diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..797f8ec9a --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,75 @@ +name: 'Build' + +env: + NODE_VERSION: '16' # Shipped with VS Code. + ARTIFACT_NAME_VSIX: vsix + VSIX_NAME: vscode-pyright.vsix + +on: + push: + tags: + - '1.1.[0-9][0-9][0-9]' + +jobs: + build: + if: github.repository == 'microsoft/pyright' + runs-on: ubuntu-latest + name: Build + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - uses: actions/setup-node@v3 + with: + node-version: ${{ env.NODE_VERSION }} + + - name: Get npm cache directory + id: npm-cache + run: | + echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT + + - uses: actions/cache@v3 + with: + path: ${{ steps.npm-cache.outputs.dir }} + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + + - run: npm run install:all + + - name: Build VSIX + working-directory: packages/vscode-pyright + run: | + npm run package + mv pyright-*.vsix ${{ env.VSIX_NAME }} + + - uses: actions/upload-artifact@v3 + with: + name: ${{ env.ARTIFACT_NAME_VSIX }} + path: packages/vscode-pyright/${{ env.VSIX_NAME }} + + create_release: + if: github.repository == 'microsoft/pyright' + runs-on: ubuntu-latest + name: Create release + needs: [build] + + steps: + - name: Download artifacts + uses: actions/download-artifact@v3 + with: + path: artifacts + + # TODO: If the release already exists (tag created via the GUI), reuse it. + - name: Create release + id: create_release + uses: ncipollo/release-action@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + name: Published ${{ github.ref_name }} + draft: true + artifacts: ./artifacts/${{ env.ARTIFACT_NAME_VSIX }}/${{ env.VSIX_NAME }} + artifactContentType: application/zip diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 75e7b311d..0595d4341 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -32,7 +32,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..77f7da9ae --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,43 @@ +name: Publish Release + +on: + release: + types: [published] + +env: + VSIX_NAME: vscode-pyright.vsix + NODE_VERSION: '16' # Shipped with VS Code. + +jobs: + publish_extension: + if: ${{ github.repository == 'microsoft/pyright' }} + runs-on: ubuntu-latest + name: Publish extension to marketplace + + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-node@v3 + with: + node-version: ${{ env.NODE_VERSION }} + + - run: npm install + + - name: Download VSIX + uses: i3h/download-release-asset@v1 + with: + owner: microsoft + repo: pyright + tag: ${{ github.event.release.tag_name }} + file: ${{ env.VSIX_NAME }} + token: ${{ secrets.GITHUB_TOKEN }} + + # https://code.visualstudio.com/api/working-with-extensions/publishing-extension + - name: Install VSCE + run: | + npm install -g "vsce@$(jq -r '.dependencies.vsce.version' < packages/vscode-pyright/package-lock.json)" + npx vsce --version + + # https://code.visualstudio.com/api/working-with-extensions/publishing-extension#get-a-personal-access-token + - name: Publish VSIX + run: npx vsce publish --packagePath ${{ env.VSIX_NAME }} --pat ${{ secrets.VSCE_TOKEN }} --noVerify diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml index 7fbe76876..17d073c69 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -18,9 +18,9 @@ jobs: name: Typecheck steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - - uses: actions/setup-node@v2-beta + - uses: actions/setup-node@v3 with: node-version: ${{ env.NODE_VERSION }} @@ -28,7 +28,7 @@ jobs: id: npm-cache run: | echo "::set-output name=dir::$(npm config get cache)" - - uses: actions/cache@v2 + - uses: actions/cache@v3 with: path: ${{ steps.npm-cache.outputs.dir }} key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} @@ -45,9 +45,9 @@ jobs: name: Style steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - - uses: actions/setup-node@v2-beta + - uses: actions/setup-node@v3 with: node-version: ${{ env.NODE_VERSION }} @@ -55,7 +55,7 @@ jobs: id: npm-cache run: | echo "::set-output name=dir::$(npm config get cache)" - - uses: actions/cache@v2 + - uses: actions/cache@v3 with: path: ${{ steps.npm-cache.outputs.dir }} key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} @@ -80,9 +80,9 @@ jobs: needs: typecheck steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - - uses: actions/setup-node@v2-beta + - uses: actions/setup-node@v3 with: node-version: ${{ env.NODE_VERSION }} @@ -93,7 +93,7 @@ jobs: id: npm-cache run: | echo "::set-output name=dir::$(npm config get cache)" - - uses: actions/cache@v2 + - uses: actions/cache@v3 if: runner.os != 'Windows' with: path: ${{ steps.npm-cache.outputs.dir }} @@ -113,9 +113,9 @@ jobs: needs: typecheck steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - - uses: actions/setup-node@v2-beta + - uses: actions/setup-node@v3 with: node-version: ${{ env.NODE_VERSION }} @@ -123,7 +123,7 @@ jobs: id: npm-cache run: | echo "::set-output name=dir::$(npm config get cache)" - - uses: actions/cache@v2 + - uses: actions/cache@v3 with: path: ${{ steps.npm-cache.outputs.dir }} key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} diff --git a/.vscode/launch.json b/.vscode/launch.json index af9d0bcc8..c7e3388fa 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -47,6 +47,25 @@ "${workspaceRoot}/packages/vscode-pyright/dist/**/*.js" ] }, + { + "name": "Pyright extension (watch)", + "type": "extensionHost", + "request": "launch", + "runtimeExecutable": "${workspaceRoot}/packages/vscode-pyright/dist/extension.js", + "preLaunchTask": "Watch extension", + "args": [ + "--extensionDevelopmentPath=${workspaceFolder}/packages/vscode-pyright", + // The published extension is named "ms-pyright.pyright", but in debug mode it's "ms-pyright.vscode-pyright" + // to allow the extension code to participate in the lerna monorepo. Make sure that the published extension + // isn't enabled, otherwise both are loaded and conflict. + "--disable-extension=ms-pyright.pyright" + ], + "smartStep": true, + "sourceMaps": true, + "outFiles": [ + "${workspaceRoot}/packages/vscode-pyright/dist/**/*.js" + ] + }, { "name": "Pyright attach server", "type": "node", diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 4c9f87646..8edf60f4a 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -18,18 +18,17 @@ "fileLocation": "absolute", "pattern": [ { - "kind": "location", - "regexp": "(ERROR|WARNING) in (.*?):(\\d+):(\\d+)", - "severity": 1, - "file": 2, - "line": 3, - "column": 4 - }, - { - "regexp": "\\s*(@typescript-eslint\\/.+):\\s*(.*)$", - "code": 1, - "message": 2 - } + "regexp": "\\[tsl\\] (ERROR|WARNING) in (.*)?\\((\\d+),(\\d+)\\)", + "severity": 1, + "file": 2, + "line": 3, + "column": 4 + }, + { + "regexp": "\\s*TS(\\d+):\\s*(.*)$", + "code": 1, + "message": 2 + } ], "background": { "activeOnStart": true, diff --git a/build/checkLockIndent.js b/build/checkLockIndent.js index e2dceaf6c..74175bf12 100644 --- a/build/checkLockIndent.js +++ b/build/checkLockIndent.js @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-var-requires */ //@ts-check -// Lerna doesn't do a good job preserving the indention in lock files. +// Lerna doesn't do a good job preserving the indentation in lock files. // Check that the lock files are still indented correctly, otherwise // the change will cause problems with merging and the updateDeps script. diff --git a/build/skipBootstrap.js b/build/skipBootstrap.js index e24bffe1d..e55fcf246 100644 --- a/build/skipBootstrap.js +++ b/build/skipBootstrap.js @@ -2,7 +2,7 @@ // This can be used to write npm script like: // node ./build/skipBootstrap.js || lerna bootstrap // Which means "skip lerna bootstrap if SKIP_LERNA_BOOTSTRAP is set". -// This prevents suprious bootstraps in nested lerna repos. +// This prevents spurious bootstraps in nested lerna repos. if (!process.env.SKIP_LERNA_BOOTSTRAP) { process.exit(1); diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/mypy/__init__.pyi b/docs/.nojekyll similarity index 100% rename from packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/mypy/__init__.pyi rename to docs/.nojekyll diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 000000000..fef7c1866 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,9 @@ +![Pyright](img/PyrightLarge.png) + +# Static type checker for Python + +Pyright is a full-featured, standards-based static type checker for Python. It is designed for high performance and can be used with large Python source bases. + +Pyright includes both a [command-line tool](command-line.md) and an [extension for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=ms-pyright.pyright). + + diff --git a/docs/_navbar.md b/docs/_navbar.md new file mode 100644 index 000000000..2908aaca9 --- /dev/null +++ b/docs/_navbar.md @@ -0,0 +1 @@ +[Github Site](https://github.com/Microsoft/pyright) diff --git a/docs/_sidebar.md b/docs/_sidebar.md new file mode 100644 index 000000000..77b49176b --- /dev/null +++ b/docs/_sidebar.md @@ -0,0 +1,39 @@ +- Getting Started + + - [Installing Pyright](installation.md) + - [Getting Started](getting-started.md) + - [Static Typing](type-concepts.md) + - [Features](features.md) + +- Customization + + - [Configuration](configuration.md) + - [Configuration Options](configuration.md#main-configuration-options) + - [Diagnostic Rules](configuration.md#type-check-diagnostics-settings) + - [Execution Environments](configuration.md#execution-environment-options) + - [Sample pyrightconfig.json](configuration.md#sample-config-file) + - [Sample pyproject.toml](configuration.md#sample-pyprojecttoml-file) + - [Diagnostic Rule Defaults](configuration.md#diagnostic-rule-defaults) + - [Language Server Settings](settings.md) + - [Command Line Interface](command-line.md) + - [Controlling Behavior With Comments](comments.md) + - [Continuous Integration](ci-integration.md) + +- Usage + + - [Advanced Type Concepts](type-concepts-advanced.md) + - [Type Inference](type-inference.md) + - [Import Statements](import-statements.md) + - [Import Resolution](import-resolution.md) + - [Extending Builtins](builtins.md) + - [Type Stubs](type-stubs.md) + - [Types in Libraries](typed-libraries.md) + - [Differences from Mypy](mypy-comparison.md) + - [Commands](commands.md) + +- Development + + - [Building & Debugging](build-debug.md) + - [Pyright Internals](internals.md) + + diff --git a/docs/build-debug.md b/docs/build-debug.md index bee13e5da..101d4364b 100644 --- a/docs/build-debug.md +++ b/docs/build-debug.md @@ -1,9 +1,9 @@ ## Building Pyright To install the dependencies for all packages in the repo: -1. Install [nodejs](https://nodejs.org/en/) version 14.x +1. Install [nodejs](https://nodejs.org/en/) version 16.x 2. Open terminal window in main directory of cloned source -3. Execute `npm install` to install dependencies +3. Execute `npm run install:all` to install dependencies for projects and sub-projects ## Building the CLI diff --git a/docs/builtins.md b/docs/builtins.md index 3aadb27ea..090a4afd2 100644 --- a/docs/builtins.md +++ b/docs/builtins.md @@ -1,4 +1,4 @@ -# Extending Builtins +## Extending Builtins The Python interpreter implicitly adds a set of symbols that are available within every module even though they are not explicitly imported. These so-called “built in” symbols include commonly-used types and functions such as “list”, “dict”, “int”, “float”, “min”, and “len”. diff --git a/docs/ci-integration.md b/docs/ci-integration.md index b89350407..cf31c87c3 100644 --- a/docs/ci-integration.md +++ b/docs/ci-integration.md @@ -1,4 +1,4 @@ -## Integrating Pyright into Continuous Integration (CI) +## Integrating Pyright into Continuous Integration ### Running Pyright as a github action @@ -12,26 +12,34 @@ You can configure pyright to run as a github action. Refer to the [pyright-action project](https://github.com/jakebailey/pyright-action) for more options. -### Running Pyright as a pre-commit hook +### Running Pyright in gitlab (with code-quality review) -If you do not use github, the following git hook will also work. +You can configure pyright to run in gitlab, and generate a compatible codequality report. ```yml -- repo: local - hooks: - - id: pyright - name: pyright - entry: pyright - language: node - pass_filenames: false - types: [python] - # Replace the version below with the latest pyright version - additional_dependencies: ['pyright@1.1.XXX'] +job_name: + before_script: + - npm i -g pyright + - npm i -g pyright-to-gitlab-ci + script: + - pyright --outputjson > report_raw.json + - pyright-to-gitlab-ci --src report_raw.json --output report.json --base_path . + artifacts: + paths: + - report.json + reports: + codequality: report.json ``` +Refer to the [pyright-to-gitlab-ci](https://www.npmjs.com/package/pyright-to-gitlab-ci) package for more details. + +### Running Pyright as a pre-commit hook + +You can run pyright as a pre-commit hook using the community-maintained [Python wrapper for pyright](https://github.com/RobertCraigie/pyright-python). For pre-commit configuration instructions, refer to [this documentation](https://github.com/RobertCraigie/pyright-python#pre-commit). + ### Running Pyright from a CI script -Alternatively, you can run pyright from a bash script. Here's a script that installs the latest version of pyright and runs it. +You can run pyright from a bash script. Here's a sample script that installs the latest version of pyright and runs it. ```bash #!/bin/bash diff --git a/docs/command-line.md b/docs/command-line.md index 5ee828119..1b7235494 100644 --- a/docs/command-line.md +++ b/docs/command-line.md @@ -11,6 +11,7 @@ Pyright can be run as either a VS Code extension or as a node-based command-line | -h, --help | Show help message | | --ignoreexternal | Ignore external imports for --verifytypes | | --lib | Use library code for types when stubs are missing | +| --level | Minimum diagnostic level (error or warning) | | --outputjson | Output results in JSON format | | -p, --project `` | Use the configuration file at this location | | --pythonplatform `` | Analyze for platform (Darwin, Linux, Windows) | @@ -29,7 +30,7 @@ Pyright can be run as either a VS Code extension or as a node-based command-line (2) Pyright has built-in typeshed type stubs for Python stdlib functionality. To use a different version of typeshed type stubs, specify the directory with this option. -(3) This option is used in conjunction with configuration file, which can refer to different virtual environments by name. For more details, refer to the [configuration](/docs/configuration.md) documentation. This allows a common config file to be checked in to the project and shared by everyone on the development team without making assumptions about the local paths to the venv directory on each developer’s computer. +(3) This option is used in conjunction with configuration file, which can refer to different virtual environments by name. For more details, refer to the [configuration](configuration.md) documentation. This allows a common config file to be checked in to the project and shared by everyone on the development team without making assumptions about the local paths to the venv directory on each developer’s computer. (4) When running in watch mode, pyright will reanalyze only those files that have been modified. These “deltas” are typically much faster than the initial analysis, which needs to analyze all files in the source tree. diff --git a/docs/commands.md b/docs/commands.md index 5ca235c92..502887fb7 100644 --- a/docs/commands.md +++ b/docs/commands.md @@ -1,11 +1,11 @@ -# VS Code Commands +## VS Code Commands Pyright offers the following commands, which can be invoked from VS Code’s “Command Palette”, which can be accessed from the View menu or by pressing Cmd-Shift-P. -## Organize Imports +### Organize Imports This command reorders all imports found in the global (module-level) scope of the source file. As recommended in PEP8, imports are grouped into three groups, each separated by an empty line. The first group includes all built-in modules, the second group includes all third-party modules, and the third group includes all local modules. Within each group, imports are sorted alphabetically. And within each “from X import Y” statement, the imported symbols are sorted alphabetically. Pyright also rewraps any imports that don't fit within a single line, switching to multi-line formatting. -## Restart Server +### Restart Server This command forces the type checker to discard all of its cached type information and restart analysis. It is useful in cases where new type stubs or libraries have been installed. diff --git a/docs/comments.md b/docs/comments.md index 2d701c235..0113b8f9b 100644 --- a/docs/comments.md +++ b/docs/comments.md @@ -1,26 +1,15 @@ -# Comments +## Comments Some behaviors of pyright can be controlled through the use of comments within the source file. -## Type Annotations -Versions of Python prior to 3.6 did not support type annotations for variables. Pyright honors type annotations found within a comment at the end of the same line where a variable is assigned. - -```python -offsets = [] # type: List[int] - -self._target = 3 # type: Union[int, str] -``` - -Future versions of Python will likely deprecate support for type annotation comments. The “reportTypeCommentUsage” diagnostic will report usage of such comments so they can be replaced with inline type annotations. - -## File-level Type Controls +### File-level Type Controls Strict type checking, where most supported type-checking switches generate errors, can be enabled for a file through the use of a special comment. Typically this comment is placed at or near the top of a code file on its own line. ```python # pyright: strict ``` -Likewise, basic type checking can be enabled for a file. +Likewise, basic type checking can be enabled for a file. If you use `# pyright: basic`, the settings for the file use the default “basic” settings, not any override settings specified in the configuration file or language server settings. You can override the basic default settings within the file by specifying them individually (see below). ```python # pyright: basic @@ -38,7 +27,8 @@ Diagnostic levels are also supported. # pyright: reportPrivateUsage=warning, reportOptionalCall=error ``` -## Line-level Diagnostic Suppression + +### Line-level Diagnostic Suppression PEP 484 defines a special comment `# type: ignore` that can be used at the end of a line to suppress all diagnostics emitted by a type checker on that line. Pyright supports this mechanism. diff --git a/docs/configuration.md b/docs/configuration.md index a39088bb4..a0e8f0c37 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -1,22 +1,22 @@ -# Pyright Configuration +## Pyright Configuration -Pyright offers flexible configuration options specified in a JSON-formatted text configuration. By default, the file is called “pyrightconfig.json” and is located within the root directory of your project. Multi-root workspaces (“Add Folder to Workspace…”) are supported, and each workspace root can have its own “pyrightconfig.json” file. For a sample pyrightconfig.json file, see [below](https://github.com/microsoft/pyright/blob/main/docs/configuration.md#sample-config-file). +Pyright offers flexible configuration options specified in a JSON-formatted text configuration. By default, the file is called “pyrightconfig.json” and is located within the root directory of your project. Multi-root workspaces (“Add Folder to Workspace…”) are supported, and each workspace root can have its own “pyrightconfig.json” file. For a sample pyrightconfig.json file, see [below](configuration.md#sample-config-file). -Pyright settings can also be specified in a `[tool.pyright]` section of a “pyproject.toml” file. A “pyrightconfig.json” file always takes precedent over “pyproject.toml” if both are present. For a sample pyproject.toml file, see [below](https://github.com/microsoft/pyright/blob/main/docs/configuration.md#sample-pyprojecttoml-file). +Pyright settings can also be specified in a `[tool.pyright]` section of a “pyproject.toml” file. A “pyrightconfig.json” file always takes precedent over “pyproject.toml” if both are present. For a sample pyproject.toml file, see [below](configuration.md#sample-pyprojecttoml-file). Relative paths specified within the config file are relative to the config file’s location. Paths with shell variables (including `~`) are not supported. Paths within a the config file should generally be relative paths so the config file can be shared by other developers who contribute to the project. -## Main Pyright Config Options +## Main Configuration Options **include** [array of paths, optional]: Paths of directories or files that should be included. If no paths are specified, pyright defaults to the directory that contains the config file. Paths may contain wildcard characters ** (a directory or multiple levels of directories), * (a sequence of zero or more characters), or ? (a single character). If no include paths are specified, the root path for the workspace is assumed. -**exclude** [array of paths, optional]: Paths of directories or files that should not be included. These override the includes directories, allowing specific subdirectories to be ignored. Note that files in the exclude paths may still be included in the analysis if they are referenced (imported) by source files that are not excluded. Paths may contain wildcard characters ** (a directory or multiple levels of directories), * (a sequence of zero or more characters), or ? (a single character). If no exclude paths are specified, Pyright automatically excludes the following: `**/node_modules`, `**/__pycache__`, `.git` and any virtual environment directories. +**exclude** [array of paths, optional]: Paths of directories or files that should not be included. These override the includes directories, allowing specific subdirectories to be ignored. Note that files in the exclude paths may still be included in the analysis if they are referenced (imported) by source files that are not excluded. Paths may contain wildcard characters ** (a directory or multiple levels of directories), * (a sequence of zero or more characters), or ? (a single character). If no exclude paths are specified, Pyright automatically excludes the following: `**/node_modules`, `**/__pycache__`, `**/.*` and any virtual environment directories. **ignore** [array of paths, optional]: Paths of directories or files whose diagnostic output (errors and warnings) should be suppressed even if they are an included file or within the transitive closure of an included file. Paths may contain wildcard characters ** (a directory or multiple levels of directories), * (a sequence of zero or more characters), or ? (a single character). -**strict** [array of paths, optional]: Paths of directories or files that should use “strict” analysis if they are included. This is the same as manually adding a “# pyright: strict” comment. In strict mode, most type-checking rules are enabled. Refer to [this table](https://github.com/microsoft/pyright/blob/main/docs/configuration.md#diagnostic-rule-defaults) for details about which rules are enabled in strict mode. Paths may contain wildcard characters ** (a directory or multiple levels of directories), * (a sequence of zero or more characters), or ? (a single character). +**strict** [array of paths, optional]: Paths of directories or files that should use “strict” analysis if they are included. This is the same as manually adding a “# pyright: strict” comment. In strict mode, most type-checking rules are enabled. Refer to [this table](configuration.md#diagnostic-rule-defaults) for details about which rules are enabled in strict mode. Paths may contain wildcard characters ** (a directory or multiple levels of directories), * (a sequence of zero or more characters), or ? (a single character). -**defineConstant** [map of constants to values (boolean or string), optional]: Set of identifiers that should be assumed to contain a constant value wherever used within this program. For example, `{ "DEBUG": true }` indicates that pyright should assume that the identifier `DEBUG` will always be equal to `True`. If this identifier is used within a conditional expression (such as `if not DEBUG:`) pyright will use the indicated value to determine whether the guarded block is reachable or not. +**defineConstant** [map of constants to values (boolean or string), optional]: Set of identifiers that should be assumed to contain a constant value wherever used within this program. For example, `{ "DEBUG": true }` indicates that pyright should assume that the identifier `DEBUG` will always be equal to `True`. If this identifier is used within a conditional expression (such as `if not DEBUG:`) pyright will use the indicated value to determine whether the guarded block is reachable or not. Member expressions that reference one of these constants (e.g. `my_module.DEBUG`) are also supported. **typeshedPath** [path, optional]: Path to a directory that contains typeshed type stub files. Pyright ships with a bundled copy of typeshed type stubs. If you want to use a different version of typeshed stubs, you can clone the [typeshed github repo](https://github.com/python/typeshed) to a local directory and reference the location with this path. This option is useful if you’re actively contributing updates to typeshed. @@ -34,7 +34,7 @@ Relative paths specified within the config file are relative to the config file **pythonPlatform** [string, optional]: Specifies the target platform that will be used to execute the source code. Should be one of `"Windows"`, `"Darwin"`, `"Linux"`, or `"All"`. If specified, pyright will tailor its use of type stub files, which conditionalize type definitions based on the platform. If no platform is specified, pyright will use the current platform. -**executionEnvironments** [array of objects, optional]: Specifies a list of execution environments (see [below](https://github.com/microsoft/pyright/blob/main/docs/configuration.md#execution-environment-options)). Execution environments are searched from start to finish by comparing the path of a source file with the root path specified in the execution environment. +**executionEnvironments** [array of objects, optional]: Specifies a list of execution environments (see [below](configuration.md#execution-environment-options)). Execution environments are searched from start to finish by comparing the path of a source file with the root path specified in the execution environment. **typeCheckingMode** ["off", "basic", "strict"]: Specifies the default rule set to use. Some rules can be overridden using additional configuration flags documented below. The default value for this setting is "basic". If set to "off", all type-checking rules are disabled, but Python syntax and semantic errors are still reported. @@ -44,138 +44,145 @@ Relative paths specified within the config file are relative to the config file ## Type Check Diagnostics Settings The following settings control pyright’s diagnostic output (warnings or errors). Unless otherwise specified, each diagnostic setting can specify a boolean value (`false` indicating that no error is generated and `true` indicating that an error is generated). Alternatively, a string value of `"none"`, `"warning"`, `"information"`, or `"error"` can be used to specify the diagnostic level. -**strictListInference** [boolean]: When inferring the type of a list, use strict type assumptions. For example, the expression `[1, 'a', 3.4]` could be inferred to be of type `List[Any]` or `List[Union[int, str, float]]`. If this setting is true, it will use the latter (stricter) type. The default value for this setting is 'false'. + **strictListInference** [boolean]: When inferring the type of a list, use strict type assumptions. For example, the expression `[1, 'a', 3.4]` could be inferred to be of type `list[Any]` or `list[int | str | float]`. If this setting is true, it will use the latter (stricter) type. The default value for this setting is `false`. -**strictDictionaryInference** [boolean]: When inferring the type of a dictionary’s keys and values, use strict type assumptions. For example, the expression `{'a': 1, 'b': 'a'}` could be inferred to be of type `Dict[str, Any]` or `Dict[str, Union[int, str]]`. If this setting is true, it will use the latter (stricter) type. The default value for this setting is 'false'. + **strictDictionaryInference** [boolean]: When inferring the type of a dictionary’s keys and values, use strict type assumptions. For example, the expression `{'a': 1, 'b': 'a'}` could be inferred to be of type `dict[str, Any]` or `dict[str, int | str]`. If this setting is true, it will use the latter (stricter) type. The default value for this setting is `false`. -**strictSetInference** [boolean]: When inferring the type of a set, use strict type assumptions. For example, the expression `{1, 'a', 3.4}` could be inferred to be of type `Set[Any]` or `Set[Union[int, str, float]]`. If this setting is true, it will use the latter (stricter) type. The default value for this setting is 'false'. + **strictSetInference** [boolean]: When inferring the type of a set, use strict type assumptions. For example, the expression `{1, 'a', 3.4}` could be inferred to be of type `set[Any]` or `set[int | str | float]`. If this setting is true, it will use the latter (stricter) type. The default value for this setting is `false`. -**strictParameterNoneValue** [boolean]: PEP 484 indicates that when a function parameter is assigned a default value of None, its type should implicitly be Optional even if the explicit type is not. When enabled, this rule requires that parameter type annotations use Optional explicitly in this case. The default value for this setting is 'true'. + **analyzeUnannotatedFunctions** [boolean]: Analyze and report errors for functions and methods that have no type annotations for input parameters or return types. The default value for this setting is `true`. -**enableTypeIgnoreComments** [boolean]: PEP 484 defines support for "# type: ignore" comments. This switch enables or disables support for these comments. The default value for this setting is 'true'. This does not affect "# pyright: ignore" comments. + **strictParameterNoneValue** [boolean]: PEP 484 indicates that when a function parameter is assigned a default value of None, its type should implicitly be Optional even if the explicit type is not. When enabled, this rule requires that parameter type annotations use Optional explicitly in this case. The default value for this setting is `true`. -**reportGeneralTypeIssues** [boolean or string, optional]: Generate or suppress diagnostics for general type inconsistencies, unsupported operations, argument/parameter mismatches, etc. This covers all of the basic type-checking rules not covered by other rules. It does not include syntax errors. The default value for this setting is 'error'. + **enableTypeIgnoreComments** [boolean]: PEP 484 defines support for "# type: ignore" comments. This switch enables or disables support for these comments. The default value for this setting is `true`. This does not affect "# pyright: ignore" comments. -**reportPropertyTypeMismatch** [boolean or string, optional]: Generate or suppress diagnostics for properties where the type of the value passed to the setter is not assignable to the value returned by the getter. Such mismatches violate the intended use of properties, which are meant to act like variables. The default value for this setting is 'none'. + **reportGeneralTypeIssues** [boolean or string, optional]: Generate or suppress diagnostics for general type inconsistencies, unsupported operations, argument/parameter mismatches, etc. This covers all of the basic type-checking rules not covered by other rules. It does not include syntax errors. The default value for this setting is `"error"`. -**reportFunctionMemberAccess** [boolean or string, optional]: Generate or suppress diagnostics for non-standard member accesses for functions. The default value for this setting is 'none'. + **reportPropertyTypeMismatch** [boolean or string, optional]: Generate or suppress diagnostics for properties where the type of the value passed to the setter is not assignable to the value returned by the getter. Such mismatches violate the intended use of properties, which are meant to act like variables. The default value for this setting is `"none"`. -**reportMissingImports** [boolean or string, optional]: Generate or suppress diagnostics for imports that have no corresponding imported python file or type stub file. The default value for this setting is 'error'. + **reportFunctionMemberAccess** [boolean or string, optional]: Generate or suppress diagnostics for non-standard member accesses for functions. The default value for this setting is `"none"`. -**reportMissingModuleSource** [boolean or string, optional]: Generate or suppress diagnostics for imports that have no corresponding source file. This happens when a type stub is found, but the module source file was not found, indicating that the code may fail at runtime when using this execution environment. Type checking will be done using the type stub. The default value for this setting is 'warning'. + **reportMissingImports** [boolean or string, optional]: Generate or suppress diagnostics for imports that have no corresponding imported python file or type stub file. The default value for this setting is `"error"`. -**reportMissingTypeStubs** [boolean or string, optional]: Generate or suppress diagnostics for imports that have no corresponding type stub file (either a typeshed file or a custom type stub). The type checker requires type stubs to do its best job at analysis. The default value for this setting is 'none'. Note that there is a corresponding quick fix for this diagnostics that let you generate custom type stub to improve editing experiences. + **reportMissingModuleSource** [boolean or string, optional]: Generate or suppress diagnostics for imports that have no corresponding source file. This happens when a type stub is found, but the module source file was not found, indicating that the code may fail at runtime when using this execution environment. Type checking will be done using the type stub. The default value for this setting is `"warning"`. -**reportImportCycles** [boolean or string, optional]: Generate or suppress diagnostics for cyclical import chains. These are not errors in Python, but they do slow down type analysis and often hint at architectural layering issues. Generally, they should be avoided. The default value for this setting is 'none'. Note that there are import cycles in the typeshed stdlib typestub files that are ignored by this setting. + **reportMissingTypeStubs** [boolean or string, optional]: Generate or suppress diagnostics for imports that have no corresponding type stub file (either a typeshed file or a custom type stub). The type checker requires type stubs to do its best job at analysis. The default value for this setting is `"none"`. Note that there is a corresponding quick fix for this diagnostics that let you generate custom type stub to improve editing experiences. -**reportUnusedImport** [boolean or string, optional]: Generate or suppress diagnostics for an imported symbol that is not referenced within that file. The default value for this setting is 'none'. + **reportImportCycles** [boolean or string, optional]: Generate or suppress diagnostics for cyclical import chains. These are not errors in Python, but they do slow down type analysis and often hint at architectural layering issues. Generally, they should be avoided. The default value for this setting is `"none"`. Note that there are import cycles in the typeshed stdlib typestub files that are ignored by this setting. -**reportUnusedClass** [boolean or string, optional]: Generate or suppress diagnostics for a class with a private name (starting with an underscore) that is not accessed. The default value for this setting is 'none'. + **reportUnusedImport** [boolean or string, optional]: Generate or suppress diagnostics for an imported symbol that is not referenced within that file. The default value for this setting is `"none"`. -**reportUnusedFunction** [boolean or string, optional]: Generate or suppress diagnostics for a function or method with a private name (starting with an underscore) that is not accessed. The default value for this setting is 'none'. + **reportUnusedClass** [boolean or string, optional]: Generate or suppress diagnostics for a class with a private name (starting with an underscore) that is not accessed. The default value for this setting is `"none"`. -**reportUnusedVariable** [boolean or string, optional]: Generate or suppress diagnostics for a variable that is not accessed. The default value for this setting is 'none'. Variables whose names begin with an underscore are exempt from this check. + **reportUnusedFunction** [boolean or string, optional]: Generate or suppress diagnostics for a function or method with a private name (starting with an underscore) that is not accessed. The default value for this setting is `"none"`. -**reportDuplicateImport** [boolean or string, optional]: Generate or suppress diagnostics for an imported symbol or module that is imported more than once. The default value for this setting is 'none'. + **reportUnusedVariable** [boolean or string, optional]: Generate or suppress diagnostics for a variable that is not accessed. The default value for this setting is `"none"`. Variables whose names begin with an underscore are exempt from this check. -**reportWildcardImportFromLibrary** [boolean or string, optional]: Generate or suppress diagnostics for a wildcard import from an external library. The use of this language feature is highly discouraged and can result in bugs when the library is updated. The default value for this setting is 'warning'. + **reportDuplicateImport** [boolean or string, optional]: Generate or suppress diagnostics for an imported symbol or module that is imported more than once. The default value for this setting is `"none"`. -**reportOptionalSubscript** [boolean or string, optional]: Generate or suppress diagnostics for an attempt to subscript (index) a variable with an Optional type. The default value for this setting is 'error'. + **reportWildcardImportFromLibrary** [boolean or string, optional]: Generate or suppress diagnostics for a wildcard import from an external library. The use of this language feature is highly discouraged and can result in bugs when the library is updated. The default value for this setting is `"warning"`. -**reportOptionalMemberAccess** [boolean or string, optional]: Generate or suppress diagnostics for an attempt to access a member of a variable with an Optional type. The default value for this setting is 'error'. + **reportOptionalSubscript** [boolean or string, optional]: Generate or suppress diagnostics for an attempt to subscript (index) a variable with an Optional type. The default value for this setting is `"error"`. -**reportOptionalCall** [boolean or string, optional]: Generate or suppress diagnostics for an attempt to call a variable with an Optional type. The default value for this setting is 'error'. + **reportOptionalMemberAccess** [boolean or string, optional]: Generate or suppress diagnostics for an attempt to access a member of a variable with an Optional type. The default value for this setting is `"error"`. -**reportOptionalIterable** [boolean or string, optional]: Generate or suppress diagnostics for an attempt to use an Optional type as an iterable value (e.g. within a `for` statement). The default value for this setting is 'error'. + **reportOptionalCall** [boolean or string, optional]: Generate or suppress diagnostics for an attempt to call a variable with an Optional type. The default value for this setting is `"error"`. -**reportOptionalContextManager** [boolean or string, optional]: Generate or suppress diagnostics for an attempt to use an Optional type as a context manager (as a parameter to a `with` statement). The default value for this setting is 'error'. + **reportOptionalIterable** [boolean or string, optional]: Generate or suppress diagnostics for an attempt to use an Optional type as an iterable value (e.g. within a `for` statement). The default value for this setting is `"error"`. -**reportOptionalOperand** [boolean or string, optional]: Generate or suppress diagnostics for an attempt to use an Optional type as an operand to a binary or unary operator (like '+', '==', 'or', 'not'). The default value for this setting is 'error'. + **reportOptionalContextManager** [boolean or string, optional]: Generate or suppress diagnostics for an attempt to use an Optional type as a context manager (as a parameter to a `with` statement). The default value for this setting is `"error"`. -**reportTypedDictNotRequiredAccess** [boolean or string, optional]: Generate or suppress diagnostics for an attempt to access a non-required field within a TypedDict without first checking whether it is present. The default value for this setting is 'error'. + **reportOptionalOperand** [boolean or string, optional]: Generate or suppress diagnostics for an attempt to use an Optional type as an operand to a binary or unary operator (like `+`, `==`, `or`, `not`). The default value for this setting is `"error"`. -**reportUntypedFunctionDecorator** [boolean or string, optional]: Generate or suppress diagnostics for function decorators that have no type annotations. These obscure the function type, defeating many type analysis features. The default value for this setting is 'none'. + **reportTypedDictNotRequiredAccess** [boolean or string, optional]: Generate or suppress diagnostics for an attempt to access a non-required field within a TypedDict without first checking whether it is present. The default value for this setting is `"error"`. -**reportUntypedClassDecorator** [boolean or string, optional]: Generate or suppress diagnostics for class decorators that have no type annotations. These obscure the class type, defeating many type analysis features. The default value for this setting is 'none'. + **reportUntypedFunctionDecorator** [boolean or string, optional]: Generate or suppress diagnostics for function decorators that have no type annotations. These obscure the function type, defeating many type analysis features. The default value for this setting is `"none"`. -**reportUntypedBaseClass** [boolean or string, optional]: Generate or suppress diagnostics for base classes whose type cannot be determined statically. These obscure the class type, defeating many type analysis features. The default value for this setting is 'none'. + **reportUntypedClassDecorator** [boolean or string, optional]: Generate or suppress diagnostics for class decorators that have no type annotations. These obscure the class type, defeating many type analysis features. The default value for this setting is `"none"`. -**reportUntypedNamedTuple** [boolean or string, optional]: Generate or suppress diagnostics when “namedtuple” is used rather than “NamedTuple”. The former contains no type information, whereas the latter does. The default value for this setting is 'none'. + **reportUntypedBaseClass** [boolean or string, optional]: Generate or suppress diagnostics for base classes whose type cannot be determined statically. These obscure the class type, defeating many type analysis features. The default value for this setting is `"none"`. -**reportPrivateUsage** [boolean or string, optional]: Generate or suppress diagnostics for incorrect usage of private or protected variables or functions. Protected class members begin with a single underscore (“_”) and can be accessed only by subclasses. Private class members begin with a double underscore but do not end in a double underscore and can be accessed only within the declaring class. Variables and functions declared outside of a class are considered private if their names start with either a single or double underscore, and they cannot be accessed outside of the declaring module. The default value for this setting is 'none'. + **reportUntypedNamedTuple** [boolean or string, optional]: Generate or suppress diagnostics when “namedtuple” is used rather than “NamedTuple”. The former contains no type information, whereas the latter does. The default value for this setting is `"none"`. -**reportTypeCommentUsage** [boolean or string, optional]: Prior to Python 3.5, the grammar did not support type annotations, so types needed to be specified using “type comments”. Python 3.5 eliminated the need for function type comments, and Python 3.6 eliminated the need for variable type comments. Future versions of Python will likely deprecate all support for type comments. If enabled, this check will flag any type comment usage unless it is required for compatibility with the specified language version. The default value for this setting is 'none'. + **reportPrivateUsage** [boolean or string, optional]: Generate or suppress diagnostics for incorrect usage of private or protected variables or functions. Protected class members begin with a single underscore (“_”) and can be accessed only by subclasses. Private class members begin with a double underscore but do not end in a double underscore and can be accessed only within the declaring class. Variables and functions declared outside of a class are considered private if their names start with either a single or double underscore, and they cannot be accessed outside of the declaring module. The default value for this setting is `"none"`. -**reportPrivateImportUsage** [boolean or string, optional]: Generate or suppress diagnostics for use of a symbol from a "py.typed" module that is not meant to be exported from that module. The default value for this setting is 'error'. + **reportTypeCommentUsage** [boolean or string, optional]: Prior to Python 3.5, the grammar did not support type annotations, so types needed to be specified using “type comments”. Python 3.5 eliminated the need for function type comments, and Python 3.6 eliminated the need for variable type comments. Future versions of Python will likely deprecate all support for type comments. If enabled, this check will flag any type comment usage unless it is required for compatibility with the specified language version. The default value for this setting is `"none"`. -**reportConstantRedefinition** [boolean or string, optional]: Generate or suppress diagnostics for attempts to redefine variables whose names are all-caps with underscores and numerals. The default value for this setting is 'none'. + **reportPrivateImportUsage** [boolean or string, optional]: Generate or suppress diagnostics for use of a symbol from a "py.typed" module that is not meant to be exported from that module. The default value for this setting is `"error"`. -**reportIncompatibleMethodOverride** [boolean or string, optional]: Generate or suppress diagnostics for methods that override a method of the same name in a base class in an incompatible manner (wrong number of parameters, incompatible parameter types, or incompatible return type). The default value for this setting is 'none'. + **reportConstantRedefinition** [boolean or string, optional]: Generate or suppress diagnostics for attempts to redefine variables whose names are all-caps with underscores and numerals. The default value for this setting is `"none"`. -**reportIncompatibleVariableOverride** [boolean or string, optional]: Generate or suppress diagnostics for class variable declarations that override a symbol of the same name in a base class with a type that is incompatible with the base class symbol type. The default value for this setting is 'none'. + **reportDeprecated** [boolean or string, optional]: Generate or suppress diagnostics for use of a class or function that has been marked as deprecated. The default value for this setting is `"none"`. -**reportInconsistentConstructor** [boolean or string, optional]: Generate or suppress diagnostics when an `__init__` method signature is inconsistent with a `__new__` signature. The default value for this setting is 'none'. + **reportIncompatibleMethodOverride** [boolean or string, optional]: Generate or suppress diagnostics for methods that override a method of the same name in a base class in an incompatible manner (wrong number of parameters, incompatible parameter types, or incompatible return type). The default value for this setting is `"none"`. -**reportOverlappingOverload** [boolean or string, optional]: Generate or suppress diagnostics for function overloads that overlap in signature and obscure each other or have incompatible return types. The default value for this setting is 'none'. + **reportIncompatibleVariableOverride** [boolean or string, optional]: Generate or suppress diagnostics for class variable declarations that override a symbol of the same name in a base class with a type that is incompatible with the base class symbol type. The default value for this setting is `"none"`. -**reportMissingSuperCall** [boolean or string, optional]: Generate or suppress diagnostics for `__init__`, `__init_subclass__`, `__enter__` and `__exit__` methods in a subclass that fail to call through to the same-named method on a base class. The default value for this setting is 'none'. + **reportInconsistentConstructor** [boolean or string, optional]: Generate or suppress diagnostics when an `__init__` method signature is inconsistent with a `__new__` signature. The default value for this setting is `"none"`. -**reportUninitializedInstanceVariable** [boolean or string, optional]: Generate or suppress diagnostics for instance variables within a class that are not initialized or declared within the class body or the `__init__` method. The default value for this setting is 'none'. + **reportOverlappingOverload** [boolean or string, optional]: Generate or suppress diagnostics for function overloads that overlap in signature and obscure each other or have incompatible return types. The default value for this setting is `"none"`. -**reportInvalidStringEscapeSequence** [boolean or string, optional]: Generate or suppress diagnostics for invalid escape sequences used within string literals. The Python specification indicates that such sequences will generate a syntax error in future versions. The default value for this setting is 'warning'. + **reportMissingSuperCall** [boolean or string, optional]: Generate or suppress diagnostics for `__init__`, `__init_subclass__`, `__enter__` and `__exit__` methods in a subclass that fail to call through to the same-named method on a base class. The default value for this setting is `"none"`. -**reportUnknownParameterType** [boolean or string, optional]: Generate or suppress diagnostics for input or return parameters for functions or methods that have an unknown type. The default value for this setting is 'none'. + **reportUninitializedInstanceVariable** [boolean or string, optional]: Generate or suppress diagnostics for instance variables within a class that are not initialized or declared within the class body or the `__init__` method. The default value for this setting is `"none"`. -**reportUnknownArgumentType** [boolean or string, optional]: Generate or suppress diagnostics for call arguments for functions or methods that have an unknown type. The default value for this setting is 'none'. + **reportInvalidStringEscapeSequence** [boolean or string, optional]: Generate or suppress diagnostics for invalid escape sequences used within string literals. The Python specification indicates that such sequences will generate a syntax error in future versions. The default value for this setting is `"warning"`. -**reportUnknownLambdaType** [boolean or string, optional]: Generate or suppress diagnostics for input or return parameters for lambdas that have an unknown type. The default value for this setting is 'none'. + **reportUnknownParameterType** [boolean or string, optional]: Generate or suppress diagnostics for input or return parameters for functions or methods that have an unknown type. The default value for this setting is `"none"`. -**reportUnknownVariableType** [boolean or string, optional]: Generate or suppress diagnostics for variables that have an unknown type. The default value for this setting is 'none'. + **reportUnknownArgumentType** [boolean or string, optional]: Generate or suppress diagnostics for call arguments for functions or methods that have an unknown type. The default value for this setting is `"none"`. -**reportUnknownMemberType** [boolean or string, optional]: Generate or suppress diagnostics for class or instance variables that have an unknown type. The default value for this setting is 'none'. + **reportUnknownLambdaType** [boolean or string, optional]: Generate or suppress diagnostics for input or return parameters for lambdas that have an unknown type. The default value for this setting is `"none"`. -**reportMissingParameterType** [boolean or string, optional]: Generate or suppress diagnostics for input parameters for functions or methods that are missing a type annotation. The 'self' and 'cls' parameters used within methods are exempt from this check. The default value for this setting is 'none'. + **reportUnknownVariableType** [boolean or string, optional]: Generate or suppress diagnostics for variables that have an unknown type. The default value for this setting is `"none"`. -**reportMissingTypeArgument** [boolean or string, optional]: Generate or suppress diagnostics when a generic class is used without providing explicit or implicit type arguments. The default value for this setting is 'none'. + **reportUnknownMemberType** [boolean or string, optional]: Generate or suppress diagnostics for class or instance variables that have an unknown type. The default value for this setting is `"none"`. -**reportInvalidTypeVarUse** [boolean or string, optional]: Generate or suppress diagnostics when a TypeVar is used inappropriately (e.g. if a TypeVar appears only once) within a generic function signature. The default value for this setting is 'warning'. + **reportMissingParameterType** [boolean or string, optional]: Generate or suppress diagnostics for input parameters for functions or methods that are missing a type annotation. The `self` and `cls` parameters used within methods are exempt from this check. The default value for this setting is `"none"`. -**reportCallInDefaultInitializer** [boolean or string, optional]: Generate or suppress diagnostics for function calls, list expressions, set expressions, or dictionary expressions within a default value initialization expression. Such calls can mask expensive operations that are performed at module initialization time. The default value for this setting is 'none'. + **reportMissingTypeArgument** [boolean or string, optional]: Generate or suppress diagnostics when a generic class is used without providing explicit or implicit type arguments. The default value for this setting is `"none"`. -**reportUnnecessaryIsInstance** [boolean or string, optional]: Generate or suppress diagnostics for 'isinstance' or 'issubclass' calls where the result is statically determined to be always true. Such calls are often indicative of a programming error. The default value for this setting is 'none'. + **reportInvalidTypeVarUse** [boolean or string, optional]: Generate or suppress diagnostics when a TypeVar is used inappropriately (e.g. if a TypeVar appears only once) within a generic function signature. The default value for this setting is `"warning"`. -**reportUnnecessaryCast** [boolean or string, optional]: Generate or suppress diagnostics for 'cast' calls that are statically determined to be unnecessary. Such calls are sometimes indicative of a programming error. The default value for this setting is 'none'. + **reportCallInDefaultInitializer** [boolean or string, optional]: Generate or suppress diagnostics for function calls, list expressions, set expressions, or dictionary expressions within a default value initialization expression. Such calls can mask expensive operations that are performed at module initialization time. The default value for this setting is `"none"`. -**reportUnnecessaryComparison** [boolean or string, optional]: Generate or suppress diagnostics for '==' or '!=' comparisons or other conditional expressions that are statically determined to always evaluate to False or True. Such comparisons are sometimes indicative of a programming error. The default value for this setting is 'none'. + **reportUnnecessaryIsInstance** [boolean or string, optional]: Generate or suppress diagnostics for `isinstance` or `issubclass` calls where the result is statically determined to be always true. Such calls are often indicative of a programming error. The default value for this setting is `"none"`. -**reportUnnecessaryContains** [boolean or string, optional]: Generate or suppress diagnostics for 'in' operations that are statically determined to always evaluate to False or True. Such operations are sometimes indicative of a programming error. The default value for this setting is 'none'. + **reportUnnecessaryCast** [boolean or string, optional]: Generate or suppress diagnostics for `cast` calls that are statically determined to be unnecessary. Such calls are sometimes indicative of a programming error. The default value for this setting is `"none"`. -**reportAssertAlwaysTrue** [boolean or string, optional]: Generate or suppress diagnostics for 'assert' statement that will provably always assert. This can be indicative of a programming error. The default value for this setting is 'warning'. + **reportUnnecessaryComparison** [boolean or string, optional]: Generate or suppress diagnostics for `==` or `!=` comparisons or other conditional expressions that are statically determined to always evaluate to False or True. Such comparisons are sometimes indicative of a programming error. The default value for this setting is `"none"`. -**reportSelfClsParameterName** [boolean or string, optional]: Generate or suppress diagnostics for a missing or misnamed “self” parameter in instance methods and “cls” parameter in class methods. Instance methods in metaclasses (classes that derive from “type”) are allowed to use “cls” for instance methods. The default value for this setting is 'warning'. + **reportUnnecessaryContains** [boolean or string, optional]: Generate or suppress diagnostics for `in` operations that are statically determined to always evaluate to False or True. Such operations are sometimes indicative of a programming error. The default value for this setting is `"none"`. -**reportImplicitStringConcatenation** [boolean or string, optional]: Generate or suppress diagnostics for two or more string literals that follow each other, indicating an implicit concatenation. This is considered a bad practice and often masks bugs such as missing commas. The default value for this setting is 'none'. + **reportAssertAlwaysTrue** [boolean or string, optional]: Generate or suppress diagnostics for `assert` statement that will provably always assert. This can be indicative of a programming error. The default value for this setting is `"warning"`. -**reportUndefinedVariable** [boolean or string, optional]: Generate or suppress diagnostics for undefined variables. The default value for this setting is 'error'. + **reportSelfClsParameterName** [boolean or string, optional]: Generate or suppress diagnostics for a missing or misnamed “self” parameter in instance methods and “cls” parameter in class methods. Instance methods in metaclasses (classes that derive from “type”) are allowed to use “cls” for instance methods. The default value for this setting is `"warning"`. -**reportUnboundVariable** [boolean or string, optional]: Generate or suppress diagnostics for unbound and possibly unbound variables. The default value for this setting is 'error'. + **reportImplicitStringConcatenation** [boolean or string, optional]: Generate or suppress diagnostics for two or more string literals that follow each other, indicating an implicit concatenation. This is considered a bad practice and often masks bugs such as missing commas. The default value for this setting is `"none"`. -**reportInvalidStubStatement** [boolean or string, optional]: Generate or suppress diagnostics for statements that are syntactically correct but have no purpose within a type stub file. The default value for this setting is 'none'. + **reportUndefinedVariable** [boolean or string, optional]: Generate or suppress diagnostics for undefined variables. The default value for this setting is `"error"`. -**reportIncompleteStub** [boolean or string, optional]: Generate or suppress diagnostics for a module-level `__getattr__` call in a type stub file, indicating that it is incomplete. The default value for this setting is 'none'. + **reportUnboundVariable** [boolean or string, optional]: Generate or suppress diagnostics for unbound and possibly unbound variables. The default value for this setting is `"error"`. -**reportUnsupportedDunderAll** [boolean or string, optional]: Generate or suppress diagnostics for statements that define or manipulate `__all__` in a way that is not allowed by a static type checker, thus rendering the contents of `__all__` to be unknown or incorrect. Also reports names within the `__all__` list that are not present in the module namespace. The default value for this setting is 'warning'. + **reportInvalidStubStatement** [boolean or string, optional]: Generate or suppress diagnostics for statements that are syntactically correct but have no purpose within a type stub file. The default value for this setting is `"none"`. -**reportUnusedCallResult** [boolean or string, optional]: Generate or suppress diagnostics for call statements whose return value is not used in any way and is not None. The default value for this setting is 'none'. + **reportIncompleteStub** [boolean or string, optional]: Generate or suppress diagnostics for a module-level `__getattr__` call in a type stub file, indicating that it is incomplete. The default value for this setting is `"none"`. -**reportUnusedCoroutine** [boolean or string, optional]: Generate or suppress diagnostics for call statements whose return value is not used in any way and is a Coroutine. This identifies a common error where an `await` keyword is mistakenly omitted. The default value for this setting is 'error'. + **reportUnsupportedDunderAll** [boolean or string, optional]: Generate or suppress diagnostics for statements that define or manipulate `__all__` in a way that is not allowed by a static type checker, thus rendering the contents of `__all__` to be unknown or incorrect. Also reports names within the `__all__` list that are not present in the module namespace. The default value for this setting is `"warning"`. -**reportUnusedExpression** [boolean or string, optional]: Generate or suppress diagnostics for simple expressions whose results are not used in any way. The default value for this setting is 'none'. + **reportUnusedCallResult** [boolean or string, optional]: Generate or suppress diagnostics for call statements whose return value is not used in any way and is not None. The default value for this setting is `"none"`. -**reportUnnecessaryTypeIgnoreComment** [boolean or string, optional]: Generate or suppress diagnostics for a '# type: ignore' or '# pyright: ignore' comment that would have no effect if removed. The default value for this setting is 'none'. + **reportUnusedCoroutine** [boolean or string, optional]: Generate or suppress diagnostics for call statements whose return value is not used in any way and is a Coroutine. This identifies a common error where an `await` keyword is mistakenly omitted. The default value for this setting is `"error"`. -**reportMatchNotExhaustive** [boolean or string, optional]: Generate or suppress diagnostics for a 'match' statement that does not provide cases that exhaustively match against all potential types of the target expression. The default value for this setting is 'none'. + **reportUnusedExpression** [boolean or string, optional]: Generate or suppress diagnostics for simple expressions whose results are not used in any way. The default value for this setting is `"none"`. + **reportUnnecessaryTypeIgnoreComment** [boolean or string, optional]: Generate or suppress diagnostics for a `# type: ignore` or `# pyright: ignore` comment that would have no effect if removed. The default value for this setting is `"none"`. + + **reportMatchNotExhaustive** [boolean or string, optional]: Generate or suppress diagnostics for a `match` statement that does not provide cases that exhaustively match against all potential types of the target expression. The default value for this setting is `"none"`. + + **reportImplicitOverride** [boolean or string, optional]: Generate or suppress diagnostics for overridden methods in a class that are missing an explicit `@override` decorator. + + **reportShadowedImports** [boolean or string, optional]: Generate or suppress diagnostics for files that are overriding a module in the stdlib. The default value for this setting is `"none"`. ## Execution Environment Options Pyright allows multiple “execution environments” to be defined for different portions of your source tree. For example, a subtree may be designed to run with different import search paths or a different version of the python interpreter than the rest of the source base. @@ -283,15 +290,16 @@ executionEnvironments = [ ## Diagnostic Rule Defaults -Each diagnostic rule has a default severity level that is dictated by the specified type checking mode. The default for each rule can be overridden in the configuration file or settings. In strict type checking mode, overrides may only increase the severity level (e.g. from “warning” to “error”). +Each diagnostic rule has a default severity level that is dictated by the specified type checking mode. The default for each rule can be overridden in the configuration file or settings. In strict type checking mode, overrides may only increase the severity level (e.g. from `"warning"` to `"error"`). -The following table lists the default severity levels for each diagnostic rule within each type checking mode ("off", "basic" and "strict"). +The following table lists the default severity levels for each diagnostic rule within each type checking mode (`"off"`, `"basic"` and `"strict"`). | Diagnostic Rule | Off | Basic | Strict | | :---------------------------------------- | :--------- | :--------- | :--------- | | strictListInference | false | false | true | | strictDictionaryInference | false | false | true | | strictSetInference | false | false | true | +| analyzeUnannotatedFunctions | true | true | true | | strictParameterNoneValue | true | true | true | | enableTypeIgnoreComments | true | true | true | | reportMissingModuleSource | "warning" | "warning" | "warning" | @@ -317,6 +325,7 @@ The following table lists the default severity levels for each diagnostic rule w | reportUnboundVariable | "none" | "error" | "error" | | reportUnusedCoroutine | "none" | "error" | "error" | | reportConstantRedefinition | "none" | "none" | "error" | +| reportDeprecated | "none" | "none" | "error" | | reportDuplicateImport | "none" | "none" | "error" | | reportFunctionMemberAccess | "none" | "none" | "error" | | reportImportCycles | "none" | "none" | "error" | @@ -349,9 +358,11 @@ The following table lists the default severity levels for each diagnostic rule w | reportUntypedFunctionDecorator | "none" | "none" | "error" | | reportUntypedNamedTuple | "none" | "none" | "error" | | reportCallInDefaultInitializer | "none" | "none" | "none" | +| reportImplicitOverride | "none" | "none" | "none" | | reportImplicitStringConcatenation | "none" | "none" | "none" | | reportMissingSuperCall | "none" | "none" | "none" | | reportPropertyTypeMismatch | "none" | "none" | "none" | +| reportShadowedImports | "none" | "none" | "none" | | reportUninitializedInstanceVariable | "none" | "none" | "none" | | reportUnnecessaryTypeIgnoreComment | "none" | "none" | "none" | | reportUnusedCallResult | "none" | "none" | "none" | diff --git a/docs/features.md b/docs/features.md new file mode 100644 index 000000000..891b524aa --- /dev/null +++ b/docs/features.md @@ -0,0 +1,61 @@ +## Pyright Features + +### Speed +Pyright is a fast type checker meant for large Python source bases. It can run in a “watch” mode and performs fast incremental updates when files are modified. + +### Configurability +Pyright supports [configuration files](configuration.md) that provide granular control over settings. Different “execution environments” can be associated with subdirectories within a source base. Each environment can specify different module search paths, python language versions, and platform targets. + +### Type Checking Features +* [PEP 484](https://www.python.org/dev/peps/pep-0484/) type hints including generics +* [PEP 487](https://www.python.org/dev/peps/pep-0487/) simpler customization of class creation +* [PEP 526](https://www.python.org/dev/peps/pep-0526/) syntax for variable annotations +* [PEP 544](https://www.python.org/dev/peps/pep-0544/) structural subtyping +* [PEP 561](https://www.python.org/dev/peps/pep-0561/) distributing and packaging type information +* [PEP 563](https://www.python.org/dev/peps/pep-0563/) postponed evaluation of annotations +* [PEP 570](https://www.python.org/dev/peps/pep-0570/) position-only parameters +* [PEP 585](https://www.python.org/dev/peps/pep-0585/) type hinting generics in standard collections +* [PEP 586](https://www.python.org/dev/peps/pep-0586/) literal types +* [PEP 589](https://www.python.org/dev/peps/pep-0589/) typed dictionaries +* [PEP 591](https://www.python.org/dev/peps/pep-0591/) final qualifier +* [PEP 593](https://www.python.org/dev/peps/pep-0593/) flexible variable annotations +* [PEP 604](https://www.python.org/dev/peps/pep-0604/) complementary syntax for unions +* [PEP 612](https://www.python.org/dev/peps/pep-0612/) parameter specification variables +* [PEP 613](https://www.python.org/dev/peps/pep-0613/) explicit type aliases +* [PEP 635](https://www.python.org/dev/peps/pep-0635/) structural pattern matching +* [PEP 646](https://www.python.org/dev/peps/pep-0646/) variadic generics +* [PEP 647](https://www.python.org/dev/peps/pep-0647/) user-defined type guards +* [PEP 655](https://www.python.org/dev/peps/pep-0655/) required typed dictionary items +* [PEP 673](https://www.python.org/dev/peps/pep-0673/) Self type +* [PEP 675](https://www.python.org/dev/peps/pep-0675/) arbitrary literal strings +* [PEP 681](https://www.python.org/dev/peps/pep-0681/) dataclass transform +* [PEP 692](https://www.python.org/dev/peps/pep-0692/) TypedDict for kwargs typing +* [PEP 695](https://www.python.org/dev/peps/pep-0695/) (draft) Type parameter syntax +* [PEP 696](https://www.python.org/dev/peps/pep-0696/) (draft) Type defaults for TypeVarLikes +* [PEP 698](https://www.python.org/dev/peps/pep-0698/) Override decorator for static typing +* [PEP 702](https://www.python.org/dev/peps/pep-0702/) (draft) Marking deprecations +* Type inference for function return values, instance variables, class variables, and globals +* Type guards that understand conditional code flow constructs like if/else statements + +### Language Server Support +Pyright ships as both a command-line tool and a language server that provides many powerful features that help improve programming efficiency. + +* Intelligent type completion of keywords, symbols, and import names appears when editing +* Import statements are automatically inserted when necessary for type completions +* Signature completion tips help when filling in arguments for a call +* Hover over symbols to provide type information and doc strings +* Find Definitions to quickly go to the location of a symbol’s definition +* Find References to find all references to a symbol within a code base +* Rename Symbol to rename all references to a symbol within a code base +* Find Symbols within the current document or within the entire workspace +* View call hierarchy information — calls made within a function and places where a function is called +* Organize Imports command for automatically ordering imports according to PEP8 rules +* Type stub generation for third-party libraries + +### Built-in Type Stubs +Pyright includes a recent copy of the stdlib type stubs from [Typeshed](https://github.com/python/typeshed). It can be configured to use another (perhaps more recent or modified) copy of the Typeshed type stubs. Of course, it also works with custom type stub files that are part of your project. + +## Limitations +Pyright provides support for Python 3.0 and newer. There are no plans to support older versions. + + diff --git a/docs/getting-started.md b/docs/getting-started.md index d2fa01fb7..19874ea3a 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -3,16 +3,25 @@ A static type checker like Pyright can add incremental value to your source code as more type information is provided. Here is a typical progression: -1. Install pyright (either the VS Code extension or command-line tool). -2. Write a minimal `pyrightconfig.json` that defines `include` entries. Place the config file in your project’s top-level directory and commit it to your repo. Alternatively, you can add a pyright section to a `pyproject.toml` file. For additional details and a sample config file, refer to [this documentation](https://github.com/microsoft/pyright/blob/main/docs/configuration.md). -3. Optionally enable the `python.analysis.useLibraryCodeForTypes` config option (or pass `--lib` to the command-line tool). This tells Pyright that it should attempt to infer type information from library code if a type stub is not available. -4. Run pyright over your source base with the default settings. Fix any errors and warnings that it emits. -5. Enable the `reportMissingTypeStubs` setting in the config file and add (minimal) type stub files for the imported files. You may wish to create a stubs directory within your code base — a location for all of your custom type stub files. Configure the “stubPath” config entry to refer to this directory. -6. Look for type stubs for the packages you use. Some package authors opt to ship stubs as a separate companion package named that has “-stubs” appended to the name of the original package. -7. In cases where type stubs do not yet exist for a package you are using, consider creating a custom type stub that defines the portion of the interface that your source code consumes. Check in your custom type stub files and configure pyright to run as part of your continuous integration (CI) environment to keep the project “type clean”. -8. Incrementally add type annotations to your code files. The annotations that provide most value are on function input parameters, instance variables, and return parameters (in that order). Note that annotation of variables (instance, class and local) requires Python 3.6 or newer. -9. Enable stricter type checking options like "reportUnknownParameterType", and "reportUntypedFunctionDecorator". -10. On a file-by-file basis, enable all type checking options by adding the comment `# pyright: strict` somewhere in the file. -11. Optionally add entire subdirectories to the `strict` config entry to indicate that all files within those subdirectories should be strictly typed. + +### 1. Initial Type Checking +* Install pyright (either the language server or command-line tool). +* Write a minimal `pyrightconfig.json` that defines `include` entries. Place the config file in your project’s top-level directory and commit it to your repo. Alternatively, you can add a pyright section to a `pyproject.toml` file. For additional details and a sample config file, refer to [this documentation](configuration.md). +* Optionally enable the `python.analysis.useLibraryCodeForTypes` config option (or pass `--lib` to the command-line tool). This tells Pyright that it should attempt to infer type information from library code if a type stub is not available. +* Run pyright over your source base with the default settings. Fix any errors and warnings that it emits. Optionally disable specific diagnostic rules if they are generating too many errors. They can be re-enabled at a later time. + +### 2. Types For Imported Libraries +* Update dependent libraries to recent versions. Many popular libraries have recently added inlined types, which eliminates the need to install or create type stubs. +* Enable the `reportMissingTypeStubs` setting in the config file and add (minimal) type stub files for the imported files. You may wish to create a stubs directory within your code base — a location for all of your custom type stub files. Configure the “stubPath” config entry to refer to this directory. +* Look for type stubs for the packages you use. Some package authors opt to ship stubs as a separate companion package named that has “-stubs” appended to the name of the original package. +* In cases where type stubs do not yet exist for a package you are using, consider creating a custom type stub that defines the portion of the interface that your source code consumes. Check in your custom type stub files and configure pyright to run as part of your continuous integration (CI) environment to keep the project “type clean”. + +### 3. Incremental Typing +* Incrementally add type annotations to your code files. The annotations that provide most value are on function input parameters, instance variables, and return parameters (in that order). +* Enable stricter type checking options like "reportUnknownParameterType", and "reportUntypedFunctionDecorator". + +### 4. Strict Typing +* On a file-by-file basis, enable all type checking options by adding the comment `# pyright: strict` somewhere in the file. +* Optionally add entire subdirectories to the `strict` config entry to indicate that all files within those subdirectories should be strictly typed. diff --git a/docs/img/PyrightSmall.png b/docs/img/PyrightSmall.png new file mode 100644 index 000000000..043de771e Binary files /dev/null and b/docs/img/PyrightSmall.png differ diff --git a/docs/import-resolution.md b/docs/import-resolution.md index 699836e25..e71b7194e 100644 --- a/docs/import-resolution.md +++ b/docs/import-resolution.md @@ -1,6 +1,6 @@ -# Import Resolution +## Import Resolution -## Resolution Order +### Resolution Order If the import is relative (the module name starts with one or more dots), it resolves the import relative to the path of the importing source file. For absolute (non-relative) imports, Pyright employs the following resolution order: @@ -9,7 +9,7 @@ For absolute (non-relative) imports, Pyright employs the following resolution or 2. Try to resolve using **code within the workspace**. - * Try to resolve relative to the **root directory** of the execution environment. If no execution environments are specified in the config file, use the root of the workspace. For more information about execution environments, refer to the [configuration documentation](https://github.com/microsoft/pyright/blob/main/docs/configuration.md#execution-environment-options). + * Try to resolve relative to the **root directory** of the execution environment. If no execution environments are specified in the config file, use the root of the workspace. For more information about execution environments, refer to the [configuration documentation](configuration.md#execution-environment-options). * Try to resolve using any of the **extra paths** defined for the execution environment in the config file. If no execution environment applies, use the `python.analysis.extraPaths` setting. Extra paths are searched in the order in which they are provided in the config file or setting. @@ -28,7 +28,7 @@ For absolute (non-relative) imports, Pyright employs the following resolution or -## Configuring Your Python Environment +### Configuring Your Python Environment Pyright does not require a Python environment to be configured if all imports can be resolved using local files and type stubs. If a Python environment is configured, it will attempt to use the packages installed in the `site-packages` subdirectory during import resolution. Pyright uses the following mechanisms (in priority order) to determine which Python environment to use: @@ -39,5 +39,37 @@ Pyright uses the following mechanisms (in priority order) to determine which Pyt 3. As a fallback, use the default Python environment (i.e. the one that is invoked when typing `python` in the shell). -## Debugging Import Resolution Problems +### Editable installs + +[PEP 660](https://peps.python.org/pep-0660/) enables build backends (e.g. setuptools) to +use import hooks to direct the [import machinery](https://docs.python.org/3/reference/import.html) +to the package’s source files rather than using a `.pth` file. Import hooks can provide +an editable installation that is a more accurate representation of your real installation. +However, because resolving module locations using an import hook requires executing Python +code, they are not usable by Pyright and other static analysis tools. Therefore, if your +editable install is configured to use import hooks, Pyright will be unable to find the +corresponding source files. + +If you want to use static analysis tools with an editable install, you should configure +the editable install to use `.pth` files instead of import hooks. See your build backend’s +documentation for details on how to do this. We have provided some basic information for +common build backends below. + +#### Setuptools +Setuptools currently supports two ways to request: +[“compat mode”](https://setuptools.pypa.io/en/latest/userguide/development_mode.html#legacy-behavior) +where a `.pth` file will be used -- a config setting and an environment variable. Another +option is [“strict mode”](https://setuptools.pypa.io/en/latest/userguide/development_mode.html#strict-editable-installs) +which uses symlinks instead. + +#### Hatch/Hatchling +[Hatchling](https://hatch.pypa.io/latest/config/build/#dev-mode) uses `.pth` files by +default. It will only use import hooks if you set `dev-mode-exact` to `true`. + +#### PDM +[PDM](https://pdm.fming.dev/latest/pyproject/build/#editable-build-backend) uses `.pth` +files by default. It will only use import hooks if you set `editable-backend` to +`"editables"`. + +### Debugging Import Resolution Problems The import resolution mechanisms in Python are complicated, and Pyright offers many configuration options. If you are encountering problems with import resolution, Pyright provides additional logging that may help you identify the cause. To enable verbose logging, pass `--verbose` as a command-line argument or add the following entry to the config file `"verboseOutput": true`. If you are using the Pyright VS Code extension, the additional logging will appear in the Output tab (select “Pyright” from the menu). Please include this verbose logging when reporting import resolution bugs. diff --git a/docs/import-statements.md b/docs/import-statements.md new file mode 100644 index 000000000..6a8a9b966 --- /dev/null +++ b/docs/import-statements.md @@ -0,0 +1,31 @@ +## Import Statements + +### Loader Side Effects + +An import statement instructs the Python import loader to perform several operations. For example, the statement `from a.b import Foo as Bar` causes the following steps to be performed at runtime: +1. Load and execute module `a` if it hasn’t previously been loaded. Cache a reference to a. +2. Load and execute submodule `b` if it hasn’t previously been loaded. +3. Store a reference to submodule `b` to the variable `b` within module `a`’s namespace. +4. Look up attribute `Foo` within module `b`. +5. Assign the value of attribute `Foo` to a local variable called `Bar`. + +If another source file were to subsequently execute the statement `import a`, it would observe `b` in the namespace of `a` as a side effect of step 3 in the the earlier import operation. Relying on such side effects leads to fragile code because a change in execution ordering or a modification to one module can break code in another module. Reliance on such side effects is therefore considered a bug by Pyright, which intentionally does not attempt to model such side effects. + +### Implicit Module Loads + +Pyright models two loader side effects that are considered safe and are commonly used in Python code. + +1. If an import statement targets a multi-part module name and does not use an alias, all modules within the multi-part module name are assumed to be loaded. For example, the statement `import a.b.c` is treated as though it is three back-to-back import statements: `import a`, `import a.b` and `import a.b.c`. This allows for subsequent use of all symbols in `a`, `a.b`, and `a.b.c`. If an alias is used (e.g. `import a.b.c as abc`), this is assumed to load only module `c`. A subsequent `import a` would not provide access to `a.b` or `a.b.c`. + +2. If an `__init__.py` file includes an import statement of the form `from .a import b`, the local variable `a` is assigned a reference to submodule `a`. This statement form is treated as though it is two back-to-back import statements: `from . import a` followed by `from .a import b`. + + +### Unsupported Loader Side Effects + +All other module loader side effects are intentionally _not_ modeled by Pyright and should not be relied upon in code. Examples include: + +- If one module contains the statement `import a.b` and a second module includes `import a`, the second module should not rely on the fact that `a.b` is now accessible as a side effect of the first module’s import. + +- If a module contains the statement `import a.b` in the global scope and a function that includes the statement `import a` or `import a.c`, the function should not assume that it can access `a.b`. This assumption might or might not be safe depending on execution order. + +- If a module contains the statements `import a.b as foo` and `import a`, code within that module should not assume that it can access `a.b`. Such an assumption might be safe depending on the relative order of the statements and the order in which they are executed, but it leads to fragile code. diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 000000000..620ca437c --- /dev/null +++ b/docs/index.html @@ -0,0 +1,46 @@ + + + + + Pyright + + + + + + +
+ + + + + + + + + + + diff --git a/docs/installation.md b/docs/installation.md new file mode 100644 index 000000000..95ea992ea --- /dev/null +++ b/docs/installation.md @@ -0,0 +1,45 @@ +## Installation + +### Language Server + +#### VS Code +For most VS Code users, we recommend using the Pylance extension rather than Pyright. Pylance incorporates the Pyright type checker but features additional capabilities such as semantic token highlighting and symbol indexing. You can install the latest-published version of the Pylance VS Code extension directly from VS Code. Simply open the extensions panel and search for “Pylance”. + +#### Vim +Vim/neovim users can install [coc-pyright](https://github.com/fannheyward/coc-pyright), the Pyright extension for coc.nvim. + +Alternatively, [ALE](https://github.com/dense-analysis/ale) will automatically check your code with Pyright if added to the linters list. + +#### Sublime Text +Sublime text users can install the [LSP-pyright](https://github.com/sublimelsp/LSP-pyright) plugin from [package control](https://packagecontrol.io/packages/LSP-pyright). + +#### Emacs +Emacs users can install [eglot](https://github.com/joaotavora/eglot) or [lsp-mode](https://github.com/emacs-lsp/lsp-mode) with [lsp-pyright](https://github.com/emacs-lsp/lsp-pyright). + +### Command-line + +#### Python Package +A [community-maintained](https://github.com/RobertCraigie/pyright-python) Python package by the name of “pyright” is available on pypi and conda-forge. This package will automatically install node (which Pyright requires) and keep Pyright up to date. + +`pip install pyright` + +or + +`conda install pyright` + +Once installed, you can run the tool from the command line as follows: +`pyright ` + + +#### NPM Package +Alternatively, you can install the command-line version of Pyright directly from npm, which is part of node. If you don't have a recent version of node on your system, install that first from [nodejs.org](https://nodejs.org). + +To install pyright globally: +`npm install -g pyright` + +On MacOS or Linux, sudo may be required to install globally: +`sudo npm install -g pyright` + +To update to the latest version: +`sudo npm update -g pyright` + diff --git a/docs/internals.md b/docs/internals.md index 9b7344069..e0da0c976 100644 --- a/docs/internals.md +++ b/docs/internals.md @@ -43,7 +43,7 @@ Pyright attempts to infer the types of global (module-level) variables, class va Pyright supports type narrowing to track assumptions that apply within certain code flow paths. For example, consider the following code: ```python -def func(a: Optional[Union[str, List[str]]): +def func(a: str | list[str] | None): if isinstance(a, str): log(a) elif isinstance(a, list): @@ -52,22 +52,22 @@ def func(a: Optional[Union[str, List[str]]): log(a) ``` -In this example, the type evaluator knows that parameter a is either None, str, or List[str]. Within the first `if` clause, a is constrained to be a str. Within the `elif` clause, it is constrained to be a List[str], and within the `else` clause, it has to be None (by process of elimination). The type checker would therefore flag the final line as an error if the log method could not accept None as a parameter. +In this example, the type evaluator knows that parameter a is either None, str, or list[str]. Within the first `if` clause, a is constrained to be a str. Within the `elif` clause, it is constrained to be a list[str], and within the `else` clause, it has to be None (by process of elimination). The type checker would therefore flag the final line as an error if the log method could not accept None as a parameter. Narrowing is also applied when values are assigned to a variable. ```python -def func(b: Optional[Union[str, List[str]]]): +def func(b: str | list[str] | None): # The declared type of “a” is a union of three types - # (str, List[str] and None). - a: Optional[Union[str, List[str]]] = b - reveal_type(a) # Type is `Optional[Union[str, List[str]]]` + # (str, list[str] and None). + a: str | list[str] | None = b + reveal_type(a) # Type is `str | list[str] | None` a = "hi" reveal_type(a) # Type is `str` a = ["a", "b", "c"] - reveal_type(a) # Type is `List[str]` + reveal_type(a) # Type is `list[str]` a = None reveal_type(a) # Type is `None` @@ -76,7 +76,7 @@ def func(b: Optional[Union[str, List[str]]]): If the type narrowing logic exhausts all possible subtypes, it can be assumed that a code path will never be taken. For example, consider the following: ```python -def func(a: Union[Foo, Bar]): +def func(a: Foo | Bar): if isinstance(a, Foo): # “a” must be type Foo a.do_something_1() @@ -103,7 +103,7 @@ class Bar: def do_something_2(self): pass -def func(a: Union[Foo, Bar]): +def func(a: Foo | Bar): if a.kind == "Foo": a.do_something_1() else: diff --git a/docs/mypy-comparison.md b/docs/mypy-comparison.md new file mode 100644 index 000000000..3ee5cda4d --- /dev/null +++ b/docs/mypy-comparison.md @@ -0,0 +1,446 @@ +## Differences Between Pyright and Mypy + +### What is Mypy? + +Mypy is the “OG” in the world of Python type checkers. It was started by Jukka Lehtosalo in 2012 with contributions from Guido van Rossum, Ivan Levkivskyi, and many others over the years. For a detailed history, refer to [this documentation](http://mypy-lang.org/about.html). The code for mypy can be found in [this github project](https://github.com/python/mypy). + + +### Why Does Pyright’s Behavior Differ from Mypy’s? + +Mypy served as a reference implementation of [PEP 484](https://www.python.org/dev/peps/pep-0484/), which defines standard behaviors for Python static typing. Although PEP 484 spells out many type checking behaviors, it intentionally leaves many other behaviors undefined. This approach has allowed different type checkers to innovate and differentiate. + +Pyright generally adheres to the type checking behaviors spelled out in PEP 484 and follow-on typing PEPs (526, 544, 586, 589, etc.). For behaviors that are not explicitly spelled out in these standards, pyright generally tries to adhere to mypy’s behavior unless there is a compelling justification for deviating. This document discusses these differences and provides the reasoning behind each design choice. + + +### Design Goals + +Pyright was designed with performance in mind. It is not unusual for pyright to be 3x to 5x faster than mypy when type checking large code bases. Some of its design decisions were motivated by this goal. + +Pyright was also designed to be used as the foundation for a Python [language server](https://microsoft.github.io/language-server-protocol/). Language servers provide interactive programming features such as completion suggestions, function signature help, type information on hover, semantic-aware search, semantic-aware renaming, semantic token coloring, refactoring tools, etc. For a good user experience, these features require highly responsive type evaluation performance during interactive code modification. They also require type evaluation to work on code that is incomplete and contains syntax errors. + +To achieve these design goals, pyright is implemented as a “lazy” or “just-in-time” type evaluator. Rather than analyzing all code in a module from top to bottom, it is able to evaluate the type of an arbitrary identifier anywhere within a module. If the type of that identifier depends on the types of other expressions or symbols, pyright recursively evaluates those in turn until it has enough information to determine the type of the requested identifier. By comparison, mypy uses a more traditional multi-pass architecture where semantic analysis is performed multiple times on a module from the top to the bottom until all types converge. + +Pyright implements its own parser, which recovers gracefully from syntax errors and continues parsing the remainder of the source file. By comparison, mypy uses the parser built in to the Python interpreter, and it does not support recovery after a syntax error. + + +### Type Checking Unannotated Code + +By default, pyright performs type checking for all code regardless of whether it contains type annotations. This is important for language server features. It is also important for catching bugs in code that is unannotated. + +By default, mypy skips all functions or methods that do not have type annotations. This is a common source of confusion for mypy users who are surprised when type violations in unannotated functions go unreported. If the option `--check-untyped-defs` is enabled, mypy performs type checking for all functions and methods. + + +### Inferred Return Types + +If a function or method lacks a return type annotation, pyright infers the return type from `return` and `yield` statements within the function’s body (including the implied `return None` at the end of the function body). This is important for supporting completion suggestions. It also improves type checking coverage and eliminates the need for developers to needlessly supply return type annotations for trivial return types. + +By comparison, mypy never infers return types and assumes that functions without a return type annotation have a return type of `Any`. This was an intentional design decision by mypy developers and is explained in [this thread](https://github.com/python/mypy/issues/10149). + + +### Unions vs Joins + +When merging two types during code flow analysis or widening types during constraint solving, pyright always uses a union operation. Mypy typically (but not always) uses a “join” operation, which merges types by finding a common supertype. The use of joins discards valuable type information and leads to many false positive errors that are [well documented within the mypy issue tracker](https://github.com/python/mypy/issues?q=is%3Aissue+is%3Aopen+label%3Atopic-join-v-union). + +```python +def func1(val: object): + if isinstance(val, str): + pass + elif isinstance(val, int): + pass + else: + return + reveal_type(val) # mypy: object, pyright: str | int + +def func2(condition: bool, val1: str, val2: int): + x = val1 if condition else val2 + reveal_type(x) # mypy: object, pyright: str | int + + y = val1 or val2 + # In this case, mypy uses a union instead of a join + reveal_type(y) # mypy: str | int, pyright: str | int +``` + + +### Variable Type Declarations + +Pyright treats variable type annotations as type declarations. If a variable is not annotated, pyright allows any value to be assigned to that variable, and its type is inferred to be the union of all assigned types. + +Mypy’s behavior for variables depends on whether the [`--allow-redefinition`](https://mypy.readthedocs.io/en/stable/command_line.html#cmdoption-mypy-allow-redefinition) is specified. If redefinitions are not allowed, then mypy typically treats the first assignment (the one with the smallest line number) as though it is an implicit type declaration. + +```python +def func1(condition: bool): + if condition: + x = 3 # Mypy treats this as an implicit type declaration + else: + x = "" # Mypy treats this as an error because `x` is implicitly declared as `int` + +def func2(condition: bool): + x = None # Mypy provides some exceptions; this is not considered an implicit type declaration + + if condition: + x = "" # This is not considered an error + +def func3(condition: bool): + x = [] # Mypy doesn't treat this as a declaration + + if condition: + x = [1, 2, 3] # The type of `x` is declared as `list[int]` +``` + +Pyright’s behavior is more consistent, is conceptually simpler and more natural for Python developers, leads to fewer false positives, and eliminates the need for many otherwise-necessary variable type annotations. + + +### Class and Instance Variable Inference + +Pyright handles instance and class variables consistently with local variables. If a type annotation is provided for an instance or class variable (either within the class or one of its base classes), pyright treats this as a type declaration and enforces it accordingly. If a class implementation does not provide a type annotation for an instance or class variable and its base classes likewise do not provide a type annotation, the variable’s type is inferred from all assignments within the class implementation. + +```python +class A: + def method1(self) -> None: + self.x = 1 + + def method2(self) -> None: + self.x = "" # Mypy treats this as an error because `x` is implicitly declared as `int` + +a = A() +reveal_type(a.x) # pyright: int | str + +a.x = "" # Pyright allows this because the type of `x` is `int | str` +a.x = 3.0 # Pyright treats this as an error because the type of `x` is `int | str` +``` + + +### Class and Instance Variable Enforcement + +Pyright distinguishes between “pure class variables”, “regular class variables”, and “pure instance variable”. For a detailed explanation, refer to [this documentation](type-concepts-advanced.md#class-and-instance-variables). + +Mypy does not distinguish between class variables and instance variables in all cases. This is a [known issue](https://github.com/python/mypy/issues/240). + +```python +class A: + x: int = 0 # Regular class variable + y: ClassVar[int] = 0 # Pure class variable + + def __init__(self): + self.z = 0 # Pure instance variable + +print(A.x) +print(A.y) +print(A.z) # pyright: error, mypy: no error +``` + + +### Assignment-based Type Narrowing + +Pyright applies type narrowing for variable assignments. This is done regardless of whether the assignment statement includes a variable type annotation. Mypy skips assignment-based type narrowing when the target variable includes a type annotation. The consensus of the typing community is that mypy’s behavior here is inconsistent, and there are [plans to eliminate this inconsistency](https://github.com/python/mypy/issues/2008). + +```python +v1: Sequence[int] +v1 = [1, 2, 3] +reveal_type(v1) # mypy and pyright both reveal `list[int]` + +v2: Sequence[int] = [1, 2, 3] +reveal_type(v2) # mypy reveals `Sequence[int]` rather than `list[int]` +``` + + +### Type Guards + +Pyright supports several built-in type guards that mypy does not currently support. For a full list of type guard expression forms supported by pyright, refer to [this documentation](type-concepts-advanced.md#type-guards). + +The following expression forms are not currently supported by mypy as type guards: +* `x == L` and `x != L` (where L is an expression with a literal type) +* `len(x) == L` and `len(x) != L` (where x is tuple and L is a literal integer) +* `x in y` or `x not in y` (where y is instance of list, set, frozenset, deque, tuple, dict, defaultdict, or OrderedDict) +* `bool(x)` (where x is any expression that is statically verifiable to be truthy or falsey in all cases) + + +### Aliased Conditional Expressions + +Pyright supports the [aliasing of conditional expressions](type-concepts-advanced.md#aliased-conditional-expression) used for type guards. Mypy does not currently support this, but it is a frequently-requested feature. + + +### Narrowing for Implied Else + +Pyright supports a feature called [type narrowing for implied else](type-concepts-advanced.md#narrowing-for-implied-else) in cases where an `if` or `elif` clause has no associated `else` clause. This feature allows pyright to determine that all cases have already been handled by the `if` or `elif` statement and that the "implied else" would never be executed if it were present. This eliminates certain false positive errors. Mypy currently does not support this. + +```python +class Color(Enum): + RED = 1 + BLUE = 2 + +def is_red(color: Color) -> bool: + if color == Color.RED: + return True + elif color == Color.BLUE: + return False + # mypy reports error: Missing return statement +``` + +### Narrowing for Captured Variables + +If a variable’s type is narrowed in an outer scope and the variable is subsequently used within an inner-scoped function or lambda, mypy does not retain the narrowed type within the inner scope. Pyright retains the narrowed type if it can determine that the value of the captured variable is not modified on any code path after the inner-scope function or lambda is defined. + +```python +def func(val: int | None): + if val is not None: + + def inner_1() -> None: + reveal_type(val) # pyright: int, mypy: int | None + print(val + 1) # mypy produces a false positive error here + + inner_2 = lambda: reveal_type(val) + 1 # pyright: int, mypy: int | None + + inner_1() + inner_2() +``` + + +### Narrowing Any + +Pyright never narrows `Any` when performing type narrowing for assignments. Mypy is inconsistent about when it applies type narrowing to `Any` type arguments. + +```python +b: list[Any] + +b = [1, 2, 3] +reveal_type(b) # pyright: list[Any], mypy: list[Any] + +c = [1, 2, 3] +b = c +reveal_type(b) # pyright: list[Any], mypy: list[int] +``` + + +### Inference of List, Set, and Dict Expressions + +Pyright’s inference rules for [list, set and dict expressions](type-inference.md#list-expressions) differ from mypy’s when values with heterogeneous types are used. Mypy uses a join operator to combine the types. Pyright uses either an `Unknown` or a union depending on configuration settings. A join operator often produces a type that is not what was intended, and this leads to false positive errors. + +```python +x = [1, 3.4, ""] +reveal_type(x) # mypy: list[object], pyright: list[Unknown] or list[int | float | str] +``` + +For these mutable container types, pyright does not retain literal types when inferring the container type. Mypy is inconsistent, sometimes retaining literal types and sometimes not. + +```python +def func(one: Literal[1]): + reveal_type(one) # Literal[1] + reveal_type([one]) # pyright: list[int], mypy: list[Literal[1]] + + reveal_type(1) # Literal[1] + reveal_type([1]) # pyright: list[int], mypy: list[int] +``` + + +### Inference of Tuple Expressions + +Pyright’s inference rules for [tuple expressions](type-inference.md#tuple-expressions) differ from mypy’s when tuple entries contain literals. Pyright retains these literal types, but mypy widens the types to their non-literal type. Pyright retains the literal types in this case because tuples are immutable, and more precise (narrower) types are almost always beneficial in this situation. + +```python +x = (1, "stop") +reveal_type(x[1]) # pyright: Literal["stop"], mypy: str + +y: Literal["stop", "go"] = x[1] # mypy: type error +``` + + +### Assignment-Based Narrowing for Literals + +When assigning a literal value to a variable, pyright narrows the type to reflect the literal. Mypy does not. Pyright retains the literal types in this case because more precise (narrower) types are typically beneficial and have little or no downside. + +```python +x: str | None +x = 'a' +reveal_type(x) # pyright: Literal['a'], mypy: str +``` + +Pyright also supports “literal math” for simple operations between literals. + +```python +def func1(a: Literal[1, 2], b: Literal[2, 3]): + c = a + b + reveal_type(c) # Literal[3, 4, 5] + +def func2(): + c = "hi" + " there" + reveal_type(c) # Literal['hi there'] +``` + + +### Type Narrowing for Asymmetric Descriptors + +When pyright evaluates a write to a class variable that contains a descriptor object (including properties), it normally applies assignment-based type narrowing. However, when the descriptor is asymmetric — that is, its “getter” type is different from its “setter” type, pyright refrains from applying assignment-based type narrowing. For a full discussion of this, refer to [this issue](https://github.com/python/mypy/issues/3004). Mypy has not yet implemented the agreed-upon behavior, so its type narrowing behavior may differ from pyright’s in this case. + + +### Parameter Type Inference + +Mypy infers the type of `self` and `cls` parameters in methods but otherwise does not infer any parameter types. + +Pyright implements several parameter type inference techniques that improve type checking and language service features in the absence of explicit parameter type annotations. For details, refer to [this documentation](type-inference.md#parameter-type-inference). + + +### Constraint Solver Behaviors + +When evaluating a call expression that invokes a generic class constructor or a generic function, a type checker performs a process called “constraint solving” to solve the type variables found within the target function signature. The solved type variables are then applied to the return type of that function to determine the final type of the call expression. This process is called “constraint solving” because it takes into account various constraints that are specified for each type variable. These constraints include variance rules and type variable bounds. + +Many aspects of constraint solving are unspecified in PEP 484. This includes behaviors around literals, whether to use unions or joins to widen types, and how to handle cases where multiple types could satisfy all type constraints. + +#### Constraint Solver: Literals + +Pyright’s constraint solver retains literal types only when they are required to satisfy constraints. In other cases, it widens the type to a non-literal type. Mypy is inconsistent in its handling of literal types. + +```python +T = TypeVar("T") +def identity(x: T) -> T: + return x + +def func(one: Literal[1]): + reveal_type(one) # Literal[1] + v1 = identity(one) + reveal_type(v1) # pyright: int, mypy: Literal[1] + + reveal_type(1) # Literal[1] + v2 = identity(1) + reveal_type(v2) # pyright: int, mypy: int +``` + +#### Constraint Solver: Type Widening + +As mentioned previously, pyright always uses unions rather than joins. Mypy typically uses joins. This applies to type widening during the constraint solving process. + +```python +T = TypeVar("T") +def func(val1: T, val2: T) -> T: + ... + +reveal_type(func("", 1)) # mypy: object, pyright: str | int +``` + +#### Constraint Solver: Ambiguous Solution Scoring + +In cases where more than one solution is possible for a type variable, both pyright and mypy employ various heuristics to pick the “best” solution. These heuristics are complex and difficult to document in their fullness. Pyright’s general strategy is to return the “simplest” type that meets the constraints. + +Consider the expression `make_list(x)` in the example below. The type constraints for `T` could be satisfied with either `int` or `list[int]`, but it’s much more likely that the developer intended the former (simpler) solution. Pyright calculates all possible solutions and “scores” them according to complexity, then picks the type with the best score. In rare cases, there can be two results with the same score, in which chase pyright arbitrarily picks one as the winner. + +Mypy produces errors with this sample. + +```python +T = TypeVar("T") + +def make_list(x: T | Iterable[T]) -> list[T]: + return list(x) if isinstance(x, Iterable) else [x] + +def func2(x: list[int], y: list[str] | int): + v1 = make_list(x) + reveal_type(v1) # pyright: "list[int]" ("list[list[T]]" is also a valid answer) + + v2 = make_list(y) + reveal_type(v2) # pyright: "list[int | str]" ("list[list[str] | int]" is also a valid answer) +``` + + +### Constrained Type Variables + +When mypy analyzes a class or function that has in-scope constrained TypeVars, it analyzes the class or function multiple times, once for each constraint. This can produce multiple errors. + +```python +T = TypeVar("T", list[Any], set[Any]) + +def func(a: AnyStr, b: T): + reveal_type(a) # Mypy reveals 2 different types ("str" and "bytes"), pyright reveals "AnyStr" + return a + b # Mypy reports 4 errors +``` + +Pyright cannot use the same multi-pass technique as mypy in this case. It needs to produce a single type for any given identifier to support language server features. Pyright instead uses a mechanism called [conditional types](type-concepts-advanced.md#constrained-type-variables-and-conditional-types). This approach allows pyright to handle some constrained TypeVar use cases that mypy cannot, but there are conversely other use cases that mypy can handle and pyright cannot. + + +### “Unknown” Type and Strict Mode + +Pyright differentiates between explicit and implicit forms of `Any`. The implicit form is referred to as [`Unknown`](type-inference.md#unknown-type). For example, if a parameter is annotated as `list[Any]`, that is a use of an explicit `Any`, but if a parameter is annotated as `list`, that is an implicit `Any`, so pyright refers to this type as `list[Unknown]`. Pyright implements several checks that are enabled in “strict” type-checking modes that report the use of an `Unknown` type. Such uses can mask type errors. + +Mypy does not track the difference between explicit and implicit `Any` types, but it supports various checks that report the use of values whose type is `Any`: `--warn-return-any` and `--disallow-any-*`. For details, refer to [this documentation](https://mypy.readthedocs.io/en/stable/command_line.html#disallow-dynamic-typing). + +Pyright’s approach gives developers more control. It provides a way to be explicit about `Any` where that is the intent. When an `Any` is implicitly produced due to an missing type argument or some other condition that produces an `Any` within the type checker logic, the developer is alerted to that condition. + + +### Overload Resolution + +Overload resolution rules are under-specified in PEP 484. Pyright and mypy apply similar rules, but there are likely some complex edge cases where different results will be produced. For full documentation of pyright’s overload behaviors, refer to [this documentation](type-concepts-advanced.md#overloads). + + +### Import Statements + +Pyright intentionally does not model implicit side effects of the Python import loading mechanism. In general, such side effects cannot be modeled statically because they depend on execution order. Dependency on such side effects leads to fragile code, so pyright treats these as errors. For more details, refer to [this documentation](import-statements.md). + +Mypy models side effects of the import loader that are potentially unsafe. + +```python +import http + +def func(): + import http.cookies + +# The next line raises an exception at runtime +x = http.cookies # mypy allows, pyright flags as error +``` + +### Ellipsis in Function Body + +If Pyright encounters a function body whose implementation is `...`, it does not enforce the return type annotation. The `...` semantically means “this is a code placeholder” — a convention established in type stubs, protocol definitions, and elsewhere. + +Mypy treats `...` function bodies as though they are executable and enforces the return type annotation. This was a recent change in mypy — made long after Pyright established a different behavior. Prior to mypy’s recent change, it did not enforce return types for function bodies consisting of either `...` or `pass`. Now it enforces both. + + +### Circular References + +Because mypy is a multi-pass analyzer, it is able to deal with certain forms of circular references that pyright cannot handle. Here are several examples of circularities that mypy resolves without errors but pyright does not. + +1. A class declaration that references a metaclass whose declaration depends on the class. + +```python +T = TypeVar("T") +class MetaA(type, Generic[T]): ... +class A(metaclass=MetaA["A"]): ... +``` + +2. A class declaration that uses a TypeVar whose bound or constraint depends on the class. + +```python +T = TypeVar("T", bound="A") +class A(Generic[T]): ... +``` + +3. A class that is decorated with a class decorator that uses the class in the decorator’s own signature. + +```python +def my_decorator(x: Callable[..., "A"]) -> Callable[..., "A"]: + return x + +@my_decorator +class A: ... +``` + +### Class Decorator Evaluation + +Pyright honors class decorators. Mypy largely ignores them. See [this issue](https://github.com/python/mypy/issues/3135) for details. + + +### Support for Type Comments + +Versions of Python prior to 3.0 did not have a dedicated syntax for supplying type annotations. Annotations therefore needed to be supplied using “type comments” of the form `# type: `. Python 3.6 added the ability to supply type annotations for variables. + +Mypy has full support for type comments. Pyright supports type comments only in locations where there is a way to provide an annotation using modern syntax. Pyright was written to assume Python 3.5 and newer, so support for older versions was not a priority. + +```python +# The following type comment is supported by +# mypy but is rejected by pyright. +x, y = (3, 4) # type: (float, float) + +# Using Python syntax from Python 3.6, this +# would be annotated as follows: +x: float +y: float +x, y = (3, 4) +``` + diff --git a/docs/settings.md b/docs/settings.md index f3592f0d1..cc9b6c39a 100644 --- a/docs/settings.md +++ b/docs/settings.md @@ -1,6 +1,6 @@ -# Pyright Settings +## Pyright Settings -The Pyright VS Code extension honors the following settings. +The Pyright language server honors the following settings. **pyright.disableLanguageServices** [boolean]: Disables all language services except for “hover”. This includes type completion, signature completion, find definition, find references, and find symbols in file. This option is useful if you want to use pyright only as a type checker but want to run another Python language server for language service features. @@ -16,7 +16,7 @@ The Pyright VS Code extension honors the following settings. **python.analysis.diagnosticMode** ["openFilesOnly", "workspace"]: Determines whether pyright analyzes (and reports errors for) all files in the workspace, as indicated by the config file. If this option is set to "openFilesOnly", pyright analyzes only open files. -**python.analysis.diagnosticSeverityOverrides** [map]: Allows a user to override the severity levels for individual diagnostic rules. "reportXXX" rules in the type check diagnostics settings in [configuration](https://github.com/microsoft/pyright/blob/main/docs/configuration.md#type-check-diagnostics-settings) are supported. Use the rule name as a key and one of "error," "warning," "information," "true," "false," or "none" as value. +**python.analysis.diagnosticSeverityOverrides** [map]: Allows a user to override the severity levels for individual diagnostic rules. "reportXXX" rules in the type check diagnostics settings in [configuration](configuration.md#type-check-diagnostics-settings) are supported. Use the rule name as a key and one of "error," "warning," "information," "true," "false," or "none" as value. **python.analysis.extraPaths** [array of paths]: Paths to add to the default execution environment extra paths if there are no execution environments defined in the config file. diff --git a/docs/type-concepts-advanced.md b/docs/type-concepts-advanced.md new file mode 100644 index 000000000..dd476177b --- /dev/null +++ b/docs/type-concepts-advanced.md @@ -0,0 +1,525 @@ +## Static Typing: Advanced Topics + +### Type Narrowing + +Pyright uses a technique called “type narrowing” to track the type of an expression based on code flow. Consider the following code: + +```python +val_str: str = "hi" +val_int: int = 3 + +def func(val: float | str | complex, test: bool): + reveal_type(val) # int | str | complex + + val = val_int # Type is narrowed to int + reveal_type(val) # int + + if test: + val = val_str # Type is narrowed to str + reveal_type(val) # str + + reveal_type(val) # int | str + + if isinstance(val, int): + reveal_type(val) # int + print(val) + else: + reveal_type(val) # str + print(val) +``` + +At the start of this function, the type checker knows nothing about `val` other than that its declared type is `float | str | complex`. Then it is assigned a value that has a known type of `int`. This is a legal assignment because `int` is considered a subclass of `float`. At the point in the code immediately after the assignment, the type checker knows that the type of `val` is an `int`. This is a “narrower” (more specific) type than `float | str | complex`. Type narrowing is applied whenever a symbol is assigned a new value. + +Another assignment occurs several lines further down, this time within a conditional block. The symbol `val` is assigned a value known to be of type `str`, so the narrowed type of `val` is now `str`. Once the code flow of the conditional block merges with the main body of the function, the narrowed type of `val` becomes `int | str` because the type checker cannot statically predict whether the conditional block will be executed at runtime. + +Another way that types can be narrowed is through the use of conditional code flow statements like `if`, `while`, and `assert`. Type narrowing applies to the block of code that is “guarded” by that condition, so type narrowing in this context is sometimes referred to as a “type guard”. For example, if you see the conditional statement `if x is None:`, the code within that `if` statement can assume that `x` contains `None`. Within the code sample above, we see an example of a type guard involving a call to `isinstance`. The type checker knows that `isinstance(val, int)` will return True only in the case where `val` contains a value of type `int`, not type `str`. So the code within the `if` block can assume that `val` contains a value of type `int`, and the code within the `else` block can assume that `val` contains a value of type `str`. This demonstrates how a type (in this case `int | str`) can be narrowed in both a positive (`if`) and negative (`else`) test. + +The following expression forms support type narrowing: + +* `` (where `` is an identifier) +* `.` (member access expression where `` is a supported expression form) +* `[]` (subscript expression where `` is a non-negative integer) +* `[]` (subscript expression where `` is a string literal) + +Examples of expressions that support type narrowing: + +* `my_var` +* `employee.name` +* `a.foo.next` +* `args[3]` +* `kwargs["bar"]` +* `a.b.c[3]["x"].d` + + +### Type Guards + +In addition to assignment-based type narrowing, Pyright supports the following type guards. + +* `x is None` and `x is not None` +* `x == None` and `x != None` +* `x is ...` and `x is not ...` +* `x == ...` and `x != ...` +* `type(x) is T` and `type(x) is not T` +* `type(x) == T` and `type(x) != T` +* `x is E` and `x is not E` (where E is a literal enum or bool) +* `x == L` and `x != L` (where L is an expression that evaluates to a literal type) +* `x.y is None` and `x.y is not None` (where x is a type that is distinguished by a field with a None) +* `x.y is E` and `x.y is not E` (where E is a literal enum or bool and x is a type that is distinguished by a field with a literal type) +* `x.y == L` and `x.y != L` (where L is a literal expression and x is a type that is distinguished by a field or property with a literal type) +* `x[K] == V`, `x[K] != V`, `x[K] is V`, and `x[K] is not V` (where K and V are literal expressions and x is a type that is distinguished by a TypedDict field with a literal type) +* `x[I] == V` and `x[I] != V` (where I and V are literal expressions and x is a known-length tuple that is distinguished by the index indicated by I) +* `x[I] is B` and `x[I] is not B` (where I is a literal expression, B is a `bool` or enum literal, and x is a known-length tuple that is distinguished by the index indicated by I) +* `x[I] is None` and `x[I] is not None` (where I is a literal expression and x is a known-length tuple that is distinguished by the index indicated by I) +* `len(x) == L` and `len(x) != L` (where x is tuple and L is a literal integer) +* `x in y` or `x not in y` (where y is instance of list, set, frozenset, deque, tuple, dict, defaultdict, or OrderedDict) +* `S in D` and `S not in D` (where S is a string literal and D is a final TypedDict) +* `isinstance(x, T)` (where T is a type or a tuple of types) +* `issubclass(x, T)` (where T is a type or a tuple of types) +* `callable(x)` +* `f(x)` (where f is a user-defined type guard as defined in [PEP 647](https://www.python.org/dev/peps/pep-0647/)) +* `bool(x)` (where x is any expression that is statically verifiable to be truthy or falsey in all cases) +* `x` (where x is any expression that is statically verifiable to be truthy or falsey in all cases) + +Expressions supported for type guards include simple names, member access chains (e.g. `a.b.c.d`), the unary `not` operator, the binary `and` and `or` operators, subscripts that are integer literals (e.g. `a[2]` or `a[-1]`), and call expressions. Other operators (such as arithmetic operators or other subscripts) are not supported. + +Some type guards are able to narrow in both the positive and negative cases. Positive cases are used in `if` statements, and negative cases are used in `else` statements. (Positive and negative cases are flipped if the type guard expression is preceded by a `not` operator.) In some cases, the type can be narrowed only in the positive or negative case but not both. Consider the following examples: + +```python +class Foo: pass +class Bar: pass + +def func1(val: Foo | Bar): + if isinstance(val, Bar): + reveal_type(val) # Bar + else: + reveal_type(val) # Foo + +def func2(val: float | None): + if val: + reveal_type(val) # float + else: + reveal_type(val) # float | None +``` + +In the example of `func1`, the type was narrowed in both the positive and negative cases. In the example of `func2`, the type was narrowed only the positive case because the type of `val` might be either `float` (specifically, a value of 0.0) or `None` in the negative case. + +### Aliased Conditional Expression + +Pyright also supports a type guard expression `c`, where `c` is an identifier that refers to a local variable that is assigned one of the above supported type guard expression forms. These are called “aliased conditional expressions”. Examples include `c = a is not None` and `c = isinstance(a, str)`. When “c” is used within a conditional check, it can be used to narrow the type of expression `a`. + +This pattern is supported only in cases where `c` is a local variable within a module or function scope and is assigned a value only once. It is also limited to cases where expression `a` is a simple identifier (as opposed to a member access expression or subscript expression), is local to the function or module scope, and is assigned only once within the scope. Unary `not` operators are allowed for expression `a`, but binary `and` and `or` are not. + +```python +def func1(x: str | None): + is_str = x is not None + + if is_str: + reveal_type(x) # str + else: + reveal_type(x) # None +``` + +```python +def func2(val: str | bytes): + is_str = not isinstance(val, bytes) + + if not is_str: + reveal_type(val) # bytes + else: + reveal_type(val) # str +``` + +```python +def func3(x: list[str | None]) -> str: + is_str = x[0] is not None + + if is_str: + # This technique doesn't work for subscript expressions, + # so x[0] is not narrowed in this case. + reveal_type(x[0]) # str | None +``` + +```python +def func4(x: str | None): + is_str = x is not None + + if is_str: + # This technique doesn't work in cases where the target + # expression is assigned elsewhere. Here `x` is assigned + # elsewhere in the function, so its type is not narrowed + # in this case. + reveal_type(x) # str | None + + x = "" +``` + +### Narrowing for Implied Else +When an “if” or “elif” clause is used without a corresponding “else”, Pyright will generally assume that the code can “fall through” without executing the “if” or “elif” block. However, there are cases where the analyzer can determine that a fall-through is not possible because the “if” or “elif” is guaranteed to be executed based on type analysis. + +```python +def func1(x: int): + if x == 1 or x == 2: + y = True + + print(y) # Error: "y" is possibly unbound + +def func2(x: Literal[1, 2]): + if x == 1 or x == 2: + y = True + + print(y) # No error +``` + +This can be especially useful when exhausting all members in an enum or types in a union. + +```python +from enum import Enum + +class Color(Enum): + RED = 1 + BLUE = 2 + GREEN = 3 + +def func3(color: Color) -> str: + if color == Color.RED or color == Color.BLUE: + return "yes" + elif color == Color.GREEN: + return "no" + +def func4(value: str | int) -> str: + if isinstance(value, str): + return "received a str" + elif isinstance(value, int): + return "received an int" +``` + +If you later added another color to the `Color` enumeration above (e.g. `YELLOW = 4`), Pyright would detect that `func3` no longer exhausts all members of the enumeration and possibly returns `None`, which violates the declared return type. Likewise, if you modify the type of the `value` parameter in `func4` to expand the union, a similar error will be produced. + +This “narrowing for implied else” technique works for all narrowing expressions listed above with the exception of simple falsey/truthy statements and type guards. These are excluded because they are not generally used for exhaustive checks, and their inclusion would have a significant impact on analysis performance. + + +### Narrowing Any + +In general, the type `Any` is not narrowed. The only exceptions to this rule are the built-in `isinstance` and `issubclass` type guards, class pattern matching in “match” statements, and user-defined type guards. In all other cases, `Any` is left as is, even for assignments. + +```python +a: Any = 3 +reveal_type(a) # Any + +a = "hi" +reveal_type(a) # Any +``` + +The same applies to `Any` when it is used as a type argument. + +```python +b: Iterable[Any] = [1, 2, 3] +reveal_type(b) # list[Any] + +c: Iterable[str] = [""] +b = c +reveal_type(b) # list[Any] +``` + +### Constrained Type Variables and Conditional Types + +When a TypeVar is defined, it can be constrained to two or more types. + +```python +# Example of unconstrained type variable +_T = TypeVar("_T") + +# Example of constrained type variables +_StrOrFloat = TypeVar("_StrOrFloat", str, float) +``` + +When a constrained TypeVar appears more than once within a function signature, the type provided for all instances of the TypeVar must be consistent. + +```python +def add(a: _StrOrFloat, b: _StrOrFloat) -> _StrOrFloat: + return a + b + +# The arguments for `a` and `b` are both `str` +v1 = add("hi", "there") +reveal_type(v1) # str + +# The arguments for `a` and `b` are both `float` +v2 = add(1.3, 2.4) +reveal_type(v2) # float + +# The arguments for `a` and `b` are inconsistent types +v3 = add(1.3, "hi") # Error +``` + +When checking the implementation of a function that uses constrained type variables in its signature, the type checker must verify that type consistency is guaranteed. Consider the following example, where the input parameter and return type are both annotated with a constrained type variable. The type checker must verify that if a caller passes an argument of type `str`, then all code paths must return a `str`. Likewise, if a caller passes an argument of type `float`, all code paths must return a `float`. + +```python +def add_one(value: _StrOrFloat) -> _StrOrFloat: + if isinstance(value, str): + sum = value + "1" + else: + sum = value + 1 + + reveal_type(sum) # str* | float* + return sum +``` + +Notice that the type of variable `sum` is reported with asterisks (`*`). This indicates that internally the type checker is tracking the type as conditional. In this particular example, it indicates that `sum` is a `str` type if the parameter `value` is a `str` but is a `float` if `value` is a `float`. By tracking these conditional types, the type checker can verify that the return type is consistent with the return type `_StrOrFloat`. + + +### Inferred type of self and cls parameters + +When a type annotation for a method’s `self` or `cls` parameter is omitted, pyright will infer its type based on the class that contains the method. The inferred type is internally represented as a type variable that is bound to the class. + +The type of `self` is represented as `Self@ClassName` where `ClassName` is the class that contains the method. Likewise, the `cls` parameter in a class method will have the type `Type[Self@ClassName]`. + +```python +class Parent: + def method1(self): + reveal_type(self) # Self@Parent + return self + + @classmethod + def method2(cls): + reveal_type(cls) # Type[Self@Parent] + return cls + +class Child(Parent): + ... + +reveal_type(Child().method1()) # Child +reveal_type(Child.method2()) # Type[Child] +``` + +### Overloads + +Some functions or methods can return one of several different types. In cases where the return type depends on the types of the input arguments, it is useful to specify this using a series of `@overload` signatures. When Pyright evaluates a call expression, it determines which overload signature best matches the supplied arguments. + +[PEP 484](https://www.python.org/dev/peps/pep-0484/#function-method-overloading) introduced the `@overload` decorator and described how it can be used, but the PEP did not specify precisely how a type checker should choose the “best” overload. Pyright uses the following rules. + +1. Pyright first filters the list of overloads based on simple “arity” (number of arguments) and keyword argument matching. For example, if one overload requires two position arguments but only one positional argument is supplied by the caller, that overload is eliminated from consideration. Likewise, if the call includes a keyword argument but no corresponding parameter is included in the overload, it is eliminated from consideration. + +2. Pyright next considers the types of the arguments and compares them to the declared types of the corresponding parameters. If the types do not match for a given overload, that overload is eliminated from consideration. Bidirectional type inference is used to determine the types of the argument expressions. + +3. If only one overload remains, it is the “winner”. + +4. If more than one overload remains, the “winner” is chosen based on the order in which the overloads are declared. In general, the first remaining overload is the “winner”. There are two exceptions to this rule. + Exception 1: When an `*args` (unpacked) argument matches a `*args` parameter in one of the overload signatures, this overrides the normal order-based rule. + Exception 2: When two or more overloads match because an argument evaluates to `Any` or `Unknown`, the matching overload is ambiguous. In this case, pyright examines the return types of the remaining overloads and eliminates types that are duplicates or are subsumed by (i.e. proper subtypes of) other types in the list. If only one type remains after this coalescing step, that type is used. If more than one type remains after this coalescing step, the type of the call expression evaluates to `Unknown`. For example, if two overloads are matched due to an argument that evaluates to `Any`, and those two overloads have return types of `str` and `LiteralString`, pyright will coalesce this to just `str` because `LiteralString` is a proper subtype of `str`. If the two overloads have return types of `str` and `bytes`, the call expression will evaluate to `Unknown` because `str` and `bytes` have no overlap. + +5. If no overloads remain, Pyright considers whether any of the arguments are union types. If so, these union types are expanded into their constituent subtypes, and the entire process of overload matching is repeated with the expanded argument types. If two or more overloads match, the union of their respective return types form the final return type for the call expression. + +6. If no overloads remain and all unions have been expanded, a diagnostic is generated indicating that the supplied arguments are incompatible with all overload signatures. + + +### Class and Instance Variables + +Most object-oriented languages clearly differentiate between class variables and instance variables. Python is a bit looser in that it allows an object to overwrite a class variable with an instance variable of the same name. + +```python +class A: + my_var = 0 + + def my_method(self): + self.my_var = "hi!" + +a = A() +print(A.my_var) # Class variable value of 0 +print(a.my_var) # Class variable value of 0 + +A.my_var = 1 +print(A.my_var) # Updated class variable value of 1 +print(a.my_var) # Updated class variable value of 1 + +a.my_method() # Writes to the instance variable my_var +print(A.my_var) # Class variable value of 1 +print(a.my_var) # Instance variable value of "hi!" + +A.my_var = 2 +print(A.my_var) # Updated class variable value of 2 +print(a.my_var) # Instance variable value of "hi!" +``` + +Pyright differentiates between three types of variables: pure class variables, regular class variables, and pure instance variables. + +#### Pure Class Variables +If a class variable is declared with a `ClassVar` annotation as described in [PEP 526](https://peps.python.org/pep-0526/#class-and-instance-variable-annotations), it is considered a “pure class variable” and cannot be overwritten by an instance variable of the same name. + +```python +from typing import ClassVar + +class A: + x: ClassVar[int] = 0 + + def instance_method(self): + self.x = 1 # Type error: Cannot overwrite class variable + + @classmethod + def class_method(cls): + cls.x = 1 + +a = A() +print(A.x) +print(a.x) + +A.x = 1 +a.x = 2 # Type error: Cannot overwrite class variable +``` + +#### Regular Class Variables +If a class variable is declared without a `ClassVar` annotation, it can be overwritten by an instance variable of the same name. The declared type of the instance variable is assumed to be the same as the declared type of the class variable. + +Regular class variables can also be declared within a class method using a `cls` member access expression, but declaring regular class variables within the class body is more common and generally preferred for readability. + +```python +class A: + x: int = 0 + y: int + + def instance_method(self): + self.x = 1 + self.y = 2 + + @classmethod + def class_method(cls): + cls.z: int = 3 + +A.y = 0 +A.z = 0 +print(f"{A.x}, {A.y}, {A.z}") # 0, 0, 0 + +A.class_method() +print(f"{A.x}, {A.y}, {A.z}") # 0, 0, 3 + +a = A() +print(f"{a.x}, {a.y}, {a.z}") # 0, 0, 3 +a.instance_method() +print(f"{a.x}, {a.y}, {a.z}") # 1, 2, 3 + +a.x = "hi!" # Error: Incompatible type +``` + +#### Pure Instance Variables +If a variable is not declared within the class body but is instead declared within a class method using a `self` member access expression, it is considered a “pure instance variable”. Such variables cannot be accessed through a class reference. + +```python +class A: + def __init__(self): + self.x: int = 0 + self.y: int + +print(A.x) # Error: 'x' is not a class variable + +a = A() +print(a.x) + +a.x = 1 +a.y = 2 +print(f"{a.x}, {a.y}") # 1, 2 + +print(a.z) # Error: 'z' is not an known member +``` + +#### Inheritance of Class and Instance Variables +Class and instance variables are inherited from parent classes. If a parent class declares the type of a class or instance variable, a derived class must honor that type when assigning to it. + +```python +class Parent: + x: int | str | None + y: int + +class Child(Parent): + x = "hi!" + y = None # Error: Incompatible type +``` + +The derived class can redeclare the type of a class or instance variable. If `reportIncompatibleVariableOverride` is enabled, the redeclared type must be the same as the type declared by the parent class or a subtype thereof. + +```python +class Parent: + x: int | str | None + y: int + +class Child(Parent): + x: int # This is OK because 'int' is a subtype of 'int | str | None' + y: str # Type error: 'y' cannot be redeclared with an incompatible type +``` + +If a parent class declares the type of a class or instance variable and a derived class does not redeclare it but does assign a value to it, the declared type is retained from the parent class. It is not overridden by the inferred type of the assignment in the derived class. + +```python +class Parent: + x: object + +class Child(Parent): + x = 3 + +reveal_type(Parent.x) # object +reveal_type(Child.x) # object +``` + +If neither the parent nor the derived class declare the type of a class or instance variable, the type is inferred within each class. + +```python +class Parent: + x = object() + +class Child(Parent): + x = 3 + +reveal_type(Parent.x) # object +reveal_type(Child.x) # int +``` + +#### Type Variable Scoping + +A type variable must be bound to a valid scope (a class, function, or type alias) before it can be used within that scope. + +Pyright displays the bound scope for a type variable using an `@` symbol. For example, `T@func` means that type variable `T` is bound to function `func`. + +```python +S = TypeVar("S") +T = TypeVar("T") + +def func(a: T) -> T: + b: T = a # T refers to T@func + reveal_type(b) # T@func + + c: S # Error: S has no bound scope in this context + return b +``` + +When a TypeVar or ParamSpec appears within parameter or return type annotations for a function and it is not already bound to an outer scope, it is normally bound to the function. As an exception to this rule, if the TypeVar or ParamSpec appears only within the return type annotation of the function and only within a single Callable in the return type, it is bound to that Callable rather than the function. This allows a function to return a generic Callable. + +```python +# T is bound to func1 because it appears in a parameter type annotation. +def func1(a: T) -> Callable[[T], T]: + a: T # OK because T is bound to func1 + +# T is bound to the return callable rather than func2 because it appears +# only within a return Callable. +def func2() -> Callable[[T], T]: + a: T # Error because T has no bound scope in this context + +# T is bound to func3 because it appears outside of a Callable. +def func3() -> Callable[[T], T] | T: + ... + +# This scoping logic applies also to type aliases used within a return +# type annotation. T is bound to the return Callable rather than func4. +Transform = Callable[[S], S] +def func4() -> Transform[T]: + ... +``` + +### Type Annotation Comments +Versions of Python prior to 3.6 did not support type annotations for variables. Pyright honors type annotations found within a comment at the end of the same line where a variable is assigned. + +```python +offsets = [] # type: list[int] + +self._target = 3 # type: int | str +``` + +Future versions of Python will likely deprecate support for type annotation comments. The “reportTypeCommentUsage” diagnostic will report usage of such comments so they can be replaced with inline type annotations. + diff --git a/docs/type-concepts.md b/docs/type-concepts.md index aab49458b..968d3f853 100644 --- a/docs/type-concepts.md +++ b/docs/type-concepts.md @@ -1,31 +1,11 @@ -## Understanding Typing +## Static Typing: The Basics -Getting started with typing in Python is easy, but it’s important to understand a few simple concepts. +Getting started with static type checking in Python is easy, but it’s important to understand a few simple concepts. ### Type Declarations When you add a type annotation to a variable or a parameter in Python, you are _declaring_ that the symbol will be assigned values that are compatible with that type. You can think of type annotations as a powerful way to comment your code. Unlike text-based comments, these comments are readable by both humans and enforceable by type checkers. -If a variable or parameter has no type annotation, the type checker must assume that any value can be assigned to it. This eliminates the ability for a type checker to identify type incompatibilities. - - -### Debugging Inferred Types - -When you want to know the type that the type checker has inferred for an expression, you can use the special `reveal_type()` function: - -``` -x = 1 -reveal_type(x) # Type of "x" is "Literal[1]" -``` - -This function is always available and does not need to be imported. When you use Pyright within an IDE, you can also simply hover over an expression to see the inferred type. - -You can also see the inferred types of all local variables at once with the `reveal_locals()` function: - -``` -def f(x: int, y: str) -> None: - z = 1.0 - reveal_locals() # Type of "x" is "int". Type of "y" is "str". Type of "z" is "float". -``` +If a variable or parameter has no type annotation, Pyright will assume that any value can be assigned to it. ### Type Assignability @@ -33,20 +13,20 @@ When your code assigns a value to a symbol (in an assignment expression) or a pa Let’s look at a few simple examples. In this first example, the declared type of `a` is `float`, and it is assigned a value that is an `int`. This is permitted because `int` is assignable to `float`. -``` +```python a: float = 3 ``` In this example, the declared type of `b` is `int`, and it is assigned a value that is a `float`. This is flagged as an error because `float` is not assignable to `int`. -``` +```python b: int = 3.4 # Error ``` -This example introduces the notion of a _Union type_, which specifies that a value can be one of several distinct types. +This example introduces the notion of a _Union type_, which specifies that a value can be one of several distinct types. A union type can be expressed using the `|` operator to combine individual types. -``` -c: Union[int, float] = 3.4 +```python +c: int | float = 3.4 c = 5 c = a c = b @@ -56,54 +36,54 @@ c = "" # Error This example introduces the _Optional_ type, which is the same as a union with `None`. -``` +```python d: Optional[int] = 4 d = b d = None d = "" # Error ``` -Those examples are straightforward. Let’s look at one that is less intuitive. In this example, the declared type of `f` is `List[Optional[int]]`. A value of type `List[int]` is being assigned to `f`. As we saw above, `int` is assignable to `Optional[int]`. You might therefore assume that `List[int]` is assignable to `List[Optional[int]]`, but this is an incorrect assumption. To understand why, we need to understand generic types and type arguments. +Those examples are straightforward. Let’s look at one that is less intuitive. In this example, the declared type of `f` is `list[int | None]`. A value of type `list[int]` is being assigned to `f`. As we saw above, `int` is assignable to `int | None`. You might therefore assume that `list[int]` is assignable to `list[int | None]`, but this is an incorrect assumption. To understand why, we need to understand generic types and type arguments. -``` -e: List[int] = [3, 4] -f: List[Optional[int]] = e # Error +```python +e: list[int] = [3, 4] +f: list[int | None] = e # Error ``` ### Generic Types -A _generic type_ is a class that is able to handle different types of inputs. For example, the `List` class is generic because it is able to operate on different types of elements. The type `List` by itself does not specify what is contained within the list. Its element type must be specified as a _type argument_ using the indexing (square bracket) syntax in Python. For example, `List[int]` denotes a list that contains only `int` elements whereas `List[Union[int, float]]` denotes a list that contains a mixture of int and float elements. +A _generic type_ is a class that is able to handle different types of inputs. For example, the `list` class is generic because it is able to operate on different types of elements. The type `list` by itself does not specify what is contained within the list. Its element type must be specified as a _type argument_ using the indexing (square bracket) syntax in Python. For example, `list[int]` denotes a list that contains only `int` elements whereas `list[int | float]` denotes a list that contains a mixture of int and float elements. -We noted above that `List[int]` is not assignable to `List[Optional[int]]`. Why is this the case? Consider the following example. +We noted above that `list[int]` is not assignable to `list[int | None]`. Why is this the case? Consider the following example. -``` -my_list_1: List[int] = [1, 2, 3] -my_list_2: List[Optional[int]] = my_list_1 # Error +```python +my_list_1: list[int] = [1, 2, 3] +my_list_2: list[int | None] = my_list_1 # Error my_list_2.append(None) for elem in my_list_1: print(elem + 1) # Runtime exception ``` -The code is appending the value `None` to the list `my_list_2`, but `my_list_2` refers to the same object as `my_list_1`, which has a declared type of `List[int]`. The code has violated the type of `my_list_1` because it no longer contains only `int` elements. This broken assumption results in a runtime exception. The type checker detects this broken assumption when the code attempts to assign `my_list_1` to `my_list_2`. +The code is appending the value `None` to the list `my_list_2`, but `my_list_2` refers to the same object as `my_list_1`, which has a declared type of `list[int]`. The code has violated the type of `my_list_1` because it no longer contains only `int` elements. This broken assumption results in a runtime exception. The type checker detects this broken assumption when the code attempts to assign `my_list_1` to `my_list_2`. -`List` is an example of a _mutable container type_. It is mutable in that code is allowed to modify its contents — for example, add or remove items. The type parameters for mutable container types are typically marked as _invariant_, which means that an exact type match is enforced. This is why the type checker reports an error when attempting to assign a `List[int]` to a variable of type `List[Optional[int]]`. +`list` is an example of a _mutable container type_. It is mutable in that code is allowed to modify its contents — for example, add or remove items. The type parameters for mutable container types are typically marked as _invariant_, which means that an exact type match is enforced. This is why the type checker reports an error when attempting to assign a `list[int]` to a variable of type `list[int | None]`. Most mutable container types also have immutable counterparts. | Mutable Type | Immutable Type | | ----------------- | -------------- | -| List | Sequence | -| Dict | Mapping | -| Set | AbstractSet | -| n/a | Tuple | +| list | Sequence | +| dict | Mapping | +| set | AbstractSet | +| n/a | tuple | Switching from a mutable container type to a corresponding immutable container type is often an effective way to resolve type errors relating to assignability. Let’s modify the example above by changing the type annotation for `my_list_2`. -``` -my_list_1: List[int] = [1, 2, 3] -my_list_2: Sequence[Optional[int]] = my_list_1 # No longer an error +```python +my_list_1: list[int] = [1, 2, 3] +my_list_2: Sequence[int | None] = my_list_1 # No longer an error ``` The type error on the second line has now gone away. @@ -111,468 +91,13 @@ The type error on the second line has now gone away. For more details about generic types, type parameters, and invariance, refer to [PEP 483 — The Theory of Type Hints](https://www.python.org/dev/peps/pep-0483/). -### Type Narrowing - -Pyright uses a technique called “type narrowing” to track the type of an expression based on code flow. Consider the following code: - -```python -val_str: str = "hi" -val_int: int = 3 - -def func(val: Union[float, str, complex], test: bool): - reveal_type(val) # Union[int, str, complex] - - val = val_int # Type is narrowed to int - reveal_type(val) # int - - if test: - val = val_str # Type is narrowed to str - reveal_type(val) # str - - reveal_type(val) # Union[int, str] - - if isinstance(val, int): - reveal_type(val) # int - print(val) - else: - reveal_type(val) # str - print(val) -``` - -At the start of this function, the type checker knows nothing about `val` other than that its declared type is `Union[float, str, complex]`. Then it is assigned a value that has a known type of `int`. This is a legal assignment because `int` is considered a subclass of `float`. At the point in the code immediately after the assignment, the type checker knows that the type of `val` is an `int`. This is a “narrower” (more specific) type than `Union[float, str, complex]`. Type narrowing is applied when ever a symbol is assigned a new value. - -Another assignment occurs several lines further down, this time within a conditional block. The symbol `val` is assigned a value known to be of type `str`, so the narrowed type of `val` is now `str`. Once the code flow of the conditional block merges with the main body of the function, the narrowed type of `val` becomes `Union[int, str]` because the type checker cannot statically predict whether the conditional block will be executed at runtime. - -Another way that types can be narrowed is through the use of conditional code flow statements like `if`, `while`, and `assert`. Type narrowing applies to the block of code that is “guarded” by that condition, so type narrowing in this context is sometimes referred to as a “type guard”. For example, if you see the conditional statement `if x is None:`, the code within that `if` statement can assume that `x` contains `None`. Within the code sample above, we see an example of a type guard involving a call to `isinstance`. The type checker knows that `isinstance(val, int)` will return True only in the case where `val` contains a value of type `int`, not type `str`. So the code within the `if` block can assume that `val` contains a value of type `int`, and the code within the `else` block can assume that `val` contains a value of type `str`. This demonstrates how a type (in this case `Union[int, str]`) can be narrowed in both a positive (`if`) and negative (`else`) test. - -The following expression forms support type narrowing: - -* `` (where `` is an identifier) -* `.` (member access expression where `` is a supported expression form) -* `[]` (subscript expression where `` is a non-negative integer) -* `[]` (subscript expression where `` is a string literal) - -Examples of expressions that support type narrowing: - -* `my_var` -* `employee.name` -* `a.foo.next` -* `args[3]` -* `kwargs["bar"]` -* `a.b.c[3]["x"].d` - - -### Type Guards - -In addition to assignment-based type narrowing, Pyright supports the following type guards. - -* `x is None` and `x is not None` -* `x == None` and `x != None` -* `type(x) is T` and `type(x) is not T` -* `x is E` and `x is not E` (where E is a literal enum or bool) -* `x == L` and `x != L` (where L is a literal expression) -* `x.y is None` and `x.y is not None` (where x is a type that is distinguished by a field with a None) -* `x.y is E` and `x.y is not E` (where E is a literal enum or bool and x is a type that is distinguished by a field with a literal type) -* `x.y == L` and `x.y != L` (where L is a literal expression and x is a type that is distinguished by a field or property with a literal type) -* `x[K] == V` and `x[K] != V` (where K and V are literal expressions and x is a type that is distinguished by a TypedDict field with a literal type) -* `x[I] == V` and `x[I] != V` (where I and V are literal expressions and x is a known-length tuple that is distinguished by the index indicated by I) -* `x[I] is None` and `x[I] is not None` (where I is a literal expression and x is a known-length tuple that is distinguished by the index indicated by I) -* `len(x) == L` and `len(x) != L` (where x is tuple and L is a literal integer) -* `x in y` or `x not in y` (where y is instance of list, set, frozenset, deque, tuple, dict, defaultdict, or OrderedDict) -* `S in D` and `S not in D` (where S is a string literal and D is a TypedDict) -* `isinstance(x, T)` (where T is a type or a tuple of types) -* `issubclass(x, T)` (where T is a type or a tuple of types) -* `callable(x)` -* `f(x)` (where f is a user-defined type guard as defined in [PEP 647](https://www.python.org/dev/peps/pep-0647/)) -* `bool(x)` (where x is any expression that is statically verifiable to be truthy or falsy in all cases). -* `x` (where x is any expression that is statically verifiable to be truthy or falsy in all cases) - -Expressions supported for type guards include simple names, member access chains (e.g. `a.b.c.d`), the unary `not` operator, the binary `and` and `or` operators, subscripts that are integer literals (e.g. `a[2]` or `a[-1]`), and call expressions. Other operators (such as arithmetic operators or other subscripts) are not supported. - -Some type guards are able to narrow in both the positive and negative cases. Positive cases are used in `if` statements, and negative cases are used in `else` statements. (Positive and negative cases are flipped if the type guard expression is preceded by a `not` operator.) In some cases, the type can be narrowed only in the positive or negative case but not both. Consider the following examples: - -```python -class Foo: pass -class Bar: pass - -def func1(val: Union[Foo, Bar]): - if isinstance(Bar): - reveal_type(val) # Bar - else: - reveal_type(val) # Foo - -def func2(val: Optional[int]): - if val: - reveal_type(val) # int - else: - reveal_type(val) # Optional[int] -``` - -In the example of `func1`, the type was narrowed in both the positive and negative cases. In the example of `func2`, the type was narrowed only the positive case because the type of `val` might be either `int` (specifically, a value of 0) or `None` in the negative case. - -### Aliased Conditional Expression - -Pyright also supports a type guard expression `c`, where `c` is an identifier that refers to a local variable that is assigned one of the above supported type guard expression forms. These are called “aliased conditional expressions”. Examples include `c = a is not None` and `c = isinstance(a, str)`. When “c” is used within a conditional check, it can be used to narrow the type of expression `a`. - -This pattern is supported only in cases where `c` is a local variable within a module or function scope and is assigned a value only once. It is also limited to cases where expression `a` is a simple identifier (as opposed to a member access expression or subscript expression), is local to the function or module scope, and is assigned only once within the scope. Unary `not` operators are allowed for expression `a`, but binary `and` and `or` are not. - -```python -def func1(x: str | None): - is_str = x is not None - - if is_str: - reveal_type(x) # str - else: - reveal_type(x) # None -``` - -```python -def func2(val: str | bytes): - is_str = not isinstance(val, bytes) - - if not is_str: - reveal_type(val) # bytes - else: - reveal_type(val) # str -``` - -```python -def func3(x: List[str | None]) -> str: - is_str = x[0] is not None - - if is_str: - # This technique doesn't work for subscript expressions, - # so x[0] is not narrowed in this case. - reveal_type(x[0]) # str | None -``` - -```python -def func4(x: str | None): - is_str = x is not None - - if is_str: - # This technique doesn't work in cases where the target - # expression is assigned elsewhere. Here `x` is assigned - # elsewhere in the function, so its type is not narrowed - # in this case. - reveal_type(x) # str | None - - x = "" -``` +### Debugging Types - -### Narrowing for Implied Else -When an “if” or “elif” clause is used without a corresponding “else”, Pyright will generally assume that the code can “fall through” without executing the “if” or “elif” block. However, there are cases where the analyzer can determine that a fall-through is not possible because the “if” or “elif” is guaranteed to be executed based on type analysis. - -```python -def func1(x: int): - if x == 1 or x == 2: - y = True - - print(y) # Error: "y" is possibly unbound - -def func2(x: Literal[1, 2]): - if x == 1 or x == 2: - y = True - - print(y) # No error -``` - -This can be especially useful when exhausting all members in an enum or types in a union. - -```python -from enum import Enum - -class Color(Enum): - RED = 1 - BLUE = 2 - GREEN = 3 - -def func3(color: Color) -> str: - if color == Color.RED or color == Color.BLUE: - return "yes" - elif color == Color.GREEN: - return "no" - -def func4(value: str | int) -> str: - if isinstance(value, str): - return "received a str" - elif isinstance(value, int): - return "received an int" -``` - -If you later added another color to the `Color` enumeration above (e.g. `YELLOW = 4`), Pyright would detect that `func3` no longer exhausts all members of the enumeration and possibly returns `None`, which violates the declared return type. Likewise, if you modify the type of the `value` parameter in `func4` to expand the union, a similar error will be produced. - -This “narrowing for implied else” technique works for all narrowing expressions listed above with the exception of simple falsy/truthy statements and type guards. These are excluded because they are not generally used for exhaustive checks, and their inclusion would have a significant impact on analysis performance. - -### Narrowing Any - -In general, the type `Any` is not narrowed. The only exceptions to this rule are the built-in `isinstance` and `issubclass` type guards, class pattern matching in “match” statements, and user-defined type guards. In all other cases, `Any` is left as is, even for assignments. - -```python -a: Any = 3 -reveal_type(a) # Any - -a = "hi" -reveal_type(a) # Any -``` - -The same applies to `Any` when it is used as a type argument. +When you want to know the type that the type checker has evaluated for an expression, you can use the special `reveal_type()` function: ```python -b: Iterable[Any] = [1, 2, 3] -reveal_type(b) # List[Any] - -c: Iterable[str] = [""] -b = c -reveal_type(b) # List[Any] -``` - -### Constrained Type Variables and Conditional Types - -When a TypeVar is defined, it can be constrained to two or more types. - -```python -# Example of unconstrained type variable -_T = TypeVar("_T") - -# Example of constrained type variables -_StrOrFloat = TypeVar("_StrOrFloat", str, float) -``` - -When a constrained TypeVar appears more than once within a function signature, the type provided for all instances of the TypeVar must be consistent. - -```python -def add(a: _StrOrFloat, b: _StrOrFloat) -> _StrOrFloat: - return a + b - -# The arguments for `a` and `b` are both `str` -v1 = add("hi", "there") -reveal_type(v1) # str - -# The arguments for `a` and `b` are both `float` -v2 = add(1.3, 2.4) -reveal_type(v2) # float - -# The arguments for `a` and `b` are inconsistent types -v3 = add(1.3, "hi") # Error -``` - -When checking the implementation of a function that uses constrained type variables in its signature, the type checker must verify that type consistency is guaranteed. Consider the following example, where the input parameter and return type are both annotated with a constrained type variable. The type checker must verify that if a caller passes an argument of type `str`, then all code paths must return a `str`. Likewise, if a caller passes an argument of type `float`, all code paths must return a `float`. - -```python -def add_one(value: _StrOrFloat) -> _StrOrFloat: - if isinstance(value, str): - sum = value + "1" - else: - sum = value + 1 - - reveal_type(sum) # str* | float* - return sum -``` - -Notice that the type of variable `sum` is reported with asterisks (`*`). This indicates that internally the type checker is tracking the type as conditional. In this particular example, it indicates that `sum` is a `str` type if the parameter `value` is a `str` but is a `float` if `value` is a `float`. By tracking these conditional types, the type checker can verify that the return type is consistent with the return type `_StrOrFloat`. - - -### Inferred type of self and cls parameters - -When a type annotation for a method’s `self` or `cls` parameter is omitted, pyright will infer its type based on the class that contains the method. The inferred type is internally represented as a type variable that is bound to the class. - -The type of `self` is represented as `Self@ClassName` where `ClassName` is the class that contains the method. Likewise, the `cls` parameter in a class method will have the type `Type[Self@ClassName]`. - -```python -class Parent: - def method1(self): - reveal_type(self) # Self@Parent - return self - - @classmethod - def method2(cls): - reveal_type(cls) # Type[Self@Parent] - return cls - -class Child(Parent): - ... - -reveal_type(Child().method1()) # Child -reveal_type(Child.method2()) # Type[Child] -``` - -### Overloads - -Some functions or methods can return one of several different types. In cases where the return type depends on the types of the input parameters, it is useful to specify this using a series of `@overload` signatures. When Pyright evaluates a call expression, it determines which overload signature best matches the supplied arguments. - -[PEP 484](https://www.python.org/dev/peps/pep-0484/#function-method-overloading) introduced the `@overload` decorator and described how it can be used, but the PEP did not specify precisely how a type checker should choose the “best” overload. Pyright uses the following rules. - -1. Pyright first filters the list of overloads based on simple “arity” (number of arguments) and keyword argument matching. For example, if one overload requires two position arguments but only one positional argument is supplied by the caller, that overload is eliminated from consideration. Likewise, if the call includes a keyword argument but no corresponding parameter is included in the overload, it is eliminated from consideration. - -2. Pyright next considers the types of the arguments and compares them to the declared types of the corresponding parameters. If the types do not match for a given overload, that overload is eliminated from consideration. Bidirectional type inference is used to determine the types of the argument expressions. - -3. If only one overload remains, it is the “winner”. - -4. If more than one overload remains, the “winner” is chosen based on the order in which the overloads are declared. In general, the first remaining overload is the “winner”. One exception to this rule is when a `*args` (unpacked) argument matches a `*args` parameter in one of the overload signatures. This situation overrides the normal order-based rule. - -5. If no overloads remain, Pyright considers whether any of the arguments are union types. If so, these union types are expanded into their constituent subtypes, and the entire process of overload matching is repeated with the expanded argument types. If two or more overloads match, the union of their respective return types form the final return type for the call expression. - -6. If no overloads remain and all unions have been expanded, a diagnostic is generated indicating that the supplied arguments are incompatible with all overload signatures. - - -### Class and Instance Variables - -Most object-oriented languages clearly differentiate between class variables and instance variables. Python is a bit looser in that it allows an object to overwrite a class variable with an instance variable of the same name. - -```python -class A: - my_var = 0 - - def my_method(self): - self.my_var = "hi!" - -a = A() -print(A.my_var) # Class variable value of 0 -print(a.my_var) # Class variable value of 0 - -A.my_var = 1 -print(A.my_var) # Updated class variable value of 1 -print(a.my_var) # Updated class variable value of 1 - -a.my_method() # Writes to the instance variable my_var -print(A.my_var) # Class variable value of 1 -print(a.my_var) # Instance variable value of "hi!" - -A.my_var = 2 -print(A.my_var) # Updated class variable value of 2 -print(a.my_var) # Instance variable value of "hi!" -``` - -Pyright differentiates between three types of variables: pure class variables, regular class variables, and pure instance variables. - -#### Pure Class Variables -If a class variable is declared with a `ClassVar` annotation as described in [PEP 526](https://peps.python.org/pep-0526/#class-and-instance-variable-annotations), it is considered a “pure class variable” and cannot be overwritten by an instance variable of the same name. - -```python -from typing import ClassVar - -class A: - x: ClassVar[int] = 0 - - def instance_method(self): - self.x = 1 # Type error: Cannot overwrite class variable - - @classmethod - def class_method(cls): - cls.x = 1 - -a = A() -print(A.x) -print(a.x) - -A.x = 1 -a.x = 2 # Type error: Cannot overwrite class variable -``` - -#### Regular Class Variables -If a class variable is declared without a `ClassVar` annotation, it can be overwritten by an instance variable of the same name. The declared type of the instance variable is assumed to be the same as the declared type of the class variable. - -Regular class variables can also be declared within a class method using a `cls` member access expression, but declaring regular class variables within the class body is more common and generally preferred for readability. - -```python -class A: - x: int = 0 - y: int - - def instance_method(self): - self.x = 1 - self.y = 2 - - @classmethod - def class_method(cls): - cls.z: int = 3 - -A.y = 0 -A.z = 0 -print(f"{A.x}, {A.y}, {A.z}") # 0, 0, 0 - -A.class_method() -print(f"{A.x}, {A.y}, {A.z}") # 0, 0, 3 - -a = A() -print(f"{a.x}, {a.y}, {a.z}") # 0, 0, 3 -a.instance_method() -print(f"{a.x}, {a.y}, {a.z}") # 1, 2, 3 - -a.x = "hi!" # Error: Incompatible type -``` - -#### Pure Instance Variables -If a variable is not declared within the class body but is instead declared within a class method using a `self` member access expression, it is considered a “pure instance variable”. Such variables cannot be accessed through a class reference. - -```python -class A: - def __init__(self): - self.x: int = 0 - self.y: int - -print(A.x) # Error: 'x' is not a class variable - -a = A() -print(a.x) - -a.x = 1 -a.y = 2 -print(f"{a.x}, {a.y}") # 1, 2 - -print(a.z) # Error: 'z' is not an known member -``` - -#### Inheritance of Class and Instance Variables -Class and instance variables are inherited from parent classes. If a parent class declares the type of a class or instance variable, a derived class must honor that type when assigning to it. - -```python -class Parent: - x: int | str | None - y: int - -class Child(Parent): - x = "hi!" - y = None # Error: Incompatible type -``` - -The derived class can redeclare the type of a class or instance variable. If `reportIncompatibleVariableOverride` is enabled, the redeclared type must be the same as the type declared by the parent class or a subtype thereof. - -```python -class Parent: - x: int | str | None - y: int - -class Child(Parent): - x: int # This is OK because 'int' is a subtype of 'int | str | None' - y: str # Type error: 'y' cannot be redeclared with an incompatible type -``` - -If a parent class declares the type of a class or instance variable and a derived class does not redeclare it but does assign a value to it, the declared type is retained from the parent class. It is not overridden by the inferred type of the assignment in the derived class. - -```python -class Parent: - x: object - -class Child(Parent): - x = 3 - -reveal_type(Parent.x) # object -reveal_type(Child.x) # object -``` - -If neither the parent nor the derived class declare the type of a class or instance variable, the type is inferred within each class. - -```python -class Parent: - x = object() - -class Child(Parent): - x = 3 - -reveal_type(Parent.x) # object -reveal_type(Child.x) # int +x = 1 +reveal_type(x) # Type of "x" is "Literal[1]" ``` +This function is always available and does not need to be imported. When you use Pyright within an IDE, you can also simply hover over an identifier to see its evaluated type. diff --git a/docs/type-inference.md b/docs/type-inference.md index a2c65cc64..59f50585d 100644 --- a/docs/type-inference.md +++ b/docs/type-inference.md @@ -1,6 +1,6 @@ -# Understanding Type Inference +## Understanding Type Inference -## Symbols and Scopes +### Symbols and Scopes In Python, a _symbol_ is any name that is not a keyword. Symbols can represent classes, functions, methods, variables, parameters, modules, type aliases, type variables, etc. @@ -13,7 +13,7 @@ The following constructs within Python define a scope: 4. Each function and lambda defines its own scope. The function’s parameters are symbols within its scope, as are any variables defined within the function. 5. List comprehensions define their own scope. -## Type Declarations +### Type Declarations A symbol can be declared with an explicit type. The “def” and “class” keywords, for example, declare a symbol as a function or a class. Other symbols in Python can be introduced into a scope with no declared type. Newer versions of Python have introduced syntax for declaring the types of input parameters, return parameters, and variables. @@ -31,7 +31,7 @@ def func1(p1: float, p2: str, p3, **p4) -> None: Symbol | Symbol Category | Scope | Declared Type ----------|-----------------|-----------|---------------------------------------------------- -func1 | Function | Module | (float, str, Any, Dict[str, Any]) -> None +func1 | Function | Module | (float, str, Any, dict[str, Any]) -> None p1 | Parameter | func1 | float p2 | Parameter | func1 | str p3 | Parameter | func1 | @@ -43,35 +43,35 @@ var3 | Variable | func1 | Note that once a symbol’s type is declared, it cannot be redeclared to a different type. -## Type Inference +### Type Inference Some languages require every symbol to be explicitly typed. Python allows a symbol to be bound to different values at runtime, so its type can change over time. A symbol’s type doesn’t need to be declared statically. When Pyright encounters a symbol with no type declaration, it attempts to _infer_ the type based on the values assigned to it. As we will see below, type inference cannot always determine the correct (intended) type, so type annotations are still required in some cases. Furthermore, type inference can require significant computation, so it is much less efficient than when type annotations are provided. -## “Unknown” Type +### “Unknown” Type If a symbol’s type cannot be inferred, Pyright sets its type to “Unknown”, which is a special form of “Any”. The “Unknown” type allows Pyright to optionally warn when types are not declared and cannot be inferred, thus leaving potential “blind spots” in type checking. -### Single-Assignment Type Inference +#### Single-Assignment Type Inference The simplest form of type inference is one that involves a single assignment to a symbol. The inferred type comes from the type of the source expression. Examples include: ```python var1 = 3 # Inferred type is int var2 = "hi" # Inferred type is str -var3 = list() # Inferred type is List[Unknown] -var4 = [3, 4] # Inferred type is List[int] +var3 = list() # Inferred type is list[Unknown] +var4 = [3, 4] # Inferred type is list[int] for var5 in [3, 4]: ... # Inferred type is int -var6 = [p for p in [1, 2, 3]] # Inferred type is List[int] +var6 = [p for p in [1, 2, 3]] # Inferred type is list[int] ``` -### Multi-Assignment Type Inference +#### Multi-Assignment Type Inference When a symbol is assigned values in multiple places within the code, those values may have different types. The inferred type of the variable is the union of all such types. ```python -# In this example, symbol var1 has an inferred type of Union[str, int]. +# In this example, symbol var1 has an inferred type of `str | int`]`. class Foo: def __init__(self): self.var1 = "" @@ -79,22 +79,22 @@ class Foo: def do_something(self, val: int): self.var1 = val -# In this example, symbol var2 has an inferred type of Optional[Foo]. +# In this example, symbol var2 has an inferred type of `Foo | None`. if __debug__: var2 = None else: var2 = Foo() ``` -### Ambiguous Type Inference +#### Ambiguous Type Inference -In some cases, an expression’s type is ambiguous. For example, what is the type of the expression `[]`? Is it `List[None]`, `List[int]`, `List[Any]`, `Sequence[Any]`, `Iterable[Any]`? These ambiguities can lead to unintended type violations. Pyright uses several techniques for reducing these ambiguities based on contextual information. In the absence of contextual information, heuristics are used. +In some cases, an expression’s type is ambiguous. For example, what is the type of the expression `[]`? Is it `list[None]`, `list[int]`, `list[Any]`, `Sequence[Any]`, `Iterable[Any]`? These ambiguities can lead to unintended type violations. Pyright uses several techniques for reducing these ambiguities based on contextual information. In the absence of contextual information, heuristics are used. -### Bidirectional Type Inference (Expected Types) +#### Bidirectional Type Inference (Expected Types) One powerful technique Pyright uses to eliminate type inference ambiguities is _bidirectional inference_. This technique makes use of an “expected type”. -As we saw above, the type of the expression `[]` is ambiguous, but if this expression is passed as an argument to a function, and the corresponding parameter is annotated with the type `List[int]`, Pyright can now assume that the type of `[]` in this context must be `List[int]`. Ambiguity eliminated! +As we saw above, the type of the expression `[]` is ambiguous, but if this expression is passed as an argument to a function, and the corresponding parameter is annotated with the type `list[int]`, Pyright can now assume that the type of `[]` in this context must be `list[int]`. Ambiguity eliminated! This technique is called “bidirectional inference” because type inference for an assignment normally proceeds by first determining the type of the right-hand side (RHS) of the assignment, which then informs the type of the left-hand side (LHS) of the assignment. With bidirectional inference, if the LHS of an assignment has a declared type, it can influence the inferred type of the RHS. @@ -102,14 +102,14 @@ Let’s look at a few examples: ```python var1 = [] # Type of RHS is ambiguous -var2: List[int] = [] # Type of LHS now makes type of RHS unambiguous -var3 = [4] # Type is assumed to be List[int] -var4: List[float] = [4] # Type of RHS is now List[float] -var5 = (3,) # Type is assumed to be Tuple[Literal[3]] -var6: Tuple[float, ...] = (3,) # Type of RHS is now Tuple[float, ...] +var2: list[int] = [] # Type of LHS now makes type of RHS unambiguous +var3 = [4] # Type is assumed to be list[int] +var4: list[float] = [4] # Type of RHS is now list[float] +var5 = (3,) # Type is assumed to be tuple[Literal[3]] +var6: tuple[float, ...] = (3,) # Type of RHS is now tuple[float, ...] ``` -### Empty List and Dictionary Type Inference +#### Empty List and Dictionary Type Inference It is common to initialize a local variable or instance variable to an empty list (`[]`) or empty dictionary (`{}`) on one code path but initialize it to a non-empty list or dictionary on other code paths. In such cases, Pyright will infer the type based on the non-empty list or dictionary and suppress errors about a “partially unknown type”. @@ -123,7 +123,7 @@ reveal_type(my_list) # list[str] ``` -### Return Type Inference +#### Return Type Inference As with variable assignments, function return types can be inferred from the `return` statements found within that function. The returned type is assumed to be the union of all types returned from all `return` statements. If a `return` statement is not followed by an expression, it is assumed to return `None`. Likewise, if the function does not end in a `return` statement, and the end of the function is reachable, an implicit `return None` is assumed. @@ -131,7 +131,7 @@ As with variable assignments, function return types can be inferred from the `re # This function has two explicit return statements and one implicit # return (at the end). It does not have a declared return type, # so Pyright infers its return type based on the return expressions. -# In this case, the inferred return type is Union[str, bool, None]. +# In this case, the inferred return type is `str | bool | None`. def func1(val: int): if val > 3: @@ -140,7 +140,7 @@ def func1(val: int): return True ``` -### NoReturn return type +#### NoReturn return type If there is no code path that returns from a function (e.g. all code paths raise an exception), Pyright infers a return type of `NoReturn`. As an exception to this rule, if the function is decorated with `@abstractmethod`, the return type is not inferred as `NoReturn` even if there is no return. This accommodates a common practice where an abstract method is implemented with a `raise NotImplementedError()` statement. @@ -156,11 +156,11 @@ class Foo: raise NotImplementedError() ``` -### Generator return types +#### Generator return types Pyright can infer the return type for a generator function from the `yield` statements contained within that function. -### Call-site Return Type Inference +#### Call-site Return Type Inference It is common for input parameters to be unannotated. This can make it difficult for Pyright to infer the correct return type for a function. For example: @@ -168,7 +168,7 @@ It is common for input parameters to be unannotated. This can make it difficult # The return type of this function cannot be fully inferred based # on the information provided because the types of parameters # a and b are unknown. In this case, the inferred return -# type is Union[Unknown, None]. +# type is `Unknown | None`. def func1(a, b, c): if c: @@ -183,15 +183,15 @@ In cases where all parameters are unannotated, Pyright uses a technique called _ ```python def func2(p_int: int, p_str: str, p_flt: float): - # The type of var1 is inferred to be Union[int, None] based + # The type of var1 is inferred to be `int | None` based # on call-site return type inference. var1 = func1(p_int, p_int, p_int) - # The type of var2 is inferred to be Union[str, float, None]. + # The type of var2 is inferred to be `str | float | None`. var2 = func1(p_str, p_flt, p_int) ``` -### Parameter Type Inference +#### Parameter Type Inference Input parameters for functions and methods typically require type annotations. There are several cases where Pyright may be able to infer a parameter’s type if it is unannotated. @@ -225,7 +225,7 @@ def func(a, b=0, c=None): reveal_type(func) # (a: Unknown, b: int, c: Unknown | None) -> None ``` -### Literals +#### Literals Python 3.8 introduced support for _literal types_. This allows a type checker like Pyright to track specific literal values of str, bytes, int, bool, and enum values. As with other types, literal types can be declared. @@ -242,105 +242,105 @@ def func2(mode: Literal["r", "w", "rw"]) -> None: When Pyright is performing type inference, it generally does not infer literal types. Consider the following example: ```python -# If Pyright inferred the type of var1 to be List[Literal[4]], +# If Pyright inferred the type of var1 to be list[Literal[4]], # any attempt to append a value other than 4 to this list would # generate an error. Pyright therefore infers the broader -# type List[int]. +# type list[int]. var1 = [4] ``` -### Tuple Expressions +#### Tuple Expressions When inferring the type of a tuple expression (in the absence of bidirectional inference hints), Pyright assumes that the tuple has a fixed length, and each tuple element is typed as specifically as possible. ```python -# The inferred type is Tuple[Literal[1], Literal["a"], Literal[True]] +# The inferred type is tuple[Literal[1], Literal["a"], Literal[True]] var1 = (1, "a", True) def func1(a: int): - # The inferred type is Tuple[int, int] + # The inferred type is tuple[int, int] var2 = (a, a) - # If you want the type to be Tuple[int, ...] - # (i.e. a homogenous tuple of indeterminate length), + # If you want the type to be tuple[int, ...] + # (i.e. a homogeneous tuple of indeterminate length), # use a type annotation. - var3: Tuple[int, ...] = (a, a) + var3: tuple[int, ...] = (a, a) ``` -### List Expressions +#### List Expressions When inferring the type of a list expression (in the absence of bidirectional inference hints), Pyright uses the following heuristics: -1. If the list is empty (`[]`), assume `List[Unknown]` (unless a known list type is assigned to the same variable along another code path). -2. If the list contains at least one element and all elements are the same type T, infer the type `List[T]`. +1. If the list is empty (`[]`), assume `list[Unknown]` (unless a known list type is assigned to the same variable along another code path). +2. If the list contains at least one element and all elements are the same type T, infer the type `list[T]`. 3. If the list contains multiple elements that are of different types, the behavior depends on the `strictListInference` configuration setting. By default this setting is off. - * If `strictListInference` is off, infer `List[Unknown]`. - * Otherwise use the union of all element types and infer `List[Union[(elements)]]`. + * If `strictListInference` is off, infer `list[Unknown]`. + * Otherwise use the union of all element types and infer `list[Union[(elements)]]`. These heuristics can be overridden through the use of bidirectional inference hints (e.g. by providing a declared type for the target of the assignment expression). ```python -var1 = [] # Infer List[Unknown] +var1 = [] # Infer list[Unknown] -var2 = [1, 2] # Infer List[int] +var2 = [1, 2] # Infer list[int] # Type depends on strictListInference config setting -var3 = [1, 3.4] # Infer List[Unknown] (off) -var3 = [1, 3.4] # Infer List[Union[int, float]] (on) +var3 = [1, 3.4] # Infer list[Unknown] (off) +var3 = [1, 3.4] # Infer list[int | float] (on) -var4: List[float] = [1, 3.4] # Infer List[float] +var4: list[float] = [1, 3.4] # Infer list[float] ``` -### Set Expressions +#### Set Expressions When inferring the type of a set expression (in the absence of bidirectional inference hints), Pyright uses the following heuristics: -1. If the set contains at least one element and all elements are the same type T, infer the type `Set[T]`. +1. If the set contains at least one element and all elements are the same type T, infer the type `set[T]`. 2. If the set contains multiple elements that are of different types, the behavior depends on the `strictSetInference` configuration setting. By default this setting is off. - * If `strictSetInference` is off, infer `Set[Unknown]`. - * Otherwise use the union of all element types and infer `Set[Union[(elements)]]`. + * If `strictSetInference` is off, infer `set[Unknown]`. + * Otherwise use the union of all element types and infer `set[Union[(elements)]]`. These heuristics can be overridden through the use of bidirectional inference hints (e.g. by providing a declared type for the target of the assignment expression). ```python -var1 = {1, 2} # Infer Set[int] +var1 = {1, 2} # Infer set[int] # Type depends on strictSetInference config setting -var2 = {1, 3.4} # Infer Set[Unknown] (off) -var2 = {1, 3.4} # Infer Set[Union[int, float]] (on) +var2 = {1, 3.4} # Infer set[Unknown] (off) +var2 = {1, 3.4} # Infer set[int | float] (on) -var3: Set[float] = {1, 3.4} # Infer Set[float] +var3: set[float] = {1, 3.4} # Infer set[float] ``` -### Dictionary Expressions +#### Dictionary Expressions When inferring the type of a dictionary expression (in the absence of bidirectional inference hints), Pyright uses the following heuristics: -1. If the dict is empty (`{}`), assume `Dict[Unknown, Unknown]`. -2. If the dict contains at least one element and all keys are the same type K and all values are the same type V, infer the type `Dict[K, V]`. +1. If the dict is empty (`{}`), assume `dict[Unknown, Unknown]`. +2. If the dict contains at least one element and all keys are the same type K and all values are the same type V, infer the type `dict[K, V]`. 3. If the dict contains multiple elements where the keys or values differ in type, the behavior depends on the `strictDictionaryInference` configuration setting. By default this setting is off. - * If `strictDictionaryInference` is off, infer `Dict[Unknown, Unknown]`. - * Otherwise use the union of all key and value types `Dict[Union[(keys), Union[(values)]]]`. + * If `strictDictionaryInference` is off, infer `dict[Unknown, Unknown]`. + * Otherwise use the union of all key and value types `dict[Union[(keys)], Union[(values)]]`. ```python -var1 = {} # Infer Dict[Unknown, Unknown] +var1 = {} # Infer dict[Unknown, Unknown] -var2 = {1: ""} # Infer Dict[int, str] +var2 = {1: ""} # Infer dict[int, str] # Type depends on strictDictionaryInference config setting -var3 = {"a": 3, "b": 3.4} # Infer Dict[str, Unknown] (off) -var3 = {"a": 3, "b": 3.4} # Infer Dict[str, Union[int, float]] (on) +var3 = {"a": 3, "b": 3.4} # Infer dict[str, Unknown] (off) +var3 = {"a": 3, "b": 3.4} # Infer dict[str, int | float] (on) -var4: Dict[str, float] = {"a": 3, "b": 3.4} +var4: dict[str, float] = {"a": 3, "b": 3.4} ``` -### Lambdas +#### Lambdas Lambdas present a particular challenge for a Python type checker because there is no provision in the Python syntax for annotating the types of a lambda’s input parameters. The types of these parameters must therefore be inferred based on context using bidirectional type inference. Absent this context, a lambda’s input parameters (and often its return type) will be unknown. @@ -349,7 +349,7 @@ Lambdas present a particular challenge for a Python type checker because there i var1 = lambda a, b: a + b # This function takes a comparison function callback. -def float_sort(list: List[float], comp: Callable[[float, float], bool]): ... +def float_sort(list: list[float], comp: Callable[[float, float], bool]): ... # In this example, the types of the lambda’s input parameters # a and b can be inferred to be float because the float_sort diff --git a/docs/type-stubs.md b/docs/type-stubs.md index 525a720ae..6a9343814 100644 --- a/docs/type-stubs.md +++ b/docs/type-stubs.md @@ -1,8 +1,8 @@ -# Type Stub Files +## Type Stub Files Type stubs are “.pyi” files that specify the public interface for a library. They use a variant of the Python syntax that allows for “...” to be used in place of any implementation details. Type stubs define the public contract for the library. -## Importance of Type Stub Files +### Importance of Type Stub Files Regardless of the search path, Pyright always attempts to resolve an import with a type stub (“.pyi”) file before falling back to a python source (“.py”) file. If a type stub cannot be located for an external import, Pyright will try to use inline type information if the module is part of a package that contains a “py.typed” file (defined in [PEP 561](https://www.python.org/dev/peps/pep-0561/)). If the module is part of a package that doesn’t contain a “py.typed” file, Pyright will treat all of the symbols imported from these modules will be of type “Unknown”, and wildcard imports (of the form `from foo import *`) will not populate the module’s namespace with specific symbol names. @@ -16,27 +16,27 @@ Why does Pyright not attempt (by default) to determine types from imported pytho If you’re serious about static type checking for your Python source base, it’s highly recommended that you consume “py.typed” packages or use type stub files for all external imports. If you are unable to find a type stub for a particular library, the recommended approach is to create a custom type stub file that defines the portion of that module’s interface used by your code. More library maintainers have started to provide inlined types or type stub files. -## Generating Type Stubs +### Generating Type Stubs If you use only a few classes, methods or functions within a library, writing a type stub file by hand is feasible. For large libraries, this can become tedious and error-prone. Pyright can generate “draft” versions of type stub files for you. To generate a type stub file from within VS Code, enable the reportMissingTypeStubs” setting in your pyrightconfig.json file or by adding a comment `# pyright: reportMissingTypeStubs=true` to individual source files. Make sure you have the target library installed in the python environment that pyright is configured to use for import resolution. Optionally specify a “stubPath” in your pyrightconfig.json file. This is where pyright will generate your type stub files. By default, the stubPath is set to "./typings". -### Generating Type Stubs in VS Code +#### Generating Type Stubs in VS Code If “reportMissingTypeStubs” is enabled, pyright will highlight any imports that have no type stub. Hover over the error message, and you will see a “Quick Fix” link. Clicking on this link will reveal a popup menu item titled “Create Type Stub For XXX”. The example below shows a missing typestub for the `django` library. -![Pyright](/docs/img/CreateTypeStub1.png) +![Pyright](img/CreateTypeStub1.png) Click on the menu item to create the type stub. Depending on the size of the library, it may take pyright tens of seconds to analyze the library and generate type stub files. Once complete, you should see a message in VS Code indicating success or failure. -![Pyright](/docs/img/CreateTypeStub2.png) +![Pyright](img/CreateTypeStub2.png) -### Generating Type Stubs from Command Line +#### Generating Type Stubs from Command Line The command-line version of pyright can also be used to generate type stubs. As with the VS Code version, it must be run within the context of your configured project. Then type `pyright --createstub [import-name]`. For example: `pyright --createstub django` -### Cleaning Up Generated Type Stubs +#### Cleaning Up Generated Type Stubs Pyright can give you a head start by creating type stubs, but you will typically need to clean up the first draft, fixing various errors and omissions that pyright was not able to infer from the original library code. A few common situations that need to be cleaned up: diff --git a/docs/typed-libraries.md b/docs/typed-libraries.md index f51eb575d..6f86b510c 100644 --- a/docs/typed-libraries.md +++ b/docs/typed-libraries.md @@ -1,4 +1,4 @@ -# Typing Guidance for Python Libraries +## Typing Guidance for Python Libraries Much of Python’s popularity can be attributed to the rich collection of Python libraries available to developers. Authors of these libraries play an important role in improving the experience for Python developers. This document provides some recommendations and guidance for Python library authors. @@ -10,7 +10,7 @@ These recommendations are intended to provide the following benefits: 4. Library authors should have the benefits of static type checking to produce high-quality, bug-free implementations. -## Inlined Type Annotations and Type Stubs +### Inlined Type Annotations and Type Stubs [PEP 561](https://www.python.org/dev/peps/pep-0561/) documents several ways type information can be delivered for a library: inlined type annotations, type stub files included in the package, a separate companion type stub package, and type stubs in the typeshed repository. Some of these options fall short on delivering the benefits above. We therefore provide the following more specific guidance to library authors. All libraries should include inlined type annotations for the functions, classes, methods, and constants that comprise the public interface for the library. @@ -22,10 +22,10 @@ There are cases where inlined type annotations are not possible — most notably In many existing type stubs (such as those found in typeshed), default parameter values are replaced with with “...” and all docstrings are removed. We recommend that default values and docstrings remain within the type stub file so language servers can display this information to developers. -## Library Interface +### Library Interface [PEP 561](https://www.python.org/dev/peps/pep-0561/) indicates that a “py.typed” marker file must be included in the package if the author wishes to support type checking of their code. -If a “py.typed” module is present, a type checker will treat all modules within that package (i.e. all files that end in “.py” or “.pyi”) as importable unless the module is marked private. There are two ways to mark a module private: (1) the module's filename begins with an underscore; (2) the module in inside a sub-package marked private. For example: +If a “py.typed” module is present, a type checker will treat all modules within that package (i.e. all files that end in “.py” or “.pyi”) as importable unless the module is marked private. There are two ways to mark a module private: (1) the module's filename begins with an underscore; (2) the module is inside a sub-package marked private. For example: * foo._bar (_bar is private) * foo._bar.baz (_bar and baz are private) @@ -50,7 +50,7 @@ The following idioms are supported for defining the values contained within `__a * `__all__.remove('a')` -## Type Completeness +### Type Completeness A “py.typed” library is said to be “type complete” if all of the symbols that comprise its interface have type annotations that refer to types that are fully known. Private symbols are exempt. A “known type” is defined as follows: @@ -76,9 +76,9 @@ Variables: Type annotations can be omitted in a few specific cases where the type is obvious from the context: -* Constants that are assigned simple literal values (e.g. `RED = '#F00'` or `MAX_TIMEOUT = 50` or `room_temperature: Final = 20`). A constant is a symbol that is assigned only once and is either annotated with `Final` or is named in all-caps. A constant that is not assigned a simple literal value requires explicit annotations, preferably with a `Final` annotation (e.g. `WOODWINDS: Final[List[str]] = ['Oboe', 'Bassoon']`). +* Constants that are assigned simple literal values (e.g. `RED = '#F00'` or `MAX_TIMEOUT = 50` or `room_temperature: Final = 20`). A constant is a symbol that is assigned only once and is either annotated with `Final` or is named in all-caps. A constant that is not assigned a simple literal value requires explicit annotations, preferably with a `Final` annotation (e.g. `WOODWINDS: Final[list[str]] = ['Oboe', 'Bassoon']`). * Enum values within an Enum class do not require annotations because they take on the type of the Enum class. -* Type aliases do not require annotations. A type alias is a symbol that is defined at a module level with a single assignment where the assigned value is an instantiable type, as opposed to a class instance (e.g. `Foo = Callable[[Literal["a", "b"]], Union[int, str]]` or `Bar = Optional[MyGenericClass[int]]`). +* Type aliases do not require annotations. A type alias is a symbol that is defined at a module level with a single assignment where the assigned value is an instantiable type, as opposed to a class instance (e.g. `Foo = Callable[[Literal["a", "b"]], int | str]` or `Bar = MyGenericClass[int] | None`). * The “self” parameter in an instance method and the “cls” parameter in a class method do not require an explicit annotation. * The return type for an `__init__` method does not need to be specified, since it is always `None`. * The following module-level symbols do not require type annotations: `__all__`,`__author__`, `__copyright__`, `__email__`, `__license__`, `__title__`, `__uri__`, `__version__`. @@ -86,14 +86,14 @@ Type annotations can be omitted in a few specific cases where the type is obviou * A variable is assigned in only one location using a simple assignment expression and the right-hand side of the assignment is a literal value (e.g. `1`, `3.14`, `"hi"`, or `MyEnum.Value`) or an identifier that has a known type that doesn't depend on type narrowing logic. -### Ambiguous Types +#### Ambiguous Types When a symbol is missing a type annotation, a type checker may be able to infer its type based on contextual information. However, type inference rules are not standardized and differ between type checkers. A symbol is said to have an “ambiguous type” if its type may be inferred differently between different Python type checkers. This can lead to a bad experience for consumers of the library. Ambiguous types can be avoided by providing explicit type annotations. -### Examples of known, ambiguous and unknown types +#### Examples of known, ambiguous and unknown types ```python # Variable with known type (unambiguous because it uses a literal assignment) @@ -103,21 +103,21 @@ a = 3 a = [3, 4, 5] # Variable with known (declared) type -a: List[int] = [3, 4, 5] +a: list[int] = [3, 4, 5] # Type alias with partially unknown type (because type # arguments are missing for list and dict) -DictOrList = Union[list, dict] +DictOrList = list | dict # Type alias with known type -DictOrList = Union[List[Any], Dict[str, Any]] +DictOrList = list[Any] | dict[str, Any] # Generic type alias with known type _T = TypeVar("_T") -DictOrList = Union[List[_T], Dict[str, _T]] +DictOrList = list[_T] | dict[str, _T] # Function with known type -def func(a: Optional[int], b: Dict[str, float] = {}) -> None: +def func(a: int | None, b: dict[str, float] = {}) -> None: pass # Function with partially unknown type (because type annotations @@ -126,13 +126,13 @@ def func(a, b): pass # Function with partially unknown type (because of missing -# type args on Dict) -def func(a: int, b: Dict) -> None: +# type args on dict) +def func(a: int, b: dict) -> None: pass # Function with partially unknown type (because return type # annotation is missing) -def func(a: int, b: Dict[str, float]): +def func(a: int, b: dict[str, float]): pass # Decorator with partially unknown type (because type annotations @@ -206,7 +206,7 @@ class DictSubclass(dict): ``` -## Verifying Type Completeness +### Verifying Type Completeness Pyright provides a feature that allows library authors to verify type completeness for a “py.typed” package. To use this feature, create a clean Python environment and install your package along with all of the other dependent packages. Run the CLI version of pyright with the `--verifytypes` option. `pyright --verifytypes ` @@ -222,7 +222,7 @@ The `--verifytypes` feature can be integrated into a continuous integration (CI) If the `--verifytypes` option is combined with `--ignoreexternal`, any incomplete types that are imported from other external packages are ignored. This allows library authors to focus on adding type annotations for the code that is directly under their control. -### Improving Type Completeness +#### Improving Type Completeness Here are some tips for increasing the type completeness score for your library: @@ -232,27 +232,27 @@ Here are some tips for increasing the type completeness score for your library: * If your package exposes types from other libraries, work with the maintainers of these other libraries to achieve type completeness. -## Best Practices for Inlined Types +### Best Practices for Inlined Types -### Wide vs. Narrow Types -In type theory, when comparing two types that are related to each other, the “wider” type is the one that is more general, and the “narrower” type is more specific. For example, `Sequence[str]` is a wider type than `List[str]` because all `List` objects are also `Sequence` objects, but the converse is not true. A subclass is narrower than a class it derives from. A union of types is wider than the individual types that comprise the union. +#### Wide vs. Narrow Types +In type theory, when comparing two types that are related to each other, the “wider” type is the one that is more general, and the “narrower” type is more specific. For example, `Sequence[str]` is a wider type than `list[str]` because all `list` objects are also `Sequence` objects, but the converse is not true. A subclass is narrower than a class it derives from. A union of types is wider than the individual types that comprise the union. -In general, a function input parameter should be annotated with the widest possible type supported by the implementation. For example, if the implementation requires the caller to provide an iterable collection of strings, the parameter should be annotated as `Iterable[str]`, not as `List[str]`. The latter type is narrower than necessary, so if a user attempts to pass a tuple of strings (which is supported by the implementation), a type checker will complain about a type incompatibility. +In general, a function input parameter should be annotated with the widest possible type supported by the implementation. For example, if the implementation requires the caller to provide an iterable collection of strings, the parameter should be annotated as `Iterable[str]`, not as `list[str]`. The latter type is narrower than necessary, so if a user attempts to pass a tuple of strings (which is supported by the implementation), a type checker will complain about a type incompatibility. -As a specific application of the “use the widest type possible” rule, libraries should generally use immutable forms of container types instead of mutable forms (unless the function needs to modify the container). Use `Sequence` rather than `List`, `Mapping` rather than `Dict`, etc. Immutable containers allow for more flexibility because their type parameters are covariant rather than invariant. A parameter that is typed as `Sequence[Union[str, int]]` can accept a `List[Union[str, int]]`, `List[int]`, `Sequence[str]`, and a `Sequence[int]`. But a parameter typed as `List[Union[str, int]]` is much more restrictive and accepts only a `List[Union[str, int]]`. +As a specific application of the “use the widest type possible” rule, libraries should generally use immutable forms of container types instead of mutable forms (unless the function needs to modify the container). Use `Sequence` rather than `list`, `Mapping` rather than `dict`, etc. Immutable containers allow for more flexibility because their type parameters are covariant rather than invariant. A parameter that is typed as `Sequence[str | int]` can accept a `list[str | int]`, `list[int]`, `Sequence[str]`, and a `Sequence[int]`. But a parameter typed as `list[str | int]` is much more restrictive and accepts only a `list[str | int]`. -### Overloads +#### Overloads If a function or method can return multiple different types and those types can be determined based on the presence or types of certain parameters, use the `@overload` mechanism defined in [PEP 484](https://www.python.org/dev/peps/pep-0484/#id45). When overloads are used within a “.py” file, they must appear prior to the function implementation, which should not have an `@overload` decorator. -### Keyword-only Parameters +#### Keyword-only Parameters If a function or method is intended to take parameters that are specified only by name, use the keyword-only separator ("*"). ```python -def create_user(age: int, *, dob: Optional[date] = None): +def create_user(age: int, *, dob: date | None = None): ... ``` -### Positional-only Parameters +#### Positional-only Parameters If a function or method is intended to take parameters that are specified only by position, use the positional-only separator ("/") as documented in [PEP 570](https://peps.python.org/pep-0570/). If your library needs to run on versions of Python prior to 3.8, you can alternatively name the positional-only parameters with an identifier that begins with a double underscore. ```python @@ -288,29 +288,29 @@ def complex_decorator(*, mode: str) -> Callable[[_F], _F]: Decorators that mutate the signature of the decorated function present challenges for type annotations. The `ParamSpec` and `Concatenate` mechanisms described in [PEP 612](https://www.python.org/dev/peps/pep-0612/) provide some help here, but these are available only in Python 3.10 and newer. More complex signature mutations may require type annotations that erase the original signature, thus blinding type checkers and other tools that provide signature assistance. As such, library authors are discouraged from creating decorators that mutate function signatures in this manner. -### Generic Classes and Functions +#### Generic Classes and Functions Classes and functions that can operate in a generic manner on various types should declare themselves as generic using the mechanisms described in [PEP 484](https://www.python.org/dev/peps/pep-0484/). This includes the use of `TypeVar` symbols. Typically, a `TypeVar` should be private to the file that declares it, and should therefore begin with an underscore. -### Type Aliases +#### Type Aliases Type aliases are symbols that refer to other types. Generic type aliases (those that refer to unspecialized generic classes) are supported by most type checkers. Pyright also provides support for recursive type aliases. [PEP 613](https://www.python.org/dev/peps/pep-0613/) provides a way to explicitly designate a symbol as a type alias using the new TypeAlias annotation. ```python # Simple type alias -FamilyPet = Union[Cat, Dog, GoldFish] +FamilyPet = Cat | Dog | GoldFish # Generic type alias -ListOrTuple = Union[List[_T], Tuple[_T, ...]] +ListOrTuple = list[_T] | tuple[_T, ...] # Recursive type alias -TreeNode = Union[LeafNode, List["TreeNode"]] +TreeNode = LeafNode | list["TreeNode"] # Explicit type alias using PEP 613 syntax -StrOrInt: TypeAlias = Union[str, int] +StrOrInt: TypeAlias = str | int ``` -### Abstract Classes and Methods +#### Abstract Classes and Methods Classes that must be subclassed should derive from `ABC`, and methods or properties that must be overridden should be decorated with the `@abstractmethod` decorator. This allows type checkers to validate that the required methods have been overridden and provide developers with useful error messages when they are not. It is customary to implement an abstract method by raising a `NotImplementedError` exception. ```python @@ -329,13 +329,13 @@ class Hashable(ABC): raise NotImplementedError() ``` -### Final Classes and Methods +#### Final Classes and Methods Classes that are not intended to be subclassed should be decorated as `@final` as described in [PEP 591](https://www.python.org/dev/peps/pep-0591/). The same decorator can also be used to specify methods that cannot be overridden by subclasses. -### Literals +#### Literals Type annotations should make use of the Literal type where appropriate, as described in [PEP 586](https://www.python.org/dev/peps/pep-0586/). Literals allow for more type specificity than their non-literal counterparts. -### Constants +#### Constants Constant values (those that are read-only) can be specified using the Final annotation as described in [PEP 591](https://www.python.org/dev/peps/pep-0591/). Type checkers will also typically treat variables that are named using all upper-case characters as constants. @@ -348,17 +348,17 @@ COLOR_FORMAT_RGB = "rgb" # All-caps constant with explicit type COLOR_FORMAT_RGB: Literal["rgb"] = "rgb" -LATEST_VERSION: Tuple[int, int] = (4, 5) +LATEST_VERSION: tuple[int, int] = (4, 5) # Final variable with inferred type ColorFormatRgb: Final = "rgb" # Final variable with explicit type ColorFormatRgb: Final[Literal["rgb"]] = "rgb" -LATEST_VERSION: Final[Tuple[int, int]] = (4, 5) +LATEST_VERSION: Final[tuple[int, int]] = (4, 5) ``` -### Typed Dictionaries, Data Classes, and Named Tuples +#### Typed Dictionaries, Data Classes, and Named Tuples If a library runs only on newer versions of Python, it can use some of the new type-friendly classes. NamedTuple (described in [PEP 484](https://www.python.org/dev/peps/pep-0484/)) is preferred over namedtuple. @@ -368,10 +368,10 @@ Data classes (described in [PEP 557](https://www.python.org/dev/peps/pep-0557/)) TypedDict (described in [PEP 589](https://www.python.org/dev/peps/pep-0589/)) is preferred over untyped dictionaries. -## Compatibility with Older Python Versions +### Compatibility with Older Python Versions Each new version of Python from 3.5 onward has introduced new typing constructs. This presents a challenge for library authors who want to maintain runtime compatibility with older versions of Python. This section documents several techniques that can be used to add types while maintaining backward compatibility. -### Quoted Annotations +#### Quoted Annotations Type annotations for variables, parameters, and return types can be placed in quotes. The Python interpreter will then ignore them, whereas a type checker will interpret them as type annotations. ```python @@ -391,7 +391,7 @@ If you need to support older versions of Python, type annotations can still be p class Foo: # Variable type comments go at the end of the line # where the variable is assigned. - timeout = None # type: Optional[int] + timeout = None # type: int | None # Function type comments can be specified on the # line after the function signature. @@ -410,20 +410,20 @@ class Foo: ... ``` -### typing_extensions +#### typing_extensions New type features that require runtime support are typically included in the stdlib `typing` module. Where possible, these new features are back-ported to a runtime library called `typing_extensions` that works with older Python runtimes. -### TYPE_CHECKING +#### TYPE_CHECKING The `typing` module exposes a variable called `TYPE_CHECKING` which has a value of False within the Python runtime but a value of True when the type checker is performing its analysis. This allows type checking statements to be conditionalized. Care should be taken when using `TYPE_CHECKING` because behavioral changes between type checking and runtime could mask problems that the type checker would otherwise catch. -## Non-Standard Type Behaviors +### Non-Standard Type Behaviors Type annotations provide a way to annotate typical type behaviors, but some classes implement specialized, non-standard behaviors that cannot be described using standard type annotations. For now, such types need to be annotated as Any, which is unfortunate because the benefits of static typing are lost. -## Docstrings +### Docstrings It is recommended that docstrings be provided for all classes, functions, and methods in the interface. They should be formatted according to [PEP 257](https://www.python.org/dev/peps/pep-0257/). There is currently no single agreed-upon standard for function and method docstrings, but several common variants have emerged. We recommend using one of these variants. diff --git a/lerna.json b/lerna.json index a77140b70..2692e2ddb 100644 --- a/lerna.json +++ b/lerna.json @@ -2,7 +2,7 @@ "packages": [ "packages/*" ], - "version": "1.1.267", + "version": "1.1.301", "command": { "version": { "push": false, diff --git a/package-lock.json b/package-lock.json index 9a4460219..3ce3be376 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,57 +6,55 @@ "": { "name": "pyright-root", "hasInstallScript": true, - "dependencies": { - "ts-proto": "^1.100.1" - }, "devDependencies": { "@types/glob": "^7.2.0", "@types/node": "^17.0.45", - "@types/yargs": "^16.0.4", - "@typescript-eslint/eslint-plugin": "^5.32.0", - "@typescript-eslint/parser": "^5.32.0", + "@types/yargs": "^16.0.5", + "@typescript-eslint/eslint-plugin": "^5.54.0", + "@typescript-eslint/parser": "^5.54.0", "detect-indent": "^6.1.0", - "eslint": "^8.21.0", - "eslint-config-prettier": "^8.5.0", + "eslint": "^8.35.0", + "eslint-config-prettier": "^8.6.0", "eslint-plugin-simple-import-sort": "^7.0.0", "glob": "^7.2.3", - "jsonc-parser": "^3.1.0", - "lerna": "^5.3.0", - "npm-check-updates": "^16.0.5", + "jsonc-parser": "^3.2.0", + "lerna": "^6.5.1", + "npm-check-updates": "^16.7.10", "p-queue": "^6.6.2", - "prettier": "2.7.1", - "syncpack": "^5.8.15", - "typescript": "~4.4.4" + "prettier": "2.8.4", + "syncpack": "^9.8.4", + "typescript": "~4.4.4", + "yargs": "^16.2.0" } }, "node_modules/@babel/code-frame": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", - "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", + "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==", "dev": true, "dependencies": { - "@babel/highlight": "^7.16.7" + "@babel/highlight": "^7.18.6" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", - "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", + "version": "7.19.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", + "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/highlight": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.7.tgz", - "integrity": "sha512-aKpPMfLvGO3Q97V0qhw/V2SWNWlwfJknuwAunU7wZLSfrM4xTBvg7E5opUVi1kJTBKihE38CPg4nBiqX83PWYw==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", + "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.16.7", + "@babel/helper-validator-identifier": "^7.18.6", "chalk": "^2.0.0", "js-tokens": "^4.0.0" }, @@ -102,13 +100,13 @@ "node_modules/@babel/highlight/node_modules/color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", "dev": true }, "node_modules/@babel/highlight/node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true, "engines": { "node": ">=0.8.0" @@ -117,7 +115,7 @@ "node_modules/@babel/highlight/node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "dev": true, "engines": { "node": ">=4" @@ -136,15 +134,15 @@ } }, "node_modules/@eslint/eslintrc": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.0.tgz", - "integrity": "sha512-UWW0TMTmk2d7hLcWD1/e2g5HDM/HQ3csaLSqXCfqwh4uNDuNqlaKWXmEsL4Cs41Z0KnILNvwbHAah3C2yt06kw==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.0.0.tgz", + "integrity": "sha512-fluIaaV+GyV24CCu/ggiHdV+j4RNh85yQnAYS/G2mZODZgGmmlrgCydjUcV3YvxCm9x8nMAfThsqTni4KiXT4A==", "dev": true, "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.3.2", - "globals": "^13.15.0", + "espree": "^9.4.0", + "globals": "^13.19.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", @@ -153,18 +151,18 @@ }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, - "node_modules/@eslint/eslintrc/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "node_modules/@eslint/js": { + "version": "8.35.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.35.0.tgz", + "integrity": "sha512-JXdzbRiWclLVoD8sNUjR443VVlYqiYmDVT6rGUEIEHU5YJW0gaVZwV2xgM7D4arkvASqD0IlLUVjHiFuxaftRw==", "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, "engines": { - "node": "*" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, "node_modules/@gar/promisify": { @@ -174,24 +172,27 @@ "dev": true }, "node_modules/@humanwhocodes/config-array": { - "version": "0.10.4", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.10.4.tgz", - "integrity": "sha512-mXAIHxZT3Vcpg83opl1wGlVZ9xydbfZO3r5YfRSH6Gpp2J/PfdBP0wbDa2sO6/qRbcalpoevVyW6A/fI6LfeMw==", + "version": "0.11.8", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz", + "integrity": "sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==", "dev": true, "dependencies": { "@humanwhocodes/object-schema": "^1.2.1", "debug": "^4.1.1", - "minimatch": "^3.0.4" + "minimatch": "^3.0.5" }, "engines": { "node": ">=10.10.0" } }, - "node_modules/@humanwhocodes/gitignore-to-minimatch": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@humanwhocodes/gitignore-to-minimatch/-/gitignore-to-minimatch-1.0.2.tgz", - "integrity": "sha512-rSqmMJDdLFUsyxR6FMtD00nfQKKLFb1kv+qBbOVKqErvloEIJLo5bDTJTQNTYgeyp78JsA7u/NPi5jT1GR/MuA==", + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", "dev": true, + "engines": { + "node": ">=12.22" + }, "funding": { "type": "github", "url": "https://github.com/sponsors/nzakas" @@ -218,3205 +219,3210 @@ "integrity": "sha512-SQ7Kzhh9+D+ZW9MA0zkYv3VXhIDNx+LzM6EJ+/65I3QY+enU6Itte7E5XX7EWrqLW2FN4n06GWzBnPoC3th2aQ==", "dev": true }, - "node_modules/@lerna/add": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/add/-/add-5.3.0.tgz", - "integrity": "sha512-MxwTO2UBxZwwuquKbBqdYa56YTqg6Lfz1MZsRQxO7F2cb2NN8NEYTcGOli/71Ee/2AoX4R4xIFTh3TnaflQ25A==", + "node_modules/@lerna/child-process": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/@lerna/child-process/-/child-process-6.5.1.tgz", + "integrity": "sha512-QfyleXSD9slh4qM54wDaqKVPvtUH1NJMgsFc9BabqSHO1Ttpandv1EAvTCN9Lu73RbCX3LJpn+BfJmnjHbjCyw==", "dev": true, "dependencies": { - "@lerna/bootstrap": "5.3.0", - "@lerna/command": "5.3.0", - "@lerna/filter-options": "5.3.0", - "@lerna/npm-conf": "5.3.0", - "@lerna/validation-error": "5.3.0", - "dedent": "^0.7.0", - "npm-package-arg": "8.1.1", - "p-map": "^4.0.0", - "pacote": "^13.6.1", - "semver": "^7.3.4" + "chalk": "^4.1.0", + "execa": "^5.0.0", + "strong-log-transformer": "^2.1.0" }, "engines": { "node": "^14.15.0 || >=16.0.0" } }, - "node_modules/@lerna/bootstrap": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/bootstrap/-/bootstrap-5.3.0.tgz", - "integrity": "sha512-iHVjt6YOQKLY0j+ex13a6ZxjIQ1TSSXqbl6z1hVjBFaDyCh7pra/tgj0LohZDVCaouLwRKucceQfTGrb+cfo7A==", - "dev": true, - "dependencies": { - "@lerna/command": "5.3.0", - "@lerna/filter-options": "5.3.0", - "@lerna/has-npm-version": "5.3.0", - "@lerna/npm-install": "5.3.0", - "@lerna/package-graph": "5.3.0", - "@lerna/pulse-till-done": "5.3.0", - "@lerna/rimraf-dir": "5.3.0", - "@lerna/run-lifecycle": "5.3.0", - "@lerna/run-topologically": "5.3.0", - "@lerna/symlink-binary": "5.3.0", - "@lerna/symlink-dependencies": "5.3.0", - "@lerna/validation-error": "5.3.0", - "@npmcli/arborist": "5.3.0", + "node_modules/@lerna/create": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/@lerna/create/-/create-6.5.1.tgz", + "integrity": "sha512-ejERJnfA36jEuKrfM+94feLiyf2/hF2NoG923N0rE4rsmvRFPr1XLVPvAKleXW+Gdi/t1p410lJ7NKaLRMYCYw==", + "dev": true, + "dependencies": { + "@lerna/child-process": "6.5.1", "dedent": "^0.7.0", - "get-port": "^5.1.1", - "multimatch": "^5.0.0", + "fs-extra": "^9.1.0", + "init-package-json": "^3.0.2", "npm-package-arg": "8.1.1", - "npmlog": "^6.0.2", - "p-map": "^4.0.0", - "p-map-series": "^2.1.0", - "p-waterfall": "^2.1.1", - "semver": "^7.3.4" + "p-reduce": "^2.1.0", + "pacote": "^13.6.1", + "pify": "^5.0.0", + "semver": "^7.3.4", + "slash": "^3.0.0", + "validate-npm-package-license": "^3.0.4", + "validate-npm-package-name": "^4.0.0", + "yargs-parser": "20.2.4" }, "engines": { "node": "^14.15.0 || >=16.0.0" } }, - "node_modules/@lerna/changed": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/changed/-/changed-5.3.0.tgz", - "integrity": "sha512-i6ZfBDBZCpnPaSWTuNGTrnExkHNMC+/cSUuS9njaqe+tXgqE95Ja3cMxWZth9Q1uasjcEBHPU2jG0VKrU37rpA==", + "node_modules/@mobily/ts-belt": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/@mobily/ts-belt/-/ts-belt-3.13.1.tgz", + "integrity": "sha512-K5KqIhPI/EoCTbA6CGbrenM9s41OouyK8A03fGJJcla/zKucsgLbz8HNbeseoLarRPgyWJsUyCYqFhI7t3Ra9Q==", "dev": true, - "dependencies": { - "@lerna/collect-updates": "5.3.0", - "@lerna/command": "5.3.0", - "@lerna/listable": "5.3.0", - "@lerna/output": "5.3.0" - }, "engines": { - "node": "^14.15.0 || >=16.0.0" + "node": ">= 10.*" } }, - "node_modules/@lerna/check-working-tree": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/check-working-tree/-/check-working-tree-5.3.0.tgz", - "integrity": "sha512-qo6jUGWXKLVL1nU8aEECqwrGRjs9o1l1hXdD2juA4Fvzsam1cFVHJwsmw3hAXGhEPD0oalg/XR62H9rZSCLOvQ==", + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", "dev": true, "dependencies": { - "@lerna/collect-uncommitted": "5.3.0", - "@lerna/describe-ref": "5.3.0", - "@lerna/validation-error": "5.3.0" + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" }, "engines": { - "node": "^14.15.0 || >=16.0.0" + "node": ">= 8" } }, - "node_modules/@lerna/child-process": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/child-process/-/child-process-5.3.0.tgz", - "integrity": "sha512-4uXPNIptrgQQQVHVVAXBD8F7IqSvZL3Og0G0DHiWKH+dsSyMIUtaIGJt7sifVoL7nzex4AqEiPq/AubpmG5g4Q==", + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", "dev": true, - "dependencies": { - "chalk": "^4.1.0", - "execa": "^5.0.0", - "strong-log-transformer": "^2.1.0" - }, "engines": { - "node": "^14.15.0 || >=16.0.0" + "node": ">= 8" } }, - "node_modules/@lerna/clean": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/clean/-/clean-5.3.0.tgz", - "integrity": "sha512-Jn+Dr7A69dch8m1dLe7l/SDVQVQT2j7zdy2gaZVEmJIgEEaXmEbfJ2t2n06vRXtckI9B85M5mubT1U3Y7KuNuA==", + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", "dev": true, "dependencies": { - "@lerna/command": "5.3.0", - "@lerna/filter-options": "5.3.0", - "@lerna/prompt": "5.3.0", - "@lerna/pulse-till-done": "5.3.0", - "@lerna/rimraf-dir": "5.3.0", - "p-map": "^4.0.0", - "p-map-series": "^2.1.0", - "p-waterfall": "^2.1.1" + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" }, "engines": { - "node": "^14.15.0 || >=16.0.0" + "node": ">= 8" } }, - "node_modules/@lerna/cli": { + "node_modules/@npmcli/arborist": { "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/cli/-/cli-5.3.0.tgz", - "integrity": "sha512-P7F3Xs98pXMEGZX+mnFfsd6gU03x8UrwQ3mElvQBICl4Ew9z6rS8NGUd3JOPFzm4/vSTjYTnPyPdWBjj6/f6sw==", + "resolved": "https://registry.npmjs.org/@npmcli/arborist/-/arborist-5.3.0.tgz", + "integrity": "sha512-+rZ9zgL1lnbl8Xbb1NQdMjveOMwj4lIYfcDtyJHHi5x4X8jtR6m8SXooJMZy5vmFVZ8w7A2Bnd/oX9eTuU8w5A==", "dev": true, "dependencies": { - "@lerna/global-options": "5.3.0", - "dedent": "^0.7.0", + "@isaacs/string-locale-compare": "^1.1.0", + "@npmcli/installed-package-contents": "^1.0.7", + "@npmcli/map-workspaces": "^2.0.3", + "@npmcli/metavuln-calculator": "^3.0.1", + "@npmcli/move-file": "^2.0.0", + "@npmcli/name-from-folder": "^1.0.1", + "@npmcli/node-gyp": "^2.0.0", + "@npmcli/package-json": "^2.0.0", + "@npmcli/run-script": "^4.1.3", + "bin-links": "^3.0.0", + "cacache": "^16.0.6", + "common-ancestor-path": "^1.0.1", + "json-parse-even-better-errors": "^2.3.1", + "json-stringify-nice": "^1.1.4", + "mkdirp": "^1.0.4", + "mkdirp-infer-owner": "^2.0.0", + "nopt": "^5.0.0", + "npm-install-checks": "^5.0.0", + "npm-package-arg": "^9.0.0", + "npm-pick-manifest": "^7.0.0", + "npm-registry-fetch": "^13.0.0", "npmlog": "^6.0.2", - "yargs": "^16.2.0" + "pacote": "^13.6.1", + "parse-conflict-json": "^2.0.1", + "proc-log": "^2.0.0", + "promise-all-reject-late": "^1.0.0", + "promise-call-limit": "^1.0.1", + "read-package-json-fast": "^2.0.2", + "readdir-scoped-modules": "^1.1.0", + "rimraf": "^3.0.2", + "semver": "^7.3.7", + "ssri": "^9.0.0", + "treeverse": "^2.0.0", + "walk-up-path": "^1.0.0" + }, + "bin": { + "arborist": "bin/index.js" }, "engines": { - "node": "^14.15.0 || >=16.0.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/@lerna/collect-uncommitted": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/collect-uncommitted/-/collect-uncommitted-5.3.0.tgz", - "integrity": "sha512-Ll/mU9Nes0NQoa0pSv2TR2PTCkIomBGuDWH48OF2sKKu69NuLjrD2L0udS5nJYig9HxFewtm4QTiUdYPxfJXkQ==", + "node_modules/@npmcli/arborist/node_modules/hosted-git-info": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.2.1.tgz", + "integrity": "sha512-xIcQYMnhcx2Nr4JTjsFmwwnr9vldugPy9uVm0o87bjqqWMv9GaqsTeT+i99wTl0mk1uLxJtHxLb8kymqTENQsw==", "dev": true, "dependencies": { - "@lerna/child-process": "5.3.0", - "chalk": "^4.1.0", - "npmlog": "^6.0.2" + "lru-cache": "^7.5.1" }, "engines": { - "node": "^14.15.0 || >=16.0.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/@lerna/collect-updates": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/collect-updates/-/collect-updates-5.3.0.tgz", - "integrity": "sha512-fzJo/rmdXKWKYt+9IXjtenIZtSr3blMH8GEqoVKpSZ7TJGpxcFNmMe6foa60BgaTnDmmg1y7Qu6JbQJ3Ra5c5w==", + "node_modules/@npmcli/arborist/node_modules/npm-package-arg": { + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-9.1.2.tgz", + "integrity": "sha512-pzd9rLEx4TfNJkovvlBSLGhq31gGu2QDexFPWT19yCDh0JgnRhlBLNo5759N0AJmBk+kQ9Y/hXoLnlgFD+ukmg==", "dev": true, "dependencies": { - "@lerna/child-process": "5.3.0", - "@lerna/describe-ref": "5.3.0", - "minimatch": "^3.0.4", - "npmlog": "^6.0.2", - "slash": "^3.0.0" + "hosted-git-info": "^5.0.0", + "proc-log": "^2.0.1", + "semver": "^7.3.5", + "validate-npm-package-name": "^4.0.0" }, "engines": { - "node": "^14.15.0 || >=16.0.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/@lerna/command": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/command/-/command-5.3.0.tgz", - "integrity": "sha512-UNQQ4EGTumqLhOuDPcRA4LpdS9pcTYKSdh/8MdKPeyIRN70vCTwdeTrxqaaKsn3Jo7ycvyUQT5yfrUFmCClfoA==", + "node_modules/@npmcli/fs": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-2.1.2.tgz", + "integrity": "sha512-yOJKRvohFOaLqipNtwYB9WugyZKhC/DZC4VYPmpaCzDBrA8YpK3qHZ8/HGscMnE4GqbkLNuVcCnxkeQEdGt6LQ==", "dev": true, "dependencies": { - "@lerna/child-process": "5.3.0", - "@lerna/package-graph": "5.3.0", - "@lerna/project": "5.3.0", - "@lerna/validation-error": "5.3.0", - "@lerna/write-log-file": "5.3.0", - "clone-deep": "^4.0.1", - "dedent": "^0.7.0", - "execa": "^5.0.0", - "is-ci": "^2.0.0", - "npmlog": "^6.0.2" + "@gar/promisify": "^1.1.3", + "semver": "^7.3.5" }, "engines": { - "node": "^14.15.0 || >=16.0.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/@lerna/conventional-commits": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/conventional-commits/-/conventional-commits-5.3.0.tgz", - "integrity": "sha512-9uoQ2E1J7pL0fml5PNO7FydnBNeqrNOQa53Ca1Klf5t/x4vIn51ocOZNm/YbRAc/affnrxxp+gR2/SWlN0yKqQ==", + "node_modules/@npmcli/git": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@npmcli/git/-/git-3.0.2.tgz", + "integrity": "sha512-CAcd08y3DWBJqJDpfuVL0uijlq5oaXaOJEKHKc4wqrjd00gkvTZB+nFuLn+doOOKddaQS9JfqtNoFCO2LCvA3w==", "dev": true, "dependencies": { - "@lerna/validation-error": "5.3.0", - "conventional-changelog-angular": "^5.0.12", - "conventional-changelog-core": "^4.2.4", - "conventional-recommended-bump": "^6.1.0", - "fs-extra": "^9.1.0", - "get-stream": "^6.0.0", - "npm-package-arg": "8.1.1", - "npmlog": "^6.0.2", - "pify": "^5.0.0", - "semver": "^7.3.4" + "@npmcli/promise-spawn": "^3.0.0", + "lru-cache": "^7.4.4", + "mkdirp": "^1.0.4", + "npm-pick-manifest": "^7.0.0", + "proc-log": "^2.0.0", + "promise-inflight": "^1.0.1", + "promise-retry": "^2.0.1", + "semver": "^7.3.5", + "which": "^2.0.2" }, "engines": { - "node": "^14.15.0 || >=16.0.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/@lerna/create": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/create/-/create-5.3.0.tgz", - "integrity": "sha512-DotTReCc3+Q9rpMA8RKAGemUK7JXT7skbxHvpqpPj7ryNkIv/dNAFC2EHglcpt9Rmyo6YbSP2zk0gfDbdiIcVA==", + "node_modules/@npmcli/installed-package-contents": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@npmcli/installed-package-contents/-/installed-package-contents-1.0.7.tgz", + "integrity": "sha512-9rufe0wnJusCQoLpV9ZPKIVP55itrM5BxOXs10DmdbRfgWtHy1LDyskbwRnBghuB0PrF7pNPOqREVtpz4HqzKw==", "dev": true, "dependencies": { - "@lerna/child-process": "5.3.0", - "@lerna/command": "5.3.0", - "@lerna/npm-conf": "5.3.0", - "@lerna/validation-error": "5.3.0", - "dedent": "^0.7.0", - "fs-extra": "^9.1.0", - "globby": "^11.0.2", - "init-package-json": "^3.0.2", - "npm-package-arg": "8.1.1", - "p-reduce": "^2.1.0", - "pacote": "^13.6.1", - "pify": "^5.0.0", - "semver": "^7.3.4", - "slash": "^3.0.0", - "validate-npm-package-license": "^3.0.4", - "validate-npm-package-name": "^4.0.0", - "whatwg-url": "^8.4.0", - "yargs-parser": "20.2.4" + "npm-bundled": "^1.1.1", + "npm-normalize-package-bin": "^1.0.1" + }, + "bin": { + "installed-package-contents": "index.js" }, "engines": { - "node": "^14.15.0 || >=16.0.0" + "node": ">= 10" } }, - "node_modules/@lerna/create-symlink": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/create-symlink/-/create-symlink-5.3.0.tgz", - "integrity": "sha512-xIoC9m4J/u4NV/8ms4P2fiimaYgialqJvNamvMDRmgE1c3BLDSGk2nE4nVI2W5LxjgJdMTiIH9v1QpTUC9Fv+Q==", + "node_modules/@npmcli/map-workspaces": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@npmcli/map-workspaces/-/map-workspaces-2.0.4.tgz", + "integrity": "sha512-bMo0aAfwhVwqoVM5UzX1DJnlvVvzDCHae821jv48L1EsrYwfOZChlqWYXEtto/+BkBXetPbEWgau++/brh4oVg==", "dev": true, "dependencies": { - "cmd-shim": "^5.0.0", - "fs-extra": "^9.1.0", - "npmlog": "^6.0.2" + "@npmcli/name-from-folder": "^1.0.1", + "glob": "^8.0.1", + "minimatch": "^5.0.1", + "read-package-json-fast": "^2.0.3" }, "engines": { - "node": "^14.15.0 || >=16.0.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/@lerna/create/node_modules/yargs-parser": { - "version": "20.2.4", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", - "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", + "node_modules/@npmcli/map-workspaces/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, - "engines": { - "node": ">=10" + "dependencies": { + "balanced-match": "^1.0.0" } }, - "node_modules/@lerna/describe-ref": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/describe-ref/-/describe-ref-5.3.0.tgz", - "integrity": "sha512-R+CtJcOuAF3kJ6GNQnGC3STEi+5OtpNVz2n17sAs/xqJnq79tPdzEhT+pMxB2eSEkQYlSr+cCKMpF0m/mtIPQA==", + "node_modules/@npmcli/map-workspaces/node_modules/glob": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", "dev": true, "dependencies": { - "@lerna/child-process": "5.3.0", - "npmlog": "^6.0.2" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" }, "engines": { - "node": "^14.15.0 || >=16.0.0" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/@lerna/diff": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/diff/-/diff-5.3.0.tgz", - "integrity": "sha512-i6f99dtO90u1QIJEfVtKE831m4gnMHBwY+4D84GY2SJMno8uI7ZyxMRZQh1nAFtvlNozO2MgzLr1OHtNMZOIgQ==", + "node_modules/@npmcli/map-workspaces/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", "dev": true, "dependencies": { - "@lerna/child-process": "5.3.0", - "@lerna/command": "5.3.0", - "@lerna/validation-error": "5.3.0", - "npmlog": "^6.0.2" + "brace-expansion": "^2.0.1" }, "engines": { - "node": "^14.15.0 || >=16.0.0" + "node": ">=10" } }, - "node_modules/@lerna/exec": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/exec/-/exec-5.3.0.tgz", - "integrity": "sha512-kI/IuF1hbT+pEMZc3v4+w8BLckUIi45ipzOP0bWvXNgSKKuADAU3HLv+ifRXEjob5906C+Zc7K2IVoVS6r1TDg==", + "node_modules/@npmcli/metavuln-calculator": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@npmcli/metavuln-calculator/-/metavuln-calculator-3.1.1.tgz", + "integrity": "sha512-n69ygIaqAedecLeVH3KnO39M6ZHiJ2dEv5A7DGvcqCB8q17BGUgW8QaanIkbWUo2aYGZqJaOORTLAlIvKjNDKA==", "dev": true, "dependencies": { - "@lerna/child-process": "5.3.0", - "@lerna/command": "5.3.0", - "@lerna/filter-options": "5.3.0", - "@lerna/profiler": "5.3.0", - "@lerna/run-topologically": "5.3.0", - "@lerna/validation-error": "5.3.0", - "p-map": "^4.0.0" + "cacache": "^16.0.0", + "json-parse-even-better-errors": "^2.3.1", + "pacote": "^13.0.3", + "semver": "^7.3.5" }, "engines": { - "node": "^14.15.0 || >=16.0.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/@lerna/filter-options": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/filter-options/-/filter-options-5.3.0.tgz", - "integrity": "sha512-ddgy0oDisTKIhCJ4WY5CeEhTsyrbW+zeBvZ7rVaG0oQXjSSYBried4TXRvgy67fampfHoPX+eQq5l1SYTRFPlw==", + "node_modules/@npmcli/move-file": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@npmcli/move-file/-/move-file-2.0.1.tgz", + "integrity": "sha512-mJd2Z5TjYWq/ttPLLGqArdtnC74J6bOzg4rMDnN+p1xTacZ2yPRCk2y0oSWQtygLR9YVQXgOcONrwtnk3JupxQ==", "dev": true, "dependencies": { - "@lerna/collect-updates": "5.3.0", - "@lerna/filter-packages": "5.3.0", - "dedent": "^0.7.0", - "npmlog": "^6.0.2" + "mkdirp": "^1.0.4", + "rimraf": "^3.0.2" }, "engines": { - "node": "^14.15.0 || >=16.0.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/@lerna/filter-packages": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/filter-packages/-/filter-packages-5.3.0.tgz", - "integrity": "sha512-5/2V50sQB2+JNwuCHP/UPm3y8PN2JWVY9CbNLtF3K5bymNsCkQh2KHEL9wlWZ4yfr/2ufpy4XFPaFUHNoUOGnQ==", - "dev": true, - "dependencies": { - "@lerna/validation-error": "5.3.0", - "multimatch": "^5.0.0", - "npmlog": "^6.0.2" - }, - "engines": { - "node": "^14.15.0 || >=16.0.0" - } + "node_modules/@npmcli/name-from-folder": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@npmcli/name-from-folder/-/name-from-folder-1.0.1.tgz", + "integrity": "sha512-qq3oEfcLFwNfEYOQ8HLimRGKlD8WSeGEdtUa7hmzpR8Sa7haL1KVQrvgO6wqMjhWFFVjgtrh1gIxDz+P8sjUaA==", + "dev": true }, - "node_modules/@lerna/get-npm-exec-opts": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/get-npm-exec-opts/-/get-npm-exec-opts-5.3.0.tgz", - "integrity": "sha512-cYBypDo8C7f4MvVvap2nYgtk8MXAADrYU1VdECSJ3Stbe4p2vBGt8bM9xkS2uPfQFMK3YSy3YPkSZcSjVXyoGw==", + "node_modules/@npmcli/node-gyp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/node-gyp/-/node-gyp-2.0.0.tgz", + "integrity": "sha512-doNI35wIe3bBaEgrlPfdJPaCpUR89pJWep4Hq3aRdh6gKazIVWfs0jHttvSSoq47ZXgC7h73kDsUl8AoIQUB+A==", "dev": true, - "dependencies": { - "npmlog": "^6.0.2" - }, "engines": { - "node": "^14.15.0 || >=16.0.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/@lerna/get-packed": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/get-packed/-/get-packed-5.3.0.tgz", - "integrity": "sha512-kD12w7Ko5TThuOuPF2HBLyuPsHK3oyyWyzleGBqR4DqxMtbMRgimyTQnr5o58XBOwUPCFsv1EZiqeGk+3HTGEA==", + "node_modules/@npmcli/package-json": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/package-json/-/package-json-2.0.0.tgz", + "integrity": "sha512-42jnZ6yl16GzjWSH7vtrmWyJDGVa/LXPdpN2rcUWolFjc9ON2N3uz0qdBbQACfmhuJZ2lbKYtmK5qx68ZPLHMA==", "dev": true, "dependencies": { - "fs-extra": "^9.1.0", - "ssri": "^9.0.1", - "tar": "^6.1.0" + "json-parse-even-better-errors": "^2.3.1" }, "engines": { - "node": "^14.15.0 || >=16.0.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/@lerna/github-client": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/github-client/-/github-client-5.3.0.tgz", - "integrity": "sha512-UqAclsWDMthmbv3Z8QE1K7D/4e93ytg31mc+nEj+UdU+xJQ0L1ypl8zWAmGNs1sFkQntIiTIB4W5zgHet5mmZw==", + "node_modules/@npmcli/promise-spawn": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/promise-spawn/-/promise-spawn-3.0.0.tgz", + "integrity": "sha512-s9SgS+p3a9Eohe68cSI3fi+hpcZUmXq5P7w0kMlAsWVtR7XbK3ptkZqKT2cK1zLDObJ3sR+8P59sJE0w/KTL1g==", "dev": true, "dependencies": { - "@lerna/child-process": "5.3.0", - "@octokit/plugin-enterprise-rest": "^6.0.1", - "@octokit/rest": "^19.0.3", - "git-url-parse": "^12.0.0", - "npmlog": "^6.0.2" + "infer-owner": "^1.0.4" }, "engines": { - "node": "^14.15.0 || >=16.0.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/@lerna/gitlab-client": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/gitlab-client/-/gitlab-client-5.3.0.tgz", - "integrity": "sha512-otwbiaGDgvn5MGF1ypsCO48inMpdcxuiDlbxrKD6glPUwNHiGV+PU8LLCCDKimwjjQhl88ySLpL1oTm4jnZ1Aw==", + "node_modules/@npmcli/run-script": { + "version": "4.1.7", + "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-4.1.7.tgz", + "integrity": "sha512-WXr/MyM4tpKA4BotB81NccGAv8B48lNH0gRoILucbcAhTQXLCoi6HflMV3KdXubIqvP9SuLsFn68Z7r4jl+ppw==", "dev": true, "dependencies": { - "node-fetch": "^2.6.1", - "npmlog": "^6.0.2", - "whatwg-url": "^8.4.0" + "@npmcli/node-gyp": "^2.0.0", + "@npmcli/promise-spawn": "^3.0.0", + "node-gyp": "^9.0.0", + "read-package-json-fast": "^2.0.3", + "which": "^2.0.2" }, "engines": { - "node": "^14.15.0 || >=16.0.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/@lerna/global-options": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/global-options/-/global-options-5.3.0.tgz", - "integrity": "sha512-iEoFrDSU+KtfcB+lHW5grjg3VkEqzZNTUnWnE1FCBBwj9tSLOHjgKGtWWjIQtBUJ+qcLBbusap9Stqzr7UPYpQ==", + "node_modules/@nrwl/cli": { + "version": "15.7.1", + "resolved": "https://registry.npmjs.org/@nrwl/cli/-/cli-15.7.1.tgz", + "integrity": "sha512-33RcH5Af2BidQvnTGlDTrUWJ6Eul5aA0LeqYmEavYb+I0kzYMqdBzBCLgQT/13gAdoQauTWUO4g3eFhoHnCNrg==", "dev": true, - "engines": { - "node": "^14.15.0 || >=16.0.0" + "dependencies": { + "nx": "15.7.1" } }, - "node_modules/@lerna/has-npm-version": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/has-npm-version/-/has-npm-version-5.3.0.tgz", - "integrity": "sha512-A/bK8e+QP/VMqZkq1wZbyOzMz/AY92tAVsBOQ5Yw2zqshdMVj99st3YHLOqJf/HTEzQo27GGI/ajmcltHS2l6A==", + "node_modules/@nrwl/devkit": { + "version": "15.7.1", + "resolved": "https://registry.npmjs.org/@nrwl/devkit/-/devkit-15.7.1.tgz", + "integrity": "sha512-u+4iBukrvrSQbKktnAcEuFzthq5ZGLpjE+SYUgg5+H6R76U0uelupdJ14qTWzIbSjlWLG53YmRZsJaIJ9EUG/w==", "dev": true, "dependencies": { - "@lerna/child-process": "5.3.0", - "semver": "^7.3.4" + "@phenomnomnominal/tsquery": "4.1.1", + "ejs": "^3.1.7", + "ignore": "^5.0.4", + "semver": "7.3.4", + "tslib": "^2.3.0" }, - "engines": { - "node": "^14.15.0 || >=16.0.0" + "peerDependencies": { + "nx": ">= 14.1 <= 16" } }, - "node_modules/@lerna/import": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/import/-/import-5.3.0.tgz", - "integrity": "sha512-KjVT9oFNSp1JLdrS1LSXjDcLiu2TMSfy6tpmhF9Zxo7oKB21SgWmXVV9rcWDueW2RIxNXDeVUG0NVNj2BRGeEQ==", + "node_modules/@nrwl/devkit/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, "dependencies": { - "@lerna/child-process": "5.3.0", - "@lerna/command": "5.3.0", - "@lerna/prompt": "5.3.0", - "@lerna/pulse-till-done": "5.3.0", - "@lerna/validation-error": "5.3.0", - "dedent": "^0.7.0", - "fs-extra": "^9.1.0", - "p-map-series": "^2.1.0" + "yallist": "^4.0.0" }, "engines": { - "node": "^14.15.0 || >=16.0.0" + "node": ">=10" } }, - "node_modules/@lerna/info": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/info/-/info-5.3.0.tgz", - "integrity": "sha512-pyeZSM/PIpBHCXdHPrbh6sPZlngXUxhTVFb0VaIjQ5Ms585xi15s1UQDO3FvzqdyMyalx0QGzCJbNx5XeoCejg==", + "node_modules/@nrwl/devkit/node_modules/semver": { + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", + "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", "dev": true, "dependencies": { - "@lerna/command": "5.3.0", - "@lerna/output": "5.3.0", - "envinfo": "^7.7.4" + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" }, "engines": { - "node": "^14.15.0 || >=16.0.0" + "node": ">=10" } }, - "node_modules/@lerna/init": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/init/-/init-5.3.0.tgz", - "integrity": "sha512-y46lzEtgMdEseTJGQQqYZOjqqd7iN+e14vFh/9q5h62V4Y8nlUJRzovVo8JSeaGwKLB0B3dq3BuUn0PNywMhpA==", + "node_modules/@nrwl/nx-darwin-arm64": { + "version": "15.7.1", + "resolved": "https://registry.npmjs.org/@nrwl/nx-darwin-arm64/-/nx-darwin-arm64-15.7.1.tgz", + "integrity": "sha512-YaNq1kP0xoaG2SDTjAzc0ZXAzRHE4obnEtVbisMzGRJkMld7SiOzYZAoaLJI6mZJuc7cIzUlA+wFkE2e21q5tQ==", + "cpu": [ + "arm64" + ], "dev": true, - "dependencies": { - "@lerna/child-process": "5.3.0", - "@lerna/command": "5.3.0", - "@lerna/project": "5.3.0", - "fs-extra": "^9.1.0", - "p-map": "^4.0.0", - "write-json-file": "^4.3.0" - }, + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": "^14.15.0 || >=16.0.0" + "node": ">= 10" } }, - "node_modules/@lerna/link": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/link/-/link-5.3.0.tgz", - "integrity": "sha512-+QBwnGg3S8Zk8M8G5CA4kmGq92rkEMbmWJXaxie3jQayp+GXgSlLs6R4jwSOZlztY6xR3WawMI9sHJ0Vdu+g7w==", + "node_modules/@nrwl/nx-darwin-x64": { + "version": "15.7.1", + "resolved": "https://registry.npmjs.org/@nrwl/nx-darwin-x64/-/nx-darwin-x64-15.7.1.tgz", + "integrity": "sha512-G/0joeAQfZm4FuqaDyOAam912EfVS6mlG1gFrzp3P/kzzE+gxt/I+iQHNmEOl8Dnp4ercTgW6epUEQ03teRLOA==", + "cpu": [ + "x64" + ], "dev": true, - "dependencies": { - "@lerna/command": "5.3.0", - "@lerna/package-graph": "5.3.0", - "@lerna/symlink-dependencies": "5.3.0", - "p-map": "^4.0.0", - "slash": "^3.0.0" - }, + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": "^14.15.0 || >=16.0.0" + "node": ">= 10" } }, - "node_modules/@lerna/list": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/list/-/list-5.3.0.tgz", - "integrity": "sha512-5RJvle3m4l2H0UmKNlwS8h2OIlNGsNTKPC4DYrJYt0+fhgzf5SEV1QKw+fuUqe3F8MziIkSGQB52HsjwPE6AWQ==", + "node_modules/@nrwl/nx-linux-arm-gnueabihf": { + "version": "15.7.1", + "resolved": "https://registry.npmjs.org/@nrwl/nx-linux-arm-gnueabihf/-/nx-linux-arm-gnueabihf-15.7.1.tgz", + "integrity": "sha512-WeZndiNyAPolRc08C4LLY7y+b3g9wAsJVVTWugW9PyaTMD19KY6oFkNG5gg1W0InoGISazW5fUissE+911kgog==", + "cpu": [ + "arm" + ], "dev": true, - "dependencies": { - "@lerna/command": "5.3.0", - "@lerna/filter-options": "5.3.0", - "@lerna/listable": "5.3.0", - "@lerna/output": "5.3.0" - }, + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": "^14.15.0 || >=16.0.0" + "node": ">= 10" } }, - "node_modules/@lerna/listable": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/listable/-/listable-5.3.0.tgz", - "integrity": "sha512-RdmeV9mDeuBOgVOlF/KNH/qttyiYwHbeqHiMAw9s9AfMo/Fz3iDZaTGZuruMm84TZSkKxI7m5mjTlC0djsyKog==", + "node_modules/@nrwl/nx-linux-arm64-gnu": { + "version": "15.7.1", + "resolved": "https://registry.npmjs.org/@nrwl/nx-linux-arm64-gnu/-/nx-linux-arm64-gnu-15.7.1.tgz", + "integrity": "sha512-efDPQl2Z1YLnUlEKyu7lsvRnFIRXmvnbkH2nRv3HNHVufnHjjQ41UBw2Gqz4WUrEpmBz2Xq31cYUZluUP7/o6Q==", + "cpu": [ + "arm64" + ], "dev": true, - "dependencies": { - "@lerna/query-graph": "5.3.0", - "chalk": "^4.1.0", - "columnify": "^1.6.0" - }, + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": "^14.15.0 || >=16.0.0" + "node": ">= 10" } }, - "node_modules/@lerna/log-packed": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/log-packed/-/log-packed-5.3.0.tgz", - "integrity": "sha512-tDuOot3vSOUSP7fNNej8UM0fah5oy8mKXe026grt4J0OP4L3rhSWxhfrDBQ3Ylh2dAjgHzscUf/vpnNC9HnhOQ==", + "node_modules/@nrwl/nx-linux-arm64-musl": { + "version": "15.7.1", + "resolved": "https://registry.npmjs.org/@nrwl/nx-linux-arm64-musl/-/nx-linux-arm64-musl-15.7.1.tgz", + "integrity": "sha512-Esv+ko6vMrI0HLnIXs76up7zUCaDfjArgn2TfMxvPjDEp4qmExiI8gmSh5JM1kC0MkHb4HghCnsSQ86Gg1BRiQ==", + "cpu": [ + "arm64" + ], "dev": true, - "dependencies": { - "byte-size": "^7.0.0", - "columnify": "^1.6.0", - "has-unicode": "^2.0.1", - "npmlog": "^6.0.2" - }, + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": "^14.15.0 || >=16.0.0" + "node": ">= 10" } }, - "node_modules/@lerna/npm-conf": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/npm-conf/-/npm-conf-5.3.0.tgz", - "integrity": "sha512-ejlypb90tvIsKUCb0fcOKt7wcPEjLdVK2zfbNs0M+UlRDLyRVOHUVdelJ15cRDNjQHzhBo2HBUKn5Fmm/2pcmg==", + "node_modules/@nrwl/nx-linux-x64-gnu": { + "version": "15.7.1", + "resolved": "https://registry.npmjs.org/@nrwl/nx-linux-x64-gnu/-/nx-linux-x64-gnu-15.7.1.tgz", + "integrity": "sha512-9ZkeCHhk+a3ok8CBEcbIheWrlp+gY1KdhmHOksJuDsHTcRMirbZ9HWm+/UIYB2FVaEENCBgcA4akwXRDaxrmYw==", + "cpu": [ + "x64" + ], "dev": true, - "dependencies": { - "config-chain": "^1.1.12", - "pify": "^5.0.0" - }, + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": "^14.15.0 || >=16.0.0" + "node": ">= 10" } }, - "node_modules/@lerna/npm-dist-tag": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/npm-dist-tag/-/npm-dist-tag-5.3.0.tgz", - "integrity": "sha512-OPahPk9QLXQXFgtrWm22NNxajVYKavCyTh8ijMwXTGXXbMJAw+PVjokfrUuEtg7FQi+kfJSrYAcJAxxfQq2eiA==", + "node_modules/@nrwl/nx-linux-x64-musl": { + "version": "15.7.1", + "resolved": "https://registry.npmjs.org/@nrwl/nx-linux-x64-musl/-/nx-linux-x64-musl-15.7.1.tgz", + "integrity": "sha512-FOs8FhcACKfYjL5l/mIHUESs25KPsZsp3TWrpCYgQNkrvNV9lWbrQ+h9acWf23hR2FYVk7xKVo4wFYsUqF+DbA==", + "cpu": [ + "x64" + ], "dev": true, - "dependencies": { - "@lerna/otplease": "5.3.0", - "npm-package-arg": "8.1.1", - "npm-registry-fetch": "^13.3.0", - "npmlog": "^6.0.2" - }, + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": "^14.15.0 || >=16.0.0" + "node": ">= 10" } }, - "node_modules/@lerna/npm-install": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/npm-install/-/npm-install-5.3.0.tgz", - "integrity": "sha512-scbWo8nW+P9KfitWG3y7Ep97dOs64ECfz9xfqtjagEXKYBPxG3skvwwljkfNnuxrCNs71JVD+imvcewHzih28g==", + "node_modules/@nrwl/nx-win32-arm64-msvc": { + "version": "15.7.1", + "resolved": "https://registry.npmjs.org/@nrwl/nx-win32-arm64-msvc/-/nx-win32-arm64-msvc-15.7.1.tgz", + "integrity": "sha512-JEhy0ac+ivhIdAPWqEfAN9EqFznKA5vt4oVjIqjDysqgzN9GBKOeo7gphdii9WyqrIKEbOs1L++ADWXw1gev6Q==", + "cpu": [ + "arm64" + ], "dev": true, - "dependencies": { - "@lerna/child-process": "5.3.0", - "@lerna/get-npm-exec-opts": "5.3.0", - "fs-extra": "^9.1.0", - "npm-package-arg": "8.1.1", - "npmlog": "^6.0.2", - "signal-exit": "^3.0.3", - "write-pkg": "^4.0.0" - }, + "optional": true, + "os": [ + "win32" + ], "engines": { - "node": "^14.15.0 || >=16.0.0" + "node": ">= 10" } }, - "node_modules/@lerna/npm-publish": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/npm-publish/-/npm-publish-5.3.0.tgz", - "integrity": "sha512-n+ocN1Dxrs6AmrSNqZl57cwhP4/VjQXdEI+QYauNnErNjMQW8Wt+tNaTlVAhZ1DnorwAo86o2uzFF/BgdUqh9A==", + "node_modules/@nrwl/nx-win32-x64-msvc": { + "version": "15.7.1", + "resolved": "https://registry.npmjs.org/@nrwl/nx-win32-x64-msvc/-/nx-win32-x64-msvc-15.7.1.tgz", + "integrity": "sha512-GLh5TXKViRb55jBviZSZweavilUr2frmb/8iv3Fz7MPS6VvA+axIqNhuVcTJP1H3C/1yt3Nx5wwsXdWgg3mZpw==", + "cpu": [ + "x64" + ], "dev": true, - "dependencies": { - "@lerna/otplease": "5.3.0", - "@lerna/run-lifecycle": "5.3.0", - "fs-extra": "^9.1.0", - "libnpmpublish": "^6.0.4", - "npm-package-arg": "8.1.1", - "npmlog": "^6.0.2", - "pify": "^5.0.0", - "read-package-json": "^5.0.1" - }, + "optional": true, + "os": [ + "win32" + ], "engines": { - "node": "^14.15.0 || >=16.0.0" + "node": ">= 10" } }, - "node_modules/@lerna/npm-run-script": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/npm-run-script/-/npm-run-script-5.3.0.tgz", - "integrity": "sha512-2cLR1YdzeMjaMKgDuwHE+iZgVPt+Ttzb3/wFtp7Mw9TlKmNIdbHdrnfl12ABz5knPC+62CCNjB/gznfLndPp2w==", + "node_modules/@nrwl/tao": { + "version": "15.7.1", + "resolved": "https://registry.npmjs.org/@nrwl/tao/-/tao-15.7.1.tgz", + "integrity": "sha512-pCKIijUGUAht+Lfy9P4WaHxTHnqqr+vaC00vX6XSlkRoFAUFYh7lhbOHDSKOwBG016ZoG73P1IIMg0um4ybd5w==", "dev": true, "dependencies": { - "@lerna/child-process": "5.3.0", - "@lerna/get-npm-exec-opts": "5.3.0", - "npmlog": "^6.0.2" + "nx": "15.7.1" }, - "engines": { - "node": "^14.15.0 || >=16.0.0" + "bin": { + "tao": "index.js" } }, - "node_modules/@lerna/otplease": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/otplease/-/otplease-5.3.0.tgz", - "integrity": "sha512-Xpju2VC5TiycmBP/mdp9hRstkH2MLm8/7o2NotVTCJwASWdKphRMqezhh5BX0E9i6VyrjzmTqSYEh9FNZZ9MwQ==", + "node_modules/@octokit/auth-token": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-3.0.3.tgz", + "integrity": "sha512-/aFM2M4HVDBT/jjDBa84sJniv1t9Gm/rLkalaz9htOm+L+8JMj1k9w0CkUdcxNyNxZPlTxKPVko+m1VlM58ZVA==", "dev": true, "dependencies": { - "@lerna/prompt": "5.3.0" + "@octokit/types": "^9.0.0" }, "engines": { - "node": "^14.15.0 || >=16.0.0" + "node": ">= 14" } }, - "node_modules/@lerna/output": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/output/-/output-5.3.0.tgz", - "integrity": "sha512-fISmHDu/9PKInFmT5NXsbh8cR6aE6SUXWrteXJ6PBYK30s0f/pVcfswb9VccX0Yea8HmqMQgCHWUWifkZeXiRA==", + "node_modules/@octokit/core": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@octokit/core/-/core-4.2.0.tgz", + "integrity": "sha512-AgvDRUg3COpR82P7PBdGZF/NNqGmtMq2NiPqeSsDIeCfYFOZ9gddqWNQHnFdEUf+YwOj4aZYmJnlPp7OXmDIDg==", "dev": true, "dependencies": { - "npmlog": "^6.0.2" + "@octokit/auth-token": "^3.0.0", + "@octokit/graphql": "^5.0.0", + "@octokit/request": "^6.0.0", + "@octokit/request-error": "^3.0.0", + "@octokit/types": "^9.0.0", + "before-after-hook": "^2.2.0", + "universal-user-agent": "^6.0.0" }, "engines": { - "node": "^14.15.0 || >=16.0.0" + "node": ">= 14" } }, - "node_modules/@lerna/pack-directory": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/pack-directory/-/pack-directory-5.3.0.tgz", - "integrity": "sha512-dTGMUB6/GjExhmLZ8yeFaRKJuSm6M/IsfxSJdL4gFPLigUIAS4XhzXS3KnL0+Ef1ue1yaTlAE9c/czfkE0pc/w==", + "node_modules/@octokit/endpoint": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-7.0.5.tgz", + "integrity": "sha512-LG4o4HMY1Xoaec87IqQ41TQ+glvIeTKqfjkCEmt5AIwDZJwQeVZFIEYXrYY6yLwK+pAScb9Gj4q+Nz2qSw1roA==", "dev": true, "dependencies": { - "@lerna/get-packed": "5.3.0", - "@lerna/package": "5.3.0", - "@lerna/run-lifecycle": "5.3.0", - "@lerna/temp-write": "5.3.0", - "npm-packlist": "^5.1.1", - "npmlog": "^6.0.2", - "tar": "^6.1.0" + "@octokit/types": "^9.0.0", + "is-plain-object": "^5.0.0", + "universal-user-agent": "^6.0.0" }, "engines": { - "node": "^14.15.0 || >=16.0.0" + "node": ">= 14" } }, - "node_modules/@lerna/package": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/package/-/package-5.3.0.tgz", - "integrity": "sha512-hsB03miiaNdvZ/UGzl0sVqxVat5x33EG9JiYgIoFqzroQPrG+WShmX3ctuO06TY1pxb4iNuHLPIbQomHEzzj8w==", + "node_modules/@octokit/graphql": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-5.0.5.tgz", + "integrity": "sha512-Qwfvh3xdqKtIznjX9lz2D458r7dJPP8l6r4GQkIdWQouZwHQK0mVT88uwiU2bdTU2OtT1uOlKpRciUWldpG0yQ==", "dev": true, "dependencies": { - "load-json-file": "^6.2.0", - "npm-package-arg": "8.1.1", - "write-pkg": "^4.0.0" + "@octokit/request": "^6.0.0", + "@octokit/types": "^9.0.0", + "universal-user-agent": "^6.0.0" }, "engines": { - "node": "^14.15.0 || >=16.0.0" + "node": ">= 14" } }, - "node_modules/@lerna/package-graph": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/package-graph/-/package-graph-5.3.0.tgz", - "integrity": "sha512-UEHY7l/yknwFvQgo0RifyY+B5QdzuFutLZYSN1BMmyWttOZD9rkM263qnLNGTZ2BUE4dXDwwwOHuhLvi+xDRsA==", + "node_modules/@octokit/openapi-types": { + "version": "16.0.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-16.0.0.tgz", + "integrity": "sha512-JbFWOqTJVLHZSUUoF4FzAZKYtqdxWu9Z5m2QQnOyEa04fOFljvyh7D3GYKbfuaSWisqehImiVIMG4eyJeP5VEA==", + "dev": true + }, + "node_modules/@octokit/plugin-enterprise-rest": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@octokit/plugin-enterprise-rest/-/plugin-enterprise-rest-6.0.1.tgz", + "integrity": "sha512-93uGjlhUD+iNg1iWhUENAtJata6w5nE+V4urXOAlIXdco6xNZtUSfYY8dzp3Udy74aqO/B5UZL80x/YMa5PKRw==", + "dev": true + }, + "node_modules/@octokit/plugin-paginate-rest": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-3.1.0.tgz", + "integrity": "sha512-+cfc40pMzWcLkoDcLb1KXqjX0jTGYXjKuQdFQDc6UAknISJHnZTiBqld6HDwRJvD4DsouDKrWXNbNV0lE/3AXA==", "dev": true, "dependencies": { - "@lerna/prerelease-id-from-version": "5.3.0", - "@lerna/validation-error": "5.3.0", - "npm-package-arg": "8.1.1", - "npmlog": "^6.0.2", - "semver": "^7.3.4" + "@octokit/types": "^6.41.0" }, "engines": { - "node": "^14.15.0 || >=16.0.0" + "node": ">= 14" + }, + "peerDependencies": { + "@octokit/core": ">=4" } }, - "node_modules/@lerna/prerelease-id-from-version": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/prerelease-id-from-version/-/prerelease-id-from-version-5.3.0.tgz", - "integrity": "sha512-o1wsLns6hFTsmk4iqTRJNWLnFzlBBwgu17hp8T2iU4U7LUlDT2ZSKV3smGAU6GfrwX3MAp4LZ5syxgjFjrUOnw==", + "node_modules/@octokit/plugin-paginate-rest/node_modules/@octokit/openapi-types": { + "version": "12.11.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-12.11.0.tgz", + "integrity": "sha512-VsXyi8peyRq9PqIz/tpqiL2w3w80OgVMwBHltTml3LmVvXiphgeqmY9mvBw9Wu7e0QWk/fqD37ux8yP5uVekyQ==", + "dev": true + }, + "node_modules/@octokit/plugin-paginate-rest/node_modules/@octokit/types": { + "version": "6.41.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.41.0.tgz", + "integrity": "sha512-eJ2jbzjdijiL3B4PrSQaSjuF2sPEQPVCPzBvTHJD9Nz+9dw2SGH4K4xeQJ77YfTq5bRQ+bD8wT11JbeDPmxmGg==", "dev": true, "dependencies": { - "semver": "^7.3.4" - }, - "engines": { - "node": "^14.15.0 || >=16.0.0" + "@octokit/openapi-types": "^12.11.0" } }, - "node_modules/@lerna/profiler": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/profiler/-/profiler-5.3.0.tgz", - "integrity": "sha512-LEZYca29EPgZR0q5E+7CJkn25Cw3OxNMQJU/CVn/HGeoWYWOpoDxujrZBl8is2bw06LHXvRbVXEUATLc+ACbqQ==", + "node_modules/@octokit/plugin-request-log": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz", + "integrity": "sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA==", "dev": true, - "dependencies": { - "fs-extra": "^9.1.0", - "npmlog": "^6.0.2", - "upath": "^2.0.1" - }, - "engines": { - "node": "^14.15.0 || >=16.0.0" + "peerDependencies": { + "@octokit/core": ">=3" } }, - "node_modules/@lerna/project": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/project/-/project-5.3.0.tgz", - "integrity": "sha512-InhIo9uwT1yod72ai5SKseJSUk8KkqG6COmwp1/45vibbawb7ZLbokpns7n46A0NdGNlmwJolamybYOuyumejw==", + "node_modules/@octokit/plugin-rest-endpoint-methods": { + "version": "6.8.1", + "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-6.8.1.tgz", + "integrity": "sha512-QrlaTm8Lyc/TbU7BL/8bO49vp+RZ6W3McxxmmQTgYxf2sWkO8ZKuj4dLhPNJD6VCUW1hetCmeIM0m6FTVpDiEg==", "dev": true, "dependencies": { - "@lerna/package": "5.3.0", - "@lerna/validation-error": "5.3.0", - "cosmiconfig": "^7.0.0", - "dedent": "^0.7.0", - "dot-prop": "^6.0.1", - "glob-parent": "^5.1.1", - "globby": "^11.0.2", - "load-json-file": "^6.2.0", - "npmlog": "^6.0.2", - "p-map": "^4.0.0", - "resolve-from": "^5.0.0", - "write-json-file": "^4.3.0" + "@octokit/types": "^8.1.1", + "deprecation": "^2.3.1" }, "engines": { - "node": "^14.15.0 || >=16.0.0" + "node": ">= 14" + }, + "peerDependencies": { + "@octokit/core": ">=3" } }, - "node_modules/@lerna/project/node_modules/resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/openapi-types": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-14.0.0.tgz", + "integrity": "sha512-HNWisMYlR8VCnNurDU6os2ikx0s0VyEjDYHNS/h4cgb8DeOxQ0n72HyinUtdDVxJhFy3FWLGl0DJhfEWk3P5Iw==", + "dev": true + }, + "node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/types": { + "version": "8.2.1", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-8.2.1.tgz", + "integrity": "sha512-8oWMUji8be66q2B9PmEIUyQm00VPDPun07umUWSaCwxmeaquFBro4Hcc3ruVoDo3zkQyZBlRvhIMEYS3pBhanw==", "dev": true, - "engines": { - "node": ">=8" + "dependencies": { + "@octokit/openapi-types": "^14.0.0" } }, - "node_modules/@lerna/prompt": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/prompt/-/prompt-5.3.0.tgz", - "integrity": "sha512-4bIusBdjpw665CJtFsVsaB55hLHnmKnrcOaRjna6N/MdJDl8Th6X4EM4rrfXTX/uUNR3XcV91lYqcLuLmrpm5w==", + "node_modules/@octokit/request": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-6.2.3.tgz", + "integrity": "sha512-TNAodj5yNzrrZ/VxP+H5HiYaZep0H3GU0O7PaF+fhDrt8FPrnkei9Aal/txsN/1P7V3CPiThG0tIvpPDYUsyAA==", "dev": true, "dependencies": { - "inquirer": "^8.2.4", - "npmlog": "^6.0.2" + "@octokit/endpoint": "^7.0.0", + "@octokit/request-error": "^3.0.0", + "@octokit/types": "^9.0.0", + "is-plain-object": "^5.0.0", + "node-fetch": "^2.6.7", + "universal-user-agent": "^6.0.0" }, "engines": { - "node": "^14.15.0 || >=16.0.0" + "node": ">= 14" } }, - "node_modules/@lerna/publish": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/publish/-/publish-5.3.0.tgz", - "integrity": "sha512-T8T1BQdI+NnlVARKwIXzILknEuiQlZToBsDpuX06M7+45t/pp9Z+u6pVt3rrqwiUPZ/dpoZzYKI31YdNJtGMcQ==", - "dev": true, - "dependencies": { - "@lerna/check-working-tree": "5.3.0", - "@lerna/child-process": "5.3.0", - "@lerna/collect-updates": "5.3.0", - "@lerna/command": "5.3.0", - "@lerna/describe-ref": "5.3.0", - "@lerna/log-packed": "5.3.0", - "@lerna/npm-conf": "5.3.0", - "@lerna/npm-dist-tag": "5.3.0", - "@lerna/npm-publish": "5.3.0", - "@lerna/otplease": "5.3.0", - "@lerna/output": "5.3.0", - "@lerna/pack-directory": "5.3.0", - "@lerna/prerelease-id-from-version": "5.3.0", - "@lerna/prompt": "5.3.0", - "@lerna/pulse-till-done": "5.3.0", - "@lerna/run-lifecycle": "5.3.0", - "@lerna/run-topologically": "5.3.0", - "@lerna/validation-error": "5.3.0", - "@lerna/version": "5.3.0", - "fs-extra": "^9.1.0", - "libnpmaccess": "^6.0.3", - "npm-package-arg": "8.1.1", - "npm-registry-fetch": "^13.3.0", - "npmlog": "^6.0.2", - "p-map": "^4.0.0", - "p-pipe": "^3.1.0", - "pacote": "^13.6.1", - "semver": "^7.3.4" + "node_modules/@octokit/request-error": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-3.0.3.tgz", + "integrity": "sha512-crqw3V5Iy2uOU5Np+8M/YexTlT8zxCfI+qu+LxUB7SZpje4Qmx3mub5DfEKSO8Ylyk0aogi6TYdf6kxzh2BguQ==", + "dev": true, + "dependencies": { + "@octokit/types": "^9.0.0", + "deprecation": "^2.0.0", + "once": "^1.4.0" }, "engines": { - "node": "^14.15.0 || >=16.0.0" + "node": ">= 14" } }, - "node_modules/@lerna/pulse-till-done": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/pulse-till-done/-/pulse-till-done-5.3.0.tgz", - "integrity": "sha512-yNvSuPLT1ZTtD2LMVOmiDhw4+9qkyf6xCpfxiUp4cGEN+qIuazWB5JicKLE49o27DBdaG8Ao4lAlb16x/gNrwQ==", + "node_modules/@octokit/rest": { + "version": "19.0.3", + "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-19.0.3.tgz", + "integrity": "sha512-5arkTsnnRT7/sbI4fqgSJ35KiFaN7zQm0uQiQtivNQLI8RQx8EHwJCajcTUwmaCMNDg7tdCvqAnc7uvHHPxrtQ==", "dev": true, "dependencies": { - "npmlog": "^6.0.2" + "@octokit/core": "^4.0.0", + "@octokit/plugin-paginate-rest": "^3.0.0", + "@octokit/plugin-request-log": "^1.0.4", + "@octokit/plugin-rest-endpoint-methods": "^6.0.0" }, "engines": { - "node": "^14.15.0 || >=16.0.0" + "node": ">= 14" } }, - "node_modules/@lerna/query-graph": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/query-graph/-/query-graph-5.3.0.tgz", - "integrity": "sha512-t99lNj97/Vilp5Js1Be7MoyaZ5U0fbOFh0E7lnTfSLvZhTkPMK6xLvAx2M3NQqhwYCQjTFDuf9ozQ3HQtYZAmA==", + "node_modules/@octokit/types": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-9.0.0.tgz", + "integrity": "sha512-LUewfj94xCMH2rbD5YJ+6AQ4AVjFYTgpp6rboWM5T7N3IsIF65SBEOVcYMGAEzO/kKNiNaW4LoWtoThOhH06gw==", "dev": true, "dependencies": { - "@lerna/package-graph": "5.3.0" - }, - "engines": { - "node": "^14.15.0 || >=16.0.0" + "@octokit/openapi-types": "^16.0.0" } }, - "node_modules/@lerna/resolve-symlink": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/resolve-symlink/-/resolve-symlink-5.3.0.tgz", - "integrity": "sha512-zKI7rV5FzzlMBfi6kjDS0ulzcdDTORvdOJ/+CHU5C2h+v+P64Nk2VhZZNCCBDoO/l4GRhgehZOB70GIamO1TSw==", + "node_modules/@parcel/watcher": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.0.4.tgz", + "integrity": "sha512-cTDi+FUDBIUOBKEtj+nhiJ71AZVlkAsQFuGQTun5tV9mwQBQgZvhCzG+URPQc8myeN32yRVZEfVAPCs1RW+Jvg==", "dev": true, + "hasInstallScript": true, "dependencies": { - "fs-extra": "^9.1.0", - "npmlog": "^6.0.2", - "read-cmd-shim": "^3.0.0" + "node-addon-api": "^3.2.1", + "node-gyp-build": "^4.3.0" }, "engines": { - "node": "^14.15.0 || >=16.0.0" + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" } }, - "node_modules/@lerna/rimraf-dir": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/rimraf-dir/-/rimraf-dir-5.3.0.tgz", - "integrity": "sha512-/QJebh0tSY3LjgEyOo+6NH/b7ZNw9IpjqiDtvnLixjtdfkgli1OKOoZTa4KrO0mJoqMRq4yAa98cjpIzyKqCqw==", + "node_modules/@phenomnomnominal/tsquery": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@phenomnomnominal/tsquery/-/tsquery-4.1.1.tgz", + "integrity": "sha512-jjMmK1tnZbm1Jq5a7fBliM4gQwjxMU7TFoRNwIyzwlO+eHPRCFv/Nv+H/Gi1jc3WR7QURG8D5d0Tn12YGrUqBQ==", "dev": true, "dependencies": { - "@lerna/child-process": "5.3.0", - "npmlog": "^6.0.2", - "path-exists": "^4.0.0", - "rimraf": "^3.0.2" + "esquery": "^1.0.1" }, - "engines": { - "node": "^14.15.0 || >=16.0.0" + "peerDependencies": { + "typescript": "^3 || ^4" } }, - "node_modules/@lerna/run": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/run/-/run-5.3.0.tgz", - "integrity": "sha512-KwoKTj1w71OmUHONNYhZME+tr5lk9Q4f+3LUr2WtWZRuOAGO5ZCRrcZc+N4Ib7zno89Ub6Ovz51fcjwltLh72w==", + "node_modules/@pnpm/network.ca-file": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@pnpm/network.ca-file/-/network.ca-file-1.0.1.tgz", + "integrity": "sha512-gkINruT2KUhZLTaiHxwCOh1O4NVnFT0wLjWFBHmTz9vpKag/C/noIMJXBxFe4F0mYpUVX2puLwAieLYFg2NvoA==", "dev": true, "dependencies": { - "@lerna/command": "5.3.0", - "@lerna/filter-options": "5.3.0", - "@lerna/npm-run-script": "5.3.0", - "@lerna/output": "5.3.0", - "@lerna/profiler": "5.3.0", - "@lerna/run-topologically": "5.3.0", - "@lerna/timer": "5.3.0", - "@lerna/validation-error": "5.3.0", - "p-map": "^4.0.0" + "graceful-fs": "4.2.10" }, "engines": { - "node": "^14.15.0 || >=16.0.0" + "node": ">=12.22.0" } }, - "node_modules/@lerna/run-lifecycle": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/run-lifecycle/-/run-lifecycle-5.3.0.tgz", - "integrity": "sha512-EuBCGwm2PLgkebfyqo3yNkwfSb1EzHeo3lA8t4yld6LXWkgUPBFhc7RwRc6TsQOpjpfFvDSGoI282R01o0jPVQ==", + "node_modules/@pnpm/npm-conf": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@pnpm/npm-conf/-/npm-conf-1.0.5.tgz", + "integrity": "sha512-hD8ml183638O3R6/Txrh0L8VzGOrFXgRtRDG4qQC4tONdZ5Z1M+tlUUDUvrjYdmK6G+JTBTeaCLMna11cXzi8A==", "dev": true, "dependencies": { - "@lerna/npm-conf": "5.3.0", - "@npmcli/run-script": "^4.1.7", - "npmlog": "^6.0.2", - "p-queue": "^6.6.2" + "@pnpm/network.ca-file": "^1.0.1", + "config-chain": "^1.1.11" }, "engines": { - "node": "^14.15.0 || >=16.0.0" + "node": ">=12" } }, - "node_modules/@lerna/run-topologically": { + "node_modules/@sindresorhus/is": { "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/run-topologically/-/run-topologically-5.3.0.tgz", - "integrity": "sha512-WiFF2EiwLjAguKs0lEmcukTL7WhuWFwxNprrGWFxEkBhlGdMFk18n8BaZN8FO26xqzztzuPzSx1re/f/dEEAPg==", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.3.0.tgz", + "integrity": "sha512-CX6t4SYQ37lzxicAqsBtxA3OseeoVrh9cSJ5PFYam0GksYlupRfy1A+Q4aYD3zvcfECLc0zO2u+ZnR2UYKvCrw==", "dev": true, - "dependencies": { - "@lerna/query-graph": "5.3.0", - "p-queue": "^6.6.2" - }, "engines": { - "node": "^14.15.0 || >=16.0.0" + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sindresorhus/is?sponsor=1" } }, - "node_modules/@lerna/symlink-binary": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/symlink-binary/-/symlink-binary-5.3.0.tgz", - "integrity": "sha512-dIATASuGS6y512AGjacOoTpkFDPsKlhggjzL3KLdSNmxV3288nUqaFBuA7rTnnMNnBQ7jVuE1JKJupZnzPN0cA==", + "node_modules/@szmarczak/http-timer": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-5.0.1.tgz", + "integrity": "sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==", "dev": true, "dependencies": { - "@lerna/create-symlink": "5.3.0", - "@lerna/package": "5.3.0", - "fs-extra": "^9.1.0", - "p-map": "^4.0.0" + "defer-to-connect": "^2.0.1" }, "engines": { - "node": "^14.15.0 || >=16.0.0" + "node": ">=14.16" } }, - "node_modules/@lerna/symlink-dependencies": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/symlink-dependencies/-/symlink-dependencies-5.3.0.tgz", - "integrity": "sha512-qkq4YT/Bdrb3W22ve+d2Gy3hRTrtT/zBhjKTCukEpYsFJLwSjZ4z5vbv6J15/j6PN1Km9oTRp6vBYmdjAuARQQ==", + "node_modules/@tootallnate/once": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", + "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", "dev": true, - "dependencies": { - "@lerna/create-symlink": "5.3.0", - "@lerna/resolve-symlink": "5.3.0", - "@lerna/symlink-binary": "5.3.0", - "fs-extra": "^9.1.0", - "p-map": "^4.0.0", - "p-map-series": "^2.1.0" - }, "engines": { - "node": "^14.15.0 || >=16.0.0" + "node": ">= 10" } }, - "node_modules/@lerna/temp-write": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/temp-write/-/temp-write-5.3.0.tgz", - "integrity": "sha512-AhC5Q+tV0yebEc1P2jsB4apQzztW8dgdLLc1G1Pkt46l5vezRGhZmsj+iUyCsVjpdUSO/UcAq1DbI2Xzhf5arg==", + "node_modules/@tufjs/models": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@tufjs/models/-/models-1.0.0.tgz", + "integrity": "sha512-RRMu4uMxWnZlxaIBxahSb2IssFZiu188sndesZflWOe1cA/qUqtemSIoBWbuVKPvvdktapImWNnKpBcc+VrCQw==", "dev": true, "dependencies": { - "graceful-fs": "^4.1.15", - "is-stream": "^2.0.0", - "make-dir": "^3.0.0", - "temp-dir": "^1.0.0", - "uuid": "^8.3.2" + "minimatch": "^6.1.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/@lerna/timer": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/timer/-/timer-5.3.0.tgz", - "integrity": "sha512-IeDjj1gJtbUPKl2ebpiml9u4k2kRqYF1Dbs6JuWpeC7lGxAx3JcUmkNH2RQ1BYTxk5xc9FKlgNMrZQwhq2K1Ow==", + "node_modules/@tufjs/models/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, - "engines": { - "node": "^14.15.0 || >=16.0.0" + "dependencies": { + "balanced-match": "^1.0.0" } }, - "node_modules/@lerna/validation-error": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/validation-error/-/validation-error-5.3.0.tgz", - "integrity": "sha512-GVvnTxx+CNFjXCiJahAu2c/pP2R3DhGuQp4CJUyKegnzGaWK0h5PhlwRL7/LbDMPLh2zLobPOVr9kTOjwv76Nw==", + "node_modules/@tufjs/models/node_modules/minimatch": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-6.2.0.tgz", + "integrity": "sha512-sauLxniAmvnhhRjFwPNnJKaPFYyddAgbYdeUpHULtCT/GhzdCx/MDNy+Y40lBxTQUrMzDE8e0S43Z5uqfO0REg==", "dev": true, "dependencies": { - "npmlog": "^6.0.2" + "brace-expansion": "^2.0.1" }, "engines": { - "node": "^14.15.0 || >=16.0.0" - } - }, - "node_modules/@lerna/version": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/version/-/version-5.3.0.tgz", - "integrity": "sha512-QOQSAdpeP66oQQ20nNZ4NhJS5NtZZDGyz36kP/4BeqjGK6QgtrEmto4+vmWj49w3VJUIXnrqAKHiPkhFUmJm5Q==", - "dev": true, - "dependencies": { - "@lerna/check-working-tree": "5.3.0", - "@lerna/child-process": "5.3.0", - "@lerna/collect-updates": "5.3.0", - "@lerna/command": "5.3.0", - "@lerna/conventional-commits": "5.3.0", - "@lerna/github-client": "5.3.0", - "@lerna/gitlab-client": "5.3.0", - "@lerna/output": "5.3.0", - "@lerna/prerelease-id-from-version": "5.3.0", - "@lerna/prompt": "5.3.0", - "@lerna/run-lifecycle": "5.3.0", - "@lerna/run-topologically": "5.3.0", - "@lerna/temp-write": "5.3.0", - "@lerna/validation-error": "5.3.0", - "chalk": "^4.1.0", - "dedent": "^0.7.0", - "load-json-file": "^6.2.0", - "minimatch": "^3.0.4", - "npmlog": "^6.0.2", - "p-map": "^4.0.0", - "p-pipe": "^3.1.0", - "p-reduce": "^2.1.0", - "p-waterfall": "^2.1.1", - "semver": "^7.3.4", - "slash": "^3.0.0", - "write-json-file": "^4.3.0" + "node": ">=10" }, - "engines": { - "node": "^14.15.0 || >=16.0.0" + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/@lerna/write-log-file": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/write-log-file/-/write-log-file-5.3.0.tgz", - "integrity": "sha512-cmrNAI5+9auUJSuTVrUzt2nb/KX6htgjdw7gGPMI1Tm6cdBIbs67R6LedZ8yvYOLGsXB2Se93vxv5fTgEHWfCw==", + "node_modules/@types/glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==", "dev": true, "dependencies": { - "npmlog": "^6.0.2", - "write-file-atomic": "^4.0.1" - }, - "engines": { - "node": "^14.15.0 || >=16.0.0" + "@types/minimatch": "*", + "@types/node": "*" } }, - "node_modules/@lerna/write-log-file/node_modules/write-file-atomic": { + "node_modules/@types/http-cache-semantics": { "version": "4.0.1", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.1.tgz", - "integrity": "sha512-nSKUxgAbyioruk6hU87QzVbY279oYT6uiwgDoujth2ju4mJ+TZau7SQBhtbTmUyuNYTuXnSyRn66FV0+eCgcrQ==", + "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.1.tgz", + "integrity": "sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ==", + "dev": true + }, + "node_modules/@types/json-schema": { + "version": "7.0.11", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", + "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", + "dev": true + }, + "node_modules/@types/minimatch": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-5.1.2.tgz", + "integrity": "sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==", + "dev": true + }, + "node_modules/@types/minimist": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.2.tgz", + "integrity": "sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==", + "dev": true + }, + "node_modules/@types/node": { + "version": "17.0.45", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.45.tgz", + "integrity": "sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==", + "dev": true + }, + "node_modules/@types/normalize-package-data": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz", + "integrity": "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==", + "dev": true + }, + "node_modules/@types/parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", + "dev": true + }, + "node_modules/@types/semver": { + "version": "7.3.13", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.13.tgz", + "integrity": "sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==", + "dev": true + }, + "node_modules/@types/yargs": { + "version": "16.0.5", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.5.tgz", + "integrity": "sha512-AxO/ADJOBFJScHbWhq2xAhlWP24rY4aCEG/NFaMvbT3X2MgRsLjhjQwsn0Zi5zn0LG9jUhCCZMeX9Dkuw6k+vQ==", "dev": true, "dependencies": { - "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.7" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" + "@types/yargs-parser": "*" } }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "node_modules/@types/yargs-parser": { + "version": "21.0.0", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.0.tgz", + "integrity": "sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==", + "dev": true + }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "5.54.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.54.0.tgz", + "integrity": "sha512-+hSN9BdSr629RF02d7mMtXhAJvDTyCbprNYJKrXETlul/Aml6YZwd90XioVbjejQeHbb3R8Dg0CkRgoJDxo8aw==", "dev": true, "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" + "@typescript-eslint/scope-manager": "5.54.0", + "@typescript-eslint/type-utils": "5.54.0", + "@typescript-eslint/utils": "5.54.0", + "debug": "^4.3.4", + "grapheme-splitter": "^1.0.4", + "ignore": "^5.2.0", + "natural-compare-lite": "^1.4.0", + "regexpp": "^3.2.0", + "semver": "^7.3.7", + "tsutils": "^3.21.0" }, "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true, - "engines": { - "node": ">= 8" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^5.0.0", + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } } }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "node_modules/@typescript-eslint/parser": { + "version": "5.54.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.54.0.tgz", + "integrity": "sha512-aAVL3Mu2qTi+h/r04WI/5PfNWvO6pdhpeMRWk9R7rEV4mwJNzoWf5CCU5vDKBsPIFQFjEq1xg7XBI2rjiMXQbQ==", "dev": true, "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" + "@typescript-eslint/scope-manager": "5.54.0", + "@typescript-eslint/types": "5.54.0", + "@typescript-eslint/typescript-estree": "5.54.0", + "debug": "^4.3.4" }, "engines": { - "node": ">= 8" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } } }, - "node_modules/@npmcli/arborist": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@npmcli/arborist/-/arborist-5.3.0.tgz", - "integrity": "sha512-+rZ9zgL1lnbl8Xbb1NQdMjveOMwj4lIYfcDtyJHHi5x4X8jtR6m8SXooJMZy5vmFVZ8w7A2Bnd/oX9eTuU8w5A==", + "node_modules/@typescript-eslint/scope-manager": { + "version": "5.54.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.54.0.tgz", + "integrity": "sha512-VTPYNZ7vaWtYna9M4oD42zENOBrb+ZYyCNdFs949GcN8Miwn37b8b7eMj+EZaq7VK9fx0Jd+JhmkhjFhvnovhg==", "dev": true, "dependencies": { - "@isaacs/string-locale-compare": "^1.1.0", - "@npmcli/installed-package-contents": "^1.0.7", - "@npmcli/map-workspaces": "^2.0.3", - "@npmcli/metavuln-calculator": "^3.0.1", - "@npmcli/move-file": "^2.0.0", - "@npmcli/name-from-folder": "^1.0.1", - "@npmcli/node-gyp": "^2.0.0", - "@npmcli/package-json": "^2.0.0", - "@npmcli/run-script": "^4.1.3", - "bin-links": "^3.0.0", - "cacache": "^16.0.6", - "common-ancestor-path": "^1.0.1", - "json-parse-even-better-errors": "^2.3.1", - "json-stringify-nice": "^1.1.4", - "mkdirp": "^1.0.4", - "mkdirp-infer-owner": "^2.0.0", - "nopt": "^5.0.0", - "npm-install-checks": "^5.0.0", - "npm-package-arg": "^9.0.0", - "npm-pick-manifest": "^7.0.0", - "npm-registry-fetch": "^13.0.0", - "npmlog": "^6.0.2", - "pacote": "^13.6.1", - "parse-conflict-json": "^2.0.1", - "proc-log": "^2.0.0", - "promise-all-reject-late": "^1.0.0", - "promise-call-limit": "^1.0.1", - "read-package-json-fast": "^2.0.2", - "readdir-scoped-modules": "^1.1.0", - "rimraf": "^3.0.2", - "semver": "^7.3.7", - "ssri": "^9.0.0", - "treeverse": "^2.0.0", - "walk-up-path": "^1.0.0" - }, - "bin": { - "arborist": "bin/index.js" + "@typescript-eslint/types": "5.54.0", + "@typescript-eslint/visitor-keys": "5.54.0" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@npmcli/arborist/node_modules/hosted-git-info": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.0.0.tgz", - "integrity": "sha512-rRnjWu0Bxj+nIfUOkz0695C0H6tRrN5iYIzYejb0tDEefe2AekHu/U5Kn9pEie5vsJqpNQU02az7TGSH3qpz4Q==", + "node_modules/@typescript-eslint/type-utils": { + "version": "5.54.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.54.0.tgz", + "integrity": "sha512-WI+WMJ8+oS+LyflqsD4nlXMsVdzTMYTxl16myXPaCXnSgc7LWwMsjxQFZCK/rVmTZ3FN71Ct78ehO9bRC7erYQ==", "dev": true, "dependencies": { - "lru-cache": "^7.5.1" + "@typescript-eslint/typescript-estree": "5.54.0", + "@typescript-eslint/utils": "5.54.0", + "debug": "^4.3.4", + "tsutils": "^3.21.0" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } } }, - "node_modules/@npmcli/arborist/node_modules/hosted-git-info/node_modules/lru-cache": { - "version": "7.13.2", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.13.2.tgz", - "integrity": "sha512-VJL3nIpA79TodY/ctmZEfhASgqekbT574/c4j3jn4bKXbSCnTTCH/KltZyvL2GlV+tGSMtsWyem8DCX7qKTMBA==", + "node_modules/@typescript-eslint/types": { + "version": "5.54.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.54.0.tgz", + "integrity": "sha512-nExy+fDCBEgqblasfeE3aQ3NuafBUxZxgxXcYfzYRZFHdVvk5q60KhCSkG0noHgHRo/xQ/BOzURLZAafFpTkmQ==", "dev": true, "engines": { - "node": ">=12" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@npmcli/arborist/node_modules/npm-package-arg": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-9.1.0.tgz", - "integrity": "sha512-4J0GL+u2Nh6OnhvUKXRr2ZMG4lR8qtLp+kv7UiV00Y+nGiSxtttCyIRHCt5L5BNkXQld/RceYItau3MDOoGiBw==", + "node_modules/@typescript-eslint/typescript-estree": { + "version": "5.54.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.54.0.tgz", + "integrity": "sha512-X2rJG97Wj/VRo5YxJ8Qx26Zqf0RRKsVHd4sav8NElhbZzhpBI8jU54i6hfo9eheumj4oO4dcRN1B/zIVEqR/MQ==", "dev": true, "dependencies": { - "hosted-git-info": "^5.0.0", - "proc-log": "^2.0.1", - "semver": "^7.3.5", - "validate-npm-package-name": "^4.0.0" + "@typescript-eslint/types": "5.54.0", + "@typescript-eslint/visitor-keys": "5.54.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "semver": "^7.3.7", + "tsutils": "^3.21.0" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, - "node_modules/@npmcli/arborist/node_modules/semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, - "bin": { - "semver": "bin/semver.js" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" }, - "engines": { - "node": ">=10" + "peerDependenciesMeta": { + "typescript": { + "optional": true + } } }, - "node_modules/@npmcli/fs": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-2.1.0.tgz", - "integrity": "sha512-DmfBvNXGaetMxj9LTp8NAN9vEidXURrf5ZTslQzEAi/6GbW+4yjaLFQc6Tue5cpZ9Frlk4OBo/Snf1Bh/S7qTQ==", + "node_modules/@typescript-eslint/utils": { + "version": "5.54.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.54.0.tgz", + "integrity": "sha512-cuwm8D/Z/7AuyAeJ+T0r4WZmlnlxQ8wt7C7fLpFlKMR+dY6QO79Cq1WpJhvZbMA4ZeZGHiRWnht7ZJ8qkdAunw==", "dev": true, "dependencies": { - "@gar/promisify": "^1.1.3", - "semver": "^7.3.5" + "@types/json-schema": "^7.0.9", + "@types/semver": "^7.3.12", + "@typescript-eslint/scope-manager": "5.54.0", + "@typescript-eslint/types": "5.54.0", + "@typescript-eslint/typescript-estree": "5.54.0", + "eslint-scope": "^5.1.1", + "eslint-utils": "^3.0.0", + "semver": "^7.3.7" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, - "node_modules/@npmcli/installed-package-contents": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/@npmcli/installed-package-contents/-/installed-package-contents-1.0.7.tgz", - "integrity": "sha512-9rufe0wnJusCQoLpV9ZPKIVP55itrM5BxOXs10DmdbRfgWtHy1LDyskbwRnBghuB0PrF7pNPOqREVtpz4HqzKw==", - "dev": true, - "dependencies": { - "npm-bundled": "^1.1.1", - "npm-normalize-package-bin": "^1.0.1" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, - "bin": { - "installed-package-contents": "index.js" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" }, - "engines": { - "node": ">= 10" + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, - "node_modules/@npmcli/map-workspaces": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@npmcli/map-workspaces/-/map-workspaces-2.0.4.tgz", - "integrity": "sha512-bMo0aAfwhVwqoVM5UzX1DJnlvVvzDCHae821jv48L1EsrYwfOZChlqWYXEtto/+BkBXetPbEWgau++/brh4oVg==", + "node_modules/@typescript-eslint/visitor-keys": { + "version": "5.54.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.54.0.tgz", + "integrity": "sha512-xu4wT7aRCakGINTLGeyGqDn+78BwFlggwBjnHa1ar/KaGagnmwLYmlrXIrgAaQ3AE1Vd6nLfKASm7LrFHNbKGA==", "dev": true, "dependencies": { - "@npmcli/name-from-folder": "^1.0.1", - "glob": "^8.0.1", - "minimatch": "^5.0.1", - "read-package-json-fast": "^2.0.3" + "@typescript-eslint/types": "5.54.0", + "eslint-visitor-keys": "^3.3.0" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@npmcli/map-workspaces/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" - } + "node_modules/@yarnpkg/lockfile": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz", + "integrity": "sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==", + "dev": true }, - "node_modules/@npmcli/map-workspaces/node_modules/glob": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz", - "integrity": "sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==", + "node_modules/@yarnpkg/parsers": { + "version": "3.0.0-rc.39", + "resolved": "https://registry.npmjs.org/@yarnpkg/parsers/-/parsers-3.0.0-rc.39.tgz", + "integrity": "sha512-BsD4zq3EVmaHqlynXTceNuEFAtrfToV4fI9GA54moKlWZL4Eb2eXrhgf1jV2nMYx18SZxYO4Jc5Kf1sCDNRjOg==", "dev": true, "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^5.0.1", - "once": "^1.3.0" + "js-yaml": "^3.10.0", + "tslib": "^2.4.0" }, "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "node": ">=14.15.0" } }, - "node_modules/@npmcli/map-workspaces/node_modules/minimatch": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", - "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", + "node_modules/@yarnpkg/parsers/node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=10" + "sprintf-js": "~1.0.2" } }, - "node_modules/@npmcli/metavuln-calculator": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@npmcli/metavuln-calculator/-/metavuln-calculator-3.1.1.tgz", - "integrity": "sha512-n69ygIaqAedecLeVH3KnO39M6ZHiJ2dEv5A7DGvcqCB8q17BGUgW8QaanIkbWUo2aYGZqJaOORTLAlIvKjNDKA==", + "node_modules/@yarnpkg/parsers/node_modules/js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", "dev": true, "dependencies": { - "cacache": "^16.0.0", - "json-parse-even-better-errors": "^2.3.1", - "pacote": "^13.0.3", - "semver": "^7.3.5" + "argparse": "^1.0.7", + "esprima": "^4.0.0" }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "bin": { + "js-yaml": "bin/js-yaml.js" } }, - "node_modules/@npmcli/move-file": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@npmcli/move-file/-/move-file-2.0.0.tgz", - "integrity": "sha512-UR6D5f4KEGWJV6BGPH3Qb2EtgH+t+1XQ1Tt85c7qicN6cezzuHPdZwwAxqZr4JLtnQu0LZsTza/5gmNmSl8XLg==", + "node_modules/@zkochan/js-yaml": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/@zkochan/js-yaml/-/js-yaml-0.0.6.tgz", + "integrity": "sha512-nzvgl3VfhcELQ8LyVrYOru+UtAy1nrygk2+AGbTm8a5YcO6o8lSjAT+pfg3vJWxIoZKOUhrK6UU7xW/+00kQrg==", "dev": true, "dependencies": { - "mkdirp": "^1.0.4", - "rimraf": "^3.0.2" + "argparse": "^2.0.1" }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "bin": { + "js-yaml": "bin/js-yaml.js" } }, - "node_modules/@npmcli/name-from-folder": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@npmcli/name-from-folder/-/name-from-folder-1.0.1.tgz", - "integrity": "sha512-qq3oEfcLFwNfEYOQ8HLimRGKlD8WSeGEdtUa7hmzpR8Sa7haL1KVQrvgO6wqMjhWFFVjgtrh1gIxDz+P8sjUaA==", + "node_modules/abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", "dev": true }, - "node_modules/@npmcli/node-gyp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@npmcli/node-gyp/-/node-gyp-2.0.0.tgz", - "integrity": "sha512-doNI35wIe3bBaEgrlPfdJPaCpUR89pJWep4Hq3aRdh6gKazIVWfs0jHttvSSoq47ZXgC7h73kDsUl8AoIQUB+A==", + "node_modules/acorn": { + "version": "8.8.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", + "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", "dev": true, + "bin": { + "acorn": "bin/acorn" + }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": ">=0.4.0" } }, - "node_modules/@npmcli/package-json": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@npmcli/package-json/-/package-json-2.0.0.tgz", - "integrity": "sha512-42jnZ6yl16GzjWSH7vtrmWyJDGVa/LXPdpN2rcUWolFjc9ON2N3uz0qdBbQACfmhuJZ2lbKYtmK5qx68ZPLHMA==", + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dev": true, - "dependencies": { - "json-parse-even-better-errors": "^2.3.1" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, - "node_modules/@npmcli/promise-spawn": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@npmcli/promise-spawn/-/promise-spawn-3.0.0.tgz", - "integrity": "sha512-s9SgS+p3a9Eohe68cSI3fi+hpcZUmXq5P7w0kMlAsWVtR7XbK3ptkZqKT2cK1zLDObJ3sR+8P59sJE0w/KTL1g==", + "node_modules/add-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/add-stream/-/add-stream-1.0.0.tgz", + "integrity": "sha512-qQLMr+8o0WC4FZGQTcJiKBVC59JylcPSrTtk6usvmIDFUOCKegapy1VHQwRbFMOFyb/inzUVqHs+eMYKDM1YeQ==", + "dev": true + }, + "node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", "dev": true, "dependencies": { - "infer-owner": "^1.0.4" + "debug": "4" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": ">= 6.0.0" } }, - "node_modules/@npmcli/run-script": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-4.2.0.tgz", - "integrity": "sha512-e/QgLg7j2wSJp1/7JRl0GC8c7PMX+uYlA/1Tb+IDOLdSM4T7K1VQ9mm9IGU3WRtY5vEIObpqCLb3aCNCug18DA==", + "node_modules/agentkeepalive": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.2.1.tgz", + "integrity": "sha512-Zn4cw2NEqd+9fiSVWMscnjyQ1a8Yfoc5oBajLeo5w+YBHgDUcEBY2hS4YpTz6iN5f/2zQiktcuM6tS8x1p9dpA==", "dev": true, "dependencies": { - "@npmcli/node-gyp": "^2.0.0", - "@npmcli/promise-spawn": "^3.0.0", - "node-gyp": "^9.0.0", - "read-package-json-fast": "^2.0.3", - "which": "^2.0.2" + "debug": "^4.1.0", + "depd": "^1.1.2", + "humanize-ms": "^1.2.1" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, - "node_modules/@nrwl/cli": { - "version": "14.4.3", - "resolved": "https://registry.npmjs.org/@nrwl/cli/-/cli-14.4.3.tgz", - "integrity": "sha512-9WzOOXgdf9YJxqte5e8KNkM3NWOuBgM7hz9jEOyw53Ht1Y2H8xLDPVkqDTS9kROgcyMQxHIjIcw80wZNaZL8Mw==", - "dev": true, - "dependencies": { - "nx": "14.4.3" + "node": ">= 8.0.0" } }, - "node_modules/@nrwl/tao": { - "version": "14.4.3", - "resolved": "https://registry.npmjs.org/@nrwl/tao/-/tao-14.4.3.tgz", - "integrity": "sha512-sHlnqTlJ/XEc/lv0MIKYI1R643CWFvYL6QyZD7f38FvP1RblZ6eVqvOJcrkpwcvRWcZNEY+GrQpb1Io1ZvMEmQ==", + "node_modules/aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", "dev": true, "dependencies": { - "nx": "14.4.3" + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" }, - "bin": { - "tao": "index.js" + "engines": { + "node": ">=8" } }, - "node_modules/@octokit/auth-token": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-3.0.0.tgz", - "integrity": "sha512-MDNFUBcJIptB9At7HiV7VCvU3NcL4GnfCQaP8C5lrxWrRPMJBnemYtehaKSOlaM7AYxeRyj9etenu8LVpSpVaQ==", + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, "dependencies": { - "@octokit/types": "^6.0.3" + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" }, - "engines": { - "node": ">= 14" + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/@octokit/core": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@octokit/core/-/core-4.0.4.tgz", - "integrity": "sha512-sUpR/hc4Gc7K34o60bWC7WUH6Q7T6ftZ2dUmepSyJr9PRF76/qqkWjE2SOEzCqLA5W83SaISymwKtxks+96hPQ==", + "node_modules/ansi-align": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.1.tgz", + "integrity": "sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==", "dev": true, "dependencies": { - "@octokit/auth-token": "^3.0.0", - "@octokit/graphql": "^5.0.0", - "@octokit/request": "^6.0.0", - "@octokit/request-error": "^3.0.0", - "@octokit/types": "^6.0.3", - "before-after-hook": "^2.2.0", - "universal-user-agent": "^6.0.0" - }, - "engines": { - "node": ">= 14" + "string-width": "^4.1.0" } }, - "node_modules/@octokit/endpoint": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-7.0.0.tgz", - "integrity": "sha512-Kz/mIkOTjs9rV50hf/JK9pIDl4aGwAtT8pry6Rpy+hVXkAPhXanNQRxMoq6AeRgDCZR6t/A1zKniY2V1YhrzlQ==", + "node_modules/ansi-colors": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", + "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", "dev": true, - "dependencies": { - "@octokit/types": "^6.0.3", - "is-plain-object": "^5.0.0", - "universal-user-agent": "^6.0.0" - }, "engines": { - "node": ">= 14" + "node": ">=6" } }, - "node_modules/@octokit/graphql": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-5.0.0.tgz", - "integrity": "sha512-1ZZ8tX4lUEcLPvHagfIVu5S2xpHYXAmgN0+95eAOPoaVPzCfUXJtA5vASafcpWcO86ze0Pzn30TAx72aB2aguQ==", + "node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", "dev": true, "dependencies": { - "@octokit/request": "^6.0.0", - "@octokit/types": "^6.0.3", - "universal-user-agent": "^6.0.0" + "type-fest": "^0.21.3" }, "engines": { - "node": ">= 14" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@octokit/openapi-types": { - "version": "12.11.0", - "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-12.11.0.tgz", - "integrity": "sha512-VsXyi8peyRq9PqIz/tpqiL2w3w80OgVMwBHltTml3LmVvXiphgeqmY9mvBw9Wu7e0QWk/fqD37ux8yP5uVekyQ==", - "dev": true - }, - "node_modules/@octokit/plugin-enterprise-rest": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/@octokit/plugin-enterprise-rest/-/plugin-enterprise-rest-6.0.1.tgz", - "integrity": "sha512-93uGjlhUD+iNg1iWhUENAtJata6w5nE+V4urXOAlIXdco6xNZtUSfYY8dzp3Udy74aqO/B5UZL80x/YMa5PKRw==", - "dev": true - }, - "node_modules/@octokit/plugin-paginate-rest": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-3.1.0.tgz", - "integrity": "sha512-+cfc40pMzWcLkoDcLb1KXqjX0jTGYXjKuQdFQDc6UAknISJHnZTiBqld6HDwRJvD4DsouDKrWXNbNV0lE/3AXA==", + "node_modules/ansi-escapes/node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", "dev": true, - "dependencies": { - "@octokit/types": "^6.41.0" - }, "engines": { - "node": ">= 14" + "node": ">=10" }, - "peerDependencies": { - "@octokit/core": ">=4" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@octokit/plugin-request-log": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz", - "integrity": "sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA==", + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, - "peerDependencies": { - "@octokit/core": ">=3" + "engines": { + "node": ">=8" } }, - "node_modules/@octokit/plugin-rest-endpoint-methods": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-6.2.0.tgz", - "integrity": "sha512-PZ+yfkbZAuRUtqu6Y191/V3eM0KBPx+Yq7nh+ONPdpm3EX4pd5UnK2y2XgO/0AtNum5a4aJCDjqsDuUZ2hWRXw==", + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "dependencies": { - "@octokit/types": "^6.41.0", - "deprecation": "^2.3.1" + "color-convert": "^2.0.1" }, "engines": { - "node": ">= 14" + "node": ">=8" }, - "peerDependencies": { - "@octokit/core": ">=3" + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/@octokit/request": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/@octokit/request/-/request-6.2.0.tgz", - "integrity": "sha512-7IAmHnaezZrgUqtRShMlByJK33MT9ZDnMRgZjnRrRV9a/jzzFwKGz0vxhFU6i7VMLraYcQ1qmcAOin37Kryq+Q==", + "node_modules/aproba": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", + "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", + "dev": true + }, + "node_modules/are-we-there-yet": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-3.0.1.tgz", + "integrity": "sha512-QZW4EDmGwlYur0Yyf/b2uGucHQMa8aFUP7eu9ddR73vvhFyt4V0Vl3QHPcTNJ8l6qYOBdxgXdnBXQrHilfRQBg==", "dev": true, "dependencies": { - "@octokit/endpoint": "^7.0.0", - "@octokit/request-error": "^3.0.0", - "@octokit/types": "^6.16.1", - "is-plain-object": "^5.0.0", - "node-fetch": "^2.6.7", - "universal-user-agent": "^6.0.0" + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" }, "engines": { - "node": ">= 14" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/@octokit/request-error": { + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "node_modules/array-differ": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-3.0.0.tgz", - "integrity": "sha512-WBtpzm9lR8z4IHIMtOqr6XwfkGvMOOILNLxsWvDwtzm/n7f5AWuqJTXQXdDtOvPfTDrH4TPhEvW2qMlR4JFA2w==", + "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-3.0.0.tgz", + "integrity": "sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg==", "dev": true, - "dependencies": { - "@octokit/types": "^6.0.3", - "deprecation": "^2.0.0", - "once": "^1.4.0" - }, "engines": { - "node": ">= 14" + "node": ">=8" } }, - "node_modules/@octokit/rest": { - "version": "19.0.3", - "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-19.0.3.tgz", - "integrity": "sha512-5arkTsnnRT7/sbI4fqgSJ35KiFaN7zQm0uQiQtivNQLI8RQx8EHwJCajcTUwmaCMNDg7tdCvqAnc7uvHHPxrtQ==", + "node_modules/array-ify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-ify/-/array-ify-1.0.0.tgz", + "integrity": "sha512-c5AMf34bKdvPhQ7tBGhqkgKNUzMr4WUs+WDtC2ZUGOUncbxKMTvqxYctiseW3+L4bA8ec+GcZ6/A/FW4m8ukng==", + "dev": true + }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", "dev": true, - "dependencies": { - "@octokit/core": "^4.0.0", - "@octokit/plugin-paginate-rest": "^3.0.0", - "@octokit/plugin-request-log": "^1.0.4", - "@octokit/plugin-rest-endpoint-methods": "^6.0.0" - }, "engines": { - "node": ">= 14" + "node": ">=8" } }, - "node_modules/@octokit/types": { - "version": "6.41.0", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.41.0.tgz", - "integrity": "sha512-eJ2jbzjdijiL3B4PrSQaSjuF2sPEQPVCPzBvTHJD9Nz+9dw2SGH4K4xeQJ77YfTq5bRQ+bD8wT11JbeDPmxmGg==", + "node_modules/arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==", "dev": true, - "dependencies": { - "@octokit/openapi-types": "^12.11.0" + "engines": { + "node": ">=0.10.0" } }, - "node_modules/@parcel/watcher": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.0.4.tgz", - "integrity": "sha512-cTDi+FUDBIUOBKEtj+nhiJ71AZVlkAsQFuGQTun5tV9mwQBQgZvhCzG+URPQc8myeN32yRVZEfVAPCs1RW+Jvg==", - "dev": true, - "hasInstallScript": true, - "dependencies": { - "node-addon-api": "^3.2.1", - "node-gyp-build": "^4.3.0" - }, + "node_modules/asap": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", + "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==", + "dev": true + }, + "node_modules/async": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.4.tgz", + "integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==", + "dev": true + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "dev": true + }, + "node_modules/at-least-node": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", + "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", + "dev": true, "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" + "node": ">= 4.0.0" } }, - "node_modules/@pnpm/network.ca-file": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@pnpm/network.ca-file/-/network.ca-file-1.0.1.tgz", - "integrity": "sha512-gkINruT2KUhZLTaiHxwCOh1O4NVnFT0wLjWFBHmTz9vpKag/C/noIMJXBxFe4F0mYpUVX2puLwAieLYFg2NvoA==", + "node_modules/axios": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.3.3.tgz", + "integrity": "sha512-eYq77dYIFS77AQlhzEL937yUBSepBfPIe8FcgEDN35vMNZKMrs81pgnyrQpwfy4NF4b4XWX1Zgx7yX+25w8QJA==", "dev": true, "dependencies": { - "graceful-fs": "4.2.10" - }, - "engines": { - "node": ">=12.22.0" + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" } }, - "node_modules/@pnpm/npm-conf": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@pnpm/npm-conf/-/npm-conf-1.0.5.tgz", - "integrity": "sha512-hD8ml183638O3R6/Txrh0L8VzGOrFXgRtRDG4qQC4tONdZ5Z1M+tlUUDUvrjYdmK6G+JTBTeaCLMna11cXzi8A==", + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/before-after-hook": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.3.tgz", + "integrity": "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==", + "dev": true + }, + "node_modules/bin-links": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/bin-links/-/bin-links-3.0.3.tgz", + "integrity": "sha512-zKdnMPWEdh4F5INR07/eBrodC7QrF5JKvqskjz/ZZRXg5YSAZIbn8zGhbhUrElzHBZ2fvEQdOU59RHcTG3GiwA==", "dev": true, "dependencies": { - "@pnpm/network.ca-file": "^1.0.1", - "config-chain": "^1.1.11" + "cmd-shim": "^5.0.0", + "mkdirp-infer-owner": "^2.0.0", + "npm-normalize-package-bin": "^2.0.0", + "read-cmd-shim": "^3.0.0", + "rimraf": "^3.0.0", + "write-file-atomic": "^4.0.0" }, "engines": { - "node": ">=12" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/@protobufjs/aspromise": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", - "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==" - }, - "node_modules/@protobufjs/base64": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", - "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" - }, - "node_modules/@protobufjs/codegen": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", - "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" + "node_modules/bin-links/node_modules/npm-normalize-package-bin": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-2.0.0.tgz", + "integrity": "sha512-awzfKUO7v0FscrSpRoogyNm0sajikhBWpU0QMrW09AMi9n1PoKU6WaIqUzuJSQnpciZZmJ/jMZ2Egfmb/9LiWQ==", + "dev": true, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } }, - "node_modules/@protobufjs/eventemitter": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", - "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==" + "node_modules/bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "dev": true, + "dependencies": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } }, - "node_modules/@protobufjs/fetch": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", - "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", + "node_modules/boxen": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/boxen/-/boxen-7.0.0.tgz", + "integrity": "sha512-j//dBVuyacJbvW+tvZ9HuH03fZ46QcaKvvhZickZqtB271DxJ7SNRSNxrV/dZX0085m7hISRZWbzWlJvx/rHSg==", + "dev": true, "dependencies": { - "@protobufjs/aspromise": "^1.1.1", - "@protobufjs/inquire": "^1.1.0" + "ansi-align": "^3.0.1", + "camelcase": "^7.0.0", + "chalk": "^5.0.1", + "cli-boxes": "^3.0.0", + "string-width": "^5.1.2", + "type-fest": "^2.13.0", + "widest-line": "^4.0.1", + "wrap-ansi": "^8.0.1" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@protobufjs/float": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", - "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==" + "node_modules/boxen/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } }, - "node_modules/@protobufjs/inquire": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", - "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==" + "node_modules/boxen/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } }, - "node_modules/@protobufjs/path": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", - "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==" + "node_modules/boxen/node_modules/camelcase": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-7.0.0.tgz", + "integrity": "sha512-JToIvOmz6nhGsUhAYScbo2d6Py5wojjNfoxoc2mEVLUdJ70gJK2gnd+ABY1Tc3sVMyK7QDPtN0T/XdlCQWITyQ==", + "dev": true, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, - "node_modules/@protobufjs/pool": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", - "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==" + "node_modules/boxen/node_modules/chalk": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.1.2.tgz", + "integrity": "sha512-E5CkT4jWURs1Vy5qGJye+XwCkNj7Od3Af7CP6SujMetSMkLs8Do2RWJK5yx1wamHV/op8Rz+9rltjaTQWDnEFQ==", + "dev": true, + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } }, - "node_modules/@protobufjs/utf8": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", - "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==" + "node_modules/boxen/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true }, - "node_modules/@sindresorhus/is": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.3.0.tgz", - "integrity": "sha512-CX6t4SYQ37lzxicAqsBtxA3OseeoVrh9cSJ5PFYam0GksYlupRfy1A+Q4aYD3zvcfECLc0zO2u+ZnR2UYKvCrw==", + "node_modules/boxen/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "dev": true, + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, "engines": { - "node": ">=14.16" + "node": ">=12" }, "funding": { - "url": "https://github.com/sindresorhus/is?sponsor=1" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@szmarczak/http-timer": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-5.0.1.tgz", - "integrity": "sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==", + "node_modules/boxen/node_modules/strip-ansi": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", + "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", "dev": true, "dependencies": { - "defer-to-connect": "^2.0.1" + "ansi-regex": "^6.0.1" }, "engines": { - "node": ">=14.16" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, - "node_modules/@tootallnate/once": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", - "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", + "node_modules/boxen/node_modules/type-fest": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", + "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", "dev": true, "engines": { - "node": ">= 10" + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@types/cacheable-request": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/@types/cacheable-request/-/cacheable-request-6.0.2.tgz", - "integrity": "sha512-B3xVo+dlKM6nnKTcmm5ZtY/OL8bOAOd2Olee9M1zft65ox50OzjEHW91sDiU9j6cvW8Ejg1/Qkf4xd2kugApUA==", + "node_modules/boxen/node_modules/wrap-ansi": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.0.1.tgz", + "integrity": "sha512-QFF+ufAqhoYHvoHdajT/Po7KoXVBPXS2bgjIam5isfWJPfIOnQZ50JtUiVvCv/sjgacf3yRrt2ZKUZ/V4itN4g==", "dev": true, "dependencies": { - "@types/http-cache-semantics": "*", - "@types/keyv": "*", - "@types/node": "*", - "@types/responselike": "*" + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/@types/glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==", + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "dependencies": { - "@types/minimatch": "*", - "@types/node": "*" + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" } }, - "node_modules/@types/http-cache-semantics": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.1.tgz", - "integrity": "sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ==", - "dev": true + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } }, - "node_modules/@types/json-buffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/json-buffer/-/json-buffer-3.0.0.tgz", - "integrity": "sha512-3YP80IxxFJB4b5tYC2SUPwkg0XQLiu0nWvhRgEatgjf+29IcWO9X1k8xRv5DGssJ/lCrjYTjQPcobJr2yWIVuQ==", - "dev": true - }, - "node_modules/@types/json-schema": { - "version": "7.0.11", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", - "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", - "dev": true - }, - "node_modules/@types/json5": { - "version": "0.0.29", - "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", - "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", - "dev": true - }, - "node_modules/@types/keyv": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/@types/keyv/-/keyv-3.1.4.tgz", - "integrity": "sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==", + "node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], "dependencies": { - "@types/node": "*" + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" } }, - "node_modules/@types/long": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz", - "integrity": "sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==" - }, - "node_modules/@types/minimatch": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.5.tgz", - "integrity": "sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==", - "dev": true - }, - "node_modules/@types/minimist": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.2.tgz", - "integrity": "sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==", - "dev": true - }, - "node_modules/@types/node": { - "version": "17.0.45", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.45.tgz", - "integrity": "sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==" - }, - "node_modules/@types/normalize-package-data": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz", - "integrity": "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==", + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "dev": true }, - "node_modules/@types/object-hash": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/@types/object-hash/-/object-hash-1.3.4.tgz", - "integrity": "sha512-xFdpkAkikBgqBdG9vIlsqffDV8GpvnPEzs0IUtr1v3BEB97ijsFQ4RXVbUZwjFThhB4MDSTUfvmxUD5PGx0wXA==" + "node_modules/builtins": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.1.tgz", + "integrity": "sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==", + "dev": true, + "dependencies": { + "semver": "^7.0.0" + } }, - "node_modules/@types/parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", - "dev": true + "node_modules/byte-size": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/byte-size/-/byte-size-7.0.0.tgz", + "integrity": "sha512-NNiBxKgxybMBtWdmvx7ZITJi4ZG+CYUgwOSZTfqB1qogkRHrhbQE/R2r5Fh94X+InN5MCYz6SvB/ejHMj/HbsQ==", + "dev": true, + "engines": { + "node": ">=10" + } }, - "node_modules/@types/responselike": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.0.tgz", - "integrity": "sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==", + "node_modules/cacache": { + "version": "16.1.3", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-16.1.3.tgz", + "integrity": "sha512-/+Emcj9DAXxX4cwlLmRI9c166RuL3w30zp4R7Joiv2cQTtTtA+jeuCAjH3ZlGnYS3tKENSrKhAzVVP9GVyzeYQ==", "dev": true, "dependencies": { - "@types/node": "*" + "@npmcli/fs": "^2.1.0", + "@npmcli/move-file": "^2.0.0", + "chownr": "^2.0.0", + "fs-minipass": "^2.1.0", + "glob": "^8.0.1", + "infer-owner": "^1.0.4", + "lru-cache": "^7.7.1", + "minipass": "^3.1.6", + "minipass-collect": "^1.0.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "mkdirp": "^1.0.4", + "p-map": "^4.0.0", + "promise-inflight": "^1.0.1", + "rimraf": "^3.0.2", + "ssri": "^9.0.0", + "tar": "^6.1.11", + "unique-filename": "^2.0.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/@types/yargs": { - "version": "16.0.4", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.4.tgz", - "integrity": "sha512-T8Yc9wt/5LbJyCaLiHPReJa0kApcIgJ7Bn735GjItUfh08Z1pJvu8QZqb9s+mMvKV6WUQRV7K2R46YbjMXTTJw==", + "node_modules/cacache/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, "dependencies": { - "@types/yargs-parser": "*" + "balanced-match": "^1.0.0" } }, - "node_modules/@types/yargs-parser": { - "version": "20.2.1", - "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-20.2.1.tgz", - "integrity": "sha512-7tFImggNeNBVMsn0vLrpn1H1uPrUBdnARPTpZoitY37ZrdJREzf7I16tMrlK3hen349gr1NYh8CmZQa7CTG6Aw==", - "dev": true - }, - "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.32.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.32.0.tgz", - "integrity": "sha512-CHLuz5Uz7bHP2WgVlvoZGhf0BvFakBJKAD/43Ty0emn4wXWv5k01ND0C0fHcl/Im8Td2y/7h44E9pca9qAu2ew==", + "node_modules/cacache/node_modules/glob": { + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz", + "integrity": "sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "5.32.0", - "@typescript-eslint/type-utils": "5.32.0", - "@typescript-eslint/utils": "5.32.0", - "debug": "^4.3.4", - "functional-red-black-tree": "^1.0.1", - "ignore": "^5.2.0", - "regexpp": "^3.2.0", - "semver": "^7.3.7", - "tsutils": "^3.21.0" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": ">=12" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "@typescript-eslint/parser": "^5.0.0", - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "node_modules/cacache/node_modules/minimatch": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", + "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", "dev": true, "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" + "brace-expansion": "^2.0.1" }, "engines": { "node": ">=10" } }, - "node_modules/@typescript-eslint/parser": { - "version": "5.32.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.32.0.tgz", - "integrity": "sha512-IxRtsehdGV9GFQ35IGm5oKKR2OGcazUoiNBxhRV160iF9FoyuXxjY+rIqs1gfnd+4eL98OjeGnMpE7RF/NBb3A==", + "node_modules/cacheable-lookup": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-7.0.0.tgz", + "integrity": "sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w==", "dev": true, - "dependencies": { - "@typescript-eslint/scope-manager": "5.32.0", - "@typescript-eslint/types": "5.32.0", - "@typescript-eslint/typescript-estree": "5.32.0", - "debug": "^4.3.4" - }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "node": ">=14.16" } }, - "node_modules/@typescript-eslint/scope-manager": { - "version": "5.32.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.32.0.tgz", - "integrity": "sha512-KyAE+tUON0D7tNz92p1uetRqVJiiAkeluvwvZOqBmW9z2XApmk5WSMV9FrzOroAcVxJZB3GfUwVKr98Dr/OjOg==", + "node_modules/cacheable-request": { + "version": "10.2.7", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-10.2.7.tgz", + "integrity": "sha512-I4SA6mKgDxcxVbSt/UmIkb9Ny8qSkg6ReBHtAAXnZHk7KOSx5g3DTiAOaYzcHCs6oOdHn+bip9T48E6tMvK9hw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.32.0", - "@typescript-eslint/visitor-keys": "5.32.0" + "@types/http-cache-semantics": "^4.0.1", + "get-stream": "^6.0.1", + "http-cache-semantics": "^4.1.1", + "keyv": "^4.5.2", + "mimic-response": "^4.0.0", + "normalize-url": "^8.0.0", + "responselike": "^3.0.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" + "node": ">=14.16" } }, - "node_modules/@typescript-eslint/type-utils": { - "version": "5.32.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.32.0.tgz", - "integrity": "sha512-0gSsIhFDduBz3QcHJIp3qRCvVYbqzHg8D6bHFsDMrm0rURYDj+skBK2zmYebdCp+4nrd9VWd13egvhYFJj/wZg==", + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true, - "dependencies": { - "@typescript-eslint/utils": "5.32.0", - "debug": "^4.3.4", - "tsutils": "^3.21.0" - }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "*" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "node": ">=6" } }, - "node_modules/@typescript-eslint/types": { - "version": "5.32.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.32.0.tgz", - "integrity": "sha512-EBUKs68DOcT/EjGfzywp+f8wG9Zw6gj6BjWu7KV/IYllqKJFPlZlLSYw/PTvVyiRw50t6wVbgv4p9uE2h6sZrQ==", + "node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" + "node": ">=6" } }, - "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.32.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.32.0.tgz", - "integrity": "sha512-ZVAUkvPk3ITGtCLU5J4atCw9RTxK+SRc6hXqLtllC2sGSeMFWN+YwbiJR9CFrSFJ3w4SJfcWtDwNb/DmUIHdhg==", + "node_modules/camelcase-keys": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz", + "integrity": "sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.32.0", - "@typescript-eslint/visitor-keys": "5.32.0", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" + "camelcase": "^5.3.1", + "map-obj": "^4.0.0", + "quick-lru": "^4.0.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": ">=8" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, "engines": { "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/@typescript-eslint/utils": { - "version": "5.32.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.32.0.tgz", - "integrity": "sha512-W7lYIAI5Zlc5K082dGR27Fczjb3Q57ECcXefKU/f0ajM5ToM0P+N9NmJWip8GmGu/g6QISNT+K6KYB+iSHjXCQ==", + "node_modules/chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", + "dev": true + }, + "node_modules/chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", "dev": true, - "dependencies": { - "@types/json-schema": "^7.0.9", - "@typescript-eslint/scope-manager": "5.32.0", - "@typescript-eslint/types": "5.32.0", - "@typescript-eslint/typescript-estree": "5.32.0", - "eslint-scope": "^5.1.1", - "eslint-utils": "^3.0.0" - }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + "node": ">=10" } }, - "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.32.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.32.0.tgz", - "integrity": "sha512-S54xOHZgfThiZ38/ZGTgB2rqx51CMJ5MCfVT2IplK4Q7hgzGfe0nLzLCcenDnc/cSjP568hdeKfeDcBgqNHD/g==", + "node_modules/ci-info": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", + "dev": true + }, + "node_modules/clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.32.0", - "eslint-visitor-keys": "^3.3.0" - }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": ">=6" + } + }, + "node_modules/cli-boxes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-3.0.0.tgz", + "integrity": "sha512-/lzGpEWL/8PfI0BmBOPRwp0c/wFNX1RdUML3jK/RcSBA9T8mZDdQpqYBKtCFTOfQbwPqWEOpjqW+Fnayc0969g==", + "dev": true, + "engines": { + "node": ">=10" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/abbrev": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", - "dev": true - }, - "node_modules/acorn": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz", - "integrity": "sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==", + "node_modules/cli-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", "dev": true, - "bin": { - "acorn": "bin/acorn" + "dependencies": { + "restore-cursor": "^3.1.0" }, "engines": { - "node": ">=0.4.0" + "node": ">=8" } }, - "node_modules/acorn-jsx": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", - "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "node_modules/cli-spinners": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.6.1.tgz", + "integrity": "sha512-x/5fWmGMnbKQAaNwN+UZlV79qBLM9JFnJuJ03gIi5whrob0xV0ofNVHy9DhwGdsMJQc2OKv0oGmLzvaqvAVv+g==", "dev": true, - "peerDependencies": { - "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/add-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/add-stream/-/add-stream-1.0.0.tgz", - "integrity": "sha512-qQLMr+8o0WC4FZGQTcJiKBVC59JylcPSrTtk6usvmIDFUOCKegapy1VHQwRbFMOFyb/inzUVqHs+eMYKDM1YeQ==", - "dev": true - }, - "node_modules/agent-base": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "node_modules/cli-table": { + "version": "0.3.11", + "resolved": "https://registry.npmjs.org/cli-table/-/cli-table-0.3.11.tgz", + "integrity": "sha512-IqLQi4lO0nIB4tcdTpN4LCB9FI3uqrJZK7RC515EnhZ6qBaglkIgICb1wjeAqpdoOabm1+SuQtkXIPdYC93jhQ==", "dev": true, "dependencies": { - "debug": "4" + "colors": "1.0.3" }, "engines": { - "node": ">= 6.0.0" + "node": ">= 0.2.0" } }, - "node_modules/agentkeepalive": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.2.1.tgz", - "integrity": "sha512-Zn4cw2NEqd+9fiSVWMscnjyQ1a8Yfoc5oBajLeo5w+YBHgDUcEBY2hS4YpTz6iN5f/2zQiktcuM6tS8x1p9dpA==", + "node_modules/cli-width": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz", + "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==", "dev": true, - "dependencies": { - "debug": "^4.1.0", - "depd": "^1.1.2", - "humanize-ms": "^1.2.1" - }, "engines": { - "node": ">= 8.0.0" + "node": ">= 10" } }, - "node_modules/aggregate-error": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", - "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", "dev": true, "dependencies": { - "clean-stack": "^2.0.0", - "indent-string": "^4.0.0" - }, + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/clone": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==", + "dev": true, "engines": { - "node": ">=8" + "node": ">=0.8" } }, - "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "node_modules/clone-deep": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", + "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", "dev": true, "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" + "is-plain-object": "^2.0.4", + "kind-of": "^6.0.2", + "shallow-clone": "^3.0.0" }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" + "engines": { + "node": ">=6" } }, - "node_modules/ansi-align": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.1.tgz", - "integrity": "sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==", + "node_modules/clone-deep/node_modules/is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", "dev": true, "dependencies": { - "string-width": "^4.1.0" + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" } }, - "node_modules/ansi-colors": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", - "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", + "node_modules/cmd-shim": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cmd-shim/-/cmd-shim-5.0.0.tgz", + "integrity": "sha512-qkCtZ59BidfEwHltnJwkyVZn+XQojdAySM1D1gSeh11Z4pW1Kpolkyo53L5noc0nrxmIvyFwTmJRo4xs7FFLPw==", "dev": true, + "dependencies": { + "mkdirp-infer-owner": "^2.0.0" + }, "engines": { - "node": ">=6" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/ansi-escapes": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", - "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "dependencies": { - "type-fest": "^0.21.3" + "color-name": "~1.1.4" }, "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=7.0.0" } }, - "node_modules/ansi-escapes/node_modules/type-fest": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", - "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/color-support": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "bin": { + "color-support": "bin.js" } }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "node_modules/colors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz", + "integrity": "sha512-pFGrxThWcWQ2MsAz6RtgeWe4NK2kUE1WfsrvvlctdII745EW9I0yflqhe7++M5LEc7bV2c/9/5zc8sFcpL0Drw==", "dev": true, "engines": { - "node": ">=8" + "node": ">=0.1.90" } }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "node_modules/columnify": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/columnify/-/columnify-1.6.0.tgz", + "integrity": "sha512-lomjuFZKfM6MSAnV9aCZC9sc0qGbmZdfygNv+nCpqVkSKdCxCklLtd16O0EILGkImHw9ZpHkAnHaB+8Zxq5W6Q==", "dev": true, "dependencies": { - "color-convert": "^2.0.1" + "strip-ansi": "^6.0.1", + "wcwidth": "^1.0.0" }, "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "node": ">=8.0.0" } }, - "node_modules/anymatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", - "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", "dev": true, "dependencies": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" + "delayed-stream": "~1.0.0" }, "engines": { - "node": ">= 8" + "node": ">= 0.8" } }, - "node_modules/aproba": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", - "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", - "dev": true - }, - "node_modules/are-we-there-yet": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-3.0.0.tgz", - "integrity": "sha512-0GWpv50YSOcLXaN6/FAKY3vfRbllXWV2xvfA/oKJF8pzFhWXPV+yjhJXDBbjscDYowv7Yw1A3uigpzn5iEGTyw==", + "node_modules/commander": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.0.tgz", + "integrity": "sha512-zS5PnTI22FIRM6ylNW8G4Ap0IEOyk62fhLSD0+uHRT9McRCLGpkVNvao4bjimpK/GShynyQkFFxHhwMcETmduA==", "dev": true, - "dependencies": { - "delegates": "^1.0.0", - "readable-stream": "^3.6.0" - }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" + "node": ">=14" } }, - "node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "node_modules/common-ancestor-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/common-ancestor-path/-/common-ancestor-path-1.0.1.tgz", + "integrity": "sha512-L3sHRo1pXXEqX8VU28kfgUY+YGsk09hPqZiZmLacNib6XNTCM8ubYeT7ryXQw8asB1sKgcU5lkB7ONug08aB8w==", "dev": true }, - "node_modules/array-differ": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-3.0.0.tgz", - "integrity": "sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg==", + "node_modules/compare-func": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-2.0.0.tgz", + "integrity": "sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA==", + "dev": true, + "dependencies": { + "array-ify": "^1.0.0", + "dot-prop": "^5.1.0" + } + }, + "node_modules/compare-func/node_modules/dot-prop": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", + "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", "dev": true, + "dependencies": { + "is-obj": "^2.0.0" + }, "engines": { "node": ">=8" } }, - "node_modules/array-ify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-ify/-/array-ify-1.0.0.tgz", - "integrity": "sha512-c5AMf34bKdvPhQ7tBGhqkgKNUzMr4WUs+WDtC2ZUGOUncbxKMTvqxYctiseW3+L4bA8ec+GcZ6/A/FW4m8ukng==", + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true }, - "node_modules/array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "node_modules/concat-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz", + "integrity": "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==", "dev": true, - "engines": { - "node": ">=8" + "engines": [ + "node >= 6.0" + ], + "dependencies": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.0.2", + "typedarray": "^0.0.6" } }, - "node_modules/arrify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==", + "node_modules/config-chain": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.13.tgz", + "integrity": "sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==", "dev": true, - "engines": { - "node": ">=0.10.0" + "dependencies": { + "ini": "^1.3.4", + "proto-list": "~1.2.1" } }, - "node_modules/asap": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", - "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==", - "dev": true - }, - "node_modules/at-least-node": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", - "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", + "node_modules/configstore": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/configstore/-/configstore-6.0.0.tgz", + "integrity": "sha512-cD31W1v3GqUlQvbBCGcXmd2Nj9SvLDOP1oQ0YFuLETufzSPaKp11rYBsSOm7rCsW3OnIRAFM3OxRhceaXNYHkA==", "dev": true, + "dependencies": { + "dot-prop": "^6.0.1", + "graceful-fs": "^4.2.6", + "unique-string": "^3.0.0", + "write-file-atomic": "^3.0.3", + "xdg-basedir": "^5.0.1" + }, "engines": { - "node": ">= 4.0.0" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/yeoman/configstore?sponsor=1" } }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true - }, - "node_modules/base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "node_modules/configstore/node_modules/write-file-atomic": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", + "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] + "dependencies": { + "imurmurhash": "^0.1.4", + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^3.1.5" + } }, - "node_modules/before-after-hook": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.2.tgz", - "integrity": "sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ==", + "node_modules/console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==", "dev": true }, - "node_modules/bin-links": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/bin-links/-/bin-links-3.0.1.tgz", - "integrity": "sha512-9vx+ypzVhASvHTS6K+YSGf7nwQdANoz7v6MTC0aCtYnOEZ87YvMf81aY737EZnGZdpbRM3sfWjO9oWkKmuIvyQ==", + "node_modules/conventional-changelog-angular": { + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-5.0.12.tgz", + "integrity": "sha512-5GLsbnkR/7A89RyHLvvoExbiGbd9xKdKqDTrArnPbOqBqG/2wIosu0fHwpeIRI8Tl94MhVNBXcLJZl92ZQ5USw==", "dev": true, "dependencies": { - "cmd-shim": "^5.0.0", - "mkdirp-infer-owner": "^2.0.0", - "npm-normalize-package-bin": "^1.0.0", - "read-cmd-shim": "^3.0.0", - "rimraf": "^3.0.0", - "write-file-atomic": "^4.0.0" + "compare-func": "^2.0.0", + "q": "^1.5.1" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": ">=10" } }, - "node_modules/bin-links/node_modules/write-file-atomic": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.1.tgz", - "integrity": "sha512-nSKUxgAbyioruk6hU87QzVbY279oYT6uiwgDoujth2ju4mJ+TZau7SQBhtbTmUyuNYTuXnSyRn66FV0+eCgcrQ==", + "node_modules/conventional-changelog-core": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/conventional-changelog-core/-/conventional-changelog-core-4.2.4.tgz", + "integrity": "sha512-gDVS+zVJHE2v4SLc6B0sLsPiloR0ygU7HaDW14aNJE1v4SlqJPILPl/aJC7YdtRE4CybBf8gDwObBvKha8Xlyg==", "dev": true, "dependencies": { - "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.7" + "add-stream": "^1.0.0", + "conventional-changelog-writer": "^5.0.0", + "conventional-commits-parser": "^3.2.0", + "dateformat": "^3.0.0", + "get-pkg-repo": "^4.0.0", + "git-raw-commits": "^2.0.8", + "git-remote-origin-url": "^2.0.0", + "git-semver-tags": "^4.1.1", + "lodash": "^4.17.15", + "normalize-package-data": "^3.0.0", + "q": "^1.5.1", + "read-pkg": "^3.0.0", + "read-pkg-up": "^3.0.0", + "through2": "^4.0.0" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" + "node": ">=10" } }, - "node_modules/binary-extensions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "node_modules/conventional-changelog-preset-loader": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-2.3.4.tgz", + "integrity": "sha512-GEKRWkrSAZeTq5+YjUZOYxdHq+ci4dNwHvpaBC3+ENalzFWuCWa9EZXSuZBpkr72sMdKB+1fyDV4takK1Lf58g==", "dev": true, "engines": { - "node": ">=8" + "node": ">=10" } }, - "node_modules/bl": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", - "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "node_modules/conventional-changelog-writer": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-5.0.1.tgz", + "integrity": "sha512-5WsuKUfxW7suLblAbFnxAcrvf6r+0b7GvNaWUwUIk0bXMnENP/PEieGKVUQrjPqwPT4o3EPAASBXiY6iHooLOQ==", "dev": true, "dependencies": { - "buffer": "^5.5.0", - "inherits": "^2.0.4", - "readable-stream": "^3.4.0" + "conventional-commits-filter": "^2.0.7", + "dateformat": "^3.0.0", + "handlebars": "^4.7.7", + "json-stringify-safe": "^5.0.1", + "lodash": "^4.17.15", + "meow": "^8.0.0", + "semver": "^6.0.0", + "split": "^1.0.0", + "through2": "^4.0.0" + }, + "bin": { + "conventional-changelog-writer": "cli.js" + }, + "engines": { + "node": ">=10" } }, - "node_modules/boxen": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/boxen/-/boxen-7.0.0.tgz", - "integrity": "sha512-j//dBVuyacJbvW+tvZ9HuH03fZ46QcaKvvhZickZqtB271DxJ7SNRSNxrV/dZX0085m7hISRZWbzWlJvx/rHSg==", + "node_modules/conventional-changelog-writer/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/conventional-commits-filter": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-2.0.7.tgz", + "integrity": "sha512-ASS9SamOP4TbCClsRHxIHXRfcGCnIoQqkvAzCSbZzTFLfcTqJVugB0agRgsEELsqaeWgsXv513eS116wnlSSPA==", "dev": true, "dependencies": { - "ansi-align": "^3.0.1", - "camelcase": "^7.0.0", - "chalk": "^5.0.1", - "cli-boxes": "^3.0.0", - "string-width": "^5.1.2", - "type-fest": "^2.13.0", - "widest-line": "^4.0.1", - "wrap-ansi": "^8.0.1" + "lodash.ismatch": "^4.4.0", + "modify-values": "^1.0.0" }, "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=10" } }, - "node_modules/boxen/node_modules/ansi-regex": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", - "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "node_modules/conventional-commits-parser": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-3.2.4.tgz", + "integrity": "sha512-nK7sAtfi+QXbxHCYfhpZsfRtaitZLIA6889kFIouLvz6repszQDgxBu7wf2WbU+Dco7sAnNCJYERCwt54WPC2Q==", "dev": true, - "engines": { - "node": ">=12" + "dependencies": { + "is-text-path": "^1.0.1", + "JSONStream": "^1.0.4", + "lodash": "^4.17.15", + "meow": "^8.0.0", + "split2": "^3.0.0", + "through2": "^4.0.0" }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" + "bin": { + "conventional-commits-parser": "cli.js" + }, + "engines": { + "node": ">=10" } }, - "node_modules/boxen/node_modules/ansi-styles": { + "node_modules/conventional-recommended-bump": { "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.1.0.tgz", - "integrity": "sha512-VbqNsoz55SYGczauuup0MFUyXNQviSpFTj1RQtFzmQLk18qbVSpTFFGMT293rmDaQuKCT6InmbuEyUne4mTuxQ==", + "resolved": "https://registry.npmjs.org/conventional-recommended-bump/-/conventional-recommended-bump-6.1.0.tgz", + "integrity": "sha512-uiApbSiNGM/kkdL9GTOLAqC4hbptObFo4wW2QRyHsKciGAfQuLU1ShZ1BIVI/+K2BE/W1AWYQMCXAsv4dyKPaw==", "dev": true, - "engines": { - "node": ">=12" + "dependencies": { + "concat-stream": "^2.0.0", + "conventional-changelog-preset-loader": "^2.3.4", + "conventional-commits-filter": "^2.0.7", + "conventional-commits-parser": "^3.2.0", + "git-raw-commits": "^2.0.8", + "git-semver-tags": "^4.1.1", + "meow": "^8.0.0", + "q": "^1.5.1" }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "bin": { + "conventional-recommended-bump": "cli.js" + }, + "engines": { + "node": ">=10" } }, - "node_modules/boxen/node_modules/camelcase": { + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "dev": true + }, + "node_modules/cosmiconfig": { "version": "7.0.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-7.0.0.tgz", - "integrity": "sha512-JToIvOmz6nhGsUhAYScbo2d6Py5wojjNfoxoc2mEVLUdJ70gJK2gnd+ABY1Tc3sVMyK7QDPtN0T/XdlCQWITyQ==", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.0.tgz", + "integrity": "sha512-pondGvTuVYDk++upghXJabWzL6Kxu6f26ljFw64Swq9v6sQPUL3EUlVDV56diOjpCayKihL6hVe8exIACU4XcA==", "dev": true, - "engines": { - "node": ">=14.16" + "dependencies": { + "@types/parse-json": "^4.0.0", + "import-fresh": "^3.2.1", + "parse-json": "^5.0.0", + "path-type": "^4.0.0", + "yaml": "^1.10.0" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/boxen/node_modules/chalk": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.0.1.tgz", - "integrity": "sha512-Fo07WOYGqMfCWHOzSXOt2CxDbC6skS/jO9ynEcmpANMoPrD+W1r1K6Vx7iNm+AQmETU1Xr2t+n8nzkV9t6xh3w==", - "dev": true, "engines": { - "node": "^12.17.0 || ^14.13 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "node": ">=10" } }, - "node_modules/boxen/node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "dev": true - }, - "node_modules/boxen/node_modules/string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "dev": true, "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" }, "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">= 8" } }, - "node_modules/boxen/node_modules/strip-ansi": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", - "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", + "node_modules/crypto-random-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-4.0.0.tgz", + "integrity": "sha512-x8dy3RnvYdlUcPOjkEHqozhiwzKNSq7GcPuXFbnyMOCHxX8V3OgIg/pYuabl2sbUPfIJaeAQB7PMOK8DFIdoRA==", "dev": true, "dependencies": { - "ansi-regex": "^6.0.1" + "type-fest": "^1.0.1" }, "engines": { "node": ">=12" }, "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/boxen/node_modules/type-fest": { - "version": "2.18.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.18.0.tgz", - "integrity": "sha512-pRS+/yrW5TjPPHNOvxhbNZexr2bS63WjrMU8a+VzEBhUi9Tz1pZeD+vQz3ut0svZ46P+SRqMEPnJmk2XnvNzTw==", + "node_modules/crypto-random-string/node_modules/type-fest": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", + "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", "dev": true, "engines": { - "node": ">=12.20" + "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/boxen/node_modules/wrap-ansi": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.0.1.tgz", - "integrity": "sha512-QFF+ufAqhoYHvoHdajT/Po7KoXVBPXS2bgjIam5isfWJPfIOnQZ50JtUiVvCv/sjgacf3yRrt2ZKUZ/V4itN4g==", + "node_modules/dargs": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/dargs/-/dargs-7.0.0.tgz", + "integrity": "sha512-2iy1EkLdlBzQGvbweYRFxmFath8+K7+AKB0TlhHWkNuH+TmovaMH/Wp7V7R4u7f4SnX3OgLsU9t1NI9ioDnUpg==", "dev": true, - "dependencies": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" - }, "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + "node": ">=8" } }, - "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "node_modules/dateformat": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz", + "integrity": "sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==", "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "engines": { + "node": "*" } }, - "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dev": true, "dependencies": { - "fill-range": "^7.0.1" + "ms": "2.1.2" }, "engines": { - "node": ">=8" - } - }, - "node_modules/buffer": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true } - ], - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" } }, - "node_modules/buffer-from": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "dev": true - }, - "node_modules/builtins": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.1.tgz", - "integrity": "sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==", + "node_modules/debuglog": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/debuglog/-/debuglog-1.0.1.tgz", + "integrity": "sha512-syBZ+rnAK3EgMsH2aYEOLUW7mZSY9Gb+0wUMCFsZvcmiz+HigA0LOcq/HoQqVuGG+EKykunc7QG2bzrponfaSw==", "dev": true, - "dependencies": { - "semver": "^7.0.0" + "engines": { + "node": "*" } }, - "node_modules/byte-size": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/byte-size/-/byte-size-7.0.1.tgz", - "integrity": "sha512-crQdqyCwhokxwV1UyDzLZanhkugAgft7vt0qbbdt60C6Zf3CAiGmtUCylbtYwrU6loOUw3euGrNtW1J651ot1A==", + "node_modules/decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", "dev": true, "engines": { - "node": ">=10" + "node": ">=0.10.0" } }, - "node_modules/cacache": { - "version": "16.1.1", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-16.1.1.tgz", - "integrity": "sha512-VDKN+LHyCQXaaYZ7rA/qtkURU+/yYhviUdvqEv2LT6QPZU8jpyzEkEVAcKlKLt5dJ5BRp11ym8lo3NKLluEPLg==", + "node_modules/decamelize-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.1.tgz", + "integrity": "sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg==", "dev": true, "dependencies": { - "@npmcli/fs": "^2.1.0", - "@npmcli/move-file": "^2.0.0", - "chownr": "^2.0.0", - "fs-minipass": "^2.1.0", - "glob": "^8.0.1", - "infer-owner": "^1.0.4", - "lru-cache": "^7.7.1", - "minipass": "^3.1.6", - "minipass-collect": "^1.0.2", - "minipass-flush": "^1.0.5", - "minipass-pipeline": "^1.2.4", - "mkdirp": "^1.0.4", - "p-map": "^4.0.0", - "promise-inflight": "^1.0.1", - "rimraf": "^3.0.2", - "ssri": "^9.0.0", - "tar": "^6.1.11", - "unique-filename": "^1.1.1" + "decamelize": "^1.1.0", + "map-obj": "^1.0.0" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": ">=0.10.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/cacache/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "node_modules/decamelize-keys/node_modules/map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==", "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" + "engines": { + "node": ">=0.10.0" } }, - "node_modules/cacache/node_modules/glob": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz", - "integrity": "sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==", + "node_modules/decompress-response": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", + "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", "dev": true, "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^5.0.1", - "once": "^1.3.0" + "mimic-response": "^3.1.0" }, "engines": { - "node": ">=12" + "node": ">=10" }, "funding": { - "url": "https://github.com/sponsors/isaacs" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/cacache/node_modules/lru-cache": { - "version": "7.12.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.12.0.tgz", - "integrity": "sha512-OIP3DwzRZDfLg9B9VP/huWBlpvbkmbfiBy8xmsXp4RPmE4A3MhwNozc5ZJ3fWnSg8fDcdlE/neRTPG2ycEKliw==", + "node_modules/decompress-response/node_modules/mimic-response": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", + "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", "dev": true, - "engines": { - "node": ">=12" - } - }, - "node_modules/cacache/node_modules/minimatch": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", - "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", - "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, "engines": { "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/cacheable-lookup": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-6.0.4.tgz", - "integrity": "sha512-mbcDEZCkv2CZF4G01kr8eBd/5agkt9oCqz75tJMSIsquvRZ2sL6Hi5zGVKi/0OSC9oO1GHfJ2AV0ZIOY9vye0A==", + "node_modules/dedent": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", + "integrity": "sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==", + "dev": true + }, + "node_modules/deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", "dev": true, "engines": { - "node": ">=10.6.0" + "node": ">=4.0.0" } }, - "node_modules/cacheable-request": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-7.0.2.tgz", - "integrity": "sha512-pouW8/FmiPQbuGpkXQ9BAPv/Mo5xDGANgSNXzTzJ8DrKGuXOssM4wIQRjfanNRh3Yu5cfYPvcorqbhg2KIJtew==", + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, + "node_modules/defaults": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz", + "integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==", "dev": true, "dependencies": { - "clone-response": "^1.0.2", - "get-stream": "^5.1.0", - "http-cache-semantics": "^4.0.0", - "keyv": "^4.0.0", - "lowercase-keys": "^2.0.0", - "normalize-url": "^6.0.1", - "responselike": "^2.0.0" + "clone": "^1.0.2" }, - "engines": { - "node": ">=8" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/cacheable-request/node_modules/get-stream": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", - "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "node_modules/defer-to-connect": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz", + "integrity": "sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==", "dev": true, - "dependencies": { - "pump": "^3.0.0" - }, "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=10" } }, - "node_modules/cacheable-request/node_modules/lowercase-keys": { + "node_modules/define-lazy-prop": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", - "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", + "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz", + "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==", "dev": true, "engines": { "node": ">=8" } }, - "node_modules/callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", "dev": true, "engines": { - "node": ">=6" + "node": ">=0.4.0" } }, - "node_modules/camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "node_modules/delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==", + "dev": true + }, + "node_modules/depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==", "dev": true, "engines": { - "node": ">=6" + "node": ">= 0.6" } }, - "node_modules/camelcase-keys": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz", - "integrity": "sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==", + "node_modules/deprecation": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", + "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==", + "dev": true + }, + "node_modules/detect-indent": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-6.1.0.tgz", + "integrity": "sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/dezalgo": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/dezalgo/-/dezalgo-1.0.4.tgz", + "integrity": "sha512-rXSP0bf+5n0Qonsb+SVVfNfIsimO4HEtmnIpPHY8Q1UCzKlQrDMfdobr8nJOOsRgWCyMRqeSBQzmWUMq7zvVig==", "dev": true, "dependencies": { - "camelcase": "^5.3.1", - "map-obj": "^4.0.0", - "quick-lru": "^4.0.1" + "asap": "^2.0.0", + "wrappy": "1" + } + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "dependencies": { + "path-type": "^4.0.0" }, "engines": { "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", "dev": true, "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" + "esutils": "^2.0.2" }, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "node": ">=6.0.0" } }, - "node_modules/chardet": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", - "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", - "dev": true - }, - "node_modules/chokidar": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", - "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "node_modules/dot-prop": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz", + "integrity": "sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==", "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ], "dependencies": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" + "is-obj": "^2.0.0" }, "engines": { - "node": ">= 8.10.0" + "node": ">=10" }, - "optionalDependencies": { - "fsevents": "~2.3.2" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/chownr": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", - "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "node_modules/dotenv": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-10.0.0.tgz", + "integrity": "sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==", "dev": true, "engines": { "node": ">=10" } }, - "node_modules/ci-info": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", - "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", + "node_modules/duplexer": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz", + "integrity": "sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==", "dev": true }, - "node_modules/clean-stack": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", - "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true + }, + "node_modules/ejs": { + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.8.tgz", + "integrity": "sha512-/sXZeMlhS0ArkfX2Aw780gJzXSMPnKjtspYZv+f3NiKLlubezAHDU5+9xz6gd3/NhG3txQCo6xlglmTS+oTGEQ==", "dev": true, + "dependencies": { + "jake": "^10.8.5" + }, + "bin": { + "ejs": "bin/cli.js" + }, "engines": { - "node": ">=6" + "node": ">=0.10.0" } }, - "node_modules/cli-boxes": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-3.0.0.tgz", - "integrity": "sha512-/lzGpEWL/8PfI0BmBOPRwp0c/wFNX1RdUML3jK/RcSBA9T8mZDdQpqYBKtCFTOfQbwPqWEOpjqW+Fnayc0969g==", + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/encoding": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", + "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "optional": true, + "dependencies": { + "iconv-lite": "^0.6.2" } }, - "node_modules/cli-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", - "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "node_modules/encoding/node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", "dev": true, + "optional": true, "dependencies": { - "restore-cursor": "^3.1.0" + "safer-buffer": ">= 2.1.2 < 3.0.0" }, "engines": { - "node": ">=8" + "node": ">=0.10.0" } }, - "node_modules/cli-spinners": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.6.1.tgz", - "integrity": "sha512-x/5fWmGMnbKQAaNwN+UZlV79qBLM9JFnJuJ03gIi5whrob0xV0ofNVHy9DhwGdsMJQc2OKv0oGmLzvaqvAVv+g==", + "node_modules/end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", "dev": true, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "dependencies": { + "once": "^1.4.0" } }, - "node_modules/cli-table": { - "version": "0.3.11", - "resolved": "https://registry.npmjs.org/cli-table/-/cli-table-0.3.11.tgz", - "integrity": "sha512-IqLQi4lO0nIB4tcdTpN4LCB9FI3uqrJZK7RC515EnhZ6qBaglkIgICb1wjeAqpdoOabm1+SuQtkXIPdYC93jhQ==", + "node_modules/enquirer": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", + "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", "dev": true, "dependencies": { - "colors": "1.0.3" + "ansi-colors": "^4.1.1" }, "engines": { - "node": ">= 0.2.0" + "node": ">=8.6" } }, - "node_modules/cli-width": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz", - "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==", + "node_modules/env-paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", "dev": true, "engines": { - "node": ">= 10" + "node": ">=6" } }, - "node_modules/cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "node_modules/envinfo": { + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.8.1.tgz", + "integrity": "sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw==", + "dev": true, + "bin": { + "envinfo": "dist/cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/err-code": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz", + "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==", + "dev": true + }, + "node_modules/error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", "dev": true, "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" + "is-arrayish": "^0.2.1" } }, - "node_modules/clone": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", - "integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==", + "node_modules/escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", "dev": true, "engines": { - "node": ">=0.8" + "node": ">=6" } }, - "node_modules/clone-deep": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", - "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", + "node_modules/escape-goat": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-goat/-/escape-goat-4.0.0.tgz", + "integrity": "sha512-2Sd4ShcWxbx6OY1IHyla/CVNwvg7XwZVoXZHcSu9w9SReNP1EzzD5T8NWKIR38fIqEns9kDWKUQTXXAmlDrdPg==", "dev": true, - "dependencies": { - "is-plain-object": "^2.0.4", - "kind-of": "^6.0.2", - "shallow-clone": "^3.0.0" + "engines": { + "node": ">=12" }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, "engines": { - "node": ">=6" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/clone-deep/node_modules/is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "node_modules/eslint": { + "version": "8.35.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.35.0.tgz", + "integrity": "sha512-BxAf1fVL7w+JLRQhWl2pzGeSiGqbWumV4WNvc9Rhp6tiCtm4oHnyPBSEtMGZwrQgudFQ+otqzWoPB7x+hxoWsw==", "dev": true, "dependencies": { - "isobject": "^3.0.1" + "@eslint/eslintrc": "^2.0.0", + "@eslint/js": "8.35.0", + "@humanwhocodes/config-array": "^0.11.8", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.1.1", + "eslint-utils": "^3.0.0", + "eslint-visitor-keys": "^3.3.0", + "espree": "^9.4.0", + "esquery": "^1.4.2", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "grapheme-splitter": "^1.0.4", + "ignore": "^5.2.0", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-sdsl": "^4.1.4", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "regexpp": "^3.2.0", + "strip-ansi": "^6.0.1", + "strip-json-comments": "^3.1.0", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" }, "engines": { - "node": ">=0.10.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, - "node_modules/clone-response": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.3.tgz", - "integrity": "sha512-ROoL94jJH2dUVML2Y/5PEDNaSHgeOdSDicUyS7izcF63G6sTc/FTjLub4b8Il9S8S0beOfYt0TaA5qvFK+w0wA==", + "node_modules/eslint-config-prettier": { + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.6.0.tgz", + "integrity": "sha512-bAF0eLpLVqP5oEVUFKpMA+NnRFICwn9X8B5jrR9FcqnYBuPbqWEjTEspPWMj5ye6czoSLDweCzSo3Ko7gGrZaA==", "dev": true, - "dependencies": { - "mimic-response": "^1.0.0" + "bin": { + "eslint-config-prettier": "bin/cli.js" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "peerDependencies": { + "eslint": ">=7.0.0" } }, - "node_modules/cmd-shim": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cmd-shim/-/cmd-shim-5.0.0.tgz", - "integrity": "sha512-qkCtZ59BidfEwHltnJwkyVZn+XQojdAySM1D1gSeh11Z4pW1Kpolkyo53L5noc0nrxmIvyFwTmJRo4xs7FFLPw==", + "node_modules/eslint-plugin-simple-import-sort": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-simple-import-sort/-/eslint-plugin-simple-import-sort-7.0.0.tgz", + "integrity": "sha512-U3vEDB5zhYPNfxT5TYR7u01dboFZp+HNpnGhkDB2g/2E4wZ/g1Q9Ton8UwCLfRV9yAKyYqDh62oHOamvkFxsvw==", + "dev": true, + "peerDependencies": { + "eslint": ">=5.0.0" + } + }, + "node_modules/eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", "dev": true, "dependencies": { - "mkdirp-infer-owner": "^2.0.0" + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": ">=8.0.0" } }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "node_modules/eslint-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", "dev": true, "dependencies": { - "color-name": "~1.1.4" + "eslint-visitor-keys": "^2.0.0" }, "engines": { - "node": ">=7.0.0" + "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + }, + "peerDependencies": { + "eslint": ">=5" } }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/color-support": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", - "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", "dev": true, - "bin": { - "color-support": "bin.js" + "engines": { + "node": ">=10" } }, - "node_modules/colors": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz", - "integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=", + "node_modules/eslint-visitor-keys": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", + "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", "dev": true, "engines": { - "node": ">=0.1.90" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, - "node_modules/columnify": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/columnify/-/columnify-1.6.0.tgz", - "integrity": "sha512-lomjuFZKfM6MSAnV9aCZC9sc0qGbmZdfygNv+nCpqVkSKdCxCklLtd16O0EILGkImHw9ZpHkAnHaB+8Zxq5W6Q==", + "node_modules/eslint/node_modules/eslint-scope": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", + "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", "dev": true, "dependencies": { - "strip-ansi": "^6.0.1", - "wcwidth": "^1.0.0" + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" }, "engines": { - "node": ">=8.0.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, - "node_modules/commander": { - "version": "9.4.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-9.4.0.tgz", - "integrity": "sha512-sRPT+umqkz90UA8M1yqYfnHlZA7fF6nSphDtxeywPZ49ysjxDQybzk13CL+mXekDRG92skbcqCLVovuCusNmFw==", + "node_modules/eslint/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, "engines": { - "node": "^12.20.0 || >=14" + "node": ">=4.0" } }, - "node_modules/common-ancestor-path": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/common-ancestor-path/-/common-ancestor-path-1.0.1.tgz", - "integrity": "sha512-L3sHRo1pXXEqX8VU28kfgUY+YGsk09hPqZiZmLacNib6XNTCM8ubYeT7ryXQw8asB1sKgcU5lkB7ONug08aB8w==", - "dev": true - }, - "node_modules/compare-func": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-2.0.0.tgz", - "integrity": "sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA==", + "node_modules/espree": { + "version": "9.4.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.4.1.tgz", + "integrity": "sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg==", "dev": true, "dependencies": { - "array-ify": "^1.0.0", - "dot-prop": "^5.1.0" + "acorn": "^8.8.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, - "node_modules/compare-func/node_modules/dot-prop": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", - "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "dev": true, - "dependencies": { - "is-obj": "^2.0.0" + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" }, "engines": { - "node": ">=8" + "node": ">=4" } }, - "node_modules/compress-brotli": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/compress-brotli/-/compress-brotli-1.3.8.tgz", - "integrity": "sha512-lVcQsjhxhIXsuupfy9fmZUFtAIdBmXA7EGY6GBdgZ++qkM9zG4YFT8iU7FoBxzryNDMOpD1HIFHUSX4D87oqhQ==", + "node_modules/esquery": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", "dev": true, "dependencies": { - "@types/json-buffer": "~3.0.0", - "json-buffer": "~3.0.1" + "estraverse": "^5.1.0" }, "engines": { - "node": ">= 12" + "node": ">=0.10" } }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true + "node_modules/esquery/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } }, - "node_modules/concat-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz", - "integrity": "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==", + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "dev": true, - "engines": [ - "node >= 6.0" - ], "dependencies": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^3.0.2", - "typedarray": "^0.0.6" + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" } }, - "node_modules/config-chain": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.13.tgz", - "integrity": "sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==", + "node_modules/esrecurse/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, - "dependencies": { - "ini": "^1.3.4", - "proto-list": "~1.2.1" + "engines": { + "node": ">=4.0" } }, - "node_modules/configstore": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/configstore/-/configstore-6.0.0.tgz", - "integrity": "sha512-cD31W1v3GqUlQvbBCGcXmd2Nj9SvLDOP1oQ0YFuLETufzSPaKp11rYBsSOm7rCsW3OnIRAFM3OxRhceaXNYHkA==", + "node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", "dev": true, - "dependencies": { - "dot-prop": "^6.0.1", - "graceful-fs": "^4.2.6", - "unique-string": "^3.0.0", - "write-file-atomic": "^3.0.3", - "xdg-basedir": "^5.0.1" - }, "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/yeoman/configstore?sponsor=1" + "node": ">=4.0" } }, - "node_modules/console-control-strings": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eventemitter3": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", + "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", "dev": true }, - "node_modules/conventional-changelog-angular": { - "version": "5.0.13", - "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-5.0.13.tgz", - "integrity": "sha512-i/gipMxs7s8L/QeuavPF2hLnJgH6pEZAttySB6aiQLWcX3puWDL3ACVmvBhJGxnAy52Qc15ua26BufY6KpmrVA==", + "node_modules/execa": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.0.0.tgz", + "integrity": "sha512-ov6w/2LCiuyO4RLYGdpFGjkcs0wMTgGE8PrkTHikeUy5iJekXyPIKUjifk5CsE0pt7sMCrMZ3YNqoCj6idQOnQ==", "dev": true, "dependencies": { - "compare-func": "^2.0.0", - "q": "^1.5.1" + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" }, "engines": { "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, - "node_modules/conventional-changelog-core": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/conventional-changelog-core/-/conventional-changelog-core-4.2.4.tgz", - "integrity": "sha512-gDVS+zVJHE2v4SLc6B0sLsPiloR0ygU7HaDW14aNJE1v4SlqJPILPl/aJC7YdtRE4CybBf8gDwObBvKha8Xlyg==", + "node_modules/expect-more": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/expect-more/-/expect-more-1.3.0.tgz", + "integrity": "sha512-HnXT5nJb9V3DMnr5RgA1TiKbu5kRaJ0GD1JkuhZvnr1Qe3HJq+ESnrcl/jmVUZ8Ycnl3Sp0OTYUhmO36d2+zow==", + "dev": true + }, + "node_modules/external-editor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", "dev": true, "dependencies": { - "add-stream": "^1.0.0", - "conventional-changelog-writer": "^5.0.0", - "conventional-commits-parser": "^3.2.0", - "dateformat": "^3.0.0", - "get-pkg-repo": "^4.0.0", - "git-raw-commits": "^2.0.8", - "git-remote-origin-url": "^2.0.0", - "git-semver-tags": "^4.1.1", - "lodash": "^4.17.15", - "normalize-package-data": "^3.0.0", - "q": "^1.5.1", - "read-pkg": "^3.0.0", - "read-pkg-up": "^3.0.0", - "through2": "^4.0.0" + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" }, "engines": { - "node": ">=10" + "node": ">=4" } }, - "node_modules/conventional-changelog-preset-loader": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-2.3.4.tgz", - "integrity": "sha512-GEKRWkrSAZeTq5+YjUZOYxdHq+ci4dNwHvpaBC3+ENalzFWuCWa9EZXSuZBpkr72sMdKB+1fyDV4takK1Lf58g==", + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "node_modules/fast-glob": { + "version": "3.2.12", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", + "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", "dev": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, "engines": { - "node": ">=10" + "node": ">=8.6.0" } }, - "node_modules/conventional-changelog-writer": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-5.0.1.tgz", - "integrity": "sha512-5WsuKUfxW7suLblAbFnxAcrvf6r+0b7GvNaWUwUIk0bXMnENP/PEieGKVUQrjPqwPT4o3EPAASBXiY6iHooLOQ==", + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, "dependencies": { - "conventional-commits-filter": "^2.0.7", - "dateformat": "^3.0.0", - "handlebars": "^4.7.7", - "json-stringify-safe": "^5.0.1", - "lodash": "^4.17.15", - "meow": "^8.0.0", - "semver": "^6.0.0", - "split": "^1.0.0", - "through2": "^4.0.0" - }, - "bin": { - "conventional-changelog-writer": "cli.js" + "is-glob": "^4.0.1" }, "engines": { - "node": ">=10" + "node": ">= 6" } }, - "node_modules/conventional-changelog-writer/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true + }, + "node_modules/fast-memoize": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/fast-memoize/-/fast-memoize-2.5.2.tgz", + "integrity": "sha512-Ue0LwpDYErFbmNnZSF0UH6eImUwDmogUO1jyE+JbN2gsQz/jICm1Ve7t9QT0rNSsfJt+Hs4/S3GnsDVjL4HVrw==", + "dev": true + }, + "node_modules/fastq": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", + "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", "dev": true, - "bin": { - "semver": "bin/semver.js" + "dependencies": { + "reusify": "^1.0.4" } }, - "node_modules/conventional-commits-filter": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-2.0.7.tgz", - "integrity": "sha512-ASS9SamOP4TbCClsRHxIHXRfcGCnIoQqkvAzCSbZzTFLfcTqJVugB0agRgsEELsqaeWgsXv513eS116wnlSSPA==", + "node_modules/figures": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", "dev": true, "dependencies": { - "lodash.ismatch": "^4.4.0", - "modify-values": "^1.0.0" + "escape-string-regexp": "^1.0.5" }, "engines": { - "node": ">=10" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/conventional-commits-parser": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-3.2.4.tgz", - "integrity": "sha512-nK7sAtfi+QXbxHCYfhpZsfRtaitZLIA6889kFIouLvz6repszQDgxBu7wf2WbU+Dco7sAnNCJYERCwt54WPC2Q==", + "node_modules/figures/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true, - "dependencies": { - "is-text-path": "^1.0.1", - "JSONStream": "^1.0.4", - "lodash": "^4.17.15", - "meow": "^8.0.0", - "split2": "^3.0.0", - "through2": "^4.0.0" - }, - "bin": { - "conventional-commits-parser": "cli.js" - }, "engines": { - "node": ">=10" + "node": ">=0.8.0" } }, - "node_modules/conventional-recommended-bump": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/conventional-recommended-bump/-/conventional-recommended-bump-6.1.0.tgz", - "integrity": "sha512-uiApbSiNGM/kkdL9GTOLAqC4hbptObFo4wW2QRyHsKciGAfQuLU1ShZ1BIVI/+K2BE/W1AWYQMCXAsv4dyKPaw==", + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", "dev": true, "dependencies": { - "concat-stream": "^2.0.0", - "conventional-changelog-preset-loader": "^2.3.4", - "conventional-commits-filter": "^2.0.7", - "conventional-commits-parser": "^3.2.0", - "git-raw-commits": "^2.0.8", - "git-semver-tags": "^4.1.1", - "meow": "^8.0.0", - "q": "^1.5.1" - }, - "bin": { - "conventional-recommended-bump": "cli.js" + "flat-cache": "^3.0.4" }, "engines": { - "node": ">=10" + "node": "^10.12.0 || >=12.0.0" } }, - "node_modules/core-util-is": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", - "dev": true - }, - "node_modules/cosmiconfig": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.1.tgz", - "integrity": "sha512-a1YWNUV2HwGimB7dU2s1wUMurNKjpx60HxBB6xUM8Re+2s1g1IIfJvFR0/iCF+XHdE0GMTKTuLR32UQff4TEyQ==", + "node_modules/filelist": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz", + "integrity": "sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==", "dev": true, "dependencies": { - "@types/parse-json": "^4.0.0", - "import-fresh": "^3.2.1", - "parse-json": "^5.0.0", - "path-type": "^4.0.0", - "yaml": "^1.10.0" - }, - "engines": { - "node": ">=10" + "minimatch": "^5.0.1" } }, - "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "node_modules/filelist/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" + "balanced-match": "^1.0.0" + } + }, + "node_modules/filelist/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" }, "engines": { - "node": ">= 8" + "node": ">=10" } }, - "node_modules/crypto-random-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-4.0.0.tgz", - "integrity": "sha512-x8dy3RnvYdlUcPOjkEHqozhiwzKNSq7GcPuXFbnyMOCHxX8V3OgIg/pYuabl2sbUPfIJaeAQB7PMOK8DFIdoRA==", + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", "dev": true, "dependencies": { - "type-fest": "^1.0.1" + "to-regex-range": "^5.0.1" }, "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=8" } }, - "node_modules/crypto-random-string/node_modules/type-fest": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", - "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, "engines": { "node": ">=10" }, @@ -3424,233 +3430,234 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/dargs": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/dargs/-/dargs-7.0.0.tgz", - "integrity": "sha512-2iy1EkLdlBzQGvbweYRFxmFath8+K7+AKB0TlhHWkNuH+TmovaMH/Wp7V7R4u7f4SnX3OgLsU9t1NI9ioDnUpg==", + "node_modules/flat": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", "dev": true, - "engines": { - "node": ">=8" + "bin": { + "flat": "cli.js" } }, - "node_modules/dataloader": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/dataloader/-/dataloader-1.4.0.tgz", - "integrity": "sha512-68s5jYdlvasItOJnCuI2Q9s4q98g0pCyL3HrcKJu8KNugUl8ahgmZYg38ysLTgQjjXX3H8CJLkAvWrclWfcalw==" - }, - "node_modules/dateformat": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz", - "integrity": "sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==", + "node_modules/flat-cache": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", "dev": true, + "dependencies": { + "flatted": "^3.1.0", + "rimraf": "^3.0.2" + }, "engines": { - "node": "*" + "node": "^10.12.0 || >=12.0.0" } }, - "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "node_modules/flatted": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", + "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", + "dev": true + }, + "node_modules/follow-redirects": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", + "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", "dev": true, - "dependencies": { - "ms": "2.1.2" - }, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], "engines": { - "node": ">=6.0" + "node": ">=4.0" }, "peerDependenciesMeta": { - "supports-color": { + "debug": { "optional": true } } }, - "node_modules/debuglog": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/debuglog/-/debuglog-1.0.1.tgz", - "integrity": "sha512-syBZ+rnAK3EgMsH2aYEOLUW7mZSY9Gb+0wUMCFsZvcmiz+HigA0LOcq/HoQqVuGG+EKykunc7QG2bzrponfaSw==", + "node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", "dev": true, + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, "engines": { - "node": "*" + "node": ">= 6" } }, - "node_modules/decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", + "node_modules/form-data-encoder": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-2.1.3.tgz", + "integrity": "sha512-KqU0nnPMgIJcCOFTNJFEA8epcseEaoox4XZffTgy8jlI6pL/5EFyR54NRG7CnCJN0biY7q52DO3MH6/sJ/TKlQ==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">= 14.17" } }, - "node_modules/decamelize-keys": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.0.tgz", - "integrity": "sha512-ocLWuYzRPoS9bfiSdDd3cxvrzovVMZnRDVEzAs+hWIVXGDbHxWMECij2OBuyB/An0FFW/nLuq6Kv1i/YC5Qfzg==", + "node_modules/fp-and-or": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/fp-and-or/-/fp-and-or-0.1.3.tgz", + "integrity": "sha512-wJaE62fLaB3jCYvY2ZHjZvmKK2iiLiiehX38rz5QZxtdN8fVPJDeZUiVvJrHStdTc+23LHlyZuSEKgFc0pxi2g==", "dev": true, - "dependencies": { - "decamelize": "^1.1.0", - "map-obj": "^1.0.0" - }, "engines": { - "node": ">=0.10.0" + "node": ">=10" } }, - "node_modules/decamelize-keys/node_modules/map-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", - "integrity": "sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } + "node_modules/fs-constants": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", + "dev": true }, - "node_modules/decompress-response": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", - "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", + "node_modules/fs-extra": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", "dev": true, "dependencies": { - "mimic-response": "^3.1.0" + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" }, "engines": { "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/decompress-response/node_modules/mimic-response": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", - "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", + "node_modules/fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", "dev": true, - "engines": { - "node": ">=10" + "dependencies": { + "minipass": "^3.0.0" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "engines": { + "node": ">= 8" } }, - "node_modules/dedent": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", - "integrity": "sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==", + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "dev": true }, - "node_modules/deep-extend": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", - "dev": true, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/deep-is": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, - "node_modules/defaults": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", - "integrity": "sha512-s82itHOnYrN0Ib8r+z7laQz3sdE+4FP3d9Q7VLO7U+KRT+CR0GsWuyHxzdAY82I7cXv0G/twrqomTJLOssO5HA==", + "node_modules/gauge": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-4.0.4.tgz", + "integrity": "sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg==", "dev": true, "dependencies": { - "clone": "^1.0.2" + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.3", + "console-control-strings": "^1.1.0", + "has-unicode": "^2.0.1", + "signal-exit": "^3.0.7", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.5" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/defer-to-connect": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz", - "integrity": "sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==", + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true, "engines": { - "node": ">=10" + "node": "6.* || 8.* || >= 10.*" } }, - "node_modules/define-lazy-prop": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz", - "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==", + "node_modules/get-pkg-repo": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/get-pkg-repo/-/get-pkg-repo-4.2.1.tgz", + "integrity": "sha512-2+QbHjFRfGB74v/pYWjd5OhU3TDIC2Gv/YKUTk/tCvAz0pkn/Mz6P3uByuBimLOcPvN2jYdScl3xGFSrx0jEcA==", "dev": true, + "dependencies": { + "@hutson/parse-repository-url": "^3.0.0", + "hosted-git-info": "^4.0.0", + "through2": "^2.0.0", + "yargs": "^16.2.0" + }, + "bin": { + "get-pkg-repo": "src/cli.js" + }, "engines": { - "node": ">=8" + "node": ">=6.9.0" } }, - "node_modules/delegates": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==", - "dev": true - }, - "node_modules/depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==", - "dev": true, - "engines": { - "node": ">= 0.6" + "node_modules/get-pkg-repo/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" } }, - "node_modules/deprecation": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", - "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==", + "node_modules/get-pkg-repo/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true }, - "node_modules/detect-indent": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-6.1.0.tgz", - "integrity": "sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA==", + "node_modules/get-pkg-repo/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, - "engines": { - "node": ">=8" + "dependencies": { + "safe-buffer": "~5.1.0" } }, - "node_modules/dezalgo": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/dezalgo/-/dezalgo-1.0.4.tgz", - "integrity": "sha512-rXSP0bf+5n0Qonsb+SVVfNfIsimO4HEtmnIpPHY8Q1UCzKlQrDMfdobr8nJOOsRgWCyMRqeSBQzmWUMq7zvVig==", + "node_modules/get-pkg-repo/node_modules/through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", "dev": true, "dependencies": { - "asap": "^2.0.0", - "wrappy": "1" + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" } }, - "node_modules/dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "node_modules/get-port": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/get-port/-/get-port-5.1.1.tgz", + "integrity": "sha512-g/Q1aTSDOxFpchXC4i8ZWvxA1lnPqx/JHqcpIw0/LX9T8x/GBbi6YnlN5nhaKIFkT8oFsscUKgDJYxfwfS6QsQ==", "dev": true, - "dependencies": { - "path-type": "^4.0.0" - }, "engines": { "node": ">=8" - } - }, - "node_modules/doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "dependencies": { - "esutils": "^2.0.2" }, - "engines": { - "node": ">=6.0.0" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/dot-prop": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz", - "integrity": "sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==", + "node_modules/get-stdin": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-8.0.0.tgz", + "integrity": "sha512-sY22aA6xchAzprjyqmSEQv4UbAAzRN0L2dQB0NlN5acTTK9Don6nhoc3eAbUnpZiCANAMfd/+40kVdKfFygohg==", "dev": true, - "dependencies": { - "is-obj": "^2.0.0" - }, "engines": { "node": ">=10" }, @@ -3658,357 +3665,371 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/dotenv": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-10.0.0.tgz", - "integrity": "sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==", + "node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", "dev": true, "engines": { "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/duplexer": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz", - "integrity": "sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==", - "dev": true - }, - "node_modules/eastasianwidth": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", - "dev": true - }, - "node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "node_modules/encoding": { - "version": "0.1.13", - "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", - "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", + "node_modules/git-raw-commits": { + "version": "2.0.11", + "resolved": "https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-2.0.11.tgz", + "integrity": "sha512-VnctFhw+xfj8Va1xtfEqCUD2XDrbAPSJx+hSrE5K7fGdjZruW7XV+QOrN7LF/RJyvspRiD2I0asWsxFp0ya26A==", "dev": true, - "optional": true, "dependencies": { - "iconv-lite": "^0.6.2" + "dargs": "^7.0.0", + "lodash": "^4.17.15", + "meow": "^8.0.0", + "split2": "^3.0.0", + "through2": "^4.0.0" + }, + "bin": { + "git-raw-commits": "cli.js" + }, + "engines": { + "node": ">=10" } }, - "node_modules/encoding/node_modules/iconv-lite": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", - "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "node_modules/git-remote-origin-url": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/git-remote-origin-url/-/git-remote-origin-url-2.0.0.tgz", + "integrity": "sha512-eU+GGrZgccNJcsDH5LkXR3PB9M958hxc7sbA8DFJjrv9j4L2P/eZfKhM+QD6wyzpiv+b1BpK0XrYCxkovtjSLw==", "dev": true, - "optional": true, "dependencies": { - "safer-buffer": ">= 2.1.2 < 3.0.0" + "gitconfiglocal": "^1.0.0", + "pify": "^2.3.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=4" } }, - "node_modules/end-of-stream": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "node_modules/git-remote-origin-url/node_modules/pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", "dev": true, - "dependencies": { - "once": "^1.4.0" + "engines": { + "node": ">=0.10.0" } }, - "node_modules/enquirer": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", - "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "node_modules/git-semver-tags": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/git-semver-tags/-/git-semver-tags-4.1.1.tgz", + "integrity": "sha512-OWyMt5zBe7xFs8vglMmhM9lRQzCWL3WjHtxNNfJTMngGym7pC1kh8sP6jevfydJ6LP3ZvGxfb6ABYgPUM0mtsA==", "dev": true, "dependencies": { - "ansi-colors": "^4.1.1" + "meow": "^8.0.0", + "semver": "^6.0.0" + }, + "bin": { + "git-semver-tags": "cli.js" }, "engines": { - "node": ">=8.6" + "node": ">=10" } }, - "node_modules/env-paths": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", - "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", + "node_modules/git-semver-tags/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true, - "engines": { - "node": ">=6" + "bin": { + "semver": "bin/semver.js" } }, - "node_modules/envinfo": { - "version": "7.8.1", - "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.8.1.tgz", - "integrity": "sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw==", + "node_modules/git-up": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/git-up/-/git-up-7.0.0.tgz", + "integrity": "sha512-ONdIrbBCFusq1Oy0sC71F5azx8bVkvtZtMJAsv+a6lz5YAmbNnLD6HAB4gptHZVLPR8S2/kVN6Gab7lryq5+lQ==", "dev": true, - "bin": { - "envinfo": "dist/cli.js" - }, - "engines": { - "node": ">=4" + "dependencies": { + "is-ssh": "^1.4.0", + "parse-url": "^8.1.0" } }, - "node_modules/err-code": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz", - "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==", - "dev": true - }, - "node_modules/error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "node_modules/git-url-parse": { + "version": "13.1.0", + "resolved": "https://registry.npmjs.org/git-url-parse/-/git-url-parse-13.1.0.tgz", + "integrity": "sha512-5FvPJP/70WkIprlUZ33bm4UAaFdjcLkJLpWft1BeZKqwR0uhhNGoKwlUaPtVb4LxCSQ++erHapRak9kWGj+FCA==", "dev": true, "dependencies": { - "is-arrayish": "^0.2.1" + "git-up": "^7.0.0" } }, - "node_modules/escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "node_modules/gitconfiglocal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/gitconfiglocal/-/gitconfiglocal-1.0.0.tgz", + "integrity": "sha512-spLUXeTAVHxDtKsJc8FkFVgFtMdEN9qPGpL23VfSHx4fP4+Ds097IXLvymbnDH8FnmxX5Nr9bPw3A+AQ6mWEaQ==", "dev": true, - "engines": { - "node": ">=6" + "dependencies": { + "ini": "^1.3.2" } }, - "node_modules/escape-goat": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-goat/-/escape-goat-4.0.0.tgz", - "integrity": "sha512-2Sd4ShcWxbx6OY1IHyla/CVNwvg7XwZVoXZHcSu9w9SReNP1EzzD5T8NWKIR38fIqEns9kDWKUQTXXAmlDrdPg==", + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, "engines": { - "node": ">=12" + "node": "*" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, - "engines": { - "node": ">=10" + "dependencies": { + "is-glob": "^4.0.3" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "engines": { + "node": ">=10.13.0" } }, - "node_modules/eslint": { - "version": "8.21.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.21.0.tgz", - "integrity": "sha512-/XJ1+Qurf1T9G2M5IHrsjp+xrGT73RZf23xA1z5wB1ZzzEAWSZKvRwhWxTFp1rvkvCfwcvAUNAP31bhKTTGfDA==", + "node_modules/global-dirs": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.0.tgz", + "integrity": "sha512-v8ho2DS5RiCjftj1nD9NmnfaOzTdud7RRnVd9kFNOjqZbISlx5DQ+OrTkywgd0dIt7oFCvKetZSHoHcP3sDdiA==", "dev": true, "dependencies": { - "@eslint/eslintrc": "^1.3.0", - "@humanwhocodes/config-array": "^0.10.4", - "@humanwhocodes/gitignore-to-minimatch": "^1.0.2", - "ajv": "^6.10.0", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", - "debug": "^4.3.2", - "doctrine": "^3.0.0", - "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.1.1", - "eslint-utils": "^3.0.0", - "eslint-visitor-keys": "^3.3.0", - "espree": "^9.3.3", - "esquery": "^1.4.0", - "esutils": "^2.0.2", - "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", - "find-up": "^5.0.0", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^6.0.1", - "globals": "^13.15.0", - "globby": "^11.1.0", - "grapheme-splitter": "^1.0.4", - "ignore": "^5.2.0", - "import-fresh": "^3.0.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "js-yaml": "^4.1.0", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", - "lodash.merge": "^4.6.2", - "minimatch": "^3.1.2", - "natural-compare": "^1.4.0", - "optionator": "^0.9.1", - "regexpp": "^3.2.0", - "strip-ansi": "^6.0.1", - "strip-json-comments": "^3.1.0", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" - }, - "bin": { - "eslint": "bin/eslint.js" + "ini": "2.0.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": ">=10" }, "funding": { - "url": "https://opencollective.com/eslint" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/eslint-config-prettier": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.5.0.tgz", - "integrity": "sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q==", + "node_modules/global-dirs/node_modules/ini": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz", + "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==", "dev": true, - "bin": { - "eslint-config-prettier": "bin/cli.js" - }, - "peerDependencies": { - "eslint": ">=7.0.0" + "engines": { + "node": ">=10" } }, - "node_modules/eslint-plugin-simple-import-sort": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-simple-import-sort/-/eslint-plugin-simple-import-sort-7.0.0.tgz", - "integrity": "sha512-U3vEDB5zhYPNfxT5TYR7u01dboFZp+HNpnGhkDB2g/2E4wZ/g1Q9Ton8UwCLfRV9yAKyYqDh62oHOamvkFxsvw==", + "node_modules/globals": { + "version": "13.20.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", + "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", "dev": true, - "peerDependencies": { - "eslint": ">=5.0.0" + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", "dev": true, "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" }, "engines": { - "node": ">=8.0.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/eslint-utils": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", - "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "node_modules/got": { + "version": "12.5.2", + "resolved": "https://registry.npmjs.org/got/-/got-12.5.2.tgz", + "integrity": "sha512-guHGMSEcsA5m1oPRweXUJnug0vuvlkX9wx5hzOka+ZBrBUOJHU0Z1JcNu3QE5IPGnA5aXUsQHdWOD4eJg9/v3A==", "dev": true, "dependencies": { - "eslint-visitor-keys": "^2.0.0" + "@sindresorhus/is": "^5.2.0", + "@szmarczak/http-timer": "^5.0.1", + "cacheable-lookup": "^7.0.0", + "cacheable-request": "^10.2.1", + "decompress-response": "^6.0.0", + "form-data-encoder": "^2.1.2", + "get-stream": "^6.0.1", + "http2-wrapper": "^2.1.10", + "lowercase-keys": "^3.0.0", + "p-cancelable": "^3.0.0", + "responselike": "^3.0.0" }, "engines": { - "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" + "node": ">=14.16" }, "funding": { - "url": "https://github.com/sponsors/mysticatea" - }, - "peerDependencies": { - "eslint": ">=5" + "url": "https://github.com/sindresorhus/got?sponsor=1" } }, - "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "node_modules/graceful-fs": { + "version": "4.2.10", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", + "dev": true + }, + "node_modules/grapheme-splitter": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", + "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", + "dev": true + }, + "node_modules/handlebars": { + "version": "4.7.7", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", + "integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==", "dev": true, + "dependencies": { + "minimist": "^1.2.5", + "neo-async": "^2.6.0", + "source-map": "^0.6.1", + "wordwrap": "^1.0.0" + }, + "bin": { + "handlebars": "bin/handlebars" + }, "engines": { - "node": ">=10" + "node": ">=0.4.7" + }, + "optionalDependencies": { + "uglify-js": "^3.1.4" } }, - "node_modules/eslint-visitor-keys": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", - "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", + "node_modules/hard-rejection": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", + "integrity": "sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==", "dev": true, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": ">=6" } }, - "node_modules/eslint/node_modules/eslint-scope": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", - "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", "dev": true, "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" + "function-bind": "^1.1.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": ">= 0.4.0" } }, - "node_modules/eslint/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "engines": { - "node": ">=4.0" + "node": ">=8" } }, - "node_modules/eslint/node_modules/find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "node_modules/has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", + "dev": true + }, + "node_modules/has-yarn": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-yarn/-/has-yarn-3.0.0.tgz", + "integrity": "sha512-IrsVwUHhEULx3R8f/aA8AHuEzAorplsab/v8HBzEiIukwq5i/EC+xmOW+HfP1OaDP+2JkgT1yILHN2O3UFIbcA==", "dev": true, - "dependencies": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - }, "engines": { - "node": ">=10" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/eslint/node_modules/glob-parent": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "node_modules/hosted-git-info": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", + "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==", "dev": true, "dependencies": { - "is-glob": "^4.0.3" + "lru-cache": "^6.0.0" }, "engines": { - "node": ">=10.13.0" + "node": ">=10" } }, - "node_modules/eslint/node_modules/locate-path": { + "node_modules/hosted-git-info/node_modules/lru-cache": { "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, "dependencies": { - "p-locate": "^5.0.0" + "yallist": "^4.0.0" }, "engines": { "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/eslint/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "node_modules/http-cache-semantics": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", + "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==", + "dev": true + }, + "node_modules/http-proxy-agent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", + "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", "dev": true, "dependencies": { - "brace-expansion": "^1.1.7" + "@tootallnate/once": "2", + "agent-base": "6", + "debug": "4" }, "engines": { - "node": "*" + "node": ">= 6" } }, - "node_modules/eslint/node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "node_modules/http2-wrapper": { + "version": "2.1.11", + "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.1.11.tgz", + "integrity": "sha512-aNAk5JzLturWEUiuhAN73Jcbq96R7rTitAoXV54FYMatvihnpD2+6PUgU4ce3D/m5VDbw+F5CsyKSF176ptitQ==", "dev": true, "dependencies": { - "yocto-queue": "^0.1.0" + "quick-lru": "^5.1.1", + "resolve-alpn": "^1.2.0" }, + "engines": { + "node": ">=10.19.0" + } + }, + "node_modules/http2-wrapper/node_modules/quick-lru": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", + "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==", + "dev": true, "engines": { "node": ">=10" }, @@ -4016,203 +4037,147 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/eslint/node_modules/p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", "dev": true, "dependencies": { - "p-limit": "^3.0.2" + "agent-base": "6", + "debug": "4" }, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">= 6" } }, - "node_modules/espree": { - "version": "9.3.3", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.3.tgz", - "integrity": "sha512-ORs1Rt/uQTqUKjDdGCyrtYxbazf5umATSf/K4qxjmZHORR6HJk+2s/2Pqe+Kk49HHINC/xNIrGfgh8sZcll0ng==", + "node_modules/human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", "dev": true, - "dependencies": { - "acorn": "^8.8.0", - "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.3.0" - }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" + "node": ">=10.17.0" } }, - "node_modules/esquery": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", - "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "node_modules/humanize-ms": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", + "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==", "dev": true, "dependencies": { - "estraverse": "^5.1.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/esquery/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "engines": { - "node": ">=4.0" + "ms": "^2.0.0" } }, - "node_modules/esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "dev": true, "dependencies": { - "estraverse": "^5.2.0" + "safer-buffer": ">= 2.1.2 < 3" }, "engines": { - "node": ">=4.0" + "node": ">=0.10.0" } }, - "node_modules/esrecurse/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", "dev": true, - "engines": { - "node": ">=4.0" - } + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] }, - "node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "node_modules/ignore": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", + "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", "dev": true, "engines": { - "node": ">=4.0" + "node": ">= 4" } }, - "node_modules/esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "node_modules/ignore-walk": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-5.0.1.tgz", + "integrity": "sha512-yemi4pMf51WKT7khInJqAvsIGzoqYXblnsz0ql8tM+yi1EKYTY1evX4NAbJrLL/Aanr2HyZeluqU+Oi7MGHokw==", "dev": true, + "dependencies": { + "minimatch": "^5.0.1" + }, "engines": { - "node": ">=0.10.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/eventemitter3": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", - "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", - "dev": true - }, - "node_modules/execa": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", - "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "node_modules/ignore-walk/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^6.0.0", - "human-signals": "^2.1.0", - "is-stream": "^2.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.1", - "onetime": "^5.1.2", - "signal-exit": "^3.0.3", - "strip-final-newline": "^2.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" + "balanced-match": "^1.0.0" } }, - "node_modules/expect-more": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/expect-more/-/expect-more-1.1.0.tgz", - "integrity": "sha512-/iIJuRtKgUJwCKEHV5XtTbyrR5JEztzqHDEub6X+WLAVGEPfkEdvsTE1Y0r9vNQqhgP6Kbp9A9w6OEYUqJwLwQ==", - "dev": true - }, - "node_modules/external-editor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", - "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", + "node_modules/ignore-walk/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", "dev": true, "dependencies": { - "chardet": "^0.7.0", - "iconv-lite": "^0.4.24", - "tmp": "^0.0.33" + "brace-expansion": "^2.0.1" }, "engines": { - "node": ">=4" + "node": ">=10" } }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true - }, - "node_modules/fast-glob": { - "version": "3.2.10", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.10.tgz", - "integrity": "sha512-s9nFhFnvR63wls6/kM88kQqDhMu0AfdjqouE2l5GVQPbqLgyFjjU5ry/r2yKsJxpb9Py1EYNqieFrmMaX4v++A==", + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", "dev": true, "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" }, "engines": { - "node": ">=8.6.0" + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true - }, - "node_modules/fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", - "dev": true - }, - "node_modules/fast-memoize": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/fast-memoize/-/fast-memoize-2.5.2.tgz", - "integrity": "sha512-Ue0LwpDYErFbmNnZSF0UH6eImUwDmogUO1jyE+JbN2gsQz/jICm1Ve7t9QT0rNSsfJt+Hs4/S3GnsDVjL4HVrw==", - "dev": true - }, - "node_modules/fastq": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", - "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", + "node_modules/import-lazy": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-4.0.0.tgz", + "integrity": "sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw==", "dev": true, - "dependencies": { - "reusify": "^1.0.4" + "engines": { + "node": ">=8" } }, - "node_modules/figures": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", - "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", + "node_modules/import-local": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz", + "integrity": "sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==", "dev": true, "dependencies": { - "escape-string-regexp": "^1.0.5" + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" + }, + "bin": { + "import-local-fixture": "fixtures/cli.js" }, "engines": { "node": ">=8" @@ -4221,277 +4186,332 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/figures/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", "dev": true, "engines": { - "node": ">=0.8.0" + "node": ">=0.8.19" } }, - "node_modules/file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", "dev": true, - "dependencies": { - "flat-cache": "^3.0.4" - }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": ">=8" } }, - "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "node_modules/infer-owner": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", + "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==", + "dev": true + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", "dev": true, "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" + "once": "^1.3.0", + "wrappy": "1" } }, - "node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true + }, + "node_modules/init-package-json": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/init-package-json/-/init-package-json-3.0.2.tgz", + "integrity": "sha512-YhlQPEjNFqlGdzrBfDNRLhvoSgX7iQRgSxgsNknRQ9ITXFT7UMfVMWhBTOh2Y+25lRnGrv5Xz8yZwQ3ACR6T3A==", "dev": true, "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" + "npm-package-arg": "^9.0.1", + "promzard": "^0.3.0", + "read": "^1.0.7", + "read-package-json": "^5.0.0", + "semver": "^7.3.5", + "validate-npm-package-license": "^3.0.4", + "validate-npm-package-name": "^4.0.0" }, "engines": { - "node": ">=8" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/flat": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", - "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "node_modules/init-package-json/node_modules/hosted-git-info": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.2.1.tgz", + "integrity": "sha512-xIcQYMnhcx2Nr4JTjsFmwwnr9vldugPy9uVm0o87bjqqWMv9GaqsTeT+i99wTl0mk1uLxJtHxLb8kymqTENQsw==", "dev": true, - "bin": { - "flat": "cli.js" + "dependencies": { + "lru-cache": "^7.5.1" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "node_modules/init-package-json/node_modules/npm-package-arg": { + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-9.1.2.tgz", + "integrity": "sha512-pzd9rLEx4TfNJkovvlBSLGhq31gGu2QDexFPWT19yCDh0JgnRhlBLNo5759N0AJmBk+kQ9Y/hXoLnlgFD+ukmg==", "dev": true, "dependencies": { - "flatted": "^3.1.0", - "rimraf": "^3.0.2" + "hosted-git-info": "^5.0.0", + "proc-log": "^2.0.1", + "semver": "^7.3.5", + "validate-npm-package-name": "^4.0.0" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/flatted": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.4.tgz", - "integrity": "sha512-8/sOawo8tJ4QOBX8YlQBMxL8+RLZfxMQOif9o0KUKTNTjMYElWPE0r/m5VNFxTRd0NSw8qSy8dajrwX4RYI1Hw==", + "node_modules/inquirer": { + "version": "8.2.5", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-8.2.5.tgz", + "integrity": "sha512-QAgPDQMEgrDssk1XiwwHoOGYF9BAbUcc1+j+FhEvaOt8/cKRqyLn0U5qA6F74fGhTMGxf92pOvPBeh29jQJDTQ==", + "dev": true, + "dependencies": { + "ansi-escapes": "^4.2.1", + "chalk": "^4.1.1", + "cli-cursor": "^3.1.0", + "cli-width": "^3.0.0", + "external-editor": "^3.0.3", + "figures": "^3.0.0", + "lodash": "^4.17.21", + "mute-stream": "0.0.8", + "ora": "^5.4.1", + "run-async": "^2.4.0", + "rxjs": "^7.5.5", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0", + "through": "^2.3.6", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/ip": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.0.tgz", + "integrity": "sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==", "dev": true }, - "node_modules/form-data-encoder": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-2.0.1.tgz", - "integrity": "sha512-Oy+P9w5mnO4TWXVgUiQvggNKPI9/ummcSt5usuIV6HkaLKigwzPpoenhEqmGmx3zHqm6ZLJ+CR/99N8JLinaEw==", + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true + }, + "node_modules/is-ci": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", + "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", + "dev": true, + "dependencies": { + "ci-info": "^2.0.0" + }, + "bin": { + "is-ci": "bin.js" + } + }, + "node_modules/is-core-module": { + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz", + "integrity": "sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==", + "dev": true, + "dependencies": { + "has": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-docker": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", + "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", "dev": true, + "bin": { + "is-docker": "cli.js" + }, "engines": { - "node": ">= 14.17" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/fp-and-or": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/fp-and-or/-/fp-and-or-0.1.3.tgz", - "integrity": "sha512-wJaE62fLaB3jCYvY2ZHjZvmKK2iiLiiehX38rz5QZxtdN8fVPJDeZUiVvJrHStdTc+23LHlyZuSEKgFc0pxi2g==", + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "dev": true, "engines": { - "node": ">=10" + "node": ">=0.10.0" } }, - "node_modules/fs-constants": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", - "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", - "dev": true + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } }, - "node_modules/fs-extra": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", - "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, "dependencies": { - "at-least-node": "^1.0.0", - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" + "is-extglob": "^2.1.1" }, "engines": { - "node": ">=10" + "node": ">=0.10.0" } }, - "node_modules/fs-minipass": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", - "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "node_modules/is-installed-globally": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.4.0.tgz", + "integrity": "sha512-iwGqO3J21aaSkC7jWnHP/difazwS7SFeIqxv6wEtLU8Y5KlzFTjyqcSIT0d8s4+dDhKytsk9PJZ2BkS5eZwQRQ==", "dev": true, "dependencies": { - "minipass": "^3.0.0" + "global-dirs": "^3.0.0", + "is-path-inside": "^3.0.2" }, "engines": { - "node": ">= 8" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/fs.realpath": { + "node_modules/is-interactive": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, - "node_modules/fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", + "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==", "dev": true, - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + "node": ">=8" } }, - "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true - }, - "node_modules/functional-red-black-tree": { + "node_modules/is-lambda": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "resolved": "https://registry.npmjs.org/is-lambda/-/is-lambda-1.0.1.tgz", + "integrity": "sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==", "dev": true }, - "node_modules/gauge": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-4.0.4.tgz", - "integrity": "sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg==", + "node_modules/is-npm": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-6.0.0.tgz", + "integrity": "sha512-JEjxbSmtPSt1c8XTkVrlujcXdKV1/tvuQ7GwKcAlyiVLeYFQ2VHat8xfrDJsIkhCdF/tZ7CiIR3sy141c6+gPQ==", "dev": true, - "dependencies": { - "aproba": "^1.0.3 || ^2.0.0", - "color-support": "^1.1.3", - "console-control-strings": "^1.1.0", - "has-unicode": "^2.0.1", - "signal-exit": "^3.0.7", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1", - "wide-align": "^1.1.5" - }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true, "engines": { - "node": "6.* || 8.* || >= 10.*" + "node": ">=0.12.0" } }, - "node_modules/get-pkg-repo": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/get-pkg-repo/-/get-pkg-repo-4.2.1.tgz", - "integrity": "sha512-2+QbHjFRfGB74v/pYWjd5OhU3TDIC2Gv/YKUTk/tCvAz0pkn/Mz6P3uByuBimLOcPvN2jYdScl3xGFSrx0jEcA==", + "node_modules/is-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", + "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", "dev": true, - "dependencies": { - "@hutson/parse-repository-url": "^3.0.0", - "hosted-git-info": "^4.0.0", - "through2": "^2.0.0", - "yargs": "^16.2.0" - }, - "bin": { - "get-pkg-repo": "src/cli.js" - }, "engines": { - "node": ">=6.9.0" + "node": ">=8" } }, - "node_modules/get-pkg-repo/node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" + "engines": { + "node": ">=8" } }, - "node_modules/get-pkg-repo/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true + "node_modules/is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, - "node_modules/get-pkg-repo/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "node_modules/is-plain-object": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", + "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" + "engines": { + "node": ">=0.10.0" } }, - "node_modules/get-pkg-repo/node_modules/through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "node_modules/is-ssh": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/is-ssh/-/is-ssh-1.4.0.tgz", + "integrity": "sha512-x7+VxdxOdlV3CYpjvRLBv5Lo9OJerlYanjwFrPR9fuGPjCiNiCzFgAWpiLAohSbsnH4ZAys3SBh+hq5rJosxUQ==", "dev": true, "dependencies": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" + "protocols": "^2.0.1" } }, - "node_modules/get-port": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/get-port/-/get-port-5.1.1.tgz", - "integrity": "sha512-g/Q1aTSDOxFpchXC4i8ZWvxA1lnPqx/JHqcpIw0/LX9T8x/GBbi6YnlN5nhaKIFkT8oFsscUKgDJYxfwfS6QsQ==", + "node_modules/is-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", + "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", "dev": true, "engines": { "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/get-stdin": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-8.0.0.tgz", - "integrity": "sha512-sY22aA6xchAzprjyqmSEQv4UbAAzRN0L2dQB0NlN5acTTK9Don6nhoc3eAbUnpZiCANAMfd/+40kVdKfFygohg==", + "node_modules/is-text-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-text-path/-/is-text-path-1.0.1.tgz", + "integrity": "sha512-xFuJpne9oFz5qDaodwmmG08e3CawH/2ZV8Qqza1Ko7Sk8POWbkRdwIoAWVhqvq0XeUzANEhKo2n0IXUGBm7A/w==", "dev": true, - "engines": { - "node": ">=10" + "dependencies": { + "text-extensions": "^1.0.0" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "engines": { + "node": ">=0.10.0" } }, - "node_modules/get-stream": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", - "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "node_modules/is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", + "dev": true + }, + "node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", "dev": true, "engines": { "node": ">=10" @@ -4500,509 +4520,673 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/git-raw-commits": { - "version": "2.0.11", - "resolved": "https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-2.0.11.tgz", - "integrity": "sha512-VnctFhw+xfj8Va1xtfEqCUD2XDrbAPSJx+hSrE5K7fGdjZruW7XV+QOrN7LF/RJyvspRiD2I0asWsxFp0ya26A==", + "node_modules/is-wsl": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", + "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", "dev": true, "dependencies": { - "dargs": "^7.0.0", - "lodash": "^4.17.15", - "meow": "^8.0.0", - "split2": "^3.0.0", - "through2": "^4.0.0" - }, - "bin": { - "git-raw-commits": "cli.js" + "is-docker": "^2.0.0" }, "engines": { - "node": ">=10" + "node": ">=8" } }, - "node_modules/git-remote-origin-url": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/git-remote-origin-url/-/git-remote-origin-url-2.0.0.tgz", - "integrity": "sha512-eU+GGrZgccNJcsDH5LkXR3PB9M958hxc7sbA8DFJjrv9j4L2P/eZfKhM+QD6wyzpiv+b1BpK0XrYCxkovtjSLw==", + "node_modules/is-yarn-global": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/is-yarn-global/-/is-yarn-global-0.4.0.tgz", + "integrity": "sha512-HneQBCrXGBy15QnaDfcn6OLoU8AQPAa0Qn0IeJR/QCo4E8dNZaGGwxpCwWyEBQC5QvFonP8d6t60iGpAHVAfNA==", "dev": true, - "dependencies": { - "gitconfiglocal": "^1.0.0", - "pify": "^2.3.0" - }, "engines": { - "node": ">=4" + "node": ">=12" } }, - "node_modules/git-remote-origin-url/node_modules/pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", + "node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "dev": true + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "node_modules/isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", "dev": true, "engines": { "node": ">=0.10.0" } }, - "node_modules/git-semver-tags": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/git-semver-tags/-/git-semver-tags-4.1.1.tgz", - "integrity": "sha512-OWyMt5zBe7xFs8vglMmhM9lRQzCWL3WjHtxNNfJTMngGym7pC1kh8sP6jevfydJ6LP3ZvGxfb6ABYgPUM0mtsA==", + "node_modules/jake": { + "version": "10.8.5", + "resolved": "https://registry.npmjs.org/jake/-/jake-10.8.5.tgz", + "integrity": "sha512-sVpxYeuAhWt0OTWITwT98oyV0GsXyMlXCF+3L1SuafBVUIr/uILGRB+NqwkzhgXKvoJpDIpQvqkUALgdmQsQxw==", "dev": true, "dependencies": { - "meow": "^8.0.0", - "semver": "^6.0.0" + "async": "^3.2.3", + "chalk": "^4.0.2", + "filelist": "^1.0.1", + "minimatch": "^3.0.4" }, "bin": { - "git-semver-tags": "cli.js" + "jake": "bin/cli.js" }, "engines": { "node": ">=10" } }, - "node_modules/git-semver-tags/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } + "node_modules/jju": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/jju/-/jju-1.4.0.tgz", + "integrity": "sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA==", + "dev": true }, - "node_modules/git-up": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/git-up/-/git-up-6.0.0.tgz", - "integrity": "sha512-6RUFSNd1c/D0xtGnyWN2sxza2bZtZ/EmI9448n6rCZruFwV/ezeEn2fJP7XnUQGwf0RAtd/mmUCbtH6JPYA2SA==", + "node_modules/js-sdsl": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.1.5.tgz", + "integrity": "sha512-08bOAKweV2NUC1wqTtf3qZlnpOX/R2DU9ikpjOHs0H+ibQv3zpncVQg6um4uYtRtrwIX8M4Nh3ytK4HGlYAq7Q==", + "dev": true + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, "dependencies": { - "is-ssh": "^1.4.0", - "parse-url": "^7.0.2" + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" } }, - "node_modules/git-url-parse": { - "version": "12.0.0", - "resolved": "https://registry.npmjs.org/git-url-parse/-/git-url-parse-12.0.0.tgz", - "integrity": "sha512-I6LMWsxV87vysX1WfsoglXsXg6GjQRKq7+Dgiseo+h0skmp5Hp2rzmcEIRQot9CPA+uzU7x1x7jZdqvTFGnB+Q==", + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true + }, + "node_modules/json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true + }, + "node_modules/json-parse-helpfulerror": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/json-parse-helpfulerror/-/json-parse-helpfulerror-1.0.3.tgz", + "integrity": "sha512-XgP0FGR77+QhUxjXkwOMkC94k3WtqEBfcnjWqhRd82qTat4SWKRE+9kUnynz/shm3I4ea2+qISvTIeGTNU7kJg==", "dev": true, "dependencies": { - "git-up": "^6.0.0" + "jju": "^1.1.0" } }, - "node_modules/gitconfiglocal": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/gitconfiglocal/-/gitconfiglocal-1.0.0.tgz", - "integrity": "sha512-spLUXeTAVHxDtKsJc8FkFVgFtMdEN9qPGpL23VfSHx4fP4+Ds097IXLvymbnDH8FnmxX5Nr9bPw3A+AQ6mWEaQ==", + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true + }, + "node_modules/json-stringify-nice": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/json-stringify-nice/-/json-stringify-nice-1.1.4.tgz", + "integrity": "sha512-5Z5RFW63yxReJ7vANgW6eZFGWaQvnPE3WNmZoOJrSkGju2etKA2L5rrOa1sm877TVTFt57A80BH1bArcmlLfPw==", "dev": true, - "dependencies": { - "ini": "^1.3.2" + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "node_modules/json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", + "dev": true + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "bin": { + "json5": "lib/cli.js" }, "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "node": ">=6" } }, - "node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "node_modules/jsonc-parser": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz", + "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==", + "dev": true + }, + "node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", "dev": true, "dependencies": { - "is-glob": "^4.0.1" + "universalify": "^2.0.0" }, - "engines": { - "node": ">= 6" + "optionalDependencies": { + "graceful-fs": "^4.1.6" } }, - "node_modules/glob/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "node_modules/jsonlines": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsonlines/-/jsonlines-0.1.1.tgz", + "integrity": "sha512-ekDrAGso79Cvf+dtm+mL8OBI2bmAOt3gssYs833De/C9NmIpWDWyUO4zPgB5x2/OhY366dkhgfPMYfwZF7yOZA==", + "dev": true + }, + "node_modules/jsonparse": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", + "integrity": "sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==", + "dev": true, + "engines": [ + "node >= 0.2.0" + ] + }, + "node_modules/JSONStream": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", + "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", "dev": true, "dependencies": { - "brace-expansion": "^1.1.7" + "jsonparse": "^1.2.0", + "through": ">=2.2.7 <3" + }, + "bin": { + "JSONStream": "bin.js" }, "engines": { "node": "*" } }, - "node_modules/global-dirs": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.0.tgz", - "integrity": "sha512-v8ho2DS5RiCjftj1nD9NmnfaOzTdud7RRnVd9kFNOjqZbISlx5DQ+OrTkywgd0dIt7oFCvKetZSHoHcP3sDdiA==", + "node_modules/just-diff": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/just-diff/-/just-diff-5.2.0.tgz", + "integrity": "sha512-6ufhP9SHjb7jibNFrNxyFZ6od3g+An6Ai9mhGRvcYe8UJlH0prseN64M+6ZBBUoKYHZsitDP42gAJ8+eVWr3lw==", + "dev": true + }, + "node_modules/just-diff-apply": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/just-diff-apply/-/just-diff-apply-5.5.0.tgz", + "integrity": "sha512-OYTthRfSh55WOItVqwpefPtNt2VdKsq5AnAK6apdtR6yCH8pr0CmSr710J0Mf+WdQy7K/OzMy7K2MgAfdQURDw==", + "dev": true + }, + "node_modules/keyv": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.2.tgz", + "integrity": "sha512-5MHbFaKn8cNSmVW7BYnijeAVlE4cYA/SVkifVgrh7yotnfhKmjuXpDKjrABLnT0SfHWV21P8ow07OGfRrNDg8g==", "dev": true, "dependencies": { - "ini": "2.0.0" - }, + "json-buffer": "3.0.1" + } + }, + "node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=0.10.0" } }, - "node_modules/global-dirs/node_modules/ini": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz", - "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==", + "node_modules/kleur": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz", + "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==", "dev": true, "engines": { - "node": ">=10" + "node": ">=6" } }, - "node_modules/globals": { - "version": "13.15.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.15.0.tgz", - "integrity": "sha512-bpzcOlgDhMG070Av0Vy5Owklpv1I6+j96GhUI7Rh7IzDCKLzboflLrrfqMu8NquDbiR4EOQk7XzJwqVJxicxog==", + "node_modules/latest-version": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-7.0.0.tgz", + "integrity": "sha512-KvNT4XqAMzdcL6ka6Tl3i2lYeFDgXNCuIX+xNx6ZMVR1dFq+idXd9FLKNMOIx0t9mJ9/HudyX4oZWXZQ0UJHeg==", "dev": true, "dependencies": { - "type-fest": "^0.20.2" + "package-json": "^8.1.0" }, "engines": { - "node": ">=8" + "node": ">=14.16" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "node_modules/lerna": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/lerna/-/lerna-6.5.1.tgz", + "integrity": "sha512-Va1bysubwWdoWZ1ncKcoTGBXNAu/10/TwELb550TTivXmEWjCCdek4eX0BNLTEYKxu3tpV2UEeqVisUiWGn4WA==", "dev": true, "dependencies": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" + "@lerna/child-process": "6.5.1", + "@lerna/create": "6.5.1", + "@npmcli/arborist": "5.3.0", + "@npmcli/run-script": "4.1.7", + "@nrwl/devkit": ">=15.5.2 < 16", + "@octokit/plugin-enterprise-rest": "6.0.1", + "@octokit/rest": "19.0.3", + "byte-size": "7.0.0", + "chalk": "4.1.0", + "clone-deep": "4.0.1", + "cmd-shim": "5.0.0", + "columnify": "1.6.0", + "config-chain": "1.1.12", + "conventional-changelog-angular": "5.0.12", + "conventional-changelog-core": "4.2.4", + "conventional-recommended-bump": "6.1.0", + "cosmiconfig": "7.0.0", + "dedent": "0.7.0", + "dot-prop": "6.0.1", + "envinfo": "^7.7.4", + "execa": "5.0.0", + "fs-extra": "9.1.0", + "get-port": "5.1.1", + "get-stream": "6.0.0", + "git-url-parse": "13.1.0", + "glob-parent": "5.1.2", + "globby": "11.1.0", + "graceful-fs": "4.2.10", + "has-unicode": "2.0.1", + "import-local": "^3.0.2", + "init-package-json": "3.0.2", + "inquirer": "^8.2.4", + "is-ci": "2.0.0", + "is-stream": "2.0.0", + "js-yaml": "^4.1.0", + "libnpmaccess": "6.0.3", + "libnpmpublish": "6.0.4", + "load-json-file": "6.2.0", + "make-dir": "3.1.0", + "minimatch": "3.0.5", + "multimatch": "5.0.0", + "node-fetch": "2.6.7", + "npm-package-arg": "8.1.1", + "npm-packlist": "5.1.1", + "npm-registry-fetch": "13.3.0", + "npmlog": "^6.0.2", + "nx": ">=15.5.2 < 16", + "p-map": "4.0.0", + "p-map-series": "2.1.0", + "p-pipe": "3.1.0", + "p-queue": "6.6.2", + "p-reduce": "2.1.0", + "p-waterfall": "2.1.1", + "pacote": "13.6.1", + "path-exists": "4.0.0", + "pify": "5.0.0", + "read-cmd-shim": "3.0.0", + "read-package-json": "5.0.1", + "resolve-from": "5.0.0", + "rimraf": "^3.0.2", + "semver": "7.3.4", + "signal-exit": "3.0.7", + "slash": "3.0.0", + "ssri": "9.0.1", + "strong-log-transformer": "2.1.0", + "tar": "6.1.11", + "temp-dir": "1.0.0", + "typescript": "^3 || ^4", + "upath": "^2.0.1", + "uuid": "8.3.2", + "validate-npm-package-license": "3.0.4", + "validate-npm-package-name": "4.0.0", + "write-file-atomic": "4.0.1", + "write-pkg": "4.0.0", + "yargs": "16.2.0", + "yargs-parser": "20.2.4" }, - "engines": { - "node": ">=10" + "bin": { + "lerna": "dist/cli.js" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "engines": { + "node": "^14.15.0 || >=16.0.0" } }, - "node_modules/got": { - "version": "12.3.0", - "resolved": "https://registry.npmjs.org/got/-/got-12.3.0.tgz", - "integrity": "sha512-7uK06aluHF0UibYFBX3lFUZ2FG/W0KS4O4EqAIrbWIdbPxIT33r6ZJy7Zy+pdh0CP/ZbF3zBa7Fd9dCn7vGPBg==", + "node_modules/lerna/node_modules/chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", "dev": true, "dependencies": { - "@sindresorhus/is": "^5.2.0", - "@szmarczak/http-timer": "^5.0.1", - "@types/cacheable-request": "^6.0.2", - "@types/responselike": "^1.0.0", - "cacheable-lookup": "^6.0.4", - "cacheable-request": "^7.0.2", - "decompress-response": "^6.0.0", - "form-data-encoder": "^2.0.1", - "get-stream": "^6.0.1", - "http2-wrapper": "^2.1.10", - "lowercase-keys": "^3.0.0", - "p-cancelable": "^3.0.0", - "responselike": "^2.0.0" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, "engines": { - "node": ">=14.16" + "node": ">=10" }, "funding": { - "url": "https://github.com/sindresorhus/got?sponsor=1" + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/graceful-fs": { - "version": "4.2.10", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", - "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", - "dev": true - }, - "node_modules/grapheme-splitter": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", - "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", - "dev": true - }, - "node_modules/handlebars": { - "version": "4.7.7", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", - "integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==", + "node_modules/lerna/node_modules/config-chain": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.12.tgz", + "integrity": "sha512-a1eOIcu8+7lUInge4Rpf/n4Krkf3Dd9lqhljRzII1/Zno/kRtUWnznPO3jOKBmTEktkt3fkxisUcivoj0ebzoA==", "dev": true, "dependencies": { - "minimist": "^1.2.5", - "neo-async": "^2.6.0", - "source-map": "^0.6.1", - "wordwrap": "^1.0.0" - }, - "bin": { - "handlebars": "bin/handlebars" - }, + "ini": "^1.3.4", + "proto-list": "~1.2.1" + } + }, + "node_modules/lerna/node_modules/get-stream": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.0.tgz", + "integrity": "sha512-A1B3Bh1UmL0bidM/YX2NsCOTnGJePL9rO/M+Mw3m9f2gUpfokS0hi5Eah0WSUEWZdZhIZtMjkIYS7mDfOqNHbg==", + "dev": true, "engines": { - "node": ">=0.4.7" + "node": ">=10" }, - "optionalDependencies": { - "uglify-js": "^3.1.4" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/hard-rejection": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", - "integrity": "sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==", + "node_modules/lerna/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, "engines": { - "node": ">=6" + "node": ">= 6" } }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "node_modules/lerna/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, "dependencies": { - "function-bind": "^1.1.1" + "yallist": "^4.0.0" }, "engines": { - "node": ">= 0.4.0" + "node": ">=10" } }, - "node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "node_modules/lerna/node_modules/minimatch": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.5.tgz", + "integrity": "sha512-tUpxzX0VAzJHjLu0xUfFv1gwVp9ba3IOuRAVH2EGuRW8a5emA2FlACLqiT/lDVtS1W+TGNwqz3sWaNyLgDJWuw==", "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, "engines": { - "node": ">=8" + "node": "*" } }, - "node_modules/has-unicode": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", - "dev": true - }, - "node_modules/has-yarn": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-yarn/-/has-yarn-3.0.0.tgz", - "integrity": "sha512-IrsVwUHhEULx3R8f/aA8AHuEzAorplsab/v8HBzEiIukwq5i/EC+xmOW+HfP1OaDP+2JkgT1yILHN2O3UFIbcA==", + "node_modules/lerna/node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=8" } }, - "node_modules/hosted-git-info": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", - "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==", + "node_modules/lerna/node_modules/semver": { + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", + "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" }, + "bin": { + "semver": "bin/semver.js" + }, "engines": { "node": ">=10" } }, - "node_modules/http-cache-semantics": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", - "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==", - "dev": true - }, - "node_modules/http-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", - "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", "dev": true, "dependencies": { - "@tootallnate/once": "2", - "agent-base": "6", - "debug": "4" + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" }, "engines": { - "node": ">= 6" + "node": ">= 0.8.0" } }, - "node_modules/http2-wrapper": { - "version": "2.1.11", - "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.1.11.tgz", - "integrity": "sha512-aNAk5JzLturWEUiuhAN73Jcbq96R7rTitAoXV54FYMatvihnpD2+6PUgU4ce3D/m5VDbw+F5CsyKSF176ptitQ==", + "node_modules/libnpmaccess": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/libnpmaccess/-/libnpmaccess-6.0.3.tgz", + "integrity": "sha512-4tkfUZprwvih2VUZYMozL7EMKgQ5q9VW2NtRyxWtQWlkLTAWHRklcAvBN49CVqEkhUw7vTX2fNgB5LzgUucgYg==", "dev": true, "dependencies": { - "quick-lru": "^5.1.1", - "resolve-alpn": "^1.2.0" + "aproba": "^2.0.0", + "minipass": "^3.1.1", + "npm-package-arg": "^9.0.1", + "npm-registry-fetch": "^13.0.0" }, "engines": { - "node": ">=10.19.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/http2-wrapper/node_modules/quick-lru": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", - "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==", + "node_modules/libnpmaccess/node_modules/hosted-git-info": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.2.1.tgz", + "integrity": "sha512-xIcQYMnhcx2Nr4JTjsFmwwnr9vldugPy9uVm0o87bjqqWMv9GaqsTeT+i99wTl0mk1uLxJtHxLb8kymqTENQsw==", "dev": true, - "engines": { - "node": ">=10" + "dependencies": { + "lru-cache": "^7.5.1" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/https-proxy-agent": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", - "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "node_modules/libnpmaccess/node_modules/npm-package-arg": { + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-9.1.2.tgz", + "integrity": "sha512-pzd9rLEx4TfNJkovvlBSLGhq31gGu2QDexFPWT19yCDh0JgnRhlBLNo5759N0AJmBk+kQ9Y/hXoLnlgFD+ukmg==", "dev": true, "dependencies": { - "agent-base": "6", - "debug": "4" + "hosted-git-info": "^5.0.0", + "proc-log": "^2.0.1", + "semver": "^7.3.5", + "validate-npm-package-name": "^4.0.0" }, "engines": { - "node": ">= 6" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/human-signals": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", - "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "node_modules/libnpmpublish": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/libnpmpublish/-/libnpmpublish-6.0.4.tgz", + "integrity": "sha512-lvAEYW8mB8QblL6Q/PI/wMzKNvIrF7Kpujf/4fGS/32a2i3jzUXi04TNyIBcK6dQJ34IgywfaKGh+Jq4HYPFmg==", "dev": true, + "dependencies": { + "normalize-package-data": "^4.0.0", + "npm-package-arg": "^9.0.1", + "npm-registry-fetch": "^13.0.0", + "semver": "^7.3.7", + "ssri": "^9.0.0" + }, "engines": { - "node": ">=10.17.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/humanize-ms": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", - "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==", + "node_modules/libnpmpublish/node_modules/hosted-git-info": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.2.1.tgz", + "integrity": "sha512-xIcQYMnhcx2Nr4JTjsFmwwnr9vldugPy9uVm0o87bjqqWMv9GaqsTeT+i99wTl0mk1uLxJtHxLb8kymqTENQsw==", "dev": true, "dependencies": { - "ms": "^2.0.0" + "lru-cache": "^7.5.1" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "node_modules/libnpmpublish/node_modules/normalize-package-data": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-4.0.1.tgz", + "integrity": "sha512-EBk5QKKuocMJhB3BILuKhmaPjI8vNRSpIfO9woLC6NyHVkKKdVEdAO1mrT0ZfxNR1lKwCcTkuZfmGIFdizZ8Pg==", "dev": true, "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" + "hosted-git-info": "^5.0.0", + "is-core-module": "^2.8.1", + "semver": "^7.3.5", + "validate-npm-package-license": "^3.0.4" }, "engines": { - "node": ">=0.10.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/ignore": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", - "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", + "node_modules/libnpmpublish/node_modules/npm-package-arg": { + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-9.1.2.tgz", + "integrity": "sha512-pzd9rLEx4TfNJkovvlBSLGhq31gGu2QDexFPWT19yCDh0JgnRhlBLNo5759N0AJmBk+kQ9Y/hXoLnlgFD+ukmg==", "dev": true, + "dependencies": { + "hosted-git-info": "^5.0.0", + "proc-log": "^2.0.1", + "semver": "^7.3.5", + "validate-npm-package-name": "^4.0.0" + }, "engines": { - "node": ">= 4" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/ignore-walk": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-5.0.1.tgz", - "integrity": "sha512-yemi4pMf51WKT7khInJqAvsIGzoqYXblnsz0ql8tM+yi1EKYTY1evX4NAbJrLL/Aanr2HyZeluqU+Oi7MGHokw==", + "node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "dev": true + }, + "node_modules/load-json-file": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-6.2.0.tgz", + "integrity": "sha512-gUD/epcRms75Cw8RT1pUdHugZYM5ce64ucs2GEISABwkRsOQr0q2wm/MV2TKThycIe5e0ytRweW2RZxclogCdQ==", "dev": true, "dependencies": { - "minimatch": "^5.0.1" + "graceful-fs": "^4.1.15", + "parse-json": "^5.0.0", + "strip-bom": "^4.0.0", + "type-fest": "^0.6.0" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": ">=8" } }, - "node_modules/ignore-walk/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "node_modules/load-json-file/node_modules/type-fest": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", + "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" + "engines": { + "node": ">=8" } }, - "node_modules/ignore-walk/node_modules/minimatch": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", - "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, "dependencies": { - "brace-expansion": "^2.0.1" + "p-locate": "^5.0.0" }, "engines": { "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/lodash.ismatch": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz", + "integrity": "sha512-fPMfXjGQEV9Xsq/8MTSgUf255gawYRbjwMyDbcvDhXgV7enSZA0hynz6vMPnpAb5iONEzBHBPsT+0zes5Z301g==", + "dev": true + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, + "node_modules/log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", "dev": true, "dependencies": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" }, "engines": { - "node": ">=6" + "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/import-lazy": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-4.0.0.tgz", - "integrity": "sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw==", + "node_modules/lowercase-keys": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-3.0.0.tgz", + "integrity": "sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==", "dev": true, "engines": { - "node": ">=8" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/import-local": { + "node_modules/lru-cache": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.14.0.tgz", + "integrity": "sha512-EIRtP1GrSJny0dqb50QXRUNBxHJhcpxHC++M5tD7RYbvLLn5KVWKsbyswSSqDuU15UFi3bgTQIY8nhDMeF6aDQ==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/make-dir": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz", - "integrity": "sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", "dev": true, "dependencies": { - "pkg-dir": "^4.2.0", - "resolve-cwd": "^3.0.0" - }, - "bin": { - "import-local-fixture": "fixtures/cli.js" + "semver": "^6.0.0" }, "engines": { "node": ">=8" @@ -5011,187 +5195,161 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", - "dev": true, - "engines": { - "node": ">=0.8.19" - } - }, - "node_modules/indent-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "node_modules/make-dir/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true, - "engines": { - "node": ">=8" + "bin": { + "semver": "bin/semver.js" } }, - "node_modules/infer-owner": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", - "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==", - "dev": true - }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "node_modules/make-fetch-happen": { + "version": "10.2.1", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-10.2.1.tgz", + "integrity": "sha512-NgOPbRiaQM10DYXvN3/hhGVI2M5MtITFryzBGxHM5p4wnFxsVCbxkrBrDsk+EZ5OB4jEOT7AjDxtdF+KVEFT7w==", "dev": true, "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "node_modules/ini": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", - "dev": true - }, - "node_modules/init-package-json": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/init-package-json/-/init-package-json-3.0.2.tgz", - "integrity": "sha512-YhlQPEjNFqlGdzrBfDNRLhvoSgX7iQRgSxgsNknRQ9ITXFT7UMfVMWhBTOh2Y+25lRnGrv5Xz8yZwQ3ACR6T3A==", - "dev": true, - "dependencies": { - "npm-package-arg": "^9.0.1", - "promzard": "^0.3.0", - "read": "^1.0.7", - "read-package-json": "^5.0.0", - "semver": "^7.3.5", - "validate-npm-package-license": "^3.0.4", - "validate-npm-package-name": "^4.0.0" + "agentkeepalive": "^4.2.1", + "cacache": "^16.1.0", + "http-cache-semantics": "^4.1.0", + "http-proxy-agent": "^5.0.0", + "https-proxy-agent": "^5.0.0", + "is-lambda": "^1.0.1", + "lru-cache": "^7.7.1", + "minipass": "^3.1.6", + "minipass-collect": "^1.0.2", + "minipass-fetch": "^2.0.3", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^0.6.3", + "promise-retry": "^2.0.1", + "socks-proxy-agent": "^7.0.0", + "ssri": "^9.0.0" }, "engines": { "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/init-package-json/node_modules/hosted-git-info": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.0.0.tgz", - "integrity": "sha512-rRnjWu0Bxj+nIfUOkz0695C0H6tRrN5iYIzYejb0tDEefe2AekHu/U5Kn9pEie5vsJqpNQU02az7TGSH3qpz4Q==", + "node_modules/map-obj": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.3.0.tgz", + "integrity": "sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==", "dev": true, - "dependencies": { - "lru-cache": "^7.5.1" - }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/init-package-json/node_modules/lru-cache": { - "version": "7.13.2", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.13.2.tgz", - "integrity": "sha512-VJL3nIpA79TodY/ctmZEfhASgqekbT574/c4j3jn4bKXbSCnTTCH/KltZyvL2GlV+tGSMtsWyem8DCX7qKTMBA==", + "node_modules/meow": { + "version": "8.1.2", + "resolved": "https://registry.npmjs.org/meow/-/meow-8.1.2.tgz", + "integrity": "sha512-r85E3NdZ+mpYk1C6RjPFEMSE+s1iZMuHtsHAqY0DT3jZczl0diWUZ8g6oU7h0M9cD2EL+PzaYghhCLzR0ZNn5Q==", "dev": true, + "dependencies": { + "@types/minimist": "^1.2.0", + "camelcase-keys": "^6.2.2", + "decamelize-keys": "^1.1.0", + "hard-rejection": "^2.1.0", + "minimist-options": "4.1.0", + "normalize-package-data": "^3.0.0", + "read-pkg-up": "^7.0.1", + "redent": "^3.0.0", + "trim-newlines": "^3.0.0", + "type-fest": "^0.18.0", + "yargs-parser": "^20.2.3" + }, "engines": { - "node": ">=12" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/init-package-json/node_modules/npm-package-arg": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-9.1.0.tgz", - "integrity": "sha512-4J0GL+u2Nh6OnhvUKXRr2ZMG4lR8qtLp+kv7UiV00Y+nGiSxtttCyIRHCt5L5BNkXQld/RceYItau3MDOoGiBw==", + "node_modules/meow/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, "dependencies": { - "hosted-git-info": "^5.0.0", - "proc-log": "^2.0.1", - "semver": "^7.3.5", - "validate-npm-package-name": "^4.0.0" + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": ">=8" } }, - "node_modules/inquirer": { - "version": "8.2.4", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-8.2.4.tgz", - "integrity": "sha512-nn4F01dxU8VeKfq192IjLsxu0/OmMZ4Lg3xKAns148rCaXP6ntAoEkVYZThWjwON8AlzdZZi6oqnhNbxUG9hVg==", + "node_modules/meow/node_modules/hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "dev": true + }, + "node_modules/meow/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, "dependencies": { - "ansi-escapes": "^4.2.1", - "chalk": "^4.1.1", - "cli-cursor": "^3.1.0", - "cli-width": "^3.0.0", - "external-editor": "^3.0.3", - "figures": "^3.0.0", - "lodash": "^4.17.21", - "mute-stream": "0.0.8", - "ora": "^5.4.1", - "run-async": "^2.4.0", - "rxjs": "^7.5.5", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0", - "through": "^2.3.6", - "wrap-ansi": "^7.0.0" + "p-locate": "^4.1.0" }, "engines": { - "node": ">=12.0.0" + "node": ">=8" } }, - "node_modules/ip": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.0.tgz", - "integrity": "sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==", - "dev": true - }, - "node_modules/is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", - "dev": true - }, - "node_modules/is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "node_modules/meow/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, "dependencies": { - "binary-extensions": "^2.0.0" + "p-try": "^2.0.0" }, "engines": { - "node": ">=8" + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-ci": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", - "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", + "node_modules/meow/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, "dependencies": { - "ci-info": "^2.0.0" + "p-limit": "^2.2.0" }, - "bin": { - "is-ci": "bin.js" + "engines": { + "node": ">=8" } }, - "node_modules/is-core-module": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz", - "integrity": "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==", + "node_modules/meow/node_modules/read-pkg": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", + "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", "dev": true, "dependencies": { - "has": "^1.0.3" + "@types/normalize-package-data": "^2.4.0", + "normalize-package-data": "^2.5.0", + "parse-json": "^5.0.0", + "type-fest": "^0.6.0" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "engines": { + "node": ">=8" } }, - "node_modules/is-docker": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", - "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", + "node_modules/meow/node_modules/read-pkg-up": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", + "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", "dev": true, - "bin": { - "is-docker": "cli.js" + "dependencies": { + "find-up": "^4.1.0", + "read-pkg": "^5.2.0", + "type-fest": "^0.8.1" }, "engines": { "node": ">=8" @@ -5200,45 +5358,50 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "node_modules/meow/node_modules/read-pkg-up/node_modules/type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "node_modules/meow/node_modules/read-pkg/node_modules/normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "dependencies": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "node_modules/meow/node_modules/read-pkg/node_modules/type-fest": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", + "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", "dev": true, "engines": { "node": ">=8" } }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "node_modules/meow/node_modules/semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "dev": true, - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" + "bin": { + "semver": "bin/semver" } }, - "node_modules/is-installed-globally": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.4.0.tgz", - "integrity": "sha512-iwGqO3J21aaSkC7jWnHP/difazwS7SFeIqxv6wEtLU8Y5KlzFTjyqcSIT0d8s4+dDhKytsk9PJZ2BkS5eZwQRQ==", + "node_modules/meow/node_modules/type-fest": { + "version": "0.18.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.18.1.tgz", + "integrity": "sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw==", "dev": true, - "dependencies": { - "global-dirs": "^3.0.0", - "is-path-inside": "^3.0.2" - }, "engines": { "node": ">=10" }, @@ -5246,25 +5409,68 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-interactive": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", - "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==", + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", "dev": true, "engines": { - "node": ">=8" + "node": ">= 8" } }, - "node_modules/is-lambda": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-lambda/-/is-lambda-1.0.1.tgz", - "integrity": "sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==", - "dev": true + "node_modules/micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } }, - "node_modules/is-npm": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-6.0.0.tgz", - "integrity": "sha512-JEjxbSmtPSt1c8XTkVrlujcXdKV1/tvuQ7GwKcAlyiVLeYFQ2VHat8xfrDJsIkhCdF/tZ7CiIR3sy141c6+gPQ==", + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dev": true, + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/mimic-response": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-4.0.0.tgz", + "integrity": "sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg==", "dev": true, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" @@ -5273,331 +5479,369 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "node_modules/min-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", + "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", "dev": true, "engines": { - "node": ">=0.12.0" + "node": ">=4" } }, - "node_modules/is-obj": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", - "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, "engines": { - "node": ">=8" + "node": "*" } }, - "node_modules/is-path-inside": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", - "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "node_modules/minimist": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz", + "integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==", "dev": true, - "engines": { - "node": ">=8" + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-plain-obj": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", - "integrity": "sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==", + "node_modules/minimist-options": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz", + "integrity": "sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==", "dev": true, + "dependencies": { + "arrify": "^1.0.1", + "is-plain-obj": "^1.1.0", + "kind-of": "^6.0.3" + }, "engines": { - "node": ">=0.10.0" + "node": ">= 6" } }, - "node_modules/is-plain-object": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", - "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", + "node_modules/minipass": { + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.4.tgz", + "integrity": "sha512-I9WPbWHCGu8W+6k1ZiGpPu0GkoKBeorkfKNuAFBNS1HNFJvke82sxvI5bzcCNpWPorkOO5QQ+zomzzwRxejXiw==", "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, - "node_modules/is-ssh": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/is-ssh/-/is-ssh-1.4.0.tgz", - "integrity": "sha512-x7+VxdxOdlV3CYpjvRLBv5Lo9OJerlYanjwFrPR9fuGPjCiNiCzFgAWpiLAohSbsnH4ZAys3SBh+hq5rJosxUQ==", + "node_modules/minipass-collect": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/minipass-collect/-/minipass-collect-1.0.2.tgz", + "integrity": "sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA==", "dev": true, "dependencies": { - "protocols": "^2.0.1" + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" } }, - "node_modules/is-stream": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", - "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "node_modules/minipass-fetch": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-2.1.2.tgz", + "integrity": "sha512-LT49Zi2/WMROHYoqGgdlQIZh8mLPZmOrN2NdJjMXxYe4nkN6FUyuPuOAOedNJDrx0IRGg9+4guZewtp8hE6TxA==", "dev": true, + "dependencies": { + "minipass": "^3.1.6", + "minipass-sized": "^1.0.3", + "minizlib": "^2.1.2" + }, "engines": { - "node": ">=8" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "optionalDependencies": { + "encoding": "^0.1.13" } }, - "node_modules/is-text-path": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-text-path/-/is-text-path-1.0.1.tgz", - "integrity": "sha512-xFuJpne9oFz5qDaodwmmG08e3CawH/2ZV8Qqza1Ko7Sk8POWbkRdwIoAWVhqvq0XeUzANEhKo2n0IXUGBm7A/w==", + "node_modules/minipass-flush": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz", + "integrity": "sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==", "dev": true, "dependencies": { - "text-extensions": "^1.0.0" + "minipass": "^3.0.0" }, "engines": { - "node": ">=0.10.0" + "node": ">= 8" } }, - "node_modules/is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", - "dev": true + "node_modules/minipass-json-stream": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minipass-json-stream/-/minipass-json-stream-1.0.1.tgz", + "integrity": "sha512-ODqY18UZt/I8k+b7rl2AENgbWE8IDYam+undIJONvigAz8KR5GWblsFTEfQs0WODsjbSXWlm+JHEv8Gr6Tfdbg==", + "dev": true, + "dependencies": { + "jsonparse": "^1.3.1", + "minipass": "^3.0.0" + } }, - "node_modules/is-unicode-supported": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", - "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "node_modules/minipass-pipeline": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz", + "integrity": "sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==", "dev": true, - "engines": { - "node": ">=10" + "dependencies": { + "minipass": "^3.0.0" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "engines": { + "node": ">=8" } }, - "node_modules/is-wsl": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", - "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "node_modules/minipass-sized": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/minipass-sized/-/minipass-sized-1.0.3.tgz", + "integrity": "sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==", "dev": true, "dependencies": { - "is-docker": "^2.0.0" + "minipass": "^3.0.0" }, "engines": { "node": ">=8" } }, - "node_modules/is-yarn-global": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/is-yarn-global/-/is-yarn-global-0.4.0.tgz", - "integrity": "sha512-HneQBCrXGBy15QnaDfcn6OLoU8AQPAa0Qn0IeJR/QCo4E8dNZaGGwxpCwWyEBQC5QvFonP8d6t60iGpAHVAfNA==", + "node_modules/minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", "dev": true, + "dependencies": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, "engines": { - "node": ">=12" + "node": ">= 8" } }, - "node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", - "dev": true + "node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true, + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } }, - "node_modules/isexe": { + "node_modules/mkdirp-infer-owner": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true + "resolved": "https://registry.npmjs.org/mkdirp-infer-owner/-/mkdirp-infer-owner-2.0.0.tgz", + "integrity": "sha512-sdqtiFt3lkOaYvTXSRIUjkIdPTcxgv5+fgqYE/5qgwdw12cOrAuzzgzvVExIkH/ul1oeHN3bCLOWSG3XOqbKKw==", + "dev": true, + "dependencies": { + "chownr": "^2.0.0", + "infer-owner": "^1.0.4", + "mkdirp": "^1.0.3" + }, + "engines": { + "node": ">=10" + } }, - "node_modules/isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", + "node_modules/modify-values": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/modify-values/-/modify-values-1.0.1.tgz", + "integrity": "sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw==", "dev": true, "engines": { "node": ">=0.10.0" } }, - "node_modules/jju": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/jju/-/jju-1.4.0.tgz", - "integrity": "sha1-o6vicYryQaKykE+EpiWXDzia4yo=", - "dev": true - }, - "node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, - "node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "node_modules/multimatch": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-5.0.0.tgz", + "integrity": "sha512-ypMKuglUrZUD99Tk2bUQ+xNQj43lPEfAeX2o9cTteAmShXy2VHDJpuwu1o0xqoKCt9jLVAvwyFKdLTPXKAfJyA==", "dev": true, "dependencies": { - "argparse": "^2.0.1" + "@types/minimatch": "^3.0.3", + "array-differ": "^3.0.0", + "array-union": "^2.1.0", + "arrify": "^2.0.1", + "minimatch": "^3.0.4" }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/json-buffer": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", - "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", - "dev": true - }, - "node_modules/json-parse-better-errors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", - "dev": true + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, - "node_modules/json-parse-even-better-errors": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", - "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "node_modules/multimatch/node_modules/@types/minimatch": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.5.tgz", + "integrity": "sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==", "dev": true }, - "node_modules/json-parse-helpfulerror": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/json-parse-helpfulerror/-/json-parse-helpfulerror-1.0.3.tgz", - "integrity": "sha1-E/FM4C7tTpgSl7ZOueO5MuLdE9w=", + "node_modules/multimatch/node_modules/arrify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", + "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", "dev": true, - "dependencies": { - "jju": "^1.1.0" + "engines": { + "node": ">=8" } }, - "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "node_modules/mute-stream": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", + "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", "dev": true }, - "node_modules/json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true }, - "node_modules/json-stringify-nice": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/json-stringify-nice/-/json-stringify-nice-1.1.4.tgz", - "integrity": "sha512-5Z5RFW63yxReJ7vANgW6eZFGWaQvnPE3WNmZoOJrSkGju2etKA2L5rrOa1sm877TVTFt57A80BH1bArcmlLfPw==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", + "node_modules/natural-compare-lite": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", + "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", "dev": true }, - "node_modules/json5": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", - "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", "dev": true, - "bin": { - "json5": "lib/cli.js" - }, "engines": { - "node": ">=6" + "node": ">= 0.6" } }, - "node_modules/jsonc-parser": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.1.0.tgz", - "integrity": "sha512-DRf0QjnNeCUds3xTjKlQQ3DpJD51GvDjJfnxUVWg6PZTo2otSm+slzNAxU/35hF8/oJIKoG9slq30JYOsF2azg==", + "node_modules/neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", "dev": true }, - "node_modules/jsonfile": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", - "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "node_modules/node-addon-api": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.2.1.tgz", + "integrity": "sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==", + "dev": true + }, + "node_modules/node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", "dev": true, "dependencies": { - "universalify": "^2.0.0" + "whatwg-url": "^5.0.0" }, - "optionalDependencies": { - "graceful-fs": "^4.1.6" + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } } }, - "node_modules/jsonlines": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsonlines/-/jsonlines-0.1.1.tgz", - "integrity": "sha1-T80kbcXQ44aRkHxEqwAveC0dlMw=", - "dev": true - }, - "node_modules/jsonparse": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", - "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", - "dev": true, - "engines": [ - "node >= 0.2.0" - ] - }, - "node_modules/JSONStream": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", - "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", + "node_modules/node-gyp": { + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-9.3.0.tgz", + "integrity": "sha512-A6rJWfXFz7TQNjpldJ915WFb1LnhO4lIve3ANPbWreuEoLoKlFT3sxIepPBkLhM27crW8YmN+pjlgbasH6cH/Q==", "dev": true, "dependencies": { - "jsonparse": "^1.2.0", - "through": ">=2.2.7 <3" + "env-paths": "^2.2.0", + "glob": "^7.1.4", + "graceful-fs": "^4.2.6", + "make-fetch-happen": "^10.0.3", + "nopt": "^6.0.0", + "npmlog": "^6.0.0", + "rimraf": "^3.0.2", + "semver": "^7.3.5", + "tar": "^6.1.2", + "which": "^2.0.2" }, "bin": { - "JSONStream": "bin.js" + "node-gyp": "bin/node-gyp.js" }, "engines": { - "node": "*" + "node": "^12.22 || ^14.13 || >=16" } }, - "node_modules/just-diff": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/just-diff/-/just-diff-5.0.3.tgz", - "integrity": "sha512-a8p80xcpJ6sdurk5PxDKb4mav9MeKjA3zFKZpCWBIfvg8mznfnmb13MKZvlrwJ+Lhis0wM3uGAzE0ArhFHvIcg==", - "dev": true - }, - "node_modules/just-diff-apply": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/just-diff-apply/-/just-diff-apply-5.3.1.tgz", - "integrity": "sha512-dgFenZnMsc1xGNqgdtgnh7DK+Oy352CE3VZLbzcbQpsBs9iI2K3M0IRrdgREZ72eItTjbl0suRyvKRdVQa9GbA==", - "dev": true - }, - "node_modules/keyv": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.3.3.tgz", - "integrity": "sha512-AcysI17RvakTh8ir03+a3zJr5r0ovnAH/XTXei/4HIv3bL2K/jzvgivLK9UuI/JbU1aJjM3NSAnVvVVd3n+4DQ==", + "node_modules/node-gyp-build": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.6.0.tgz", + "integrity": "sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ==", "dev": true, - "dependencies": { - "compress-brotli": "^1.3.8", - "json-buffer": "3.0.1" + "bin": { + "node-gyp-build": "bin.js", + "node-gyp-build-optional": "optional.js", + "node-gyp-build-test": "build-test.js" } }, - "node_modules/kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "node_modules/node-gyp/node_modules/nopt": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-6.0.0.tgz", + "integrity": "sha512-ZwLpbTgdhuZUnZzjd7nb1ZV+4DoiC6/sfiVKok72ym/4Tlf+DFdlHYmT2JPmcNNWV6Pi3SDf1kT+A4r9RTuT9g==", "dev": true, + "dependencies": { + "abbrev": "^1.0.0" + }, + "bin": { + "nopt": "bin/nopt.js" + }, "engines": { - "node": ">=0.10.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/kleur": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz", - "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==", + "node_modules/nopt": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", + "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", "dev": true, + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + }, "engines": { "node": ">=6" } }, - "node_modules/latest-version": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-7.0.0.tgz", - "integrity": "sha512-KvNT4XqAMzdcL6ka6Tl3i2lYeFDgXNCuIX+xNx6ZMVR1dFq+idXd9FLKNMOIx0t9mJ9/HudyX4oZWXZQ0UJHeg==", + "node_modules/normalize-package-data": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz", + "integrity": "sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==", "dev": true, "dependencies": { - "package-json": "^8.1.0" + "hosted-git-info": "^4.0.1", + "is-core-module": "^2.5.0", + "semver": "^7.3.4", + "validate-npm-package-license": "^3.0.1" }, + "engines": { + "node": ">=10" + } + }, + "node_modules/normalize-url": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-8.0.0.tgz", + "integrity": "sha512-uVFpKhj5MheNBJRTiMZ9pE/7hD1QTeEvugSJW/OmLzAp78PB5O6adfMNTvmfKhXBkvCzC+rqifWcVYpGFwTjnw==", + "dev": true, "engines": { "node": ">=14.16" }, @@ -5605,1062 +5849,1075 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/lerna": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/lerna/-/lerna-5.3.0.tgz", - "integrity": "sha512-0Y9xJqleVu0ExGmsw2WM/GkVmxOwtA7OLQFS5ERPKJfnsxH9roTX3a7NPaGQRI2E+tSJLJJGgNSf3WYEqinOqA==", - "dev": true, - "dependencies": { - "@lerna/add": "5.3.0", - "@lerna/bootstrap": "5.3.0", - "@lerna/changed": "5.3.0", - "@lerna/clean": "5.3.0", - "@lerna/cli": "5.3.0", - "@lerna/create": "5.3.0", - "@lerna/diff": "5.3.0", - "@lerna/exec": "5.3.0", - "@lerna/import": "5.3.0", - "@lerna/info": "5.3.0", - "@lerna/init": "5.3.0", - "@lerna/link": "5.3.0", - "@lerna/list": "5.3.0", - "@lerna/publish": "5.3.0", - "@lerna/run": "5.3.0", - "@lerna/version": "5.3.0", - "import-local": "^3.0.2", - "npmlog": "^6.0.2", - "nx": ">=14.4.3 < 16" + "node_modules/npm-bundled": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.1.2.tgz", + "integrity": "sha512-x5DHup0SuyQcmL3s7Rx/YQ8sbw/Hzg0rj48eN0dV7hf5cmQq5PXIeioroH3raV1QC1yh3uTYuMThvEQF3iKgGQ==", + "dev": true, + "dependencies": { + "npm-normalize-package-bin": "^1.0.1" + } + }, + "node_modules/npm-check-updates": { + "version": "16.7.10", + "resolved": "https://registry.npmjs.org/npm-check-updates/-/npm-check-updates-16.7.10.tgz", + "integrity": "sha512-sLDgYD8ebkH9Jd6mPIq7UDGLr3DAxkHl6ZuJrEF4rauLv6DqHBxtnF16MHUPN+/eBt5QbH4GL/+nxfSAFm3TfQ==", + "dev": true, + "dependencies": { + "chalk": "^5.2.0", + "cli-table": "^0.3.11", + "commander": "^10.0.0", + "fast-memoize": "^2.5.2", + "find-up": "5.0.0", + "fp-and-or": "^0.1.3", + "get-stdin": "^8.0.0", + "globby": "^11.0.4", + "hosted-git-info": "^5.1.0", + "ini": "^3.0.1", + "json-parse-helpfulerror": "^1.0.3", + "jsonlines": "^0.1.1", + "lodash": "^4.17.21", + "minimatch": "^7.0.1", + "p-map": "^4.0.0", + "pacote": "15.1.1", + "parse-github-url": "^1.0.2", + "progress": "^2.0.3", + "prompts-ncu": "^2.5.1", + "rc-config-loader": "^4.1.2", + "remote-git-tags": "^3.0.0", + "rimraf": "^4.1.2", + "semver": "^7.3.8", + "semver-utils": "^1.1.4", + "source-map-support": "^0.5.21", + "spawn-please": "^2.0.1", + "strip-json-comments": "^5.0.0", + "untildify": "^4.0.0", + "update-notifier": "^6.0.2", + "yaml": "^2.2.1" }, "bin": { - "lerna": "cli.js" + "ncu": "build/src/bin/cli.js", + "npm-check-updates": "build/src/bin/cli.js" }, "engines": { - "node": "^14.15.0 || >=16.0.0" + "node": ">=14.14" } }, - "node_modules/levn": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "node_modules/npm-check-updates/node_modules/@npmcli/fs": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-3.1.0.tgz", + "integrity": "sha512-7kZUAaLscfgbwBQRbvdMYaZOWyMEcPTH/tJjnyAWJ/dvvs9Ef+CERx/qJb9GExJpl1qipaDGn7KqHnFGGixd0w==", "dev": true, "dependencies": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" + "semver": "^7.3.5" }, "engines": { - "node": ">= 0.8.0" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/libnpmaccess": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/libnpmaccess/-/libnpmaccess-6.0.3.tgz", - "integrity": "sha512-4tkfUZprwvih2VUZYMozL7EMKgQ5q9VW2NtRyxWtQWlkLTAWHRklcAvBN49CVqEkhUw7vTX2fNgB5LzgUucgYg==", + "node_modules/npm-check-updates/node_modules/@npmcli/git": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@npmcli/git/-/git-4.0.3.tgz", + "integrity": "sha512-8cXNkDIbnXPVbhXMmQ7/bklCAjtmPaXfI9aEM4iH+xSuEHINLMHhlfESvVwdqmHJRJkR48vNJTSUvoF6GRPSFA==", "dev": true, "dependencies": { - "aproba": "^2.0.0", - "minipass": "^3.1.1", - "npm-package-arg": "^9.0.1", - "npm-registry-fetch": "^13.0.0" + "@npmcli/promise-spawn": "^6.0.0", + "lru-cache": "^7.4.4", + "mkdirp": "^1.0.4", + "npm-pick-manifest": "^8.0.0", + "proc-log": "^3.0.0", + "promise-inflight": "^1.0.1", + "promise-retry": "^2.0.1", + "semver": "^7.3.5", + "which": "^3.0.0" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/libnpmaccess/node_modules/hosted-git-info": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.0.0.tgz", - "integrity": "sha512-rRnjWu0Bxj+nIfUOkz0695C0H6tRrN5iYIzYejb0tDEefe2AekHu/U5Kn9pEie5vsJqpNQU02az7TGSH3qpz4Q==", + "node_modules/npm-check-updates/node_modules/@npmcli/installed-package-contents": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@npmcli/installed-package-contents/-/installed-package-contents-2.0.2.tgz", + "integrity": "sha512-xACzLPhnfD51GKvTOOuNX2/V4G4mz9/1I2MfDoye9kBM3RYe5g2YbscsaGoTlaWqkxeiapBWyseULVKpSVHtKQ==", "dev": true, "dependencies": { - "lru-cache": "^7.5.1" + "npm-bundled": "^3.0.0", + "npm-normalize-package-bin": "^3.0.0" + }, + "bin": { + "installed-package-contents": "lib/index.js" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/libnpmaccess/node_modules/lru-cache": { - "version": "7.13.2", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.13.2.tgz", - "integrity": "sha512-VJL3nIpA79TodY/ctmZEfhASgqekbT574/c4j3jn4bKXbSCnTTCH/KltZyvL2GlV+tGSMtsWyem8DCX7qKTMBA==", + "node_modules/npm-check-updates/node_modules/@npmcli/node-gyp": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/node-gyp/-/node-gyp-3.0.0.tgz", + "integrity": "sha512-gp8pRXC2oOxu0DUE1/M3bYtb1b3/DbJ5aM113+XJBgfXdussRAsX0YOrOhdd8WvnAR6auDBvJomGAkLKA5ydxA==", "dev": true, "engines": { - "node": ">=12" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/libnpmaccess/node_modules/npm-package-arg": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-9.1.0.tgz", - "integrity": "sha512-4J0GL+u2Nh6OnhvUKXRr2ZMG4lR8qtLp+kv7UiV00Y+nGiSxtttCyIRHCt5L5BNkXQld/RceYItau3MDOoGiBw==", + "node_modules/npm-check-updates/node_modules/@npmcli/promise-spawn": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/@npmcli/promise-spawn/-/promise-spawn-6.0.2.tgz", + "integrity": "sha512-gGq0NJkIGSwdbUt4yhdF8ZrmkGKVz9vAdVzpOfnom+V8PLSmSOVhZwbNvZZS1EYcJN5hzzKBxmmVVAInM6HQLg==", "dev": true, "dependencies": { - "hosted-git-info": "^5.0.0", - "proc-log": "^2.0.1", - "semver": "^7.3.5", - "validate-npm-package-name": "^4.0.0" + "which": "^3.0.0" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/libnpmpublish": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/libnpmpublish/-/libnpmpublish-6.0.4.tgz", - "integrity": "sha512-lvAEYW8mB8QblL6Q/PI/wMzKNvIrF7Kpujf/4fGS/32a2i3jzUXi04TNyIBcK6dQJ34IgywfaKGh+Jq4HYPFmg==", + "node_modules/npm-check-updates/node_modules/@npmcli/run-script": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-6.0.0.tgz", + "integrity": "sha512-ql+AbRur1TeOdl1FY+RAwGW9fcr4ZwiVKabdvm93mujGREVuVLbdkXRJDrkTXSdCjaxYydr1wlA2v67jxWG5BQ==", "dev": true, "dependencies": { - "normalize-package-data": "^4.0.0", - "npm-package-arg": "^9.0.1", - "npm-registry-fetch": "^13.0.0", - "semver": "^7.3.7", - "ssri": "^9.0.0" + "@npmcli/node-gyp": "^3.0.0", + "@npmcli/promise-spawn": "^6.0.0", + "node-gyp": "^9.0.0", + "read-package-json-fast": "^3.0.0", + "which": "^3.0.0" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/libnpmpublish/node_modules/hosted-git-info": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.0.0.tgz", - "integrity": "sha512-rRnjWu0Bxj+nIfUOkz0695C0H6tRrN5iYIzYejb0tDEefe2AekHu/U5Kn9pEie5vsJqpNQU02az7TGSH3qpz4Q==", + "node_modules/npm-check-updates/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, "dependencies": { - "lru-cache": "^7.5.1" + "balanced-match": "^1.0.0" + } + }, + "node_modules/npm-check-updates/node_modules/cacache": { + "version": "17.0.4", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-17.0.4.tgz", + "integrity": "sha512-Z/nL3gU+zTUjz5pCA5vVjYM8pmaw2kxM7JEiE0fv3w77Wj+sFbi70CrBruUWH0uNcEdvLDixFpgA2JM4F4DBjA==", + "dev": true, + "dependencies": { + "@npmcli/fs": "^3.1.0", + "fs-minipass": "^3.0.0", + "glob": "^8.0.1", + "lru-cache": "^7.7.1", + "minipass": "^4.0.0", + "minipass-collect": "^1.0.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "p-map": "^4.0.0", + "promise-inflight": "^1.0.1", + "ssri": "^10.0.0", + "tar": "^6.1.11", + "unique-filename": "^3.0.0" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/libnpmpublish/node_modules/hosted-git-info/node_modules/lru-cache": { - "version": "7.13.2", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.13.2.tgz", - "integrity": "sha512-VJL3nIpA79TodY/ctmZEfhASgqekbT574/c4j3jn4bKXbSCnTTCH/KltZyvL2GlV+tGSMtsWyem8DCX7qKTMBA==", + "node_modules/npm-check-updates/node_modules/chalk": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.2.0.tgz", + "integrity": "sha512-ree3Gqw/nazQAPuJJEy+avdl7QfZMcUvmHIKgEZkGL+xOBzRvup5Hxo6LHuMceSxOabuJLJm5Yp/92R9eMmMvA==", "dev": true, "engines": { - "node": ">=12" + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/libnpmpublish/node_modules/normalize-package-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-4.0.0.tgz", - "integrity": "sha512-m+GL22VXJKkKbw62ZaBBjv8u6IE3UI4Mh5QakIqs3fWiKe0Xyi6L97hakwZK41/LD4R/2ly71Bayx0NLMwLA/g==", + "node_modules/npm-check-updates/node_modules/fs-minipass": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-3.0.1.tgz", + "integrity": "sha512-MhaJDcFRTuLidHrIttu0RDGyyXs/IYHVmlcxfLAEFIWjc1vdLAkdwT7Ace2u7DbitWC0toKMl5eJZRYNVreIMw==", "dev": true, "dependencies": { - "hosted-git-info": "^5.0.0", - "is-core-module": "^2.8.1", - "semver": "^7.3.5", - "validate-npm-package-license": "^3.0.4" + "minipass": "^4.0.0" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/libnpmpublish/node_modules/npm-package-arg": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-9.1.0.tgz", - "integrity": "sha512-4J0GL+u2Nh6OnhvUKXRr2ZMG4lR8qtLp+kv7UiV00Y+nGiSxtttCyIRHCt5L5BNkXQld/RceYItau3MDOoGiBw==", + "node_modules/npm-check-updates/node_modules/glob": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", "dev": true, "dependencies": { - "hosted-git-info": "^5.0.0", - "proc-log": "^2.0.1", - "semver": "^7.3.5", - "validate-npm-package-name": "^4.0.0" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/libnpmpublish/node_modules/semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "node_modules/npm-check-updates/node_modules/glob/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", "dev": true, "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" + "brace-expansion": "^2.0.1" }, "engines": { "node": ">=10" } }, - "node_modules/lines-and-columns": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", - "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", - "dev": true - }, - "node_modules/load-json-file": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-6.2.0.tgz", - "integrity": "sha512-gUD/epcRms75Cw8RT1pUdHugZYM5ce64ucs2GEISABwkRsOQr0q2wm/MV2TKThycIe5e0ytRweW2RZxclogCdQ==", + "node_modules/npm-check-updates/node_modules/hosted-git-info": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.2.1.tgz", + "integrity": "sha512-xIcQYMnhcx2Nr4JTjsFmwwnr9vldugPy9uVm0o87bjqqWMv9GaqsTeT+i99wTl0mk1uLxJtHxLb8kymqTENQsw==", "dev": true, "dependencies": { - "graceful-fs": "^4.1.15", - "parse-json": "^5.0.0", - "strip-bom": "^4.0.0", - "type-fest": "^0.6.0" + "lru-cache": "^7.5.1" }, "engines": { - "node": ">=8" - } - }, - "node_modules/load-json-file/node_modules/type-fest": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", - "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", - "dev": true, - "engines": { - "node": ">=8" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "node_modules/npm-check-updates/node_modules/ignore-walk": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-6.0.1.tgz", + "integrity": "sha512-/c8MxUAqpRccq+LyDOecwF+9KqajueJHh8fz7g3YqjMZt+NSfJzx05zrKiXwa2sKwFCzaiZ5qUVfRj0pmxixEA==", "dev": true, "dependencies": { - "p-locate": "^4.1.0" + "minimatch": "^6.1.6" }, "engines": { - "node": ">=8" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" - }, - "node_modules/lodash.ismatch": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz", - "integrity": "sha512-fPMfXjGQEV9Xsq/8MTSgUf255gawYRbjwMyDbcvDhXgV7enSZA0hynz6vMPnpAb5iONEzBHBPsT+0zes5Z301g==", - "dev": true - }, - "node_modules/lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true - }, - "node_modules/log-symbols": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", - "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "node_modules/npm-check-updates/node_modules/ignore-walk/node_modules/minimatch": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-6.2.0.tgz", + "integrity": "sha512-sauLxniAmvnhhRjFwPNnJKaPFYyddAgbYdeUpHULtCT/GhzdCx/MDNy+Y40lBxTQUrMzDE8e0S43Z5uqfO0REg==", "dev": true, "dependencies": { - "chalk": "^4.1.0", - "is-unicode-supported": "^0.1.0" + "brace-expansion": "^2.0.1" }, "engines": { "node": ">=10" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/long": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", - "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" - }, - "node_modules/lowercase-keys": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-3.0.0.tgz", - "integrity": "sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "node_modules/npm-check-updates/node_modules/ini": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ini/-/ini-3.0.1.tgz", + "integrity": "sha512-it4HyVAUTKBc6m8e1iXWvXSTdndF7HbdN713+kvLrymxTaU4AUBWrJ4vEooP+V7fexnVD3LKcBshjGGPefSMUQ==", "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, "engines": { - "node": ">=10" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "node_modules/npm-check-updates/node_modules/json-parse-even-better-errors": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-3.0.0.tgz", + "integrity": "sha512-iZbGHafX/59r39gPwVPRBGw0QQKnA7tte5pSMrhWOW7swGsVvVTjmfyAV9pNqk8YGT7tRCdxRu8uzcgZwoDooA==", "dev": true, - "dependencies": { - "semver": "^6.0.0" - }, "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/make-dir/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true, - "bin": { - "semver": "bin/semver.js" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/make-fetch-happen": { - "version": "10.2.0", - "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-10.2.0.tgz", - "integrity": "sha512-OnEfCLofQVJ5zgKwGk55GaqosqKjaR6khQlJY3dBAA+hM25Bc5CmX5rKUfVut+rYA3uidA7zb7AvcglU87rPRg==", + "node_modules/npm-check-updates/node_modules/make-fetch-happen": { + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-11.0.3.tgz", + "integrity": "sha512-oPLh5m10lRNNZDjJ2kP8UpboUx2uFXVaVweVe/lWut4iHWcQEmfqSVJt2ihZsFI8HbpwyyocaXbCAWf0g1ukIA==", "dev": true, "dependencies": { "agentkeepalive": "^4.2.1", - "cacache": "^16.1.0", - "http-cache-semantics": "^4.1.0", + "cacache": "^17.0.0", + "http-cache-semantics": "^4.1.1", "http-proxy-agent": "^5.0.0", "https-proxy-agent": "^5.0.0", "is-lambda": "^1.0.1", "lru-cache": "^7.7.1", - "minipass": "^3.1.6", - "minipass-collect": "^1.0.2", - "minipass-fetch": "^2.0.3", + "minipass": "^4.0.0", + "minipass-fetch": "^3.0.0", "minipass-flush": "^1.0.5", "minipass-pipeline": "^1.2.4", "negotiator": "^0.6.3", "promise-retry": "^2.0.1", "socks-proxy-agent": "^7.0.0", - "ssri": "^9.0.0" + "ssri": "^10.0.0" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/make-fetch-happen/node_modules/lru-cache": { - "version": "7.13.2", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.13.2.tgz", - "integrity": "sha512-VJL3nIpA79TodY/ctmZEfhASgqekbT574/c4j3jn4bKXbSCnTTCH/KltZyvL2GlV+tGSMtsWyem8DCX7qKTMBA==", + "node_modules/npm-check-updates/node_modules/minimatch": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-7.4.2.tgz", + "integrity": "sha512-xy4q7wou3vUoC9k1xGTXc+awNdGaGVHtFUaey8tiX4H1QRc04DZ/rmDFwNm2EBsuYEhAZ6SgMmYf3InGY6OauA==", "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, "engines": { - "node": ">=12" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/map-obj": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.3.0.tgz", - "integrity": "sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==", + "node_modules/npm-check-updates/node_modules/minipass": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-4.2.4.tgz", + "integrity": "sha512-lwycX3cBMTvcejsHITUgYj6Gy6A7Nh4Q6h9NP4sTHY1ccJlC7yKzDmiShEHsJ16Jf1nKGDEaiHxiltsJEvk0nQ==", "dev": true, "engines": { "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/meow": { - "version": "8.1.2", - "resolved": "https://registry.npmjs.org/meow/-/meow-8.1.2.tgz", - "integrity": "sha512-r85E3NdZ+mpYk1C6RjPFEMSE+s1iZMuHtsHAqY0DT3jZczl0diWUZ8g6oU7h0M9cD2EL+PzaYghhCLzR0ZNn5Q==", + "node_modules/npm-check-updates/node_modules/minipass-fetch": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-3.0.1.tgz", + "integrity": "sha512-t9/wowtf7DYkwz8cfMSt0rMwiyNIBXf5CKZ3S5ZMqRqMYT0oLTp0x1WorMI9WTwvaPg21r1JbFxJMum8JrLGfw==", "dev": true, "dependencies": { - "@types/minimist": "^1.2.0", - "camelcase-keys": "^6.2.2", - "decamelize-keys": "^1.1.0", - "hard-rejection": "^2.1.0", - "minimist-options": "4.1.0", - "normalize-package-data": "^3.0.0", - "read-pkg-up": "^7.0.1", - "redent": "^3.0.0", - "trim-newlines": "^3.0.0", - "type-fest": "^0.18.0", - "yargs-parser": "^20.2.3" + "minipass": "^4.0.0", + "minipass-sized": "^1.0.3", + "minizlib": "^2.1.2" }, "engines": { - "node": ">=10" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "optionalDependencies": { + "encoding": "^0.1.13" } }, - "node_modules/meow/node_modules/hosted-git-info": { - "version": "2.8.9", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", - "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", - "dev": true - }, - "node_modules/meow/node_modules/read-pkg": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", - "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", + "node_modules/npm-check-updates/node_modules/normalize-package-data": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-5.0.0.tgz", + "integrity": "sha512-h9iPVIfrVZ9wVYQnxFgtw1ugSvGEMOlyPWWtm8BMJhnwyEL/FLbYbTY3V3PpjI/BUK67n9PEWDu6eHzu1fB15Q==", "dev": true, "dependencies": { - "@types/normalize-package-data": "^2.4.0", - "normalize-package-data": "^2.5.0", - "parse-json": "^5.0.0", - "type-fest": "^0.6.0" + "hosted-git-info": "^6.0.0", + "is-core-module": "^2.8.1", + "semver": "^7.3.5", + "validate-npm-package-license": "^3.0.4" }, "engines": { - "node": ">=8" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/meow/node_modules/read-pkg-up": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", - "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", + "node_modules/npm-check-updates/node_modules/normalize-package-data/node_modules/hosted-git-info": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-6.1.1.tgz", + "integrity": "sha512-r0EI+HBMcXadMrugk0GCQ+6BQV39PiWAZVfq7oIckeGiN7sjRGyQxPdft3nQekFTCQbYxLBH+/axZMeH8UX6+w==", "dev": true, "dependencies": { - "find-up": "^4.1.0", - "read-pkg": "^5.2.0", - "type-fest": "^0.8.1" + "lru-cache": "^7.5.1" }, "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/meow/node_modules/read-pkg-up/node_modules/type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "node_modules/npm-check-updates/node_modules/npm-bundled": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-3.0.0.tgz", + "integrity": "sha512-Vq0eyEQy+elFpzsKjMss9kxqb9tG3YHg4dsyWuUENuzvSUWe1TCnW/vV9FkhvBk/brEDoDiVd+M1Btosa6ImdQ==", "dev": true, + "dependencies": { + "npm-normalize-package-bin": "^3.0.0" + }, "engines": { - "node": ">=8" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/meow/node_modules/read-pkg/node_modules/normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "node_modules/npm-check-updates/node_modules/npm-install-checks": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/npm-install-checks/-/npm-install-checks-6.0.0.tgz", + "integrity": "sha512-SBU9oFglRVZnfElwAtF14NivyulDqF1VKqqwNsFW9HDcbHMAPHpRSsVFgKuwFGq/hVvWZExz62Th0kvxn/XE7Q==", "dev": true, "dependencies": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" + "semver": "^7.1.1" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/meow/node_modules/read-pkg/node_modules/type-fest": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", - "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", + "node_modules/npm-check-updates/node_modules/npm-normalize-package-bin": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-3.0.0.tgz", + "integrity": "sha512-g+DPQSkusnk7HYXr75NtzkIP4+N81i3RPsGFidF3DzHd9MT9wWngmqoeg/fnHFz5MNdtG4w03s+QnhewSLTT2Q==", "dev": true, "engines": { - "node": ">=8" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/meow/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "node_modules/npm-check-updates/node_modules/npm-package-arg": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-10.1.0.tgz", + "integrity": "sha512-uFyyCEmgBfZTtrKk/5xDfHp6+MdrqGotX/VoOyEEl3mBwiEE5FlBaePanazJSVMPT7vKepcjYBY2ztg9A3yPIA==", "dev": true, - "bin": { - "semver": "bin/semver" + "dependencies": { + "hosted-git-info": "^6.0.0", + "proc-log": "^3.0.0", + "semver": "^7.3.5", + "validate-npm-package-name": "^5.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/meow/node_modules/type-fest": { - "version": "0.18.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.18.1.tgz", - "integrity": "sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw==", + "node_modules/npm-check-updates/node_modules/npm-package-arg/node_modules/hosted-git-info": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-6.1.1.tgz", + "integrity": "sha512-r0EI+HBMcXadMrugk0GCQ+6BQV39PiWAZVfq7oIckeGiN7sjRGyQxPdft3nQekFTCQbYxLBH+/axZMeH8UX6+w==", "dev": true, - "engines": { - "node": ">=10" + "dependencies": { + "lru-cache": "^7.5.1" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/merge-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "dev": true - }, - "node_modules/merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "node_modules/npm-check-updates/node_modules/npm-packlist": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-7.0.4.tgz", + "integrity": "sha512-d6RGEuRrNS5/N84iglPivjaJPxhDbZmlbTwTDX2IbcRHG5bZCdtysYMhwiPvcF4GisXHGn7xsxv+GQ7T/02M5Q==", "dev": true, + "dependencies": { + "ignore-walk": "^6.0.0" + }, "engines": { - "node": ">= 8" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/micromatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", - "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", + "node_modules/npm-check-updates/node_modules/npm-pick-manifest": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-8.0.1.tgz", + "integrity": "sha512-mRtvlBjTsJvfCCdmPtiu2bdlx8d/KXtF7yNXNWe7G0Z36qWA9Ny5zXsI2PfBZEv7SXgoxTmNaTzGSbbzDZChoA==", "dev": true, "dependencies": { - "braces": "^3.0.1", - "picomatch": "^2.2.3" + "npm-install-checks": "^6.0.0", + "npm-normalize-package-bin": "^3.0.0", + "npm-package-arg": "^10.0.0", + "semver": "^7.3.5" }, "engines": { - "node": ">=8.6" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "node_modules/npm-check-updates/node_modules/npm-registry-fetch": { + "version": "14.0.3", + "resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-14.0.3.tgz", + "integrity": "sha512-YaeRbVNpnWvsGOjX2wk5s85XJ7l1qQBGAp724h8e2CZFFhMSuw9enom7K1mWVUtvXO1uUSFIAPofQK0pPN0ZcA==", "dev": true, + "dependencies": { + "make-fetch-happen": "^11.0.0", + "minipass": "^4.0.0", + "minipass-fetch": "^3.0.0", + "minipass-json-stream": "^1.0.1", + "minizlib": "^2.1.2", + "npm-package-arg": "^10.0.0", + "proc-log": "^3.0.0" + }, "engines": { - "node": ">=6" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/mimic-response": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", - "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", + "node_modules/npm-check-updates/node_modules/pacote": { + "version": "15.1.1", + "resolved": "https://registry.npmjs.org/pacote/-/pacote-15.1.1.tgz", + "integrity": "sha512-eeqEe77QrA6auZxNHIp+1TzHQ0HBKf5V6c8zcaYZ134EJe1lCi+fjXATkNiEEfbG+e50nu02GLvUtmZcGOYabQ==", "dev": true, + "dependencies": { + "@npmcli/git": "^4.0.0", + "@npmcli/installed-package-contents": "^2.0.1", + "@npmcli/promise-spawn": "^6.0.1", + "@npmcli/run-script": "^6.0.0", + "cacache": "^17.0.0", + "fs-minipass": "^3.0.0", + "minipass": "^4.0.0", + "npm-package-arg": "^10.0.0", + "npm-packlist": "^7.0.0", + "npm-pick-manifest": "^8.0.0", + "npm-registry-fetch": "^14.0.0", + "proc-log": "^3.0.0", + "promise-retry": "^2.0.1", + "read-package-json": "^6.0.0", + "read-package-json-fast": "^3.0.0", + "sigstore": "^1.0.0", + "ssri": "^10.0.0", + "tar": "^6.1.11" + }, + "bin": { + "pacote": "lib/bin.js" + }, "engines": { - "node": ">=4" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/min-indent": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", - "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", + "node_modules/npm-check-updates/node_modules/proc-log": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-3.0.0.tgz", + "integrity": "sha512-++Vn7NS4Xf9NacaU9Xq3URUuqZETPsf8L4j5/ckhaRYsfPeRyzGw+iDjFhV/Jr3uNmTvvddEJFWh5R1gRgUH8A==", "dev": true, "engines": { - "node": ">=4" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "node_modules/npm-check-updates/node_modules/read-package-json": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-6.0.0.tgz", + "integrity": "sha512-b/9jxWJ8EwogJPpv99ma+QwtqB7FSl3+V6UXS7Aaay8/5VwMY50oIFooY1UKXMWpfNCM6T/PoGqa5GD1g9xf9w==", "dev": true, "dependencies": { - "brace-expansion": "^1.1.7" + "glob": "^8.0.1", + "json-parse-even-better-errors": "^3.0.0", + "normalize-package-data": "^5.0.0", + "npm-normalize-package-bin": "^3.0.0" }, "engines": { - "node": "*" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/minimist": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", - "dev": true - }, - "node_modules/minimist-options": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz", - "integrity": "sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==", + "node_modules/npm-check-updates/node_modules/read-package-json-fast": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/read-package-json-fast/-/read-package-json-fast-3.0.2.tgz", + "integrity": "sha512-0J+Msgym3vrLOUB3hzQCuZHII0xkNGCtz/HJH9xZshwv9DbDwkw1KaE3gx/e2J5rpEY5rtOy6cyhKOPrkP7FZw==", "dev": true, "dependencies": { - "arrify": "^1.0.1", - "is-plain-obj": "^1.1.0", - "kind-of": "^6.0.3" + "json-parse-even-better-errors": "^3.0.0", + "npm-normalize-package-bin": "^3.0.0" }, "engines": { - "node": ">= 6" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/minipass": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.3.tgz", - "integrity": "sha512-N0BOsdFAlNRfmwMhjAsLVWOk7Ljmeb39iqFlsV1At+jqRhSUP9yeof8FyJu4imaJiSUp8vQebWD/guZwGQC8iA==", + "node_modules/npm-check-updates/node_modules/rimraf": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-4.1.2.tgz", + "integrity": "sha512-BlIbgFryTbw3Dz6hyoWFhKk+unCcHMSkZGrTFVAx2WmttdBSonsdtRlwiuTbDqTKr+UlXIUqJVS4QT5tUzGENQ==", "dev": true, - "dependencies": { - "yallist": "^4.0.0" + "bin": { + "rimraf": "dist/cjs/src/bin.js" }, "engines": { - "node": ">=8" + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/minipass-collect": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/minipass-collect/-/minipass-collect-1.0.2.tgz", - "integrity": "sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA==", + "node_modules/npm-check-updates/node_modules/ssri": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-10.0.1.tgz", + "integrity": "sha512-WVy6di9DlPOeBWEjMScpNipeSX2jIZBGEn5Uuo8Q7aIuFEuDX0pw8RxcOjlD1TWP4obi24ki7m/13+nFpcbXrw==", "dev": true, "dependencies": { - "minipass": "^3.0.0" + "minipass": "^4.0.0" }, "engines": { - "node": ">= 8" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/minipass-fetch": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-2.1.0.tgz", - "integrity": "sha512-H9U4UVBGXEyyWJnqYDCLp1PwD8XIkJ4akNHp1aGVI+2Ym7wQMlxDKi4IB4JbmyU+pl9pEs/cVrK6cOuvmbK4Sg==", + "node_modules/npm-check-updates/node_modules/strip-json-comments": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-5.0.0.tgz", + "integrity": "sha512-V1LGY4UUo0jgwC+ELQ2BNWfPa17TIuwBLg+j1AA/9RPzKINl1lhxVEu2r+ZTTO8aetIsUzE5Qj6LMSBkoGYKKw==", "dev": true, - "dependencies": { - "minipass": "^3.1.6", - "minipass-sized": "^1.0.3", - "minizlib": "^2.1.2" - }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": ">=14.16" }, - "optionalDependencies": { - "encoding": "^0.1.13" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/minipass-flush": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz", - "integrity": "sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==", + "node_modules/npm-check-updates/node_modules/unique-filename": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-3.0.0.tgz", + "integrity": "sha512-afXhuC55wkAmZ0P18QsVE6kp8JaxrEokN2HGIoIVv2ijHQd419H0+6EigAFcIzXeMIkcIkNBpB3L/DXB3cTS/g==", "dev": true, "dependencies": { - "minipass": "^3.0.0" + "unique-slug": "^4.0.0" }, "engines": { - "node": ">= 8" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/minipass-json-stream": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minipass-json-stream/-/minipass-json-stream-1.0.1.tgz", - "integrity": "sha512-ODqY18UZt/I8k+b7rl2AENgbWE8IDYam+undIJONvigAz8KR5GWblsFTEfQs0WODsjbSXWlm+JHEv8Gr6Tfdbg==", + "node_modules/npm-check-updates/node_modules/unique-slug": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-4.0.0.tgz", + "integrity": "sha512-WrcA6AyEfqDX5bWige/4NQfPZMtASNVxdmWR76WESYQVAACSgWcR6e9i0mofqqBxYFtL4oAxPIptY73/0YE1DQ==", "dev": true, "dependencies": { - "jsonparse": "^1.3.1", - "minipass": "^3.0.0" + "imurmurhash": "^0.1.4" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/minipass-pipeline": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz", - "integrity": "sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==", + "node_modules/npm-check-updates/node_modules/validate-npm-package-name": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-5.0.0.tgz", + "integrity": "sha512-YuKoXDAhBYxY7SfOKxHBDoSyENFeW5VvIIQp2TGQuit8gpK6MnWaQelBKxso72DoxTZfZdcP3W90LqpSkgPzLQ==", "dev": true, "dependencies": { - "minipass": "^3.0.0" + "builtins": "^5.0.0" }, "engines": { - "node": ">=8" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/minipass-sized": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/minipass-sized/-/minipass-sized-1.0.3.tgz", - "integrity": "sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==", + "node_modules/npm-check-updates/node_modules/which": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/which/-/which-3.0.0.tgz", + "integrity": "sha512-nla//68K9NU6yRiwDY/Q8aU6siKlSs64aEC7+IV56QoAuyQT2ovsJcgGYGyqMOmI/CGN1BOR6mM5EN0FBO+zyQ==", "dev": true, "dependencies": { - "minipass": "^3.0.0" + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/which.js" }, "engines": { - "node": ">=8" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/minizlib": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", - "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "node_modules/npm-check-updates/node_modules/yaml": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.2.1.tgz", + "integrity": "sha512-e0WHiYql7+9wr4cWMx3TVQrNwejKaEe7/rHNmQmqRjazfOP5W8PB6Jpebb5o6fIapbz9o9+2ipcaTM2ZwDI6lw==", + "dev": true, + "engines": { + "node": ">= 14" + } + }, + "node_modules/npm-install-checks": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/npm-install-checks/-/npm-install-checks-5.0.0.tgz", + "integrity": "sha512-65lUsMI8ztHCxFz5ckCEC44DRvEGdZX5usQFriauxHEwt7upv1FKaQEmAtU0YnOAdwuNWCmk64xYiQABNrEyLA==", "dev": true, "dependencies": { - "minipass": "^3.0.0", - "yallist": "^4.0.0" + "semver": "^7.1.1" }, "engines": { - "node": ">= 8" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "node_modules/npm-normalize-package-bin": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz", + "integrity": "sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==", + "dev": true + }, + "node_modules/npm-package-arg": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-8.1.1.tgz", + "integrity": "sha512-CsP95FhWQDwNqiYS+Q0mZ7FAEDytDZAkNxQqea6IaAFJTAY9Lhhqyl0irU/6PMc7BGfUmnsbHcqxJD7XuVM/rg==", "dev": true, - "bin": { - "mkdirp": "bin/cmd.js" + "dependencies": { + "hosted-git-info": "^3.0.6", + "semver": "^7.0.0", + "validate-npm-package-name": "^3.0.0" }, "engines": { "node": ">=10" } }, - "node_modules/mkdirp-infer-owner": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/mkdirp-infer-owner/-/mkdirp-infer-owner-2.0.0.tgz", - "integrity": "sha512-sdqtiFt3lkOaYvTXSRIUjkIdPTcxgv5+fgqYE/5qgwdw12cOrAuzzgzvVExIkH/ul1oeHN3bCLOWSG3XOqbKKw==", + "node_modules/npm-package-arg/node_modules/builtins": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/builtins/-/builtins-1.0.3.tgz", + "integrity": "sha512-uYBjakWipfaO/bXI7E8rq6kpwHRZK5cNYrUv2OzZSI/FvmdMyXJ2tG9dKcjEC5YHmHpUAwsargWIZNWdxb/bnQ==", + "dev": true + }, + "node_modules/npm-package-arg/node_modules/hosted-git-info": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-3.0.8.tgz", + "integrity": "sha512-aXpmwoOhRBrw6X3j0h5RloK4x1OzsxMPyxqIHyNfSe2pypkVTZFpEiRoSipPEPlMrh0HW/XsjkJ5WgnCirpNUw==", "dev": true, "dependencies": { - "chownr": "^2.0.0", - "infer-owner": "^1.0.4", - "mkdirp": "^1.0.3" + "lru-cache": "^6.0.0" }, "engines": { "node": ">=10" } }, - "node_modules/modify-values": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/modify-values/-/modify-values-1.0.1.tgz", - "integrity": "sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw==", + "node_modules/npm-package-arg/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, "engines": { - "node": ">=0.10.0" + "node": ">=10" } }, - "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true + "node_modules/npm-package-arg/node_modules/validate-npm-package-name": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-3.0.0.tgz", + "integrity": "sha512-M6w37eVCMMouJ9V/sdPGnC5H4uDr73/+xdq0FBLO3TFFX1+7wiUY6Es328NN+y43tmY+doUdN9g9J21vqB7iLw==", + "dev": true, + "dependencies": { + "builtins": "^1.0.3" + } }, - "node_modules/multimatch": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-5.0.0.tgz", - "integrity": "sha512-ypMKuglUrZUD99Tk2bUQ+xNQj43lPEfAeX2o9cTteAmShXy2VHDJpuwu1o0xqoKCt9jLVAvwyFKdLTPXKAfJyA==", + "node_modules/npm-packlist": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-5.1.1.tgz", + "integrity": "sha512-UfpSvQ5YKwctmodvPPkK6Fwk603aoVsf8AEbmVKAEECrfvL8SSe1A2YIwrJ6xmTHAITKPwwZsWo7WwEbNk0kxw==", "dev": true, "dependencies": { - "@types/minimatch": "^3.0.3", - "array-differ": "^3.0.0", - "array-union": "^2.1.0", - "arrify": "^2.0.1", - "minimatch": "^3.0.4" + "glob": "^8.0.1", + "ignore-walk": "^5.0.1", + "npm-bundled": "^1.1.2", + "npm-normalize-package-bin": "^1.0.1" }, - "engines": { - "node": ">=10" + "bin": { + "npm-packlist": "bin/index.js" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/multimatch/node_modules/arrify": { + "node_modules/npm-packlist/node_modules/brace-expansion": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", - "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, - "engines": { - "node": ">=8" + "dependencies": { + "balanced-match": "^1.0.0" } }, - "node_modules/mute-stream": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", - "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", - "dev": true - }, - "node_modules/natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", - "dev": true - }, - "node_modules/negotiator": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", - "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "node_modules/npm-packlist/node_modules/glob": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + }, "engines": { - "node": ">= 0.6" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/neo-async": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", - "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", - "dev": true - }, - "node_modules/node-addon-api": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.2.1.tgz", - "integrity": "sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==", - "dev": true - }, - "node_modules/node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "node_modules/npm-packlist/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", "dev": true, "dependencies": { - "whatwg-url": "^5.0.0" + "brace-expansion": "^2.0.1" }, "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } + "node": ">=10" } }, - "node_modules/node-fetch/node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", - "dev": true - }, - "node_modules/node-fetch/node_modules/webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", - "dev": true - }, - "node_modules/node-fetch/node_modules/whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "node_modules/npm-pick-manifest": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-7.0.2.tgz", + "integrity": "sha512-gk37SyRmlIjvTfcYl6RzDbSmS9Y4TOBXfsPnoYqTHARNgWbyDiCSMLUpmALDj4jjcTZpURiEfsSHJj9k7EV4Rw==", "dev": true, "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" + "npm-install-checks": "^5.0.0", + "npm-normalize-package-bin": "^2.0.0", + "npm-package-arg": "^9.0.0", + "semver": "^7.3.5" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/node-gyp": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-9.1.0.tgz", - "integrity": "sha512-HkmN0ZpQJU7FLbJauJTHkHlSVAXlNGDAzH/VYFZGDOnFyn/Na3GlNJfkudmufOdS6/jNFhy88ObzL7ERz9es1g==", + "node_modules/npm-pick-manifest/node_modules/hosted-git-info": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.2.1.tgz", + "integrity": "sha512-xIcQYMnhcx2Nr4JTjsFmwwnr9vldugPy9uVm0o87bjqqWMv9GaqsTeT+i99wTl0mk1uLxJtHxLb8kymqTENQsw==", "dev": true, "dependencies": { - "env-paths": "^2.2.0", - "glob": "^7.1.4", - "graceful-fs": "^4.2.6", - "make-fetch-happen": "^10.0.3", - "nopt": "^5.0.0", - "npmlog": "^6.0.0", - "rimraf": "^3.0.2", - "semver": "^7.3.5", - "tar": "^6.1.2", - "which": "^2.0.2" - }, - "bin": { - "node-gyp": "bin/node-gyp.js" + "lru-cache": "^7.5.1" }, "engines": { - "node": "^12.22 || ^14.13 || >=16" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/node-gyp-build": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.5.0.tgz", - "integrity": "sha512-2iGbaQBV+ITgCz76ZEjmhUKAKVf7xfY1sRl4UiKQspfZMH2h06SyhNsnSVy50cwkFQDGLyif6m/6uFXHkOZ6rg==", + "node_modules/npm-pick-manifest/node_modules/npm-normalize-package-bin": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-2.0.0.tgz", + "integrity": "sha512-awzfKUO7v0FscrSpRoogyNm0sajikhBWpU0QMrW09AMi9n1PoKU6WaIqUzuJSQnpciZZmJ/jMZ2Egfmb/9LiWQ==", "dev": true, - "bin": { - "node-gyp-build": "bin.js", - "node-gyp-build-optional": "optional.js", - "node-gyp-build-test": "build-test.js" + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/nopt": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", - "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "node_modules/npm-pick-manifest/node_modules/npm-package-arg": { + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-9.1.2.tgz", + "integrity": "sha512-pzd9rLEx4TfNJkovvlBSLGhq31gGu2QDexFPWT19yCDh0JgnRhlBLNo5759N0AJmBk+kQ9Y/hXoLnlgFD+ukmg==", "dev": true, "dependencies": { - "abbrev": "1" - }, - "bin": { - "nopt": "bin/nopt.js" + "hosted-git-info": "^5.0.0", + "proc-log": "^2.0.1", + "semver": "^7.3.5", + "validate-npm-package-name": "^4.0.0" }, "engines": { - "node": ">=6" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/normalize-package-data": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz", - "integrity": "sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==", + "node_modules/npm-registry-fetch": { + "version": "13.3.0", + "resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-13.3.0.tgz", + "integrity": "sha512-10LJQ/1+VhKrZjIuY9I/+gQTvumqqlgnsCufoXETHAPFTS3+M+Z5CFhZRDHGavmJ6rOye3UvNga88vl8n1r6gg==", "dev": true, "dependencies": { - "hosted-git-info": "^4.0.1", - "is-core-module": "^2.5.0", - "semver": "^7.3.4", - "validate-npm-package-license": "^3.0.1" + "make-fetch-happen": "^10.0.6", + "minipass": "^3.1.6", + "minipass-fetch": "^2.0.3", + "minipass-json-stream": "^1.0.1", + "minizlib": "^2.1.2", + "npm-package-arg": "^9.0.1", + "proc-log": "^2.0.0" }, "engines": { - "node": ">=10" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "node_modules/npm-registry-fetch/node_modules/hosted-git-info": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.2.1.tgz", + "integrity": "sha512-xIcQYMnhcx2Nr4JTjsFmwwnr9vldugPy9uVm0o87bjqqWMv9GaqsTeT+i99wTl0mk1uLxJtHxLb8kymqTENQsw==", "dev": true, + "dependencies": { + "lru-cache": "^7.5.1" + }, "engines": { - "node": ">=0.10.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/normalize-url": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-6.1.0.tgz", - "integrity": "sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==", + "node_modules/npm-registry-fetch/node_modules/npm-package-arg": { + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-9.1.2.tgz", + "integrity": "sha512-pzd9rLEx4TfNJkovvlBSLGhq31gGu2QDexFPWT19yCDh0JgnRhlBLNo5759N0AJmBk+kQ9Y/hXoLnlgFD+ukmg==", "dev": true, - "engines": { - "node": ">=10" + "dependencies": { + "hosted-git-info": "^5.0.0", + "proc-log": "^2.0.1", + "semver": "^7.3.5", + "validate-npm-package-name": "^4.0.0" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/npm-bundled": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.1.2.tgz", - "integrity": "sha512-x5DHup0SuyQcmL3s7Rx/YQ8sbw/Hzg0rj48eN0dV7hf5cmQq5PXIeioroH3raV1QC1yh3uTYuMThvEQF3iKgGQ==", + "node_modules/npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", "dev": true, "dependencies": { - "npm-normalize-package-bin": "^1.0.1" + "path-key": "^3.0.0" + }, + "engines": { + "node": ">=8" } }, - "node_modules/npm-check-updates": { - "version": "16.0.5", - "resolved": "https://registry.npmjs.org/npm-check-updates/-/npm-check-updates-16.0.5.tgz", - "integrity": "sha512-0qK6NTmgbq8y39xm4y1tKW5ghEGtWWyiUzSPSQEaqb9elqOfZogV4GQVvBYw3xJlt6igJVXgBUyjNqtPv/j7Yw==", + "node_modules/npmlog": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-6.0.2.tgz", + "integrity": "sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg==", "dev": true, "dependencies": { - "chalk": "^5.0.1", - "cli-table": "^0.3.11", - "commander": "^9.4.0", - "fast-memoize": "^2.5.2", - "find-up": "5.0.0", - "fp-and-or": "^0.1.3", - "get-stdin": "^8.0.0", - "globby": "^11.0.4", - "hosted-git-info": "^5.0.0", - "json-parse-helpfulerror": "^1.0.3", - "jsonlines": "^0.1.1", - "lodash": "^4.17.21", - "minimatch": "^5.1.0", - "p-map": "^4.0.0", - "pacote": "^13.6.1", - "parse-github-url": "^1.0.2", - "progress": "^2.0.3", - "prompts-ncu": "^2.5.1", - "rc-config-loader": "^4.1.0", - "remote-git-tags": "^3.0.0", - "rimraf": "^3.0.2", - "semver": "^7.3.7", - "semver-utils": "^1.1.4", - "source-map-support": "^0.5.21", - "spawn-please": "^1.0.0", - "update-notifier": "^6.0.2", - "yaml": "^2.1.1" - }, - "bin": { - "ncu": "build/src/bin/cli.js", - "npm-check-updates": "build/src/bin/cli.js" + "are-we-there-yet": "^3.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^4.0.3", + "set-blocking": "^2.0.0" }, "engines": { - "node": ">=14.14" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/npm-check-updates/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "node_modules/nx": { + "version": "15.7.1", + "resolved": "https://registry.npmjs.org/nx/-/nx-15.7.1.tgz", + "integrity": "sha512-8Gtqazww3rCWxJ+pgB3JDU6hQeA+qRMYh77mXvf5CFQPszqEqvvuiJtKzcieWjxn/IZpeyVRjmPypkEOM6BbHw==", "dev": true, + "hasInstallScript": true, "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/npm-check-updates/node_modules/chalk": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.0.1.tgz", - "integrity": "sha512-Fo07WOYGqMfCWHOzSXOt2CxDbC6skS/jO9ynEcmpANMoPrD+W1r1K6Vx7iNm+AQmETU1Xr2t+n8nzkV9t6xh3w==", - "dev": true, - "engines": { - "node": "^12.17.0 || ^14.13 || >=16.0.0" + "@nrwl/cli": "15.7.1", + "@nrwl/tao": "15.7.1", + "@parcel/watcher": "2.0.4", + "@yarnpkg/lockfile": "^1.1.0", + "@yarnpkg/parsers": "^3.0.0-rc.18", + "@zkochan/js-yaml": "0.0.6", + "axios": "^1.0.0", + "chalk": "^4.1.0", + "cli-cursor": "3.1.0", + "cli-spinners": "2.6.1", + "cliui": "^7.0.2", + "dotenv": "~10.0.0", + "enquirer": "~2.3.6", + "fast-glob": "3.2.7", + "figures": "3.2.0", + "flat": "^5.0.2", + "fs-extra": "^11.1.0", + "glob": "7.1.4", + "ignore": "^5.0.4", + "js-yaml": "4.1.0", + "jsonc-parser": "3.2.0", + "lines-and-columns": "~2.0.3", + "minimatch": "3.0.5", + "npm-run-path": "^4.0.1", + "open": "^8.4.0", + "semver": "7.3.4", + "string-width": "^4.2.3", + "strong-log-transformer": "^2.1.0", + "tar-stream": "~2.2.0", + "tmp": "~0.2.1", + "tsconfig-paths": "^4.1.2", + "tslib": "^2.3.0", + "v8-compile-cache": "2.3.0", + "yargs": "^17.6.2", + "yargs-parser": "21.1.1" }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "bin": { + "nx": "bin/nx.js" + }, + "optionalDependencies": { + "@nrwl/nx-darwin-arm64": "15.7.1", + "@nrwl/nx-darwin-x64": "15.7.1", + "@nrwl/nx-linux-arm-gnueabihf": "15.7.1", + "@nrwl/nx-linux-arm64-gnu": "15.7.1", + "@nrwl/nx-linux-arm64-musl": "15.7.1", + "@nrwl/nx-linux-x64-gnu": "15.7.1", + "@nrwl/nx-linux-x64-musl": "15.7.1", + "@nrwl/nx-win32-arm64-msvc": "15.7.1", + "@nrwl/nx-win32-x64-msvc": "15.7.1" + }, + "peerDependencies": { + "@swc-node/register": "^1.4.2", + "@swc/core": "^1.2.173" + }, + "peerDependenciesMeta": { + "@swc-node/register": { + "optional": true + }, + "@swc/core": { + "optional": true + } } }, - "node_modules/npm-check-updates/node_modules/find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "node_modules/nx/node_modules/fast-glob": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.7.tgz", + "integrity": "sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q==", "dev": true, "dependencies": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" }, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=8" } }, - "node_modules/npm-check-updates/node_modules/hosted-git-info": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.0.0.tgz", - "integrity": "sha512-rRnjWu0Bxj+nIfUOkz0695C0H6tRrN5iYIzYejb0tDEefe2AekHu/U5Kn9pEie5vsJqpNQU02az7TGSH3qpz4Q==", + "node_modules/nx/node_modules/fs-extra": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.1.0.tgz", + "integrity": "sha512-0rcTq621PD5jM/e0a3EJoGC/1TC5ZBCERW82LQuwfGnCa1V8w7dpYH1yNu+SLb6E5dkeCBzKEyLGlFrnr+dUyw==", "dev": true, "dependencies": { - "lru-cache": "^7.5.1" + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" + "node": ">=14.14" } }, - "node_modules/npm-check-updates/node_modules/locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "node_modules/nx/node_modules/glob": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", + "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", "dev": true, "dependencies": { - "p-locate": "^5.0.0" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" }, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": "*" } }, - "node_modules/npm-check-updates/node_modules/lru-cache": { - "version": "7.10.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.10.1.tgz", - "integrity": "sha512-BQuhQxPuRl79J5zSXRP+uNzPOyZw2oFI9JLRQ80XswSvg21KMKNtQza9eF42rfI/3Z40RvzBdXgziEkudzjo8A==", + "node_modules/nx/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, "engines": { - "node": ">=12" + "node": ">= 6" } }, - "node_modules/npm-check-updates/node_modules/minimatch": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", - "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", + "node_modules/nx/node_modules/lines-and-columns": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-2.0.3.tgz", + "integrity": "sha512-cNOjgCnLB+FnvWWtyRTzmB3POJ+cXxTA81LoW7u8JdmhfXzriropYwpjShnz1QLLWsQwY7nIxoDmcPTwphDK9w==", "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, "engines": { - "node": ">=10" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } }, - "node_modules/npm-check-updates/node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "node_modules/nx/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, "dependencies": { - "yocto-queue": "^0.1.0" + "yallist": "^4.0.0" }, "engines": { "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/npm-check-updates/node_modules/p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "node_modules/nx/node_modules/minimatch": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.5.tgz", + "integrity": "sha512-tUpxzX0VAzJHjLu0xUfFv1gwVp9ba3IOuRAVH2EGuRW8a5emA2FlACLqiT/lDVtS1W+TGNwqz3sWaNyLgDJWuw==", "dev": true, "dependencies": { - "p-limit": "^3.0.2" + "brace-expansion": "^1.1.7" }, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": "*" } }, - "node_modules/npm-check-updates/node_modules/semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "node_modules/nx/node_modules/semver": { + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", + "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -6672,588 +6929,552 @@ "node": ">=10" } }, - "node_modules/npm-check-updates/node_modules/semver/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "node_modules/nx/node_modules/tmp": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", + "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", "dev": true, "dependencies": { - "yallist": "^4.0.0" + "rimraf": "^3.0.0" }, "engines": { - "node": ">=10" + "node": ">=8.17.0" } }, - "node_modules/npm-check-updates/node_modules/yaml": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.1.1.tgz", - "integrity": "sha512-o96x3OPo8GjWeSLF+wOAbrPfhFOGY0W00GNaxCDv+9hkcDJEnev1yh8S7pgHF0ik6zc8sQLuL8hjHjJULZp8bw==", + "node_modules/nx/node_modules/yargs": { + "version": "17.6.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.6.2.tgz", + "integrity": "sha512-1/9UrdHjDZc0eOU0HxOHoS78C69UD3JRMvzlJ7S79S2nTaWRA/whGCTV8o9e/N/1Va9YIV7Q4sOxD8VV4pCWOw==", "dev": true, + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, "engines": { - "node": ">= 14" + "node": ">=12" } }, - "node_modules/npm-install-checks": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/npm-install-checks/-/npm-install-checks-5.0.0.tgz", - "integrity": "sha512-65lUsMI8ztHCxFz5ckCEC44DRvEGdZX5usQFriauxHEwt7upv1FKaQEmAtU0YnOAdwuNWCmk64xYiQABNrEyLA==", + "node_modules/nx/node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", "dev": true, - "dependencies": { - "semver": "^7.1.1" - }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": ">=12" } }, - "node_modules/npm-normalize-package-bin": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz", - "integrity": "sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==", - "dev": true - }, - "node_modules/npm-package-arg": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-8.1.1.tgz", - "integrity": "sha512-CsP95FhWQDwNqiYS+Q0mZ7FAEDytDZAkNxQqea6IaAFJTAY9Lhhqyl0irU/6PMc7BGfUmnsbHcqxJD7XuVM/rg==", + "node_modules/nx/node_modules/yargs/node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", "dev": true, "dependencies": { - "hosted-git-info": "^3.0.6", - "semver": "^7.0.0", - "validate-npm-package-name": "^3.0.0" + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" }, "engines": { - "node": ">=10" + "node": ">=12" } }, - "node_modules/npm-package-arg/node_modules/builtins": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/builtins/-/builtins-1.0.3.tgz", - "integrity": "sha512-uYBjakWipfaO/bXI7E8rq6kpwHRZK5cNYrUv2OzZSI/FvmdMyXJ2tG9dKcjEC5YHmHpUAwsargWIZNWdxb/bnQ==", - "dev": true + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "dependencies": { + "wrappy": "1" + } }, - "node_modules/npm-package-arg/node_modules/hosted-git-info": { - "version": "3.0.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-3.0.8.tgz", - "integrity": "sha512-aXpmwoOhRBrw6X3j0h5RloK4x1OzsxMPyxqIHyNfSe2pypkVTZFpEiRoSipPEPlMrh0HW/XsjkJ5WgnCirpNUw==", + "node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", "dev": true, "dependencies": { - "lru-cache": "^6.0.0" + "mimic-fn": "^2.1.0" }, "engines": { - "node": ">=10" + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/npm-package-arg/node_modules/validate-npm-package-name": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-3.0.0.tgz", - "integrity": "sha512-M6w37eVCMMouJ9V/sdPGnC5H4uDr73/+xdq0FBLO3TFFX1+7wiUY6Es328NN+y43tmY+doUdN9g9J21vqB7iLw==", + "node_modules/open": { + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/open/-/open-8.4.1.tgz", + "integrity": "sha512-/4b7qZNhv6Uhd7jjnREh1NjnPxlTq+XNWPG88Ydkj5AILcA5m3ajvcg57pB24EQjKv0dK62XnDqk9c/hkIG5Kg==", "dev": true, "dependencies": { - "builtins": "^1.0.3" - } - }, - "node_modules/npm-packlist": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-5.1.1.tgz", - "integrity": "sha512-UfpSvQ5YKwctmodvPPkK6Fwk603aoVsf8AEbmVKAEECrfvL8SSe1A2YIwrJ6xmTHAITKPwwZsWo7WwEbNk0kxw==", - "dev": true, - "dependencies": { - "glob": "^8.0.1", - "ignore-walk": "^5.0.1", - "npm-bundled": "^1.1.2", - "npm-normalize-package-bin": "^1.0.1" - }, - "bin": { - "npm-packlist": "bin/index.js" + "define-lazy-prop": "^2.0.0", + "is-docker": "^2.1.1", + "is-wsl": "^2.2.0" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/npm-packlist/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "node_modules/optionator": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", "dev": true, "dependencies": { - "balanced-match": "^1.0.0" + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + }, + "engines": { + "node": ">= 0.8.0" } }, - "node_modules/npm-packlist/node_modules/glob": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz", - "integrity": "sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==", + "node_modules/ora": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", + "integrity": "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==", "dev": true, "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^5.0.1", - "once": "^1.3.0" + "bl": "^4.1.0", + "chalk": "^4.1.0", + "cli-cursor": "^3.1.0", + "cli-spinners": "^2.5.0", + "is-interactive": "^1.0.0", + "is-unicode-supported": "^0.1.0", + "log-symbols": "^4.1.0", + "strip-ansi": "^6.0.0", + "wcwidth": "^1.0.1" }, "engines": { - "node": ">=12" + "node": ">=10" }, "funding": { - "url": "https://github.com/sponsors/isaacs" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/npm-packlist/node_modules/minimatch": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", - "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", + "node_modules/os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, "engines": { - "node": ">=10" + "node": ">=0.10.0" } }, - "node_modules/npm-pick-manifest": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-7.0.1.tgz", - "integrity": "sha512-IA8+tuv8KujbsbLQvselW2XQgmXWS47t3CB0ZrzsRZ82DbDfkcFunOaPm4X7qNuhMfq+FmV7hQT4iFVpHqV7mg==", + "node_modules/p-cancelable": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-3.0.0.tgz", + "integrity": "sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==", + "dev": true, + "engines": { + "node": ">=12.20" + } + }, + "node_modules/p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, "dependencies": { - "npm-install-checks": "^5.0.0", - "npm-normalize-package-bin": "^1.0.1", - "npm-package-arg": "^9.0.0", - "semver": "^7.3.5" + "yocto-queue": "^0.1.0" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/npm-pick-manifest/node_modules/hosted-git-info": { + "node_modules/p-locate": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.0.0.tgz", - "integrity": "sha512-rRnjWu0Bxj+nIfUOkz0695C0H6tRrN5iYIzYejb0tDEefe2AekHu/U5Kn9pEie5vsJqpNQU02az7TGSH3qpz4Q==", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, "dependencies": { - "lru-cache": "^7.5.1" + "p-limit": "^3.0.2" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/npm-pick-manifest/node_modules/lru-cache": { - "version": "7.12.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.12.0.tgz", - "integrity": "sha512-OIP3DwzRZDfLg9B9VP/huWBlpvbkmbfiBy8xmsXp4RPmE4A3MhwNozc5ZJ3fWnSg8fDcdlE/neRTPG2ycEKliw==", + "node_modules/p-map": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", + "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", "dev": true, + "dependencies": { + "aggregate-error": "^3.0.0" + }, "engines": { - "node": ">=12" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/npm-pick-manifest/node_modules/npm-package-arg": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-9.1.0.tgz", - "integrity": "sha512-4J0GL+u2Nh6OnhvUKXRr2ZMG4lR8qtLp+kv7UiV00Y+nGiSxtttCyIRHCt5L5BNkXQld/RceYItau3MDOoGiBw==", + "node_modules/p-map-series": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-map-series/-/p-map-series-2.1.0.tgz", + "integrity": "sha512-RpYIIK1zXSNEOdwxcfe7FdvGcs7+y5n8rifMhMNWvaxRNMPINJHF5GDeuVxWqnfrcHPSCnp7Oo5yNXHId9Av2Q==", "dev": true, - "dependencies": { - "hosted-git-info": "^5.0.0", - "proc-log": "^2.0.1", - "semver": "^7.3.5", - "validate-npm-package-name": "^4.0.0" - }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": ">=8" } }, - "node_modules/npm-registry-fetch": { - "version": "13.3.0", - "resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-13.3.0.tgz", - "integrity": "sha512-10LJQ/1+VhKrZjIuY9I/+gQTvumqqlgnsCufoXETHAPFTS3+M+Z5CFhZRDHGavmJ6rOye3UvNga88vl8n1r6gg==", + "node_modules/p-pipe": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-pipe/-/p-pipe-3.1.0.tgz", + "integrity": "sha512-08pj8ATpzMR0Y80x50yJHn37NF6vjrqHutASaX5LiH5npS9XPvrUmscd9MF5R4fuYRHOxQR1FfMIlF7AzwoPqw==", "dev": true, - "dependencies": { - "make-fetch-happen": "^10.0.6", - "minipass": "^3.1.6", - "minipass-fetch": "^2.0.3", - "minipass-json-stream": "^1.0.1", - "minizlib": "^2.1.2", - "npm-package-arg": "^9.0.1", - "proc-log": "^2.0.0" - }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/npm-registry-fetch/node_modules/hosted-git-info": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.0.0.tgz", - "integrity": "sha512-rRnjWu0Bxj+nIfUOkz0695C0H6tRrN5iYIzYejb0tDEefe2AekHu/U5Kn9pEie5vsJqpNQU02az7TGSH3qpz4Q==", + "node_modules/p-queue": { + "version": "6.6.2", + "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-6.6.2.tgz", + "integrity": "sha512-RwFpb72c/BhQLEXIZ5K2e+AhgNVmIejGlTgiB9MzZ0e93GRvqZ7uSi0dvRF7/XIXDeNkra2fNHBxTyPDGySpjQ==", "dev": true, "dependencies": { - "lru-cache": "^7.5.1" + "eventemitter3": "^4.0.4", + "p-timeout": "^3.2.0" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/npm-registry-fetch/node_modules/lru-cache": { - "version": "7.13.2", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.13.2.tgz", - "integrity": "sha512-VJL3nIpA79TodY/ctmZEfhASgqekbT574/c4j3jn4bKXbSCnTTCH/KltZyvL2GlV+tGSMtsWyem8DCX7qKTMBA==", + "node_modules/p-reduce": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-reduce/-/p-reduce-2.1.0.tgz", + "integrity": "sha512-2USApvnsutq8uoxZBGbbWM0JIYLiEMJ9RlaN7fAzVNb9OZN0SHjjTTfIcb667XynS5Y1VhwDJVDa72TnPzAYWw==", "dev": true, "engines": { - "node": ">=12" + "node": ">=8" } }, - "node_modules/npm-registry-fetch/node_modules/npm-package-arg": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-9.1.0.tgz", - "integrity": "sha512-4J0GL+u2Nh6OnhvUKXRr2ZMG4lR8qtLp+kv7UiV00Y+nGiSxtttCyIRHCt5L5BNkXQld/RceYItau3MDOoGiBw==", + "node_modules/p-timeout": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-3.2.0.tgz", + "integrity": "sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg==", "dev": true, "dependencies": { - "hosted-git-info": "^5.0.0", - "proc-log": "^2.0.1", - "semver": "^7.3.5", - "validate-npm-package-name": "^4.0.0" + "p-finally": "^1.0.0" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": ">=8" } }, - "node_modules/npm-run-path": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", - "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/p-waterfall": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/p-waterfall/-/p-waterfall-2.1.1.tgz", + "integrity": "sha512-RRTnDb2TBG/epPRI2yYXsimO0v3BXC8Yd3ogr1545IaqKK17VGhbWVeGGN+XfCm/08OK8635nH31c8bATkHuSw==", "dev": true, "dependencies": { - "path-key": "^3.0.0" + "p-reduce": "^2.0.0" }, "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/npmlog": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-6.0.2.tgz", - "integrity": "sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg==", + "node_modules/package-json": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/package-json/-/package-json-8.1.0.tgz", + "integrity": "sha512-hySwcV8RAWeAfPsXb9/HGSPn8lwDnv6fabH+obUZKX169QknRkRhPxd1yMubpKDskLFATkl3jHpNtVtDPFA0Wg==", "dev": true, "dependencies": { - "are-we-there-yet": "^3.0.0", - "console-control-strings": "^1.1.0", - "gauge": "^4.0.3", - "set-blocking": "^2.0.0" + "got": "^12.1.0", + "registry-auth-token": "^5.0.1", + "registry-url": "^6.0.0", + "semver": "^7.3.7" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/nx": { - "version": "14.4.3", - "resolved": "https://registry.npmjs.org/nx/-/nx-14.4.3.tgz", - "integrity": "sha512-XPaoEAfJI9056qdwTvkutQSwwA3iihqNDwhvk3dmgpT35j8Uzm/y67goACaCUBCjP2dIQqXfNfJVWQIpcG3MTw==", + "node_modules/pacote": { + "version": "13.6.1", + "resolved": "https://registry.npmjs.org/pacote/-/pacote-13.6.1.tgz", + "integrity": "sha512-L+2BI1ougAPsFjXRyBhcKmfT016NscRFLv6Pz5EiNf1CCFJFU0pSKKQwsZTyAQB+sTuUL4TyFyp6J1Ork3dOqw==", "dev": true, - "hasInstallScript": true, "dependencies": { - "@nrwl/cli": "14.4.3", - "@nrwl/tao": "14.4.3", - "@parcel/watcher": "2.0.4", - "chalk": "4.1.0", - "chokidar": "^3.5.1", - "cli-cursor": "3.1.0", - "cli-spinners": "2.6.1", - "cliui": "^7.0.2", - "dotenv": "~10.0.0", - "enquirer": "~2.3.6", - "fast-glob": "3.2.7", - "figures": "3.2.0", - "flat": "^5.0.2", - "fs-extra": "^10.1.0", - "glob": "7.1.4", - "ignore": "^5.0.4", - "js-yaml": "4.1.0", - "jsonc-parser": "3.0.0", - "minimatch": "3.0.5", - "npm-run-path": "^4.0.1", - "open": "^8.4.0", - "semver": "7.3.4", - "string-width": "^4.2.3", - "tar-stream": "~2.2.0", - "tmp": "~0.2.1", - "tsconfig-paths": "^3.9.0", - "tslib": "^2.3.0", - "v8-compile-cache": "2.3.0", - "yargs": "^17.4.0", - "yargs-parser": "21.0.1" + "@npmcli/git": "^3.0.0", + "@npmcli/installed-package-contents": "^1.0.7", + "@npmcli/promise-spawn": "^3.0.0", + "@npmcli/run-script": "^4.1.0", + "cacache": "^16.0.0", + "chownr": "^2.0.0", + "fs-minipass": "^2.1.0", + "infer-owner": "^1.0.4", + "minipass": "^3.1.6", + "mkdirp": "^1.0.4", + "npm-package-arg": "^9.0.0", + "npm-packlist": "^5.1.0", + "npm-pick-manifest": "^7.0.0", + "npm-registry-fetch": "^13.0.1", + "proc-log": "^2.0.0", + "promise-retry": "^2.0.1", + "read-package-json": "^5.0.0", + "read-package-json-fast": "^2.0.3", + "rimraf": "^3.0.2", + "ssri": "^9.0.0", + "tar": "^6.1.11" }, "bin": { - "nx": "bin/nx.js" - }, - "peerDependencies": { - "@swc-node/register": "^1.4.2", - "@swc/core": "^1.2.173" + "pacote": "lib/bin.js" }, - "peerDependenciesMeta": { - "@swc-node/register": { - "optional": true - }, - "@swc/core": { - "optional": true - } + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/nx/node_modules/chalk": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "node_modules/pacote/node_modules/hosted-git-info": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.2.1.tgz", + "integrity": "sha512-xIcQYMnhcx2Nr4JTjsFmwwnr9vldugPy9uVm0o87bjqqWMv9GaqsTeT+i99wTl0mk1uLxJtHxLb8kymqTENQsw==", "dev": true, "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" + "lru-cache": "^7.5.1" }, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/nx/node_modules/fast-glob": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.7.tgz", - "integrity": "sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q==", + "node_modules/pacote/node_modules/npm-package-arg": { + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-9.1.2.tgz", + "integrity": "sha512-pzd9rLEx4TfNJkovvlBSLGhq31gGu2QDexFPWT19yCDh0JgnRhlBLNo5759N0AJmBk+kQ9Y/hXoLnlgFD+ukmg==", "dev": true, "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" + "hosted-git-info": "^5.0.0", + "proc-log": "^2.0.1", + "semver": "^7.3.5", + "validate-npm-package-name": "^4.0.0" }, "engines": { - "node": ">=8" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/nx/node_modules/fs-extra": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", - "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", "dev": true, "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" + "callsites": "^3.0.0" }, "engines": { - "node": ">=12" + "node": ">=6" } }, - "node_modules/nx/node_modules/glob": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", - "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", + "node_modules/parse-conflict-json": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/parse-conflict-json/-/parse-conflict-json-2.0.2.tgz", + "integrity": "sha512-jDbRGb00TAPFsKWCpZZOT93SxVP9nONOSgES3AevqRq/CHvavEBvKAjxX9p5Y5F0RZLxH9Ufd9+RwtCsa+lFDA==", "dev": true, "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "json-parse-even-better-errors": "^2.3.1", + "just-diff": "^5.0.1", + "just-diff-apply": "^5.2.0" }, "engines": { - "node": "*" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/nx/node_modules/jsonc-parser": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.0.0.tgz", - "integrity": "sha512-fQzRfAbIBnR0IQvftw9FJveWiHp72Fg20giDrHz6TdfB12UH/uue0D3hm57UB5KgAVuniLMCaS8P1IMj9NR7cA==", - "dev": true - }, - "node_modules/nx/node_modules/minimatch": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.5.tgz", - "integrity": "sha512-tUpxzX0VAzJHjLu0xUfFv1gwVp9ba3IOuRAVH2EGuRW8a5emA2FlACLqiT/lDVtS1W+TGNwqz3sWaNyLgDJWuw==", + "node_modules/parse-github-url": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/parse-github-url/-/parse-github-url-1.0.2.tgz", + "integrity": "sha512-kgBf6avCbO3Cn6+RnzRGLkUsv4ZVqv/VfAYkRsyBcgkshNvVBkRn1FEZcW0Jb+npXQWm2vHPnnOqFteZxRRGNw==", "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" + "bin": { + "parse-github-url": "cli.js" }, "engines": { - "node": "*" + "node": ">=0.10.0" } }, - "node_modules/nx/node_modules/semver": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", - "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", + "node_modules/parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", "dev": true, "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" }, "engines": { - "node": ">=10" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/nx/node_modules/tmp": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", - "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", + "node_modules/parse-path": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/parse-path/-/parse-path-7.0.0.tgz", + "integrity": "sha512-Euf9GG8WT9CdqwuWJGdf3RkUcTBArppHABkO7Lm8IzRQp0e2r/kkFnmhu4TSK30Wcu5rVAZLmfPKSBBi9tWFog==", "dev": true, "dependencies": { - "rimraf": "^3.0.0" - }, - "engines": { - "node": ">=8.17.0" + "protocols": "^2.0.0" } }, - "node_modules/nx/node_modules/tslib": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", - "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==", - "dev": true - }, - "node_modules/nx/node_modules/yargs": { - "version": "17.5.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.5.1.tgz", - "integrity": "sha512-t6YAJcxDkNX7NFYiVtKvWUz8l+PaKTLiL63mJYWR2GnHq2gjEWISzsLp9wg3aY36dY1j+gfIEL3pIF+XlJJfbA==", + "node_modules/parse-url": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/parse-url/-/parse-url-8.1.0.tgz", + "integrity": "sha512-xDvOoLU5XRrcOZvnI6b8zA6n9O9ejNk/GExuz1yBuWUGn9KA97GI6HTs6u02wKara1CeVmZhH+0TZFdWScR89w==", "dev": true, "dependencies": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.0.0" - }, + "parse-path": "^7.0.0" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, "engines": { - "node": ">=12" + "node": ">=8" } }, - "node_modules/nx/node_modules/yargs-parser": { - "version": "21.0.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.0.1.tgz", - "integrity": "sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg==", + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "dev": true, "engines": { - "node": ">=12" + "node": ">=0.10.0" } }, - "node_modules/object-hash": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-1.3.1.tgz", - "integrity": "sha512-OSuu/pU4ENM9kmREg0BdNrUDIl1heYa4mBZacJc+vVWz4GtAwu7jO8s4AIt2aGRUTqxykpWzI3Oqnsm13tTMDA==", + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, "engines": { - "node": ">= 0.10.0" + "node": ">=8" } }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", "dev": true, - "dependencies": { - "wrappy": "1" + "engines": { + "node": ">=8" } }, - "node_modules/onetime": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "dev": true, - "dependencies": { - "mimic-fn": "^2.1.0" - }, "engines": { - "node": ">=6" + "node": ">=8.6" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/open": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/open/-/open-8.4.0.tgz", - "integrity": "sha512-XgFPPM+B28FtCCgSb9I+s9szOC1vZRSwgWsRUA5ylIxRTgKozqjOCrVOqGsYABPYK5qnfqClxZTFBa8PKt2v6Q==", + "node_modules/pify": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-5.0.0.tgz", + "integrity": "sha512-eW/gHNMlxdSP6dmG6uJip6FXN0EQBwm2clYYd8Wul42Cwu/DK8HEftzsapcNdYe2MfLiIwZqsDk2RDEsTE79hA==", "dev": true, - "dependencies": { - "define-lazy-prop": "^2.0.0", - "is-docker": "^2.1.1", - "is-wsl": "^2.2.0" - }, "engines": { - "node": ">=12" + "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/optionator": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "node_modules/pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", "dev": true, "dependencies": { - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.3" + "find-up": "^4.0.0" }, "engines": { - "node": ">= 0.8.0" + "node": ">=8" } }, - "node_modules/ora": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", - "integrity": "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==", + "node_modules/pkg-dir/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, "dependencies": { - "bl": "^4.1.0", - "chalk": "^4.1.0", - "cli-cursor": "^3.1.0", - "cli-spinners": "^2.5.0", - "is-interactive": "^1.0.0", - "is-unicode-supported": "^0.1.0", - "log-symbols": "^4.1.0", - "strip-ansi": "^6.0.0", - "wcwidth": "^1.0.1" - }, - "engines": { - "node": ">=10" + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/p-cancelable": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-3.0.0.tgz", - "integrity": "sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==", - "dev": true, "engines": { - "node": ">=12.20" + "node": ">=8" } }, - "node_modules/p-finally": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "node_modules/pkg-dir/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, + "dependencies": { + "p-locate": "^4.1.0" + }, "engines": { - "node": ">=4" + "node": ">=8" } }, - "node_modules/p-limit": { + "node_modules/pkg-dir/node_modules/p-limit": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", @@ -7268,7 +7489,7 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/p-locate": { + "node_modules/pkg-dir/node_modules/p-locate": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", @@ -7280,1936 +7501,1874 @@ "node": ">=8" } }, - "node_modules/p-map": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", - "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true, - "dependencies": { - "aggregate-error": "^3.0.0" + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/prettier": { + "version": "2.8.4", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.4.tgz", + "integrity": "sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw==", + "dev": true, + "bin": { + "prettier": "bin-prettier.js" }, "engines": { - "node": ">=10" + "node": ">=10.13.0" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/prettier/prettier?sponsor=1" } }, - "node_modules/p-map-series": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-map-series/-/p-map-series-2.1.0.tgz", - "integrity": "sha512-RpYIIK1zXSNEOdwxcfe7FdvGcs7+y5n8rifMhMNWvaxRNMPINJHF5GDeuVxWqnfrcHPSCnp7Oo5yNXHId9Av2Q==", + "node_modules/proc-log": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-2.0.1.tgz", + "integrity": "sha512-Kcmo2FhfDTXdcbfDH76N7uBYHINxc/8GW7UAVuVP9I+Va3uHSerrnKV6dLooga/gh7GlgzuCCr/eoldnL1muGw==", "dev": true, "engines": { - "node": ">=8" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/p-pipe": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-pipe/-/p-pipe-3.1.0.tgz", - "integrity": "sha512-08pj8ATpzMR0Y80x50yJHn37NF6vjrqHutASaX5LiH5npS9XPvrUmscd9MF5R4fuYRHOxQR1FfMIlF7AzwoPqw==", + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true + }, + "node_modules/progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", "dev": true, "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=0.4.0" } }, - "node_modules/p-queue": { - "version": "6.6.2", - "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-6.6.2.tgz", - "integrity": "sha512-RwFpb72c/BhQLEXIZ5K2e+AhgNVmIejGlTgiB9MzZ0e93GRvqZ7uSi0dvRF7/XIXDeNkra2fNHBxTyPDGySpjQ==", + "node_modules/promise-all-reject-late": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/promise-all-reject-late/-/promise-all-reject-late-1.0.1.tgz", + "integrity": "sha512-vuf0Lf0lOxyQREH7GDIOUMLS7kz+gs8i6B+Yi8dC68a2sychGrHTJYghMBD6k7eUcH0H5P73EckCA48xijWqXw==", "dev": true, - "dependencies": { - "eventemitter3": "^4.0.4", - "p-timeout": "^3.2.0" - }, - "engines": { - "node": ">=8" - }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/p-reduce": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-reduce/-/p-reduce-2.1.0.tgz", - "integrity": "sha512-2USApvnsutq8uoxZBGbbWM0JIYLiEMJ9RlaN7fAzVNb9OZN0SHjjTTfIcb667XynS5Y1VhwDJVDa72TnPzAYWw==", + "node_modules/promise-call-limit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/promise-call-limit/-/promise-call-limit-1.0.1.tgz", + "integrity": "sha512-3+hgaa19jzCGLuSCbieeRsu5C2joKfYn8pY6JAuXFRVfF4IO+L7UPpFWNTeWT9pM7uhskvbPPd/oEOktCn317Q==", "dev": true, - "engines": { - "node": ">=8" + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/p-timeout": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-3.2.0.tgz", - "integrity": "sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg==", + "node_modules/promise-inflight": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", + "integrity": "sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==", + "dev": true + }, + "node_modules/promise-retry": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz", + "integrity": "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==", "dev": true, "dependencies": { - "p-finally": "^1.0.0" + "err-code": "^2.0.2", + "retry": "^0.12.0" }, "engines": { - "node": ">=8" + "node": ">=10" } }, - "node_modules/p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "node_modules/prompts-ncu": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/prompts-ncu/-/prompts-ncu-2.5.1.tgz", + "integrity": "sha512-Hdd7GgV7b76Yh9FP9HL1D9xqtJCJdVPpiM2vDtuoc8W1KfweJe15gutFYmxkq83ViFaagFM8K0UcPCQ/tZq8bA==", "dev": true, + "dependencies": { + "kleur": "^4.0.1", + "sisteransi": "^1.0.5" + }, "engines": { - "node": ">=6" + "node": ">= 6" } }, - "node_modules/p-waterfall": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/p-waterfall/-/p-waterfall-2.1.1.tgz", - "integrity": "sha512-RRTnDb2TBG/epPRI2yYXsimO0v3BXC8Yd3ogr1545IaqKK17VGhbWVeGGN+XfCm/08OK8635nH31c8bATkHuSw==", + "node_modules/promzard": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/promzard/-/promzard-0.3.0.tgz", + "integrity": "sha512-JZeYqd7UAcHCwI+sTOeUDYkvEU+1bQ7iE0UT1MgB/tERkAPkesW46MrpIySzODi+owTjZtiF8Ay5j9m60KmMBw==", "dev": true, "dependencies": { - "p-reduce": "^2.0.0" - }, + "read": "1" + } + }, + "node_modules/proto-list": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", + "integrity": "sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==", + "dev": true + }, + "node_modules/protocols": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/protocols/-/protocols-2.0.1.tgz", + "integrity": "sha512-/XJ368cyBJ7fzLMwLKv1e4vLxOju2MNAIokcr7meSaNcVbWz/CPcW22cP04mwxOErdA5mwjA8Q6w/cdAQxVn7Q==", + "dev": true + }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "dev": true + }, + "node_modules/punycode": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", + "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", + "dev": true, "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=6" } }, - "node_modules/package-json": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/package-json/-/package-json-8.1.0.tgz", - "integrity": "sha512-hySwcV8RAWeAfPsXb9/HGSPn8lwDnv6fabH+obUZKX169QknRkRhPxd1yMubpKDskLFATkl3jHpNtVtDPFA0Wg==", + "node_modules/pupa": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/pupa/-/pupa-3.1.0.tgz", + "integrity": "sha512-FLpr4flz5xZTSJxSeaheeMKN/EDzMdK7b8PTOC6a5PYFKTucWbdqjgqaEyH0shFiSJrVB1+Qqi4Tk19ccU6Aug==", "dev": true, "dependencies": { - "got": "^12.1.0", - "registry-auth-token": "^5.0.1", - "registry-url": "^6.0.0", - "semver": "^7.3.7" + "escape-goat": "^4.0.0" }, "engines": { - "node": ">=14.16" + "node": ">=12.20" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/package-json/node_modules/semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "node_modules/q": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", + "integrity": "sha512-kV/CThkXo6xyFEZUugw/+pIOywXcDbFYgSct5cT3gqlbkBE1SJdwy6UQoZvodiWF/ckQLZyDE/Bu1M6gVu5lVw==", "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, "engines": { - "node": ">=10" + "node": ">=0.6.0", + "teleport": ">=0.2.0" } }, - "node_modules/pacote": { - "version": "13.6.1", - "resolved": "https://registry.npmjs.org/pacote/-/pacote-13.6.1.tgz", - "integrity": "sha512-L+2BI1ougAPsFjXRyBhcKmfT016NscRFLv6Pz5EiNf1CCFJFU0pSKKQwsZTyAQB+sTuUL4TyFyp6J1Ork3dOqw==", + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", "dev": true, - "dependencies": { - "@npmcli/git": "^3.0.0", - "@npmcli/installed-package-contents": "^1.0.7", - "@npmcli/promise-spawn": "^3.0.0", - "@npmcli/run-script": "^4.1.0", - "cacache": "^16.0.0", - "chownr": "^2.0.0", - "fs-minipass": "^2.1.0", - "infer-owner": "^1.0.4", - "minipass": "^3.1.6", - "mkdirp": "^1.0.4", - "npm-package-arg": "^9.0.0", - "npm-packlist": "^5.1.0", - "npm-pick-manifest": "^7.0.0", - "npm-registry-fetch": "^13.0.1", - "proc-log": "^2.0.0", - "promise-retry": "^2.0.1", - "read-package-json": "^5.0.0", - "read-package-json-fast": "^2.0.3", - "rimraf": "^3.0.2", - "ssri": "^9.0.0", - "tar": "^6.1.11" + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/quick-lru": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz", + "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "dev": true, + "dependencies": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" }, "bin": { - "pacote": "lib/bin.js" + "rc": "cli.js" + } + }, + "node_modules/rc-config-loader": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/rc-config-loader/-/rc-config-loader-4.1.2.tgz", + "integrity": "sha512-qKTnVWFl9OQYKATPzdfaZIbTxcHziQl92zYSxYC6umhOqyAsoj8H8Gq/+aFjAso68sBdjTz3A7omqeAkkF1MWg==", + "dev": true, + "dependencies": { + "debug": "^4.3.4", + "js-yaml": "^4.1.0", + "json5": "^2.2.2", + "require-from-string": "^2.0.2" + } + }, + "node_modules/rc/node_modules/strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/read": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/read/-/read-1.0.7.tgz", + "integrity": "sha512-rSOKNYUmaxy0om1BNjMN4ezNT6VKK+2xF4GBhc81mkH7L60i6dp8qPYrkndNLT3QPphoII3maL9PVC9XmhHwVQ==", + "dev": true, + "dependencies": { + "mute-stream": "~0.0.4" }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/read-cmd-shim": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-cmd-shim/-/read-cmd-shim-3.0.0.tgz", + "integrity": "sha512-KQDVjGqhZk92PPNRj9ZEXEuqg8bUobSKRw+q0YQ3TKI5xkce7bUJobL4Z/OtiEbAAv70yEpYIXp4iQ9L8oPVog==", + "dev": true, "engines": { "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/pacote/node_modules/@npmcli/git": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@npmcli/git/-/git-3.0.1.tgz", - "integrity": "sha512-UU85F/T+F1oVn3IsB/L6k9zXIMpXBuUBE25QDH0SsURwT6IOBqkC7M16uqo2vVZIyji3X1K4XH9luip7YekH1A==", + "node_modules/read-package-json": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-5.0.1.tgz", + "integrity": "sha512-MALHuNgYWdGW3gKzuNMuYtcSSZbGQm94fAp16xt8VsYTLBjUSc55bLMKe6gzpWue0Tfi6CBgwCSdDAqutGDhMg==", "dev": true, "dependencies": { - "@npmcli/promise-spawn": "^3.0.0", - "lru-cache": "^7.4.4", - "mkdirp": "^1.0.4", - "npm-pick-manifest": "^7.0.0", - "proc-log": "^2.0.0", - "promise-inflight": "^1.0.1", - "promise-retry": "^2.0.1", - "semver": "^7.3.5", - "which": "^2.0.2" + "glob": "^8.0.1", + "json-parse-even-better-errors": "^2.3.1", + "normalize-package-data": "^4.0.0", + "npm-normalize-package-bin": "^1.0.1" }, "engines": { "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/pacote/node_modules/hosted-git-info": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.0.0.tgz", - "integrity": "sha512-rRnjWu0Bxj+nIfUOkz0695C0H6tRrN5iYIzYejb0tDEefe2AekHu/U5Kn9pEie5vsJqpNQU02az7TGSH3qpz4Q==", + "node_modules/read-package-json-fast": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/read-package-json-fast/-/read-package-json-fast-2.0.3.tgz", + "integrity": "sha512-W/BKtbL+dUjTuRL2vziuYhp76s5HZ9qQhd/dKfWIZveD0O40453QNyZhC0e63lqZrAQ4jiOapVoeJ7JrszenQQ==", "dev": true, "dependencies": { - "lru-cache": "^7.5.1" + "json-parse-even-better-errors": "^2.3.0", + "npm-normalize-package-bin": "^1.0.1" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" + "node": ">=10" + } + }, + "node_modules/read-package-json/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" } }, - "node_modules/pacote/node_modules/lru-cache": { - "version": "7.10.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.10.1.tgz", - "integrity": "sha512-BQuhQxPuRl79J5zSXRP+uNzPOyZw2oFI9JLRQ80XswSvg21KMKNtQza9eF42rfI/3Z40RvzBdXgziEkudzjo8A==", + "node_modules/read-package-json/node_modules/glob": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + }, "engines": { "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/pacote/node_modules/npm-package-arg": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-9.1.0.tgz", - "integrity": "sha512-4J0GL+u2Nh6OnhvUKXRr2ZMG4lR8qtLp+kv7UiV00Y+nGiSxtttCyIRHCt5L5BNkXQld/RceYItau3MDOoGiBw==", + "node_modules/read-package-json/node_modules/hosted-git-info": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.2.1.tgz", + "integrity": "sha512-xIcQYMnhcx2Nr4JTjsFmwwnr9vldugPy9uVm0o87bjqqWMv9GaqsTeT+i99wTl0mk1uLxJtHxLb8kymqTENQsw==", "dev": true, "dependencies": { - "hosted-git-info": "^5.0.0", - "proc-log": "^2.0.1", - "semver": "^7.3.5", - "validate-npm-package-name": "^4.0.0" + "lru-cache": "^7.5.1" }, "engines": { "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "node_modules/read-package-json/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", "dev": true, "dependencies": { - "callsites": "^3.0.0" + "brace-expansion": "^2.0.1" }, "engines": { - "node": ">=6" + "node": ">=10" } }, - "node_modules/parse-conflict-json": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/parse-conflict-json/-/parse-conflict-json-2.0.2.tgz", - "integrity": "sha512-jDbRGb00TAPFsKWCpZZOT93SxVP9nONOSgES3AevqRq/CHvavEBvKAjxX9p5Y5F0RZLxH9Ufd9+RwtCsa+lFDA==", + "node_modules/read-package-json/node_modules/normalize-package-data": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-4.0.1.tgz", + "integrity": "sha512-EBk5QKKuocMJhB3BILuKhmaPjI8vNRSpIfO9woLC6NyHVkKKdVEdAO1mrT0ZfxNR1lKwCcTkuZfmGIFdizZ8Pg==", "dev": true, "dependencies": { - "json-parse-even-better-errors": "^2.3.1", - "just-diff": "^5.0.1", - "just-diff-apply": "^5.2.0" + "hosted-git-info": "^5.0.0", + "is-core-module": "^2.8.1", + "semver": "^7.3.5", + "validate-npm-package-license": "^3.0.4" }, "engines": { "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/parse-github-url": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/parse-github-url/-/parse-github-url-1.0.2.tgz", - "integrity": "sha512-kgBf6avCbO3Cn6+RnzRGLkUsv4ZVqv/VfAYkRsyBcgkshNvVBkRn1FEZcW0Jb+npXQWm2vHPnnOqFteZxRRGNw==", + "node_modules/read-pkg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha512-BLq/cCO9two+lBgiTYNqD6GdtK8s4NpaWrl6/rCO9w0TUS8oJl7cmToOZfRYllKTISY6nt1U7jQ53brmKqY6BA==", "dev": true, - "bin": { - "parse-github-url": "cli.js" + "dependencies": { + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=4" } }, - "node_modules/parse-json": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", - "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "node_modules/read-pkg-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", + "integrity": "sha512-YFzFrVvpC6frF1sz8psoHDBGF7fLPc+llq/8NB43oagqWkx8ar5zYtsTORtOjw9W2RHLpWP+zTWwBvf1bCmcSw==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.0.0", - "error-ex": "^1.3.1", - "json-parse-even-better-errors": "^2.3.0", - "lines-and-columns": "^1.1.6" + "find-up": "^2.0.0", + "read-pkg": "^3.0.0" }, "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=4" } }, - "node_modules/parse-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/parse-path/-/parse-path-5.0.0.tgz", - "integrity": "sha512-qOpH55/+ZJ4jUu/oLO+ifUKjFPNZGfnPJtzvGzKN/4oLMil5m9OH4VpOj6++9/ytJcfks4kzH2hhi87GL/OU9A==", + "node_modules/read-pkg-up/node_modules/find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==", "dev": true, "dependencies": { - "protocols": "^2.0.0" + "locate-path": "^2.0.0" + }, + "engines": { + "node": ">=4" } }, - "node_modules/parse-url": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/parse-url/-/parse-url-7.0.2.tgz", - "integrity": "sha512-PqO4Z0eCiQ08Wj6QQmrmp5YTTxpYfONdOEamrtvK63AmzXpcavIVQubGHxOEwiIoDZFb8uDOoQFS0NCcjqIYQg==", + "node_modules/read-pkg-up/node_modules/locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==", "dev": true, "dependencies": { - "is-ssh": "^1.4.0", - "normalize-url": "^6.1.0", - "parse-path": "^5.0.0", - "protocols": "^2.0.1" + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + }, + "engines": { + "node": ">=4" } }, - "node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "node_modules/read-pkg-up/node_modules/p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", "dev": true, + "dependencies": { + "p-try": "^1.0.0" + }, "engines": { - "node": ">=8" + "node": ">=4" } }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "node_modules/read-pkg-up/node_modules/p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==", "dev": true, + "dependencies": { + "p-limit": "^1.1.0" + }, "engines": { - "node": ">=0.10.0" + "node": ">=4" } }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "node_modules/read-pkg-up/node_modules/p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==", "dev": true, "engines": { - "node": ">=8" + "node": ">=4" } }, - "node_modules/path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true - }, - "node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "node_modules/read-pkg-up/node_modules/path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", "dev": true, "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" + "node": ">=4" } }, - "node_modules/pify": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-5.0.0.tgz", - "integrity": "sha512-eW/gHNMlxdSP6dmG6uJip6FXN0EQBwm2clYYd8Wul42Cwu/DK8HEftzsapcNdYe2MfLiIwZqsDk2RDEsTE79hA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } + "node_modules/read-pkg/node_modules/hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "dev": true }, - "node_modules/pkg-dir": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "node_modules/read-pkg/node_modules/load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==", "dev": true, "dependencies": { - "find-up": "^4.0.0" + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" }, "engines": { - "node": ">=8" + "node": ">=4" } }, - "node_modules/prelude-ls": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "node_modules/read-pkg/node_modules/normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", "dev": true, - "engines": { - "node": ">= 0.8.0" + "dependencies": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" } }, - "node_modules/prettier": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", - "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==", - "bin": { - "prettier": "bin-prettier.js" + "node_modules/read-pkg/node_modules/parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==", + "dev": true, + "dependencies": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" }, "engines": { - "node": ">=10.13.0" - }, - "funding": { - "url": "https://github.com/prettier/prettier?sponsor=1" + "node": ">=4" } }, - "node_modules/proc-log": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-2.0.1.tgz", - "integrity": "sha512-Kcmo2FhfDTXdcbfDH76N7uBYHINxc/8GW7UAVuVP9I+Va3uHSerrnKV6dLooga/gh7GlgzuCCr/eoldnL1muGw==", + "node_modules/read-pkg/node_modules/path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", "dev": true, + "dependencies": { + "pify": "^3.0.0" + }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": ">=4" } }, - "node_modules/process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "dev": true - }, - "node_modules/progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "node_modules/read-pkg/node_modules/pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", "dev": true, "engines": { - "node": ">=0.4.0" + "node": ">=4" } }, - "node_modules/promise-all-reject-late": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/promise-all-reject-late/-/promise-all-reject-late-1.0.1.tgz", - "integrity": "sha512-vuf0Lf0lOxyQREH7GDIOUMLS7kz+gs8i6B+Yi8dC68a2sychGrHTJYghMBD6k7eUcH0H5P73EckCA48xijWqXw==", + "node_modules/read-pkg/node_modules/semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "dev": true, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "bin": { + "semver": "bin/semver" } }, - "node_modules/promise-call-limit": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/promise-call-limit/-/promise-call-limit-1.0.1.tgz", - "integrity": "sha512-3+hgaa19jzCGLuSCbieeRsu5C2joKfYn8pY6JAuXFRVfF4IO+L7UPpFWNTeWT9pM7uhskvbPPd/oEOktCn317Q==", + "node_modules/read-pkg/node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", "dev": true, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "engines": { + "node": ">=4" } }, - "node_modules/promise-inflight": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", - "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=", - "dev": true - }, - "node_modules/promise-retry": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz", - "integrity": "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==", + "node_modules/read-yaml-file": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/read-yaml-file/-/read-yaml-file-2.1.0.tgz", + "integrity": "sha512-UkRNRIwnhG+y7hpqnycCL/xbTk7+ia9VuVTC0S+zVbwd65DI9eUpRMfsWIGrCWxTU/mi+JW8cHQCrv+zfCbEPQ==", "dev": true, "dependencies": { - "err-code": "^2.0.2", - "retry": "^0.12.0" + "js-yaml": "^4.0.0", + "strip-bom": "^4.0.0" }, "engines": { - "node": ">=10" + "node": ">=10.13" } }, - "node_modules/prompts-ncu": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/prompts-ncu/-/prompts-ncu-2.5.1.tgz", - "integrity": "sha512-Hdd7GgV7b76Yh9FP9HL1D9xqtJCJdVPpiM2vDtuoc8W1KfweJe15gutFYmxkq83ViFaagFM8K0UcPCQ/tZq8bA==", + "node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", "dev": true, "dependencies": { - "kleur": "^4.0.1", - "sisteransi": "^1.0.5" + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" }, "engines": { "node": ">= 6" } }, - "node_modules/promzard": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/promzard/-/promzard-0.3.0.tgz", - "integrity": "sha512-JZeYqd7UAcHCwI+sTOeUDYkvEU+1bQ7iE0UT1MgB/tERkAPkesW46MrpIySzODi+owTjZtiF8Ay5j9m60KmMBw==", + "node_modules/readdir-scoped-modules": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/readdir-scoped-modules/-/readdir-scoped-modules-1.1.0.tgz", + "integrity": "sha512-asaikDeqAQg7JifRsZn1NJZXo9E+VwlyCfbkZhwyISinqk5zNS6266HS5kah6P0SaQKGF6SkNnZVHUzHFYxYDw==", + "deprecated": "This functionality has been moved to @npmcli/fs", "dev": true, "dependencies": { - "read": "1" + "debuglog": "^1.0.1", + "dezalgo": "^1.0.0", + "graceful-fs": "^4.1.2", + "once": "^1.3.0" } }, - "node_modules/proto-list": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", - "integrity": "sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==", - "dev": true - }, - "node_modules/protobufjs": { - "version": "6.11.3", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.3.tgz", - "integrity": "sha512-xL96WDdCZYdU7Slin569tFX712BxsxslWwAfAhCYjQKGTq7dAU91Lomy6nLLhh/dyGhk/YH4TwTSRxTzhuHyZg==", - "hasInstallScript": true, + "node_modules/redent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", + "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", + "dev": true, "dependencies": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/long": "^4.0.1", - "@types/node": ">=13.7.0", - "long": "^4.0.0" + "indent-string": "^4.0.0", + "strip-indent": "^3.0.0" }, - "bin": { - "pbjs": "bin/pbjs", - "pbts": "bin/pbts" + "engines": { + "node": ">=8" } }, - "node_modules/protocols": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/protocols/-/protocols-2.0.1.tgz", - "integrity": "sha512-/XJ368cyBJ7fzLMwLKv1e4vLxOju2MNAIokcr7meSaNcVbWz/CPcW22cP04mwxOErdA5mwjA8Q6w/cdAQxVn7Q==", - "dev": true - }, - "node_modules/pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "node_modules/regexpp": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", "dev": true, - "dependencies": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" } }, - "node_modules/punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "node_modules/registry-auth-token": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-5.0.1.tgz", + "integrity": "sha512-UfxVOj8seK1yaIOiieV4FIP01vfBDLsY0H9sQzi9EbbUdJiuuBjJgLa1DpImXMNPnVkBD4eVxTEXcrZA6kfpJA==", "dev": true, + "dependencies": { + "@pnpm/npm-conf": "^1.0.4" + }, "engines": { - "node": ">=6" + "node": ">=14" } }, - "node_modules/pupa": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/pupa/-/pupa-3.1.0.tgz", - "integrity": "sha512-FLpr4flz5xZTSJxSeaheeMKN/EDzMdK7b8PTOC6a5PYFKTucWbdqjgqaEyH0shFiSJrVB1+Qqi4Tk19ccU6Aug==", + "node_modules/registry-url": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-6.0.1.tgz", + "integrity": "sha512-+crtS5QjFRqFCoQmvGduwYWEBng99ZvmFvF+cUJkGYF1L1BfU8C6Zp9T7f5vPAwyLkUExpvK+ANVZmGU49qi4Q==", "dev": true, "dependencies": { - "escape-goat": "^4.0.0" + "rc": "1.2.8" }, "engines": { - "node": ">=12.20" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/q": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", - "integrity": "sha512-kV/CThkXo6xyFEZUugw/+pIOywXcDbFYgSct5cT3gqlbkBE1SJdwy6UQoZvodiWF/ckQLZyDE/Bu1M6gVu5lVw==", + "node_modules/remote-git-tags": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/remote-git-tags/-/remote-git-tags-3.0.0.tgz", + "integrity": "sha512-C9hAO4eoEsX+OXA4rla66pXZQ+TLQ8T9dttgQj18yuKlPMTVkIkdYXvlMC55IuUsIkV6DpmQYi10JKFLaU+l7w==", "dev": true, "engines": { - "node": ">=0.6.0", - "teleport": ">=0.2.0" + "node": ">=8" } }, - "node_modules/queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] + "engines": { + "node": ">=0.10.0" + } }, - "node_modules/quick-lru": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz", - "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==", + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", "dev": true, "engines": { - "node": ">=8" + "node": ">=0.10.0" } }, - "node_modules/rc": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", - "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "node_modules/resolve": { + "version": "1.22.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", + "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", "dev": true, "dependencies": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" + "is-core-module": "^2.9.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" }, "bin": { - "rc": "cli.js" + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/rc-config-loader": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/rc-config-loader/-/rc-config-loader-4.1.0.tgz", - "integrity": "sha512-aW+kX4qy0CiM9L4fG4Us3oEOpIrOrXzWykAn+xldD07Y9PXWjTH744oHbv0Kc9ZwWaylw3jMjxaf14RgStrNrA==", + "node_modules/resolve-alpn": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.2.1.tgz", + "integrity": "sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==", + "dev": true + }, + "node_modules/resolve-cwd": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", + "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", "dev": true, "dependencies": { - "debug": "^4.1.1", - "js-yaml": "^4.0.0", - "json5": "^2.1.2", - "require-from-string": "^2.0.2" + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" } }, - "node_modules/rc/node_modules/strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", + "node_modules/resolve-cwd/node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, - "node_modules/read": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/read/-/read-1.0.7.tgz", - "integrity": "sha512-rSOKNYUmaxy0om1BNjMN4ezNT6VKK+2xF4GBhc81mkH7L60i6dp8qPYrkndNLT3QPphoII3maL9PVC9XmhHwVQ==", + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true, - "dependencies": { - "mute-stream": "~0.0.4" - }, "engines": { - "node": ">=0.8" + "node": ">=4" } }, - "node_modules/read-cmd-shim": { + "node_modules/responselike": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-cmd-shim/-/read-cmd-shim-3.0.0.tgz", - "integrity": "sha512-KQDVjGqhZk92PPNRj9ZEXEuqg8bUobSKRw+q0YQ3TKI5xkce7bUJobL4Z/OtiEbAAv70yEpYIXp4iQ9L8oPVog==", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-3.0.0.tgz", + "integrity": "sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==", "dev": true, + "dependencies": { + "lowercase-keys": "^3.0.0" + }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/read-package-json": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-5.0.1.tgz", - "integrity": "sha512-MALHuNgYWdGW3gKzuNMuYtcSSZbGQm94fAp16xt8VsYTLBjUSc55bLMKe6gzpWue0Tfi6CBgwCSdDAqutGDhMg==", + "node_modules/restore-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", "dev": true, "dependencies": { - "glob": "^8.0.1", - "json-parse-even-better-errors": "^2.3.1", - "normalize-package-data": "^4.0.0", - "npm-normalize-package-bin": "^1.0.1" + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": ">=8" } }, - "node_modules/read-package-json-fast": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/read-package-json-fast/-/read-package-json-fast-2.0.3.tgz", - "integrity": "sha512-W/BKtbL+dUjTuRL2vziuYhp76s5HZ9qQhd/dKfWIZveD0O40453QNyZhC0e63lqZrAQ4jiOapVoeJ7JrszenQQ==", + "node_modules/retry": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", + "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==", "dev": true, - "dependencies": { - "json-parse-even-better-errors": "^2.3.0", - "npm-normalize-package-bin": "^1.0.1" - }, "engines": { - "node": ">=10" + "node": ">= 4" } }, - "node_modules/read-package-json/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" } }, - "node_modules/read-package-json/node_modules/glob": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz", - "integrity": "sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==", + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", "dev": true, "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^5.0.1", - "once": "^1.3.0" + "glob": "^7.1.3" }, - "engines": { - "node": ">=12" + "bin": { + "rimraf": "bin.js" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/read-package-json/node_modules/hosted-git-info": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.0.0.tgz", - "integrity": "sha512-rRnjWu0Bxj+nIfUOkz0695C0H6tRrN5iYIzYejb0tDEefe2AekHu/U5Kn9pEie5vsJqpNQU02az7TGSH3qpz4Q==", + "node_modules/run-async": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", + "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", "dev": true, - "dependencies": { - "lru-cache": "^7.5.1" - }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" + "node": ">=0.12.0" } }, - "node_modules/read-package-json/node_modules/lru-cache": { - "version": "7.13.2", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.13.2.tgz", - "integrity": "sha512-VJL3nIpA79TodY/ctmZEfhASgqekbT574/c4j3jn4bKXbSCnTTCH/KltZyvL2GlV+tGSMtsWyem8DCX7qKTMBA==", + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", "dev": true, - "engines": { - "node": ">=12" + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" } }, - "node_modules/read-package-json/node_modules/minimatch": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", - "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", + "node_modules/rxjs": { + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.0.tgz", + "integrity": "sha512-F2+gxDshqmIub1KdvZkaEfGDwLNpPvk9Fs6LD/MyQxNgMds/WH9OdDDXOmxUZpME+iSK3rQCctkL0DYyytUqMg==", "dev": true, "dependencies": { - "brace-expansion": "^2.0.1" + "tslib": "^2.1.0" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "node_modules/semver": { + "version": "7.3.8", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", + "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" }, "engines": { "node": ">=10" } }, - "node_modules/read-package-json/node_modules/normalize-package-data": { + "node_modules/semver-diff": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-4.0.0.tgz", - "integrity": "sha512-m+GL22VXJKkKbw62ZaBBjv8u6IE3UI4Mh5QakIqs3fWiKe0Xyi6L97hakwZK41/LD4R/2ly71Bayx0NLMwLA/g==", + "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-4.0.0.tgz", + "integrity": "sha512-0Ju4+6A8iOnpL/Thra7dZsSlOHYAHIeMxfhWQRI1/VLcT3WDBZKKtQt/QkBOsiIN9ZpuvHE6cGZ0x4glCMmfiA==", "dev": true, "dependencies": { - "hosted-git-info": "^5.0.0", - "is-core-module": "^2.8.1", - "semver": "^7.3.5", - "validate-npm-package-license": "^3.0.4" + "semver": "^7.3.5" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/read-pkg": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", - "integrity": "sha512-BLq/cCO9two+lBgiTYNqD6GdtK8s4NpaWrl6/rCO9w0TUS8oJl7cmToOZfRYllKTISY6nt1U7jQ53brmKqY6BA==", - "dev": true, - "dependencies": { - "load-json-file": "^4.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^3.0.0" - }, - "engines": { - "node": ">=4" - } + "node_modules/semver-utils": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/semver-utils/-/semver-utils-1.1.4.tgz", + "integrity": "sha512-EjnoLE5OGmDAVV/8YDoN5KiajNadjzIp9BAHOhYeQHt7j0UWxjmgsx4YD48wp4Ue1Qogq38F1GNUJNqF1kKKxA==", + "dev": true }, - "node_modules/read-pkg-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", - "integrity": "sha512-YFzFrVvpC6frF1sz8psoHDBGF7fLPc+llq/8NB43oagqWkx8ar5zYtsTORtOjw9W2RHLpWP+zTWwBvf1bCmcSw==", + "node_modules/semver/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, "dependencies": { - "find-up": "^2.0.0", - "read-pkg": "^3.0.0" + "yallist": "^4.0.0" }, "engines": { - "node": ">=4" + "node": ">=10" } }, - "node_modules/read-pkg-up/node_modules/find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==", + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", + "dev": true + }, + "node_modules/shallow-clone": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", + "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", "dev": true, "dependencies": { - "locate-path": "^2.0.0" + "kind-of": "^6.0.2" }, "engines": { - "node": ">=4" + "node": ">=8" } }, - "node_modules/read-pkg-up/node_modules/locate-path": { + "node_modules/shebang-command": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, "dependencies": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" + "shebang-regex": "^3.0.0" }, "engines": { - "node": ">=4" + "node": ">=8" } }, - "node_modules/read-pkg-up/node_modules/p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true, - "dependencies": { - "p-try": "^1.0.0" - }, "engines": { - "node": ">=4" + "node": ">=8" } }, - "node_modules/read-pkg-up/node_modules/p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==", + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true + }, + "node_modules/sigstore": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/sigstore/-/sigstore-1.0.0.tgz", + "integrity": "sha512-e+qfbn/zf1+rCza/BhIA//Awmf0v1pa5HQS8Xk8iXrn9bgytytVLqYD0P7NSqZ6IELTgq+tcDvLPkQjNHyWLNg==", "dev": true, "dependencies": { - "p-limit": "^1.1.0" + "make-fetch-happen": "^11.0.1", + "tuf-js": "^1.0.0" + }, + "bin": { + "sigstore": "bin/sigstore.js" }, "engines": { - "node": ">=4" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/read-pkg-up/node_modules/p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==", + "node_modules/sigstore/node_modules/@npmcli/fs": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-3.1.0.tgz", + "integrity": "sha512-7kZUAaLscfgbwBQRbvdMYaZOWyMEcPTH/tJjnyAWJ/dvvs9Ef+CERx/qJb9GExJpl1qipaDGn7KqHnFGGixd0w==", "dev": true, + "dependencies": { + "semver": "^7.3.5" + }, "engines": { - "node": ">=4" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/read-pkg-up/node_modules/path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", + "node_modules/sigstore/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, - "engines": { - "node": ">=4" + "dependencies": { + "balanced-match": "^1.0.0" } }, - "node_modules/read-pkg/node_modules/hosted-git-info": { - "version": "2.8.9", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", - "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", - "dev": true - }, - "node_modules/read-pkg/node_modules/load-json-file": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", - "integrity": "sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==", + "node_modules/sigstore/node_modules/cacache": { + "version": "17.0.4", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-17.0.4.tgz", + "integrity": "sha512-Z/nL3gU+zTUjz5pCA5vVjYM8pmaw2kxM7JEiE0fv3w77Wj+sFbi70CrBruUWH0uNcEdvLDixFpgA2JM4F4DBjA==", "dev": true, "dependencies": { - "graceful-fs": "^4.1.2", - "parse-json": "^4.0.0", - "pify": "^3.0.0", - "strip-bom": "^3.0.0" + "@npmcli/fs": "^3.1.0", + "fs-minipass": "^3.0.0", + "glob": "^8.0.1", + "lru-cache": "^7.7.1", + "minipass": "^4.0.0", + "minipass-collect": "^1.0.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "p-map": "^4.0.0", + "promise-inflight": "^1.0.1", + "ssri": "^10.0.0", + "tar": "^6.1.11", + "unique-filename": "^3.0.0" }, "engines": { - "node": ">=4" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/read-pkg/node_modules/normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "node_modules/sigstore/node_modules/fs-minipass": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-3.0.1.tgz", + "integrity": "sha512-MhaJDcFRTuLidHrIttu0RDGyyXs/IYHVmlcxfLAEFIWjc1vdLAkdwT7Ace2u7DbitWC0toKMl5eJZRYNVreIMw==", "dev": true, "dependencies": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" + "minipass": "^4.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/read-pkg/node_modules/parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==", + "node_modules/sigstore/node_modules/glob": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", "dev": true, "dependencies": { - "error-ex": "^1.3.1", - "json-parse-better-errors": "^1.0.1" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" }, "engines": { - "node": ">=4" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/read-pkg/node_modules/path-type": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", - "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "node_modules/sigstore/node_modules/make-fetch-happen": { + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-11.0.3.tgz", + "integrity": "sha512-oPLh5m10lRNNZDjJ2kP8UpboUx2uFXVaVweVe/lWut4iHWcQEmfqSVJt2ihZsFI8HbpwyyocaXbCAWf0g1ukIA==", "dev": true, "dependencies": { - "pify": "^3.0.0" + "agentkeepalive": "^4.2.1", + "cacache": "^17.0.0", + "http-cache-semantics": "^4.1.1", + "http-proxy-agent": "^5.0.0", + "https-proxy-agent": "^5.0.0", + "is-lambda": "^1.0.1", + "lru-cache": "^7.7.1", + "minipass": "^4.0.0", + "minipass-fetch": "^3.0.0", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^0.6.3", + "promise-retry": "^2.0.1", + "socks-proxy-agent": "^7.0.0", + "ssri": "^10.0.0" }, "engines": { - "node": ">=4" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/read-pkg/node_modules/pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", + "node_modules/sigstore/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, "engines": { - "node": ">=4" - } - }, - "node_modules/read-pkg/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true, - "bin": { - "semver": "bin/semver" + "node": ">=10" } }, - "node_modules/read-pkg/node_modules/strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "node_modules/sigstore/node_modules/minipass": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-4.2.4.tgz", + "integrity": "sha512-lwycX3cBMTvcejsHITUgYj6Gy6A7Nh4Q6h9NP4sTHY1ccJlC7yKzDmiShEHsJ16Jf1nKGDEaiHxiltsJEvk0nQ==", "dev": true, "engines": { - "node": ">=4" + "node": ">=8" } }, - "node_modules/read-yaml-file": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/read-yaml-file/-/read-yaml-file-2.1.0.tgz", - "integrity": "sha512-UkRNRIwnhG+y7hpqnycCL/xbTk7+ia9VuVTC0S+zVbwd65DI9eUpRMfsWIGrCWxTU/mi+JW8cHQCrv+zfCbEPQ==", + "node_modules/sigstore/node_modules/minipass-fetch": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-3.0.1.tgz", + "integrity": "sha512-t9/wowtf7DYkwz8cfMSt0rMwiyNIBXf5CKZ3S5ZMqRqMYT0oLTp0x1WorMI9WTwvaPg21r1JbFxJMum8JrLGfw==", "dev": true, "dependencies": { - "js-yaml": "^4.0.0", - "strip-bom": "^4.0.0" + "minipass": "^4.0.0", + "minipass-sized": "^1.0.3", + "minizlib": "^2.1.2" }, "engines": { - "node": ">=10.13" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + }, + "optionalDependencies": { + "encoding": "^0.1.13" } }, - "node_modules/readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "node_modules/sigstore/node_modules/ssri": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-10.0.1.tgz", + "integrity": "sha512-WVy6di9DlPOeBWEjMScpNipeSX2jIZBGEn5Uuo8Q7aIuFEuDX0pw8RxcOjlD1TWP4obi24ki7m/13+nFpcbXrw==", "dev": true, "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" + "minipass": "^4.0.0" }, "engines": { - "node": ">= 6" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/readdir-scoped-modules": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/readdir-scoped-modules/-/readdir-scoped-modules-1.1.0.tgz", - "integrity": "sha512-asaikDeqAQg7JifRsZn1NJZXo9E+VwlyCfbkZhwyISinqk5zNS6266HS5kah6P0SaQKGF6SkNnZVHUzHFYxYDw==", + "node_modules/sigstore/node_modules/unique-filename": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-3.0.0.tgz", + "integrity": "sha512-afXhuC55wkAmZ0P18QsVE6kp8JaxrEokN2HGIoIVv2ijHQd419H0+6EigAFcIzXeMIkcIkNBpB3L/DXB3cTS/g==", "dev": true, "dependencies": { - "debuglog": "^1.0.1", - "dezalgo": "^1.0.0", - "graceful-fs": "^4.1.2", - "once": "^1.3.0" + "unique-slug": "^4.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "node_modules/sigstore/node_modules/unique-slug": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-4.0.0.tgz", + "integrity": "sha512-WrcA6AyEfqDX5bWige/4NQfPZMtASNVxdmWR76WESYQVAACSgWcR6e9i0mofqqBxYFtL4oAxPIptY73/0YE1DQ==", "dev": true, "dependencies": { - "picomatch": "^2.2.1" + "imurmurhash": "^0.1.4" }, "engines": { - "node": ">=8.10.0" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/redent": { + "node_modules/sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", + "dev": true + }, + "node_modules/slash": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", - "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true, - "dependencies": { - "indent-string": "^4.0.0", - "strip-indent": "^3.0.0" - }, "engines": { "node": ">=8" } }, - "node_modules/regexpp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", - "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", + "node_modules/smart-buffer": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", + "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", "dev": true, "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" + "node": ">= 6.0.0", + "npm": ">= 3.0.0" } }, - "node_modules/registry-auth-token": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-5.0.1.tgz", - "integrity": "sha512-UfxVOj8seK1yaIOiieV4FIP01vfBDLsY0H9sQzi9EbbUdJiuuBjJgLa1DpImXMNPnVkBD4eVxTEXcrZA6kfpJA==", + "node_modules/socks": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz", + "integrity": "sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==", "dev": true, "dependencies": { - "@pnpm/npm-conf": "^1.0.4" + "ip": "^2.0.0", + "smart-buffer": "^4.2.0" }, "engines": { - "node": ">=14" + "node": ">= 10.13.0", + "npm": ">= 3.0.0" } }, - "node_modules/registry-url": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-6.0.1.tgz", - "integrity": "sha512-+crtS5QjFRqFCoQmvGduwYWEBng99ZvmFvF+cUJkGYF1L1BfU8C6Zp9T7f5vPAwyLkUExpvK+ANVZmGU49qi4Q==", + "node_modules/socks-proxy-agent": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-7.0.0.tgz", + "integrity": "sha512-Fgl0YPZ902wEsAyiQ+idGd1A7rSFx/ayC1CQVMw5P+EQx2V0SgpGtf6OKFhVjPflPUl9YMmEOnmfjCdMUsygww==", "dev": true, "dependencies": { - "rc": "1.2.8" + "agent-base": "^6.0.2", + "debug": "^4.3.3", + "socks": "^2.6.2" }, "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">= 10" } }, - "node_modules/remote-git-tags": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remote-git-tags/-/remote-git-tags-3.0.0.tgz", - "integrity": "sha512-C9hAO4eoEsX+OXA4rla66pXZQ+TLQ8T9dttgQj18yuKlPMTVkIkdYXvlMC55IuUsIkV6DpmQYi10JKFLaU+l7w==", + "node_modules/sort-keys": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-2.0.0.tgz", + "integrity": "sha512-/dPCrG1s3ePpWm6yBbxZq5Be1dXGLyLn9Z791chDC3NFrpkVbWGzkBwPN1knaciexFXgRJ7hzdnwZ4stHSDmjg==", "dev": true, + "dependencies": { + "is-plain-obj": "^1.0.0" + }, "engines": { - "node": ">=8" + "node": ">=4" } }, - "node_modules/require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true, "engines": { "node": ">=0.10.0" } }, - "node_modules/require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", "dev": true, - "engines": { - "node": ">=0.10.0" + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" } }, - "node_modules/resolve": { - "version": "1.22.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", - "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", + "node_modules/spawn-please": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/spawn-please/-/spawn-please-2.0.1.tgz", + "integrity": "sha512-W+cFbZR2q2mMTfjz5ZGvhBAiX+e/zczFCNlbS9mxiSdYswBXwUuBUT+a0urH+xZZa8f/bs0mXHyZsZHR9hKogA==", "dev": true, "dependencies": { - "is-core-module": "^2.9.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - }, - "bin": { - "resolve": "bin/resolve" + "cross-spawn": "^7.0.3" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "engines": { + "node": ">=14" } }, - "node_modules/resolve-alpn": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.2.1.tgz", - "integrity": "sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==", + "node_modules/spdx-correct": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", + "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", + "dev": true, + "dependencies": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-exceptions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", "dev": true }, - "node_modules/resolve-cwd": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", - "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", + "node_modules/spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", "dev": true, "dependencies": { - "resolve-from": "^5.0.0" + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-license-ids": { + "version": "3.0.12", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.12.tgz", + "integrity": "sha512-rr+VVSXtRhO4OHbXUiAF7xW3Bo9DuuF6C5jH+q/x15j2jniycgKbxU09Hr0WqlSLUs4i4ltHGXqTe7VHclYWyA==", + "dev": true + }, + "node_modules/split": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/split/-/split-1.0.1.tgz", + "integrity": "sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==", + "dev": true, + "dependencies": { + "through": "2" }, "engines": { - "node": ">=8" + "node": "*" } }, - "node_modules/resolve-cwd/node_modules/resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "node_modules/split2": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz", + "integrity": "sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg==", "dev": true, - "engines": { - "node": ">=8" + "dependencies": { + "readable-stream": "^3.0.0" } }, - "node_modules/resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", + "dev": true + }, + "node_modules/ssri": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-9.0.1.tgz", + "integrity": "sha512-o57Wcn66jMQvfHG1FlYbWeZWW/dHZhJXjpIcTfXldXEk5nz5lStPo3mK0OJQfGR3RbZUlbISexbljkJzuEj/8Q==", "dev": true, + "dependencies": { + "minipass": "^3.1.1" + }, "engines": { - "node": ">=4" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/responselike": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/responselike/-/responselike-2.0.1.tgz", - "integrity": "sha512-4gl03wn3hj1HP3yzgdI7d3lCkF95F21Pz4BPGvKHinyQzALR5CapwC8yIi0Rh58DEMQ/SguC03wFj2k0M/mHhw==", + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", "dev": true, "dependencies": { - "lowercase-keys": "^2.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "safe-buffer": "~5.2.0" } }, - "node_modules/responselike/node_modules/lowercase-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", - "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, "engines": { "node": ">=8" } }, - "node_modules/restore-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", - "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "dependencies": { - "onetime": "^5.1.0", - "signal-exit": "^3.0.2" + "ansi-regex": "^5.0.1" }, "engines": { "node": ">=8" } }, - "node_modules/retry": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", - "integrity": "sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs=", + "node_modules/strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", "dev": true, "engines": { - "node": ">= 4" + "node": ">=8" } }, - "node_modules/reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "node_modules/strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", "dev": true, "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" + "node": ">=6" } }, - "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "node_modules/strip-indent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", + "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", "dev": true, "dependencies": { - "glob": "^7.1.3" + "min-indent": "^1.0.0" }, - "bin": { - "rimraf": "bin.js" + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "engines": { + "node": ">=8" }, "funding": { - "url": "https://github.com/sponsors/isaacs" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/run-async": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", - "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", + "node_modules/strong-log-transformer": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/strong-log-transformer/-/strong-log-transformer-2.1.0.tgz", + "integrity": "sha512-B3Hgul+z0L9a236FAUC9iZsL+nVHgoCJnqCbN588DjYxvGXaXaaFbfmQ/JhvKjZwsOukuR72XbHv71Qkug0HxA==", "dev": true, + "dependencies": { + "duplexer": "^0.1.1", + "minimist": "^1.2.0", + "through": "^2.3.4" + }, + "bin": { + "sl-log-transformer": "bin/sl-log-transformer.js" + }, "engines": { - "node": ">=0.12.0" + "node": ">=4" } }, - "node_modules/run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "queue-microtask": "^1.2.2" - } - }, - "node_modules/rxjs": { - "version": "7.5.6", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.5.6.tgz", - "integrity": "sha512-dnyv2/YsXhnm461G+R/Pe5bWP41Nm6LBXEYWI6eiFP4fiwx6WRI/CD0zbdVAudd9xwLEF2IDcKXLHit0FYjUzw==", + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "dependencies": { - "tslib": "^2.1.0" + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" } }, - "node_modules/rxjs/node_modules/tslib": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", - "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==", - "dev": true - }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, - "node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "node_modules/syncpack": { + "version": "9.8.4", + "resolved": "https://registry.npmjs.org/syncpack/-/syncpack-9.8.4.tgz", + "integrity": "sha512-i81rO+dHuJ2dO8YQq6SCExcyN0x9ZVTY7cVPn8pWjS5Dml0A8uM0cOaneOludFesdrLXMZUA/uEWa74ddBgkPQ==", "dev": true, "dependencies": { - "lru-cache": "^6.0.0" + "@mobily/ts-belt": "3.13.1", + "chalk": "4.1.2", + "commander": "10.0.0", + "cosmiconfig": "8.0.0", + "expect-more": "1.3.0", + "fs-extra": "11.1.0", + "glob": "8.1.0", + "minimatch": "6.2.0", + "read-yaml-file": "2.1.0", + "semver": "7.3.8", + "zod": "3.20.6" }, "bin": { - "semver": "bin/semver.js" + "syncpack": "dist/bin.js", + "syncpack-fix-mismatches": "dist/bin-fix-mismatches/index.js", + "syncpack-format": "dist/bin-format/index.js", + "syncpack-lint-semver-ranges": "dist/bin-lint-semver-ranges/index.js", + "syncpack-list": "dist/bin-list/index.js", + "syncpack-list-mismatches": "dist/bin-list-mismatches/index.js", + "syncpack-set-semver-ranges": "dist/bin-set-semver-ranges/index.js" }, "engines": { - "node": ">=10" + "node": ">=14" } }, - "node_modules/semver-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-4.0.0.tgz", - "integrity": "sha512-0Ju4+6A8iOnpL/Thra7dZsSlOHYAHIeMxfhWQRI1/VLcT3WDBZKKtQt/QkBOsiIN9ZpuvHE6cGZ0x4glCMmfiA==", + "node_modules/syncpack/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, "dependencies": { - "semver": "^7.3.5" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "balanced-match": "^1.0.0" } }, - "node_modules/semver-utils": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/semver-utils/-/semver-utils-1.1.4.tgz", - "integrity": "sha512-EjnoLE5OGmDAVV/8YDoN5KiajNadjzIp9BAHOhYeQHt7j0UWxjmgsx4YD48wp4Ue1Qogq38F1GNUJNqF1kKKxA==", - "dev": true - }, - "node_modules/set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", - "dev": true - }, - "node_modules/shallow-clone": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", - "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", + "node_modules/syncpack/node_modules/cosmiconfig": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.0.0.tgz", + "integrity": "sha512-da1EafcpH6b/TD8vDRaWV7xFINlHlF6zKsGwS1TsuVJTZRkquaS5HTMq7uq6h31619QjbsYl21gVDOm32KM1vQ==", "dev": true, "dependencies": { - "kind-of": "^6.0.2" + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "parse-json": "^5.0.0", + "path-type": "^4.0.0" }, "engines": { - "node": ">=8" + "node": ">=14" } }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "node_modules/syncpack/node_modules/fs-extra": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.1.0.tgz", + "integrity": "sha512-0rcTq621PD5jM/e0a3EJoGC/1TC5ZBCERW82LQuwfGnCa1V8w7dpYH1yNu+SLb6E5dkeCBzKEyLGlFrnr+dUyw==", "dev": true, "dependencies": { - "shebang-regex": "^3.0.0" + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" }, "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "engines": { - "node": ">=8" + "node": ">=14.14" } }, - "node_modules/signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "dev": true - }, - "node_modules/sisteransi": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", - "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", - "dev": true - }, - "node_modules/slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "node_modules/syncpack/node_modules/glob": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + }, "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/smart-buffer": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", - "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "node_modules/syncpack/node_modules/glob/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, "engines": { - "node": ">= 6.0.0", - "npm": ">= 3.0.0" + "node": ">=10" } }, - "node_modules/socks": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.0.tgz", - "integrity": "sha512-scnOe9y4VuiNUULJN72GrM26BNOjVsfPXI+j+98PkyEfsIXroa5ofyjT+FzGvn/xHs73U2JtoBYAVx9Hl4quSA==", + "node_modules/syncpack/node_modules/minimatch": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-6.2.0.tgz", + "integrity": "sha512-sauLxniAmvnhhRjFwPNnJKaPFYyddAgbYdeUpHULtCT/GhzdCx/MDNy+Y40lBxTQUrMzDE8e0S43Z5uqfO0REg==", "dev": true, "dependencies": { - "ip": "^2.0.0", - "smart-buffer": "^4.2.0" + "brace-expansion": "^2.0.1" }, "engines": { - "node": ">= 10.13.0", - "npm": ">= 3.0.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/socks-proxy-agent": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-7.0.0.tgz", - "integrity": "sha512-Fgl0YPZ902wEsAyiQ+idGd1A7rSFx/ayC1CQVMw5P+EQx2V0SgpGtf6OKFhVjPflPUl9YMmEOnmfjCdMUsygww==", + "node_modules/tar": { + "version": "6.1.11", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz", + "integrity": "sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA==", "dev": true, "dependencies": { - "agent-base": "^6.0.2", - "debug": "^4.3.3", - "socks": "^2.6.2" + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^3.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" }, "engines": { "node": ">= 10" } }, - "node_modules/sort-keys": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-4.2.0.tgz", - "integrity": "sha512-aUYIEU/UviqPgc8mHR6IW1EGxkAXpeRETYcrzg8cLAvUPZcpAlleSXHV2mY7G12GphSH6Gzv+4MMVSSkbdteHg==", + "node_modules/tar-stream": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", + "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", "dev": true, "dependencies": { - "is-plain-obj": "^2.0.0" + "bl": "^4.0.3", + "end-of-stream": "^1.4.1", + "fs-constants": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" }, "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=6" } }, - "node_modules/sort-keys/node_modules/is-plain-obj": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", - "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "node_modules/temp-dir": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-1.0.0.tgz", + "integrity": "sha512-xZFXEGbG7SNC3itwBzI3RYjq/cEhBkx2hJuKGIUOcEULmkQExXiHat2z/qkISYsuR+IKumhEfKKbV5qXmhICFQ==", "dev": true, "engines": { - "node": ">=8" + "node": ">=4" } }, - "node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "node_modules/text-extensions": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/text-extensions/-/text-extensions-1.9.0.tgz", + "integrity": "sha512-wiBrwC1EhBelW12Zy26JeOUkQ5mRu+5o8rpsJk5+2t+Y5vE7e842qtZDQ2g1NpX/29HdyFeJ4nSIhI47ENSxlQ==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=0.10" } }, - "node_modules/source-map-support": { - "version": "0.5.21", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", - "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true + }, + "node_modules/through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", + "dev": true + }, + "node_modules/through2": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz", + "integrity": "sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==", "dev": true, "dependencies": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" + "readable-stream": "3" } }, - "node_modules/spawn-please": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/spawn-please/-/spawn-please-1.0.0.tgz", - "integrity": "sha512-Kz33ip6NRNKuyTRo3aDWyWxeGeM0ORDO552Fs6E1nj4pLWPkl37SrRtTnq+MEopVaqgmaO6bAvVS+v64BJ5M/A==", + "node_modules/tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", "dev": true, + "dependencies": { + "os-tmpdir": "~1.0.2" + }, "engines": { - "node": ">=10" + "node": ">=0.6.0" } }, - "node_modules/spdx-correct": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", - "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, "dependencies": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" } }, - "node_modules/spdx-exceptions": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", - "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", "dev": true }, - "node_modules/spdx-expression-parse": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", - "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "node_modules/treeverse": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/treeverse/-/treeverse-2.0.0.tgz", + "integrity": "sha512-N5gJCkLu1aXccpOTtqV6ddSEi6ZmGkh3hjmbu1IjcavJK4qyOVQmi0myQKM7z5jVGmD68SJoliaVrMmVObhj6A==", "dev": true, - "dependencies": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/spdx-license-ids": { - "version": "3.0.11", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.11.tgz", - "integrity": "sha512-Ctl2BrFiM0X3MANYgj3CkygxhRmr9mi6xhejbdO960nF6EDJApTYpn0BQnDKlnNBULKiCN1n3w9EBkHK8ZWg+g==", - "dev": true + "node_modules/trim-newlines": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz", + "integrity": "sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==", + "dev": true, + "engines": { + "node": ">=8" + } }, - "node_modules/split": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/split/-/split-1.0.1.tgz", - "integrity": "sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==", + "node_modules/tsconfig-paths": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-4.1.2.tgz", + "integrity": "sha512-uhxiMgnXQp1IR622dUXI+9Ehnws7i/y6xvpZB9IbUVOPy0muvdvgXeZOn88UcGPiT98Vp3rJPTa8bFoalZ3Qhw==", "dev": true, "dependencies": { - "through": "2" + "json5": "^2.2.2", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" }, "engines": { - "node": "*" + "node": ">=6" } }, - "node_modules/split2": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz", - "integrity": "sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg==", + "node_modules/tsconfig-paths/node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", "dev": true, - "dependencies": { - "readable-stream": "^3.0.0" + "engines": { + "node": ">=4" } }, - "node_modules/ssri": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-9.0.1.tgz", - "integrity": "sha512-o57Wcn66jMQvfHG1FlYbWeZWW/dHZhJXjpIcTfXldXEk5nz5lStPo3mK0OJQfGR3RbZUlbISexbljkJzuEj/8Q==", + "node_modules/tslib": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", + "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==", + "dev": true + }, + "node_modules/tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", "dev": true, "dependencies": { - "minipass": "^3.1.1" + "tslib": "^1.8.1" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": ">= 6" + }, + "peerDependencies": { + "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" } }, - "node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.2.0" - } + "node_modules/tsutils/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true }, - "node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "node_modules/tuf-js": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/tuf-js/-/tuf-js-1.1.0.tgz", + "integrity": "sha512-Tsqlm419OAlrkCE6rsf1WuPvww44vfK1ZHz+Uq9Mpq5JiV5qnJ9LLItvsbM9OipIIeSG3rydVBS4BmD40ts2uA==", "dev": true, "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" + "@tufjs/models": "1.0.0", + "make-fetch-happen": "^11.0.1" }, "engines": { - "node": ">=8" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "node_modules/tuf-js/node_modules/@npmcli/fs": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-3.1.0.tgz", + "integrity": "sha512-7kZUAaLscfgbwBQRbvdMYaZOWyMEcPTH/tJjnyAWJ/dvvs9Ef+CERx/qJb9GExJpl1qipaDGn7KqHnFGGixd0w==", "dev": true, "dependencies": { - "ansi-regex": "^5.0.1" + "semver": "^7.3.5" }, "engines": { - "node": ">=8" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/strip-bom": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", - "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "node_modules/tuf-js/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, - "engines": { - "node": ">=8" + "dependencies": { + "balanced-match": "^1.0.0" } }, - "node_modules/strip-final-newline": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", - "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "node_modules/tuf-js/node_modules/cacache": { + "version": "17.0.4", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-17.0.4.tgz", + "integrity": "sha512-Z/nL3gU+zTUjz5pCA5vVjYM8pmaw2kxM7JEiE0fv3w77Wj+sFbi70CrBruUWH0uNcEdvLDixFpgA2JM4F4DBjA==", "dev": true, + "dependencies": { + "@npmcli/fs": "^3.1.0", + "fs-minipass": "^3.0.0", + "glob": "^8.0.1", + "lru-cache": "^7.7.1", + "minipass": "^4.0.0", + "minipass-collect": "^1.0.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "p-map": "^4.0.0", + "promise-inflight": "^1.0.1", + "ssri": "^10.0.0", + "tar": "^6.1.11", + "unique-filename": "^3.0.0" + }, "engines": { - "node": ">=6" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/strip-indent": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", - "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", + "node_modules/tuf-js/node_modules/fs-minipass": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-3.0.1.tgz", + "integrity": "sha512-MhaJDcFRTuLidHrIttu0RDGyyXs/IYHVmlcxfLAEFIWjc1vdLAkdwT7Ace2u7DbitWC0toKMl5eJZRYNVreIMw==", "dev": true, "dependencies": { - "min-indent": "^1.0.0" + "minipass": "^4.0.0" }, "engines": { - "node": ">=8" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "node_modules/tuf-js/node_modules/glob": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + }, "engines": { - "node": ">=8" + "node": ">=12" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/strong-log-transformer": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/strong-log-transformer/-/strong-log-transformer-2.1.0.tgz", - "integrity": "sha512-B3Hgul+z0L9a236FAUC9iZsL+nVHgoCJnqCbN588DjYxvGXaXaaFbfmQ/JhvKjZwsOukuR72XbHv71Qkug0HxA==", + "node_modules/tuf-js/node_modules/make-fetch-happen": { + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-11.0.3.tgz", + "integrity": "sha512-oPLh5m10lRNNZDjJ2kP8UpboUx2uFXVaVweVe/lWut4iHWcQEmfqSVJt2ihZsFI8HbpwyyocaXbCAWf0g1ukIA==", "dev": true, "dependencies": { - "duplexer": "^0.1.1", - "minimist": "^1.2.0", - "through": "^2.3.4" - }, - "bin": { - "sl-log-transformer": "bin/sl-log-transformer.js" + "agentkeepalive": "^4.2.1", + "cacache": "^17.0.0", + "http-cache-semantics": "^4.1.1", + "http-proxy-agent": "^5.0.0", + "https-proxy-agent": "^5.0.0", + "is-lambda": "^1.0.1", + "lru-cache": "^7.7.1", + "minipass": "^4.0.0", + "minipass-fetch": "^3.0.0", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^0.6.3", + "promise-retry": "^2.0.1", + "socks-proxy-agent": "^7.0.0", + "ssri": "^10.0.0" }, "engines": { - "node": ">=4" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "node_modules/tuf-js/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", "dev": true, "dependencies": { - "has-flag": "^4.0.0" + "brace-expansion": "^2.0.1" }, "engines": { - "node": ">=8" + "node": ">=10" } }, - "node_modules/supports-preserve-symlinks-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "node_modules/tuf-js/node_modules/minipass": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-4.2.4.tgz", + "integrity": "sha512-lwycX3cBMTvcejsHITUgYj6Gy6A7Nh4Q6h9NP4sTHY1ccJlC7yKzDmiShEHsJ16Jf1nKGDEaiHxiltsJEvk0nQ==", "dev": true, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=8" } }, - "node_modules/syncpack": { - "version": "5.8.15", - "resolved": "https://registry.npmjs.org/syncpack/-/syncpack-5.8.15.tgz", - "integrity": "sha512-V40rKrJL86eyvPLVhWP1BpG2suXOzWRCOSKGPyLdAjqXpmYPSqKh2O30lIqYSFLjw8TL0Dl5WNiVINqz7+DccQ==", + "node_modules/tuf-js/node_modules/minipass-fetch": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-3.0.1.tgz", + "integrity": "sha512-t9/wowtf7DYkwz8cfMSt0rMwiyNIBXf5CKZ3S5ZMqRqMYT0oLTp0x1WorMI9WTwvaPg21r1JbFxJMum8JrLGfw==", "dev": true, "dependencies": { - "chalk": "4.1.2", - "commander": "8.1.0", - "cosmiconfig": "7.0.0", - "expect-more": "1.1.0", - "fs-extra": "10.0.0", - "glob": "7.1.7", - "read-yaml-file": "2.1.0", - "semver": "7.3.5" - }, - "bin": { - "syncpack": "dist/bin.js", - "syncpack-fix-mismatches": "dist/bin-fix-mismatches.js", - "syncpack-format": "dist/bin-format.js", - "syncpack-lint-semver-ranges": "dist/bin-lint-semver-ranges.js", - "syncpack-list": "dist/bin-list.js", - "syncpack-list-mismatches": "dist/bin-list-mismatches.js", - "syncpack-set-semver-ranges": "dist/bin-set-semver-ranges.js" + "minipass": "^4.0.0", + "minipass-sized": "^1.0.3", + "minizlib": "^2.1.2" }, "engines": { - "node": ">=10" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + }, + "optionalDependencies": { + "encoding": "^0.1.13" } }, - "node_modules/syncpack/node_modules/commander": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-8.1.0.tgz", - "integrity": "sha512-mf45ldcuHSYShkplHHGKWb4TrmwQadxOn7v4WuhDJy0ZVoY5JFajaRDKD0PNe5qXzBX0rhovjTnP6Kz9LETcuA==", + "node_modules/tuf-js/node_modules/ssri": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-10.0.1.tgz", + "integrity": "sha512-WVy6di9DlPOeBWEjMScpNipeSX2jIZBGEn5Uuo8Q7aIuFEuDX0pw8RxcOjlD1TWP4obi24ki7m/13+nFpcbXrw==", "dev": true, + "dependencies": { + "minipass": "^4.0.0" + }, "engines": { - "node": ">= 12" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/syncpack/node_modules/cosmiconfig": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.0.tgz", - "integrity": "sha512-pondGvTuVYDk++upghXJabWzL6Kxu6f26ljFw64Swq9v6sQPUL3EUlVDV56diOjpCayKihL6hVe8exIACU4XcA==", + "node_modules/tuf-js/node_modules/unique-filename": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-3.0.0.tgz", + "integrity": "sha512-afXhuC55wkAmZ0P18QsVE6kp8JaxrEokN2HGIoIVv2ijHQd419H0+6EigAFcIzXeMIkcIkNBpB3L/DXB3cTS/g==", "dev": true, "dependencies": { - "@types/parse-json": "^4.0.0", - "import-fresh": "^3.2.1", - "parse-json": "^5.0.0", - "path-type": "^4.0.0", - "yaml": "^1.10.0" + "unique-slug": "^4.0.0" }, "engines": { - "node": ">=10" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/syncpack/node_modules/fs-extra": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.0.tgz", - "integrity": "sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ==", + "node_modules/tuf-js/node_modules/unique-slug": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-4.0.0.tgz", + "integrity": "sha512-WrcA6AyEfqDX5bWige/4NQfPZMtASNVxdmWR76WESYQVAACSgWcR6e9i0mofqqBxYFtL4oAxPIptY73/0YE1DQ==", "dev": true, "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" + "imurmurhash": "^0.1.4" }, "engines": { - "node": ">=12" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/syncpack/node_modules/glob": { - "version": "7.1.7", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", - "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", - "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/tar": { - "version": "6.1.11", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz", - "integrity": "sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA==", - "dev": true, - "dependencies": { - "chownr": "^2.0.0", - "fs-minipass": "^2.0.0", - "minipass": "^3.0.0", - "minizlib": "^2.1.1", - "mkdirp": "^1.0.3", - "yallist": "^4.0.0" - }, - "engines": { - "node": ">= 10" - } - }, - "node_modules/tar-stream": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", - "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", - "dev": true, - "dependencies": { - "bl": "^4.0.3", - "end-of-stream": "^1.4.1", - "fs-constants": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^3.1.1" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/temp-dir": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-1.0.0.tgz", - "integrity": "sha512-xZFXEGbG7SNC3itwBzI3RYjq/cEhBkx2hJuKGIUOcEULmkQExXiHat2z/qkISYsuR+IKumhEfKKbV5qXmhICFQ==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/text-extensions": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/text-extensions/-/text-extensions-1.9.0.tgz", - "integrity": "sha512-wiBrwC1EhBelW12Zy26JeOUkQ5mRu+5o8rpsJk5+2t+Y5vE7e842qtZDQ2g1NpX/29HdyFeJ4nSIhI47ENSxlQ==", - "dev": true, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", - "dev": true - }, - "node_modules/through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", - "dev": true - }, - "node_modules/through2": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz", - "integrity": "sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==", - "dev": true, - "dependencies": { - "readable-stream": "3" - } - }, - "node_modules/tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", - "dev": true, - "dependencies": { - "os-tmpdir": "~1.0.2" - }, - "engines": { - "node": ">=0.6.0" - } - }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, - "node_modules/tr46": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-2.1.0.tgz", - "integrity": "sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw==", - "dev": true, - "dependencies": { - "punycode": "^2.1.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/treeverse": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/treeverse/-/treeverse-2.0.0.tgz", - "integrity": "sha512-N5gJCkLu1aXccpOTtqV6ddSEi6ZmGkh3hjmbu1IjcavJK4qyOVQmi0myQKM7z5jVGmD68SJoliaVrMmVObhj6A==", - "dev": true, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, - "node_modules/trim-newlines": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz", - "integrity": "sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/ts-poet": { - "version": "4.15.0", - "resolved": "https://registry.npmjs.org/ts-poet/-/ts-poet-4.15.0.tgz", - "integrity": "sha512-sLLR8yQBvHzi9d4R1F4pd+AzQxBfzOSSjfxiJxQhkUoH5bL7RsAC6wgvtVUQdGqiCsyS9rT6/8X2FI7ipdir5g==", - "dependencies": { - "lodash": "^4.17.15", - "prettier": "^2.5.1" - } - }, - "node_modules/ts-proto": { - "version": "1.122.0", - "resolved": "https://registry.npmjs.org/ts-proto/-/ts-proto-1.122.0.tgz", - "integrity": "sha512-TmPKmSxRJjnfrdyncOMfilJDXvyL0BGxM4nDyYgMDVT2EhYZV85J93qEJPBIufwUtDBY8N42UNgja8Z5ObF6IA==", - "dependencies": { - "@types/object-hash": "^1.3.0", - "dataloader": "^1.4.0", - "object-hash": "^1.3.1", - "protobufjs": "^6.11.3", - "ts-poet": "^4.15.0", - "ts-proto-descriptors": "1.7.1" - }, - "bin": { - "protoc-gen-ts_proto": "protoc-gen-ts_proto" - } - }, - "node_modules/ts-proto-descriptors": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/ts-proto-descriptors/-/ts-proto-descriptors-1.7.1.tgz", - "integrity": "sha512-oIKUh3K4Xts4v29USGLfUG+2mEk32MsqpgZAOUyUlkrcIdv34yE+k2oZ2Nzngm6cV/JgFdOxRCqeyvmWHuYAyw==", - "dependencies": { - "long": "^4.0.0", - "protobufjs": "^6.8.8" - } - }, - "node_modules/tsconfig-paths": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz", - "integrity": "sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ==", - "dev": true, - "dependencies": { - "@types/json5": "^0.0.29", - "json5": "^1.0.1", - "minimist": "^1.2.6", - "strip-bom": "^3.0.0" - } - }, - "node_modules/tsconfig-paths/node_modules/json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", - "dev": true, - "dependencies": { - "minimist": "^1.2.0" - }, - "bin": { - "json5": "lib/cli.js" - } - }, - "node_modules/tsconfig-paths/node_modules/strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, - "node_modules/tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dev": true, - "dependencies": { - "tslib": "^1.8.1" - }, - "engines": { - "node": ">= 6" - }, - "peerDependencies": { - "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" - } - }, - "node_modules/type-check": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", "dev": true, "dependencies": { "prelude-ls": "^1.2.1" @@ -9259,9 +9418,9 @@ } }, "node_modules/uglify-js": { - "version": "3.16.3", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.16.3.tgz", - "integrity": "sha512-uVbFqx9vvLhQg0iBaau9Z75AxWJ8tqM9AV890dIZCLApF4rTcyHwmAvLeEdYRs+BzYWu8Iw81F79ah0EfTXbaw==", + "version": "3.17.4", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz", + "integrity": "sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==", "dev": true, "optional": true, "bin": { @@ -9272,21 +9431,27 @@ } }, "node_modules/unique-filename": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", - "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-2.0.1.tgz", + "integrity": "sha512-ODWHtkkdx3IAR+veKxFV+VBkUMcN+FaqzUUd7IZzt+0zhDZFPFxhlqwPF3YQvMHx1TD0tdgYl+kuPnJ8E6ql7A==", "dev": true, "dependencies": { - "unique-slug": "^2.0.0" + "unique-slug": "^3.0.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/unique-slug": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", - "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-3.0.0.tgz", + "integrity": "sha512-8EyMynh679x/0gqE9fT9oilG+qEt+ibFyqjuVTsZn1+CMxH+XLlpvr2UZx4nVcCwTpx81nICr2JQFkM+HPLq4w==", "dev": true, "dependencies": { "imurmurhash": "^0.1.4" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/unique-string": { @@ -9319,6 +9484,15 @@ "node": ">= 10.0.0" } }, + "node_modules/untildify": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz", + "integrity": "sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/upath": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/upath/-/upath-2.0.1.tgz", @@ -9358,1478 +9532,629 @@ } }, "node_modules/update-notifier/node_modules/chalk": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.0.1.tgz", - "integrity": "sha512-Fo07WOYGqMfCWHOzSXOt2CxDbC6skS/jO9ynEcmpANMoPrD+W1r1K6Vx7iNm+AQmETU1Xr2t+n8nzkV9t6xh3w==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.1.2.tgz", + "integrity": "sha512-E5CkT4jWURs1Vy5qGJye+XwCkNj7Od3Af7CP6SujMetSMkLs8Do2RWJK5yx1wamHV/op8Rz+9rltjaTQWDnEFQ==", "dev": true, "engines": { "node": "^12.17.0 || ^14.13 || >=16.0.0" }, "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/update-notifier/node_modules/ci-info": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.2.tgz", - "integrity": "sha512-xmDt/QIAdeZ9+nfdPsaBCpMvHNLFiLdjj59qjqn+6iPe6YmHGQ35sBnQ8uslRBXFmXkiZQOJRjvQeoGppoTjjg==", - "dev": true - }, - "node_modules/update-notifier/node_modules/is-ci": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-3.0.1.tgz", - "integrity": "sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ==", - "dev": true, - "dependencies": { - "ci-info": "^3.2.0" - }, - "bin": { - "is-ci": "bin.js" - } - }, - "node_modules/update-notifier/node_modules/semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, - "dependencies": { - "punycode": "^2.1.0" - } - }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", - "dev": true - }, - "node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "dev": true, - "bin": { - "uuid": "dist/bin/uuid" - } - }, - "node_modules/v8-compile-cache": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", - "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", - "dev": true - }, - "node_modules/validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "dev": true, - "dependencies": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, - "node_modules/validate-npm-package-name": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-4.0.0.tgz", - "integrity": "sha512-mzR0L8ZDktZjpX4OB46KT+56MAhl4EIazWP/+G/HPGuvfdaqg4YsCdtOm6U9+LOFyYDoh4dpnpxZRB9MQQns5Q==", - "dev": true, - "dependencies": { - "builtins": "^5.0.0" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, - "node_modules/walk-up-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/walk-up-path/-/walk-up-path-1.0.0.tgz", - "integrity": "sha512-hwj/qMDUEjCU5h0xr90KGCf0tg0/LgJbmOWgrWKYlcJZM7XvquvUJZ0G/HMGr7F7OQMOUuPHWP9JpriinkAlkg==", - "dev": true - }, - "node_modules/wcwidth": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", - "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==", - "dev": true, - "dependencies": { - "defaults": "^1.0.3" - } - }, - "node_modules/webidl-conversions": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz", - "integrity": "sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w==", - "dev": true, - "engines": { - "node": ">=10.4" - } - }, - "node_modules/whatwg-url": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.7.0.tgz", - "integrity": "sha512-gAojqb/m9Q8a5IV96E3fHJM70AzCkgt4uXYX2O7EmuyOnLrViCQlsEBmF9UQIu3/aeAIp2U17rtbpZWNntQqdg==", - "dev": true, - "dependencies": { - "lodash": "^4.7.0", - "tr46": "^2.1.0", - "webidl-conversions": "^6.1.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/wide-align": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", - "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", - "dev": true, - "dependencies": { - "string-width": "^1.0.2 || 2 || 3 || 4" - } - }, - "node_modules/widest-line": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-4.0.1.tgz", - "integrity": "sha512-o0cyEG0e8GPzT4iGHphIOh0cJOV8fivsXxddQasHPHfoZf1ZexrfeA21w2NaEN1RHE+fXlfISmOE8R9N3u3Qig==", - "dev": true, - "dependencies": { - "string-width": "^5.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/widest-line/node_modules/ansi-regex": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", - "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, - "node_modules/widest-line/node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "dev": true - }, - "node_modules/widest-line/node_modules/string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", - "dev": true, - "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/widest-line/node_modules/strip-ansi": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", - "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", - "dev": true, - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, - "node_modules/word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/wordwrap": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", - "dev": true - }, - "node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true - }, - "node_modules/write-file-atomic": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", - "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", - "dev": true, - "dependencies": { - "imurmurhash": "^0.1.4", - "is-typedarray": "^1.0.0", - "signal-exit": "^3.0.2", - "typedarray-to-buffer": "^3.1.5" - } - }, - "node_modules/write-json-file": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/write-json-file/-/write-json-file-4.3.0.tgz", - "integrity": "sha512-PxiShnxf0IlnQuMYOPPhPkhExoCQuTUNPOa/2JWCYTmBquU9njyyDuwRKN26IZBlp4yn1nt+Agh2HOOBl+55HQ==", - "dev": true, - "dependencies": { - "detect-indent": "^6.0.0", - "graceful-fs": "^4.1.15", - "is-plain-obj": "^2.0.0", - "make-dir": "^3.0.0", - "sort-keys": "^4.0.0", - "write-file-atomic": "^3.0.0" - }, - "engines": { - "node": ">=8.3" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/write-json-file/node_modules/is-plain-obj": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", - "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/write-pkg": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/write-pkg/-/write-pkg-4.0.0.tgz", - "integrity": "sha512-v2UQ+50TNf2rNHJ8NyWttfm/EJUBWMJcx6ZTYZr6Qp52uuegWw/lBkCtCbnYZEmPRNL61m+u67dAmGxo+HTULA==", - "dev": true, - "dependencies": { - "sort-keys": "^2.0.0", - "type-fest": "^0.4.1", - "write-json-file": "^3.2.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/write-pkg/node_modules/detect-indent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-5.0.0.tgz", - "integrity": "sha512-rlpvsxUtM0PQvy9iZe640/IWwWYyBsTApREbA1pHOpmOUIl9MkP/U4z7vTtg4Oaojvqhxt7sdufnT0EzGaR31g==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/write-pkg/node_modules/make-dir": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", - "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", - "dev": true, - "dependencies": { - "pify": "^4.0.1", - "semver": "^5.6.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/write-pkg/node_modules/pify": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/write-pkg/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true, - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/write-pkg/node_modules/sort-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-2.0.0.tgz", - "integrity": "sha512-/dPCrG1s3ePpWm6yBbxZq5Be1dXGLyLn9Z791chDC3NFrpkVbWGzkBwPN1knaciexFXgRJ7hzdnwZ4stHSDmjg==", - "dev": true, - "dependencies": { - "is-plain-obj": "^1.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/write-pkg/node_modules/type-fest": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.4.1.tgz", - "integrity": "sha512-IwzA/LSfD2vC1/YDYMv/zHP4rDF1usCwllsDpbolT3D4fUepIO7f9K70jjmUewU/LmGUKJcwcVtDCpnKk4BPMw==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/write-pkg/node_modules/write-file-atomic": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz", - "integrity": "sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==", - "dev": true, - "dependencies": { - "graceful-fs": "^4.1.11", - "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.2" - } - }, - "node_modules/write-pkg/node_modules/write-json-file": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/write-json-file/-/write-json-file-3.2.0.tgz", - "integrity": "sha512-3xZqT7Byc2uORAatYiP3DHUUAVEkNOswEWNs9H5KXiicRTvzYzYqKjYc4G7p+8pltvAw641lVByKVtMpf+4sYQ==", - "dev": true, - "dependencies": { - "detect-indent": "^5.0.0", - "graceful-fs": "^4.1.15", - "make-dir": "^2.1.0", - "pify": "^4.0.1", - "sort-keys": "^2.0.0", - "write-file-atomic": "^2.4.2" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/xdg-basedir": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-5.1.0.tgz", - "integrity": "sha512-GCPAHLvrIH13+c0SuacwvRYj2SxJXQ4kaVTT5xgL3kPrz56XxkF21IGhjSE1+W0aw7gpBWRGXLCPnPby6lSpmQ==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", - "dev": true, - "engines": { - "node": ">=0.4" - } - }, - "node_modules/y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "dev": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, - "node_modules/yaml": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", - "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", - "dev": true, - "engines": { - "node": ">= 6" - } - }, - "node_modules/yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", - "dev": true, - "dependencies": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.0", - "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs-parser": { - "version": "20.2.9", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", - "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", - "dev": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - } - }, - "dependencies": { - "@babel/code-frame": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", - "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", - "dev": true, - "requires": { - "@babel/highlight": "^7.16.7" - } - }, - "@babel/helper-validator-identifier": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", - "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", - "dev": true - }, - "@babel/highlight": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.7.tgz", - "integrity": "sha512-aKpPMfLvGO3Q97V0qhw/V2SWNWlwfJknuwAunU7wZLSfrM4xTBvg7E5opUVi1kJTBKihE38CPg4nBiqX83PWYw==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.16.7", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "@eslint/eslintrc": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.0.tgz", - "integrity": "sha512-UWW0TMTmk2d7hLcWD1/e2g5HDM/HQ3csaLSqXCfqwh4uNDuNqlaKWXmEsL4Cs41Z0KnILNvwbHAah3C2yt06kw==", - "dev": true, - "requires": { - "ajv": "^6.12.4", - "debug": "^4.3.2", - "espree": "^9.3.2", - "globals": "^13.15.0", - "ignore": "^5.2.0", - "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", - "minimatch": "^3.1.2", - "strip-json-comments": "^3.1.1" - }, - "dependencies": { - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - } - } - }, - "@gar/promisify": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz", - "integrity": "sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==", - "dev": true - }, - "@humanwhocodes/config-array": { - "version": "0.10.4", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.10.4.tgz", - "integrity": "sha512-mXAIHxZT3Vcpg83opl1wGlVZ9xydbfZO3r5YfRSH6Gpp2J/PfdBP0wbDa2sO6/qRbcalpoevVyW6A/fI6LfeMw==", - "dev": true, - "requires": { - "@humanwhocodes/object-schema": "^1.2.1", - "debug": "^4.1.1", - "minimatch": "^3.0.4" - } - }, - "@humanwhocodes/gitignore-to-minimatch": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@humanwhocodes/gitignore-to-minimatch/-/gitignore-to-minimatch-1.0.2.tgz", - "integrity": "sha512-rSqmMJDdLFUsyxR6FMtD00nfQKKLFb1kv+qBbOVKqErvloEIJLo5bDTJTQNTYgeyp78JsA7u/NPi5jT1GR/MuA==", - "dev": true - }, - "@humanwhocodes/object-schema": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", - "dev": true - }, - "@hutson/parse-repository-url": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@hutson/parse-repository-url/-/parse-repository-url-3.0.2.tgz", - "integrity": "sha512-H9XAx3hc0BQHY6l+IFSWHDySypcXsvsuLhgYLUGywmJ5pswRVQJUHpOsobnLYp2ZUaUlKiKDrgWWhosOwAEM8Q==", - "dev": true - }, - "@isaacs/string-locale-compare": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@isaacs/string-locale-compare/-/string-locale-compare-1.1.0.tgz", - "integrity": "sha512-SQ7Kzhh9+D+ZW9MA0zkYv3VXhIDNx+LzM6EJ+/65I3QY+enU6Itte7E5XX7EWrqLW2FN4n06GWzBnPoC3th2aQ==", - "dev": true - }, - "@lerna/add": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/add/-/add-5.3.0.tgz", - "integrity": "sha512-MxwTO2UBxZwwuquKbBqdYa56YTqg6Lfz1MZsRQxO7F2cb2NN8NEYTcGOli/71Ee/2AoX4R4xIFTh3TnaflQ25A==", - "dev": true, - "requires": { - "@lerna/bootstrap": "5.3.0", - "@lerna/command": "5.3.0", - "@lerna/filter-options": "5.3.0", - "@lerna/npm-conf": "5.3.0", - "@lerna/validation-error": "5.3.0", - "dedent": "^0.7.0", - "npm-package-arg": "8.1.1", - "p-map": "^4.0.0", - "pacote": "^13.6.1", - "semver": "^7.3.4" - } - }, - "@lerna/bootstrap": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/bootstrap/-/bootstrap-5.3.0.tgz", - "integrity": "sha512-iHVjt6YOQKLY0j+ex13a6ZxjIQ1TSSXqbl6z1hVjBFaDyCh7pra/tgj0LohZDVCaouLwRKucceQfTGrb+cfo7A==", - "dev": true, - "requires": { - "@lerna/command": "5.3.0", - "@lerna/filter-options": "5.3.0", - "@lerna/has-npm-version": "5.3.0", - "@lerna/npm-install": "5.3.0", - "@lerna/package-graph": "5.3.0", - "@lerna/pulse-till-done": "5.3.0", - "@lerna/rimraf-dir": "5.3.0", - "@lerna/run-lifecycle": "5.3.0", - "@lerna/run-topologically": "5.3.0", - "@lerna/symlink-binary": "5.3.0", - "@lerna/symlink-dependencies": "5.3.0", - "@lerna/validation-error": "5.3.0", - "@npmcli/arborist": "5.3.0", - "dedent": "^0.7.0", - "get-port": "^5.1.1", - "multimatch": "^5.0.0", - "npm-package-arg": "8.1.1", - "npmlog": "^6.0.2", - "p-map": "^4.0.0", - "p-map-series": "^2.1.0", - "p-waterfall": "^2.1.1", - "semver": "^7.3.4" - } - }, - "@lerna/changed": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/changed/-/changed-5.3.0.tgz", - "integrity": "sha512-i6ZfBDBZCpnPaSWTuNGTrnExkHNMC+/cSUuS9njaqe+tXgqE95Ja3cMxWZth9Q1uasjcEBHPU2jG0VKrU37rpA==", - "dev": true, - "requires": { - "@lerna/collect-updates": "5.3.0", - "@lerna/command": "5.3.0", - "@lerna/listable": "5.3.0", - "@lerna/output": "5.3.0" - } - }, - "@lerna/check-working-tree": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/check-working-tree/-/check-working-tree-5.3.0.tgz", - "integrity": "sha512-qo6jUGWXKLVL1nU8aEECqwrGRjs9o1l1hXdD2juA4Fvzsam1cFVHJwsmw3hAXGhEPD0oalg/XR62H9rZSCLOvQ==", - "dev": true, - "requires": { - "@lerna/collect-uncommitted": "5.3.0", - "@lerna/describe-ref": "5.3.0", - "@lerna/validation-error": "5.3.0" - } - }, - "@lerna/child-process": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/child-process/-/child-process-5.3.0.tgz", - "integrity": "sha512-4uXPNIptrgQQQVHVVAXBD8F7IqSvZL3Og0G0DHiWKH+dsSyMIUtaIGJt7sifVoL7nzex4AqEiPq/AubpmG5g4Q==", - "dev": true, - "requires": { - "chalk": "^4.1.0", - "execa": "^5.0.0", - "strong-log-transformer": "^2.1.0" - } - }, - "@lerna/clean": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/clean/-/clean-5.3.0.tgz", - "integrity": "sha512-Jn+Dr7A69dch8m1dLe7l/SDVQVQT2j7zdy2gaZVEmJIgEEaXmEbfJ2t2n06vRXtckI9B85M5mubT1U3Y7KuNuA==", - "dev": true, - "requires": { - "@lerna/command": "5.3.0", - "@lerna/filter-options": "5.3.0", - "@lerna/prompt": "5.3.0", - "@lerna/pulse-till-done": "5.3.0", - "@lerna/rimraf-dir": "5.3.0", - "p-map": "^4.0.0", - "p-map-series": "^2.1.0", - "p-waterfall": "^2.1.1" - } - }, - "@lerna/cli": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/cli/-/cli-5.3.0.tgz", - "integrity": "sha512-P7F3Xs98pXMEGZX+mnFfsd6gU03x8UrwQ3mElvQBICl4Ew9z6rS8NGUd3JOPFzm4/vSTjYTnPyPdWBjj6/f6sw==", - "dev": true, - "requires": { - "@lerna/global-options": "5.3.0", - "dedent": "^0.7.0", - "npmlog": "^6.0.2", - "yargs": "^16.2.0" + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "@lerna/collect-uncommitted": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/collect-uncommitted/-/collect-uncommitted-5.3.0.tgz", - "integrity": "sha512-Ll/mU9Nes0NQoa0pSv2TR2PTCkIomBGuDWH48OF2sKKu69NuLjrD2L0udS5nJYig9HxFewtm4QTiUdYPxfJXkQ==", - "dev": true, - "requires": { - "@lerna/child-process": "5.3.0", - "chalk": "^4.1.0", - "npmlog": "^6.0.2" - } + "node_modules/update-notifier/node_modules/ci-info": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.5.0.tgz", + "integrity": "sha512-yH4RezKOGlOhxkmhbeNuC4eYZKAUsEaGtBuBzDDP1eFUKiccDWzBABxBfOx31IDwDIXMTxWuwAxUGModvkbuVw==", + "dev": true }, - "@lerna/collect-updates": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/collect-updates/-/collect-updates-5.3.0.tgz", - "integrity": "sha512-fzJo/rmdXKWKYt+9IXjtenIZtSr3blMH8GEqoVKpSZ7TJGpxcFNmMe6foa60BgaTnDmmg1y7Qu6JbQJ3Ra5c5w==", + "node_modules/update-notifier/node_modules/is-ci": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-3.0.1.tgz", + "integrity": "sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ==", "dev": true, - "requires": { - "@lerna/child-process": "5.3.0", - "@lerna/describe-ref": "5.3.0", - "minimatch": "^3.0.4", - "npmlog": "^6.0.2", - "slash": "^3.0.0" + "dependencies": { + "ci-info": "^3.2.0" + }, + "bin": { + "is-ci": "bin.js" } }, - "@lerna/command": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/command/-/command-5.3.0.tgz", - "integrity": "sha512-UNQQ4EGTumqLhOuDPcRA4LpdS9pcTYKSdh/8MdKPeyIRN70vCTwdeTrxqaaKsn3Jo7ycvyUQT5yfrUFmCClfoA==", + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", "dev": true, - "requires": { - "@lerna/child-process": "5.3.0", - "@lerna/package-graph": "5.3.0", - "@lerna/project": "5.3.0", - "@lerna/validation-error": "5.3.0", - "@lerna/write-log-file": "5.3.0", - "clone-deep": "^4.0.1", - "dedent": "^0.7.0", - "execa": "^5.0.0", - "is-ci": "^2.0.0", - "npmlog": "^6.0.2" + "dependencies": { + "punycode": "^2.1.0" } }, - "@lerna/conventional-commits": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/conventional-commits/-/conventional-commits-5.3.0.tgz", - "integrity": "sha512-9uoQ2E1J7pL0fml5PNO7FydnBNeqrNOQa53Ca1Klf5t/x4vIn51ocOZNm/YbRAc/affnrxxp+gR2/SWlN0yKqQ==", + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true + }, + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", "dev": true, - "requires": { - "@lerna/validation-error": "5.3.0", - "conventional-changelog-angular": "^5.0.12", - "conventional-changelog-core": "^4.2.4", - "conventional-recommended-bump": "^6.1.0", - "fs-extra": "^9.1.0", - "get-stream": "^6.0.0", - "npm-package-arg": "8.1.1", - "npmlog": "^6.0.2", - "pify": "^5.0.0", - "semver": "^7.3.4" + "bin": { + "uuid": "dist/bin/uuid" } }, - "@lerna/create": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/create/-/create-5.3.0.tgz", - "integrity": "sha512-DotTReCc3+Q9rpMA8RKAGemUK7JXT7skbxHvpqpPj7ryNkIv/dNAFC2EHglcpt9Rmyo6YbSP2zk0gfDbdiIcVA==", + "node_modules/v8-compile-cache": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", + "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", + "dev": true + }, + "node_modules/validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", "dev": true, - "requires": { - "@lerna/child-process": "5.3.0", - "@lerna/command": "5.3.0", - "@lerna/npm-conf": "5.3.0", - "@lerna/validation-error": "5.3.0", - "dedent": "^0.7.0", - "fs-extra": "^9.1.0", - "globby": "^11.0.2", - "init-package-json": "^3.0.2", - "npm-package-arg": "8.1.1", - "p-reduce": "^2.1.0", - "pacote": "^13.6.1", - "pify": "^5.0.0", - "semver": "^7.3.4", - "slash": "^3.0.0", - "validate-npm-package-license": "^3.0.4", - "validate-npm-package-name": "^4.0.0", - "whatwg-url": "^8.4.0", - "yargs-parser": "20.2.4" - }, "dependencies": { - "yargs-parser": { - "version": "20.2.4", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", - "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", - "dev": true - } + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" } }, - "@lerna/create-symlink": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/create-symlink/-/create-symlink-5.3.0.tgz", - "integrity": "sha512-xIoC9m4J/u4NV/8ms4P2fiimaYgialqJvNamvMDRmgE1c3BLDSGk2nE4nVI2W5LxjgJdMTiIH9v1QpTUC9Fv+Q==", + "node_modules/validate-npm-package-name": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-4.0.0.tgz", + "integrity": "sha512-mzR0L8ZDktZjpX4OB46KT+56MAhl4EIazWP/+G/HPGuvfdaqg4YsCdtOm6U9+LOFyYDoh4dpnpxZRB9MQQns5Q==", "dev": true, - "requires": { - "cmd-shim": "^5.0.0", - "fs-extra": "^9.1.0", - "npmlog": "^6.0.2" + "dependencies": { + "builtins": "^5.0.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "@lerna/describe-ref": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/describe-ref/-/describe-ref-5.3.0.tgz", - "integrity": "sha512-R+CtJcOuAF3kJ6GNQnGC3STEi+5OtpNVz2n17sAs/xqJnq79tPdzEhT+pMxB2eSEkQYlSr+cCKMpF0m/mtIPQA==", + "node_modules/walk-up-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/walk-up-path/-/walk-up-path-1.0.0.tgz", + "integrity": "sha512-hwj/qMDUEjCU5h0xr90KGCf0tg0/LgJbmOWgrWKYlcJZM7XvquvUJZ0G/HMGr7F7OQMOUuPHWP9JpriinkAlkg==", + "dev": true + }, + "node_modules/wcwidth": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", + "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==", "dev": true, - "requires": { - "@lerna/child-process": "5.3.0", - "npmlog": "^6.0.2" + "dependencies": { + "defaults": "^1.0.3" } }, - "@lerna/diff": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/diff/-/diff-5.3.0.tgz", - "integrity": "sha512-i6f99dtO90u1QIJEfVtKE831m4gnMHBwY+4D84GY2SJMno8uI7ZyxMRZQh1nAFtvlNozO2MgzLr1OHtNMZOIgQ==", + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "dev": true + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", "dev": true, - "requires": { - "@lerna/child-process": "5.3.0", - "@lerna/command": "5.3.0", - "@lerna/validation-error": "5.3.0", - "npmlog": "^6.0.2" + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" } }, - "@lerna/exec": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/exec/-/exec-5.3.0.tgz", - "integrity": "sha512-kI/IuF1hbT+pEMZc3v4+w8BLckUIi45ipzOP0bWvXNgSKKuADAU3HLv+ifRXEjob5906C+Zc7K2IVoVS6r1TDg==", + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, - "requires": { - "@lerna/child-process": "5.3.0", - "@lerna/command": "5.3.0", - "@lerna/filter-options": "5.3.0", - "@lerna/profiler": "5.3.0", - "@lerna/run-topologically": "5.3.0", - "@lerna/validation-error": "5.3.0", - "p-map": "^4.0.0" + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" } }, - "@lerna/filter-options": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/filter-options/-/filter-options-5.3.0.tgz", - "integrity": "sha512-ddgy0oDisTKIhCJ4WY5CeEhTsyrbW+zeBvZ7rVaG0oQXjSSYBried4TXRvgy67fampfHoPX+eQq5l1SYTRFPlw==", + "node_modules/wide-align": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", + "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", "dev": true, - "requires": { - "@lerna/collect-updates": "5.3.0", - "@lerna/filter-packages": "5.3.0", - "dedent": "^0.7.0", - "npmlog": "^6.0.2" + "dependencies": { + "string-width": "^1.0.2 || 2 || 3 || 4" } }, - "@lerna/filter-packages": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/filter-packages/-/filter-packages-5.3.0.tgz", - "integrity": "sha512-5/2V50sQB2+JNwuCHP/UPm3y8PN2JWVY9CbNLtF3K5bymNsCkQh2KHEL9wlWZ4yfr/2ufpy4XFPaFUHNoUOGnQ==", + "node_modules/widest-line": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-4.0.1.tgz", + "integrity": "sha512-o0cyEG0e8GPzT4iGHphIOh0cJOV8fivsXxddQasHPHfoZf1ZexrfeA21w2NaEN1RHE+fXlfISmOE8R9N3u3Qig==", "dev": true, - "requires": { - "@lerna/validation-error": "5.3.0", - "multimatch": "^5.0.0", - "npmlog": "^6.0.2" + "dependencies": { + "string-width": "^5.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "@lerna/get-npm-exec-opts": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/get-npm-exec-opts/-/get-npm-exec-opts-5.3.0.tgz", - "integrity": "sha512-cYBypDo8C7f4MvVvap2nYgtk8MXAADrYU1VdECSJ3Stbe4p2vBGt8bM9xkS2uPfQFMK3YSy3YPkSZcSjVXyoGw==", + "node_modules/widest-line/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", "dev": true, - "requires": { - "npmlog": "^6.0.2" + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" } }, - "@lerna/get-packed": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/get-packed/-/get-packed-5.3.0.tgz", - "integrity": "sha512-kD12w7Ko5TThuOuPF2HBLyuPsHK3oyyWyzleGBqR4DqxMtbMRgimyTQnr5o58XBOwUPCFsv1EZiqeGk+3HTGEA==", + "node_modules/widest-line/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true + }, + "node_modules/widest-line/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "dev": true, - "requires": { - "fs-extra": "^9.1.0", - "ssri": "^9.0.1", - "tar": "^6.1.0" + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "@lerna/github-client": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/github-client/-/github-client-5.3.0.tgz", - "integrity": "sha512-UqAclsWDMthmbv3Z8QE1K7D/4e93ytg31mc+nEj+UdU+xJQ0L1ypl8zWAmGNs1sFkQntIiTIB4W5zgHet5mmZw==", + "node_modules/widest-line/node_modules/strip-ansi": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", + "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", "dev": true, - "requires": { - "@lerna/child-process": "5.3.0", - "@octokit/plugin-enterprise-rest": "^6.0.1", - "@octokit/rest": "^19.0.3", - "git-url-parse": "^12.0.0", - "npmlog": "^6.0.2" + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, - "@lerna/gitlab-client": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/gitlab-client/-/gitlab-client-5.3.0.tgz", - "integrity": "sha512-otwbiaGDgvn5MGF1ypsCO48inMpdcxuiDlbxrKD6glPUwNHiGV+PU8LLCCDKimwjjQhl88ySLpL1oTm4jnZ1Aw==", + "node_modules/word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", "dev": true, - "requires": { - "node-fetch": "^2.6.1", - "npmlog": "^6.0.2", - "whatwg-url": "^8.4.0" + "engines": { + "node": ">=0.10.0" } }, - "@lerna/global-options": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/global-options/-/global-options-5.3.0.tgz", - "integrity": "sha512-iEoFrDSU+KtfcB+lHW5grjg3VkEqzZNTUnWnE1FCBBwj9tSLOHjgKGtWWjIQtBUJ+qcLBbusap9Stqzr7UPYpQ==", + "node_modules/wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", "dev": true }, - "@lerna/has-npm-version": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/has-npm-version/-/has-npm-version-5.3.0.tgz", - "integrity": "sha512-A/bK8e+QP/VMqZkq1wZbyOzMz/AY92tAVsBOQ5Yw2zqshdMVj99st3YHLOqJf/HTEzQo27GGI/ajmcltHS2l6A==", + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, - "requires": { - "@lerna/child-process": "5.3.0", - "semver": "^7.3.4" + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "@lerna/import": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/import/-/import-5.3.0.tgz", - "integrity": "sha512-KjVT9oFNSp1JLdrS1LSXjDcLiu2TMSfy6tpmhF9Zxo7oKB21SgWmXVV9rcWDueW2RIxNXDeVUG0NVNj2BRGeEQ==", + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true + }, + "node_modules/write-file-atomic": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.1.tgz", + "integrity": "sha512-nSKUxgAbyioruk6hU87QzVbY279oYT6uiwgDoujth2ju4mJ+TZau7SQBhtbTmUyuNYTuXnSyRn66FV0+eCgcrQ==", "dev": true, - "requires": { - "@lerna/child-process": "5.3.0", - "@lerna/command": "5.3.0", - "@lerna/prompt": "5.3.0", - "@lerna/pulse-till-done": "5.3.0", - "@lerna/validation-error": "5.3.0", - "dedent": "^0.7.0", - "fs-extra": "^9.1.0", - "p-map-series": "^2.1.0" + "dependencies": { + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.7" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16" } }, - "@lerna/info": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/info/-/info-5.3.0.tgz", - "integrity": "sha512-pyeZSM/PIpBHCXdHPrbh6sPZlngXUxhTVFb0VaIjQ5Ms585xi15s1UQDO3FvzqdyMyalx0QGzCJbNx5XeoCejg==", + "node_modules/write-json-file": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/write-json-file/-/write-json-file-3.2.0.tgz", + "integrity": "sha512-3xZqT7Byc2uORAatYiP3DHUUAVEkNOswEWNs9H5KXiicRTvzYzYqKjYc4G7p+8pltvAw641lVByKVtMpf+4sYQ==", "dev": true, - "requires": { - "@lerna/command": "5.3.0", - "@lerna/output": "5.3.0", - "envinfo": "^7.7.4" + "dependencies": { + "detect-indent": "^5.0.0", + "graceful-fs": "^4.1.15", + "make-dir": "^2.1.0", + "pify": "^4.0.1", + "sort-keys": "^2.0.0", + "write-file-atomic": "^2.4.2" + }, + "engines": { + "node": ">=6" } }, - "@lerna/init": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/init/-/init-5.3.0.tgz", - "integrity": "sha512-y46lzEtgMdEseTJGQQqYZOjqqd7iN+e14vFh/9q5h62V4Y8nlUJRzovVo8JSeaGwKLB0B3dq3BuUn0PNywMhpA==", + "node_modules/write-json-file/node_modules/detect-indent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-5.0.0.tgz", + "integrity": "sha512-rlpvsxUtM0PQvy9iZe640/IWwWYyBsTApREbA1pHOpmOUIl9MkP/U4z7vTtg4Oaojvqhxt7sdufnT0EzGaR31g==", "dev": true, - "requires": { - "@lerna/child-process": "5.3.0", - "@lerna/command": "5.3.0", - "@lerna/project": "5.3.0", - "fs-extra": "^9.1.0", - "p-map": "^4.0.0", - "write-json-file": "^4.3.0" + "engines": { + "node": ">=4" } }, - "@lerna/link": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/link/-/link-5.3.0.tgz", - "integrity": "sha512-+QBwnGg3S8Zk8M8G5CA4kmGq92rkEMbmWJXaxie3jQayp+GXgSlLs6R4jwSOZlztY6xR3WawMI9sHJ0Vdu+g7w==", + "node_modules/write-json-file/node_modules/make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", "dev": true, - "requires": { - "@lerna/command": "5.3.0", - "@lerna/package-graph": "5.3.0", - "@lerna/symlink-dependencies": "5.3.0", - "p-map": "^4.0.0", - "slash": "^3.0.0" + "dependencies": { + "pify": "^4.0.1", + "semver": "^5.6.0" + }, + "engines": { + "node": ">=6" } }, - "@lerna/list": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/list/-/list-5.3.0.tgz", - "integrity": "sha512-5RJvle3m4l2H0UmKNlwS8h2OIlNGsNTKPC4DYrJYt0+fhgzf5SEV1QKw+fuUqe3F8MziIkSGQB52HsjwPE6AWQ==", + "node_modules/write-json-file/node_modules/pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", "dev": true, - "requires": { - "@lerna/command": "5.3.0", - "@lerna/filter-options": "5.3.0", - "@lerna/listable": "5.3.0", - "@lerna/output": "5.3.0" + "engines": { + "node": ">=6" } }, - "@lerna/listable": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/listable/-/listable-5.3.0.tgz", - "integrity": "sha512-RdmeV9mDeuBOgVOlF/KNH/qttyiYwHbeqHiMAw9s9AfMo/Fz3iDZaTGZuruMm84TZSkKxI7m5mjTlC0djsyKog==", + "node_modules/write-json-file/node_modules/semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "dev": true, - "requires": { - "@lerna/query-graph": "5.3.0", - "chalk": "^4.1.0", - "columnify": "^1.6.0" + "bin": { + "semver": "bin/semver" } }, - "@lerna/log-packed": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/log-packed/-/log-packed-5.3.0.tgz", - "integrity": "sha512-tDuOot3vSOUSP7fNNej8UM0fah5oy8mKXe026grt4J0OP4L3rhSWxhfrDBQ3Ylh2dAjgHzscUf/vpnNC9HnhOQ==", + "node_modules/write-json-file/node_modules/write-file-atomic": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz", + "integrity": "sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==", "dev": true, - "requires": { - "byte-size": "^7.0.0", - "columnify": "^1.6.0", - "has-unicode": "^2.0.1", - "npmlog": "^6.0.2" + "dependencies": { + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.2" } }, - "@lerna/npm-conf": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/npm-conf/-/npm-conf-5.3.0.tgz", - "integrity": "sha512-ejlypb90tvIsKUCb0fcOKt7wcPEjLdVK2zfbNs0M+UlRDLyRVOHUVdelJ15cRDNjQHzhBo2HBUKn5Fmm/2pcmg==", + "node_modules/write-pkg": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/write-pkg/-/write-pkg-4.0.0.tgz", + "integrity": "sha512-v2UQ+50TNf2rNHJ8NyWttfm/EJUBWMJcx6ZTYZr6Qp52uuegWw/lBkCtCbnYZEmPRNL61m+u67dAmGxo+HTULA==", "dev": true, - "requires": { - "config-chain": "^1.1.12", - "pify": "^5.0.0" + "dependencies": { + "sort-keys": "^2.0.0", + "type-fest": "^0.4.1", + "write-json-file": "^3.2.0" + }, + "engines": { + "node": ">=8" } }, - "@lerna/npm-dist-tag": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/npm-dist-tag/-/npm-dist-tag-5.3.0.tgz", - "integrity": "sha512-OPahPk9QLXQXFgtrWm22NNxajVYKavCyTh8ijMwXTGXXbMJAw+PVjokfrUuEtg7FQi+kfJSrYAcJAxxfQq2eiA==", + "node_modules/write-pkg/node_modules/type-fest": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.4.1.tgz", + "integrity": "sha512-IwzA/LSfD2vC1/YDYMv/zHP4rDF1usCwllsDpbolT3D4fUepIO7f9K70jjmUewU/LmGUKJcwcVtDCpnKk4BPMw==", "dev": true, - "requires": { - "@lerna/otplease": "5.3.0", - "npm-package-arg": "8.1.1", - "npm-registry-fetch": "^13.3.0", - "npmlog": "^6.0.2" + "engines": { + "node": ">=6" } }, - "@lerna/npm-install": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/npm-install/-/npm-install-5.3.0.tgz", - "integrity": "sha512-scbWo8nW+P9KfitWG3y7Ep97dOs64ECfz9xfqtjagEXKYBPxG3skvwwljkfNnuxrCNs71JVD+imvcewHzih28g==", + "node_modules/xdg-basedir": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-5.1.0.tgz", + "integrity": "sha512-GCPAHLvrIH13+c0SuacwvRYj2SxJXQ4kaVTT5xgL3kPrz56XxkF21IGhjSE1+W0aw7gpBWRGXLCPnPby6lSpmQ==", "dev": true, - "requires": { - "@lerna/child-process": "5.3.0", - "@lerna/get-npm-exec-opts": "5.3.0", - "fs-extra": "^9.1.0", - "npm-package-arg": "8.1.1", - "npmlog": "^6.0.2", - "signal-exit": "^3.0.3", - "write-pkg": "^4.0.0" + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "@lerna/npm-publish": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/npm-publish/-/npm-publish-5.3.0.tgz", - "integrity": "sha512-n+ocN1Dxrs6AmrSNqZl57cwhP4/VjQXdEI+QYauNnErNjMQW8Wt+tNaTlVAhZ1DnorwAo86o2uzFF/BgdUqh9A==", + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", "dev": true, - "requires": { - "@lerna/otplease": "5.3.0", - "@lerna/run-lifecycle": "5.3.0", - "fs-extra": "^9.1.0", - "libnpmpublish": "^6.0.4", - "npm-package-arg": "8.1.1", - "npmlog": "^6.0.2", - "pify": "^5.0.0", - "read-package-json": "^5.0.1" + "engines": { + "node": ">=0.4" } }, - "@lerna/npm-run-script": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/npm-run-script/-/npm-run-script-5.3.0.tgz", - "integrity": "sha512-2cLR1YdzeMjaMKgDuwHE+iZgVPt+Ttzb3/wFtp7Mw9TlKmNIdbHdrnfl12ABz5knPC+62CCNjB/gznfLndPp2w==", + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", "dev": true, - "requires": { - "@lerna/child-process": "5.3.0", - "@lerna/get-npm-exec-opts": "5.3.0", - "npmlog": "^6.0.2" + "engines": { + "node": ">=10" } }, - "@lerna/otplease": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/otplease/-/otplease-5.3.0.tgz", - "integrity": "sha512-Xpju2VC5TiycmBP/mdp9hRstkH2MLm8/7o2NotVTCJwASWdKphRMqezhh5BX0E9i6VyrjzmTqSYEh9FNZZ9MwQ==", - "dev": true, - "requires": { - "@lerna/prompt": "5.3.0" - } + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true }, - "@lerna/output": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/output/-/output-5.3.0.tgz", - "integrity": "sha512-fISmHDu/9PKInFmT5NXsbh8cR6aE6SUXWrteXJ6PBYK30s0f/pVcfswb9VccX0Yea8HmqMQgCHWUWifkZeXiRA==", + "node_modules/yaml": { + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", + "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", "dev": true, - "requires": { - "npmlog": "^6.0.2" + "engines": { + "node": ">= 6" } }, - "@lerna/pack-directory": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/pack-directory/-/pack-directory-5.3.0.tgz", - "integrity": "sha512-dTGMUB6/GjExhmLZ8yeFaRKJuSm6M/IsfxSJdL4gFPLigUIAS4XhzXS3KnL0+Ef1ue1yaTlAE9c/czfkE0pc/w==", + "node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", "dev": true, - "requires": { - "@lerna/get-packed": "5.3.0", - "@lerna/package": "5.3.0", - "@lerna/run-lifecycle": "5.3.0", - "@lerna/temp-write": "5.3.0", - "npm-packlist": "^5.1.1", - "npmlog": "^6.0.2", - "tar": "^6.1.0" + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" } }, - "@lerna/package": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/package/-/package-5.3.0.tgz", - "integrity": "sha512-hsB03miiaNdvZ/UGzl0sVqxVat5x33EG9JiYgIoFqzroQPrG+WShmX3ctuO06TY1pxb4iNuHLPIbQomHEzzj8w==", + "node_modules/yargs-parser": { + "version": "20.2.4", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", + "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", "dev": true, - "requires": { - "load-json-file": "^6.2.0", - "npm-package-arg": "8.1.1", - "write-pkg": "^4.0.0" + "engines": { + "node": ">=10" } }, - "@lerna/package-graph": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/package-graph/-/package-graph-5.3.0.tgz", - "integrity": "sha512-UEHY7l/yknwFvQgo0RifyY+B5QdzuFutLZYSN1BMmyWttOZD9rkM263qnLNGTZ2BUE4dXDwwwOHuhLvi+xDRsA==", + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "dev": true, - "requires": { - "@lerna/prerelease-id-from-version": "5.3.0", - "@lerna/validation-error": "5.3.0", - "npm-package-arg": "8.1.1", - "npmlog": "^6.0.2", - "semver": "^7.3.4" + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "@lerna/prerelease-id-from-version": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/prerelease-id-from-version/-/prerelease-id-from-version-5.3.0.tgz", - "integrity": "sha512-o1wsLns6hFTsmk4iqTRJNWLnFzlBBwgu17hp8T2iU4U7LUlDT2ZSKV3smGAU6GfrwX3MAp4LZ5syxgjFjrUOnw==", + "node_modules/zod": { + "version": "3.20.6", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.20.6.tgz", + "integrity": "sha512-oyu0m54SGCtzh6EClBVqDDlAYRz4jrVtKwQ7ZnsEmMI9HnzuZFj8QFwAY1M5uniIYACdGvv0PBWPF2kO0aNofA==", "dev": true, - "requires": { - "semver": "^7.3.4" + "funding": { + "url": "https://github.com/sponsors/colinhacks" } - }, - "@lerna/profiler": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/profiler/-/profiler-5.3.0.tgz", - "integrity": "sha512-LEZYca29EPgZR0q5E+7CJkn25Cw3OxNMQJU/CVn/HGeoWYWOpoDxujrZBl8is2bw06LHXvRbVXEUATLc+ACbqQ==", + } + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", + "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==", "dev": true, "requires": { - "fs-extra": "^9.1.0", - "npmlog": "^6.0.2", - "upath": "^2.0.1" + "@babel/highlight": "^7.18.6" } }, - "@lerna/project": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/project/-/project-5.3.0.tgz", - "integrity": "sha512-InhIo9uwT1yod72ai5SKseJSUk8KkqG6COmwp1/45vibbawb7ZLbokpns7n46A0NdGNlmwJolamybYOuyumejw==", + "@babel/helper-validator-identifier": { + "version": "7.19.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", + "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", + "dev": true + }, + "@babel/highlight": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", + "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", "dev": true, "requires": { - "@lerna/package": "5.3.0", - "@lerna/validation-error": "5.3.0", - "cosmiconfig": "^7.0.0", - "dedent": "^0.7.0", - "dot-prop": "^6.0.1", - "glob-parent": "^5.1.1", - "globby": "^11.0.2", - "load-json-file": "^6.2.0", - "npmlog": "^6.0.2", - "p-map": "^4.0.0", - "resolve-from": "^5.0.0", - "write-json-file": "^4.3.0" + "@babel/helper-validator-identifier": "^7.18.6", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" }, "dependencies": { - "resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } } } }, - "@lerna/prompt": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/prompt/-/prompt-5.3.0.tgz", - "integrity": "sha512-4bIusBdjpw665CJtFsVsaB55hLHnmKnrcOaRjna6N/MdJDl8Th6X4EM4rrfXTX/uUNR3XcV91lYqcLuLmrpm5w==", - "dev": true, - "requires": { - "inquirer": "^8.2.4", - "npmlog": "^6.0.2" - } - }, - "@lerna/publish": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/publish/-/publish-5.3.0.tgz", - "integrity": "sha512-T8T1BQdI+NnlVARKwIXzILknEuiQlZToBsDpuX06M7+45t/pp9Z+u6pVt3rrqwiUPZ/dpoZzYKI31YdNJtGMcQ==", - "dev": true, - "requires": { - "@lerna/check-working-tree": "5.3.0", - "@lerna/child-process": "5.3.0", - "@lerna/collect-updates": "5.3.0", - "@lerna/command": "5.3.0", - "@lerna/describe-ref": "5.3.0", - "@lerna/log-packed": "5.3.0", - "@lerna/npm-conf": "5.3.0", - "@lerna/npm-dist-tag": "5.3.0", - "@lerna/npm-publish": "5.3.0", - "@lerna/otplease": "5.3.0", - "@lerna/output": "5.3.0", - "@lerna/pack-directory": "5.3.0", - "@lerna/prerelease-id-from-version": "5.3.0", - "@lerna/prompt": "5.3.0", - "@lerna/pulse-till-done": "5.3.0", - "@lerna/run-lifecycle": "5.3.0", - "@lerna/run-topologically": "5.3.0", - "@lerna/validation-error": "5.3.0", - "@lerna/version": "5.3.0", - "fs-extra": "^9.1.0", - "libnpmaccess": "^6.0.3", - "npm-package-arg": "8.1.1", - "npm-registry-fetch": "^13.3.0", - "npmlog": "^6.0.2", - "p-map": "^4.0.0", - "p-pipe": "^3.1.0", - "pacote": "^13.6.1", - "semver": "^7.3.4" - } - }, - "@lerna/pulse-till-done": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/pulse-till-done/-/pulse-till-done-5.3.0.tgz", - "integrity": "sha512-yNvSuPLT1ZTtD2LMVOmiDhw4+9qkyf6xCpfxiUp4cGEN+qIuazWB5JicKLE49o27DBdaG8Ao4lAlb16x/gNrwQ==", - "dev": true, - "requires": { - "npmlog": "^6.0.2" - } - }, - "@lerna/query-graph": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/query-graph/-/query-graph-5.3.0.tgz", - "integrity": "sha512-t99lNj97/Vilp5Js1Be7MoyaZ5U0fbOFh0E7lnTfSLvZhTkPMK6xLvAx2M3NQqhwYCQjTFDuf9ozQ3HQtYZAmA==", + "@eslint/eslintrc": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.0.0.tgz", + "integrity": "sha512-fluIaaV+GyV24CCu/ggiHdV+j4RNh85yQnAYS/G2mZODZgGmmlrgCydjUcV3YvxCm9x8nMAfThsqTni4KiXT4A==", "dev": true, "requires": { - "@lerna/package-graph": "5.3.0" + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.4.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" } }, - "@lerna/resolve-symlink": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/resolve-symlink/-/resolve-symlink-5.3.0.tgz", - "integrity": "sha512-zKI7rV5FzzlMBfi6kjDS0ulzcdDTORvdOJ/+CHU5C2h+v+P64Nk2VhZZNCCBDoO/l4GRhgehZOB70GIamO1TSw==", - "dev": true, - "requires": { - "fs-extra": "^9.1.0", - "npmlog": "^6.0.2", - "read-cmd-shim": "^3.0.0" - } + "@eslint/js": { + "version": "8.35.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.35.0.tgz", + "integrity": "sha512-JXdzbRiWclLVoD8sNUjR443VVlYqiYmDVT6rGUEIEHU5YJW0gaVZwV2xgM7D4arkvASqD0IlLUVjHiFuxaftRw==", + "dev": true }, - "@lerna/rimraf-dir": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/rimraf-dir/-/rimraf-dir-5.3.0.tgz", - "integrity": "sha512-/QJebh0tSY3LjgEyOo+6NH/b7ZNw9IpjqiDtvnLixjtdfkgli1OKOoZTa4KrO0mJoqMRq4yAa98cjpIzyKqCqw==", - "dev": true, - "requires": { - "@lerna/child-process": "5.3.0", - "npmlog": "^6.0.2", - "path-exists": "^4.0.0", - "rimraf": "^3.0.2" - } + "@gar/promisify": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz", + "integrity": "sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==", + "dev": true }, - "@lerna/run": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/run/-/run-5.3.0.tgz", - "integrity": "sha512-KwoKTj1w71OmUHONNYhZME+tr5lk9Q4f+3LUr2WtWZRuOAGO5ZCRrcZc+N4Ib7zno89Ub6Ovz51fcjwltLh72w==", + "@humanwhocodes/config-array": { + "version": "0.11.8", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz", + "integrity": "sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==", "dev": true, "requires": { - "@lerna/command": "5.3.0", - "@lerna/filter-options": "5.3.0", - "@lerna/npm-run-script": "5.3.0", - "@lerna/output": "5.3.0", - "@lerna/profiler": "5.3.0", - "@lerna/run-topologically": "5.3.0", - "@lerna/timer": "5.3.0", - "@lerna/validation-error": "5.3.0", - "p-map": "^4.0.0" + "@humanwhocodes/object-schema": "^1.2.1", + "debug": "^4.1.1", + "minimatch": "^3.0.5" } }, - "@lerna/run-lifecycle": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/run-lifecycle/-/run-lifecycle-5.3.0.tgz", - "integrity": "sha512-EuBCGwm2PLgkebfyqo3yNkwfSb1EzHeo3lA8t4yld6LXWkgUPBFhc7RwRc6TsQOpjpfFvDSGoI282R01o0jPVQ==", - "dev": true, - "requires": { - "@lerna/npm-conf": "5.3.0", - "@npmcli/run-script": "^4.1.7", - "npmlog": "^6.0.2", - "p-queue": "^6.6.2" - } + "@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true }, - "@lerna/run-topologically": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/run-topologically/-/run-topologically-5.3.0.tgz", - "integrity": "sha512-WiFF2EiwLjAguKs0lEmcukTL7WhuWFwxNprrGWFxEkBhlGdMFk18n8BaZN8FO26xqzztzuPzSx1re/f/dEEAPg==", - "dev": true, - "requires": { - "@lerna/query-graph": "5.3.0", - "p-queue": "^6.6.2" - } + "@humanwhocodes/object-schema": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "dev": true }, - "@lerna/symlink-binary": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/symlink-binary/-/symlink-binary-5.3.0.tgz", - "integrity": "sha512-dIATASuGS6y512AGjacOoTpkFDPsKlhggjzL3KLdSNmxV3288nUqaFBuA7rTnnMNnBQ7jVuE1JKJupZnzPN0cA==", - "dev": true, - "requires": { - "@lerna/create-symlink": "5.3.0", - "@lerna/package": "5.3.0", - "fs-extra": "^9.1.0", - "p-map": "^4.0.0" - } + "@hutson/parse-repository-url": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@hutson/parse-repository-url/-/parse-repository-url-3.0.2.tgz", + "integrity": "sha512-H9XAx3hc0BQHY6l+IFSWHDySypcXsvsuLhgYLUGywmJ5pswRVQJUHpOsobnLYp2ZUaUlKiKDrgWWhosOwAEM8Q==", + "dev": true }, - "@lerna/symlink-dependencies": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/symlink-dependencies/-/symlink-dependencies-5.3.0.tgz", - "integrity": "sha512-qkq4YT/Bdrb3W22ve+d2Gy3hRTrtT/zBhjKTCukEpYsFJLwSjZ4z5vbv6J15/j6PN1Km9oTRp6vBYmdjAuARQQ==", - "dev": true, - "requires": { - "@lerna/create-symlink": "5.3.0", - "@lerna/resolve-symlink": "5.3.0", - "@lerna/symlink-binary": "5.3.0", - "fs-extra": "^9.1.0", - "p-map": "^4.0.0", - "p-map-series": "^2.1.0" - } + "@isaacs/string-locale-compare": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@isaacs/string-locale-compare/-/string-locale-compare-1.1.0.tgz", + "integrity": "sha512-SQ7Kzhh9+D+ZW9MA0zkYv3VXhIDNx+LzM6EJ+/65I3QY+enU6Itte7E5XX7EWrqLW2FN4n06GWzBnPoC3th2aQ==", + "dev": true }, - "@lerna/temp-write": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/temp-write/-/temp-write-5.3.0.tgz", - "integrity": "sha512-AhC5Q+tV0yebEc1P2jsB4apQzztW8dgdLLc1G1Pkt46l5vezRGhZmsj+iUyCsVjpdUSO/UcAq1DbI2Xzhf5arg==", + "@lerna/child-process": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/@lerna/child-process/-/child-process-6.5.1.tgz", + "integrity": "sha512-QfyleXSD9slh4qM54wDaqKVPvtUH1NJMgsFc9BabqSHO1Ttpandv1EAvTCN9Lu73RbCX3LJpn+BfJmnjHbjCyw==", "dev": true, "requires": { - "graceful-fs": "^4.1.15", - "is-stream": "^2.0.0", - "make-dir": "^3.0.0", - "temp-dir": "^1.0.0", - "uuid": "^8.3.2" + "chalk": "^4.1.0", + "execa": "^5.0.0", + "strong-log-transformer": "^2.1.0" } }, - "@lerna/timer": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/timer/-/timer-5.3.0.tgz", - "integrity": "sha512-IeDjj1gJtbUPKl2ebpiml9u4k2kRqYF1Dbs6JuWpeC7lGxAx3JcUmkNH2RQ1BYTxk5xc9FKlgNMrZQwhq2K1Ow==", - "dev": true - }, - "@lerna/validation-error": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/validation-error/-/validation-error-5.3.0.tgz", - "integrity": "sha512-GVvnTxx+CNFjXCiJahAu2c/pP2R3DhGuQp4CJUyKegnzGaWK0h5PhlwRL7/LbDMPLh2zLobPOVr9kTOjwv76Nw==", + "@lerna/create": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/@lerna/create/-/create-6.5.1.tgz", + "integrity": "sha512-ejERJnfA36jEuKrfM+94feLiyf2/hF2NoG923N0rE4rsmvRFPr1XLVPvAKleXW+Gdi/t1p410lJ7NKaLRMYCYw==", "dev": true, "requires": { - "npmlog": "^6.0.2" - } - }, - "@lerna/version": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/version/-/version-5.3.0.tgz", - "integrity": "sha512-QOQSAdpeP66oQQ20nNZ4NhJS5NtZZDGyz36kP/4BeqjGK6QgtrEmto4+vmWj49w3VJUIXnrqAKHiPkhFUmJm5Q==", - "dev": true, - "requires": { - "@lerna/check-working-tree": "5.3.0", - "@lerna/child-process": "5.3.0", - "@lerna/collect-updates": "5.3.0", - "@lerna/command": "5.3.0", - "@lerna/conventional-commits": "5.3.0", - "@lerna/github-client": "5.3.0", - "@lerna/gitlab-client": "5.3.0", - "@lerna/output": "5.3.0", - "@lerna/prerelease-id-from-version": "5.3.0", - "@lerna/prompt": "5.3.0", - "@lerna/run-lifecycle": "5.3.0", - "@lerna/run-topologically": "5.3.0", - "@lerna/temp-write": "5.3.0", - "@lerna/validation-error": "5.3.0", - "chalk": "^4.1.0", + "@lerna/child-process": "6.5.1", "dedent": "^0.7.0", - "load-json-file": "^6.2.0", - "minimatch": "^3.0.4", - "npmlog": "^6.0.2", - "p-map": "^4.0.0", - "p-pipe": "^3.1.0", + "fs-extra": "^9.1.0", + "init-package-json": "^3.0.2", + "npm-package-arg": "8.1.1", "p-reduce": "^2.1.0", - "p-waterfall": "^2.1.1", + "pacote": "^13.6.1", + "pify": "^5.0.0", "semver": "^7.3.4", "slash": "^3.0.0", - "write-json-file": "^4.3.0" + "validate-npm-package-license": "^3.0.4", + "validate-npm-package-name": "^4.0.0", + "yargs-parser": "20.2.4" } }, - "@lerna/write-log-file": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@lerna/write-log-file/-/write-log-file-5.3.0.tgz", - "integrity": "sha512-cmrNAI5+9auUJSuTVrUzt2nb/KX6htgjdw7gGPMI1Tm6cdBIbs67R6LedZ8yvYOLGsXB2Se93vxv5fTgEHWfCw==", - "dev": true, - "requires": { - "npmlog": "^6.0.2", - "write-file-atomic": "^4.0.1" - }, - "dependencies": { - "write-file-atomic": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.1.tgz", - "integrity": "sha512-nSKUxgAbyioruk6hU87QzVbY279oYT6uiwgDoujth2ju4mJ+TZau7SQBhtbTmUyuNYTuXnSyRn66FV0+eCgcrQ==", - "dev": true, - "requires": { - "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.7" - } - } - } + "@mobily/ts-belt": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/@mobily/ts-belt/-/ts-belt-3.13.1.tgz", + "integrity": "sha512-K5KqIhPI/EoCTbA6CGbrenM9s41OouyK8A03fGJJcla/zKucsgLbz8HNbeseoLarRPgyWJsUyCYqFhI7t3Ra9Q==", + "dev": true }, "@nodelib/fs.scandir": { "version": "2.1.5", @@ -10900,26 +10225,18 @@ }, "dependencies": { "hosted-git-info": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.0.0.tgz", - "integrity": "sha512-rRnjWu0Bxj+nIfUOkz0695C0H6tRrN5iYIzYejb0tDEefe2AekHu/U5Kn9pEie5vsJqpNQU02az7TGSH3qpz4Q==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.2.1.tgz", + "integrity": "sha512-xIcQYMnhcx2Nr4JTjsFmwwnr9vldugPy9uVm0o87bjqqWMv9GaqsTeT+i99wTl0mk1uLxJtHxLb8kymqTENQsw==", "dev": true, "requires": { "lru-cache": "^7.5.1" - }, - "dependencies": { - "lru-cache": { - "version": "7.13.2", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.13.2.tgz", - "integrity": "sha512-VJL3nIpA79TodY/ctmZEfhASgqekbT574/c4j3jn4bKXbSCnTTCH/KltZyvL2GlV+tGSMtsWyem8DCX7qKTMBA==", - "dev": true - } } }, "npm-package-arg": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-9.1.0.tgz", - "integrity": "sha512-4J0GL+u2Nh6OnhvUKXRr2ZMG4lR8qtLp+kv7UiV00Y+nGiSxtttCyIRHCt5L5BNkXQld/RceYItau3MDOoGiBw==", + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-9.1.2.tgz", + "integrity": "sha512-pzd9rLEx4TfNJkovvlBSLGhq31gGu2QDexFPWT19yCDh0JgnRhlBLNo5759N0AJmBk+kQ9Y/hXoLnlgFD+ukmg==", "dev": true, "requires": { "hosted-git-info": "^5.0.0", @@ -10927,28 +10244,36 @@ "semver": "^7.3.5", "validate-npm-package-name": "^4.0.0" } - }, - "semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", - "dev": true, - "requires": { - "lru-cache": "^6.0.0" - } } } }, "@npmcli/fs": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-2.1.0.tgz", - "integrity": "sha512-DmfBvNXGaetMxj9LTp8NAN9vEidXURrf5ZTslQzEAi/6GbW+4yjaLFQc6Tue5cpZ9Frlk4OBo/Snf1Bh/S7qTQ==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-2.1.2.tgz", + "integrity": "sha512-yOJKRvohFOaLqipNtwYB9WugyZKhC/DZC4VYPmpaCzDBrA8YpK3qHZ8/HGscMnE4GqbkLNuVcCnxkeQEdGt6LQ==", "dev": true, "requires": { "@gar/promisify": "^1.1.3", "semver": "^7.3.5" } }, + "@npmcli/git": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@npmcli/git/-/git-3.0.2.tgz", + "integrity": "sha512-CAcd08y3DWBJqJDpfuVL0uijlq5oaXaOJEKHKc4wqrjd00gkvTZB+nFuLn+doOOKddaQS9JfqtNoFCO2LCvA3w==", + "dev": true, + "requires": { + "@npmcli/promise-spawn": "^3.0.0", + "lru-cache": "^7.4.4", + "mkdirp": "^1.0.4", + "npm-pick-manifest": "^7.0.0", + "proc-log": "^2.0.0", + "promise-inflight": "^1.0.1", + "promise-retry": "^2.0.1", + "semver": "^7.3.5", + "which": "^2.0.2" + } + }, "@npmcli/installed-package-contents": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/@npmcli/installed-package-contents/-/installed-package-contents-1.0.7.tgz", @@ -10981,9 +10306,9 @@ } }, "glob": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz", - "integrity": "sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -10994,9 +10319,9 @@ } }, "minimatch": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", - "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", "dev": true, "requires": { "brace-expansion": "^2.0.1" @@ -11017,9 +10342,9 @@ } }, "@npmcli/move-file": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@npmcli/move-file/-/move-file-2.0.0.tgz", - "integrity": "sha512-UR6D5f4KEGWJV6BGPH3Qb2EtgH+t+1XQ1Tt85c7qicN6cezzuHPdZwwAxqZr4JLtnQu0LZsTza/5gmNmSl8XLg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@npmcli/move-file/-/move-file-2.0.1.tgz", + "integrity": "sha512-mJd2Z5TjYWq/ttPLLGqArdtnC74J6bOzg4rMDnN+p1xTacZ2yPRCk2y0oSWQtygLR9YVQXgOcONrwtnk3JupxQ==", "dev": true, "requires": { "mkdirp": "^1.0.4", @@ -11057,9 +10382,9 @@ } }, "@npmcli/run-script": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-4.2.0.tgz", - "integrity": "sha512-e/QgLg7j2wSJp1/7JRl0GC8c7PMX+uYlA/1Tb+IDOLdSM4T7K1VQ9mm9IGU3WRtY5vEIObpqCLb3aCNCug18DA==", + "version": "4.1.7", + "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-4.1.7.tgz", + "integrity": "sha512-WXr/MyM4tpKA4BotB81NccGAv8B48lNH0gRoILucbcAhTQXLCoi6HflMV3KdXubIqvP9SuLsFn68Z7r4jl+ppw==", "dev": true, "requires": { "@npmcli/node-gyp": "^2.0.0", @@ -11070,73 +10395,169 @@ } }, "@nrwl/cli": { - "version": "14.4.3", - "resolved": "https://registry.npmjs.org/@nrwl/cli/-/cli-14.4.3.tgz", - "integrity": "sha512-9WzOOXgdf9YJxqte5e8KNkM3NWOuBgM7hz9jEOyw53Ht1Y2H8xLDPVkqDTS9kROgcyMQxHIjIcw80wZNaZL8Mw==", + "version": "15.7.1", + "resolved": "https://registry.npmjs.org/@nrwl/cli/-/cli-15.7.1.tgz", + "integrity": "sha512-33RcH5Af2BidQvnTGlDTrUWJ6Eul5aA0LeqYmEavYb+I0kzYMqdBzBCLgQT/13gAdoQauTWUO4g3eFhoHnCNrg==", "dev": true, "requires": { - "nx": "14.4.3" + "nx": "15.7.1" + } + }, + "@nrwl/devkit": { + "version": "15.7.1", + "resolved": "https://registry.npmjs.org/@nrwl/devkit/-/devkit-15.7.1.tgz", + "integrity": "sha512-u+4iBukrvrSQbKktnAcEuFzthq5ZGLpjE+SYUgg5+H6R76U0uelupdJ14qTWzIbSjlWLG53YmRZsJaIJ9EUG/w==", + "dev": true, + "requires": { + "@phenomnomnominal/tsquery": "4.1.1", + "ejs": "^3.1.7", + "ignore": "^5.0.4", + "semver": "7.3.4", + "tslib": "^2.3.0" + }, + "dependencies": { + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "semver": { + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", + "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + } } }, + "@nrwl/nx-darwin-arm64": { + "version": "15.7.1", + "resolved": "https://registry.npmjs.org/@nrwl/nx-darwin-arm64/-/nx-darwin-arm64-15.7.1.tgz", + "integrity": "sha512-YaNq1kP0xoaG2SDTjAzc0ZXAzRHE4obnEtVbisMzGRJkMld7SiOzYZAoaLJI6mZJuc7cIzUlA+wFkE2e21q5tQ==", + "dev": true, + "optional": true + }, + "@nrwl/nx-darwin-x64": { + "version": "15.7.1", + "resolved": "https://registry.npmjs.org/@nrwl/nx-darwin-x64/-/nx-darwin-x64-15.7.1.tgz", + "integrity": "sha512-G/0joeAQfZm4FuqaDyOAam912EfVS6mlG1gFrzp3P/kzzE+gxt/I+iQHNmEOl8Dnp4ercTgW6epUEQ03teRLOA==", + "dev": true, + "optional": true + }, + "@nrwl/nx-linux-arm-gnueabihf": { + "version": "15.7.1", + "resolved": "https://registry.npmjs.org/@nrwl/nx-linux-arm-gnueabihf/-/nx-linux-arm-gnueabihf-15.7.1.tgz", + "integrity": "sha512-WeZndiNyAPolRc08C4LLY7y+b3g9wAsJVVTWugW9PyaTMD19KY6oFkNG5gg1W0InoGISazW5fUissE+911kgog==", + "dev": true, + "optional": true + }, + "@nrwl/nx-linux-arm64-gnu": { + "version": "15.7.1", + "resolved": "https://registry.npmjs.org/@nrwl/nx-linux-arm64-gnu/-/nx-linux-arm64-gnu-15.7.1.tgz", + "integrity": "sha512-efDPQl2Z1YLnUlEKyu7lsvRnFIRXmvnbkH2nRv3HNHVufnHjjQ41UBw2Gqz4WUrEpmBz2Xq31cYUZluUP7/o6Q==", + "dev": true, + "optional": true + }, + "@nrwl/nx-linux-arm64-musl": { + "version": "15.7.1", + "resolved": "https://registry.npmjs.org/@nrwl/nx-linux-arm64-musl/-/nx-linux-arm64-musl-15.7.1.tgz", + "integrity": "sha512-Esv+ko6vMrI0HLnIXs76up7zUCaDfjArgn2TfMxvPjDEp4qmExiI8gmSh5JM1kC0MkHb4HghCnsSQ86Gg1BRiQ==", + "dev": true, + "optional": true + }, + "@nrwl/nx-linux-x64-gnu": { + "version": "15.7.1", + "resolved": "https://registry.npmjs.org/@nrwl/nx-linux-x64-gnu/-/nx-linux-x64-gnu-15.7.1.tgz", + "integrity": "sha512-9ZkeCHhk+a3ok8CBEcbIheWrlp+gY1KdhmHOksJuDsHTcRMirbZ9HWm+/UIYB2FVaEENCBgcA4akwXRDaxrmYw==", + "dev": true, + "optional": true + }, + "@nrwl/nx-linux-x64-musl": { + "version": "15.7.1", + "resolved": "https://registry.npmjs.org/@nrwl/nx-linux-x64-musl/-/nx-linux-x64-musl-15.7.1.tgz", + "integrity": "sha512-FOs8FhcACKfYjL5l/mIHUESs25KPsZsp3TWrpCYgQNkrvNV9lWbrQ+h9acWf23hR2FYVk7xKVo4wFYsUqF+DbA==", + "dev": true, + "optional": true + }, + "@nrwl/nx-win32-arm64-msvc": { + "version": "15.7.1", + "resolved": "https://registry.npmjs.org/@nrwl/nx-win32-arm64-msvc/-/nx-win32-arm64-msvc-15.7.1.tgz", + "integrity": "sha512-JEhy0ac+ivhIdAPWqEfAN9EqFznKA5vt4oVjIqjDysqgzN9GBKOeo7gphdii9WyqrIKEbOs1L++ADWXw1gev6Q==", + "dev": true, + "optional": true + }, + "@nrwl/nx-win32-x64-msvc": { + "version": "15.7.1", + "resolved": "https://registry.npmjs.org/@nrwl/nx-win32-x64-msvc/-/nx-win32-x64-msvc-15.7.1.tgz", + "integrity": "sha512-GLh5TXKViRb55jBviZSZweavilUr2frmb/8iv3Fz7MPS6VvA+axIqNhuVcTJP1H3C/1yt3Nx5wwsXdWgg3mZpw==", + "dev": true, + "optional": true + }, "@nrwl/tao": { - "version": "14.4.3", - "resolved": "https://registry.npmjs.org/@nrwl/tao/-/tao-14.4.3.tgz", - "integrity": "sha512-sHlnqTlJ/XEc/lv0MIKYI1R643CWFvYL6QyZD7f38FvP1RblZ6eVqvOJcrkpwcvRWcZNEY+GrQpb1Io1ZvMEmQ==", + "version": "15.7.1", + "resolved": "https://registry.npmjs.org/@nrwl/tao/-/tao-15.7.1.tgz", + "integrity": "sha512-pCKIijUGUAht+Lfy9P4WaHxTHnqqr+vaC00vX6XSlkRoFAUFYh7lhbOHDSKOwBG016ZoG73P1IIMg0um4ybd5w==", "dev": true, "requires": { - "nx": "14.4.3" + "nx": "15.7.1" } }, "@octokit/auth-token": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-3.0.0.tgz", - "integrity": "sha512-MDNFUBcJIptB9At7HiV7VCvU3NcL4GnfCQaP8C5lrxWrRPMJBnemYtehaKSOlaM7AYxeRyj9etenu8LVpSpVaQ==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-3.0.3.tgz", + "integrity": "sha512-/aFM2M4HVDBT/jjDBa84sJniv1t9Gm/rLkalaz9htOm+L+8JMj1k9w0CkUdcxNyNxZPlTxKPVko+m1VlM58ZVA==", "dev": true, "requires": { - "@octokit/types": "^6.0.3" + "@octokit/types": "^9.0.0" } }, "@octokit/core": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@octokit/core/-/core-4.0.4.tgz", - "integrity": "sha512-sUpR/hc4Gc7K34o60bWC7WUH6Q7T6ftZ2dUmepSyJr9PRF76/qqkWjE2SOEzCqLA5W83SaISymwKtxks+96hPQ==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@octokit/core/-/core-4.2.0.tgz", + "integrity": "sha512-AgvDRUg3COpR82P7PBdGZF/NNqGmtMq2NiPqeSsDIeCfYFOZ9gddqWNQHnFdEUf+YwOj4aZYmJnlPp7OXmDIDg==", "dev": true, "requires": { "@octokit/auth-token": "^3.0.0", "@octokit/graphql": "^5.0.0", "@octokit/request": "^6.0.0", "@octokit/request-error": "^3.0.0", - "@octokit/types": "^6.0.3", + "@octokit/types": "^9.0.0", "before-after-hook": "^2.2.0", "universal-user-agent": "^6.0.0" } }, "@octokit/endpoint": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-7.0.0.tgz", - "integrity": "sha512-Kz/mIkOTjs9rV50hf/JK9pIDl4aGwAtT8pry6Rpy+hVXkAPhXanNQRxMoq6AeRgDCZR6t/A1zKniY2V1YhrzlQ==", + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-7.0.5.tgz", + "integrity": "sha512-LG4o4HMY1Xoaec87IqQ41TQ+glvIeTKqfjkCEmt5AIwDZJwQeVZFIEYXrYY6yLwK+pAScb9Gj4q+Nz2qSw1roA==", "dev": true, "requires": { - "@octokit/types": "^6.0.3", + "@octokit/types": "^9.0.0", "is-plain-object": "^5.0.0", "universal-user-agent": "^6.0.0" } }, "@octokit/graphql": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-5.0.0.tgz", - "integrity": "sha512-1ZZ8tX4lUEcLPvHagfIVu5S2xpHYXAmgN0+95eAOPoaVPzCfUXJtA5vASafcpWcO86ze0Pzn30TAx72aB2aguQ==", + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-5.0.5.tgz", + "integrity": "sha512-Qwfvh3xdqKtIznjX9lz2D458r7dJPP8l6r4GQkIdWQouZwHQK0mVT88uwiU2bdTU2OtT1uOlKpRciUWldpG0yQ==", "dev": true, "requires": { "@octokit/request": "^6.0.0", - "@octokit/types": "^6.0.3", + "@octokit/types": "^9.0.0", "universal-user-agent": "^6.0.0" } }, "@octokit/openapi-types": { - "version": "12.11.0", - "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-12.11.0.tgz", - "integrity": "sha512-VsXyi8peyRq9PqIz/tpqiL2w3w80OgVMwBHltTml3LmVvXiphgeqmY9mvBw9Wu7e0QWk/fqD37ux8yP5uVekyQ==", + "version": "16.0.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-16.0.0.tgz", + "integrity": "sha512-JbFWOqTJVLHZSUUoF4FzAZKYtqdxWu9Z5m2QQnOyEa04fOFljvyh7D3GYKbfuaSWisqehImiVIMG4eyJeP5VEA==", "dev": true }, "@octokit/plugin-enterprise-rest": { @@ -11152,6 +10573,23 @@ "dev": true, "requires": { "@octokit/types": "^6.41.0" + }, + "dependencies": { + "@octokit/openapi-types": { + "version": "12.11.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-12.11.0.tgz", + "integrity": "sha512-VsXyi8peyRq9PqIz/tpqiL2w3w80OgVMwBHltTml3LmVvXiphgeqmY9mvBw9Wu7e0QWk/fqD37ux8yP5uVekyQ==", + "dev": true + }, + "@octokit/types": { + "version": "6.41.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.41.0.tgz", + "integrity": "sha512-eJ2jbzjdijiL3B4PrSQaSjuF2sPEQPVCPzBvTHJD9Nz+9dw2SGH4K4xeQJ77YfTq5bRQ+bD8wT11JbeDPmxmGg==", + "dev": true, + "requires": { + "@octokit/openapi-types": "^12.11.0" + } + } } }, "@octokit/plugin-request-log": { @@ -11162,36 +10600,53 @@ "requires": {} }, "@octokit/plugin-rest-endpoint-methods": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-6.2.0.tgz", - "integrity": "sha512-PZ+yfkbZAuRUtqu6Y191/V3eM0KBPx+Yq7nh+ONPdpm3EX4pd5UnK2y2XgO/0AtNum5a4aJCDjqsDuUZ2hWRXw==", + "version": "6.8.1", + "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-6.8.1.tgz", + "integrity": "sha512-QrlaTm8Lyc/TbU7BL/8bO49vp+RZ6W3McxxmmQTgYxf2sWkO8ZKuj4dLhPNJD6VCUW1hetCmeIM0m6FTVpDiEg==", "dev": true, "requires": { - "@octokit/types": "^6.41.0", + "@octokit/types": "^8.1.1", "deprecation": "^2.3.1" + }, + "dependencies": { + "@octokit/openapi-types": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-14.0.0.tgz", + "integrity": "sha512-HNWisMYlR8VCnNurDU6os2ikx0s0VyEjDYHNS/h4cgb8DeOxQ0n72HyinUtdDVxJhFy3FWLGl0DJhfEWk3P5Iw==", + "dev": true + }, + "@octokit/types": { + "version": "8.2.1", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-8.2.1.tgz", + "integrity": "sha512-8oWMUji8be66q2B9PmEIUyQm00VPDPun07umUWSaCwxmeaquFBro4Hcc3ruVoDo3zkQyZBlRvhIMEYS3pBhanw==", + "dev": true, + "requires": { + "@octokit/openapi-types": "^14.0.0" + } + } } }, "@octokit/request": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/@octokit/request/-/request-6.2.0.tgz", - "integrity": "sha512-7IAmHnaezZrgUqtRShMlByJK33MT9ZDnMRgZjnRrRV9a/jzzFwKGz0vxhFU6i7VMLraYcQ1qmcAOin37Kryq+Q==", + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-6.2.3.tgz", + "integrity": "sha512-TNAodj5yNzrrZ/VxP+H5HiYaZep0H3GU0O7PaF+fhDrt8FPrnkei9Aal/txsN/1P7V3CPiThG0tIvpPDYUsyAA==", "dev": true, "requires": { "@octokit/endpoint": "^7.0.0", "@octokit/request-error": "^3.0.0", - "@octokit/types": "^6.16.1", + "@octokit/types": "^9.0.0", "is-plain-object": "^5.0.0", "node-fetch": "^2.6.7", "universal-user-agent": "^6.0.0" } }, "@octokit/request-error": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-3.0.0.tgz", - "integrity": "sha512-WBtpzm9lR8z4IHIMtOqr6XwfkGvMOOILNLxsWvDwtzm/n7f5AWuqJTXQXdDtOvPfTDrH4TPhEvW2qMlR4JFA2w==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-3.0.3.tgz", + "integrity": "sha512-crqw3V5Iy2uOU5Np+8M/YexTlT8zxCfI+qu+LxUB7SZpje4Qmx3mub5DfEKSO8Ylyk0aogi6TYdf6kxzh2BguQ==", "dev": true, "requires": { - "@octokit/types": "^6.0.3", + "@octokit/types": "^9.0.0", "deprecation": "^2.0.0", "once": "^1.4.0" } @@ -11209,12 +10664,12 @@ } }, "@octokit/types": { - "version": "6.41.0", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.41.0.tgz", - "integrity": "sha512-eJ2jbzjdijiL3B4PrSQaSjuF2sPEQPVCPzBvTHJD9Nz+9dw2SGH4K4xeQJ77YfTq5bRQ+bD8wT11JbeDPmxmGg==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-9.0.0.tgz", + "integrity": "sha512-LUewfj94xCMH2rbD5YJ+6AQ4AVjFYTgpp6rboWM5T7N3IsIF65SBEOVcYMGAEzO/kKNiNaW4LoWtoThOhH06gw==", "dev": true, "requires": { - "@octokit/openapi-types": "^12.11.0" + "@octokit/openapi-types": "^16.0.0" } }, "@parcel/watcher": { @@ -11223,8 +10678,17 @@ "integrity": "sha512-cTDi+FUDBIUOBKEtj+nhiJ71AZVlkAsQFuGQTun5tV9mwQBQgZvhCzG+URPQc8myeN32yRVZEfVAPCs1RW+Jvg==", "dev": true, "requires": { - "node-addon-api": "^3.2.1", - "node-gyp-build": "^4.3.0" + "node-addon-api": "^3.2.1", + "node-gyp-build": "^4.3.0" + } + }, + "@phenomnomnominal/tsquery": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@phenomnomnominal/tsquery/-/tsquery-4.1.1.tgz", + "integrity": "sha512-jjMmK1tnZbm1Jq5a7fBliM4gQwjxMU7TFoRNwIyzwlO+eHPRCFv/Nv+H/Gi1jc3WR7QURG8D5d0Tn12YGrUqBQ==", + "dev": true, + "requires": { + "esquery": "^1.0.1" } }, "@pnpm/network.ca-file": { @@ -11246,60 +10710,6 @@ "config-chain": "^1.1.11" } }, - "@protobufjs/aspromise": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", - "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==" - }, - "@protobufjs/base64": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", - "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" - }, - "@protobufjs/codegen": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", - "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" - }, - "@protobufjs/eventemitter": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", - "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==" - }, - "@protobufjs/fetch": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", - "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", - "requires": { - "@protobufjs/aspromise": "^1.1.1", - "@protobufjs/inquire": "^1.1.0" - } - }, - "@protobufjs/float": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", - "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==" - }, - "@protobufjs/inquire": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", - "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==" - }, - "@protobufjs/path": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", - "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==" - }, - "@protobufjs/pool": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", - "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==" - }, - "@protobufjs/utf8": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", - "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==" - }, "@sindresorhus/is": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.3.0.tgz", @@ -11321,16 +10731,33 @@ "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", "dev": true }, - "@types/cacheable-request": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/@types/cacheable-request/-/cacheable-request-6.0.2.tgz", - "integrity": "sha512-B3xVo+dlKM6nnKTcmm5ZtY/OL8bOAOd2Olee9M1zft65ox50OzjEHW91sDiU9j6cvW8Ejg1/Qkf4xd2kugApUA==", + "@tufjs/models": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@tufjs/models/-/models-1.0.0.tgz", + "integrity": "sha512-RRMu4uMxWnZlxaIBxahSb2IssFZiu188sndesZflWOe1cA/qUqtemSIoBWbuVKPvvdktapImWNnKpBcc+VrCQw==", "dev": true, "requires": { - "@types/http-cache-semantics": "*", - "@types/keyv": "*", - "@types/node": "*", - "@types/responselike": "*" + "minimatch": "^6.1.0" + }, + "dependencies": { + "brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0" + } + }, + "minimatch": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-6.2.0.tgz", + "integrity": "sha512-sauLxniAmvnhhRjFwPNnJKaPFYyddAgbYdeUpHULtCT/GhzdCx/MDNy+Y40lBxTQUrMzDE8e0S43Z5uqfO0REg==", + "dev": true, + "requires": { + "brace-expansion": "^2.0.1" + } + } } }, "@types/glob": { @@ -11349,42 +10776,16 @@ "integrity": "sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ==", "dev": true }, - "@types/json-buffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/json-buffer/-/json-buffer-3.0.0.tgz", - "integrity": "sha512-3YP80IxxFJB4b5tYC2SUPwkg0XQLiu0nWvhRgEatgjf+29IcWO9X1k8xRv5DGssJ/lCrjYTjQPcobJr2yWIVuQ==", - "dev": true - }, "@types/json-schema": { "version": "7.0.11", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", "dev": true }, - "@types/json5": { - "version": "0.0.29", - "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", - "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", - "dev": true - }, - "@types/keyv": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/@types/keyv/-/keyv-3.1.4.tgz", - "integrity": "sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, - "@types/long": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz", - "integrity": "sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==" - }, "@types/minimatch": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.5.tgz", - "integrity": "sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-5.1.2.tgz", + "integrity": "sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==", "dev": true }, "@types/minimist": { @@ -11396,7 +10797,8 @@ "@types/node": { "version": "17.0.45", "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.45.tgz", - "integrity": "sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==" + "integrity": "sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==", + "dev": true }, "@types/normalize-package-data": { "version": "2.4.1", @@ -11404,158 +10806,178 @@ "integrity": "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==", "dev": true }, - "@types/object-hash": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/@types/object-hash/-/object-hash-1.3.4.tgz", - "integrity": "sha512-xFdpkAkikBgqBdG9vIlsqffDV8GpvnPEzs0IUtr1v3BEB97ijsFQ4RXVbUZwjFThhB4MDSTUfvmxUD5PGx0wXA==" - }, "@types/parse-json": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", "dev": true }, - "@types/responselike": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.0.tgz", - "integrity": "sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==", - "dev": true, - "requires": { - "@types/node": "*" - } + "@types/semver": { + "version": "7.3.13", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.13.tgz", + "integrity": "sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==", + "dev": true }, "@types/yargs": { - "version": "16.0.4", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.4.tgz", - "integrity": "sha512-T8Yc9wt/5LbJyCaLiHPReJa0kApcIgJ7Bn735GjItUfh08Z1pJvu8QZqb9s+mMvKV6WUQRV7K2R46YbjMXTTJw==", + "version": "16.0.5", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.5.tgz", + "integrity": "sha512-AxO/ADJOBFJScHbWhq2xAhlWP24rY4aCEG/NFaMvbT3X2MgRsLjhjQwsn0Zi5zn0LG9jUhCCZMeX9Dkuw6k+vQ==", "dev": true, "requires": { "@types/yargs-parser": "*" } }, "@types/yargs-parser": { - "version": "20.2.1", - "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-20.2.1.tgz", - "integrity": "sha512-7tFImggNeNBVMsn0vLrpn1H1uPrUBdnARPTpZoitY37ZrdJREzf7I16tMrlK3hen349gr1NYh8CmZQa7CTG6Aw==", + "version": "21.0.0", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.0.tgz", + "integrity": "sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==", "dev": true }, "@typescript-eslint/eslint-plugin": { - "version": "5.32.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.32.0.tgz", - "integrity": "sha512-CHLuz5Uz7bHP2WgVlvoZGhf0BvFakBJKAD/43Ty0emn4wXWv5k01ND0C0fHcl/Im8Td2y/7h44E9pca9qAu2ew==", + "version": "5.54.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.54.0.tgz", + "integrity": "sha512-+hSN9BdSr629RF02d7mMtXhAJvDTyCbprNYJKrXETlul/Aml6YZwd90XioVbjejQeHbb3R8Dg0CkRgoJDxo8aw==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "5.32.0", - "@typescript-eslint/type-utils": "5.32.0", - "@typescript-eslint/utils": "5.32.0", + "@typescript-eslint/scope-manager": "5.54.0", + "@typescript-eslint/type-utils": "5.54.0", + "@typescript-eslint/utils": "5.54.0", "debug": "^4.3.4", - "functional-red-black-tree": "^1.0.1", + "grapheme-splitter": "^1.0.4", "ignore": "^5.2.0", + "natural-compare-lite": "^1.4.0", "regexpp": "^3.2.0", "semver": "^7.3.7", "tsutils": "^3.21.0" - }, - "dependencies": { - "semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", - "dev": true, - "requires": { - "lru-cache": "^6.0.0" - } - } } }, "@typescript-eslint/parser": { - "version": "5.32.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.32.0.tgz", - "integrity": "sha512-IxRtsehdGV9GFQ35IGm5oKKR2OGcazUoiNBxhRV160iF9FoyuXxjY+rIqs1gfnd+4eL98OjeGnMpE7RF/NBb3A==", + "version": "5.54.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.54.0.tgz", + "integrity": "sha512-aAVL3Mu2qTi+h/r04WI/5PfNWvO6pdhpeMRWk9R7rEV4mwJNzoWf5CCU5vDKBsPIFQFjEq1xg7XBI2rjiMXQbQ==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "5.32.0", - "@typescript-eslint/types": "5.32.0", - "@typescript-eslint/typescript-estree": "5.32.0", + "@typescript-eslint/scope-manager": "5.54.0", + "@typescript-eslint/types": "5.54.0", + "@typescript-eslint/typescript-estree": "5.54.0", "debug": "^4.3.4" } }, "@typescript-eslint/scope-manager": { - "version": "5.32.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.32.0.tgz", - "integrity": "sha512-KyAE+tUON0D7tNz92p1uetRqVJiiAkeluvwvZOqBmW9z2XApmk5WSMV9FrzOroAcVxJZB3GfUwVKr98Dr/OjOg==", + "version": "5.54.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.54.0.tgz", + "integrity": "sha512-VTPYNZ7vaWtYna9M4oD42zENOBrb+ZYyCNdFs949GcN8Miwn37b8b7eMj+EZaq7VK9fx0Jd+JhmkhjFhvnovhg==", "dev": true, "requires": { - "@typescript-eslint/types": "5.32.0", - "@typescript-eslint/visitor-keys": "5.32.0" + "@typescript-eslint/types": "5.54.0", + "@typescript-eslint/visitor-keys": "5.54.0" } }, "@typescript-eslint/type-utils": { - "version": "5.32.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.32.0.tgz", - "integrity": "sha512-0gSsIhFDduBz3QcHJIp3qRCvVYbqzHg8D6bHFsDMrm0rURYDj+skBK2zmYebdCp+4nrd9VWd13egvhYFJj/wZg==", + "version": "5.54.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.54.0.tgz", + "integrity": "sha512-WI+WMJ8+oS+LyflqsD4nlXMsVdzTMYTxl16myXPaCXnSgc7LWwMsjxQFZCK/rVmTZ3FN71Ct78ehO9bRC7erYQ==", "dev": true, "requires": { - "@typescript-eslint/utils": "5.32.0", + "@typescript-eslint/typescript-estree": "5.54.0", + "@typescript-eslint/utils": "5.54.0", "debug": "^4.3.4", "tsutils": "^3.21.0" } }, "@typescript-eslint/types": { - "version": "5.32.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.32.0.tgz", - "integrity": "sha512-EBUKs68DOcT/EjGfzywp+f8wG9Zw6gj6BjWu7KV/IYllqKJFPlZlLSYw/PTvVyiRw50t6wVbgv4p9uE2h6sZrQ==", + "version": "5.54.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.54.0.tgz", + "integrity": "sha512-nExy+fDCBEgqblasfeE3aQ3NuafBUxZxgxXcYfzYRZFHdVvk5q60KhCSkG0noHgHRo/xQ/BOzURLZAafFpTkmQ==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "5.32.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.32.0.tgz", - "integrity": "sha512-ZVAUkvPk3ITGtCLU5J4atCw9RTxK+SRc6hXqLtllC2sGSeMFWN+YwbiJR9CFrSFJ3w4SJfcWtDwNb/DmUIHdhg==", + "version": "5.54.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.54.0.tgz", + "integrity": "sha512-X2rJG97Wj/VRo5YxJ8Qx26Zqf0RRKsVHd4sav8NElhbZzhpBI8jU54i6hfo9eheumj4oO4dcRN1B/zIVEqR/MQ==", "dev": true, "requires": { - "@typescript-eslint/types": "5.32.0", - "@typescript-eslint/visitor-keys": "5.32.0", + "@typescript-eslint/types": "5.54.0", + "@typescript-eslint/visitor-keys": "5.54.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", "semver": "^7.3.7", "tsutils": "^3.21.0" - }, - "dependencies": { - "semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", - "dev": true, - "requires": { - "lru-cache": "^6.0.0" - } - } } }, "@typescript-eslint/utils": { - "version": "5.32.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.32.0.tgz", - "integrity": "sha512-W7lYIAI5Zlc5K082dGR27Fczjb3Q57ECcXefKU/f0ajM5ToM0P+N9NmJWip8GmGu/g6QISNT+K6KYB+iSHjXCQ==", + "version": "5.54.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.54.0.tgz", + "integrity": "sha512-cuwm8D/Z/7AuyAeJ+T0r4WZmlnlxQ8wt7C7fLpFlKMR+dY6QO79Cq1WpJhvZbMA4ZeZGHiRWnht7ZJ8qkdAunw==", "dev": true, "requires": { "@types/json-schema": "^7.0.9", - "@typescript-eslint/scope-manager": "5.32.0", - "@typescript-eslint/types": "5.32.0", - "@typescript-eslint/typescript-estree": "5.32.0", + "@types/semver": "^7.3.12", + "@typescript-eslint/scope-manager": "5.54.0", + "@typescript-eslint/types": "5.54.0", + "@typescript-eslint/typescript-estree": "5.54.0", "eslint-scope": "^5.1.1", - "eslint-utils": "^3.0.0" + "eslint-utils": "^3.0.0", + "semver": "^7.3.7" } }, "@typescript-eslint/visitor-keys": { - "version": "5.32.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.32.0.tgz", - "integrity": "sha512-S54xOHZgfThiZ38/ZGTgB2rqx51CMJ5MCfVT2IplK4Q7hgzGfe0nLzLCcenDnc/cSjP568hdeKfeDcBgqNHD/g==", + "version": "5.54.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.54.0.tgz", + "integrity": "sha512-xu4wT7aRCakGINTLGeyGqDn+78BwFlggwBjnHa1ar/KaGagnmwLYmlrXIrgAaQ3AE1Vd6nLfKASm7LrFHNbKGA==", "dev": true, "requires": { - "@typescript-eslint/types": "5.32.0", + "@typescript-eslint/types": "5.54.0", "eslint-visitor-keys": "^3.3.0" } }, + "@yarnpkg/lockfile": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz", + "integrity": "sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==", + "dev": true + }, + "@yarnpkg/parsers": { + "version": "3.0.0-rc.39", + "resolved": "https://registry.npmjs.org/@yarnpkg/parsers/-/parsers-3.0.0-rc.39.tgz", + "integrity": "sha512-BsD4zq3EVmaHqlynXTceNuEFAtrfToV4fI9GA54moKlWZL4Eb2eXrhgf1jV2nMYx18SZxYO4Jc5Kf1sCDNRjOg==", + "dev": true, + "requires": { + "js-yaml": "^3.10.0", + "tslib": "^2.4.0" + }, + "dependencies": { + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + } + } + }, + "@zkochan/js-yaml": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/@zkochan/js-yaml/-/js-yaml-0.0.6.tgz", + "integrity": "sha512-nzvgl3VfhcELQ8LyVrYOru+UtAy1nrygk2+AGbTm8a5YcO6o8lSjAT+pfg3vJWxIoZKOUhrK6UU7xW/+00kQrg==", + "dev": true, + "requires": { + "argparse": "^2.0.1" + } + }, "abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", @@ -11563,9 +10985,9 @@ "dev": true }, "acorn": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz", - "integrity": "sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==", + "version": "8.8.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", + "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", "dev": true }, "acorn-jsx": { @@ -11670,16 +11092,6 @@ "color-convert": "^2.0.1" } }, - "anymatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", - "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", - "dev": true, - "requires": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - } - }, "aproba": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", @@ -11687,9 +11099,9 @@ "dev": true }, "are-we-there-yet": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-3.0.0.tgz", - "integrity": "sha512-0GWpv50YSOcLXaN6/FAKY3vfRbllXWV2xvfA/oKJF8pzFhWXPV+yjhJXDBbjscDYowv7Yw1A3uigpzn5iEGTyw==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-3.0.1.tgz", + "integrity": "sha512-QZW4EDmGwlYur0Yyf/b2uGucHQMa8aFUP7eu9ddR73vvhFyt4V0Vl3QHPcTNJ8l6qYOBdxgXdnBXQrHilfRQBg==", "dev": true, "requires": { "delegates": "^1.0.0", @@ -11732,12 +11144,35 @@ "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==", "dev": true }, + "async": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.4.tgz", + "integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==", + "dev": true + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "dev": true + }, "at-least-node": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", "dev": true }, + "axios": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.3.3.tgz", + "integrity": "sha512-eYq77dYIFS77AQlhzEL937yUBSepBfPIe8FcgEDN35vMNZKMrs81pgnyrQpwfy4NF4b4XWX1Zgx7yX+25w8QJA==", + "dev": true, + "requires": { + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, "balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -11751,43 +11186,33 @@ "dev": true }, "before-after-hook": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.2.tgz", - "integrity": "sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.3.tgz", + "integrity": "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==", "dev": true }, "bin-links": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/bin-links/-/bin-links-3.0.1.tgz", - "integrity": "sha512-9vx+ypzVhASvHTS6K+YSGf7nwQdANoz7v6MTC0aCtYnOEZ87YvMf81aY737EZnGZdpbRM3sfWjO9oWkKmuIvyQ==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/bin-links/-/bin-links-3.0.3.tgz", + "integrity": "sha512-zKdnMPWEdh4F5INR07/eBrodC7QrF5JKvqskjz/ZZRXg5YSAZIbn8zGhbhUrElzHBZ2fvEQdOU59RHcTG3GiwA==", "dev": true, "requires": { "cmd-shim": "^5.0.0", "mkdirp-infer-owner": "^2.0.0", - "npm-normalize-package-bin": "^1.0.0", + "npm-normalize-package-bin": "^2.0.0", "read-cmd-shim": "^3.0.0", "rimraf": "^3.0.0", "write-file-atomic": "^4.0.0" }, "dependencies": { - "write-file-atomic": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.1.tgz", - "integrity": "sha512-nSKUxgAbyioruk6hU87QzVbY279oYT6uiwgDoujth2ju4mJ+TZau7SQBhtbTmUyuNYTuXnSyRn66FV0+eCgcrQ==", - "dev": true, - "requires": { - "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.7" - } + "npm-normalize-package-bin": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-2.0.0.tgz", + "integrity": "sha512-awzfKUO7v0FscrSpRoogyNm0sajikhBWpU0QMrW09AMi9n1PoKU6WaIqUzuJSQnpciZZmJ/jMZ2Egfmb/9LiWQ==", + "dev": true } } }, - "binary-extensions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", - "dev": true - }, "bl": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", @@ -11822,9 +11247,9 @@ "dev": true }, "ansi-styles": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.1.0.tgz", - "integrity": "sha512-VbqNsoz55SYGczauuup0MFUyXNQviSpFTj1RQtFzmQLk18qbVSpTFFGMT293rmDaQuKCT6InmbuEyUne4mTuxQ==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", "dev": true }, "camelcase": { @@ -11834,9 +11259,9 @@ "dev": true }, "chalk": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.0.1.tgz", - "integrity": "sha512-Fo07WOYGqMfCWHOzSXOt2CxDbC6skS/jO9ynEcmpANMoPrD+W1r1K6Vx7iNm+AQmETU1Xr2t+n8nzkV9t6xh3w==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.1.2.tgz", + "integrity": "sha512-E5CkT4jWURs1Vy5qGJye+XwCkNj7Od3Af7CP6SujMetSMkLs8Do2RWJK5yx1wamHV/op8Rz+9rltjaTQWDnEFQ==", "dev": true }, "emoji-regex": { @@ -11866,9 +11291,9 @@ } }, "type-fest": { - "version": "2.18.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.18.0.tgz", - "integrity": "sha512-pRS+/yrW5TjPPHNOvxhbNZexr2bS63WjrMU8a+VzEBhUi9Tz1pZeD+vQz3ut0svZ46P+SRqMEPnJmk2XnvNzTw==", + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", + "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", "dev": true }, "wrap-ansi": { @@ -11929,15 +11354,15 @@ } }, "byte-size": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/byte-size/-/byte-size-7.0.1.tgz", - "integrity": "sha512-crQdqyCwhokxwV1UyDzLZanhkugAgft7vt0qbbdt60C6Zf3CAiGmtUCylbtYwrU6loOUw3euGrNtW1J651ot1A==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/byte-size/-/byte-size-7.0.0.tgz", + "integrity": "sha512-NNiBxKgxybMBtWdmvx7ZITJi4ZG+CYUgwOSZTfqB1qogkRHrhbQE/R2r5Fh94X+InN5MCYz6SvB/ejHMj/HbsQ==", "dev": true }, "cacache": { - "version": "16.1.1", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-16.1.1.tgz", - "integrity": "sha512-VDKN+LHyCQXaaYZ7rA/qtkURU+/yYhviUdvqEv2LT6QPZU8jpyzEkEVAcKlKLt5dJ5BRp11ym8lo3NKLluEPLg==", + "version": "16.1.3", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-16.1.3.tgz", + "integrity": "sha512-/+Emcj9DAXxX4cwlLmRI9c166RuL3w30zp4R7Joiv2cQTtTtA+jeuCAjH3ZlGnYS3tKENSrKhAzVVP9GVyzeYQ==", "dev": true, "requires": { "@npmcli/fs": "^2.1.0", @@ -11957,7 +11382,7 @@ "rimraf": "^3.0.2", "ssri": "^9.0.0", "tar": "^6.1.11", - "unique-filename": "^1.1.1" + "unique-filename": "^2.0.0" }, "dependencies": { "brace-expansion": { @@ -11982,12 +11407,6 @@ "once": "^1.3.0" } }, - "lru-cache": { - "version": "7.12.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.12.0.tgz", - "integrity": "sha512-OIP3DwzRZDfLg9B9VP/huWBlpvbkmbfiBy8xmsXp4RPmE4A3MhwNozc5ZJ3fWnSg8fDcdlE/neRTPG2ycEKliw==", - "dev": true - }, "minimatch": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", @@ -12000,41 +11419,24 @@ } }, "cacheable-lookup": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-6.0.4.tgz", - "integrity": "sha512-mbcDEZCkv2CZF4G01kr8eBd/5agkt9oCqz75tJMSIsquvRZ2sL6Hi5zGVKi/0OSC9oO1GHfJ2AV0ZIOY9vye0A==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-7.0.0.tgz", + "integrity": "sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w==", "dev": true }, "cacheable-request": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-7.0.2.tgz", - "integrity": "sha512-pouW8/FmiPQbuGpkXQ9BAPv/Mo5xDGANgSNXzTzJ8DrKGuXOssM4wIQRjfanNRh3Yu5cfYPvcorqbhg2KIJtew==", + "version": "10.2.7", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-10.2.7.tgz", + "integrity": "sha512-I4SA6mKgDxcxVbSt/UmIkb9Ny8qSkg6ReBHtAAXnZHk7KOSx5g3DTiAOaYzcHCs6oOdHn+bip9T48E6tMvK9hw==", "dev": true, "requires": { - "clone-response": "^1.0.2", - "get-stream": "^5.1.0", - "http-cache-semantics": "^4.0.0", - "keyv": "^4.0.0", - "lowercase-keys": "^2.0.0", - "normalize-url": "^6.0.1", - "responselike": "^2.0.0" - }, - "dependencies": { - "get-stream": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", - "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", - "dev": true, - "requires": { - "pump": "^3.0.0" - } - }, - "lowercase-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", - "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", - "dev": true - } + "@types/http-cache-semantics": "^4.0.1", + "get-stream": "^6.0.1", + "http-cache-semantics": "^4.1.1", + "keyv": "^4.5.2", + "mimic-response": "^4.0.0", + "normalize-url": "^8.0.0", + "responselike": "^3.0.0" } }, "callsites": { @@ -12076,22 +11478,6 @@ "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", "dev": true }, - "chokidar": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", - "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", - "dev": true, - "requires": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "fsevents": "~2.3.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" - } - }, "chownr": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", @@ -12185,15 +11571,6 @@ } } }, - "clone-response": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.3.tgz", - "integrity": "sha512-ROoL94jJH2dUVML2Y/5PEDNaSHgeOdSDicUyS7izcF63G6sTc/FTjLub4b8Il9S8S0beOfYt0TaA5qvFK+w0wA==", - "dev": true, - "requires": { - "mimic-response": "^1.0.0" - } - }, "cmd-shim": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/cmd-shim/-/cmd-shim-5.0.0.tgz", @@ -12227,7 +11604,7 @@ "colors": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz", - "integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=", + "integrity": "sha512-pFGrxThWcWQ2MsAz6RtgeWe4NK2kUE1WfsrvvlctdII745EW9I0yflqhe7++M5LEc7bV2c/9/5zc8sFcpL0Drw==", "dev": true }, "columnify": { @@ -12240,10 +11617,19 @@ "wcwidth": "^1.0.0" } }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "requires": { + "delayed-stream": "~1.0.0" + } + }, "commander": { - "version": "9.4.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-9.4.0.tgz", - "integrity": "sha512-sRPT+umqkz90UA8M1yqYfnHlZA7fF6nSphDtxeywPZ49ysjxDQybzk13CL+mXekDRG92skbcqCLVovuCusNmFw==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.0.tgz", + "integrity": "sha512-zS5PnTI22FIRM6ylNW8G4Ap0IEOyk62fhLSD0+uHRT9McRCLGpkVNvao4bjimpK/GShynyQkFFxHhwMcETmduA==", "dev": true }, "common-ancestor-path": { @@ -12273,20 +11659,10 @@ } } }, - "compress-brotli": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/compress-brotli/-/compress-brotli-1.3.8.tgz", - "integrity": "sha512-lVcQsjhxhIXsuupfy9fmZUFtAIdBmXA7EGY6GBdgZ++qkM9zG4YFT8iU7FoBxzryNDMOpD1HIFHUSX4D87oqhQ==", - "dev": true, - "requires": { - "@types/json-buffer": "~3.0.0", - "json-buffer": "~3.0.1" - } - }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true }, "concat-stream": { @@ -12322,18 +11698,32 @@ "unique-string": "^3.0.0", "write-file-atomic": "^3.0.3", "xdg-basedir": "^5.0.1" + }, + "dependencies": { + "write-file-atomic": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", + "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", + "dev": true, + "requires": { + "imurmurhash": "^0.1.4", + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^3.1.5" + } + } } }, "console-control-strings": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", + "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==", "dev": true }, "conventional-changelog-angular": { - "version": "5.0.13", - "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-5.0.13.tgz", - "integrity": "sha512-i/gipMxs7s8L/QeuavPF2hLnJgH6pEZAttySB6aiQLWcX3puWDL3ACVmvBhJGxnAy52Qc15ua26BufY6KpmrVA==", + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-5.0.12.tgz", + "integrity": "sha512-5GLsbnkR/7A89RyHLvvoExbiGbd9xKdKqDTrArnPbOqBqG/2wIosu0fHwpeIRI8Tl94MhVNBXcLJZl92ZQ5USw==", "dev": true, "requires": { "compare-func": "^2.0.0", @@ -12440,9 +11830,9 @@ "dev": true }, "cosmiconfig": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.1.tgz", - "integrity": "sha512-a1YWNUV2HwGimB7dU2s1wUMurNKjpx60HxBB6xUM8Re+2s1g1IIfJvFR0/iCF+XHdE0GMTKTuLR32UQff4TEyQ==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.0.tgz", + "integrity": "sha512-pondGvTuVYDk++upghXJabWzL6Kxu6f26ljFw64Swq9v6sQPUL3EUlVDV56diOjpCayKihL6hVe8exIACU4XcA==", "dev": true, "requires": { "@types/parse-json": "^4.0.0", @@ -12486,11 +11876,6 @@ "integrity": "sha512-2iy1EkLdlBzQGvbweYRFxmFath8+K7+AKB0TlhHWkNuH+TmovaMH/Wp7V7R4u7f4SnX3OgLsU9t1NI9ioDnUpg==", "dev": true }, - "dataloader": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/dataloader/-/dataloader-1.4.0.tgz", - "integrity": "sha512-68s5jYdlvasItOJnCuI2Q9s4q98g0pCyL3HrcKJu8KNugUl8ahgmZYg38ysLTgQjjXX3H8CJLkAvWrclWfcalw==" - }, "dateformat": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz", @@ -12519,9 +11904,9 @@ "dev": true }, "decamelize-keys": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.0.tgz", - "integrity": "sha512-ocLWuYzRPoS9bfiSdDd3cxvrzovVMZnRDVEzAs+hWIVXGDbHxWMECij2OBuyB/An0FFW/nLuq6Kv1i/YC5Qfzg==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.1.tgz", + "integrity": "sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg==", "dev": true, "requires": { "decamelize": "^1.1.0", @@ -12572,9 +11957,9 @@ "dev": true }, "defaults": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", - "integrity": "sha512-s82itHOnYrN0Ib8r+z7laQz3sdE+4FP3d9Q7VLO7U+KRT+CR0GsWuyHxzdAY82I7cXv0G/twrqomTJLOssO5HA==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz", + "integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==", "dev": true, "requires": { "clone": "^1.0.2" @@ -12592,6 +11977,12 @@ "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==", "dev": true }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "dev": true + }, "delegates": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", @@ -12671,6 +12062,15 @@ "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", "dev": true }, + "ejs": { + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.8.tgz", + "integrity": "sha512-/sXZeMlhS0ArkfX2Aw780gJzXSMPnKjtspYZv+f3NiKLlubezAHDU5+9xz6gd3/NhG3txQCo6xlglmTS+oTGEQ==", + "dev": true, + "requires": { + "jake": "^10.8.5" + } + }, "emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -12763,14 +12163,16 @@ "dev": true }, "eslint": { - "version": "8.21.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.21.0.tgz", - "integrity": "sha512-/XJ1+Qurf1T9G2M5IHrsjp+xrGT73RZf23xA1z5wB1ZzzEAWSZKvRwhWxTFp1rvkvCfwcvAUNAP31bhKTTGfDA==", + "version": "8.35.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.35.0.tgz", + "integrity": "sha512-BxAf1fVL7w+JLRQhWl2pzGeSiGqbWumV4WNvc9Rhp6tiCtm4oHnyPBSEtMGZwrQgudFQ+otqzWoPB7x+hxoWsw==", "dev": true, "requires": { - "@eslint/eslintrc": "^1.3.0", - "@humanwhocodes/config-array": "^0.10.4", - "@humanwhocodes/gitignore-to-minimatch": "^1.0.2", + "@eslint/eslintrc": "^2.0.0", + "@eslint/js": "8.35.0", + "@humanwhocodes/config-array": "^0.11.8", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", @@ -12780,21 +12182,21 @@ "eslint-scope": "^7.1.1", "eslint-utils": "^3.0.0", "eslint-visitor-keys": "^3.3.0", - "espree": "^9.3.3", - "esquery": "^1.4.0", + "espree": "^9.4.0", + "esquery": "^1.4.2", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", "find-up": "^5.0.0", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^6.0.1", - "globals": "^13.15.0", - "globby": "^11.1.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", "grapheme-splitter": "^1.0.4", "ignore": "^5.2.0", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-sdsl": "^4.1.4", "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", @@ -12802,90 +12204,34 @@ "minimatch": "^3.1.2", "natural-compare": "^1.4.0", "optionator": "^0.9.1", - "regexpp": "^3.2.0", - "strip-ansi": "^6.0.1", - "strip-json-comments": "^3.1.0", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" - }, - "dependencies": { - "eslint-scope": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", - "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", - "dev": true, - "requires": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" - } - }, - "estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true - }, - "find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dev": true, - "requires": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - } - }, - "glob-parent": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", - "dev": true, - "requires": { - "is-glob": "^4.0.3" - } - }, - "locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dev": true, - "requires": { - "p-locate": "^5.0.0" - } - }, - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "regexpp": "^3.2.0", + "strip-ansi": "^6.0.1", + "strip-json-comments": "^3.1.0", + "text-table": "^0.2.0" + }, + "dependencies": { + "eslint-scope": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", + "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", "dev": true, "requires": { - "yocto-queue": "^0.1.0" + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" } }, - "p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dev": true, - "requires": { - "p-limit": "^3.0.2" - } + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true } } }, "eslint-config-prettier": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.5.0.tgz", - "integrity": "sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q==", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.6.0.tgz", + "integrity": "sha512-bAF0eLpLVqP5oEVUFKpMA+NnRFICwn9X8B5jrR9FcqnYBuPbqWEjTEspPWMj5ye6czoSLDweCzSo3Ko7gGrZaA==", "dev": true, "requires": {} }, @@ -12930,9 +12276,9 @@ "dev": true }, "espree": { - "version": "9.3.3", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.3.tgz", - "integrity": "sha512-ORs1Rt/uQTqUKjDdGCyrtYxbazf5umATSf/K4qxjmZHORR6HJk+2s/2Pqe+Kk49HHINC/xNIrGfgh8sZcll0ng==", + "version": "9.4.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.4.1.tgz", + "integrity": "sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg==", "dev": true, "requires": { "acorn": "^8.8.0", @@ -12940,10 +12286,16 @@ "eslint-visitor-keys": "^3.3.0" } }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, "esquery": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", - "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", "dev": true, "requires": { "estraverse": "^5.1.0" @@ -12993,9 +12345,9 @@ "dev": true }, "execa": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", - "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.0.0.tgz", + "integrity": "sha512-ov6w/2LCiuyO4RLYGdpFGjkcs0wMTgGE8PrkTHikeUy5iJekXyPIKUjifk5CsE0pt7sMCrMZ3YNqoCj6idQOnQ==", "dev": true, "requires": { "cross-spawn": "^7.0.3", @@ -13010,9 +12362,9 @@ } }, "expect-more": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/expect-more/-/expect-more-1.1.0.tgz", - "integrity": "sha512-/iIJuRtKgUJwCKEHV5XtTbyrR5JEztzqHDEub6X+WLAVGEPfkEdvsTE1Y0r9vNQqhgP6Kbp9A9w6OEYUqJwLwQ==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/expect-more/-/expect-more-1.3.0.tgz", + "integrity": "sha512-HnXT5nJb9V3DMnr5RgA1TiKbu5kRaJ0GD1JkuhZvnr1Qe3HJq+ESnrcl/jmVUZ8Ycnl3Sp0OTYUhmO36d2+zow==", "dev": true }, "external-editor": { @@ -13033,9 +12385,9 @@ "dev": true }, "fast-glob": { - "version": "3.2.10", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.10.tgz", - "integrity": "sha512-s9nFhFnvR63wls6/kM88kQqDhMu0AfdjqouE2l5GVQPbqLgyFjjU5ry/r2yKsJxpb9Py1EYNqieFrmMaX4v++A==", + "version": "3.2.12", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", + "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", "dev": true, "requires": { "@nodelib/fs.stat": "^2.0.2", @@ -13043,6 +12395,17 @@ "glob-parent": "^5.1.2", "merge2": "^1.3.0", "micromatch": "^4.0.4" + }, + "dependencies": { + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + } } }, "fast-json-stable-stringify": { @@ -13054,7 +12417,7 @@ "fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", "dev": true }, "fast-memoize": { @@ -13098,6 +12461,35 @@ "flat-cache": "^3.0.4" } }, + "filelist": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz", + "integrity": "sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==", + "dev": true, + "requires": { + "minimatch": "^5.0.1" + }, + "dependencies": { + "brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0" + } + }, + "minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dev": true, + "requires": { + "brace-expansion": "^2.0.1" + } + } + } + }, "fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", @@ -13108,12 +12500,12 @@ } }, "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, "requires": { - "locate-path": "^5.0.0", + "locate-path": "^6.0.0", "path-exists": "^4.0.0" } }, @@ -13134,15 +12526,32 @@ } }, "flatted": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.4.tgz", - "integrity": "sha512-8/sOawo8tJ4QOBX8YlQBMxL8+RLZfxMQOif9o0KUKTNTjMYElWPE0r/m5VNFxTRd0NSw8qSy8dajrwX4RYI1Hw==", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", + "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", + "dev": true + }, + "follow-redirects": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", + "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", "dev": true }, + "form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + } + }, "form-data-encoder": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-2.0.1.tgz", - "integrity": "sha512-Oy+P9w5mnO4TWXVgUiQvggNKPI9/ummcSt5usuIV6HkaLKigwzPpoenhEqmGmx3zHqm6ZLJ+CR/99N8JLinaEw==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-2.1.3.tgz", + "integrity": "sha512-KqU0nnPMgIJcCOFTNJFEA8epcseEaoox4XZffTgy8jlI6pL/5EFyR54NRG7CnCJN0biY7q52DO3MH6/sJ/TKlQ==", "dev": true }, "fp-and-or": { @@ -13181,28 +12590,15 @@ "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "dev": true }, - "fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, - "optional": true - }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, - "functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", - "dev": true - }, "gauge": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/gauge/-/gauge-4.0.4.tgz", @@ -13347,22 +12743,22 @@ } }, "git-up": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/git-up/-/git-up-6.0.0.tgz", - "integrity": "sha512-6RUFSNd1c/D0xtGnyWN2sxza2bZtZ/EmI9448n6rCZruFwV/ezeEn2fJP7XnUQGwf0RAtd/mmUCbtH6JPYA2SA==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/git-up/-/git-up-7.0.0.tgz", + "integrity": "sha512-ONdIrbBCFusq1Oy0sC71F5azx8bVkvtZtMJAsv+a6lz5YAmbNnLD6HAB4gptHZVLPR8S2/kVN6Gab7lryq5+lQ==", "dev": true, "requires": { "is-ssh": "^1.4.0", - "parse-url": "^7.0.2" + "parse-url": "^8.1.0" } }, "git-url-parse": { - "version": "12.0.0", - "resolved": "https://registry.npmjs.org/git-url-parse/-/git-url-parse-12.0.0.tgz", - "integrity": "sha512-I6LMWsxV87vysX1WfsoglXsXg6GjQRKq7+Dgiseo+h0skmp5Hp2rzmcEIRQot9CPA+uzU7x1x7jZdqvTFGnB+Q==", + "version": "13.1.0", + "resolved": "https://registry.npmjs.org/git-url-parse/-/git-url-parse-13.1.0.tgz", + "integrity": "sha512-5FvPJP/70WkIprlUZ33bm4UAaFdjcLkJLpWft1BeZKqwR0uhhNGoKwlUaPtVb4LxCSQ++erHapRak9kWGj+FCA==", "dev": true, "requires": { - "git-up": "^6.0.0" + "git-up": "^7.0.0" } }, "gitconfiglocal": { @@ -13386,26 +12782,15 @@ "minimatch": "^3.1.1", "once": "^1.3.0", "path-is-absolute": "^1.0.0" - }, - "dependencies": { - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - } } }, "glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, "requires": { - "is-glob": "^4.0.1" + "is-glob": "^4.0.3" } }, "global-dirs": { @@ -13426,9 +12811,9 @@ } }, "globals": { - "version": "13.15.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.15.0.tgz", - "integrity": "sha512-bpzcOlgDhMG070Av0Vy5Owklpv1I6+j96GhUI7Rh7IzDCKLzboflLrrfqMu8NquDbiR4EOQk7XzJwqVJxicxog==", + "version": "13.20.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", + "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", "dev": true, "requires": { "type-fest": "^0.20.2" @@ -13449,24 +12834,22 @@ } }, "got": { - "version": "12.3.0", - "resolved": "https://registry.npmjs.org/got/-/got-12.3.0.tgz", - "integrity": "sha512-7uK06aluHF0UibYFBX3lFUZ2FG/W0KS4O4EqAIrbWIdbPxIT33r6ZJy7Zy+pdh0CP/ZbF3zBa7Fd9dCn7vGPBg==", + "version": "12.5.2", + "resolved": "https://registry.npmjs.org/got/-/got-12.5.2.tgz", + "integrity": "sha512-guHGMSEcsA5m1oPRweXUJnug0vuvlkX9wx5hzOka+ZBrBUOJHU0Z1JcNu3QE5IPGnA5aXUsQHdWOD4eJg9/v3A==", "dev": true, "requires": { "@sindresorhus/is": "^5.2.0", "@szmarczak/http-timer": "^5.0.1", - "@types/cacheable-request": "^6.0.2", - "@types/responselike": "^1.0.0", - "cacheable-lookup": "^6.0.4", - "cacheable-request": "^7.0.2", + "cacheable-lookup": "^7.0.0", + "cacheable-request": "^10.2.1", "decompress-response": "^6.0.0", - "form-data-encoder": "^2.0.1", + "form-data-encoder": "^2.1.2", "get-stream": "^6.0.1", "http2-wrapper": "^2.1.10", "lowercase-keys": "^3.0.0", "p-cancelable": "^3.0.0", - "responselike": "^2.0.0" + "responselike": "^3.0.0" } }, "graceful-fs": { @@ -13534,12 +12917,23 @@ "dev": true, "requires": { "lru-cache": "^6.0.0" + }, + "dependencies": { + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + } } }, "http-cache-semantics": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", - "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", + "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==", "dev": true }, "http-proxy-agent": { @@ -13636,9 +13030,9 @@ } }, "minimatch": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", - "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", "dev": true, "requires": { "brace-expansion": "^2.0.1" @@ -13675,7 +13069,7 @@ "imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", "dev": true }, "indent-string": { @@ -13693,7 +13087,7 @@ "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", "dev": true, "requires": { "once": "^1.3.0", @@ -13728,24 +13122,18 @@ }, "dependencies": { "hosted-git-info": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.0.0.tgz", - "integrity": "sha512-rRnjWu0Bxj+nIfUOkz0695C0H6tRrN5iYIzYejb0tDEefe2AekHu/U5Kn9pEie5vsJqpNQU02az7TGSH3qpz4Q==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.2.1.tgz", + "integrity": "sha512-xIcQYMnhcx2Nr4JTjsFmwwnr9vldugPy9uVm0o87bjqqWMv9GaqsTeT+i99wTl0mk1uLxJtHxLb8kymqTENQsw==", "dev": true, "requires": { "lru-cache": "^7.5.1" } }, - "lru-cache": { - "version": "7.13.2", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.13.2.tgz", - "integrity": "sha512-VJL3nIpA79TodY/ctmZEfhASgqekbT574/c4j3jn4bKXbSCnTTCH/KltZyvL2GlV+tGSMtsWyem8DCX7qKTMBA==", - "dev": true - }, "npm-package-arg": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-9.1.0.tgz", - "integrity": "sha512-4J0GL+u2Nh6OnhvUKXRr2ZMG4lR8qtLp+kv7UiV00Y+nGiSxtttCyIRHCt5L5BNkXQld/RceYItau3MDOoGiBw==", + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-9.1.2.tgz", + "integrity": "sha512-pzd9rLEx4TfNJkovvlBSLGhq31gGu2QDexFPWT19yCDh0JgnRhlBLNo5759N0AJmBk+kQ9Y/hXoLnlgFD+ukmg==", "dev": true, "requires": { "hosted-git-info": "^5.0.0", @@ -13757,9 +13145,9 @@ } }, "inquirer": { - "version": "8.2.4", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-8.2.4.tgz", - "integrity": "sha512-nn4F01dxU8VeKfq192IjLsxu0/OmMZ4Lg3xKAns148rCaXP6ntAoEkVYZThWjwON8AlzdZZi6oqnhNbxUG9hVg==", + "version": "8.2.5", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-8.2.5.tgz", + "integrity": "sha512-QAgPDQMEgrDssk1XiwwHoOGYF9BAbUcc1+j+FhEvaOt8/cKRqyLn0U5qA6F74fGhTMGxf92pOvPBeh29jQJDTQ==", "dev": true, "requires": { "ansi-escapes": "^4.2.1", @@ -13788,18 +13176,9 @@ "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", "dev": true }, - "is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, - "requires": { - "binary-extensions": "^2.0.0" - } - }, "is-ci": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", @@ -13810,9 +13189,9 @@ } }, "is-core-module": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz", - "integrity": "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==", + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz", + "integrity": "sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==", "dev": true, "requires": { "has": "^1.0.3" @@ -13827,7 +13206,7 @@ "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "dev": true }, "is-fullwidth-code-point": { @@ -13913,9 +13292,9 @@ } }, "is-stream": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", - "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", + "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", "dev": true }, "is-text-path": { @@ -13930,7 +13309,7 @@ "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", "dev": true }, "is-unicode-supported": { @@ -13963,7 +13342,7 @@ "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "dev": true }, "isobject": { @@ -13972,10 +13351,28 @@ "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", "dev": true }, + "jake": { + "version": "10.8.5", + "resolved": "https://registry.npmjs.org/jake/-/jake-10.8.5.tgz", + "integrity": "sha512-sVpxYeuAhWt0OTWITwT98oyV0GsXyMlXCF+3L1SuafBVUIr/uILGRB+NqwkzhgXKvoJpDIpQvqkUALgdmQsQxw==", + "dev": true, + "requires": { + "async": "^3.2.3", + "chalk": "^4.0.2", + "filelist": "^1.0.1", + "minimatch": "^3.0.4" + } + }, "jju": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/jju/-/jju-1.4.0.tgz", - "integrity": "sha1-o6vicYryQaKykE+EpiWXDzia4yo=", + "integrity": "sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA==", + "dev": true + }, + "js-sdsl": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.1.5.tgz", + "integrity": "sha512-08bOAKweV2NUC1wqTtf3qZlnpOX/R2DU9ikpjOHs0H+ibQv3zpncVQg6um4uYtRtrwIX8M4Nh3ytK4HGlYAq7Q==", "dev": true }, "js-tokens": { @@ -14014,7 +13411,7 @@ "json-parse-helpfulerror": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/json-parse-helpfulerror/-/json-parse-helpfulerror-1.0.3.tgz", - "integrity": "sha1-E/FM4C7tTpgSl7ZOueO5MuLdE9w=", + "integrity": "sha512-XgP0FGR77+QhUxjXkwOMkC94k3WtqEBfcnjWqhRd82qTat4SWKRE+9kUnynz/shm3I4ea2+qISvTIeGTNU7kJg==", "dev": true, "requires": { "jju": "^1.1.0" @@ -14029,7 +13426,7 @@ "json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", "dev": true }, "json-stringify-nice": { @@ -14045,15 +13442,15 @@ "dev": true }, "json5": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", - "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "dev": true }, "jsonc-parser": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.1.0.tgz", - "integrity": "sha512-DRf0QjnNeCUds3xTjKlQQ3DpJD51GvDjJfnxUVWg6PZTo2otSm+slzNAxU/35hF8/oJIKoG9slq30JYOsF2azg==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz", + "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==", "dev": true }, "jsonfile": { @@ -14069,13 +13466,13 @@ "jsonlines": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsonlines/-/jsonlines-0.1.1.tgz", - "integrity": "sha1-T80kbcXQ44aRkHxEqwAveC0dlMw=", + "integrity": "sha512-ekDrAGso79Cvf+dtm+mL8OBI2bmAOt3gssYs833De/C9NmIpWDWyUO4zPgB5x2/OhY366dkhgfPMYfwZF7yOZA==", "dev": true }, "jsonparse": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", - "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", + "integrity": "sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==", "dev": true }, "JSONStream": { @@ -14089,24 +13486,23 @@ } }, "just-diff": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/just-diff/-/just-diff-5.0.3.tgz", - "integrity": "sha512-a8p80xcpJ6sdurk5PxDKb4mav9MeKjA3zFKZpCWBIfvg8mznfnmb13MKZvlrwJ+Lhis0wM3uGAzE0ArhFHvIcg==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/just-diff/-/just-diff-5.2.0.tgz", + "integrity": "sha512-6ufhP9SHjb7jibNFrNxyFZ6od3g+An6Ai9mhGRvcYe8UJlH0prseN64M+6ZBBUoKYHZsitDP42gAJ8+eVWr3lw==", "dev": true }, "just-diff-apply": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/just-diff-apply/-/just-diff-apply-5.3.1.tgz", - "integrity": "sha512-dgFenZnMsc1xGNqgdtgnh7DK+Oy352CE3VZLbzcbQpsBs9iI2K3M0IRrdgREZ72eItTjbl0suRyvKRdVQa9GbA==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/just-diff-apply/-/just-diff-apply-5.5.0.tgz", + "integrity": "sha512-OYTthRfSh55WOItVqwpefPtNt2VdKsq5AnAK6apdtR6yCH8pr0CmSr710J0Mf+WdQy7K/OzMy7K2MgAfdQURDw==", "dev": true }, "keyv": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.3.3.tgz", - "integrity": "sha512-AcysI17RvakTh8ir03+a3zJr5r0ovnAH/XTXei/4HIv3bL2K/jzvgivLK9UuI/JbU1aJjM3NSAnVvVVd3n+4DQ==", + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.2.tgz", + "integrity": "sha512-5MHbFaKn8cNSmVW7BYnijeAVlE4cYA/SVkifVgrh7yotnfhKmjuXpDKjrABLnT0SfHWV21P8ow07OGfRrNDg8g==", "dev": true, "requires": { - "compress-brotli": "^1.3.8", "json-buffer": "3.0.1" } }, @@ -14132,30 +13528,157 @@ } }, "lerna": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/lerna/-/lerna-5.3.0.tgz", - "integrity": "sha512-0Y9xJqleVu0ExGmsw2WM/GkVmxOwtA7OLQFS5ERPKJfnsxH9roTX3a7NPaGQRI2E+tSJLJJGgNSf3WYEqinOqA==", - "dev": true, - "requires": { - "@lerna/add": "5.3.0", - "@lerna/bootstrap": "5.3.0", - "@lerna/changed": "5.3.0", - "@lerna/clean": "5.3.0", - "@lerna/cli": "5.3.0", - "@lerna/create": "5.3.0", - "@lerna/diff": "5.3.0", - "@lerna/exec": "5.3.0", - "@lerna/import": "5.3.0", - "@lerna/info": "5.3.0", - "@lerna/init": "5.3.0", - "@lerna/link": "5.3.0", - "@lerna/list": "5.3.0", - "@lerna/publish": "5.3.0", - "@lerna/run": "5.3.0", - "@lerna/version": "5.3.0", + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/lerna/-/lerna-6.5.1.tgz", + "integrity": "sha512-Va1bysubwWdoWZ1ncKcoTGBXNAu/10/TwELb550TTivXmEWjCCdek4eX0BNLTEYKxu3tpV2UEeqVisUiWGn4WA==", + "dev": true, + "requires": { + "@lerna/child-process": "6.5.1", + "@lerna/create": "6.5.1", + "@npmcli/arborist": "5.3.0", + "@npmcli/run-script": "4.1.7", + "@nrwl/devkit": ">=15.5.2 < 16", + "@octokit/plugin-enterprise-rest": "6.0.1", + "@octokit/rest": "19.0.3", + "byte-size": "7.0.0", + "chalk": "4.1.0", + "clone-deep": "4.0.1", + "cmd-shim": "5.0.0", + "columnify": "1.6.0", + "config-chain": "1.1.12", + "conventional-changelog-angular": "5.0.12", + "conventional-changelog-core": "4.2.4", + "conventional-recommended-bump": "6.1.0", + "cosmiconfig": "7.0.0", + "dedent": "0.7.0", + "dot-prop": "6.0.1", + "envinfo": "^7.7.4", + "execa": "5.0.0", + "fs-extra": "9.1.0", + "get-port": "5.1.1", + "get-stream": "6.0.0", + "git-url-parse": "13.1.0", + "glob-parent": "5.1.2", + "globby": "11.1.0", + "graceful-fs": "4.2.10", + "has-unicode": "2.0.1", "import-local": "^3.0.2", + "init-package-json": "3.0.2", + "inquirer": "^8.2.4", + "is-ci": "2.0.0", + "is-stream": "2.0.0", + "js-yaml": "^4.1.0", + "libnpmaccess": "6.0.3", + "libnpmpublish": "6.0.4", + "load-json-file": "6.2.0", + "make-dir": "3.1.0", + "minimatch": "3.0.5", + "multimatch": "5.0.0", + "node-fetch": "2.6.7", + "npm-package-arg": "8.1.1", + "npm-packlist": "5.1.1", + "npm-registry-fetch": "13.3.0", "npmlog": "^6.0.2", - "nx": ">=14.4.3 < 16" + "nx": ">=15.5.2 < 16", + "p-map": "4.0.0", + "p-map-series": "2.1.0", + "p-pipe": "3.1.0", + "p-queue": "6.6.2", + "p-reduce": "2.1.0", + "p-waterfall": "2.1.1", + "pacote": "13.6.1", + "path-exists": "4.0.0", + "pify": "5.0.0", + "read-cmd-shim": "3.0.0", + "read-package-json": "5.0.1", + "resolve-from": "5.0.0", + "rimraf": "^3.0.2", + "semver": "7.3.4", + "signal-exit": "3.0.7", + "slash": "3.0.0", + "ssri": "9.0.1", + "strong-log-transformer": "2.1.0", + "tar": "6.1.11", + "temp-dir": "1.0.0", + "typescript": "^3 || ^4", + "upath": "^2.0.1", + "uuid": "8.3.2", + "validate-npm-package-license": "3.0.4", + "validate-npm-package-name": "4.0.0", + "write-file-atomic": "4.0.1", + "write-pkg": "4.0.0", + "yargs": "16.2.0", + "yargs-parser": "20.2.4" + }, + "dependencies": { + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "config-chain": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.12.tgz", + "integrity": "sha512-a1eOIcu8+7lUInge4Rpf/n4Krkf3Dd9lqhljRzII1/Zno/kRtUWnznPO3jOKBmTEktkt3fkxisUcivoj0ebzoA==", + "dev": true, + "requires": { + "ini": "^1.3.4", + "proto-list": "~1.2.1" + } + }, + "get-stream": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.0.tgz", + "integrity": "sha512-A1B3Bh1UmL0bidM/YX2NsCOTnGJePL9rO/M+Mw3m9f2gUpfokS0hi5Eah0WSUEWZdZhIZtMjkIYS7mDfOqNHbg==", + "dev": true + }, + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "minimatch": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.5.tgz", + "integrity": "sha512-tUpxzX0VAzJHjLu0xUfFv1gwVp9ba3IOuRAVH2EGuRW8a5emA2FlACLqiT/lDVtS1W+TGNwqz3sWaNyLgDJWuw==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true + }, + "semver": { + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", + "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + } } }, "levn": { @@ -14181,24 +13704,18 @@ }, "dependencies": { "hosted-git-info": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.0.0.tgz", - "integrity": "sha512-rRnjWu0Bxj+nIfUOkz0695C0H6tRrN5iYIzYejb0tDEefe2AekHu/U5Kn9pEie5vsJqpNQU02az7TGSH3qpz4Q==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.2.1.tgz", + "integrity": "sha512-xIcQYMnhcx2Nr4JTjsFmwwnr9vldugPy9uVm0o87bjqqWMv9GaqsTeT+i99wTl0mk1uLxJtHxLb8kymqTENQsw==", "dev": true, "requires": { "lru-cache": "^7.5.1" } }, - "lru-cache": { - "version": "7.13.2", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.13.2.tgz", - "integrity": "sha512-VJL3nIpA79TodY/ctmZEfhASgqekbT574/c4j3jn4bKXbSCnTTCH/KltZyvL2GlV+tGSMtsWyem8DCX7qKTMBA==", - "dev": true - }, "npm-package-arg": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-9.1.0.tgz", - "integrity": "sha512-4J0GL+u2Nh6OnhvUKXRr2ZMG4lR8qtLp+kv7UiV00Y+nGiSxtttCyIRHCt5L5BNkXQld/RceYItau3MDOoGiBw==", + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-9.1.2.tgz", + "integrity": "sha512-pzd9rLEx4TfNJkovvlBSLGhq31gGu2QDexFPWT19yCDh0JgnRhlBLNo5759N0AJmBk+kQ9Y/hXoLnlgFD+ukmg==", "dev": true, "requires": { "hosted-git-info": "^5.0.0", @@ -14223,26 +13740,18 @@ }, "dependencies": { "hosted-git-info": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.0.0.tgz", - "integrity": "sha512-rRnjWu0Bxj+nIfUOkz0695C0H6tRrN5iYIzYejb0tDEefe2AekHu/U5Kn9pEie5vsJqpNQU02az7TGSH3qpz4Q==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.2.1.tgz", + "integrity": "sha512-xIcQYMnhcx2Nr4JTjsFmwwnr9vldugPy9uVm0o87bjqqWMv9GaqsTeT+i99wTl0mk1uLxJtHxLb8kymqTENQsw==", "dev": true, "requires": { "lru-cache": "^7.5.1" - }, - "dependencies": { - "lru-cache": { - "version": "7.13.2", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.13.2.tgz", - "integrity": "sha512-VJL3nIpA79TodY/ctmZEfhASgqekbT574/c4j3jn4bKXbSCnTTCH/KltZyvL2GlV+tGSMtsWyem8DCX7qKTMBA==", - "dev": true - } } }, "normalize-package-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-4.0.0.tgz", - "integrity": "sha512-m+GL22VXJKkKbw62ZaBBjv8u6IE3UI4Mh5QakIqs3fWiKe0Xyi6L97hakwZK41/LD4R/2ly71Bayx0NLMwLA/g==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-4.0.1.tgz", + "integrity": "sha512-EBk5QKKuocMJhB3BILuKhmaPjI8vNRSpIfO9woLC6NyHVkKKdVEdAO1mrT0ZfxNR1lKwCcTkuZfmGIFdizZ8Pg==", "dev": true, "requires": { "hosted-git-info": "^5.0.0", @@ -14252,9 +13761,9 @@ } }, "npm-package-arg": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-9.1.0.tgz", - "integrity": "sha512-4J0GL+u2Nh6OnhvUKXRr2ZMG4lR8qtLp+kv7UiV00Y+nGiSxtttCyIRHCt5L5BNkXQld/RceYItau3MDOoGiBw==", + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-9.1.2.tgz", + "integrity": "sha512-pzd9rLEx4TfNJkovvlBSLGhq31gGu2QDexFPWT19yCDh0JgnRhlBLNo5759N0AJmBk+kQ9Y/hXoLnlgFD+ukmg==", "dev": true, "requires": { "hosted-git-info": "^5.0.0", @@ -14262,15 +13771,6 @@ "semver": "^7.3.5", "validate-npm-package-name": "^4.0.0" } - }, - "semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", - "dev": true, - "requires": { - "lru-cache": "^6.0.0" - } } } }, @@ -14301,18 +13801,19 @@ } }, "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, "requires": { - "p-locate": "^4.1.0" + "p-locate": "^5.0.0" } }, "lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true }, "lodash.ismatch": { "version": "4.4.0", @@ -14336,11 +13837,6 @@ "is-unicode-supported": "^0.1.0" } }, - "long": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", - "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" - }, "lowercase-keys": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-3.0.0.tgz", @@ -14348,13 +13844,10 @@ "dev": true }, "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "requires": { - "yallist": "^4.0.0" - } + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.14.0.tgz", + "integrity": "sha512-EIRtP1GrSJny0dqb50QXRUNBxHJhcpxHC++M5tD7RYbvLLn5KVWKsbyswSSqDuU15UFi3bgTQIY8nhDMeF6aDQ==", + "dev": true }, "make-dir": { "version": "3.1.0", @@ -14374,9 +13867,9 @@ } }, "make-fetch-happen": { - "version": "10.2.0", - "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-10.2.0.tgz", - "integrity": "sha512-OnEfCLofQVJ5zgKwGk55GaqosqKjaR6khQlJY3dBAA+hM25Bc5CmX5rKUfVut+rYA3uidA7zb7AvcglU87rPRg==", + "version": "10.2.1", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-10.2.1.tgz", + "integrity": "sha512-NgOPbRiaQM10DYXvN3/hhGVI2M5MtITFryzBGxHM5p4wnFxsVCbxkrBrDsk+EZ5OB4jEOT7AjDxtdF+KVEFT7w==", "dev": true, "requires": { "agentkeepalive": "^4.2.1", @@ -14395,14 +13888,6 @@ "promise-retry": "^2.0.1", "socks-proxy-agent": "^7.0.0", "ssri": "^9.0.0" - }, - "dependencies": { - "lru-cache": { - "version": "7.13.2", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.13.2.tgz", - "integrity": "sha512-VJL3nIpA79TodY/ctmZEfhASgqekbT574/c4j3jn4bKXbSCnTTCH/KltZyvL2GlV+tGSMtsWyem8DCX7qKTMBA==", - "dev": true - } } }, "map-obj": { @@ -14430,12 +13915,49 @@ "yargs-parser": "^20.2.3" }, "dependencies": { + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, "hosted-git-info": { "version": "2.8.9", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", "dev": true }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, "read-pkg": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", @@ -14514,13 +14036,28 @@ "dev": true }, "micromatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", - "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, + "requires": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + } + }, + "mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "dev": true + }, + "mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", "dev": true, "requires": { - "braces": "^3.0.1", - "picomatch": "^2.2.3" + "mime-db": "1.52.0" } }, "mimic-fn": { @@ -14530,9 +14067,9 @@ "dev": true }, "mimic-response": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", - "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-4.0.0.tgz", + "integrity": "sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg==", "dev": true }, "min-indent": { @@ -14542,18 +14079,18 @@ "dev": true }, "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "requires": { "brace-expansion": "^1.1.7" } }, "minimist": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz", + "integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==", "dev": true }, "minimist-options": { @@ -14568,9 +14105,9 @@ } }, "minipass": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.3.tgz", - "integrity": "sha512-N0BOsdFAlNRfmwMhjAsLVWOk7Ljmeb39iqFlsV1At+jqRhSUP9yeof8FyJu4imaJiSUp8vQebWD/guZwGQC8iA==", + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.4.tgz", + "integrity": "sha512-I9WPbWHCGu8W+6k1ZiGpPu0GkoKBeorkfKNuAFBNS1HNFJvke82sxvI5bzcCNpWPorkOO5QQ+zomzzwRxejXiw==", "dev": true, "requires": { "yallist": "^4.0.0" @@ -14586,9 +14123,9 @@ } }, "minipass-fetch": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-2.1.0.tgz", - "integrity": "sha512-H9U4UVBGXEyyWJnqYDCLp1PwD8XIkJ4akNHp1aGVI+2Ym7wQMlxDKi4IB4JbmyU+pl9pEs/cVrK6cOuvmbK4Sg==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-2.1.2.tgz", + "integrity": "sha512-LT49Zi2/WMROHYoqGgdlQIZh8mLPZmOrN2NdJjMXxYe4nkN6FUyuPuOAOedNJDrx0IRGg9+4guZewtp8hE6TxA==", "dev": true, "requires": { "encoding": "^0.1.13", @@ -14686,6 +14223,12 @@ "minimatch": "^3.0.4" }, "dependencies": { + "@types/minimatch": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.5.tgz", + "integrity": "sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==", + "dev": true + }, "arrify": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", @@ -14703,7 +14246,13 @@ "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true + }, + "natural-compare-lite": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", + "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", "dev": true }, "negotiator": { @@ -14731,54 +14280,41 @@ "dev": true, "requires": { "whatwg-url": "^5.0.0" - }, - "dependencies": { - "tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", - "dev": true - }, - "webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", - "dev": true - }, - "whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "dev": true, - "requires": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - } } }, "node-gyp": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-9.1.0.tgz", - "integrity": "sha512-HkmN0ZpQJU7FLbJauJTHkHlSVAXlNGDAzH/VYFZGDOnFyn/Na3GlNJfkudmufOdS6/jNFhy88ObzL7ERz9es1g==", + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-9.3.0.tgz", + "integrity": "sha512-A6rJWfXFz7TQNjpldJ915WFb1LnhO4lIve3ANPbWreuEoLoKlFT3sxIepPBkLhM27crW8YmN+pjlgbasH6cH/Q==", "dev": true, "requires": { "env-paths": "^2.2.0", "glob": "^7.1.4", "graceful-fs": "^4.2.6", "make-fetch-happen": "^10.0.3", - "nopt": "^5.0.0", + "nopt": "^6.0.0", "npmlog": "^6.0.0", "rimraf": "^3.0.2", "semver": "^7.3.5", "tar": "^6.1.2", "which": "^2.0.2" + }, + "dependencies": { + "nopt": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-6.0.0.tgz", + "integrity": "sha512-ZwLpbTgdhuZUnZzjd7nb1ZV+4DoiC6/sfiVKok72ym/4Tlf+DFdlHYmT2JPmcNNWV6Pi3SDf1kT+A4r9RTuT9g==", + "dev": true, + "requires": { + "abbrev": "^1.0.0" + } + } } }, "node-gyp-build": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.5.0.tgz", - "integrity": "sha512-2iGbaQBV+ITgCz76ZEjmhUKAKVf7xfY1sRl4UiKQspfZMH2h06SyhNsnSVy50cwkFQDGLyif6m/6uFXHkOZ6rg==", + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.6.0.tgz", + "integrity": "sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ==", "dev": true }, "nopt": { @@ -14802,16 +14338,10 @@ "validate-npm-package-license": "^3.0.1" } }, - "normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true - }, "normalize-url": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-6.1.0.tgz", - "integrity": "sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-8.0.0.tgz", + "integrity": "sha512-uVFpKhj5MheNBJRTiMZ9pE/7hD1QTeEvugSJW/OmLzAp78PB5O6adfMNTvmfKhXBkvCzC+rqifWcVYpGFwTjnw==", "dev": true }, "npm-bundled": { @@ -14824,40 +14354,107 @@ } }, "npm-check-updates": { - "version": "16.0.5", - "resolved": "https://registry.npmjs.org/npm-check-updates/-/npm-check-updates-16.0.5.tgz", - "integrity": "sha512-0qK6NTmgbq8y39xm4y1tKW5ghEGtWWyiUzSPSQEaqb9elqOfZogV4GQVvBYw3xJlt6igJVXgBUyjNqtPv/j7Yw==", + "version": "16.7.10", + "resolved": "https://registry.npmjs.org/npm-check-updates/-/npm-check-updates-16.7.10.tgz", + "integrity": "sha512-sLDgYD8ebkH9Jd6mPIq7UDGLr3DAxkHl6ZuJrEF4rauLv6DqHBxtnF16MHUPN+/eBt5QbH4GL/+nxfSAFm3TfQ==", "dev": true, "requires": { - "chalk": "^5.0.1", + "chalk": "^5.2.0", "cli-table": "^0.3.11", - "commander": "^9.4.0", + "commander": "^10.0.0", "fast-memoize": "^2.5.2", "find-up": "5.0.0", "fp-and-or": "^0.1.3", "get-stdin": "^8.0.0", "globby": "^11.0.4", - "hosted-git-info": "^5.0.0", + "hosted-git-info": "^5.1.0", + "ini": "^3.0.1", "json-parse-helpfulerror": "^1.0.3", "jsonlines": "^0.1.1", "lodash": "^4.17.21", - "minimatch": "^5.1.0", + "minimatch": "^7.0.1", "p-map": "^4.0.0", - "pacote": "^13.6.1", + "pacote": "15.1.1", "parse-github-url": "^1.0.2", "progress": "^2.0.3", "prompts-ncu": "^2.5.1", - "rc-config-loader": "^4.1.0", + "rc-config-loader": "^4.1.2", "remote-git-tags": "^3.0.0", - "rimraf": "^3.0.2", - "semver": "^7.3.7", + "rimraf": "^4.1.2", + "semver": "^7.3.8", "semver-utils": "^1.1.4", "source-map-support": "^0.5.21", - "spawn-please": "^1.0.0", + "spawn-please": "^2.0.1", + "strip-json-comments": "^5.0.0", + "untildify": "^4.0.0", "update-notifier": "^6.0.2", - "yaml": "^2.1.1" + "yaml": "^2.2.1" }, "dependencies": { + "@npmcli/fs": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-3.1.0.tgz", + "integrity": "sha512-7kZUAaLscfgbwBQRbvdMYaZOWyMEcPTH/tJjnyAWJ/dvvs9Ef+CERx/qJb9GExJpl1qipaDGn7KqHnFGGixd0w==", + "dev": true, + "requires": { + "semver": "^7.3.5" + } + }, + "@npmcli/git": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@npmcli/git/-/git-4.0.3.tgz", + "integrity": "sha512-8cXNkDIbnXPVbhXMmQ7/bklCAjtmPaXfI9aEM4iH+xSuEHINLMHhlfESvVwdqmHJRJkR48vNJTSUvoF6GRPSFA==", + "dev": true, + "requires": { + "@npmcli/promise-spawn": "^6.0.0", + "lru-cache": "^7.4.4", + "mkdirp": "^1.0.4", + "npm-pick-manifest": "^8.0.0", + "proc-log": "^3.0.0", + "promise-inflight": "^1.0.1", + "promise-retry": "^2.0.1", + "semver": "^7.3.5", + "which": "^3.0.0" + } + }, + "@npmcli/installed-package-contents": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@npmcli/installed-package-contents/-/installed-package-contents-2.0.2.tgz", + "integrity": "sha512-xACzLPhnfD51GKvTOOuNX2/V4G4mz9/1I2MfDoye9kBM3RYe5g2YbscsaGoTlaWqkxeiapBWyseULVKpSVHtKQ==", + "dev": true, + "requires": { + "npm-bundled": "^3.0.0", + "npm-normalize-package-bin": "^3.0.0" + } + }, + "@npmcli/node-gyp": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/node-gyp/-/node-gyp-3.0.0.tgz", + "integrity": "sha512-gp8pRXC2oOxu0DUE1/M3bYtb1b3/DbJ5aM113+XJBgfXdussRAsX0YOrOhdd8WvnAR6auDBvJomGAkLKA5ydxA==", + "dev": true + }, + "@npmcli/promise-spawn": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/@npmcli/promise-spawn/-/promise-spawn-6.0.2.tgz", + "integrity": "sha512-gGq0NJkIGSwdbUt4yhdF8ZrmkGKVz9vAdVzpOfnom+V8PLSmSOVhZwbNvZZS1EYcJN5hzzKBxmmVVAInM6HQLg==", + "dev": true, + "requires": { + "which": "^3.0.0" + } + }, + "@npmcli/run-script": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-6.0.0.tgz", + "integrity": "sha512-ql+AbRur1TeOdl1FY+RAwGW9fcr4ZwiVKabdvm93mujGREVuVLbdkXRJDrkTXSdCjaxYydr1wlA2v67jxWG5BQ==", + "dev": true, + "requires": { + "@npmcli/node-gyp": "^3.0.0", + "@npmcli/promise-spawn": "^6.0.0", + "node-gyp": "^9.0.0", + "read-package-json-fast": "^3.0.0", + "which": "^3.0.0" + } + }, "brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", @@ -14867,97 +14464,378 @@ "balanced-match": "^1.0.0" } }, + "cacache": { + "version": "17.0.4", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-17.0.4.tgz", + "integrity": "sha512-Z/nL3gU+zTUjz5pCA5vVjYM8pmaw2kxM7JEiE0fv3w77Wj+sFbi70CrBruUWH0uNcEdvLDixFpgA2JM4F4DBjA==", + "dev": true, + "requires": { + "@npmcli/fs": "^3.1.0", + "fs-minipass": "^3.0.0", + "glob": "^8.0.1", + "lru-cache": "^7.7.1", + "minipass": "^4.0.0", + "minipass-collect": "^1.0.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "p-map": "^4.0.0", + "promise-inflight": "^1.0.1", + "ssri": "^10.0.0", + "tar": "^6.1.11", + "unique-filename": "^3.0.0" + } + }, "chalk": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.0.1.tgz", - "integrity": "sha512-Fo07WOYGqMfCWHOzSXOt2CxDbC6skS/jO9ynEcmpANMoPrD+W1r1K6Vx7iNm+AQmETU1Xr2t+n8nzkV9t6xh3w==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.2.0.tgz", + "integrity": "sha512-ree3Gqw/nazQAPuJJEy+avdl7QfZMcUvmHIKgEZkGL+xOBzRvup5Hxo6LHuMceSxOabuJLJm5Yp/92R9eMmMvA==", "dev": true }, - "find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "fs-minipass": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-3.0.1.tgz", + "integrity": "sha512-MhaJDcFRTuLidHrIttu0RDGyyXs/IYHVmlcxfLAEFIWjc1vdLAkdwT7Ace2u7DbitWC0toKMl5eJZRYNVreIMw==", "dev": true, "requires": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" + "minipass": "^4.0.0" + } + }, + "glob": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + }, + "dependencies": { + "minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dev": true, + "requires": { + "brace-expansion": "^2.0.1" + } + } } }, "hosted-git-info": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.0.0.tgz", - "integrity": "sha512-rRnjWu0Bxj+nIfUOkz0695C0H6tRrN5iYIzYejb0tDEefe2AekHu/U5Kn9pEie5vsJqpNQU02az7TGSH3qpz4Q==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.2.1.tgz", + "integrity": "sha512-xIcQYMnhcx2Nr4JTjsFmwwnr9vldugPy9uVm0o87bjqqWMv9GaqsTeT+i99wTl0mk1uLxJtHxLb8kymqTENQsw==", "dev": true, "requires": { "lru-cache": "^7.5.1" } }, - "locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "ignore-walk": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-6.0.1.tgz", + "integrity": "sha512-/c8MxUAqpRccq+LyDOecwF+9KqajueJHh8fz7g3YqjMZt+NSfJzx05zrKiXwa2sKwFCzaiZ5qUVfRj0pmxixEA==", "dev": true, "requires": { - "p-locate": "^5.0.0" + "minimatch": "^6.1.6" + }, + "dependencies": { + "minimatch": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-6.2.0.tgz", + "integrity": "sha512-sauLxniAmvnhhRjFwPNnJKaPFYyddAgbYdeUpHULtCT/GhzdCx/MDNy+Y40lBxTQUrMzDE8e0S43Z5uqfO0REg==", + "dev": true, + "requires": { + "brace-expansion": "^2.0.1" + } + } } }, - "lru-cache": { - "version": "7.10.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.10.1.tgz", - "integrity": "sha512-BQuhQxPuRl79J5zSXRP+uNzPOyZw2oFI9JLRQ80XswSvg21KMKNtQza9eF42rfI/3Z40RvzBdXgziEkudzjo8A==", + "ini": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ini/-/ini-3.0.1.tgz", + "integrity": "sha512-it4HyVAUTKBc6m8e1iXWvXSTdndF7HbdN713+kvLrymxTaU4AUBWrJ4vEooP+V7fexnVD3LKcBshjGGPefSMUQ==", "dev": true }, + "json-parse-even-better-errors": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-3.0.0.tgz", + "integrity": "sha512-iZbGHafX/59r39gPwVPRBGw0QQKnA7tte5pSMrhWOW7swGsVvVTjmfyAV9pNqk8YGT7tRCdxRu8uzcgZwoDooA==", + "dev": true + }, + "make-fetch-happen": { + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-11.0.3.tgz", + "integrity": "sha512-oPLh5m10lRNNZDjJ2kP8UpboUx2uFXVaVweVe/lWut4iHWcQEmfqSVJt2ihZsFI8HbpwyyocaXbCAWf0g1ukIA==", + "dev": true, + "requires": { + "agentkeepalive": "^4.2.1", + "cacache": "^17.0.0", + "http-cache-semantics": "^4.1.1", + "http-proxy-agent": "^5.0.0", + "https-proxy-agent": "^5.0.0", + "is-lambda": "^1.0.1", + "lru-cache": "^7.7.1", + "minipass": "^4.0.0", + "minipass-fetch": "^3.0.0", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^0.6.3", + "promise-retry": "^2.0.1", + "socks-proxy-agent": "^7.0.0", + "ssri": "^10.0.0" + } + }, "minimatch": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", - "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-7.4.2.tgz", + "integrity": "sha512-xy4q7wou3vUoC9k1xGTXc+awNdGaGVHtFUaey8tiX4H1QRc04DZ/rmDFwNm2EBsuYEhAZ6SgMmYf3InGY6OauA==", "dev": true, "requires": { "brace-expansion": "^2.0.1" } }, - "p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "minipass": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-4.2.4.tgz", + "integrity": "sha512-lwycX3cBMTvcejsHITUgYj6Gy6A7Nh4Q6h9NP4sTHY1ccJlC7yKzDmiShEHsJ16Jf1nKGDEaiHxiltsJEvk0nQ==", + "dev": true + }, + "minipass-fetch": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-3.0.1.tgz", + "integrity": "sha512-t9/wowtf7DYkwz8cfMSt0rMwiyNIBXf5CKZ3S5ZMqRqMYT0oLTp0x1WorMI9WTwvaPg21r1JbFxJMum8JrLGfw==", "dev": true, "requires": { - "yocto-queue": "^0.1.0" + "encoding": "^0.1.13", + "minipass": "^4.0.0", + "minipass-sized": "^1.0.3", + "minizlib": "^2.1.2" } }, - "p-locate": { + "normalize-package-data": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-5.0.0.tgz", + "integrity": "sha512-h9iPVIfrVZ9wVYQnxFgtw1ugSvGEMOlyPWWtm8BMJhnwyEL/FLbYbTY3V3PpjI/BUK67n9PEWDu6eHzu1fB15Q==", "dev": true, "requires": { - "p-limit": "^3.0.2" + "hosted-git-info": "^6.0.0", + "is-core-module": "^2.8.1", + "semver": "^7.3.5", + "validate-npm-package-license": "^3.0.4" + }, + "dependencies": { + "hosted-git-info": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-6.1.1.tgz", + "integrity": "sha512-r0EI+HBMcXadMrugk0GCQ+6BQV39PiWAZVfq7oIckeGiN7sjRGyQxPdft3nQekFTCQbYxLBH+/axZMeH8UX6+w==", + "dev": true, + "requires": { + "lru-cache": "^7.5.1" + } + } } }, - "semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "npm-bundled": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-3.0.0.tgz", + "integrity": "sha512-Vq0eyEQy+elFpzsKjMss9kxqb9tG3YHg4dsyWuUENuzvSUWe1TCnW/vV9FkhvBk/brEDoDiVd+M1Btosa6ImdQ==", "dev": true, "requires": { - "lru-cache": "^6.0.0" + "npm-normalize-package-bin": "^3.0.0" + } + }, + "npm-install-checks": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/npm-install-checks/-/npm-install-checks-6.0.0.tgz", + "integrity": "sha512-SBU9oFglRVZnfElwAtF14NivyulDqF1VKqqwNsFW9HDcbHMAPHpRSsVFgKuwFGq/hVvWZExz62Th0kvxn/XE7Q==", + "dev": true, + "requires": { + "semver": "^7.1.1" + } + }, + "npm-normalize-package-bin": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-3.0.0.tgz", + "integrity": "sha512-g+DPQSkusnk7HYXr75NtzkIP4+N81i3RPsGFidF3DzHd9MT9wWngmqoeg/fnHFz5MNdtG4w03s+QnhewSLTT2Q==", + "dev": true + }, + "npm-package-arg": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-10.1.0.tgz", + "integrity": "sha512-uFyyCEmgBfZTtrKk/5xDfHp6+MdrqGotX/VoOyEEl3mBwiEE5FlBaePanazJSVMPT7vKepcjYBY2ztg9A3yPIA==", + "dev": true, + "requires": { + "hosted-git-info": "^6.0.0", + "proc-log": "^3.0.0", + "semver": "^7.3.5", + "validate-npm-package-name": "^5.0.0" }, "dependencies": { - "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "hosted-git-info": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-6.1.1.tgz", + "integrity": "sha512-r0EI+HBMcXadMrugk0GCQ+6BQV39PiWAZVfq7oIckeGiN7sjRGyQxPdft3nQekFTCQbYxLBH+/axZMeH8UX6+w==", "dev": true, "requires": { - "yallist": "^4.0.0" + "lru-cache": "^7.5.1" } } } }, + "npm-packlist": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-7.0.4.tgz", + "integrity": "sha512-d6RGEuRrNS5/N84iglPivjaJPxhDbZmlbTwTDX2IbcRHG5bZCdtysYMhwiPvcF4GisXHGn7xsxv+GQ7T/02M5Q==", + "dev": true, + "requires": { + "ignore-walk": "^6.0.0" + } + }, + "npm-pick-manifest": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-8.0.1.tgz", + "integrity": "sha512-mRtvlBjTsJvfCCdmPtiu2bdlx8d/KXtF7yNXNWe7G0Z36qWA9Ny5zXsI2PfBZEv7SXgoxTmNaTzGSbbzDZChoA==", + "dev": true, + "requires": { + "npm-install-checks": "^6.0.0", + "npm-normalize-package-bin": "^3.0.0", + "npm-package-arg": "^10.0.0", + "semver": "^7.3.5" + } + }, + "npm-registry-fetch": { + "version": "14.0.3", + "resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-14.0.3.tgz", + "integrity": "sha512-YaeRbVNpnWvsGOjX2wk5s85XJ7l1qQBGAp724h8e2CZFFhMSuw9enom7K1mWVUtvXO1uUSFIAPofQK0pPN0ZcA==", + "dev": true, + "requires": { + "make-fetch-happen": "^11.0.0", + "minipass": "^4.0.0", + "minipass-fetch": "^3.0.0", + "minipass-json-stream": "^1.0.1", + "minizlib": "^2.1.2", + "npm-package-arg": "^10.0.0", + "proc-log": "^3.0.0" + } + }, + "pacote": { + "version": "15.1.1", + "resolved": "https://registry.npmjs.org/pacote/-/pacote-15.1.1.tgz", + "integrity": "sha512-eeqEe77QrA6auZxNHIp+1TzHQ0HBKf5V6c8zcaYZ134EJe1lCi+fjXATkNiEEfbG+e50nu02GLvUtmZcGOYabQ==", + "dev": true, + "requires": { + "@npmcli/git": "^4.0.0", + "@npmcli/installed-package-contents": "^2.0.1", + "@npmcli/promise-spawn": "^6.0.1", + "@npmcli/run-script": "^6.0.0", + "cacache": "^17.0.0", + "fs-minipass": "^3.0.0", + "minipass": "^4.0.0", + "npm-package-arg": "^10.0.0", + "npm-packlist": "^7.0.0", + "npm-pick-manifest": "^8.0.0", + "npm-registry-fetch": "^14.0.0", + "proc-log": "^3.0.0", + "promise-retry": "^2.0.1", + "read-package-json": "^6.0.0", + "read-package-json-fast": "^3.0.0", + "sigstore": "^1.0.0", + "ssri": "^10.0.0", + "tar": "^6.1.11" + } + }, + "proc-log": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-3.0.0.tgz", + "integrity": "sha512-++Vn7NS4Xf9NacaU9Xq3URUuqZETPsf8L4j5/ckhaRYsfPeRyzGw+iDjFhV/Jr3uNmTvvddEJFWh5R1gRgUH8A==", + "dev": true + }, + "read-package-json": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-6.0.0.tgz", + "integrity": "sha512-b/9jxWJ8EwogJPpv99ma+QwtqB7FSl3+V6UXS7Aaay8/5VwMY50oIFooY1UKXMWpfNCM6T/PoGqa5GD1g9xf9w==", + "dev": true, + "requires": { + "glob": "^8.0.1", + "json-parse-even-better-errors": "^3.0.0", + "normalize-package-data": "^5.0.0", + "npm-normalize-package-bin": "^3.0.0" + } + }, + "read-package-json-fast": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/read-package-json-fast/-/read-package-json-fast-3.0.2.tgz", + "integrity": "sha512-0J+Msgym3vrLOUB3hzQCuZHII0xkNGCtz/HJH9xZshwv9DbDwkw1KaE3gx/e2J5rpEY5rtOy6cyhKOPrkP7FZw==", + "dev": true, + "requires": { + "json-parse-even-better-errors": "^3.0.0", + "npm-normalize-package-bin": "^3.0.0" + } + }, + "rimraf": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-4.1.2.tgz", + "integrity": "sha512-BlIbgFryTbw3Dz6hyoWFhKk+unCcHMSkZGrTFVAx2WmttdBSonsdtRlwiuTbDqTKr+UlXIUqJVS4QT5tUzGENQ==", + "dev": true + }, + "ssri": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-10.0.1.tgz", + "integrity": "sha512-WVy6di9DlPOeBWEjMScpNipeSX2jIZBGEn5Uuo8Q7aIuFEuDX0pw8RxcOjlD1TWP4obi24ki7m/13+nFpcbXrw==", + "dev": true, + "requires": { + "minipass": "^4.0.0" + } + }, + "strip-json-comments": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-5.0.0.tgz", + "integrity": "sha512-V1LGY4UUo0jgwC+ELQ2BNWfPa17TIuwBLg+j1AA/9RPzKINl1lhxVEu2r+ZTTO8aetIsUzE5Qj6LMSBkoGYKKw==", + "dev": true + }, + "unique-filename": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-3.0.0.tgz", + "integrity": "sha512-afXhuC55wkAmZ0P18QsVE6kp8JaxrEokN2HGIoIVv2ijHQd419H0+6EigAFcIzXeMIkcIkNBpB3L/DXB3cTS/g==", + "dev": true, + "requires": { + "unique-slug": "^4.0.0" + } + }, + "unique-slug": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-4.0.0.tgz", + "integrity": "sha512-WrcA6AyEfqDX5bWige/4NQfPZMtASNVxdmWR76WESYQVAACSgWcR6e9i0mofqqBxYFtL4oAxPIptY73/0YE1DQ==", + "dev": true, + "requires": { + "imurmurhash": "^0.1.4" + } + }, + "validate-npm-package-name": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-5.0.0.tgz", + "integrity": "sha512-YuKoXDAhBYxY7SfOKxHBDoSyENFeW5VvIIQp2TGQuit8gpK6MnWaQelBKxso72DoxTZfZdcP3W90LqpSkgPzLQ==", + "dev": true, + "requires": { + "builtins": "^5.0.0" + } + }, + "which": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/which/-/which-3.0.0.tgz", + "integrity": "sha512-nla//68K9NU6yRiwDY/Q8aU6siKlSs64aEC7+IV56QoAuyQT2ovsJcgGYGyqMOmI/CGN1BOR6mM5EN0FBO+zyQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, "yaml": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.1.1.tgz", - "integrity": "sha512-o96x3OPo8GjWeSLF+wOAbrPfhFOGY0W00GNaxCDv+9hkcDJEnev1yh8S7pgHF0ik6zc8sQLuL8hjHjJULZp8bw==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.2.1.tgz", + "integrity": "sha512-e0WHiYql7+9wr4cWMx3TVQrNwejKaEe7/rHNmQmqRjazfOP5W8PB6Jpebb5o6fIapbz9o9+2ipcaTM2ZwDI6lw==", "dev": true } } @@ -15003,6 +14881,15 @@ "lru-cache": "^6.0.0" } }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, "validate-npm-package-name": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-3.0.0.tgz", @@ -15036,9 +14923,9 @@ } }, "glob": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz", - "integrity": "sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -15049,9 +14936,9 @@ } }, "minimatch": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", - "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", "dev": true, "requires": { "brace-expansion": "^2.0.1" @@ -15060,36 +14947,36 @@ } }, "npm-pick-manifest": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-7.0.1.tgz", - "integrity": "sha512-IA8+tuv8KujbsbLQvselW2XQgmXWS47t3CB0ZrzsRZ82DbDfkcFunOaPm4X7qNuhMfq+FmV7hQT4iFVpHqV7mg==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-7.0.2.tgz", + "integrity": "sha512-gk37SyRmlIjvTfcYl6RzDbSmS9Y4TOBXfsPnoYqTHARNgWbyDiCSMLUpmALDj4jjcTZpURiEfsSHJj9k7EV4Rw==", "dev": true, "requires": { "npm-install-checks": "^5.0.0", - "npm-normalize-package-bin": "^1.0.1", + "npm-normalize-package-bin": "^2.0.0", "npm-package-arg": "^9.0.0", "semver": "^7.3.5" }, "dependencies": { "hosted-git-info": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.0.0.tgz", - "integrity": "sha512-rRnjWu0Bxj+nIfUOkz0695C0H6tRrN5iYIzYejb0tDEefe2AekHu/U5Kn9pEie5vsJqpNQU02az7TGSH3qpz4Q==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.2.1.tgz", + "integrity": "sha512-xIcQYMnhcx2Nr4JTjsFmwwnr9vldugPy9uVm0o87bjqqWMv9GaqsTeT+i99wTl0mk1uLxJtHxLb8kymqTENQsw==", "dev": true, "requires": { "lru-cache": "^7.5.1" } }, - "lru-cache": { - "version": "7.12.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.12.0.tgz", - "integrity": "sha512-OIP3DwzRZDfLg9B9VP/huWBlpvbkmbfiBy8xmsXp4RPmE4A3MhwNozc5ZJ3fWnSg8fDcdlE/neRTPG2ycEKliw==", + "npm-normalize-package-bin": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-2.0.0.tgz", + "integrity": "sha512-awzfKUO7v0FscrSpRoogyNm0sajikhBWpU0QMrW09AMi9n1PoKU6WaIqUzuJSQnpciZZmJ/jMZ2Egfmb/9LiWQ==", "dev": true }, "npm-package-arg": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-9.1.0.tgz", - "integrity": "sha512-4J0GL+u2Nh6OnhvUKXRr2ZMG4lR8qtLp+kv7UiV00Y+nGiSxtttCyIRHCt5L5BNkXQld/RceYItau3MDOoGiBw==", + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-9.1.2.tgz", + "integrity": "sha512-pzd9rLEx4TfNJkovvlBSLGhq31gGu2QDexFPWT19yCDh0JgnRhlBLNo5759N0AJmBk+kQ9Y/hXoLnlgFD+ukmg==", "dev": true, "requires": { "hosted-git-info": "^5.0.0", @@ -15116,24 +15003,18 @@ }, "dependencies": { "hosted-git-info": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.0.0.tgz", - "integrity": "sha512-rRnjWu0Bxj+nIfUOkz0695C0H6tRrN5iYIzYejb0tDEefe2AekHu/U5Kn9pEie5vsJqpNQU02az7TGSH3qpz4Q==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.2.1.tgz", + "integrity": "sha512-xIcQYMnhcx2Nr4JTjsFmwwnr9vldugPy9uVm0o87bjqqWMv9GaqsTeT+i99wTl0mk1uLxJtHxLb8kymqTENQsw==", "dev": true, "requires": { "lru-cache": "^7.5.1" } }, - "lru-cache": { - "version": "7.13.2", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.13.2.tgz", - "integrity": "sha512-VJL3nIpA79TodY/ctmZEfhASgqekbT574/c4j3jn4bKXbSCnTTCH/KltZyvL2GlV+tGSMtsWyem8DCX7qKTMBA==", - "dev": true - }, "npm-package-arg": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-9.1.0.tgz", - "integrity": "sha512-4J0GL+u2Nh6OnhvUKXRr2ZMG4lR8qtLp+kv7UiV00Y+nGiSxtttCyIRHCt5L5BNkXQld/RceYItau3MDOoGiBw==", + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-9.1.2.tgz", + "integrity": "sha512-pzd9rLEx4TfNJkovvlBSLGhq31gGu2QDexFPWT19yCDh0JgnRhlBLNo5759N0AJmBk+kQ9Y/hXoLnlgFD+ukmg==", "dev": true, "requires": { "hosted-git-info": "^5.0.0", @@ -15166,16 +15047,28 @@ } }, "nx": { - "version": "14.4.3", - "resolved": "https://registry.npmjs.org/nx/-/nx-14.4.3.tgz", - "integrity": "sha512-XPaoEAfJI9056qdwTvkutQSwwA3iihqNDwhvk3dmgpT35j8Uzm/y67goACaCUBCjP2dIQqXfNfJVWQIpcG3MTw==", - "dev": true, - "requires": { - "@nrwl/cli": "14.4.3", - "@nrwl/tao": "14.4.3", + "version": "15.7.1", + "resolved": "https://registry.npmjs.org/nx/-/nx-15.7.1.tgz", + "integrity": "sha512-8Gtqazww3rCWxJ+pgB3JDU6hQeA+qRMYh77mXvf5CFQPszqEqvvuiJtKzcieWjxn/IZpeyVRjmPypkEOM6BbHw==", + "dev": true, + "requires": { + "@nrwl/cli": "15.7.1", + "@nrwl/nx-darwin-arm64": "15.7.1", + "@nrwl/nx-darwin-x64": "15.7.1", + "@nrwl/nx-linux-arm-gnueabihf": "15.7.1", + "@nrwl/nx-linux-arm64-gnu": "15.7.1", + "@nrwl/nx-linux-arm64-musl": "15.7.1", + "@nrwl/nx-linux-x64-gnu": "15.7.1", + "@nrwl/nx-linux-x64-musl": "15.7.1", + "@nrwl/nx-win32-arm64-msvc": "15.7.1", + "@nrwl/nx-win32-x64-msvc": "15.7.1", + "@nrwl/tao": "15.7.1", "@parcel/watcher": "2.0.4", - "chalk": "4.1.0", - "chokidar": "^3.5.1", + "@yarnpkg/lockfile": "^1.1.0", + "@yarnpkg/parsers": "^3.0.0-rc.18", + "@zkochan/js-yaml": "0.0.6", + "axios": "^1.0.0", + "chalk": "^4.1.0", "cli-cursor": "3.1.0", "cli-spinners": "2.6.1", "cliui": "^7.0.2", @@ -15184,35 +15077,27 @@ "fast-glob": "3.2.7", "figures": "3.2.0", "flat": "^5.0.2", - "fs-extra": "^10.1.0", + "fs-extra": "^11.1.0", "glob": "7.1.4", "ignore": "^5.0.4", "js-yaml": "4.1.0", - "jsonc-parser": "3.0.0", + "jsonc-parser": "3.2.0", + "lines-and-columns": "~2.0.3", "minimatch": "3.0.5", "npm-run-path": "^4.0.1", "open": "^8.4.0", "semver": "7.3.4", "string-width": "^4.2.3", + "strong-log-transformer": "^2.1.0", "tar-stream": "~2.2.0", "tmp": "~0.2.1", - "tsconfig-paths": "^3.9.0", + "tsconfig-paths": "^4.1.2", "tslib": "^2.3.0", "v8-compile-cache": "2.3.0", - "yargs": "^17.4.0", - "yargs-parser": "21.0.1" + "yargs": "^17.6.2", + "yargs-parser": "21.1.1" }, "dependencies": { - "chalk": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, "fast-glob": { "version": "3.2.7", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.7.tgz", @@ -15227,9 +15112,9 @@ } }, "fs-extra": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", - "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.1.0.tgz", + "integrity": "sha512-0rcTq621PD5jM/e0a3EJoGC/1TC5ZBCERW82LQuwfGnCa1V8w7dpYH1yNu+SLb6E5dkeCBzKEyLGlFrnr+dUyw==", "dev": true, "requires": { "graceful-fs": "^4.2.0", @@ -15251,12 +15136,30 @@ "path-is-absolute": "^1.0.0" } }, - "jsonc-parser": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.0.0.tgz", - "integrity": "sha512-fQzRfAbIBnR0IQvftw9FJveWiHp72Fg20giDrHz6TdfB12UH/uue0D3hm57UB5KgAVuniLMCaS8P1IMj9NR7cA==", + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "lines-and-columns": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-2.0.3.tgz", + "integrity": "sha512-cNOjgCnLB+FnvWWtyRTzmB3POJ+cXxTA81LoW7u8JdmhfXzriropYwpjShnz1QLLWsQwY7nIxoDmcPTwphDK9w==", "dev": true }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, "minimatch": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.5.tgz", @@ -15284,44 +15187,46 @@ "rimraf": "^3.0.0" } }, - "tslib": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", - "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==", - "dev": true - }, "yargs": { - "version": "17.5.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.5.1.tgz", - "integrity": "sha512-t6YAJcxDkNX7NFYiVtKvWUz8l+PaKTLiL63mJYWR2GnHq2gjEWISzsLp9wg3aY36dY1j+gfIEL3pIF+XlJJfbA==", + "version": "17.6.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.6.2.tgz", + "integrity": "sha512-1/9UrdHjDZc0eOU0HxOHoS78C69UD3JRMvzlJ7S79S2nTaWRA/whGCTV8o9e/N/1Va9YIV7Q4sOxD8VV4pCWOw==", "dev": true, "requires": { - "cliui": "^7.0.2", + "cliui": "^8.0.1", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", "string-width": "^4.2.3", "y18n": "^5.0.5", - "yargs-parser": "^21.0.0" + "yargs-parser": "^21.1.1" + }, + "dependencies": { + "cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + } + } } }, "yargs-parser": { - "version": "21.0.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.0.1.tgz", - "integrity": "sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg==", + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", "dev": true } } }, - "object-hash": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-1.3.1.tgz", - "integrity": "sha512-OSuu/pU4ENM9kmREg0BdNrUDIl1heYa4mBZacJc+vVWz4GtAwu7jO8s4AIt2aGRUTqxykpWzI3Oqnsm13tTMDA==" - }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "dev": true, "requires": { "wrappy": "1" @@ -15337,9 +15242,9 @@ } }, "open": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/open/-/open-8.4.0.tgz", - "integrity": "sha512-XgFPPM+B28FtCCgSb9I+s9szOC1vZRSwgWsRUA5ylIxRTgKozqjOCrVOqGsYABPYK5qnfqClxZTFBa8PKt2v6Q==", + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/open/-/open-8.4.1.tgz", + "integrity": "sha512-/4b7qZNhv6Uhd7jjnREh1NjnPxlTq+XNWPG88Ydkj5AILcA5m3ajvcg57pB24EQjKv0dK62XnDqk9c/hkIG5Kg==", "dev": true, "requires": { "define-lazy-prop": "^2.0.0", @@ -15393,25 +15298,25 @@ "p-finally": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "integrity": "sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==", "dev": true }, "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, "requires": { - "p-try": "^2.0.0" + "yocto-queue": "^0.1.0" } }, "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, "requires": { - "p-limit": "^2.2.0" + "p-limit": "^3.0.2" } }, "p-map": { @@ -15485,17 +15390,6 @@ "registry-auth-token": "^5.0.1", "registry-url": "^6.0.0", "semver": "^7.3.7" - }, - "dependencies": { - "semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", - "dev": true, - "requires": { - "lru-cache": "^6.0.0" - } - } } }, "pacote": { @@ -15527,42 +15421,19 @@ "tar": "^6.1.11" }, "dependencies": { - "@npmcli/git": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@npmcli/git/-/git-3.0.1.tgz", - "integrity": "sha512-UU85F/T+F1oVn3IsB/L6k9zXIMpXBuUBE25QDH0SsURwT6IOBqkC7M16uqo2vVZIyji3X1K4XH9luip7YekH1A==", - "dev": true, - "requires": { - "@npmcli/promise-spawn": "^3.0.0", - "lru-cache": "^7.4.4", - "mkdirp": "^1.0.4", - "npm-pick-manifest": "^7.0.0", - "proc-log": "^2.0.0", - "promise-inflight": "^1.0.1", - "promise-retry": "^2.0.1", - "semver": "^7.3.5", - "which": "^2.0.2" - } - }, "hosted-git-info": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.0.0.tgz", - "integrity": "sha512-rRnjWu0Bxj+nIfUOkz0695C0H6tRrN5iYIzYejb0tDEefe2AekHu/U5Kn9pEie5vsJqpNQU02az7TGSH3qpz4Q==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.2.1.tgz", + "integrity": "sha512-xIcQYMnhcx2Nr4JTjsFmwwnr9vldugPy9uVm0o87bjqqWMv9GaqsTeT+i99wTl0mk1uLxJtHxLb8kymqTENQsw==", "dev": true, "requires": { "lru-cache": "^7.5.1" } }, - "lru-cache": { - "version": "7.10.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.10.1.tgz", - "integrity": "sha512-BQuhQxPuRl79J5zSXRP+uNzPOyZw2oFI9JLRQ80XswSvg21KMKNtQza9eF42rfI/3Z40RvzBdXgziEkudzjo8A==", - "dev": true - }, "npm-package-arg": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-9.1.0.tgz", - "integrity": "sha512-4J0GL+u2Nh6OnhvUKXRr2ZMG4lR8qtLp+kv7UiV00Y+nGiSxtttCyIRHCt5L5BNkXQld/RceYItau3MDOoGiBw==", + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-9.1.2.tgz", + "integrity": "sha512-pzd9rLEx4TfNJkovvlBSLGhq31gGu2QDexFPWT19yCDh0JgnRhlBLNo5759N0AJmBk+kQ9Y/hXoLnlgFD+ukmg==", "dev": true, "requires": { "hosted-git-info": "^5.0.0", @@ -15612,24 +15483,21 @@ } }, "parse-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/parse-path/-/parse-path-5.0.0.tgz", - "integrity": "sha512-qOpH55/+ZJ4jUu/oLO+ifUKjFPNZGfnPJtzvGzKN/4oLMil5m9OH4VpOj6++9/ytJcfks4kzH2hhi87GL/OU9A==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/parse-path/-/parse-path-7.0.0.tgz", + "integrity": "sha512-Euf9GG8WT9CdqwuWJGdf3RkUcTBArppHABkO7Lm8IzRQp0e2r/kkFnmhu4TSK30Wcu5rVAZLmfPKSBBi9tWFog==", "dev": true, "requires": { "protocols": "^2.0.0" } }, "parse-url": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/parse-url/-/parse-url-7.0.2.tgz", - "integrity": "sha512-PqO4Z0eCiQ08Wj6QQmrmp5YTTxpYfONdOEamrtvK63AmzXpcavIVQubGHxOEwiIoDZFb8uDOoQFS0NCcjqIYQg==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/parse-url/-/parse-url-8.1.0.tgz", + "integrity": "sha512-xDvOoLU5XRrcOZvnI6b8zA6n9O9ejNk/GExuz1yBuWUGn9KA97GI6HTs6u02wKara1CeVmZhH+0TZFdWScR89w==", "dev": true, "requires": { - "is-ssh": "^1.4.0", - "normalize-url": "^6.1.0", - "parse-path": "^5.0.0", - "protocols": "^2.0.1" + "parse-path": "^7.0.0" } }, "path-exists": { @@ -15641,7 +15509,7 @@ "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "dev": true }, "path-key": { @@ -15681,6 +15549,45 @@ "dev": true, "requires": { "find-up": "^4.0.0" + }, + "dependencies": { + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + } } }, "prelude-ls": { @@ -15690,9 +15597,10 @@ "dev": true }, "prettier": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", - "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==" + "version": "2.8.4", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.4.tgz", + "integrity": "sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw==", + "dev": true }, "proc-log": { "version": "2.0.1", @@ -15727,7 +15635,7 @@ "promise-inflight": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", - "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=", + "integrity": "sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==", "dev": true }, "promise-retry": { @@ -15765,46 +15673,22 @@ "integrity": "sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==", "dev": true }, - "protobufjs": { - "version": "6.11.3", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.3.tgz", - "integrity": "sha512-xL96WDdCZYdU7Slin569tFX712BxsxslWwAfAhCYjQKGTq7dAU91Lomy6nLLhh/dyGhk/YH4TwTSRxTzhuHyZg==", - "requires": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/long": "^4.0.1", - "@types/node": ">=13.7.0", - "long": "^4.0.0" - } - }, "protocols": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/protocols/-/protocols-2.0.1.tgz", "integrity": "sha512-/XJ368cyBJ7fzLMwLKv1e4vLxOju2MNAIokcr7meSaNcVbWz/CPcW22cP04mwxOErdA5mwjA8Q6w/cdAQxVn7Q==", "dev": true }, - "pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } + "proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "dev": true }, "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", + "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", "dev": true }, "pupa": { @@ -15855,14 +15739,14 @@ } }, "rc-config-loader": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/rc-config-loader/-/rc-config-loader-4.1.0.tgz", - "integrity": "sha512-aW+kX4qy0CiM9L4fG4Us3oEOpIrOrXzWykAn+xldD07Y9PXWjTH744oHbv0Kc9ZwWaylw3jMjxaf14RgStrNrA==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/rc-config-loader/-/rc-config-loader-4.1.2.tgz", + "integrity": "sha512-qKTnVWFl9OQYKATPzdfaZIbTxcHziQl92zYSxYC6umhOqyAsoj8H8Gq/+aFjAso68sBdjTz3A7omqeAkkF1MWg==", "dev": true, "requires": { - "debug": "^4.1.1", - "js-yaml": "^4.0.0", - "json5": "^2.1.2", + "debug": "^4.3.4", + "js-yaml": "^4.1.0", + "json5": "^2.2.2", "require-from-string": "^2.0.2" } }, @@ -15903,9 +15787,9 @@ } }, "glob": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz", - "integrity": "sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -15916,33 +15800,27 @@ } }, "hosted-git-info": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.0.0.tgz", - "integrity": "sha512-rRnjWu0Bxj+nIfUOkz0695C0H6tRrN5iYIzYejb0tDEefe2AekHu/U5Kn9pEie5vsJqpNQU02az7TGSH3qpz4Q==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.2.1.tgz", + "integrity": "sha512-xIcQYMnhcx2Nr4JTjsFmwwnr9vldugPy9uVm0o87bjqqWMv9GaqsTeT+i99wTl0mk1uLxJtHxLb8kymqTENQsw==", "dev": true, "requires": { "lru-cache": "^7.5.1" } }, - "lru-cache": { - "version": "7.13.2", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.13.2.tgz", - "integrity": "sha512-VJL3nIpA79TodY/ctmZEfhASgqekbT574/c4j3jn4bKXbSCnTTCH/KltZyvL2GlV+tGSMtsWyem8DCX7qKTMBA==", - "dev": true - }, "minimatch": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", - "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", "dev": true, "requires": { "brace-expansion": "^2.0.1" } }, "normalize-package-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-4.0.0.tgz", - "integrity": "sha512-m+GL22VXJKkKbw62ZaBBjv8u6IE3UI4Mh5QakIqs3fWiKe0Xyi6L97hakwZK41/LD4R/2ly71Bayx0NLMwLA/g==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-4.0.1.tgz", + "integrity": "sha512-EBk5QKKuocMJhB3BILuKhmaPjI8vNRSpIfO9woLC6NyHVkKKdVEdAO1mrT0ZfxNR1lKwCcTkuZfmGIFdizZ8Pg==", "dev": true, "requires": { "hosted-git-info": "^5.0.0", @@ -16137,15 +16015,6 @@ "once": "^1.3.0" } }, - "readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "dev": true, - "requires": { - "picomatch": "^2.2.1" - } - }, "redent": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", @@ -16189,7 +16058,7 @@ "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", "dev": true }, "require-from-string": { @@ -16239,20 +16108,12 @@ "dev": true }, "responselike": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/responselike/-/responselike-2.0.1.tgz", - "integrity": "sha512-4gl03wn3hj1HP3yzgdI7d3lCkF95F21Pz4BPGvKHinyQzALR5CapwC8yIi0Rh58DEMQ/SguC03wFj2k0M/mHhw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-3.0.0.tgz", + "integrity": "sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==", "dev": true, "requires": { - "lowercase-keys": "^2.0.0" - }, - "dependencies": { - "lowercase-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", - "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", - "dev": true - } + "lowercase-keys": "^3.0.0" } }, "restore-cursor": { @@ -16268,7 +16129,7 @@ "retry": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", - "integrity": "sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs=", + "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==", "dev": true }, "reusify": { @@ -16302,20 +16163,12 @@ } }, "rxjs": { - "version": "7.5.6", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.5.6.tgz", - "integrity": "sha512-dnyv2/YsXhnm461G+R/Pe5bWP41Nm6LBXEYWI6eiFP4fiwx6WRI/CD0zbdVAudd9xwLEF2IDcKXLHit0FYjUzw==", + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.0.tgz", + "integrity": "sha512-F2+gxDshqmIub1KdvZkaEfGDwLNpPvk9Fs6LD/MyQxNgMds/WH9OdDDXOmxUZpME+iSK3rQCctkL0DYyytUqMg==", "dev": true, "requires": { "tslib": "^2.1.0" - }, - "dependencies": { - "tslib": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", - "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==", - "dev": true - } } }, "safe-buffer": { @@ -16331,12 +16184,23 @@ "dev": true }, "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "version": "7.3.8", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", + "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", "dev": true, "requires": { "lru-cache": "^6.0.0" + }, + "dependencies": { + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + } } }, "semver-diff": { @@ -16357,7 +16221,7 @@ "set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", "dev": true }, "shallow-clone": { @@ -16390,6 +16254,156 @@ "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", "dev": true }, + "sigstore": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/sigstore/-/sigstore-1.0.0.tgz", + "integrity": "sha512-e+qfbn/zf1+rCza/BhIA//Awmf0v1pa5HQS8Xk8iXrn9bgytytVLqYD0P7NSqZ6IELTgq+tcDvLPkQjNHyWLNg==", + "dev": true, + "requires": { + "make-fetch-happen": "^11.0.1", + "tuf-js": "^1.0.0" + }, + "dependencies": { + "@npmcli/fs": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-3.1.0.tgz", + "integrity": "sha512-7kZUAaLscfgbwBQRbvdMYaZOWyMEcPTH/tJjnyAWJ/dvvs9Ef+CERx/qJb9GExJpl1qipaDGn7KqHnFGGixd0w==", + "dev": true, + "requires": { + "semver": "^7.3.5" + } + }, + "brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0" + } + }, + "cacache": { + "version": "17.0.4", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-17.0.4.tgz", + "integrity": "sha512-Z/nL3gU+zTUjz5pCA5vVjYM8pmaw2kxM7JEiE0fv3w77Wj+sFbi70CrBruUWH0uNcEdvLDixFpgA2JM4F4DBjA==", + "dev": true, + "requires": { + "@npmcli/fs": "^3.1.0", + "fs-minipass": "^3.0.0", + "glob": "^8.0.1", + "lru-cache": "^7.7.1", + "minipass": "^4.0.0", + "minipass-collect": "^1.0.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "p-map": "^4.0.0", + "promise-inflight": "^1.0.1", + "ssri": "^10.0.0", + "tar": "^6.1.11", + "unique-filename": "^3.0.0" + } + }, + "fs-minipass": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-3.0.1.tgz", + "integrity": "sha512-MhaJDcFRTuLidHrIttu0RDGyyXs/IYHVmlcxfLAEFIWjc1vdLAkdwT7Ace2u7DbitWC0toKMl5eJZRYNVreIMw==", + "dev": true, + "requires": { + "minipass": "^4.0.0" + } + }, + "glob": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + } + }, + "make-fetch-happen": { + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-11.0.3.tgz", + "integrity": "sha512-oPLh5m10lRNNZDjJ2kP8UpboUx2uFXVaVweVe/lWut4iHWcQEmfqSVJt2ihZsFI8HbpwyyocaXbCAWf0g1ukIA==", + "dev": true, + "requires": { + "agentkeepalive": "^4.2.1", + "cacache": "^17.0.0", + "http-cache-semantics": "^4.1.1", + "http-proxy-agent": "^5.0.0", + "https-proxy-agent": "^5.0.0", + "is-lambda": "^1.0.1", + "lru-cache": "^7.7.1", + "minipass": "^4.0.0", + "minipass-fetch": "^3.0.0", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^0.6.3", + "promise-retry": "^2.0.1", + "socks-proxy-agent": "^7.0.0", + "ssri": "^10.0.0" + } + }, + "minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dev": true, + "requires": { + "brace-expansion": "^2.0.1" + } + }, + "minipass": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-4.2.4.tgz", + "integrity": "sha512-lwycX3cBMTvcejsHITUgYj6Gy6A7Nh4Q6h9NP4sTHY1ccJlC7yKzDmiShEHsJ16Jf1nKGDEaiHxiltsJEvk0nQ==", + "dev": true + }, + "minipass-fetch": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-3.0.1.tgz", + "integrity": "sha512-t9/wowtf7DYkwz8cfMSt0rMwiyNIBXf5CKZ3S5ZMqRqMYT0oLTp0x1WorMI9WTwvaPg21r1JbFxJMum8JrLGfw==", + "dev": true, + "requires": { + "encoding": "^0.1.13", + "minipass": "^4.0.0", + "minipass-sized": "^1.0.3", + "minizlib": "^2.1.2" + } + }, + "ssri": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-10.0.1.tgz", + "integrity": "sha512-WVy6di9DlPOeBWEjMScpNipeSX2jIZBGEn5Uuo8Q7aIuFEuDX0pw8RxcOjlD1TWP4obi24ki7m/13+nFpcbXrw==", + "dev": true, + "requires": { + "minipass": "^4.0.0" + } + }, + "unique-filename": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-3.0.0.tgz", + "integrity": "sha512-afXhuC55wkAmZ0P18QsVE6kp8JaxrEokN2HGIoIVv2ijHQd419H0+6EigAFcIzXeMIkcIkNBpB3L/DXB3cTS/g==", + "dev": true, + "requires": { + "unique-slug": "^4.0.0" + } + }, + "unique-slug": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-4.0.0.tgz", + "integrity": "sha512-WrcA6AyEfqDX5bWige/4NQfPZMtASNVxdmWR76WESYQVAACSgWcR6e9i0mofqqBxYFtL4oAxPIptY73/0YE1DQ==", + "dev": true, + "requires": { + "imurmurhash": "^0.1.4" + } + } + } + }, "sisteransi": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", @@ -16409,9 +16423,9 @@ "dev": true }, "socks": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.0.tgz", - "integrity": "sha512-scnOe9y4VuiNUULJN72GrM26BNOjVsfPXI+j+98PkyEfsIXroa5ofyjT+FzGvn/xHs73U2JtoBYAVx9Hl4quSA==", + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz", + "integrity": "sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==", "dev": true, "requires": { "ip": "^2.0.0", @@ -16430,20 +16444,12 @@ } }, "sort-keys": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-4.2.0.tgz", - "integrity": "sha512-aUYIEU/UviqPgc8mHR6IW1EGxkAXpeRETYcrzg8cLAvUPZcpAlleSXHV2mY7G12GphSH6Gzv+4MMVSSkbdteHg==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-2.0.0.tgz", + "integrity": "sha512-/dPCrG1s3ePpWm6yBbxZq5Be1dXGLyLn9Z791chDC3NFrpkVbWGzkBwPN1knaciexFXgRJ7hzdnwZ4stHSDmjg==", "dev": true, "requires": { - "is-plain-obj": "^2.0.0" - }, - "dependencies": { - "is-plain-obj": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", - "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", - "dev": true - } + "is-plain-obj": "^1.0.0" } }, "source-map": { @@ -16463,10 +16469,13 @@ } }, "spawn-please": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/spawn-please/-/spawn-please-1.0.0.tgz", - "integrity": "sha512-Kz33ip6NRNKuyTRo3aDWyWxeGeM0ORDO552Fs6E1nj4pLWPkl37SrRtTnq+MEopVaqgmaO6bAvVS+v64BJ5M/A==", - "dev": true + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/spawn-please/-/spawn-please-2.0.1.tgz", + "integrity": "sha512-W+cFbZR2q2mMTfjz5ZGvhBAiX+e/zczFCNlbS9mxiSdYswBXwUuBUT+a0urH+xZZa8f/bs0mXHyZsZHR9hKogA==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.3" + } }, "spdx-correct": { "version": "3.1.1", @@ -16495,9 +16504,9 @@ } }, "spdx-license-ids": { - "version": "3.0.11", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.11.tgz", - "integrity": "sha512-Ctl2BrFiM0X3MANYgj3CkygxhRmr9mi6xhejbdO960nF6EDJApTYpn0BQnDKlnNBULKiCN1n3w9EBkHK8ZWg+g==", + "version": "3.0.12", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.12.tgz", + "integrity": "sha512-rr+VVSXtRhO4OHbXUiAF7xW3Bo9DuuF6C5jH+q/x15j2jniycgKbxU09Hr0WqlSLUs4i4ltHGXqTe7VHclYWyA==", "dev": true }, "split": { @@ -16518,6 +16527,12 @@ "readable-stream": "^3.0.0" } }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", + "dev": true + }, "ssri": { "version": "9.0.1", "resolved": "https://registry.npmjs.org/ssri/-/ssri-9.0.1.tgz", @@ -16610,44 +16625,49 @@ "dev": true }, "syncpack": { - "version": "5.8.15", - "resolved": "https://registry.npmjs.org/syncpack/-/syncpack-5.8.15.tgz", - "integrity": "sha512-V40rKrJL86eyvPLVhWP1BpG2suXOzWRCOSKGPyLdAjqXpmYPSqKh2O30lIqYSFLjw8TL0Dl5WNiVINqz7+DccQ==", + "version": "9.8.4", + "resolved": "https://registry.npmjs.org/syncpack/-/syncpack-9.8.4.tgz", + "integrity": "sha512-i81rO+dHuJ2dO8YQq6SCExcyN0x9ZVTY7cVPn8pWjS5Dml0A8uM0cOaneOludFesdrLXMZUA/uEWa74ddBgkPQ==", "dev": true, "requires": { + "@mobily/ts-belt": "3.13.1", "chalk": "4.1.2", - "commander": "8.1.0", - "cosmiconfig": "7.0.0", - "expect-more": "1.1.0", - "fs-extra": "10.0.0", - "glob": "7.1.7", + "commander": "10.0.0", + "cosmiconfig": "8.0.0", + "expect-more": "1.3.0", + "fs-extra": "11.1.0", + "glob": "8.1.0", + "minimatch": "6.2.0", "read-yaml-file": "2.1.0", - "semver": "7.3.5" + "semver": "7.3.8", + "zod": "3.20.6" }, "dependencies": { - "commander": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-8.1.0.tgz", - "integrity": "sha512-mf45ldcuHSYShkplHHGKWb4TrmwQadxOn7v4WuhDJy0ZVoY5JFajaRDKD0PNe5qXzBX0rhovjTnP6Kz9LETcuA==", - "dev": true + "brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0" + } }, "cosmiconfig": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.0.tgz", - "integrity": "sha512-pondGvTuVYDk++upghXJabWzL6Kxu6f26ljFw64Swq9v6sQPUL3EUlVDV56diOjpCayKihL6hVe8exIACU4XcA==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.0.0.tgz", + "integrity": "sha512-da1EafcpH6b/TD8vDRaWV7xFINlHlF6zKsGwS1TsuVJTZRkquaS5HTMq7uq6h31619QjbsYl21gVDOm32KM1vQ==", "dev": true, "requires": { - "@types/parse-json": "^4.0.0", "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", "parse-json": "^5.0.0", - "path-type": "^4.0.0", - "yaml": "^1.10.0" + "path-type": "^4.0.0" } }, "fs-extra": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.0.tgz", - "integrity": "sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ==", + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.1.0.tgz", + "integrity": "sha512-0rcTq621PD5jM/e0a3EJoGC/1TC5ZBCERW82LQuwfGnCa1V8w7dpYH1yNu+SLb6E5dkeCBzKEyLGlFrnr+dUyw==", "dev": true, "requires": { "graceful-fs": "^4.2.0", @@ -16656,17 +16676,36 @@ } }, "glob": { - "version": "7.1.7", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", - "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "minimatch": "^5.0.1", + "once": "^1.3.0" + }, + "dependencies": { + "minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dev": true, + "requires": { + "brace-expansion": "^2.0.1" + } + } + } + }, + "minimatch": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-6.2.0.tgz", + "integrity": "sha512-sauLxniAmvnhhRjFwPNnJKaPFYyddAgbYdeUpHULtCT/GhzdCx/MDNy+Y40lBxTQUrMzDE8e0S43Z5uqfO0REg==", + "dev": true, + "requires": { + "brace-expansion": "^2.0.1" } } } @@ -16713,7 +16752,7 @@ "text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", "dev": true }, "through": { @@ -16750,13 +16789,10 @@ } }, "tr46": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-2.1.0.tgz", - "integrity": "sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw==", - "dev": true, - "requires": { - "punycode": "^2.1.1" - } + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "dev": true }, "treeverse": { "version": "2.0.0", @@ -16770,58 +16806,17 @@ "integrity": "sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==", "dev": true }, - "ts-poet": { - "version": "4.15.0", - "resolved": "https://registry.npmjs.org/ts-poet/-/ts-poet-4.15.0.tgz", - "integrity": "sha512-sLLR8yQBvHzi9d4R1F4pd+AzQxBfzOSSjfxiJxQhkUoH5bL7RsAC6wgvtVUQdGqiCsyS9rT6/8X2FI7ipdir5g==", - "requires": { - "lodash": "^4.17.15", - "prettier": "^2.5.1" - } - }, - "ts-proto": { - "version": "1.122.0", - "resolved": "https://registry.npmjs.org/ts-proto/-/ts-proto-1.122.0.tgz", - "integrity": "sha512-TmPKmSxRJjnfrdyncOMfilJDXvyL0BGxM4nDyYgMDVT2EhYZV85J93qEJPBIufwUtDBY8N42UNgja8Z5ObF6IA==", - "requires": { - "@types/object-hash": "^1.3.0", - "dataloader": "^1.4.0", - "object-hash": "^1.3.1", - "protobufjs": "^6.11.3", - "ts-poet": "^4.15.0", - "ts-proto-descriptors": "1.7.1" - } - }, - "ts-proto-descriptors": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/ts-proto-descriptors/-/ts-proto-descriptors-1.7.1.tgz", - "integrity": "sha512-oIKUh3K4Xts4v29USGLfUG+2mEk32MsqpgZAOUyUlkrcIdv34yE+k2oZ2Nzngm6cV/JgFdOxRCqeyvmWHuYAyw==", - "requires": { - "long": "^4.0.0", - "protobufjs": "^6.8.8" - } - }, "tsconfig-paths": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz", - "integrity": "sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-4.1.2.tgz", + "integrity": "sha512-uhxiMgnXQp1IR622dUXI+9Ehnws7i/y6xvpZB9IbUVOPy0muvdvgXeZOn88UcGPiT98Vp3rJPTa8bFoalZ3Qhw==", "dev": true, "requires": { - "@types/json5": "^0.0.29", - "json5": "^1.0.1", + "json5": "^2.2.2", "minimist": "^1.2.6", "strip-bom": "^3.0.0" }, "dependencies": { - "json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", - "dev": true, - "requires": { - "minimist": "^1.2.0" - } - }, "strip-bom": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", @@ -16831,9 +16826,9 @@ } }, "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", + "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==", "dev": true }, "tsutils": { @@ -16843,6 +16838,164 @@ "dev": true, "requires": { "tslib": "^1.8.1" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + } + } + }, + "tuf-js": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/tuf-js/-/tuf-js-1.1.0.tgz", + "integrity": "sha512-Tsqlm419OAlrkCE6rsf1WuPvww44vfK1ZHz+Uq9Mpq5JiV5qnJ9LLItvsbM9OipIIeSG3rydVBS4BmD40ts2uA==", + "dev": true, + "requires": { + "@tufjs/models": "1.0.0", + "make-fetch-happen": "^11.0.1" + }, + "dependencies": { + "@npmcli/fs": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-3.1.0.tgz", + "integrity": "sha512-7kZUAaLscfgbwBQRbvdMYaZOWyMEcPTH/tJjnyAWJ/dvvs9Ef+CERx/qJb9GExJpl1qipaDGn7KqHnFGGixd0w==", + "dev": true, + "requires": { + "semver": "^7.3.5" + } + }, + "brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0" + } + }, + "cacache": { + "version": "17.0.4", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-17.0.4.tgz", + "integrity": "sha512-Z/nL3gU+zTUjz5pCA5vVjYM8pmaw2kxM7JEiE0fv3w77Wj+sFbi70CrBruUWH0uNcEdvLDixFpgA2JM4F4DBjA==", + "dev": true, + "requires": { + "@npmcli/fs": "^3.1.0", + "fs-minipass": "^3.0.0", + "glob": "^8.0.1", + "lru-cache": "^7.7.1", + "minipass": "^4.0.0", + "minipass-collect": "^1.0.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "p-map": "^4.0.0", + "promise-inflight": "^1.0.1", + "ssri": "^10.0.0", + "tar": "^6.1.11", + "unique-filename": "^3.0.0" + } + }, + "fs-minipass": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-3.0.1.tgz", + "integrity": "sha512-MhaJDcFRTuLidHrIttu0RDGyyXs/IYHVmlcxfLAEFIWjc1vdLAkdwT7Ace2u7DbitWC0toKMl5eJZRYNVreIMw==", + "dev": true, + "requires": { + "minipass": "^4.0.0" + } + }, + "glob": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + } + }, + "make-fetch-happen": { + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-11.0.3.tgz", + "integrity": "sha512-oPLh5m10lRNNZDjJ2kP8UpboUx2uFXVaVweVe/lWut4iHWcQEmfqSVJt2ihZsFI8HbpwyyocaXbCAWf0g1ukIA==", + "dev": true, + "requires": { + "agentkeepalive": "^4.2.1", + "cacache": "^17.0.0", + "http-cache-semantics": "^4.1.1", + "http-proxy-agent": "^5.0.0", + "https-proxy-agent": "^5.0.0", + "is-lambda": "^1.0.1", + "lru-cache": "^7.7.1", + "minipass": "^4.0.0", + "minipass-fetch": "^3.0.0", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^0.6.3", + "promise-retry": "^2.0.1", + "socks-proxy-agent": "^7.0.0", + "ssri": "^10.0.0" + } + }, + "minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dev": true, + "requires": { + "brace-expansion": "^2.0.1" + } + }, + "minipass": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-4.2.4.tgz", + "integrity": "sha512-lwycX3cBMTvcejsHITUgYj6Gy6A7Nh4Q6h9NP4sTHY1ccJlC7yKzDmiShEHsJ16Jf1nKGDEaiHxiltsJEvk0nQ==", + "dev": true + }, + "minipass-fetch": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-3.0.1.tgz", + "integrity": "sha512-t9/wowtf7DYkwz8cfMSt0rMwiyNIBXf5CKZ3S5ZMqRqMYT0oLTp0x1WorMI9WTwvaPg21r1JbFxJMum8JrLGfw==", + "dev": true, + "requires": { + "encoding": "^0.1.13", + "minipass": "^4.0.0", + "minipass-sized": "^1.0.3", + "minizlib": "^2.1.2" + } + }, + "ssri": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-10.0.1.tgz", + "integrity": "sha512-WVy6di9DlPOeBWEjMScpNipeSX2jIZBGEn5Uuo8Q7aIuFEuDX0pw8RxcOjlD1TWP4obi24ki7m/13+nFpcbXrw==", + "dev": true, + "requires": { + "minipass": "^4.0.0" + } + }, + "unique-filename": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-3.0.0.tgz", + "integrity": "sha512-afXhuC55wkAmZ0P18QsVE6kp8JaxrEokN2HGIoIVv2ijHQd419H0+6EigAFcIzXeMIkcIkNBpB3L/DXB3cTS/g==", + "dev": true, + "requires": { + "unique-slug": "^4.0.0" + } + }, + "unique-slug": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-4.0.0.tgz", + "integrity": "sha512-WrcA6AyEfqDX5bWige/4NQfPZMtASNVxdmWR76WESYQVAACSgWcR6e9i0mofqqBxYFtL4oAxPIptY73/0YE1DQ==", + "dev": true, + "requires": { + "imurmurhash": "^0.1.4" + } + } } }, "type-check": { @@ -16882,25 +17035,25 @@ "dev": true }, "uglify-js": { - "version": "3.16.3", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.16.3.tgz", - "integrity": "sha512-uVbFqx9vvLhQg0iBaau9Z75AxWJ8tqM9AV890dIZCLApF4rTcyHwmAvLeEdYRs+BzYWu8Iw81F79ah0EfTXbaw==", + "version": "3.17.4", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz", + "integrity": "sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==", "dev": true, "optional": true }, "unique-filename": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", - "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-2.0.1.tgz", + "integrity": "sha512-ODWHtkkdx3IAR+veKxFV+VBkUMcN+FaqzUUd7IZzt+0zhDZFPFxhlqwPF3YQvMHx1TD0tdgYl+kuPnJ8E6ql7A==", "dev": true, "requires": { - "unique-slug": "^2.0.0" + "unique-slug": "^3.0.0" } }, "unique-slug": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", - "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-3.0.0.tgz", + "integrity": "sha512-8EyMynh679x/0gqE9fT9oilG+qEt+ibFyqjuVTsZn1+CMxH+XLlpvr2UZx4nVcCwTpx81nICr2JQFkM+HPLq4w==", "dev": true, "requires": { "imurmurhash": "^0.1.4" @@ -16927,6 +17080,12 @@ "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", "dev": true }, + "untildify": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz", + "integrity": "sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==", + "dev": true + }, "upath": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/upath/-/upath-2.0.1.tgz", @@ -16956,15 +17115,15 @@ }, "dependencies": { "chalk": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.0.1.tgz", - "integrity": "sha512-Fo07WOYGqMfCWHOzSXOt2CxDbC6skS/jO9ynEcmpANMoPrD+W1r1K6Vx7iNm+AQmETU1Xr2t+n8nzkV9t6xh3w==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.1.2.tgz", + "integrity": "sha512-E5CkT4jWURs1Vy5qGJye+XwCkNj7Od3Af7CP6SujMetSMkLs8Do2RWJK5yx1wamHV/op8Rz+9rltjaTQWDnEFQ==", "dev": true }, "ci-info": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.2.tgz", - "integrity": "sha512-xmDt/QIAdeZ9+nfdPsaBCpMvHNLFiLdjj59qjqn+6iPe6YmHGQ35sBnQ8uslRBXFmXkiZQOJRjvQeoGppoTjjg==", + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.5.0.tgz", + "integrity": "sha512-yH4RezKOGlOhxkmhbeNuC4eYZKAUsEaGtBuBzDDP1eFUKiccDWzBABxBfOx31IDwDIXMTxWuwAxUGModvkbuVw==", "dev": true }, "is-ci": { @@ -16975,15 +17134,6 @@ "requires": { "ci-info": "^3.2.0" } - }, - "semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", - "dev": true, - "requires": { - "lru-cache": "^6.0.0" - } } } }, @@ -17049,20 +17199,19 @@ } }, "webidl-conversions": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz", - "integrity": "sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", "dev": true }, "whatwg-url": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.7.0.tgz", - "integrity": "sha512-gAojqb/m9Q8a5IV96E3fHJM70AzCkgt4uXYX2O7EmuyOnLrViCQlsEBmF9UQIu3/aeAIp2U17rtbpZWNntQqdg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", "dev": true, "requires": { - "lodash": "^4.7.0", - "tr46": "^2.1.0", - "webidl-conversions": "^6.1.0" + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" } }, "which": { @@ -17152,52 +17301,31 @@ "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "dev": true }, "write-file-atomic": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", - "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.1.tgz", + "integrity": "sha512-nSKUxgAbyioruk6hU87QzVbY279oYT6uiwgDoujth2ju4mJ+TZau7SQBhtbTmUyuNYTuXnSyRn66FV0+eCgcrQ==", "dev": true, "requires": { "imurmurhash": "^0.1.4", - "is-typedarray": "^1.0.0", - "signal-exit": "^3.0.2", - "typedarray-to-buffer": "^3.1.5" + "signal-exit": "^3.0.7" } }, "write-json-file": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/write-json-file/-/write-json-file-4.3.0.tgz", - "integrity": "sha512-PxiShnxf0IlnQuMYOPPhPkhExoCQuTUNPOa/2JWCYTmBquU9njyyDuwRKN26IZBlp4yn1nt+Agh2HOOBl+55HQ==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/write-json-file/-/write-json-file-3.2.0.tgz", + "integrity": "sha512-3xZqT7Byc2uORAatYiP3DHUUAVEkNOswEWNs9H5KXiicRTvzYzYqKjYc4G7p+8pltvAw641lVByKVtMpf+4sYQ==", "dev": true, "requires": { - "detect-indent": "^6.0.0", + "detect-indent": "^5.0.0", "graceful-fs": "^4.1.15", - "is-plain-obj": "^2.0.0", - "make-dir": "^3.0.0", - "sort-keys": "^4.0.0", - "write-file-atomic": "^3.0.0" - }, - "dependencies": { - "is-plain-obj": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", - "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", - "dev": true - } - } - }, - "write-pkg": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/write-pkg/-/write-pkg-4.0.0.tgz", - "integrity": "sha512-v2UQ+50TNf2rNHJ8NyWttfm/EJUBWMJcx6ZTYZr6Qp52uuegWw/lBkCtCbnYZEmPRNL61m+u67dAmGxo+HTULA==", - "dev": true, - "requires": { + "make-dir": "^2.1.0", + "pify": "^4.0.1", "sort-keys": "^2.0.0", - "type-fest": "^0.4.1", - "write-json-file": "^3.2.0" + "write-file-atomic": "^2.4.2" }, "dependencies": { "detect-indent": { @@ -17228,21 +17356,6 @@ "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "dev": true }, - "sort-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-2.0.0.tgz", - "integrity": "sha512-/dPCrG1s3ePpWm6yBbxZq5Be1dXGLyLn9Z791chDC3NFrpkVbWGzkBwPN1knaciexFXgRJ7hzdnwZ4stHSDmjg==", - "dev": true, - "requires": { - "is-plain-obj": "^1.0.0" - } - }, - "type-fest": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.4.1.tgz", - "integrity": "sha512-IwzA/LSfD2vC1/YDYMv/zHP4rDF1usCwllsDpbolT3D4fUepIO7f9K70jjmUewU/LmGUKJcwcVtDCpnKk4BPMw==", - "dev": true - }, "write-file-atomic": { "version": "2.4.3", "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz", @@ -17253,20 +17366,25 @@ "imurmurhash": "^0.1.4", "signal-exit": "^3.0.2" } - }, - "write-json-file": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/write-json-file/-/write-json-file-3.2.0.tgz", - "integrity": "sha512-3xZqT7Byc2uORAatYiP3DHUUAVEkNOswEWNs9H5KXiicRTvzYzYqKjYc4G7p+8pltvAw641lVByKVtMpf+4sYQ==", - "dev": true, - "requires": { - "detect-indent": "^5.0.0", - "graceful-fs": "^4.1.15", - "make-dir": "^2.1.0", - "pify": "^4.0.1", - "sort-keys": "^2.0.0", - "write-file-atomic": "^2.4.2" - } + } + } + }, + "write-pkg": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/write-pkg/-/write-pkg-4.0.0.tgz", + "integrity": "sha512-v2UQ+50TNf2rNHJ8NyWttfm/EJUBWMJcx6ZTYZr6Qp52uuegWw/lBkCtCbnYZEmPRNL61m+u67dAmGxo+HTULA==", + "dev": true, + "requires": { + "sort-keys": "^2.0.0", + "type-fest": "^0.4.1", + "write-json-file": "^3.2.0" + }, + "dependencies": { + "type-fest": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.4.1.tgz", + "integrity": "sha512-IwzA/LSfD2vC1/YDYMv/zHP4rDF1usCwllsDpbolT3D4fUepIO7f9K70jjmUewU/LmGUKJcwcVtDCpnKk4BPMw==", + "dev": true } } }, @@ -17316,9 +17434,9 @@ } }, "yargs-parser": { - "version": "20.2.9", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", - "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "version": "20.2.4", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", + "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", "dev": true }, "yocto-queue": { @@ -17326,6 +17444,12 @@ "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "dev": true + }, + "zod": { + "version": "3.20.6", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.20.6.tgz", + "integrity": "sha512-oyu0m54SGCtzh6EClBVqDDlAYRz4jrVtKwQ7ZnsEmMI9HnzuZFj8QFwAY1M5uniIYACdGvv0PBWPF2kO0aNofA==", + "dev": true } } } diff --git a/package.json b/package.json index b2e2483bc..e4b4890ce 100644 --- a/package.json +++ b/package.json @@ -22,23 +22,21 @@ "devDependencies": { "@types/glob": "^7.2.0", "@types/node": "^17.0.45", - "@types/yargs": "^16.0.4", - "@typescript-eslint/eslint-plugin": "^5.32.0", - "@typescript-eslint/parser": "^5.32.0", + "@types/yargs": "^16.0.5", + "@typescript-eslint/eslint-plugin": "^5.54.0", + "@typescript-eslint/parser": "^5.54.0", "detect-indent": "^6.1.0", - "eslint": "^8.21.0", - "eslint-config-prettier": "^8.5.0", + "eslint": "^8.35.0", + "eslint-config-prettier": "^8.6.0", "eslint-plugin-simple-import-sort": "^7.0.0", "glob": "^7.2.3", - "jsonc-parser": "^3.1.0", - "lerna": "^5.3.0", - "npm-check-updates": "^16.0.5", + "jsonc-parser": "^3.2.0", + "lerna": "^6.5.1", + "npm-check-updates": "^16.7.10", "p-queue": "^6.6.2", - "prettier": "2.7.1", - "syncpack": "^5.8.15", - "typescript": "~4.4.4" - }, - "dependencies": { - "ts-proto": "^1.100.1" + "prettier": "2.8.4", + "syncpack": "^9.8.4", + "typescript": "~4.4.4", + "yargs": "^16.2.0" } } diff --git a/packages/pyright-internal/package-lock.json b/packages/pyright-internal/package-lock.json index 8431e810d..2ea1038bf 100644 --- a/packages/pyright-internal/package-lock.json +++ b/packages/pyright-internal/package-lock.json @@ -1,30 +1,29 @@ { "name": "pyright-internal", - "version": "1.1.267", + "version": "1.1.301", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "pyright-internal", - "version": "1.1.267", + "version": "1.1.301", "license": "MIT", "dependencies": { "@iarna/toml": "2.2.5", - "@yarnpkg/fslib": "2.7.0", + "@yarnpkg/fslib": "2.10.1", "@yarnpkg/libzip": "2.2.4", "chalk": "^4.1.2", "chokidar": "^3.5.3", "command-line-args": "^5.2.1", - "jsonc-parser": "^3.1.0", + "jsonc-parser": "^3.2.0", "leven": "^3.1.0", "source-map-support": "^0.5.21", "tmp": "^0.2.1", "typescript-char": "^0.0.0", - "vscode-jsonrpc": "8.0.2-next.1", - "vscode-languageserver": "8.0.2-next.4", - "vscode-languageserver-textdocument": "^1.0.5", - "vscode-languageserver-types": "3.17.2-next.2", - "vscode-uri": "^3.0.3" + "vscode-jsonrpc": "8.1.0", + "vscode-languageserver": "8.1.0", + "vscode-languageserver-textdocument": "^1.0.9", + "vscode-languageserver-types": "3.17.3", + "vscode-uri": "^3.0.7" }, "devDependencies": { "@types/command-line-args": "^5.2.0", @@ -1044,9 +1043,9 @@ "dev": true }, "node_modules/@yarnpkg/fslib": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/@yarnpkg/fslib/-/fslib-2.7.0.tgz", - "integrity": "sha512-uLVuKd/i19v2c1OMg8H9sH8o5QAKlrLQYXdOk7ZFzUPDTmb8tHrSO1IKUijqItKAUi8RkrqsVgDHZmYFUEWMfQ==", + "version": "2.10.1", + "resolved": "https://registry.npmjs.org/@yarnpkg/fslib/-/fslib-2.10.1.tgz", + "integrity": "sha512-pVMLtOYu87N5y5G2lyPNYTY2JbTco99v7nGFI34Blx01Ct9LmoKVOc91vnLOYIMMljKr1c8xs1O2UamRdMG5Pg==", "dependencies": { "@yarnpkg/libzip": "^2.2.4", "tslib": "^1.13.0" @@ -3061,13 +3060,10 @@ "dev": true }, "node_modules/json5": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", - "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "dev": true, - "dependencies": { - "minimist": "^1.2.5" - }, "bin": { "json5": "lib/cli.js" }, @@ -3076,9 +3072,9 @@ } }, "node_modules/jsonc-parser": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.1.0.tgz", - "integrity": "sha512-DRf0QjnNeCUds3xTjKlQQ3DpJD51GvDjJfnxUVWg6PZTo2otSm+slzNAxU/35hF8/oJIKoG9slq30JYOsF2azg==" + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz", + "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==" }, "node_modules/kleur": { "version": "3.0.3", @@ -3237,9 +3233,9 @@ } }, "node_modules/minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -4188,47 +4184,47 @@ } }, "node_modules/vscode-jsonrpc": { - "version": "8.0.2-next.1", - "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.0.2-next.1.tgz", - "integrity": "sha512-sbbvGSWja7NVBLHPGawtgezc8DHYJaP4qfr/AaJiyDapWcSFtHyPtm18+LnYMLTmB7bhOUW/lf5PeeuLpP6bKA==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.1.0.tgz", + "integrity": "sha512-6TDy/abTQk+zDGYazgbIPc+4JoXdwC8NHU9Pbn4UJP1fehUyZmM4RHp5IthX7A6L5KS30PRui+j+tbbMMMafdw==", "engines": { "node": ">=14.0.0" } }, "node_modules/vscode-languageserver": { - "version": "8.0.2-next.4", - "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-8.0.2-next.4.tgz", - "integrity": "sha512-B3roWH4TmJiB6Zh5+r7zu0QdlLqJsPdGo0LeEi6OiLfrHYCDlcI7DNcQ7F17vWmxC3C82SrxMt/EuLBMpKQM0A==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-8.1.0.tgz", + "integrity": "sha512-eUt8f1z2N2IEUDBsKaNapkz7jl5QpskN2Y0G01T/ItMxBxw1fJwvtySGB9QMecatne8jFIWJGWI61dWjyTLQsw==", "dependencies": { - "vscode-languageserver-protocol": "3.17.2-next.5" + "vscode-languageserver-protocol": "3.17.3" }, "bin": { "installServerIntoExtension": "bin/installServerIntoExtension" } }, "node_modules/vscode-languageserver-protocol": { - "version": "3.17.2-next.5", - "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.2-next.5.tgz", - "integrity": "sha512-UlH+QL4Q4lX94of/UPDDwwWIkd8w7dtMW4khzvEDUoykiG9tba0iG6V0bAiv8XVpnBIUYjL2FNFiL3zl+TY1Sw==", + "version": "3.17.3", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.3.tgz", + "integrity": "sha512-924/h0AqsMtA5yK22GgMtCYiMdCOtWTSGgUOkgEDX+wk2b0x4sAfLiO4NxBxqbiVtz7K7/1/RgVrVI0NClZwqA==", "dependencies": { - "vscode-jsonrpc": "8.0.2-next.1", - "vscode-languageserver-types": "3.17.2-next.2" + "vscode-jsonrpc": "8.1.0", + "vscode-languageserver-types": "3.17.3" } }, "node_modules/vscode-languageserver-textdocument": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.5.tgz", - "integrity": "sha512-1ah7zyQjKBudnMiHbZmxz5bYNM9KKZYz+5VQLj+yr8l+9w3g+WAhCkUkWbhMEdC5u0ub4Ndiye/fDyS8ghIKQg==" + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.9.tgz", + "integrity": "sha512-NPfHVGFW2/fQEWHspr8x3PXhRgtFbuDZdl7p6ifuN3M7nk2Yjf5POr/NfDBuAiQG88DehDyJ7nGOT+p+edEtbw==" }, "node_modules/vscode-languageserver-types": { - "version": "3.17.2-next.2", - "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.2-next.2.tgz", - "integrity": "sha512-TiAkLABgqkVWdAlC3XlOfdhdjIAdVU4YntPUm9kKGbXr+MGwpVnKz2KZMNBcvG0CFx8Hi8qliL0iq+ndPB720w==" + "version": "3.17.3", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.3.tgz", + "integrity": "sha512-SYU4z1dL0PyIMd4Vj8YOqFvHu7Hz/enbWtpfnVbJHU4Nd1YNYx8u0ennumc6h48GQNeOLxmwySmnADouT/AuZA==" }, "node_modules/vscode-uri": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.0.3.tgz", - "integrity": "sha512-EcswR2S8bpR7fD0YPeS7r2xXExrScVMxg4MedACaWHEtx9ftCF/qHG1xGkolzTPcEmjTavCQgbVzHUIdTMzFGA==" + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.0.7.tgz", + "integrity": "sha512-eOpPHogvorZRobNqJGhapa0JdwaxpjVvyBp0QIUMRMSf8ZAlqOdEquKuRmw9Qwu0qXtJIWqFtMkmvJjUZmMjVA==" }, "node_modules/w3c-hr-time": { "version": "1.0.2", @@ -5249,9 +5245,9 @@ "dev": true }, "@yarnpkg/fslib": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/@yarnpkg/fslib/-/fslib-2.7.0.tgz", - "integrity": "sha512-uLVuKd/i19v2c1OMg8H9sH8o5QAKlrLQYXdOk7ZFzUPDTmb8tHrSO1IKUijqItKAUi8RkrqsVgDHZmYFUEWMfQ==", + "version": "2.10.1", + "resolved": "https://registry.npmjs.org/@yarnpkg/fslib/-/fslib-2.10.1.tgz", + "integrity": "sha512-pVMLtOYu87N5y5G2lyPNYTY2JbTco99v7nGFI34Blx01Ct9LmoKVOc91vnLOYIMMljKr1c8xs1O2UamRdMG5Pg==", "requires": { "@yarnpkg/libzip": "^2.2.4", "tslib": "^1.13.0" @@ -6778,18 +6774,15 @@ "dev": true }, "json5": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", - "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", - "dev": true, - "requires": { - "minimist": "^1.2.5" - } + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true }, "jsonc-parser": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.1.0.tgz", - "integrity": "sha512-DRf0QjnNeCUds3xTjKlQQ3DpJD51GvDjJfnxUVWg6PZTo2otSm+slzNAxU/35hF8/oJIKoG9slq30JYOsF2azg==" + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz", + "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==" }, "kleur": { "version": "3.0.3", @@ -6915,9 +6908,9 @@ "dev": true }, "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "requires": { "brace-expansion": "^1.1.7" } @@ -7603,41 +7596,41 @@ } }, "vscode-jsonrpc": { - "version": "8.0.2-next.1", - "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.0.2-next.1.tgz", - "integrity": "sha512-sbbvGSWja7NVBLHPGawtgezc8DHYJaP4qfr/AaJiyDapWcSFtHyPtm18+LnYMLTmB7bhOUW/lf5PeeuLpP6bKA==" + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.1.0.tgz", + "integrity": "sha512-6TDy/abTQk+zDGYazgbIPc+4JoXdwC8NHU9Pbn4UJP1fehUyZmM4RHp5IthX7A6L5KS30PRui+j+tbbMMMafdw==" }, "vscode-languageserver": { - "version": "8.0.2-next.4", - "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-8.0.2-next.4.tgz", - "integrity": "sha512-B3roWH4TmJiB6Zh5+r7zu0QdlLqJsPdGo0LeEi6OiLfrHYCDlcI7DNcQ7F17vWmxC3C82SrxMt/EuLBMpKQM0A==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-8.1.0.tgz", + "integrity": "sha512-eUt8f1z2N2IEUDBsKaNapkz7jl5QpskN2Y0G01T/ItMxBxw1fJwvtySGB9QMecatne8jFIWJGWI61dWjyTLQsw==", "requires": { - "vscode-languageserver-protocol": "3.17.2-next.5" + "vscode-languageserver-protocol": "3.17.3" } }, "vscode-languageserver-protocol": { - "version": "3.17.2-next.5", - "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.2-next.5.tgz", - "integrity": "sha512-UlH+QL4Q4lX94of/UPDDwwWIkd8w7dtMW4khzvEDUoykiG9tba0iG6V0bAiv8XVpnBIUYjL2FNFiL3zl+TY1Sw==", + "version": "3.17.3", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.3.tgz", + "integrity": "sha512-924/h0AqsMtA5yK22GgMtCYiMdCOtWTSGgUOkgEDX+wk2b0x4sAfLiO4NxBxqbiVtz7K7/1/RgVrVI0NClZwqA==", "requires": { - "vscode-jsonrpc": "8.0.2-next.1", - "vscode-languageserver-types": "3.17.2-next.2" + "vscode-jsonrpc": "8.1.0", + "vscode-languageserver-types": "3.17.3" } }, "vscode-languageserver-textdocument": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.5.tgz", - "integrity": "sha512-1ah7zyQjKBudnMiHbZmxz5bYNM9KKZYz+5VQLj+yr8l+9w3g+WAhCkUkWbhMEdC5u0ub4Ndiye/fDyS8ghIKQg==" + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.9.tgz", + "integrity": "sha512-NPfHVGFW2/fQEWHspr8x3PXhRgtFbuDZdl7p6ifuN3M7nk2Yjf5POr/NfDBuAiQG88DehDyJ7nGOT+p+edEtbw==" }, "vscode-languageserver-types": { - "version": "3.17.2-next.2", - "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.2-next.2.tgz", - "integrity": "sha512-TiAkLABgqkVWdAlC3XlOfdhdjIAdVU4YntPUm9kKGbXr+MGwpVnKz2KZMNBcvG0CFx8Hi8qliL0iq+ndPB720w==" + "version": "3.17.3", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.3.tgz", + "integrity": "sha512-SYU4z1dL0PyIMd4Vj8YOqFvHu7Hz/enbWtpfnVbJHU4Nd1YNYx8u0ennumc6h48GQNeOLxmwySmnADouT/AuZA==" }, "vscode-uri": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.0.3.tgz", - "integrity": "sha512-EcswR2S8bpR7fD0YPeS7r2xXExrScVMxg4MedACaWHEtx9ftCF/qHG1xGkolzTPcEmjTavCQgbVzHUIdTMzFGA==" + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.0.7.tgz", + "integrity": "sha512-eOpPHogvorZRobNqJGhapa0JdwaxpjVvyBp0QIUMRMSf8ZAlqOdEquKuRmw9Qwu0qXtJIWqFtMkmvJjUZmMjVA==" }, "w3c-hr-time": { "version": "1.0.2", diff --git a/packages/pyright-internal/package.json b/packages/pyright-internal/package.json index e03feef3b..6ef8e546a 100644 --- a/packages/pyright-internal/package.json +++ b/packages/pyright-internal/package.json @@ -2,7 +2,7 @@ "name": "pyright-internal", "displayName": "pyright", "description": "Type checker for the Python language", - "version": "1.1.267", + "version": "1.1.301", "license": "MIT", "private": true, "files": [ @@ -16,21 +16,21 @@ }, "dependencies": { "@iarna/toml": "2.2.5", - "@yarnpkg/fslib": "2.7.0", + "@yarnpkg/fslib": "2.10.1", "@yarnpkg/libzip": "2.2.4", "chalk": "^4.1.2", "chokidar": "^3.5.3", "command-line-args": "^5.2.1", - "jsonc-parser": "^3.1.0", + "jsonc-parser": "^3.2.0", "leven": "^3.1.0", "source-map-support": "^0.5.21", "tmp": "^0.2.1", "typescript-char": "^0.0.0", - "vscode-jsonrpc": "8.0.2-next.1", - "vscode-languageserver": "8.0.2-next.4", - "vscode-languageserver-textdocument": "^1.0.5", - "vscode-languageserver-types": "3.17.2-next.2", - "vscode-uri": "^3.0.3" + "vscode-jsonrpc": "8.1.0", + "vscode-languageserver": "8.1.0", + "vscode-languageserver-textdocument": "^1.0.9", + "vscode-languageserver-types": "3.17.3", + "vscode-uri": "^3.0.7" }, "devDependencies": { "@types/command-line-args": "^5.2.0", diff --git a/packages/pyright-internal/src/analyzer/aliasDeclarationUtils.ts b/packages/pyright-internal/src/analyzer/aliasDeclarationUtils.ts deleted file mode 100644 index 64f047220..000000000 --- a/packages/pyright-internal/src/analyzer/aliasDeclarationUtils.ts +++ /dev/null @@ -1,169 +0,0 @@ -/* - * aliasDeclarationUtils.ts - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT license. - * - * Helper functions around alias declarations. - */ - -import { ImportLookup, ImportLookupResult } from './analyzerFileInfo'; -import { Declaration, DeclarationType } from './declaration'; -import { Symbol } from './symbol'; - -export interface ResolvedAliasInfo { - declaration: Declaration | undefined; - isPrivate: boolean; - privatePyTypedImported?: string; - privatePyTypedImporter?: string; -} - -// If the specified declaration is an alias declaration that points to a symbol, -// it resolves the alias and looks up the symbol, then returns the a declaration -// (typically the last) associated with that symbol. It does this recursively if -// necessary. If a symbol lookup fails, undefined is returned. If resolveLocalNames -// is true, the method resolves aliases through local renames ("as" clauses found -// in import statements). -export function resolveAliasDeclaration( - importLookup: ImportLookup, - declaration: Declaration, - resolveLocalNames: boolean, - allowExternallyHiddenAccess: boolean -): ResolvedAliasInfo | undefined { - let curDeclaration: Declaration | undefined = declaration; - const alreadyVisited: Declaration[] = []; - let isPrivate = false; - let isPrivatePyTypedImport = false; - let privatePyTypedImported: string | undefined; - let privatePyTypedImporter: string | undefined; - - while (true) { - if (curDeclaration.type !== DeclarationType.Alias || !curDeclaration.symbolName) { - return { - declaration: curDeclaration, - isPrivate, - privatePyTypedImported, - privatePyTypedImporter, - }; - } - - // If we are not supposed to follow local alias names and this - // is a local name, don't continue to follow the alias. - if (!resolveLocalNames && curDeclaration.usesLocalName) { - return { - declaration: curDeclaration, - isPrivate, - privatePyTypedImported, - privatePyTypedImporter, - }; - } - - let lookupResult: ImportLookupResult | undefined; - if (curDeclaration.path && curDeclaration.loadSymbolsFromPath) { - lookupResult = importLookup(curDeclaration.path); - } - - const symbol: Symbol | undefined = lookupResult - ? lookupResult.symbolTable.get(curDeclaration.symbolName) - : undefined; - if (!symbol) { - if (curDeclaration.submoduleFallback) { - return resolveAliasDeclaration( - importLookup, - curDeclaration.submoduleFallback, - resolveLocalNames, - allowExternallyHiddenAccess - ); - } - - // If the symbol comes from a native library, we won't - // be able to resolve its type directly. - if (curDeclaration.isNativeLib) { - return { - declaration: undefined, - isPrivate, - }; - } - - return undefined; - } - - if (symbol.isPrivateMember()) { - isPrivate = true; - } - - if (symbol.isExternallyHidden() && !allowExternallyHiddenAccess) { - return undefined; - } - - // Prefer declarations with specified types. If we don't have any of those, - // fall back on declarations with inferred types. - let declarations = symbol.getTypedDeclarations(); - - // Try not to use declarations within an except suite even if it's a typed - // declaration. These are typically used for fallback exception handling. - declarations = declarations.filter((decl) => !decl.isInExceptSuite); - - if (declarations.length === 0) { - declarations = symbol.getDeclarations(); - declarations = declarations.filter((decl) => !decl.isInExceptSuite); - } - - if (declarations.length === 0) { - // Use declarations within except clauses if there are no alternatives. - declarations = symbol.getDeclarations(); - } - - if (declarations.length === 0) { - return undefined; - } - - // Prefer the last unvisited declaration in the list. This ensures that - // we use all of the overloads if it's an overloaded function. - const unvisitedDecls = declarations.filter((decl) => !alreadyVisited.includes(decl)); - if (unvisitedDecls.length > 0) { - curDeclaration = unvisitedDecls[unvisitedDecls.length - 1]; - } else { - curDeclaration = declarations[declarations.length - 1]; - } - - if (isPrivatePyTypedImport) { - privatePyTypedImported = privatePyTypedImported ?? curDeclaration?.moduleName; - } - - if (symbol.isPrivatePyTypedImport()) { - isPrivatePyTypedImport = true; - } - - if (isPrivatePyTypedImport) { - privatePyTypedImporter = privatePyTypedImporter ?? curDeclaration?.moduleName; - } - - // Make sure we don't follow a circular list indefinitely. - if (alreadyVisited.find((decl) => decl === curDeclaration)) { - // If the path path of the alias points back to the original path, use the submodule - // fallback instead. This happens in the case where a module's __init__.py file - // imports a submodule using itself as the import target. For example, if - // the module is foo, and the foo.__init__.py file contains the statement - // "from foo import bar", we want to import the foo/bar.py submodule. - if ( - curDeclaration.path === declaration.path && - curDeclaration.type === DeclarationType.Alias && - curDeclaration.submoduleFallback - ) { - return resolveAliasDeclaration( - importLookup, - curDeclaration.submoduleFallback, - resolveLocalNames, - allowExternallyHiddenAccess - ); - } - return { - declaration, - isPrivate, - privatePyTypedImported, - privatePyTypedImporter, - }; - } - alreadyVisited.push(curDeclaration); - } -} diff --git a/packages/pyright-internal/src/analyzer/analyzerFileInfo.ts b/packages/pyright-internal/src/analyzer/analyzerFileInfo.ts index 278fe2a77..9b80fca82 100644 --- a/packages/pyright-internal/src/analyzer/analyzerFileInfo.ts +++ b/packages/pyright-internal/src/analyzer/analyzerFileInfo.ts @@ -10,6 +10,7 @@ import { DiagnosticRuleSet, ExecutionEnvironment } from '../common/configOptions'; import { TextRangeDiagnosticSink } from '../common/diagnosticSink'; +import { PythonVersion } from '../common/pythonVersion'; import { TextRange } from '../common/textRange'; import { TextRangeCollection } from '../common/textRangeCollection'; import { Scope } from './scope'; @@ -28,11 +29,12 @@ export interface ImportLookupResult { dunderAllNames: string[] | undefined; usesUnsupportedDunderAllForm: boolean; docString: string | undefined; + isInPyTypedPackage: boolean; } export interface AnalyzerFileInfo { importLookup: ImportLookup; - futureImports: Map; + futureImports: Set; builtinsScope?: Scope | undefined; diagnosticSink: TextRangeDiagnosticSink; executionEnvironment: ExecutionEnvironment; @@ -53,5 +55,20 @@ export interface AnalyzerFileInfo { } export function isAnnotationEvaluationPostponed(fileInfo: AnalyzerFileInfo) { - return fileInfo.futureImports.get('annotations') !== undefined || fileInfo.isStubFile; + if (fileInfo.isStubFile) { + return true; + } + + if (fileInfo.futureImports.has('annotations')) { + return true; + } + + // As of November 22, the Python steering council has tentatively + // approved PEP 649 for Python 3.12. + // https://discuss.python.org/t/pep-649-deferred-evaluation-of-annotations-tentatively-accepted/21331 + if (fileInfo.executionEnvironment.pythonVersion >= PythonVersion.V3_12) { + return true; + } + + return false; } diff --git a/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts b/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts index 84fe77d2d..10d2675b6 100644 --- a/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts +++ b/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts @@ -10,39 +10,38 @@ import { CancellationToken } from 'vscode-languageserver'; import { TextDocumentContentChangeEvent } from 'vscode-languageserver-textdocument'; -import { BackgroundAnalysisBase, IndexOptions } from '../backgroundAnalysisBase'; +import { BackgroundAnalysisBase, IndexOptions, RefreshOptions } from '../backgroundAnalysisBase'; import { ConfigOptions, ExecutionEnvironment } from '../common/configOptions'; import { ConsoleInterface } from '../common/console'; import { Diagnostic } from '../common/diagnostic'; import { FileDiagnostics } from '../common/diagnosticSink'; -import { LanguageServiceExtension } from '../common/extensibility'; import { Range } from '../common/textRange'; -import { IndexResults } from '../languageService/documentSymbolProvider'; import { AnalysisCompleteCallback, analyzeProgram } from './analysis'; +import { CacheManager } from './cacheManager'; import { ImportResolver } from './importResolver'; import { Indices, MaxAnalysisTime, OpenFileOptions, Program } from './program'; export class BackgroundAnalysisProgram { private _program: Program; + private _disposed = false; private _onAnalysisCompletion: AnalysisCompleteCallback | undefined; - private _indices: Indices | undefined; constructor( private _console: ConsoleInterface, private _configOptions: ConfigOptions, private _importResolver: ImportResolver, - extension?: LanguageServiceExtension, - private _backgroundAnalysis?: BackgroundAnalysisBase, + protected _backgroundAnalysis?: BackgroundAnalysisBase, private _maxAnalysisTime?: MaxAnalysisTime, - private _disableChecker?: boolean + private _disableChecker?: boolean, + cacheManager?: CacheManager ) { this._program = new Program( this._importResolver, this._configOptions, this._console, - extension, undefined, - this._disableChecker + this._disableChecker, + cacheManager ); } @@ -66,6 +65,10 @@ export class BackgroundAnalysisProgram { return this._backgroundAnalysis; } + hasSourceFile(filePath: string): boolean { + return !!this._program.getSourceFile(filePath); + } + setConfigOptions(configOptions: ConfigOptions) { this._configOptions = configOptions; this._backgroundAnalysis?.setConfigOptions(configOptions); @@ -116,12 +119,17 @@ export class BackgroundAnalysisProgram { this.markFilesDirty([path], /* evenIfContentsAreSame */ true); } - setFileClosed(filePath: string) { - this._backgroundAnalysis?.setFileClosed(filePath); - const diagnostics = this._program.setFileClosed(filePath); + setFileClosed(filePath: string, isTracked?: boolean) { + this._backgroundAnalysis?.setFileClosed(filePath, isTracked); + const diagnostics = this._program.setFileClosed(filePath, isTracked); this._reportDiagnosticsForRemovedFiles(diagnostics); } + addInterimFile(filePath: string) { + this._backgroundAnalysis?.addInterimFile(filePath); + this._program.addInterimFile(filePath); + } + markAllFilesDirty(evenIfContentsAreSame: boolean, indexingNeeded = true) { this._backgroundAnalysis?.markAllFilesDirty(evenIfContentsAreSame, indexingNeeded); this._program.markAllFilesDirty(evenIfContentsAreSame, indexingNeeded); @@ -139,7 +147,7 @@ export class BackgroundAnalysisProgram { startAnalysis(token: CancellationToken): boolean { if (this._backgroundAnalysis) { - this._backgroundAnalysis.startAnalysis(this._indices, token); + this._backgroundAnalysis.startAnalysis(this._getIndices(), token); return false; } @@ -153,47 +161,29 @@ export class BackgroundAnalysisProgram { ); } - test_setIndexing( - workspaceIndices: Map, - libraryIndices: Map> - ) { - const indices = this._getIndices(); - for (const [filePath, indexResults] of workspaceIndices) { - indices.setWorkspaceIndex(filePath, indexResults); - } - - for (const [execEnvRoot, map] of libraryIndices) { - for (const [libraryPath, indexResults] of map) { - indices.setIndex(execEnvRoot, libraryPath, indexResults); - } - } + analyzeFile(filePath: string, token: CancellationToken): boolean { + return this._program.analyzeFile(filePath, token); } startIndexing(indexOptions: IndexOptions) { - this._backgroundAnalysis?.startIndexing( - indexOptions, - this._configOptions, - this.importResolver, - this.host.kind, - this._getIndices() - ); + this._backgroundAnalysis?.startIndexing(indexOptions, this._configOptions, this.importResolver, this.host.kind); } - refreshIndexing() { + refreshIndexing(refreshOptions?: RefreshOptions) { this._backgroundAnalysis?.refreshIndexing( this._configOptions, this.importResolver, this.host.kind, - this._indices + refreshOptions ); } cancelIndexing() { - this._backgroundAnalysis?.cancelIndexing(this._configOptions); + this._backgroundAnalysis?.cancelIndexing(); } getIndexing(filePath: string) { - return this._indices?.getIndex(this._configOptions.findExecEnvironment(filePath).root); + return this._getIndices()?.getIndex(this._configOptions.findExecEnvironment(filePath).root); } async getDiagnosticsForRange(filePath: string, range: Range, token: CancellationToken): Promise { @@ -225,9 +215,13 @@ export class BackgroundAnalysisProgram { return this._program.writeTypeStub(targetImportPath, targetIsSingleFile, stubPath, token); } - invalidateAndForceReanalysis(rebuildUserFileIndexing: boolean, rebuildLibraryIndexing: boolean) { + invalidateAndForceReanalysis( + rebuildUserFileIndexing: boolean, + rebuildLibraryIndexing: boolean, + refreshOptions?: RefreshOptions + ) { if (rebuildLibraryIndexing) { - this.refreshIndexing(); + this.refreshIndexing(refreshOptions); } this._backgroundAnalysis?.invalidateAndForceReanalysis(rebuildUserFileIndexing); @@ -244,47 +238,17 @@ export class BackgroundAnalysisProgram { this._backgroundAnalysis?.restart(); } + dispose() { + this._disposed = true; + this._program.dispose(); + this._backgroundAnalysis?.shutdown(); + } + private _ensurePartialStubPackages(execEnv: ExecutionEnvironment) { this._backgroundAnalysis?.ensurePartialStubPackages(execEnv.root); return this._importResolver.ensurePartialStubPackages(execEnv); } - private _getIndices(): Indices { - if (!this._indices) { - const program = this._program; - - // The map holds onto index results of library files per execution root. - // The map will be refreshed together when library files are re-scanned. - // It can't be cached by sourceFile since some of library files won't have - // corresponding sourceFile created. - const map = new Map>(); - this._indices = { - setWorkspaceIndex(path: string, indexResults: IndexResults): void { - // Index result of workspace file will be cached by each sourceFile - // and it will go away when the source file goes away. - program.getSourceFile(path)?.cacheIndexResults(indexResults); - }, - getIndex(execEnv: string | undefined): Map | undefined { - return map.get(execEnv); - }, - setIndex(execEnv: string | undefined, path: string, indexResults: IndexResults): void { - let indicesMap = map.get(execEnv); - if (!indicesMap) { - indicesMap = new Map(); - map.set(execEnv, indicesMap); - } - - indicesMap.set(path, indexResults); - }, - reset(): void { - map.clear(); - }, - }; - } - - return this._indices!; - } - private _reportDiagnosticsForRemovedFiles(fileDiags: FileDiagnostics[]) { if (fileDiags.length > 0) { // If analysis is running in the foreground process, report any @@ -303,13 +267,18 @@ export class BackgroundAnalysisProgram { } } } + + protected _getIndices(): Indices | undefined { + return undefined; + } } export type BackgroundAnalysisProgramFactory = ( + serviceId: string, console: ConsoleInterface, configOptions: ConfigOptions, importResolver: ImportResolver, - extension?: LanguageServiceExtension, backgroundAnalysis?: BackgroundAnalysisBase, - maxAnalysisTime?: MaxAnalysisTime + maxAnalysisTime?: MaxAnalysisTime, + cacheManager?: CacheManager ) => BackgroundAnalysisProgram; diff --git a/packages/pyright-internal/src/analyzer/binder.ts b/packages/pyright-internal/src/analyzer/binder.ts index 4537cf5e7..b6a5bdd34 100644 --- a/packages/pyright-internal/src/analyzer/binder.ts +++ b/packages/pyright-internal/src/analyzer/binder.ts @@ -23,7 +23,7 @@ import { assert, assertNever, fail } from '../common/debug'; import { CreateTypeStubFileAction, Diagnostic } from '../common/diagnostic'; import { DiagnosticRule } from '../common/diagnosticRules'; import { getFileName, stripFileExtension } from '../common/pathUtils'; -import { convertOffsetsToRange } from '../common/positionUtils'; +import { convertTextRangeToRange } from '../common/positionUtils'; import { getEmptyRange } from '../common/textRange'; import { TextRange } from '../common/textRange'; import { Localizer } from '../localization/localize'; @@ -81,7 +81,7 @@ import { YieldNode, } from '../parser/parseNodes'; import { KeywordType, OperatorType } from '../parser/tokenizerTypes'; -import { AnalyzerFileInfo, ImportLookupResult, isAnnotationEvaluationPostponed } from './analyzerFileInfo'; +import { AnalyzerFileInfo, ImportLookupResult } from './analyzerFileInfo'; import * as AnalyzerNodeInfo from './analyzerNodeInfo'; import { CodeFlowReferenceExpressionNode, @@ -102,6 +102,7 @@ import { FlowWildcardImport, getUniqueFlowNodeId, isCodeFlowSupportedForReference, + wildcardImportReferenceKey, } from './codeFlowTypes'; import { AliasDeclaration, @@ -113,8 +114,10 @@ import { ParameterDeclaration, TypeAliasDeclaration, TypeParameterDeclaration, + UnresolvedModuleMarker, VariableDeclaration, } from './declaration'; +import { extractParameterDocumentation } from './docStringUtils'; import { ImplicitImport, ImportResult, ImportType } from './importResult'; import * as ParseTreeUtils from './parseTreeUtils'; import { ParseTreeWalker } from './parseTreeWalker'; @@ -151,7 +154,7 @@ interface ClassVarInfo { // amount to the complexity factor. Without this, the complexity // calculation fails to take into account large numbers of non-cyclical // flow nodes. This number is somewhat arbitrary and is tuned empirically. -const flowNodeComplexityFactor = 0.05; +const flowNodeComplexityContribution = 0.05; export class Binder extends ParseTreeWalker { private readonly _fileInfo: AnalyzerFileInfo; @@ -268,7 +271,6 @@ export class Binder extends ParseTreeWalker { // Bind implicit names. // List taken from https://docs.python.org/3/reference/import.html#__name__ - this._addImplicitSymbolToCurrentScope('__doc__', node, 'str | None'); this._addImplicitSymbolToCurrentScope('__name__', node, 'str'); this._addImplicitSymbolToCurrentScope('__qualname__', node, 'str'); this._addImplicitSymbolToCurrentScope('__loader__', node, 'Any'); @@ -281,6 +283,11 @@ export class Binder extends ParseTreeWalker { this._addImplicitSymbolToCurrentScope('__annotations__', node, 'Dict[str, Any]'); this._addImplicitSymbolToCurrentScope('__builtins__', node, 'Any'); + // If there is a static docstring provided in the module, assume + // that the type of `__doc__` is `str` rather than `str | None`. + const moduleDocString = ParseTreeUtils.getDocString(node.statements); + this._addImplicitSymbolToCurrentScope('__doc__', node, moduleDocString ? 'str' : 'str | None'); + // Create a start node for the module. this._currentFlowNode = this._createStartFlowNode(); @@ -364,7 +371,7 @@ export class Binder extends ParseTreeWalker { return true; } - // Source found, but type stub is missing + // A source file was found, but the type stub was missing. if ( !importResult.isStubFile && importResult.importType === ImportType.ThirdParty && @@ -396,7 +403,7 @@ export class Binder extends ParseTreeWalker { type: DeclarationType.Class, node, path: this._fileInfo.filePath, - range: convertOffsetsToRange(node.name.start, TextRange.getEnd(node.name), this._fileInfo.lines), + range: convertTextRangeToRange(node.name, this._fileInfo.lines), moduleName: this._fileInfo.moduleName, isInExceptSuite: this._isInExceptSuite, }; @@ -454,7 +461,7 @@ export class Binder extends ParseTreeWalker { isMethod: !!containingClassNode, isGenerator: false, path: this._fileInfo.filePath, - range: convertOffsetsToRange(node.name.start, TextRange.getEnd(node.name), this._fileInfo.lines), + range: convertTextRangeToRange(node.name, this._fileInfo.lines), moduleName: this._fileInfo.moduleName, isInExceptSuite: this._isInExceptSuite, }; @@ -516,18 +523,22 @@ export class Binder extends ParseTreeWalker { node.parameters.forEach((paramNode) => { if (paramNode.name) { const symbol = this._bindNameToScope(this._currentScope, paramNode.name); + + // Extract the parameter docString from the function docString + let docString = ParseTreeUtils.getDocString(node?.suite?.statements ?? []); + if (docString !== undefined) { + docString = extractParameterDocumentation(docString, paramNode.name.value); + } + if (symbol) { const paramDeclaration: ParameterDeclaration = { type: DeclarationType.Parameter, node: paramNode, path: this._fileInfo.filePath, - range: convertOffsetsToRange( - paramNode.start, - TextRange.getEnd(paramNode), - this._fileInfo.lines - ), + range: convertTextRangeToRange(paramNode, this._fileInfo.lines), moduleName: this._fileInfo.moduleName, isInExceptSuite: this._isInExceptSuite, + docString: docString, }; symbol.addDeclaration(paramDeclaration); @@ -598,11 +609,7 @@ export class Binder extends ParseTreeWalker { type: DeclarationType.Parameter, node: paramNode, path: this._fileInfo.filePath, - range: convertOffsetsToRange( - paramNode.start, - TextRange.getEnd(paramNode), - this._fileInfo.lines - ), + range: convertTextRangeToRange(paramNode, this._fileInfo.lines), moduleName: this._fileInfo.moduleName, isInExceptSuite: this._isInExceptSuite, }; @@ -746,7 +753,7 @@ export class Binder extends ParseTreeWalker { type: DeclarationType.TypeParameter, node: param, path: this._fileInfo.filePath, - range: convertOffsetsToRange(node.start, TextRange.getEnd(node), this._fileInfo.lines), + range: convertTextRangeToRange(node, this._fileInfo.lines), moduleName: this._fileInfo.moduleName, isInExceptSuite: this._isInExceptSuite, }; @@ -765,6 +772,12 @@ export class Binder extends ParseTreeWalker { } }); + node.parameters.forEach((param) => { + if (param.defaultExpression) { + this.walk(param.defaultExpression); + } + }); + return false; } @@ -781,7 +794,7 @@ export class Binder extends ParseTreeWalker { type: DeclarationType.TypeAlias, node, path: this._fileInfo.filePath, - range: convertOffsetsToRange(node.name.start, TextRange.getEnd(node.name), this._fileInfo.lines), + range: convertTextRangeToRange(node.name, this._fileInfo.lines), moduleName: this._fileInfo.moduleName, isInExceptSuite: this._isInExceptSuite, }; @@ -817,18 +830,13 @@ export class Binder extends ParseTreeWalker { this._addTypeDeclarationForVariable(node.leftExpression, node.typeAnnotationComment); } - // If there is a type annotation associated with the assignment and annotation evaluations are - // not deferred, the Python interpreter creates an entry in the local symbol table (presumably - // to store the __annotation__ attribute) before it evaluates the RHS of the assignment. This - // can affect the evaluation of the RHS if the name of the symbol is the same as a name that - // is defined in an outer scope. - let createdAssignmentTargetFlowNodes = false; - if ( - node.leftExpression.nodeType === ParseNodeType.TypeAnnotation && - !isAnnotationEvaluationPostponed(this._fileInfo) - ) { - this._createAssignmentTargetFlowNodes(node.leftExpression, /* walkTargets */ true, /* unbound */ false); - createdAssignmentTargetFlowNodes = true; + if (node.chainedTypeAnnotationComment) { + this._addDiagnostic( + this._fileInfo.diagnosticRuleSet.reportGeneralTypeIssues, + DiagnosticRule.reportGeneralTypeIssues, + Localizer.Diagnostic.annotationNotSupported(), + node.chainedTypeAnnotationComment + ); } // If the assignment target base expression is potentially a @@ -869,9 +877,7 @@ export class Binder extends ParseTreeWalker { this._addInferredTypeAssignmentForVariable(node.leftExpression, node.rightExpression, isPossibleTypeAlias); // If we didn't create assignment target flow nodes above, do so now. - if (!createdAssignmentTargetFlowNodes) { - this._createAssignmentTargetFlowNodes(node.leftExpression, /* walkTargets */ true, /* unbound */ false); - } + this._createAssignmentTargetFlowNodes(node.leftExpression, /* walkTargets */ true, /* unbound */ false); // Is this an assignment to dunder all? if (this._currentScope.type === ScopeType.Module) { @@ -1100,14 +1106,25 @@ export class Binder extends ParseTreeWalker { return false; } - // Walk the type annotation first so it is "before" the target - // in the code flow graph. - this.walk(node.typeAnnotation); + // If this is an annotated variable assignment within a class body, + // we need to evaluate the type annotation first. + const bindVariableBeforeAnnotationEvaluation = + node.parent?.nodeType === ParseNodeType.Assignment && + ParseTreeUtils.getEnclosingClass(node, /* stopAtFunction */ true) !== undefined; + + if (!bindVariableBeforeAnnotationEvaluation) { + this.walk(node.typeAnnotation); + } + this._createVariableAnnotationFlowNode(); this._bindPossibleTupleNamedTarget(node.valueExpression); this._addTypeDeclarationForVariable(node.valueExpression, node.typeAnnotation); + if (bindVariableBeforeAnnotationEvaluation) { + this.walk(node.typeAnnotation); + } + // For type annotations that are not part of assignments (e.g. simple variable // annotations), we need to populate the reference map. Otherwise the type // analyzer's code flow engine won't run and detect cases where the variable @@ -1121,6 +1138,7 @@ export class Binder extends ParseTreeWalker { } this.walk(node.valueExpression); + return false; } @@ -1159,7 +1177,9 @@ export class Binder extends ParseTreeWalker { this._currentFlowNode = this._finishFlowLabel(postForLabel); - if (node.asyncToken) { + // Async for is not allowed outside of an async function + // unless we're in ipython mode. + if (node.asyncToken && !this._fileInfo.ipythonMode) { const enclosingFunction = ParseTreeUtils.getEnclosingFunction(node); if (!enclosingFunction || !enclosingFunction.isAsync) { this._addError(Localizer.Diagnostic.asyncNotInAsyncFunction(), node.asyncToken); @@ -1366,7 +1386,7 @@ export class Binder extends ParseTreeWalker { isConstant: isConstantName(node.name.value), inferredTypeSource: node, path: this._fileInfo.filePath, - range: convertOffsetsToRange(node.name.start, TextRange.getEnd(node.name), this._fileInfo.lines), + range: convertTextRangeToRange(node.name, this._fileInfo.lines), moduleName: this._fileInfo.moduleName, isInExceptSuite: this._isInExceptSuite, }; @@ -1686,7 +1706,7 @@ export class Binder extends ParseTreeWalker { } override visitImportFrom(node: ImportFromNode): boolean { - const typingSymbolsOfInterest = ['Final', 'TypeAlias', 'ClassVar', 'Required', 'NotRequired', 'Annotated']; + const typingSymbolsOfInterest = ['Final', 'ClassVar', 'Annotated']; const dataclassesSymbolsOfInterest = ['InitVar']; const importInfo = AnalyzerNodeInfo.getImportInfo(node.module); @@ -1727,6 +1747,10 @@ export class Binder extends ParseTreeWalker { if (importInfo) { const names: string[] = []; + // Note that this scope uses a wildcard import, so we cannot shortcut + // any code flow checks. All expressions are potentially in play. + this._currentScopeCodeFlowExpressions?.add(wildcardImportReferenceKey); + const lookupInfo = this._fileInfo.importLookup(resolvedPath); if (lookupInfo) { const wildcardNames = this._getWildcardImportNames(lookupInfo); @@ -1757,7 +1781,7 @@ export class Binder extends ParseTreeWalker { node, path: resolvedPath, loadSymbolsFromPath: true, - range: getEmptyRange(), + range: getEmptyRange(), // Range is unknown for wildcard name import. usesLocalName: false, symbolName: name, moduleName: this._fileInfo.moduleName, @@ -1799,6 +1823,7 @@ export class Binder extends ParseTreeWalker { }; localSymbol.addDeclaration(aliasDecl); + names.push(name); } } } @@ -1828,6 +1853,7 @@ export class Binder extends ParseTreeWalker { node.imports.forEach((importSymbolNode) => { const importedName = importSymbolNode.name.value; const nameNode = importSymbolNode.alias || importSymbolNode.name; + const symbol = this._bindNameToScope(this._currentScope, nameNode); if (symbol) { @@ -1893,7 +1919,7 @@ export class Binder extends ParseTreeWalker { usesLocalName: !!importSymbolNode.alias, symbolName: importedName, submoduleFallback, - range: getEmptyRange(), + range: convertTextRangeToRange(nameNode, this._fileInfo.lines), moduleName: this._fileInfo.moduleName, isInExceptSuite: this._isInExceptSuite, isNativeLib: importInfo?.isNativeLib, @@ -1988,7 +2014,8 @@ export class Binder extends ParseTreeWalker { this._addExceptTargets(this._currentFlowNode!); } - if (node.asyncToken) { + if (node.asyncToken && !this._fileInfo.ipythonMode) { + // Top level async with is allowed in ipython mode. const enclosingFunction = ParseTreeUtils.getEnclosingFunction(node); if (!enclosingFunction || !enclosingFunction.isAsync) { this._addError(Localizer.Diagnostic.asyncNotInAsyncFunction(), node.asyncToken); @@ -2095,8 +2122,9 @@ export class Binder extends ParseTreeWalker { this._bindPossibleTupleNamedTarget(compr.targetExpression, addedSymbols); this._addInferredTypeAssignmentForVariable(compr.targetExpression, compr); - // Async for is not allowed outside of an async function. - if (compr.asyncToken) { + // Async for is not allowed outside of an async function + // unless we're in ipython mode. + if (compr.asyncToken && !this._fileInfo.ipythonMode) { if (!enclosingFunction || !enclosingFunction.isAsync) { // Allow if it's within a generator expression. Execution of // generator expressions is deferred and therefore can be @@ -2233,11 +2261,7 @@ export class Binder extends ParseTreeWalker { isConstant: isConstantName(node.target.value), inferredTypeSource: node, path: this._fileInfo.filePath, - range: convertOffsetsToRange( - node.target.start, - TextRange.getEnd(node.target), - this._fileInfo.lines - ), + range: convertTextRangeToRange(node.target, this._fileInfo.lines), moduleName: this._fileInfo.moduleName, isInExceptSuite: this._isInExceptSuite, }; @@ -2317,11 +2341,7 @@ export class Binder extends ParseTreeWalker { isConstant: isConstantName(slotName), isDefinedBySlots: true, path: this._fileInfo.filePath, - range: convertOffsetsToRange( - slotNameNode.start, - slotNameNode.start + slotNameNode.length, - this._fileInfo.lines - ), + range: convertTextRangeToRange(slotNameNode, this._fileInfo.lines), moduleName: this._fileInfo.moduleName, isInExceptSuite: this._isInExceptSuite, }; @@ -2370,7 +2390,7 @@ export class Binder extends ParseTreeWalker { isConstant: isConstantName(target.value), inferredTypeSource: target.parent, path: this._fileInfo.filePath, - range: convertOffsetsToRange(target.start, TextRange.getEnd(target), this._fileInfo.lines), + range: convertTextRangeToRange(target, this._fileInfo.lines), moduleName: this._fileInfo.moduleName, isInExceptSuite: this._isInExceptSuite, }; @@ -2453,7 +2473,7 @@ export class Binder extends ParseTreeWalker { if (importInfo && importInfo.isImportFound && !importInfo.isNativeLib && importInfo.resolvedPaths.length > 0) { pathOfLastSubmodule = importInfo.resolvedPaths[importInfo.resolvedPaths.length - 1]; } else { - pathOfLastSubmodule = '*** unresolved ***'; + pathOfLastSubmodule = UnresolvedModuleMarker; } const isResolved = @@ -2469,7 +2489,7 @@ export class Binder extends ParseTreeWalker { loadSymbolsFromPath: false, range: getEmptyRange(), usesLocalName: !!importAlias, - moduleName: importInfo.importName, + moduleName: firstNamePartValue, firstNamePart: firstNamePartValue, isInExceptSuite: this._isInExceptSuite, }; @@ -2491,6 +2511,15 @@ export class Binder extends ParseTreeWalker { }; } + // See if there is import info for this part of the path. This allows us + // to implicitly import all of the modules in a multi-part module name. + const implicitImportInfo = AnalyzerNodeInfo.getImportInfo(node.module.nameParts[0]); + if (implicitImportInfo && implicitImportInfo.resolvedPaths.length) { + newDecl.path = implicitImportInfo.resolvedPaths[0]; + newDecl.loadSymbolsFromPath = true; + this._addImplicitImportsToLoaderActions(implicitImportInfo, newDecl); + } + // Add the implicit imports for this module if it's the last // name part we're resolving. if (importAlias || node.module.nameParts.length === 1) { @@ -2516,7 +2545,7 @@ export class Binder extends ParseTreeWalker { const loaderActionPath = importInfo && i < importInfo.resolvedPaths.length ? importInfo.resolvedPaths[i] - : '*** unresolved ***'; + : UnresolvedModuleMarker; // Allocate a new loader action. loaderActions = { @@ -2531,14 +2560,25 @@ export class Binder extends ParseTreeWalker { curLoaderActions.implicitImports.set(namePartValue, loaderActions); } - // If this is the last name part we're resolving, add in the - // implicit imports as well. if (i === node.module.nameParts.length - 1) { + // If this is the last name part we're resolving, add in the + // implicit imports as well. if (importInfo && i < importInfo.resolvedPaths.length) { loaderActions.path = importInfo.resolvedPaths[i]; loaderActions.loadSymbolsFromPath = true; this._addImplicitImportsToLoaderActions(importInfo, loaderActions); } + } else { + // If this isn't the last name part we're resolving, see if there + // is import info for this part of the path. This allows us to implicitly + // import all of the modules in a multi-part module name (e.g. "import a.b.c" + // imports "a" and "a.b" and "a.b.c"). + const implicitImportInfo = AnalyzerNodeInfo.getImportInfo(node.module.nameParts[i]); + if (implicitImportInfo && implicitImportInfo.resolvedPaths.length) { + loaderActions.path = implicitImportInfo.resolvedPaths[i]; + loaderActions.loadSymbolsFromPath = true; + this._addImplicitImportsToLoaderActions(implicitImportInfo, loaderActions); + } } curLoaderActions = loaderActions; @@ -2803,7 +2843,15 @@ export class Binder extends ParseTreeWalker { } const expressionList: CodeFlowReferenceExpressionNode[] = []; - if (!this._isNarrowingExpression(expression, expressionList)) { + if ( + !this._isNarrowingExpression( + expression, + expressionList, + /* filterForNeverNarrowing */ (flags & + (FlowFlags.TrueNeverCondition | FlowFlags.FalseNeverCondition)) !== + 0 + ) + ) { return antecedent; } @@ -2878,6 +2926,31 @@ export class Binder extends ParseTreeWalker { if (isCodeFlowSupportedForReference(expression)) { expressionList.push(expression); + + if (!filterForNeverNarrowing) { + // If the expression is a member access expression, add its + // leftExpression to the expression list because that expression + // can be narrowed based on the attribute type. + if (expression.nodeType === ParseNodeType.MemberAccess) { + if (isCodeFlowSupportedForReference(expression.leftExpression)) { + expressionList.push(expression.leftExpression); + } + } + + // If the expression is an index expression with a supported + // subscript, add its baseExpression to the expression list because + // that expression can be narrowed. + if ( + expression.nodeType === ParseNodeType.Index && + expression.items.length === 1 && + !expression.trailingComma && + expression.items[0].argumentCategory === ArgumentCategory.Simple + ) { + if (isCodeFlowSupportedForReference(expression.baseExpression)) { + expressionList.push(expression.baseExpression); + } + } + } return true; } @@ -2941,20 +3014,8 @@ export class Binder extends ParseTreeWalker { ); // Look for "X is Y" or "X is not Y". - if (isOrIsNotOperator) { - return isLeftNarrowing; - } - - // Look for X == , X != or == X, != X - if (equalsOrNotEqualsOperator) { - const isRightNarrowing = this._isNarrowingExpression( - expression.rightExpression, - expressionList, - filterForNeverNarrowing, - /* isComplexExpression */ true - ); - return isLeftNarrowing || isRightNarrowing; - } + // Look for X == or X != + return isLeftNarrowing; } // Look for " in Y" or " not in Y". @@ -3271,11 +3332,6 @@ export class Binder extends ParseTreeWalker { } private _bindNameToScope(scope: Scope, node: NameNode, addedSymbols?: Map) { - // Is this name already used by an active type parameter? - if (this._activeTypeParams.get(node.value)) { - this._addError(Localizer.Diagnostic.overwriteTypeParameter().format({ name: node.value }), node); - } - return this._bindNameValueToScope(scope, node.value, addedSymbols); } @@ -3447,7 +3503,7 @@ export class Binder extends ParseTreeWalker { isInferenceAllowedInPyTyped: this._isInferenceAllowedInPyTyped(name.value), typeAliasName: isPossibleTypeAlias ? target : undefined, path: this._fileInfo.filePath, - range: convertOffsetsToRange(name.start, TextRange.getEnd(name), this._fileInfo.lines), + range: convertTextRangeToRange(name, this._fileInfo.lines), moduleName: this._fileInfo.moduleName, isInExceptSuite: this._isInExceptSuite, docString: this._getVariableDocString(target), @@ -3495,11 +3551,7 @@ export class Binder extends ParseTreeWalker { inferredTypeSource: source, isDefinedByMemberAccess: true, path: this._fileInfo.filePath, - range: convertOffsetsToRange( - target.memberName.start, - target.memberName.start + target.memberName.length, - this._fileInfo.lines - ), + range: convertTextRangeToRange(target.memberName, this._fileInfo.lines), moduleName: this._fileInfo.moduleName, isInExceptSuite: this._isInExceptSuite, docString: this._getVariableDocString(target), @@ -3549,24 +3601,9 @@ export class Binder extends ParseTreeWalker { const symbolWithScope = this._currentScope.lookUpSymbolRecursive(name.value); if (symbolWithScope && symbolWithScope.symbol) { const finalInfo = this._isAnnotationFinal(typeAnnotation); - const isExplicitTypeAlias = this._isAnnotationTypeAlias(typeAnnotation); let typeAnnotationNode: ExpressionNode | undefined = typeAnnotation; - let innerTypeAnnotationNode: ExpressionNode | undefined = typeAnnotation; - if (isExplicitTypeAlias) { - typeAnnotationNode = undefined; - innerTypeAnnotationNode = undefined; - - // Type aliases are allowed only in the global or class scope. - if ( - this._currentScope.type !== ScopeType.Class && - this._currentScope.type !== ScopeType.Module && - this._currentScope.type !== ScopeType.Builtin - ) { - this._addError(Localizer.Diagnostic.typeAliasNotInModuleOrClass(), typeAnnotation); - } - } else if (finalInfo.isFinal) { - innerTypeAnnotationNode = finalInfo.finalTypeNode; + if (finalInfo.isFinal) { if (!finalInfo.finalTypeNode) { typeAnnotationNode = undefined; } @@ -3576,8 +3613,6 @@ export class Binder extends ParseTreeWalker { let classVarInfo = this._isAnnotationClassVar(typeAnnotation); if (classVarInfo.isClassVar) { - innerTypeAnnotationNode = classVarInfo.classVarTypeNode; - if (!classVarInfo.classVarTypeNode) { typeAnnotationNode = undefined; } @@ -3606,14 +3641,10 @@ export class Binder extends ParseTreeWalker { node: target, isConstant: isConstantName(name.value), isFinal: finalInfo.isFinal, - isClassVar: classVarInfo.isClassVar, - isRequired: this._isRequiredAnnotation(innerTypeAnnotationNode), - isNotRequired: this._isNotRequiredAnnotation(innerTypeAnnotationNode), - typeAliasAnnotation: isExplicitTypeAlias ? typeAnnotation : undefined, - typeAliasName: isExplicitTypeAlias ? target : undefined, + typeAliasName: target, path: this._fileInfo.filePath, typeAnnotationNode, - range: convertOffsetsToRange(name.start, TextRange.getEnd(name), this._fileInfo.lines), + range: convertTextRangeToRange(name, this._fileInfo.lines), moduleName: this._fileInfo.moduleName, isInExceptSuite: this._isInExceptSuite, docString: this._getVariableDocString(target), @@ -3686,11 +3717,7 @@ export class Binder extends ParseTreeWalker { isFinal: finalInfo.isFinal, path: this._fileInfo.filePath, typeAnnotationNode: finalInfo.isFinal && !finalInfo.finalTypeNode ? undefined : typeAnnotation, - range: convertOffsetsToRange( - target.memberName.start, - target.memberName.start + target.memberName.length, - this._fileInfo.lines - ), + range: convertTextRangeToRange(target.memberName, this._fileInfo.lines), moduleName: this._fileInfo.moduleName, isInExceptSuite: this._isInExceptSuite, docString: this._getVariableDocString(target), @@ -3736,17 +3763,24 @@ export class Binder extends ParseTreeWalker { importAliases: string[], symbolAliases: Map ) { - if (typeAnnotation.nodeType === ParseNodeType.Name) { - const alias = symbolAliases.get(typeAnnotation.value); + let annotationNode = typeAnnotation; + + // Is this a quoted annotation? + if (annotationNode.nodeType === ParseNodeType.StringList && annotationNode.typeAnnotation) { + annotationNode = annotationNode.typeAnnotation; + } + + if (annotationNode.nodeType === ParseNodeType.Name) { + const alias = symbolAliases.get(annotationNode.value); if (alias === name) { return true; } - } else if (typeAnnotation.nodeType === ParseNodeType.MemberAccess) { + } else if (annotationNode.nodeType === ParseNodeType.MemberAccess) { if ( - typeAnnotation.leftExpression.nodeType === ParseNodeType.Name && - typeAnnotation.memberName.value === name + annotationNode.leftExpression.nodeType === ParseNodeType.Name && + annotationNode.memberName.value === name ) { - const baseName = typeAnnotation.leftExpression.value; + const baseName = annotationNode.leftExpression.value; return importAliases.some((alias) => alias === baseName); } } @@ -3755,87 +3789,13 @@ export class Binder extends ParseTreeWalker { } private _getVariableDocString(node: ExpressionNode): string | undefined { - // Walk up the parse tree to find an assignment expression. - let curNode: ParseNode | undefined = node; - let annotationNode: TypeAnnotationNode | undefined; - - while (curNode) { - if (curNode.nodeType === ParseNodeType.Assignment) { - break; - } - - if (curNode.nodeType === ParseNodeType.TypeAnnotation && !annotationNode) { - annotationNode = curNode; - } - - curNode = curNode.parent; - } - - if (curNode?.nodeType !== ParseNodeType.Assignment) { - // Allow a simple annotation statement to have a docstring even - // though PEP 258 doesn't mention this case. This PEP pre-dated - // PEP 526, so it didn't contemplate this situation. - if (annotationNode) { - curNode = annotationNode; - } else { - return undefined; - } - } - - const parentNode = curNode.parent; - if (parentNode?.nodeType !== ParseNodeType.StatementList) { - return undefined; - } - - const suiteOrModule = parentNode.parent; - if ( - !suiteOrModule || - (suiteOrModule.nodeType !== ParseNodeType.Module && suiteOrModule.nodeType !== ParseNodeType.Suite) - ) { - return undefined; - } - - const assignmentIndex = suiteOrModule.statements.findIndex((node) => node === parentNode); - if (assignmentIndex < 0 || assignmentIndex === suiteOrModule.statements.length - 1) { - return undefined; - } - - const nextStatement = suiteOrModule.statements[assignmentIndex + 1]; - - if (nextStatement.nodeType !== ParseNodeType.StatementList || !ParseTreeUtils.isDocString(nextStatement)) { - return undefined; - } - - // See if the assignment is within one of the contexts specified in PEP 258. - let isValidContext = false; - if (parentNode?.parent?.nodeType === ParseNodeType.Module) { - // If we're at the top level of a module, the attribute docstring is valid. - isValidContext = true; - } else if ( - parentNode?.parent?.nodeType === ParseNodeType.Suite && - parentNode?.parent?.parent?.nodeType === ParseNodeType.Class - ) { - // If we're at the top level of a class, the attribute docstring is valid. - isValidContext = true; - } else { - const func = ParseTreeUtils.getEnclosingFunction(parentNode); - - // If we're within an __init__ method, the attribute docstring is valid. - if ( - func && - func.name.value === '__init__' && - ParseTreeUtils.getEnclosingClass(func, /* stopAtFunction */ true) - ) { - isValidContext = true; - } - } - - if (!isValidContext) { + const docNode = ParseTreeUtils.getVariableDocStringNode(node); + if (!docNode) { return undefined; } // A docstring can consist of multiple joined strings in a single expression. - const strings = (nextStatement.statements[0] as StringListNode).strings; + const strings = docNode.strings; if (strings.length === 1) { // Common case. return strings[0].value; @@ -3880,6 +3840,11 @@ export class Binder extends ParseTreeWalker { let classVarTypeNode: ExpressionNode | undefined; while (typeAnnotation) { + // Is this a quoted annotation? + if (typeAnnotation.nodeType === ParseNodeType.StringList && typeAnnotation.typeAnnotation) { + typeAnnotation = typeAnnotation.typeAnnotation; + } + if ( typeAnnotation.nodeType === ParseNodeType.Index && typeAnnotation.items.length > 0 && @@ -3932,14 +3897,6 @@ export class Binder extends ParseTreeWalker { return false; } - private _isAnnotationTypeAlias(typeAnnotation: ExpressionNode | undefined) { - if (!typeAnnotation) { - return false; - } - - return this._isTypingAnnotation(typeAnnotation, 'TypeAlias'); - } - // Determines whether a member access expression is referring to a // member of a class (either a class or instance member). This will // typically take the form "self.x" or "cls.x". @@ -4066,29 +4023,29 @@ export class Binder extends ParseTreeWalker { } const assignedNameNode = annotationNode.valueExpression; - const specialTypes: Map = new Map([ - ['Tuple', true], - ['Generic', true], - ['Protocol', true], - ['Callable', true], - ['Type', true], - ['ClassVar', true], - ['Final', true], - ['Literal', true], - ['TypedDict', true], - ['Union', true], - ['Optional', true], - ['Annotated', true], - ['TypeAlias', true], - ['OrderedDict', true], - ['Concatenate', true], - ['TypeGuard', true], - ['StrictTypeGuard', true], - ['Unpack', true], - ['Self', true], - ['NoReturn', true], - ['Never', true], - ['LiteralString', true], + const specialTypes: Set = new Set([ + 'Tuple', + 'Generic', + 'Protocol', + 'Callable', + 'Type', + 'ClassVar', + 'Final', + 'Literal', + 'TypedDict', + 'Union', + 'Optional', + 'Annotated', + 'TypeAlias', + 'OrderedDict', + 'Concatenate', + 'TypeGuard', + 'StrictTypeGuard', + 'Unpack', + 'Self', + 'NoReturn', + 'Never', + 'LiteralString', ]); const assignedName = assignedNameNode.value; @@ -4103,11 +4060,7 @@ export class Binder extends ParseTreeWalker { type: DeclarationType.SpecialBuiltInClass, node: annotationNode, path: this._fileInfo.filePath, - range: convertOffsetsToRange( - annotationNode.start, - TextRange.getEnd(annotationNode), - this._fileInfo.lines - ), + range: convertTextRangeToRange(annotationNode, this._fileInfo.lines), moduleName: this._fileInfo.moduleName, isInExceptSuite: this._isInExceptSuite, }); @@ -4170,7 +4123,7 @@ export class Binder extends ParseTreeWalker { } private _getUniqueFlowNodeId() { - this._codeFlowComplexity += flowNodeComplexityFactor; + this._codeFlowComplexity += flowNodeComplexityContribution; return getUniqueFlowNodeId(); } diff --git a/packages/pyright-internal/src/analyzer/cacheManager.ts b/packages/pyright-internal/src/analyzer/cacheManager.ts new file mode 100644 index 000000000..63e2299f8 --- /dev/null +++ b/packages/pyright-internal/src/analyzer/cacheManager.ts @@ -0,0 +1,102 @@ +/* + * cacheManager.ts + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT license. + * Author: Eric Traut + * + * A singleton that tracks the size of caches and empties them + * if memory usage approaches the max heap space. + */ + +import { ConsoleInterface } from '../common/console'; +import { fail } from '../common/debug'; +import { getHeapStatistics } from '../common/memUtils'; + +export interface CacheOwner { + // Returns a number between 0 and 1 that indicates how full + // the cache is. + getCacheUsage(): number; + + // Empties the cache, typically in response to a low-memory condition. + emptyCache(): void; +} + +export class CacheManager { + private _pausedCount = 0; + private readonly _cacheOwners: CacheOwner[] = []; + + registerCacheOwner(provider: CacheOwner) { + this._cacheOwners.push(provider); + } + + unregisterCacheOwner(provider: CacheOwner) { + const index = this._cacheOwners.findIndex((p) => p === provider); + if (index < 0) { + fail('Specified cache provider not found'); + } else { + this._cacheOwners.splice(index, 1); + } + } + + pauseTracking(): { dispose(): void } { + const local = this; + local._pausedCount++; + return { + dispose() { + local._pausedCount--; + }, + }; + } + + getCacheUsage() { + if (this._pausedCount > 0) { + return -1; + } + + let totalUsage = 0; + + this._cacheOwners.forEach((p) => { + totalUsage += p.getCacheUsage(); + }); + + return totalUsage; + } + + emptyCache(console?: ConsoleInterface) { + if (console) { + const heapStats = getHeapStatistics(); + + console.info( + `Emptying type cache to avoid heap overflow. Used ${this._convertToMB( + heapStats.used_heap_size + )} out of ${this._convertToMB(heapStats.heap_size_limit)}.` + ); + } + + this._cacheOwners.forEach((p) => { + p.emptyCache(); + }); + } + + // Returns a ratio of used bytes to total bytes. + getUsedHeapRatio(console?: ConsoleInterface) { + const heapStats = getHeapStatistics(); + + if (console) { + console.info( + `Heap stats: ` + + `total_heap_size=${this._convertToMB(heapStats.total_heap_size)}, ` + + `used_heap_size=${this._convertToMB(heapStats.used_heap_size)}, ` + + `total_physical_size=${this._convertToMB(heapStats.total_physical_size)}, ` + + `total_available_size=${this._convertToMB(heapStats.total_available_size)}, ` + + `heap_size_limit=${this._convertToMB(heapStats.heap_size_limit)}` + ); + } + + return heapStats.used_heap_size / heapStats.heap_size_limit; + } + + private _convertToMB(bytes: number) { + return `${Math.round(bytes / (1024 * 1024))}MB`; + } +} diff --git a/packages/pyright-internal/src/analyzer/checker.ts b/packages/pyright-internal/src/analyzer/checker.ts index 8d27696fa..076605e50 100644 --- a/packages/pyright-internal/src/analyzer/checker.ts +++ b/packages/pyright-internal/src/analyzer/checker.ts @@ -12,14 +12,17 @@ * cannot (or should not be) performed lazily. */ +import { CancellationToken } from 'vscode-languageserver'; + import { Commands } from '../commands/commands'; import { DiagnosticLevel } from '../common/configOptions'; import { assert, assertNever } from '../common/debug'; -import { Diagnostic, DiagnosticAddendum } from '../common/diagnostic'; +import { ActionKind, Diagnostic, DiagnosticAddendum, RenameShadowedFileAction } from '../common/diagnostic'; import { DiagnosticRule } from '../common/diagnosticRules'; import { getFileExtension } from '../common/pathUtils'; import { PythonVersion, versionToString } from '../common/pythonVersion'; import { TextRange } from '../common/textRange'; +import { DefinitionFilter, DefinitionProvider } from '../languageService/definitionProvider'; import { Localizer } from '../localization/localize'; import { ArgumentCategory, @@ -60,7 +63,6 @@ import { ParameterCategory, ParameterNode, ParseNode, - ParseNodeArray, ParseNodeType, PatternClassNode, RaiseNode, @@ -85,28 +87,30 @@ import { YieldFromNode, YieldNode, } from '../parser/parseNodes'; +import { ParseResults } from '../parser/parser'; import { getUnescapedString, UnescapeError, UnescapeErrorType } from '../parser/stringTokenUtils'; import { OperatorType } from '../parser/tokenizerTypes'; import { AnalyzerFileInfo } from './analyzerFileInfo'; import * as AnalyzerNodeInfo from './analyzerNodeInfo'; import { Declaration, DeclarationType, isAliasDeclaration } from './declaration'; -import { isExplicitTypeAliasDeclaration, isFinalVariableDeclaration } from './declarationUtils'; -import { createImportedModuleDescriptor, ImportResolver } from './importResolver'; +import { createImportedModuleDescriptor, ImportedModuleDescriptor, ImportResolver } from './importResolver'; import { ImportResult, ImportType } from './importResult'; import { getRelativeModuleName, getTopLevelImports } from './importStatementUtils'; +import { getParameterListDetails } from './parameterUtils'; import * as ParseTreeUtils from './parseTreeUtils'; import { ParseTreeWalker } from './parseTreeWalker'; import { validateClassPattern } from './patternMatching'; +import { getRegionComments, RegionComment, RegionCommentType } from './regions'; import { ScopeType } from './scope'; import { getScopeForNode } from './scopeUtils'; import { IPythonMode } from './sourceFile'; -import { isStubFile } from './sourceMapper'; +import { isStubFile, SourceMapper } from './sourceMapper'; import { evaluateStaticBoolExpression } from './staticExpressions'; import { Symbol } from './symbol'; import * as SymbolNameUtils from './symbolNameUtils'; -import { getLastTypedDeclaredForSymbol, isFinalVariable } from './symbolUtils'; +import { getLastTypedDeclaredForSymbol } from './symbolUtils'; import { maxCodeComplexity } from './typeEvaluator'; -import { TypeEvaluator } from './typeEvaluatorTypes'; +import { FunctionTypeResult, TypeEvaluator, TypeResult } from './typeEvaluatorTypes'; import { getElementTypeForContainerNarrowing, isIsinstanceFilterSubclass, @@ -156,11 +160,9 @@ import { getDeclaredGeneratorReturnType, getGeneratorTypeArgs, getGeneratorYieldType, - getParameterListDetails, getProtocolSymbols, getTypeVarArgumentsRecursive, getTypeVarScopeId, - isEllipsisType, isLiteralType, isLiteralTypeOrUnion, isPartlyUnknown, @@ -233,6 +235,7 @@ const deprecatedSpecialForms = new Map([ const isPrintCodeComplexityEnabled = false; export class Checker extends ParseTreeWalker { + private readonly _moduleNode: ModuleNode; private readonly _fileInfo: AnalyzerFileInfo; private _isUnboundCheckSuppressed = false; @@ -246,16 +249,38 @@ export class Checker extends ParseTreeWalker { constructor( private _importResolver: ImportResolver, private _evaluator: TypeEvaluator, - private _moduleNode: ModuleNode + private _parseResults: ParseResults, + private _sourceMapper: SourceMapper, + private _dependentFiles?: ParseResults[] ) { super(); - this._fileInfo = AnalyzerNodeInfo.getFileInfo(_moduleNode)!; + this._moduleNode = _parseResults.parseTree; + this._fileInfo = AnalyzerNodeInfo.getFileInfo(this._moduleNode)!; } check() { this._scopedNodes.push(this._moduleNode); + this._conditionallyReportShadowedModule(); + + // Report code complexity issues for the module. + const codeComplexity = AnalyzerNodeInfo.getCodeFlowComplexity(this._moduleNode); + + if (isPrintCodeComplexityEnabled) { + console.log(`Code complexity of module ${this._fileInfo.filePath} is ${codeComplexity.toString()}`); + } + + if (codeComplexity > maxCodeComplexity) { + this._evaluator.addDiagnosticForTextRange( + this._fileInfo, + this._fileInfo.diagnosticRuleSet.reportGeneralTypeIssues, + DiagnosticRule.reportGeneralTypeIssues, + Localizer.Diagnostic.codeTooComplexToAnalyze(), + { start: 0, length: 0 } + ); + } + this._walkStatementsAndReportUnreachable(this._moduleNode.statements); // Mark symbols accessed by __all__ as accessed. @@ -272,7 +297,7 @@ export class Checker extends ParseTreeWalker { this._reportDuplicateImports(); - MissingModuleSourceReporter.report(this._importResolver, this._evaluator, this._fileInfo, this._moduleNode); + this._checkRegions(); } override walk(node: ParseNode) { @@ -330,11 +355,8 @@ export class Checker extends ParseTreeWalker { if (!ClassType.isProtocolClass(baseClassType)) { this._evaluator.addError( Localizer.Diagnostic.protocolBaseClass().format({ - classType: this._evaluator.printType( - classTypeResult.classType, - /* expandTypeAlias */ false - ), - baseType: this._evaluator.printType(baseClassType, /* expandTypeAlias */ false), + classType: this._evaluator.printType(classTypeResult.classType), + baseType: this._evaluator.printType(baseClassType), }), arg.valueExpression ); @@ -392,6 +414,15 @@ export class Checker extends ParseTreeWalker { this.walk(node.typeParameters); } + if (!this._fileInfo.diagnosticRuleSet.analyzeUnannotatedFunctions && !this._fileInfo.isStubFile) { + if (ParseTreeUtils.isUnannotatedFunction(node)) { + this._evaluator.addInformation( + Localizer.Diagnostic.unannotatedFunctionSkipped().format({ name: node.name.value }), + node.name + ); + } + } + const functionTypeResult = this._evaluator.getTypeOfFunction(node); const containingClassNode = ParseTreeUtils.getEnclosingClass(node, /* stopAtFunction */ true); @@ -435,36 +466,39 @@ export class Checker extends ParseTreeWalker { const functionTypeParam = functionTypeResult.functionType.details.parameters.find( (p) => p.name === param.name?.value ); + if (functionTypeParam) { const paramType = functionTypeParam.type; - if ( - isUnknown(paramType) || - (isTypeVar(paramType) && - paramType.details.isSynthesized && - !paramType.details.isSynthesizedSelf) - ) { - this._evaluator.addDiagnostic( - this._fileInfo.diagnosticRuleSet.reportUnknownParameterType, - DiagnosticRule.reportUnknownParameterType, - Localizer.Diagnostic.paramTypeUnknown().format({ paramName: param.name.value }), - param.name - ); - } else if (isPartlyUnknown(paramType)) { - const diagAddendum = new DiagnosticAddendum(); - diagAddendum.addMessage( - Localizer.DiagnosticAddendum.paramType().format({ - paramType: this._evaluator.printType(paramType, /* expandTypeAlias */ true), - }) - ); - this._evaluator.addDiagnostic( - this._fileInfo.diagnosticRuleSet.reportUnknownParameterType, - DiagnosticRule.reportUnknownParameterType, - Localizer.Diagnostic.paramTypePartiallyUnknown().format({ - paramName: param.name.value, - }) + diagAddendum.getString(), - param.name - ); + if (this._fileInfo.diagnosticRuleSet.reportUnknownParameterType !== 'none') { + if ( + isUnknown(paramType) || + (isTypeVar(paramType) && + paramType.details.isSynthesized && + !paramType.details.isSynthesizedSelf) + ) { + this._evaluator.addDiagnostic( + this._fileInfo.diagnosticRuleSet.reportUnknownParameterType, + DiagnosticRule.reportUnknownParameterType, + Localizer.Diagnostic.paramTypeUnknown().format({ paramName: param.name.value }), + param.name + ); + } else if (isPartlyUnknown(paramType)) { + const diagAddendum = new DiagnosticAddendum(); + diagAddendum.addMessage( + Localizer.DiagnosticAddendum.paramType().format({ + paramType: this._evaluator.printType(paramType, { expandTypeAlias: true }), + }) + ); + this._evaluator.addDiagnostic( + this._fileInfo.diagnosticRuleSet.reportUnknownParameterType, + DiagnosticRule.reportUnknownParameterType, + Localizer.Diagnostic.paramTypePartiallyUnknown().format({ + paramName: param.name.value, + }) + diagAddendum.getString(), + param.name + ); + } } let hasAnnotation = false; @@ -478,7 +512,7 @@ export class Checker extends ParseTreeWalker { } } - if (!hasAnnotation) { + if (!hasAnnotation && this._fileInfo.diagnosticRuleSet.reportMissingParameterType !== 'none') { this._evaluator.addDiagnostic( this._fileInfo.diagnosticRuleSet.reportMissingParameterType, DiagnosticRule.reportMissingParameterType, @@ -488,19 +522,6 @@ export class Checker extends ParseTreeWalker { } } } - - // If it's a stub file, report an issue of the default value expression is not "...". - if (param.defaultValue && this._fileInfo.isStubFile) { - const defaultValueType = this._evaluator.getType(param.defaultValue); - if (!defaultValueType || !isEllipsisType(defaultValueType)) { - this._evaluator.addDiagnostic( - this._fileInfo.diagnosticRuleSet.reportInvalidStubStatement, - DiagnosticRule.reportInvalidStubStatement, - Localizer.Diagnostic.defaultValueNotEllipsis(), - param.defaultValue - ); - } - } }); // Check for invalid use of ParamSpec P.args and P.kwargs. @@ -557,11 +578,13 @@ export class Checker extends ParseTreeWalker { const annotationNode = param.typeAnnotation || param.typeAnnotationComment; if (annotationNode && index < functionTypeResult.functionType.details.parameters.length) { const paramType = functionTypeResult.functionType.details.parameters[index].type; + const exemptMethods = ['__init__', '__new__']; + if ( isTypeVar(paramType) && paramType.details.declaredVariance === Variance.Covariant && !paramType.details.isSynthesized && - functionTypeResult.functionType.details.name !== '__init__' + !exemptMethods.some((name) => name === functionTypeResult.functionType.details.name) ) { this._evaluator.addDiagnostic( this._fileInfo.diagnosticRuleSet.reportGeneralTypeIssues, @@ -629,15 +652,10 @@ export class Checker extends ParseTreeWalker { // Verify common dunder signatures. this._validateDunderSignatures(node, functionTypeResult.functionType, containingClassNode !== undefined); - // Verify that strict type guard functions don't violate the constraints - // of strict type guards. - this._validateStrictTypeGuardFunction( - node, - functionTypeResult.functionType, - containingClassNode !== undefined - ); + // Verify TypeGuard or StrictTypeGuard functions. + this._validateTypeGuardFunction(node, functionTypeResult.functionType, containingClassNode !== undefined); - this._validateFunctionTypeVarUsage(node, functionTypeResult.functionType); + this._validateFunctionTypeVarUsage(node, functionTypeResult); } // If we're at the module level within a stub file, report a diagnostic @@ -728,7 +746,7 @@ export class Checker extends ParseTreeWalker { this._fileInfo.diagnosticRuleSet.reportUnknownLambdaType, DiagnosticRule.reportUnknownLambdaType, Localizer.Diagnostic.lambdaReturnTypePartiallyUnknown().format({ - returnType: this._evaluator.printType(returnType, /* expandTypeAlias */ true), + returnType: this._evaluator.printType(returnType, { expandTypeAlias: true }), }), node.expression ); @@ -745,6 +763,8 @@ export class Checker extends ParseTreeWalker { this._validateIllegalDefaultParamInitializer(node); + this._validateStandardCollectionInstantiation(node); + if ( this._fileInfo.diagnosticRuleSet.reportUnusedCallResult !== 'none' || this._fileInfo.diagnosticRuleSet.reportUnusedCoroutine !== 'none' @@ -759,7 +779,7 @@ export class Checker extends ParseTreeWalker { this._fileInfo.diagnosticRuleSet.reportUnusedCallResult, DiagnosticRule.reportUnusedCallResult, Localizer.Diagnostic.unusedCallResult().format({ - type: this._evaluator.printType(returnType, /* expandTypeAlias */ false), + type: this._evaluator.printType(returnType), }), node ); @@ -792,7 +812,7 @@ export class Checker extends ParseTreeWalker { this._fileInfo.diagnosticRuleSet.reportUnusedCallResult, DiagnosticRule.reportUnusedCallResult, Localizer.Diagnostic.unusedCallResult().format({ - type: this._evaluator.printType(returnType, /* expandTypeAlias */ false), + type: this._evaluator.printType(returnType), }), node ); @@ -874,7 +894,7 @@ export class Checker extends ParseTreeWalker { } override visitReturn(node: ReturnNode): boolean { - let returnType: Type; + let returnTypeResult: TypeResult; const enclosingFunctionNode = ParseTreeUtils.getEnclosingFunction(node); const declaredReturnType = enclosingFunctionNode @@ -882,10 +902,20 @@ export class Checker extends ParseTreeWalker { : undefined; if (node.returnExpression) { - returnType = this._evaluator.getType(node.returnExpression) || UnknownType.create(); + returnTypeResult = this._evaluator.getTypeResult(node.returnExpression) ?? { type: UnknownType.create() }; } else { // There is no return expression, so "None" is assumed. - returnType = NoneType.createInstance(); + returnTypeResult = { type: NoneType.createInstance() }; + } + + // If the enclosing function is async and a generator, the return + // statement is not allowed to have an argument. A syntax error occurs + // at runtime in this case. + if (enclosingFunctionNode?.isAsync && node.returnExpression) { + const functionDecl = AnalyzerNodeInfo.getDeclaration(enclosingFunctionNode); + if (functionDecl?.type === DeclarationType.Function && functionDecl.isGenerator) { + this._evaluator.addError(Localizer.Diagnostic.returnInAsyncGenerator(), node.returnExpression); + } } if (this._evaluator.isNodeReachable(node, /* sourceNode */ undefined) && enclosingFunctionNode) { @@ -898,13 +928,13 @@ export class Checker extends ParseTreeWalker { node ); } else { - const diagAddendum = new DiagnosticAddendum(); + let diagAddendum = new DiagnosticAddendum(); let returnTypeMatches = false; if ( this._evaluator.assignType( declaredReturnType, - returnType, + returnTypeResult.type, diagAddendum, new TypeVarContext(), /* srcTypeVarContext */ undefined, @@ -939,7 +969,7 @@ export class Checker extends ParseTreeWalker { if ( this._evaluator.assignType( adjustedReturnType, - returnType, + returnTypeResult.type, diagAddendum, /* destTypeVarContext */ undefined, /* srcTypeVarContext */ undefined, @@ -953,32 +983,39 @@ export class Checker extends ParseTreeWalker { } if (!returnTypeMatches) { + // If we have more detailed diagnostic information from + // bidirectional type inference, use that. + if (returnTypeResult.expectedTypeDiagAddendum) { + diagAddendum = returnTypeResult.expectedTypeDiagAddendum; + } + this._evaluator.addDiagnostic( this._fileInfo.diagnosticRuleSet.reportGeneralTypeIssues, DiagnosticRule.reportGeneralTypeIssues, Localizer.Diagnostic.returnTypeMismatch().format({ - exprType: this._evaluator.printType(returnType, /* expandTypeAlias */ false), - returnType: this._evaluator.printType(declaredReturnType, /* expandTypeAlias */ false), + exprType: this._evaluator.printType(returnTypeResult.type), + returnType: this._evaluator.printType(declaredReturnType), }) + diagAddendum.getString(), - node.returnExpression ? node.returnExpression : node + node.returnExpression ? node.returnExpression : node, + returnTypeResult.expectedTypeDiagAddendum?.getEffectiveTextRange() ); } } } - if (isUnknown(returnType)) { + if (isUnknown(returnTypeResult.type)) { this._evaluator.addDiagnostic( this._fileInfo.diagnosticRuleSet.reportUnknownVariableType, DiagnosticRule.reportUnknownVariableType, Localizer.Diagnostic.returnTypeUnknown(), node.returnExpression! ); - } else if (isPartlyUnknown(returnType)) { + } else if (isPartlyUnknown(returnTypeResult.type)) { this._evaluator.addDiagnostic( this._fileInfo.diagnosticRuleSet.reportUnknownVariableType, DiagnosticRule.reportUnknownVariableType, Localizer.Diagnostic.returnTypePartiallyUnknown().format({ - returnType: this._evaluator.printType(returnType, /* expandTypeAlias */ true), + returnType: this._evaluator.printType(returnTypeResult.type, { expandTypeAlias: true }), }), node.returnExpression! ); @@ -1003,7 +1040,8 @@ export class Checker extends ParseTreeWalker { yieldType = UnknownType.create(); } else { yieldType = - this._evaluator.getTypeOfIterable(yieldFromType, /* isAsync */ false, node) || UnknownType.create(); + this._evaluator.getTypeOfIterable({ type: yieldFromType }, /* isAsync */ false, node)?.type ?? + UnknownType.create(); // Does the iterator return a Generator? If so, get the yield type from it. // If the iterator doesn't return a Generator, use the iterator return type @@ -1013,7 +1051,8 @@ export class Checker extends ParseTreeWalker { yieldType = generatorTypeArgs.length >= 1 ? generatorTypeArgs[0] : UnknownType.create(); } else { yieldType = - this._evaluator.getTypeOfIterator(yieldFromType, /* isAsync */ false, node) || UnknownType.create(); + this._evaluator.getTypeOfIterator({ type: yieldFromType }, /* isAsync */ false, node)?.type ?? + UnknownType.create(); } } @@ -1041,14 +1080,14 @@ export class Checker extends ParseTreeWalker { if (!derivesFromClassRecursive(subtype, baseExceptionType, /* ignoreUnknown */ false)) { diagAddendum.addMessage( Localizer.Diagnostic.exceptionTypeIncorrect().format({ - type: this._evaluator.printType(subtype, /* expandTypeAlias */ false), + type: this._evaluator.printType(subtype), }) ); } } else { diagAddendum.addMessage( Localizer.Diagnostic.exceptionTypeIncorrect().format({ - type: this._evaluator.printType(subtype, /* expandTypeAlias */ false), + type: this._evaluator.printType(subtype), }) ); } @@ -1110,6 +1149,7 @@ export class Checker extends ParseTreeWalker { override visitAssignment(node: AssignmentNode): boolean { this._evaluator.evaluateTypesForStatement(node); + if (node.typeAnnotationComment) { this._evaluator.getType(node.typeAnnotationComment); @@ -1126,6 +1166,27 @@ export class Checker extends ParseTreeWalker { } } + // If this isn't a class or global scope, explicit type aliases are not allowed. + if (node.leftExpression.nodeType === ParseNodeType.TypeAnnotation) { + const annotationType = this._evaluator.getTypeOfAnnotation(node.leftExpression.typeAnnotation); + + if (isClassInstance(annotationType) && ClassType.isBuiltIn(annotationType, 'TypeAlias')) { + const scope = getScopeForNode(node); + if (scope) { + if ( + scope.type !== ScopeType.Class && + scope.type !== ScopeType.Module && + scope.type !== ScopeType.Builtin + ) { + this._evaluator.addError( + Localizer.Diagnostic.typeAliasNotInModuleOrClass(), + node.leftExpression.typeAnnotation + ); + } + } + } + } + return true; } @@ -1193,6 +1254,11 @@ export class Checker extends ParseTreeWalker { if (!ParseTreeUtils.isWithinAssertExpression(node)) { this._validateComparisonTypes(node); } + } else if (node.operator === OperatorType.Is || node.operator === OperatorType.IsNot) { + // Don't apply this rule if it's within an assert. + if (!ParseTreeUtils.isWithinAssertExpression(node)) { + this._validateComparisonTypesForIsOperator(node); + } } else if (node.operator === OperatorType.In || node.operator === OperatorType.NotIn) { // Don't apply this rule if it's within an assert. if (!ParseTreeUtils.isWithinAssertExpression(node)) { @@ -1338,9 +1404,9 @@ export class Checker extends ParseTreeWalker { this._reportUnboundName(node); } - // Report the use of a deprecated symbol. For now, this functionality - // is disabled. We'll leave it in place for the future. - // this._reportDeprecatedUse(node); + // Report the use of a deprecated symbol. + const type = this._evaluator.getType(node); + this._reportDeprecatedUse(node, type); return true; } @@ -1356,7 +1422,9 @@ export class Checker extends ParseTreeWalker { } override visitMemberAccess(node: MemberAccessNode) { - this._evaluator.getType(node); + const type = this._evaluator.getType(node); + this._reportDeprecatedUse(node.memberName, type); + this._conditionallyReportPrivateUsage(node.memberName); // Walk the leftExpression but not the memberName. @@ -1366,11 +1434,24 @@ export class Checker extends ParseTreeWalker { } override visitImportAs(node: ImportAsNode): boolean { + this._conditionallyReportShadowedImport(node); this._evaluator.evaluateTypesForStatement(node); - return false; + return true; } override visitImportFrom(node: ImportFromNode): boolean { + // Verify that any "__future__" import occurs at the top of the file. + if ( + node.module.leadingDots === 0 && + node.module.nameParts.length === 1 && + node.module.nameParts[0].value === '__future__' + ) { + if (!ParseTreeUtils.isValidLocationForFutureImport(node)) { + this._evaluator.addError(Localizer.Diagnostic.futureImportLocationNotAllowed(), node); + } + } + + this._conditionallyReportShadowedImport(node); if (!node.isWildcardImport) { node.imports.forEach((importAs) => { this._evaluator.evaluateTypesForStatement(importAs); @@ -1393,6 +1474,54 @@ export class Checker extends ParseTreeWalker { } } + return true; + } + + override visitImportFromAs(node: ImportFromAsNode): boolean { + if (this._fileInfo.isStubFile) { + return false; + } + + const decls = this._evaluator.getDeclarationsForNameNode(node.name); + if (!decls) { + return false; + } + + for (const decl of decls) { + if (!isAliasDeclaration(decl) || !decl.submoduleFallback || decl.node !== node) { + // If it is not implicitly imported module, move to next. + continue; + } + + const resolvedAlias = this._evaluator.resolveAliasDeclaration(decl, /* resolveLocalNames */ true); + if (!resolvedAlias?.path || !isStubFile(resolvedAlias.path)) { + continue; + } + + const importResult = this._getImportResult(node, resolvedAlias.path); + if (!importResult) { + continue; + } + + this._addMissingModuleSourceDiagnosticIfNeeded(importResult, node.name); + break; + } + + const type = this._evaluator.getType(node.alias ?? node.name); + this._reportDeprecatedUse(node.name, type); + + return false; + } + + override visitModuleName(node: ModuleNameNode): boolean { + if (this._fileInfo.isStubFile) { + return false; + } + + const importResult = AnalyzerNodeInfo.getImportInfo(node); + assert(importResult !== undefined); + + this._addMissingModuleSourceDiagnosticIfNeeded(importResult, node); return false; } @@ -1446,6 +1575,49 @@ export class Checker extends ParseTreeWalker { return false; } + private _getImportResult(node: ImportFromAsNode, filePath: string) { + const execEnv = this._importResolver.getConfigOptions().findExecEnvironment(filePath); + const moduleNameNode = (node.parent as ImportFromNode).module; + + // Handle both absolute and relative imports. + const moduleName = + moduleNameNode.leadingDots === 0 + ? this._importResolver.getModuleNameForImport(filePath, execEnv).moduleName + : getRelativeModuleName(this._importResolver.fileSystem, this._fileInfo.filePath, filePath); + + if (!moduleName) { + return undefined; + } + + return this._importResolver.resolveImport( + this._fileInfo.filePath, + execEnv, + createImportedModuleDescriptor(moduleName) + ); + } + + private _addMissingModuleSourceDiagnosticIfNeeded(importResult: ImportResult, node: ParseNode) { + if ( + importResult.isNativeLib || + !importResult.isStubFile || + importResult.importType === ImportType.BuiltIn || + !importResult.nonStubImportResult || + importResult.nonStubImportResult.isImportFound + ) { + return; + } + + // Type stub found, but source is missing. + this._evaluator.addDiagnostic( + this._fileInfo.diagnosticRuleSet.reportMissingModuleSource, + DiagnosticRule.reportMissingModuleSource, + Localizer.Diagnostic.importSourceResolveFailure().format({ + importName: importResult.importName, + }), + node + ); + } + private _reportUnnecessaryConditionExpression(expression: ExpressionNode) { if (expression.nodeType === ParseNodeType.BinaryOperation) { if (expression.operator === OperatorType.And || expression.operator === OperatorType.Or) { @@ -1494,9 +1666,38 @@ export class Checker extends ParseTreeWalker { ParseNodeType.Number, ParseNodeType.Constant, ParseNodeType.Name, + ParseNodeType.Tuple, ]; + let reportAsUnused = false; + if (simpleExpressionTypes.some((nodeType) => nodeType === node.nodeType)) { + reportAsUnused = true; + } else if ( + node.nodeType === ParseNodeType.List || + node.nodeType === ParseNodeType.Set || + node.nodeType === ParseNodeType.Dictionary + ) { + // Exclude comprehensions. + if (!node.entries.some((entry) => entry.nodeType === ParseNodeType.ListComprehension)) { + reportAsUnused = true; + } + } + + if ( + reportAsUnused && + this._fileInfo.ipythonMode === IPythonMode.CellDocs && + node.parent?.nodeType === ParseNodeType.StatementList && + node.parent.statements[node.parent.statements.length - 1] === node && + node.parent.parent?.nodeType === ParseNodeType.Module && + node.parent.parent.statements[node.parent.parent.statements.length - 1] === node.parent + ) { + // Exclude an expression at the end of a notebook cell, as that is treated as + // the cell's value. + reportAsUnused = false; + } + + if (reportAsUnused) { this._evaluator.addDiagnostic( this._fileInfo.diagnosticRuleSet.reportUnusedExpression, DiagnosticRule.reportUnusedExpression, @@ -1558,6 +1759,32 @@ export class Checker extends ParseTreeWalker { } } + private _validateStandardCollectionInstantiation(node: CallNode) { + const leftType = this._evaluator.getType(node.leftExpression); + + if ( + leftType && + isInstantiableClass(leftType) && + ClassType.isBuiltIn(leftType) && + !leftType.includeSubclasses && + leftType.aliasName + ) { + const nonInstantiable = ['List', 'Set', 'Dict', 'Tuple']; + + if (nonInstantiable.some((name) => name === leftType.aliasName)) { + this._evaluator.addDiagnostic( + this._fileInfo.diagnosticRuleSet.reportGeneralTypeIssues, + DiagnosticRule.reportGeneralTypeIssues, + Localizer.Diagnostic.collectionAliasInstantiation().format({ + type: leftType.aliasName, + alias: leftType.details.name, + }), + node.leftExpression + ); + } + } + } + private _validateContainmentTypes(node: BinaryOperationNode) { const leftType = this._evaluator.getType(node.leftExpression); const containerType = this._evaluator.getType(node.rightExpression); @@ -1592,8 +1819,50 @@ export class Checker extends ParseTreeWalker { this._fileInfo.diagnosticRuleSet.reportUnnecessaryContains, DiagnosticRule.reportUnnecessaryContains, getMessage().format({ - leftType: this._evaluator.printType(leftType, /* expandTypeAlias */ true), - rightType: this._evaluator.printType(elementType, /* expandTypeAlias */ true), + leftType: this._evaluator.printType(leftType, { expandTypeAlias: true }), + rightType: this._evaluator.printType(elementType, { expandTypeAlias: true }), + }), + node + ); + } + } + + // Determines whether the types of the two operands for an "is" or "is not" + // operation have overlapping types. + private _validateComparisonTypesForIsOperator(node: BinaryOperationNode) { + const rightType = this._evaluator.getType(node.rightExpression); + + if (!rightType || !isNoneInstance(rightType)) { + return; + } + + const leftType = this._evaluator.getType(node.leftExpression); + if (!leftType) { + return; + } + + let foundMatchForNone = false; + doForEachSubtype(leftType, (subtype) => { + subtype = this._evaluator.makeTopLevelTypeVarsConcrete(subtype); + + if (this._evaluator.assignType(subtype, NoneType.createInstance())) { + foundMatchForNone = true; + } + }); + + const getMessage = () => { + return node.operator === OperatorType.Is + ? Localizer.Diagnostic.comparisonAlwaysFalse() + : Localizer.Diagnostic.comparisonAlwaysTrue(); + }; + + if (!foundMatchForNone) { + this._evaluator.addDiagnostic( + this._fileInfo.diagnosticRuleSet.reportUnnecessaryComparison, + DiagnosticRule.reportUnnecessaryComparison, + getMessage().format({ + leftType: this._evaluator.printType(leftType, { expandTypeAlias: true }), + rightType: this._evaluator.printType(rightType), }), node ); @@ -1654,8 +1923,8 @@ export class Checker extends ParseTreeWalker { this._fileInfo.diagnosticRuleSet.reportUnnecessaryComparison, DiagnosticRule.reportUnnecessaryComparison, getMessage().format({ - leftType: this._evaluator.printType(leftType, /* expandTypeAlias */ true), - rightType: this._evaluator.printType(rightType, /* expandTypeAlias */ true), + leftType: this._evaluator.printType(leftType, { expandTypeAlias: true }), + rightType: this._evaluator.printType(rightType, { expandTypeAlias: true }), }), node ); @@ -1684,8 +1953,8 @@ export class Checker extends ParseTreeWalker { }); if (!isComparable) { - const leftTypeText = this._evaluator.printType(leftType, /* expandTypeAlias */ true); - const rightTypeText = this._evaluator.printType(rightType, /* expandTypeAlias */ true); + const leftTypeText = this._evaluator.printType(leftType, { expandTypeAlias: true }); + const rightTypeText = this._evaluator.printType(rightType, { expandTypeAlias: true }); this._evaluator.addDiagnostic( this._fileInfo.diagnosticRuleSet.reportUnnecessaryComparison, @@ -1789,13 +2058,19 @@ export class Checker extends ParseTreeWalker { } // Does the class have an operator overload for eq? - if ( - lookUpClassMember( - ClassType.cloneAsInstantiable(leftType), - '__eq__', - ClassMemberLookupFlags.SkipObjectBaseClass - ) - ) { + const eqMethod = lookUpClassMember( + ClassType.cloneAsInstantiable(leftType), + '__eq__', + ClassMemberLookupFlags.SkipObjectBaseClass + ); + + if (eqMethod) { + // If this is a synthesized method for a dataclass, we can assume + // that other dataclass types will not be comparable. + if (ClassType.isDataClass(leftType) && eqMethod.symbol.getSynthesizedType()) { + return false; + } + return true; } @@ -1812,12 +2087,13 @@ export class Checker extends ParseTreeWalker { } // Verifies that each local type variable is used more than once. - private _validateFunctionTypeVarUsage(node: FunctionNode, type: FunctionType) { + private _validateFunctionTypeVarUsage(node: FunctionNode, functionTypeResult: FunctionTypeResult) { // Skip this check entirely if it's disabled. if (this._fileInfo.diagnosticRuleSet.reportInvalidTypeVarUse === 'none') { return; } + const type = functionTypeResult.functionType; const localTypeVarUsage = new Map(); const classTypeVarUsage = new Map(); let exemptBoundTypeVar = true; @@ -1838,7 +2114,7 @@ export class Checker extends ParseTreeWalker { const nameWalker = new ParseTreeUtils.NameNodeWalker((nameNode, subscriptIndex, baseExpression) => { const nameType = this._evaluator.getType(nameNode); ``; - if (nameType && isTypeVar(nameType)) { + if (nameType && isTypeVar(nameType) && !nameType.details.isSynthesizedSelf) { // Does this name refer to a TypeVar that is scoped to this function? if (nameType.scopeId === this._evaluator.getScopeIdForNode(node)) { // We exempt constrained TypeVars, bound TypeVars that are type arguments of @@ -1846,6 +2122,7 @@ export class Checker extends ParseTreeWalker { // instances in these particular cases. let isExempt = nameType.details.constraints.length > 0 || + !!nameType.details.defaultType || (exemptBoundTypeVar && nameType.details.boundType !== undefined && subscriptIndex !== undefined) || @@ -1900,6 +2177,7 @@ export class Checker extends ParseTreeWalker { const existingEntry = classTypeVarUsage.get(nameType.details.name); const isParamTypeWithEllipsisUsage = curParamNode?.defaultValue?.nodeType === ParseNodeType.Ellipsis; + const isExempt = !!nameType.details.defaultType; if (!existingEntry) { classTypeVarUsage.set(nameType.details.name, { @@ -1908,7 +2186,7 @@ export class Checker extends ParseTreeWalker { paramTypeWithEllipsisUsageCount: isParamTypeWithEllipsisUsage ? 1 : 0, returnTypeUsageCount: 0, paramWithEllipsis: isParamTypeWithEllipsisUsage ? curParamNode?.name?.value : undefined, - isExempt: false, + isExempt, }); } else { existingEntry.nodes.push(nameNode); @@ -1977,10 +2255,17 @@ export class Checker extends ParseTreeWalker { } } + // Skip this check if the function is overloaded because the TypeVar + // will be solved in terms of the overload signatures. + const skipUnsolvableTypeVarCheck = + isOverloadedFunction(functionTypeResult.decoratedType) && + !FunctionType.isOverloaded(functionTypeResult.functionType); + if ( isUsedInReturnType && usage.paramTypeWithEllipsisUsageCount > 0 && - usage.paramTypeUsageCount === usage.paramTypeWithEllipsisUsageCount + usage.paramTypeUsageCount === usage.paramTypeWithEllipsisUsageCount && + !skipUnsolvableTypeVarCheck ) { const diag = new DiagnosticAddendum(); diag.addMessage(Localizer.DiagnosticAddendum.typeVarUnsolvableRemedy()); @@ -2002,7 +2287,8 @@ export class Checker extends ParseTreeWalker { classTypeVarUsage.forEach((usage) => { if ( usage.paramTypeWithEllipsisUsageCount > 0 && - usage.paramTypeUsageCount === usage.paramTypeWithEllipsisUsageCount + usage.paramTypeUsageCount === usage.paramTypeWithEllipsisUsageCount && + !usage.isExempt ) { const diag = new DiagnosticAddendum(); diag.addMessage(Localizer.DiagnosticAddendum.typeVarUnsolvableRemedy()); @@ -2162,8 +2448,8 @@ export class Checker extends ParseTreeWalker { ) { returnDiag.addMessage( Localizer.DiagnosticAddendum.functionReturnTypeMismatch().format({ - sourceType: this._evaluator.printType(overloadReturnType, /* expandTypeAlias */ false), - destType: this._evaluator.printType(implementationReturnType, /* expandTypeAlias */ false), + sourceType: this._evaluator.printType(overloadReturnType), + destType: this._evaluator.printType(implementationReturnType), }) ); diag?.addAddendum(returnDiag); @@ -2319,14 +2605,14 @@ export class Checker extends ParseTreeWalker { if (!derivesFromBaseException(exceptionType)) { diagAddendum.addMessage( Localizer.Diagnostic.exceptionTypeIncorrect().format({ - type: this._evaluator.printType(exceptionType, /* expandTypeAlias */ false), + type: this._evaluator.printType(exceptionType), }) ); } resultingExceptionType = ClassType.cloneAsInstance(exceptionType); } else if (isClassInstance(exceptionType)) { const iterableType = - this._evaluator.getTypeOfIterator(exceptionType, /* isAsync */ false, errorNode) || + this._evaluator.getTypeOfIterator({ type: exceptionType }, /* isAsync */ false, errorNode)?.type ?? UnknownType.create(); resultingExceptionType = mapSubtypes(iterableType, (subtype) => { @@ -2338,7 +2624,7 @@ export class Checker extends ParseTreeWalker { if (!derivesFromBaseException(subtype)) { diagAddendum.addMessage( Localizer.Diagnostic.exceptionTypeIncorrect().format({ - type: this._evaluator.printType(exceptionType, /* expandTypeAlias */ false), + type: this._evaluator.printType(exceptionType), }) ); } @@ -2348,7 +2634,7 @@ export class Checker extends ParseTreeWalker { diagAddendum.addMessage( Localizer.Diagnostic.exceptionTypeIncorrect().format({ - type: this._evaluator.printType(exceptionType, /* expandTypeAlias */ false), + type: this._evaluator.printType(exceptionType), }) ); return UnknownType.create(); @@ -2359,7 +2645,7 @@ export class Checker extends ParseTreeWalker { if (!diagAddendum.isEmpty()) { this._evaluator.addError( Localizer.Diagnostic.exceptionTypeNotClass().format({ - type: this._evaluator.printType(exceptionType, /* expandTypeAlias */ false), + type: this._evaluator.printType(exceptionType), }), errorNode ); @@ -2392,12 +2678,13 @@ export class Checker extends ParseTreeWalker { } private _validateSymbolTables() { + const dependentFileInfo = this._dependentFiles?.map((p) => AnalyzerNodeInfo.getFileInfo(p.parseTree)); for (const scopedNode of this._scopedNodes) { const scope = AnalyzerNodeInfo.getScope(scopedNode); if (scope) { scope.symbolTable.forEach((symbol, name) => { - this._conditionallyReportUnusedSymbol(name, symbol, scope.type); + this._conditionallyReportUnusedSymbol(name, symbol, scope.type, dependentFileInfo); this._reportIncompatibleDeclarations(name, symbol); @@ -2532,7 +2819,7 @@ export class Checker extends ParseTreeWalker { } private _reportMultipleFinalDeclarations(name: string, symbol: Symbol, scopeType: ScopeType) { - if (!isFinalVariable(symbol)) { + if (!this._evaluator.isFinalVariable(symbol)) { return; } @@ -2541,7 +2828,7 @@ export class Checker extends ParseTreeWalker { let sawAssignment = false; decls.forEach((decl) => { - if (isFinalVariableDeclaration(decl)) { + if (this._evaluator.isFinalVariableDeclaration(decl)) { if (sawFinal) { this._evaluator.addError(Localizer.Diagnostic.finalRedeclaration().format({ name }), decl.node); } @@ -2594,7 +2881,7 @@ export class Checker extends ParseTreeWalker { private _reportMultipleTypeAliasDeclarations(name: string, symbol: Symbol) { const decls = symbol.getDeclarations(); - const typeAliasDecl = decls.find((decl) => isExplicitTypeAliasDeclaration(decl)); + const typeAliasDecl = decls.find((decl) => this._evaluator.isExplicitTypeAliasDeclaration(decl)); // If this is a type alias, there should be only one declaration. if (typeAliasDecl && decls.length > 1) { @@ -2729,7 +3016,7 @@ export class Checker extends ParseTreeWalker { addPrimaryDeclInfo(diag); } } else if (otherDecl.type === DeclarationType.Function) { - const primaryType = this._evaluator.getTypeForDeclaration(primaryDecl); + const primaryType = this._evaluator.getTypeForDeclaration(primaryDecl)?.type; let duplicateIsOk = false; // If the return type has not yet been inferred, do so now. @@ -2737,7 +3024,7 @@ export class Checker extends ParseTreeWalker { this._evaluator.getFunctionInferredReturnType(primaryType); } - const otherType = this._evaluator.getTypeForDeclaration(otherDecl); + const otherType = this._evaluator.getTypeForDeclaration(otherDecl)?.type; const suite1 = ParseTreeUtils.getEnclosingSuite(primaryDecl.node); const suite2 = ParseTreeUtils.getEnclosingSuite(otherDecl.node); @@ -2797,14 +3084,14 @@ export class Checker extends ParseTreeWalker { } } } else if (otherDecl.type === DeclarationType.Variable) { - const primaryType = this._evaluator.getTypeForDeclaration(primaryDecl); + const primaryType = this._evaluator.getTypeForDeclaration(primaryDecl)?.type; if (otherDecl.typeAnnotationNode) { if (otherDecl.node.nodeType === ParseNodeType.Name) { let duplicateIsOk = false; // It's OK if they both have the same declared type. - const otherType = this._evaluator.getTypeForDeclaration(otherDecl); + const otherType = this._evaluator.getTypeForDeclaration(otherDecl)?.type; if (primaryType && otherType && isTypeSame(primaryType, otherType)) { duplicateIsOk = true; } @@ -2838,14 +3125,20 @@ export class Checker extends ParseTreeWalker { } } - private _conditionallyReportUnusedSymbol(name: string, symbol: Symbol, scopeType: ScopeType) { + private _conditionallyReportUnusedSymbol( + name: string, + symbol: Symbol, + scopeType: ScopeType, + dependentFileInfo?: AnalyzerFileInfo[] + ) { const accessedSymbolSet = this._fileInfo.accessedSymbolSet; + if (symbol.isIgnoredForProtocolMatch() || accessedSymbolSet.has(symbol.id)) { + return; + } - if ( - symbol.isIgnoredForProtocolMatch() || - accessedSymbolSet.has(symbol.id) || - this._fileInfo.ipythonMode === IPythonMode.CellDocs - ) { + // If this file is implicitly imported by other files, we need to make sure the symbol defined in + // the current file is not accessed from those other files. + if (dependentFileInfo && dependentFileInfo.some((i) => i.accessedSymbolSet.has(symbol.id))) { return; } @@ -2877,8 +3170,10 @@ export class Checker extends ParseTreeWalker { rule = DiagnosticRule.reportUnusedImport; if (decl.node.nodeType === ParseNodeType.ImportAs) { if (decl.node.alias) { - // Aliases in stub files are assumed to be re-exports. - if (!this._fileInfo.isStubFile) { + // For statements of the form "import x as x", don't mark "x" as unaccessed + // because it's assumed to be re-exported. + // See https://typing.readthedocs.io/en/latest/source/stubs.html#imports. + if (decl.node.alias.value !== decl.moduleName) { nameNode = decl.node.alias; } } else { @@ -2907,9 +3202,9 @@ export class Checker extends ParseTreeWalker { } else if (decl.node.nodeType === ParseNodeType.ImportFromAs) { const importFrom = decl.node.parent as ImportFromNode; - // If this is a stub file that is using the "from A import B as C" or "from . import C", - // don't mark "C" as unaccessed because it's assumed to be re-exported. - const isReexport = this._fileInfo.isStubFile && decl.node.alias !== undefined; + // For statements of the form "from y import x as x", don't mark "x" as + // unaccessed because it's assumed to be re-exported. + const isReexport = decl.node.alias?.value === decl.node.name.value; // If this is a __future__ import, it's OK for the import symbol to be unaccessed. const isFuture = @@ -3078,10 +3373,10 @@ export class Checker extends ParseTreeWalker { DiagnosticRule.reportGeneralTypeIssues, isInstanceCheck ? Localizer.Diagnostic.isInstanceInvalidType().format({ - type: this._evaluator.printType(arg1Type, /* expandTypeAlias */ false), + type: this._evaluator.printType(arg1Type), }) + diag.getString() : Localizer.Diagnostic.isSubclassInvalidType().format({ - type: this._evaluator.printType(arg1Type, /* expandTypeAlias */ false), + type: this._evaluator.printType(arg1Type), }) + diag.getString(), node.arguments[1] ); @@ -3280,12 +3575,12 @@ export class Checker extends ParseTreeWalker { DiagnosticRule.reportUnnecessaryIsInstance, isInstanceCheck ? Localizer.Diagnostic.unnecessaryIsInstanceAlways().format({ - testType: this._evaluator.printType(arg0Type, /* expandTypeAlias */ false), - classType: this._evaluator.printType(getTestType(), /* expandTypeAlias */ false), + testType: this._evaluator.printType(arg0Type), + classType: this._evaluator.printType(getTestType()), }) : Localizer.Diagnostic.unnecessaryIsSubclassAlways().format({ - testType: this._evaluator.printType(arg0Type, /* expandTypeAlias */ false), - classType: this._evaluator.printType(getTestType(), /* expandTypeAlias */ false), + testType: this._evaluator.printType(arg0Type), + classType: this._evaluator.printType(getTestType()), }), node ); @@ -3360,33 +3655,127 @@ export class Checker extends ParseTreeWalker { return false; } - private _reportDeprecatedUse(node: NameNode) { - const deprecatedForm = deprecatedAliases.get(node.value) ?? deprecatedSpecialForms.get(node.value); - - if (!deprecatedForm) { - return; - } - - const type = this._evaluator.getType(node); - + private _reportDeprecatedUse(node: NameNode, type: Type | undefined) { if (!type) { return; } - if (!isInstantiableClass(type) || type.details.fullName !== deprecatedForm.fullName) { - return; - } + let errorMessage: string | undefined; + let deprecatedMessage: string | undefined; - if (this._fileInfo.executionEnvironment.pythonVersion >= deprecatedForm.version) { - this._evaluator.addDeprecated( - Localizer.Diagnostic.deprecatedType().format({ - version: versionToString(deprecatedForm.version), - replacement: deprecatedForm.replacementText, - }), - node - ); - } - } + function getDeprecatedMessageForOverloadedCall(evaluator: TypeEvaluator, type: Type) { + // Determine if the node is part of a call expression. If so, + // we can determine which overload(s) were used to satisfy + // the call expression and determine whether any of them + // are deprecated. + const callNode = ParseTreeUtils.getCallForName(node); + + if (callNode) { + const callTypeResult = evaluator.getTypeResult(callNode); + + if ( + callTypeResult && + callTypeResult.overloadsUsedForCall && + callTypeResult.overloadsUsedForCall.length > 0 + ) { + callTypeResult.overloadsUsedForCall.forEach((overload) => { + if (overload.details.deprecatedMessage !== undefined) { + if (node.value === overload.details.name) { + deprecatedMessage = overload.details.deprecatedMessage; + errorMessage = Localizer.Diagnostic.deprecatedFunction().format({ + name: overload.details.name, + }); + } else if (isInstantiableClass(type) && overload.details.name === '__init__') { + deprecatedMessage = overload.details.deprecatedMessage; + errorMessage = Localizer.Diagnostic.deprecatedConstructor().format({ + name: type.details.name, + }); + } + } + }); + } + } + } + + doForEachSubtype(type, (subtype) => { + if (isClass(subtype)) { + if ( + !subtype.includeSubclasses && + subtype.details.deprecatedMessage !== undefined && + node.value === subtype.details.name + ) { + deprecatedMessage = subtype.details.deprecatedMessage; + errorMessage = Localizer.Diagnostic.deprecatedClass().format({ name: subtype.details.name }); + } else { + // See if this is part of a call to a constructor. + getDeprecatedMessageForOverloadedCall(this._evaluator, subtype); + } + } else if (isFunction(subtype)) { + if (subtype.details.deprecatedMessage !== undefined && node.value === subtype.details.name) { + deprecatedMessage = subtype.details.deprecatedMessage; + errorMessage = Localizer.Diagnostic.deprecatedFunction().format({ + name: subtype.details.name || '', + }); + } + } else if (isOverloadedFunction(subtype)) { + // Determine if the node is part of a call expression. If so, + // we can determine which overload(s) were used to satisfy + // the call expression and determine whether any of them + // are deprecated. + getDeprecatedMessageForOverloadedCall(this._evaluator, subtype); + } + }); + + if (errorMessage) { + const diag = new DiagnosticAddendum(); + if (deprecatedMessage) { + diag.addMessage(deprecatedMessage); + } + + if (this._fileInfo.diagnosticRuleSet.reportDeprecated === 'none') { + this._evaluator.addDeprecated(errorMessage + diag.getString(), node); + } else { + this._evaluator.addDiagnostic( + this._fileInfo.diagnosticRuleSet.reportDeprecated, + DiagnosticRule.reportDeprecated, + errorMessage + diag.getString(), + node + ); + } + } + + // We'll leave this disabled for now because this would be too noisy for most + // code bases. We may want to add it at some future date. + if (0) { + const deprecatedForm = deprecatedAliases.get(node.value) ?? deprecatedSpecialForms.get(node.value); + + if (deprecatedForm) { + if (isInstantiableClass(type) && type.details.fullName === deprecatedForm.fullName) { + if (this._fileInfo.executionEnvironment.pythonVersion >= deprecatedForm.version) { + if (this._fileInfo.diagnosticRuleSet.reportDeprecated === 'none') { + this._evaluator.addDeprecated( + Localizer.Diagnostic.deprecatedType().format({ + version: versionToString(deprecatedForm.version), + replacement: deprecatedForm.replacementText, + }), + node + ); + } else { + this._evaluator.addDiagnostic( + this._fileInfo.diagnosticRuleSet.reportDeprecated, + DiagnosticRule.reportDeprecated, + Localizer.Diagnostic.deprecatedType().format({ + version: versionToString(deprecatedForm.version), + replacement: deprecatedForm.replacementText, + }), + node + ); + } + } + } + } + } + } private _reportUnboundName(node: NameNode) { if (this._fileInfo.diagnosticRuleSet.reportUnboundVariable === 'none') { @@ -3416,6 +3805,116 @@ export class Checker extends ParseTreeWalker { } } + private _conditionallyReportShadowedModule() { + if (this._fileInfo.diagnosticRuleSet.reportShadowedImports === 'none') { + return; + } + // Check the module we're in. + const moduleName = this._fileInfo.moduleName; + const desc: ImportedModuleDescriptor = { + nameParts: moduleName.split('.'), + leadingDots: 0, + importedSymbols: [], + }; + const stdlibPath = this._importResolver.getTypeshedStdLibPath(this._fileInfo.executionEnvironment); + if ( + stdlibPath && + this._importResolver.isStdlibModule(desc, this._fileInfo.executionEnvironment) && + this._sourceMapper.isUserCode(this._fileInfo.filePath) + ) { + // This means the user has a module that is overwriting the stdlib module. + const diag = this._evaluator.addDiagnosticForTextRange( + this._fileInfo, + this._fileInfo.diagnosticRuleSet.reportShadowedImports, + DiagnosticRule.reportShadowedImports, + Localizer.Diagnostic.stdlibModuleOverridden().format({ + name: moduleName, + path: this._fileInfo.filePath, + }), + this._moduleNode + ); + + // Add a quick action that renames the file. + if (diag) { + const renameAction: RenameShadowedFileAction = { + action: ActionKind.RenameShadowedFileAction, + oldFile: this._fileInfo.filePath, + newFile: this._sourceMapper.getNextFileName(this._fileInfo.filePath), + }; + diag.addAction(renameAction); + } + } + } + + private _conditionallyReportShadowedImport(node: ImportAsNode | ImportFromAsNode | ImportFromNode) { + if (this._fileInfo.diagnosticRuleSet.reportShadowedImports === 'none') { + return; + } + + // Skip this check for relative imports. + const nodeModule = + node.nodeType === ParseNodeType.ImportFromAs + ? node.parent?.nodeType === ParseNodeType.ImportFrom + ? node.parent?.module + : undefined + : node.module; + if (nodeModule?.leadingDots) { + return; + } + + // Otherwise use the name to determine if a match for a stdlib module. + const namePartNodes = + node.nodeType === ParseNodeType.ImportAs + ? node.module.nameParts + : node.nodeType === ParseNodeType.ImportFromAs + ? [node.name] + : node.module.nameParts; + const nameParts = namePartNodes.map((n) => n.value); + const module: ImportedModuleDescriptor = { + nameParts, + leadingDots: 0, + importedSymbols: [], + }; + + // Make sure the module is a potential stdlib one so we don't spend the time + // searching for the definition. + const stdlibPath = this._importResolver.getTypeshedStdLibPath(this._fileInfo.executionEnvironment); + if (stdlibPath && this._importResolver.isStdlibModule(module, this._fileInfo.executionEnvironment)) { + // If the definition for this name is in 'user' module, it is overwriting the stdlib module. + const definitions = DefinitionProvider.getDefinitionsForNode( + this._sourceMapper, + namePartNodes[namePartNodes.length - 1], + DefinitionFilter.All, + this._evaluator, + CancellationToken.None + ); + const paths = definitions ? definitions.map((d) => d.path) : []; + paths.forEach((p) => { + if (!p.startsWith(stdlibPath) && !isStubFile(p) && this._sourceMapper.isUserCode(p)) { + // This means the user has a module that is overwriting the stdlib module. + const diag = this._evaluator.addDiagnostic( + this._fileInfo.diagnosticRuleSet.reportShadowedImports, + DiagnosticRule.reportShadowedImports, + Localizer.Diagnostic.stdlibModuleOverridden().format({ + name: nameParts.join('.'), + path: p, + }), + node + ); + // Add a quick action that renames the file. + if (diag) { + const renameAction: RenameShadowedFileAction = { + action: ActionKind.RenameShadowedFileAction, + oldFile: p, + newFile: this._sourceMapper.getNextFileName(p), + }; + diag.addAction(renameAction); + } + } + }); + } + } + private _conditionallyReportPrivateUsage(node: NameNode) { if (this._fileInfo.diagnosticRuleSet.reportPrivateUsage === 'none') { return; @@ -3601,44 +4100,70 @@ export class Checker extends ParseTreeWalker { }); } - private _validateStrictTypeGuardFunction(node: FunctionNode, functionType: FunctionType, isMethod: boolean) { - // Is this a strict type guard function? - if (!functionType.details.declaredReturnType) { + private _validateTypeGuardFunction(node: FunctionNode, functionType: FunctionType, isMethod: boolean) { + const returnType = functionType.details.declaredReturnType; + if (!returnType) { return; } - if ( - !isClassInstance(functionType.details.declaredReturnType) || - !ClassType.isBuiltIn(functionType.details.declaredReturnType, 'StrictTypeGuard') || - !functionType.details.declaredReturnType.typeArguments || - functionType.details.declaredReturnType.typeArguments.length < 1 - ) { + if (!isClassInstance(returnType) || !returnType.typeArguments || returnType.typeArguments.length < 1) { return; } - const typeGuardType = functionType.details.declaredReturnType.typeArguments[0]; + const isNormalTypeGuard = ClassType.isBuiltIn(returnType, 'TypeGuard'); + const isStrictTypeGuard = ClassType.isBuiltIn(returnType, 'StrictTypeGuard'); - // Determine the type of the first parameter. - const paramIndex = isMethod && !FunctionType.isStaticMethod(functionType) ? 1 : 0; - if (paramIndex >= functionType.details.parameters.length) { + if (!isNormalTypeGuard && !isStrictTypeGuard) { return; } - const paramType = FunctionType.getEffectiveParameterType(functionType, paramIndex); + // Make sure there's at least one input parameter provided. + let paramCount = functionType.details.parameters.length; + if (isMethod) { + if ( + FunctionType.isInstanceMethod(functionType) || + FunctionType.isConstructorMethod(functionType) || + FunctionType.isClassMethod(functionType) + ) { + paramCount--; + } + } - // Verify that the typeGuardType is a narrower type than the paramType. - if (!this._evaluator.assignType(paramType, typeGuardType)) { - const returnAnnotation = node.returnTypeAnnotation || node.functionAnnotationComment?.returnTypeAnnotation; - if (returnAnnotation) { - this._evaluator.addDiagnostic( - this._fileInfo.diagnosticRuleSet.reportGeneralTypeIssues, - DiagnosticRule.reportGeneralTypeIssues, - Localizer.Diagnostic.strictTypeGuardReturnType().format({ - type: this._evaluator.printType(paramType), - returnType: this._evaluator.printType(typeGuardType), - }), - returnAnnotation - ); + if (paramCount < 1) { + this._evaluator.addDiagnostic( + this._fileInfo.diagnosticRuleSet.reportGeneralTypeIssues, + DiagnosticRule.reportGeneralTypeIssues, + Localizer.Diagnostic.typeGuardParamCount(), + node.name + ); + } + + if (isStrictTypeGuard) { + const typeGuardType = returnType.typeArguments[0]; + + // Determine the type of the first parameter. + const paramIndex = isMethod && !FunctionType.isStaticMethod(functionType) ? 1 : 0; + if (paramIndex >= functionType.details.parameters.length) { + return; + } + + const paramType = FunctionType.getEffectiveParameterType(functionType, paramIndex); + + // Verify that the typeGuardType is a narrower type than the paramType. + if (!this._evaluator.assignType(paramType, typeGuardType)) { + const returnAnnotation = + node.returnTypeAnnotation || node.functionAnnotationComment?.returnTypeAnnotation; + if (returnAnnotation) { + this._evaluator.addDiagnostic( + this._fileInfo.diagnosticRuleSet.reportGeneralTypeIssues, + DiagnosticRule.reportGeneralTypeIssues, + Localizer.Diagnostic.strictTypeGuardReturnType().format({ + type: this._evaluator.printType(paramType), + returnType: this._evaluator.printType(typeGuardType), + }), + returnAnnotation + ); + } } } } @@ -3705,7 +4230,7 @@ export class Checker extends ParseTreeWalker { this._fileInfo.diagnosticRuleSet.reportUnknownVariableType, DiagnosticRule.reportUnknownVariableType, Localizer.Diagnostic.declaredReturnTypePartiallyUnknown().format({ - returnType: this._evaluator.printType(declaredReturnType, /* expandTypeAlias */ true), + returnType: this._evaluator.printType(declaredReturnType, { expandTypeAlias: true }), }), returnAnnotation ); @@ -3766,10 +4291,7 @@ export class Checker extends ParseTreeWalker { this._fileInfo.diagnosticRuleSet.reportGeneralTypeIssues, DiagnosticRule.reportGeneralTypeIssues, Localizer.Diagnostic.returnMissing().format({ - returnType: this._evaluator.printType( - declaredReturnType, - /* expandTypeAlias */ false - ), + returnType: this._evaluator.printType(declaredReturnType), }) + diagAddendum.getString(), returnAnnotation ); @@ -3791,7 +4313,7 @@ export class Checker extends ParseTreeWalker { this._fileInfo.diagnosticRuleSet.reportUnknownParameterType, DiagnosticRule.reportUnknownParameterType, Localizer.Diagnostic.returnTypePartiallyUnknown().format({ - returnType: this._evaluator.printType(inferredReturnType, /* expandTypeAlias */ true), + returnType: this._evaluator.printType(inferredReturnType, { expandTypeAlias: true }), }), node.name ); @@ -3807,7 +4329,7 @@ export class Checker extends ParseTreeWalker { if ( parentSymbol && isInstantiableClass(parentSymbol.classType) && - isFinalVariable(parentSymbol.symbol) && + this._evaluator.isFinalVariable(parentSymbol.symbol) && !SymbolNameUtils.isPrivateName(name) ) { const decl = localSymbol.getDeclarations()[0]; @@ -3899,7 +4421,12 @@ export class Checker extends ParseTreeWalker { } } } else if (decls[0].type === DeclarationType.Function) { - if (ParseTreeUtils.isSuiteEmpty(decls[0].node.suite) && decls[0]) { + if ( + decls.every( + (decl) => + decl.type !== DeclarationType.Function || ParseTreeUtils.isSuiteEmpty(decl.node.suite) + ) + ) { if (getFileExtension(decls[0].path).toLowerCase() !== '.pyi') { if (!isSymbolImplemented(name)) { diagAddendum.addMessage( @@ -4006,7 +4533,7 @@ export class Checker extends ParseTreeWalker { const param = paramListDetails.params[paramIndex].param; if (param.hasDeclaredType && param.typeAnnotation) { - const fieldType = this._evaluator.getDeclaredTypeOfSymbol(symbol); + const fieldType = this._evaluator.getDeclaredTypeOfSymbol(symbol)?.type; const paramType = FunctionType.getEffectiveParameterType( postInitType, paramListDetails.params[paramIndex].index @@ -4090,6 +4617,11 @@ export class Checker extends ParseTreeWalker { // Reports the case where an instance variable is not declared or initialized // within the class body or constructor method. private _validateInstanceVariableInitialization(classType: ClassType) { + // This check doesn't apply to stub files. + if (this._fileInfo.isStubFile) { + return; + } + // This check can be expensive, so don't perform it if the corresponding // rule is disabled. if (this._fileInfo.diagnosticRuleSet.reportUninitializedInstanceVariable === 'none') { @@ -4535,7 +5067,7 @@ export class Checker extends ParseTreeWalker { } // Build maps of symbols for each of the base classes. - const symbolMaps = baseClasses.map((baseClass) => { + const baseClassSymbolMaps = baseClasses.map((baseClass) => { const specializedBaseClass = classType.details.mro.find( (c) => isClass(c) && ClassType.isSameGenericClass(c, baseClass) ); @@ -4547,51 +5079,59 @@ export class Checker extends ParseTreeWalker { return getClassFieldsRecursive(specializedBaseClass); }); - for (let symbolMapBaseIndex = 1; symbolMapBaseIndex < symbolMaps.length; symbolMapBaseIndex++) { - const baseSymbolMap = symbolMaps[symbolMapBaseIndex]; + const childClassSymbolMap = getClassFieldsRecursive(classType); - for (const [name, baseClassAndSymbol] of baseSymbolMap) { + for (let symbolMapBaseIndex = 1; symbolMapBaseIndex < baseClassSymbolMaps.length; symbolMapBaseIndex++) { + const baseSymbolMap = baseClassSymbolMaps[symbolMapBaseIndex]; + + for (const [name, overriddenClassAndSymbol] of baseSymbolMap) { // Special-case dundered methods, which can differ in signature. Also // exempt private symbols. if (SymbolNameUtils.isDunderName(name) || SymbolNameUtils.isPrivateName(name)) { continue; } - const baseClassType = baseClassAndSymbol.classType; - if (!isClass(baseClassType)) { + const overriddenClassType = overriddenClassAndSymbol.classType; + if (!isClass(overriddenClassType)) { continue; } - for (let overrideIndex = 0; overrideIndex < symbolMapBaseIndex; overrideIndex++) { - const overrideSymbolMap = symbolMaps[overrideIndex]; - const overrideClassAndSymbol = overrideSymbolMap.get(name); - - if (overrideClassAndSymbol) { - this._validateMultipleInheritanceOverride( - baseClassAndSymbol, - overrideClassAndSymbol, - classType, - name, - baseClasses[symbolMapBaseIndex], - baseClasses[overrideIndex], - errorNode - ); + const overrideClassAndSymbol = childClassSymbolMap.get(name); + + if (overrideClassAndSymbol) { + const overrideClassType = overrideClassAndSymbol.classType; + + // If the override is the same as the overridden, then there's nothing + // to check. If the override is the child class, then we can also skip + // the check because the normal override checks will report the error. + if ( + !isClass(overrideClassType) || + ClassType.isSameGenericClass(overrideClassType, overriddenClassType) || + ClassType.isSameGenericClass(overrideClassType, classType) + ) { + continue; } + + this._validateMultipleInheritanceOverride( + overriddenClassAndSymbol, + overrideClassAndSymbol, + classType, + name, + errorNode + ); } } } } private _validateMultipleInheritanceOverride( - baseClassAndSymbol: ClassMember, + overriddenClassAndSymbol: ClassMember, overrideClassAndSymbol: ClassMember, childClassType: ClassType, memberName: string, - baseClass1: ClassType, - baseClass2: ClassType, errorNode: ParseNode ) { - if (!isClass(baseClassAndSymbol.classType) || !isClass(overrideClassAndSymbol.classType)) { + if (!isClass(overriddenClassAndSymbol.classType) || !isClass(overrideClassAndSymbol.classType)) { return; } @@ -4601,18 +5141,23 @@ export class Checker extends ParseTreeWalker { return; } - let baseType = this._evaluator.getEffectiveTypeOfSymbol(baseClassAndSymbol.symbol); - baseType = partiallySpecializeType(baseType, baseClassAndSymbol.classType); + let overriddenType = this._evaluator.getEffectiveTypeOfSymbol(overriddenClassAndSymbol.symbol); + overriddenType = partiallySpecializeType(overriddenType, overriddenClassAndSymbol.classType); const overrideSymbol = overrideClassAndSymbol.symbol; let overrideType = this._evaluator.getEffectiveTypeOfSymbol(overrideSymbol); overrideType = partiallySpecializeType(overrideType, overrideClassAndSymbol.classType); + const childOverrideSymbol = childClassType.details.fields.get(memberName); + const childOverrideType = childOverrideSymbol + ? this._evaluator.getEffectiveTypeOfSymbol(childOverrideSymbol) + : undefined; + let diag: Diagnostic | undefined; const overrideDecl = getLastTypedDeclaredForSymbol(overrideClassAndSymbol.symbol); - const baseDecl = getLastTypedDeclaredForSymbol(baseClassAndSymbol.symbol); + const overriddenDecl = getLastTypedDeclaredForSymbol(overriddenClassAndSymbol.symbol); - if (isFunction(baseType) || isOverloadedFunction(baseType)) { + if (isFunction(overriddenType) || isOverloadedFunction(overriddenType)) { const diagAddendum = new DiagnosticAddendum(); let overrideFunction: FunctionType | undefined; @@ -4631,7 +5176,7 @@ export class Checker extends ParseTreeWalker { if (overrideFunction) { if ( !this._evaluator.validateOverrideMethod( - baseType, + overriddenType, overrideFunction, diagAddendum, /* enforceParamNameMatch */ true @@ -4651,7 +5196,7 @@ export class Checker extends ParseTreeWalker { } } } - } else if (isProperty(baseType)) { + } else if (isProperty(overriddenType)) { // Handle properties specially. if (!isProperty(overrideType) && !isAnyOrUnknown(overrideType)) { const decls = overrideSymbol.getDeclarations(); @@ -4673,37 +5218,42 @@ export class Checker extends ParseTreeWalker { // This check can be expensive, so don't perform it if the corresponding // rule is disabled. if (this._fileInfo.diagnosticRuleSet.reportIncompatibleVariableOverride !== 'none') { - if (!isAnyOrUnknown(baseType) && !isAnyOrUnknown(overrideType) && !isTypeSame(baseType, overrideType)) { - diag = this._evaluator.addDiagnostic( - this._fileInfo.diagnosticRuleSet.reportIncompatibleVariableOverride, - DiagnosticRule.reportIncompatibleVariableOverride, - Localizer.Diagnostic.baseClassVariableTypeIncompatible().format({ - classType: childClassType.details.name, - name: memberName, - }), - errorNode - ); + if (!isAnyOrUnknown(overriddenType) && !isAnyOrUnknown(overrideType)) { + // If the child class overrides this symbol with its own type, make sure + // the override is compatible with the overridden symbol. Otherwise use the + // override type. + if (!this._evaluator.assignType(overriddenType, childOverrideType ?? overrideType)) { + diag = this._evaluator.addDiagnostic( + this._fileInfo.diagnosticRuleSet.reportIncompatibleVariableOverride, + DiagnosticRule.reportIncompatibleVariableOverride, + Localizer.Diagnostic.baseClassVariableTypeIncompatible().format({ + classType: childClassType.details.name, + name: memberName, + }), + errorNode + ); + } } } } - if (diag && overrideDecl && baseDecl) { + if (diag && overrideDecl && overriddenDecl) { diag.addRelatedInfo( - Localizer.DiagnosticAddendum.baseClassProvidesType().format({ - baseClass: this._evaluator.printType(convertToInstance(baseClass1)), - type: this._evaluator.printType(overrideType), + Localizer.DiagnosticAddendum.baseClassOverriddenType().format({ + baseClass: this._evaluator.printType(convertToInstance(overriddenClassAndSymbol.classType)), + type: this._evaluator.printType(overriddenType), }), - overrideDecl.path, - overrideDecl.range + overriddenDecl.path, + overriddenDecl.range ); diag.addRelatedInfo( - Localizer.DiagnosticAddendum.baseClassProvidesType().format({ - baseClass: this._evaluator.printType(convertToInstance(baseClass2)), - type: this._evaluator.printType(baseType), + Localizer.DiagnosticAddendum.baseClassOverridesType().format({ + baseClass: this._evaluator.printType(convertToInstance(overrideClassAndSymbol.classType)), + type: this._evaluator.printType(overrideType), }), - baseDecl.path, - baseDecl.range + overrideDecl.path, + overrideDecl.range ); } } @@ -4722,7 +5272,7 @@ export class Checker extends ParseTreeWalker { // If the symbol has no declaration, and the type is inferred, // skip this check. - if (!symbol.hasTypedDeclarations() && !isFinalVariable(symbol)) { + if (!symbol.hasTypedDeclarations() && !this._evaluator.isFinalVariable(symbol)) { return; } @@ -4734,6 +5284,8 @@ export class Checker extends ParseTreeWalker { return; } + let firstOverride: ClassMember | undefined; + for (const baseClass of classType.details.baseClasses) { if (!isClass(baseClass)) { continue; @@ -4753,11 +5305,99 @@ export class Checker extends ParseTreeWalker { continue; } + firstOverride = firstOverride ?? baseClassAndSymbol; + this._validateBaseClassOverride(baseClassAndSymbol, symbol, typeOfSymbol, classType, name); } + + if (!firstOverride) { + // If this is a method decorated with @override, validate that there + // is a base class method of the same name. + this._validateOverrideDecoratorNotPresent(typeOfSymbol); + } else { + this._validateOverrideDecoratorPresent(typeOfSymbol, firstOverride); + } }); } + private _validateOverrideDecoratorPresent(overrideType: Type, baseMember: ClassMember) { + // Skip this check if disabled. + if (this._fileInfo.diagnosticRuleSet.reportImplicitOverride === 'none') { + return; + } + + let overrideFunction: FunctionType | undefined; + + if (isFunction(overrideType)) { + overrideFunction = overrideType; + } else if (isOverloadedFunction(overrideType)) { + overrideFunction = OverloadedFunctionType.getImplementation(overrideType); + } else if (isClassInstance(overrideType) && ClassType.isPropertyClass(overrideType)) { + const fgetSymbol = overrideType.details.fields.get('fget'); + + if (fgetSymbol) { + const fgetType = this._evaluator.getDeclaredTypeOfSymbol(fgetSymbol)?.type; + if (fgetType && isFunction(fgetType)) { + overrideFunction = fgetType; + } + } + } + + if (!overrideFunction?.details.declaration || FunctionType.isOverridden(overrideFunction)) { + return; + } + + // Constructors are exempt. + if (overrideFunction.details.name === '__init__' || overrideFunction.details.name === '__new__') { + return; + } + + const funcNode = overrideFunction.details.declaration.node; + this._evaluator.addDiagnostic( + this._fileInfo.diagnosticRuleSet.reportImplicitOverride, + DiagnosticRule.reportImplicitOverride, + Localizer.Diagnostic.overrideDecoratorMissing().format({ + name: funcNode.name.value, + className: this._evaluator.printType(convertToInstance(baseMember.classType)), + }), + funcNode.name + ); + } + + // Determines whether the type is a function or overloaded function with an @override + // decorator. In this case, an error is reported because no base class has declared + // a method of the same name. + private _validateOverrideDecoratorNotPresent(overrideType: Type) { + let overrideFunction: FunctionType | undefined; + + if (isFunction(overrideType)) { + overrideFunction = overrideType; + } else if (isOverloadedFunction(overrideType)) { + overrideFunction = OverloadedFunctionType.getImplementation(overrideType); + } else if (isClassInstance(overrideType) && ClassType.isPropertyClass(overrideType)) { + const fgetSymbol = overrideType.details.fields.get('fget'); + + if (fgetSymbol) { + const fgetType = this._evaluator.getDeclaredTypeOfSymbol(fgetSymbol)?.type; + if (fgetType && isFunction(fgetType)) { + overrideFunction = fgetType; + } + } + } + + if (!overrideFunction?.details.declaration || !FunctionType.isOverridden(overrideFunction)) { + return; + } + + const funcNode = overrideFunction.details.declaration.node; + this._evaluator.addDiagnostic( + this._fileInfo.diagnosticRuleSet.reportGeneralTypeIssues, + DiagnosticRule.reportGeneralTypeIssues, + Localizer.Diagnostic.overriddenMethodNotFound().format({ name: funcNode.name.value }), + funcNode.name + ); + } + private _validateBaseClassOverride( baseClassAndSymbol: ClassMember, overrideSymbol: Symbol, @@ -4876,7 +5516,7 @@ export class Checker extends ParseTreeWalker { Localizer.Diagnostic.methodOverridden().format({ name: memberName, className: baseClassAndSymbol.classType.details.name, - type: this._evaluator.printType(overrideType, /* expandTypeAlias */ false), + type: this._evaluator.printType(overrideType), }), lastDecl.node ); @@ -5030,8 +5670,8 @@ export class Checker extends ParseTreeWalker { } // Verify that there is not a Final mismatch. - const isBaseVarFinal = isFinalVariable(baseClassAndSymbol.symbol); - const overrideFinalVarDecl = decls.find((d) => isFinalVariableDeclaration(d)); + const isBaseVarFinal = this._evaluator.isFinalVariable(baseClassAndSymbol.symbol); + const overrideFinalVarDecl = decls.find((d) => this._evaluator.isFinalVariableDeclaration(d)); if (!isBaseVarFinal && overrideFinalVarDecl) { const diag = this._evaluator.addDiagnostic( @@ -5128,7 +5768,9 @@ export class Checker extends ParseTreeWalker { if ( node.parameters.length === 0 || !node.parameters[0].name || - !['cls', '_cls', '__cls', '__mcls'].some((name) => node.parameters[0].name!.value === name) + !['cls', '_cls', '__cls', '__mcls', 'mcls', 'mcs'].some( + (name) => node.parameters[0].name!.value === name + ) ) { this._evaluator.addDiagnostic( this._fileInfo.diagnosticRuleSet.reportSelfClsParameterName, @@ -5207,9 +5849,13 @@ export class Checker extends ParseTreeWalker { this._validateClsSelfParameterType(functionType, classType, /* isCls */ true); } } else { + const decoratorIsPresent = node.decorators.length > 0; + const isOverloaded = FunctionType.isOverloaded(functionType); + // The presence of a decorator can change the behavior, so we need - // to back off from this check if a decorator is present. - if (node.decorators.length === 0) { + // to back off from this check if a decorator is present. An overload + // is a decorator, but we'll ignore that here. + if (isOverloaded || !decoratorIsPresent) { let paramName = ''; let firstParamIsSimple = true; if (node.parameters.length > 0) { @@ -5224,9 +5870,9 @@ export class Checker extends ParseTreeWalker { // Instance methods should have a "self" parameter. if (firstParamIsSimple && paramName !== 'self') { - // Special-case metaclasses, which can use "cls". + // Special-case metaclasses, which can use "cls" or several variants. let isLegalMetaclassName = false; - if (paramName === 'cls') { + if (['cls', 'mcls', 'mcs'].some((name) => name === paramName)) { const classTypeInfo = this._evaluator.getTypeOfClass(classNode); const typeType = this._evaluator.getBuiltInType(classNode, 'type'); if ( @@ -5362,22 +6008,20 @@ export class Checker extends ParseTreeWalker { return; } - // Don't enforce this for an overloaded method because the "self" param - // annotation can be used as a filter for the overload. - if (FunctionType.isOverloaded(functionType)) { - return; - } - - if (!this._evaluator.assignType(paramType, expectedType)) { - this._evaluator.addDiagnostic( - this._fileInfo.diagnosticRuleSet.reportGeneralTypeIssues, - DiagnosticRule.reportGeneralTypeIssues, - Localizer.Diagnostic.clsSelfParamTypeMismatch().format({ - name: paramInfo.name, - classType: this._evaluator.printType(expectedType, /* expandTypeAlias */ false), - }), - paramInfo.typeAnnotation - ); + const typeVarContext = new TypeVarContext(getTypeVarScopeId(functionType)); + if (!this._evaluator.assignType(paramType, expectedType, /* diag */ undefined, typeVarContext)) { + // We exempt Never from this check because it has a legitimate use in this case. + if (!isNever(paramType)) { + this._evaluator.addDiagnostic( + this._fileInfo.diagnosticRuleSet.reportGeneralTypeIssues, + DiagnosticRule.reportGeneralTypeIssues, + Localizer.Diagnostic.clsSelfParamTypeMismatch().format({ + name: paramInfo.name, + classType: this._evaluator.printType(expectedType), + }), + paramInfo.typeAnnotation + ); + } } } @@ -5423,8 +6067,8 @@ export class Checker extends ParseTreeWalker { this._fileInfo.diagnosticRuleSet.reportGeneralTypeIssues, DiagnosticRule.reportGeneralTypeIssues, Localizer.Diagnostic.yieldTypeMismatch().format({ - exprType: this._evaluator.printType(yieldType, /* expandTypeAlias */ false), - yieldType: this._evaluator.printType(declaredYieldType, /* expandTypeAlias */ false), + exprType: this._evaluator.printType(yieldType), + yieldType: this._evaluator.printType(declaredYieldType), }) + diagAddendum.getString(), node.expression || node ); @@ -5462,8 +6106,11 @@ export class Checker extends ParseTreeWalker { typesOfThisExcept.push(exceptionType); } else if (isClassInstance(exceptionType)) { const iterableType = - this._evaluator.getTypeOfIterator(exceptionType, /* isAsync */ false, /* errorNode */ undefined) || - UnknownType.create(); + this._evaluator.getTypeOfIterator( + { type: exceptionType }, + /* isAsync */ false, + /* errorNode */ undefined + )?.type ?? UnknownType.create(); doForEachSubtype(iterableType, (subtype) => { if (isAnyOrUnknown(subtype)) { @@ -5562,139 +6209,36 @@ export class Checker extends ParseTreeWalker { } }); } -} - -class MissingModuleSourceReporter extends ParseTreeWalker { - static report( - importResolver: ImportResolver, - evaluator: TypeEvaluator, - fileInfo: AnalyzerFileInfo, - node: ModuleNode - ) { - if (fileInfo.isStubFile) { - // Don't report this for stub files. - return; - } - - new MissingModuleSourceReporter(importResolver, evaluator, fileInfo).walk(node); - } - - private constructor( - private _importResolver: ImportResolver, - private _evaluator: TypeEvaluator, - private _fileInfo: AnalyzerFileInfo - ) { - super(); - } - - override visitNode(node: ParseNode): ParseNodeArray { - // Optimization. don't walk into expressions which can't - // have import statement as child nodes. - if (isExpressionNode(node)) { - return []; - } - - return super.visitNode(node); - } - - override visitModule(node: ModuleNode): boolean { - const codeComplexity = AnalyzerNodeInfo.getCodeFlowComplexity(node); - - if (isPrintCodeComplexityEnabled) { - console.log(`Code complexity of module ${this._fileInfo.filePath} is ${codeComplexity.toString()}`); - } - - if (codeComplexity > maxCodeComplexity) { - this._evaluator.addDiagnosticForTextRange( - this._fileInfo, - this._fileInfo.diagnosticRuleSet.reportGeneralTypeIssues, - DiagnosticRule.reportGeneralTypeIssues, - Localizer.Diagnostic.codeTooComplexToAnalyze(), - { start: 0, length: 0 } - ); - return false; - } - - return true; - } - override visitModuleName(node: ModuleNameNode): boolean { - const importResult = AnalyzerNodeInfo.getImportInfo(node); - assert(importResult !== undefined); + private _checkRegions() { + const regionComments = getRegionComments(this._parseResults); + const regionStack: RegionComment[] = []; - this._addMissingModuleSourceDiagnosticIfNeeded(importResult, node); - return false; - } - - override visitImportFromAs(node: ImportFromAsNode): boolean { - const decls = this._evaluator.getDeclarationsForNameNode(node.name); - if (!decls) { - return false; - } - - for (const decl of decls) { - if (!isAliasDeclaration(decl) || !decl.submoduleFallback || decl.node !== node) { - // If it is not implicitly imported module, move to next. - continue; - } - - const resolvedAlias = this._evaluator.resolveAliasDeclaration(decl, /* resolveLocalNames */ true); - if (!resolvedAlias?.path || !isStubFile(resolvedAlias.path)) { - continue; - } - - const importResult = this._getImportResult(node, resolvedAlias.path); - if (!importResult) { - continue; + regionComments.forEach((regionComment) => { + if (regionComment.type === RegionCommentType.Region) { + regionStack.push(regionComment); + } else { + if (regionStack.length > 0) { + regionStack.pop(); + } else { + this._addDiagnosticForRegionComment( + regionComment, + Localizer.Diagnostic.unmatchedEndregionComment() + ); + } } + }); - this._addMissingModuleSourceDiagnosticIfNeeded(importResult, node.name); - break; - } - - return false; - } - - private _getImportResult(node: ImportFromAsNode, filePath: string) { - const execEnv = this._importResolver.getConfigOption().findExecEnvironment(filePath); - const moduleNameNode = (node.parent as ImportFromNode).module; - - // Handle both absolute and relative imports. - const moduleName = - moduleNameNode.leadingDots === 0 - ? this._importResolver.getModuleNameForImport(filePath, execEnv).moduleName - : getRelativeModuleName(this._importResolver.fileSystem, this._fileInfo.filePath, filePath); - - if (!moduleName) { - return undefined; - } - - return this._importResolver.resolveImport( - this._fileInfo.filePath, - execEnv, - createImportedModuleDescriptor(moduleName) - ); + regionStack.forEach((regionComment) => { + this._addDiagnosticForRegionComment(regionComment, Localizer.Diagnostic.unmatchedRegionComment()); + }); } - private _addMissingModuleSourceDiagnosticIfNeeded(importResult: ImportResult, node: ParseNode) { - if ( - importResult.isNativeLib || - !importResult.isStubFile || - importResult.importType === ImportType.BuiltIn || - !importResult.nonStubImportResult || - importResult.nonStubImportResult.isImportFound - ) { - return; - } - - // Type stub found, but source is missing. - this._evaluator.addDiagnostic( - this._fileInfo.diagnosticRuleSet.reportMissingModuleSource, - DiagnosticRule.reportMissingModuleSource, - Localizer.Diagnostic.importSourceResolveFailure().format({ - importName: importResult.importName, - }), - node - ); + private _addDiagnosticForRegionComment(regionComment: RegionComment, message: string): Diagnostic | undefined { + return this._evaluator.addDiagnosticForTextRange(this._fileInfo, 'error', '', message, { + // extend range to include # character + start: regionComment.comment.start - 1, + length: regionComment.comment.length + 1, + }); } } diff --git a/packages/pyright-internal/src/analyzer/codeFlowEngine.ts b/packages/pyright-internal/src/analyzer/codeFlowEngine.ts index 96b77b65b..8bea7ae3f 100644 --- a/packages/pyright-internal/src/analyzer/codeFlowEngine.ts +++ b/packages/pyright-internal/src/analyzer/codeFlowEngine.ts @@ -11,6 +11,7 @@ * TypeScript compiler. */ +import { ConsoleInterface } from '../common/console'; import { assert, fail } from '../common/debug'; import { convertOffsetToPosition } from '../common/positionUtils'; import { ArgumentCategory, ExpressionNode, ParseNode, ParseNodeType } from '../parser/parseNodes'; @@ -36,19 +37,13 @@ import { } from './codeFlowTypes'; import { formatControlFlowGraph } from './codeFlowUtils'; import { isMatchingExpression, isPartialMatchingExpression, printExpression } from './parseTreeUtils'; -import { - CachedType, - IncompleteSubtypeInfo, - IncompleteType, - isIncompleteType, - SpeculativeTypeTracker, - TypeCache, -} from './typeCache'; +import { SpeculativeTypeTracker } from './typeCacheUtils'; import { narrowForKeyAssignment } from './typedDicts'; import { EvaluatorFlags, TypeEvaluator, TypeResult } from './typeEvaluatorTypes'; import { getTypeNarrowingCallback } from './typeGuards'; import { ClassType, + cleanIncompleteUnknown, combineTypes, FunctionType, isClass, @@ -62,7 +57,6 @@ import { maxTypeRecursionCount, NeverType, OverloadedFunctionType, - removeIncompleteUnknownFromUnion, Type, TypeVarType, UnboundType, @@ -71,6 +65,7 @@ import { import { ClassMemberLookupFlags, doForEachSubtype, + isIncompleteUnknown, isTypeAliasPlaceholder, lookUpClassMember, mapSubtypes, @@ -84,14 +79,19 @@ export interface FlowNodeTypeResult { incompleteSubtypes?: IncompleteSubtypeInfo[] | undefined; } +export interface FlowNodeTypeOptions { + isTypeAtStartIncomplete?: boolean; + skipNoReturnCallAnalysis?: boolean; + skipConditionalNarrowing?: boolean; +} + export interface CodeFlowAnalyzer { getTypeFromCodeFlow: ( flowNode: FlowNode, reference: CodeFlowReferenceExpressionNode | undefined, targetSymbolId: number | undefined, - initialType: Type | undefined, - isInitialTypeIncomplete: boolean, - ignoreNoReturn: boolean + typeAtStart: Type, + options?: FlowNodeTypeOptions ) => FlowNodeTypeResult; } @@ -99,18 +99,65 @@ export interface CodeFlowEngine { createCodeFlowAnalyzer: () => CodeFlowAnalyzer; isFlowNodeReachable: (flowNode: FlowNode, sourceFlowNode?: FlowNode, ignoreNoReturn?: boolean) => boolean; narrowConstrainedTypeVar: (flowNode: FlowNode, typeVar: TypeVarType) => Type | undefined; + printControlFlowGraph: ( + flowNode: FlowNode, + reference: CodeFlowReferenceExpressionNode | undefined, + callName: string, + logger: ConsoleInterface + ) => void; +} + +export interface IncompleteSubtypeInfo { + type: Type; + isIncomplete: boolean; + isPending: boolean; + evaluationCount: number; +} + +export interface IncompleteType { + isIncompleteType?: true; + + // Type computed so far + type: Type | undefined; + + // Array of incomplete subtypes that have been computed so far + // (used for loops) + incompleteSubtypes: IncompleteSubtypeInfo[]; + + // Tracks whether something has changed since this cache entry + // was written that might change the incomplete type; if this + // doesn't match the global "incomplete generation count", this + // cached value is stale + generationCount: number; + + // Indicates that the cache entry represents a sentinel + // value used to detect and prevent recursion. + isRecursionSentinel?: boolean; } +// Define a user type guard function for IncompleteType. +export function isIncompleteType(cachedType: CachedType): cachedType is IncompleteType { + return !!(cachedType as IncompleteType).isIncompleteType; +} + +export type CachedType = Type | IncompleteType; + interface CodeFlowTypeCache { - cache: TypeCache; + cache: Map; pendingNodes: Set; } // This debugging option prints the control flow graph when getTypeFromCodeFlow is called. -const isPrintControlFlowGraphEnabled = false; +const enablePrintControlFlowGraph = false; // This debugging option prints the results of calls to isCallNoReturn. -const isPrintCallNoReturnEnabled = false; +const enablePrintCallNoReturn = false; + +// Should the code flow engine assume that an unannotated function does not have +// an inferred return type of `NoReturn`, or should it perform code flow analysis +// to determine whether it is `NoReturn`? Enabling this produces more consistent +// and complete results, but it can be very expensive. +const inferNoReturnForUnannotatedFunctions = false; export function getCodeFlowEngine( evaluator: TypeEvaluator, @@ -142,15 +189,18 @@ export function getCodeFlowEngine( return flowNodeTypeCache; } + // This function has two primary modes. The first is used to determine + // the narrowed type of a reference expression based on code flow analysis. + // The second (when reference is undefined) is used to determine whether + // the specified flowNode is reachable when "never narrowing" is applied. function getTypeFromCodeFlow( flowNode: FlowNode, reference: CodeFlowReferenceExpressionNode | undefined, targetSymbolId: number | undefined, - initialType: Type | undefined, - isInitialTypeIncomplete: boolean, - ignoreNoReturn: boolean + typeAtStart: Type, + options?: FlowNodeTypeOptions ): FlowNodeTypeResult { - if (isPrintControlFlowGraphEnabled) { + if (enablePrintControlFlowGraph) { printControlFlowGraph(flowNode, reference, 'getTypeFromCodeFlow'); } @@ -211,7 +261,7 @@ export function getCodeFlowEngine( function setIncompleteSubtype( flowNode: FlowNode, index: number, - type: Type | undefined, + type: Type, isIncomplete: boolean, isPending: boolean, evaluationCount: number @@ -224,12 +274,7 @@ export function getCodeFlowEngine( const incompleteEntries = cachedEntry.incompleteSubtypes; if (index < incompleteEntries.length) { const oldEntry = incompleteEntries[index]; - if ( - oldEntry.isIncomplete !== isIncomplete || - oldEntry.type === undefined || - type === undefined || - !isTypeSame(oldEntry.type, type) - ) { + if (oldEntry.isIncomplete !== isIncomplete || !isTypeSame(oldEntry.type, type)) { incompleteEntries[index] = { type, isIncomplete, isPending, evaluationCount }; flowIncompleteGeneration++; } else if (oldEntry.isPending !== isPending) { @@ -241,9 +286,30 @@ export function getCodeFlowEngine( flowIncompleteGeneration++; } + let combinedType: Type | undefined; + if (cachedEntry.incompleteSubtypes.length > 0) { + // Recompute the effective type based on all of the incomplete + // types we've accumulated so far. + const typesToCombine: Type[] = []; + + cachedEntry.incompleteSubtypes.forEach((t) => { + if (t.type) { + typesToCombine.push(t.type); + } + }); + + combinedType = typesToCombine.length > 0 ? combineTypes(typesToCombine) : undefined; + } + + cachedEntry.type = combinedType; + cachedEntry.generationCount = flowIncompleteGeneration; + return getCacheEntry(flowNode); } + // Cache either contains a type or an object that represents an incomplete type. + // Incomplete types are types that haven't gone through all flow nodes yet. + // Incomplete only happens for branch and loop nodes. function getCacheEntry(flowNode: FlowNode): FlowNodeTypeResult | undefined { if (!flowNodeTypeCache.cache.has(flowNode.id)) { return undefined; @@ -251,35 +317,15 @@ export function getCodeFlowEngine( const cachedEntry = flowNodeTypeCache.cache.get(flowNode.id); if (cachedEntry === undefined) { - return { - type: cachedEntry, - isIncomplete: false, - }; + return { type: undefined, isIncomplete: false }; } if (!isIncompleteType(cachedEntry)) { - return { - type: cachedEntry, - isIncomplete: false, - }; - } - - let type = cachedEntry.type; - - if (cachedEntry.incompleteSubtypes.length > 0) { - // Recompute the effective type based on all of the incomplete - // types we've accumulated so far. - const typesToCombine: Type[] = []; - cachedEntry.incompleteSubtypes.forEach((t) => { - if (t.type) { - typesToCombine.push(t.type); - } - }); - type = typesToCombine.length > 0 ? combineTypes(typesToCombine) : undefined; + return { type: cachedEntry, isIncomplete: false }; } return { - type, + type: cachedEntry.type, isIncomplete: true, incompleteSubtypes: cachedEntry.incompleteSubtypes, generationCount: cachedEntry.generationCount, @@ -311,9 +357,14 @@ export function getCodeFlowEngine( flowNodeTypeCache.pendingNodes.add(flowNode.id); try { - return callback(); - } finally { + const result = callback(); + flowNodeTypeCache.pendingNodes.delete(flowNode.id); + return result; + } catch (e) { + // Don't use a "finally" clause here because the TypeScript + // debugger doesn't handle "step out" well with finally clauses. flowNodeTypeCache.pendingNodes.delete(flowNode.id); + throw e; } } @@ -339,13 +390,19 @@ export function getCodeFlowEngine( // If the cached entry is incomplete, we can use it only if nothing // has changed that may cause the previously-reported incomplete type to change. if (cachedEntry.generationCount === flowIncompleteGeneration) { - return { type: cachedEntry.type, isIncomplete: true }; + return { + type: cachedEntry.type ? cleanIncompleteUnknown(cachedEntry.type) : undefined, + isIncomplete: true, + }; } } // Check for recursion. if (flowNodeTypeCache.pendingNodes.has(curFlowNode.id)) { - return { type: cachedEntry?.type, isIncomplete: true }; + return { + type: cachedEntry?.type ?? UnknownType.create(/* isIncomplete */ true), + isIncomplete: true, + }; } if (curFlowNode.flags & FlowFlags.Unreachable) { @@ -366,7 +423,7 @@ export function getCodeFlowEngine( // If this function returns a "NoReturn" type, that means // it always raises an exception or otherwise doesn't return, // so we can assume that the code before this is unreachable. - if (!ignoreNoReturn && isCallNoReturn(evaluator, callFlowNode)) { + if (!options?.skipNoReturnCallAnalysis && isCallNoReturn(evaluator, callFlowNode)) { return setCacheEntry(curFlowNode, /* type */ undefined, /* isIncomplete */ false); } @@ -395,6 +452,7 @@ export function getCodeFlowEngine( let flowTypeResult = preventRecursion(curFlowNode, () => evaluateAssignmentFlowNode(assignmentFlowNode) ); + if (flowTypeResult) { if (isTypeAliasPlaceholder(flowTypeResult.type)) { flowTypeResult = undefined; @@ -405,61 +463,62 @@ export function getCodeFlowEngine( flowTypeResult = undefined; } } + return setCacheEntry(curFlowNode, flowTypeResult?.type, !!flowTypeResult?.isIncomplete); - } else { - // Is this a simple assignment to an index expression? If so, it could - // be assigning to a TypedDict, which requires narrowing of the expression's - // base type. + } + + // Is this a simple assignment to an index expression? If so, it could + // be assigning to a TypedDict, which requires narrowing of the expression's + // base type. + if ( + targetNode.nodeType === ParseNodeType.Index && + isMatchingExpression(reference, targetNode.baseExpression) + ) { if ( - targetNode.nodeType === ParseNodeType.Index && - isMatchingExpression(reference, targetNode.baseExpression) + targetNode.parent?.nodeType === ParseNodeType.Assignment && + targetNode.items.length === 1 && + !targetNode.trailingComma && + !targetNode.items[0].name && + targetNode.items[0].argumentCategory === ArgumentCategory.Simple && + targetNode.items[0].valueExpression.nodeType === ParseNodeType.StringList && + targetNode.items[0].valueExpression.strings.length === 1 && + targetNode.items[0].valueExpression.strings[0].nodeType === ParseNodeType.String ) { - if ( - targetNode.parent?.nodeType === ParseNodeType.Assignment && - targetNode.items.length === 1 && - !targetNode.trailingComma && - !targetNode.items[0].name && - targetNode.items[0].argumentCategory === ArgumentCategory.Simple && - targetNode.items[0].valueExpression.nodeType === ParseNodeType.StringList && - targetNode.items[0].valueExpression.strings.length === 1 && - targetNode.items[0].valueExpression.strings[0].nodeType === ParseNodeType.String - ) { - const keyValue = targetNode.items[0].valueExpression.strings[0].value; - const narrowedResult = preventRecursion(assignmentFlowNode, () => { - const flowTypeResult = getTypeFromFlowNode(assignmentFlowNode.antecedent); - - if (flowTypeResult.type) { - flowTypeResult.type = mapSubtypes(flowTypeResult.type, (subtype) => { - if (isClass(subtype) && ClassType.isTypedDictClass(subtype)) { - return narrowForKeyAssignment(subtype, keyValue); - } - return subtype; - }); - } + const keyValue = targetNode.items[0].valueExpression.strings[0].value; + const narrowedResult = preventRecursion(assignmentFlowNode, () => { + const flowTypeResult = getTypeFromFlowNode(assignmentFlowNode.antecedent); + + if (flowTypeResult.type) { + flowTypeResult.type = mapSubtypes(flowTypeResult.type, (subtype) => { + if (isClass(subtype) && ClassType.isTypedDictClass(subtype)) { + return narrowForKeyAssignment(subtype, keyValue); + } + return subtype; + }); + } - return flowTypeResult; - }); + return flowTypeResult; + }); - return setCacheEntry( - curFlowNode, - narrowedResult?.type, - !!narrowedResult?.isIncomplete - ); - } + return setCacheEntry( + curFlowNode, + narrowedResult?.type, + !!narrowedResult?.isIncomplete + ); } + } - if (isPartialMatchingExpression(reference, targetNode)) { - // If the node partially matches the reference, we need to "kill" any narrowed - // types further above this point. For example, if we see the sequence - // a.b = 3 - // a = Foo() - // x = a.b - // The type of "a.b" can no longer be assumed to be Literal[3]. - return { - type: initialType, - isIncomplete: isInitialTypeIncomplete, - }; - } + if (isPartialMatchingExpression(reference, targetNode)) { + // If the node partially matches the reference, we need to "kill" any narrowed + // types further above this point. For example, if we see the sequence + // a.b = 3 + // a = Foo() + // x = a.b + // The type of "a.b" can no longer be assumed to be Literal[3]. + return { + type: typeAtStart, + isIncomplete: !!options?.isTypeAtStartIncomplete, + }; } } @@ -469,6 +528,7 @@ export function getCodeFlowEngine( if (curFlowNode.flags & FlowFlags.BranchLabel) { const branchFlowNode = curFlowNode as FlowBranchLabel; + if (curFlowNode.flags & FlowFlags.PostContextManager) { // Determine whether any of the context managers support exception // suppression. If not, none of its antecedents are reachable. @@ -527,7 +587,7 @@ export function getCodeFlowEngine( if (curFlowNode.flags & (FlowFlags.TrueCondition | FlowFlags.FalseCondition)) { const conditionalFlowNode = curFlowNode as FlowCondition; - if (reference) { + if (!options?.skipConditionalNarrowing && reference) { const narrowedResult = preventRecursion(curFlowNode, () => { const typeNarrowingCallback = getTypeNarrowingCallback( evaluator, @@ -542,11 +602,20 @@ export function getCodeFlowEngine( if (typeNarrowingCallback) { const flowTypeResult = getTypeFromFlowNode(conditionalFlowNode.antecedent); let flowType = flowTypeResult.type; + let isIncomplete = flowTypeResult.isIncomplete; + if (flowType) { - flowType = typeNarrowingCallback(flowType); + const flowTypeResult = typeNarrowingCallback(flowType); + + if (flowTypeResult) { + flowType = flowTypeResult.type; + if (flowTypeResult.isIncomplete) { + isIncomplete = true; + } + } } - return setCacheEntry(curFlowNode, flowType, flowTypeResult.isIncomplete); + return setCacheEntry(curFlowNode, flowType, isIncomplete); } return undefined; @@ -563,7 +632,7 @@ export function getCodeFlowEngine( if (curFlowNode.flags & (FlowFlags.TrueNeverCondition | FlowFlags.FalseNeverCondition)) { const conditionalFlowNode = curFlowNode as FlowCondition; - if (conditionalFlowNode.reference) { + if (!options?.skipConditionalNarrowing && conditionalFlowNode.reference) { // Don't allow apply if the conditional expression references the expression // we're already narrowing. This case will be handled by the TrueCondition // or FalseCondition node. @@ -576,6 +645,7 @@ export function getCodeFlowEngine( conditionalFlowNode.reference.value, /* honorCodeFlow */ false ); + if (symbolWithScope && symbolWithScope.symbol.getTypedDeclarations().length > 0) { const result = preventRecursion(curFlowNode, () => { const typeNarrowingCallback = getTypeNarrowingCallback( @@ -592,16 +662,21 @@ export function getCodeFlowEngine( const refTypeInfo = evaluator.getTypeOfExpression( conditionalFlowNode.reference! ); - const narrowedType = - typeNarrowingCallback(refTypeInfo.type) || refTypeInfo.type; + + let narrowedType = refTypeInfo.type; + let isIncomplete = !!refTypeInfo.isIncomplete; + + const narrowedTypeResult = typeNarrowingCallback(refTypeInfo.type); + if (narrowedTypeResult) { + narrowedType = narrowedTypeResult.type; + if (narrowedTypeResult.isIncomplete) { + isIncomplete = true; + } + } // If the narrowed type is "never", don't allow further exploration. if (isNever(narrowedType)) { - return setCacheEntry( - curFlowNode, - undefined, - !!refTypeInfo.isIncomplete - ); + return setCacheEntry(curFlowNode, undefined, isIncomplete); } } @@ -614,6 +689,7 @@ export function getCodeFlowEngine( } } } + curFlowNode = conditionalFlowNode.antecedent; continue; } @@ -626,7 +702,11 @@ export function getCodeFlowEngine( // If the narrowed type is "never", don't allow further exploration. if (narrowedTypeResult && isNever(narrowedTypeResult.type)) { - return setCacheEntry(curFlowNode, /* type */ undefined, !!narrowedTypeResult.isIncomplete); + return setCacheEntry( + curFlowNode, + narrowedTypeResult.type, + !!narrowedTypeResult.isIncomplete + ); } curFlowNode = exhaustedMatchFlowNode.antecedent; @@ -671,7 +751,7 @@ export function getCodeFlowEngine( } if (curFlowNode.flags & FlowFlags.Start) { - return setCacheEntry(curFlowNode, initialType, isInitialTypeIncomplete); + return setCacheEntry(curFlowNode, typeAtStart, !!options?.isTypeAtStartIncomplete); } if (curFlowNode.flags & FlowFlags.WildcardImport) { @@ -692,41 +772,31 @@ export function getCodeFlowEngine( // We shouldn't get here. fail('Unexpected flow node flags'); - return setCacheEntry(curFlowNode, /* type */ undefined, /* isIncomplete */ false); } } - function getTypeFromBranchFlowNode(branchNode: FlowLabel) { + function getTypeFromBranchFlowNode(branchNode: FlowLabel): FlowNodeTypeResult { const typesToCombine: Type[] = []; let sawIncomplete = false; - let isProvenReachable = false; return preventRecursion(branchNode, () => { - branchNode.antecedents.forEach((antecedent) => { - // If we're solving for "reachability", and we have now proven - // reachability, there's no reason to do more work. - if (reference === undefined && isProvenReachable) { - return; - } - + for (const antecedent of branchNode.antecedents) { const flowTypeResult = getTypeFromFlowNode(antecedent); - if (flowTypeResult.isIncomplete) { - sawIncomplete = true; + if (reference === undefined && flowTypeResult.type && !isNever(flowTypeResult.type)) { + // If we're solving for "reachability", and we have now proven + // reachability, there's no reason to do more work. + return setCacheEntry(branchNode, typeAtStart, /* isIncomplete */ false); } - if (reference === undefined && flowTypeResult.type !== undefined) { - isProvenReachable = true; + if (flowTypeResult.isIncomplete) { + sawIncomplete = true; } if (flowTypeResult.type) { typesToCombine.push(flowTypeResult.type); } - }); - - if (isProvenReachable) { - return setCacheEntry(branchNode, initialType, /* isIncomplete */ false); } const effectiveType = typesToCombine.length > 0 ? combineTypes(typesToCombine) : undefined; @@ -735,133 +805,172 @@ export function getCodeFlowEngine( }); } - function getTypeFromLoopFlowNode(loopNode: FlowLabel, cacheEntry: FlowNodeTypeResult | undefined) { + function getTypeFromLoopFlowNode( + loopNode: FlowLabel, + cacheEntry: FlowNodeTypeResult | undefined + ): FlowNodeTypeResult { // The type result from one antecedent may depend on the type // result from another, so loop up to one time for each // antecedent in the loop. const maxAttemptCount = loopNode.antecedents.length; - return preventRecursion(loopNode, () => { - if (cacheEntry === undefined) { - // We haven't been here before, so create a new incomplete cache entry. - cacheEntry = setCacheEntry( - loopNode, - reference ? undefined : initialType, - /* isIncomplete */ true - ); - } else if (cacheEntry.incompleteSubtypes?.some((subtype) => subtype.isPending)) { - // If there are pending entries that have not been evaluated even once, - // treat it as incomplete. - const isIncomplete = - cacheEntry.incompleteSubtypes.length < loopNode.antecedents.length || - cacheEntry.incompleteSubtypes.some( - (subtype) => subtype.isPending && subtype.evaluationCount < maxAttemptCount - ); - return { type: cacheEntry.type, isIncomplete }; - } + if (cacheEntry === undefined) { + // We haven't been here before, so create a new incomplete cache entry. + cacheEntry = setCacheEntry(loopNode, reference ? undefined : typeAtStart, /* isIncomplete */ true); + } else if ( + cacheEntry.incompleteSubtypes && + cacheEntry.incompleteSubtypes.length === loopNode.antecedents.length && + cacheEntry.incompleteSubtypes.some((subtype) => subtype.isPending) + ) { + // If entries have been added for all antecedents and there are pending entries + // that have not been evaluated even once, treat it as incomplete. + return { type: cacheEntry.type, isIncomplete: true }; + } - let attemptCount = 0; + let attemptCount = 0; - while (true) { - let sawIncomplete = false; - let isProvenReachable = - reference === undefined && - cacheEntry.incompleteSubtypes?.some((subtype) => subtype.type !== undefined); + while (true) { + let sawIncomplete = false; + let sawPending = false; + let isProvenReachable = + reference === undefined && + cacheEntry.incompleteSubtypes?.some((subtype) => subtype.type !== undefined); + let firstAntecedentTypeIsIncomplete = false; + + loopNode.antecedents.forEach((antecedent, index) => { + // If we've trying to determine reachability and we've already proven + // reachability, then we're done. + if (reference === undefined && isProvenReachable) { + return; + } - loopNode.antecedents.forEach((antecedent, index) => { - // If we've trying to determine reachability and we've already proven - // reachability, then we're done. - if (reference === undefined && isProvenReachable) { - return; - } + cacheEntry = getCacheEntry(loopNode)!; - cacheEntry = getCacheEntry(loopNode)!; + // Is this entry marked "pending"? If so, we have recursed and there + // is another call on the stack that is actively evaluating this + // antecedent. Skip it here to avoid infinite recursion but note that + // we skipped a "pending" antecedent. + if ( + cacheEntry.incompleteSubtypes && + index < cacheEntry.incompleteSubtypes.length && + cacheEntry.incompleteSubtypes[index].isPending + ) { + sawIncomplete = true; + sawPending = true; + return; + } + + // Have we already been here (i.e. does the entry exist and is + // not marked "pending")? If so, we can use the type that was already + // computed if it is complete. + const subtypeEntry = + cacheEntry.incompleteSubtypes !== undefined && index < cacheEntry.incompleteSubtypes.length + ? cacheEntry.incompleteSubtypes[index] + : undefined; + if (subtypeEntry === undefined || (!subtypeEntry?.isPending && subtypeEntry?.isIncomplete)) { + const entryEvaluationCount = subtypeEntry === undefined ? 0 : subtypeEntry.evaluationCount; + + // Set this entry to "pending" to prevent infinite recursion. + // We'll mark it "not pending" below. + cacheEntry = setIncompleteSubtype( + loopNode, + index, + subtypeEntry?.type ?? UnknownType.create(/* isIncomplete */ true), + /* isIncomplete */ true, + /* isPending */ true, + entryEvaluationCount + ); + + try { + const flowTypeResult = getTypeFromFlowNode(antecedent); + + if (flowTypeResult.isIncomplete) { + sawIncomplete = true; + + if (index === 0) { + firstAntecedentTypeIsIncomplete = true; + } + } - // Have we already been here (i.e. does the entry exist and is - // not marked "pending")? If so, we can use the type that was already - // computed if it is complete. - const subtypeEntry = - cacheEntry.incompleteSubtypes !== undefined && - index < cacheEntry.incompleteSubtypes.length - ? cacheEntry.incompleteSubtypes[index] - : undefined; - if ( - subtypeEntry === undefined || - (!subtypeEntry?.isPending && subtypeEntry?.isIncomplete) - ) { - const entryEvaluationCount = - subtypeEntry === undefined ? 0 : subtypeEntry.evaluationCount; - // Set this entry to "pending" to prevent infinite recursion. - // We'll mark it "not pending" below. cacheEntry = setIncompleteSubtype( loopNode, index, - subtypeEntry?.type ?? (reference ? undefined : initialType), + flowTypeResult.type ?? + (flowTypeResult.isIncomplete + ? UnknownType.create(/* isIncomplete */ true) + : NeverType.createNever()), + flowTypeResult.isIncomplete, + /* isPending */ false, + entryEvaluationCount + 1 + ); + } catch (e) { + setIncompleteSubtype( + loopNode, + index, + UnknownType.create(/* isIncomplete */ true), /* isIncomplete */ true, - /* isPending */ true, - entryEvaluationCount + /* isPending */ false, + entryEvaluationCount + 1 ); - - try { - const flowTypeResult = getTypeFromFlowNode(antecedent); - - if (flowTypeResult.isIncomplete) { - sawIncomplete = true; - } - - cacheEntry = setIncompleteSubtype( - loopNode, - index, - flowTypeResult.type, - flowTypeResult.isIncomplete, - /* isPending */ false, - entryEvaluationCount + 1 - ); - } catch (e) { - setIncompleteSubtype( - loopNode, - index, - undefined, - /* isIncomplete */ true, - /* isPending */ false, - entryEvaluationCount + 1 - ); - throw e; - } + throw e; } + } - if (reference === undefined && cacheEntry?.type !== undefined) { - isProvenReachable = true; - } - }); + if (reference === undefined && cacheEntry?.type !== undefined) { + isProvenReachable = true; + } + }); - if (isProvenReachable) { - return setCacheEntry(loopNode, initialType, /* isIncomplete */ false); + if (isProvenReachable) { + // If we saw a pending entry, do not save over the top of the cache + // entry because we'll overwrite a pending evaluation. + return sawPending + ? { type: typeAtStart, isIncomplete: false } + : setCacheEntry(loopNode, typeAtStart, /* isIncomplete */ false); + } + + let effectiveType = cacheEntry.type; + if (sawIncomplete) { + // If there is an incomplete "Unknown" type within a union type, remove + // it. Otherwise we might end up resolving the cycle with a type + // that includes an undesirable unknown. + if (effectiveType) { + effectiveType = cleanIncompleteUnknown(effectiveType); } + } - let effectiveType = cacheEntry.type; - if (sawIncomplete) { - // If there is an incomplete "Unknown" type within a union type, remove - // it. Otherwise we might end up resolving the cycle with a type - // that includes an undesirable unknown. - if (effectiveType) { - const typeWithoutUnknown = removeIncompleteUnknownFromUnion(effectiveType); - if (!isNever(typeWithoutUnknown)) { - effectiveType = typeWithoutUnknown; - } - } + if (!sawIncomplete || attemptCount >= maxAttemptCount) { + // If we were able to evaluate a type along at least one antecedent + // path, mark it as complete. If we couldn't evaluate a type along + // any antecedent path, assume that some recursive call further + // up the stack will be able to produce a valid type. + let reportIncomplete = sawIncomplete; + if ( + !sawPending && + effectiveType && + !isIncompleteUnknown(effectiveType) && + !firstAntecedentTypeIsIncomplete + ) { + // Bump the generation count because we need to recalculate + // other incomplete types based on this now-complete type. + flowIncompleteGeneration++; + reportIncomplete = false; } - if (!sawIncomplete || attemptCount >= maxAttemptCount) { - return setCacheEntry(loopNode, effectiveType, /* isIncomplete */ false); + // If we saw a pending or incomplete entry, do not save over the top + // of the cache entry because we'll overwrite the partial result. + if (sawPending || sawIncomplete) { + return { type: effectiveType, isIncomplete: reportIncomplete }; } - attemptCount++; + return setCacheEntry(loopNode, effectiveType, /* isIncomplete */ false); } - }); + + attemptCount++; + } } - function getTypeFromPreFinallyGateFlowNode(preFinallyFlowNode: FlowPreFinallyGate) { + function getTypeFromPreFinallyGateFlowNode(preFinallyFlowNode: FlowPreFinallyGate): FlowNodeTypeResult { if (preFinallyFlowNode.isGateClosed) { return { type: undefined, isIncomplete: false }; } @@ -879,7 +988,7 @@ export function getCodeFlowEngine( }); } - function getTypeFromPostFinallyFlowNode(postFinallyFlowNode: FlowPostFinally) { + function getTypeFromPostFinallyFlowNode(postFinallyFlowNode: FlowPostFinally): FlowNodeTypeResult { const wasGateClosed = postFinallyFlowNode.preFinallyGate.isGateClosed; try { postFinallyFlowNode.preFinallyGate.isGateClosed = true; @@ -907,8 +1016,8 @@ export function getCodeFlowEngine( // (namely, string literals that are used for forward // referenced types). return { - type: initialType, - isIncomplete: isInitialTypeIncomplete, + type: typeAtStart, + isIncomplete: !!options?.isTypeAtStartIncomplete, }; } @@ -927,7 +1036,7 @@ export function getCodeFlowEngine( function isFlowNodeReachable(flowNode: FlowNode, sourceFlowNode?: FlowNode, ignoreNoReturn = false): boolean { const visitedFlowNodeMap = new Set(); - if (isPrintControlFlowGraphEnabled) { + if (enablePrintControlFlowGraph) { printControlFlowGraph(flowNode, /* reference */ undefined, 'isFlowNodeReachable'); } @@ -1162,8 +1271,8 @@ export function getCodeFlowEngine( const arg1Type = evaluator.getTypeOfExpression( arg1Expr, EvaluatorFlags.EvaluateStringLiteralAsType | - EvaluatorFlags.ParamSpecDisallowed | - EvaluatorFlags.TypeVarTupleDisallowed + EvaluatorFlags.DisallowParamSpec | + EvaluatorFlags.DisallowTypeVarTuple ).type; if (isInstantiableClass(arg1Type)) { @@ -1245,7 +1354,7 @@ export function getCodeFlowEngine( function isCallNoReturn(evaluator: TypeEvaluator, flowNode: FlowCall) { const node = flowNode.node; - if (isPrintCallNoReturnEnabled) { + if (enablePrintCallNoReturn) { console.log(`isCallNoReturn@${flowNode.id} Pre depth ${noReturnAnalysisDepth}`); } @@ -1253,7 +1362,7 @@ export function getCodeFlowEngine( if (callIsNoReturnCache.has(node.id)) { const result = callIsNoReturnCache.get(node.id); - if (isPrintCallNoReturnEnabled) { + if (enablePrintCallNoReturn) { console.log(`isCallNoReturn@${flowNode.id} Post: ${result ? 'true' : 'false'} (cached)`); } @@ -1275,7 +1384,8 @@ export function getCodeFlowEngine( let subtypeCount = 0; // Evaluate the call base type. - const callType = evaluator.getTypeOfExpression(node.leftExpression, EvaluatorFlags.DoNotSpecialize).type; + const callTypeResult = evaluator.getTypeOfExpression(node.leftExpression, EvaluatorFlags.DoNotSpecialize); + const callType = callTypeResult.type; doForEachSubtype(callType, (callSubtype) => { // Track the number of subtypes we've examined. @@ -1375,7 +1485,7 @@ export function getCodeFlowEngine( const callResult = evaluator.validateOverloadedFunctionArguments( node, node.arguments, - callSubtype, + { type: callSubtype, isIncomplete: callTypeResult.isIncomplete }, undefined /* typeVarContext */, false /* skipUnknownArgCheck */, undefined /* expectedType */ @@ -1395,7 +1505,7 @@ export function getCodeFlowEngine( // Cache the value for next time. callIsNoReturnCache.set(node.id, callIsNoReturn); - if (isPrintCallNoReturnEnabled) { + if (enablePrintCallNoReturn) { console.log(`isCallNoReturn@${flowNode.id} Post: ${callIsNoReturn ? 'true' : 'false'}`); } @@ -1407,9 +1517,9 @@ export function getCodeFlowEngine( function isFunctionNoReturn(functionType: FunctionType, isCallAwaited: boolean) { const returnType = functionType.details.declaredReturnType; - if (FunctionType.isAsync(functionType)) { + if (returnType) { if ( - returnType && + FunctionType.isAsync(functionType) && isClassInstance(returnType) && ClassType.isBuiltIn(returnType, 'Coroutine') && returnType.typeArguments && @@ -1419,14 +1529,16 @@ export function getCodeFlowEngine( return true; } } - } else if (returnType) { + return isNever(returnType); + } else if (!inferNoReturnForUnannotatedFunctions) { + return false; } else if (functionType.details.declaration) { - // If the function has yield expressions, it's a generator, and - // we'll assume the yield statements are reachable. Also, don't - // infer a "no return" type for abstract methods. + // If the function is a generator (i.e. it has yield statements) + // then it is not a "no return" call. Also, don't infer a "no + // return" type for abstract methods. if ( - !functionType.details.declaration.yieldStatements && + !functionType.details.declaration.isGenerator && !FunctionType.isAbstractMethod(functionType) && !FunctionType.isStubDefinition(functionType) && !FunctionType.isPyTypedDefinition(functionType) @@ -1552,7 +1664,8 @@ export function getCodeFlowEngine( function printControlFlowGraph( flowNode: FlowNode, reference: CodeFlowReferenceExpressionNode | undefined, - callName: string + callName: string, + logger: ConsoleInterface = console ) { let referenceText = ''; if (reference) { @@ -1561,13 +1674,14 @@ export function getCodeFlowEngine( referenceText = `${printExpression(reference)}[${pos.line + 1}:${pos.character + 1}]`; } - console.log(`${callName}@${flowNode.id}: ${referenceText || '(none)'}`); - console.log(formatControlFlowGraph(flowNode)); + logger.log(`${callName}@${flowNode.id}: ${referenceText || '(none)'}`); + logger.log(formatControlFlowGraph(flowNode)); } return { createCodeFlowAnalyzer, isFlowNodeReachable, narrowConstrainedTypeVar, + printControlFlowGraph, }; } diff --git a/packages/pyright-internal/src/analyzer/codeFlowTypes.ts b/packages/pyright-internal/src/analyzer/codeFlowTypes.ts index f2192008a..62d924a0d 100644 --- a/packages/pyright-internal/src/analyzer/codeFlowTypes.ts +++ b/packages/pyright-internal/src/analyzer/codeFlowTypes.ts @@ -266,3 +266,6 @@ export function createKeysForReferenceSubexpressions(reference: CodeFlowReferenc fail('createKeyForReference received unexpected expression type'); } + +// A reference key that corresponds to a wildcard import. +export const wildcardImportReferenceKey = '*'; diff --git a/packages/pyright-internal/src/analyzer/commentUtils.ts b/packages/pyright-internal/src/analyzer/commentUtils.ts index 2541fe15a..fc3f641fa 100644 --- a/packages/pyright-internal/src/analyzer/commentUtils.ts +++ b/packages/pyright-internal/src/analyzer/commentUtils.ts @@ -18,14 +18,26 @@ import { getStrictDiagnosticRuleSet, getStrictModeNotOverriddenRules, } from '../common/configOptions'; +import { assert } from '../common/debug'; import { DiagnosticRule } from '../common/diagnosticRules'; +import { TextRange } from '../common/textRange'; import { TextRangeCollection } from '../common/textRangeCollection'; +import { Localizer } from '../localization/localize'; import { Token } from '../parser/tokenizerTypes'; +const strictSetting = 'strict'; +const basicSetting = 'basic'; + +export interface CommentDiagnostic { + message: string; + range: TextRange; +} + export function getFileLevelDirectives( tokens: TextRangeCollection, defaultRuleSet: DiagnosticRuleSet, - useStrict: boolean + useStrict: boolean, + diagnostics: CommentDiagnostic[] ): DiagnosticRuleSet { let ruleSet = cloneDiagnosticRuleSet(defaultRuleSet); @@ -37,9 +49,10 @@ export function getFileLevelDirectives( const token = tokens.getItemAt(i); if (token.comments) { for (const comment of token.comments) { - const value = comment.value.trim(); + const textRange: TextRange = { start: comment.start, length: comment.length }; + const value = _trimTextWithRange(comment.value, textRange); - ruleSet = _parsePyrightComment(value, ruleSet); + ruleSet = _parsePyrightComment(value, textRange, ruleSet, diagnostics); } } } @@ -52,7 +65,7 @@ function _applyStrictRules(ruleSet: DiagnosticRuleSet) { } function _applyBasicRules(ruleSet: DiagnosticRuleSet) { - _overrideRules(ruleSet, getBasicDiagnosticRuleSet(), []); + _overwriteRules(ruleSet, getBasicDiagnosticRuleSet()); } function _overrideRules( @@ -93,50 +106,127 @@ function _overrideRules( } } -function _parsePyrightComment(commentValue: string, ruleSet: DiagnosticRuleSet) { - // Is this a pyright or mspython-specific comment? - const validPrefixes = ['pyright:', 'mspython:']; - const prefix = validPrefixes.find((p) => commentValue.startsWith(p)); - if (prefix) { - const operands = commentValue.substr(prefix.length).trim(); - const operandList = operands.split(',').map((s) => s.trim()); +function _overwriteRules(ruleSet: DiagnosticRuleSet, overrideRuleSet: DiagnosticRuleSet) { + const boolRuleNames = getBooleanDiagnosticRules(); + const diagRuleNames = getDiagLevelDiagnosticRules(); + + for (const ruleName of boolRuleNames) { + (ruleSet as any)[ruleName] = (overrideRuleSet as any)[ruleName]; + } + + for (const ruleName of diagRuleNames) { + (ruleSet as any)[ruleName] = (overrideRuleSet as any)[ruleName]; + } +} + +function _parsePyrightComment( + commentValue: string, + commentRange: TextRange, + ruleSet: DiagnosticRuleSet, + diagnostics: CommentDiagnostic[] +) { + // Is this a pyright comment? + const commentPrefix = 'pyright:'; + if (commentValue.startsWith(commentPrefix)) { + const operands = commentValue.substring(commentPrefix.length); + + // Handle (actual ignore) "ignore" directives. + if (operands.trim().startsWith('ignore')) { + return ruleSet; + } + + const operandList = operands.split(','); // If it contains a "strict" operand, replace the existing // diagnostic rules with their strict counterparts. - if (operandList.some((s) => s === 'strict')) { + if (operandList.some((s) => s.trim() === strictSetting)) { _applyStrictRules(ruleSet); - } else if (operandList.some((s) => s === 'basic')) { + } else if (operandList.some((s) => s.trim() === basicSetting)) { _applyBasicRules(ruleSet); } + let rangeOffset = 0; for (const operand of operandList) { - ruleSet = _parsePyrightOperand(operand, ruleSet); + const operandRange: TextRange = { + start: commentRange.start + commentPrefix.length + rangeOffset, + length: operand.length, + }; + const trimmedOperand = _trimTextWithRange(operand, operandRange); + + ruleSet = _parsePyrightOperand(trimmedOperand, operandRange, ruleSet, diagnostics); + rangeOffset += operand.length + 1; } } return ruleSet; } -function _parsePyrightOperand(operand: string, ruleSet: DiagnosticRuleSet) { - const operandSplit = operand.split('=').map((s) => s.trim()); - if (operandSplit.length !== 2) { - return ruleSet; +function _parsePyrightOperand( + operand: string, + operandRange: TextRange, + ruleSet: DiagnosticRuleSet, + diagnostics: CommentDiagnostic[] +) { + const operandSplit = operand.split('='); + const ruleRange: TextRange = { + start: operandRange.start, + length: operandSplit[0].length, + }; + const trimmedRule = _trimTextWithRange(operandSplit[0], ruleRange); + + // Handle basic directives "basic" and "strict". + if (operandSplit.length === 1) { + if (trimmedRule && [strictSetting, basicSetting].some((setting) => trimmedRule === setting)) { + return ruleSet; + } } - const ruleName = operandSplit[0]; - const boolRules = getBooleanDiagnosticRules(); const diagLevelRules = getDiagLevelDiagnosticRules(); + const boolRules = getBooleanDiagnosticRules(); - if (diagLevelRules.find((r) => r === ruleName)) { - const diagLevelValue = _parseDiagLevel(operandSplit[1]); + const ruleValue = operandSplit.length > 0 ? operandSplit.slice(1).join('=') : ''; + const ruleValueRange: TextRange = { + start: operandRange.start + operandSplit[0].length + 1, + length: ruleValue.length, + }; + const trimmedRuleValue = _trimTextWithRange(ruleValue, ruleValueRange); + + if (diagLevelRules.find((r) => r === trimmedRule)) { + const diagLevelValue = _parseDiagLevel(trimmedRuleValue); if (diagLevelValue !== undefined) { - (ruleSet as any)[ruleName] = diagLevelValue; + (ruleSet as any)[trimmedRule] = diagLevelValue; + } else { + const diag: CommentDiagnostic = { + message: Localizer.Diagnostic.pyrightCommentInvalidDiagnosticSeverityValue(), + range: trimmedRuleValue ? ruleValueRange : ruleRange, + }; + diagnostics.push(diag); } - } else if (boolRules.find((r) => r === ruleName)) { - const boolValue = _parseBoolSetting(operandSplit[1]); + } else if (boolRules.find((r) => r === trimmedRule)) { + const boolValue = _parseBoolSetting(trimmedRuleValue); if (boolValue !== undefined) { - (ruleSet as any)[ruleName] = boolValue; + (ruleSet as any)[trimmedRule] = boolValue; + } else { + const diag: CommentDiagnostic = { + message: Localizer.Diagnostic.pyrightCommentInvalidDiagnosticBoolValue(), + range: trimmedRuleValue ? ruleValueRange : ruleRange, + }; + diagnostics.push(diag); } + } else if (trimmedRule) { + const diag: CommentDiagnostic = { + message: trimmedRuleValue + ? Localizer.Diagnostic.pyrightCommentUnknownDiagnosticRule().format({ rule: trimmedRule }) + : Localizer.Diagnostic.pyrightCommentUnknownDirective().format({ directive: trimmedRule }), + range: ruleRange, + }; + diagnostics.push(diag); + } else { + const diag: CommentDiagnostic = { + message: Localizer.Diagnostic.pyrightCommentMissingDirective(), + range: ruleRange, + }; + diagnostics.push(diag); } return ruleSet; @@ -172,3 +262,24 @@ function _parseBoolSetting(value: string): boolean | undefined { return undefined; } + +// Calls "trim" on the text and adjusts the corresponding range +// if characters are trimmed from the beginning or end. +function _trimTextWithRange(text: string, range: TextRange): string { + assert(text.length === range.length); + const value1 = text.trimStart(); + + if (value1 !== text) { + const delta = text.length - value1.length; + range.start += delta; + range.length -= delta; + } + + const value2 = value1.trimEnd(); + if (value2 !== value1) { + range.length -= value1.length - value2.length; + } + + assert(value2.length === range.length); + return value2; +} diff --git a/packages/pyright-internal/src/analyzer/constraintSolver.ts b/packages/pyright-internal/src/analyzer/constraintSolver.ts index 2785fc1bb..63b28cf1a 100644 --- a/packages/pyright-internal/src/analyzer/constraintSolver.ts +++ b/packages/pyright-internal/src/analyzer/constraintSolver.ts @@ -16,8 +16,8 @@ import { AnyType, ClassType, combineTypes, + FunctionParameter, FunctionType, - FunctionTypeFlags, isAny, isAnyOrUnknown, isClass, @@ -30,8 +30,9 @@ import { isUnion, isUnknown, isUnpacked, + isUnpackedClass, isVariadicTypeVar, - ParamSpecEntry, + TupleTypeArgument, Type, TypeBase, TypeVarScopeId, @@ -41,12 +42,13 @@ import { } from './types'; import { addConditionToType, + applySolvedTypeVars, AssignTypeFlags, buildTypeVarContextFromSpecializedClass, - containsLiteralType, convertParamSpecValueToType, convertToInstance, convertToInstantiable, + convertTypeToParamSpecValue, getTypeCondition, getTypeVarScopeId, isEffectivelyInstantiable, @@ -90,30 +92,28 @@ export function assignTypeToTypeVar( return true; } + // Is this the equivalent of an "Unknown" for a ParamSpec? + if ( + destType.details.isParamSpec && + isFunction(srcType) && + FunctionType.isParamSpecValue(srcType) && + FunctionType.shouldSkipArgsKwargsCompatibilityCheck(srcType) + ) { + return true; + } + + // Never or NoReturn is always assignable to all type variables unless + // we're enforcing invariance. + if (isNever(srcType) && (flags & AssignTypeFlags.EnforceInvariance) === 0) { + return true; + } + // If we're in "ignore type var scope" mode, don't generate // an error in this path. if ((flags & AssignTypeFlags.IgnoreTypeVarScope) !== 0) { return true; } - // If we're in "reverse type var" mode, simply make sure that - // the concrete type is assignable. - if (isContravariant) { - if ( - evaluator.assignType( - evaluator.makeTopLevelTypeVarsConcrete(destType), - evaluator.makeTopLevelTypeVarsConcrete(srcType), - /* diag */ undefined, - /* destTypeVarContext */ undefined, - /* srcTypeVarContext */ undefined, - flags, - recursionCount - ) - ) { - return true; - } - } - isTypeVarInScope = false; if (!destType.details.isSynthesized) { diag?.addMessage( @@ -142,7 +142,7 @@ export function assignTypeToTypeVar( return assignTypeToParamSpec(evaluator, destType, srcType, diag, typeVarContext, recursionCount); } - if (destType.details.isVariadic) { + if (destType.details.isVariadic && !destType.isVariadicInUnion) { if (!isUnpacked(srcType)) { const tupleClassType = evaluator.getTupleClassType(); if (tupleClassType && isInstantiableClass(tupleClassType)) { @@ -161,6 +161,18 @@ export function assignTypeToTypeVar( } } + // If we're assigning an unpacked TypeVarTuple to a regular TypeVar, + // we need to treat it as a union of the unpacked TypeVarTuple. + if ( + isTypeVar(srcType) && + srcType.details.isVariadic && + srcType.isVariadicUnpacked && + !srcType.isVariadicInUnion && + !destType.details.isVariadic + ) { + srcType = TypeVarType.cloneForUnpacked(srcType, /* isInUnion */ true); + } + // If we're attempting to assign `type` to Type[T], transform `type` into `Type[Any]`. if ( TypeBase.isInstantiable(destType) && @@ -171,9 +183,13 @@ export function assignTypeToTypeVar( srcType = AnyType.create(); } - const curEntry = typeVarContext.getTypeVar(destType); + const curEntry = typeVarContext.getPrimarySignature().getTypeVar(destType); const curNarrowTypeBound = curEntry?.narrowBound; - const curWideTypeBound = curEntry?.wideBound ?? destType.details.boundType; + + let curWideTypeBound = curEntry?.wideBound; + if (!curWideTypeBound && !destType.details.isSynthesizedSelf) { + curWideTypeBound = destType.details.boundType; + } // Handle the constrained case. This case needs to be handled specially // because type narrowing isn't used in this case. For example, if the @@ -371,14 +387,7 @@ export function assignTypeToTypeVar( let newWideTypeBound = curWideTypeBound; const diagAddendum = diag ? new DiagnosticAddendum() : undefined; - // Strip literals if the existing value contains no literals. This allows - // for explicit (but no implicit) literal specialization of a generic class. - const retainLiterals = - (flags & AssignTypeFlags.RetainLiteralsForTypeVar) !== 0 || - typeVarContext.getRetainLiterals(destType) || - (destType.details.boundType && containsLiteralType(destType.details.boundType)) || - destType.details.constraints.some((t) => containsLiteralType(t)); - let adjSrcType = retainLiterals ? srcType : evaluator.stripLiteralValue(srcType); + let adjSrcType = srcType; if (TypeBase.isInstantiable(destType)) { if (isEffectivelyInstantiable(adjSrcType)) { @@ -392,9 +401,32 @@ export function assignTypeToTypeVar( ); return false; } + } else if ( + isTypeVar(srcType) && + TypeBase.isInstantiable(srcType) && + isTypeSame(convertToInstance(srcType), destType) + ) { + diag?.addMessage( + Localizer.DiagnosticAddendum.typeAssignmentMismatch().format({ + sourceType: evaluator.printType(adjSrcType), + destType: evaluator.printType(destType), + }) + ); + return false; } - if (isContravariant || (flags & AssignTypeFlags.AllowTypeVarNarrowing) !== 0) { + if ((flags & AssignTypeFlags.PopulatingExpectedType) !== 0) { + // If we're populating the expected type, constrain either the + // narrow type bound, wide type bound or both. + if ((flags & AssignTypeFlags.EnforceInvariance) !== 0) { + newNarrowTypeBound = adjSrcType; + newWideTypeBound = adjSrcType; + } else if (isContravariant) { + newNarrowTypeBound = adjSrcType; + } else { + newWideTypeBound = adjSrcType; + } + } else if (isContravariant) { // Update the wide type bound. if (!curWideTypeBound) { newWideTypeBound = adjSrcType; @@ -495,7 +527,7 @@ export function assignTypeToTypeVar( ) { newNarrowTypeBound = adjSrcType; } else { - newNarrowTypeBound = curNarrowTypeBound; + newNarrowTypeBound = applySolvedTypeVars(curNarrowTypeBound, typeVarContext); } } else { // We need to widen the type. @@ -509,18 +541,6 @@ export function assignTypeToTypeVar( return false; } - // Don't allow widening for variadic type variables. - const possibleVariadic = destType; - if (isVariadicTypeVar(possibleVariadic)) { - diag?.addMessage( - Localizer.DiagnosticAddendum.typeAssignmentMismatch().format({ - sourceType: evaluator.printType(curNarrowTypeBound), - destType: evaluator.printType(adjSrcType), - }) - ); - return false; - } - if ( evaluator.assignType( adjSrcType, @@ -533,8 +553,22 @@ export function assignTypeToTypeVar( ) ) { newNarrowTypeBound = adjSrcType; + } else if (isVariadicTypeVar(destType)) { + const widenedType = widenTypeForVariadicTypeVar(curNarrowTypeBound, adjSrcType); + if (!widenedType) { + diag?.addMessage( + Localizer.DiagnosticAddendum.typeAssignmentMismatch().format({ + sourceType: evaluator.printType(curNarrowTypeBound), + destType: evaluator.printType(adjSrcType), + }) + ); + return false; + } + + newNarrowTypeBound = widenedType; } else { const objectType = evaluator.getObjectType(); + const curSolvedNarrowTypeBound = applySolvedTypeVars(curNarrowTypeBound, typeVarContext); // In some extreme edge cases, the narrow type bound can become // a union with so many subtypes that performance grinds to a @@ -542,15 +576,15 @@ export function assignTypeToTypeVar( // to an 'object' instead of making the union even bigger. This // is still a valid solution to the TypeVar. if ( - isUnion(curNarrowTypeBound) && - curNarrowTypeBound.subtypes.length > maxSubtypesForInferredType && + isUnion(curSolvedNarrowTypeBound) && + curSolvedNarrowTypeBound.subtypes.length > maxSubtypesForInferredType && (destType as TypeVarType).details.boundType !== undefined && objectType && isClassInstance(objectType) ) { - newNarrowTypeBound = combineTypes([curNarrowTypeBound, objectType]); + newNarrowTypeBound = combineTypes([curSolvedNarrowTypeBound, objectType]); } else { - newNarrowTypeBound = combineTypes([curNarrowTypeBound, adjSrcType]); + newNarrowTypeBound = combineTypes([curSolvedNarrowTypeBound, adjSrcType]); } } } @@ -569,20 +603,24 @@ export function assignTypeToTypeVar( makeConcrete = false; } else if ( isUnion(newNarrowTypeBound) && - newNarrowTypeBound.subtypes.some((subtype) => isTypeSame(subtype, curWideTypeBound)) + newNarrowTypeBound.subtypes.some((subtype) => isTypeSame(subtype, curWideTypeBound!)) ) { makeConcrete = false; } } + const adjWideTypeBound = makeConcrete + ? evaluator.makeTopLevelTypeVarsConcrete(curWideTypeBound, /* makeParamSpecsConcrete */ true) + : curWideTypeBound; + if ( !evaluator.assignType( - makeConcrete ? evaluator.makeTopLevelTypeVarsConcrete(curWideTypeBound) : curWideTypeBound, + adjWideTypeBound, newNarrowTypeBound, diag?.createAddendum(), - new TypeVarContext(destType.scopeId), + /* destTypeVarContext */ undefined, /* srcTypeVarContext */ undefined, - flags & AssignTypeFlags.IgnoreTypeVarScope, + AssignTypeFlags.IgnoreTypeVarScope, recursionCount ) ) { @@ -645,7 +683,26 @@ export function assignTypeToTypeVar( } if (!typeVarContext.isLocked() && isTypeVarInScope) { - typeVarContext.setTypeVarType(destType, newNarrowTypeBound, newWideTypeBound, retainLiterals); + let newNarrowTypeBoundNoLiterals: Type | undefined; + + if ( + newNarrowTypeBound && + (flags & (AssignTypeFlags.PopulatingExpectedType | AssignTypeFlags.RetainLiteralsForTypeVar)) === 0 + ) { + const strippedLiteral = isVariadicTypeVar(destType) + ? stripLiteralValueForUnpackedTuple(evaluator, newNarrowTypeBound) + : evaluator.stripLiteralValue(newNarrowTypeBound); + + // Strip the literals from the narrow type bound and see if it is still + // narrower than the wide bound. + if (strippedLiteral !== newNarrowTypeBound) { + if (!newWideTypeBound || evaluator.assignType(newWideTypeBound, strippedLiteral)) { + newNarrowTypeBoundNoLiterals = strippedLiteral; + } + } + } + + typeVarContext.setTypeVarType(destType, newNarrowTypeBound, newNarrowTypeBoundNoLiterals, newWideTypeBound); } return true; @@ -659,94 +716,92 @@ function assignTypeToParamSpec( typeVarContext: TypeVarContext, recursionCount = 0 ) { - if (isTypeVar(srcType) && srcType.details.isParamSpec) { - const existingEntry = typeVarContext.getParamSpec(destType); - if (existingEntry) { - if (existingEntry.parameters.length === 0 && existingEntry.paramSpec) { - // If there's an existing entry that matches, that's fine. - if (isTypeSame(existingEntry.paramSpec, srcType, {}, recursionCount)) { - return true; + let isAssignable = true; + + typeVarContext.doForEachSignature((signatureContext) => { + if (isTypeVar(srcType) && srcType.details.isParamSpec) { + const existingType = signatureContext.getParamSpecType(destType); + if (existingType) { + if (existingType.details.parameters.length === 0 && existingType.details.paramSpec) { + // If there's an existing entry that matches, that's fine. + if (isTypeSame(existingType.details.paramSpec, srcType, {}, recursionCount)) { + return; + } } + } else { + if (!typeVarContext.isLocked() && typeVarContext.hasSolveForScope(destType.scopeId)) { + typeVarContext.setTypeVarType(destType, convertTypeToParamSpecValue(srcType)); + } + return; } - } else { - if (!typeVarContext.isLocked() && typeVarContext.hasSolveForScope(destType.scopeId)) { - typeVarContext.setParamSpec(destType, { - flags: FunctionTypeFlags.None, - parameters: [], - typeVarScopeId: undefined, - docString: undefined, - paramSpec: srcType, - }); - } - return true; - } - } else if (isFunction(srcType)) { - const functionSrcType = srcType; - const parameters = srcType.details.parameters.map((p, index) => { - const paramSpecEntry: ParamSpecEntry = { - category: p.category, - name: p.name, - isNameSynthesized: p.isNameSynthesized, - hasDefault: !!p.hasDefault, - type: FunctionType.getEffectiveParameterType(functionSrcType, index), - }; - return paramSpecEntry; - }); + } else if (isFunction(srcType)) { + const functionSrcType = srcType; + const parameters = srcType.details.parameters.map((p, index) => { + const param: FunctionParameter = { + category: p.category, + name: p.name, + isNameSynthesized: p.isNameSynthesized, + hasDefault: !!p.hasDefault, + defaultValueExpression: p.defaultValueExpression, + type: FunctionType.getEffectiveParameterType(functionSrcType, index), + }; + return param; + }); - const existingEntry = typeVarContext.getParamSpec(destType); - if (existingEntry) { - if (existingEntry.paramSpec === srcType.details.paramSpec) { - // Convert the remaining portion of the signature to a function - // for comparison purposes. - const existingFunction = convertParamSpecValueToType(existingEntry, /* omitParamSpec */ true); - const assignedFunction = convertParamSpecValueToType( - { - parameters, - flags: srcType.details.flags, - typeVarScopeId: srcType.details.typeVarScopeId, - docString: undefined, - paramSpec: undefined, - }, - /* omitParamSpec */ true - ); + const existingType = signatureContext.getParamSpecType(destType); + if (existingType) { + if (existingType.details.paramSpec === srcType.details.paramSpec) { + // Convert the remaining portion of the signature to a function + // for comparison purposes. + const existingFunction = convertParamSpecValueToType(existingType, /* omitParamSpec */ true); + const assignedFunction = FunctionType.createInstance('', '', '', srcType.details.flags); + parameters.forEach((param) => { + FunctionType.addParameter(assignedFunction, param); + }); + assignedFunction.details.typeVarScopeId = srcType.details.typeVarScopeId; - if ( - evaluator.assignType( - existingFunction, - assignedFunction, - /* diag */ undefined, - /* destTypeVarContext */ undefined, - /* srcTypeVarContext */ undefined, - AssignTypeFlags.SkipFunctionReturnTypeCheck, - recursionCount - ) - ) { - return true; + if ( + evaluator.assignType( + existingFunction, + assignedFunction, + /* diag */ undefined, + /* destTypeVarContext */ undefined, + /* srcTypeVarContext */ undefined, + AssignTypeFlags.SkipFunctionReturnTypeCheck, + recursionCount + ) + ) { + return; + } } + } else { + if (!typeVarContext.isLocked() && typeVarContext.hasSolveForScope(destType.scopeId)) { + const newFunction = FunctionType.createInstance('', '', '', srcType.details.flags); + parameters.forEach((param) => { + FunctionType.addParameter(newFunction, param); + }); + newFunction.details.typeVarScopeId = srcType.details.typeVarScopeId; + newFunction.details.docString = srcType.details.docString; + newFunction.details.paramSpec = srcType.details.paramSpec; + typeVarContext.setTypeVarType(destType, newFunction); + } + return; } - } else { - if (!typeVarContext.isLocked() && typeVarContext.hasSolveForScope(destType.scopeId)) { - typeVarContext.setParamSpec(destType, { - parameters, - typeVarScopeId: srcType.details.typeVarScopeId, - flags: srcType.details.flags, - docString: srcType.details.docString, - paramSpec: srcType.details.paramSpec, - }); - } - return true; + } else if (isAnyOrUnknown(srcType)) { + return; } - } else if (isAnyOrUnknown(srcType)) { - return true; - } - diag?.addMessage( - Localizer.DiagnosticAddendum.typeParamSpec().format({ - type: evaluator.printType(srcType), - name: destType.details.name, - }) - ); - return false; + diag?.addMessage( + Localizer.DiagnosticAddendum.typeParamSpec().format({ + type: evaluator.printType(srcType), + name: destType.details.name, + }) + ); + + isAssignable = false; + }); + + return isAssignable; } // In cases where the expected type is a specialized base class of the @@ -796,22 +851,25 @@ export function populateTypeVarContextBasedOnExpectedType( // we can use a faster method. if (ClassType.isSameGenericClass(expectedType, type)) { const sameClassTypeVarContext = buildTypeVarContextFromSpecializedClass(expectedType); - sameClassTypeVarContext.getTypeVars().forEach((entry) => { - const typeVarType = sameClassTypeVarContext.getTypeVarType(entry.typeVar); - - if (typeVarType) { - // Skip this if the type argument is a TypeVar defined by the class scope because - // we're potentially solving for these TypeVars. - if (!isTypeVar(typeVarType) || typeVarType.scopeId !== type.details.typeVarScopeId) { - typeVarContext.setTypeVarType( - entry.typeVar, - TypeVarType.getVariance(entry.typeVar) === Variance.Covariant ? undefined : typeVarType, - TypeVarType.getVariance(entry.typeVar) === Variance.Contravariant ? undefined : typeVarType, - entry.retainLiteral - ); + sameClassTypeVarContext + .getPrimarySignature() + .getTypeVars() + .forEach((entry) => { + const typeVarType = sameClassTypeVarContext.getPrimarySignature().getTypeVarType(entry.typeVar); + + if (typeVarType) { + // Skip this if the type argument is a TypeVar defined by the class scope because + // we're potentially solving for these TypeVars. + if (!isTypeVar(typeVarType) || typeVarType.scopeId !== type.details.typeVarScopeId) { + typeVarContext.setTypeVarType( + entry.typeVar, + TypeVarType.getVariance(entry.typeVar) === Variance.Covariant ? undefined : typeVarType, + /* narrowBoundNoLiterals */ undefined, + TypeVarType.getVariance(entry.typeVar) === Variance.Contravariant ? undefined : typeVarType + ); + } } - } - }); + }); return true; } @@ -856,7 +914,7 @@ export function populateTypeVarContextBasedOnExpectedType( let isResultValid = true; synthExpectedTypeArgs.forEach((typeVar, index) => { - const synthTypeVar = syntheticTypeVarContext.getTypeVarType(typeVar); + const synthTypeVar = syntheticTypeVarContext.getPrimarySignature().getTypeVarType(typeVar); // Is this one of the synthesized type vars we allocated above? If so, // the type arg that corresponds to this type var maps back to the target type. @@ -876,7 +934,6 @@ export function populateTypeVarContextBasedOnExpectedType( if (liveTypeVarScopes) { expectedTypeArgValue = transformExpectedTypeForConstructor( expectedTypeArgValue, - typeVarContext, liveTypeVarScopes ); } @@ -885,6 +942,7 @@ export function populateTypeVarContextBasedOnExpectedType( typeVarContext.setTypeVarType( targetTypeVar, TypeVarType.getVariance(typeVar) === Variance.Covariant ? undefined : expectedTypeArgValue, + /* narrowBoundNoLiterals */ undefined, TypeVarType.getVariance(typeVar) === Variance.Contravariant ? undefined : expectedTypeArgValue @@ -901,3 +959,73 @@ export function populateTypeVarContextBasedOnExpectedType( return false; } + +// For normal TypeVars, the constraint solver can widen a type by combining +// two otherwise incompatible types into a union. For TypeVarTuples, we need +// to do the equivalent operation for unpacked tuples. +function widenTypeForVariadicTypeVar(type1: Type, type2: Type): Type | undefined { + // If the two types are not unpacked tuples, we can't combine them. + if (!isUnpackedClass(type1) || !isUnpackedClass(type2)) { + return undefined; + } + + // If the two unpacked tuples are not the same length, we can't combine them. + if ( + !type1.tupleTypeArguments || + !type2.tupleTypeArguments || + type1.tupleTypeArguments.length !== type2.tupleTypeArguments.length + ) { + return undefined; + } + + let canCombine = true; + + const tupleTypeArgs: TupleTypeArgument[] = type1.tupleTypeArguments.map((arg1, index) => { + const arg2 = type2.tupleTypeArguments![index]; + + // If an entry is unbound in length and the corresponding entry in the + // other tuple is not (or vice versa), we can't combine them. + if (arg1.isUnbounded !== arg2.isUnbounded) { + canCombine = false; + } + + return { + isUnbounded: arg1.isUnbounded, + type: combineTypes([arg1.type, arg2.type]), + }; + }); + + if (!canCombine) { + return undefined; + } + + return specializeTupleClass(type1, tupleTypeArgs, /* isTypeArgumentExplicit */ true, /* isUnpackedTuple */ true); +} + +// If the provided type is an unpacked tuple, this function strips the +// literals from types of the corresponding elements. +function stripLiteralValueForUnpackedTuple(evaluator: TypeEvaluator, type: Type): Type { + if (!isUnpackedClass(type) || !type.tupleTypeArguments) { + return type; + } + + let strippedLiteral = false; + const tupleTypeArgs: TupleTypeArgument[] = type.tupleTypeArguments.map((arg) => { + const strippedType = evaluator.stripLiteralValue(arg.type); + + if (strippedType !== arg.type) { + strippedLiteral = true; + } + + return { + isUnbounded: arg.isUnbounded, + type: strippedType, + }; + }); + + if (!strippedLiteral) { + return type; + } + + return specializeTupleClass(type, tupleTypeArgs, /* isTypeArgumentExplicit */ true, /* isUnpackedTuple */ true); +} diff --git a/packages/pyright-internal/src/analyzer/constructorTransform.ts b/packages/pyright-internal/src/analyzer/constructorTransform.ts index 272abdd16..29074368d 100644 --- a/packages/pyright-internal/src/analyzer/constructorTransform.ts +++ b/packages/pyright-internal/src/analyzer/constructorTransform.ts @@ -15,19 +15,27 @@ import { DiagnosticRule } from '../common/diagnosticRules'; import { Localizer } from '../localization/localize'; import { ArgumentCategory, ExpressionNode, ParameterCategory } from '../parser/parseNodes'; import { getFileInfo } from './analyzerNodeInfo'; +import { getParameterListDetails, ParameterSource } from './parameterUtils'; import { Symbol, SymbolFlags } from './symbol'; import { FunctionArgument, FunctionResult, TypeEvaluator } from './typeEvaluatorTypes'; import { ClassType, FunctionParameter, FunctionType, isClassInstance, isFunction, isTypeSame } from './types'; import { applySolvedTypeVars, convertToInstance, - getParameterListDetails, getTypeVarScopeId, lookUpObjectMember, - ParameterSource, + makeInferenceContext, } from './typeUtils'; import { TypeVarContext } from './typeVarContext'; +export function hasConstructorTransform(classType: ClassType): boolean { + if (classType.details.fullName === 'functools.partial') { + return true; + } + + return false; +} + export function applyConstructorTransform( evaluator: TypeEvaluator, errorNode: ExpressionNode, @@ -98,7 +106,9 @@ function applyPartialTransform( const remainingArgsList = argList.slice(1); remainingArgsList.forEach((arg, argIndex) => { - const argTypeResult = evaluator.getTypeOfArgument(arg); + if (!arg.valueExpression) { + return; + } // Is it a positional argument or a keyword argument? if (!arg.name) { @@ -114,6 +124,12 @@ function applyPartialTransform( ); const diag = new DiagnosticAddendum(); + const argTypeResult = evaluator.getTypeOfExpression( + arg.valueExpression, + /* flags */ undefined, + makeInferenceContext(paramType) + ); + if (!evaluator.assignType(paramType, argTypeResult.type, diag, typeVarContext)) { evaluator.addDiagnostic( getFileInfo(errorNode).diagnosticRuleSet.reportGeneralTypeIssues, @@ -152,6 +168,12 @@ function applyPartialTransform( const diag = new DiagnosticAddendum(); const paramName = paramListDetails.params[argIndex].param.name ?? ''; + const argTypeResult = evaluator.getTypeOfExpression( + arg.valueExpression, + /* flags */ undefined, + makeInferenceContext(paramType) + ); + if (!evaluator.assignType(paramType, argTypeResult.type, diag, typeVarContext)) { evaluator.addDiagnostic( getFileInfo(errorNode).diagnosticRuleSet.reportGeneralTypeIssues, @@ -194,6 +216,12 @@ function applyPartialTransform( ); const diag = new DiagnosticAddendum(); + const argTypeResult = evaluator.getTypeOfExpression( + arg.valueExpression, + /* flags */ undefined, + makeInferenceContext(paramType) + ); + if (!evaluator.assignType(paramType, argTypeResult.type, diag, typeVarContext)) { evaluator.addDiagnostic( getFileInfo(errorNode).diagnosticRuleSet.reportGeneralTypeIssues, @@ -226,6 +254,12 @@ function applyPartialTransform( } else { const diag = new DiagnosticAddendum(); + const argTypeResult = evaluator.getTypeOfExpression( + arg.valueExpression, + /* flags */ undefined, + makeInferenceContext(paramType) + ); + if (!evaluator.assignType(paramType, argTypeResult.type, diag, typeVarContext)) { evaluator.addDiagnostic( getFileInfo(errorNode).diagnosticRuleSet.reportGeneralTypeIssues, diff --git a/packages/pyright-internal/src/analyzer/dataClasses.ts b/packages/pyright-internal/src/analyzer/dataClasses.ts index 172699ba7..d43460cdd 100644 --- a/packages/pyright-internal/src/analyzer/dataClasses.ts +++ b/packages/pyright-internal/src/analyzer/dataClasses.ts @@ -28,6 +28,7 @@ import { updateNamedTupleBaseClass } from './namedTuples'; import { getEnclosingClassOrFunction } from './parseTreeUtils'; import { evaluateStaticBoolExpression } from './staticExpressions'; import { Symbol, SymbolFlags } from './symbol'; +import { isPrivateName } from './symbolNameUtils'; import { EvaluatorFlags, FunctionArgument, TypeEvaluator } from './typeEvaluatorTypes'; import { AnyType, @@ -186,10 +187,12 @@ export function synthesizeDataClassMethods( // If the RHS of the assignment is assigning a field instance where the // "init" parameter is set to false, do not include it in the init method. if (statement.rightExpression.nodeType === ParseNodeType.Call) { - const callType = evaluator.getTypeOfExpression( + const callTypeResult = evaluator.getTypeOfExpression( statement.rightExpression.leftExpression, EvaluatorFlags.DoNotSpecialize - ).type; + ); + const callType = callTypeResult.type; + if ( isDataclassFieldConstructor( callType, @@ -218,7 +221,7 @@ export function synthesizeDataClassMethods( } else if (isOverloadedFunction(callType)) { callTarget = evaluator.getBestOverloadForArguments( statement.rightExpression, - callType, + { type: callType, isIncomplete: callTypeResult.isIncomplete }, statement.rightExpression.arguments ); } else if (isInstantiableClass(callType)) { @@ -229,7 +232,7 @@ export function synthesizeDataClassMethods( } else if (isOverloadedFunction(initCall)) { callTarget = evaluator.getBestOverloadForArguments( statement.rightExpression, - initCall, + { type: initCall }, statement.rightExpression.arguments ); } @@ -347,6 +350,7 @@ export function synthesizeDataClassMethods( hasDefault: hasDefaultValue, defaultValueExpression, includeInInit, + nameNode: variableNameNode, type: UnknownType.create(), isClassVar: true, }; @@ -363,6 +367,7 @@ export function synthesizeDataClassMethods( hasDefault: hasDefaultValue, defaultValueExpression, includeInInit, + nameNode: variableNameNode, type: UnknownType.create(), isClassVar: false, }; @@ -383,7 +388,7 @@ export function synthesizeDataClassMethods( // While this isn't documented behavior, it appears that the dataclass implementation // causes overridden variables to "inherit" default values from parent classes. - if (!dataClassEntry.hasDefault && oldEntry.hasDefault) { + if (!dataClassEntry.hasDefault && oldEntry.hasDefault && oldEntry.includeInInit) { dataClassEntry.hasDefault = true; dataClassEntry.defaultValueExpression = oldEntry.defaultValueExpression; hasDefaultValue = true; @@ -402,7 +407,12 @@ export function synthesizeDataClassMethods( (p) => p.hasDefault && p.includeInInit && !p.isKeywordOnly ); if (firstDefaultValueIndex >= 0 && firstDefaultValueIndex < insertIndex) { - evaluator.addError(Localizer.Diagnostic.dataClassFieldWithDefault(), variableNameNode); + evaluator.addDiagnostic( + AnalyzerNodeInfo.getFileInfo(node).diagnosticRuleSet.reportGeneralTypeIssues, + DiagnosticRule.reportGeneralTypeIssues, + Localizer.Diagnostic.dataClassFieldWithDefault(), + variableNameNode + ); } } } @@ -465,47 +475,55 @@ export function synthesizeDataClassMethods( const symbolTable = classType.details.fields; const keywordOnlyParams: FunctionParameter[] = []; - if (!skipSynthesizeInit && !hasExistingInitMethod && allAncestorsKnown) { - fullDataClassEntries.forEach((entry) => { - if (entry.includeInInit) { - // If the type refers to Self of the parent class, we need to - // transform it to refer to the Self of this subclass. - let effectiveType = entry.type; - if (entry.classType !== classType && requiresSpecialization(effectiveType)) { - const typeVarContext = new TypeVarContext(getTypeVarScopeId(entry.classType)); - populateTypeVarContextForSelfType(typeVarContext, entry.classType, classType); - effectiveType = applySolvedTypeVars(effectiveType, typeVarContext); - } + if (!skipSynthesizeInit && !hasExistingInitMethod) { + if (allAncestorsKnown) { + fullDataClassEntries.forEach((entry) => { + if (entry.includeInInit) { + // If the type refers to Self of the parent class, we need to + // transform it to refer to the Self of this subclass. + let effectiveType = entry.type; + if (entry.classType !== classType && requiresSpecialization(effectiveType)) { + const typeVarContext = new TypeVarContext(getTypeVarScopeId(entry.classType)); + populateTypeVarContextForSelfType(typeVarContext, entry.classType, classType); + effectiveType = applySolvedTypeVars(effectiveType, typeVarContext); + } - // Is the field type a descriptor object? If so, we need to extract the corresponding - // type of the __init__ method parameter from the __set__ method. - effectiveType = transformDescriptorType(evaluator, effectiveType); - - const functionParam: FunctionParameter = { - category: ParameterCategory.Simple, - name: entry.alias || entry.name, - hasDefault: entry.hasDefault, - defaultValueExpression: entry.defaultValueExpression, - type: effectiveType, - hasDeclaredType: true, - }; - - if (entry.isKeywordOnly) { - keywordOnlyParams.push(functionParam); - } else { - FunctionType.addParameter(initType, functionParam); - } - } - }); + // Is the field type a descriptor object? If so, we need to extract the corresponding + // type of the __init__ method parameter from the __set__ method. + effectiveType = transformDescriptorType(evaluator, effectiveType); - if (keywordOnlyParams.length > 0) { - FunctionType.addParameter(initType, { - category: ParameterCategory.VarArgList, - type: AnyType.create(), - }); - keywordOnlyParams.forEach((param) => { - FunctionType.addParameter(initType, param); + const effectiveName = entry.alias || entry.name; + + if (!entry.alias && entry.nameNode && isPrivateName(entry.nameNode.value)) { + evaluator.addError(Localizer.Diagnostic.dataClassFieldWithPrivateName(), entry.nameNode); + } + + const functionParam: FunctionParameter = { + category: ParameterCategory.Simple, + name: effectiveName, + hasDefault: entry.hasDefault, + defaultValueExpression: entry.defaultValueExpression, + type: effectiveType, + hasDeclaredType: true, + }; + + if (entry.isKeywordOnly) { + keywordOnlyParams.push(functionParam); + } else { + FunctionType.addParameter(initType, functionParam); + } + } }); + + if (keywordOnlyParams.length > 0) { + FunctionType.addParameter(initType, { + category: ParameterCategory.VarArgList, + type: AnyType.create(), + }); + keywordOnlyParams.forEach((param) => { + FunctionType.addParameter(initType, param); + }); + } } symbolTable.set('__init__', Symbol.createWithType(SymbolFlags.ClassMember, initType)); @@ -598,12 +616,35 @@ export function synthesizeDataClassMethods( ) ); } - symbolTable.set('__dataclass_fields__', Symbol.createWithType(SymbolFlags.ClassMember, dictType)); + symbolTable.set( + '__dataclass_fields__', + Symbol.createWithType(SymbolFlags.ClassMember | SymbolFlags.ClassVar, dictType) + ); if (ClassType.isGeneratedDataClassSlots(classType) && classType.details.localSlotsNames === undefined) { classType.details.localSlotsNames = localDataClassEntries.map((entry) => entry.name); } + // Should we synthesize a __slots__ symbol? + if (ClassType.isGeneratedDataClassSlots(classType)) { + let iterableType = evaluator.getTypingType(node, 'Iterable') ?? UnknownType.create(); + + if (isInstantiableClass(iterableType)) { + iterableType = ClassType.cloneAsInstance( + ClassType.cloneForSpecialization( + iterableType, + [evaluator.getBuiltInObject(node, 'str')], + /* isTypeArgumentExplicit */ true + ) + ); + } + + symbolTable.set( + '__slots__', + Symbol.createWithType(SymbolFlags.ClassMember | SymbolFlags.ClassVar, iterableType) + ); + } + // If this dataclass derived from a NamedTuple, update the NamedTuple with // the specialized entry types. updateNamedTupleBaseClass( @@ -708,6 +749,7 @@ export function validateDataClassTransformDecorator( keywordOnlyParams: false, generateEq: true, generateOrder: false, + frozen: false, fieldDescriptorNames: [], }; @@ -775,6 +817,24 @@ export function validateDataClassTransformDecorator( break; } + case 'frozen_default': { + const value = evaluateStaticBoolExpression( + arg.valueExpression, + fileInfo.executionEnvironment, + fileInfo.definedConstants + ); + if (value === undefined) { + evaluator.addError( + Localizer.Diagnostic.dataClassTransformExpectedBoolLiteral(), + arg.valueExpression + ); + return; + } + + behaviors.frozen = value; + break; + } + // Earlier versions of the dataclass_transform spec used the name "field_descriptors" // rather than "field_specifiers". The older name is now deprecated but still supported // for the time being because some libraries shipped with the older __dataclass_transform__ @@ -853,6 +913,7 @@ export function getDataclassDecoratorBehaviors(type: Type): DataClassBehaviors | keywordOnlyParams: false, generateEq: true, generateOrder: false, + frozen: false, fieldDescriptorNames: ['dataclasses.field', 'dataclasses.Field'], }; } @@ -865,24 +926,34 @@ function applyDataClassBehaviorOverride( errorNode: ParseNode, classType: ClassType, argName: string, - argValue: ExpressionNode + argValueExpr: ExpressionNode ) { const fileInfo = AnalyzerNodeInfo.getFileInfo(errorNode); - const value = evaluateStaticBoolExpression(argValue, fileInfo.executionEnvironment, fileInfo.definedConstants); + const value = evaluateStaticBoolExpression(argValueExpr, fileInfo.executionEnvironment, fileInfo.definedConstants); + + applyDataClassBehaviorOverrideValue(evaluator, errorNode, classType, argName, value); +} +function applyDataClassBehaviorOverrideValue( + evaluator: TypeEvaluator, + errorNode: ParseNode, + classType: ClassType, + argName: string, + argValue: boolean | undefined +) { switch (argName) { case 'order': - if (value === true) { + if (argValue === true) { classType.details.flags |= ClassTypeFlags.SynthesizedDataClassOrder; - } else if (value === false) { + } else if (argValue === false) { classType.details.flags &= ~ClassTypeFlags.SynthesizedDataClassOrder; } break; case 'kw_only': - if (value === false) { + if (argValue === false) { classType.details.flags &= ~ClassTypeFlags.DataClassKeywordOnlyParams; - } else if (value === true) { + } else if (argValue === true) { classType.details.flags |= ClassTypeFlags.DataClassKeywordOnlyParams; } break; @@ -891,6 +962,12 @@ function applyDataClassBehaviorOverride( let hasUnfrozenBaseClass = false; let hasFrozenBaseClass = false; + if (argValue === false) { + classType.details.flags &= ~ClassTypeFlags.FrozenDataClass; + } else if (argValue === true) { + classType.details.flags |= ClassTypeFlags.FrozenDataClass; + } + classType.details.baseClasses.forEach((baseClass) => { if (isInstantiableClass(baseClass) && ClassType.isDataClass(baseClass)) { if (ClassType.isFrozenDataClass(baseClass)) { @@ -911,58 +988,66 @@ function applyDataClassBehaviorOverride( } }); - if (value === true || hasFrozenBaseClass) { - classType.details.flags |= ClassTypeFlags.FrozenDataClass; - + if (argValue) { // A frozen dataclass cannot derive from a non-frozen dataclass. if (hasUnfrozenBaseClass) { evaluator.addDiagnostic( - fileInfo.diagnosticRuleSet.reportGeneralTypeIssues, + AnalyzerNodeInfo.getFileInfo(errorNode).diagnosticRuleSet.reportGeneralTypeIssues, DiagnosticRule.reportGeneralTypeIssues, Localizer.Diagnostic.dataClassBaseClassNotFrozen(), errorNode ); } + } else { + // A non-frozen dataclass cannot derive from a frozen dataclass. + if (hasFrozenBaseClass) { + evaluator.addDiagnostic( + AnalyzerNodeInfo.getFileInfo(errorNode).diagnosticRuleSet.reportGeneralTypeIssues, + DiagnosticRule.reportGeneralTypeIssues, + Localizer.Diagnostic.dataClassBaseClassFrozen(), + errorNode + ); + } } break; } case 'init': - if (value === false) { + if (argValue === false) { classType.details.flags |= ClassTypeFlags.SkipSynthesizedDataClassInit; - } else if (value === true) { + } else if (argValue === true) { classType.details.flags &= ~ClassTypeFlags.SkipSynthesizedDataClassInit; } break; case 'eq': - if (value === false) { + if (argValue === false) { classType.details.flags |= ClassTypeFlags.SkipSynthesizedDataClassEq; - } else if (value === true) { + } else if (argValue === true) { classType.details.flags &= ~ClassTypeFlags.SkipSynthesizedDataClassEq; } break; case 'slots': - if (value === true) { + if (argValue === true) { classType.details.flags |= ClassTypeFlags.GenerateDataClassSlots; if (classType.details.localSlotsNames) { evaluator.addDiagnostic( - fileInfo.diagnosticRuleSet.reportGeneralTypeIssues, + AnalyzerNodeInfo.getFileInfo(errorNode).diagnosticRuleSet.reportGeneralTypeIssues, DiagnosticRule.reportGeneralTypeIssues, Localizer.Diagnostic.dataClassSlotsOverwrite(), errorNode ); } - } else if (value === false) { + } else if (argValue === false) { classType.details.flags &= ~ClassTypeFlags.GenerateDataClassSlots; } break; case 'hash': case 'unsafe_hash': - if (value === true) { + if (argValue === true) { classType.details.flags |= ClassTypeFlags.SynthesizeDataClassUnsafeHash; } break; @@ -971,14 +1056,28 @@ function applyDataClassBehaviorOverride( export function applyDataClassClassBehaviorOverrides( evaluator: TypeEvaluator, + errorNode: ParseNode, classType: ClassType, - args: FunctionArgument[] + args: FunctionArgument[], + defaultBehaviors: DataClassBehaviors ) { + let sawFrozenArg = false; + args.forEach((arg) => { if (arg.valueExpression && arg.name) { applyDataClassBehaviorOverride(evaluator, arg.name, classType, arg.name.value, arg.valueExpression); + + if (arg.name.value === 'frozen') { + sawFrozenArg = true; + } } }); + + // If there was no frozen argument, it is implicitly false. This will + // validate that we're not overriding a frozen class with a non-frozen class. + if (!sawFrozenArg) { + applyDataClassBehaviorOverrideValue(evaluator, errorNode, classType, 'frozen', defaultBehaviors.frozen); + } } export function applyDataClassDefaultBehaviors(classType: ClassType, defaultBehaviors: DataClassBehaviors) { @@ -996,17 +1095,20 @@ export function applyDataClassDefaultBehaviors(classType: ClassType, defaultBeha if (defaultBehaviors.generateOrder) { classType.details.flags |= ClassTypeFlags.SynthesizedDataClassOrder; } + + if (defaultBehaviors.frozen) { + classType.details.flags |= ClassTypeFlags.FrozenDataClass; + } } export function applyDataClassDecorator( evaluator: TypeEvaluator, + errorNode: ParseNode, classType: ClassType, defaultBehaviors: DataClassBehaviors, callNode: CallNode | undefined ) { applyDataClassDefaultBehaviors(classType, defaultBehaviors); - if (callNode?.arguments) { - applyDataClassClassBehaviorOverrides(evaluator, classType, callNode.arguments); - } + applyDataClassClassBehaviorOverrides(evaluator, errorNode, classType, callNode?.arguments ?? [], defaultBehaviors); } diff --git a/packages/pyright-internal/src/analyzer/declaration.ts b/packages/pyright-internal/src/analyzer/declaration.ts index 1f14a759f..1b0d94097 100644 --- a/packages/pyright-internal/src/analyzer/declaration.ts +++ b/packages/pyright-internal/src/analyzer/declaration.ts @@ -31,6 +31,8 @@ import { YieldNode, } from '../parser/parseNodes'; +export const UnresolvedModuleMarker = '*** unresolved ***'; + export const enum DeclarationType { Intrinsic, Variable, @@ -50,11 +52,13 @@ export interface DeclarationBase { // Used by hover provider to display helpful text. type: DeclarationType; - // Parse node associated with the declaration. + // Parse node associated with the declaration. Does not necessarily match + // the path and range. node: ParseNode; // The file and range within that file that - // contains the declaration. + // contains the declaration. Unless this is an alias, then path refers to the + // file the alias is referring to. path: string; range: Range; @@ -100,6 +104,17 @@ export interface FunctionDeclaration extends DeclarationBase { export interface ParameterDeclaration extends DeclarationBase { type: DeclarationType.Parameter; node: ParameterNode; + + // Documentation specified in the function's docstring (if any) can be + // associated with the parameter + docString?: string; + + // Inferred parameters can be inferred from pieces of an actual NameNode, so this + // value represents the actual 'name' as the user thinks of it. + inferredName?: string; + + // Nodes that potentially makeup the type of an inferred parameter. + inferredTypeNodes?: ExpressionNode[]; } export interface TypeParameterDeclaration extends DeclarationBase { @@ -130,15 +145,6 @@ export interface VariableDeclaration extends DeclarationBase { // constant in that reassignment is not permitted)? isFinal?: boolean; - // Is the declaration a "ClassVar"? - isClassVar?: boolean; - - // Is the declaration annotated with "Required"? - isRequired?: boolean; - - // Is the declaration annotated with "NotRequired"? - isNotRequired?: boolean; - // Is the declaration an entry in __slots__? isDefinedBySlots?: boolean; @@ -152,9 +158,6 @@ export interface VariableDeclaration extends DeclarationBase { // and other complex (more dynamic) class definitions with typed variables. isRuntimeTypeExpression?: boolean; - // Points to the "TypeAlias" annotation described in PEP 613. - typeAliasAnnotation?: ExpressionNode | undefined; - // If the declaration is a type alias, points to the alias name. typeAliasName?: NameNode | undefined; @@ -165,6 +168,9 @@ export interface VariableDeclaration extends DeclarationBase { // If an "attribute docstring" (as defined in PEP 258) is present... docString?: string | undefined; + + // If set, indicates an alternative node to use to determine the type of the variable. + alternativeTypeNode?: ExpressionNode; } // Alias declarations are used for imports. They are resolved @@ -274,3 +280,7 @@ export function isSpecialBuiltInClassDeclaration(decl: Declaration): decl is Spe export function isIntrinsicDeclaration(decl: Declaration): decl is IntrinsicDeclaration { return decl.type === DeclarationType.Intrinsic; } + +export function isUnresolvedAliasDeclaration(decl: Declaration): boolean { + return isAliasDeclaration(decl) && decl.path === UnresolvedModuleMarker; +} diff --git a/packages/pyright-internal/src/analyzer/declarationUtils.ts b/packages/pyright-internal/src/analyzer/declarationUtils.ts index 0c82b16f3..4e6f7980c 100644 --- a/packages/pyright-internal/src/analyzer/declarationUtils.ts +++ b/packages/pyright-internal/src/analyzer/declarationUtils.ts @@ -9,8 +9,17 @@ import { getEmptyRange } from '../common/textRange'; import { NameNode, ParseNodeType } from '../parser/parseNodes'; +import { ImportLookup, ImportLookupResult } from './analyzerFileInfo'; import { AliasDeclaration, Declaration, DeclarationType, isAliasDeclaration, ModuleLoaderActions } from './declaration'; import { getFileInfoFromNode } from './parseTreeUtils'; +import { Symbol } from './symbol'; + +export interface ResolvedAliasInfo { + declaration: Declaration | undefined; + isPrivate: boolean; + privatePyTypedImported?: string; + privatePyTypedImporter?: string; +} export function hasTypeForDeclaration(declaration: Declaration): boolean { switch (declaration.type) { @@ -26,6 +35,8 @@ export function hasTypeForDeclaration(declaration: Declaration): boolean { if (declaration.node.typeAnnotation || declaration.node.typeAnnotationComment) { return true; } + + // Handle function type comments. const parameterParent = declaration.node.parent; if (parameterParent?.nodeType === ParseNodeType.Function) { if ( @@ -33,6 +44,7 @@ export function hasTypeForDeclaration(declaration: Declaration): boolean { !parameterParent.functionAnnotationComment.isParamListEllipsis ) { const paramAnnotations = parameterParent.functionAnnotationComment.paramTypeAnnotations; + // Handle the case where the annotation comment is missing an // annotation for the first parameter (self or cls). if ( @@ -41,6 +53,7 @@ export function hasTypeForDeclaration(declaration: Declaration): boolean { ) { return false; } + return true; } } @@ -58,7 +71,8 @@ export function hasTypeForDeclaration(declaration: Declaration): boolean { export function areDeclarationsSame( decl1: Declaration, decl2: Declaration, - treatModuleInImportAndFromImportSame = false + treatModuleInImportAndFromImportSame = false, + skipRangeForAliases = false ): boolean { if (decl1.type !== decl2.type) { return false; @@ -68,11 +82,13 @@ export function areDeclarationsSame( return false; } - if ( - decl1.range.start.line !== decl2.range.start.line || - decl1.range.start.character !== decl2.range.start.character - ) { - return false; + if (!skipRangeForAliases || decl1.type !== DeclarationType.Alias) { + if ( + decl1.range.start.line !== decl2.range.start.line || + decl1.range.start.character !== decl2.range.start.character + ) { + return false; + } } // Alias declarations refer to the entire import statement. @@ -101,51 +117,6 @@ export function areDeclarationsSame( return true; } -export function isFinalVariableDeclaration(decl: Declaration) { - return decl.type === DeclarationType.Variable && !!decl.isFinal; -} - -export function isExplicitTypeAliasDeclaration(decl: Declaration) { - return decl.type === DeclarationType.Variable && !!decl.typeAliasAnnotation; -} - -export function isPossibleTypeAliasDeclaration(decl: Declaration) { - if (decl.type !== DeclarationType.Variable || !decl.typeAliasName || decl.typeAnnotationNode) { - return false; - } - - if (decl.node.parent?.nodeType !== ParseNodeType.Assignment) { - return false; - } - - // Perform a sanity check on the RHS expression. Some expression - // forms should never be considered legitimate for type aliases. - const rhsOfAssignment = decl.node.parent.rightExpression; - switch (rhsOfAssignment.nodeType) { - case ParseNodeType.Error: - case ParseNodeType.UnaryOperation: - case ParseNodeType.AssignmentExpression: - case ParseNodeType.TypeAnnotation: - case ParseNodeType.Await: - case ParseNodeType.Ternary: - case ParseNodeType.Unpack: - case ParseNodeType.Tuple: - case ParseNodeType.Call: - case ParseNodeType.ListComprehension: - case ParseNodeType.Slice: - case ParseNodeType.Yield: - case ParseNodeType.YieldFrom: - case ParseNodeType.Lambda: - case ParseNodeType.Number: - case ParseNodeType.Dictionary: - case ParseNodeType.List: - case ParseNodeType.Set: - return false; - } - - return true; -} - export function getNameFromDeclaration(declaration: Declaration) { switch (declaration.type) { case DeclarationType.Alias: @@ -238,3 +209,185 @@ export function createSynthesizedAliasDeclaration(path: string): AliasDeclaratio isInExceptSuite: false, }; } + +// If the specified declaration is an alias declaration that points to a symbol, +// it resolves the alias and looks up the symbol, then returns the a declaration +// (typically the last) associated with that symbol. It does this recursively if +// necessary. If a symbol lookup fails, undefined is returned. If resolveLocalNames +// is true, the method resolves aliases through local renames ("as" clauses found +// in import statements). +export function resolveAliasDeclaration( + importLookup: ImportLookup, + declaration: Declaration, + resolveLocalNames: boolean, + allowExternallyHiddenAccess: boolean +): ResolvedAliasInfo | undefined { + let curDeclaration: Declaration | undefined = declaration; + const alreadyVisited: Declaration[] = []; + let isPrivate = false; + + // These variables are used to find a transition from a non-py.typed to + // a py.typed resolution chain. In this case, if the imported symbol + // is a private symbol (i.e. not intended to be re-exported), we store + // the name of the importer and imported modules so the caller can + // report an error. + let sawPyTypedTransition = false; + let privatePyTypedImported: string | undefined; + let privatePyTypedImporter: string | undefined; + + while (true) { + if (curDeclaration.type !== DeclarationType.Alias || !curDeclaration.symbolName) { + return { + declaration: curDeclaration, + isPrivate, + privatePyTypedImported, + privatePyTypedImporter, + }; + } + + // If we are not supposed to follow local alias names and this + // is a local name, don't continue to follow the alias. + if (!resolveLocalNames && curDeclaration.usesLocalName) { + return { + declaration: curDeclaration, + isPrivate, + privatePyTypedImported, + privatePyTypedImporter, + }; + } + + let lookupResult: ImportLookupResult | undefined; + if (curDeclaration.path && curDeclaration.loadSymbolsFromPath) { + lookupResult = importLookup(curDeclaration.path); + } + + const symbol: Symbol | undefined = lookupResult + ? lookupResult.symbolTable.get(curDeclaration.symbolName) + : undefined; + if (!symbol) { + if (curDeclaration.submoduleFallback) { + if (curDeclaration.symbolName) { + // See if we are resolving a specific imported symbol name and the submodule + // fallback cannot be resolved. For example, `from a import b`. If b is both + // a symbol in `a/__init__.py` and a submodule `a/b.py` and we are not using + // type information from this library (e.g. a non-py.typed library source file + // when useLibraryCodeForTypes is disabled), b should be evaluated as Unknown, + // not as a module. + if ( + curDeclaration.submoduleFallback.type === DeclarationType.Alias && + curDeclaration.submoduleFallback.path + ) { + const lookupResult = importLookup(curDeclaration.submoduleFallback.path); + if (!lookupResult) { + return undefined; + } + } + } + + return resolveAliasDeclaration( + importLookup, + curDeclaration.submoduleFallback, + resolveLocalNames, + allowExternallyHiddenAccess + ); + } + + // If the symbol comes from a native library, we won't + // be able to resolve its type directly. + if (curDeclaration.isNativeLib) { + return { + declaration: undefined, + isPrivate, + }; + } + + return undefined; + } + + if (symbol.isPrivateMember()) { + isPrivate = true; + } + + if (symbol.isExternallyHidden() && !allowExternallyHiddenAccess) { + return undefined; + } + + // Prefer declarations with specified types. If we don't have any of those, + // fall back on declarations with inferred types. + let declarations = symbol.getTypedDeclarations(); + + // Try not to use declarations within an except suite even if it's a typed + // declaration. These are typically used for fallback exception handling. + declarations = declarations.filter((decl) => !decl.isInExceptSuite); + + if (declarations.length === 0) { + declarations = symbol.getDeclarations(); + declarations = declarations.filter((decl) => !decl.isInExceptSuite); + } + + if (declarations.length === 0) { + // Use declarations within except clauses if there are no alternatives. + declarations = symbol.getDeclarations(); + } + + if (declarations.length === 0) { + return undefined; + } + + // Prefer the last unvisited declaration in the list. This ensures that + // we use all of the overloads if it's an overloaded function. + const unvisitedDecls = declarations.filter((decl) => !alreadyVisited.includes(decl)); + if (unvisitedDecls.length > 0) { + curDeclaration = unvisitedDecls[unvisitedDecls.length - 1]; + } else { + curDeclaration = declarations[declarations.length - 1]; + } + + if (lookupResult?.isInPyTypedPackage) { + if (!sawPyTypedTransition) { + if (symbol.isPrivatePyTypedImport()) { + privatePyTypedImporter = curDeclaration?.moduleName; + } + + // Note that we've seen a transition from a non-py.typed to a py.typed + // import. No further check is needed. + sawPyTypedTransition = true; + } else { + // If we've already seen a transition, look for the first non-private + // symbol that is resolved so we can tell the user to import from this + // location instead. + if (!symbol.isPrivatePyTypedImport()) { + privatePyTypedImported = privatePyTypedImported ?? curDeclaration?.moduleName; + } + } + } + + // Make sure we don't follow a circular list indefinitely. + if (alreadyVisited.find((decl) => decl === curDeclaration)) { + // If the path path of the alias points back to the original path, use the submodule + // fallback instead. This happens in the case where a module's __init__.py file + // imports a submodule using itself as the import target. For example, if + // the module is foo, and the foo.__init__.py file contains the statement + // "from foo import bar", we want to import the foo/bar.py submodule. + if ( + curDeclaration.path === declaration.path && + curDeclaration.type === DeclarationType.Alias && + curDeclaration.submoduleFallback + ) { + return resolveAliasDeclaration( + importLookup, + curDeclaration.submoduleFallback, + resolveLocalNames, + allowExternallyHiddenAccess + ); + } + return { + declaration, + isPrivate, + privatePyTypedImported, + privatePyTypedImporter, + }; + } + alreadyVisited.push(curDeclaration); + } +} diff --git a/packages/pyright-internal/src/analyzer/docStringConversion.ts b/packages/pyright-internal/src/analyzer/docStringConversion.ts index bd8c086e5..fded1bfac 100644 --- a/packages/pyright-internal/src/analyzer/docStringConversion.ts +++ b/packages/pyright-internal/src/analyzer/docStringConversion.ts @@ -62,7 +62,7 @@ const SpaceDotDotRegExp = /^\s*\.\. /; const DirectiveLikeRegExp = /^\s*\.\.\s+(\w+)::\s*(.*)$/; const DoctestRegExp = / *>>> /; const DirectivesExtraNewlineRegExp = /^\s*:(param|arg|type|return|rtype|raise|except|var|ivar|cvar|copyright|license)/; -const epyDocFieldTokensRegExp = /^[.\s\t]+(@\w+)/; // cv2 has leading '.' http://epydoc.sourceforge.net/manual-epytext.html +const epyDocFieldTokensRegExp = /^\.[\s\t]+(@\w)/gm; // cv2 has leading '.' http://epydoc.sourceforge.net/manual-epytext.html const epyDocCv2FixRegExp = /^(\.\s{3})|^(\.)/; const PotentialHeaders: RegExpReplacement[] = [ @@ -80,6 +80,9 @@ const PlusRegExp = /\+/g; const UnescapedMarkdownCharsRegExp = /(?/g, replacement: '>' }, @@ -113,6 +116,7 @@ class DocStringConverter { private _state: State; private _stateStack: State[] = []; + private _input: string; private _lines: string[]; private _lineNum = 0; @@ -123,11 +127,12 @@ class DocStringConverter { constructor(input: string) { this._state = this._parseText; + this._input = input; this._lines = cleanAndSplitDocString(input); } convert(): string { - const isEpyDoc = this._lines.some((v) => epyDocFieldTokensRegExp.exec(v)); + const isEpyDoc = epyDocFieldTokensRegExp.test(this._input); if (isEpyDoc) { // fixup cv2 leading '.' this._lines = this._lines.map((v) => v.replace(epyDocCv2FixRegExp, '')); @@ -419,8 +424,13 @@ class DocStringConverter { } private _beginBacktickBlock(): boolean { - if (this._currentLine().startsWith('```')) { - this._appendLine(this._currentLine()); + const match = this._currentLine().match(CodeBlockStartRegExp); + if (match !== null) { + this._blockIndent = this._currentIndent(); + + // Remove indentation and preserve language tag. + this._appendLine('```' + match[1]); + this._pushAndSetState(this._parseBacktickBlock); this._eatLine(); return true; @@ -429,7 +439,8 @@ class DocStringConverter { } private _parseBacktickBlock(): void { - if (this._currentLine().startsWith('```')) { + // Only match closing ``` at same indent level of opening. + if (CodeBlockEndRegExp.test(this._currentLine()) && this._currentIndent() === this._blockIndent) { this._appendLine('```'); this._appendLine(); this._popState(); @@ -511,14 +522,15 @@ class DocStringConverter { return; } - if (this._currentLineIsOutsideBlock()) { + const prev = this._lineAt(this._lineNum - 1); + if (this._currentLineIsOutsideBlock() && _isUndefinedOrWhitespace(prev)) { this._trimOutputAndAppendLine('```'); this._appendLine(); this._popState(); return; } - this._appendLine(this._currentLineWithinBlock()); + this._appendLine(this._currentLine()); this._eatLine(); } @@ -681,7 +693,7 @@ class DocStringConverter { }); this._appendLine(formattedLine); - //Convert header end + // Convert header end const endHeaderStr = line.trimStart().replace(/=/g, '-').replace(' ', '|'); this._appendLine(`|${endHeaderStr}|`); this._eatLine(); diff --git a/packages/pyright-internal/src/analyzer/enums.ts b/packages/pyright-internal/src/analyzer/enums.ts index e48d6d403..abf9e9a15 100644 --- a/packages/pyright-internal/src/analyzer/enums.ts +++ b/packages/pyright-internal/src/analyzer/enums.ts @@ -189,7 +189,12 @@ export function transformTypeForPossibleEnumClass( } if (isMemberOfEnumeration) { - const enumLiteral = new EnumLiteral(enumClassInfo.classType.details.name, node.value, valueType); + const enumLiteral = new EnumLiteral( + enumClassInfo.classType.details.fullName, + enumClassInfo.classType.details.name, + node.value, + valueType + ); return ClassType.cloneAsInstance(ClassType.cloneWithLiteral(enumClassInfo.classType, enumLiteral)); } diff --git a/packages/pyright-internal/src/analyzer/importResolver.ts b/packages/pyright-internal/src/analyzer/importResolver.ts index d471ca305..269407dd5 100644 --- a/packages/pyright-internal/src/analyzer/importResolver.ts +++ b/packages/pyright-internal/src/analyzer/importResolver.ts @@ -11,7 +11,7 @@ import type { Dirent } from 'fs'; import { appendArray, flatten, getMapValues, getOrAdd } from '../common/collectionUtils'; -import { ConfigOptions, ExecutionEnvironment } from '../common/configOptions'; +import { ConfigOptions, ExecutionEnvironment, matchFileSpecs } from '../common/configOptions'; import { FileSystem } from '../common/fileSystem'; import { Host } from '../common/host'; import { stubsSuffix } from '../common/pathConsts'; @@ -63,6 +63,11 @@ export interface ModuleNameAndType { isLocalTypingsFile: boolean; } +export interface ModuleNameInfoFromPath { + moduleName: string; + containsInvalidCharacters?: boolean; +} + export function createImportedModuleDescriptor(moduleName: string): ImportedModuleDescriptor { if (moduleName.length === 0) { return { leadingDots: 0, nameParts: [], importedSymbols: [] }; @@ -92,7 +97,8 @@ interface SupportedVersionRange { } const supportedNativeLibExtensions = ['.pyd', '.so', '.dylib']; -export const supportedFileExtensions = ['.py', '.pyi', ...supportedNativeLibExtensions]; +export const supportedSourceFileExtensions = ['.py', '.pyi']; +export const supportedFileExtensions = [...supportedSourceFileExtensions, ...supportedNativeLibExtensions]; // Should we allow partial resolution for third-party packages? Some use tricks // to populate their package namespaces, so we might be able to partially resolve @@ -102,7 +108,7 @@ export const supportedFileExtensions = ['.py', '.pyi', ...supportedNativeLibExte const allowPartialResolutionForThirdPartyPackages = false; export class ImportResolver { - private _cachedPythonSearchPaths: string[] | undefined; + private _cachedPythonSearchPaths: { paths: string[]; failureInfo: string[] } | undefined; private _cachedImportResults = new Map(); private _cachedModuleNameResults = new Map>(); private _cachedTypeshedRoot: string | undefined; @@ -112,7 +118,7 @@ export class ImportResolver { private _cachedTypeshedThirdPartyPackagePaths: Map | undefined; private _cachedTypeshedThirdPartyPackageRoots: string[] | undefined; private _cachedEntriesForPath = new Map(); - + private _stdlibModules: Set | undefined; protected cachedParentImportResults: ParentDirectoryCache; constructor( @@ -127,6 +133,7 @@ export class ImportResolver { this._cachedImportResults = new Map(); this._cachedModuleNameResults = new Map>(); this.cachedParentImportResults.reset(); + this._stdlibModules = undefined; this._invalidateFileSystemCache(); @@ -192,6 +199,7 @@ export class ImportResolver { let current = origin; while (this._shouldWalkUp(current, root, execEnv)) { const result = this.resolveAbsoluteImport( + sourceFilePath, current, execEnv, moduleDescriptor, @@ -236,12 +244,14 @@ export class ImportResolver { moduleDescriptor: ImportedModuleDescriptor, importFailureInfo: string[] ) { + const fromUserFile = matchFileSpecs(this._configOptions, sourceFilePath); const notFoundResult: ImportResult = { importName, isRelative: false, isImportFound: false, isPartlyResolved: false, isNamespacePackage: false, + isInitFilePresent: false, isStubPackage: false, importFailureInfo, resolvedPaths: [], @@ -271,7 +281,12 @@ export class ImportResolver { } } else { // Is it already cached? - const cachedResults = this._lookUpResultsInCache(execEnv, importName, moduleDescriptor.importedSymbols); + const cachedResults = this._lookUpResultsInCache( + execEnv, + importName, + moduleDescriptor.importedSymbols, + fromUserFile + ); if (cachedResults) { // In most cases, we can simply return a cached entry. However, there are cases @@ -307,11 +322,23 @@ export class ImportResolver { ) || notFoundResult; } - return this.addResultsToCache(execEnv, importName, bestImport, moduleDescriptor.importedSymbols); + return this.addResultsToCache( + execEnv, + importName, + bestImport, + moduleDescriptor.importedSymbols, + fromUserFile + ); } } - return this.addResultsToCache(execEnv, importName, notFoundResult, /* importedSymbols */ undefined); + return this.addResultsToCache( + execEnv, + importName, + notFoundResult, + /* importedSymbols */ undefined, + fromUserFile + ); } getCompletionSuggestions( @@ -352,17 +379,22 @@ export class ImportResolver { return suggestions; } - getConfigOption() { + getConfigOptions() { return this._configOptions; } + setConfigOptions(configOptions: ConfigOptions): void { + this._configOptions = configOptions; + this.invalidateCache(); + } + private _getCompletionSuggestionsStrict( sourceFilePath: string, execEnv: ExecutionEnvironment, moduleDescriptor: ImportedModuleDescriptor - ): Set { + ): Map { const importFailureInfo: string[] = []; - const suggestions = new Set(); + const suggestions = new Map(); // Is it a relative import? if (moduleDescriptor.leadingDots > 0) { @@ -537,19 +569,29 @@ export class ImportResolver { // Returns the module name (of the form X.Y.Z) that needs to be imported // from the current context to access the module with the specified file path. // In a sense, it's performing the inverse of resolveImport. - getModuleNameForImport(filePath: string, execEnv: ExecutionEnvironment) { + getModuleNameForImport(filePath: string, execEnv: ExecutionEnvironment, allowInvalidModuleName = false) { // Cache results of the reverse of resolveImport as we cache resolveImport. const cache = getOrAdd(this._cachedModuleNameResults, execEnv.root, () => new Map()); - return getOrAdd(cache, filePath, () => this._getModuleNameForImport(filePath, execEnv)); + return getOrAdd(cache, filePath, () => this._getModuleNameForImport(filePath, execEnv, allowInvalidModuleName)); } - private _getModuleNameForImport(filePath: string, execEnv: ExecutionEnvironment): ModuleNameAndType { + private _getModuleNameForImport( + filePath: string, + execEnv: ExecutionEnvironment, + allowInvalidModuleName: boolean + ): ModuleNameAndType { let moduleName: string | undefined; let importType = ImportType.BuiltIn; let isLocalTypingsFile = false; const importFailureInfo: string[] = []; + // If we cannot find a fully-qualified module name with legal characters, + // look for one with invalid characters (e.g. "-"). This is important to + // differentiate between different modules in a project in case they + // declare types with the same (local) name. + let moduleNameWithInvalidCharacters: string | undefined; + // Is this a stdlib typeshed path? const stdLibTypeshedPath = this._getStdlibTypeshedPath(execEnv, importFailureInfo); if (stdLibTypeshedPath) { @@ -569,33 +611,56 @@ export class ImportResolver { // Look for it in the root directory of the execution environment. if (execEnv.root) { - moduleName = this.getModuleNameFromPath(execEnv.root, filePath); + const candidateModuleNameInfo = this.getModuleNameInfoFromPath(execEnv.root, filePath); + + if (candidateModuleNameInfo) { + if (candidateModuleNameInfo.containsInvalidCharacters) { + moduleNameWithInvalidCharacters = candidateModuleNameInfo.moduleName; + } else { + moduleName = candidateModuleNameInfo.moduleName; + } + } + importType = ImportType.Local; } for (const extraPath of execEnv.extraPaths) { - const candidateModuleName = this.getModuleNameFromPath(extraPath, filePath); + const candidateModuleNameInfo = this.getModuleNameInfoFromPath(extraPath, filePath); - // Does this candidate look better than the previous best module name? - // We'll always try to use the shortest version. - if (!moduleName || (candidateModuleName && candidateModuleName.length < moduleName.length)) { - moduleName = candidateModuleName; - importType = ImportType.Local; + if (candidateModuleNameInfo) { + if (candidateModuleNameInfo.containsInvalidCharacters) { + moduleNameWithInvalidCharacters = candidateModuleNameInfo.moduleName; + } else { + // Does this candidate look better than the previous best module name? + // We'll always try to use the shortest version. + const candidateModuleName = candidateModuleNameInfo.moduleName; + if (!moduleName || (candidateModuleName && candidateModuleName.length < moduleName.length)) { + moduleName = candidateModuleName; + importType = ImportType.Local; + } + } } } // Check for a typings file. if (this._configOptions.stubPath) { - const candidateModuleName = this.getModuleNameFromPath(this._configOptions.stubPath, filePath); + const candidateModuleNameInfo = this.getModuleNameInfoFromPath(this._configOptions.stubPath, filePath); - // Does this candidate look better than the previous best module name? - // We'll always try to use the shortest version. - if (!moduleName || (candidateModuleName && candidateModuleName.length < moduleName.length)) { - moduleName = candidateModuleName; - - // Treat the typings path as a local import so errors are reported for it. - importType = ImportType.Local; - isLocalTypingsFile = true; + if (candidateModuleNameInfo) { + if (candidateModuleNameInfo.containsInvalidCharacters) { + moduleNameWithInvalidCharacters = candidateModuleNameInfo.moduleName; + } else { + // Does this candidate look better than the previous best module name? + // We'll always try to use the shortest version. + const candidateModuleName = candidateModuleNameInfo.moduleName; + if (!moduleName || (candidateModuleName && candidateModuleName.length < moduleName.length)) { + moduleName = candidateModuleName; + + // Treat the typings path as a local import so errors are reported for it. + importType = ImportType.Local; + isLocalTypingsFile = true; + } + } } } @@ -630,14 +695,22 @@ export class ImportResolver { // Look for the import in the list of third-party packages. const pythonSearchPaths = this.getPythonSearchPaths(importFailureInfo); + for (const searchPath of pythonSearchPaths) { - const candidateModuleName = this.getModuleNameFromPath(searchPath, filePath); + const candidateModuleNameInfo = this.getModuleNameInfoFromPath(searchPath, filePath); - // Does this candidate look better than the previous best module name? - // We'll always try to use the shortest version. - if (!moduleName || (candidateModuleName && candidateModuleName.length < moduleName.length)) { - moduleName = candidateModuleName; - importType = ImportType.ThirdParty; + if (candidateModuleNameInfo) { + if (candidateModuleNameInfo.containsInvalidCharacters) { + moduleNameWithInvalidCharacters = candidateModuleNameInfo.moduleName; + } else { + // Does this candidate look better than the previous best module name? + // We'll always try to use the shortest version. + const candidateModuleName = candidateModuleNameInfo.moduleName; + if (!moduleName || (candidateModuleName && candidateModuleName.length < moduleName.length)) { + moduleName = candidateModuleName; + importType = ImportType.ThirdParty; + } + } } } @@ -645,6 +718,10 @@ export class ImportResolver { return { moduleName, importType, isLocalTypingsFile }; } + if (allowInvalidModuleName && moduleNameWithInvalidCharacters) { + return { moduleName: moduleNameWithInvalidCharacters, importType, isLocalTypingsFile }; + } + // We didn't find any module name. return { moduleName: '', importType: ImportType.Local, isLocalTypingsFile }; } @@ -654,6 +731,19 @@ export class ImportResolver { return this._getStdlibTypeshedPath(execEnv, unused); } + getTypeshedThirdPartyPath(execEnv: ExecutionEnvironment) { + const unused: string[] = []; + return this._getThirdPartyTypeshedPath(execEnv, unused); + } + + isStdlibModule(module: ImportedModuleDescriptor, execEnv: ExecutionEnvironment): boolean { + if (!this._stdlibModules) { + this._stdlibModules = this._buildStdlibCache(this.getTypeshedStdLibPath(execEnv)); + } + + return this._stdlibModules.has(module.nameParts.join('.')); + } + getImportRoots(execEnv: ExecutionEnvironment, forLogging = false) { const importFailureInfo: string[] = []; const roots = []; @@ -808,10 +898,11 @@ export class ImportResolver { execEnv: ExecutionEnvironment, importName: string, importResult: ImportResult, - importedSymbols: string[] | undefined + importedSymbols: string[] | undefined, + fromUserFile: boolean ) { getOrAdd(this._cachedImportResults, execEnv.root, () => new Map()).set( - importName, + this._getCacheKey(importName, fromUserFile), importResult ); @@ -821,6 +912,7 @@ export class ImportResolver { // Follows import resolution algorithm defined in PEP-420: // https://www.python.org/dev/peps/pep-0420/ protected resolveAbsoluteImport( + sourceFilePath: string | undefined, rootPath: string, execEnv: ExecutionEnvironment, moduleDescriptor: ImportedModuleDescriptor, @@ -837,6 +929,7 @@ export class ImportResolver { // their stubs separately from their package implementation by appending the string // '-stubs' to its top - level directory name. We'll look there first. const importResult = this._resolveAbsoluteImport( + sourceFilePath, rootPath, execEnv, moduleDescriptor, @@ -860,6 +953,7 @@ export class ImportResolver { } return this._resolveAbsoluteImport( + sourceFilePath, rootPath, execEnv, moduleDescriptor, @@ -892,6 +986,7 @@ export class ImportResolver { } private _resolveAbsoluteImport( + sourceFilePath: string | undefined, rootPath: string, execEnv: ExecutionEnvironment, moduleDescriptor: ImportedModuleDescriptor, @@ -914,6 +1009,7 @@ export class ImportResolver { const resolvedPaths: string[] = []; let dirPath = rootPath; let isNamespacePackage = false; + let isInitFilePresent = false; let isStubPackage = false; let isStubFile = false; let isNativeLib = false; @@ -963,7 +1059,7 @@ export class ImportResolver { const fileNameWithoutExtension = '__init__'; const pyFilePath = combinePaths(dirPath, fileNameWithoutExtension + '.py'); const pyiFilePath = combinePaths(dirPath, fileNameWithoutExtension + '.pyi'); - let foundInit = false; + isInitFilePresent = false; if (allowPyi && this.fileExistsCached(pyiFilePath)) { importFailureInfo.push(`Resolved import with file '${pyiFilePath}'`); @@ -971,11 +1067,11 @@ export class ImportResolver { if (isLastPart) { isStubFile = true; } - foundInit = true; + isInitFilePresent = true; } else if (this.fileExistsCached(pyFilePath)) { importFailureInfo.push(`Resolved import with file '${pyFilePath}'`); resolvedPaths.push(pyFilePath); - foundInit = true; + isInitFilePresent = true; } if (!pyTypedInfo && lookForPyTyped) { @@ -987,7 +1083,7 @@ export class ImportResolver { if (!isLastPart) { // We are not at the last part, and we found a directory, // so continue to look for the next part. - if (!foundInit) { + if (!isInitFilePresent) { resolvedPaths.push(''); isNamespacePackage = true; pyTypedInfo = undefined; @@ -995,7 +1091,7 @@ export class ImportResolver { continue; } - if (foundInit) { + if (isInitFilePresent) { implicitImports = this._findImplicitImports(moduleDescriptor.nameParts.join('.'), dirPath, [ pyFilePath, pyiFilePath, @@ -1069,6 +1165,7 @@ export class ImportResolver { importName, isRelative: false, isNamespacePackage, + isInitFilePresent, isStubPackage, isImportFound: importFound, isPartlyResolved, @@ -1124,17 +1221,22 @@ export class ImportResolver { return undefined; } + private _getCacheKey(importName: string, fromUserFile: boolean) { + return `${importName}-${fromUserFile}`; + } + private _lookUpResultsInCache( execEnv: ExecutionEnvironment, importName: string, - importedSymbols: string[] | undefined + importedSymbols: string[] | undefined, + fromUserFile: boolean ) { const cacheForExecEnv = this._cachedImportResults.get(execEnv.root); if (!cacheForExecEnv) { return undefined; } - const cachedEntry = cacheForExecEnv.get(importName); + const cachedEntry = cacheForExecEnv.get(this._getCacheKey(importName, fromUserFile)); if (!cachedEntry) { return undefined; } @@ -1169,6 +1271,19 @@ export class ImportResolver { filePath: string, stripTopContainerDir = false ): string | undefined { + const moduleNameInfo = this.getModuleNameInfoFromPath(containerPath, filePath, stripTopContainerDir); + if (!moduleNameInfo || moduleNameInfo.containsInvalidCharacters) { + return undefined; + } + + return moduleNameInfo.moduleName; + } + + protected getModuleNameInfoFromPath( + containerPath: string, + filePath: string, + stripTopContainerDir = false + ): ModuleNameInfoFromPath | undefined { containerPath = ensureTrailingDirectorySeparator(containerPath); let filePathWithoutExtension = stripFileExtension(filePath); @@ -1208,11 +1323,12 @@ export class ImportResolver { } // Check whether parts contains invalid characters. - if (parts.some((p) => !this._isIdentifier(p))) { - return undefined; - } + const containsInvalidCharacters = parts.some((p) => !this._isIdentifier(p)); - return parts.join('.'); + return { + moduleName: parts.join('.'), + containsInvalidCharacters, + }; } private _resolveBestAbsoluteImport( @@ -1228,6 +1344,7 @@ export class ImportResolver { if (allowPyi && this._configOptions.stubPath) { importFailureInfo.push(`Looking in stubPath '${this._configOptions.stubPath}'`); const typingsImport = this.resolveAbsoluteImport( + sourceFilePath, this._configOptions.stubPath, execEnv, moduleDescriptor, @@ -1269,6 +1386,7 @@ export class ImportResolver { importFailureInfo.push(`Looking in root directory of execution environment ` + `'${execEnv.root}'`); localImport = this.resolveAbsoluteImport( + sourceFilePath, execEnv.root, execEnv, moduleDescriptor, @@ -1286,6 +1404,7 @@ export class ImportResolver { for (const extraPath of execEnv.extraPaths) { importFailureInfo.push(`Looking in extraPath '${extraPath}'`); localImport = this.resolveAbsoluteImport( + sourceFilePath, extraPath, execEnv, moduleDescriptor, @@ -1307,6 +1426,7 @@ export class ImportResolver { importFailureInfo.push(`Looking in python search path '${searchPath}'`); const thirdPartyImport = this.resolveAbsoluteImport( + sourceFilePath, searchPath, execEnv, moduleDescriptor, @@ -1417,6 +1537,9 @@ export class ImportResolver { if (bestImportSoFar.importType === ImportType.Local && !bestImportSoFar.isNamespacePackage) { return bestImportSoFar; } + if (newImport.importType === ImportType.Local && !newImport.isNamespacePackage) { + return newImport; + } // If both are namespace imports, select the one that resolves the symbols. if ( @@ -1424,11 +1547,18 @@ export class ImportResolver { newImport.isNamespacePackage && moduleDescriptor.importedSymbols ) { - if ( - !this._isNamespacePackageResolved(moduleDescriptor, bestImportSoFar.implicitImports) && - this._isNamespacePackageResolved(moduleDescriptor, newImport.implicitImports) - ) { - return newImport; + if (!this._isNamespacePackageResolved(moduleDescriptor, bestImportSoFar.implicitImports)) { + if (this._isNamespacePackageResolved(moduleDescriptor, newImport.implicitImports)) { + return newImport; + } + + // Prefer the namespace package that has an __init__.py(i) file present + // in the final directory over one that does not. + if (bestImportSoFar.isInitFilePresent && !newImport.isInitFilePresent) { + return bestImportSoFar; + } else if (!bestImportSoFar.isInitFilePresent && newImport.isInitFilePresent) { + return newImport; + } } } @@ -1469,23 +1599,21 @@ export class ImportResolver { return true; } - protected getPythonSearchPaths(importFailureInfo: string[]) { + getPythonSearchPaths(importFailureInfo: string[]) { // Find the site packages for the configured virtual environment. if (!this._cachedPythonSearchPaths) { + const info: string[] = []; const paths = ( - PythonPathUtils.findPythonSearchPaths( - this.fileSystem, - this._configOptions, - this.host, - importFailureInfo - ) || [] + PythonPathUtils.findPythonSearchPaths(this.fileSystem, this._configOptions, this.host, info) || [] ).map((p) => this.fileSystem.realCasePath(p)); // Remove duplicates (yes, it happens). - this._cachedPythonSearchPaths = [...new Set(paths)]; + this._cachedPythonSearchPaths = { paths: [...new Set(paths)], failureInfo: info }; } - return this._cachedPythonSearchPaths; + // Make sure we cache the logs as well so we can find out why search path failed. + importFailureInfo.push(...this._cachedPythonSearchPaths.failureInfo); + return this._cachedPythonSearchPaths.paths; } private _findTypeshedPath( @@ -1515,6 +1643,7 @@ export class ImportResolver { for (const typeshedPath of typeshedPaths) { if (this.dirExistsCached(typeshedPath)) { const importInfo = this.resolveAbsoluteImport( + undefined, typeshedPath, execEnv, moduleDescriptor, @@ -1534,6 +1663,31 @@ export class ImportResolver { return undefined; } + // Finds all of the stdlib modules and returns a Set containing all of their names. + private _buildStdlibCache(stdlibRoot: string | undefined): Set { + const cache = new Set(); + + if (stdlibRoot) { + const readDir = (root: string, prefix: string | undefined) => { + this.readdirEntriesCached(root).forEach((entry) => { + if (entry.isDirectory()) { + const dirRoot = combinePaths(root, entry.name); + readDir(dirRoot, prefix ? `${prefix}.${entry.name}` : entry.name); + } else if (entry.name.includes('.py')) { + const stripped = stripFileExtension(entry.name); + // Skip anything starting with an underscore. + if (!stripped.startsWith('_')) { + cache.add(prefix ? `${prefix}.${stripped}` : stripped); + } + } + }); + }; + readDir(stdlibRoot, undefined); + } + + return cache; + } + // Populates a cache of third-party packages found within the typeshed // directory. They are organized such that top-level directories contain // the pypi-registered name of the package and an inner directory contains @@ -1584,7 +1738,7 @@ export class ImportResolver { execEnv: ExecutionEnvironment, moduleDescriptor: ImportedModuleDescriptor, isStdLib: boolean, - suggestions: Set + suggestions: Map ) { const importFailureInfo: string[] = []; @@ -1858,6 +2012,7 @@ export class ImportResolver { // Now try to match the module parts from the current directory location. const absImport = this.resolveAbsoluteImport( + sourceFilePath, directory, execEnv, moduleDescriptor, @@ -1872,6 +2027,7 @@ export class ImportResolver { // the same folder for the real module. Otherwise, it will // error out on runtime. absImport.nonStubImportResult = this.resolveAbsoluteImport( + sourceFilePath, directory, execEnv, moduleDescriptor, @@ -1906,7 +2062,7 @@ export class ImportResolver { sourceFilePath: string, execEnv: ExecutionEnvironment, moduleDescriptor: ImportedModuleDescriptor, - suggestions: Set + suggestions: Map ) { // Determine which search path this file is part of. const directory = getDirectoryLeadingDotsPointsTo( @@ -1941,7 +2097,7 @@ export class ImportResolver { execEnv: ExecutionEnvironment, rootPath: string, moduleDescriptor: ImportedModuleDescriptor, - suggestions: Set, + suggestions: Map, strictOnly = true ) { // Starting at the specified path, walk the file system to find the @@ -2003,7 +2159,7 @@ export class ImportResolver { execEnv: ExecutionEnvironment, currentPath: string, filter: string, - suggestions: Set, + suggestions: Map, leadingDots: number, parentNameParts: string[], strictOnly: boolean @@ -2044,7 +2200,7 @@ export class ImportResolver { return; } - suggestions.add(fileWithoutExtension); + suggestions.set(fileWithoutExtension, combinePaths(currentPath, file)); } }); @@ -2060,7 +2216,20 @@ export class ImportResolver { return; } - suggestions.add(dir); + const initPyiPath = combinePaths(currentPath, dir, '__init__.pyi'); + if (this.fileExistsCached(initPyiPath)) { + suggestions.set(dir, initPyiPath); + return; + } + + const initPyPath = combinePaths(currentPath, dir, '__init__.py'); + if (this.fileExistsCached(initPyPath)) { + suggestions.set(dir, initPyPath); + return; + } + + // It is a namespace package. there is no corresponding module path. + suggestions.set(dir, ''); }); } @@ -2093,7 +2262,7 @@ export class ImportResolver { return this._resolveImport(sourceFilePath, execEnv, moduleDescriptor).isImportFound; } - private _isUniqueValidSuggestion(suggestionToAdd: string, suggestions: Set) { + private _isUniqueValidSuggestion(suggestionToAdd: string, suggestions: Map) { if (suggestions.has(suggestionToAdd)) { return false; } @@ -2222,6 +2391,7 @@ export class ImportResolver { isNativeLib: false, name: dirName, path, + pyTypedInfo: getPyTypedInfo(this.fileSystem, combinePaths(dirPath, dirName)), }; implicitImportMap.set(implicitImport.name, implicitImport); diff --git a/packages/pyright-internal/src/analyzer/importResult.ts b/packages/pyright-internal/src/analyzer/importResult.ts index 7ac1e9c74..93586ca7a 100644 --- a/packages/pyright-internal/src/analyzer/importResult.ts +++ b/packages/pyright-internal/src/analyzer/importResult.ts @@ -20,6 +20,7 @@ export interface ImplicitImport { isNativeLib: boolean; name: string; path: string; + pyTypedInfo?: PyTypedInfo | undefined; } export interface ImportResult { @@ -38,9 +39,13 @@ export interface ImportResult { isPartlyResolved: boolean; // True if the import refers to a namespace package (a - // folder without an __init__.py file). + // folder without an __init__.py(i) file at every level). isNamespacePackage: boolean; + // True if there is an __init__.py(i) file in the final + // directory resolved. + isInitFilePresent: boolean; + // Did it resolve to a stub within a stub package? isStubPackage: boolean; diff --git a/packages/pyright-internal/src/analyzer/importStatementUtils.ts b/packages/pyright-internal/src/analyzer/importStatementUtils.ts index 2da9d2116..0e76dc83b 100644 --- a/packages/pyright-internal/src/analyzer/importStatementUtils.ts +++ b/packages/pyright-internal/src/analyzer/importStatementUtils.ts @@ -5,7 +5,7 @@ * Author: Eric Traut * * Utility routines for summarizing and manipulating - * import statements in a python source file. + * import statements in a Python source file. */ import { CancellationToken } from 'vscode-languageserver'; @@ -901,3 +901,18 @@ export function getResolvedFilePath(importResult: ImportResult | undefined) { // Regular case. return importResult.resolvedPaths[importResult.resolvedPaths.length - 1]; } + +export function haveSameParentModule(module1: string[], module2: string[]) { + if (module1.length !== module2.length) { + return false; + } + + let i = 0; + for (i = 0; i < module1.length - 1; i++) { + if (module1[i] !== module2[i]) { + break; + } + } + + return i === module1.length - 1; +} diff --git a/packages/pyright-internal/src/analyzer/namedTuples.ts b/packages/pyright-internal/src/analyzer/namedTuples.ts index f08d27a7b..d930b8fbe 100644 --- a/packages/pyright-internal/src/analyzer/namedTuples.ts +++ b/packages/pyright-internal/src/analyzer/namedTuples.ts @@ -218,7 +218,7 @@ export function createNamedTupleType( entryNameNode = entry.expressions[0]; entryTypeNode = entry.expressions[1]; entryType = convertToInstance( - evaluator.getTypeOfExpressionExpectingType(entryTypeNode, /* allowFinal */ false).type + evaluator.getTypeOfExpressionExpectingType(entryTypeNode).type ); } else { evaluator.addError(Localizer.Diagnostic.namedTupleNameType(), entry); diff --git a/packages/pyright-internal/src/analyzer/packageTypeVerifier.ts b/packages/pyright-internal/src/analyzer/packageTypeVerifier.ts index 09473e0b6..fa647fbd8 100644 --- a/packages/pyright-internal/src/analyzer/packageTypeVerifier.ts +++ b/packages/pyright-internal/src/analyzer/packageTypeVerifier.ts @@ -8,7 +8,9 @@ * that the types are complete. */ +import { CommandLineOptions } from '../common/commandLineOptions'; import { ConfigOptions, ExecutionEnvironment } from '../common/configOptions'; +import { NullConsole } from '../common/console'; import { assert } from '../common/debug'; import { Diagnostic, DiagnosticAddendum, DiagnosticCategory } from '../common/diagnostic'; import { FileSystem } from '../common/fileSystem'; @@ -55,7 +57,7 @@ import { isPartlyUnknown, } from './typeUtils'; -type PublicSymbolMap = Map; +type PublicSymbolSet = Set; export class PackageTypeVerifier { private _configOptions: ConfigOptions; @@ -63,9 +65,24 @@ export class PackageTypeVerifier { private _importResolver: ImportResolver; private _program: Program; - constructor(private _fileSystem: FileSystem, private _packageName: string, private _ignoreExternal = false) { + constructor( + private _fileSystem: FileSystem, + commandLineOptions: CommandLineOptions, + private _packageName: string, + private _ignoreExternal = false + ) { + const host = new FullAccessHost(_fileSystem); this._configOptions = new ConfigOptions(''); + this._configOptions.defaultPythonPlatform = commandLineOptions.pythonPlatform; + this._configOptions.defaultPythonVersion = commandLineOptions.pythonVersion; + + // Make sure we have default python version and platform set if the user didn't + // specify these on the command line. + const console = new NullConsole(); + this._configOptions.ensureDefaultPythonPlatform(host, console); + this._configOptions.ensureDefaultPythonVersion(host, console); + if (_ignoreExternal) { this._configOptions.evaluateUnknownImportsAsAny = true; } @@ -141,16 +158,16 @@ export class PackageTypeVerifier { ); } - // Build a map of all public symbols exported by this package. We'll + // Build a set of all public symbols exported by this package. We'll // use this map to determine which diagnostics to report. We don't want // to report diagnostics many times for types that include public types. - const publicSymbolMap = new Map(); + const publicSymbols = new Set(); publicModules.forEach((moduleName) => { - this._getPublicSymbolsForModule(moduleName, publicSymbolMap, report.alternateSymbolNames); + this._getPublicSymbolsForModule(moduleName, publicSymbols, report.alternateSymbolNames); }); publicModules.forEach((moduleName) => { - this._verifyTypesOfModule(moduleName, publicSymbolMap, report); + this._verifyTypesOfModule(moduleName, publicSymbols, report); }); } } @@ -225,7 +242,7 @@ export class PackageTypeVerifier { private _getPublicSymbolsForModule( moduleName: string, - symbolMap: PublicSymbolMap, + publicSymbols: PublicSymbolSet, alternateSymbolNames: AlternateSymbolNameMap ) { const importResult = this._resolveImport(moduleName); @@ -247,7 +264,7 @@ export class PackageTypeVerifier { const moduleScope = getScopeForNode(parseTree)!; this._getPublicSymbolsInSymbolTable( - symbolMap, + publicSymbols, alternateSymbolNames, module, module.name, @@ -259,7 +276,7 @@ export class PackageTypeVerifier { } private _getPublicSymbolsInSymbolTable( - symbolMap: PublicSymbolMap, + publicSymbols: PublicSymbolSet, alternateSymbolNames: AlternateSymbolNameMap, module: ModuleInfo, scopeName: string, @@ -276,7 +293,7 @@ export class PackageTypeVerifier { if (!symbol.isExternallyHidden() && !symbol.isPrivateMember() && !symbol.isPrivatePyTypedImport()) { const symbolType = this._program.getTypeOfSymbol(symbol); - symbolMap.set(fullName, fullName); + publicSymbols.add(fullName); const typedDecls = symbol.getTypedDeclarations(); @@ -287,7 +304,7 @@ export class PackageTypeVerifier { if (classDecl) { if (isInstantiableClass(symbolType)) { this._getPublicSymbolsInSymbolTable( - symbolMap, + publicSymbols, alternateSymbolNames, module, fullName, @@ -327,7 +344,7 @@ export class PackageTypeVerifier { } } - private _verifyTypesOfModule(moduleName: string, publicSymbolMap: PublicSymbolMap, report: PackageTypeReport) { + private _verifyTypesOfModule(moduleName: string, publicSymbols: PublicSymbolSet, report: PackageTypeReport) { const importResult = this._resolveImport(moduleName); if (!importResult.isImportFound) { report.generalDiagnostics.push( @@ -364,7 +381,7 @@ export class PackageTypeVerifier { module.name, moduleScope.symbolTable, ScopeType.Module, - publicSymbolMap + publicSymbols ); } else { report.generalDiagnostics.push( @@ -455,7 +472,7 @@ export class PackageTypeVerifier { scopeName: string, symbolTable: SymbolTable, scopeType: ScopeType, - publicSymbolMap: PublicSymbolMap, + publicSymbols: PublicSymbolSet, overrideSymbolCallback?: (name: string, symbol: Symbol) => Symbol ): TypeKnownStatus { if (this._shouldIgnoreType(report, scopeName)) { @@ -516,16 +533,16 @@ export class PackageTypeVerifier { let symbolInfo: SymbolInfo; if (primaryDecl?.type === DeclarationType.Class && isInstantiableClass(symbolType)) { - symbolInfo = this._getSymbolForClass(report, symbolType, publicSymbolMap); + symbolInfo = this._getSymbolForClass(report, symbolType, publicSymbols); } else if (primaryDecl?.type === DeclarationType.Alias && isModule(symbolType)) { - symbolInfo = this._getSymbolForModule(report, symbolType, publicSymbolMap); + symbolInfo = this._getSymbolForModule(report, symbolType, publicSymbols); } else { const decls = symbol.getDeclarations(); const primaryDecl = decls.length > 0 ? decls[decls.length - 1] : undefined; const declRange = primaryDecl?.range || getEmptyRange(); const declPath = primaryDecl?.path || ''; const symbolCategory = this._getSymbolCategory(symbol, symbolType); - const isExported = publicSymbolMap.has(fullName); + const isExported = publicSymbols.has(fullName); // If the only reference to this symbol is a "__slots__" entry, we will // skip it when considering type completeness. @@ -558,7 +575,7 @@ export class PackageTypeVerifier { symbolType, declRange, declPath, - publicSymbolMap + publicSymbols ); } } @@ -572,19 +589,13 @@ export class PackageTypeVerifier { const extraInfo = new DiagnosticAddendum(); if (baseSymbolType) { extraInfo.addMessage( - `Type declared in base class is "${this._program.printType( - baseSymbolType, - /* expandTypeAlias */ false - )}"` + `Type declared in base class is "${this._program.printType(baseSymbolType)}"` ); } if (childSymbolType) { extraInfo.addMessage( - `Type inferred in child class is "${this._program.printType( - childSymbolType, - /* expandTypeAlias */ false - )}"` + `Type inferred in child class is "${this._program.printType(childSymbolType)}"` ); if (TypeBase.isAmbiguous(childSymbolType)) { @@ -622,7 +633,7 @@ export class PackageTypeVerifier { type: Type, declRange: Range, declFilePath: string, - publicSymbolMap: PublicSymbolMap, + publicSymbols: PublicSymbolSet, skipDocStringCheck = false ): TypeKnownStatus { let knownStatus = TypeKnownStatus.Known; @@ -653,9 +664,7 @@ export class PackageTypeVerifier { if (TypeBase.isAmbiguous(type) && !isUnknown(type)) { const ambiguousDiag = new DiagnosticAddendum(); - ambiguousDiag.addMessage( - `Inferred type is "${this._program.printType(type, /* expandTypeAlias */ false)}"` - ); + ambiguousDiag.addMessage(`Inferred type is "${this._program.printType(type)}"`); this._addSymbolError( symbolInfo, 'Type is missing type annotation and could be inferred differently by type checkers' + @@ -697,7 +706,7 @@ export class PackageTypeVerifier { subtype, declRange, declFilePath, - publicSymbolMap + publicSymbols ) ); }); @@ -714,7 +723,7 @@ export class PackageTypeVerifier { overload, declRange, declFilePath, - publicSymbolMap + publicSymbols ) ); } @@ -728,7 +737,7 @@ export class PackageTypeVerifier { this._getFunctionTypeKnownStatus( report, type, - publicSymbolMap, + publicSymbols, symbolInfo, declRange, declFilePath, @@ -777,7 +786,7 @@ export class PackageTypeVerifier { accessType, getEmptyRange(), '', - publicSymbolMap, + publicSymbols, skipDocStringCheck ) ); @@ -789,8 +798,8 @@ export class PackageTypeVerifier { if (!this._shouldIgnoreType(report, type.details.fullName)) { // Don't bother type-checking built-in types. if (!ClassType.isBuiltIn(type)) { - // Reference the class. - this._getSymbolForClass(report, type, publicSymbolMap); + const symbolInfo = this._getSymbolForClass(report, type, publicSymbols); + knownStatus = this._updateKnownStatusIfWorse(knownStatus, symbolInfo.typeKnownStatus); } } @@ -807,7 +816,7 @@ export class PackageTypeVerifier { knownStatus = this._updateKnownStatusIfWorse(knownStatus, TypeKnownStatus.Unknown); } else if (isPartlyUnknown(typeArg)) { const diag = new DiagnosticAddendum(); - diag.addMessage(`Type is ${this._program.printType(typeArg, /* expandTypeAlias */ false)}`); + diag.addMessage(`Type is ${this._program.printType(typeArg)}`); this._addSymbolError( symbolInfo, `Type argument ${index + 1} for class "${ @@ -826,7 +835,7 @@ export class PackageTypeVerifier { case TypeCategory.Module: { if (!this._shouldIgnoreType(report, type.moduleName)) { - const moduleSymbol = this._getSymbolForModule(report, type, publicSymbolMap); + const moduleSymbol = this._getSymbolForModule(report, type, publicSymbols); if (moduleSymbol.typeKnownStatus !== TypeKnownStatus.Known) { this._addSymbolError( symbolInfo, @@ -851,7 +860,7 @@ export class PackageTypeVerifier { private _getFunctionTypeKnownStatus( report: PackageTypeReport, type: FunctionType, - publicSymbolMap: PublicSymbolMap, + publicSymbols: PublicSymbolSet, symbolInfo?: SymbolInfo, declRange?: Range, declFilePath?: string, @@ -906,14 +915,12 @@ export class PackageTypeVerifier { const paramKnownStatus = this._getTypeKnownStatus( report, param.type, - publicSymbolMap, + publicSymbols, extraInfo.createAddendum() ); if (paramKnownStatus !== TypeKnownStatus.Known) { - extraInfo.addMessage( - `Parameter type is "${this._program.printType(param.type, /* expandTypeAlias */ false)}"` - ); + extraInfo.addMessage(`Parameter type is "${this._program.printType(param.type)}"`); if (symbolInfo) { this._addSymbolError( @@ -952,16 +959,13 @@ export class PackageTypeVerifier { const returnTypeKnownStatus = this._getTypeKnownStatus( report, type.details.declaredReturnType, - publicSymbolMap, + publicSymbols, extraInfo.createAddendum() ); if (returnTypeKnownStatus !== TypeKnownStatus.Known) { extraInfo.addMessage( - `Return type is "${this._program.printType( - type.details.declaredReturnType, - /* expandTypeAlias */ false - )}"` + `Return type is "${this._program.printType(type.details.declaredReturnType)}"` ); if (symbolInfo) { @@ -1048,11 +1052,7 @@ export class PackageTypeVerifier { return knownStatus; } - private _getSymbolForClass( - report: PackageTypeReport, - type: ClassType, - publicSymbolMap: PublicSymbolMap - ): SymbolInfo { + private _getSymbolForClass(report: PackageTypeReport, type: ClassType, publicSymbols: PublicSymbolSet): SymbolInfo { // See if this type is already analyzed. const cachedType = report.symbols.get(type.details.fullName); if (cachedType) { @@ -1065,7 +1065,7 @@ export class PackageTypeVerifier { name: type.details.name, fullName: type.details.fullName, filePath: type.details.filePath, - isExported: publicSymbolMap.has(type.details.fullName), + isExported: publicSymbols.has(type.details.fullName), typeKnownStatus: TypeKnownStatus.Known, referenceCount: 1, diagnostics: [], @@ -1091,7 +1091,7 @@ export class PackageTypeVerifier { type.details.fullName, type.details.fields, ScopeType.Class, - publicSymbolMap, + publicSymbols, (name: string, symbol: Symbol) => { // If the symbol within this class is lacking a type declaration, // see if we can find a same-named symbol in a parent class with @@ -1129,7 +1129,7 @@ export class PackageTypeVerifier { const metaclassKnownStatus = this._getTypeKnownStatus( report, type.details.effectiveMetaclass, - publicSymbolMap, + publicSymbols, diag ); @@ -1165,7 +1165,7 @@ export class PackageTypeVerifier { } const diag = new DiagnosticAddendum(); - const baseClassTypeStatus = this._getTypeKnownStatus(report, baseClass, publicSymbolMap, diag); + const baseClassTypeStatus = this._getTypeKnownStatus(report, baseClass, publicSymbols, diag); if (baseClassTypeStatus !== TypeKnownStatus.Known) { this._addSymbolError( @@ -1189,7 +1189,7 @@ export class PackageTypeVerifier { private _getSymbolForModule( report: PackageTypeReport, type: ModuleType, - publicSymbolMap: PublicSymbolMap + publicSymbols: PublicSymbolSet ): SymbolInfo { // See if this type is already analyzed. const cachedType = report.symbols.get(type.moduleName); @@ -1203,7 +1203,7 @@ export class PackageTypeVerifier { name: type.moduleName, fullName: type.moduleName, filePath: type.filePath, - isExported: publicSymbolMap.has(type.moduleName), + isExported: publicSymbols.has(type.moduleName), typeKnownStatus: TypeKnownStatus.Known, referenceCount: 1, diagnostics: [], @@ -1217,7 +1217,7 @@ export class PackageTypeVerifier { type.moduleName, type.fields, ScopeType.Module, - publicSymbolMap + publicSymbols ); symbolInfo.typeKnownStatus = this._updateKnownStatusIfWorse( @@ -1231,7 +1231,7 @@ export class PackageTypeVerifier { private _getTypeKnownStatus( report: PackageTypeReport, type: Type, - publicSymbolMap: PublicSymbolMap, + publicSymbols: PublicSymbolSet, diag: DiagnosticAddendum ): TypeKnownStatus { let knownStatus = TypeKnownStatus.Known; @@ -1275,7 +1275,7 @@ export class PackageTypeVerifier { doForEachSubtype(type, (subtype) => { knownStatus = this._updateKnownStatusIfWorse( knownStatus, - this._getTypeKnownStatus(report, subtype, publicSymbolMap, diag.createAddendum()) + this._getTypeKnownStatus(report, subtype, publicSymbols, diag.createAddendum()) ); }); @@ -1286,7 +1286,7 @@ export class PackageTypeVerifier { for (const overload of type.overloads) { knownStatus = this._updateKnownStatusIfWorse( knownStatus, - this._getTypeKnownStatus(report, overload, publicSymbolMap, diag.createAddendum()) + this._getTypeKnownStatus(report, overload, publicSymbols, diag.createAddendum()) ); } @@ -1300,7 +1300,7 @@ export class PackageTypeVerifier { this._getFunctionTypeKnownStatus( report, type, - publicSymbolMap, + publicSymbols, /* symbolInfo */ undefined, /* declRange */ undefined, /* declFilePath */ undefined, @@ -1316,8 +1316,8 @@ export class PackageTypeVerifier { if (!this._shouldIgnoreType(report, type.details.fullName)) { // Don't bother type-checking built-in types. if (!ClassType.isBuiltIn(type)) { - // Reference the class. - this._getSymbolForClass(report, type, publicSymbolMap); + const symbolInfo = this._getSymbolForClass(report, type, publicSymbols); + knownStatus = this._updateKnownStatusIfWorse(knownStatus, symbolInfo.typeKnownStatus); } } @@ -1343,7 +1343,7 @@ export class PackageTypeVerifier { case TypeCategory.Module: { if (!this._shouldIgnoreType(report, type.moduleName)) { - const moduleSymbol = this._getSymbolForModule(report, type, publicSymbolMap); + const moduleSymbol = this._getSymbolForModule(report, type, publicSymbols); knownStatus = this._updateKnownStatusIfWorse(knownStatus, moduleSymbol.typeKnownStatus); } diff --git a/packages/pyright-internal/src/analyzer/parameterUtils.ts b/packages/pyright-internal/src/analyzer/parameterUtils.ts new file mode 100644 index 000000000..cb0e8d33f --- /dev/null +++ b/packages/pyright-internal/src/analyzer/parameterUtils.ts @@ -0,0 +1,280 @@ +/* + * parameterUtils.ts + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT license. + * + * Utility functions for parameters. + */ + +import { ParameterCategory } from '../parser/parseNodes'; +import { isDunderName } from './symbolNameUtils'; +import { + ClassType, + FunctionParameter, + FunctionType, + isClassInstance, + isUnpackedClass, + isVariadicTypeVar, + Type, +} from './types'; +import { partiallySpecializeType } from './typeUtils'; + +export function isTypedKwargs(param: FunctionParameter): boolean { + return ( + param.category === ParameterCategory.VarArgDictionary && + isClassInstance(param.type) && + isUnpackedClass(param.type) && + ClassType.isTypedDictClass(param.type) && + !!param.type.details.typedDictEntries + ); +} + +export enum ParameterSource { + PositionOnly, + PositionOrKeyword, + KeywordOnly, +} + +export interface VirtualParameterDetails { + param: FunctionParameter; + type: Type; + defaultArgType?: Type | undefined; + index: number; + source: ParameterSource; +} + +export interface ParameterListDetails { + // Virtual parameter list that refers to original parameters + params: VirtualParameterDetails[]; + + // Counts of virtual parameters + positionOnlyParamCount: number; + positionParamCount: number; + + // Indexes into virtual parameter list + kwargsIndex?: number; + argsIndex?: number; + firstKeywordOnlyIndex?: number; + firstPositionOrKeywordIndex: number; + + // Other information + hasUnpackedVariadicTypeVar: boolean; + hasUnpackedTypedDict: boolean; +} + +// Examines the input parameters within a function signature and creates a +// "virtual list" of parameters, stripping out any markers and expanding +// any *args with unpacked tuples. +export function getParameterListDetails(type: FunctionType): ParameterListDetails { + const result: ParameterListDetails = { + firstPositionOrKeywordIndex: 0, + positionParamCount: 0, + positionOnlyParamCount: 0, + params: [], + hasUnpackedVariadicTypeVar: false, + hasUnpackedTypedDict: false, + }; + + let positionOnlyIndex = type.details.parameters.findIndex( + (p) => p.category === ParameterCategory.Simple && !p.name + ); + + // Handle the old (pre Python 3.8) way of specifying positional-only + // parameters by naming them with "__". + if (positionOnlyIndex < 0) { + for (let i = 0; i < type.details.parameters.length; i++) { + const p = type.details.parameters[i]; + if (p.category !== ParameterCategory.Simple) { + break; + } + + if (!p.name) { + break; + } + + if (isDunderName(p.name) || !p.name.startsWith('__')) { + break; + } + + positionOnlyIndex = i + 1; + } + } + + if (positionOnlyIndex >= 0) { + result.firstPositionOrKeywordIndex = positionOnlyIndex; + } + + for (let i = 0; i < positionOnlyIndex; i++) { + if (type.details.parameters[i].hasDefault) { + break; + } + + result.positionOnlyParamCount++; + } + + let sawKeywordOnlySeparator = false; + + const addVirtualParameter = ( + param: FunctionParameter, + index: number, + typeOverride?: Type, + defaultArgTypeOverride?: Type, + sourceOverride?: ParameterSource + ) => { + if (param.name) { + let source: ParameterSource; + if (sourceOverride !== undefined) { + source = sourceOverride; + } else if (param.category === ParameterCategory.VarArgList) { + source = ParameterSource.PositionOnly; + } else if (sawKeywordOnlySeparator) { + source = ParameterSource.KeywordOnly; + } else if (positionOnlyIndex >= 0 && index < positionOnlyIndex) { + source = ParameterSource.PositionOnly; + } else { + source = ParameterSource.PositionOrKeyword; + } + + result.params.push({ + param, + index, + type: typeOverride ?? FunctionType.getEffectiveParameterType(type, index), + defaultArgType: defaultArgTypeOverride, + source, + }); + } + }; + + type.details.parameters.forEach((param, index) => { + if (param.category === ParameterCategory.VarArgList) { + // If this is an unpacked tuple, expand the entries. + const paramType = FunctionType.getEffectiveParameterType(type, index); + if (param.name && isUnpackedClass(paramType) && paramType.tupleTypeArguments) { + const addToPositionalOnly = index < result.positionOnlyParamCount; + + paramType.tupleTypeArguments.forEach((tupleArg, tupleIndex) => { + const category = + isVariadicTypeVar(tupleArg.type) || tupleArg.isUnbounded + ? ParameterCategory.VarArgList + : ParameterCategory.Simple; + + if (category === ParameterCategory.VarArgList) { + result.argsIndex = result.params.length; + } + + if (isVariadicTypeVar(param.type)) { + result.hasUnpackedVariadicTypeVar = true; + } + + addVirtualParameter( + { + category, + name: `${param.name}[${tupleIndex.toString()}]`, + isNameSynthesized: true, + type: tupleArg.type, + hasDeclaredType: true, + }, + index, + tupleArg.type, + /* defaultArgTypeOverride */ undefined, + ParameterSource.PositionOnly + ); + + if (category === ParameterCategory.Simple) { + result.positionParamCount++; + } + + if (tupleIndex > 0 && addToPositionalOnly) { + result.positionOnlyParamCount++; + } + }); + + // Normally, a VarArgList parameter (either named or as an unnamed separator) + // would signify the start of keyword-only parameters. However, we can construct + // callable signatures that defy this rule by using Callable and TypeVarTuples + // or unpacked tuples. + if (!sawKeywordOnlySeparator && (positionOnlyIndex < 0 || index >= positionOnlyIndex)) { + result.firstKeywordOnlyIndex = result.params.length; + sawKeywordOnlySeparator = true; + } + } else { + if (param.name && result.argsIndex === undefined) { + result.argsIndex = result.params.length; + + if (isVariadicTypeVar(param.type)) { + result.hasUnpackedVariadicTypeVar = true; + } + } + + // Normally, a VarArgList parameter (either named or as an unnamed separator) + // would signify the start of keyword-only parameters. However, we can construct + // callable signatures that defy this rule by using Callable and TypeVarTuples + // or unpacked tuples. + if (!sawKeywordOnlySeparator && (positionOnlyIndex < 0 || index >= positionOnlyIndex)) { + result.firstKeywordOnlyIndex = result.params.length; + if (param.name) { + result.firstKeywordOnlyIndex++; + } + sawKeywordOnlySeparator = true; + } + + addVirtualParameter(param, index); + } + } else if (param.category === ParameterCategory.VarArgDictionary) { + sawKeywordOnlySeparator = true; + + const paramType = FunctionType.getEffectiveParameterType(type, index); + + // Is this an unpacked TypedDict? If so, expand the entries. + if (isClassInstance(paramType) && isUnpackedClass(paramType) && paramType.details.typedDictEntries) { + if (result.firstKeywordOnlyIndex === undefined) { + result.firstKeywordOnlyIndex = result.params.length; + } + + const typedDictType = paramType; + paramType.details.typedDictEntries.forEach((entry, name) => { + const specializedParamType = partiallySpecializeType(entry.valueType, typedDictType); + + addVirtualParameter( + { + category: ParameterCategory.Simple, + name, + type: specializedParamType, + hasDeclaredType: true, + hasDefault: !entry.isRequired, + }, + index, + specializedParamType + ); + }); + + result.hasUnpackedTypedDict = true; + } else if (param.name) { + if (result.kwargsIndex === undefined) { + result.kwargsIndex = result.params.length; + } + + if (result.firstKeywordOnlyIndex === undefined) { + result.firstKeywordOnlyIndex = result.params.length; + } + + addVirtualParameter(param, index); + } + } else if (param.category === ParameterCategory.Simple) { + if (param.name && !sawKeywordOnlySeparator) { + result.positionParamCount++; + } + + addVirtualParameter( + param, + index, + /* typeOverride */ undefined, + type.specializedTypes?.parameterDefaultArgs + ? type.specializedTypes?.parameterDefaultArgs[index] + : undefined + ); + } + }); + + return result; +} diff --git a/packages/pyright-internal/src/analyzer/parseTreeUtils.ts b/packages/pyright-internal/src/analyzer/parseTreeUtils.ts index 4368d2f6a..4e12f3cb2 100644 --- a/packages/pyright-internal/src/analyzer/parseTreeUtils.ts +++ b/packages/pyright-internal/src/analyzer/parseTreeUtils.ts @@ -8,21 +8,24 @@ */ import * as AnalyzerNodeInfo from '../analyzer/analyzerNodeInfo'; +import { containsOnlyWhitespace } from '../common/core'; import { assert, assertNever, fail } from '../common/debug'; import { convertPositionToOffset, convertTextRangeToRange } from '../common/positionUtils'; import { Position, Range } from '../common/textRange'; import { TextRange } from '../common/textRange'; -import { TextRangeCollection } from '../common/textRangeCollection'; +import { getIndexContaining, TextRangeCollection } from '../common/textRangeCollection'; import { ArgumentCategory, ArgumentNode, AssignmentExpressionNode, CallNode, ClassNode, + DecoratorNode, EvaluationScopeNode, ExecutionScopeNode, ExpressionNode, FunctionNode, + ImportFromNode, IndexNode, isExpressionNode, LambdaNode, @@ -41,10 +44,12 @@ import { TypeAnnotationNode, TypeParameterScopeNode, } from '../parser/parseNodes'; +import { ParseResults } from '../parser/parser'; +import * as StringTokenUtils from '../parser/stringTokenUtils'; import { TokenizerOutput } from '../parser/tokenizer'; import { KeywordType, OperatorType, StringToken, StringTokenFlags, Token, TokenType } from '../parser/tokenizerTypes'; import { getScope } from './analyzerNodeInfo'; -import { ParseTreeWalker } from './parseTreeWalker'; +import { getChildNodes, ParseTreeWalker } from './parseTreeWalker'; export const enum PrintExpressionFlags { None = 0, @@ -91,29 +96,48 @@ export function findNodeByOffset(node: ParseNode, offset: number): ParseNode | u return undefined; } - const parseTreeWalker = new ParseTreeWalker(); - // The range is found within this node. See if we can localize it // further by checking its children. - const children = parseTreeWalker.visitNode(node); + let children = getChildNodes(node); + if (isCompliantWithNodeRangeRules(node) && children.length > 20) { + // Use binary search to find the child to visit. This should be helpful + // when there are many siblings, such as statements in a module/suite + // or expressions in a list, etc. Otherwise, we will have to traverse + // every sibling before finding the correct one. + const index = getIndexContaining(children, offset); + if (index >= 0) { + children = [children[index]]; + } + } + for (const child of children) { - if (child) { - const containingChild = findNodeByOffset(child, offset); - if (containingChild) { - // For augmented assignments, prefer the dest expression, which is a clone - // of the left expression but is used to hold the type of the operation result. - if (node.nodeType === ParseNodeType.AugmentedAssignment && containingChild === node.leftExpression) { - return node.destExpression; - } + if (!child) { + continue; + } - return containingChild; + const containingChild = findNodeByOffset(child, offset); + if (containingChild) { + // For augmented assignments, prefer the dest expression, which is a clone + // of the left expression but is used to hold the type of the operation result. + if (node.nodeType === ParseNodeType.AugmentedAssignment && containingChild === node.leftExpression) { + return node.destExpression; } + + return containingChild; } } return node; } +export function isCompliantWithNodeRangeRules(node: ParseNode) { + // ParseNode range rules are + // 1. Children are all contained within the parent. + // 2. Children have non-overlapping ranges. + // 3. Children are listed in increasing order. + return node.nodeType !== ParseNodeType.Assignment && node.nodeType !== ParseNodeType.StringList; +} + export function getClassFullName(classNode: ParseNode, moduleName: string, className: string): string { const nameParts: string[] = [className]; @@ -514,6 +538,25 @@ export function printOperator(operator: OperatorType): string { return 'unknown'; } +// If the name node is the LHS of a call expression or is a member +// name in the LHS of a call expression, returns the call node. +export function getCallForName(node: NameNode): CallNode | undefined { + if (node.parent?.nodeType === ParseNodeType.Call && node.parent.leftExpression === node) { + return node.parent; + } + + if ( + node.parent?.nodeType === ParseNodeType.MemberAccess && + node.parent.memberName === node && + node.parent.parent?.nodeType === ParseNodeType.Call && + node.parent.parent.leftExpression === node.parent + ) { + return node.parent.parent; + } + + return undefined; +} + export function getEnclosingSuite(node: ParseNode): SuiteNode | undefined { let curNode = node.parent; @@ -918,6 +961,15 @@ export function isClassVarAllowedForAssignmentTarget(targetNode: ExpressionNode) return true; } +export function isRequiredAllowedForAssignmentTarget(targetNode: ExpressionNode): boolean { + const classNode = getEnclosingClass(targetNode, /* stopAtFunction */ true); + if (!classNode) { + return false; + } + + return true; +} + export function isNodeContainedWithin(node: ParseNode, potentialContainer: ParseNode): boolean { let curNode: ParseNode | undefined = node; while (curNode) { @@ -988,13 +1040,6 @@ export function getParentAnnotationNode(node: ExpressionNode): ExpressionNode | return undefined; } - if (curNode.nodeType === ParseNodeType.StringList) { - if (prevNode === curNode.typeAnnotation) { - return prevNode; - } - return undefined; - } - prevNode = curNode; curNode = curNode.parent; } @@ -1505,7 +1550,7 @@ export function getCallNodeAndActiveParameterIndex( while (curNode !== undefined) { // make sure we only look at callNodes when we are inside their arguments if (curNode.nodeType === ParseNodeType.Call) { - if (isOffsetInsideCallArgs(curNode, insertionOffset)) { + if (isOffsetInsideCallArgs(tokens, curNode, insertionOffset)) { callNode = curNode; break; } @@ -1580,19 +1625,77 @@ export function getCallNodeAndActiveParameterIndex( activeOrFake, }; - function isOffsetInsideCallArgs(node: CallNode, offset: number) { - let found = true; + function isOffsetInsideCallArgs(tokens: TextRangeCollection, node: CallNode, offset: number) { const argumentStart = node.leftExpression.length > 0 ? TextRange.getEnd(node.leftExpression) - 1 : node.leftExpression.start; + + // Handle obvious case first. + const callEndOffset = TextRange.getEnd(node); + if (offset < argumentStart || callEndOffset < offset) { + return false; + } + + if (node.arguments.length > 0) { + const start = node.arguments[0].start; + const end = TextRange.getEnd(node.arguments[node.arguments.length - 1]); + if (start <= offset && offset < end) { + return true; + } + } + const index = tokens.getItemAtPosition(argumentStart); - if (index >= 0 && index + 1 < tokens.count) { - const token = tokens.getItemAt(index + 1); - if (token.type === TokenType.OpenParenthesis && insertionOffset < TextRange.getEnd(token)) { - // position must be after '(' - found = false; + if (index < 0 || tokens.count <= index) { + // Somehow, we can't get token. To be safe, we will allow + // signature help to show up. + return true; + } + + const token = tokens.getItemAt(index); + if ( + token.type === TokenType.String && + (token as StringToken).flags & StringTokenFlags.Format && + TextRange.contains(token, offset) + ) { + // tokenizer won't tokenize format string segments. We get one token + // for the whole format string. We need to dig in. + const stringToken = token as StringToken; + const result = StringTokenUtils.getUnescapedString(stringToken); + const offsetInSegment = offset - stringToken.start - stringToken.prefixLength - stringToken.quoteMarkLength; + const segment = result.formatStringSegments.find( + (s) => s.offset <= offsetInSegment && offsetInSegment < s.offset + s.length + ); + if (!segment || !segment.isExpression) { + // Just to be safe, allow signature help. + return true; } + + const length = Math.min( + segment.length, + callEndOffset - + stringToken.start - + stringToken.prefixLength - + stringToken.quoteMarkLength - + segment.offset + ); + + for (let i = offsetInSegment - segment.offset; i < length; i++) { + const ch = segment.value[i]; + if (ch === '(') { + // position must be after '(' + return false; + } + } + + return true; + } + + const nextToken = tokens.getItemAt(index + 1); + if (nextToken.type === TokenType.OpenParenthesis && offset < TextRange.getEnd(nextToken)) { + // position must be after '(' + return false; } - return found; + + return true; } } @@ -1639,7 +1742,7 @@ export function getTokenAtLeft( return tokens.getItemAt(index); } -function isWhitespace(token: Token) { +export function isWhitespace(token: Token) { return token.type === TokenType.NewLine || token.type === TokenType.Indent || token.type === TokenType.Dedent; } @@ -2132,6 +2235,31 @@ export function getDottedNameWithGivenNodeAsLastName(node: NameNode): MemberAcce return node.parent; } +// +// Returns the dotted name that makes up the expression for the decorator. +// Example: +// @pytest.fixture() +// def my_fixture(): +// pass +// +// would return `pytest.fixture` +export function getDecoratorName(decorator: DecoratorNode): string | undefined { + function getExpressionName(node: ExpressionNode): string | undefined { + if (node.nodeType === ParseNodeType.Name || node.nodeType === ParseNodeType.MemberAccess) { + return getDottedName(node) + ?.map((n) => n.value) + .join('.'); + } + if (node.nodeType === ParseNodeType.Call) { + return getExpressionName(node.leftExpression); + } + + return undefined; + } + + return getExpressionName(decorator.expression); +} + export function getDottedName(node: MemberAccessNode | NameNode): NameNode[] | undefined { // ex) [a] or [a].b // simple case, [a] @@ -2225,26 +2353,53 @@ export function getStringValueRange(token: StringToken) { return TextRange.create(token.start + length, token.length - length - (hasEnding ? length : 0)); } -export function getFullStatementRange(statementNode: ParseNode, tokenizerOutput: TokenizerOutput): Range { +export function getFullStatementRange( + statementNode: ParseNode, + parseResults: ParseResults, + options?: { includeTrailingBlankLines: boolean } +): Range { + const tokenizerOutput = parseResults.tokenizerOutput; const range = convertTextRangeToRange(statementNode, tokenizerOutput.lines); + const start = _getStartPositionIfMultipleStatementsAreOnSameLine(range, statementNode.start, tokenizerOutput) ?? { + line: range.start.line, + character: 0, + }; + // First, see whether there are other tokens except semicolon or new line on the same line. - const endPosition = _getEndPositionIfMultipleStatementsAreOnSameLine( + const end = _getEndPositionIfMultipleStatementsAreOnSameLine( range, TextRange.getEnd(statementNode), tokenizerOutput ); - if (endPosition) { - return { start: range.start, end: endPosition }; + if (end) { + return { start, end }; } // If not, delete the whole line. if (range.end.line === tokenizerOutput.lines.count - 1) { - return range; + return { start, end: range.end }; } - return { start: range.start, end: { line: range.end.line + 1, character: 0 } }; + let lineDeltaToAdd = 1; + if (options) { + if (options.includeTrailingBlankLines) { + for (let i = lineDeltaToAdd; range.end.line + i < tokenizerOutput.lines.count; i++) { + if (!isBlankLine(parseResults, range.end.line + i)) { + lineDeltaToAdd = i; + break; + } + } + } + } + + return { start, end: { line: range.end.line + lineDeltaToAdd, character: 0 } }; +} + +export function isBlankLine(parseResults: ParseResults, line: number) { + const span = parseResults.tokenizerOutput.lines.getItemAt(line); + return containsOnlyWhitespace(parseResults.text, span); } export function isUnannotatedFunction(node: FunctionNode) { @@ -2256,6 +2411,47 @@ export function isUnannotatedFunction(node: FunctionNode) { ); } +// Verifies that an import of the form "from __future__ import x" +// occurs only at the top of a file. This mirrors the algorithm used +// in the CPython interpreter. +export function isValidLocationForFutureImport(node: ImportFromNode): boolean { + const module = getModuleNode(node); + assert(module); + + let sawDocString = false; + + for (const statement of module.statements) { + if (statement.nodeType !== ParseNodeType.StatementList) { + return false; + } + + for (const simpleStatement of statement.statements) { + if (simpleStatement === node) { + return true; + } + + if (simpleStatement.nodeType === ParseNodeType.StringList) { + if (sawDocString) { + return false; + } + sawDocString = true; + } else if (simpleStatement.nodeType === ParseNodeType.ImportFrom) { + if ( + simpleStatement.module.leadingDots !== 0 || + simpleStatement.module.nameParts.length !== 1 || + simpleStatement.module.nameParts[0].value !== '__future__' + ) { + return false; + } + } else { + return false; + } + } + } + + return false; +} + // "Chaining" is when binary operators can be chained together // as a shorthand. For example, "a < b < c" is shorthand for // "a < b and b < c". @@ -2277,6 +2473,55 @@ export function operatorSupportsChaining(op: OperatorType) { return false; } +// If the statement is a part of multiple statements on the same line +// and the statement is not the first statement on the line, then it will return +// appropriate start position. otherwise, return undefined. +// ex) a = 1; [|b = 1|] +function _getStartPositionIfMultipleStatementsAreOnSameLine( + range: Range, + tokenPosition: number, + tokenizerOutput: TokenizerOutput +): Position | undefined { + const tokenIndex = tokenizerOutput.tokens.getItemAtPosition(tokenPosition); + if (tokenIndex < 0) { + return undefined; + } + + // Find the last token index on the previous line or the first token. + let currentIndex = tokenIndex; + for (; currentIndex > 0; currentIndex--) { + const token = tokenizerOutput.tokens.getItemAt(currentIndex); + const tokenRange = convertTextRangeToRange(token, tokenizerOutput.lines); + if (tokenRange.end.line !== range.start.line) { + break; + } + } + + // Find the previous token of the first token of the statement. + for (let index = tokenIndex - 1; index > currentIndex; index--) { + const token = tokenizerOutput.tokens.getItemAt(index); + + // Eat up indentation + if (token.type === TokenType.Indent || token.type === TokenType.Dedent) { + continue; + } + + // If previous token is new line, use default. + if (token.type === TokenType.NewLine) { + return undefined; + } + + // Anything else (ex, semicolon), use statement start as it is. + return range.start; + } + + return undefined; +} + +// If the statement is a part of multiple statements on the same line +// and the statement is not the last statement on the line, then it will return +// appropriate end position. otherwise, return undefined. +// ex) [|a = 1|]; b = 1 function _getEndPositionIfMultipleStatementsAreOnSameLine( range: Range, tokenPosition: number, @@ -2287,6 +2532,7 @@ function _getEndPositionIfMultipleStatementsAreOnSameLine( return undefined; } + // Find the first token index on the next line or the last token. let currentIndex = tokenIndex; for (; currentIndex < tokenizerOutput.tokens.count; currentIndex++) { const token = tokenizerOutput.tokens.getItemAt(currentIndex); @@ -2296,9 +2542,12 @@ function _getEndPositionIfMultipleStatementsAreOnSameLine( } } + // Find the next token of the last token of the statement. let foundStatementEnd = false; for (let index = tokenIndex; index < currentIndex; index++) { const token = tokenizerOutput.tokens.getItemAt(index); + + // Eat up semicolon or new line. if (token.type === TokenType.Semicolon || token.type === TokenType.NewLine) { foundStatementEnd = true; continue; @@ -2314,3 +2563,83 @@ function _getEndPositionIfMultipleStatementsAreOnSameLine( return undefined; } + +export function getVariableDocStringNode(node: ExpressionNode): StringListNode | undefined { + // Walk up the parse tree to find an assignment expression. + let curNode: ParseNode | undefined = node; + let annotationNode: TypeAnnotationNode | undefined; + + while (curNode) { + if (curNode.nodeType === ParseNodeType.Assignment) { + break; + } + + if (curNode.nodeType === ParseNodeType.TypeAnnotation && !annotationNode) { + annotationNode = curNode; + } + + curNode = curNode.parent; + } + + if (curNode?.nodeType !== ParseNodeType.Assignment) { + // Allow a simple annotation statement to have a docstring even + // though PEP 258 doesn't mention this case. This PEP pre-dated + // PEP 526, so it didn't contemplate this situation. + if (annotationNode) { + curNode = annotationNode; + } else { + return undefined; + } + } + + const parentNode = curNode.parent; + if (parentNode?.nodeType !== ParseNodeType.StatementList) { + return undefined; + } + + const suiteOrModule = parentNode.parent; + if ( + !suiteOrModule || + (suiteOrModule.nodeType !== ParseNodeType.Module && suiteOrModule.nodeType !== ParseNodeType.Suite) + ) { + return undefined; + } + + const assignmentIndex = suiteOrModule.statements.findIndex((node) => node === parentNode); + if (assignmentIndex < 0 || assignmentIndex === suiteOrModule.statements.length - 1) { + return undefined; + } + + const nextStatement = suiteOrModule.statements[assignmentIndex + 1]; + + if (nextStatement.nodeType !== ParseNodeType.StatementList || !isDocString(nextStatement)) { + return undefined; + } + + // See if the assignment is within one of the contexts specified in PEP 258. + let isValidContext = false; + if (parentNode?.parent?.nodeType === ParseNodeType.Module) { + // If we're at the top level of a module, the attribute docstring is valid. + isValidContext = true; + } else if ( + parentNode?.parent?.nodeType === ParseNodeType.Suite && + parentNode?.parent?.parent?.nodeType === ParseNodeType.Class + ) { + // If we're at the top level of a class, the attribute docstring is valid. + isValidContext = true; + } else { + const func = getEnclosingFunction(parentNode); + + // If we're within an __init__ method, the attribute docstring is valid. + if (func && func.name.value === '__init__' && getEnclosingClass(func, /* stopAtFunction */ true)) { + isValidContext = true; + } + } + + if (!isValidContext) { + return undefined; + } + + // A docstring can consist of multiple joined strings in a single expression. + return nextStatement.statements[0] as StringListNode; +} diff --git a/packages/pyright-internal/src/analyzer/parseTreeWalker.ts b/packages/pyright-internal/src/analyzer/parseTreeWalker.ts index 867996053..783fca2ae 100644 --- a/packages/pyright-internal/src/analyzer/parseTreeWalker.ts +++ b/packages/pyright-internal/src/analyzer/parseTreeWalker.ts @@ -7,6 +7,7 @@ * Class that traverses a parse tree. */ +import * as debug from '../common/debug'; import { ArgumentNode, AssertNode, @@ -91,600 +92,844 @@ import { YieldNode, } from '../parser/parseNodes'; -// To use this class, create a subclass and override the -// visitXXX methods that you want to handle. -export class ParseTreeWalker { - walk(node: ParseNode): void { - const childrenToWalk = this.visitNode(node); - if (childrenToWalk.length > 0) { - this.walkMultiple(childrenToWalk); - } +// Get child nodes of the given node. +export function getChildNodes(node: ParseNode): (ParseNode | undefined)[] { + switch (node.nodeType) { + case ParseNodeType.Error: + return [node.child, ...(node.decorators ?? [])]; + + case ParseNodeType.Argument: + return [node.name, node.valueExpression]; + + case ParseNodeType.Assert: + return [node.testExpression, node.exceptionExpression]; + + case ParseNodeType.AssignmentExpression: + return [node.name, node.rightExpression]; + + case ParseNodeType.Assignment: + return [node.leftExpression, node.rightExpression, node.typeAnnotationComment]; + + case ParseNodeType.AugmentedAssignment: + return [node.leftExpression, node.rightExpression]; + + case ParseNodeType.Await: + return [node.expression]; + + case ParseNodeType.BinaryOperation: + return [node.leftExpression, node.rightExpression]; + + case ParseNodeType.Break: + return []; + + case ParseNodeType.Call: + return [node.leftExpression, ...node.arguments]; + + case ParseNodeType.Case: + return [node.pattern, node.guardExpression, node.suite]; + + case ParseNodeType.Class: + return [...node.decorators, node.name, node.typeParameters, ...node.arguments, node.suite]; + + case ParseNodeType.Constant: + return []; + + case ParseNodeType.Continue: + return []; + + case ParseNodeType.Decorator: + return [node.expression]; + + case ParseNodeType.Del: + return node.expressions; + + case ParseNodeType.Dictionary: + return node.entries; + + case ParseNodeType.DictionaryExpandEntry: + return [node.expandExpression]; + + case ParseNodeType.DictionaryKeyEntry: + return [node.keyExpression, node.valueExpression]; + + case ParseNodeType.Ellipsis: + return []; + + case ParseNodeType.If: + return [node.testExpression, node.ifSuite, node.elseSuite]; + + case ParseNodeType.Import: + return node.list; + + case ParseNodeType.ImportAs: + return [node.module, node.alias]; + + case ParseNodeType.ImportFrom: + return [node.module, ...node.imports]; + + case ParseNodeType.ImportFromAs: + return [node.name, node.alias]; + + case ParseNodeType.Index: + return [node.baseExpression, ...node.items]; + + case ParseNodeType.Except: + return [node.typeExpression, node.name, node.exceptSuite]; + + case ParseNodeType.For: + return [node.targetExpression, node.iterableExpression, node.forSuite, node.elseSuite]; + + case ParseNodeType.FormatString: + return node.expressions; + + case ParseNodeType.Function: + return [ + ...node.decorators, + node.name, + node.typeParameters, + ...node.parameters, + node.returnTypeAnnotation, + node.functionAnnotationComment, + node.suite, + ]; + + case ParseNodeType.FunctionAnnotation: + return [...node.paramTypeAnnotations, node.returnTypeAnnotation]; + + case ParseNodeType.Global: + return node.nameList; + + case ParseNodeType.Lambda: + return [...node.parameters, node.expression]; + + case ParseNodeType.List: + return node.entries; + + case ParseNodeType.ListComprehension: + return [node.expression, ...node.forIfNodes]; + + case ParseNodeType.ListComprehensionFor: + return [node.targetExpression, node.iterableExpression]; + + case ParseNodeType.ListComprehensionIf: + return [node.testExpression]; + + case ParseNodeType.Match: + return [node.subjectExpression, ...node.cases]; + + case ParseNodeType.MemberAccess: + return [node.leftExpression, node.memberName]; + + case ParseNodeType.ModuleName: + return node.nameParts; + + case ParseNodeType.Module: + return [...node.statements]; + + case ParseNodeType.Name: + return []; + + case ParseNodeType.Nonlocal: + return node.nameList; + + case ParseNodeType.Number: + return []; + + case ParseNodeType.Parameter: + return [node.name, node.typeAnnotation, node.typeAnnotationComment, node.defaultValue]; + + case ParseNodeType.Pass: + return []; + + case ParseNodeType.PatternAs: + return [...node.orPatterns, node.target]; + + case ParseNodeType.PatternClass: + return [node.className, ...node.arguments]; + + case ParseNodeType.PatternClassArgument: + return [node.name, node.pattern]; + + case ParseNodeType.PatternCapture: + return [node.target]; + + case ParseNodeType.PatternLiteral: + return [node.expression]; + + case ParseNodeType.PatternMappingExpandEntry: + return [node.target]; + + case ParseNodeType.PatternMappingKeyEntry: + return [node.keyPattern, node.valuePattern]; + + case ParseNodeType.PatternMapping: + return [...node.entries]; + + case ParseNodeType.PatternSequence: + return [...node.entries]; + + case ParseNodeType.PatternValue: + return [node.expression]; + + case ParseNodeType.Raise: + return [node.typeExpression, node.valueExpression, node.tracebackExpression]; + + case ParseNodeType.Return: + return [node.returnExpression]; + + case ParseNodeType.Set: + return node.entries; + + case ParseNodeType.Slice: + return [node.startValue, node.endValue, node.stepValue]; + + case ParseNodeType.StatementList: + return node.statements; + + case ParseNodeType.StringList: + return [node.typeAnnotation, ...node.strings]; + + case ParseNodeType.String: + return []; + + case ParseNodeType.Suite: + return [...node.statements]; + + case ParseNodeType.Ternary: + return [node.ifExpression, node.testExpression, node.elseExpression]; + + case ParseNodeType.Tuple: + return node.expressions; + + case ParseNodeType.Try: + return [node.trySuite, ...node.exceptClauses, node.elseSuite, node.finallySuite]; + + case ParseNodeType.TypeAlias: + return [node.name, node.typeParameters, node.expression]; + + case ParseNodeType.TypeAnnotation: + return [node.valueExpression, node.typeAnnotation]; + + case ParseNodeType.TypeParameter: + return [node.name, node.boundExpression, node.defaultExpression]; + + case ParseNodeType.TypeParameterList: + return [...node.parameters]; + + case ParseNodeType.UnaryOperation: + return [node.expression]; + + case ParseNodeType.Unpack: + return [node.expression]; + + case ParseNodeType.While: + return [node.testExpression, node.whileSuite, node.elseSuite]; + + case ParseNodeType.With: + return [...node.withItems, node.suite]; + + case ParseNodeType.WithItem: + return [node.expression, node.target]; + + case ParseNodeType.Yield: + return [node.expression]; + + case ParseNodeType.YieldFrom: + return [node.expression]; + + default: + debug.assertNever(node, `Unknown node type ${node}`); } +} - walkMultiple(nodes: ParseNodeArray) { - nodes.forEach((node) => { - if (node) { - this.walk(node); - } - }); +// To use this class, create a subclass and override the +// visitXXX methods that you want to handle. +export class ParseTreeVisitor { + constructor(private readonly _default: T) { + // empty } - // Calls the node-specific method (visitXXXX). If the method - // returns true, all child nodes for the node are returned. - // If the method returns false, we assume that the handler - // has already handled the child nodes, so an empty list is - // returned. - visitNode(node: ParseNode): ParseNodeArray { + visit(node: ParseNode): T { switch (node.nodeType) { case ParseNodeType.Error: - return this.visitError(node) ? [node.child, ...(node.decorators ?? [])] : []; + return this.visitError(node); case ParseNodeType.Argument: - return this.visitArgument(node) ? [node.name, node.valueExpression] : []; + return this.visitArgument(node); case ParseNodeType.Assert: - return this.visitAssert(node) ? [node.testExpression, node.exceptionExpression] : []; + return this.visitAssert(node); case ParseNodeType.AssignmentExpression: - return this.visitAssignmentExpression(node) ? [node.name, node.rightExpression] : []; + return this.visitAssignmentExpression(node); case ParseNodeType.Assignment: - return this.visitAssignment(node) - ? [node.leftExpression, node.rightExpression, node.typeAnnotationComment] - : []; + return this.visitAssignment(node); case ParseNodeType.AugmentedAssignment: - return this.visitAugmentedAssignment(node) ? [node.leftExpression, node.rightExpression] : []; + return this.visitAugmentedAssignment(node); case ParseNodeType.Await: - return this.visitAwait(node) ? [node.expression] : []; + return this.visitAwait(node); case ParseNodeType.BinaryOperation: - return this.visitBinaryOperation(node) ? [node.leftExpression, node.rightExpression] : []; + return this.visitBinaryOperation(node); case ParseNodeType.Break: - return this.visitBreak(node) ? [] : []; + return this.visitBreak(node); case ParseNodeType.Call: - return this.visitCall(node) ? [node.leftExpression, ...node.arguments] : []; + return this.visitCall(node); case ParseNodeType.Case: - return this.visitCase(node) ? [node.pattern, node.guardExpression, node.suite] : []; + return this.visitCase(node); case ParseNodeType.Class: - return this.visitClass(node) - ? [...node.decorators, node.name, node.typeParameters, ...node.arguments, node.suite] - : []; + return this.visitClass(node); case ParseNodeType.Constant: - return this.visitConstant(node) ? [] : []; + return this.visitConstant(node); case ParseNodeType.Continue: - return this.visitContinue(node) ? [] : []; + return this.visitContinue(node); case ParseNodeType.Decorator: - return this.visitDecorator(node) ? [node.expression] : []; + return this.visitDecorator(node); case ParseNodeType.Del: - return this.visitDel(node) ? node.expressions : []; + return this.visitDel(node); case ParseNodeType.Dictionary: - return this.visitDictionary(node) ? node.entries : []; + return this.visitDictionary(node); case ParseNodeType.DictionaryExpandEntry: - return this.visitDictionaryExpandEntry(node) ? [node.expandExpression] : []; + return this.visitDictionaryExpandEntry(node); case ParseNodeType.DictionaryKeyEntry: - return this.visitDictionaryKeyEntry(node) ? [node.keyExpression, node.valueExpression] : []; + return this.visitDictionaryKeyEntry(node); case ParseNodeType.Ellipsis: - return this.visitEllipsis(node) ? [] : []; + return this.visitEllipsis(node); case ParseNodeType.If: - return this.visitIf(node) ? [node.testExpression, node.ifSuite, node.elseSuite] : []; + return this.visitIf(node); case ParseNodeType.Import: - return this.visitImport(node) ? node.list : []; + return this.visitImport(node); case ParseNodeType.ImportAs: - return this.visitImportAs(node) ? [node.module, node.alias] : []; + return this.visitImportAs(node); case ParseNodeType.ImportFrom: - return this.visitImportFrom(node) ? [node.module, ...node.imports] : []; + return this.visitImportFrom(node); case ParseNodeType.ImportFromAs: - return this.visitImportFromAs(node) ? [node.name, node.alias] : []; + return this.visitImportFromAs(node); case ParseNodeType.Index: - return this.visitIndex(node) ? [node.baseExpression, ...node.items] : []; + return this.visitIndex(node); case ParseNodeType.Except: - return this.visitExcept(node) ? [node.typeExpression, node.name, node.exceptSuite] : []; + return this.visitExcept(node); case ParseNodeType.For: - return this.visitFor(node) - ? [node.targetExpression, node.iterableExpression, node.forSuite, node.elseSuite] - : []; + return this.visitFor(node); case ParseNodeType.FormatString: - return this.visitFormatString(node) ? node.expressions : []; + return this.visitFormatString(node); case ParseNodeType.Function: - return this.visitFunction(node) - ? [ - ...node.decorators, - node.name, - node.typeParameters, - ...node.parameters, - node.returnTypeAnnotation, - node.functionAnnotationComment, - node.suite, - ] - : []; + return this.visitFunction(node); case ParseNodeType.FunctionAnnotation: - return this.visitFunctionAnnotation(node) - ? [...node.paramTypeAnnotations, node.returnTypeAnnotation] - : []; + return this.visitFunctionAnnotation(node); case ParseNodeType.Global: - return this.visitGlobal(node) ? node.nameList : []; + return this.visitGlobal(node); case ParseNodeType.Lambda: - return this.visitLambda(node) ? [...node.parameters, node.expression] : []; + return this.visitLambda(node); case ParseNodeType.List: - return this.visitList(node) ? node.entries : []; + return this.visitList(node); case ParseNodeType.ListComprehension: - return this.visitListComprehension(node) ? [node.expression, ...node.forIfNodes] : []; + return this.visitListComprehension(node); case ParseNodeType.ListComprehensionFor: - return this.visitListComprehensionFor(node) ? [node.targetExpression, node.iterableExpression] : []; + return this.visitListComprehensionFor(node); case ParseNodeType.ListComprehensionIf: - return this.visitListComprehensionIf(node) ? [node.testExpression] : []; + return this.visitListComprehensionIf(node); case ParseNodeType.Match: - return this.visitMatch(node) ? [node.subjectExpression, ...node.cases] : []; + return this.visitMatch(node); case ParseNodeType.MemberAccess: - return this.visitMemberAccess(node) ? [node.leftExpression, node.memberName] : []; + return this.visitMemberAccess(node); case ParseNodeType.ModuleName: - return this.visitModuleName(node) ? node.nameParts : []; + return this.visitModuleName(node); case ParseNodeType.Module: - return this.visitModule(node) ? [...node.statements] : []; + return this.visitModule(node); case ParseNodeType.Name: - return this.visitName(node) ? [] : []; + return this.visitName(node); case ParseNodeType.Nonlocal: - return this.visitNonlocal(node) ? node.nameList : []; + return this.visitNonlocal(node); case ParseNodeType.Number: - return this.visitNumber(node) ? [] : []; + return this.visitNumber(node); case ParseNodeType.Parameter: - return this.visitParameter(node) - ? [node.name, node.typeAnnotation, node.typeAnnotationComment, node.defaultValue] - : []; + return this.visitParameter(node); case ParseNodeType.Pass: - return this.visitPass(node) ? [] : []; + return this.visitPass(node); case ParseNodeType.PatternAs: - return this.visitPatternAs(node) ? [...node.orPatterns, node.target] : []; + return this.visitPatternAs(node); case ParseNodeType.PatternClass: - return this.visitPatternClass(node) ? [node.className, ...node.arguments] : []; + return this.visitPatternClass(node); case ParseNodeType.PatternClassArgument: - return this.visitPatternClassArgument(node) ? [node.name, node.pattern] : []; + return this.visitPatternClassArgument(node); case ParseNodeType.PatternCapture: - return this.visitPatternCapture(node) ? [node.target] : []; + return this.visitPatternCapture(node); case ParseNodeType.PatternLiteral: - return this.visitPatternLiteral(node) ? [node.expression] : []; + return this.visitPatternLiteral(node); case ParseNodeType.PatternMappingExpandEntry: - return this.visitPatternMappingExpandEntry(node) ? [node.target] : []; + return this.visitPatternMappingExpandEntry(node); case ParseNodeType.PatternMappingKeyEntry: - return this.visitPatternMappingKeyEntry(node) ? [node.keyPattern, node.valuePattern] : []; + return this.visitPatternMappingKeyEntry(node); case ParseNodeType.PatternMapping: - return this.visitPatternMapping(node) ? [...node.entries] : []; + return this.visitPatternMapping(node); case ParseNodeType.PatternSequence: - return this.visitPatternSequence(node) ? [...node.entries] : []; + return this.visitPatternSequence(node); case ParseNodeType.PatternValue: - return this.visitPatternValue(node) ? [node.expression] : []; + return this.visitPatternValue(node); + case ParseNodeType.Raise: - return this.visitRaise(node) - ? [node.typeExpression, node.valueExpression, node.tracebackExpression] - : []; + return this.visitRaise(node); case ParseNodeType.Return: - return this.visitReturn(node) ? [node.returnExpression] : []; + return this.visitReturn(node); case ParseNodeType.Set: - return this.visitSet(node) ? node.entries : []; + return this.visitSet(node); case ParseNodeType.Slice: - return this.visitSlice(node) ? [node.startValue, node.endValue, node.stepValue] : []; + return this.visitSlice(node); case ParseNodeType.StatementList: - return this.visitStatementList(node) ? node.statements : []; + return this.visitStatementList(node); case ParseNodeType.StringList: - return this.visitStringList(node) ? [node.typeAnnotation, ...node.strings] : []; + return this.visitStringList(node); case ParseNodeType.String: - return this.visitString(node) ? [] : []; + return this.visitString(node); case ParseNodeType.Suite: - return this.visitSuite(node) ? [...node.statements] : []; + return this.visitSuite(node); case ParseNodeType.Ternary: - return this.visitTernary(node) ? [node.ifExpression, node.testExpression, node.elseExpression] : []; + return this.visitTernary(node); case ParseNodeType.Tuple: - return this.visitTuple(node) ? node.expressions : []; + return this.visitTuple(node); case ParseNodeType.Try: - return this.visitTry(node) - ? [node.trySuite, ...node.exceptClauses, node.elseSuite, node.finallySuite] - : []; + return this.visitTry(node); case ParseNodeType.TypeAlias: - return this.visitTypeAlias(node) ? [node.name, node.typeParameters, node.expression] : []; + return this.visitTypeAlias(node); case ParseNodeType.TypeAnnotation: - return this.visitTypeAnnotation(node) ? [node.valueExpression, node.typeAnnotation] : []; + return this.visitTypeAnnotation(node); case ParseNodeType.TypeParameter: - return this.visitTypeParameter(node) ? [node.name, node.boundExpression] : []; + return this.visitTypeParameter(node); case ParseNodeType.TypeParameterList: - return this.visitTypeParameterList(node) ? [...node.parameters] : []; + return this.visitTypeParameterList(node); case ParseNodeType.UnaryOperation: - return this.visitUnaryOperation(node) ? [node.expression] : []; + return this.visitUnaryOperation(node); case ParseNodeType.Unpack: - return this.visitUnpack(node) ? [node.expression] : []; + return this.visitUnpack(node); case ParseNodeType.While: - return this.visitWhile(node) ? [node.testExpression, node.whileSuite, node.elseSuite] : []; + return this.visitWhile(node); case ParseNodeType.With: - return this.visitWith(node) ? [...node.withItems, node.suite] : []; + return this.visitWith(node); case ParseNodeType.WithItem: - return this.visitWithItem(node) ? [node.expression, node.target] : []; + return this.visitWithItem(node); case ParseNodeType.Yield: - return this.visitYield(node) ? [node.expression] : []; + return this.visitYield(node); case ParseNodeType.YieldFrom: - return this.visitYieldFrom(node) ? [node.expression] : []; + return this.visitYieldFrom(node); + + default: + debug.assertNever(node, `Unknown node type ${node}`); } } // Override these methods as necessary. visitArgument(node: ArgumentNode) { - return true; + return this._default; } visitAssert(node: AssertNode) { - return true; + return this._default; } visitAssignment(node: AssignmentNode) { - return true; + return this._default; } visitAssignmentExpression(node: AssignmentExpressionNode) { - return true; + return this._default; } visitAugmentedAssignment(node: AugmentedAssignmentNode) { - return true; + return this._default; } visitAwait(node: AwaitNode) { - return true; + return this._default; } visitBinaryOperation(node: BinaryOperationNode) { - return true; + return this._default; } visitBreak(node: BreakNode) { - return true; + return this._default; } visitCall(node: CallNode) { - return true; + return this._default; } visitCase(node: CaseNode) { - return true; + return this._default; } visitClass(node: ClassNode) { - return true; + return this._default; } visitTernary(node: TernaryNode) { - return true; + return this._default; } visitContinue(node: ContinueNode) { - return true; + return this._default; } visitConstant(node: ConstantNode) { - return true; + return this._default; } visitDecorator(node: DecoratorNode) { - return true; + return this._default; } visitDel(node: DelNode) { - return true; + return this._default; } visitDictionary(node: DictionaryNode) { - return true; + return this._default; } visitDictionaryKeyEntry(node: DictionaryKeyEntryNode) { - return true; + return this._default; } visitDictionaryExpandEntry(node: DictionaryExpandEntryNode) { - return true; + return this._default; } visitError(node: ErrorNode) { - return true; + return this._default; } visitEllipsis(node: EllipsisNode) { - return true; + return this._default; } visitIf(node: IfNode) { - return true; + return this._default; } visitImport(node: ImportNode) { - return true; + return this._default; } visitImportAs(node: ImportAsNode) { - return true; + return this._default; } visitImportFrom(node: ImportFromNode) { - return true; + return this._default; } visitImportFromAs(node: ImportFromAsNode) { - return true; + return this._default; } visitIndex(node: IndexNode) { - return true; + return this._default; } visitExcept(node: ExceptNode) { - return true; + return this._default; } visitFor(node: ForNode) { - return true; + return this._default; } visitFormatString(node: FormatStringNode) { - return true; + return this._default; } visitFunction(node: FunctionNode) { - return true; + return this._default; } visitFunctionAnnotation(node: FunctionAnnotationNode) { - return true; + return this._default; } visitGlobal(node: GlobalNode) { - return true; + return this._default; } visitLambda(node: LambdaNode) { - return true; + return this._default; } visitList(node: ListNode) { - return true; + return this._default; } visitListComprehension(node: ListComprehensionNode) { - return true; + return this._default; } visitListComprehensionFor(node: ListComprehensionForNode) { - return true; + return this._default; } visitListComprehensionIf(node: ListComprehensionIfNode) { - return true; + return this._default; } visitMatch(node: MatchNode) { - return true; + return this._default; } visitMemberAccess(node: MemberAccessNode) { - return true; + return this._default; } visitModule(node: ModuleNode) { - return true; + return this._default; } visitModuleName(node: ModuleNameNode) { - return true; + return this._default; } visitName(node: NameNode) { - return true; + return this._default; } visitNonlocal(node: NonlocalNode) { - return true; + return this._default; } visitNumber(node: NumberNode) { - return true; + return this._default; } visitParameter(node: ParameterNode) { - return true; + return this._default; } visitPass(node: PassNode) { - return true; + return this._default; } visitPatternCapture(node: PatternCaptureNode) { - return true; + return this._default; } visitPatternClass(node: PatternClassNode) { - return true; + return this._default; } visitPatternClassArgument(node: PatternClassArgumentNode) { - return true; + return this._default; } visitPatternAs(node: PatternAsNode) { - return true; + return this._default; } visitPatternLiteral(node: PatternLiteralNode) { - return true; + return this._default; } visitPatternMappingExpandEntry(node: PatternMappingExpandEntryNode) { - return true; + return this._default; } visitPatternSequence(node: PatternSequenceNode) { - return true; + return this._default; } visitPatternValue(node: PatternValueNode) { - return true; + return this._default; } visitPatternMappingKeyEntry(node: PatternMappingKeyEntryNode) { - return true; + return this._default; } visitPatternMapping(node: PatternMappingNode) { - return true; + return this._default; } visitRaise(node: RaiseNode) { - return true; + return this._default; } visitReturn(node: ReturnNode) { - return true; + return this._default; } visitSet(node: SetNode) { - return true; + return this._default; } visitSlice(node: SliceNode) { - return true; + return this._default; } visitStatementList(node: StatementListNode) { - return true; + return this._default; } visitString(node: StringNode) { - return true; + return this._default; } visitStringList(node: StringListNode) { - return true; + return this._default; } visitSuite(node: SuiteNode) { - return true; + return this._default; } visitTuple(node: TupleNode) { - return true; + return this._default; } visitTry(node: TryNode) { - return true; + return this._default; } visitTypeAlias(node: TypeAliasNode) { - return true; + return this._default; } visitTypeAnnotation(node: TypeAnnotationNode) { - return true; + return this._default; } visitTypeParameter(node: TypeParameterNode) { - return true; + return this._default; } visitTypeParameterList(node: TypeParameterListNode) { - return true; + return this._default; } visitUnaryOperation(node: UnaryOperationNode) { - return true; + return this._default; } visitUnpack(node: UnpackNode) { - return true; + return this._default; } visitWhile(node: WhileNode) { - return true; + return this._default; } visitWith(node: WithNode) { - return true; + return this._default; } visitWithItem(node: WithItemNode) { - return true; + return this._default; } visitYield(node: YieldNode) { - return true; + return this._default; } visitYieldFrom(node: YieldFromNode) { - return true; + return this._default; + } +} + +// To use this class, create a subclass and override the +// visitXXX methods that you want to handle. +export class ParseTreeWalker extends ParseTreeVisitor { + constructor() { + super(/* default */ true); + } + + walk(node: ParseNode): void { + const childrenToWalk = this.visitNode(node); + if (childrenToWalk.length > 0) { + this.walkMultiple(childrenToWalk); + } + } + + walkMultiple(nodes: ParseNodeArray) { + nodes.forEach((node) => { + if (node) { + this.walk(node); + } + }); + } + + // If this.visit(node) returns true, all child nodes for the node are returned. + // If the method returns false, we assume that the handler has already handled the + // child nodes, so an empty list is returned. + visitNode(node: ParseNode): ParseNodeArray { + return this.visit(node) ? getChildNodes(node) : []; } } diff --git a/packages/pyright-internal/src/analyzer/patternMatching.ts b/packages/pyright-internal/src/analyzer/patternMatching.ts index bb781a1bd..a8fcc60a3 100644 --- a/packages/pyright-internal/src/analyzer/patternMatching.ts +++ b/packages/pyright-internal/src/analyzer/patternMatching.ts @@ -11,6 +11,7 @@ import { appendArray } from '../common/collectionUtils'; import { assert } from '../common/debug'; +import { DiagnosticAddendum } from '../common/diagnostic'; import { DiagnosticRule } from '../common/diagnosticRules'; import { Localizer } from '../localization/localize'; import { @@ -56,11 +57,13 @@ import { getTypeCondition, getTypeVarScopeId, isLiteralType, + isPartlyUnknown, isTupleClass, isUnboundedTupleClass, lookUpClassMember, mapSubtypes, partiallySpecializeType, + preserveUnknown, specializeClassType, specializeTupleClass, } from './typeUtils'; @@ -142,6 +145,36 @@ export function narrowTypeBasedOnPattern( } } +// Determines whether this pattern (or part of the pattern) in +// this case statement will never be matched. +export function checkForUnusedPattern(evaluator: TypeEvaluator, pattern: PatternAtomNode, subjectType: Type): void { + if (isNever(subjectType)) { + reportUnnecessaryPattern(evaluator, pattern, subjectType); + } else if (pattern.nodeType === ParseNodeType.PatternAs && pattern.orPatterns.length > 1) { + // Check each of the or patterns separately. + pattern.orPatterns.forEach((orPattern) => { + const subjectTypeMatch = narrowTypeBasedOnPattern( + evaluator, + subjectType, + orPattern, + /* isPositiveTest */ true + ); + + if (isNever(subjectTypeMatch)) { + reportUnnecessaryPattern(evaluator, orPattern, subjectType); + } + + subjectType = narrowTypeBasedOnPattern(evaluator, subjectType, orPattern, /* isPositiveTest */ false); + }); + } else { + const subjectTypeMatch = narrowTypeBasedOnPattern(evaluator, subjectType, pattern, /* isPositiveTest */ true); + + if (isNever(subjectTypeMatch)) { + reportUnnecessaryPattern(evaluator, pattern, subjectType); + } + } +} + function narrowTypeBasedOnSequencePattern( evaluator: TypeEvaluator, type: Type, @@ -212,7 +245,7 @@ function narrowTypeBasedOnSequencePattern( } } } else { - if (!isNever(narrowedEntryType) || isAnyOrUnknown(entryType)) { + if (!isNever(narrowedEntryType)) { isDefiniteMatch = false; } } @@ -296,8 +329,60 @@ function narrowTypeBasedOnMappingPattern( isPositiveTest: boolean ): Type { if (!isPositiveTest) { - // Never narrow in negative case. - return type; + // Our ability to narrow in the negative case for mapping patterns is + // limited, but we can do it if the type is a union that includes a + // TypedDict with a field discriminated by a literal. + if (pattern.entries.length !== 1 || pattern.entries[0].nodeType !== ParseNodeType.PatternMappingKeyEntry) { + return type; + } + + const keyPattern = pattern.entries[0].keyPattern; + const valuePattern = pattern.entries[0].valuePattern; + if ( + keyPattern.nodeType !== ParseNodeType.PatternLiteral || + valuePattern.nodeType !== ParseNodeType.PatternAs || + !valuePattern.orPatterns.every((orPattern) => orPattern.nodeType === ParseNodeType.PatternLiteral) + ) { + return type; + } + + const keyType = evaluator.getTypeOfExpression(keyPattern.expression).type; + + // The key type must be a str literal. + if (!isClassInstance(keyType) || !ClassType.isBuiltIn(keyType, 'str') || keyType.literalValue === undefined) { + return type; + } + const keyValue = keyType.literalValue as string; + + const valueTypes = valuePattern.orPatterns.map( + (orPattern) => evaluator.getTypeOfExpression((orPattern as PatternLiteralNode).expression).type + ); + + return mapSubtypes(type, (subtype) => { + if (isClassInstance(subtype) && ClassType.isTypedDictClass(subtype)) { + const typedDictMembers = getTypedDictMembersForClass(evaluator, subtype, /* allowNarrowed */ true); + const member = typedDictMembers.get(keyValue); + + if (member && (member.isRequired || member.isProvided) && isClassInstance(member.valueType)) { + const memberValueType = member.valueType; + + // If there's at least one literal value pattern that matches + // the literal type of the member, we can eliminate this type. + if ( + valueTypes.some( + (valueType) => + isClassInstance(valueType) && + ClassType.isSameGenericClass(valueType, memberValueType) && + valueType.literalValue === memberValueType.literalValue + ) + ) { + return undefined; + } + } + } + + return subtype; + }); } let mappingInfo = getMappingPatternInfo(evaluator, type); @@ -451,6 +536,19 @@ function narrowTypeBasedOnLiteralPattern( if (evaluator.assignType(subtype, literalType)) { return literalType; } + + // See if the subtype is a subclass of the literal's class. For example, + // if it's a literal str, see if the subtype is subclass of str. + if ( + isClassInstance(literalType) && + isLiteralType(literalType) && + isClassInstance(subtype) && + !isLiteralType(subtype) + ) { + if (evaluator.assignType(ClassType.cloneWithLiteral(literalType, /* value */ undefined), subtype)) { + return subtype; + } + } return undefined; }); } @@ -490,25 +588,41 @@ function narrowTypeBasedOnClassPattern( type, /* conditionFilter */ undefined, (subjectSubtypeExpanded, subjectSubtypeUnexpanded) => { - if (!isClassInstance(subjectSubtypeExpanded)) { + if (!isNoneInstance(subjectSubtypeExpanded) && !isClassInstance(subjectSubtypeExpanded)) { return subjectSubtypeUnexpanded; } + if ( + isNoneInstance(subjectSubtypeExpanded) && + isInstantiableClass(classType) && + ClassType.isBuiltIn(classType, 'NoneType') + ) { + return undefined; + } + if (!evaluator.assignType(classInstance, subjectSubtypeExpanded)) { return subjectSubtypeExpanded; } - // If there are no arguments, we're done. We know that this match - // will never succeed. if (pattern.arguments.length === 0) { - return undefined; + if ( + isClass(classInstance) && + isClass(subjectSubtypeExpanded) && + ClassType.isSameGenericClass(classInstance, subjectSubtypeExpanded) + ) { + // We know that this match will always succeed, so we can + // eliminate this subtype. + return undefined; + } + + return subjectSubtypeExpanded; } // We might be able to narrow further based on arguments, but only // if the types match exactly or the subtype is a final class and // therefore cannot be subclassed. if (!evaluator.assignType(subjectSubtypeExpanded, classInstance)) { - if (!ClassType.isFinal(subjectSubtypeExpanded)) { + if (isClass(subjectSubtypeExpanded) && !ClassType.isFinal(subjectSubtypeExpanded)) { return subjectSubtypeExpanded; } } @@ -570,6 +684,14 @@ function narrowTypeBasedOnClassPattern( return convertToInstance(unexpandedSubtype); } + if ( + isNoneInstance(subjectSubtypeExpanded) && + isInstantiableClass(expandedSubtype) && + ClassType.isBuiltIn(expandedSubtype, 'NoneType') + ) { + return subjectSubtypeExpanded; + } + if (isClassInstance(subjectSubtypeExpanded)) { let resultType: Type; @@ -611,14 +733,12 @@ function narrowTypeBasedOnClassPattern( matchTypeInstance, subjectSubtypeExpanded, typeVarContext, - [] + /* liveTypeVarScopes */ undefined ) ) { - resultType = applySolvedTypeVars( - matchTypeInstance, - typeVarContext, - /* unknownIfNotFound */ true - ) as ClassType; + resultType = applySolvedTypeVars(matchTypeInstance, typeVarContext, { + unknownIfNotFound: true, + }) as ClassType; } } } @@ -667,6 +787,12 @@ function narrowTypeBasedOnClassPattern( ); } +// Some built-in classes are treated as special cases for the class pattern +// if a positional argument is used. +function isClassSpecialCaseForClassPattern(classType: ClassType) { + return classPatternSpecialCases.some((className) => classType.details.fullName === className); +} + // Narrows the pattern provided for a class pattern argument. function narrowTypeOfClassPatternArgument( evaluator: TypeEvaluator, @@ -692,15 +818,30 @@ function narrowTypeOfClassPatternArgument( return UnknownType.create(); } - const useSelfForPattern = - isClass(matchType) && - classPatternSpecialCases.some((className) => matchType.details.fullName === className) && - argIndex === 0 && - !arg.name; + // According to PEP 634, some built-in types use themselves as the subject + // for the first positional argument to a class pattern. Although the PEP does + // state so explicitly, this is true of subclasses of these built-in classes + // if the subclass doesn't define its own __match_args__. + let useSelfForPattern = false; + let selfForPatternType = matchType; + + if (!arg.name && isClass(matchType) && argIndex === 0) { + if (isClassSpecialCaseForClassPattern(matchType)) { + useSelfForPattern = true; + } else if (positionalArgNames.length === 0) { + matchType.details.mro.forEach((mroClass) => { + if (isClass(mroClass) && isClassSpecialCaseForClassPattern(mroClass)) { + selfForPatternType = mroClass; + useSelfForPattern = true; + } + }); + } + } let argType: Type | undefined; + if (useSelfForPattern) { - argType = ClassType.cloneAsInstance(matchType); + argType = ClassType.cloneAsInstance(selfForPatternType); } else { if (argName) { argType = evaluator.useSpeculativeMode(arg, () => @@ -787,7 +928,7 @@ function narrowTypeBasedOnValuePattern( if (isAnyOrUnknown(valueSubtypeExpanded) || isAnyOrUnknown(subjectSubtypeExpanded)) { // If either type is "Unknown" (versus Any), propagate the Unknown. return isUnknown(valueSubtypeExpanded) || isUnknown(subjectSubtypeExpanded) - ? UnknownType.create() + ? preserveUnknown(valueSubtypeExpanded, subjectSubtypeExpanded) : AnyType.create(); } @@ -1109,12 +1250,35 @@ export function assignTypeToPatternTargets( } case ParseNodeType.PatternCapture: { - evaluator.assignTypeToExpression( - pattern.target, - pattern.isWildcard ? AnyType.create() : type, - isTypeIncomplete, - pattern.target - ); + if (pattern.isWildcard) { + if (!isTypeIncomplete) { + const fileInfo = getFileInfo(pattern); + if (isUnknown(type)) { + evaluator.addDiagnostic( + fileInfo.diagnosticRuleSet.reportUnknownVariableType, + DiagnosticRule.reportUnknownVariableType, + Localizer.Diagnostic.wildcardPatternTypeUnknown(), + pattern.target + ); + } else if (isPartlyUnknown(type)) { + const diagAddendum = new DiagnosticAddendum(); + diagAddendum.addMessage( + Localizer.DiagnosticAddendum.typeOfSymbol().format({ + name: '_', + type: evaluator.printType(type, { expandTypeAlias: true }), + }) + ); + evaluator.addDiagnostic( + fileInfo.diagnosticRuleSet.reportUnknownVariableType, + DiagnosticRule.reportUnknownVariableType, + Localizer.Diagnostic.wildcardPatternTypePartiallyUnknown() + diagAddendum.getString(), + pattern.target + ); + } + } + } else { + evaluator.assignTypeToExpression(pattern.target, type, isTypeIncomplete, pattern.target); + } break; } @@ -1353,3 +1517,12 @@ export function validateClassPattern(evaluator: TypeEvaluator, pattern: PatternC } } } + +function reportUnnecessaryPattern(evaluator: TypeEvaluator, pattern: PatternAtomNode, subjectType: Type): void { + evaluator.addDiagnostic( + getFileInfo(pattern).diagnosticRuleSet.reportUnnecessaryComparison, + DiagnosticRule.reportUnnecessaryComparison, + Localizer.Diagnostic.patternNeverMatches().format({ type: evaluator.printType(subjectType) }), + pattern + ); +} diff --git a/packages/pyright-internal/src/analyzer/program.ts b/packages/pyright-internal/src/analyzer/program.ts index f8dda8195..6dd178d73 100644 --- a/packages/pyright-internal/src/analyzer/program.ts +++ b/packages/pyright-internal/src/analyzer/program.ts @@ -8,7 +8,6 @@ * and all of their recursive imports. */ -import { getHeapStatistics } from 'v8'; import { CancellationToken, CompletionItem, DocumentSymbol } from 'vscode-languageserver'; import { TextDocumentContentChangeEvent } from 'vscode-languageserver-textdocument'; import { @@ -20,19 +19,21 @@ import { MarkupKind, } from 'vscode-languageserver-types'; +import { Commands } from '../commands/commands'; import { OperationCanceledException, throwIfCancellationRequested } from '../common/cancellationUtils'; -import { appendArray } from '../common/collectionUtils'; -import { ConfigOptions, ExecutionEnvironment } from '../common/configOptions'; +import { appendArray, arrayEquals } from '../common/collectionUtils'; +import { ConfigOptions, ExecutionEnvironment, matchFileSpecs } from '../common/configOptions'; import { ConsoleInterface, StandardConsole } from '../common/console'; import { assert, assertNever } from '../common/debug'; -import { Diagnostic } from '../common/diagnostic'; +import { Diagnostic, DiagnosticCategory } from '../common/diagnostic'; import { FileDiagnostics } from '../common/diagnosticSink'; -import { FileEditAction, FileEditActions, TextEditAction } from '../common/editAction'; -import { LanguageServiceExtension } from '../common/extensibility'; +import { FileEditAction, FileEditActions, FileOperations, TextEditAction } from '../common/editAction'; +import { Extensions } from '../common/extensibility'; import { LogTracker } from '../common/logTracker'; import { combinePaths, getDirectoryPath, + getFileExtension, getFileName, getRelativePath, isFile, @@ -43,13 +44,25 @@ import { } from '../common/pathUtils'; import { convertPositionToOffset, convertRangeToTextRange, convertTextRangeToRange } from '../common/positionUtils'; import { computeCompletionSimilarity } from '../common/stringUtils'; -import { DocumentRange, doesRangeContain, doRangesIntersect, Position, Range } from '../common/textRange'; +import { TextEditTracker } from '../common/textEditTracker'; +import { + DocumentRange, + doesRangeContain, + doRangesIntersect, + getEmptyRange, + Position, + Range, + TextRange, +} from '../common/textRange'; +import { TextRangeCollection } from '../common/textRangeCollection'; import { Duration, timingStats } from '../common/timing'; +import { applyTextEditsToString } from '../common/workspaceEditUtils'; import { AutoImporter, AutoImportOptions, AutoImportResult, buildModuleSymbolsMap, + ImportFormat, ModuleSymbolMap, } from '../languageService/autoImporter'; import { CallHierarchyProvider } from '../languageService/callHierarchyProvider'; @@ -60,9 +73,12 @@ import { CompletionResultsList, } from '../languageService/completionProvider'; import { DefinitionFilter } from '../languageService/definitionProvider'; -import { DocumentSymbolCollector } from '../languageService/documentSymbolCollector'; +import { DocumentSymbolCollector, DocumentSymbolCollectorUseCase } from '../languageService/documentSymbolCollector'; import { IndexOptions, IndexResults, WorkspaceSymbolCallback } from '../languageService/documentSymbolProvider'; import { HoverResults } from '../languageService/hoverProvider'; +import { ImportAdder, ImportData } from '../languageService/importAdder'; +import { getModuleStatementIndentation, reindentSpan } from '../languageService/indentationUtils'; +import { getInsertionPointForSymbolUnderModule } from '../languageService/insertionPointUtils'; import { ReferenceCallback, ReferencesResult } from '../languageService/referencesProvider'; import { RenameModuleProvider } from '../languageService/renameModuleProvider'; import { SignatureHelpResults } from '../languageService/signatureHelpProvider'; @@ -70,20 +86,28 @@ import { ParseNodeType } from '../parser/parseNodes'; import { ParseResults } from '../parser/parser'; import { AbsoluteModuleDescriptor, ImportLookupResult } from './analyzerFileInfo'; import * as AnalyzerNodeInfo from './analyzerNodeInfo'; +import { CacheManager } from './cacheManager'; import { CircularDependency } from './circularDependency'; -import { Declaration } from './declaration'; +import { Declaration, DeclarationType } from './declaration'; import { ImportResolver } from './importResolver'; import { ImportResult, ImportType } from './importResult'; -import { findNodeByOffset, getDocString } from './parseTreeUtils'; +import { + findNodeByOffset, + findNodeByPosition, + getDocString, + getDottedName, + getDottedNameWithGivenNodeAsLastName, + isBlankLine, +} from './parseTreeUtils'; import { Scope } from './scope'; import { getScopeForNode } from './scopeUtils'; import { IPythonMode, SourceFile } from './sourceFile'; -import { isUserCode } from './sourceFileInfoUtils'; +import { collectImportedByFiles, isUserCode } from './sourceFileInfoUtils'; import { isStubFile, SourceMapper } from './sourceMapper'; import { Symbol } from './symbol'; import { isPrivateOrProtectedName } from './symbolNameUtils'; import { createTracePrinter } from './tracePrinter'; -import { TypeEvaluator } from './typeEvaluatorTypes'; +import { PrintTypeOptions, TypeEvaluator } from './typeEvaluatorTypes'; import { createTypeEvaluatorWithTracker } from './typeEvaluatorWithTracker'; import { PrintTypeFlags } from './typePrinter'; import { Type } from './types'; @@ -117,6 +141,8 @@ export interface SourceFileInfo { // current file's scope. chainedSourceFile?: SourceFileInfo | undefined; + effectiveFutureImports?: Set; + // Information about why the file is included in the program // and its relation to other source files in the program. isTracked: boolean; @@ -143,8 +169,6 @@ export interface MaxAnalysisTime { export interface Indices { setWorkspaceIndex(path: string, indexResults: IndexResults): void; getIndex(execEnv: string | undefined): Map | undefined; - setIndex(execEnv: string | undefined, path: string, indexResults: IndexResults): void; - reset(): void; } interface UpdateImportInfo { @@ -160,6 +184,7 @@ export interface OpenFileOptions { isTracked: boolean; ipythonMode: IPythonMode; chainedFilePath: string | undefined; + realFilePath: string | undefined; } // Container for all of the files that are being analyzed. Files @@ -179,34 +204,62 @@ export class Program { private _logTracker: LogTracker; private _parsedFileCount = 0; private _preCheckCallback: PreCheckCallback | undefined; + private _cacheManager: CacheManager; + private _id: number; + private static _nextId = 0; constructor( initialImportResolver: ImportResolver, initialConfigOptions: ConfigOptions, console?: ConsoleInterface, - private _extension?: LanguageServiceExtension, logTracker?: LogTracker, - private _disableChecker?: boolean + private _disableChecker?: boolean, + cacheManager?: CacheManager ) { this._console = console || new StandardConsole(); this._logTracker = logTracker ?? new LogTracker(console, 'FG'); this._importResolver = initialImportResolver; this._configOptions = initialConfigOptions; + this._cacheManager = cacheManager ?? new CacheManager(); + this._cacheManager.registerCacheOwner(this); this._createNewEvaluator(); + this._id = Program._nextId; + Program._nextId += 1; + } + + dispose() { + this._cacheManager.unregisterCacheOwner(this); } get evaluator(): TypeEvaluator | undefined { return this._evaluator; } + get console(): ConsoleInterface { + return this._console; + } + + get id() { + return this._id; + } + setConfigOptions(configOptions: ConfigOptions) { this._configOptions = configOptions; + this._importResolver.setConfigOptions(configOptions); // Create a new evaluator with the updated config options. this._createNewEvaluator(); } + get rootPath(): string { + return this._configOptions.projectRoot; + } + + getConfigOptions(): ConfigOptions { + return this._configOptions; + } + setImportResolver(importResolver: ImportResolver) { this._importResolver = importResolver; @@ -216,6 +269,10 @@ export class Program { this._createNewEvaluator(); } + getImportResolver() { + return this._importResolver; + } + // Sets the list of tracked files that make up the program. setTrackedFiles(filePaths: string[]): FileDiagnostics[] { if (this._sourceFileList.length > 0) { @@ -262,8 +319,18 @@ export class Program { }); } + addInterimFile(filePath: string): SourceFileInfo { + // Double check not already there. + let fileInfo = this.getSourceFileInfo(filePath); + if (!fileInfo) { + fileInfo = this._createInterimFileInfo(filePath); + this._addToSourceFileListAndMap(fileInfo); + } + return fileInfo; + } + addTrackedFile(filePath: string, isThirdPartyImport = false, isInPyTypedPackage = false): SourceFile { - let sourceFileInfo = this._getSourceFileInfoFromPath(filePath); + let sourceFileInfo = this.getSourceFileInfo(filePath); const importName = this._getImportNameForFile(filePath); if (sourceFileInfo) { @@ -306,7 +373,7 @@ export class Program { contents: TextDocumentContentChangeEvent[], options?: OpenFileOptions ) { - let sourceFileInfo = this._getSourceFileInfoFromPath(filePath); + let sourceFileInfo = this.getSourceFileInfo(filePath); if (!sourceFileInfo) { const importName = this._getImportNameForFile(filePath); const sourceFile = new SourceFile( @@ -317,6 +384,7 @@ export class Program { /* isInPyTypedPackage */ false, this._console, this._logTracker, + options?.realFilePath, options?.ipythonMode ?? IPythonMode.None ); @@ -324,7 +392,7 @@ export class Program { sourceFileInfo = { sourceFile, isTracked: options?.isTracked ?? false, - chainedSourceFile: chainedFilePath ? this._getSourceFileInfoFromPath(chainedFilePath) : undefined, + chainedSourceFile: chainedFilePath ? this.getSourceFileInfo(chainedFilePath) : undefined, isOpenByClient: true, isTypeshedFile: false, isThirdPartyImport: false, @@ -350,26 +418,25 @@ export class Program { } getChainedFilePath(filePath: string): string | undefined { - const sourceFileInfo = this._getSourceFileInfoFromPath(filePath); + const sourceFileInfo = this.getSourceFileInfo(filePath); return sourceFileInfo?.chainedSourceFile?.sourceFile.getFilePath(); } updateChainedFilePath(filePath: string, chainedFilePath: string | undefined) { - const sourceFileInfo = this._getSourceFileInfoFromPath(filePath); + const sourceFileInfo = this.getSourceFileInfo(filePath); if (sourceFileInfo) { - sourceFileInfo.chainedSourceFile = chainedFilePath - ? this._getSourceFileInfoFromPath(chainedFilePath) - : undefined; + sourceFileInfo.chainedSourceFile = chainedFilePath ? this.getSourceFileInfo(chainedFilePath) : undefined; sourceFileInfo.sourceFile.markDirty(); - this._markFileDirtyRecursive(sourceFileInfo, new Map()); + this._markFileDirtyRecursive(sourceFileInfo, new Set()); } } - setFileClosed(filePath: string): FileDiagnostics[] { - const sourceFileInfo = this._getSourceFileInfoFromPath(filePath); + setFileClosed(filePath: string, isTracked?: boolean): FileDiagnostics[] { + const sourceFileInfo = this.getSourceFileInfo(filePath); if (sourceFileInfo) { sourceFileInfo.isOpenByClient = false; + sourceFileInfo.isTracked = isTracked ?? sourceFileInfo.isTracked; sourceFileInfo.sourceFile.setClientVersion(null, []); // There is no guarantee that content is saved before the file is closed. @@ -378,19 +445,15 @@ export class Program { // people who use diagnosticMode Workspace. if (sourceFileInfo.sourceFile.didContentsChangeOnDisk()) { sourceFileInfo.sourceFile.markDirty(); - this._markFileDirtyRecursive(sourceFileInfo, new Map()); + this._markFileDirtyRecursive(sourceFileInfo, new Set()); } } return this._removeUnneededFiles(); } - isFileOpen(filePath: string) { - return this._getSourceFileInfoFromPath(filePath) !== undefined; - } - markAllFilesDirty(evenIfContentsAreSame: boolean, indexingNeeded = true) { - const markDirtyMap = new Map(); + const markDirtySet = new Set(); this._sourceFileList.forEach((sourceFileInfo) => { if (evenIfContentsAreSame) { @@ -400,19 +463,19 @@ export class Program { // Mark any files that depend on this file as dirty // also. This will retrigger analysis of these other files. - this._markFileDirtyRecursive(sourceFileInfo, markDirtyMap); + this._markFileDirtyRecursive(sourceFileInfo, markDirtySet); } }); - if (markDirtyMap.size > 0) { + if (markDirtySet.size > 0) { this._createNewEvaluator(); } } markFilesDirty(filePaths: string[], evenIfContentsAreSame: boolean, indexingNeeded = true) { - const markDirtyMap = new Map(); + const markDirtySet = new Set(); filePaths.forEach((filePath) => { - const sourceFileInfo = this._getSourceFileInfoFromPath(filePath); + const sourceFileInfo = this.getSourceFileInfo(filePath); if (sourceFileInfo) { const fileName = getFileName(filePath); @@ -434,17 +497,21 @@ export class Program { // Mark any files that depend on this file as dirty // also. This will retrigger analysis of these other files. - this._markFileDirtyRecursive(sourceFileInfo, markDirtyMap); + this._markFileDirtyRecursive(sourceFileInfo, markDirtySet); } } }); - if (markDirtyMap.size > 0) { + if (markDirtySet.size > 0) { this._createNewEvaluator(); } } - getFileCount() { + getFileCount(userFileOnly = true) { + if (userFileOnly) { + return this._sourceFileList.filter((f) => isUserCode(f)).length; + } + return this._sourceFileList.length; } @@ -454,8 +521,8 @@ export class Program { return this._sourceFileList.filter((s) => isUserCode(s)).length; } - getTracked(): SourceFileInfo[] { - return this._sourceFileList.filter((s) => s.isTracked); + getUserFiles(): SourceFileInfo[] { + return this._sourceFileList.filter((s) => isUserCode(s)); } getOpened(): SourceFileInfo[] { @@ -484,13 +551,28 @@ export class Program { return this._configOptions.checkOnlyOpenFiles || false; } + functionSignatureDisplay() { + return this._configOptions.functionSignatureDisplay; + } + containsSourceFileIn(folder: string): boolean { const normalized = normalizePathCase(this._fs, folder); return this._sourceFileList.some((i) => i.sourceFile.getFilePath().startsWith(normalized)); } + owns(filePath: string) { + const fileInfo = this.getSourceFileInfo(filePath); + if (fileInfo) { + // If we already determined whether the file is tracked or not, don't do it again. + // This will make sure we have consistent look at the state once it is loaded to the memory. + return fileInfo.isTracked; + } + + return matchFileSpecs(this._configOptions, filePath); + } + getSourceFile(filePath: string): SourceFile | undefined { - const sourceFileInfo = this._getSourceFileInfoFromPath(filePath); + const sourceFileInfo = this.getSourceFileInfo(filePath); if (!sourceFileInfo) { return undefined; } @@ -499,13 +581,21 @@ export class Program { } getBoundSourceFile(filePath: string): SourceFile | undefined { - const sourceFileInfo = this._getSourceFileInfoFromPath(filePath); + return this.getBoundSourceFileInfo(filePath)?.sourceFile; + } + + getSourceFileInfo(filePath: string): SourceFileInfo | undefined { + return this._sourceFileMap.get(normalizePathCase(this._fs, filePath)); + } + + getBoundSourceFileInfo(filePath: string, content?: string, force?: boolean): SourceFileInfo | undefined { + const sourceFileInfo = this.getSourceFileInfo(filePath); if (!sourceFileInfo) { return undefined; } - this._bindFile(sourceFileInfo); - return this.getSourceFile(filePath); + this._bindFile(sourceFileInfo, content, force); + return sourceFileInfo; } // Performs parsing and analysis of any source files in the program @@ -527,7 +617,7 @@ export class Program { // Check the open files. for (const sourceFileInfo of openFiles) { - if (this._checkTypes(sourceFileInfo)) { + if (this._checkTypes(sourceFileInfo, token)) { if (elapsedTime.getDurationInMilliseconds() > effectiveMaxTime) { return true; } @@ -551,7 +641,7 @@ export class Program { continue; } - if (this._checkTypes(sourceFileInfo)) { + if (this._checkTypes(sourceFileInfo, token)) { if (elapsedTime.getDurationInMilliseconds() > effectiveMaxTime) { return true; } @@ -563,6 +653,18 @@ export class Program { }); } + // Performs parsing and analysis of a single file in the program. If the file is not part of + // the program returns false to indicate analysis was not performed. + analyzeFile(filePath: string, token: CancellationToken = CancellationToken.None): boolean { + return this._runEvaluatorWithCancellationToken(token, () => { + const sourceFileInfo = this.getSourceFileInfo(filePath); + if (sourceFileInfo && this._checkTypes(sourceFileInfo, token)) { + return true; + } + return false; + }); + } + indexWorkspace(callback: (path: string, results: IndexResults) => void, token: CancellationToken): number { if (!this._configOptions.indexing) { return 0; @@ -752,11 +854,11 @@ export class Program { return evaluator.getEffectiveTypeOfSymbol(symbol); } - printType(type: Type, expandTypeAlias: boolean): string { + printType(type: Type, options?: PrintTypeOptions): string { this._handleMemoryHighUsage(); const evaluator = this._evaluator || this._createNewEvaluator(); - return evaluator.printType(type, expandTypeAlias); + return evaluator.printType(type, options); } private static _getPrintTypeFlags(configOptions: ConfigOptions): PrintTypeFlags { @@ -790,9 +892,16 @@ export class Program { } public _getImportNameForFile(filePath: string) { + // We allow illegal module names (e.g. names that include "-" in them) + // because we want a unique name for each module even if it cannot be + // imported through an "import" statement. It's important to have a + // unique name in case two modules declare types with the same local + // name. The type checker uses the fully-qualified (unique) module name + // to differentiate between such types. const moduleNameAndType = this._importResolver.getModuleNameForImport( filePath, - this._configOptions.getDefaultExecEnvironment() + this._configOptions.getDefaultExecEnvironment(), + /* allowIllegalModuleName */ true ); return moduleNameAndType.moduleName; } @@ -802,33 +911,10 @@ export class Program { // We need to track the relationship so if the original type stub is removed from the // program, we can remove the corresponding shadowed file and any files it imports. private _addShadowedFile(stubFile: SourceFileInfo, shadowImplPath: string): SourceFile { - let shadowFileInfo = this._getSourceFileInfoFromPath(shadowImplPath); + let shadowFileInfo = this.getSourceFileInfo(shadowImplPath); if (!shadowFileInfo) { - const importName = this._getImportNameForFile(shadowImplPath); - const sourceFile = new SourceFile( - this._fs, - shadowImplPath, - importName, - /* isThirdPartyImport */ false, - /* isInPyTypedPackage */ false, - this._console, - this._logTracker - ); - shadowFileInfo = { - sourceFile, - isTracked: false, - isOpenByClient: false, - isTypeshedFile: false, - isThirdPartyImport: false, - isThirdPartyPyTypedPresent: false, - diagnosticsVersion: undefined, - imports: [], - importedBy: [], - shadows: [], - shadowedBy: [], - }; - this._addToSourceFileListAndMap(shadowFileInfo); + shadowFileInfo = this.addInterimFile(shadowImplPath); } if (!shadowFileInfo.shadows.includes(stubFile)) { @@ -842,6 +928,34 @@ export class Program { return shadowFileInfo.sourceFile; } + private _createInterimFileInfo(filePath: string) { + const importName = this._getImportNameForFile(filePath); + const sourceFile = new SourceFile( + this._fs, + filePath, + importName, + /* isThirdPartyImport */ false, + /* isInPyTypedPackage */ false, + this._console, + this._logTracker + ); + const sourceFileInfo = { + sourceFile, + isTracked: false, + isOpenByClient: false, + isTypeshedFile: false, + isThirdPartyImport: false, + isThirdPartyPyTypedPresent: false, + diagnosticsVersion: undefined, + imports: [], + importedBy: [], + shadows: [], + shadowedBy: [], + }; + + return sourceFileInfo; + } + private _createNewEvaluator() { if (this._evaluator) { // We shouldn't need to call this, but there appears to be a bug @@ -856,7 +970,6 @@ export class Program { printTypeFlags: Program._getPrintTypeFlags(this._configOptions), logCalls: this._configOptions.logTypeEvaluationTime, minimumLoggingThreshold: this._configOptions.typeEvaluationTimeThreshold, - analyzeUnannotatedFunctions: this._configOptions.analyzeUnannotatedFunctions, evaluateUnknownImportsAsAny: !!this._configOptions.evaluateUnknownImportsAsAny, verifyTypeCacheEvaluatorFlags: !!this._configOptions.internalTestMode, }, @@ -873,8 +986,8 @@ export class Program { return this._evaluator; } - private _parseFile(fileToParse: SourceFileInfo, content?: string) { - if (!this._isFileNeeded(fileToParse) || !fileToParse.sourceFile.isParseRequired()) { + private _parseFile(fileToParse: SourceFileInfo, content?: string, force?: boolean) { + if (!force && (!this._isFileNeeded(fileToParse) || !fileToParse.sourceFile.isParseRequired())) { return; } @@ -888,8 +1001,8 @@ export class Program { // Mark any files that depend on this file as dirty // also. This will retrigger analysis of these other files. - const markDirtyMap = new Map(); - this._markFileDirtyRecursive(fileToParse, markDirtyMap); + const markDirtySet = new Set(); + this._markFileDirtyRecursive(fileToParse, markDirtySet); // Invalidate the import resolver's cache as well. this._importResolver.invalidateCache(); @@ -898,12 +1011,12 @@ export class Program { // Binds the specified file and all of its dependencies, recursively. If // it runs out of time, it returns true. If it completes, it returns false. - private _bindFile(fileToAnalyze: SourceFileInfo, content?: string): void { - if (!this._isFileNeeded(fileToAnalyze) || !fileToAnalyze.sourceFile.isBindingRequired()) { + private _bindFile(fileToAnalyze: SourceFileInfo, content?: string, force?: boolean): void { + if (!force && (!this._isFileNeeded(fileToAnalyze) || !fileToAnalyze.sourceFile.isBindingRequired())) { return; } - this._parseFile(fileToAnalyze, content); + this._parseFile(fileToAnalyze, content, force); const getScopeIfAvailable = (fileInfo: SourceFileInfo | undefined) => { if (!fileInfo || fileInfo === fileToAnalyze) { @@ -936,14 +1049,30 @@ export class Program { getScopeIfAvailable(fileToAnalyze.builtinsImport); } - fileToAnalyze.sourceFile.bind(this._configOptions, this._lookUpImport, builtinsScope); + let futureImports = fileToAnalyze.sourceFile.getParseResults()!.futureImports; + if (fileToAnalyze.chainedSourceFile) { + futureImports = this._getEffectiveFutureImports(futureImports, fileToAnalyze.chainedSourceFile); + } + fileToAnalyze.effectiveFutureImports = futureImports.size > 0 ? futureImports : undefined; + + fileToAnalyze.sourceFile.bind(this._configOptions, this._lookUpImport, builtinsScope, futureImports); + } + + private _getEffectiveFutureImports(futureImports: Set, chainedSourceFile: SourceFileInfo): Set { + const effectiveFutureImports = new Set(futureImports); + + chainedSourceFile.effectiveFutureImports?.forEach((value) => { + effectiveFutureImports.add(value); + }); + + return effectiveFutureImports; } private _lookUpImport = (filePathOrModule: string | AbsoluteModuleDescriptor): ImportLookupResult | undefined => { let sourceFileInfo: SourceFileInfo | undefined; if (typeof filePathOrModule === 'string') { - sourceFileInfo = this._getSourceFileInfoFromPath(filePathOrModule); + sourceFileInfo = this.getSourceFileInfo(filePathOrModule); } else { // Resolve the import. const importResult = this._importResolver.resolveImport( @@ -960,14 +1089,14 @@ export class Program { let resolvedPath = importResult.resolvedPaths[importResult.resolvedPaths.length - 1]; if (resolvedPath) { // See if the source file already exists in the program. - sourceFileInfo = this._getSourceFileInfoFromPath(resolvedPath); + sourceFileInfo = this.getSourceFileInfo(resolvedPath); if (!sourceFileInfo) { resolvedPath = normalizePathCase(this._fs, resolvedPath); // Start tracking the source file. this.addTrackedFile(resolvedPath); - sourceFileInfo = this._getSourceFileInfoFromPath(resolvedPath); + sourceFileInfo = this.getSourceFileInfo(resolvedPath); } } } @@ -992,6 +1121,7 @@ export class Program { const parseResults = sourceFileInfo.sourceFile.getParseResults(); const moduleNode = parseResults!.parseTree; + const fileInfo = AnalyzerNodeInfo.getFileInfo(moduleNode); const dunderAllInfo = AnalyzerNodeInfo.getDunderAllInfo(parseResults!.parseTree); @@ -1002,6 +1132,7 @@ export class Program { get docString() { return getDocString(moduleNode.statements); }, + isInPyTypedPackage: fileInfo.isInPyTypedPackage, }; }; @@ -1013,7 +1144,7 @@ export class Program { includeIndexUserSymbols: boolean, token: CancellationToken ): ModuleSymbolMap { - // If we have library map, always use the map for library symbols. + // require resolveAliasDeclaration that can cause more files to be parsed and bound. return buildModuleSymbolsMap( this._sourceFileList.filter((s) => s !== sourceFileToExclude && (userFileOnly ? isUserCode(s) : true)), includeIndexUserSymbols, @@ -1036,7 +1167,7 @@ export class Program { return false; } - private _checkTypes(fileToCheck: SourceFileInfo) { + private _checkTypes(fileToCheck: SourceFileInfo, token: CancellationToken) { return this._logTracker.log(`analyzing: ${fileToCheck.sourceFile.getFilePath()}`, (logState) => { // If the file isn't needed because it was eliminated from the // transitive closure or deleted, skip the file rather than wasting @@ -1066,7 +1197,42 @@ export class Program { } if (!this._disableChecker) { - fileToCheck.sourceFile.check(this._importResolver, this._evaluator!); + // For ipython, make sure we check all its dependent files first since + // their results can affect this file's result. + let dependentFiles: ParseResults[] | undefined = undefined; + if (fileToCheck.sourceFile.getIPythonMode() === IPythonMode.CellDocs) { + dependentFiles = []; + const importedByFiles = collectImportedByFiles(fileToCheck); + for (const file of importedByFiles) { + if (!isUserCode(file)) { + continue; + } + + // If the file is already analyzed, it will be no op. + // And make sure we don't dump parse tree and etc while + // recursively calling checker. Otherwise, inner check + // can dump parse tree required by outer check. + const handle = this._cacheManager.pauseTracking(); + try { + this._checkTypes(file, token); + } finally { + handle.dispose(); + } + + const parseResults = file.sourceFile.getParseResults(); + if (parseResults) { + dependentFiles.push(parseResults); + } + } + } + + const execEnv = this._configOptions.findExecEnvironment(fileToCheck.sourceFile.getFilePath()); + fileToCheck.sourceFile.check( + this._importResolver, + this._evaluator!, + this._createSourceMapper(execEnv, token, fileToCheck), + dependentFiles + ); } // For very large programs, we may need to discard the evaluator and @@ -1088,8 +1254,9 @@ export class Program { const filesVisitedMap = new Map(); if (!this._detectAndReportImportCycles(file, filesVisitedMap)) { - // If no cycles were reported, set a flag in all of the visited files - // so we don't need to visit them again on subsequent cycle checks. + // If no cycles were found in any of the files we visited, + // set a flag to indicates that we don't need to visit them again + // on subsequent cycle checks. filesVisitedMap.forEach((sourceFileInfo) => { sourceFileInfo.sourceFile.setNoCircularDependencyConfirmed(); }); @@ -1129,6 +1296,14 @@ export class Program { // Add the file to the closure map. closureMap.set(filePath, file); + // If this file hasn't already been parsed, parse it now. This will + // discover any files it imports. Skip this if the file is part + // of a library. We'll assume that no cycles will be generated from + // library code or typeshed stubs. + if (isUserCode(file)) { + this._parseFile(file); + } + // Recursively add the file's imports. for (const importedFileInfo of file.imports) { this._getImportsRecursive(importedFileInfo, closureMap, recursionCount + 1); @@ -1152,17 +1327,25 @@ export class Program { return false; } - filesVisited.set(sourceFileInfo.sourceFile.getFilePath(), sourceFileInfo); + const filePath = normalizePathCase(this._fs, sourceFileInfo.sourceFile.getFilePath()); + + filesVisited.set(filePath, sourceFileInfo); + let detectedCycle = false; - const filePath = normalizePathCase(this._fs, sourceFileInfo.sourceFile.getFilePath()); if (dependencyMap.has(filePath)) { + // We detect a cycle (partial or full). A full cycle is one that is + // rooted in the file at the start of our dependency chain. A partial + // cycle loops back on some other file in the dependency chain. We + // will report only full cycles here and leave the reporting of + // partial cycles to other passes. + detectedCycle = true; + // Look for chains at least two in length. A file that contains // an "import . from X" will technically create a cycle with // itself, but those are not interesting to report. if (dependencyChain.length > 1 && sourceFileInfo === dependencyChain[0]) { this._logImportCycle(dependencyChain); - detectedCycle = true; } } else { // If we've already checked this dependency along @@ -1201,34 +1384,45 @@ export class Program { circDep.normalizeOrder(); const firstFilePath = circDep.getPaths()[0]; - const firstSourceFile = this._getSourceFileInfoFromPath(firstFilePath)!; + const firstSourceFile = this.getSourceFileInfo(firstFilePath)!; assert(firstSourceFile !== undefined); firstSourceFile.sourceFile.addCircularDependency(circDep); } - private _markFileDirtyRecursive( - sourceFileInfo: SourceFileInfo, - markMap: Map, - forceRebinding = false - ) { + private _markFileDirtyRecursive(sourceFileInfo: SourceFileInfo, markSet: Set, forceRebinding = false) { const filePath = normalizePathCase(this._fs, sourceFileInfo.sourceFile.getFilePath()); // Don't mark it again if it's already been visited. - if (!markMap.has(filePath)) { - sourceFileInfo.sourceFile.markReanalysisRequired(forceRebinding); - markMap.set(filePath, true); - - sourceFileInfo.importedBy.forEach((dep) => { - // Changes on chained source file can change symbols in the symbol table and - // dependencies on the dependent file. Force rebinding. - const forceRebinding = dep.chainedSourceFile === sourceFileInfo; - this._markFileDirtyRecursive(dep, markMap, forceRebinding); - }); + if (markSet.has(filePath)) { + return; + } + + sourceFileInfo.sourceFile.markReanalysisRequired(forceRebinding); + markSet.add(filePath); + + sourceFileInfo.importedBy.forEach((dep) => { + // Changes on chained source file can change symbols in the symbol table and + // dependencies on the dependent file. Force rebinding. + const forceRebinding = dep.chainedSourceFile === sourceFileInfo; + this._markFileDirtyRecursive(dep, markSet, forceRebinding); + }); + + // Change in the current file could impact checker result of chainedSourceFile such as unused symbols. + let chainedSourceFile = sourceFileInfo.chainedSourceFile; + while (chainedSourceFile) { + if (chainedSourceFile.sourceFile.isCheckingRequired()) { + // If the file is marked for checking, its chained one should be marked + // as well. Stop here. + return; + } + + chainedSourceFile.sourceFile.markReanalysisRequired(/* forceRebinding */ false); + chainedSourceFile = chainedSourceFile.chainedSourceFile; } } getTextOnRange(filePath: string, range: Range, token: CancellationToken): string | undefined { - const sourceFileInfo = this._getSourceFileInfoFromPath(filePath); + const sourceFileInfo = this.getSourceFileInfo(filePath); if (!sourceFileInfo) { return undefined; } @@ -1261,7 +1455,7 @@ export class Program { options: AutoImportOptions, token: CancellationToken ): AutoImportResult[] { - const sourceFileInfo = this._getSourceFileInfoFromPath(filePath); + const sourceFileInfo = this.getSourceFileInfo(filePath); if (!sourceFileInfo) { return []; } @@ -1392,7 +1586,7 @@ export class Program { token: CancellationToken ): DocumentRange[] | undefined { return this._runEvaluatorWithCancellationToken(token, () => { - const sourceFileInfo = this._getSourceFileInfoFromPath(filePath); + const sourceFileInfo = this.getSourceFileInfo(filePath); if (!sourceFileInfo) { return undefined; } @@ -1401,7 +1595,7 @@ export class Program { const execEnv = this._configOptions.findExecEnvironment(filePath); return sourceFileInfo.sourceFile.getDefinitionsForPosition( - this._createSourceMapper(execEnv), + this._createSourceMapper(execEnv, token, sourceFileInfo), position, filter, this._evaluator!, @@ -1416,7 +1610,7 @@ export class Program { token: CancellationToken ): DocumentRange[] | undefined { return this._runEvaluatorWithCancellationToken(token, () => { - const sourceFileInfo = this._getSourceFileInfoFromPath(filePath); + const sourceFileInfo = this.getSourceFileInfo(filePath); if (!sourceFileInfo) { return undefined; } @@ -1425,7 +1619,13 @@ export class Program { const execEnv = this._configOptions.findExecEnvironment(filePath); return sourceFileInfo.sourceFile.getTypeDefinitionsForPosition( - this._createSourceMapper(execEnv, /* mapCompiled */ false, /* preferStubs */ true), + this._createSourceMapper( + execEnv, + token, + sourceFileInfo, + /* mapCompiled */ false, + /* preferStubs */ true + ), position, this._evaluator!, filePath, @@ -1442,7 +1642,7 @@ export class Program { token: CancellationToken ) { this._runEvaluatorWithCancellationToken(token, () => { - const sourceFileInfo = this._getSourceFileInfoFromPath(filePath); + const sourceFileInfo = this.getSourceFileInfo(filePath); if (!sourceFileInfo) { return; } @@ -1451,14 +1651,14 @@ export class Program { this._bindFile(sourceFileInfo); const execEnv = this._configOptions.findExecEnvironment(filePath); - const referencesResult = sourceFileInfo.sourceFile.getDeclarationForPosition( - this._createSourceMapper(execEnv), + const referencesResult = this._getDeclarationForPosition( + sourceFileInfo, position, - this._evaluator!, - reporter, - token + DocumentSymbolCollectorUseCase.Reference, + this._createSourceMapper(execEnv, token, sourceFileInfo), + token, + reporter ); - if (!referencesResult) { return; } @@ -1474,7 +1674,7 @@ export class Program { // See if the reference symbol's string is located somewhere within the file. // If not, we can skip additional processing for the file. const fileContents = curSourceFileInfo.sourceFile.getFileContent(); - if (!fileContents || fileContents.search(referencesResult.symbolName) >= 0) { + if (!fileContents || referencesResult.symbolNames.some((s) => fileContents.search(s) >= 0)) { this._bindFile(curSourceFileInfo); curSourceFileInfo.sourceFile.addReferences( @@ -1502,7 +1702,7 @@ export class Program { continue; } - const declFileInfo = this._getSourceFileInfoFromPath(decl.path); + const declFileInfo = this.getSourceFileInfo(decl.path); if (!declFileInfo) { // The file the declaration belongs to doesn't belong to the program. continue; @@ -1511,8 +1711,9 @@ export class Program { const tempResult = new ReferencesResult( referencesResult.requiresGlobalSearch, referencesResult.nodeAtOffset, - referencesResult.symbolName, - referencesResult.declarations + referencesResult.symbolNames, + referencesResult.declarations, + referencesResult.useCase ); declFileInfo.sourceFile.addReferences(tempResult, includeDeclaration, this._evaluator!, token); @@ -1543,7 +1744,7 @@ export class Program { this._handleMemoryHighUsage(); return this._runEvaluatorWithCancellationToken(token, () => { - const sourceFileInfo = this._getSourceFileInfoFromPath(filePath); + const sourceFileInfo = this.getSourceFileInfo(filePath); if (!sourceFileInfo) { return undefined; } @@ -1551,7 +1752,7 @@ export class Program { const content = sourceFileInfo.sourceFile.getFileContent() ?? ''; if ( options.indexingForAutoImportMode && - !options.forceIndexing && + !options.includeAllSymbols && !sourceFileInfo.sourceFile.isStubFile() && !sourceFileInfo.sourceFile.isThirdPartyPyTypedPresent() ) { @@ -1569,7 +1770,7 @@ export class Program { addSymbolsForDocument(filePath: string, symbolList: DocumentSymbol[], token: CancellationToken) { return this._runEvaluatorWithCancellationToken(token, () => { - const sourceFileInfo = this._getSourceFileInfoFromPath(filePath); + const sourceFileInfo = this.getSourceFileInfo(filePath); if (sourceFileInfo) { if (!sourceFileInfo.sourceFile.getCachedIndexResults()) { // If we already have cached index for this file, no need to bind this file. @@ -1619,7 +1820,7 @@ export class Program { token: CancellationToken ): HoverResults | undefined { return this._runEvaluatorWithCancellationToken(token, () => { - const sourceFileInfo = this._getSourceFileInfoFromPath(filePath); + const sourceFileInfo = this.getSourceFileInfo(filePath); if (!sourceFileInfo) { return undefined; } @@ -1628,10 +1829,11 @@ export class Program { const execEnv = this._configOptions.findExecEnvironment(filePath); return sourceFileInfo.sourceFile.getHoverForPosition( - this._createSourceMapper(execEnv, /* mapCompiled */ true), + this._createSourceMapper(execEnv, token, sourceFileInfo, /* mapCompiled */ true), position, format, this._evaluator!, + this.functionSignatureDisplay(), token ); }); @@ -1643,7 +1845,7 @@ export class Program { token: CancellationToken ): DocumentHighlight[] | undefined { return this._runEvaluatorWithCancellationToken(token, () => { - const sourceFileInfo = this._getSourceFileInfoFromPath(filePath); + const sourceFileInfo = this.getSourceFileInfo(filePath); if (!sourceFileInfo) { return undefined; } @@ -1652,7 +1854,7 @@ export class Program { const execEnv = this._configOptions.findExecEnvironment(filePath); return sourceFileInfo.sourceFile.getDocumentHighlight( - this._createSourceMapper(execEnv), + this._createSourceMapper(execEnv, token, sourceFileInfo), position, this._evaluator!, token @@ -1667,7 +1869,7 @@ export class Program { token: CancellationToken ): SignatureHelpResults | undefined { return this._runEvaluatorWithCancellationToken(token, () => { - const sourceFileInfo = this._getSourceFileInfoFromPath(filePath); + const sourceFileInfo = this.getSourceFileInfo(filePath); if (!sourceFileInfo) { return undefined; } @@ -1677,7 +1879,7 @@ export class Program { const execEnv = this._configOptions.findExecEnvironment(filePath); return sourceFileInfo.sourceFile.getSignatureHelpForPosition( position, - this._createSourceMapper(execEnv, /* mapCompiled */ true), + this._createSourceMapper(execEnv, token, sourceFileInfo, /* mapCompiled */ true), this._evaluator!, format, token @@ -1694,11 +1896,11 @@ export class Program { libraryMap: Map | undefined, token: CancellationToken ): Promise { - const sourceFileInfo = this._getSourceFileInfoFromPath(filePath); + const sourceFileInfo = this.getSourceFileInfo(filePath); if (!sourceFileInfo) { return undefined; } - + let sourceMapper: SourceMapper | undefined; const completionResult = this._logTracker.log( `completion at ${filePath}:${position.line}:${position.character}`, (ls) => { @@ -1706,6 +1908,7 @@ export class Program { this._bindFile(sourceFileInfo); const execEnv = this._configOptions.findExecEnvironment(filePath); + sourceMapper = this._createSourceMapper(execEnv, token, sourceFileInfo, /* mapCompiled */ true); return sourceFileInfo.sourceFile.getCompletionsForPosition( position, workspacePath, @@ -1714,14 +1917,14 @@ export class Program { this._lookUpImport, this._evaluator!, options, - this._createSourceMapper(execEnv, /* mapCompiled */ true), + sourceMapper, nameMap, libraryMap, () => this._buildModuleSymbolsMap( sourceFileInfo, !!libraryMap, - /* includeIndexUserSymbols */ false, + options.includeUserSymbolsInAutoImport, token ), token @@ -1740,19 +1943,23 @@ export class Program { extensionInfo: completionResult?.extensionInfo, }; - if (!completionResult || !this._extension?.completionListExtension) { - return completionResultsList; - } - const parseResults = sourceFileInfo.sourceFile.getParseResults(); if (parseResults?.parseTree && parseResults?.text) { const offset = convertPositionToOffset(position, parseResults.tokenizerOutput.lines); - if (offset !== undefined) { - await this._extension.completionListExtension.updateCompletionResults( - completionResultsList, - parseResults, - offset, - token + if (offset !== undefined && sourceMapper) { + await Promise.all( + Extensions.getProgramExtensions(parseResults.parseTree).map((e) => + e.completionListExtension?.updateCompletionResults( + this.evaluator!, + sourceMapper!, + options, + completionResultsList, + parseResults, + offset, + this._configOptions.functionSignatureDisplay, + token + ) + ) ); } } @@ -1769,7 +1976,7 @@ export class Program { token: CancellationToken ) { return this._runEvaluatorWithCancellationToken(token, () => { - const sourceFileInfo = this._getSourceFileInfoFromPath(filePath); + const sourceFileInfo = this.getSourceFileInfo(filePath); if (!sourceFileInfo) { return; } @@ -1783,14 +1990,14 @@ export class Program { this._lookUpImport, this._evaluator!, options, - this._createSourceMapper(execEnv, /* mapCompiled */ true), + this._createSourceMapper(execEnv, token, sourceFileInfo, /* mapCompiled */ true), nameMap, libraryMap, () => this._buildModuleSymbolsMap( sourceFileInfo, !!libraryMap, - /* includeIndexUserSymbols */ false, + options.includeUserSymbolsInAutoImport, token ), completionItem, @@ -1802,7 +2009,7 @@ export class Program { renameModule(path: string, newPath: string, token: CancellationToken): FileEditActions | undefined { return this._runEvaluatorWithCancellationToken(token, () => { if (isFile(this._fs, path)) { - const fileInfo = this._getSourceFileInfoFromPath(path); + const fileInfo = this.getSourceFileInfo(path); if (!fileInfo) { return undefined; } @@ -1829,14 +2036,28 @@ export class Program { filePath: string, newFilePath: string, position: Position, + options: { importFormat: ImportFormat }, token: CancellationToken ): FileEditActions | undefined { return this._runEvaluatorWithCancellationToken(token, () => { - const fileInfo = this._getSourceFileInfoFromPath(filePath); + const sourceFileExt = getFileExtension(filePath); + const destFileExt = getFileExtension(newFilePath); + if (sourceFileExt.toLowerCase() !== destFileExt.toLowerCase()) { + // Don't allow moving a symbol from py to pyi or vice versa. + return undefined; + } + + const fileInfo = this.getSourceFileInfo(filePath); if (!fileInfo) { return undefined; } + const newFileInfo = this.getBoundSourceFileInfo(newFilePath); + if (fileInfo === newFileInfo) { + // Can't move symbol to the same file. + return undefined; + } + this._bindFile(fileInfo); const parseResults = fileInfo.sourceFile.getParseResults(); if (!parseResults) { @@ -1854,17 +2075,34 @@ export class Program { } // If this isn't a name node, there are no references to be found. - if (node.nodeType !== ParseNodeType.Name) { + if ( + node.nodeType !== ParseNodeType.Name || + !RenameModuleProvider.canMoveSymbol(this._configOptions, this._evaluator!, node) + ) { return undefined; } + // We will try to + // 1. Find symbol to move. + // 2. Update all references to the symbol to new location. + // 3. Remove the existing symbol. + // 4. Insert the symbol to the destination module. + // 5. Insert imports required for the symbol moved to the destination module. + // 6. Remove import no longer needed from the original module. + // + // Here all changes are done to edits, no features in LS will apply changes to + // program directly. All modification is done through LSP by a edit request so + // things like undo or edit stacks UI works. + + // 1. Find symbol to move. const execEnv = this._configOptions.findExecEnvironment(filePath); const declarations = DocumentSymbolCollector.getDeclarationsForNode( node, this._evaluator!, /* resolveLocalNames */ false, + DocumentSymbolCollectorUseCase.Rename, token, - this._createSourceMapper(execEnv) + this._createSourceMapper(execEnv, token, fileInfo) ); const renameModuleProvider = RenameModuleProvider.createForSymbol( @@ -1880,9 +2118,344 @@ export class Program { return undefined; } + // 2. Update affected references. this._processModuleReferences(renameModuleProvider, node.value, filePath); - return { edits: renameModuleProvider.getEdits(), fileOperations: [] }; + + // 3. Remove existing symbols. + const sourceDecl = renameModuleProvider.declarations.find( + (d) => d.node && getFileExtension(d.path) === sourceFileExt + ); + if (!sourceDecl) { + // Can't find symbol we can move. + return undefined; + } + + const symbolRange = RenameModuleProvider.getSymbolTextRange(parseResults, sourceDecl); + const importAdder = new ImportAdder(this._configOptions, this._importResolver, this._evaluator!); + const collectedImports = importAdder.collectImportsForSymbolsUsed(parseResults, symbolRange, token); + + let insertionPoint: number | undefined = 0; + let insertionIndentation = 0; + + const newFileParseResults = newFileInfo?.sourceFile.getParseResults(); + if (newFileParseResults) { + const insertBefore = renameModuleProvider.tryGetFirstSymbolUsage(newFileParseResults); + insertionPoint = getInsertionPointForSymbolUnderModule( + this._evaluator!, + newFileParseResults, + node.value, + { + symbolDeclToIgnore: sourceDecl.path, + insertBefore, + } + ); + if (insertionPoint === undefined) { + // No place to insert the symbol. + return undefined; + } + + insertionIndentation = getModuleStatementIndentation(newFileParseResults); + } + + const reindentResult = reindentSpan(parseResults, symbolRange, insertionIndentation); + const fullRange = RenameModuleProvider.getSymbolFullStatementTextRange(parseResults, sourceDecl); + + renameModuleProvider.textEditTracker.addEdit( + filePath, + convertTextRangeToRange( + TextRange.combine([reindentResult.originalSpan, fullRange])!, + parseResults.tokenizerOutput.lines + ), + '' + ); + + // 4. Add the symbol to the destination file. + const fileOperations: FileOperations[] = []; + let codeSnippetToInsert = reindentResult.text; + if (newFileParseResults) { + const range = convertTextRangeToRange( + { start: insertionPoint, length: 0 }, + newFileParseResults.tokenizerOutput.lines + ); + + // If we are adding at the end of line (ex, end of a file), + // add new lines. + const newLinesToAdd = _getNumberOfBlankLinesToInsert(newFileParseResults, range.end); + codeSnippetToInsert = '\n'.repeat(newLinesToAdd) + codeSnippetToInsert; + + renameModuleProvider.textEditTracker.addEdit(newFilePath, range, codeSnippetToInsert); + } else { + fileOperations.push({ kind: 'create', filePath: newFilePath }); + renameModuleProvider.textEditTracker.addEdit(newFilePath, getEmptyRange(), codeSnippetToInsert); + } + + // 5. Insert imports required for the symbol moved to the destination module. + // + // Since step 5 and 6 can create nested edits, we clone the program and apply all changes to re-calculate + // edits we need to apply to the destination file. The same workflow as `fix all` but done in program level + // not service level. + const cloned = this.clone(); + + let edits = renameModuleProvider.getEdits(); + + const textAfterSymbolAdded = applyTextEditsToString( + edits.filter((v) => v.filePath === newFilePath), + newFileParseResults?.tokenizerOutput.lines ?? new TextRangeCollection([]), + newFileInfo?.sourceFile.getFileContent() ?? '' + ); + + _updateFileContent(cloned, newFilePath, textAfterSymbolAdded); + + const textAfterImportsAdded = _tryGetTextAfterImportsAdded( + cloned, + newFilePath, + collectedImports, + insertionPoint, + token + ); + + edits = _updateFileEditActions( + edits, + newFilePath, + newFileParseResults, + textAfterSymbolAdded, + textAfterImportsAdded + ); + + // 6. Remove imports no longer required from original module. + const textAfterSymbolRemoved = applyTextEditsToString( + edits.filter((v) => v.filePath === filePath), + parseResults.tokenizerOutput.lines, + fileInfo.sourceFile.getFileContent()! + ); + + _updateFileContent(cloned, filePath, textAfterSymbolRemoved); + + const textAfterUnusedImportsRemoved = _tryGetTextAfterUnusedImportsRemoved( + cloned, + filePath, + collectedImports, + 0, + token + ); + + edits = _updateFileEditActions( + edits, + filePath, + parseResults, + textAfterSymbolRemoved, + textAfterUnusedImportsRemoved + ); + + cloned.dispose(); + + return { + edits, + fileOperations, + }; + + function _updateFileEditActions( + edits: FileEditAction[], + filePath: string, + parseResults: ParseResults | undefined, + oldText: string, + newText: string | undefined + ) { + if (newText === undefined || oldText === newText) { + return edits; + } + + // There were nested edits. Replace whole file. + edits = edits.filter((v) => v.filePath !== filePath); + edits.push({ + filePath, + range: parseResults + ? convertTextRangeToRange(parseResults.parseTree, parseResults.tokenizerOutput.lines) + : getEmptyRange(), + replacementText: newText, + }); + + return edits; + } + + function _tryGetTextAfterImportsAdded( + cloned: Program, + filePath: string, + importData: ImportData, + insertionPoint: number, + token: CancellationToken + ) { + const sourceFile = cloned.getBoundSourceFile(filePath); + const parseResults = sourceFile?.getParseResults(); + if (!parseResults) { + return undefined; + } + + const insertAddEdits = importAdder.applyImports( + importData, + filePath, + parseResults, + insertionPoint, + options.importFormat, + token + ); + + return applyTextEditsToString( + insertAddEdits, + parseResults.tokenizerOutput.lines, + sourceFile!.getFileContent()! + ); + } + + function _tryGetTextAfterUnusedImportsRemoved( + cloned: Program, + filePath: string, + importData: ImportData, + attempt: number, + token: CancellationToken + ): string | undefined { + throwIfCancellationRequested(token); + + cloned.analyzeFile(filePath, token); + + const sourceFile = cloned.getBoundSourceFile(filePath); + const parseResults = sourceFile?.getParseResults(); + if (!parseResults) { + return undefined; + } + + const tracker = new TextEditTracker(); + for (const diagnostic of cloned + .getDiagnosticsForRange( + filePath, + convertTextRangeToRange(parseResults.parseTree, parseResults.tokenizerOutput.lines) + ) + .filter( + (d) => + d.category === DiagnosticCategory.UnusedCode && + d.getActions()?.some((a) => a.action === Commands.unusedImport) + )) { + const nameNode = findNodeByPosition( + parseResults.parseTree, + diagnostic.range.start, + parseResults.tokenizerOutput.lines + ); + + if (nameNode?.nodeType !== ParseNodeType.Name) { + continue; + } + + // decl is synthesized. there is no node associated with the decl. + // ex) import a or import a.b + const dottedName1 = + nameNode.parent?.nodeType === ParseNodeType.ModuleName ? nameNode.parent.nameParts : [nameNode]; + + for (const [decl, names] of importData.declarations) { + if (decl.node) { + if (TextRange.containsRange(decl.node, nameNode)) { + tracker.removeNodes({ node: nameNode, parseResults: parseResults }); + break; + } + } + + const dottedName2 = getDottedName(getDottedNameWithGivenNodeAsLastName(names[0])); + if (dottedName2 && arrayEquals(dottedName1, dottedName2, (e1, e2) => e1.value === e2.value)) { + tracker.removeNodes({ node: nameNode, parseResults: parseResults }); + break; + } + } + } + + const oldText = sourceFile!.getFileContent()!; + const newText = applyTextEditsToString( + tracker.getEdits(token).filter((v) => v.filePath === filePath), + parseResults.tokenizerOutput.lines, + oldText + ); + + // We will attempt to remove unused imports multiple times since removing 1 unused import + // could make another import unused. This is due to how we calculate which import is not used. + // ex) import os, os.path, os.path.xxx + // `os.path` and `os.path.xxx` will be marked as used due to `import os`. + // once `os` is removed `os.path` will be marked as unused and so on. + // We will attempt to remove those chained unused imports up to 10 chain. + if (attempt > 10 || oldText === newText) { + return newText; + } + + _updateFileContent(cloned, filePath, newText); + return _tryGetTextAfterUnusedImportsRemoved(cloned, filePath, importData, attempt + 1, token); + } }); + + function _updateFileContent(cloned: Program, filePath: string, text: string) { + const info = cloned.getSourceFileInfo(filePath); + const version = info ? (info.sourceFile.getClientVersion() ?? 0) + 1 : 0; + const chainedFilePath = info ? info.chainedSourceFile?.sourceFile.getFilePath() : undefined; + const ipythonMode = info ? info.sourceFile.getIPythonMode() : IPythonMode.None; + const isTracked = info ? info.isTracked : true; + const realFilePath = info ? info.sourceFile.getRealFilePath() : filePath; + + cloned.setFileOpened(filePath, version, [{ text }], { + chainedFilePath, + ipythonMode, + isTracked, + realFilePath, + }); + } + + function _getNumberOfBlankLinesToInsert(parseResults: ParseResults, position: Position) { + // This basically try to add 2 blanks lines before previous line with text. + if (position.line === 0 && position.character === 0) { + return 0; + } + + const linesToAdd = + position.line > 0 && isBlankLine(parseResults, position.line - 1) + ? position.line > 1 && isBlankLine(parseResults, position.line - 2) + ? 0 + : 1 + : 2; + + // Add one more line for the line that position is on if it is not blank. + return position.character !== 0 ? linesToAdd + 1 : linesToAdd; + } + } + + clone() { + const program = new Program( + this._importResolver, + this._configOptions, + this._console, + new LogTracker(this._console, 'Cloned') + ); + + // Cloned program will use whatever user files the program currently has. + const userFiles = this.getUserFiles(); + program.setTrackedFiles(userFiles.map((i) => i.sourceFile.getFilePath())); + program.markAllFilesDirty(true); + + // Make sure we keep editor content (open file) which could be different than one in the file system. + for (const fileInfo of this.getOpened()) { + const version = fileInfo.sourceFile.getClientVersion(); + if (version === undefined) { + continue; + } + + program.setFileOpened( + fileInfo.sourceFile.getFilePath(), + version, + [{ text: fileInfo.sourceFile.getOpenFileContents()! }], + { + chainedFilePath: fileInfo.chainedSourceFile?.sourceFile.getFilePath(), + ipythonMode: fileInfo.sourceFile.getIPythonMode(), + isTracked: fileInfo.isTracked, + realFilePath: fileInfo.sourceFile.getRealFilePath(), + } + ); + } + + return program; } canRenameSymbolAtPosition( @@ -1893,7 +2466,7 @@ export class Program { token: CancellationToken ): { range: Range; declarations: Declaration[] } | undefined { return this._runEvaluatorWithCancellationToken(token, () => { - const sourceFileInfo = this._getSourceFileInfoFromPath(filePath); + const sourceFileInfo = this.getSourceFileInfo(filePath); if (!sourceFileInfo) { return undefined; } @@ -1940,7 +2513,7 @@ export class Program { token: CancellationToken ): FileEditActions | undefined { return this._runEvaluatorWithCancellationToken(token, () => { - const sourceFileInfo = this._getSourceFileInfoFromPath(filePath); + const sourceFileInfo = this.getSourceFileInfo(filePath); if (!sourceFileInfo) { return undefined; } @@ -2017,7 +2590,7 @@ export class Program { if (isUserCode(curSourceFileInfo)) { // Make sure searching symbol name exists in the file. const content = curSourceFileInfo.sourceFile.getFileContent() ?? ''; - if (content.indexOf(referencesResult.symbolName) < 0) { + if (!referencesResult.symbolNames.some((s) => content.search(s) >= 0)) { continue; } @@ -2055,7 +2628,7 @@ export class Program { } getCallForPosition(filePath: string, position: Position, token: CancellationToken): CallHierarchyItem | undefined { - const sourceFileInfo = this._getSourceFileInfoFromPath(filePath); + const sourceFileInfo = this.getSourceFileInfo(filePath); if (!sourceFileInfo) { return undefined; } @@ -2063,10 +2636,11 @@ export class Program { const execEnv = this._configOptions.findExecEnvironment(filePath); const referencesResult = sourceFileInfo.sourceFile.getDeclarationForPosition( - this._createSourceMapper(execEnv), + this._createSourceMapper(execEnv, token, sourceFileInfo), position, this._evaluator!, undefined, + DocumentSymbolCollectorUseCase.Reference, token ); @@ -2074,16 +2648,17 @@ export class Program { return undefined; } - const targetDecl = CallHierarchyProvider.getTargetDeclaration( - referencesResult.declarations, - referencesResult.nodeAtOffset + const { targetDecl, callItemUri, symbolName } = CallHierarchyProvider.getTargetDeclaration( + referencesResult, + filePath ); return CallHierarchyProvider.getCallForDeclaration( - referencesResult.symbolName, + symbolName, targetDecl, this._evaluator!, - token + token, + callItemUri ); } @@ -2092,7 +2667,7 @@ export class Program { position: Position, token: CancellationToken ): CallHierarchyIncomingCall[] | undefined { - const sourceFileInfo = this._getSourceFileInfoFromPath(filePath); + const sourceFileInfo = this.getSourceFileInfo(filePath); if (!sourceFileInfo) { return undefined; } @@ -2100,10 +2675,11 @@ export class Program { const execEnv = this._configOptions.findExecEnvironment(filePath); const referencesResult = sourceFileInfo.sourceFile.getDeclarationForPosition( - this._createSourceMapper(execEnv), + this._createSourceMapper(execEnv, token, sourceFileInfo), position, this._evaluator!, undefined, + DocumentSymbolCollectorUseCase.Reference, token ); @@ -2111,19 +2687,17 @@ export class Program { return undefined; } - const targetDecl = CallHierarchyProvider.getTargetDeclaration( - referencesResult.declarations, - referencesResult.nodeAtOffset - ); + const { targetDecl, symbolName } = CallHierarchyProvider.getTargetDeclaration(referencesResult, filePath); let items: CallHierarchyIncomingCall[] = []; - for (const curSourceFileInfo of this._sourceFileList) { + const sourceFiles = targetDecl.type === DeclarationType.Alias ? [sourceFileInfo] : this._sourceFileList; + for (const curSourceFileInfo of sourceFiles) { if (isUserCode(curSourceFileInfo) || curSourceFileInfo.isOpenByClient) { this._bindFile(curSourceFileInfo); const itemsToAdd = CallHierarchyProvider.getIncomingCallsForDeclaration( curSourceFileInfo.sourceFile.getFilePath(), - referencesResult.symbolName, + symbolName, targetDecl, curSourceFileInfo.sourceFile.getParseResults()!, this._evaluator!, @@ -2148,7 +2722,7 @@ export class Program { position: Position, token: CancellationToken ): CallHierarchyOutgoingCall[] | undefined { - const sourceFileInfo = this._getSourceFileInfoFromPath(filePath); + const sourceFileInfo = this.getSourceFileInfo(filePath); if (!sourceFileInfo) { return undefined; } @@ -2156,20 +2730,18 @@ export class Program { const execEnv = this._configOptions.findExecEnvironment(filePath); const referencesResult = sourceFileInfo.sourceFile.getDeclarationForPosition( - this._createSourceMapper(execEnv), + this._createSourceMapper(execEnv, token, sourceFileInfo), position, this._evaluator!, undefined, + DocumentSymbolCollectorUseCase.Reference, token ); if (!referencesResult || referencesResult.declarations.length === 0) { return undefined; } - const targetDecl = CallHierarchyProvider.getTargetDeclaration( - referencesResult.declarations, - referencesResult.nodeAtOffset - ); + const { targetDecl } = CallHierarchyProvider.getTargetDeclaration(referencesResult, filePath); return CallHierarchyProvider.getOutgoingCallsForDeclaration( targetDecl, @@ -2185,7 +2757,7 @@ export class Program { args: any[], token: CancellationToken ): TextEditAction[] | undefined { - const sourceFileInfo = this._getSourceFileInfoFromPath(filePath); + const sourceFileInfo = this.getSourceFileInfo(filePath); if (!sourceFileInfo) { return undefined; } @@ -2195,8 +2767,28 @@ export class Program { return sourceFileInfo.sourceFile.performQuickAction(command, args, token); } - test_createSourceMapper(execEnv: ExecutionEnvironment) { - return this._createSourceMapper(execEnv, /* mapCompiled */ false); + // Returns a value from 0 to 1 (or more) indicating how "full" the cache is + // relative to some predetermined high-water mark. We'll compute this value + // based on two easy-to-compute metrics: the number of entries in the type + // cache and the number of parsed files. + getCacheUsage() { + const typeCacheEntryCount = this._evaluator!.getTypeCacheEntryCount(); + const entryCountRatio = typeCacheEntryCount / 750000; + const fileCountRatio = this._parsedFileCount / 1000; + + return Math.max(entryCountRatio, fileCountRatio); + } + + // Discards any cached information associated with this program. + emptyCache() { + this._createNewEvaluator(); + this._discardCachedParseResults(); + this._parsedFileCount = 0; + Extensions.getProgramExtensions(this.rootPath).forEach((e) => (e.clearCache ? e.clearCache() : null)); + } + + test_createSourceMapper(execEnv: ExecutionEnvironment, from?: SourceFileInfo) { + return this._createSourceMapper(execEnv, CancellationToken.None, /*from*/ from, /* mapCompiled */ false); } private _getRenameSymbolMode( @@ -2218,12 +2810,12 @@ export class Program { (userFile && !referencesResult.requiresGlobalSearch) || (!userFile && sourceFileInfo.isOpenByClient && - referencesResult.declarations.every((d) => this._getSourceFileInfoFromPath(d.path) === sourceFileInfo)) + referencesResult.declarations.every((d) => this.getSourceFileInfo(d.path) === sourceFileInfo)) ) { return 'singleFileMode'; } - if (referencesResult.declarations.every((d) => isUserCode(this._getSourceFileInfoFromPath(d.path)))) { + if (referencesResult.declarations.every((d) => isUserCode(this.getSourceFileInfo(d.path)))) { return 'multiFileMode'; } @@ -2234,7 +2826,7 @@ export class Program { private _supportRenameModule(declarations: Declaration[], isDefaultWorkspace: boolean) { // Rename module is not supported for standalone file and all decls must be on a user file. - return !isDefaultWorkspace && declarations.every((d) => isUserCode(this._getSourceFileInfoFromPath(d.path))); + return !isDefaultWorkspace && declarations.every((d) => isUserCode(this.getSourceFileInfo(d.path))); } private _getReferenceResult( @@ -2245,11 +2837,11 @@ export class Program { token: CancellationToken ) { const execEnv = this._configOptions.findExecEnvironment(filePath); - const referencesResult = sourceFileInfo.sourceFile.getDeclarationForPosition( - this._createSourceMapper(execEnv), + const referencesResult = this._getDeclarationForPosition( + sourceFileInfo, position, - this._evaluator!, - undefined, + DocumentSymbolCollectorUseCase.Rename, + this._createSourceMapper(execEnv, token), token ); @@ -2270,8 +2862,28 @@ export class Program { return new ReferencesResult( referencesResult.requiresGlobalSearch, referencesResult.nodeAtOffset, - referencesResult.symbolName, - referencesResult.nonImportDeclarations + referencesResult.symbolNames, + referencesResult.nonImportDeclarations, + referencesResult.useCase + ); + } + + private _getDeclarationForPosition( + sourceFileInfo: SourceFileInfo, + position: Position, + useCase: DocumentSymbolCollectorUseCase, + sourceMapper: SourceMapper, + token: CancellationToken, + reporter?: ReferenceCallback + ) { + return sourceFileInfo.sourceFile.getDeclarationForPosition( + sourceMapper, + position, + this._evaluator!, + reporter, + useCase, + token, + Array.from(collectImportedByFiles(sourceFileInfo)).map((fileInfo) => fileInfo.sourceFile) ); } @@ -2304,7 +2916,7 @@ export class Program { continue; } - renameModuleProvider.renameReferences(filePath, parseResult); + renameModuleProvider.renameReferences(parseResult); // This operation can consume significant memory, so check // for situations where we need to discard the type cache. @@ -2322,42 +2934,24 @@ export class Program { const convertToMB = (bytes: number) => { return `${Math.round(bytes / (1024 * 1024))}MB`; }; + const cacheUsage = this._cacheManager.getCacheUsage(); - // If the type cache size has exceeded a high-water mark, query the heap usage. - // Don't bother doing this until we hit this point because the heap usage may not - // drop immediately after we empty the cache due to garbage collection timing. - if (typeCacheEntryCount > 750000 || this._parsedFileCount > 1000) { - const heapStats = getHeapStatistics(); - - if (this._configOptions.verboseOutput) { - this._console.info( - `Heap stats: ` + - `total_heap_size=${convertToMB(heapStats.total_heap_size)}, ` + - `used_heap_size=${convertToMB(heapStats.used_heap_size)}, ` + - `total_physical_size=${convertToMB(heapStats.total_physical_size)}, ` + - `total_available_size=${convertToMB(heapStats.total_available_size)}, ` + - `heap_size_limit=${convertToMB(heapStats.heap_size_limit)}` - ); - } + // If the total cache has exceeded 75%, determine whether we should empty + // the cache. + if (cacheUsage > 0.75) { + const usedHeapRatio = this._cacheManager.getUsedHeapRatio( + this._configOptions.verboseOutput ? this._console : undefined + ); // The type cache uses a Map, which has an absolute limit of 2^24 entries // before it will fail. If we cross the 95% mark, we'll empty the cache. const absoluteMaxCacheEntryCount = (1 << 24) * 0.9; + const typeCacheEntryCount = this._evaluator!.getTypeCacheEntryCount(); // If we use more than 90% of the heap size limit, avoid a crash // by emptying the type cache. - if ( - typeCacheEntryCount > absoluteMaxCacheEntryCount || - heapStats.used_heap_size > heapStats.heap_size_limit * 0.9 - ) { - this._console.info( - `Emptying type cache to avoid heap overflow. Used ${convertToMB( - heapStats.used_heap_size - )} out of ${convertToMB(heapStats.heap_size_limit)} (${typeCacheEntryCount} cache entries).` - ); - this._createNewEvaluator(); - this._discardCachedParseResults(); - this._parsedFileCount = 0; + if (typeCacheEntryCount > absoluteMaxCacheEntryCount || usedHeapRatio > 0.9) { + this._cacheManager.emptyCache(this._console); } } } @@ -2384,7 +2978,7 @@ export class Program { // An unexpected exception occurred, potentially leaving the current evaluator // in an inconsistent state. Discard it and replace it with a fresh one. It is // Cancellation exceptions are known to handle this correctly. - if (!(e instanceof OperationCanceledException)) { + if (!OperationCanceledException.is(e)) { this._createNewEvaluator(); } throw e; @@ -2485,10 +3079,10 @@ export class Program { // by a tracked file but then abandoned. The import cycle // will keep the entire group "alive" if we don't detect // the condition and garbage collect them. - return this._isImportNeededRecursive(fileInfo, new Map()); + return this._isImportNeededRecursive(fileInfo, new Set()); } - private _isImportNeededRecursive(fileInfo: SourceFileInfo, recursionMap: Map) { + private _isImportNeededRecursive(fileInfo: SourceFileInfo, recursionSet: Set) { if (fileInfo.isTracked || fileInfo.isOpenByClient || fileInfo.shadows.length > 0) { return true; } @@ -2496,14 +3090,14 @@ export class Program { const filePath = normalizePathCase(this._fs, fileInfo.sourceFile.getFilePath()); // Avoid infinite recursion. - if (recursionMap.has(filePath)) { + if (recursionSet.has(filePath)) { return false; } - recursionMap.set(filePath, true); + recursionSet.add(filePath); for (const importerInfo of fileInfo.importedBy) { - if (this._isImportNeededRecursive(importerInfo, recursionMap)) { + if (this._isImportNeededRecursive(importerInfo, recursionSet)) { return true; } } @@ -2511,22 +3105,46 @@ export class Program { return false; } - public _createSourceMapper(execEnv: ExecutionEnvironment, mapCompiled?: boolean, preferStubs?: boolean) { + public _createSourceMapper( + execEnv: ExecutionEnvironment, + token: CancellationToken, + from?: SourceFileInfo, + mapCompiled?: boolean, + preferStubs?: boolean + ) { const sourceMapper = new SourceMapper( this._importResolver, execEnv, this._evaluator!, (stubFilePath: string, implFilePath: string) => { - const stubFileInfo = this._getSourceFileInfoFromPath(stubFilePath); + let stubFileInfo = this.getSourceFileInfo(stubFilePath); if (!stubFileInfo) { - return undefined; + // Special case for import statement like "import X.Y". The SourceFile + // for X might not be in memory since import `X.Y` only brings in Y. + stubFileInfo = this.addInterimFile(stubFilePath); } + this._addShadowedFile(stubFileInfo, implFilePath); return this.getBoundSourceFile(implFilePath); }, - (f) => this.getBoundSourceFile(f), + (f) => { + let fileInfo = this.getBoundSourceFileInfo(f); + if (!fileInfo) { + // Special case for import statement like "import X.Y". The SourceFile + // for X might not be in memory since import `X.Y` only brings in Y. + fileInfo = this.addInterimFile(f); + + // Even though this file is not referenced by anything, make sure + // we have a parse tree for the doc string. + this._parseFile(fileInfo, /* content */ undefined, /* force */ true); + } + + return fileInfo; + }, mapCompiled ?? false, - preferStubs ?? false + preferStubs ?? false, + from, + token ); return sourceMapper; } @@ -2570,6 +3188,20 @@ export class Program { ) { thirdPartyImportAllowed = true; } + } else if (importer.isThirdPartyImport && this._configOptions.useLibraryCodeForTypes) { + // If the importing file is a third-party import, allow importing of + // additional third-party imports. This supports the case where the importer + // is in a py.typed library but is importing from another non-py.typed + // library. It also supports the case where someone explicitly opens a + // library source file in their editor. + thirdPartyImportAllowed = true; + } else if ( + importResult.isNamespacePackage && + importResult.filteredImplicitImports.some((implicitImport) => !!implicitImport.pyTypedInfo) + ) { + // Handle the case where the import targets a namespace package, and a + // submodule contained within it has a py.typed marker. + thirdPartyImportAllowed = true; } // Some libraries ship with stub files that import from non-stubs. Don't @@ -2724,10 +3356,8 @@ export class Program { if (!updatedImportMap.has(normalizedImportPath)) { // We found a new import to add. See if it's already part // of the program. - let importedFileInfo: SourceFileInfo; - if (this._getSourceFileInfoFromPath(importInfo.path)) { - importedFileInfo = this._getSourceFileInfoFromPath(importInfo.path)!; - } else { + let importedFileInfo = this.getSourceFileInfo(importInfo.path); + if (!importedFileInfo) { const importName = this._getImportNameForFile(importInfo.path); const sourceFile = new SourceFile( this._fs, @@ -2765,8 +3395,8 @@ export class Program { // specified by the source file. sourceFileInfo.imports = []; newImportPathMap.forEach((_, path) => { - if (this._getSourceFileInfoFromPath(path)) { - sourceFileInfo.imports.push(this._getSourceFileInfoFromPath(path)!); + if (this.getSourceFileInfo(path)) { + sourceFileInfo.imports.push(this.getSourceFileInfo(path)!); } }); @@ -2776,7 +3406,7 @@ export class Program { const builtinsImport = sourceFileInfo.sourceFile.getBuiltinsImport(); if (builtinsImport && builtinsImport.isImportFound) { const resolvedBuiltinsPath = builtinsImport.resolvedPaths[builtinsImport.resolvedPaths.length - 1]; - sourceFileInfo.builtinsImport = this._getSourceFileInfoFromPath(resolvedBuiltinsPath); + sourceFileInfo.builtinsImport = this.getSourceFileInfo(resolvedBuiltinsPath); } // Resolve the ipython display import for the file. This needs to be @@ -2786,16 +3416,12 @@ export class Program { if (ipythonDisplayImport && ipythonDisplayImport.isImportFound) { const resolvedIPythonDisplayPath = ipythonDisplayImport.resolvedPaths[ipythonDisplayImport.resolvedPaths.length - 1]; - sourceFileInfo.ipythonDisplayImport = this._getSourceFileInfoFromPath(resolvedIPythonDisplayPath); + sourceFileInfo.ipythonDisplayImport = this.getSourceFileInfo(resolvedIPythonDisplayPath); } return filesAdded; } - private _getSourceFileInfoFromPath(filePath: string): SourceFileInfo | undefined { - return this._sourceFileMap.get(normalizePathCase(this._fs, filePath)); - } - private _removeSourceFileFromListAndMap(filePath: string, indexToRemove: number) { this._sourceFileMap.delete(normalizePathCase(this._fs, filePath)); this._sourceFileList.splice(indexToRemove, 1); diff --git a/packages/pyright-internal/src/analyzer/properties.ts b/packages/pyright-internal/src/analyzer/properties.ts index c1424f471..146ab05b3 100644 --- a/packages/pyright-internal/src/analyzer/properties.ts +++ b/packages/pyright-internal/src/analyzer/properties.ts @@ -97,7 +97,7 @@ export function createProperty( propertyClass.isAsymmetricDescriptor = false; // Update the __set__ and __delete__ methods if present. - updateGetSetDelMethodForClonedProperty(propertyObject, evaluator); + updateGetSetDelMethodForClonedProperty(evaluator, propertyObject); // Fill in the fget method. const fgetSymbol = Symbol.createWithType( @@ -111,7 +111,7 @@ export function createProperty( } // Fill in the __get__ method with an overload. - addGetMethodToPropertySymbolTable(propertyObject, fget); + addGetMethodToPropertySymbolTable(evaluator, propertyObject, fget); // Fill in the getter, setter and deleter methods. addDecoratorMethodsToPropertySymbolTable(propertyObject); @@ -145,7 +145,6 @@ export function clonePropertyWithSetter( if (fgetType && !isAnyOrUnknown(fgetType)) { const fsetType = evaluator.getTypeOfAnnotation(typeAnnotation, { associateTypeVarsWithScope: true, - disallowRecursiveTypeAlias: true, }); // The setter type should be assignable to the getter type. @@ -195,7 +194,7 @@ export function clonePropertyWithSetter( }); // Update the __get__ and __delete__ methods if present. - updateGetSetDelMethodForClonedProperty(propertyObject, evaluator); + updateGetSetDelMethodForClonedProperty(evaluator, propertyObject); // Fill in the fset method. const fsetSymbol = Symbol.createWithType( @@ -205,7 +204,7 @@ export function clonePropertyWithSetter( fields.set('fset', fsetSymbol); // Fill in the __set__ method. - addSetMethodToPropertySymbolTable(propertyObject, fset, evaluator); + addSetMethodToPropertySymbolTable(evaluator, propertyObject, fset); // Fill in the getter, setter and deleter methods. addDecoratorMethodsToPropertySymbolTable(propertyObject); @@ -251,7 +250,7 @@ export function clonePropertyWithDeleter( }); // Update the __get__ and __set__ methods if present. - updateGetSetDelMethodForClonedProperty(propertyObject, evaluator); + updateGetSetDelMethodForClonedProperty(evaluator, propertyObject); // Fill in the fdel method. const fdelSymbol = Symbol.createWithType( @@ -261,7 +260,7 @@ export function clonePropertyWithDeleter( fields.set('fdel', fdelSymbol); // Fill in the __delete__ method. - addDelMethodToPropertySymbolTable(propertyObject, fdel, evaluator); + addDelMethodToPropertySymbolTable(evaluator, propertyObject, fdel); // Fill in the getter, setter and deleter methods. addDecoratorMethodsToPropertySymbolTable(propertyObject); @@ -269,7 +268,7 @@ export function clonePropertyWithDeleter( return propertyObject; } -function addGetMethodToPropertySymbolTable(propertyObject: ClassType, fget: FunctionType) { +function addGetMethodToPropertySymbolTable(evaluator: TypeEvaluator, propertyObject: ClassType, fget: FunctionType) { const fields = propertyObject.details.fields; const getFunction1 = FunctionType.createSynthesizedInstance('__get__', FunctionTypeFlags.Overloaded); @@ -298,6 +297,10 @@ function addGetMethodToPropertySymbolTable(propertyObject: ClassType, fget: Func : propertyObject; getFunction1.details.declaration = fget.details.declaration; + // Override the scope ID since we're using parameter types from the + // decorated function. + getFunction1.details.typeVarScopeId = getTypeVarScopeId(fget); + const getFunction2 = FunctionType.createSynthesizedInstance('__get__', FunctionTypeFlags.Overloaded); FunctionType.addParameter(getFunction2, { category: ParameterCategory.Simple, @@ -307,12 +310,14 @@ function addGetMethodToPropertySymbolTable(propertyObject: ClassType, fget: Func }); const objType = fget.details.parameters.length > 0 ? fget.details.parameters[0].type : AnyType.create(); + FunctionType.addParameter(getFunction2, { category: ParameterCategory.Simple, name: 'obj', type: objType, hasDeclaredType: true, }); + FunctionType.addParameter(getFunction2, { category: ParameterCategory.Simple, name: 'objtype', @@ -328,12 +333,16 @@ function addGetMethodToPropertySymbolTable(propertyObject: ClassType, fget: Func // decorated function. getFunction2.details.typeVarScopeId = getTypeVarScopeId(fget); - const getFunctionOverload = OverloadedFunctionType.create([getFunction1, getFunction2]); + // We previously placed getFunction1 before getFunction2, but this creates + // problems specifically for the `NoneType` class because None.__class__ + // is a property, and both overloads match in this case because None + // is passed for the "obj" parameter. + const getFunctionOverload = OverloadedFunctionType.create([getFunction2, getFunction1]); const getSymbol = Symbol.createWithType(SymbolFlags.ClassMember, getFunctionOverload); fields.set('__get__', getSymbol); } -function addSetMethodToPropertySymbolTable(propertyObject: ClassType, fset: FunctionType, evaluator: TypeEvaluator) { +function addSetMethodToPropertySymbolTable(evaluator: TypeEvaluator, propertyObject: ClassType, fset: FunctionType) { const fields = propertyObject.details.fields; const setFunction = FunctionType.createSynthesizedInstance('__set__'); @@ -343,18 +352,27 @@ function addSetMethodToPropertySymbolTable(propertyObject: ClassType, fset: Func type: AnyType.create(), hasDeclaredType: true, }); + let objType = fset.details.parameters.length > 0 ? fset.details.parameters[0].type : AnyType.create(); if (isTypeVar(objType) && objType.details.isSynthesizedSelf) { objType = evaluator.makeTopLevelTypeVarsConcrete(objType); } + FunctionType.addParameter(setFunction, { category: ParameterCategory.Simple, name: 'obj', type: combineTypes([objType, NoneType.createInstance()]), hasDeclaredType: true, }); + setFunction.details.declaredReturnType = NoneType.createInstance(); + + // Adopt the TypeVarScopeId of the fset function in case it has any + // TypeVars that need to be solved. + setFunction.details.typeVarScopeId = getTypeVarScopeId(fset); + let setParamType: Type = UnknownType.create(); + if ( fset.details.parameters.length >= 2 && fset.details.parameters[1].category === ParameterCategory.Simple && @@ -372,7 +390,7 @@ function addSetMethodToPropertySymbolTable(propertyObject: ClassType, fset: Func fields.set('__set__', setSymbol); } -function addDelMethodToPropertySymbolTable(propertyObject: ClassType, fdel: FunctionType, evaluator: TypeEvaluator) { +function addDelMethodToPropertySymbolTable(evaluator: TypeEvaluator, propertyObject: ClassType, fdel: FunctionType) { const fields = propertyObject.details.fields; const delFunction = FunctionType.createSynthesizedInstance('__delete__'); @@ -382,10 +400,17 @@ function addDelMethodToPropertySymbolTable(propertyObject: ClassType, fdel: Func type: AnyType.create(), hasDeclaredType: true, }); + + // Adopt the TypeVarScopeId of the fdel function in case it has any + // TypeVars that need to be solved. + delFunction.details.typeVarScopeId = getTypeVarScopeId(fdel); + let objType = fdel.details.parameters.length > 0 ? fdel.details.parameters[0].type : AnyType.create(); + if (isTypeVar(objType) && objType.details.isSynthesizedSelf) { objType = evaluator.makeTopLevelTypeVarsConcrete(objType); } + FunctionType.addParameter(delFunction, { category: ParameterCategory.Simple, name: 'obj', @@ -397,25 +422,25 @@ function addDelMethodToPropertySymbolTable(propertyObject: ClassType, fdel: Func fields.set('__delete__', delSymbol); } -function updateGetSetDelMethodForClonedProperty(propertyObject: ClassType, evaluator: TypeEvaluator) { +function updateGetSetDelMethodForClonedProperty(evaluator: TypeEvaluator, propertyObject: ClassType) { const fields = propertyObject.details.fields; const fgetSymbol = fields.get('fget'); const fgetType = fgetSymbol?.getSynthesizedType(); if (fgetType && isFunction(fgetType)) { - addGetMethodToPropertySymbolTable(propertyObject, fgetType); + addGetMethodToPropertySymbolTable(evaluator, propertyObject, fgetType); } const fsetSymbol = fields.get('fset'); const fsetType = fsetSymbol?.getSynthesizedType(); if (fsetType && isFunction(fsetType)) { - addSetMethodToPropertySymbolTable(propertyObject, fsetType, evaluator); + addSetMethodToPropertySymbolTable(evaluator, propertyObject, fsetType); } const fdelSymbol = fields.get('fdel'); const fdelType = fdelSymbol?.getSynthesizedType(); if (fdelType && isFunction(fdelType)) { - addDelMethodToPropertySymbolTable(propertyObject, fdelType, evaluator); + addDelMethodToPropertySymbolTable(evaluator, propertyObject, fdelType); } } @@ -454,7 +479,8 @@ export function assignProperty( selfTypeVarContext?: TypeVarContext, recursionCount = 0 ): boolean { - const objectToBind = ClassType.cloneAsInstance(srcClass); + const srcObjectToBind = ClassType.cloneAsInstance(srcClass); + const destObjectToBind = ClassType.cloneAsInstance(destClass); let isAssignable = true; const accessors: { name: string; missingDiagMsg: () => string; incompatibleDiagMsg: () => string }[] = [ { @@ -476,11 +502,11 @@ export function assignProperty( accessors.forEach((accessorInfo) => { const destAccessSymbol = destPropertyType.details.fields.get(accessorInfo.name); - let destAccessType = destAccessSymbol ? evaluator.getDeclaredTypeOfSymbol(destAccessSymbol) : undefined; + let destAccessType = destAccessSymbol ? evaluator.getDeclaredTypeOfSymbol(destAccessSymbol)?.type : undefined; if (destAccessType && isFunction(destAccessType)) { const srcAccessSymbol = srcPropertyType.details.fields.get(accessorInfo.name); - let srcAccessType = srcAccessSymbol ? evaluator.getDeclaredTypeOfSymbol(srcAccessSymbol) : undefined; + let srcAccessType = srcAccessSymbol ? evaluator.getDeclaredTypeOfSymbol(srcAccessSymbol)?.type : undefined; if (!srcAccessType || !isFunction(srcAccessType)) { diag?.addMessage(accessorInfo.missingDiagMsg()); @@ -500,15 +526,29 @@ export function assignProperty( destAccessType = applySolvedTypeVars(destAccessType, selfTypeVarContext) as FunctionType; } + // The access methods of fget, fset and fdel are modeled as static + // variables because they do not bind go the "property" class that + // contains them, but we'll turn it back into a non-static method + // here and bind them to the associated objects. + destAccessType = FunctionType.cloneWithNewFlags( + destAccessType, + destAccessType.details.flags & ~FunctionTypeFlags.StaticMethod + ); + + srcAccessType = FunctionType.cloneWithNewFlags( + srcAccessType, + srcAccessType.details.flags & ~FunctionTypeFlags.StaticMethod + ); + const boundDestAccessType = evaluator.bindFunctionToClassOrObject( - objectToBind, + destObjectToBind, destAccessType, /* memberClass */ undefined, /* errorNode */ undefined, recursionCount ); const boundSrcAccessType = evaluator.bindFunctionToClassOrObject( - objectToBind, + srcObjectToBind, srcAccessType, /* memberClass */ undefined, /* errorNode */ undefined, diff --git a/packages/pyright-internal/src/analyzer/protocols.ts b/packages/pyright-internal/src/analyzer/protocols.ts index 0ab9ee63c..96764f492 100644 --- a/packages/pyright-internal/src/analyzer/protocols.ts +++ b/packages/pyright-internal/src/analyzer/protocols.ts @@ -73,7 +73,7 @@ export function assignClassToProtocol( return isTypeSame(entry.srcType, srcType) && isTypeSame(entry.destType, destType); }) ) { - return true; + return !enforceInvariance; } // See if we've already determined that this class is compatible with this protocol. @@ -150,7 +150,8 @@ function assignClassToProtocolInternal( const genericDestTypeVarContext = new TypeVarContext(getTypeVarScopeId(destType)); const selfTypeVarContext = new TypeVarContext(getTypeVarScopeId(destType)); - populateTypeVarContextForSelfType(selfTypeVarContext, destType, srcType); + const noLiteralSrcType = evaluator.stripLiteralValue(srcType) as ClassType; + populateTypeVarContextForSelfType(selfTypeVarContext, destType, noLiteralSrcType); // If the source is a TypedDict, use the _TypedDict placeholder class // instead. We don't want to use the TypedDict members for protocol @@ -165,7 +166,9 @@ function assignClassToProtocolInternal( let typesAreConsistent = true; const checkedSymbolSet = new Set(); const srcClassTypeVarContext = buildTypeVarContextFromSpecializedClass(srcType); - const assignTypeFlags = containsLiteralType(srcType, /* includeTypeArgs */ true) + let assignTypeFlags = flags & AssignTypeFlags.OverloadOverlapCheck; + + assignTypeFlags |= containsLiteralType(srcType, /* includeTypeArgs */ true) ? AssignTypeFlags.RetainLiteralsForTypeVar : AssignTypeFlags.Default; @@ -228,7 +231,7 @@ function assignClassToProtocolInternal( diag?.addMessage(Localizer.DiagnosticAddendum.protocolMemberMissing().format({ name })); typesAreConsistent = false; } else { - let destMemberType = evaluator.getDeclaredTypeOfSymbol(symbol); + let destMemberType = evaluator.getDeclaredTypeOfSymbol(symbol)?.type; if (destMemberType) { // Partially specialize the type of the symbol based on the MRO class. // We can skip this if it's the dest class because it is already @@ -246,7 +249,11 @@ function assignClassToProtocolInternal( evaluator.inferReturnTypeIfNecessary(symbolType); } - srcMemberType = partiallySpecializeType(symbolType, srcMemberInfo.classType, srcType); + srcMemberType = partiallySpecializeType( + symbolType, + srcMemberInfo.classType, + noLiteralSrcType + ); } else { srcMemberType = UnknownType.create(); } @@ -254,7 +261,7 @@ function assignClassToProtocolInternal( if (isFunction(srcMemberType) || isOverloadedFunction(srcMemberType)) { if (isMemberFromMetaclass) { const boundSrcFunction = evaluator.bindFunctionToClassOrObject( - srcType, + ClassType.cloneAsInstance(srcType), srcMemberType, /* memberClass */ undefined, /* errorNode */ undefined, @@ -268,7 +275,7 @@ function assignClassToProtocolInternal( if (isFunction(destMemberType) || isOverloadedFunction(destMemberType)) { const boundDeclaredType = evaluator.bindFunctionToClassOrObject( - srcType, + ClassType.cloneAsInstance(srcType), destMemberType, /* memberClass */ undefined, /* errorNode */ undefined, @@ -423,7 +430,7 @@ function assignClassToProtocolInternal( } } - if (symbol.isClassVar() && !srcMemberInfo.symbol.isClassMember()) { + if (symbol.isClassVar() && !srcMemberInfo.symbol.isClassVar()) { diag?.addMessage(Localizer.DiagnosticAddendum.protocolMemberClassVar().format({ name })); typesAreConsistent = false; } @@ -433,23 +440,42 @@ function assignClassToProtocolInternal( }); // If the dest protocol has type parameters, make sure the source type arguments match. - if (typesAreConsistent && destType.details.typeParameters.length > 0 && destType.typeArguments) { + if (typesAreConsistent && destType.details.typeParameters.length > 0) { // Create a specialized version of the protocol defined by the dest and // make sure the resulting type args can be assigned. const specializedDestProtocol = applySolvedTypeVars(genericDestType, genericDestTypeVarContext) as ClassType; - if ( - !evaluator.verifyTypeArgumentsAssignable( - destType, - specializedDestProtocol, - diag, - destTypeVarContext, - srcTypeVarContext, - flags, - recursionCount - ) + if (destType.typeArguments) { + if ( + !evaluator.verifyTypeArgumentsAssignable( + destType, + specializedDestProtocol, + diag, + destTypeVarContext, + srcTypeVarContext, + flags, + recursionCount + ) + ) { + typesAreConsistent = false; + } + } else if ( + destTypeVarContext && + destType.details.typeParameters.length > 0 && + specializedDestProtocol.typeArguments && + !destTypeVarContext.isLocked() ) { - typesAreConsistent = false; + // Populate the typeVar map with type arguments of the source. + const srcTypeArgs = specializedDestProtocol.typeArguments; + for (let i = 0; i < destType.details.typeParameters.length; i++) { + const typeArgType = i < srcTypeArgs.length ? srcTypeArgs[i] : UnknownType.create(); + destTypeVarContext.setTypeVarType( + destType.details.typeParameters[i], + /* narrowBound */ undefined, + /* narrowBoundNoLiterals */ undefined, + typeArgType + ); + } } } @@ -494,7 +520,7 @@ export function assignModuleToProtocol( diag?.addMessage(Localizer.DiagnosticAddendum.protocolMemberMissing().format({ name })); typesAreConsistent = false; } else { - let destMemberType = evaluator.getDeclaredTypeOfSymbol(symbol); + let destMemberType = evaluator.getDeclaredTypeOfSymbol(symbol)?.type; if (destMemberType) { destMemberType = partiallySpecializeType(destMemberType, destType); diff --git a/packages/pyright-internal/src/analyzer/pythonPathUtils.ts b/packages/pyright-internal/src/analyzer/pythonPathUtils.ts index b5ca0de47..642052278 100644 --- a/packages/pyright-internal/src/analyzer/pythonPathUtils.ts +++ b/packages/pyright-internal/src/analyzer/pythonPathUtils.ts @@ -4,7 +4,7 @@ * Licensed under the MIT license. * Author: Eric Traut * - * Utility routines used to resolve various paths in python. + * Utility routines used to resolve various paths in Python. */ import { ConfigOptions } from '../common/configOptions'; @@ -22,6 +22,8 @@ import { normalizePath, tryStat, } from '../common/pathUtils'; +import { versionToString } from '../common/pythonVersion'; +import { PythonVersion } from '../common/pythonVersion'; export interface PythonPathResult { paths: string[]; @@ -76,7 +78,12 @@ export function findPythonSearchPaths( const sitePackagesPaths: string[] = []; [pathConsts.lib, pathConsts.lib64, pathConsts.libAlternate].forEach((libPath) => { - const sitePackagesPath = findSitePackagesPath(fs, combinePaths(venvPath, libPath), importFailureInfo); + const sitePackagesPath = findSitePackagesPath( + fs, + combinePaths(venvPath, libPath), + configOptions.defaultPythonVersion, + importFailureInfo + ); if (sitePackagesPath) { addPathIfUnique(foundPaths, sitePackagesPath); sitePackagesPaths.push(sitePackagesPath); @@ -124,7 +131,12 @@ export function isPythonBinary(p: string): boolean { return p === 'python' || p === 'python3'; } -function findSitePackagesPath(fs: FileSystem, libPath: string, importFailureInfo: string[]): string | undefined { +function findSitePackagesPath( + fs: FileSystem, + libPath: string, + pythonVersion: PythonVersion | undefined, + importFailureInfo: string[] +): string | undefined { if (fs.existsSync(libPath)) { importFailureInfo.push(`Found path '${libPath}'; looking for ${pathConsts.sitePackages}`); } else { @@ -141,21 +153,38 @@ function findSitePackagesPath(fs: FileSystem, libPath: string, importFailureInfo } // We didn't find a site-packages directory directly in the lib - // directory. Scan for a "python*" directory instead. + // directory. Scan for a "python3.X" directory instead. const entries = getFileSystemEntries(fs, libPath); - for (let i = 0; i < entries.directories.length; i++) { - const dirName = entries.directories[i]; - if (dirName.startsWith('python')) { + + // Candidate directories start with "python3.". + const candidateDirs = entries.directories.filter((dirName) => { + if (dirName.startsWith('python3.')) { const dirPath = combinePaths(libPath, dirName, pathConsts.sitePackages); - if (fs.existsSync(dirPath)) { - importFailureInfo.push(`Found path '${dirPath}'`); - return dirPath; - } else { - importFailureInfo.push(`Path '${dirPath}' is not a valid directory`); - } + return fs.existsSync(dirPath); + } + return false; + }); + + // If there is a python3.X directory (where 3.X matches the configured python + // version), prefer that over other python directories. + if (pythonVersion) { + const preferredDir = candidateDirs.find((dirName) => dirName === `python${versionToString(pythonVersion)}`); + if (preferredDir) { + const dirPath = combinePaths(libPath, preferredDir, pathConsts.sitePackages); + importFailureInfo.push(`Found path '${dirPath}'`); + return dirPath; } } + // If there was no python version or we didn't find an exact match, use the + // first directory that starts with "python". Most of the time, there will be + // only one. + if (candidateDirs.length > 0) { + const dirPath = combinePaths(libPath, candidateDirs[0], pathConsts.sitePackages); + importFailureInfo.push(`Found path '${dirPath}'`); + return dirPath; + } + return undefined; } diff --git a/packages/pyright-internal/src/analyzer/regions.ts b/packages/pyright-internal/src/analyzer/regions.ts new file mode 100644 index 000000000..e3676bbf2 --- /dev/null +++ b/packages/pyright-internal/src/analyzer/regions.ts @@ -0,0 +1,71 @@ +/* + * regions.ts + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT license. + * Author: Erik De Bonte + * + * Helper functions related to #region/#endregion comments. + */ + +import { convertOffsetToPosition } from '../common/positionUtils'; +import { ParseResults } from '../parser/parser'; +import { Comment } from '../parser/tokenizerTypes'; + +export const enum RegionCommentType { + Region, + EndRegion, +} + +export interface RegionComment { + readonly type: RegionCommentType; + readonly comment: Comment; +} + +export function getRegionComments(parseResults: ParseResults): RegionComment[] { + const comments = []; + + for (let i = 0; i < parseResults.tokenizerOutput.tokens.count; i++) { + const token = parseResults.tokenizerOutput.tokens.getItemAt(i); + if (token.comments) { + for (const comment of token.comments) { + const regionCommentType = getRegionCommentType(comment, parseResults); + if (regionCommentType !== undefined) { + comments.push({ type: regionCommentType, comment }); + } + } + } + } + + return comments; +} + +// A comment starting with "region" or "endregion" is only treated as a region/endregion +// if it is not followed by an identifier character. +const StartRegionRegEx = /^\s*region\b/; +const EndRegionRegEx = /^\s*endregion\b/; + +function getRegionCommentType(comment: Comment, parseResults: ParseResults): RegionCommentType | undefined { + const hashOffset = comment.start - 1; + const hashPosition = convertOffsetToPosition(hashOffset, parseResults.tokenizerOutput.lines); + + // If anything other than whitespace is found before the #region (ex. a statement) + // it's treated as a normal comment. + if (hashPosition.character !== 0) { + const lineStartOffset = hashOffset - hashPosition.character; + const textBeforeCommentOnLine = parseResults.text.slice(lineStartOffset, hashOffset); + if (textBeforeCommentOnLine.trimStart().length > 0) { + return undefined; + } + } + + const startRegionMatch = StartRegionRegEx.exec(comment.value); + const endRegionMatch = EndRegionRegEx.exec(comment.value); + + if (startRegionMatch) { + return RegionCommentType.Region; + } else if (endRegionMatch) { + return RegionCommentType.EndRegion; + } else { + return undefined; + } +} diff --git a/packages/pyright-internal/src/analyzer/scope.ts b/packages/pyright-internal/src/analyzer/scope.ts index 64c5dc0a8..8700a4ce1 100644 --- a/packages/pyright-internal/src/analyzer/scope.ts +++ b/packages/pyright-internal/src/analyzer/scope.ts @@ -156,9 +156,11 @@ export class Scope { if (this.notLocalBindings.get(name) === NameBindingType.Global) { const globalScopeResult = this.getGlobalScope(); - parentScope = globalScopeResult.scope; - if (globalScopeResult.isBeyondExecutionScope) { - isNextScopeBeyondExecutionScope = true; + if (globalScopeResult.scope !== this) { + parentScope = globalScopeResult.scope; + if (globalScopeResult.isBeyondExecutionScope) { + isNextScopeBeyondExecutionScope = true; + } } } else { parentScope = this.parent; diff --git a/packages/pyright-internal/src/analyzer/service.ts b/packages/pyright-internal/src/analyzer/service.ts index f67b23416..5c2c4a83f 100644 --- a/packages/pyright-internal/src/analyzer/service.ts +++ b/packages/pyright-internal/src/analyzer/service.ts @@ -4,7 +4,7 @@ * Licensed under the MIT license. * Author: Eric Traut * - * A persistent service that is able to analyze a collection of + * A service that is able to analyze a collection of * Python files. */ @@ -25,21 +25,23 @@ import { MarkupKind, } from 'vscode-languageserver-types'; -import { BackgroundAnalysisBase, IndexOptions } from '../backgroundAnalysisBase'; +import { BackgroundAnalysisBase, IndexOptions, RefreshOptions } from '../backgroundAnalysisBase'; import { CancellationProvider, DefaultCancellationProvider } from '../common/cancellationUtils'; import { CommandLineOptions } from '../common/commandLineOptions'; -import { ConfigOptions } from '../common/configOptions'; +import { ConfigOptions, matchFileSpecs } from '../common/configOptions'; import { ConsoleInterface, log, LogLevel, StandardConsole } from '../common/console'; import { Diagnostic } from '../common/diagnostic'; import { FileEditActions, TextEditAction } from '../common/editAction'; -import { LanguageServiceExtension } from '../common/extensibility'; +import { Extensions } from '../common/extensibility'; import { FileSystem, FileWatcher, FileWatcherEventType, ignoredWatchEventFunction } from '../common/fileSystem'; import { Host, HostFactory, NoAccessHost } from '../common/host'; +import { defaultStubsDirectory } from '../common/pathConsts'; import { combinePaths, FileSpec, forEachAncestorDirectory, getDirectoryPath, + getFileExtension, getFileName, getFileSpec, getFileSystemEntries, @@ -55,16 +57,22 @@ import { } from '../common/pathUtils'; import { DocumentRange, Position, Range } from '../common/textRange'; import { timingStats } from '../common/timing'; -import { AutoImportOptions } from '../languageService/autoImporter'; +import { AutoImportOptions, ImportFormat } from '../languageService/autoImporter'; import { AbbreviationMap, CompletionOptions, CompletionResultsList } from '../languageService/completionProvider'; import { DefinitionFilter } from '../languageService/definitionProvider'; -import { IndexResults, WorkspaceSymbolCallback } from '../languageService/documentSymbolProvider'; +import { WorkspaceSymbolCallback } from '../languageService/documentSymbolProvider'; import { HoverResults } from '../languageService/hoverProvider'; import { ReferenceCallback } from '../languageService/referencesProvider'; import { SignatureHelpResults } from '../languageService/signatureHelpProvider'; import { AnalysisCompleteCallback } from './analysis'; import { BackgroundAnalysisProgram, BackgroundAnalysisProgramFactory } from './backgroundAnalysisProgram'; -import { createImportedModuleDescriptor, ImportResolver, ImportResolverFactory } from './importResolver'; +import { CacheManager } from './cacheManager'; +import { + createImportedModuleDescriptor, + ImportResolver, + ImportResolverFactory, + supportedSourceFileExtensions, +} from './importResolver'; import { MaxAnalysisTime, Program } from './program'; import { findPythonSearchPaths } from './pythonPathUtils'; import { IPythonMode } from './sourceFile'; @@ -78,19 +86,27 @@ export const pyprojectTomlName = 'pyproject.toml'; const _userActivityBackoffTimeInMs = 250; const _gitDirectory = normalizeSlashes('/.git/'); -const _includeFileRegex = /\.pyi?$/; export interface AnalyzerServiceOptions { console?: ConsoleInterface; hostFactory?: HostFactory; importResolverFactory?: ImportResolverFactory; configOptions?: ConfigOptions; - extension?: LanguageServiceExtension; backgroundAnalysis?: BackgroundAnalysisBase; maxAnalysisTime?: MaxAnalysisTime; backgroundAnalysisProgramFactory?: BackgroundAnalysisProgramFactory; cancellationProvider?: CancellationProvider; libraryReanalysisTimeProvider?: () => number; + cacheManager?: CacheManager; + serviceId?: string; + skipScanningUserFiles?: boolean; +} + +// Hold uniqueId for this service. It can be used to distinguish each service later. +let _nextServiceId = 1; + +export function getNextServiceId(name: string) { + return `${name}_${_nextServiceId++}`; } export class AnalyzerService { @@ -115,12 +131,15 @@ export class AnalyzerService { private _backgroundAnalysisProgram: BackgroundAnalysisProgram; private _backgroundAnalysisCancellationSource: AbstractCancellationTokenSource | undefined; private _disposed = false; + private _pendingLibraryChanges: RefreshOptions = { changesOnly: true }; constructor(instanceName: string, fs: FileSystem, options: AnalyzerServiceOptions) { this._instanceName = instanceName; + this._executionRootPath = ''; this._options = options; + this._options.serviceId = this._options.serviceId ?? getNextServiceId(instanceName); this._options.console = options.console || new StandardConsole(); this._options.importResolverFactory = options.importResolverFactory ?? AnalyzerService.createImportResolver; this._options.cancellationProvider = options.cancellationProvider ?? new DefaultCancellationProvider(); @@ -136,25 +155,46 @@ export class AnalyzerService { this._backgroundAnalysisProgram = this._options.backgroundAnalysisProgramFactory !== undefined ? this._options.backgroundAnalysisProgramFactory( + this._options.serviceId, this._options.console, this._options.configOptions, importResolver, - this._options.extension, this._options.backgroundAnalysis, - this._options.maxAnalysisTime + this._options.maxAnalysisTime, + this._options.cacheManager ) : new BackgroundAnalysisProgram( this._options.console, this._options.configOptions, importResolver, - this._options.extension, this._options.backgroundAnalysis, - this._options.maxAnalysisTime + this._options.maxAnalysisTime, + /* disableChecker */ undefined, + this._options.cacheManager ); - } - clone(instanceName: string, backgroundAnalysis?: BackgroundAnalysisBase, fs?: FileSystem): AnalyzerService { - const service = new AnalyzerService(instanceName, fs ?? this.fs, { ...this._options, backgroundAnalysis }); + // Create the extensions tied to this program. This is where the mutating 'addTrackedFile' will actually + // mutate the local program and the BG thread one. + Extensions.createProgramExtensions(this._program, { addInterimFile: this.addInterimFile.bind(this) }); + } + + clone( + instanceName: string, + serviceId: string, + backgroundAnalysis?: BackgroundAnalysisBase, + fs?: FileSystem + ): AnalyzerService { + const service = new AnalyzerService(instanceName, fs ?? this.fs, { + ...this._options, + serviceId, + backgroundAnalysis, + skipScanningUserFiles: true, + }); + + // Cloned service will use whatever user files the service currently has. + const userFiles = this.getUserFiles(); + service.backgroundAnalysisProgram.setTrackedFiles(userFiles); + service.backgroundAnalysisProgram.markAllFilesDirty(true); // Make sure we keep editor content (open file) which could be different than one in the file system. for (const fileInfo of this.backgroundAnalysisProgram.program.getOpened()) { @@ -163,7 +203,10 @@ export class AnalyzerService { service.setFileOpened( fileInfo.sourceFile.getFilePath(), version, - fileInfo.sourceFile.getOpenFileContents()! + fileInfo.sourceFile.getOpenFileContents()!, + fileInfo.sourceFile.getIPythonMode(), + fileInfo.chainedSourceFile?.sourceFile.getFilePath(), + fileInfo.sourceFile.getRealFilePath() ); } } @@ -172,6 +215,13 @@ export class AnalyzerService { } dispose() { + if (!this._disposed) { + // Make sure we dispose program, otherwise, entire program + // will leak. + this._backgroundAnalysisProgram.dispose(); + Extensions.destroyProgramExtensions(this._program.id); + } + this._disposed = true; this._removeSourceFileWatchers(); this._removeConfigFileWatcher(); @@ -193,7 +243,7 @@ export class AnalyzerService { return this._options.importResolverFactory!; } - private get _cancellationProvider() { + get cancellationProvider() { return this._options.cancellationProvider!; } @@ -235,14 +285,20 @@ export class AnalyzerService { this._applyConfigOptions(host); } + hasSourceFile(filePath: string): boolean { + return this.backgroundAnalysisProgram.hasSourceFile(filePath); + } + isTracked(filePath: string): boolean { - for (const includeSpec of this._configOptions.include) { - if (this._matchIncludeFileSpec(includeSpec.regExp, this._configOptions.exclude, filePath)) { - return true; - } - } + return this._program.owns(filePath); + } + + getUserFiles() { + return this._program.getUserFiles().map((i) => i.sourceFile.getFilePath()); + } - return false; + getOpenFiles() { + return this._program.getOpened().map((i) => i.sourceFile.getFilePath()); } setFileOpened( @@ -250,12 +306,17 @@ export class AnalyzerService { version: number | null, contents: string, ipythonMode = IPythonMode.None, - chainedFilePath?: string + chainedFilePath?: string, + realFilePath?: string ) { + // Open the file. Notebook cells are always tracked as they aren't 3rd party library files. + // This is how it's worked in the past since each notebook used to have its own + // workspace and the workspace include setting marked all cells as tracked. this._backgroundAnalysisProgram.setFileOpened(path, version, contents, { - isTracked: this.isTracked(path), + isTracked: this.isTracked(path) || ipythonMode !== IPythonMode.None, ipythonMode, chainedFilePath, + realFilePath, }); this._scheduleReanalysis(/* requireTrackedFileUpdate */ false); } @@ -274,34 +335,28 @@ export class AnalyzerService { version: number | null, contents: TextDocumentContentChangeEvent[], ipythonMode = IPythonMode.None, - chainedFilePath?: string + realFilePath?: string ) { this._backgroundAnalysisProgram.updateOpenFileContents(path, version, contents, { isTracked: this.isTracked(path), ipythonMode, - chainedFilePath, + chainedFilePath: undefined, + realFilePath, }); this._scheduleReanalysis(/* requireTrackedFileUpdate */ false); } - test_setIndexing( - workspaceIndices: Map, - libraryIndices: Map> - ) { - this._backgroundAnalysisProgram.test_setIndexing(workspaceIndices, libraryIndices); - } - startIndexing(indexOptions: IndexOptions) { this._backgroundAnalysisProgram.startIndexing(indexOptions); } - setFileClosed(path: string) { - this._backgroundAnalysisProgram.setFileClosed(path); + setFileClosed(path: string, isTracked?: boolean) { + this._backgroundAnalysisProgram.setFileClosed(path, isTracked); this._scheduleReanalysis(/* requireTrackedFileUpdate */ false); } - isFileOpen(path: string) { - return this._program.isFileOpen(path); + addInterimFile(path: string) { + this._backgroundAnalysisProgram.addInterimFile(path); } getParseResult(path: string) { @@ -434,6 +489,16 @@ export class AnalyzerService { return this._program.performQuickAction(filePath, command, args, token); } + moveSymbolAtPosition( + filePath: string, + newFilePath: string, + position: Position, + options: { importFormat: ImportFormat }, + token: CancellationToken + ): FileEditActions | undefined { + return this._program.moveSymbolAtPosition(filePath, newFilePath, position, options, token); + } + renameModule(filePath: string, newFilePath: string, token: CancellationToken): FileEditActions | undefined { return this._program.renameModule(filePath, newFilePath, token); } @@ -496,7 +561,7 @@ export class AnalyzerService { this._console.info(''); this._console.info('Analysis stats'); - const boundFileCount = this._program.getFileCount(); + const boundFileCount = this._program.getFileCount(/* userFileOnly */ false); this._console.info('Total files parsed and bound: ' + boundFileCount.toString()); const checkedFileCount = this._program.getUserFileCount(); @@ -546,6 +611,10 @@ export class AnalyzerService { return this._getFileNamesFromFileSpecs(); } + test_shouldHandleSourceFileWatchChanges(path: string, isFile: boolean) { + return this._shouldHandleSourceFileWatchChanges(path, isFile); + } + // Calculates the effective options based on the command-line options, // an optional config file, and default values. private _getConfigOptions(host: Host, commandLineOptions: CommandLineOptions): ConfigOptions { @@ -590,7 +659,7 @@ export class AnalyzerService { if (configFilePath) { projectRoot = getDirectoryPath(configFilePath); } else { - this._console.info(`No configuration file found.`); + this._console.log(`No configuration file found.`); configFilePath = undefined; } } @@ -605,9 +674,9 @@ export class AnalyzerService { if (pyprojectFilePath) { projectRoot = getDirectoryPath(pyprojectFilePath); - this._console.info(`pyproject.toml file found at ${projectRoot}.`); + this._console.log(`pyproject.toml file found at ${projectRoot}.`); } else { - this._console.info(`No pyproject.toml file found.`); + this._console.log(`No pyproject.toml file found.`); } } @@ -635,13 +704,29 @@ export class AnalyzerService { commandLineOptions.fileSpecs.forEach((fileSpec) => { configOptions.include.push(getFileSpec(this.fs, projectRoot, fileSpec)); }); - } else if (!configFilePath) { - // If no config file was found and there are no explicit include - // paths specified, assume the caller wants to include all source - // files under the execution root path. - if (commandLineOptions.executionRoot) { + } + + if (commandLineOptions.excludeFileSpecs.length > 0) { + commandLineOptions.excludeFileSpecs.forEach((fileSpec) => { + configOptions.exclude.push(getFileSpec(this.fs, projectRoot, fileSpec)); + }); + } + + if (commandLineOptions.ignoreFileSpecs.length > 0) { + commandLineOptions.ignoreFileSpecs.forEach((fileSpec) => { + configOptions.ignore.push(getFileSpec(this.fs, projectRoot, fileSpec)); + }); + } + + if (!configFilePath && commandLineOptions.executionRoot) { + if (commandLineOptions.fileSpecs.length === 0) { + // If no config file was found and there are no explicit include + // paths specified, assume the caller wants to include all source + // files under the execution root path. configOptions.include.push(getFileSpec(this.fs, commandLineOptions.executionRoot, '.')); + } + if (commandLineOptions.excludeFileSpecs.length === 0) { // Add a few common excludes to avoid long scan times. defaultExcludes.forEach((exclude) => { configOptions.exclude.push(getFileSpec(this.fs, commandLineOptions.executionRoot, exclude)); @@ -697,7 +782,11 @@ export class AnalyzerService { configOptions.applyDiagnosticOverrides(commandLineOptions.diagnosticSeverityOverrides); } - configOptions.analyzeUnannotatedFunctions = commandLineOptions.analyzeUnannotatedFunctions ?? true; + // Override the analyzeUnannotatedFunctions setting based on the command-line setting. + if (commandLineOptions.analyzeUnannotatedFunctions !== undefined) { + configOptions.diagnosticRuleSet.analyzeUnannotatedFunctions = + commandLineOptions.analyzeUnannotatedFunctions; + } const reportDuplicateSetting = (settingName: string, configValue: number | string | boolean) => { const settingSource = commandLineOptions.fromVsCodeExtension @@ -733,6 +822,7 @@ export class AnalyzerService { configOptions.checkOnlyOpenFiles = !!commandLineOptions.checkOnlyOpenFiles; configOptions.autoImportCompletions = !!commandLineOptions.autoImportCompletions; configOptions.indexing = !!commandLineOptions.indexing; + configOptions.taskListTokens = commandLineOptions.taskListTokens; configOptions.logTypeEvaluationTime = !!commandLineOptions.logTypeEvaluationTime; configOptions.typeEvaluationTimeThreshold = commandLineOptions.typeEvaluationTimeThreshold; @@ -744,17 +834,22 @@ export class AnalyzerService { reportDuplicateSetting('useLibraryCodeForTypes', configOptions.useLibraryCodeForTypes); } - // If there was no stub path specified, use a default path. if (commandLineOptions.stubPath) { if (!configOptions.stubPath) { configOptions.stubPath = commandLineOptions.stubPath; } else { reportDuplicateSetting('stubPath', configOptions.stubPath); } - } else { - if (!configOptions.stubPath) { - configOptions.stubPath = normalizePath(combinePaths(configOptions.projectRoot, 'typings')); + } + + if (configOptions.stubPath) { + // If there was a stub path specified, validate it. + if (!this.fs.existsSync(configOptions.stubPath) || !isDirectory(this.fs, configOptions.stubPath)) { + this._console.warn(`stubPath ${configOptions.stubPath} is not a valid directory.`); } + } else { + // If no stub path was specified, use a default path. + configOptions.stubPath = normalizePath(combinePaths(configOptions.projectRoot, defaultStubsDirectory)); } // Do some sanity checks on the specified settings and report missing @@ -806,12 +901,6 @@ export class AnalyzerService { } } - if (configOptions.stubPath) { - if (!this.fs.existsSync(configOptions.stubPath) || !isDirectory(this.fs, configOptions.stubPath)) { - this._console.warn(`stubPath ${configOptions.stubPath} is not a valid directory.`); - } - } - return configOptions; } @@ -837,20 +926,16 @@ export class AnalyzerService { ); } - // This is called after a new type stub has been created. It allows - // us to invalidate caches and force reanalysis of files that potentially - // are affected by the appearance of a new type stub. invalidateAndForceReanalysis( rebuildUserFileIndexing = true, rebuildLibraryIndexing = true, - updateTrackedFileList = false + refreshOptions?: RefreshOptions ) { - if (updateTrackedFileList) { - this._updateTrackedFileList(/* markFilesDirtyUnconditionally */ false); - } - - // Mark all files with one or more errors dirty. - this._backgroundAnalysisProgram.invalidateAndForceReanalysis(rebuildUserFileIndexing, rebuildLibraryIndexing); + this._backgroundAnalysisProgram.invalidateAndForceReanalysis( + rebuildUserFileIndexing, + rebuildLibraryIndexing, + refreshOptions + ); } // Forces the service to stop all analysis, discard all its caches, @@ -898,21 +983,16 @@ export class AnalyzerService { } private _getTypeStubFolder() { - const stubPath = this._configOptions.stubPath; + const stubPath = + this._configOptions.stubPath ?? + normalizePath(combinePaths(this._configOptions.projectRoot, defaultStubsDirectory)); + if (!this._typeStubTargetPath || !this._typeStubTargetImportName) { const errMsg = `Import '${this._typeStubTargetImportName}'` + ` could not be resolved`; this._console.error(errMsg); throw new Error(errMsg); } - if (!stubPath) { - // We should never get here because we always generate a - // default typings path if none was specified. - const errMsg = 'No typings path was specified'; - this._console.info(errMsg); - throw new Error(errMsg); - } - const typeStubInputTargetParts = this._typeStubTargetImportName.split('.'); if (typeStubInputTargetParts[0].length === 0) { // We should never get here because the import resolution @@ -979,7 +1059,13 @@ export class AnalyzerService { private _parseJsonConfigFile(configPath: string): object | undefined { return this._attemptParseFile(configPath, (fileContents) => { - return JSONC.parse(fileContents); + const errors: JSONC.ParseError[] = []; + const result = JSONC.parse(fileContents, errors, { allowTrailingComma: true }); + if (errors.length > 0) { + throw new Error('Errors parsing JSON file'); + } + + return result; }); } @@ -1046,6 +1132,7 @@ export class AnalyzerService { // Use a map to generate a list of unique files. const fileMap = new Map(); + // Scan all matching files from file system. timingStats.findFilesTime.timeOperation(() => { const matchedFiles = this._matchFiles(this._configOptions.include, this._configOptions.exclude); @@ -1054,6 +1141,14 @@ export class AnalyzerService { } }); + // And scan all matching open files. We need to do this since some of files are not backed by + // files in file system but only exist in memory (ex, virtual workspace) + this._backgroundAnalysisProgram.program + .getOpened() + .map((o) => o.sourceFile.getFilePath()) + .filter((f) => matchFileSpecs(this._program.getConfigOptions(), f)) + .forEach((f) => fileMap.set(f, f)); + return [...fileMap.values()]; } @@ -1118,7 +1213,10 @@ export class AnalyzerService { // Add the implicit import paths. importResult.filteredImplicitImports.forEach((implicitImport) => { - filesToImport.push(implicitImport.path); + const fileExtension = getFileExtension(implicitImport.path).toLowerCase(); + if (supportedSourceFileExtensions.some((ext) => fileExtension === ext)) { + filesToImport.push(implicitImport.path); + } }); this._backgroundAnalysisProgram.setAllowedThirdPartyImports([this._typeStubTargetImportName]); @@ -1126,11 +1224,13 @@ export class AnalyzerService { } else { this._console.error(`Import '${this._typeStubTargetImportName}' not found`); } - } else { + } else if (!this._options.skipScanningUserFiles) { let fileList: string[] = []; - this._console.info(`Searching for source files`); + this._console.log(`Searching for source files`); fileList = this._getFileNamesFromFileSpecs(); + // getFileNamesFromFileSpecs might have updated configOptions, resync options. + this._backgroundAnalysisProgram.setConfigOptions(this._configOptions); this._backgroundAnalysisProgram.setTrackedFiles(fileList); this._backgroundAnalysisProgram.markAllFilesDirty(markFilesDirtyUnconditionally); @@ -1151,7 +1251,11 @@ export class AnalyzerService { const longOperationLimitInSec = 10; let loggedLongOperationError = false; - const visitDirectoryUnchecked = (absolutePath: string, includeRegExp: RegExp) => { + const visitDirectoryUnchecked = ( + absolutePath: string, + includeRegExp: RegExp, + hasDirectoryWildcard: boolean + ) => { if (!loggedLongOperationError) { const secondsSinceStart = (Date.now() - startTime) * 0.001; @@ -1176,6 +1280,11 @@ export class AnalyzerService { if (this._configOptions.autoExcludeVenv) { if (envMarkers.some((f) => this.fs.existsSync(combinePaths(absolutePath, ...f)))) { + // Save auto exclude paths in the configOptions once we found them. + if (!FileSpec.isInPath(absolutePath, exclude)) { + exclude.push(getFileSpec(this.fs, this._configOptions.projectRoot, `${absolutePath}/**`)); + } + this._console.info(`Auto-excluding ${absolutePath}`); return; } @@ -1186,23 +1295,23 @@ export class AnalyzerService { for (const file of files) { const filePath = combinePaths(absolutePath, file); - if (this._matchIncludeFileSpec(includeRegExp, exclude, filePath)) { + if (FileSpec.matchIncludeFileSpec(includeRegExp, exclude, filePath)) { results.push(filePath); } } for (const directory of directories) { const dirPath = combinePaths(absolutePath, directory); - if (includeRegExp.test(dirPath)) { - if (!this._isInExcludePath(dirPath, exclude)) { - visitDirectory(dirPath, includeRegExp); + if (includeRegExp.test(dirPath) || hasDirectoryWildcard) { + if (!FileSpec.isInPath(dirPath, exclude)) { + visitDirectory(dirPath, includeRegExp, hasDirectoryWildcard); } } } }; const seenDirs = new Set(); - const visitDirectory = (absolutePath: string, includeRegExp: RegExp) => { + const visitDirectory = (absolutePath: string, includeRegExp: RegExp, hasDirectoryWildcard: boolean) => { const realDirPath = tryRealpath(this.fs, absolutePath); if (!realDirPath) { this._console.warn(`Skipping broken link "${absolutePath}"`); @@ -1216,27 +1325,27 @@ export class AnalyzerService { seenDirs.add(realDirPath); try { - visitDirectoryUnchecked(absolutePath, includeRegExp); + visitDirectoryUnchecked(absolutePath, includeRegExp, hasDirectoryWildcard); } finally { seenDirs.delete(realDirPath); } }; include.forEach((includeSpec) => { - if (!this._isInExcludePath(includeSpec.wildcardRoot, exclude)) { + if (!FileSpec.isInPath(includeSpec.wildcardRoot, exclude)) { let foundFileSpec = false; let isFileIncluded = true; const stat = tryStat(this.fs, includeSpec.wildcardRoot); if (stat?.isFile()) { - if (this._shouldIncludeFile(includeSpec.wildcardRoot)) { + if (FileSpec.matchesIncludeFileRegex(includeSpec.wildcardRoot)) { results.push(includeSpec.wildcardRoot); } else { isFileIncluded = false; } foundFileSpec = true; } else if (stat?.isDirectory()) { - visitDirectory(includeSpec.wildcardRoot, includeSpec.regExp); + visitDirectory(includeSpec.wildcardRoot, includeSpec.regExp, includeSpec.hasDirectoryWildcard); foundFileSpec = true; } @@ -1300,56 +1409,38 @@ export class AnalyzerService { return; } - // For file change, we only care python file change. - if ( - eventInfo.isFile && - (!hasPythonExtension(path) || isTemporaryFile(path) || !this.isTracked(path)) - ) { + if (!this._shouldHandleSourceFileWatchChanges(path, eventInfo.isFile)) { return; } - if (eventInfo.isFile && (eventInfo.event === 'change' || eventInfo.event === 'unlink')) { + // If the change is the content of 1 file, then it can't affect `import resolution` result. All we need to do is + // reanalyzing related files (files that transitively depends on this file). + if (eventInfo.isFile && eventInfo.event === 'change') { this._backgroundAnalysisProgram.markFilesDirty([path], /* evenIfContentsAreSame */ false); this._scheduleReanalysis(/* requireTrackedFileUpdate */ false); - } else { - // Added files or folder changes impact imports, - // clear the import resolver cache and reanalyze everything. - // - // Here we don't need to rebuild any indexing since this kind of change can't affect - // indices. For library, since the changes are on workspace files, it won't affect library - // indices. For user file, since user file indices don't contains import alias symbols, - // it won't affect those indices. we only need to rebuild user file indices when symbols - // defined in the file are changed. ex) user modified the file. - // Newly added file will be scanned since it doesn't have existing indices. - this.invalidateAndForceReanalysis( - /* rebuildUserFileIndexing */ false, - /* rebuildLibraryIndexing */ false - ); - this._scheduleReanalysis(/* requireTrackedFileUpdate */ true); + return; } + + // fs events happened can impact import resolution result. + // clear the import resolver cache and reanalyze everything. + // + // Here we don't need to rebuild any indexing since this kind of change can't affect + // indices. For library, since the changes are on workspace files, it won't affect library + // indices. For user file, since user file indices don't contains import alias symbols, + // it won't affect those indices. we only need to rebuild user file indices when symbols + // defined in the file are changed. ex) user modified the file. + // Newly added file will be scanned since it doesn't have existing indices. + this.invalidateAndForceReanalysis( + /* rebuildUserFileIndexing */ false, + /* rebuildLibraryIndexing */ false + ); + this._scheduleReanalysis(/* requireTrackedFileUpdate */ true); }); } catch { this._console.error(`Exception caught when installing fs watcher for:\n ${fileList.join('\n')}`); } } - function isTemporaryFile(path: string) { - // Determine if this is an add or delete event related to a temporary - // file. Some tools (like auto-formatters) create temporary files - // alongside the original file and name them "x.py..py" where - // is a 32-character random string of hex digits. We don't - // want these events to trigger a full reanalysis. - const fileName = getFileName(path); - const fileNameSplit = fileName.split('.'); - if (fileNameSplit.length === 4) { - if (fileNameSplit[3] === fileNameSplit[1] && fileNameSplit[2].length === 32) { - return true; - } - } - - return false; - } - function getEventInfo( fs: FileSystem, console: ConsoleInterface, @@ -1394,6 +1485,60 @@ export class AnalyzerService { } } + private _shouldHandleSourceFileWatchChanges(path: string, isFile: boolean) { + if (isFile) { + if (!hasPythonExtension(path) || isTemporaryFile(path)) { + return false; + } + + // Check whether the file change can affect semantics. If the file changed is not a user file or already a part of + // the program (since we lazily load library files or extra path files when they are used), then the change can't + // affect semantics. so just bail out. + if (!this.isTracked(path) && !this._program.getSourceFileInfo(path)) { + return false; + } + + return true; + } + + // The fs change is on a folder. + if (!matchFileSpecs(this._program.getConfigOptions(), path, /* isFile */ false)) { + // First, make sure the folder is included. By default, we exclude any folder whose name starts with '.' + return false; + } + + const parentPath = getDirectoryPath(path); + const hasInit = + parentPath.startsWith(this._configOptions.projectRoot) && + (this.fs.existsSync(combinePaths(parentPath, '__init__.py')) || + this.fs.existsSync(combinePaths(parentPath, '__init__.pyi'))); + + // We don't have any file under the given path and its parent folder doesn't have __init__ then this folder change + // doesn't have any meaning to us. + if (!hasInit && !this._program.containsSourceFileIn(path)) { + return false; + } + + return true; + + function isTemporaryFile(path: string) { + // Determine if this is an add or delete event related to a temporary + // file. Some tools (like auto-formatters) create temporary files + // alongside the original file and name them "x.py..py" where + // is a 32-character random string of hex digits. We don't + // want these events to trigger a full reanalysis. + const fileName = getFileName(path); + const fileNameSplit = fileName.split('.'); + if (fileNameSplit.length === 4) { + if (fileNameSplit[3] === fileNameSplit[1] && fileNameSplit[2].length === 32) { + return true; + } + } + + return false; + } + } + private _removeLibraryFileWatcher() { if (this._libraryFileWatcher) { this._libraryFileWatcher.close(); @@ -1440,7 +1585,9 @@ export class AnalyzerService { return; } - this._scheduleLibraryAnalysis(); + // If file doesn't exist, it is delete. + const isChange = event === 'change' && this.fs.existsSync(path); + this._scheduleLibraryAnalysis(isChange); }); } catch { this._console.error(`Exception caught when installing fs watcher for:\n ${watchList.join('\n')}`); @@ -1456,7 +1603,7 @@ export class AnalyzerService { } } - private _scheduleLibraryAnalysis() { + private _scheduleLibraryAnalysis(isChange: boolean) { if (this._disposed) { // Already disposed. return; @@ -1470,6 +1617,9 @@ export class AnalyzerService { return; } + // Add pending library files/folders changes. + this._pendingLibraryChanges.changesOnly = this._pendingLibraryChanges.changesOnly && isChange; + // Wait for a little while, since library changes // tend to happen in big batches when packages // are installed or uninstalled. @@ -1478,8 +1628,13 @@ export class AnalyzerService { // Invalidate import resolver, mark all files dirty unconditionally, // and reanalyze. - this.invalidateAndForceReanalysis(/* rebuildUserFileIndexing */ false); + this.invalidateAndForceReanalysis(/* rebuildUserFileIndexing */ false, /* rebuildLibraryIndexing */ true, { + changesOnly: this._pendingLibraryChanges.changesOnly, + }); this._scheduleReanalysis(/* requireTrackedFileUpdate */ false); + + // No more pending changes. + this._pendingLibraryChanges.changesOnly = true; }, backOffTimeInMS); } @@ -1639,7 +1794,7 @@ export class AnalyzerService { } // This creates a cancellation source only if it actually gets used. - this._backgroundAnalysisCancellationSource = this._cancellationProvider.createCancellationTokenSource(); + this._backgroundAnalysisCancellationSource = this.cancellationProvider.createCancellationTokenSource(); const moreToAnalyze = this._backgroundAnalysisProgram.startAnalysis( this._backgroundAnalysisCancellationSource.token ); @@ -1662,22 +1817,4 @@ export class AnalyzerService { }); } } - - private _shouldIncludeFile(filePath: string) { - return _includeFileRegex.test(filePath); - } - - private _isInExcludePath(path: string, excludePaths: FileSpec[]) { - return !!excludePaths.find((excl) => excl.regExp.test(path)); - } - - private _matchIncludeFileSpec(includeRegExp: RegExp, exclude: FileSpec[], filePath: string) { - if (includeRegExp.test(filePath)) { - if (!this._isInExcludePath(filePath, exclude) && this._shouldIncludeFile(filePath)) { - return true; - } - } - - return false; - } } diff --git a/packages/pyright-internal/src/analyzer/sourceFile.ts b/packages/pyright-internal/src/analyzer/sourceFile.ts index a45b40b62..d14b7346d 100644 --- a/packages/pyright-internal/src/analyzer/sourceFile.ts +++ b/packages/pyright-internal/src/analyzer/sourceFile.ts @@ -4,7 +4,7 @@ * Licensed under the MIT license. * Author: Eric Traut * - * Class that represents a single python source file. + * Class that represents a single Python source or stub file. */ import { @@ -19,17 +19,25 @@ import { isMainThread } from 'worker_threads'; import * as SymbolNameUtils from '../analyzer/symbolNameUtils'; import { OperationCanceledException } from '../common/cancellationUtils'; -import { ConfigOptions, ExecutionEnvironment, getBasicDiagnosticRuleSet } from '../common/configOptions'; +import { + ConfigOptions, + ExecutionEnvironment, + getBasicDiagnosticRuleSet, + SignatureDisplayType, +} from '../common/configOptions'; import { ConsoleInterface, StandardConsole } from '../common/console'; import { assert } from '../common/debug'; +import { TaskListToken } from '../common/diagnostic'; import { convertLevelToCategory, Diagnostic, DiagnosticCategory } from '../common/diagnostic'; +import { DiagnosticRule } from '../common/diagnosticRules'; import { DiagnosticSink, TextRangeDiagnosticSink } from '../common/diagnosticSink'; import { TextEditAction } from '../common/editAction'; +import { Extensions } from '../common/extensibility'; import { FileSystem } from '../common/fileSystem'; import { LogTracker } from '../common/logTracker'; import { fromLSPAny } from '../common/lspUtils'; import { getFileName, normalizeSlashes, stripFileExtension } from '../common/pathUtils'; -import { convertOffsetsToRange } from '../common/positionUtils'; +import { convertOffsetsToRange, convertTextRangeToRange } from '../common/positionUtils'; import * as StringUtils from '../common/stringUtils'; import { DocumentRange, getEmptyRange, Position, Range, TextRange } from '../common/textRange'; import { TextRangeCollection } from '../common/textRangeCollection'; @@ -39,13 +47,14 @@ import { AbbreviationMap, CompletionOptions, CompletionResults } from '../langua import { CompletionItemData, CompletionProvider } from '../languageService/completionProvider'; import { DefinitionFilter, DefinitionProvider } from '../languageService/definitionProvider'; import { DocumentHighlightProvider } from '../languageService/documentHighlightProvider'; +import { DocumentSymbolCollectorUseCase } from '../languageService/documentSymbolCollector'; import { DocumentSymbolProvider, IndexOptions, IndexResults } from '../languageService/documentSymbolProvider'; import { HoverProvider, HoverResults } from '../languageService/hoverProvider'; import { performQuickAction } from '../languageService/quickActions'; import { ReferenceCallback, ReferencesProvider, ReferencesResult } from '../languageService/referencesProvider'; import { SignatureHelpProvider, SignatureHelpResults } from '../languageService/signatureHelpProvider'; import { Localizer } from '../localization/localize'; -import { ModuleNode, NameNode } from '../parser/parseNodes'; +import { ModuleNode } from '../parser/parseNodes'; import { ModuleImport, ParseOptions, Parser, ParseResults } from '../parser/parser'; import { IgnoreComment } from '../parser/tokenizer'; import { Token } from '../parser/tokenizerTypes'; @@ -83,8 +92,6 @@ export enum IPythonMode { // Not a notebook. This is the only falsy enum value, so you // can test if IPython is supported via "if (ipythonMode)" None = 0, - // All cells are concatenated into a single document. - ConcatDoc, // Each cell is its own document. CellDocs, } @@ -93,9 +100,13 @@ export class SourceFile { // Console interface to use for debugging. private _console: ConsoleInterface; - // File path on disk. + // File path unique to this file within the workspace. May not represent + // a real file on disk. private readonly _filePath: string; + // File path on disk. May not be unique. + private readonly _realFilePath: string; + // Period-delimited import path for the module. private _moduleName: string; @@ -158,13 +169,16 @@ export class SourceFile { // Diagnostics generated during different phases of analysis. private _parseDiagnostics: Diagnostic[] = []; + private _commentDiagnostics: Diagnostic[] = []; private _bindDiagnostics: Diagnostic[] = []; private _checkerDiagnostics: Diagnostic[] = []; private _typeIgnoreLines = new Map(); private _typeIgnoreAll: IgnoreComment | undefined; private _pyrightIgnoreLines = new Map(); - // Settings that control which diagnostics should be output. + // Settings that control which diagnostics should be output. The rules + // are initialized to the basic set. They should be updated after the + // the file is parsed. private _diagnosticRuleSet = getBasicDiagnosticRuleSet(); // Circular dependencies that have been reported in this file. @@ -205,11 +219,13 @@ export class SourceFile { isThirdPartyPyTypedPresent: boolean, console?: ConsoleInterface, logTracker?: LogTracker, + realFilePath?: string, ipythonMode = IPythonMode.None ) { this.fileSystem = fs; this._console = console || new StandardConsole(); this._filePath = filePath; + this._realFilePath = realFilePath ?? filePath; this._moduleName = moduleName; this._isStubFile = filePath.endsWith('.pyi'); this._isThirdPartyImport = isThirdPartyImport; @@ -243,6 +259,14 @@ export class SourceFile { this._ipythonMode = ipythonMode; } + getRealFilePath(): string { + return this._realFilePath; + } + + getIPythonMode(): IPythonMode { + return this._ipythonMode; + } + getFilePath(): string { return this._filePath; } @@ -283,7 +307,12 @@ export class SourceFile { includeWarningsAndErrors = false; } - let diagList = [...this._parseDiagnostics, ...this._bindDiagnostics, ...this._checkerDiagnostics]; + let diagList = [ + ...this._parseDiagnostics, + ...this._commentDiagnostics, + ...this._bindDiagnostics, + ...this._checkerDiagnostics, + ]; const prefilteredDiagList = diagList; const typeIgnoreLinesClone = new Map(this._typeIgnoreLines); const pyrightIgnoreLinesClone = new Map(this._pyrightIgnoreLines); @@ -313,11 +342,7 @@ export class SourceFile { // Filter the diagnostics based on "pyright: ignore" lines. if (this._pyrightIgnoreLines.size > 0) { diagList = diagList.filter((d) => { - if ( - d.category !== DiagnosticCategory.UnusedCode && - d.category !== DiagnosticCategory.UnreachableCode && - d.category !== DiagnosticCategory.Deprecated - ) { + if (d.category !== DiagnosticCategory.UnreachableCode && d.category !== DiagnosticCategory.Deprecated) { for (let line = d.range.start.line; line <= d.range.end.line; line++) { const pyrightIgnoreComment = this._pyrightIgnoreLines.get(line); if (pyrightIgnoreComment) { @@ -389,7 +414,7 @@ export class SourceFile { const rangeEnd = rangeStart + this._typeIgnoreAll.range.length; const range = convertOffsetsToRange(rangeStart, rangeEnd, this._parseResults!.tokenizerOutput.lines!); - if (!isUnreachableCodeRange(range)) { + if (!isUnreachableCodeRange(range) && this._diagnosticRuleSet.enableTypeIgnoreComments) { unnecessaryTypeIgnoreDiags.push( new Diagnostic(diagCategory, Localizer.Diagnostic.unnecessaryTypeIgnore(), range) ); @@ -406,7 +431,7 @@ export class SourceFile { this._parseResults!.tokenizerOutput.lines! ); - if (!isUnreachableCodeRange(range)) { + if (!isUnreachableCodeRange(range) && this._diagnosticRuleSet.enableTypeIgnoreComments) { unnecessaryTypeIgnoreDiags.push( new Diagnostic(diagCategory, Localizer.Diagnostic.unnecessaryTypeIgnore(), range) ); @@ -461,18 +486,18 @@ export class SourceFile { const category = convertLevelToCategory(this._diagnosticRuleSet.reportImportCycles); this._circularDependencies.forEach((cirDep) => { - diagList.push( - new Diagnostic( - category, - Localizer.Diagnostic.importCycleDetected() + - '\n' + - cirDep - .getPaths() - .map((path) => ' ' + path) - .join('\n'), - getEmptyRange() - ) + const diag = new Diagnostic( + category, + Localizer.Diagnostic.importCycleDetected() + + '\n' + + cirDep + .getPaths() + .map((path) => ' ' + path) + .join('\n'), + getEmptyRange() ); + diag.setRule(DiagnosticRule.reportImportCycles); + diagList.push(diag); }); } @@ -486,8 +511,11 @@ export class SourceFile { ); } + // add diagnostics for comments that match the task list tokens + this._addTaskListDiagnostics(options.taskListTokens, diagList); + // If the file is in the ignore list, clear the diagnostic list. - if (options.ignore.find((ignoreFileSpec) => ignoreFileSpec.regExp.test(this._filePath))) { + if (options.ignore.find((ignoreFileSpec) => ignoreFileSpec.regExp.test(this._realFilePath))) { diagList = []; } @@ -522,6 +550,64 @@ export class SourceFile { return diagList; } + // Get all task list diagnostics for the current file and add them + // to the specified diagnostic list + private _addTaskListDiagnostics(taskListTokens: TaskListToken[] | undefined, diagList: Diagnostic[]) { + // input validation + if (!taskListTokens || taskListTokens.length === 0 || !diagList) { + return; + } + + // if we have no tokens, we're done + if (!this._parseResults?.tokenizerOutput?.tokens) { + return; + } + + const tokenizerOutput = this._parseResults.tokenizerOutput; + for (let i = 0; i < tokenizerOutput.tokens.count; i++) { + const token = tokenizerOutput.tokens.getItemAt(i); + + // if there are no comments, skip this token + if (!token.comments || token.comments.length === 0) { + continue; + } + + for (const comment of token.comments) { + for (const token of taskListTokens) { + // Check if the comment matches the task list token. + // The comment must start with zero or more whitespace characters, + // followed by the taskListToken (case insensitive), + // followed by (0+ whitespace + EOL) OR (1+ NON-alphanumeric characters) + const regexStr = '^[\\s]*' + token.text + '([\\s]*$|[\\W]+)'; + const regex = RegExp(regexStr, 'i'); // case insensitive + + // if the comment doesn't match, skip it + if (!regex.test(comment.value)) { + continue; + } + + // Calculate the range for the diagnostic + // This allows navigation to the comment via double clicking the item in the task list pane + let rangeStart = comment.start; + + // The comment technically starts right after the comment identifier (#), but we want the caret right + // before the task list token (since there might be whitespace before it) + const indexOfToken = comment.value.toLowerCase().indexOf(token.text.toLowerCase()); + rangeStart += indexOfToken; + + const rangeEnd = TextRange.getEnd(comment); + const range = convertOffsetsToRange(rangeStart, rangeEnd, tokenizerOutput.lines!); + + // Add the diagnostic to the list to send to VS, + // and trim whitespace from the comment so it's easier to read in the task list + diagList.push( + new Diagnostic(DiagnosticCategory.TaskItem, comment.value.trim(), range, token.priority) + ); + } + } + } + } + getImports(): ImportResult[] { return this._imports || []; } @@ -598,11 +684,14 @@ export class SourceFile { this._indexingNeeded = indexingNeeded; this._moduleSymbolTable = undefined; this._cachedIndexResults = undefined; + const filePath = this.getFilePath(); + Extensions.getProgramExtensions(filePath).forEach((e) => (e.fileDirty ? e.fileDirty(filePath) : null)); } markReanalysisRequired(forceRebinding: boolean): void { // Keep the parse info, but reset the analysis to the beginning. this._isCheckingNeeded = true; + this._noCircularDependencyConfirmed = false; // If the file contains a wildcard import or __all__ symbols, // we need to rebind because a dependent import may have changed. @@ -633,7 +722,7 @@ export class SourceFile { getFileContent(): string | undefined { // Get current buffer content if the file is opened. const openFileContent = this.getOpenFileContents(); - if (openFileContent) { + if (openFileContent !== undefined) { return openFileContent; } @@ -794,22 +883,16 @@ export class SourceFile { } } - // Use the configuration options to determine the environment in which - // this source file will be executed. - const execEnvironment = configOptions.findExecEnvironment(this._filePath); - - const parseOptions = new ParseOptions(); - parseOptions.ipythonMode = this._ipythonMode; - if (this._filePath.endsWith('pyi')) { - parseOptions.isStubFile = true; - } - parseOptions.pythonVersion = execEnvironment.pythonVersion; - parseOptions.skipFunctionAndClassBody = configOptions.indexGenerationMode ?? false; - try { // Parse the token stream, building the abstract syntax tree. - const parser = new Parser(); - const parseResults = parser.parseSourceFile(fileContents!, parseOptions, diagSink); + const parseResults = parseFile( + configOptions, + this._filePath, + fileContents!, + this._ipythonMode, + diagSink + ); + assert(parseResults !== undefined && parseResults.tokenizerOutput !== undefined); this._parseResults = parseResults; this._typeIgnoreLines = this._parseResults.tokenizerOutput.typeIgnoreLines; @@ -817,6 +900,7 @@ export class SourceFile { this._pyrightIgnoreLines = this._parseResults.tokenizerOutput.pyrightIgnoreLines; // Resolve imports. + const execEnvironment = configOptions.findExecEnvironment(this._filePath); timingStats.resolveImportsTime.timeOperation(() => { const importResult = this._resolveImports( importResolver, @@ -833,14 +917,28 @@ export class SourceFile { // Is this file in a "strict" path? const useStrict = - configOptions.strict.find((strictFileSpec) => strictFileSpec.regExp.test(this._filePath)) !== + configOptions.strict.find((strictFileSpec) => strictFileSpec.regExp.test(this._realFilePath)) !== undefined; + const commentDiags: CommentUtils.CommentDiagnostic[] = []; this._diagnosticRuleSet = CommentUtils.getFileLevelDirectives( this._parseResults.tokenizerOutput.tokens, configOptions.diagnosticRuleSet, - useStrict + useStrict, + commentDiags ); + + this._commentDiagnostics = []; + + commentDiags.forEach((commentDiag) => { + this._commentDiagnostics.push( + new Diagnostic( + DiagnosticCategory.Error, + commentDiag.message, + convertTextRangeToRange(commentDiag.range, this._parseResults!.tokenizerOutput.lines) + ) + ); + }); } catch (e: any) { const message: string = (e.stack ? e.stack.toString() : undefined) || @@ -855,7 +953,7 @@ export class SourceFile { text: '', parseTree: ModuleNode.create({ start: 0, length: 0 }), importedModules: [], - futureImports: new Map(), + futureImports: new Set(), tokenizerOutput: { tokens: new TextRangeCollection([]), lines: new TextRangeCollection([]), @@ -964,27 +1062,14 @@ export class SourceFile { ); } - getDeclarationForNode( - sourceMapper: SourceMapper, - node: NameNode, - evaluator: TypeEvaluator, - reporter: ReferenceCallback | undefined, - token: CancellationToken - ): ReferencesResult | undefined { - // If we have no completed analysis job, there's nothing to do. - if (!this._parseResults) { - return undefined; - } - - return ReferencesProvider.getDeclarationForNode(sourceMapper, this._filePath, node, evaluator, reporter, token); - } - getDeclarationForPosition( sourceMapper: SourceMapper, position: Position, evaluator: TypeEvaluator, reporter: ReferenceCallback | undefined, - token: CancellationToken + useCase: DocumentSymbolCollectorUseCase, + token: CancellationToken, + implicitlyImportedBy?: SourceFile[] ): ReferencesResult | undefined { // If we have no completed analysis job, there's nothing to do. if (!this._parseResults) { @@ -998,7 +1083,9 @@ export class SourceFile { position, evaluator, reporter, - token + useCase, + token, + implicitlyImportedBy ); } @@ -1059,6 +1146,7 @@ export class SourceFile { position: Position, format: MarkupKind, evaluator: TypeEvaluator, + functionSignatureDisplay: SignatureDisplayType, token: CancellationToken ): HoverResults | undefined { // If this file hasn't been bound, no hover info is available. @@ -1066,7 +1154,15 @@ export class SourceFile { return undefined; } - return HoverProvider.getHoverForPosition(sourceMapper, this._parseResults, position, format, evaluator, token); + return HoverProvider.getHoverForPosition( + sourceMapper, + this._parseResults, + position, + format, + evaluator, + functionSignatureDisplay, + token + ); } getDocumentHighlight( @@ -1211,7 +1307,12 @@ export class SourceFile { return performQuickAction(command, args, this._parseResults, token); } - bind(configOptions: ConfigOptions, importLookup: ImportLookup, builtinsScope: Scope | undefined) { + bind( + configOptions: ConfigOptions, + importLookup: ImportLookup, + builtinsScope: Scope | undefined, + futureImports: Set + ) { assert(!this.isParseRequired(), 'Bind called before parsing'); assert(this.isBindingRequired(), 'Bind called unnecessarily'); assert(!this._isBindingInProgress, 'Bind called while binding in progress'); @@ -1227,7 +1328,8 @@ export class SourceFile { configOptions, this._parseResults!.text, importLookup, - builtinsScope + builtinsScope, + futureImports ); AnalyzerNodeInfo.setFileInfo(this._parseResults!.parseTree, fileInfo); @@ -1277,7 +1379,12 @@ export class SourceFile { }); } - check(importResolver: ImportResolver, evaluator: TypeEvaluator) { + check( + importResolver: ImportResolver, + evaluator: TypeEvaluator, + sourceMapper: SourceMapper, + dependentFiles?: ParseResults[] + ) { assert(!this.isParseRequired(), 'Check called before parsing'); assert(!this.isBindingRequired(), 'Check called before binding'); assert(!this._isBindingInProgress, 'Check called while binding in progress'); @@ -1288,7 +1395,13 @@ export class SourceFile { try { timingStats.typeCheckerTime.timeOperation(() => { const checkDuration = new Duration(); - const checker = new Checker(importResolver, evaluator, this._parseResults!.parseTree); + const checker = new Checker( + importResolver, + evaluator, + this._parseResults!, + sourceMapper, + dependentFiles + ); checker.check(); this._isCheckingNeeded = false; @@ -1330,21 +1443,22 @@ export class SourceFile { } test_enableIPythonMode(enable: boolean) { - this._ipythonMode = enable ? IPythonMode.ConcatDoc : IPythonMode.None; + this._ipythonMode = enable ? IPythonMode.CellDocs : IPythonMode.None; } private _buildFileInfo( configOptions: ConfigOptions, fileContents: string, importLookup: ImportLookup, - builtinsScope?: Scope + builtinsScope: Scope | undefined, + futureImports: Set ) { assert(this._parseResults !== undefined, 'Parse results not available'); const analysisDiagnostics = new TextRangeDiagnosticSink(this._parseResults!.tokenizerOutput.lines); const fileInfo: AnalyzerFileInfo = { importLookup, - futureImports: this._parseResults!.futureImports, + futureImports, builtinsScope, diagnosticSink: analysisDiagnostics, executionEnvironment: configOptions.findExecEnvironment(this._filePath), @@ -1432,7 +1546,20 @@ export class SourceFile { // Associate the import results with the module import // name node in the parse tree so we can access it later // (for hover and definition support). - AnalyzerNodeInfo.setImportInfo(moduleImport.nameNode, importResult); + if (moduleImport.nameParts.length === moduleImport.nameNode.nameParts.length) { + AnalyzerNodeInfo.setImportInfo(moduleImport.nameNode, importResult); + } else { + // For implicit imports of higher-level modules within a multi-part + // module name, the moduleImport.nameParts will refer to the subset + // of the multi-part name rather than the full multi-part name. In this + // case, store the import info on the name part node. + assert(moduleImport.nameParts.length > 0); + assert(moduleImport.nameParts.length - 1 < moduleImport.nameNode.nameParts.length); + AnalyzerNodeInfo.setImportInfo( + moduleImport.nameNode.nameParts[moduleImport.nameParts.length - 1], + importResult + ); + } } return { @@ -1450,3 +1577,27 @@ export class SourceFile { return filepath; } } + +export function parseFile( + configOptions: ConfigOptions, + filePath: string, + fileContents: string, + ipythonMode: IPythonMode, + diagSink: DiagnosticSink +) { + // Use the configuration options to determine the environment in which + // this source file will be executed. + const execEnvironment = configOptions.findExecEnvironment(filePath); + + const parseOptions = new ParseOptions(); + parseOptions.ipythonMode = ipythonMode; + if (filePath.endsWith('pyi')) { + parseOptions.isStubFile = true; + } + parseOptions.pythonVersion = execEnvironment.pythonVersion; + parseOptions.skipFunctionAndClassBody = configOptions.indexGenerationMode ?? false; + + // Parse the token stream, building the abstract syntax tree. + const parser = new Parser(); + return parser.parseSourceFile(fileContents, parseOptions, diagSink); +} diff --git a/packages/pyright-internal/src/analyzer/sourceFileInfoUtils.ts b/packages/pyright-internal/src/analyzer/sourceFileInfoUtils.ts index 0f9fece99..019ddba70 100644 --- a/packages/pyright-internal/src/analyzer/sourceFileInfoUtils.ts +++ b/packages/pyright-internal/src/analyzer/sourceFileInfoUtils.ts @@ -3,11 +3,29 @@ * Copyright (c) Microsoft Corporation. * Licensed under the MIT license. * - * Collection of functions that operate on SourceFileInfo objects. + * Functions that operate on SourceFileInfo objects. */ import { SourceFileInfo } from './program'; export function isUserCode(fileInfo: SourceFileInfo | undefined) { - return fileInfo && fileInfo.isTracked && !fileInfo.isThirdPartyImport && !fileInfo.isTypeshedFile; + return !!fileInfo && fileInfo.isTracked && !fileInfo.isThirdPartyImport && !fileInfo.isTypeshedFile; +} + +export function collectImportedByFiles(fileInfo: SourceFileInfo): Set { + const importedByFiles = new Set(); + _collectImportedByFiles(fileInfo, importedByFiles); + return importedByFiles; +} + +function _collectImportedByFiles(fileInfo: SourceFileInfo, importedByFiles: Set) { + fileInfo.importedBy.forEach((dep) => { + if (importedByFiles.has(dep)) { + // Already visited. + return; + } + + importedByFiles.add(dep); + _collectImportedByFiles(dep, importedByFiles); + }); } diff --git a/packages/pyright-internal/src/analyzer/sourceMapper.ts b/packages/pyright-internal/src/analyzer/sourceMapper.ts index 96b6dcc36..6e397bcf1 100644 --- a/packages/pyright-internal/src/analyzer/sourceMapper.ts +++ b/packages/pyright-internal/src/analyzer/sourceMapper.ts @@ -3,16 +3,18 @@ * Copyright (c) Microsoft Corporation. * Licensed under the MIT license. * - * Logic that maps a (.pyi) stub to its (.py) implementation source file. + * Logic that maps a ".pyi" stub to its ".py" source file. */ +import { CancellationToken } from 'vscode-jsonrpc'; + import * as AnalyzerNodeInfo from '../analyzer/analyzerNodeInfo'; import * as ParseTreeUtils from '../analyzer/parseTreeUtils'; import { appendArray } from '../common/collectionUtils'; import { ExecutionEnvironment } from '../common/configOptions'; import { isDefined } from '../common/core'; import { assertNever } from '../common/debug'; -import { combinePaths, getAnyExtensionFromPath } from '../common/pathUtils'; +import { combinePaths, getAnyExtensionFromPath, stripFileExtension } from '../common/pathUtils'; import { ClassNode, ImportFromNode, ModuleNode, ParseNode, ParseNodeType } from '../parser/parseNodes'; import { AliasDeclaration, @@ -30,7 +32,10 @@ import { VariableDeclaration, } from './declaration'; import { ImportResolver } from './importResolver'; +import { SourceFileInfo } from './program'; import { SourceFile } from './sourceFile'; +import { isUserCode } from './sourceFileInfoUtils'; +import { buildImportTree } from './sourceMapperUtils'; import { TypeEvaluator } from './typeEvaluatorTypes'; import { ClassType, isFunction, isInstantiableClass, isOverloadedFunction } from './types'; import { lookUpClassMember } from './typeUtils'; @@ -39,7 +44,7 @@ type ClassOrFunctionOrVariableDeclaration = ClassDeclaration | FunctionDeclarati // Creates and binds a shadowed file within the program. export type ShadowFileBinder = (stubFilePath: string, implFilePath: string) => SourceFile | undefined; -export type BoundSourceGetter = (filePath: string) => SourceFile | undefined; +export type BoundSourceGetter = (filePath: string) => SourceFileInfo | undefined; export class SourceMapper { constructor( @@ -49,12 +54,24 @@ export class SourceMapper { private _fileBinder: ShadowFileBinder, private _boundSourceGetter: BoundSourceGetter, private _mapCompiled: boolean, - private _preferStubs: boolean + private _preferStubs: boolean, + private _fromFile: SourceFileInfo | undefined, + private _cancelToken: CancellationToken ) {} findModules(stubFilePath: string): ModuleNode[] { - const sourceFiles = this._getBoundSourceFilesFromStubFile(stubFilePath); - return sourceFiles.map((sf) => sf.getParseResults()?.parseTree).filter(isDefined); + const sourceFiles = this._isStubThatShouldBeMappedToImplementation(stubFilePath) + ? this._getBoundSourceFilesFromStubFile(stubFilePath) + : [this._boundSourceGetter(stubFilePath)?.sourceFile]; + + return sourceFiles + .filter(isDefined) + .map((sf) => sf.getParseResults()?.parseTree) + .filter(isDefined); + } + + getModuleNode(filePath: string): ModuleNode | undefined { + return this._boundSourceGetter(filePath)?.sourceFile.getParseResults()?.parseTree; } findDeclarations(stubDecl: Declaration): Declaration[] { @@ -73,12 +90,6 @@ export class SourceMapper { return []; } - findClassDeclarations(stubDecl: ClassDeclaration): ClassDeclaration[] { - return this._findClassOrTypeAliasDeclarations(stubDecl) - .filter((d) => isClassDeclaration(d)) - .map((d) => d as ClassDeclaration); - } - findClassDeclarationsByType(originatedPath: string, type: ClassType): ClassDeclaration[] { const result: ClassOrFunctionOrVariableDeclaration[] = []; this._addClassTypeDeclarations(originatedPath, type, result, new Set()); @@ -91,6 +102,21 @@ export class SourceMapper { .map((d) => d as FunctionDeclaration); } + isUserCode(path: string): boolean { + return isUserCode(this._boundSourceGetter(path)); + } + + getNextFileName(path: string) { + const withoutExtension = stripFileExtension(path); + let suffix = 1; + let result = `${withoutExtension}_${suffix}.py`; + while (this.isUserCode(result) && suffix < 1000) { + suffix += 1; + result = `${withoutExtension}_${suffix}.py`; + } + return result; + } + private _findSpecialBuiltInClassDeclarations( stubDecl: SpecialBuiltInClassDeclaration, recursiveDeclCache = new Set() @@ -563,7 +589,7 @@ export class SourceMapper { recursiveDeclCache: Set ) { const filePath = type.details.filePath; - const sourceFiles = this._getSourceFiles(filePath); + const sourceFiles = this._getSourceFiles(filePath, /*stubToShadow*/ undefined, originated); const fullClassName = type.details.fullName.substring( type.details.moduleName.length + 1 /* +1 for trailing dot */ @@ -574,15 +600,15 @@ export class SourceMapper { } } - private _getSourceFiles(filePath: string, stubToShadow?: string) { + private _getSourceFiles(filePath: string, stubToShadow?: string, originated?: string) { const sourceFiles: SourceFile[] = []; if (this._isStubThatShouldBeMappedToImplementation(filePath)) { - appendArray(sourceFiles, this._getBoundSourceFilesFromStubFile(filePath, stubToShadow)); + appendArray(sourceFiles, this._getBoundSourceFilesFromStubFile(filePath, stubToShadow, originated)); } else { - const sourceFile = this._boundSourceGetter(filePath); - if (sourceFile) { - sourceFiles.push(sourceFile); + const sourceFileInfo = this._boundSourceGetter(filePath); + if (sourceFileInfo) { + sourceFiles.push(sourceFileInfo.sourceFile); } } @@ -690,11 +716,64 @@ export class SourceMapper { return fullName.reverse().join('.'); } - private _getBoundSourceFilesFromStubFile(stubFilePath: string, stubToShadow?: string): SourceFile[] { - const paths = this._importResolver.getSourceFilesFromStub(stubFilePath, this._execEnv, this._mapCompiled); + private _getBoundSourceFilesFromStubFile( + stubFilePath: string, + stubToShadow?: string, + originated?: string + ): SourceFile[] { + const paths = this._getSourcePathsFromStub( + stubFilePath, + originated ?? this._fromFile?.sourceFile.getFilePath() + ); return paths.map((fp) => this._fileBinder(stubToShadow ?? stubFilePath, fp)).filter(isDefined); } + private _getSourcePathsFromStub(stubFilePath: string, fromFile: string | undefined): string[] { + // Attempt our stubFilePath to see if we can resolve it as a source file path + let results = this._importResolver.getSourceFilesFromStub(stubFilePath, this._execEnv, this._mapCompiled); + if (results.length > 0) { + return results; + } + + // If that didn't work, try looking through the graph up to our fromFile. + // One of them should be able to resolve to an actual file. + const stubFileImportTree = this._getStubFileImportTree(stubFilePath, fromFile); + + // Go through the items in this tree until we find at least one path. + for (let i = 0; i < stubFileImportTree.length; i++) { + results = this._importResolver.getSourceFilesFromStub( + stubFileImportTree[i], + this._execEnv, + this._mapCompiled + ); + if (results.length > 0) { + return results; + } + } + + return []; + } + + private _getStubFileImportTree(stubFilePath: string, fromFile: string | undefined): string[] { + if (!fromFile || !this._isStubThatShouldBeMappedToImplementation(stubFilePath)) { + // No path to search, just return the starting point. + return [stubFilePath]; + } else { + // Otherwise recurse through the importedBy list up to our 'fromFile'. + return buildImportTree( + fromFile, + stubFilePath, + (p) => { + const boundSourceInfo = this._boundSourceGetter(p); + return boundSourceInfo + ? boundSourceInfo.importedBy.map((info) => info.sourceFile.getFilePath()) + : []; + }, + this._cancelToken + ).filter((p) => this._isStubThatShouldBeMappedToImplementation(p)); + } + } + private _isStubThatShouldBeMappedToImplementation(filePath: string): boolean { if (this._preferStubs) { return false; diff --git a/packages/pyright-internal/src/analyzer/sourceMapperUtils.ts b/packages/pyright-internal/src/analyzer/sourceMapperUtils.ts new file mode 100644 index 000000000..3d9abeca2 --- /dev/null +++ b/packages/pyright-internal/src/analyzer/sourceMapperUtils.ts @@ -0,0 +1,67 @@ +/* + * sourceMapperUtils.ts + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT license. + */ + +import { CancellationToken } from 'vscode-jsonrpc'; + +const MAX_TREE_SEARCH_COUNT = 1000; + +class NumberReference { + value = 0; +} + +// Builds an array of imports from the 'from' to the 'to' entry where 'from' +// is on the front of the array and the item just before 'to' is on the +// back of the array. +export function buildImportTree( + to: string, + from: string, + next: (from: string) => string[], + token: CancellationToken +): string[] { + const totalCountRef = new NumberReference(); + const results = _buildImportTreeImpl(to, from, next, [], totalCountRef, token); + + // Result should always have the 'from' node in it. + return results.length > 0 ? results : [from]; +} + +function _buildImportTreeImpl( + to: string, + from: string, + next: (from: string) => string[], + previous: string[], + totalSearched: NumberReference, + token: CancellationToken +): string[] { + // Exit early if cancellation is requested or we've exceeded max count + if (totalSearched.value > MAX_TREE_SEARCH_COUNT || token.isCancellationRequested) { + return []; + } + totalSearched.value += 1; + + if (from === to) { + // At the top, previous should have our way into this recursion. + return previous.length ? previous : [from]; + } + + if (previous.length > 1 && previous.find((s) => s === from)) { + // Fail the search, we're stuck in a loop. + return []; + } + + const nextEntries = next(from); + for (let i = 0; i < nextEntries.length && !token.isCancellationRequested; i++) { + // Do a search through the next level to get to the 'to' entry. + const subentries = _buildImportTreeImpl(to, nextEntries[i], next, [...previous, from], totalSearched, token); + + if (subentries.length > 0) { + return subentries; + } + } + + // Search failed on this tree. Fail so we can exit recursion. + return []; +} diff --git a/packages/pyright-internal/src/analyzer/staticExpressions.ts b/packages/pyright-internal/src/analyzer/staticExpressions.ts index 9f4649f57..9e75b18b9 100644 --- a/packages/pyright-internal/src/analyzer/staticExpressions.ts +++ b/packages/pyright-internal/src/analyzer/staticExpressions.ts @@ -4,8 +4,8 @@ * Licensed under the MIT license. * Author: Eric Traut * - * Collection of static methods that operate on expressions - * (parse node trees). + * Functions that operate on expressions (parse node trees) + * whose values can be evaluated statically. */ import { ExecutionEnvironment, PythonPlatform } from '../common/configOptions'; @@ -118,11 +118,15 @@ export function evaluateStaticBoolExpression( } } else { // Handle the special case of == 'X' or != 'X'. - if ( - node.leftExpression.nodeType === ParseNodeType.Name && - node.rightExpression.nodeType === ParseNodeType.StringList - ) { - const constantValue = definedConstants.get(node.leftExpression.value); + if (node.rightExpression.nodeType === ParseNodeType.StringList) { + let constantValue: string | number | boolean | undefined; + + if (node.leftExpression.nodeType === ParseNodeType.Name) { + constantValue = definedConstants.get(node.leftExpression.value); + } else if (node.leftExpression.nodeType === ParseNodeType.MemberAccess) { + constantValue = definedConstants.get(node.leftExpression.memberName.value); + } + if (constantValue !== undefined && typeof constantValue === 'string') { const comparisonStringName = node.rightExpression.strings.map((s) => s.value).join(''); return _evaluateStringBinaryOperation(node.operator, constantValue, comparisonStringName); @@ -144,14 +148,20 @@ export function evaluateStaticBoolExpression( if (constant !== undefined) { return !!constant; } - } else if ( - typingImportAliases && - node.nodeType === ParseNodeType.MemberAccess && - node.memberName.value === 'TYPE_CHECKING' && - node.leftExpression.nodeType === ParseNodeType.Name && - typingImportAliases.some((alias) => alias === (node.leftExpression as NameNode).value) - ) { - return true; + } else if (node.nodeType === ParseNodeType.MemberAccess) { + if ( + typingImportAliases && + node.memberName.value === 'TYPE_CHECKING' && + node.leftExpression.nodeType === ParseNodeType.Name && + typingImportAliases.some((alias) => alias === (node.leftExpression as NameNode).value) + ) { + return true; + } + + const constant = definedConstants.get(node.memberName.value); + if (constant !== undefined) { + return !!constant; + } } return undefined; diff --git a/packages/pyright-internal/src/analyzer/symbol.ts b/packages/pyright-internal/src/analyzer/symbol.ts index d604bb58d..f48c8a11c 100644 --- a/packages/pyright-internal/src/analyzer/symbol.ts +++ b/packages/pyright-internal/src/analyzer/symbol.ts @@ -212,10 +212,7 @@ export class Symbol { curDecl.isFinal = true; } - if (declaration.typeAliasAnnotation) { - curDecl.typeAliasAnnotation = declaration.typeAliasAnnotation; - curDecl.typeAliasName = declaration.typeAliasName; - } + curDecl.typeAliasName = declaration.typeAliasName; if (!curDecl.inferredTypeSource && declaration.inferredTypeSource) { curDecl.inferredTypeSource = declaration.inferredTypeSource; diff --git a/packages/pyright-internal/src/analyzer/symbolUtils.ts b/packages/pyright-internal/src/analyzer/symbolUtils.ts index 8b61951b8..00d323b64 100644 --- a/packages/pyright-internal/src/analyzer/symbolUtils.ts +++ b/packages/pyright-internal/src/analyzer/symbolUtils.ts @@ -4,11 +4,10 @@ * Licensed under the MIT license. * Author: Eric Traut * - * Collection of functions that operate on Symbol objects. + * Functions that operate on Symbol objects. */ import { Declaration, DeclarationType } from './declaration'; -import { isFinalVariableDeclaration } from './declarationUtils'; import { Symbol } from './symbol'; export function getLastTypedDeclaredForSymbol(symbol: Symbol): Declaration | undefined { @@ -36,14 +35,6 @@ export function isTypedDictMemberAccessedThroughIndex(symbol: Symbol): boolean { return false; } -export function isFinalVariable(symbol: Symbol): boolean { - return symbol.getDeclarations().some((decl) => isFinalVariableDeclaration(decl)); -} - -export function isRequiredTypedDictVariable(symbol: Symbol) { - return symbol.getDeclarations().some((decl) => decl.type === DeclarationType.Variable && !!decl.isRequired); -} - -export function isNotRequiredTypedDictVariable(symbol: Symbol) { - return symbol.getDeclarations().some((decl) => decl.type === DeclarationType.Variable && !!decl.isNotRequired); +export function isVisibleExternally(symbol: Symbol) { + return !symbol.isExternallyHidden() && !symbol.isPrivatePyTypedImport(); } diff --git a/packages/pyright-internal/src/analyzer/testWalker.ts b/packages/pyright-internal/src/analyzer/testWalker.ts index 6062828e8..c70f6300e 100644 --- a/packages/pyright-internal/src/analyzer/testWalker.ts +++ b/packages/pyright-internal/src/analyzer/testWalker.ts @@ -1,5 +1,8 @@ /* * testWalker.ts + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT license. + * Author: Eric Traut * * Walks a parse tree to validate internal consistency and completeness. */ @@ -8,6 +11,7 @@ import { ParseTreeWalker } from '../analyzer/parseTreeWalker'; import { fail } from '../common/debug'; import { TextRange } from '../common/textRange'; import { NameNode, ParseNode, ParseNodeArray, ParseNodeType } from '../parser/parseNodes'; +import { isCompliantWithNodeRangeRules } from './parseTreeUtils'; import { TypeEvaluator } from './typeEvaluatorTypes'; export class TestWalker extends ParseTreeWalker { @@ -43,21 +47,35 @@ export class TestWalker extends ParseTreeWalker { private _verifyChildRanges(node: ParseNode, children: ParseNodeArray) { let prevNode: ParseNode | undefined; + const compliant = isCompliantWithNodeRangeRules(node); children.forEach((child) => { if (child) { let skipCheck = false; - // There are a few exceptions we need to deal with here. Comment - // annotations can occur outside of an assignment node's range. - if (node.nodeType === ParseNodeType.Assignment) { - if (child === node.typeAnnotationComment) { - skipCheck = true; - } - } + if (!compliant) { + switch (node.nodeType) { + case ParseNodeType.Assignment: + // There are a few exceptions we need to deal with here. Comment + // annotations can occur outside of an assignment node's range. + if (child === node.typeAnnotationComment) { + skipCheck = true; + } + + // Portions of chained assignments can occur outside of an + // assignment node's range. + if (child.nodeType === ParseNodeType.Assignment) { + skipCheck = true; + } + break; + + case ParseNodeType.StringList: + if (child === node.typeAnnotation) { + skipCheck = true; + } + break; - if (node.nodeType === ParseNodeType.StringList) { - if (child === node.typeAnnotation) { - skipCheck = true; + default: + fail(`node ${node.nodeType} is not marked as not following range rules.`); } } diff --git a/packages/pyright-internal/src/analyzer/tracePrinter.ts b/packages/pyright-internal/src/analyzer/tracePrinter.ts index b5ff2177b..71e75d1aa 100644 --- a/packages/pyright-internal/src/analyzer/tracePrinter.ts +++ b/packages/pyright-internal/src/analyzer/tracePrinter.ts @@ -3,7 +3,7 @@ * Copyright (c) Microsoft Corporation. * Licensed under the MIT license. * - * Converts various types into a string representation. + * Converts various types into string representations. */ import { isNumber, isString } from '../common/core'; @@ -50,7 +50,7 @@ export function createTracePrinter(roots: string[]): TracePrinter { } return filePathOrModule; - } else { + } else if (filePathOrModule.nameParts) { return filePathOrModule.nameParts.join('.'); } } @@ -260,7 +260,8 @@ export function createTracePrinter(roots: string[]): TracePrinter { return printType(o as Type); } - assertNever(o); + // Do nothing, we can't print it. + return ''; } return { diff --git a/packages/pyright-internal/src/analyzer/typeCache.ts b/packages/pyright-internal/src/analyzer/typeCache.ts deleted file mode 100644 index 474d0153e..000000000 --- a/packages/pyright-internal/src/analyzer/typeCache.ts +++ /dev/null @@ -1,181 +0,0 @@ -/* - * typeCache.ts - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT license. - * Author: Eric Traut - * - * Module used by the type evaluator that caches computed types - * and stores them by node ID. - */ - -import { assert } from '../common/debug'; -import { ParseNode } from '../parser/parseNodes'; -import * as ParseTreeUtils from './parseTreeUtils'; -import { isTypeSame, Type } from './types'; - -// A type cache maps node IDs to types or pseudo-type objects. -export type TypeCache = Map; - -// An entry within the cache is either a type or an "incomplete type" -// object that refers to a type. -export type CachedType = Type | IncompleteType; - -export interface IncompleteSubtypeInfo { - type: Type | undefined; - isIncomplete: boolean; - isPending: boolean; - evaluationCount: number; -} - -export interface IncompleteType { - isIncompleteType?: true; - - // Type computed so far - type: Type | undefined; - - // Array of incomplete subtypes that have been computed so far - // (used for loops) - incompleteSubtypes: IncompleteSubtypeInfo[]; - - // Tracks whether something has changed since this cache entry - // was written that might change the incomplete type; if this - // doesn't match the global "incomplete generation count", this - // cached value is stale - generationCount: number; - - // Indicates that the cache entry represents a sentinel - // value used to detect and prevent recursion. - isRecursionSentinel?: boolean; -} - -// Define a user type guard function for IncompleteType. -export function isIncompleteType(cachedType: CachedType): cachedType is IncompleteType { - return !!(cachedType as IncompleteType).isIncompleteType; -} - -// Define an interface to track speculative entries that need to -// be cleaned up when they go out of scope. -interface TypeCacheEntry { - cache: TypeCache; - id: number; -} - -interface SpeculativeContext { - speculativeRootNode: ParseNode; - entriesToUndo: TypeCacheEntry[]; - allowCacheRetention: boolean; -} - -interface SpeculativeTypeEntry { - type: Type; - expectedType: Type | undefined; -} - -// This class maintains a stack of "speculative type contexts". When -// a context is popped off the stack, all of the speculative type cache -// entries that were created within that context are removed from the -// corresponding type caches because they are no longer valid. -// Each type context also contains a map of "speculative types" that are -// contextually evaluated based on an "expected type". -export class SpeculativeTypeTracker { - private _speculativeContextStack: SpeculativeContext[] = []; - private _speculativeTypeCache = new Map(); - - enterSpeculativeContext(speculativeRootNode: ParseNode, allowCacheRetention: boolean) { - this._speculativeContextStack.push({ - speculativeRootNode, - entriesToUndo: [], - allowCacheRetention, - }); - } - - leaveSpeculativeContext() { - assert(this._speculativeContextStack.length > 0); - const context = this._speculativeContextStack.pop(); - - // Delete all of the speculative type cache entries - // that were tracked in this context. - context!.entriesToUndo.forEach((entry) => { - entry.cache.delete(entry.id); - }); - } - - isSpeculative(node: ParseNode | undefined) { - if (this._speculativeContextStack.length === 0) { - return false; - } - - if (!node) { - return true; - } - - for (let i = this._speculativeContextStack.length - 1; i >= 0; i--) { - if (ParseTreeUtils.isNodeContainedWithin(node, this._speculativeContextStack[i].speculativeRootNode)) { - return true; - } - } - - return false; - } - - trackEntry(cache: TypeCache, id: number) { - const stackSize = this._speculativeContextStack.length; - if (stackSize > 0) { - this._speculativeContextStack[stackSize - 1].entriesToUndo.push({ - cache, - id, - }); - } - } - - // Temporarily disables speculative mode, clearing the stack - // of speculative contexts. It returns the stack so the caller - // can later restore it by calling enableSpeculativeMode. - disableSpeculativeMode() { - const stack = this._speculativeContextStack; - this._speculativeContextStack = []; - return stack; - } - - enableSpeculativeMode(stack: SpeculativeContext[]) { - assert(this._speculativeContextStack.length === 0); - this._speculativeContextStack = stack; - } - - addSpeculativeType(node: ParseNode, type: Type, expectedType: Type | undefined) { - assert(this._speculativeContextStack.length > 0); - if (this._speculativeContextStack.some((context) => !context.allowCacheRetention)) { - return; - } - - let cacheEntries = this._speculativeTypeCache.get(node.id); - if (!cacheEntries) { - cacheEntries = []; - this._speculativeTypeCache.set(node.id, cacheEntries); - } - cacheEntries.push({ type, expectedType }); - } - - getSpeculativeType(node: ParseNode, expectedType: Type | undefined) { - if ( - this._speculativeContextStack.some((context) => - ParseTreeUtils.isNodeContainedWithin(node, context.speculativeRootNode) - ) - ) { - const entries = this._speculativeTypeCache.get(node.id); - if (entries) { - for (const entry of entries) { - if (!expectedType) { - if (!entry.expectedType) { - return entry.type; - } - } else if (entry.expectedType && isTypeSame(expectedType, entry.expectedType)) { - return entry.type; - } - } - } - } - - return undefined; - } -} diff --git a/packages/pyright-internal/src/analyzer/typeCacheUtils.ts b/packages/pyright-internal/src/analyzer/typeCacheUtils.ts new file mode 100644 index 000000000..342e4b811 --- /dev/null +++ b/packages/pyright-internal/src/analyzer/typeCacheUtils.ts @@ -0,0 +1,151 @@ +/* + * typeCacheUtils.ts + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT license. + * Author: Eric Traut + * + * Utilities for managing type caches. + */ + +import { assert } from '../common/debug'; +import { ParseNode } from '../parser/parseNodes'; +import * as ParseTreeUtils from './parseTreeUtils'; +import { isTypeSame, Type } from './types'; + +// Define an interface to track speculative entries that need to +// be cleaned up when they go out of scope. +interface SpeculativeEntry { + cache: Map; + id: number; +} + +interface SpeculativeContext { + speculativeRootNode: ParseNode; + entriesToUndo: SpeculativeEntry[]; + allowCacheRetention: boolean; +} + +export interface TypeResult { + type: Type; + isIncomplete?: boolean; +} + +export interface SpeculativeTypeEntry { + typeResult: TypeResult; + expectedType: Type | undefined; + incompleteGenerationCount: number; +} + +// This class maintains a stack of "speculative type contexts". When +// a context is popped off the stack, all of the speculative type cache +// entries that were created within that context are removed from the +// corresponding type caches because they are no longer valid. +// Each type context also contains a map of "speculative types" that are +// contextually evaluated based on an "expected type". +export class SpeculativeTypeTracker { + private _speculativeContextStack: SpeculativeContext[] = []; + private _speculativeTypeCache = new Map(); + + enterSpeculativeContext(speculativeRootNode: ParseNode, allowCacheRetention: boolean) { + this._speculativeContextStack.push({ + speculativeRootNode, + entriesToUndo: [], + allowCacheRetention, + }); + } + + leaveSpeculativeContext() { + assert(this._speculativeContextStack.length > 0); + const context = this._speculativeContextStack.pop(); + + // Delete all of the speculative type cache entries + // that were tracked in this context. + context!.entriesToUndo.forEach((entry) => { + entry.cache.delete(entry.id); + }); + } + + isSpeculative(node: ParseNode | undefined) { + if (this._speculativeContextStack.length === 0) { + return false; + } + + if (!node) { + return true; + } + + for (let i = this._speculativeContextStack.length - 1; i >= 0; i--) { + if (ParseTreeUtils.isNodeContainedWithin(node, this._speculativeContextStack[i].speculativeRootNode)) { + return true; + } + } + + return false; + } + + trackEntry(cache: Map, id: number) { + const stackSize = this._speculativeContextStack.length; + if (stackSize > 0) { + this._speculativeContextStack[stackSize - 1].entriesToUndo.push({ + cache, + id, + }); + } + } + + // Temporarily disables speculative mode, clearing the stack + // of speculative contexts. It returns the stack so the caller + // can later restore it by calling enableSpeculativeMode. + disableSpeculativeMode() { + const stack = this._speculativeContextStack; + this._speculativeContextStack = []; + return stack; + } + + enableSpeculativeMode(stack: SpeculativeContext[]) { + assert(this._speculativeContextStack.length === 0); + this._speculativeContextStack = stack; + } + + addSpeculativeType( + node: ParseNode, + typeResult: TypeResult, + incompleteGenerationCount: number, + expectedType: Type | undefined + ) { + assert(this._speculativeContextStack.length > 0); + if (this._speculativeContextStack.some((context) => !context.allowCacheRetention)) { + return; + } + + let cacheEntries = this._speculativeTypeCache.get(node.id); + if (!cacheEntries) { + cacheEntries = []; + this._speculativeTypeCache.set(node.id, cacheEntries); + } + cacheEntries.push({ typeResult, expectedType, incompleteGenerationCount }); + } + + getSpeculativeType(node: ParseNode, expectedType: Type | undefined): SpeculativeTypeEntry | undefined { + if ( + this._speculativeContextStack.some((context) => + ParseTreeUtils.isNodeContainedWithin(node, context.speculativeRootNode) + ) + ) { + const entries = this._speculativeTypeCache.get(node.id); + if (entries) { + for (const entry of entries) { + if (!expectedType) { + if (!entry.expectedType) { + return entry; + } + } else if (entry.expectedType && isTypeSame(expectedType, entry.expectedType)) { + return entry; + } + } + } + } + + return undefined; + } +} diff --git a/packages/pyright-internal/src/analyzer/typeDocStringUtils.ts b/packages/pyright-internal/src/analyzer/typeDocStringUtils.ts index c8266ae52..0f7ddad60 100644 --- a/packages/pyright-internal/src/analyzer/typeDocStringUtils.ts +++ b/packages/pyright-internal/src/analyzer/typeDocStringUtils.ts @@ -32,6 +32,7 @@ import { Type, TypeCategory, } from '../analyzer/types'; +import { addIfNotNull } from '../common/collectionUtils'; import { ModuleNode, ParseNodeType } from '../parser/parseNodes'; import { TypeEvaluator } from './typeEvaluatorTypes'; import { @@ -131,7 +132,7 @@ export function getOverloadedFunctionDocStringsInherited( for (const classMember of memberIterator) { const inheritedDecl = classMember.symbol.getDeclarations().slice(-1)[0]; - const declType = evaluator.getTypeForDeclaration(inheritedDecl); + const declType = evaluator.getTypeForDeclaration(inheritedDecl)?.type; if (declType) { docStrings = _getOverloadedFunctionDocStrings(declType, inheritedDecl, sourceMapper); if (docStrings && docStrings.length > 0) { @@ -179,6 +180,32 @@ export function getVariableInStubFileDocStrings(decl: VariableDeclaration, sourc return docStrings; } +export function getModuleDocStringFromModuleNodes(modules: ModuleNode[]): string | undefined { + for (const module of modules) { + if (module.statements) { + const docString = ParseTreeUtils.getDocString(module.statements); + if (docString) { + return docString; + } + } + } + + return undefined; +} + +export function getModuleDocStringFromPaths(filePaths: string[], sourceMapper: SourceMapper) { + const modules: ModuleNode[] = []; + for (const filePath of filePaths) { + if (isStubFile(filePath)) { + addIfNotNull(modules, sourceMapper.getModuleNode(filePath)); + } + + modules.push(...sourceMapper.findModules(filePath)); + } + + return getModuleDocStringFromModuleNodes(modules); +} + export function getModuleDocString( type: ModuleType, resolvedDecl: DeclarationBase | undefined, @@ -186,10 +213,8 @@ export function getModuleDocString( ) { let docString = type.docString; if (!docString) { - if (resolvedDecl && isStubFile(resolvedDecl.path)) { - const modules = sourceMapper.findModules(resolvedDecl.path); - docString = _getModuleNodeDocString(modules); - } + const filePath = resolvedDecl?.path ?? type.filePath; + docString = getModuleDocStringFromPaths([filePath], sourceMapper); } return docString; @@ -290,7 +315,7 @@ function _getPropertyDocStringInherited( return; } - const declaredType = evaluator.getTypeForDeclaration(decl); + const declaredType = evaluator.getTypeForDeclaration(decl)?.type; if (!declaredType || !isMaybeDescriptorInstance(declaredType)) { return; } @@ -313,7 +338,7 @@ function _getPropertyDocStringInherited( if (decls) { for (const decl of decls) { if (isFunctionDeclaration(decl)) { - const declaredType = evaluator.getTypeForDeclaration(decl); + const declaredType = evaluator.getTypeForDeclaration(decl)?.type; if (declaredType && isMaybeDescriptorInstance(declaredType)) { const docString = _getFunctionDocStringFromDeclaration(decl, sourceMapper); if (docString) { @@ -365,16 +390,3 @@ function _getFunctionOrClassDeclsDocString(decls: FunctionDeclaration[] | ClassD return undefined; } - -function _getModuleNodeDocString(modules: ModuleNode[]): string | undefined { - for (const module of modules) { - if (module.statements) { - const docString = ParseTreeUtils.getDocString(module.statements); - if (docString) { - return docString; - } - } - } - - return undefined; -} diff --git a/packages/pyright-internal/src/analyzer/typeEvaluator.ts b/packages/pyright-internal/src/analyzer/typeEvaluator.ts index a933849be..42d797a1c 100644 --- a/packages/pyright-internal/src/analyzer/typeEvaluator.ts +++ b/packages/pyright-internal/src/analyzer/typeEvaluator.ts @@ -20,13 +20,14 @@ import { Commands } from '../commands/commands'; import { throwIfCancellationRequested } from '../common/cancellationUtils'; import { appendArray } from '../common/collectionUtils'; import { DiagnosticLevel } from '../common/configOptions'; +import { ConsoleInterface } from '../common/console'; import { assert, assertNever, fail } from '../common/debug'; import { AddMissingOptionalToParamAction, DiagnosticAddendum } from '../common/diagnostic'; import { DiagnosticRule } from '../common/diagnosticRules'; import { convertOffsetsToRange, convertOffsetToPosition } from '../common/positionUtils'; import { PythonVersion } from '../common/pythonVersion'; import { TextRange } from '../common/textRange'; -import { Localizer } from '../localization/localize'; +import { Localizer, ParameterizedString } from '../localization/localize'; import { ArgumentCategory, AssignmentNode, @@ -72,6 +73,7 @@ import { TypeAnnotationNode, TypeParameterCategory, TypeParameterListNode, + TypeParameterNode, UnaryOperationNode, UnpackNode, WithItemNode, @@ -80,18 +82,18 @@ import { } from '../parser/parseNodes'; import { ParseOptions, Parser } from '../parser/parser'; import { KeywordType, OperatorType, StringTokenFlags } from '../parser/tokenizerTypes'; -import * as DeclarationUtils from './aliasDeclarationUtils'; import { AnalyzerFileInfo, ImportLookup, isAnnotationEvaluationPostponed } from './analyzerFileInfo'; import * as AnalyzerNodeInfo from './analyzerNodeInfo'; -import { CodeFlowAnalyzer, FlowNodeTypeResult, getCodeFlowEngine } from './codeFlowEngine'; +import { CodeFlowAnalyzer, FlowNodeTypeOptions, FlowNodeTypeResult, getCodeFlowEngine } from './codeFlowEngine'; import { CodeFlowReferenceExpressionNode, createKeyForReference, FlowNode, isCodeFlowSupportedForReference, + wildcardImportReferenceKey, } from './codeFlowTypes'; import { assignTypeToTypeVar, populateTypeVarContextBasedOnExpectedType } from './constraintSolver'; -import { applyConstructorTransform } from './constructorTransform'; +import { applyConstructorTransform, hasConstructorTransform } from './constructorTransform'; import { applyDataClassClassBehaviorOverrides, applyDataClassDecorator, @@ -111,9 +113,8 @@ import { createSynthesizedAliasDeclaration, getDeclarationsWithUsesLocalNameRemoved, getNameNodeForDeclaration, - isExplicitTypeAliasDeclaration, - isFinalVariableDeclaration, - isPossibleTypeAliasDeclaration, + resolveAliasDeclaration as resolveAliasDeclarationUtil, + ResolvedAliasInfo, } from './declarationUtils'; import { createEnumType, @@ -125,8 +126,14 @@ import { } from './enums'; import { applyFunctionTransform } from './functionTransform'; import { createNamedTupleType } from './namedTuples'; +import { + getParameterListDetails, + ParameterListDetails, + ParameterSource, + VirtualParameterDetails, +} from './parameterUtils'; import * as ParseTreeUtils from './parseTreeUtils'; -import { assignTypeToPatternTargets, narrowTypeBasedOnPattern } from './patternMatching'; +import { assignTypeToPatternTargets, checkForUnusedPattern, narrowTypeBasedOnPattern } from './patternMatching'; import { assignProperty, clonePropertyWithDeleter, @@ -140,12 +147,13 @@ import * as ScopeUtils from './scopeUtils'; import { evaluateStaticBoolExpression } from './staticExpressions'; import { indeterminateSymbolId, Symbol, SymbolFlags } from './symbol'; import { isConstantName, isPrivateName, isPrivateOrProtectedName } from './symbolNameUtils'; -import { getLastTypedDeclaredForSymbol, isFinalVariable } from './symbolUtils'; -import { CachedType, isIncompleteType, SpeculativeTypeTracker, TypeCache } from './typeCache'; +import { getLastTypedDeclaredForSymbol } from './symbolUtils'; +import { SpeculativeTypeTracker } from './typeCacheUtils'; import { assignToTypedDict, assignTypedDictToTypedDict as assignTypedDictToTypedDict, createTypedDictType, + createTypedDictTypeInlined, getTypedDictMembersForClass, getTypeOfIndexedTypedDict, synthesizeTypedDictClassMethods, @@ -153,17 +161,21 @@ import { import { AbstractMethod, AnnotationTypeOptions, + ArgResult, CallResult, CallSignature, CallSignatureInfo, ClassTypeResult, + DeclaredSymbolTypeInfo, EffectiveTypeResult, EvaluatorFlags, EvaluatorUsage, + ExpectedTypeOptions, ExpectedTypeResult, FunctionArgument, FunctionTypeResult, maxSubtypesForInferredType, + PrintTypeOptions, TypeEvaluator, TypeResult, TypeResultWithNode, @@ -208,7 +220,6 @@ import { NeverType, NoneType, OverloadedFunctionType, - ParamSpecEntry, removeFromUnion, removeNoneFromUnion, removeUnbound, @@ -237,40 +248,51 @@ import { ClassMember, ClassMemberLookupFlags, combineSameSizedTuples, + combineVariances, computeMroLinearization, containsLiteralType, containsUnknown, convertParamSpecValueToType, convertToInstance, convertToInstantiable, + convertTypeToParamSpecValue, derivesFromClassRecursive, doForEachSubtype, + ensureFunctionSignaturesAreUnique, explodeGenericClass, + getContainerDepth, getDeclaredGeneratorReturnType, getGeneratorTypeArgs, + getGeneratorYieldType, getLiteralTypeClassName, - getParameterListDetails, getSpecializedTupleType, getTypeCondition, getTypeVarArgumentsRecursive, getTypeVarScopeId, getUnionSubtypeCount, + InferenceContext, + isDescriptorInstance, + isEffectivelyInstantiable, isEllipsisType, + isIncompleteUnknown, isLiteralType, isMaybeDescriptorInstance, + isMetaclassInstance, isOptionalType, isPartlyUnknown, isProperty, isTupleClass, isTypeAliasPlaceholder, isTypeAliasRecursive, + isTypeVarLimitedToCallable, + isTypeVarSame, isUnboundedTupleClass, isUnionableType, + isVarianceOfTypeArgumentCompatible, lookUpClassMember, lookUpObjectMember, + makeInferenceContext, mapSubtypes, - ParameterListDetails, - ParameterSource, partiallySpecializeType, preserveUnknown, removeParamSpecVariadicsFromFunction, @@ -284,9 +306,10 @@ import { specializeTupleClass, synthesizeTypeVarForSelfCls, transformPossibleRecursiveTypeAlias, - VirtualParameterDetails, + UniqueSignatureTracker, + validateTypeVarDefault, } from './typeUtils'; -import { TypeVarContext } from './typeVarContext'; +import { TypeVarContext, TypeVarSignatureContext } from './typeVarContext'; const enum MemberAccessFlags { None = 0, @@ -337,6 +360,14 @@ interface ValidateTypeArgsOptions { allowUnpackedTuples?: boolean; } +interface GetTypeArgsOptions { + isAnnotatedClass?: boolean; + hasCustomClassGetItem?: boolean; + isFinalAnnotation?: boolean; + isClassVarAnnotation?: boolean; + supportsTypedDictTypeArg?: boolean; +} + interface MatchArgsToParamsResult { overload: FunctionType; overloadIndex: number; @@ -353,14 +384,6 @@ interface MatchArgsToParamsResult { relevance: number; } -interface ArgResult { - isCompatible: boolean; - argType: Type; - isTypeIncomplete?: boolean | undefined; - condition?: TypeCondition[]; - skippedOverloadArg?: boolean; -} - interface ClassMemberLookup { symbol: Symbol | undefined; @@ -388,6 +411,12 @@ export interface DescriptorTypeResult { isAsymmetricDescriptor: boolean; } +interface ScopedTypeVarResult { + type: TypeVarType; + isRescoped: boolean; + foundInterveningClass: boolean; +} + interface AliasMapEntry { alias: string; module: 'builtins' | 'collections' | 'self'; @@ -399,6 +428,14 @@ interface ParamAssignmentInfo { isPositionalOnly: boolean; } +interface MatchedOverloadInfo { + overload: FunctionType; + matchResults: MatchArgsToParamsResult; + typeVarContext: TypeVarContext; + argResults: ArgResult[]; + returnType: Type; +} + // Maps binary operators to the magic methods that implement them. const binaryOperatorMap: { [operator: number]: [string, string] } = { [OperatorType.Add]: ['__add__', '__radd__'], @@ -414,12 +451,12 @@ const binaryOperatorMap: { [operator: number]: [string, string] } = { [OperatorType.BitwiseXor]: ['__xor__', '__rxor__'], [OperatorType.LeftShift]: ['__lshift__', '__rlshift__'], [OperatorType.RightShift]: ['__rshift__', '__rrshift__'], - [OperatorType.Equals]: ['__eq__', '__ne__'], - [OperatorType.NotEquals]: ['__ne__', '__eq__'], - [OperatorType.LessThan]: ['__lt__', '__ge__'], - [OperatorType.LessThanOrEqual]: ['__le__', '__gt__'], - [OperatorType.GreaterThan]: ['__gt__', '__le__'], - [OperatorType.GreaterThanOrEqual]: ['__ge__', '__lt__'], + [OperatorType.Equals]: ['__eq__', '__eq__'], + [OperatorType.NotEquals]: ['__ne__', '__ne__'], + [OperatorType.LessThan]: ['__lt__', '__gt__'], + [OperatorType.LessThanOrEqual]: ['__le__', '__ge__'], + [OperatorType.GreaterThan]: ['__gt__', '__lt__'], + [OperatorType.GreaterThanOrEqual]: ['__ge__', '__le__'], }; // Map of operators that always return a bool result. @@ -498,7 +535,12 @@ const maxReturnTypeInferenceArgumentCount = 6; // we will analyze to determine the return type of a function // when its parameters are unannotated? We want to keep this // pretty low because this can be very costly. -const maxReturnTypeInferenceCodeFlowComplexity = 8; +const maxReturnTypeInferenceCodeFlowComplexity = 32; + +// What is the max complexity of the code flow graph for +// call-site type inference? This is very expensive, so we +// want to keep this very low. +const maxReturnCallSiteTypeInferenceCodeFlowComplexity = 8; // What is the max number of return types cached per function // when using call-site inference? @@ -514,6 +556,10 @@ const maxEntriesToUseForInference = 64; // to avoid excessive computation. const maxDeclarationsToUseForInference = 64; +// Maximum number of times to attempt effective type evaluation +// of a variable that has no type declaration. +const maxEffectiveTypeEvaluationAttempts = 16; + // Maximum number of combinatoric union type expansions allowed // when resolving an overload. const maxOverloadUnionExpansionCount = 64; @@ -522,6 +568,18 @@ const maxOverloadUnionExpansionCount = 64; // that can be concurrently pending before we give up. const maxInferFunctionReturnRecursionCount = 12; +// In certain loops, it's possible to construct arbitrarily-deep containers +// (tuples, lists, sets, or dicts) which can lead to infinite type analysis. +// This limits the depth. +const maxInferredContainerDepth = 8; + +// Maximum recursion amount when comparing two recursive type aliases. +// Increasing this can greatly increase the time required to evaluate +// two recursive type aliases that have the same definition. Decreasing +// it can increase the chance of false negatives for such recursive +// type aliases. +const maxRecursiveTypeAliasRecursionCount = 10; + // This switch enables a special debug mode that attempts to catch // bugs due to inconsistent evaluation flags used when reading types // from the type cache. @@ -544,7 +602,6 @@ export interface EvaluatorOptions { printTypeFlags: TypePrinter.PrintTypeFlags; logCalls: boolean; minimumLoggingThreshold: number; - analyzeUnannotatedFunctions: boolean; evaluateUnknownImportsAsAny: boolean; verifyTypeCacheEvaluatorFlags: boolean; } @@ -558,16 +615,26 @@ interface ClassTypeHook { callback: () => void; } +interface TypeCacheEntry { + typeResult: TypeResult; + incompleteGenerationCount: number; + flags: EvaluatorFlags | undefined; +} + +interface BinaryOperationOptions { + isLiteralMathAllowed?: boolean; + isTupleAddAllowed?: boolean; +} + export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions: EvaluatorOptions): TypeEvaluator { const symbolResolutionStack: SymbolResolutionStackEntry[] = []; - const typeCacheFlags = new Map(); const asymmetricDescriptorAssignmentCache = new Set(); const speculativeTypeTracker = new SpeculativeTypeTracker(); const suppressedNodeStack: ParseNode[] = []; let functionRecursionMap = new Set(); let codeFlowAnalyzerCache = new Map(); - let typeCache: TypeCache = new Map(); + let typeCache = new Map(); let effectiveTypeCache = new Map>(); let expectedTypeCache = new Map(); let classTypeHooks: ClassTypeHook[] = []; @@ -584,11 +651,12 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions let strClassType: Type | undefined; let dictClassType: Type | undefined; let typedDictClassType: Type | undefined; - let incompleteTypeCache: TypeCache | undefined; + let typedDictPrivateClassType: Type | undefined; let printExpressionSpaceCount = 0; + let incompleteGenerationCount = 0; const returnTypeInferenceContextStack: ReturnTypeInferenceContext[] = []; - let returnTypeInferenceTypeCache: TypeCache | undefined; + let returnTypeInferenceTypeCache: Map | undefined; function runWithCancellationToken(token: CancellationToken, callback: () => T): T { try { @@ -618,41 +686,41 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions function disposeEvaluator() { functionRecursionMap = new Set(); codeFlowAnalyzerCache = new Map(); - typeCache = new Map(); + typeCache = new Map(); effectiveTypeCache = new Map>(); expectedTypeCache = new Map(); } - function isTypeCached(node: ParseNode) { - let cachedType: CachedType | undefined; - + function readTypeCacheEntry(node: ParseNode) { + // Should we use a temporary cache associated with a contextual + // analysis of a function, contextualized based on call-site argument types? if (returnTypeInferenceTypeCache && isNodeInReturnTypeInferenceContext(node)) { - cachedType = returnTypeInferenceTypeCache.get(node.id); + return returnTypeInferenceTypeCache.get(node.id); } else { - cachedType = typeCache.get(node.id); + return typeCache.get(node.id); } - - return cachedType !== undefined; } - function readTypeCache(node: ParseNode, flags: EvaluatorFlags | undefined): Type | undefined { - let cachedType: CachedType | undefined; - - // Should we use a temporary cache associated with a contextual - // analysis of a function, contextualized based on call-site argument types? - if (returnTypeInferenceTypeCache && isNodeInReturnTypeInferenceContext(node)) { - cachedType = returnTypeInferenceTypeCache.get(node.id); - } else { - cachedType = typeCache.get(node.id); + function isTypeCached(node: ParseNode) { + const cacheEntry = readTypeCacheEntry(node); + if (!cacheEntry) { + return false; } - if (cachedType === undefined) { + return ( + !cacheEntry.typeResult.isIncomplete || cacheEntry.incompleteGenerationCount === incompleteGenerationCount + ); + } + + function readTypeCache(node: ParseNode, flags: EvaluatorFlags | undefined): Type | undefined { + const cacheEntry = readTypeCacheEntry(node); + if (!cacheEntry || cacheEntry.typeResult.isIncomplete) { return undefined; } if (evaluatorOptions.verifyTypeCacheEvaluatorFlags || verifyTypeCacheEvaluatorFlags) { if (flags !== undefined) { - const expectedFlags = typeCacheFlags.get(node.id); + const expectedFlags = cacheEntry.flags; if (expectedFlags !== undefined && flags !== expectedFlags) { const fileInfo = AnalyzerNodeInfo.getFileInfo(node); @@ -672,25 +740,16 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } } - assert(!isIncompleteType(cachedType)); - return cachedType as Type; + return cacheEntry.typeResult.type; } function writeTypeCache( node: ParseNode, - type: Type, + typeResult: TypeResult, flags: EvaluatorFlags | undefined, - isIncomplete: boolean, - expectedType?: Type, + inferenceContext?: InferenceContext, allowSpeculativeCaching = false ) { - if (isIncomplete) { - if (incompleteTypeCache) { - incompleteTypeCache.set(node.id, type); - } - return; - } - // Should we use a temporary cache associated with a contextual // analysis of a function, contextualized based on call-site argument types? const typeCacheToUse = @@ -698,36 +757,35 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions ? returnTypeInferenceTypeCache : typeCache; - typeCacheToUse.set(node.id, type); - - if (evaluatorOptions.verifyTypeCacheEvaluatorFlags || verifyTypeCacheEvaluatorFlags) { - if (typeCacheToUse === typeCache && flags !== undefined) { - typeCacheFlags.set(node.id, flags); + if (!typeResult.isIncomplete) { + incompleteGenerationCount++; + } else { + const oldValue = typeCacheToUse.get(node.id); + if (oldValue !== undefined && !isTypeSame(typeResult.type, oldValue.typeResult.type)) { + incompleteGenerationCount++; } } + typeCacheToUse.set(node.id, { typeResult, flags, incompleteGenerationCount: incompleteGenerationCount }); + // If the entry is located within a part of the parse tree that is currently being // "speculatively" evaluated, track it so we delete the cached entry when we leave // this speculative context. if (speculativeTypeTracker.isSpeculative(node)) { speculativeTypeTracker.trackEntry(typeCacheToUse, node.id); if (allowSpeculativeCaching) { - speculativeTypeTracker.addSpeculativeType(node, type, expectedType); + speculativeTypeTracker.addSpeculativeType( + node, + typeResult, + incompleteGenerationCount, + inferenceContext?.expectedType + ); } } } - function deleteTypeCacheEntry(node: ParseNode) { - const typeCacheToUse = - returnTypeInferenceTypeCache && isNodeInReturnTypeInferenceContext(node) - ? returnTypeInferenceTypeCache - : typeCache; - - typeCacheToUse.delete(node.id); - } - function setTypeForNode(node: ParseNode, type: Type = UnknownType.create(), flags = EvaluatorFlags.None) { - writeTypeCache(node, type, flags, /* isIncomplete */ false); + writeTypeCache(node, { type }, flags); } function setAsymmetricDescriptorAssignment(node: ParseNode) { @@ -827,6 +885,17 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions })?.type; } + function getTypeResult(node: ExpressionNode): TypeResult | undefined { + return evaluateTypeForSubnode(node, () => { + evaluateTypesForExpressionInContext(node); + }); + } + + // Reads the type of the node from the cache. + function getCachedType(node: ExpressionNode): Type | undefined { + return readTypeCache(node, EvaluatorFlags.None); + } + // Determines the expected type of a specified node based on surrounding // context. For example, if it's a subexpression of an argument expression, // the associated parameter type might inform the expected type. @@ -888,34 +957,48 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions intClassType = getBuiltInType(node, 'int'); strClassType = getBuiltInType(node, 'str'); dictClassType = getBuiltInType(node, 'dict'); - typedDictClassType = getTypingType(node, '_TypedDict'); + typedDictClassType = getTypingType(node, 'TypedDict'); + typedDictPrivateClassType = getTypingType(node, '_TypedDict'); } } - function getTypeOfExpression(node: ExpressionNode, flags = EvaluatorFlags.None, expectedType?: Type): TypeResult { + function getTypeOfExpression( + node: ExpressionNode, + flags = EvaluatorFlags.None, + inferenceContext?: InferenceContext + ): TypeResult { // Is this type already cached? - const cachedType = readTypeCache(node, flags); - if (cachedType) { + const cacheEntry = readTypeCacheEntry(node); + if ( + cacheEntry && + (!cacheEntry.typeResult.isIncomplete || cacheEntry.incompleteGenerationCount === incompleteGenerationCount) + ) { if (printExpressionTypes) { console.log( `${getPrintExpressionTypesSpaces()}${ParseTreeUtils.printExpression(node)} (${getLineNum( node - )}): Cached ${printType(cachedType)}` + )}): Cached ${printType(cacheEntry.typeResult.type)} ${ + cacheEntry.typeResult.typeErrors ? ' Errors' : '' + }` ); } - return { type: cachedType }; + return cacheEntry.typeResult; } else { // Is it cached in the speculative type cache? - const speculativeCachedType = speculativeTypeTracker.getSpeculativeType(node, expectedType); - if (speculativeCachedType) { + const cacheEntry = speculativeTypeTracker.getSpeculativeType(node, inferenceContext?.expectedType); + if ( + cacheEntry && + (!cacheEntry.typeResult.isIncomplete || + cacheEntry.incompleteGenerationCount === incompleteGenerationCount) + ) { if (printExpressionTypes) { console.log( `${getPrintExpressionTypesSpaces()}${ParseTreeUtils.printExpression(node)} (${getLineNum( node - )}): Speculative ${printType(speculativeCachedType)}` + )}): Speculative ${printType(cacheEntry.typeResult.type)}` ); } - return { type: speculativeCachedType }; + return cacheEntry.typeResult; } } @@ -931,7 +1014,9 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // will be thrown at this point. checkForCancellation(); - expectedType = transformPossibleRecursiveTypeAlias(expectedType); + if (inferenceContext) { + inferenceContext.expectedType = transformPossibleRecursiveTypeAlias(inferenceContext.expectedType); + } // If we haven't already fetched some core type definitions from the // typeshed stubs, do so here. It would be better to fetch this when it's @@ -959,12 +1044,12 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } case ParseNodeType.Call: { - typeResult = getTypeOfCall(node, expectedType, flags); + typeResult = getTypeOfCall(node, inferenceContext, flags); break; } case ParseNodeType.Tuple: { - typeResult = getTypeOfTuple(node, expectedType, flags); + typeResult = getTypeOfTuple(node, inferenceContext, flags); break; } @@ -998,23 +1083,23 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } case ParseNodeType.UnaryOperation: { - typeResult = getTypeOfUnaryOperation(node, expectedType); + typeResult = getTypeOfUnaryOperation(node, inferenceContext); break; } case ParseNodeType.BinaryOperation: { - typeResult = getTypeOfBinaryOperation(node, expectedType, flags); + typeResult = getTypeOfBinaryOperation(node, inferenceContext, flags); break; } case ParseNodeType.AugmentedAssignment: { - typeResult = getTypeOfAugmentedAssignment(node, expectedType); + typeResult = getTypeOfAugmentedAssignment(node, inferenceContext); break; } case ParseNodeType.List: case ParseNodeType.Set: { - typeResult = getTypeOfListOrSet(node, expectedType); + typeResult = getTypeOfListOrSet(node, inferenceContext); break; } @@ -1024,27 +1109,27 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } case ParseNodeType.Await: { - typeResult = getTypeOfAwaitOperator(node, flags, expectedType); + typeResult = getTypeOfAwaitOperator(node, flags, inferenceContext); break; } case ParseNodeType.Ternary: { - typeResult = getTypeOfTernary(node, flags, expectedType); + typeResult = getTypeOfTernary(node, flags, inferenceContext); break; } case ParseNodeType.ListComprehension: { - typeResult = getTypeOfListComprehension(node, expectedType); + typeResult = getTypeOfListComprehension(node, inferenceContext); break; } case ParseNodeType.Dictionary: { - typeResult = getTypeOfDictionary(node, expectedType); + typeResult = getTypeOfDictionary(node, inferenceContext); break; } case ParseNodeType.Lambda: { - typeResult = getTypeOfLambda(node, expectedType); + typeResult = getTypeOfLambda(node, inferenceContext); break; } @@ -1053,7 +1138,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions assignTypeToExpression( node.leftExpression, typeResult.type, - /* isTypeIncomplete */ false, + !!typeResult.isIncomplete, node.rightExpression, /* ignoreEmptyContainers */ true, /* allowAssignmentToFinalVar */ true @@ -1066,7 +1151,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions assignTypeToExpression( node.name, typeResult.type, - /* isTypeIncomplete */ false, + !!typeResult.isIncomplete, node.rightExpression, /* ignoreEmptyContainers */ true ); @@ -1084,7 +1169,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } case ParseNodeType.Unpack: { - typeResult = getTypeOfUnpackOperator(node, flags, expectedType); + typeResult = getTypeOfUnpackOperator(node, flags, inferenceContext); break; } @@ -1094,8 +1179,8 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions EvaluatorFlags.ExpectingType | EvaluatorFlags.ExpectingTypeAnnotation | EvaluatorFlags.EvaluateStringLiteralAsType | - EvaluatorFlags.ParamSpecDisallowed | - EvaluatorFlags.TypeVarTupleDisallowed | + EvaluatorFlags.DisallowParamSpec | + EvaluatorFlags.DisallowTypeVarTuple | EvaluatorFlags.VariableTypeAnnotation ); break; @@ -1120,7 +1205,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } default: - assertNever(node); + assertNever(node, `Illegal node type: ${(node as any).nodeType}`); } if (!typeResult) { @@ -1129,18 +1214,14 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } if (reportExpectingTypeErrors && !typeResult.isIncomplete) { - if (flags & EvaluatorFlags.TypeVarTupleDisallowed) { - if ( - isTypeVar(typeResult.type) && - typeResult.type.details.isVariadic && - !typeResult.type.isVariadicInUnion - ) { + if (flags & EvaluatorFlags.DisallowTypeVarTuple) { + if (isVariadicTypeVar(typeResult.type) && !typeResult.type.isVariadicInUnion) { addError(Localizer.Diagnostic.typeVarTupleContext(), node); typeResult.type = UnknownType.create(); } } - if (!TypeBase.isInstantiable(typeResult.type)) { + if (!isEffectivelyInstantiable(typeResult.type)) { const isEmptyVariadic = isClassInstance(typeResult.type) && ClassType.isTupleClass(typeResult.type) && @@ -1149,27 +1230,39 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions if (!isEmptyVariadic) { addExpectedClassDiagnostic(typeResult.type, node); typeResult.type = UnknownType.create(); + typeResult.typeErrors = true; } } } - if (flags & EvaluatorFlags.DisallowRecursiveTypeAliasPlaceholder) { - if (isTypeAliasPlaceholder(typeResult.type)) { - typeResult.type.details.illegalRecursionDetected = true; - } - } + writeTypeCache(node, typeResult, flags, inferenceContext, /* allowSpeculativeCaching */ true); - writeTypeCache( - node, - typeResult.type, - flags, - !!typeResult.isIncomplete, - expectedType, - /* allowSpeculativeCaching */ true - ); + if ( + inferenceContext && + !isAnyOrUnknown(inferenceContext.expectedType) && + !isNever(inferenceContext.expectedType) + ) { + expectedTypeCache.set(node.id, inferenceContext.expectedType); - if (expectedType && !isAnyOrUnknown(expectedType) && !isNever(expectedType)) { - expectedTypeCache.set(node.id, expectedType); + if (!typeResult.isIncomplete && !typeResult.expectedTypeDiagAddendum) { + const diag = new DiagnosticAddendum(); + + // Make sure the resulting type is assignable to the expected type. + // Use the "solve for scopes" of the associated typeVarContext if + // it is provided. + if ( + !assignType( + inferenceContext.expectedType, + typeResult.type, + diag, + new TypeVarContext(inferenceContext.typeVarContext?.getSolveForScopes()) + ) + ) { + typeResult.typeErrors = true; + typeResult.expectedTypeDiagAddendum = diag; + diag.addTextRange(node); + } + } } if (printExpressionTypes) { @@ -1184,12 +1277,12 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions return typeResult; } - function getTypeOfAwaitOperator(node: AwaitNode, flags: EvaluatorFlags, expectedType?: Type) { - const effectiveExpectedType = expectedType - ? createAwaitableReturnType(node, expectedType, /* isGenerator */ false) + function getTypeOfAwaitOperator(node: AwaitNode, flags: EvaluatorFlags, inferenceContext?: InferenceContext) { + const effectiveExpectedType = inferenceContext + ? createAwaitableReturnType(node, inferenceContext.expectedType, /* isGenerator */ false) : undefined; - const exprTypeResult = getTypeOfExpression(node.expression, flags, effectiveExpectedType); + const exprTypeResult = getTypeOfExpression(node.expression, flags, makeInferenceContext(effectiveExpectedType)); const typeResult: TypeResult = { type: getTypeOfAwaitable(exprTypeResult.type, node.expression), }; @@ -1223,23 +1316,27 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions return typeResult; } - function getTypeOfUnpackOperator(node: UnpackNode, flags: EvaluatorFlags, expectedType?: Type) { + function getTypeOfUnpackOperator(node: UnpackNode, flags: EvaluatorFlags, inferenceContext?: InferenceContext) { let typeResult: TypeResult | undefined; let iterExpectedType: Type | undefined; - if (expectedType) { + if (inferenceContext) { const iterableType = getBuiltInType(node, 'Iterable'); if (iterableType && isInstantiableClass(iterableType)) { iterExpectedType = ClassType.cloneAsInstance( - ClassType.cloneForSpecialization(iterableType, [expectedType], /* isTypeArgumentExplicit */ true) + ClassType.cloneForSpecialization( + iterableType, + [inferenceContext.expectedType], + /* isTypeArgumentExplicit */ true + ) ); } } - const iterTypeResult = getTypeOfExpression(node.expression, flags, iterExpectedType); + const iterTypeResult = getTypeOfExpression(node.expression, flags, makeInferenceContext(iterExpectedType)); const iterType = iterTypeResult.type; if ( - (flags & EvaluatorFlags.TypeVarTupleDisallowed) === 0 && + (flags & EvaluatorFlags.DisallowTypeVarTuple) === 0 && isVariadicTypeVar(iterType) && !iterType.isVariadicUnpacked ) { @@ -1252,10 +1349,15 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions ) { typeResult = { type: ClassType.cloneForUnpacked(iterType) }; } else { - const type = - getTypeOfIterator(iterType, /* isAsync */ false, node) ?? - UnknownType.create(!!iterTypeResult.isIncomplete); - typeResult = { type, unpackedType: iterType, isIncomplete: iterTypeResult.isIncomplete }; + const iteratorTypeResult = getTypeOfIterator(iterTypeResult, /* isAsync */ false, node) ?? { + type: UnknownType.create(!!iterTypeResult.isIncomplete), + isIncomplete: iterTypeResult.isIncomplete, + }; + typeResult = { + type: iteratorTypeResult.type, + unpackedType: iterType, + isIncomplete: iteratorTypeResult.isIncomplete, + }; } } return typeResult; @@ -1366,20 +1468,22 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions node.expressions.forEach((expr) => { const exprType = getTypeOfExpression(expr).type; - if (!isClassInstance(exprType)) { - isLiteralString = false; - return; - } + doForEachSubtype(exprType, (exprSubtype) => { + if (!isClassInstance(exprSubtype)) { + isLiteralString = false; + return; + } - if (ClassType.isBuiltIn(exprType, 'LiteralString')) { - return; - } + if (ClassType.isBuiltIn(exprSubtype, 'LiteralString')) { + return; + } - if (ClassType.isBuiltIn(exprType, 'str') && exprType.literalValue !== undefined) { - return; - } + if (ClassType.isBuiltIn(exprSubtype, 'str') && exprSubtype.literalValue !== undefined) { + return; + } - isLiteralString = false; + isLiteralString = false; + }); }); if (!isBytes && isLiteralString) { @@ -1404,33 +1508,34 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } function stripLiteralValue(type: Type): Type { - if (isClass(type)) { - if (type.literalValue !== undefined) { - type = ClassType.cloneWithLiteral(type, /* value */ undefined); - } else if (ClassType.isBuiltIn(type, 'LiteralString')) { - // Handle "LiteralString" specially. - if (strClassType && isInstantiableClass(strClassType)) { - type = ClassType.cloneAsInstance(strClassType); + return mapSubtypes(type, (subtype) => { + if (isClass(subtype)) { + if (subtype.literalValue !== undefined) { + return ClassType.cloneWithLiteral(subtype, /* value */ undefined); } - } - return type; - } + if (ClassType.isBuiltIn(subtype, 'LiteralString')) { + // Handle "LiteralString" specially. + if (strClassType && isInstantiableClass(strClassType)) { + let strInstance = ClassType.cloneAsInstance(strClassType); - if (isUnion(type)) { - return mapSubtypes(type, (subtype) => { - return stripLiteralValue(subtype); - }); - } + if (subtype.condition) { + strInstance = TypeBase.cloneForCondition(strInstance, getTypeCondition(subtype)); + } - return type; + return strInstance; + } + } + } + + return subtype; + }); } function getTypeOfParameterAnnotation(paramTypeNode: ExpressionNode, paramCategory: ParameterCategory) { return getTypeOfAnnotation(paramTypeNode, { associateTypeVarsWithScope: true, allowTypeVarTuple: paramCategory === ParameterCategory.VarArgList, - disallowRecursiveTypeAlias: true, allowUnpackedTypedDict: paramCategory === ParameterCategory.VarArgDictionary, allowUnpackedTuple: paramCategory === ParameterCategory.VarArgList, }); @@ -1459,21 +1564,21 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } if (!options?.allowFinal) { - evaluatorFlags |= EvaluatorFlags.FinalDisallowed; + evaluatorFlags |= EvaluatorFlags.DisallowFinal; } if (!options?.allowClassVar) { - evaluatorFlags |= EvaluatorFlags.ClassVarDisallowed; + evaluatorFlags |= EvaluatorFlags.DisallowClassVar; } if (!options?.allowTypeVarTuple) { - evaluatorFlags |= EvaluatorFlags.TypeVarTupleDisallowed; + evaluatorFlags |= EvaluatorFlags.DisallowTypeVarTuple; } else { evaluatorFlags |= EvaluatorFlags.AllowUnpackedTupleOrTypeVarTuple; } if (!options?.allowParamSpec) { - evaluatorFlags |= EvaluatorFlags.ParamSpecDisallowed; + evaluatorFlags |= EvaluatorFlags.DisallowParamSpec; } if (options?.associateTypeVarsWithScope) { @@ -1482,10 +1587,6 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions evaluatorFlags |= EvaluatorFlags.DisallowTypeVarsWithoutScopeId; } - if (options?.disallowRecursiveTypeAlias) { - evaluatorFlags |= EvaluatorFlags.DisallowRecursiveTypeAliasPlaceholder; - } - if (options?.allowUnpackedTypedDict) { evaluatorFlags |= EvaluatorFlags.AllowUnpackedTypedDict; } @@ -1498,6 +1599,10 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions evaluatorFlags |= EvaluatorFlags.NotParsedByInterpreter; } + if (options?.allowRequired) { + evaluatorFlags |= EvaluatorFlags.AllowRequired; + } + if (isAnnotationEvaluationPostponed(fileInfo)) { evaluatorFlags |= EvaluatorFlags.AllowForwardReferences; } @@ -1610,6 +1715,8 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } function canBeFalsy(type: Type, recursionCount = 0): boolean { + type = makeTopLevelTypeVarsConcrete(type); + if (recursionCount > maxTypeRecursionCount) { return true; } @@ -1645,6 +1752,14 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions return isUnboundedTupleClass(type) || type.tupleTypeArguments.length === 0; } + // Handle subclasses of tuple, such as NamedTuple. + const tupleBaseClass = type.details.mro.find( + (mroClass) => !isClass(mroClass) || isTupleClass(mroClass) + ); + if (tupleBaseClass && isClass(tupleBaseClass) && tupleBaseClass.tupleTypeArguments) { + return isUnboundedTupleClass(tupleBaseClass) || tupleBaseClass.tupleTypeArguments.length === 0; + } + // Check for Literal[False] and Literal[True]. if (ClassType.isBuiltIn(type, 'bool') && type.literalValue !== undefined) { return type.literalValue === false; @@ -1687,6 +1802,8 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } function canBeTruthy(type: Type, recursionCount = 0): boolean { + type = makeTopLevelTypeVarsConcrete(type); + if (recursionCount > maxTypeRecursionCount) { return true; } @@ -1770,17 +1887,29 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // and return only the "None". function removeTruthinessFromType(type: Type): Type { return mapSubtypes(type, (subtype) => { - if (isClassInstance(subtype)) { - if (subtype.literalValue !== undefined) { + const concreteSubtype = makeTopLevelTypeVarsConcrete(subtype); + + if (isClassInstance(concreteSubtype)) { + if (concreteSubtype.literalValue !== undefined) { // If the object is already definitely falsy, it's fine to // include, otherwise it should be removed. - return !subtype.literalValue ? subtype : undefined; + return !concreteSubtype.literalValue ? subtype : undefined; } // If the object is a bool, make it "false", since // "true" is a truthy value. - if (ClassType.isBuiltIn(subtype, 'bool')) { - return ClassType.cloneWithLiteral(subtype, /* value */ false); + if (ClassType.isBuiltIn(concreteSubtype, 'bool')) { + return ClassType.cloneWithLiteral(concreteSubtype, /* value */ false); + } + + // If the object is an int, str or bytes, narrow to a literal type. + // This is slightly unsafe in that someone could subclass `int`, `str` + // or `bytes` and override the `__bool__` method to change its behavior, + // but this is extremely unlikely (and ill advised). + if (ClassType.isBuiltIn(concreteSubtype, 'int')) { + return ClassType.cloneWithLiteral(concreteSubtype, /* value */ 0); + } else if (ClassType.isBuiltIn(concreteSubtype, ['str', 'bytes'])) { + return ClassType.cloneWithLiteral(concreteSubtype, /* value */ ''); } } @@ -1799,17 +1928,19 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // and return only the "int". function removeFalsinessFromType(type: Type): Type { return mapSubtypes(type, (subtype) => { - if (isClassInstance(subtype)) { - if (subtype.literalValue !== undefined) { + const concreteSubtype = makeTopLevelTypeVarsConcrete(subtype); + + if (isClassInstance(concreteSubtype)) { + if (concreteSubtype.literalValue !== undefined) { // If the object is already definitely truthy, it's fine to // include, otherwise it should be removed. - return subtype.literalValue ? subtype : undefined; + return concreteSubtype.literalValue ? subtype : undefined; } // If the object is a bool, make it "true", since // "false" is a falsy value. - if (ClassType.isBuiltIn(subtype, 'bool')) { - return ClassType.cloneWithLiteral(subtype, /* value */ true); + if (ClassType.isBuiltIn(concreteSubtype, 'bool')) { + return ClassType.cloneWithLiteral(concreteSubtype, /* value */ true); } } @@ -1870,6 +2001,8 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions bindToType?: ClassType | TypeVarType ): TypeResult | undefined { let memberInfo: ClassMemberLookup | undefined; + const classDiag = diag ? new DiagnosticAddendum() : undefined; + const metaclassDiag = diag ? new DiagnosticAddendum() : undefined; if (ClassType.isPartiallyEvaluated(classType)) { addDiagnostic( @@ -1888,7 +2021,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions /* isAccessedThroughObject */ false, memberName, usage, - diag, + classDiag, memberAccessFlags | MemberAccessFlags.AccessClassMembersOnly, bindToType ); @@ -1917,6 +2050,8 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } } + const isMemberPresentOnClass = memberInfo?.classType !== undefined; + // If it wasn't found on the class, see if it's part of the metaclass. if (!memberInfo) { const metaclass = classType.details.effectiveMetaclass; @@ -1927,7 +2062,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions /* isAccessedThroughObject */ true, memberName, usage, - /* diag */ undefined, + metaclassDiag, memberAccessFlags, classType ); @@ -1942,6 +2077,12 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions }; } + // Determine whether to use the class or metaclass diagnostic addendum. + const subDiag = isMemberPresentOnClass ? classDiag : metaclassDiag; + if (diag && subDiag) { + diag.addAddendum(subDiag); + } + return undefined; } @@ -2043,7 +2184,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions callResult = validateFunctionArguments( exprNode, argList, - type, + { type }, new TypeVarContext(getTypeVarScopeId(type)), /* skipUnknownArgCheck */ true ); @@ -2077,8 +2218,8 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions if (TypeBase.isInstantiable(subtype)) { let methodType: FunctionType | OverloadedFunctionType | undefined; - // Try to get the __init__ method first because it typically has - // more type information than __new__. + // Try to get the `__init__` method first because it typically has more + // type information than `__new__`. methodType = getBoundMethod(subtype, '__init__'); // Is this the __init__ method provided by the object class? @@ -2088,11 +2229,13 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions methodType.details.fullName === 'builtins.object.__init__'; const isSkipConstructor = !!methodType && isFunction(methodType) && FunctionType.isSkipConstructorCheck(methodType); + const isDefaultParams = + methodType && isFunction(methodType) && FunctionType.hasDefaultParameters(methodType); - // If there was no `__init__` or the only `__init__` that was found - // was form the `object` class, see if we can find a better `__new__` - // method. - if (!methodType || isObjectInit || isSkipConstructor) { + // If there was no `__init__` or the only `__init__` that was found was from + // the `object` class or accepts only default parameters(* args, ** kwargs), + // see if we can find a better signature from the `__new__` method. + if (!methodType || isObjectInit || isSkipConstructor || isDefaultParams) { const constructorType = getBoundMethod( subtype, '__new__', @@ -2172,7 +2315,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // where the type isn't declared in this class but is in // a parent class. if ( - getDeclaredTypeOfSymbol(symbol, expression) === undefined && + !getDeclaredTypeOfSymbol(symbol, expression)?.type && symbolWithScope.scope.type === ScopeType.Class ) { const enclosingClass = ParseTreeUtils.getEnclosingClassOrFunction(expression); @@ -2279,7 +2422,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } if (symbol) { - let declaredType = getDeclaredTypeOfSymbol(symbol); + let declaredType = getDeclaredTypeOfSymbol(symbol)?.type; if (declaredType) { // If it's a descriptor, we need to get the setter type. if (isClassInstance(declaredType)) { @@ -2366,16 +2509,20 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // Validates that the type is an iterator and returns the iterated type // (i.e. the type returned from the '__next__' or '__anext__' method). - function getTypeOfIterator(type: Type, isAsync: boolean, errorNode: ExpressionNode | undefined): Type | undefined { + function getTypeOfIterator( + typeResult: TypeResult, + isAsync: boolean, + errorNode: ExpressionNode | undefined + ): TypeResult | undefined { const iterMethodName = isAsync ? '__aiter__' : '__iter__'; const nextMethodName = isAsync ? '__anext__' : '__next__'; let isValidIterator = true; - type = transformPossibleRecursiveTypeAlias(type); + let type = transformPossibleRecursiveTypeAlias(typeResult.type); type = makeTopLevelTypeVarsConcrete(type); if (isOptionalType(type)) { - if (errorNode) { + if (errorNode && !typeResult.isIncomplete) { addDiagnostic( AnalyzerNodeInfo.getFileInfo(errorNode).diagnosticRuleSet.reportOptionalIterable, DiagnosticRule.reportOptionalIterable, @@ -2460,7 +2607,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } if (isClassInstance(subtype)) { - const nextReturnType = getSpecializedReturnType(subtype, nextMethodName, [], errorNode); + let nextReturnType = getSpecializedReturnType(subtype, nextMethodName, [], errorNode); if (!nextReturnType) { iterReturnTypeDiag.addMessage( @@ -2470,6 +2617,16 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions }) ); } else { + // Convert any unpacked TypeVarTuples into object instances. We don't + // know anything more about them. + nextReturnType = mapSubtypes(nextReturnType, (returnSubtype) => { + if (isTypeVar(returnSubtype) && isUnpackedVariadicTypeVar(returnSubtype)) { + return objectType ?? UnknownType.create(); + } + + return returnSubtype; + }); + if (!isAsync) { return nextReturnType; } @@ -2496,7 +2653,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } } - if (errorNode) { + if (errorNode && !typeResult.isIncomplete) { addDiagnostic( AnalyzerNodeInfo.getFileInfo(errorNode).diagnosticRuleSet.reportGeneralTypeIssues, DiagnosticRule.reportGeneralTypeIssues, @@ -2509,18 +2666,22 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions return undefined; }); - return isValidIterator ? iterableType : undefined; + return isValidIterator ? { type: iterableType, isIncomplete: typeResult.isIncomplete } : undefined; } // Validates that the type is an iterable and returns the iterable type argument. - function getTypeOfIterable(type: Type, isAsync: boolean, errorNode: ExpressionNode | undefined): Type | undefined { + function getTypeOfIterable( + typeResult: TypeResult, + isAsync: boolean, + errorNode: ExpressionNode | undefined + ): TypeResult | undefined { const iterMethodName = isAsync ? '__aiter__' : '__iter__'; let isValidIterable = true; - type = makeTopLevelTypeVarsConcrete(type); + let type = makeTopLevelTypeVarsConcrete(typeResult.type); if (isOptionalType(type)) { - if (errorNode) { + if (errorNode && !typeResult.isIncomplete) { addDiagnostic( AnalyzerNodeInfo.getFileInfo(errorNode).diagnosticRuleSet.reportOptionalIterable, DiagnosticRule.reportOptionalIterable, @@ -2573,11 +2734,61 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions return undefined; }); - return isValidIterable ? iterableType : undefined; + return isValidIterable ? { type: iterableType, isIncomplete: typeResult.isIncomplete } : undefined; + } + + function isTypeHashable(type: Type): boolean { + let isTypeHashable = true; + + doForEachSubtype(makeTopLevelTypeVarsConcrete(type), (subtype) => { + if (isClassInstance(subtype)) { + // Assume the class is hashable. + let isObjectHashable = true; + + // Have we already computed and cached the hashability? + if (subtype.details.isInstanceHashable !== undefined) { + isObjectHashable = subtype.details.isInstanceHashable; + } else { + const hashMember = lookUpObjectMember( + subtype, + '__hash__', + ClassMemberLookupFlags.SkipObjectBaseClass + ); + + if (hashMember && hashMember.isTypeDeclared) { + const decls = hashMember.symbol.getTypedDeclarations(); + const synthesizedType = hashMember.symbol.getSynthesizedType(); + + // Handle the case where the type is synthesized (used for + // dataclasses). + if (synthesizedType) { + isObjectHashable = !isNoneInstance(synthesizedType); + } else { + // Assume that if '__hash__' is declared as a variable, it is + // not hashable. If it's declared as a function, it is. We'll + // skip evaluating its full type because that's not needed in + // this case. + if (decls.every((decl) => decl.type === DeclarationType.Variable)) { + isObjectHashable = false; + } + } + } + + // Cache the hashability for next time. + subtype.details.isInstanceHashable = isObjectHashable; + } + + if (!isObjectHashable) { + isTypeHashable = false; + } + } + }); + + return isTypeHashable; } function getTypedDictClassType() { - return typedDictClassType; + return typedDictPrivateClassType; } function getTupleClassType() { @@ -2693,12 +2904,13 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions flowNode, /* reference */ undefined, /* targetSymbolId */ undefined, - /* initialType */ UnboundType.create(), - /* isInitialTypeIncomplete */ false, - /* ignoreNoReturn */ true + /* typeAtStart */ UnboundType.create(), + { + skipNoReturnCallAnalysis: true, + } ); - return codeFlowResult.type !== undefined; + return codeFlowResult.type !== undefined && !isNever(codeFlowResult.type); } // Determines whether there is a code flow path from sourceNode to sinkNode. @@ -2789,12 +3001,33 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions ); } - function addDiagnostic(diagLevel: DiagnosticLevel, rule: string, message: string, node: ParseNode) { + function addDiagnostic( + diagLevel: DiagnosticLevel, + rule: string, + message: string, + node: ParseNode, + range?: TextRange + ) { if (diagLevel === 'none') { return undefined; } - const diagnostic = addDiagnosticWithSuppressionCheck(diagLevel, message, node); + // Should we suppress this diagnostic because it's within an unannotated function? + const fileInfo = AnalyzerNodeInfo.getFileInfo(node); + if (!fileInfo.diagnosticRuleSet.analyzeUnannotatedFunctions) { + const containingFunction = ParseTreeUtils.getEnclosingFunction(node); + + // Is the target node within the body of the function? If so, suppress the diagnostic. + if ( + containingFunction && + ParseTreeUtils.isUnannotatedFunction(containingFunction) && + ParseTreeUtils.isNodeContainedWithin(node, containingFunction.suite) + ) { + return undefined; + } + } + + const diagnostic = addDiagnosticWithSuppressionCheck(diagLevel, message, node, range); if (diagnostic) { diagnostic.setRule(rule); } @@ -2826,7 +3059,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions const diag = new DiagnosticAddendum(); if (isUnion(type)) { doForEachSubtype(type, (subtype) => { - if (!TypeBase.isInstantiable(subtype)) { + if (!isEffectivelyInstantiable(subtype)) { diag.addMessage(Localizer.DiagnosticAddendum.typeNotClass().format({ type: printType(subtype) })); } }); @@ -2859,7 +3092,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } const declarations = symbolWithScope.symbol.getDeclarations(); - let declaredType = getDeclaredTypeOfSymbol(symbolWithScope.symbol); + let declaredType = getDeclaredTypeOfSymbol(symbolWithScope.symbol)?.type; const fileInfo = AnalyzerNodeInfo.getFileInfo(nameNode); // If this is a class scope and there is no type declared for this class variable, @@ -2883,7 +3116,10 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // We found an existing declared type. Make sure the type is assignable. let destType = type; - if (declaredType) { + const isTypeAlias = + !!declaredType && isClassInstance(declaredType) && ClassType.isBuiltIn(declaredType, 'TypeAlias'); + + if (declaredType && !isTypeAlias) { let diagAddendum = new DiagnosticAddendum(); if (!assignType(declaredType, type, diagAddendum)) { @@ -2900,7 +3136,8 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions sourceType: printType(type), destType: printType(declaredType), }) + diagAddendum.getString(), - srcExpression ?? nameNode + srcExpression ?? nameNode, + diagAddendum.getEffectiveTextRange() ?? srcExpression ?? nameNode ); // Replace the assigned type with the (unnarrowed) declared type. @@ -2940,7 +3177,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions nameNode ); } - } else if (varDecl.isFinal && !allowAssignmentToFinalVar) { + } else if (isFinalVariableDeclaration(varDecl) && !allowAssignmentToFinalVar) { addDiagnostic( fileInfo.diagnosticRuleSet.reportGeneralTypeIssues, DiagnosticRule.reportGeneralTypeIssues, @@ -2961,7 +3198,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions ); } - writeTypeCache(nameNode, destType, EvaluatorFlags.None, isTypeIncomplete); + writeTypeCache(nameNode, { type: destType, isIncomplete: isTypeIncomplete }, EvaluatorFlags.None); } function assignTypeToMemberAccessNode( @@ -3025,7 +3262,12 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions const setTypeResult = getTypeOfMemberAccessWithBaseType( target, baseTypeResult, - { method: 'set', setType: type, setErrorNode: srcExpr, setExpectedTypeDiag: expectedTypeDiagAddendum }, + { + method: 'set', + setType: { type, isIncomplete: isTypeIncomplete }, + setErrorNode: srcExpr, + setExpectedTypeDiag: expectedTypeDiagAddendum, + }, EvaluatorFlags.None ); @@ -3033,8 +3275,8 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions setAsymmetricDescriptorAssignment(target); } - writeTypeCache(target.memberName, type, EvaluatorFlags.None, isTypeIncomplete); - writeTypeCache(target, type, EvaluatorFlags.None, isTypeIncomplete); + writeTypeCache(target.memberName, { type, isIncomplete: isTypeIncomplete }, EvaluatorFlags.None); + writeTypeCache(target, { type, isIncomplete: isTypeIncomplete }, EvaluatorFlags.None); } function assignTypeToMemberVariable( @@ -3134,7 +3376,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } } else { // Is the target a property? - const declaredType = getDeclaredTypeOfSymbol(memberInfo.symbol); + const declaredType = getDeclaredTypeOfSymbol(memberInfo.symbol)?.type; if (declaredType && !isProperty(declaredType)) { // Handle the case where there is a class variable defined with the same // name, but there's also now an instance variable introduced. Combine the @@ -3203,10 +3445,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions const unboundedIndex = tupleType.tupleTypeArguments.findIndex((t) => t.isUnbounded); if (unboundedIndex >= 0) { - if (sourceEntryTypes.length > targetTypes.length) { - // Splice out the unbounded since it might be zero length. - sourceEntryTypes.splice(unboundedIndex, 1); - } else if (sourceEntryTypes.length < targetTypes.length) { + if (sourceEntryTypes.length < targetTypes.length) { const typeToReplicate = sourceEntryTypes.length > 0 ? sourceEntryTypes[unboundedIndex] : AnyType.create(); @@ -3264,7 +3503,9 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } else { // The assigned expression isn't a tuple, so it had better // be some iterable type. - const iterableType = getTypeOfIterator(subtype, /* isAsync */ false, srcExpr) || UnknownType.create(); + const iterableType = + getTypeOfIterator({ type: subtype, isIncomplete: isTypeIncomplete }, /* isAsync */ false, srcExpr) + ?.type ?? UnknownType.create(); for (let index = 0; index < targetExpressions.length; index++) { targetTypes[index].push(addConditionToType(iterableType, getTypeCondition(subtype))); } @@ -3295,14 +3536,18 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions assignTypeToExpression(expr, targetType, isTypeIncomplete, srcExpr, /* ignoreEmptyContainers */ true); }); - writeTypeCache(target, type, EvaluatorFlags.None, isTypeIncomplete); + writeTypeCache(target, { type, isIncomplete: isTypeIncomplete }, EvaluatorFlags.None); } // Replaces all of the top-level TypeVars (as opposed to TypeVars // used as type arguments in other types) with their concrete form. // If conditionFilter is specified and the TypeVar is a constrained // TypeVar, only the conditions that match the filter will be included. - function makeTopLevelTypeVarsConcrete(type: Type, conditionFilter?: TypeCondition[]): Type { + function makeTopLevelTypeVarsConcrete( + type: Type, + makeParamSpecsConcrete = false, + conditionFilter?: TypeCondition[] + ): Type { return mapSubtypes(type, (subtype) => { if (isParamSpec(subtype)) { if (subtype.paramSpecAccess === 'args') { @@ -3340,12 +3585,33 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } } + // If this is a function that contains only a ParamSpec (no additional + // parameters), convert it to a concrete type of (*args: Any, **kwargs: Any). + if ( + makeParamSpecsConcrete && + isFunction(subtype) && + subtype.details.parameters.length === 0 && + subtype.details.paramSpec + ) { + const concreteFunction = FunctionType.createInstance( + '', + '', + '', + FunctionTypeFlags.SynthesizedMethod | FunctionTypeFlags.SkipArgsKwargsCompatibilityCheck + ); + FunctionType.addDefaultParameters(concreteFunction); + + return FunctionType.cloneForParamSpec(subtype, concreteFunction); + } + + // If this is a TypeVarTuple *Ts, convert it to an unpacked tuple + // *tuple[*Ts]. if (isVariadicTypeVar(subtype)) { if (tupleClassType && isInstantiableClass(tupleClassType)) { return convertToInstance( specializeTupleClass( tupleClassType, - [], + [{ type: subtype, isUnbounded: false }], /* isTypeArgumentExplicit */ true, /* isUnpackedTuple */ true ) @@ -3597,14 +3863,14 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions baseTypeResult, { method: 'set', - setType: type, + setType: { type, isIncomplete: isTypeIncomplete }, setErrorNode: srcExpr, setExpectedTypeDiag: expectedTypeDiagAddendum, }, EvaluatorFlags.None ); - writeTypeCache(target, type, EvaluatorFlags.None, isTypeIncomplete); + writeTypeCache(target, { type, isIncomplete: isTypeIncomplete }, EvaluatorFlags.None); break; } @@ -3711,7 +3977,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions ) { diagAddendum.addMessage( Localizer.Diagnostic.exceptionTypeIncorrect().format({ - type: printType(subtype, /* expandTypeAlias */ false), + type: printType(subtype), }) ); } else { @@ -3722,14 +3988,14 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions [], concreteSubtype, /* skipUnknownArgCheck */ false, - /* expectedType */ undefined + /* inferenceContext */ undefined ); }); if (callResult && callResult.argumentErrors) { diagAddendum.addMessage( Localizer.Diagnostic.exceptionTypeNotInstantiable().format({ - type: printType(subtype, /* expandTypeAlias */ false), + type: printType(subtype), }) ); } @@ -3744,14 +4010,14 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions ) { diagAddendum.addMessage( Localizer.Diagnostic.exceptionTypeIncorrect().format({ - type: printType(subtype, /* expandTypeAlias */ false), + type: printType(subtype), }) ); } } else { diagAddendum.addMessage( Localizer.Diagnostic.exceptionTypeIncorrect().format({ - type: printType(subtype, /* expandTypeAlias */ false), + type: printType(subtype), }) ); } @@ -3788,15 +4054,15 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions { method: 'del' }, EvaluatorFlags.None ); - writeTypeCache(node.memberName, memberType.type, EvaluatorFlags.None, /* isIncomplete */ false); - writeTypeCache(node, memberType.type, EvaluatorFlags.None, /* isIncomplete */ false); + writeTypeCache(node.memberName, { type: memberType.type }, EvaluatorFlags.None); + writeTypeCache(node, { type: memberType.type }, EvaluatorFlags.None); break; } case ParseNodeType.Index: { const baseTypeResult = getTypeOfExpression(node.baseExpression, EvaluatorFlags.DoNotSpecialize); getTypeOfIndexWithBaseType(node, baseTypeResult, { method: 'del' }, EvaluatorFlags.None); - writeTypeCache(node, UnboundType.create(), EvaluatorFlags.None, /* isIncomplete */ false); + writeTypeCache(node, { type: UnboundType.create() }, EvaluatorFlags.None); break; } @@ -3868,7 +4134,12 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions return undefined; } - const memberType = getTypeOfMember(classMember); + const memberTypeResult = getTypeOfMemberInternal(classMember, objType); + if (!memberTypeResult) { + return undefined; + } + + const memberType = memberTypeResult.type; if (isAnyOrUnknown(memberType)) { return memberType; } @@ -3886,7 +4157,12 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions if (methodType) { if (isOverloadedFunction(methodType)) { if (errorNode) { - const bestOverload = getBestOverloadForArguments(errorNode, methodType, argList); + const bestOverload = getBestOverloadForArguments( + errorNode, + { type: methodType, isIncomplete: memberTypeResult.isIncomplete }, + argList + ); + if (bestOverload) { return getFunctionEffectiveReturnType(bestOverload); } @@ -3908,31 +4184,40 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions let isIncomplete = false; const allowForwardReferences = (flags & EvaluatorFlags.AllowForwardReferences) !== 0 || fileInfo.isStubFile; - if (!evaluatorOptions.analyzeUnannotatedFunctions) { - const containingFunction = ParseTreeUtils.getEnclosingFunction(node); - if (containingFunction && ParseTreeUtils.isUnannotatedFunction(containingFunction)) { - return { - type: AnyType.create(), - isIncomplete: false, - }; - } - } - + // Does this name refer to a PEP 695-style type parameter? const typeParamSymbol = AnalyzerNodeInfo.getTypeParameterSymbol(node); if (typeParamSymbol) { symbol = typeParamSymbol; - type = getDeclaredTypeOfSymbol(typeParamSymbol) ?? UnknownType.create(); + assert(symbol.getDeclarations().length === 1); + const decl = getLastTypedDeclaredForSymbol(symbol); + assert(decl?.type === DeclarationType.TypeParameter); + type = getTypeOfTypeParameter(decl.node); setSymbolAccessed(fileInfo, symbol, node); } else { // Look for the scope that contains the value definition and // see if it has a declared type. - const symbolWithScope = lookUpSymbolRecursive( + let symbolWithScope = lookUpSymbolRecursive( node, name, !allowForwardReferences, allowForwardReferences && (flags & EvaluatorFlags.ExpectingTypeAnnotation) !== 0 ); + if (!symbolWithScope) { + // If the node is part of a "from X import Y as Z" statement and the node + // is the "Y" (non-aliased) name, we need to look up the alias symbol + // since the non-aliased name is not in the symbol table. + const alias = getAliasFromImport(node); + if (alias) { + symbolWithScope = lookUpSymbolRecursive( + alias, + alias.value, + !allowForwardReferences, + allowForwardReferences && (flags & EvaluatorFlags.ExpectingTypeAnnotation) !== 0 + ); + } + } + if (symbolWithScope) { let useCodeFlowAnalysis = !allowForwardReferences; @@ -3943,6 +4228,19 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } symbol = symbolWithScope.symbol; + setSymbolAccessed(fileInfo, symbol, node); + + // If we're not supposed to be analyzing this function, skip the remaining work + // to determine the name's type. Simply evaluate its type as Any. + if (!fileInfo.diagnosticRuleSet.analyzeUnannotatedFunctions) { + const containingFunction = ParseTreeUtils.getEnclosingFunction(node); + if (containingFunction && ParseTreeUtils.isUnannotatedFunction(containingFunction)) { + return { + type: AnyType.create(), + isIncomplete: false, + }; + } + } // Get the effective type (either the declared type or the inferred type). // If we're using code flow analysis, pass the usage node so we consider @@ -3978,16 +4276,29 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // If the symbol is declared outside of our execution scope, use its effective // type. If it's declared inside our execution scope, it generally starts // as unbound at the start of the code flow. - const typeAtStart = - symbolWithScope.isBeyondExecutionScope || !symbol.isInitiallyUnbound() - ? effectiveType - : UnboundType.create(); - const codeFlowTypeResult = getFlowTypeOfReference( - node, + let typeAtStart = effectiveType; + if (!symbolWithScope.isBeyondExecutionScope && symbol.isInitiallyUnbound()) { + typeAtStart = UnboundType.create(); + + // Is this a module-level scope? If so, see if it's an alias of a builtin. + if (symbolWithScope.scope.type === ScopeType.Module) { + assert(symbolWithScope.scope.parent); + const builtInSymbol = symbolWithScope.scope.parent.lookUpSymbol(name); + if (builtInSymbol) { + const builtInEffectiveType = getEffectiveTypeOfSymbolForUsage(builtInSymbol); + typeAtStart = builtInEffectiveType.type; + } + } + } + + const codeFlowTypeResult = getFlowTypeOfReference( + node, symbol.id, typeAtStart, - /* isInitialTypeIncomplete */ false, - /* startNode */ undefined + /* startNode */ undefined, + { + skipConditionalNarrowing: (flags & EvaluatorFlags.ExpectingTypeAnnotation) !== 0, + } ); if (codeFlowTypeResult.type) { type = codeFlowTypeResult.type; @@ -4017,8 +4328,6 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // Detect, report, and fill in missing type arguments if appropriate. type = reportMissingTypeArguments(node, type, flags); - setSymbolAccessed(fileInfo, symbol, node); - if ((flags & EvaluatorFlags.ExpectingTypeAnnotation) !== 0) { // Verify that the name does not refer to a (non type alias) variable. if (effectiveTypeInfo.includesVariableDecl && !type.typeAliasInfo) { @@ -4069,7 +4378,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } if (isParamSpec(type)) { - if (flags & EvaluatorFlags.ParamSpecDisallowed) { + if (flags & EvaluatorFlags.DisallowParamSpec) { addError(Localizer.Diagnostic.paramSpecContext(), node); type = UnknownType.create(); } @@ -4078,6 +4387,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions if ( isTypeVar(type) && !type.details.isParamSpec && + !type.isVariadicInUnion && (flags & EvaluatorFlags.ExpectingType) === 0 && type.details.name === name ) { @@ -4128,12 +4438,17 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions symbolWithScope: SymbolWithScope, effectiveType: Type ): FlowNodeTypeResult | undefined { - // This function applies only to variables and parameters, not to other + // This function applies only to variables, parameters, and imports, not to other // types of symbols. if ( !symbolWithScope.symbol .getDeclarations() - .every((decl) => decl.type === DeclarationType.Variable || decl.type === DeclarationType.Parameter) + .every( + (decl) => + decl.type === DeclarationType.Variable || + decl.type === DeclarationType.Parameter || + decl.type === DeclarationType.Alias + ) ) { return undefined; } @@ -4169,6 +4484,11 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions return true; } + // Assume alias declarations are also always safe to narrow. + if (decl.type === DeclarationType.Alias) { + return true; + } + const declCodeFlowNode = AnalyzerNodeInfo.getFlowNode(decl.node); if (!declCodeFlowNode) { return false; @@ -4181,13 +4501,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions ); }) ) { - return getFlowTypeOfReference( - node, - symbolWithScope.symbol.id, - effectiveType, - /* isInitialTypeIncomplete */ false, - innerScopeNode - ); + return getFlowTypeOfReference(node, symbolWithScope.symbol.id, effectiveType, innerScopeNode); } } } @@ -4248,7 +4562,19 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions const outerFunctionScope = ParseTreeUtils.getEnclosingClassOrFunction(enclosingScope); if (outerFunctionScope?.nodeType === ParseNodeType.Function) { - enclosingScope = outerFunctionScope; + if (scopedTypeVarInfo.isRescoped) { + addDiagnostic( + AnalyzerNodeInfo.getFileInfo(node).diagnosticRuleSet + .reportGeneralTypeIssues, + DiagnosticRule.reportGeneralTypeIssues, + Localizer.Diagnostic.paramSpecScopedToReturnType().format({ + name: type.details.name, + }), + node + ); + } else { + enclosingScope = outerFunctionScope; + } } else if (!scopedTypeVarInfo.type.scopeId) { addDiagnostic( AnalyzerNodeInfo.getFileInfo(node).diagnosticRuleSet.reportGeneralTypeIssues, @@ -4265,7 +4591,12 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions if (enclosingScope) { // If the enclosing scope is using type parameter syntax, traditional // type variables can't be used in this context. - if (enclosingScope.typeParameters) { + if ( + enclosingScope.typeParameters && + !enclosingScope.typeParameters.parameters.some( + (param) => param.name.value === type.details.name + ) + ) { addDiagnostic( AnalyzerNodeInfo.getFileInfo(node).diagnosticRuleSet.reportGeneralTypeIssues, DiagnosticRule.reportGeneralTypeIssues, @@ -4302,9 +4633,16 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions (type.scopeId === undefined || scopedTypeVarInfo.foundInterveningClass) && !type.details.isSynthesized ) { - const message = isParamSpec(type) - ? Localizer.Diagnostic.paramSpecNotUsedByOuterScope() - : Localizer.Diagnostic.typeVarNotUsedByOuterScope(); + let message: ParameterizedString<{ name: string }>; + if (scopedTypeVarInfo.isRescoped) { + message = isParamSpec(type) + ? Localizer.Diagnostic.paramSpecScopedToReturnType() + : Localizer.Diagnostic.typeVarScopedToReturnType(); + } else { + message = isParamSpec(type) + ? Localizer.Diagnostic.paramSpecNotUsedByOuterScope() + : Localizer.Diagnostic.typeVarNotUsedByOuterScope(); + } addDiagnostic( AnalyzerNodeInfo.getFileInfo(node).diagnosticRuleSet.reportGeneralTypeIssues, DiagnosticRule.reportGeneralTypeIssues, @@ -4317,7 +4655,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // If this type var is variadic, the name refers to the packed form. It // must be unpacked in most contexts. - if (type.isVariadicUnpacked) { + if (isUnpackedVariadicTypeVar(type)) { type = TypeVarType.cloneForPacked(type); } @@ -4328,32 +4666,58 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // type arguments. If so, it fills in these type arguments with Unknown // and optionally reports an error. function reportMissingTypeArguments(node: ExpressionNode, type: Type, flags: EvaluatorFlags): Type { - if ((flags & EvaluatorFlags.DoNotSpecialize) === 0) { - if (isInstantiableClass(type)) { - if ((flags & EvaluatorFlags.ExpectingType) !== 0) { - if (requiresTypeArguments(type) && !type.typeArguments) { - addDiagnostic( - AnalyzerNodeInfo.getFileInfo(node).diagnosticRuleSet.reportMissingTypeArgument, - DiagnosticRule.reportMissingTypeArgument, - Localizer.Diagnostic.typeArgsMissingForClass().format({ - name: type.aliasName || type.details.name, - }), - node - ); - } - } - if (!type.typeArguments) { - type = createSpecializedClassType(type, /* typeArgs */ undefined, flags, node); + if ((flags & EvaluatorFlags.DoNotSpecialize) !== 0) { + return type; + } + + // Is this a generic class that needs to be specialized? + if (isInstantiableClass(type)) { + if ((flags & EvaluatorFlags.ExpectingType) !== 0) { + if (requiresTypeArguments(type) && !type.typeArguments) { + addDiagnostic( + AnalyzerNodeInfo.getFileInfo(node).diagnosticRuleSet.reportMissingTypeArgument, + DiagnosticRule.reportMissingTypeArgument, + Localizer.Diagnostic.typeArgsMissingForClass().format({ + name: type.aliasName || type.details.name, + }), + node + ); } } + if (!type.typeArguments) { + type = createSpecializedClassType(type, /* typeArgs */ undefined, flags, node)?.type; + } + } - if ( - (flags & EvaluatorFlags.ExpectingType) !== 0 && - type.typeAliasInfo && - type.typeAliasInfo.typeParameters && - type.typeAliasInfo.typeParameters.length > 0 && - !type.typeAliasInfo.typeArguments - ) { + // Is this a generic type alias that needs to be specialized? + if ( + (flags & EvaluatorFlags.ExpectingType) !== 0 && + type.typeAliasInfo && + type.typeAliasInfo.typeParameters && + type.typeAliasInfo.typeParameters.length > 0 && + !type.typeAliasInfo.typeArguments + ) { + let reportMissingTypeArguments = false; + const defaultTypeArgs: Type[] = []; + const typeVarContext = new TypeVarContext(type.typeAliasInfo.typeVarScopeId); + + type.typeAliasInfo.typeParameters.forEach((param) => { + if (!param.details.defaultType) { + reportMissingTypeArguments = true; + } + + let defaultType: Type; + if (param.details.defaultType || param.details.isParamSpec) { + defaultType = applySolvedTypeVars(param, typeVarContext, { unknownIfNotFound: true }); + } else { + defaultType = UnknownType.create(); + } + + defaultTypeArgs.push(defaultType); + typeVarContext.setTypeVarType(param, defaultType); + }); + + if (reportMissingTypeArguments) { addDiagnostic( AnalyzerNodeInfo.getFileInfo(node).diagnosticRuleSet.reportMissingTypeArgument, DiagnosticRule.reportMissingTypeArgument, @@ -4362,20 +4726,16 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions }), node ); - - type = TypeBase.cloneForTypeAlias( - applySolvedTypeVars( - type, - new TypeVarContext(type.typeAliasInfo.typeVarScopeId), - /* unknownIfNotFound */ true - ), - type.typeAliasInfo.name, - type.typeAliasInfo.fullName, - type.typeAliasInfo.typeVarScopeId, - type.typeAliasInfo.typeParameters, - type.typeAliasInfo.typeParameters.map((param) => UnknownType.create()) - ); } + + type = TypeBase.cloneForTypeAlias( + applySolvedTypeVars(type, typeVarContext, { unknownIfNotFound: true }), + type.typeAliasInfo.name, + type.typeAliasInfo.fullName, + type.typeAliasInfo.typeVarScopeId, + type.typeAliasInfo.typeParameters, + defaultTypeArgs + ); } return type; @@ -4416,11 +4776,8 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } // Walks up the parse tree to find a function, class, or type alias - // assignment that provides the context for a type variable. - function findScopedTypeVar( - node: ExpressionNode, - type: TypeVarType - ): { type: TypeVarType; foundInterveningClass: boolean } { + // declaration that provides the context for a type variable. + function findScopedTypeVar(node: ExpressionNode, type: TypeVarType): ScopedTypeVarResult { let curNode: ParseNode | undefined = node; let nestedClassCount = 0; @@ -4446,20 +4803,14 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } else if (curNode.nodeType === ParseNodeType.Function) { const functionTypeInfo = getTypeOfFunction(curNode); if (functionTypeInfo) { - typeParametersForScope = []; - functionTypeInfo.functionType.details.parameters.forEach((param) => { - if (param.hasDeclaredType) { - addTypeVarsToListIfUnique( - typeParametersForScope!, - getTypeVarArgumentsRecursive(param.type) - ); - } - }); - if (functionTypeInfo.functionType.details.declaredReturnType) { - addTypeVarsToListIfUnique( - typeParametersForScope!, - getTypeVarArgumentsRecursive(functionTypeInfo.functionType.details.declaredReturnType) - ); + const functionDetails = functionTypeInfo.functionType.details; + typeParametersForScope = functionDetails.typeParameters; + + // Was this type parameter "rescoped" to a callable found within the + // return type annotation? If so, it is not available for use within + // the function body. + if (functionDetails.rescopedTypeParameters?.some((tp) => tp.details.name === type.details.name)) { + return { type, isRescoped: true, foundInterveningClass: false }; } } @@ -4474,7 +4825,11 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions if (match?.scopeId) { // Use the scoped version of the TypeVar rather than the (unscoped) original type. type = TypeVarType.cloneForScopeId(type, match.scopeId, match.scopeName!, match.scopeType!); - return { type, foundInterveningClass: nestedClassCount > 1 && !scopeUsesTypeParameterSyntax }; + return { + type, + isRescoped: false, + foundInterveningClass: nestedClassCount > 1 && !scopeUsesTypeParameterSyntax, + }; } } @@ -4523,6 +4878,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions leftType.details.recursiveTypeAliasName, TypeVarScopeType.TypeAlias ), + isRescoped: false, foundInterveningClass: false, }; } @@ -4532,7 +4888,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } // Return the original type. - return { type, foundInterveningClass: false }; + return { type, isRescoped: false, foundInterveningClass: false }; } function getTypeOfMemberAccess(node: MemberAccessNode, flags: EvaluatorFlags): TypeResult { @@ -4564,14 +4920,14 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions if (isCodeFlowSupportedForReference(node)) { // Before performing code flow analysis, update the cache to prevent recursion. - writeTypeCache(node, typeResult.type, flags, /* isIncomplete */ true); - writeTypeCache(node.memberName, typeResult.type, flags, /* isIncomplete */ true); + writeTypeCache(node, { ...typeResult, isIncomplete: true }, flags); + writeTypeCache(node.memberName, { ...typeResult, isIncomplete: true }, flags); // If the type is initially unbound, see if there's a parent class that // potentially initialized the value. - let initialType = typeResult.type; - let isInitialTypeIncomplete = !!typeResult.isIncomplete; - if (isUnbound(initialType)) { + let typeAtStart = typeResult.type; + let isTypeAtStartIncomplete = !!typeResult.isIncomplete; + if (isUnbound(typeAtStart)) { const baseType = makeTopLevelTypeVarsConcrete(baseTypeResult.type); let classMemberInfo: ClassMember | undefined; @@ -4590,8 +4946,8 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } if (classMemberInfo) { - initialType = getTypeOfMember(classMemberInfo); - isInitialTypeIncomplete = false; + typeAtStart = getTypeOfMember(classMemberInfo); + isTypeAtStartIncomplete = false; } } @@ -4599,8 +4955,12 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions const codeFlowTypeResult = getFlowTypeOfReference( node, indeterminateSymbolId, - initialType, - isInitialTypeIncomplete + typeAtStart, + /* startNode */ undefined, + { + isTypeAtStartIncomplete, + skipConditionalNarrowing: (flags & EvaluatorFlags.ExpectingTypeAnnotation) !== 0, + } ); if (codeFlowTypeResult.type) { @@ -4613,9 +4973,6 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // Detect, report, and fill in missing type arguments if appropriate. typeResult.type = reportMissingTypeArguments(node, typeResult.type, flags); - - deleteTypeCacheEntry(node); - deleteTypeCacheEntry(node.memberName); } if (baseTypeResult.isIncomplete) { @@ -4623,7 +4980,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } // Cache the type information in the member name node. - writeTypeCache(node.memberName, typeResult.type, flags, !!typeResult.isIncomplete); + writeTypeCache(node.memberName, typeResult, flags); return typeResult; } @@ -4641,6 +4998,8 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions let type: Type | undefined; let isIncomplete = !!baseTypeResult.isIncomplete; let isAsymmetricDescriptor: boolean | undefined; + const isRequired = false; + const isNotRequired = false; // If the base type was incomplete and unbound, don't proceed // because false positive errors will be generated. @@ -4659,7 +5018,13 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions const getTypeOfNoneBase = (subtype: NoneType) => { if (noneType && isInstantiableClass(noneType)) { if (TypeBase.isInstance(subtype)) { - return getTypeOfObjectMember(node.memberName, noneType, memberName, usage, diag); + return getTypeOfObjectMember( + node.memberName, + ClassType.cloneAsInstance(noneType), + memberName, + usage, + diag + ); } else { return getTypeOfClassMember(node.memberName, noneType, memberName, usage, diag); } @@ -4870,12 +5235,21 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } } + // If the field was not found and the module type is marked + // such that all fields should be Any/Unknown, return that type. + if (!type && baseType.notPresentFieldType) { + type = baseType.notPresentFieldType; + } + if (!type) { if (!isIncomplete) { addDiagnostic( fileInfo.diagnosticRuleSet.reportGeneralTypeIssues, DiagnosticRule.reportGeneralTypeIssues, - Localizer.Diagnostic.moduleUnknownMember().format({ name: memberName }), + Localizer.Diagnostic.moduleUnknownMember().format({ + memberName, + moduleName: baseType.moduleName, + }), node.memberName ); } @@ -5000,7 +5374,8 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions ruleSet, rule, diagMessage.format({ name: memberName, type: printType(baseType) }) + diag.getString(), - node.memberName + node.memberName, + diag.getEffectiveTextRange() ?? node.memberName ); } @@ -5013,7 +5388,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // Should we specialize the class? if ((flags & EvaluatorFlags.DoNotSpecialize) === 0) { if (isInstantiableClass(type) && !type.typeArguments) { - type = createSpecializedClassType(type, /* typeArgs */ undefined, flags, node); + type = createSpecializedClassType(type, /* typeArgs */ undefined, flags, node)?.type; } } @@ -5043,7 +5418,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } } - return { type, isIncomplete, isAsymmetricDescriptor }; + return { type, isIncomplete, isAsymmetricDescriptor, isRequired, isNotRequired }; } function getTypeOfClassMemberName( @@ -5107,10 +5482,30 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions isInstantiableClass(containingClassType) && ClassType.isSameGenericClass(containingClassType, classType) ) { - type = getDeclaredTypeOfSymbol(memberInfo.symbol) ?? UnknownType.create(); + type = getDeclaredTypeOfSymbol(memberInfo.symbol)?.type; if (type && isInstantiableClass(memberInfo.classType)) { type = partiallySpecializeType(type, memberInfo.classType); } + + // If we're setting a class variable via a write through an object, + // this is normally considered a type violation. But it is allowed + // if the class variable is a descriptor object. In this case, we will + // clear the flag that causes an error to be generated. + if (usage.method === 'set' && memberInfo.symbol.isClassVar() && isAccessedThroughObject) { + const selfClass = bindToType || memberName === '__new__' ? undefined : classType; + const typeResult = getTypeOfMemberInternal(memberInfo, selfClass); + + if (typeResult) { + if (isDescriptorInstance(typeResult.type, /* requireSetter */ true)) { + type = typeResult.type; + flags &= MemberAccessFlags.DisallowClassVarWrites; + } + } + } + + if (!type) { + type = UnknownType.create(); + } } } } @@ -5119,8 +5514,10 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // Determine whether to replace Self variables with a specific // class. Avoid doing this if there's a "bindToType" specified // because that case is used for super() calls where we want - // to leave the Self type generic (not specialized). - const selfClass = bindToType ? undefined : classType; + // to leave the Self type generic (not specialized). We'll also + // skip this for __new__ methods because they are not bound + // to the class but rather assume the type of the cls argument. + const selfClass = bindToType || memberName === '__new__' ? undefined : classType; const typeResult = getTypeOfMemberInternal(memberInfo, selfClass); @@ -5135,7 +5532,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } // Don't include variables within typed dict classes. - if (ClassType.isTypedDictClass(classType)) { + if (isClass(memberInfo.classType) && ClassType.isTypedDictClass(memberInfo.classType)) { const typedDecls = memberInfo.symbol.getTypedDeclarations(); if (typedDecls.length > 0 && typedDecls[0].type === DeclarationType.Variable) { diag?.addMessage(Localizer.DiagnosticAddendum.memberUnknown().format({ name: memberName })); @@ -5173,14 +5570,16 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions if (usage.method === 'set' && usage.setType) { // Verify that the assigned type is compatible. - if (!assignType(type, usage.setType, diag?.createAddendum())) { - diag?.addMessage( - Localizer.DiagnosticAddendum.memberAssignment().format({ - type: printType(usage.setType), - name: memberName, - classType: printObjectTypeForClass(classType), - }) - ); + if (!assignType(type, usage.setType.type, diag?.createAddendum())) { + if (!usage.setType.isIncomplete) { + diag?.addMessage( + Localizer.DiagnosticAddendum.memberAssignment().format({ + type: printType(usage.setType.type), + name: memberName, + classType: printObjectTypeForClass(classType), + }) + ); + } return undefined; } @@ -5349,7 +5748,10 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // Provide "value" argument. argList.push({ argumentCategory: ArgumentCategory.Simple, - typeResult: { type: usage.setType ?? UnknownType.create() }, + typeResult: { + type: usage.setType?.type ?? UnknownType.create(), + isIncomplete: !!usage.setType?.isIncomplete, + }, }); } @@ -5454,7 +5856,8 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions if ( usage.setType && isFunction(boundMethodType) && - boundMethodType.details.parameters.length >= 2 + boundMethodType.details.parameters.length >= 2 && + !usage.setType.isIncomplete ) { const setterType = FunctionType.getEffectiveParameterType( boundMethodType, @@ -5464,7 +5867,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions diag?.addMessage( Localizer.DiagnosticAddendum.typeIncompatible().format({ destType: printType(setterType), - sourceType: printType(usage.setType), + sourceType: printType(usage.setType.type), }) ); } else if (isOverloadedFunction(boundMethodType)) { @@ -5528,6 +5931,21 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // If this function is an instance member (e.g. a lambda that was // assigned to an instance variable), don't perform any binding. if (!isAccessedThroughObject || (memberInfo && !memberInfo.isInstanceMember)) { + // Skip binding if the class appears to be a metaclass (i.e. a subclass of + // `type`) because the first parameter of instance methods in a metaclass + // are not `self` instances. + const isMetaclass = + !isAccessedThroughObject && + isClass(baseTypeClass) && + (flags & MemberAccessFlags.TreatConstructorAsClassMethod) === 0 && + baseTypeClass.details.mro.some( + (mroType) => isClass(mroType) && ClassType.isBuiltIn(mroType, 'type') + ); + + if (isMetaclass) { + return concreteSubtype; + } + return bindFunctionToClassOrObject( isAccessedThroughObject ? ClassType.cloneAsInstance(baseTypeClass) : baseTypeClass, concreteSubtype, @@ -5593,7 +6011,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } if (enforceTargetType) { - let effectiveType = concreteSubtype; + let effectiveType = subtype; // If the code is patching a method (defined on the class) // with an object-level function, strip the "self" parameter @@ -5714,7 +6132,10 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions argList.push({ // Provide "value" argument. argumentCategory: ArgumentCategory.Simple, - typeResult: { type: usage.setType ?? UnknownType.create() }, + typeResult: { + type: usage.setType?.type ?? UnknownType.create(), + isIncomplete: !!usage.setType?.isIncomplete, + }, }); } @@ -5811,14 +6232,18 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions if (baseTypeSupportsIndexNarrowing) { // Before performing code flow analysis, update the cache to prevent recursion. - writeTypeCache(node, indexTypeResult.type, flags, /* isIncomplete */ false); + writeTypeCache(node, indexTypeResult, flags); // See if we can refine the type based on code flow analysis. const codeFlowTypeResult = getFlowTypeOfReference( node, indeterminateSymbolId, indexTypeResult.type, - !!baseTypeResult.isIncomplete || !!indexTypeResult.isIncomplete + /* startNode */ undefined, + { + isTypeAtStartIncomplete: !!baseTypeResult.isIncomplete || !!indexTypeResult.isIncomplete, + skipConditionalNarrowing: (flags & EvaluatorFlags.ExpectingTypeAnnotation) !== 0, + } ); if (codeFlowTypeResult.type) { indexTypeResult.type = codeFlowTypeResult.type; @@ -5827,8 +6252,6 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions if (codeFlowTypeResult.isIncomplete) { indexTypeResult.isIncomplete = true; } - - deleteTypeCacheEntry(node); } } @@ -5836,17 +6259,6 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions indexTypeResult.isIncomplete = true; } - // Handle "Required" and "NotRequired" specially. - if ((flags & EvaluatorFlags.RequiredAllowed) !== 0) { - if (isInstantiableClass(baseTypeResult.type)) { - if (ClassType.isBuiltIn(baseTypeResult.type, 'Required')) { - indexTypeResult.isRequired = true; - } else if (ClassType.isBuiltIn(baseTypeResult.type, 'NotRequired')) { - indexTypeResult.isNotRequired = true; - } - } - } - return indexTypeResult; } @@ -5860,6 +6272,8 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // Do we need to adjust the type arguments to map to a variadic type // param at the end of the list? if (variadicIndex >= 0) { + const variadicTypeVar = typeParameters[variadicIndex]; + if (tupleClassType && isInstantiableClass(tupleClassType)) { if (variadicIndex < typeArgs.length) { const variadicTypeResults = typeArgs.slice( @@ -5911,7 +6325,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions ), ]; } - } else { + } else if (!variadicTypeVar.details.defaultType) { // Add an empty tuple that maps to the TypeVarTuple type parameter. typeArgs.push({ node: errorNode, @@ -5994,15 +6408,32 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } } - if (typeArgs.length > typeParameters.length && !typeParameters.some((typeVar) => typeVar.details.isVariadic)) { - addError( - Localizer.Diagnostic.typeArgsTooMany().format({ - name: printType(baseType), - expected: typeParameters.length, - received: typeArgs.length, - }), - typeArgs[typeParameters.length].node - ); + if (!typeParameters.some((typeVar) => typeVar.details.isVariadic && !typeVar.isVariadicInUnion)) { + let minTypeArgCount = typeParameters.length; + const firstNonDefaultParam = typeParameters.findIndex((param) => !!param.details.defaultType); + if (firstNonDefaultParam >= 0) { + minTypeArgCount = firstNonDefaultParam; + } + + if (typeArgs.length > typeParameters.length) { + addError( + Localizer.Diagnostic.typeArgsTooMany().format({ + name: printType(baseType), + expected: typeParameters.length, + received: typeArgs.length, + }), + typeArgs[typeParameters.length].node + ); + } else if (typeArgs.length < minTypeArgCount) { + addError( + Localizer.Diagnostic.typeArgsTooFew().format({ + name: printType(baseType), + expected: typeParameters.length, + received: typeArgs.length, + }), + node.items[node.items.length - 1] + ); + } } // Handle the mypy_extensions.FlexibleAlias type specially. @@ -6021,7 +6452,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions const typeArgType = typeArgs[index].type; if (typeArgs[index].typeList) { - const functionType = FunctionType.createInstantiable(FunctionTypeFlags.ParamSpecValue); + const functionType = FunctionType.createSynthesizedInstance('', FunctionTypeFlags.ParamSpecValue); TypeBase.setSpecialForm(functionType); typeArgs[index].typeList!.forEach((paramType, paramIndex) => { FunctionType.addParameter(functionType, { @@ -6088,7 +6519,8 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions AssignTypeFlags.RetainLiteralsForTypeVar ); } else if (isEllipsisType(typeArgType)) { - const functionType = FunctionType.createInstantiable( + const functionType = FunctionType.createSynthesizedInstance( + '', FunctionTypeFlags.ParamSpecValue | FunctionTypeFlags.SkipArgsKwargsCompatibilityCheck ); TypeBase.setSpecialForm(functionType); @@ -6102,8 +6534,33 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions addError(Localizer.Diagnostic.typeArgListNotAllowed(), typeArgs[index].node); } - const typeArgType: Type = - index < typeArgs.length ? convertToInstance(typeArgs[index].type) : UnknownType.create(); + let typeArgType: Type; + if (index < typeArgs.length) { + typeArgType = convertToInstance(typeArgs[index].type); + } else if (param.details.defaultType) { + typeArgType = applySolvedTypeVars(param, typeVarContext, { unknownIfNotFound: true }); + } else { + typeArgType = UnknownType.create(); + } + + if ((flags & EvaluatorFlags.EnforceTypeVarVarianceConsistency) !== 0) { + const usageVariances = inferTypeParameterVarianceForTypeAlias(baseType); + if (usageVariances && index < usageVariances.length) { + const usageVariance = usageVariances[index]; + + if (!isVarianceOfTypeArgumentCompatible(typeArgType, usageVariance)) { + const messageDiag = diag.createAddendum(); + messageDiag.addMessage( + Localizer.DiagnosticAddendum.varianceMismatchForTypeAlias().format({ + typeVarName: printType(typeArgType), + typeAliasParam: printType(typeParameters[index]), + }) + ); + messageDiag.addTextRange(typeArgs[index].node); + } + } + } + assignTypeToTypeVar( evaluatorInterface, param, @@ -6118,19 +6575,24 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions if (!diag.isEmpty()) { addError( Localizer.Diagnostic.typeNotSpecializable().format({ type: printType(baseType) }) + diag.getString(), - node + node, + diag.getEffectiveTextRange() ?? node ); } + const primarySignatureContext = typeVarContext.getPrimarySignature(); const aliasTypeArgs: Type[] = []; + baseType.typeAliasInfo.typeParameters?.forEach((typeParam) => { let typeVarType: Type | undefined; + if (isParamSpec(typeParam)) { - const paramSpecValue = typeVarContext.getParamSpec(typeParam); - typeVarType = paramSpecValue ? convertParamSpecValueToType(paramSpecValue) : UnknownType.create(); + const paramSpecType = primarySignatureContext.getParamSpecType(typeParam); + typeVarType = paramSpecType ? convertParamSpecValueToType(paramSpecType) : UnknownType.create(); } else { - typeVarType = typeVarContext.getTypeVarType(typeParam); + typeVarType = primarySignatureContext.getTypeVarType(typeParam); } + aliasTypeArgs.push(typeVarType || UnknownType.create()); }); @@ -6158,7 +6620,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions return typeAliasResult; } - if (isTypeAliasPlaceholder(baseTypeResult.type)) { + if (isTypeVar(baseTypeResult.type) && isTypeAliasPlaceholder(baseTypeResult.type)) { const typeArgTypes = getTypeArgs(node, flags).map((t) => convertToInstance(t.type)); const type = TypeBase.cloneForTypeAlias( baseTypeResult.type, @@ -6172,6 +6634,8 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } let isIncomplete = baseTypeResult.isIncomplete; + let isRequired = false; + let isNotRequired = false; const type = mapSubtypesExpandTypeVars( baseTypeResult.type, @@ -6193,7 +6657,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions ); // Evaluate the index expressions as though they are type arguments for error-reporting. - getTypeArgs(node, flags, /* isAnnotatedClass */ false, /* hasCustomClassGetItem */ false); + getTypeArgs(node, flags); return UnknownType.create(); } @@ -6204,7 +6668,8 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions if ( concreteSubtype.details.effectiveMetaclass && isInstantiableClass(concreteSubtype.details.effectiveMetaclass) && - !ClassType.isBuiltIn(concreteSubtype.details.effectiveMetaclass, 'type') + !ClassType.isBuiltIn(concreteSubtype.details.effectiveMetaclass, ['type', '_InitVarMeta']) && + (flags & EvaluatorFlags.ExpectingType) === 0 ) { const itemMethodType = getTypeOfClassMember( node, @@ -6214,6 +6679,19 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions /* diag */ undefined, MemberAccessFlags.SkipAttributeAccessOverride | MemberAccessFlags.ConsiderMetaclassOnly ); + + if (flags & EvaluatorFlags.ExpectingTypeAnnotation) { + // If the class doesn't derive from Generic, a type argument should not be allowed. + addDiagnostic( + AnalyzerNodeInfo.getFileInfo(node).diagnosticRuleSet.reportGeneralTypeIssues, + DiagnosticRule.reportGeneralTypeIssues, + Localizer.Diagnostic.typeArgsExpectingNone().format({ + name: printType(ClassType.cloneAsInstance(concreteSubtype)), + }), + node + ); + } + if (itemMethodType) { return getTypeOfIndexedObjectOrClass(node, concreteSubtype, usage).type; } @@ -6279,14 +6757,20 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions const isClassVarAnnotation = isInstantiableClass(concreteSubtype) && ClassType.isBuiltIn(concreteSubtype, 'ClassVar'); - let typeArgs = getTypeArgs( - node, - flags, + // Inlined TypedDicts are supported only for 'dict' (and not for 'Dict'). + const supportsTypedDictTypeArg = + isInstantiableClass(concreteSubtype) && + ClassType.isBuiltIn(concreteSubtype, 'dict') && + !concreteSubtype.aliasName; + + let typeArgs = getTypeArgs(node, flags, { isAnnotatedClass, - hasCustomClassGetItem || !isGenericClass, + hasCustomClassGetItem: hasCustomClassGetItem || !isGenericClass, isFinalAnnotation, - isClassVarAnnotation - ); + isClassVarAnnotation, + supportsTypedDictTypeArg, + }); + if (!isAnnotatedClass) { typeArgs = adjustTypeArgumentsForVariadicTypeVar( typeArgs, @@ -6306,14 +6790,21 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions AnalyzerNodeInfo.getFileInfo(node).diagnosticRuleSet.reportGeneralTypeIssues, DiagnosticRule.reportGeneralTypeIssues, Localizer.Diagnostic.classAlreadySpecialized().format({ - type: printType(convertToInstance(concreteSubtype), /* expandTypeAlias */ true), + type: printType(convertToInstance(concreteSubtype), { expandTypeAlias: true }), }), node.baseExpression ); return concreteSubtype; } - return createSpecializedClassType(concreteSubtype, typeArgs, flags, node); + const result = createSpecializedClassType(concreteSubtype, typeArgs, flags, node); + if (result.isRequired) { + isRequired = true; + } else if (result.isNotRequired) { + isNotRequired = true; + } + + return result.type; } if (isClassInstance(concreteSubtype)) { @@ -6324,8 +6815,8 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions return typeResult.type; } - if (isNever(concreteSubtype)) { - return UnknownType.create(); + if (isNever(concreteSubtype) || isUnbound(concreteSubtype)) { + return NeverType.createNever(); } if (isNoneInstance(concreteSubtype) && !isIncomplete) { @@ -6339,7 +6830,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions return UnknownType.create(); } - if (!isUnbound(concreteSubtype) && !isIncomplete) { + if (!isIncomplete) { const fileInfo = AnalyzerNodeInfo.getFileInfo(node); addDiagnostic( fileInfo.diagnosticRuleSet.reportGeneralTypeIssues, @@ -6363,7 +6854,107 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions }); } - return { type, isIncomplete }; + return { type, isIncomplete, isRequired, isNotRequired }; + } + + // Determines the effective variance of the type parameters for a generic + // type alias. Normally, variance is not important for type aliases, but + // it can be important in cases where the type alias is used to specify + // a base class in a class definition. + function inferTypeParameterVarianceForTypeAlias(type: Type): Variance[] | undefined { + // If this isn't a generic type alias, there's nothing to do. + if (!type.typeAliasInfo || !type.typeAliasInfo.typeParameters) { + return undefined; + } + + // Is the usage variance info already cached? + if (type.typeAliasInfo.usageVariance) { + return type.typeAliasInfo.usageVariance; + } + + const typeParams = type.typeAliasInfo.typeParameters; + + // Start with all of the usage variances unknown. + const usageVariances: Variance[] = typeParams.map(() => Variance.Unknown); + + // Prepopulate the cached value for the type alias to handle + // recursive type aliases. + type.typeAliasInfo.usageVariance = usageVariances; + + // Traverse the type alias type definition and adjust the usage + // variances accordingly. + updateUsageVariancesRecursive(type, typeParams, usageVariances); + + return usageVariances; + } + + // Looks at uses of the type parameters within the type and adjusts the + // variances accordingly. For example, if the type is `Mapping[T1, T2]`, + // then T1 will be set to invariant and T2 will be set to covariant. + function updateUsageVariancesRecursive( + type: Type, + typeAliasTypeParams: TypeVarType[], + usageVariances: Variance[], + recursionCount = 0 + ) { + if (recursionCount > maxTypeRecursionCount) { + return; + } + + recursionCount++; + + // Define a helper function that performs the actual usage variant update. + function updateUsageVarianceForType(type: Type, variance: Variance) { + doForEachSubtype(type, (subtype) => { + const typeParamIndex = typeAliasTypeParams.findIndex((param) => isTypeSame(param, subtype)); + if (typeParamIndex >= 0) { + usageVariances[typeParamIndex] = combineVariances(usageVariances[typeParamIndex], variance); + } else { + updateUsageVariancesRecursive(subtype, typeAliasTypeParams, usageVariances, recursionCount); + } + }); + } + + doForEachSubtype(type, (subtype) => { + if (subtype.category === TypeCategory.Function) { + if (subtype.specializedTypes) { + subtype.specializedTypes.parameterTypes.forEach((paramType) => { + updateUsageVarianceForType(paramType, Variance.Contravariant); + }); + + const returnType = subtype.specializedTypes.returnType; + if (returnType) { + updateUsageVarianceForType(returnType, Variance.Covariant); + } + } + } else if (subtype.category === TypeCategory.Class) { + if (subtype.typeArguments) { + // If the class includes type parameters that uses auto variance, + // compute the calculated variance. + inferTypeParameterVarianceForClass(subtype); + + // Is the class specialized using any type arguments that correspond to + // the type alias' type parameters? + subtype.typeArguments.forEach((typeArg, classParamIndex) => { + if (isTupleClass(subtype)) { + updateUsageVarianceForType(typeArg, Variance.Covariant); + } else if (classParamIndex < subtype.details.typeParameters.length) { + const classTypeParam = subtype.details.typeParameters[classParamIndex]; + if (isUnpackedClass(typeArg) && typeArg.tupleTypeArguments) { + typeArg.tupleTypeArguments.forEach((tupleTypeArg) => { + updateUsageVarianceForType(tupleTypeArg.type, Variance.Invariant); + }); + } else { + updateUsageVarianceForType( + typeArg, + classTypeParam.computedVariance ?? classTypeParam.details.declaredVariance + ); + } + } + }); + } + } + }); } function makeTupleObject(entryTypes: Type[], isUnspecifiedLength = false) { @@ -6558,12 +7149,12 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions unpackedListArgs.forEach((arg) => { const typeResult = getTypeOfExpression(arg.valueExpression); - const exprType = typeResult.type; if (typeResult.isIncomplete) { isPositionalIndexTypeIncomplete = true; } const iterableType = - getTypeOfIterator(exprType, /* isAsync */ false, arg.valueExpression) || UnknownType.create(); + getTypeOfIterator(typeResult, /* isAsync */ false, arg.valueExpression)?.type ?? + UnknownType.create(); tupleEntries.push(iterableType); }); @@ -6578,17 +7169,24 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions ]; if (usage.method === 'set') { - let setType = usage.setType || AnyType.create(); + let setType = usage.setType?.type ?? AnyType.create(); // Expand constrained type variables. if (isTypeVar(setType) && setType.details.constraints.length > 0) { const conditionFilter = isClassInstance(baseType) ? baseType.condition : undefined; - setType = makeTopLevelTypeVarsConcrete(setType, conditionFilter); + setType = makeTopLevelTypeVarsConcrete( + setType, + /* makeParamSpecsConcrete */ undefined, + conditionFilter + ); } argList.push({ argumentCategory: ArgumentCategory.Simple, - typeResult: { type: setType, isIncomplete: isPositionalIndexTypeIncomplete }, + typeResult: { + type: setType, + isIncomplete: !!usage.setType?.isIncomplete, + }, }); } @@ -6652,29 +7250,23 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions }; } - function getTypeArgs( - node: IndexNode, - flags: EvaluatorFlags, - isAnnotatedClass = false, - hasCustomClassGetItem = false, - isFinalAnnotation = false, - isClassVarAnnotation = false - ): TypeResultWithNode[] { + function getTypeArgs(node: IndexNode, flags: EvaluatorFlags, options?: GetTypeArgsOptions): TypeResultWithNode[] { const typeArgs: TypeResultWithNode[] = []; let adjFlags = flags; - if (isFinalAnnotation || isClassVarAnnotation) { - adjFlags |= EvaluatorFlags.ClassVarDisallowed | EvaluatorFlags.FinalDisallowed; + if (options?.isFinalAnnotation || options?.isClassVarAnnotation) { + adjFlags |= EvaluatorFlags.DisallowClassVar | EvaluatorFlags.DisallowFinal; } else { adjFlags &= ~( EvaluatorFlags.DoNotSpecialize | - EvaluatorFlags.ParamSpecDisallowed | - EvaluatorFlags.TypeVarTupleDisallowed | - EvaluatorFlags.RequiredAllowed + EvaluatorFlags.DisallowParamSpec | + EvaluatorFlags.DisallowTypeVarTuple | + EvaluatorFlags.AllowRequired | + EvaluatorFlags.EnforceTypeVarVarianceConsistency ); - if (!isAnnotatedClass) { - adjFlags |= EvaluatorFlags.ClassVarDisallowed | EvaluatorFlags.FinalDisallowed; + if (!options?.isAnnotatedClass) { + adjFlags |= EvaluatorFlags.DisallowClassVar | EvaluatorFlags.DisallowFinal; } adjFlags |= EvaluatorFlags.AllowUnpackedTupleOrTypeVarTuple; @@ -6687,19 +7279,19 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // If it's a custom __class_getitem__, none of the arguments should be // treated as types. If it's an Annotated[a, b, c], only the first index // should be treated as a type. The others can be regular (non-type) objects. - if (hasCustomClassGetItem || (isAnnotatedClass && argIndex > 0)) { + if (options?.hasCustomClassGetItem || (options?.isAnnotatedClass && argIndex > 0)) { typeResult = { ...getTypeOfExpression( expr, - EvaluatorFlags.ParamSpecDisallowed | - EvaluatorFlags.TypeVarTupleDisallowed | + EvaluatorFlags.DisallowParamSpec | + EvaluatorFlags.DisallowTypeVarTuple | EvaluatorFlags.DoNotSpecialize | - EvaluatorFlags.ClassVarDisallowed + EvaluatorFlags.DisallowClassVar ), node: expr, }; } else { - typeResult = getTypeArg(expr, adjFlags); + typeResult = getTypeArg(expr, adjFlags, !!options?.supportsTypedDictTypeArg && argIndex === 0); } return typeResult; @@ -6748,7 +7340,11 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions return typeArgs; } - function getTypeArg(node: ExpressionNode, flags: EvaluatorFlags): TypeResultWithNode { + function getTypeArg( + node: ExpressionNode, + flags: EvaluatorFlags, + supportsDictExpression: boolean + ): TypeResultWithNode { let typeResult: TypeResultWithNode; let adjustedFlags = @@ -6773,15 +7369,32 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // Set the node's type so it isn't reevaluated later. setTypeForNode(node, UnknownType.create()); + } else if (node.nodeType === ParseNodeType.Dictionary && supportsDictExpression) { + const inlinedTypeDict = + typedDictClassType && isInstantiableClass(typedDictClassType) + ? createTypedDictTypeInlined(evaluatorInterface, node, typedDictClassType) + : undefined; + const keyTypeFallback = + strClassType && isInstantiableClass(strClassType) ? strClassType : UnknownType.create(); + + typeResult = { + type: keyTypeFallback, + inlinedTypeDict, + node, + }; } else { typeResult = { ...getTypeOfExpression(node, adjustedFlags), node }; + if (node.nodeType === ParseNodeType.Dictionary) { + addError(Localizer.Diagnostic.dictInAnnotation(), node); + } + // "Protocol" is not allowed as a type argument. if (isClass(typeResult.type) && ClassType.isBuiltIn(typeResult.type, 'Protocol')) { addError(Localizer.Diagnostic.protocolNotAllowedInTypeArgument(), node); } - if ((flags & EvaluatorFlags.ClassVarDisallowed) !== 0) { + if ((flags & EvaluatorFlags.DisallowClassVar) !== 0) { // "ClassVar" is not allowed as a type argument. if (isClass(typeResult.type) && ClassType.isBuiltIn(typeResult.type, 'ClassVar')) { addError(Localizer.Diagnostic.classVarNotAllowed(), node); @@ -6792,27 +7405,34 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions return typeResult; } - function getTypeOfTuple(node: TupleNode, expectedType: Type | undefined, flags: EvaluatorFlags): TypeResult { - if ((flags & EvaluatorFlags.ExpectingType) !== 0 && node.expressions.length === 0 && !expectedType) { + function getTypeOfTuple( + node: TupleNode, + inferenceContext: InferenceContext | undefined, + flags: EvaluatorFlags + ): TypeResult { + if ((flags & EvaluatorFlags.ExpectingType) !== 0 && node.expressions.length === 0 && !inferenceContext) { return { type: makeTupleObject([]), isEmptyTupleShorthand: true }; } // If the expected type is a union, recursively call for each of the subtypes // to find one that matches. - let effectiveExpectedType = expectedType; - let expectedTypeContainsAny = expectedType && isAny(expectedType); + let effectiveExpectedType = inferenceContext?.expectedType; + let expectedTypeContainsAny = inferenceContext && isAny(inferenceContext.expectedType); - if (expectedType && isUnion(expectedType)) { + if (inferenceContext && isUnion(inferenceContext.expectedType)) { let matchingSubtype: Type | undefined; - doForEachSubtype(expectedType, (subtype) => { + doForEachSubtype(inferenceContext.expectedType, (subtype) => { if (isAny(subtype)) { expectedTypeContainsAny = true; } if (!matchingSubtype) { const subtypeResult = useSpeculativeMode(node, () => { - return getTypeOfTupleExpected(node, subtype); + return getTypeOfTupleWithContext( + node, + makeInferenceContext(subtype, inferenceContext?.typeVarContext) + ); }); if (subtypeResult && assignType(subtype, subtypeResult.type)) { @@ -6824,27 +7444,33 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions effectiveExpectedType = matchingSubtype; } + let expectedTypeDiagAddendum: DiagnosticAddendum | undefined; if (effectiveExpectedType) { - const result = getTypeOfTupleExpected(node, effectiveExpectedType); - if (result) { + const result = getTypeOfTupleWithContext( + node, + makeInferenceContext(effectiveExpectedType, inferenceContext?.typeVarContext) + ); + if (result && !result.typeErrors) { return result; } + + expectedTypeDiagAddendum = result?.expectedTypeDiagAddendum; } - const resultType = getTypeOfTupleInferred(node); + const typeResult = getTypeOfTupleInferred(node); // If there was an expected type of Any, replace the resulting type // with Any rather than return a type with unknowns. if (expectedTypeContainsAny) { - resultType.type = AnyType.create(); + typeResult.type = AnyType.create(); } - return resultType; + return { ...typeResult, expectedTypeDiagAddendum }; } - function getTypeOfTupleExpected(node: TupleNode, expectedType: Type): TypeResult | undefined { - expectedType = transformPossibleRecursiveTypeAlias(expectedType); - if (!isClassInstance(expectedType)) { + function getTypeOfTupleWithContext(node: TupleNode, inferenceContext: InferenceContext): TypeResult | undefined { + inferenceContext.expectedType = transformPossibleRecursiveTypeAlias(inferenceContext.expectedType); + if (!isClassInstance(inferenceContext.expectedType)) { return undefined; } @@ -6855,9 +7481,11 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // Build an array of expected types. let expectedTypes: Type[] = []; - if (isTupleClass(expectedType) && expectedType.tupleTypeArguments) { - expectedTypes = expectedType.tupleTypeArguments.map((t) => transformPossibleRecursiveTypeAlias(t.type)); - const unboundedIndex = expectedType.tupleTypeArguments.findIndex((t) => t.isUnbounded); + if (isTupleClass(inferenceContext.expectedType) && inferenceContext.expectedType.tupleTypeArguments) { + expectedTypes = inferenceContext.expectedType.tupleTypeArguments.map((t) => + transformPossibleRecursiveTypeAlias(t.type) + ); + const unboundedIndex = inferenceContext.expectedType.tupleTypeArguments.findIndex((t) => t.isUnbounded); if (unboundedIndex >= 0) { if (expectedTypes.length > node.expressions.length) { expectedTypes.splice(unboundedIndex, 1); @@ -6873,7 +7501,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions !populateTypeVarContextBasedOnExpectedType( evaluatorInterface, ClassType.cloneAsInstance(tupleClassType), - expectedType, + inferenceContext.expectedType, tupleTypeVarContext, getTypeVarScopesForNode(node) ) @@ -6896,9 +7524,10 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions getTypeOfExpression( expr, /* flags */ undefined, - index < expectedTypes.length ? expectedTypes[index] : undefined + makeInferenceContext(index < expectedTypes.length ? expectedTypes[index] : undefined) ) ); + const isIncomplete = entryTypeResults.some((result) => result.isIncomplete); const type = convertToInstance( specializeTupleClass( @@ -6908,7 +7537,18 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions ) ); - return { type }; + // Copy any expected type diag addenda for precision error reporting. + let expectedTypeDiagAddendum: DiagnosticAddendum | undefined; + if (entryTypeResults.some((result) => result.expectedTypeDiagAddendum)) { + expectedTypeDiagAddendum = new DiagnosticAddendum(); + entryTypeResults.forEach((result) => { + if (result.expectedTypeDiagAddendum) { + expectedTypeDiagAddendum!.addAddendum(result.expectedTypeDiagAddendum); + } + }); + } + + return { type, expectedTypeDiagAddendum, isIncomplete }; } function getTypeOfTupleInferred(node: TupleNode): TypeResult { @@ -6921,6 +7561,12 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions const type = convertToInstance(specializeTupleClass(tupleClassType, buildTupleTypesList(entryTypeResults))); + if (isIncomplete) { + if (getContainerDepth(type) > maxInferredContainerDepth) { + return { type: UnknownType.create() }; + } + } + return { type, isIncomplete }; } @@ -6970,7 +7616,11 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions return entryTypes; } - function getTypeOfCall(node: CallNode, expectedType: Type | undefined, flags: EvaluatorFlags): TypeResult { + function getTypeOfCall( + node: CallNode, + inferenceContext: InferenceContext | undefined, + flags: EvaluatorFlags + ): TypeResult { const baseTypeResult = getTypeOfExpression(node.leftExpression, EvaluatorFlags.DoNotSpecialize); const argList = node.arguments.map((arg) => { @@ -6995,13 +7645,13 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions node.leftExpression.value === 'reveal_type' ) { // Handle the implicit "reveal_type" call. - typeResult = getTypeOfRevealType(node, expectedType); + typeResult = getTypeOfRevealType(node, inferenceContext); } else if (isFunction(baseTypeResult.type) && baseTypeResult.type.details.builtInName === 'reveal_type') { // Handle the "typing.reveal_type" call. - typeResult = getTypeOfRevealType(node, expectedType); + typeResult = getTypeOfRevealType(node, inferenceContext); } else if (isFunction(baseTypeResult.type) && baseTypeResult.type.details.builtInName === 'assert_type') { // Handle the "typing.assert_type" call. - typeResult = getTypeOfAssertType(node, expectedType); + typeResult = getTypeOfAssertType(node, inferenceContext); } else if ( isAnyOrUnknown(baseTypeResult.type) && node.leftExpression.nodeType === ParseNodeType.Name && @@ -7020,13 +7670,15 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions baseTypeResult, /* typeVarContext */ undefined, /* skipUnknownArgCheck */ false, - expectedType + inferenceContext ); typeResult.type = callResult.returnType ?? UnknownType.create(); if (callResult.argumentErrors) { typeResult.typeErrors = true; + } else { + typeResult.overloadsUsedForCall = callResult.overloadsUsedForCall; } if (callResult.isTypeIncomplete) { @@ -7082,7 +7734,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions return typeResult; } - function getTypeOfAssertType(node: CallNode, expectedType: Type | undefined): TypeResult { + function getTypeOfAssertType(node: CallNode, inferenceContext: InferenceContext | undefined): TypeResult { if ( node.arguments.length !== 2 || node.arguments[0].argumentCategory !== ArgumentCategory.Simple || @@ -7097,7 +7749,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions const arg0TypeResult = getTypeOfExpression( node.arguments[0].valueExpression, /* flags */ undefined, - expectedType + inferenceContext ); if (arg0TypeResult.isIncomplete) { return { type: UnknownType.create(/* isIncomplete */ true), isIncomplete: true }; @@ -7105,7 +7757,9 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions const assertedType = convertToInstance(getTypeOfArgumentExpectingType(node.arguments[1]).type); - if (!isTypeSame(assertedType, arg0TypeResult.type, { treatAnySameAsUnknown: true })) { + if ( + !isTypeSame(assertedType, arg0TypeResult.type, { treatAnySameAsUnknown: true, ignorePseudoGeneric: true }) + ) { addDiagnostic( AnalyzerNodeInfo.getFileInfo(node).diagnosticRuleSet.reportGeneralTypeIssues, DiagnosticRule.reportGeneralTypeIssues, @@ -7120,7 +7774,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions return { type: arg0TypeResult.type }; } - function getTypeOfRevealType(node: CallNode, expectedType: Type | undefined): TypeResult { + function getTypeOfRevealType(node: CallNode, inferenceContext: InferenceContext | undefined): TypeResult { let arg0Value: ExpressionNode | undefined; let expectedRevealTypeNode: ExpressionNode | undefined; let expectedRevealType: Type | undefined; @@ -7159,11 +7813,11 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions return { type: UnknownType.create() }; } - const typeResult = getTypeOfExpression(arg0Value, /* flags */ undefined, expectedType); + const typeResult = getTypeOfExpression(arg0Value, /* flags */ undefined, inferenceContext); const type = typeResult.type; const exprString = ParseTreeUtils.printExpression(arg0Value); - const typeString = printType(type, /* expandTypeAlias */ true); + const typeString = printType(type, { expandTypeAlias: true }); if (expectedText !== undefined) { if (expectedText !== typeString) { @@ -7178,7 +7832,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } if (expectedRevealType) { - if (!isTypeSame(expectedRevealType, type)) { + if (!isTypeSame(expectedRevealType, type, { ignorePseudoGeneric: true })) { const expectedRevealTypeText = printType(expectedRevealType); addError( Localizer.Diagnostic.revealTypeExpectedTypeMismatch().format({ @@ -7223,7 +7877,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions infoMessages.push( Localizer.DiagnosticAddendum.typeOfSymbol().format({ name, - type: printType(typeOfSymbol, /* expandTypeAlias */ true), + type: printType(typeOfSymbol, { expandTypeAlias: true }), }) ); } @@ -7385,10 +8039,12 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions type: resultIsInstance ? ClassType.cloneAsInstance(lookupResults.classType) : lookupResults.classType, - bindToType: - resultIsInstance && bindToType && isInstantiableClass(bindToType) - ? ClassType.cloneAsInstance(bindToType) - : bindToType, + bindToType: bindToType + ? TypeBase.cloneForCondition( + synthesizeTypeVarForSelfCls(bindToType, !resultIsInstance), + bindToType.condition + ) + : undefined, }; } } @@ -7429,20 +8085,20 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions argParamMatches: MatchArgsToParamsResult[], typeVarContext: TypeVarContext | undefined, skipUnknownArgCheck: boolean, - expectedType: Type | undefined + inferenceContext: InferenceContext | undefined ): CallResult { const returnTypes: Type[] = []; - const matchedOverloads: { - overload: FunctionType; - matchResults: MatchArgsToParamsResult; - typeVarContext: TypeVarContext; - }[] = []; + const matchedOverloads: MatchedOverloadInfo[] = []; let isTypeIncomplete = false; + let overloadsUsedForCall: FunctionType[] = []; + let isDefinitiveMatchFound = false; for (let expandedTypesIndex = 0; expandedTypesIndex < expandedArgTypes.length; expandedTypesIndex++) { let matchedOverload: FunctionType | undefined; const argTypeOverride = expandedArgTypes[expandedTypesIndex]; const hasArgTypeOverride = argTypeOverride.some((a) => a !== undefined); + let possibleMatchResults: MatchedOverloadInfo[] = []; + isDefinitiveMatchFound = false; for (let overloadIndex = 0; overloadIndex < argParamMatches.length; overloadIndex++) { const overload = argParamMatches[overloadIndex].overload; @@ -7470,6 +8126,9 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions const effectiveTypeVarContext = typeVarContextToClone?.clone() ?? new TypeVarContext(getTypeVarScopeId(overload)); effectiveTypeVarContext.addSolveForScope(getTypeVarScopeId(overload)); + if (overload.details.constructorTypeVarScopeId) { + effectiveTypeVarContext.addSolveForScope(overload.details.constructorTypeVarScopeId); + } effectiveTypeVarContext.unlock(); // Use speculative mode so we don't output any diagnostics or @@ -7480,7 +8139,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions matchResults, effectiveTypeVarContext, /* skipUnknownArgCheck */ true, - expectedType + inferenceContext ); }); @@ -7489,19 +8148,73 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } if (!callResult.argumentErrors && callResult.returnType) { + overloadsUsedForCall.push(overload); + matchedOverload = overload; - matchedOverloads.push({ + const matchedOverloadInfo: MatchedOverloadInfo = { overload: matchedOverload, matchResults, typeVarContext: effectiveTypeVarContext, - }); - returnTypes.push(callResult.returnType); - break; + returnType: callResult.returnType, + argResults: callResult.argResults ?? [], + }; + matchedOverloads.push(matchedOverloadInfo); + + if (callResult.isArgumentAnyOrUnknown) { + possibleMatchResults.push(matchedOverloadInfo); + } else { + returnTypes.push(callResult.returnType); + isDefinitiveMatchFound = true; + break; + } + } + } + + // If we didn't find a definitive match that doesn't depend on + // an Any or Unknown argument, fall back on the possible match. + // If there were multiple possible matches, evaluate the type as + // Unknown, but include the "possible types" to allow for completion + // suggestions. + if (!isDefinitiveMatchFound) { + possibleMatchResults = filterOverloadMatchesForAnyArgs(possibleMatchResults); + + // Did the filtering produce a single result? If so, we're done. + if (possibleMatchResults.length === 1) { + overloadsUsedForCall = [possibleMatchResults[0].overload]; + returnTypes.push(possibleMatchResults[0].returnType); + } else { + // Eliminate any return types that are subsumed by other return types. + let dedupedMatchResults: Type[] = []; + + possibleMatchResults.forEach((result) => { + let isSubtypeSubsumed = false; + + for (let dedupedIndex = 0; dedupedIndex < dedupedMatchResults.length; dedupedIndex++) { + if (assignType(dedupedMatchResults[dedupedIndex], result.returnType)) { + isSubtypeSubsumed = true; + break; + } else if (assignType(result.returnType, dedupedMatchResults[dedupedIndex])) { + dedupedMatchResults[dedupedIndex] = NeverType.createNever(); + break; + } + } + + if (!isSubtypeSubsumed) { + dedupedMatchResults.push(result.returnType); + } + }); + + dedupedMatchResults = dedupedMatchResults.filter((t) => !isNever(t)); + const combinedTypes = combineTypes(dedupedMatchResults); + + returnTypes.push( + dedupedMatchResults.length > 1 ? UnknownType.createPossibleType(combinedTypes) : combinedTypes + ); } } if (!matchedOverload) { - return { argumentErrors: true, isTypeIncomplete }; + return { argumentErrors: true, isTypeIncomplete, overloadsUsedForCall }; } } @@ -7509,7 +8222,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // resulting type var context back into the caller's type var context. // Use the type var context from the last matched overload because it // includes the type var solutions for all earlier matched overloads. - if (typeVarContext) { + if (typeVarContext && isDefinitiveMatchFound) { typeVarContext.copyFromClone(matchedOverloads[matchedOverloads.length - 1].typeVarContext); } @@ -7523,7 +8236,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions matchedOverloads[0].matchResults, finalTypeVarContext, skipUnknownArgCheck, - expectedType + inferenceContext ); if (finalCallResult.isTypeIncomplete) { @@ -7531,25 +8244,72 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } return { - argumentErrors: false, + argumentErrors: finalCallResult.argumentErrors, + isArgumentAnyOrUnknown: finalCallResult.isArgumentAnyOrUnknown, returnType: combineTypes(returnTypes), isTypeIncomplete, specializedInitSelfType: finalCallResult.specializedInitSelfType, + overloadsUsedForCall, }; } + // This function determines whether multiple incompatible overloads match + // due to an Any or Unknown argument type. + function filterOverloadMatchesForAnyArgs(matches: MatchedOverloadInfo[]): MatchedOverloadInfo[] { + if (matches.length < 2) { + return matches; + } + + // If all of the return types match, select the first one. + if ( + areTypesSame( + matches.map((match) => match.returnType), + { treatAnySameAsUnknown: true } + ) + ) { + return [matches[0]]; + } + + const firstArgResults = matches[0].argResults; + if (!firstArgResults) { + return matches; + } + + for (let i = 0; i < firstArgResults.length; i++) { + // If the arg is Any or Unknown, see if the corresponding + // parameter types differ in any way. + if (isAnyOrUnknown(firstArgResults[i].argType)) { + const paramTypes = matches.map((match) => + i < match.matchResults.argParams.length + ? match.matchResults.argParams[i].paramType + : UnknownType.create() + ); + if (!areTypesSame(paramTypes, { treatAnySameAsUnknown: true })) { + return matches; + } + } + } + + return [matches[0]]; + } + function getBestOverloadForArguments( errorNode: ExpressionNode, - type: OverloadedFunctionType, + typeResult: TypeResult, argList: FunctionArgument[] ): FunctionType | undefined { let overloadIndex = 0; let matches: MatchArgsToParamsResult[] = []; // Create a list of potential overload matches based on arguments. - OverloadedFunctionType.getOverloads(type).forEach((overload) => { + OverloadedFunctionType.getOverloads(typeResult.type).forEach((overload) => { useSpeculativeMode(errorNode, () => { - const matchResults = matchFunctionArgumentsToParameters(errorNode, argList, overload, overloadIndex); + const matchResults = matchFunctionArgumentsToParameters( + errorNode, + argList, + { type: overload, isIncomplete: typeResult.isIncomplete }, + overloadIndex + ); if (!matchResults.argumentErrors) { matches.push(matchResults); @@ -7597,10 +8357,10 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions function validateOverloadedFunctionArguments( errorNode: ExpressionNode, argList: FunctionArgument[], - type: OverloadedFunctionType, + typeResult: TypeResult, typeVarContext: TypeVarContext | undefined, skipUnknownArgCheck: boolean, - expectedType: Type | undefined + inferenceContext: InferenceContext | undefined ): CallResult { let filteredMatchResults: MatchArgsToParamsResult[] = []; let contextFreeArgTypes: Type[] | undefined; @@ -7612,11 +8372,16 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // cache or record any diagnostics at this stage. useSpeculativeMode(errorNode, () => { let overloadIndex = 0; - OverloadedFunctionType.getOverloads(type).forEach((overload) => { + OverloadedFunctionType.getOverloads(typeResult.type).forEach((overload) => { // Consider only the functions that have the @overload decorator, // not the final function that omits the overload. This is the // intended behavior according to PEP 484. - const matchResults = matchFunctionArgumentsToParameters(errorNode, argList, overload, overloadIndex); + const matchResults = matchFunctionArgumentsToParameters( + errorNode, + argList, + { type: overload, isIncomplete: typeResult.isIncomplete }, + overloadIndex + ); if (!matchResults.argumentErrors) { filteredMatchResults.push(matchResults); } @@ -7633,7 +8398,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // Skip the error message if we're in speculative mode because it's very // expensive, and we're going to suppress the diagnostic anyway. if (!isDiagnosticSuppressedForNode(errorNode)) { - const functionName = type.overloads[0].details.name || ''; + const functionName = typeResult.type.overloads[0].details.name || ''; const diagAddendum = new DiagnosticAddendum(); const argTypes = argList.map((t) => printType(getTypeOfArgument(t).type)); @@ -7648,7 +8413,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions ); } - return { argumentErrors: true, isTypeIncomplete: false }; + return { argumentErrors: true, isTypeIncomplete: false, overloadsUsedForCall: [] }; } // Create a helper lambda that evaluates the overload that matches @@ -7662,6 +8427,9 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions const effectiveTypeVarContext = typeVarContext ?? new TypeVarContext(); effectiveTypeVarContext.addSolveForScope(getTypeVarScopeId(lastMatch.overload)); + if (lastMatch.overload.details.constructorTypeVarScopeId) { + effectiveTypeVarContext.addSolveForScope(lastMatch.overload.details.constructorTypeVarScopeId); + } effectiveTypeVarContext.unlock(); return validateFunctionArgumentTypesWithExpectedType( @@ -7669,7 +8437,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions lastMatch, effectiveTypeVarContext, skipUnknownArgCheck, - expectedType + inferenceContext ); }; @@ -7681,7 +8449,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } let expandedArgTypes: (Type | undefined)[][] | undefined = [argList.map((arg) => undefined)]; - let isTypeIncomplete = false; + let isTypeIncomplete = !!typeResult.isIncomplete; while (true) { const callResult = validateOverloadsWithExpandedTypes( @@ -7690,7 +8458,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions filteredMatchResults, typeVarContext, skipUnknownArgCheck, - expectedType + inferenceContext ); if (callResult.isTypeIncomplete) { @@ -7706,7 +8474,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions if (!contextFreeArgTypes) { useSpeculativeMode(errorNode, () => { // Evaluate the types of each argument expression without regard to - // the expectedType. We'll use this to determine whether we need to do + // the context. We'll use this to determine whether we need to do // union expansion. contextFreeArgTypes = argList.map((arg) => { if (arg.typeResult) { @@ -7742,10 +8510,10 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // Replace the result with an unknown type since we don't know // what overload should have been used. result.returnType = UnknownType.create(); - return result; + return { ...result, argumentErrors: true }; } - return { argumentErrors: true, isTypeIncomplete: false }; + return { argumentErrors: true, isTypeIncomplete: false, overloadsUsedForCall: [] }; } // Replaces each item in the expandedArgTypes with n items where n is @@ -7813,13 +8581,14 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions argList: FunctionArgument[], type: ClassType, skipUnknownArgCheck: boolean, - expectedType: Type | undefined + inferenceContext: InferenceContext | undefined ): CallResult { let validatedTypes = false; let returnType: Type | undefined; let reportedErrors = false; let isTypeIncomplete = false; let usedMetaclassCallMethod = false; + const overloadsUsedForCall: FunctionType[] = []; // Create a helper function that determines whether we should skip argument // validation for either __init__ or __new__. This is required for certain @@ -7846,22 +8615,24 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // If there is an expected type, analyze the constructor call // for each of the subtypes that comprise the expected type. If // one or more analyzes with no errors, use those results. - if (expectedType) { + if (inferenceContext) { const expectedCallResult = validateConstructorMethodWithExpectedType( errorNode, argList, type, skipUnknownArgCheck, - expectedType, + inferenceContext, initMethodType ); - if (expectedCallResult) { + if (expectedCallResult && !expectedCallResult.argumentErrors) { returnType = expectedCallResult.returnType; if (expectedCallResult.isTypeIncomplete) { isTypeIncomplete = true; } + + overloadsUsedForCall.push(...expectedCallResult.overloadsUsedForCall); } } @@ -7891,13 +8662,15 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions returnType = applyExpectedTypeForConstructor( adjustedClassType, - /* expectedType */ undefined, + /* inferenceContext */ undefined, typeVarContext ); if (callResult.isTypeIncomplete) { isTypeIncomplete = true; } + + overloadsUsedForCall.push(...callResult.overloadsUsedForCall); } else { reportedErrors = true; } @@ -7952,21 +8725,23 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions if (constructorMethodInfo && !skipConstructorCheck(constructorMethodInfo.type)) { const constructorMethodType = constructorMethodInfo.type; + let newReturnType: Type | undefined; // If there is an expected type that was not applied above when // handling the __init__ method, try to apply it with the __new__ method. - if (expectedType && !returnType) { + if (inferenceContext && !returnType) { const expectedCallResult = validateConstructorMethodWithExpectedType( errorNode, argList, type, skipUnknownArgCheck, - expectedType, + inferenceContext, constructorMethodType ); - if (expectedCallResult) { - returnType = expectedCallResult.returnType; + if (expectedCallResult && !expectedCallResult.argumentErrors) { + newReturnType = expectedCallResult.returnType; + returnType = newReturnType; if (expectedCallResult.isTypeIncomplete) { isTypeIncomplete = true; @@ -7983,22 +8758,38 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions typeVarContext.addSolveForScope(getTypeVarScopeId(constructorMethodType)); // Skip the unknown argument check if we've already checked for __init__. - const callResult = validateCallArguments( - errorNode, - argList, - constructorMethodInfo, - typeVarContext, - skipUnknownArgCheck - ); + let callResult: CallResult; + if (hasConstructorTransform(type)) { + // Use speculative mode if we're going to later apply + // a constructor transform. This allows us to use bidirectional + // type inference for arguments in the transform. + callResult = useSpeculativeMode(errorNode, () => { + return validateCallArguments( + errorNode, + argList, + constructorMethodInfo!, + typeVarContext, + skipUnknownArgCheck + ); + }); + } else { + callResult = validateCallArguments( + errorNode, + argList, + constructorMethodInfo, + typeVarContext, + skipUnknownArgCheck + ); + } + + if (callResult.isTypeIncomplete) { + isTypeIncomplete = true; + } if (callResult.argumentErrors) { reportedErrors = true; - } else { - let newReturnType = callResult.returnType; - - if (callResult.isTypeIncomplete) { - isTypeIncomplete = true; - } + } else if (!newReturnType) { + newReturnType = callResult.returnType; // If the constructor returned an object whose type matches the class of // the original type being constructed, use the return type in case it was @@ -8039,9 +8830,9 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } if (!returnType) { - returnType = applyExpectedTypeForConstructor(type, expectedType, typeVarContext); + returnType = applyExpectedTypeForConstructor(type, inferenceContext, typeVarContext); } else if (isClassInstance(returnType) && isTupleClass(returnType) && !returnType.tupleTypeArguments) { - returnType = applyExpectedTypeForTupleConstructor(returnType, expectedType); + returnType = applyExpectedTypeForTupleConstructor(returnType, inferenceContext); } validatedTypes = true; } @@ -8057,7 +8848,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions }); } - if (!validatedTypes && argList.length > 0) { + if (!validatedTypes && argList.some((arg) => arg.argumentCategory === ArgumentCategory.Simple)) { // Suppress this error if the class was instantiated from a custom // metaclass because it's likely that it's a false positive. Also // suppress the error if the class's metaclass has a __call__ method. @@ -8080,7 +8871,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions if (!returnType) { // There was no __init__ or __new__ method or we couldn't match the provided // arguments to them. - if (!expectedType && type.typeArguments) { + if (!inferenceContext && type.typeArguments) { // If there was no expected type but the type was already specialized, // assume that we're constructing an instance of the specialized type. returnType = convertToInstance(type); @@ -8089,17 +8880,17 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // type if provided. const typeVarContext = new TypeVarContext(getTypeVarScopeId(type)); - if (expectedType) { + if (inferenceContext) { populateTypeVarContextBasedOnExpectedType( evaluatorInterface, ClassType.cloneAsInstance(type), - expectedType, + inferenceContext.expectedType, typeVarContext, getTypeVarScopesForNode(errorNode) ); } - returnType = applyExpectedTypeForConstructor(type, expectedType, typeVarContext); + returnType = applyExpectedTypeForConstructor(type, inferenceContext, typeVarContext); } } @@ -8121,7 +8912,12 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } } - const result: CallResult = { argumentErrors: reportedErrors, returnType, isTypeIncomplete }; + const result: CallResult = { + argumentErrors: reportedErrors, + returnType, + isTypeIncomplete, + overloadsUsedForCall, + }; return result; } @@ -8134,13 +8930,14 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions argList: FunctionArgument[], type: ClassType, skipUnknownArgCheck: boolean, - expectedType: Type, + inferenceContext: InferenceContext, constructorMethodType: Type ): CallResult | undefined { let isTypeIncomplete = false; let argumentErrors = false; + const overloadsUsedForCall: FunctionType[] = []; - const returnType = mapSubtypes(expectedType, (expectedSubType) => { + const returnType = mapSubtypes(inferenceContext.expectedType, (expectedSubType) => { expectedSubType = transformPossibleRecursiveTypeAlias(expectedSubType); const typeVarContext = new TypeVarContext(getTypeVarScopeId(type)); if ( @@ -8163,10 +8960,10 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions ); }); - if (!callResult?.argumentErrors) { + if (!callResult!.argumentErrors) { // Call validateCallArguments again, this time without speculative // mode, so any errors are reported. - const callResult = validateCallArguments( + callResult = validateCallArguments( errorNode, argList, { type: constructorMethodType }, @@ -8182,6 +8979,8 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions argumentErrors = true; } + overloadsUsedForCall.push(...callResult.overloadsUsedForCall); + return applyExpectedSubtypeForConstructor(type, expectedSubType, typeVarContext); } } @@ -8193,7 +8992,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions return undefined; } - return { returnType, isTypeIncomplete, argumentErrors }; + return { returnType, isTypeIncomplete, argumentErrors, overloadsUsedForCall }; } function applyExpectedSubtypeForConstructor( @@ -8219,13 +9018,13 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // arguments are not specified but can be provided by the expected type. function applyExpectedTypeForConstructor( type: ClassType, - expectedType: Type | undefined, + inferenceContext: InferenceContext | undefined, typeVarContext: TypeVarContext ): Type { let unsolvedTypeVarsAreUnknown = true; - if (expectedType) { - const specializedExpectedType = mapSubtypes(expectedType, (expectedSubtype) => { + if (inferenceContext) { + const specializedExpectedType = mapSubtypes(inferenceContext.expectedType, (expectedSubtype) => { return applyExpectedSubtypeForConstructor(type, expectedSubtype, typeVarContext); }); @@ -8241,22 +9040,24 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } } - const specializedType = applySolvedTypeVars(type, typeVarContext, unsolvedTypeVarsAreUnknown) as ClassType; + const specializedType = applySolvedTypeVars(type, typeVarContext, { + unknownIfNotFound: unsolvedTypeVarsAreUnknown, + }) as ClassType; return ClassType.cloneAsInstance(specializedType); } // Similar to applyExpectedTypeForConstructor, this function handles the // special case of the tuple class. - function applyExpectedTypeForTupleConstructor(type: ClassType, expectedType: Type | undefined) { + function applyExpectedTypeForTupleConstructor(type: ClassType, inferenceContext: InferenceContext | undefined) { let specializedType = type; if ( - expectedType && - isClassInstance(expectedType) && - isTupleClass(expectedType) && - expectedType.tupleTypeArguments + inferenceContext && + isClassInstance(inferenceContext.expectedType) && + isTupleClass(inferenceContext.expectedType) && + inferenceContext.expectedType.tupleTypeArguments ) { - specializedType = specializeTupleClass(type, expectedType.tupleTypeArguments); + specializedType = specializeTupleClass(type, inferenceContext.expectedType.tupleTypeArguments); } return specializedType; @@ -8265,22 +9066,23 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // Validates that the arguments can be assigned to the call's parameter // list, specializes the call based on arg types, and returns the // specialized type of the return value. If it detects an error along - // the way, it emits a diagnostic and returns undefined. + // the way, it emits a diagnostic and sets argumentErrors to true. function validateCallArguments( errorNode: ExpressionNode, argList: FunctionArgument[], callTypeResult: TypeResult, typeVarContext?: TypeVarContext, skipUnknownArgCheck = false, - expectedType?: Type, + inferenceContext?: InferenceContext, recursionCount = 0 ): CallResult { let argumentErrors = false; let isTypeIncomplete = false; let specializedInitSelfType: Type | undefined; + const overloadsUsedForCall: FunctionType[] = []; if (recursionCount > maxTypeRecursionCount) { - return { returnType: UnknownType.create(), argumentErrors: true }; + return { returnType: UnknownType.create(), argumentErrors: true, overloadsUsedForCall }; } recursionCount++; @@ -8291,14 +9093,14 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions DiagnosticRule.reportGeneralTypeIssues, Localizer.Diagnostic.typeNotCallable().format({ expression: ParseTreeUtils.printExpression(exprNode), - type: printType(callTypeResult.type, /* expandTypeAlias */ true), + type: printType(callTypeResult.type, { expandTypeAlias: true }), }), exprNode ); - return { returnType: UnknownType.create(), argumentErrors: true }; + return { returnType: UnknownType.create(), argumentErrors: true, overloadsUsedForCall }; } - const returnType = mapSubtypesExpandTypeVars( + let returnType = mapSubtypesExpandTypeVars( callTypeResult.type, /* conditionFilter */ undefined, (expandedSubtype, unexpandedSubtype) => { @@ -8320,6 +9122,19 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } case TypeCategory.Function: { + if (TypeBase.isInstantiable(expandedSubtype)) { + addDiagnostic( + AnalyzerNodeInfo.getFileInfo(errorNode).diagnosticRuleSet.reportGeneralTypeIssues, + DiagnosticRule.reportGeneralTypeIssues, + Localizer.Diagnostic.callableNotInstantiable().format({ + type: printType(expandedSubtype), + }), + errorNode + ); + argumentErrors = true; + return undefined; + } + // The stdlib collections/__init__.pyi stub file defines namedtuple // as a function rather than a class, so we need to check for it here. if (expandedSubtype.details.builtInName === 'namedtuple') { @@ -8351,10 +9166,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // the call is a constructor but the proper TypeVar scope has been lost. // We'll add a wildcard TypeVar scope here. This is a bit of a hack and // we may need to revisit this in the future. - if ( - !effectiveTypeVarContext.getSolveForScopes() && - FunctionType.isConstructorMethod(expandedSubtype) - ) { + if (FunctionType.isConstructorMethod(expandedSubtype)) { effectiveTypeVarContext.addSolveForScope(WildcardTypeVarScopeId); } } @@ -8362,16 +9174,18 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions const functionResult = validateFunctionArguments( errorNode, argList, - expandedSubtype, + { type: expandedSubtype, isIncomplete: callTypeResult.isIncomplete }, effectiveTypeVarContext, skipUnknownArgCheck, - expectedType + inferenceContext ); if (functionResult.isTypeIncomplete) { isTypeIncomplete = true; } + overloadsUsedForCall.push(...functionResult.overloadsUsedForCall); + if (functionResult.argumentErrors) { argumentErrors = true; } else { @@ -8438,12 +9252,14 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions const functionResult = validateOverloadedFunctionArguments( errorNode, argList, - expandedSubtype, + { type: expandedSubtype, isIncomplete: callTypeResult.isIncomplete }, typeVarContext, skipUnknownArgCheck, - expectedType + inferenceContext ); + overloadsUsedForCall.push(...functionResult.overloadsUsedForCall); + if (functionResult.isTypeIncomplete) { isTypeIncomplete = true; } @@ -8501,7 +9317,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions argList, expandedSubtype, skipUnknownArgCheck, - expectedType + inferenceContext ); // Handle the 'type' call specially. @@ -8516,6 +9332,8 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions isNoneInstance(subtype) ) { return convertToInstantiable(stripLiteralValue(subtype)); + } else if (isFunction(subtype) && TypeBase.isInstance(subtype)) { + return FunctionType.cloneAsInstantiable(subtype); } return AnyType.create(); @@ -8573,8 +9391,8 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions return AnyType.create(); } - if (isKnownEnumType(className)) { - return createEnumType(errorNode, expandedSubtype, argList); + if (isClass(unexpandedSubtype) && isKnownEnumType(className)) { + return createEnumType(errorNode, expandedSubtype, argList) ?? UnknownType.create(); } if (className === 'TypedDict') { @@ -8647,9 +9465,11 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions argList, expandedSubtype, skipUnknownArgCheck, - expectedType + inferenceContext ); + overloadsUsedForCall.push(...constructorResult.overloadsUsedForCall); + if (constructorResult.argumentErrors) { argumentErrors = true; } @@ -8708,18 +9528,28 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions return returnType; } else { - const memberType = getTypeOfObjectMember(errorNode, expandedSubtype, '__call__')?.type; + const memberType = getTypeOfObjectMember( + errorNode, + expandedSubtype, + '__call__', + /* usage */ undefined, + /* diag */ undefined, + MemberAccessFlags.SkipAttributeAccessOverride + )?.type; - if (memberType && (isFunction(memberType) || isOverloadedFunction(memberType))) { + if (memberType) { const functionResult = validateCallArguments( errorNode, argList, { type: memberType }, typeVarContext, skipUnknownArgCheck, - expectedType, + inferenceContext, recursionCount ); + + overloadsUsedForCall.push(...functionResult.overloadsUsedForCall); + if (functionResult.argumentErrors) { argumentErrors = true; } @@ -8753,6 +9583,30 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } case TypeCategory.None: { + if (TypeBase.isInstantiable(expandedSubtype)) { + if (noneType && isInstantiableClass(noneType)) { + const functionResult = validateCallArguments( + errorNode, + argList, + { type: noneType }, + typeVarContext, + skipUnknownArgCheck, + inferenceContext, + recursionCount + ); + + if (functionResult.isTypeIncomplete) { + isTypeIncomplete = true; + } + + if (functionResult.argumentErrors) { + argumentErrors = true; + } + } + + return NoneType.createInstance(); + } + addDiagnostic( AnalyzerNodeInfo.getFileInfo(errorNode).diagnosticRuleSet.reportOptionalCall, DiagnosticRule.reportOptionalCall, @@ -8775,10 +9629,12 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions { type: expandedSubtype }, typeVarContext, skipUnknownArgCheck, - expectedType, + inferenceContext, recursionCount ); + overloadsUsedForCall.push(...callResult.overloadsUsedForCall); + if (callResult.argumentErrors) { argumentErrors = true; } @@ -8801,14 +9657,71 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } ); + // If we ended up with a "Never" type because all code paths returned + // undefined due to argument errors, transform the result into an Unknown + // to avoid subsequent false positives. + if (argumentErrors && isNever(returnType) && !returnType.isNoReturn) { + returnType = UnknownType.create(); + } + return { argumentErrors, - returnType: isNever(returnType) && !returnType.isNoReturn ? undefined : returnType, + returnType, isTypeIncomplete, specializedInitSelfType, + overloadsUsedForCall, }; } + // Expands any unpacked tuples within an argument list. + function expandArgList(argList: FunctionArgument[]): FunctionArgument[] { + const expandedArgList: FunctionArgument[] = []; + + for (const arg of argList) { + if (arg.argumentCategory === ArgumentCategory.UnpackedList) { + const argType = getTypeOfArgument(arg).type; + + // If this is a tuple with specified element types, use those + // specified types rather than using the more generic iterator + // type which will be a union of all element types. + const combinedArgType = combineSameSizedTuples(makeTopLevelTypeVarsConcrete(argType), tupleClassType); + + if (isClassInstance(combinedArgType) && isTupleClass(combinedArgType)) { + const tupleTypeArgs = combinedArgType.tupleTypeArguments ?? []; + + if (tupleTypeArgs.length !== 1) { + for (const tupleTypeArg of tupleTypeArgs) { + if (tupleTypeArg.isUnbounded) { + expandedArgList.push({ + ...arg, + argumentCategory: ArgumentCategory.UnpackedList, + valueExpression: undefined, + typeResult: { + type: specializeTupleClass(combinedArgType, [tupleTypeArg]), + }, + }); + } else { + expandedArgList.push({ + ...arg, + argumentCategory: ArgumentCategory.Simple, + valueExpression: undefined, + typeResult: { + type: tupleTypeArg.type, + }, + }); + } + } + continue; + } + } + } + + expandedArgList.push(arg); + } + + return expandedArgList; + } + // Matches the arguments passed to a function to the corresponding parameters in that // function. This matching is done based on positions and keywords. Type evaluation and // validation is left to the caller. @@ -8816,16 +9729,19 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions function matchFunctionArgumentsToParameters( errorNode: ExpressionNode, argList: FunctionArgument[], - type: FunctionType, + typeResult: TypeResult, overloadIndex: number ): MatchArgsToParamsResult { - const paramDetails = getParameterListDetails(type); + const paramDetails = getParameterListDetails(typeResult.type); let argIndex = 0; let matchedUnpackedListOfUnknownLength = false; let reportedArgError = false; - let isTypeIncomplete = false; + let isTypeIncomplete = !!typeResult.isIncomplete; let isVariadicTypeVarFullyMatched = false; + // Expand any unpacked tuples in the arg list. + argList = expandArgList(argList); + // Build a map of parameters by name. const paramMap = new Map(); paramDetails.params.forEach((paramInfo) => { @@ -8871,8 +9787,8 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // function nested within another function that defines the param // spec? We need to handle these two cases differently. if ( - varArgListParam.type.scopeId === type.details.typeVarScopeId || - varArgListParam.type.scopeId === type.details.constructorTypeVarScopeId + varArgListParam.type.scopeId === typeResult.type.details.typeVarScopeId || + varArgListParam.type.scopeId === typeResult.type.details.constructorTypeVarScopeId ) { paramSpecArgList = []; paramSpecTarget = TypeVarType.cloneForParamSpecAccess(varArgListParam.type, /* access */ undefined); @@ -8930,12 +9846,11 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } } - let foundUnpackedListArg = + const foundUnpackedListArg = argList.find((arg) => arg.argumentCategory === ArgumentCategory.UnpackedList) !== undefined; // Map the positional args to parameters. let paramIndex = 0; - let unpackedArgIndex = 0; while (argIndex < positionalArgCount) { if (argIndex < positionalOnlyLimitIndex && argList[argIndex].name) { @@ -8949,19 +9864,47 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions reportedArgError = true; } + const remainingArgCount = positionalArgCount - argIndex; + const remainingParamCount = positionParamLimitIndex - paramIndex - 1; + if (paramIndex >= positionParamLimitIndex) { - if (!foundUnpackedListArg || argList[argIndex].argumentCategory !== ArgumentCategory.UnpackedList) { - addDiagnostic( - AnalyzerNodeInfo.getFileInfo(errorNode).diagnosticRuleSet.reportGeneralTypeIssues, - DiagnosticRule.reportGeneralTypeIssues, - positionParamLimitIndex === 1 - ? Localizer.Diagnostic.argPositionalExpectedOne() - : Localizer.Diagnostic.argPositionalExpectedCount().format({ - expected: positionParamLimitIndex, - }), - argList[argIndex].valueExpression || errorNode - ); - reportedArgError = true; + if (!typeResult.type.details.paramSpec) { + let tooManyPositionals = false; + + if (foundUnpackedListArg && argList[argIndex].argumentCategory === ArgumentCategory.UnpackedList) { + // If this is an unpacked iterable, we will conservatively assume that it + // might have zero iterations unless we can tell from its type that it + // definitely has at least one iterable value. + const argType = getTypeOfArgument(argList[argIndex]).type; + + if ( + isClassInstance(argType) && + isTupleClass(argType) && + !isUnboundedTupleClass(argType) && + argType.tupleTypeArguments !== undefined && + argType.tupleTypeArguments.length > 0 + ) { + tooManyPositionals = true; + } + } else { + tooManyPositionals = true; + } + + if (tooManyPositionals) { + if (!isDiagnosticSuppressedForNode(errorNode)) { + addDiagnostic( + AnalyzerNodeInfo.getFileInfo(errorNode).diagnosticRuleSet.reportGeneralTypeIssues, + DiagnosticRule.reportGeneralTypeIssues, + positionParamLimitIndex === 1 + ? Localizer.Diagnostic.argPositionalExpectedOne() + : Localizer.Diagnostic.argPositionalExpectedCount().format({ + expected: positionParamLimitIndex, + }), + argList[argIndex].valueExpression ?? errorNode + ); + } + reportedArgError = true; + } } break; } @@ -8972,17 +9915,15 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions assert(paramDetails.params[paramIndex], 'paramIndex params entry is undefined'); const paramType = paramDetails.params[paramIndex].type; - if (argList[argIndex].argumentCategory === ArgumentCategory.UnpackedList) { - if (!argList[argIndex].valueExpression) { - break; - } + const paramName = paramDetails.params[paramIndex].param.name; + + const isParamVariadic = + paramDetails.params[paramIndex].param.category === ParameterCategory.VarArgList && + isVariadicTypeVar(paramType); - const isParamVariadic = - paramDetails.params[paramIndex].param.category === ParameterCategory.VarArgList && - isVariadicTypeVar(paramType); + if (argList[argIndex].argumentCategory === ArgumentCategory.UnpackedList) { let isArgCompatibleWithVariadic = false; const argTypeResult = getTypeOfArgument(argList[argIndex]); - const argType = argTypeResult.type; let listElementType: Type | undefined; let advanceToNextArg = false; @@ -8990,49 +9931,25 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // with a ParamSpec and a Concatenate operator. PEP 612 indicates that // all positional parameters specified in the Concatenate must be // filled explicitly. - if (type.details.paramSpec && paramIndex < positionParamLimitIndex) { - addDiagnostic( - AnalyzerNodeInfo.getFileInfo(errorNode).diagnosticRuleSet.reportGeneralTypeIssues, - DiagnosticRule.reportGeneralTypeIssues, - positionParamLimitIndex === 1 - ? Localizer.Diagnostic.argPositionalExpectedOne() - : Localizer.Diagnostic.argPositionalExpectedCount().format({ - expected: positionParamLimitIndex, - }), - argList[argIndex].valueExpression || errorNode - ); + if (typeResult.type.details.paramSpec && paramIndex < positionParamLimitIndex) { + if (!isDiagnosticSuppressedForNode(errorNode)) { + addDiagnostic( + AnalyzerNodeInfo.getFileInfo(errorNode).diagnosticRuleSet.reportGeneralTypeIssues, + DiagnosticRule.reportGeneralTypeIssues, + positionParamLimitIndex === 1 + ? Localizer.Diagnostic.argPositionalExpectedOne() + : Localizer.Diagnostic.argPositionalExpectedCount().format({ + expected: positionParamLimitIndex, + }), + argList[argIndex].valueExpression ?? errorNode + ); + } reportedArgError = true; } - // If this is a tuple with specified element types, use those - // specified types rather than using the more generic iterator - // type which will be a union of all element types. - const combinedTupleType = combineSameSizedTuples(makeTopLevelTypeVarsConcrete(argType), tupleClassType); + const argType = argTypeResult.type; - if ( - !isParamVariadic && - combinedTupleType && - isClassInstance(combinedTupleType) && - combinedTupleType.tupleTypeArguments && - combinedTupleType.tupleTypeArguments.length > 0 && - unpackedArgIndex < combinedTupleType.tupleTypeArguments.length - ) { - listElementType = combinedTupleType.tupleTypeArguments[unpackedArgIndex].type; - - // Determine if there are any more unpacked list arguments after - // this one. If not, we'll clear this flag because this unpacked - // list arg is bounded in length. - foundUnpackedListArg = - argList.find( - (arg, index) => index > argIndex && arg.argumentCategory === ArgumentCategory.UnpackedList - ) !== undefined; - - unpackedArgIndex++; - if (unpackedArgIndex >= combinedTupleType.tupleTypeArguments.length) { - unpackedArgIndex = 0; - advanceToNextArg = true; - } - } else if (isParamVariadic && isVariadicTypeVar(argType)) { + if (isParamVariadic && isUnpackedVariadicTypeVar(argType)) { // Allow an unpacked variadic type variable to satisfy an // unpacked variadic type variable. listElementType = argType; @@ -9044,7 +9961,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions isTupleClass(argType) && argType.tupleTypeArguments && argType.tupleTypeArguments.length === 1 && - isVariadicTypeVar(argType.tupleTypeArguments[0].type) + isUnpackedVariadicTypeVar(argType.tupleTypeArguments[0].type) ) { // Handle the case where an unpacked variadic type var has // been packaged into a tuple. @@ -9052,12 +9969,28 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions isArgCompatibleWithVariadic = true; advanceToNextArg = true; isVariadicTypeVarFullyMatched = true; + } else if (isParamVariadic && isClassInstance(argType) && isTupleClass(argType)) { + // Handle the case where an unpacked tuple argument is + // matched to a TypeVarTuple parameter. + isArgCompatibleWithVariadic = true; + advanceToNextArg = true; + + // Determine whether we should treat the variadic type as fully matched. + // This depends on how many args and unmatched parameters exist. + if (remainingArgCount < remainingParamCount) { + isVariadicTypeVarFullyMatched = true; + } + + listElementType = ClassType.cloneForUnpacked(argType); } else if (isParamSpec(argType) && argType.paramSpecAccess === 'args') { listElementType = undefined; } else { listElementType = - getTypeOfIterator(argType, /* isAsync */ false, argList[argIndex].valueExpression!) || - UnknownType.create(); + getTypeOfIterator( + { type: argType, isIncomplete: argTypeResult.isIncomplete }, + /* isAsync */ false, + argList[argIndex].valueExpression! + )?.type ?? UnknownType.create(); if (paramDetails.params[paramIndex].param.category !== ParameterCategory.VarArgList) { matchedUnpackedListOfUnknownLength = true; @@ -9074,17 +10007,17 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions isTypeIncomplete = true; } - const paramName = paramDetails.params[paramIndex].param.name; - // It's not allowed to use unpacked arguments with a variadic *args // parameter unless the argument is a variadic arg as well. if (isParamVariadic && !isArgCompatibleWithVariadic) { - addDiagnostic( - AnalyzerNodeInfo.getFileInfo(errorNode).diagnosticRuleSet.reportGeneralTypeIssues, - DiagnosticRule.reportGeneralTypeIssues, - Localizer.Diagnostic.unpackedArgWithVariadicParam(), - argList[argIndex].valueExpression || errorNode - ); + if (!isDiagnosticSuppressedForNode(errorNode)) { + addDiagnostic( + AnalyzerNodeInfo.getFileInfo(errorNode).diagnosticRuleSet.reportGeneralTypeIssues, + DiagnosticRule.reportGeneralTypeIssues, + Localizer.Diagnostic.unpackedArgWithVariadicParam(), + argList[argIndex].valueExpression || errorNode + ); + } reportedArgError = true; } else { if (paramSpecArgList) { @@ -9097,9 +10030,10 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions paramType, requiresTypeVarMatching: requiresSpecialization(paramType), argument: funcArg, - errorNode: argList[argIndex].valueExpression || errorNode, + errorNode: argList[argIndex].valueExpression ?? errorNode, paramName, isParamNameSynthesized: paramDetails.params[paramIndex].param.isNameSynthesized, + mapsToVarArgList: isParamVariadic && remainingArgCount > remainingParamCount, }); } } @@ -9151,22 +10085,21 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions ? ParameterCategory.VarArgList : ParameterCategory.Simple; - const remainingArgCount = positionalArgCount - argIndex; - const remainingParamCount = positionParamLimitIndex - paramIndex - 1; - if (remainingArgCount <= remainingParamCount) { if (remainingArgCount < remainingParamCount) { - // Have we run out of arguments and still have parameters left to fill? - addDiagnostic( - AnalyzerNodeInfo.getFileInfo(errorNode).diagnosticRuleSet.reportGeneralTypeIssues, - DiagnosticRule.reportGeneralTypeIssues, - remainingArgCount === 1 - ? Localizer.Diagnostic.argMorePositionalExpectedOne() - : Localizer.Diagnostic.argMorePositionalExpectedCount().format({ - expected: remainingArgCount, - }), - argList[argIndex].valueExpression || errorNode - ); + if (!isDiagnosticSuppressedForNode(errorNode)) { + // Have we run out of arguments and still have parameters left to fill? + addDiagnostic( + AnalyzerNodeInfo.getFileInfo(errorNode).diagnosticRuleSet.reportGeneralTypeIssues, + DiagnosticRule.reportGeneralTypeIssues, + remainingArgCount === 1 + ? Localizer.Diagnostic.argMorePositionalExpectedOne() + : Localizer.Diagnostic.argMorePositionalExpectedCount().format({ + expected: remainingArgCount, + }), + argList[argIndex].valueExpression || errorNode + ); + } reportedArgError = true; } @@ -9209,6 +10142,20 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } } + // If there weren't enough positional arguments to populate all of the + // positional-only parameters and the next positional-only parameter is + // an unbounded tuple, skip past it. + let skippedArgsParam = false; + if ( + positionalOnlyLimitIndex >= 0 && + paramIndex < positionalOnlyLimitIndex && + paramDetails.params[paramIndex].param.category === ParameterCategory.VarArgList && + !isParamSpec(paramDetails.params[paramIndex].param.type) + ) { + paramIndex++; + skippedArgsParam = true; + } + // Check if there weren't enough positional arguments to populate all of // the positional-only parameters. if ( @@ -9221,20 +10168,41 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions firstParamWithDefault >= 0 && firstParamWithDefault < positionalOnlyLimitIndex ? firstParamWithDefault : positionalOnlyLimitIndex; - const argsRemainingCount = positionOnlyWithoutDefaultsCount - positionalArgCount; + + // Calculate the number of remaining positional parameters to report. + let argsRemainingCount = positionOnlyWithoutDefaultsCount - positionalArgCount; + if (skippedArgsParam) { + // If we skipped an args parameter above, reduce the count by one + // because it's permitted to pass zero arguments to *args. + argsRemainingCount--; + } + + const firstArgsParam = paramDetails.params.findIndex( + (paramInfo) => + paramInfo.param.category === ParameterCategory.VarArgList && !isParamSpec(paramInfo.param.type) + ); + if (firstArgsParam >= paramIndex && firstArgsParam < positionalOnlyLimitIndex) { + // If there is another args parameter beyond the current param index, + // reduce the count by one because it's permitted to pass zero arguments + // to *args. + argsRemainingCount--; + } + if (argsRemainingCount > 0) { - addDiagnostic( - AnalyzerNodeInfo.getFileInfo(errorNode).diagnosticRuleSet.reportGeneralTypeIssues, - DiagnosticRule.reportGeneralTypeIssues, - argsRemainingCount === 1 - ? Localizer.Diagnostic.argMorePositionalExpectedOne() - : Localizer.Diagnostic.argMorePositionalExpectedCount().format({ - expected: argsRemainingCount, - }), - argList.length > positionalArgCount - ? argList[positionalArgCount].valueExpression || errorNode - : errorNode - ); + if (!isDiagnosticSuppressedForNode(errorNode)) { + addDiagnostic( + AnalyzerNodeInfo.getFileInfo(errorNode).diagnosticRuleSet.reportGeneralTypeIssues, + DiagnosticRule.reportGeneralTypeIssues, + argsRemainingCount === 1 + ? Localizer.Diagnostic.argMorePositionalExpectedOne() + : Localizer.Diagnostic.argMorePositionalExpectedCount().format({ + expected: argsRemainingCount, + }), + argList.length > positionalArgCount + ? argList[positionalArgCount].valueExpression || errorNode + : errorNode + ); + } reportedArgError = true; } } @@ -9245,7 +10213,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // Now consume any keyword arguments. while (argIndex < argList.length) { if (argList[argIndex].argumentCategory === ArgumentCategory.UnpackedDictionary) { - // Verify that the type used in this expression is a Mapping[str, T]. + // Verify that the type used in this expression is a SupportsKeysAndGetItem[str, T]. const argType = getTypeOfArgument(argList[argIndex]).type; if (isAnyOrUnknown(argType)) { unpackedDictionaryArgType = argType; @@ -9313,27 +10281,32 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions }); if (!diag.isEmpty()) { - addDiagnostic( - AnalyzerNodeInfo.getFileInfo(errorNode).diagnosticRuleSet.reportGeneralTypeIssues, - DiagnosticRule.reportGeneralTypeIssues, - Localizer.Diagnostic.unpackedTypedDictArgument() + diag.getString(), - argList[argIndex].valueExpression || errorNode - ); + if (!isDiagnosticSuppressedForNode(errorNode)) { + addDiagnostic( + AnalyzerNodeInfo.getFileInfo(errorNode).diagnosticRuleSet.reportGeneralTypeIssues, + DiagnosticRule.reportGeneralTypeIssues, + Localizer.Diagnostic.unpackedTypedDictArgument() + diag.getString(), + argList[argIndex].valueExpression || errorNode + ); + } reportedArgError = true; } } else if (isParamSpec(argType) && argType.paramSpecAccess === 'kwargs') { unpackedDictionaryArgType = AnyType.create(); - if (type.details.paramSpec) { + if (typeResult.type.details.paramSpec) { validateArgTypeParams.push({ paramCategory: ParameterCategory.VarArgDictionary, - paramType: type.details.paramSpec, + paramType: typeResult.type.details.paramSpec, requiresTypeVarMatching: false, argument: argList[argIndex], errorNode: argList[argIndex].valueExpression || errorNode, }); } } else { - const mappingType = getTypingType(errorNode, 'Mapping'); + let mappingType = getTypeshedType(errorNode, 'SupportsKeysAndGetItem'); + if (!mappingType) { + mappingType = getTypingType(errorNode, 'Mapping'); + } const strObjType = getBuiltInObject(errorNode, 'str'); if ( @@ -9374,12 +10347,15 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } if (!isValidMappingType) { - addDiagnostic( - AnalyzerNodeInfo.getFileInfo(errorNode).diagnosticRuleSet.reportGeneralTypeIssues, - DiagnosticRule.reportGeneralTypeIssues, - Localizer.Diagnostic.unpackedDictArgumentNotMapping(), - argList[argIndex].valueExpression || errorNode - ); + if (!isDiagnosticSuppressedForNode(errorNode)) { + addDiagnostic( + AnalyzerNodeInfo.getFileInfo(errorNode).diagnosticRuleSet + .reportGeneralTypeIssues, + DiagnosticRule.reportGeneralTypeIssues, + Localizer.Diagnostic.unpackedDictArgumentNotMapping(), + argList[argIndex].valueExpression || errorNode + ); + } reportedArgError = true; } } @@ -9419,7 +10395,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions paramType, requiresTypeVarMatching: requiresSpecialization(paramType), argument: argList[argIndex], - errorNode: argList[argIndex].valueExpression || errorNode, + errorNode: argList[argIndex].valueExpression ?? errorNode, paramName: paramNameValue, }); trySetActive(argList[argIndex], paramDetails.params[paramInfoIndex].param); @@ -9434,7 +10410,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions paramType, requiresTypeVarMatching: requiresSpecialization(paramType), argument: argList[argIndex], - errorNode: argList[argIndex].valueExpression || errorNode, + errorNode: argList[argIndex].valueExpression ?? errorNode, paramName: paramNameValue, }); @@ -9460,22 +10436,24 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions reportedArgError = true; } } else if (argList[argIndex].argumentCategory === ArgumentCategory.Simple) { - const fileInfo = AnalyzerNodeInfo.getFileInfo(errorNode); - addDiagnostic( - fileInfo.diagnosticRuleSet.reportGeneralTypeIssues, - DiagnosticRule.reportGeneralTypeIssues, - positionParamLimitIndex === 1 - ? Localizer.Diagnostic.argPositionalExpectedOne() - : Localizer.Diagnostic.argPositionalExpectedCount().format({ - expected: positionParamLimitIndex, - }), - argList[argIndex].valueExpression || errorNode - ); + if (!isDiagnosticSuppressedForNode(errorNode)) { + const fileInfo = AnalyzerNodeInfo.getFileInfo(errorNode); + addDiagnostic( + fileInfo.diagnosticRuleSet.reportGeneralTypeIssues, + DiagnosticRule.reportGeneralTypeIssues, + positionParamLimitIndex === 1 + ? Localizer.Diagnostic.argPositionalExpectedOne() + : Localizer.Diagnostic.argPositionalExpectedCount().format({ + expected: positionParamLimitIndex, + }), + argList[argIndex].valueExpression || errorNode + ); + } reportedArgError = true; } else if (argList[argIndex].argumentCategory === ArgumentCategory.UnpackedList) { // Handle the case where a *args: P.args is passed as an argument to // a function that accepts a ParamSpec. - if (type.details.paramSpec) { + if (typeResult.type.details.paramSpec) { const argTypeResult = getTypeOfArgument(argList[argIndex]); const argType = argTypeResult.type; @@ -9486,10 +10464,10 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions if (isParamSpec(argType) && argType.paramSpecAccess === 'args') { validateArgTypeParams.push({ paramCategory: ParameterCategory.VarArgList, - paramType: type.details.paramSpec, + paramType: typeResult.type.details.paramSpec, requiresTypeVarMatching: false, argument: argList[argIndex], - errorNode: argList[argIndex].valueExpression || errorNode, + errorNode: argList[argIndex].valueExpression ?? errorNode, }); } } @@ -9540,22 +10518,24 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // but have not yet received them. If we received a dictionary argument // (i.e. an arg starting with a "**"), we will assume that all parameters // are matched. - if (!unpackedDictionaryArgType && !FunctionType.isDefaultParameterCheckDisabled(type)) { + if (!unpackedDictionaryArgType && !FunctionType.isDefaultParameterCheckDisabled(typeResult.type)) { const unassignedParams = [...paramMap.keys()].filter((name) => { const entry = paramMap.get(name)!; return !entry || entry.argsReceived < entry.argsNeeded; }); if (unassignedParams.length > 0) { - const missingParamNames = unassignedParams.map((p) => `"${p}"`).join(', '); - addDiagnostic( - AnalyzerNodeInfo.getFileInfo(errorNode).diagnosticRuleSet.reportGeneralTypeIssues, - DiagnosticRule.reportGeneralTypeIssues, - unassignedParams.length === 1 - ? Localizer.Diagnostic.argMissingForParam().format({ name: missingParamNames }) - : Localizer.Diagnostic.argMissingForParams().format({ names: missingParamNames }), - errorNode - ); + if (!isDiagnosticSuppressedForNode(errorNode)) { + const missingParamNames = unassignedParams.map((p) => `"${p}"`).join(', '); + addDiagnostic( + AnalyzerNodeInfo.getFileInfo(errorNode).diagnosticRuleSet.reportGeneralTypeIssues, + DiagnosticRule.reportGeneralTypeIssues, + unassignedParams.length === 1 + ? Localizer.Diagnostic.argMissingForParam().format({ name: missingParamNames }) + : Localizer.Diagnostic.argMissingForParams().format({ names: missingParamNames }), + errorNode + ); + } reportedArgError = true; } @@ -9584,7 +10564,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions argumentCategory: ArgumentCategory.Simple, typeResult: { type: defaultArgType }, }, - errorNode: errorNode, + errorNode, paramName: param.name, isParamNameSynthesized: param.isNameSynthesized, }); @@ -9612,7 +10592,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions const paramType = paramDetails.params[paramDetails.argsIndex].type; const variadicArgs = validateArgTypeParams.filter((argParam) => argParam.mapsToVarArgList); - if (isTypeVar(paramType) && paramType.details.isVariadic) { + if (isVariadicTypeVar(paramType) && !paramType.isVariadicInUnion) { if (tupleClassType && isInstantiableClass(tupleClassType)) { const tupleTypeArgs: TupleTypeArgument[] = variadicArgs.map((argParam) => { const argType = getTypeOfArgument(argParam.argument).type; @@ -9621,18 +10601,23 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions (isClassInstance(argType) && isTupleClass(argType) && argType.tupleTypeArguments && - argType.tupleTypeArguments.some((arg) => isUnpackedVariadicTypeVar(arg.type))); + argType.tupleTypeArguments.length === 1 && + isUnpackedVariadicTypeVar(argType.tupleTypeArguments[0].type)); if ( containsVariadicTypeVar && - argParam.argument.argumentCategory !== ArgumentCategory.UnpackedList + argParam.argument.argumentCategory !== ArgumentCategory.UnpackedList && + !argParam.mapsToVarArgList ) { - addDiagnostic( - AnalyzerNodeInfo.getFileInfo(errorNode).diagnosticRuleSet.reportGeneralTypeIssues, - DiagnosticRule.reportGeneralTypeIssues, - Localizer.Diagnostic.typeVarTupleMustBeUnpacked(), - argParam.argument.valueExpression ?? errorNode - ); + if (!isDiagnosticSuppressedForNode(errorNode)) { + addDiagnostic( + AnalyzerNodeInfo.getFileInfo(errorNode).diagnosticRuleSet + .reportGeneralTypeIssues, + DiagnosticRule.reportGeneralTypeIssues, + Localizer.Diagnostic.typeVarTupleMustBeUnpacked(), + argParam.argument.valueExpression ?? errorNode + ); + } reportedArgError = true; } @@ -9641,14 +10626,27 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions isUnbounded: argParam.argument.argumentCategory === ArgumentCategory.UnpackedList, }; }); - const specializedTuple = ClassType.cloneAsInstance( - specializeTupleClass( - tupleClassType, - tupleTypeArgs, - /* isTypeArgumentExplicit */ true, - /* isUnpackedTuple */ true - ) - ); + + let specializedTuple: Type; + if ( + tupleTypeArgs.length === 1 && + !tupleTypeArgs[0].isUnbounded && + (isUnpackedClass(tupleTypeArgs[0].type) || isVariadicTypeVar(tupleTypeArgs[0].type)) + ) { + // If there is a single unpacked tuple or unpacked variadic type variable + // (including an unpacked TypeVarTuple union) within this tuple, + // simplify the type. + specializedTuple = tupleTypeArgs[0].type; + } else { + specializedTuple = ClassType.cloneAsInstance( + specializeTupleClass( + tupleClassType, + tupleTypeArgs, + /* isTypeArgumentExplicit */ true, + /* isUnpackedTuple */ true + ) + ); + } const combinedArg: ValidateArgTypeParams = { paramCategory: ParameterCategory.VarArgList, @@ -9683,14 +10681,14 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // Special-case the builtin isinstance and issubclass functions. if ( - ['isinstance', 'issubclass'].some((name) => name === type.details.builtInName) && + ['isinstance', 'issubclass'].some((name) => name === typeResult.type.details.builtInName) && validateArgTypeParams.length === 2 ) { validateArgTypeParams[1].expectingType = true; } return { - overload: type, + overload: typeResult.type, overloadIndex, argumentErrors: reportedArgError, isTypeIncomplete, @@ -9710,23 +10708,24 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions matchResults: MatchArgsToParamsResult, typeVarContext: TypeVarContext, skipUnknownArgCheck = false, - expectedType: Type | undefined + inferenceContext: InferenceContext | undefined ): CallResult { const type = matchResults.overload; if ( - !expectedType || - isAnyOrUnknown(expectedType) || - isNever(expectedType) || - requiresSpecialization(expectedType) || - !type.details.declaredReturnType + !inferenceContext || + isAnyOrUnknown(inferenceContext.expectedType) || + isNever(inferenceContext.expectedType) || + requiresSpecialization(inferenceContext.expectedType) || + !type.details.declaredReturnType || + !requiresSpecialization(FunctionType.getSpecializedReturnType(type) ?? UnknownType.create()) ) { return validateFunctionArgumentTypes(errorNode, matchResults, typeVarContext, skipUnknownArgCheck); } const effectiveReturnType = getFunctionEffectiveReturnType(type); - let effectiveExpectedType: Type | undefined = expectedType; - let effectiveFlags = AssignTypeFlags.AllowTypeVarNarrowing; + let effectiveExpectedType: Type | undefined = inferenceContext.expectedType; + let effectiveFlags = AssignTypeFlags.Default; if (containsLiteralType(effectiveExpectedType, /* includeTypeArgs */ true)) { effectiveFlags |= AssignTypeFlags.RetainLiteralsForTypeVar; } @@ -9734,7 +10733,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // If the expected type is a union, we don't know which type is expected. // We may or may not be able to make use of the expected type. We'll evaluate // speculatively to see if using the expected type works. - if (isUnion(expectedType)) { + if (isUnion(inferenceContext.expectedType)) { let speculativeResults: CallResult | undefined; useSpeculativeMode(errorNode, () => { @@ -9763,9 +10762,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions if (effectiveExpectedType) { // Prepopulate the typeVarContext based on the specialized expected type if the // callee has a declared return type. This will allow us to more closely match - // the expected type if possible. We set the AllowTypeVarNarrowing and - // SkipStripLiteralForTypeVar flags so the type can be further narrowed - // and so literals are not stripped. + // the expected type if possible. // If the return type is not the same as the expected type but is // assignable to the expected type, determine which type arguments @@ -9816,6 +10813,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions let isTypeIncomplete = matchResults.isTypeIncomplete; let argumentErrors = false; let specializedInitSelfType: Type | undefined; + let isArgumentAnyOrUnknown = false; const typeCondition = getTypeCondition(type); if (type.boundTypeVarScopeId) { @@ -9880,36 +10878,41 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // where more than two passes are needed. let passCount = Math.min(typeVarMatchingCount, 2); for (let i = 0; i < passCount; i++) { + const signatureTracker = new UniqueSignatureTracker(); + useSpeculativeMode(errorNode, () => { matchResults.argParams.forEach((argParam) => { - if (argParam.requiresTypeVarMatching) { - // Populate the typeVarContext for the argument. If the argument - // is an overload function, skip it during the first pass - // because the selection of the proper overload may depend - // on type arguments supplied by other function arguments. - // Set useNarrowBoundOnly to true the first time through - // the loop if we're going to go through the loop multiple - // times. - const argResult = validateArgType( - argParam, - typeVarContext, - type, - skipUnknownArgCheck, - /* skipOverloadArg */ i === 0, - /* useNarrowBoundOnly */ passCount > 1 && i === 0, - typeCondition - ); + if (!argParam.requiresTypeVarMatching) { + return; + } - if (argResult.isTypeIncomplete) { - isTypeIncomplete = true; - } + // Populate the typeVarContext for the argument. If the argument + // is an overload function, skip it during the first pass + // because the selection of the proper overload may depend + // on type arguments supplied by other function arguments. + // Set useNarrowBoundOnly to true the first time through + // the loop if we're going to go through the loop multiple + // times. + const argResult = validateArgType( + argParam, + typeVarContext, + signatureTracker, + { type, isIncomplete: matchResults.isTypeIncomplete }, + skipUnknownArgCheck, + /* skipOverloadArg */ i === 0, + /* useNarrowBoundOnly */ passCount > 1 && i === 0, + typeCondition + ); - // If we skipped a overload arg during the first pass, - // add another pass to ensure that we handle all of the - // type variables. - if (i === 0 && argResult.skippedOverloadArg) { - passCount++; - } + if (argResult.isTypeIncomplete) { + isTypeIncomplete = true; + } + + // If we skipped a overload arg during the first pass, + // add another pass to ensure that we handle all of the + // type variables. + if (i === 0 && argResult.skippedOverloadArg) { + passCount++; } }); }); @@ -9924,17 +10927,23 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions let sawParamSpecKwargs = false; let condition: TypeCondition[] = []; + const argResults: ArgResult[] = []; + + const signatureTracker = new UniqueSignatureTracker(); matchResults.argParams.forEach((argParam) => { const argResult = validateArgType( argParam, typeVarContext, - type, + signatureTracker, + { type, isIncomplete: matchResults.isTypeIncomplete }, skipUnknownArgCheck, /* skipOverloadArg */ false, /* useNarrowBoundOnly */ false, typeCondition ); + argResults.push(argResult); + if (!argResult.isCompatible) { argumentErrors = true; } @@ -9947,6 +10956,10 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions condition = TypeCondition.combine(condition, argResult.condition) ?? []; } + if (isAnyOrUnknown(argResult.argType)) { + isArgumentAnyOrUnknown = true; + } + if (type.details.paramSpec) { if (argParam.argument.argumentCategory === ArgumentCategory.UnpackedList) { if (isParamSpec(argResult.argType) && argResult.argType.paramSpecAccess === 'args') { @@ -10035,23 +11048,21 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // the call below to adjustCallableReturnType will "detach" these // TypeVars from the scope of this function and "attach" them to // the scope of the callable. - let unknownIfUnsolved = !isFunction(returnType); + let unknownIfNotFound = !isFunction(returnType); // We'll also leave TypeVars unsolved if the call is a recursive // call to a generic function. const typeVarScopes = getTypeVarScopesForNode(errorNode); if (typeVarScopes.some((typeVarScope) => typeVarContext.hasSolveForScope(typeVarScope))) { - unknownIfUnsolved = false; + unknownIfNotFound = false; } let specializedReturnType = addConditionToType( - applySolvedTypeVars( - returnType, - typeVarContext, - unknownIfUnsolved, - /* useNarrowBoundOnly */ false, - eliminateUnsolvedInUnions - ), + applySolvedTypeVars(returnType, typeVarContext, { + unknownIfNotFound, + useUnknownOverDefault: skipUnknownArgCheck, + eliminateUnsolvedInUnions, + }), typeCondition ); @@ -10070,10 +11081,31 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions specializedReturnType.typeArguments.length > 0 ) { if (boolClassType && isInstantiableClass(boolClassType)) { + let typeGuardType = specializedReturnType.typeArguments[0]; + + // If the first argument is a simple (non-constrained) TypeVar, + // associate that TypeVar with the resulting TypeGuard type. + if (argResults.length > 0) { + const arg0Type = argResults[0].argType; + if ( + isTypeVar(arg0Type) && + !arg0Type.details.isParamSpec && + arg0Type.details.constraints.length === 0 + ) { + typeGuardType = addConditionToType(typeGuardType, [ + { + typeVarName: TypeVarType.getNameWithScope(arg0Type), + constraintIndex: 0, + isConstrainedTypeVar: false, + }, + ]) as ClassType; + } + } + specializedReturnType = ClassType.cloneAsInstance( ClassType.cloneForTypeGuard( boolClassType, - specializedReturnType.typeArguments[0], + typeGuardType, ClassType.isBuiltIn(specializedReturnType, 'StrictTypeGuard') ) ); @@ -10088,10 +11120,13 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions return { argumentErrors, + argResults, + isArgumentAnyOrUnknown, returnType: specializedReturnType, isTypeIncomplete, activeParam: matchResults.activeParam, specializedInitSelfType, + overloadsUsedForCall: argumentErrors ? [] : [type], }; } @@ -10117,12 +11152,12 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions function validateFunctionArguments( errorNode: ExpressionNode, argList: FunctionArgument[], - type: FunctionType, + typeResult: TypeResult, typeVarContext: TypeVarContext, skipUnknownArgCheck = false, - expectedType?: Type + inferenceContext?: InferenceContext ): CallResult { - const matchResults = matchFunctionArgumentsToParameters(errorNode, argList, type, 0); + const matchResults = matchFunctionArgumentsToParameters(errorNode, argList, typeResult, 0); if (matchResults.argumentErrors) { // Evaluate types of all args. This will ensure that referenced symbols are @@ -10136,6 +11171,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions return { argumentErrors: true, activeParam: matchResults.activeParam, + overloadsUsedForCall: [], }; } @@ -10144,7 +11180,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions matchResults, typeVarContext, skipUnknownArgCheck, - expectedType + inferenceContext ); } @@ -10154,12 +11190,64 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions errorNode: ExpressionNode, argList: FunctionArgument[], paramSpec: TypeVarType, - typeVarContext: TypeVarContext, + destTypeVarContext: TypeVarContext, conditionFilter: TypeCondition[] | undefined ): boolean { - const paramSpecValue = typeVarContext.getParamSpec(paramSpec); + const signatureContexts = destTypeVarContext.getSignatureContexts(); + + // Handle the common case where there is only one signature context. + if (signatureContexts.length === 1) { + return validateFunctionArgumentsForParamSpecSignature( + errorNode, + argList, + paramSpec, + signatureContexts[0], + conditionFilter + ); + } + + const filteredSignatureContexts: TypeVarSignatureContext[] = []; + signatureContexts.forEach((context) => { + // Use speculative mode to avoid emitting errors or caching types. + useSpeculativeMode(errorNode, () => { + if ( + validateFunctionArgumentsForParamSpecSignature( + errorNode, + argList, + paramSpec, + context, + conditionFilter + ) + ) { + filteredSignatureContexts.push(context); + } + }); + }); + + // Copy back any compatible signature contexts if any were compatible. + if (filteredSignatureContexts.length > 0) { + destTypeVarContext.copySignatureContexts(filteredSignatureContexts); + } + + // Evaluate non-speculatively to produce a final result and cache types. + return validateFunctionArgumentsForParamSpecSignature( + errorNode, + argList, + paramSpec, + filteredSignatureContexts.length > 0 ? filteredSignatureContexts[0] : signatureContexts[0], + conditionFilter + ); + } - if (!paramSpecValue) { + function validateFunctionArgumentsForParamSpecSignature( + errorNode: ExpressionNode, + argList: FunctionArgument[], + paramSpec: TypeVarType, + typeVarContext: TypeVarSignatureContext, + conditionFilter: TypeCondition[] | undefined + ): boolean { + const paramSpecType = typeVarContext.getParamSpecType(paramSpec); + if (!paramSpecType) { addDiagnostic( AnalyzerNodeInfo.getFileInfo(errorNode).diagnosticRuleSet.reportGeneralTypeIssues, DiagnosticRule.reportGeneralTypeIssues, @@ -10169,15 +11257,12 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions return false; } - // If the ParamSpec was bound to a generic function, some TypeVars may - // not yet be solved. Add the TypeVar scope for the bound function. - typeVarContext.addSolveForScope(paramSpecValue.typeVarScopeId); - + const srcTypeVarContext = new TypeVarContext(paramSpecType.details.typeVarScopeId); let reportedArgError = false; // Build a map of all named parameters. - const paramMap = new Map(); - const paramSpecParams = paramSpecValue.parameters; + const paramMap = new Map(); + const paramSpecParams = paramSpecType.details.parameters; paramSpecParams.forEach((param) => { if (param.name) { paramMap.set(param.name, param); @@ -10196,6 +11281,8 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions (paramInfo) => paramInfo.category === ParameterCategory.VarArgDictionary ); + const signatureTracker = new UniqueSignatureTracker(); + argList.forEach((arg) => { if (arg.argumentCategory === ArgumentCategory.Simple) { let paramType: Type | undefined; @@ -10243,23 +11330,24 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } if (paramType) { - if ( - !validateArgType( - { - paramCategory: ParameterCategory.Simple, - paramType, - requiresTypeVarMatching: false, - argument: arg, - errorNode: arg.valueExpression || errorNode, - }, - typeVarContext, - /* functionType */ undefined, - /* skipUnknownArgCheck */ false, - /* skipOverloadArg */ false, - /* useNarrowBoundOnly */ false, - conditionFilter - ) - ) { + const argResult = validateArgType( + { + paramCategory: ParameterCategory.Simple, + paramType, + requiresTypeVarMatching: false, + argument: arg, + errorNode: arg.valueExpression || errorNode, + }, + srcTypeVarContext, + signatureTracker, + /* functionType */ undefined, + /* skipUnknownArgCheck */ false, + /* skipOverloadArg */ false, + /* useNarrowBoundOnly */ false, + conditionFilter + ); + + if (!argResult.isCompatible) { reportedArgError = true; } } @@ -10279,7 +11367,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions return paramInfo.category === ParameterCategory.Simple && !paramInfo.hasDefault; }); - if (unassignedParams.length > 0 && !paramSpecValue.paramSpec) { + if (unassignedParams.length > 0 && !paramSpecType.details.paramSpec) { const missingParamNames = unassignedParams.map((p) => `"${p}"`).join(', '); addDiagnostic( AnalyzerNodeInfo.getFileInfo(errorNode).diagnosticRuleSet.reportGeneralTypeIssues, @@ -10293,13 +11381,18 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } } + if (!reportedArgError) { + typeVarContext.applySourceContextTypeVars(srcTypeVarContext); + } + return !reportedArgError; } function validateArgType( argParam: ValidateArgTypeParams, typeVarContext: TypeVarContext, - functionType: FunctionType | undefined, + signatureTracker: UniqueSignatureTracker, + typeResult: TypeResult | undefined, skipUnknownCheck: boolean, skipOverloadArg: boolean, useNarrowBoundOnly: boolean, @@ -10307,9 +11400,9 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions ): ArgResult { let argType: Type | undefined; let expectedTypeDiag: DiagnosticAddendum | undefined; - let isTypeIncomplete = false; + let isTypeIncomplete = !!typeResult?.isIncomplete; let isCompatible = true; - const functionName = functionType?.details.name; + const functionName = typeResult?.type.details.name; if (argParam.argument.valueExpression) { // If the param type is a "bare" TypeVar, don't use it as an expected @@ -10319,17 +11412,13 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // to true if this is the first pass through the parameter list because // a wide bound on a TypeVar (if a narrow bound has not yet been established) // will unnecessarily constrain the expected type. - let expectedType: Type | undefined = - isTypeVar(argParam.paramType) && - functionType !== undefined && - argParam.paramType.scopeId === functionType.details.typeVarScopeId - ? undefined - : applySolvedTypeVars( - argParam.paramType, - typeVarContext, - /* unknownIfNotFound */ false, - useNarrowBoundOnly - ); + let expectedType: Type | undefined; + if ( + !isTypeVar(argParam.paramType) || + argParam.paramType.scopeId !== typeResult?.type.details.typeVarScopeId + ) { + expectedType = applySolvedTypeVars(argParam.paramType, typeVarContext, { useNarrowBoundOnly }); + } // If the expected type is unknown, don't use an expected type. Instead, // use default rules for evaluating the expression type. @@ -10343,17 +11432,25 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } else { const flags = argParam.expectingType ? EvaluatorFlags.EvaluateStringLiteralAsType | - EvaluatorFlags.ParamSpecDisallowed | - EvaluatorFlags.TypeVarTupleDisallowed + EvaluatorFlags.DisallowParamSpec | + EvaluatorFlags.DisallowTypeVarTuple : EvaluatorFlags.None; - const exprTypeResult = getTypeOfExpression(argParam.argument.valueExpression, flags, expectedType); + const exprTypeResult = getTypeOfExpression( + argParam.argument.valueExpression, + flags, + makeInferenceContext(expectedType, typeVarContext, !!typeResult?.isIncomplete) + ); + argType = exprTypeResult.type; + if (exprTypeResult.isIncomplete) { isTypeIncomplete = true; } + if (exprTypeResult.typeErrors) { isCompatible = false; } + expectedTypeDiag = exprTypeResult.expectedTypeDiagAddendum; } @@ -10362,7 +11459,11 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions argParam.argument.name && !speculativeTypeTracker.isSpeculative(argParam.errorNode) ) { - writeTypeCache(argParam.argument.name, expectedType || argType, EvaluatorFlags.None, isTypeIncomplete); + writeTypeCache( + argParam.argument.name, + { type: expectedType ?? argType, isIncomplete: isTypeIncomplete }, + EvaluatorFlags.None + ); } } else { // Was the argument's type precomputed by the caller? @@ -10372,10 +11473,12 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions const argTypeResult = getTypeOfExpression( argParam.argument.valueExpression, EvaluatorFlags.EvaluateStringLiteralAsType | - EvaluatorFlags.ParamSpecDisallowed | - EvaluatorFlags.TypeVarTupleDisallowed + EvaluatorFlags.DisallowParamSpec | + EvaluatorFlags.DisallowTypeVarTuple ); + argType = argTypeResult.type; + if (argTypeResult.isIncomplete) { isTypeIncomplete = true; } @@ -10388,6 +11491,11 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } } + // If the type includes multiple instances of a generic function + // signature, force the type arguments for the duplicates to have + // unique names. + argType = ensureFunctionSignaturesAreUnique(argType, signatureTracker); + // If we're assigning to a var arg dictionary with a TypeVar type, // strip literals before performing the assignment. This is used in // places like a dict constructor. @@ -10504,7 +11612,8 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions fileInfo.diagnosticRuleSet.reportGeneralTypeIssues, DiagnosticRule.reportGeneralTypeIssues, message + diag.getString(), - argParam.errorNode + argParam.errorNode, + diag.getEffectiveTextRange() ?? argParam.errorNode ); } @@ -10573,7 +11682,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions const diagAddendum = getDiagAddendum(); diagAddendum.addMessage( Localizer.DiagnosticAddendum.argumentType().format({ - type: printType(simplifiedType, /* expandTypeAlias */ true), + type: printType(simplifiedType, { expandTypeAlias: true }), }) ); addDiagnostic( @@ -10593,6 +11702,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions function createTypeVarType(errorNode: ExpressionNode, argList: FunctionArgument[]): Type | undefined { let typeVarName = ''; let firstConstraintArg: FunctionArgument | undefined; + let defaultValueNode: ExpressionNode | undefined; if (argList.length === 0) { addError(Localizer.Diagnostic.typeVarFirstArg(), errorNode); @@ -10609,10 +11719,10 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions const typeVar = TypeVarType.createInstantiable(typeVarName, /* isParamSpec */ false); // Parse the remaining parameters. + const paramNameMap = new Map(); for (let i = 1; i < argList.length; i++) { const paramNameNode = argList[i].name; const paramName = paramNameNode ? paramNameNode.value : undefined; - const paramNameMap = new Map(); if (paramName) { if (paramNameMap.get(paramName)) { @@ -10633,13 +11743,19 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions argList[i].typeResult?.type ?? getTypeOfExpressionExpectingType(argList[i].valueExpression!).type; if (requiresSpecialization(argType, /* ignorePseudoGeneric */ true)) { - addError(Localizer.Diagnostic.typeVarGeneric(), argList[i].valueExpression || errorNode); + addError( + Localizer.Diagnostic.typeVarBoundGeneric(), + argList[i].valueExpression || errorNode + ); } typeVar.details.boundType = convertToInstance(argType); } } else if (paramName === 'covariant') { if (argList[i].valueExpression && getBooleanValue(argList[i].valueExpression!)) { - if (typeVar.details.declaredVariance === Variance.Contravariant) { + if ( + typeVar.details.declaredVariance === Variance.Contravariant || + typeVar.details.declaredVariance === Variance.Auto + ) { addError(Localizer.Diagnostic.typeVarVariance(), argList[i].valueExpression!); } else { typeVar.details.declaredVariance = Variance.Covariant; @@ -10647,12 +11763,32 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } } else if (paramName === 'contravariant') { if (argList[i].valueExpression && getBooleanValue(argList[i].valueExpression!)) { - if (typeVar.details.declaredVariance === Variance.Covariant) { + if ( + typeVar.details.declaredVariance === Variance.Covariant || + typeVar.details.declaredVariance === Variance.Auto + ) { addError(Localizer.Diagnostic.typeVarVariance(), argList[i].valueExpression!); } else { typeVar.details.declaredVariance = Variance.Contravariant; } } + } else if (paramName === 'infer_variance') { + if (argList[i].valueExpression && getBooleanValue(argList[i].valueExpression!)) { + if ( + typeVar.details.declaredVariance === Variance.Covariant || + typeVar.details.declaredVariance === Variance.Contravariant + ) { + addError(Localizer.Diagnostic.typeVarVariance(), argList[i].valueExpression!); + } else { + typeVar.details.declaredVariance = Variance.Auto; + } + } + } else if (paramName === 'default') { + defaultValueNode = argList[i].valueExpression; + const argType = + argList[i].typeResult?.type ?? + getTypeOfExpressionExpectingType(argList[i].valueExpression!).type; + typeVar.details.defaultType = convertToInstance(argType); } else { addError( Localizer.Diagnostic.typeVarUnknownParam().format({ name: paramName }), @@ -10673,7 +11809,10 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions getTypeOfExpressionExpectingType(argList[i].valueExpression!).type; if (requiresSpecialization(argType, /* ignorePseudoGeneric */ true)) { - addError(Localizer.Diagnostic.typeVarGeneric(), argList[i].valueExpression || errorNode); + addError( + Localizer.Diagnostic.typeVarConstraintGeneric(), + argList[i].valueExpression || errorNode + ); } TypeVarType.addConstraint(typeVar, convertToInstance(argType)); if (firstConstraintArg === undefined) { @@ -10692,6 +11831,37 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions ); } + // If a default is provided, make sure it is compatible with the bound + // or constraint. + if (typeVar.details.defaultType && defaultValueNode) { + const typeVarContext = new TypeVarContext(WildcardTypeVarScopeId); + const concreteDefaultType = makeTopLevelTypeVarsConcrete( + applySolvedTypeVars(typeVar.details.defaultType, typeVarContext, { + unknownIfNotFound: true, + }) + ); + + if (typeVar.details.boundType) { + if (!assignType(typeVar.details.boundType, concreteDefaultType)) { + addDiagnostic( + AnalyzerNodeInfo.getFileInfo(errorNode).diagnosticRuleSet.reportGeneralTypeIssues, + DiagnosticRule.reportGeneralTypeIssues, + Localizer.Diagnostic.typeVarDefaultBoundMismatch(), + defaultValueNode + ); + } + } else if (typeVar.details.constraints.length > 0) { + if (!typeVar.details.constraints.some((constraint) => isTypeSame(constraint, concreteDefaultType))) { + addDiagnostic( + AnalyzerNodeInfo.getFileInfo(errorNode).diagnosticRuleSet.reportGeneralTypeIssues, + DiagnosticRule.reportGeneralTypeIssues, + Localizer.Diagnostic.typeVarDefaultConstraintMismatch(), + defaultValueNode + ); + } + } + } + return typeVar; } @@ -10715,15 +11885,45 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // Parse the remaining parameters. for (let i = 1; i < argList.length; i++) { - addError( - Localizer.Diagnostic.typeVarUnknownParam().format({ name: argList[i].name?.value || '?' }), - argList[i].node?.name || argList[i].valueExpression || errorNode - ); + const paramNameNode = argList[i].name; + const paramName = paramNameNode ? paramNameNode.value : undefined; + + if (paramName) { + if (paramName === 'default') { + const expr = argList[i].valueExpression; + if (expr) { + typeVar.details.defaultType = getTypeVarTupleDefaultType(expr); + } + } else { + addError( + Localizer.Diagnostic.typeVarTupleUnknownParam().format({ name: argList[i].name?.value || '?' }), + argList[i].node?.name || argList[i].valueExpression || errorNode + ); + } + } } return typeVar; } + function getTypeVarTupleDefaultType(node: ExpressionNode): Type | undefined { + const argType = getTypeOfExpressionExpectingType(node, { allowUnpackedTuple: true }).type; + const isUnpackedTuple = isClass(argType) && isTupleClass(argType) && argType.isUnpacked; + const isUnpackedTypeVarTuple = isUnpackedVariadicTypeVar(argType); + + if (!isUnpackedTuple && !isUnpackedTypeVarTuple) { + addDiagnostic( + AnalyzerNodeInfo.getFileInfo(node).diagnosticRuleSet.reportGeneralTypeIssues, + DiagnosticRule.reportGeneralTypeIssues, + Localizer.Diagnostic.typeVarTupleDefaultNotUnpacked(), + node + ); + return undefined; + } + + return convertToInstance(argType); + } + function createParamSpecType(errorNode: ExpressionNode, argList: FunctionArgument[]): Type | undefined { if (argList.length === 0) { addError(Localizer.Diagnostic.paramSpecFirstArg(), errorNode); @@ -10738,22 +11938,83 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions addError(Localizer.Diagnostic.paramSpecFirstArg(), firstArg.valueExpression || errorNode); } - const paramSpec = TypeVarType.createInstantiable(paramSpecName, /* isParamSpec */ true); + const paramSpec = TypeVarType.createInstantiable(paramSpecName, /* isParamSpec */ true); + + // Parse the remaining parameters. + for (let i = 1; i < argList.length; i++) { + const paramNameNode = argList[i].name; + const paramName = paramNameNode ? paramNameNode.value : undefined; + + if (paramName) { + if (paramName === 'default') { + const expr = argList[i].valueExpression; + if (expr) { + paramSpec.details.defaultType = getParamSpecDefaultType(expr); + } + } else { + addError( + Localizer.Diagnostic.paramSpecUnknownParam().format({ name: paramName }), + paramNameNode || argList[i].valueExpression || errorNode + ); + } + } else { + addError(Localizer.Diagnostic.paramSpecUnknownArg(), argList[i].valueExpression || errorNode); + break; + } + } + + return paramSpec; + } + + function getParamSpecDefaultType(node: ExpressionNode): Type | undefined { + const functionType = FunctionType.createSynthesizedInstance( + '', + FunctionTypeFlags.SkipArgsKwargsCompatibilityCheck | FunctionTypeFlags.ParamSpecValue + ); + TypeBase.setSpecialForm(functionType); + + if (node.nodeType === ParseNodeType.Ellipsis) { + FunctionType.addDefaultParameters(functionType); + return functionType; + } + + if (node.nodeType === ParseNodeType.List) { + node.entries.forEach((paramExpr, index) => { + const typeResult = getTypeOfExpressionExpectingType(paramExpr); + + FunctionType.addParameter(functionType, { + category: ParameterCategory.Simple, + name: `__p${index}`, + isNameSynthesized: true, + hasDeclaredType: true, + type: convertToInstance(typeResult.type), + }); + }); + + // Update the type cache so we don't attempt to re-evaluate this node. + // The type doesn't matter, so use Any. + writeTypeCache(node, { type: AnyType.create() }, /* flags */ undefined); + return functionType; + } else { + const typeResult = getTypeOfExpressionExpectingType(node, { allowParamSpec: true }); + if (typeResult.typeErrors) { + return undefined; + } - // Parse the remaining parameters. - for (let i = 1; i < argList.length; i++) { - if (argList[i].name?.value) { - addError( - Localizer.Diagnostic.paramSpecUnknownParam().format({ name: argList[i].name!.value }), - argList[i].node?.name || argList[i].valueExpression || errorNode - ); - } else { - addError(Localizer.Diagnostic.paramSpecUnknownArg(), argList[i].valueExpression || errorNode); - break; + if (isParamSpec(typeResult.type)) { + functionType.details.paramSpec = typeResult.type; + return functionType; } } - return paramSpec; + addDiagnostic( + AnalyzerNodeInfo.getFileInfo(node).diagnosticRuleSet.reportGeneralTypeIssues, + DiagnosticRule.reportGeneralTypeIssues, + Localizer.Diagnostic.paramSpecDefaultNotTuple(), + node + ); + + return undefined; } function getBooleanValue(node: ExpressionNode): boolean { @@ -10792,73 +12053,93 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // the new type as if it were a subclass of the original type. function createNewType(errorNode: ExpressionNode, argList: FunctionArgument[]): ClassType | undefined { const fileInfo = AnalyzerNodeInfo.getFileInfo(errorNode); - let className = '_'; - if (argList.length >= 1) { - const nameArg = argList[0]; - if (nameArg.argumentCategory === ArgumentCategory.Simple) { - if (nameArg.valueExpression && nameArg.valueExpression.nodeType === ParseNodeType.StringList) { - className = nameArg.valueExpression.strings.map((s) => s.value).join(''); - } - } - } + let className = ''; - if (argList.length >= 2) { - const baseClass = getTypeOfArgumentExpectingType(argList[1]).type; + if (argList.length !== 2) { + addDiagnostic( + AnalyzerNodeInfo.getFileInfo(errorNode).diagnosticRuleSet.reportGeneralTypeIssues, + DiagnosticRule.reportGeneralTypeIssues, + Localizer.Diagnostic.newTypeParamCount(), + errorNode + ); + return undefined; + } - if (isInstantiableClass(baseClass)) { - if (ClassType.isProtocolClass(baseClass)) { - addError(Localizer.Diagnostic.newTypeProtocolClass(), argList[1].node || errorNode); - } else if (baseClass.literalValue !== undefined) { - addError(Localizer.Diagnostic.newTypeLiteral(), argList[1].node || errorNode); - } + const nameArg = argList[0]; + if ( + nameArg.argumentCategory === ArgumentCategory.Simple && + nameArg.valueExpression && + nameArg.valueExpression.nodeType === ParseNodeType.StringList + ) { + className = nameArg.valueExpression.strings.map((s) => s.value).join(''); + } - const classFlags = - baseClass.details.flags & ~(ClassTypeFlags.BuiltInClass | ClassTypeFlags.SpecialBuiltIn); - const classType = ClassType.createInstantiable( - className, - ParseTreeUtils.getClassFullName(errorNode, fileInfo.moduleName, className), - fileInfo.moduleName, - fileInfo.filePath, - classFlags, - ParseTreeUtils.getTypeSourceId(errorNode), - /* declaredMetaclass */ undefined, - baseClass.details.effectiveMetaclass - ); - classType.details.baseClasses.push(baseClass); - computeMroLinearization(classType); + if (!className) { + addDiagnostic( + AnalyzerNodeInfo.getFileInfo(errorNode).diagnosticRuleSet.reportGeneralTypeIssues, + DiagnosticRule.reportGeneralTypeIssues, + Localizer.Diagnostic.newTypeBadName(), + argList[0].node ?? errorNode + ); + return undefined; + } - // Synthesize an __init__ method that accepts only the specified type. - const initType = FunctionType.createSynthesizedInstance('__init__'); - FunctionType.addParameter(initType, { - category: ParameterCategory.Simple, - name: 'self', - type: ClassType.cloneAsInstance(classType), - hasDeclaredType: true, - }); - FunctionType.addParameter(initType, { - category: ParameterCategory.Simple, - name: '_x', - type: ClassType.cloneAsInstance(baseClass), - hasDeclaredType: true, - }); - initType.details.declaredReturnType = NoneType.createInstance(); - classType.details.fields.set('__init__', Symbol.createWithType(SymbolFlags.ClassMember, initType)); + const baseClass = getTypeOfArgumentExpectingType(argList[1]).type; - // Synthesize a trivial __new__ method. - const newType = FunctionType.createSynthesizedInstance('__new__', FunctionTypeFlags.ConstructorMethod); - FunctionType.addParameter(newType, { - category: ParameterCategory.Simple, - name: 'cls', - type: classType, - hasDeclaredType: true, - }); - FunctionType.addDefaultParameters(newType); - newType.details.declaredReturnType = ClassType.cloneAsInstance(classType); - classType.details.fields.set('__new__', Symbol.createWithType(SymbolFlags.ClassMember, newType)); - return classType; - } else if (!isAnyOrUnknown(baseClass)) { - addError(Localizer.Diagnostic.newTypeNotAClass(), argList[1].node || errorNode); + if (isInstantiableClass(baseClass)) { + if (ClassType.isProtocolClass(baseClass)) { + addError(Localizer.Diagnostic.newTypeProtocolClass(), argList[1].node || errorNode); + } else if (baseClass.literalValue !== undefined) { + addError(Localizer.Diagnostic.newTypeLiteral(), argList[1].node || errorNode); } + + const classFlags = baseClass.details.flags & ~(ClassTypeFlags.BuiltInClass | ClassTypeFlags.SpecialBuiltIn); + const classType = ClassType.createInstantiable( + className, + ParseTreeUtils.getClassFullName(errorNode, fileInfo.moduleName, className), + fileInfo.moduleName, + fileInfo.filePath, + classFlags, + ParseTreeUtils.getTypeSourceId(errorNode), + /* declaredMetaclass */ undefined, + baseClass.details.effectiveMetaclass + ); + classType.details.baseClasses.push(baseClass); + computeMroLinearization(classType); + + // Synthesize an __init__ method that accepts only the specified type. + const initType = FunctionType.createSynthesizedInstance('__init__'); + FunctionType.addParameter(initType, { + category: ParameterCategory.Simple, + name: 'self', + type: ClassType.cloneAsInstance(classType), + hasDeclaredType: true, + }); + FunctionType.addParameter(initType, { + category: ParameterCategory.Simple, + name: '_x', + type: ClassType.cloneAsInstance(baseClass), + hasDeclaredType: true, + }); + initType.details.declaredReturnType = NoneType.createInstance(); + classType.details.fields.set('__init__', Symbol.createWithType(SymbolFlags.ClassMember, initType)); + + // Synthesize a trivial __new__ method. + const newType = FunctionType.createSynthesizedInstance('__new__', FunctionTypeFlags.ConstructorMethod); + FunctionType.addParameter(newType, { + category: ParameterCategory.Simple, + name: 'cls', + type: classType, + hasDeclaredType: true, + }); + FunctionType.addDefaultParameters(newType); + newType.details.declaredReturnType = ClassType.cloneAsInstance(classType); + classType.details.fields.set('__new__', Symbol.createWithType(SymbolFlags.ClassMember, newType)); + return classType; + } + + if (!isAnyOrUnknown(baseClass)) { + addError(Localizer.Diagnostic.newTypeNotAClass(), argList[1].node || errorNode); } return undefined; @@ -10891,11 +12172,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions arg1Type.tupleTypeArguments.forEach((typeArg) => { const specializedType = makeTopLevelTypeVarsConcrete(typeArg.type); - if ( - isInstantiableClass(specializedType) || - isAnyOrUnknown(specializedType) || - (isClassInstance(specializedType) && ClassType.isBuiltIn(specializedType, 'type')) - ) { + if (isEffectivelyInstantiable(specializedType)) { classType.details.baseClasses.push(specializedType); } else { addExpectedClassDiagnostic(typeArg.type, argList[1].valueExpression || errorNode); @@ -10939,7 +12216,10 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions return { type }; } - function getTypeOfUnaryOperation(node: UnaryOperationNode, expectedType: Type | undefined): TypeResult { + function getTypeOfUnaryOperation( + node: UnaryOperationNode, + inferenceContext: InferenceContext | undefined + ): TypeResult { const exprTypeResult = getTypeOfExpression(node.expression); let exprType = makeTopLevelTypeVarsConcrete(exprTypeResult.type); const isIncomplete = exprTypeResult.isIncomplete; @@ -11012,20 +12292,20 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions type = exprType; } else { const magicMethodName = unaryOperatorMap[node.operator]; - type = getTypeOfMagicMethodReturn(exprType, [], magicMethodName, node, expectedType); + type = getTypeOfMagicMethodReturn(exprType, [], magicMethodName, node, inferenceContext); } if (!type) { const fileInfo = AnalyzerNodeInfo.getFileInfo(node); - if (expectedType) { + if (inferenceContext) { addDiagnostic( fileInfo.diagnosticRuleSet.reportGeneralTypeIssues, DiagnosticRule.reportGeneralTypeIssues, Localizer.Diagnostic.typeNotSupportUnaryOperatorBidirectional().format({ operator: ParseTreeUtils.printOperator(node.operator), type: printType(exprType), - expectedType: printType(expectedType), + expectedType: printType(inferenceContext.expectedType), }), node ); @@ -11050,12 +12330,13 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions function getTypeOfBinaryOperation( node: BinaryOperationNode, - expectedType: Type | undefined, + inferenceContext: InferenceContext | undefined, flags: EvaluatorFlags ): TypeResult { const leftExpression = node.leftExpression; let rightExpression = node.rightExpression; let isIncomplete = false; + let typeErrors = false; // If this is a comparison and the left expression is also a comparison, // we need to change the behavior to accommodate python's "chained @@ -11067,7 +12348,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions ParseTreeUtils.operatorSupportsChaining(rightExpression.operator) ) { // Evaluate the right expression so it is type checked. - getTypeOfBinaryOperation(rightExpression, expectedType, flags); + getTypeOfBinaryOperation(rightExpression, inferenceContext, flags); // Use the left side of the right expression for comparison purposes. rightExpression = rightExpression.leftExpression; @@ -11078,7 +12359,9 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // of the magic method for that operation. However, the "or" and "and" operators // have no magic method, so we apply the expected type directly to both operands. let expectedOperandType = - node.operator === OperatorType.Or || node.operator === OperatorType.And ? expectedType : undefined; + node.operator === OperatorType.Or || node.operator === OperatorType.And + ? inferenceContext?.expectedType + : undefined; // Handle the very special case where the expected type is a list // and the operator is a multiply. This comes up in the common case @@ -11086,21 +12369,18 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions let expectedLeftOperandType: Type | undefined; if ( node.operator === OperatorType.Multiply && - expectedType && - isClassInstance(expectedType) && - ClassType.isBuiltIn(expectedType, 'list') && - expectedType.typeArguments && - expectedType.typeArguments.length >= 1 && + inferenceContext && + isClassInstance(inferenceContext.expectedType) && + ClassType.isBuiltIn(inferenceContext.expectedType, 'list') && + inferenceContext.expectedType.typeArguments && + inferenceContext.expectedType.typeArguments.length >= 1 && node.leftExpression.nodeType === ParseNodeType.List ) { - expectedLeftOperandType = expectedType; + expectedLeftOperandType = inferenceContext.expectedType; } - const leftTypeResult = getTypeOfExpression( - leftExpression, - flags, - expectedOperandType || expectedLeftOperandType - ); + const effectiveExpectedType = expectedOperandType ?? expectedLeftOperandType; + const leftTypeResult = getTypeOfExpression(leftExpression, flags, makeInferenceContext(effectiveExpectedType)); let leftType = leftTypeResult.type; if (!expectedOperandType) { @@ -11115,11 +12395,13 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } else if (node.operator === OperatorType.BitwiseOr) { // If this is a bitwise or ("|"), use the type of the left operand. This allows // us to support the case where a TypedDict is being updated with a dict expression. - expectedOperandType = leftType; + if (isClassInstance(leftType) && ClassType.isTypedDictClass(leftType)) { + expectedOperandType = leftType; + } } } - const rightTypeResult = getTypeOfExpression(rightExpression, flags, expectedOperandType); + const rightTypeResult = getTypeOfExpression(rightExpression, flags, makeInferenceContext(expectedOperandType)); let rightType = rightTypeResult.type; if (leftTypeResult.isIncomplete || rightTypeResult.isIncomplete) { @@ -11177,6 +12459,43 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions TypeBase.setSpecialForm(newUnion); } + // Check for "stringified" forward reference type expressions. The "|" operator + // doesn't support these except in certain circumstances. Notably, it can't be used + // with other strings or with types that are not specialized using an index form. + if (!fileInfo.isStubFile) { + let stringNode: ExpressionNode | undefined; + let otherNode: ExpressionNode | undefined; + let otherType: Type | undefined; + + if (leftExpression.nodeType === ParseNodeType.StringList) { + stringNode = leftExpression; + otherNode = rightExpression; + otherType = rightType; + } else if (rightExpression.nodeType === ParseNodeType.StringList) { + stringNode = rightExpression; + otherNode = leftExpression; + otherType = leftType; + } + + if (stringNode && otherNode && otherType) { + let isAllowed = true; + if (isClass(otherType)) { + if (!otherType.isTypeArgumentExplicit || isClassInstance(otherType)) { + isAllowed = false; + } + } + + if (!isAllowed) { + addDiagnostic( + fileInfo.diagnosticRuleSet.reportGeneralTypeIssues, + DiagnosticRule.reportGeneralTypeIssues, + Localizer.Diagnostic.unionForwardReferenceNotAllowed(), + stringNode + ); + } + } + } + return { type: newUnion }; } } @@ -11199,21 +12518,28 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions const diag = new DiagnosticAddendum(); - // Don't use literal math if either of the operand types are - // incomplete because we may be evaluating types within a loop, - // so the literal values may change each time. + // Don't use literal math if either of the operation is within a loop + // because the literal values may change each time. const isLiteralMathAllowed = !ParseTreeUtils.isWithinLoop(node); + + // Don't special-case tuple __add__ if the left type is a union. This + // can result in an infinite loop if we keep creating new tuple types + // within a loop construct using __add__. + const isTupleAddAllowed = !isUnion(leftType); + let type = validateBinaryOperation( node.operator, { type: leftType, isIncomplete: leftTypeResult.isIncomplete }, { type: rightType, isIncomplete: rightTypeResult.isIncomplete }, node, - expectedType, + inferenceContext, diag, - isLiteralMathAllowed + { isLiteralMathAllowed, isTupleAddAllowed } ); if (!diag.isEmpty() || !type) { + typeErrors = true; + if (!isIncomplete) { const fileInfo = AnalyzerNodeInfo.getFileInfo(node); @@ -11247,7 +12573,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions type = UnknownType.create(); } - return { type, isIncomplete }; + return { type, isIncomplete, typeErrors }; } function customMetaclassSupportsMethod(type: Type, methodName: string): boolean { @@ -11276,7 +12602,10 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions return true; } - function getTypeOfAugmentedAssignment(node: AugmentedAssignmentNode, expectedType: Type | undefined): TypeResult { + function getTypeOfAugmentedAssignment( + node: AugmentedAssignmentNode, + inferenceContext: InferenceContext | undefined + ): TypeResult { const operatorMap: { [operator: number]: [string, OperatorType] } = { [OperatorType.AddEqual]: ['__iadd__', OperatorType.Add], [OperatorType.SubtractEqual]: ['__isub__', OperatorType.Subtract], @@ -11307,7 +12636,11 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions expectedOperandType = leftType; } - const rightTypeResult = getTypeOfExpression(node.rightExpression, /* flags */ undefined, expectedOperandType); + const rightTypeResult = getTypeOfExpression( + node.rightExpression, + /* flags */ undefined, + makeInferenceContext(expectedOperandType) + ); const rightType = rightTypeResult.type; const isIncomplete = !!rightTypeResult.isIncomplete || !!leftTypeResult.isIncomplete; @@ -11332,7 +12665,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions [{ type: rightSubtypeUnexpanded, isIncomplete: rightTypeResult.isIncomplete }], magicMethodName, node, - expectedType + inferenceContext ); if (!returnType && leftSubtypeUnexpanded !== leftSubtypeExpanded) { @@ -11342,7 +12675,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions [{ type: rightSubtypeUnexpanded, isIncomplete: rightTypeResult.isIncomplete }], magicMethodName, node, - expectedType + inferenceContext ); } @@ -11353,7 +12686,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions [{ type: rightSubtypeExpanded, isIncomplete: rightTypeResult.isIncomplete }], magicMethodName, node, - expectedType + inferenceContext ); } @@ -11362,23 +12695,26 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // assignment, fall back on the normal binary expression evaluator. const binaryOperator = operatorMap[node.operator][1]; - // Don't use literal math if either of the operand types are - // incomplete because we may be evaluating types within a loop, - // so the literal values may change each time. + // Don't use literal math if either of the operation is within a loop + // because the literal values may change each time. const isLiteralMathAllowed = - !leftTypeResult.isIncomplete && - !rightTypeResult.isIncomplete && + !ParseTreeUtils.isWithinLoop(node) && getUnionSubtypeCount(leftType) * getUnionSubtypeCount(rightType) < maxLiteralMathSubtypeCount; + // Don't special-case tuple __add__ if the left type is a union. This + // can result in an infinite loop if we keep creating new tuple types + // within a loop construct using __add__. + const isTupleAddAllowed = !isUnion(leftType); + returnType = validateBinaryOperation( binaryOperator, { type: leftSubtypeUnexpanded, isIncomplete: leftTypeResult.isIncomplete }, { type: rightSubtypeUnexpanded, isIncomplete: rightTypeResult.isIncomplete }, node, - expectedType, + inferenceContext, diag, - isLiteralMathAllowed + { isLiteralMathAllowed, isTupleAddAllowed } ); } @@ -11421,9 +12757,9 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions leftTypeResult: TypeResult, rightTypeResult: TypeResult, errorNode: ExpressionNode, - expectedType: Type | undefined, + inferenceContext: InferenceContext | undefined, diag: DiagnosticAddendum, - isLiteralMathAllowed: boolean + options: BinaryOperationOptions ): Type | undefined { const leftType = leftTypeResult.type; const rightType = rightTypeResult.type; @@ -11495,17 +12831,17 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions [{ type: leftSubtype, isIncomplete: leftTypeResult.isIncomplete }], '__contains__', errorNode, - /* expectedType */ undefined + /* inferenceContext */ undefined ); if (!returnType) { // If __contains__ was not supported, fall back // on an iterable. const iteratorType = getTypeOfIterator( - rightSubtypeExpanded, + { type: rightSubtypeExpanded, isIncomplete: rightTypeResult.isIncomplete }, /* isAsync */ false, /* errorNode */ undefined - ); + )?.type; if (iteratorType && assignType(iteratorType, leftSubtype)) { returnType = getBuiltInObject(errorNode, 'bool'); @@ -11560,7 +12896,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // Handle certain operations on certain homogenous literal types // using special-case math. For example, Literal[1, 2] + Literal[3, 4] // should result in Literal[4, 5, 6]. - if (isLiteralMathAllowed) { + if (options.isLiteralMathAllowed) { const leftLiteralClassName = getLiteralTypeClassName(leftType); if (leftLiteralClassName && !getTypeCondition(leftType)) { const rightLiteralClassName = getLiteralTypeClassName(rightType); @@ -11633,7 +12969,10 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } else { // Convert back to a simple number if it fits. Leave as a bigint // if it doesn't. - if (newValue === BigInt(Number(newValue))) { + if ( + newValue >= Number.MIN_SAFE_INTEGER && + newValue <= Number.MAX_SAFE_INTEGER + ) { newValue = Number(newValue); } @@ -11670,6 +13009,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // Special-case __add__ for tuples when the types for both tuples are known. if ( + options.isTupleAddAllowed && operator === OperatorType.Add && isClassInstance(leftSubtypeExpanded) && isTupleClass(leftSubtypeExpanded) && @@ -11696,7 +13036,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions [{ type: rightSubtypeUnexpanded, isIncomplete: rightTypeResult.isIncomplete }], magicMethodName, errorNode, - expectedType + inferenceContext ); if (!resultType && leftSubtypeUnexpanded !== leftSubtypeExpanded) { @@ -11706,7 +13046,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions [{ type: rightSubtypeUnexpanded, isIncomplete: rightTypeResult.isIncomplete }], magicMethodName, errorNode, - expectedType + inferenceContext ); } @@ -11717,7 +13057,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions [{ type: rightSubtypeExpanded, isIncomplete: rightTypeResult.isIncomplete }], magicMethodName, errorNode, - expectedType + inferenceContext ); } @@ -11729,7 +13069,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions [{ type: leftSubtypeUnexpanded, isIncomplete: leftTypeResult.isIncomplete }], altMagicMethodName, errorNode, - expectedType + inferenceContext ); if (!resultType && rightSubtypeUnexpanded !== rightSubtypeExpanded) { @@ -11744,7 +13084,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions ], altMagicMethodName, errorNode, - expectedType + inferenceContext ); } @@ -11755,19 +13095,19 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions [{ type: leftSubtypeExpanded, isIncomplete: leftTypeResult.isIncomplete }], altMagicMethodName, errorNode, - expectedType + inferenceContext ); } } if (!resultType) { - if (expectedType) { + if (inferenceContext) { diag.addMessage( Localizer.Diagnostic.typeNotSupportBinaryOperatorBidirectional().format({ operator: ParseTreeUtils.printOperator(operator), leftType: printType(leftSubtypeExpanded), rightType: printType(rightSubtypeExpanded), - expectedType: printType(expectedType), + expectedType: printType(inferenceContext.expectedType), }) ); } else { @@ -11796,7 +13136,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions args: TypeResult[], magicMethodName: string, errorNode: ExpressionNode, - expectedType: Type | undefined + inferenceContext: InferenceContext | undefined ): Type | undefined { let magicMethodSupported = true; @@ -11843,10 +13183,24 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions { type: magicMethodType! }, /* typeVarContext */ undefined, /* skipUnknownArgCheck */ true, - expectedType + inferenceContext ); }); + // If there were errors with the expected type, try + // to evaluate without the expected type. + if (callResult!.argumentErrors && inferenceContext) { + useSpeculativeMode(errorNode, () => { + callResult = validateCallArguments( + errorNode, + functionArgs, + { type: magicMethodType! }, + /* typeVarContext */ undefined, + /* skipUnknownArgCheck */ true + ); + }); + } + if (callResult!.argumentErrors) { magicMethodSupported = false; } @@ -11905,22 +13259,34 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions return type; } - function getTypeOfDictionary(node: DictionaryNode, expectedType: Type | undefined): TypeResult { + function getTypeOfDictionary(node: DictionaryNode, inferenceContext: InferenceContext | undefined): TypeResult { // If the expected type is a union, analyze for each of the subtypes // to find one that matches. - let effectiveExpectedType = expectedType; + let effectiveExpectedType = inferenceContext?.expectedType; - if (expectedType && isUnion(expectedType)) { + if (inferenceContext && isUnion(inferenceContext.expectedType)) { let matchingSubtype: Type | undefined; + let matchingSubtypeResult: TypeResult | undefined; - doForEachSubtype(expectedType, (subtype) => { - if (!matchingSubtype) { - const subtypeResult = useSpeculativeMode(node, () => { - return getTypeOfDictionaryExpected(node, subtype); - }); + doForEachSubtype(inferenceContext.expectedType, (subtype) => { + // Use shortcut if we've already found a match. + if (matchingSubtypeResult && !matchingSubtypeResult.typeErrors) { + return; + } - if (subtypeResult && assignType(subtype, subtypeResult.type)) { + const subtypeResult = useSpeculativeMode(node, () => { + return getTypeOfDictionaryWithContext( + node, + makeInferenceContext(subtype, inferenceContext?.typeVarContext) + ); + }); + + if (subtypeResult && assignType(subtype, subtypeResult.type)) { + // If this is the first result we're seeing or it's the first result + // without errors, select it as the match. + if (!matchingSubtypeResult || (matchingSubtypeResult.typeErrors && !subtypeResult.typeErrors)) { matchingSubtype = subtype; + matchingSubtypeResult = subtypeResult; } } }); @@ -11931,37 +13297,39 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions let expectedTypeDiagAddendum = undefined; if (effectiveExpectedType) { expectedTypeDiagAddendum = new DiagnosticAddendum(); - const result = getTypeOfDictionaryExpected(node, effectiveExpectedType, expectedTypeDiagAddendum); + const result = getTypeOfDictionaryWithContext( + node, + makeInferenceContext(effectiveExpectedType, inferenceContext?.typeVarContext), + expectedTypeDiagAddendum + ); if (result) { return result; } } - const result = getTypeOfDictionaryInferred(node, /* hasExpectedType */ !!expectedType); + const result = getTypeOfDictionaryInferred(node, /* hasExpectedType */ !!inferenceContext); return { ...result, expectedTypeDiagAddendum }; } - // Attempts to infer the type of a dictionary statement. If an expectedType - // is provided, the resulting type must be compatible with the expected type. - // If this isn't possible, undefined is returned. - function getTypeOfDictionaryExpected( + function getTypeOfDictionaryWithContext( node: DictionaryNode, - expectedType: Type, + inferenceContext: InferenceContext, expectedDiagAddendum?: DiagnosticAddendum ): TypeResult | undefined { - expectedType = transformPossibleRecursiveTypeAlias(expectedType); + inferenceContext.expectedType = transformPossibleRecursiveTypeAlias(inferenceContext.expectedType); + const concreteExpectedType = makeTopLevelTypeVarsConcrete(inferenceContext.expectedType); - if (!isClassInstance(expectedType)) { + if (!isClassInstance(concreteExpectedType)) { return undefined; } - const keyTypes: Type[] = []; - const valueTypes: Type[] = []; + const keyTypes: TypeResultWithNode[] = []; + const valueTypes: TypeResultWithNode[] = []; let isIncomplete = false; // Handle TypedDict's as a special case. - if (ClassType.isTypedDictClass(expectedType)) { - const expectedTypedDictEntries = getTypedDictMembersForClass(evaluatorInterface, expectedType); + if (ClassType.isTypedDictClass(concreteExpectedType)) { + const expectedTypedDictEntries = getTypedDictMembersForClass(evaluatorInterface, concreteExpectedType); // Infer the key and value types if possible. if ( @@ -11979,13 +13347,15 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions isIncomplete = true; } - if (ClassType.isTypedDictClass(expectedType)) { + if (ClassType.isTypedDictClass(concreteExpectedType)) { const resultTypedDict = assignToTypedDict( evaluatorInterface, - expectedType, + concreteExpectedType, keyTypes, valueTypes, - expectedDiagAddendum + // Don't overwrite existing expectedDiagAddendum messages if they were + // already provided by getKeyValueTypesFromDictionary. + expectedDiagAddendum?.isEmpty() ? expectedDiagAddendum : undefined ); if (resultTypedDict) { return { @@ -12008,7 +13378,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions !populateTypeVarContextBasedOnExpectedType( evaluatorInterface, builtInDict, - expectedType, + inferenceContext.expectedType, dictTypeVarContext, getTypeVarScopesForNode(node) ) @@ -12047,13 +13417,18 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // cannot be narrowed further. Other super-types like Mapping, Collection, // and Iterable use covariant value types, so they can be narrowed. const isValueTypeInvariant = - isClassInstance(expectedType) && - (ClassType.isBuiltIn(expectedType, 'dict') || ClassType.isBuiltIn(expectedType, 'MutableMapping')); - - const specializedKeyType = inferTypeArgFromExpectedType(expectedKeyType, keyTypes, /* isNarrowable */ false); + isClassInstance(inferenceContext.expectedType) && + (ClassType.isBuiltIn(inferenceContext.expectedType, 'dict') || + ClassType.isBuiltIn(inferenceContext.expectedType, 'MutableMapping')); + + const specializedKeyType = inferTypeArgFromExpectedType( + expectedKeyType, + keyTypes.map((result) => result.type), + /* isNarrowable */ false + ); const specializedValueType = inferTypeArgFromExpectedType( expectedValueType, - valueTypes, + valueTypes.map((result) => result.type), /* isNarrowable */ !isValueTypeInvariant ); if (!specializedKeyType || !specializedValueType) { @@ -12071,20 +13446,27 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions let keyType: Type = fallbackType; let valueType: Type = fallbackType; - let keyTypes: Type[] = []; - let valueTypes: Type[] = []; + const keyTypeResults: TypeResultWithNode[] = []; + const valueTypeResults: TypeResultWithNode[] = []; let isEmptyContainer = false; let isIncomplete = false; // Infer the key and value types if possible. - if (getKeyAndValueTypesFromDictionary(node, keyTypes, valueTypes, /* forceStrictInference */ hasExpectedType)) { + if ( + getKeyAndValueTypesFromDictionary( + node, + keyTypeResults, + valueTypeResults, + /* forceStrictInference */ hasExpectedType + ) + ) { isIncomplete = true; } // Strip any literal values. - keyTypes = keyTypes.map((t) => stripLiteralValue(t)); - valueTypes = valueTypes.map((t) => stripLiteralValue(t)); + const keyTypes = keyTypeResults.map((t) => stripLiteralValue(t.type)); + const valueTypes = valueTypeResults.map((t) => stripLiteralValue(t.type)); keyType = keyTypes.length > 0 ? combineTypes(keyTypes) : fallbackType; @@ -12118,13 +13500,19 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions ) : UnknownType.create(); + if (isIncomplete) { + if (getContainerDepth(type) > maxInferredContainerDepth) { + return { type: UnknownType.create() }; + } + } + return { type, isIncomplete }; } function getKeyAndValueTypesFromDictionary( node: DictionaryNode, - keyTypes: Type[], - valueTypes: Type[], + keyTypes: TypeResultWithNode[], + valueTypes: TypeResultWithNode[], forceStrictInference: boolean, expectedKeyType?: Type, expectedValueType?: Type, @@ -12141,13 +13529,25 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions const keyTypeResult = getTypeOfExpression( entryNode.keyExpression, /* flags */ undefined, - expectedKeyType ?? (forceStrictInference ? NeverType.createNever() : undefined) + makeInferenceContext( + expectedKeyType ?? (forceStrictInference ? NeverType.createNever() : undefined) + ) ); + if (keyTypeResult.isIncomplete) { isIncomplete = true; } const keyType = keyTypeResult.type; + + if (!keyTypeResult.isIncomplete && !keyTypeResult.typeErrors) { + verifySetEntryOrDictKeyIsHashable(entryNode.keyExpression, keyType, /* isDictKey */ true); + } + + if (expectedDiagAddendum && keyTypeResult.expectedTypeDiagAddendum) { + expectedDiagAddendum.addAddendum(keyTypeResult.expectedTypeDiagAddendum); + } + let valueTypeResult: TypeResult; if ( @@ -12157,16 +13557,19 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions isLiteralType(keyType) && expectedTypedDictEntries.has(keyType.literalValue as string) ) { + const effectiveValueType = expectedTypedDictEntries.get(keyType.literalValue as string)!.valueType; valueTypeResult = getTypeOfExpression( entryNode.valueExpression, /* flags */ undefined, - expectedTypedDictEntries.get(keyType.literalValue as string)!.valueType + makeInferenceContext(effectiveValueType) ); } else { + const effectiveValueType = + expectedValueType ?? (forceStrictInference ? NeverType.createNever() : undefined); valueTypeResult = getTypeOfExpression( entryNode.valueExpression, /* flags */ undefined, - expectedValueType ?? (forceStrictInference ? NeverType.createNever() : undefined) + makeInferenceContext(effectiveValueType) ); } @@ -12180,12 +13583,39 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } if (forceStrictInference || index < maxEntriesToUseForInference) { - keyTypes.push(keyType); - valueTypes.push(valueType); + keyTypes.push({ node: entryNode.keyExpression, type: keyType }); + valueTypes.push({ node: entryNode.valueExpression, type: valueType }); } + addUnknown = false; } else if (entryNode.nodeType === ParseNodeType.DictionaryExpandEntry) { - const unexpandedTypeResult = getTypeOfExpression(entryNode.expandExpression); + // Verify that the type supports the `keys` and `__getitem__` methods. + // This protocol is defined in the _typeshed stub. If we can't find + // it there, fall back on typing.Mapping. + let mappingType = getTypeshedType(node, 'SupportsKeysAndGetItem'); + if (!mappingType) { + mappingType = getTypingType(node, 'Mapping'); + } + + let expectedType: Type | undefined; + if (expectedKeyType && expectedValueType) { + if (mappingType && isInstantiableClass(mappingType)) { + expectedType = ClassType.cloneAsInstance( + ClassType.cloneForSpecialization( + mappingType, + [expectedKeyType, expectedValueType], + /* isTypeArgumentExplicit */ true + ) + ); + } + } + + const unexpandedTypeResult = getTypeOfExpression( + entryNode.expandExpression, + /* flags */ undefined, + makeInferenceContext(expectedType) + ); + if (unexpandedTypeResult.isIncomplete) { isIncomplete = true; } @@ -12205,21 +13635,14 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions tdEntries.forEach((entry, name) => { if (entry.isRequired || entry.isProvided) { - keyTypes.push(ClassType.cloneWithLiteral(strObject, name)); - valueTypes.push(entry.valueType); + keyTypes.push({ node: entryNode, type: ClassType.cloneWithLiteral(strObject, name) }); + valueTypes.push({ node: entryNode, type: entry.valueType }); } }); addUnknown = false; } } else { - // Verify that the type supports the `keys` and `__getitem__` methods. - // This protocol is defined in the _typeshed stub. If we can't find - // it there, fall back on typing.Mapping. - let mappingType = getTypeshedType(node, 'SupportsKeysAndGetItem'); - if (!mappingType) { - mappingType = getTypingType(node, 'Mapping'); - } if (mappingType && isInstantiableClass(mappingType)) { const mappingTypeVarContext = new TypeVarContext(getTypeVarScopeId(mappingType)); @@ -12235,7 +13658,9 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions ClassType.cloneAsInstance(mappingType), unexpandedType, /* diag */ undefined, - mappingTypeVarContext + mappingTypeVarContext, + /* srcTypeVarContext */ undefined, + AssignTypeFlags.RetainLiteralsForTypeVar ) ) { const specializedMapping = applySolvedTypeVars( @@ -12245,8 +13670,8 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions const typeArgs = specializedMapping.typeArguments; if (typeArgs && typeArgs.length >= 2) { if (forceStrictInference || index < maxEntriesToUseForInference) { - keyTypes.push(typeArgs[0]); - valueTypes.push(typeArgs[1]); + keyTypes.push({ node: entryNode, type: typeArgs[0] }); + valueTypes.push({ node: entryNode, type: typeArgs[1] }); } addUnknown = false; } @@ -12277,8 +13702,8 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions const typeArgs = dictEntryType.tupleTypeArguments?.map((t) => t.type); if (typeArgs && typeArgs.length === 2) { if (forceStrictInference || index < maxEntriesToUseForInference) { - keyTypes.push(typeArgs[0]); - valueTypes.push(typeArgs[1]); + keyTypes.push({ node: entryNode, type: typeArgs[0] }); + valueTypes.push({ node: entryNode, type: typeArgs[1] }); } addUnknown = false; } @@ -12287,8 +13712,8 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions if (addUnknown) { if (forceStrictInference || index < maxEntriesToUseForInference) { - keyTypes.push(UnknownType.create()); - valueTypes.push(UnknownType.create()); + keyTypes.push({ node: entryNode, type: UnknownType.create() }); + valueTypes.push({ node: entryNode, type: UnknownType.create() }); } } }); @@ -12296,22 +13721,34 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions return isIncomplete; } - function getTypeOfListOrSet(node: ListNode | SetNode, expectedType: Type | undefined): TypeResult { + function getTypeOfListOrSet(node: ListNode | SetNode, inferenceContext: InferenceContext | undefined): TypeResult { // If the expected type is a union, recursively call for each of the subtypes // to find one that matches. - let effectiveExpectedType = expectedType; + let effectiveExpectedType = inferenceContext?.expectedType; - if (expectedType && isUnion(expectedType)) { + if (inferenceContext && isUnion(inferenceContext.expectedType)) { let matchingSubtype: Type | undefined; + let matchingSubtypeResult: TypeResult | undefined; - doForEachSubtype(expectedType, (subtype) => { - if (!matchingSubtype) { - const subtypeResult = useSpeculativeMode(node, () => { - return getTypeOfListOrSetExpected(node, subtype); - }); + doForEachSubtype(inferenceContext.expectedType, (subtype) => { + // Use shortcut if we've already found a match. + if (matchingSubtypeResult && !matchingSubtypeResult.typeErrors) { + return; + } - if (subtypeResult && assignType(subtype, subtypeResult.type)) { + const subtypeResult = useSpeculativeMode(node, () => { + return getTypeOfListOrSetWithContext( + node, + makeInferenceContext(subtype, inferenceContext?.typeVarContext) + ); + }); + + if (subtypeResult && assignType(subtype, subtypeResult.type)) { + // If this is the first result we're seeing or it's the first result + // without errors, select it as the match. + if (!matchingSubtypeResult || (matchingSubtypeResult.typeErrors && !subtypeResult.typeErrors)) { matchingSubtype = subtype; + matchingSubtypeResult = subtypeResult; } } }); @@ -12319,25 +13756,37 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions effectiveExpectedType = matchingSubtype; } + let expectedTypeDiagAddendum: DiagnosticAddendum | undefined; if (effectiveExpectedType) { - const result = getTypeOfListOrSetExpected(node, effectiveExpectedType); - if (result) { + const result = getTypeOfListOrSetWithContext( + node, + makeInferenceContext(effectiveExpectedType, inferenceContext?.typeVarContext) + ); + if (result && !result.typeErrors) { return result; } + + expectedTypeDiagAddendum = result?.expectedTypeDiagAddendum; } - return getTypeOfListOrSetInferred(node, /* hasExpectedType */ expectedType !== undefined); + const typeResult = getTypeOfListOrSetInferred(node, /* hasExpectedType */ inferenceContext !== undefined); + return { ...typeResult, expectedTypeDiagAddendum }; } // Attempts to determine the type of a list or set statement based on an expected type. // Returns undefined if that type cannot be honored. - function getTypeOfListOrSetExpected(node: ListNode | SetNode, expectedType: Type): TypeResult | undefined { + function getTypeOfListOrSetWithContext( + node: ListNode | SetNode, + inferenceContext: InferenceContext + ): TypeResult | undefined { const builtInClassName = node.nodeType === ParseNodeType.List ? 'list' : 'set'; - expectedType = transformPossibleRecursiveTypeAlias(expectedType); + inferenceContext.expectedType = transformPossibleRecursiveTypeAlias(inferenceContext.expectedType); + let isIncomplete = false; let typeErrors = false; + const verifyHashable = node.nodeType === ParseNodeType.Set; - if (!isClassInstance(expectedType)) { + if (!isClassInstance(inferenceContext.expectedType)) { return undefined; } @@ -12351,7 +13800,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions !populateTypeVarContextBasedOnExpectedType( evaluatorInterface, builtInListOrSet, - expectedType, + inferenceContext.expectedType, typeVarContext, getTypeVarScopesForNode(node) ) @@ -12370,40 +13819,59 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions const expectedEntryType = specializedListOrSet.typeArguments[0]; const entryTypes: Type[] = []; + const expectedTypeDiagAddendum = new DiagnosticAddendum(); node.entries.forEach((entry) => { let entryTypeResult: TypeResult; + if (entry.nodeType === ParseNodeType.ListComprehension) { entryTypeResult = getElementTypeFromListComprehension(entry, expectedEntryType); } else { - entryTypeResult = getTypeOfExpression(entry, /* flags */ undefined, expectedEntryType); + entryTypeResult = getTypeOfExpression( + entry, + /* flags */ undefined, + makeInferenceContext(expectedEntryType, inferenceContext?.typeVarContext) + ); } + entryTypes.push(entryTypeResult.type); + if (entryTypeResult.isIncomplete) { isIncomplete = true; } + if (entryTypeResult.typeErrors) { typeErrors = true; } + + if (entryTypeResult.expectedTypeDiagAddendum) { + expectedTypeDiagAddendum.addAddendum(entryTypeResult.expectedTypeDiagAddendum); + } + + if (verifyHashable && !entryTypeResult.isIncomplete && !entryTypeResult.typeErrors) { + verifySetEntryOrDictKeyIsHashable(entry, entryTypeResult.type, /* isDictKey */ false); + } }); const isExpectedTypeListOrSet = - isClassInstance(expectedType) && ClassType.isBuiltIn(expectedType, builtInClassName); + isClassInstance(inferenceContext.expectedType) && + ClassType.isBuiltIn(inferenceContext.expectedType, builtInClassName); const specializedEntryType = inferTypeArgFromExpectedType( expectedEntryType, entryTypes, /* isNarrowable */ !isExpectedTypeListOrSet ); if (!specializedEntryType) { - return undefined; + return { type: UnknownType.create(), isIncomplete, typeErrors: true, expectedTypeDiagAddendum }; } const type = getBuiltInObject(node, builtInClassName, [specializedEntryType]); - return { type, isIncomplete, typeErrors }; + return { type, isIncomplete, typeErrors, expectedTypeDiagAddendum }; } // Attempts to infer the type of a list or set statement with no "expected type". function getTypeOfListOrSetInferred(node: ListNode | SetNode, hasExpectedType: boolean): TypeResult { const builtInClassName = node.nodeType === ParseNodeType.List ? 'list' : 'set'; + const verifyHashable = node.nodeType === ParseNodeType.Set; let isEmptyContainer = false; let isIncomplete = false; let typeErrors = false; @@ -12415,16 +13883,13 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions if (entry.nodeType === ParseNodeType.ListComprehension) { entryTypeResult = getElementTypeFromListComprehension(entry); } else { - entryTypeResult = getTypeOfExpression( - entry, - /* flags */ undefined, - hasExpectedType ? NeverType.createNever() : undefined - ); + entryTypeResult = getTypeOfExpression(entry); } if (entryTypeResult.isIncomplete) { isIncomplete = true; } + if (entryTypeResult.typeErrors) { typeErrors = true; } @@ -12432,6 +13897,10 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions if (index < maxEntriesToUseForInference) { entryTypes.push(entryTypeResult.type); } + + if (verifyHashable && !entryTypeResult.isIncomplete && !entryTypeResult.typeErrors) { + verifySetEntryOrDictKeyIsHashable(entry, entryTypeResult.type, /* isDictKey */ false); + } }); entryTypes = entryTypes.map((t) => stripLiteralValue(t)); @@ -12471,9 +13940,35 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions ) : UnknownType.create(); + if (isIncomplete) { + if (getContainerDepth(type) > maxInferredContainerDepth) { + return { type: UnknownType.create() }; + } + } + return { type, isIncomplete, typeErrors }; } + function verifySetEntryOrDictKeyIsHashable(entry: ExpressionNode, type: Type, isDictKey: boolean) { + // Verify that the type is hashable. + if (!isTypeHashable(type)) { + const fileInfo = AnalyzerNodeInfo.getFileInfo(entry); + const diag = new DiagnosticAddendum(); + diag.addMessage(Localizer.DiagnosticAddendum.unhashableType().format({ type: printType(type) })); + + const message = isDictKey + ? Localizer.Diagnostic.unhashableDictKey() + : Localizer.Diagnostic.unhashableSetEntry(); + + addDiagnostic( + fileInfo.diagnosticRuleSet.reportGeneralTypeIssues, + DiagnosticRule.reportGeneralTypeIssues, + message + diag.getString(), + entry + ); + } + } + function inferTypeArgFromExpectedType( expectedType: Type, entryTypes: Type[], @@ -12508,7 +14003,12 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions let typeVarContext = new TypeVarContext(targetTypeVar.scopeId); if (useSynthesizedTypeVar) { - typeVarContext.setTypeVarType(targetTypeVar, isNarrowable ? undefined : expectedType, expectedType); + typeVarContext.setTypeVarType( + targetTypeVar, + isNarrowable ? undefined : expectedType, + /* narrowBoundNoLiterals */ undefined, + expectedType + ); } if ( @@ -12526,8 +14026,8 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions typeVarContext.setTypeVarType( targetTypeVar, isNarrowable ? undefined : expectedType, - expectedType, - /* retainLiteral */ true + /* narrowBoundNoLiterals */ undefined, + expectedType ); } @@ -12540,15 +14040,26 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions return undefined; } - function getTypeOfTernary(node: TernaryNode, flags: EvaluatorFlags, expectedType: Type | undefined): TypeResult { + function getTypeOfTernary( + node: TernaryNode, + flags: EvaluatorFlags, + inferenceContext: InferenceContext | undefined + ): TypeResult { getTypeOfExpression(node.testExpression); const typesToCombine: Type[] = []; let isIncomplete = false; let typeErrors = false; - if (isNodeReachable(node.ifExpression)) { - const ifType = getTypeOfExpression(node.ifExpression, flags, expectedType); + const fileInfo = AnalyzerNodeInfo.getFileInfo(node); + const constExprValue = evaluateStaticBoolExpression( + node.testExpression, + fileInfo.executionEnvironment, + fileInfo.definedConstants + ); + + if (constExprValue !== false && isNodeReachable(node.ifExpression)) { + const ifType = getTypeOfExpression(node.ifExpression, flags, inferenceContext); typesToCombine.push(ifType.type); if (ifType.isIncomplete) { isIncomplete = true; @@ -12558,8 +14069,8 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } } - if (isNodeReachable(node.elseExpression)) { - const elseType = getTypeOfExpression(node.elseExpression, flags, expectedType); + if (constExprValue !== true && isNodeReachable(node.elseExpression)) { + const elseType = getTypeOfExpression(node.elseExpression, flags, inferenceContext); typesToCombine.push(elseType.type); if (elseType.isIncomplete) { isIncomplete = true; @@ -12583,23 +14094,22 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions if (functionTypeInfo) { const returnType = FunctionType.getSpecializedReturnType(functionTypeInfo.functionType); if (returnType) { - const generatorTypeArgs = getGeneratorTypeArgs(returnType); - - if (generatorTypeArgs) { - if (generatorTypeArgs.length >= 1) { - expectedYieldType = generatorTypeArgs[0]; - } + expectedYieldType = getGeneratorYieldType(returnType, !!enclosingFunction.isAsync); - if (generatorTypeArgs.length >= 2) { - sentType = generatorTypeArgs[1]; - } + const generatorTypeArgs = getGeneratorTypeArgs(returnType); + if (generatorTypeArgs && generatorTypeArgs.length >= 2) { + sentType = generatorTypeArgs[1]; } } } } if (node.expression) { - const exprResult = getTypeOfExpression(node.expression, /* flags */ undefined, expectedYieldType); + const exprResult = getTypeOfExpression( + node.expression, + /* flags */ undefined, + makeInferenceContext(expectedYieldType) + ); if (exprResult.isIncomplete) { isIncomplete = true; } @@ -12609,7 +14119,8 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } function getTypeOfYieldFrom(node: YieldFromNode): TypeResult { - const yieldFromType = getTypeOfExpression(node.expression).type; + const yieldFromTypeResult = getTypeOfExpression(node.expression); + const yieldFromType = yieldFromTypeResult.type; let generatorTypeArgs = getGeneratorTypeArgs(yieldFromType); let returnedType: Type | undefined; @@ -12621,7 +14132,8 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // Handle old-style (pre-await) Coroutines as a special case. returnedType = UnknownType.create(); } else { - const iterableType = getTypeOfIterable(yieldFromType, /* isAsync */ false, node) ?? UnknownType.create(); + const iterableType = + getTypeOfIterable(yieldFromTypeResult, /* isAsync */ false, node)?.type ?? UnknownType.create(); // Does the iterable return a Generator? generatorTypeArgs = getGeneratorTypeArgs(iterableType); @@ -12633,18 +14145,18 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions return { type: returnedType || UnknownType.create() }; } - function getTypeOfLambda(node: LambdaNode, expectedType: Type | undefined): TypeResult { - let isIncomplete = false; + function getTypeOfLambda(node: LambdaNode, inferenceContext: InferenceContext | undefined): TypeResult { + let isIncomplete = !!inferenceContext?.isTypeIncomplete; const functionType = FunctionType.createInstance('', '', '', FunctionTypeFlags.PartiallyEvaluated); functionType.details.typeVarScopeId = getScopeIdForNode(node); // Pre-cache the incomplete function type in case the evaluation of the // lambda depends on itself. - writeTypeCache(node, functionType, EvaluatorFlags.None, /* isIncomplete */ true); + writeTypeCache(node, { type: functionType, isIncomplete: true }, EvaluatorFlags.None); let expectedFunctionTypes: FunctionType[] = []; - if (expectedType) { - mapSubtypes(expectedType, (subtype) => { + if (inferenceContext) { + mapSubtypes(inferenceContext.expectedType, (subtype) => { if (isFunction(subtype)) { expectedFunctionTypes.push(subtype); } @@ -12697,9 +14209,8 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions if (param.name) { writeTypeCache( param.name, - transformVariadicParamType(node, param.category, paramType), - EvaluatorFlags.None, - /* isIncomplete */ false + { type: transformVariadicParamType(node, param.category, paramType) }, + EvaluatorFlags.None ); } @@ -12747,6 +14258,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions hasDeclaredType: true, type: paramType, }; + FunctionType.addParameter(functionType, functionParam); }); @@ -12766,14 +14278,23 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // evaluation scope for the return expression and do not allow retention // of the cached types. const inferLambdaReturnType = () => { - const returnTypeResult = getTypeOfExpression(node.expression, /* flags */ undefined, expectedReturnType); + const returnTypeResult = getTypeOfExpression( + node.expression, + /* flags */ undefined, + makeInferenceContext(expectedReturnType) + ); + functionType.inferredReturnType = returnTypeResult.type; if (returnTypeResult.isIncomplete) { isIncomplete = true; } }; - if (speculativeTypeTracker.isSpeculative(node)) { + if (speculativeTypeTracker.isSpeculative(node) || inferenceContext?.isTypeIncomplete) { + // We need to set allowCacheRetention to false because we don't want to + // cache the type of the lambda return expression because it depends on + // the parameter types that we set above, and the speculative type cache + // doesn't know about that context. useSpeculativeMode( node.expression, () => { @@ -12791,19 +14312,10 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions return { type: functionType, isIncomplete }; } - function getTypeOfListComprehension(node: ListComprehensionNode, expectedType?: Type): TypeResult { + function getTypeOfListComprehension(node: ListComprehensionNode, inferenceContext?: InferenceContext): TypeResult { let isIncomplete = false; let typeErrors = false; - const elementTypeResult = getElementTypeFromListComprehension(node); - if (elementTypeResult.isIncomplete) { - isIncomplete = true; - } - if (elementTypeResult.typeErrors) { - typeErrors = true; - } - const elementType = elementTypeResult.type; - let isAsync = node.forIfNodes.some((comp) => { return ( (comp.nodeType === ParseNodeType.ListComprehensionFor && comp.isAsync) || @@ -12817,13 +14329,31 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions isAsync = true; } + let expectedElementType: Type | undefined; + if (inferenceContext) { + expectedElementType = getTypeOfIterator( + { type: inferenceContext.expectedType }, + isAsync, + /* errorNode */ undefined + )?.type; + } + + const elementTypeResult = getElementTypeFromListComprehension(node, expectedElementType); + if (elementTypeResult.isIncomplete) { + isIncomplete = true; + } + if (elementTypeResult.typeErrors) { + typeErrors = true; + } + const elementType = elementTypeResult.type; + // Handle the special case where a generator function (e.g. `(await x for x in y)`) // is expected to be an AsyncGenerator. if ( !isAsync && - expectedType && - isClassInstance(expectedType) && - ClassType.isBuiltIn(expectedType, 'AsyncGenerator') + inferenceContext && + isClassInstance(inferenceContext.expectedType) && + ClassType.isBuiltIn(inferenceContext.expectedType, 'AsyncGenerator') ) { isAsync = true; } @@ -12875,7 +14405,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions diagAddendum.addMessage( Localizer.DiagnosticAddendum.typeOfSymbol().format({ name: nameValue, - type: printType(simplifiedType, /* expandTypeAlias */ true), + type: printType(simplifiedType, { expandTypeAlias: true }), }) ); addDiagnostic( @@ -12897,11 +14427,19 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions isIncomplete = true; } const iterableType = stripLiteralValue(iterableTypeResult.type); - const itemType = - getTypeOfIterator(iterableType, !!node.isAsync, node.iterableExpression) ?? UnknownType.create(); + const itemTypeResult = getTypeOfIterator( + { type: iterableType, isIncomplete: iterableTypeResult.isIncomplete }, + !!node.isAsync, + node.iterableExpression + ) ?? { type: UnknownType.create(), isIncomplete: iterableTypeResult.isIncomplete }; const targetExpr = node.targetExpression; - assignTypeToExpression(targetExpr, itemType, !!iterableTypeResult.isIncomplete, node.iterableExpression); + assignTypeToExpression( + targetExpr, + itemTypeResult.type, + !!itemTypeResult.isIncomplete, + node.iterableExpression + ); } else { assert(node.nodeType === ParseNodeType.ListComprehensionIf); @@ -12939,7 +14477,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions const keyTypeResult = getTypeOfExpression( node.expression.keyExpression, /* flags */ undefined, - expectedKeyType + makeInferenceContext(expectedKeyType) ); if (keyTypeResult.isIncomplete) { isIncomplete = true; @@ -12955,7 +14493,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions const valueTypeResult = getTypeOfExpression( node.expression.valueExpression, /* flags */ undefined, - expectedValueOrElementType + makeInferenceContext(expectedValueOrElementType) ); if (valueTypeResult.isIncomplete) { isIncomplete = true; @@ -12971,12 +14509,16 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions type = makeTupleObject([keyType, valueType]); } else if (node.expression.nodeType === ParseNodeType.DictionaryExpandEntry) { // The parser should have reported an error in this case because it's not allowed. - getTypeOfExpression(node.expression.expandExpression, /* flags */ undefined, expectedValueOrElementType); + getTypeOfExpression( + node.expression.expandExpression, + /* flags */ undefined, + makeInferenceContext(expectedValueOrElementType) + ); } else if (isExpressionNode(node)) { const exprTypeResult = getTypeOfExpression( node.expression as ExpressionNode, /* flags */ undefined, - expectedValueOrElementType + makeInferenceContext(expectedValueOrElementType) ); if (exprTypeResult.isIncomplete) { isIncomplete = true; @@ -13219,7 +14761,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions let typeArg0Type = typeArgs[0].type; if (!validateTypeArg(typeArgs[0])) { typeArg0Type = UnknownType.create(); - } else if (!TypeBase.isInstantiable(typeArg0Type)) { + } else if (!isEffectivelyInstantiable(typeArg0Type)) { addExpectedClassDiagnostic(typeArg0Type, typeArgs[0].node); typeArg0Type = UnknownType.create(); } @@ -13347,7 +14889,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions typeArgs: TypeResultWithNode[] | undefined, flags: EvaluatorFlags ): Type { - if (flags & EvaluatorFlags.ClassVarDisallowed) { + if (flags & EvaluatorFlags.DisallowClassVar) { addError(Localizer.Diagnostic.classVarNotAllowed(), errorNode); return AnyType.create(); } @@ -13465,7 +15007,6 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions ) { const annotationType = getTypeOfAnnotation(firstParamTypeAnnotation, { associateTypeVarsWithScope: true, - disallowRecursiveTypeAlias: true, }); if (!isTypeVar(annotationType) || !annotationType.details.isSynthesizedSelf) { addDiagnostic( @@ -13489,12 +15030,12 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions isRequired: boolean, typeArgs: TypeResultWithNode[] | undefined, flags: EvaluatorFlags - ): Type { + ): TypeResult { // If no type arguments are provided, the resulting type // depends on whether we're evaluating a type annotation or // we're in some other context. if (!typeArgs && (flags & EvaluatorFlags.ExpectingTypeAnnotation) === 0) { - return classType; + return { type: classType }; } if (!typeArgs || typeArgs.length !== 1) { @@ -13502,7 +15043,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions isRequired ? Localizer.Diagnostic.requiredArgCount() : Localizer.Diagnostic.notRequiredArgCount(), errorNode ); - return classType; + return { type: classType }; } const typeArgType = typeArgs[0].type; @@ -13519,18 +15060,20 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions ClassType.isTypedDictClass(classTypeInfo.classType) ) { // The only legal usage is when used in a type annotation statement. - if ( - errorNode.parent?.nodeType === ParseNodeType.TypeAnnotation && - errorNode.parent.typeAnnotation === errorNode - ) { + if (ParseTreeUtils.isNodeContainedWithinNodeType(errorNode, ParseNodeType.TypeAnnotation)) { isUsageLegal = true; } } - if ((flags & EvaluatorFlags.RequiredAllowed) !== 0) { + if ((flags & EvaluatorFlags.AllowRequired) !== 0) { isUsageLegal = true; } + // Nested Required/NotRequired are not allowed. + if (typeArgs[0].isRequired || typeArgs[0].isNotRequired) { + isUsageLegal = false; + } + if (!isUsageLegal) { addError( isRequired @@ -13538,10 +15081,10 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions : Localizer.Diagnostic.notRequiredNotInTypedDict(), errorNode ); - return ClassType.cloneForSpecialization(classType, [convertToInstance(typeArgType)], !!typeArgs); + return { type: ClassType.cloneForSpecialization(classType, [convertToInstance(typeArgType)], !!typeArgs) }; } - return typeArgType; + return { type: typeArgType, isRequired, isNotRequired: !isRequired }; } function createUnpackType( @@ -13617,7 +15160,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions typeArgs: TypeResultWithNode[] | undefined, flags: EvaluatorFlags ): Type { - if (flags & EvaluatorFlags.FinalDisallowed) { + if (flags & EvaluatorFlags.DisallowFinal) { addError(Localizer.Diagnostic.finalContext(), errorNode); return AnyType.create(); } @@ -13649,6 +15192,10 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } else { if (isParamSpec(typeArg.type)) { addError(Localizer.Diagnostic.paramSpecContext(), typeArg.node); + } else if (isUnpackedVariadicTypeVar(typeArg.type)) { + addError(Localizer.Diagnostic.typeVarTupleContext(), typeArg.node); + } else if (isUnpackedClass(typeArg.type)) { + addError(Localizer.Diagnostic.unpackedArgInTypeArgument(), typeArg.node); } } }); @@ -13657,16 +15204,20 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions return createSpecialType(classType, typeArgs, /* paramLimit */ undefined, /* allowParamSpec */ true); } - function createAnnotatedType(errorNode: ParseNode, typeArgs: TypeResultWithNode[] | undefined): Type { + function createAnnotatedType(errorNode: ParseNode, typeArgs: TypeResultWithNode[] | undefined): TypeResult { if (typeArgs && typeArgs.length < 2) { addError(Localizer.Diagnostic.annotatedTypeArgMissing(), errorNode); } if (!typeArgs || typeArgs.length === 0) { - return AnyType.create(); + return { type: AnyType.create() }; } - return TypeBase.cloneForAnnotated(typeArgs[0].type); + return { + type: TypeBase.cloneForAnnotated(typeArgs[0].type), + isRequired: typeArgs[0].isRequired, + isNotRequired: typeArgs[0].isNotRequired, + }; } // Creates one of several "special" types that are defined in typing.pyi @@ -13812,7 +15363,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions if (!validateTypeArg(typeArg, { allowVariadicTypeVar: true, allowUnpackedTuples: true })) { typeArgType = UnknownType.create(); - } else if (!TypeBase.isInstantiable(typeArgType)) { + } else if (!isEffectivelyInstantiable(typeArgType)) { addExpectedClassDiagnostic(typeArgType, typeArg.node); typeArgType = UnknownType.create(); } @@ -13825,7 +15376,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } else { // If this is an unpacked TypeVar, note that it is in a union so we can differentiate // between Unpack[Vs] and Union[Unpack[Vs]]. - if (isTypeVar(typeArgType) && isVariadicTypeVar(typeArgType) && typeArgType.isVariadicUnpacked) { + if (isTypeVar(typeArgType) && isUnpackedVariadicTypeVar(typeArgType)) { typeArgType = TypeVarType.cloneForUnpacked(typeArgType, /* isInUnion */ true); } @@ -13896,8 +15447,9 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions function transformTypeForTypeAlias( type: Type, name: NameNode, - errorNode: ParseNode, - typeParameters?: TypeVarType[] + errorNode: ExpressionNode, + typeParameters?: TypeVarType[], + typeParamNodes?: TypeParameterNode[] ): Type { if (!TypeBase.isInstantiable(type)) { return type; @@ -13933,6 +15485,15 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions return convertToInstance(typeVar) as TypeVarType; }); + // Validate the default types for all type parameters. + typeParameters.forEach((typeParam, index) => { + let bestErrorNode = errorNode; + if (typeParamNodes && index < typeParamNodes.length) { + bestErrorNode = typeParamNodes[index].defaultExpression ?? typeParamNodes[index].name; + } + validateTypeParameterDefault(bestErrorNode, typeParam, typeParameters!.slice(0, index)); + }); + // Verify that we have at most one variadic type variable. const variadics = typeParameters.filter((param) => isVariadicTypeVar(param)); if (variadics.length > 1) { @@ -14080,7 +15641,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions computeMroLinearization(specialType); } - writeTypeCache(node, specialType, EvaluatorFlags.None, /* isIncomplete */ false); + writeTypeCache(node, { type: specialType }, EvaluatorFlags.None); return specialType; } @@ -14134,7 +15695,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // If the entire statement has already been evaluated, don't // re-evaluate it. - if (readTypeCache(node, EvaluatorFlags.None)) { + if (isTypeCached(node)) { return; } @@ -14157,10 +15718,11 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions if (isDeclaredTypeAlias(node.leftExpression)) { flags |= EvaluatorFlags.ExpectingType | + EvaluatorFlags.ExpectingTypeAnnotation | EvaluatorFlags.EvaluateStringLiteralAsType | - EvaluatorFlags.ParamSpecDisallowed | - EvaluatorFlags.TypeVarTupleDisallowed | - EvaluatorFlags.ClassVarDisallowed; + EvaluatorFlags.DisallowParamSpec | + EvaluatorFlags.DisallowTypeVarTuple | + EvaluatorFlags.DisallowClassVar; flags &= ~EvaluatorFlags.DoNotSpecialize; } @@ -14175,7 +15737,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions if (fileInfo.isTypingStubFile || fileInfo.isTypingExtensionsStubFile) { rightHandType = handleTypingStubAssignment(node); if (rightHandType) { - writeTypeCache(node.rightExpression, rightHandType, EvaluatorFlags.None, /* isIncomplete */ false); + writeTypeCache(node.rightExpression, { type: rightHandType }, EvaluatorFlags.None); } } @@ -14190,6 +15752,15 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions if (isDeclaredTypeAlias(node.leftExpression)) { typeAliasNameNode = (node.leftExpression as TypeAnnotationNode).valueExpression as NameNode; + + if (!isLegalTypeAliasExpressionForm(node.rightExpression)) { + addDiagnostic( + fileInfo.diagnosticRuleSet.reportGeneralTypeIssues, + DiagnosticRule.reportGeneralTypeIssues, + Localizer.Diagnostic.typeAliasIllegalExpressionForm(), + node.rightExpression + ); + } } else if (node.leftExpression.nodeType === ParseNodeType.Name) { const symbolWithScope = lookUpSymbolRecursive( node.leftExpression, @@ -14198,7 +15769,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions ); if (symbolWithScope) { const decls = symbolWithScope.symbol.getDeclarations(); - if (decls.length === 1 && isPossibleTypeAliasDeclaration(decls[0])) { + if (decls.length === 1 && isPossibleTypeAliasOrTypedDict(decls[0])) { typeAliasNameNode = node.leftExpression; isSpeculativeTypeAlias = true; } @@ -14217,24 +15788,22 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions typeAliasTypeVar.scopeId = scopeId; // Write the type back to the type cache. It will be replaced below. - writeTypeCache(node, typeAliasTypeVar, /* flags */ undefined, /* isIncomplete */ false); - writeTypeCache( - node.leftExpression, - typeAliasTypeVar, - /* flags */ undefined, - /* isIncomplete */ false - ); + writeTypeCache(node, { type: typeAliasTypeVar }, /* flags */ undefined); + writeTypeCache(node.leftExpression, { type: typeAliasTypeVar }, /* flags */ undefined); if (node.leftExpression.nodeType === ParseNodeType.TypeAnnotation) { writeTypeCache( node.leftExpression.valueExpression, - typeAliasTypeVar, - /* flags */ undefined, - /* isIncomplete */ false + { type: typeAliasTypeVar }, + /* flags */ undefined ); } } - const srcTypeResult = getTypeOfExpression(node.rightExpression, flags, declaredType); + const srcTypeResult = getTypeOfExpression( + node.rightExpression, + flags, + makeInferenceContext(declaredType) + ); let srcType = srcTypeResult.type; expectedTypeDiagAddendum = srcTypeResult.expectedTypeDiagAddendum; if (srcTypeResult.isIncomplete) { @@ -14277,13 +15846,6 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } if (typeAliasNameNode) { - // Clear out the temporary types we wrote above. - deleteTypeCacheEntry(node); - deleteTypeCacheEntry(node.leftExpression); - if (node.leftExpression.nodeType === ParseNodeType.TypeAnnotation) { - deleteTypeCacheEntry(node.leftExpression.valueExpression); - } - // If this was a speculative type alias, it becomes a real type alias // only if the evaluated type is an instantiable type. if ( @@ -14318,17 +15880,6 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // can be specialized. typeAliasTypeVar!.details.recursiveTypeParameters = rightHandType.typeAliasInfo?.typeParameters; } - - if (typeAliasTypeVar!.details.illegalRecursionDetected) { - addDiagnostic( - fileInfo.diagnosticRuleSet.reportGeneralTypeIssues, - DiagnosticRule.reportGeneralTypeIssues, - Localizer.Diagnostic.typeAliasIsRecursiveIndirect().format({ - name: typeAliasNameNode.value, - }), - node.leftExpression - ); - } } } } @@ -14343,7 +15894,42 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions expectedTypeDiagAddendum ); - writeTypeCache(node, rightHandType, EvaluatorFlags.None, isIncomplete); + writeTypeCache(node, { type: rightHandType, isIncomplete }, EvaluatorFlags.None); + } + + function isPossibleTypeAliasOrTypedDict(decl: Declaration) { + if (isPossibleTypeAliasDeclaration(decl)) { + return true; + } + + if ( + decl.type === DeclarationType.Variable && + decl.node.parent && + decl.node.parent.nodeType === ParseNodeType.Assignment && + decl.node.parent.rightExpression?.nodeType === ParseNodeType.Call + ) { + const callLeftNode = decl.node.parent.rightExpression.leftExpression; + + // Use a simple heuristic to determine whether this is potentially + // a call to the TypedDict call. This avoids the expensive (and potentially + // recursive) call to getTypeOfExpression in cases where it's not needed. + if ( + (callLeftNode.nodeType === ParseNodeType.Name && callLeftNode.value) === 'TypedDict' || + (callLeftNode.nodeType === ParseNodeType.MemberAccess && + callLeftNode.memberName.value === 'TypedDict' && + callLeftNode.leftExpression.nodeType === ParseNodeType.Name) + ) { + // See if this is a call to TypedDict. We want to support + // recursive type references in a TypedDict call. + const callType = getTypeOfExpression(callLeftNode, EvaluatorFlags.DoNotSpecialize).type; + + if (isInstantiableClass(callType) && ClassType.isBuiltIn(callType, 'TypedDict')) { + return true; + } + } + } + + return false; } // Evaluates the type of a type alias (i.e. "type") statement. This code @@ -14365,7 +15951,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions typeAliasTypeVar.scopeId = scopeId; // Write the type to the type cache. It will be replaced below. - writeTypeCache(node.name, typeAliasTypeVar, /* flags */ undefined, /* isIncomplete */ false); + writeTypeCache(node.name, { type: typeAliasTypeVar }, /* flags */ undefined); // Set a partial type to handle recursive (self-referential) type aliases. const scope = ScopeUtils.getScopeForNode(node); @@ -14381,6 +15967,15 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions typeAliasTypeVar.details.recursiveTypeParameters = typeParameters; } + if (!isLegalTypeAliasExpressionForm(node.expression)) { + addDiagnostic( + AnalyzerNodeInfo.getFileInfo(node).diagnosticRuleSet.reportGeneralTypeIssues, + DiagnosticRule.reportGeneralTypeIssues, + Localizer.Diagnostic.typeAliasIllegalExpressionForm(), + node.expression + ); + } + const aliasTypeResult = getTypeOfExpressionExpectingType(node.expression); let isIncomplete = false; let aliasType = aliasTypeResult.type; @@ -14388,10 +15983,13 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions isIncomplete = true; } - // Clear the temporary type we wrote above. - deleteTypeCacheEntry(node.name); - - aliasType = transformTypeForTypeAlias(aliasType, node.name, node.expression, typeParameters); + aliasType = transformTypeForTypeAlias( + aliasType, + node.name, + node.expression, + typeParameters, + node.typeParameters?.parameters + ); if (isTypeAliasRecursive(typeAliasTypeVar, aliasType)) { addDiagnostic( @@ -14410,30 +16008,19 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // to support recursive type aliases. typeAliasTypeVar.details.boundType = aliasType; - if (typeAliasTypeVar.details.illegalRecursionDetected) { - addDiagnostic( - AnalyzerNodeInfo.getFileInfo(node).diagnosticRuleSet.reportGeneralTypeIssues, - DiagnosticRule.reportGeneralTypeIssues, - Localizer.Diagnostic.typeAliasIsRecursiveIndirect().format({ - name: node.name.value, - }), - node.name - ); - } - - writeTypeCache(node.name, aliasType, EvaluatorFlags.None, isIncomplete); + writeTypeCache(node.name, { type: aliasType, isIncomplete }, EvaluatorFlags.None); return aliasType; } function evaluateTypesForAugmentedAssignment(node: AugmentedAssignmentNode): void { - if (readTypeCache(node, EvaluatorFlags.None)) { + if (isTypeCached(node)) { return; } - const destTypeResult = getTypeOfAugmentedAssignment(node, /* expectedType */ undefined); + const destTypeResult = getTypeOfAugmentedAssignment(node, /* inferenceContext */ undefined); - writeTypeCache(node, destTypeResult.type, EvaluatorFlags.None, !!destTypeResult.isIncomplete); + writeTypeCache(node, destTypeResult, EvaluatorFlags.None); } function getPseudoGenericTypeVarName(paramName: string) { @@ -14513,8 +16100,8 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions setSymbolResolutionPartialType(classSymbol, classDecl, classType); } classType.details.flags |= ClassTypeFlags.PartiallyEvaluated; - writeTypeCache(node, classType, /* flags */ undefined, /* isIncomplete */ false); - writeTypeCache(node.name, classType, /* flags */ undefined, /* isIncomplete */ false); + writeTypeCache(node, { type: classType }, /* flags */ undefined); + writeTypeCache(node.name, { type: classType }, /* flags */ undefined); // Keep a list of unique type parameters that are used in the // base class arguments. @@ -14531,24 +16118,36 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions const initSubclassArgs: FunctionArgument[] = []; let metaclassNode: ExpressionNode | undefined; + let isMetaclassDeferred = false; let exprFlags = EvaluatorFlags.ExpectingType | EvaluatorFlags.AllowGenericClassType | EvaluatorFlags.DisallowNakedGeneric | EvaluatorFlags.DisallowTypeVarsWithScopeId | - EvaluatorFlags.AssociateTypeVarsWithCurrentScope; + EvaluatorFlags.AssociateTypeVarsWithCurrentScope | + EvaluatorFlags.EnforceTypeVarVarianceConsistency; if (fileInfo.isStubFile) { exprFlags |= EvaluatorFlags.AllowForwardReferences; } node.arguments.forEach((arg) => { // Ignore unpacked arguments. - if (arg.argumentCategory !== ArgumentCategory.Simple) { + if (arg.argumentCategory === ArgumentCategory.UnpackedDictionary) { + // Evaluate the expression's type so symbols are marked accessed + // and errors are reported. + getTypeOfExpression(arg.valueExpression); return; } if (!arg.name) { - let argType = getTypeOfExpression(arg.valueExpression, exprFlags).type; + let argType: Type; + + if (arg.argumentCategory === ArgumentCategory.UnpackedList) { + getTypeOfExpression(arg.valueExpression); + argType = UnknownType.create(); + } else { + argType = getTypeOfExpression(arg.valueExpression, exprFlags).type; + } // In some stub files, classes are conditionally defined (e.g. based // on platform type). We'll assume that the conditional logic is correct @@ -14558,7 +16157,13 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } if (!isAnyOrUnknown(argType) && !isUnbound(argType)) { - if (!isInstantiableClass(argType)) { + if (isMetaclassInstance(argType)) { + assert(isClassInstance(argType)); + argType = + argType.typeArguments && argType.typeArguments.length > 0 + ? argType.typeArguments[0] + : UnknownType.create(); + } else if (!isInstantiableClass(argType)) { addDiagnostic( fileInfo.diagnosticRuleSet.reportGeneralTypeIssues, DiagnosticRule.reportGeneralTypeIssues, @@ -14567,14 +16172,18 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions ); argType = UnknownType.create(); } else { - if (ClassType.isPartiallyEvaluated(argType)) { + if ( + ClassType.isPartiallyEvaluated(argType) || + argType.details.mro.some((t) => isClass(t) && ClassType.isPartiallyEvaluated(t)) + ) { // If the base class is partially evaluated, install a callback // so we can fix up this class (e.g. compute the MRO) when the // dependent class is completed. classTypeHooks.push({ dependency: argType, - callback: () => completeClassTypeDeferred(classType, node.name), + callback: () => completeClassTypeDeferred(classType, node, node.name), }); + isMetaclassDeferred = true; } if (ClassType.isBuiltIn(argType, 'Protocol')) { @@ -14832,13 +16441,25 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions ); } + // Validate the default types for all type parameters. + classType.details.typeParameters.forEach((typeParam, index) => { + let bestErrorNode: ExpressionNode = node.name; + if (node.typeParameters && index < node.typeParameters.parameters.length) { + const typeParamNode = node.typeParameters.parameters[index]; + bestErrorNode = typeParamNode.defaultExpression ?? typeParamNode.name; + } + validateTypeParameterDefault(bestErrorNode, typeParam, classType.details.typeParameters.slice(0, index)); + }); + if (!computeMroLinearization(classType)) { addError(Localizer.Diagnostic.methodOrdering(), node.name); } // The scope for this class becomes the "fields" for the corresponding type. const innerScope = ScopeUtils.getScopeForNode(node.suite); - classType.details.fields = innerScope?.symbolTable || new Map(); + classType.details.fields = innerScope?.symbolTable + ? new Map(innerScope.symbolTable) + : new Map(); // Determine whether the class's instance variables are constrained // to those defined by __slots__. We need to do this prior to dataclass @@ -14918,7 +16539,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions if (metaclassNode) { const metaclassType = getTypeOfExpression(metaclassNode, exprFlags).type; if (isInstantiableClass(metaclassType) || isUnknown(metaclassType)) { - if (requiresSpecialization(metaclassType)) { + if (requiresSpecialization(metaclassType, /* ignorePseudoGeneric */ true)) { addDiagnostic( fileInfo.diagnosticRuleSet.reportGeneralTypeIssues, DiagnosticRule.reportGeneralTypeIssues, @@ -14976,7 +16597,11 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions dataClassBehaviors = effectiveMetaclass.details.classDataClassTransform; } else { const baseClassDataTransform = classType.details.mro.find((mroClass) => { - return isClass(mroClass) && mroClass.details.classDataClassTransform !== undefined; + return ( + isClass(mroClass) && + mroClass.details.classDataClassTransform !== undefined && + !ClassType.isSameGenericClass(mroClass, classType) + ); }); if (baseClassDataTransform) { @@ -14986,7 +16611,13 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions if (dataClassBehaviors) { applyDataClassDefaultBehaviors(classType, dataClassBehaviors); - applyDataClassClassBehaviorOverrides(evaluatorInterface, classType, initSubclassArgs); + applyDataClassClassBehaviorOverrides( + evaluatorInterface, + node.name, + classType, + initSubclassArgs, + dataClassBehaviors + ); } // Run any class hooks that depend on this class. @@ -15012,24 +16643,14 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions if (!skipSynthesizedInit) { const initSymbol = lookUpClassMember(classType, '__init__', ClassMemberLookupFlags.SkipBaseClasses); if (initSymbol) { - const initSymbolType = getTypeOfMember(initSymbol); - if (isFunction(initSymbolType)) { - if (!FunctionType.isSynthesizedMethod(initSymbolType)) { - hasExistingInitMethod = true; - } - } else { - hasExistingInitMethod = true; - } + hasExistingInitMethod = true; } } let skipSynthesizeHash = false; const hashSymbol = lookUpClassMember(classType, '__hash__', ClassMemberLookupFlags.SkipBaseClasses); if (hashSymbol) { - const hashSymbolType = getTypeOfMember(hashSymbol); - if (isFunction(hashSymbolType) && !FunctionType.isSynthesizedMethod(hashSymbolType)) { - skipSynthesizeHash = true; - } + skipSynthesizeHash = true; } synthesizeDataClassMethods( @@ -15072,13 +16693,10 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } // Update the undecorated class type. - writeTypeCache(node.name, classType, EvaluatorFlags.None, /* isIncomplete */ false); + writeTypeCache(node.name, { type: classType }, EvaluatorFlags.None); // Update the decorated class type. - writeTypeCache(node, decoratedType, EvaluatorFlags.None, /* isIncomplete */ false); - - // Validate __init_subclass__ call or metaclass keyword arguments. - validateInitSubclassArgs(node, classType, initSubclassArgs); + writeTypeCache(node, { type: decoratedType }, EvaluatorFlags.None); // Stash away a reference to the UnionType class if we encounter it. // There's no easy way to otherwise reference it. @@ -15086,9 +16704,65 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions unionType = ClassType.cloneAsInstance(classType); } + // Validate that arguments passed to `__init_subclass__` are of the correct type. + // Defer this if the metaclass calculation is deferred. + if (!isMetaclassDeferred) { + validateInitSubclassArgs(node, classType); + } + return { classType, decoratedType }; } + // Determines whether the type parameters has a default that refers to another + // type parameter. If so, validates that it is in the list of "live" type + // parameters and updates the scope of the type parameter referred to in the + // default type expression. + function validateTypeParameterDefault( + errorNode: ExpressionNode, + typeParam: TypeVarType, + otherLiveTypeParams: TypeVarType[] + ) { + if ( + !typeParam.details.defaultType && + !typeParam.details.isSynthesized && + !typeParam.details.isSynthesizedSelf + ) { + const typeVarWithDefault = otherLiveTypeParams.find((param) => param.details.defaultType); + if (typeVarWithDefault) { + addDiagnostic( + AnalyzerNodeInfo.getFileInfo(errorNode).diagnosticRuleSet.reportGeneralTypeIssues, + DiagnosticRule.reportGeneralTypeIssues, + Localizer.Diagnostic.typeVarWithoutDefault().format({ + name: typeParam.details.name, + other: typeVarWithDefault.details.name, + }), + errorNode + ); + } + return; + } + + const invalidTypeVars = new Set(); + validateTypeVarDefault(typeParam, otherLiveTypeParams, invalidTypeVars); + + // If we found one or more unapplied type variable, report an error. + if (invalidTypeVars.size > 0) { + const diag = new DiagnosticAddendum(); + invalidTypeVars.forEach((name) => { + diag.addMessage(Localizer.DiagnosticAddendum.typeVarDefaultOutOfScope().format({ name })); + }); + + addDiagnostic( + AnalyzerNodeInfo.getFileInfo(errorNode).diagnosticRuleSet.reportGeneralTypeIssues, + DiagnosticRule.reportGeneralTypeIssues, + Localizer.Diagnostic.typeVarDefaultInvalidTypeVar().format({ + name: typeParam.details.name, + }) + diag.getString(), + errorNode + ); + } + } + function inferTypeParameterVarianceForClass(classType: ClassType): void { if (!classType.details.requiresVarianceInference) { return; @@ -15102,7 +16776,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // prevents potential recursion. classType.details.requiresVarianceInference = false; - // Presumptively mark the computed variance to "in progress". We'll + // Presumptively mark the computed variance to "unknown". We'll // replace this below once the variance has been inferred. classType.details.typeParameters.forEach((param) => { if (param.details.declaredVariance === Variance.Auto) { @@ -15155,13 +16829,13 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions /* isTypeArgumentExplicit */ true ); - const isDestSubtypeOfSrc = assignClassToSelf(srcType, destType); + const isDestSubtypeOfSrc = assignClassToSelf(srcType, destType, /* ignoreBaseClassVariance */ false); let inferredVariance: Variance; if (isDestSubtypeOfSrc) { inferredVariance = Variance.Covariant; } else { - const isSrcSubtypeOfDest = assignClassToSelf(destType, srcType); + const isSrcSubtypeOfDest = assignClassToSelf(destType, srcType, /* ignoreBaseClassVariance */ false); if (isSrcSubtypeOfDest) { inferredVariance = Variance.Contravariant; } else { @@ -15183,12 +16857,12 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions const paramSymbol = AnalyzerNodeInfo.getTypeParameterSymbol(param.name); assert(paramSymbol); - const typeOfParam = getDeclaredTypeOfSymbol(paramSymbol, param.name); + const typeOfParam = getDeclaredTypeOfSymbol(paramSymbol, param.name)?.type; if (!typeOfParam || !isTypeVar(typeOfParam)) { return; } - writeTypeCache(param.name, typeOfParam, EvaluatorFlags.None, /* isIncomplete */ false); + writeTypeCache(param.name, { type: typeOfParam }, EvaluatorFlags.None); paramTypes.push(typeOfParam); }); @@ -15229,6 +16903,10 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions effectiveMetaclass = baseClassMeta ? UnknownType.create() : undefined; break; } + + if (ClassType.isEnumClass(baseClass)) { + classType.details.flags |= ClassTypeFlags.EnumClass; + } } else { // If one of the base classes is unknown, then the effective // metaclass is also unknowable. @@ -15307,6 +16985,19 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions evaluatorInterface, decoratorNode.expression ); + } else if (decoratorCallType.details.name === 'deprecated') { + originalClassType.details.deprecatedMessage = getCustomDeprecationMessage(decoratorNode); + return inputClassType; + } + } + + if (isOverloadedFunction(decoratorCallType)) { + if ( + decoratorCallType.overloads.length > 0 && + decoratorCallType.overloads[0].details.builtInName === 'deprecated' + ) { + originalClassType.details.deprecatedMessage = getCustomDeprecationMessage(decoratorNode); + return inputClassType; } } } @@ -15316,12 +17007,18 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions if (dataclassBehaviors) { applyDataClassDecorator( evaluatorInterface, + decoratorNode, originalClassType, dataclassBehaviors, /* callNode */ undefined ); return inputClassType; } + + if (decoratorType.overloads.length > 0 && decoratorType.overloads[0].details.builtInName === 'deprecated') { + originalClassType.details.deprecatedMessage = getCustomDeprecationMessage(decoratorNode); + return inputClassType; + } } else if (isFunction(decoratorType)) { if (decoratorType.details.builtInName === 'final') { originalClassType.details.flags |= ClassTypeFlags.Final; @@ -15330,7 +17027,14 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // behavior because its function definition results in a cyclical // dependency between builtins, typing and _typeshed stubs. return inputClassType; - } else if (decoratorType.details.builtInName === 'runtime_checkable') { + } + + if (decoratorType.details.builtInName === 'deprecated') { + originalClassType.details.deprecatedMessage = getCustomDeprecationMessage(decoratorNode); + return inputClassType; + } + + if (decoratorType.details.builtInName === 'runtime_checkable') { originalClassType.details.flags |= ClassTypeFlags.RuntimeCheckable; // Don't call getTypeOfDecorator for runtime_checkable. It appears @@ -15356,7 +17060,13 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } if (dataclassBehaviors) { - applyDataClassDecorator(evaluatorInterface, originalClassType, dataclassBehaviors, callNode); + applyDataClassDecorator( + evaluatorInterface, + decoratorNode, + originalClassType, + dataclassBehaviors, + callNode + ); return inputClassType; } } @@ -15364,23 +17074,39 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions return getTypeOfDecorator(decoratorNode, inputClassType); } + // Given a @typing.deprecated decorator node, returns either '' or a custom + // deprecation message if one is provided. + function getCustomDeprecationMessage(decorator: DecoratorNode): string { + if ( + decorator.expression.nodeType === ParseNodeType.Call && + decorator.expression.arguments.length > 0 && + decorator.expression.arguments[0].argumentCategory === ArgumentCategory.Simple && + decorator.expression.arguments[0].valueExpression.nodeType === ParseNodeType.StringList && + decorator.expression.arguments[0].valueExpression.strings.length === 1 + ) { + return decorator.expression.arguments[0].valueExpression.strings[0].value; + } + + return ''; + } + // Runs any registered "callback hooks" that depend on the specified class type. // This allows us to complete any work that requires dependent classes to be // completed. function runClassTypeHooks(type: ClassType) { classTypeHooks.forEach((hook) => { - if (hook.dependency === type) { + if (ClassType.isSameGenericClass(hook.dependency, type)) { hook.callback(); } }); // Remove any hooks that depend on this type. - classTypeHooks = classTypeHooks.filter((hook) => hook.dependency !== type); + classTypeHooks = classTypeHooks.filter((hook) => !ClassType.isSameGenericClass(hook.dependency, type)); } // Recomputes the MRO and effective metaclass for the class after dependent // classes have been fully constructed. - function completeClassTypeDeferred(type: ClassType, errorNode: ParseNode) { + function completeClassTypeDeferred(type: ClassType, node: ClassNode, errorNode: ParseNode) { // Recompute the MRO linearization. if (!computeMroLinearization(type)) { addError(Localizer.Diagnostic.methodOrdering(), errorNode); @@ -15388,9 +17114,26 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // Recompute the effective metaclass. computeEffectiveMetaclass(type, errorNode); + + validateInitSubclassArgs(node, type); } - function validateInitSubclassArgs(node: ClassNode, classType: ClassType, argList: FunctionArgument[]) { + function validateInitSubclassArgs(node: ClassNode, classType: ClassType) { + // Collect arguments that will be passed to the `__init_subclass__` + // method described in PEP 487 and validate it. + const argList: FunctionArgument[] = []; + + node.arguments.forEach((arg) => { + if (arg.name && arg.name.value !== 'metaclass') { + argList.push({ + argumentCategory: ArgumentCategory.Simple, + node: arg, + name: arg.name, + valueExpression: arg.valueExpression, + }); + } + }); + const errorNode = argList.length > 0 ? argList[0].node!.name! : node.name; const initSubclassMethodInfo = getTypeOfClassMemberName( errorNode, @@ -15415,7 +17158,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions { type: initSubclassMethodType }, /* typeVarContext */ undefined, /* skipUnknownArgCheck */ false, - NoneType.createInstance() + makeInferenceContext(NoneType.createInstance()) ); } } else if (classType.details.effectiveMetaclass && isClass(classType.details.effectiveMetaclass)) { @@ -15442,6 +17185,8 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } argList.forEach((arg) => { + const signatureTracker = new UniqueSignatureTracker(); + if (arg.argumentCategory === ArgumentCategory.Simple && arg.name) { const paramIndex = paramMap.get(arg.name.value) ?? paramListDetails.kwargsIndex; @@ -15461,7 +17206,8 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions validateArgType( argParam, new TypeVarContext(), - newMethodType, + signatureTracker, + { type: newMethodType }, /* skipUnknownCheck */ true, /* skipOverloadArg */ true, /* useNarrowBoundOnly */ false, @@ -15554,11 +17300,6 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions functionFlags |= FunctionTypeFlags.Generator; } - // Special-case magic method __class_getitem__, which is implicitly a class method. - if (containingClassNode && node.name.value === '__class_getitem__') { - functionFlags |= FunctionTypeFlags.ClassMethod; - } - if (fileInfo.isStubFile) { functionFlags |= FunctionTypeFlags.StubDefinition; } else if (fileInfo.isInPyTypedPackage) { @@ -15601,8 +17342,8 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions if (functionDecl && functionSymbol) { setSymbolResolutionPartialType(functionSymbol.symbol, functionDecl, functionType); } - writeTypeCache(node, functionType, /* flags */ undefined, /* isIncomplete */ false); - writeTypeCache(node.name, functionType, /* flags */ undefined, /* isIncomplete */ false); + writeTypeCache(node, { type: functionType }, /* flags */ undefined); + writeTypeCache(node.name, { type: functionType }, /* flags */ undefined); // Is this an "__init__" method within a pseudo-generic class? If so, // we'll add generic types to the constructor's parameters. @@ -15641,8 +17382,13 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } } + // If this function uses PEP 695 syntax for type parameters, + // accumulate the list of type parameters upfront. + const typeParametersSeen: TypeVarType[] = []; if (node.typeParameters) { - evaluateTypeParameterList(node.typeParameters); + functionType.details.typeParameters = evaluateTypeParameterList(node.typeParameters); + } else { + functionType.details.typeParameters = typeParametersSeen; } const markParamAccessed = (param: ParameterNode) => { @@ -15729,7 +17475,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions defaultValueType = getTypeOfExpression( param.defaultValue, EvaluatorFlags.ConvertEllipsisToAny, - annotatedType + makeInferenceContext(annotatedType) ).type; } @@ -15802,9 +17548,12 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // If there was no annotation for the parameter, infer its type if possible. let isTypeInferred = false; - if (!paramType) { + if (!paramTypeNode) { isTypeInferred = true; - paramType = inferParameterType(node, functionType.details.flags, index, containingClassType); + const inferredType = inferParameterType(node, functionType.details.flags, index, containingClassType); + if (inferredType) { + paramType = inferredType; + } } const functionParam: FunctionParameter = { @@ -15821,6 +17570,10 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions FunctionType.addParameter(functionType, functionParam); + if (functionParam.hasDeclaredType) { + addTypeVarsToListIfUnique(typeParametersSeen, getTypeVarArgumentsRecursive(functionParam.type)); + } + if (param.name) { const variadicParamType = transformVariadicParamType(node, param.category, functionParam.type); paramTypes.push(variadicParamType); @@ -15844,7 +17597,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions if (isUnknown(paramType)) { functionType.details.flags |= FunctionTypeFlags.UnannotatedParams; } - writeTypeCache(paramNameNode, paramType, EvaluatorFlags.None, /* isIncomplete */ false); + writeTypeCache(paramNameNode, { type: paramType }, EvaluatorFlags.None); } }); @@ -15866,22 +17619,14 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // If there was a defined return type, analyze that first so when we // walk the contents of the function, return statements can be // validated against this type. - if (node.returnTypeAnnotation) { + const returnTypeAnnotationNode = + node.returnTypeAnnotation ?? node.functionAnnotationComment?.returnTypeAnnotation; + if (returnTypeAnnotationNode) { // Temporarily set the return type to unknown in case of recursion. functionType.details.declaredReturnType = UnknownType.create(); - const returnType = getTypeOfAnnotation(node.returnTypeAnnotation, { + const returnType = getTypeOfAnnotation(returnTypeAnnotationNode, { associateTypeVarsWithScope: true, - disallowRecursiveTypeAlias: true, - }); - functionType.details.declaredReturnType = returnType; - } else if (node.functionAnnotationComment) { - // Temporarily set the return type to unknown in case of recursion. - functionType.details.declaredReturnType = UnknownType.create(); - - const returnType = getTypeOfAnnotation(node.functionAnnotationComment.returnTypeAnnotation, { - associateTypeVarsWithScope: true, - disallowRecursiveTypeAlias: true, }); functionType.details.declaredReturnType = returnType; } else { @@ -15899,6 +17644,15 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } } + // Accumulate any type parameters used in the return type. + if (functionType.details.declaredReturnType && returnTypeAnnotationNode) { + rescopeTypeVarsForCallableReturnType( + functionType.details.declaredReturnType, + functionType, + typeParametersSeen + ); + } + // If the return type is explicitly annotated as a generator, mark the // function as a generator even though it may not contain a "yield" statement. // This is important for generator functions declared in stub files, abstract @@ -15917,6 +17671,16 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } } + // Validate the default types for all type parameters. + functionType.details.typeParameters.forEach((typeParam, index) => { + let bestErrorNode: ExpressionNode = node.name; + if (node.typeParameters && index < node.typeParameters.parameters.length) { + const typeParamNode = node.typeParameters.parameters[index]; + bestErrorNode = typeParamNode.defaultExpression ?? typeParamNode.name; + } + validateTypeParameterDefault(bestErrorNode, typeParam, functionType.details.typeParameters.slice(0, index)); + }); + // Clear the "partially evaluated" flag to indicate that the functionType // is fully evaluated. functionType.details.flags &= ~FunctionTypeFlags.PartiallyEvaluated; @@ -15961,12 +17725,54 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions decoratedType = addOverloadsToFunctionType(node, decoratedType); } - writeTypeCache(node.name, functionType, EvaluatorFlags.None, /* isIncomplete */ false); - writeTypeCache(node, decoratedType, EvaluatorFlags.None, /* isIncomplete */ false); + writeTypeCache(node.name, { type: functionType }, EvaluatorFlags.None); + writeTypeCache(node, { type: decoratedType }, EvaluatorFlags.None); return { functionType, decoratedType }; } + // If the declared return type of a function contains type variables that + // are found nowhere else in the signature and are contained within a + // Callable, these type variables are "rescoped" from the function to + // the Callable. + function rescopeTypeVarsForCallableReturnType( + returnType: Type, + functionType: FunctionType, + typeParametersSeen: TypeVarType[] + ) { + const typeVarsInReturnType = getTypeVarArgumentsRecursive(returnType); + const rescopedTypeVars: TypeVarType[] = []; + + typeVarsInReturnType.forEach((typeVar) => { + if (TypeBase.isInstantiable(typeVar)) { + typeVar = TypeVarType.cloneAsInstance(typeVar); + } + + // If this type variable isn't scoped to this function, it is probably + // associated with an outer scope. + if (typeVar.scopeId !== functionType.details.typeVarScopeId) { + return; + } + + // If this type variable was already seen in one or more input parameters, + // don't attempt to rescope it. + if (typeParametersSeen.some((tp) => isTypeSame(convertToInstance(tp), typeVar))) { + return; + } + + // Is this type variable seen outside of a single callable? + if (isTypeVarLimitedToCallable(returnType, typeVar)) { + rescopedTypeVars.push(typeVar); + } + }); + + addTypeVarsToListIfUnique(typeParametersSeen, typeVarsInReturnType); + + // Note that the type parameters have been rescoped so they are not + // considered valid for the body of this function. + functionType.details.rescopedTypeParameters = rescopedTypeVars; + } + function adjustParameterAnnotatedType(param: ParameterNode, type: Type): Type { // PEP 484 indicates that if a parameter has a default value of 'None' // the type checker should assume that the type is optional (i.e. a union @@ -15987,7 +17793,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions const defaultArgType = getTypeOfExpression( param.defaultValue, EvaluatorFlags.ConvertEllipsisToAny, - type + makeInferenceContext(type) ).type; if (!isAny(defaultArgType)) { @@ -16068,9 +17874,16 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions const defaultValueType = getTypeOfExpression(paramValueExpr, EvaluatorFlags.ConvertEllipsisToAny).type; let inferredParamType: Type | undefined; - if (isNoneInstance(defaultValueType)) { - // Infer Optional[Unknown] in this case. - inferredParamType = combineTypes([NoneType.createInstance(), UnknownType.create()]); + + // Is the default value a "None" or an instance of some private class (one + // whose name starts with an underscore)? If so, we will assume that the + // value is a singleton sentinel. The actual supported type is going to be + // a union of this type and Unknown. + if ( + isNoneInstance(defaultValueType) || + (isClassInstance(defaultValueType) && isPrivateOrProtectedName(defaultValueType.details.name)) + ) { + inferredParamType = combineTypes([defaultValueType, UnknownType.create()]); } else { // Do not infer certain types like tuple because it's likely to be // more restrictive (narrower) than intended. @@ -16158,16 +17971,19 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions const fileInfo = AnalyzerNodeInfo.getFileInfo(node); let flags = FunctionTypeFlags.None; - // The "__new__" magic method is not an instance method. - // It acts as a static method instead. - if (node.name.value === '__new__' && isInClass) { - flags |= FunctionTypeFlags.ConstructorMethod; - } + if (isInClass) { + // The "__new__" magic method is not an instance method. + // It acts as a static method instead. + if (node.name.value === '__new__') { + flags |= FunctionTypeFlags.ConstructorMethod; + } - // The "__init_subclass__" magic method is not an instance method. - // It acts an an implicit class method instead. - if (node.name.value === '__init_subclass__' && isInClass) { - flags |= FunctionTypeFlags.ClassMethod; + // Several magic methods are treated as class methods implicitly + // by the runtime. Check for these here. + const implicitClassMethods = ['__init_subclass__', '__class_getitem__']; + if (implicitClassMethods.some((name) => node.name.value === name)) { + flags |= FunctionTypeFlags.ClassMethod; + } } for (const decoratorNode of node.decorators) { @@ -16187,6 +18003,8 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } } else if (decoratorType.details.builtInName === 'final') { flags |= FunctionTypeFlags.Final; + } else if (decoratorType.details.builtInName === 'override') { + flags |= FunctionTypeFlags.Overridden; } } else if (isInstantiableClass(decoratorType)) { if (ClassType.isBuiltIn(decoratorType, 'staticmethod')) { @@ -16253,6 +18071,21 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions ); return inputFunctionType; } + + if (decoratorCallType.details.name === 'deprecated') { + undecoratedType.details.deprecatedMessage = getCustomDeprecationMessage(decoratorNode); + return inputFunctionType; + } + } + + if (isOverloadedFunction(decoratorCallType)) { + if ( + decoratorCallType.overloads.length > 0 && + decoratorCallType.overloads[0].details.builtInName === 'deprecated' + ) { + undecoratedType.details.deprecatedMessage = getCustomDeprecationMessage(decoratorNode); + return inputFunctionType; + } } } @@ -16264,6 +18097,11 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions return inputFunctionType; } + if (decoratorType.details.builtInName === 'deprecated') { + undecoratedType.details.deprecatedMessage = getCustomDeprecationMessage(decoratorNode); + return inputFunctionType; + } + // Handle property setters and deleters. if (decoratorNode.expression.nodeType === ParseNodeType.MemberAccess) { const baseType = getTypeOfExpression( @@ -16300,6 +18138,11 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } } } + } else if (isOverloadedFunction(decoratorType)) { + if (decoratorType.overloads.length > 0 && decoratorType.overloads[0].details.builtInName === 'deprecated') { + undecoratedType.details.deprecatedMessage = getCustomDeprecationMessage(decoratorNode); + return inputFunctionType; + } } else if (isInstantiableClass(decoratorType)) { if (ClassType.isBuiltIn(decoratorType)) { switch (decoratorType.details.name) { @@ -16390,7 +18233,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } } - const overloadedTypes: FunctionType[] = []; + let overloadedTypes: FunctionType[] = []; // Look at the previous declaration's type. const prevDecl = decls[declIndex - 1]; @@ -16415,6 +18258,18 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions return overloadedTypes[0]; } + // Apply the implementation's docstring to any overloads that don't + // have their own docstrings. + const implementation = overloadedTypes.find((signature) => !FunctionType.isOverloaded(signature)); + if (implementation?.details.docString) { + overloadedTypes = overloadedTypes.map((overload) => { + if (FunctionType.isOverloaded(overload) && !overload.details.docString) { + return FunctionType.cloneWithDocString(overload, implementation.details.docString); + } + return overload; + }); + } + // Create a new overloaded type that copies the contents of the previous // one and adds a new function. const newOverload = OverloadedFunctionType.create(overloadedTypes); @@ -16577,7 +18432,26 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions isIncomplete = true; } - inferredReturnTypes.push(returnTypeResult.type ?? UnknownType.create()); + let returnType = returnTypeResult.type; + + // If the return type includes an instance of a class with isEmptyContainer + // set, clear that because we don't want this flag to "leak" into the + // inferred return type. + returnType = mapSubtypes(returnType, (subtype) => { + if (isClassInstance(subtype) && subtype.isEmptyContainer) { + return ClassType.cloneForSpecialization( + subtype, + subtype.typeArguments, + !!subtype.isTypeArgumentExplicit, + subtype.includeSubclasses, + subtype.tupleTypeArguments, + /* isEmptyContainer */ false + ); + } + return subtype; + }); + + inferredReturnTypes.push(returnType); } else { inferredReturnTypes.push(NoneType.createInstance()); } @@ -16605,20 +18479,20 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions functionDecl.yieldStatements.forEach((yieldNode) => { if (isNodeReachable(yieldNode)) { if (yieldNode.nodeType === ParseNodeType.YieldFrom) { - const iteratorType = getTypeOfExpression(yieldNode.expression).type; + const iteratorTypeResult = getTypeOfExpression(yieldNode.expression); if ( - isClassInstance(iteratorType) && - ClassType.isBuiltIn(iteratorType, 'Coroutine') + isClassInstance(iteratorTypeResult.type) && + ClassType.isBuiltIn(iteratorTypeResult.type, 'Coroutine') ) { // Handle old-style (pre-await) Coroutines. inferredYieldTypes.push(); useAwaitableGenerator = true; } else { const yieldType = getTypeOfIterator( - iteratorType, + iteratorTypeResult, /* isAsync */ false, yieldNode - ); + )?.type; inferredYieldTypes.push(yieldType ?? UnknownType.create()); } } else { @@ -16671,7 +18545,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } } - writeTypeCache(node.suite, inferredReturnType, EvaluatorFlags.None, isIncomplete); + writeTypeCache(node.suite, { type: inferredReturnType, isIncomplete }, EvaluatorFlags.None); } finally { functionRecursionMap.delete(node.id); } @@ -16713,13 +18587,14 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } function evaluateTypesForForStatement(node: ForNode): void { - if (readTypeCache(node, EvaluatorFlags.None)) { + if (isTypeCached(node)) { return; } const iteratorTypeResult = getTypeOfExpression(node.iterableExpression); const iteratedType = - getTypeOfIterator(iteratorTypeResult.type, !!node.isAsync, node.iterableExpression) ?? UnknownType.create(); + getTypeOfIterator(iteratorTypeResult, !!node.isAsync, node.iterableExpression)?.type ?? + UnknownType.create(); assignTypeToExpression( node.targetExpression, @@ -16728,18 +18603,23 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions node.targetExpression ); - writeTypeCache(node, iteratedType, EvaluatorFlags.None, !!iteratorTypeResult.isIncomplete); + writeTypeCache( + node, + { type: iteratedType, isIncomplete: !!iteratorTypeResult.isIncomplete }, + EvaluatorFlags.None + ); } function evaluateTypesForExceptStatement(node: ExceptNode): void { // This should be called only if the except node has a target exception. assert(node.typeExpression !== undefined); - if (readTypeCache(node, EvaluatorFlags.None)) { + if (isTypeCached(node)) { return; } - const exceptionTypes = getTypeOfExpression(node.typeExpression!).type; + const exceptionTypeResult = getTypeOfExpression(node.typeExpression!); + const exceptionTypes = exceptionTypeResult.type; function getExceptionType(exceptionType: Type, errorNode: ExpressionNode) { exceptionType = makeTopLevelTypeVarsConcrete(exceptionType); @@ -16754,7 +18634,11 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions if (isClassInstance(exceptionType)) { const iterableType = - getTypeOfIterator(exceptionType, /* isAsync */ false, errorNode) ?? UnknownType.create(); + getTypeOfIterator( + { type: exceptionType, isIncomplete: exceptionTypeResult.isIncomplete }, + /* isAsync */ false, + errorNode + )?.type ?? UnknownType.create(); return mapSubtypes(iterableType, (subtype) => { if (isAnyOrUnknown(subtype)) { @@ -16782,20 +18666,20 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions return getExceptionType(subType, node.typeExpression!); }); - // If this is an except group, wrap the exception type in an ExceptionGroup. + // If this is an except group, wrap the exception type in an BaseExceptionGroup. if (node.isExceptGroup) { - targetType = getBuiltInObject(node, 'ExceptionGroup', [targetType]); + targetType = getBuiltInObject(node, 'BaseExceptionGroup', [targetType]); } if (node.name) { assignTypeToExpression(node.name, targetType, /* isIncomplete */ false, node.name); } - writeTypeCache(node, targetType, EvaluatorFlags.None, /* isIncomplete */ false); + writeTypeCache(node, { type: targetType }, EvaluatorFlags.None); } function evaluateTypesForWithStatement(node: WithItemNode): void { - if (readTypeCache(node, EvaluatorFlags.None)) { + if (isTypeCached(node)) { return; } @@ -16823,43 +18707,36 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions return subtype; } - const diag = new DiagnosticAddendum(); const additionalHelp = new DiagnosticAddendum(); - if (isClassInstance(subtype)) { - const enterType = getTypeOfObjectMember( - node.expression, + if (isClass(subtype)) { + let enterType = getTypeOfMagicMethodReturn( subtype, + [], enterMethodName, - { method: 'get' }, - diag - )?.type; + node.expression, + /* inferenceContext */ undefined + ); if (enterType) { - let memberReturnType: Type; - if (isFunction(enterType)) { - memberReturnType = getFunctionEffectiveReturnType(enterType); - } else { - memberReturnType = UnknownType.create(); - } - // For "async while", an implicit "await" is performed. if (isAsync) { - memberReturnType = getTypeOfAwaitable(memberReturnType, node.expression); + enterType = getTypeOfAwaitable(enterType, node.expression); } - return memberReturnType; + return enterType; } if (!isAsync) { - const memberType = getTypeOfObjectMember( - node.expression, - subtype, - '__aenter__', - { method: 'get' }, - diag - ); - if (memberType) { + if ( + getTypeOfMagicMethodReturn( + subtype, + [], + '__aenter__', + node.expression, + /* inferenceContext */ undefined + ) + ) { additionalHelp.addMessage(Localizer.DiagnosticAddendum.asyncHelp()); } } @@ -16885,15 +18762,14 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions return; } - const diag = new DiagnosticAddendum(); - - if (isClassInstance(subtype)) { - const exitType = getTypeOfObjectMember( - node.expression, + if (isClass(subtype)) { + const anyArg: TypeResult = { type: AnyType.create() }; + const exitType = getTypeOfMagicMethodReturn( subtype, + [anyArg, anyArg, anyArg], exitMethodName, - { method: 'get' }, - diag + node.expression, + /* inferenceContext */ undefined ); if (exitType) { @@ -16914,11 +18790,11 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions assignTypeToExpression(node.target, scopedType, !!exprTypeResult.isIncomplete, node.target); } - writeTypeCache(node, scopedType, EvaluatorFlags.None, !!exprTypeResult.isIncomplete); + writeTypeCache(node, { type: scopedType, isIncomplete: !!exprTypeResult.isIncomplete }, EvaluatorFlags.None); } function evaluateTypesForImportAs(node: ImportAsNode): void { - if (readTypeCache(node, EvaluatorFlags.None)) { + if (isTypeCached(node)) { return; } @@ -16951,11 +18827,11 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions assignTypeToNameNode(symbolNameNode, symbolType, /* isIncomplete */ false, /* ignoreEmptyContainers */ false); - writeTypeCache(node, symbolType, EvaluatorFlags.None, /* isIncomplete */ false); + writeTypeCache(node, { type: symbolType }, EvaluatorFlags.None); } function evaluateTypesForImportFromAs(node: ImportFromAsNode): void { - if (readTypeCache(node, EvaluatorFlags.None)) { + if (isTypeCached(node)) { return; } @@ -17022,11 +18898,11 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } assignTypeToNameNode(aliasNode, symbolType, /* isIncomplete */ false, /* ignoreEmptyContainers */ false); - writeTypeCache(node, symbolType, EvaluatorFlags.None, /* isIncomplete */ false); + writeTypeCache(node, { type: symbolType }, EvaluatorFlags.None); } function evaluateTypesForMatchStatement(node: MatchNode): void { - if (readTypeCache(node, EvaluatorFlags.None)) { + if (isTypeCached(node)) { return; } @@ -17045,11 +18921,15 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } } - writeTypeCache(node, subjectType, EvaluatorFlags.None, !!subjectTypeResult.isIncomplete); + writeTypeCache( + node, + { type: subjectType, isIncomplete: !!subjectTypeResult.isIncomplete }, + EvaluatorFlags.None + ); } function evaluateTypesForCaseStatement(node: CaseNode): void { - if (readTypeCache(node, EvaluatorFlags.None)) { + if (isTypeCached(node)) { return; } @@ -17058,6 +18938,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions return; } + const fileInfo = AnalyzerNodeInfo.getFileInfo(node); const subjectTypeResult = getTypeOfExpression(node.parent.subjectExpression); let subjectType = subjectTypeResult.type; @@ -17065,8 +18946,12 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // except for those that have a guard expression. for (const caseStatement of node.parent.cases) { if (caseStatement === node) { + if (fileInfo.diagnosticRuleSet.reportUnnecessaryComparison !== 'none') { + checkForUnusedPattern(evaluatorInterface, node.pattern, subjectType); + } break; } + if (!caseStatement.guardExpression) { subjectType = narrowTypeBasedOnPattern( evaluatorInterface, @@ -17101,11 +18986,15 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions node.pattern ); - writeTypeCache(node, subjectType, EvaluatorFlags.None, !!subjectTypeResult.isIncomplete); + writeTypeCache( + node, + { type: subjectType, isIncomplete: !!subjectTypeResult.isIncomplete }, + EvaluatorFlags.None + ); } function evaluateTypesForImportFrom(node: ImportFromNode): void { - if (readTypeCache(node, EvaluatorFlags.None)) { + if (isTypeCached(node)) { return; } @@ -17129,7 +19018,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions assignTypeToNameNode(symbolNameNode, symbolType, /* isIncomplete */ false, /* ignoreEmptyContainers */ false); - writeTypeCache(node, symbolType, EvaluatorFlags.None, /* isIncomplete */ false); + writeTypeCache(node, { type: symbolType }, EvaluatorFlags.None); } function evaluateTypesForTypeAnnotationNode(node: TypeAnnotationNode) { @@ -17145,7 +19034,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions allowClassVar: ParseTreeUtils.isClassVarAllowedForAssignmentTarget(node.valueExpression), }); - writeTypeCache(node.valueExpression, annotationType, EvaluatorFlags.None, /* isIncomplete */ false); + writeTypeCache(node.valueExpression, { type: annotationType }, EvaluatorFlags.None); } } @@ -17253,6 +19142,16 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions return; } + if (node.parent.nodeType === ParseNodeType.ImportFromAs) { + evaluateTypesForImportFromAs(node.parent); + return; + } + + if (node.parent.nodeType === ParseNodeType.ImportAs) { + evaluateTypesForImportAs(node.parent); + return; + } + if (node.parent.nodeType === ParseNodeType.TypeAlias && node.parent.name === node) { getTypeOfTypeAlias(node.parent); return; @@ -17306,12 +19205,19 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions ) { getTypeOfAnnotation(annotationNode, { associateTypeVarsWithScope: true, - disallowRecursiveTypeAlias: true, }); return; } - getTypeOfAnnotation(annotationNode); + getTypeOfAnnotation(annotationNode, { + isVariableAnnotation: annotationNode.parent?.nodeType === ParseNodeType.TypeAnnotation, + allowUnpackedTuple: + annotationParent.nodeType === ParseNodeType.Parameter && + annotationParent.category === ParameterCategory.VarArgList, + allowUnpackedTypedDict: + annotationParent.nodeType === ParseNodeType.Parameter && + annotationParent.category === ParameterCategory.VarArgDictionary, + }); return; } @@ -17345,6 +19251,13 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions nodeToEvaluate = argumentNode.parent; continue; } + + if (argumentNode.parent.nodeType === ParseNodeType.Class) { + // If this is an argument node within a class declaration, + // evaluate the full class declaration node. + getTypeOfClass(argumentNode.parent); + return; + } } let parent = nodeToEvaluate.parent; @@ -17381,19 +19294,13 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions flags = EvaluatorFlags.DoNotSpecialize; break; } - } else { - // Check for expression types that are always contextual. - if ( - nodeToEvaluate.nodeType !== ParseNodeType.Dictionary && - nodeToEvaluate.nodeType !== ParseNodeType.List && - nodeToEvaluate.nodeType !== ParseNodeType.Lambda && - nodeToEvaluate.nodeType !== ParseNodeType.Set && - nodeToEvaluate.nodeType !== ParseNodeType.Tuple && - nodeToEvaluate.nodeType !== ParseNodeType.Unpack && - nodeToEvaluate.nodeType !== ParseNodeType.ListComprehension - ) { - break; - } + } else if (parent.nodeType === ParseNodeType.StringList && nodeToEvaluate === parent.typeAnnotation) { + // Forward-declared type annotation expressions need to be be evaluated + // in context so they have the appropriate flags set. Most of these cases + // will have been detected above when calling getParentAnnotationNode, + // but TypeAlias expressions are not handled there. + nodeToEvaluate = parent; + continue; } if (!isExpressionNode(parent)) { @@ -17493,7 +19400,11 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions const declaredReturnType = enclosingFunctionNode ? getFunctionDeclaredReturnType(enclosingFunctionNode) : undefined; - getTypeOfExpression(parent.returnExpression, EvaluatorFlags.None, declaredReturnType); + getTypeOfExpression( + parent.returnExpression, + EvaluatorFlags.None, + makeInferenceContext(declaredReturnType) + ); return; } break; @@ -17553,7 +19464,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions adjustParameterAnnotatedType(param, annotatedType) ); - writeTypeCache(node.name!, adjType, EvaluatorFlags.None, /* isIncomplete */ false); + writeTypeCache(node.name!, { type: adjType }, EvaluatorFlags.None); return; } @@ -17571,7 +19482,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions ); if (paramType) { - writeTypeCache(node.name!, paramType, EvaluatorFlags.None, /* isIncomplete */ false); + writeTypeCache(node.name!, { type: paramType }, EvaluatorFlags.None); return; } } @@ -17584,9 +19495,8 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions writeTypeCache( node.name!, - transformVariadicParamType(node, node.category, inferredParamType ?? UnknownType.create()), - EvaluatorFlags.None, - /* isIncomplete */ false + { type: transformVariadicParamType(node, node.category, inferredParamType ?? UnknownType.create()) }, + EvaluatorFlags.None ); } @@ -17718,38 +19628,17 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // within that tree. If the type cannot be determined (because it's part // of a cyclical dependency), the function returns undefined. function evaluateTypeForSubnode(subnode: ParseNode, callback: () => void): TypeResult | undefined { - // If the type cache is already populated, don't bother - // doing additional work. - let subnodeType = readTypeCache(subnode, /* flags */ undefined); - if (subnodeType) { - return { type: subnodeType }; + // If the type cache is already populated with a complete type, + // don't bother doing additional work. + let cacheEntry = readTypeCacheEntry(subnode); + if (cacheEntry && !cacheEntry.typeResult.isIncomplete) { + return cacheEntry.typeResult; } - const oldIncompleteCache = incompleteTypeCache; - try { - // If there isn't already an incompleteTypeCache allocated, allocate - // one now. We'll use this same cache for nested calls, but we'll - // abandon it once the last nested call completes. - if (!incompleteTypeCache) { - incompleteTypeCache = new Map(); - } - callback(); - subnodeType = readTypeCache(subnode, /* flags */ undefined); - if (subnodeType) { - return { type: subnodeType }; - } - - subnodeType = incompleteTypeCache.get(subnode.id) as Type | undefined; - if (subnodeType) { - return { type: subnodeType, isIncomplete: true }; - } - - incompleteTypeCache = oldIncompleteCache; - } catch (e) { - // We don't use a finally clause here because the debugger doesn't - // handle it well when stepping through code. - incompleteTypeCache = oldIncompleteCache; - throw e; + callback(); + cacheEntry = readTypeCacheEntry(subnode); + if (cacheEntry) { + return cacheEntry.typeResult; } return undefined; @@ -17769,24 +19658,26 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // Attempts to determine the type of the reference expression at the // point in the code. If the code flow analysis has nothing to say - // about that expression, it return undefined. Normally flow analysis - // starts from the reference node, but startNode can be specified to - // override this in a few special cases (functions and lambdas) to - // support analysis of captured variables. + // about that expression, it returns un undefined type. Normally + // flow analysis starts from the reference node, but startNode can be + // specified to override this in a few special cases (functions and + // lambdas) to support analysis of captured variables. function getFlowTypeOfReference( reference: CodeFlowReferenceExpressionNode, targetSymbolId: number, - initialType: Type | undefined, - isInitialTypeIncomplete: boolean, + typeAtStart: Type, startNode?: FunctionNode | LambdaNode, - ignoreNoReturn = false + options?: FlowNodeTypeOptions ): FlowNodeTypeResult { // See if this execution scope requires code flow for this reference expression. const referenceKey = createKeyForReference(reference); const executionNode = ParseTreeUtils.getExecutionScopeNode(startNode?.parent ?? reference); const codeFlowExpressions = AnalyzerNodeInfo.getCodeFlowExpressions(executionNode); - if (!codeFlowExpressions || !codeFlowExpressions.has(referenceKey)) { + if ( + !codeFlowExpressions || + (!codeFlowExpressions.has(referenceKey) && !codeFlowExpressions.has(wildcardImportReferenceKey)) + ) { return { type: undefined, isIncomplete: false }; } @@ -17812,14 +19703,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions return { type: undefined, isIncomplete: false }; } - return analyzer.getTypeFromCodeFlow( - flowNode!, - reference, - targetSymbolId, - initialType, - isInitialTypeIncomplete, - ignoreNoReturn - ); + return analyzer.getTypeFromCodeFlow(flowNode!, reference, targetSymbolId, typeAtStart, options); } // Specializes the specified (potentially generic) class type using @@ -17831,14 +19715,14 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions typeArgs: TypeResultWithNode[] | undefined, flags: EvaluatorFlags, errorNode: ParseNode - ): Type { + ): TypeResult { // Handle the special-case classes that are not defined // in the type stubs. if (ClassType.isSpecialBuiltIn(classType)) { const aliasedName = classType.aliasName || classType.details.name; switch (aliasedName) { case 'Callable': { - return createCallableType(typeArgs, errorNode); + return { type: createCallableType(typeArgs, errorNode) }; } case 'Never': { @@ -17848,7 +19732,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions typeArgs[0].node ); } - return NeverType.createNever(); + return { type: NeverType.createNever() }; } case 'NoReturn': { @@ -17858,11 +19742,11 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions typeArgs[0].node ); } - return NeverType.createNoReturn(); + return { type: NeverType.createNoReturn() }; } case 'Optional': { - return createOptionalType(classType, errorNode, typeArgs, flags); + return { type: createOptionalType(classType, errorNode, typeArgs, flags) }; } case 'Type': { @@ -17874,43 +19758,45 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions typeClassType && isInstantiableClass(typeClassType) ) { - return typeClassType; + return { type: typeClassType }; } let typeType = createSpecialType(classType, typeArgs, 1); if (isInstantiableClass(typeType)) { typeType = explodeGenericClass(typeType); } - return typeType; + return { type: typeType }; } case 'ClassVar': { - return createClassVarType(classType, errorNode, typeArgs, flags); + return { type: createClassVarType(classType, errorNode, typeArgs, flags) }; } case 'Protocol': { - return createSpecialType( - classType, - typeArgs, - /* paramLimit */ undefined, - /* allowParamSpec */ true - ); + return { + type: createSpecialType( + classType, + typeArgs, + /* paramLimit */ undefined, + /* allowParamSpec */ true + ), + }; } case 'Tuple': { - return createSpecialType(classType, typeArgs, /* paramLimit */ undefined); + return { type: createSpecialType(classType, typeArgs, /* paramLimit */ undefined) }; } case 'Union': { - return createUnionType(classType, errorNode, typeArgs, flags); + return { type: createUnionType(classType, errorNode, typeArgs, flags) }; } case 'Generic': { - return createGenericType(classType, errorNode, typeArgs, flags); + return { type: createGenericType(classType, errorNode, typeArgs, flags) }; } case 'Final': { - return createFinalType(classType, errorNode, typeArgs, flags); + return { type: createFinalType(classType, errorNode, typeArgs, flags) }; } case 'Annotated': { @@ -17918,16 +19804,16 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } case 'Concatenate': { - return createConcatenateType(errorNode, classType, typeArgs); + return { type: createConcatenateType(errorNode, classType, typeArgs) }; } case 'TypeGuard': case 'StrictTypeGuard': { - return createTypeGuardType(errorNode, classType, typeArgs, flags); + return { type: createTypeGuardType(errorNode, classType, typeArgs, flags) }; } case 'Unpack': { - return createUnpackType(classType, errorNode, typeArgs, flags); + return { type: createUnpackType(classType, errorNode, typeArgs, flags) }; } case 'Required': @@ -17936,11 +19822,11 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } case 'Self': { - return createSelfType(classType, errorNode, typeArgs); + return { type: createSelfType(classType, errorNode, typeArgs) }; } case 'LiteralString': { - return createSpecialType(classType, typeArgs, 0); + return { type: createSpecialType(classType, typeArgs, 0) }; } } } @@ -17958,7 +19844,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // PEP 484 says that type[Any] should be considered // equivalent to type. if (typeArgs.length === 1 && isAnyOrUnknown(typeArgs[0].type)) { - return classType; + return { type: classType }; } const typeClass = getTypingType(errorNode, 'Type'); @@ -17975,20 +19861,22 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions typeType = explodeGenericClass(typeType); } - return typeType; + return { type: typeType }; } } // Handle "tuple" specially, since it needs to act like "Tuple" // in Python 3.9 and newer. if (isTupleClass(classType)) { - return createSpecialType( - classType, - typeArgs, - /* paramLimit */ undefined, - /* allowParamSpec */ undefined, - /* isCallable */ true - ); + return { + type: createSpecialType( + classType, + typeArgs, + /* paramLimit */ undefined, + /* allowParamSpec */ undefined, + /* isCallable */ true + ), + }; } } @@ -18000,13 +19888,36 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // If there are no type parameters or args, the class is already specialized. // No need to do any more work. if (typeParameters.length === 0 && typeArgCount === 0) { - return classType; + return { type: classType }; } const variadicTypeParamIndex = typeParameters.findIndex((param) => isVariadicTypeVar(param)); if (typeArgs) { - if (typeArgCount > typeParameters.length) { + let minTypeArgCount = typeParameters.length; + const firstNonDefaultParam = typeParameters.findIndex((param) => !!param.details.defaultType); + + if (firstNonDefaultParam >= 0) { + minTypeArgCount = firstNonDefaultParam; + } + + // Classes that accept inlined type dict type args allow only one. + if (typeArgs[0].inlinedTypeDict) { + if (typeArgs.length > 1) { + addDiagnostic( + fileInfo.diagnosticRuleSet.reportGeneralTypeIssues, + DiagnosticRule.reportGeneralTypeIssues, + Localizer.Diagnostic.typeArgsTooMany().format({ + name: classType.aliasName || classType.details.name, + expected: 1, + received: typeArgCount, + }), + typeArgs[1].node + ); + } + + return { type: typeArgs[0].inlinedTypeDict }; + } else if (typeArgCount > typeParameters.length) { if (!ClassType.isPartiallyEvaluated(classType) && !ClassType.isTupleClass(classType)) { const fileInfo = AnalyzerNodeInfo.getFileInfo(errorNode); if (typeParameters.length === 0) { @@ -18030,16 +19941,17 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions typeArgs[typeParameters.length].node ); } + + typeArgCount = typeParameters.length; } - typeArgCount = typeParameters.length; - } else if (typeArgCount < typeParameters.length) { + } else if (typeArgCount < minTypeArgCount) { const fileInfo = AnalyzerNodeInfo.getFileInfo(errorNode); addDiagnostic( fileInfo.diagnosticRuleSet.reportGeneralTypeIssues, DiagnosticRule.reportGeneralTypeIssues, Localizer.Diagnostic.typeArgsTooFew().format({ name: classType.aliasName || classType.details.name, - expected: typeParameters.length, + expected: minTypeArgCount, received: typeArgCount, }), typeArgs.length > 0 ? typeArgs[0].node.parent! : errorNode @@ -18111,17 +20023,20 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } } + const typeVarContext = new TypeVarContext(classType.details.typeVarScopeId); + fullTypeParams.forEach((typeParam, index) => { if (typeArgs && index < typeArgs.length) { if (typeParam.details.isParamSpec) { const typeArg = typeArgs[index]; - const functionType = FunctionType.createInstantiable(FunctionTypeFlags.ParamSpecValue); + const functionType = FunctionType.createSynthesizedInstance('', FunctionTypeFlags.ParamSpecValue); TypeBase.setSpecialForm(functionType); if (isEllipsisType(typeArg.type)) { FunctionType.addDefaultParameters(functionType); functionType.details.flags |= FunctionTypeFlags.SkipArgsKwargsCompatibilityCheck; typeArgTypes.push(functionType); + typeVarContext.setTypeVarType(typeParam, convertTypeToParamSpecValue(functionType)); return; } @@ -18136,6 +20051,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions }); }); typeArgTypes.push(functionType); + typeVarContext.setTypeVarType(typeParam, convertTypeToParamSpecValue(functionType)); return; } @@ -18164,17 +20080,41 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } } - typeArgTypes.push(convertToInstance(typeArgs[index].type)); + const typeArgType = convertToInstance(typeArgs[index].type); + typeArgTypes.push(typeArgType); + typeVarContext.setTypeVarType(typeParam, typeArgType); return; } - typeArgTypes.push(UnknownType.create()); + const solvedDefaultType = applySolvedTypeVars(typeParam, typeVarContext, { unknownIfNotFound: true }); + typeArgTypes.push(solvedDefaultType); + if (isParamSpec(typeParam)) { + typeVarContext.setTypeVarType(typeParam, convertTypeToParamSpecValue(solvedDefaultType)); + } else { + typeVarContext.setTypeVarType(typeParam, solvedDefaultType); + } }); typeArgTypes = typeArgTypes.map((typeArgType, index) => { if (index < typeArgCount) { const diag = new DiagnosticAddendum(); - const adjustedTypeArgType = applyTypeArgToTypeVar(typeParameters[index], typeArgType, diag); + let adjustedTypeArgType = applyTypeArgToTypeVar(typeParameters[index], typeArgType, diag); + + // Determine if the variance must match. + if (adjustedTypeArgType && (flags & EvaluatorFlags.EnforceTypeVarVarianceConsistency) !== 0) { + const destType = typeParameters[index]; + const declaredVariance = destType.details.declaredVariance; + + if (!isVarianceOfTypeArgumentCompatible(adjustedTypeArgType, declaredVariance)) { + diag.addMessage( + Localizer.DiagnosticAddendum.varianceMismatchForClass().format({ + typeVarName: printType(adjustedTypeArgType), + className: classType.details.name, + }) + ); + adjustedTypeArgType = undefined; + } + } if (adjustedTypeArgType) { typeArgType = adjustedTypeArgType; @@ -18198,9 +20138,16 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions return typeArgType; }); + // If the class is partially constructed and doesn't yet have + // type parameters, assume that the number and types of supplied type + // arguments are correct. + if (typeArgs && classType.details.typeParameters.length === 0 && ClassType.isPartiallyEvaluated(classType)) { + typeArgTypes = typeArgs.map((t) => convertToInstance(t.type)); + } + const specializedClass = ClassType.cloneForSpecialization(classType, typeArgTypes, typeArgs !== undefined); - return specializedClass; + return { type: specializedClass }; } function getTypeOfArgument(arg: FunctionArgument): TypeResult { @@ -18232,17 +20179,9 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions return getTypeOfExpressionExpectingType(arg.valueExpression!); } - function getTypeOfExpressionExpectingType( - node: ExpressionNode, - allowFinal = false, - allowRequired = false - ): TypeResult { + function getTypeOfExpressionExpectingType(node: ExpressionNode, options?: ExpectedTypeOptions): TypeResult { let flags = - EvaluatorFlags.ExpectingType | - EvaluatorFlags.EvaluateStringLiteralAsType | - EvaluatorFlags.ParamSpecDisallowed | - EvaluatorFlags.TypeVarTupleDisallowed | - EvaluatorFlags.ClassVarDisallowed; + EvaluatorFlags.ExpectingType | EvaluatorFlags.EvaluateStringLiteralAsType | EvaluatorFlags.DisallowClassVar; const fileInfo = AnalyzerNodeInfo.getFileInfo(node); if (fileInfo.isStubFile) { @@ -18251,12 +20190,22 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions flags |= EvaluatorFlags.InterpreterParsesStringLiteral; } - if (!allowFinal) { - flags |= EvaluatorFlags.FinalDisallowed; + if (!options?.allowFinal) { + flags |= EvaluatorFlags.DisallowFinal; + } + + if (options?.allowRequired) { + flags |= EvaluatorFlags.AllowRequired | EvaluatorFlags.ExpectingTypeAnnotation; + } + + if (options?.allowUnpackedTuple) { + flags |= EvaluatorFlags.AllowUnpackedTupleOrTypeVarTuple; + } else { + flags |= EvaluatorFlags.DisallowTypeVarTuple; } - if (allowRequired) { - flags |= EvaluatorFlags.RequiredAllowed; + if (!options?.allowParamSpec) { + flags |= EvaluatorFlags.DisallowParamSpec; } return getTypeOfExpression(node, flags); @@ -18310,7 +20259,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions if (symbolWithScope && honorCodeFlow && scopeTypeHonorsCodeFlow) { // Filter the declarations based on flow reachability. - const reachableDecls = symbolWithScope.symbol.getDeclarations().filter((decl) => { + const reachableDecl = symbolWithScope.symbol.getDeclarations().find((decl) => { if (decl.type !== DeclarationType.Alias && decl.type !== DeclarationType.Intrinsic) { // Is the declaration in the same execution scope as the "usageNode" node? const usageScope = ParseTreeUtils.getExecutionScopeNode(node); @@ -18343,7 +20292,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // If none of the declarations are reachable from the current node, // search for the symbol in outer scopes. - if (reachableDecls.length === 0) { + if (!reachableDecl) { if (symbolWithScope.scope.type !== ScopeType.Function) { let nextScopeToSearch = symbolWithScope.scope.parent; const isOutsideCallerModule = @@ -18507,6 +20456,18 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions return declarations.length === 0 ? undefined : declarations; } + function getAliasFromImport(node: NameNode): NameNode | undefined { + if ( + node.parent && + node.parent.nodeType === ParseNodeType.ImportFromAs && + node.parent.alias && + node === node.parent.name + ) { + return node.parent.alias; + } + return undefined; + } + function getDeclarationsForNameNode(node: NameNode, skipUnreachableCode = true): Declaration[] | undefined { if (skipUnreachableCode && AnalyzerNodeInfo.isCodeUnreachable(node)) { return undefined; @@ -18517,16 +20478,12 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // If the node is part of a "from X import Y as Z" statement and the node // is the "Y" (non-aliased) name, we need to look up the alias symbol // since the non-aliased name is not in the symbol table. - if ( - node.parent && - node.parent.nodeType === ParseNodeType.ImportFromAs && - node.parent.alias && - node === node.parent.name - ) { + const alias = getAliasFromImport(node); + if (alias) { const scope = ScopeUtils.getScopeForNode(node); if (scope) { // Look up the alias symbol. - const symbolInScope = scope.lookUpSymbolRecursive(node.parent.alias.value); + const symbolInScope = scope.lookUpSymbolRecursive(alias.value); if (symbolInScope) { // The alias could have more decls that don't refer to this import. Filter // out the one(s) that specifically associated with this import statement. @@ -18649,7 +20606,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions const paramDecl = getDeclarationFromFunctionNamedParameter(initMethodType, paramName); if (paramDecl) { declarations.push(paramDecl); - } else if (ClassType.isDataClass(baseType)) { + } else if (ClassType.isDataClass(baseType) || ClassType.isTypedDictClass(baseType)) { const lookupResults = lookUpClassMember(baseType, paramName); if (lookupResults) { appendArray(declarations, lookupResults.symbol.getDeclarations()); @@ -18692,80 +20649,84 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions return declarations; } - function getTypeForDeclaration(declaration: Declaration): Type | undefined { + function getTypeForDeclaration(declaration: Declaration): DeclaredSymbolTypeInfo { switch (declaration.type) { case DeclarationType.Intrinsic: { if (declaration.intrinsicType === 'Any') { - return AnyType.create(); + return { type: AnyType.create() }; } if (declaration.intrinsicType === 'class') { const classNode = ParseTreeUtils.getEnclosingClass(declaration.node) as ClassNode; const classTypeInfo = getTypeOfClass(classNode); - return classTypeInfo?.classType; + return { type: classTypeInfo?.classType }; } const strType = getBuiltInObject(declaration.node, 'str'); const intType = getBuiltInObject(declaration.node, 'int'); if (isClassInstance(intType) && isClassInstance(strType)) { if (declaration.intrinsicType === 'str') { - return strType; + return { type: strType }; } if (declaration.intrinsicType === 'str | None') { - return combineTypes([strType, NoneType.createInstance()]); + return { type: combineTypes([strType, NoneType.createInstance()]) }; } if (declaration.intrinsicType === 'int') { - return intType; + return { type: intType }; } if (declaration.intrinsicType === 'Iterable[str]') { const iterableType = getBuiltInType(declaration.node, 'Iterable'); if (isInstantiableClass(iterableType)) { - return ClassType.cloneAsInstance( - ClassType.cloneForSpecialization( - iterableType, - [strType], - /* isTypeArgumentExplicit */ true - ) - ); + return { + type: ClassType.cloneAsInstance( + ClassType.cloneForSpecialization( + iterableType, + [strType], + /* isTypeArgumentExplicit */ true + ) + ), + }; } } if (declaration.intrinsicType === 'Dict[str, Any]') { const dictType = getBuiltInType(declaration.node, 'dict'); if (isInstantiableClass(dictType)) { - return ClassType.cloneAsInstance( - ClassType.cloneForSpecialization( - dictType, - [strType, AnyType.create()], - /* isTypeArgumentExplicit */ true - ) - ); + return { + type: ClassType.cloneAsInstance( + ClassType.cloneForSpecialization( + dictType, + [strType, AnyType.create()], + /* isTypeArgumentExplicit */ true + ) + ), + }; } } } - return UnknownType.create(); + return { type: UnknownType.create() }; } case DeclarationType.Class: { const classTypeInfo = getTypeOfClass(declaration.node); - return classTypeInfo?.decoratedType; + return { type: classTypeInfo?.decoratedType }; } case DeclarationType.SpecialBuiltInClass: { - return getTypeOfAnnotation(declaration.node.typeAnnotation); + return { type: getTypeOfAnnotation(declaration.node.typeAnnotation) }; } case DeclarationType.Function: { const functionTypeInfo = getTypeOfFunction(declaration.node); - return functionTypeInfo?.decoratedType; + return { type: functionTypeInfo?.decoratedType }; } case DeclarationType.TypeAlias: { - return getTypeOfTypeAlias(declaration.node); + return { type: getTypeOfTypeAlias(declaration.node) }; } case DeclarationType.Parameter: { @@ -18790,105 +20751,34 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions if (typeAnnotationNode) { const declaredType = getTypeOfParameterAnnotation(typeAnnotationNode, declaration.node.category); - return transformVariadicParamType( - declaration.node, - declaration.node.category, - adjustParameterAnnotatedType(declaration.node, declaredType) - ); + return { + type: transformVariadicParamType( + declaration.node, + declaration.node.category, + adjustParameterAnnotatedType(declaration.node, declaredType) + ), + }; } - return undefined; + return { type: undefined }; } case DeclarationType.TypeParameter: { - let typeVar = TypeVarType.createInstantiable(declaration.node.name.value); - if (declaration.node.typeParamCategory === TypeParameterCategory.TypeVarTuple) { - typeVar.details.isVariadic = true; - } else if (declaration.node.typeParamCategory === TypeParameterCategory.ParamSpec) { - typeVar.details.isParamSpec = true; - } - - if (declaration.node.boundExpression) { - if (declaration.node.boundExpression.nodeType === ParseNodeType.Tuple) { - const constraints = declaration.node.boundExpression.expressions.map((constraint) => { - const constraintType = getTypeOfExpressionExpectingType(constraint).type; - - if (requiresSpecialization(constraintType, /* ignorePseudoGeneric */ true)) { - addError(Localizer.Diagnostic.typeVarGeneric(), constraint); - } - - return convertToInstance(constraintType); - }); - - if (constraints.length < 2) { - addDiagnostic( - AnalyzerNodeInfo.getFileInfo(declaration.node.boundExpression).diagnosticRuleSet - .reportGeneralTypeIssues, - DiagnosticRule.reportGeneralTypeIssues, - Localizer.Diagnostic.typeVarSingleConstraint(), - declaration.node.boundExpression - ); - } else if (declaration.node.typeParamCategory === TypeParameterCategory.TypeVar) { - typeVar.details.constraints = constraints; - } - } else { - const boundType = getTypeOfExpressionExpectingType(declaration.node.boundExpression).type; - - if (requiresSpecialization(boundType, /* ignorePseudoGeneric */ true)) { - addError(Localizer.Diagnostic.typeVarGeneric(), declaration.node.boundExpression); - } - - if (declaration.node.typeParamCategory === TypeParameterCategory.TypeVar) { - typeVar.details.boundType = convertToInstance(boundType); - } - } - } - - typeVar.details.isTypeParamSyntax = true; - - // Associate the type variable with the owning scope. - const scopeNode = ParseTreeUtils.getTypeVarScopeNode(declaration.node); - if (scopeNode) { - let scopeType: TypeVarScopeType; - if (scopeNode.nodeType === ParseNodeType.Class) { - scopeType = TypeVarScopeType.Class; - - // Set the variance to "auto" for class-scoped TypeVars. - typeVar.details.declaredVariance = Variance.Auto; - } else if (scopeNode.nodeType === ParseNodeType.Function) { - scopeType = TypeVarScopeType.Function; - } else { - assert(scopeNode.nodeType === ParseNodeType.TypeAlias); - scopeType = TypeVarScopeType.TypeAlias; - } - - typeVar = TypeVarType.cloneForScopeId( - typeVar, - getScopeIdForNode(scopeNode.nodeType === ParseNodeType.TypeAlias ? scopeNode.name : scopeNode), - scopeNode.name.value, - scopeType - ); - } - - return typeVar; + return { type: getTypeOfTypeParameter(declaration.node) }; } case DeclarationType.Variable: { const typeAnnotationNode = declaration.typeAnnotationNode; if (typeAnnotationNode) { - const typeAliasNode = isDeclaredTypeAlias(typeAnnotationNode) - ? ParseTreeUtils.getTypeAnnotationNode(typeAnnotationNode) - : undefined; - let declaredType: Type; + let declaredType: Type | undefined; if (declaration.isRuntimeTypeExpression) { declaredType = convertToInstance( - getTypeOfExpressionExpectingType( - typeAnnotationNode, - /* allowFinal */ true, - /* allowRequired */ true - ).type + getTypeOfExpressionExpectingType(typeAnnotationNode, { + allowFinal: true, + allowRequired: true, + }).type ); } else { const declNode = @@ -18900,6 +20790,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions isVariableAnnotation: true, allowClassVar: ParseTreeUtils.isClassVarAllowedForAssignmentTarget(declNode), allowFinal: ParseTreeUtils.isFinalAllowedForAssignmentTarget(declNode), + allowRequired: ParseTreeUtils.isRequiredAllowedForAssignmentTarget(declNode), }); } @@ -18910,29 +20801,149 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions transformTypeForPossibleEnumClass( evaluatorInterface, declaration.node, - () => declaredType - ) || declaredType; + () => declaredType! + ) ?? declaredType; } - if (typeAliasNode && typeAliasNode.valueExpression.nodeType === ParseNodeType.Name) { - declaredType = transformTypeForTypeAlias( - declaredType, - typeAliasNode.valueExpression, - declaration.node - ); + if (isClassInstance(declaredType) && ClassType.isBuiltIn(declaredType, 'TypeAlias')) { + return { type: undefined, isTypeAlias: true }; } - return declaredType; + return { type: declaredType }; } } - return undefined; + return { type: undefined }; } case DeclarationType.Alias: { - return undefined; + return { type: undefined }; + } + } + } + + function getTypeOfTypeParameter(node: TypeParameterNode): TypeVarType { + // Is this type already cached? + const cachedTypeVarType = readTypeCache(node.name, EvaluatorFlags.None) as FunctionType; + if (cachedTypeVarType && isTypeVar(cachedTypeVarType)) { + return cachedTypeVarType; + } + + let typeVar = TypeVarType.createInstantiable(node.name.value); + typeVar.details.isTypeParamSyntax = true; + + if (node.typeParamCategory === TypeParameterCategory.TypeVarTuple) { + typeVar.details.isVariadic = true; + } else if (node.typeParamCategory === TypeParameterCategory.ParamSpec) { + typeVar.details.isParamSpec = true; + } + + // Cache the value before we evaluate the bound or the default type in + // case it refers to itself in a circular manner. + writeTypeCache(node, { type: typeVar }, /* flags */ undefined); + writeTypeCache(node.name, { type: typeVar }, /* flags */ undefined); + + if (node.boundExpression) { + if (node.boundExpression.nodeType === ParseNodeType.Tuple) { + const constraints = node.boundExpression.expressions.map((constraint) => { + const constraintType = getTypeOfExpressionExpectingType(constraint).type; + + if (requiresSpecialization(constraintType, /* ignorePseudoGeneric */ true)) { + addError(Localizer.Diagnostic.typeVarBoundGeneric(), constraint); + } + + return convertToInstance(constraintType); + }); + + if (constraints.length < 2) { + addDiagnostic( + AnalyzerNodeInfo.getFileInfo(node.boundExpression).diagnosticRuleSet.reportGeneralTypeIssues, + DiagnosticRule.reportGeneralTypeIssues, + Localizer.Diagnostic.typeVarSingleConstraint(), + node.boundExpression + ); + } else if (node.typeParamCategory === TypeParameterCategory.TypeVar) { + typeVar.details.constraints = constraints; + } + } else { + const boundType = getTypeOfExpressionExpectingType(node.boundExpression).type; + + if (requiresSpecialization(boundType, /* ignorePseudoGeneric */ true)) { + addError(Localizer.Diagnostic.typeVarConstraintGeneric(), node.boundExpression); + } + + if (node.typeParamCategory === TypeParameterCategory.TypeVar) { + typeVar.details.boundType = convertToInstance(boundType); + } + } + } + + if (node.defaultExpression) { + if (node.typeParamCategory === TypeParameterCategory.ParamSpec) { + typeVar.details.defaultType = getParamSpecDefaultType(node.defaultExpression); + } else if (node.typeParamCategory === TypeParameterCategory.TypeVarTuple) { + typeVar.details.defaultType = getTypeVarTupleDefaultType(node.defaultExpression); + } else { + typeVar.details.defaultType = convertToInstance( + getTypeOfExpressionExpectingType(node.defaultExpression).type + ); + } + } + + // If a default is provided, make sure it is compatible with the bound + // or constraint. + if (typeVar.details.defaultType && node.defaultExpression) { + const typeVarContext = new TypeVarContext(WildcardTypeVarScopeId); + const concreteDefaultType = applySolvedTypeVars(typeVar.details.defaultType, typeVarContext, { + unknownIfNotFound: true, + }); + + if (typeVar.details.boundType) { + if (!assignType(typeVar.details.boundType, concreteDefaultType)) { + addDiagnostic( + AnalyzerNodeInfo.getFileInfo(node).diagnosticRuleSet.reportGeneralTypeIssues, + DiagnosticRule.reportGeneralTypeIssues, + Localizer.Diagnostic.typeVarDefaultBoundMismatch(), + node.defaultExpression + ); + } + } else if (typeVar.details.constraints.length > 0) { + if (!typeVar.details.constraints.some((constraint) => isTypeSame(constraint, concreteDefaultType))) { + addDiagnostic( + AnalyzerNodeInfo.getFileInfo(node).diagnosticRuleSet.reportGeneralTypeIssues, + DiagnosticRule.reportGeneralTypeIssues, + Localizer.Diagnostic.typeVarDefaultConstraintMismatch(), + node.defaultExpression + ); + } + } + } + + // Associate the type variable with the owning scope. + const scopeNode = ParseTreeUtils.getTypeVarScopeNode(node); + if (scopeNode) { + let scopeType: TypeVarScopeType; + if (scopeNode.nodeType === ParseNodeType.Class) { + scopeType = TypeVarScopeType.Class; + + // Set the variance to "auto" for class-scoped TypeVars. + typeVar.details.declaredVariance = Variance.Auto; + } else if (scopeNode.nodeType === ParseNodeType.Function) { + scopeType = TypeVarScopeType.Function; + } else { + assert(scopeNode.nodeType === ParseNodeType.TypeAlias); + scopeType = TypeVarScopeType.TypeAlias; } + + typeVar = TypeVarType.cloneForScopeId( + typeVar, + getScopeIdForNode(scopeNode.nodeType === ParseNodeType.TypeAlias ? scopeNode.name : scopeNode), + scopeNode.name.value, + scopeType + ); } + + return typeVar; } function getInferredTypeOfDeclaration(symbol: Symbol, decl: Declaration): Type | undefined { @@ -18959,7 +20970,12 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions moduleType.fields = lookupResults.symbolTable; moduleType.docString = lookupResults.docString; } else { - return evaluatorOptions.evaluateUnknownImportsAsAny ? AnyType.create() : UnknownType.create(); + // Note that all module attributes that are not found in the + // symbol table should be treated as Any or Unknown rather than + // as an error. + moduleType.notPresentFieldType = evaluatorOptions.evaluateUnknownImportsAsAny + ? AnyType.create() + : UnknownType.create(); } } @@ -19020,8 +21036,8 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } const declaredType = getTypeForDeclaration(resolvedDecl); - if (declaredType) { - return declaredType; + if (declaredType.type) { + return declaredType.type; } // If this is part of a "py.typed" package, don't fall back on type inference @@ -19044,9 +21060,37 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } } - if (resolvedDecl.isFinal || resolvedDecl.isConstant) { + // Special-case constants, which are treated as unambiguous. + if (isFinalVariableDeclaration(resolvedDecl) || resolvedDecl.isConstant) { isUnambiguousType = true; } + + // Special-case calls to certain built-in type functions. + if (resolvedDecl.inferredTypeSource?.nodeType === ParseNodeType.Call) { + const baseTypeResult = getTypeOfExpression( + resolvedDecl.inferredTypeSource.leftExpression, + EvaluatorFlags.DoNotSpecialize + ); + const callType = baseTypeResult.type; + + const exemptBuiltins = [ + 'TypeVar', + 'ParamSpec', + 'TypeVarTuple', + 'TypedDict', + 'NamedTuple', + 'NewType', + ]; + + if (isInstantiableClass(callType) && ClassType.isBuiltIn(callType, exemptBuiltins)) { + isUnambiguousType = true; + } else if ( + isFunction(callType) && + exemptBuiltins.some((name) => callType.details.builtInName === name) + ) { + isUnambiguousType = true; + } + } } } @@ -19059,10 +21103,13 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } if (resolvedDecl.type === DeclarationType.Variable && resolvedDecl.inferredTypeSource) { + const isTypeAlias = + isExplicitTypeAliasDeclaration(resolvedDecl) || isPossibleTypeAliasOrTypedDict(resolvedDecl); + // If this is a type alias, evaluate types for the entire assignment // statement rather than just the RHS of the assignment. const typeSource = - resolvedDecl.typeAliasName && resolvedDecl.inferredTypeSource.parent + isTypeAlias && resolvedDecl.inferredTypeSource.parent ? resolvedDecl.inferredTypeSource.parent : resolvedDecl.inferredTypeSource; let inferredType = evaluateTypeForSubnode(resolvedDecl.node, () => { @@ -19083,7 +21130,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } } - if (inferredType && resolvedDecl.typeAliasName) { + if (inferredType && isTypeAlias && resolvedDecl.typeAliasName) { // If this was a speculative type alias, it becomes a real type alias only // in the event that its inferred type is instantiable or explicitly Any // (but not an ellipsis). @@ -19195,25 +21242,16 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions resolveLocalNames: boolean, allowExternallyHiddenAccess = false ): Declaration | undefined { - return DeclarationUtils.resolveAliasDeclaration( - importLookup, - declaration, - resolveLocalNames, - allowExternallyHiddenAccess - )?.declaration; + return resolveAliasDeclarationUtil(importLookup, declaration, resolveLocalNames, allowExternallyHiddenAccess) + ?.declaration; } function resolveAliasDeclarationWithInfo( declaration: Declaration, resolveLocalNames: boolean, allowExternallyHiddenAccess = false - ): DeclarationUtils.ResolvedAliasInfo | undefined { - return DeclarationUtils.resolveAliasDeclaration( - importLookup, - declaration, - resolveLocalNames, - allowExternallyHiddenAccess - ); + ): ResolvedAliasInfo | undefined { + return resolveAliasDeclarationUtil(importLookup, declaration, resolveLocalNames, allowExternallyHiddenAccess); } // Returns the type of the symbol. If the type is explicitly declared, that type @@ -19231,47 +21269,60 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions usageNode?: NameNode, useLastDecl = false ): EffectiveTypeResult { + let declaredTypeInfo: DeclaredSymbolTypeInfo | undefined; + // If there's a declared type, it takes precedence over inferred types. if (symbol.hasTypedDeclarations()) { - const declaredType = getDeclaredTypeOfSymbol(symbol, usageNode); - const typedDecls = symbol.getTypedDeclarations(); - let isIncomplete = false; + declaredTypeInfo = getDeclaredTypeOfSymbol(symbol, usageNode); - if (declaredType) { - if (isFunction(declaredType) && FunctionType.isPartiallyEvaluated(declaredType)) { - isIncomplete = true; - } else if (isClass(declaredType) && ClassType.isPartiallyEvaluated(declaredType)) { - isIncomplete = true; + const declaredType = declaredTypeInfo?.type; + const hasMetadata = !!declaredTypeInfo.isTypeAlias; + + if (declaredType || !hasMetadata) { + let isIncomplete = false; + + if (declaredType) { + if (isFunction(declaredType) && FunctionType.isPartiallyEvaluated(declaredType)) { + isIncomplete = true; + } else if (isClass(declaredType) && ClassType.isPartiallyEvaluated(declaredType)) { + isIncomplete = true; + } } - } - return { - type: declaredType ?? UnknownType.create(), - isIncomplete, - includesVariableDecl: typedDecls.some((decl) => decl.type === DeclarationType.Variable), - includesIllegalTypeAliasDecl: !typedDecls.every((decl) => isPossibleTypeAliasDeclaration(decl)), - isRecursiveDefinition: !declaredType, - }; + const typedDecls = symbol.getTypedDeclarations(); + const result: EffectiveTypeResult = { + type: declaredType ?? UnknownType.create(), + isIncomplete, + includesVariableDecl: typedDecls.some((decl) => decl.type === DeclarationType.Variable), + includesIllegalTypeAliasDecl: !typedDecls.every((decl) => isPossibleTypeAliasDeclaration(decl)), + isRecursiveDefinition: !declaredType, + }; + + return result; + } } - // Look in the cache to see if we've computed this already. + // Look in the inferred type cache to see if we've computed this already. let cacheEntries = effectiveTypeCache.get(symbol.id); const usageNodeId = usageNode ? usageNode.id : undefined; const effectiveTypeCacheKey = `${usageNodeId === undefined ? '.' : usageNodeId.toString()}${ useLastDecl ? '*' : '' }`; + if (cacheEntries) { const result = cacheEntries.get(effectiveTypeCacheKey); if (result) { - return result; + if (!result.isIncomplete) { + return result; + } } } // Infer the type. const typesToCombine: Type[] = []; const decls = symbol.getDeclarations(); - const isFinalVar = isFinalVariable(symbol); let isIncomplete = false; + let sawPendingEvaluation = false; let includesVariableDecl = false; let includesSpeculativeResult = false; @@ -19279,13 +21330,16 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // Limit the number of declarations to explore. if (decls.length > maxDeclarationsToUseForInference) { - return { + const result: EffectiveTypeResult = { type: UnknownType.create(), isIncomplete: false, includesVariableDecl: false, includesIllegalTypeAliasDecl: !decls.every((decl) => isPossibleTypeAliasDeclaration(decl)), isRecursiveDefinition: false, }; + + addToEffectiveTypeCache(result); + return result; } // If the caller has requested that we use only the last decl, we @@ -19297,6 +21351,18 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions declIndexToConsider = index; } }); + } else { + // Handle the case where there are multiple imports — one of them in + // a try block and one or more in except blocks. In this case, we'll + // use the one in the try block rather than the excepts. + if (decls.length > 1 && decls.every((decl) => decl.type === DeclarationType.Alias)) { + const nonExceptDecls = decls.filter( + (decl) => decl.type === DeclarationType.Alias && !decl.isInExceptSuite + ); + if (nonExceptDecls.length === 1) { + declIndexToConsider = decls.findIndex((decl) => decl === nonExceptDecls[0]); + } + } } let sawExplicitTypeAlias = false; @@ -19311,6 +21377,13 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions considerDecl = false; } + // If the symbol is explicitly marked as a ClassVar, consider only the + // declarations that assign to it from within the class body, not through + // a member access expression. + if (symbol.isClassVar() && decl.type === DeclarationType.Variable && decl.isDefinedByMemberAccess) { + considerDecl = false; + } + if (usageNode !== undefined) { if (decl.type !== DeclarationType.Alias) { // Is the declaration in the same execution scope as the "usageNode" node? @@ -19325,8 +21398,15 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } if (considerDecl) { + const resolvedDecl = + resolveAliasDeclaration( + decl, + /* resolveLocalNames */ true, + /* allowExternallyHiddenAccess */ AnalyzerNodeInfo.getFileInfo(decl.node).isStubFile + ) ?? decl; + const isExplicitTypeAlias = isExplicitTypeAliasDeclaration(decl); - const isTypeAlias = isExplicitTypeAlias || isPossibleTypeAliasDeclaration(decl); + const isTypeAlias = isExplicitTypeAlias || isPossibleTypeAliasOrTypedDict(decl); if (isExplicitTypeAlias) { sawExplicitTypeAlias = true; @@ -19336,19 +21416,10 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // resolution check so we can evaluate the full assignment statement. if ( isTypeAlias && - decl.type === DeclarationType.Variable && - decl.inferredTypeSource?.parent?.nodeType === ParseNodeType.Assignment + resolvedDecl.type === DeclarationType.Variable && + resolvedDecl.inferredTypeSource?.parent?.nodeType === ParseNodeType.Assignment ) { - evaluateTypesForAssignmentStatement(decl.inferredTypeSource.parent); - - if (decl.typeAliasAnnotation) { - // Mark "TypeAlias" declaration as accessed. - getTypeOfAnnotation(decl.typeAliasAnnotation, { - isVariableAnnotation: true, - allowFinal: ParseTreeUtils.isFinalAllowedForAssignmentTarget(decl.node), - allowClassVar: ParseTreeUtils.isClassVarAllowedForAssignmentTarget(decl.node), - }); - } + evaluateTypesForAssignmentStatement(resolvedDecl.inferredTypeSource.parent); } if (pushSymbolResolution(symbol, decl)) { @@ -19360,24 +21431,34 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } if (type) { - if (decl.type === DeclarationType.Variable) { - includesVariableDecl = true; + if (resolvedDecl.type === DeclarationType.Variable) { + // Exempt typing.pyi, which uses variables to define some + // special forms like Any. + const fileInfo = AnalyzerNodeInfo.getFileInfo(resolvedDecl.node); + if (!fileInfo.isTypingStubFile) { + includesVariableDecl = true; + } - let isConstant = decl.type === DeclarationType.Variable && !!decl.isConstant; + let isConstant = false; + if (resolvedDecl.type === DeclarationType.Variable) { + if (resolvedDecl.isConstant || isFinalVariableDeclaration(resolvedDecl)) { + isConstant = true; + } + } // Treat enum values declared within an enum class as though they are const even // though they may not be named as such. if ( isClassInstance(type) && ClassType.isEnumClass(type) && - isDeclInEnumClass(evaluatorInterface, decl) + isDeclInEnumClass(evaluatorInterface, resolvedDecl) ) { isConstant = true; } // If the symbol is constant, we can retain the literal // value. Otherwise, strip literal values to widen the type. - if (TypeBase.isInstance(type) && !isExplicitTypeAlias && !isConstant && !isFinalVar) { + if (TypeBase.isInstance(type) && !isExplicitTypeAlias && !isConstant) { type = stripLiteralValue(type); } } @@ -19395,28 +21476,42 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions throw e; } } else { + if (resolvedDecl.type === DeclarationType.Class) { + const classTypeInfo = getTypeOfClass(resolvedDecl.node); + if (classTypeInfo?.decoratedType) { + typesToCombine.push(classTypeInfo.decoratedType); + } + } + isIncomplete = true; + + // Note that at least one decl could not be evaluated because + // it was already in the process of being evaluated. + sawPendingEvaluation = true; } } }); if (typesToCombine.length > 0) { + // How many times have we already attempted to evaluate this declaration already? + const evaluationAttempts = (cacheEntries?.get(effectiveTypeCacheKey)?.evaluationAttempts ?? 0) + 1; + + // Ignore the pending evaluation flag if we've already attempted the + // type evaluation many times because this probably means there's a + // cyclical dependency that cannot be broken. + isIncomplete = sawPendingEvaluation && evaluationAttempts < maxEffectiveTypeEvaluationAttempts; + const result: EffectiveTypeResult = { type: combineTypes(typesToCombine), - isIncomplete: false, + isIncomplete, includesVariableDecl, includesIllegalTypeAliasDecl: !decls.every((decl) => isPossibleTypeAliasDeclaration(decl)), isRecursiveDefinition: false, + evaluationAttempts, }; if (!includesSpeculativeResult) { - // Add the entry to the cache so we don't need to compute it next time. - if (!cacheEntries) { - cacheEntries = new Map(); - effectiveTypeCache.set(symbol.id, cacheEntries); - } - - cacheEntries.set(effectiveTypeCacheKey, result); + addToEffectiveTypeCache(result); } return result; @@ -19429,19 +21524,35 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions includesIllegalTypeAliasDecl: !decls.every((decl) => isPossibleTypeAliasDeclaration(decl)), isRecursiveDefinition: false, }; + + function addToEffectiveTypeCache(result: EffectiveTypeResult) { + // Add the entry to the cache so we don't need to compute it next time. + if (!cacheEntries) { + cacheEntries = new Map(); + effectiveTypeCache.set(symbol.id, cacheEntries); + } + + cacheEntries.set(effectiveTypeCacheKey, result); + } } - function getDeclaredTypeOfSymbol(symbol: Symbol, usageNode?: NameNode): Type | undefined { + // If a declaration has an explicit type (e.g. a variable with an annotation), + // this function evaluates the type and returns it. If the symbol has no + // explicit declared type, its type will need to be inferred instead. In some + // cases, non-type information (such as Final or ClassVar attributes) may be + // provided, but type inference is still required. In such cases, the attributes + // are returned as flags. + function getDeclaredTypeOfSymbol(symbol: Symbol, usageNode?: NameNode): DeclaredSymbolTypeInfo { const synthesizedType = symbol.getSynthesizedType(); if (synthesizedType) { - return synthesizedType; + return { type: synthesizedType }; } let typedDecls = symbol.getTypedDeclarations(); if (typedDecls.length === 0) { // There was no declaration with a defined type. - return undefined; + return { type: undefined }; } // If there is more than one typed decl, filter out any that are not @@ -19465,7 +21576,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions }); if (filteredTypedDecls.length === 0) { - return UnboundType.create(); + return { type: UnboundType.create() }; } typedDecls = filteredTypedDecls; @@ -19484,13 +21595,13 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // for recursive symbol resolution, return it as the resolved type. const partialType = getSymbolResolutionPartialType(symbol, decl); if (partialType) { - return partialType; + return { type: partialType }; } if (getIndexOfSymbolResolution(symbol, decl) < 0) { if (pushSymbolResolution(symbol, decl)) { try { - const type = getTypeForDeclaration(decl); + const declaredTypeInfo = getTypeForDeclaration(decl); // If there was recursion detected, don't use this declaration. // The exception is it's a class declaration because getTypeOfClass @@ -19499,7 +21610,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // circular dependency between the "type" and "object" classes in // builtins.pyi (since "object" is a "type" and "type" is an "object"). if (popSymbolResolution(symbol) || decl.type === DeclarationType.Class) { - return type; + return declaredTypeInfo; } } catch (e: any) { // Clean up the stack before rethrowing. @@ -19512,7 +21623,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions declIndex--; } - return undefined; + return { type: undefined }; } function inferReturnTypeIfNecessary(type: Type) { @@ -19549,12 +21660,19 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions function getFunctionInferredReturnType(type: FunctionType, args?: ValidateArgTypeParams[]) { let returnType: Type | undefined; let isIncomplete = false; + let analyzeUnannotatedFunctions = true; // Don't attempt to infer the return type for a stub file. if (FunctionType.isStubDefinition(type)) { return UnknownType.create(); } + // Don't infer the return type for an overloaded function (unless it's synthesized, + // which is needed for proper operation of the __get__ method in properties). + if (FunctionType.isOverloaded(type) && !FunctionType.isSynthesizedMethod(type)) { + return UnknownType.create(); + } + // If the return type has already been lazily evaluated, // don't bother computing it again. if (type.inferredReturnType) { @@ -19566,9 +21684,11 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions returnType = NoneType.createInstance(); } else if (type.details.declaration) { const functionNode = type.details.declaration.node; + analyzeUnannotatedFunctions = + AnalyzerNodeInfo.getFileInfo(functionNode).diagnosticRuleSet.analyzeUnannotatedFunctions; // Skip return type inference if we are in "skip unannotated function" mode. - if (evaluatorOptions.analyzeUnannotatedFunctions && !checkCodeFlowTooComplex(functionNode.suite)) { + if (analyzeUnannotatedFunctions && !checkCodeFlowTooComplex(functionNode.suite)) { const codeFlowComplexity = AnalyzerNodeInfo.getCodeFlowComplexity(functionNode); // For very complex functions that have no annotated parameter types, @@ -19621,7 +21741,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // attempt to do a better job at inference. if ( !isIncomplete && - evaluatorOptions.analyzeUnannotatedFunctions && + analyzeUnannotatedFunctions && isPartlyUnknown(returnType) && FunctionType.hasUnannotatedParams(type) && !FunctionType.isStubDefinition(type) && @@ -19649,7 +21769,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions const functionNode = type.details.declaration.node; const codeFlowComplexity = AnalyzerNodeInfo.getCodeFlowComplexity(functionNode); - if (codeFlowComplexity >= maxReturnTypeInferenceCodeFlowComplexity) { + if (codeFlowComplexity >= maxReturnCallSiteTypeInferenceCodeFlowComplexity) { return undefined; } @@ -19699,7 +21819,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions }); try { - returnTypeInferenceTypeCache = new Map(); + returnTypeInferenceTypeCache = new Map(); let allArgTypesAreUnknown = true; functionNode.parameters.forEach((param, index) => { @@ -19737,7 +21857,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } paramTypes.push(paramType); - writeTypeCache(param.name, paramType, EvaluatorFlags.None, /* isIncomplete */ false); + writeTypeCache(param.name, { type: paramType }, EvaluatorFlags.None); } }); @@ -19969,16 +22089,20 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions if (isDerivedFrom) { assert(inheritanceChain.length > 0); - return assignClassWithTypeArgs( - destType, - srcType, - inheritanceChain, - diag, - destTypeVarContext, - srcTypeVarContext, - flags, - recursionCount - ); + if ( + assignClassWithTypeArgs( + destType, + srcType, + inheritanceChain, + diag?.createAddendum(), + destTypeVarContext, + srcTypeVarContext, + flags, + recursionCount + ) + ) { + return true; + } } } @@ -20011,8 +22135,16 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } // This function is used to validate or infer the variance of type - // parameters within a class. - function assignClassToSelf(destType: ClassType, srcType: ClassType, recursionCount = 0): boolean { + // parameters within a class. If ignoreBaseClassVariance is set to false, + // the type parameters for the base class are honored. This is useful for + // variance inference (PEP 695). For validation of protocol variance, we + // want to ignore the variance for all base classes in the class hierarchy. + function assignClassToSelf( + destType: ClassType, + srcType: ClassType, + ignoreBaseClassVariance = true, + recursionCount = 0 + ): boolean { assert(ClassType.isSameGenericClass(destType, srcType)); assert(destType.details.typeParameters.length > 0); @@ -20025,7 +22157,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions const memberInfo = lookUpClassMember(srcType, name); assert(memberInfo !== undefined); - let destMemberType = getDeclaredTypeOfSymbol(symbol); + let destMemberType = getDeclaredTypeOfSymbol(symbol)?.type; if (destMemberType) { const srcMemberType = getTypeOfMember(memberInfo!); destMemberType = partiallySpecializeType(destMemberType, destType); @@ -20057,7 +22189,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // Class and instance variables that are mutable need to // enforce invariance. const flags = - primaryDecl?.type === DeclarationType.Variable && !primaryDecl.isFinal + primaryDecl?.type === DeclarationType.Variable && !isFinalVariableDeclaration(primaryDecl) ? AssignTypeFlags.EnforceInvariance : AssignTypeFlags.Default; if ( @@ -20089,7 +22221,41 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions ) { const specializedDestBaseClass = specializeForBaseClass(destType, baseClass); const specializedSrcBaseClass = specializeForBaseClass(srcType, baseClass); - if (!assignClassToSelf(specializedDestBaseClass, specializedSrcBaseClass, recursionCount)) { + + if (!ignoreBaseClassVariance) { + specializedDestBaseClass.details.typeParameters.forEach((param, index) => { + if ( + !param.details.isParamSpec && + !param.details.isVariadic && + !param.details.isSynthesized && + specializedSrcBaseClass.typeArguments && + index < specializedSrcBaseClass.typeArguments.length && + specializedDestBaseClass.typeArguments && + index < specializedDestBaseClass.typeArguments.length + ) { + const paramVariance = param.details.declaredVariance; + if (isTypeVar(specializedSrcBaseClass.typeArguments[index])) { + if (paramVariance === Variance.Invariant || paramVariance === Variance.Contravariant) { + isAssignable = false; + } + } else if (isTypeVar(specializedDestBaseClass.typeArguments[index])) { + if (paramVariance === Variance.Invariant || paramVariance === Variance.Covariant) { + isAssignable = false; + } + } + } + }); + } + + if ( + isAssignable && + !assignClassToSelf( + specializedDestBaseClass, + specializedSrcBaseClass, + ignoreBaseClassVariance, + recursionCount + ) + ) { isAssignable = false; } } @@ -20116,20 +22282,13 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // If the source is unbounded, expand the unbounded argument to try // to make the source and dest arg counts match. if (srcUnboundedIndex >= 0) { - const requiredSrcArgCount = - destVariadicIndex >= 0 || destUnboundedIndex >= 0 ? destTypeArgs.length - 1 : destTypeArgs.length; const typeToReplicate = srcTypeArgs.length > 0 ? srcTypeArgs[srcUnboundedIndex].type : AnyType.create(); - while (srcTypeArgs.length < requiredSrcArgCount) { - srcTypeArgs.splice(srcUnboundedIndex, 0, { type: typeToReplicate, isUnbounded: false }); + while (srcTypeArgs.length < destTypeArgs.length) { + srcTypeArgs.splice(srcUnboundedIndex, 0, { type: typeToReplicate, isUnbounded: true }); } } - if (destVariadicIndex >= 0 && srcUnboundedIndex >= 0) { - diag?.addMessage(Localizer.DiagnosticAddendum.typeVarTupleRequiresKnownLength()); - return false; - } - // If the dest is unbounded or contains a variadic, determine which // source args map to the unbounded or variadic arg. if (destUnboundedIndex >= 0 || destVariadicIndex >= 0) { @@ -20146,7 +22305,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions specializeTupleClass( tupleClassType, removedArgs.map((typeArg) => { - return { type: stripLiteralValue(typeArg.type), isUnbounded: false }; + return { type: typeArg.type, isUnbounded: typeArg.isUnbounded }; }), /* isTypeArgumentExplicit */ true, /* isUnpackedTuple */ true @@ -20158,9 +22317,14 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions }); } } else { - const removedArgs = srcTypeArgs.splice(destUnboundedIndex, srcArgsToCapture); + const removedArgTypes = srcTypeArgs.splice(destUnboundedIndex, srcArgsToCapture).map((t) => { + if (isTypeVar(t.type) && isUnpackedVariadicTypeVar(t.type) && !t.type.isVariadicInUnion) { + return TypeVarType.cloneForUnpacked(t.type, /* isInUnion */ true); + } + return t.type; + }); srcTypeArgs.splice(destUnboundedIndex, 0, { - type: removedArgs.length > 0 ? combineTypes(removedArgs.map((t) => t.type)) : AnyType.create(), + type: removedArgTypes.length > 0 ? combineTypes(removedArgTypes) : AnyType.create(), isUnbounded: false, }); } @@ -20178,7 +22342,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions entryDiag?.createAddendum(), typeVarContext, /* srcTypeVarContext */ undefined, - flags | AssignTypeFlags.RetainLiteralsForTypeVar, + flags, recursionCount ) ) { @@ -20193,19 +22357,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } } } else { - if (srcUnboundedIndex >= 0) { - // PEP 646 allows an indeterminate tuple type to be assigned to - // a determinate tuple type if it's associated with a TypeVarTuple. - if (!destType.isUnpacked) { - diag?.addMessage( - Localizer.DiagnosticAddendum.tupleSizeMismatchIndeterminate().format({ - expected: destTypeArgs.length, - }) - ); - - return false; - } - } else { + if (srcUnboundedIndex < 0) { diag?.addMessage( Localizer.DiagnosticAddendum.tupleSizeMismatch().format({ expected: destTypeArgs.length, @@ -20233,19 +22385,28 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions recursionCount: number ): boolean { let curSrcType = srcType; - let curTypeVarContext = destTypeVarContext ?? new TypeVarContext(getTypeVarScopeId(destType)); + let curDestTypeVarContext = destTypeVarContext; let effectiveFlags = flags; inferTypeParameterVarianceForClass(destType); - // If we're using a private typeVarContext, don't skip solving type vars. + effectiveFlags |= AssignTypeFlags.SkipSolveTypeVars; + if (!destTypeVarContext) { + curDestTypeVarContext = new TypeVarContext(getTypeVarScopeId(destType)); effectiveFlags &= ~AssignTypeFlags.SkipSolveTypeVars; + } else { + // If we're using the caller's type var context, don't solve the + // type vars in this pass. We'll do this after we're done looping + // through the inheritance chain. + effectiveFlags |= AssignTypeFlags.SkipSolveTypeVars; } for (let ancestorIndex = inheritanceChain.length - 1; ancestorIndex >= 0; ancestorIndex--) { const ancestorType = inheritanceChain[ancestorIndex]; + const curSrcTypeVarContext = new TypeVarContext(getTypeVarScopeId(curSrcType)); + // If we've hit an "unknown", all bets are off, and we need to assume // that the type is assignable. if (isUnknown(ancestorType)) { @@ -20266,7 +22427,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // Handle built-in types that support arbitrary numbers // of type parameters like Tuple. if (ancestorIndex === 0 && destType.tupleTypeArguments && curSrcType.tupleTypeArguments) { - return assignTupleTypeArgs(destType, curSrcType, diag, curTypeVarContext, flags, recursionCount); + return assignTupleTypeArgs(destType, curSrcType, diag, curDestTypeVarContext, flags, recursionCount); } // If there are no type parameters on this class, we're done. @@ -20286,8 +22447,8 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions ancestorType, curSrcType, diag, - curTypeVarContext, - /* srcTypeVarContext */ undefined, + curDestTypeVarContext, + curSrcTypeVarContext, effectiveFlags, recursionCount ) @@ -20296,7 +22457,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } // Allocate a new type var map for the next time through the loop. - curTypeVarContext = new TypeVarContext(getTypeVarScopeId(ancestorType)); + curDestTypeVarContext = new TypeVarContext(getTypeVarScopeId(ancestorType)); effectiveFlags &= ~AssignTypeFlags.SkipSolveTypeVars; } @@ -20329,6 +22490,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions destTypeVarContext.setTypeVarType( destType.details.typeParameters[i], /* narrowBound */ undefined, + /* narrowBoundNoLiterals */ undefined, typeArgType ); } @@ -20345,7 +22507,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions const fgetSymbol = propertyClass.details.fields.get('fget'); if (fgetSymbol) { - const fgetType = getDeclaredTypeOfSymbol(fgetSymbol); + const fgetType = getDeclaredTypeOfSymbol(fgetSymbol)?.type; if (fgetType && isFunction(fgetType)) { return getFunctionEffectiveReturnType(fgetType, /* args */ undefined, inferTypeIfNeeded); } @@ -20495,35 +22657,11 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions flags = AssignTypeFlags.Default, recursionCount = 0 ): boolean { - // If this is a one-element union that contains a variadic type variable, - // pull out the subtype. - if (isUnion(destType) && destType.subtypes.length === 1 && isVariadicTypeVar(destType.subtypes[0])) { - destType = destType.subtypes[0]; - } - - if (isUnion(srcType) && srcType.subtypes.length === 1 && isVariadicTypeVar(srcType.subtypes[0])) { - srcType = srcType.subtypes[0]; - } - - if (destType === srcType) { - // If the dest type is a TypeVar and a typeVarContext was provided, we may - // need to assign the TypeVar to itself under certain circumstances. - // This is needed for cases where generic class A[T] calls its own - // constructor with an argument of type T. - if ( - isTypeVar(destType) && - !destType.details.isParamSpec && - !destType.details.isVariadic && - destType.scopeType === TypeVarScopeType.Class && - destTypeVarContext && - !destTypeVarContext.isLocked() && - destTypeVarContext.hasSolveForScope(destType.scopeId) && - !destTypeVarContext.getTypeVar(destType) && - (flags & (AssignTypeFlags.SkipSolveTypeVars | AssignTypeFlags.ReverseTypeVarMatching)) === 0 - ) { - destTypeVarContext.setTypeVarType(destType, srcType); - } - + // Handle the case where the dest and src types are the same object. + // We can normally shortcut this and say that they are compatible, + // but if the type includes TypeVars, we need to go through + // the rest of the logic. + if (destType === srcType && !requiresSpecialization(destType)) { return true; } @@ -20579,8 +22717,24 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } // Transform recursive type aliases if necessary. - destType = transformPossibleRecursiveTypeAlias(destType); - srcType = transformPossibleRecursiveTypeAlias(srcType); + const transformedDestType = transformPossibleRecursiveTypeAlias(destType); + const transformedSrcType = transformPossibleRecursiveTypeAlias(srcType); + + // Did either the source or dest include recursive type aliases? + // If so, we could be dealing with different recursive type aliases + // or a recursive type alias and a recursive protocol definition. + if ( + (transformedDestType !== destType && isUnion(transformedDestType)) || + (transformedSrcType !== srcType && isUnion(transformedSrcType)) + ) { + // Use a smaller recursive limit in this case to prevent runaway recursion. + if (recursionCount > maxRecursiveTypeAliasRecursionCount) { + return true; + } + } + + destType = transformedDestType; + srcType = transformedSrcType; // If the source or dest is unbound, allow the assignment. The // error will be reported elsewhere. @@ -20594,13 +22748,28 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions srcType = makeTopLevelTypeVarsConcrete(srcType); } - // Strip a few of the flags we don't want to propagate to other calls. + // Strip flags we don't want to propagate to other calls. const originalFlags = flags; - flags &= ~(AssignTypeFlags.AllowBoolTypeGuard | AssignTypeFlags.AllowTypeVarNarrowing); + flags &= ~AssignTypeFlags.AllowBoolTypeGuard; // Before performing any other checks, see if the dest type is a // TypeVar that we are attempting to match. if (isTypeVar(destType)) { + if (isTypeVarSame(destType, srcType)) { + if (destType.scopeId && destTypeVarContext?.hasSolveForScope(destType.scopeId)) { + return assignTypeToTypeVar( + evaluatorInterface, + destType, + srcType, + diag, + destTypeVarContext, + flags, + recursionCount + ); + } + return true; + } + // If the dest is a constrained or bound type variable and all of the // types in the source are conditioned on that same type variable // and have compatible types, we'll consider it assignable. @@ -20608,7 +22777,16 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions return true; } - if (isTypeSame(destType, srcType)) { + // If the source is a conditional type associated with a bound TypeVar + // and the bound TypeVar matches the condition, the types are compatible. + const destTypeVar = destType; + if ( + TypeBase.isInstantiable(destType) === TypeBase.isInstantiable(srcType) && + srcType.condition && + srcType.condition.some((cond) => { + return !cond.isConstrainedTypeVar && cond.typeVarName === destTypeVar.nameWithScope; + }) + ) { return true; } @@ -20626,7 +22804,8 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions srcType.details.isSynthesizedSelf && srcType.details.boundType && destType.details.isSynthesizedSelf && - destType.details.boundType + destType.details.boundType && + TypeBase.isInstance(srcType) === TypeBase.isInstance(destType) ) { if ((flags & AssignTypeFlags.ReverseTypeVarMatching) === 0 && destTypeVarContext) { assignTypeToTypeVar( @@ -20698,29 +22877,14 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions recursionCount ); } else { - // Reverse the order of assignment to populate the TypeVarContext for - // the source TypeVar. Normally we set the AllowTypeVarNarrowing flag - // so the wide type bound of the TypeVar is set rather than the narrow - // type bound. This allows the type to be further narrowed through other - // assignments. However, if we're populating the expected type in the - // TypeVarContext, we don't want to allow further narrowing. - let effectiveFlags = originalFlags; - if ((originalFlags & AssignTypeFlags.PopulatingExpectedType) !== 0) { - effectiveFlags &= ~( - AssignTypeFlags.ReverseTypeVarMatching | AssignTypeFlags.AllowTypeVarNarrowing - ); - } else { - effectiveFlags |= AssignTypeFlags.AllowTypeVarNarrowing; - } - if ( assignTypeToTypeVar( evaluatorInterface, - srcType as TypeVarType, + srcType, destType, diag, srcTypeVarContext, - effectiveFlags, + originalFlags, recursionCount ) ) { @@ -20738,7 +22902,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions destSubtype, diag, srcTypeVarContext, - originalFlags | AssignTypeFlags.AllowTypeVarNarrowing, + originalFlags, recursionCount ) ) { @@ -20797,8 +22961,13 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } if (isNever(srcType)) { + if ((flags & AssignTypeFlags.EnforceInvariance) !== 0) { + return isNever(destType); + } + const targetTypeVarContext = (flags & AssignTypeFlags.ReverseTypeVarMatching) === 0 ? destTypeVarContext : srcTypeVarContext; + if (targetTypeVarContext) { setTypeArgumentsRecursive(destType, UnknownType.create(), targetTypeVarContext, recursionCount); } @@ -20876,8 +23045,14 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions ); } - if (isNoneInstance(destType) && isNoneInstance(srcType)) { - return true; + if (isNoneInstance(destType)) { + if (isNoneInstance(srcType)) { + return true; + } + + if (isClassInstance(srcType) && ClassType.isBuiltIn(srcType, 'NoneType')) { + return true; + } } if (isNoneTypeClass(destType)) { @@ -20891,21 +23066,31 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } // Is the src a specialized "Type" object? - if (isClassInstance(srcType) && ClassType.isBuiltIn(srcType, 'type')) { - const srcTypeArgs = srcType.typeArguments; + if (isClassInstance(expandedSrcType) && ClassType.isBuiltIn(expandedSrcType, 'type')) { + const srcTypeArgs = expandedSrcType.typeArguments; + let typeTypeArg: Type | undefined; + let instantiableType: Type | undefined; + if (srcTypeArgs && srcTypeArgs.length >= 1) { - if (isAnyOrUnknown(srcTypeArgs[0])) { - if (isClassInstance(destType) && ClassType.isBuiltIn(srcType, 'type')) { + typeTypeArg = srcTypeArgs[0]; + if (isAnyOrUnknown(typeTypeArg)) { + if (isClassInstance(destType) && ClassType.isBuiltIn(expandedSrcType, 'type')) { return true; } return TypeBase.isInstantiable(destType); } + instantiableType = convertToInstantiable(typeTypeArg); + } else if (TypeBase.isInstantiable(destType)) { + typeTypeArg = objectType ?? AnyType.create(); + instantiableType = expandedSrcType; + } - if (isClassInstance(srcTypeArgs[0]) || isTypeVar(srcTypeArgs[0])) { + if (instantiableType && typeTypeArg) { + if (isClassInstance(typeTypeArg) || isTypeVar(typeTypeArg)) { if ( assignType( destType, - convertToInstantiable(srcTypeArgs[0]), + instantiableType, diag?.createAddendum(), destTypeVarContext, srcTypeVarContext, @@ -20928,13 +23113,12 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } if (isInstantiableClass(destType)) { - const concreteSrcType = makeTopLevelTypeVarsConcrete(srcType); - if (isInstantiableClass(concreteSrcType)) { + if (isInstantiableClass(expandedSrcType)) { // PEP 544 says that if the dest type is a Type[Proto] class, // the source must be a "concrete" (non-protocol) class. if (ClassType.isProtocolClass(destType)) { if ( - ClassType.isProtocolClass(concreteSrcType) && + ClassType.isProtocolClass(expandedSrcType) && isInstantiableClass(srcType) && !srcType.includeSubclasses ) { @@ -20951,7 +23135,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions if ( assignClass( destType, - concreteSrcType, + expandedSrcType, diag, destTypeVarContext, srcTypeVarContext, @@ -21167,7 +23351,6 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } if (isFunction(destType)) { - let srcFunction: FunctionType | undefined; let concreteSrcType = makeTopLevelTypeVarsConcrete(srcType); if (isClassInstance(concreteSrcType)) { @@ -21185,50 +23368,71 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } } - if (isOverloadedFunction(concreteSrcType)) { - // Overloads are not compatible with ParamSpec. - if (destType.details.paramSpec) { - diag?.addMessage(Localizer.DiagnosticAddendum.paramSpecOverload()); - return false; - } + if (isAnyOrUnknown(concreteSrcType)) { + return (flags & AssignTypeFlags.OverloadOverlapCheck) === 0; + } - // Find first overloaded function that matches the parameters. - // We don't want to pollute the current typeVarContext, so we'll - // make a copy of the existing one if it's specified. + if (isOverloadedFunction(concreteSrcType)) { + // Find all of the overloaded functions that match the parameters. const overloads = OverloadedFunctionType.getOverloads(concreteSrcType); - const overloadIndex = overloads.findIndex((overload) => { - return assignType( - destType, - overload, - diag?.createAddendum(), - destTypeVarContext?.clone(), - srcTypeVarContext?.clone(), - flags, - recursionCount - ); + const filteredOverloads: FunctionType[] = []; + const destTypeVarSignatures: TypeVarSignatureContext[] = []; + const srcTypeVarSignatures: TypeVarSignatureContext[] = []; + + overloads.forEach((overload) => { + const overloadScopeId = getTypeVarScopeId(overload) ?? ''; + const destTypeVarContextClone = destTypeVarContext?.cloneWithSignatureSource(overloadScopeId); + const srcTypeVarContextClone = srcTypeVarContext?.cloneWithSignatureSource(overloadScopeId); + + if ( + assignType( + destType, + overload, + /* diag */ undefined, + destTypeVarContextClone, + srcTypeVarContextClone, + flags, + recursionCount + ) + ) { + filteredOverloads.push(overload); + + if (destTypeVarContextClone) { + destTypeVarSignatures.push(...destTypeVarContextClone.getSignatureContexts()); + } + + if (srcTypeVarContextClone) { + srcTypeVarSignatures.push(...srcTypeVarContextClone.getSignatureContexts()); + } + } }); - if (overloadIndex < 0) { + if (filteredOverloads.length === 0) { diag?.addMessage( Localizer.DiagnosticAddendum.noOverloadAssignable().format({ type: printType(destType) }) ); return false; } - srcFunction = overloads[overloadIndex]; - } else if (isFunction(concreteSrcType)) { - srcFunction = concreteSrcType; - } else if (isAnyOrUnknown(concreteSrcType)) { - return (flags & AssignTypeFlags.OverloadOverlapCheck) === 0; + + if (destTypeVarContext) { + destTypeVarContext.copySignatureContexts(destTypeVarSignatures); + } + + if (srcTypeVarContext) { + srcTypeVarContext.copySignatureContexts(srcTypeVarSignatures); + } + + return true; } - if (srcFunction) { + if (isFunction(concreteSrcType)) { if ( assignFunction( destType, - srcFunction, + concreteSrcType, diag?.createAddendum(), destTypeVarContext ?? new TypeVarContext(getTypeVarScopeId(destType)), - srcTypeVarContext ?? new TypeVarContext(getTypeVarScopeId(srcFunction)), + srcTypeVarContext ?? new TypeVarContext(getTypeVarScopeId(concreteSrcType)), flags, recursionCount ) @@ -21242,7 +23446,34 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions const overloadDiag = diag?.createAddendum(); // All overloads in the dest must be assignable. - const isAssignable = OverloadedFunctionType.getOverloads(destType).every((destOverload) => { + const destOverloads = OverloadedFunctionType.getOverloads(destType); + + // If the source is also an overload with the same number of overloads, + // there's a good chance that there's a one-to-one mapping. Try this + // first before using an n^2 algorithm. + if (isOverloadedFunction(srcType)) { + const srcOverloads = OverloadedFunctionType.getOverloads(srcType); + if (destOverloads.length === srcOverloads.length) { + if ( + destOverloads.every((destOverload, index) => { + const srcOverload = srcOverloads[index]; + return assignType( + destOverload, + srcOverload, + /* diag */ undefined, + destTypeVarContext ?? new TypeVarContext(getTypeVarScopeId(destOverload)), + srcTypeVarContext, + flags, + recursionCount + ); + }) + ) { + return true; + } + } + } + + const isAssignable = destOverloads.every((destOverload) => { if (destTypeVarContext) { destTypeVarContext.addSolveForScope(getTypeVarScopeId(destOverload)); } @@ -21273,10 +23504,12 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions return true; } - if (isClassInstance(destType) && ClassType.isBuiltIn(destType, 'object')) { - if ((flags & AssignTypeFlags.EnforceInvariance) === 0) { - // All types (including None, Module, OverloadedFunction) derive from object. - return true; + if (isClass(destType) && ClassType.isBuiltIn(destType, 'object')) { + if ((isInstantiableClass(destType) && TypeBase.isInstantiable(srcType)) || isClassInstance(destType)) { + if ((flags & AssignTypeFlags.EnforceInvariance) === 0) { + // All types (including None, Module, OverloadedFunction) derive from object. + return true; + } } } @@ -21327,34 +23560,34 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions return true; } + // Sort the subtypes so we have a deterministic order for unions. + let sortedSrcTypes: Type[] = sortTypes(srcType.subtypes); + // Handle the case where the source and dest are both unions. Try // to eliminate as many exact type matches between the src and dest. if (isUnion(destType)) { // Handle the special case where the dest is a union of Any and - // a type variable and AssignTypeFlags.AllowTypeVarNarrowing is - // in effect. This occurs, for example, with the return type of + // a type variable. This occurs, for example, with the return type of // the getattr function. - if ((flags & AssignTypeFlags.AllowTypeVarNarrowing) !== 0) { - const nonAnySubtypes = destType.subtypes.filter((t) => !isAnyOrUnknown(t)); - if (nonAnySubtypes.length === 1 && isTypeVar(nonAnySubtypes[0])) { - assignType( - nonAnySubtypes[0], - srcType, - /* diag */ undefined, - destTypeVarContext, - srcTypeVarContext, - flags, - recursionCount - ); + const nonAnySubtypes = destType.subtypes.filter((t) => !isAnyOrUnknown(t)); + if (nonAnySubtypes.length === 1 && isTypeVar(nonAnySubtypes[0])) { + assignType( + nonAnySubtypes[0], + srcType, + /* diag */ undefined, + destTypeVarContext, + srcTypeVarContext, + flags, + recursionCount + ); - // This always succeeds because the destination contains Any. - return true; - } + // This always succeeds because the destination contains Any. + return true; } const remainingDestSubtypes: Type[] = []; - let remainingSrcSubtypes: Type[] = [...srcType.subtypes]; - let isIncompatible = false; + let remainingSrcSubtypes: Type[] = sortedSrcTypes; + let canUseFastPath = true; // First attempt to match all of the non-generic types in the dest // to non-generic types in the source. @@ -21365,63 +23598,68 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions const srcTypeIndex = remainingSrcSubtypes.findIndex((srcSubtype) => isTypeSame(srcSubtype, destSubtype, {}, recursionCount) ); + if (srcTypeIndex >= 0) { remainingSrcSubtypes.splice(srcTypeIndex, 1); } else { - isIncompatible = true; + remainingDestSubtypes.push(destSubtype); } } }); // For all remaining source subtypes, attempt to find a dest subtype // whose primary type matches. - if (!isIncompatible) { - sortTypes(remainingSrcSubtypes).forEach((srcSubtype) => { - const destTypeIndex = remainingDestSubtypes.findIndex((destSubtype) => { - if ( - isClass(srcSubtype) && - isClass(destSubtype) && - TypeBase.isInstance(srcSubtype) === TypeBase.isInstance(destSubtype) && - ClassType.isSameGenericClass(srcSubtype, destSubtype) - ) { - return true; - } - - if (isFunction(srcSubtype) || isOverloadedFunction(srcSubtype)) { - if (isFunction(destSubtype) || isOverloadedFunction(destSubtype)) { - return true; - } - } - - return false; - }); + remainingSrcSubtypes.forEach((srcSubtype) => { + const destTypeIndex = remainingDestSubtypes.findIndex((destSubtype) => { + if ( + isClass(srcSubtype) && + isClass(destSubtype) && + TypeBase.isInstance(srcSubtype) === TypeBase.isInstance(destSubtype) && + ClassType.isSameGenericClass(srcSubtype, destSubtype) + ) { + return true; + } - if (destTypeIndex >= 0) { - if ( - !assignType( - remainingDestSubtypes[destTypeIndex], - srcSubtype, - diag?.createAddendum(), - destTypeVarContext, - srcTypeVarContext, - flags, - recursionCount - ) - ) { - isIncompatible = true; + if (isFunction(srcSubtype) || isOverloadedFunction(srcSubtype)) { + if (isFunction(destSubtype) || isOverloadedFunction(destSubtype)) { + return true; } - - remainingDestSubtypes.splice(destTypeIndex, 1); - remainingSrcSubtypes = remainingSrcSubtypes.filter((t) => t !== srcSubtype); } + + return false; }); - } + + if (destTypeIndex >= 0) { + if ( + !assignType( + remainingDestSubtypes[destTypeIndex], + srcSubtype, + diag?.createAddendum(), + destTypeVarContext, + srcTypeVarContext, + flags, + recursionCount + ) + ) { + canUseFastPath = false; + } + + remainingDestSubtypes.splice(destTypeIndex, 1); + remainingSrcSubtypes = remainingSrcSubtypes.filter((t) => t !== srcSubtype); + } + }); // If there is are remaining dest subtypes and they're all type variables, // attempt to assign the remaining source subtypes to them. - if (!isIncompatible && (remainingDestSubtypes.length !== 0 || remainingSrcSubtypes.length !== 0)) { - if (remainingDestSubtypes.length === 0 || remainingDestSubtypes.some((t) => !isTypeVar(t))) { - isIncompatible = true; + if (canUseFastPath && (remainingDestSubtypes.length !== 0 || remainingSrcSubtypes.length !== 0)) { + const isReversed = (flags & AssignTypeFlags.ReverseTypeVarMatching) !== 0; + const effectiveDestSubtypes = isReversed ? remainingSrcSubtypes : remainingDestSubtypes; + + if (effectiveDestSubtypes.length === 0 || effectiveDestSubtypes.some((t) => !isTypeVar(t))) { + canUseFastPath = false; + + // We can avoid checking the source subtypes that have already been checked. + sortedSrcTypes = remainingSrcSubtypes; } else if (remainingDestSubtypes.length === remainingSrcSubtypes.length) { // If the number of remaining source subtypes is the same as the number // of dest TypeVars, try to assign each source subtype to its own dest TypeVar. @@ -21438,16 +23676,39 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions recursionCount ) ) { - isIncompatible = true; + canUseFastPath = false; } }); + + // We can avoid checking the source subtypes that have already been checked. + sortedSrcTypes = remainingSrcSubtypes; + } else if (remainingSrcSubtypes.length === 0) { + if ((flags & AssignTypeFlags.PopulatingExpectedType) !== 0) { + // If we're populating an expected type, try not to leave + // any TypeVars unsolved. Assign the full type to the remaining + // dest TypeVars. + remainingDestSubtypes.forEach((destSubtype) => { + assignType( + destSubtype, + srcType, + /* diag */ undefined, + destTypeVarContext, + srcTypeVarContext, + flags, + recursionCount + ); + }); + } + + // If we've assigned all of the source subtypes but one or more dest + // TypeVars have gone unmatched, treat this as success. } else { // Try to assign a union of the remaining source types to // the first destination TypeVar. if ( !assignType( - remainingDestSubtypes[0], - combineTypes(remainingSrcSubtypes), + isReversed ? combineTypes(remainingDestSubtypes) : remainingDestSubtypes[0], + isReversed ? remainingSrcSubtypes[0] : combineTypes(remainingSrcSubtypes), diag?.createAddendum(), destTypeVarContext, srcTypeVarContext, @@ -21455,72 +23716,67 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions recursionCount ) ) { - isIncompatible = true; + canUseFastPath = false; } } } - if (!isIncompatible) { + if (canUseFastPath) { return true; } } - // For union sources, all of the types need to be assignable to the dest. let isIncompatible = false; - // Sort the subtypes so we have a deterministic order for unions. - doForEachSubtype( - srcType, - (subtype, subtypeIndex) => { - if (isIncompatible) { - return; - } + sortedSrcTypes.forEach((subtype) => { + if (isIncompatible) { + return; + } + + if ( + !assignType( + destType, + subtype, + /* diag */ undefined, + destTypeVarContext, + srcTypeVarContext, + flags, + recursionCount + ) + ) { + const concreteSubtype = makeTopLevelTypeVarsConcrete(subtype); + + // Determine if the current subtype is subsumed by another subtype + // in the same union. If so, we can ignore this. + let isSubtypeSubsumed = false; + srcType.subtypes.forEach((innerSubtype) => { + if ( + !isSubtypeSubsumed && + !isTypeSame(innerSubtype, subtype) && + !isAnyOrUnknown(innerSubtype) && + isProperSubtype(innerSubtype, concreteSubtype, recursionCount) + ) { + isSubtypeSubsumed = true; + } + }); + // Try again with a concrete version of the subtype. if ( + !isSubtypeSubsumed && !assignType( destType, - subtype, - /* diag */ undefined, + concreteSubtype, + diag?.createAddendum(), destTypeVarContext, srcTypeVarContext, flags, recursionCount ) ) { - const concreteSubtype = makeTopLevelTypeVarsConcrete(subtype); - - // Determine if the current subtype is subsumed by another subtype - // in the same union. If so, we can ignore this. - let isSubtypeSubsumed = false; - doForEachSubtype(srcType, (innerSubtype, innerSubtypeIndex) => { - if (isSubtypeSubsumed || subtypeIndex === innerSubtypeIndex || isAnyOrUnknown(innerSubtype)) { - return; - } - - if (isProperSubtype(innerSubtype, concreteSubtype, recursionCount)) { - isSubtypeSubsumed = true; - } - }); - - // Try again with a concrete version of the subtype. - if ( - !isSubtypeSubsumed && - !assignType( - destType, - concreteSubtype, - diag?.createAddendum(), - destTypeVarContext, - srcTypeVarContext, - flags, - recursionCount - ) - ) { - isIncompatible = true; - } + isIncompatible = true; } - }, - /* sortSubtypes */ true - ); + } + }, /* sortSubtypes */ true); if (isIncompatible) { diag?.addMessage( @@ -21540,6 +23796,11 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // matches for types like `tuple[Any]` and `tuple[int]` from being considered // proper subtypes of each other. function isProperSubtype(destType: Type, srcType: Type, recursionCount: number) { + // If the destType has a condition, don't consider the srcType a proper subtype. + if (destType.condition) { + return false; + } + // Shortcut the check if either type is Any or Unknown. if (isAnyOrUnknown(destType) || isAnyOrUnknown(srcType)) { return true; @@ -21660,8 +23921,8 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions subtype, srcType, diagAddendum?.createAddendum(), - /* destTypeVarContextClone */ undefined, - /* srcTypeVarContextClone */ undefined, + destTypeVarContext, + srcTypeVarContext, flags, recursionCount ) @@ -21687,7 +23948,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions if ( isClassInstance(srcType) && isLiteralType(srcType) && - UnionType.containsType(destType, srcType, recursionCount) + UnionType.containsType(destType, srcType, /* exclusionSet */ undefined, recursionCount) ) { return true; } @@ -21864,13 +24125,22 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions /* errorNode */ undefined, recursionCount ) as FunctionType | undefined; + if (constructorFunction) { constructorFunction = FunctionType.clone(constructorFunction); constructorFunction.details.declaredReturnType = objectType; + if (constructorFunction.specializedTypes) { constructorFunction.specializedTypes.returnType = objectType; } + + if (!constructorFunction.details.docString && classType.details.docString) { + constructorFunction.details.docString = classType.details.docString; + } + + constructorFunction.details.flags &= ~FunctionTypeFlags.StaticMethod; } + return constructorFunction; }; @@ -21906,7 +24176,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions const newType = getTypeOfMember(newInfo); const convertNewToConstructor = (newSubtype: FunctionType) => { - return bindFunctionToClassOrObject( + let constructorFunction = bindFunctionToClassOrObject( classType, newSubtype, /* memberClass */ undefined, @@ -21914,6 +24184,20 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions recursionCount, /* treatConstructorAsClassMember */ true ) as FunctionType | undefined; + + if (constructorFunction) { + constructorFunction = FunctionType.clone(constructorFunction); + + if (!constructorFunction.details.docString && classType.details.docString) { + constructorFunction.details.docString = classType.details.docString; + } + + constructorFunction.details.flags &= ~( + FunctionTypeFlags.StaticMethod | FunctionTypeFlags.ConstructorMethod + ); + } + + return constructorFunction; }; if (isFunction(newType)) { @@ -21938,12 +24222,14 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } // Return a generic constructor. - const constructorFunction = FunctionType.createSynthesizedInstance( - '__new__', - FunctionTypeFlags.ConstructorMethod - ); + const constructorFunction = FunctionType.createSynthesizedInstance('__new__', FunctionTypeFlags.None); constructorFunction.details.declaredReturnType = ClassType.cloneAsInstance(classType); FunctionType.addDefaultParameters(constructorFunction); + + if (!constructorFunction.details.docString && classType.details.docString) { + constructorFunction.details.docString = classType.details.docString; + } + return constructorFunction; } @@ -22020,7 +24306,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions let reverseMatchingFailed = false; if ((flags & AssignTypeFlags.ReverseTypeVarMatching) === 0) { - specializedDestType = applySolvedTypeVars(destType, destTypeVarContext); + specializedDestType = applySolvedTypeVars(destType, destTypeVarContext, { useNarrowBoundOnly: true }); if (requiresSpecialization(specializedDestType)) { reverseMatchingFailed = !assignType( @@ -22038,7 +24324,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions specializedDestType = applySolvedTypeVars(destType, destTypeVarContext); } } else { - specializedSrcType = applySolvedTypeVars(srcType, srcTypeVarContext); + specializedSrcType = applySolvedTypeVars(srcType, srcTypeVarContext, { useNarrowBoundOnly: true }); if (requiresSpecialization(specializedSrcType)) { reverseMatchingFailed = !assignType( @@ -22082,7 +24368,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions specializedSrcType = applySolvedTypeVars( specializedSrcType.details.boundType, new TypeVarContext(getTypeVarScopeId(specializedSrcType)), - /* unknownIfNotFound */ true + { unknownIfNotFound: true } ); } } @@ -22132,6 +24418,12 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions return; } + // If the *args parameter isn't an unpacked TypeVarTuple or tuple, + // we have nothing to do. + if (!isUnpacked(destDetails.params[destDetails.argsIndex].type)) { + return; + } + // If the source doesn't have enough positional parameters, we have nothing to do. if (srcDetails.params.length < destDetails.argsIndex) { return; @@ -22504,9 +24796,9 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions if ( !FunctionType.shouldSkipArgsKwargsCompatibilityCheck(destType) && srcParamDetails.argsIndex === undefined && + srcType.details.paramSpec === undefined && destParamDetails.argsIndex !== undefined && - !destParamDetails.hasUnpackedVariadicTypeVar && - !targetIncludesParamSpec + !destParamDetails.hasUnpackedVariadicTypeVar ) { diag?.createAddendum().addMessage( Localizer.DiagnosticAddendum.argsParamMissing().format({ @@ -22711,10 +25003,11 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // If the target function was generic and we solved some of the type variables // in that generic type, assign them back to the destination typeVar. - effectiveSrcTypeVarContext.getTypeVars().forEach((typeVarEntry) => { + const typeVarSignatureContext = effectiveSrcTypeVarContext.getPrimarySignature(); + typeVarSignatureContext.getTypeVars().forEach((typeVarEntry) => { assignType( typeVarEntry.typeVar, - effectiveSrcTypeVarContext.getTypeVarType(typeVarEntry.typeVar)!, + typeVarSignatureContext.getTypeVarType(typeVarEntry.typeVar)!, /* diag */ undefined, destTypeVarContext, srcTypeVarContext, @@ -22723,24 +25016,6 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions ); }); - // Perform partial specialization of type variables to allow for - // "higher-order" type variables. - if (!destTypeVarContext.isLocked()) { - destTypeVarContext.getTypeVars().forEach((entry) => { - if (entry.narrowBound) { - const specializedType = applySolvedTypeVars(entry.narrowBound, destTypeVarContext); - if (specializedType !== entry.narrowBound) { - destTypeVarContext.setTypeVarType( - entry.typeVar, - specializedType, - entry.wideBound, - entry.retainLiteral - ); - } - } - }); - } - // Are we assigning to a function with a ParamSpec? if (targetIncludesParamSpec) { const effectiveDestType = (flags & AssignTypeFlags.ReverseTypeVarMatching) === 0 ? destType : srcType; @@ -22751,13 +25026,14 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions if (!p.name) { return false; } + if (p.category === ParameterCategory.Simple && isParamSpec(p.type)) { return false; } return true; }).length; let matchedParamCount = 0; - const remainingParams: ParamSpecEntry[] = []; + const remainingParams: FunctionParameter[] = []; // If there are parameters in the source that are not matched // to parameters in the dest, assume these are concatenated on @@ -22776,6 +25052,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions name: p.name, isNameSynthesized: p.isNameSynthesized, hasDefault: !!p.hasDefault, + defaultValueExpression: p.defaultValueExpression, type: FunctionType.getEffectiveParameterType(effectiveSrcType, index), }); } @@ -22919,6 +25196,10 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } } + // Apply any solved source TypeVars to the dest TypeVar solutions. This + // allows for higher-order functions to accept generic callbacks. + destTypeVarContext.applySourceContextTypeVars(srcTypeVarContext); + return canAssign; } @@ -22927,7 +25208,16 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // replace that type argument in the assigned type. This function assumes // that the caller has already verified that the assignedType is assignable // to the declaredType. - function replaceTypeArgsWithAny(declaredType: ClassType, assignedType: ClassType): ClassType | undefined { + function replaceTypeArgsWithAny( + declaredType: ClassType, + assignedType: ClassType, + recursionCount = 0 + ): ClassType | undefined { + if (recursionCount > maxTypeRecursionCount) { + return undefined; + } + recursionCount++; + // If this is a tuple with defined tuple type arguments, don't overwrite them. if (assignedType.tupleTypeArguments) { return undefined; @@ -22954,12 +25244,23 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions let replacedTypeArg = false; const newTypeArgs = assignedType.typeArguments.map((typeArg, index) => { const typeParam = assignedType.details.typeParameters[index]; - const expectedTypeArgType = typeVarContext.getTypeVarType(typeParam); + const expectedTypeArgType = typeVarContext.getPrimarySignature().getTypeVarType(typeParam); if (expectedTypeArgType) { if (isAny(expectedTypeArgType) || isAnyOrUnknown(typeArg)) { replacedTypeArg = true; return expectedTypeArgType; + } else if (isClassInstance(expectedTypeArgType) && isClassInstance(typeArg)) { + // Recursively replace Any in the type argument. + const recursiveReplacement = replaceTypeArgsWithAny( + expectedTypeArgType, + typeArg, + recursionCount + ); + if (recursiveReplacement) { + replacedTypeArg = true; + return recursiveReplacement; + } } } @@ -22977,8 +25278,6 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // When a value is assigned to a variable with a declared type, // we may be able to narrow the type based on the assignment. function narrowTypeBasedOnAssignment(declaredType: Type, assignedType: Type): Type { - const diag = new DiagnosticAddendum(); - const narrowedType = mapSubtypes(assignedType, (assignedSubtype) => { const narrowedSubtype = mapSubtypes(declaredType, (declaredSubtype) => { // We can't narrow "Any". @@ -22986,7 +25285,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions return declaredType; } - if (assignType(declaredSubtype, assignedSubtype, diag)) { + if (assignType(declaredSubtype, assignedSubtype)) { // If the source is generic and has unspecified type arguments, // see if we can determine then based on the declared type. if (isInstantiableClass(declaredSubtype) && isInstantiableClass(assignedSubtype)) { @@ -23006,9 +25305,6 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // If the source is an unsolved TypeVar but the declared type is concrete, // use the concrete type. return declaredSubtype; - } else if (isAnyOrUnknown(assignedSubtype)) { - // Any or Unknown do not narrow because they're assignable to all types. - return declaredSubtype; } return assignedSubtype; @@ -23027,8 +25323,17 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions }); // If the result of narrowing is Any, stick with the declared (unnarrowed) type. - if (isAnyOrUnknown(assignedType)) { + // If the result of narrowing is an Unknown that is incomplete, propagate the + // incomplete type for the benefit of code flow analysis. + // If the result of narrowing is a complete Unknown, combine the Unknown type + // with the declared type. In strict mode, this will retain the "unknown type" + // diagnostics while still providing reasonable completion suggestions. + if (isAny(narrowedType)) { return declaredType; + } else if (isIncompleteUnknown(narrowedType)) { + return narrowedType; + } else if (isUnknown(narrowedType)) { + return combineTypes([narrowedType, declaredType]); } return narrowedType; @@ -23125,11 +25430,31 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // Verify that the positional param count matches exactly or that the override // adds only params that preserve the original signature. let foundParamCountMismatch = false; - if ( - overrideParamDetails.positionParamCount < baseParamDetails.positionParamCount && - overrideParamDetails.argsIndex === undefined - ) { - foundParamCountMismatch = true; + if (overrideParamDetails.positionParamCount < baseParamDetails.positionParamCount) { + if (overrideParamDetails.argsIndex === undefined) { + foundParamCountMismatch = true; + } else { + const overrideArgsType = overrideParamDetails.params[overrideParamDetails.argsIndex].type; + for (let i = overrideParamDetails.positionParamCount; i < baseParamDetails.positionParamCount; i++) { + if ( + !assignType( + overrideArgsType, + baseParamDetails.params[i].type, + diag?.createAddendum(), + new TypeVarContext(getTypeVarScopeId(overrideMethod)), + new TypeVarContext(getTypeVarScopeId(baseMethod)), + AssignTypeFlags.SkipSolveTypeVars + ) + ) { + Localizer.DiagnosticAddendum.overrideParamType().format({ + index: i + 1, + baseType: printType(baseParamDetails.params[i].type), + overrideType: printType(overrideArgsType), + }); + canOverride = false; + } + } + } } else if (overrideParamDetails.positionParamCount > baseParamDetails.positionParamCount) { // Verify that all of the override parameters that extend the // signature are either *args, **kwargs or parameters with @@ -23183,6 +25508,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions if ( i >= baseParamDetails.positionOnlyParamCount && !isPrivateOrProtectedName(baseParam.name || '') && + baseParamDetails.params[i].source !== ParameterSource.PositionOnly && baseParam.category === ParameterCategory.Simple && baseParam.name !== overrideParam.name ) { @@ -23403,43 +25729,37 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // Validates that the specified source type matches the constraints // of the type variable. If successful, it returns the constraint // type that applies. If unsuccessful, it returns undefined. - function applyTypeArgToTypeVar( - destType: TypeVarType, - srcType: Type, - diag: DiagnosticAddendum, - flags = AssignTypeFlags.Default, - recursionCount = 0 - ): Type | undefined { - if (recursionCount > maxTypeRecursionCount) { - return srcType; - } - recursionCount++; - + function applyTypeArgToTypeVar(destType: TypeVarType, srcType: Type, diag: DiagnosticAddendum): Type | undefined { if (isAnyOrUnknown(srcType)) { return srcType; } - let effectiveSrcType: Type = srcType; + let effectiveSrcType: Type = transformPossibleRecursiveTypeAlias(srcType); if (isTypeVar(srcType)) { - if (isTypeSame(srcType, destType, {}, recursionCount)) { + if (isTypeSame(srcType, destType)) { return srcType; } effectiveSrcType = makeTopLevelTypeVarsConcrete(srcType); } + // If this is a partially-evaluated class, don't perform any further + // checks. Assume in this case that the type is compatible with the + // bound or constraint. + if (isClass(effectiveSrcType) && ClassType.isPartiallyEvaluated(effectiveSrcType)) { + return srcType; + } + // If there's a bound type, make sure the source is derived from it. - if (destType.details.boundType) { + if (destType.details.boundType && !isTypeAliasPlaceholder(effectiveSrcType)) { if ( !assignType( destType.details.boundType, effectiveSrcType, diag.createAddendum(), /* destTypeVarContext */ undefined, - /* srcTypeVarContext */ undefined, - flags, - recursionCount + /* srcTypeVarContext */ undefined ) ) { // Avoid adding a message that will confuse users if the TypeVar was @@ -23491,21 +25811,15 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions return srcType; } + if (isTypeAliasPlaceholder(srcType)) { + return srcType; + } + if (isTypeVar(srcType) && srcType.details.constraints.length > 0) { // Make sure all the source constraint types map to constraint types in the dest. if ( srcType.details.constraints.every((sourceConstraint) => { - return constraints.some((destConstraint) => - assignType( - destConstraint, - sourceConstraint, - /* diag */ undefined, - /* destTypeVarContext */ undefined, - /* srcTypeVarContext */ undefined, - AssignTypeFlags.Default, - recursionCount - ) - ); + return constraints.some((destConstraint) => assignType(destConstraint, sourceConstraint)); }) ) { return srcType; @@ -23515,29 +25829,8 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // Try to find the best (narrowest) match among the constraints. for (const constraint of constraints) { - if ( - assignType( - constraint, - effectiveSrcType, - /* diag */ undefined, - /* destTypeVarContext */ undefined, - /* srcTypeVarContext */ undefined, - AssignTypeFlags.Default, - recursionCount - ) - ) { - if ( - !bestConstraintSoFar || - assignType( - bestConstraintSoFar, - constraint, - /* diag */ undefined, - /* destTypeVarContext */ undefined, - /* srcTypeVarContext */ undefined, - AssignTypeFlags.Default, - recursionCount - ) - ) { + if (assignType(constraint, effectiveSrcType)) { + if (!bestConstraintSoFar || assignType(bestConstraintSoFar, constraint)) { bestConstraintSoFar = constraint; } } @@ -23689,7 +25982,9 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions } } else if (isOverloadedFunction(memberType)) { const newOverloadType = OverloadedFunctionType.create([]); - memberType.overloads.forEach((overload) => { + + // Don't bother binding the implementation. + OverloadedFunctionType.getOverloads(memberType).forEach((overload) => { const boundMethod = bindFunctionToClassOrObject( baseType, overload, @@ -23699,14 +25994,13 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions treatConstructorAsClassMember, firstParamType ); + if (boundMethod) { OverloadedFunctionType.addOverload(newOverloadType, boundMethod as FunctionType); } }); - if (newOverloadType.overloads.length === 1) { - return newOverloadType.overloads[0]; - } else if (newOverloadType.overloads.length === 0) { + if (OverloadedFunctionType.getOverloads(newOverloadType).length === 0) { // No overloads matched, so rebind with the errorNode // to report the error(s) to the user. if (errorNode) { @@ -23723,6 +26017,8 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions }); } return undefined; + } else if (newOverloadType.overloads.length === 1) { + return newOverloadType.overloads[0]; } return newOverloadType; @@ -23754,7 +26050,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions // Fill out the typeVarContext for the "self" or "cls" parameter. typeVarContext.addSolveForScope(getTypeVarScopeId(memberType)); - const diag = new DiagnosticAddendum(); + const diag = errorNode ? new DiagnosticAddendum() : undefined; if ( isTypeVar(memberTypeFirstParamType) && @@ -23799,7 +26095,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions type: printType(baseType), methodName: methodName, paramName: memberTypeFirstParam.name, - }) + diag.getString(), + }) + diag?.getString(), errorNode ); } else { @@ -23821,6 +26117,71 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions return FunctionType.clone(specializedFunction, stripFirstParam, baseType, getTypeVarScopeId(baseType)); } + function isFinalVariable(symbol: Symbol): boolean { + return symbol.getDeclarations().some((decl) => isFinalVariableDeclaration(decl)); + } + + function isFinalVariableDeclaration(decl: Declaration): boolean { + return decl.type === DeclarationType.Variable && !!decl.isFinal; + } + + function isExplicitTypeAliasDeclaration(decl: Declaration): boolean { + if (decl.type !== DeclarationType.Variable || !decl.typeAnnotationNode) { + return false; + } + + if ( + decl.typeAnnotationNode.nodeType !== ParseNodeType.Name && + decl.typeAnnotationNode.nodeType !== ParseNodeType.MemberAccess && + decl.typeAnnotationNode.nodeType !== ParseNodeType.StringList + ) { + return false; + } + + const type = getTypeOfAnnotation(decl.typeAnnotationNode, { isVariableAnnotation: true, allowClassVar: true }); + return isClassInstance(type) && ClassType.isBuiltIn(type, 'TypeAlias'); + } + + function isPossibleTypeAliasDeclaration(decl: Declaration): boolean { + if (decl.type !== DeclarationType.Variable || !decl.typeAliasName || decl.typeAnnotationNode) { + return false; + } + + if (decl.node.parent?.nodeType !== ParseNodeType.Assignment) { + return false; + } + + // Perform a sanity check on the RHS expression. Some expression + // forms should never be considered legitimate for type aliases. + return isLegalTypeAliasExpressionForm(decl.node.parent.rightExpression); + } + + function isLegalTypeAliasExpressionForm(node: ExpressionNode): boolean { + switch (node.nodeType) { + case ParseNodeType.Error: + case ParseNodeType.UnaryOperation: + case ParseNodeType.AssignmentExpression: + case ParseNodeType.TypeAnnotation: + case ParseNodeType.Await: + case ParseNodeType.Ternary: + case ParseNodeType.Unpack: + case ParseNodeType.Tuple: + case ParseNodeType.Call: + case ParseNodeType.ListComprehension: + case ParseNodeType.Slice: + case ParseNodeType.Yield: + case ParseNodeType.YieldFrom: + case ParseNodeType.Lambda: + case ParseNodeType.Number: + case ParseNodeType.Dictionary: + case ParseNodeType.List: + case ParseNodeType.Set: + return false; + } + + return true; + } + function printObjectTypeForClass(type: ClassType): string { return TypePrinter.printObjectTypeForClass( type, @@ -23829,16 +26190,23 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions ); } - function printFunctionParts(type: FunctionType): [string[], string] { - return TypePrinter.printFunctionParts(type, evaluatorOptions.printTypeFlags, getFunctionEffectiveReturnType); + function printFunctionParts(type: FunctionType, extraFlags?: TypePrinter.PrintTypeFlags): [string[], string] { + const flags = extraFlags ? evaluatorOptions.printTypeFlags | extraFlags : evaluatorOptions.printTypeFlags; + return TypePrinter.printFunctionParts(type, flags, getFunctionEffectiveReturnType); } - function printType(type: Type, expandTypeAlias = false): string { + function printType(type: Type, options?: PrintTypeOptions): string { let flags = evaluatorOptions.printTypeFlags; - if (expandTypeAlias) { + if (options?.expandTypeAlias) { flags |= TypePrinter.PrintTypeFlags.ExpandTypeAlias; } + if (options?.enforcePythonSyntax) { + flags |= TypePrinter.PrintTypeFlags.PythonSyntax; + } + if (options?.useTypingUnpack) { + flags |= TypePrinter.PrintTypeFlags.UseTypingUnpack; + } return TypePrinter.printType(type, flags, getFunctionEffectiveReturnType); } @@ -23910,9 +26278,20 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions return (range.start.line + 1).toString(); } + function printControlFlowGraph( + flowNode: FlowNode, + reference: CodeFlowReferenceExpressionNode | undefined, + callName: string, + logger: ConsoleInterface + ) { + return codeFlowEngine.printControlFlowGraph(flowNode, reference, callName, logger); + } + const evaluatorInterface: TypeEvaluator = { runWithCancellationToken, getType, + getTypeResult, + getCachedType, getTypeOfExpression, getTypeOfAnnotation, getTypeOfClass, @@ -23979,6 +26358,9 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions verifyTypeArgumentsAssignable, inferReturnTypeIfNecessary, inferTypeParameterVarianceForClass, + isFinalVariable, + isFinalVariableDeclaration, + isExplicitTypeAliasDeclaration, addError, addWarning, addInformation, @@ -23994,6 +26376,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions useSpeculativeMode, setTypeForNode, checkForCancellation, + printControlFlowGraph, }; const codeFlowEngine = getCodeFlowEngine(evaluatorInterface, speculativeTypeTracker); diff --git a/packages/pyright-internal/src/analyzer/typeEvaluatorTypes.ts b/packages/pyright-internal/src/analyzer/typeEvaluatorTypes.ts index 91d4da110..5a80c7721 100644 --- a/packages/pyright-internal/src/analyzer/typeEvaluatorTypes.ts +++ b/packages/pyright-internal/src/analyzer/typeEvaluatorTypes.ts @@ -5,12 +5,12 @@ * Author: Eric Traut * * Abstract interface and other helper types for type evaluator module. - * */ import { CancellationToken } from 'vscode-languageserver-protocol'; import { DiagnosticLevel } from '../common/configOptions'; +import { ConsoleInterface } from '../common/console'; import { Diagnostic, DiagnosticAddendum } from '../common/diagnostic'; import { TextRange } from '../common/textRange'; import { @@ -29,11 +29,13 @@ import { RaiseNode, StringNode, } from '../parser/parseNodes'; -import * as DeclarationUtils from './aliasDeclarationUtils'; import { AnalyzerFileInfo } from './analyzerFileInfo'; +import { CodeFlowReferenceExpressionNode, FlowNode } from './codeFlowTypes'; import { Declaration } from './declaration'; +import * as DeclarationUtils from './declarationUtils'; import { SymbolWithScope } from './scope'; import { Symbol } from './symbol'; +import { PrintTypeFlags } from './typePrinter'; import { ClassType, FunctionParameter, @@ -44,7 +46,7 @@ import { TypeVarType, UnknownType, } from './types'; -import { AssignTypeFlags, ClassMember } from './typeUtils'; +import { AssignTypeFlags, ClassMember, InferenceContext } from './typeUtils'; import { TypeVarContext } from './typeVarContext'; // Maximum number of unioned subtypes for an inferred type (e.g. @@ -69,36 +71,36 @@ export const enum EvaluatorFlags { EvaluateStringLiteralAsType = 1 << 3, // 'Final' is not allowed in this context. - FinalDisallowed = 1 << 4, + DisallowFinal = 1 << 4, // A ParamSpec isn't allowed in this context. - ParamSpecDisallowed = 1 << 5, + DisallowParamSpec = 1 << 5, + + // A TypeVarTuple isn't allowed in this context. + DisallowTypeVarTuple = 1 << 6, // Expression is expected to be a type (class) rather // than an instance (object) - ExpectingType = 1 << 6, + ExpectingType = 1 << 7, - // A TypeVarTuple isn't allowed in this context. - TypeVarTupleDisallowed = 1 << 7, + // A type annotation restricts the types of expressions that are + // allowed. If this flag is set, illegal type expressions are + // flagged as errors. + ExpectingTypeAnnotation = 1 << 8, // Interpret an ellipsis type annotation to mean "Unknown". - ConvertEllipsisToUnknown = 1 << 8, + ConvertEllipsisToUnknown = 1 << 9, // The Generic class type is allowed in this context. It is // normally not allowed if ExpectingType is set. - AllowGenericClassType = 1 << 9, - - // A type annotation restricts the types of expressions that are - // allowed. If this flag is set, illegal type expressions are - // flagged as errors. - ExpectingTypeAnnotation = 1 << 10, + AllowGenericClassType = 1 << 10, // TypeVars within this expression must not refer to type vars - // used in an outer scope that. + // used in an outer scope. DisallowTypeVarsWithScopeId = 1 << 11, // TypeVars within this expression must refer to type vars - // used in an outer scope that. + // used in an outer scope. DisallowTypeVarsWithoutScopeId = 1 << 12, // TypeVars within this expression that are otherwise not @@ -106,15 +108,16 @@ export const enum EvaluatorFlags { // the containing function's scope. AssociateTypeVarsWithCurrentScope = 1 << 13, + // When a new class-scoped TypeVar is used within a class + // declaration, make sure that it is not used to parameterize + // a base class whose TypeVar variance is inconsistent. + EnforceTypeVarVarianceConsistency = 1 << 14, + // Used for PEP 526-style variable type annotations VariableTypeAnnotation = 1 << 15, - // Emit an error if an incomplete recursive type alias is - // used in this context. - DisallowRecursiveTypeAliasPlaceholder = 1 << 16, - // 'ClassVar' is not allowed in this context. - ClassVarDisallowed = 1 << 17, + DisallowClassVar = 1 << 17, // 'Generic' cannot be used without type arguments in this context. DisallowNakedGeneric = 1 << 18, @@ -124,7 +127,7 @@ export const enum EvaluatorFlags { NotParsedByInterpreter = 1 << 19, // Required and NotRequired are allowed in this context. - RequiredAllowed = 1 << 20, + AllowRequired = 1 << 20, // Allow Unpack annotation for a tuple or TypeVarTuple. AllowUnpackedTupleOrTypeVarTuple = 1 << 21, @@ -138,8 +141,8 @@ export const enum EvaluatorFlags { AllowUnpackedTypedDict = 1 << 23, } -export interface TypeResult { - type: Type; +export interface TypeResult { + type: T; // Is the type incomplete (i.e. not fully evaluated) because // some of the paths involve cyclical dependencies? @@ -155,6 +158,9 @@ export interface TypeResult { unpackedType?: Type | undefined; typeList?: TypeResultWithNode[] | undefined; + // For inlined TypedDict definitions. + inlinedTypeDict?: ClassType; + // Type consistency errors detected when evaluating this type. typeErrors?: boolean | undefined; @@ -175,6 +181,9 @@ export interface TypeResult { // Is the type wrapped in a "Required" or "NotRequired" class? isRequired?: boolean; isNotRequired?: boolean; + + // If a call expression, which overloads were used to satisfy it? + overloadsUsedForCall?: FunctionType[]; } export interface TypeResultWithNode extends TypeResult { @@ -185,7 +194,7 @@ export interface EvaluatorUsage { method: 'get' | 'set' | 'del'; // Used only for set methods - setType?: Type | undefined; + setType?: TypeResult | undefined; setErrorNode?: ExpressionNode | undefined; setExpectedTypeDiag?: DiagnosticAddendum | undefined; } @@ -243,6 +252,7 @@ export interface EffectiveTypeResult { includesVariableDecl: boolean; includesIllegalTypeAliasDecl: boolean; isRecursiveDefinition: boolean; + evaluationAttempts?: number; } export interface ValidateArgTypeParams { @@ -265,12 +275,19 @@ export interface AnnotationTypeOptions { associateTypeVarsWithScope?: boolean; allowTypeVarTuple?: boolean; allowParamSpec?: boolean; - disallowRecursiveTypeAlias?: boolean; + allowRequired?: boolean; allowUnpackedTypedDict?: boolean; allowUnpackedTuple?: boolean; notParsedByInterpreter?: boolean; } +export interface ExpectedTypeOptions { + allowFinal?: boolean; + allowRequired?: boolean; + allowUnpackedTuple?: boolean; + allowParamSpec?: boolean; +} + export interface ExpectedTypeResult { type: Type; node: ParseNode; @@ -282,6 +299,14 @@ export interface FunctionResult { isTypeIncomplete: boolean; } +export interface ArgResult { + isCompatible: boolean; + argType: Type; + isTypeIncomplete?: boolean | undefined; + condition?: TypeCondition[]; + skippedOverloadArg?: boolean; +} + export interface CallResult { // Specialized return type of call returnType?: Type | undefined; @@ -292,6 +317,9 @@ export interface CallResult { // Were any errors discovered when evaluating argument types? argumentErrors: boolean; + // Did one or more arguments evaluated to Any or Unknown? + isArgumentAnyOrUnknown?: boolean; + // The parameter associated with the "active" argument (used // for signature help provider) activeParam?: FunctionParameter | undefined; @@ -301,21 +329,38 @@ export interface CallResult { // is used for overloaded constructors where the arguments to the // constructor influence the specialized type of the constructed object. specializedInitSelfType?: Type | undefined; + + // The overload or overloads used to satisfy the call. There can + // be multiple overloads in the case where the call type is a union + // or we have used union expansion for arguments. + overloadsUsedForCall: FunctionType[]; + + // Types of individual arguments. + argResults?: ArgResult[]; +} + +export interface PrintTypeOptions { + expandTypeAlias?: boolean; + enforcePythonSyntax?: boolean; + useTypingUnpack?: boolean; +} + +export interface DeclaredSymbolTypeInfo { + type: Type | undefined; + isTypeAlias?: boolean; } export interface TypeEvaluator { runWithCancellationToken(token: CancellationToken, callback: () => T): T; getType: (node: ExpressionNode) => Type | undefined; - getTypeOfExpression: (node: ExpressionNode, flags?: EvaluatorFlags, expectedType?: Type) => TypeResult; + getTypeResult: (node: ExpressionNode) => TypeResult | undefined; + getCachedType: (node: ExpressionNode) => Type | undefined; + getTypeOfExpression: (node: ExpressionNode, flags?: EvaluatorFlags, context?: InferenceContext) => TypeResult; getTypeOfAnnotation: (node: ExpressionNode, options?: AnnotationTypeOptions) => Type; getTypeOfClass: (node: ClassNode) => ClassTypeResult | undefined; getTypeOfFunction: (node: FunctionNode) => FunctionTypeResult | undefined; - getTypeOfExpressionExpectingType: ( - node: ExpressionNode, - allowFinal?: boolean, - allowRequired?: boolean - ) => TypeResult; + getTypeOfExpressionExpectingType: (node: ExpressionNode, options?: ExpectedTypeOptions) => TypeResult; evaluateTypeForSubnode: (subnode: ParseNode, callback: () => void) => TypeResult | undefined; evaluateTypesForStatement: (node: ParseNode) => void; evaluateTypesForMatchStatement: (node: MatchNode) => void; @@ -334,10 +379,10 @@ export interface TypeEvaluator { validateOverloadedFunctionArguments: ( errorNode: ExpressionNode, argList: FunctionArgument[], - type: OverloadedFunctionType, + typeResult: TypeResult, typeVarContext: TypeVarContext | undefined, skipUnknownArgCheck: boolean, - expectedType: Type | undefined + inferenceContext: InferenceContext | undefined ) => CallResult; isAfterNodeReachable: (node: ParseNode) => boolean; @@ -347,7 +392,7 @@ export interface TypeEvaluator { getDeclarationsForStringNode: (node: StringNode) => Declaration[] | undefined; getDeclarationsForNameNode: (node: NameNode, skipUnreachableCode?: boolean) => Declaration[] | undefined; - getTypeForDeclaration: (declaration: Declaration) => Type | undefined; + getTypeForDeclaration: (declaration: Declaration) => DeclaredSymbolTypeInfo; resolveAliasDeclaration: ( declaration: Declaration, resolveLocalNames: boolean, @@ -358,20 +403,28 @@ export interface TypeEvaluator { resolveLocalNames: boolean, allowExternallyHiddenAccess?: boolean ) => DeclarationUtils.ResolvedAliasInfo | undefined; - getTypeOfIterable: (type: Type, isAsync: boolean, errorNode: ExpressionNode | undefined) => Type | undefined; - getTypeOfIterator: (type: Type, isAsync: boolean, errorNode: ExpressionNode | undefined) => Type | undefined; + getTypeOfIterable: ( + typeResult: TypeResult, + isAsync: boolean, + errorNode: ExpressionNode | undefined + ) => TypeResult | undefined; + getTypeOfIterator: ( + typeResult: TypeResult, + isAsync: boolean, + errorNode: ExpressionNode | undefined + ) => TypeResult | undefined; getGetterTypeFromProperty: (propertyClass: ClassType, inferTypeIfNeeded: boolean) => Type | undefined; getTypeOfArgument: (arg: FunctionArgument) => TypeResult; markNamesAccessed: (node: ParseNode, names: string[]) => void; getScopeIdForNode: (node: ParseNode) => string; - makeTopLevelTypeVarsConcrete: (type: Type) => Type; + makeTopLevelTypeVarsConcrete: (type: Type, makeParamSpecsConcrete?: boolean) => Type; mapSubtypesExpandTypeVars: ( type: Type, conditionFilter: TypeCondition[] | undefined, callback: (expandedSubtype: Type, unexpandedSubtype: Type) => Type | undefined ) => Type; lookUpSymbolRecursive: (node: ParseNode, name: string, honorCodeFlow: boolean) => SymbolWithScope | undefined; - getDeclaredTypeOfSymbol: (symbol: Symbol) => Type | undefined; + getDeclaredTypeOfSymbol: (symbol: Symbol) => DeclaredSymbolTypeInfo; getEffectiveTypeOfSymbol: (symbol: Symbol) => Type; getEffectiveTypeOfSymbolForUsage: ( symbol: Symbol, @@ -384,7 +437,7 @@ export interface TypeEvaluator { getFunctionInferredReturnType: (type: FunctionType, args?: ValidateArgTypeParams[]) => Type; getBestOverloadForArguments: ( errorNode: ExpressionNode, - type: OverloadedFunctionType, + typeResult: TypeResult, argList: FunctionArgument[] ) => FunctionType | undefined; getBuiltInType: (node: ParseNode, name: string) => Type; @@ -401,7 +454,7 @@ export interface TypeEvaluator { args: TypeResult[], magicMethodName: string, errorNode: ExpressionNode, - expectedType: Type | undefined + inferenceContext: InferenceContext | undefined ) => Type | undefined; bindFunctionToClassOrObject: ( baseType: ClassType | undefined, @@ -454,6 +507,11 @@ export interface TypeEvaluator { flags: AssignTypeFlags, recursionCount: number ) => boolean; + + isFinalVariable: (symbol: Symbol) => boolean; + isFinalVariableDeclaration: (decl: Declaration) => boolean; + isExplicitTypeAliasDeclaration: (decl: Declaration) => boolean; + addError: (message: string, node: ParseNode) => Diagnostic | undefined; addWarning: (message: string, node: ParseNode) => Diagnostic | undefined; addInformation: (message: string, node: ParseNode) => Diagnostic | undefined; @@ -465,7 +523,8 @@ export interface TypeEvaluator { diagLevel: DiagnosticLevel, rule: string, message: string, - node: ParseNode + node: ParseNode, + range?: TextRange ) => Diagnostic | undefined; addDiagnosticForTextRange: ( fileInfo: AnalyzerFileInfo, @@ -475,8 +534,8 @@ export interface TypeEvaluator { range: TextRange ) => Diagnostic | undefined; - printType: (type: Type, expandTypeAlias?: boolean) => string; - printFunctionParts: (type: FunctionType) => [string[], string]; + printType: (type: Type, options?: PrintTypeOptions) => string; + printFunctionParts: (type: FunctionType, extraFlags?: PrintTypeFlags) => [string[], string]; getTypeCacheEntryCount: () => number; disposeEvaluator: () => void; @@ -484,4 +543,10 @@ export interface TypeEvaluator { setTypeForNode: (node: ParseNode, type?: Type, flags?: EvaluatorFlags) => void; checkForCancellation: () => void; + printControlFlowGraph: ( + flowNode: FlowNode, + reference: CodeFlowReferenceExpressionNode | undefined, + callName: string, + logger: ConsoleInterface + ) => void; } diff --git a/packages/pyright-internal/src/analyzer/typeEvaluatorWithTracker.ts b/packages/pyright-internal/src/analyzer/typeEvaluatorWithTracker.ts index 118c5d3da..a0b3064f2 100644 --- a/packages/pyright-internal/src/analyzer/typeEvaluatorWithTracker.ts +++ b/packages/pyright-internal/src/analyzer/typeEvaluatorWithTracker.ts @@ -5,18 +5,16 @@ * Licensed under the MIT license. * Author: Eric Traut * - * This wraps real type evaluator to track performance information such - * as which type inferring takes most of time, what files are read most of times - * and etc. + * Wraps type evaluator to track performance of internal calls. */ +import { LogLevel } from '../common/console'; import { isDebugMode } from '../common/core'; import { LogTracker } from '../common/logTracker'; import { timingStats } from '../common/timing'; import { ImportLookup } from './analyzerFileInfo'; -import { PrintableType, TracePrinter } from './tracePrinter'; +import { TracePrinter } from './tracePrinter'; import { createTypeEvaluator, EvaluatorOptions } from './typeEvaluator'; -import { TypeEvaluator } from './typeEvaluatorTypes'; // We don't want to track calls from the type evaluator itself, but only entry points. export function createTypeEvaluatorWithTracker( @@ -25,141 +23,46 @@ export function createTypeEvaluatorWithTracker( logger: LogTracker, printer?: TracePrinter ) { - if (!evaluatorOptions.logCalls && isDebugMode()) { - return createTypeEvaluator(importLookup, evaluatorOptions); + function wrapWithLogger any>(func: T): (...args: Parameters) => ReturnType { + // Wrap the function only if told to do so and the log level is high + // enough for it to log something. + if (evaluatorOptions.logCalls && logger.logLevel === LogLevel.Log) { + return (...args: Parameters): ReturnType => { + return logger.log( + func.name, + (s) => { + if (func.name === 'importLookup' && args.length > 0) { + // This is actually a filename, so special case it. + s.add(printer?.printFileOrModuleName(args[0])); + } else { + // Print all parameters. + args.forEach((a) => { + s.add(printer?.print(a)); + }); + } + return timingStats.typeEvaluationTime.timeOperation(func, ...args); + }, + evaluatorOptions.minimumLoggingThreshold, + /* logParsingPerf */ true + ); + }; + } else if (!isDebugMode()) { + return timingStats.typeEvaluationTime.timeOperation.bind(timingStats.typeEvaluationTime, func); + } else { + return func; + } } - function run(title: string, callback: () => T, value?: PrintableType): T { - return evaluatorOptions.logCalls - ? logger.log( - title, - (s) => { - s.add(printer?.print(value)); - return timingStats.typeEvaluationTime.timeOperation(callback); - }, - evaluatorOptions.minimumLoggingThreshold, - true - ) - : timingStats.typeEvaluationTime.timeOperation(callback); - } - - const lookup: ImportLookup = evaluatorOptions.logCalls - ? (filePath) => - logger.log( - 'import lookup', - (s) => { - s.add(printer?.printFileOrModuleName(filePath)); - return importLookup(filePath); - }, - evaluatorOptions.minimumLoggingThreshold, - true - ) - : importLookup; - - const typeEvaluator = createTypeEvaluator(lookup, evaluatorOptions); - - const withTracker: TypeEvaluator = { - runWithCancellationToken: typeEvaluator.runWithCancellationToken, - getType: (n) => run('getType', () => typeEvaluator.getType(n), n), - getTypeOfExpression: (n, f, e) => - run('getTypeOfExpression', () => typeEvaluator.getTypeOfExpression(n, f, e), n), - getTypeOfAnnotation: typeEvaluator.getTypeOfAnnotation, - getTypeOfClass: (n) => run('getTypeOfClass', () => typeEvaluator.getTypeOfClass(n), n), - getTypeOfFunction: (n) => run('getTypeOfFunction', () => typeEvaluator.getTypeOfFunction(n), n), - getTypeOfExpressionExpectingType: typeEvaluator.getTypeOfExpressionExpectingType, - evaluateTypeForSubnode: typeEvaluator.evaluateTypeForSubnode, - evaluateTypesForStatement: (n) => - run('evaluateTypesForStatement', () => typeEvaluator.evaluateTypesForStatement(n), n), - evaluateTypesForMatchStatement: typeEvaluator.evaluateTypesForMatchStatement, - evaluateTypesForCaseStatement: typeEvaluator.evaluateTypesForCaseStatement, - evaluateTypeOfParameter: typeEvaluator.evaluateTypeOfParameter, - canBeTruthy: typeEvaluator.canBeTruthy, - canBeFalsy: typeEvaluator.canBeFalsy, - stripLiteralValue: typeEvaluator.stripLiteralValue, - removeTruthinessFromType: typeEvaluator.removeTruthinessFromType, - removeFalsinessFromType: typeEvaluator.removeFalsinessFromType, - getExpectedType: (n) => run('getExpectedType', () => typeEvaluator.getExpectedType(n), n), - verifyRaiseExceptionType: (n) => - run('verifyRaiseExceptionType', () => typeEvaluator.verifyRaiseExceptionType(n), n), - verifyDeleteExpression: (n) => run('verifyDeleteExpression', () => typeEvaluator.verifyDeleteExpression(n), n), - validateOverloadedFunctionArguments: typeEvaluator.validateOverloadedFunctionArguments, - isAfterNodeReachable: (n) => run('isAfterNodeReachable', () => typeEvaluator.isAfterNodeReachable(n), n), - isNodeReachable: (n, s) => run('isNodeReachable', () => typeEvaluator.isNodeReachable(n, s), n), - isAsymmetricDescriptorAssignment: typeEvaluator.isAsymmetricDescriptorAssignment, - suppressDiagnostics: (node, callback) => - run('suppressDiagnostics', () => typeEvaluator.suppressDiagnostics(node, callback)), - getDeclarationsForStringNode: (n) => - run('getDeclarationsForStringNode', () => typeEvaluator.getDeclarationsForStringNode(n), n), - getDeclarationsForNameNode: (n, s) => - run('getDeclarationsForNameNode', () => typeEvaluator.getDeclarationsForNameNode(n, s), n), - getTypeForDeclaration: (n) => run('getTypeForDeclaration', () => typeEvaluator.getTypeForDeclaration(n), n), - resolveAliasDeclaration: (d, l, h) => - run('resolveAliasDeclaration', () => typeEvaluator.resolveAliasDeclaration(d, l, h), d), - resolveAliasDeclarationWithInfo: (d, l, h) => - run('resolveAliasDeclarationWithInfo', () => typeEvaluator.resolveAliasDeclarationWithInfo(d, l, h), d), - getTypeOfIterable: (t, a, e) => run('getTypeOfIterable', () => typeEvaluator.getTypeOfIterable(t, a, e), t), - getTypeOfIterator: (t, a, e) => run('getTypeOfIterator', () => typeEvaluator.getTypeOfIterator(t, a, e), t), - getGetterTypeFromProperty: (p, i) => - run('getGetterTypeFromProperty', () => typeEvaluator.getGetterTypeFromProperty(p, i), p), - getTypeOfArgument: typeEvaluator.getTypeOfArgument, - markNamesAccessed: (n, a) => run('markNamesAccessed', () => typeEvaluator.markNamesAccessed(n, a), n), - getScopeIdForNode: typeEvaluator.getScopeIdForNode, - makeTopLevelTypeVarsConcrete: (t) => - run('makeTopLevelTypeVarsConcrete', () => typeEvaluator.makeTopLevelTypeVarsConcrete(t), t), - mapSubtypesExpandTypeVars: typeEvaluator.mapSubtypesExpandTypeVars, - lookUpSymbolRecursive: typeEvaluator.lookUpSymbolRecursive, - getDeclaredTypeOfSymbol: typeEvaluator.getDeclaredTypeOfSymbol, - getEffectiveTypeOfSymbol: (s) => - run('getEffectiveTypeOfSymbol', () => typeEvaluator.getEffectiveTypeOfSymbol(s), s), - getEffectiveTypeOfSymbolForUsage: (s, u, d) => - run('getEffectiveTypeOfSymbolForUsage', () => typeEvaluator.getEffectiveTypeOfSymbolForUsage(s, u, d), s), - getInferredTypeOfDeclaration: typeEvaluator.getInferredTypeOfDeclaration, - getDeclaredTypeForExpression: typeEvaluator.getDeclaredTypeForExpression, - getFunctionDeclaredReturnType: (n) => - run('getFunctionDeclaredReturnType', () => typeEvaluator.getFunctionDeclaredReturnType(n), n), - getFunctionInferredReturnType: (t, a) => - run('getFunctionInferredReturnType', () => typeEvaluator.getFunctionInferredReturnType(t, a), t), - getBestOverloadForArguments: (e, t, a) => typeEvaluator.getBestOverloadForArguments(e, t, a), - getBuiltInType: (n, b) => run('getBuiltInType', () => typeEvaluator.getBuiltInType(n, b), n), - getTypeOfMember: (m) => run('getTypeOfMember', () => typeEvaluator.getTypeOfMember(m), m.symbol), - getTypeOfObjectMember: typeEvaluator.getTypeOfObjectMember, - getBoundMethod: typeEvaluator.getBoundMethod, - getTypeOfMagicMethodReturn: typeEvaluator.getTypeOfMagicMethodReturn, - bindFunctionToClassOrObject: typeEvaluator.bindFunctionToClassOrObject, - getCallSignatureInfo: (n, i, a) => - run('getCallSignatureInfo', () => typeEvaluator.getCallSignatureInfo(n, i, a), n), - getAbstractMethods: (c) => run('getAbstractMethods', () => typeEvaluator.getAbstractMethods(c), c), - narrowConstrainedTypeVar: typeEvaluator.narrowConstrainedTypeVar, - assignType: (d, s, a, dc, sc, f, r) => - run('assignType', () => typeEvaluator.assignType(d, s, a, dc, sc, f, r), d), - validateOverrideMethod: (b, o, d, e) => - run('validateOverrideMethod', () => typeEvaluator.validateOverrideMethod(b, o, d, e), o), - assignTypeToExpression: typeEvaluator.assignTypeToExpression, - assignClassToSelf: typeEvaluator.assignClassToSelf, - getBuiltInObject: typeEvaluator.getBuiltInObject, - getTypedDictClassType: typeEvaluator.getTypedDictClassType, - getTupleClassType: typeEvaluator.getTupleClassType, - getObjectType: typeEvaluator.getObjectType, - getTypingType: typeEvaluator.getTypingType, - inferReturnTypeIfNecessary: typeEvaluator.inferReturnTypeIfNecessary, - inferTypeParameterVarianceForClass: typeEvaluator.inferTypeParameterVarianceForClass, - verifyTypeArgumentsAssignable: typeEvaluator.verifyTypeArgumentsAssignable, - addError: typeEvaluator.addError, - addWarning: typeEvaluator.addWarning, - addInformation: typeEvaluator.addInformation, - addUnusedCode: typeEvaluator.addUnusedCode, - addUnreachableCode: typeEvaluator.addUnreachableCode, - addDeprecated: typeEvaluator.addDeprecated, - addDiagnostic: typeEvaluator.addDiagnostic, - addDiagnosticForTextRange: typeEvaluator.addDiagnosticForTextRange, - printType: (t, e) => run('printType', () => typeEvaluator.printType(t, e), t), - printFunctionParts: (t) => run('printFunctionParts', () => typeEvaluator.printFunctionParts(t), t), - getTypeCacheEntryCount: typeEvaluator.getTypeCacheEntryCount, - disposeEvaluator: typeEvaluator.disposeEvaluator, - useSpeculativeMode: typeEvaluator.useSpeculativeMode, - setTypeForNode: typeEvaluator.setTypeForNode, - checkForCancellation: typeEvaluator.checkForCancellation, - }; + // Wrap all functions with either a logger or a timer. + importLookup = wrapWithLogger(importLookup); + const evaluator = createTypeEvaluator(importLookup, evaluatorOptions); + const keys = Object.keys(evaluator); + keys.forEach((k) => { + const entry = (evaluator as any)[k]; + if (typeof entry === 'function') { + (evaluator as any)[k] = wrapWithLogger(entry); + } + }); - return withTracker; + return evaluator; } diff --git a/packages/pyright-internal/src/analyzer/typeGuards.ts b/packages/pyright-internal/src/analyzer/typeGuards.ts index 009bdfc98..46110d5a6 100644 --- a/packages/pyright-internal/src/analyzer/typeGuards.ts +++ b/packages/pyright-internal/src/analyzer/typeGuards.ts @@ -29,6 +29,7 @@ import { getScopeForNode } from './scopeUtils'; import { Symbol, SymbolFlags } from './symbol'; import { getTypedDictMembersForClass } from './typedDicts'; import { EvaluatorFlags, TypeEvaluator } from './typeEvaluatorTypes'; +import { EnumLiteral } from './types'; import { ClassType, ClassTypeFlags, @@ -83,7 +84,12 @@ import { } from './typeUtils'; import { TypeVarContext } from './typeVarContext'; -export type TypeNarrowingCallback = (type: Type) => Type | undefined; +export interface TypeNarrowingResult { + type: Type; + isIncomplete: boolean; +} + +export type TypeNarrowingCallback = (type: Type) => TypeNarrowingResult | undefined; // Given a reference expression and a test expression, returns a callback that // can be used to narrow the type described by the reference expression. @@ -140,7 +146,7 @@ export function getTypeNarrowingCallback( if (ParseTreeUtils.isMatchingExpression(reference, leftExpression)) { return (type: Type) => { - return narrowTypeForIsNone(evaluator, type, adjIsPositiveTest); + return { type: narrowTypeForIsNone(evaluator, type, adjIsPositiveTest), isIncomplete: false }; }; } @@ -158,14 +164,36 @@ export function getTypeNarrowingCallback( const indexValue = leftExpression.items[0].valueExpression.value; if (typeof indexValue === 'number') { return (type: Type) => { - return narrowTupleTypeForIsNone(evaluator, type, adjIsPositiveTest, indexValue); + return { + type: narrowTupleTypeForIsNone(evaluator, type, adjIsPositiveTest, indexValue), + isIncomplete: false, + }; }; } } } - // Look for "type(X) is Y" or "type(X) is not Y". - if (isOrIsNotOperator && testExpression.leftExpression.nodeType === ParseNodeType.Call) { + // Look for "X is ...", "X is not ...", "X == ...", and "X != ...". + if (testExpression.rightExpression.nodeType === ParseNodeType.Ellipsis) { + // Allow the LHS to be either a simple expression or an assignment + // expression that assigns to a simple name. + let leftExpression = testExpression.leftExpression; + if (leftExpression.nodeType === ParseNodeType.AssignmentExpression) { + leftExpression = leftExpression.name; + } + + if (ParseTreeUtils.isMatchingExpression(reference, leftExpression)) { + return (type: Type) => { + return { + type: narrowTypeForIsEllipsis(evaluator, type, adjIsPositiveTest), + isIncomplete: false, + }; + }; + } + } + + // Look for "type(X) is Y", "type(X) is not Y", "type(X) == Y" or "type(X) != Y". + if (testExpression.leftExpression.nodeType === ParseNodeType.Call) { if ( testExpression.leftExpression.arguments.length === 1 && testExpression.leftExpression.arguments[0].argumentCategory === ArgumentCategory.Simple @@ -178,13 +206,15 @@ export function getTypeNarrowingCallback( ).type; if (isInstantiableClass(callType) && ClassType.isBuiltIn(callType, 'type')) { - const classType = evaluator.makeTopLevelTypeVarsConcrete( - evaluator.getTypeOfExpression(testExpression.rightExpression).type - ); + const classTypeResult = evaluator.getTypeOfExpression(testExpression.rightExpression); + const classType = evaluator.makeTopLevelTypeVarsConcrete(classTypeResult.type); if (isInstantiableClass(classType)) { return (type: Type) => { - return narrowTypeForTypeIs(type, classType, adjIsPositiveTest); + return { + type: narrowTypeForTypeIs(evaluator, type, classType, adjIsPositiveTest), + isIncomplete: !!classTypeResult.isIncomplete, + }; }; } } @@ -195,23 +225,90 @@ export function getTypeNarrowingCallback( // Look for "X is Y" or "X is not Y" where Y is a an enum or bool literal. if (isOrIsNotOperator) { if (ParseTreeUtils.isMatchingExpression(reference, testExpression.leftExpression)) { - const rightType = evaluator.getTypeOfExpression(testExpression.rightExpression).type; + const rightTypeResult = evaluator.getTypeOfExpression(testExpression.rightExpression); + const rightType = rightTypeResult.type; + if ( isClassInstance(rightType) && (ClassType.isEnumClass(rightType) || ClassType.isBuiltIn(rightType, 'bool')) && rightType.literalValue !== undefined ) { return (type: Type) => { - return narrowTypeForLiteralComparison( - evaluator, - type, - rightType, - adjIsPositiveTest, - /* isIsOperator */ true - ); + return { + type: narrowTypeForLiteralComparison( + evaluator, + type, + rightType, + adjIsPositiveTest, + /* isIsOperator */ true + ), + isIncomplete: !!rightTypeResult.isIncomplete, + }; }; } } + + // Look for X[] is or X[] is not + if ( + testExpression.leftExpression.nodeType === ParseNodeType.Index && + testExpression.leftExpression.items.length === 1 && + !testExpression.leftExpression.trailingComma && + testExpression.leftExpression.items[0].argumentCategory === ArgumentCategory.Simple && + ParseTreeUtils.isMatchingExpression(reference, testExpression.leftExpression.baseExpression) + ) { + const indexTypeResult = evaluator.getTypeOfExpression( + testExpression.leftExpression.items[0].valueExpression + ); + const indexType = indexTypeResult.type; + + if (isClassInstance(indexType) && isLiteralType(indexType)) { + if (ClassType.isBuiltIn(indexType, 'str')) { + const rightType = evaluator.getTypeOfExpression(testExpression.rightExpression).type; + if (isClassInstance(rightType) && rightType.literalValue !== undefined) { + return (type: Type) => { + return { + type: narrowTypeForDiscriminatedDictEntryComparison( + evaluator, + type, + indexType, + rightType, + adjIsPositiveTest + ), + isIncomplete: !!indexTypeResult.isIncomplete, + }; + }; + } + } else if (ClassType.isBuiltIn(indexType, 'int')) { + const rightTypeResult = evaluator.getTypeOfExpression(testExpression.rightExpression); + const rightType = rightTypeResult.type; + + if (isClassInstance(rightType) && rightType.literalValue !== undefined) { + let canNarrow = false; + // Narrowing can be applied only for bool or enum literals. + if (ClassType.isBuiltIn(rightType, 'bool')) { + canNarrow = true; + } else if (rightType.literalValue instanceof EnumLiteral) { + canNarrow = true; + } + + if (canNarrow) { + return (type: Type) => { + return { + type: narrowTypeForDiscriminatedTupleComparison( + evaluator, + type, + indexType, + rightType, + adjIsPositiveTest + ), + isIncomplete: !!rightTypeResult.isIncomplete, + }; + }; + } + } + } + } + } } if (equalsOrNotEqualsOperator) { @@ -220,32 +317,21 @@ export function getTypeNarrowingCallback( testExpression.operator === OperatorType.Equals ? isPositiveTest : !isPositiveTest; if (ParseTreeUtils.isMatchingExpression(reference, testExpression.leftExpression)) { - const rightType = evaluator.getTypeOfExpression(testExpression.rightExpression).type; - if (isClassInstance(rightType) && rightType.literalValue !== undefined) { - return (type: Type) => { - return narrowTypeForLiteralComparison( - evaluator, - type, - rightType, - adjIsPositiveTest, - /* isIsOperator */ false - ); - }; - } - } + const rightTypeResult = evaluator.getTypeOfExpression(testExpression.rightExpression); + const rightType = rightTypeResult.type; - // Look for == X or != X - if (ParseTreeUtils.isMatchingExpression(reference, testExpression.rightExpression)) { - const leftType = evaluator.getTypeOfExpression(testExpression.leftExpression).type; - if (isClassInstance(leftType) && leftType.literalValue !== undefined) { + if (isClassInstance(rightType) && rightType.literalValue !== undefined) { return (type: Type) => { - return narrowTypeForLiteralComparison( - evaluator, - type, - leftType, - adjIsPositiveTest, - /* isIsOperator */ false - ); + return { + type: narrowTypeForLiteralComparison( + evaluator, + type, + rightType, + adjIsPositiveTest, + /* isIsOperator */ false + ), + isIncomplete: !!rightTypeResult.isIncomplete, + }; }; } } @@ -258,35 +344,44 @@ export function getTypeNarrowingCallback( testExpression.leftExpression.items[0].argumentCategory === ArgumentCategory.Simple && ParseTreeUtils.isMatchingExpression(reference, testExpression.leftExpression.baseExpression) ) { - const indexType = evaluator.getTypeOfExpression( + const indexTypeResult = evaluator.getTypeOfExpression( testExpression.leftExpression.items[0].valueExpression - ).type; + ); + const indexType = indexTypeResult.type; if (isClassInstance(indexType) && isLiteralType(indexType)) { if (ClassType.isBuiltIn(indexType, 'str')) { const rightType = evaluator.getTypeOfExpression(testExpression.rightExpression).type; if (isClassInstance(rightType) && rightType.literalValue !== undefined) { return (type: Type) => { - return narrowTypeForDiscriminatedDictEntryComparison( - evaluator, - type, - indexType, - rightType, - adjIsPositiveTest - ); + return { + type: narrowTypeForDiscriminatedDictEntryComparison( + evaluator, + type, + indexType, + rightType, + adjIsPositiveTest + ), + isIncomplete: !!indexTypeResult.isIncomplete, + }; }; } } else if (ClassType.isBuiltIn(indexType, 'int')) { - const rightType = evaluator.getTypeOfExpression(testExpression.rightExpression).type; + const rightTypeResult = evaluator.getTypeOfExpression(testExpression.rightExpression); + const rightType = rightTypeResult.type; + if (isClassInstance(rightType) && rightType.literalValue !== undefined) { return (type: Type) => { - return narrowTypeForDiscriminatedTupleComparison( - evaluator, - type, - indexType, - rightType, - adjIsPositiveTest - ); + return { + type: narrowTypeForDiscriminatedTupleComparison( + evaluator, + type, + indexType, + rightType, + adjIsPositiveTest + ), + isIncomplete: !!rightTypeResult.isIncomplete, + }; }; } } @@ -305,17 +400,21 @@ export function getTypeNarrowingCallback( const arg0Expr = testExpression.leftExpression.arguments[0].valueExpression; if (ParseTreeUtils.isMatchingExpression(reference, arg0Expr)) { - const callType = evaluator.getTypeOfExpression( + const callTypeResult = evaluator.getTypeOfExpression( testExpression.leftExpression.leftExpression, EvaluatorFlags.DoNotSpecialize - ).type; + ); + const callType = callTypeResult.type; if (isFunction(callType) && callType.details.fullName === 'builtins.len') { const tupleLength = testExpression.rightExpression.value; if (typeof tupleLength === 'number') { return (type: Type) => { - return narrowTypeForTupleLength(evaluator, type, tupleLength, adjIsPositiveTest); + return { + type: narrowTypeForTupleLength(evaluator, type, tupleLength, adjIsPositiveTest), + isIncomplete: !!callTypeResult.isIncomplete, + }; }; } } @@ -328,17 +427,22 @@ export function getTypeNarrowingCallback( testExpression.leftExpression.nodeType === ParseNodeType.MemberAccess && ParseTreeUtils.isMatchingExpression(reference, testExpression.leftExpression.leftExpression) ) { - const rightType = evaluator.getTypeOfExpression(testExpression.rightExpression).type; + const rightTypeResult = evaluator.getTypeOfExpression(testExpression.rightExpression); + const rightType = rightTypeResult.type; const memberName = testExpression.leftExpression.memberName; + if (isClassInstance(rightType) && rightType.literalValue !== undefined) { return (type: Type) => { - return narrowTypeForDiscriminatedLiteralFieldComparison( - evaluator, - type, - memberName.value, - rightType, - adjIsPositiveTest - ); + return { + type: narrowTypeForDiscriminatedLiteralFieldComparison( + evaluator, + type, + memberName.value, + rightType, + adjIsPositiveTest + ), + isIncomplete: !!rightTypeResult.isIncomplete, + }; }; } } @@ -349,21 +453,26 @@ export function getTypeNarrowingCallback( testExpression.leftExpression.nodeType === ParseNodeType.MemberAccess && ParseTreeUtils.isMatchingExpression(reference, testExpression.leftExpression.leftExpression) ) { - const rightType = evaluator.getTypeOfExpression(testExpression.rightExpression).type; + const rightTypeResult = evaluator.getTypeOfExpression(testExpression.rightExpression); + const rightType = rightTypeResult.type; const memberName = testExpression.leftExpression.memberName; + if ( isClassInstance(rightType) && (ClassType.isEnumClass(rightType) || ClassType.isBuiltIn(rightType, 'bool')) && rightType.literalValue !== undefined ) { return (type: Type) => { - return narrowTypeForDiscriminatedLiteralFieldComparison( - evaluator, - type, - memberName.value, - rightType, - adjIsPositiveTest - ); + return { + type: narrowTypeForDiscriminatedLiteralFieldComparison( + evaluator, + type, + memberName.value, + rightType, + adjIsPositiveTest + ), + isIncomplete: !!rightTypeResult.isIncomplete, + }; }; } } @@ -378,12 +487,15 @@ export function getTypeNarrowingCallback( ) { const memberName = testExpression.leftExpression.memberName; return (type: Type) => { - return narrowTypeForDiscriminatedFieldNoneComparison( - evaluator, - type, - memberName.value, - adjIsPositiveTest - ); + return { + type: narrowTypeForDiscriminatedFieldNoneComparison( + evaluator, + type, + memberName.value, + adjIsPositiveTest + ), + isIncomplete: false, + }; }; } } @@ -391,31 +503,38 @@ export function getTypeNarrowingCallback( if (testExpression.operator === OperatorType.In || testExpression.operator === OperatorType.NotIn) { // Look for "x in y" or "x not in y" where y is one of several built-in types. if (ParseTreeUtils.isMatchingExpression(reference, testExpression.leftExpression)) { - const rightType = evaluator.getTypeOfExpression(testExpression.rightExpression).type; + const rightTypeResult = evaluator.getTypeOfExpression(testExpression.rightExpression); + const rightType = rightTypeResult.type; const adjIsPositiveTest = testExpression.operator === OperatorType.In ? isPositiveTest : !isPositiveTest; - if (adjIsPositiveTest) { - return (type: Type) => { - return narrowTypeForContainerType(evaluator, type, rightType); + return (type: Type) => { + return { + type: narrowTypeForContainerType(evaluator, type, rightType, adjIsPositiveTest), + isIncomplete: !!rightTypeResult.isIncomplete, }; - } + }; } if (ParseTreeUtils.isMatchingExpression(reference, testExpression.rightExpression)) { // Look for in y where y is a union that contains // one or more TypedDicts. - const leftType = evaluator.getTypeOfExpression(testExpression.leftExpression).type; + const leftTypeResult = evaluator.getTypeOfExpression(testExpression.leftExpression); + const leftType = leftTypeResult.type; + if (isClassInstance(leftType) && ClassType.isBuiltIn(leftType, 'str') && isLiteralType(leftType)) { const adjIsPositiveTest = testExpression.operator === OperatorType.In ? isPositiveTest : !isPositiveTest; return (type: Type) => { - return narrowTypeForTypedDictKey( - evaluator, - type, - ClassType.cloneAsInstantiable(leftType), - adjIsPositiveTest - ); + return { + type: narrowTypeForTypedDictKey( + evaluator, + type, + ClassType.cloneAsInstantiable(leftType), + adjIsPositiveTest + ), + isIncomplete: !!leftTypeResult.isIncomplete, + }; }; } } @@ -430,25 +549,29 @@ export function getTypeNarrowingCallback( // of valid class types. const arg0Expr = testExpression.arguments[0].valueExpression; const arg1Expr = testExpression.arguments[1].valueExpression; + if (ParseTreeUtils.isMatchingExpression(reference, arg0Expr)) { - const callType = evaluator.getTypeOfExpression( + const callTypeResult = evaluator.getTypeOfExpression( testExpression.leftExpression, EvaluatorFlags.DoNotSpecialize - ).type; + ); + const callType = callTypeResult.type; if ( isFunction(callType) && (callType.details.builtInName === 'isinstance' || callType.details.builtInName === 'issubclass') ) { const isInstanceCheck = callType.details.builtInName === 'isinstance'; - const arg1Type = evaluator.getTypeOfExpression( + const arg1TypeResult = evaluator.getTypeOfExpression( arg1Expr, EvaluatorFlags.EvaluateStringLiteralAsType | - EvaluatorFlags.ParamSpecDisallowed | - EvaluatorFlags.TypeVarTupleDisallowed - ).type; + EvaluatorFlags.DisallowParamSpec | + EvaluatorFlags.DisallowTypeVarTuple + ); + const arg1Type = arg1TypeResult.type; const classTypeList = getIsInstanceClassTypes(arg1Type); + const isIncomplete = !!callTypeResult.isIncomplete || !!arg1TypeResult.isIncomplete; if (classTypeList) { return (type: Type) => { @@ -462,19 +585,34 @@ export function getTypeNarrowingCallback( testExpression ); if (!isNever(narrowedType)) { - return narrowedType; + return { + type: narrowedType, + isIncomplete, + }; } // Try again with intersection types allowed. - return narrowTypeForIsInstance( - evaluator, + return { + type: narrowTypeForIsInstance( + evaluator, + type, + classTypeList, + isInstanceCheck, + isPositiveTest, + /* allowIntersections */ true, + testExpression + ), + isIncomplete, + }; + }; + } else if (isIncomplete) { + // If the type is incomplete, it may include unknowns, which will result + // in classTypeList being undefined. + return (type: Type) => { + return { type, - classTypeList, - isInstanceCheck, - isPositiveTest, - /* allowIntersections */ true, - testExpression - ); + isIncomplete: true, + }; }; } } @@ -485,10 +623,11 @@ export function getTypeNarrowingCallback( if (testExpression.arguments.length === 1) { const arg0Expr = testExpression.arguments[0].valueExpression; if (ParseTreeUtils.isMatchingExpression(reference, arg0Expr)) { - const callType = evaluator.getTypeOfExpression( + const callTypeResult = evaluator.getTypeOfExpression( testExpression.leftExpression, EvaluatorFlags.DoNotSpecialize - ).type; + ); + const callType = callTypeResult.type; if (isFunction(callType) && callType.details.builtInName === 'callable') { return (type: Type) => { @@ -510,7 +649,7 @@ export function getTypeNarrowingCallback( ); } - return narrowedType; + return { type: narrowedType, isIncomplete: !!callTypeResult.isIncomplete }; }; } } @@ -519,14 +658,18 @@ export function getTypeNarrowingCallback( // Look for "bool(X)" if (testExpression.arguments.length === 1 && !testExpression.arguments[0].name) { if (ParseTreeUtils.isMatchingExpression(reference, testExpression.arguments[0].valueExpression)) { - const callType = evaluator.getTypeOfExpression( + const callTypeResult = evaluator.getTypeOfExpression( testExpression.leftExpression, EvaluatorFlags.DoNotSpecialize - ).type; + ); + const callType = callTypeResult.type; if (isInstantiableClass(callType) && ClassType.isBuiltIn(callType, 'bool')) { return (type: Type) => { - return narrowTypeForTruthiness(evaluator, type, isPositiveTest); + return { + type: narrowTypeForTruthiness(evaluator, type, isPositiveTest), + isIncomplete: !!callTypeResult.isIncomplete, + }; }; } } @@ -547,10 +690,11 @@ export function getTypeNarrowingCallback( ); }; - const callType = evaluator.getTypeOfExpression( + const callTypeResult = evaluator.getTypeOfExpression( testExpression.leftExpression, EvaluatorFlags.DoNotSpecialize - ).type; + ); + const callType = callTypeResult.type; if (isFunction(callType) && isFunctionReturnTypeGuard(callType)) { isPossiblyTypeGuard = true; @@ -559,11 +703,15 @@ export function getTypeNarrowingCallback( OverloadedFunctionType.getOverloads(callType).some((o) => isFunctionReturnTypeGuard(o)) ) { isPossiblyTypeGuard = true; + } else if (isClassInstance(callType)) { + isPossiblyTypeGuard = true; } if (isPossiblyTypeGuard) { // Evaluate the type guard call expression. - const functionReturnType = evaluator.getTypeOfExpression(testExpression).type; + const functionReturnTypeResult = evaluator.getTypeOfExpression(testExpression); + const functionReturnType = functionReturnTypeResult.type; + if ( isClassInstance(functionReturnType) && ClassType.isBuiltIn(functionReturnType, 'bool') && @@ -571,15 +719,19 @@ export function getTypeNarrowingCallback( ) { const isStrictTypeGuard = !!functionReturnType.isStrictTypeGuard; const typeGuardType = functionReturnType.typeGuardType; + const isIncomplete = !!callTypeResult.isIncomplete || !!functionReturnTypeResult.isIncomplete; return (type: Type) => { - return narrowTypeForUserDefinedTypeGuard( - evaluator, - type, - typeGuardType, - isPositiveTest, - isStrictTypeGuard - ); + return { + type: narrowTypeForUserDefinedTypeGuard( + evaluator, + type, + typeGuardType, + isPositiveTest, + isStrictTypeGuard + ), + isIncomplete, + }; }; } } @@ -589,7 +741,10 @@ export function getTypeNarrowingCallback( if (ParseTreeUtils.isMatchingExpression(reference, testExpression)) { return (type: Type) => { - return narrowTypeForTruthiness(evaluator, type, isPositiveTest); + return { + type: narrowTypeForTruthiness(evaluator, type, isPositiveTest), + isIncomplete: false, + }; }; } @@ -878,6 +1033,49 @@ function narrowTypeForIsNone(evaluator: TypeEvaluator, type: Type, isPositiveTes ); } +// Handle type narrowing for expressions of the form "x is ..." and "x is not ...". +function narrowTypeForIsEllipsis(evaluator: TypeEvaluator, type: Type, isPositiveTest: boolean) { + const expandedType = mapSubtypes(type, (subtype) => { + return transformPossibleRecursiveTypeAlias(subtype); + }); + + return evaluator.mapSubtypesExpandTypeVars( + expandedType, + /* conditionFilter */ undefined, + (subtype, unexpandedSubtype) => { + if (isAnyOrUnknown(subtype)) { + // We need to assume that "Any" is always both None and not None, + // so it matches regardless of whether the test is positive or negative. + return subtype; + } + + // If this is a TypeVar that isn't constrained, use the unexpanded + // TypeVar. For all other cases (including constrained TypeVars), + // use the expanded subtype. + const adjustedSubtype = + isTypeVar(unexpandedSubtype) && unexpandedSubtype.details.constraints.length === 0 + ? unexpandedSubtype + : subtype; + + // See if it's a match for object. + if (isClassInstance(subtype) && ClassType.isBuiltIn(subtype, 'object')) { + return isPositiveTest + ? addConditionToType(NoneType.createInstance(), subtype.condition) + : adjustedSubtype; + } + + const isEllipsis = isClassInstance(subtype) && ClassType.isBuiltIn(subtype, 'ellipsis'); + + // See if it's a match for "...". + if (isEllipsis === isPositiveTest) { + return subtype; + } + + return undefined; + } + ); +} + // The "isinstance" and "issubclass" calls support two forms - a simple form // that accepts a single class, and a more complex form that accepts a tuple // of classes (including arbitrarily-nested tuples). This method determines @@ -1093,7 +1291,7 @@ function narrowTypeForIsInstance( specializedFilterType = applySolvedTypeVars( unspecializedFilterType, typeVarContext, - /* unknownIfNotFound */ true + { unknownIfNotFound: true } ) as ClassType; } } @@ -1138,7 +1336,14 @@ function narrowTypeForIsInstance( ]) as ClassType; } - const newClassInstanceType = ClassType.cloneAsInstance(newClassType); + let newClassInstanceType = ClassType.cloneAsInstance(newClassType); + + if (varType.condition) { + newClassInstanceType = addConditionToType( + newClassInstanceType, + varType.condition + ) as ClassType; + } // If this is a issubclass check, we do a double conversion from instantiable // to instance back to instantiable to make sure that the includeSubclasses flag @@ -1302,7 +1507,13 @@ function narrowTypeForIsInstance( if (isInstanceCheck) { if (isNoneInstance(subtype)) { - const containsNoneType = classTypeList.some((t) => isNoneTypeClass(t)); + const containsNoneType = classTypeList.some((t) => { + if (isNoneTypeClass(t)) { + return true; + } + return isInstantiableClass(t) && ClassType.isBuiltIn(t, 'NoneType'); + }); + if (isPositiveTest) { return containsNoneType ? subtype : undefined; } else { @@ -1389,8 +1600,8 @@ function narrowTypeForIsInstance( return combineTypes(anyOrUnknownSubstitutions); } - if (anyOrUnknown.length > 0) { - return combineTypes([filteredType, ...anyOrUnknown]); + if (isNever(filteredType) && anyOrUnknown.length > 0) { + return combineTypes(anyOrUnknown); } return filteredType; @@ -1422,17 +1633,71 @@ function narrowTypeForTupleLength( } // Attempts to narrow a type (make it more constrained) based on an "in" binary operator. -function narrowTypeForContainerType(evaluator: TypeEvaluator, referenceType: Type, containerType: Type) { - const elementType = getElementTypeForContainerNarrowing(containerType); - if (!elementType) { +function narrowTypeForContainerType( + evaluator: TypeEvaluator, + referenceType: Type, + containerType: Type, + isPositiveTest: boolean +) { + if (isPositiveTest) { + const elementType = getElementTypeForContainerNarrowing(containerType); + if (!elementType) { + return referenceType; + } + + return narrowTypeForContainerElementType( + evaluator, + referenceType, + evaluator.makeTopLevelTypeVarsConcrete(elementType) + ); + } + + // Narrowing in the negative case is possible only with tuples + // with a known length. + if ( + !isClassInstance(containerType) || + !ClassType.isBuiltIn(containerType, 'tuple') || + !containerType.tupleTypeArguments + ) { return referenceType; } - return narrowTypeForContainerElementType( - evaluator, - referenceType, - evaluator.makeTopLevelTypeVarsConcrete(elementType) - ); + // Determine which tuple types can be eliminated. Only "None" and + // literal types can be handled here. + const typesToEliminate: Type[] = []; + containerType.tupleTypeArguments.forEach((tupleEntry) => { + if (!tupleEntry.isUnbounded) { + if (isNoneInstance(tupleEntry.type)) { + typesToEliminate.push(tupleEntry.type); + } else if (isClassInstance(tupleEntry.type) && isLiteralType(tupleEntry.type)) { + typesToEliminate.push(tupleEntry.type); + } + } + }); + + if (typesToEliminate.length === 0) { + return referenceType; + } + + return mapSubtypes(referenceType, (referenceSubtype) => { + referenceSubtype = evaluator.makeTopLevelTypeVarsConcrete(referenceSubtype); + if (isClassInstance(referenceSubtype) && referenceSubtype.literalValue === undefined) { + // If we're able to enumerate all possible literal values + // (for bool or enum), we can eliminate all others in a negative test. + const allLiteralTypes = enumerateLiteralsForType(evaluator, referenceSubtype); + if (allLiteralTypes && allLiteralTypes.length > 0) { + return combineTypes( + allLiteralTypes.filter((type) => !typesToEliminate.some((t) => isTypeSame(t, type))) + ); + } + } + + if (typesToEliminate.some((t) => isTypeSame(t, referenceSubtype))) { + return undefined; + } + + return referenceSubtype; + }); } export function getElementTypeForContainerNarrowing(containerType: Type) { @@ -1747,38 +2012,42 @@ function narrowTypeForDiscriminatedFieldNoneComparison( } // Attempts to narrow a type based on a "type(x) is y" or "type(x) is not y" check. -function narrowTypeForTypeIs(type: Type, classType: ClassType, isPositiveTest: boolean) { - return mapSubtypes(type, (subtype) => { - if (isClassInstance(subtype)) { - const matches = ClassType.isDerivedFrom(classType, ClassType.cloneAsInstantiable(subtype)); - if (isPositiveTest) { - if (matches) { - if (ClassType.isSameGenericClass(subtype, classType)) { - return subtype; +function narrowTypeForTypeIs(evaluator: TypeEvaluator, type: Type, classType: ClassType, isPositiveTest: boolean) { + return evaluator.mapSubtypesExpandTypeVars( + type, + /* conditionFilter */ undefined, + (subtype: Type, unexpandedSubtype: Type) => { + if (isClassInstance(subtype)) { + const matches = ClassType.isDerivedFrom(classType, ClassType.cloneAsInstantiable(subtype)); + if (isPositiveTest) { + if (matches) { + if (ClassType.isSameGenericClass(subtype, classType)) { + return subtype; + } + return addConditionToType(ClassType.cloneAsInstance(classType), subtype.condition); } - return ClassType.cloneAsInstance(classType); - } - return undefined; - } else { - // If the class if marked final and it matches, then - // we can eliminate it in the negative case. - if (matches && ClassType.isFinal(subtype)) { return undefined; - } + } else { + // If the class if marked final and it matches, then + // we can eliminate it in the negative case. + if (matches && ClassType.isFinal(subtype)) { + return undefined; + } - // We can't eliminate the subtype in the negative - // case because it could be a subclass of the type, - // in which case `type(x) is y` would fail. - return subtype; + // We can't eliminate the subtype in the negative + // case because it could be a subclass of the type, + // in which case `type(x) is y` would fail. + return subtype; + } + } else if (isNoneInstance(subtype)) { + return isPositiveTest ? undefined : subtype; + } else if (isAnyOrUnknown(subtype)) { + return isPositiveTest ? ClassType.cloneAsInstance(classType) : subtype; } - } else if (isNoneInstance(subtype)) { - return isPositiveTest ? undefined : subtype; - } else if (isAnyOrUnknown(subtype)) { - return isPositiveTest ? ClassType.cloneAsInstance(classType) : subtype; - } - return subtype; - }); + return unexpandedSubtype; + } + ); } // Attempts to narrow a type (make it more constrained) based on a comparison diff --git a/packages/pyright-internal/src/analyzer/typePrinter.ts b/packages/pyright-internal/src/analyzer/typePrinter.ts index 1cbc7b2af..0664b75c2 100644 --- a/packages/pyright-internal/src/analyzer/typePrinter.ts +++ b/packages/pyright-internal/src/analyzer/typePrinter.ts @@ -8,6 +8,7 @@ */ import { ParameterCategory } from '../parser/parseNodes'; +import { isTypedKwargs } from './parameterUtils'; import * as ParseTreeUtils from './parseTreeUtils'; import { ClassType, @@ -64,6 +65,16 @@ export const enum PrintTypeFlags { // Include a parentheses around a callable. ParenthesizeCallable = 1 << 7, + + // Limit output to legal Python syntax. + PythonSyntax = 1 << 8, + + // Use Unpack instead of "*" for unpacked tuples and TypeVarTuples. + // Requires Python 3.11 or newer. + UseTypingUnpack = 1 << 9, + + // Expand TypedDict kwargs to show the keys from the TypedDict instead of **kwargs. + ExpandTypedDictArgs = 1 << 10, } export type FunctionReturnTypeCallback = (type: FunctionType) => Type; @@ -72,12 +83,21 @@ export function printType( type: Type, printTypeFlags: PrintTypeFlags, returnTypeCallback: FunctionReturnTypeCallback, - recursionTypes: Type[] = [] + recursionTypes: Type[] = [], + recursionCount = 0 ): string { + const originalPrintTypeFlags = printTypeFlags; const parenthesizeUnion = (printTypeFlags & PrintTypeFlags.ParenthesizeUnion) !== 0; - const parenthesizeCallable = (printTypeFlags & PrintTypeFlags.ParenthesizeCallable) !== 0; printTypeFlags &= ~(PrintTypeFlags.ParenthesizeUnion | PrintTypeFlags.ParenthesizeCallable); + if (recursionCount > maxTypeRecursionCount) { + if (printTypeFlags & PrintTypeFlags.PythonSyntax) { + return 'Any'; + } + return ''; + } + recursionCount++; + // If this is a type alias, see if we should use its name rather than // the type it represents. if (type.typeAliasInfo) { @@ -124,13 +144,20 @@ export function printType( tupleTypeArg.type, printTypeFlags, returnTypeCallback, - recursionTypes + recursionTypes, + recursionCount ) ); }); } else { argumentStrings!.push( - printType(typeArg, printTypeFlags, returnTypeCallback, recursionTypes) + printType( + typeArg, + printTypeFlags, + returnTypeCallback, + recursionTypes, + recursionCount + ) ); } }); @@ -143,7 +170,13 @@ export function printType( argumentStrings = []; typeParams.forEach((typeParam) => { argumentStrings!.push( - printType(typeParam, printTypeFlags, returnTypeCallback, recursionTypes) + printType( + typeParam, + printTypeFlags, + returnTypeCallback, + recursionTypes, + recursionCount + ) ); }); } @@ -195,7 +228,8 @@ export function printType( type, printTypeFlags & ~PrintTypeFlags.ExpandTypeAlias, returnTypeCallback, - recursionTypes + recursionTypes, + recursionCount ); } finally { recursionTypes.pop(); @@ -208,21 +242,31 @@ export function printType( try { recursionTypes.push(type); - const includeConditionalIndicator = (printTypeFlags & PrintTypeFlags.OmitConditionalConstraint) === 0; + const includeConditionalIndicator = + (printTypeFlags & (PrintTypeFlags.OmitConditionalConstraint | PrintTypeFlags.PythonSyntax)) === 0; const getConditionalIndicator = (subtype: Type) => { return subtype.condition !== undefined && includeConditionalIndicator ? '*' : ''; }; switch (type.category) { case TypeCategory.Unbound: { + if (printTypeFlags & PrintTypeFlags.PythonSyntax) { + return 'Any'; + } return 'Unbound'; } case TypeCategory.Unknown: { - return (printTypeFlags & PrintTypeFlags.PrintUnknownWithAny) !== 0 ? 'Any' : 'Unknown'; + if (printTypeFlags & (PrintTypeFlags.PythonSyntax | PrintTypeFlags.PrintUnknownWithAny)) { + return 'Any'; + } + return 'Unknown'; } case TypeCategory.Module: { + if (printTypeFlags & PrintTypeFlags.PythonSyntax) { + return 'Any'; + } return `Module("${type.moduleName}")`; } @@ -257,27 +301,34 @@ export function printType( } case TypeCategory.Function: { - // If it's a Callable with a ParamSpec, use the - // Callable notation. - const parts = printFunctionParts(type, printTypeFlags, returnTypeCallback, recursionTypes); - const paramSignature = `(${parts[0].join(', ')})`; - if (FunctionType.isParamSpecValue(type)) { - return paramSignature; - } - const fullSignature = `${paramSignature} -> ${parts[1]}`; - - if (parenthesizeCallable) { - return `(${fullSignature})`; + if (TypeBase.isInstantiable(type)) { + const typeString = printFunctionType( + TypeBase.cloneTypeAsInstance(type), + printTypeFlags, + returnTypeCallback, + recursionTypes, + recursionCount + ); + return `Type[${typeString}]`; } - return fullSignature; + return printFunctionType( + type, + originalPrintTypeFlags, + returnTypeCallback, + recursionTypes, + recursionCount + ); } case TypeCategory.OverloadedFunction: { const overloadedType = type; const overloads = overloadedType.overloads.map((overload) => - printType(overload, printTypeFlags, returnTypeCallback, recursionTypes) + printType(overload, printTypeFlags, returnTypeCallback, recursionTypes, recursionCount) ); + if (printTypeFlags & PrintTypeFlags.PythonSyntax) { + return 'Callable[..., Any]'; + } return `Overload[${overloads.join(', ')}]`; } @@ -329,7 +380,13 @@ export function printType( if (matchedAllSubtypes && !allSubtypesPreviouslyHandled) { subtypeStrings.add( - printType(typeAliasSource, updatedPrintTypeFlags, returnTypeCallback, recursionTypes) + printType( + typeAliasSource, + updatedPrintTypeFlags, + returnTypeCallback, + recursionTypes, + recursionCount + ) ); indicesCoveredByTypeAlias.forEach((index) => subtypeHandledSet.add(index)); } @@ -347,7 +404,8 @@ export function printType( typeWithoutNone, updatedPrintTypeFlags, returnTypeCallback, - recursionTypes + recursionTypes, + recursionCount ); if (printTypeFlags & PrintTypeFlags.PEP604) { @@ -371,7 +429,13 @@ export function printType( literalClassStrings.add(printLiteralValue(subtype)); } else { subtypeStrings.add( - printType(subtype, updatedPrintTypeFlags, returnTypeCallback, recursionTypes) + printType( + subtype, + updatedPrintTypeFlags, + returnTypeCallback, + recursionTypes, + recursionCount + ) ); } } @@ -423,7 +487,8 @@ export function printType( : type.details.boundType, printTypeFlags, returnTypeCallback, - recursionTypes + recursionTypes, + recursionCount ); } return type.details.recursiveTypeAliasName; @@ -437,11 +502,16 @@ export function printType( type.details.boundType, printTypeFlags & ~PrintTypeFlags.ExpandTypeAlias, returnTypeCallback, - recursionTypes + recursionTypes, + recursionCount ); if (!isAnyOrUnknown(type.details.boundType)) { - boundTypeString = `Self@${boundTypeString}`; + if (printTypeFlags & PrintTypeFlags.PythonSyntax) { + boundTypeString = `Self`; + } else { + boundTypeString = `Self@${boundTypeString}`; + } } if (TypeBase.isInstantiable(type)) { @@ -451,20 +521,25 @@ export function printType( return boundTypeString; } - return (printTypeFlags & PrintTypeFlags.PrintUnknownWithAny) !== 0 ? 'Any' : 'Unknown'; + return (printTypeFlags & (PrintTypeFlags.PrintUnknownWithAny | PrintTypeFlags.PythonSyntax)) !== 0 + ? 'Any' + : 'Unknown'; } if (type.details.isParamSpec) { if (type.paramSpecAccess) { return `${type.details.name}.${type.paramSpecAccess}`; } - return `${TypeVarType.getReadableName(type)}`; + return `${_getReadableTypeVarName(type, (printTypeFlags & PrintTypeFlags.PythonSyntax) !== 0)}`; } - let typeVarName = TypeVarType.getReadableName(type); - + let typeVarName = _getReadableTypeVarName(type, (printTypeFlags & PrintTypeFlags.PythonSyntax) !== 0); if (type.isVariadicUnpacked) { - typeVarName = `*${typeVarName}`; + typeVarName = _printUnpack(typeVarName, printTypeFlags); + } + + if (type.isVariadicInUnion) { + typeVarName = `Union[${typeVarName}]`; } if (TypeBase.isInstantiable(type)) { @@ -496,6 +571,85 @@ export function printType( } } +function printFunctionType( + type: FunctionType, + printTypeFlags: PrintTypeFlags, + returnTypeCallback: FunctionReturnTypeCallback, + recursionTypes: Type[] = [], + recursionCount = 0 +) { + if (printTypeFlags & PrintTypeFlags.PythonSyntax) { + // Callable works only in cases where all parameters are positional-only. + let isPositionalParamsOnly = false; + if (type.details.parameters.length === 0) { + isPositionalParamsOnly = true; + } else { + if (type.details.parameters.every((param) => param.category === ParameterCategory.Simple)) { + const lastParam = type.details.parameters[type.details.parameters.length - 1]; + if (!lastParam.name) { + isPositionalParamsOnly = true; + } + } + } + + const returnType = returnTypeCallback(type); + let returnTypeString = 'Any'; + if (returnType) { + returnTypeString = printType( + returnType, + printTypeFlags, + returnTypeCallback, + recursionTypes, + recursionCount + ); + } + + if (isPositionalParamsOnly) { + const paramTypes: string[] = []; + + type.details.parameters.forEach((param, index) => { + if (param.name) { + const paramType = FunctionType.getEffectiveParameterType(type, index); + if (recursionTypes.length < maxTypeRecursionCount) { + paramTypes.push( + printType(paramType, printTypeFlags, returnTypeCallback, recursionTypes, recursionCount) + ); + } else { + paramTypes.push('Any'); + } + } + }); + + if (type.details.paramSpec) { + return `Callable[Concatenate[${paramTypes.join(', ')}, ${ + type.details.paramSpec.details.name + }], ${returnTypeString}]`; + } + + return `Callable[[${paramTypes.join(', ')}], ${returnTypeString}]`; + } else { + // We can't represent this type using a Callable so default to + // a "catch all" Callable. + return `Callable[..., ${returnTypeString}]`; + } + } else { + const parts = printFunctionParts(type, printTypeFlags, returnTypeCallback, recursionTypes); + const paramSignature = `(${parts[0].join(', ')})`; + + if (FunctionType.isParamSpecValue(type)) { + return paramSignature; + } + const fullSignature = `${paramSignature} -> ${parts[1]}`; + + const parenthesizeCallable = (printTypeFlags & PrintTypeFlags.ParenthesizeCallable) !== 0; + if (parenthesizeCallable) { + return `(${fullSignature})`; + } + + return fullSignature; + } +} + export function printLiteralValue(type: ClassType, quotation = "'"): string { const literalValue = type.literalValue; if (literalValue === undefined) { @@ -504,27 +658,46 @@ export function printLiteralValue(type: ClassType, quotation = "'"): string { let literalStr: string; if (typeof literalValue === 'string') { - const prefix = type.details.name === 'bytes' ? 'b' : ''; + let effectiveLiteralValue = literalValue; // Limit the length of the string literal. - let effectiveLiteralValue = literalValue; const maxLiteralStringLength = 50; if (literalValue.length > maxLiteralStringLength) { effectiveLiteralValue = literalValue.substring(0, maxLiteralStringLength) + '…'; } - // JSON.stringify will perform proper escaping for " case. - // So, we only need to do our own escaping for ' case. - literalStr = JSON.stringify(effectiveLiteralValue).toString(); - if (quotation !== '"') { - literalStr = `'${literalStr - .substring(1, literalStr.length - 1) - .replace(escapedDoubleQuoteRegEx, '"') - .replace(singleTickRegEx, "\\'")}'`; - } + if (type.details.name === 'bytes') { + let bytesString = ''; + + // There's no good built-in conversion routine in javascript to convert + // bytes strings. Determine on a character-by-character basis whether + // it can be rendered into an ASCII character. If not, use an escape. + for (let i = 0; i < effectiveLiteralValue.length; i++) { + const char = effectiveLiteralValue.substring(i, i + 1); + const charCode = char.charCodeAt(0); + + if (charCode >= 20 && charCode <= 126) { + if (charCode === 34) { + bytesString += '\\' + char; + } else { + bytesString += char; + } + } else { + bytesString += `\\x${((charCode >> 4) & 0xf).toString(16)}${(charCode & 0xf).toString(16)}`; + } + } - if (prefix) { - literalStr = `${prefix}${literalStr}`; + literalStr = `b"${bytesString}"`; + } else { + // JSON.stringify will perform proper escaping for " case. + // So, we only need to do our own escaping for ' case. + literalStr = JSON.stringify(effectiveLiteralValue).toString(); + if (quotation !== '"') { + literalStr = `'${literalStr + .substring(1, literalStr.length - 1) + .replace(escapedDoubleQuoteRegEx, '"') + .replace(singleTickRegEx, "\\'")}'`; + } } } else if (typeof literalValue === 'boolean') { literalStr = literalValue ? 'True' : 'False'; @@ -546,7 +719,8 @@ export function printObjectTypeForClass( type: ClassType, printTypeFlags: PrintTypeFlags, returnTypeCallback: FunctionReturnTypeCallback, - recursionTypes: Type[] = [] + recursionTypes: Type[] = [], + recursionCount = 0 ): string { let objName = type.aliasName || type.details.name; @@ -584,7 +758,9 @@ export function printObjectTypeForClass( isAllAny = false; } - typeArgStrings.push('()'); + if (index === 0) { + typeArgStrings.push(_printUnpack('tuple[()]', printTypeFlags)); + } } else { typeArgStrings.push( ...typeArg.type.tupleTypeArguments.map((typeArg) => { @@ -596,10 +772,12 @@ export function printObjectTypeForClass( typeArg.type, printTypeFlags, returnTypeCallback, - recursionTypes + recursionTypes, + recursionCount ); + if (typeArg.isUnbounded) { - return `*tuple[${typeArgText}, ...]`; + return _printUnpack(`tuple[${typeArgText}, ...]`, printTypeFlags); } return typeArgText; @@ -615,14 +793,15 @@ export function printObjectTypeForClass( typeArg.type, printTypeFlags, returnTypeCallback, - recursionTypes + recursionTypes, + recursionCount ); if (typeArg.isUnbounded) { if (typeArgs.length === 1) { typeArgStrings.push(typeArgTypeText, '...'); } else { - typeArgStrings.push(`*tuple[${typeArgTypeText}, ...]`); + typeArgStrings.push(_printUnpack(`tuple[${typeArgTypeText}, ...]`, printTypeFlags)); } } else { typeArgStrings.push(typeArgTypeText); @@ -631,18 +810,26 @@ export function printObjectTypeForClass( }); if (type.isUnpacked) { - objName = '*' + objName; + objName = _printUnpack(objName, printTypeFlags); } if ((printTypeFlags & PrintTypeFlags.OmitTypeArgumentsIfAny) === 0 || !isAllAny) { objName += '[' + typeArgStrings.join(', ') + ']'; } } else { + if (type.isUnpacked) { + objName = _printUnpack(objName, printTypeFlags); + } + if (ClassType.isTupleClass(type) || isVariadic) { objName += '[()]'; } } } else { + if (type.isUnpacked) { + objName = _printUnpack(objName, printTypeFlags); + } + if (typeParams.length > 0) { if ( (printTypeFlags & PrintTypeFlags.OmitTypeArgumentsIfAny) === 0 || @@ -652,7 +839,13 @@ export function printObjectTypeForClass( '[' + typeParams .map((typeParam) => { - return printType(typeParam, printTypeFlags, returnTypeCallback, recursionTypes); + return printType( + typeParam, + printTypeFlags, + returnTypeCallback, + recursionTypes, + recursionCount + ); }) .join(', ') + ']'; @@ -668,7 +861,8 @@ export function printFunctionParts( type: FunctionType, printTypeFlags: PrintTypeFlags, returnTypeCallback: FunctionReturnTypeCallback, - recursionTypes: Type[] = [] + recursionTypes: Type[] = [], + recursionCount = 0 ): [string[], string] { const paramTypeStrings: string[] = []; let sawDefinedName = false; @@ -687,13 +881,38 @@ export function printFunctionParts( specializedParamType.tupleTypeArguments ) { specializedParamType.tupleTypeArguments.forEach((paramType) => { - const paramString = printType(paramType.type, printTypeFlags, returnTypeCallback, recursionTypes); + const paramString = printType( + paramType.type, + printTypeFlags, + returnTypeCallback, + recursionTypes, + recursionCount + ); paramTypeStrings.push(paramString); }); return; } } + // Handle expanding TypedDict kwargs specially. + if ( + isTypedKwargs(param) && + printTypeFlags & PrintTypeFlags.ExpandTypedDictArgs && + param.type.category === TypeCategory.Class + ) { + param.type.details.typedDictEntries!.forEach((v, k) => { + const valueTypeString = printType( + v.valueType, + printTypeFlags, + returnTypeCallback, + recursionTypes, + recursionCount + ); + paramTypeStrings.push(`${k}: ${valueTypeString}`); + }); + return; + } + let paramString = ''; if (param.category === ParameterCategory.VarArgList) { if (!param.name || !param.isNameSynthesized) { @@ -703,9 +922,15 @@ export function printFunctionParts( paramString += '**'; } + let emittedParamName = false; if (param.name && !param.isNameSynthesized) { paramString += param.name; sawDefinedName = true; + emittedParamName = true; + } else if (printTypeFlags & PrintTypeFlags.PythonSyntax) { + paramString += `__p${index}`; + sawDefinedName = true; + emittedParamName = true; } let defaultValueAssignment = '='; @@ -715,19 +940,25 @@ export function printFunctionParts( // Avoid printing type types if parameter have unknown type. if (param.hasDeclaredType || param.isTypeInferred) { const paramType = FunctionType.getEffectiveParameterType(type, index); - const paramTypeString = + let paramTypeString = recursionTypes.length < maxTypeRecursionCount - ? printType(paramType, printTypeFlags, returnTypeCallback, recursionTypes) + ? printType(paramType, printTypeFlags, returnTypeCallback, recursionTypes, recursionCount) : ''; - if (!param.isNameSynthesized) { + if (emittedParamName) { paramString += ': '; } else if (param.category === ParameterCategory.VarArgList && !isUnpacked(paramType)) { paramString += '*'; } if (param.category === ParameterCategory.VarArgDictionary && isUnpacked(paramType)) { - paramString += '**'; + if (printTypeFlags & PrintTypeFlags.PythonSyntax) { + // Use "Unpack" because ** isn't legal syntax prior to Python 3.12. + paramTypeString = `Unpack[${paramTypeString.substring(1)}]`; + } else { + // If this is an unpacked TypeDict for a **kwargs parameter, add another star. + paramTypeString = '*' + paramTypeString; + } } paramString += paramTypeString; @@ -748,7 +979,11 @@ export function printFunctionParts( if (!param.isNameSynthesized) { paramString += ': '; } - paramString += 'Unknown'; + if (printTypeFlags & (PrintTypeFlags.PrintUnknownWithAny | PrintTypeFlags.PythonSyntax)) { + paramString += 'Any'; + } else { + paramString += 'Unknown'; + } defaultValueAssignment = ' = '; } } else if (param.category === ParameterCategory.Simple) { @@ -783,9 +1018,20 @@ export function printFunctionParts( }); if (type.details.paramSpec) { - paramTypeStrings.push( - `**${printType(type.details.paramSpec, printTypeFlags, returnTypeCallback, recursionTypes)}` - ); + if (printTypeFlags & PrintTypeFlags.PythonSyntax) { + paramTypeStrings.push(`*args: ${type.details.paramSpec}.args`); + paramTypeStrings.push(`**kwargs: ${type.details.paramSpec}.kwargs`); + } else { + paramTypeStrings.push( + `**${printType( + type.details.paramSpec, + printTypeFlags, + returnTypeCallback, + recursionTypes, + recursionCount + )}` + ); + } } const returnType = returnTypeCallback(type); @@ -795,13 +1041,18 @@ export function printFunctionParts( returnType, printTypeFlags | PrintTypeFlags.ParenthesizeUnion | PrintTypeFlags.ParenthesizeCallable, returnTypeCallback, - recursionTypes + recursionTypes, + recursionCount ) : ''; return [paramTypeStrings, returnTypeString]; } +function _printUnpack(textToWrap: string, flags: PrintTypeFlags) { + return flags & PrintTypeFlags.UseTypingUnpack ? `Unpack[${textToWrap}]` : `*${textToWrap}`; +} + // Surrounds a printed type with Type[...] as many times as needed // for the nested instantiable count. function _printNestedInstantiable(type: Type, textToWrap: string) { @@ -813,3 +1064,11 @@ function _printNestedInstantiable(type: Type, textToWrap: string) { return textToWrap; } + +function _getReadableTypeVarName(type: TypeVarType, usePythonSyntax: boolean) { + if (usePythonSyntax) { + return type.details.name; + } + + return TypeVarType.getReadableName(type); +} diff --git a/packages/pyright-internal/src/analyzer/typeStubWriter.ts b/packages/pyright-internal/src/analyzer/typeStubWriter.ts index 818e9a113..a36a2b7a2 100644 --- a/packages/pyright-internal/src/analyzer/typeStubWriter.ts +++ b/packages/pyright-internal/src/analyzer/typeStubWriter.ts @@ -88,7 +88,7 @@ class TrackedImportFrom extends TrackedImport { } class ImportSymbolWalker extends ParseTreeWalker { - constructor(private _accessedImportedSymbols: Map, private _treatStringsAsSymbols: boolean) { + constructor(private _accessedImportedSymbols: Set, private _treatStringsAsSymbols: boolean) { super(); } @@ -103,7 +103,7 @@ class ImportSymbolWalker extends ParseTreeWalker { } override visitName(node: NameNode) { - this._accessedImportedSymbols.set(node.value, true); + this._accessedImportedSymbols.add(node.value); return true; } @@ -111,7 +111,7 @@ class ImportSymbolWalker extends ParseTreeWalker { const baseExpression = this._getRecursiveModuleAccessExpression(node.leftExpression); if (baseExpression) { - this._accessedImportedSymbols.set(`${baseExpression}.${node.memberName.value}`, true); + this._accessedImportedSymbols.add(`${baseExpression}.${node.memberName.value}`); } return true; @@ -119,7 +119,7 @@ class ImportSymbolWalker extends ParseTreeWalker { override visitString(node: StringNode) { if (this._treatStringsAsSymbols) { - this._accessedImportedSymbols.set(node.value, true); + this._accessedImportedSymbols.add(node.value); } return true; @@ -156,7 +156,7 @@ export class TypeStubWriter extends ParseTreeWalker { private _emitDocString = true; private _trackedImportAs = new Map(); private _trackedImportFrom = new Map(); - private _accessedImportedSymbols = new Map(); + private _accessedImportedSymbols = new Set(); constructor(private _stubPath: string, private _sourceFile: SourceFile, private _evaluator: TypeEvaluator) { super(); @@ -289,7 +289,7 @@ export class TypeStubWriter extends ParseTreeWalker { let returnType = this._evaluator.getFunctionInferredReturnType(functionType.functionType); returnType = removeUnknownFromUnion(returnType); if (!isNever(returnType) && !isUnknown(returnType)) { - line += ` # -> ${this._evaluator.printType(returnType, /* expandTypeAlias */ false)}:`; + line += ` # -> ${this._evaluator.printType(returnType)}:`; } } } @@ -324,6 +324,9 @@ export class TypeStubWriter extends ParseTreeWalker { override visitTry(node: TryNode) { // Don't emit a doc string after the first statement. this._emitDocString = false; + + // Only walk a single branch of the try/catch to for imports. + this.walk(node.trySuite); return false; } @@ -638,6 +641,11 @@ export class TypeStubWriter extends ParseTreeWalker { line += this._printExpression(node.boundExpression); } + if (node.defaultExpression) { + line += ' = '; + line += this._printExpression(node.defaultExpression); + } + return line; } @@ -705,7 +713,7 @@ export class TypeStubWriter extends ParseTreeWalker { // Emit the "import" statements. this._trackedImportAs.forEach((imp) => { - if (this._accessedImportedSymbols.get(imp.alias || imp.importName)) { + if (this._accessedImportedSymbols.has(imp.alias || imp.importName)) { imp.isAccessed = true; } @@ -722,7 +730,7 @@ export class TypeStubWriter extends ParseTreeWalker { // Emit the "import from" statements. this._trackedImportFrom.forEach((imp) => { imp.symbols.forEach((s) => { - if (this._accessedImportedSymbols.get(s.alias || s.name)) { + if (this._accessedImportedSymbols.has(s.alias || s.name)) { s.isAccessed = true; } }); diff --git a/packages/pyright-internal/src/analyzer/typeUtils.ts b/packages/pyright-internal/src/analyzer/typeUtils.ts index 52470a4de..231a93251 100644 --- a/packages/pyright-internal/src/analyzer/typeUtils.ts +++ b/packages/pyright-internal/src/analyzer/typeUtils.ts @@ -4,7 +4,7 @@ * Licensed under the MIT license. * Author: Eric Traut * - * Collection of functions that operate on Type objects. + * Functions that operate on Type objects. */ import { appendArray } from '../common/collectionUtils'; @@ -12,7 +12,6 @@ import { assert } from '../common/debug'; import { ParameterCategory } from '../parser/parseNodes'; import { DeclarationType } from './declaration'; import { Symbol, SymbolFlags, SymbolTable } from './symbol'; -import { isDunderName } from './symbolNameUtils'; import { isTypedDictMemberAccessedThroughIndex } from './symbolUtils'; import { AnyType, @@ -37,15 +36,13 @@ import { isUnbound, isUnion, isUnknown, - isUnpackedClass, + isUnpackedVariadicTypeVar, isVariadicTypeVar, maxTypeRecursionCount, ModuleType, NeverType, NoneType, OverloadedFunctionType, - ParamSpecEntry, - ParamSpecValue, SpecializedFunctionTypes, TupleTypeArgument, Type, @@ -58,6 +55,7 @@ import { TypeVarType, UnionType, UnknownType, + Variance, WildcardTypeVarScopeId, } from './types'; import { TypeVarContext } from './typeVarContext'; @@ -148,9 +146,10 @@ export const enum AssignTypeFlags { // on dest type vars rather than source type var. ReverseTypeVarMatching = 1 << 1, - // Normally invariant and contravariant TypeVars cannot be - // narrowed. This overrides the standard behavior. - AllowTypeVarNarrowing = 1 << 2, + // We're comparing type compatibility of two distinct recursive types. + // This has the potential of recursing infinitely. This flag allows us + // to detect the recursion after the first level of checking. + SkipRecursiveTypeCheck = 1 << 2, // Normally type vars are treated as variables that need to // be "solved". If this flag is set, they are treated as types @@ -188,240 +187,124 @@ export const enum AssignTypeFlags { // so TypeVars should match the specified type exactly rather than // employing narrowing or widening, and don't strip literals. PopulatingExpectedType = 1 << 10, - - // We're comparing type compatibility of two distinct recursive types. - // This has the potential of recursing infinitely. This flag allows us - // to detect the recursion after the first level of checking. - SkipRecursiveTypeCheck = 1 << 11, } -export enum ParameterSource { - PositionOnly, - PositionOrKeyword, - KeywordOnly, +export interface ApplyTypeVarOptions { + unknownIfNotFound?: boolean; + useUnknownOverDefault?: boolean; + useNarrowBoundOnly?: boolean; + eliminateUnsolvedInUnions?: boolean; + typeClassType?: Type; } -export interface VirtualParameterDetails { - param: FunctionParameter; - type: Type; - defaultArgType?: Type | undefined; - index: number; - source: ParameterSource; +export interface InferenceContext { + expectedType: Type; + isTypeIncomplete?: boolean; + typeVarContext?: TypeVarContext; } -export interface ParameterListDetails { - // Virtual parameter list that refers to original parameters - params: VirtualParameterDetails[]; - - // Counts of virtual parameters - positionOnlyParamCount: number; - positionParamCount: number; - - // Indexes into virtual parameter list - kwargsIndex?: number; - argsIndex?: number; - firstKeywordOnlyIndex?: number; - firstPositionOrKeywordIndex: number; - - // Other information - hasUnpackedVariadicTypeVar: boolean; - hasUnpackedTypedDict: boolean; +export interface SignatureWithCount { + type: FunctionType; + count: number; } -// Examines the input parameters within a function signature and creates a -// "virtual list" of parameters, stripping out any markers and expanding -// any *args with unpacked tuples. -export function getParameterListDetails(type: FunctionType): ParameterListDetails { - const result: ParameterListDetails = { - firstPositionOrKeywordIndex: 0, - positionParamCount: 0, - positionOnlyParamCount: 0, - params: [], - hasUnpackedVariadicTypeVar: false, - hasUnpackedTypedDict: false, - }; +export class UniqueSignatureTracker { + public signaturesSeen: SignatureWithCount[]; - let positionOnlyIndex = type.details.parameters.findIndex( - (p) => p.category === ParameterCategory.Simple && !p.name - ); - - // Handle the old (pre Python 3.8) way of specifying positional-only - // parameters by naming them with "__". - if (positionOnlyIndex < 0) { - for (let i = 0; i < type.details.parameters.length; i++) { - const p = type.details.parameters[i]; - if (p.category !== ParameterCategory.Simple) { - break; - } - - if (!p.name) { - break; - } - - if (isDunderName(p.name) || !p.name.startsWith('__')) { - break; - } - - positionOnlyIndex = i + 1; - } + constructor() { + this.signaturesSeen = []; } - if (positionOnlyIndex >= 0) { - result.firstPositionOrKeywordIndex = positionOnlyIndex; + findSignature(signature: FunctionType): SignatureWithCount | undefined { + return this.signaturesSeen.find((s) => { + return isTypeSame(signature, s.type); + }); } - for (let i = 0; i < positionOnlyIndex; i++) { - if (type.details.parameters[i].hasDefault) { - break; + addSignature(signature: FunctionType) { + const existingSignature = this.findSignature(signature); + if (existingSignature) { + existingSignature.count++; + } else { + this.signaturesSeen.push({ type: signature, count: 1 }); } - - result.positionOnlyParamCount++; } +} - let sawKeywordOnlySeparator = false; - - const addVirtualParameter = ( - param: FunctionParameter, - index: number, - typeOverride?: Type, - defaultArgTypeOverride?: Type - ) => { - if (param.name) { - let source: ParameterSource; - if (param.category === ParameterCategory.VarArgList) { - source = ParameterSource.PositionOnly; - } else if (sawKeywordOnlySeparator) { - source = ParameterSource.KeywordOnly; - } else if (positionOnlyIndex >= 0 && index < positionOnlyIndex) { - source = ParameterSource.PositionOnly; - } else { - source = ParameterSource.PositionOrKeyword; - } - - result.params.push({ - param, - index, - type: typeOverride ?? FunctionType.getEffectiveParameterType(type, index), - defaultArgType: defaultArgTypeOverride, - source, - }); - } - }; - - type.details.parameters.forEach((param, index) => { - if (param.category === ParameterCategory.VarArgList) { - // If this is an unpacked tuple, expand the entries. - const paramType = FunctionType.getEffectiveParameterType(type, index); - if (param.name && isUnpackedClass(paramType) && paramType.tupleTypeArguments) { - paramType.tupleTypeArguments.forEach((tupleArg, index) => { - const category = - isVariadicTypeVar(tupleArg.type) || tupleArg.isUnbounded - ? ParameterCategory.VarArgList - : ParameterCategory.Simple; - - if (category === ParameterCategory.VarArgList) { - result.argsIndex = result.params.length; - } - - if (isVariadicTypeVar(param.type)) { - result.hasUnpackedVariadicTypeVar = true; - } - - addVirtualParameter( - { - category, - name: `${param.name}[${index.toString()}]`, - isNameSynthesized: true, - type: tupleArg.type, - hasDeclaredType: true, - }, - index, - tupleArg.type - ); - }); - } else { - if (param.name && result.argsIndex === undefined) { - result.argsIndex = result.params.length; +export function isOptionalType(type: Type): boolean { + if (isUnion(type)) { + return findSubtype(type, (subtype) => isNoneInstance(subtype)) !== undefined; + } - if (isVariadicTypeVar(param.type)) { - result.hasUnpackedVariadicTypeVar = true; - } - } + return false; +} - // Normally, a VarArgList parameter (either named or as an unnamed separator) - // would signify the start of keyword-only parameters. However, we can construct - // callable signatures that defy this rule by using Callable and TypeVarTuples - // or unpacked tuples. - if (!sawKeywordOnlySeparator && (positionOnlyIndex < 0 || index >= positionOnlyIndex)) { - result.firstKeywordOnlyIndex = result.params.length; - if (param.name) { - result.firstKeywordOnlyIndex++; - } - sawKeywordOnlySeparator = true; - } +export function isIncompleteUnknown(type: Type): boolean { + return isUnknown(type) && type.isIncomplete; +} - addVirtualParameter(param, index); - } - } else if (param.category === ParameterCategory.VarArgDictionary) { - sawKeywordOnlySeparator = true; +// Similar to isTypeSame except that type1 is a TypeVar and type2 +// can be either a TypeVar of the same type or a union that includes +// conditional types associated with that bound TypeVar. +export function isTypeVarSame(type1: TypeVarType, type2: Type) { + if (isTypeSame(type1, type2)) { + return true; + } - // Is this an unpacked TypedDict? If so, expand the entries. - if (isClassInstance(param.type) && isUnpackedClass(param.type) && param.type.details.typedDictEntries) { - if (result.firstKeywordOnlyIndex === undefined) { - result.firstKeywordOnlyIndex = result.params.length; - } + // If this isn't a bound TypeVar, return false. + if (type1.details.isParamSpec || type1.details.isVariadic || !type1.details.boundType) { + return false; + } - param.type.details.typedDictEntries.forEach((entry, name) => { - addVirtualParameter( - { - category: ParameterCategory.Simple, - name, - type: entry.valueType, - hasDeclaredType: true, - hasDefault: !entry.isRequired, - }, - index, - entry.valueType - ); - }); + // If the second type isn't a union, return false. + if (!isUnion(type2)) { + return false; + } - result.hasUnpackedTypedDict = true; - } else if (param.name) { - if (result.kwargsIndex === undefined) { - result.kwargsIndex = result.params.length; - } + let isCompatible = true; + doForEachSubtype(type2, (subtype) => { + if (!isCompatible) { + return; + } - if (result.firstKeywordOnlyIndex === undefined) { - result.firstKeywordOnlyIndex = result.params.length; - } + if (!isTypeSame(type1, subtype)) { + const conditions = getTypeCondition(subtype); - addVirtualParameter(param, index); + if (!conditions || !conditions.some((condition) => condition.typeVarName === type1.nameWithScope)) { + isCompatible = false; } - } else if (param.category === ParameterCategory.Simple) { - if (param.name && !sawKeywordOnlySeparator) { - result.positionParamCount++; - } - - addVirtualParameter( - param, - index, - /* typeOverride */ undefined, - type.specializedTypes?.parameterDefaultArgs - ? type.specializedTypes?.parameterDefaultArgs[index] - : undefined - ); } }); - return result; + return isCompatible; } -export function isOptionalType(type: Type): boolean { - if (isUnion(type)) { - return findSubtype(type, (subtype) => isNoneInstance(subtype)) !== undefined; +export function makeInferenceContext( + expectedType: undefined, + typeVarContext?: TypeVarContext, + isTypeIncomplete?: boolean +): undefined; +export function makeInferenceContext( + expectedType: Type, + typeVarContext?: TypeVarContext, + isTypeIncomplete?: boolean +): InferenceContext; +export function makeInferenceContext( + expectedType: Type | undefined, + typeVarContext?: TypeVarContext, + isTypeIncomplete?: boolean +): InferenceContext | undefined; + +export function makeInferenceContext( + expectedType: Type | undefined, + typeVarContext?: TypeVarContext, + isTypeIncomplete?: boolean +): InferenceContext | undefined { + if (!expectedType) { + return undefined; } - return false; + return { expectedType, isTypeIncomplete, typeVarContext }; } // Calls a callback for each subtype and combines the results @@ -601,16 +484,16 @@ function compareTypes(a: Type, b: Type): number { export function doForEachSubtype( type: Type, - callback: (type: Type, index: number) => void, + callback: (type: Type, index: number, allSubtypes: Type[]) => void, sortSubtypes = false ): void { if (isUnion(type)) { const subtypes = sortSubtypes ? sortTypes(type.subtypes) : type.subtypes; subtypes.forEach((subtype, index) => { - callback(subtype, index); + callback(subtype, index, subtypes); }); } else { - callback(type, 0); + callback(type, 0, [type]); } } @@ -761,12 +644,8 @@ export function getTypeCondition(type: Type): TypeCondition[] | undefined { // Indicates whether the specified type is a recursive type alias // placeholder that has not yet been resolved. -export function isTypeAliasPlaceholder(type: Type): type is TypeVarType { - if (!isTypeVar(type)) { - return false; - } - - return !!type.details.recursiveTypeAliasName && !type.details.boundType; +export function isTypeAliasPlaceholder(type: Type): boolean { + return isTypeVar(type) && TypeVarType.isTypeAliasPlaceholder(type); } // Determines whether the type alias placeholder is used directly @@ -813,6 +692,24 @@ export function transformPossibleRecursiveTypeAlias(type: Type | undefined): Typ ); return applySolvedTypeVars(unspecializedType, typeVarContext); } + + if (isUnion(type) && type.includesRecursiveTypeAlias) { + let newType = mapSubtypes(type, (subtype) => transformPossibleRecursiveTypeAlias(subtype)); + + if (newType !== type && type.typeAliasInfo) { + // Copy the type alias information if present. + newType = TypeBase.cloneForTypeAlias( + newType, + type.typeAliasInfo.name, + type.typeAliasInfo.fullName, + type.typeAliasInfo.typeVarScopeId, + type.typeAliasInfo.typeParameters, + type.typeAliasInfo.typeArguments + ); + } + + return newType; + } } return type; @@ -1027,7 +924,10 @@ export function isTupleClass(type: ClassType) { // the form tuple[x, ...] where the number of elements // in the tuple is unknown. export function isUnboundedTupleClass(type: ClassType) { - return type.tupleTypeArguments && type.tupleTypeArguments.some((t) => t.isUnbounded); + return ( + type.tupleTypeArguments && + type.tupleTypeArguments.some((t) => t.isUnbounded || isUnpackedVariadicTypeVar(t.type)) + ); } // Partially specializes a type within the context of a specified @@ -1052,14 +952,7 @@ export function partiallySpecializeType( populateTypeVarContextForSelfType(typeVarContext, contextClassType, selfClass); } - return applySolvedTypeVars( - type, - typeVarContext, - /* unknownIfNotFound */ undefined, - /* useNarrowBoundOnly */ undefined, - /* eliminateUnsolvedInUnions */ undefined, - typeClassType - ); + return applySolvedTypeVars(type, typeVarContext, { typeClassType }); } export function populateTypeVarContextForSelfType( @@ -1071,29 +964,42 @@ export function populateTypeVarContextForSelfType( typeVarContext.setTypeVarType(synthesizedSelfTypeVar, convertToInstance(selfClass)); } +// Looks for duplicate function types within the type and ensures that +// if they are generic, they have unique type variables. +export function ensureFunctionSignaturesAreUnique(type: Type, signatureTracker: UniqueSignatureTracker): Type { + const transformer = new UniqueFunctionSignatureTransformer(signatureTracker); + return transformer.apply(type, 0); +} + // Specializes a (potentially generic) type by substituting // type variables from a type var map. export function applySolvedTypeVars( type: Type, typeVarContext: TypeVarContext, - unknownIfNotFound = false, - useNarrowBoundOnly = false, - eliminateUnsolvedInUnions = false, - typeClassType?: Type + options: ApplyTypeVarOptions = {} ): Type { // Use a shortcut if the typeVarContext is empty and no transform is necessary. - if (typeVarContext.isEmpty() && !unknownIfNotFound && !eliminateUnsolvedInUnions) { + if (typeVarContext.isEmpty() && !options.unknownIfNotFound && !options.eliminateUnsolvedInUnions) { return type; } - const transformer = new ApplySolvedTypeVarsTransformer( - typeVarContext, - unknownIfNotFound, - useNarrowBoundOnly, - eliminateUnsolvedInUnions, - typeClassType - ); - return transformer.apply(type); + const transformer = new ApplySolvedTypeVarsTransformer(typeVarContext, options); + return transformer.apply(type, 0); +} + +// Validates that a default type associated with a TypeVar does not refer to +// other TypeVars or ParamSpecs that are out of scope. +export function validateTypeVarDefault( + typeVar: TypeVarType, + liveTypeParams: TypeVarType[], + invalidTypeVars: Set +) { + // If there is no default type or the default type is concrete, there's + // no need to do any more work here. + if (typeVar.details.defaultType && requiresSpecialization(typeVar.details.defaultType)) { + const validator = new TypeVarDefaultValidator(liveTypeParams, invalidTypeVars); + validator.apply(typeVar.details.defaultType, 0); + } } // During bidirectional type inference for constructors, an "executed type" @@ -1103,7 +1009,6 @@ export function applySolvedTypeVars( // type variables that are scoped to the appropriate context. export function transformExpectedTypeForConstructor( expectedType: Type, - typeVarContext: TypeVarContext, liveTypeVarScopes: TypeVarScopeId[] ): Type | undefined { const isTypeVarLive = (typeVar: TypeVarType) => liveTypeVarScopes.some((scopeId) => typeVar.scopeId === scopeId); @@ -1119,8 +1024,8 @@ export function transformExpectedTypeForConstructor( return undefined; } - const transformer = new ExpectedConstructorTypeTransformer(typeVarContext, liveTypeVarScopes); - return transformer.apply(expectedType); + const transformer = new ExpectedConstructorTypeTransformer(liveTypeVarScopes); + return transformer.apply(expectedType, 0); } // Given a protocol class, this function returns a set of all the @@ -1163,6 +1068,42 @@ function getProtocolSymbolsRecursive(classType: ClassType, symbolMap: Map maxTypeRecursionCount) { + return 1; + } + + recursionCount++; + + if (!isClassInstance(type)) { + return 0; + } + + let maxChildDepth = 0; + + if (type.tupleTypeArguments) { + type.tupleTypeArguments.forEach((typeArgInfo) => { + doForEachSubtype(typeArgInfo.type, (subtype) => { + const childDepth = getContainerDepth(subtype, recursionCount); + maxChildDepth = Math.max(childDepth, maxChildDepth); + }); + }); + } else if (type.typeArguments) { + type.typeArguments.forEach((typeArg) => { + doForEachSubtype(typeArg, (subtype) => { + const childDepth = getContainerDepth(subtype, recursionCount); + maxChildDepth = Math.max(childDepth, maxChildDepth); + }); + }); + } else { + return 0; + } + + return 1 + maxChildDepth; +} + export function lookUpObjectMember( objectType: Type, memberName: string, @@ -1278,7 +1219,7 @@ export function* getClassMemberIterator(classType: Type, memberName: string, fla // class member. const isDataclass = ClassType.isDataClass(specializedMroClass); const isTypedDict = ClassType.isTypedDictClass(specializedMroClass); - if (isDataclass || isTypedDict) { + if (hasDeclaredType && (isDataclass || isTypedDict)) { const decls = symbol.getDeclarations(); if (decls.length > 0 && decls[0].type === DeclarationType.Variable) { isInstanceMember = true; @@ -1414,17 +1355,6 @@ export function getTypeVarArgumentsRecursive(type: Type, recursionCount = 0): Ty } recursionCount++; - const getTypeVarsFromClass = (classType: ClassType) => { - const combinedList: TypeVarType[] = []; - if (classType.typeArguments) { - classType.typeArguments.forEach((typeArg) => { - addTypeVarsToListIfUnique(combinedList, getTypeVarArgumentsRecursive(typeArg, recursionCount)); - }); - } - - return combinedList; - }; - if (type.typeAliasInfo?.typeArguments) { const combinedList: TypeVarType[] = []; @@ -1450,7 +1380,15 @@ export function getTypeVarArgumentsRecursive(type: Type, recursionCount = 0): Ty } if (isClass(type)) { - return getTypeVarsFromClass(type); + const combinedList: TypeVarType[] = []; + const typeArgs = type.tupleTypeArguments ? type.tupleTypeArguments.map((e) => e.type) : type.typeArguments; + if (typeArgs) { + typeArgs.forEach((typeArg) => { + addTypeVarsToListIfUnique(combinedList, getTypeVarArgumentsRecursive(typeArg, recursionCount)); + }); + } + + return combinedList; } if (isUnion(type)) { @@ -1486,6 +1424,96 @@ export function getTypeVarArgumentsRecursive(type: Type, recursionCount = 0): Ty return []; } +// Determines if the type variable appears within the type and only within +// a particular Callable within that type. +export function isTypeVarLimitedToCallable(type: Type, typeVar: TypeVarType): boolean { + const info = getTypeVarWithinTypeInfoRecursive(type, typeVar); + return info.isTypeVarUsed && info.isUsedInCallable; +} + +function getTypeVarWithinTypeInfoRecursive( + type: Type, + typeVar: TypeVarType, + recursionCount = 0 +): { + isTypeVarUsed: boolean; + isUsedInCallable: boolean; +} { + if (recursionCount > maxTypeRecursionCount) { + return { isTypeVarUsed: false, isUsedInCallable: false }; + } + recursionCount++; + + let typeVarUsedCount = 0; + let usedInCallableCount = 0; + + if (isTypeVar(type)) { + // Ignore P.args or P.kwargs types. + if (!isParamSpec(type) || !type.paramSpecAccess) { + if (isTypeSame(typeVar, convertToInstance(type))) { + typeVarUsedCount++; + } + } + } else if (isClass(type)) { + if (type.typeArguments) { + type.typeArguments.forEach((typeArg) => { + const subResult = getTypeVarWithinTypeInfoRecursive(typeArg, typeVar, recursionCount); + if (subResult.isTypeVarUsed) { + typeVarUsedCount++; + } + if (subResult.isUsedInCallable) { + usedInCallableCount++; + } + }); + } + } else if (isUnion(type)) { + doForEachSubtype(type, (subtype) => { + const subResult = getTypeVarWithinTypeInfoRecursive(subtype, typeVar, recursionCount); + if (subResult.isTypeVarUsed) { + typeVarUsedCount++; + } + if (subResult.isUsedInCallable) { + usedInCallableCount++; + } + }); + } else if (isFunction(type)) { + for (let i = 0; i < type.details.parameters.length; i++) { + if ( + getTypeVarWithinTypeInfoRecursive( + FunctionType.getEffectiveParameterType(type, i), + typeVar, + recursionCount + ).isTypeVarUsed + ) { + typeVarUsedCount++; + } + } + + if (type.details.paramSpec) { + if (isTypeSame(typeVar, convertToInstance(type.details.paramSpec))) { + typeVarUsedCount++; + } + } + + const returnType = FunctionType.getSpecializedReturnType(type); + if (returnType) { + if (getTypeVarWithinTypeInfoRecursive(returnType, typeVar, recursionCount).isTypeVarUsed) { + typeVarUsedCount++; + } + } + + if (typeVarUsedCount > 0) { + typeVarUsedCount = 1; + usedInCallableCount = 1; + } + } + + return { + isTypeVarUsed: typeVarUsedCount > 0, + isUsedInCallable: usedInCallableCount === 1 && typeVarUsedCount === 1, + }; +} + // Creates a specialized version of the class, filling in any unspecified // type arguments with Unknown. export function specializeClassType(type: ClassType): ClassType { @@ -1503,7 +1531,7 @@ export function specializeClassType(type: ClassType): ClassType { // to the specified srcType. export function setTypeArgumentsRecursive( destType: Type, - srcType: Type, + srcType: UnknownType | AnyType, typeVarContext: TypeVarContext, recursionCount = 0 ) { @@ -1563,15 +1591,16 @@ export function setTypeArgumentsRecursive( } if (destType.details.paramSpec) { - // Fill in an empty signature for a ParamSpec if the source is Any or Unknown. - if (!typeVarContext.hasTypeVar(destType.details.paramSpec) && isAnyOrUnknown(srcType)) { - typeVarContext.setParamSpec(destType.details.paramSpec, { - flags: FunctionTypeFlags.None, - parameters: FunctionType.getDefaultParameters(), - typeVarScopeId: undefined, - docString: undefined, - paramSpec: undefined, - }); + // Fill in an empty signature for a ParamSpec. + if (!typeVarContext.getPrimarySignature().getTypeVar(destType.details.paramSpec)) { + const newFunction = FunctionType.createInstance( + '', + '', + '', + FunctionTypeFlags.SkipArgsKwargsCompatibilityCheck | FunctionTypeFlags.ParamSpecValue + ); + FunctionType.addDefaultParameters(newFunction); + typeVarContext.setTypeVarType(destType.details.paramSpec, newFunction); } } } @@ -1584,7 +1613,7 @@ export function setTypeArgumentsRecursive( break; case TypeCategory.TypeVar: - if (!typeVarContext.hasTypeVar(destType)) { + if (!typeVarContext.getPrimarySignature().getTypeVar(destType)) { typeVarContext.setTypeVarType(destType, srcType); } break; @@ -1608,7 +1637,7 @@ export function buildTypeVarContextFromSpecializedClass(classType: ClassType, ma const typeVarContext = buildTypeVarContext(typeParameters, typeArguments, getTypeVarScopeId(classType)); if (ClassType.isTupleClass(classType) && classType.tupleTypeArguments && typeParameters.length >= 1) { - typeVarContext.setVariadicTypeVar(typeParameters[0], classType.tupleTypeArguments); + typeVarContext.setTupleTypeVar(typeParameters[0], classType.tupleTypeArguments); } return typeVarContext; @@ -1628,41 +1657,21 @@ export function buildTypeVarContext( if (index < typeArgs.length) { typeArgType = typeArgs[index]; if (isFunction(typeArgType) && FunctionType.isParamSpecValue(typeArgType)) { - const paramSpecEntries: ParamSpecEntry[] = []; + const parameters: FunctionParameter[] = []; const typeArgFunctionType = typeArgType; typeArgType.details.parameters.forEach((param, paramIndex) => { - paramSpecEntries.push({ + parameters.push({ category: param.category, name: param.name, hasDefault: !!param.hasDefault, + defaultValueExpression: param.defaultValueExpression, isNameSynthesized: param.isNameSynthesized, type: FunctionType.getEffectiveParameterType(typeArgFunctionType, paramIndex), }); }); - typeVarContext.setParamSpec(typeParam, { - parameters: paramSpecEntries, - typeVarScopeId: typeArgType.details.typeVarScopeId, - flags: typeArgType.details.flags, - docString: typeArgType.details.docString, - paramSpec: typeArgType.details.paramSpec, - }); - } else if (isParamSpec(typeArgType)) { - typeVarContext.setParamSpec(typeParam, { - flags: FunctionTypeFlags.None, - parameters: [], - typeVarScopeId: undefined, - docString: undefined, - paramSpec: typeArgType, - }); - } else if (isAnyOrUnknown(typeArgType)) { - // Fill in an empty signature if the arg type is Any or Unknown. - typeVarContext.setParamSpec(typeParam, { - flags: FunctionTypeFlags.SkipArgsKwargsCompatibilityCheck, - parameters: FunctionType.getDefaultParameters(), - typeVarScopeId: undefined, - docString: undefined, - paramSpec: undefined, - }); + typeVarContext.setTypeVarType(typeParam, convertTypeToParamSpecValue(typeArgType)); + } else if (isParamSpec(typeArgType) || isAnyOrUnknown(typeArgType)) { + typeVarContext.setTypeVarType(typeParam, convertTypeToParamSpecValue(typeArgType)); } } } else { @@ -1672,7 +1681,12 @@ export function buildTypeVarContext( typeArgType = typeArgs[index]; } - typeVarContext.setTypeVarType(typeParam, typeArgType, typeArgType, /* retainLiteral */ true); + typeVarContext.setTypeVarType( + typeParam, + typeArgType, + /* narrowBoundNoLiterals */ undefined, + typeArgType + ); } } }); @@ -1787,13 +1801,21 @@ export function getGeneratorYieldType(declaredReturnType: Type, isAsync: boolean return isLegalGeneratorType ? yieldType : undefined; } +export function isMetaclassInstance(type: Type): boolean { + return ( + isClassInstance(type) && + type.details.mro.some((mroClass) => isClass(mroClass) && ClassType.isBuiltIn(mroClass, 'type')) + ); +} + export function isEffectivelyInstantiable(type: Type): boolean { if (TypeBase.isInstantiable(type)) { return true; } - // Handle the special case of 'type', which is instantiable. - if (isClassInstance(type) && ClassType.isBuiltIn(type, 'type')) { + // Handle the special case of 'type' (or subclasses thereof), + // which are instantiable. + if (isMetaclassInstance(type)) { return true; } @@ -1805,6 +1827,11 @@ export function isEffectivelyInstantiable(type: Type): boolean { } export function convertToInstance(type: Type, includeSubclasses = true): Type { + // See if we've already performed this conversion and cached it. + if (type.cached?.instanceType) { + return type.cached.instanceType; + } + let result = mapSubtypes(type, (subtype) => { switch (subtype.category) { case TypeCategory.Class: { @@ -1817,6 +1844,11 @@ export function convertToInstance(type: Type, includeSubclasses = true): Type { } } + // Handle NoneType as a special case. + if (TypeBase.isInstantiable(subtype) && ClassType.isBuiltIn(subtype, 'NoneType')) { + return NoneType.createInstance(); + } + return ClassType.cloneAsInstance(subtype, includeSubclasses); } @@ -1854,10 +1886,23 @@ export function convertToInstance(type: Type, includeSubclasses = true): Type { ); } + if (type !== result) { + // Cache the converted value for next time. + if (!type.cached) { + type.cached = {}; + } + type.cached.instanceType = result; + } + return result; } export function convertToInstantiable(type: Type): Type { + // See if we've already performed this conversion and cached it. + if (type.cached?.instantiableType) { + return type.cached.instantiableType; + } + let result = mapSubtypes(type, (subtype) => { switch (subtype.category) { case TypeCategory.Class: { @@ -1892,6 +1937,12 @@ export function convertToInstantiable(type: Type): Type { ); } + // Cache the converted value for next time. + if (!type.cached) { + type.cached = {}; + } + type.cached.instantiableType = result; + return result; } @@ -2074,9 +2125,9 @@ export function explodeGenericClass(classType: ClassType) { // If the type is a union of same-sized tuples, these are combined into // a single tuple with that size. Otherwise, returns undefined. -export function combineSameSizedTuples(type: Type, tupleType: Type | undefined) { +export function combineSameSizedTuples(type: Type, tupleType: Type | undefined): Type { if (!tupleType || !isInstantiableClass(tupleType) || isUnboundedTupleClass(tupleType)) { - return undefined; + return type; } let tupleEntries: Type[][] | undefined; @@ -2118,7 +2169,7 @@ export function combineSameSizedTuples(type: Type, tupleType: Type | undefined) }); if (!isValid || !tupleEntries) { - return undefined; + return type; } return convertToInstance( @@ -2140,7 +2191,16 @@ export function specializeTupleClass( isTypeArgumentExplicit = true, isUnpackedTuple = false ): ClassType { - let combinedTupleType = combineTypes(typeArgs.map((t) => t.type)); + let combinedTupleType = combineTypes( + typeArgs.map((t) => { + if (isTypeVar(t.type) && isUnpackedVariadicTypeVar(t.type)) { + // Treat the unpacked TypeVarTuple as a union. + return TypeVarType.cloneForUnpacked(t.type, /* isInUnion */ true); + } + + return t.type; + }) + ); // An empty tuple has an effective type of Any. if (isNever(combinedTupleType)) { @@ -2232,10 +2292,22 @@ export function getGeneratorTypeArgs(returnType: Type): Type[] | undefined { export function requiresTypeArguments(classType: ClassType) { if (classType.details.typeParameters.length > 0) { + const firstTypeParam = classType.details.typeParameters[0]; + // If there are type parameters, type arguments are needed. // The exception is if type parameters have been synthesized // for classes that have untyped constructors. - return !classType.details.typeParameters[0].details.isSynthesized; + if (firstTypeParam.details.isSynthesized) { + return false; + } + + // If the first type parameter has a default type, then no + // type arguments are needed. + if (firstTypeParam.details.defaultType) { + return false; + } + + return true; } // There are a few built-in special classes that require @@ -2364,6 +2436,77 @@ export function requiresSpecialization( return false; } +// Combines two variances to produce a resulting variance. +export function combineVariances(variance1: Variance, variance2: Variance) { + if (variance1 === Variance.Unknown) { + return variance2; + } + + if ( + variance2 === Variance.Invariant || + (variance2 === Variance.Covariant && variance1 === Variance.Contravariant) || + (variance2 === Variance.Contravariant && variance1 === Variance.Covariant) + ) { + return Variance.Invariant; + } + + return variance1; +} + +// Determines if the variance of the type argument for a generic class is compatible +// With the declared variance of the corresponding type parameter. +export function isVarianceOfTypeArgumentCompatible(type: Type, typeParamVariance: Variance): boolean { + if (typeParamVariance === Variance.Unknown || typeParamVariance === Variance.Auto) { + return true; + } + + if (isTypeVar(type) && !type.details.isParamSpec && !type.details.isVariadic) { + const typeArgVariance = type.details.declaredVariance; + + if (typeArgVariance === Variance.Contravariant || typeArgVariance === Variance.Covariant) { + return typeArgVariance === typeParamVariance; + } + } else if (isClassInstance(type)) { + if (type.details.typeParameters && type.details.typeParameters.length > 0) { + return type.details.typeParameters.every((typeParam, index) => { + let typeArgType: Type | undefined; + + if (typeParam.details.isParamSpec || typeParam.details.isVariadic) { + return true; + } + + if (type.typeArguments && index < type.typeArguments.length) { + typeArgType = type.typeArguments[index]; + } + + const declaredVariance = typeParam.details.declaredVariance; + if (declaredVariance === Variance.Auto) { + return true; + } + + let effectiveVariance = Variance.Invariant; + if (declaredVariance === Variance.Covariant) { + // If the declared variance is covariant, the effective variance + // is simply copied from the type param variance. + effectiveVariance = typeParamVariance; + } else if (declaredVariance === Variance.Contravariant) { + // If the declared variance is contravariant, it flips the + // effective variance from contravariant to covariant or vice versa. + if (typeParamVariance === Variance.Covariant) { + effectiveVariance = Variance.Contravariant; + } else if (typeParamVariance === Variance.Contravariant) { + effectiveVariance = Variance.Covariant; + } + } + + return isVarianceOfTypeArgumentCompatible(typeArgType ?? UnknownType.create(), effectiveVariance); + }); + } + } + + return true; +} + // Computes the method resolution ordering for a class whose base classes // have already been filled in. The algorithm for computing MRO is described // here: https://www.python.org/download/releases/2.3/mro/. It returns true @@ -2409,7 +2552,7 @@ export function computeMroLinearization(classType: ClassType): boolean { // Construct the list of class lists that need to be merged. const classListsToMerge: Type[][] = []; - filteredBaseClasses.forEach((baseClass, index) => { + filteredBaseClasses.forEach((baseClass) => { if (isInstantiableClass(baseClass)) { const typeVarContext = buildTypeVarContextFromSpecializedClass(baseClass, /* makeConcrete */ false); classListsToMerge.push( @@ -2559,32 +2702,75 @@ function addDeclaringModuleNamesForType(type: Type, moduleList: string[], recurs } } -export function convertParamSpecValueToType(paramSpecEntry: ParamSpecValue, omitParamSpec = false): Type { - let hasParameters = paramSpecEntry.parameters.length > 0; +export function convertTypeToParamSpecValue(type: Type): FunctionType { + if (isParamSpec(type)) { + const newFunction = FunctionType.createInstance('', '', '', FunctionTypeFlags.ParamSpecValue); + newFunction.details.paramSpec = type; + newFunction.details.typeVarScopeId = getTypeVarScopeId(type); + return newFunction; + } + + if (isFunction(type)) { + const newFunction = FunctionType.createInstance( + '', + '', + '', + type.details.flags | FunctionTypeFlags.ParamSpecValue, + type.details.docString + ); + + type.details.parameters.forEach((param, index) => { + FunctionType.addParameter(newFunction, { + category: param.category, + name: param.name, + hasDefault: param.hasDefault, + defaultValueExpression: param.defaultValueExpression, + isNameSynthesized: param.isNameSynthesized, + type: FunctionType.getEffectiveParameterType(type, index), + }); + }); + newFunction.details.typeVarScopeId = getTypeVarScopeId(type); + newFunction.details.paramSpec = type.details.paramSpec; + return newFunction; + } + + const newFunction = FunctionType.createInstance( + '', + '', + '', + FunctionTypeFlags.ParamSpecValue | FunctionTypeFlags.SkipArgsKwargsCompatibilityCheck + ); + FunctionType.addDefaultParameters(newFunction); + return newFunction; +} + +export function convertParamSpecValueToType(paramSpecValue: FunctionType, omitParamSpec = false): Type { + let hasParameters = paramSpecValue.details.parameters.length > 0; - if (paramSpecEntry.parameters.length === 1) { + if (paramSpecValue.details.parameters.length === 1) { // If the ParamSpec has a position-only separator as its only parameter, // treat it as though there are no parameters. - const onlyParam = paramSpecEntry.parameters[0]; + const onlyParam = paramSpecValue.details.parameters[0]; if (onlyParam.category === ParameterCategory.Simple && !onlyParam.name) { hasParameters = false; } } - if (hasParameters || !paramSpecEntry.paramSpec || omitParamSpec) { + if (hasParameters || !paramSpecValue.details.paramSpec || omitParamSpec) { // Create a function type from the param spec entries. const functionType = FunctionType.createInstance( '', '', '', - FunctionTypeFlags.ParamSpecValue | paramSpecEntry.flags + FunctionTypeFlags.ParamSpecValue | paramSpecValue.details.flags ); - paramSpecEntry.parameters.forEach((entry) => { + paramSpecValue.details.parameters.forEach((entry) => { FunctionType.addParameter(functionType, { category: entry.category, name: entry.name, hasDefault: entry.hasDefault, + defaultValueExpression: entry.defaultValueExpression, isNameSynthesized: entry.isNameSynthesized, hasDeclaredType: true, type: entry.type, @@ -2592,14 +2778,14 @@ export function convertParamSpecValueToType(paramSpecEntry: ParamSpecValue, omit }); if (!omitParamSpec) { - functionType.details.paramSpec = paramSpecEntry.paramSpec; + functionType.details.paramSpec = paramSpecValue.details.paramSpec; } - functionType.details.docString = paramSpecEntry.docString; + functionType.details.docString = paramSpecValue.details.docString; return functionType; } - return paramSpecEntry.paramSpec; + return paramSpecValue.details.paramSpec; } // Recursively walks a type and calls a callback for each TypeVar, allowing @@ -2607,14 +2793,15 @@ export function convertParamSpecValueToType(paramSpecEntry: ParamSpecValue, omit class TypeVarTransformer { private _isTransformingTypeArg = false; private _pendingTypeVarTransformations = new Set(); + private _pendingFunctionTransformations: (FunctionType | OverloadedFunctionType)[] = []; - apply(type: Type, recursionCount = 0): Type { + apply(type: Type, recursionCount: number): Type { if (recursionCount > maxTypeRecursionCount) { return type; } recursionCount++; - type = this._transformGenericTypeAlias(type, recursionCount); + type = this.transformGenericTypeAlias(type, recursionCount); // Shortcut the operation if possible. if (!requiresSpecialization(type)) { @@ -2668,18 +2855,27 @@ class TypeVarTransformer { // _pendingTypeVarTransformations set. const typeVarName = TypeVarType.getNameWithScope(type); if (!this._pendingTypeVarTransformations.has(typeVarName)) { - replacementType = this.transformTypeVar(type); + if (type.details.isParamSpec) { + if (!type.paramSpecAccess) { + const paramSpecValue = this.transformParamSpec(type, recursionCount); + if (paramSpecValue) { + replacementType = convertParamSpecValueToType(paramSpecValue); + } + } + } else { + replacementType = this.transformTypeVar(type, recursionCount) ?? type; - if (!this._isTransformingTypeArg) { - this._pendingTypeVarTransformations.add(typeVarName); - replacementType = this.apply(replacementType, recursionCount); - this._pendingTypeVarTransformations.delete(typeVarName); - } + if (!this._isTransformingTypeArg) { + this._pendingTypeVarTransformations.add(typeVarName); + replacementType = this.apply(replacementType, recursionCount); + this._pendingTypeVarTransformations.delete(typeVarName); + } - // If we're transforming a variadic type variable that was in a union, - // expand the union types. - if (isVariadicTypeVar(type) && type.isVariadicInUnion) { - replacementType = _expandVariadicUnpackedUnion(replacementType); + // If we're transforming a variadic type variable that was in a union, + // expand the union types. + if (isVariadicTypeVar(type) && type.isVariadicInUnion) { + replacementType = _expandVariadicUnpackedUnion(replacementType); + } } } @@ -2702,7 +2898,7 @@ class TypeVarTransformer { } if (this.transformUnionSubtype) { - return this.transformUnionSubtype(subtype, transformedType); + return this.transformUnionSubtype(subtype, transformedType, recursionCount); } return transformedType; @@ -2712,26 +2908,50 @@ class TypeVarTransformer { } if (isClass(type)) { - return this._transformTypeVarsInClassType(type, recursionCount); + return this.transformTypeVarsInClassType(type, recursionCount); } if (isFunction(type)) { - return this._transformTypeVarsInFunctionType(type, recursionCount); + // Prevent recursion. + if (this._pendingFunctionTransformations.some((t) => t === type)) { + return type; + } + + this._pendingFunctionTransformations.push(type); + const result = this.transformTypeVarsInFunctionType(type, recursionCount); + this._pendingFunctionTransformations.pop(); + + return result; } if (isOverloadedFunction(type)) { + // Prevent recursion. + if (this._pendingFunctionTransformations.some((t) => t === type)) { + return type; + } + + this._pendingFunctionTransformations.push(type); + let requiresUpdate = false; // Specialize each of the functions in the overload. const newOverloads: FunctionType[] = []; type.overloads.forEach((entry) => { - const replacementType = this._transformTypeVarsInFunctionType(entry, recursionCount); - newOverloads.push(replacementType); + const replacementType = this.transformTypeVarsInFunctionType(entry, recursionCount); + + if (isFunction(replacementType)) { + newOverloads.push(replacementType); + } else { + newOverloads.push(...replacementType.overloads); + } + if (replacementType !== entry) { requiresUpdate = true; } }); + this._pendingFunctionTransformations.pop(); + // Construct a new overload with the specialized function types. return requiresUpdate ? OverloadedFunctionType.create(newOverloads) : type; } @@ -2739,23 +2959,29 @@ class TypeVarTransformer { return type; } - transformTypeVar(typeVar: TypeVarType): Type { - return typeVar; + transformTypeVar(typeVar: TypeVarType, recursionCount: number): Type | undefined { + return undefined; } - transformVariadicTypeVar(paramSpec: TypeVarType): TupleTypeArgument[] | undefined { + transformTupleTypeVar(paramSpec: TypeVarType, recursionCount: number): TupleTypeArgument[] | undefined { return undefined; } - transformParamSpec(paramSpec: TypeVarType): ParamSpecValue | undefined { + transformParamSpec(paramSpec: TypeVarType, recursionCount: number): FunctionType | undefined { return undefined; } - transformUnionSubtype(preTransform: Type, postTransform: Type): Type | undefined { + transformUnionSubtype(preTransform: Type, postTransform: Type, recursionCount: number): Type | undefined { return postTransform; } - private _transformGenericTypeAlias(type: Type, recursionCount: number) { + doForEachSignatureContext(callback: () => FunctionType): FunctionType | OverloadedFunctionType { + // By default, simply return the result of the callback. Subclasses + // can override this method as they see fit. + return callback(); + } + + transformGenericTypeAlias(type: Type, recursionCount: number) { if (!type.typeAliasInfo || !type.typeAliasInfo.typeParameters || !type.typeAliasInfo.typeArguments) { return type; } @@ -2781,19 +3007,19 @@ class TypeVarTransformer { : type; } - private _transformTypeVarsInClassType(classType: ClassType, recursionCount: number): ClassType { + transformTypeVarsInClassType(classType: ClassType, recursionCount: number): ClassType { // Handle the common case where the class has no type parameters. if (ClassType.getTypeParameters(classType).length === 0 && !ClassType.isSpecialBuiltIn(classType)) { return classType; } let newTypeArgs: Type[] = []; - let newVariadicTypeArgs: TupleTypeArgument[] | undefined; + let newTupleTypeArgs: TupleTypeArgument[] | undefined; let specializationNeeded = false; const typeParams = ClassType.getTypeParameters(classType); const transformParamSpec = (paramSpec: TypeVarType) => { - const paramSpecValue = this.transformParamSpec(paramSpec); + const paramSpecValue = this.transformParamSpec(paramSpec, recursionCount); if (paramSpecValue) { specializationNeeded = true; return convertParamSpecValueToType(paramSpecValue); @@ -2840,15 +3066,12 @@ class TypeVarTransformer { } else { const typeParamName = TypeVarType.getNameWithScope(typeParam); if (!this._pendingTypeVarTransformations.has(typeParamName)) { - replacementType = this.transformTypeVar(typeParam); + const transformedType = this.transformTypeVar(typeParam, recursionCount); + replacementType = transformedType ?? typeParam; if (replacementType !== typeParam) { - if (!this._isTransformingTypeArg) { - this._pendingTypeVarTransformations.add(typeParamName); - replacementType = this.apply(replacementType, recursionCount); - this._pendingTypeVarTransformations.delete(typeParamName); - } - + specializationNeeded = true; + } else if (transformedType !== undefined && !classType.typeArguments) { specializationNeeded = true; } } @@ -2860,7 +3083,7 @@ class TypeVarTransformer { if (ClassType.isTupleClass(classType)) { if (classType.tupleTypeArguments) { - newVariadicTypeArgs = []; + newTupleTypeArgs = []; classType.tupleTypeArguments.forEach((oldTypeArgType) => { const newTypeArgType = this.apply(oldTypeArgType.type, recursionCount); @@ -2869,19 +3092,19 @@ class TypeVarTransformer { } if ( - isVariadicTypeVar(oldTypeArgType.type) && + isUnpackedVariadicTypeVar(oldTypeArgType.type) && isClassInstance(newTypeArgType) && isTupleClass(newTypeArgType) && newTypeArgType.tupleTypeArguments ) { - appendArray(newVariadicTypeArgs!, newTypeArgType.tupleTypeArguments); + appendArray(newTupleTypeArgs!, newTypeArgType.tupleTypeArguments); } else { - newVariadicTypeArgs!.push({ type: newTypeArgType, isUnbounded: oldTypeArgType.isUnbounded }); + newTupleTypeArgs!.push({ type: newTypeArgType, isUnbounded: oldTypeArgType.isUnbounded }); } }); } else if (typeParams.length > 0) { - newVariadicTypeArgs = this.transformVariadicTypeVar(typeParams[0]); - if (newVariadicTypeArgs) { + newTupleTypeArgs = this.transformTupleTypeVar(typeParams[0], recursionCount); + if (newTupleTypeArgs) { specializationNeeded = true; } } @@ -2899,221 +3122,300 @@ class TypeVarTransformer { newTypeArgs, /* isTypeArgumentExplicit */ true, /* includeSubclasses */ undefined, - newVariadicTypeArgs + newTupleTypeArgs ); } - private _transformTypeVarsInFunctionType(sourceType: FunctionType, recursionCount: number): FunctionType { - let functionType = sourceType; + transformTypeVarsInFunctionType( + sourceType: FunctionType, + recursionCount: number + ): FunctionType | OverloadedFunctionType { + return this.doForEachSignatureContext(() => { + let functionType = sourceType; - // Handle functions with a parameter specification in a special manner. - if (functionType.details.paramSpec) { - const paramSpec = this.transformParamSpec(functionType.details.paramSpec); - if (paramSpec) { - functionType = FunctionType.cloneForParamSpec(functionType, paramSpec); + // Handle functions with a parameter specification in a special manner. + if (functionType.details.paramSpec) { + const paramSpec = this.transformParamSpec(functionType.details.paramSpec, recursionCount); + if (paramSpec) { + functionType = FunctionType.cloneForParamSpec(functionType, paramSpec); + } } - } - const declaredReturnType = FunctionType.getSpecializedReturnType(functionType); - const specializedReturnType = declaredReturnType ? this.apply(declaredReturnType, recursionCount) : undefined; - let typesRequiredSpecialization = declaredReturnType !== specializedReturnType; + const declaredReturnType = FunctionType.getSpecializedReturnType(functionType); + const specializedReturnType = declaredReturnType + ? this.apply(declaredReturnType, recursionCount) + : undefined; + let typesRequiredSpecialization = declaredReturnType !== specializedReturnType; - const specializedParameters: SpecializedFunctionTypes = { - parameterTypes: [], - returnType: specializedReturnType, - }; + const specializedParameters: SpecializedFunctionTypes = { + parameterTypes: [], + returnType: specializedReturnType, + }; - // Does this function end with *args: P.args, **args: P.kwargs? If so, we'll - // modify the function and replace these parameters with the signature captured - // by the ParamSpec. - if (functionType.details.parameters.length >= 2) { - const argsParam = functionType.details.parameters[functionType.details.parameters.length - 2]; - const kwargsParam = functionType.details.parameters[functionType.details.parameters.length - 1]; - const argsParamType = FunctionType.getEffectiveParameterType( - functionType, - functionType.details.parameters.length - 2 - ); - const kwargsParamType = FunctionType.getEffectiveParameterType( - functionType, - functionType.details.parameters.length - 1 - ); + // Does this function end with *args: P.args, **args: P.kwargs? If so, we'll + // modify the function and replace these parameters with the signature captured + // by the ParamSpec. + if (functionType.details.parameters.length >= 2) { + const argsParam = functionType.details.parameters[functionType.details.parameters.length - 2]; + const kwargsParam = functionType.details.parameters[functionType.details.parameters.length - 1]; + const argsParamType = FunctionType.getEffectiveParameterType( + functionType, + functionType.details.parameters.length - 2 + ); + const kwargsParamType = FunctionType.getEffectiveParameterType( + functionType, + functionType.details.parameters.length - 1 + ); - if ( - argsParam.category === ParameterCategory.VarArgList && - kwargsParam.category === ParameterCategory.VarArgDictionary && - isParamSpec(argsParamType) && - isParamSpec(kwargsParamType) && - isTypeSame(argsParamType, kwargsParamType) - ) { - const paramSpecType = this.transformParamSpec(argsParamType); - if (paramSpecType) { - if ( - paramSpecType.parameters.length > 0 || - paramSpecType.paramSpec === undefined || - !isTypeSame(argsParamType, paramSpecType.paramSpec) - ) { - functionType = FunctionType.cloneForParamSpecApplication(functionType, paramSpecType); + if ( + argsParam.category === ParameterCategory.VarArgList && + kwargsParam.category === ParameterCategory.VarArgDictionary && + isParamSpec(argsParamType) && + isParamSpec(kwargsParamType) && + isTypeSame(argsParamType, kwargsParamType) + ) { + const paramSpecType = this.transformParamSpec(argsParamType, recursionCount); + if (paramSpecType) { + if ( + paramSpecType.details.parameters.length > 0 || + paramSpecType.details.paramSpec === undefined || + !isTypeSame(argsParamType, paramSpecType.details.paramSpec) + ) { + functionType = FunctionType.cloneForParamSpecApplication(functionType, paramSpecType); + } } } } - } - let variadicParamIndex: number | undefined; - let variadicTypesToUnpack: TupleTypeArgument[] | undefined; - const specializedDefaultArgs: (Type | undefined)[] = []; + let variadicParamIndex: number | undefined; + let variadicTypesToUnpack: TupleTypeArgument[] | undefined; + const specializedDefaultArgs: (Type | undefined)[] = []; - const wasTransformingTypeArg = this._isTransformingTypeArg; - this._isTransformingTypeArg = true; + const wasTransformingTypeArg = this._isTransformingTypeArg; + this._isTransformingTypeArg = true; - for (let i = 0; i < functionType.details.parameters.length; i++) { - const paramType = FunctionType.getEffectiveParameterType(functionType, i); - const specializedType = this.apply(paramType, recursionCount); - specializedParameters.parameterTypes.push(specializedType); - - // Do we need to specialize the default argument type for this parameter? - let defaultArgType = FunctionType.getEffectiveParameterDefaultArgType(functionType, i); - if (defaultArgType) { - const specializedArgType = this.apply(defaultArgType, recursionCount); - if (specializedArgType !== defaultArgType) { - defaultArgType = specializedArgType; - typesRequiredSpecialization = true; + for (let i = 0; i < functionType.details.parameters.length; i++) { + const paramType = FunctionType.getEffectiveParameterType(functionType, i); + const specializedType = this.apply(paramType, recursionCount); + specializedParameters.parameterTypes.push(specializedType); + + // Do we need to specialize the default argument type for this parameter? + let defaultArgType = FunctionType.getEffectiveParameterDefaultArgType(functionType, i); + if (defaultArgType) { + const specializedArgType = this.apply(defaultArgType, recursionCount); + if (specializedArgType !== defaultArgType) { + defaultArgType = specializedArgType; + typesRequiredSpecialization = true; + } } - } - specializedDefaultArgs.push(defaultArgType); + specializedDefaultArgs.push(defaultArgType); - if ( - variadicParamIndex === undefined && - isVariadicTypeVar(paramType) && - functionType.details.parameters[i].category === ParameterCategory.VarArgList - ) { - variadicParamIndex = i; + if ( + variadicParamIndex === undefined && + isVariadicTypeVar(paramType) && + functionType.details.parameters[i].category === ParameterCategory.VarArgList + ) { + variadicParamIndex = i; - if (isClassInstance(specializedType) && isTupleClass(specializedType) && specializedType.isUnpacked) { - variadicTypesToUnpack = specializedType.tupleTypeArguments; + if ( + isClassInstance(specializedType) && + isTupleClass(specializedType) && + specializedType.isUnpacked + ) { + variadicTypesToUnpack = specializedType.tupleTypeArguments; + } } - } - if (paramType !== specializedType) { - typesRequiredSpecialization = true; + if (paramType !== specializedType) { + typesRequiredSpecialization = true; + } } - } - let specializedInferredReturnType: Type | undefined; - if (functionType.inferredReturnType) { - specializedInferredReturnType = this.apply(functionType.inferredReturnType, recursionCount); - if (specializedInferredReturnType !== functionType.inferredReturnType) { - typesRequiredSpecialization = true; + let specializedInferredReturnType: Type | undefined; + if (functionType.inferredReturnType) { + specializedInferredReturnType = this.apply(functionType.inferredReturnType, recursionCount); + if (specializedInferredReturnType !== functionType.inferredReturnType) { + typesRequiredSpecialization = true; + } } - } - this._isTransformingTypeArg = wasTransformingTypeArg; + this._isTransformingTypeArg = wasTransformingTypeArg; - if (!typesRequiredSpecialization) { - return functionType; - } + if (!typesRequiredSpecialization) { + return functionType; + } - if (specializedDefaultArgs.some((t) => t !== undefined)) { - specializedParameters.parameterDefaultArgs = specializedDefaultArgs; - } + if (specializedDefaultArgs.some((t) => t !== undefined)) { + specializedParameters.parameterDefaultArgs = specializedDefaultArgs; + } - // If there was no unpacked variadic type variable, we're done. - if (!variadicTypesToUnpack) { - return FunctionType.cloneForSpecialization( - functionType, - specializedParameters, - specializedInferredReturnType - ); - } + // If there was no unpacked variadic type variable, we're done. + if (!variadicTypesToUnpack) { + return FunctionType.cloneForSpecialization( + functionType, + specializedParameters, + specializedInferredReturnType + ); + } - // Unpack the tuple and synthesize a new function in the process. - const newFunctionType = FunctionType.createSynthesizedInstance(''); - let insertKeywordOnlySeparator = false; - let swallowPositionOnlySeparator = false; + // Unpack the tuple and synthesize a new function in the process. + const newFunctionType = FunctionType.createSynthesizedInstance('', functionType.details.flags); + let insertKeywordOnlySeparator = false; + let swallowPositionOnlySeparator = false; - specializedParameters.parameterTypes.forEach((paramType, index) => { - if (index === variadicParamIndex) { - let sawUnboundedEntry = false; + specializedParameters.parameterTypes.forEach((paramType, index) => { + if (index === variadicParamIndex) { + let sawUnboundedEntry = false; - // Unpack the tuple into individual parameters. - variadicTypesToUnpack!.forEach((unpackedType) => { - FunctionType.addParameter(newFunctionType, { - category: unpackedType.isUnbounded ? ParameterCategory.VarArgList : ParameterCategory.Simple, - name: `__p${newFunctionType.details.parameters.length}`, - isNameSynthesized: true, - type: unpackedType.type, - hasDeclaredType: true, + // Unpack the tuple into individual parameters. + variadicTypesToUnpack!.forEach((unpackedType) => { + FunctionType.addParameter(newFunctionType, { + category: unpackedType.isUnbounded + ? ParameterCategory.VarArgList + : ParameterCategory.Simple, + name: `__p${newFunctionType.details.parameters.length}`, + isNameSynthesized: true, + type: unpackedType.type, + hasDeclaredType: true, + }); + + if (unpackedType.isUnbounded) { + sawUnboundedEntry = true; + } }); - if (unpackedType.isUnbounded) { - sawUnboundedEntry = true; + if (sawUnboundedEntry) { + swallowPositionOnlySeparator = true; + } else { + insertKeywordOnlySeparator = true; + } + } else { + const param = { ...functionType.details.parameters[index] }; + + if (param.category === ParameterCategory.VarArgList && !param.name) { + insertKeywordOnlySeparator = false; + } else if (param.category === ParameterCategory.VarArgDictionary) { + insertKeywordOnlySeparator = false; } - }); - if (sawUnboundedEntry) { - swallowPositionOnlySeparator = true; - } else { - insertKeywordOnlySeparator = true; - } - } else { - const param = { ...functionType.details.parameters[index] }; + // Insert a keyword-only separator parameter if we previously + // unpacked a variadic TypeVar. + if (param.category === ParameterCategory.Simple && param.name && insertKeywordOnlySeparator) { + FunctionType.addParameter(newFunctionType, { + category: ParameterCategory.VarArgList, + type: UnknownType.create(), + }); + insertKeywordOnlySeparator = false; + } - if (param.category === ParameterCategory.VarArgList && !param.name) { - insertKeywordOnlySeparator = false; - } else if (param.category === ParameterCategory.VarArgDictionary) { - insertKeywordOnlySeparator = false; - } + param.type = paramType; + if (param.name && param.isNameSynthesized) { + param.name = `__p${newFunctionType.details.parameters.length}`; + } - // Insert a keyword-only separator parameter if we previously - // unpacked a variadic TypeVar. - if (param.category === ParameterCategory.Simple && param.name && insertKeywordOnlySeparator) { - FunctionType.addParameter(newFunctionType, { - category: ParameterCategory.VarArgList, - type: UnknownType.create(), - }); - insertKeywordOnlySeparator = false; + if (param.category !== ParameterCategory.Simple || param.name || !swallowPositionOnlySeparator) { + FunctionType.addParameter(newFunctionType, param); + } } + }); - param.type = paramType; - if (param.name && param.isNameSynthesized) { - param.name = `__p${newFunctionType.details.parameters.length}`; - } + newFunctionType.details.declaredReturnType = specializedParameters.returnType; - if (param.category !== ParameterCategory.Simple || param.name || !swallowPositionOnlySeparator) { - FunctionType.addParameter(newFunctionType, param); - } - } + return newFunctionType; }); + } +} + +// For a TypeVar with a default type, validates whether the default type is using +// any other TypeVars that are not currently in scope. +class TypeVarDefaultValidator extends TypeVarTransformer { + constructor(private _liveTypeParams: TypeVarType[], private _invalidTypeVars: Set) { + super(); + } + + override transformTypeVar(typeVar: TypeVarType) { + const replacementType = this._liveTypeParams.find((param) => param.details.name === typeVar.details.name); + if (!replacementType || isParamSpec(replacementType)) { + this._invalidTypeVars.add(typeVar.details.name); + } + + return UnknownType.create(); + } - newFunctionType.details.declaredReturnType = specializedParameters.returnType; + override transformParamSpec(paramSpec: TypeVarType) { + const replacementType = this._liveTypeParams.find((param) => param.details.name === paramSpec.details.name); + if (!replacementType || !isParamSpec(replacementType)) { + this._invalidTypeVars.add(paramSpec.details.name); + } + + return undefined; + } +} + +class UniqueFunctionSignatureTransformer extends TypeVarTransformer { + constructor(private _signatureTracker: UniqueSignatureTracker) { + super(); + } + + override transformTypeVarsInFunctionType( + sourceType: FunctionType, + recursionCount: number + ): FunctionType | OverloadedFunctionType { + // If this function has already been specialized or is not generic, + // there's no need to check for uniqueness. + if (sourceType.specializedTypes || sourceType.details.typeParameters.length === 0) { + return super.transformTypeVarsInFunctionType(sourceType, recursionCount); + } + + let updatedSourceType: Type = sourceType; + const existingSignature = this._signatureTracker.findSignature(sourceType); + if (existingSignature) { + const typeVarContext = new TypeVarContext(getTypeVarScopeId(sourceType)); + + // Create new type variables with the same scope but with + // different (unique) names. + sourceType.details.typeParameters.forEach((typeParam) => { + const replacement = TypeVarType.cloneForNewName( + typeParam, + `${typeParam.details.name}(${existingSignature.count})` + ); + typeVarContext.setTypeVarType(typeParam, replacement); - return newFunctionType; + updatedSourceType = applySolvedTypeVars(sourceType, typeVarContext); + }); + } + + this._signatureTracker.addSignature(sourceType); + + return updatedSourceType; } } // Specializes a (potentially generic) type by substituting // type variables from a type var map. class ApplySolvedTypeVarsTransformer extends TypeVarTransformer { - constructor( - private _typeVarContext: TypeVarContext, - private _unknownIfNotFound = false, - private _useNarrowBoundOnly = false, - private _eliminateUnsolvedInUnions = false, - private _typeClassType?: Type - ) { + private _isSolvingDefaultType = false; + private _activeTypeVarSignatureContextIndex: number | undefined; + + constructor(private _typeVarContext: TypeVarContext, private _options: ApplyTypeVarOptions) { super(); } - override transformTypeVar(typeVar: TypeVarType) { + override transformTypeVar(typeVar: TypeVarType, recursionCount: number) { + const signatureContext = this._typeVarContext.getSignatureContext( + this._activeTypeVarSignatureContextIndex ?? 0 + ); + // If the type variable is unrelated to the scopes we're solving, // don't transform that type variable. if (typeVar.scopeId && this._typeVarContext.hasSolveForScope(typeVar.scopeId)) { - let replacement = this._typeVarContext.getTypeVarType(typeVar, this._useNarrowBoundOnly); + let replacement = signatureContext.getTypeVarType(typeVar, !!this._options.useNarrowBoundOnly); // If there was no narrow bound but there is a wide bound that // contains literals, we'll use the wide bound even if "useNarrowBoundOnly" // is specified. - if (!replacement && this._useNarrowBoundOnly) { - const wideType = this._typeVarContext.getTypeVarType(typeVar); + if (!replacement && !!this._options.useNarrowBoundOnly) { + const wideType = signatureContext.getTypeVarType(typeVar); if (wideType) { if (containsLiteralType(wideType, /* includeTypeArgs */ true)) { replacement = wideType; @@ -3125,11 +3427,11 @@ class ApplySolvedTypeVarsTransformer extends TypeVarTransformer { if (TypeBase.isInstantiable(typeVar)) { if ( isAnyOrUnknown(replacement) && - this._typeClassType && - isInstantiableClass(this._typeClassType) + this._options.typeClassType && + isInstantiableClass(this._options.typeClassType) ) { replacement = ClassType.cloneForSpecialization( - ClassType.cloneAsInstance(this._typeClassType), + ClassType.cloneAsInstance(this._options.typeClassType), [replacement], /* isTypeArgumentExplicit */ true ); @@ -3141,13 +3443,53 @@ class ApplySolvedTypeVarsTransformer extends TypeVarTransformer { } // If this typeVar is in scope for what we're solving but the type - // var map doesn't contain any entry for it, replace with Unknown. - if (this._unknownIfNotFound && !this._typeVarContext.hasSolveForScope(WildcardTypeVarScopeId)) { + // var map doesn't contain any entry for it, replace with the + // default or Unknown. + if (this._options.unknownIfNotFound && !this._typeVarContext.hasSolveForScope(WildcardTypeVarScopeId)) { + // Use the default value if there is one. + if (typeVar.details.defaultType && !this._options.useUnknownOverDefault) { + return this._solveDefaultType(typeVar.details.defaultType, recursionCount); + } + return UnknownType.create(); } } - return typeVar; + // If we're solving a default type, handle type variables with no scope ID. + if (this._isSolvingDefaultType && !typeVar.scopeId) { + const replacementEntry = signatureContext + .getTypeVars() + .find((entry) => entry.typeVar.details.name === typeVar.details.name); + + if (replacementEntry) { + return signatureContext.getTypeVarType(replacementEntry.typeVar); + } + + if (typeVar.details.defaultType) { + return this.apply(typeVar.details.defaultType, recursionCount); + } + + return UnknownType.create(); + } + + // If we're solving a default type, handle type variables with no scope ID. + if (this._isSolvingDefaultType && !typeVar.scopeId) { + const replacementEntry = signatureContext + .getTypeVars() + .find((entry) => entry.typeVar.details.name === typeVar.details.name); + + if (replacementEntry) { + return signatureContext.getTypeVarType(replacementEntry.typeVar); + } + + if (typeVar.details.defaultType) { + return this.apply(typeVar.details.defaultType, recursionCount); + } + + return UnknownType.create(); + } + + return undefined; } override transformUnionSubtype(preTransform: Type, postTransform: Type): Type | undefined { @@ -3156,7 +3498,7 @@ class ApplySolvedTypeVarsTransformer extends TypeVarTransformer { // in cases where TypeVars can go unsolved due to unions in parameter // annotations, like this: // def test(x: Union[str, T]) -> Union[str, T] - if (this._eliminateUnsolvedInUnions) { + if (this._options.eliminateUnsolvedInUnions) { if ( isTypeVar(preTransform) && preTransform.scopeId !== undefined && @@ -3170,7 +3512,7 @@ class ApplySolvedTypeVarsTransformer extends TypeVarTransformer { // If _unknownIfNotFound is true, the postTransform type will // be Unknown, which we want to eliminate. - if (isUnknown(postTransform) && this._unknownIfNotFound) { + if (isUnknown(postTransform) && this._options.unknownIfNotFound) { return undefined; } } @@ -3179,84 +3521,126 @@ class ApplySolvedTypeVarsTransformer extends TypeVarTransformer { return postTransform; } - override transformVariadicTypeVar(typeVar: TypeVarType) { + override transformTupleTypeVar(typeVar: TypeVarType): TupleTypeArgument[] | undefined { if (!typeVar.scopeId || !this._typeVarContext.hasSolveForScope(typeVar.scopeId)) { + const defaultType = typeVar.details.defaultType; + + if (defaultType && isClassInstance(defaultType) && defaultType.tupleTypeArguments) { + return defaultType.tupleTypeArguments; + } + return undefined; } - return this._typeVarContext.getVariadicTypeVar(typeVar); + const signatureContext = this._typeVarContext.getSignatureContext( + this._activeTypeVarSignatureContextIndex ?? 0 + ); + return signatureContext.getTupleTypeVar(typeVar); } - override transformParamSpec(paramSpec: TypeVarType) { + override transformParamSpec(paramSpec: TypeVarType, recursionCount: number): FunctionType | undefined { + const signatureContext = this._typeVarContext.getSignatureContext( + this._activeTypeVarSignatureContextIndex ?? 0 + ); + + // If we're solving a default type, handle param specs with no scope ID. + if (this._isSolvingDefaultType && !paramSpec.scopeId) { + const replacementEntry = signatureContext + .getTypeVars() + .find((entry) => entry.typeVar.details.name === paramSpec.details.name); + + if (replacementEntry) { + return signatureContext.getParamSpecType(replacementEntry.typeVar); + } + + if (paramSpec.details.defaultType) { + return convertTypeToParamSpecValue(this.apply(paramSpec.details.defaultType, recursionCount)); + } + + return this._getUnknownParamSpec(); + } + if (!paramSpec.scopeId || !this._typeVarContext.hasSolveForScope(paramSpec.scopeId)) { return undefined; } - const transformedParamSpec = this._typeVarContext.getParamSpec(paramSpec); + const transformedParamSpec = signatureContext.getParamSpecType(paramSpec); if (transformedParamSpec) { return transformedParamSpec; } - if (this._unknownIfNotFound && !this._typeVarContext.hasSolveForScope(WildcardTypeVarScopeId)) { - // Convert to the ParamSpec equivalent of "Unknown". - const paramSpecValue: ParamSpecValue = { - flags: FunctionTypeFlags.SkipArgsKwargsCompatibilityCheck, - parameters: FunctionType.getDefaultParameters(/* useUnknown */ true), - typeVarScopeId: undefined, - docString: undefined, - paramSpec: undefined, - }; + if (this._options.unknownIfNotFound && !this._typeVarContext.hasSolveForScope(WildcardTypeVarScopeId)) { + // Use the default value if there is one. + if (paramSpec.details.defaultType) { + return convertTypeToParamSpecValue( + this._solveDefaultType(paramSpec.details.defaultType, recursionCount) + ); + } - return paramSpecValue; + // Convert to the ParamSpec equivalent of "Unknown". + return this._getUnknownParamSpec(); } return undefined; } -} -class ExpectedConstructorTypeTransformer extends TypeVarTransformer { - static synthesizedTypeVarIndexForExpectedType = 1; + override doForEachSignatureContext(callback: () => FunctionType): FunctionType | OverloadedFunctionType { + const signatureContexts = this._typeVarContext.getSignatureContexts(); - dummyScopeId = '__expected_type_scope_id'; - dummyTypeVarPrefix = '__expected_type_'; + // Handle the common case where there are not multiple signature contexts. + if (signatureContexts.length <= 1) { + return callback(); + } - constructor(private _typeVarContext: TypeVarContext, private _liveTypeVarScopes: TypeVarScopeId[]) { - super(); + // Loop through all of the signature contexts in the type var context + // to create an overload type. + const overloadTypes = signatureContexts.map((_, index) => { + this._activeTypeVarSignatureContextIndex = index; + return callback(); + }); + this._activeTypeVarSignatureContextIndex = undefined; - this._typeVarContext.addSolveForScope(this.dummyScopeId); - } + const filteredOverloads: FunctionType[] = []; + doForEachSubtype(combineTypes(overloadTypes), (subtype) => { + assert(isFunction(subtype)); + filteredOverloads.push(subtype); + }); - private _isTypeVarLive(typeVar: TypeVarType) { - return this._liveTypeVarScopes.some((scopeId) => typeVar.scopeId === scopeId); + if (filteredOverloads.length === 1) { + return filteredOverloads[0]; + } + + return OverloadedFunctionType.create(filteredOverloads); } - private _createDummyTypeVar(prevTypeVar: TypeVarType) { - // If we previously synthesized this dummy type var, just return it. - if (prevTypeVar.details.isSynthesized && prevTypeVar.details.name.startsWith(this.dummyTypeVarPrefix)) { - return prevTypeVar; - } + private _solveDefaultType(defaultType: Type, recursionCount: number) { + const wasSolvingDefaultType = this._isSolvingDefaultType; + this._isSolvingDefaultType = true; + const result = this.apply(defaultType, recursionCount); + this._isSolvingDefaultType = wasSolvingDefaultType; + return result; + } - const isInstance = TypeBase.isInstance(prevTypeVar); - let newTypeVar = TypeVarType.createInstance( - `__expected_type_${ExpectedConstructorTypeTransformer.synthesizedTypeVarIndexForExpectedType}` + private _getUnknownParamSpec() { + const paramSpecValue = FunctionType.createInstance( + '', + '', + '', + FunctionTypeFlags.ParamSpecValue | FunctionTypeFlags.SkipArgsKwargsCompatibilityCheck ); - newTypeVar.details.isSynthesized = true; - newTypeVar.scopeId = this.dummyScopeId; - newTypeVar.nameWithScope = TypeVarType.makeNameWithScope(newTypeVar.details.name, this.dummyScopeId); - if (!isInstance) { - newTypeVar = convertToInstantiable(newTypeVar) as TypeVarType; - } + FunctionType.addDefaultParameters(paramSpecValue); - // If the original TypeVar was bound or constrained, make the replacement as well. - newTypeVar.details.boundType = prevTypeVar.details.boundType; - newTypeVar.details.constraints = prevTypeVar.details.constraints; + return paramSpecValue; + } +} - // Also copy the variance. - newTypeVar.details.declaredVariance = prevTypeVar.details.declaredVariance; - newTypeVar.computedVariance = prevTypeVar.computedVariance; +class ExpectedConstructorTypeTransformer extends TypeVarTransformer { + constructor(private _liveTypeVarScopes: TypeVarScopeId[]) { + super(); + } - ExpectedConstructorTypeTransformer.synthesizedTypeVarIndexForExpectedType++; - return newTypeVar; + private _isTypeVarLive(typeVar: TypeVarType) { + return this._liveTypeVarScopes.some((scopeId) => typeVar.scopeId === scopeId); } override transformTypeVar(typeVar: TypeVarType) { @@ -3266,6 +3650,6 @@ class ExpectedConstructorTypeTransformer extends TypeVarTransformer { return typeVar; } - return this._createDummyTypeVar(typeVar); + return AnyType.create(); } } diff --git a/packages/pyright-internal/src/analyzer/typeVarContext.ts b/packages/pyright-internal/src/analyzer/typeVarContext.ts index acf87b1c7..a9c6bddf9 100644 --- a/packages/pyright-internal/src/analyzer/typeVarContext.ts +++ b/packages/pyright-internal/src/analyzer/typeVarContext.ts @@ -13,8 +13,9 @@ import { assert } from '../common/debug'; import { AnyType, ClassType, + FunctionType, + isFunction, maxTypeRecursionCount, - ParamSpecValue, TupleTypeArgument, Type, TypeCategory, @@ -22,110 +23,51 @@ import { TypeVarType, WildcardTypeVarScopeId, } from './types'; -import { doForEachSubtype } from './typeUtils'; +import { applySolvedTypeVars, doForEachSubtype } from './typeUtils'; export interface TypeVarMapEntry { typeVar: TypeVarType; - // The final type must "fit" between the narrow and - // wide type bound. + // The final type must "fit" between the narrow and wide type bound. + // If there are literal subtypes in the narrowBound, these are stripped, + // and the resulting widened type is placed in narrowBoundNoLiterals as + // long as they fit within the wideBound. narrowBound?: Type | undefined; + narrowBoundNoLiterals?: Type | undefined; wideBound?: Type | undefined; - retainLiteral?: boolean | undefined; + // For tuples, the variadic types can be individually specified + tupleTypes?: TupleTypeArgument[]; } -export interface ParamSpecMapEntry { - paramSpec: TypeVarType; - type: ParamSpecValue; -} - -export interface VariadicTypeVarMapEntry { - typeVar: TypeVarType; - types: TupleTypeArgument[]; -} - -export class TypeVarContext { - private _solveForScopes: TypeVarScopeId[] | undefined; +export class TypeVarSignatureContext { private _typeVarMap: Map; - private _variadicTypeVarMap: Map | undefined; - private _paramSpecMap: Map; - private _isLocked = false; - - constructor(solveForScopes?: TypeVarScopeId[] | TypeVarScopeId) { - if (Array.isArray(solveForScopes)) { - this._solveForScopes = solveForScopes; - } else if (solveForScopes !== undefined) { - this._solveForScopes = [solveForScopes]; - } else { - this._solveForScopes = undefined; - } + private _sourceTypeVarScopeId: Set | undefined; + constructor() { this._typeVarMap = new Map(); - this._paramSpecMap = new Map(); } clone() { - const newTypeVarMap = new TypeVarContext(); - if (this._solveForScopes) { - newTypeVarMap._solveForScopes = [...this._solveForScopes]; - } + const newContext = new TypeVarSignatureContext(); this._typeVarMap.forEach((value) => { - newTypeVarMap.setTypeVarType(value.typeVar, value.narrowBound, value.wideBound, value.retainLiteral); - }); + newContext.setTypeVarType(value.typeVar, value.narrowBound, value.narrowBoundNoLiterals, value.wideBound); - this._paramSpecMap.forEach((value) => { - newTypeVarMap.setParamSpec(value.paramSpec, value.type); + if (value.tupleTypes) { + newContext.setTupleTypeVar(value.typeVar, value.tupleTypes); + } }); - if (this._variadicTypeVarMap) { - this._variadicTypeVarMap.forEach((value) => { - newTypeVarMap.setVariadicTypeVar(value.typeVar, value.types); - }); + if (this._sourceTypeVarScopeId) { + this._sourceTypeVarScopeId.forEach((scopeId) => newContext.addSourceTypeVarScopeId(scopeId)); } - newTypeVarMap._isLocked = this._isLocked; - - return newTypeVarMap; - } - - // Copies a cloned type var map back into this object. - copyFromClone(clone: TypeVarContext) { - this._typeVarMap = clone._typeVarMap; - this._paramSpecMap = clone._paramSpecMap; - this._variadicTypeVarMap = clone._variadicTypeVarMap; - this._isLocked = clone._isLocked; - } - - // Returns the list of scopes this type var map is "solving". - getSolveForScopes() { - return this._solveForScopes; - } - - hasSolveForScope(scopeId: TypeVarScopeId | undefined) { - return ( - scopeId !== undefined && - this._solveForScopes !== undefined && - this._solveForScopes.some((s) => s === scopeId || s === WildcardTypeVarScopeId) - ); - } - - setSolveForScopes(scopeIds: TypeVarScopeId[]) { - this._solveForScopes = scopeIds; - } - - addSolveForScope(scopeId?: TypeVarScopeId) { - if (scopeId !== undefined && !this.hasSolveForScope(scopeId)) { - if (!this._solveForScopes) { - this._solveForScopes = []; - } - this._solveForScopes.push(scopeId); - } + return newContext; } isEmpty() { - return this._typeVarMap.size === 0 && this._paramSpecMap.size === 0; + return this._typeVarMap.size === 0; } // Provides a "score" - a value that values completeness (number @@ -145,52 +87,62 @@ export class TypeVarContext { score += 1.0 - this._getComplexityScoreForType(typeVarType); }); - score += this._paramSpecMap.size; - return score; } - hasTypeVar(reference: TypeVarType): boolean { - return this._typeVarMap.has(this._getKey(reference)); - } - getTypeVarType(reference: TypeVarType, useNarrowBoundOnly = false): Type | undefined { - const entry = this._typeVarMap.get(this._getKey(reference)); + const entry = this.getTypeVar(reference); if (!entry) { return undefined; } - if (entry.narrowBound) { + + if (useNarrowBoundOnly) { return entry.narrowBound; } - if (!useNarrowBoundOnly) { - return entry.wideBound; + + // Prefer the narrow version with no literals. It will be undefined + // if the literal type couldn't be widened due to constraints imposed + // by the wide bound. + return entry.narrowBoundNoLiterals ?? entry.narrowBound ?? entry.wideBound; + } + + getParamSpecType(reference: TypeVarType): FunctionType | undefined { + const entry = this.getTypeVar(reference); + if (!entry?.narrowBound) { + return undefined; + } + + if (isFunction(entry.narrowBound)) { + return entry.narrowBound; } + return undefined; } - setTypeVarType(reference: TypeVarType, narrowBound: Type | undefined, wideBound?: Type, retainLiteral?: boolean) { - assert(!this._isLocked); - const key = this._getKey(reference); - this._typeVarMap.set(key, { typeVar: reference, narrowBound, wideBound, retainLiteral }); + setTypeVarType( + reference: TypeVarType, + narrowBound: Type | undefined, + narrowBoundNoLiterals?: Type, + wideBound?: Type + ) { + const key = TypeVarType.getNameWithScope(reference); + this._typeVarMap.set(key, { typeVar: reference, narrowBound, narrowBoundNoLiterals, wideBound }); } - getVariadicTypeVar(reference: TypeVarType): TupleTypeArgument[] | undefined { - return this._variadicTypeVarMap?.get(this._getKey(reference))?.types; + getTupleTypeVar(reference: TypeVarType): TupleTypeArgument[] | undefined { + return this.getTypeVar(reference)?.tupleTypes; } - setVariadicTypeVar(reference: TypeVarType, types: TupleTypeArgument[]) { - assert(!this._isLocked); - const key = this._getKey(reference); + setTupleTypeVar(reference: TypeVarType, types: TupleTypeArgument[]) { + // Caller should have already assigned a value to this type variable. + const entry = this.getTypeVar(reference); + assert(entry); - // Allocate variadic map on demand since most classes don't use it. - if (!this._variadicTypeVarMap) { - this._variadicTypeVarMap = new Map(); - } - this._variadicTypeVarMap.set(key, { typeVar: reference, types }); + entry.tupleTypes = types; } getTypeVar(reference: TypeVarType): TypeVarMapEntry | undefined { - const key = this._getKey(reference); + const key = TypeVarType.getNameWithScope(reference); return this._typeVarMap.get(key); } @@ -204,25 +156,36 @@ export class TypeVarContext { return entries; } - hasParamSpec(reference: TypeVarType): boolean { - return this._paramSpecMap.has(this._getKey(reference)); - } - - getParamSpec(reference: TypeVarType): ParamSpecValue | undefined { - return this._paramSpecMap.get(this._getKey(reference))?.type; - } - - setParamSpec(reference: TypeVarType, type: ParamSpecValue) { - assert(!this._isLocked); - this._paramSpecMap.set(this._getKey(reference), { paramSpec: reference, type }); + // Applies solved TypeVars from one context to this context. + applySourceContextTypeVars(srcContext: TypeVarContext) { + this._typeVarMap.forEach((entry) => { + const newNarrowTypeBound = entry.narrowBound + ? applySolvedTypeVars(entry.narrowBound, srcContext) + : undefined; + const newNarrowTypeBoundNoLiterals = entry.narrowBoundNoLiterals + ? applySolvedTypeVars(entry.narrowBoundNoLiterals, srcContext) + : undefined; + const newWideTypeBound = entry.wideBound ? applySolvedTypeVars(entry.wideBound, srcContext) : undefined; + + this.setTypeVarType(entry.typeVar, newNarrowTypeBound, newNarrowTypeBoundNoLiterals, newWideTypeBound); + + if (entry.tupleTypes) { + this.setTupleTypeVar( + entry.typeVar, + entry.tupleTypes.map((arg) => { + return { isUnbounded: arg.isUnbounded, type: applySolvedTypeVars(arg.type, srcContext) }; + }) + ); + } + }); } - typeVarCount() { + getTypeVarCount() { return this._typeVarMap.size; } getWideTypeBound(reference: TypeVarType): Type | undefined { - const entry = this._typeVarMap.get(this._getKey(reference)); + const entry = this.getTypeVar(reference); if (entry) { return entry.wideBound; } @@ -230,28 +193,20 @@ export class TypeVarContext { return undefined; } - getRetainLiterals(reference: TypeVarType): boolean { - const entry = this._typeVarMap.get(this._getKey(reference)); - return !!entry?.retainLiteral; - } - - lock() { - // Locks the type var map, preventing any further changes. - assert(!this._isLocked); - this._isLocked = true; - } + addSourceTypeVarScopeId(scopeId: string) { + if (!this._sourceTypeVarScopeId) { + this._sourceTypeVarScopeId = new Set(); + } - unlock() { - // Unlocks the type var map, allowing further changes. - this._isLocked = false; + this._sourceTypeVarScopeId.add(scopeId); } - isLocked(): boolean { - return this._isLocked; - } + hasSourceTypeVarScopeId(scopeId: string) { + if (!this._sourceTypeVarScopeId) { + return false; + } - private _getKey(reference: TypeVarType) { - return TypeVarType.getNameWithScope(reference); + return this._sourceTypeVarScopeId.has(scopeId); } // Returns a "score" for a type that captures the relative complexity @@ -268,12 +223,17 @@ export class TypeVarContext { case TypeCategory.Unknown: case TypeCategory.Any: case TypeCategory.None: - case TypeCategory.Function: - case TypeCategory.OverloadedFunction: case TypeCategory.TypeVar: { return 0.5; } + case TypeCategory.Function: + case TypeCategory.OverloadedFunction: { + // Classes and unions should be preferred over functions, + // so make this relatively high (more than 0.75). + return 0.8; + } + case TypeCategory.Unbound: case TypeCategory.Never: return 1.0; @@ -288,10 +248,11 @@ export class TypeVarContext { const subtypeScore = this._getComplexityScoreForType(subtype, recursionCount); maxScore = Math.max(maxScore, subtypeScore); }); + } else { + maxScore = 0.5; } - // Assume that a union is more complex than a non-union. - return 0.75 + maxScore / 4; + return maxScore; } case TypeCategory.Class: { @@ -328,3 +289,178 @@ export class TypeVarContext { return 0.5 + averageTypeArgComplexity * 0.25; } } + +export class TypeVarContext { + private _solveForScopes: TypeVarScopeId[] | undefined; + private _isLocked = false; + private _signatureContexts: TypeVarSignatureContext[]; + + constructor(solveForScopes?: TypeVarScopeId[] | TypeVarScopeId) { + if (Array.isArray(solveForScopes)) { + this._solveForScopes = solveForScopes; + } else if (solveForScopes !== undefined) { + this._solveForScopes = [solveForScopes]; + } else { + this._solveForScopes = undefined; + } + + this._signatureContexts = [new TypeVarSignatureContext()]; + } + + clone() { + const newTypeVarMap = new TypeVarContext(); + if (this._solveForScopes) { + newTypeVarMap._solveForScopes = [...this._solveForScopes]; + } + + newTypeVarMap._signatureContexts = this._signatureContexts.map((context) => context.clone()); + newTypeVarMap._isLocked = this._isLocked; + + return newTypeVarMap; + } + + cloneWithSignatureSource(typeVarScopeId: string): TypeVarContext { + const clonedContext = this.clone(); + + if (typeVarScopeId) { + const filteredSignatures = this._signatureContexts.filter((context) => + context.hasSourceTypeVarScopeId(typeVarScopeId) + ); + + if (filteredSignatures.length > 0) { + clonedContext._signatureContexts = filteredSignatures; + } else { + clonedContext._signatureContexts.forEach((context) => { + context.addSourceTypeVarScopeId(typeVarScopeId); + }); + } + } + + return clonedContext; + } + + // Copies a cloned type var context back into this object. + copyFromClone(clone: TypeVarContext) { + this._signatureContexts = clone._signatureContexts.map((context) => context.clone()); + this._isLocked = clone._isLocked; + } + + // Copy the specified signature contexts into this type var context. + copySignatureContexts(contexts: TypeVarSignatureContext[]) { + assert(contexts.length > 0); + + this._signatureContexts = [...contexts]; + } + + // Returns the list of scopes this type var map is "solving". + getSolveForScopes() { + return this._solveForScopes; + } + + hasSolveForScope(scopeId: TypeVarScopeId | undefined) { + return ( + scopeId !== undefined && + this._solveForScopes !== undefined && + this._solveForScopes.some((s) => s === scopeId || s === WildcardTypeVarScopeId) + ); + } + + setSolveForScopes(scopeIds: TypeVarScopeId[]) { + this._solveForScopes = scopeIds; + } + + addSolveForScope(scopeId?: TypeVarScopeId) { + if (scopeId !== undefined && !this.hasSolveForScope(scopeId)) { + if (!this._solveForScopes) { + this._solveForScopes = []; + } + this._solveForScopes.push(scopeId); + } + } + + lock() { + // Locks the type var map, preventing any further changes. + assert(!this._isLocked); + this._isLocked = true; + } + + unlock() { + // Unlocks the type var map, allowing further changes. + this._isLocked = false; + } + + isLocked(): boolean { + return this._isLocked; + } + + isEmpty() { + return this._signatureContexts.every((context) => context.isEmpty()); + } + + // Applies solved TypeVars from one context to this context. + applySourceContextTypeVars(srcContext: TypeVarContext) { + if (srcContext.isEmpty()) { + return; + } + + const wasLocked = this.isLocked(); + this.unlock(); + + this._signatureContexts.forEach((context) => context.applySourceContextTypeVars(srcContext)); + + if (wasLocked) { + this.lock(); + } + } + + setTypeVarType( + reference: TypeVarType, + narrowBound: Type | undefined, + narrowBoundNoLiterals?: Type, + wideBound?: Type + ) { + assert(!this._isLocked); + + return this._signatureContexts.forEach((context) => { + context.setTypeVarType(reference, narrowBound, narrowBoundNoLiterals, wideBound); + }); + } + + setTupleTypeVar(reference: TypeVarType, tupleTypes: TupleTypeArgument[]) { + assert(!this._isLocked); + + return this._signatureContexts.forEach((context) => { + context.setTupleTypeVar(reference, tupleTypes); + }); + } + + getScore() { + let total = 0; + + this._signatureContexts.forEach((context) => { + total += context.getScore(); + }); + + // Return the average score among all signature contexts. + return total / this._signatureContexts.length; + } + + getPrimarySignature() { + return this._signatureContexts[0]; + } + + getSignatureContexts() { + return this._signatureContexts; + } + + getSignatureContext(index: number) { + assert(index >= 0 && index < this._signatureContexts.length); + return this._signatureContexts[index]; + } + + doForEachSignature(callback: (context: TypeVarSignatureContext) => void) { + this._signatureContexts.forEach((context) => { + callback(context); + }); + } +} diff --git a/packages/pyright-internal/src/analyzer/typedDicts.ts b/packages/pyright-internal/src/analyzer/typedDicts.ts index d98084093..dbaede42b 100644 --- a/packages/pyright-internal/src/analyzer/typedDicts.ts +++ b/packages/pyright-internal/src/analyzer/typedDicts.ts @@ -18,6 +18,7 @@ import { Localizer } from '../localization/localize'; import { ArgumentCategory, ClassNode, + DictionaryNode, ExpressionNode, IndexNode, ParameterCategory, @@ -27,13 +28,9 @@ import { KeywordType } from '../parser/tokenizerTypes'; import * as AnalyzerNodeInfo from './analyzerNodeInfo'; import { DeclarationType, VariableDeclaration } from './declaration'; import * as ParseTreeUtils from './parseTreeUtils'; -import { Symbol, SymbolFlags } from './symbol'; -import { - getLastTypedDeclaredForSymbol, - isNotRequiredTypedDictVariable, - isRequiredTypedDictVariable, -} from './symbolUtils'; -import { EvaluatorUsage, FunctionArgument, TypeEvaluator, TypeResult } from './typeEvaluatorTypes'; +import { Symbol, SymbolFlags, SymbolTable } from './symbol'; +import { getLastTypedDeclaredForSymbol } from './symbolUtils'; +import { EvaluatorUsage, FunctionArgument, TypeEvaluator, TypeResult, TypeResultWithNode } from './typeEvaluatorTypes'; import { AnyType, ClassType, @@ -65,6 +62,7 @@ import { isLiteralType, mapSubtypes, partiallySpecializeType, + specializeTupleClass, } from './typeUtils'; import { TypeVarContext } from './typeVarContext'; @@ -120,7 +118,6 @@ export function createTypedDictType( evaluator.addError(Localizer.Diagnostic.typedDictSecondArgDict(), errorNode); } else { const entriesArg = argList[1]; - const entryMap = new Map(); if ( entriesArg.argumentCategory === ArgumentCategory.Simple && @@ -128,87 +125,23 @@ export function createTypedDictType( entriesArg.valueExpression.nodeType === ParseNodeType.Dictionary ) { usingDictSyntax = true; - const entryDict = entriesArg.valueExpression; - - entryDict.entries.forEach((entry) => { - if (entry.nodeType !== ParseNodeType.DictionaryKeyEntry) { - evaluator.addError(Localizer.Diagnostic.typedDictSecondArgDictEntry(), entry); - return; - } - - if (entry.keyExpression.nodeType !== ParseNodeType.StringList) { - evaluator.addError(Localizer.Diagnostic.typedDictEntryName(), entry.keyExpression); - return; - } - - const entryName = entry.keyExpression.strings.map((s) => s.value).join(''); - if (!entryName) { - evaluator.addError(Localizer.Diagnostic.typedDictEmptyName(), entry.keyExpression); - return; - } - - if (entryMap.has(entryName)) { - evaluator.addError(Localizer.Diagnostic.typedDictEntryUnique(), entry.keyExpression); - return; - } - - // Record names in a map to detect duplicates. - entryMap.set(entryName, true); - - // Cache the annotation type. - const annotatedType = evaluator.getTypeOfExpressionExpectingType( - entry.valueExpression, - /* allowFinal */ true, - /* allowRequired */ true - ); - - const newSymbol = new Symbol(SymbolFlags.InstanceMember); - const declaration: VariableDeclaration = { - type: DeclarationType.Variable, - node: entry.keyExpression, - path: fileInfo.filePath, - typeAnnotationNode: entry.valueExpression, - isRequired: annotatedType.isRequired, - isNotRequired: annotatedType.isNotRequired, - isRuntimeTypeExpression: true, - range: convertOffsetsToRange( - entry.keyExpression.start, - TextRange.getEnd(entry.keyExpression), - fileInfo.lines - ), - moduleName: fileInfo.moduleName, - isInExceptSuite: false, - }; - newSymbol.addDeclaration(declaration); - - classFields.set(entryName, newSymbol); - }); - // Set the type in the type cache for the dict node so it doesn't - // get evaluated again. - evaluator.setTypeForNode(entryDict); + getTypedDictFieldsFromDictSyntax(evaluator, entriesArg.valueExpression, classFields); } else if (entriesArg.name) { + const entrySet = new Set(); for (let i = 1; i < argList.length; i++) { const entry = argList[i]; if (!entry.name || !entry.valueExpression) { continue; } - if (entryMap.has(entry.name.value)) { + if (entrySet.has(entry.name.value)) { evaluator.addError(Localizer.Diagnostic.typedDictEntryUnique(), entry.valueExpression); continue; } // Record names in a map to detect duplicates. - entryMap.set(entry.name.value, true); - - // Evaluate the type with specific evaluation flags. The - // type will be cached for later. - const annotatedType = evaluator.getTypeOfExpressionExpectingType( - entry.valueExpression, - /* allowFinal */ true, - /* allowRequired */ true - ); + entrySet.add(entry.name.value); const newSymbol = new Symbol(SymbolFlags.InstanceMember); const fileInfo = AnalyzerNodeInfo.getFileInfo(errorNode); @@ -217,8 +150,6 @@ export function createTypedDictType( node: entry.name, path: fileInfo.filePath, typeAnnotationNode: entry.valueExpression, - isRequired: annotatedType.isRequired, - isNotRequired: annotatedType.isNotRequired, isRuntimeTypeExpression: true, range: convertOffsetsToRange( entry.name.start, @@ -265,6 +196,34 @@ export function createTypedDictType( return classType; } +// Creates a new anonymous TypedDict class from an inlined dict[{}] type annotation. +export function createTypedDictTypeInlined( + evaluator: TypeEvaluator, + dictNode: DictionaryNode, + typedDictClass: ClassType +): ClassType { + const fileInfo = AnalyzerNodeInfo.getFileInfo(dictNode); + const className = ''; + + const classType = ClassType.createInstantiable( + className, + ParseTreeUtils.getClassFullName(dictNode, fileInfo.moduleName, className), + fileInfo.moduleName, + fileInfo.filePath, + ClassTypeFlags.TypedDictClass, + ParseTreeUtils.getTypeSourceId(dictNode), + /* declaredMetaclass */ undefined, + typedDictClass.details.effectiveMetaclass + ); + classType.details.baseClasses.push(typedDictClass); + computeMroLinearization(classType); + + getTypedDictFieldsFromDictSyntax(evaluator, dictNode, classType.details.fields); + synthesizeTypedDictClassMethods(evaluator, dictNode, classType, /* isClassFinal */ true); + + return classType; +} + export function synthesizeTypedDictClassMethods( evaluator: TypeEvaluator, node: ClassNode | ExpressionNode, @@ -302,6 +261,7 @@ export function synthesizeTypedDictClassMethods( }); const entries = getTypedDictMembersForClass(evaluator, classType); + let allEntriesAreNotRequired = true; entries.forEach((entry, name) => { FunctionType.addParameter(initType, { category: ParameterCategory.Simple, @@ -310,6 +270,10 @@ export function synthesizeTypedDictClassMethods( type: entry.valueType, hasDeclaredType: true, }); + + if (entry.isRequired) { + allEntriesAreNotRequired = false; + } }); const symbolTable = classType.details.fields; @@ -545,6 +509,33 @@ export function synthesizeTypedDictClassMethods( ); } symbolTable.set('__delitem__', Symbol.createWithType(SymbolFlags.ClassMember, createDelItemMethod(strType))); + + // If the TypedDict is final and all of its entries are NotRequired, + // add a "clear" and "popitem" method. + if (isClassFinal && allEntriesAreNotRequired) { + const clearMethod = FunctionType.createSynthesizedInstance('clear'); + FunctionType.addParameter(clearMethod, selfParam); + clearMethod.details.declaredReturnType = NoneType.createInstance(); + symbolTable.set('clear', Symbol.createWithType(SymbolFlags.ClassMember, clearMethod)); + + const popItemMethod = FunctionType.createSynthesizedInstance('popitem'); + FunctionType.addParameter(popItemMethod, selfParam); + let tupleType = evaluator.getTupleClassType(); + if (tupleType && isInstantiableClass(tupleType)) { + tupleType = specializeTupleClass( + ClassType.cloneAsInstance(tupleType), + [ + { type: strType, isUnbounded: false }, + { type: UnknownType.create(), isUnbounded: false }, + ], + /* isTypeArgumentExplicit */ true + ); + } else { + tupleType = UnknownType.create(); + } + popItemMethod.details.declaredReturnType = tupleType; + symbolTable.set('popitem', Symbol.createWithType(SymbolFlags.ClassMember, popItemMethod)); + } } } @@ -580,6 +571,64 @@ export function getTypedDictMembersForClass(evaluator: TypeEvaluator, classType: return entries; } +function getTypedDictFieldsFromDictSyntax( + evaluator: TypeEvaluator, + entryDict: DictionaryNode, + classFields: SymbolTable +) { + const entrySet = new Set(); + const fileInfo = AnalyzerNodeInfo.getFileInfo(entryDict); + + entryDict.entries.forEach((entry) => { + if (entry.nodeType !== ParseNodeType.DictionaryKeyEntry) { + evaluator.addError(Localizer.Diagnostic.typedDictSecondArgDictEntry(), entry); + return; + } + + if (entry.keyExpression.nodeType !== ParseNodeType.StringList) { + evaluator.addError(Localizer.Diagnostic.typedDictEntryName(), entry.keyExpression); + return; + } + + const entryName = entry.keyExpression.strings.map((s) => s.value).join(''); + if (!entryName) { + evaluator.addError(Localizer.Diagnostic.typedDictEmptyName(), entry.keyExpression); + return; + } + + if (entrySet.has(entryName)) { + evaluator.addError(Localizer.Diagnostic.typedDictEntryUnique(), entry.keyExpression); + return; + } + + // Record names in a set to detect duplicates. + entrySet.add(entryName); + + const newSymbol = new Symbol(SymbolFlags.InstanceMember); + const declaration: VariableDeclaration = { + type: DeclarationType.Variable, + node: entry.keyExpression, + path: fileInfo.filePath, + typeAnnotationNode: entry.valueExpression, + isRuntimeTypeExpression: true, + range: convertOffsetsToRange( + entry.keyExpression.start, + TextRange.getEnd(entry.keyExpression), + fileInfo.lines + ), + moduleName: fileInfo.moduleName, + isInExceptSuite: false, + }; + newSymbol.addDeclaration(declaration); + + classFields.set(entryName, newSymbol); + }); + + // Set the type in the type cache for the dict node so it doesn't + // get evaluated again. + evaluator.setTypeForNode(entryDict); +} + function getTypedDictMembersForClassRecursive( evaluator: TypeEvaluator, classType: ClassType, @@ -613,9 +662,9 @@ function getTypedDictMembersForClassRecursive( let isRequired = !ClassType.isCanOmitDictValues(classType); - if (isRequiredTypedDictVariable(symbol)) { + if (isRequiredTypedDictVariable(evaluator, symbol)) { isRequired = true; - } else if (isNotRequiredTypedDictVariable(symbol)) { + } else if (isNotRequiredTypedDictVariable(evaluator, symbol)) { isRequired = false; } @@ -725,8 +774,8 @@ export function assignTypedDictToTypedDict( export function assignToTypedDict( evaluator: TypeEvaluator, classType: ClassType, - keyTypes: Type[], - valueTypes: Type[], + keyTypes: TypeResultWithNode[], + valueTypes: TypeResultWithNode[], diagAddendum?: DiagnosticAddendum ): ClassType | undefined { assert(isClassInstance(classType)); @@ -754,7 +803,8 @@ export function assignToTypedDict( const symbolMap = getTypedDictMembersForClass(evaluator, genericClassType); - keyTypes.forEach((keyType, index) => { + keyTypes.forEach((keyTypeResult, index) => { + const keyType = keyTypeResult.type; if (!isClassInstance(keyType) || !ClassType.isBuiltIn(keyType, 'str') || !isLiteralType(keyType)) { isMatch = false; } else { @@ -765,12 +815,15 @@ export function assignToTypedDict( // The provided key name doesn't exist. isMatch = false; if (diagAddendum) { - diagAddendum.addMessage( + const subDiag = diagAddendum?.createAddendum(); + subDiag.addMessage( Localizer.DiagnosticAddendum.typedDictFieldUndefined().format({ name: keyType.literalValue as string, type: evaluator.printType(ClassType.cloneAsInstance(classType)), }) ); + + subDiag.addTextRange(keyTypeResult.node); } } else { // Can we assign the value to the declared type? @@ -778,7 +831,7 @@ export function assignToTypedDict( if ( !evaluator.assignType( symbolEntry.valueType, - valueTypes[index], + valueTypes[index].type, subDiag?.createAddendum(), typeVarContext, /* srcTypeVarContext */ undefined, @@ -789,16 +842,18 @@ export function assignToTypedDict( subDiag.addMessage( Localizer.DiagnosticAddendum.typedDictFieldTypeMismatch().format({ name: keyType.literalValue as string, - type: evaluator.printType(valueTypes[index]), + type: evaluator.printType(valueTypes[index].type), }) ); + + subDiag.addTextRange(keyTypeResult.node); } isMatch = false; } if (!symbolEntry.isRequired) { narrowedEntries.set(keyValue, { - valueType: valueTypes[index], + valueType: valueTypes[index].type, isRequired: false, isProvided: true, }); @@ -900,7 +955,7 @@ export function getTypeOfIndexedTypedDict( } if (usage.method === 'set') { - if (!evaluator.assignType(entry.valueType, usage.setType || AnyType.create(), diag)) { + if (!evaluator.assignType(entry.valueType, usage.setType?.type ?? AnyType.create(), diag)) { allDiagsInvolveNotRequiredKeys = false; } } else if (usage.method === 'del' && entry.isRequired) { @@ -958,8 +1013,12 @@ export function getTypeOfIndexedTypedDict( // If the specified type has a non-required key, this method marks the // key as present. export function narrowForKeyAssignment(classType: ClassType, key: string) { - assert(ClassType.isTypedDictClass(classType)); - assert(classType.details.typedDictEntries); + // We should never be called if the classType is not a TypedDict or if typedDictEntries + // is empty, but this can theoretically happen in the presence of certain circular + // dependencies. + if (!ClassType.isTypedDictClass(classType) || !classType.details.typedDictEntries) { + return classType; + } const tdEntry = classType.details.typedDictEntries.get(key); if (!tdEntry || tdEntry.isRequired) { @@ -978,3 +1037,33 @@ export function narrowForKeyAssignment(classType: ClassType, key: string) { return ClassType.cloneForNarrowedTypedDictEntries(classType, narrowedEntries); } + +function isRequiredTypedDictVariable(evaluator: TypeEvaluator, symbol: Symbol) { + return symbol.getDeclarations().some((decl) => { + if (decl.type !== DeclarationType.Variable || !decl.typeAnnotationNode) { + return false; + } + + const annotatedType = evaluator.getTypeOfExpressionExpectingType(decl.typeAnnotationNode, { + allowFinal: true, + allowRequired: true, + }); + + return !!annotatedType.isRequired; + }); +} + +function isNotRequiredTypedDictVariable(evaluator: TypeEvaluator, symbol: Symbol) { + return symbol.getDeclarations().some((decl) => { + if (decl.type !== DeclarationType.Variable || !decl.typeAnnotationNode) { + return false; + } + + const annotatedType = evaluator.getTypeOfExpressionExpectingType(decl.typeAnnotationNode, { + allowFinal: true, + allowRequired: true, + }); + + return !!annotatedType.isNotRequired; + }); +} diff --git a/packages/pyright-internal/src/analyzer/types.ts b/packages/pyright-internal/src/analyzer/types.ts index e5716b6cb..9207e6248 100644 --- a/packages/pyright-internal/src/analyzer/types.ts +++ b/packages/pyright-internal/src/analyzer/types.ts @@ -8,7 +8,7 @@ */ import { assert } from '../common/debug'; -import { ExpressionNode, ParameterCategory } from '../parser/parseNodes'; +import { ExpressionNode, NameNode, ParameterCategory } from '../parser/parseNodes'; import { FunctionDeclaration } from './declaration'; import { Symbol, SymbolTable } from './symbol'; @@ -87,13 +87,22 @@ export type TypeVarScopeId = string; export const WildcardTypeVarScopeId = '*'; export class EnumLiteral { - constructor(public className: string, public itemName: string, public itemType: Type) {} + constructor( + public classFullName: string, + public className: string, + public itemName: string, + public itemType: Type + ) {} + + getName() { + return `${this.classFullName}.${this.itemName}`; + } } export type LiteralValue = number | bigint | boolean | string | EnumLiteral; export type TypeSourceId = number; -export const maxTypeRecursionCount = 14; +export const maxTypeRecursionCount = 32; export type InheritanceChain = (ClassType | UnknownType)[]; @@ -106,9 +115,17 @@ export interface TypeSameOptions { interface TypeAliasInfo { name: string; fullName: string; + typeVarScopeId: TypeVarScopeId; + + // Type parameters, if type alias is generic typeParameters?: TypeVarType[] | undefined; + + // Lazily-evaluated variance of type parameters based on how + // they are used in the type alias + usageVariance?: Variance[]; + + // Type argument, if type alias is specialized typeArguments?: Type[] | undefined; - typeVarScopeId: TypeVarScopeId; } interface TypeBase { @@ -131,6 +148,13 @@ interface TypeBase { // with a TypeFlags because we don't want an ambiguous and unambiguous // type to be seen as distinct when comparing types. isAmbiguous?: boolean; + + // Cached values are not cloned. + cached?: { + // Type converted to instantiable and instance (cached) + instantiableType?: Type; + instanceType?: Type; + }; } export namespace TypeBase { @@ -159,7 +183,9 @@ export namespace TypeBase { } export function cloneType(type: T): T { - return { ...type }; + const clone = { ...type }; + delete clone.cached; + return clone; } export function cloneTypeAsInstance(type: T): T { @@ -265,6 +291,12 @@ export namespace UnboundType { export interface UnknownType extends TypeBase { category: TypeCategory.Unknown; isIncomplete: boolean; + + // A "possible type" is a form of a "weak union" where the actual + // type is unknown, but it could be one of the subtypes in the union. + // This is used for overload matching in cases where more than one + // overload matches due to an argument that evaluates to Any or Unknown. + possibleType?: Type; } export namespace UnknownType { @@ -282,6 +314,17 @@ export namespace UnknownType { export function create(isIncomplete = false) { return isIncomplete ? _incompleteInstance : _instance; } + + export function createPossibleType(possibleType: Type) { + const unknownWithPossibleType: UnknownType = { + category: TypeCategory.Unknown, + flags: TypeFlags.Instantiable | TypeFlags.Instance, + isIncomplete: false, + possibleType, + }; + + return unknownWithPossibleType; + } } export interface ModuleType extends TypeBase { @@ -289,6 +332,10 @@ export interface ModuleType extends TypeBase { fields: SymbolTable; docString?: string | undefined; + // If a field lookup isn't found, should the type of the + // resulting field be Any/Unknown or treated as an error? + notPresentFieldType?: AnyType | UnknownType; + // A "loader" module includes symbols that were injected by // the module loader. We keep these separate so we don't // pollute the symbols exported by the module itself. @@ -343,6 +390,7 @@ export interface DataClassEntry { isKeywordOnly: boolean; alias?: string | undefined; hasDefault?: boolean | undefined; + nameNode: NameNode | undefined; defaultValueExpression?: ExpressionNode | undefined; includeInInit: boolean; type: Type; @@ -432,7 +480,7 @@ export const enum ClassTypeFlags { // special-case handling of its type arguments. TupleClass = 1 << 19, - // The class has a metaclass of EnumMet or derives from + // The class has a metaclass of EnumMeta or derives from // a class that has this metaclass. EnumClass = 1 << 20, @@ -461,6 +509,7 @@ export interface DataClassBehaviors { keywordOnlyParams: boolean; generateEq: boolean; generateOrder: boolean; + frozen: boolean; fieldDescriptorNames: string[]; } @@ -479,6 +528,7 @@ interface ClassDetails { typeParameters: TypeVarType[]; typeVarScopeId?: TypeVarScopeId | undefined; docString?: string | undefined; + deprecatedMessage?: string | undefined; dataClassEntries?: DataClassEntry[] | undefined; dataClassBehaviors?: DataClassBehaviors | undefined; typedDictEntries?: Map | undefined; @@ -493,12 +543,13 @@ interface ClassDetails { // or a base class. classDataClassTransform?: DataClassBehaviors | undefined; - // Variance of type parameters, inferred if necessary. - typeParameterVariance?: Variance[]; - // Indicates that one or more type parameters has an // autovariance, so variance must be inferred. requiresVarianceInference?: boolean; + + // A cached value that indicates whether an instance of this class + // is hashable (i.e. does not override "__hash__" with None). + isInstanceHashable?: boolean; } export interface TupleTypeArgument { @@ -636,15 +687,13 @@ export namespace ClassType { ): ClassType { const newClassType = TypeBase.cloneType(classType); - // Never should never appear as a type argument, so replace it with - newClassType.typeArguments = typeArguments - ? typeArguments.map((t) => (isNever(t) && !t.isNoReturn ? UnknownType.create() : t)) - : undefined; - + newClassType.typeArguments = typeArguments; newClassType.isTypeArgumentExplicit = isTypeArgumentExplicit; + if (includeSubclasses) { newClassType.includeSubclasses = true; } + newClassType.tupleTypeArguments = tupleTypeArguments ? tupleTypeArguments.map((t) => isNever(t.type) ? { type: UnknownType.create(), isUnbounded: t.isUnbounded } : t @@ -1093,17 +1142,15 @@ export namespace ClassType { } } -export interface ParamSpecEntry { +export interface FunctionParameter { category: ParameterCategory; name?: string | undefined; isNameSynthesized?: boolean; hasDefault?: boolean | undefined; + defaultValueExpression?: ExpressionNode | undefined; type: Type; -} -export interface FunctionParameter extends ParamSpecEntry { isTypeInferred?: boolean | undefined; - defaultValueExpression?: ExpressionNode | undefined; defaultType?: Type | undefined; hasDeclaredType?: boolean | undefined; typeAnnotation?: ExpressionNode | undefined; @@ -1179,6 +1226,9 @@ export const enum FunctionTypeFlags { // that contains a forward reference that requires the function // type itself to be evaluated first). PartiallyEvaluated = 1 << 17, + + // Decorated with @override as defined in PEP 698. + Overridden = 1 << 18, } interface FunctionDetails { @@ -1194,6 +1244,7 @@ interface FunctionDetails { constructorTypeVarScopeId?: TypeVarScopeId | undefined; builtInName?: string | undefined; docString?: string | undefined; + deprecatedMessage?: string | undefined; // Transforms to apply if this function is used // as a decorator. @@ -1202,6 +1253,11 @@ interface FunctionDetails { // Parameter specification used only for Callable types created // with a ParamSpec representing the parameters. paramSpec?: TypeVarType | undefined; + + // If the function is generic (has one or more typeParameters) and + // one or more of these appear only within the return type and within + // a callable, they are rescoped to that callable. + rescopedTypeParameters?: TypeVarType[]; } export interface SpecializedFunctionTypes { @@ -1256,14 +1312,6 @@ export interface FunctionType extends TypeBase { boundTypeVarScopeId?: TypeVarScopeId | undefined; } -export interface ParamSpecValue { - flags: FunctionTypeFlags; - parameters: ParamSpecEntry[]; - typeVarScopeId: TypeVarScopeId | undefined; - docString: string | undefined; - paramSpec: TypeVarType | undefined; -} - export namespace FunctionType { export function createInstance( name: string, @@ -1329,16 +1377,15 @@ export namespace FunctionType { newFunction.preBoundFlags = newFunction.details.flags; if (stripFirstParam) { - if ( - type.details.parameters.length > 0 && - type.details.parameters[0].category === ParameterCategory.Simple - ) { - if (type.details.parameters.length > 0 && !type.details.parameters[0].isTypeInferred) { - // Stash away the effective type of the first parameter if it - // wasn't synthesized. - newFunction.strippedFirstParamType = getEffectiveParameterType(type, 0); + if (type.details.parameters.length > 0) { + if (type.details.parameters[0].category === ParameterCategory.Simple) { + if (type.details.parameters.length > 0 && !type.details.parameters[0].isTypeInferred) { + // Stash away the effective type of the first parameter if it + // wasn't synthesized. + newFunction.strippedFirstParamType = getEffectiveParameterType(type, 0); + } + newFunction.details.parameters = type.details.parameters.slice(1); } - newFunction.details.parameters = type.details.parameters.slice(1); } else { stripFirstParam = false; } @@ -1415,7 +1462,7 @@ export namespace FunctionType { } // Creates a new function based on the parameters of another function. - export function cloneForParamSpec(type: FunctionType, paramSpecValue: ParamSpecValue | undefined): FunctionType { + export function cloneForParamSpec(type: FunctionType, paramSpecValue: FunctionType | undefined): FunctionType { const newFunction = create( type.details.name, type.details.fullName, @@ -1435,27 +1482,29 @@ export namespace FunctionType { if (paramSpecValue) { newFunction.details.parameters = [ ...type.details.parameters, - ...paramSpecValue.parameters.map((specEntry) => { + ...paramSpecValue.details.parameters.map((param) => { return { - category: specEntry.category, - name: specEntry.name, - hasDefault: specEntry.hasDefault, - isNameSynthesized: specEntry.isNameSynthesized, + category: param.category, + name: param.name, + hasDefault: param.hasDefault, + defaultValueExpression: param.defaultValueExpression, + isNameSynthesized: param.isNameSynthesized, hasDeclaredType: true, - type: specEntry.type, + type: param.type, }; }), ]; if (!newFunction.details.docString) { - newFunction.details.docString = paramSpecValue.docString; + newFunction.details.docString = paramSpecValue.details.docString; } newFunction.details.flags = - (paramSpecValue.flags & + (paramSpecValue.details.flags & (FunctionTypeFlags.ClassMethod | FunctionTypeFlags.StaticMethod | FunctionTypeFlags.ConstructorMethod | + FunctionTypeFlags.Overloaded | FunctionTypeFlags.SkipArgsKwargsCompatibilityCheck)) | FunctionTypeFlags.SynthesizedMethod; @@ -1472,7 +1521,7 @@ export namespace FunctionType { if (type.specializedTypes.parameterDefaultArgs) { newFunction.specializedTypes.parameterDefaultArgs = [...type.specializedTypes.parameterDefaultArgs]; } - paramSpecValue.parameters.forEach((paramInfo) => { + paramSpecValue.details.parameters.forEach((paramInfo) => { newFunction.specializedTypes!.parameterTypes.push(paramInfo.type); if (newFunction.specializedTypes!.parameterDefaultArgs) { // Assume that the parameters introduced via paramSpec have no specialized @@ -1482,7 +1531,7 @@ export namespace FunctionType { }); } - newFunction.details.paramSpec = paramSpecValue.paramSpec; + newFunction.details.paramSpec = paramSpecValue.details.paramSpec; } return newFunction; @@ -1499,7 +1548,18 @@ export namespace FunctionType { return newFunction; } - export function cloneForParamSpecApplication(type: FunctionType, paramSpecValue: ParamSpecValue): FunctionType { + export function cloneWithDocString(type: FunctionType, docString?: string): FunctionType { + const newFunction = TypeBase.cloneType(type); + + // Make a shallow clone of the details. + newFunction.details = { ...type.details }; + + newFunction.details.docString = docString; + + return newFunction; + } + + export function cloneForParamSpecApplication(type: FunctionType, paramSpecValue: FunctionType): FunctionType { const newFunction = TypeBase.cloneType(type); // Make a shallow clone of the details. @@ -1513,14 +1573,18 @@ export namespace FunctionType { // Update the flags of the function. newFunction.details.flags &= ~FunctionTypeFlags.SkipArgsKwargsCompatibilityCheck; - if (paramSpecValue.flags & FunctionTypeFlags.SkipArgsKwargsCompatibilityCheck) { + if (paramSpecValue.details.flags & FunctionTypeFlags.SkipArgsKwargsCompatibilityCheck) { newFunction.details.flags |= FunctionTypeFlags.SkipArgsKwargsCompatibilityCheck; } // If there is a position-only separator in the captured param spec signature, // remove the position-only separator in the existing signature. Otherwise, // we'll end up with redundant position-only separators. - if (paramSpecValue.parameters.some((entry) => entry.category === ParameterCategory.Simple && !entry.name)) { + if ( + paramSpecValue.details.parameters.some( + (entry) => entry.category === ParameterCategory.Simple && !entry.name + ) + ) { if (newFunction.details.parameters.length > 0) { const lastParam = newFunction.details.parameters[newFunction.details.parameters.length - 1]; if (lastParam.category === ParameterCategory.Simple && !lastParam.name) { @@ -1529,20 +1593,21 @@ export namespace FunctionType { } } - paramSpecValue.parameters.forEach((specEntry) => { + paramSpecValue.details.parameters.forEach((param) => { newFunction.details.parameters.push({ - category: specEntry.category, - name: specEntry.name, - hasDefault: specEntry.hasDefault, - isNameSynthesized: specEntry.isNameSynthesized, + category: param.category, + name: param.name, + hasDefault: param.hasDefault, + defaultValueExpression: param.defaultValueExpression, + isNameSynthesized: param.isNameSynthesized, hasDeclaredType: true, - type: specEntry.type, + type: param.type, }); }); - newFunction.details.paramSpec = paramSpecValue.paramSpec; + newFunction.details.paramSpec = paramSpecValue.details.paramSpec; if (!newFunction.details.docString) { - newFunction.details.docString = paramSpecValue.docString; + newFunction.details.docString = paramSpecValue.details.docString; } return newFunction; @@ -1723,6 +1788,10 @@ export namespace FunctionType { return !!(type.details.flags & FunctionTypeFlags.PartiallyEvaluated); } + export function isOverridden(type: FunctionType) { + return !!(type.details.flags & FunctionTypeFlags.Overridden); + } + export function getEffectiveParameterType(type: FunctionType, index: number): Type { assert(index < type.details.parameters.length, 'Parameter types array overflow'); @@ -1963,7 +2032,9 @@ export interface UnionType extends TypeBase { subtypes: UnionableType[]; literalStrMap?: Map | undefined; literalIntMap?: Map | undefined; + literalEnumMap?: Map | undefined; typeAliasSources?: Set; + includesRecursiveTypeAlias?: boolean; } export namespace UnionType { @@ -1978,7 +2049,7 @@ export namespace UnionType { } export function addType(unionType: UnionType, newType: UnionableType) { - // If we're adding a string literal or integer type, add it to the + // If we're adding a string, integer or enum literal, add it to the // corresponding literal map to speed up some operations. It's not // uncommon for unions to contain hundreds of literals. if (isClassInstance(newType) && newType.literalValue !== undefined && newType.condition === undefined) { @@ -1992,14 +2063,34 @@ export namespace UnionType { unionType.literalIntMap = new Map(); } unionType.literalIntMap.set(newType.literalValue as number | bigint, newType); + } else if (ClassType.isEnumClass(newType)) { + if (unionType.literalEnumMap === undefined) { + unionType.literalEnumMap = new Map(); + } + const enumLiteral = newType.literalValue as EnumLiteral; + unionType.literalEnumMap.set(enumLiteral.getName(), newType); } } unionType.flags &= newType.flags; unionType.subtypes.push(newType); + + if (isTypeVar(newType) && newType.details.recursiveTypeAliasName) { + // Note that at least one recursive type alias was included in + // this union. We'll need to expand it before the union is used. + unionType.includesRecursiveTypeAlias = true; + } } - export function containsType(unionType: UnionType, subtype: Type, recursionCount = 0): boolean { + // Determines whether the union contains a specified subtype. If exclusionSet is passed, + // the method skips any subtype indexes that are in the set and adds a found index to + // the exclusion set. This speeds up union type comparisons. + export function containsType( + unionType: UnionType, + subtype: Type, + exclusionSet?: Set, + recursionCount = 0 + ): boolean { // Handle string literals as a special case because unions can sometimes // contain hundreds of string literal types. if (isClassInstance(subtype) && subtype.condition === undefined && subtype.literalValue !== undefined) { @@ -2007,10 +2098,26 @@ export namespace UnionType { return unionType.literalStrMap.has(subtype.literalValue as string); } else if (ClassType.isBuiltIn(subtype, 'int') && unionType.literalIntMap !== undefined) { return unionType.literalIntMap.has(subtype.literalValue as number | bigint); + } else if (ClassType.isEnumClass(subtype) && unionType.literalEnumMap !== undefined) { + const enumLiteral = subtype.literalValue as EnumLiteral; + return unionType.literalEnumMap.has(enumLiteral.getName()); + } + } + + const foundIndex = unionType.subtypes.findIndex((t, i) => { + if (exclusionSet?.has(i)) { + return false; } + + return isTypeSame(t, subtype, {}, recursionCount); + }); + + if (foundIndex < 0) { + return false; } - return unionType.subtypes.find((t) => isTypeSame(t, subtype, {}, recursionCount)) !== undefined; + exclusionSet?.add(foundIndex); + return true; } export function addTypeAliasSource(unionType: UnionType, typeAliasSource: Type) { @@ -2042,6 +2149,7 @@ export interface TypeVarDetails { name: string; constraints: Type[]; boundType?: Type | undefined; + defaultType?: Type | undefined; isParamSpec: boolean; isVariadic: boolean; @@ -2060,7 +2168,6 @@ export interface TypeVarDetails { // Used for recursive type aliases. recursiveTypeAliasName?: string | undefined; recursiveTypeAliasScopeId?: TypeVarScopeId | undefined; - illegalRecursionDetected?: boolean | undefined; // Type parameters for a recursive type alias. recursiveTypeParameters?: TypeVarType[] | undefined; @@ -2078,18 +2185,19 @@ export interface TypeVarType extends TypeBase { category: TypeCategory.TypeVar; details: TypeVarDetails; - // An ID that uniquely identifies the scope in which this TypeVar is defined. + // An ID that uniquely identifies the scope to which this TypeVar is bound scopeId?: TypeVarScopeId | undefined; // A human-readable name of the function, class, or type alias that - // provides the scope for this type variable. This might not be unique, - // so it should be used only for error messages. + // provides the scope to which this type variable is bound. Unlike the + // scopeId, this might not be unique, so it should be used only for error + // messages. scopeName?: string | undefined; - // If the TypeVar is bound to a scope, this is the scope type. + // If the TypeVar is bound to a scope, this is the scope type scopeType?: TypeVarScopeType; - // String formatted as .. + // String formatted as . nameWithScope?: string | undefined; // Is this variadic TypeVar unpacked (i.e. Unpack or * operator applied)? @@ -2099,10 +2207,10 @@ export interface TypeVarType extends TypeBase { // differentiate between Unpack[Vs] and Union[Unpack[Vs]]. isVariadicInUnion?: boolean | undefined; - // Represents access to "args" or "kwargs" of a ParamSpec. + // Represents access to "args" or "kwargs" of a ParamSpec paramSpecAccess?: ParamSpecAccess; - // May be different from declaredVariance if the latter is Auto. + // May be different from declaredVariance if declared as Auto computedVariance?: Variance; } @@ -2128,6 +2236,18 @@ export namespace TypeVarType { return newInstance; } + export function cloneForNewName(type: TypeVarType, name: string): TypeVarType { + const newInstance = TypeBase.cloneType(type); + newInstance.details = { ...type.details }; + newInstance.details.name = name; + + if (newInstance.scopeId) { + newInstance.nameWithScope = makeNameWithScope(name, newInstance.scopeId); + } + + return newInstance; + } + export function cloneForScopeId( type: TypeVarType, scopeId: string, @@ -2243,6 +2363,12 @@ export namespace TypeVarType { return variance; } + + // Indicates whether the specified type is a recursive type alias + // placeholder that has not yet been resolved. + export function isTypeAliasPlaceholder(type: TypeVarType) { + return !!type.details.recursiveTypeAliasName && !type.details.boundType; + } } export function isNever(type: Type): type is NeverType { @@ -2322,10 +2448,12 @@ export function isVariadicTypeVar(type: Type): type is TypeVarType { } export function isUnpackedVariadicTypeVar(type: Type): boolean { - if (isUnion(type) && type.subtypes.length === 1) { - type = type.subtypes[0]; - } - return type.category === TypeCategory.TypeVar && type.details.isVariadic && !!type.isVariadicUnpacked; + return ( + type.category === TypeCategory.TypeVar && + type.details.isVariadic && + !!type.isVariadicUnpacked && + !type.isVariadicInUnion + ); } export function isUnpackedClass(type: Type): type is ClassType { @@ -2443,9 +2571,9 @@ export function isTypeSame(type1: Type, type2: Type, options: TypeSameOptions = const typeArgCount = Math.max(type1TypeArgs.length, type2TypeArgs.length); for (let i = 0; i < typeArgCount; i++) { - // Assume that missing type args are "Any". - const typeArg1 = i < type1TypeArgs.length ? type1TypeArgs[i] : AnyType.create(); - const typeArg2 = i < type2TypeArgs.length ? type2TypeArgs[i] : AnyType.create(); + // Assume that missing type args are "Unknown". + const typeArg1 = i < type1TypeArgs.length ? type1TypeArgs[i] : UnknownType.create(); + const typeArg2 = i < type2TypeArgs.length ? type2TypeArgs[i] : UnknownType.create(); if (!isTypeSame(typeArg1, typeArg2, { ...options, ignoreTypeFlags: false }, recursionCount)) { return false; @@ -2511,6 +2639,24 @@ export function isTypeSame(type1: Type, type2: Type, options: TypeSameOptions = } } + // If the functions have ParamSpecs associated with them, make sure those match. + if (!type1.specializedTypes && !functionType2.specializedTypes) { + const paramSpec1 = type1.details.paramSpec; + const paramSpec2 = functionType2.details.paramSpec; + + if (paramSpec1) { + if (!paramSpec2) { + return false; + } + + if (!isTypeSame(paramSpec1, paramSpec2, options, recursionCount)) { + return false; + } + } else if (paramSpec2) { + return false; + } + } + // Make sure the return types match. let return1Type = type1.details.declaredReturnType; if (type1.specializedTypes && type1.specializedTypes.returnType) { @@ -2570,9 +2716,12 @@ export function isTypeSame(type1: Type, type2: Type, options: TypeSameOptions = // The types do not have a particular order, so we need to // do the comparison in an order-independent manner. + const exclusionSet = new Set(); return ( - findSubtype(type1, (subtype) => !UnionType.containsType(unionType2, subtype, recursionCount)) === - undefined + findSubtype( + type1, + (subtype) => !UnionType.containsType(unionType2, subtype, exclusionSet, recursionCount) + ) === undefined ); } @@ -2601,6 +2750,10 @@ export function isTypeSame(type1: Type, type2: Type, options: TypeSameOptions = } } + if (!type1.isVariadicInUnion !== !type2TypeVar.isVariadicInUnion) { + return false; + } + if (type1.details === type2TypeVar.details) { return true; } @@ -2670,6 +2823,12 @@ export function isTypeSame(type1: Type, type2: Type, options: TypeSameOptions = return false; } + + case TypeCategory.Unknown: { + const type2Unknown = type2 as UnknownType; + + return type1.isIncomplete === type2Unknown.isIncomplete; + } } return true; @@ -2685,6 +2844,15 @@ export function removeIncompleteUnknownFromUnion(type: Type): Type { return removeFromUnion(type, (t: Type) => isUnknown(t) && t.isIncomplete); } +export function cleanIncompleteUnknown(type: Type): Type { + const typeWithoutUnknown = removeIncompleteUnknownFromUnion(type); + if (!isNever(typeWithoutUnknown)) { + return typeWithoutUnknown; + } + + return type; +} + // If the type is a union, remove an "unbound" type from the union, // returning only the known types. export function removeUnbound(type: Type): Type { @@ -2895,6 +3063,16 @@ function _addTypeIfUnique(unionType: UnionType, typeToAdd: UnionableType) { UnionType.addType(unionType, typeToAdd); } return; + } else if ( + ClassType.isEnumClass(typeToAdd) && + typeToAdd.literalValue !== undefined && + unionType.literalEnumMap !== undefined + ) { + const enumLiteral = typeToAdd.literalValue as EnumLiteral; + if (!unionType.literalEnumMap.has(enumLiteral.getName())) { + UnionType.addType(unionType, typeToAdd); + } + return; } } diff --git a/packages/pyright-internal/src/backgroundAnalysisBase.ts b/packages/pyright-internal/src/backgroundAnalysisBase.ts index 4a2ab900b..f5b0de4a6 100644 --- a/packages/pyright-internal/src/backgroundAnalysisBase.ts +++ b/packages/pyright-internal/src/backgroundAnalysisBase.ts @@ -21,18 +21,18 @@ import { LogData, run, } from './backgroundThreadBase'; -import { throwIfCancellationRequested } from './common/cancellationUtils'; +import { + getCancellationTokenId, + OperationCanceledException, + throwIfCancellationRequested, +} from './common/cancellationUtils'; import { ConfigOptions } from './common/configOptions'; import { ConsoleInterface, log, LogLevel } from './common/console'; import * as debug from './common/debug'; import { Diagnostic } from './common/diagnostic'; import { FileDiagnostics } from './common/diagnosticSink'; -import { LanguageServiceExtension } from './common/extensibility'; -import { - disposeCancellationToken, - getCancellationTokenFromId, - getCancellationTokenId, -} from './common/fileBasedCancellationUtils'; +import { Extensions } from './common/extensibility'; +import { disposeCancellationToken, getCancellationTokenFromId } from './common/fileBasedCancellationUtils'; import { FileSystem } from './common/fileSystem'; import { Host, HostKind } from './common/host'; import { LogTracker } from './common/logTracker'; @@ -123,8 +123,12 @@ export class BackgroundAnalysisBase { }); } - setFileClosed(filePath: string) { - this.enqueueRequest({ requestType: 'setFileClosed', data: filePath }); + setFileClosed(filePath: string, isTracked?: boolean) { + this.enqueueRequest({ requestType: 'setFileClosed', data: { filePath, isTracked } }); + } + + addInterimFile(filePath: string) { + this.enqueueRequest({ requestType: 'addInterimFile', data: { filePath } }); } markAllFilesDirty(evenIfContentsAreSame: boolean, indexingNeeded: boolean) { @@ -193,17 +197,21 @@ export class BackgroundAnalysisBase { indexOptions: IndexOptions, configOptions: ConfigOptions, importResolver: ImportResolver, - kind: HostKind, - indices: Indices + kind: HostKind ) { /* noop */ } - refreshIndexing(configOptions: ConfigOptions, importResolver: ImportResolver, kind: HostKind, indices?: Indices) { + refreshIndexing( + configOptions: ConfigOptions, + importResolver: ImportResolver, + kind: HostKind, + refreshOptions?: RefreshOptions + ) { /* noop */ } - cancelIndexing(configOptions: ConfigOptions) { + cancelIndexing() { /* noop */ } @@ -280,14 +288,13 @@ export abstract class BackgroundAnalysisRunnerBase extends BackgroundThreadBase protected _importResolver: ImportResolver; private _program: Program; - protected _host: Host; protected _logTracker: LogTracker; get program(): Program { return this._program; } - protected constructor(private _extension?: LanguageServiceExtension) { + protected constructor() { super(workerData as InitializationData); // Stash the base directory into a global variable. @@ -295,27 +302,24 @@ export abstract class BackgroundAnalysisRunnerBase extends BackgroundThreadBase this.log(LogLevel.Info, `Background analysis(${threadId}) root directory: ${data.rootDirectory}`); this._configOptions = new ConfigOptions(data.rootDirectory); - this._host = this.createHost(); - this._importResolver = this.createImportResolver(this.fs, this._configOptions, this._host); + this._importResolver = this.createImportResolver(this.fs, this._configOptions, this.createHost()); const console = this.getConsole(); this._logTracker = new LogTracker(console, `BG(${threadId})`); - this._program = new Program( - this._importResolver, - this._configOptions, - console, - this._extension, - this._logTracker - ); + this._program = new Program(this._importResolver, this._configOptions, console, this._logTracker); + + // Create the extensions bound to the program for this background thread + Extensions.createProgramExtensions(this._program, { + addInterimFile: (filePath: string) => this._program.addInterimFile(filePath), + }); } start() { this.log(LogLevel.Info, `Background analysis(${threadId}) started`); // Get requests from main thread. - parentPort?.on('message', (msg: AnalysisRequest) => this.onMessage(msg)); - + parentPort?.on('message', this._onMessageWrapper.bind(this)); parentPort?.on('error', (msg) => debug.fail(`failed ${msg}`)); parentPort?.on('exit', (c) => { if (c !== 0) { @@ -396,7 +400,11 @@ export abstract class BackgroundAnalysisRunnerBase extends BackgroundThreadBase case 'setConfigOptions': { this._configOptions = createConfigOptionsFrom(msg.data); - this._importResolver = this.createImportResolver(this.fs, this._configOptions, this._host); + this._importResolver = this.createImportResolver( + this.fs, + this._configOptions, + this._importResolver.host + ); this.program.setConfigOptions(this._configOptions); this.program.setImportResolver(this._importResolver); break; @@ -435,11 +443,18 @@ export abstract class BackgroundAnalysisRunnerBase extends BackgroundThreadBase } case 'setFileClosed': { - const diagnostics = this.program.setFileClosed(msg.data); + const { filePath, isTracked } = msg.data; + const diagnostics = this.program.setFileClosed(filePath, isTracked); this._reportDiagnostics(diagnostics, this.program.getFilesToAnalyzeCount(), 0); break; } + case 'addInterimFile': { + const { filePath } = msg.data; + this.program.addInterimFile(filePath); + break; + } + case 'markAllFilesDirty': { const { evenIfContentsAreSame, indexingNeeded } = msg.data; this.program.markAllFilesDirty(evenIfContentsAreSame, indexingNeeded); @@ -464,13 +479,17 @@ export abstract class BackgroundAnalysisRunnerBase extends BackgroundThreadBase case 'restart': { // recycle import resolver - this._importResolver = this.createImportResolver(this.fs, this._configOptions, this._host); + this._importResolver = this.createImportResolver( + this.fs, + this._configOptions, + this._importResolver.host + ); this.program.setImportResolver(this._importResolver); break; } case 'shutdown': { - parentPort?.close(); + this.shutdown(); break; } @@ -480,6 +499,25 @@ export abstract class BackgroundAnalysisRunnerBase extends BackgroundThreadBase } } + private _onMessageWrapper(msg: AnalysisRequest) { + try { + return this.onMessage(msg); + } catch (e: any) { + // Don't crash the worker, just send an exception or cancel message + this.log(LogLevel.Log, `Background analysis exception leak: ${e}`); + + if (OperationCanceledException.is(e)) { + parentPort?.postMessage({ kind: 'cancelled', data: e.message }); + return; + } + + parentPort?.postMessage({ + kind: 'failed', + data: `Exception: for msg ${msg.requestType}: ${e.message} in ${e.stack}`, + }); + } + } + private _analyzeOneChunk(port: MessagePort, token: CancellationToken, msg: AnalysisRequest) { // Report results at the interval of the max analysis time. const maxTime = { openFilesTimeInMs: 50, noOpenFilesTimeInMs: 200 }; @@ -515,6 +553,12 @@ export abstract class BackgroundAnalysisRunnerBase extends BackgroundThreadBase port.postMessage({ requestType: 'indexResult', data: result }); } + protected override shutdown() { + this._program.dispose(); + Extensions.destroyProgramExtensions(this._program.id); + super.shutdown(); + } + private _reportDiagnostics(diagnostics: FileDiagnostics[], filesLeftToAnalyze: number, elapsedTime: number) { if (parentPort) { this._onAnalysisCompletion(parentPort, { @@ -558,7 +602,7 @@ function convertDiagnostics(diagnostics: Diagnostic[]) { // Elements are typed as "any" since data crossing the process // boundary loses type info. return diagnostics.map((d: any) => { - const diag = new Diagnostic(d.category, d.message, d.range); + const diag = new Diagnostic(d.category, d.message, d.range, d.priority); if (d._actions) { for (const action of d._actions) { diag.addAction(action); @@ -600,7 +644,8 @@ export interface AnalysisRequest { | 'setExperimentOptions' | 'setImportResolver' | 'getInlayHints' - | 'shutdown'; + | 'shutdown' + | 'addInterimFile'; data: any; port?: MessagePort | undefined; @@ -612,6 +657,11 @@ export interface AnalysisResponse { } export interface IndexOptions { - // forceIndexing means it will include symbols not shown in __all__ for py file. - packageDepths: [moduleName: string, maxDepth: number, forceIndexing: boolean][]; + // includeAllSymbols means it will include symbols not shown in __all__ for py file. + packageDepths: [moduleName: string, maxDepth: number, includeAllSymbols: boolean][]; +} + +export interface RefreshOptions { + // No files/folders are added or removed. only changes. + changesOnly: boolean; } diff --git a/packages/pyright-internal/src/backgroundThreadBase.ts b/packages/pyright-internal/src/backgroundThreadBase.ts index 7a978bf1b..7a275ba95 100644 --- a/packages/pyright-internal/src/backgroundThreadBase.ts +++ b/packages/pyright-internal/src/backgroundThreadBase.ts @@ -6,7 +6,7 @@ * base class for background worker thread. */ -import { MessagePort, parentPort } from 'worker_threads'; +import { MessagePort, parentPort, TransferListItem } from 'worker_threads'; import { OperationCanceledException, setCancellationFolderName } from './common/cancellationUtils'; import { ConfigOptions } from './common/configOptions'; @@ -52,12 +52,21 @@ export class BackgroundThreadBase { level: LogLevel.Log, }; } + + protected shutdown() { + this.fs.dispose(); + parentPort?.close(); + } } export function createConfigOptionsFrom(jsonObject: any): ConfigOptions { const configOptions = new ConfigOptions(jsonObject.projectRoot); const getFileSpec = (fileSpec: any): FileSpec => { - return { wildcardRoot: fileSpec.wildcardRoot, regExp: new RegExp(fileSpec.regExp.source) }; + return { + wildcardRoot: fileSpec.wildcardRoot, + regExp: new RegExp(fileSpec.regExp.source), + hasDirectoryWildcard: fileSpec.hasDirectoryWildcard, + }; }; configOptions.pythonPath = jsonObject.pythonPath; @@ -79,17 +88,23 @@ export function createConfigOptionsFrom(jsonObject: any): ConfigOptions { configOptions.executionEnvironments = jsonObject.executionEnvironments; configOptions.autoImportCompletions = jsonObject.autoImportCompletions; configOptions.indexing = jsonObject.indexing; + configOptions.taskListTokens = jsonObject.taskListTokens; configOptions.logTypeEvaluationTime = jsonObject.logTypeEvaluationTime; configOptions.typeEvaluationTimeThreshold = jsonObject.typeEvaluationTimeThreshold; configOptions.include = jsonObject.include.map((f: any) => getFileSpec(f)); configOptions.exclude = jsonObject.exclude.map((f: any) => getFileSpec(f)); configOptions.ignore = jsonObject.ignore.map((f: any) => getFileSpec(f)); configOptions.strict = jsonObject.strict.map((f: any) => getFileSpec(f)); + configOptions.functionSignatureDisplay = jsonObject.functionSignatureDisplay; return configOptions; } -export function run(code: () => any, port: MessagePort) { +export interface MessagePoster { + postMessage(value: any, transferList?: ReadonlyArray): void; +} + +export function run(code: () => T, port: MessagePoster) { try { const result = code(); port.postMessage({ kind: 'ok', data: result }); diff --git a/packages/pyright-internal/src/commands/commandController.ts b/packages/pyright-internal/src/commands/commandController.ts index e1e5419c3..87a99a18c 100644 --- a/packages/pyright-internal/src/commands/commandController.ts +++ b/packages/pyright-internal/src/commands/commandController.ts @@ -11,6 +11,7 @@ import { CancellationToken, ExecuteCommandParams, ResponseError } from 'vscode-l import { LanguageServerInterface } from '../languageServerBase'; import { Commands } from './commands'; import { CreateTypeStubCommand } from './createTypeStub'; +import { DumpFileDebugInfoCommand } from './dumpFileDebugInfoCommand'; import { QuickActionCommand } from './quickActionCommand'; import { RestartServerCommand } from './restartServer'; @@ -22,11 +23,13 @@ export class CommandController implements ServerCommand { private _createStub: CreateTypeStubCommand; private _restartServer: RestartServerCommand; private _quickAction: QuickActionCommand; + private _dumpFileDebugInfo: DumpFileDebugInfoCommand; constructor(ls: LanguageServerInterface) { this._createStub = new CreateTypeStubCommand(ls); this._restartServer = new RestartServerCommand(ls); this._quickAction = new QuickActionCommand(ls); + this._dumpFileDebugInfo = new DumpFileDebugInfoCommand(ls); } async execute(cmdParams: ExecuteCommandParams, token: CancellationToken): Promise { @@ -44,6 +47,10 @@ export class CommandController implements ServerCommand { return this._restartServer.execute(cmdParams); } + case Commands.dumpFileDebugInfo: { + return this._dumpFileDebugInfo.execute(cmdParams, token); + } + default: { return new ResponseError(1, 'Unsupported command'); } @@ -53,6 +60,7 @@ export class CommandController implements ServerCommand { isLongRunningCommand(command: string): boolean { switch (command) { case Commands.createTypeStub: + case Commands.restartServer: return true; default: diff --git a/packages/pyright-internal/src/commands/commands.ts b/packages/pyright-internal/src/commands/commands.ts index 2dbc7b51a..caf908d82 100644 --- a/packages/pyright-internal/src/commands/commands.ts +++ b/packages/pyright-internal/src/commands/commands.ts @@ -13,4 +13,10 @@ export const enum Commands { orderImports = 'pyright.organizeimports', addMissingOptionalToParam = 'pyright.addoptionalforparam', unusedImport = 'pyright.unusedImport', + dumpFileDebugInfo = 'pyright.dumpFileDebugInfo', + dumpTokens = 'pyright.dumpTokens', + dumpNodes = 'pyright.dumpNodes', + dumpTypes = 'pyright.dumpTypes', + dumpCachedTypes = 'pyright.dumpCachedTypes', + dumpCodeFlowGraph = 'pyright.dumpCodeFlowGraph', } diff --git a/packages/pyright-internal/src/commands/createTypeStub.ts b/packages/pyright-internal/src/commands/createTypeStub.ts index 304987948..94e72b3f6 100644 --- a/packages/pyright-internal/src/commands/createTypeStub.ts +++ b/packages/pyright-internal/src/commands/createTypeStub.ts @@ -25,8 +25,9 @@ export class CreateTypeStubCommand implements ServerCommand { const service = await AnalyzerServiceExecutor.cloneService( this._ls, await this._ls.getWorkspaceForFile(callingFile ?? workspaceRoot), - importName, - this._ls.createBackgroundAnalysis() + { + typeStubTargetImportName: importName, + } ); try { @@ -35,6 +36,10 @@ export class CreateTypeStubCommand implements ServerCommand { const infoMessage = `Type stub was successfully created for '${importName}'.`; this._ls.window.showInformationMessage(infoMessage); + + // This is called after a new type stub has been created. It allows + // us to invalidate caches and force reanalysis of files that potentially + // are affected by the appearance of a new type stub. this._ls.reanalyze(); } catch (err) { const isCancellation = OperationCanceledException.is(err); diff --git a/packages/pyright-internal/src/commands/dumpFileDebugInfoCommand.ts b/packages/pyright-internal/src/commands/dumpFileDebugInfoCommand.ts new file mode 100644 index 000000000..02e2628b3 --- /dev/null +++ b/packages/pyright-internal/src/commands/dumpFileDebugInfoCommand.ts @@ -0,0 +1,1371 @@ +/* + * dumpFileDebugInfoCommand.ts + * Copyright (c) Microsoft Corporation. + * + * Dump various token/node/type info + */ + +import { CancellationToken, ExecuteCommandParams } from 'vscode-languageserver'; + +import { getFlowNode } from '../analyzer/analyzerNodeInfo'; +import { findNodeByOffset, printParseNodeType } from '../analyzer/parseTreeUtils'; +import { ParseTreeWalker } from '../analyzer/parseTreeWalker'; +import { TypeEvaluator } from '../analyzer/typeEvaluatorTypes'; +import { + ClassType, + ClassTypeFlags, + FunctionParameter, + FunctionType, + FunctionTypeFlags, + TypeBase, + TypeCategory, + TypeFlags, + TypeVarDetails, + TypeVarType, + Variance, +} from '../analyzer/types'; +import { throwIfCancellationRequested } from '../common/cancellationUtils'; +import { isNumber, isString } from '../common/core'; +import { convertOffsetsToRange, convertOffsetToPosition } from '../common/positionUtils'; +import { TextRange } from '../common/textRange'; +import { TextRangeCollection } from '../common/textRangeCollection'; +import { LanguageServerInterface } from '../languageServerBase'; +import { + ArgumentCategory, + ArgumentNode, + AssertNode, + AssignmentExpressionNode, + AssignmentNode, + AugmentedAssignmentNode, + AwaitNode, + BinaryOperationNode, + BreakNode, + CallNode, + CaseNode, + ClassNode, + ConstantNode, + ContinueNode, + DecoratorNode, + DelNode, + DictionaryExpandEntryNode, + DictionaryKeyEntryNode, + DictionaryNode, + EllipsisNode, + ErrorExpressionCategory, + ErrorNode, + ExceptNode, + ExpressionNode, + FormatStringNode, + ForNode, + FunctionAnnotationNode, + FunctionNode, + GlobalNode, + IfNode, + ImportAsNode, + ImportFromAsNode, + ImportFromNode, + ImportNode, + IndexNode, + isExpressionNode, + LambdaNode, + ListComprehensionForNode, + ListComprehensionIfNode, + ListComprehensionNode, + ListNode, + MatchNode, + MemberAccessNode, + ModuleNameNode, + ModuleNode, + NameNode, + NonlocalNode, + NumberNode, + ParameterCategory, + ParameterNode, + ParseNode, + ParseNodeType, + PassNode, + PatternAsNode, + PatternCaptureNode, + PatternClassArgumentNode, + PatternClassNode, + PatternLiteralNode, + PatternMappingExpandEntryNode, + PatternMappingKeyEntryNode, + PatternMappingNode, + PatternSequenceNode, + PatternValueNode, + RaiseNode, + ReturnNode, + SetNode, + SliceNode, + StatementListNode, + StringListNode, + StringNode, + SuiteNode, + TernaryNode, + TryNode, + TupleNode, + TypeAliasNode, + TypeAnnotationNode, + TypeParameterCategory, + TypeParameterListNode, + TypeParameterNode, + UnaryOperationNode, + UnpackNode, + WhileNode, + WithItemNode, + WithNode, + YieldFromNode, + YieldNode, +} from '../parser/parseNodes'; +import { ParseResults } from '../parser/parser'; +import { KeywordType, NewLineType, OperatorType, StringTokenFlags, Token, TokenType } from '../parser/tokenizerTypes'; +import { ServerCommand } from './commandController'; + +export class DumpFileDebugInfoCommand implements ServerCommand { + constructor(private _ls: LanguageServerInterface) {} + + async execute(params: ExecuteCommandParams, token: CancellationToken): Promise { + throwIfCancellationRequested(token); + + if (!params.arguments || params.arguments.length < 2) { + return []; + } + + const filePath = params.arguments[0] as string; + const kind = params.arguments[1]; + + const workspace = await this._ls.getWorkspaceForFile(filePath); + const parseResults = workspace.service.getParseResult(filePath); + if (!parseResults) { + return []; + } + + const output: string[] = []; + const collectingConsole = { + info: (m: string) => { + output.push(m); + }, + log: (m: string) => { + output.push(m); + }, + error: (m: string) => { + output.push(m); + }, + warn: (m: string) => { + output.push(m); + }, + }; + + collectingConsole.info(`* Dump debug info for '${filePath}'`); + + switch (kind) { + case 'tokens': { + collectingConsole.info(`* Token info (${parseResults.tokenizerOutput.tokens.count} tokens)`); + + for (let i = 0; i < parseResults.tokenizerOutput.tokens.count; i++) { + const token = parseResults.tokenizerOutput.tokens.getItemAt(i); + collectingConsole.info( + `[${i}] ${getTokenString(filePath, token, parseResults.tokenizerOutput.lines)}` + ); + } + break; + } + case 'nodes': { + collectingConsole.info(`* Node info`); + + const dumper = new TreeDumper(filePath, parseResults.tokenizerOutput.lines); + dumper.walk(parseResults.parseTree); + + collectingConsole.info(dumper.output); + break; + } + case 'types': { + const evaluator = workspace.service.getEvaluator(); + const start = params.arguments[2] as number; + const end = params.arguments[3] as number; + if (!evaluator || !start || !end) { + return []; + } + + collectingConsole.info(`* Type info`); + collectingConsole.info(`${getTypeEvaluatorString(filePath, evaluator, parseResults, start, end)}`); + break; + } + case 'cachedtypes': { + const evaluator = workspace.service.getEvaluator(); + const start = params.arguments[2] as number; + const end = params.arguments[3] as number; + if (!evaluator || !start || !end) { + return []; + } + + collectingConsole.info(`* Cached Type info`); + collectingConsole.info( + `${getTypeEvaluatorString(filePath, evaluator, parseResults, start, end, true)}` + ); + break; + } + + case 'codeflowgraph': { + const evaluator = workspace.service.getEvaluator(); + const offset = params.arguments[2] as number; + if (!evaluator || offset === undefined) { + return []; + } + const node = findNodeByOffset(parseResults.parseTree, offset); + if (!node) { + return []; + } + const flowNode = getFlowNode(node); + if (!flowNode) { + return []; + } + collectingConsole.info(`* CodeFlow Graph`); + evaluator.printControlFlowGraph(flowNode, undefined, 'Dump CodeFlowGraph', collectingConsole); + } + } + + // Print all of the output in one message so the trace log is smaller. + this._ls.console.info(output.join('\n')); + } +} + +function stringify(value: any, replacer: (this: any, key: string, value: any) => any): string { + const json = JSON.stringify(value, replacer, 2); + + // Unescape any paths so VS code shows them as clickable. + return json.replace(/\\\\/g, '\\'); +} + +function getTypeEvaluatorString( + file: string, + evaluator: TypeEvaluator, + results: ParseResults, + start: number, + end: number, + cacheOnly?: boolean +) { + const dumper = new TreeDumper(file, results.tokenizerOutput.lines); + const node = findNodeByOffset(results.parseTree, start) ?? findNodeByOffset(results.parseTree, end); + if (!node) { + return 'N/A'; + } + + const set = new Set(); + + if (node.nodeType === ParseNodeType.Name) { + switch (node.parent?.nodeType) { + case ParseNodeType.Class: { + const result = cacheOnly + ? evaluator.getCachedType(node.parent.name) + : evaluator.getTypeOfClass(node.parent as ClassNode); + if (!result) { + return 'N/A'; + } + + return stringify(result, replacer); + } + case ParseNodeType.Function: { + const result = cacheOnly + ? evaluator.getCachedType(node.parent.name) + : evaluator.getTypeOfFunction(node.parent as FunctionNode); + if (!result) { + return 'N/A'; + } + + return stringify(result, replacer); + } + } + } + + const range = TextRange.fromBounds(start, end); + const expr = getExpressionNodeWithRange(node, range); + if (!expr) { + return 'N/A'; + } + + const sb = `Expression node found at ${getTextSpanString( + expr, + results.tokenizerOutput.lines + )} from the given span ${getTextSpanString(range, results.tokenizerOutput.lines)}\r\n`; + + const result = cacheOnly ? evaluator.getCachedType(expr) : evaluator.getType(expr); + if (!result) { + return sb + 'No result'; + } + + return sb + stringify(result, replacer); + + function getExpressionNodeWithRange(node: ParseNode, range: TextRange): ExpressionNode | undefined { + // find best expression node that contains both start and end. + let current: ParseNode | undefined = node; + while (current && !TextRange.containsRange(current, range)) { + current = current.parent; + } + + if (!current) { + return undefined; + } + + while (!isExpressionNode(current!)) { + current = current!.parent; + } + + return current; + } + + function replacer(this: any, key: string, value: any) { + if (value === undefined) { + return undefined; + } + + if (!isNumber(value) && !isString(value)) { + if (set.has(value)) { + if (isClassType(value)) { + return ` class '${value.details.fullName}' typeSourceId:${value.details.typeSourceId}`; + } + + if (isFunctionType(value)) { + return ` function '${value.details.fullName}' parameter count:${value.details.parameters.length}`; + } + + if (isTypeVarType(value)) { + return ` function '${value.details.name}' scope id:${value.nameWithScope}`; + } + + return undefined; + } else { + set.add(value); + } + } + + if (isTypeBase(this) && key === 'category') { + return getTypeCategoryString(value, this); + } + + if (isTypeBase(this) && key === 'flags') { + return getTypeFlagsString(value); + } + + if (isClassDetail(this) && key === 'flags') { + return getClassTypeFlagsString(value); + } + + if (isFunctionDetail(this) && key === 'flags') { + return getFunctionTypeFlagsString(value); + } + + if (isTypeVarDetails(this) && key === 'variance') { + return getVarianceString(value); + } + + if (isParameter(this) && key === 'category') { + return getParameterCategoryString(value); + } + + if (value.nodeType && value.id) { + dumper.visitNode(value as ParseNode); + + const output = dumper.output; + dumper.reset(); + return output; + } + + return value; + } + + function isTypeBase(type: any): boolean { + return type.category && type.flags; + } + + function isClassType(type: any): type is ClassType { + return isTypeBase(type) && type.details && isClassDetail(type.details); + } + + function isClassDetail(type: any): boolean { + return ( + type.name !== undefined && type.fullName !== undefined && type.moduleName !== undefined && type.baseClasses + ); + } + + function isFunctionType(type: any): type is FunctionType { + return isTypeBase(type) && type.details && isFunctionDetail(type.details); + } + + function isFunctionDetail(type: any): boolean { + return ( + type.name !== undefined && type.fullName !== undefined && type.moduleName !== undefined && type.parameters + ); + } + + function isTypeVarType(type: any): type is TypeVarType { + return isTypeBase(type) && type.details && isTypeVarDetails(type.details); + } + + function isTypeVarDetails(type: any): type is TypeVarDetails { + return type.name !== undefined && type.constraints && type.variance !== undefined; + } + + function isParameter(type: any): type is FunctionParameter { + return type.category && type.type; + } +} + +function getVarianceString(type: Variance) { + switch (type) { + case Variance.Invariant: + return 'Invariant'; + case Variance.Covariant: + return 'Covariant'; + case Variance.Contravariant: + return 'Contravariant'; + default: + return `Unknown Value!! (${type})`; + } +} + +function getFlagEnumString(enumMap: [E, string][], enumValue: E): string { + const str: string[] = []; + enumMap.forEach((e) => { + if (enumValue & e[0]) { + str.push(e[1]); + } + }); + if (str.length === 0) { + if (enumValue === 0) { + return 'None'; + } + return ''; + } + + return str.join(','); +} + +const FunctionTypeFlagsToString: [FunctionTypeFlags, string][] = [ + [FunctionTypeFlags.AbstractMethod, 'AbstractMethod'], + [FunctionTypeFlags.Async, 'Async'], + [FunctionTypeFlags.ClassMethod, 'ClassMethod'], + [FunctionTypeFlags.ConstructorMethod, 'ConstructorMethod'], + [FunctionTypeFlags.DisableDefaultChecks, 'DisableDefaultChecks'], + [FunctionTypeFlags.Final, 'Final'], + [FunctionTypeFlags.Generator, 'Generator'], + [FunctionTypeFlags.Overloaded, 'Overloaded'], + [FunctionTypeFlags.ParamSpecValue, 'ParamSpecValue'], + [FunctionTypeFlags.PartiallyEvaluated, 'PartiallyEvaluated'], + [FunctionTypeFlags.PyTypedDefinition, 'PyTypedDefinition'], + [FunctionTypeFlags.SkipArgsKwargsCompatibilityCheck, 'SkipArgsKwargsCompatibilityCheck'], + [FunctionTypeFlags.SkipConstructorCheck, 'SkipConstructorCheck'], + [FunctionTypeFlags.StaticMethod, 'StaticMethod'], + [FunctionTypeFlags.StubDefinition, 'StubDefinition'], + [FunctionTypeFlags.SynthesizedMethod, 'SynthesizedMethod'], + [FunctionTypeFlags.UnannotatedParams, 'UnannotatedParams'], + [FunctionTypeFlags.WrapReturnTypeInAwait, 'WrapReturnTypeInAwait'], +]; + +function getFunctionTypeFlagsString(flags: FunctionTypeFlags) { + return getFlagEnumString(FunctionTypeFlagsToString, flags); +} + +const ClassTypeFlagsToString: [ClassTypeFlags, string][] = [ + [ClassTypeFlags.BuiltInClass, 'BuiltInClass'], + [ClassTypeFlags.CanOmitDictValues, 'CanOmitDictValues'], + [ClassTypeFlags.ClassProperty, 'ClassProperty'], + [ClassTypeFlags.DataClass, 'DataClass'], + [ClassTypeFlags.DataClassKeywordOnlyParams, 'DataClassKeywordOnlyParams'], + [ClassTypeFlags.DefinedInStub, 'DefinedInStub'], + [ClassTypeFlags.EnumClass, 'EnumClass'], + [ClassTypeFlags.Final, 'Final'], + [ClassTypeFlags.FrozenDataClass, 'FrozenDataClass'], + [ClassTypeFlags.GenerateDataClassSlots, 'GenerateDataClassSlots'], + [ClassTypeFlags.HasCustomClassGetItem, 'HasCustomClassGetItem'], + [ClassTypeFlags.PartiallyEvaluated, 'PartiallyEvaluated'], + [ClassTypeFlags.PropertyClass, 'PropertyClass'], + [ClassTypeFlags.ProtocolClass, 'ProtocolClass'], + [ClassTypeFlags.PseudoGenericClass, 'PseudoGenericClass'], + [ClassTypeFlags.ReadOnlyInstanceVariables, 'ReadOnlyInstanceVariables'], + [ClassTypeFlags.RuntimeCheckable, 'RuntimeCheckable'], + [ClassTypeFlags.SkipSynthesizedDataClassEq, 'SkipSynthesizedDataClassEq'], + [ClassTypeFlags.SkipSynthesizedDataClassInit, 'SkipSynthesizedDataClassInit'], + [ClassTypeFlags.SpecialBuiltIn, 'SpecialBuiltIn'], + [ClassTypeFlags.SupportsAbstractMethods, 'SupportsAbstractMethods'], + [ClassTypeFlags.SynthesizeDataClassUnsafeHash, 'SynthesizeDataClassUnsafeHash'], + [ClassTypeFlags.SynthesizedDataClassOrder, 'SynthesizedDataClassOrder'], + [ClassTypeFlags.TupleClass, 'TupleClass'], + [ClassTypeFlags.TypedDictClass, 'TypedDictClass'], + [ClassTypeFlags.TypingExtensionClass, 'TypingExtensionClass'], +]; + +function getClassTypeFlagsString(flags: ClassTypeFlags) { + return getFlagEnumString(ClassTypeFlagsToString, flags); +} + +function getTypeFlagsString(flags: TypeFlags) { + const str = []; + + if (flags & TypeFlags.Instantiable) { + str.push('Instantiable'); + } + + if (flags & TypeFlags.Instance) { + str.push('Instance'); + } + + if (str.length === 0) return 'None'; + + return str.join(','); +} + +function getTypeCategoryString(typeCategory: TypeCategory, type: any) { + switch (typeCategory) { + case TypeCategory.Unbound: + return 'Unbound'; + case TypeCategory.Unknown: + return 'Unknown'; + case TypeCategory.Any: + return 'Any'; + case TypeCategory.None: + return 'None'; + case TypeCategory.Never: + return 'Never'; + case TypeCategory.Function: + return 'Function'; + case TypeCategory.OverloadedFunction: + return 'OverloadedFunction'; + case TypeCategory.Class: + if (TypeBase.isInstantiable(type)) { + return 'Class'; + } else { + return 'Object'; + } + case TypeCategory.Module: + return 'Module'; + case TypeCategory.Union: + return 'Union'; + case TypeCategory.TypeVar: + return 'TypeVar'; + default: + return `Unknown Value!! (${typeCategory})`; + } +} + +class TreeDumper extends ParseTreeWalker { + private _indentation = ''; + private _output = ''; + + constructor(private _file: string, private _lines: TextRangeCollection) { + super(); + } + + get output(): string { + return this._output; + } + + override walk(node: ParseNode): void { + const childrenToWalk = this.visitNode(node); + if (childrenToWalk.length > 0) { + this._indentation += ' '; + this.walkMultiple(childrenToWalk); + this._indentation = this._indentation.substr(0, this._indentation.length - 2); + } + } + + private _log(value: string) { + this._output += `${this._indentation}${value}\r\n`; + } + + private _getPrefix(node: ParseNode) { + const pos = convertOffsetToPosition(node.start, this._lines); + // VS code's output window expects 1 based values, print the line/char with 1 based. + return `[${node.id}] '${this._file}:${pos.line + 1}:${pos.character + 1}' => ${printParseNodeType( + node.nodeType + )} ${getTextSpanString(node, this._lines)} =>`; + } + + reset() { + this._indentation = ''; + this._output = ''; + } + + override visitArgument(node: ArgumentNode) { + this._log(`${this._getPrefix(node)} ${getArgumentCategoryString(node.argumentCategory)}`); + return true; + } + + override visitAssert(node: AssertNode) { + this._log(`${this._getPrefix(node)}`); + return true; + } + + override visitAssignment(node: AssignmentNode) { + this._log(`${this._getPrefix(node)}`); + return true; + } + + override visitAssignmentExpression(node: AssignmentExpressionNode) { + this._log(`${this._getPrefix(node)}`); + return true; + } + + override visitAugmentedAssignment(node: AugmentedAssignmentNode) { + this._log(`${this._getPrefix(node)} ${getOperatorTypeString(node.operator)}`); + return true; + } + + override visitAwait(node: AwaitNode) { + this._log(`${this._getPrefix(node)}`); + return true; + } + + override visitBinaryOperation(node: BinaryOperationNode) { + this._log( + `${this._getPrefix(node)} ${getTokenString( + this._file, + node.operatorToken, + this._lines + )} ${getOperatorTypeString(node.operator)}} parenthesized:(${node.parenthesized})` + ); + return true; + } + + override visitBreak(node: BreakNode) { + this._log(`${this._getPrefix(node)}`); + return true; + } + + override visitCall(node: CallNode) { + this._log(`${this._getPrefix(node)}`); + return true; + } + + override visitClass(node: ClassNode) { + this._log(`${this._getPrefix(node)}`); + return true; + } + + override visitTernary(node: TernaryNode) { + this._log(`${this._getPrefix(node)}`); + return true; + } + + override visitContinue(node: ContinueNode) { + this._log(`${this._getPrefix(node)}`); + return true; + } + + override visitConstant(node: ConstantNode) { + this._log(`${this._getPrefix(node)} ${getKeywordTypeString(node.constType)}`); + return true; + } + + override visitDecorator(node: DecoratorNode) { + this._log(`${this._getPrefix(node)}`); + return true; + } + + override visitDel(node: DelNode) { + this._log(`${this._getPrefix(node)}`); + return true; + } + + override visitDictionary(node: DictionaryNode) { + this._log(`${this._getPrefix(node)}`); + return true; + } + + override visitDictionaryKeyEntry(node: DictionaryKeyEntryNode) { + this._log(`${this._getPrefix(node)}`); + return true; + } + + override visitDictionaryExpandEntry(node: DictionaryExpandEntryNode) { + this._log(`${this._getPrefix(node)}`); + return true; + } + + override visitError(node: ErrorNode) { + this._log(`${this._getPrefix(node)} ${getErrorExpressionCategoryString(node.category)}`); + return true; + } + + override visitEllipsis(node: EllipsisNode) { + this._log(`${this._getPrefix(node)}`); + return true; + } + + override visitIf(node: IfNode) { + this._log(`${this._getPrefix(node)}`); + return true; + } + + override visitImport(node: ImportNode) { + this._log(`${this._getPrefix(node)}`); + return true; + } + + override visitImportAs(node: ImportAsNode) { + this._log(`${this._getPrefix(node)}`); + return true; + } + + override visitImportFrom(node: ImportFromNode) { + this._log( + `${this._getPrefix(node)} wildcard import:(${node.isWildcardImport}) paren:(${ + node.usesParens + }) wildcard token:(${ + node.wildcardToken ? getTokenString(this._file, node.wildcardToken, this._lines) : 'N/A' + }) missing import keyword:(${node.missingImportKeyword})` + ); + return true; + } + + override visitImportFromAs(node: ImportFromAsNode) { + this._log(`${this._getPrefix(node)}`); + return true; + } + + override visitIndex(node: IndexNode) { + this._log(`${this._getPrefix(node)}`); + return true; + } + + override visitExcept(node: ExceptNode) { + this._log(`${this._getPrefix(node)}`); + return true; + } + + override visitFor(node: ForNode) { + this._log(`${this._getPrefix(node)} async:(${node.isAsync})`); + return true; + } + + override visitFormatString(node: FormatStringNode) { + this._log( + `${this._getPrefix(node)} ${getTokenString(this._file, node.token, this._lines)} ${ + node.value + } unescape errors:(${node.hasUnescapeErrors})` + ); + return true; + } + + override visitFunction(node: FunctionNode) { + this._log(`${this._getPrefix(node)} async:(${node.isAsync})`); + return true; + } + + override visitFunctionAnnotation(node: FunctionAnnotationNode) { + this._log(`${this._getPrefix(node)} ellipsis:(${node.isParamListEllipsis})`); + return true; + } + + override visitGlobal(node: GlobalNode) { + this._log(`${this._getPrefix(node)}`); + return true; + } + + override visitLambda(node: LambdaNode) { + this._log(`${this._getPrefix(node)}`); + return true; + } + + override visitList(node: ListNode) { + this._log(`${this._getPrefix(node)}`); + return true; + } + + override visitListComprehension(node: ListComprehensionNode) { + this._log(`${this._getPrefix(node)}`); + return true; + } + + override visitListComprehensionFor(node: ListComprehensionForNode) { + this._log(`${this._getPrefix(node)} async:(${node.isAsync})`); + return true; + } + + override visitListComprehensionIf(node: ListComprehensionIfNode) { + this._log(`${this._getPrefix(node)}`); + return true; + } + + override visitMemberAccess(node: MemberAccessNode) { + this._log(`${this._getPrefix(node)}`); + return true; + } + + override visitModule(node: ModuleNode) { + this._log(`${this._getPrefix(node)}`); + return true; + } + + override visitModuleName(node: ModuleNameNode) { + this._log(`${this._getPrefix(node)} leading dots:(${node.leadingDots}) trailing dot:(${node.hasTrailingDot})`); + return true; + } + + override visitName(node: NameNode) { + this._log(`${this._getPrefix(node)} ${getTokenString(this._file, node.token, this._lines)} ${node.value}`); + return true; + } + + override visitNonlocal(node: NonlocalNode) { + this._log(`${this._getPrefix(node)}`); + return true; + } + + override visitNumber(node: NumberNode) { + this._log(`${this._getPrefix(node)} ${node.value} int:(${node.isInteger}) imaginary:(${node.isImaginary})`); + return true; + } + + override visitParameter(node: ParameterNode) { + this._log(`${this._getPrefix(node)} ${getParameterCategoryString(node.category)}`); + return true; + } + + override visitPass(node: PassNode) { + this._log(`${this._getPrefix(node)}`); + return true; + } + + override visitRaise(node: RaiseNode) { + this._log(`${this._getPrefix(node)}`); + return true; + } + + override visitReturn(node: ReturnNode) { + this._log(`${this._getPrefix(node)}`); + return true; + } + + override visitSet(node: SetNode) { + this._log(`${this._getPrefix(node)}`); + return true; + } + + override visitSlice(node: SliceNode) { + this._log(`${this._getPrefix(node)}`); + return true; + } + + override visitStatementList(node: StatementListNode) { + this._log(`${this._getPrefix(node)}`); + return true; + } + + override visitString(node: StringNode) { + this._log( + `${this._getPrefix(node)} ${getTokenString(this._file, node.token, this._lines)} ${ + node.value + } unescape errors:(${node.hasUnescapeErrors})` + ); + return true; + } + + override visitStringList(node: StringListNode) { + this._log(`${this._getPrefix(node)}`); + return true; + } + + override visitSuite(node: SuiteNode) { + this._log(`${this._getPrefix(node)}`); + return true; + } + + override visitTuple(node: TupleNode) { + this._log(`${this._getPrefix(node)} paren:(${node.enclosedInParens})`); + return true; + } + + override visitTry(node: TryNode) { + this._log(`${this._getPrefix(node)}`); + return true; + } + + override visitTypeAnnotation(node: TypeAnnotationNode) { + this._log(`${this._getPrefix(node)}`); + return true; + } + + override visitUnaryOperation(node: UnaryOperationNode) { + this._log( + `${this._getPrefix(node)} ${getTokenString( + this._file, + node.operatorToken, + this._lines + )} ${getOperatorTypeString(node.operator)}` + ); + return true; + } + + override visitUnpack(node: UnpackNode) { + this._log(`${this._getPrefix(node)}`); + return true; + } + + override visitWhile(node: WhileNode) { + this._log(`${this._getPrefix(node)}`); + return true; + } + + override visitWith(node: WithNode) { + this._log(`${this._getPrefix(node)} async:(${node.isAsync})`); + return true; + } + + override visitWithItem(node: WithItemNode) { + this._log(`${this._getPrefix(node)}`); + return true; + } + + override visitYield(node: YieldNode) { + this._log(`${this._getPrefix(node)}`); + return true; + } + + override visitYieldFrom(node: YieldFromNode) { + this._log(`${this._getPrefix(node)}`); + return true; + } + + override visitCase(node: CaseNode): boolean { + this._log(`${this._getPrefix(node)} isIrrefutable: ${node.isIrrefutable}`); + return true; + } + + override visitMatch(node: MatchNode): boolean { + this._log(`${this._getPrefix(node)}`); + return true; + } + + override visitPatternAs(node: PatternAsNode): boolean { + this._log(`${this._getPrefix(node)}`); + return true; + } + + override visitPatternCapture(node: PatternCaptureNode): boolean { + this._log(`${this._getPrefix(node)} isStar:${node.isStar} isWildcard:${node.isWildcard}`); + return true; + } + + override visitPatternClass(node: PatternClassNode): boolean { + this._log(`${this._getPrefix(node)}`); + return true; + } + + override visitPatternClassArgument(node: PatternClassArgumentNode): boolean { + this._log(`${this._getPrefix(node)}`); + return true; + } + + override visitPatternLiteral(node: PatternLiteralNode): boolean { + this._log(`${this._getPrefix(node)}`); + return true; + } + + override visitPatternMapping(node: PatternMappingNode): boolean { + this._log(`${this._getPrefix(node)}`); + return true; + } + + override visitPatternMappingExpandEntry(node: PatternMappingExpandEntryNode): boolean { + this._log(`${this._getPrefix(node)}`); + return true; + } + + override visitPatternMappingKeyEntry(node: PatternMappingKeyEntryNode): boolean { + this._log(`${this._getPrefix(node)}`); + return true; + } + + override visitPatternSequence(node: PatternSequenceNode): boolean { + this._log(`${this._getPrefix(node)} starEntryIndex: ${node.starEntryIndex}`); + return true; + } + + override visitPatternValue(node: PatternValueNode): boolean { + this._log(`${this._getPrefix(node)}`); + return true; + } + + override visitTypeAlias(node: TypeAliasNode): boolean { + this._log(`${this._getPrefix(node)}`); + return true; + } + + override visitTypeParameter(node: TypeParameterNode): boolean { + this._log( + `${this._getPrefix(node)} typeParamCategory:${getTypeParameterCategoryString(node.typeParamCategory)}` + ); + return true; + } + + override visitTypeParameterList(node: TypeParameterListNode): boolean { + this._log(`${this._getPrefix(node)}`); + return true; + } +} + +function getTypeParameterCategoryString(type: TypeParameterCategory) { + switch (type) { + case TypeParameterCategory.TypeVar: + return 'TypeVar'; + case TypeParameterCategory.TypeVarTuple: + return 'TypeVarTuple'; + case TypeParameterCategory.ParamSpec: + return 'ParamSpec'; + } +} + +function getParameterCategoryString(type: ParameterCategory) { + switch (type) { + case ParameterCategory.Simple: + return 'Simple'; + case ParameterCategory.VarArgList: + return 'VarArgList'; + case ParameterCategory.VarArgDictionary: + return 'VarArgDictionary'; + } +} + +function getArgumentCategoryString(type: ArgumentCategory) { + switch (type) { + case ArgumentCategory.Simple: + return 'Simple'; + case ArgumentCategory.UnpackedList: + return 'UnpackedList'; + case ArgumentCategory.UnpackedDictionary: + return 'UnpackedDictionary'; + default: + return `Unknown Value!! (${type})`; + } +} + +function getErrorExpressionCategoryString(type: ErrorExpressionCategory) { + switch (type) { + case ErrorExpressionCategory.MissingIn: + return 'MissingIn'; + case ErrorExpressionCategory.MissingElse: + return 'MissingElse'; + case ErrorExpressionCategory.MissingExpression: + return 'MissingExpression'; + case ErrorExpressionCategory.MissingIndexOrSlice: + return 'MissingIndexOrSlice'; + case ErrorExpressionCategory.MissingDecoratorCallName: + return 'MissingDecoratorCallName'; + case ErrorExpressionCategory.MissingCallCloseParen: + return 'MissingCallCloseParen'; + case ErrorExpressionCategory.MissingIndexCloseBracket: + return 'MissingIndexCloseBracket'; + case ErrorExpressionCategory.MissingMemberAccessName: + return 'MissingMemberAccessName'; + case ErrorExpressionCategory.MissingTupleCloseParen: + return 'MissingTupleCloseParen'; + case ErrorExpressionCategory.MissingListCloseBracket: + return 'MissingListCloseBracket'; + case ErrorExpressionCategory.MissingFunctionParameterList: + return 'MissingFunctionParameterList'; + case ErrorExpressionCategory.MissingPattern: + return 'MissingPattern'; + case ErrorExpressionCategory.MissingPatternSubject: + return 'MissingPatternSubject'; + case ErrorExpressionCategory.MissingDictValue: + return 'MissingDictValue'; + case ErrorExpressionCategory.MaxDepthExceeded: + return 'MaxDepthExceeded'; + default: + return `Unknown Value!! (${type})`; + } +} + +function getTokenString(file: string, token: Token, lines: TextRangeCollection) { + const pos = convertOffsetToPosition(token.start, lines); + let str = `'${file}:${pos.line + 1}:${pos.character + 1}' (`; + str += getTokenTypeString(token.type); + str += getNewLineInfo(token); + str += getOperatorInfo(token); + str += getKeywordInfo(token); + str += getStringTokenFlags(token); + str += `, ${getTextSpanString(token, lines)}`; + str += ') '; + str += JSON.stringify(token); + + return str; + + function getNewLineInfo(t: any) { + return t.newLineType ? `, ${getNewLineTypeString(t.newLineType)}` : ''; + } + + function getOperatorInfo(t: any) { + return t.operatorType ? `, ${getOperatorTypeString(t.operatorType)}` : ''; + } + + function getKeywordInfo(t: any) { + return t.keywordType ? `, ${getKeywordTypeString(t.keywordType)}` : ''; + } + + function getStringTokenFlags(t: any) { + return t.flags ? `, [${getStringTokenFlagsString(t.flags)}]` : ''; + } +} + +function getTextSpanString(span: TextRange, lines: TextRangeCollection) { + const range = convertOffsetsToRange(span.start, TextRange.getEnd(span), lines); + return `(${range.start.line},${range.start.character})-(${range.end.line},${range.end.character})`; +} + +function getTokenTypeString(type: TokenType) { + switch (type) { + case TokenType.Invalid: + return 'Invalid'; + case TokenType.EndOfStream: + return 'EndOfStream'; + case TokenType.NewLine: + return 'NewLine'; + case TokenType.Indent: + return 'Indent'; + case TokenType.Dedent: + return 'Dedent'; + case TokenType.String: + return 'String'; + case TokenType.Number: + return 'Number'; + case TokenType.Identifier: + return 'Identifier'; + case TokenType.Keyword: + return 'Keyword'; + case TokenType.Operator: + return 'Operator'; + case TokenType.Colon: + return 'Colon'; + case TokenType.Semicolon: + return 'Semicolon'; + case TokenType.Comma: + return 'Comma'; + case TokenType.OpenParenthesis: + return 'OpenParenthesis'; + case TokenType.CloseParenthesis: + return 'CloseParenthesis'; + case TokenType.OpenBracket: + return 'OpenBracket'; + case TokenType.CloseBracket: + return 'CloseBracket'; + case TokenType.OpenCurlyBrace: + return 'OpenCurlyBrace'; + case TokenType.CloseCurlyBrace: + return 'CloseCurlyBrace'; + case TokenType.Ellipsis: + return 'Ellipsis'; + case TokenType.Dot: + return 'Dot'; + case TokenType.Arrow: + return 'Arrow'; + case TokenType.Backtick: + return 'Backtick'; + default: + return `Unknown Value!! (${type})`; + } +} + +function getNewLineTypeString(type: NewLineType) { + switch (type) { + case NewLineType.CarriageReturn: + return 'CarriageReturn'; + case NewLineType.LineFeed: + return 'LineFeed'; + case NewLineType.CarriageReturnLineFeed: + return 'CarriageReturnLineFeed'; + case NewLineType.Implied: + return 'Implied'; + default: + return `Unknown Value!! (${type})`; + } +} + +function getOperatorTypeString(type: OperatorType) { + switch (type) { + case OperatorType.Add: + return 'Add'; + case OperatorType.AddEqual: + return 'AddEqual'; + case OperatorType.Assign: + return 'Assign'; + case OperatorType.BitwiseAnd: + return 'BitwiseAnd'; + case OperatorType.BitwiseAndEqual: + return 'BitwiseAndEqual'; + case OperatorType.BitwiseInvert: + return 'BitwiseInvert'; + case OperatorType.BitwiseOr: + return 'BitwiseOr'; + case OperatorType.BitwiseOrEqual: + return 'BitwiseOrEqual'; + case OperatorType.BitwiseXor: + return 'BitwiseXor'; + case OperatorType.BitwiseXorEqual: + return 'BitwiseXorEqual'; + case OperatorType.Divide: + return 'Divide'; + case OperatorType.DivideEqual: + return 'DivideEqual'; + case OperatorType.Equals: + return 'Equals'; + case OperatorType.FloorDivide: + return 'FloorDivide'; + case OperatorType.FloorDivideEqual: + return 'FloorDivideEqual'; + case OperatorType.GreaterThan: + return 'GreaterThan'; + case OperatorType.GreaterThanOrEqual: + return 'GreaterThanOrEqual'; + case OperatorType.LeftShift: + return 'LeftShift'; + case OperatorType.LeftShiftEqual: + return 'LeftShiftEqual'; + case OperatorType.LessOrGreaterThan: + return 'LessOrGreaterThan'; + case OperatorType.LessThan: + return 'LessThan'; + case OperatorType.LessThanOrEqual: + return 'LessThanOrEqual'; + case OperatorType.MatrixMultiply: + return 'MatrixMultiply'; + case OperatorType.MatrixMultiplyEqual: + return 'MatrixMultiplyEqual'; + case OperatorType.Mod: + return 'Mod'; + case OperatorType.ModEqual: + return 'ModEqual'; + case OperatorType.Multiply: + return 'Multiply'; + case OperatorType.MultiplyEqual: + return 'MultiplyEqual'; + case OperatorType.NotEquals: + return 'NotEquals'; + case OperatorType.Power: + return 'Power'; + case OperatorType.PowerEqual: + return 'PowerEqual'; + case OperatorType.RightShift: + return 'RightShift'; + case OperatorType.RightShiftEqual: + return 'RightShiftEqual'; + case OperatorType.Subtract: + return 'Subtract'; + case OperatorType.SubtractEqual: + return 'SubtractEqual'; + case OperatorType.Walrus: + return 'Walrus'; + case OperatorType.And: + return 'And'; + case OperatorType.Or: + return 'Or'; + case OperatorType.Not: + return 'Not'; + case OperatorType.Is: + return 'Is'; + case OperatorType.IsNot: + return 'IsNot'; + case OperatorType.In: + return 'In'; + case OperatorType.NotIn: + return 'NotIn'; + default: + return `Unknown Value!! (${type})`; + } +} + +function getKeywordTypeString(type: KeywordType) { + switch (type) { + case KeywordType.And: + return 'And'; + case KeywordType.As: + return 'As'; + case KeywordType.Assert: + return 'Assert'; + case KeywordType.Async: + return 'Async'; + case KeywordType.Await: + return 'Await'; + case KeywordType.Break: + return 'Break'; + case KeywordType.Class: + return 'Class'; + case KeywordType.Continue: + return 'Continue'; + case KeywordType.Debug: + return 'Debug'; + case KeywordType.Def: + return 'Def'; + case KeywordType.Del: + return 'Del'; + case KeywordType.Elif: + return 'Elif'; + case KeywordType.Else: + return 'Else'; + case KeywordType.Except: + return 'Except'; + case KeywordType.False: + return 'False'; + case KeywordType.Finally: + return 'Finally'; + case KeywordType.For: + return 'For'; + case KeywordType.From: + return 'From'; + case KeywordType.Global: + return 'Global'; + case KeywordType.If: + return 'If'; + case KeywordType.Import: + return 'Import'; + case KeywordType.In: + return 'In'; + case KeywordType.Is: + return 'Is'; + case KeywordType.Lambda: + return 'Lambda'; + case KeywordType.None: + return 'None'; + case KeywordType.Nonlocal: + return 'Nonlocal'; + case KeywordType.Not: + return 'Not'; + case KeywordType.Or: + return 'Or'; + case KeywordType.Pass: + return 'Pass'; + case KeywordType.Raise: + return 'Raise'; + case KeywordType.Return: + return 'Return'; + case KeywordType.True: + return 'True'; + case KeywordType.Try: + return 'Try'; + case KeywordType.While: + return 'While'; + case KeywordType.With: + return 'With'; + case KeywordType.Yield: + return 'Yield'; + default: + return `Unknown Value!! (${type})`; + } +} + +const StringTokenFlagsStrings: [StringTokenFlags, string][] = [ + [StringTokenFlags.Bytes, 'Bytes'], + [StringTokenFlags.DoubleQuote, 'DoubleQuote'], + [StringTokenFlags.ExceedsMaxSize, 'ExceedsMaxSize'], + [StringTokenFlags.Format, 'Format'], + [StringTokenFlags.Raw, 'Raw'], + [StringTokenFlags.SingleQuote, 'SingleQuote'], + [StringTokenFlags.Triplicate, 'Triplicate'], + [StringTokenFlags.Unicode, 'Unicode'], + [StringTokenFlags.Unterminated, 'Unterminated'], +]; + +function getStringTokenFlagsString(flags: StringTokenFlags) { + return getFlagEnumString(StringTokenFlagsStrings, flags); +} diff --git a/packages/pyright-internal/src/commands/quickActionCommand.ts b/packages/pyright-internal/src/commands/quickActionCommand.ts index 066f3bb28..4fae6c2e0 100644 --- a/packages/pyright-internal/src/commands/quickActionCommand.ts +++ b/packages/pyright-internal/src/commands/quickActionCommand.ts @@ -8,7 +8,7 @@ import { CancellationToken, ExecuteCommandParams } from 'vscode-languageserver'; -import { convertTextEdits } from '../common/textEditUtils'; +import { convertToFileTextEdits, convertToWorkspaceEdit } from '../common/workspaceEditUtils'; import { LanguageServerInterface } from '../languageServerBase'; import { ServerCommand } from './commandController'; import { Commands } from './commands'; @@ -27,14 +27,9 @@ export class QuickActionCommand implements ServerCommand { return []; } - const editActions = workspace.serviceInstance.performQuickAction( - filePath, - params.command, - otherArgs, - token - ); + const editActions = workspace.service.performQuickAction(filePath, params.command, otherArgs, token); - return convertTextEdits(docUri, editActions); + return convertToWorkspaceEdit(workspace.service.fs, convertToFileTextEdits(filePath, editActions ?? [])); } } } diff --git a/packages/pyright-internal/src/common/cancellationUtils.ts b/packages/pyright-internal/src/common/cancellationUtils.ts index 865f40bb8..dfe237a14 100644 --- a/packages/pyright-internal/src/common/cancellationUtils.ts +++ b/packages/pyright-internal/src/common/cancellationUtils.ts @@ -6,7 +6,7 @@ * Helper methods relating to cancellation. */ -import { AbstractCancellationTokenSource, CancellationTokenSource } from 'vscode-jsonrpc'; +import { AbstractCancellationTokenSource, CancellationTokenSource, Emitter, Event } from 'vscode-jsonrpc'; import { CancellationToken, Disposable, LSPErrorCodes, ResponseError } from 'vscode-languageserver'; import { isDebugMode } from './core'; @@ -43,8 +43,8 @@ export function throwIfCancellationRequested(token: CancellationToken) { } } -export function CancelAfter(...tokens: CancellationToken[]) { - const source = new CancellationTokenSource(); +export function CancelAfter(provider: CancellationProvider, ...tokens: CancellationToken[]) { + const source = provider.createCancellationTokenSource(); const disposables: Disposable[] = []; for (const token of tokens) { @@ -69,3 +69,91 @@ export class DefaultCancellationProvider implements CancellationProvider { return new CancellationTokenSource(); } } + +export function getCancellationTokenId(token: CancellationToken) { + return token instanceof FileBasedToken ? token.cancellationFilePath : undefined; +} + +export class FileBasedToken implements CancellationToken { + protected isCancelled = false; + private _emitter: Emitter | undefined; + + constructor(readonly cancellationFilePath: string, private _fs: { statSync(filePath: string): void }) { + // empty + } + + cancel() { + if (!this.isCancelled) { + this.isCancelled = true; + if (this._emitter) { + this._emitter.fire(undefined); + this._disposeEmitter(); + } + } + } + + get isCancellationRequested(): boolean { + if (this.isCancelled) { + return true; + } + + if (CancellationThrottle.shouldCheck() && this._pipeExists()) { + // The first time it encounters the cancellation file, it will + // cancel itself and raise a cancellation event. + // In this mode, cancel() might not be called explicitly by + // jsonrpc layer. + this.cancel(); + } + + return this.isCancelled; + } + + get onCancellationRequested(): Event { + if (!this._emitter) { + this._emitter = new Emitter(); + } + return this._emitter.event; + } + + dispose(): void { + this._disposeEmitter(); + } + + private _disposeEmitter() { + if (this._emitter) { + this._emitter.dispose(); + this._emitter = undefined; + } + } + + private _pipeExists(): boolean { + try { + this._fs.statSync(this.cancellationFilePath); + return true; + } catch (e: any) { + return false; + } + } +} + +class CancellationThrottle { + private static _lastCheckTimestamp = 0; + + static shouldCheck() { + // Throttle cancellation checks to one every 5ms. This value + // was selected through empirical testing. If we call the + // file system more often than this, type analysis performance + // is affected. If we call it less often, performance doesn't + // improve much, but responsiveness suffers. + const minTimeBetweenChecksInMs = 5; + const curTimestamp = Date.now().valueOf(); + const timeSinceLastCheck = curTimestamp - this._lastCheckTimestamp; + + if (timeSinceLastCheck >= minTimeBetweenChecksInMs) { + this._lastCheckTimestamp = curTimestamp; + return true; + } + + return false; + } +} diff --git a/packages/pyright-internal/src/common/collectionUtils.ts b/packages/pyright-internal/src/common/collectionUtils.ts index ccb69f59c..a5e1acaba 100644 --- a/packages/pyright-internal/src/common/collectionUtils.ts +++ b/packages/pyright-internal/src/common/collectionUtils.ts @@ -377,3 +377,20 @@ export function getMapValues(m: Map, predicate: (k: K, v: V) => bool return values; } + +export function addIfNotNull(arr: T[], t: T): T[] { + if (t === undefined) { + return arr; + } + + arr.push(t); + return arr; +} + +export function arrayEquals(c1: T[], c2: T[], predicate: (e1: T, e2: T) => boolean) { + if (c1.length !== c2.length) { + return false; + } + + return c1.every((v, i) => predicate(v, c2[i])); +} diff --git a/packages/pyright-internal/src/common/commandLineOptions.ts b/packages/pyright-internal/src/common/commandLineOptions.ts index e08a627ef..b1ff8e599 100644 --- a/packages/pyright-internal/src/common/commandLineOptions.ts +++ b/packages/pyright-internal/src/common/commandLineOptions.ts @@ -9,6 +9,7 @@ * of the analyzer). */ +import { TaskListToken } from './diagnostic'; import { PythonVersion } from './pythonVersion'; export const enum DiagnosticSeverityOverrides { @@ -44,6 +45,15 @@ export class CommandLineOptions { // are included. fileSpecs: string[] = []; + // A list of file specs to exclude in the analysis. Can contain + // directories, in which case all "*.py" files within those directories + // are excluded. + excludeFileSpecs: string[] = []; + + // A list of file specs whose errors and warnings should be ignored even + // if they are included in the transitive closure of included files. + ignoreFileSpecs: string[] = []; + // Watch for changes in workspace source files. watchForSourceChanges?: boolean | undefined; @@ -118,6 +128,9 @@ export class CommandLineOptions { // Use indexing. indexing?: boolean | undefined; + // Task list tokens, used for VS task list population + taskListTokens?: TaskListToken[] | undefined; + // Use type evaluator call tracking. logTypeEvaluationTime = false; @@ -128,5 +141,5 @@ export class CommandLineOptions { enableAmbientAnalysis = true; // Analyze functions and methods that have no type annotations? - analyzeUnannotatedFunctions = true; + analyzeUnannotatedFunctions?: boolean; } diff --git a/packages/pyright-internal/src/common/configOptions.ts b/packages/pyright-internal/src/common/configOptions.ts index 5e6fc589d..72b8879bb 100644 --- a/packages/pyright-internal/src/common/configOptions.ts +++ b/packages/pyright-internal/src/common/configOptions.ts @@ -14,6 +14,7 @@ import * as pathConsts from '../common/pathConsts'; import { appendArray } from './collectionUtils'; import { DiagnosticSeverityOverridesMap } from './commandLineOptions'; import { ConsoleInterface } from './console'; +import { TaskListToken } from './diagnostic'; import { DiagnosticRule } from './diagnosticRules'; import { FileSystem } from './fileSystem'; import { Host } from './host'; @@ -65,6 +66,11 @@ export class ExecutionEnvironment { export type DiagnosticLevel = 'none' | 'information' | 'warning' | 'error'; +export enum SignatureDisplayType { + compact = 'compact', + formatted = 'formatted', +} + export interface DiagnosticRuleSet { // Should "Unknown" types be reported as "Any"? printUnknownAsAny: boolean; @@ -92,6 +98,9 @@ export interface DiagnosticRuleSet { // Use strict inference rules for dictionary expressions? strictDictionaryInference: boolean; + // Analyze functions and methods that have no annotations? + analyzeUnannotatedFunctions: boolean; + // Use strict type rules for parameters assigned default of None? strictParameterNoneValue: boolean; @@ -184,6 +193,9 @@ export interface DiagnosticRuleSet { // Report attempts to redefine variables that are in all-caps. reportConstantRedefinition: DiagnosticLevel; + // Report use of deprecated classes or functions. + reportDeprecated: DiagnosticLevel; + // Report usage of method override that is incompatible with // the base class method of the same name? reportIncompatibleMethodOverride: DiagnosticLevel; @@ -295,6 +307,12 @@ export interface DiagnosticRuleSet { // Report cases where the a "match" statement is not exhaustive in // covering all possible cases. reportMatchNotExhaustive: DiagnosticLevel; + + // Report files that match stdlib modules. + reportShadowedImports: DiagnosticLevel; + + // Report missing @override decorator. + reportImplicitOverride: DiagnosticLevel; } export function cloneDiagnosticRuleSet(diagSettings: DiagnosticRuleSet): DiagnosticRuleSet { @@ -309,6 +327,7 @@ export function getBooleanDiagnosticRules(includeNonOverridable = false) { DiagnosticRule.strictListInference, DiagnosticRule.strictSetInference, DiagnosticRule.strictDictionaryInference, + DiagnosticRule.analyzeUnannotatedFunctions, DiagnosticRule.strictParameterNoneValue, ]; @@ -354,6 +373,7 @@ export function getDiagLevelDiagnosticRules() { DiagnosticRule.reportTypeCommentUsage, DiagnosticRule.reportPrivateImportUsage, DiagnosticRule.reportConstantRedefinition, + DiagnosticRule.reportDeprecated, DiagnosticRule.reportIncompatibleMethodOverride, DiagnosticRule.reportIncompatibleVariableOverride, DiagnosticRule.reportInconsistentConstructor, @@ -387,6 +407,8 @@ export function getDiagLevelDiagnosticRules() { DiagnosticRule.reportUnusedExpression, DiagnosticRule.reportUnnecessaryTypeIgnoreComment, DiagnosticRule.reportMatchNotExhaustive, + DiagnosticRule.reportShadowedImports, + DiagnosticRule.reportImplicitOverride, ]; } @@ -406,6 +428,7 @@ export function getOffDiagnosticRuleSet(): DiagnosticRuleSet { strictListInference: false, strictSetInference: false, strictDictionaryInference: false, + analyzeUnannotatedFunctions: true, strictParameterNoneValue: true, enableTypeIgnoreComments: true, reportGeneralTypeIssues: 'none', @@ -436,6 +459,7 @@ export function getOffDiagnosticRuleSet(): DiagnosticRuleSet { reportTypeCommentUsage: 'none', reportPrivateImportUsage: 'none', reportConstantRedefinition: 'none', + reportDeprecated: 'none', reportIncompatibleMethodOverride: 'none', reportIncompatibleVariableOverride: 'none', reportInconsistentConstructor: 'none', @@ -469,6 +493,8 @@ export function getOffDiagnosticRuleSet(): DiagnosticRuleSet { reportUnusedExpression: 'none', reportUnnecessaryTypeIgnoreComment: 'none', reportMatchNotExhaustive: 'none', + reportShadowedImports: 'none', + reportImplicitOverride: 'none', }; return diagSettings; @@ -484,6 +510,7 @@ export function getBasicDiagnosticRuleSet(): DiagnosticRuleSet { strictListInference: false, strictSetInference: false, strictDictionaryInference: false, + analyzeUnannotatedFunctions: true, strictParameterNoneValue: true, enableTypeIgnoreComments: true, reportGeneralTypeIssues: 'error', @@ -514,6 +541,7 @@ export function getBasicDiagnosticRuleSet(): DiagnosticRuleSet { reportTypeCommentUsage: 'none', reportPrivateImportUsage: 'error', reportConstantRedefinition: 'none', + reportDeprecated: 'none', reportIncompatibleMethodOverride: 'none', reportIncompatibleVariableOverride: 'none', reportInconsistentConstructor: 'none', @@ -547,6 +575,8 @@ export function getBasicDiagnosticRuleSet(): DiagnosticRuleSet { reportUnusedExpression: 'warning', reportUnnecessaryTypeIgnoreComment: 'none', reportMatchNotExhaustive: 'none', + reportShadowedImports: 'none', + reportImplicitOverride: 'none', }; return diagSettings; @@ -562,6 +592,7 @@ export function getStrictDiagnosticRuleSet(): DiagnosticRuleSet { strictListInference: true, strictSetInference: true, strictDictionaryInference: true, + analyzeUnannotatedFunctions: true, strictParameterNoneValue: true, enableTypeIgnoreComments: true, // Not overridden by strict mode reportGeneralTypeIssues: 'error', @@ -592,6 +623,7 @@ export function getStrictDiagnosticRuleSet(): DiagnosticRuleSet { reportTypeCommentUsage: 'error', reportPrivateImportUsage: 'error', reportConstantRedefinition: 'error', + reportDeprecated: 'error', reportIncompatibleMethodOverride: 'error', reportIncompatibleVariableOverride: 'error', reportInconsistentConstructor: 'error', @@ -625,11 +657,23 @@ export function getStrictDiagnosticRuleSet(): DiagnosticRuleSet { reportUnusedExpression: 'error', reportUnnecessaryTypeIgnoreComment: 'none', reportMatchNotExhaustive: 'error', + reportShadowedImports: 'none', + reportImplicitOverride: 'none', }; return diagSettings; } +export function matchFileSpecs(configOptions: ConfigOptions, filePath: string, isFile = true) { + for (const includeSpec of configOptions.include) { + if (FileSpec.matchIncludeFileSpec(includeSpec.regExp, configOptions.exclude, filePath, isFile)) { + return true; + } + } + + return false; +} + // Internal configuration options. These are derived from a combination // of the command line and from a JSON-based config file. export class ConfigOptions { @@ -637,6 +681,7 @@ export class ConfigOptions { this.projectRoot = projectRoot; this.typeCheckingMode = typeCheckingMode; this.diagnosticRuleSet = ConfigOptions.getDiagnosticRuleSet(typeCheckingMode); + this.functionSignatureDisplay = SignatureDisplayType.formatted; } // Absolute directory of project. All relative paths in the config @@ -709,15 +754,16 @@ export class ConfigOptions { // Was this config initialized from JSON (pyrightconfig/pyproject)? initializedFromJson = false; - // Should we skip analysis of all functions and methods that have - // no parameter ore return type annotations? - analyzeUnannotatedFunctions = true; - //--------------------------------------------------------------- // Diagnostics Rule Set diagnosticRuleSet: DiagnosticRuleSet; + //--------------------------------------------------------------- + // TaskList tokens used by diagnostics + + taskListTokens?: TaskListToken[] | undefined; + //--------------------------------------------------------------- // Parsing and Import Resolution Settings @@ -756,6 +802,9 @@ export class ConfigOptions { // treated as Any rather than Unknown? evaluateUnknownImportsAsAny?: boolean; + // Controls how hover and completion function signatures are displayed. + functionSignatureDisplay: SignatureDisplayType; + static getDiagnosticRuleSet(typeCheckingMode?: string): DiagnosticRuleSet { if (typeCheckingMode === 'strict') { return getStrictDiagnosticRuleSet(); @@ -1126,6 +1175,20 @@ export class ConfigOptions { this.typeEvaluationTimeThreshold = configObj.typeEvaluationTimeThreshold; } } + + // Read the "functionSignatureDisplay" setting. + if (configObj.functionSignatureDisplay !== undefined) { + if (typeof configObj.functionSignatureDisplay !== 'string') { + console.error(`Config "functionSignatureDisplay" field must be true or false.`); + } else { + if ( + configObj.functionSignatureDisplay === 'compact' || + configObj.functionSignatureDisplay === 'formatted' + ) { + this.functionSignatureDisplay = configObj.functionSignatureDisplay as SignatureDisplayType; + } + } + } } ensureDefaultPythonPlatform(host: Host, console: ConsoleInterface) { @@ -1137,7 +1200,7 @@ export class ConfigOptions { this.defaultPythonPlatform = host.getPythonPlatform(); if (this.defaultPythonPlatform !== undefined) { - console.info(`Assuming Python platform ${this.defaultPythonPlatform}`); + console.log(`Assuming Python platform ${this.defaultPythonPlatform}`); } } diff --git a/packages/pyright-internal/src/common/console.ts b/packages/pyright-internal/src/common/console.ts index 8057198de..03fe1e22b 100644 --- a/packages/pyright-internal/src/common/console.ts +++ b/packages/pyright-internal/src/common/console.ts @@ -199,3 +199,26 @@ export function log(console: ConsoleInterface, logType: LogLevel, msg: string) { debug.fail(`${logType} is not expected`); } } + +export function convertLogLevel(logLevelValue?: string): LogLevel { + if (!logLevelValue) { + return LogLevel.Info; + } + + switch (logLevelValue.toLowerCase()) { + case 'error': + return LogLevel.Error; + + case 'warning': + return LogLevel.Warn; + + case 'information': + return LogLevel.Info; + + case 'trace': + return LogLevel.Log; + + default: + return LogLevel.Info; + } +} diff --git a/packages/pyright-internal/src/common/core.ts b/packages/pyright-internal/src/common/core.ts index a9d9b9cc7..dad373336 100644 --- a/packages/pyright-internal/src/common/core.ts +++ b/packages/pyright-internal/src/common/core.ts @@ -6,6 +6,8 @@ * Various helpers that don't have a dependency on other code files. */ +import { TextRange } from './textRange'; + export const enum Comparison { LessThan = -1, EqualTo = 0, @@ -127,9 +129,21 @@ export function toBoolean(trueOrFalse: string): boolean { return false; } +let _debugMode: boolean | undefined = undefined; +export function test_setDebugMode(debugMode: boolean | undefined) { + const oldValue = _debugMode; + _debugMode = debugMode; + return oldValue; +} + export function isDebugMode() { - const argv = process.execArgv.join(); - return argv.includes('inspect') || argv.includes('debug'); + if (_debugMode === undefined) { + // Cache debugging mode since it can't be changed while process is running. + const argv = process.execArgv.join(); + _debugMode = argv.includes('inspect') || argv.includes('debug'); + } + + return _debugMode; } interface Thenable { @@ -150,3 +164,22 @@ export function isThenable(v: any): v is Thenable { export function isDefined(element: T | undefined): element is T { return element !== undefined; } + +export function getEnumNames(enumType: T) { + const result: string[] = []; + for (const value in enumType) { + if (isNaN(Number(value))) { + result.push(value); + } + } + + return result; +} + +export function containsOnlyWhitespace(text: string, span?: TextRange) { + if (span) { + text = text.substring(span.start, TextRange.getEnd(span)); + } + + return /^\s*$/.test(text); +} diff --git a/packages/pyright-internal/src/common/debug.ts b/packages/pyright-internal/src/common/debug.ts index 3ecc8c03f..6f35dc337 100644 --- a/packages/pyright-internal/src/common/debug.ts +++ b/packages/pyright-internal/src/common/debug.ts @@ -55,7 +55,14 @@ export function assertEachDefined( } export function assertNever(member: never, message = 'Illegal value:', stackCrawlMark?: AnyFunction): never { - const detail = JSON.stringify(member); + let detail = ''; + + try { + detail = JSON.stringify(member); + } catch { + // Do nothing. + } + fail(`${message} ${detail}`, stackCrawlMark || assertNever); } diff --git a/packages/pyright-internal/src/common/diagnostic.ts b/packages/pyright-internal/src/common/diagnostic.ts index 2c8d2c66e..80401a763 100644 --- a/packages/pyright-internal/src/common/diagnostic.ts +++ b/packages/pyright-internal/src/common/diagnostic.ts @@ -10,12 +10,28 @@ import { Commands } from '../commands/commands'; import { appendArray } from './collectionUtils'; import { DiagnosticLevel } from './configOptions'; -import { Range } from './textRange'; +import { Range, TextRange } from './textRange'; const defaultMaxDepth = 5; const defaultMaxLineCount = 8; const maxRecursionCount = 64; +// Corresponds to the CommentTaskPriority enum at https://devdiv.visualstudio.com/DefaultCollection/DevDiv/_git/VS?path=src/env/shell/PackageFramework/Framework/CommentTaskPriority.cs +export enum TaskListPriority { + High = 'High', + Normal = 'Normal', + Low = 'Low', +} + +export interface TaskListToken { + text: string; + priority: TaskListPriority; +} + +export const enum ActionKind { + RenameShadowedFileAction = 'renameShadowedFile', +} + export const enum DiagnosticCategory { Error, Warning, @@ -23,6 +39,7 @@ export const enum DiagnosticCategory { UnusedCode, UnreachableCode, Deprecated, + TaskItem, } export function convertLevelToCategory(level: DiagnosticLevel) { @@ -60,10 +77,17 @@ export interface AddMissingOptionalToParamAction extends DiagnosticAction { offsetOfTypeNode: number; } +export interface RenameShadowedFileAction extends DiagnosticAction { + action: ActionKind.RenameShadowedFileAction; + oldFile: string; + newFile: string; +} + export interface DiagnosticRelatedInfo { message: string; filePath: string; range: Range; + priority: TaskListPriority; } // Represents a single error or warning. @@ -72,7 +96,12 @@ export class Diagnostic { private _rule: string | undefined; private _relatedInfo: DiagnosticRelatedInfo[] = []; - constructor(readonly category: DiagnosticCategory, readonly message: string, readonly range: Range) {} + constructor( + readonly category: DiagnosticCategory, + readonly message: string, + readonly range: Range, + readonly priority: TaskListPriority = TaskListPriority.Normal + ) {} addAction(action: DiagnosticAction) { if (this._actions === undefined) { @@ -94,8 +123,13 @@ export class Diagnostic { return this._rule; } - addRelatedInfo(message: string, filePath: string, range: Range) { - this._relatedInfo.push({ filePath, message, range }); + addRelatedInfo( + message: string, + filePath: string, + range: Range, + priority: TaskListPriority = TaskListPriority.Normal + ) { + this._relatedInfo.push({ filePath, message, range, priority }); } getRelatedInfo() { @@ -109,10 +143,19 @@ export class DiagnosticAddendum { private _messages: string[] = []; private _childAddenda: DiagnosticAddendum[] = []; + // Addenda normally don't have their own ranges, but there are cases + // where we want to track ranges that can influence the range of the + // diagnostic. + private _range: TextRange | undefined; + addMessage(message: string) { this._messages.push(message); } + addTextRange(range: TextRange) { + this._range = range; + } + // Create a new (nested) addendum to which messages can be added. createAddendum() { const newAddendum = new DiagnosticAddendum(); @@ -152,6 +195,46 @@ export class DiagnosticAddendum { return this._messages; } + // Returns undefined if no range is associated with this addendum + // or its children. Returns a non-empty range if there is a single range + // associated. + getEffectiveTextRange(): TextRange | undefined { + const range = this._getTextRangeRecursive(); + + // If we received an empty range, it means that there were multiple + // non-overlapping ranges associated with this addendum. + if (range?.length === 0) { + return undefined; + } + + return range; + } + + private _getTextRangeRecursive(recursionCount = 0): TextRange | undefined { + if (recursionCount > maxRecursionCount) { + return undefined; + } + recursionCount++; + + const childRanges = this._childAddenda + .map((child) => child._getTextRangeRecursive(recursionCount)) + .filter((r) => !!r); + + if (childRanges.length > 1) { + return { start: 0, length: 0 }; + } + + if (childRanges.length === 1) { + return childRanges[0]; + } + + if (this._range) { + return this._range; + } + + return undefined; + } + private _getMessageCount(recursionCount = 0) { if (recursionCount > maxRecursionCount) { return 0; diff --git a/packages/pyright-internal/src/common/diagnosticRules.ts b/packages/pyright-internal/src/common/diagnosticRules.ts index e6f19676f..0da7d6926 100644 --- a/packages/pyright-internal/src/common/diagnosticRules.ts +++ b/packages/pyright-internal/src/common/diagnosticRules.ts @@ -14,6 +14,7 @@ export enum DiagnosticRule { strictListInference = 'strictListInference', strictSetInference = 'strictSetInference', strictDictionaryInference = 'strictDictionaryInference', + analyzeUnannotatedFunctions = 'analyzeUnannotatedFunctions', strictParameterNoneValue = 'strictParameterNoneValue', enableTypeIgnoreComments = 'enableTypeIgnoreComments', @@ -45,6 +46,7 @@ export enum DiagnosticRule { reportTypeCommentUsage = 'reportTypeCommentUsage', reportPrivateImportUsage = 'reportPrivateImportUsage', reportConstantRedefinition = 'reportConstantRedefinition', + reportDeprecated = 'reportDeprecated', reportIncompatibleMethodOverride = 'reportIncompatibleMethodOverride', reportIncompatibleVariableOverride = 'reportIncompatibleVariableOverride', reportInconsistentConstructor = 'reportInconsistentConstructor', @@ -78,4 +80,6 @@ export enum DiagnosticRule { reportUnusedExpression = 'reportUnusedExpression', reportUnnecessaryTypeIgnoreComment = 'reportUnnecessaryTypeIgnoreComment', reportMatchNotExhaustive = 'reportMatchNotExhaustive', + reportShadowedImports = 'reportShadowedImports', + reportImplicitOverride = 'reportImplicitOverride', } diff --git a/packages/pyright-internal/src/common/diagnosticSink.ts b/packages/pyright-internal/src/common/diagnosticSink.ts index 43f3d110d..b1949371f 100644 --- a/packages/pyright-internal/src/common/diagnosticSink.ts +++ b/packages/pyright-internal/src/common/diagnosticSink.ts @@ -4,7 +4,7 @@ * Licensed under the MIT license. * Author: Eric Traut * - * Class that represents errors and warnings. + * Class that collects and deduplicates diagnostics. */ import { appendArray } from './collectionUtils'; diff --git a/packages/pyright-internal/src/common/editAction.ts b/packages/pyright-internal/src/common/editAction.ts index b47c84280..c496941da 100644 --- a/packages/pyright-internal/src/common/editAction.ts +++ b/packages/pyright-internal/src/common/editAction.ts @@ -7,7 +7,7 @@ * Represents a single edit within a file. */ -import { Range } from './textRange'; +import { Range, rangesAreEqual } from './textRange'; export interface TextEditAction { range: Range; @@ -55,4 +55,13 @@ export namespace FileEditAction { export function is(value: any): value is FileEditAction { return value.filePath !== undefined && TextEditAction.is(value); } + + export function areEqual(e1: FileEditAction, e2: FileEditAction) { + return ( + e1 === e2 || + (e1.filePath === e2.filePath && + rangesAreEqual(e1.range, e2.range) && + e1.replacementText === e2.replacementText) + ); + } } diff --git a/packages/pyright-internal/src/common/envVarUtils.ts b/packages/pyright-internal/src/common/envVarUtils.ts new file mode 100644 index 000000000..3d9e50417 --- /dev/null +++ b/packages/pyright-internal/src/common/envVarUtils.ts @@ -0,0 +1,50 @@ +/* + * envVarUtils.ts + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT license. + * + * Utils functions that handles environment variables. + */ + +import * as os from 'os'; + +import { + combinePaths, + ensureTrailingDirectorySeparator, + getPathComponents, + hasTrailingDirectorySeparator, +} from './pathUtils'; + +// Expands certain predefined variables supported within VS Code settings. +// Ideally, VS Code would provide an API for doing this expansion, but +// it doesn't. We'll handle the most common variables here as a convenience. +export function expandPathVariables(rootPath: string, path: string): string { + const pathParts = getPathComponents(path); + + const expandedParts: string[] = []; + for (const part of pathParts) { + const trimmedPart = part.trim(); + + if (trimmedPart === '${workspaceFolder}') { + expandedParts.push(rootPath); + } else if (trimmedPart === '${env:HOME}' && process.env.HOME !== undefined) { + expandedParts.push(process.env.HOME); + } else if (trimmedPart === '${env:USERNAME}' && process.env.USERNAME !== undefined) { + expandedParts.push(process.env.USERNAME); + } else if (trimmedPart === '${env:VIRTUAL_ENV}' && process.env.VIRTUAL_ENV !== undefined) { + expandedParts.push(process.env.VIRTUAL_ENV); + } else if (trimmedPart === '~' && os.homedir) { + expandedParts.push(os.homedir() || process.env.HOME || process.env.USERPROFILE || '~'); + } else { + expandedParts.push(part); + } + } + + if (expandedParts.length === 0) { + return path; + } + + const root = expandedParts.shift()!; + const expandedPath = combinePaths(root, ...expandedParts); + return hasTrailingDirectorySeparator(path) ? ensureTrailingDirectorySeparator(expandedPath) : expandedPath; +} diff --git a/packages/pyright-internal/src/common/extensibility.ts b/packages/pyright-internal/src/common/extensibility.ts index fa5abbeea..4b915bcf0 100644 --- a/packages/pyright-internal/src/common/extensibility.ts +++ b/packages/pyright-internal/src/common/extensibility.ts @@ -1,35 +1,215 @@ /* -* completions.ts +* extensibility.ts * Copyright (c) Microsoft Corporation. * Licensed under the MIT license. -* Language service completion list extensibility. +* Language service extensibility. */ -import { CancellationToken } from 'vscode-languageserver'; +import { CancellationToken, CodeAction, ExecuteCommandParams } from 'vscode-languageserver'; -import { CompletionResultsList } from '../languageService/completionProvider'; +import { getFileInfo } from '../analyzer/analyzerNodeInfo'; +import { Declaration } from '../analyzer/declaration'; +import { ImportResolver } from '../analyzer/importResolver'; +import { SourceFileInfo } from '../analyzer/program'; +import { SourceMapper } from '../analyzer/sourceMapper'; +import { TypeEvaluator } from '../analyzer/typeEvaluatorTypes'; +import { Type } from '../analyzer/types'; +import { LanguageServerBase } from '../languageServerBase'; +import { CompletionOptions, CompletionResultsList } from '../languageService/completionProvider'; +import { FunctionNode, ParameterNode, ParseNode } from '../parser/parseNodes'; import { ParseResults } from '../parser/parser'; +import { ConfigOptions, SignatureDisplayType } from './configOptions'; +import { ConsoleInterface } from './console'; +import { Range } from './textRange'; export interface LanguageServiceExtension { - readonly completionListExtension: CompletionListExtension; + readonly commandExtension?: CommandExtension; } +export interface ProgramExtension { + readonly completionListExtension?: CompletionListExtension; + readonly declarationProviderExtension?: DeclarationProviderExtension; + readonly typeProviderExtension?: TypeProviderExtension; + readonly codeActionExtension?: CodeActionExtension; + fileDirty?: (filePath: string) => void; + clearCache?: () => void; +} + +// Readonly wrapper around a Program. Makes sure it doesn't mutate the program. +export interface ProgramView { + readonly id: number; + rootPath: string; + getImportResolver(): ImportResolver; + console: ConsoleInterface; + getConfigOptions(): ConfigOptions; + owns(file: string): boolean; + getBoundSourceFileInfo(file: string, content?: string, force?: boolean): SourceFileInfo | undefined; +} + +// Mutable wrapper around a program. Allows the FG thread to forward this request to the BG thread +export interface ProgramMutator { + addInterimFile(file: string): void; +} + +export interface ExtensionFactory { + createProgramExtension: (view: ProgramView, mutator: ProgramMutator) => ProgramExtension; + createLanguageServiceExtension: (languageserver: LanguageServerBase) => LanguageServiceExtension; +} + +export interface CommandExtension { + // Prefix to tell extension commands from others. + // For example, 'myextension'. Command name then + // should be 'myextension.command'. + readonly commandPrefix: string; + + // Extension executes command + executeCommand(params: ExecuteCommandParams, token: CancellationToken): Promise; +} export interface CompletionListExtension { // Extension updates completion list provided by the application. updateCompletionResults( + evaluator: TypeEvaluator, + sourceMapper: SourceMapper, + options: CompletionOptions, completionResults: CompletionResultsList, parseResults: ParseResults, position: number, + functionSignatureDisplay: SignatureDisplayType, token: CancellationToken ): Promise; +} - // Prefix to tell extension commands from others. - // For example, 'myextension'. Command name then - // should be 'myextension.command'. - readonly commandPrefix: string; +export enum DeclarationUseCase { + Definition, + Rename, + References, +} + +export interface DeclarationProviderExtension { + tryGetDeclarations( + evaluator: TypeEvaluator, + node: ParseNode, + useCase: DeclarationUseCase, + token: CancellationToken + ): Declaration[]; +} + +export interface TypeProviderExtension { + tryGetParameterNodeType( + node: ParameterNode, + evaluator: TypeEvaluator, + token: CancellationToken, + context?: {} + ): Type | undefined; + tryGetFunctionNodeType(node: FunctionNode, evaluator: TypeEvaluator, token: CancellationToken): Type | undefined; +} + +export interface CodeActionExtension { + addCodeActions( + evaluator: TypeEvaluator, + filePath: string, + range: Range, + parseResults: ParseResults, + codeActions: CodeAction[], + token: CancellationToken + ): void; +} + +interface OwnedProgramExtension extends ProgramExtension { + readonly view: ProgramView; +} + +interface OwnedLanguageServiceExtension extends LanguageServiceExtension { + readonly owner: LanguageServerBase; +} + +export namespace Extensions { + const factories: ExtensionFactory[] = []; + let programExtensions: OwnedProgramExtension[] = []; + let languageServiceExtensions: OwnedLanguageServiceExtension[] = []; + + export function register(entries: ExtensionFactory[]) { + factories.push(...entries); + } + export function createProgramExtensions(view: ProgramView, mutator: ProgramMutator) { + programExtensions.push( + ...(factories + .map((s) => { + let result = s.createProgramExtension ? s.createProgramExtension(view, mutator) : undefined; + if (result) { + // Add the extra parameter that we use for finding later. + result = Object.defineProperty(result, 'view', { value: view }); + } + return result; + }) + .filter((s) => !!s) as OwnedProgramExtension[]) + ); + } + + export function destroyProgramExtensions(viewId: number) { + programExtensions = programExtensions.filter((s) => s.view.id !== viewId); + } + + export function createLanguageServiceExtensions(languageServer: LanguageServerBase) { + languageServiceExtensions.push( + ...(factories + .map((s) => { + let result = s.createLanguageServiceExtension + ? s.createLanguageServiceExtension(languageServer) + : undefined; + if (result) { + // Add the extra parameter that we use for finding later. + result = Object.defineProperty(result, 'owner', { value: languageServer }); + } + return result; + }) + .filter((s) => !!s) as OwnedLanguageServiceExtension[]) + ); + } + + export function destroyLanguageServiceExtensions(languageServer: LanguageServerBase) { + languageServiceExtensions = languageServiceExtensions.filter((s) => s.owner !== languageServer); + } + + function getBestProgram(filePath: string): ProgramView { + // Find the best program to use for this file. + const programs = [...new Set(programExtensions.map((s) => s.view))]; + let bestProgram: ProgramView | undefined; + programs.forEach((program) => { + // If the file is tracked by this program, use it. + if (program.owns(filePath)) { + if (!bestProgram || filePath.startsWith(program.rootPath)) { + bestProgram = program; + } + } + }); + + // If we didn't find a program that tracks the file, use the first one that claims ownership. + if (bestProgram === undefined) { + if (programs.length === 1) { + bestProgram = programs[0]; + } else { + bestProgram = programs.find((p) => p.getBoundSourceFileInfo(filePath)) || programs[0]; + } + } + return bestProgram; + } + + export function getProgramExtensions(nodeOrFilePath: ParseNode | string) { + const filePath = + typeof nodeOrFilePath === 'string' ? nodeOrFilePath.toString() : getFileInfo(nodeOrFilePath).filePath; + const bestProgram = getBestProgram(filePath); + return programExtensions.filter((s) => s.view === bestProgram) as ProgramExtension[]; + } + + export function getLanguageServiceExtensions() { + return languageServiceExtensions as LanguageServiceExtension[]; + } - // Extension executes command attached to committed - // completion list item, if any. - executeCommand(command: string, args: any[] | undefined, token: CancellationToken): Promise; + export function unregister() { + programExtensions.splice(0, programExtensions.length); + languageServiceExtensions.splice(0, languageServiceExtensions.length); + factories.splice(0, factories.length); + } } diff --git a/packages/pyright-internal/src/common/extensions.ts b/packages/pyright-internal/src/common/extensions.ts index 80d38c165..8be326fea 100644 --- a/packages/pyright-internal/src/common/extensions.ts +++ b/packages/pyright-internal/src/common/extensions.ts @@ -17,5 +17,7 @@ declare interface Promise { /* eslint-disable @typescript-eslint/no-empty-function */ // Explicitly tells that promise should be run asynchronously. Promise.prototype.ignoreErrors = function (this: Promise) { - this.catch(() => {}); + this.catch((e) => { + console.log(e); + }); }; diff --git a/packages/pyright-internal/src/common/fileBasedCancellationUtils.ts b/packages/pyright-internal/src/common/fileBasedCancellationUtils.ts index 246306946..7bd208f07 100644 --- a/packages/pyright-internal/src/common/fileBasedCancellationUtils.ts +++ b/packages/pyright-internal/src/common/fileBasedCancellationUtils.ts @@ -3,7 +3,7 @@ * Copyright (c) Microsoft Corporation. * Licensed under the MIT license. * - * Helper methods relating to file based cancellation. + * Helper methods relating to file-based cancellation. */ import * as fs from 'fs'; @@ -16,99 +16,20 @@ import { CancellationSenderStrategy, CancellationStrategy, CancellationToken, - Emitter, - Event, } from 'vscode-languageserver'; -import { CancellationProvider, getCancellationFolderName, setCancellationFolderName } from './cancellationUtils'; - -class CancellationThrottle { - private static _lastCheckTimestamp = 0; - - static shouldCheck() { - // Throttle cancellation checks to one every 5ms. This value - // was selected through empirical testing. If we call the - // file system more often than this, type analysis performance - // is affected. If we call it less often, performance doesn't - // improve much, but responsiveness suffers. - const minTimeBetweenChecksInMs = 5; - const curTimestamp = Date.now().valueOf(); - const timeSinceLastCheck = curTimestamp - this._lastCheckTimestamp; - - if (timeSinceLastCheck >= minTimeBetweenChecksInMs) { - this._lastCheckTimestamp = curTimestamp; - return true; - } - - return false; - } -} - -class FileBasedToken implements CancellationToken { - protected isCancelled = false; - private _emitter: Emitter | undefined; - - constructor(readonly cancellationFilePath: string) {} - - cancel() { - if (!this.isCancelled) { - this.isCancelled = true; - if (this._emitter) { - this._emitter.fire(undefined); - this._disposeEmitter(); - } - } - } - - get isCancellationRequested(): boolean { - if (this.isCancelled) { - return true; - } - - if (CancellationThrottle.shouldCheck() && this._pipeExists()) { - // The first time it encounters the cancellation file, it will - // cancel itself and raise a cancellation event. - // In this mode, cancel() might not be called explicitly by - // jsonrpc layer. - this.cancel(); - } - - return this.isCancelled; - } - - get onCancellationRequested(): Event { - if (!this._emitter) { - this._emitter = new Emitter(); - } - return this._emitter.event; - } - - dispose(): void { - this._disposeEmitter(); - } - - private _disposeEmitter() { - if (this._emitter) { - this._emitter.dispose(); - this._emitter = undefined; - } - } - - private _pipeExists(): boolean { - try { - fs.statSync(this.cancellationFilePath); - return true; - } catch (e: any) { - return false; - } - } -} +import { + CancellationProvider, + FileBasedToken, + getCancellationFolderName, + setCancellationFolderName, +} from './cancellationUtils'; class OwningFileToken extends FileBasedToken { private _disposed = false; constructor(cancellationFilePath: string) { - super(cancellationFilePath); + super(cancellationFilePath, fs); } override cancel() { @@ -157,7 +78,7 @@ class FileBasedCancellationTokenSource implements AbstractCancellationTokenSourc // Be lazy and create the token only when actually needed. this._token = this._ownFile ? new OwningFileToken(this._cancellationFilePath) - : new FileBasedToken(this._cancellationFilePath); + : new FileBasedToken(this._cancellationFilePath, fs); } return this._token; } @@ -168,6 +89,9 @@ class FileBasedCancellationTokenSource implements AbstractCancellationTokenSourc // cancelled token when cancellation happens // before someone asks for the token. this._token = CancellationToken.Cancelled; + } else if (this._token.isCancellationRequested) { + // Already cancelled. + return; } else { (this._token as FileBasedToken).cancel(); } @@ -245,11 +169,7 @@ export function getCancellationTokenFromId(cancellationId: string) { return CancellationToken.None; } - return new FileBasedToken(cancellationId); -} - -export function getCancellationTokenId(token: CancellationToken) { - return token instanceof FileBasedToken ? token.cancellationFilePath : undefined; + return new FileBasedToken(cancellationId, fs); } let cancellationSourceId = 0; diff --git a/packages/pyright-internal/src/common/fileSystem.ts b/packages/pyright-internal/src/common/fileSystem.ts index 14fdb52ae..07fe222f8 100644 --- a/packages/pyright-internal/src/common/fileSystem.ts +++ b/packages/pyright-internal/src/common/fileSystem.ts @@ -28,6 +28,7 @@ export interface FileWatcherProvider { export interface Stats { size: number; + mtimeMs: number; isFile(): boolean; isDirectory(): boolean; @@ -90,6 +91,8 @@ export interface FileSystem { getUri(path: string): string; isInZipOrEgg(path: string): boolean; + + dispose(): void; } // File watchers can give "changed" event even for a file open. but for those cases, diff --git a/packages/pyright-internal/src/common/fullAccessHost.ts b/packages/pyright-internal/src/common/fullAccessHost.ts index db82a48d6..bd4feee08 100644 --- a/packages/pyright-internal/src/common/fullAccessHost.ts +++ b/packages/pyright-internal/src/common/fullAccessHost.ts @@ -12,7 +12,7 @@ import { PythonPathResult } from '../analyzer/pythonPathUtils'; import { PythonPlatform } from './configOptions'; import { assertNever } from './debug'; import { FileSystem } from './fileSystem'; -import { HostKind, NoAccessHost } from './host'; +import { HostKind, NoAccessHost, ScriptOutput } from './host'; import { isDirectory, normalizePath } from './pathUtils'; import { PythonVersion, versionFromMajorMinor } from './pythonVersion'; @@ -125,6 +125,35 @@ export class FullAccessHost extends LimitedAccessHost { } } + override runScript( + pythonPath: string | undefined, + script: string, + args: string[], + cwd: string + ): Promise { + // What to do about conda here? + return new Promise<{ stdout: string; stderr: string }>((resolve, reject) => { + let stdout = ''; + let stderr = ''; + const commandLineArgs = [script, ...args]; + const child = this._executePythonInterpreter(pythonPath, (p) => + child_process.spawn(p, commandLineArgs, { cwd }) + ); + if (child) { + child.stdout.on('data', (d) => (stdout = stdout.concat(d))); + child.stderr.on('data', (d) => (stderr = stderr.concat(d))); + child.on('error', (e) => { + reject(e); + }); + child.on('exit', () => { + resolve({ stdout, stderr }); + }); + } else { + reject(new Error(`Cannot start python interpreter with script ${script}`)); + } + }); + } + private _executePythonInterpreter( pythonPath: string | undefined, execute: (path: string) => T | undefined diff --git a/packages/pyright-internal/src/common/host.ts b/packages/pyright-internal/src/common/host.ts index 4885da096..f8d887460 100644 --- a/packages/pyright-internal/src/common/host.ts +++ b/packages/pyright-internal/src/common/host.ts @@ -3,7 +3,7 @@ * Copyright (c) Microsoft Corporation. * Licensed under the MIT license. * - * Provides accesses to the host the language service runs on + * Provides access to the host environment the language service is running on. */ import { PythonPathResult } from '../analyzer/pythonPathUtils'; @@ -16,11 +16,17 @@ export const enum HostKind { NoAccess, } +export interface ScriptOutput { + stdout: string; + stderr: string; +} + export interface Host { readonly kind: HostKind; getPythonSearchPaths(pythonPath?: string, logInfo?: string[]): PythonPathResult; getPythonVersion(pythonPath?: string, logInfo?: string[]): PythonVersion | undefined; getPythonPlatform(logInfo?: string[]): PythonPlatform | undefined; + runScript(pythonPath: string | undefined, script: string, args: string[], cwd: string): Promise; } export class NoAccessHost implements Host { @@ -44,6 +50,15 @@ export class NoAccessHost implements Host { getPythonPlatform(logInfo?: string[]): PythonPlatform | undefined { return undefined; } + + async runScript( + pythonPath: string | undefined, + scriptPath: string, + args: string[], + cwd: string + ): Promise { + return { stdout: '', stderr: '' }; + } } export type HostFactory = () => Host; diff --git a/packages/pyright-internal/src/common/logTracker.ts b/packages/pyright-internal/src/common/logTracker.ts index ac74fdfb9..7eb8b1a4f 100644 --- a/packages/pyright-internal/src/common/logTracker.ts +++ b/packages/pyright-internal/src/common/logTracker.ts @@ -19,6 +19,11 @@ export class LogTracker { constructor(private _console: ConsoleInterface | undefined, private _prefix: string) {} + get logLevel() { + const level = (this._console as any).level; + return level ?? LogLevel.Error; + } + log(title: string, callback: (state: LogState) => T, minimalDuration = -1, logParsingPerf = false) { // If no console is given, don't do anything. if (this._console === undefined) { diff --git a/packages/pyright-internal/src/common/lspUtils.ts b/packages/pyright-internal/src/common/lspUtils.ts index 71489f4aa..fb0188f5d 100644 --- a/packages/pyright-internal/src/common/lspUtils.ts +++ b/packages/pyright-internal/src/common/lspUtils.ts @@ -2,7 +2,7 @@ * lspUtils.ts * Copyright (c) Microsoft Corporation. * - * Helper functions around Language Server Protocol (LSP). + * Helper functions related to the Language Server Protocol (LSP). */ import { LSPAny } from 'vscode-languageserver'; diff --git a/packages/pyright-internal/src/common/pathConsts.ts b/packages/pyright-internal/src/common/pathConsts.ts index 5ef81944f..8158145b4 100644 --- a/packages/pyright-internal/src/common/pathConsts.ts +++ b/packages/pyright-internal/src/common/pathConsts.ts @@ -14,3 +14,4 @@ export const sitePackages = 'site-packages'; export const distPackages = 'dist-packages'; export const src = 'src'; export const stubsSuffix = '-stubs'; +export const defaultStubsDirectory = 'typings'; diff --git a/packages/pyright-internal/src/common/pathUtils.ts b/packages/pyright-internal/src/common/pathUtils.ts index d34d85656..e5b16e56d 100644 --- a/packages/pyright-internal/src/common/pathUtils.ts +++ b/packages/pyright-internal/src/common/pathUtils.ts @@ -36,13 +36,37 @@ export interface FileSpec { // Regular expression that can be used to match against this // file spec. regExp: RegExp; + + // Indicates whether the file spec has a directory wildcard (**). + // When present, the search cannot terminate without exploring to + // an arbitrary depth. + hasDirectoryWildcard: boolean; } +const _includeFileRegex = /\.pyi?$/; + export namespace FileSpec { export function is(value: any): value is FileSpec { const candidate: FileSpec = value as FileSpec; return candidate && !!candidate.wildcardRoot && !!candidate.regExp; } + export function isInPath(path: string, paths: FileSpec[]) { + return !!paths.find((p) => p.regExp.test(path)); + } + + export function matchesIncludeFileRegex(filePath: string, isFile = true) { + return isFile ? _includeFileRegex.test(filePath) : true; + } + + export function matchIncludeFileSpec(includeRegExp: RegExp, exclude: FileSpec[], filePath: string, isFile = true) { + if (includeRegExp.test(filePath)) { + if (!FileSpec.isInPath(filePath, exclude) && FileSpec.matchesIncludeFileRegex(filePath, isFile)) { + return true; + } + } + + return false; + } } export interface FileSystemEntries { @@ -534,6 +558,15 @@ export function getFileName(pathString: string) { return path.basename(pathString); } +export function getShortenedFileName(pathString: string, maxDirLength = 15) { + const fileName = getFileName(pathString); + const dirName = getDirectoryPath(pathString); + if (dirName.length > maxDirLength) { + return `...${dirName.slice(dirName.length - maxDirLength)}${path.sep}${fileName}`; + } + return pathString; +} + export function stripFileExtension(fileName: string, multiDotExtension = false) { const ext = getFileExtension(fileName, multiDotExtension); return fileName.substr(0, fileName.length - ext.length); @@ -562,10 +595,13 @@ export function isFile(fs: FileSystem, path: string, treatZipDirectoryAsFile = f export function tryStat(fs: FileSystem, path: string): Stats | undefined { try { - return fs.statSync(path); + if (fs.existsSync(path)) { + return fs.statSync(path); + } } catch (e: any) { return undefined; } + return undefined; } export function tryRealpath(fs: FileSystem, path: string): string | undefined { @@ -637,7 +673,7 @@ export function getWildcardRegexPattern(rootPath: string, fileSpec: string): str const pathComponents = getPathComponents(absolutePath); const escapedSeparator = getRegexEscapedSeparator(); - const doubleAsteriskRegexFragment = `(${escapedSeparator}[^${escapedSeparator}.][^${escapedSeparator}]*)*?`; + const doubleAsteriskRegexFragment = `(${escapedSeparator}[^${escapedSeparator}][^${escapedSeparator}]*)*?`; const reservedCharacterPattern = new RegExp(`[^\\w\\s${escapedSeparator}]`, 'g'); // Strip the directory separator from the root component. @@ -674,6 +710,20 @@ export function getWildcardRegexPattern(rootPath: string, fileSpec: string): str return regExPattern; } +// Determines whether the file spec contains a directory wildcard pattern ("**"). +export function isDirectoryWildcardPatternPresent(fileSpec: string): boolean { + const path = normalizePath(fileSpec); + const pathComponents = getPathComponents(path); + + for (const component of pathComponents) { + if (component === '**') { + return true; + } + } + + return false; +} + // Returns the topmost path that contains no wildcard characters. export function getWildcardRoot(rootPath: string, fileSpec: string): string { let absolutePath = normalizePath(combinePaths(rootPath, fileSpec)); @@ -726,10 +776,12 @@ export function getFileSpec(fs: FileSystem, rootPath: string, fileSpec: string): const regExp = new RegExp(regExPattern, isFileSystemCaseSensitive(fs) ? undefined : 'i'); const wildcardRoot = getWildcardRoot(rootPath, fileSpec); + const hasDirectoryWildcard = isDirectoryWildcardPatternPresent(fileSpec); return { wildcardRoot, regExp, + hasDirectoryWildcard, }; } @@ -895,7 +947,9 @@ export function convertUriToPath(fs: FileSystem, uriString: string): string { export function extractPathFromUri(uriString: string) { const uri = URI.parse(uriString); - let convertedPath = normalizePath(uri.path); + + // When schema is "file", we use fsPath so that we can handle things like UNC paths. + let convertedPath = normalizePath(uri.scheme === 'file' ? uri.fsPath : uri.path); // If this is a DOS-style path with a drive letter, remove // the leading slash. diff --git a/packages/pyright-internal/src/common/positionUtils.ts b/packages/pyright-internal/src/common/positionUtils.ts index 60baa9676..a512a917a 100644 --- a/packages/pyright-internal/src/common/positionUtils.ts +++ b/packages/pyright-internal/src/common/positionUtils.ts @@ -8,6 +8,7 @@ * line/column positions. */ +import { TokenizerOutput } from '../parser/tokenizer'; import { assert } from './debug'; import { Position, Range, TextRange } from './textRange'; import { TextRangeCollection } from './textRangeCollection'; @@ -22,20 +23,13 @@ export function convertOffsetToPosition(offset: number, lines: TextRangeCollecti }; } - // Handle the case where we're pointing to the last line of the file. - let offsetAdjustment = 0; - if (offset >= lines.end) { - offset = lines.end - 1; - offsetAdjustment = 1; - } - - const itemIndex = lines.getItemContaining(offset); - assert(itemIndex >= 0 && itemIndex <= lines.length); + const itemIndex = offset >= lines.end ? lines.count - 1 : lines.getItemContaining(offset); + assert(itemIndex >= 0 && itemIndex <= lines.count); const lineRange = lines.getItemAt(itemIndex); assert(lineRange !== undefined); return { line: itemIndex, - character: offset - lineRange.start + offsetAdjustment, + character: Math.max(0, Math.min(lineRange.length, offset - lineRange.start)), }; } @@ -76,3 +70,18 @@ export function convertRangeToTextRange(range: Range, lines: TextRangeCollection export function convertTextRangeToRange(range: TextRange, lines: TextRangeCollection): Range { return convertOffsetsToRange(range.start, TextRange.getEnd(range), lines); } + +// Returns the position of the last character in a line (before the newline). +export function getLineEndPosition(tokenizerOutput: TokenizerOutput, line: number): Position { + const lines = tokenizerOutput.lines; + const lineRange = lines.getItemAt(line); + // Character should be at the end of the line but before the newline. + const char = + line < lines.count - 1 + ? lineRange.length - tokenizerOutput.predominantEndOfLineSequence.length + : lineRange.length; + return { + line, + character: char, + }; +} diff --git a/packages/pyright-internal/src/common/progressReporter.ts b/packages/pyright-internal/src/common/progressReporter.ts index 3bccc3acb..fbb31a114 100644 --- a/packages/pyright-internal/src/common/progressReporter.ts +++ b/packages/pyright-internal/src/common/progressReporter.ts @@ -1,7 +1,10 @@ /* * progressReporter.ts + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT license. + * Author: Eric Traut * - * Implements progress reporter. + * Implements a mechanism for reporting progress in a language server client. */ export interface ProgressReporter { diff --git a/packages/pyright-internal/src/common/pythonVersion.ts b/packages/pyright-internal/src/common/pythonVersion.ts index 93336c51a..00e050689 100644 --- a/packages/pyright-internal/src/common/pythonVersion.ts +++ b/packages/pyright-internal/src/common/pythonVersion.ts @@ -4,8 +4,7 @@ * Licensed under the MIT license. * Author: Eric Traut * - * Types and functions that relate to the Python language version - * and features within them. + * Types and functions that relate to the Python language version. */ export enum PythonVersion { @@ -27,7 +26,7 @@ export enum PythonVersion { V3_12 = 0x030c, } -export const latestStablePythonVersion = PythonVersion.V3_10; +export const latestStablePythonVersion = PythonVersion.V3_11; export function versionToString(version: PythonVersion): string { const majorVersion = (version >> 8) & 0xff; diff --git a/packages/pyright-internal/src/common/realFileSystem.ts b/packages/pyright-internal/src/common/realFileSystem.ts index 06ffb716f..28d406461 100644 --- a/packages/pyright-internal/src/common/realFileSystem.ts +++ b/packages/pyright-internal/src/common/realFileSystem.ts @@ -1,7 +1,7 @@ /* * realFileSystem.ts * - * Collection of helper functions that require real fs access. + * Helper functions that require real filesystem access. */ import { FakeFS, NativePath, PortablePath, PosixFS, ppath, VirtualFS, ZipFS, ZipOpenFS } from '@yarnpkg/fslib'; @@ -205,7 +205,7 @@ class YarnFS extends PosixFS { const yarnFS = new YarnFS(); class RealFileSystem implements FileSystem { - private _tmpdir?: string; + private _tmpdir?: tmp.DirResult; constructor(private _fileWatcherProvider: FileWatcherProvider, private _console: ConsoleInterface) {} @@ -331,10 +331,10 @@ class RealFileSystem implements FileSystem { tmpdir() { if (!this._tmpdir) { - const dir = tmp.dirSync({ prefix: 'pyright' }); - this._tmpdir = dir.name; + this._tmpdir = tmp.dirSync({ prefix: 'pyright' }); } - return this._tmpdir; + + return this._tmpdir.name; } tmpfile(options?: TmpfileOptions): string { @@ -364,7 +364,7 @@ class RealFileSystem implements FileSystem { return realPath.substr(0, rootLength).toLowerCase() + realPath.substr(rootLength); } catch (e: any) { // Return as it is, if anything failed. - this._console.error(`Failed to get real file system casing for ${path}: ${e}`); + this._console.log(`Failed to get real file system casing for ${path}: ${e}`); return path; } @@ -389,6 +389,15 @@ class RealFileSystem implements FileSystem { isInZipOrEgg(path: string): boolean { return /[^\\/]\.(?:egg|zip)[\\/]/.test(path) && yarnFS.isZip(path); } + + dispose(): void { + try { + this._tmpdir?.removeCallback(); + this._tmpdir = undefined; + } catch { + // ignore + } + } } interface WorkspaceFileWatcher extends FileWatcher { diff --git a/packages/pyright-internal/src/common/textEditTracker.ts b/packages/pyright-internal/src/common/textEditTracker.ts new file mode 100644 index 000000000..5c4ea2792 --- /dev/null +++ b/packages/pyright-internal/src/common/textEditTracker.ts @@ -0,0 +1,436 @@ +/* + * textEditTracker.ts + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT license. + * + * Tracks text edits on a per-file basis. + */ + +import { CancellationToken } from 'vscode-languageserver'; + +import { getFileInfo } from '../analyzer/analyzerNodeInfo'; +import { + getAllImportNames, + getContainingImportStatement, + getTextEditsForAutoImportInsertion, + getTextEditsForAutoImportSymbolAddition, + getTextRangeForImportNameDeletion, + haveSameParentModule, + ImportGroup, + ImportNameInfo, + ImportStatements, + ModuleNameInfo, +} from '../analyzer/importStatementUtils'; +import * as ParseTreeUtils from '../analyzer/parseTreeUtils'; +import { + ImportAsNode, + ImportFromAsNode, + ImportFromNode, + ImportNode, + ParseNode, + ParseNodeType, +} from '../parser/parseNodes'; +import { ParseResults } from '../parser/parser'; +import { appendArray, getOrAdd, removeArrayElements } from './collectionUtils'; +import { isString } from './core'; +import * as debug from './debug'; +import { FileEditAction } from './editAction'; +import { convertOffsetToPosition, convertTextRangeToRange } from './positionUtils'; +import { doesRangeContain, doRangesIntersect, extendRange, Range, TextRange } from './textRange'; + +export class TextEditTracker { + private readonly _nodesRemoved: Map = new Map(); + private readonly _results = new Map(); + + private readonly _pendingNodeToRemove: NodeToRemove[] = []; + + constructor(private _mergeOnlyDuplications = true) { + // Empty + } + + addEdits(...edits: FileEditAction[]) { + edits.forEach((e) => this.addEdit(e.filePath, e.range, e.replacementText)); + } + + addEdit(filePath: string, range: Range, replacementText: string) { + const edits = getOrAdd(this._results, filePath, () => []); + + // If there is any overlapping edit, see whether we can merge edits. + // We can merge edits, if one of them is 'deletion' or 2 edits has the same + // replacement text with containing range. + const overlappingEdits = this._getEditsToMerge(edits, range, replacementText); + if (overlappingEdits.length > 0) { + // Merge the given edit with the existing edits by + // first deleting existing edits and expanding the current edit's range + // to cover all existing edits. + this._removeEdits(edits, overlappingEdits); + extendRange( + range, + overlappingEdits.map((d) => d.range) + ); + } + + edits.push({ filePath, range, replacementText }); + } + + addEditWithTextRange(parseResults: ParseResults, range: TextRange, replacementText: string) { + const filePath = getFileInfo(parseResults.parseTree).filePath; + + const existing = parseResults.text.substr(range.start, range.length); + if (existing === replacementText) { + // No change. Return as it is. + return; + } + + this.addEdit(filePath, convertTextRangeToRange(range, parseResults.tokenizerOutput.lines), replacementText); + } + + deleteImportName(parseResults: ParseResults, importToDelete: ImportFromAsNode | ImportAsNode) { + // TODO: remove all these manual text handling and merge it to _processNodeRemoved that is + // used by remove unused imports. + const imports: ImportFromAsNode[] | ImportAsNode[] = + importToDelete.nodeType === ParseNodeType.ImportAs + ? (importToDelete.parent as ImportNode).list + : (importToDelete.parent as ImportFromNode).imports; + + const filePath = getFileInfo(parseResults.parseTree).filePath; + const ranges = getTextRangeForImportNameDeletion( + imports, + imports.findIndex((v) => v === importToDelete) + ); + + ranges.forEach((r) => this.addEditWithTextRange(parseResults, r, '')); + + this._markNodeRemoved(importToDelete, parseResults); + + // Check whether we have deleted all trailing import names. + // If either no trailing import is deleted or handled properly + // then, there is nothing to do. otherwise, either delete the whole statement + // or remove trailing comma. + // ex) from x import [y], z or from x import y[, z] + let lastImportIndexNotDeleted = 0; + for ( + lastImportIndexNotDeleted = imports.length - 1; + lastImportIndexNotDeleted >= 0; + lastImportIndexNotDeleted-- + ) { + if (!this._nodesRemoved.has(imports[lastImportIndexNotDeleted])) { + break; + } + } + + if (lastImportIndexNotDeleted === -1) { + // Whole statement is deleted. Remove the statement itself. + // ex) [from x import a, b, c] or [import a] + const importStatement = importToDelete.parent; + if (importStatement) { + this.addEdit(filePath, ParseTreeUtils.getFullStatementRange(importStatement, parseResults), ''); + } + } else if (lastImportIndexNotDeleted >= 0 && lastImportIndexNotDeleted < imports.length - 2) { + // We need to delete trailing comma + // ex) from x import a, [b, c] + const start = TextRange.getEnd(imports[lastImportIndexNotDeleted]); + const length = TextRange.getEnd(imports[lastImportIndexNotDeleted + 1]) - start; + this.addEditWithTextRange(parseResults, { start, length }, ''); + } + } + + addOrUpdateImport( + parseResults: ParseResults, + importStatements: ImportStatements, + moduleNameInfo: ModuleNameInfo, + importGroup: ImportGroup, + importNameInfo?: ImportNameInfo[], + updateOptions?: { + currentFromImport: ImportFromNode; + originalModuleName: string; + } + ): void { + // TODO: remove all these manual text handling and merge it to _processNodeRemoved that is + // used by remove unused imports. + if ( + importNameInfo && + this._tryUpdateImport(parseResults, importStatements, moduleNameInfo, importNameInfo, updateOptions) + ) { + return; + } + + this._addImport(parseResults, importStatements, moduleNameInfo, importGroup, importNameInfo); + } + + removeNodes(...nodes: { node: ParseNode; parseResults: ParseResults }[]) { + this._pendingNodeToRemove.push(...nodes); + } + + isNodeRemoved(node: ParseNode) { + return this._nodesRemoved.has(node); + } + + getEdits(token: CancellationToken) { + this._processNodeRemoved(token); + + const edits: FileEditAction[] = []; + this._results.forEach((v) => appendArray(edits, v)); + + return edits; + } + + private _addImport( + parseResults: ParseResults, + importStatements: ImportStatements, + moduleNameInfo: ModuleNameInfo, + importGroup: ImportGroup, + importNameInfo?: ImportNameInfo[] + ) { + const filePath = getFileInfo(parseResults.parseTree).filePath; + + this.addEdits( + ...getTextEditsForAutoImportInsertion( + importNameInfo ?? [], + moduleNameInfo, + importStatements, + importGroup, + parseResults, + convertOffsetToPosition(parseResults.parseTree.length, parseResults.tokenizerOutput.lines) + ).map((e) => ({ filePath, range: e.range, replacementText: e.replacementText })) + ); + } + + private _tryUpdateImport( + parseResults: ParseResults, + importStatements: ImportStatements, + moduleNameInfo: ModuleNameInfo, + importNameInfo: ImportNameInfo[], + updateOptions?: UpdateOption + ): boolean { + if (!updateOptions) { + return false; + } + + // See whether we have existing from import statement for the same module + // ex) from [|moduleName|] import subModule + const imported = importStatements.orderedImports.find( + (i) => + i.node.nodeType === ParseNodeType.ImportFrom && + (i.moduleName === moduleNameInfo.nameForImportFrom || i.moduleName === moduleNameInfo.name) + ); + + if (!imported || imported.node.nodeType !== ParseNodeType.ImportFrom || imported.node.isWildcardImport) { + return false; + } + + const filePath = getFileInfo(parseResults.parseTree).filePath; + + const edits = getTextEditsForAutoImportSymbolAddition(importNameInfo, imported, parseResults); + if (imported.node !== updateOptions.currentFromImport) { + // Add what we want to the existing "import from" statement as long as it is not the same import + // node we are working on. + // ex) from xxx import yyy <= we are working on here. + // from xxx import zzz <= but we found this. + this.addEdits(...edits.map((e) => ({ filePath, range: e.range, replacementText: e.replacementText }))); + return true; + } + + const moduleNames = updateOptions.originalModuleName.split('.'); + const newModuleNames = moduleNameInfo.name.split('.'); + + if (!haveSameParentModule(moduleNames, newModuleNames)) { + // Module has moved. + return false; + } + + // Check whether we can avoid creating a new statement. We can't just merge with existing one since + // we could create invalid text edits (2 edits that change the same span, or invalid replacement text since + // texts on the node has changed) + if (importNameInfo.length !== 1 || edits.length !== 1) { + return false; + } + + const deletions = this._getDeletionsForSpan(filePath, edits[0].range); + if (deletions.length === 0) { + this.addEdit(filePath, edits[0].range, edits[0].replacementText); + return true; + } + + const lastModuleName = moduleNames[moduleNames.length - 1]; + const newLastModuleName = newModuleNames[newModuleNames.length - 1]; + + const alias = importNameInfo[0].alias === newLastModuleName ? lastModuleName : importNameInfo[0].alias; + const importName = updateOptions.currentFromImport.imports.find( + (i) => i.name.value === lastModuleName && i.alias?.value === alias + ); + + if (!importName) { + return false; + } + + this._removeEdits(filePath, deletions); + if (importName.alias) { + this._nodesRemoved.delete(importName.alias); + } + + this.addEdit( + filePath, + convertTextRangeToRange(importName.name, parseResults.tokenizerOutput.lines), + newLastModuleName + ); + + return true; + } + + private _getDeletionsForSpan(filePathOrEdit: string | FileEditAction[], range: Range) { + const edits = this._getOverlappingForSpan(filePathOrEdit, range); + return edits.filter((e) => e.replacementText === ''); + } + + private _removeEdits(filePathOrEdit: string | FileEditAction[], edits: FileEditAction[]) { + if (isString(filePathOrEdit)) { + filePathOrEdit = this._results.get(filePathOrEdit) ?? []; + } + + removeArrayElements(filePathOrEdit, (f) => edits.some((e) => FileEditAction.areEqual(f, e))); + } + + private _getEditsToMerge(edits: FileEditAction[], range: Range, replacementText: string) { + const overlappingEdits = this._getOverlappingForSpan(edits, range); + if (this._mergeOnlyDuplications && overlappingEdits.length > 0) { + // Merge duplicated deletion. For deletion, we can even merge edits + // intersecting each other. + if (replacementText === '') { + return overlappingEdits.filter((e) => e.replacementText === ''); + } + + // Merge duplicated edits as long as one of them contains the other. + return overlappingEdits.filter( + (e) => + e.replacementText === replacementText && + (doesRangeContain(range, e.range) || doesRangeContain(e.range, range)) + ); + } + + // We are allowed to merge more than exact duplication. If the existing edit + // is deletion or duplicated text with containing ranges, merge them to 1. + return overlappingEdits.filter( + (e) => + e.replacementText === '' || + (e.replacementText === replacementText && + (doesRangeContain(range, e.range) || doesRangeContain(e.range, range))) + ); + } + + private _getOverlappingForSpan(filePathOrEdit: string | FileEditAction[], range: Range) { + if (isString(filePathOrEdit)) { + filePathOrEdit = this._results.get(filePathOrEdit) ?? []; + } + + return filePathOrEdit.filter((e) => doRangesIntersect(e.range, range)); + } + + private _processNodeRemoved(token: CancellationToken) { + while (this._pendingNodeToRemove.length > 0) { + const numberOfNodesBeforeProcessing = this._pendingNodeToRemove.length; + + const peekNodeToRemove = this._pendingNodeToRemove[this._pendingNodeToRemove.length - 1]; + this._handleImportNameNode(peekNodeToRemove, token); + + if (this._pendingNodeToRemove.length === numberOfNodesBeforeProcessing) { + // It looks like we don't know how to handle the node, + // Please add code to handle the case. + debug.assert(`please add handler for ${peekNodeToRemove.node.nodeType}`); + + // As a default behavior, we will just remove the node + this._pendingNodeToRemove.pop(); + + const info = getFileInfo(peekNodeToRemove.parseResults.parseTree); + this.addEdit(info.filePath, convertTextRangeToRange(peekNodeToRemove.node, info.lines), ''); + } + } + } + + private _handleImportNameNode(nodeToRemove: NodeToRemove, token: CancellationToken) { + const node = nodeToRemove.node; + if (node.nodeType !== ParseNodeType.Name) { + return false; + } + + const module = nodeToRemove.parseResults.parseTree; + const info = getFileInfo(module); + const importNode = getContainingImportStatement(ParseTreeUtils.findNodeByOffset(module, node.start), token); + if (!importNode) { + return false; + } + + const nameNodes = getAllImportNames(importNode); + + // check various different cases + // 1. check whether all imported names in the import statement is not used. + const nodesRemoved = this._pendingNodeToRemove.filter((nodeToRemove) => + nameNodes.some((n) => TextRange.overlapsRange(nodeToRemove.node, n)) + ); + + if (nameNodes.length === nodesRemoved.length) { + this.addEdit( + info.filePath, + ParseTreeUtils.getFullStatementRange(importNode, nodeToRemove.parseResults), + '' + ); + + // Remove nodes that are handled from queue. + this._removeNodesHandled(nodesRemoved); + return true; + } + + // 2. some of modules in the import statement is used. + const indices: number[] = []; + for (let i = 0; i < nameNodes.length; i++) { + const nameNode = nameNodes[i]; + + if (nodesRemoved.some((r) => TextRange.overlapsRange(r.node, nameNode))) { + indices.push(i); + } + } + + if (indices.length === 0) { + // can't find module user wants to remove + return false; + } + + const editSpans = getTextRangeForImportNameDeletion(nameNodes, ...indices); + editSpans.forEach((e) => this.addEdit(info.filePath, convertTextRangeToRange(e, info.lines), '')); + + this._removeNodesHandled(nodesRemoved); + return true; + } + + private _removeNodesHandled(nodesRemoved: NodeToRemove[]) { + nodesRemoved.forEach((n) => this._markNodeRemoved(n.node, n.parseResults)); + removeArrayElements(this._pendingNodeToRemove, (n) => this._nodesRemoved.has(n.node)); + } + + private _markNodeRemoved(nodeToDelete: ParseNode, parseResults: ParseResults) { + // Mark that we don't need to process these node again later. + this._nodesRemoved.set(nodeToDelete, parseResults); + if (nodeToDelete.nodeType === ParseNodeType.ImportAs) { + this._nodesRemoved.set(nodeToDelete.module, parseResults); + nodeToDelete.module.nameParts.forEach((n) => this._nodesRemoved.set(n, parseResults)); + if (nodeToDelete.alias) { + this._nodesRemoved.set(nodeToDelete.alias, parseResults); + } + } else if (nodeToDelete.nodeType === ParseNodeType.ImportFromAs) { + this._nodesRemoved.set(nodeToDelete.name, parseResults); + if (nodeToDelete.alias) { + this._nodesRemoved.set(nodeToDelete.alias, parseResults); + } + } + } +} + +interface UpdateOption { + currentFromImport: ImportFromNode; + originalModuleName: string; +} + +interface NodeToRemove { + node: ParseNode; + parseResults: ParseResults; +} diff --git a/packages/pyright-internal/src/common/textEditUtils.ts b/packages/pyright-internal/src/common/textEditUtils.ts deleted file mode 100644 index a398d9cac..000000000 --- a/packages/pyright-internal/src/common/textEditUtils.ts +++ /dev/null @@ -1,195 +0,0 @@ -/* - * textEditUtils.ts - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT license. - * - * Language server command execution functionality. - */ - -import { CancellationToken, TextEdit, WorkspaceEdit } from 'vscode-languageserver'; - -import { getFileInfo } from '../analyzer/analyzerNodeInfo'; -import { - getAllImportNames, - getContainingImportStatement, - getTextRangeForImportNameDeletion, -} from '../analyzer/importStatementUtils'; -import * as ParseTreeUtils from '../analyzer/parseTreeUtils'; -import * as debug from '../common/debug'; -import { FileEditAction, TextEditAction } from '../common/editAction'; -import { ParseNode, ParseNodeType } from '../parser/parseNodes'; -import { ParseResults } from '../parser/parser'; -import { appendArray, getOrAdd, removeArrayElements } from './collectionUtils'; -import { isString } from './core'; -import { convertTextRangeToRange } from './positionUtils'; -import { doRangesIntersect, extendRange, Range, rangesAreEqual, TextRange } from './textRange'; - -export function convertTextEdits(uri: string, editActions: TextEditAction[] | undefined): WorkspaceEdit { - if (!editActions) { - return {}; - } - - const edits: TextEdit[] = []; - editActions.forEach((editAction) => { - edits.push({ - range: editAction.range, - newText: editAction.replacementText, - }); - }); - - return { - changes: { - [uri]: edits, - }, - }; -} - -export interface NodeToRemove { - parseResults: ParseResults; - node: ParseNode; -} - -export class TextEditTracker { - private readonly _nodesRemoved: NodeToRemove[] = []; - private readonly _results = new Map(); - - addEdits(...edits: FileEditAction[]) { - edits.forEach((e) => this.addEdit(e.filePath, e.range, e.replacementText)); - } - - addEdit(filePath: string, range: Range, replacementText: string) { - const edits = getOrAdd(this._results, filePath, () => []); - if (replacementText === '') { - // If it is a deletion, merge with overlapping deletion edit if there is any. - const deletions = this.getDeletionsForSpan(edits, range); - if (deletions.length > 0) { - // Delete the existing ones. - this.removeEdits(edits, deletions); - - // Extend range with deleted ones. - extendRange( - range, - deletions.map((d) => d.range) - ); - } - } - - // Don't put duplicated edit. It can happen if code has duplicated module import. - // ex) from a import b, b, c - // If we need to introduce new "from import" statement for "b", we will add new statement twice. - if (edits.some((e) => rangesAreEqual(e.range, range) && e.replacementText === replacementText)) { - return; - } - - edits.push({ filePath, range, replacementText }); - } - - getDeletionsForSpan(filePathOrEdit: string | FileEditAction[], range: Range) { - if (isString(filePathOrEdit)) { - filePathOrEdit = this._results.get(filePathOrEdit) ?? []; - } - - return filePathOrEdit.filter((e) => e.replacementText === '' && doRangesIntersect(e.range, range)); - } - - removeEdits(filePathOrEdit: string | FileEditAction[], edits: FileEditAction[]) { - if (isString(filePathOrEdit)) { - filePathOrEdit = this._results.get(filePathOrEdit) ?? []; - } - - removeArrayElements(filePathOrEdit, (f) => edits.findIndex((e) => e === f) >= 0); - } - - removeNodes(...nodes: NodeToRemove[]) { - this._nodesRemoved.push(...nodes); - } - - getEdits(token: CancellationToken) { - this._processNodeRemoved(token); - - const edits: FileEditAction[] = []; - this._results.forEach((v) => appendArray(edits, v)); - - return edits; - } - - private _processNodeRemoved(token: CancellationToken) { - while (this._nodesRemoved.length > 0) { - const numberOfNodesBeforeProcessing = this._nodesRemoved.length; - - const peekNodeToRemove = this._nodesRemoved[this._nodesRemoved.length - 1]; - this._handleImportNameNode(peekNodeToRemove, token); - - if (this._nodesRemoved.length === numberOfNodesBeforeProcessing) { - // It looks like we don't know how to handle the node, - // Please add code to handle the case. - debug.assert(`please add handler for ${peekNodeToRemove.node.nodeType}`); - - // As a default behavior, we will just remove the node - this._nodesRemoved.pop(); - - const info = getFileInfo(peekNodeToRemove.parseResults.parseTree); - this.addEdit(info.filePath, convertTextRangeToRange(peekNodeToRemove.node, info.lines), ''); - } - } - } - - private _handleImportNameNode(peekNodeToRemove: NodeToRemove, token: CancellationToken) { - const peekNode = peekNodeToRemove.node; - if (peekNode.nodeType !== ParseNodeType.Name) { - return false; - } - - const module = peekNodeToRemove.parseResults.parseTree; - const info = getFileInfo(module); - const importNode = getContainingImportStatement(ParseTreeUtils.findNodeByOffset(module, peekNode.start), token); - if (!importNode) { - return false; - } - - const nameNodes = getAllImportNames(importNode); - - // check various different cases - // 1. check whether all imported names in the import statement is not used. - const nodesRemoved = this._nodesRemoved.filter((nodeToRemove) => - nameNodes.some((n) => TextRange.overlapsRange(nodeToRemove.node, n)) - ); - - if (nameNodes.length === nodesRemoved.length) { - this.addEdit( - info.filePath, - ParseTreeUtils.getFullStatementRange(importNode, peekNodeToRemove.parseResults.tokenizerOutput), - '' - ); - - // Remove nodes that are handled from queue. - this._removeNodesHandled(nodesRemoved); - return true; - } - - // 2. some of modules in the import statement is used. - const indices: number[] = []; - for (let i = 0; i < nameNodes.length; i++) { - const nameNode = nameNodes[i]; - - if (nodesRemoved.some((r) => TextRange.overlapsRange(r.node, nameNode))) { - indices.push(i); - } - } - - if (indices.length === 0) { - // can't find module user wants to remove - return false; - } - - const editSpans = getTextRangeForImportNameDeletion(nameNodes, ...indices); - editSpans.forEach((e) => this.addEdit(info.filePath, convertTextRangeToRange(e, info.lines), '')); - - this._removeNodesHandled(nodesRemoved); - return true; - } - - private _removeNodesHandled(nodesRemoved: NodeToRemove[]) { - removeArrayElements(this._nodesRemoved, (n) => nodesRemoved.some((r) => r === n)); - } -} diff --git a/packages/pyright-internal/src/common/textRangeCollection.ts b/packages/pyright-internal/src/common/textRangeCollection.ts index a493cdec7..5012f3726 100644 --- a/packages/pyright-internal/src/common/textRangeCollection.ts +++ b/packages/pyright-internal/src/common/textRangeCollection.ts @@ -96,27 +96,72 @@ export class TextRangeCollection { return -1; } - let min = 0; - let max = this.count - 1; + return getIndexContaining(this._items, position); + } +} - while (min <= max) { - const mid = Math.floor(min + (max - min) / 2); - const item = this._items[mid]; +export function getIndexContaining(arr: (T | undefined)[], position: number) { + if (arr.length === 0) { + return -1; + } - if (TextRange.contains(item, position)) { - return mid; - } + let min = 0; + let max = arr.length - 1; + while (min <= max) { + const mid = Math.floor(min + (max - min) / 2); + const item = findNonNullElement(arr, mid, min, max); + if (item === undefined) { + return -1; + } - if (mid < this.count - 1 && TextRange.getEnd(item) <= position && position < this._items[mid + 1].start) { - return -1; - } + if (TextRange.contains(item, position)) { + return mid; + } - if (position < item.start) { - max = mid - 1; - } else { - min = mid + 1; - } + const nextItem = findNonNullElement(arr, mid + 1, mid + 1, max); + if (nextItem === undefined) { + return -1; + } + + if (mid < arr.length - 1 && TextRange.getEnd(item) <= position && position < nextItem.start) { + return -1; + } + + if (position < item.start) { + max = mid - 1; + } else { + min = mid + 1; + } + } + + return -1; +} + +function findNonNullElement( + arr: (T | undefined)[], + position: number, + min: number, + max: number +): T | undefined { + const item = arr[position]; + if (item) { + return item; + } + + // Search forward and backward until it finds non-null value. + for (let i = position + 1; i <= max; i++) { + const item = arr[position]; + if (item) { + return item; } - return -1; } + + for (let i = position - 1; i >= min; i--) { + const item = arr[position]; + if (item) { + return item; + } + } + + return undefined; } diff --git a/packages/pyright-internal/src/common/timing.ts b/packages/pyright-internal/src/common/timing.ts index c69c402cc..29b41ad3f 100644 --- a/packages/pyright-internal/src/common/timing.ts +++ b/packages/pyright-internal/src/common/timing.ts @@ -32,16 +32,16 @@ export class TimingStat { callCount = 0; isTiming = false; - timeOperation(callback: () => T): T { + timeOperation any>(callback: T, ...args: any[]): ReturnType { this.callCount++; // Handle reentrancy. if (this.isTiming) { - return callback(); + return callback(...args); } else { this.isTiming = true; const duration = new Duration(); - const result = callback(); + const result = callback(...args); this.totalTime += duration.getDurationInMilliseconds(); this.isTiming = false; diff --git a/packages/pyright-internal/src/common/workspaceEditUtils.ts b/packages/pyright-internal/src/common/workspaceEditUtils.ts index da96cef19..fa3e0ac1a 100644 --- a/packages/pyright-internal/src/common/workspaceEditUtils.ts +++ b/packages/pyright-internal/src/common/workspaceEditUtils.ts @@ -3,7 +3,7 @@ * Copyright (c) Microsoft Corporation. * Licensed under the MIT license. * - * Convert Pyright's FileEditActions to LanguageServer's WorkspaceEdits. + * Convert pyright's FileEditActions to LanguageServer's WorkspaceEdits. */ import { @@ -12,26 +12,59 @@ import { DeleteFile, RenameFile, TextDocumentEdit, + TextEdit, WorkspaceEdit, } from 'vscode-languageserver'; -import { FileEditAction, FileEditActions } from '../common/editAction'; -import { convertPathToUri } from '../common/pathUtils'; +import { SourceFileInfo } from '../analyzer/program'; +import { AnalyzerService } from '../analyzer/service'; +import { FileEditAction, FileEditActions, TextEditAction } from '../common/editAction'; +import { convertPathToUri, convertUriToPath } from '../common/pathUtils'; import { createMapFromItems } from './collectionUtils'; +import { isArray } from './core'; import { assertNever } from './debug'; import { FileSystem } from './fileSystem'; +import { convertRangeToTextRange, convertTextRangeToRange } from './positionUtils'; +import { TextRange } from './textRange'; +import { TextRangeCollection } from './textRangeCollection'; -export function convertWorkspaceEdits(fs: FileSystem, edits: FileEditAction[]) { - const workspaceEdit: WorkspaceEdit = { - changes: {}, - }; +export function convertToTextEdits(editActions: TextEditAction[]): TextEdit[] { + return editActions.map((editAction) => ({ + range: editAction.range, + newText: editAction.replacementText, + })); +} - AddToWorkspaceEdit(fs, workspaceEdit, edits); +export function convertToFileTextEdits(filePath: string, editActions: TextEditAction[]): FileEditAction[] { + return editActions.map((a) => ({ filePath, ...a })); +} - return workspaceEdit; +export function convertToWorkspaceEdit(fs: FileSystem, edits: FileEditAction[]): WorkspaceEdit; +export function convertToWorkspaceEdit(fs: FileSystem, edits: FileEditActions): WorkspaceEdit; +export function convertToWorkspaceEdit( + fs: FileSystem, + edits: FileEditActions, + changeAnnotations: { + [id: string]: ChangeAnnotation; + }, + defaultAnnotationId: string +): WorkspaceEdit; +export function convertToWorkspaceEdit( + fs: FileSystem, + edits: FileEditActions | FileEditAction[], + changeAnnotations?: { + [id: string]: ChangeAnnotation; + }, + defaultAnnotationId = 'default' +): WorkspaceEdit { + if (isArray(edits)) { + return _convertToWorkspaceEditWithChanges(fs, edits); + } + + return _convertToWorkspaceEditWithDocumentChanges(fs, edits, changeAnnotations, defaultAnnotationId); } -export function AddToWorkspaceEdit(fs: FileSystem, workspaceEdit: WorkspaceEdit, edits: FileEditAction[]) { +export function appendToWorkspaceEdit(fs: FileSystem, edits: FileEditAction[], workspaceEdit: WorkspaceEdit) { edits.forEach((edit) => { const uri = convertPathToUri(fs, edit.filePath); workspaceEdit.changes![uri] = workspaceEdit.changes![uri] || []; @@ -39,7 +72,137 @@ export function AddToWorkspaceEdit(fs: FileSystem, workspaceEdit: WorkspaceEdit, }); } -export function convertWorkspaceDocumentEdits( +export function applyTextEditsToString( + edits: TextEditAction[], + lines: TextRangeCollection, + originalText: string +) { + const editsWithOffset = edits + .map((e) => ({ + range: convertRangeToTextRange(e.range, lines) ?? { start: originalText.length, length: 0 }, + text: e.replacementText, + })) + .sort((e1, e2) => { + const result = e2.range.start - e1.range.start; + if (result !== 0) { + return result; + } + + return TextRange.getEnd(e2.range) - TextRange.getEnd(e1.range); + }); + + // Apply change in reverse order. + let current = originalText; + for (const change of editsWithOffset) { + current = current.substr(0, change.range.start) + change.text + current.substr(TextRange.getEnd(change.range)); + } + + return current; +} + +export function applyWorkspaceEdit(clonedService: AnalyzerService, edits: WorkspaceEdit, filesChanged: Set) { + if (edits.changes) { + for (const kv of Object.entries(edits.changes)) { + const filePath = convertUriToPath(clonedService.fs, kv[0]); + const fileInfo = clonedService.backgroundAnalysisProgram.program.getSourceFileInfo(filePath); + if (!fileInfo || !fileInfo.isTracked) { + // We don't allow non user file being modified. + continue; + } + + applyDocumentChanges(clonedService, fileInfo, kv[1]); + filesChanged.add(filePath); + } + } + + // For now, we don't support annotations. + if (edits.documentChanges) { + for (const change of edits.documentChanges) { + if (TextDocumentEdit.is(change)) { + const filePath = convertUriToPath(clonedService.fs, change.textDocument.uri); + const fileInfo = clonedService.backgroundAnalysisProgram.program.getSourceFileInfo(filePath); + if (!fileInfo || !fileInfo.isTracked) { + // We don't allow non user file being modified. + continue; + } + + applyDocumentChanges(clonedService, fileInfo, change.edits); + filesChanged.add(filePath); + } + + // For now, we don't support other kinds of text changes. + // But if we want to add support for those in future, we should add them here. + } + } +} + +export function applyDocumentChanges(clonedService: AnalyzerService, fileInfo: SourceFileInfo, edits: TextEdit[]) { + if (!fileInfo.isOpenByClient) { + const fileContent = fileInfo.sourceFile.getFileContent(); + clonedService.setFileOpened( + fileInfo.sourceFile.getFilePath(), + 0, + fileContent ?? '', + fileInfo.sourceFile.getIPythonMode(), + fileInfo.sourceFile.getRealFilePath() + ); + } + + const version = (fileInfo.sourceFile.getClientVersion() ?? 0) + 1; + clonedService.updateOpenFileContents( + fileInfo.sourceFile.getFilePath(), + version, + edits.map((t) => ({ range: t.range, text: t.newText })), + fileInfo.sourceFile.getIPythonMode(), + fileInfo.sourceFile.getRealFilePath() + ); +} + +export function generateWorkspaceEdit( + originalService: AnalyzerService, + clonedService: AnalyzerService, + filesChanged: Set +) { + // For now, we won't do text diff to find out minimal text changes. instead, we will + // consider whole text of the files are changed. In future, we could consider + // doing minimal changes using vscode's differ (https://github.com/microsoft/vscode/blob/main/src/vs/base/common/diff/diff.ts) + // to support annotation. + const edits: WorkspaceEdit = { changes: {} }; + + for (const filePath of filesChanged) { + const original = originalService.backgroundAnalysisProgram.program.getBoundSourceFile(filePath); + const final = clonedService.backgroundAnalysisProgram.program.getBoundSourceFile(filePath); + if (!original || !final) { + // Both must exist. + continue; + } + + const parseResults = original.getParseResults(); + if (!parseResults) { + continue; + } + + edits.changes![convertPathToUri(originalService.fs, filePath)] = [ + { + range: convertTextRangeToRange(parseResults.parseTree, parseResults.tokenizerOutput.lines), + newText: final.getFileContent() ?? '', + }, + ]; + } + + return edits; +} + +function _convertToWorkspaceEditWithChanges(fs: FileSystem, edits: FileEditAction[]) { + const workspaceEdit: WorkspaceEdit = { + changes: {}, + }; + + appendToWorkspaceEdit(fs, edits, workspaceEdit); + return workspaceEdit; +} + +function _convertToWorkspaceEditWithDocumentChanges( fs: FileSystem, editActions: FileEditActions, changeAnnotations?: { @@ -52,6 +215,28 @@ export function convertWorkspaceDocumentEdits( changeAnnotations: changeAnnotations, }; + // Ordering of documentChanges are important. + // Make sure create operaiton happens before edits + for (const operation of editActions.fileOperations) { + switch (operation.kind) { + case 'create': + workspaceEdit.documentChanges!.push( + CreateFile.create( + convertPathToUri(fs, operation.filePath), + /* options */ undefined, + defaultAnnotationId + ) + ); + break; + case 'rename': + case 'delete': + break; + default: + assertNever(operation); + } + } + + // Text edit's file path must refer to original file paths unless it is a new file just created. const mapPerFile = createMapFromItems(editActions.edits, (e) => e.filePath); for (const [key, value] of mapPerFile) { workspaceEdit.documentChanges!.push( @@ -68,13 +253,6 @@ export function convertWorkspaceDocumentEdits( for (const operation of editActions.fileOperations) { switch (operation.kind) { case 'create': - workspaceEdit.documentChanges!.push( - CreateFile.create( - convertPathToUri(fs, operation.filePath), - /* options */ undefined, - defaultAnnotationId - ) - ); break; case 'rename': workspaceEdit.documentChanges!.push( diff --git a/packages/pyright-internal/src/languageServerBase.ts b/packages/pyright-internal/src/languageServerBase.ts index 5521dc00e..313767b89 100644 --- a/packages/pyright-internal/src/languageServerBase.ts +++ b/packages/pyright-internal/src/languageServerBase.ts @@ -12,13 +12,13 @@ import './common/extensions'; import { + AbstractCancellationTokenSource, CallHierarchyIncomingCallsParams, CallHierarchyItem, CallHierarchyOutgoingCall, CallHierarchyOutgoingCallsParams, CallHierarchyPrepareParams, CancellationToken, - CancellationTokenSource, CodeAction, CodeActionParams, Command, @@ -70,7 +70,6 @@ import { WatchKind, WorkDoneProgressReporter, WorkspaceEdit, - WorkspaceFolder, WorkspaceSymbol, WorkspaceSymbolParams, } from 'vscode-languageserver'; @@ -78,9 +77,10 @@ import { attachWorkDone, ResultProgressReporter } from 'vscode-languageserver/li import { AnalysisResults } from './analyzer/analysis'; import { BackgroundAnalysisProgram } from './analyzer/backgroundAnalysisProgram'; +import { CacheManager } from './analyzer/cacheManager'; import { ImportResolver } from './analyzer/importResolver'; import { MaxAnalysisTime } from './analyzer/program'; -import { AnalyzerService, configFileNames } from './analyzer/service'; +import { AnalyzerService, configFileNames, getNextServiceId } from './analyzer/service'; import { IPythonMode } from './analyzer/sourceFile'; import type { BackgroundAnalysisBase } from './backgroundAnalysisBase'; import { CommandResult } from './commands/commandResult'; @@ -91,21 +91,26 @@ import { DiagnosticSeverityOverridesMap, getDiagnosticSeverityOverrides, } from './common/commandLineOptions'; -import { ConfigOptions, getDiagLevelDiagnosticRules } from './common/configOptions'; +import { ConfigOptions, getDiagLevelDiagnosticRules, SignatureDisplayType } from './common/configOptions'; import { ConsoleInterface, ConsoleWithLogLevel, LogLevel } from './common/console'; -import { createDeferred, Deferred } from './common/deferred'; -import { Diagnostic as AnalyzerDiagnostic, DiagnosticCategory } from './common/diagnostic'; +import { + Diagnostic as AnalyzerDiagnostic, + DiagnosticCategory, + TaskListPriority, + TaskListToken, +} from './common/diagnostic'; import { DiagnosticRule } from './common/diagnosticRules'; import { FileDiagnostics } from './common/diagnosticSink'; -import { LanguageServiceExtension } from './common/extensibility'; +import { Extensions } from './common/extensibility'; import { FileSystem, FileWatcherEventType, FileWatcherHandler } from './common/fileSystem'; import { Host } from './common/host'; import { fromLSPAny } from './common/lspUtils'; import { convertPathToUri, deduplicateFolders, getDirectoryPath, getFileName, isFile } from './common/pathUtils'; import { ProgressReporter, ProgressReportTracker } from './common/progressReporter'; +import { hashString } from './common/stringUtils'; import { DocumentRange, Position, Range } from './common/textRange'; import { UriParser } from './common/uriParser'; -import { convertWorkspaceDocumentEdits } from './common/workspaceEditUtils'; +import { convertToWorkspaceEdit } from './common/workspaceEditUtils'; import { AnalyzerServiceExecutor } from './languageService/analyzerServiceExecutor'; import { ImportFormat } from './languageService/autoImporter'; import { CompletionItemData, CompletionOptions, CompletionResultsList } from './languageService/completionProvider'; @@ -115,7 +120,7 @@ import { convertHoverResults } from './languageService/hoverProvider'; import { ReferenceCallback } from './languageService/referencesProvider'; import { Localizer, setLocaleOverride } from './localization/localize'; import { PyrightFileSystem } from './pyrightFileSystem'; -import { WorkspaceMap } from './workspaceMap'; +import { InitStatus, WellKnownWorkspaceKinds, Workspace, WorkspaceFactory } from './workspaceFactory'; export interface ServerSettings { venvPath?: string | undefined; @@ -138,33 +143,11 @@ export interface ServerSettings { indexing?: boolean | undefined; logTypeEvaluationTime?: boolean | undefined; typeEvaluationTimeThreshold?: number | undefined; -} - -export enum WellKnownWorkspaceKinds { - Default = 'default', - Regular = 'regular', - Limited = 'limited', - Cloned = 'cloned', - Test = 'test', -} - -// path and uri will point to a workspace itself. It could be a folder -// if the workspace represents a folder. it could be '' if it is the default workspace. -// But it also could be a file if it is a virtual workspace. -// rootPath will always point to the folder that contains the workspace. -export interface WorkspaceServiceInstance { - workspaceName: string; - rootPath: string; - path: string; - uri: string; - kinds: string[]; - serviceInstance: AnalyzerService; - disableLanguageServices: boolean; - disableOrganizeImports: boolean; - disableWorkspaceSymbol: boolean; - isInitialized: Deferred; - searchPathsToWatch: string[]; - owns(filePath: string): boolean; + fileSpecs?: string[]; + excludeFileSpecs?: string[]; + ignoreFileSpecs?: string[]; + taskListTokens?: TaskListToken[]; + functionSignatureDisplay?: SignatureDisplayType | undefined; } export interface MessageAction { @@ -184,9 +167,9 @@ export interface WindowInterface { } export interface LanguageServerInterface { - getWorkspaceForFile(filePath: string): Promise; - getSettings(workspace: WorkspaceServiceInstance): Promise; - createBackgroundAnalysis(): BackgroundAnalysisBase | undefined; + getWorkspaceForFile(filePath: string): Promise; + getSettings(workspace: Workspace): Promise; + createBackgroundAnalysis(serviceId: string): BackgroundAnalysisBase | undefined; reanalyze(): void; restart(): void; decodeTextDocumentUri(uriString: string): string; @@ -201,15 +184,14 @@ export interface ServerOptions { productName: string; rootDirectory: string; version: string; - workspaceMap: WorkspaceMap; cancellationProvider: CancellationProvider; fileSystem: FileSystem; fileWatcherHandler: FileWatcherHandler; - extension?: LanguageServiceExtension; maxAnalysisTimeInForeground?: MaxAnalysisTime; disableChecker?: boolean; supportedCommands?: string[]; supportedCodeActions?: string[]; + supportsTelemetry?: boolean; } export interface WorkspaceServices { @@ -237,20 +219,88 @@ interface ClientCapabilities { signatureDocFormat: MarkupKind; supportsDeprecatedDiagnosticTag: boolean; supportsUnnecessaryDiagnosticTag: boolean; + supportsTaskItemDiagnosticTag: boolean; completionItemResolveSupportsAdditionalTextEdits: boolean; } const nullProgressReporter = attachWorkDone(undefined as any, /* params */ undefined); +/* + * Additional DiagnosticTag values that are specific to Visual Studio. + * These must match the values in https://dev.azure.com/devdiv/DevDiv/_git/vslanguageserverclient?path=%2Fsrc%2Fproduct%2FProtocol%2FLanguageServer.Protocol.Extensions%2FVSDiagnosticTags.cs&version=GBdevelop&_a=contents + */ +namespace VSDiagnosticTag { + /** + * A diagnostic entry generated by the build. + */ + export const BuildError = -1; + + /** + * A diagnostic entry generated by Intellisense. + */ + export const IntellisenseError = -2; + + /** + * A diagnostic entry that could be generated from both builds and Intellisense. + * + * Diagnostic entries tagged with PotentialDuplicate will be hidden + * in the error list if the error list is displaying build and intellisense errors. + */ + export const PotentialDuplicate = -3; + + /** + * A diagnostic entry that is never displayed in the error list. + */ + export const HiddenInErrorList = -4; + + /** + * A diagnostic entry that is always displayed in the error list. + */ + export const VisibleInErrorList = -5; + + /** + * A diagnostic entry that is never displayed in the editor. + */ + export const HiddenInEditor = -6; + + /** + * No tooltip is shown for the Diagnostic entry in the editor. + */ + export const SuppressEditorToolTip = -7; + + /** + * A diagnostic entry that is represented in the editor as an Edit and Continue error. + */ + export const EditAndContinueError = -8; + + /** + * A diagnostic entry that is represented in the editor as a Task List item (View -> Task List) + */ + export const TaskItem = -9; +} + +/* + * DiagnosticRank values that are specific to Visual Studio. + * These must match the values in https://dev.azure.com/devdiv/DevDiv/_git/vslanguageserverclient?path=/src/product/Protocol/LanguageServer.Protocol.Extensions/VSDiagnosticRank.cs&version=GBdevelop&_a=contents + */ +namespace VSDiagnosticRank { + export const Highest = 100; + export const High = 200; + export const Default = 300; + export const Low = 400; + export const Lowest = 500; +} + export abstract class LanguageServerBase implements LanguageServerInterface { protected _defaultClientConfig: any; - protected _workspaceMap: WorkspaceMap; + protected _workspaceFactory: WorkspaceFactory; + protected _cacheManager: CacheManager; // We support running only one "find all reference" at a time. - private _pendingFindAllRefsCancellationSource: CancellationTokenSource | undefined; + private _pendingFindAllRefsCancellationSource: AbstractCancellationTokenSource | undefined; // We support running only one command at a time. - private _pendingCommandCancellationSource: CancellationTokenSource | undefined; + private _pendingCommandCancellationSource: AbstractCancellationTokenSource | undefined; private _progressReporter: ProgressReporter; @@ -258,6 +308,8 @@ export abstract class LanguageServerBase implements LanguageServerInterface { private _lastFileWatcherRegistration: Disposable | undefined; + private _initialized = false; + // Global root path - the basis for all global settings. rootPath = ''; @@ -281,6 +333,7 @@ export abstract class LanguageServerBase implements LanguageServerInterface { signatureDocFormat: MarkupKind.PlainText, supportsDeprecatedDiagnosticTag: false, supportsUnnecessaryDiagnosticTag: false, + supportsTaskItemDiagnosticTag: false, completionItemResolveSupportsAdditionalTextEdits: false, }; @@ -307,11 +360,19 @@ export abstract class LanguageServerBase implements LanguageServerInterface { this.console.info(`Server root directory: ${_serverOptions.rootDirectory}`); - this._workspaceMap = this._serverOptions.workspaceMap; + this._cacheManager = new CacheManager(); this._serviceFS = new PyrightFileSystem(this._serverOptions.fileSystem); this._uriParser = uriParserFactory(this._serviceFS); + this._workspaceFactory = new WorkspaceFactory( + this.console, + this._uriParser, + this.createAnalyzerServiceForWorkspace.bind(this), + this.isPythonPathImmutable.bind(this), + this.onWorkspaceCreated.bind(this) + ); + // Set the working directory to a known location within // the extension directory. Otherwise the execution of // python can have unintended and surprising results. @@ -327,6 +388,9 @@ export abstract class LanguageServerBase implements LanguageServerInterface { // Listen on the connection. this._connection.listen(); + + // Setup extensions + Extensions.createLanguageServiceExtensions(this); } // Convert uri to path @@ -334,7 +398,7 @@ export abstract class LanguageServerBase implements LanguageServerInterface { return this._uriParser.decodeTextDocumentUri(uriString); } - abstract createBackgroundAnalysis(): BackgroundAnalysisBase | undefined; + abstract createBackgroundAnalysis(serviceId: string): BackgroundAnalysisBase | undefined; protected abstract executeCommand(params: ExecuteCommandParams, token: CancellationToken): Promise; @@ -345,7 +409,14 @@ export abstract class LanguageServerBase implements LanguageServerInterface { token: CancellationToken ): Promise<(Command | CodeAction)[] | undefined | null>; - abstract getSettings(workspace: WorkspaceServiceInstance): Promise; + abstract getSettings(workspace: Workspace): Promise; + + protected isPythonPathImmutable(filePath: string): boolean { + // This function is called to determine if the file is using + // a special pythonPath separate from a workspace or not. + // The default is no. + return false; + } protected async getConfiguration(scopeUri: string | undefined, section: string) { if (this.client.hasConfigurationCapability) { @@ -396,27 +467,25 @@ export abstract class LanguageServerBase implements LanguageServerInterface { protected abstract createImportResolver(fs: FileSystem, options: ConfigOptions, host: Host): ImportResolver; protected createBackgroundAnalysisProgram( + serviceId: string, console: ConsoleInterface, configOptions: ConfigOptions, importResolver: ImportResolver, - extension?: LanguageServiceExtension, backgroundAnalysis?: BackgroundAnalysisBase, - maxAnalysisTime?: MaxAnalysisTime + maxAnalysisTime?: MaxAnalysisTime, + cacheManager?: CacheManager ): BackgroundAnalysisProgram { return new BackgroundAnalysisProgram( console, configOptions, importResolver, - extension, backgroundAnalysis, - maxAnalysisTime + maxAnalysisTime, + /* disableChecker */ undefined, + cacheManager ); } - protected setExtension(extension: any): void { - this._serverOptions.extension = extension; - } - // Provides access to the client's window. get window(): RemoteWindow { return this._connection.window; @@ -435,37 +504,50 @@ export abstract class LanguageServerBase implements LanguageServerInterface { ): AnalyzerService { this.console.info(`Starting service instance "${name}"`); + const serviceId = getNextServiceId(name); const service = new AnalyzerService(name, services?.fs ?? this._serviceFS, { console: this.console, hostFactory: this.createHost.bind(this), importResolverFactory: this.createImportResolver.bind(this), - extension: this._serverOptions.extension, - backgroundAnalysis: services ? services.backgroundAnalysis : this.createBackgroundAnalysis(), + backgroundAnalysis: services ? services.backgroundAnalysis : this.createBackgroundAnalysis(serviceId), maxAnalysisTime: this._serverOptions.maxAnalysisTimeInForeground, backgroundAnalysisProgramFactory: this.createBackgroundAnalysisProgram.bind(this), cancellationProvider: this._serverOptions.cancellationProvider, libraryReanalysisTimeProvider, + cacheManager: this._cacheManager, + serviceId, }); service.setCompletionCallback((results) => this.onAnalysisCompletedHandler(service.fs, results)); return service; } - async getWorkspaceForFile(filePath: string): Promise { - const workspace = this._workspaceMap.getWorkspaceForFile(this, filePath); - await workspace.isInitialized.promise; - return workspace; + async test_getWorkspaces() { + const workspaces = [...this._workspaceFactory.items()]; + for (const workspace of workspaces) { + await workspace.isInitialized.promise; + } + + return workspaces; + } + + async getWorkspaceForFile(filePath: string, pythonPath?: string): Promise { + return this._workspaceFactory.getWorkspaceForFile(filePath, pythonPath); + } + + async getContainingWorkspacesForFile(filePath: string): Promise { + return this._workspaceFactory.getContainingWorkspacesForFile(filePath); } reanalyze() { - this._workspaceMap.forEach((workspace) => { - workspace.serviceInstance.invalidateAndForceReanalysis(); + this._workspaceFactory.items().forEach((workspace) => { + workspace.service.invalidateAndForceReanalysis(); }); } restart() { - this._workspaceMap.forEach((workspace) => { - workspace.serviceInstance.restart(); + this._workspaceFactory.items().forEach((workspace) => { + workspace.service.restart(); }); } @@ -519,6 +601,7 @@ export abstract class LanguageServerBase implements LanguageServerInterface { this._connection.onExecuteCommand(async (params, token, reporter) => this.onExecuteCommand(params, token, reporter) ); + this._connection.onShutdown(async (token) => this.onShutdown(token)); } protected initialize( @@ -538,7 +621,7 @@ export abstract class LanguageServerBase implements LanguageServerInterface { this.client.hasWatchFileRelativePathCapability = !!capabilities.workspace?.didChangeWatchedFiles?.relativePatternSupport; this.client.hasWorkspaceFoldersCapability = !!capabilities.workspace?.workspaceFolders; - this.client.hasVisualStudioExtensionsCapability = !!(capabilities as any).supportsVisualStudioExtensions; + this.client.hasVisualStudioExtensionsCapability = !!(capabilities as any)._vs_supportsVisualStudioExtensions; this.client.hasActiveParameterCapability = !!capabilities.textDocument?.signatureHelp?.signatureInformation?.activeParameterSupport; this.client.hasSignatureLabelOffsetCapability = @@ -568,6 +651,8 @@ export abstract class LanguageServerBase implements LanguageServerInterface { this.client.supportsDeprecatedDiagnosticTag = supportedDiagnosticTags.some( (tag) => tag === DiagnosticTag.Deprecated ); + // if the client is running in VS, it always supports task item diagnostics + this.client.supportsTaskItemDiagnosticTag = this.client.hasVisualStudioExtensionsCapability; this.client.hasWindowProgressCapability = !!capabilities.window?.workDoneProgress; this.client.hasGoToDeclarationCapability = !!capabilities.textDocument?.declaration; this.client.completionItemResolveSupportsAdditionalTextEdits = @@ -576,17 +661,7 @@ export abstract class LanguageServerBase implements LanguageServerInterface { ); // Create a service instance for each of the workspace folders. - if (params.workspaceFolders) { - params.workspaceFolders.forEach((folder) => { - const path = this._uriParser.decodeTextDocumentUri(folder.uri); - this._workspaceMap.set(path, this.createWorkspaceServiceInstance(folder, path, path)); - }); - } else if (params.rootPath) { - this._workspaceMap.set( - params.rootPath, - this.createWorkspaceServiceInstance(undefined, params.rootPath, params.rootPath) - ); - } + this._workspaceFactory.handleInitialize(params); const result: InitializeResult = { capabilities: { @@ -601,7 +676,9 @@ export abstract class LanguageServerBase implements LanguageServerInterface { documentHighlightProvider: { workDoneProgress: true }, renameProvider: { prepareProvider: true, workDoneProgress: true }, completionProvider: { - triggerCharacters: this.client.hasVisualStudioExtensionsCapability ? ['.', '[', '@'] : ['.', '['], + triggerCharacters: this.client.hasVisualStudioExtensionsCapability + ? ['.', '[', '@', '"', "'"] + : ['.', '[', '"', "'"], resolveProvider: true, workDoneProgress: true, completionItem: { @@ -621,6 +698,12 @@ export abstract class LanguageServerBase implements LanguageServerInterface { workDoneProgress: true, }, callHierarchyProvider: true, + workspace: { + workspaceFolders: { + supported: true, + changeNotifications: true, + }, + }, }, }; @@ -628,25 +711,22 @@ export abstract class LanguageServerBase implements LanguageServerInterface { } protected onInitialized() { - if (this.client.hasWorkspaceFoldersCapability) { - this._connection.workspace.onDidChangeWorkspaceFolders((event) => { - event.removed.forEach((workspace) => { - const rootPath = this._uriParser.decodeTextDocumentUri(workspace.uri); - this._workspaceMap.delete(rootPath); - }); - - event.added.forEach(async (workspace) => { - const rootPath = this._uriParser.decodeTextDocumentUri(workspace.uri); - const newWorkspace = this.createWorkspaceServiceInstance(workspace, rootPath, rootPath); - this._workspaceMap.set(rootPath, newWorkspace); - await this.updateSettingsForWorkspace(newWorkspace); - }); - - this._setupFileWatcher(); - }); + // Mark as initialized. We need this to make sure to + // not send config updates before this point. + this._initialized = true; - this._setupFileWatcher(); + if (!this.client.hasWorkspaceFoldersCapability) { + // If folder capability is not supported, initialize ones given by onInitialize. + this.updateSettingsForAllWorkspaces(); + return; } + + this._connection.workspace.onDidChangeWorkspaceFolders((event) => { + this._workspaceFactory.handleWorkspaceFoldersChanged(event); + this._setupFileWatcher(); + }); + + this._setupFileWatcher(); } private _setupFileWatcher() { @@ -668,7 +748,7 @@ export abstract class LanguageServerBase implements LanguageServerInterface { // Get rid of any search path under workspace root since it is already watched by // "**" above. const foldersToWatch = deduplicateFolders( - this._workspaceMap + this._workspaceFactory .getNonDefaultWorkspaces() .map((w) => w.searchPathsToWatch.filter((p) => !p.startsWith(w.rootPath))) ); @@ -709,7 +789,7 @@ export abstract class LanguageServerBase implements LanguageServerInterface { token, this.client.hasGoToDeclarationCapability ? DefinitionFilter.PreferSource : DefinitionFilter.All, (workspace, filePath, position, filter, token) => - workspace.serviceInstance.getDefinitionForPosition(filePath, position, filter, token) + workspace.service.getDefinitionForPosition(filePath, position, filter, token) ); } @@ -722,7 +802,7 @@ export abstract class LanguageServerBase implements LanguageServerInterface { token, this.client.hasGoToDeclarationCapability ? DefinitionFilter.PreferStubs : DefinitionFilter.All, (workspace, filePath, position, filter, token) => - workspace.serviceInstance.getDefinitionForPosition(filePath, position, filter, token) + workspace.service.getDefinitionForPosition(filePath, position, filter, token) ); } @@ -731,7 +811,7 @@ export abstract class LanguageServerBase implements LanguageServerInterface { token: CancellationToken ): Promise { return this.getDefinitions(params, token, DefinitionFilter.All, (workspace, filePath, position, _, token) => - workspace.serviceInstance.getTypeDefinitionForPosition(filePath, position, token) + workspace.service.getTypeDefinitionForPosition(filePath, position, token) ); } @@ -740,7 +820,7 @@ export abstract class LanguageServerBase implements LanguageServerInterface { token: CancellationToken, filter: DefinitionFilter, getDefinitionsFunc: ( - workspace: WorkspaceServiceInstance, + workspace: Workspace, filePath: string, position: Position, filter: DefinitionFilter, @@ -761,8 +841,8 @@ export abstract class LanguageServerBase implements LanguageServerInterface { return undefined; } return locations - .filter((loc) => !workspace.serviceInstance.fs.isInZipOrEgg(loc.path)) - .map((loc) => Location.create(convertPathToUri(workspace.serviceInstance.fs, loc.path), loc.range)); + .filter((loc) => this.canNavigateToFile(loc.path, workspace.service.fs)) + .map((loc) => Location.create(convertPathToUri(workspace.service.fs, loc.path), loc.range)); } protected async onReferences( @@ -801,8 +881,8 @@ export abstract class LanguageServerBase implements LanguageServerInterface { const convert = (locs: DocumentRange[]): Location[] => { return locs - .filter((loc) => !workspace.serviceInstance.fs.isInZipOrEgg(loc.path)) - .map((loc) => Location.create(convertPathToUri(workspace.serviceInstance.fs, loc.path), loc.range)); + .filter((loc) => this.canNavigateToFile(loc.path, workspace.service.fs)) + .map((loc) => Location.create(convertPathToUri(workspace.service.fs, loc.path), loc.range)); }; const locations: Location[] = []; @@ -810,7 +890,7 @@ export abstract class LanguageServerBase implements LanguageServerInterface { ? (locs) => resultReporter.report(convert(locs)) : (locs) => appendArray(locations, convert(locs)); - workspace.serviceInstance.reportReferencesForPosition( + workspace.service.reportReferencesForPosition( filePath, position, params.context.includeDeclaration, @@ -839,7 +919,7 @@ export abstract class LanguageServerBase implements LanguageServerInterface { } const symbolList: DocumentSymbol[] = []; - workspace.serviceInstance.addSymbolsForDocument(filePath, symbolList, token); + workspace.service.addSymbolsForDocument(filePath, symbolList, token); if (this.client.hasHierarchicalDocumentSymbolCapability) { return symbolList; } @@ -858,10 +938,10 @@ export abstract class LanguageServerBase implements LanguageServerInterface { ? (symbols) => resultReporter.report(symbols) : (symbols) => appendArray(symbolList, symbols); - for (const workspace of this._workspaceMap.values()) { + for (const workspace of this._workspaceFactory.items()) { await workspace.isInitialized.promise; if (!workspace.disableLanguageServices && !workspace.disableWorkspaceSymbol) { - workspace.serviceInstance.reportSymbolsForWorkspace(params.query, reporter, token); + workspace.service.reportSymbolsForWorkspace(params.query, reporter, token); } } @@ -872,13 +952,17 @@ export abstract class LanguageServerBase implements LanguageServerInterface { const { filePath, position } = this._uriParser.decodeTextDocumentPosition(params.textDocument, params.position); const workspace = await this.getWorkspaceForFile(filePath); - const hoverResults = workspace.serviceInstance.getHoverForPosition( + const hoverResults = workspace.service.getHoverForPosition( filePath, position, this.client.hoverContentFormat, token ); - return convertHoverResults(this.client.hoverContentFormat, hoverResults); + return convertHoverResults( + this.client.hoverContentFormat, + hoverResults, + !!this._serverOptions.supportsTelemetry + ); } protected async onDocumentHighlight( @@ -887,7 +971,7 @@ export abstract class LanguageServerBase implements LanguageServerInterface { ): Promise { const { filePath, position } = this._uriParser.decodeTextDocumentPosition(params.textDocument, params.position); const workspace = await this.getWorkspaceForFile(filePath); - return workspace.serviceInstance.getDocumentHighlight(filePath, position, token); + return workspace.service.getDocumentHighlight(filePath, position, token); } protected async onSignatureHelp( @@ -900,7 +984,7 @@ export abstract class LanguageServerBase implements LanguageServerInterface { if (workspace.disableLanguageServices) { return; } - const signatureHelpResults = workspace.serviceInstance.getSignatureHelpForPosition( + const signatureHelpResults = workspace.service.getSignatureHelpForPosition( filePath, position, this.client.signatureDocFormat, @@ -1030,6 +1114,22 @@ export abstract class LanguageServerBase implements LanguageServerInterface { completions.completionList.isIncomplete = completionIncomplete; } + // Add memberAccessInfo.lastKnownModule if we have it. The client side + // will use this to send extra telemetry + if ( + completions?.memberAccessInfo && + completions.completionList && + completions.completionList.items.length > 0 && + completions.memberAccessInfo.lastKnownModule && + this._serverOptions.supportsTelemetry + ) { + // Just stick it on the first item. It only checks the first one + completions.completionList.items[0].data = { + ...completions.completionList.items[0].data, + moduleHash: hashString(completions.memberAccessInfo.lastKnownModule), + }; + } + return completions?.completionList; } @@ -1059,20 +1159,14 @@ export abstract class LanguageServerBase implements LanguageServerInterface { return null; } - const result = workspace.serviceInstance.canRenameSymbolAtPosition( + const result = workspace.service.canRenameSymbolAtPosition( filePath, position, - workspace.path === '', + workspace.kinds.includes(WellKnownWorkspaceKinds.Default), this.allowModuleRename, token ); - // We only allow renaming symbol defined in the files this workspace owns. - // This is to make sure we don't rename files across workspaces in multiple workspaces context. - if (result && result.declarations.some((d) => d.path && !workspace.owns(d.path))) { - return null; - } - return result?.range ?? null; } @@ -1087,11 +1181,11 @@ export abstract class LanguageServerBase implements LanguageServerInterface { return; } - const editActions = workspace.serviceInstance.renameSymbolAtPosition( + const editActions = workspace.service.renameSymbolAtPosition( filePath, position, params.newName, - workspace.path === '', + workspace.kinds.includes(WellKnownWorkspaceKinds.Default), this.allowModuleRename, token ); @@ -1100,7 +1194,7 @@ export abstract class LanguageServerBase implements LanguageServerInterface { return undefined; } - return convertWorkspaceDocumentEdits(workspace.serviceInstance.fs, editActions); + return convertToWorkspaceEdit(workspace.service.fs, editActions); } protected async onPrepare( @@ -1114,17 +1208,17 @@ export abstract class LanguageServerBase implements LanguageServerInterface { return null; } - const callItem = workspace.serviceInstance.getCallForPosition(filePath, position, token) || null; + const callItem = workspace.service.getCallForPosition(filePath, position, token) || null; if (!callItem) { return null; } - if (workspace.serviceInstance.fs.isInZipOrEgg(callItem.uri)) { + if (!this.canNavigateToFile(callItem.uri, workspace.service.fs)) { return null; } // Convert the file path in the item to proper URI. - callItem.uri = convertPathToUri(workspace.serviceInstance.fs, callItem.uri); + callItem.uri = convertPathToUri(workspace.service.fs, callItem.uri); return [callItem]; } @@ -1137,16 +1231,16 @@ export abstract class LanguageServerBase implements LanguageServerInterface { return null; } - let callItems = workspace.serviceInstance.getIncomingCallsForPosition(filePath, position, token) || null; + let callItems = workspace.service.getIncomingCallsForPosition(filePath, position, token) || null; if (!callItems || callItems.length === 0) { return null; } - callItems = callItems.filter((item) => !workspace.serviceInstance.fs.isInZipOrEgg(item.from.uri)); + callItems = callItems.filter((item) => this.canNavigateToFile(item.from.uri, workspace.service.fs)); // Convert the file paths in the items to proper URIs. callItems.forEach((item) => { - item.from.uri = convertPathToUri(workspace.serviceInstance.fs, item.from.uri); + item.from.uri = convertPathToUri(workspace.service.fs, item.from.uri); }); return callItems; @@ -1163,16 +1257,16 @@ export abstract class LanguageServerBase implements LanguageServerInterface { return null; } - let callItems = workspace.serviceInstance.getOutgoingCallsForPosition(filePath, position, token) || null; + let callItems = workspace.service.getOutgoingCallsForPosition(filePath, position, token) || null; if (!callItems || callItems.length === 0) { return null; } - callItems = callItems.filter((item) => !workspace.serviceInstance.fs.isInZipOrEgg(item.to.uri)); + callItems = callItems.filter((item) => this.canNavigateToFile(item.to.uri, workspace.service.fs)); // Convert the file paths in the items to proper URIs. callItems.forEach((item) => { - item.to.uri = convertPathToUri(workspace.serviceInstance.fs, item.to.uri); + item.to.uri = convertPathToUri(workspace.service.fs, item.to.uri); }); return callItems; @@ -1186,13 +1280,11 @@ export abstract class LanguageServerBase implements LanguageServerInterface { return; } - const workspace = await this.getWorkspaceForFile(filePath); - workspace.serviceInstance.setFileOpened( - filePath, - params.textDocument.version, - params.textDocument.text, - ipythonMode - ); + // Send this open to all the workspaces that might contain this file. + const workspaces = await this.getContainingWorkspacesForFile(filePath); + workspaces.forEach((w) => { + w.service.setFileOpened(filePath, params.textDocument.version, params.textDocument.text, ipythonMode); + }); } protected async onDidChangeTextDocument(params: DidChangeTextDocumentParams, ipythonMode = IPythonMode.None) { @@ -1204,13 +1296,11 @@ export abstract class LanguageServerBase implements LanguageServerInterface { return; } - const workspace = await this.getWorkspaceForFile(filePath); - workspace.serviceInstance.updateOpenFileContents( - filePath, - params.textDocument.version, - params.contentChanges, - ipythonMode - ); + // Send this change to all the workspaces that might contain this file. + const workspaces = await this.getContainingWorkspacesForFile(filePath); + workspaces.forEach((w) => { + w.service.updateOpenFileContents(filePath, params.textDocument.version, params.contentChanges, ipythonMode); + }); } protected async onDidCloseTextDocument(params: DidCloseTextDocumentParams) { @@ -1220,8 +1310,11 @@ export abstract class LanguageServerBase implements LanguageServerInterface { return; } - const workspace = await this.getWorkspaceForFile(filePath); - workspace.serviceInstance.setFileClosed(filePath); + // Send this close to all the workspaces that might contain this file. + const workspaces = await this.getContainingWorkspacesForFile(filePath); + workspaces.forEach((w) => { + w.service.setFileClosed(filePath); + }); } protected onDidChangeWatchedFiles(params: DidChangeWatchedFilesParams) { @@ -1280,13 +1373,19 @@ export abstract class LanguageServerBase implements LanguageServerInterface { } } + protected onShutdown(token: CancellationToken) { + // Shutdown remaining workspaces. + this._workspaceFactory.clear(); + return Promise.resolve(); + } + protected resolveWorkspaceCompletionItem( - workspace: WorkspaceServiceInstance, + workspace: Workspace, filePath: string, item: CompletionItem, token: CancellationToken ): void { - workspace.serviceInstance.resolveCompletionItem( + workspace.service.resolveCompletionItem( filePath, item, this.getCompletionOptions(workspace), @@ -1296,16 +1395,16 @@ export abstract class LanguageServerBase implements LanguageServerInterface { } protected getWorkspaceCompletionsForPosition( - workspace: WorkspaceServiceInstance, + workspace: Workspace, filePath: string, position: Position, options: CompletionOptions, token: CancellationToken ): Promise { - return workspace.serviceInstance.getCompletionsForPosition( + return workspace.service.getCompletionsForPosition( filePath, position, - workspace.path, + workspace.rootPath, options, undefined, token @@ -1314,8 +1413,13 @@ export abstract class LanguageServerBase implements LanguageServerInterface { updateSettingsForAllWorkspaces(): void { const tasks: Promise[] = []; - this._workspaceMap.forEach((workspace) => { - tasks.push(this.updateSettingsForWorkspace(workspace)); + this._workspaceFactory.items().forEach((workspace) => { + // Updating settings can change workspace's file ownership. Make workspace uninitialized so that + // features can wait until workspace gets new settings. + // the file's ownership can also changed by `pyrightconfig.json` changes, but those are synchronous + // operation, so it won't affect this. + workspace.isInitialized = workspace.isInitialized.reset(); + tasks.push(this.updateSettingsForWorkspace(workspace, workspace.isInitialized)); }); Promise.all(tasks).then(() => { @@ -1323,59 +1427,16 @@ export abstract class LanguageServerBase implements LanguageServerInterface { }); } - protected getCompletionOptions(workspace: WorkspaceServiceInstance, params?: CompletionParams): CompletionOptions { + protected getCompletionOptions(workspace: Workspace, params?: CompletionParams): CompletionOptions { return { format: this.client.completionDocFormat, snippet: this.client.completionSupportsSnippet, lazyEdit: this.client.completionItemResolveSupportsAdditionalTextEdits, autoImport: true, + includeUserSymbolsInAutoImport: false, extraCommitChars: false, importFormat: ImportFormat.Absolute, - }; - } - - protected createWorkspaceServiceInstance( - workspaceFolder: WorkspaceFolder | undefined, - rootPath: string, - path: string, - kinds: string[] = [WellKnownWorkspaceKinds.Regular], - owns?: (filePath: string) => boolean, - services?: WorkspaceServices - ): WorkspaceServiceInstance { - // 5 seconds default - const defaultBackOffTime = 5 * 1000; - - // 10 mins back off for multi workspace. - const multiWorkspaceBackOffTime = 10 * 60 * 1000; - - const libraryReanalysisTimeProvider = - kinds.length === 1 && kinds[0] === WellKnownWorkspaceKinds.Regular - ? () => - this._workspaceMap.hasMultipleWorkspaces(kinds[0]) - ? multiWorkspaceBackOffTime - : defaultBackOffTime - : () => defaultBackOffTime; - - const rootUri = workspaceFolder?.uri ?? ''; - owns = owns ?? ((f) => f.startsWith(rootPath)); - - return { - workspaceName: workspaceFolder?.name ?? '', - rootPath, - path, - uri: rootUri, - kinds, - serviceInstance: this.createAnalyzerService( - workspaceFolder?.name ?? path, - services, - libraryReanalysisTimeProvider - ), - disableLanguageServices: false, - disableOrganizeImports: false, - disableWorkspaceSymbol: false, - isInitialized: createDeferred(), - searchPathsToWatch: [], - owns, + triggerCharacter: params?.context?.triggerCharacter, }; } @@ -1392,7 +1453,7 @@ export abstract class LanguageServerBase implements LanguageServerInterface { protected onAnalysisCompletedHandler(fs: FileSystem, results: AnalysisResults): void { // Send the computed diagnostics to the client. results.diagnostics.forEach((fileDiag) => { - if (fs.isInZipOrEgg(fileDiag.filePath)) { + if (!this.canNavigateToFile(fileDiag.filePath, fs)) { return; } @@ -1426,52 +1487,72 @@ export abstract class LanguageServerBase implements LanguageServerInterface { } async updateSettingsForWorkspace( - workspace: WorkspaceServiceInstance, + workspace: Workspace, + status: InitStatus | undefined, serverSettings?: ServerSettings ): Promise { + status?.markCalled(); + serverSettings = serverSettings ?? (await this.getSettings(workspace)); // Set logging level first. (this.console as ConsoleWithLogLevel).level = serverSettings.logLevel ?? LogLevel.Info; + // Apply the new path to the workspace (before restarting the service). + serverSettings.pythonPath = this._workspaceFactory.applyPythonPath(workspace, serverSettings.pythonPath); + + // Then use the updated settings to restart the service. this.updateOptionsAndRestartService(workspace, serverSettings); + workspace.disableLanguageServices = !!serverSettings.disableLanguageServices; workspace.disableOrganizeImports = !!serverSettings.disableOrganizeImports; + // Don't use workspace.isInitialized directly since it might have been + // reset due to pending config change event. // The workspace is now open for business. - workspace.isInitialized.resolve(true); + status?.resolve(); } updateOptionsAndRestartService( - workspace: WorkspaceServiceInstance, + workspace: Workspace, serverSettings: ServerSettings, typeStubTargetImportName?: string ) { AnalyzerServiceExecutor.runWithOptions(this.rootPath, workspace, serverSettings, typeStubTargetImportName); - workspace.searchPathsToWatch = workspace.serviceInstance.librarySearchPathsToWatch ?? []; + workspace.searchPathsToWatch = workspace.service.librarySearchPathsToWatch ?? []; } - protected convertLogLevel(logLevelValue?: string): LogLevel { - if (!logLevelValue) { - return LogLevel.Info; + protected onWorkspaceCreated(workspace: Workspace) { + // Update settings on this workspace (but only if initialize has happened) + if (this._initialized) { + this.updateSettingsForWorkspace(workspace, workspace.isInitialized).ignoreErrors(); } - switch (logLevelValue.toLowerCase()) { - case 'error': - return LogLevel.Error; + // Otherwise the initialize completion should cause settings to be updated on all workspaces. + } - case 'warning': - return LogLevel.Warn; + protected createAnalyzerServiceForWorkspace( + name: string, + _rootPath: string, + _uri: string, + kinds: string[], + services?: WorkspaceServices + ): AnalyzerService { + // 5 seconds default + const defaultBackOffTime = 5 * 1000; - case 'information': - return LogLevel.Info; + // 10 seconds back off for multi workspace. + const multiWorkspaceBackOffTime = 10 * 1000; - case 'trace': - return LogLevel.Log; + const libraryReanalysisTimeProvider = + kinds.length === 1 && kinds[0] === WellKnownWorkspaceKinds.Regular + ? () => + this._workspaceFactory.hasMultipleWorkspaces(kinds[0]) + ? multiWorkspaceBackOffTime + : defaultBackOffTime + : () => defaultBackOffTime; - default: - return LogLevel.Info; - } + return this.createAnalyzerService(name, services, libraryReanalysisTimeProvider); } private _sendDiagnostics(params: PublishDiagnosticsParams[]) { @@ -1498,7 +1579,7 @@ export abstract class LanguageServerBase implements LanguageServerInterface { // created by the LSP library. If it's the latter, we'll create a server-initiated // progress reporter. if (reporter.constructor !== nullProgressReporter.constructor) { - return { reporter: reporter, source: CancelAfter(token) }; + return { reporter: reporter, source: CancelAfter(this._serverOptions.cancellationProvider, token) }; } const serverInitiatedReporter = await this._connection.window.createWorkDoneProgress(); @@ -1511,7 +1592,7 @@ export abstract class LanguageServerBase implements LanguageServerInterface { return { reporter: serverInitiatedReporter, - source: CancelAfter(token, serverInitiatedReporter.token), + source: CancelAfter(this._serverOptions.cancellationProvider, token, serverInitiatedReporter.token), }; } @@ -1542,6 +1623,31 @@ export abstract class LanguageServerBase implements LanguageServerInterface { if (!this.client.supportsDeprecatedDiagnosticTag) { return; } + } else if (diag.category === DiagnosticCategory.TaskItem) { + vsDiag.tags = [VSDiagnosticTag.TaskItem as DiagnosticTag]; + + // Map the task item priority to a value VS will understand + // and store it in the diagnostic. + + // The Diagnostic type is defined in a protocol that we can't change, + // so we just dynamically create the vsDiag._vs_diagnosticRank property at runtime, + // which is what VS is looking for. + switch (diag.priority as TaskListPriority) { + case TaskListPriority.High: + (vsDiag as any)._vs_diagnosticRank = VSDiagnosticRank.High; + break; + case TaskListPriority.Normal: + (vsDiag as any)._vs_diagnosticRank = VSDiagnosticRank.Default; + break; + case TaskListPriority.Low: + (vsDiag as any)._vs_diagnosticRank = VSDiagnosticRank.Low; + break; + } + + // if the client doesn't support "task item" tags, don't report. + if (!this.client.supportsTaskItemDiagnosticTag) { + return; + } } if (rule) { @@ -1556,7 +1662,7 @@ export abstract class LanguageServerBase implements LanguageServerInterface { const relatedInfo = diag.getRelatedInfo(); if (relatedInfo.length > 0) { vsDiag.relatedInformation = relatedInfo - .filter((info) => !fs.isInZipOrEgg(info.filePath)) + .filter((info) => this.canNavigateToFile(info.filePath, fs)) .map((info) => DiagnosticRelatedInformation.create( Location.create(convertPathToUri(fs, info.filePath), info.range), @@ -1577,6 +1683,7 @@ export abstract class LanguageServerBase implements LanguageServerInterface { return DiagnosticSeverity.Warning; case DiagnosticCategory.Information: + case DiagnosticCategory.TaskItem: // task items only show up in the task list if they are information or above. return DiagnosticSeverity.Information; case DiagnosticCategory.UnusedCode: @@ -1593,39 +1700,19 @@ export abstract class LanguageServerBase implements LanguageServerInterface { // Tell all of the services that the user is actively // interacting with one or more editors, so they should // back off from performing any work. - this._workspaceMap.forEach((workspace: { serviceInstance: { recordUserInteractionTime: () => void } }) => { - workspace.serviceInstance.recordUserInteractionTime(); + this._workspaceFactory.items().forEach((workspace: { service: { recordUserInteractionTime: () => void } }) => { + workspace.service.recordUserInteractionTime(); }); } protected getDocumentationUrlForDiagnosticRule(rule: string): string | undefined { - // For now, return the same URL for all rules. We can separate these - // in the future. - return 'https://github.com/microsoft/pyright/blob/main/docs/configuration.md'; + // Configuration.md is configured to have a link for every rule name. + return `https://github.com/microsoft/pyright/blob/main/docs/configuration.md#${rule}`; } protected abstract createProgressReporter(): ProgressReporter; - // Expands certain predefined variables supported within VS Code settings. - // Ideally, VS Code would provide an API for doing this expansion, but - // it doesn't. We'll handle the most common variables here as a convenience. - protected expandPathVariables(rootPath: string, value: string): string { - const regexp = /\$\{(.*?)\}/g; - return value.replace(regexp, (match: string, name: string) => { - const trimmedName = name.trim(); - if (trimmedName === 'workspaceFolder') { - return rootPath; - } - if (trimmedName === 'env:HOME' && process.env.HOME !== undefined) { - return process.env.HOME; - } - if (trimmedName === 'env:USERNAME' && process.env.USERNAME !== undefined) { - return process.env.USERNAME; - } - if (trimmedName === 'env:VIRTUAL_ENV' && process.env.VIRTUAL_ENV !== undefined) { - return process.env.VIRTUAL_ENV; - } - return match; - }); + protected canNavigateToFile(path: string, fs: FileSystem): boolean { + return !fs.isInZipOrEgg(path); } } diff --git a/packages/pyright-internal/src/languageService/analyzerServiceExecutor.ts b/packages/pyright-internal/src/languageService/analyzerServiceExecutor.ts index 91de92c90..50fdf4376 100644 --- a/packages/pyright-internal/src/languageService/analyzerServiceExecutor.ts +++ b/packages/pyright-internal/src/languageService/analyzerServiceExecutor.ts @@ -7,25 +7,26 @@ * Runs the analyzer service of a given workspace service instance * with a specified set of options. */ + import { isPythonBinary } from '../analyzer/pythonPathUtils'; -import { AnalyzerService } from '../analyzer/service'; -import type { BackgroundAnalysis } from '../backgroundAnalysis'; +import { AnalyzerService, getNextServiceId } from '../analyzer/service'; import { CommandLineOptions } from '../common/commandLineOptions'; import { LogLevel } from '../common/console'; -import { createDeferred } from '../common/deferred'; import { FileSystem } from '../common/fileSystem'; import { combinePaths } from '../common/pathUtils'; -import { - LanguageServerInterface, - ServerSettings, - WellKnownWorkspaceKinds, - WorkspaceServiceInstance, -} from '../languageServerBase'; +import { LanguageServerInterface, ServerSettings } from '../languageServerBase'; +import { createInitStatus, WellKnownWorkspaceKinds, Workspace } from '../workspaceFactory'; + +export interface CloneOptions { + useBackgroundAnalysis?: boolean; + typeStubTargetImportName?: string; + fileSystem?: FileSystem; +} export class AnalyzerServiceExecutor { static runWithOptions( languageServiceRootPath: string, - workspace: WorkspaceServiceInstance, + workspace: Workspace, serverSettings: ServerSettings, typeStubTargetImportName?: string, trackFiles = true @@ -39,30 +40,39 @@ export class AnalyzerServiceExecutor { ); // Setting options causes the analyzer service to re-analyze everything. - workspace.serviceInstance.setOptions(commandLineOptions); + workspace.service.setOptions(commandLineOptions); } static async cloneService( ls: LanguageServerInterface, - workspace: WorkspaceServiceInstance, - typeStubTargetImportName?: string, - backgroundAnalysis?: BackgroundAnalysis, - fileSystem?: FileSystem + workspace: Workspace, + options?: CloneOptions ): Promise { // Allocate a temporary pseudo-workspace to perform this job. - const tempWorkspace: WorkspaceServiceInstance = { + const instanceName = 'cloned service'; + const serviceId = getNextServiceId(instanceName); + + options = options ?? {}; + + const tempWorkspace: Workspace = { + ...workspace, workspaceName: `temp workspace for cloned service`, rootPath: workspace.rootPath, - path: workspace.path, uri: workspace.uri, + pythonPath: workspace.pythonPath, + pythonPathKind: workspace.pythonPathKind, kinds: [...workspace.kinds, WellKnownWorkspaceKinds.Cloned], - serviceInstance: workspace.serviceInstance.clone('cloned service', backgroundAnalysis, fileSystem), + service: workspace.service.clone( + instanceName, + serviceId, + options.useBackgroundAnalysis ? ls.createBackgroundAnalysis(serviceId) : undefined, + options.fileSystem + ), disableLanguageServices: true, disableOrganizeImports: true, disableWorkspaceSymbol: true, - isInitialized: createDeferred(), + isInitialized: createInitStatus(), searchPathsToWatch: [], - owns: workspace.owns, }; const serverSettings = await ls.getSettings(workspace); @@ -70,11 +80,11 @@ export class AnalyzerServiceExecutor { ls.rootPath, tempWorkspace, serverSettings, - typeStubTargetImportName, + options.typeStubTargetImportName, /* trackFiles */ false ); - return tempWorkspace.serviceInstance; + return tempWorkspace.service; } } @@ -91,6 +101,7 @@ function getEffectiveCommandLineOptions( commandLineOptions.typeCheckingMode = serverSettings.typeCheckingMode; commandLineOptions.autoImportCompletions = serverSettings.autoImportCompletions; commandLineOptions.indexing = serverSettings.indexing; + commandLineOptions.taskListTokens = serverSettings.taskListTokens; commandLineOptions.logTypeEvaluationTime = serverSettings.logTypeEvaluationTime ?? false; commandLineOptions.typeEvaluationTimeThreshold = serverSettings.typeEvaluationTimeThreshold ?? 50; commandLineOptions.enableAmbientAnalysis = trackFiles; @@ -149,5 +160,9 @@ function getEffectiveCommandLineOptions( commandLineOptions.extraPaths = serverSettings.extraPaths; commandLineOptions.diagnosticSeverityOverrides = serverSettings.diagnosticSeverityOverrides; + commandLineOptions.fileSpecs = serverSettings.fileSpecs ?? []; + commandLineOptions.excludeFileSpecs = serverSettings.excludeFileSpecs ?? []; + commandLineOptions.ignoreFileSpecs = serverSettings.ignoreFileSpecs ?? []; + return commandLineOptions; } diff --git a/packages/pyright-internal/src/languageService/autoImporter.ts b/packages/pyright-internal/src/languageService/autoImporter.ts index f8e7f5cda..7525bb721 100644 --- a/packages/pyright-internal/src/languageService/autoImporter.ts +++ b/packages/pyright-internal/src/languageService/autoImporter.ts @@ -3,6 +3,7 @@ * Copyright (c) Microsoft Corporation. * Licensed under the MIT license. * + * Logic for performing auto-import completions. */ import { CancellationToken, CompletionItemKind, SymbolKind } from 'vscode-languageserver'; @@ -27,6 +28,7 @@ import { SourceFileInfo } from '../analyzer/program'; import { isUserCode } from '../analyzer/sourceFileInfoUtils'; import { Symbol } from '../analyzer/symbol'; import * as SymbolNameUtils from '../analyzer/symbolNameUtils'; +import { isVisibleExternally } from '../analyzer/symbolUtils'; import { throwIfCancellationRequested } from '../common/cancellationUtils'; import { appendArray } from '../common/collectionUtils'; import { ExecutionEnvironment } from '../common/configOptions'; @@ -132,7 +134,7 @@ export function buildModuleSymbolsMap( moduleSymbolMap.set(filePath, { forEach(callbackfn: (value: AutoImportSymbol, key: string, library: boolean) => void): void { symbolTable.forEach((symbol, name) => { - if (symbol.isExternallyHidden()) { + if (!isVisibleExternally(symbol)) { return; } diff --git a/packages/pyright-internal/src/languageService/callHierarchyProvider.ts b/packages/pyright-internal/src/languageService/callHierarchyProvider.ts index 2b46eb790..5fd803258 100644 --- a/packages/pyright-internal/src/languageService/callHierarchyProvider.ts +++ b/packages/pyright-internal/src/languageService/callHierarchyProvider.ts @@ -25,7 +25,7 @@ import { ClassType, isClassInstance, isFunction, isInstantiableClass } from '../ import { ClassMemberLookupFlags, doForEachSubtype, - isProperty, + isMaybeDescriptorInstance, lookUpClassMember, lookUpObjectMember, } from '../analyzer/typeUtils'; @@ -33,6 +33,7 @@ import { throwIfCancellationRequested } from '../common/cancellationUtils'; import { getFileName } from '../common/pathUtils'; import { convertOffsetsToRange } from '../common/positionUtils'; import { rangesAreEqual } from '../common/textRange'; +import { ReferencesResult } from '../languageService/referencesProvider'; import { CallNode, MemberAccessNode, NameNode, ParseNode, ParseNodeType } from '../parser/parseNodes'; import { ParseResults } from '../parser/parser'; @@ -41,15 +42,30 @@ export class CallHierarchyProvider { symbolName: string, declaration: Declaration, evaluator: TypeEvaluator, - token: CancellationToken + token: CancellationToken, + callItemUri: string ): CallHierarchyItem | undefined { throwIfCancellationRequested(token); - if (declaration.type === DeclarationType.Function || declaration.type === DeclarationType.Class) { + if ( + declaration.type === DeclarationType.Function || + declaration.type === DeclarationType.Class || + declaration.type === DeclarationType.Alias + ) { + // make sure the alias is resolved to class or function + if (declaration.type === DeclarationType.Alias) { + const resolvedDecl = evaluator.resolveAliasDeclaration(declaration, true); + if (!resolvedDecl) { + return undefined; + } + if (resolvedDecl.type !== DeclarationType.Function && resolvedDecl.type !== DeclarationType.Class) { + return undefined; + } + } const callItem: CallHierarchyItem = { name: symbolName, kind: getSymbolKind(declaration, evaluator), - uri: declaration.path, + uri: callItemUri, range: declaration.range, selectionRange: declaration.range, }; @@ -97,7 +113,7 @@ export class CallHierarchyProvider { parseRoot = declaration.node; } else if (declaration.type === DeclarationType.Class) { // Look up the __init__ method for this class. - const classType = evaluator.getTypeForDeclaration(declaration); + const classType = evaluator.getTypeForDeclaration(declaration)?.type; if (classType && isInstantiableClass(classType)) { // Don't perform a recursive search of parent classes in this // case because we don't want to find an inherited __init__ @@ -135,10 +151,15 @@ export class CallHierarchyProvider { return outgoingCalls.length > 0 ? outgoingCalls : undefined; } - static getTargetDeclaration(declarations: Declaration[], node: ParseNode): Declaration { + static getTargetDeclaration( + referencesResult: ReferencesResult, + filePath: string + ): { targetDecl: Declaration; callItemUri: string; symbolName: string } { // If there's more than one declaration, pick the target one. // We'll always prefer one with a declared type, and we'll always // prefer later declarations. + const declarations = referencesResult.declarations; + const node = referencesResult.nodeAtOffset; let targetDecl = declarations[0]; for (const decl of declarations) { if (DeclarationUtils.hasTypeForDeclaration(decl) || !DeclarationUtils.hasTypeForDeclaration(targetDecl)) { @@ -153,8 +174,16 @@ export class CallHierarchyProvider { } } } - - return targetDecl; + let symbolName; + let callItemUri; + if (targetDecl.type === DeclarationType.Alias) { + symbolName = (referencesResult.nodeAtOffset as NameNode).value; + callItemUri = filePath; + } else { + symbolName = DeclarationUtils.getNameFromDeclaration(targetDecl) || referencesResult.symbolNames[0]; + callItemUri = targetDecl.path; + } + return { targetDecl, callItemUri, symbolName }; } } @@ -324,7 +353,20 @@ class FindIncomingCallTreeWalker extends ParseTreeWalker { return this._evaluator.resolveAliasDeclaration(decl, /* resolveLocalNames */ true); }) .filter((decl) => decl !== undefined); - if (resolvedDecls.some((decl) => DeclarationUtils.areDeclarationsSame(decl!, this._declaration))) { + if (this._declaration.type === DeclarationType.Alias) { + const resolvedCurDecls = this._evaluator.resolveAliasDeclaration( + this._declaration, + /* resolveLocalNames */ true + ); + if ( + resolvedCurDecls && + resolvedDecls.some((decl) => DeclarationUtils.areDeclarationsSame(decl!, resolvedCurDecls)) + ) { + this._addIncomingCallForDeclaration(nameNode!); + } + } else if ( + resolvedDecls.some((decl) => DeclarationUtils.areDeclarationsSame(decl!, this._declaration)) + ) { this._addIncomingCallForDeclaration(nameNode!); } } @@ -456,8 +498,8 @@ function getSymbolKind(declaration: Declaration, evaluator: TypeEvaluator): Symb case DeclarationType.Function: if (declaration.isMethod) { - const declType = evaluator.getTypeForDeclaration(declaration); - if (declType && isProperty(declType)) { + const declType = evaluator.getTypeForDeclaration(declaration)?.type; + if (declType && isMaybeDescriptorInstance(declType, /* requireSetter */ false)) { symbolKind = SymbolKind.Property; } else { symbolKind = SymbolKind.Method; diff --git a/packages/pyright-internal/src/languageService/codeActionProvider.ts b/packages/pyright-internal/src/languageService/codeActionProvider.ts index 7b432a7f5..988dc6640 100644 --- a/packages/pyright-internal/src/languageService/codeActionProvider.ts +++ b/packages/pyright-internal/src/languageService/codeActionProvider.ts @@ -10,15 +10,22 @@ import { CancellationToken, CodeAction, CodeActionKind, Command } from 'vscode-l import { Commands } from '../commands/commands'; import { throwIfCancellationRequested } from '../common/cancellationUtils'; -import { AddMissingOptionalToParamAction, CreateTypeStubFileAction } from '../common/diagnostic'; -import { convertPathToUri } from '../common/pathUtils'; +import { + ActionKind, + AddMissingOptionalToParamAction, + CreateTypeStubFileAction, + RenameShadowedFileAction, +} from '../common/diagnostic'; +import { FileEditActions } from '../common/editAction'; +import { convertPathToUri, getShortenedFileName } from '../common/pathUtils'; import { Range } from '../common/textRange'; -import { WorkspaceServiceInstance } from '../languageServerBase'; +import { convertToWorkspaceEdit } from '../common/workspaceEditUtils'; import { Localizer } from '../localization/localize'; +import { Workspace } from '../workspaceFactory'; export class CodeActionProvider { static async getCodeActionsForPosition( - workspace: WorkspaceServiceInstance, + workspace: Workspace, filePath: string, range: Range, kinds: CodeActionKind[] | undefined, @@ -29,7 +36,7 @@ export class CodeActionProvider { const codeActions: CodeAction[] = []; if (!workspace.disableLanguageServices) { - const diags = await workspace.serviceInstance.getDiagnosticsForRange(filePath, range, token); + const diags = await workspace.service.getDiagnosticsForRange(filePath, range, token); const typeStubDiag = diags.find((d) => { const actions = d.getActions(); return actions && actions.find((a) => a.action === Commands.createTypeStub); @@ -45,7 +52,7 @@ export class CodeActionProvider { Command.create( Localizer.CodeAction.createTypeStub(), Commands.createTypeStub, - workspace.path, + workspace.rootPath, action.moduleName, filePath ), @@ -65,7 +72,7 @@ export class CodeActionProvider { .getActions()! .find((a) => a.action === Commands.addMissingOptionalToParam) as AddMissingOptionalToParamAction; if (action) { - const fs = workspace.serviceInstance.getImportResolver().fileSystem; + const fs = workspace.service.getImportResolver().fileSystem; const addMissingOptionalAction = CodeAction.create( Localizer.CodeAction.addOptionalToAnnotation(), Command.create( @@ -79,6 +86,35 @@ export class CodeActionProvider { codeActions.push(addMissingOptionalAction); } } + const renameShadowed = diags.find((d) => { + const actions = d.getActions(); + return actions && actions.find((a) => a.action === ActionKind.RenameShadowedFileAction); + }); + if (renameShadowed) { + const action = renameShadowed + .getActions()! + .find((a) => a.action === ActionKind.RenameShadowedFileAction) as RenameShadowedFileAction; + if (action) { + const title = Localizer.CodeAction.renameShadowedFile().format({ + oldFile: getShortenedFileName(action.oldFile), + newFile: getShortenedFileName(action.newFile), + }); + const fs = workspace.service.getImportResolver().fileSystem; + const editActions: FileEditActions = { + edits: [], + fileOperations: [ + { + kind: 'rename', + oldFilePath: action.oldFile, + newFilePath: action.newFile, + }, + ], + }; + const workspaceEdit = convertToWorkspaceEdit(fs, editActions); + const renameAction = CodeAction.create(title, workspaceEdit, CodeActionKind.QuickFix); + codeActions.push(renameAction); + } + } } return codeActions; diff --git a/packages/pyright-internal/src/languageService/completionProvider.ts b/packages/pyright-internal/src/languageService/completionProvider.ts index 322acbc4a..97f8debd8 100644 --- a/packages/pyright-internal/src/languageService/completionProvider.ts +++ b/packages/pyright-internal/src/languageService/completionProvider.ts @@ -33,20 +33,21 @@ import { import { isDefinedInFile } from '../analyzer/declarationUtils'; import { convertDocStringToMarkdown, convertDocStringToPlainText } from '../analyzer/docStringConversion'; import { ImportedModuleDescriptor, ImportResolver } from '../analyzer/importResolver'; +import { isTypedKwargs } from '../analyzer/parameterUtils'; import * as ParseTreeUtils from '../analyzer/parseTreeUtils'; import { getCallNodeAndActiveParameterIndex } from '../analyzer/parseTreeUtils'; import { getScopeForNode } from '../analyzer/scopeUtils'; import { isStubFile, SourceMapper } from '../analyzer/sourceMapper'; import { Symbol, SymbolTable } from '../analyzer/symbol'; import * as SymbolNameUtils from '../analyzer/symbolNameUtils'; -import { getLastTypedDeclaredForSymbol } from '../analyzer/symbolUtils'; +import { getLastTypedDeclaredForSymbol, isVisibleExternally } from '../analyzer/symbolUtils'; import { getTypedDictMembersForClass } from '../analyzer/typedDicts'; +import { getModuleDocStringFromPaths } from '../analyzer/typeDocStringUtils'; import { CallSignatureInfo, TypeEvaluator } from '../analyzer/typeEvaluatorTypes'; import { printLiteralValue } from '../analyzer/typePrinter'; import { ClassType, FunctionType, - getTypeAliasInfo, isClass, isClassInstance, isFunction, @@ -58,16 +59,18 @@ import { isUnknown, Type, TypeBase, - UnknownType, + TypeCategory, } from '../analyzer/types'; import { + ClassMemberLookupFlags, doForEachSubtype, getDeclaringModulesForType, getMembersForClass, getMembersForModule, isLiteralType, isLiteralTypeOrUnion, - isProperty, + isMaybeDescriptorInstance, + lookUpClassMember, lookUpObjectMember, } from '../analyzer/typeUtils'; import { throwIfCancellationRequested } from '../common/cancellationUtils'; @@ -75,7 +78,6 @@ import { appendArray } from '../common/collectionUtils'; import { ConfigOptions, ExecutionEnvironment } from '../common/configOptions'; import * as debug from '../common/debug'; import { fail } from '../common/debug'; -import { TextEditAction } from '../common/editAction'; import { fromLSPAny, toLSPAny } from '../common/lspUtils'; import { convertOffsetToPosition, convertPositionToOffset } from '../common/positionUtils'; import { PythonVersion } from '../common/pythonVersion'; @@ -84,6 +86,7 @@ import { comparePositions, Position } from '../common/textRange'; import { TextRange } from '../common/textRange'; import { TextRangeCollection } from '../common/textRangeCollection'; import { Duration } from '../common/timing'; +import { convertToTextEdits } from '../common/workspaceEditUtils'; import { ArgumentCategory, DecoratorNode, @@ -103,13 +106,20 @@ import { ParseNodeType, SetNode, StringNode, + TypeAnnotationNode, } from '../parser/parseNodes'; import { ParseResults } from '../parser/parser'; -import { StringToken, StringTokenFlags, Token, TokenType } from '../parser/tokenizerTypes'; +import { OperatorToken, OperatorType, StringToken, StringTokenFlags, Token, TokenType } from '../parser/tokenizerTypes'; import { AbbreviationInfo, AutoImporter, AutoImportResult, ImportFormat, ModuleSymbolMap } from './autoImporter'; +import { + CompletionDetail, + getCompletionItemDocumentation, + getTypeDetail, + SymbolDetail, +} from './completionProviderUtils'; import { DocumentSymbolCollector } from './documentSymbolCollector'; import { IndexResults } from './documentSymbolProvider'; -import { getAutoImportText, getDocumentationPartsForTypeAndDecl, getOverloadedFunctionTooltip } from './tooltipUtils'; +import { getAutoImportText, getDocumentationPartsForTypeAndDecl } from './tooltipUtils'; namespace Keywords { const base: string[] = [ @@ -221,6 +231,7 @@ export interface CompletionItemData { autoImportText?: string; symbolLabel?: string; funcParensDisabled?: boolean; + modulePath?: string; } // MemberAccessInfo attempts to gather info for unknown types @@ -270,8 +281,10 @@ export interface CompletionOptions { snippet: boolean; lazyEdit: boolean; autoImport: boolean; + includeUserSymbolsInAutoImport: boolean; extraCommitChars: boolean; importFormat: ImportFormat; + triggerCharacter?: string; } export type AbbreviationMap = Map; @@ -287,33 +300,12 @@ interface RecentCompletionInfo { autoImportText: string; } -interface Edits { - format?: InsertTextFormat; - textEdit?: TextEdit; - additionalTextEdits?: TextEditAction[]; -} - -interface CommonDetail { - funcParensDisabled?: boolean; - edits?: Edits; - extraCommitChars?: boolean; -} - -interface SymbolDetail extends CommonDetail { - autoImportSource?: string; - autoImportAlias?: string; - boundObjectOrClass?: ClassType; -} - -interface CompletionDetail extends CommonDetail { - typeDetail?: string; - documentation?: string; - autoImportText?: { - source: string; - importText: string; - }; - sortText?: string; - itemDetail?: string; +interface QuoteInfo { + priorWord: string; + priorText: string; + filterText: string | undefined; + stringValue: string | undefined; + quoteCharacter: string; } export const autoImportDetail = 'Auto-import'; @@ -447,7 +439,7 @@ export class CompletionProvider { throwIfCancellationRequested(this._cancellationToken); if (curNode.nodeType === ParseNodeType.String) { - return this._getLiteralCompletions(curNode, priorWord, priorText, postText); + return this._getLiteralCompletions(curNode, offset, priorWord, priorText, postText); } if (curNode.nodeType === ParseNodeType.StringList || curNode.nodeType === ParseNodeType.FormatString) { @@ -459,7 +451,7 @@ export class CompletionProvider { } if (curNode.nodeType === ParseNodeType.Error) { - return this._getExpressionErrorCompletions(curNode, priorWord, priorText, postText); + return this._getExpressionErrorCompletions(curNode, offset, priorWord, priorText, postText); } if (curNode.nodeType === ParseNodeType.MemberAccess) { @@ -468,7 +460,16 @@ export class CompletionProvider { if (curNode.nodeType === ParseNodeType.Dictionary) { const completionMap = new CompletionMap(); - if (this._addTypedDictKeys(curNode, /* stringNode */ undefined, priorText, postText, completionMap)) { + if ( + this._tryAddTypedDictKeysFromDictionary( + curNode, + /* stringNode */ undefined, + priorWord, + priorText, + postText, + completionMap + ) + ) { return { completionMap }; } } @@ -483,9 +484,10 @@ export class CompletionProvider { if (dictionaryNode.trailingCommaToken && dictionaryNode.trailingCommaToken.start < offset) { const completionMap = new CompletionMap(); if ( - this._addTypedDictKeys( + this._tryAddTypedDictKeysFromDictionary( dictionaryNode, /* stringNode */ undefined, + priorWord, priorText, postText, completionMap @@ -507,6 +509,11 @@ export class CompletionProvider { } } + if (curNode.nodeType === ParseNodeType.List && this._options.triggerCharacter === '[') { + // If this is an empty list, don't start putting completions up yet. + return undefined; + } + if (curNode.nodeType === ParseNodeType.ImportFrom) { return this._getImportFromCompletions(curNode, priorWord); } @@ -600,26 +607,49 @@ export class CompletionProvider { CompletionProvider._mostRecentCompletions.pop(); } - if (completionItemData.symbolLabel) { - this._itemToResolve = completionItem; + if (!completionItemData.symbolLabel) { + return; + } - if (!completionItemData.autoImportText) { - // Rerun the completion lookup. It will fill in additional information - // about the item to be resolved. We'll ignore the rest of the returned - // list. This is a bit wasteful, but all of that information should be - // cached, so it's not as bad as it might seem. - this.getCompletionsForPosition(); - } else if (!completionItem.additionalTextEdits) { - const completionMap = new CompletionMap(); - const completionResults = { completionMap }; + if (completionItemData.modulePath) { + const documentation = getModuleDocStringFromPaths([completionItemData.modulePath], this._sourceMapper); + if (!documentation) { + return; + } - this._addAutoImportCompletions( - completionItemData.symbolLabel, - /* similarityLimit */ 1, - /* lazyEdit */ false, - completionResults - ); + if (this._options.format === MarkupKind.Markdown) { + const markdownString = convertDocStringToMarkdown(documentation); + completionItem.documentation = { + kind: MarkupKind.Markdown, + value: markdownString, + }; + } else if (this._options.format === MarkupKind.PlainText) { + const plainTextString = convertDocStringToPlainText(documentation); + completionItem.documentation = { + kind: MarkupKind.PlainText, + value: plainTextString, + }; } + return; + } + + this._itemToResolve = completionItem; + if (!completionItemData.autoImportText) { + // Rerun the completion lookup. It will fill in additional information + // about the item to be resolved. We'll ignore the rest of the returned + // list. This is a bit wasteful, but all of that information should be + // cached, so it's not as bad as it might seem. + this.getCompletionsForPosition(); + } else if (!completionItem.additionalTextEdits) { + const completionMap = new CompletionMap(); + const completionResults = { completionMap }; + + this._addAutoImportCompletions( + completionItemData.symbolLabel, + /* similarityLimit */ 1, + /* lazyEdit */ false, + completionResults + ); } } @@ -755,7 +785,7 @@ export class CompletionProvider { curNode.parent.parent?.nodeType === ParseNodeType.Suite && curNode.parent.parent.parent?.nodeType === ParseNodeType.Class ) { - const completionList = this._getClassVariableCompletions(priorWord, curNode); + const completionList = this._getClassVariableCompletions(curNode); if (completionList) { return completionList; } @@ -810,6 +840,7 @@ export class CompletionProvider { private _getExpressionErrorCompletions( node: ErrorNode, + offset: number, priorWord: string, priorText: string, postText: string @@ -826,52 +857,69 @@ export class CompletionProvider { return this._createSingleKeywordCompletion('else'); } + case ErrorExpressionCategory.MissingMemberAccessName: case ErrorExpressionCategory.MissingExpression: { // Don't show completion after random dots. const tokenizerOutput = this._parseResults.tokenizerOutput; const offset = convertPositionToOffset(this._position, tokenizerOutput.lines); const index = ParseTreeUtils.getTokenIndexAtLeft(tokenizerOutput.tokens, offset!); const token = ParseTreeUtils.getTokenAtIndex(tokenizerOutput.tokens, index); - if (token?.type === TokenType.Dot || token?.type === TokenType.Ellipsis) { - break; - } + const prevToken = ParseTreeUtils.getTokenAtIndex(tokenizerOutput.tokens, index - 1); - // ex) class MyType: - // def is_str(self): ... - // myType = MyType() - // - // In incomplete code such as "myType.is" <= "is" will be tokenized as keyword not identifier, - // so even if user's intention is writing "is_str", completion after "is" won't include "is_str" - // since parser won't see "is" as partially written member name instead it will see it as - // expression statement with missing expression after "is" keyword. - // In such case, use "MyType." to get completion. - if (token?.type !== TokenType.Keyword || TextRange.getEnd(token) !== offset) { - return this._getExpressionCompletions(node, priorWord, priorText, postText); - } + if (node.category === ErrorExpressionCategory.MissingExpression) { + // Skip dots on expressions. + if (token?.type === TokenType.Dot || token?.type === TokenType.Ellipsis) { + break; + } - const previousToken = ParseTreeUtils.getTokenAtIndex(tokenizerOutput.tokens, index - 1); - if (previousToken?.type !== TokenType.Dot) { - return this._getExpressionCompletions(node, priorWord, priorText, postText); - } + // ex) class MyType: + // def is_str(self): ... + // myType = MyType() + // + // In incomplete code such as "myType.is" <= "is" will be tokenized as keyword not identifier, + // so even if user's intention is writing "is_str", completion after "is" won't include "is_str" + // since parser won't see "is" as partially written member name instead it will see it as + // expression statement with missing expression after "is" keyword. + // In such case, use "MyType." to get completion. + if (token?.type !== TokenType.Keyword || TextRange.getEnd(token) !== offset) { + return this._getExpressionCompletions(node, priorWord, priorText, postText); + } - const previousOffset = TextRange.getEnd(previousToken); - const previousNode = ParseTreeUtils.findNodeByOffset(this._parseResults.parseTree, previousOffset); - if ( - previousNode?.nodeType !== ParseNodeType.Error || - previousNode.category !== ErrorExpressionCategory.MissingMemberAccessName - ) { - return this._getExpressionCompletions(node, priorWord, priorText, postText); + if (prevToken?.type !== TokenType.Dot) { + return this._getExpressionCompletions(node, priorWord, priorText, postText); + } + + const previousOffset = TextRange.getEnd(prevToken); + const previousNode = ParseTreeUtils.findNodeByOffset(this._parseResults.parseTree, previousOffset); + if ( + previousNode?.nodeType !== ParseNodeType.Error || + previousNode.category !== ErrorExpressionCategory.MissingMemberAccessName + ) { + return this._getExpressionCompletions(node, priorWord, priorText, postText); + } else { + // Update node to previous node so we get the member access completions. + node = previousNode; + } + } else if (node.category === ErrorExpressionCategory.MissingMemberAccessName) { + // Skip double dots on member access. + if ( + (token?.type === TokenType.Dot || token?.type === TokenType.Ellipsis) && + (prevToken?.type === TokenType.Dot || prevToken?.type === TokenType.Ellipsis) + ) { + return undefined; + } } - return this._getMissingMemberAccessNameCompletions(previousNode, previousOffset, priorWord); + return this._getMissingMemberAccessNameCompletions(node, priorWord); } case ErrorExpressionCategory.MissingDecoratorCallName: { return this._getExpressionCompletions(node, priorWord, priorText, postText); } + case ErrorExpressionCategory.MissingPattern: case ErrorExpressionCategory.MissingIndexOrSlice: { - let completionResults = this._getLiteralCompletions(node, priorWord, priorText, postText); + let completionResults = this._getLiteralCompletions(node, offset, priorWord, priorText, postText); if (!completionResults) { completionResults = this._getExpressionCompletions(node, priorWord, priorText, postText); @@ -880,11 +928,6 @@ export class CompletionProvider { return completionResults; } - case ErrorExpressionCategory.MissingMemberAccessName: { - const offset = convertPositionToOffset(this._position, this._parseResults.tokenizerOutput.lines); - return this._getMissingMemberAccessNameCompletions(node, offset!, priorWord); - } - case ErrorExpressionCategory.MissingFunctionParameterList: { if (node.child && node.child.nodeType === ParseNodeType.Name) { if (node.decorators?.some((d) => this._isOverload(d))) { @@ -902,14 +945,7 @@ export class CompletionProvider { return undefined; } - private _getMissingMemberAccessNameCompletions(node: ErrorNode, offset: number, priorWord: string) { - const index = ParseTreeUtils.getTokenIndexAtLeft(this._parseResults.tokenizerOutput.tokens, offset) - 1; - const previousToken = ParseTreeUtils.getTokenAtIndex(this._parseResults.tokenizerOutput.tokens, index); - if (previousToken?.type === TokenType.Dot || previousToken?.type === TokenType.Ellipsis) { - // Don't allow multiple dot bring up completions. - return undefined; - } - + private _getMissingMemberAccessNameCompletions(node: ErrorNode, priorWord: string) { if (!node.child || !isExpressionNode(node.child)) { return undefined; } @@ -934,10 +970,28 @@ export class CompletionProvider { return { completionMap }; } - private _getClassVariableCompletions(priorWord: string, partialName: NameNode): CompletionResults | undefined { - const enclosingClass = ParseTreeUtils.getEnclosingClass(partialName, false); + private _addClassVariableTypeAnnotationCompletions( + priorWord: string, + parseNode: ParseNode, + completionMap: CompletionMap + ): void { + // class T: + // f: |<= here + const isTypeAnnotationOfClassVariable = + parseNode.parent?.nodeType === ParseNodeType.TypeAnnotation && + parseNode.parent.valueExpression.nodeType === ParseNodeType.Name && + parseNode.parent.typeAnnotation === parseNode && + parseNode.parent.parent?.nodeType === ParseNodeType.StatementList && + parseNode.parent.parent.parent?.nodeType === ParseNodeType.Suite && + parseNode.parent.parent.parent.parent?.nodeType === ParseNodeType.Class; + + if (!isTypeAnnotationOfClassVariable) { + return; + } + + const enclosingClass = ParseTreeUtils.getEnclosingClass(parseNode, false); if (!enclosingClass) { - return undefined; + return; } const classResults = this._evaluator.getTypeOfClass(enclosingClass); @@ -945,18 +999,96 @@ export class CompletionProvider { return undefined; } + const classVariableName = ((parseNode.parent as TypeAnnotationNode).valueExpression as NameNode).value; + const classMember = lookUpClassMember( + classResults.classType, + classVariableName, + ClassMemberLookupFlags.SkipInstanceVariables | ClassMemberLookupFlags.SkipOriginalClass + ); + + // First, see whether we can use semantic info to get variable type. + if (classMember) { + const memberType = this._evaluator.getTypeOfMember(classMember); + + const text = this._evaluator.printType(memberType, { + enforcePythonSyntax: true, + expandTypeAlias: false, + }); + + this._addNameToCompletions(text, CompletionItemKind.Reference, priorWord, completionMap, { + sortText: this._makeSortText(SortCategory.LikelyKeyword, text), + }); + return; + } + + // If we can't do that using semantic info, then try syntactic info. const symbolTable = new Map(); for (const mroClass of classResults.classType.details.mro) { + if (mroClass === classResults.classType) { + // Ignore current type. + continue; + } + if (isInstantiableClass(mroClass)) { getMembersForClass(mroClass, symbolTable, /* includeInstanceVars */ false); } } + const symbol = symbolTable.get(classVariableName); + if (!symbol) { + return; + } + + const decls = symbol + .getDeclarations() + .filter((d) => isVariableDeclaration(d) && d.moduleName !== 'builtins') as VariableDeclaration[]; + + // Skip any symbols invalid such as defined in the same class. + if ( + decls.length === 0 || + decls.some((d) => d.node && ParseTreeUtils.getEnclosingClass(d.node, false) === enclosingClass) + ) { + return; + } + + const declWithTypeAnnotations = decls.filter((d) => d.typeAnnotationNode); + if (declWithTypeAnnotations.length === 0) { + return; + } + const printFlags = isStubFile(this._filePath) ? ParseTreeUtils.PrintExpressionFlags.ForwardDeclarations | ParseTreeUtils.PrintExpressionFlags.DoNotLimitStringLength : ParseTreeUtils.PrintExpressionFlags.DoNotLimitStringLength; + const text = `${ParseTreeUtils.printExpression( + declWithTypeAnnotations[declWithTypeAnnotations.length - 1].typeAnnotationNode!, + printFlags + )}`; + + this._addNameToCompletions(text, CompletionItemKind.Reference, priorWord, completionMap, { + sortText: this._makeSortText(SortCategory.LikelyKeyword, text), + }); + } + + private _getClassVariableCompletions(partialName: NameNode): CompletionResults | undefined { + const enclosingClass = ParseTreeUtils.getEnclosingClass(partialName, false); + if (!enclosingClass) { + return undefined; + } + + const classResults = this._evaluator.getTypeOfClass(enclosingClass); + if (!classResults) { + return undefined; + } + + const symbolTable = new Map(); + for (const mroClass of classResults.classType.details.mro) { + if (isInstantiableClass(mroClass)) { + getMembersForClass(mroClass, symbolTable, /* includeInstanceVars */ false); + } + } + const completionMap = new CompletionMap(); symbolTable.forEach((symbol, name) => { if ( @@ -980,19 +1112,7 @@ export class CompletionProvider { return; } - let edits: Edits | undefined; - const declWithTypeAnnotations = decls.filter((d) => d.typeAnnotationNode); - if (declWithTypeAnnotations.length > 0) { - const text = `${name}: ${ParseTreeUtils.printExpression( - declWithTypeAnnotations[declWithTypeAnnotations.length - 1].typeAnnotationNode!, - printFlags - )}`; - edits = { - textEdit: this._createReplaceEdits(priorWord, partialName, text), - }; - } - - this._addSymbol(name, symbol, partialName.value, completionMap, { edits }); + this._addSymbol(name, symbol, partialName.value, completionMap, {}); }); return completionMap.size > 0 ? { completionMap } : undefined; @@ -1097,7 +1217,7 @@ export class CompletionProvider { let decl = getLastTypedDeclaredForSymbol(symbol); if (decl && decl.type === DeclarationType.Function) { if (StringUtils.isPatternInSymbol(partialName.value, name)) { - const declaredType = this._evaluator.getTypeForDeclaration(decl); + const declaredType = this._evaluator.getTypeForDeclaration(decl)?.type; if (!declaredType) { return; } @@ -1250,6 +1370,7 @@ export class CompletionProvider { switch (node.nodeType) { case ParseNodeType.Number: case ParseNodeType.Constant: + case ParseNodeType.MemberAccess: return true; case ParseNodeType.String: @@ -1310,15 +1431,20 @@ export class CompletionProvider { function getParameters(parameters: ParameterNode[]) { const results: [node: ParameterNode, keywordOnly: boolean][] = []; - let keywordOnly = false; + let sawKeywordOnlySeparator = false; for (const parameter of parameters) { if (parameter.name) { - results.push([parameter, keywordOnly]); + results.push([ + parameter, + parameter.category === ParameterCategory.Simple && !!parameter.name && sawKeywordOnlySeparator, + ]); } - keywordOnly = - parameter.category === ParameterCategory.VarArgList || - parameter.category === ParameterCategory.VarArgDictionary; + // All simple parameters after a `*` or `*args` parameter + // are considered keyword only. + if (parameter.category === ParameterCategory.VarArgList) { + sawKeywordOnlySeparator = true; + } } return results; @@ -1351,6 +1477,12 @@ export class CompletionProvider { if (leftType) { leftType = this._evaluator.makeTopLevelTypeVarsConcrete(leftType); + // If this is an unknown type with a "possible type" associated with + // it, use the possible type. + if (isUnknown(leftType) && leftType.possibleType) { + leftType = this._evaluator.makeTopLevelTypeVarsConcrete(leftType.possibleType); + } + doForEachSubtype(leftType, (subtype) => { subtype = this._evaluator.makeTopLevelTypeVarsConcrete(subtype); @@ -1374,6 +1506,7 @@ export class CompletionProvider { symbolTable, () => true, priorWord, + leftExprNode, /* isInImport */ false, isClass(subtype) ? subtype : undefined, completionMap @@ -1381,10 +1514,8 @@ export class CompletionProvider { }); } - // If we don't know this type, look for a module we should stub. - if (!leftType || isUnknown(leftType) || isUnbound(leftType)) { - memberAccessInfo = this._getLastKnownModule(leftExprNode, leftType); - } + // Save member access info for every request + memberAccessInfo = this._getLastKnownModule(leftExprNode, leftType); return { completionMap, memberAccessInfo }; } @@ -1407,7 +1538,7 @@ export class CompletionProvider { curNode.nodeType === ParseNodeType.MemberAccess ? curNode?.memberName.value ?? '' : ''; } } else { - curNode = undefined; + break; } if (curNode) { @@ -1482,6 +1613,11 @@ export class CompletionProvider { return completionResults; } + // Defining type annotation for class variables. + // ex) class A: + // variable: | <= here + this._addClassVariableTypeAnnotationCompletions(priorWord, parseNode, completionMap); + // Add call argument completions. this._addCallArgumentCompletions( parseNode, @@ -1513,52 +1649,7 @@ export class CompletionProvider { } // Add literal values if appropriate. - if (parseNode.nodeType === ParseNodeType.Error) { - if ( - parseNode.category === ErrorExpressionCategory.MissingIndexOrSlice && - parseNode.parent?.nodeType === ParseNodeType.Index - ) { - this._tryAddTypedDictStringLiteral( - parseNode.parent, - /* priorText */ undefined, - /* postText */ undefined, - completionMap - ); - } else if (parseNode.category === ErrorExpressionCategory.MissingExpression) { - if (parseNode.parent && parseNode.parent.nodeType === ParseNodeType.Assignment) { - const declaredTypeOfTarget = this._evaluator.getExpectedType(parseNode)?.type; - if (declaredTypeOfTarget) { - this._addLiteralValuesForTargetType( - declaredTypeOfTarget, - priorText, - priorWord, - postText, - completionMap - ); - } - } - } - } - - if (isIndexArgument) { - // Completion for dict key (ex, dict_variable[]) - const indexNode = parseNode.parent!.parent! as IndexNode; - - this._getIndexerKeys(indexNode, parseNode).forEach((key) => { - if (completionMap.has(key)) { - // Don't add key if it already exists in the completion. - // ex) key = "dictKey" - // dict[key] = 1 - // print(dict[])) - return; - } - - this._addNameToCompletions(key, CompletionItemKind.Constant, priorWord, completionMap, { - sortText: this._makeSortText(SortCategory.LiteralValue, key), - itemDetail: dictionaryKeyDetail, - }); - }); - } + this._tryAddLiterals(parseNode, priorWord, priorText, postText, completionMap); return completionResults; } @@ -1615,15 +1706,15 @@ export class CompletionProvider { } // Add literals that apply to this parameter. - this._addLiteralValuesForArgument(signatureInfo, priorText, priorWord, postText, completionMap); + this._addLiteralValuesForArgument(signatureInfo, priorWord, priorText, postText, completionMap); } } } private _addLiteralValuesForArgument( signatureInfo: CallSignatureInfo, - priorText: string, priorWord: string, + priorText: string, postText: string, completionMap: CompletionMap ) { @@ -1640,19 +1731,19 @@ export class CompletionProvider { } const paramType = type.details.parameters[paramIndex].type; - this._addLiteralValuesForTargetType(paramType, priorText, priorWord, postText, completionMap); + this._addLiteralValuesForTargetType(paramType, priorWord, priorText, postText, completionMap); return undefined; }); } private _addLiteralValuesForTargetType( type: Type, - priorText: string, priorWord: string, + priorText: string, postText: string, completionMap: CompletionMap ) { - const quoteValue = this._getQuoteInfo(priorText); + const quoteValue = this._getQuoteInfo(priorWord, priorText); this._getSubTypesWithLiteralValues(type).forEach((v) => { if (ClassType.isBuiltIn(v, 'str')) { const value = printLiteralValue(v, quoteValue.quoteCharacter); @@ -1663,9 +1754,8 @@ export class CompletionProvider { } else { this._addStringLiteralToCompletions( value.substr(1, value.length - 2), - quoteValue.stringValue, + quoteValue, postText, - quoteValue.quoteCharacter, completionMap ); } @@ -1734,7 +1824,7 @@ export class CompletionProvider { if (member?.symbol.hasDeclarations()) { const declaration = member.symbol.getDeclarations()[0]; if (isFunctionDeclaration(declaration) && declaration.isMethod) { - const getItemType = this._evaluator.getTypeForDeclaration(declaration); + const getItemType = this._evaluator.getTypeForDeclaration(declaration)?.type; if (getItemType && isFunction(getItemType) && getItemType.details.parameters.length === 2) { return getItemType.details.parameters[1].type; } @@ -1745,11 +1835,6 @@ export class CompletionProvider { } private _getIndexerKeys(indexNode: IndexNode, invocationNode: ParseNode) { - if (indexNode.baseExpression.nodeType !== ParseNodeType.Name) { - // This completion only supports simple name case - return []; - } - const baseType = this._evaluator.getType(indexNode.baseExpression); if (!baseType || !isClassInstance(baseType)) { return []; @@ -1779,6 +1864,11 @@ export class CompletionProvider { } } + if (indexNode.baseExpression.nodeType !== ParseNodeType.Name) { + // This completion only supports simple name case + return []; + } + // Must be local variable/parameter const declarations = this._evaluator.getDeclarationsForNameNode(indexNode.baseExpression) ?? []; const declaration = declarations.length > 0 ? declarations[0] : undefined; @@ -1870,135 +1960,257 @@ export class CompletionProvider { private _getLiteralCompletions( parseNode: StringNode | ErrorNode, + offset: number, priorWord: string, priorText: string, postText: string ): CompletionResults | undefined { - let parentNode: ParseNode | undefined = parseNode.parent; + if (this._options.triggerCharacter === '"' || this._options.triggerCharacter === "'") { + if (parseNode.start !== offset - 1) { + // If completion is triggered by typing " or ', it must be the one that starts a string + // literal. In another word, it can't be something inside of another string or comment + return undefined; + } + } - if (!parentNode) { + const completionMap = new CompletionMap(); + if (!this._tryAddLiterals(parseNode, priorWord, priorText, postText, completionMap)) { return undefined; } - const completionMap = new CompletionMap(); + return { completionMap }; + } + + private _tryAddLiterals( + parseNode: ParseNode, + priorWord: string, + priorText: string, + postText: string, + completionMap: CompletionMap + ): boolean { + const parentAndChild = getParentSkippingStringList(parseNode); + if (!parentAndChild) { + return false; + } // See if the type evaluator can determine the expected type for this node. - if (isExpressionNode(parentNode)) { - const expectedTypeResult = this._evaluator.getExpectedType(parentNode); + // ex) a: Literal["str"] = /* here */ + const nodeForExpectedType = + parentAndChild.parent.nodeType === ParseNodeType.Assignment + ? parentAndChild.parent.rightExpression === parentAndChild.child + ? parentAndChild.child + : undefined + : isExpressionNode(parentAndChild.child) + ? parentAndChild.child + : undefined; + + if (nodeForExpectedType) { + const expectedTypeResult = this._evaluator.getExpectedType(nodeForExpectedType); if (expectedTypeResult && isLiteralTypeOrUnion(expectedTypeResult.type)) { this._addLiteralValuesForTargetType( expectedTypeResult.type, - priorText, priorWord, + priorText, postText, completionMap ); - return { completionMap }; + return true; } + } - if (parseNode.nodeType === ParseNodeType.String && parseNode.parent?.parent) { - const stringParent = parseNode.parent.parent; + // ex) a: TypedDictType = { "/* here */" } or a: TypedDictType = { A/* here */ } + const nodeForKey = parentAndChild.parent; + if (nodeForKey) { + // If the dictionary is not yet filled in, it will appear as though it's + // a set initially. + let dictOrSet: DictionaryNode | SetNode | undefined; - // If the dictionary is not yet filled in, it will appear as though it's - // a set initially. - let dictOrSet: DictionaryNode | SetNode | undefined; + if ( + nodeForKey.nodeType === ParseNodeType.DictionaryKeyEntry && + nodeForKey.keyExpression === parentAndChild.child && + nodeForKey.parent?.nodeType === ParseNodeType.Dictionary + ) { + dictOrSet = nodeForKey.parent; + } else if (nodeForKey?.nodeType === ParseNodeType.Set) { + dictOrSet = nodeForKey; + } + if (dictOrSet) { if ( - stringParent.nodeType === ParseNodeType.DictionaryKeyEntry && - stringParent.keyExpression === parseNode.parent && - stringParent.parent?.nodeType === ParseNodeType.Dictionary + this._tryAddTypedDictKeysFromDictionary( + dictOrSet, + parseNode.nodeType === ParseNodeType.String ? parseNode : undefined, + priorWord, + priorText, + postText, + completionMap + ) ) { - dictOrSet = stringParent.parent; - } else if (stringParent?.nodeType === ParseNodeType.Set) { - dictOrSet = stringParent; - } - - if (dictOrSet) { - if (this._addTypedDictKeys(dictOrSet, parseNode, priorText, postText, completionMap)) { - return { completionMap }; - } + return true; } } } - if (parentNode.nodeType !== ParseNodeType.Argument) { - if (parentNode.nodeType !== ParseNodeType.StringList || parentNode.strings.length > 1) { - return undefined; + // a: DictType = { .... } + // a[/* here */] or a['/* here */'] or a[variable/*here*/] + const argument = parentAndChild.parent; + if (argument.nodeType === ParseNodeType.Argument && argument.parent?.nodeType === ParseNodeType.Index) { + const priorTextInString = parseNode.nodeType === ParseNodeType.String ? priorText : ''; + if ( + this._tryAddTypedDictKeysFromIndexer( + argument.parent, + priorWord, + priorTextInString, + postText, + completionMap + ) + ) { + return true; } - parentNode = parentNode.parent; - if (!parentNode) { - return undefined; - } - } + const quoteInfo = this._getQuoteInfo(priorWord, priorTextInString); + const keys = this._getIndexerKeys(argument.parent, parseNode); - if (parentNode.nodeType === ParseNodeType.Argument && parentNode.parent?.nodeType === ParseNodeType.Index) { - const priorTextInString = parseNode.nodeType === ParseNodeType.String ? priorText : ''; - if (!this._tryAddTypedDictStringLiteral(parentNode.parent, priorTextInString, postText, completionMap)) { - const keys = this._getIndexerKeys(parentNode.parent, parseNode); - const quoteValue = this._getQuoteInfo(priorTextInString); + let keyFound = false; + for (const key of keys) { + if (completionMap.has(key)) { + // Don't add key if it already exists in the completion. + // ex) key = "dictKey" + // dict[key] = 1 + // print(dict[])) + continue; + } - for (const key of keys) { - const stringLiteral = /^["|'].*["|']$/.test(key); - if (parseNode.nodeType === ParseNodeType.String && !stringLiteral) { - continue; - } + const stringLiteral = /^["|'].*["|']$/.test(key); + if (parseNode.nodeType === ParseNodeType.String && !stringLiteral) { + continue; + } - if (stringLiteral) { - const keyWithoutQuote = key.substr(1, key.length - 2); + keyFound = true; + if (stringLiteral) { + const keyWithoutQuote = key.substr(1, key.length - 2); - this._addStringLiteralToCompletions( - keyWithoutQuote, - quoteValue.stringValue, - postText, - quoteValue.quoteCharacter, - completionMap, - dictionaryKeyDetail - ); - } else { - this._addNameToCompletions(key, CompletionItemKind.Constant, priorWord, completionMap, { - sortText: this._makeSortText(SortCategory.LiteralValue, key), - itemDetail: dictionaryKeyDetail, - }); - } + this._addStringLiteralToCompletions( + keyWithoutQuote, + quoteInfo, + postText, + completionMap, + dictionaryKeyDetail + ); + } else { + this._addNameToCompletions(key, CompletionItemKind.Constant, priorWord, completionMap, { + sortText: this._makeSortText(SortCategory.LiteralValue, key), + itemDetail: dictionaryKeyDetail, + }); } + } - if (completionMap.size === 0) { - return undefined; - } + if (keyFound) { + return true; } - } else { - debug.assert(parseNode.nodeType === ParseNodeType.String); + } + // if c == "/* here */" + const comparison = parentAndChild.parent; + const supportedOperators = [OperatorType.Assign, OperatorType.Equals, OperatorType.NotEquals]; + if (comparison.nodeType === ParseNodeType.BinaryOperation && supportedOperators.includes(comparison.operator)) { + const type = this._evaluator.getType(comparison.leftExpression); + if (type && isLiteralTypeOrUnion(type)) { + this._addLiteralValuesForTargetType(type, priorWord, priorText, postText, completionMap); + return true; + } + } + + // if c := "/* here */" + const assignmentExpression = parentAndChild.parent; + if ( + assignmentExpression.nodeType === ParseNodeType.AssignmentExpression && + assignmentExpression.rightExpression === parentAndChild.child + ) { + const type = this._evaluator.getType(assignmentExpression.name); + if (type && isLiteralTypeOrUnion(type)) { + this._addLiteralValuesForTargetType(type, priorWord, priorText, postText, completionMap); + return true; + } + } + + // For now, we only support simple cases. no complex pattern matching. + // match c: + // case /* here */ + const caseNode = parentAndChild.parent; + if ( + caseNode.nodeType === ParseNodeType.Case && + caseNode.pattern.nodeType === ParseNodeType.Error && + caseNode.pattern.category === ErrorExpressionCategory.MissingPattern && + caseNode.suite === parentAndChild.child && + caseNode.parent?.nodeType === ParseNodeType.Match + ) { + const type = this._evaluator.getType(caseNode.parent.subjectExpression); + if (type && isLiteralTypeOrUnion(type)) { + this._addLiteralValuesForTargetType(type, priorWord, priorText, postText, completionMap); + return true; + } + } + + // match c: + // case "/* here */" + // case Sym/*here*/ + const patternLiteral = parentAndChild.parent; + if ( + (patternLiteral.nodeType === ParseNodeType.PatternLiteral || + patternLiteral.nodeType === ParseNodeType.PatternCapture) && + patternLiteral.parent?.nodeType === ParseNodeType.PatternAs && + patternLiteral.parent.parent?.nodeType === ParseNodeType.Case && + patternLiteral.parent.parent.parent?.nodeType === ParseNodeType.Match + ) { + const type = this._evaluator.getType(patternLiteral.parent.parent.parent.subjectExpression); + if (type && isLiteralTypeOrUnion(type)) { + this._addLiteralValuesForTargetType(type, priorWord, priorText, postText, completionMap); + return true; + } + } + + if (parseNode.nodeType === ParseNodeType.String) { const offset = convertPositionToOffset(this._position, this._parseResults.tokenizerOutput.lines)!; - const atArgument = parentNode.start < offset && offset < TextRange.getEnd(parseNode); + const atArgument = parseNode.parent!.start < offset && offset < TextRange.getEnd(parseNode); this._addCallArgumentCompletions(parseNode, priorWord, priorText, postText, atArgument, completionMap); + return true; } - return { completionMap }; + return false; + + function getParentSkippingStringList(node: ParseNode): { parent: ParseNode; child: ParseNode } | undefined { + if (!node.parent) { + return undefined; + } + + if (node.nodeType !== ParseNodeType.String) { + return { parent: node.parent, child: node }; + } + + if (!node.parent.parent) { + return undefined; + } + + if (node.parent?.nodeType !== ParseNodeType.StringList || node.parent.strings.length > 1) { + return undefined; + } + + return { parent: node.parent.parent, child: node.parent }; + } } - private _addTypedDictKeys( - dictionaryNode: DictionaryNode | SetNode, - stringNode: StringNode | undefined, + private _tryAddTypedDictKeys( + type: Type, + existingKeys: string[], + priorWord: string, priorText: string, postText: string, completionMap: CompletionMap ) { - const expectedTypeResult = this._evaluator.getExpectedType(dictionaryNode); - if (!expectedTypeResult) { - return false; - } - - // If the expected type result is associated with a node above the - // dictionaryNode in the parse tree, there are no typed dict keys to add. - if (ParseTreeUtils.getNodeDepth(expectedTypeResult.node) < ParseTreeUtils.getNodeDepth(dictionaryNode)) { - return false; - } - let typedDicts: ClassType[] = []; - doForEachSubtype(expectedTypeResult.type, (subtype) => { + doForEachSubtype(type, (subtype) => { if (isClassInstance(subtype) && ClassType.isTypedDictClass(subtype)) { typedDicts.push(subtype); } @@ -2008,15 +2220,10 @@ export class CompletionProvider { return false; } - const keys = this._getDictExpressionStringKeys( - dictionaryNode, - stringNode ? new Set([stringNode.parent?.id]) : undefined - ); - - typedDicts = this._tryNarrowTypedDicts(typedDicts, keys); + typedDicts = this._tryNarrowTypedDicts(typedDicts, existingKeys); - const quoteValue = this._getQuoteInfo(priorText); - const excludes = new Set(keys); + const quoteInfo = this._getQuoteInfo(priorWord, priorText); + const excludes = new Set(existingKeys); typedDicts.forEach((typedDict) => { getTypedDictMembersForClass(this._evaluator, typedDict, /* allowNarrowed */ true).forEach((_, key) => { @@ -2027,21 +2234,40 @@ export class CompletionProvider { excludes.add(key); - this._addStringLiteralToCompletions( - key, - quoteValue ? quoteValue.stringValue : undefined, - postText, - quoteValue - ? quoteValue.quoteCharacter - : this._parseResults.tokenizerOutput.predominantSingleQuoteCharacter, - completionMap - ); + this._addStringLiteralToCompletions(key, quoteInfo, postText, completionMap); }); }); return true; } + private _tryAddTypedDictKeysFromDictionary( + dictionaryNode: DictionaryNode | SetNode, + stringNode: StringNode | undefined, + priorWord: string, + priorText: string, + postText: string, + completionMap: CompletionMap + ) { + const expectedTypeResult = this._evaluator.getExpectedType(dictionaryNode); + if (!expectedTypeResult) { + return false; + } + + // If the expected type result is associated with a node above the + // dictionaryNode in the parse tree, there are no typed dict keys to add. + if (ParseTreeUtils.getNodeDepth(expectedTypeResult.node) < ParseTreeUtils.getNodeDepth(dictionaryNode)) { + return false; + } + + const keys = this._getDictExpressionStringKeys( + dictionaryNode, + stringNode ? new Set([stringNode.parent?.id]) : undefined + ); + + return this._tryAddTypedDictKeys(expectedTypeResult.type, keys, priorWord, priorText, postText, completionMap); + } + private _tryNarrowTypedDicts(types: ClassType[], keys: string[]): ClassType[] { const newTypes = types.flatMap((type) => { const entries = getTypedDictMembersForClass(this._evaluator, type, /* allowNarrowed */ true); @@ -2065,10 +2291,8 @@ export class CompletionProvider { // Find out quotation and string prefix to use for string literals // completion under current context. - private _getQuoteInfo(priorText: string | undefined): { - stringValue: string | undefined; - quoteCharacter: string; - } { + private _getQuoteInfo(priorWord: string, priorText: string): QuoteInfo { + let filterText = priorWord; let stringValue = undefined; let quoteCharacter = this._parseResults.tokenizerOutput.predominantSingleQuoteCharacter; @@ -2076,7 +2300,7 @@ export class CompletionProvider { // ex) typedDict[ |<= here // use default quotation char without any string prefix. if (!this._insideStringLiteral) { - return { stringValue, quoteCharacter }; + return { priorWord, priorText, filterText, stringValue, quoteCharacter }; } const singleQuote = "'"; @@ -2110,13 +2334,18 @@ export class CompletionProvider { quoteCharacter = this._insideStringLiteral.flags & StringTokenFlags.SingleQuote ? doubleQuote : singleQuote; } - return { stringValue, quoteCharacter }; + if (stringValue) { + filterText = stringValue; + } + + return { priorWord, priorText, filterText, stringValue, quoteCharacter }; } - private _tryAddTypedDictStringLiteral( - indexNode: IndexNode | undefined, - priorText: string | undefined, - postText: string | undefined, + private _tryAddTypedDictKeysFromIndexer( + indexNode: IndexNode, + priorWord: string, + priorText: string, + postText: string, completionMap: CompletionMap ) { if (!indexNode) { @@ -2128,46 +2357,18 @@ export class CompletionProvider { return false; } - let foundTypedDict = false; - - doForEachSubtype(baseType, (subtype) => { - if (!isClassInstance(subtype)) { - return; - } - - if (!ClassType.isTypedDictClass(subtype)) { - return; - } - - const entries = getTypedDictMembersForClass(this._evaluator, subtype, /* allowNarrowed */ true); - const quoteValue = this._getQuoteInfo(priorText); - - entries.forEach((_, key) => { - this._addStringLiteralToCompletions( - key, - quoteValue.stringValue, - postText, - quoteValue.quoteCharacter, - completionMap - ); - }); - - foundTypedDict = true; - }); - - return foundTypedDict; + return this._tryAddTypedDictKeys(baseType, [], priorWord, priorText, postText, completionMap); } private _addStringLiteralToCompletions( value: string, - priorString: string | undefined, + quoteInfo: QuoteInfo, postText: string | undefined, - quoteCharacter: string, completionMap: CompletionMap, detail?: string ) { - if (StringUtils.isPatternInSymbol(priorString || '', value)) { - const valueWithQuotes = `${quoteCharacter}${value}${quoteCharacter}`; + if (StringUtils.isPatternInSymbol(quoteInfo.filterText || '', value)) { + const valueWithQuotes = `${quoteInfo.quoteCharacter}${value}${quoteInfo.quoteCharacter}`; if (completionMap.has(valueWithQuotes)) { return; } @@ -2177,15 +2378,17 @@ export class CompletionProvider { completionItem.kind = CompletionItemKind.Constant; completionItem.sortText = this._makeSortText(SortCategory.LiteralValue, valueWithQuotes); let rangeStartCol = this._position.character; - if (priorString !== undefined) { - rangeStartCol -= priorString.length + 1; + if (quoteInfo.stringValue !== undefined) { + rangeStartCol -= quoteInfo.stringValue.length + 1; + } else if (quoteInfo.priorWord) { + rangeStartCol -= quoteInfo.priorWord.length; } // If the text after the insertion point is the closing quote, // replace it. let rangeEndCol = this._position.character; if (postText !== undefined) { - if (postText.startsWith(quoteCharacter)) { + if (postText.startsWith(quoteInfo.quoteCharacter)) { rangeEndCol++; } } @@ -2326,6 +2529,7 @@ export class CompletionProvider { ); }, priorWord, + importFromNode, /* isInImport */ true, /* boundObject */ undefined, completionMap @@ -2335,7 +2539,9 @@ export class CompletionProvider { // Add the implicit imports. importInfo.implicitImports.forEach((implImport) => { if (!importFromNode.imports.find((imp) => imp.name.value === implImport.name)) { - this._addNameToCompletions(implImport.name, CompletionItemKind.Module, priorWord, completionMap); + this._addNameToCompletions(implImport.name, CompletionItemKind.Module, priorWord, completionMap, { + modulePath: implImport.path, + }); } }); @@ -2353,21 +2559,21 @@ export class CompletionProvider { } private _addNamedParameters(signatureInfo: CallSignatureInfo, priorWord: string, completionMap: CompletionMap) { - const argNameMap = new Map(); + const argNameSet = new Set(); signatureInfo.signatures.forEach((signature) => { - this._addNamedParametersToMap(signature.type, argNameMap); + this._addNamedParametersToMap(signature.type, argNameSet); }); // Remove any named parameters that are already provided. signatureInfo.callNode.arguments!.forEach((arg) => { if (arg.name) { - argNameMap.delete(arg.name.value); + argNameSet.delete(arg.name.value); } }); // Add the remaining unique parameter names to the completion list. - argNameMap.forEach((argName) => { + argNameSet.forEach((argName) => { if (StringUtils.isPatternInSymbol(priorWord, argName)) { const label = argName + '='; if (completionMap.has(label)) { @@ -2391,13 +2597,16 @@ export class CompletionProvider { }); } - private _addNamedParametersToMap(type: FunctionType, paramMap: Map) { + private _addNamedParametersToMap(type: FunctionType, names: Set) { type.details.parameters.forEach((param) => { - if (param.name && !param.isNameSynthesized) { + if (isTypedKwargs(param) && param.type.category === TypeCategory.Class) { + // Add param names for unpacked dictionary keys + param.type.details.typedDictEntries?.forEach((_v, k) => names.add(k)); + } else if (param.name && !param.isNameSynthesized) { // Don't add private or protected names. These are assumed // not to be named parameters. if (!SymbolNameUtils.isPrivateOrProtectedName(param.name)) { - paramMap.set(param.name, param.name); + names.add(param.name); } } }); @@ -2415,6 +2624,7 @@ export class CompletionProvider { scope.symbolTable, () => true, priorWord, + node, /* isInImport */ false, /* boundObject */ undefined, completionMap @@ -2441,6 +2651,7 @@ export class CompletionProvider { .some((decl) => decl.type === DeclarationType.Variable); }, priorWord, + node, /* isInImport */ false, /* boundObject */ undefined, completionMap @@ -2460,31 +2671,58 @@ export class CompletionProvider { symbolTable: SymbolTable, includeSymbolCallback: (symbol: Symbol, name: string) => boolean, priorWord: string, + node: ParseNode, isInImport: boolean, boundObjectOrClass: ClassType | undefined, completionMap: CompletionMap ) { + const insideTypeAnnotation = + ParseTreeUtils.isWithinAnnotationComment(node) || + ParseTreeUtils.isWithinTypeAnnotation(node, /*requireQuotedAnnotation*/ false); symbolTable.forEach((symbol, name) => { // If there are no declarations or the symbol is not // exported from this scope, don't include it in the // suggestion list unless we are in the same file. const hidden = - symbol.isExternallyHidden() && + !isVisibleExternally(symbol) && !symbol.getDeclarations().some((d) => isDefinedInFile(d, this._filePath)); if (!hidden && includeSymbolCallback(symbol, name)) { // Don't add a symbol more than once. It may have already been // added from an inner scope's symbol table. if (!completionMap.has(name)) { + // Skip func parens for classes when not a direct assignment or an argument (passed as a value) + const skipForClass = !this._shouldShowAutoParensForClass(symbol, node); this._addSymbol(name, symbol, priorWord, completionMap, { boundObjectOrClass, - funcParensDisabled: isInImport, - extraCommitChars: !isInImport, + funcParensDisabled: isInImport || insideTypeAnnotation || skipForClass, + extraCommitChars: !isInImport && !!priorWord, }); } } }); } + private _shouldShowAutoParensForClass(symbol: Symbol, node: ParseNode) { + if (symbol.getDeclarations().every((d) => d.type !== DeclarationType.Class)) { + // Not actually a class, so yes show parens. + return true; + } + + // If an argument then show parens for classes. + if (node.parent?.nodeType === ParseNodeType.Argument) { + return true; + } + + // Otherwise only show when the class is being assigned to a variable. + const nodeIndex = ParseTreeUtils.getTokenIndexAtLeft(this._parseResults.tokenizerOutput.tokens, node.start); + const prevToken = ParseTreeUtils.getTokenAtIndex(this._parseResults.tokenizerOutput.tokens, nodeIndex); + return ( + prevToken && + prevToken.type === TokenType.Operator && + (prevToken as OperatorToken).operatorType === OperatorType.Assign + ); + } + private _addSymbol( name: string, symbol: Symbol, @@ -2492,12 +2730,6 @@ export class CompletionProvider { completionMap: CompletionMap, detail: SymbolDetail ) { - // If the symbol is a py.typed import that is not supposed to be re-exported, - // don't offer it as a completion suggestion. - if (symbol.isPrivatePyTypedImport()) { - return; - } - let primaryDecl = getLastTypedDeclaredForSymbol(symbol); if (!primaryDecl) { const declarations = symbol.getDeclarations(); @@ -2506,169 +2738,91 @@ export class CompletionProvider { } } - if (primaryDecl) { - let itemKind: CompletionItemKind = CompletionItemKind.Variable; + primaryDecl = primaryDecl + ? this._evaluator.resolveAliasDeclaration(primaryDecl, /* resolveLocalNames */ true) ?? primaryDecl + : undefined; - primaryDecl = this._evaluator.resolveAliasDeclaration(primaryDecl, /* resolveLocalNames */ true); - if (primaryDecl) { - itemKind = this._convertDeclarationTypeToItemKind(primaryDecl); + const autoImportText = detail.autoImportSource + ? this._getAutoImportText(name, detail.autoImportSource, detail.autoImportAlias) + : undefined; + + // Are we resolving a completion item? If so, see if this symbol + // is the one that we're trying to match. + if (this._itemToResolve) { + const completionItemData = fromLSPAny(this._itemToResolve.data); + + if (completionItemData.symbolLabel !== name) { + // It's not what we are looking for. + return; + } - // Handle enum members specially. Enum members normally look like - // variables, but the are declared using assignment expressions - // within an enum class. + if (completionItemData.autoImportText) { if ( - primaryDecl.type === DeclarationType.Variable && - detail.boundObjectOrClass && - isInstantiableClass(detail.boundObjectOrClass) && - ClassType.isEnumClass(detail.boundObjectOrClass) && - primaryDecl.node.parent?.nodeType === ParseNodeType.Assignment + completionItemData.autoImportText === autoImportText?.importText && + detail.edits?.additionalTextEdits ) { - itemKind = CompletionItemKind.EnumMember; + this._itemToResolve.additionalTextEdits = convertToTextEdits(detail.edits.additionalTextEdits); } + return; + } - // Are we resolving a completion item? If so, see if this symbol - // is the one that we're trying to match. - if (this._itemToResolve) { - const completionItemData = fromLSPAny(this._itemToResolve.data); - - if (completionItemData.symbolLabel === name && !completionItemData.autoImportText) { - // This call can be expensive to perform on every completion item - // that we return, so we do it lazily in the "resolve" callback. - const type = this._evaluator.getEffectiveTypeOfSymbol(symbol); - if (type) { - let typeDetail: string | undefined; - let documentation: string | undefined; - - switch (primaryDecl.type) { - case DeclarationType.Intrinsic: - case DeclarationType.Variable: - case DeclarationType.Parameter: - case DeclarationType.TypeParameter: { - let expandTypeAlias = false; - if (type && TypeBase.isInstantiable(type)) { - const typeAliasInfo = getTypeAliasInfo(type); - if (typeAliasInfo) { - if (typeAliasInfo.name === name) { - expandTypeAlias = true; - } - } - } - typeDetail = name + ': ' + this._evaluator.printType(type, expandTypeAlias); - break; - } - - case DeclarationType.Function: { - const functionType = - detail.boundObjectOrClass && (isFunction(type) || isOverloadedFunction(type)) - ? this._evaluator.bindFunctionToClassOrObject( - detail.boundObjectOrClass, - type - ) - : type; - if (functionType) { - if ( - isProperty(functionType) && - detail.boundObjectOrClass && - isClassInstance(detail.boundObjectOrClass) - ) { - const propertyType = - this._evaluator.getGetterTypeFromProperty( - functionType as ClassType, - /* inferTypeIfNeeded */ true - ) || UnknownType.create(); - typeDetail = - name + - ': ' + - this._evaluator.printType(propertyType, /* expandTypeAlias */ false) + - ' (property)'; - } else if (isOverloadedFunction(functionType)) { - // 35 is completion tooltip's default width size - typeDetail = getOverloadedFunctionTooltip( - functionType, - this._evaluator, - /* columnThreshold */ 35 - ); - } else { - typeDetail = - name + - ': ' + - this._evaluator.printType(functionType, /* expandTypeAlias */ false); - } - } - break; - } - - case DeclarationType.Class: - case DeclarationType.SpecialBuiltInClass: { - typeDetail = 'class ' + name + '()'; - break; - } - - case DeclarationType.Alias: { - typeDetail = name; - if (primaryDecl.path) { - const lookupResults = this._importLookup(primaryDecl.path); - if (lookupResults) { - documentation = lookupResults.docString; - } - } - break; - } - - default: { - typeDetail = name; - break; - } - } + // This call can be expensive to perform on every completion item + // that we return, so we do it lazily in the "resolve" callback. + const type = this._evaluator.getEffectiveTypeOfSymbol(symbol); + if (!type) { + // Can't resolve. so bail out. + return; + } - documentation = getDocumentationPartsForTypeAndDecl( - this._sourceMapper, - type, - primaryDecl, - this._evaluator, - symbol, - detail.boundObjectOrClass - ); - - if (this._options.format === MarkupKind.Markdown) { - let markdownString = '```python\n' + typeDetail + '\n```\n'; - - if (documentation) { - markdownString += '---\n'; - markdownString += convertDocStringToMarkdown(documentation); - } - - markdownString = markdownString.trimEnd(); - - this._itemToResolve.documentation = { - kind: MarkupKind.Markdown, - value: markdownString, - }; - } else if (this._options.format === MarkupKind.PlainText) { - let plainTextString = typeDetail + '\n'; - - if (documentation) { - plainTextString += '\n'; - plainTextString += convertDocStringToPlainText(documentation); - } - - plainTextString = plainTextString.trimEnd(); - - this._itemToResolve.documentation = { - kind: MarkupKind.PlainText, - value: plainTextString, - }; - } else { - fail(`Unsupported markup type: ${this._options.format}`); - } - } - } + const typeDetail = getTypeDetail( + this._evaluator, + primaryDecl, + type, + name, + detail, + this._configOptions.functionSignatureDisplay + ); + const documentation = getDocumentationPartsForTypeAndDecl( + this._sourceMapper, + type, + primaryDecl, + this._evaluator, + { + name, + symbol, + boundObjectOrClass: detail.boundObjectOrClass, } + ); + + if (this._options.format === MarkupKind.Markdown || this._options.format === MarkupKind.PlainText) { + this._itemToResolve.documentation = getCompletionItemDocumentation( + typeDetail, + documentation, + this._options.format + ); + } else { + fail(`Unsupported markup type: ${this._options.format}`); } - const autoImportText = detail.autoImportSource - ? this._getAutoImportText(name, detail.autoImportSource, detail.autoImportAlias) - : undefined; + // Bail out. We don't need to add items to completion. + return; + } + + if (primaryDecl) { + let itemKind = this._convertDeclarationTypeToItemKind(primaryDecl); + + // Handle enum members specially. Enum members normally look like + // variables, but the are declared using assignment expressions + // within an enum class. + if ( + primaryDecl.type === DeclarationType.Variable && + detail.boundObjectOrClass && + isInstantiableClass(detail.boundObjectOrClass) && + ClassType.isEnumClass(detail.boundObjectOrClass) && + primaryDecl.node.parent?.nodeType === ParseNodeType.Assignment + ) { + itemKind = CompletionItemKind.EnumMember; + } this._addNameToCompletions(detail.autoImportAlias ?? name, itemKind, priorWord, completionMap, { autoImportText, @@ -2680,7 +2834,7 @@ export class CompletionProvider { // Does the symbol have no declaration but instead has a synthesized type? const synthesizedType = symbol.getSynthesizedType(); if (synthesizedType) { - const itemKind: CompletionItemKind = CompletionItemKind.Variable; + const itemKind: CompletionItemKind = this._convertTypeToItemKind(synthesizedType); this._addNameToCompletions(name, itemKind, priorWord, completionMap, { extraCommitChars: detail.extraCommitChars, funcParensDisabled: detail.funcParensDisabled, @@ -2740,10 +2894,14 @@ export class CompletionProvider { position: this._position, }; - if (detail?.funcParensDisabled) { + if (detail?.funcParensDisabled || !this._options.snippet) { completionItemData.funcParensDisabled = true; } + if (detail?.modulePath) { + completionItemData.modulePath = detail.modulePath; + } + completionItem.data = toLSPAny(completionItemData); if (detail?.sortText || detail?.itemDetail) { @@ -2753,7 +2911,9 @@ export class CompletionProvider { // Force auto-import entries to the end. completionItem.sortText = this._makeSortText( SortCategory.AutoImport, - name, + `${name}.${this._formatInteger(detail.autoImportText.source.length, 2)}.${ + detail.autoImportText.source + }`, detail.autoImportText.importText ); completionItemData.autoImportText = detail.autoImportText.importText; @@ -2847,17 +3007,9 @@ export class CompletionProvider { } if (detail?.edits?.additionalTextEdits) { - completionItem.additionalTextEdits = detail.edits.additionalTextEdits.map((te) => { - const textEdit: TextEdit = { - range: { - start: { line: te.range.start.line, character: te.range.start.character }, - end: { line: te.range.end.line, character: te.range.end.character }, - }, - newText: te.replacementText, - }; - return textEdit; - }); + completionItem.additionalTextEdits = convertToTextEdits(detail.edits.additionalTextEdits); + // This is for auto import entries from indices which skip symbols. if (this._itemToResolve) { const data = fromLSPAny(this._itemToResolve.data); if (data.autoImportText === completionItemData.autoImportText) { @@ -2948,7 +3100,10 @@ export class CompletionProvider { case DeclarationType.Function: { if (this._isPossiblePropertyDeclaration(resolvedDeclaration)) { const functionType = this._evaluator.getTypeOfFunction(resolvedDeclaration.node); - if (functionType && isProperty(functionType.decoratedType)) { + if ( + functionType && + isMaybeDescriptorInstance(functionType.decoratedType, /* requireSetter */ false) + ) { return CompletionItemKind.Property; } } @@ -2964,6 +3119,27 @@ export class CompletionProvider { } } + private _convertTypeToItemKind(type: Type): CompletionItemKind { + switch (type.category) { + case TypeCategory.Module: + return CompletionItemKind.Module; + case TypeCategory.Class: + return CompletionItemKind.Class; + case TypeCategory.Function: + case TypeCategory.OverloadedFunction: + if (isMaybeDescriptorInstance(type, /* requireSetter */ false)) { + return CompletionItemKind.Property; + } + + return CompletionItemKind.Function; + case TypeCategory.TypeVar: + return CompletionItemKind.TypeParameter; + + default: + return CompletionItemKind.Variable; + } + } + private _getImportModuleCompletions(node: ModuleNameNode): CompletionResults { const moduleDescriptor: ImportedModuleDescriptor = { leadingDots: node.leadingDots, @@ -2995,15 +3171,11 @@ export class CompletionProvider { completionMap.set(completionItem); } - completions.forEach((completionName) => { - if (completionMap.has(completionName)) { - return; - } - - const completionItem = CompletionItem.create(completionName); - completionItem.kind = CompletionItemKind.Module; - completionItem.sortText = this._makeSortText(SortCategory.ImportModuleName, completionName); - completionMap.set(completionItem); + completions.forEach((modulePath, completionName) => { + this._addNameToCompletions(completionName, CompletionItemKind.Module, '', completionMap, { + sortText: this._makeSortText(SortCategory.ImportModuleName, completionName), + modulePath, + }); }); return { completionMap }; diff --git a/packages/pyright-internal/src/languageService/completionProviderUtils.ts b/packages/pyright-internal/src/languageService/completionProviderUtils.ts new file mode 100644 index 000000000..d9fb9560a --- /dev/null +++ b/packages/pyright-internal/src/languageService/completionProviderUtils.ts @@ -0,0 +1,176 @@ +/* + * completionProviderUtils.ts + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT license. + * + * Helper functions for providing completions + */ + +import { InsertTextFormat, MarkupContent, MarkupKind, TextEdit } from 'vscode-languageserver-types'; + +import { Declaration, DeclarationType } from '../analyzer/declaration'; +import { convertDocStringToMarkdown, convertDocStringToPlainText } from '../analyzer/docStringConversion'; +import { TypeEvaluator } from '../analyzer/typeEvaluatorTypes'; +import { + ClassType, + getTypeAliasInfo, + isClassInstance, + isFunction, + isModule, + isOverloadedFunction, + Type, + TypeBase, + UnknownType, +} from '../analyzer/types'; +import { isProperty } from '../analyzer/typeUtils'; +import { SignatureDisplayType } from '../common/configOptions'; +import { TextEditAction } from '../common/editAction'; +import { getToolTipForType } from './tooltipUtils'; + +export interface Edits { + format?: InsertTextFormat; + textEdit?: TextEdit; + additionalTextEdits?: TextEditAction[]; +} + +export interface CommonDetail { + funcParensDisabled?: boolean; + edits?: Edits; + extraCommitChars?: boolean; +} + +export interface SymbolDetail extends CommonDetail { + autoImportSource?: string; + autoImportAlias?: string; + boundObjectOrClass?: ClassType; +} + +export interface CompletionDetail extends CommonDetail { + typeDetail?: string; + documentation?: string; + autoImportText?: { + source: string; + importText: string; + }; + sortText?: string; + itemDetail?: string; + modulePath?: string; +} + +export function getTypeDetail( + evaluator: TypeEvaluator, + primaryDecl: Declaration | undefined, + type: Type, + name: string, + detail: SymbolDetail | undefined, + functionSignatureDisplay: SignatureDisplayType +) { + if (!primaryDecl) { + if (isModule(type)) { + // Special casing import modules. + // submodule imported through `import` statement doesn't have + // corresponding decls. so use given name as it is. + // + // ex) import X.Y + // X.[Y] + return name; + } + + return; + } + + switch (primaryDecl.type) { + case DeclarationType.Intrinsic: + case DeclarationType.Variable: + case DeclarationType.Parameter: + case DeclarationType.TypeParameter: { + let expandTypeAlias = false; + if (type && TypeBase.isInstantiable(type)) { + const typeAliasInfo = getTypeAliasInfo(type); + if (typeAliasInfo) { + if (typeAliasInfo.name === name) { + expandTypeAlias = true; + } + } + } + + return name + ': ' + evaluator.printType(type, { expandTypeAlias }); + } + + case DeclarationType.Function: { + const functionType = + detail?.boundObjectOrClass && (isFunction(type) || isOverloadedFunction(type)) + ? evaluator.bindFunctionToClassOrObject(detail.boundObjectOrClass, type) + : type; + if (!functionType) { + return undefined; + } + + if (isProperty(functionType) && detail?.boundObjectOrClass && isClassInstance(detail.boundObjectOrClass)) { + const propertyType = + evaluator.getGetterTypeFromProperty(functionType as ClassType, /* inferTypeIfNeeded */ true) || + UnknownType.create(); + return name + ': ' + evaluator.printType(propertyType) + ' (property)'; + } + + return getToolTipForType( + functionType, + /*label*/ '', + name, + evaluator, + /*isProperty*/ false, + functionSignatureDisplay + ); + } + + case DeclarationType.Class: + case DeclarationType.SpecialBuiltInClass: { + return 'class ' + name + '()'; + } + + case DeclarationType.Alias: { + return name; + } + + default: { + return name; + } + } +} + +export function getCompletionItemDocumentation( + typeDetail: string | undefined, + documentation: string | undefined, + markupKind: MarkupKind +): MarkupContent | undefined { + if (markupKind === MarkupKind.Markdown) { + let markdownString = '```python\n' + typeDetail + '\n```\n'; + + if (documentation) { + markdownString += '---\n'; + markdownString += convertDocStringToMarkdown(documentation); + } + + markdownString = markdownString.trimEnd(); + + return { + kind: MarkupKind.Markdown, + value: markdownString, + }; + } else if (markupKind === MarkupKind.PlainText) { + let plainTextString = typeDetail + '\n'; + + if (documentation) { + plainTextString += '\n'; + plainTextString += convertDocStringToPlainText(documentation); + } + + plainTextString = plainTextString.trimEnd(); + + return { + kind: MarkupKind.PlainText, + value: plainTextString, + }; + } + return undefined; +} diff --git a/packages/pyright-internal/src/languageService/definitionProvider.ts b/packages/pyright-internal/src/languageService/definitionProvider.ts index 1b119f8dc..83f969cb4 100644 --- a/packages/pyright-internal/src/languageService/definitionProvider.ts +++ b/packages/pyright-internal/src/languageService/definitionProvider.ts @@ -22,9 +22,10 @@ import { doForEachSubtype } from '../analyzer/typeUtils'; import { throwIfCancellationRequested } from '../common/cancellationUtils'; import { appendArray } from '../common/collectionUtils'; import { isDefined } from '../common/core'; +import { DeclarationUseCase, Extensions } from '../common/extensibility'; import { convertPositionToOffset } from '../common/positionUtils'; import { DocumentRange, Position, rangesAreEqual } from '../common/textRange'; -import { ParseNodeType } from '../parser/parseNodes'; +import { NameNode, ParseNode, ParseNodeType } from '../parser/parseNodes'; import { ParseResults } from '../parser/parser'; export enum DefinitionFilter { @@ -54,14 +55,40 @@ export class DefinitionProvider { return undefined; } + return DefinitionProvider.getDefinitionsForNode(sourceMapper, node, filter, evaluator, token); + } + + static getDefinitionsForNode( + sourceMapper: SourceMapper, + node: ParseNode, + filter: DefinitionFilter, + evaluator: TypeEvaluator, + token: CancellationToken + ) { const definitions: DocumentRange[] = []; - if (node.nodeType === ParseNodeType.Name) { - const declarations = evaluator.getDeclarationsForNameNode(node); - DefinitionProvider._resolveDeclarations(declarations, evaluator, definitions, sourceMapper); - } else if (node.nodeType === ParseNodeType.String) { - const declarations = evaluator.getDeclarationsForStringNode(node); - DefinitionProvider._resolveDeclarations(declarations, evaluator, definitions, sourceMapper); + // Let extensions have a try first. + Extensions.getProgramExtensions(node).forEach((e) => { + if (e.declarationProviderExtension) { + const declarations = e.declarationProviderExtension.tryGetDeclarations( + evaluator, + node, + DeclarationUseCase.Definition, + token + ); + DefinitionProvider._resolveDeclarations(declarations, evaluator, definitions, sourceMapper); + } + }); + + // There should be only one 'definition', so only if extensions failed should we try again. + if (definitions.length === 0) { + if (node.nodeType === ParseNodeType.Name) { + const declarations = evaluator.getDeclarationsForNameNode(node); + DefinitionProvider._resolveDeclarations(declarations, evaluator, definitions, sourceMapper); + } else if (node.nodeType === ParseNodeType.String) { + const declarations = evaluator.getDeclarationsForStringNode(node); + DefinitionProvider._resolveDeclarations(declarations, evaluator, definitions, sourceMapper); + } } if (definitions.length === 0) { @@ -137,6 +164,11 @@ export class DefinitionProvider { return definitions; } + private static _getDeclarationsForNameNode(node: NameNode, evaluator: TypeEvaluator) { + // Fall back to the evaluator if no extension handled it. + return evaluator.getDeclarationsForNameNode(node) ?? []; + } + private static _resolveDeclarations( declarations: Declaration[] | undefined, evaluator: TypeEvaluator, @@ -175,7 +207,7 @@ export class DefinitionProvider { if (isFunctionDeclaration(resolvedDecl)) { // Handle overloaded function case - const functionType = evaluator.getTypeForDeclaration(resolvedDecl); + const functionType = evaluator.getTypeForDeclaration(resolvedDecl)?.type; if (functionType && isOverloadedFunction(functionType)) { for (const overloadDecl of functionType.overloads .map((o) => o.details.declaration) diff --git a/packages/pyright-internal/src/languageService/documentSymbolCollector.ts b/packages/pyright-internal/src/languageService/documentSymbolCollector.ts index 088023eec..a38ca9004 100644 --- a/packages/pyright-internal/src/languageService/documentSymbolCollector.ts +++ b/packages/pyright-internal/src/languageService/documentSymbolCollector.ts @@ -27,7 +27,9 @@ import { import { getModuleNode, getStringNodeValueRange } from '../analyzer/parseTreeUtils'; import * as ParseTreeUtils from '../analyzer/parseTreeUtils'; import { ParseTreeWalker } from '../analyzer/parseTreeWalker'; +import { ScopeType } from '../analyzer/scope'; import * as ScopeUtils from '../analyzer/scopeUtils'; +import { SourceFile } from '../analyzer/sourceFile'; import { isStubFile, SourceMapper } from '../analyzer/sourceMapper'; import { TypeEvaluator } from '../analyzer/typeEvaluatorTypes'; import { isInstantiableClass, TypeCategory } from '../analyzer/types'; @@ -35,14 +37,29 @@ import { ClassMemberLookupFlags, lookUpClassMember } from '../analyzer/typeUtils import { throwIfCancellationRequested } from '../common/cancellationUtils'; import { appendArray } from '../common/collectionUtils'; import { assert } from '../common/debug'; +import { DeclarationUseCase, Extensions } from '../common/extensibility'; import { TextRange } from '../common/textRange'; -import { ImportAsNode, NameNode, ParseNode, ParseNodeType, StringNode } from '../parser/parseNodes'; +import { + ClassNode, + FunctionNode, + ImportAsNode, + NameNode, + ParseNode, + ParseNodeType, + StringListNode, + StringNode, +} from '../parser/parseNodes'; export type CollectionResult = { node: NameNode | StringNode; range: TextRange; }; +export enum DocumentSymbolCollectorUseCase { + Rename, + Reference, +} + // This walker looks for symbols that are semantically equivalent // to the requested symbol. export class DocumentSymbolCollector extends ParseTreeWalker { @@ -52,13 +69,14 @@ export class DocumentSymbolCollector extends ParseTreeWalker { cancellationToken: CancellationToken, startingNode?: ParseNode, treatModuleInImportAndFromImportSame = false, - skipUnreachableCode = true + skipUnreachableCode = true, + useCase = DocumentSymbolCollectorUseCase.Reference ): CollectionResult[] { - const symbolName = node.value; const declarations = this.getDeclarationsForNode( node, evaluator, /* resolveLocalName */ true, + useCase, cancellationToken ); @@ -68,13 +86,14 @@ export class DocumentSymbolCollector extends ParseTreeWalker { } const collector = new DocumentSymbolCollector( - symbolName, + [node.value], declarations, evaluator, cancellationToken, startingNode, treatModuleInImportAndFromImportSame, - skipUnreachableCode + skipUnreachableCode, + useCase ); return collector.collect(); @@ -84,12 +103,43 @@ export class DocumentSymbolCollector extends ParseTreeWalker { node: NameNode, evaluator: TypeEvaluator, resolveLocalName: boolean, + useCase: DocumentSymbolCollectorUseCase, token: CancellationToken, - sourceMapper?: SourceMapper + sourceMapper?: SourceMapper, + implicitlyImportedBy?: SourceFile[] ): Declaration[] { throwIfCancellationRequested(token); - const declarations = this._getDeclarationsForNode(node, evaluator); + const declarations = this._getDeclarationsForNode( + node, + useCase, + evaluator, + token, + /*skipUnreachableCode*/ false + ); + + // Add declarations from chained source files + let builtinsScope = AnalyzerNodeInfo.getFileInfo(node).builtinsScope; + while (builtinsScope && builtinsScope.type === ScopeType.Module) { + const symbol = builtinsScope?.lookUpSymbol(node.value); + if (symbol) { + declarations.push(...symbol.getDeclarations()); + } + + builtinsScope = builtinsScope?.parent; + } + + // Add declarations from files that implicitly import the target file. + implicitlyImportedBy?.forEach((implicitImport) => { + const parseTree = implicitImport.getParseResults()?.parseTree; + if (parseTree) { + const scope = AnalyzerNodeInfo.getScope(parseTree); + const symbol = scope?.lookUpSymbol(node.value); + if (symbol) { + declarations.push(...symbol.getDeclarations()); + } + } + }); const resolvedDeclarations: Declaration[] = []; declarations.forEach((decl) => { @@ -113,21 +163,41 @@ export class DocumentSymbolCollector extends ParseTreeWalker { private _results: CollectionResult[] = []; private _dunderAllNameNodes = new Set(); + private _initFunction: FunctionNode | undefined; + private _symbolNames: Set = new Set(); constructor( - private _symbolName: string, + symbolNames: string[], private _declarations: Declaration[], private _evaluator: TypeEvaluator, private _cancellationToken: CancellationToken, private _startingNode: ParseNode, private _treatModuleInImportAndFromImportSame = false, - private _skipUnreachableCode = true + private _skipUnreachableCode = true, + private _useCase = DocumentSymbolCollectorUseCase.Reference ) { super(); + // Start with the symbols passed in + symbolNames.forEach((s) => this._symbolNames.add(s)); + // Don't report strings in __all__ right away, that will // break the assumption on the result ordering. this._setDunderAllNodes(this._startingNode); + + // Check if one of our symbols is __init__ and we + // have a class declaration in the list and we are + // computing symbols for references and not rename. + const initDeclaration = _declarations.find( + (d) => d.type === DeclarationType.Function && d.node.name.value === '__init__' + ); + if (initDeclaration && _useCase === DocumentSymbolCollectorUseCase.Reference) { + const classDeclaration = _declarations.find((d) => d.type === DeclarationType.Class); + if (classDeclaration) { + this._initFunction = initDeclaration.node as FunctionNode; + this._symbolNames.add((classDeclaration.node as ClassNode).name.value); + } + } } collect() { @@ -145,20 +215,22 @@ export class DocumentSymbolCollector extends ParseTreeWalker { throwIfCancellationRequested(this._cancellationToken); // No need to do any more work if the symbol name doesn't match. - if (node.value !== this._symbolName) { + if (!this._symbolNames.has(node.value)) { return false; } if (this._declarations.length > 0) { const declarations = DocumentSymbolCollector._getDeclarationsForNode( node, + this._useCase, this._evaluator, + this._cancellationToken, this._skipUnreachableCode ); if (declarations && declarations.length > 0) { // Does this name share a declaration with the symbol of interest? - if (declarations.some((decl) => this._resultsContainsDeclaration(decl))) { + if (declarations.some((decl) => this._resultsContainsDeclaration(decl, node))) { this._addResult(node); } } @@ -170,6 +242,18 @@ export class DocumentSymbolCollector extends ParseTreeWalker { return false; } + override visitStringList(node: StringListNode): boolean { + // See if we have reference that matches this node. + if (this._declarations.some((d) => d.node?.id === node.id)) { + // Then the matching string should be included + const matching = node.strings.find((s) => this._symbolNames.has(s.value)); + if (matching && matching.nodeType === ParseNodeType.String) { + this._addResult(matching); + } + } + return super.visitStringList(node); + } + override visitString(node: StringNode): boolean { throwIfCancellationRequested(this._cancellationToken); @@ -185,7 +269,39 @@ export class DocumentSymbolCollector extends ParseTreeWalker { this._results.push({ node, range }); } - private _resultsContainsDeclaration(declaration: Declaration) { + private _isDeclarationAllowed(resolvedDecl: Declaration, referenceNode: ParseNode) { + // Declaration is allowed if: + // Matches one of our declarations. + // and -- + // That match is the right kind. + const match = this._declarations.find((decl) => + areDeclarationsSame( + decl, + resolvedDecl, + this._treatModuleInImportAndFromImportSame, + /* skipRangeForAliases */ true + ) + ); + if (match) { + // Special case for __init__ being one of our symbol names and we have a classname as the other. + if (this._initFunction) { + // If this is a method, must be an __init__ reference. + if (match.type === DeclarationType.Function) { + return true; + } else if (match.type === DeclarationType.Class) { + // If this is a class type match, only match on class calls. + // Meaning something like so: + // a = ClassA() + return referenceNode.parent?.nodeType === ParseNodeType.Call; + } + return false; + } + return true; + } + return false; + } + + private _resultsContainsDeclaration(declaration: Declaration, referenceNode: ParseNode) { // Resolve the declaration. const resolvedDecl = this._evaluator.resolveAliasDeclaration(declaration, /* resolveLocalNames */ false); if (!resolvedDecl) { @@ -194,11 +310,7 @@ export class DocumentSymbolCollector extends ParseTreeWalker { // The reference results declarations are already resolved, so we don't // need to call resolveAliasDeclaration on them. - if ( - this._declarations.some((decl) => - areDeclarationsSame(decl, resolvedDecl, this._treatModuleInImportAndFromImportSame) - ) - ) { + if (this._isDeclarationAllowed(resolvedDecl, referenceNode)) { return true; } @@ -209,9 +321,7 @@ export class DocumentSymbolCollector extends ParseTreeWalker { return false; } - return this._declarations.some((decl) => - areDeclarationsSame(decl, resolvedDeclNonlocal, this._treatModuleInImportAndFromImportSame) - ); + return this._isDeclarationAllowed(resolvedDeclNonlocal, referenceNode); } private _getResolveAliasDeclaration(declaration: Declaration) { @@ -254,7 +364,7 @@ export class DocumentSymbolCollector extends ParseTreeWalker { } dunderAllInfo.stringNodes.forEach((stringNode) => { - if (stringNode.value !== this._symbolName) { + if (!this._symbolNames.has(stringNode.value)) { return; } @@ -263,7 +373,7 @@ export class DocumentSymbolCollector extends ParseTreeWalker { return; } - if (!symbolInScope.symbol.getDeclarations().some((d) => this._resultsContainsDeclaration(d))) { + if (!symbolInScope.symbol.getDeclarations().some((d) => this._resultsContainsDeclaration(d, stringNode))) { return; } @@ -273,7 +383,14 @@ export class DocumentSymbolCollector extends ParseTreeWalker { private static _addIfUnique(declarations: Declaration[], itemToAdd: Declaration) { for (const def of declarations) { - if (areDeclarationsSame(def, itemToAdd)) { + if ( + areDeclarationsSame( + def, + itemToAdd, + /* treatModuleInImportAndFromImportSame */ false, + /* skipRangeForAliases */ true + ) + ) { return; } } @@ -281,18 +398,69 @@ export class DocumentSymbolCollector extends ParseTreeWalker { declarations.push(itemToAdd); } + private static _getDeclarationsForInitNode(node: NameNode, evaluator: TypeEvaluator): Declaration[] { + const parent = ParseTreeUtils.getEnclosingClassOrFunction(node.parent!); + // See what type of __init__ we're at. + if (parent?.nodeType === ParseNodeType.Class) { + // This is a def for '__init__'. We should include the class name too. + return this._getDeclarationsForNonModuleNameNode(parent.name, evaluator); + } else if ( + node.parent?.nodeType === ParseNodeType.MemberAccess && + ((node.parent.leftExpression.nodeType === ParseNodeType.Call && + node.parent.leftExpression.leftExpression.nodeType === ParseNodeType.Name && + node.parent.leftExpression.leftExpression.value === 'super') || + (node.parent.leftExpression.nodeType === ParseNodeType.Name && + node.parent.leftExpression.value === 'super')) + ) { + // We're on the 'super().__init__' call. + const decls = evaluator.getDeclarationsForNameNode(node, /* skipUnreachableCode */ true); + if (decls && decls.length > 0 && decls[0].node.parent) { + // Parent node of the decl should be the class + const classNode = ParseTreeUtils.getEnclosingClass(decls[0].node.parent); + if (classNode) { + return this._getDeclarationsForNonModuleNameNode(classNode.name, evaluator); + } + } + } + + return []; + } + private static _getDeclarationsForNode( node: NameNode, + useCase: DocumentSymbolCollectorUseCase, evaluator: TypeEvaluator, + token: CancellationToken, skipUnreachableCode = true ): Declaration[] { + let result: Declaration[] = []; + // This can handle symbols brought in by wildcard (import *) as long as the declarations that the symbol collector // compares against point to the actual alias declaration, not one that uses local name (ex, import alias) if (node.parent?.nodeType !== ParseNodeType.ModuleName) { - return this._getDeclarationsForNonModuleNameNode(node, evaluator, skipUnreachableCode); + result = this._getDeclarationsForNonModuleNameNode(node, evaluator, skipUnreachableCode); + + // Special case for __init__. Might be __init__ on a class. + if (node.value === '__init__' && useCase === DocumentSymbolCollectorUseCase.Reference && node.parent) { + result.push(...this._getDeclarationsForInitNode(node, evaluator)); + } + } else { + result = this._getDeclarationsForModuleNameNode(node, evaluator); } - return this._getDeclarationsForModuleNameNode(node, evaluator); + // Let extensions also add declarations. + Extensions.getProgramExtensions(node).forEach((e) => { + const declUseCase = + useCase === DocumentSymbolCollectorUseCase.Rename + ? DeclarationUseCase.Rename + : DeclarationUseCase.References; + const extras = e.declarationProviderExtension?.tryGetDeclarations(evaluator, node, declUseCase, token); + if (extras && extras.length > 0) { + result.push(...extras); + } + }); + + return result; } private static _getDeclarationsForNonModuleNameNode( @@ -343,6 +511,11 @@ export class DocumentSymbolCollector extends ParseTreeWalker { continue; } + // Skip init and new as being overloads. They're not really overloads. + if (methodDecl.node.name.value === '__init__' || methodDecl.node.name.value === '__new__') { + continue; + } + for (const mroClass of classResults.classType.details.mro) { if (isInstantiableClass(mroClass)) { const currentMember = lookUpClassMember(mroClass, methodDecl.node.name.value); diff --git a/packages/pyright-internal/src/languageService/documentSymbolProvider.ts b/packages/pyright-internal/src/languageService/documentSymbolProvider.ts index 333382818..85e445ef4 100644 --- a/packages/pyright-internal/src/languageService/documentSymbolProvider.ts +++ b/packages/pyright-internal/src/languageService/documentSymbolProvider.ts @@ -18,14 +18,13 @@ import { } from 'vscode-languageserver'; import { URI } from 'vscode-uri'; -import { resolveAliasDeclaration } from '../analyzer/aliasDeclarationUtils'; import { AnalyzerFileInfo, ImportLookup } from '../analyzer/analyzerFileInfo'; import * as AnalyzerNodeInfo from '../analyzer/analyzerNodeInfo'; import { AliasDeclaration, Declaration, DeclarationType } from '../analyzer/declaration'; -import { getNameFromDeclaration } from '../analyzer/declarationUtils'; -import { getLastTypedDeclaredForSymbol } from '../analyzer/symbolUtils'; +import { getNameFromDeclaration, resolveAliasDeclaration } from '../analyzer/declarationUtils'; +import { getLastTypedDeclaredForSymbol, isVisibleExternally } from '../analyzer/symbolUtils'; import { TypeEvaluator } from '../analyzer/typeEvaluatorTypes'; -import { isProperty } from '../analyzer/typeUtils'; +import { isMaybeDescriptorInstance } from '../analyzer/typeUtils'; import { throwIfCancellationRequested } from '../common/cancellationUtils'; import { convertOffsetsToRange } from '../common/positionUtils'; import * as StringUtils from '../common/stringUtils'; @@ -58,7 +57,7 @@ export interface IndexResults { export interface IndexOptions { indexingForAutoImportMode: boolean; - forceIndexing?: boolean; + includeAllSymbols?: boolean; } export type WorkspaceSymbolCallback = (symbols: SymbolInformation[]) => void; @@ -179,8 +178,8 @@ function getSymbolKind(name: string, declaration: Declaration, evaluator?: TypeE case DeclarationType.Function: if (declaration.isMethod) { - const declType = evaluator?.getTypeForDeclaration(declaration); - if (declType && isProperty(declType)) { + const declType = evaluator?.getTypeForDeclaration(declaration)?.type; + if (declType && isMaybeDescriptorInstance(declType, /* requireSetter */ false)) { symbolKind = SymbolKind.Property; } else { symbolKind = SymbolKind.Method; @@ -293,6 +292,13 @@ function appendDocumentSymbolsRecursive( continue; } + // It's possible for a name to be '' under certain error + // conditions (such as a decorator with no associated function + // or class). + if (!symbolData.name) { + continue; + } + const children: DocumentSymbol[] = []; appendDocumentSymbolsRecursive(symbolData.children, children, token); @@ -332,7 +338,7 @@ function collectSymbolIndexData( // If we are not py.typed package, symbol must exist in __all__ for auto import mode. if ( options.indexingForAutoImportMode && - !options.forceIndexing && + !options.includeAllSymbols && !fileInfo.isStubFile && !fileInfo.isInPyTypedPackage && !symbol.isInDunderAll() @@ -374,7 +380,7 @@ function collectSymbolIndexData( parseResults, declaration, options, - !symbol.isExternallyHidden(), + isVisibleExternally(symbol), name, indexSymbolData, token diff --git a/packages/pyright-internal/src/languageService/hoverProvider.ts b/packages/pyright-internal/src/languageService/hoverProvider.ts index c0f36a2fb..67cdc090d 100644 --- a/packages/pyright-internal/src/languageService/hoverProvider.ts +++ b/packages/pyright-internal/src/languageService/hoverProvider.ts @@ -18,14 +18,18 @@ import { SourceMapper } from '../analyzer/sourceMapper'; import { TypeEvaluator } from '../analyzer/typeEvaluatorTypes'; import { ClassType, + FunctionType, getTypeAliasInfo, + isAnyOrUnknown, isClassInstance, isFunction, isInstantiableClass, isModule, isOverloadedFunction, isTypeVar, + OverloadedFunctionType, Type, + TypeCategory, UnknownType, } from '../analyzer/types'; import { @@ -35,13 +39,21 @@ import { lookUpClassMember, } from '../analyzer/typeUtils'; import { throwIfCancellationRequested } from '../common/cancellationUtils'; +import { SignatureDisplayType } from '../common/configOptions'; import { assertNever, fail } from '../common/debug'; +import { DeclarationUseCase, Extensions } from '../common/extensibility'; import { convertOffsetToPosition, convertPositionToOffset } from '../common/positionUtils'; +import { hashString } from '../common/stringUtils'; import { Position, Range } from '../common/textRange'; import { TextRange } from '../common/textRange'; -import { NameNode, ParseNode, ParseNodeType, StringNode } from '../parser/parseNodes'; +import { ExpressionNode, isExpressionNode, NameNode, ParseNode, ParseNodeType, StringNode } from '../parser/parseNodes'; import { ParseResults } from '../parser/parser'; -import { getDocumentationPartsForTypeAndDecl, getOverloadedFunctionTooltip } from './tooltipUtils'; +import { + combineExpressionTypes, + getConstructorTooltip, + getDocumentationPartsForTypeAndDecl, + getToolTipForType, +} from './tooltipUtils'; export interface HoverTextPart { python?: boolean; @@ -50,6 +62,7 @@ export interface HoverTextPart { export interface HoverResults { parts: HoverTextPart[]; + lastKnownModule?: string; range: Range; } @@ -60,6 +73,7 @@ export class HoverProvider { position: Position, format: MarkupKind, evaluator: TypeEvaluator, + functionSignatureDisplay: SignatureDisplayType, token: CancellationToken ): HoverResults | undefined { throwIfCancellationRequested(token); @@ -83,7 +97,21 @@ export class HoverProvider { }; if (node.nodeType === ParseNodeType.Name) { - const declarations = evaluator.getDeclarationsForNameNode(node); + // First give extensions a crack at getting a declaration. + let declarations: Declaration[] | undefined = Extensions.getProgramExtensions(node) + .map( + (e) => + e.declarationProviderExtension?.tryGetDeclarations( + evaluator, + node, + DeclarationUseCase.Definition, + token + ) || [] + ) + .flat(); + if (declarations.length === 0) { + declarations = evaluator.getDeclarationsForNameNode(node); + } if (declarations && declarations.length > 0) { // In most cases, it's best to treat the first declaration as the // "primary". This works well for properties that have setters @@ -96,6 +124,13 @@ export class HoverProvider { let primaryDeclaration = declarations[0]; if (primaryDeclaration.type === DeclarationType.Alias && declarations.length > 1) { primaryDeclaration = declarations[1]; + } else if ( + primaryDeclaration.type === DeclarationType.Variable && + declarations.length > 1 && + primaryDeclaration.isDefinedBySlots + ) { + // Slots cannot have docstrings, so pick the secondary. + primaryDeclaration = declarations[1]; } this._addResultsForDeclaration( @@ -104,24 +139,46 @@ export class HoverProvider { results.parts, primaryDeclaration, node, - evaluator + evaluator, + functionSignatureDisplay, + token ); + + // Add the lastKnownModule for this declaration. We'll use this + // in telemetry for hover. + results.lastKnownModule = primaryDeclaration.moduleName; } else if (!node.parent || node.parent.nodeType !== ParseNodeType.ModuleName) { // If we had no declaration, see if we can provide a minimal tooltip. We'll skip // this if it's part of a module name, since a module name part with no declaration // is a directory (a namespace package), and we don't want to provide any hover // information in that case. if (results.parts.length === 0) { - const type = evaluator.getType(node) || UnknownType.create(); + let type = evaluator.getType(node) || UnknownType.create(); - let typeText = ''; + let typeText: string; if (isModule(type)) { // Handle modules specially because submodules aren't associated with // declarations, but we want them to be presented in the same way as // the top-level module, which does have a declaration. typeText = '(module) ' + node.value; } else { - typeText = node.value + ': ' + evaluator.printType(type, /* expandTypeAlias */ false); + type = this._limitOverloadBasedOnCall(node, evaluator, type); + let label = 'function'; + let isProperty = false; + + if (isMaybeDescriptorInstance(type, /* requireSetter */ false)) { + isProperty = true; + label = 'property'; + } + + typeText = getToolTipForType( + type, + label, + node.value, + evaluator, + isProperty, + functionSignatureDisplay + ); } this._addResultsPart(results.parts, typeText, /* python */ true); @@ -151,7 +208,9 @@ export class HoverProvider { parts: HoverTextPart[], declaration: Declaration, node: NameNode, - evaluator: TypeEvaluator + evaluator: TypeEvaluator, + functionSignatureDisplay: SignatureDisplayType, + token: CancellationToken ): void { const resolvedDecl = evaluator.resolveAliasDeclaration(declaration, /* resolveLocalNames */ true); if (!resolvedDecl) { @@ -171,12 +230,15 @@ export class HoverProvider { } case DeclarationType.Variable: { - let label = resolvedDecl.isConstant || resolvedDecl.isFinal ? 'constant' : 'variable'; + let label = + resolvedDecl.isConstant || evaluator.isFinalVariableDeclaration(resolvedDecl) + ? 'constant' + : 'variable'; // If the named node is an aliased import symbol, we can't call // getType on the original name because it's not in the symbol // table. Instead, use the node from the resolved alias. - let typeNode = node; + let typeNode: ParseNode = node; if ( declaration.node.nodeType === ParseNodeType.ImportAs || declaration.node.nodeType === ParseNodeType.ImportFromAs @@ -197,11 +259,24 @@ export class HoverProvider { // Determine if this identifier is a type alias. If so, expand // the type alias when printing the type information. - const type = evaluator.getType(typeNode); + let type = evaluator.getType(typeNode); + + // We may have more type information in the alternativeTypeNode. Use that if it's better. + if ( + (!type || type.category === TypeCategory.Unknown) && + resolvedDecl.alternativeTypeNode && + isExpressionNode(resolvedDecl.alternativeTypeNode) + ) { + const inferredType = evaluator.getType(resolvedDecl.alternativeTypeNode); + if (inferredType && inferredType.category !== TypeCategory.Unknown) { + type = inferredType; + typeNode = resolvedDecl.alternativeTypeNode; + } + } let expandTypeAlias = false; let typeVarName: string | undefined; - if (type?.typeAliasInfo) { + if (type?.typeAliasInfo && typeNode.nodeType === ParseNodeType.Name) { const typeAliasInfo = getTypeAliasInfo(type); if (typeAliasInfo?.name === typeNode.value) { if (isTypeVar(type)) { @@ -221,11 +296,24 @@ export class HoverProvider { } case DeclarationType.Parameter: { - this._addResultsPart( - parts, - '(parameter) ' + node.value + this._getTypeText(node, evaluator), - /* python */ true - ); + if (resolvedDecl.inferredName && resolvedDecl.inferredTypeNodes) { + this._addResultsPart( + parts, + '(parameter) ' + + resolvedDecl.inferredName + + this._getTypesText(resolvedDecl.inferredTypeNodes, evaluator), + /* python */ true + ); + } else { + this._addResultsPart( + parts, + '(parameter) ' + node.value + this._getTypeText(node, evaluator), + /* python */ true + ); + } + if (resolvedDecl.docString) { + this._addResultsPart(parts, resolvedDecl.docString); + } this._addDocumentationPart(format, sourceMapper, parts, node, evaluator, resolvedDecl); break; } @@ -242,45 +330,63 @@ export class HoverProvider { case DeclarationType.Class: case DeclarationType.SpecialBuiltInClass: { - if (this._addInitMethodInsteadIfCallNode(format, node, evaluator, parts, sourceMapper, resolvedDecl)) { + const nameNode = resolvedDecl.type === DeclarationType.Class ? resolvedDecl.node.name : node; + if ( + this._addInitOrNewMethodInsteadIfCallNode( + format, + node, + evaluator, + parts, + sourceMapper, + resolvedDecl, + functionSignatureDisplay + ) + ) { return; } - this._addResultsPart(parts, '(class) ' + node.value, /* python */ true); + this._addResultsPart(parts, '(class) ' + nameNode.value, /* python */ true); this._addDocumentationPart(format, sourceMapper, parts, node, evaluator, resolvedDecl); break; } case DeclarationType.Function: { let label = 'function'; + let isProperty = false; if (resolvedDecl.isMethod) { - const declaredType = evaluator.getTypeForDeclaration(resolvedDecl); - label = - declaredType && isMaybeDescriptorInstance(declaredType, /* requireSetter */ false) - ? 'property' - : 'method'; + const declaredType = evaluator.getTypeForDeclaration(resolvedDecl)?.type; + isProperty = !!declaredType && isMaybeDescriptorInstance(declaredType, /* requireSetter */ false); + label = isProperty ? 'property' : 'method'; } - const type = evaluator.getType(node); - if (type && isOverloadedFunction(type)) { - this._addResultsPart( - parts, - `(${label})\n${getOverloadedFunctionTooltip(type, evaluator)}`, - /* python */ true - ); - } else { - this._addResultsPart( - parts, - `(${label}) ` + node.value + this._getTypeText(node, evaluator), - /* python */ true + let type = evaluator.getType(node); + const resolvedType = + Extensions.getProgramExtensions(resolvedDecl.node) + .map((e) => + e.typeProviderExtension?.tryGetFunctionNodeType(resolvedDecl.node, evaluator, token) + ) + .find((t) => !!t) || evaluator.getType(resolvedDecl.node.name); + type = type === undefined || isAnyOrUnknown(type) ? resolvedType : type; + + if (type) { + type = this._limitOverloadBasedOnCall(node, evaluator, type); + + const signatureString = getToolTipForType( + type, + label, + node.value, + evaluator, + isProperty, + functionSignatureDisplay ); + this._addResultsPart(parts, signatureString, /* python */ true); } - this._addDocumentationPart(format, sourceMapper, parts, node, evaluator, resolvedDecl); break; } case DeclarationType.Alias: { + // First the 'module' header. this._addResultsPart(parts, '(module) ' + node.value, /* python */ true); this._addDocumentationPart(format, sourceMapper, parts, node, evaluator, resolvedDecl); break; @@ -319,11 +425,7 @@ export class HoverProvider { } // e.g. (key) name: str - const text = - '(key) ' + - node.value + - ': ' + - evaluator.printType(entry.valueType, /* expandTypeAlias */ false); + const text = '(key) ' + node.value + ': ' + evaluator.printType(entry.valueType); this._addResultsPart(parts, text, /* python */ true); const declarations = subtype.details.fields.get(node.value)?.getDeclarations(); @@ -348,13 +450,14 @@ export class HoverProvider { }); } - private static _addInitMethodInsteadIfCallNode( + private static _addInitOrNewMethodInsteadIfCallNode( format: MarkupKind, node: NameNode, evaluator: TypeEvaluator, parts: HoverTextPart[], sourceMapper: SourceMapper, - declaration: Declaration + declaration: Declaration, + functionSignatureDisplay: SignatureDisplayType ) { // If the class is used as part of a call (i.e. it is being // instantiated), include the constructor arguments within the @@ -363,11 +466,10 @@ export class HoverProvider { // Allow the left to be a member access chain (e.g. a.b.c) if the // node in question is the last item in the chain. - if ( - callLeftNode.parent && - callLeftNode.parent.nodeType === ParseNodeType.MemberAccess && - node === callLeftNode.parent.memberName - ) { + if (callLeftNode?.parent?.nodeType === ParseNodeType.MemberAccess && node === callLeftNode.parent.memberName) { + callLeftNode = node.parent; + // Allow the left to be a generic class constructor (e.g. foo[int]()) + } else if (callLeftNode?.parent?.nodeType === ParseNodeType.Index) { callLeftNode = node.parent; } @@ -382,50 +484,118 @@ export class HoverProvider { // Get the init method for this class. const classType = evaluator.getType(node); + if (!classType || !isInstantiableClass(classType)) { return false; } - const initMethodMember = lookUpClassMember(classType, '__init__', ClassMemberLookupFlags.SkipInstanceVariables); - - if (!initMethodMember) { + const instanceType = evaluator.getType(callLeftNode.parent); + if (!instanceType || !isClassInstance(instanceType)) { return false; } - const instanceType = evaluator.getType(callLeftNode.parent); - const functionType = evaluator.getTypeOfMember(initMethodMember); + let methodType: Type | undefined; - if (!instanceType || !functionType || !isClassInstance(instanceType) || !isFunction(functionType)) { - return false; + // Try to get the `__init__` method first because it typically has more type information than `__new__`. + // Don't exclude `object.__init__` since in the plain case we want to show Foo(). + const initMember = lookUpClassMember(classType, '__init__', ClassMemberLookupFlags.SkipInstanceVariables); + + if (initMember) { + const functionType = evaluator.getTypeOfMember(initMember); + + if (isFunction(functionType) || isOverloadedFunction(functionType)) { + methodType = evaluator.bindFunctionToClassOrObject(instanceType, functionType); + } } - const initMethodType = evaluator.bindFunctionToClassOrObject(instanceType, functionType); + // If there was no `__init__`, excluding `object` class `__init__`, or if `__init__` only had default params (*args: Any, **kwargs: Any) or no params (), + // see if we can find a better `__new__` method. + if ( + !methodType || + (methodType && + isFunction(methodType) && + (FunctionType.hasDefaultParameters(methodType) || methodType.details.parameters.length === 0)) + ) { + const newMember = lookUpClassMember( + classType, + '__new__', + ClassMemberLookupFlags.SkipObjectBaseClass | ClassMemberLookupFlags.SkipInstanceVariables + ); - if (!initMethodType || !isFunction(initMethodType)) { - return false; + if (newMember) { + const newMemberType = evaluator.getTypeOfMember(newMember); + + // Prefer `__new__` if it doesn't have default params (*args: Any, **kwargs: Any) or no params (). + if (isFunction(newMemberType) || isOverloadedFunction(newMemberType)) { + // Set `treatConstructorAsClassMember` to true to exclude `cls` as a parameter. + methodType = evaluator.bindFunctionToClassOrObject( + instanceType, + newMemberType, + /* memberClass */ undefined, + /* errorNode */ undefined, + /* recursiveCount */ undefined, + /* treatConstructorAsClassMember */ true + ); + } + } } - const functionParts = evaluator.printFunctionParts(initMethodType); - const classText = `${node.value}(${functionParts[0].join(', ')})`; - - this._addResultsPart(parts, '(class) ' + classText, /* python */ true); - const addedDoc = this._addDocumentationPartForType( - format, - sourceMapper, - parts, - initMethodType, - declaration, - evaluator - ); - if (!addedDoc) { - this._addDocumentationPartForType(format, sourceMapper, parts, classType, declaration, evaluator); + if (methodType && (isFunction(methodType) || isOverloadedFunction(methodType))) { + methodType = this._limitOverloadBasedOnCall(node, evaluator, methodType); + this._addResultsPart( + parts, + getConstructorTooltip(node.value, methodType, evaluator, functionSignatureDisplay), + /* python */ true + ); + + const addedDoc = this._addDocumentationPartForType( + format, + sourceMapper, + parts, + methodType, + declaration, + evaluator + ); + + if (!addedDoc) { + this._addDocumentationPartForType(format, sourceMapper, parts, classType, declaration, evaluator); + } + return true; } - return true; + return false; + } + + private static _getTypeText(node: ExpressionNode, evaluator: TypeEvaluator, expandTypeAlias = false): string { + let type = evaluator.getType(node) || UnknownType.create(); + type = this._limitOverloadBasedOnCall(node, evaluator, type); + return ': ' + evaluator.printType(type, { expandTypeAlias }); } - private static _getTypeText(node: NameNode, evaluator: TypeEvaluator, expandTypeAlias = false): string { - const type = evaluator.getType(node) || UnknownType.create(); - return ': ' + evaluator.printType(type, expandTypeAlias); + private static _getTypesText(nodes: ExpressionNode[], evaluator: TypeEvaluator, expandTypeAlias = false): string { + const type = combineExpressionTypes(nodes, evaluator); + return ': ' + evaluator.printType(type, { expandTypeAlias }); + } + + private static _limitOverloadBasedOnCall(node: ExpressionNode, evaluator: TypeEvaluator, type: Type) { + // If it's an overloaded function, see if it's part of a call expression. + // If so, we may be able to eliminate some of the overloads based on + // the overload resolution. + if (isOverloadedFunction(type) && node.nodeType === ParseNodeType.Name) { + const callNode = ParseTreeUtils.getCallForName(node); + if (callNode) { + const callTypeResult = evaluator.getTypeResult(callNode); + + if (callTypeResult?.overloadsUsedForCall && callTypeResult.overloadsUsedForCall.length > 0) { + if (callTypeResult.overloadsUsedForCall.length === 1) { + type = callTypeResult.overloadsUsedForCall[0]; + } else { + type = OverloadedFunctionType.create(callTypeResult.overloadsUsedForCall); + } + } + } + } + + return type; } private static _addDocumentationPart( @@ -437,20 +607,19 @@ export class HoverProvider { resolvedDecl: Declaration | undefined ) { const type = evaluator.getType(node); - if (type) { - this._addDocumentationPartForType(format, sourceMapper, parts, type, resolvedDecl, evaluator); - } + this._addDocumentationPartForType(format, sourceMapper, parts, type, resolvedDecl, evaluator, node.value); } private static _addDocumentationPartForType( format: MarkupKind, sourceMapper: SourceMapper, parts: HoverTextPart[], - type: Type, + type: Type | undefined, resolvedDecl: Declaration | undefined, - evaluator: TypeEvaluator + evaluator: TypeEvaluator, + name?: string ): boolean { - const docString = getDocumentationPartsForTypeAndDecl(sourceMapper, type, resolvedDecl, evaluator); + const docString = getDocumentationPartsForTypeAndDecl(sourceMapper, type, resolvedDecl, evaluator, { name }); if (docString) { this._addDocumentationResultsPart(format, parts, docString); return true; @@ -485,12 +654,16 @@ export class HoverProvider { } } -export function convertHoverResults(format: MarkupKind, hoverResults: HoverResults | undefined): Hover | undefined { +export function convertHoverResults( + format: MarkupKind, + hoverResults: HoverResults | undefined, + includeHash?: boolean +): Hover | undefined { if (!hoverResults) { return undefined; } - const markupString = hoverResults.parts + let markupString = hoverResults.parts .map((part) => { if (part.python) { if (format === MarkupKind.Markdown) { @@ -506,6 +679,12 @@ export function convertHoverResults(format: MarkupKind, hoverResults: HoverResul .join('') .trimEnd(); + // If we have a lastKnownModule in the hover results, stick in a comment with + // the hashed module name. This is used by the other side to send telemetry. + if (hoverResults.lastKnownModule && format === MarkupKind.Markdown && includeHash) { + markupString += `\n`; + } + return { contents: { kind: format, diff --git a/packages/pyright-internal/src/languageService/importAdder.ts b/packages/pyright-internal/src/languageService/importAdder.ts index 0501c23b3..fe3935397 100644 --- a/packages/pyright-internal/src/languageService/importAdder.ts +++ b/packages/pyright-internal/src/languageService/importAdder.ts @@ -16,6 +16,7 @@ import { isClassDeclaration, isFunctionDeclaration, isParameterDeclaration, + isUnresolvedAliasDeclaration, isVariableDeclaration, ModuleLoaderActions, } from '../analyzer/declaration'; @@ -26,10 +27,12 @@ import { } from '../analyzer/declarationUtils'; import { ImportResolver } from '../analyzer/importResolver'; import { + getImportGroupFromModuleNameAndType, getRelativeModuleName, getTextEditsForAutoImportInsertions, getTextEditsForAutoImportSymbolAddition, getTopLevelImports, + ImportGroup, ImportNameInfo, ImportNameWithModuleInfo, ImportStatements, @@ -46,9 +49,11 @@ import { TypeEvaluator } from '../analyzer/typeEvaluatorTypes'; import { throwIfCancellationRequested } from '../common/cancellationUtils'; import { addIfUnique, appendArray, createMapFromItems, getOrAdd, removeArrayElements } from '../common/collectionUtils'; import { ConfigOptions } from '../common/configOptions'; +import { isArray } from '../common/core'; import { TextEditAction } from '../common/editAction'; import { getDirectoryPath } from '../common/pathUtils'; import { convertOffsetToPosition } from '../common/positionUtils'; +import { TextEditTracker } from '../common/textEditTracker'; import { TextRange } from '../common/textRange'; import { ModuleNameNode, NameNode, ParseNode, ParseNodeType } from '../parser/parseNodes'; import { ParseResults } from '../parser/parser'; @@ -78,6 +83,7 @@ export class ImportAdder { applyImports( result: ImportData, + filePath: string, parseResults: ParseResults, insertionPosition: number, importFormat: ImportFormat, @@ -85,14 +91,62 @@ export class ImportAdder { ): TextEditAction[] { throwIfCancellationRequested(token); + const importStatements = getTopLevelImports(parseResults.parseTree); + const importNameInfo = this._getImportNameWithModuleInfo(filePath, result, importFormat); + + const edits: TextEditAction[] = []; + const newNameInfo: ImportNameWithModuleInfo[] = []; + for (const moduleAndInfo of createMapFromItems(importNameInfo, (i) => i.module.moduleName)) { + if (!this._tryProcessExistingImports(moduleAndInfo, importStatements, parseResults, edits)) { + appendArray(newNameInfo, moduleAndInfo[1]); + continue; + } + } + + edits.push( + ...getTextEditsForAutoImportInsertions( + newNameInfo, + importStatements, + parseResults, + convertOffsetToPosition(insertionPosition, parseResults.tokenizerOutput.lines) + ) + ); + + return edits; + } + + applyImportsTo( + result: ImportData, + parseResults: ParseResults, + importFormat: ImportFormat, + textEditTracker: TextEditTracker, + token: CancellationToken + ): void { + throwIfCancellationRequested(token); + const filePath = getFileInfo(parseResults.parseTree).filePath; const importStatements = getTopLevelImports(parseResults.parseTree); - const execEnv = this._configOptions.findExecEnvironment(filePath); + const importNameInfo = this._getImportNameWithModuleInfo(filePath, result, importFormat); + + const newNameInfo: ImportNameWithModuleInfo[] = []; + for (const moduleAndInfo of createMapFromItems(importNameInfo, (i) => i.module.moduleName)) { + if (!this._tryProcessExistingImports(moduleAndInfo, importStatements, parseResults, textEditTracker)) { + appendArray(newNameInfo, moduleAndInfo[1]); + continue; + } + } + + for (const moduleAndInfo of createMapFromItems(newNameInfo, (i) => i.module.moduleName)) { + this._addOrUpdateImport(moduleAndInfo, importStatements, parseResults, moduleAndInfo[1], textEditTracker); + } + } + private _getImportNameWithModuleInfo(filePath: string, result: ImportData, importFormat: ImportFormat) { const importNameInfo: ImportNameWithModuleInfo[] = []; + const execEnv = this._configOptions.findExecEnvironment(filePath); for (const decl of result.declarations.keys() ?? []) { const importInfo = this._getImportInfo(decl, filePath); - if (!importInfo) { + if (!importInfo || isUnresolvedAliasDeclaration(decl)) { continue; } @@ -120,33 +174,14 @@ export class ImportAdder { (a, b) => this._areSame(a, b) ); } - - const edits: TextEditAction[] = []; - const newNameInfo: ImportNameWithModuleInfo[] = []; - for (const moduleAndInfo of createMapFromItems(importNameInfo, (i) => i.module.moduleName)) { - if (!this._tryProcessExistingImports(moduleAndInfo, importStatements, parseResults, edits)) { - appendArray(newNameInfo, moduleAndInfo[1]); - continue; - } - } - - edits.push( - ...getTextEditsForAutoImportInsertions( - newNameInfo, - importStatements, - parseResults, - convertOffsetToPosition(insertionPosition, parseResults.tokenizerOutput.lines) - ) - ); - - return edits; + return importNameInfo; } private _tryProcessExistingImports( moduleAndInfo: [string, ImportNameWithModuleInfo[]], importStatements: ImportStatements, parseResults: ParseResults, - edits: TextEditAction[] + edits: TextEditAction[] | TextEditTracker ) { for (const kindAndImports of createMapFromItems( importStatements.orderedImports.filter((i) => i.moduleName === moduleAndInfo[0]), @@ -171,7 +206,12 @@ export class ImportAdder { n.node.imports.some((i) => i.name.value === m.name && i.alias?.value === m.alias) ) ); - appendArray(edits, getTextEditsForAutoImportSymbolAddition(info, imported[0], parseResults)); + + if (isArray(edits)) { + appendArray(edits, getTextEditsForAutoImportSymbolAddition(info, imported[0], parseResults)); + } else { + this._addOrUpdateImport(moduleAndInfo, importStatements, parseResults, info, edits); + } return true; } @@ -188,6 +228,27 @@ export class ImportAdder { return false; } + private _addOrUpdateImport( + moduleAndInfo: [string, ImportNameWithModuleInfo[]], + importStatements: ImportStatements, + parseResults: ParseResults, + info: ImportNameWithModuleInfo[], + editTracker: TextEditTracker + ) { + if (info.length === 0) { + return; + } + + const name = moduleAndInfo[0]; + const nameForImportFrom = moduleAndInfo[1].length === 0 ? undefined : moduleAndInfo[1][0].nameForImportFrom; + const importGroup = + moduleAndInfo[1].length === 0 + ? ImportGroup.Local + : getImportGroupFromModuleNameAndType(moduleAndInfo[1][0].module); + + editTracker.addOrUpdateImport(parseResults, importStatements, { name, nameForImportFrom }, importGroup, info); + } + private _getImportInfo( decl: Declaration, destFilePath: string @@ -318,6 +379,10 @@ class NameCollector extends ParseTreeWalker { } override visitName(name: NameNode) { + if (!TextRange.containsRange(this._range, name)) { + return false; + } + throwIfCancellationRequested(this._token); // We process dotted name as a whole rather than diff --git a/packages/pyright-internal/src/languageService/importSorter.ts b/packages/pyright-internal/src/languageService/importSorter.ts index 17094bd18..d9143dc8f 100644 --- a/packages/pyright-internal/src/languageService/importSorter.ts +++ b/packages/pyright-internal/src/languageService/importSorter.ts @@ -5,7 +5,7 @@ * Author: Eric Traut * * Provides code that sorts and formats import statements within a - * python source file. + * Python source file. */ import { CancellationToken } from 'vscode-languageserver'; diff --git a/packages/pyright-internal/src/languageService/indentationUtils.ts b/packages/pyright-internal/src/languageService/indentationUtils.ts index 42fd61ff7..51532ecc1 100644 --- a/packages/pyright-internal/src/languageService/indentationUtils.ts +++ b/packages/pyright-internal/src/languageService/indentationUtils.ts @@ -3,13 +3,15 @@ * Copyright (c) Microsoft Corporation. * Licensed under the MIT license. * - * Provides code to get indentation and re-indent code to the given indentation. + * Provides code to get indentation and re-indent code for the + * given indentation. */ import Char from 'typescript-char'; import { findNodeByOffset, + getFirstAncestorOrSelf, getFirstAncestorOrSelfOfKind, getStringValueRange, getTokenAt, @@ -19,7 +21,7 @@ import { appendArray } from '../common/collectionUtils'; import { convertOffsetToPosition, convertTextRangeToRange } from '../common/positionUtils'; import { Range, TextRange } from '../common/textRange'; import { TextRangeCollection } from '../common/textRangeCollection'; -import { ModuleNode, ParseNode, ParseNodeType, SuiteNode } from '../parser/parseNodes'; +import { MatchNode, ModuleNode, ParseNode, ParseNodeType, SuiteNode } from '../parser/parseNodes'; import { ParseResults } from '../parser/parser'; import { defaultTabSize } from '../parser/tokenizer'; import { @@ -42,11 +44,15 @@ interface TokenInfo extends TextRange { multilineDocComment: boolean; } -export function getIndentation(parseResults: ParseResults, offset: number, preferDedent?: boolean): number { +export function getNewlineIndentation( + parseResults: ParseResults, + newlineOffset: number, + preferDedent?: boolean +): number { // ex) // a = """ // | <= here - const strIndent = _tryHandleStringLiterals(parseResults, offset); + const strIndent = _tryHandleStringLiterals(parseResults, newlineOffset); if (strIndent !== undefined) { return strIndent; } @@ -57,13 +63,13 @@ export function getIndentation(parseResults: ParseResults, offset: number, prefe // or // a = (1 + // | <= here - const exprIndent = _tryHandleMultilineConstructs(parseResults, offset); + const exprIndent = _tryHandleMultilineConstructs(parseResults, newlineOffset); if (exprIndent !== undefined) { return exprIndent; } - preferDedent = preferDedent ?? _shouldDedentAfterKeyword(parseResults.tokenizerOutput.tokens, offset); - return Math.max(_getIndentation(parseResults, offset, preferDedent).indentation, 0); + preferDedent = preferDedent ?? _shouldDedentAfterKeyword(parseResults, newlineOffset); + return Math.max(_getIndentation(parseResults, newlineOffset, preferDedent).indentation, 0); } export function reindentSpan( @@ -76,7 +82,7 @@ export function reindentSpan( const texts: string[] = []; // Currently _convertTokenStreams converts text in the span as whitespace and non whitespace - // and then this function puts those back to string with reidentation if needed. + // and then this function puts those back to string with reindentation if needed. // // Another approach we can take is converting the text in 2 chunks that require reindentation and not // and process chunks that require reindentation line by line (like how it currently does for @@ -86,14 +92,14 @@ export function reindentSpan( indentDelta = indentation - - _getIndentationFromText(parseResults, previousInfo.range.start.line, previousInfo.range.start.character) + getIndentationFromText(parseResults, previousInfo.range.start.line, previousInfo.range.start.character) .indentation; if (previousInfo.multilineDocComment) { appendArray(texts, _reindentLinesFromText(parseResults, previousInfo, indentDelta)); } else { if (indentFirstToken) { - texts.push(_createIndentationString(parseResults, indentation)); + texts.push(createIndentationString(parseResults, indentation)); } texts.push(previousInfo.text); @@ -113,11 +119,11 @@ export function reindentSpan( } else { // Put indentation for the first token on the line. texts.push( - _createIndentationString( + createIndentationString( parseResults, Math.max( 0, - _getIndentationFromText(parseResults, info.range.start.line, info.range.start.character) + getIndentationFromText(parseResults, info.range.start.line, info.range.start.character) .indentation + indentDelta ) ) @@ -134,7 +140,18 @@ export function reindentSpan( previousInfo = info; } - return texts.join(''); + return { + originalSpan: TextRange.combine(tokenInfo)!, + text: texts.join(''), + }; +} + +export function getModuleStatementIndentation(parseResults: ParseResults) { + if (parseResults.parseTree.statements.length === 0) { + return getNewlineIndentation(parseResults, parseResults.parseTree.length, /* preferDedent */ true); + } + + return getNewlineIndentation(parseResults, parseResults.parseTree.statements[0].start, /* preferDedent */ true); } function _getIndentation( @@ -143,7 +160,7 @@ function _getIndentation( preferDedent: boolean ): { token?: Token; indentation: number } { const tokens = parseResults.tokenizerOutput.tokens; - const startingToken = _findPreviousNonWhitespaceToken(tokens, offset); + const startingToken = findNonWhitespaceTokenAtOrBeforeOffset(tokens, offset); if (!startingToken) { return { indentation: 0, @@ -157,38 +174,57 @@ function _getIndentation( }; } + // Special-case the match statement since it does not contain a suite. Case statements do, + // but match does not. + if (node.nodeType === ParseNodeType.Match) { + const tabSize = _getTabSize(parseResults); + const outerContainer = getContainer(node, /*includeSelf*/ false); + const result = _getIndentationForNode(parseResults, offset, outerContainer ?? parseResults.parseTree, node); + result.indentation += tabSize; + return result; + } + const suite = getFirstAncestorOrSelfOfKind(node, ParseNodeType.Suite); if (!suite) { - return _getIndentationForNode(parseResults, parseResults.parseTree, node); + return _getIndentationForNode(parseResults, offset, parseResults.parseTree, node); } const suiteSpan = convertTextRangeToRange(suite, parseResults.tokenizerOutput.lines); - if (preferDedent || suiteSpan.start.line === suiteSpan.end.line) { + if (preferDedent || (suiteSpan.start.line === suiteSpan.end.line && suite.statements.length > 0)) { // Go one more level up. const outerContainer = getContainer(suite, /*includeSelf*/ false); - return _getIndentationForNode(parseResults, outerContainer ?? parseResults.parseTree, suite); + return _getIndentationForNode(parseResults, offset, outerContainer ?? parseResults.parseTree, suite); } - return _getIndentationForNode(parseResults, suite, node); + return _getIndentationForNode(parseResults, offset, suite, node); } function _getIndentationForNode( parseResults: ParseResults, - container: ModuleNode | SuiteNode, + offset: number, + container: ModuleNode | SuiteNode | MatchNode, current: ParseNode ): { token?: Token; indentation: number } { if (container.nodeType === ParseNodeType.Module) { // It is at the module level return { - token: _getFirstTokenOFStatement(parseResults, container, current), + token: _getFirstTokenOfStatement(parseResults, container, current), indentation: 0, }; } - if (_containsNoIndentBeforeFirstStatement(parseResults, container)) { + if ( + container.nodeType === ParseNodeType.Match || + _containsNoIndentBeforeFirstStatement(parseResults, offset, container) + ) { const tabSize = _getTabSize(parseResults); const outerContainer = getContainer(container, /*includeSelf*/ false); - const result = _getIndentationForNode(parseResults, outerContainer ?? parseResults.parseTree, container); + const result = _getIndentationForNode( + parseResults, + offset, + outerContainer ?? parseResults.parseTree, + container + ); return { token: result.token, indentation: result.indentation + tabSize, @@ -196,14 +232,15 @@ function _getIndentationForNode( } else { const tokens = parseResults.tokenizerOutput.tokens; return { - token: _getFirstTokenOFStatement(parseResults, container, current), + token: _getFirstTokenOfStatement(parseResults, container, current), indentation: _getIndentationFromIndentToken(tokens, tokens.getItemAtPosition(container.start)), }; } } -function _containsNoIndentBeforeFirstStatement(parseResults: ParseResults, suite: SuiteNode): boolean { - if (suite.statements.filter((s) => s.length > 0).length === 0) { +function _containsNoIndentBeforeFirstStatement(parseResults: ParseResults, offset: number, suite: SuiteNode): boolean { + const statements = suite.statements.filter((s) => s.length > 0); + if (statements.length === 0) { // There is no statement in the suite. // ex) // def foo(): @@ -211,6 +248,22 @@ function _containsNoIndentBeforeFirstStatement(parseResults: ParseResults, suite return true; } + if (statements.length === 1) { + if (statements[0].nodeType !== ParseNodeType.StatementList || statements[0].statements.length === 1) { + if (statements[0].start >= offset) { + const statementLine = parseResults.tokenizerOutput.lines.getItemAtPosition(statements[0].start); + const offsetLine = parseResults.tokenizerOutput.lines.getItemAtPosition(offset); + if (statementLine === offsetLine) { + // We are calculating indent for only statement in suite. + // ex) + // def foo(): + // |pass <= offset before first statement + return true; + } + } + } + } + // If suite contains no indent before first statement, then consider user is in the middle of writing block // and parser is in broken state. // ex) @@ -235,7 +288,7 @@ function _containsNoIndentBeforeFirstStatement(parseResults: ParseResults, suite return true; } -function _getFirstTokenOFStatement( +function _getFirstTokenOfStatement( parseResults: ParseResults, container: ModuleNode | SuiteNode, span: TextRange @@ -266,6 +319,7 @@ function _getIndentationFromIndentToken(tokens: TextRangeCollection, inde function _tryHandleMultilineConstructs(parseResults: ParseResults, offset: number): number | undefined { const tokens = parseResults.tokenizerOutput.tokens; + const lines = parseResults.tokenizerOutput.lines; // Make sure we use next token to get line delta. // This is just to handle how tokenizer associates new lines to which token. @@ -277,9 +331,6 @@ function _tryHandleMultilineConstructs(parseResults: ParseResults, offset: numbe return undefined; } - const lines = parseResults.tokenizerOutput.lines; - const tabSize = _getTabSize(parseResults); - for (let i = index; i > 0; i--) { const token = _getTokenAtIndex(tokens, i)!; if (TextRange.getEnd(token) < offset) { @@ -293,35 +344,10 @@ function _tryHandleMultilineConstructs(parseResults: ParseResults, offset: numbe if ( tokenSpan && previousTokenSpan && - previousTokenSpan.end.line < tokenSpan.start.line && + previousTokenSpan.start.line < tokenSpan.start.line && previousToken!.type !== TokenType.NewLine ) { - const indentationResult = _getIndentation(parseResults, previousToken!.start, /* preferDedent */ false); - const currentPosition = convertOffsetToPosition(offset, lines); - - // Handle multiline constructs (explicit or implicit) - // ex) def foo \ - // | <= here - // or - // i = \ - // \ - // | <= here - // or - // a = ( - // | <= here - const lineDelta = - currentPosition.line - - (indentationResult.token - ? convertOffsetToPosition(indentationResult.token.start, lines).line - : previousTokenSpan.start.line); - - const indentation = _getFirstNonBlankLineIndentationFromText( - parseResults, - currentPosition.line, - previousTokenSpan.start.line - ); - - return indentation + (lineDelta === 1 ? tabSize : 0); + return _getIndentationForNextLine(parseResults, previousToken, token, offset); } } @@ -367,10 +393,97 @@ function _tryHandleStringLiterals(parseResults: ParseResults, offset: number): n return _getFirstNonBlankLineIndentationFromText(parseResults, current.line, begin.line); } +function _isOpenToken(token: Token) { + return ( + token.type === TokenType.OpenParenthesis || + token.type === TokenType.OpenBracket || + token.type === TokenType.OpenCurlyBrace + ); +} + +function _isCloseToken(token: Token) { + return ( + token.type === TokenType.CloseParenthesis || + token.type === TokenType.CloseBracket || + token.type === TokenType.CloseCurlyBrace + ); +} + +function _getIndentationForNextLine(parseResults: ParseResults, prevToken: Token, nextToken: Token, offset: number) { + // Get the last token on the same line as the previous token + const lines = parseResults.tokenizerOutput.lines; + const lineIndex = convertOffsetToPosition(prevToken.start, lines).line; + const line = lines.getItemAt(lineIndex); + const tabSize = _getTabSize(parseResults); + let token: Token | undefined = prevToken; + + // Go backwards through tokens up until the front of the line + let whitespaceOnly = true; + let closeCount = 0; + while (token && token.start >= line.start) { + if (_isCloseToken(token)) { + whitespaceOnly = false; + closeCount += 1; + } else if (_isOpenToken(token) && closeCount === 0) { + // Special case for parenthesis + if (token.type === TokenType.OpenParenthesis && whitespaceOnly) { + const baseIndentation = _getIndentation(parseResults, token.start, false).indentation; + + // In PEP 8, this should be this case here: + // # Add 4 spaces (an extra level of indentation) to distinguish arguments from the rest. + // def long_function_name( + // var_one, var_two, var_three, + // var_four): + // print(var_one) + // + const node = findNodeByOffset(parseResults.parseTree, token.start - 1); + const funcNode = getFirstAncestorOrSelfOfKind(node, ParseNodeType.Function); + if ( + funcNode && + funcNode.nodeType === ParseNodeType.Function && + convertOffsetToPosition(funcNode.start, lines).line === lineIndex + ) { + return baseIndentation + tabSize * 2; + } + + // Not inside a function, just need one tab. See this in PEP 8 + // # Hanging indents should add a level. + // foo = long_function_name( + // var_one, var_two, + // var_three, var_four) + return baseIndentation + tabSize; + } else if (whitespaceOnly) { + return _getIndentation(parseResults, token.start, false).indentation + tabSize; + } else { + // In PEP 8, this should be this case here: + // # Aligned with opening delimiter. + // def long_function_name(var_one, var_two, + // var_three, var_four) + // + 1 is to accommodate for the parenthesis. + return token.start - line.start + 1; + } + } else if (_isOpenToken(token) && closeCount > 0) { + closeCount--; + whitespaceOnly = false; + } else if (!_isWhitespaceToken(token.type)) { + // Found a non whitespace token before we returned. + whitespaceOnly = false; + } + token = findNonWhitespaceTokenAtOrBeforeOffset(parseResults.tokenizerOutput.tokens, token.start - 1); + } + + // No parenthesis found + return _getFirstNonBlankLineIndentationFromText( + parseResults, + convertOffsetToPosition(offset, parseResults.tokenizerOutput.lines).line, + lineIndex + ); +} + function _getFirstNonBlankLineIndentationFromText(parseResults: ParseResults, currentLine: number, endingLine: number) { endingLine = Math.max(endingLine, 0); for (let i = currentLine; i >= endingLine; i--) { - const result = _getIndentationFromText(parseResults, i); + const result = getIndentationFromText(parseResults, i); if (!_isBlankLine(parseResults, i, result.charOffset)) { // Not blank line. @@ -379,11 +492,11 @@ function _getFirstNonBlankLineIndentationFromText(parseResults: ParseResults, cu } } - return _getIndentationFromText(parseResults, endingLine).indentation; + return getIndentationFromText(parseResults, endingLine).indentation; } function _findStringToken(tokens: TextRangeCollection, index: number): Token | undefined { - const token = _findPreviousNonWhitespaceTokenFromIndex(tokens, index); + const token = _findNonWhitespaceTokenAtOrBeforeIndex(tokens, index); if (!token) { return undefined; } @@ -391,19 +504,19 @@ function _findStringToken(tokens: TextRangeCollection, index: number): To return token.type === TokenType.String ? token : undefined; } -function _findPreviousNonWhitespaceToken(tokens: TextRangeCollection, offset: number): Token | undefined { +export function findNonWhitespaceTokenAtOrBeforeOffset( + tokens: TextRangeCollection, + offset: number +): Token | undefined { const index = tokens.getItemAtPosition(offset); if (index < 0) { return undefined; } - return _findPreviousNonWhitespaceTokenFromIndex(tokens, index); + return _findNonWhitespaceTokenAtOrBeforeIndex(tokens, index); } -function _findPreviousNonWhitespaceTokenFromIndex( - tokens: TextRangeCollection, - index: number -): Token | undefined { +function _findNonWhitespaceTokenAtOrBeforeIndex(tokens: TextRangeCollection, index: number): Token | undefined { for (let i = index; i >= 0; i--) { const token = _getTokenAtIndex(tokens, i); if (!token) { @@ -446,11 +559,11 @@ function _getTokenAtIndex(tokens: TextRangeCollection, index: number) { return tokens.getItemAt(index); } -function _shouldDedentAfterKeyword(tokens: TextRangeCollection, offset: number) { - // Keeping the PTVS smart indenter behavior. +function _shouldDedentAfterKeyword(parseResults: ParseResults, offset: number) { // For now, we won't include all small statements that can put at single line. // See parser.ts to see all small statements or see python grammar. // ex) def foo(): pass + const tokens = parseResults.tokenizerOutput.tokens; const index = tokens.getItemAtPosition(offset); if (index < 0) { return false; @@ -477,18 +590,36 @@ function _shouldDedentAfterKeyword(tokens: TextRangeCollection, offset: n } const keyword = token as KeywordToken; - return ( + // Dedent if we found one of these keywords + if ( keyword.keywordType === KeywordType.Pass || keyword.keywordType === KeywordType.Return || keyword.keywordType === KeywordType.Break || keyword.keywordType === KeywordType.Continue || keyword.keywordType === KeywordType.Raise - ); - } + ) { + return true; + } - default: - return false; + // Otherwise, unless the keyword can be used as a return/raise value, don't dedent. + if ( + keyword.keywordType !== KeywordType.True && + keyword.keywordType !== KeywordType.False && + keyword.keywordType !== KeywordType.None && + keyword.keywordType !== KeywordType.Debug + ) { + return false; + } + } } + + // Dedent if we've found a return or raise statement + const node = findNodeByOffset(parseResults.parseTree, token.start); + const returnOrRaise = getFirstAncestorOrSelf( + node, + (x) => x.nodeType === ParseNodeType.Return || x.nodeType === ParseNodeType.Raise + ); + return !!returnOrRaise; } return false; @@ -523,7 +654,7 @@ function _getLineEndingLength(parseResults: ParseResults, line: number) { return length; } -function _getIndentationFromText( +export function getIndentationFromText( parseResults: ParseResults, line: number, uptoLineOffset?: number @@ -580,7 +711,7 @@ function _convertTokenStreams(parseResults: ParseResults, span: TextRange) { let endIndex = Math.min(tokens.getItemAtPosition(TextRange.getEnd(span)), tokens.length - 1); const endToken = _getTokenAtIndex(tokens, endIndex)!; - if (TextRange.getEnd(span) < endToken.start) { + if (TextRange.getEnd(span) <= endToken.start) { // ex) |< = span end [endToken] endIndex--; } @@ -631,6 +762,12 @@ function _convertTokenStreams(parseResults: ParseResults, span: TextRange) { // Handle text in whitespace that is not part of token stream. let previousInfo = tokenInfoArray[0]; const additionalTokens: TokenInfo[] = []; + if (previousInfo.kind === 'comment') { + // ex) token [#] comment + const start = startIndex === 0 ? 0 : TextRange.getEnd(_getTokenAtIndex(tokens, startIndex - 1)!); + _addTokenInfoIfMatch(parseResults, start, previousInfo.start, Char.Hash, additionalTokens); + } + for (let i = 1; i < tokenInfoArray.length; i++) { const info = tokenInfoArray[i]; @@ -677,9 +814,13 @@ function _convertTokenStreams(parseResults: ParseResults, span: TextRange) { // It is the first token in the file. previousInfo.firstTokenOnLine = true; } else { - const previousToken = _findPreviousNonWhitespaceTokenFromIndex(tokens, startIndex - 1)!; - const previousEnd = convertOffsetToPosition(TextRange.getEnd(previousToken), lines); - previousInfo.firstTokenOnLine = previousEnd.line !== previousInfo.range.start.line; + const previousNonWhitespaceToken = _findNonWhitespaceTokenAtOrBeforeIndex(tokens, startIndex - 1); + if (previousNonWhitespaceToken) { + const previousEnd = convertOffsetToPosition(TextRange.getEnd(previousNonWhitespaceToken), lines); + previousInfo.firstTokenOnLine = previousEnd.line !== previousInfo.range.start.line; + } else { + previousInfo.firstTokenOnLine = true; + } } previousInfo.multilineDocComment = _isMultilineDocComment(parseResults, previousInfo); @@ -764,7 +905,7 @@ function _reindentLineFromText( indentDelta: number, range?: TextRange ): string { - const result = _getIndentationFromText(parseResults, line); + const result = getIndentationFromText(parseResults, line); if (_isBlankLine(parseResults, line, result.charOffset)) { return ''; } @@ -778,7 +919,7 @@ function _reindentLineFromText( } const text = parseResults.text.substr(lineRange.start + result.charOffset, lineRange.length - result.charOffset); - return _createIndentationString(parseResults, Math.max(result.indentation + indentDelta, 0)) + text; + return createIndentationString(parseResults, Math.max(result.indentation + indentDelta, 0)) + text; } function _getTabSize(parseResults: ParseResults) { @@ -792,7 +933,7 @@ function _getTabSize(parseResults: ParseResults) { return tabLength; } -function _createIndentationString(parseResults: ParseResults, indentation: number) { +export function createIndentationString(parseResults: ParseResults, indentation: number) { const tab = parseResults.tokenizerOutput.predominantTabSequence; const tabLength = tab.length; if (tabLength === 1 && tab.charCodeAt(0) === Char.Tab) { diff --git a/packages/pyright-internal/src/languageService/insertionPointUtils.ts b/packages/pyright-internal/src/languageService/insertionPointUtils.ts index ad8a1a5bc..16aece31f 100644 --- a/packages/pyright-internal/src/languageService/insertionPointUtils.ts +++ b/packages/pyright-internal/src/languageService/insertionPointUtils.ts @@ -9,11 +9,13 @@ import { getFileInfo, getScope } from '../analyzer/analyzerNodeInfo'; import { Declaration, DeclarationType } from '../analyzer/declaration'; import { getNameNodeForDeclaration } from '../analyzer/declarationUtils'; -import { getFirstAncestorOrSelf } from '../analyzer/parseTreeUtils'; +import { getFirstAncestorOrSelf, isBlankLine } from '../analyzer/parseTreeUtils'; import { isPrivateName } from '../analyzer/symbolNameUtils'; import { TypeEvaluator } from '../analyzer/typeEvaluatorTypes'; +import { containsOnlyWhitespace } from '../common/core'; +import { convertOffsetToPosition, convertPositionToOffset } from '../common/positionUtils'; import { TextRange } from '../common/textRange'; -import { ParseNode, ParseNodeType, StatementNode, SuiteNode } from '../parser/parseNodes'; +import { MatchNode, ParseNode, ParseNodeType, StatementNode, SuiteNode } from '../parser/parseNodes'; import { ParseResults } from '../parser/parser'; export interface InsertionOptions { @@ -29,10 +31,10 @@ export function getInsertionPointForSymbolUnderModule( ): number | undefined { const module = parseResults.parseTree; - const defaultInsertionPoint = TextRange.getEnd(module); + // If it is an empty file with all whitespaces, return 0 + const defaultInsertionPoint = _getDefaultInsertionPoint(parseResults); if (module.statements.length === 0) { - // Empty file. - return defaultInsertionPoint; + return containsOnlyWhitespace(parseResults.text) ? 0 : defaultInsertionPoint; } // See whether same name is already taken. @@ -54,24 +56,49 @@ export function getInsertionPointForSymbolUnderModule( return undefined; } + const insertBefore = options?.insertBefore ?? defaultInsertionPoint; if (isPrivateName(symbolName)) { - return Math.max(0, options?.insertBefore ?? defaultInsertionPoint); + return Math.max(0, insertBefore); + } + + if (insertBefore < TextRange.getEnd(module.statements[0])) { + return Math.max(0, Math.min(insertBefore, module.statements[0].start)); } - const lastStatement = _getLastStatementWithPublicName(module.statements); + const lastStatement = _getLastStatementWithPublicName( + module.statements, + options?.insertBefore ?? defaultInsertionPoint + ); return TextRange.getEnd(lastStatement); } -export function getContainer(node: ParseNode, includeSelf = true): SuiteNode | undefined { +export function getContainer(node: ParseNode, includeSelf = true): SuiteNode | MatchNode | undefined { return getFirstAncestorOrSelf(node, (n) => { if (!includeSelf && node === n) { return false; } - return n.nodeType === ParseNodeType.Suite; + return n.nodeType === ParseNodeType.Suite || n.nodeType === ParseNodeType.Match; }) as SuiteNode | undefined; } +function _getDefaultInsertionPoint(parseResults: ParseResults) { + const endOffset = TextRange.getEnd(parseResults.parseTree); + const position = convertOffsetToPosition(endOffset, parseResults.tokenizerOutput.lines); + if (position.character === 0) { + return endOffset; + } + + if (isBlankLine(parseResults, position.line)) { + return ( + convertPositionToOffset({ line: position.line, character: 0 }, parseResults.tokenizerOutput.lines) ?? + endOffset + ); + } + + return endOffset; +} + function _getDeclarationsDefinedInCurrentModule( evaluator: TypeEvaluator, declarations: Declaration[], @@ -111,10 +138,14 @@ function _getDeclarationsDefinedInCurrentModule( }); } -function _getLastStatementWithPublicName(statements: StatementNode[]) { +function _getLastStatementWithPublicName(statements: StatementNode[], insertBefore: number) { let lastStatement = statements[0]; for (let i = 1; i < statements.length; i++) { const statement = statements[i]; + if (insertBefore < TextRange.getEnd(statement)) { + return lastStatement; + } + switch (statement.nodeType) { case ParseNodeType.Class: case ParseNodeType.Function: { diff --git a/packages/pyright-internal/src/languageService/referencesProvider.ts b/packages/pyright-internal/src/languageService/referencesProvider.ts index 6ec6557b6..cbad0b11d 100644 --- a/packages/pyright-internal/src/languageService/referencesProvider.ts +++ b/packages/pyright-internal/src/languageService/referencesProvider.ts @@ -11,9 +11,12 @@ import { CancellationToken } from 'vscode-languageserver'; import { Declaration, DeclarationType, isAliasDeclaration } from '../analyzer/declaration'; +import { getNameFromDeclaration } from '../analyzer/declarationUtils'; import * as ParseTreeUtils from '../analyzer/parseTreeUtils'; +import { SourceFile } from '../analyzer/sourceFile'; import { SourceMapper } from '../analyzer/sourceMapper'; import { Symbol } from '../analyzer/symbol'; +import { isVisibleExternally } from '../analyzer/symbolUtils'; import { TypeEvaluator } from '../analyzer/typeEvaluatorTypes'; import { maxTypeRecursionCount } from '../analyzer/types'; import { throwIfCancellationRequested } from '../common/cancellationUtils'; @@ -24,7 +27,7 @@ import { DocumentRange, Position } from '../common/textRange'; import { TextRange } from '../common/textRange'; import { NameNode, ParseNode, ParseNodeType } from '../parser/parseNodes'; import { ParseResults } from '../parser/parser'; -import { DocumentSymbolCollector } from './documentSymbolCollector'; +import { DocumentSymbolCollector, DocumentSymbolCollectorUseCase } from './documentSymbolCollector'; export type ReferenceCallback = (locations: DocumentRange[]) => void; @@ -36,8 +39,9 @@ export class ReferencesResult { constructor( readonly requiresGlobalSearch: boolean, readonly nodeAtOffset: ParseNode, - readonly symbolName: string, + readonly symbolNames: string[], readonly declarations: Declaration[], + readonly useCase: DocumentSymbolCollectorUseCase, private readonly _reporter?: ReferenceCallback ) { // Filter out any import decls. but leave one with alias. @@ -57,8 +61,11 @@ export class ReferencesResult { return false; } + // Extract alias for comparison (symbolNames.some can't know d is for an Alias). + const alias = d.node.alias?.value; + // Check alias and what we are renaming is same thing. - if (d.node.alias?.value !== symbolName) { + if (!symbolNames.some((s) => s === alias)) { return false; } @@ -99,13 +106,14 @@ export class FindReferencesTreeWalker { findReferences(rootNode = this._parseResults.parseTree) { const collector = new DocumentSymbolCollector( - this._referencesResult.symbolName, + this._referencesResult.symbolNames, this._referencesResult.declarations, this._evaluator, this._cancellationToken, rootNode, /* treatModuleInImportAndFromImportSame */ true, - /* skipUnreachableCode */ false + /* skipUnreachableCode */ false, + this._referencesResult.useCase ); const results: DocumentRange[] = []; @@ -136,7 +144,9 @@ export class ReferencesProvider { node: NameNode, evaluator: TypeEvaluator, reporter: ReferenceCallback | undefined, - token: CancellationToken + useCase: DocumentSymbolCollectorUseCase, + token: CancellationToken, + implicitlyImportedBy?: SourceFile[] ) { throwIfCancellationRequested(token); @@ -144,8 +154,10 @@ export class ReferencesProvider { node, evaluator, /* resolveLocalNames */ false, + useCase, token, - sourceMapper + sourceMapper, + implicitlyImportedBy ); if (declarations.length === 0) { @@ -153,7 +165,18 @@ export class ReferencesProvider { } const requiresGlobalSearch = isVisibleOutside(evaluator, filePath, node, declarations); - return new ReferencesResult(requiresGlobalSearch, node, node.value, declarations, reporter); + + const symbolNames = new Set(declarations.map((d) => getNameFromDeclaration(d)!).filter((n) => !!n)); + symbolNames.add(node.value); + + return new ReferencesResult( + requiresGlobalSearch, + node, + [...symbolNames.values()], + declarations, + useCase, + reporter + ); } static getDeclarationForPosition( @@ -163,7 +186,9 @@ export class ReferencesProvider { position: Position, evaluator: TypeEvaluator, reporter: ReferenceCallback | undefined, - token: CancellationToken + useCase: DocumentSymbolCollectorUseCase, + token: CancellationToken, + implicitlyImportedBy?: SourceFile[] ): ReferencesResult | undefined { throwIfCancellationRequested(token); @@ -182,7 +207,16 @@ export class ReferencesProvider { return undefined; } - return this.getDeclarationForNode(sourceMapper, filePath, node, evaluator, reporter, token); + return this.getDeclarationForNode( + sourceMapper, + filePath, + node, + evaluator, + reporter, + useCase, + token, + implicitlyImportedBy + ); } static addReferences( @@ -252,7 +286,7 @@ function isVisibleOutside( recursionCount++; - if (symbol.isExternallyHidden()) { + if (!isVisibleExternally(symbol)) { return false; } diff --git a/packages/pyright-internal/src/languageService/renameModuleProvider.ts b/packages/pyright-internal/src/languageService/renameModuleProvider.ts index afec8909b..4a98064bb 100644 --- a/packages/pyright-internal/src/languageService/renameModuleProvider.ts +++ b/packages/pyright-internal/src/languageService/renameModuleProvider.ts @@ -8,7 +8,7 @@ import { CancellationToken } from 'vscode-languageserver'; -import { getImportInfo } from '../analyzer/analyzerNodeInfo'; +import { getFileInfo, getImportInfo } from '../analyzer/analyzerNodeInfo'; import { AliasDeclaration, Declaration, @@ -23,11 +23,8 @@ import { getDirectoryLeadingDotsPointsTo, getImportGroupFromModuleNameAndType, getRelativeModuleName, - getTextEditsForAutoImportInsertion, - getTextEditsForAutoImportSymbolAddition, - getTextRangeForImportNameDeletion, getTopLevelImports, - ImportNameInfo, + haveSameParentModule, ImportStatement, ImportStatements, } from '../analyzer/importStatementUtils'; @@ -35,6 +32,7 @@ import { getDottedNameWithGivenNodeAsLastName, getFirstAncestorOrSelfOfKind, getFullStatementRange, + getVariableDocStringNode, isFromImportAlias, isFromImportModuleName, isFromImportName, @@ -43,10 +41,13 @@ import { isLastNameOfModuleName, } from '../analyzer/parseTreeUtils'; import { ParseTreeWalker } from '../analyzer/parseTreeWalker'; +import { ScopeType } from '../analyzer/scope'; import { isStubFile } from '../analyzer/sourceMapper'; +import { isPrivateName } from '../analyzer/symbolNameUtils'; import { TypeEvaluator } from '../analyzer/typeEvaluatorTypes'; +import { TypeCategory } from '../analyzer/types'; import { getOrAdd } from '../common/collectionUtils'; -import { ConfigOptions } from '../common/configOptions'; +import { ConfigOptions, matchFileSpecs } from '../common/configOptions'; import { assert, assertNever } from '../common/debug'; import { FileEditAction } from '../common/editAction'; import { FileSystem } from '../common/fileSystem'; @@ -61,14 +62,13 @@ import { resolvePaths, stripFileExtension, } from '../common/pathUtils'; -import { convertOffsetToPosition, convertTextRangeToRange } from '../common/positionUtils'; -import { TextEditTracker } from '../common/textEditUtils'; +import { convertRangeToTextRange } from '../common/positionUtils'; +import { TextEditTracker } from '../common/textEditTracker'; import { TextRange } from '../common/textRange'; import { ImportAsNode, ImportFromAsNode, ImportFromNode, - ImportNode, isExpressionNode, MemberAccessNode, ModuleNameNode, @@ -78,7 +78,7 @@ import { ParseNodeType, } from '../parser/parseNodes'; import { ParseResults } from '../parser/parser'; -import { CollectionResult, DocumentSymbolCollector } from './documentSymbolCollector'; +import { CollectionResult, DocumentSymbolCollector, DocumentSymbolCollectorUseCase } from './documentSymbolCollector'; enum UpdateType { File, @@ -164,6 +164,102 @@ export class RenameModuleProvider { ); } + static canMoveSymbol(configOptions: ConfigOptions, evaluator: TypeEvaluator, node: NameNode): boolean { + const filePath = getFileInfo(node)?.filePath; + if (!filePath || !matchFileSpecs(configOptions, filePath, /* isFile */ true)) { + // We only support moving symbols from a user file. + return false; + } + + if (isPrivateName(node.value)) { + return false; + } + + const lookUpResult = evaluator.lookUpSymbolRecursive(node, node.value, /* honorCodeFlow */ false); + if (lookUpResult === undefined || lookUpResult.scope.type !== ScopeType.Module) { + // We only allow moving a symbol at the module level. + return false; + } + + // For now, we only supports module level variable, function and class. + const declarations = lookUpResult.symbol.getDeclarations(); + if (declarations.length === 0) { + return false; + } + + return declarations.every((d) => { + if (!TextRange.containsRange(d.node, node)) { + return false; + } + + if (isFunctionDeclaration(d) || isClassDeclaration(d)) { + return true; + } + + if (isVariableDeclaration(d)) { + // We only support simple variable assignment. + // ex) a = 1 + if (evaluator.isExplicitTypeAliasDeclaration(d)) { + return false; + } + + if (d.inferredTypeSource && isExpressionNode(d.inferredTypeSource)) { + const type = evaluator.getType(d.inferredTypeSource); + if (type?.category === TypeCategory.TypeVar) { + return false; + } + } + + // This make sure we are not one of these + // ex) a = b = 1 + // a, b = 1, 2 + if ( + d.node.parent?.nodeType !== ParseNodeType.Assignment || + d.node.parent?.parent?.nodeType !== ParseNodeType.StatementList + ) { + return false; + } + + if (d.node.start !== d.node.parent.start) { + return false; + } + + return true; + } + + return false; + }); + } + + static getSymbolTextRange(parseResults: ParseResults, decl: Declaration): TextRange { + if (isVariableDeclaration(decl)) { + const assignment = getFirstAncestorOrSelfOfKind(decl.node, ParseNodeType.Assignment) ?? decl.node; + const range = getFullStatementRange(assignment, parseResults); + const textRange = convertRangeToTextRange(range, parseResults.tokenizerOutput.lines) ?? assignment; + + if (decl.docString !== undefined) { + const docNode = getVariableDocStringNode(decl.node); + if (docNode) { + TextRange.extend(textRange, docNode); + } + } + + return textRange; + } + + return decl.node; + } + + static getSymbolFullStatementTextRange(parseResults: ParseResults, decl: Declaration): TextRange { + const statementNode = isVariableDeclaration(decl) + ? getFirstAncestorOrSelfOfKind(decl.node, ParseNodeType.Assignment) ?? decl.node + : decl.node; + const range = getFullStatementRange(statementNode, parseResults, { + includeTrailingBlankLines: true, + }); + return convertRangeToTextRange(range, parseResults.tokenizerOutput.lines) ?? statementNode; + } + static getRenameModulePath(declarations: Declaration[]) { // If we have a decl with no node, we will prefer that decl over others. // The decl with no node is a synthesized alias decl created only for IDE case @@ -275,7 +371,7 @@ export class RenameModuleProvider { private _moduleNameAndType: ModuleNameAndType, private _newModuleNameAndType: ModuleNameAndType, private _type: UpdateType, - private _declarations: Declaration[], + public declarations: Declaration[], private _token: CancellationToken ) { // moduleName and newModuleName are always in the absolute path form. @@ -284,39 +380,72 @@ export class RenameModuleProvider { this._moduleNames = this._moduleName.split('.'); this._newModuleNames = this._newModuleName.split('.'); - if (this._moduleNames.length !== this._newModuleNames.length) { - this._onlyNameChanged = false; - return; - } + this._onlyNameChanged = haveSameParentModule(this._moduleNames, this._newModuleNames); + assert(this._type !== UpdateType.Folder || this._onlyNameChanged, 'We only support simple rename for folder'); + } - let i = 0; - for (i = 0; i < this._moduleNames.length - 1; i++) { - if (this._moduleNames[i] !== this._newModuleNames[i]) { - break; - } - } + get lastModuleName() { + return this._moduleNames[this._moduleNames.length - 1]; + } - this._onlyNameChanged = i === this._moduleNames.length - 1; - assert(this._type !== UpdateType.Folder || this._onlyNameChanged, 'We only support simple rename for folder'); + get textEditTracker(): TextEditTracker { + return this._textEditTracker; } - renameReferences(filePath: string, parseResults: ParseResults) { + getEdits(): FileEditAction[] { + return this._textEditTracker.getEdits(this._token); + } + + renameReferences(parseResults: ParseResults) { switch (this._type) { case UpdateType.Folder: - return this._renameFolderReferences(filePath, parseResults); + return this._renameFolderReferences(parseResults); case UpdateType.File: - return this._renameModuleReferences(filePath, parseResults); + return this._renameModuleReferences(parseResults); case UpdateType.Symbol: - return this._updateSymbolReferences(filePath, parseResults); + return this._updateSymbolReferences(parseResults); default: return assertNever(this._type, `${this._type} is unknown`); } } - private _updateSymbolReferences(filePath: string, parseResults: ParseResults) { + tryGetFirstSymbolUsage(parseResults: ParseResults, symbol?: { name: string; decls: Declaration[] }) { + const name = symbol?.name ?? getNameFromDeclaration(this.declarations[0]) ?? ''; + const collector = new DocumentSymbolCollector( + [name], + symbol?.decls ?? this.declarations, + this._evaluator!, + this._token, + parseResults.parseTree, + /* treatModuleImportAndFromImportSame */ true, + /* skipUnreachableCode */ false + ); + + for (const result of collector.collect().sort((r1, r2) => r1.range.start - r2.range.start)) { + // We only care about symbol usages, not alias decl of the symbol. + if ( + isImportModuleName(result.node) || + isImportAlias(result.node) || + isFromImportModuleName(result.node) || + isFromImportName(result.node) || + isFromImportAlias(result.node) + ) { + continue; + } + + return result.range.start; + } + + return undefined; + } + + private _updateSymbolReferences(parseResults: ParseResults) { + const filePath = getFileInfo(parseResults.parseTree).filePath; + const isSource = filePath === this._moduleFilePath; + const collector = new DocumentSymbolCollector( - getNameFromDeclaration(this._declarations[0]) ?? '', - this._declarations, + [getNameFromDeclaration(this.declarations[0]) || ''], + this.declarations, this._evaluator!, this._token, parseResults.parseTree, @@ -331,111 +460,109 @@ export class RenameModuleProvider { // ex) import [moduleName] or from ... import [moduleName] const imported = importStatements.orderedImports.find((i) => i.moduleName === this._newModuleName); - const nameRemoved = new Set(); + // Indicate whether current file has any usage of the symbol + let hasSymbolUsage = false; + + const wildcardImports = new Map>(); const importUsed = new Map(); for (const result of collector.collect()) { const nodeFound = result.node; if (nodeFound.nodeType === ParseNodeType.String) { - // Ignore symbol appearing in the __all__. it should be handled - // when decl is moved. + if (isSource) { + // Delete the symbol reference in __all__ if the file is the source file. + this._textEditTracker.addEditWithTextRange(parseResults, nodeFound, ''); + } continue; } if (isFromImportName(nodeFound)) { - // ex) from ... import [symbol] ... - const fromNode = nodeFound.parent?.parent as ImportFromNode; - const newModuleName = this._getNewModuleName( - filePath, - fromNode.module.leadingDots > 0, - /* isLastPartImportName */ false - ); - - if (fromNode.imports.length === 1) { - // ex) "from [module] import symbol" to "from [module.changed] import symbol" - this._addResultWithTextRange(filePath, fromNode.module, parseResults, newModuleName); - } else { - // ex) "from module import symbol, another_symbol" to - // "from module import another_symbol" and "from module.changed import symbol" - - // Delete the existing import name including alias. - const importFromAs = nodeFound.parent as ImportFromAsNode; - this._addFromImportNameDeletion( - filePath, - parseResults, - nameRemoved, - fromNode.imports, - importFromAs - ); - - // For now, this won't merge absolute and relative path "from import" statement. - const importNameInfo = { - name: importFromAs.name.value, - alias: importFromAs.alias?.value, - }; - - this._addResultEdits( - this._getTextEditsForNewOrExistingFromImport( - filePath, - fromNode, - parseResults, - nameRemoved, - importStatements, - newModuleName, - [importNameInfo] - ) - ); - } - + this._updateNameInFromImportForSymbolReferences(parseResults, importStatements, nodeFound); continue; } + // Exclude symbol decl itself. + hasSymbolUsage = isSource + ? !this.declarations.some((d) => TextRange.containsRange(d.node, nodeFound)) + : true; + const dottedName = getDottedNameWithGivenNodeAsLastName(nodeFound); if (dottedName === nodeFound || dottedName.nodeType !== ParseNodeType.MemberAccess) { + this._collectWildcardImports(nodeFound, wildcardImports); + // ex) from module import foo // foo // foo.method() - // - // from module import * - // foo() - // bar() - // - // we don't need to do anything for wild card case since - // we will preserve __all__ entries. continue; } - const moduleName = - dottedName.leftExpression.nodeType === ParseNodeType.MemberAccess - ? dottedName.leftExpression.memberName - : dottedName.leftExpression.nodeType === ParseNodeType.Name - ? dottedName.leftExpression + this._collectSymbolReferencesPerImports(dottedName, importUsed); + } + + if (isSource && hasSymbolUsage) { + // If the original file has references to the symbol moved, we need to either + // insert import statement or update existing one. + const newModuleName = + imported?.node.nodeType === ParseNodeType.ImportFrom + ? this._getNewModuleName( + filePath, + imported.node.module.leadingDots > 0, + /* isLastPartImportName */ false + ) : undefined; - if (!moduleName) { - // ex) from module import foo - // getModule().foo - continue; - } - const moduleDecl = this._evaluator - .getDeclarationsForNameNode(moduleName) - ?.filter( - (d) => - isAliasDeclaration(d) && - (d.node.nodeType === ParseNodeType.ImportAs || d.node.nodeType === ParseNodeType.ImportFromAs) - ); - if (!moduleDecl || moduleDecl.length === 0) { - // ex) from xxx import yyy - // yyy.property.foo - continue; - } + const options = + imported?.node.nodeType === ParseNodeType.ImportFrom + ? { + currentFromImport: imported.node, + originalModuleName: this._moduleName, + } + : undefined; - const importAs = moduleDecl[0].node as ImportAsNode | ImportFromAsNode; - getOrAdd(importUsed, importAs, () => []).push(dottedName); - continue; + this._textEditTracker.addOrUpdateImport( + parseResults, + importStatements, + { name: this._newModuleName, nameForImportFrom: newModuleName }, + getImportGroupFromModuleNameAndType(this._newModuleNameAndType), + [{ name: getNameFromDeclaration(this.declarations[0])! }], + options + ); } + // Handle symbol references that are used off wildcard imports. + this._processSymbolReferenceOffWildcardImports(parseResults, importStatements, wildcardImports); + // Handle symbol references that are used off imported modules. + this._processSymbolReferenceOffImports(parseResults, importStatements, imported, importUsed); + } + + private _processSymbolReferenceOffImports( + parseResults: ParseResults, + importStatements: ImportStatements, + imported: ImportStatement | undefined, + importUsed: Map + ) { + const filePath = getFileInfo(parseResults.parseTree).filePath; + const isDestination = filePath === this._newModuleFilePath; + if (isDestination) { + for (const [key, value] of importUsed) { + if (this._canReplaceImportName(parseResults, key, value)) { + // We can remove existing import statement. + this._textEditTracker.deleteImportName(parseResults, key); + } + + for (const node of value) { + this._textEditTracker.addEditWithTextRange( + parseResults, + TextRange.fromBounds(node.start, node.memberName.start), + '' + ); + } + } + return; + } + + // Other files. for (const [key, value] of importUsed) { let referenceModuleName: string; if (this._canReplaceImportName(parseResults, key, value)) { @@ -443,27 +570,15 @@ export class RenameModuleProvider { if (key.nodeType === ParseNodeType.ImportAs) { if (moduleName) { referenceModuleName = moduleName; - this._addImportNameDeletion( - filePath, - parseResults, - nameRemoved, - (key.parent as ImportNode).list, - key - ); + this._textEditTracker.deleteImportName(parseResults, key); } else { referenceModuleName = key.alias ? key.alias.value : this._newModuleName; - this._addResultWithTextRange(filePath, key.module, parseResults, this._newModuleName); + this._textEditTracker.addEditWithTextRange(parseResults, key.module, this._newModuleName); } } else { if (moduleName) { referenceModuleName = moduleName; - this._addFromImportNameDeletion( - filePath, - parseResults, - nameRemoved, - (key.parent as ImportFromNode).imports, - key - ); + this._textEditTracker.deleteImportName(parseResults, key); } else { const fromNode = key.parent as ImportFromNode; const newModuleName = this._getNewModuleName( @@ -473,8 +588,8 @@ export class RenameModuleProvider { ); referenceModuleName = key.alias ? key.alias.value : this._newLastModuleName; - this._addResultWithTextRange(filePath, fromNode.module, parseResults, newModuleName); - this._addResultWithTextRange(filePath, key.name, parseResults, this._newLastModuleName); + this._textEditTracker.addEditWithTextRange(parseResults, fromNode.module, newModuleName); + this._textEditTracker.addEditWithTextRange(parseResults, key.name, this._newLastModuleName); } } } else { @@ -483,25 +598,163 @@ export class RenameModuleProvider { referenceModuleName = moduleName; } else { referenceModuleName = this._newModuleName; - this._addResultEdits( - getTextEditsForAutoImportInsertion( - [], - { name: this._newModuleName }, - importStatements, - getImportGroupFromModuleNameAndType(this._newModuleNameAndType), - parseResults, - convertOffsetToPosition(parseResults.parseTree.length, parseResults.tokenizerOutput.lines) - ).map((e) => ({ filePath, range: e.range, replacementText: e.replacementText })) + this._textEditTracker.addOrUpdateImport( + parseResults, + importStatements, + { name: this._newModuleName }, + getImportGroupFromModuleNameAndType(this._newModuleNameAndType) ); } } for (const node of value) { - this._addResultWithTextRange(filePath, node.leftExpression, parseResults, referenceModuleName); + this._textEditTracker.addEditWithTextRange(parseResults, node.leftExpression, referenceModuleName); } } } + private _processSymbolReferenceOffWildcardImports( + parseResults: ParseResults, + importStatements: ImportStatements, + wildcardImports: Map> + ) { + const filePath = getFileInfo(parseResults.parseTree).filePath; + const isDestination = filePath === this._newModuleFilePath; + if (isDestination) { + // Destination file contains the moved symbol decl. no need to insert + // import statement for the symbol moved. + return; + } + + for (const [key, value] of wildcardImports) { + const fromNode = key; + const newModuleName = this._getNewModuleName( + filePath, + fromNode.module.leadingDots > 0, + /* isLastPartImportName */ false + ); + + this._textEditTracker.addOrUpdateImport( + parseResults, + importStatements, + { name: this._newModuleName, nameForImportFrom: newModuleName }, + getImportGroupFromModuleNameAndType(this._newModuleNameAndType), + [...value].map((v) => ({ name: v })), + { + currentFromImport: fromNode, + originalModuleName: this._moduleName, + } + ); + } + } + + private _collectSymbolReferencesPerImports( + dottedName: MemberAccessNode, + importUsed: Map + ) { + const moduleName = + dottedName.leftExpression.nodeType === ParseNodeType.MemberAccess + ? dottedName.leftExpression.memberName + : dottedName.leftExpression.nodeType === ParseNodeType.Name + ? dottedName.leftExpression + : undefined; + if (!moduleName) { + // ex) from module import foo + // getModule().foo + return; + } + + const moduleDecl = this._evaluator + .getDeclarationsForNameNode(moduleName) + ?.filter( + (d) => + isAliasDeclaration(d) && + (d.node.nodeType === ParseNodeType.ImportAs || d.node.nodeType === ParseNodeType.ImportFromAs) + ); + if (!moduleDecl || moduleDecl.length === 0) { + // ex) from xxx import yyy + // yyy.property.foo + return; + } + + const importAs = moduleDecl[0].node as ImportAsNode | ImportFromAsNode; + getOrAdd(importUsed, importAs, () => []).push(dottedName); + } + + private _collectWildcardImports(nodeFound: NameNode, wildcardImports: Map>) { + const nameDecls = this._evaluator.getDeclarationsForNameNode(nodeFound); + const aliasDeclFromWildCardImport = nameDecls?.find( + (d) => d.node.nodeType === ParseNodeType.ImportFrom && d.node.isWildcardImport + ); + + if (!aliasDeclFromWildCardImport || !isAliasDeclaration(aliasDeclFromWildCardImport)) { + return; + } + + // ex) from module import * + // foo() + // bar() + getOrAdd(wildcardImports, aliasDeclFromWildCardImport.node, () => new Set()).add(nodeFound.value); + } + + private _updateNameInFromImportForSymbolReferences( + parseResults: ParseResults, + importStatements: ImportStatements, + nodeFound: NameNode + ) { + const filePath = getFileInfo(parseResults.parseTree).filePath; + const isDestination = filePath === this._newModuleFilePath; + + // ex) from ... import [symbol] ... + const importFromAs = nodeFound.parent as ImportFromAsNode; + const fromNode = importFromAs?.parent as ImportFromNode; + + const newModuleName = this._getNewModuleName( + filePath, + fromNode.module.leadingDots > 0, + /* isLastPartImportName */ false + ); + + if (isDestination) { + // If we have import statement for the symbol in the destination file, + // we need to remove it. + // ex) "from module import symbol, another_symbol" to + // "from module import another_symbol" + this._textEditTracker.deleteImportName(parseResults, importFromAs); + return; + } + + if (fromNode.imports.length === 1) { + // ex) "from [module] import symbol" to "from [module.changed] import symbol" + this._textEditTracker.addEditWithTextRange(parseResults, fromNode.module, newModuleName); + return; + } + + // ex) "from module import symbol, another_symbol" to + // "from module import another_symbol" and "from module.changed import symbol" + + // Delete the existing import name including alias. + this._textEditTracker.deleteImportName(parseResults, importFromAs); + + // For now, this won't merge absolute and relative path "from import" statement. + const importNameInfo = { + name: importFromAs.name.value, + alias: importFromAs.alias?.value, + }; + + this._textEditTracker.addOrUpdateImport( + parseResults, + importStatements, + { name: this._newModuleName, nameForImportFrom: newModuleName }, + getImportGroupFromModuleNameAndType(this._newModuleNameAndType), + [importNameInfo], + { + currentFromImport: fromNode, + originalModuleName: this._moduleName, + } + ); + } + private _getReferenceModuleName( importStatements: ImportStatements, imported: ImportStatement | undefined @@ -531,6 +784,7 @@ export class RenameModuleProvider { nameToBind, this._evaluator, /* resolveLocalName */ false, + DocumentSymbolCollectorUseCase.Rename, this._token ); if (declarations.length === 0) { @@ -538,7 +792,7 @@ export class RenameModuleProvider { } const collector = new DocumentSymbolCollector( - nameToBind.value, + [nameToBind.value], declarations, this._evaluator!, this._token, @@ -559,6 +813,7 @@ export class RenameModuleProvider { continue; } + // other symbols from the module are used in the file. if (!symbolReferences.some((s) => TextRange.containsRange(s, result.node))) { return false; } @@ -567,10 +822,10 @@ export class RenameModuleProvider { return true; } - private _renameFolderReferences(filePath: string, parseResults: ParseResults) { + private _renameFolderReferences(parseResults: ParseResults) { const collector = new DocumentSymbolCollector( - this.lastModuleName, - this._declarations, + [this.lastModuleName], + this.declarations, this._evaluator!, this._token, parseResults.parseTree, @@ -581,14 +836,14 @@ export class RenameModuleProvider { // We only support simple rename of folder. Change all occurrence of the old folder name // to new name. for (const result of collector.collect()) { - this._addResultWithTextRange(filePath, result.range, parseResults, this._newLastModuleName); + this._textEditTracker.addEditWithTextRange(parseResults, result.range, this._newLastModuleName); } } - private _renameModuleReferences(filePath: string, parseResults: ParseResults) { + private _renameModuleReferences(parseResults: ParseResults) { const collector = new DocumentSymbolCollector( - this.lastModuleName, - this._declarations, + [this.lastModuleName], + this.declarations, this._evaluator!, this._token, parseResults.parseTree, @@ -596,22 +851,17 @@ export class RenameModuleProvider { /* skipUnreachableCode */ false ); - const nameRemoved = new Set(); const results = collector.collect(); // Update module references first. - this._updateModuleReferences(filePath, parseResults, nameRemoved, results); + this._updateModuleReferences(parseResults, results); // If the module file has moved, we need to update all relative paths used in the file to reflect the move. - this._updateRelativeModuleNamePath(filePath, parseResults, nameRemoved, results); + this._updateRelativeModuleNamePath(parseResults, results); } - private _updateRelativeModuleNamePath( - filePath: string, - parseResults: ParseResults, - nameRemoved: Set, - results: CollectionResult[] - ) { + private _updateRelativeModuleNamePath(parseResults: ParseResults, results: CollectionResult[]) { + const filePath = getFileInfo(parseResults.parseTree).filePath; if (filePath !== this._moduleFilePath) { // We only update relative import paths for the file that has moved. return; @@ -626,7 +876,7 @@ export class RenameModuleProvider { (m) => !results.some((r) => TextRange.containsRange(m.parent!, r.node)) ) )) { - this._addResultWithTextRange(filePath, edit.moduleName, parseResults, edit.newModuleName); + this._textEditTracker.addEditWithTextRange(parseResults, edit.moduleName, edit.newModuleName); if (!edit.itemsToMove) { continue; @@ -641,7 +891,7 @@ export class RenameModuleProvider { // First, delete existing exported symbols from "from import" statement. for (const importFromAs of edit.itemsToMove) { - this._addFromImportNameDeletion(filePath, parseResults, nameRemoved, fromNode.imports, importFromAs); + this._textEditTracker.deleteImportName(parseResults, importFromAs); } importStatements = @@ -649,41 +899,41 @@ export class RenameModuleProvider { // For now, this won't merge absolute and relative path "from import" // statement. - this._addResultEdits( - this._getTextEditsForNewOrExistingFromImport( - filePath, - fromNode, - parseResults, - nameRemoved, - importStatements, - getRelativeModuleName( + this._textEditTracker.addOrUpdateImport( + parseResults, + importStatements, + { + name: this._newModuleName, + nameForImportFrom: getRelativeModuleName( this._fs, this._newModuleFilePath, this._newModuleFilePath, /* ignoreFolderStructure */ false, /* sourceIsFile */ true ), - edit.itemsToMove.map((i) => { - return { name: i.name.value, alias: i.alias?.value }; - }) - ) + }, + getImportGroupFromModuleNameAndType(this._newModuleNameAndType), + edit.itemsToMove.map((i) => { + return { name: i.name.value, alias: i.alias?.value }; + }), + { + currentFromImport: fromNode, + originalModuleName: this._moduleName, + } ); } } - private _updateModuleReferences( - filePath: string, - parseResults: ParseResults, - nameRemoved: Set, - results: CollectionResult[] - ) { + private _updateModuleReferences(parseResults: ParseResults, results: CollectionResult[]) { + const filePath = getFileInfo(parseResults.parseTree).filePath; + let importStatements: ImportStatements | undefined; for (const result of results) { const nodeFound = result.node; if (nodeFound.nodeType === ParseNodeType.String) { // ex) __all__ = ["[a]"] - this._addResultWithTextRange(filePath, result.range, parseResults, this._newLastModuleName); + this._textEditTracker.addEditWithTextRange(parseResults, result.range, this._newLastModuleName); continue; } @@ -717,11 +967,9 @@ export class RenameModuleProvider { this._newModuleNames.length > 1 ) { this._aliasIntroduced.add(moduleNameNode.parent); - - this._addResultWithTextRange( - filePath, - moduleNameNode, + this._textEditTracker.addEditWithTextRange( parseResults, + moduleNameNode, `${this._newModuleName} as ${this._newLastModuleName}` ); continue; @@ -729,13 +977,13 @@ export class RenameModuleProvider { // Otherwise, update whole module name to new name // ex) import [xxx.yyy] to import [aaa.bbb] - this._addResultWithTextRange(filePath, moduleNameNode, parseResults, this._newModuleName); + this._textEditTracker.addEditWithTextRange(parseResults, moduleNameNode, this._newModuleName); continue; } if (isImportAlias(nodeFound)) { // ex) import xxx as [yyy] to import xxx as [zzz] - this._addResultWithTextRange(filePath, result.range, parseResults, this._newLastModuleName); + this._textEditTracker.addEditWithTextRange(parseResults, result.range, this._newLastModuleName); continue; } @@ -765,10 +1013,9 @@ export class RenameModuleProvider { // We don't have any sub modules, we can change module name to new one. // Update whole module name to new name. // ex) from [xxx.yyy] import zzz to from [aaa.bbb] import zzz - this._addResultWithTextRange( - filePath, - moduleNameNode, + this._textEditTracker.addEditWithTextRange( parseResults, + moduleNameNode, this._getNewModuleName( filePath, moduleNameNode.leadingDots > 0, @@ -790,19 +1037,13 @@ export class RenameModuleProvider { // Update module name if needed. if (fromNode.module.leadingDots > 0) { for (const edit of this._getNewRelativeModuleNamesForFileMoved(filePath, [fromNode.module])) { - this._addResultWithTextRange(filePath, edit.moduleName, parseResults, edit.newModuleName); + this._textEditTracker.addEditWithTextRange(parseResults, edit.moduleName, edit.newModuleName); } } // First, delete existing exported symbols from "from import" statement. for (const importFromAs of exportedSymbols) { - this._addFromImportNameDeletion( - filePath, - parseResults, - nameRemoved, - fromNode.imports, - importFromAs - ); + this._textEditTracker.deleteImportName(parseResults, importFromAs); } importStatements = @@ -810,33 +1051,31 @@ export class RenameModuleProvider { // For now, this won't merge absolute and relative path "from import" // statement. - this._addResultEdits( - this._getTextEditsForNewOrExistingFromImport( - filePath, - fromNode, - parseResults, - nameRemoved, - importStatements, - this._newModuleName, - exportedSymbols.map((i) => { - const name = - results.findIndex((r) => r.node === i.name) >= 0 - ? this._newLastModuleName - : i.name.value; - const alias = - results.findIndex((r) => r.node === i.alias) >= 0 - ? this._newLastModuleName - : i.alias?.value; - - return { name, alias }; - }) - ) + this._textEditTracker.addOrUpdateImport( + parseResults, + importStatements, + { name: this._newModuleName }, + getImportGroupFromModuleNameAndType(this._newModuleNameAndType), + exportedSymbols.map((i) => { + const name = + results.findIndex((r) => r.node === i.name) >= 0 ? this._newLastModuleName : i.name.value; + const alias = + results.findIndex((r) => r.node === i.alias) >= 0 + ? this._newLastModuleName + : i.alias?.value; + + return { name, alias }; + }), + { + currentFromImport: fromNode, + originalModuleName: this._moduleName, + } ); continue; } if (isFromImportName(nodeFound)) { - if (nameRemoved.has(nodeFound.id)) { + if (this._textEditTracker.isNodeRemoved(nodeFound)) { // Import name is already removed. continue; } @@ -852,14 +1091,14 @@ export class RenameModuleProvider { // Existing logic should make sure re-exported symbol name work as before after // symbol rename. if (this._isExportedSymbol(nodeFound)) { - this._addResultWithTextRange(filePath, result.range, parseResults, this._newLastModuleName); + this._textEditTracker.addEditWithTextRange(parseResults, result.range, this._newLastModuleName); continue; } if (fromNode.imports.length === 1) { // ex) from xxx import [yyy] to from [aaa.bbb] import [zzz] - this._addResultWithTextRange(filePath, fromNode.module, parseResults, newModuleName); - this._addResultWithTextRange(filePath, result.range, parseResults, this._newLastModuleName); + this._textEditTracker.addEditWithTextRange(parseResults, fromNode.module, newModuleName); + this._textEditTracker.addEditWithTextRange(parseResults, result.range, this._newLastModuleName); } else { // Delete the existing import name including alias. const importFromAs = nodeFound.parent as ImportFromAsNode; @@ -867,17 +1106,15 @@ export class RenameModuleProvider { // Update module name if needed. if (fromNode.module.leadingDots > 0) { for (const edit of this._getNewRelativeModuleNamesForFileMoved(filePath, [fromNode.module])) { - this._addResultWithTextRange(filePath, edit.moduleName, parseResults, edit.newModuleName); + this._textEditTracker.addEditWithTextRange( + parseResults, + edit.moduleName, + edit.newModuleName + ); } } - this._addFromImportNameDeletion( - filePath, - parseResults, - nameRemoved, - fromNode.imports, - importFromAs - ); + this._textEditTracker.deleteImportName(parseResults, importFromAs); importStatements = importStatements ?? @@ -901,29 +1138,29 @@ export class RenameModuleProvider { : importFromAs.alias?.value, }; - this._addResultEdits( - this._getTextEditsForNewOrExistingFromImport( - filePath, - fromNode, - parseResults, - nameRemoved, - importStatements, - newModuleName, - [importNameInfo] - ) + this._textEditTracker.addOrUpdateImport( + parseResults, + importStatements, + { name: this._newModuleName, nameForImportFrom: newModuleName }, + getImportGroupFromModuleNameAndType(this._newModuleNameAndType), + [importNameInfo], + { + currentFromImport: fromNode, + originalModuleName: this._moduleName, + } ); } continue; } if (isFromImportAlias(nodeFound)) { - if (nameRemoved.has(nodeFound.id)) { + if (this._textEditTracker.isNodeRemoved(nodeFound)) { // alias is already removed. continue; } // ex) from ccc import xxx as [yyy] to from ccc import xxx as [zzz] - this._addResultWithTextRange(filePath, result.range, parseResults, this._newLastModuleName); + this._textEditTracker.addEditWithTextRange(parseResults, result.range, this._newLastModuleName); continue; } @@ -932,6 +1169,7 @@ export class RenameModuleProvider { nodeFound, this._evaluator, /* resolveLocalName */ false, + DocumentSymbolCollectorUseCase.Rename, this._token ).filter((d) => isAliasDeclaration(d)) as AliasDeclaration[]; @@ -939,7 +1177,7 @@ export class RenameModuleProvider { // Simple case. only name has changed. but not path. // Just replace name to new symbol name. // ex) a.[b].foo() to a.[z].foo() - this._addResultWithTextRange(filePath, result.range, parseResults, this._newLastModuleName); + this._textEditTracker.addEditWithTextRange(parseResults, result.range, this._newLastModuleName); continue; } @@ -954,7 +1192,7 @@ export class RenameModuleProvider { const dottedName = getDottedNameWithGivenNodeAsLastName(nodeFound); if (dottedName.parent?.nodeType !== ParseNodeType.MemberAccess) { // Replace whole dotted name with new module name. - this._addResultWithTextRange(filePath, dottedName, parseResults, this._newModuleName); + this._textEditTracker.addEditWithTextRange(parseResults, dottedName, this._newModuleName); continue; } @@ -972,12 +1210,12 @@ export class RenameModuleProvider { // Next name is actual symbol. Replace whole name to new module name. // ex) import a.b.c // [a.b.c].[foo]() - this._addResultWithTextRange(filePath, dottedName, parseResults, this._newModuleName); + this._textEditTracker.addEditWithTextRange(parseResults, dottedName, this._newModuleName); continue; } if (result.node.value !== this._newLastModuleName) { - this._addResultWithTextRange(filePath, result.range, parseResults, this._newLastModuleName); + this._textEditTracker.addEditWithTextRange(parseResults, result.range, this._newLastModuleName); continue; } } @@ -1129,14 +1367,6 @@ export class RenameModuleProvider { return moduleName; } - getEdits(): FileEditAction[] { - return this._textEditTracker.getEdits(this._token); - } - - get lastModuleName() { - return this._moduleNames[this._moduleNames.length - 1]; - } - private get _moduleName() { return this._moduleNameAndType.moduleName; } @@ -1148,189 +1378,6 @@ export class RenameModuleProvider { private get _newModuleName() { return this._newModuleNameAndType.moduleName; } - - private _addImportNameDeletion( - filePath: string, - parseResults: ParseResults, - nameRemoved: Set, - imports: ImportAsNode[], - importToDelete: ImportAsNode - ) { - this._addImportNameDeletionInternal( - filePath, - parseResults, - nameRemoved, - imports, - importToDelete, - ParseNodeType.Import - ); - - // Mark that we don't need to process these node again later. - nameRemoved.add(importToDelete.module.id); - importToDelete.module.nameParts.forEach((n) => nameRemoved.add(n.id)); - if (importToDelete.alias) { - nameRemoved.add(importToDelete.alias.id); - } - } - - private _addFromImportNameDeletion( - filePath: string, - parseResults: ParseResults, - nameRemoved: Set, - imports: ImportFromAsNode[], - importToDelete: ImportFromAsNode - ) { - this._addImportNameDeletionInternal( - filePath, - parseResults, - nameRemoved, - imports, - importToDelete, - ParseNodeType.ImportFrom - ); - - // Mark that we don't need to process these node again later. - nameRemoved.add(importToDelete.name.id); - if (importToDelete.alias) { - nameRemoved.add(importToDelete.alias.id); - } - } - - private _addImportNameDeletionInternal( - filePath: string, - parseResults: ParseResults, - nameRemoved: Set, - imports: ImportFromAsNode[] | ImportAsNode[], - importToDelete: ImportFromAsNode | ImportAsNode, - importKind: ParseNodeType.ImportFrom | ParseNodeType.Import - ) { - const ranges = getTextRangeForImportNameDeletion( - imports, - imports.findIndex((v) => v === importToDelete) - ); - - ranges.forEach((r) => this._addResultWithTextRange(filePath, r, parseResults, '')); - - // Mark that we don't need to process these node again later. - nameRemoved.add(importToDelete.id); - - // Check whether we have deleted all trailing import names. - // If either no trailing import is deleted or handled properly - // then, there is nothing to do. otherwise, either delete the whole statement - // or remove trailing comma. - // ex) from x import [y], z or from x import y[, z] - let lastImportIndexNotDeleted = 0; - for ( - lastImportIndexNotDeleted = imports.length - 1; - lastImportIndexNotDeleted >= 0; - lastImportIndexNotDeleted-- - ) { - if (!nameRemoved.has(imports[lastImportIndexNotDeleted].id)) { - break; - } - } - - if (lastImportIndexNotDeleted === -1) { - // Whole statement is deleted. Remove the statement itself. - // ex) [from x import a, b, c] or [import a] - const importStatement = getFirstAncestorOrSelfOfKind(importToDelete, importKind); - if (importStatement) { - this._textEditTracker.addEdit( - filePath, - getFullStatementRange(importStatement, parseResults.tokenizerOutput), - '' - ); - } - } else if (lastImportIndexNotDeleted >= 0 && lastImportIndexNotDeleted < imports.length - 2) { - // We need to delete trailing comma - // ex) from x import a, [b, c] - const start = TextRange.getEnd(imports[lastImportIndexNotDeleted]); - const length = TextRange.getEnd(imports[lastImportIndexNotDeleted + 1]) - start; - this._addResultWithTextRange(filePath, { start, length }, parseResults, ''); - } - } - - private _addResultWithTextRange(filePath: string, range: TextRange, parseResults: ParseResults, newName: string) { - const existing = parseResults.text.substr(range.start, range.length); - if (existing === newName) { - // No change. Return as it is. - return; - } - - this._textEditTracker.addEdit( - filePath, - convertTextRangeToRange(range, parseResults.tokenizerOutput.lines), - newName - ); - } - - private _addResultEdits(edits: FileEditAction[]) { - this._textEditTracker.addEdits(...edits); - } - - private _getTextEditsForNewOrExistingFromImport( - filePath: string, - currentFromImport: ImportFromNode, - parseResults: ParseResults, - nameRemoved: Set, - importStatements: ImportStatements, - moduleName: string, - importNameInfo: ImportNameInfo[] - ): FileEditAction[] { - // See whether we have existing from import statement for the same module - // ex) from [|moduleName|] import subModule - const imported = importStatements.orderedImports.find((i) => i.moduleName === moduleName); - if (imported && imported.node.nodeType === ParseNodeType.ImportFrom && !imported.node.isWildcardImport) { - const edits = getTextEditsForAutoImportSymbolAddition(importNameInfo, imported, parseResults); - if (imported.node !== currentFromImport) { - // Add what we want to the existing "import from" statement as long as it is not the same import - // node we are working on. - return edits.map((e) => ({ filePath, range: e.range, replacementText: e.replacementText })); - } - - // Check whether we can avoid creating a new statement. We can't just merge with existing one since - // we could create invalid text edits (2 edits that change the same span, or invalid replacement text since - // texts on the node has changed) - if (this._onlyNameChanged && importNameInfo.length === 1 && edits.length === 1) { - const deletions = this._textEditTracker.getDeletionsForSpan(filePath, edits[0].range); - if (deletions.length === 0) { - return [{ filePath, range: edits[0].range, replacementText: edits[0].replacementText }]; - } else { - const alias = - importNameInfo[0].alias === this._newLastModuleName - ? this.lastModuleName - : importNameInfo[0].alias; - - const importName = currentFromImport.imports.find( - (i) => i.name.value === this.lastModuleName && i.alias?.value === alias - ); - if (importName) { - this._textEditTracker.removeEdits(filePath, deletions); - if (importName.alias) { - nameRemoved.delete(importName.alias.id); - } - - return [ - { - filePath, - range: convertTextRangeToRange(importName.name, parseResults.tokenizerOutput.lines), - replacementText: this._newLastModuleName, - }, - ]; - } - } - } - } - - return getTextEditsForAutoImportInsertion( - importNameInfo, - { name: moduleName }, - importStatements, - getImportGroupFromModuleNameAndType(this._newModuleNameAndType), - parseResults, - convertOffsetToPosition(parseResults.parseTree.length, parseResults.tokenizerOutput.lines) - ).map((e) => ({ filePath, range: e.range, replacementText: e.replacementText })); - } } class ModuleNameCollector extends ParseTreeWalker { diff --git a/packages/pyright-internal/src/languageService/signatureHelpProvider.ts b/packages/pyright-internal/src/languageService/signatureHelpProvider.ts index b24035aad..374f52516 100644 --- a/packages/pyright-internal/src/languageService/signatureHelpProvider.ts +++ b/packages/pyright-internal/src/languageService/signatureHelpProvider.ts @@ -13,10 +13,13 @@ import { CancellationToken, MarkupContent, MarkupKind } from 'vscode-languageser import { convertDocStringToMarkdown, convertDocStringToPlainText } from '../analyzer/docStringConversion'; import { extractParameterDocumentation } from '../analyzer/docStringUtils'; +import { isTypedKwargs } from '../analyzer/parameterUtils'; import * as ParseTreeUtils from '../analyzer/parseTreeUtils'; import { getCallNodeAndActiveParameterIndex } from '../analyzer/parseTreeUtils'; import { SourceMapper } from '../analyzer/sourceMapper'; import { CallSignature, TypeEvaluator } from '../analyzer/typeEvaluatorTypes'; +import { PrintTypeFlags } from '../analyzer/typePrinter'; +import { isClassInstance } from '../analyzer/types'; import { throwIfCancellationRequested } from '../common/cancellationUtils'; import { convertPositionToOffset } from '../common/positionUtils'; import { Position } from '../common/textRange'; @@ -124,13 +127,14 @@ export class SignatureHelpProvider { format: MarkupKind ): SignatureInfo { const functionType = signature.type; - const stringParts = evaluator.printFunctionParts(functionType); + const stringParts = evaluator.printFunctionParts(functionType, PrintTypeFlags.ExpandTypedDictArgs); const parameters: ParamInfo[] = []; const functionDocString = getFunctionDocStringFromType(functionType, sourceMapper, evaluator) ?? this._getDocStringFromCallNode(callNode, sourceMapper, evaluator); let label = '('; + let activeParameter: number | undefined; const params = functionType.details.parameters; stringParts[0].forEach((paramString: string, paramIndex) => { @@ -141,6 +145,21 @@ export class SignatureHelpProvider { paramName = params[params.length - 1].name || ''; } + // If we have a typedKwargs, the param name will be wrong. + const kwargsIndex = paramIndex >= params.length ? params.length - 1 : paramIndex; + if (kwargsIndex >= 0) { + const kwargsParam = params[kwargsIndex]; + if ( + isTypedKwargs(kwargsParam) && + isClassInstance(kwargsParam.type) && + kwargsParam.type.details.typedDictEntries + ) { + // Use the relative position in typed dict entries. + const dictIndex = paramIndex - kwargsIndex; + paramName = [...kwargsParam.type.details.typedDictEntries.keys()][dictIndex]; + } + } + parameters.push({ startOffset: label.length, endOffset: label.length + paramString.length, @@ -148,6 +167,12 @@ export class SignatureHelpProvider { documentation: extractParameterDocumentation(functionDocString || '', paramName), }); + // Name match for active parameter. The set of parameters from the function + // may not match the actual string output from the typeEvaluator (kwargs for TypedDict is an example). + if (paramName && signature.activeParam && signature.activeParam.name === paramName) { + activeParameter = paramIndex; + } + label += paramString; if (paramIndex < stringParts[0].length - 1) { label += ', '; @@ -156,8 +181,7 @@ export class SignatureHelpProvider { label += ') -> ' + stringParts[1]; - let activeParameter: number | undefined; - if (signature.activeParam) { + if (signature.activeParam && activeParameter === undefined) { activeParameter = params.indexOf(signature.activeParam); if (activeParameter === -1) { activeParameter = undefined; diff --git a/packages/pyright-internal/src/languageService/tooltipUtils.ts b/packages/pyright-internal/src/languageService/tooltipUtils.ts index 0662be805..9d701b863 100644 --- a/packages/pyright-internal/src/languageService/tooltipUtils.ts +++ b/packages/pyright-internal/src/languageService/tooltipUtils.ts @@ -4,8 +4,8 @@ * Licensed under the MIT license. * Author: Eric Traut * - * Tooltip helper methods that can be shared between multiple language server features such as - * hover and completion tooltip. + * Helper functions for formatting text that can appear in hover text, + * completion suggestions, etc. */ import { Declaration, DeclarationType, VariableDeclaration } from '../analyzer/declaration'; @@ -16,6 +16,7 @@ import { getClassDocString, getFunctionDocStringInherited, getModuleDocString, + getModuleDocStringFromPaths, getOverloadedFunctionDocStringsInherited, getPropertyDocStringInherited, getVariableDocString, @@ -23,6 +24,7 @@ import { import { TypeEvaluator } from '../analyzer/typeEvaluatorTypes'; import { ClassType, + combineTypes, FunctionType, isFunction, isInstantiableClass, @@ -30,18 +32,55 @@ import { isOverloadedFunction, OverloadedFunctionType, Type, + TypeCategory, + UnknownType, } from '../analyzer/types'; +import { SignatureDisplayType } from '../common/configOptions'; import { isDefined } from '../common/core'; +import { ExpressionNode, ParseNodeType } from '../parser/parseNodes'; + +// The number of spaces to indent each parameter, after moving to a newline in tooltips. +const functionParamIndentOffset = 4; + +export function getToolTipForType( + type: Type, + label: string, + name: string, + evaluator: TypeEvaluator, + isProperty: boolean, + functionSignatureDisplay: SignatureDisplayType +): string { + let signatureString = ''; + if (isOverloadedFunction(type)) { + signatureString = label.length > 0 ? `(${label})\n` : ''; + signatureString += `${getOverloadedFunctionTooltip(type, evaluator, functionSignatureDisplay)}`; + } else if (isFunction(type)) { + signatureString = `${getFunctionTooltip(label, name, type, evaluator, isProperty, functionSignatureDisplay)}`; + } else { + signatureString = label.length > 0 ? `(${label}) ` : ''; + signatureString += `${name}: ${evaluator.printType(type)}`; + } + + return signatureString; +} // 70 is vscode's default hover width size. export function getOverloadedFunctionTooltip( type: OverloadedFunctionType, evaluator: TypeEvaluator, + functionSignatureDisplay: SignatureDisplayType, columnThreshold = 70 ) { let content = ''; - const overloads = OverloadedFunctionType.getOverloads(type).map( - (o) => o.details.name + evaluator.printType(o, /* expandTypeAlias */ false) + const overloads = OverloadedFunctionType.getOverloads(type).map((o) => + getFunctionTooltip( + /* label */ '', + o.details.name, + o, + evaluator, + /* isProperty */ false, + functionSignatureDisplay + ) ); for (let i = 0; i < overloads.length; i++) { @@ -49,7 +88,7 @@ export function getOverloadedFunctionTooltip( content += '\n'; } - content += overloads[i]; + content += overloads[i] + `: ...`; if (i < overloads.length - 1) { content += '\n'; @@ -62,6 +101,65 @@ export function getOverloadedFunctionTooltip( return content; } +export function getFunctionTooltip( + label: string, + functionName: string, + type: FunctionType, + evaluator: TypeEvaluator, + isProperty = false, + functionSignatureDisplay: SignatureDisplayType +) { + const labelFormatted = label.length === 0 ? '' : `(${label}) `; + const indentStr = + functionSignatureDisplay === SignatureDisplayType.formatted ? '\n' + ' '.repeat(functionParamIndentOffset) : ''; + const funcParts = evaluator.printFunctionParts(type); + const paramSignature = formatSignature(funcParts, indentStr, functionSignatureDisplay); + const sep = isProperty ? ': ' : ''; + const defKeyword = isProperty ? '' : 'def '; + return `${labelFormatted}${defKeyword}${functionName}${sep}${paramSignature} -> ${funcParts[1]}`; +} + +export function getConstructorTooltip( + constructorName: string, + type: Type, + evaluator: TypeEvaluator, + functionSignatureDisplay: SignatureDisplayType +) { + const classText = `class `; + let signature = ''; + + if (isOverloadedFunction(type)) { + const overloads = type.overloads.map((overload) => + getConstructorTooltip(constructorName, overload, evaluator, functionSignatureDisplay) + ); + overloads.forEach((overload, index) => { + signature += overload + ': ...' + '\n\n'; + }); + } else if (isFunction(type)) { + const indentStr = + functionSignatureDisplay === SignatureDisplayType.formatted + ? '\n' + ' '.repeat(functionParamIndentOffset) + : ' '; + const funcParts = evaluator.printFunctionParts(type); + const paramSignature = formatSignature(funcParts, indentStr, functionSignatureDisplay); + signature += `${classText}${constructorName}${paramSignature}`; + } + return signature; +} + +// Only formats signature if there is more than one parameter +function formatSignature( + funcParts: [string[], string], + indentStr: string, + functionSignatureDisplay: SignatureDisplayType +) { + return functionSignatureDisplay === SignatureDisplayType.formatted && + funcParts.length > 0 && + funcParts[0].length > 1 + ? `(${indentStr}${funcParts[0].join(',' + indentStr)}\n)` + : `(${funcParts[0].join(', ')})`; +} + export function getFunctionDocStringFromType(type: FunctionType, sourceMapper: SourceMapper, evaluator: TypeEvaluator) { const decl = type.details.declaration; const enclosingClass = decl ? ParseTreeUtils.getEnclosingClass(decl.node) : undefined; @@ -93,14 +191,38 @@ export function getOverloadedFunctionDocStringsFromType( ); } -export function getDocumentationPartsForTypeAndDecl( +function getDocumentationPartForTypeAlias( + sourceMapper: SourceMapper, + resolvedDecl: Declaration | undefined, + evaluator: TypeEvaluator, + symbol?: Symbol +) { + if (resolvedDecl?.type === DeclarationType.Variable && resolvedDecl.typeAliasName && resolvedDecl.docString) { + return resolvedDecl.docString; + } else if (resolvedDecl?.type === DeclarationType.Variable) { + const decl = (symbol?.getDeclarations().find((d) => d.type === DeclarationType.Variable && !!d.docString) ?? + resolvedDecl) as VariableDeclaration; + const doc = getVariableDocString(decl, sourceMapper); + if (doc) { + return doc; + } + } else if (resolvedDecl?.type === DeclarationType.Function) { + // @property functions + const doc = getPropertyDocStringInherited(resolvedDecl, sourceMapper, evaluator); + if (doc) { + return doc; + } + } + return undefined; +} + +function getDocumentationPartForType( sourceMapper: SourceMapper, type: Type, resolvedDecl: Declaration | undefined, evaluator: TypeEvaluator, - symbol?: Symbol, boundObjectOrClass?: ClassType | undefined -): string | undefined { +) { if (isModule(type)) { const doc = getModuleDocString(type, resolvedDecl, sourceMapper); if (doc) { @@ -133,25 +255,56 @@ export function getDocumentationPartsForTypeAndDecl( } } } + return undefined; +} - if (resolvedDecl?.type === DeclarationType.Variable && resolvedDecl.typeAliasName && resolvedDecl.docString) { - return resolvedDecl.docString; - } else if (resolvedDecl?.type === DeclarationType.Variable) { - const decl = (symbol?.getDeclarations().find((d) => d.type === DeclarationType.Variable && !!d.docString) ?? - resolvedDecl) as VariableDeclaration; - const doc = getVariableDocString(decl, sourceMapper); - if (doc) { - return doc; - } - } else if (resolvedDecl?.type === DeclarationType.Function) { - // @property functions - const doc = getPropertyDocStringInherited(resolvedDecl, sourceMapper, evaluator); - if (doc) { - return doc; +export function getDocumentationPartsForTypeAndDecl( + sourceMapper: SourceMapper, + type: Type | undefined, + resolvedDecl: Declaration | undefined, + evaluator: TypeEvaluator, + optional?: { + name?: string; + symbol?: Symbol; + boundObjectOrClass?: ClassType | undefined; + } +): string | undefined { + // Get the alias first + const aliasDoc = getDocumentationPartForTypeAlias(sourceMapper, resolvedDecl, evaluator, optional?.symbol); + + // Combine this with the type doc + let typeDoc: string | undefined; + if (resolvedDecl?.type === DeclarationType.Alias) { + // Handle another alias decl special case. + // ex) import X.Y + // [X].Y + // Asking decl for X gives us "X.Y" rather than "X" since "X" is not actually a symbol. + // We need to get corresponding module name to use special code in type eval for this case. + if ( + resolvedDecl.type === DeclarationType.Alias && + resolvedDecl.node && + resolvedDecl.node.nodeType === ParseNodeType.ImportAs && + !!optional?.name && + !resolvedDecl.node.alias + ) { + const name = resolvedDecl.node.module.nameParts.find((n) => n.value === optional.name); + if (name) { + const aliasDecls = evaluator.getDeclarationsForNameNode(name) ?? [resolvedDecl]; + resolvedDecl = aliasDecls.length > 0 ? aliasDecls[0] : resolvedDecl; + } } + + typeDoc = getModuleDocStringFromPaths([resolvedDecl.path], sourceMapper); } - return undefined; + typeDoc = + typeDoc ?? + (type + ? getDocumentationPartForType(sourceMapper, type, resolvedDecl, evaluator, optional?.boundObjectOrClass) + : undefined); + + // Combine with a new line if they both exist + return aliasDoc && typeDoc && aliasDoc !== typeDoc ? `${aliasDoc}\n\n${typeDoc}` : aliasDoc || typeDoc; } export function getAutoImportText(name: string, from?: string, alias?: string): string { @@ -168,3 +321,26 @@ export function getAutoImportText(name: string, from?: string, alias?: string): return text; } + +export function combineExpressionTypes(typeNodes: ExpressionNode[], evaluator: TypeEvaluator): Type { + const typeList = typeNodes.map((n) => evaluator.getType(n) || UnknownType.create()); + let result = combineTypes(typeList); + + // We're expecting a set of types, if there is only one and the outermost type is a list, take its inner type. This + // is probably an expression that at runtime would turn into a list. + if ( + typeList.length === 1 && + result.category === TypeCategory.Class && + ClassType.isBuiltIn(result, 'list') && + result.typeArguments + ) { + result = result.typeArguments[0]; + } else if ( + typeList.length === 1 && + result.category === TypeCategory.Class && + ClassType.isBuiltIn(result, 'range') + ) { + result = evaluator.getBuiltInObject(typeNodes[0], 'int'); + } + return result; +} diff --git a/packages/pyright-internal/src/localization/localize.ts b/packages/pyright-internal/src/localization/localize.ts index 2a771a9cf..dfe64202e 100644 --- a/packages/pyright-internal/src/localization/localize.ts +++ b/packages/pyright-internal/src/localization/localize.ts @@ -24,7 +24,7 @@ export class ParameterizedString { format(params: T): string { let str = this._formatString; Object.keys(params).forEach((key) => { - str = str.replace(`{${key}}`, (params as any)[key].toString()); + str = str.replace(new RegExp(`{${key}}`, 'g'), (params as any)[key].toString()); }); return str; } @@ -65,7 +65,7 @@ function getRawString(key: string): string { fail(`Missing localized string for key "${key}"`); } -function getRawStringFromMap(map: StringLookupMap, keyParts: string[]): string | undefined { +export function getRawStringFromMap(map: StringLookupMap, keyParts: string[]): string | undefined { let curObj: any = map; for (const keyPart of keyParts) { @@ -82,7 +82,7 @@ function getRawStringFromMap(map: StringLookupMap, keyParts: string[]): string | function initialize(): StringLookupMap { defaultStrings = loadDefaultStrings(); const currentLocale = getLocaleFromEnv(); - return loadStringsForLocale(currentLocale); + return loadStringsForLocale(currentLocale, stringMapsByLocale); } declare let navigator: { language: string } | undefined; @@ -93,7 +93,7 @@ export function setLocaleOverride(locale: string) { localeOverride = locale.toLowerCase(); } -function getLocaleFromEnv() { +export function getLocaleFromEnv() { if (localeOverride) { return localeOverride; } @@ -133,7 +133,7 @@ function getLocaleFromEnv() { } function loadDefaultStrings(): StringLookupMap { - const defaultStrings = loadStringsFromJsonFile(defaultLocale); + const defaultStrings = stringMapsByLocale.get(defaultLocale); if (defaultStrings) { return defaultStrings; } @@ -141,13 +141,13 @@ function loadDefaultStrings(): StringLookupMap { return {}; } -function loadStringsForLocale(locale: string): StringLookupMap { +export function loadStringsForLocale(locale: string, localeMap: Map): StringLookupMap { if (locale === defaultLocale) { // No need to load override if we're using the default. return {}; } - let override = loadStringsFromJsonFile(locale); + let override = localeMap.get(locale); if (override !== undefined) { return override; } @@ -156,7 +156,7 @@ function loadStringsForLocale(locale: string): StringLookupMap { // general version. const localeSplit = locale.split('-'); if (localeSplit.length > 0 && localeSplit[0]) { - override = loadStringsFromJsonFile(localeSplit[0]); + override = localeMap.get(localeSplit[0]); if (override !== undefined) { return override; } @@ -165,10 +165,6 @@ function loadStringsForLocale(locale: string): StringLookupMap { return {}; } -function loadStringsFromJsonFile(locale: string): StringLookupMap | undefined { - return stringMapsByLocale.get(locale); -} - export namespace Localizer { export namespace Diagnostic { export const annotatedParamCountMismatch = () => @@ -243,6 +239,8 @@ export namespace Localizer { export const breakOutsideLoop = () => getRawString('Diagnostic.breakOutsideLoop'); export const callableExtraArgs = () => getRawString('Diagnostic.callableExtraArgs'); export const callableFirstArg = () => getRawString('Diagnostic.callableFirstArg'); + export const callableNotInstantiable = () => + new ParameterizedString<{ type: string }>(getRawString('Diagnostic.callableNotInstantiable')); export const callableSecondArg = () => getRawString('Diagnostic.callableSecondArg'); export const casePatternIsIrrefutable = () => getRawString('Diagnostic.casePatternIsIrrefutable'); export const classAlreadySpecialized = () => @@ -273,6 +271,10 @@ export namespace Localizer { getRawString('Diagnostic.clsSelfParamTypeMismatch') ); export const codeTooComplexToAnalyze = () => getRawString('Diagnostic.codeTooComplexToAnalyze'); + export const collectionAliasInstantiation = () => + new ParameterizedString<{ type: string; alias: string }>( + getRawString('Diagnostic.collectionAliasInstantiation') + ); export const comparisonAlwaysFalse = () => new ParameterizedString<{ leftType: string; rightType: string }>( getRawString('Diagnostic.comparisonAlwaysFalse') @@ -301,9 +303,11 @@ export namespace Localizer { ); export const continueInFinally = () => getRawString('Diagnostic.continueInFinally'); export const continueOutsideLoop = () => getRawString('Diagnostic.continueOutsideLoop'); + export const dataClassBaseClassFrozen = () => getRawString('Diagnostic.dataClassBaseClassFrozen'); export const dataClassBaseClassNotFrozen = () => getRawString('Diagnostic.dataClassBaseClassNotFrozen'); export const dataClassFieldWithDefault = () => getRawString('Diagnostic.dataClassFieldWithDefault'); export const dataClassFieldWithoutAnnotation = () => getRawString('Diagnostic.dataClassFieldWithoutAnnotation'); + export const dataClassFieldWithPrivateName = () => getRawString('Diagnostic.dataClassFieldWithPrivateName'); export const dataClassPostInitParamCount = () => new ParameterizedString<{ expected: number }>(getRawString('Diagnostic.dataClassPostInitParamCount')); export const dataClassPostInitType = () => @@ -324,7 +328,12 @@ export namespace Localizer { export const declaredReturnTypeUnknown = () => getRawString('Diagnostic.declaredReturnTypeUnknown'); export const defaultValueContainsCall = () => getRawString('Diagnostic.defaultValueContainsCall'); export const defaultValueNotAllowed = () => getRawString('Diagnostic.defaultValueNotAllowed'); - export const defaultValueNotEllipsis = () => getRawString('Diagnostic.defaultValueNotEllipsis'); + export const deprecatedClass = () => + new ParameterizedString<{ name: string }>(getRawString('Diagnostic.deprecatedClass')); + export const deprecatedConstructor = () => + new ParameterizedString<{ name: string }>(getRawString('Diagnostic.deprecatedConstructor')); + export const deprecatedFunction = () => + new ParameterizedString<{ name: string }>(getRawString('Diagnostic.deprecatedFunction')); export const deprecatedType = () => new ParameterizedString<{ version: string; replacement: string }>( getRawString('Diagnostic.deprecatedType') @@ -441,6 +450,7 @@ export namespace Localizer { export const functionDecoratorTypeUnknown = () => getRawString('Diagnostic.functionDecoratorTypeUnknown'); export const functionInConditionalExpression = () => getRawString('Diagnostic.functionInConditionalExpression'); export const functionTypeParametersIllegal = () => getRawString('Diagnostic.functionTypeParametersIllegal'); + export const futureImportLocationNotAllowed = () => getRawString('Diagnostic.futureImportLocationNotAllowed'); export const generatorAsyncReturnType = () => getRawString('Diagnostic.generatorAsyncReturnType'); export const generatorNotParenthesized = () => getRawString('Diagnostic.generatorNotParenthesized'); export const generatorSyncReturnType = () => getRawString('Diagnostic.generatorSyncReturnType'); @@ -503,6 +513,7 @@ export namespace Localizer { export const keyValueInSet = () => getRawString('Diagnostic.keyValueInSet'); export const keywordArgInTypeArgument = () => getRawString('Diagnostic.keywordArgInTypeArgument'); export const keywordOnlyAfterArgs = () => getRawString('Diagnostic.keywordOnlyAfterArgs'); + export const keywordParameterMissing = () => getRawString('Diagnostic.keywordParameterMissing'); export const keywordSubscriptIllegal = () => getRawString('Diagnostic.keywordSubscriptIllegal'); export const lambdaReturnTypeUnknown = () => getRawString('Diagnostic.lambdaReturnTypeUnknown'); export const lambdaReturnTypePartiallyUnknown = () => @@ -544,7 +555,9 @@ export namespace Localizer { export const moduleAsType = () => getRawString('Diagnostic.moduleAsType'); export const moduleNotCallable = () => getRawString('Diagnostic.moduleNotCallable'); export const moduleUnknownMember = () => - new ParameterizedString<{ name: string }>(getRawString('Diagnostic.moduleUnknownMember')); + new ParameterizedString<{ memberName: string; moduleName: string }>( + getRawString('Diagnostic.moduleUnknownMember') + ); export const namedExceptAfterCatchAll = () => getRawString('Diagnostic.namedExceptAfterCatchAll'); export const namedParamAfterParamSpecArgs = () => new ParameterizedString<{ name: string }>(getRawString('Diagnostic.namedParamAfterParamSpecArgs')); @@ -556,8 +569,10 @@ export namespace Localizer { export const namedTupleNoTypes = () => getRawString('Diagnostic.namedTupleNoTypes'); export const namedTupleSecondArg = () => getRawString('Diagnostic.namedTupleSecondArg'); export const newClsParam = () => getRawString('Diagnostic.newClsParam'); + export const newTypeBadName = () => getRawString('Diagnostic.newTypeBadName'); export const newTypeLiteral = () => getRawString('Diagnostic.newTypeLiteral'); export const newTypeNotAClass = () => getRawString('Diagnostic.newTypeNotAClass'); + export const newTypeParamCount = () => getRawString('Diagnostic.newTypeParamCount'); export const newTypeProtocolClass = () => getRawString('Diagnostic.newTypeProtocolClass'); export const nonDefaultAfterDefault = () => getRawString('Diagnostic.nonDefaultAfterDefault'); export const noneNotCallable = () => getRawString('Diagnostic.noneNotCallable'); @@ -618,8 +633,12 @@ export namespace Localizer { new ParameterizedString<{ name: string }>(getRawString('Diagnostic.overloadWithImplementation')); export const overloadWithoutImplementation = () => new ParameterizedString<{ name: string }>(getRawString('Diagnostic.overloadWithoutImplementation')); - export const overwriteTypeParameter = () => - new ParameterizedString<{ name: string }>(getRawString('Diagnostic.overwriteTypeParameter')); + export const overriddenMethodNotFound = () => + new ParameterizedString<{ name: string }>(getRawString('Diagnostic.overriddenMethodNotFound')); + export const overrideDecoratorMissing = () => + new ParameterizedString<{ name: string; className: string }>( + getRawString('Diagnostic.overrideDecoratorMissing') + ); export const paramAfterKwargsParam = () => getRawString('Diagnostic.paramAfterKwargsParam'); export const paramAlreadyAssigned = () => new ParameterizedString<{ name: string }>(getRawString('Diagnostic.paramAlreadyAssigned')); @@ -634,12 +653,15 @@ export namespace Localizer { export const paramSpecAssignedName = () => new ParameterizedString<{ name: string }>(getRawString('Diagnostic.paramSpecAssignedName')); export const paramSpecContext = () => getRawString('Diagnostic.paramSpecContext'); + export const paramSpecDefaultNotTuple = () => getRawString('Diagnostic.paramSpecDefaultNotTuple'); export const paramSpecFirstArg = () => getRawString('Diagnostic.paramSpecFirstArg'); export const paramSpecKwargsUsage = () => getRawString('Diagnostic.paramSpecKwargsUsage'); export const paramSpecNotBound = () => new ParameterizedString<{ type: string }>(getRawString('Diagnostic.paramSpecNotBound')); export const paramSpecNotUsedByOuterScope = () => new ParameterizedString<{ name: string }>(getRawString('Diagnostic.paramSpecNotUsedByOuterScope')); + export const paramSpecScopedToReturnType = () => + new ParameterizedString<{ name: string }>(getRawString('Diagnostic.paramSpecScopedToReturnType')); export const paramSpecUnknownArg = () => getRawString('Diagnostic.paramSpecUnknownArg'); export const paramSpecUnknownMember = () => new ParameterizedString<{ name: string }>(getRawString('Diagnostic.paramSpecUnknownMember')); @@ -656,6 +678,8 @@ export namespace Localizer { new ParameterizedString<{ paramName: string }>(getRawString('Diagnostic.paramTypePartiallyUnknown')); export const parenthesizedContextManagerIllegal = () => getRawString('Diagnostic.parenthesizedContextManagerIllegal'); + export const patternNeverMatches = () => + new ParameterizedString<{ type: string }>(getRawString('Diagnostic.patternNeverMatches')); export const positionArgAfterNamedArg = () => getRawString('Diagnostic.positionArgAfterNamedArg'); export const privateImportFromPyTypedModule = () => new ParameterizedString<{ name: string; module: string }>( @@ -700,11 +724,21 @@ export namespace Localizer { new ParameterizedString<{ variable: string; class: string }>( getRawString('Diagnostic.protocolVarianceInvariant') ); + export const pyrightCommentInvalidDiagnosticBoolValue = () => + getRawString('Diagnostic.pyrightCommentInvalidDiagnosticBoolValue'); + export const pyrightCommentInvalidDiagnosticSeverityValue = () => + getRawString('Diagnostic.pyrightCommentInvalidDiagnosticSeverityValue'); + export const pyrightCommentMissingDirective = () => getRawString('Diagnostic.pyrightCommentMissingDirective'); + export const pyrightCommentUnknownDirective = () => + new ParameterizedString<{ directive: string }>(getRawString('Diagnostic.pyrightCommentUnknownDirective')); + export const pyrightCommentUnknownDiagnosticRule = () => + new ParameterizedString<{ rule: string }>(getRawString('Diagnostic.pyrightCommentUnknownDiagnosticRule')); export const recursiveDefinition = () => new ParameterizedString<{ name: string }>(getRawString('Diagnostic.recursiveDefinition')); export const relativeImportNotAllowed = () => getRawString('Diagnostic.relativeImportNotAllowed'); export const requiredArgCount = () => getRawString('Diagnostic.requiredArgCount'); export const requiredNotInTypedDict = () => getRawString('Diagnostic.requiredNotInTypedDict'); + export const returnInAsyncGenerator = () => getRawString('Diagnostic.returnInAsyncGenerator'); export const returnMissing = () => new ParameterizedString<{ returnType: string }>(getRawString('Diagnostic.returnMissing')); export const returnOutsideFunction = () => getRawString('Diagnostic.returnOutsideFunction'); @@ -741,6 +775,9 @@ export namespace Localizer { new ParameterizedString<{ name: string }>(getRawString('Diagnostic.slotsClassVarConflict')); export const starStarWildcardNotAllowed = () => getRawString('Diagnostic.starStarWildcardNotAllowed'); export const staticClsSelfParam = () => getRawString('Diagnostic.staticClsSelfParam'); + export const stdlibModuleOverridden = () => + new ParameterizedString<{ name: string; path: string }>(getRawString('Diagnostic.stdlibModuleOverridden')); + export const strictTypeGuardReturnType = () => new ParameterizedString<{ type: string; returnType: string }>( getRawString('Diagnostic.strictTypeGuardReturnType') @@ -775,10 +812,9 @@ export namespace Localizer { export const tupleInAnnotation = () => getRawString('Diagnostic.tupleInAnnotation'); export const tupleIndexOutOfRange = () => new ParameterizedString<{ type: string; index: number }>(getRawString('Diagnostic.tupleIndexOutOfRange')); + export const typeAliasIllegalExpressionForm = () => getRawString('Diagnostic.typeAliasIllegalExpressionForm'); export const typeAliasIsRecursiveDirect = () => new ParameterizedString<{ name: string }>(getRawString('Diagnostic.typeAliasIsRecursiveDirect')); - export const typeAliasIsRecursiveIndirect = () => - new ParameterizedString<{ name: string }>(getRawString('Diagnostic.typeAliasIsRecursiveIndirect')); export const typeAliasNotInModuleOrClass = () => getRawString('Diagnostic.typeAliasNotInModuleOrClass'); export const typeAliasRedeclared = () => new ParameterizedString<{ name: string }>(getRawString('Diagnostic.typeAliasRedeclared')); @@ -827,6 +863,7 @@ export namespace Localizer { export const typeExpectedClass = () => new ParameterizedString<{ type: string }>(getRawString('Diagnostic.typeExpectedClass')); export const typeGuardArgCount = () => getRawString('Diagnostic.typeGuardArgCount'); + export const typeGuardParamCount = () => getRawString('Diagnostic.typeGuardParamCount'); export const typeNotAwaitable = () => new ParameterizedString<{ type: string }>(getRawString('Diagnostic.typeNotAwaitable')); export const typeNotCallable = () => @@ -866,8 +903,6 @@ export namespace Localizer { new ParameterizedString<{ name: string; container: string }>( getRawString('Diagnostic.typeParameterNotDeclared') ); - export const typeParameterOutOfScope = () => - new ParameterizedString<{ name: string }>(getRawString('Diagnostic.typeParameterOutOfScope')); export const typePartiallyUnknown = () => new ParameterizedString<{ name: string }>(getRawString('Diagnostic.typePartiallyUnknown')); export const typeUnknown = () => @@ -879,8 +914,14 @@ export namespace Localizer { getRawString('Diagnostic.typeVarAssignmentMismatch') ); export const typeVarBoundAndConstrained = () => getRawString('Diagnostic.typeVarBoundAndConstrained'); + export const typeVarBoundGeneric = () => getRawString('Diagnostic.typeVarBoundGeneric'); + export const typeVarConstraintGeneric = () => getRawString('Diagnostic.typeVarConstraintGeneric'); + export const typeVarDefaultBoundMismatch = () => getRawString('Diagnostic.typeVarDefaultBoundMismatch'); + export const typeVarDefaultConstraintMismatch = () => + getRawString('Diagnostic.typeVarDefaultConstraintMismatch'); export const typeVarFirstArg = () => getRawString('Diagnostic.typeVarFirstArg'); - export const typeVarGeneric = () => getRawString('Diagnostic.typeVarGeneric'); + export const typeVarDefaultInvalidTypeVar = () => + new ParameterizedString<{ name: string }>(getRawString('Diagnostic.typeVarDefaultInvalidTypeVar')); export const typeVarNoMember = () => new ParameterizedString<{ type: string; name: string }>(getRawString('Diagnostic.typeVarNoMember')); export const typeVarNotSubscriptable = () => @@ -891,10 +932,15 @@ export namespace Localizer { new ParameterizedString<{ name: string; param: string }>( getRawString('Diagnostic.typeVarPossiblyUnsolvable') ); + export const typeVarScopedToReturnType = () => + new ParameterizedString<{ name: string }>(getRawString('Diagnostic.typeVarScopedToReturnType')); export const typeVarSingleConstraint = () => getRawString('Diagnostic.typeVarSingleConstraint'); export const typeVarsNotInGenericOrProtocol = () => getRawString('Diagnostic.typeVarsNotInGenericOrProtocol'); - export const typeVarTupleMustBeUnpacked = () => getRawString('Diagnostic.typeVarTupleMustBeUnpacked'); export const typeVarTupleContext = () => getRawString('Diagnostic.typeVarTupleContext'); + export const typeVarTupleDefaultNotUnpacked = () => getRawString('Diagnostic.typeVarTupleDefaultNotUnpacked'); + export const typeVarTupleMustBeUnpacked = () => getRawString('Diagnostic.typeVarTupleMustBeUnpacked'); + export const typeVarTupleUnknownParam = () => + new ParameterizedString<{ name: string }>(getRawString('Diagnostic.typeVarTupleUnknownParam')); export const typeVarUnknownParam = () => new ParameterizedString<{ name: string }>(getRawString('Diagnostic.typeVarUnknownParam')); export const typeVarUsedByOuterScope = () => @@ -902,6 +948,8 @@ export namespace Localizer { export const typeVarUsedOnlyOnce = () => new ParameterizedString<{ name: string }>(getRawString('Diagnostic.typeVarUsedOnlyOnce')); export const typeVarVariance = () => getRawString('Diagnostic.typeVarVariance'); + export const typeVarWithoutDefault = () => + new ParameterizedString<{ name: string; other: string }>(getRawString('Diagnostic.typeVarWithoutDefault')); export const unaccessedClass = () => new ParameterizedString<{ name: string }>(getRawString('Diagnostic.unaccessedClass')); export const unaccessedFunction = () => @@ -912,14 +960,21 @@ export namespace Localizer { new ParameterizedString<{ name: string }>(getRawString('Diagnostic.unaccessedSymbol')); export const unaccessedVariable = () => new ParameterizedString<{ name: string }>(getRawString('Diagnostic.unaccessedVariable')); + export const unannotatedFunctionSkipped = () => + new ParameterizedString<{ name: string }>(getRawString('Diagnostic.unannotatedFunctionSkipped')); export const unexpectedAsyncToken = () => getRawString('Diagnostic.unexpectedAsyncToken'); export const unexpectedExprToken = () => getRawString('Diagnostic.unexpectedExprToken'); export const unexpectedIndent = () => getRawString('Diagnostic.unexpectedIndent'); export const unexpectedUnindent = () => getRawString('Diagnostic.unexpectedUnindent'); + export const unhashableDictKey = () => getRawString('Diagnostic.unhashableDictKey'); + export const unhashableSetEntry = () => getRawString('Diagnostic.unhashableSetEntry'); + export const unionForwardReferenceNotAllowed = () => getRawString('Diagnostic.unionForwardReferenceNotAllowed'); export const unionSyntaxIllegal = () => getRawString('Diagnostic.unionSyntaxIllegal'); export const unionTypeArgCount = () => getRawString('Diagnostic.unionTypeArgCount'); export const uninitializedInstanceVariable = () => new ParameterizedString<{ name: string }>(getRawString('Diagnostic.uninitializedInstanceVariable')); + export const unmatchedEndregionComment = () => getRawString('Diagnostic.unmatchedEndregionComment'); + export const unmatchedRegionComment = () => getRawString('Diagnostic.unmatchedRegionComment'); export const unnecessaryCast = () => new ParameterizedString<{ type: string }>(getRawString('Diagnostic.unnecessaryCast')); export const unnecessaryIsInstanceAlways = () => @@ -973,6 +1028,9 @@ export namespace Localizer { export const walrusIllegal = () => getRawString('Diagnostic.walrusIllegal'); export const walrusNotAllowed = () => getRawString('Diagnostic.walrusNotAllowed'); export const wildcardInFunction = () => getRawString('Diagnostic.wildcardInFunction'); + export const wildcardPatternTypeUnknown = () => getRawString('Diagnostic.wildcardPatternTypeUnknown'); + export const wildcardPatternTypePartiallyUnknown = () => + getRawString('Diagnostic.wildcardPatternTypePartiallyUnknown'); export const wildcardLibraryImport = () => getRawString('Diagnostic.wildcardLibraryImport'); export const yieldFromIllegal = () => getRawString('Diagnostic.yieldFromIllegal'); export const yieldFromOutsideAsync = () => getRawString('Diagnostic.yieldFromOutsideAsync'); @@ -1005,9 +1063,13 @@ export namespace Localizer { new ParameterizedString<{ types: string }>(getRawString('DiagnosticAddendum.argumentTypes')); export const assignToNone = () => getRawString('DiagnosticAddendum.assignToNone'); export const asyncHelp = () => getRawString('DiagnosticAddendum.asyncHelp'); - export const baseClassProvidesType = () => + export const baseClassOverriddenType = () => + new ParameterizedString<{ baseClass: string; type: string }>( + getRawString('DiagnosticAddendum.baseClassOverriddenType') + ); + export const baseClassOverridesType = () => new ParameterizedString<{ baseClass: string; type: string }>( - getRawString('DiagnosticAddendum.baseClassProvidesType') + getRawString('DiagnosticAddendum.baseClassOverridesType') ); export const dataClassFrozen = () => new ParameterizedString<{ name: string }>(getRawString('DiagnosticAddendum.dataClassFrozen')); @@ -1150,7 +1212,6 @@ export namespace Localizer { new ParameterizedString<{ index: number; sourceType: string; destType: string }>( getRawString('DiagnosticAddendum.paramAssignment') ); - export const paramSpecOverload = () => getRawString('DiagnosticAddendum.paramSpecOverload'); export const paramType = () => new ParameterizedString<{ paramType: string }>(getRawString('DiagnosticAddendum.paramType')); export const privateImportFromPyTypedSource = () => @@ -1196,10 +1257,6 @@ export namespace Localizer { new ParameterizedString<{ expected: number; received: number }>( getRawString('DiagnosticAddendum.tupleSizeMismatch') ); - export const tupleSizeMismatchIndeterminate = () => - new ParameterizedString<{ expected: number }>( - getRawString('DiagnosticAddendum.tupleSizeMismatchIndeterminate') - ); export const typeAssignmentMismatch = () => new ParameterizedString<{ sourceType: string; destType: string }>( getRawString('DiagnosticAddendum.typeAssignmentMismatch') @@ -1256,18 +1313,22 @@ export namespace Localizer { new ParameterizedString<{ name: string; type: string }>(getRawString('DiagnosticAddendum.typeOfSymbol')); export const typeUnsupported = () => new ParameterizedString<{ type: string }>(getRawString('DiagnosticAddendum.typeUnsupported')); + export const typeVarDefaultOutOfScope = () => + new ParameterizedString<{ name: string }>(getRawString('DiagnosticAddendum.typeVarDefaultOutOfScope')); export const typeVarIsContravariant = () => new ParameterizedString<{ name: string }>(getRawString('DiagnosticAddendum.typeVarIsContravariant')); export const typeVarIsCovariant = () => new ParameterizedString<{ name: string }>(getRawString('DiagnosticAddendum.typeVarIsCovariant')); export const typeVarIsInvariant = () => new ParameterizedString<{ name: string }>(getRawString('DiagnosticAddendum.typeVarIsInvariant')); - export const typeVarTupleRequiresKnownLength = () => - getRawString('DiagnosticAddendum.typeVarTupleRequiresKnownLength'); - export const typeVarNotAllowed = () => getRawString('DiagnosticAddendum.typeVarNotAllowed'); export const typeVarsMissing = () => new ParameterizedString<{ names: string }>(getRawString('DiagnosticAddendum.typeVarsMissing')); + export const typeVarNotAllowed = () => getRawString('DiagnosticAddendum.typeVarNotAllowed'); + export const typeVarTupleRequiresKnownLength = () => + getRawString('DiagnosticAddendum.typeVarTupleRequiresKnownLength'); export const typeVarUnsolvableRemedy = () => getRawString('DiagnosticAddendum.typeVarUnsolvableRemedy'); + export const unhashableType = () => + new ParameterizedString<{ type: string }>(getRawString('DiagnosticAddendum.unhashableType')); export const unreachableExcept = () => new ParameterizedString<{ exceptionType: string; parentType: string }>( getRawString('DiagnosticAddendum.unreachableExcept') @@ -1276,6 +1337,14 @@ export namespace Localizer { export const useListInstead = () => getRawString('DiagnosticAddendum.useListInstead'); export const useTupleInstead = () => getRawString('DiagnosticAddendum.useTupleInstead'); export const useTypeInstead = () => getRawString('DiagnosticAddendum.useTypeInstead'); + export const varianceMismatchForClass = () => + new ParameterizedString<{ typeVarName: string; className: string }>( + getRawString('DiagnosticAddendum.varianceMismatchForClass') + ); + export const varianceMismatchForTypeAlias = () => + new ParameterizedString<{ typeVarName: string; typeAliasParam: string }>( + getRawString('DiagnosticAddendum.varianceMismatchForTypeAlias') + ); } export namespace CodeAction { @@ -1289,6 +1358,10 @@ export namespace Localizer { new ParameterizedString<{ count: number }>(getRawString('CodeAction.filesToAnalyzeCount')); export const findingReferences = () => getRawString('CodeAction.findingReferences'); export const organizeImports = () => getRawString('CodeAction.organizeImports'); + export const renameShadowedFile = () => + new ParameterizedString<{ newFile: string; oldFile: string }>( + getRawString('CodeAction.renameShadowedFile') + ); } export namespace Refactoring { diff --git a/packages/pyright-internal/src/localization/package.nls.en-us.json b/packages/pyright-internal/src/localization/package.nls.en-us.json index 6bd96719e..0ec04db15 100644 --- a/packages/pyright-internal/src/localization/package.nls.en-us.json +++ b/packages/pyright-internal/src/localization/package.nls.en-us.json @@ -3,7 +3,7 @@ "annotatedParamCountMismatch": "Parameter annotation count mismatch: expected {expected} but received {received}", "annotatedTypeArgMissing": "Expected one type argument and one or more annotations for \"Annotated\"", "annotationFormatString": "Type annotations cannot use format string literals (f-strings)", - "annotationNotSupported": "Type annotation not supported for this type of expression", + "annotationNotSupported": "Type annotation not supported for this statement", "annotationSpansStrings": "Type annotations cannot span multiple string literals", "annotationStringEscape": "Type annotations cannot contain escape characters", "argAssignment": "Argument of type \"{argType}\" cannot be assigned to parameter of type \"{paramType}\"", @@ -41,6 +41,7 @@ "breakOutsideLoop": "\"break\" can be used only within a loop", "callableExtraArgs": "Expected only two type arguments to \"Callable\"", "callableFirstArg": "Expected parameter type list or \"...\"", + "callableNotInstantiable": "Cannot instantiate type \"{type}\"", "callableSecondArg": "Expected return type as second type argument for \"Callable\"", "casePatternIsIrrefutable": "Irrefutable pattern is allowed only for the last case statement", "classAlreadySpecialized": "Type \"{type}\" is already specialized", @@ -60,6 +61,7 @@ "classVarWithTypeVar": "\"ClassVar\" type cannot include type variables", "clsSelfParamTypeMismatch": "Type of parameter \"{name}\" must be a supertype of its class \"{classType}\"", "codeTooComplexToAnalyze": "Code is too complex to analyze; reduce complexity by refactoring into subroutines or reducing conditional code paths", + "collectionAliasInstantiation": "Type \"{type}\" cannot be instantiated, use \"{alias}\" instead", "comparisonAlwaysFalse": "Condition will always evaluate to False since the types \"{leftType}\" and \"{rightType}\" have no overlap", "comparisonAlwaysTrue": "Condition will always evaluate to True since the types \"{leftType}\" and \"{rightType}\" have no overlap", "comprehensionInDict": "Comprehension cannot be used with other dictionary entries", @@ -73,9 +75,11 @@ "continueInFinally": "\"continue\" cannot be used within a finally clause", "continueOutsideLoop": "\"continue\" can be used only within a loop", "constructorNoArgs": "Expected no arguments to \"{type}\" constructor", + "dataClassBaseClassFrozen": "A non-frozen class cannot inherit from a class that is frozen", "dataClassBaseClassNotFrozen": "A frozen class cannot inherit from a class that is not frozen", "dataClassFieldWithDefault": "Fields without default values cannot appear after fields with default values", "dataClassFieldWithoutAnnotation": "Dataclass field without type annotation will cause runtime exception", + "dataClassFieldWithPrivateName": "Dataclass field cannot use private name", "dataClassPostInitParamCount": "Dataclass __post_init__ incorrect parameter count; number of InitVar fields is {expected}", "dataClassPostInitType": "Dataclass __post_init__ method parameter type mismatch for field \"{fieldName}\"", "dataClassSlotsOverwrite": "__slots__ is already defined in class", @@ -87,7 +91,9 @@ "declaredReturnTypeUnknown": "Declared return type is unknown", "defaultValueContainsCall": "Function calls and mutable objects not allowed within parameter default value expression", "defaultValueNotAllowed": "Parameter with \"*\" or \"**\" cannot have default value", - "defaultValueNotEllipsis": "Default values in stub files should be specified as \"...\"", + "deprecatedClass": "The class \"{name}\" is deprecated", + "deprecatedConstructor": "The constructor for class \"{name}\" is deprecated", + "deprecatedFunction": "This function \"{name}\" is deprecated", "deprecatedType": "This type is deprecated as of Python {version}; use \"{replacement}\" instead", "delTargetExpr": "Expression cannot be deleted", "dictExpandIllegalInComprehension": "Dictionary expansion not allowed in comprehension", @@ -114,7 +120,7 @@ "enumClassOverride": "Enum class \"{name}\" is final and cannot be subclassed", "exceptionGroupIncompatible": "Exception group syntax (\"except*\") requires Python 3.11 or newer", "exceptionTypeIncorrect": "\"{type}\" does not derive from BaseException", - "exceptionTypeNotClass": "\"{type}\" is not valid exception class", + "exceptionTypeNotClass": "\"{type}\" is not a valid exception class", "exceptionTypeNotInstantiable": "Constructor for exception type \"{type}\" requires one or more arguments", "expectedAfterDecorator": "Expected function or class declaration after decorator", "expectedArrow": "Expected \"->\" followed by return type annotation", @@ -181,6 +187,7 @@ "functionDecoratorTypeUnknown": "Untyped function decorator obscures type of function; ignoring decorator", "functionInConditionalExpression": "Conditional expression references function which always evaluates to True", "functionTypeParametersIllegal": "Function type parameter syntax requires Python 3.12 or newer", + "futureImportLocationNotAllowed": "Imports from __future__ must be at the beginning of the file", "generatorAsyncReturnType": "Return type of async generator function must be \"AsyncGenerator\" or \"AsyncIterable\"", "generatorNotParenthesized": "Generator expressions must be parenthesized if not sole argument", "generatorSyncReturnType": "Return type of generator function must be \"Generator\" or \"Iterable\"", @@ -220,6 +227,7 @@ "keyValueInSet": "Key/value pairs are not allowed within a set", "keywordArgInTypeArgument": "Keyword arguments cannot be used in type argument lists", "keywordOnlyAfterArgs": "Keyword-only argument separator not allowed after \"*\" parameter", + "keywordParameterMissing": "One or more keyword parameters must follow \"*\" parameter", "keywordSubscriptIllegal": "Keyword arguments within subscripts are not supported", "lambdaReturnTypeUnknown": "Return type of lambda is unknown", "lambdaReturnTypePartiallyUnknown": "Return type of lambda, \"{returnType}\", is partially unknown", @@ -246,7 +254,7 @@ "missingSuperCall": "Method \"{methodName}\" does not call the method of the same name in parent class", "moduleAsType": "Module cannot be used as a type", "moduleNotCallable": "Module is not callable", - "moduleUnknownMember": "\"{name}\" is not a known member of module", + "moduleUnknownMember": "\"{memberName}\" is not a known member of module \"{moduleName}\"", "namedExceptAfterCatchAll": "A named except clause cannot appear after catch-all except clause", "namedParamAfterParamSpecArgs": "Keyword parameter \"{name}\" cannot appear in signature after ParamSpec args parameter", "namedTupleEmptyName": "Names within a named tuple cannot be empty", @@ -257,8 +265,10 @@ "namedTupleNoTypes": "\"namedtuple\" provides no types for tuple entries; use \"NamedTuple\" instead", "namedTupleSecondArg": "Expected named tuple entry list as second argument", "newClsParam": "__new__ override should take a \"cls\" parameter", + "newTypeBadName": "The first argument to NewType must be a string literal", "newTypeLiteral": "NewType cannot be used with Literal type", "newTypeNotAClass": "Expected class as second argument to NewType", + "newTypeParamCount": "NewType requires two positional arguments", "newTypeProtocolClass": "NewType cannot be used with protocol class", "nonDefaultAfterDefault": "Non-default argument follows default argument", "noneNotCallable": "Object of type \"None\" cannot be called", @@ -294,7 +304,8 @@ "overloadReturnTypeMismatch": "Overload {prevIndex} for \"{name}\" overlaps overload {newIndex} and returns an incompatible type", "overloadWithImplementation": "\"{name}\" is marked as overload, but it includes an implementation", "overloadWithoutImplementation": "\"{name}\" is marked as overload, but no implementation is provided", - "overwriteTypeParameter": "Cannot overwrite type parameter \"{name}\"", + "overriddenMethodNotFound": "Method \"{name}\" is marked as override, but no base method of same name is present", + "overrideDecoratorMissing": "Method \"{name}\" is not marked as override but is overriding a method in class \"{className}\"", "paramAfterKwargsParam": "Parameter cannot follow \"**\" parameter", "paramAlreadyAssigned": "Parameter \"{name}\" is already assigned", "paramAnnotationMissing": "Type annotation is missing for parameter \"{name}\"", @@ -304,10 +315,12 @@ "paramSpecArgsUsage": "\"args\" member of ParamSpec is valid only when used with *args parameter", "paramSpecAssignedName": "ParamSpec must be assigned to a variable named \"{name}\"", "paramSpecContext": "ParamSpec not allowed in this context", + "paramSpecDefaultNotTuple": "Expected ellipsis, a tuple expression, or ParamSpec for default value of ParamSpec", "paramSpecFirstArg": "Expected name of ParamSpec as first argument", "paramSpecKwargsUsage": "\"kwargs\" member of ParamSpec is valid only when used with **kwargs parameter", "paramSpecNotBound": "Param spec \"{type}\" has no bound value", "paramSpecNotUsedByOuterScope": "ParamSpec \"{name}\" has no meaning in this context", + "paramSpecScopedToReturnType": "ParamSpec \"{name}\" is scoped to a callable within the return type and cannot be referenced in the function body", "paramSpecUnknownArg": "ParamSpec does not support more than one argument", "paramSpecUnknownMember": "\"{name}\" is not a known member of ParamSpec", "paramSpecUnknownParam": "\"{name}\" is unknown parameter to ParamSpec", @@ -316,6 +329,7 @@ "paramTypeUnknown": "Type of parameter \"{paramName}\" is unknown", "paramTypePartiallyUnknown": "Type of parameter \"{paramName}\" is partially unknown", "parenthesizedContextManagerIllegal": "Parentheses within \"with\" statement requires Python 3.9 or newer", + "patternNeverMatches": "Pattern will never be matched for subject type \"{type}\"", "positionArgAfterNamedArg": "Positional argument cannot appear after keyword arguments", "privateImportFromPyTypedModule": "\"{name}\" is not exported from module \"{module}\"", "positionOnlyAfterArgs": "Position-only argument separator not allowed after \"*\" parameter", @@ -332,16 +346,23 @@ "protocolIllegal": "Use of \"Protocol\" requires Python 3.7 or newer", "protocolMemberNotClassVar": "Protocol class \"{className}\" does not define \"{memberName}\" as a ClassVar", "protocolNotAllowedInTypeArgument": "\"Protocol\" cannot be used as a type argument", + "protocolUsedInCall": "Protocol class cannot be used in \"{name}\" call", "protocolVarianceContravariant": "Type variable \"{variable}\" used in generic protocol \"{class}\" should be contravariant", "protocolVarianceCovariant": "Type variable \"{variable}\" used in generic protocol \"{class}\" should be covariant", "protocolVarianceInvariant": "Type variable \"{variable}\" used in generic protocol \"{class}\" should be invariant", - "protocolUsedInCall": "Protocol class cannot be used in \"{name}\" call", + "pyrightCommentInvalidDiagnosticBoolValue": "Pyright comment directive must be followed by \"=\" and a value of true or false", + "pyrightCommentInvalidDiagnosticSeverityValue": "Pyright comment directive must be followed by \"=\" and a value of true, false, error, warning, information, or none", + "pyrightCommentMissingDirective": "Pyright comment must be followed by a directive (basic or strict) or a diagnostic rule", + "pyrightCommentUnknownDirective": "\"{directive}\" is an unknown directive for pyright comment; expected \"strict\" or \"basic\"", + "pyrightCommentUnknownDiagnosticRule": "\"{rule}\" is an unknown diagnostic rule for pyright comment", + "pyrightCommentUnknownDiagnosticSeverityValue": "\"{value}\" is invalid value for pyright comment; expected true, false, error, warning, information, or none", "relativeImportNotAllowed": "Relative imports cannot be used with \"import .a\" form; use \"from . import a\" instead", "recursiveDefinition": "Type of \"{name}\" could not be determined because it refers to itself", "requiredArgCount": "Expected a single type argument after \"Required\"", "requiredNotInTypedDict": "\"Required\" is not allowed in this context", + "returnInAsyncGenerator": "Return statement with value is not allowed in async generator", "returnOutsideFunction": "\"return\" can be used only within a function", - "returnMissing": "Function with declared type of \"{returnType}\" must return value", + "returnMissing": "Function with declared type of \"{returnType}\" must return value on all code paths", "returnTypeContravariant": "Contravariant type variable cannot be used in return type", "returnTypeMismatch": "Expression of type \"{exprType}\" cannot be assigned to return type \"{returnType}\"", "returnTypeUnknown": "Return type is unknown", @@ -362,6 +383,7 @@ "starPatternInOrPattern": "Star pattern cannot be ORed within other patterns", "starStarWildcardNotAllowed": "** cannot be used with wildcard \"_\"", "staticClsSelfParam": "Static methods should not take a \"self\" or \"cls\" parameter", + "stdlibModuleOverridden": "\"{path}\" is overriding the stdlib module \"{name}\"", "strictTypeGuardReturnType": "Return type of StrictTypeGuard (\"{returnType}\") is not assignable to value parameter type (\"{type}\")", "stringNonAsciiBytes": "Non-ASCII character not allowed in bytes string literal", "stringNotSubscriptable": "String expression cannot be subscripted in type annotation; enclose entire annotation in quotes", @@ -384,8 +406,8 @@ "tupleAssignmentMismatch": "Expression with type \"{type}\" cannot be assigned to target tuple", "tupleInAnnotation": "Tuple expression not allowed in type annotation", "tupleIndexOutOfRange": "Index {index} is out of range for type {type}", + "typeAliasIllegalExpressionForm": "Invalid expression form for type alias definition", "typeAliasIsRecursiveDirect": "Type alias \"{name}\" cannot use itself in its definition", - "typeAliasIsRecursiveIndirect": "Type alias \"{name}\" cannot refer to itself indirectly in its definition", "typeAliasNotInModuleOrClass": "A TypeAlias can be defined only within a module or class scope", "typeAliasRedeclared": "\"{name}\" is declared as a TypeAlias and can be assigned only once", "typeAliasStatementIllegal": "Type alias statement requires Python 3.12 or newer", @@ -416,8 +438,9 @@ "typedDictSecondArgDictEntry": "Expected simple dictionary entry", "typedDictSet": "Could not assign item in TypedDict", "typedDictTotalParam": "Expected \"total\" parameter to have a value of True or False", - "typeExpectedClass": "Expected class type but received \"{type}\"", + "typeExpectedClass": "Expected type expression but received \"{type}\"", "typeGuardArgCount": "Expected a single type argument after \"TypeGuard\"", + "typeGuardParamCount": "User-defined type guard functions and methods must have at least one input parameter", "typeNotAwaitable": "\"{type}\" is not awaitable", "typeNotCallable": "\"{expression}\" has type \"{type}\" and is not callable", "typeNotIntantiable": "\"{type}\" cannot be instantiated", @@ -434,38 +457,51 @@ "typeParameterExistingTypeParameter": "Type parameter \"{name}\" is already in use", "typeParametersMissing": "At least one type parameter must be specified", "typeParameterNotDeclared": "Type parameter \"{name}\" is not included in the type parameter list for \"{container}\"", - "typeParameterOutOfScope": "Type parameter \"{name}\" has no meaning in this context", "typePartiallyUnknown": "Type of \"{name}\" is partially unknown", "typeUnknown": "Type of \"{name}\" is unknown", "typeVarAssignedName": "TypeVar must be assigned to a variable named \"{name}\"", "typeVarAssignmentMismatch": "Type \"{type}\" cannot be assigned to type variable \"{name}\"", "typeVarBoundAndConstrained": "TypeVar cannot be both bound and constrained", + "typeVarBoundGeneric": "TypeVar bound type cannot be generic", + "typeVarConstraintGeneric": "TypeVar constraint type cannot be generic", + "typeVarDefaultBoundMismatch": "TypeVar default type must be a subtype of the bound type", + "typeVarDefaultConstraintMismatch": "TypeVar default type must be one of the constrained types", "typeVarFirstArg": "Expected name of TypeVar as first argument", - "typeVarGeneric": "TypeVar bound type cannot be generic", + "typeVarDefaultInvalidTypeVar": "Type parameter \"{name}\" has a default type that refers to one or more type variables that are out of scope", "typeVarNoMember": "TypeVar \"{type}\" has no member \"{name}\"", "typeVarNotSubscriptable": "TypeVar \"{type}\" is not subscriptable", "typeVarNotUsedByOuterScope": "Type variable \"{name}\" has no meaning in this context", "typeVarPossiblyUnsolvable": "Type variable \"{name}\" may go unsolved if caller supplies no argument for parameter \"{param}\"", + "typeVarScopedToReturnType": "Type variable \"{name}\" is scoped to a callable within the return type and cannot be referenced in the function body", "typeVarSingleConstraint": "TypeVar must have at least two constrained types", "typeVarsNotInGenericOrProtocol": "Generic[] or Protocol[] must include all type variables", "typeVarTupleContext": "TypeVarTuple not allowed in this context", + "typeVarTupleDefaultNotUnpacked": "TypeVarTuple default type must be an unpacked tuple or TypeVarTuple", "typeVarTupleMustBeUnpacked": "Unpack operator is required for TypeVarTuple value", + "typeVarTupleUnknownParam": "\"{name}\" is unknown parameter to TypeVarTuple", "typeVarUnknownParam": "\"{name}\" is unknown parameter to TypeVar", "typeVarUsedByOuterScope": "TypeVar \"{name}\" is already in use by an outer scope", "typeVarUsedOnlyOnce": "TypeVar \"{name}\" appears only once in generic function signature", "typeVarVariance": "TypeVar cannot be both covariant and contravariant", + "typeVarWithoutDefault": "\"{name}\" cannot appear after \"{other}\" in type parameter list because it has no default type", "unaccessedClass": "Class \"{name}\" is not accessed", "unaccessedFunction": "Function \"{name}\" is not accessed", "unaccessedImport": "Import \"{name}\" is not accessed", "unaccessedSymbol": "\"{name}\" is not accessed", "unaccessedVariable": "Variable \"{name}\" is not accessed", + "unannotatedFunctionSkipped": "Analysis of function \"{name}\" is skipped because it is unannotated", "unexpectedAsyncToken": "Expected \"def\", \"with\" or \"for\" to follow \"async\"", "unexpectedExprToken": "Unexpected token at end of expression", "unexpectedIndent": "Unexpected indentation", "unexpectedUnindent": "Unindent not expected", + "unhashableDictKey": "Dictionary key must be hashable", + "unhashableSetEntry": "Set entry must be hashable", + "unionForwardReferenceNotAllowed": "Union syntax cannot be used with string operand; use quotes around entire expression", "unionSyntaxIllegal": "Alternative syntax for unions requires Python 3.10 or newer", "unionTypeArgCount": "Union requires two or more type arguments", "uninitializedInstanceVariable": "Instance variable \"{name}\" is not initialized in the class body or __init__ method", + "unmatchedEndregionComment": "#endregion is missing corresponding #region", + "unmatchedRegionComment": "#region is missing corresponding #endregion", "unnecessaryCast": "Unnecessary \"cast\" call; type is already \"{type}\"", "unnecessaryIsInstanceAlways": "Unnecessary isinstance call; \"{testType}\" is always an instance of \"{classType}\"", "unnecessaryIsSubclassAlways": "Unnecessary issubclass call; \"{testType}\" is always a subclass of \"{classType}\"", @@ -500,8 +536,10 @@ "variadicTypeParamTooManyAlias": "Type alias can have at most one TypeVarTuple type parameter but received multiple ({names})", "variadicTypeParamTooManyClass": "Generic class can have at most one TypeVarTuple type parameter but received multiple ({names})", "walrusIllegal": "Operator \":=\" requires Python 3.8 or newer", - "walrusNotAllowed": "Operator \":=\" not allowed in this context", + "walrusNotAllowed": "Operator \":=\" not allowed in this context without surrounding parentheses", "wildcardInFunction": "Wildcard import not allowed within a class or function", + "wildcardPatternTypeUnknown": "Type captured by wildcard pattern is unknown", + "wildcardPatternTypePartiallyUnknown": "Type captured by wildcard pattern is partially unknown", "wildcardLibraryImport": "Wildcard import from a library not allowed", "yieldFromIllegal": "Use of \"yield from\" requires Python 3.3 or newer", "yieldFromOutsideAsync": "\"yield from\" not allowed in an async function", @@ -520,7 +558,8 @@ "argumentTypes": "Argument types: ({types})", "assignToNone": "Type cannot be assigned to type \"None\"", "asyncHelp": "Did you mean \"async with\"?", - "baseClassProvidesType": "Base class \"{baseClass}\" provides type \"{type}\"", + "baseClassOverriddenType": "Base class \"{baseClass}\" provides type \"{type}\", which is overridden", + "baseClassOverridesType": "Base class \"{baseClass}\" overrides with type \"{type}\"", "dataClassFieldLocation": "Field declaration", "dataClassFrozen": "\"{name}\" is frozen", "finalMethod": "Final method", @@ -584,7 +623,6 @@ "overrideReturnType": "Return type mismatch: base method returns type \"{baseType}\", override returns type \"{overrideType}\"", "overrideType": "Base class defines type as \"{type}\"", "paramAssignment": "Parameter {index}: type \"{sourceType}\" cannot be assigned to type \"{destType}\"", - "paramSpecOverload": "ParamSpec cannot be used with overloaded function", "paramType": "Parameter type is \"{paramType}\"", "privateImportFromPyTypedSource": "Import from \"{module}\" instead", "propertyAccessFromProtocolClass": "A property defined within a protocol class cannot be accessed as a class variable", @@ -607,7 +645,6 @@ "tupleEntryTypeMismatch": "Tuple entry {entry} is incorrect type", "tupleAssignmentMismatch": "Type \"{type}\" is incompatible with target tuple", "tupleSizeMismatch": "Element size mismatch; expected {expected} but received {received}", - "tupleSizeMismatchIndeterminate": "Tuple size mismatch; expected {expected} but received indeterminate number", "typeAssignmentMismatch": "Type \"{sourceType}\" cannot be assigned to type \"{destType}\"", "typeBound": "Type \"{sourceType}\" is incompatible with bound type \"{destType}\" for type variable \"{name}\"", "typeConstrainedTypeVar": "Type \"{type}\" is incompatible with constrained type variable \"{name}\"", @@ -625,6 +662,7 @@ "typeNotStringLiteral": "\"{type}\" is not a string literal", "typeOfSymbol": "Type of \"{name}\" is \"{type}\"", "typeUnsupported": "Type \"{type}\" is unsupported", + "typeVarDefaultOutOfScope": "Type variable \"{name}\" is not in scope", "typeVarIsContravariant": "TypeVar \"{name}\" is contravariant", "typeVarIsCovariant": "TypeVar \"{name}\" is covariant", "typeVarIsInvariant": "TypeVar \"{name}\" is invariant", @@ -632,11 +670,14 @@ "typeVarUnsolvableRemedy": "Provide an overload that specifies the return type when the argument is not supplied", "typeVarsMissing": "Missing type variables: {names}", "typeVarTupleRequiresKnownLength": "TypeVarTuple cannot be bound to a tuple of unknown length", + "unhashableType": "Type \"{type}\" is not hashable", "unreachableExcept": "\"{exceptionType}\" is a subclass of \"{parentType}\"", "useDictInstead": "Use Dict[T1, T2] to indicate a dictionary type", "useListInstead": "Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type", "useTupleInstead": "Use Tuple[T1, ..., Tn] to indicate a tuple type or Union[T1, T2] to indicate a union type", - "useTypeInstead": "Use Type[T] instead" + "useTypeInstead": "Use Type[T] instead", + "varianceMismatchForClass": "Variance of type argument \"{typeVarName}\" is incompatible with base class \"{className}\"", + "varianceMismatchForTypeAlias": "Variance of type argument \"{typeVarName}\" is incompatible with \"{typeAliasParam}\"" }, "CodeAction": { "addOptionalToAnnotation": "Add \"Optional\" to Type Annotation", @@ -646,7 +687,8 @@ "filesToAnalyzeOne": "1 file to analyze", "filesToAnalyzeCount": "{count} files to analyze", "findingReferences": "Finding references", - "organizeImports": "Organize Imports" + "organizeImports": "Organize Imports", + "renameShadowedFile": "Rename \"{oldFile}\" to \"{newFile}\"" }, "Refactoring": { "moveFile": "Do you want to update all import references for \"{oldModuleName}\" to \"{newModuleName}\"?", diff --git a/packages/pyright-internal/src/parser/parseNodes.ts b/packages/pyright-internal/src/parser/parseNodes.ts index 7d523aa1e..27e44e698 100644 --- a/packages/pyright-internal/src/parser/parseNodes.ts +++ b/packages/pyright-internal/src/parser/parseNodes.ts @@ -736,7 +736,6 @@ export function isExpressionNode(node: ParseNode): node is ExpressionNode { case ParseNodeType.FormatString: case ParseNodeType.StringList: case ParseNodeType.Dictionary: - case ParseNodeType.DictionaryExpandEntry: case ParseNodeType.List: case ParseNodeType.Set: return true; @@ -886,6 +885,7 @@ export interface AssignmentNode extends ParseNodeBase { leftExpression: ExpressionNode; rightExpression: ExpressionNode; typeAnnotationComment?: ExpressionNode | undefined; + chainedTypeAnnotationComment?: ExpressionNode | undefined; } export namespace AssignmentNode { @@ -919,10 +919,16 @@ export interface TypeParameterNode extends ParseNodeBase { name: NameNode; typeParamCategory: TypeParameterCategory; boundExpression?: ExpressionNode; + defaultExpression?: ExpressionNode; } export namespace TypeParameterNode { - export function create(name: NameNode, typeParamCategory: TypeParameterCategory, boundExpression?: ExpressionNode) { + export function create( + name: NameNode, + typeParamCategory: TypeParameterCategory, + boundExpression?: ExpressionNode, + defaultExpression?: ExpressionNode + ) { const node: TypeParameterNode = { start: name.start, length: name.length, @@ -931,6 +937,7 @@ export namespace TypeParameterNode { name, typeParamCategory, boundExpression, + defaultExpression, }; name.parent = node; @@ -940,6 +947,11 @@ export namespace TypeParameterNode { extendRange(node, boundExpression); } + if (defaultExpression) { + defaultExpression.parent = node; + extendRange(node, defaultExpression); + } + return node; } } diff --git a/packages/pyright-internal/src/parser/parser.ts b/packages/pyright-internal/src/parser/parser.ts index 1f9ed1c15..8145efb87 100644 --- a/packages/pyright-internal/src/parser/parser.ts +++ b/packages/pyright-internal/src/parser/parser.ts @@ -169,7 +169,7 @@ export interface ParseResults { text: string; parseTree: ModuleNode; importedModules: ModuleImport[]; - futureImports: Map; + futureImports: Set; tokenizerOutput: TokenizerOutput; containsWildcardImport: boolean; typingSymbolAliases: Map; @@ -218,7 +218,7 @@ export class Parser { private _isParsingTypeAnnotation = false; private _isParsingIndexTrailer = false; private _isParsingQuotedText = false; - private _futureImportMap = new Map(); + private _futureImports = new Set(); private _importedModules: ModuleImport[] = []; private _containsWildcardImport = false; private _assignmentExpressionsAllowed = true; @@ -264,7 +264,7 @@ export class Parser { text: fileContents, parseTree: moduleNode, importedModules: this._importedModules, - futureImports: this._futureImportMap, + futureImports: this._futureImports, tokenizerOutput: this._tokenizerOutput!, containsWildcardImport: this._containsWildcardImport, typingSymbolAliases: this._typingSymbolAliases, @@ -520,7 +520,7 @@ export class Parser { return TypeParameterListNode.create(openBracketToken, closingToken, typeVariableNodes); } - // type_param: ['*' | '**'] NAME [':' expr] + // type_param: ['*' | '**'] NAME [':' bound_expr] ['=' default_expr] private _parseTypeParameter(): TypeParameterNode | undefined { let typeParamCategory = TypeParameterCategory.TypeVar; if (this._consumeTokenIfOperator(OperatorType.Multiply)) { @@ -538,16 +538,22 @@ export class Parser { const name = NameNode.create(nameToken); let boundExpression: ExpressionNode | undefined; - if (this._peekTokenType() === TokenType.Colon) { - this._getNextToken(); - boundExpression = this._parseTestExpression(/* allowAssignmentExpression */ false); + if (this._consumeTokenIfType(TokenType.Colon)) { + boundExpression = this._parseExpression(/* allowUnpack */ false); if (typeParamCategory !== TypeParameterCategory.TypeVar) { this._addError(Localizer.Diagnostic.typeParameterBoundNotAllowed(), boundExpression); } } - return TypeParameterNode.create(name, typeParamCategory, boundExpression); + let defaultExpression: ExpressionNode | undefined; + if (this._consumeTokenIfOperator(OperatorType.Assign)) { + defaultExpression = this._parseExpression( + /* allowUnpack */ typeParamCategory === TypeParameterCategory.TypeVarTuple + ); + } + + return TypeParameterNode.create(name, typeParamCategory, boundExpression, defaultExpression); } // match_stmt: "match" subject_expr ':' NEWLINE INDENT case_block+ DEDENT @@ -569,7 +575,7 @@ export class Parser { /* allowAssignmentExpression */ true, /* allowMultipleUnpack */ true, ErrorExpressionCategory.MissingPatternSubject, - Localizer.Diagnostic.expectedReturnExpr() + () => Localizer.Diagnostic.expectedReturnExpr() ); smellsLikeMatchStatement = expression.nodeType !== ParseNodeType.Error && this._peekToken().type === TokenType.Colon; @@ -588,7 +594,7 @@ export class Parser { /* allowAssignmentExpression */ true, /* allowMultipleUnpack */ true, ErrorExpressionCategory.MissingPatternSubject, - Localizer.Diagnostic.expectedReturnExpr() + () => Localizer.Diagnostic.expectedReturnExpr() ); const matchNode = MatchNode.create(matchToken, subjectExpression); @@ -602,56 +608,60 @@ export class Parser { if (this._consumeTokensUntilType([TokenType.NewLine, TokenType.Colon])) { this._getNextToken(); } - } else if (!this._consumeTokenIfType(TokenType.NewLine)) { - this._addError(Localizer.Diagnostic.expectedNewline(), nextToken); } else { - const possibleIndent = this._peekToken(); - if (!this._consumeTokenIfType(TokenType.Indent)) { - this._addError(Localizer.Diagnostic.expectedIndentedBlock(), this._peekToken()); - } else { - const indentToken = possibleIndent as IndentToken; - if (indentToken.isIndentAmbiguous) { - this._addError(Localizer.Diagnostic.inconsistentTabs(), indentToken); - } - } + extendRange(matchNode, nextToken); - while (true) { - // Handle a common error here and see if we can recover. - const nextToken = this._peekToken(); - if (nextToken.type === TokenType.Indent) { - this._getNextToken(); - const indentToken = nextToken as IndentToken; + if (!this._consumeTokenIfType(TokenType.NewLine)) { + this._addError(Localizer.Diagnostic.expectedNewline(), nextToken); + } else { + const possibleIndent = this._peekToken(); + if (!this._consumeTokenIfType(TokenType.Indent)) { + this._addError(Localizer.Diagnostic.expectedIndentedBlock(), this._peekToken()); + } else { + const indentToken = possibleIndent as IndentToken; if (indentToken.isIndentAmbiguous) { this._addError(Localizer.Diagnostic.inconsistentTabs(), indentToken); - } else { - this._addError(Localizer.Diagnostic.unexpectedIndent(), nextToken); } } - const caseStatement = this._parseCaseStatement(); - if (!caseStatement) { - // Perform basic error recovery to get to the next line. - if (this._consumeTokensUntilType([TokenType.NewLine, TokenType.Colon])) { + while (true) { + // Handle a common error here and see if we can recover. + const possibleUnexpectedIndent = this._peekToken(); + if (possibleUnexpectedIndent.type === TokenType.Indent) { this._getNextToken(); + const indentToken = possibleUnexpectedIndent as IndentToken; + if (indentToken.isIndentAmbiguous) { + this._addError(Localizer.Diagnostic.inconsistentTabs(), indentToken); + } else { + this._addError(Localizer.Diagnostic.unexpectedIndent(), possibleUnexpectedIndent); + } } - } else { - caseStatement.parent = matchNode; - matchNode.cases.push(caseStatement); - } - const dedentToken = this._peekToken() as DedentToken; - if (this._consumeTokenIfType(TokenType.Dedent)) { - if (!dedentToken.matchesIndent) { - this._addError(Localizer.Diagnostic.inconsistentIndent(), dedentToken); + const caseStatement = this._parseCaseStatement(); + if (!caseStatement) { + // Perform basic error recovery to get to the next line. + if (this._consumeTokensUntilType([TokenType.NewLine, TokenType.Colon])) { + this._getNextToken(); + } + } else { + caseStatement.parent = matchNode; + matchNode.cases.push(caseStatement); } - if (dedentToken.isDedentAmbiguous) { - this._addError(Localizer.Diagnostic.inconsistentTabs(), dedentToken); + + const dedentToken = this._peekToken() as DedentToken; + if (this._consumeTokenIfType(TokenType.Dedent)) { + if (!dedentToken.matchesIndent) { + this._addError(Localizer.Diagnostic.inconsistentIndent(), dedentToken); + } + if (dedentToken.isDedentAmbiguous) { + this._addError(Localizer.Diagnostic.inconsistentTabs(), dedentToken); + } + break; } - break; - } - if (this._peekTokenType() === TokenType.EndOfStream) { - break; + if (this._peekTokenType() === TokenType.EndOfStream) { + break; + } } } @@ -732,35 +742,35 @@ export class Parser { return false; } - private _getPatternTargetNames(node: PatternAtomNode, nameMap: Map): void { + private _getPatternTargetNames(node: PatternAtomNode, nameSet: Set): void { switch (node.nodeType) { case ParseNodeType.PatternSequence: { node.entries.forEach((subpattern) => { - this._getPatternTargetNames(subpattern, nameMap); + this._getPatternTargetNames(subpattern, nameSet); }); break; } case ParseNodeType.PatternClass: { node.arguments.forEach((arg) => { - this._getPatternTargetNames(arg.pattern, nameMap); + this._getPatternTargetNames(arg.pattern, nameSet); }); break; } case ParseNodeType.PatternAs: { if (node.target) { - nameMap.set(node.target.value, true); + nameSet.add(node.target.value); } node.orPatterns.forEach((subpattern) => { - this._getPatternTargetNames(subpattern, nameMap); + this._getPatternTargetNames(subpattern, nameSet); }); break; } case ParseNodeType.PatternCapture: { if (!node.isWildcard) { - nameMap.set(node.target.value, true); + nameSet.add(node.target.value); } break; } @@ -768,10 +778,10 @@ export class Parser { case ParseNodeType.PatternMapping: { node.entries.forEach((mapEntry) => { if (mapEntry.nodeType === ParseNodeType.PatternMappingExpandEntry) { - nameMap.set(mapEntry.target.value, true); + nameSet.add(mapEntry.target.value); } else { - this._getPatternTargetNames(mapEntry.keyPattern, nameMap); - this._getPatternTargetNames(mapEntry.valuePattern, nameMap); + this._getPatternTargetNames(mapEntry.keyPattern, nameSet); + this._getPatternTargetNames(mapEntry.valuePattern, nameSet); } }); break; @@ -876,17 +886,17 @@ export class Parser { }); // Validate that all bound variables are the same within all or patterns. - const fullNameMap = new Map(); + const fullNameSet = new Set(); orPatterns.forEach((orPattern) => { - this._getPatternTargetNames(orPattern, fullNameMap); + this._getPatternTargetNames(orPattern, fullNameSet); }); orPatterns.forEach((orPattern) => { - const localNameMap = new Map(); - this._getPatternTargetNames(orPattern, localNameMap); + const localNameSet = new Set(); + this._getPatternTargetNames(orPattern, localNameSet); - if (localNameMap.size < fullNameMap.size) { - const missingNames = Array.from(fullNameMap.keys()).filter((name) => !localNameMap.has(name)); + if (localNameSet.size < fullNameSet.size) { + const missingNames = Array.from(fullNameSet.keys()).filter((name) => !localNameSet.has(name)); const diag = new DiagnosticAddendum(); diag.addMessage( Localizer.DiagnosticAddendum.orPatternMissingName().format({ @@ -1403,11 +1413,12 @@ export class Parser { const possibleIndent = this._peekToken(); if (!this._consumeTokenIfType(TokenType.Indent)) { this._addError(Localizer.Diagnostic.expectedIndentedBlock(), this._peekToken()); - } else { - const indentToken = possibleIndent as IndentToken; - if (indentToken.isIndentAmbiguous) { - this._addError(Localizer.Diagnostic.inconsistentTabs(), indentToken); - } + return suite; + } + + const bodyIndentToken = possibleIndent as IndentToken; + if (bodyIndentToken.isIndentAmbiguous) { + this._addError(Localizer.Diagnostic.inconsistentTabs(), bodyIndentToken); } while (true) { @@ -1421,6 +1432,40 @@ export class Parser { } else { this._addError(Localizer.Diagnostic.unexpectedIndent(), nextToken); } + } else if (nextToken.type === TokenType.Dedent) { + // When we see a dedent, stop before parsing the dedented statement. + const dedentToken = nextToken as DedentToken; + if (!dedentToken.matchesIndent) { + this._addError(Localizer.Diagnostic.inconsistentIndent(), dedentToken); + } + if (dedentToken.isDedentAmbiguous) { + this._addError(Localizer.Diagnostic.inconsistentTabs(), dedentToken); + } + + // When the suite is incomplete (no statements), leave the dedent token for + // recovery. This allows a single dedent token to cause us to break out of + // multiple levels of nested suites. Also extend the suite's range in this + // case so it is multi-line as this works better with indentationUtils. + if (suite.statements.length > 0) { + this._consumeTokenIfType(TokenType.Dedent); + } else { + extendRange(suite, dedentToken); + } + + // Did this dedent take us to an indent amount that is less than the + // initial indent of the suite body? + if (!bodyIndentToken || dedentToken.indentAmount < bodyIndentToken.indentAmount) { + break; + } else if (dedentToken.indentAmount === bodyIndentToken.indentAmount) { + // If the next token is also a dedent that reduces the indent + // level to a less than the initial indent of the suite body, swallow + // the extra dedent to help recover the parse. + const nextToken = this._peekToken(); + if (this._consumeTokenIfType(TokenType.Dedent)) { + extendRange(suite, nextToken); + break; + } + } } const statement = this._parseStatement(); @@ -1432,17 +1477,6 @@ export class Parser { suite.statements.push(statement); } - const dedentToken = this._peekToken() as DedentToken; - if (this._consumeTokenIfType(TokenType.Dedent)) { - if (!dedentToken.matchesIndent) { - this._addError(Localizer.Diagnostic.inconsistentIndent(), dedentToken); - } - if (dedentToken.isDedentAmbiguous) { - this._addError(Localizer.Diagnostic.inconsistentTabs(), dedentToken); - } - break; - } - if (this._peekTokenType() === TokenType.EndOfStream) { break; } @@ -1468,7 +1502,7 @@ export class Parser { const targetExpr = this._parseExpressionListAsPossibleTuple( ErrorExpressionCategory.MissingExpression, - Localizer.Diagnostic.expectedExpr(), + () => Localizer.Diagnostic.expectedExpr(), forToken ); @@ -1487,7 +1521,7 @@ export class Parser { /* allowAssignmentExpression */ false, /* allowMultipleUnpack */ true, ErrorExpressionCategory.MissingExpression, - Localizer.Diagnostic.expectedInExpr() + () => Localizer.Diagnostic.expectedInExpr() ); forSuite = this._parseLoopSuite(); @@ -1589,7 +1623,7 @@ export class Parser { const targetExpr = this._parseExpressionListAsPossibleTuple( ErrorExpressionCategory.MissingExpression, - Localizer.Diagnostic.expectedExpr(), + () => Localizer.Diagnostic.expectedExpr(), forToken ); let seqExpr: ExpressionNode | undefined; @@ -1862,6 +1896,7 @@ export class Parser { let reportedNonDefaultParamErr = false; let sawKeywordOnlySeparator = false; let sawPositionOnlySeparator = false; + let sawKeywordOnlyParamAfterSeparator = false; let sawArgs = false; let sawKwArgs = false; @@ -1900,6 +1935,10 @@ export class Parser { } sawPositionOnlySeparator = true; } else { + if (sawKeywordOnlySeparator) { + sawKeywordOnlyParamAfterSeparator = true; + } + if (param.defaultValue) { sawDefaultParam = true; } else if (sawDefaultParam && !sawKeywordOnlySeparator && !sawArgs) { @@ -1935,6 +1974,11 @@ export class Parser { this._addError(Localizer.Diagnostic.duplicateKwargsParam(), param); } sawKwArgs = true; + + // A **kwargs cannot immediately follow a keyword-only separator ("*"). + if (sawKeywordOnlySeparator && !sawKeywordOnlyParamAfterSeparator) { + this._addError(Localizer.Diagnostic.keywordParameterMissing(), param); + } } else if (sawKwArgs) { this._addError(Localizer.Diagnostic.paramAfterKwargsParam(), param); } @@ -2317,7 +2361,7 @@ export class Parser { /* allowAssignmentExpression */ true, /* allowMultipleUnpack */ true, ErrorExpressionCategory.MissingExpression, - Localizer.Diagnostic.expectedReturnExpr() + () => Localizer.Diagnostic.expectedReturnExpr() ); this._reportConditionalErrorForStarTupleElement(returnExpr); returnNode.returnExpression = returnExpr; @@ -2390,8 +2434,8 @@ export class Parser { extendRange(importFromNode, importFromAsNode); if (isFutureImport) { - // Add the future import to the map. - this._futureImportMap.set(importName.value, true); + // Add the future import by name. + this._futureImports.add(importName.value); } const nextToken = this._peekToken(); @@ -2485,12 +2529,31 @@ export class Parser { importNode.list.push(importAsNode); importAsNode.parent = importNode; - this._importedModules.push({ - nameNode: importAsNode.module, - leadingDots: importAsNode.module.leadingDots, - nameParts: importAsNode.module.nameParts.map((p) => p.value), - importedSymbols: undefined, - }); + const nameParts = importAsNode.module.nameParts.map((p) => p.value); + + if ( + importAsNode.alias || + importAsNode.module.leadingDots > 0 || + importAsNode.module.nameParts.length === 0 + ) { + this._importedModules.push({ + nameNode: importAsNode.module, + leadingDots: importAsNode.module.leadingDots, + nameParts, + importedSymbols: undefined, + }); + } else { + // Implicitly import all modules in the multi-part name if we + // are not assigning the final module to an alias. + importAsNode.module.nameParts.forEach((_, index) => { + this._importedModules.push({ + nameNode: importAsNode.module, + leadingDots: importAsNode.module.leadingDots, + nameParts: nameParts.slice(0, index + 1), + importedSymbols: undefined, + }); + }); + } if (modName.nameParts.length === 1) { const firstNamePartValue = modName.nameParts[0].value; @@ -2644,11 +2707,11 @@ export class Parser { private _parseAssertStatement(): AssertNode { const assertToken = this._getKeywordToken(KeywordType.Assert); - const expr = this._parseTestExpression(/* allowAssignmentExpression */ true); + const expr = this._parseTestExpression(/* allowAssignmentExpression */ false); const assertNode = AssertNode.create(assertToken, expr); if (this._consumeTokenIfType(TokenType.Comma)) { - const exceptionExpr = this._parseTestExpression(/* allowAssignmentExpression */ true); + const exceptionExpr = this._parseTestExpression(/* allowAssignmentExpression */ false); assertNode.exceptionExpression = exceptionExpr; assertNode.exceptionExpression.parent = assertNode; extendRange(assertNode, exceptionExpr); @@ -2695,7 +2758,7 @@ export class Parser { /* allowAssignmentExpression */ true, /* allowMultipleUnpack */ true, ErrorExpressionCategory.MissingExpression, - Localizer.Diagnostic.expectedYieldExpr() + () => Localizer.Diagnostic.expectedYieldExpr() ); this._reportConditionalErrorForStarTupleElement(exprList); } @@ -2865,11 +2928,11 @@ export class Parser { private _parseExpressionListAsPossibleTuple( errorCategory: ErrorExpressionCategory, - errorString: string, + getErrorString: () => string, errorToken: Token ): ExpressionNode { if (this._isNextTokenNeverExpression()) { - this._addError(errorString, errorToken); + this._addError(getErrorString(), errorToken); return ErrorNode.create(errorToken, errorCategory); } @@ -2880,9 +2943,12 @@ export class Parser { return this._makeExpressionOrTuple(exprListResult, /* enclosedInParens */ false); } - private _parseTestListAsExpression(errorCategory: ErrorExpressionCategory, errorString: string): ExpressionNode { + private _parseTestListAsExpression( + errorCategory: ErrorExpressionCategory, + getErrorString: () => string + ): ExpressionNode { if (this._isNextTokenNeverExpression()) { - return this._handleExpressionParseError(errorCategory, errorString); + return this._handleExpressionParseError(errorCategory, getErrorString()); } const exprListResult = this._parseTestExpressionList(); @@ -2896,10 +2962,10 @@ export class Parser { allowAssignmentExpression: boolean, allowMultipleUnpack: boolean, errorCategory: ErrorExpressionCategory, - errorString: string + getErrorString: () => string ): ExpressionNode { if (this._isNextTokenNeverExpression()) { - return this._handleExpressionParseError(errorCategory, errorString); + return this._handleExpressionParseError(errorCategory, getErrorString()); } const exprListResult = this._parseTestOrStarExpressionList(allowAssignmentExpression, allowMultipleUnpack); @@ -2970,7 +3036,7 @@ export class Parser { return this._parseLambdaExpression(); } - const ifExpr = allowAssignmentExpression ? this._parseAssignmentExpression() : this._parseOrTest(); + const ifExpr = this._parseAssignmentExpression(!allowAssignmentExpression); if (ifExpr.nodeType === ParseNodeType.Error) { return ifExpr; } @@ -2985,16 +3051,17 @@ export class Parser { } if (!this._consumeTokenIfKeyword(KeywordType.Else)) { - return this._handleExpressionParseError( - ErrorExpressionCategory.MissingElse, - Localizer.Diagnostic.expectedElse() + return TernaryNode.create( + ifExpr, + testExpr, + this._handleExpressionParseError( + ErrorExpressionCategory.MissingElse, + Localizer.Diagnostic.expectedElse() + ) ); } const elseExpr = this._parseTestExpression(/* allowAssignmentExpression */ true); - if (elseExpr.nodeType === ParseNodeType.Error) { - return elseExpr; - } return TernaryNode.create(ifExpr, testExpr, elseExpr); } @@ -3579,7 +3646,10 @@ export class Parser { } if (nextTokenType !== TokenType.Colon) { - sliceExpressions[sliceIndex] = this._parseTestExpression(/* allowAssignmentExpression */ false); + // Python 3.10 and newer allow assignment expressions to be used inside of a subscript. + const allowAssignmentExpression = + this._parseOptions.isStubFile || this._getLanguageVersion() >= PythonVersion.V3_10; + sliceExpressions[sliceIndex] = this._parseTestExpression(allowAssignmentExpression); } sliceIndex++; @@ -3729,8 +3799,7 @@ export class Parser { // and emit an error. this._addError(Localizer.Diagnostic.backticksIllegal(), nextToken); - const expressionNode = this._parseTestListAsExpression( - ErrorExpressionCategory.MissingExpression, + const expressionNode = this._parseTestListAsExpression(ErrorExpressionCategory.MissingExpression, () => Localizer.Diagnostic.expectedExpr() ); @@ -3779,7 +3848,7 @@ export class Parser { return listNode; } else if (nextToken.type === TokenType.OpenCurlyBrace) { const dictNode = this._parseDictionaryOrSetAtom(); - if (this._isParsingTypeAnnotation) { + if (this._isParsingTypeAnnotation && !this._isParsingIndexTrailer) { const diag = new DiagnosticAddendum(); diag.addMessage(Localizer.DiagnosticAddendum.useDictInstead()); this._addError(Localizer.Diagnostic.dictInAnnotation() + diag.getString(), dictNode); @@ -3898,11 +3967,8 @@ export class Parser { const exprListResult = this._parseTestListWithComprehension(); const tupleOrExpression = this._makeExpressionOrTuple(exprListResult, /* enclosedInParens */ true); - const isExpression = exprListResult.list.length === 1 && !exprListResult.trailingComma; - if (!isExpression) { - extendRange(tupleOrExpression, startParen); - } + extendRange(tupleOrExpression, startParen); if (this._peekTokenType() !== TokenType.CloseParenthesis) { return this._handleExpressionParseError( @@ -3912,10 +3978,7 @@ export class Parser { exprListResult.parseError ?? tupleOrExpression ); } else { - const nextToken = this._getNextToken(); - if (!isExpression) { - extendRange(tupleOrExpression, nextToken); - } + extendRange(tupleOrExpression, this._getNextToken()); } return tupleOrExpression; @@ -4193,7 +4256,7 @@ export class Parser { /* allowAssignmentExpression */ false, /* allowMultipleUnpack */ false, ErrorExpressionCategory.MissingExpression, - Localizer.Diagnostic.expectedExpr() + () => Localizer.Diagnostic.expectedExpr() ); let annotationExpr: ExpressionNode | undefined; @@ -4231,7 +4294,7 @@ export class Parser { /* allowAssignmentExpression */ false, /* allowMultipleUnpack */ true, ErrorExpressionCategory.MissingExpression, - Localizer.Diagnostic.expectedAssignRightHandExpr() + () => Localizer.Diagnostic.expectedAssignRightHandExpr() ); this._isParsingTypeAnnotation = wasParsingTypeAnnotation; @@ -4249,8 +4312,7 @@ export class Parser { const rightExpr = this._tryParseYieldExpression() || - this._parseTestListAsExpression( - ErrorExpressionCategory.MissingExpression, + this._parseTestListAsExpression(ErrorExpressionCategory.MissingExpression, () => Localizer.Diagnostic.expectedBinaryRightHandExpr() ); @@ -4265,37 +4327,58 @@ export class Parser { } private _parseChainAssignments(leftExpr: ExpressionNode): ExpressionNode { - let rightExpr = - this._tryParseYieldExpression() || - this._parseTestOrStarListAsExpression( - /* allowAssignmentExpression */ false, - /* allowMultipleUnpack */ true, - ErrorExpressionCategory.MissingExpression, - Localizer.Diagnostic.expectedAssignRightHandExpr() - ); + // Make a list of assignment targets. + const assignmentTargets = [leftExpr]; + let rightExpr: ExpressionNode; - if (rightExpr.nodeType === ParseNodeType.Error) { - return AssignmentNode.create(leftExpr, rightExpr); - } + while (true) { + rightExpr = + this._tryParseYieldExpression() || + this._parseTestOrStarListAsExpression( + /* allowAssignmentExpression */ false, + /* allowMultipleUnpack */ true, + ErrorExpressionCategory.MissingExpression, + () => Localizer.Diagnostic.expectedAssignRightHandExpr() + ); - // Recur until we've consumed the entire chain. - if (this._consumeTokenIfOperator(OperatorType.Assign)) { - rightExpr = this._parseChainAssignments(rightExpr); if (rightExpr.nodeType === ParseNodeType.Error) { - return rightExpr; + break; } + + // Continue until we've consumed the entire chain. + if (!this._consumeTokenIfOperator(OperatorType.Assign)) { + break; + } + + assignmentTargets.push(rightExpr); } - const assignmentNode = AssignmentNode.create(leftExpr, rightExpr); + // Create a tree of assignment expressions starting with the first one. + // The final RHS value is assigned to the targets left to right in Python. + let assignmentNode = AssignmentNode.create(assignmentTargets[0], rightExpr); // Look for a type annotation comment at the end of the line. const typeAnnotationComment = this._parseVariableTypeAnnotationComment(); if (typeAnnotationComment) { - assignmentNode.typeAnnotationComment = typeAnnotationComment; - assignmentNode.typeAnnotationComment.parent = assignmentNode; - extendRange(assignmentNode, assignmentNode.typeAnnotationComment); + if (assignmentTargets.length > 1) { + // Type comments are not allowed for chained assignments for the + // same reason that variable type annotations don't support + // chained assignments. Note that a type comment was used here + // so it can be later reported as an error by the binder. + assignmentNode.chainedTypeAnnotationComment = typeAnnotationComment; + } else { + assignmentNode.typeAnnotationComment = typeAnnotationComment; + assignmentNode.typeAnnotationComment.parent = assignmentNode; + extendRange(assignmentNode, assignmentNode.typeAnnotationComment); + } } + assignmentTargets.forEach((target, index) => { + if (index > 0) { + assignmentNode = AssignmentNode.create(target, assignmentNode); + } + }); + return assignmentNode; } diff --git a/packages/pyright-internal/src/parser/stringTokenUtils.ts b/packages/pyright-internal/src/parser/stringTokenUtils.ts index 664f03e27..f3eadae54 100644 --- a/packages/pyright-internal/src/parser/stringTokenUtils.ts +++ b/packages/pyright-internal/src/parser/stringTokenUtils.ts @@ -241,7 +241,7 @@ export function getUnescapedString(stringToken: StringToken): UnescapedString { } strOffset++; } else { - if (isRaw) { + if (isRaw || (isFormat && formatSegment.isExpression)) { localValue = '\\' + String.fromCharCode(curChar); strOffset++; } else { @@ -460,6 +460,17 @@ export function getUnescapedString(stringToken: StringToken): UnescapedString { } if (strChar === Char.Backslash) { + if (isFormat) { + if (formatSegment.isExpression) { + // The last format segment was an unterminated expression. + output.unescapeErrors.push({ + offset: formatSegment.offset, + length: strOffset - formatSegment.offset, + errorType: UnescapeErrorType.UnterminatedFormatExpression, + }); + } + } + appendOutputChar(strChar); strOffset++; strChar = getEscapedCharacter(); diff --git a/packages/pyright-internal/src/parser/tokenizer.ts b/packages/pyright-internal/src/parser/tokenizer.ts index c5a614d14..fbb31636f 100644 --- a/packages/pyright-internal/src/parser/tokenizer.ts +++ b/packages/pyright-internal/src/parser/tokenizer.ts @@ -12,6 +12,7 @@ import Char from 'typescript-char'; +import { isWhitespace } from '../analyzer/parseTreeUtils'; import { IPythonMode } from '../analyzer/sourceFile'; import { TextRange } from '../common/textRange'; import { TextRangeCollection } from '../common/textRangeCollection'; @@ -276,7 +277,7 @@ export class Tokenizer { } // Insert any implied dedent tokens. - this._setIndent(0, 0, /* isSpacePresent */ false, /* isTabPresent */ false); + this._setIndent(this._cs.position, 0, 0, /* isSpacePresent */ false, /* isTabPresent */ false); // Add a final end-of-stream token to make parsing easier. this._tokens.push(Token.create(TokenType.EndOfStream, this._cs.position, 0, this._getComments())); @@ -377,11 +378,23 @@ export class Tokenizer { return true; } - if (this._ipythonMode && this._isIPythonMagics()) { - this._handleIPythonMagics( - this._cs.currentChar === Char.Percent ? CommentType.IPythonMagic : CommentType.IPythonShellEscape - ); - return true; + if (this._ipythonMode) { + const kind = this._getIPythonMagicsKind(); + if (kind === 'line') { + this._handleIPythonMagics( + this._cs.currentChar === Char.Percent ? CommentType.IPythonMagic : CommentType.IPythonShellEscape + ); + return true; + } + + if (kind === 'cell') { + this._handleIPythonMagics( + this._cs.currentChar === Char.Percent + ? CommentType.IPythonCellMagic + : CommentType.IPythonCellShellEscape + ); + return true; + } } switch (this._cs.currentChar) { @@ -554,6 +567,8 @@ export class Tokenizer { let isTabPresent = false; let isSpacePresent = false; + const startOffset = this._cs.position; + while (!this._cs.isEndOfStream()) { switch (this._cs.currentChar) { case Char.Space: @@ -582,7 +597,7 @@ export class Tokenizer { default: // Non-blank line. Set the current indent level. - this._setIndent(tab1Spaces, tab8Spaces, isSpacePresent, isTabPresent); + this._setIndent(startOffset, tab1Spaces, tab8Spaces, isSpacePresent, isTabPresent); return; case Char.Hash: @@ -597,7 +612,13 @@ export class Tokenizer { // The caller must specify two space count values. The first assumes // that tabs are translated into one-space tab stops. The second assumes // that tabs are translated into eight-space tab stops. - private _setIndent(tab1Spaces: number, tab8Spaces: number, isSpacePresent: boolean, isTabPresent: boolean) { + private _setIndent( + startOffset: number, + tab1Spaces: number, + tab8Spaces: number, + isSpacePresent: boolean, + isTabPresent: boolean + ) { // Indentations are ignored within a parenthesized clause. if (this._parenDepth > 0) { return; @@ -618,7 +639,7 @@ export class Tokenizer { isSpacePresent, isTabPresent, }); - this._tokens.push(IndentToken.create(this._cs.position, 0, tab8Spaces, false, this._getComments())); + this._tokens.push(IndentToken.create(startOffset, tab1Spaces, tab8Spaces, false, this._getComments())); } } else { const prevTabInfo = this._indentAmounts[this._indentAmounts.length - 1]; @@ -645,7 +666,7 @@ export class Tokenizer { }); this._tokens.push( - IndentToken.create(this._cs.position, 0, tab8Spaces, isIndentAmbiguous, this._getComments()) + IndentToken.create(startOffset, tab1Spaces, tab8Spaces, isIndentAmbiguous, this._getComments()) ); } else if (prevTabInfo.tab8Spaces === tab8Spaces) { // The Python spec says that if there is ambiguity about how tabs should @@ -653,7 +674,9 @@ export class Tokenizer { // spaces, it should be an error. We'll record this condition in the token // so the parser can later report it. if ((prevTabInfo.isSpacePresent && isTabPresent) || (prevTabInfo.isTabPresent && isSpacePresent)) { - this._tokens.push(IndentToken.create(this._cs.position, 0, tab8Spaces, true, this._getComments())); + this._tokens.push( + IndentToken.create(startOffset, tab1Spaces, tab8Spaces, true, this._getComments()) + ); } } else { // The Python spec says that if there is ambiguity about how tabs should @@ -797,7 +820,11 @@ export class Tokenizer { if (!isNaN(intValue)) { const bigIntValue = BigInt(simpleIntText); - if (!isFinite(intValue) || BigInt(intValue) !== bigIntValue) { + if ( + !isFinite(intValue) || + intValue < Number.MIN_SAFE_INTEGER || + intValue > Number.MAX_SAFE_INTEGER + ) { intValue = bigIntValue; } @@ -835,7 +862,8 @@ export class Tokenizer { isDecimalInteger = this._cs.currentChar !== Char.Period && this._cs.currentChar !== Char.e && - this._cs.currentChar !== Char.E; + this._cs.currentChar !== Char.E && + (this._cs.currentChar < Char._1 || this._cs.currentChar > Char._9); } if (isDecimalInteger) { @@ -847,7 +875,11 @@ export class Tokenizer { let isImaginary = false; const bigIntValue = BigInt(simpleIntText); - if (!isFinite(intValue) || BigInt(intValue) !== bigIntValue) { + if ( + !isFinite(intValue) || + bigIntValue < Number.MIN_SAFE_INTEGER || + bigIntValue > Number.MAX_SAFE_INTEGER + ) { intValue = bigIntValue; } @@ -1048,12 +1080,27 @@ export class Tokenizer { return prevComments; } - private _isIPythonMagics() { + private _getIPythonMagicsKind(): 'line' | 'cell' | undefined { + if (!isMagicChar(this._cs.currentChar)) { + return undefined; + } + const prevToken = this._tokens.length > 0 ? this._tokens[this._tokens.length - 1] : undefined; - return ( - (prevToken === undefined || prevToken.type === TokenType.NewLine || prevToken.type === TokenType.Indent) && - (this._cs.currentChar === Char.Percent || this._cs.currentChar === Char.ExclamationMark) - ); + if (prevToken !== undefined && !isWhitespace(prevToken)) { + return undefined; + } + + if (this._cs.nextChar === this._cs.currentChar) { + // Eat up next magic char. + this._cs.moveNext(); + return 'cell'; + } + + return 'line'; + + function isMagicChar(ch: number) { + return ch === Char.Percent || ch === Char.ExclamationMark; + } } private _handleIPythonMagics(type: CommentType): void { @@ -1063,16 +1110,19 @@ export class Tokenizer { do { this._cs.skipToEol(); - const length = this._cs.position - begin; - const value = this._cs.getText().substring(begin, begin + length); + if (type === CommentType.IPythonMagic || type === CommentType.IPythonShellEscape) { + const length = this._cs.position - begin; + const value = this._cs.getText().substring(begin, begin + length); - // is it multiline magics? - // %magic command \ - // next arguments - if (!value.match(/\\\s*$/)) { - break; + // is it multiline magics? + // %magic command \ + // next arguments + if (!value.match(/\\\s*$/)) { + break; + } } + this._cs.moveNext(); begin = this._cs.position + 1; } while (!this._cs.isEndOfStream()); @@ -1091,12 +1141,16 @@ export class Tokenizer { const value = this._cs.getText().substring(start, start + length); const comment = Comment.create(start, length, value); - const typeIgnoreRegexMatch = value.match(/^\s*type:\s*ignore(\s*\[([\s*\w-,]*)\]|\s|$)/); + const typeIgnoreRegexMatch = value.match(/((^|#)\s*)type:\s*ignore(\s*\[([\s*\w-,]*)\]|\s|$)/); if (typeIgnoreRegexMatch) { - const textRange: TextRange = { start, length: typeIgnoreRegexMatch[0].length }; + const commentStart = start + (typeIgnoreRegexMatch.index ?? 0); + const textRange: TextRange = { + start: commentStart + typeIgnoreRegexMatch[1].length, + length: typeIgnoreRegexMatch[0].length - typeIgnoreRegexMatch[1].length, + }; const ignoreComment: IgnoreComment = { range: textRange, - rulesList: this._getIgnoreCommentRulesList(start, typeIgnoreRegexMatch), + rulesList: this._getIgnoreCommentRulesList(commentStart, typeIgnoreRegexMatch), }; if (this._tokens.findIndex((t) => t.type !== TokenType.NewLine && t && t.type !== TokenType.Indent) < 0) { @@ -1106,12 +1160,16 @@ export class Tokenizer { } } - const pyrightIgnoreRegexMatch = value.match(/^\s*pyright:\s*ignore(\s*\[([\s*\w-,]*)\]|\s|$)/); + const pyrightIgnoreRegexMatch = value.match(/((^|#)\s*)pyright:\s*ignore(\s*\[([\s*\w-,]*)\]|\s|$)/); if (pyrightIgnoreRegexMatch) { - const textRange: TextRange = { start, length: pyrightIgnoreRegexMatch[0].length }; + const commentStart = start + (pyrightIgnoreRegexMatch.index ?? 0); + const textRange: TextRange = { + start: commentStart + pyrightIgnoreRegexMatch[1].length, + length: pyrightIgnoreRegexMatch[0].length - pyrightIgnoreRegexMatch[1].length, + }; const ignoreComment: IgnoreComment = { range: textRange, - rulesList: this._getIgnoreCommentRulesList(start, pyrightIgnoreRegexMatch), + rulesList: this._getIgnoreCommentRulesList(commentStart, pyrightIgnoreRegexMatch), }; this._pyrightIgnoreLines.set(this._lineRanges.length, ignoreComment); } @@ -1121,11 +1179,11 @@ export class Tokenizer { // Extracts the individual rules within a "type: ignore [x, y, z]" comment. private _getIgnoreCommentRulesList(start: number, match: RegExpMatchArray): IgnoreCommentRule[] | undefined { - if (match.length < 3 || match[2] === undefined) { + if (match.length < 5 || match[4] === undefined) { return undefined; } - const splitElements = match[2].split(','); + const splitElements = match[4].split(','); const commentRules: IgnoreCommentRule[] = []; let currentOffset = start + match[0].indexOf('[') + 1; diff --git a/packages/pyright-internal/src/parser/tokenizerTypes.ts b/packages/pyright-internal/src/parser/tokenizerTypes.ts index 72d543128..e50ea7861 100644 --- a/packages/pyright-internal/src/parser/tokenizerTypes.ts +++ b/packages/pyright-internal/src/parser/tokenizerTypes.ts @@ -172,6 +172,8 @@ export const enum CommentType { Regular, IPythonMagic, IPythonShellEscape, + IPythonCellMagic, + IPythonCellShellEscape, } export interface Comment extends TextRange { diff --git a/packages/pyright-internal/src/pyright.ts b/packages/pyright-internal/src/pyright.ts index b8515dc47..30c23e96b 100644 --- a/packages/pyright-internal/src/pyright.ts +++ b/packages/pyright-internal/src/pyright.ts @@ -32,9 +32,12 @@ import { PackageTypeReport, TypeKnownStatus } from './analyzer/packageTypeReport import { createDeferred } from './common/deferred'; import { FullAccessHost } from './common/fullAccessHost'; import { ChokidarFileWatcherProvider } from './common/chokidarFileWatcherProvider'; +import { fail } from './common/debug'; const toolName = 'pyright'; +type SeverityLevel = 'error' | 'warning' | 'information'; + enum ExitStatus { NoErrors = 0, ErrorsReported = 1, @@ -91,7 +94,7 @@ interface PyrightPublicSymbolReport { interface PyrightJsonDiagnostic { file: string; - severity: 'error' | 'warning' | 'information'; + severity: SeverityLevel; message: string; range?: Range | undefined; rule?: string | undefined; @@ -131,6 +134,7 @@ async function processArgs(): Promise { { name: 'help', alias: 'h', type: Boolean }, { name: 'ignoreexternal', type: Boolean }, { name: 'lib', type: Boolean }, + { name: 'level', type: String }, { name: 'outputjson', type: Boolean }, { name: 'project', alias: 'p', type: String }, { name: 'pythonplatform', type: String }, @@ -255,7 +259,9 @@ async function processArgs(): Promise { options.typeStubTargetImportName = args.createstub; } - options.analyzeUnannotatedFunctions = !args.skipunannotated; + if (args.skipunannotated) { + options.analyzeUnannotatedFunctions = false; + } if (args.verbose) { options.verboseOutput = true; @@ -265,6 +271,17 @@ async function processArgs(): Promise { options.useLibraryCodeForTypes = true; } + let minSeverityLevel: SeverityLevel = 'information'; + if (args.level && typeof args.level === 'string') { + const levelValue = args.level.toLowerCase(); + if (levelValue === 'error' || levelValue === 'warning') { + minSeverityLevel = levelValue; + } else { + console.error(`'${args.level}' is not a valid value for --level; specify error or warning.`); + return ExitStatus.ParameterError; + } + } + options.checkOnlyOpenFiles = false; if (!!args.stats && !!args.verbose) { @@ -284,8 +301,9 @@ async function processArgs(): Promise { return verifyPackageTypes( fileSystem, args['verifytypes'] || '', - !!args.verbose, + options, !!args.outputjson, + minSeverityLevel, args['ignoreexternal'] ); } else if (args['ignoreexternal'] !== undefined) { @@ -317,10 +335,11 @@ async function processArgs(): Promise { } let errorCount = 0; - if (results.diagnostics.length > 0 && !args.createstub && !args['verifytypes']) { + if (!args.createstub && !args.verifytypes) { if (args.outputjson) { const report = reportDiagnosticsAsJson( results.diagnostics, + minSeverityLevel, results.filesInProgram, results.elapsedTime ); @@ -330,7 +349,7 @@ async function processArgs(): Promise { } } else { printVersion(); - const report = reportDiagnosticsAsText(results.diagnostics); + const report = reportDiagnosticsAsText(results.diagnostics, minSeverityLevel); errorCount += report.errorCount; if (treatWarningsAsErrors) { errorCount += report.warningCount; @@ -395,19 +414,20 @@ async function processArgs(): Promise { function verifyPackageTypes( fileSystem: PyrightFileSystem, packageName: string, - verboseOutput: boolean, + options: PyrightCommandLineOptions, outputJson: boolean, + minSeverityLevel: SeverityLevel, ignoreUnknownTypesFromImports: boolean ): ExitStatus { try { - const verifier = new PackageTypeVerifier(fileSystem, packageName, ignoreUnknownTypesFromImports); + const verifier = new PackageTypeVerifier(fileSystem, options, packageName, ignoreUnknownTypesFromImports); const report = verifier.verify(); - const jsonReport = buildTypeCompletenessReport(packageName, report); + const jsonReport = buildTypeCompletenessReport(packageName, report, minSeverityLevel); if (outputJson) { console.log(JSON.stringify(jsonReport, /* replacer */ undefined, 4)); } else { - printTypeCompletenessReportText(jsonReport, verboseOutput); + printTypeCompletenessReportText(jsonReport, !!options.verboseOutput); } return jsonReport.typeCompleteness!.completenessScore < 1 ? ExitStatus.ErrorsReported : ExitStatus.NoErrors; @@ -432,7 +452,11 @@ function accumulateReportDiagnosticStats(diag: PyrightJsonDiagnostic, report: Py } } -function buildTypeCompletenessReport(packageName: string, completenessReport: PackageTypeReport): PyrightJsonResults { +function buildTypeCompletenessReport( + packageName: string, + completenessReport: PackageTypeReport, + minSeverityLevel: SeverityLevel +): PyrightJsonResults { const report: PyrightJsonResults = { version: getVersionString(), time: Date.now().toString(), @@ -449,7 +473,9 @@ function buildTypeCompletenessReport(packageName: string, completenessReport: Pa // Add the general diagnostics. completenessReport.generalDiagnostics.forEach((diag) => { const jsonDiag = convertDiagnosticToJson('', diag); - report.generalDiagnostics.push(jsonDiag); + if (isDiagnosticIncluded(jsonDiag.severity, minSeverityLevel)) { + report.generalDiagnostics.push(jsonDiag); + } accumulateReportDiagnosticStats(jsonDiag, report); }); @@ -489,6 +515,16 @@ function buildTypeCompletenessReport(packageName: string, completenessReport: Pa // Add the symbols. completenessReport.symbols.forEach((symbol) => { + const diagnostics: PyrightJsonDiagnostic[] = []; + + // Convert and filter the diagnostics. + symbol.diagnostics.forEach((diag) => { + const jsonDiag = convertDiagnosticToJson(diag.filePath, diag.diagnostic); + if (isDiagnosticIncluded(jsonDiag.severity, minSeverityLevel)) { + diagnostics.push(jsonDiag); + } + }); + const jsonSymbol: PyrightPublicSymbolReport = { category: PackageTypeVerifier.getSymbolCategoryString(symbol.category), name: symbol.fullName, @@ -496,7 +532,7 @@ function buildTypeCompletenessReport(packageName: string, completenessReport: Pa isExported: symbol.isExported, isTypeKnown: symbol.typeKnownStatus === TypeKnownStatus.Known, isTypeAmbiguous: symbol.typeKnownStatus === TypeKnownStatus.Ambiguous, - diagnostics: symbol.diagnostics.map((diag) => convertDiagnosticToJson(diag.filePath, diag.diagnostic)), + diagnostics, }; const alternateNames = completenessReport.alternateSymbolNames.get(symbol.fullName); @@ -653,6 +689,7 @@ function printUsage() { ' -h,--help Show this help message\n' + ' --ignoreexternal Ignore external imports for --verifytypes\n' + ' --lib Use library code to infer types when stubs are missing\n' + + ' --level Minimum diagnostic level (error or warning)\n' + ' --outputjson Output results in JSON format\n' + ' -p,--project Use the configuration file at this location\n' + ' --pythonplatform Analyze for a specific platform (Darwin, Linux, Windows)\n' + @@ -681,6 +718,7 @@ function printVersion() { function reportDiagnosticsAsJson( fileDiagnostics: FileDiagnostics[], + minSeverityLevel: SeverityLevel, filesInProgram: number, timeInSec: number ): DiagnosticResult { @@ -705,7 +743,10 @@ function reportDiagnosticsAsJson( diag.category === DiagnosticCategory.Information ) { const jsonDiag = convertDiagnosticToJson(fileDiag.filePath, diag); - report.generalDiagnostics.push(jsonDiag); + if (isDiagnosticIncluded(jsonDiag.severity, minSeverityLevel)) { + report.generalDiagnostics.push(jsonDiag); + } + accumulateReportDiagnosticStats(jsonDiag, report); } }); @@ -721,22 +762,51 @@ function reportDiagnosticsAsJson( }; } +function isDiagnosticIncluded(diagSeverity: SeverityLevel, minSeverityLevel: SeverityLevel) { + // Errors are always included. + if (diagSeverity === 'error') { + return true; + } + + // Warnings are included only if the min severity level is below error. + if (diagSeverity === 'warning') { + return minSeverityLevel !== 'error'; + } + + // Informations are included only if the min severity level is 'information'. + return minSeverityLevel === 'information'; +} + +function convertDiagnosticCategoryToSeverity(category: DiagnosticCategory): SeverityLevel { + switch (category) { + case DiagnosticCategory.Error: + return 'error'; + + case DiagnosticCategory.Warning: + return 'warning'; + + case DiagnosticCategory.Information: + return 'information'; + + default: + fail('Unexpected diagnostic category'); + } +} + function convertDiagnosticToJson(filePath: string, diag: Diagnostic): PyrightJsonDiagnostic { return { file: filePath, - severity: - diag.category === DiagnosticCategory.Error - ? 'error' - : diag.category === DiagnosticCategory.Warning - ? 'warning' - : 'information', + severity: convertDiagnosticCategoryToSeverity(diag.category), message: diag.message, range: isEmptyRange(diag.range) ? undefined : diag.range, rule: diag.getRule(), }; } -function reportDiagnosticsAsText(fileDiagnostics: FileDiagnostics[]): DiagnosticResult { +function reportDiagnosticsAsText( + fileDiagnostics: FileDiagnostics[], + minSeverityLevel: SeverityLevel +): DiagnosticResult { let errorCount = 0; let warningCount = 0; let informationCount = 0; @@ -747,13 +817,15 @@ function reportDiagnosticsAsText(fileDiagnostics: FileDiagnostics[]): Diagnostic (diag) => diag.category !== DiagnosticCategory.UnusedCode && diag.category !== DiagnosticCategory.UnreachableCode && - diag.category !== DiagnosticCategory.Deprecated + diag.category !== DiagnosticCategory.Deprecated && + isDiagnosticIncluded(convertDiagnosticCategoryToSeverity(diag.category), minSeverityLevel) ); if (fileErrorsAndWarnings.length > 0) { console.log(`${fileDiagnostics.filePath}`); fileErrorsAndWarnings.forEach((diag) => { - logDiagnosticToConsole(convertDiagnosticToJson(fileDiagnostics.filePath, diag)); + const jsonDiag = convertDiagnosticToJson(fileDiagnostics.filePath, diag); + logDiagnosticToConsole(jsonDiag); if (diag.category === DiagnosticCategory.Error) { errorCount++; diff --git a/packages/pyright-internal/src/pyrightFileSystem.ts b/packages/pyright-internal/src/pyrightFileSystem.ts index 41d00c057..b2fcfe388 100644 --- a/packages/pyright-internal/src/pyrightFileSystem.ts +++ b/packages/pyright-internal/src/pyrightFileSystem.ts @@ -234,6 +234,10 @@ export class PyrightFileSystem } } + override dispose(): void { + this._realFS.dispose(); + } + clearPartialStubs(): void { super._clear(); diff --git a/packages/pyright-internal/src/readonlyAugmentedFileSystem.ts b/packages/pyright-internal/src/readonlyAugmentedFileSystem.ts index b4b1e500a..90e934af1 100644 --- a/packages/pyright-internal/src/readonlyAugmentedFileSystem.ts +++ b/packages/pyright-internal/src/readonlyAugmentedFileSystem.ts @@ -172,6 +172,10 @@ export class ReadOnlyAugmentedFileSystem implements FileSystem { return this._realFS.isInZipOrEgg(path); } + dispose(): void { + this._realFS.dispose(); + } + protected _recordMovedEntry(mappedPath: string, originalPath: string, reversible = true, isFile = true) { this._entryMap.set(mappedPath, originalPath); diff --git a/packages/pyright-internal/src/server.ts b/packages/pyright-internal/src/server.ts index 5754439ef..737456c8a 100644 --- a/packages/pyright-internal/src/server.ts +++ b/packages/pyright-internal/src/server.ts @@ -22,9 +22,10 @@ import { BackgroundAnalysis } from './backgroundAnalysis'; import { BackgroundAnalysisBase } from './backgroundAnalysisBase'; import { CommandController } from './commands/commandController'; import { getCancellationFolderName } from './common/cancellationUtils'; -import { ConfigOptions } from './common/configOptions'; -import { ConsoleWithLogLevel, LogLevel } from './common/console'; +import { ConfigOptions, SignatureDisplayType } from './common/configOptions'; +import { ConsoleWithLogLevel, convertLogLevel, LogLevel } from './common/console'; import { isDebugMode, isString } from './common/core'; +import { expandPathVariables } from './common/envVarUtils'; import { FileBasedCancellationProvider } from './common/fileBasedCancellationUtils'; import { FileSystem } from './common/fileSystem'; import { FullAccessHost } from './common/fullAccessHost'; @@ -32,9 +33,9 @@ import { Host } from './common/host'; import { resolvePaths } from './common/pathUtils'; import { ProgressReporter } from './common/progressReporter'; import { createFromRealFileSystem, WorkspaceFileWatcherProvider } from './common/realFileSystem'; -import { LanguageServerBase, ServerSettings, WorkspaceServiceInstance } from './languageServerBase'; +import { LanguageServerBase, ServerSettings } from './languageServerBase'; import { CodeActionProvider } from './languageService/codeActionProvider'; -import { WorkspaceMap } from './workspaceMap'; +import { Workspace } from './workspaceFactory'; const maxAnalysisTimeInForeground = { openFilesTimeInMs: 50, noOpenFilesTimeInMs: 200 }; @@ -51,7 +52,6 @@ export class PyrightServer extends LanguageServerBase { const rootDirectory = (global as any).__rootDirectory || __dirname; const console = new ConsoleWithLogLevel(connection.console); - const workspaceMap = new WorkspaceMap(); const fileWatcherProvider = new WorkspaceFileWatcherProvider(); const fileSystem = createFromRealFileSystem(console, fileWatcherProvider); @@ -60,7 +60,6 @@ export class PyrightServer extends LanguageServerBase { productName: 'Pyright', rootDirectory, version, - workspaceMap, fileSystem, fileWatcherHandler: fileWatcherProvider, cancellationProvider: new FileBasedCancellationProvider('bg'), @@ -74,7 +73,7 @@ export class PyrightServer extends LanguageServerBase { this._controller = new CommandController(this); } - async getSettings(workspace: WorkspaceServiceInstance): Promise { + async getSettings(workspace: Workspace): Promise { const serverSettings: ServerSettings = { watchForSourceChanges: true, watchForLibraryChanges: true, @@ -87,6 +86,7 @@ export class PyrightServer extends LanguageServerBase { diagnosticSeverityOverrides: {}, logLevel: LogLevel.Info, autoImportCompletions: true, + functionSignatureDisplay: SignatureDisplayType.formatted, }; try { @@ -96,7 +96,7 @@ export class PyrightServer extends LanguageServerBase { if (pythonPath && isString(pythonPath) && !isPythonBinary(pythonPath)) { serverSettings.pythonPath = resolvePaths( workspace.rootPath, - this.expandPathVariables(workspace.rootPath, pythonPath) + expandPathVariables(workspace.rootPath, pythonPath) ); } @@ -105,7 +105,7 @@ export class PyrightServer extends LanguageServerBase { if (venvPath && isString(venvPath)) { serverSettings.venvPath = resolvePaths( workspace.rootPath, - this.expandPathVariables(workspace.rootPath, venvPath) + expandPathVariables(workspace.rootPath, venvPath) ); } } @@ -118,7 +118,7 @@ export class PyrightServer extends LanguageServerBase { if (typeshedPath && isString(typeshedPath)) { serverSettings.typeshedPath = resolvePaths( workspace.rootPath, - this.expandPathVariables(workspace.rootPath, typeshedPath) + expandPathVariables(workspace.rootPath, typeshedPath) ); } } @@ -127,7 +127,7 @@ export class PyrightServer extends LanguageServerBase { if (stubPath && isString(stubPath)) { serverSettings.stubPath = resolvePaths( workspace.rootPath, - this.expandPathVariables(workspace.rootPath, stubPath) + expandPathVariables(workspace.rootPath, stubPath) ); } @@ -152,14 +152,14 @@ export class PyrightServer extends LanguageServerBase { serverSettings.useLibraryCodeForTypes = !!pythonAnalysisSection.useLibraryCodeForTypes; } - serverSettings.logLevel = this.convertLogLevel(pythonAnalysisSection.logLevel); + serverSettings.logLevel = convertLogLevel(pythonAnalysisSection.logLevel); serverSettings.autoSearchPaths = !!pythonAnalysisSection.autoSearchPaths; const extraPaths = pythonAnalysisSection.extraPaths; if (extraPaths && Array.isArray(extraPaths) && extraPaths.length > 0) { serverSettings.extraPaths = extraPaths .filter((p) => p && isString(p)) - .map((p) => resolvePaths(workspace.rootPath, this.expandPathVariables(workspace.rootPath, p))); + .map((p) => resolvePaths(workspace.rootPath, expandPathVariables(workspace.rootPath, p))); } if (pythonAnalysisSection.typeCheckingMode !== undefined) { @@ -208,7 +208,7 @@ export class PyrightServer extends LanguageServerBase { return serverSettings; } - createBackgroundAnalysis(): BackgroundAnalysisBase | undefined { + createBackgroundAnalysis(serviceId: string): BackgroundAnalysisBase | undefined { if (isDebugMode() || !getCancellationFolderName()) { // Don't do background analysis if we're in debug mode or an old client // is used where cancellation is not supported. diff --git a/packages/pyright-internal/src/tests/cacheManager.test.ts b/packages/pyright-internal/src/tests/cacheManager.test.ts new file mode 100644 index 000000000..99e1f1bcc --- /dev/null +++ b/packages/pyright-internal/src/tests/cacheManager.test.ts @@ -0,0 +1,84 @@ +/* + * cacheManager.test.ts + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT license. + * + * Unit tests for cache manager + */ + +import assert from 'assert'; + +import { CacheManager, CacheOwner } from '../analyzer/cacheManager'; + +test('basic', () => { + const manager = new CacheManager(); + const mock = new MockCacheOwner(10); + + manager.registerCacheOwner(mock); + assert.strictEqual(manager.getCacheUsage(), 10); + + manager.unregisterCacheOwner(mock); + assert.strictEqual(manager.getCacheUsage(), 0); +}); + +test('nested stopTracking', () => { + const manager = new CacheManager(); + const mock = new MockCacheOwner(10); + + manager.registerCacheOwner(mock); + assert.strictEqual(manager.getCacheUsage(), 10); + + const handle1 = manager.pauseTracking(); + assert.strictEqual(manager.getCacheUsage(), -1); + + // nested + const handle2 = manager.pauseTracking(); + assert.strictEqual(manager.getCacheUsage(), -1); + + handle2.dispose(); + assert.strictEqual(manager.getCacheUsage(), -1); + + handle1.dispose(); + assert.strictEqual(manager.getCacheUsage(), 10); + + manager.unregisterCacheOwner(mock); + assert.strictEqual(manager.getCacheUsage(), 0); +}); + +test('multiple owners', () => { + const manager = new CacheManager(); + const mock1 = new MockCacheOwner(10); + const mock2 = new MockCacheOwner(20); + + manager.registerCacheOwner(mock1); + assert.strictEqual(manager.getCacheUsage(), 10); + + manager.registerCacheOwner(mock2); + assert.strictEqual(manager.getCacheUsage(), 30); + + const handle = manager.pauseTracking(); + assert.strictEqual(manager.getCacheUsage(), -1); + + manager.unregisterCacheOwner(mock1); + assert.strictEqual(manager.getCacheUsage(), -1); + + handle.dispose(); + assert.strictEqual(manager.getCacheUsage(), 20); + + manager.unregisterCacheOwner(mock2); + assert.strictEqual(manager.getCacheUsage(), 0); +}); + +class MockCacheOwner implements CacheOwner { + constructor(private _used: number) { + // empty + } + + getCacheUsage(): number { + return this._used; + } + + emptyCache(): void { + this._used = 0; + } +} diff --git a/packages/pyright-internal/src/tests/chainedSourceFiles.test.ts b/packages/pyright-internal/src/tests/chainedSourceFiles.test.ts index 09de3400c..fc80c4c7e 100644 --- a/packages/pyright-internal/src/tests/chainedSourceFiles.test.ts +++ b/packages/pyright-internal/src/tests/chainedSourceFiles.test.ts @@ -56,6 +56,7 @@ test('check chained files', async () => { autoImport: false, extraCommitChars: false, importFormat: ImportFormat.Absolute, + includeUserSymbolsInAutoImport: false, }, undefined, CancellationToken.None @@ -103,6 +104,7 @@ test('modify chained files', async () => { autoImport: false, extraCommitChars: false, importFormat: ImportFormat.Absolute, + includeUserSymbolsInAutoImport: false, }, undefined, CancellationToken.None diff --git a/packages/pyright-internal/src/tests/checker.test.ts b/packages/pyright-internal/src/tests/checker.test.ts index b62815e6f..172906a07 100644 --- a/packages/pyright-internal/src/tests/checker.test.ts +++ b/packages/pyright-internal/src/tests/checker.test.ts @@ -179,6 +179,12 @@ test('With5', () => { TestUtils.validateResults(analysisResults, 0); }); +test('With6', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['with6.py']); + + TestUtils.validateResults(analysisResults, 0); +}); + test('Mro1', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['mro1.py']); @@ -340,6 +346,13 @@ test('PyrightIgnore2', () => { TestUtils.validateResults(analysisResults, 2, 3); }); +test('PyrightComment1', () => { + const configOptions = new ConfigOptions('.'); + + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['pyrightComment1.py'], configOptions); + TestUtils.validateResults(analysisResults, 7); +}); + test('DuplicateImports1', () => { const configOptions = new ConfigOptions('.'); @@ -353,11 +366,11 @@ test('DuplicateImports1', () => { TestUtils.validateResults(analysisResults, 2); }); -test('ParamName1', () => { +test('ParamNames1', () => { const configOptions = new ConfigOptions('.'); let analysisResults = TestUtils.typeAnalyzeSampleFiles(['paramNames1.py'], configOptions); - TestUtils.validateResults(analysisResults, 0, 4); + TestUtils.validateResults(analysisResults, 0, 7); configOptions.diagnosticRuleSet.reportSelfClsParameterName = 'none'; analysisResults = TestUtils.typeAnalyzeSampleFiles(['paramNames1.py'], configOptions); @@ -365,7 +378,7 @@ test('ParamName1', () => { configOptions.diagnosticRuleSet.reportSelfClsParameterName = 'error'; analysisResults = TestUtils.typeAnalyzeSampleFiles(['paramNames1.py'], configOptions); - TestUtils.validateResults(analysisResults, 4, 0); + TestUtils.validateResults(analysisResults, 7, 0); }); test('ParamType1', () => { @@ -382,7 +395,7 @@ test('Python2', () => { test('InconsistentSpaceTab1', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['inconsistentSpaceTab1.py']); - TestUtils.validateResults(analysisResults, 4); + TestUtils.validateResults(analysisResults, 1); }); test('InconsistentSpaceTab2', () => { @@ -418,7 +431,7 @@ test('UnusedExpression1', () => { // By default, this is a warning. let analysisResults = TestUtils.typeAnalyzeSampleFiles(['unusedExpression1.py'], configOptions); - TestUtils.validateResults(analysisResults, 0, 10); + TestUtils.validateResults(analysisResults, 0, 14); // Disable it. configOptions.diagnosticRuleSet.reportUnusedExpression = 'none'; @@ -428,7 +441,26 @@ test('UnusedExpression1', () => { // Enable it as an error. configOptions.diagnosticRuleSet.reportUnusedExpression = 'error'; analysisResults = TestUtils.typeAnalyzeSampleFiles(['unusedExpression1.py'], configOptions); - TestUtils.validateResults(analysisResults, 10); + TestUtils.validateResults(analysisResults, 14); +}); + +test('UnusedImport1', () => { + const configOptions = new ConfigOptions('.'); + + // Enabled it + configOptions.diagnosticRuleSet.reportUnusedImport = 'warning'; + let analysisResults = TestUtils.typeAnalyzeSampleFiles(['unusedImport1.py'], configOptions); + TestUtils.validateResults(analysisResults, 0, 2); + + // Disable it. + configOptions.diagnosticRuleSet.reportUnusedImport = 'none'; + analysisResults = TestUtils.typeAnalyzeSampleFiles(['unusedImport1.py'], configOptions); + TestUtils.validateResults(analysisResults, 0); + + // Enable it as an error. + configOptions.diagnosticRuleSet.reportUnusedImport = 'error'; + analysisResults = TestUtils.typeAnalyzeSampleFiles(['unusedImport1.py'], configOptions); + TestUtils.validateResults(analysisResults, 2); }); test('UninitializedVariable1', () => { @@ -444,6 +476,12 @@ test('UninitializedVariable1', () => { TestUtils.validateResults(analysisResults, 1); }); +test('RegionComments1', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['regionComments1.py']); + + TestUtils.validateResults(analysisResults, 2); +}); + // For now, this functionality is disabled. // test('Deprecated1', () => { @@ -461,3 +499,25 @@ test('UninitializedVariable1', () => { // const analysisResults3 = TestUtils.typeAnalyzeSampleFiles(['deprecated1.py'], configOptions); // TestUtils.validateResults(analysisResults3, 0, 0, 0, 0, 13); // }); + +test('Deprecated2', () => { + const configOptions = new ConfigOptions('.'); + + const analysisResults1 = TestUtils.typeAnalyzeSampleFiles(['deprecated2.py'], configOptions); + TestUtils.validateResults(analysisResults1, 0, 0, 0, undefined, undefined, 6); + + configOptions.diagnosticRuleSet.reportDeprecated = 'error'; + const analysisResults2 = TestUtils.typeAnalyzeSampleFiles(['deprecated2.py'], configOptions); + TestUtils.validateResults(analysisResults2, 6); +}); + +test('Deprecated3', () => { + const configOptions = new ConfigOptions('.'); + + const analysisResults1 = TestUtils.typeAnalyzeSampleFiles(['deprecated3.py'], configOptions); + TestUtils.validateResults(analysisResults1, 0, 0, 0, undefined, undefined, 5); + + configOptions.diagnosticRuleSet.reportDeprecated = 'error'; + const analysisResults2 = TestUtils.typeAnalyzeSampleFiles(['deprecated3.py'], configOptions); + TestUtils.validateResults(analysisResults2, 5); +}); diff --git a/packages/pyright-internal/src/tests/completions.test.ts b/packages/pyright-internal/src/tests/completions.test.ts new file mode 100644 index 000000000..1d6ae546b --- /dev/null +++ b/packages/pyright-internal/src/tests/completions.test.ts @@ -0,0 +1,922 @@ +/* + * completions.test.ts + * + * completions tests. + */ + +import assert from 'assert'; +import { CancellationToken } from 'vscode-languageserver'; +import { CompletionItemKind, MarkupKind } from 'vscode-languageserver-types'; + +import { ImportFormat } from '../languageService/autoImporter'; +import { CompletionOptions } from '../languageService/completionProvider'; +import { parseAndGetTestState } from './harness/fourslash/testState'; + +test('completion import statement tooltip', async () => { + const code = ` +// @filename: pyrightconfig.json +//// { +//// "useLibraryCodeForTypes": true +//// } + +// @filename: test.py +//// import [|/*marker*/m|] + +// @filename: matplotlib/__init__.py +// @library: true +//// """ matplotlib """ + `; + + const state = parseAndGetTestState(code).state; + const marker = state.getMarkerByName('marker'); + state.openFile(marker.fileName); + + await state.verifyCompletion('included', MarkupKind.Markdown, { + marker: { + completions: [ + { + kind: CompletionItemKind.Module, + label: 'matplotlib', + documentation: 'matplotlib', + }, + ], + }, + }); +}); + +test('completion import statement tooltip - stub file', async () => { + const code = ` +// @filename: pyrightconfig.json +//// { +//// "useLibraryCodeForTypes": true +//// } + +// @filename: test.py +//// import [|/*marker*/m|] + +// @filename: matplotlib/__init__.pyi +// @library: true +//// # empty + +// @filename: matplotlib/__init__.py +// @library: true +//// """ matplotlib """ + `; + + const state = parseAndGetTestState(code).state; + const marker = state.getMarkerByName('marker'); + state.openFile(marker.fileName); + + await state.verifyCompletion('included', MarkupKind.Markdown, { + marker: { + completions: [ + { + kind: CompletionItemKind.Module, + label: 'matplotlib', + documentation: 'matplotlib', + }, + ], + }, + }); +}); + +test('completion import statement tooltip - doc in stub file', async () => { + const code = ` +// @filename: pyrightconfig.json +//// { +//// "useLibraryCodeForTypes": true +//// } + +// @filename: test.py +//// import [|/*marker*/m|] + +// @filename: matplotlib/__init__.pyi +// @library: true +//// """ matplotlib """ + +// @filename: matplotlib/__init__.py +// @library: true +//// # empty + `; + + const state = parseAndGetTestState(code).state; + const marker = state.getMarkerByName('marker'); + state.openFile(marker.fileName); + + await state.verifyCompletion('included', MarkupKind.Markdown, { + marker: { + completions: [ + { + kind: CompletionItemKind.Module, + label: 'matplotlib', + documentation: 'matplotlib', + }, + ], + }, + }); +}); + +test('completion import statement tooltip - sub modules', async () => { + const code = ` +// @filename: pyrightconfig.json +//// { +//// "useLibraryCodeForTypes": true +//// } + +// @filename: test.py +//// import matplotlib.[|/*marker*/p|] + +// @filename: matplotlib/__init__.py +// @library: true +//// """ matplotlib """ + +// @filename: matplotlib/pyplot.py +// @library: true +//// """ pyplot """ + `; + + const state = parseAndGetTestState(code).state; + const marker = state.getMarkerByName('marker'); + state.openFile(marker.fileName); + + await state.verifyCompletion('included', MarkupKind.Markdown, { + marker: { + completions: [ + { + kind: CompletionItemKind.Module, + label: 'pyplot', + documentation: 'pyplot', + }, + ], + }, + }); +}); + +test('completion import reference tooltip', async () => { + const code = ` +// @filename: pyrightconfig.json +//// { +//// "useLibraryCodeForTypes": true +//// } + +// @filename: test.py +//// import matplotlib +//// [|/*marker*/m|] + +// @filename: matplotlib/__init__.py +// @library: true +//// """ matplotlib """ + `; + + const state = parseAndGetTestState(code).state; + const marker = state.getMarkerByName('marker'); + state.openFile(marker.fileName); + + await state.verifyCompletion('included', MarkupKind.Markdown, { + marker: { + completions: [ + { + kind: CompletionItemKind.Module, + label: 'matplotlib', + documentation: '```python\nmatplotlib\n```\n---\nmatplotlib', + }, + ], + }, + }); +}); + +test('completion import reference tooltip - first module', async () => { + const code = ` +// @filename: pyrightconfig.json +//// { +//// "useLibraryCodeForTypes": true +//// } + +// @filename: test.py +//// import matplotlib.pyplot +//// [|/*marker*/m|] + +// @filename: matplotlib/__init__.py +// @library: true +//// """ matplotlib """ + +// @filename: matplotlib/pyplot.py +// @library: true +//// """ pyplot """ + `; + + const state = parseAndGetTestState(code).state; + const marker = state.getMarkerByName('marker'); + state.openFile(marker.fileName); + + await state.verifyCompletion('included', MarkupKind.Markdown, { + marker: { + completions: [ + { + kind: CompletionItemKind.Module, + label: 'matplotlib', + documentation: '```python\nmatplotlib\n```\n---\nmatplotlib', + }, + ], + }, + }); +}); + +test('completion import reference tooltip - child module', async () => { + const code = ` +// @filename: pyrightconfig.json +//// { +//// "useLibraryCodeForTypes": true +//// } + +// @filename: test.py +//// import matplotlib.pyplot +//// matplotlib.[|/*marker*/p|] + +// @filename: matplotlib/__init__.py +// @library: true +//// """ matplotlib """ + +// @filename: matplotlib/pyplot.py +// @library: true +//// """ pyplot """ + `; + + const state = parseAndGetTestState(code).state; + const marker = state.getMarkerByName('marker'); + state.openFile(marker.fileName); + + await state.verifyCompletion('included', MarkupKind.Markdown, { + marker: { + completions: [ + { + kind: CompletionItemKind.Module, + label: 'pyplot', + documentation: '```python\npyplot\n```\n---\npyplot', + }, + ], + }, + }); +}); + +test('completion from import statement tooltip - first module', async () => { + const code = ` +// @filename: pyrightconfig.json +//// { +//// "useLibraryCodeForTypes": true +//// } + +// @filename: test.py +//// from [|/*marker*/m|] + +// @filename: matplotlib/__init__.py +// @library: true +//// """ matplotlib """ + `; + + const state = parseAndGetTestState(code).state; + const marker = state.getMarkerByName('marker'); + state.openFile(marker.fileName); + + await state.verifyCompletion('included', MarkupKind.Markdown, { + marker: { + completions: [ + { + kind: CompletionItemKind.Module, + label: 'matplotlib', + documentation: 'matplotlib', + }, + ], + }, + }); +}); + +test('completion from import statement tooltip - child module', async () => { + const code = ` +// @filename: pyrightconfig.json +//// { +//// "useLibraryCodeForTypes": true +//// } + +// @filename: test.py +//// from matplotlib.[|/*marker*/p|] + +// @filename: matplotlib/__init__.py +// @library: true +//// """ matplotlib """ + +// @filename: matplotlib/pyplot.py +// @library: true +//// """ pyplot """ + `; + + const state = parseAndGetTestState(code).state; + const marker = state.getMarkerByName('marker'); + state.openFile(marker.fileName); + + await state.verifyCompletion('included', MarkupKind.Markdown, { + marker: { + completions: [ + { + kind: CompletionItemKind.Module, + label: 'pyplot', + documentation: 'pyplot', + }, + ], + }, + }); +}); + +test('completion from import statement tooltip - implicit module', async () => { + const code = ` +// @filename: pyrightconfig.json +//// { +//// "useLibraryCodeForTypes": true +//// } + +// @filename: test.py +//// from matplotlib import [|/*marker*/p|] + +// @filename: matplotlib/__init__.py +// @library: true +//// """ matplotlib """ + +// @filename: matplotlib/pyplot.py +// @library: true +//// """ pyplot """ + `; + + const state = parseAndGetTestState(code).state; + const marker = state.getMarkerByName('marker'); + state.openFile(marker.fileName); + + await state.verifyCompletion('included', MarkupKind.Markdown, { + marker: { + completions: [ + { + kind: CompletionItemKind.Module, + label: 'pyplot', + documentation: 'pyplot', + }, + ], + }, + }); +}); + +test('include literals in expression completion', async () => { + const code = ` +// @filename: test.py +//// from typing import TypedDict +//// +//// class TestType(TypedDict): +//// A: str +//// B: int +//// +//// var: TestType = {} +//// +//// var[[|A/*marker*/|]] + `; + + const state = parseAndGetTestState(code).state; + const marker = state.getMarkerByName('marker'); + state.openFile(marker.fileName); + + await state.verifyCompletion('included', MarkupKind.Markdown, { + marker: { + completions: [ + { + kind: CompletionItemKind.Constant, + label: "'A'", + textEdit: { range: state.getPositionRange('marker'), newText: "'A'" }, + }, + ], + }, + }); +}); + +test('include literals in set key', async () => { + const code = ` +// @filename: test.py +//// from typing import TypedDict +//// +//// class TestType(TypedDict): +//// A: str +//// B: int +//// +//// var: TestType = { [|A/*marker*/|] } + `; + + const state = parseAndGetTestState(code).state; + const marker = state.getMarkerByName('marker'); + state.openFile(marker.fileName); + + await state.verifyCompletion('included', MarkupKind.Markdown, { + marker: { + completions: [ + { + kind: CompletionItemKind.Constant, + label: "'A'", + textEdit: { range: state.getPositionRange('marker'), newText: "'A'" }, + }, + ], + }, + }); +}); + +test('include literals in dict key', async () => { + const code = ` +// @filename: test.py +//// from typing import TypedDict +//// +//// class TestType(TypedDict): +//// A: str +//// B: int +//// +//// var: TestType = { [|A/*marker*/|] : "hello" } + `; + + const state = parseAndGetTestState(code).state; + const marker = state.getMarkerByName('marker'); + state.openFile(marker.fileName); + + await state.verifyCompletion('included', MarkupKind.Markdown, { + marker: { + completions: [ + { + kind: CompletionItemKind.Constant, + label: '"A"', + textEdit: { range: state.getPositionRange('marker'), newText: '"A"' }, + }, + ], + }, + }); +}); + +test('literals support for binary operators - equals', async () => { + const code = ` +// @filename: test.py +//// from typing import Literal +//// +//// Currency = Literal["USD", "EUR"] +//// +//// def foo(c: Currency): +//// if c == [|"/*marker*/"|] + `; + + const state = parseAndGetTestState(code).state; + const marker = state.getMarkerByName('marker'); + state.openFile(marker.fileName); + + await state.verifyCompletion('included', MarkupKind.Markdown, { + marker: { + completions: [ + { + kind: CompletionItemKind.Constant, + label: '"USD"', + textEdit: { range: state.getPositionRange('marker'), newText: '"USD"' }, + }, + { + kind: CompletionItemKind.Constant, + label: '"EUR"', + textEdit: { range: state.getPositionRange('marker'), newText: '"EUR"' }, + }, + ], + }, + }); +}); + +test('literals support for binary operators - not equals', async () => { + const code = ` +// @filename: test.py +//// from typing import Literal +//// +//// Currency = Literal["USD", "EUR"] +//// +//// def foo(c: Currency): +//// if c != [|"/*marker*/"|] + `; + + const state = parseAndGetTestState(code).state; + const marker = state.getMarkerByName('marker'); + state.openFile(marker.fileName); + + await state.verifyCompletion('included', MarkupKind.Markdown, { + marker: { + completions: [ + { + kind: CompletionItemKind.Constant, + label: '"USD"', + textEdit: { range: state.getPositionRange('marker'), newText: '"USD"' }, + }, + { + kind: CompletionItemKind.Constant, + label: '"EUR"', + textEdit: { range: state.getPositionRange('marker'), newText: '"EUR"' }, + }, + ], + }, + }); +}); + +test('literals support for binary operators without string node', async () => { + const code = ` +// @filename: test.py +//// from typing import Literal +//// +//// Currency = Literal["USD", "EUR"] +//// +//// def foo(c: Currency): +//// if c != [|/*marker*/|] + `; + + const state = parseAndGetTestState(code).state; + const marker = state.getMarkerByName('marker'); + state.openFile(marker.fileName); + + await state.verifyCompletion('included', MarkupKind.Markdown, { + marker: { + completions: [ + { + kind: CompletionItemKind.Constant, + label: '"USD"', + }, + { + kind: CompletionItemKind.Constant, + label: '"EUR"', + }, + ], + }, + }); +}); + +test('literals support for binary operators with prior word', async () => { + const code = ` +// @filename: test.py +//// from typing import Literal +//// +//// Currency = Literal["USD", "EUR"] +//// +//// def foo(c: Currency): +//// if c != [|US/*marker*/|] + `; + + const state = parseAndGetTestState(code).state; + const marker = state.getMarkerByName('marker'); + state.openFile(marker.fileName); + + await state.verifyCompletion('included', MarkupKind.Markdown, { + marker: { + completions: [ + { + kind: CompletionItemKind.Constant, + label: '"USD"', + }, + ], + }, + }); +}); + +test('literals support for binary operators - assignment expression', async () => { + const code = ` +// @filename: test.py +//// from typing import Literal +//// +//// Currency = Literal["USD", "EUR"] +//// +//// def foo(c: Currency): +//// if c := [|"/*marker*/"|] + `; + + const state = parseAndGetTestState(code).state; + const marker = state.getMarkerByName('marker'); + state.openFile(marker.fileName); + + await state.verifyCompletion('included', MarkupKind.Markdown, { + marker: { + completions: [ + { + kind: CompletionItemKind.Constant, + label: '"USD"', + textEdit: { range: state.getPositionRange('marker'), newText: '"USD"' }, + }, + { + kind: CompletionItemKind.Constant, + label: '"EUR"', + textEdit: { range: state.getPositionRange('marker'), newText: '"EUR"' }, + }, + ], + }, + }); +}); + +test('literals support for call', async () => { + const code = ` +// @filename: test.py +//// from typing import Literal +//// +//// Currency = Literal["USD", "EUR"] +//// +//// def foo(c: Currency) -> Currency: +//// return c +//// +//// if foo([|"/*marker1*/"|]) == [|"/*marker2*/"|] + `; + + const state = parseAndGetTestState(code).state; + const marker1 = state.getMarkerByName('marker1'); + state.openFile(marker1.fileName); + + await state.verifyCompletion('included', MarkupKind.Markdown, { + marker1: { + completions: [ + { + kind: CompletionItemKind.Constant, + label: '"USD"', + textEdit: { range: state.getPositionRange('marker1'), newText: '"USD"' }, + }, + { + kind: CompletionItemKind.Constant, + label: '"EUR"', + textEdit: { range: state.getPositionRange('marker1'), newText: '"EUR"' }, + }, + ], + }, + marker2: { + completions: [ + { + kind: CompletionItemKind.Constant, + label: '"USD"', + textEdit: { range: state.getPositionRange('marker2'), newText: '"USD"' }, + }, + { + kind: CompletionItemKind.Constant, + label: '"EUR"', + textEdit: { range: state.getPositionRange('marker2'), newText: '"EUR"' }, + }, + ], + }, + }); +}); + +test('list with literal types', async () => { + const code = ` +// @filename: test.py +//// from typing import Literal +//// +//// Currency = Literal["USD", "EUR"] +//// +//// a: list[Currency] = [[|"/*marker*/"|]] + `; + + const state = parseAndGetTestState(code).state; + const marker = state.getMarkerByName('marker'); + state.openFile(marker.fileName); + + await state.verifyCompletion('included', MarkupKind.Markdown, { + marker: { + completions: [ + { + kind: CompletionItemKind.Constant, + label: '"USD"', + textEdit: { range: state.getPositionRange('marker'), newText: '"USD"' }, + }, + { + kind: CompletionItemKind.Constant, + label: '"EUR"', + textEdit: { range: state.getPositionRange('marker'), newText: '"EUR"' }, + }, + ], + }, + }); +}); + +test('literals support for match - error case', async () => { + const code = ` +// @filename: test.py +//// from typing import Literal +//// +//// Currency = Literal["USD", "EUR"] +//// +//// def foo(c: Currency): +//// match c: +//// case [|/*marker*/|] + `; + + const state = parseAndGetTestState(code).state; + const marker = state.getMarkerByName('marker'); + state.openFile(marker.fileName); + + await state.verifyCompletion('included', MarkupKind.Markdown, { + marker: { + completions: [ + { + kind: CompletionItemKind.Constant, + label: '"USD"', + }, + { + kind: CompletionItemKind.Constant, + label: '"EUR"', + }, + ], + }, + }); +}); + +test('literals support for match - simple case', async () => { + const code = ` +// @filename: test.py +//// from typing import Literal +//// +//// Currency = Literal["USD", "EUR"] +//// +//// def foo(c: Currency): +//// match c: +//// case [|"/*marker*/"|] + `; + + const state = parseAndGetTestState(code).state; + const marker = state.getMarkerByName('marker'); + state.openFile(marker.fileName); + + await state.verifyCompletion('included', MarkupKind.Markdown, { + marker: { + completions: [ + { + kind: CompletionItemKind.Constant, + label: '"USD"', + textEdit: { range: state.getPositionRange('marker'), newText: '"USD"' }, + }, + { + kind: CompletionItemKind.Constant, + label: '"EUR"', + textEdit: { range: state.getPositionRange('marker'), newText: '"EUR"' }, + }, + ], + }, + }); +}); + +test('literals support for match - simple case without string', async () => { + const code = ` +// @filename: test.py +//// from typing import Literal +//// +//// Currency = Literal["USD", "EUR"] +//// +//// def foo(c: Currency): +//// match c: +//// case [|US/*marker*/|] + `; + + const state = parseAndGetTestState(code).state; + const marker = state.getMarkerByName('marker'); + state.openFile(marker.fileName); + + await state.verifyCompletion('included', MarkupKind.Markdown, { + marker: { + completions: [ + { + kind: CompletionItemKind.Constant, + label: '"USD"', + }, + ], + }, + }); +}); + +test('completion quote trigger', async () => { + const code = ` +// @filename: test.py +//// from typing import Literal +//// +//// Currency = Literal["USD", "EUR"] +//// +//// def foo(c: Currency): +//// match c: +//// case [|"/*marker*/"|] + `; + + const state = parseAndGetTestState(code).state; + const marker = state.getMarkerByName('marker'); + const filePath = marker.fileName; + const position = state.convertOffsetToPosition(filePath, marker.position); + + const options: CompletionOptions = { + format: 'markdown', + snippet: false, + lazyEdit: false, + autoImport: false, + extraCommitChars: false, + importFormat: ImportFormat.Absolute, + includeUserSymbolsInAutoImport: false, + triggerCharacter: '"', + }; + + const result = await state.workspace.service.getCompletionsForPosition( + filePath, + position, + state.workspace.rootPath, + options, + undefined, + CancellationToken.None + ); + + assert(result); + const item = result.completionList.items.find((a) => a.label === '"USD"'); + assert(item); +}); + +test('completion quote trigger - middle', async () => { + const code = ` +// @filename: test.py +//// from typing import Literal +//// +//// Currency = Literal["Quote'Middle"] +//// +//// def foo(c: Currency): +//// match c: +//// case [|"Quote'/*marker*/"|] + `; + + const state = parseAndGetTestState(code).state; + const marker = state.getMarkerByName('marker'); + const filePath = marker.fileName; + const position = state.convertOffsetToPosition(filePath, marker.position); + + const options: CompletionOptions = { + format: 'markdown', + snippet: false, + lazyEdit: false, + autoImport: false, + extraCommitChars: false, + importFormat: ImportFormat.Absolute, + includeUserSymbolsInAutoImport: false, + triggerCharacter: "'", + }; + + const result = await state.workspace.service.getCompletionsForPosition( + filePath, + position, + state.workspace.rootPath, + options, + undefined, + CancellationToken.None + ); + + assert.strictEqual(result?.completionList.items.length, 0); +}); + +test('auto import sort text', async () => { + const code = ` +// @filename: test.py +//// [|os/*marker*/|] + +// @filename: unused.py +//// import os +//// p = os.path + +// @filename: vendored/__init__.py +// @library: true +//// # empty + +// @filename: vendored/os.py +// @library: true +//// def foo(): pass + `; + + const state = parseAndGetTestState(code).state; + const marker = state.getMarkerByName('marker'); + state.openFiles(state.testData.files.map((f) => f.fileName)); + + while (state.workspace.service.test_program.analyze()); + + const filePath = marker.fileName; + const position = state.convertOffsetToPosition(filePath, marker.position); + + const options: CompletionOptions = { + format: 'markdown', + snippet: false, + lazyEdit: false, + autoImport: true, + extraCommitChars: false, + importFormat: ImportFormat.Absolute, + includeUserSymbolsInAutoImport: true, + }; + + const result = await state.workspace.service.getCompletionsForPosition( + filePath, + position, + state.workspace.rootPath, + options, + undefined, + CancellationToken.None + ); + + const items = result?.completionList.items.filter((i) => i.label === 'os'); + assert.strictEqual(items?.length, 2); + + items.sort((a, b) => a.sortText!.localeCompare(b.sortText!)); + + assert(!items[0].labelDetails); + assert.strictEqual(items[1].labelDetails!.description, 'vendored'); +}); diff --git a/packages/pyright-internal/src/tests/config.test.ts b/packages/pyright-internal/src/tests/config.test.ts index 623c89d40..e668519af 100644 --- a/packages/pyright-internal/src/tests/config.test.ts +++ b/packages/pyright-internal/src/tests/config.test.ts @@ -291,3 +291,17 @@ test('BasicPyprojectTomlParsing', () => { assert.strictEqual(configOptions.diagnosticRuleSet.reportMissingImports, 'error'); assert.strictEqual(configOptions.diagnosticRuleSet.reportUnusedClass, 'warning'); }); + +test('FindFilesInMemoryOnly', () => { + const cwd = normalizePath(process.cwd()); + const service = new AnalyzerService('', createFromRealFileSystem(), options); + const commandLineOptions = new CommandLineOptions(cwd, /* fromVsCodeExtension */ true); + service.setOptions(commandLineOptions); + + // Open a file that is not backed by the file system. + const untitled = combinePaths(cwd, 'untitled.py'); + service.setFileOpened(untitled, 1, '# empty'); + + const fileList = service.test_getFileNamesFromFileSpecs(); + assert(fileList.filter((f) => f === untitled)); +}); diff --git a/packages/pyright-internal/src/tests/diagnostics.test.ts b/packages/pyright-internal/src/tests/diagnostics.test.ts new file mode 100644 index 000000000..2c99916b2 --- /dev/null +++ b/packages/pyright-internal/src/tests/diagnostics.test.ts @@ -0,0 +1,41 @@ +/* + * diagnostics.test.ts + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT license. + * + * Unit tests for diagnostics + */ + +import { parseAndGetTestState } from './harness/fourslash/testState'; + +test('unused import', async () => { + const code = ` +// @filename: test1.py +//// from test2 import [|/*marker*/foo|] + +// @filename: test2.py +//// def foo(): pass + `; + + const state = parseAndGetTestState(code).state; + + state.verifyDiagnostics({ + marker: { category: 'unused', message: '"foo" is not accessed' }, + }); +}); + +test('pyright ignore unused import', async () => { + const code = ` +// @filename: test1.py +//// from test2 import [|/*marker*/foo|] # pyright: ignore + +// @filename: test2.py +//// def foo(): pass + `; + + const state = parseAndGetTestState(code).state; + + state.verifyDiagnostics({ + marker: { category: 'none', message: '' }, + }); +}); diff --git a/packages/pyright-internal/src/tests/docStringConversion.test.ts b/packages/pyright-internal/src/tests/docStringConversion.test.ts index 02ddff1cb..8e8634e55 100644 --- a/packages/pyright-internal/src/tests/docStringConversion.test.ts +++ b/packages/pyright-internal/src/tests/docStringConversion.test.ts @@ -285,10 +285,10 @@ This text comes after. const markdown = `Take a look at this code: ${tripleTick} -if foo: - print(foo) -else: - print('not foo!') + if foo: + print(foo) + else: + print('not foo!') ${tripleTick} This text comes after. @@ -308,10 +308,10 @@ test('RestLiteralBlockEmptyDoubleColonLine', () => { `; const markdown = `${tripleTick} -if foo: - print(foo) -else: - print('not foo!') + if foo: + print(foo) + else: + print('not foo!') ${tripleTick} `; @@ -336,10 +336,10 @@ This text comes after. const markdown = `Take a look at this code: ${tripleTick} -if foo: - print(foo) -else: - print('not foo!') + if foo: + print(foo) + else: + print('not foo!') ${tripleTick} This text comes after. @@ -665,6 +665,34 @@ Currently, the following file formats are supported: _testConvertToMarkdown(docstring, markdown); }); +test('Non EpyDocCv2Imread', () => { + const docstring = `imread(filename[, flags]) -> retval + . @brief Loads an image from a file. + . @anchor imread + . + . The function imread loads an image from the specified file and returns it. If the image cannot be + . read (because of missing file, improper permissions, unsupported or invalid format), the function + . + . Currently, the following file formats are supported: + . + . - Windows bitmaps - \\*.bmp, \\*.dib (always supported) + . - JPEG files - \\*.jpeg, \\*.jpg, \\*.jpe (see the *Note* section)`; + + const markdown = `imread(filename\\[, flags\\]) -> retval +. @brief Loads an image from a file. +. @anchor imread +. +. The function imread loads an image from the specified file and returns it. If the image cannot be +. read (because of missing file, improper permissions, unsupported or invalid format), the function +. +. Currently, the following file formats are supported: +. +. - Windows bitmaps - \\*.bmp, \\*.dib (always supported) +. - JPEG files - \\*.jpeg, \\*.jpg, \\*.jpe (see the \\*Note\\* section)`; + + _testConvertToMarkdown(docstring, markdown); +}); + test('EpyDocTest', () => { const docstring = `Return the x intercept of the line M{y=m*x+b}. The X{x intercept} of a line is the point at which it crosses the x axis (M{y=0}). @@ -718,6 +746,31 @@ test('EscapeHtmlTagsOutsideCodeBlocks', () => { _testConvertToMarkdown(docstring, markdown); }); +test('IndentedCodeBlock', () => { + const docstring = ` +Expected: + ${tripleTick}python + def some_fn(): + """ + Backticks on a different indentation level don't close the code block. + ${tripleTick} + """ + ${tripleTick} +`; + + const markdown = ` +Expected: +${tripleTick}python + def some_fn(): + """ + Backticks on a different indentation level don't close the code block. + ${tripleTick} + """ +${tripleTick} +`; + _testConvertToMarkdown(docstring, markdown); +}); + test('RestTableWithHeader', () => { const docstring = ` =============== ========================================================= @@ -821,3 +874,40 @@ function _testConvertToPlainText(docstring: string, expectedPlainText: string) { function _normalizeLineEndings(text: string): string { return text.split(/\r?\n/).join('\n'); } + +test('RPYCLiteralBlockTransition', () => { + const docstring = ` +:: + + ##### ##### #### + ## ## ## ## ## #### + ## ## ## ## ## # + ##### ##### ## ## ## ## + ## ## ## ## ## ## # + ## ## ## ### ## ### + ## ## ## ## ##### + -------------------- ## ------------------------------------------ + ## + +Remote Python Call (RPyC) +`; + + const markdown = ` + +${tripleTick} + ##### ##### #### + ## ## ## ## ## #### + ## ## ## ## ## # + ##### ##### ## ## ## ## + ## ## ## ## ## ## # + ## ## ## ### ## ### + ## ## ## ## ##### + -------------------- ## ------------------------------------------ + ## +${tripleTick} + +Remote Python Call (RPyC) +`; + + _testConvertToMarkdown(docstring, markdown); +}); diff --git a/packages/pyright-internal/src/tests/documentSymbolCollector.test.ts b/packages/pyright-internal/src/tests/documentSymbolCollector.test.ts index 31d65b26a..c7e669341 100644 --- a/packages/pyright-internal/src/tests/documentSymbolCollector.test.ts +++ b/packages/pyright-internal/src/tests/documentSymbolCollector.test.ts @@ -13,8 +13,9 @@ import { findNodeByOffset } from '../analyzer/parseTreeUtils'; import { Program } from '../analyzer/program'; import { createMapFromItems } from '../common/collectionUtils'; import { ConfigOptions } from '../common/configOptions'; +import { isArray } from '../common/core'; import { TextRange } from '../common/textRange'; -import { DocumentSymbolCollector } from '../languageService/documentSymbolCollector'; +import { DocumentSymbolCollector, DocumentSymbolCollectorUseCase } from '../languageService/documentSymbolCollector'; import { NameNode } from '../parser/parseNodes'; import { Range } from './harness/fourslash/fourSlashTypes'; import { parseAndGetTestState } from './harness/fourslash/testState'; @@ -459,6 +460,119 @@ test('overridden symbols multi inheritance test', () => { verifyReferencesAtPosition(state.program, state.configOptions, 'foo', marker.fileName, marker.position, ranges); }); +test('__init__ test', () => { + const code = ` +// @filename: test.py +//// class A: +//// def __init__(self): +//// pass +//// +//// class B: +//// def __init__(self): +//// pass +//// +//// class C(A, B): +//// def [|/*marker*/__init__|](self): +//// pass +//// +//// A() +//// B() +//// [|C|]() + `; + + const state = parseAndGetTestState(code).state; + + const marker = state.getMarkerByName('marker'); + const ranges = state.getRangesByText().get('__init__')!; + ranges.push(...state.getRangesByText().get('C')!); + + verifyReferencesAtPosition( + state.program, + state.configOptions, + ['__init__', 'C'], + marker.fileName, + marker.position, + ranges + ); +}); + +test('super __init__ test', () => { + const code = ` +// @filename: test.py +//// class A: +//// def [|__init__|](self): +//// pass +//// +//// class B: +//// def __init__(self): +//// pass +//// +//// class C(A, B): +//// def __init__(self): +//// super().[|/*marker*/__init__|]() +//// pass +//// +//// [|A|]() +//// B() +//// C() + `; + + const state = parseAndGetTestState(code).state; + + const marker = state.getMarkerByName('marker'); + const ranges = state.getRangesByText().get('__init__')!; + ranges.push(...state.getRangesByText().get('A')!); + + verifyReferencesAtPosition( + state.program, + state.configOptions, + ['__init__', 'A'], + marker.fileName, + marker.position, + ranges + ); +}); + +test('__init__ internal class test', () => { + const code = ` +// @filename: test.py +//// class A: +//// def __init__(self): +//// class A_inner: +//// def [|/*marker*/__init__|](self): +//// pass +//// self.inner = [|A_inner|]() +//// +//// +//// class B: +//// def __init__(self): +//// pass +//// +//// class C(A, B): +//// def __init__(self): +//// pass +//// +//// A() +//// B() +//// C() + `; + + const state = parseAndGetTestState(code).state; + + const marker = state.getMarkerByName('marker'); + const ranges = state.getRangesByText().get('__init__')!; + ranges.push(...state.getRangesByText().get('A_inner')!); + + verifyReferencesAtPosition( + state.program, + state.configOptions, + ['__init__', 'A_inner'], + marker.fileName, + marker.position, + ranges + ); +}); + test('overridden symbols multi inheritance with multiple base with same name test', () => { const code = ` // @filename: test.py @@ -695,7 +809,7 @@ test('variable overridden test 2', () => { function verifyReferencesAtPosition( program: Program, configOption: ConfigOptions, - symbolName: string, + symbolNames: string | string[], fileName: string, position: number, ranges: Range[] @@ -708,6 +822,7 @@ function verifyReferencesAtPosition( node as NameNode, program.evaluator!, /* resolveLocalName */ true, + DocumentSymbolCollectorUseCase.Reference, CancellationToken.None, program.test_createSourceMapper(configOption.findExecEnvironment(fileName)) ); @@ -715,18 +830,19 @@ function verifyReferencesAtPosition( const rangesByFile = createMapFromItems(ranges, (r) => r.fileName); for (const rangeFileName of rangesByFile.keys()) { const collector = new DocumentSymbolCollector( - symbolName, + isArray(symbolNames) ? symbolNames : [symbolNames], decls, program.evaluator!, CancellationToken.None, program.getBoundSourceFile(rangeFileName)!.getParseResults()!.parseTree, /* treatModuleInImportAndFromImportSame */ true, - /* skipUnreachableCode */ false + /* skipUnreachableCode */ false, + DocumentSymbolCollectorUseCase.Reference ); const results = collector.collect(); const rangesOnFile = rangesByFile.get(rangeFileName)!; - assert.strictEqual(results.length, rangesOnFile.length, `${rangeFileName}@${symbolName}`); + assert.strictEqual(results.length, rangesOnFile.length, `${rangeFileName}@${symbolNames}`); for (const result of results) { assert(rangesOnFile.some((r) => r.pos === result.range.start && r.end === TextRange.getEnd(result.range))); diff --git a/packages/pyright-internal/src/tests/filesystem.test.ts b/packages/pyright-internal/src/tests/filesystem.test.ts index f096f9143..8961631cc 100644 --- a/packages/pyright-internal/src/tests/filesystem.test.ts +++ b/packages/pyright-internal/src/tests/filesystem.test.ts @@ -41,6 +41,21 @@ test('Folders', () => { }); }); +test('Folders Recursive', () => { + const cwd = normalizeSlashes('/'); + const fs = new vfs.TestFileSystem(/*ignoreCase*/ true, { cwd }); + + // no such dir exist + assert.throws(() => { + fs.chdir('a'); + }); + + const path = combinePaths('/', 'a', 'b', 'c'); + fs.mkdirSync(path, { recursive: true }); + + assert(fs.existsSync(path)); +}); + test('Files', () => { const cwd = normalizeSlashes('/'); const fs = new vfs.TestFileSystem(/*ignoreCase*/ true, { cwd }); diff --git a/packages/pyright-internal/src/tests/fourslash/completions.autoimport.shadow.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/completions.autoimport.shadow.fourslash.ts index 04937229d..37b024d17 100644 --- a/packages/pyright-internal/src/tests/fourslash/completions.autoimport.shadow.fourslash.ts +++ b/packages/pyright-internal/src/tests/fourslash/completions.autoimport.shadow.fourslash.ts @@ -24,7 +24,7 @@ // This will cause shadow file to be injected. helper.openFile(helper.getMarkerByName('hover').fileName); helper.verifyHover('markdown', { - hover: '```python\n(method) method: () -> Unknown\n```\n---\ndoc string', + hover: '```python\n(method) def method() -> Unknown\n```\n---\ndoc string', }); const importRange = helper.getPositionRange('import'); diff --git a/packages/pyright-internal/src/tests/fourslash/completions.builtinDocstrings.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/completions.builtinDocstrings.fourslash.ts index 3f51c9c32..53b9fb509 100644 --- a/packages/pyright-internal/src/tests/fourslash/completions.builtinDocstrings.fourslash.ts +++ b/packages/pyright-internal/src/tests/fourslash/completions.builtinDocstrings.fourslash.ts @@ -73,7 +73,7 @@ { label: '__init__', kind: Consts.CompletionItemKind.Method, - documentation: '__init__: () -> None\n\nThis is the __init__ doc for object.', + documentation: 'def __init__() -> None\n\nThis is the __init__ doc for object.', }, ], }, @@ -82,7 +82,7 @@ { label: '__init__', kind: Consts.CompletionItemKind.Method, - documentation: '__init__: () -> None', + documentation: 'def __init__() -> None', }, ], }, @@ -91,7 +91,7 @@ { label: '__init__', kind: Consts.CompletionItemKind.Method, - documentation: '__init__: () -> None\n\nThis is the __init__ doc for B.', + documentation: 'def __init__() -> None\n\nThis is the __init__ doc for B.', }, ], }, @@ -100,7 +100,7 @@ { label: '__init__', kind: Consts.CompletionItemKind.Method, - documentation: '__init__: () -> None', + documentation: 'def __init__() -> None', }, ], }, @@ -109,7 +109,7 @@ { label: '__init__', kind: Consts.CompletionItemKind.Method, - documentation: '__init__: () -> None\n\nThis is the __init__ doc for D.', + documentation: 'def __init__() -> None\n\nThis is the __init__ doc for D.', }, ], }, diff --git a/packages/pyright-internal/src/tests/fourslash/completions.classVariable.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/completions.classVariable.fourslash.ts index a7c7b0350..280ddcbea 100644 --- a/packages/pyright-internal/src/tests/fourslash/completions.classVariable.fourslash.ts +++ b/packages/pyright-internal/src/tests/fourslash/completions.classVariable.fourslash.ts @@ -1,10 +1,16 @@ /// +// @filename: pyrightconfig.json +//// { +//// "pythonVersion": "3.11" +//// } // @filename: test.py +//// class MyType: pass +//// //// class B: //// var1 = 1 -//// var2: int -//// var3: str = "hello" +//// var2: MyType +//// var3: list[str] = ["hello"] //// __var4 = 4 //// //// def __init__(self): @@ -12,26 +18,118 @@ //// //// class T(B): //// var5: bool -//// [|va/*marker*/|] +//// [|va/*marker1*/|] +//// +//// class T1(B): +//// var2: [|/*marker2*/|] +//// +//// class T2(B): +//// var3: [|/*marker3*/|] + +// @filename: test2.py +//// from typing import Generic, Sequence, TypeVar +//// +//// +//// T = TypeVar("T") +//// +//// class A(Generic[T]): +//// var: Sequence[T] +//// +//// class B(A[int]): +//// var: [|/*marker4*/|] +//// +//// T2 = TypeVar("T2") +//// +//// class C(A[T2]): +//// var: [|/*marker5*/|] + +// @filename: test3.py +//// from typing import Generic, TypeVarTuple +//// +//// T = TypeVarTuple('T') +//// +//// class MyType(Generic[*T]): +//// pass +//// +//// class A(Generic[*T]): +//// var: MyType[*T] +//// +//// class B(A[int, str, float]): +//// var: [|/*marker6*/|] +//// +//// T2 = TypeVarTuple('T2') +//// +//// class C(A[int, *T2]): +//// var: [|/*marker7*/|] + +{ + helper.openFiles(helper.getMarkers().map((m) => m.fileName)); -// @ts-ignore -await helper.verifyCompletion('included', 'markdown', { - marker: { - completions: [ - { - label: 'var1', - kind: Consts.CompletionItemKind.Variable, - }, - { - label: 'var2', - kind: Consts.CompletionItemKind.Variable, - textEdit: { range: helper.getPositionRange('marker'), newText: 'var2: int' }, - }, - { - label: 'var3', - kind: Consts.CompletionItemKind.Variable, - textEdit: { range: helper.getPositionRange('marker'), newText: 'var3: str' }, - }, - ], - }, -}); + // @ts-ignore + await helper.verifyCompletion('included', 'markdown', { + marker1: { + completions: [ + { + label: 'var1', + kind: Consts.CompletionItemKind.Variable, + }, + { + label: 'var2', + kind: Consts.CompletionItemKind.Variable, + }, + { + label: 'var3', + kind: Consts.CompletionItemKind.Variable, + }, + ], + }, + marker2: { + completions: [ + { + label: 'MyType', + kind: Consts.CompletionItemKind.Reference, + }, + ], + }, + marker3: { + completions: [ + { + label: 'list[str]', + kind: Consts.CompletionItemKind.Reference, + }, + ], + }, + marker4: { + completions: [ + { + label: 'Sequence[int]', + kind: Consts.CompletionItemKind.Reference, + }, + ], + }, + marker5: { + completions: [ + { + label: 'Sequence[T2]', + kind: Consts.CompletionItemKind.Reference, + }, + ], + }, + marker6: { + completions: [ + { + label: 'MyType[int, str, float]', + kind: Consts.CompletionItemKind.Reference, + }, + ], + }, + marker7: { + completions: [ + { + label: 'MyType[int, *T2]', + kind: Consts.CompletionItemKind.Reference, + }, + ], + }, + }); +} diff --git a/packages/pyright-internal/src/tests/fourslash/completions.commitChars.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/completions.commitChars.fourslash.ts index 15c5e279d..800bee92a 100644 --- a/packages/pyright-internal/src/tests/fourslash/completions.commitChars.fourslash.ts +++ b/packages/pyright-internal/src/tests/fourslash/completions.commitChars.fourslash.ts @@ -8,6 +8,10 @@ // @filename: test1.py //// from .samp[|/*marker3*/|] +// @filename: test2.py +//// from samples import * +//// [|/*marker4*/|] + // @filename: samples.py //// import fooLib as fooLib //// def fooFunc(): ... @@ -55,7 +59,26 @@ { label: 'samples', kind: Consts.CompletionItemKind.Module, - commitCharacters: undefined, + commitCharacters: [], + }, + ], + }, + marker4: { + completions: [ + { + label: 'fooLib', + kind: Consts.CompletionItemKind.Module, + commitCharacters: [], + }, + { + label: 'fooFunc', + kind: Consts.CompletionItemKind.Function, + commitCharacters: [], + }, + { + label: 'fooClass', + kind: Consts.CompletionItemKind.Class, + commitCharacters: [], }, ], }, diff --git a/packages/pyright-internal/src/tests/fourslash/completions.dictionary.keys.expression.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/completions.dictionary.keys.expression.fourslash.ts index abc8f0dd0..a145ca86a 100644 --- a/packages/pyright-internal/src/tests/fourslash/completions.dictionary.keys.expression.fourslash.ts +++ b/packages/pyright-internal/src/tests/fourslash/completions.dictionary.keys.expression.fourslash.ts @@ -18,7 +18,7 @@ // @filename: dict_expression_partial_expression.py //// d = { "key" : 1 } //// d["key2"] = 1 -//// d[key/*marker4*/] +//// d[[|key/*marker4*/|]] // @filename: dict_expression_complex_key.py //// class C: @@ -52,8 +52,18 @@ }, marker4: { completions: [ - { label: '"key"', kind: Consts.CompletionItemKind.Constant, detail: 'Dictionary key' }, - { label: '"key2"', kind: Consts.CompletionItemKind.Constant, detail: 'Dictionary key' }, + { + label: '"key"', + kind: Consts.CompletionItemKind.Constant, + textEdit: { range: helper.getPositionRange('marker4'), newText: '"key"' }, + detail: 'Dictionary key', + }, + { + label: '"key2"', + kind: Consts.CompletionItemKind.Constant, + textEdit: { range: helper.getPositionRange('marker4'), newText: '"key2"' }, + detail: 'Dictionary key', + }, ], }, marker5: { diff --git a/packages/pyright-internal/src/tests/fourslash/completions.dictionary.keys.stringLiterals.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/completions.dictionary.keys.stringLiterals.fourslash.ts index 671e3f9a3..285083232 100644 --- a/packages/pyright-internal/src/tests/fourslash/completions.dictionary.keys.stringLiterals.fourslash.ts +++ b/packages/pyright-internal/src/tests/fourslash/completions.dictionary.keys.stringLiterals.fourslash.ts @@ -25,7 +25,7 @@ // @filename: dict_key_name_conflicts.py //// keyString = "key" //// d = dict(keyString=1) -//// d[keyStr[|/*marker6*/|]] +//// d[[|keyStr/*marker6*/|]] // @filename: dict_key_mixed_literals.py //// d = { "key": 1, 1 + 2: 1 } @@ -94,7 +94,12 @@ marker6: { completions: [ { label: 'keyString', kind: Consts.CompletionItemKind.Variable }, - { label: '"keyString"', kind: Consts.CompletionItemKind.Constant, detail: 'Dictionary key' }, + { + label: '"keyString"', + kind: Consts.CompletionItemKind.Constant, + textEdit: { range: helper.getPositionRange('marker6'), newText: '"keyString"' }, + detail: 'Dictionary key', + }, ], }, marker7: { diff --git a/packages/pyright-internal/src/tests/fourslash/completions.dunderNew.Inheritance.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/completions.dunderNew.Inheritance.fourslash.ts new file mode 100644 index 000000000..e2dc51faa --- /dev/null +++ b/packages/pyright-internal/src/tests/fourslash/completions.dunderNew.Inheritance.fourslash.ts @@ -0,0 +1,30 @@ +/// + +// @filename: test.py +//// class Parent: +//// def __init__(self, *args: Any, **kwargs: Any): +//// pass +//// +//// def __new__(cls, *args: Any, **kwargs: Any): +//// pass +//// +//// class Child(Parent): +//// def __new__(cls, name:str): +//// return super().__new__(cls, name) +//// +//// class GrandChild(Child): +//// pass + +//// x = GrandChild([|/*marker1*/|]) + +// @ts-ignore +await helper.verifyCompletion('included', 'markdown', { + marker1: { + completions: [ + { + label: 'name=', + kind: Consts.CompletionItemKind.Variable, + }, + ], + }, +}); diff --git a/packages/pyright-internal/src/tests/fourslash/completions.dunderNew.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/completions.dunderNew.fourslash.ts new file mode 100644 index 000000000..ac9138abe --- /dev/null +++ b/packages/pyright-internal/src/tests/fourslash/completions.dunderNew.fourslash.ts @@ -0,0 +1,20 @@ +/// + +// @filename: test.py +//// class Foo: +//// def __new__(cls, name: str): +//// return super().__new__(cls) +//// +//// x = Foo([|/*marker1*/|]) + +// @ts-ignore +await helper.verifyCompletion('included', 'markdown', { + marker1: { + completions: [ + { + label: 'name=', + kind: Consts.CompletionItemKind.Variable, + }, + ], + }, +}); diff --git a/packages/pyright-internal/src/tests/fourslash/completions.errorNodes.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/completions.errorNodes.fourslash.ts new file mode 100644 index 000000000..33def1708 --- /dev/null +++ b/packages/pyright-internal/src/tests/fourslash/completions.errorNodes.fourslash.ts @@ -0,0 +1,27 @@ +/// + +// @filename: test.py +//// import os + +//// class App(): +//// def __init(self): +//// self.instance_path = "\\foo" + +//// app = App() +//// try: +//// os.makedirs(app.in[|/*marker*/|]) + +//// except: +//// pass + +// @ts-ignore +await helper.verifyCompletion('included', 'markdown', { + marker: { + completions: [ + { + label: 'instance_path', + kind: Consts.CompletionItemKind.Variable, + }, + ], + }, +}); diff --git a/packages/pyright-internal/src/tests/fourslash/completions.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/completions.fourslash.ts index c94b6f4c6..fd18789f1 100644 --- a/packages/pyright-internal/src/tests/fourslash/completions.fourslash.ts +++ b/packages/pyright-internal/src/tests/fourslash/completions.fourslash.ts @@ -38,12 +38,12 @@ await helper.verifyCompletion('exact', 'markdown', { { label: 'some_func1', kind: Consts.CompletionItemKind.Function, - documentation: '```python\nsome_func1: (a: Unknown) -> None\n```\n---\nsome function docs', + documentation: '```python\ndef some_func1(a: Unknown) -> None\n```\n---\nsome function docs', }, { label: 'some_func2', kind: Consts.CompletionItemKind.Function, - documentation: '```python\nsome_func2: (a: Unknown) -> None\n```\n---\nanother function docs', + documentation: '```python\ndef some_func2(a: Unknown) -> None\n```\n---\nanother function docs', }, ], }, diff --git a/packages/pyright-internal/src/tests/fourslash/completions.inherited.overload.docFromScrWithStub.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/completions.inherited.overload.docFromScrWithStub.fourslash.ts index dfcc3d19b..d910ebc13 100644 --- a/packages/pyright-internal/src/tests/fourslash/completions.inherited.overload.docFromScrWithStub.fourslash.ts +++ b/packages/pyright-internal/src/tests/fourslash/completions.inherited.overload.docFromScrWithStub.fourslash.ts @@ -45,7 +45,7 @@ await helper.verifyCompletion('included', 'markdown', { label: 'func', kind: Consts.CompletionItemKind.Method, documentation: - '```python\nfunc(self: ChildA, x: str) -> str\nfunc(self: ChildA, x: int) -> int\n```\n---\nfunc docs', + '```python\ndef func(self: ChildA, x: str) -> str: ...\ndef func(self: ChildA, x: int) -> int: ...\n```\n---\nfunc docs', }, ], }, diff --git a/packages/pyright-internal/src/tests/fourslash/completions.inherited.overload.docFromStub.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/completions.inherited.overload.docFromStub.fourslash.ts index 364a160c6..e9d9a625e 100644 --- a/packages/pyright-internal/src/tests/fourslash/completions.inherited.overload.docFromStub.fourslash.ts +++ b/packages/pyright-internal/src/tests/fourslash/completions.inherited.overload.docFromStub.fourslash.ts @@ -46,7 +46,7 @@ await helper.verifyCompletion('included', 'markdown', { label: 'func', kind: Consts.CompletionItemKind.Method, documentation: - '```python\nfunc(self: ChildA, x: str) -> str\nfunc(self: ChildA, x: int) -> int\n```\n---\nfunc docs', + '```python\ndef func(self: ChildA, x: str) -> str: ...\ndef func(self: ChildA, x: int) -> int: ...\n```\n---\nfunc docs', }, ], }, diff --git a/packages/pyright-internal/src/tests/fourslash/completions.libCodeAndStub.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/completions.libCodeAndStub.fourslash.ts index fab316d38..207d76f2c 100644 --- a/packages/pyright-internal/src/tests/fourslash/completions.libCodeAndStub.fourslash.ts +++ b/packages/pyright-internal/src/tests/fourslash/completions.libCodeAndStub.fourslash.ts @@ -58,7 +58,7 @@ await helper.verifyCompletion('included', 'markdown', { label: 'is_valid', kind: Consts.CompletionItemKind.Method, documentation: - '```python\nis_valid: (text: str) -> bool\n```\n---\nChecks if the input string is valid.', + '```python\ndef is_valid(text: str) -> bool\n```\n---\nChecks if the input string is valid.', }, ], }, diff --git a/packages/pyright-internal/src/tests/fourslash/completions.libCodeNoStub.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/completions.libCodeNoStub.fourslash.ts index 5e0ff5e4b..bb5991a5d 100644 --- a/packages/pyright-internal/src/tests/fourslash/completions.libCodeNoStub.fourslash.ts +++ b/packages/pyright-internal/src/tests/fourslash/completions.libCodeNoStub.fourslash.ts @@ -48,7 +48,7 @@ await helper.verifyCompletion('included', 'markdown', { label: 'is_valid', kind: Consts.CompletionItemKind.Method, documentation: - '```python\nis_valid: (text: str) -> bool\n```\n---\nChecks if the input string is valid.', + '```python\ndef is_valid(text: str) -> bool\n```\n---\nChecks if the input string is valid.', }, ], }, diff --git a/packages/pyright-internal/src/tests/fourslash/completions.libStub.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/completions.libStub.fourslash.ts index 8c6b86d5e..493bb1c3c 100644 --- a/packages/pyright-internal/src/tests/fourslash/completions.libStub.fourslash.ts +++ b/packages/pyright-internal/src/tests/fourslash/completions.libStub.fourslash.ts @@ -48,7 +48,7 @@ await helper.verifyCompletion('included', 'markdown', { label: 'is_valid', kind: Consts.CompletionItemKind.Method, documentation: - '```python\nis_valid: (text: str) -> bool\n```\n---\nChecks if the input string is valid.', + '```python\ndef is_valid(text: str) -> bool\n```\n---\nChecks if the input string is valid.', }, ], }, diff --git a/packages/pyright-internal/src/tests/fourslash/completions.localCode.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/completions.localCode.fourslash.ts index 5d6aca6e4..30f6a1c0b 100644 --- a/packages/pyright-internal/src/tests/fourslash/completions.localCode.fourslash.ts +++ b/packages/pyright-internal/src/tests/fourslash/completions.localCode.fourslash.ts @@ -43,7 +43,7 @@ await helper.verifyCompletion('included', 'markdown', { label: 'is_valid', kind: Consts.CompletionItemKind.Method, documentation: - '```python\nis_valid: (text: str) -> bool\n```\n---\nChecks if the input string is valid.', + '```python\ndef is_valid(text: str) -> bool\n```\n---\nChecks if the input string is valid.', }, ], }, @@ -67,7 +67,7 @@ await helper.verifyCompletion('included', 'markdown', { label: 'is_valid', kind: Consts.CompletionItemKind.Method, documentation: - '```python\nis_valid: (self: Validator, text: str) -> bool\n```\n---\nChecks if the input string is valid.', + '```python\ndef is_valid(self: Validator, text: str) -> bool\n```\n---\nChecks if the input string is valid.', }, ], }, diff --git a/packages/pyright-internal/src/tests/fourslash/completions.overloads.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/completions.overloads.fourslash.ts index 938211ef5..7d8a21eec 100644 --- a/packages/pyright-internal/src/tests/fourslash/completions.overloads.fourslash.ts +++ b/packages/pyright-internal/src/tests/fourslash/completions.overloads.fourslash.ts @@ -27,7 +27,7 @@ await helper.verifyCompletion('included', 'markdown', { label: 'func', kind: Consts.CompletionItemKind.Function, documentation: - '```python\nfunc(x: str) -> str\nfunc(x: bytes) -> bytes\nfunc(x: int) -> int\n```\n---\nfunc docs', + '```python\ndef func(x: str) -> str: ...\ndef func(x: bytes) -> bytes: ...\ndef func(x: int) -> int: ...\n```\n---\nfunc docs', }, ], }, diff --git a/packages/pyright-internal/src/tests/fourslash/completions.params.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/completions.params.fourslash.ts index c16436f31..82917bf08 100644 --- a/packages/pyright-internal/src/tests/fourslash/completions.params.fourslash.ts +++ b/packages/pyright-internal/src/tests/fourslash/completions.params.fourslash.ts @@ -1,10 +1,26 @@ /// // @filename: test.py +//// from typing import TypedDict, Unpack, Any +//// +//// class Movie(TypedDict): +//// key1: str +//// key2: int +//// //// def method(param1=None, param2='active', param3=None): //// pass //// //// met/*marker1*/hod /*marker2*/ ( /*marker3*/ param2 = 'test') +//// +//// def method2(param1: int, **kwargs: Unpack[Movie]): +//// pass +//// +//// method2(p/*marker4*/, k/*marker5*/) +//// +//// def method3(param1: int, **kwargs: Any): +//// pass +//// +//// method3(p/*marker6*/, k/*marker7*/) // @ts-ignore await helper.verifyCompletion('excluded', 'markdown', { @@ -14,6 +30,15 @@ await helper.verifyCompletion('excluded', 'markdown', { marker2: { completions: [{ label: 'param1', kind: undefined }], }, + marker4: { + completions: [{ label: 'key1', kind: undefined }], + }, + marker5: { + completions: [{ label: 'param1', kind: undefined }], + }, + marker7: { + completions: [{ label: 'key1', kind: undefined }], + }, }); // @ts-ignore @@ -21,4 +46,16 @@ await helper.verifyCompletion('included', 'markdown', { marker3: { completions: [{ label: 'param1=', kind: Consts.CompletionItemKind.Variable }], }, + marker4: { + completions: [{ label: 'param1=', kind: Consts.CompletionItemKind.Variable }], + }, + marker5: { + completions: [ + { label: 'key2=', kind: Consts.CompletionItemKind.Variable }, + { label: 'key1=', kind: Consts.CompletionItemKind.Variable }, + ], + }, + marker6: { + completions: [{ label: 'param1=', kind: Consts.CompletionItemKind.Variable }], + }, }); diff --git a/packages/pyright-internal/src/tests/fourslash/completions.plainText.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/completions.plainText.fourslash.ts index d3dd64791..1fb1daa74 100644 --- a/packages/pyright-internal/src/tests/fourslash/completions.plainText.fourslash.ts +++ b/packages/pyright-internal/src/tests/fourslash/completions.plainText.fourslash.ts @@ -22,12 +22,12 @@ await helper.verifyCompletion('exact', 'plaintext', { { label: 'some_func1', kind: Consts.CompletionItemKind.Function, - documentation: 'some_func1: (a: Unknown) -> None\n\nsome function docs', + documentation: 'def some_func1(a: Unknown) -> None\n\nsome function docs', }, { label: 'some_func2', kind: Consts.CompletionItemKind.Function, - documentation: 'some_func2: (a: Unknown) -> None\n\nanother function docs', + documentation: 'def some_func2(a: Unknown) -> None\n\nanother function docs', }, ], }, diff --git a/packages/pyright-internal/src/tests/fourslash/completions.self.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/completions.self.fourslash.ts index 060862d39..088d1de35 100644 --- a/packages/pyright-internal/src/tests/fourslash/completions.self.fourslash.ts +++ b/packages/pyright-internal/src/tests/fourslash/completions.self.fourslash.ts @@ -21,12 +21,12 @@ await helper.verifyCompletion('included', 'markdown', { { label: 'method1', kind: Consts.CompletionItemKind.Method, - documentation: '```python\nmethod1: () -> None\n```\n---\nMethod 1.', + documentation: '```python\ndef method1() -> None\n```\n---\nMethod 1.', }, { label: 'new_method', kind: Consts.CompletionItemKind.Method, - documentation: '```python\nnew_method: () -> None\n```', + documentation: '```python\ndef new_method() -> None\n```', }, { label: 'prop1', diff --git a/packages/pyright-internal/src/tests/fourslash/completions.wildcardimports.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/completions.wildcardimports.fourslash.ts index cfdbf3115..e2ba11c1c 100644 --- a/packages/pyright-internal/src/tests/fourslash/completions.wildcardimports.fourslash.ts +++ b/packages/pyright-internal/src/tests/fourslash/completions.wildcardimports.fourslash.ts @@ -82,7 +82,7 @@ await helper.verifyCompletion('includes', 'markdown', { { label: 'func2', kind: Consts.CompletionItemKind.Method, - documentation: '```python\nfunc2: () -> None\n```\n---\nfunc2 docs', + documentation: '```python\ndef func2() -> None\n```\n---\nfunc2 docs', }, ], }, diff --git a/packages/pyright-internal/src/tests/fourslash/findDefinitions.builtinClass.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/findDefinitions.builtinClass.fourslash.ts index 57550dddc..3227a86e1 100644 --- a/packages/pyright-internal/src/tests/fourslash/findDefinitions.builtinClass.fourslash.ts +++ b/packages/pyright-internal/src/tests/fourslash/findDefinitions.builtinClass.fourslash.ts @@ -1,14 +1,16 @@ /// // @filename: test.py -//// from typing import [|/*marker*/Union|] +//// from operator import itemgetter +//// x = 4 +//// itemgetter().[|/*marker*/__call__|](x) -// @filename: typing.py +// @filename: operator.py // @library: true -//// class _Union: -//// pass +//// class itemgetter: +//// def [|__call__|](self, obj): +//// pass //// -//// [|Union|] = _Union() { const rangeMap = helper.getRangesByText(); @@ -17,7 +19,7 @@ { marker: { definitions: rangeMap - .get('Union')! + .get('__call__')! .filter((r) => !r.marker) .map((r) => { return { path: r.fileName, range: helper.convertPositionRange(r) }; diff --git a/packages/pyright-internal/src/tests/fourslash/findDefinitions.namespaceImportWithInit.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/findDefinitions.namespaceImportWithInit.fourslash.ts new file mode 100644 index 000000000..fb4c8ae6a --- /dev/null +++ b/packages/pyright-internal/src/tests/fourslash/findDefinitions.namespaceImportWithInit.fourslash.ts @@ -0,0 +1,40 @@ +/// + +// @filename: pyrightconfig.json +//// { +//// "useLibraryCodeForTypes": true, +//// "executionEnvironments": [{ "root": "."}], +//// "venv": ".venv", +//// "venvPath": ".", +//// } + +// @filename: .venv/lib/site-packages/lib1.pth +//// lib1 + +// @filename: .venv/lib/site-packages/lib2.pth +//// lib2 + +// @filename: .venv/lib/site-packages/lib1/a/b/main.py +//// + +// @filename: .venv/lib/site-packages/lib2/a/b/__init__.py +//// [|/*def1*/x|] = 1 + +// @filename: test.py +//// from a.b import [|/*marker1*/x|] + +{ + helper.verifyFindDefinitions( + { + marker1: { + definitions: [ + { + path: helper.getMarkerByName('def1').fileName, + range: { start: { line: 0, character: 0 }, end: { line: 0, character: 1 } }, + }, + ], + }, + }, + 'preferSource' + ); +} diff --git a/packages/pyright-internal/src/tests/fourslash/fourslash.ts b/packages/pyright-internal/src/tests/fourslash/fourslash.ts index 70c3677f0..332ba1f62 100644 --- a/packages/pyright-internal/src/tests/fourslash/fourslash.ts +++ b/packages/pyright-internal/src/tests/fourslash/fourslash.ts @@ -232,7 +232,7 @@ declare namespace _ { convertPositionRange(range: Range): PositionRange; convertPathToUri(path: string): string; getDirectoryPath(path: string): string; - + getPathSep(): string; goToBOF(): void; goToEOF(): void; goToPosition(positionOrLineAndColumn: number | LineAndColumn): void; @@ -251,7 +251,7 @@ declare namespace _ { openFile(indexOrName: number | string): void; openFiles(indexOrNames: (number | string)[]): void; - verifyDiagnostics(map?: { [marker: string]: { category: string; message: string } }): void; + verifyDiagnostics(map?: { [marker: string]: { category: string; message: string | undefined } }): void; verifyCodeActions( map: { [marker: string]: { @@ -303,6 +303,11 @@ declare namespace _ { references: DocumentRange[]; }; }): void; + verifyShowCallHierarchyGetIncomingCalls(map: { + [marker: string]: { + references: DocumentRange[]; + }; + }): void; verifyHighlightReferences(map: { [marker: string]: { references: DocumentHighlight[]; diff --git a/packages/pyright-internal/src/tests/fourslash/hover.builtinDocstrings.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/hover.builtinDocstrings.fourslash.ts index 32d05547e..9a5f45e8a 100644 --- a/packages/pyright-internal/src/tests/fourslash/hover.builtinDocstrings.fourslash.ts +++ b/packages/pyright-internal/src/tests/fourslash/hover.builtinDocstrings.fourslash.ts @@ -49,16 +49,16 @@ { helper.verifyHover('plaintext', { object: '(class) object\n\nThis is the class doc for object.', - objectInit: '(class) object()\n\nThis is the __init__ doc for object.', - objectDir: '(method) __dir__: () -> Iterable[str]\n\nThis is the __dir__ doc for object.', + objectInit: 'class object()\n\nThis is the __init__ doc for object.', + objectDir: '(method) def __dir__() -> Iterable[str]\n\nThis is the __dir__ doc for object.', a: '(class) A', - aInit: '(class) A()', - aDir: '(method) __dir__: () -> Iterable[str]', + aInit: 'class A()', + aDir: '(method) def __dir__() -> Iterable[str]', b: '(class) B\n\nThis is the class doc for B.', - bInit: '(class) B()\n\nThis is the __init__ doc for B.', + bInit: 'class B()\n\nThis is the __init__ doc for B.', c: '(class) C\n\nThis is the class doc for C.', - cInit: '(class) C()\n\nThis is the class doc for C.', + cInit: 'class C()\n\nThis is the class doc for C.', d: '(class) D', - dInit: '(class) D()\n\nThis is the __init__ doc for D.', + dInit: 'class D()\n\nThis is the __init__ doc for D.', }); } diff --git a/packages/pyright-internal/src/tests/fourslash/hover.class.docString.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/hover.class.docString.fourslash.ts index a810a90ac..d0244358d 100644 --- a/packages/pyright-internal/src/tests/fourslash/hover.class.docString.fourslash.ts +++ b/packages/pyright-internal/src/tests/fourslash/hover.class.docString.fourslash.ts @@ -24,5 +24,5 @@ //// class A(): pass helper.verifyHover('markdown', { - marker1: '```python\n(class) A()\n```\n---\ndoc string for A', + marker1: '```python\nclass A()\n```\n---\ndoc string for A', }); diff --git a/packages/pyright-internal/src/tests/fourslash/hover.classNoInit.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/hover.classNoInit.fourslash.ts index 5c1776cdf..9c2380be5 100644 --- a/packages/pyright-internal/src/tests/fourslash/hover.classNoInit.fourslash.ts +++ b/packages/pyright-internal/src/tests/fourslash/hover.classNoInit.fourslash.ts @@ -10,5 +10,5 @@ //// [|/*marker1*/Something|]() helper.verifyHover('markdown', { - marker1: '```python\n(class) Something(text: str)\n```\n---\nThis is a test.', + marker1: '```python\nclass Something(text: str)\n```\n---\nThis is a test.', }); diff --git a/packages/pyright-internal/src/tests/fourslash/hover.docFromSrc.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/hover.docFromSrc.fourslash.ts index 92d2abc5c..09dc75aa5 100644 --- a/packages/pyright-internal/src/tests/fourslash/hover.docFromSrc.fourslash.ts +++ b/packages/pyright-internal/src/tests/fourslash/hover.docFromSrc.fourslash.ts @@ -55,29 +55,31 @@ //// def func2() -> bool: ... // @filename: test.py -//// import module1 -//// import module2 +//// import [|/*module1_docs*/module1|] as m1 +//// import [|/*module2_docs*/module2|] as m2 //// -//// print([|/*module1_docs*/module1|].[|/*func1_docs*/func1|]()) +//// print([|/*m1_docs*/m1|].[|/*func1_docs*/func1|]()) //// -//// a = module1.[|/*a_docs*/A|]() +//// a = m1.[|/*a_docs*/A|]() //// print(a.[|/*method1_docs*/method1|]()) //// -//// b = module1.[|/*b_docs*/B|]() +//// b = m1.[|/*b_docs*/B|]() //// -//// print([|/*module2_docs*/module2|].[|/*func2_docs*/func2|]()) +//// print([|/*m2_docs*/m2|].[|/*func2_docs*/func2|]()) //// -//// inner = module1.A.[|/*a_inner_docs*/Inner|]() +//// inner = m1.A.[|/*a_inner_docs*/Inner|]() //// print(inner.[|/*inner_method1_docs*/method1|]()) helper.verifyHover('markdown', { - a_docs: '```python\n(class) A()\n```\n---\nA docs', - b_docs: '```python\n(class) B()\n```\n---\nB init docs', - a_inner_docs: '```python\n(class) Inner()\n```\n---\nA.Inner docs', - func1_docs: '```python\n(function) func1: () -> bool\n```\n---\nfunc1 docs', - func2_docs: '```python\n(function) func2: () -> bool\n```\n---\nfunc2 docs', - inner_method1_docs: '```python\n(method) method1: () -> bool\n```\n---\nA.Inner.method1 docs', - method1_docs: '```python\n(method) method1: () -> bool\n```\n---\nA.method1 docs', + a_docs: '```python\nclass A()\n```\n---\nA docs', + b_docs: '```python\nclass B()\n```\n---\nB init docs', + a_inner_docs: '```python\nclass Inner()\n```\n---\nA.Inner docs', + func1_docs: '```python\n(function) def func1() -> bool\n```\n---\nfunc1 docs', + func2_docs: '```python\n(function) def func2() -> bool\n```\n---\nfunc2 docs', + inner_method1_docs: '```python\n(method) def method1() -> bool\n```\n---\nA.Inner.method1 docs', + method1_docs: '```python\n(method) def method1() -> bool\n```\n---\nA.method1 docs', module1_docs: '```python\n(module) module1\n```\n---\nmodule1 docs', module2_docs: '```python\n(module) module2\n```\n---\nmodule2 docs', + m1_docs: '```python\n(module) m1\n```\n---\nmodule1 docs', + m2_docs: '```python\n(module) m2\n```\n---\nmodule2 docs', }); diff --git a/packages/pyright-internal/src/tests/fourslash/hover.docFromSrc.pkg-vs-module1.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/hover.docFromSrc.pkg-vs-module1.fourslash.ts index 626369a7b..d9976123d 100644 --- a/packages/pyright-internal/src/tests/fourslash/hover.docFromSrc.pkg-vs-module1.fourslash.ts +++ b/packages/pyright-internal/src/tests/fourslash/hover.docFromSrc.pkg-vs-module1.fourslash.ts @@ -22,5 +22,5 @@ //// print([|/*func1_docs*/func1|]()) helper.verifyHover('markdown', { - func1_docs: '```python\n(function) func1: () -> bool\n```\n---\nfunc1 docs', + func1_docs: '```python\n(function) def func1() -> bool\n```\n---\nfunc1 docs', }); diff --git a/packages/pyright-internal/src/tests/fourslash/hover.docFromSrc.pkg-vs-module2.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/hover.docFromSrc.pkg-vs-module2.fourslash.ts index 168422c83..f9777a2f9 100644 --- a/packages/pyright-internal/src/tests/fourslash/hover.docFromSrc.pkg-vs-module2.fourslash.ts +++ b/packages/pyright-internal/src/tests/fourslash/hover.docFromSrc.pkg-vs-module2.fourslash.ts @@ -2,10 +2,12 @@ // @filename: package1/__init__.py // @library: true +//// '''package1 docs''' //// from .subpackage import func1 // @filename: package1/subpackage/__init__.py // @library: true +//// '''subpackage docs''' //// def func1(): //// '''func1 docs''' //// return True @@ -17,10 +19,11 @@ //// def func1() -> bool: ... // @filename: test.py -//// from package1 import func1 +//// from [|/*package_docs*/package1|] import func1 //// //// print([|/*func1_docs*/func1|]()) helper.verifyHover('markdown', { - func1_docs: '```python\n(function) func1: () -> bool\n```\n---\nfunc1 docs', + func1_docs: '```python\n(function) def func1() -> bool\n```\n---\nfunc1 docs', + package_docs: '```python\n(module) package1\n```\n---\npackage1 docs', }); diff --git a/packages/pyright-internal/src/tests/fourslash/hover.docFromSrc.relativeImport1.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/hover.docFromSrc.relativeImport1.fourslash.ts index 42ad8dac3..3cbdd62b3 100644 --- a/packages/pyright-internal/src/tests/fourslash/hover.docFromSrc.relativeImport1.fourslash.ts +++ b/packages/pyright-internal/src/tests/fourslash/hover.docFromSrc.relativeImport1.fourslash.ts @@ -18,6 +18,6 @@ //// print([|/*module1_docs*/module1|].[|/*func1_docs*/func1|]()) helper.verifyHover('markdown', { - func1_docs: '```python\n(function) func1: () -> bool\n```\n---\nfunc1 docs', + func1_docs: '```python\n(function) def func1() -> bool\n```\n---\nfunc1 docs', module1_docs: '```python\n(module) module1\n```\n---\nmodule1 docs', }); diff --git a/packages/pyright-internal/src/tests/fourslash/hover.docFromSrc.relativeImport2.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/hover.docFromSrc.relativeImport2.fourslash.ts index 860852438..4f0ff538f 100644 --- a/packages/pyright-internal/src/tests/fourslash/hover.docFromSrc.relativeImport2.fourslash.ts +++ b/packages/pyright-internal/src/tests/fourslash/hover.docFromSrc.relativeImport2.fourslash.ts @@ -13,10 +13,11 @@ //// // @filename: test.py -//// from .module1 import func1 +//// from .[|/*module_docs*/module1|] import func1 //// //// print([|/*func1_docs*/func1|]()) helper.verifyHover('markdown', { - func1_docs: '```python\n(function) func1: () -> bool\n```\n---\nfunc1 docs', + func1_docs: '```python\n(function) def func1() -> bool\n```\n---\nfunc1 docs', + module_docs: '```python\n(module) module1\n```\n---\nmodule1 docs', }); diff --git a/packages/pyright-internal/src/tests/fourslash/hover.docFromSrc.relativeImport3.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/hover.docFromSrc.relativeImport3.fourslash.ts index 54cc7c356..4369fc868 100644 --- a/packages/pyright-internal/src/tests/fourslash/hover.docFromSrc.relativeImport3.fourslash.ts +++ b/packages/pyright-internal/src/tests/fourslash/hover.docFromSrc.relativeImport3.fourslash.ts @@ -2,14 +2,17 @@ // @filename: dj/__init__.py // @library: true +//// '''dj doc string''' //// # empty // @filename: dj/db/__init__.py // @library: true +//// '''db doc string''' //// # empty // @filename: dj/db/models/__init__.py // @library: true +//// '''models doc string''' //// from dj.db.models.base import Model // @filename: dj/db/models/base.py @@ -26,6 +29,7 @@ //// # empty // @filename: typings/dj/db/models/__init__.pyi +//// '''models doc string''' //// from .base import Model as Model // @filename: typings/dj/db/models/base.pyi @@ -33,7 +37,7 @@ //// def clean_fields(self) -> None: ... // @filename: test.py -//// from dj.db import models +//// from [|/*djmarker*/dj|].[|/*dbmarker*/db|] import [|/*modelsmarker*/models|] //// //// class Person(models.Model): //// pass @@ -42,5 +46,8 @@ //// p.[|/*marker*/clean_fields|]() helper.verifyHover('markdown', { - marker: '```python\n(method) clean_fields: () -> None\n```\n---\nclean\\_fields docs', + marker: '```python\n(method) def clean_fields() -> None\n```\n---\nclean\\_fields docs', + djmarker: '```python\n(module) dj\n```\n---\ndj doc string', + dbmarker: '```python\n(module) db\n```\n---\ndb doc string', + modelsmarker: '```python\n(module) models\n```\n---\nmodels doc string', }); diff --git a/packages/pyright-internal/src/tests/fourslash/hover.docFromSrc.stubs-package.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/hover.docFromSrc.stubs-package.fourslash.ts index 612e21280..c1568afb4 100644 --- a/packages/pyright-internal/src/tests/fourslash/hover.docFromSrc.stubs-package.fourslash.ts +++ b/packages/pyright-internal/src/tests/fourslash/hover.docFromSrc.stubs-package.fourslash.ts @@ -24,6 +24,6 @@ //// print(package1.[|/*marker*/func1|]()) helper.verifyHover('markdown', { - marker: '```python\n(function) func1: () -> bool\n```\n---\nfunc1 docs', - marker2: '```python\n(function) func2: () -> bool\n```\n---\nfunc2 docs', + marker: '```python\n(function) def func1() -> bool\n```\n---\nfunc1 docs', + marker2: '```python\n(function) def func2() -> bool\n```\n---\nfunc2 docs', }); diff --git a/packages/pyright-internal/src/tests/fourslash/hover.docFromSrc.typeshed.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/hover.docFromSrc.typeshed.fourslash.ts index 3ec1dae8e..209023523 100644 --- a/packages/pyright-internal/src/tests/fourslash/hover.docFromSrc.typeshed.fourslash.ts +++ b/packages/pyright-internal/src/tests/fourslash/hover.docFromSrc.typeshed.fourslash.ts @@ -16,5 +16,5 @@ //// print(requests.[|/*marker*/head|]('')) helper.verifyHover('markdown', { - marker: '```python\n(function) head: (url: Unknown, **kwargs: Unknown) -> None\n```\n---\nSends a <HEAD> request.', + marker: '```python\n(function) def head(url: Unknown, **kwargs: Unknown) -> None\n```\n---\nSends a <HEAD> request.', }); diff --git a/packages/pyright-internal/src/tests/fourslash/hover.docstring.alias.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/hover.docstring.alias.fourslash.ts new file mode 100644 index 000000000..ebc2a2398 --- /dev/null +++ b/packages/pyright-internal/src/tests/fourslash/hover.docstring.alias.fourslash.ts @@ -0,0 +1,24 @@ +/// + +// @filename: test.py +//// class Foo: +//// ''' Original doc string ''' +//// pass +//// +//// [|/*marker1*/A|] = Foo +//// ''' Alias doc string ''' +//// +//// def bar(x: [|/*marker2*/A|]): +//// pass +//// +//// class Baz: +//// pass +//// +//// [|/*marker3*/B|] = Baz +//// ''' Alias alone doc string ''' + +helper.verifyHover('markdown', { + marker1: '```python\n(type alias) A: Type[Foo]\n```\n---\nAlias doc string\n\nOriginal doc string', + marker2: '```python\n(type alias) A: Type[Foo]\n```\n---\nAlias doc string\n\nOriginal doc string', + marker3: '```python\n(type alias) B: Type[Baz]\n```\n---\nAlias alone doc string', +}); diff --git a/packages/pyright-internal/src/tests/fourslash/hover.docstring.links.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/hover.docstring.links.fourslash.ts index 111eb262e..e9851c7b0 100644 --- a/packages/pyright-internal/src/tests/fourslash/hover.docstring.links.fourslash.ts +++ b/packages/pyright-internal/src/tests/fourslash/hover.docstring.links.fourslash.ts @@ -8,5 +8,5 @@ //// [|/*marker1*/func|]() helper.verifyHover('markdown', { - marker1: '```python\n(function) func: () -> None\n```\n---\nsomething [link](http://microsoft.com) something', + marker1: '```python\n(function) def func() -> None\n```\n---\nsomething [link](http://microsoft.com) something', }); diff --git a/packages/pyright-internal/src/tests/fourslash/hover.docstring.parameter.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/hover.docstring.parameter.fourslash.ts new file mode 100644 index 000000000..77746255b --- /dev/null +++ b/packages/pyright-internal/src/tests/fourslash/hover.docstring.parameter.fourslash.ts @@ -0,0 +1,57 @@ +/// + +// @filename: test.py +//// def foo1([|/*marker1*/bar|]: str) -> None: +//// """ +//// Foo1 does something +//// +//// @param bar: The bar is in town +//// """ +//// baz = [|/*marker2*/bar|] +//// ... +//// +//// def foo2([|/*marker3*/bar|]: str) -> None: +//// """ +//// Foo2 does something +//// +//// :param bar: The bar is in town +//// """ +//// baz = [|/*marker4*/bar|] +//// ... +//// +//// def foo3([|/*marker5*/bar|]: str, [|/*marker6*/bar2|]: str) -> None: +//// """ +//// Foo3 does something +//// +//// Args: +//// bar: The bar is in town +//// bar2 The bar is 2 far +//// """ +//// baz = [|/*marker7*/bar|] +//// [|/*marker8*/bar|] = "reassign" +//// ... +//// +//// def foo4([|/*marker9*/bar|]: str, [|/*marker10*/bar2|]: str) -> None: +//// """ +//// Foo4 does something +//// +//// Args: +//// bar (str): The bar is in town +//// bar2 str: The bar is 2 far +//// """ +//// baz = [|/*marker11*/bar|] +//// ... + +helper.verifyHover('markdown', { + marker1: '```python\n(parameter) bar: str\n```\nbar: The bar is in town', + marker2: '```python\n(parameter) bar: str\n```\nbar: The bar is in town', + marker3: '```python\n(parameter) bar: str\n```\nbar: The bar is in town', + marker4: '```python\n(parameter) bar: str\n```\nbar: The bar is in town', + marker5: '```python\n(parameter) bar: str\n```\nbar: The bar is in town', + marker6: '```python\n(parameter) bar2: str\n```', + marker7: '```python\n(parameter) bar: str\n```\nbar: The bar is in town', + marker8: "```python\n(parameter) bar: Literal['reassign']\n```\nbar: The bar is in town", + marker9: '```python\n(parameter) bar: str\n```\nbar (str): The bar is in town', + marker10: '```python\n(parameter) bar2: str\n```', + marker11: '```python\n(parameter) bar: str\n```\nbar (str): The bar is in town', +}); diff --git a/packages/pyright-internal/src/tests/fourslash/hover.docstring.split.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/hover.docstring.split.fourslash.ts index afd1062d4..887daaf68 100644 --- a/packages/pyright-internal/src/tests/fourslash/hover.docstring.split.fourslash.ts +++ b/packages/pyright-internal/src/tests/fourslash/hover.docstring.split.fourslash.ts @@ -18,7 +18,7 @@ //// [|/*marker3*/func3|]() helper.verifyHover('markdown', { - marker1: '```python\n(function) func: () -> None\n```\n---\nThis docstring is split.', - marker2: '```python\n(function) func2: () -> None\n```', - marker3: '```python\n(function) func3: () -> None\n```', + marker1: '```python\n(function) def func() -> None\n```\n---\nThis docstring is split.', + marker2: '```python\n(function) def func2() -> None\n```', + marker3: '```python\n(function) def func3() -> None\n```', }); diff --git a/packages/pyright-internal/src/tests/fourslash/hover.dunderNew.basic.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/hover.dunderNew.basic.fourslash.ts new file mode 100644 index 000000000..38f1d14e9 --- /dev/null +++ b/packages/pyright-internal/src/tests/fourslash/hover.dunderNew.basic.fourslash.ts @@ -0,0 +1,13 @@ +/// + +// @filename: test.py +//// class Foo: +//// def __new__(cls, name:str): +//// '''doc for __new__.''' +//// return super().__new__(cls) +//// +//// x = [|/*marker1*/Foo|]() + +helper.verifyHover('markdown', { + marker1: '```python\nclass Foo(name: str)\n```\n---\ndoc for \\_\\_new\\_\\_.', +}); diff --git a/packages/pyright-internal/src/tests/fourslash/hover.dunderNew.inheritance.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/hover.dunderNew.inheritance.fourslash.ts new file mode 100644 index 000000000..402b927ac --- /dev/null +++ b/packages/pyright-internal/src/tests/fourslash/hover.dunderNew.inheritance.fourslash.ts @@ -0,0 +1,16 @@ +/// + +// @filename: test.py +//// class Parent: +//// def __init__(self, *args: Any, **kwargs: Any): +//// pass +//// +//// class Child(Parent): +//// def __new__(cls, name: str): +//// return super().__new__(cls) + +//// x = [|/*marker1*/Child|]() + +helper.verifyHover('markdown', { + marker1: '```python\nclass Child(name: str)\n```', +}); diff --git a/packages/pyright-internal/src/tests/fourslash/hover.dunderNew.inheritance2.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/hover.dunderNew.inheritance2.fourslash.ts new file mode 100644 index 000000000..2df0e3025 --- /dev/null +++ b/packages/pyright-internal/src/tests/fourslash/hover.dunderNew.inheritance2.fourslash.ts @@ -0,0 +1,22 @@ +/// + +// @filename: test.py +//// class Parent: +//// def __init__(self, *args: Any, **kwargs: Any): +//// pass +//// +//// def __new__(cls, *args: Any, **kwargs: Any): +//// return super().__new__(cls) +//// +//// class Child(Parent): +//// def __new__(cls, name:str): +//// return super().__new__(cls, name) +//// +//// class GrandChild(Child): +//// pass + +//// x = [|/*marker1*/GrandChild|]() + +helper.verifyHover('markdown', { + marker1: '```python\nclass GrandChild(name: str)\n```', +}); diff --git a/packages/pyright-internal/src/tests/fourslash/hover.dunderNew.overloads.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/hover.dunderNew.overloads.fourslash.ts new file mode 100644 index 000000000..76e6b2161 --- /dev/null +++ b/packages/pyright-internal/src/tests/fourslash/hover.dunderNew.overloads.fourslash.ts @@ -0,0 +1,17 @@ +/// + +// @filename: test.py +//// from typing import overload +//// class Foo: +//// @overload +//// def __new__(cls, name:str, last:str) -> "Foo": +//// return super().__new__(cls) +//// @overload +//// def __new__(cls, age:int, height:float) -> "Foo": +//// return super().__new__(cls) +//// +//// x = [|/*marker1*/Foo|]() + +helper.verifyHover('markdown', { + marker1: '```python\nclass Foo(name: str, last: str): ...\n\nclass Foo(age: int, height: float): ...\n\n\n```', +}); diff --git a/packages/pyright-internal/src/tests/fourslash/hover.dunderNew.withInit.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/hover.dunderNew.withInit.fourslash.ts new file mode 100644 index 000000000..57b5841c2 --- /dev/null +++ b/packages/pyright-internal/src/tests/fourslash/hover.dunderNew.withInit.fourslash.ts @@ -0,0 +1,15 @@ +/// + +// @filename: test.py +//// class Foo: +//// def __init__(self, *args: Any, **kwargs: Any): +//// pass +//// def __new__(cls, name:str): +//// '''doc for __new__.''' +//// return super().__new__(cls) +//// +//// x = [|/*marker1*/Foo|]() + +helper.verifyHover('markdown', { + marker1: '```python\nclass Foo(name: str)\n```\n---\ndoc for \\_\\_new\\_\\_.', +}); diff --git a/packages/pyright-internal/src/tests/fourslash/hover.formatted.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/hover.formatted.fourslash.ts new file mode 100644 index 000000000..adaa72442 --- /dev/null +++ b/packages/pyright-internal/src/tests/fourslash/hover.formatted.fourslash.ts @@ -0,0 +1,46 @@ +/// + +// @filename: pyrightconfig.json +//// { +//// "functionSignatureDisplay": "formatted" +//// } + +// @filename: test.py +//// from typing import overload +//// class A: +//// def __init__(self, x:int, y:int): +//// pass +//// +//// class B: +//// @overload +//// def __init__(self): +//// pass +//// @overload +//// def __init__(self, x:int, y:int): +//// pass +//// +//// a = [|/*a_constructor*/A|](1,2) +//// +//// b = [|/*b_constructorOverloads*/B|](1,2) +//// def [|/*paramFunc0*/foo|](): +//// pass +//// def [|/*paramFunc1*/foo1|](x:int): +//// pass +//// def [|/*paramFunc2*/foo2|](x:int, y:int): +//// pass +//// +//// @overload +//// def bar() -> int: ... +//// @overload +//// def bar(x:str, y:int) -> int: ... +//// +//// [|/*overload*/bar|] + +helper.verifyHover('markdown', { + a_constructor: '```python\nclass A(\n x: int,\n y: int\n)\n```', + b_constructorOverloads: '```python\nclass B(\n x: int,\n y: int\n)\n```', + paramFunc0: '```python\n(function) def foo() -> None\n```', + paramFunc1: '```python\n(function) def foo1(x: int) -> None\n```', + paramFunc2: '```python\n(function) def foo2(\n x: int,\n y: int\n) -> None\n```', + overload: '```python\n(function)\ndef bar() -> int: ...\ndef bar(\n x: str,\n y: int\n) -> int: ...\n```', +}); diff --git a/packages/pyright-internal/src/tests/fourslash/hover.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/hover.fourslash.ts index 6a95964b2..00b58dca8 100644 --- a/packages/pyright-internal/src/tests/fourslash/hover.fourslash.ts +++ b/packages/pyright-internal/src/tests/fourslash/hover.fourslash.ts @@ -16,5 +16,5 @@ helper.verifyHover('markdown', { marker1: '```python\n(class) Validator\n```\n---\nThe validator class', - marker2: '```python\n(method) is_valid: (text: str) -> bool\n```\n---\nChecks if the input string is valid.', + marker2: '```python\n(method) def is_valid(text: str) -> bool\n```\n---\nChecks if the input string is valid.', }); diff --git a/packages/pyright-internal/src/tests/fourslash/hover.inferred.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/hover.inferred.fourslash.ts new file mode 100644 index 000000000..b127d3946 --- /dev/null +++ b/packages/pyright-internal/src/tests/fourslash/hover.inferred.fourslash.ts @@ -0,0 +1,23 @@ +/// + +// @filename: test.py +//// import third_party_module # type: ignore +//// +//// def return_one(): +//// one = third_party_module.one() +//// if one is None: +//// return +//// return one +//// +//// def return_two() -> int: +//// [|on/*marker1*/e|]: int | None = return_one() +//// assert one is not None +//// two = [|on/*marker2*/e|] + 1 +//// return two +//// +//// [|tw/*marker3*/o|] = return_two() +helper.verifyHover('markdown', { + marker1: '```python\n(variable) one: Unknown | None\n```', + marker2: '```python\n(variable) one: Unknown\n```', + marker3: '```python\n(variable) two: int\n```', +}); diff --git a/packages/pyright-internal/src/tests/fourslash/hover.inherited.docFromSrc.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/hover.inherited.docFromSrc.fourslash.ts index bbde1d0ee..92f40c7d6 100644 --- a/packages/pyright-internal/src/tests/fourslash/hover.inherited.docFromSrc.fourslash.ts +++ b/packages/pyright-internal/src/tests/fourslash/hover.inherited.docFromSrc.fourslash.ts @@ -54,10 +54,10 @@ //// d2.[|/*secondDerived_method_docs*/method|]() helper.verifyHover('markdown', { - child_a_method1_docs: '```python\n(method) method1: () -> bool\n```\n---\nA.method1 docs', - child_a_docs: '```python\n(class) ChildA()\n```', - child_b_docs: '```python\n(class) ChildB()\n```\n---\nB init docs', - child_b_init_docs: '```python\n(method) __init__: () -> None\n```\n---\nB init docs', - secondDerived_docs: '```python\n(class) Derived2()\n```', - secondDerived_method_docs: '```python\n(method) method: () -> None\n```\n---\nBase.method docs', + child_a_method1_docs: '```python\n(method) def method1() -> bool\n```\n---\nA.method1 docs', + child_a_docs: '```python\nclass ChildA()\n```', + child_b_docs: '```python\nclass ChildB()\n```\n---\nB init docs', + child_b_init_docs: '```python\n(method) def __init__() -> None\n```\n---\nB init docs', + secondDerived_docs: '```python\nclass Derived2()\n```', + secondDerived_method_docs: '```python\n(method) def method() -> None\n```\n---\nBase.method docs', }); diff --git a/packages/pyright-internal/src/tests/fourslash/hover.inherited.docFromSrcWithStub.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/hover.inherited.docFromSrcWithStub.fourslash.ts index 6a1a22032..c4db99559 100644 --- a/packages/pyright-internal/src/tests/fourslash/hover.inherited.docFromSrcWithStub.fourslash.ts +++ b/packages/pyright-internal/src/tests/fourslash/hover.inherited.docFromSrcWithStub.fourslash.ts @@ -46,9 +46,9 @@ //// childB =[|/*child_b_docs*/ChildB|]() helper.verifyHover('markdown', { - child_a_method1_docs: '```python\n(method) method1: () -> bool\n```\n---\nA.method1 docs', - child_a_docs: '```python\n(class) ChildA()\n```', - child_a_inner_docs: '```python\n(class) ChildInner()\n```', - child_a_inner_method1_docs: '```python\n(method) method1: () -> bool\n```\n---\nA.Inner.method1 docs', - child_b_docs: '```python\n(class) ChildB()\n```', + child_a_method1_docs: '```python\n(method) def method1() -> bool\n```\n---\nA.method1 docs', + child_a_docs: '```python\nclass ChildA()\n```', + child_a_inner_docs: '```python\nclass ChildInner()\n```', + child_a_inner_method1_docs: '```python\n(method) def method1() -> bool\n```\n---\nA.Inner.method1 docs', + child_b_docs: '```python\nclass ChildB()\n```', }); diff --git a/packages/pyright-internal/src/tests/fourslash/hover.inherited.docFromStub.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/hover.inherited.docFromStub.fourslash.ts index 8049ca9a1..b737853d5 100644 --- a/packages/pyright-internal/src/tests/fourslash/hover.inherited.docFromStub.fourslash.ts +++ b/packages/pyright-internal/src/tests/fourslash/hover.inherited.docFromStub.fourslash.ts @@ -35,8 +35,8 @@ //// inner.[|/*child_a_inner_method1_docs*/method1|]() helper.verifyHover('markdown', { - child_a_method1_docs: '```python\n(method) method1: () -> bool\n```\n---\nA.method1 docs', - child_a_docs: '```python\n(class) ChildA()\n```', - child_a_inner_docs: '```python\n(class) ChildInner()\n```', - child_a_inner_method1_docs: '```python\n(method) method1: () -> bool\n```\n---\nA.Inner.method1 docs', + child_a_method1_docs: '```python\n(method) def method1() -> bool\n```\n---\nA.method1 docs', + child_a_docs: '```python\nclass ChildA()\n```', + child_a_inner_docs: '```python\nclass ChildInner()\n```', + child_a_inner_method1_docs: '```python\n(method) def method1() -> bool\n```\n---\nA.Inner.method1 docs', }); diff --git a/packages/pyright-internal/src/tests/fourslash/hover.inherited.overload.docFromSrcWithStub.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/hover.inherited.overload.docFromSrcWithStub.fourslash.ts index 46ed31efd..4cb1b6cb8 100644 --- a/packages/pyright-internal/src/tests/fourslash/hover.inherited.overload.docFromSrcWithStub.fourslash.ts +++ b/packages/pyright-internal/src/tests/fourslash/hover.inherited.overload.docFromSrcWithStub.fourslash.ts @@ -41,6 +41,7 @@ helper.verifyHover('markdown', { child_a_func_doc: - '```python\n(method)\nfunc(self: ChildA, x: str) -> str\nfunc(self: ChildA, x: int) -> int\n```\n---\nfunc docs', - child_a_instance_func_doc: '```python\n(method)\nfunc(x: str) -> str\nfunc(x: int) -> int\n```\n---\nfunc docs', + '```python\n(method)\ndef func(self: ChildA, x: str) -> str: ...\ndef func(self: ChildA, x: int) -> int: ...\n```\n---\nfunc docs', + child_a_instance_func_doc: + '```python\n(method)\ndef func(x: str) -> str: ...\ndef func(x: int) -> int: ...\n```\n---\nfunc docs', }); diff --git a/packages/pyright-internal/src/tests/fourslash/hover.inherited.overload.docFromStub.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/hover.inherited.overload.docFromStub.fourslash.ts index 2d96666fc..3ca695c8b 100644 --- a/packages/pyright-internal/src/tests/fourslash/hover.inherited.overload.docFromStub.fourslash.ts +++ b/packages/pyright-internal/src/tests/fourslash/hover.inherited.overload.docFromStub.fourslash.ts @@ -42,6 +42,7 @@ helper.verifyHover('markdown', { child_a_func_doc: - '```python\n(method)\nfunc(self: ChildA, x: str) -> str\nfunc(self: ChildA, x: int) -> int\n```\n---\nfunc docs', - child_a_instance_func_doc: '```python\n(method)\nfunc(x: str) -> str\nfunc(x: int) -> int\n```\n---\nfunc docs', + '```python\n(method)\ndef func(self: ChildA, x: str) -> str: ...\ndef func(self: ChildA, x: int) -> int: ...\n```\n---\nfunc docs', + child_a_instance_func_doc: + '```python\n(method)\ndef func(x: str) -> str: ...\ndef func(x: int) -> int: ...\n```\n---\nfunc docs', }); diff --git a/packages/pyright-internal/src/tests/fourslash/hover.init.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/hover.init.fourslash.ts index dc0c52904..d871d9ae8 100644 --- a/packages/pyright-internal/src/tests/fourslash/hover.init.fourslash.ts +++ b/packages/pyright-internal/src/tests/fourslash/hover.init.fourslash.ts @@ -31,9 +31,9 @@ //// c = test.[|/*marker5*/C1|]() helper.verifyHover('markdown', { - marker1: '```python\n(class) C1(name: str = "hello")\n```\n---\n\\_\\_init\\_\\_ docs', + marker1: '```python\nclass C1(name: str = "hello")\n```\n---\n\\_\\_init\\_\\_ docs', marker2: '```python\n(type alias) unionType: Type[C1] | Type[C2]\n```', - marker3: '```python\n(class) G(value: int)\n```', - marker4: '```python\n(class) G\n```', - marker5: '```python\n(class) C1(name: str = "hello")\n```\n---\n\\_\\_init\\_\\_ docs', + marker3: '```python\nclass G(value: int)\n```', + marker4: '```python\nclass G(value: int)\n```', + marker5: '```python\nclass C1(name: str = "hello")\n```\n---\n\\_\\_init\\_\\_ docs', }); diff --git a/packages/pyright-internal/src/tests/fourslash/hover.libCodeAndStub.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/hover.libCodeAndStub.fourslash.ts index 1ef478da1..5b29b4ea0 100644 --- a/packages/pyright-internal/src/tests/fourslash/hover.libCodeAndStub.fourslash.ts +++ b/packages/pyright-internal/src/tests/fourslash/hover.libCodeAndStub.fourslash.ts @@ -44,8 +44,8 @@ //// obj.[|/*marker5*/read_write_prop|] = r helper.verifyHover('markdown', { - marker1: '```python\n(class) Validator()\n```\n---\nThe validator class', - marker2: '```python\n(method) is_valid: (text: str) -> bool\n```\n---\nChecks if the input string is valid.', + marker1: '```python\nclass Validator()\n```\n---\nThe validator class', + marker2: '```python\n(method) def is_valid(text: str) -> bool\n```\n---\nChecks if the input string is valid.', marker3: '```python\n(property) read_only_prop: bool\n```\n---\nThe read-only property.', marker4: '```python\n(property) read_write_prop: bool\n```\n---\nThe read-write property.', marker5: '```python\n(property) read_write_prop: bool\n```\n---\nThe read-write property.', diff --git a/packages/pyright-internal/src/tests/fourslash/hover.libCodeNoStub.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/hover.libCodeNoStub.fourslash.ts index 5261a4f7c..137508fb2 100644 --- a/packages/pyright-internal/src/tests/fourslash/hover.libCodeNoStub.fourslash.ts +++ b/packages/pyright-internal/src/tests/fourslash/hover.libCodeNoStub.fourslash.ts @@ -33,8 +33,8 @@ //// obj.[|/*marker5*/read_write_prop|] = r helper.verifyHover('markdown', { - marker1: '```python\n(class) Validator()\n```\n---\nThe validator class', - marker2: '```python\n(method) is_valid: (text: str) -> bool\n```\n---\nChecks if the input string is valid.', + marker1: '```python\nclass Validator()\n```\n---\nThe validator class', + marker2: '```python\n(method) def is_valid(text: str) -> bool\n```\n---\nChecks if the input string is valid.', marker3: '```python\n(property) read_only_prop: bool\n```\n---\nThe read-only property.', marker4: '```python\n(property) read_write_prop: bool\n```\n---\nThe read-write property.', marker5: '```python\n(property) read_write_prop: bool\n```\n---\nThe read-write property.', diff --git a/packages/pyright-internal/src/tests/fourslash/hover.libStub.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/hover.libStub.fourslash.ts index 0b006bcdc..b0e71607e 100644 --- a/packages/pyright-internal/src/tests/fourslash/hover.libStub.fourslash.ts +++ b/packages/pyright-internal/src/tests/fourslash/hover.libStub.fourslash.ts @@ -33,8 +33,8 @@ //// obj.[|/*marker5*/read_write_prop|] = r helper.verifyHover('markdown', { - marker1: '```python\n(class) Validator()\n```\n---\nThe validator class', - marker2: '```python\n(method) is_valid: (text: str) -> bool\n```\n---\nChecks if the input string is valid.', + marker1: '```python\nclass Validator()\n```\n---\nThe validator class', + marker2: '```python\n(method) def is_valid(text: str) -> bool\n```\n---\nChecks if the input string is valid.', marker3: '```python\n(property) read_only_prop: bool\n```\n---\nThe read-only property.', marker4: '```python\n(property) read_write_prop: bool\n```\n---\nThe read-write property.', marker5: '```python\n(property) read_write_prop: bool\n```\n---\nThe read-write property.', diff --git a/packages/pyright-internal/src/tests/fourslash/hover.overloadedFunction.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/hover.overloadedFunction.fourslash.ts new file mode 100644 index 000000000..64b625d0c --- /dev/null +++ b/packages/pyright-internal/src/tests/fourslash/hover.overloadedFunction.fourslash.ts @@ -0,0 +1,23 @@ +/// + +// @filename: test.py +//// from typing import overload +//// +//// @overload +//// def func(a: int) -> int: +//// ... +//// +//// @overload +//// def func(a: str) -> str: +//// ... +//// +//// def func(a: int | str) -> int | str: +//// return a +//// +//// [|/*marker1*/func|](1) +//// [|/*marker2*/func|]("hi") + +helper.verifyHover('markdown', { + marker1: '```python\n(function) def func(a: int) -> int\n```', + marker2: '```python\n(function) def func(a: str) -> str\n```', +}); diff --git a/packages/pyright-internal/src/tests/fourslash/hover.plainText.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/hover.plainText.fourslash.ts index 9a846bbd7..2db42d1ab 100644 --- a/packages/pyright-internal/src/tests/fourslash/hover.plainText.fourslash.ts +++ b/packages/pyright-internal/src/tests/fourslash/hover.plainText.fourslash.ts @@ -17,5 +17,5 @@ helper.verifyHover('plaintext', { marker1: '(class) Validator\n\nThe validator class\n\n.. versionadded:: 2.0\n This directive shows in plaintext.', - marker2: '(method) is_valid: (text: str) -> bool\n\nChecks if the input string is valid.', + marker2: '(method) def is_valid(text: str) -> bool\n\nChecks if the input string is valid.', }); diff --git a/packages/pyright-internal/src/tests/fourslash/hover.slots.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/hover.slots.fourslash.ts new file mode 100644 index 000000000..5cf9e5d99 --- /dev/null +++ b/packages/pyright-internal/src/tests/fourslash/hover.slots.fourslash.ts @@ -0,0 +1,15 @@ +/// + +// @filename: test.py +//// class Chat: +//// __slots__ = ("id",) +//// +//// def __init__(self): +//// self.id = 1234 +//// """The ID of the channel.""" +//// +//// y = Chat() +//// y.[|/*marker*/id|] +helper.verifyHover('markdown', { + marker: '```python\n(variable) id: int\n```\n---\nThe ID of the channel.', +}); diff --git a/packages/pyright-internal/src/tests/fourslash/hover.variable.docString.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/hover.variable.docString.fourslash.ts index 928ee2b10..3e18d8ce8 100644 --- a/packages/pyright-internal/src/tests/fourslash/hover.variable.docString.fourslash.ts +++ b/packages/pyright-internal/src/tests/fourslash/hover.variable.docString.fourslash.ts @@ -36,6 +36,9 @@ //// [|/*marker5*/SomeType|] = List[Union[int, str]] //// """Here's some documentation about SomeType""" +// @filename: testBigInt.py +//// [|/*marker6*/x|] = 123670029844611072 + helper.verifyHover('markdown', { marker1: '```python\n(variable) x: int\n```\n---\ntest x', marker2: '```python\n(variable) func: (float) -> float\n```\n---\nA given function', @@ -43,4 +46,5 @@ helper.verifyHover('markdown', { marker4: '```python\n(variable) z: int\n```\n---\ntest z', marker5: "```python\n(type alias) SomeType: Type[List[int | str]]\n```\n---\nHere's some documentation about SomeType", + marker6: '```python\n(variable) x: Literal[123670029844611072]\n```', }); diff --git a/packages/pyright-internal/src/tests/fourslash/hover.wildcardimports.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/hover.wildcardimports.fourslash.ts index 5cfa3f01d..aed7ab929 100644 --- a/packages/pyright-internal/src/tests/fourslash/hover.wildcardimports.fourslash.ts +++ b/packages/pyright-internal/src/tests/fourslash/hover.wildcardimports.fourslash.ts @@ -73,7 +73,7 @@ helper.verifyHover('markdown', { marker1: '```python\n(variable) func: Any\n```\n---\nfunc docs', marker2: '```python\n(variable) MyType: Any\n```\n---\nMyType docs', - marker3: '```python\n(method) func2: () -> None\n```\n---\nfunc2 docs', + marker3: '```python\n(method) def func2() -> None\n```\n---\nfunc2 docs', marker4: '```python\n(variable) func3: Any\n```\n---\nfunc3 docs', marker5: '```python\n(variable) func4: Any\n```\n---\nfunc4 docs', marker6: '```python\n(variable) func5: Any\n```\n---\nfunc5 docs', diff --git a/packages/pyright-internal/src/tests/fourslash/import.multipart.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/import.multipart.fourslash.ts index d5d3364b7..ab9455ee8 100644 --- a/packages/pyright-internal/src/tests/fourslash/import.multipart.fourslash.ts +++ b/packages/pyright-internal/src/tests/fourslash/import.multipart.fourslash.ts @@ -17,5 +17,5 @@ // @ts-ignore helper.verifyHover('markdown', { - marker: '```python\n(class) Foo()\n```', + marker: '```python\nclass Foo()\n```', }); diff --git a/packages/pyright-internal/src/tests/fourslash/import.pytyped.typeCheckingBasic.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/import.pytyped.typeCheckingBasic.fourslash.ts index fd7d5febc..7e76c3125 100644 --- a/packages/pyright-internal/src/tests/fourslash/import.pytyped.typeCheckingBasic.fourslash.ts +++ b/packages/pyright-internal/src/tests/fourslash/import.pytyped.typeCheckingBasic.fourslash.ts @@ -31,7 +31,7 @@ await helper.verifyCompletion('included', 'markdown', { { label: 'method1', kind: Consts.CompletionItemKind.Method, - documentation: '```python\nmethod1: () -> None\n```\n---\nMethod docs', + documentation: '```python\ndef method1() -> None\n```\n---\nMethod docs', }, ], }, diff --git a/packages/pyright-internal/src/tests/fourslash/import.pytyped.typeCheckingOff.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/import.pytyped.typeCheckingOff.fourslash.ts index 40c7e910d..ec1b95ffb 100644 --- a/packages/pyright-internal/src/tests/fourslash/import.pytyped.typeCheckingOff.fourslash.ts +++ b/packages/pyright-internal/src/tests/fourslash/import.pytyped.typeCheckingOff.fourslash.ts @@ -31,7 +31,7 @@ await helper.verifyCompletion('included', 'markdown', { { label: 'method1', kind: Consts.CompletionItemKind.Method, - documentation: '```python\nmethod1: () -> None\n```\n---\nMethod docs', + documentation: '```python\ndef method1() -> None\n```\n---\nMethod docs', }, ], }, diff --git a/packages/pyright-internal/src/tests/fourslash/missingTypeStub.command.trycatchImport.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/missingTypeStub.command.trycatchImport.fourslash.ts new file mode 100644 index 000000000..6d6f9c3a1 --- /dev/null +++ b/packages/pyright-internal/src/tests/fourslash/missingTypeStub.command.trycatchImport.fourslash.ts @@ -0,0 +1,49 @@ +/// + +// @filename: pyrightconfig.json +//// { +//// "reportMissingTypeStubs": "warning" +//// } + +// @filename: testLib/mylibrary.py +// @library: true +//// # This is a library file +//// class MyLibrary: +//// def DoEveryThing(self, code: str): +//// ... +//// class ExceptLibrary: +//// def DoEveryThing(self, code: str): +//// ... +//// class ElseLibrary: +//// def DoEveryThing(self, code: str): +//// ... + +// @filename: testLib/__init__.py +// @library: true +//// try: +//// from .mylibrary import MyLibrary +//// except: +//// from .mylibrary import ExceptLibrary +//// else: +//// from .mylibrary import ElseLibrary + +// @filename: test.py +//// import [|/*marker*/testLi|]b + +const filename4 = helper.getMarkerByName('marker').fileName; +const command4 = { + title: 'Create Type Stub', + command: Consts.Commands.createTypeStub, + arguments: ['/', 'testLib', filename4], +}; + +// @ts-ignore +await helper.verifyCommand(command4, { + ['/typings/testLib/__init__.pyi']: `""" +This type stub file was generated by pyright. +""" + +from .mylibrary import MyLibrary + +`, +}); diff --git a/packages/pyright-internal/src/tests/fourslash/rename.init.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/rename.init.fourslash.ts new file mode 100644 index 000000000..bc848f939 --- /dev/null +++ b/packages/pyright-internal/src/tests/fourslash/rename.init.fourslash.ts @@ -0,0 +1,25 @@ +/// +// Verify rename doesn't use the same logic as find all references (which would find the constructor calls) + +// @filename: test.py +//// class Test1: +//// def [|/*marker*/__init__|](self): +//// pass + +// @filename: test2.py +//// from test import Test1 +//// +//// b = Test1() + +{ + const ranges = helper.getRanges().filter((r) => r.marker); + + helper.verifyRename({ + marker: { + newName: 'foo', + changes: ranges.map((r) => { + return { filePath: r.fileName, range: helper.convertPositionRange(r), replacementText: 'foo' }; + }), + }, + }); +} diff --git a/packages/pyright-internal/src/tests/fourslash/shadowedImports.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/shadowedImports.fourslash.ts new file mode 100644 index 000000000..dc6394869 --- /dev/null +++ b/packages/pyright-internal/src/tests/fourslash/shadowedImports.fourslash.ts @@ -0,0 +1,96 @@ +/// + +// @filename: pyrightconfig.json +//// { +//// "reportShadowedImports": "warning" +//// } + +// @filename: random.py +// @library: true +//// def random(): +//// pass + +// @filename: curses/__init__.py +// @library: true +//// # Should make this more official + +// @filename: curses/ascii.py +// @library: true +//// def stuff(): +//// pass + +// @filename: ctypes/util.py +// @library: true +//// def stuff(): +//// pass + +// @filename: random.py +//// [|/*marker7*/def stuff(): +//// pass|] + +// @filename: __main__.py +//// [|/*marker10*/def something(): +//// pass|] + +// @filename: curses/ascii.py +//// [|/*marker8*/# This shouldn't cause a problem when referenced below because the below reference +//// # will look at the lib curses/ascii.py instead|] + +// @filename: ctypes/util.py +//// [|/*marker1*/def foo(): +//// ...|] + +// @filename: ctypes/__init__.py +//// # This should be flagged as a module + +// @filename: test.py +//// import [|/*marker2*/ctypes.util|] +//// [|from /*marker3*/ctypes.util import find_library|] +//// import [|/*marker4*/ctypes.util as bar|] +//// import [|/*marker5*/random|] +//// import [|/*marker6*/curses.ascii as ascii|] +//// from [|/*marker9*/.random import stuff|] # Relative should be okay +//// +// @ts-ignore +await helper.verifyDiagnostics({ + marker1: { + category: 'warning', + message: `"${helper.getPathSep()}ctypes${helper.getPathSep()}util.py" is overriding the stdlib module "ctypes.util"`, + }, + marker2: { + category: 'warning', + message: `"${helper.getPathSep()}ctypes${helper.getPathSep()}util.py" is overriding the stdlib module "ctypes.util"`, + }, + marker3: { + category: 'warning', + message: `"${helper.getPathSep()}ctypes${helper.getPathSep()}util.py" is overriding the stdlib module "ctypes.util"`, + }, + marker4: { + category: 'warning', + message: `"${helper.getPathSep()}ctypes${helper.getPathSep()}util.py" is overriding the stdlib module "ctypes.util"`, + }, + marker5: { + category: 'warning', + message: `"${helper.getPathSep()}random.py" is overriding the stdlib module "random"`, + }, + marker6: { + category: 'none', + message: undefined, + }, + marker7: { + category: 'warning', + message: `"${helper.getPathSep()}random.py" is overriding the stdlib module "random"`, + }, + marker8: { + category: 'warning', + message: `"${helper.getPathSep()}curses${helper.getPathSep()}ascii.py" is overriding the stdlib module "curses.ascii"`, + }, + marker9: { + category: 'none', + message: undefined, + }, + marker10: { + category: 'none', + message: undefined, + }, +}); diff --git a/packages/pyright-internal/src/tests/fourslash/showcallhierarchy.incomingCalls.aliasedFunction.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/showcallhierarchy.incomingCalls.aliasedFunction.fourslash.ts new file mode 100644 index 000000000..bf6f67a7b --- /dev/null +++ b/packages/pyright-internal/src/tests/fourslash/showcallhierarchy.incomingCalls.aliasedFunction.fourslash.ts @@ -0,0 +1,37 @@ +/// + +// @filename: declare.py +//// def func(): +//// return 1 + +// @filename: consume.py +//// from declare import func +//// from declare import func as /*marker1*/foobar +//// +//// def callByName(): +//// func() +//// def [|callByAlias|](): +//// /*marker2*/foobar() + +// @filename: consume2.py +//// from declare import func as foobar +//// +//// def callByAlias2(): +//// func() + +{ + const ranges = helper.getRanges(); + + helper.verifyShowCallHierarchyGetIncomingCalls({ + marker1: { + references: ranges.map((r) => { + return { path: r.fileName, range: helper.convertPositionRange(r) }; + }), + }, + marker2: { + references: ranges.map((r) => { + return { path: r.fileName, range: helper.convertPositionRange(r) }; + }), + }, + }); +} diff --git a/packages/pyright-internal/src/tests/fourslash/showcallhierarchy.incomingCalls.aliasedVariable.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/showcallhierarchy.incomingCalls.aliasedVariable.fourslash.ts new file mode 100644 index 000000000..a9229f765 --- /dev/null +++ b/packages/pyright-internal/src/tests/fourslash/showcallhierarchy.incomingCalls.aliasedVariable.fourslash.ts @@ -0,0 +1,21 @@ +/// + +// @filename: declare.py +//// my_variable = "Hello, world!" + +// @filename: consume.py +//// from my_module import my_variable as /*marker*/greeting +//// +//// print(greeting) + +{ + const ranges = helper.getRanges(); + + helper.verifyShowCallHierarchyGetIncomingCalls({ + marker: { + references: ranges.map((r) => { + return { path: r.fileName, range: helper.convertPositionRange(r) }; + }), + }, + }); +} diff --git a/packages/pyright-internal/src/tests/fourslash/showcallhierarchy.incomingCalls.function.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/showcallhierarchy.incomingCalls.function.fourslash.ts new file mode 100644 index 000000000..b8dfbf599 --- /dev/null +++ b/packages/pyright-internal/src/tests/fourslash/showcallhierarchy.incomingCalls.function.fourslash.ts @@ -0,0 +1,42 @@ +/// + +// @filename: declare.py +//// def /*marker1*/func(): +//// return 1 + +// @filename: consume.py +//// from declare import func +//// from declare import /*marker2*/func as foobar +//// +//// def [|callByName|](): +//// /*marker3*/func() +//// def callByAlias(): +//// foobar() + +// @filename: consume2.py +//// from declare import func +//// +//// def [|callByName2|](): +//// func() + +{ + const ranges = helper.getRanges(); + + helper.verifyShowCallHierarchyGetIncomingCalls({ + marker1: { + references: ranges.map((r) => { + return { path: r.fileName, range: helper.convertPositionRange(r) }; + }), + }, + marker2: { + references: ranges.map((r) => { + return { path: r.fileName, range: helper.convertPositionRange(r) }; + }), + }, + marker3: { + references: ranges.map((r) => { + return { path: r.fileName, range: helper.convertPositionRange(r) }; + }), + }, + }); +} diff --git a/packages/pyright-internal/src/tests/fourslash/signature.complicated.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/signature.complicated.fourslash.ts index 6649c3f9b..08e2f0814 100644 --- a/packages/pyright-internal/src/tests/fourslash/signature.complicated.fourslash.ts +++ b/packages/pyright-internal/src/tests/fourslash/signature.complicated.fourslash.ts @@ -1,7 +1,11 @@ /// // @filename: complicated.py -//// from typing import Any, Optional, Type, Union +//// from typing import Any, Optional, Type, Union, TypedDict, Unpack +//// +//// class Movie(TypedDict): +//// key1: str +//// key2: int //// //// class A: //// def __init__(self, x: bool): ... @@ -10,6 +14,8 @@ //// //// def complicated(self, a: int, b: int, c: int = 1234, d: Optional[str] = None, **kwargs: Any) -> Union[int, str]: ... //// +//// def typeddict(self, a: int, b: int, **kwargs: Unpack[Movie]) -> None: ... +//// //// x = A(True[|/*init1*/|]) //// //// x.complicated([|/*c1*/|]) @@ -20,6 +26,8 @@ //// //// x.complicated(1[|/*cA*/|],[|/*cB*/|] 2, 3, x=[|/*cX*/|]123, d="wo[|/*cD*/|]w", z[|/*cZ*/|]=1234) //// +//// x.typeddict(1[|/*tdA*/|], [|/*tdB*/|]2, key1=[|/*tdkey1*/|]'r', key2=[|/*tdkey2*/|]4) +//// //// x([|/*call*/|]) //// //// def get_cls() -> Type[A]: @@ -44,6 +52,13 @@ }, ]; + const xTypedDictSignatures = [ + { + label: '(a: int, b: int, key1: str, key2: int) -> None', + parameters: ['a: int', 'b: int', 'key1: str', 'key2: int'], + }, + ]; + const xCallSignatures = [ { label: '(z: float) -> complex', @@ -96,5 +111,21 @@ signatures: xCallSignatures, activeParameters: [0], }, + tdA: { + signatures: xTypedDictSignatures, + activeParameters: [0], + }, + tdB: { + signatures: xTypedDictSignatures, + activeParameters: [1], + }, + tdkey1: { + signatures: xTypedDictSignatures, + activeParameters: [2], + }, + tdkey2: { + signatures: xTypedDictSignatures, + activeParameters: [3], + }, }); } diff --git a/packages/pyright-internal/src/tests/fourslash/signature.dunderNew.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/signature.dunderNew.fourslash.ts new file mode 100644 index 000000000..22d323691 --- /dev/null +++ b/packages/pyright-internal/src/tests/fourslash/signature.dunderNew.fourslash.ts @@ -0,0 +1,26 @@ +/// + +// @filename: dunerNew.py +//// +//// class Foo: +//// def __new__(cls, x:int, y:int): +//// return super().__new__(cls) + +//// +//// Foo([|/*s1*/|] + +{ + const simpleSignatures = [ + { + label: '(x: int, y: int) -> Foo', + parameters: ['x: int', 'y: int'], + }, + ]; + + helper.verifySignature('plaintext', { + s1: { + signatures: simpleSignatures, + activeParameters: [0], + }, + }); +} diff --git a/packages/pyright-internal/src/tests/harness/fourslash/runner.ts b/packages/pyright-internal/src/tests/harness/fourslash/runner.ts index a99b81e42..0e52fd312 100644 --- a/packages/pyright-internal/src/tests/harness/fourslash/runner.ts +++ b/packages/pyright-internal/src/tests/harness/fourslash/runner.ts @@ -95,5 +95,6 @@ ${code} if (cb) { cb(...args); } + state.dispose(); } } diff --git a/packages/pyright-internal/src/tests/harness/fourslash/testLanguageService.ts b/packages/pyright-internal/src/tests/harness/fourslash/testLanguageService.ts index e82101214..17df885a6 100644 --- a/packages/pyright-internal/src/tests/harness/fourslash/testLanguageService.ts +++ b/packages/pyright-internal/src/tests/harness/fourslash/testLanguageService.ts @@ -9,36 +9,60 @@ import * as path from 'path'; import { CancellationToken, CodeAction, ExecuteCommandParams } from 'vscode-languageserver'; -import { ImportResolverFactory } from '../../../analyzer/importResolver'; +import { + BackgroundAnalysisProgram, + BackgroundAnalysisProgramFactory, +} from '../../../analyzer/backgroundAnalysisProgram'; +import { CacheManager } from '../../../analyzer/cacheManager'; +import { ImportResolver, ImportResolverFactory } from '../../../analyzer/importResolver'; +import { MaxAnalysisTime } from '../../../analyzer/program'; import { AnalyzerService } from '../../../analyzer/service'; import { BackgroundAnalysisBase } from '../../../backgroundAnalysisBase'; import { CommandController } from '../../../commands/commandController'; import { ConfigOptions } from '../../../common/configOptions'; import { ConsoleInterface } from '../../../common/console'; import * as debug from '../../../common/debug'; -import { createDeferred } from '../../../common/deferred'; import { FileSystem } from '../../../common/fileSystem'; import { Range } from '../../../common/textRange'; import { UriParser } from '../../../common/uriParser'; +import { LanguageServerInterface, MessageAction, ServerSettings, WindowInterface } from '../../../languageServerBase'; +import { CodeActionProvider } from '../../../languageService/codeActionProvider'; import { - LanguageServerInterface, - MessageAction, - ServerSettings, + createInitStatus, WellKnownWorkspaceKinds, - WindowInterface, - WorkspaceServiceInstance, -} from '../../../languageServerBase'; -import { CodeActionProvider } from '../../../languageService/codeActionProvider'; + Workspace, + WorkspacePythonPathKind, +} from '../../../workspaceFactory'; import { TestAccessHost } from '../testAccessHost'; import { HostSpecificFeatures } from './testState'; export class TestFeatures implements HostSpecificFeatures { importResolverFactory: ImportResolverFactory = AnalyzerService.createImportResolver; - runIndexer(workspace: WorkspaceServiceInstance, noStdLib: boolean, options?: string): void { + backgroundAnalysisProgramFactory: BackgroundAnalysisProgramFactory = ( + serviceId: string, + console: ConsoleInterface, + configOptions: ConfigOptions, + importResolver: ImportResolver, + backgroundAnalysis?: BackgroundAnalysisBase, + maxAnalysisTime?: MaxAnalysisTime, + cacheManager?: CacheManager + ) => + new BackgroundAnalysisProgram( + console, + configOptions, + importResolver, + backgroundAnalysis, + maxAnalysisTime, + /* disableChecker */ undefined, + cacheManager + ); + + runIndexer(workspace: Workspace, noStdLib: boolean, options?: string): void { /* empty */ } + getCodeActionsForPosition( - workspace: WorkspaceServiceInstance, + workspace: Workspace, filePath: string, range: Range, token: CancellationToken @@ -52,20 +76,21 @@ export class TestFeatures implements HostSpecificFeatures { } export class TestLanguageService implements LanguageServerInterface { - private readonly _workspace: WorkspaceServiceInstance; - private readonly _defaultWorkspace: WorkspaceServiceInstance; + private readonly _workspace: Workspace; + private readonly _defaultWorkspace: Workspace; private readonly _uriParser: UriParser; - constructor(workspace: WorkspaceServiceInstance, readonly console: ConsoleInterface, readonly fs: FileSystem) { + constructor(workspace: Workspace, readonly console: ConsoleInterface, readonly fs: FileSystem) { this._workspace = workspace; this._uriParser = new UriParser(this.fs); this._defaultWorkspace = { workspaceName: '', rootPath: '', - path: '', uri: '', + pythonPath: undefined, + pythonPathKind: WorkspacePythonPathKind.Mutable, kinds: [WellKnownWorkspaceKinds.Test], - serviceInstance: new AnalyzerService('test service', this.fs, { + service: new AnalyzerService('test service', this.fs, { console: this.console, hostFactory: () => new TestAccessHost(), importResolverFactory: AnalyzerService.createImportResolver, @@ -74,16 +99,15 @@ export class TestLanguageService implements LanguageServerInterface { disableLanguageServices: false, disableOrganizeImports: false, disableWorkspaceSymbol: false, - isInitialized: createDeferred(), + isInitialized: createInitStatus(), searchPathsToWatch: [], - owns: (f) => true, }; } decodeTextDocumentUri(uriString: string): string { return this._uriParser.decodeTextDocumentUri(uriString); } - getWorkspaceForFile(filePath: string): Promise { + getWorkspaceForFile(filePath: string): Promise { if (filePath.startsWith(this._workspace.rootPath)) { return Promise.resolve(this._workspace); } @@ -91,21 +115,22 @@ export class TestLanguageService implements LanguageServerInterface { return Promise.resolve(this._defaultWorkspace); } - getSettings(workspace: WorkspaceServiceInstance): Promise { + getSettings(_workspace: Workspace): Promise { const settings: ServerSettings = { - venvPath: this._workspace.serviceInstance.getConfigOptions().venvPath, - pythonPath: this._workspace.serviceInstance.getConfigOptions().pythonPath, - typeshedPath: this._workspace.serviceInstance.getConfigOptions().typeshedPath, - openFilesOnly: this._workspace.serviceInstance.getConfigOptions().checkOnlyOpenFiles, - useLibraryCodeForTypes: this._workspace.serviceInstance.getConfigOptions().useLibraryCodeForTypes, + venvPath: this._workspace.service.getConfigOptions().venvPath, + pythonPath: this._workspace.service.getConfigOptions().pythonPath, + typeshedPath: this._workspace.service.getConfigOptions().typeshedPath, + openFilesOnly: this._workspace.service.getConfigOptions().checkOnlyOpenFiles, + useLibraryCodeForTypes: this._workspace.service.getConfigOptions().useLibraryCodeForTypes, disableLanguageServices: this._workspace.disableLanguageServices, - autoImportCompletions: this._workspace.serviceInstance.getConfigOptions().autoImportCompletions, + autoImportCompletions: this._workspace.service.getConfigOptions().autoImportCompletions, + functionSignatureDisplay: this._workspace.service.getConfigOptions().functionSignatureDisplay, }; return Promise.resolve(settings); } - createBackgroundAnalysis(): BackgroundAnalysisBase | undefined { + createBackgroundAnalysis(serviceId: string): BackgroundAnalysisBase | undefined { // worker thread doesn't work in Jest // by returning undefined, analysis will run inline return undefined; diff --git a/packages/pyright-internal/src/tests/harness/fourslash/testState.ts b/packages/pyright-internal/src/tests/harness/fourslash/testState.ts index d4de47e0e..f1d599719 100644 --- a/packages/pyright-internal/src/tests/harness/fourslash/testState.ts +++ b/packages/pyright-internal/src/tests/harness/fourslash/testState.ts @@ -6,50 +6,41 @@ * TestState wraps currently test states and provides a way to query and manipulate * the test states. */ - import assert from 'assert'; -import * as JSONC from 'jsonc-parser'; +import * as path from 'path'; import Char from 'typescript-char'; import { - AnnotatedTextEdit, CancellationToken, - ChangeAnnotation, CodeAction, Command, CompletionItem, - CreateFile, - DeleteFile, Diagnostic, DocumentHighlight, DocumentHighlightKind, ExecuteCommandParams, MarkupContent, MarkupKind, - OptionalVersionedTextDocumentIdentifier, - RenameFile, - TextDocumentEdit, TextEdit, WorkspaceEdit, } from 'vscode-languageserver'; +import { BackgroundAnalysisProgramFactory } from '../../../analyzer/backgroundAnalysisProgram'; import { ImportResolver, ImportResolverFactory } from '../../../analyzer/importResolver'; import { findNodeByOffset } from '../../../analyzer/parseTreeUtils'; import { Program } from '../../../analyzer/program'; -import { AnalyzerService, configFileNames } from '../../../analyzer/service'; +import { AnalyzerService } from '../../../analyzer/service'; import { CommandResult } from '../../../commands/commandResult'; import { appendArray } from '../../../common/collectionUtils'; -import { ConfigOptions } from '../../../common/configOptions'; +import { ConfigOptions, SignatureDisplayType } from '../../../common/configOptions'; import { ConsoleInterface, NullConsole } from '../../../common/console'; import { Comparison, isNumber, isString, toBoolean } from '../../../common/core'; import * as debug from '../../../common/debug'; -import { createDeferred } from '../../../common/deferred'; import { DiagnosticCategory } from '../../../common/diagnostic'; import { FileEditAction } from '../../../common/editAction'; import { combinePaths, comparePaths, convertPathToUri, - getBaseFileName, getDirectoryPath, getFileExtension, getFileSpec, @@ -57,14 +48,9 @@ import { normalizeSlashes, } from '../../../common/pathUtils'; import { convertOffsetToPosition, convertPositionToOffset } from '../../../common/positionUtils'; -import { getStringComparer } from '../../../common/stringUtils'; import { DocumentRange, Position, Range as PositionRange, rangesAreEqual, TextRange } from '../../../common/textRange'; import { TextRangeCollection } from '../../../common/textRangeCollection'; -import { - LanguageServerInterface, - WellKnownWorkspaceKinds, - WorkspaceServiceInstance, -} from '../../../languageServerBase'; +import { LanguageServerInterface } from '../../../languageServerBase'; import { AbbreviationInfo, ImportFormat } from '../../../languageService/autoImporter'; import { CompletionOptions } from '../../../languageService/completionProvider'; import { DefinitionFilter } from '../../../languageService/definitionProvider'; @@ -73,6 +59,12 @@ import { ParseNode } from '../../../parser/parseNodes'; import { ParseResults } from '../../../parser/parser'; import { Tokenizer } from '../../../parser/tokenizer'; import { PyrightFileSystem } from '../../../pyrightFileSystem'; +import { + createInitStatus, + WellKnownWorkspaceKinds, + Workspace, + WorkspacePythonPathKind, +} from '../../../workspaceFactory'; import { TestAccessHost } from '../testAccessHost'; import * as host from '../testHost'; import { stringify } from '../utils'; @@ -90,6 +82,8 @@ import { TestCancellationToken, } from './fourSlashTypes'; import { TestFeatures, TestLanguageService } from './testLanguageService'; +import { createVfsInfoFromFourSlashData, getMarkerByName, getMarkerName, getMarkerNames } from './testStateUtils'; +import { verifyWorkspaceEdit } from './workspaceEditTestUtils'; export interface TextChange { span: TextRange; @@ -98,10 +92,11 @@ export interface TextChange { export interface HostSpecificFeatures { importResolverFactory: ImportResolverFactory; + backgroundAnalysisProgramFactory: BackgroundAnalysisProgramFactory; - runIndexer(workspace: WorkspaceServiceInstance, noStdLib: boolean, options?: string): void; + runIndexer(workspace: Workspace, noStdLib: boolean, options?: string): void; getCodeActionsForPosition( - workspace: WorkspaceServiceInstance, + workspace: Workspace, filePath: string, range: PositionRange, token: CancellationToken @@ -119,7 +114,7 @@ export class TestState { readonly testFS: vfs.TestFileSystem; readonly fs: PyrightFileSystem; - readonly workspace: WorkspaceServiceInstance; + readonly workspace: Workspace; readonly console: ConsoleInterface; readonly rawConfigJson: any | undefined; @@ -137,26 +132,30 @@ export class TestState { projectRoot: string, public testData: FourSlashData, mountPaths?: Map, - hostSpecificFeatures?: HostSpecificFeatures + hostSpecificFeatures?: HostSpecificFeatures, + testFS?: vfs.TestFileSystem ) { const vfsInfo = createVfsInfoFromFourSlashData(projectRoot, testData); - this.rawConfigJson = vfsInfo.rawConfigJson; - this._cancellationToken = new TestCancellationToken(); - this._hostSpecificFeatures = hostSpecificFeatures ?? new TestFeatures(); + this.testFS = + testFS ?? + createFromFileSystem( + host.HOST, + vfsInfo.ignoreCase, + { cwd: vfsInfo.projectRoot, files: vfsInfo.files, meta: testData.globalOptions }, + mountPaths + ); this.console = new NullConsole(); - this.testFS = createFromFileSystem( - host.HOST, - vfsInfo.ignoreCase, - { cwd: vfsInfo.projectRoot, files: vfsInfo.files, meta: testData.globalOptions }, - mountPaths - ); + this._cancellationToken = new TestCancellationToken(); + this._hostSpecificFeatures = hostSpecificFeatures ?? new TestFeatures(); this.fs = new PyrightFileSystem(this.testFS); this._files = vfsInfo.sourceFileNames; + this.rawConfigJson = vfsInfo.rawConfigJson; const configOptions = this._convertGlobalOptionsToConfigOptions(vfsInfo.projectRoot, mountPaths); + if (this.rawConfigJson) { configOptions.initializeFromJson(this.rawConfigJson, 'basic', this.console, this.fs, testAccessHost); this._applyTestConfigOptions(configOptions); @@ -165,22 +164,23 @@ export class TestState { const service = this._createAnalysisService( this.console, this._hostSpecificFeatures.importResolverFactory, + this._hostSpecificFeatures.backgroundAnalysisProgramFactory, configOptions ); this.workspace = { workspaceName: 'test workspace', rootPath: vfsInfo.projectRoot, - path: vfsInfo.projectRoot, + pythonPath: undefined, + pythonPathKind: WorkspacePythonPathKind.Mutable, uri: convertPathToUri(this.fs, vfsInfo.projectRoot), kinds: [WellKnownWorkspaceKinds.Test], - serviceInstance: service, + service: service, disableLanguageServices: false, disableOrganizeImports: false, disableWorkspaceSymbol: false, - isInitialized: createDeferred(), + isInitialized: createInitStatus(), searchPathsToWatch: [], - owns: (f) => true, }; const indexer = toBoolean(testData.globalOptions[GlobalMetadataOptionNames.indexer]); @@ -205,15 +205,19 @@ export class TestState { } get importResolver(): ImportResolver { - return this.workspace.serviceInstance.getImportResolver(); + return this.workspace.service.getImportResolver(); } get configOptions(): ConfigOptions { - return this.workspace.serviceInstance.getConfigOptions(); + return this.workspace.service.getConfigOptions(); } get program(): Program { - return this.workspace.serviceInstance.test_program; + return this.workspace.service.test_program; + } + + dispose() { + this.workspace.service.dispose(); } cwd() { @@ -251,28 +255,11 @@ export class TestState { } getMarkerName(m: Marker): string { - let found: string | undefined; - this.testData.markerPositions.forEach((marker, name) => { - if (marker === m) { - found = name; - } - }); - - assert.ok(found); - return found!; + return getMarkerName(this.testData, m); } getMarkerByName(markerName: string) { - const markerPos = this.testData.markerPositions.get(markerName); - if (markerPos === undefined) { - throw new Error( - `Unknown marker "${markerName}" Available markers: ${this.getMarkerNames() - .map((m) => '"' + m + '"') - .join(', ')}` - ); - } else { - return markerPos; - } + return getMarkerByName(this.testData, markerName); } getMarkers(): Marker[] { @@ -281,7 +268,7 @@ export class TestState { } getMarkerNames(): string[] { - return [...this.testData.markerPositions.keys()]; + return getMarkerNames(this.testData); } getPositionRange(markerString: string) { @@ -323,6 +310,10 @@ export class TestState { return getDirectoryPath(path); } + getPathSep() { + return path.sep; + } + goToPosition(positionOrLineAndColumn: number | Position) { const pos = isNumber(positionOrLineAndColumn) ? positionOrLineAndColumn @@ -534,7 +525,7 @@ export class TestState { } verifyDiagnostics(map?: { [marker: string]: { category: string; message: string } }): void { - this._analyze(); + this.analyze(); // organize things per file const resultPerFile = this._getDiagnosticsPerFile(); @@ -579,9 +570,13 @@ export class TestState { ? result.warnings : category === 'information' ? result.information + : category === 'unused' + ? result.unused + : category === 'none' + ? [] : this.raiseError(`unexpected category ${category}`); - if (expected.length !== actual.length) { + if (expected.length !== actual.length && category !== 'none') { this.raiseError( `contains unexpected result - expected: ${stringify(expected)}, actual: ${stringify(actual)}` ); @@ -597,15 +592,20 @@ export class TestState { return this._deepEqual(diagnosticSpan, rangeSpan); }); - if (matches.length === 0) { + // If the map is provided, it might say + // a marker should have none. + const name = map ? this.getMarkerName(range.marker!) : ''; + const message = map ? map[name].message : undefined; + const expectMatches = !!message; + + if (expectMatches && matches.length === 0) { this.raiseError(`doesn't contain expected range: ${stringify(range)}`); + } else if (!expectMatches && matches.length !== 0) { + this.raiseError(`${name} should not contain any matches`); } // if map is provided, check message as well - if (map) { - const name = this.getMarkerName(range.marker!); - const message = map[name].message; - + if (message) { if (matches.filter((d) => message === d.message).length !== 1) { this.raiseError( `message doesn't match: ${message} of ${name} - ${stringify( @@ -652,8 +652,8 @@ export class TestState { verifyCodeActionCount?: boolean ): Promise { // make sure we don't use cache built from other tests - this.workspace.serviceInstance.invalidateAndForceReanalysis(); - this._analyze(); + this.workspace.service.invalidateAndForceReanalysis(); + this.analyze(); for (const range of this.getRanges()) { const name = this.getMarkerName(range.marker!); @@ -719,7 +719,7 @@ export class TestState { } async verifyCommand(command: Command, files: { [filePath: string]: string }): Promise { - this._analyze(); + this.analyze(); const commandResult = await this._hostSpecificFeatures.execute( new TestLanguageService(this.workspace, this.console, this.fs), @@ -748,155 +748,7 @@ export class TestState { } verifyWorkspaceEdit(expected: WorkspaceEdit, actual: WorkspaceEdit) { - if (actual.changes) { - this._verifyTextEditMap(expected.changes!, actual.changes); - } else { - assert(!expected.changes); - } - - if (actual.documentChanges) { - this._verifyDocumentEdits(expected.documentChanges!, actual.documentChanges); - } else { - assert(!expected.documentChanges); - } - - if (actual.changeAnnotations) { - this._verifyChangeAnnotations(expected.changeAnnotations!, actual.changeAnnotations); - } else { - assert(!expected.changeAnnotations); - } - } - - private _verifyChangeAnnotations( - expected: { [id: string]: ChangeAnnotation }, - actual: { [id: string]: ChangeAnnotation } - ) { - assert.strictEqual(Object.entries(expected).length, Object.entries(actual).length); - - for (const key of Object.keys(expected)) { - const expectedAnnotation = expected[key]; - const actualAnnotation = actual[key]; - - // We need to improve it to test localized strings. - assert.strictEqual(expectedAnnotation.label, actualAnnotation.label); - assert.strictEqual(expectedAnnotation.description, actualAnnotation.description); - - assert.strictEqual(expectedAnnotation.needsConfirmation, actualAnnotation.needsConfirmation); - } - } - - private _textDocumentAreSame( - expected: OptionalVersionedTextDocumentIdentifier, - actual: OptionalVersionedTextDocumentIdentifier - ) { - return expected.version === actual.version && expected.uri === actual.uri; - } - - private _verifyDocumentEdits( - expected: (TextDocumentEdit | CreateFile | RenameFile | DeleteFile)[], - actual: (TextDocumentEdit | CreateFile | RenameFile | DeleteFile)[] - ) { - assert.strictEqual(expected.length, actual.length); - - for (const op of expected) { - assert( - actual.some((a) => { - const expectedKind = TextDocumentEdit.is(op) ? 'edit' : op.kind; - const actualKind = TextDocumentEdit.is(a) ? 'edit' : a.kind; - if (expectedKind !== actualKind) { - return false; - } - - switch (expectedKind) { - case 'edit': { - const expectedEdit = op as TextDocumentEdit; - const actualEdit = a as TextDocumentEdit; - - if (!this._textDocumentAreSame(expectedEdit.textDocument, actualEdit.textDocument)) { - return false; - } - - return this._textEditsAreSame(expectedEdit.edits, actualEdit.edits); - } - case 'create': { - const expectedOp = op as CreateFile; - const actualOp = a as CreateFile; - return ( - expectedOp.kind === actualOp.kind && - expectedOp.annotationId === actualOp.annotationId && - expectedOp.uri === actualOp.uri && - expectedOp.options?.ignoreIfExists === actualOp.options?.ignoreIfExists && - expectedOp.options?.overwrite === actualOp.options?.overwrite - ); - } - case 'rename': { - const expectedOp = op as RenameFile; - const actualOp = a as RenameFile; - return ( - expectedOp.kind === actualOp.kind && - expectedOp.annotationId === actualOp.annotationId && - expectedOp.oldUri === actualOp.oldUri && - expectedOp.newUri === actualOp.newUri && - expectedOp.options?.ignoreIfExists === actualOp.options?.ignoreIfExists && - expectedOp.options?.overwrite === actualOp.options?.overwrite - ); - } - case 'delete': { - const expectedOp = op as DeleteFile; - const actualOp = a as DeleteFile; - return ( - expectedOp.annotationId === actualOp.annotationId && - expectedOp.kind === actualOp.kind && - expectedOp.uri === actualOp.uri && - expectedOp.options?.ignoreIfNotExists === actualOp.options?.ignoreIfNotExists && - expectedOp.options?.recursive === actualOp.options?.recursive - ); - } - default: - debug.assertNever(expectedKind); - } - }) - ); - } - } - - private _verifyTextEditMap(expected: { [uri: string]: TextEdit[] }, actual: { [uri: string]: TextEdit[] }) { - assert.strictEqual(Object.entries(expected).length, Object.entries(actual).length); - - for (const key of Object.keys(expected)) { - assert(this._textEditsAreSame(expected[key], actual[key])); - } - } - - private _textEditsAreSame( - expectedEdits: (TextEdit | AnnotatedTextEdit)[], - actualEdits: (TextEdit | AnnotatedTextEdit)[] - ) { - if (expectedEdits.length !== actualEdits.length) { - return false; - } - - for (const edit of expectedEdits) { - if (!actualEdits.some((a) => this._textEditAreSame(edit, a))) { - return false; - } - } - - return true; - } - - private _textEditAreSame(expected: TextEdit, actual: TextEdit) { - if (!rangesAreEqual(expected.range, actual.range)) { - return false; - } - - if (expected.newText !== actual.newText) { - return false; - } - - const expectedAnnotation = AnnotatedTextEdit.is(expected) ? expected.annotationId : ''; - const actualAnnotation = AnnotatedTextEdit.is(actual) ? actual.annotationId : ''; - return expectedAnnotation === actualAnnotation; + return verifyWorkspaceEdit(expected, actual); } async verifyInvokeCodeAction( @@ -905,7 +757,7 @@ export class TestState { }, verifyCodeActionCount?: boolean ): Promise { - this._analyze(); + this.analyze(); for (const range of this.getRanges()) { const name = this.getMarkerName(range.marker!); @@ -1058,7 +910,7 @@ export class TestState { }, abbrMap?: { [abbr: string]: AbbreviationInfo } ): Promise { - this._analyze(); + this.analyze(); for (const marker of this.getMarkers()) { const markerName = this.getMarkerName(marker); @@ -1079,12 +931,13 @@ export class TestState { autoImport: true, extraCommitChars: true, importFormat: ImportFormat.Absolute, + includeUserSymbolsInAutoImport: false, }; const nameMap = abbrMap ? new Map(Object.entries(abbrMap)) : undefined; - const result = await this.workspace.serviceInstance.getCompletionsForPosition( + const result = await this.workspace.service.getCompletionsForPosition( filePath, completionPosition, - this.workspace.path, + this.workspace.rootPath, options, nameMap, CancellationToken.None @@ -1128,7 +981,7 @@ export class TestState { if (expected.additionalTextEdits !== undefined) { if (actual.additionalTextEdits === undefined) { - this.workspace.serviceInstance.resolveCompletionItem( + this.workspace.service.resolveCompletionItem( filePath, actual, options, @@ -1141,8 +994,8 @@ export class TestState { this.verifyCompletionItem(expected, actual); if (expected.documentation !== undefined) { - if (actual.documentation === undefined) { - this.workspace.serviceInstance.resolveCompletionItem( + if (actual.documentation === undefined && actual.data) { + this.workspace.service.resolveCompletionItem( filePath, actual, options, @@ -1228,7 +1081,7 @@ export class TestState { }; } ): void { - this._analyze(); + this.analyze(); for (const marker of this.getMarkers()) { const fileName = marker.fileName; @@ -1297,7 +1150,7 @@ export class TestState { references: DocumentRange[]; }; }) { - this._analyze(); + this.analyze(); for (const marker of this.getMarkers()) { const fileName = marker.fileName; @@ -1328,6 +1181,37 @@ export class TestState { } } + verifyShowCallHierarchyGetIncomingCalls(map: { + [marker: string]: { + references: DocumentRange[]; + }; + }) { + this.analyze(); + + for (const marker of this.getMarkers()) { + const fileName = marker.fileName; + const name = this.getMarkerName(marker); + + if (!(name in map)) { + continue; + } + + const expected = map[name].references; + + const position = this.convertOffsetToPosition(fileName, marker.position); + + const actual = this.program.getIncomingCallsForPosition(fileName, position, CancellationToken.None); + + assert.strictEqual(actual?.length ?? 0, expected.length, `${name} has failed`); + if (actual) { + for (const a of actual) { + assert.equal(expected?.filter((e) => this._deepEqual(a.from.range, e.range)).length, 1); + assert.equal(expected?.filter((e) => this._deepEqual(a.from.uri, e.path)).length, 1); + } + } + } + } + getDocumentHighlightKind(m?: Marker): DocumentHighlightKind | undefined { const kind = m?.data ? ((m.data as any).kind as string) : undefined; switch (kind) { @@ -1347,7 +1231,7 @@ export class TestState { references: DocumentHighlight[]; }; }) { - this._analyze(); + this.analyze(); for (const name of Object.keys(map)) { const marker = this.getMarkerByName(name); @@ -1379,7 +1263,7 @@ export class TestState { }, filter: DefinitionFilter = DefinitionFilter.All ) { - this._analyze(); + this.analyze(); for (const marker of this.getMarkers()) { const fileName = marker.fileName; @@ -1391,13 +1275,25 @@ export class TestState { const expected = map[name].definitions; + // If we're going to def from a file, act like it's open. + if (!this.program.getSourceFileInfo(fileName)) { + const file = this.testData.files.find((v) => v.fileName === fileName); + if (file) { + this.program.setFileOpened(fileName, file.version, [{ text: file.content }]); + } + } + const position = this.convertOffsetToPosition(fileName, marker.position); const actual = this.program.getDefinitionsForPosition(fileName, position, filter, CancellationToken.None); - assert.equal(actual?.length ?? 0, expected.length); + assert.equal(actual?.length ?? 0, expected.length, `No definitions found for marker "${name}"`); for (const r of expected) { - assert.equal(actual?.filter((d) => this._deepEqual(d, r)).length, 1); + assert.equal( + actual?.filter((d) => this._deepEqual(d, r)).length, + 1, + `No match found for ${JSON.stringify(r)} from marker ${name}` + ); } } } @@ -1407,7 +1303,7 @@ export class TestState { definitions: DocumentRange[]; }; }) { - this._analyze(); + this.analyze(); for (const marker of this.getMarkers()) { const fileName = marker.fileName; @@ -1436,7 +1332,7 @@ export class TestState { changes: FileEditAction[]; }; }) { - this._analyze(); + this.analyze(); for (const marker of this.getMarkers()) { const fileName = marker.fileName; @@ -1478,7 +1374,12 @@ export class TestState { const configOptions = new ConfigOptions(projectRoot); // add more global options as we need them - return this._applyTestConfigOptions(configOptions, mountPaths); + const newConfigOptions = this._applyTestConfigOptions(configOptions, mountPaths); + + // default tests to run use compact signatures. + newConfigOptions.functionSignatureDisplay = SignatureDisplayType.compact; + + return newConfigOptions; } private _applyTestConfigOptions(configOptions: ConfigOptions, mountPaths?: Map) { @@ -1504,6 +1405,10 @@ export class TestState { } } + if (configOptions.functionSignatureDisplay === undefined) { + configOptions.functionSignatureDisplay === SignatureDisplayType.compact; + } + return configOptions; } @@ -1780,7 +1685,7 @@ export class TestState { return position <= editStart ? position : position < editEnd ? -1 : position + length - +(editEnd - editStart); } - private _analyze() { + public analyze() { while (this.program.analyze()) { // Continue to call analyze until it completes. Since we're not // specifying a timeout, it should complete the first time. @@ -1799,6 +1704,7 @@ export class TestState { errors: diagnostics.filter((diag) => diag.category === DiagnosticCategory.Error), warnings: diagnostics.filter((diag) => diag.category === DiagnosticCategory.Warning), information: diagnostics.filter((diag) => diag.category === DiagnosticCategory.Information), + unused: diagnostics.filter((diag) => diag.category === DiagnosticCategory.UnusedCode), }; return [filePath, value] as [string, typeof value]; } else { @@ -1806,12 +1712,13 @@ export class TestState { } }); - return new Map(results); + return new Map(results); } private _createAnalysisService( nullConsole: ConsoleInterface, importResolverFactory: ImportResolverFactory, + backgroundAnalysisProgramFactory: BackgroundAnalysisProgramFactory, configOptions: ConfigOptions ) { // we do not initiate automatic analysis or file watcher in test. @@ -1819,6 +1726,7 @@ export class TestState { console: nullConsole, hostFactory: () => testAccessHost, importResolverFactory, + backgroundAnalysisProgramFactory, configOptions, }); @@ -1941,14 +1849,25 @@ export class TestState { } if (expected.commitCharacters !== undefined) { - expect(expected.commitCharacters.sort()).toEqual(actual.commitCharacters?.sort()); + expect(expected.commitCharacters.sort()).toEqual(actual.commitCharacters?.sort() ?? []); } } } -export function parseAndGetTestState(code: string, projectRoot = '/', anonymousFileName = 'unnamedFile.py') { +export function parseAndGetTestState( + code: string, + projectRoot = '/', + anonymousFileName = 'unnamedFile.py', + testFS?: vfs.TestFileSystem +) { const data = parseTestData(normalizeSlashes(projectRoot), code, anonymousFileName); - const state = new TestState(normalizeSlashes('/'), data); + const state = new TestState( + normalizeSlashes('/'), + data, + /* mountPath */ undefined, + /* hostSpecificFeatures */ undefined, + testFS + ); return { data, state }; } @@ -1988,37 +1907,3 @@ export function getNodeAtMarker(codeOrState: string | TestState, markerName = 'm return node; } - -export function createVfsInfoFromFourSlashData(projectRoot: string, testData: FourSlashData) { - const metaProjectRoot = testData.globalOptions[GlobalMetadataOptionNames.projectRoot]; - projectRoot = metaProjectRoot ? combinePaths(projectRoot, metaProjectRoot) : projectRoot; - - const ignoreCase = toBoolean(testData.globalOptions[GlobalMetadataOptionNames.ignoreCase]); - - let rawConfigJson = ''; - const sourceFileNames: string[] = []; - const files: vfs.FileSet = {}; - - for (const file of testData.files) { - // if one of file is configuration file, set config options from the given json - if (isConfig(file, ignoreCase)) { - try { - rawConfigJson = JSONC.parse(file.content); - } catch (e: any) { - throw new Error(`Failed to parse test ${file.fileName}: ${e.message}`); - } - } else { - files[file.fileName] = new vfs.File(file.content, { meta: file.fileOptions, encoding: 'utf8' }); - - if (!toBoolean(file.fileOptions[MetadataOptionNames.library])) { - sourceFileNames.push(file.fileName); - } - } - } - return { files, sourceFileNames, projectRoot, ignoreCase, rawConfigJson }; -} - -function isConfig(file: FourSlashFile, ignoreCase: boolean): boolean { - const comparer = getStringComparer(ignoreCase); - return configFileNames.some((f) => comparer(getBaseFileName(file.fileName), f) === Comparison.EqualTo); -} diff --git a/packages/pyright-internal/src/tests/harness/fourslash/testStateUtils.ts b/packages/pyright-internal/src/tests/harness/fourslash/testStateUtils.ts new file mode 100644 index 000000000..9bbde1b40 --- /dev/null +++ b/packages/pyright-internal/src/tests/harness/fourslash/testStateUtils.ts @@ -0,0 +1,80 @@ +/* + * testStateUtils.ts + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT license. + * + * Various test utility functions for TestState. + */ + +import assert from 'assert'; +import * as JSONC from 'jsonc-parser'; + +import { configFileNames } from '../../../analyzer/service'; +import { Comparison, toBoolean } from '../../../common/core'; +import { combinePaths, getBaseFileName } from '../../../common/pathUtils'; +import { getStringComparer } from '../../../common/stringUtils'; +import * as vfs from '../vfs/filesystem'; +import { FourSlashData, FourSlashFile, GlobalMetadataOptionNames, Marker, MetadataOptionNames } from './fourSlashTypes'; + +export function createVfsInfoFromFourSlashData(projectRoot: string, testData: FourSlashData) { + const metaProjectRoot = testData.globalOptions[GlobalMetadataOptionNames.projectRoot]; + projectRoot = metaProjectRoot ? combinePaths(projectRoot, metaProjectRoot) : projectRoot; + + const ignoreCase = toBoolean(testData.globalOptions[GlobalMetadataOptionNames.ignoreCase]); + + let rawConfigJson = ''; + const sourceFileNames: string[] = []; + const files: vfs.FileSet = {}; + + for (const file of testData.files) { + // if one of file is configuration file, set config options from the given json + if (isConfig(file, ignoreCase)) { + try { + rawConfigJson = JSONC.parse(file.content); + } catch (e: any) { + throw new Error(`Failed to parse test ${file.fileName}: ${e.message}`); + } + } else { + files[file.fileName] = new vfs.File(file.content, { meta: file.fileOptions, encoding: 'utf8' }); + + if (!toBoolean(file.fileOptions[MetadataOptionNames.library])) { + sourceFileNames.push(file.fileName); + } + } + } + return { files, sourceFileNames, projectRoot, ignoreCase, rawConfigJson }; +} + +export function getMarkerName(testData: FourSlashData, markerToFind: Marker) { + let found: string | undefined; + testData.markerPositions.forEach((marker, name) => { + if (marker === markerToFind) { + found = name; + } + }); + + assert.ok(found); + return found!; +} + +export function getMarkerByName(testData: FourSlashData, markerName: string) { + const markerPos = testData.markerPositions.get(markerName); + if (markerPos === undefined) { + throw new Error( + `Unknown marker "${markerName}" Available markers: ${getMarkerNames(testData) + .map((m) => '"' + m + '"') + .join(', ')}` + ); + } else { + return markerPos; + } +} + +export function getMarkerNames(testData: FourSlashData): string[] { + return [...testData.markerPositions.keys()]; +} + +function isConfig(file: FourSlashFile, ignoreCase: boolean): boolean { + const comparer = getStringComparer(ignoreCase); + return configFileNames.some((f) => comparer(getBaseFileName(file.fileName), f) === Comparison.EqualTo); +} diff --git a/packages/pyright-internal/src/tests/harness/fourslash/workspaceEditTestUtils.ts b/packages/pyright-internal/src/tests/harness/fourslash/workspaceEditTestUtils.ts new file mode 100644 index 000000000..de3aa19b4 --- /dev/null +++ b/packages/pyright-internal/src/tests/harness/fourslash/workspaceEditTestUtils.ts @@ -0,0 +1,175 @@ +/* + * workspaceEditTestUtils.ts + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT license. + * + * Test Utils around workspace edits. + */ + +import assert from 'assert'; +import { + AnnotatedTextEdit, + ChangeAnnotation, + CreateFile, + DeleteFile, + OptionalVersionedTextDocumentIdentifier, + RenameFile, + TextDocumentEdit, + TextEdit, + WorkspaceEdit, +} from 'vscode-languageserver'; + +import * as debug from '../../../common/debug'; +import { rangesAreEqual } from '../../../common/textRange'; + +export function verifyWorkspaceEdit(expected: WorkspaceEdit, actual: WorkspaceEdit) { + if (actual.changes) { + verifyTextEditMap(expected.changes!, actual.changes); + } else { + assert(!expected.changes); + } + + if (actual.documentChanges) { + verifyDocumentEdits(expected.documentChanges!, actual.documentChanges); + } else { + assert(!expected.documentChanges); + } + + if (actual.changeAnnotations) { + verifyChangeAnnotations(expected.changeAnnotations!, actual.changeAnnotations); + } else { + assert(!expected.changeAnnotations); + } +} + +export function verifyChangeAnnotations( + expected: { [id: string]: ChangeAnnotation }, + actual: { [id: string]: ChangeAnnotation } +) { + assert.strictEqual(Object.entries(expected).length, Object.entries(actual).length); + + for (const key of Object.keys(expected)) { + const expectedAnnotation = expected[key]; + const actualAnnotation = actual[key]; + + // We need to improve it to test localized strings. + assert.strictEqual(expectedAnnotation.label, actualAnnotation.label); + assert.strictEqual(expectedAnnotation.description, actualAnnotation.description); + + assert.strictEqual(expectedAnnotation.needsConfirmation, actualAnnotation.needsConfirmation); + } +} + +export function textDocumentAreSame( + expected: OptionalVersionedTextDocumentIdentifier, + actual: OptionalVersionedTextDocumentIdentifier +) { + return expected.version === actual.version && expected.uri === actual.uri; +} + +export function verifyDocumentEdits( + expected: (TextDocumentEdit | CreateFile | RenameFile | DeleteFile)[], + actual: (TextDocumentEdit | CreateFile | RenameFile | DeleteFile)[] +) { + assert.strictEqual(expected.length, actual.length); + + for (const op of expected) { + assert( + actual.some((a) => { + const expectedKind = TextDocumentEdit.is(op) ? 'edit' : op.kind; + const actualKind = TextDocumentEdit.is(a) ? 'edit' : a.kind; + if (expectedKind !== actualKind) { + return false; + } + + switch (expectedKind) { + case 'edit': { + const expectedEdit = op as TextDocumentEdit; + const actualEdit = a as TextDocumentEdit; + + if (!textDocumentAreSame(expectedEdit.textDocument, actualEdit.textDocument)) { + return false; + } + + return textEditsAreSame(expectedEdit.edits, actualEdit.edits); + } + case 'create': { + const expectedOp = op as CreateFile; + const actualOp = a as CreateFile; + return ( + expectedOp.kind === actualOp.kind && + expectedOp.annotationId === actualOp.annotationId && + expectedOp.uri === actualOp.uri && + expectedOp.options?.ignoreIfExists === actualOp.options?.ignoreIfExists && + expectedOp.options?.overwrite === actualOp.options?.overwrite + ); + } + case 'rename': { + const expectedOp = op as RenameFile; + const actualOp = a as RenameFile; + return ( + expectedOp.kind === actualOp.kind && + expectedOp.annotationId === actualOp.annotationId && + expectedOp.oldUri === actualOp.oldUri && + expectedOp.newUri === actualOp.newUri && + expectedOp.options?.ignoreIfExists === actualOp.options?.ignoreIfExists && + expectedOp.options?.overwrite === actualOp.options?.overwrite + ); + } + case 'delete': { + const expectedOp = op as DeleteFile; + const actualOp = a as DeleteFile; + return ( + expectedOp.annotationId === actualOp.annotationId && + expectedOp.kind === actualOp.kind && + expectedOp.uri === actualOp.uri && + expectedOp.options?.ignoreIfNotExists === actualOp.options?.ignoreIfNotExists && + expectedOp.options?.recursive === actualOp.options?.recursive + ); + } + default: + debug.assertNever(expectedKind); + } + }) + ); + } +} + +export function verifyTextEditMap(expected: { [uri: string]: TextEdit[] }, actual: { [uri: string]: TextEdit[] }) { + assert.strictEqual(Object.entries(expected).length, Object.entries(actual).length); + + for (const key of Object.keys(expected)) { + assert(textEditsAreSame(expected[key], actual[key])); + } +} + +export function textEditsAreSame( + expectedEdits: (TextEdit | AnnotatedTextEdit)[], + actualEdits: (TextEdit | AnnotatedTextEdit)[] +) { + if (expectedEdits.length !== actualEdits.length) { + return false; + } + + for (const edit of expectedEdits) { + if (!actualEdits.some((a) => textEditAreSame(edit, a))) { + return false; + } + } + + return true; +} + +export function textEditAreSame(expected: TextEdit, actual: TextEdit) { + if (!rangesAreEqual(expected.range, actual.range)) { + return false; + } + + if (expected.newText !== actual.newText) { + return false; + } + + const expectedAnnotation = AnnotatedTextEdit.is(expected) ? expected.annotationId : ''; + const actualAnnotation = AnnotatedTextEdit.is(actual) ? actual.annotationId : ''; + return expectedAnnotation === actualAnnotation; +} diff --git a/packages/pyright-internal/src/tests/harness/vfs/filesystem.ts b/packages/pyright-internal/src/tests/harness/vfs/filesystem.ts index deec709e9..e7fc6188a 100644 --- a/packages/pyright-internal/src/tests/harness/vfs/filesystem.ts +++ b/packages/pyright-internal/src/tests/harness/vfs/filesystem.ts @@ -10,7 +10,13 @@ import { Dirent, ReadStream, WriteStream } from 'fs'; import { URI } from 'vscode-uri'; -import { FileSystem, FileWatcher, FileWatcherEventHandler, TmpfileOptions } from '../../../common/fileSystem'; +import { + FileSystem, + FileWatcher, + FileWatcherEventHandler, + MkDirOptions, + TmpfileOptions, +} from '../../../common/fileSystem'; import * as pathUtil from '../../../common/pathUtils'; import { bufferFrom, createIOError } from '../utils'; import { closeIterator, getIterator, Metadata, nextResult, SortedMap } from './../utils'; @@ -614,11 +620,16 @@ export class TestFileSystem implements FileSystem { * * NOTE: do not rename this method as it is intended to align with the same named export of the "fs" module. */ - mkdirSync(path: string) { + mkdirSync(path: string, options?: MkDirOptions) { if (this.isReadonly) { throw createIOError('EROFS'); } + if (options?.recursive) { + this.mkdirpSync(path); + return; + } + this._mkdir(this._walk(this._resolve(path), /*noFollow*/ true)); } @@ -922,6 +933,10 @@ export class TestFileSystem implements FileSystem { return false; } + dispose(): void { + // Do Nothing + } + private static _diffWorker( container: FileSet, changed: TestFileSystem, diff --git a/packages/pyright-internal/src/tests/hoverProvider.test.ts b/packages/pyright-internal/src/tests/hoverProvider.test.ts new file mode 100644 index 000000000..fb50cb05a --- /dev/null +++ b/packages/pyright-internal/src/tests/hoverProvider.test.ts @@ -0,0 +1,355 @@ +/* + * hoverProvider.test.ts + * + * hoverProvider tests. + */ + +import { parseAndGetTestState } from './harness/fourslash/testState'; + +test('import tooltip - import statement', async () => { + const code = ` +// @filename: pyrightconfig.json +//// { +//// "useLibraryCodeForTypes": true +//// } + +// @filename: test.py +//// import [|/*marker1*/matplotlib|].[|/*marker2*/pyplot|] + +// @filename: matplotlib/__init__.py +// @library: true +//// """ matplotlib """ + +// @filename: matplotlib/pyplot.py +// @library: true +//// """ pyplot """ + `; + + const state = parseAndGetTestState(code).state; + const marker1 = state.getMarkerByName('marker1'); + state.openFile(marker1.fileName); + + state.verifyHover('markdown', { + marker1: '```python\n(module) matplotlib\n```\n---\nmatplotlib', + marker2: '```python\n(module) pyplot\n```\n---\npyplot', + }); +}); + +test('import tooltip - import reference', async () => { + const code = ` +// @filename: pyrightconfig.json +//// { +//// "useLibraryCodeForTypes": true +//// } + +// @filename: test.py +//// import matplotlib.pyplot +//// [|/*marker1*/matplotlib|].[|/*marker2*/pyplot|] + +// @filename: matplotlib/__init__.py +// @library: true +//// """ matplotlib """ + +// @filename: matplotlib/pyplot.py +// @library: true +//// """ pyplot """ + `; + + const state = parseAndGetTestState(code).state; + const marker1 = state.getMarkerByName('marker1'); + state.openFile(marker1.fileName); + + state.verifyHover('markdown', { + marker1: '```python\n(module) matplotlib\n```\n---\nmatplotlib', + marker2: '```python\n(module) pyplot\n```\n---\npyplot', + }); +}); + +test('import tooltip - import statement with stubs', async () => { + const code = ` +// @filename: pyrightconfig.json +//// { +//// "useLibraryCodeForTypes": true +//// } + +// @filename: test.py +//// import [|/*marker1*/matplotlib|].[|/*marker2*/pyplot|] + +// @filename: matplotlib/__init__.pyi +// @library: true +//// # empty + +// @filename: matplotlib/pyplot.pyi +// @library: true +//// # empty + +// @filename: matplotlib/__init__.py +// @library: true +//// """ matplotlib """ + +// @filename: matplotlib/pyplot.py +// @library: true +//// """ pyplot """ + `; + + const state = parseAndGetTestState(code).state; + const marker1 = state.getMarkerByName('marker1'); + state.openFile(marker1.fileName); + + state.verifyHover('markdown', { + marker1: '```python\n(module) matplotlib\n```\n---\nmatplotlib', + marker2: '```python\n(module) pyplot\n```\n---\npyplot', + }); +}); + +test('import tooltip - import reference - stub files', async () => { + const code = ` +// @filename: pyrightconfig.json +//// { +//// "useLibraryCodeForTypes": true +//// } + +// @filename: test.py +//// import matplotlib.pyplot +//// [|/*marker1*/matplotlib|].[|/*marker2*/pyplot|] + +// @filename: matplotlib/__init__.pyi +// @library: true +//// # empty + +// @filename: matplotlib/pyplot.pyi +// @library: true +//// # empty + +// @filename: matplotlib/__init__.py +// @library: true +//// """ matplotlib """ + +// @filename: matplotlib/pyplot.py +// @library: true +//// """ pyplot """ + `; + + const state = parseAndGetTestState(code).state; + const marker1 = state.getMarkerByName('marker1'); + state.openFile(marker1.fileName); + + state.verifyHover('markdown', { + marker1: '```python\n(module) matplotlib\n```\n---\nmatplotlib', + marker2: '```python\n(module) pyplot\n```\n---\npyplot', + }); +}); + +test('import tooltip - import submodules statement', async () => { + const code = ` +// @filename: pyrightconfig.json +//// { +//// "useLibraryCodeForTypes": true +//// } + +// @filename: test.py +//// import A.B.[|/*marker*/C|] + +// @filename: A/__init__.py +// @library: true +//// # empty + +// @filename: A/B/__init__.py +// @library: true +//// # empty + +// @filename: A/B/C/__init__.py +// @library: true +//// """ C """ + `; + + const state = parseAndGetTestState(code).state; + const marker = state.getMarkerByName('marker'); + state.openFile(marker.fileName); + + state.verifyHover('markdown', { marker: '```python\n(module) C\n```\n---\nC' }); +}); + +test('import tooltip - import submodules reference', async () => { + const code = ` +// @filename: pyrightconfig.json +//// { +//// "useLibraryCodeForTypes": true +//// } + +// @filename: test.py +//// import A.B.C +//// A.B.[|/*marker*/C|] + +// @filename: A/__init__.py +// @library: true +//// # empty + +// @filename: A/B/__init__.py +// @library: true +//// # empty + +// @filename: A/B/C/__init__.py +// @library: true +//// """ C """ + `; + + const state = parseAndGetTestState(code).state; + const marker = state.getMarkerByName('marker'); + state.openFile(marker.fileName); + + state.verifyHover('markdown', { marker: '```python\n(module) C\n```\n---\nC' }); +}); + +test('import tooltip - from import statement with stubs', async () => { + const code = ` +// @filename: pyrightconfig.json +//// { +//// "useLibraryCodeForTypes": true +//// } + +// @filename: test.py +//// from [|/*marker1*/matplotlib|].[|/*marker2*/pyplot|] import * + +// @filename: matplotlib/__init__.pyi +// @library: true +//// # empty + +// @filename: matplotlib/pyplot.pyi +// @library: true +//// # empty + +// @filename: matplotlib/__init__.py +// @library: true +//// """ matplotlib """ + +// @filename: matplotlib/pyplot.py +// @library: true +//// """ pyplot """ + `; + + const state = parseAndGetTestState(code).state; + const marker1 = state.getMarkerByName('marker1'); + state.openFile(marker1.fileName); + + state.verifyHover('markdown', { + marker1: '```python\n(module) matplotlib\n```\n---\nmatplotlib', + marker2: '```python\n(module) pyplot\n```\n---\npyplot', + }); +}); + +test('import tooltip - from import submodules statement', async () => { + const code = ` +// @filename: pyrightconfig.json +//// { +//// "useLibraryCodeForTypes": true +//// } + +// @filename: test.py +//// from A.B.[|/*marker*/C|] import * + +// @filename: A/__init__.py +// @library: true +//// # empty + +// @filename: A/B/__init__.py +// @library: true +//// # empty + +// @filename: A/B/C/__init__.py +// @library: true +//// """ C """ + `; + + const state = parseAndGetTestState(code).state; + const marker = state.getMarkerByName('marker'); + state.openFile(marker.fileName); + + state.verifyHover('markdown', { marker: '```python\n(module) C\n```\n---\nC' }); +}); + +test('import tooltip - check duplicate property', async () => { + const code = ` + +// @filename: test.py +//// class Test: +//// def __init__(self) -> None: +//// self.__test = False +//// +//// @property +//// def [|/*marker*/test|](self): +//// """Test DocString. +//// +//// Returns +//// ------- +//// bool +//// Lorem Ipsum +//// """ +//// return self.__test + + `; + + const state = parseAndGetTestState(code).state; + const marker = state.getMarkerByName('marker'); + state.openFile(marker.fileName); + + state.verifyHover('markdown', { + marker: '```python\n(property) test: (self: Self@Test) -> bool\n```\n---\nTest DocString.\n\nReturns\n-------\nbool \n    Lorem Ipsum', + }); +}); + +test('import symbol tooltip - useLibraryCodeForTypes false', async () => { + const code = ` +// @filename: pyrightconfig.json +//// { +//// "useLibraryCodeForTypes": false +//// } + +// @filename: test.py +//// from foo import [|/*marker1*/bar|] + +// @filename: foo/__init__.py +// @library: true +//// from .bar import bar + +// @filename: foo/bar.py +// @library: true +//// class bar: ... + `; + + const state = parseAndGetTestState(code).state; + const marker1 = state.getMarkerByName('marker1'); + state.openFile(marker1.fileName); + + state.verifyHover('markdown', { + marker1: '```python\n(import) bar: Unknown\n```', + }); +}); + +test('import symbol tooltip - useLibraryCodeForTypes true', async () => { + const code = ` +// @filename: pyrightconfig.json +//// { +//// "useLibraryCodeForTypes": true +//// } + +// @filename: test.py +//// from foo import [|/*marker1*/bar|] + +// @filename: foo/__init__.py +// @library: true +//// from .bar import bar + +// @filename: foo/bar.py +// @library: true +//// class bar: ... + `; + + const state = parseAndGetTestState(code).state; + const marker1 = state.getMarkerByName('marker1'); + state.openFile(marker1.fileName); + + state.verifyHover('markdown', { + marker1: '```python\n(class) bar\n```', + }); +}); diff --git a/packages/pyright-internal/src/tests/importAdder.test.ts b/packages/pyright-internal/src/tests/importAdder.test.ts index 37850b7ea..44e902c70 100644 --- a/packages/pyright-internal/src/tests/importAdder.test.ts +++ b/packages/pyright-internal/src/tests/importAdder.test.ts @@ -9,10 +9,13 @@ import assert from 'assert'; import { CancellationToken } from 'vscode-languageserver'; +import { TextEditAction } from '../common/editAction'; +import { TextEditTracker } from '../common/textEditTracker'; import { rangesAreEqual, TextRange } from '../common/textRange'; import { ImportFormat } from '../languageService/autoImporter'; import { ImportAdder } from '../languageService/importAdder'; -import { parseAndGetTestState } from './harness/fourslash/testState'; +import { parseAndGetTestState, TestState } from './harness/fourslash/testState'; +import { convertFileEditActionToString, convertRangeToFileEditAction } from './testStateUtils'; test('builtin types', () => { const code = ` @@ -1336,6 +1339,61 @@ test('use relative import format', () => { testImportMove(code, ImportFormat.Relative); }); +test('use relative import format - textEditTracker', () => { + const code = ` +// @filename: test1.py +//// from nested import module +//// +//// [|/*src*/module.foo()|] + +// @filename: nested/__init__.py +//// [|{|"r":"from . import module!n!!n!!n!"|}|][|/*dest*/|] + +// @filename: nested/module.py +//// def foo(): pass + `; + testImportMoveWithTracker(code, ImportFormat.Relative); +}); + +test('dont include token not contained in the span', () => { + const code = ` +// @filename: test1.py +//// import random +//// +//// [|/*src*/answer_word = random.choice(["a","b","c","d"]) +//// |]guess_word = "c" + +// @filename: nested/__init__.py +//// [|{|"r":"import random!n!!n!!n!"|}|][|/*dest*/|] + `; + testImportMove(code, ImportFormat.Absolute); +}); + +function testImportMoveWithTracker(code: string, importFormat = ImportFormat.Absolute) { + const state = parseAndGetTestState(code).state; + + const src = state.getRangeByMarkerName('src')!; + const dest = state.getMarkerByName('dest'); + + const importMover = new ImportAdder(state.configOptions, state.importResolver, state.program.evaluator!); + const importData = importMover.collectImportsForSymbolsUsed( + state.program.getBoundSourceFile(src.fileName)!.getParseResults()!, + TextRange.fromBounds(src.pos, src.end), + CancellationToken.None + ); + + const tracker = new TextEditTracker(); + importMover.applyImportsTo( + importData, + state.program.getBoundSourceFile(dest.fileName)!.getParseResults()!, + importFormat, + tracker, + CancellationToken.None + ); + + verifyEdits(tracker.getEdits(CancellationToken.None), state); +} + function testImportMove(code: string, importFormat = ImportFormat.Absolute) { const state = parseAndGetTestState(code).state; @@ -1351,16 +1409,29 @@ function testImportMove(code: string, importFormat = ImportFormat.Absolute) { const edits = importMover.applyImports( importData, + dest.fileName, state.program.getBoundSourceFile(dest.fileName)!.getParseResults()!, dest.position, importFormat, CancellationToken.None ); + verifyEdits(edits, state); +} + +function verifyEdits(edits: TextEditAction[], state: TestState) { assert(edits); + const filePath = state.getMarkerByName('dest').fileName; const ranges = state.getRanges().filter((r) => !!r.marker?.data); - assert.strictEqual(edits.length, ranges.length); + assert.strictEqual( + edits.length, + ranges.length, + `${edits.map((e) => convertFileEditActionToString({ filePath, ...e })).join('|')} vs ${ranges + .map((r) => convertRangeToFileEditAction(state, r)) + .map((e) => convertFileEditActionToString(e)) + .join('|')}` + ); for (const edit of edits) { assert( @@ -1373,7 +1444,10 @@ function testImportMove(code: string, importFormat = ImportFormat.Absolute) { expectedText.replace(/!n!/g, '\n') === edit.replacementText ); }), - `can't find '${edit.replacementText}'@'(${edit.range.start.line},${edit.range.start.character})'` + `can't find ${convertFileEditActionToString({ filePath, ...edit })} in ${ranges + .map((r) => convertRangeToFileEditAction(state, r)) + .map((e) => convertFileEditActionToString(e)) + .join('|')}` ); } } diff --git a/packages/pyright-internal/src/tests/indentationUtils.ptvs.test.ts b/packages/pyright-internal/src/tests/indentationUtils.ptvs.test.ts index 544c192d2..8f007ff5b 100644 --- a/packages/pyright-internal/src/tests/indentationUtils.ptvs.test.ts +++ b/packages/pyright-internal/src/tests/indentationUtils.ptvs.test.ts @@ -8,7 +8,7 @@ import assert from 'assert'; -import { getIndentation } from '../languageService/indentationUtils'; +import { getNewlineIndentation } from '../languageService/indentationUtils'; import { parseAndGetTestState } from './harness/fourslash/testState'; test('top level statement - pass', () => { @@ -48,7 +48,7 @@ test('function with open paren between top level statement', () => { //// def bar(): pass `; - testIndentation(code, 4); + testIndentation(code, 8); // Based on PEP8 }); test('function with open paren', () => { @@ -58,7 +58,7 @@ test('function with open paren', () => { //// `; - testIndentation(code, 4); + testIndentation(code, 8); }); test('function with parameter', () => { @@ -68,7 +68,7 @@ test('function with parameter', () => { //// `; - testIndentation(code, 4); + testIndentation(code, 6); }); test('call with open paren at end of file', () => { @@ -110,7 +110,7 @@ test('call with parameter', () => { //// `; - testIndentation(code, 4); + testIndentation(code, 2); }); test('list', () => { @@ -130,7 +130,7 @@ test('list with spaces', () => { //// `; - testIndentation(code, 17); + testIndentation(code, 8); }); test('list with nested', () => { @@ -150,7 +150,7 @@ test('list with spaces and element', () => { //// `; - testIndentation(code, 17); + testIndentation(code, 10); }); test('list with nested with element', () => { @@ -160,7 +160,7 @@ test('list with nested with element', () => { //// `; - testIndentation(code, 4); + testIndentation(code, 7); }); test('set', () => { @@ -213,10 +213,10 @@ test('nested list in dict', () => { //// `; - testIndentation(code, 4); + testIndentation(code, 5); }); -test('nested list in dict', () => { +test('nested list in dict 2', () => { const code = ` //// abc = {'x': [ //// ['''str''', @@ -259,7 +259,7 @@ test('dict first key with list', () => { //// `; - testIndentation(code, 6); + testIndentation(code, 4); }); test('dict key list element on its own line', () => { @@ -311,7 +311,7 @@ test('explicit multiline expression', () => { //// `; - testIndentation(code, 8); + testIndentation(code, 4); }); test('explicit multiline expression next statement', () => { @@ -383,6 +383,6 @@ function testIndentation(code: string, indentation: number, preferDedent?: boole const marker = state.getMarkerByName('marker'); const parseResults = state.program.getBoundSourceFile(marker.fileName)!.getParseResults()!; - const actual = getIndentation(parseResults, marker.position, preferDedent); + const actual = getNewlineIndentation(parseResults, marker.position, preferDedent); assert.strictEqual(actual, indentation); } diff --git a/packages/pyright-internal/src/tests/indentationUtils.reindent.test.ts b/packages/pyright-internal/src/tests/indentationUtils.reindent.test.ts index 417b1b517..586b1a423 100644 --- a/packages/pyright-internal/src/tests/indentationUtils.reindent.test.ts +++ b/packages/pyright-internal/src/tests/indentationUtils.reindent.test.ts @@ -387,6 +387,33 @@ test('re-indentation tab on multiline text', () => { testIndentation(code, 2, expected); }); +test('dont include token not contained in the span', () => { + const code = ` +//// import random +//// +//// [|/*marker*/answer_word = random.choice(["a","b","c","d"]) +//// |]guess_word = "c" + `; + + const expected = `answer_word = random.choice(["a","b","c","d"])`; + + testIndentation(code, 0, expected); +}); + +test('handle comment before first token', () => { + const code = ` +//// [|/*marker*/# this function doesn't do much +//// def myfunc(a, b): +//// return a + b|] + `; + + const expected = `# this function doesn't do much +def myfunc(a, b): + return a + b`; + + testIndentation(code, 0, expected); +}); + function testIndentation(code: string, indentation: number, expected: string, indentFirstToken = true) { const state = parseAndGetTestState(code).state; const range = state.getRangeByMarkerName('marker')!; @@ -397,7 +424,7 @@ function testIndentation(code: string, indentation: number, expected: string, in TextRange.fromBounds(range.pos, range.end), indentation, indentFirstToken - ); + ).text; assert.strictEqual(actual, expected); } diff --git a/packages/pyright-internal/src/tests/indentationUtils.test.ts b/packages/pyright-internal/src/tests/indentationUtils.test.ts index c9121be1f..afcc42c02 100644 --- a/packages/pyright-internal/src/tests/indentationUtils.test.ts +++ b/packages/pyright-internal/src/tests/indentationUtils.test.ts @@ -8,7 +8,7 @@ import assert from 'assert'; -import { getIndentation } from '../languageService/indentationUtils'; +import { getNewlineIndentation } from '../languageService/indentationUtils'; import { parseAndGetTestState } from './harness/fourslash/testState'; test('top level indentation', () => { @@ -354,14 +354,14 @@ test('explicit multiline construct', () => { //// `; - testIndentation(code, 4); + testIndentation(code, 0); }); test('multiple explicit multiline construct', () => { const code = ` //// def foo \\ -//// \\ -//// [|/*marker*/|] +//// \\[|/*marker*/|] +//// //// `; @@ -376,7 +376,7 @@ test('explicit multiline expression', () => { //// `; - testIndentation(code, 8); + testIndentation(code, 4); }); test('explicit multiline expression between lines', () => { @@ -387,7 +387,7 @@ test('explicit multiline expression between lines', () => { //// b = 1 `; - testIndentation(code, 8); + testIndentation(code, 4); }); test('implicit multiline constructs', () => { @@ -396,7 +396,7 @@ test('implicit multiline constructs', () => { //// [|/*marker*/|] `; - testIndentation(code, 4); + testIndentation(code, 8); }); test('multiple implicit multiline constructs', () => { @@ -432,6 +432,16 @@ test('multiline list', () => { testIndentation(code, 7); }); +test('empty multiline list', () => { + const code = ` +//// a = [ +//// [|/*marker*/|] +//// ] + `; + + testIndentation(code, 4); +}); + test('unfinished block', () => { const code = ` //// def foo(a: Union[int, str]): @@ -445,11 +455,130 @@ test('unfinished block', () => { testIndentation(code, 8); }); +test('func params', () => { + const code = ` +//// def foo_bar( +//// [|/*marker*/|]var1, var2): +//// pass + `; + + testIndentation(code, 8); +}); + +test('func params 2', () => { + const code = ` +//// def foo_bar(var1, +//// [|/*marker*/|]var2): +//// pass + `; + + testIndentation(code, 12); +}); + +test('func params call', () => { + const code = ` +//// def foo_bar(var1, var2): +//// pass +//// a = foo_bar( +//// [|/*marker*/|]var1, var2) + `; + + testIndentation(code, 4); +}); + +test('nested func params call', () => { + const code = ` +//// def foo_bar(var1, var2): +//// print( +//// [|/*marker*/|]var1) + `; + + testIndentation(code, 8); +}); + +test('nested func params call 2', () => { + const code = ` +//// def foo_bar(var1, var2): +//// print(var1, +//// [|/*marker*/|]var1) + `; + + testIndentation(code, 10); +}); + +test('class func params', () => { + const code = ` +//// class Test(): +//// def foo_bar(self, var1, var2): +//// print(var1, +//// [|/*marker*/|]var1) + `; + + testIndentation(code, 14); +}); + +test('nested closures', () => { + const code = ` +//// import pytest +//// +//// class TestStuff: +//// @pytest.mark.parametrize( +//// ["given", "expected"], +//// [ +//// ("A", ["A"]), +//// ("A ", ["A"]), +//// (" A", ["A"]), +//// [|/*marker*/|] +//// ("A, B", ["A", "B"]), +//// ("A,B", ["A", "B"]), +//// (" A, B", ["A", "B"]), +//// ("A B", ["A B"]), +//// ], +//// ) +//// def test(given, expected): +//// pass + `; + + testIndentation(code, 16); +}); + +test('nested closures 2', () => { + const code = ` +//// import pytest +//// +//// class TestStuff: +//// @pytest.mark.parametrize( +//// ["given", "expected"] +//// [|/*marker*/|] +//// ) +//// def test(given, expected): +//// pass + `; + + testIndentation(code, 8); +}); + +test('nested closures 3', () => { + const code = ` +//// import pytest +//// +//// class TestStuff: +//// @pytest.mark.parametrize( +//// ["given", "expected" +//// [|/*marker*/|] +//// ) +//// def test(given, expected): +//// pass + `; + + testIndentation(code, 9); +}); + function testIndentation(code: string, indentation: number, preferDedent?: boolean) { const state = parseAndGetTestState(code).state; const marker = state.getMarkerByName('marker'); const parseResults = state.program.getBoundSourceFile(marker.fileName)!.getParseResults()!; - const actual = getIndentation(parseResults, marker.position, preferDedent); + const actual = getNewlineIndentation(parseResults, marker.position, preferDedent); assert.strictEqual(actual, indentation); } diff --git a/packages/pyright-internal/src/tests/insertionPointUtils.test.ts b/packages/pyright-internal/src/tests/insertionPointUtils.test.ts index 9318df8fd..f819d87e5 100644 --- a/packages/pyright-internal/src/tests/insertionPointUtils.test.ts +++ b/packages/pyright-internal/src/tests/insertionPointUtils.test.ts @@ -12,6 +12,34 @@ import { normalizeSlashes } from '../common/pathUtils'; import { getInsertionPointForSymbolUnderModule, InsertionOptions } from '../languageService/insertionPointUtils'; import { parseAndGetTestState } from './harness/fourslash/testState'; +test('empty file', () => { + const code = ` +//// [|/*marker*/|] + `; + + testInsertionPoint(code, 'bar'); +}); + +test('empty file with blank lines', () => { + const code = ` +//// [|/*marker*/|] +//// +//// + `; + + testInsertionPoint(code, 'bar'); +}); + +test('empty file with comments', () => { + const code = ` +//// # comment +//// [|/*marker*/|] +//// + `; + + testInsertionPoint(code, 'bar'); +}); + test('insert symbol to module', () => { const code = ` //// def foo(): pass[|/*marker*/|] @@ -67,20 +95,78 @@ test('insert symbol with imported symbol with same name', () => { }); }); -function testInsertionPoint(code: string, symbolName: string, options?: InsertionOptions) { +test('insert symbol with before marker at the top', () => { + const code = ` +//// [|/*marker*/|] +//// [|/*before*/|] + `; + + testInsertionPoint(code, 'path', { + insertBeforeMarker: 'before', + }); +}); + +test('insert symbol with before marker at the top before symbols', () => { + const code = ` +//// [|/*marker*/|]def [|/*before*/|]foo(): +//// pass + `; + + testInsertionPoint(code, 'path', { + insertBeforeMarker: 'before', + }); +}); + +test('insert symbol with before marker at the top before symbols 2', () => { + const code = ` +//// [|/*marker*/|]def foo(a: [|/*before*/|]MyType): +//// pass + `; + + testInsertionPoint(code, 'path', { + insertBeforeMarker: 'before', + }); +}); + +test('insert symbol before insert marker with other statements', () => { + const code = ` +//// import os[|/*marker*/|] +//// +//// def [|/*before*/|]foo(): +//// pass + `; + + testInsertionPoint(code, 'path', { + insertBeforeMarker: 'before', + }); +}); + +function testInsertionPoint( + code: string, + symbolName: string, + testOptions?: { symbolDeclToIgnore?: string; insertBeforeMarker?: string } +) { const state = parseAndGetTestState(code).state; const marker = state.getMarkerByName('marker'); + const insertBefore = testOptions?.insertBeforeMarker + ? state.getMarkerByName(testOptions.insertBeforeMarker).position + : undefined; + + const options: InsertionOptions = { + symbolDeclToIgnore: testOptions?.symbolDeclToIgnore, + insertBefore, + }; const parseResults = state.program.getBoundSourceFile(marker.fileName)!.getParseResults()!; const actual = getInsertionPointForSymbolUnderModule(state.program.evaluator!, parseResults, symbolName, options); assert.strictEqual(actual, marker.position); } -function testNoInsertionPoint(code: string, symbolName: string, options?: InsertionOptions) { +function testNoInsertionPoint(code: string, symbolName: string) { const state = parseAndGetTestState(code).state; const marker = state.getMarkerByName('marker'); const parseResults = state.program.getBoundSourceFile(marker.fileName)!.getParseResults()!; - const actual = getInsertionPointForSymbolUnderModule(state.program.evaluator!, parseResults, symbolName, options); + const actual = getInsertionPointForSymbolUnderModule(state.program.evaluator!, parseResults, symbolName); assert(!actual); } diff --git a/packages/pyright-internal/src/tests/ipythonMode.test.ts b/packages/pyright-internal/src/tests/ipythonMode.test.ts index 1c47f8a8b..6e9631940 100644 --- a/packages/pyright-internal/src/tests/ipythonMode.test.ts +++ b/packages/pyright-internal/src/tests/ipythonMode.test.ts @@ -9,6 +9,7 @@ import assert from 'assert'; import { CompletionItemKind, MarkupKind } from 'vscode-languageserver-types'; +import { DiagnosticRule } from '../common/diagnosticRules'; import { TextRange } from '../common/textRange'; import { TextRangeCollection } from '../common/textRangeCollection'; import { Localizer } from '../localization/localize'; @@ -216,6 +217,41 @@ test('ipython multiple magics 2', () => { testIPython(code); }); +test('ipython cell magic', () => { + const code = ` +// @ipythonMode: true +//// def foo(): ... +//// [|/*marker*/%%cell magic +//// random text +//// and more|] + `; + + testIPython(code); +}); + +test('ipython cell shell escape', () => { + const code = ` +// @ipythonMode: true +//// def foo(): ... +//// [|/*marker*/!!cell shell escape +//// random text +//// and more|] + `; + + testIPython(code); +}); + +test('ipython wrong magic', () => { + const code = ` +// @ipythonMode: true +//// def foo(): +//// [|/*marker*/%!not cell magic|] +//// ... + `; + + testIPython(code); +}); + test('top level await raises errors in regular mode', () => { const code = ` //// async def foo(): @@ -270,6 +306,121 @@ test('await still raises errors when used in wrong context in ipython mode', () assert(diagnostics?.some((d) => d.message === Localizer.Diagnostic.awaitNotInAsync())); }); +test('top level async for raises errors in regular mode', () => { + const code = ` +//// async def b(): +//// for i in range(5): +//// yield i +//// +//// [|/*marker*/async for x in b():|] +//// print("") + `; + + const state = parseAndGetTestState(code).state; + const range = state.getRangeByMarkerName('marker')!; + + const source = state.program.getBoundSourceFile(range.fileName)!; + const diagnostics = source.getDiagnostics(state.configOptions); + + assert(diagnostics?.some((d) => d.message === Localizer.Diagnostic.asyncNotInAsyncFunction())); +}); + +test('top level async for raises no errors in ipython mode', () => { + const code = ` +// @ipythonMode: true +//// async def b(): +//// for i in range(5): +//// yield i +//// +//// [|/*marker*/async for x in b():|] +//// print("") + `; + + const state = parseAndGetTestState(code).state; + const range = state.getRangeByMarkerName('marker')!; + + const source = state.program.getBoundSourceFile(range.fileName)!; + const diagnostics = source.getDiagnostics(state.configOptions); + + assert(!diagnostics?.some((d) => d.message === Localizer.Diagnostic.asyncNotInAsyncFunction())); +}); + +test('top level async for in list comprehension raises errors in regular mode', () => { + const code = ` +//// async def b(): +//// for i in range(5): +//// yield i +//// +//// y = [|/*marker*/[x async for x in b()]|] + `; + + const state = parseAndGetTestState(code).state; + const range = state.getRangeByMarkerName('marker')!; + + const source = state.program.getBoundSourceFile(range.fileName)!; + const diagnostics = source.getDiagnostics(state.configOptions); + + assert(diagnostics?.some((d) => d.message === Localizer.Diagnostic.asyncNotInAsyncFunction())); +}); + +test('top level async for in list comprehension raises no errors in ipython mode', () => { + const code = ` +// @ipythonMode: true +//// async def b(): +//// for i in range(5): +//// yield i +//// +//// y = [|/*marker*/[x async for x in b()]|] + `; + + const state = parseAndGetTestState(code).state; + const range = state.getRangeByMarkerName('marker')!; + + const source = state.program.getBoundSourceFile(range.fileName)!; + const diagnostics = source.getDiagnostics(state.configOptions); + + assert(!diagnostics?.some((d) => d.message === Localizer.Diagnostic.asyncNotInAsyncFunction())); +}); + +test('top level async with raises errors in regular mode', () => { + const code = ` +//// from contextlib import AsyncExitStack +//// +//// cm = AsyncExitStack() +//// +//// [|/*marker*/async with cm:|] +//// pass + `; + + const state = parseAndGetTestState(code).state; + const range = state.getRangeByMarkerName('marker')!; + + const source = state.program.getBoundSourceFile(range.fileName)!; + const diagnostics = source.getDiagnostics(state.configOptions); + + assert(diagnostics?.some((d) => d.message === Localizer.Diagnostic.asyncNotInAsyncFunction())); +}); + +test('top level async with raises no errors in ipython mode', () => { + const code = ` +// @ipythonMode: true +//// from contextlib import AsyncExitStack +//// +//// cm = AsyncExitStack() +//// +//// [|/*marker*/async with cm:|] +//// pass + `; + + const state = parseAndGetTestState(code).state; + const range = state.getRangeByMarkerName('marker')!; + + const source = state.program.getBoundSourceFile(range.fileName)!; + const diagnostics = source.getDiagnostics(state.configOptions); + + assert(!diagnostics?.some((d) => d.message === Localizer.Diagnostic.asyncNotInAsyncFunction())); +}); + test('try implicitly load ipython display module but fail', async () => { const code = ` // @ipythonMode: true @@ -324,24 +475,71 @@ test('implicitly load ipython display module', async () => { }); }); +test('magics at the end', async () => { + const code = ` +// @filename: test.py +// @ipythonMode: true +//// from random import random +//// def estimate_pi(n=1e7) -> "area": +//// """Estimate pi with monte carlo simulation. +//// +//// Arguments: +//// n: number of simulations +//// """ +//// in_circle = 0 +//// total = n +//// +//// while n != 0: +//// prec_x = random() +//// prec_y = random() +//// if pow(prec_x, 2) + pow(prec_y, 2) <= 1: +//// in_circle += 1 # inside the circle +//// n -= 1 +//// +//// return 4 * in_circle / total +//// +//// [|/*marker*/%time estimate_pi()|] + `; + + testIPython(code); +}); + function testIPython(code: string, expectMagic = true) { const state = parseAndGetTestState(code).state; const range = state.getRangeByMarkerName('marker')!; const results = state.program.getBoundSourceFile(range.fileName)!.getParseResults()!; - const comment = findCommentByOffset(results.tokenizerOutput.tokens, range.pos + 1); + const text = results.text.substring(range.pos, range.end); + const type = getCommentType(text); + + const offset = type === CommentType.IPythonMagic || type === CommentType.IPythonShellEscape ? 1 : 2; + const comment = findCommentByOffset(results.tokenizerOutput.tokens, range.pos + offset); if (!expectMagic) { assert(!comment); return; } assert(comment); - const text = results.text.substring(range.pos, range.end); - const type = text[0] === '%' ? CommentType.IPythonMagic : CommentType.IPythonShellEscape; assert.strictEqual(type, comment.type); - assert.strictEqual(text.substring(1), comment.value); + assert.strictEqual(text.substring(offset), comment.value); +} + +function getCommentType(text: string) { + assert(text.length > 0); + + const type = text[0] === '%' ? CommentType.IPythonMagic : CommentType.IPythonShellEscape; + if (text.length === 1) { + return type; + } + + switch (type) { + case CommentType.IPythonMagic: + return text[1] === '%' ? CommentType.IPythonCellMagic : type; + case CommentType.IPythonShellEscape: + return text[1] === '!' ? CommentType.IPythonCellShellEscape : type; + } } function findCommentByOffset(tokens: TextRangeCollection, offset: number) { @@ -363,3 +561,51 @@ function findCommentByOffset(tokens: TextRangeCollection, offset: number) return comment; } + +test('unused expression at end is not error', async () => { + const code = ` +// @filename: test.py +// @ipythonMode: true +//// 4[|/*marker*/|] + `; + + verifyAnalysisDiagnosticCount(code, 0); +}); + +test('unused expression is error if not at end of cell', async () => { + const code = ` +// @filename: test.py +// @ipythonMode: true +//// 4[|/*marker*/|] +//// +//// x = 1 + `; + + verifyAnalysisDiagnosticCount(code, 1, DiagnosticRule.reportUnusedExpression); +}); + +test('unused expression is error if within another statement', async () => { + const code = ` +// @filename: test.py +// @ipythonMode: true +//// if True: +//// 4[|/*marker*/|] + `; + + verifyAnalysisDiagnosticCount(code, 1, DiagnosticRule.reportUnusedExpression); +}); + +function verifyAnalysisDiagnosticCount(code: string, expectedCount: number, expectedRule?: string) { + const state = parseAndGetTestState(code).state; + + state.analyze(); + + const range = state.getRangeByMarkerName('marker')!; + const source = state.program.getBoundSourceFile(range.fileName)!; + const diagnostics = source.getDiagnostics(state.configOptions); + + assert.strictEqual(diagnostics?.length, expectedCount); + if (expectedRule) { + diagnostics.forEach((diagnostic) => assert.strictEqual(diagnostic.getRule(), expectedRule)); + } +} diff --git a/packages/pyright-internal/src/tests/logger.test.ts b/packages/pyright-internal/src/tests/logger.test.ts new file mode 100644 index 000000000..9a1efff6a --- /dev/null +++ b/packages/pyright-internal/src/tests/logger.test.ts @@ -0,0 +1,101 @@ +/* + * logger.test.ts + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT license. + * + * Unit tests for logger. + */ + +import * as assert from 'assert'; + +import { ConfigOptions } from '../common/configOptions'; +import { ConsoleInterface, ConsoleWithLogLevel, LogLevel } from '../common/console'; +import { test_setDebugMode } from '../common/core'; +import { timingStats } from '../common/timing'; +import * as TestUtils from './testUtils'; + +class TestConsole implements ConsoleInterface { + errors: string[] = []; + warnings: string[] = []; + infos: string[] = []; + logs: string[] = []; + + error(message: string): void { + this.errors.push(message); + } + warn(message: string): void { + this.warnings.push(message); + } + info(message: string): void { + this.infos.push(message); + } + log(message: string): void { + this.logs.push(message); + } + + clear() { + this.logs = []; + this.errors = []; + this.warnings = []; + this.infos = []; + } +} + +describe('TypeEvaluatorWithTracker tests', () => { + const consoleInterface = new TestConsole(); + const console = new ConsoleWithLogLevel(consoleInterface); + const config = new ConfigOptions('.'); + + beforeEach(() => { + consoleInterface.clear(); + }); + afterEach(() => { + consoleInterface.clear(); + timingStats.typeEvaluationTime.callCount = 0; + }); + test('Log generated', () => { + config.logTypeEvaluationTime = true; + console.level = LogLevel.Log; + + TestUtils.typeAnalyzeSampleFiles(['badToken1.py'], config, console); + assert.ok(consoleInterface.logs.length > 10, `No calls logged`); + assert.ok( + consoleInterface.logs.some((s) => s.includes('evaluateTypesForStatement')), + `Inner evaluateTypesForStatement not found` + ); + }); + + test('Log not generated when level is error', () => { + config.logTypeEvaluationTime = true; + console.level = LogLevel.Error; + + TestUtils.typeAnalyzeSampleFiles(['badToken1.py'], config, console); + assert.equal(consoleInterface.logs.length, 0, `Should not have any logs when logging level is error`); + }); + + test('Inner log not generated when eval is turned off', () => { + config.logTypeEvaluationTime = false; + console.level = LogLevel.Log; + TestUtils.typeAnalyzeSampleFiles(['badToken1.py'], config, console); + assert.equal( + consoleInterface.logs.some((s) => s.includes('evaluateTypesForStatement')), + false, + `Inner evaluateTypesForStatement is being logged when it shouldnt` + ); + assert.ok( + timingStats.typeEvaluationTime.callCount > 1, + `Should be tracking timing when not logging but not debugging` + ); + }); + + test('Timing is not captured in debug mode', () => { + const oldValue = test_setDebugMode(true); + + config.logTypeEvaluationTime = false; + console.level = LogLevel.Log; + TestUtils.typeAnalyzeSampleFiles(['badToken1.py'], config, console); + assert.equal(timingStats.typeEvaluationTime.callCount, 0, `Should not be tracking call counts when debugging`); + + test_setDebugMode(oldValue); + }); +}); diff --git a/packages/pyright-internal/src/tests/moveSymbol.importAdder.test.ts b/packages/pyright-internal/src/tests/moveSymbol.importAdder.test.ts new file mode 100644 index 000000000..d5cd3979d --- /dev/null +++ b/packages/pyright-internal/src/tests/moveSymbol.importAdder.test.ts @@ -0,0 +1,340 @@ +/* + * moveSymbol.importAdder.test.ts + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT license. + * + * importAdder tests around move symbol. + */ + +import { parseAndGetTestState } from './harness/fourslash/testState'; +import { testMoveSymbolAtPosition } from './renameModuleTestUtils'; + +test('move imports used in the symbol', () => { + const code = ` +// @filename: test.py +//// [|{|"r":"!n!class MyType:!n! pass!n!!n!"|}from typing import List, Mapping +//// +//// class MyType: +//// pass +//// +//// def [|/*marker*/foo|](a: str, b: List[int]) -> None: +//// c: Mapping[str, MyType] = { 'hello', MyType() }|] + +// @filename: moved.py +//// [|{|"r":"from test import MyType!n!!n!!n!from typing import List, Mapping!n!!n!!n!def foo(a: str, b: List[int]) -> None:!n! c: Mapping[str, MyType] = { 'hello', MyType() }", "name": "dest"|}|] + `; + + testFromCode(code); +}); + +test('import with alias', () => { + const code = ` +// @filename: test.py +//// [|{|"r":"!n!class MyType:!n! pass!n!!n!"|}from typing import List as l, Mapping as m +//// +//// class MyType: +//// pass +//// +//// def [|/*marker*/foo|](a: str, b: l[int]) -> None: +//// c: m[str, MyType] = { 'hello', MyType() }|] + +// @filename: moved.py +//// [|{|"r":"from test import MyType!n!!n!!n!from typing import List as l, Mapping as m!n!!n!!n!def foo(a: str, b: l[int]) -> None:!n! c: m[str, MyType] = { 'hello', MyType() }", "name": "dest"|}|] + `; + + testFromCode(code); +}); + +test('with existing imports', () => { + const code = ` +// @filename: test.py +//// [|{|"r":"!n!class MyType:!n! pass!n!!n!"|}from typing import List, Mapping +//// +//// class MyType: +//// pass +//// +//// def [|/*marker*/foo|](a: str, b: List[int]) -> None: +//// c: Mapping[str, MyType] = { 'hello', MyType() }|] + +// @filename: moved.py +//// from typing import List, Mapping +//// from test import MyType[|{|"r":"!n!!n!!n!def foo(a: str, b: List[int]) -> None:!n! c: Mapping[str, MyType] = { 'hello', MyType() }", "name": "dest"|}|] + `; + + testFromCode(code); +}); + +test('merge with existing imports', () => { + const code = ` +// @filename: test.py +//// [|{|"r":"!n!class MyType:!n! pass!n!!n!class MyType2(MyType):!n! pass!n!!n!"|}from typing import List, Mapping +//// +//// class MyType: +//// pass +//// +//// class MyType2(MyType): +//// pass +//// +//// def [|/*marker*/foo|](a: str, b: List[int]) -> None: +//// c: Mapping[str, MyType] = { 'hello', MyType2() }|] + +// @filename: moved.py +//// [|{|"r":"from typing import List, Mapping!n!from test import MyType, MyType2!n!m = MyType()!n!!n!!n!def foo(a: str, b: List[int]) -> None:!n! c: Mapping[str, MyType] = { 'hello', MyType2() }", "name": "dest"|}from typing import Mapping +//// from test import MyType +//// m = MyType()|] + `; + + testFromCode(code); +}); + +test('merge with existing moving symbol imports', () => { + const code = ` +// @filename: test.py +//// [|{|"r":"!n!class MyType:!n! pass!n!!n!"|}from typing import List, Mapping +//// +//// class MyType: +//// pass +//// +//// def [|/*marker*/foo|](a: str, b: List[int]) -> None: +//// c: Mapping[str, MyType] = { 'hello', MyType() }|] + +// @filename: moved.py +//// from typing import List, Mapping +//// from test import [|{|"r":""|}foo, |]MyType[|{|"r":"!n!!n!!n!def foo(a: str, b: List[int]) -> None:!n! c: Mapping[str, MyType] = { 'hello', MyType() }", "name": "dest"|}|] +//// +//// foo() + `; + + testFromCode(code); +}); + +test('merge with existing moving symbol imports and add new one', () => { + const code = ` +// @filename: test.py +//// [|{|"r":"!n!class MyType:!n! pass!n!!n!"|}from typing import List, Mapping +//// +//// class MyType: +//// pass +//// +//// def [|/*marker*/foo|](a: str, b: List[int]) -> None: +//// c: Mapping[str, MyType] = { 'hello', MyType() }|] + +// @filename: moved.py +//// [|{|"r":"from typing import List, Mapping!n!!n!from test import MyType!n!!n!!n!def foo(a: str, b: List[int]) -> None:!n! c: Mapping[str, MyType] = { 'hello', MyType() }!n!!n!foo()", "name": "dest"|}from typing import List, Mapping +//// from test import foo +//// +//// foo()|] + `; + + testFromCode(code); +}); + +test('symbol from destination file used', () => { + const code = ` +// @filename: test.py +//// [|{|"r":"!n!"|}from moved import MyType +//// +//// def [|/*marker*/foo|](a: MyType) -> None: +//// c: Mapping[str, MyType] = { 'hello', a }|] + +// @filename: moved.py +//// class MyType: +//// pass[|{|"r":"!n!!n!!n!def foo(a: MyType) -> None:!n! c: Mapping[str, MyType] = { 'hello', a }", "name": "dest"|}|] +//// + `; + + testFromCode(code); +}); + +test('insert after all symbols references', () => { + const code = ` +// @filename: test.py +//// [|{|"r":"!n!"|}from moved import MyType +//// +//// def [|/*marker*/foo|](a: MyType) -> None: +//// c: Mapping[str, MyType] = { 'hello', a }|] + +// @filename: moved.py +//// [|{|"r":""|}from test import foo +//// |] +//// class MyType: +//// pass[|{|"r":"!n!!n!!n!def foo(a: MyType) -> None:!n! c: Mapping[str, MyType] = { 'hello', a }", "name": "dest"|}|] +//// +//// foo() + `; + + testFromCode(code); +}); + +test('insert after all symbols references 2', () => { + const code = ` +// @filename: test.py +//// [|{|"r":"!n!"|}from moved import MyType +//// +//// def [|/*marker*/foo|](a: MyType) -> None: +//// c: Mapping[str, MyType] = { 'hello', a }|] + +// @filename: moved.py +//// def __privateFoo(): +//// pass +//// +//// class MyType: +//// pass[|{|"r":"!n!!n!!n!def foo(a: MyType) -> None:!n! c: Mapping[str, MyType] = { 'hello', a }", "name": "dest"|}|] + `; + + testFromCode(code); +}); + +test('symbol used before all symbol references', () => { + const code = ` +// @filename: test.py +//// [|{|"r":"!n!"|}from moved import MyType +//// +//// def [|/*marker*/foo|](a: MyType) -> None: +//// c: Mapping[str, MyType] = { 'hello', a }|] + +// @filename: moved.py +//// [|{|"r":""|}from test import foo[|{|"r":"!n!!n!!n!def foo(a: MyType) -> None:!n! c: Mapping[str, MyType] = { 'hello', a }", "name": "dest"|}|] +//// |] +//// foo() +//// +//// class MyType: +//// pass + `; + + testFromCode(code); +}); + +test('symbol with import statements', () => { + const code = ` +// @filename: test.py +//// [|{|"r": "import sys!n!!n!"|}import os, os.path, sys +//// +//// def [|/*marker*/foo|](): +//// p = os.path.curdir +//// os.abort()|] + +// @filename: moved.py +//// [|{|"r": "import os!n!import os.path!n!!n!!n!def foo():!n! p = os.path.curdir!n! os.abort()", "name": "dest"|}|] + `; + + testFromCode(code); +}); + +test('symbol with import statements with alias', () => { + const code = ` +// @filename: test.py +//// [|{|"r": "import sys!n!!n!"|}import os, os.path as path, sys +//// +//// def [|/*marker*/foo|](): +//// p = path.curdir +//// os.abort()|] + +// @filename: moved.py +//// [|{|"r": "import os!n!import os.path as path!n!!n!!n!def foo():!n! p = path.curdir!n! os.abort()", "name": "dest"|}|] + `; + + testFromCode(code); +}); + +test('symbol with import statements with alias 2', () => { + const code = ` +// @filename: test.py +//// [|{|"r": "import sys!n!!n!"|}import os, os.path as p1, sys +//// +//// def [|/*marker*/foo|](): +//// p = p1.curdir +//// os.abort()|] + +// @filename: moved.py +//// [|{|"r": "import os!n!import os.path as p1!n!!n!!n!def foo():!n! p = p1.curdir!n! os.abort()", "name": "dest"|}|] + `; + + testFromCode(code); +}); + +test('symbol with import statements with multiple unused imports', () => { + const code = ` +// @filename: test.py +//// [|{|"r": "import os.path, sys!n!!n!"|}import os, os.path, sys +//// +//// def [|/*marker*/foo|](): +//// os.abort()|] + +// @filename: moved.py +//// [|{|"r": "import os!n!!n!!n!def foo():!n! os.abort()", "name": "dest"|}|] + `; + + testFromCode(code); +}); + +test('symbol with import statements with used imports', () => { + const code = ` +// @filename: test.py +//// [|{|"r": "import os.path as path, sys!n!!n!p = path.curdir!n!!n!"|}import os, os.path as path, sys +//// +//// p = path.curdir +//// +//// def [|/*marker*/foo|](): +//// p = path.curdir +//// os.abort()|] + +// @filename: moved.py +//// [|{|"r": "import os!n!import os.path as path!n!!n!!n!def foo():!n! p = path.curdir!n! os.abort()", "name": "dest"|}|] + `; + + testFromCode(code); +}); + +test('symbol with invalid import', () => { + const code = ` +// @filename: test.py +//// import notExist +//// +//// p = notExist.fooStr +//// +//// [|{|"r": ""|}def [|/*marker*/foo|](): +//// p = notExist.fooStr|] + +// @filename: moved.py +//// [|{|"r": "def foo():!n! p = notExist.fooStr", "name": "dest"|}|] + `; + + testFromCode(code, true); +}); + +test('symbol with import with error', () => { + const code = ` +// @filename: test.py +//// #pyright: strict +//// import lib # should have no stub diagnostic +//// +//// lib.bar() +//// +//// [|{|"r": ""|}def [|/*marker*/foo|](): +//// p = lib.bar()|] + +// @filename: lib/__init__.py +// @library: true +//// def bar(): pass + +// @filename: moved.py +//// [|{|"r": "import lib!n!!n!!n!def foo():!n! p = lib.bar()", "name": "dest"|}|] + `; + + testFromCode(code, true); +}); + +function testFromCode(code: string, expectsMissingImport = false) { + const state = parseAndGetTestState(code).state; + + testMoveSymbolAtPosition( + state, + state.getMarkerByName('marker').fileName, + state.getMarkerByName('dest').fileName, + state.getPositionRange('marker').start, + undefined, + undefined, + expectsMissingImport + ); +} diff --git a/packages/pyright-internal/src/tests/moveSymbol.insertion.test.ts b/packages/pyright-internal/src/tests/moveSymbol.insertion.test.ts new file mode 100644 index 000000000..89f297bc8 --- /dev/null +++ b/packages/pyright-internal/src/tests/moveSymbol.insertion.test.ts @@ -0,0 +1,575 @@ +/* + * moveSymbol.trivia.test.ts + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT license. + * + * Tests around how moveSymbol handles whitespace/blank lines/comments around + * symbol that is moved. + */ + +import assert from 'assert'; +import { CancellationToken } from 'vscode-languageserver'; + +import { ImportFormat } from '../languageService/autoImporter'; +import { parseAndGetTestState } from './harness/fourslash/testState'; +import { testMoveSymbolAtPosition } from './renameModuleTestUtils'; + +test('single symbol with trailing whitespace', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): +//// pass +//// |] +//// + +// @filename: moved.py +//// [|{|"r":"def foo():!n! pass", "name": "dest"|}|] + `; + + testFromCode(code); +}); + +test('begining of a file with other symbols below', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): +//// pass +//// +//// |]def nextFoo(): +//// pass + +// @filename: moved.py +//// [|{|"r":"def foo():!n! pass", "name": "dest"|}|] + `; + + testFromCode(code); +}); + +test('at the end of a file with other symbols above', () => { + const code = ` +// @filename: test.py +//// def beforeFoo(): +//// pass +//// +//// [|{|"r":""|}def [|/*marker*/foo|](): +//// pass|] + +// @filename: moved.py +//// [|{|"r":"def foo():!n! pass", "name": "dest"|}|] + `; + + testFromCode(code); +}); + +test('between symbols', () => { + const code = ` +// @filename: test.py +//// def beforeFoo(): +//// pass +//// +//// [|{|"r":""|}def [|/*marker*/foo|](): +//// pass +//// +//// +//// |]def afterFoo(): +//// pass +//// + +// @filename: moved.py +//// [|{|"r":"def foo():!n! pass", "name": "dest"|}|] + `; + + testFromCode(code); +}); + +test('insert to empty file', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): +//// pass|] + +// @filename: moved.py +//// [|{|"r":"def foo():!n! pass", "name": "dest"|}|] + `; + + testFromCode(code); +}); + +test('insert to empty file with blank lines', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): +//// pass|] + +// @filename: moved.py +//// [|{|"r":"def foo():!n! pass", "name": "dest"|}|] +//// +//// + `; + + testFromCode(code); +}); + +test('insert to empty file with comments', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): +//// pass|] + +// @filename: moved.py +//// # comment +//// [|{|"r":"!n!!n!!n!def foo():!n! pass", "name": "dest"|}|] + `; + + testFromCode(code); +}); + +test('insert to empty file with comments and blank lines', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): +//// pass|] + +// @filename: moved.py +//// # comment +//// [|{|"r":"!n!!n!def foo():!n! pass", "name": "dest"|}|] +//// + `; + + testFromCode(code); +}); + +test('insert after other symbol', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): +//// pass|] + +// @filename: moved.py +//// def beforeFoo(): +//// pass[|{|"r":"!n!!n!!n!def foo():!n! pass", "name": "dest"|}|] + `; + + testFromCode(code); +}); + +test('insert between symbols', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): +//// pass|] + +// @filename: moved.py +//// def beforeFoo(): +//// pass[|{|"r":"!n!!n!!n!def foo():!n! pass", "name": "dest"|}|] +//// +//// def __privateFunc(): +//// pass + `; + + testFromCode(code); +}); + +test('no insert with conflicting name', () => { + const code = ` +// @filename: test.py +//// def [|/*marker*/foo|](): +//// pass + +// @filename: moved.py +//// # same name already exist +//// [|/*dest*/|] +//// def foo(): +//// pass + `; + + const state = parseAndGetTestState(code).state; + + const actions = state.program.moveSymbolAtPosition( + state.getMarkerByName('marker').fileName, + state.getMarkerByName('dest').fileName, + state.getPositionRange('marker').start, + { importFormat: ImportFormat.Absolute }, + CancellationToken.None + ); + assert(!actions); +}); + +test('insert to a file with same symbol imported without alias', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): +//// pass|] + +// @filename: moved.py +//// [|{|"r":""|}from test import foo +//// |]import os[|{|"r":"!n!!n!!n!def foo():!n! pass", "name": "dest"|}|] + `; + + testFromCode(code); +}); + +test('insert to a file with same symbol imported with multiple symbol imports', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): +//// pass +//// +//// |]def bar(): +//// pass + +// @filename: moved.py +//// from test import bar[|{|"r":""|}, foo|][|{|"r":"!n!!n!!n!def foo():!n! pass", "name": "dest"|}|] + `; + + testFromCode(code); +}); + +test('insert to a file with same symbol used off import', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): +//// pass|] + +// @filename: moved.py +//// [|{|"r":""|}import test +//// |]import os[|{|"r":"!n!!n!!n!def foo():!n! pass", "name": "dest"|}|] +//// +//// [|{|"r":""|}test.|]foo() + `; + + testFromCode(code); +}); + +test('insert to a file with same symbol used off import with edit merge', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): +//// pass|] + +// @filename: moved.py +//// [|{|"r":""|}import test[|{|"r":"!n!!n!!n!def foo():!n! pass", "name": "dest"|}|] +//// |] +//// +//// [|{|"r":""|}test.|]foo() + `; + + testFromCode(code); +}); + +test('insert to a file with same symbol used off import with alias', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): +//// pass|] + +// @filename: moved.py +//// [|{|"r":""|}import test as t +//// |]import os[|{|"r":"!n!!n!!n!def foo():!n! pass", "name": "dest"|}|] +//// +//// [|{|"r":""|}t.|]foo() + + `; + testFromCode(code); +}); + +test('insert to a file with same symbol used off import with other symbols', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): +//// pass +//// +//// |]def bar(): +//// pass + +// @filename: moved.py +//// import test[|{|"r":"!n!!n!!n!def foo():!n! pass", "name": "dest"|}|] +//// +//// [|{|"r":""|}test.|]foo() +//// test.bar() + `; + + testFromCode(code); +}); + +test('insert to a file with same symbol used off from import', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): +//// pass|] + +// @filename: moved.py +//// [|{|"r":""|}from . import test +//// |]import os[|{|"r":"!n!!n!!n!def foo():!n! pass", "name": "dest"|}|] +//// +//// [|{|"r":""|}test.|]foo() + `; + + testFromCode(code); +}); + +test('insert to a file with same symbol imported with alias', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): +//// pass|] + +// @filename: moved.py +//// [|{|"r":""|}from test import foo as aliasFoo +//// |] +//// aliasFoo()[|{|"r":"!n!!n!def foo():!n! pass", "name": "dest"|}|] + `; + + testFromCode(code); +}); + +test('insert to a file with same symbol imported and used', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): +//// pass|] + +// @filename: moved.py +//// [|{|"r":""|}from test import foo +//// |]import os[|{|"r":"!n!!n!!n!def foo():!n! pass", "name": "dest"|}|] +//// +//// foo() + `; + + testFromCode(code); +}); + +test('insert to a file with same symbol used off import with alias and used', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): +//// pass +//// |]def bar(): +//// pass + +// @filename: moved.py +//// import test as t[|{|"r":"!n!!n!!n!def foo():!n! pass", "name": "dest"|}|] +//// +//// [|{|"r":""|}t.|]foo() +//// t.bar() + `; + + testFromCode(code); +}); + +test('insert import to original file for usage', () => { + const code = ` +// @filename: test.py +//// [|{|"r":"from moved import foo!n!!n!!n!"|}|][|{|"r":""|}def [|/*marker*/foo|](): +//// pass +//// |]foo() + +// @filename: moved.py +//// [|{|"r":"def foo():!n! pass", "name": "dest"|}|] + `; + + testFromCode(code); +}); + +test('insert import name to the existing import in the original file for usage', () => { + const code = ` +// @filename: test.py +//// from moved import bar[|{|"r":", foo"|}|] +//// +//// [|{|"r":""|}def [|/*marker*/foo|](): +//// pass +//// |]foo() + +// @filename: moved.py +//// def bar(): +//// pass[|{|"r":"!n!!n!!n!def foo():!n! pass", "name": "dest"|}|] + `; + + testFromCode(code); +}); + +test('original file has import for the symbol with alias', () => { + const code = ` +// @filename: test.py +//// from [|{|"r": "moved"|}test|] import foo as aliasFoo +//// +//// aliasFoo() +//// +//// [|{|"r":""|}def [|/*marker*/foo|](): +//// pass +//// |] + +// @filename: moved.py +//// [|{|"r":"def foo():!n! pass", "name": "dest"|}|] + `; + + testFromCode(code); +}); + +test('move after class', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): +//// pass +//// |] + +// @filename: moved.py +//// class A: +//// def foo(self): +//// pass[|{|"r":"!n!!n!!n!def foo():!n! pass", "name": "dest"|}|] + `; + + testFromCode(code); +}); + +test('move variable', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}[|/*marker*/A|] = 1|] + +// @filename: moved.py +//// [|{|"r":"A = 1", "name": "dest"|}|] + `; + + testFromCode(code); +}); + +test('move variable with doc string', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}[|/*marker*/A|] = 1 +//// ''' +//// doc string +//// '''|] + +// @filename: moved.py +//// [|{|"r":"A = 1!n!'''!n! doc string!n!'''", "name": "dest"|}|] + `; + + testFromCode(code); +}); + +test('move a variable with another variable next line', () => { + const code = ` +// @filename: test.py +//// [|{|"r":"!n!guess_word = 'c'"|}import random +//// +//// [|/*marker*/answer_word|] = random.choice(['a','b','c','d']) +//// guess_word = 'c'|] + +// @filename: moved.py +//// [|{|"r":"import random!n!!n!!n!answer_word = random.choice(['a','b','c','d'])", "name": "dest"|}|] + `; + + testFromCode(code); +}); + +test('Handle comments at the begining better 1', () => { + const code = ` +// @filename: test.py +//// # this function doesn't do much +//// [|{|"r":""|}def [|/*marker*/myfunc|](a, b): +//// return a + b|] + +// @filename: moved.py +//// [|{|"r":"def myfunc(a, b):!n! return a + b", "name": "dest"|}|] + `; + + testFromCode(code); +}); + +test('Handle comments at the begining better 2', () => { + const code = ` +// @filename: test.py +//// import os +//// +//// [|{|"r":""|}# this function doesn't do much +//// def [|/*marker*/myfunc|](a, b): +//// return a + b|] + +// @filename: moved.py +//// [|{|"r":"# this function doesn't do much!n!def myfunc(a, b):!n! return a + b", "name": "dest"|}|] + `; + + testFromCode(code); +}); + +test('variable with multiline expression', () => { + const code = ` +// @filename: test.py +//// [|{|"r":"!n!"|}from functools import partial +//// +//// [|/*marker*/sum1_2|] = partial(sum, +//// [1, +//// 2] +//// )|] + +// @filename: moved.py +//// [|{|"r":"from functools import partial!n!!n!!n!sum1_2 = partial(sum,!n![1,!n!2]!n!)", "name": "dest"|}|] + `; + + testFromCode(code); +}); + +test('multiple variables in a single line 1', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}[|/*marker*/a|] = 1; |]b = 1 + +// @filename: moved.py +//// [|{|"r":"a = 1;", "name": "dest"|}|] + `; + + testFromCode(code); +}); + +test('multiple variables in a single line 2', () => { + const code = ` +// @filename: test.py +//// a = 1;[|{|"r":""|}[|/*marker*/b|] = 2|] + +// @filename: moved.py +//// [|{|"r":"b = 2", "name": "dest"|}|] + `; + + testFromCode(code); +}); + +test('multiple variables in multiple lines 1', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}[|/*marker*/a|] = \\ +//// 1 + 2; |]b = 3 + \\ +//// 4 + +// @filename: moved.py +//// [|{|"r":"a = \\\\!n! 1 + 2;", "name": "dest"|}|] + `; + + testFromCode(code); +}); + +test('multiple variables in multiple lines 2', () => { + const code = ` +// @filename: test.py +//// a = \\ +//// 1 + 2; [|{|"r":""|}[|/*marker*/b|] = 3 + \\ +//// 4|] + +// @filename: moved.py +//// [|{|"r":"b = 3 + \\\\!n! 4", "name": "dest"|}|] + `; + + testFromCode(code); +}); + +function testFromCode(code: string) { + const state = parseAndGetTestState(code).state; + + testMoveSymbolAtPosition( + state, + state.getMarkerByName('marker').fileName, + state.getMarkerByName('dest').fileName, + state.getPositionRange('marker').start + ); +} diff --git a/packages/pyright-internal/src/tests/moveSymbol.misc.test.ts b/packages/pyright-internal/src/tests/moveSymbol.misc.test.ts new file mode 100644 index 000000000..356ff7e16 --- /dev/null +++ b/packages/pyright-internal/src/tests/moveSymbol.misc.test.ts @@ -0,0 +1,206 @@ +/* + * moveSymbol.misc.test.ts + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT license. + * + * Misc tests around move symbol. + */ + +import assert from 'assert'; +import { CancellationToken } from 'vscode-languageserver'; + +import { ImportFormat } from '../languageService/autoImporter'; +import { parseAndGetTestState } from './harness/fourslash/testState'; + +test('source and destnation file must have same ext', () => { + const code = ` +// @filename: test.py +//// def [|/*marker*/foo|](): pass + +// @filename: moved.pyi +//// [|/*dest*/|] + `; + + testNoMoveFromCode(code); +}); + +test('source and destnation file can not be same', () => { + const code = ` +// @filename: test.py +//// [|/*dest*/|]def [|/*marker*/foo|](): pass + `; + + testNoMoveFromCode(code); +}); + +test('Symbol must be module level symbol', () => { + const code = ` +// @filename: test.py +//// class A: +//// def [|/*marker*/foo|](self): pass + +// @filename: moved.py +//// [|/*dest*/|] + `; + + testNoMoveFromCode(code); +}); + +test('Import alias can not be moved', () => { + const code = ` +// @filename: test.py +//// import [|/*marker*/sys|] + +// @filename: moved.py +//// [|/*dest*/|] + `; + + testNoMoveFromCode(code); +}); + +test('Type alias can not be moved', () => { + const code = ` +// @filename: test.py +//// from typing import TypeAlias +//// [|/*marker*/TA|]: TypeAlias = int + +// @filename: moved.py +//// [|/*dest*/|] + `; + + testNoMoveFromCode(code); +}); + +test('TypeVar can not be moved', () => { + const code = ` +// @filename: test.py +//// from typing import TypeVar +//// [|/*marker*/T1|] = TypeVar("T1") + +// @filename: moved.py +//// [|/*dest*/|] + `; + + testNoMoveFromCode(code); +}); + +test('tuple unpacking not supported', () => { + const code = ` +// @filename: test.py +//// [|/*marker*/a|], b = 1, 2 + +// @filename: moved.py +//// [|/*dest*/|] + `; + + testNoMoveFromCode(code); +}); + +test('tuple unpacking not supported 2', () => { + const code = ` +// @filename: test.py +//// a, [|/*marker*/b|] = 1, 2 + +// @filename: moved.py +//// [|/*dest*/|] + `; + + testNoMoveFromCode(code); +}); + +test('chained assignment not supported', () => { + const code = ` +// @filename: test.py +//// [|/*marker*/a|] = b = 1 + +// @filename: moved.py +//// [|/*dest*/|] + `; + + testNoMoveFromCode(code); +}); + +test('chained assignment not supported 2', () => { + const code = ` +// @filename: test.py +//// a = [|/*marker*/b|] = 1 + +// @filename: moved.py +//// [|/*dest*/|] + `; + + testNoMoveFromCode(code); +}); + +test('augmented assignment', () => { + const code = ` +// @filename: test.py +//// [|/*marker*/a|] += 1 + +// @filename: moved.py +//// [|/*dest*/|] + `; + + testNoMoveFromCode(code); +}); + +test('augmented assignment 2', () => { + const code = ` +// @filename: test.py +//// a = 1 +//// [|/*marker*/a|] += 1 + +// @filename: moved.py +//// [|/*dest*/|] + `; + + testNoMoveFromCode(code); +}); + +test('symbol must be from user files', () => { + const code = ` +// @filename: pyrightconfig.json +//// { +//// "useLibraryCodeForTypes": true +//// } + +// @filename: used.py +//// /*used*/ +//// import lib +//// lib.a + +// @filename: lib.py +// @library: true +//// a = 1 +//// [|/*marker*/a|] += 1 + +// @filename: moved.py +// @library: true +//// [|/*dest*/|] + `; + + const state = parseAndGetTestState(code).state; + while (state.workspace.service.test_program.analyze()); + + const actions = state.program.moveSymbolAtPosition( + state.getMarkerByName('marker').fileName, + state.getMarkerByName('dest').fileName, + state.getPositionRange('marker').start, + { importFormat: ImportFormat.Absolute }, + CancellationToken.None + ); + assert(!actions); +}); + +function testNoMoveFromCode(code: string) { + const state = parseAndGetTestState(code).state; + + const actions = state.program.moveSymbolAtPosition( + state.getMarkerByName('marker').fileName, + state.getMarkerByName('dest').fileName, + state.getPositionRange('marker').start, + { importFormat: ImportFormat.Absolute }, + CancellationToken.None + ); + assert(!actions); +} diff --git a/packages/pyright-internal/src/tests/moveSymbol.updateReference.test.ts b/packages/pyright-internal/src/tests/moveSymbol.updateReference.test.ts new file mode 100644 index 000000000..5e3348c7f --- /dev/null +++ b/packages/pyright-internal/src/tests/moveSymbol.updateReference.test.ts @@ -0,0 +1,1194 @@ +/* + * moveSymbol.updateReference.test.ts + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT license. + * + * Tests Program.moveSymbol + */ + +import { parseAndGetTestState } from './harness/fourslash/testState'; +import { testMoveSymbolAtPosition } from './renameModuleTestUtils'; + +test('move symbol to another file - simple from import', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass|] + +// @filename: moved.py +//// [|{|"r":"def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// from [|{|"r":"moved"|}test|] import foo + `; + + testFromCode(code); +}); + +test('move symbol to another file - nested file', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass|] + +// @filename: nested/moved.py +//// [|{|"r":"def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// from [|{|"r":"nested.moved"|}test|] import foo + `; + + testFromCode(code); +}); + +test('move symbol to another file - parent file', () => { + const code = ` +// @filename: nested/test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass|] + +// @filename: moved.py +//// [|{|"r":"def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// from [|{|"r":"moved"|}nested.test|] import foo + `; + + testFromCode(code); +}); + +test('move symbol to another file - multiple import', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass +//// +//// |]def stay(): pass + +// @filename: moved.py +//// [|{|"r":"def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// [|{|"r":"from moved import foo!n!"|}|]from test import [|{|"r":""|}foo, |]stay + `; + + testFromCode(code); +}); + +test('move symbol to another file - multiple import with submodules', () => { + const code = ` +// @filename: nested/__init__.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass|] + +// @filename: nested/test.py +//// # empty + +// @filename: moved.py +//// [|{|"r":"def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// [|{|"r":"from moved import foo!n!"|}|]from nested import [|{|"r":""|}foo, |]test + `; + + testFromCode(code); +}); + +test('move symbol to another file - no merge with existing imports', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass|] + +// @filename: moved.py +//// def stay(): pass[|{|"r":"!n!!n!!n!def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// from [|{|"r":"moved"|}test|] import foo +//// from moved import stay + `; + + testFromCode(code); +}); + +test('move symbol to another file - merge with existing imports', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass +//// |]def bar(): pass + +// @filename: moved.py +//// def stay(): pass[|{|"r":"!n!!n!!n!def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// from test import bar[|{|"r":""|}, foo|] +//// from moved import [|{|"r":"foo, "|}|]stay + `; + + testFromCode(code); +}); + +test('move symbol to another file - multiple import - nested folder', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass +//// +//// |]def stay(): pass + +// @filename: nested/moved.py +//// [|{|"r":"def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// [|{|"r":"from nested.moved import foo!n!"|}|]from test import [|{|"r":""|}foo, |]stay + `; + + testFromCode(code); +}); + +test('move symbol to another file - multiple import with submodules - parent folder', () => { + const code = ` +// @filename: nested/__init__.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass|] + +// @filename: nested/test.py +//// # empty + +// @filename: moved.py +//// [|{|"r":"def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// [|{|"r":"from moved import foo!n!"|}|]from nested import [|{|"r":""|}foo, |]test + `; + + testFromCode(code); +}); + +test('move symbol to another file - no merge with existing imports - nested folder', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass|] + +// @filename: nested/moved.py +//// def stay(): pass[|{|"r":"!n!!n!!n!def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// from [|{|"r":"nested.moved"|}test|] import foo +//// from nested.moved import stay + `; + + testFromCode(code); +}); + +test('move symbol to another file - merge with existing imports - nested folder', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass +//// |]def bar(): pass + +// @filename: nested/moved.py +//// def stay(): pass[|{|"r":"!n!!n!!n!def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// from test import bar[|{|"r":""|}, foo|] +//// from nested.moved import [|{|"r":"foo, "|}|]stay + `; + + testFromCode(code); +}); + +test('move symbol to another file - multiple import - parent folder', () => { + const code = ` +// @filename: nested/test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass +//// +//// |]def stay(): pass + +// @filename: moved.py +//// [|{|"r":"def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// [|{|"r":"from moved import foo!n!"|}|]from nested.test import [|{|"r":""|}foo, |]stay + `; + + testFromCode(code); +}); + +test('move symbol to another file - multiple import with submodules - sibling folder', () => { + const code = ` +// @filename: nested/__init__.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass|] + +// @filename: nested/test.py +//// # empty + +// @filename: nested/moved.py +//// [|{|"r":"def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// from nested import [|{|"r":""|}foo, |]test[|{|"r":"!n!from nested.moved import foo"|}|] + `; + + testFromCode(code); +}); + +test('move symbol to another file - no merge with existing imports - parent folder', () => { + const code = ` +// @filename: nested/test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass|] + +// @filename: moved.py +//// def stay(): pass[|{|"r":"!n!!n!!n!def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// from [|{|"r":"moved"|}nested.test|] import foo +//// from moved import stay + `; + + testFromCode(code); +}); + +test('move symbol to another file - merge with existing imports - parent folder', () => { + const code = ` +// @filename: nested/test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass +//// |]def bar(): pass + +// @filename: moved.py +//// def stay(): pass[|{|"r":"!n!!n!!n!def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// from nested.test import bar[|{|"r":""|}, foo|] +//// from moved import [|{|"r":"foo, "|}|]stay + `; + + testFromCode(code); +}); + +test('move symbol to another file - simple from import - relative path', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass|] + +// @filename: moved.py +//// [|{|"r":"def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// from [|{|"r":".moved"|}.test|] import foo + `; + + testFromCode(code); +}); + +test('move symbol to another file - nested file - relative path', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass|] + +// @filename: nested/moved.py +//// [|{|"r":"def foo(): pass", "name": "dest"|}|] + +// @filename: nested/used.py +//// from [|{|"r":".moved"|}..test|] import foo + `; + + testFromCode(code); +}); + +test('move symbol to another file - parent file - relative path', () => { + const code = ` +// @filename: nested/test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass|] + +// @filename: moved.py +//// [|{|"r":"def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// from [|{|"r":".moved"|}.nested.test|] import foo + `; + + testFromCode(code); +}); + +test('move symbol to another file - multiple import - relative path', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass +//// +//// |]def stay(): pass + +// @filename: moved.py +//// [|{|"r":"def foo(): pass", "name": "dest"|}|] + +// @filename: nested/used.py +//// [|{|"r":"from ..moved import foo!n!"|}|]from ..test import [|{|"r":""|}foo, |]stay + `; + + testFromCode(code); +}); + +test('move symbol to another file - multiple import with submodules - relative path', () => { + const code = ` +// @filename: nested/__init__.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass|] + +// @filename: nested/test.py +//// # empty + +// @filename: moved.py +//// [|{|"r":"def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// [|{|"r":"from .moved import foo!n!"|}|]from .nested import [|{|"r":""|}foo, |]test + `; + + testFromCode(code); +}); + +test('move symbol to another file - no merge with existing imports - relative path', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass|] + +// @filename: moved.py +//// def stay(): pass[|{|"r":"!n!!n!!n!def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// from [|{|"r":".moved"|}.test|] import foo +//// from moved import stay + `; + + testFromCode(code); +}); + +test('move symbol to another file - merge with existing imports - relative path', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass +//// |]def bar(): pass + +// @filename: moved.py +//// def stay(): pass[|{|"r":"!n!!n!!n!def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// from .test import bar[|{|"r":""|}, foo|] +//// from .moved import [|{|"r":"foo, "|}|]stay + `; + + testFromCode(code); +}); + +test('member off import', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass|] + +// @filename: moved.py +//// [|{|"r":"def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// import [|{|"r":"moved"|}test|] +//// [|{|"r":"moved"|}test|].foo() + `; + + testFromCode(code); +}); + +test('member off import with existing import', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass|] + +// @filename: moved.py +//// [|{|"r":"def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// [|{|"r":""|}import test +//// |]import moved +//// [|{|"r":"moved"|}test|].foo() + `; + + testFromCode(code); +}); + +test('member off import with existing import with alias', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass|] + +// @filename: moved.py +//// [|{|"r":"def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// [|{|"r":""|}import test +//// |]import moved as m +//// [|{|"r":"m"|}test|].foo() + `; + + testFromCode(code); +}); + +test('member off import with existing import - multiple imports', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass|] + +// @filename: moved.py +//// [|{|"r":"def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// import moved[|{|"r":""|}, test|] +//// [|{|"r":"moved"|}test|].foo() + `; + + testFromCode(code); +}); + +test('member off import with existing import - multiple imports with alias', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass|] + +// @filename: moved.py +//// [|{|"r":"def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// import moved as m[|{|"r":""|}, test|] +//// [|{|"r":"m"|}test|].foo() + `; + + testFromCode(code); +}); + +test('member off from import with existing import', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass|] + +// @filename: moved.py +//// [|{|"r":"def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// [|{|"r":""|}from . import test +//// |]import moved +//// [|{|"r":"moved"|}test|].foo() + `; + + testFromCode(code); +}); + +test('member off from import with existing import with alias', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass|] + +// @filename: moved.py +//// [|{|"r":"def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// [|{|"r":""|}from . import test +//// |]import moved as m +//// [|{|"r":"m"|}test|].foo() + `; + + testFromCode(code); +}); + +test('member off from import with existing from import', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass|] + +// @filename: moved.py +//// [|{|"r":"def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// [|{|"r":""|}from . import test +//// |]from . import moved +//// [|{|"r":"moved"|}test|].foo() + `; + + testFromCode(code); +}); + +test('member off from import with existing from import with alias', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass|] + +// @filename: moved.py +//// [|{|"r":"def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// [|{|"r":""|}from . import test +//// |]from . import moved as m +//// [|{|"r":"m"|}test|].foo() + `; + + testFromCode(code); +}); + +test('member off from import with existing import - multiple imports', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass|] + +// @filename: moved.py +//// [|{|"r":"def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// from . import moved[|{|"r":""|}, test|] +//// [|{|"r":"moved"|}test|].foo() + `; + + testFromCode(code); +}); + +test('member off from import with existing import - multiple imports with alias', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass|] + +// @filename: moved.py +//// [|{|"r":"def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// from . import moved as m[|{|"r":""|}, test|] +//// [|{|"r":"m"|}test|].foo() + `; + + testFromCode(code); +}); + +test('member off submodule', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass|] + +// @filename: moved.py +//// [|{|"r":"def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// from . import [|{|"r":"moved"|}test|] +//// [|{|"r":"moved"|}test|].foo() + `; + + testFromCode(code); +}); + +test('member off import - dotted name', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass|] + +// @filename: nested/moved.py +//// [|{|"r":"def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// import [|{|"r":"nested.moved"|}test|] +//// [|{|"r":"nested.moved"|}test|].foo() + `; + + testFromCode(code); +}); + +test('member off submodule - dotted name', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass|] + +// @filename: nested/moved.py +//// [|{|"r":"def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// from [|{|"r":".nested"|}.|] import [|{|"r":"moved"|}test|] +//// [|{|"r":"moved"|}test|].foo() + `; + + testFromCode(code); +}); + +test('member off import with alias', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass|] + +// @filename: moved.py +//// [|{|"r":"def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// import [|{|"r":"moved"|}test|] as t +//// t.foo() + `; + + testFromCode(code); +}); + +test('member off submodule with alias', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass|] + +// @filename: moved.py +//// [|{|"r":"def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// from . import [|{|"r":"moved"|}test|] as test +//// test.foo() + `; + + testFromCode(code); +}); + +test('member off import with alias - dotted name', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass|] + +// @filename: nested/moved.py +//// [|{|"r":"def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// import [|{|"r":"nested.moved"|}test|] as t +//// t.foo() + `; + + testFromCode(code); +}); + +test('member off submodule with alias - dotted name', () => { + const code = ` +// @filename: nested/test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass|] + +// @filename: sub/moved.py +//// [|{|"r":"def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// from [|{|"r":"sub"|}nested|] import [|{|"r":"moved"|}test|] as test +//// test.foo() + `; + + testFromCode(code); +}); + +test('member off import - multiple symbols', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass +//// |]def bar(): pass + +// @filename: moved.py +//// [|{|"r":"def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// [|{|"r":"import moved!n!"|}|]import test +//// [|{|"r":"moved"|}test|].foo() +//// test.bar() + `; + + testFromCode(code); +}); + +test('member off import - multiple symbols - existing import', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass +//// |]def bar(): pass + +// @filename: moved.py +//// [|{|"r":"def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// import moved +//// import test +//// +//// [|{|"r":"moved"|}test|].foo() +//// test.bar() + `; + + testFromCode(code); +}); + +test('member off import - multiple symbols - existing import with alias', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass +//// |]def bar(): pass + +// @filename: moved.py +//// [|{|"r":"def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// import moved as m +//// import test +//// +//// [|{|"r":"m"|}test|].foo() +//// test.bar() + `; + + testFromCode(code); +}); + +test('member off import - multiple symbols with alias - existing import', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass +//// |]def bar(): pass + +// @filename: moved.py +//// [|{|"r":"def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// import moved +//// import test as t +//// +//// [|{|"r":"moved"|}t|].foo() +//// t.bar() + `; + + testFromCode(code); +}); + +test('member off import - multiple symbols with alias - new import', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass +//// |]def bar(): pass + +// @filename: moved.py +//// [|{|"r":"def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// [|{|"r":"import moved!n!"|}|]import test as t +//// +//// [|{|"r":"moved"|}t|].foo() +//// t.bar() + `; + + testFromCode(code); +}); + +test('member off import - multiple symbols with alias - existing import with alias', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass +//// |]def bar(): pass + +// @filename: moved.py +//// [|{|"r":"def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// import moved as m +//// import test as t +//// +//// [|{|"r":"m"|}t|].foo() +//// t.bar() + `; + + testFromCode(code); +}); + +test('member off import - multiple symbols - existing from import', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass +//// |]def bar(): pass + +// @filename: moved.py +//// [|{|"r":"def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// from . import moved +//// import test +//// +//// [|{|"r":"moved"|}test|].foo() +//// test.bar() + `; + + testFromCode(code); +}); + +test('member off import - multiple symbols - existing from import with alias', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass +//// |]def bar(): pass + +// @filename: moved.py +//// [|{|"r":"def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// from . import moved as m +//// import test +//// +//// [|{|"r":"m"|}test|].foo() +//// test.bar() + `; + + testFromCode(code); +}); + +test('member off import - multiple symbols - existing from import', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass +//// |]def bar(): pass + +// @filename: moved.py +//// [|{|"r":"def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// from . import moved +//// import test +//// +//// [|{|"r":"moved"|}test|].foo() +//// test.bar() + `; + + testFromCode(code); +}); + +test('member off import - multiple symbols - existing from import with alias', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass +//// |]def bar(): pass + +// @filename: moved.py +//// [|{|"r":"def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// from . import moved as m +//// import test +//// +//// [|{|"r":"m"|}test|].foo() +//// test.bar() + `; + + testFromCode(code); +}); + +test('member off from import - multiple symbols', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass +//// |]def bar(): pass + +// @filename: moved.py +//// [|{|"r":"def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// [|{|"r":"import moved!n!"|}|]from . import test +//// [|{|"r":"moved"|}test|].foo() +//// test.bar() + `; + + testFromCode(code); +}); + +test('member off from import - multiple symbols - existing import', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass +//// |]def bar(): pass + +// @filename: moved.py +//// [|{|"r":"def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// import moved +//// from . import test +//// +//// [|{|"r":"moved"|}test|].foo() +//// test.bar() + `; + + testFromCode(code); +}); + +test('member off from import - multiple symbols - existing import with alias', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass +//// |]def bar(): pass + +// @filename: moved.py +//// [|{|"r":"def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// import moved as m +//// from . import test +//// +//// [|{|"r":"m"|}test|].foo() +//// test.bar() + `; + + testFromCode(code); +}); + +test('member off from import - multiple symbols with alias - existing import', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass +//// |]def bar(): pass + +// @filename: moved.py +//// [|{|"r":"def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// import moved +//// from . import test as t +//// +//// [|{|"r":"moved"|}t|].foo() +//// t.bar() + `; + + testFromCode(code); +}); + +test('member off from import - multiple symbols with alias - new import', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass +//// |]def bar(): pass + +// @filename: moved.py +//// [|{|"r":"def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// [|{|"r":"import moved!n!"|}|]from . import test as t +//// +//// [|{|"r":"moved"|}t|].foo() +//// t.bar() + `; + + testFromCode(code); +}); + +test('member off from import - multiple symbols with alias - existing import with alias', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass +//// |]def bar(): pass + +// @filename: moved.py +//// [|{|"r":"def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// import moved as m +//// from . import test as t +//// +//// [|{|"r":"m"|}t|].foo() +//// t.bar() + `; + + testFromCode(code); +}); + +test('member off from import - multiple symbols - existing from import', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass +//// |]def bar(): pass + +// @filename: moved.py +//// [|{|"r":"def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// from . import moved +//// from . import test +//// +//// [|{|"r":"moved"|}test|].foo() +//// test.bar() + `; + + testFromCode(code); +}); + +test('member off from import - multiple symbols - existing from import with alias', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass +//// |]def bar(): pass + +// @filename: moved.py +//// [|{|"r":"def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// from . import moved as m +//// from . import test +//// +//// [|{|"r":"m"|}test|].foo() +//// test.bar() + `; + + testFromCode(code); +}); + +test('member off import - error case that we dont touch - function return module', () => { + // We could put import in test so test module still has symbol "foo" but + // for now, we won't handle such corner case. + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass|] + +// @filename: test2.py +//// def foo(): pass + +// @filename: moved.py +//// [|{|"r":"def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// from test +//// from test2 +//// def getTestModule(a): +//// return test if a > 0 else test2 +//// +//// getTestModule(1).foo() + `; + + testFromCode(code); +}); + +test('member off import - error case that we dont touch - field return module', () => { + // We could put import in test so test module still has symbol "foo" but + // for now, we won't handle such corner case. + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): pass|] + +// @filename: test2.py +//// def foo(): pass + +// @filename: moved.py +//// [|{|"r":"def foo(): pass", "name": "dest"|}|] + +// @filename: used.py +//// from test +//// from test2 +//// module = test if a > 0 else test2 +//// +//// module.foo() + `; + + testFromCode(code); +}); + +test('simple symbol reference', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): +//// return 1|] + +// @filename: moved.py +//// [|{|"r":"def foo():!n! return 1", "name": "dest"|}|] + +// @filename: used.py +//// from [|{|"r":"moved"|}test|] import foo +//// +//// foo() +//// b = foo().real + `; + + testFromCode(code); +}); + +test('handle __all__ - at the original file', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): +//// return 1 +//// |]__all__ = [[|{|"r":""|}"foo"|]] + +// @filename: moved.py +//// [|{|"r":"def foo():!n! return 1", "name": "dest"|}|] + +// @filename: used.py +//// from [|{|"r":"moved"|}test|] import foo +//// foo() +//// b = foo().real +//// +//// __all__ = ["foo"] + `; + + testFromCode(code); +}); + +test('handle wildcard import - new import', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): +//// return 1|] + +// @filename: moved.py +//// [|{|"r":"def foo():!n! return 1", "name": "dest"|}|] + +// @filename: used.py +//// [|{|"r":"from moved import foo!n!"|}|]from test import * +//// foo() +//// b = foo().real + `; + + testFromCode(code); +}); + +test('handle wildcard import with existing import', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): +//// return 1|] + +// @filename: moved.py +//// def bar(): +//// pass[|{|"r":"!n!!n!!n!def foo():!n! return 1", "name": "dest"|}|] + +// @filename: used.py +//// from moved import bar[|{|"r":", foo"|}|] +//// from test import * +//// foo() +//// b = foo().real + `; + + testFromCode(code); +}); + +test('handle wildcard import with existing wildcard import', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): +//// return 1|] + +// @filename: moved.py +//// def bar(): +//// pass[|{|"r":"!n!!n!!n!def foo():!n! return 1", "name": "dest"|}|] + +// @filename: used.py +//// from moved import *[|{|"r":"!n!from moved import foo"|}|] +//// from test import * +//// foo() +//// b = foo().real + `; + + testFromCode(code); +}); + +test('handle wildcard import in destination file', () => { + const code = ` +// @filename: test.py +//// [|{|"r":""|}def [|/*marker*/foo|](): +//// return 1|] + +// @filename: moved.py +//// from test import * +//// +//// def bar(): +//// pass[|{|"r":"!n!!n!!n!def foo():!n! return 1", "name": "dest"|}|] + `; + + testFromCode(code); +}); + +function testFromCode(code: string) { + const state = parseAndGetTestState(code).state; + + testMoveSymbolAtPosition( + state, + state.getMarkerByName('marker').fileName, + state.getMarkerByName('dest').fileName, + state.getPositionRange('marker').start + ); +} diff --git a/packages/pyright-internal/src/tests/parseTreeUtils.test.ts b/packages/pyright-internal/src/tests/parseTreeUtils.test.ts index 58c8aed57..f994c398d 100644 --- a/packages/pyright-internal/src/tests/parseTreeUtils.test.ts +++ b/packages/pyright-internal/src/tests/parseTreeUtils.test.ts @@ -256,26 +256,61 @@ test('getFullStatementRange', () => { const code = ` //// [|/*marker1*/import a //// |][|/*marker2*/a = 1; |][|/*marker3*/b = 2 -//// |][|/*marker4*/if True: +//// |] +//// try: +//// [| /*marker4*/a = 1 +//// |]except Exception: +//// pass +//// [|/*marker5*/if True: //// pass|] `; const state = parseAndGetTestState(code).state; - testRange(state, 'marker1', ParseNodeType.Import); - testRange(state, 'marker2', ParseNodeType.Assignment); - testRange(state, 'marker3', ParseNodeType.Assignment); - testRange(state, 'marker4', ParseNodeType.If); + testNodeRange(state, 'marker1', ParseNodeType.Import); + testNodeRange(state, 'marker2', ParseNodeType.Assignment); + testNodeRange(state, 'marker3', ParseNodeType.Assignment); + testNodeRange(state, 'marker4', ParseNodeType.Assignment); + testNodeRange(state, 'marker5', ParseNodeType.If); +}); - function testRange(state: TestState, markerName: string, type: ParseNodeType) { - const range = state.getRangeByMarkerName(markerName)!; - const sourceFile = state.program.getBoundSourceFile(range.marker!.fileName)!; +test('getFullStatementRange with trailing blank lines', () => { + const code = ` +//// [|/*marker*/def foo(): +//// return 1 +//// +//// |]def bar(): +//// pass + `; - const statementNode = getFirstAncestorOrSelfOfKind(getNodeAtMarker(state, markerName), type)!; - const statementRange = getFullStatementRange(statementNode, sourceFile.getParseResults()!.tokenizerOutput); + const state = parseAndGetTestState(code).state; - const expectedRange = state.convertPositionRange(range); + testNodeRange(state, 'marker', ParseNodeType.Function, true); +}); - assert(rangesAreEqual(expectedRange, statementRange)); - } +test('getFullStatementRange with only trailing blank lines', () => { + const code = ` +//// [|/*marker*/def foo(): +//// return 1 +//// |] +//// + `; + + const state = parseAndGetTestState(code).state; + + testNodeRange(state, 'marker', ParseNodeType.Function, true); }); + +function testNodeRange(state: TestState, markerName: string, type: ParseNodeType, includeTrailingBlankLines = false) { + const range = state.getRangeByMarkerName(markerName)!; + const sourceFile = state.program.getBoundSourceFile(range.marker!.fileName)!; + + const statementNode = getFirstAncestorOrSelfOfKind(getNodeAtMarker(state, markerName), type)!; + const statementRange = getFullStatementRange(statementNode, sourceFile.getParseResults()!, { + includeTrailingBlankLines, + }); + + const expectedRange = state.convertPositionRange(range); + + assert(rangesAreEqual(expectedRange, statementRange)); +} diff --git a/packages/pyright-internal/src/tests/parser.test.ts b/packages/pyright-internal/src/tests/parser.test.ts index 60b806c4d..6dae6bc29 100644 --- a/packages/pyright-internal/src/tests/parser.test.ts +++ b/packages/pyright-internal/src/tests/parser.test.ts @@ -10,6 +10,7 @@ import * as assert from 'assert'; +import { findNodeByOffset, getFirstAncestorOrSelfOfKind } from '../analyzer/parseTreeUtils'; import { DiagnosticSink } from '../common/diagnosticSink'; import { TextRange } from '../common/textRange'; import { ParseNodeType, StatementListNode } from '../parser/parseNodes'; @@ -68,9 +69,9 @@ test('ExpressionWrappedInParens', () => { const statementList = parseResults.parseTree.statements[0] as StatementListNode; assert.equal(statementList.statements.length, 1); - // length of node should exclude parens + // length of node should include parens assert.equal(statementList.statements[0].nodeType, ParseNodeType.Name); - assert.equal(statementList.statements[0].length, 3); + assert.equal(statementList.statements[0].length, 5); }); test('MaxParseDepth1', () => { @@ -97,3 +98,30 @@ test('ModuleName range', () => { assert.strictEqual(node.start, expectedRange?.pos); assert.strictEqual(TextRange.getEnd(node), expectedRange?.end); }); + +test('ParserRecovery1', () => { + const diagSink = new DiagnosticSink(); + const parseResults = TestUtils.parseSampleFile('parserRecovery1.py', diagSink).parseResults; + + const node = findNodeByOffset(parseResults.parseTree, parseResults.text.length - 2); + const functionNode = getFirstAncestorOrSelfOfKind(node, ParseNodeType.Function); + assert.equal(functionNode!.parent!.nodeType, ParseNodeType.Module); +}); + +test('ParserRecovery2', () => { + const diagSink = new DiagnosticSink(); + const parseResults = TestUtils.parseSampleFile('parserRecovery2.py', diagSink).parseResults; + + const node = findNodeByOffset(parseResults.parseTree, parseResults.text.length - 2); + const functionNode = getFirstAncestorOrSelfOfKind(node, ParseNodeType.Function); + assert.equal(functionNode!.parent!.nodeType, ParseNodeType.Suite); +}); + +test('ParserRecovery3', () => { + const diagSink = new DiagnosticSink(); + const parseResults = TestUtils.parseSampleFile('parserRecovery3.py', diagSink).parseResults; + + const node = findNodeByOffset(parseResults.parseTree, parseResults.text.length - 2); + const functionNode = getFirstAncestorOrSelfOfKind(node, ParseNodeType.Function); + assert.equal(functionNode!.parent!.nodeType, ParseNodeType.Module); +}); diff --git a/packages/pyright-internal/src/tests/pathUtils.test.ts b/packages/pyright-internal/src/tests/pathUtils.test.ts index 3f3a24ae7..212166667 100644 --- a/packages/pyright-internal/src/tests/pathUtils.test.ts +++ b/packages/pyright-internal/src/tests/pathUtils.test.ts @@ -8,9 +8,11 @@ */ import assert from 'assert'; +import * as os from 'os'; import * as path from 'path'; import { Comparison } from '../common/core'; +import { expandPathVariables } from '../common/envVarUtils'; import { changeAnyExtension, combinePathComponents, @@ -19,6 +21,7 @@ import { comparePathsCaseInsensitive, comparePathsCaseSensitive, containsPath, + convertUriToPath, deduplicateFolders, ensureTrailingDirectorySeparator, getAnyExtensionFromPath, @@ -26,12 +29,12 @@ import { getFileExtension, getFileName, getPathComponents, - getRegexEscapedSeparator, getRelativePath, getRelativePathFromDirectory, getWildcardRegexPattern, getWildcardRoot, hasTrailingDirectorySeparator, + isDirectoryWildcardPatternPresent, isFileSystemCaseSensitiveInternal, isRootedDiskPath, normalizeSlashes, @@ -132,16 +135,52 @@ test('stripFileExtension2', () => { assert.equal(path2, 'blah.blah/hello.cpython-32m'); }); +function fixSeparators(linuxPath: string) { + if (path.sep === '\\') { + return linuxPath.replace(/\//g, path.sep); + } + return linuxPath; +} + test('getWildcardRegexPattern1', () => { const pattern = getWildcardRegexPattern('/users/me', './blah/'); - const sep = getRegexEscapedSeparator(); - assert.equal(pattern, `${sep}users${sep}me${sep}blah`); + const regex = new RegExp(pattern); + assert.ok(regex.test(fixSeparators('/users/me/blah/d'))); + assert.ok(!regex.test(fixSeparators('/users/me/blad/d'))); }); test('getWildcardRegexPattern2', () => { - const pattern = getWildcardRegexPattern('/users/me', './**/*.py?/'); - const sep = getRegexEscapedSeparator(); - assert.equal(pattern, `${sep}users${sep}me(${sep}[^${sep}.][^${sep}]*)*?${sep}[^${sep}]*\\.py[^${sep}]`); + const pattern = getWildcardRegexPattern('/users/me', './**/*.py?'); + const regex = new RegExp(pattern); + assert.ok(regex.test(fixSeparators('/users/me/.blah/foo.pyd'))); + assert.ok(!regex.test(fixSeparators('/users/me/.blah/foo.py'))); // No char after +}); + +test('getWildcardRegexPattern3', () => { + const pattern = getWildcardRegexPattern('/users/me', './**/.*.py'); + const regex = new RegExp(pattern); + assert.ok(regex.test(fixSeparators('/users/me/.blah/.foo.py'))); + assert.ok(!regex.test(fixSeparators('/users/me/.blah/foo.py'))); +}); + +test('isDirectoryWildcardPatternPresent1', () => { + const isPresent = isDirectoryWildcardPatternPresent('./**/*.py'); + assert.equal(isPresent, true); +}); + +test('isDirectoryWildcardPatternPresent2', () => { + const isPresent = isDirectoryWildcardPatternPresent('./**/a/*.py'); + assert.equal(isPresent, true); +}); + +test('isDirectoryWildcardPatternPresent3', () => { + const isPresent = isDirectoryWildcardPatternPresent('./**/@tests'); + assert.equal(isPresent, true); +}); + +test('isDirectoryWildcardPatternPresent4', () => { + const isPresent = isDirectoryWildcardPatternPresent('./**/test/test*'); + assert.equal(isPresent, true); }); test('getWildcardRoot1', () => { @@ -192,6 +231,32 @@ test('resolvePath2', () => { assert.equal(resolvePaths('/path', 'to', '..', 'from', 'file.ext/'), normalizeSlashes('/path/from/file.ext/')); }); +test('resolvePath3 ~ escape', () => { + const homedir = os.homedir(); + assert.equal( + resolvePaths(expandPathVariables('', '~/path'), 'to', '..', 'from', 'file.ext/'), + normalizeSlashes(`${homedir}/path/from/file.ext/`) + ); +}); + +test('resolvePath4 ~ escape in middle', () => { + const homedir = os.homedir(); + assert.equal( + resolvePaths('/path', expandPathVariables('', '~/file.ext/')), + normalizeSlashes(`${homedir}/file.ext/`) + ); +}); + +test('invalid ~ without root', () => { + const path = combinePaths('Library', 'Mobile Documents', 'com~apple~CloudDocs', 'Development', 'mysuperproject'); + assert.equal(resolvePaths(expandPathVariables('/src', path)), path); +}); + +test('invalid ~ with root', () => { + const path = combinePaths('/', 'Library', 'com~apple~CloudDocs', 'Development', 'mysuperproject'); + assert.equal(resolvePaths(expandPathVariables('/src', path)), path); +}); + test('comparePaths1', () => { assert.equal(comparePaths('/A/B/C', '\\a\\b\\c'), Comparison.LessThan); }); @@ -341,3 +406,13 @@ test('deduplicateFolders', () => { assert.deepStrictEqual(folders.sort(), expected.sort()); }); + +test('convert UNC path', () => { + const cwd = normalizeSlashes('/'); + const fs = new vfs.TestFileSystem(/*ignoreCase*/ true, { cwd }); + + const path = convertUriToPath(fs, 'file://server/c$/folder/file.py'); + + // When converting UNC path, server part shouldn't be removed. + assert(path.indexOf('server') > 0); +}); diff --git a/packages/pyright-internal/src/tests/renameModuleTestUtils.ts b/packages/pyright-internal/src/tests/renameModuleTestUtils.ts index 9203d3a8a..2faf93ab8 100644 --- a/packages/pyright-internal/src/tests/renameModuleTestUtils.ts +++ b/packages/pyright-internal/src/tests/renameModuleTestUtils.ts @@ -14,9 +14,15 @@ import { Diagnostic } from '../common/diagnostic'; import { DiagnosticRule } from '../common/diagnosticRules'; import { FileEditActions } from '../common/editAction'; import { Position } from '../common/textRange'; +import { ImportFormat } from '../languageService/autoImporter'; import { Range } from './harness/fourslash/fourSlashTypes'; import { TestState } from './harness/fourslash/testState'; -import { applyFileOperations, verifyEdits } from './testStateUtils'; +import { + applyFileOperations, + convertFileEditActionToString, + convertRangeToFileEditAction, + verifyEdits, +} from './testStateUtils'; export function testMoveSymbolAtPosition( state: TestState, @@ -24,9 +30,16 @@ export function testMoveSymbolAtPosition( newFilePath: string, position: Position, text?: string, - replacementText?: string + replacementText?: string, + expectsMissingImport = false ) { - const actions = state.program.moveSymbolAtPosition(filePath, newFilePath, position, CancellationToken.None); + const actions = state.program.moveSymbolAtPosition( + filePath, + newFilePath, + position, + { importFormat: ImportFormat.Absolute }, + CancellationToken.None + ); assert(actions); const ranges: Range[] = []; @@ -39,9 +52,16 @@ export function testMoveSymbolAtPosition( ); } - assert.strictEqual(actions.edits.length, ranges.length); + assert.strictEqual( + actions.edits.length, + ranges.length, + `${actions.edits.map((e) => convertFileEditActionToString(e)).join('|')} vs ${ranges + .map((r) => convertRangeToFileEditAction(state, r, replacementText)) + .map((e) => convertFileEditActionToString(e)) + .join('|')}` + ); - _verifyFileOperations(state, actions, ranges, replacementText); + _verifyFileOperations(state, actions, ranges, replacementText, expectsMissingImport); } export function testRenameModule( @@ -64,7 +84,14 @@ export function testRenameModule( ); } - assert.strictEqual(editActions.edits.length, ranges.length); + assert.strictEqual( + editActions.edits.length, + ranges.length, + `${editActions.edits.map((e) => convertFileEditActionToString(e)).join('\n')} vs ${ranges + .map((r) => convertRangeToFileEditAction(state, r, replacementText)) + .map((e) => convertFileEditActionToString(e)) + .join('\n')}` + ); editActions.fileOperations.push({ kind: 'rename', oldFilePath: filePath, newFilePath }); @@ -76,18 +103,23 @@ function _verifyFileOperations( state: TestState, fileEditActions: FileEditActions, ranges: Range[], - replacementText: string | undefined + replacementText: string | undefined, + expectsMissingImport = false ) { const editsPerFileMap = createMapFromItems(fileEditActions.edits, (e) => e.filePath); - _verifyMissingImports(); + if (!expectsMissingImport) { + _verifyMissingImports(); + } verifyEdits(state, fileEditActions, ranges, replacementText); applyFileOperations(state, fileEditActions); // Make sure we don't have missing imports after the change. - _verifyMissingImports(); + if (!expectsMissingImport) { + _verifyMissingImports(); + } function _verifyMissingImports() { for (const editFileName of editsPerFileMap.keys()) { diff --git a/packages/pyright-internal/src/tests/samples/annotations1.py b/packages/pyright-internal/src/tests/samples/annotations1.py index c4cbe2e36..6f5fb65a7 100644 --- a/packages/pyright-internal/src/tests/samples/annotations1.py +++ b/packages/pyright-internal/src/tests/samples/annotations1.py @@ -3,6 +3,7 @@ from typing import Optional, Type, Union import uuid +from datetime import datetime class ClassA: @@ -59,7 +60,8 @@ class ClassD: # This should generate an error because ClassF refers # to itself, and there is no ClassF declared at the module - # level. + # level. It should also generate a second error because + # ClassF is a variable and can't be used as an annotation. ClassF: "ClassF" str: "str" @@ -85,7 +87,7 @@ class ClassG: class ClassH: # This should generate an error because uuid refers to the local - # symbol in this case. + # symbol in this case, which is a circular reference. uuid: uuid.UUID = uuid.uuid4() @@ -104,3 +106,11 @@ def func12(x: Type[int]): # normal annotation limitations do not apply here. print(Union[x, x]) print(Optional[x]) + + +# This should generate an error because foo isn't defined. +foo: int = foo + + +class ClassJ: + datetime: datetime diff --git a/packages/pyright-internal/src/tests/samples/assignment10.py b/packages/pyright-internal/src/tests/samples/assignment10.py index e1e5acdf9..44620bdb6 100644 --- a/packages/pyright-internal/src/tests/samples/assignment10.py +++ b/packages/pyright-internal/src/tests/samples/assignment10.py @@ -2,7 +2,7 @@ class A: - instance: "A" | None + instance: "A | None" def __init__(self) -> None: self.foo: bool diff --git a/packages/pyright-internal/src/tests/samples/assignment11.py b/packages/pyright-internal/src/tests/samples/assignment11.py new file mode 100644 index 000000000..424da60bb --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/assignment11.py @@ -0,0 +1,15 @@ +# This sample tests the type checker's handling of chained assignments. + +a1 = b1 = c1 = d1 = 3 + +my_list = [10] +a2 = my_list[a2] = b2 = my_list[b2] = 0 + +# This should generate an error because a3 is read before written. +my_list[a3] = a3 = 0 + + +# This should generate an error because type comments are not +# allowed for chained assignments. +x1 = x2 = x3 = [3] # type: list[float] + diff --git a/packages/pyright-internal/src/tests/samples/assignment12.py b/packages/pyright-internal/src/tests/samples/assignment12.py new file mode 100644 index 000000000..4b1557308 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/assignment12.py @@ -0,0 +1,19 @@ +# This sample tests the case where a variable with a declared type +# is assigned an unknown value or partially-unknown value. + +def a_test(x: int): + u = x.upper() # type: ignore + reveal_type(u, expected_text="Unknown") + + # This should generate an error if reportUnknownVariableType is enabled. + y: str = u + reveal_type(y, expected_text="Unknown | str") + + +def b_test(x: int | str): + u = x.upper() # type: ignore + reveal_type(u, expected_text="Unknown | str") + + # This should generate an error if reportUnknownVariableType is enabled. + y: str = u + reveal_type(y, expected_text="Unknown | str") diff --git a/packages/pyright-internal/src/tests/samples/assignmentExpr1.py b/packages/pyright-internal/src/tests/samples/assignmentExpr1.py index 07e2544a7..9c66707c5 100644 --- a/packages/pyright-internal/src/tests/samples/assignmentExpr1.py +++ b/packages/pyright-internal/src/tests/samples/assignmentExpr1.py @@ -21,3 +21,6 @@ def func1(): val if val := 1 + 2 else None val2 if (val2 := 1 + 2) else None + +# This should generate an error because parens are not allowed in asserts. +assert e := 1 \ No newline at end of file diff --git a/packages/pyright-internal/src/tests/samples/assignmentExpr2.py b/packages/pyright-internal/src/tests/samples/assignmentExpr2.py index b4f01c850..ab917596c 100644 --- a/packages/pyright-internal/src/tests/samples/assignmentExpr2.py +++ b/packages/pyright-internal/src/tests/samples/assignmentExpr2.py @@ -1,4 +1,5 @@ -# This sample tests the Python 3.8 assignment expressions. +# This sample tests the Python 3.8 assignment expressions. This sample +# is taken from PEP 257. # pyright: reportUnusedExpression=false @@ -8,23 +9,19 @@ def foo(x: float): ... def pep572_examples(): - # Handle a matched regex if (match := re.search('123', '252')) is not None: print(match) print(match) - # A loop that can't be trivially rewritten using 2-arg iter() file = open('hello') while chunk := file.read(8192): print(chunk) print(chunk) - # Reuse a value that's expensive to compute def f(x: float): return x mylist = [y := f(25), y**2, y**3] - # Share a subexpression between a comprehension filter clause and its output data = [1, 2, 3] filtered_data = [y for x in data if (y := f(x)) is not None] print(filtered_data) diff --git a/packages/pyright-internal/src/tests/samples/autoVariance3.py b/packages/pyright-internal/src/tests/samples/autoVariance3.py new file mode 100644 index 000000000..88f5978a4 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/autoVariance3.py @@ -0,0 +1,93 @@ +# This sample tests variance inference for traditional type variables. + +from typing import Generic, Iterator, Sequence +from typing_extensions import TypeVar + +T = TypeVar("T", infer_variance=True) +K = TypeVar("K", infer_variance=True) +V = TypeVar("V", infer_variance=True) + +# This should generate an error because covariant cannot be used +# with infer_variance. +S1 = TypeVar("S1", covariant=True, infer_variance=True) + +# This should generate an error because contravariant cannot be used +# with infer_variance. +S2 = TypeVar("S2", contravariant=True, infer_variance=True) + + +class ShouldBeCovariant1(Generic[T]): + def __getitem__(self, index: int) -> T: ... + def __iter__(self) -> Iterator[T]: ... + + +vco1_1: ShouldBeCovariant1[float] = ShouldBeCovariant1[int]() + +# This should generate an error based on variance +vco1_2: ShouldBeCovariant1[int] = ShouldBeCovariant1[float]() + + +class ShouldBeCovariant2(Sequence[T]): + pass + +vco2_1: ShouldBeCovariant2[float] = ShouldBeCovariant2[int]() + +# This should generate an error based on variance +vco2_2: ShouldBeCovariant2[int] = ShouldBeCovariant2[float]() + + + +class ShouldBeInvariant1(Generic[T]): + def __init__(self, value: T) -> None: + self._value = value + + @property + def value(self): + return self._value + +# This should generate an error based on variance +vinv1_1: ShouldBeInvariant1[float] = ShouldBeInvariant1[int](1) + +# This should generate an error based on variance +vinv1_2: ShouldBeInvariant1[int] = ShouldBeInvariant1[float](1.1) + + +class ShouldBeInvariant2(Generic[T]): + def __init__(self, value: T) -> None: + self._value = value + + def get_value(self) ->T: + return self._value + +# This should generate an error based on variance +vinv2_1: ShouldBeInvariant2[float] = ShouldBeInvariant2[int](1) + +# This should generate an error based on variance +vinv2_2: ShouldBeInvariant2[int] = ShouldBeInvariant2[float](1.1) + + +class ShouldBeInvariant3(dict[K, V]): + pass + +# This should generate an error based on variance +vinv3_1: ShouldBeInvariant3[float, str] = ShouldBeInvariant3[int, str]() + +# This should generate an error based on variance +vinv3_2: ShouldBeInvariant3[int, str] = ShouldBeInvariant3[float, str]() + +# This should generate an error based on variance +vinv3_3: ShouldBeInvariant3[str, float] = ShouldBeInvariant3[str, int]() + +# This should generate an error based on variance +vinv3_4: ShouldBeInvariant3[str, int] = ShouldBeInvariant3[str, float]() + + +class ShouldBeContravariant1(Generic[T]): + def __init__(self, value: T) -> None: + self._value = value + + +# This should generate an error based on variance +vcontra1_1: ShouldBeContravariant1[float] = ShouldBeContravariant1[int](1) + +vcontra1_2: ShouldBeContravariant1[int] = ShouldBeContravariant1[float](1.2) diff --git a/packages/pyright-internal/src/tests/samples/autoVariance4.py b/packages/pyright-internal/src/tests/samples/autoVariance4.py new file mode 100644 index 000000000..ef0924269 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/autoVariance4.py @@ -0,0 +1,45 @@ +# This sample tests the case where a class uses auto-variance but derives +# from a class that does not. + +from typing import Generic, TypeVar + +T = TypeVar("T") +T_co = TypeVar("T_co", covariant=True) +T_contra = TypeVar("T_contra", contravariant=True) + +class Parent_Invariant(Generic[T]): + pass + +class ShouldBeInvariant[T](Parent_Invariant[T]): + pass + +# This should generate an error. +a1: ShouldBeInvariant[int] = ShouldBeInvariant[float]() + +# This should generate an error. +a2: ShouldBeInvariant[float] = ShouldBeInvariant[int]() + + +class Parent_Covariant(Generic[T_co]): + pass + +class ShouldBeCovariant[T](Parent_Covariant[T]): + pass + +# This should generate an error. +b1: ShouldBeCovariant[int] = ShouldBeCovariant[float]() + +b2: ShouldBeCovariant[float] = ShouldBeCovariant[int]() + + +class Parent_Contravariant(Generic[T_contra]): + pass + +class ShouldBeContravariant[T](Parent_Contravariant[T]): + pass + +c1: ShouldBeContravariant[int] = ShouldBeContravariant[float]() + +# This should generate an error. +c2: ShouldBeContravariant[float] = ShouldBeContravariant[int]() + diff --git a/packages/pyright-internal/src/tests/samples/builtins2.py b/packages/pyright-internal/src/tests/samples/builtins2.py new file mode 100644 index 000000000..692620317 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/builtins2.py @@ -0,0 +1,8 @@ +# This sample tests that builtins can be overridden at the module level +# without generating a "possibly unbound" error. + +if input(): + print = lambda *x: None + +print('') + diff --git a/packages/pyright-internal/src/tests/samples/call1.py b/packages/pyright-internal/src/tests/samples/call1.py index e5e89074a..b5b6ff5a1 100644 --- a/packages/pyright-internal/src/tests/samples/call1.py +++ b/packages/pyright-internal/src/tests/samples/call1.py @@ -69,7 +69,7 @@ def callback9(a: FooBase) -> Foo: # type of callback3 doesn't match. needs_function1(callback3) -# This should generage an error because callback4 +# This should generate an error because callback4 # takes too many parameters. needs_function1(callback4) diff --git a/packages/pyright-internal/src/tests/samples/call2.py b/packages/pyright-internal/src/tests/samples/call2.py index d3024f8f9..4e87e7270 100644 --- a/packages/pyright-internal/src/tests/samples/call2.py +++ b/packages/pyright-internal/src/tests/samples/call2.py @@ -21,8 +21,9 @@ def func1(a: int, *b: int): # This should generate an error func1("hello", 3) -# This should generate an error str_list = ["he", "2", "3"] + +# This should generate an error func1(3, *str_list) @@ -114,5 +115,15 @@ def func9( args4: List[str] = ["hi"] func9(0, *args4, **kwargs3) -# This should generate an error +# This should generate an error. func9(*args4, **kwargs3) + +def func10(x: int): ... + +func10(1, *()) + +# This should generate an error. +func10(1, *(1, )) + +def func11(y: tuple[int, ...]): + func10(1, *y) diff --git a/packages/pyright-internal/src/tests/samples/call3.py b/packages/pyright-internal/src/tests/samples/call3.py index 5c471ae2c..8616aa282 100644 --- a/packages/pyright-internal/src/tests/samples/call3.py +++ b/packages/pyright-internal/src/tests/samples/call3.py @@ -153,7 +153,19 @@ def f10(x, *args, /, y): def f11(x, *args, *, y): pass +def f15(x, /, *args): + pass + +# This should generate an error because x +# is a position-only parameter. +f15(x=1) +def f16(x, /, *args, **kw): + pass + +# This should generate an error because x +# is a position-only parameter. +f16(x=1) def f12(a: int, b: str, /): ... diff --git a/packages/pyright-internal/src/tests/samples/call5.py b/packages/pyright-internal/src/tests/samples/call5.py index 366bccd55..a3a078f07 100644 --- a/packages/pyright-internal/src/tests/samples/call5.py +++ b/packages/pyright-internal/src/tests/samples/call5.py @@ -44,7 +44,7 @@ (3, 6), ] -# This should generate two errors because int isn't assignable to parameter +# This should generate two errors because it isn't assignable to parameter # b or c. [X(*item) for item in q4] diff --git a/packages/pyright-internal/src/tests/samples/call6.py b/packages/pyright-internal/src/tests/samples/call6.py index 4ec95f69d..f907cf41a 100644 --- a/packages/pyright-internal/src/tests/samples/call6.py +++ b/packages/pyright-internal/src/tests/samples/call6.py @@ -1,9 +1,6 @@ # This sample tests the handling of unpack operators # used in argument expressions when used in conjunction with -# Tuples and *args parameters. - - -from typing import Tuple +# tuples and *args parameters. def foo1(a: int, b: int): @@ -15,21 +12,26 @@ def foo2(*args: int): fixed_tuple_0 = () -foo1(*fixed_tuple_0, 2) +foo1(*fixed_tuple_0, 2, 3) foo2(*fixed_tuple_0, 2) fixed_tuple_1 = (1,) -foo1(*fixed_tuple_1, 2) -foo2(*fixed_tuple_1, 2) + +# This should generate an error because there +# are too many parameters. +foo1(*fixed_tuple_1, 2, 3) + +foo2(*fixed_tuple_1, 2, *fixed_tuple_0) fixed_tuple_3 = (1, 3, 5) # This should generate an error because there # are too many parameters. foo1(*fixed_tuple_3, 2) -foo2(*fixed_tuple_3, 2) -homogen_tuple: Tuple[int, ...] = (1, 5, 3) +foo2(*fixed_tuple_3, 2, *fixed_tuple_0) + +homogen_tuple: tuple[int, ...] = (1, 5, 3) foo2(*homogen_tuple) foo2(*homogen_tuple, 2) diff --git a/packages/pyright-internal/src/tests/samples/call8.py b/packages/pyright-internal/src/tests/samples/call8.py new file mode 100644 index 000000000..851eb64a5 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/call8.py @@ -0,0 +1,44 @@ +# This sample tests a case where multiple overloaded calls are nested +# within each other. + +from typing import Any, Iterable, TypeVar, Protocol, overload +from typing_extensions import LiteralString + +_T = TypeVar("_T") +_T_co = TypeVar("_T_co", covariant=True) + + +class SupportsLenAndGetItem(Protocol[_T_co]): + def __getitem__(self, __k: int) -> _T_co: + ... + + +def choices(population: SupportsLenAndGetItem[_T]) -> list[_T]: + ... + + +@overload +def join(__iterable: Iterable[LiteralString]) -> LiteralString: # type:ignore + ... + + +@overload +def join(__iterable: Iterable[str]) -> str: + ... + + +@overload +def array(object: int) -> list[Any]: + ... + + +@overload +def array(object: object) -> list[Any]: + ... + + +def array(object: object) -> list[Any]: + ... + + +array([join(choices("")) for i in range(1)]) diff --git a/packages/pyright-internal/src/tests/samples/call9.py b/packages/pyright-internal/src/tests/samples/call9.py new file mode 100644 index 000000000..a6033f83b --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/call9.py @@ -0,0 +1,52 @@ +# This sample tests the case where a dictionary expansion operator +# is used in a call. The type checker should verify that the +# type supports a SupportsKeyAndGetItem protocol. + +from typing import Any, Generic, TypeVar, Mapping, KeysView + + +class MyMapping(Mapping[str, Any]): + ... + + +class StrRecord: + def __getitem__(self, __key: str) -> str: + ... + + def keys(self) -> KeysView[str]: + ... + + +T = TypeVar("T") + + +class GenericRecord(Generic[T]): + def __getitem__(self, __key: str) -> T: + ... + + def keys(self) -> KeysView[T]: + ... + + +def func1(**kwargs: Any) -> None: + ... + + +m = MyMapping() +r = StrRecord() + + +def func2( + m: MyMapping, + r: StrRecord, + g: GenericRecord[str], + mrg: MyMapping | StrRecord | GenericRecord[str], + bad: GenericRecord[bytes], +): + func1(**m) + func1(**r) + func1(**g) + func1(**mrg) + + # This should generate an error. + func1(**bad) diff --git a/packages/pyright-internal/src/tests/samples/callable6.py b/packages/pyright-internal/src/tests/samples/callable6.py index 85760c3e5..3850418c0 100644 --- a/packages/pyright-internal/src/tests/samples/callable6.py +++ b/packages/pyright-internal/src/tests/samples/callable6.py @@ -13,14 +13,15 @@ TA3 = Callable[[int, Unpack[Tuple[int, int]], str], int] +TA4 = Callable[[Unpack[Tuple[int, ...]]], _T] -def func1(x: TA1): +def func1(x: TA1[int]): r1 = x(3, 4, 5, (1, 2, "hi"), "hi") reveal_type(r1, expected_text="int") x(3, (1, 2, "hi"), "hi") - # This should generage an error because the first argument is not an int. + # This should generate an error because the first argument is not an int. x(None, (1, 2, "hi"), "hi") y = [1, 2, 3] @@ -37,6 +38,10 @@ def func2(x: TA3): x(3, 4, "hi", "hi") +def func6(x: TA4): + x() + + Ts = TypeVarTuple("Ts") diff --git a/packages/pyright-internal/src/tests/samples/callbackProtocol1.py b/packages/pyright-internal/src/tests/samples/callbackProtocol1.py index 8d645488e..fc63cee85 100644 --- a/packages/pyright-internal/src/tests/samples/callbackProtocol1.py +++ b/packages/pyright-internal/src/tests/samples/callbackProtocol1.py @@ -59,6 +59,10 @@ def func4(*a: bytes, **b: bytes): pass +def func5(**b: str): + pass + + var2: TestClass2 = func1 # This should generate an error. @@ -70,6 +74,9 @@ def func4(*a: bytes, **b: bytes): # This should generate an error. var2 = func4 +# This should generate an error. +var2 = func5 + class TestClass3(Protocol): def __call__(self) -> None: @@ -81,6 +88,7 @@ def __call__(self) -> None: var3 = func2 var3 = func3 var3 = func4 +var3 = func5 class TestClass4(Protocol): @@ -90,12 +98,12 @@ def __call__(self, x: int) -> None: pass -def func5(x: int) -> None: +def func6(x: int) -> None: pass # This should generate an error. -var4: TestClass4 = func5 +var4: TestClass4 = func6 class TestClass5(Protocol): @@ -103,11 +111,11 @@ def __call__(self, *, a: int, b: str) -> int: ... -def func6(a: int, b: str) -> int: +def func7(a: int, b: str) -> int: return 123 -f: TestClass5 = func6 +f: TestClass5 = func7 class TestClass6: diff --git a/packages/pyright-internal/src/tests/samples/callbackProtocol9.py b/packages/pyright-internal/src/tests/samples/callbackProtocol9.py new file mode 100644 index 000000000..133785f49 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/callbackProtocol9.py @@ -0,0 +1,29 @@ +# This sample tests that a call through a __call__ handles the case +# where the __call__ is a callable object itself. + +class A: + def __call__(self, v: int): + print("Received", v) + + +class B: + __call__ = A() + + +class C: + __call__ = B() + + +class D: + __call__ = C() + + +d = D() + +d(1) + +# This should generate an error because of the incompatible argument type. +d("1") + +# This should generate an error because of the wrong argument count. +d(1, 1) diff --git a/packages/pyright-internal/src/tests/samples/circular1.py b/packages/pyright-internal/src/tests/samples/circular1.py index c00bfed9d..d41d0dd9d 100644 --- a/packages/pyright-internal/src/tests/samples/circular1.py +++ b/packages/pyright-internal/src/tests/samples/circular1.py @@ -3,8 +3,8 @@ class Example1: - # This should not generate an error because "int" - # is not forward-declared. + # This should generate two errors because "str" refers to itself + # and it is a variable, so it's an illegal annotation. str: str = "" int = int diff --git a/packages/pyright-internal/src/tests/samples/classVar1.py b/packages/pyright-internal/src/tests/samples/classVar1.py index b75633ecf..7cf651120 100644 --- a/packages/pyright-internal/src/tests/samples/classVar1.py +++ b/packages/pyright-internal/src/tests/samples/classVar1.py @@ -15,7 +15,7 @@ def __set__(self, obj: Any, value: str): class Starship: captain: str = "Picard" damage: int - stats: ClassVar[Dict[str, int]] = {} + stats: "ClassVar[Dict[str, int]]" = {} desc: ClassVar[MyDescriptor] = MyDescriptor() def __init__(self, damage: int, captain: Optional[str] = None): diff --git a/packages/pyright-internal/src/tests/samples/classes1.py b/packages/pyright-internal/src/tests/samples/classes1.py index d0eda1cd3..602dcb25e 100644 --- a/packages/pyright-internal/src/tests/samples/classes1.py +++ b/packages/pyright-internal/src/tests/samples/classes1.py @@ -48,3 +48,10 @@ class I(E, other_keyword=2): class J(*args, **kwargs): pass + + +def func1(x: type) -> object: + class Y(x): + pass + + return Y() diff --git a/packages/pyright-internal/src/tests/samples/classes3.py b/packages/pyright-internal/src/tests/samples/classes3.py index cfaa6b079..01790b77c 100644 --- a/packages/pyright-internal/src/tests/samples/classes3.py +++ b/packages/pyright-internal/src/tests/samples/classes3.py @@ -2,6 +2,9 @@ # the type metaclass) are accessible without a type error. +from typing import TypeVar + + class TestClass: # These should be accessible within the class body print(__doc__) @@ -46,3 +49,12 @@ class NonMeta: def method1(self) -> str: # This should generate an error return self.__name__ + + +_T = TypeVar("_T") + + +def func1(cls: type[_T]) -> _T: + x1 = cls.__dict__ + x2 = cls.__mro__ + return cls() diff --git a/packages/pyright-internal/src/tests/samples/classes9.py b/packages/pyright-internal/src/tests/samples/classes9.py new file mode 100644 index 000000000..6574782f4 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/classes9.py @@ -0,0 +1,44 @@ +# This sample tests the reportIncompatibleVariableOverride +# configuration option in cases involving multiple inheritance +# where the override symbol is type compatible with the overridden. + + +# pyright: reportIncompatibleVariableOverride=true + +class A: + class M: + pass + +class B0(A): + class M(A.M): + pass + +class B1(A): + class M(A.M): + pass + +class C(B0, B1): + class M(B0.M, B1.M): + pass + +class D0(B0): + pass + +class D1(B1): + pass + +class D(D0, D1, C): + pass + + +class E0(B0): + pass + +class E1(B1): + pass + +# This should generate an error because B0.M is not +# type compatible with B1.M. +class E(E0, E1): + pass + diff --git a/packages/pyright-internal/src/tests/samples/codeFlow4.py b/packages/pyright-internal/src/tests/samples/codeFlow4.py index 0748b1208..1c8b7fff9 100644 --- a/packages/pyright-internal/src/tests/samples/codeFlow4.py +++ b/packages/pyright-internal/src/tests/samples/codeFlow4.py @@ -44,10 +44,10 @@ def func4(x: Color): if x == Color.RED: return - if x == Color.GREEN or (Color.PERIWINKLE == x and True): + if x == Color.GREEN or (x == Color.PERIWINKLE and True): y = 2 else: - if Color.BLUE == x: + if x == Color.BLUE: y = 3 print(y) diff --git a/packages/pyright-internal/src/tests/samples/codeFlow8.py b/packages/pyright-internal/src/tests/samples/codeFlow8.py new file mode 100644 index 000000000..13c51aa0d --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/codeFlow8.py @@ -0,0 +1,27 @@ +# This sample tests the case where an assignment expression +# is used within a looping construct such that the assigned +# value is initially unknown. + +# pyright: strict + +from typing import Iterator + +for _ in ["1"]: + old_lines: Iterator[str] = iter(["2", "3"]) + + try: + while True: + line = next(old_lines) + count = 1 + if count: + while True: + if not (line := next(old_lines)): + pass + elif line.startswith(""): + print(line.removeprefix("")) + else: + old_lines = iter([line] + list(old_lines)) + break + + except StopIteration: + pass diff --git a/packages/pyright-internal/src/tests/samples/comparison1.py b/packages/pyright-internal/src/tests/samples/comparison1.py index caad44f03..52123d5e8 100644 --- a/packages/pyright-internal/src/tests/samples/comparison1.py +++ b/packages/pyright-internal/src/tests/samples/comparison1.py @@ -11,15 +11,18 @@ def func1(os: OS, val: Literal[1, "linux"]): if os == "Linux": return True - # This should generate an error because there is no overlap in types. + # This should generate an error because this expression will always + # evaluate to False. if os == "darwin": return False - # This should generate an error because there is no overlap in types. + # This should generate an error because this expression will always + # evaluate to True. if os != val: return False - # This should generate an error because there is no overlap in types. + # This should generate an error because this expression will always + # evaluate to False. if val == 2: return False diff --git a/packages/pyright-internal/src/tests/samples/comparison2.py b/packages/pyright-internal/src/tests/samples/comparison2.py index a804731bc..98a30bbfd 100644 --- a/packages/pyright-internal/src/tests/samples/comparison2.py +++ b/packages/pyright-internal/src/tests/samples/comparison2.py @@ -2,6 +2,10 @@ # when applied to functions that appear within a conditional expression. +from typing import Any +from dataclasses import dataclass + + def cond() -> bool: ... @@ -37,3 +41,28 @@ def func1(): a = 1 if cond else 2 b = "1" == "1" == "1" + +c = "" +# This should generate a diagnostic when reportUnnecessaryComparison is enabled. +if c is None: + pass + +# This should generate a diagnostic when reportUnnecessaryComparison is enabled. +if c is not None: + pass + + +def func2(d: str | Any): + if d is None: + pass + + +@dataclass +class DC1: + bar: str + + +def func3(x: DC1): + # This should generate an error if reportUnnecessaryComparison is enabled. + if x == 42: + ... diff --git a/packages/pyright-internal/src/tests/samples/constructor15.py b/packages/pyright-internal/src/tests/samples/constructor15.py new file mode 100644 index 000000000..c9b76b48d --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/constructor15.py @@ -0,0 +1,46 @@ +# This sample tests the case where a constructor for a generic +# class is called with an inference context (i.e. using bidirectional +# type inference) and literals are used as type arguments. + +from typing import Any, Generic, Literal, Self, TypeVar + +_N = TypeVar("_N") +_M = TypeVar("_M") + + +class A(Generic[_M, _N]): + def __new__(cls, m: _M, n: _N) -> "A[_M, _N]": + ... + + +a: A[Literal[3], Literal[4]] = A(3, 4) + + +class B(Generic[_M, _N]): + def __new__(cls, m: _M, n: _N) -> A[_M, _N]: + ... + + def __init__(self, *args: Any, **kwargs: Any) -> None: + ... + + +b: B[Literal[3], Literal[4]] = B(3, 4) + + +class C(Generic[_M, _N]): + def __new__(cls, m: _M, n: _N) -> A[_M, _N]: + ... + + def __init__(self, m: _M, n: _N) -> None: + ... + + +c: C[Literal[3], Literal[4]] = C(3, 4) + + +class D(Generic[_M, _N]): + def __new__(cls, m: _M, n: _N) -> Self: + ... + + +d: D[Literal[3], Literal[4]] = D(3, 4) diff --git a/packages/pyright-internal/src/tests/samples/dataclass1.py b/packages/pyright-internal/src/tests/samples/dataclass1.py index 879e9bff8..b826fc665 100644 --- a/packages/pyright-internal/src/tests/samples/dataclass1.py +++ b/packages/pyright-internal/src/tests/samples/dataclass1.py @@ -7,6 +7,9 @@ class Other: pass +def standalone(obj: object) -> None: + print(obj) + class DataTuple(NamedTuple): def _m(self): pass @@ -25,8 +28,11 @@ def _m(self): name2: Final[Optional[str]] = None + not_a_method = standalone d1 = DataTuple(id=1, aid=Other(), name2="hi") +d1.not_a_method() + d2 = DataTuple(id=1, aid=Other(), value="v") d3 = DataTuple(id=1, aid=Other(), name="hello") d4 = DataTuple(id=1, aid=Other(), name=None) diff --git a/packages/pyright-internal/src/tests/samples/dataclass13.py b/packages/pyright-internal/src/tests/samples/dataclass13.py index 9008d7bc4..dde92e784 100644 --- a/packages/pyright-internal/src/tests/samples/dataclass13.py +++ b/packages/pyright-internal/src/tests/samples/dataclass13.py @@ -28,6 +28,13 @@ class DC4(DC2): val5: ClassVar[int] +# This should generate an error because a non-frozen dataclass +# cannot inherit from a frozen dataclass. +@dataclass(frozen=False) +class DC5(DC2): + val4: int = 5 + + a = DC1(val1=3) a.val1 = 3 diff --git a/packages/pyright-internal/src/tests/samples/dataclass17.py b/packages/pyright-internal/src/tests/samples/dataclass17.py index ba198d757..520731e5b 100644 --- a/packages/pyright-internal/src/tests/samples/dataclass17.py +++ b/packages/pyright-internal/src/tests/samples/dataclass17.py @@ -44,3 +44,26 @@ class D: D(1, "bar") + + +@dataclass(slots=True) +class E: + a: int + + +E.__slots__ +E(1).__slots__ + +reveal_type(E.__slots__, expected_text="Iterable[str]") + + +@dataclass +class F: + a: int + + +# This should generate an error. +F.__slots__ + +# This should generate an error. +F(1).__slots__ diff --git a/packages/pyright-internal/src/tests/samples/dataclass24.py b/packages/pyright-internal/src/tests/samples/dataclass24.py new file mode 100644 index 000000000..0d0a1ac57 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/dataclass24.py @@ -0,0 +1,20 @@ +# This sample tests the generation of __init__ when some ancestor +# classes are unknown. + +from dataclasses import dataclass +import abc +from random import random + +C = abc.ABC if random() else object + +class B(C): + def __init__(self, x: int): + pass + + +@dataclass +class A(B): + color: str + + +reveal_type(A.__init__, expected_text="(self: A, *args: Any, **kwargs: Any) -> None") diff --git a/packages/pyright-internal/src/tests/samples/dataclass4.py b/packages/pyright-internal/src/tests/samples/dataclass4.py index b040b9cea..960701213 100644 --- a/packages/pyright-internal/src/tests/samples/dataclass4.py +++ b/packages/pyright-internal/src/tests/samples/dataclass4.py @@ -62,3 +62,10 @@ class Baz3: # the ordering requirement is not enforced when # init=False. ccc: str + + +@dataclass +class Baz4: + # Private names are not allowed, so this should + # generate an error. + __private: int diff --git a/packages/pyright-internal/src/tests/samples/dataclass7.py b/packages/pyright-internal/src/tests/samples/dataclass7.py index 40f71bb12..a76d8447f 100644 --- a/packages/pyright-internal/src/tests/samples/dataclass7.py +++ b/packages/pyright-internal/src/tests/samples/dataclass7.py @@ -91,3 +91,16 @@ class DC9(DC8): # This should generate an error because the default # value for "a" is inherited from the base class. b: str + + +@dataclass +class DC10: + a: str = field(init=False, default="s") + b: bool = field() + + +@dataclass +class DC11(DC10): + a: str = field() + b: bool = field() + diff --git a/packages/pyright-internal/src/tests/samples/dataclassTransform1.py b/packages/pyright-internal/src/tests/samples/dataclassTransform1.py index 51c114755..867ca056d 100644 --- a/packages/pyright-internal/src/tests/samples/dataclassTransform1.py +++ b/packages/pyright-internal/src/tests/samples/dataclassTransform1.py @@ -69,3 +69,24 @@ class Customer2Subclass(Customer2, frozen=True): c2_2 = Customer2(0, "John") v2 = c2_1 < c2_2 + + +@dataclass_transform(kw_only_default=True, order_default=True, frozen_default=True) +def create_model_frozen(cls: _T) -> _T: + ... + +@create_model_frozen +class Customer3: + id: int + name: str + +# This should generate an error because a non-frozen class +# cannot inherit from a frozen class. +@create_model +class Customer3Subclass(Customer3): + age: int + +c3_1 = Customer3(id=2, name="hi") + +# This should generate an error because Customer3 is frozen. +c3_1.id = 4 diff --git a/packages/pyright-internal/src/tests/samples/dataclassTransform2.py b/packages/pyright-internal/src/tests/samples/dataclassTransform2.py index 82680d558..0c5cf9c17 100644 --- a/packages/pyright-internal/src/tests/samples/dataclassTransform2.py +++ b/packages/pyright-internal/src/tests/samples/dataclassTransform2.py @@ -23,6 +23,8 @@ def model_field( field_specifiers=(ModelField, model_field), ) class ModelMeta(type): + not_a_field: str + def __init_subclass__( cls, *, @@ -43,6 +45,8 @@ class Customer1(ModelBase, frozen=True): name2: str = model_field(alias="other_name", default="None") +# This should generate an error because a non-frozen class cannot +# derive from a frozen one. class Customer1Subclass(Customer1, frozen=False): salary: float = model_field() @@ -76,3 +80,22 @@ class Customer2(ModelBase, order=True): # This should generate an error because Customer2 supports # keyword-only parameters for its constructor. c2_3 = Customer2(0, "John") + + + +@dataclass_transform(frozen_default=True) +class ModelMetaFrozen(type): + pass + +class ModelBaseFrozen(metaclass=ModelMetaFrozen): + ... + +class Customer3(ModelBaseFrozen): + id: int + name: str + + +c3_1 = Customer3(id=2, name="hi") + +# This should generate an error because Customer3 is frozen. +c3_1.id = 4 diff --git a/packages/pyright-internal/src/tests/samples/dataclassTransform3.py b/packages/pyright-internal/src/tests/samples/dataclassTransform3.py index cb1860bfd..c2fbe26af 100644 --- a/packages/pyright-internal/src/tests/samples/dataclassTransform3.py +++ b/packages/pyright-internal/src/tests/samples/dataclassTransform3.py @@ -1,7 +1,7 @@ # This sample tests the handling of the dataclass_transform mechanism # when applied to a class. -from typing import Any, Callable, Optional, Tuple, TypeVar, Union +from typing import Any, Callable, Generic, Optional, Tuple, TypeVar, Union _T = TypeVar("_T") @@ -11,6 +11,7 @@ def __dataclass_transform__( eq_default: bool = True, order_default: bool = False, kw_only_default: bool = False, + frozen_default: bool = False, field_specifiers: Tuple[Union[type, Callable[..., Any]], ...] = (()), ) -> Callable[[_T], _T]: return lambda a: a @@ -32,6 +33,8 @@ def model_field( field_specifiers=(ModelField, model_field), ) class ModelBase: + not_a_field: str + def __init_subclass__( cls, *, @@ -48,7 +51,9 @@ class Customer1(ModelBase, frozen=True): name2: str = model_field(alias="other_name", default="None") -class Customer1Subclass(Customer1, frozen=False): +# This should generate an error because a non-frozen dataclass cannot +# derive from a frozen one. +class Customer1Subclass(Customer1): salary: float = model_field() @@ -65,7 +70,6 @@ class Customer2(ModelBase, order=True): # This should generate an error because the class is kw_only. c1_2 = Customer1(3, "Sue") -# This should generate an error because other_name is missing. c1_3 = Customer1(id=3, name="John") # This should generate an error because comparison methods are @@ -81,3 +85,45 @@ class Customer2(ModelBase, order=True): # This should generate an error because Customer2 supports # keyword-only parameters for its constructor. c2_3 = Customer2(0, "John") + +_T = TypeVar("_T") + + +@__dataclass_transform__( + kw_only_default=True, + field_specifiers=(ModelField, model_field), +) +class GenericModelBase(Generic[_T]): + not_a_field: _T + + def __init_subclass__( + cls, + *, + frozen: bool = False, + kw_only: bool = True, + order: bool = True, + ) -> None: + ... + + +class GenericCustomer(GenericModelBase[int]): + id: int = model_field() + + +gc_1 = GenericCustomer(id=3) + + +@__dataclass_transform__(frozen_default=True) +class ModelBaseFrozen: + not_a_field: str + + +class Customer3(ModelBaseFrozen): + id: int + name: str + + +c3_1 = Customer3(id=2, name="hi") + +# This should generate an error because Customer3 is frozen. +c3_1.id = 4 diff --git a/packages/pyright-internal/src/tests/samples/deprecated2.py b/packages/pyright-internal/src/tests/samples/deprecated2.py new file mode 100644 index 000000000..ffd2c69a8 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/deprecated2.py @@ -0,0 +1,92 @@ +# This sample tests the @typing.deprecated decorator introduced in PEP 702. + +from typing import Self +from typing_extensions import deprecated, overload + + +@deprecated("Use ClassB instead") +class ClassA: + ... + + +# This should generate an error if reportDeprecated is enabled. +ClassA() + + +class ClassC: + @deprecated("Don't temp me") + def method1(self) -> None: + ... + + @overload + @deprecated("Int is no longer supported") + def method2(self, a: int) -> None: + ... + + @overload + def method2(self, a: None = None) -> None: + ... + + def method2(self, a: int | None = None) -> None: + ... + + +c1 = ClassC() + +# This should generate an error if reportDeprecated is enabled. +c1.method1() + +c1.method2() + +# This should generate an error if reportDeprecated is enabled. +c1.method2(2) + + +@deprecated("Test") +def func1() -> None: + ... + + +# This should generate an error if reportDeprecated is enabled. +func1() + + +@overload +def func2(a: str) -> None: + ... + + +@overload +@deprecated("int no longer supported") +def func2(a: int) -> int: + ... + + +def func2(a: str | int) -> int | None: + ... + + +func2("hi") + +# This should generate an error if reportDeprecated is enabled. +func2(3) + + +class ClassD: + @overload + def __init__(self, x: int) -> None: + ... + + @overload + @deprecated("str no longer supported") + def __init__(self, x: str) -> None: + ... + + def __init__(self, x: int | str) -> None: + ... + + +ClassD(3) + +# This should generate an error if reportDeprecated is enabled. +ClassD("") diff --git a/packages/pyright-internal/src/tests/samples/deprecated3.py b/packages/pyright-internal/src/tests/samples/deprecated3.py new file mode 100644 index 000000000..954e0cd31 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/deprecated3.py @@ -0,0 +1,25 @@ +# This sample tests the @typing.deprecated decorator introduced in PEP 702. + +# This should generate an error if reportDeprecated is enabled. +from .deprecated2 import func1 + +# This should generate an error if reportDeprecated is enabled. +from .deprecated2 import ClassA as A + +from .deprecated2 import func2 +from .deprecated2 import ClassC as C + +func2("hi") + +# This should generate an error if reportDeprecated is enabled. +func2(1) + +# This should generate an error if reportDeprecated is enabled. +c1 = C.method1 + + +c2 = C() +c2.method2() + +# This should generate an error if reportDeprecated is enabled. +c2.method2(3) diff --git a/packages/pyright-internal/src/tests/samples/dictionary1.py b/packages/pyright-internal/src/tests/samples/dictionary1.py index 11a143b86..33d691d7b 100644 --- a/packages/pyright-internal/src/tests/samples/dictionary1.py +++ b/packages/pyright-internal/src/tests/samples/dictionary1.py @@ -40,3 +40,10 @@ def wantsIntDict(a: Dict[int, int]): "max": max, "sum": sum, } + +LiteralDict = dict[LitChoices, str] + +d6: LiteralDict = {"ab": "x"} +d7: LiteralDict = {"bcd": "y"} +d6 = {**d6, **d7} +d6 = d6 | d7 \ No newline at end of file diff --git a/packages/pyright-internal/src/tests/samples/enums10.py b/packages/pyright-internal/src/tests/samples/enums10.py new file mode 100644 index 000000000..49afbf3dc --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/enums10.py @@ -0,0 +1,15 @@ +# This sample tests the case where an enum class is used as a bound +# for a TypeVar and instantiated. + +# pyright: strict + +from enum import Enum +from typing import TypeVar + +TEnum = TypeVar("TEnum", bound=Enum) + + +def func1(enum_cls: type[TEnum], enum_value: object) -> TEnum: + enum_member = enum_cls(enum_value) + reveal_type(enum_member, expected_text="TEnum@func1") + return enum_member diff --git a/packages/pyright-internal/src/tests/samples/expressions7.py b/packages/pyright-internal/src/tests/samples/expressions7.py index c1fe4f808..ab287951e 100644 --- a/packages/pyright-internal/src/tests/samples/expressions7.py +++ b/packages/pyright-internal/src/tests/samples/expressions7.py @@ -15,8 +15,8 @@ def baz() -> str: reveal_type(foo() and bar(), expected_text="int | Literal[False]") reveal_type(foo() and baz(), expected_text="str | Literal[False]") -reveal_type(bar() and foo(), expected_text="int | bool") -reveal_type(baz() and foo(), expected_text="str | bool") +reveal_type(bar() and foo(), expected_text="bool | Literal[0]") +reveal_type(baz() and foo(), expected_text="bool | Literal['']") reveal_type(foo() or bar(), expected_text="int | Literal[True]") reveal_type(foo() or baz(), expected_text="str | Literal[True]") diff --git a/packages/pyright-internal/src/tests/samples/fstring1.py b/packages/pyright-internal/src/tests/samples/fstring1.py index e77ecd3c3..748a6bf87 100644 --- a/packages/pyright-internal/src/tests/samples/fstring1.py +++ b/packages/pyright-internal/src/tests/samples/fstring1.py @@ -8,6 +8,12 @@ # This should generate an error. b = f"hello { \t1 }" +# This should generate an error. +b1 = f"""{"\n"}""" + +# This should generate an error. +b2 = f"{r'\n'}" + # Test f-string with unterminated expression. # This should generate an error. @@ -64,3 +70,11 @@ # f-string with quotes within quotes within quotes. k = f"""{"#M's#".replace(f"'", '')!r}""" + + +# f-strings with escape characters in the format string section. +my_str = "" +width = 3 +l = f"{my_str:\>{width}s}" +m = f"{my_str:\x00>{width}s}" +n = f"{my_str:\u2007>{width}s}" diff --git a/packages/pyright-internal/src/tests/samples/fstring3.py b/packages/pyright-internal/src/tests/samples/fstring3.py index bf3c96296..a228e1904 100644 --- a/packages/pyright-internal/src/tests/samples/fstring3.py +++ b/packages/pyright-internal/src/tests/samples/fstring3.py @@ -7,7 +7,7 @@ b1 = f"{'''hello'''}" -c1 = f"""{"\""}""" +c1 = f"""{'"'}""" hello1 = 3 d1 = f"{ f'{hello1}' }" @@ -15,14 +15,14 @@ print(f"{'a' if 'b' != d1 else 'd'}") -a2 = fr"[{{name}}{'}' if True else ''}]" +a2 = rf"[{{name}}{'}' if True else ''}]" -b2 = fr"{'''hello'''}" +b2 = rf"{'''hello'''}" -c2 = rf"""{"\""}""" +c2 = rf"""{'"'}""" hello2 = 3 -d2 = fr"{ rf'{hello2}' }" +d2 = rf"{ rf'{hello2}' }" e1 = f''' { f""" { @@ -32,4 +32,3 @@ ]) }""" }''' - diff --git a/packages/pyright-internal/src/tests/samples/function12.py b/packages/pyright-internal/src/tests/samples/function12.py new file mode 100644 index 000000000..02775f256 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/function12.py @@ -0,0 +1,26 @@ +# This sample tests the case where a union of callables is passed +# to a generic function and the parameter types are subtypes of +# each other. + +from typing import Any, Callable, Generic, TypeVar + +T_contra = TypeVar('T_contra', contravariant=True) + + +class Thing1: + prop1: str + + +class Thing2: + prop1: str + prop2: str + + +class ClassA(Generic[T_contra]): + def __init__(self, callback: Callable[[T_contra], Any]) -> None: + ... + + +def func1(cb: Callable[[Thing1], Any] | Callable[[Thing1 | Thing2], Any]): + reveal_type(ClassA(cb), expected_text="ClassA[Thing1]") + diff --git a/packages/pyright-internal/src/tests/samples/futureImport1.py b/packages/pyright-internal/src/tests/samples/futureImport1.py new file mode 100644 index 000000000..172c4bc32 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/futureImport1.py @@ -0,0 +1,5 @@ +# This sample tests that __future__ imports are found +# only at the beginning of a file. + +""" Doc String """ "Extension" +from __future__ import annotations; from __future__ import with_statement diff --git a/packages/pyright-internal/src/tests/samples/futureImport2.py b/packages/pyright-internal/src/tests/samples/futureImport2.py new file mode 100644 index 000000000..b68ebdde7 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/futureImport2.py @@ -0,0 +1,9 @@ +# This sample tests that __future__ imports are found +# only at the beginning of a file. + +""" Doc String """ +"Extension" +from __future__ import annotations # This should generate an error + +def func(): + from __future__ import annotations # This should generate an error diff --git a/packages/pyright-internal/src/tests/samples/futureImport3.py b/packages/pyright-internal/src/tests/samples/futureImport3.py new file mode 100644 index 000000000..301113846 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/futureImport3.py @@ -0,0 +1,4 @@ +# This sample tests that __future__ imports are found +# only at the beginning of a file. + +from typing import Any; from __future__ import annotations # This should generate an error diff --git a/packages/pyright-internal/src/tests/samples/generators1.py b/packages/pyright-internal/src/tests/samples/generators1.py index 653f18a84..2f14ef15b 100644 --- a/packages/pyright-internal/src/tests/samples/generators1.py +++ b/packages/pyright-internal/src/tests/samples/generators1.py @@ -102,7 +102,6 @@ def generator9() -> int: # This should generate an error. async def generator10() -> int: yield None - return 3 # This should generate an error. @@ -117,6 +116,11 @@ class TD1(TypedDict): def generator12() -> Generator[TD1, None, None]: yield {"x": "x"} + def generator13() -> Generator[TD1, None, None]: # This should generate an error. yield {"y": "x"} + + +def generator14() -> Iterator[TD1]: + yield {"x": "x"} diff --git a/packages/pyright-internal/src/tests/samples/generators16.py b/packages/pyright-internal/src/tests/samples/generators16.py new file mode 100644 index 000000000..18805e3f4 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/generators16.py @@ -0,0 +1,18 @@ +# This sample tests the case where a return statement within an async +# generator has an explicit return value. This generates a syntax +# error at runtime. + +from typing import Any, AsyncIterable + + +async def func1(n: int, fa: AsyncIterable[Any]): + if n <= 0: + return None + + g = aiter(fa) + + while True: + try: + yield await g.__anext__() + except StopAsyncIteration: + return diff --git a/packages/pyright-internal/src/tests/samples/genericTypes10.py b/packages/pyright-internal/src/tests/samples/genericTypes10.py index e95b49d15..78d5c2b9c 100644 --- a/packages/pyright-internal/src/tests/samples/genericTypes10.py +++ b/packages/pyright-internal/src/tests/samples/genericTypes10.py @@ -1,7 +1,7 @@ # This sample tests that a Generic base class overrides the type parameter # ordering of other type parameters. -from typing import Container, Generic, Iterable, Iterator, Mapping, Protocol, TypeVar +from typing import Generic, Iterable, Iterator, Mapping, TypeVar _T1 = TypeVar("_T1") _T2 = TypeVar( @@ -29,7 +29,7 @@ class Bar(Generic[_T1], Generic[_T2]): pass -K = TypeVar("K", covariant=True) +K = TypeVar("K") V = TypeVar("V") # This should generate an error because V isn't included diff --git a/packages/pyright-internal/src/tests/samples/genericTypes100.py b/packages/pyright-internal/src/tests/samples/genericTypes100.py new file mode 100644 index 000000000..f86c5eacd --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/genericTypes100.py @@ -0,0 +1,16 @@ +# This sample tests the assignment of unions that contain TypeVars. + + +from typing import TypeVar + + +T = TypeVar("T") + +def func1(x: T | None) -> T | str: + # This should generate an error. + return x + +def func2(x: T | int) -> T | str: + # This should generate an error. + return x + diff --git a/packages/pyright-internal/src/tests/samples/genericTypes101.py b/packages/pyright-internal/src/tests/samples/genericTypes101.py new file mode 100644 index 000000000..3131f68c4 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/genericTypes101.py @@ -0,0 +1,47 @@ +# This sample tests the handling of generic callbacks passed to a higher-order +# function that is also generic. + +from typing import Callable, ParamSpec, Protocol, TypeVar + +_T = TypeVar("_T") +_T1 = TypeVar("_T1") +_T_co = TypeVar("_T_co", covariant=True) +_U = TypeVar("_U") + +class MyIterable(Protocol[_T_co]): ... +class MySupportsAbs(Protocol[_T_co]): ... + +def my_abs(x: MySupportsAbs[_T], /) -> _T: ... +def my_map(a: Callable[[_T], _U], b: MyIterable[_T]) -> MyIterable[_U]: ... + +def func1(xs: MyIterable[MySupportsAbs[int]]): + ys0 = my_map(a=my_abs, b=xs) + reveal_type(ys0, expected_text="MyIterable[int]") + + ys1 = my_map(b=xs, a=my_abs) + reveal_type(ys1, expected_text="MyIterable[int]") + + +def ident(x: _U) -> _U: + return x + +def func2(__cb: Callable[[_T1], _T], __arg0: _T1) -> _T: + ... + +x1_0 = func2(ident, "hi") +reveal_type(x1_0, expected_text="str") + +x1_1 = func2(ident, 1) +reveal_type(x1_1, expected_text="int") + + +_P = ParamSpec("_P") +_R = TypeVar("_R") +def func3(__obj: Callable[_P, _R], *args: _P.args, **kwargs: _P.kwargs) -> _R: + ... + +x2_0 = func3(ident, "hi") +reveal_type(x2_0, expected_text="str") + +x2_1 = func3(ident, 1) +reveal_type(x2_1, expected_text="int") diff --git a/packages/pyright-internal/src/tests/samples/genericTypes102.py b/packages/pyright-internal/src/tests/samples/genericTypes102.py new file mode 100644 index 000000000..3ff17e2aa --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/genericTypes102.py @@ -0,0 +1,23 @@ +# This sample tests the case where a invariant type parameter is used +# within a contravariant type argument. + +from typing import TypeVar, Generic + +T = TypeVar("T") +T_contra = TypeVar("T_contra", contravariant=True) + + +class Contra(Generic[T_contra]): + ... + + +class Foo(Generic[T]): + ... + + +class Bar(Foo[T]): + ... + + +def func(x: Contra[Foo[int]]): + v: Contra[Bar[int]] = x diff --git a/packages/pyright-internal/src/tests/samples/genericTypes103.py b/packages/pyright-internal/src/tests/samples/genericTypes103.py new file mode 100644 index 000000000..8af28608a --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/genericTypes103.py @@ -0,0 +1,45 @@ +# This sample tests the "complexity" calculation in the constraint +# solver to select the less-complex solution. + +from typing import Callable, Generic, Protocol, TypeVar + +T = TypeVar("T") +S = TypeVar("S") +T_contra = TypeVar("T_contra", contravariant=True) +TResult = TypeVar("TResult") + + +class ResolveFunc(Protocol[T_contra]): + def __call__(self, resolve_value: T_contra) -> None: + ... + + +FullfillFunc = Callable[[T], TResult | "Promise[TResult]"] +ExecutorFunc = Callable[[ResolveFunc[T]], None] + + +class Promise(Generic[T]): + @staticmethod + def resolve(resolve_value: S) -> "Promise[S]": + ... + + def __init__(self, executor_func: ExecutorFunc[T]) -> None: + ... + + def then(self, onfullfilled: FullfillFunc[T, TResult]) -> "Promise[TResult]": + ... + + +Promise.resolve(1).then(lambda result: reveal_type(result, expected_text="int")) + +Promise.resolve(1).then(lambda result: "abc").then( + lambda result: reveal_type(result, expected_text="str") +) + +Promise.resolve(None).then(lambda result: Promise.resolve("abc" or 123)).then( + lambda result: reveal_type(result, expected_text="str | int") +) + +Promise.resolve(None).then(lambda result: "abc" or 123).then( + lambda result: reveal_type(result, expected_text="int | str") +) diff --git a/packages/pyright-internal/src/tests/samples/genericTypes104.py b/packages/pyright-internal/src/tests/samples/genericTypes104.py new file mode 100644 index 000000000..195f19d76 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/genericTypes104.py @@ -0,0 +1,31 @@ +# This sample tests the case where a contravariant TypeVar is used in a protocol. + +from typing import Generic, Protocol, TypeVar + +T_contra = TypeVar("T_contra", contravariant=True) + + +class Contra(Generic[T_contra]): + ... + + +class Foo(Protocol[T_contra]): + def f(self) -> Contra[T_contra]: + ... + + +def t1(x: Foo[T_contra]) -> T_contra | None: + ... + + +def t2(x: Foo[object]) -> None: + ... + + +def func1(x: Foo[T_contra]) -> T_contra | None: + # This should generate an error. + t2(x) + + +def func2(x: Foo[object]) -> None: + t1(x) diff --git a/packages/pyright-internal/src/tests/samples/genericTypes105.py b/packages/pyright-internal/src/tests/samples/genericTypes105.py new file mode 100644 index 000000000..83a677378 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/genericTypes105.py @@ -0,0 +1,56 @@ +# This sample tests the case where a generic function is passed +# as an argument to another generic function multiple times. + +from typing import TypeVar, Callable + +T = TypeVar("T") +A = TypeVar("A") +B = TypeVar("B") +C = TypeVar("C") +X = TypeVar("X") +Y = TypeVar("Y") +Z = TypeVar("Z") + + +def identity(x: T) -> T: + return x + + +def triple_1( + f: Callable[[A], X], g: Callable[[B], Y], h: Callable[[C], Z] +) -> Callable[[A, B, C], tuple[X, Y, Z]]: + def wrapped(a: A, b: B, c: C) -> tuple[X, Y, Z]: + return f(a), g(b), h(c) + + return wrapped + + +def triple_2( + f: tuple[Callable[[A], X], Callable[[B], Y], Callable[[C], Z]] +) -> Callable[[A, B, C], tuple[X, Y, Z]]: + def wrapped(a: A, b: B, c: C) -> tuple[X, Y, Z]: + return f[0](a), f[1](b), f[2](c) + + return wrapped + + +def test_1(f: Callable[[A], X]) -> Callable[[A, B, C], tuple[X, B, C]]: + val = triple_1(f, identity, identity) + + reveal_type( + val, + expected_text="(A@test_1, T@identity, T(1)@identity) -> tuple[X@test_1, T@identity, T(1)@identity]", + ) + + return val + + +def test_2(f: Callable[[A], X]) -> Callable[[A, B, C], tuple[X, B, C]]: + val = triple_2((f, identity, identity)) + + reveal_type( + val, + expected_text="(A@test_2, T(1)@identity, T(2)@identity) -> tuple[X@test_2, T(1)@identity, T(2)@identity]", + ) + + return val diff --git a/packages/pyright-internal/src/tests/samples/genericTypes28.py b/packages/pyright-internal/src/tests/samples/genericTypes28.py index 060afef69..d50e9ac8d 100644 --- a/packages/pyright-internal/src/tests/samples/genericTypes28.py +++ b/packages/pyright-internal/src/tests/samples/genericTypes28.py @@ -1,7 +1,7 @@ # This sample tests that Optional types can be matched # to Type[T] expressions. -from typing import Generic, Optional, Type, TypeVar +from typing import Callable, Generic, Optional, Type, TypeVar _T1 = TypeVar("_T1") _T2 = TypeVar("_T2", bound=None) @@ -49,3 +49,7 @@ def bar(value: _T1) -> Type[Foo[_T1]]: d = Bar.get() reveal_type(d, expected_text="Type[Bar]") reveal_type(Bar.get(), expected_text="Type[Bar]") + + +def class_constructor(cls: type[_T1]) -> Callable[..., _T1]: + return cls diff --git a/packages/pyright-internal/src/tests/samples/genericTypes29.py b/packages/pyright-internal/src/tests/samples/genericTypes29.py index 319e52022..01c5795d3 100644 --- a/packages/pyright-internal/src/tests/samples/genericTypes29.py +++ b/packages/pyright-internal/src/tests/samples/genericTypes29.py @@ -17,8 +17,4 @@ keys = channel_types.keys() -_T = TypeVar("_T") -_S = TypeVar("_S") - - options.update(dict.fromkeys(keys, 1)) diff --git a/packages/pyright-internal/src/tests/samples/genericTypes31.py b/packages/pyright-internal/src/tests/samples/genericTypes31.py index 761a72bc0..d8c18a5d7 100644 --- a/packages/pyright-internal/src/tests/samples/genericTypes31.py +++ b/packages/pyright-internal/src/tests/samples/genericTypes31.py @@ -2,29 +2,48 @@ # whereby it attempts to solve type variables with the simplest # possible solution. -from typing import Union, List, TypeVar, Type +from typing import Callable, TypeVar T = TypeVar("T") -def to_list1(obj_type: Type[T], obj: Union[List[T], T]) -> List[T]: +def func1(obj_type: type[T], obj: list[T] | T) -> list[T]: return [] -def to_list2(obj_type: Type[T], obj: Union[T, List[T]]) -> List[T]: +def func2(obj_type: type[T], obj: T | list[T]) -> list[T]: return [] -input_list: List[str] = ["string"] +def func3(input1: list[str]): + val1 = func1(str, input1) + reveal_type(val1, expected_text="list[str]") + val2 = func2(str, input1) + reveal_type(val2, expected_text="list[str]") -# The expression on the RHS can satisfy the type variable T -# with either the type str or Union[List[str], str]. It should -# pick the simpler of the two. -output_list1 = to_list1(str, input_list) -verify_type1: List[str] = output_list1 -# The resulting type should not depend on the order of the union -# elements. -output_list2 = to_list2(str, input_list) -verify_type2: List[str] = output_list2 +def func4( + func: Callable[[], T] | Callable[[T], None] | list[T] | dict[str, T] | T +) -> T: + ... + + +def func5(func: Callable[[], T]) -> T: + ... + + +def func6(val: str) -> None: + ... + + +def func7() -> str: + ... + + +reveal_type(func4([""]), expected_text="str") +reveal_type(func4({"": 1}), expected_text="int") +reveal_type(func4(func6), expected_text="str") +reveal_type(func4(func7), expected_text="str") +reveal_type(func4(str), expected_text="Type[str]") +reveal_type(func5(str), expected_text="str") diff --git a/packages/pyright-internal/src/tests/samples/genericTypes79.py b/packages/pyright-internal/src/tests/samples/genericTypes79.py index 8b8680c67..4ce0041cc 100644 --- a/packages/pyright-internal/src/tests/samples/genericTypes79.py +++ b/packages/pyright-internal/src/tests/samples/genericTypes79.py @@ -35,3 +35,7 @@ def func3(value: _T) -> Callable[[_T], None]: x: Callable[[Tuple[bool]], None] = func3((True,)) + +def func4(v: _T, f: Callable[[_T], None]): ... +def func5(v: Literal[1, 2], f: Callable[[Literal[1, 2]], None]): + func4(v, f) diff --git a/packages/pyright-internal/src/tests/samples/genericTypes94.py b/packages/pyright-internal/src/tests/samples/genericTypes94.py index 0802dda7a..fe9cf0e31 100644 --- a/packages/pyright-internal/src/tests/samples/genericTypes94.py +++ b/packages/pyright-internal/src/tests/samples/genericTypes94.py @@ -1,8 +1,10 @@ # This sample tests for the case where a generic callable type is # specialized with type variables in a recursive manner. -from typing import Callable, Generic, TypeVar +from dataclasses import dataclass +from typing import Callable, Generic, Iterable, Iterator, TypeVar, overload +S = TypeVar("S") T = TypeVar("T") U = TypeVar("U") V = TypeVar("V") @@ -21,3 +23,60 @@ def __add__(self, other: "ClassA[U, V]") -> "ClassA[T, V]": f = self.x g: Callable[[U], V] = other.x return ClassA(lambda x: g(f(x))) + + +class ClassB(Generic[T]): + value: T + + def __init__(self, val: T) -> None: + self.value = val + + def method1(self, val: U) -> "ClassB[U]": + # This should generate an error. + return ClassB(self.value) + +@dataclass +class DC1(Generic[T]): + value: T + +@dataclass +class DC2(Generic[S]): + value: S + +@dataclass +class ClassC(Generic[T, S]): + value: DC1[T] | DC2[S] + + def method1(self, val: U) -> "ClassC[U, S]": + if isinstance(self.value, DC1): + # This should generate an error. + return ClassC(self.value) + else: + return ClassC(self.value) + + +T_co = TypeVar("T_co", covariant=True) + +class ClassD(Generic[T_co]): + @overload + def __init__(self, arg: Iterable[T_co]) -> None: + ... + + @overload + def __init__(self, arg: Callable[[], Iterable[T_co]]) -> None: + ... + + def __init__(self, arg: Iterable[T_co] | Callable[[], Iterable[T_co]]) -> None: + ... + + def __iter__(self) -> Iterator[T_co]: + ... + + +class ClassE(ClassD[T_co]): + def method(self) -> "ClassE[ClassE[T_co]]": + def inner(): + for x in self: + yield ClassE(lambda: [x]) + + return ClassE(inner) diff --git a/packages/pyright-internal/src/tests/samples/genericTypes96.py b/packages/pyright-internal/src/tests/samples/genericTypes96.py new file mode 100644 index 000000000..37adda276 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/genericTypes96.py @@ -0,0 +1,20 @@ +# This sample tests the case where a type conditioned on a TypeVar +# is assigned to that same TypeVar in an invariant context. + +from typing import TypeVar + + +class ClassA: + ... + + +T = TypeVar("T", bound=ClassA) + + +def func1(cls: type[T]) -> list[type[T]]: + result = [cls] + for c in cls.__subclasses__(): + result.extend(func1(c)) + return result + + diff --git a/packages/pyright-internal/src/tests/samples/genericTypes97.py b/packages/pyright-internal/src/tests/samples/genericTypes97.py new file mode 100644 index 000000000..a363a7b20 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/genericTypes97.py @@ -0,0 +1,224 @@ +# This sample tests that a class-scoped TypeVar used to parameterize +# a base class within a class definition cannot be covariant or +# contravariant if the base class requires an invariant type parameter. + +from typing import Generic, Sequence, TypeVar, TypeVarTuple, Unpack + +T = TypeVar("T") +T_co = TypeVar("T_co", covariant=True) +T_contra = TypeVar("T_contra", contravariant=True) + +# This should generate an error because the type parameter for list +# is invariant, so T_co here cannot be covariant. +class Class1(list[T_co]): + pass + + +# This should generate an error because the type parameter for list +# is invariant, so T_co here cannot be contravariant. +class Class2(list[T_contra]): + pass + + +class Class3(Generic[T_co]): + ... + + +class Class3_Child1(Class3[T_co]): + ... + + +class Class3_Child2(Class3[T]): + ... + + +# This should generate an error because T_contra isn't +# compatible with T_co. +class Class3_Child3(Class3[T_contra]): + ... + + +class Class4(Generic[T_contra]): + ... + + +class Class4_Child1(Class4[T_contra]): + ... + + +class Class4_Child2(Class4[T]): + ... + + +# This should generate an error because T_co isn't +# compatible with T_contra. +class Class4_Child3(Class4[T_co]): + ... + + +class Class5(Generic[T_contra]): + ... + + +class Class5_Child1(Class5[frozenset[T_contra]]): + ... + + +# This should generate an error because Sequence[T_co] +# is covariant and is therefore not compatible with +# a contravariant type parameter. +class Class5_Child2(Class5[Sequence[T_co]]): + ... + + +class Class5_Child3(Class5[Sequence[T]]): + ... + + +class Class6(Generic[T_co, T_contra]): + ... + + +class Class6_Child1(Class6[T_co, T_contra]): + ... + + +# This should generate an error because T_co isn't +# compatible with T_contra. +class Class6_Child2(Class6[T_co, T_co]): + ... + + +# This should generate an error because T_contra isn't +# compatible with T_co. +class Class6_Child3(Class6[T_contra, T_contra]): + ... + + +class Class6_Child4(Class6[T, T]): + ... + + +# This should generate an error because Sequence[T_co] isn't +# compatible with T_contra. +class Class6_Child5(Class6[Sequence[T_co], Sequence[T_co]]): + ... + + +class Co(Generic[T_co]): + ... + + +class Contra(Generic[T_contra]): + ... + + +class CoToContra(Contra[Co[T_contra]]): + ... + + +class ContraToContra(Contra[Contra[T_co]]): + ... + + +class CoToCo(Co[Co[T_co]]): + ... + + +class ContraToCo(Co[Contra[T_contra]]): + ... + + +# This should generate an error. +class CoToContraToContra(Contra[Co[Contra[T_contra]]]): + ... + + +# This should generate an error. +class ContraToContraToContra(Contra[Contra[Contra[T_co]]]): + ... + + +Co_TA = Co[T_co] +Contra_TA = Contra[T_contra] + + +class CoToContra_WithTA(Contra_TA[Co_TA[T_contra]]): + ... + + +class ContraToContra_WithTA(Contra_TA[Contra_TA[T_co]]): + ... + + +class CoToCo_WithTA(Co_TA[Co_TA[T_co]]): + ... + + +class ContraToCo_WithTA(Co_TA[Contra_TA[T_contra]]): + ... + + +# This should generate an error. +class CoToContraToContra_WithTA(Contra_TA[Co_TA[Contra_TA[T_contra]]]): + ... + + +# This should generate an error. +class ContraToContraToContra_WithTA(Contra_TA[Contra_TA[Contra_TA[T_co]]]): + ... + + +Ts = TypeVarTuple("Ts") + + +class Variadic(Generic[Unpack[Ts]]): + ... + + +class VariadicChild(Variadic[T]): + ... + + +# This should generate an error. +class VariadicChildCo(Variadic[T_co]): + ... + + +# This should generate an error. +class VariadicChildContra(Variadic[T_contra]): + ... + + +Variadic_TA = Variadic[Unpack[tuple[int, Unpack[Ts]]]] + + +class VariadicChild_WithTA(Variadic_TA[T]): + ... + + +# This should generate an error. +class VariadicChildCo_WithTA(Variadic_TA[T_co]): + ... + + +# This should generate an error. +class VariadicChildContra_WithTA(Variadic_TA[T_contra]): + ... + + +Variadic_TA2 = Variadic[Unpack[tuple[int, T]]] + + +class VariadicChild_WithTA2(Variadic_TA2[T]): + ... + + +# This should generate an error. +class VariadicChildCo_WithTA2(Variadic_TA2[T_co]): + ... + + +# This should generate an error. +class VariadicChildContra_WithTA2(Variadic_TA2[T_contra]): + ... diff --git a/packages/pyright-internal/src/tests/samples/genericTypes98.py b/packages/pyright-internal/src/tests/samples/genericTypes98.py new file mode 100644 index 000000000..ea9f9ec65 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/genericTypes98.py @@ -0,0 +1,19 @@ +# This sample tests the case where a contravariant type parameter +# has a union type that must be matched against another union +# type for purposes of bidirectional type inference. + +from typing import Generic, TypeVar + +T1 = TypeVar("T1", contravariant=True) +T2 = TypeVar("T2") + + +class A(Generic[T1]): + ... + + +def func1(x: A[T2]) -> A[T2 | None]: + ... + + +x1: A[int | None] = func1(A[int]()) diff --git a/packages/pyright-internal/src/tests/samples/genericTypes99.py b/packages/pyright-internal/src/tests/samples/genericTypes99.py new file mode 100644 index 000000000..7d48b7643 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/genericTypes99.py @@ -0,0 +1,18 @@ +# This sample tests the case where a specialized generic class references +# itself in a magic method like __iter__. + +from typing import Iterator, Generic, TypeVar + +A = TypeVar("A") + +class Iter(Generic[A]): + def __iter__(self) -> Iterator[A]: + ... + + def enumerate(self) -> "Iter[tuple[int, A]]": + ... + + def method1(self) -> None: + for x in self.enumerate(): + reveal_type(x, expected_text="tuple[int, A@Iter]") + diff --git a/packages/pyright-internal/src/tests/samples/hashability1.py b/packages/pyright-internal/src/tests/samples/hashability1.py new file mode 100644 index 000000000..935b21f78 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/hashability1.py @@ -0,0 +1,51 @@ +# This sample tests the check for hashability that applies to entries +# within a set expression and keys within a dictionary expression. + +from dataclasses import dataclass +from typing import Any + + +# This should generate two errors because {} and [] are not hashable. +s1 = {{}, 2, dict, frozenset(), []} + +# This should generate two errors because {} and [] are not hashable. +s2: set[Any] = {{}, 2, dict, frozenset(), []} + +class StrList(list[str]): + def __hash__(self) -> int: + ... + +s3 = {StrList()} + + +# This should generate two errors because {} and [] are not hashable. +d1 = {{}: None, None: 2, dict: 3, frozenset(): 4, []: ""} + +# This should generate two errors because {} and [] are not hashable. +d2: dict[Any, Any] = {{}: None, None: 2, dict: 3, frozenset(): 4, []: ""} + + +def func1(x: str | dict[Any, Any], y: Any, z: None): + # This should generate an error because dict isn't hashable + d3 = {x: "hi"} + + d4 = {y: "hi", z: "hi"} + +@dataclass +class DC1: + a: int + +@dataclass(frozen=True) +class DC2: + a: int + + +dc1 = DC1(0) + +# This should generate an error because a non-frozen +# dataclass is not hashable. +d5 = {dc1: 100} + + +dc2 = DC2(0) +d6 = {dc2: 100} diff --git a/packages/pyright-internal/src/tests/samples/import15.py b/packages/pyright-internal/src/tests/samples/import15.py new file mode 100644 index 000000000..9af954301 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/import15.py @@ -0,0 +1,11 @@ +# This sample tests the case where a symbol is imported from two different +# sources, one of them in a try block and another in an except block. + +try: + from typing import TypedDict +except ImportError: + from typing_extensions import TypedDict + + +class TD1(TypedDict): + x: int diff --git a/packages/pyright-internal/src/tests/samples/import16.py b/packages/pyright-internal/src/tests/samples/import16.py new file mode 100644 index 000000000..b506a5795 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/import16.py @@ -0,0 +1,7 @@ +# This source ensures that a multi-part import statement without an alias +# implicitly imports all modules in the multi-part chain. + +import html.entities + +x = html.escape + diff --git a/packages/pyright-internal/src/tests/samples/inferredTypes2.py b/packages/pyright-internal/src/tests/samples/inferredTypes2.py new file mode 100644 index 000000000..adbd547e9 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/inferredTypes2.py @@ -0,0 +1,16 @@ +# This sample tests the ability of the type checker to infer +# the types of instance variables based on their assigned values. + +class ClassA: + def __init__(self): + self.value = None + + def func(self, param: int): + reveal_type(self.value, expected_text="int | None") + + if self.value is not None: + reveal_type(self.value, expected_text="int") + self.value.bit_length() + + self.value = param + diff --git a/packages/pyright-internal/src/tests/samples/isinstance6.py b/packages/pyright-internal/src/tests/samples/isinstance6.py index b22692681..05a055cee 100644 --- a/packages/pyright-internal/src/tests/samples/isinstance6.py +++ b/packages/pyright-internal/src/tests/samples/isinstance6.py @@ -12,8 +12,8 @@ def bar(cls, other: type): reveal_type(other, expected_text="Type[Self@Foo] | Type[int]") def baz(self, other: object): - if isinstance(other, self.__class__): + if isinstance(other, type(self)): reveal_type(other, expected_text="Self@Foo") - if isinstance(other, (int, self.__class__)): + if isinstance(other, (int, type(self))): reveal_type(other, expected_text="Self@Foo | int") diff --git a/packages/pyright-internal/src/tests/samples/lambda7.py b/packages/pyright-internal/src/tests/samples/lambda7.py new file mode 100644 index 000000000..66ffd8475 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/lambda7.py @@ -0,0 +1,8 @@ +# This sample tests the case where a lambda's expression must be +# evaluated multiple times as more type information is gathered +# in the presence of an overloaded method. + +# pyright: strict + +def func1(keys: list[str]): + filter(lambda s: s.startswith(""), keys) diff --git a/packages/pyright-internal/src/tests/samples/lambda8.py b/packages/pyright-internal/src/tests/samples/lambda8.py new file mode 100644 index 000000000..e35ab9852 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/lambda8.py @@ -0,0 +1,21 @@ +# This sample tests the case where a lambda is passed to a generic +# Callable with two different type variables. + +from typing import Callable, Generic, TypeVar + +T = TypeVar("T") +R = TypeVar("R") + + +class A(Generic[T, R]): + def __init__(self, x: Callable[[T], R], y: T): + ... + + +class B(Generic[R]): + def __init__(self, x: Callable[[T], R], y: T): + ... + + +reveal_type(A(lambda x: x, 123), expected_text="A[int, int]") +reveal_type(B(lambda x: x, 123), expected_text="B[int]") diff --git a/packages/pyright-internal/src/tests/samples/lambda9.py b/packages/pyright-internal/src/tests/samples/lambda9.py new file mode 100644 index 000000000..c44e08802 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/lambda9.py @@ -0,0 +1,39 @@ +# This sample tests the case where a lambda's expected type is incomplete +# the first time it is evaluated. + +from typing import Callable, Generic, TypeVar, cast, overload + + +_OutT = TypeVar("_OutT") +_Out2T = TypeVar("_Out2T") + + +class Flow(Generic[_OutT]): + @overload + def map(self, func: Callable[[_OutT], Exception], /) -> "Flow[None]": + ... + + @overload + def map(self, func: Callable[[_OutT], _Out2T], /) -> "Flow[_Out2T]": + ... + + def map(self, obj, /): + return cast("Flow", self) + + +class Data: + ... + + +x1 = Flow[Data]().map(lambda aa: _get_date(reveal_type(aa, expected_text="Data"))) +reveal_type(x1, expected_text="Flow[str]") + +x2 = x1.map(lambda bb: reveal_type(bb, expected_text="str")) +reveal_type(x2, expected_text="Flow[str]") + +x3 = x2.map(lambda cc: "any value") +reveal_type(x3, expected_text="Flow[str]") + + +def _get_date(d: Data) -> str: + ... diff --git a/packages/pyright-internal/src/tests/samples/list1.py b/packages/pyright-internal/src/tests/samples/list1.py index cb8ee0d28..2f7ff84a0 100644 --- a/packages/pyright-internal/src/tests/samples/list1.py +++ b/packages/pyright-internal/src/tests/samples/list1.py @@ -12,6 +12,7 @@ Optional, Sequence, TypeVar, + Union, ) @@ -88,3 +89,24 @@ def func1(by: list[ScalarKeysT]) -> ScalarKeysT: # This should generate an error. func1(["id"]) + + +def func2(thing: Union[str, List[Union[str, int]], List[List[Union[str, int]]]]): + ... + + +func2("") +func2(["", 0]) +func2([["", 0], ["", 0]]) +func2([[""]]) + + +def func3(value: _T) -> list[_T]: + to_add = [value, str(value)] + # This should generate an error. + return to_add + + +def func4(value: _T) -> list[_T]: + # This should generate an error. + return [value, str(value)] diff --git a/packages/pyright-internal/src/tests/samples/list3.py b/packages/pyright-internal/src/tests/samples/list3.py new file mode 100644 index 000000000..07a304fc9 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/list3.py @@ -0,0 +1,17 @@ +# This sample tests list inference in a loop where the type of +# the inferred list changes each time through the loop. + +def func1(k: str): + keys = ["a", "b", "c"] + value = [] + + while keys: + if not k: + continue + + if not k: + value = {k: value} + else: + value = [None] * int(k) + [value] + + return value diff --git a/packages/pyright-internal/src/tests/samples/listComprehension2.py b/packages/pyright-internal/src/tests/samples/listComprehension2.py index 78aef49f1..c6db64f9f 100644 --- a/packages/pyright-internal/src/tests/samples/listComprehension2.py +++ b/packages/pyright-internal/src/tests/samples/listComprehension2.py @@ -1,6 +1,6 @@ # This sample tests interleaved for and if clauses in a list comprehension. -# pyright: strict +# pyright: strict, reportUnnecessaryComparison=false from typing import Union, List, Tuple diff --git a/packages/pyright-internal/src/tests/samples/listComprehension9.py b/packages/pyright-internal/src/tests/samples/listComprehension9.py new file mode 100644 index 000000000..35d9245f9 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/listComprehension9.py @@ -0,0 +1,12 @@ +# This sample tests the case where a comprehension requires bidirectional +# type inference for correct analysis. + +from typing import TypedDict + + +class X(TypedDict): + x: str + + +xs: list[X] = [] +xs.extend({"x": c} for c in "abc") diff --git a/packages/pyright-internal/src/tests/samples/literalString1.py b/packages/pyright-internal/src/tests/samples/literalString1.py index 65aea439d..916b3ff76 100644 --- a/packages/pyright-internal/src/tests/samples/literalString1.py +++ b/packages/pyright-internal/src/tests/samples/literalString1.py @@ -73,3 +73,9 @@ def func6(a: LiteralString): a = "hi" v3: list[str] = "1 2 3".split(" ") + +def func7(a: Literal["a", "b"], b: Literal["a", 1]): + v1: LiteralString = f"{a}" + + # This should generate an error because "b" is not a string literal. + v2: LiteralString = f"{b}" diff --git a/packages/pyright-internal/src/tests/samples/literalString3.py b/packages/pyright-internal/src/tests/samples/literalString3.py new file mode 100644 index 000000000..cbca25438 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/literalString3.py @@ -0,0 +1,26 @@ +# This sample tests the case where a LiteralString is used as the bound +# of a TypeVar. + +from typing import Generic, TypeVar, LiteralString + +T = TypeVar("T") +T_LS = TypeVar("T_LS", bound=LiteralString) + + +class ClassA(Generic[T]): + def __init__(self, val: T) -> None: + ... + + +def func1(x: T) -> ClassA[T]: + return ClassA(x) + + +def func2(x: T_LS | None, default: T_LS) -> ClassA[T_LS]: + if x is None: + x = default + + reveal_type(x, expected_text="T_LS@func2 | LiteralString*") + out = func1(x) + reveal_type(out, expected_text="ClassA[T_LS@func2 | str*]") + return out diff --git a/packages/pyright-internal/src/tests/samples/literals1.py b/packages/pyright-internal/src/tests/samples/literals1.py index fe6f62fb0..c01309906 100644 --- a/packages/pyright-internal/src/tests/samples/literals1.py +++ b/packages/pyright-internal/src/tests/samples/literals1.py @@ -46,3 +46,13 @@ def foo(a: ValidResponses): # This should generate an error because literals are # not instantiable. c = Literal[1]() + + +bytes1 = b"\x7f" +reveal_type(bytes1, expected_text='Literal[b"\\x7f"]') +bytes2 = b"\x20" +reveal_type(bytes2, expected_text='Literal[b" "]') +bytes3 = b'"' +reveal_type(bytes3, expected_text='Literal[b"\\""]') +bytes4 = b"'" +reveal_type(bytes4, expected_text='Literal[b"\'"]') diff --git a/packages/pyright-internal/src/tests/samples/literals7.py b/packages/pyright-internal/src/tests/samples/literals7.py index b0b0d5193..96fc89173 100644 --- a/packages/pyright-internal/src/tests/samples/literals7.py +++ b/packages/pyright-internal/src/tests/samples/literals7.py @@ -3,6 +3,7 @@ from typing import Literal +big_int: Literal[9223372036854775808] = 0x8000000000000000 # This should generate an error. y1: Literal[ @@ -36,3 +37,6 @@ y6 = 0xFFFFFFFFFFFFFFFFADF85458A2BB4A9AAFDC5620273D3CF1D8B9C583CE2D3695A9E13641146433FBCC939DCE249B3EF97D2FE363630C75D8F681B202AEC4617AD3DF1ED5D5FD65612433F51F5F066ED0856365553DED1AF3B557135E7F57C935984F0C70E0E68B77E2A689DAF3EFE8721DF158A136ADE73530ACCA4F483A797ABC0AB182B324FB61D108A94BB2C8E3FBB96ADAB760D7F4681D4F42A3DE394DF4AE56EDE76372BB190B07A7C8EE0A6D709E02FCE1CDF7E2ECC03404CD28342F619172FE9CE98583FF8E4F1232EEF28183C3FE3B1B4C6FAD733BB5FCBC2EC22005C58EF1837D1683B2C6F34A26C1B2EFFA886B4238611FCFDCDE355B3B6519035BBC34F4DEF99C023861B46FC9D6E6C9077AD91D2691F7F7EE598CB0FAC186D91CAEFE130985139270B4130C93BC437944F4FD4452E2D74DD364F2E21E71F54BFF5CAE82AB9C9DF69EE86D2BC522363A0DABC521979B0DEADA1DBF9A42D5C4484E0ABCD06BFA53DDEF3C1B20EE3FD59D7C25E41D2B669E1EF16E6F52C3164DF4FB7930E9E4E58857B6AC7D5F42D69F6D187763CF1D5503400487F55BA57E31CC7A7135C886EFB4318AED6A1E012D9E6832A907600A918130C46DC778F971AD0038092999A333CB8B7A1A1DB93D7140003C2A4ECEA9F98D0ACC0A8291CDCEC97DCF8EC9B55A7F88A46B4DB5A851F44182E1C68A007E5E0DD9020BFD64B645036C7A4E677D2C38532A3A23BA4442CAF53EA63BB454329B7624C8917BDD64B1C0FD4CB38E8C334C701C3ACDAD0657FCCFEC719B1F5C3E4E46041F388147FB4CFDB477A52471F7A9A96910B855322EDB6340D8A00EF092350511E30ABEC1FFF9E3A26E7FB29F8C183023C3587E38DA0077D9B4763E4E4B94B2BBC194C6651E77CAF992EEAAC0232A281BF6B3A739C1226116820AE8DB5847A67CBEF9C9091B462D538CD72B03746AE77F5E62292C311562A846505DC82DB854338AE49F5235C95B91178CCF2DD5CACEF403EC9D1810C6272B045B3B71F9DC6B80D63FDD4A8E9ADB1E6962A69526D43161C1A41D570D7938DAD4A40E329CCFF46AAA36AD004CF600C8381E425A31D951AE64FDB23FCEC9509D43687FEB69EDD1CC5E0B8CC3BDF64B10EF86B63142A3AB8829555B2F747C932665CB2C0F1CC01BD70229388839D2AF05E454504AC78B7582822846C0BA35C35F5C59160CC046FD8251541FC68C9C86B022BB7099876A460E7451A8A93109703FEE1C217E6C3826E52C51AA691E0E423CFC99E9E31650C1217B624816CDAD9A95F9D5B8019488D9C0A0A1FE3075A577E23183F81D4A3F2FA4571EFC8CE0BA8A4FE8B6855DFE72B0A66EDED2FBABFBE58A30FAFABE1C5D71A87E2F741EF8C1FE86FEA6BBFDE530677F0D97D11D49F7A8443D0822E506A9F4614E011E2A94838FF88CD68C8BB7C5C6424CFFFFFFFFFFFFFFFF y7 = y6 * y6 + +y8: Literal[10] = 0b1010 +y9: Literal[10] = 0o12 diff --git a/packages/pyright-internal/src/tests/samples/loops16.py b/packages/pyright-internal/src/tests/samples/loops16.py index 0a3866915..d69790861 100644 --- a/packages/pyright-internal/src/tests/samples/loops16.py +++ b/packages/pyright-internal/src/tests/samples/loops16.py @@ -283,38 +283,38 @@ def get_ipv4(): continue elif ip1 == 40 and ip2 == 104 and ip3 == 0 and ip4 == 0: continue - elif ip1 == 52 and ip2 == 96 and ip3 == 0 and ip4 == 0: - continue - elif ip1 == 131 and ip2 == 253 and ip3 == 33 and ip4 == 215: - continue - elif ip1 == 132 and ip2 == 245 and ip3 == 0 and ip4 == 0: - continue - elif ip1 == 150 and ip2 == 171 and ip3 == 32 and ip4 == 0: - continue - elif ip1 == 204 and ip2 == 79 and ip3 == 197 and ip4 == 215: - continue - elif ip1 == 208 and ip2 == 71 and (ip3 > 120 and ip3 < 127): - continue - elif ip1 == 117 and ip2 == 102 and (ip3 > 128 and ip3 < 159): - continue - elif ip1 == 203 and ip2 == 171 and (ip3 > 192 and ip3 < 207): - continue - elif ip1 == 59 and (ip3 > 192 and ip3 < 255): - continue - elif ip1 == 163 and ip2 == 233: - continue - elif ip1 == 62 and ip2 <= 30: - continue # honey pots - elif ip1 == 207 and ip2 >= 31 and ip3 <= 120: - continue # fbi honey pots - elif ip1 == 65 and ip2 >= 224 and ip3 <= 226: - continue # more honey pots - elif ip1 == 195 and ip2 == 10: - continue # another honeypot - elif ip1 == 216 and (ip2 == 25 or ip2 == 94): - continue - elif ip1 == 212 and ip2 == 56: - continue + # elif ip1 == 52 and ip2 == 96 and ip3 == 0 and ip4 == 0: + # continue + # elif ip1 == 131 and ip2 == 253 and ip3 == 33 and ip4 == 215: + # continue + # elif ip1 == 132 and ip2 == 245 and ip3 == 0 and ip4 == 0: + # continue + # elif ip1 == 150 and ip2 == 171 and ip3 == 32 and ip4 == 0: + # continue + # elif ip1 == 204 and ip2 == 79 and ip3 == 197 and ip4 == 215: + # continue + # elif ip1 == 208 and ip2 == 71 and (ip3 > 120 and ip3 < 127): + # continue + # elif ip1 == 117 and ip2 == 102 and (ip3 > 128 and ip3 < 159): + # continue + # elif ip1 == 203 and ip2 == 171 and (ip3 > 192 and ip3 < 207): + # continue + # elif ip1 == 59 and (ip3 > 192 and ip3 < 255): + # continue + # elif ip1 == 163 and ip2 == 233: + # continue + # elif ip1 == 62 and ip2 <= 30: + # continue # honey pots + # elif ip1 == 207 and ip2 >= 31 and ip3 <= 120: + # continue # fbi honey pots + # elif ip1 == 65 and ip2 >= 224 and ip3 <= 226: + # continue # more honey pots + # elif ip1 == 195 and ip2 == 10: + # continue # another honeypot + # elif ip1 == 216 and (ip2 == 25 or ip2 == 94): + # continue + # elif ip1 == 212 and ip2 == 56: + # continue ip = f"{str(ip1)}.{str(ip2)}.{str(ip3)}.{str(ip4)}" return ip diff --git a/packages/pyright-internal/src/tests/samples/loops28.py b/packages/pyright-internal/src/tests/samples/loops28.py new file mode 100644 index 000000000..b522a04d2 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/loops28.py @@ -0,0 +1,29 @@ +# This sample tests type evaluation for a nested loop that involves +# accesses to an instance variable accessed through a member access +# expression that requires narrowing. + +from concurrent import futures +from concurrent.futures import Future +from typing import Any, Dict, Optional + + +class A: + def __init__(self): + self.pending: Optional[Dict[Future[Any], int]] + self.foo: bool + + def poll(self): + assert self.pending is not None + while True: + if self.pending: + pass + + ready, _ = futures.wait(self.pending) + + for future_id in ready: + self.pending.pop(future_id) + + future_id.result() + if self.foo: + pass + \ No newline at end of file diff --git a/packages/pyright-internal/src/tests/samples/loops29.py b/packages/pyright-internal/src/tests/samples/loops29.py new file mode 100644 index 000000000..b23eafd47 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/loops29.py @@ -0,0 +1,16 @@ +# This sample tests the case where a variable type declaration is found +# within a loop and the variable is used within a conditional expression +# within the same loop. + +from enum import Enum + + +class MyEnum(Enum): + A = 0 + + +def func1(vals: list[MyEnum]): + for val1 in vals: + val2: MyEnum = val1 + if val2 == MyEnum.A: + pass diff --git a/packages/pyright-internal/src/tests/samples/loops30.py b/packages/pyright-internal/src/tests/samples/loops30.py new file mode 100644 index 000000000..54b562986 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/loops30.py @@ -0,0 +1,10 @@ +# This sample tests type evaluation in a nested loop. + +a: int | None = None + +for _ in range(1): + for i in range(1): + a = i + j = a + +reveal_type(a, expected_type=int | None) diff --git a/packages/pyright-internal/src/tests/samples/loops31.py b/packages/pyright-internal/src/tests/samples/loops31.py new file mode 100644 index 000000000..fae7e73a3 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/loops31.py @@ -0,0 +1,13 @@ +# This sample tests the case where an unannotated local variable +# has a dependency on itself when evaluating its effective type. + +def func1(arg: str): + ... + +def func2(arg: int): + for _ in range(1): + loc = arg + loc = loc if loc else loc + + # This should generate an error. + func1(loc) diff --git a/packages/pyright-internal/src/tests/samples/loops32.py b/packages/pyright-internal/src/tests/samples/loops32.py new file mode 100644 index 000000000..56c2dd2db --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/loops32.py @@ -0,0 +1,9 @@ +# This sample tests type narrowing of instance variables in the presence +# of a double nested loop. + +def func1(x: str | None): + assert x is not None + + for i in range(10): + for j in range(10): + x = x + "" diff --git a/packages/pyright-internal/src/tests/samples/loops33.py b/packages/pyright-internal/src/tests/samples/loops33.py new file mode 100644 index 000000000..b6b003a9b --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/loops33.py @@ -0,0 +1,10 @@ +# This sample tests a nested loop containing an augmented assignment. + +count = 0 + +for x in range(1): + for y in range(1): + count += 1 + +reveal_type(count, expected_text='int') + diff --git a/packages/pyright-internal/src/tests/samples/loops34.py b/packages/pyright-internal/src/tests/samples/loops34.py new file mode 100644 index 000000000..ea60645b3 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/loops34.py @@ -0,0 +1,36 @@ +# This sample tests a doubly-nested loop with a function (max) that +# uses a TypeVar. + +from typing import Any, Protocol, TypeAlias, TypeVar + +_T_contra = TypeVar("_T_contra", contravariant=True) + + +class SupportsDunderGT(Protocol[_T_contra]): + def __gt__(self, __other: _T_contra) -> bool: + ... + + +class SupportsDunderLT(Protocol[_T_contra]): + def __lt__(self, __other: _T_contra) -> bool: + ... + + +SupportsRichComparison: TypeAlias = SupportsDunderLT[Any] | SupportsDunderGT[Any] + +SupportsRichComparisonT = TypeVar( + "SupportsRichComparisonT", bound=SupportsRichComparison +) + + +def max( + __arg1: SupportsRichComparisonT, __arg2: SupportsRichComparisonT +) -> SupportsRichComparisonT: + ... + + +a: int = 1 +while True: + while a >= 0: + a -= 1 + a = max(0, a) diff --git a/packages/pyright-internal/src/tests/samples/loops35.py b/packages/pyright-internal/src/tests/samples/loops35.py new file mode 100644 index 000000000..835c4f4b8 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/loops35.py @@ -0,0 +1,8 @@ +# This sample tests that code flow analysis of a list comprehension +# within a loop eliminates any Unknowns. + +# pyright: strict + +lst = [1] +while True: + lst = [val for val in lst] diff --git a/packages/pyright-internal/src/tests/samples/loops36.py b/packages/pyright-internal/src/tests/samples/loops36.py new file mode 100644 index 000000000..218273b54 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/loops36.py @@ -0,0 +1,15 @@ +# This sample tests code that uses an augmented assignment to a subscript +# within a loop. + +# pyright: strict + +from typing import Any + + +def func1(any: Any): + l: list[int] = any + while any: + if any: + l[0] += 0 + else: + l[0] += 0 diff --git a/packages/pyright-internal/src/tests/samples/match10.py b/packages/pyright-internal/src/tests/samples/match10.py index a13c7233e..3200ef5d2 100644 --- a/packages/pyright-internal/src/tests/samples/match10.py +++ b/packages/pyright-internal/src/tests/samples/match10.py @@ -1,14 +1,16 @@ # This sample tests the reportMatchNotExhaustive diagnostic check. +from types import NoneType from typing import Literal from enum import Enum + def func1(subj: Literal["a", "b"], cond: bool): # This should generate an error if reportMatchNotExhaustive is enabled. match subj: case "a": pass - + case "b" if cond: pass @@ -19,11 +21,13 @@ def func2(subj: object): case int(): pass + def func3(subj: object): match subj: case object(): pass + def func4(subj: tuple[str] | tuple[int]): match subj[0]: case str(): @@ -32,15 +36,17 @@ def func4(subj: tuple[str] | tuple[int]): case int(): pass + def func5(subj: Literal[1, 2, 3]): # This should generate an error if reportMatchNotExhaustive is enabled. match subj: case 1 | 2: pass + class Color(Enum): red = 0 - green= 1 + green = 1 blue = 2 @@ -65,3 +71,46 @@ def func7() -> int: match [10]: case [*values]: return values[0] + + +class SingleColor(Enum): + red = 0 + + +def func8(subj: SingleColor) -> int: + match subj: + case SingleColor.red: + return 1 + + +def func9(subj: int | None): + match subj: + case NoneType(): + return 1 + case int(): + return 2 + + +def func10(subj: Color | None = None) -> list[str]: + results = [""] + for x in [""]: + match subj: + case None: + results.append(x) + case Color.red: + pass + case Color.green: + pass + case Color.blue: + pass + return results + + +def func11(subj: int | float | None): + match subj: + case float(): + reveal_type(subj, expected_text="int | float") + case int(): + reveal_type(subj, expected_text="int") + case NoneType(): + reveal_type(subj, expected_text="None") diff --git a/packages/pyright-internal/src/tests/samples/match11.py b/packages/pyright-internal/src/tests/samples/match11.py new file mode 100644 index 000000000..fb8636b6b --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/match11.py @@ -0,0 +1,45 @@ +# This sample tests the reportUnnecessaryComparison check when applied +# to match statements. + +from typing import Literal + +Letters = Literal["A", "B", "C"] + + +def func1(subj: Letters): + match subj: + # This should generate an error if reportUnnecessaryComparison is enabled. + case "A" | "B" | "D": + pass + case str(): + pass + # This should generate an error if reportUnnecessaryComparison is enabled. + case "C": + pass + # This should generate an error if reportUnnecessaryComparison is enabled. + case x: + print(x) + + +def func2(subj: int | dict[str, str]): + match subj: + # This should generate an error if reportUnnecessaryComparison is enabled. + case str() if subj > 4: + pass + case int() if subj > 4: + pass + case int(): + pass + # This should generate an error if reportUnnecessaryComparison is enabled. + case int(): + pass + # This should generate an error if reportUnnecessaryComparison is enabled. + case (a, b): + print(a, b) + case {"": d}: + print(d) + case dict(): + pass + # This should generate an error if reportUnnecessaryComparison is enabled. + case x: + print(x) diff --git a/packages/pyright-internal/src/tests/samples/match2.py b/packages/pyright-internal/src/tests/samples/match2.py index bcceb62f5..59da81fbb 100644 --- a/packages/pyright-internal/src/tests/samples/match2.py +++ b/packages/pyright-internal/src/tests/samples/match2.py @@ -338,3 +338,13 @@ def test_negative_narrowing2(subj: tuple[int, ...]): case d: reveal_type(subj, expected_text="Never") reveal_type(d, expected_text="Never") + + +def test_negative_narrowing3(subj: tuple[Any, Any]): + match subj: + case (a, b): + reveal_type(a, expected_text="Any") + reveal_type(b, expected_text="Any") + + case x: + reveal_type(x, expected_text="Never") diff --git a/packages/pyright-internal/src/tests/samples/match3.py b/packages/pyright-internal/src/tests/samples/match3.py index 7d0e2c7d5..3b3102bec 100644 --- a/packages/pyright-internal/src/tests/samples/match3.py +++ b/packages/pyright-internal/src/tests/samples/match3.py @@ -362,3 +362,31 @@ def func13(subj: tuple[Literal[0]]): case d: reveal_type(subj, expected_text="Never") reveal_type(d, expected_text="Never") + + +class ClassE(Generic[T]): + __match_args__ = ("x",) + x: list[T] + + +class ClassF(ClassE[T]): + pass + + +def func14(subj: ClassE[T]) -> T | None: + match subj: + case ClassF(a): + reveal_type(subj, expected_text="ClassF[T@func14]") + reveal_type(a, expected_text="list[T@func14]") + return a[0] + + +class IntPair(tuple[int, int]): + pass + + +def func15(x: IntPair | None) -> None: + match x: + case IntPair((y, z)): + reveal_type(y, expected_text="int") + reveal_type(z, expected_text="int") diff --git a/packages/pyright-internal/src/tests/samples/match5.py b/packages/pyright-internal/src/tests/samples/match5.py index daee8caf3..37ce041b4 100644 --- a/packages/pyright-internal/src/tests/samples/match5.py +++ b/packages/pyright-internal/src/tests/samples/match5.py @@ -2,6 +2,8 @@ # described in PEP 634) that contain mapping patterns. from typing import Dict, Literal, TypedDict +from typing_extensions import NotRequired + def test_unknown(value_to_match): match value_to_match: @@ -33,9 +35,11 @@ class Movie(TypedDict): release_year: int gross_earnings: float + class MovieInfo: field_of_interest: Literal["release_year", "gross_earnings"] + def test_typed_dict(value_to_match: Movie): match value_to_match: case {"title": a1, "release_year": a2, **a3}: @@ -52,7 +56,7 @@ def test_typed_dict(value_to_match: Movie): case {"director": c1}: reveal_type(c1, expected_text="Never") reveal_type(value_to_match, expected_text="Never") - + case {MovieInfo.field_of_interest: d1}: reveal_type(d1, expected_text="int | float") reveal_type(value_to_match, expected_text="Movie") @@ -66,5 +70,44 @@ def test_union(value_to_match: Dict[str | int, str | int] | Movie | str): case {"gross_earnings": b1}: reveal_type(b1, expected_text="str | int | float") - reveal_type(value_to_match, expected_text="Dict[str | int, str | int] | Movie") + reveal_type( + value_to_match, expected_text="Dict[str | int, str | int] | Movie" + ) + + +class IntValue(TypedDict): + type: Literal["Int"] + int_value: int + + +class StrValue(TypedDict): + type: Literal["Str"] + str_value: str + + +class ComplexValue(TypedDict): + type: NotRequired[Literal["Complex"]] + complex_value: complex + + +def test_negative_narrowing1(value: IntValue | StrValue | ComplexValue | int) -> None: + match value: + case {"type": "Int"}: + reveal_type(value, expected_text="IntValue") + case {"type": "Str" | "Complex"}: + reveal_type(value, expected_text="StrValue | ComplexValue") + case _: + reveal_type(value, expected_text="ComplexValue | int") + + +def test_negative_narrowing2(value: StrValue | ComplexValue) -> None: + if "type" not in value: + raise + match value: + case {"type": "Str"}: + reveal_type(value, expected_text="StrValue") + case {"type": "Complex"}: + reveal_type(value, expected_text="ComplexValue") + case _: + reveal_type(value, expected_text="Never") diff --git a/packages/pyright-internal/src/tests/samples/match6.py b/packages/pyright-internal/src/tests/samples/match6.py index c6f69aee5..356e76949 100644 --- a/packages/pyright-internal/src/tests/samples/match6.py +++ b/packages/pyright-internal/src/tests/samples/match6.py @@ -24,13 +24,14 @@ def test_unknown(value_to_match): reveal_type(d2, expected_text="Literal[False]") reveal_type(value_to_match, expected_text="Unknown") + def test_tuple(value_to_match: tuple[int | float | str | complex, ...]): match value_to_match: case (3, -3) as a1: reveal_type(a1, expected_text="tuple[Literal[3], Literal[-3]]") reveal_type(value_to_match, expected_text="tuple[Literal[3], Literal[-3]]") - case (3j , -3 + 5j) as b1: + case (3j, -3 + 5j) as b1: reveal_type(b1, expected_text="tuple[complex, complex]") reveal_type(value_to_match, expected_text="tuple[complex, complex]") @@ -38,8 +39,8 @@ def test_tuple(value_to_match: tuple[int | float | str | complex, ...]): def test_union(value_to_match: int | float | str | complex | bool | None): match value_to_match: case (3 | -3j) as a1: - reveal_type(a1, expected_text="complex | Literal[3]") - reveal_type(value_to_match, expected_text="complex | Literal[3]") + reveal_type(a1, expected_text="bool | complex | Literal[3]") + reveal_type(value_to_match, expected_text="bool | complex | Literal[3]") case (True | False | 3.4 | -3 + 3j | None) as b1: reveal_type(b1, expected_text="float | complex | bool | None") @@ -62,3 +63,14 @@ def test_none(value_to_match: int | None): case a2: reveal_type(a2, expected_text="int") + +class A(str): + ... + + +def test_subclass(a: A): + match a: + case "TEST" as m: + reveal_type(m, expected_text="A") + case x: + reveal_type(x, expected_text="A") diff --git a/packages/pyright-internal/src/tests/samples/memberAccess14.py b/packages/pyright-internal/src/tests/samples/memberAccess14.py index 1b8205e85..43c8b3c79 100644 --- a/packages/pyright-internal/src/tests/samples/memberAccess14.py +++ b/packages/pyright-internal/src/tests/samples/memberAccess14.py @@ -52,7 +52,7 @@ class D(C[float]): ... -reveal_type(C.prop, expected_text="CachedSlotProperty[Self@C[T@C], int]") +reveal_type(C.prop, expected_text="CachedSlotProperty[C[T@C], int]") reveal_type(D.prop, expected_text="CachedSlotProperty[D, int]") diff --git a/packages/pyright-internal/src/tests/samples/memberAccess20.py b/packages/pyright-internal/src/tests/samples/memberAccess20.py new file mode 100644 index 000000000..e628cf57b --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/memberAccess20.py @@ -0,0 +1,15 @@ +# This sample tests the case where an instance member write +# targets an instance variable with a TypeVar type. + +from typing import Generic, TypeVar + +T = TypeVar("T") + + +class ClassA(Generic[T]): + def __init__(self, value: T) -> None: + self.value: T = value + + def set_value(self, value: int): + # This should generate an error. + self.value = value diff --git a/packages/pyright-internal/src/tests/samples/memberAccess21.py b/packages/pyright-internal/src/tests/samples/memberAccess21.py new file mode 100644 index 000000000..42c115c87 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/memberAccess21.py @@ -0,0 +1,40 @@ +# This sample tests the case where a member access is performed through +# an object using a field that is annotated as a ClassVar. Normally this +# is disallowed, but it is permitted if the type of the ClassVar is +# a descriptor object. + +from typing import ClassVar, Generic, TypeVar, overload, Self + +T = TypeVar("T") + + +class Descriptor(Generic[T]): + @overload + def __get__(self, instance: None, owner) -> Self: + ... + + @overload + def __get__(self, instance: object, owner) -> T: + ... + + def __get__(self, instance: object | None, owner) -> Self | T: + ... + + def __set__(self, instance: object, value: T) -> None: + ... + + def is_null(self) -> bool: + ... + + +class Example: + field1: ClassVar = Descriptor[str]() + + field2: ClassVar = "" + + def reset(self) -> None: + self.field1 = "" + + # This should generate an error because field2 isn't + # a descriptor object. + self.field2 = "" diff --git a/packages/pyright-internal/src/tests/samples/metaclass1.py b/packages/pyright-internal/src/tests/samples/metaclass1.py index 82adfd794..488c8eec1 100644 --- a/packages/pyright-internal/src/tests/samples/metaclass1.py +++ b/packages/pyright-internal/src/tests/samples/metaclass1.py @@ -1,7 +1,33 @@ # This sample tests pyright's ability to use metaclasses. from ctypes import Array, c_uint64 +from typing import Any, Generic, TypeAlias, TypeVar myArray1 = (c_uint64 * 5)() myArray2: Array[c_uint64] = (c_uint64 * 5)() + + +T = TypeVar("T") + + +class CustomMeta(type): + def __getitem__(self, key: Any) -> "type[int]": + ... + + +class Custom(metaclass=CustomMeta): + ... + + +# This should generate an error because the class isn't +# Generic even though it supports a metaclass with a +# __getitem__. +y1: Custom[int] + +# This should not generate an error because it is used +# as a runtime expression rather than a type annotation. +y2 = Custom[int] + +# This should generate an error. +y3: TypeAlias = Custom[int] diff --git a/packages/pyright-internal/src/tests/samples/metaclass10.py b/packages/pyright-internal/src/tests/samples/metaclass10.py new file mode 100644 index 000000000..69b0db865 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/metaclass10.py @@ -0,0 +1,13 @@ +# This sample tests the case where a member access expression is used +# to access an instance method on a metaclass. Binding should not be +# performed in this case. + +from enum import EnumMeta +from typing import TypeVar + +_EnumMemberT = TypeVar("_EnumMemberT") + + +class EnumMeta2(EnumMeta): + def __getitem__(cls: type[_EnumMemberT], name: str) -> _EnumMemberT: + return EnumMeta.__getitem__(cls, name) diff --git a/packages/pyright-internal/src/tests/samples/methodOverride1.py b/packages/pyright-internal/src/tests/samples/methodOverride1.py index 61e39b588..481fca19e 100644 --- a/packages/pyright-internal/src/tests/samples/methodOverride1.py +++ b/packages/pyright-internal/src/tests/samples/methodOverride1.py @@ -159,6 +159,12 @@ def my_method39(self, a: int, /) -> None: def my_method40(self, a: int, /) -> None: ... + def my_method41(self, a: int, b: str, c: str) -> None: + ... + + def my_method42(self, a: int, b: int, c: str) -> None: + ... + T_ChildClass = TypeVar("T_ChildClass", bound="ChildClass") @@ -329,6 +335,12 @@ def my_method39(self, *args: Any) -> None: def my_method40(self, **kwargs: Any) -> None: ... + def my_method41(self, a: int, *args: str) -> None: + ... + + # This should generate an error because args doesn't have the right type. + def my_method42(self, a: int, *args: int) -> None: + ... class A: def test(self, t: Sequence[int]) -> Sequence[str]: diff --git a/packages/pyright-internal/src/tests/samples/methodOverride5.py b/packages/pyright-internal/src/tests/samples/methodOverride5.py new file mode 100644 index 000000000..36ae2da6d --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/methodOverride5.py @@ -0,0 +1,25 @@ +# This sample tests an edge case where a base method uses an unpacked +# tuple or a specialized TypeVarTuple and is overridden by a method +# that supplies specific arguments. + +# pyright: strict + +from typing import Generic, TypeVarTuple + +Ts = TypeVarTuple("Ts") + +class Parent(Generic[*Ts]): + def method_1(self, *args: *Ts) -> None: + ... + + def method_2(self, *args: *tuple[*Ts]) -> None: + ... + + +class Child(Parent[int]): + def method_1(self, arg1: int) -> None: + ... + + def method_2(self, arg1: int) -> None: + ... + diff --git a/packages/pyright-internal/src/tests/samples/methods1.py b/packages/pyright-internal/src/tests/samples/methods1.py new file mode 100644 index 000000000..62f3f40c3 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/methods1.py @@ -0,0 +1,123 @@ +# This sample tests that instance methods, regardless of how they're +# defined or decorated, act like instance methods. + +from typing import ( + Any, + Callable, + ClassVar, + Concatenate, + Generic, + ParamSpec, + TypeVar, +) + +P = ParamSpec("P") +R = TypeVar("R") + + +def func1(self) -> None: + print("func1", f"{self=}") + + +def deco1(x: Callable[P, R]) -> Callable[P, R]: + return x + + +def deco2( + func: Callable[P, Any] +) -> Callable[[Callable[..., Any]], Callable[Concatenate["ClassA", P], None]]: + return lambda f: f # type: ignore + + +class Deco3(Generic[P, R]): + def __init__(self, func: Callable[P, R]): + self.func = func + + def __call__(self, *args: P.args, **kwargs: P.kwargs) -> R: + print("Deco3.__call__:", f"{self=}") + return self.func(*args, **kwargs) + + +class Deco4: + def __init__(self, func: Callable[..., Any]): + self.func = func + + def __call__(self) -> None: + print("Deco4.__call__:", f"{self=}") + + +class CallableA: + def __call__(self) -> None: + print("CallableA.__call__:", f"{self=}") + + +class DummyClass: + def __init__(self, a: str, b: float) -> None: + pass + + +def dummyFunc(a: str, b: float) -> None: + pass + + +class ClassA: + a: ClassVar[Callable[[Any], None]] = lambda self: None + + b1 = lambda self: None + b2: ClassVar = lambda self: None + + c1 = func1 + c2: ClassVar = func1 + + d1: CallableA = CallableA() + d2: ClassVar[CallableA] = CallableA() + + e1 = deco1(func1) + e2: ClassVar = deco1(func1) + + @deco1 + def f1(self) -> None: + print("f1:", f"{self=}") + + @Deco3 + def g1(self) -> None: + print("g1:", f"{self=}") + + @Deco4 + def h1(self) -> None: + print("h1:", f"{self=}") + + @deco2(DummyClass) + def i1(self, a: str, b: float) -> None: + print("i1:", f"{self=}") + + @deco2(dummyFunc) + def j1(self, a: str, b: float) -> None: + print("j1:", f"{self=}") + + +a = ClassA() + +a.a() + +a.b1() +a.b2() + +a.c1() +a.c2() + +a.d1() +a.d2() + +a.e1() +a.e2() + +a.f1() + +a.g1(a) + +a.h1() + +a.i1("", 0) + +a.j1("", 0) diff --git a/packages/pyright-internal/src/tests/samples/namedTuples7.py b/packages/pyright-internal/src/tests/samples/namedTuples7.py index e2b2c786f..65954d6aa 100644 --- a/packages/pyright-internal/src/tests/samples/namedTuples7.py +++ b/packages/pyright-internal/src/tests/samples/namedTuples7.py @@ -13,7 +13,7 @@ class NT1(NamedTuple, Generic[_T1]): c: list[_T1] -reveal_type(NT1(3, 4, ["hi"]), expected_text="NT1[int | str]") +reveal_type(NT1(3, 4, ["hi"]), expected_text="NT1[str | int]") reveal_type(NT1(3, 4, []), expected_text="NT1[int]") reveal_type(NT1(3.4, 4, [1, 2]), expected_text="NT1[float]") reveal_type(NT1(3.4, 4, [2j]), expected_text="NT1[complex]") diff --git a/packages/pyright-internal/src/tests/samples/never1.py b/packages/pyright-internal/src/tests/samples/never1.py index 28dc91ff3..e1ae31315 100644 --- a/packages/pyright-internal/src/tests/samples/never1.py +++ b/packages/pyright-internal/src/tests/samples/never1.py @@ -1,12 +1,60 @@ -# This sample verifies that "Never" doesn't appear in -# an inferred function return type. +# This sample tests the handling of the "Never" type, +# ensuring that it's treated as the same as NoReturn. +from typing import NoReturn, TypeVar, Generic +from typing_extensions import Never -def func1(a: str = ""): - if not isinstance(a, str): - reveal_type(a, expected_text="Never") - return [a] +T = TypeVar("T") -x1 = func1() -reveal_type(x1, expected_text="list[Unknown] | None") +class ClassA(Generic[T]): + ... + + +def func1(val: ClassA[Never]): + # This should generate an error because + # the type parameter for ClassA is invariant. + x: ClassA[object] = val + + +def assert_never1(val: Never) -> NoReturn: + raise Exception("Should never get here") + + +def assert_never2(val: NoReturn) -> NoReturn: + raise Exception("Should never get here") + + +# This should generate an error because Never doesn't accept type arguments. +def assert_never3(val: Never[int]): + ... + + +# This should generate an error because NoReturn doesn't accept type arguments. +def assert_never4(val: NoReturn[int]): + ... + + +def func2(val: str | int) -> str: + if isinstance(val, (str, int)): + return "str or int" + else: + assert_never1(val) + + +def func3(val: str | int) -> str: + if isinstance(val, (str, int)): + return "str or int" + else: + assert_never2(val) + + +def func4(): + # This should generate an error because of the missing argument. + assert_never1() + + +reveal_type(assert_never1, expected_text="(val: Never) -> NoReturn") + +# This should generate an error. +assert_never1(1) diff --git a/packages/pyright-internal/src/tests/samples/never2.py b/packages/pyright-internal/src/tests/samples/never2.py index f7b086cc4..325883ec3 100644 --- a/packages/pyright-internal/src/tests/samples/never2.py +++ b/packages/pyright-internal/src/tests/samples/never2.py @@ -1,48 +1,23 @@ -# This sample tests the handling of the "Never" type, -# ensuring that it's treated as the same as NoReturn. +# This sample validates that Never is treated as a bottom type for +# covariant type arguments. -from typing import NoReturn -from typing_extensions import Never +from typing import Generic, Never, TypeVar +U = TypeVar("U") -def assert_never1(val: Never) -> NoReturn: - raise Exception("Should never get here") +T_co = TypeVar("T_co", covariant=True) +class ClassA(Generic[T_co]): + pass +def func1(x: U) -> ClassA[U]: + return ClassA[Never]() -def assert_never2(val: NoReturn) -> NoReturn: - raise Exception("Should never get here") +T = TypeVar("T") +class ClassB(Generic[T]): + pass -# This should generate an error because Never doesn't accept type arguments. -def assert_never3(val: Never[int]): - ... +def func2(x: U) -> ClassB[U]: + # This should generate an error because T is invariant. + return ClassB[Never]() - -# This should generate an error because NoReturn doesn't accept type arguments. -def assert_never4(val: NoReturn[int]): - ... - - -def func1(val: str | int) -> str: - if isinstance(val, (str, int)): - return "str or int" - else: - assert_never1(val) - - -def func2(val: str | int) -> str: - if isinstance(val, (str, int)): - return "str or int" - else: - assert_never2(val) - - -def func3(): - # This should generate an error because of the missing argument. - assert_never1() - - -reveal_type(assert_never1, expected_text="(val: Never) -> NoReturn") - -# This should generate an error. -assert_never1(1) diff --git a/packages/pyright-internal/src/tests/samples/newType1.py b/packages/pyright-internal/src/tests/samples/newType1.py index bedad17d0..0772c463a 100644 --- a/packages/pyright-internal/src/tests/samples/newType1.py +++ b/packages/pyright-internal/src/tests/samples/newType1.py @@ -32,3 +32,19 @@ def func1(x: Type[_T]) -> Type[_T]: MyString2 = NewType("MyString2", func1(str)) + +# This should generate an error because NewType requires two arguments. +NewTypeBad1 = NewType() + +# This should generate an error because NewType requires two arguments. +NewTypeBad2 = NewType("Hi") + +# This should generate an error because NewType requires two arguments. +NewTypeBad3 = NewType("Hi", int, int) + +# This should generate an error because the first argument must be a string literal. +NewTypeBad4 = NewType(int, int) + +args = ("Hi", int) +# This should generate an error because two positional args are needed. +NewTypeBad5 = NewType(*args) diff --git a/packages/pyright-internal/src/tests/samples/none1.py b/packages/pyright-internal/src/tests/samples/none1.py index 81d97705d..e87461918 100644 --- a/packages/pyright-internal/src/tests/samples/none1.py +++ b/packages/pyright-internal/src/tests/samples/none1.py @@ -27,3 +27,5 @@ def func2(x: type[None]): reveal_type(type(None).__name__, expected_text="str") _ = type(None) == type(None) + +None.__eq__(0) diff --git a/packages/pyright-internal/src/tests/samples/none2.py b/packages/pyright-internal/src/tests/samples/none2.py index 09fcb756d..ccf443d00 100644 --- a/packages/pyright-internal/src/tests/samples/none2.py +++ b/packages/pyright-internal/src/tests/samples/none2.py @@ -20,3 +20,8 @@ def func1(a: Type[None]) -> Type[str] | Type[None]: # This should generate an error because None isn't # assignable to Type[None]. val2 = func1(None) + +val3: type[object] = type(None) + +val4 = type(None)() +reveal_type(val4, expected_text="None") diff --git a/packages/pyright-internal/src/tests/samples/operators10.py b/packages/pyright-internal/src/tests/samples/operators10.py new file mode 100644 index 000000000..016ab534b --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/operators10.py @@ -0,0 +1,16 @@ +# This sample tests the case where an operator (__or__) cannot be +# properly evaluated when using bidirectional type inference but +# can be without. + +from typing import Iterable + + +def func(a: set[int], b: set[str]): + x1: Iterable[int | str] = a | a + + x2: set[int] = a | a + + # This should generate an error + x3: set[int | str] = a | a + + x4: set[int | str] = a | b diff --git a/packages/pyright-internal/src/tests/samples/operators8.py b/packages/pyright-internal/src/tests/samples/operators8.py index 24a88d992..7aa3e9442 100644 --- a/packages/pyright-internal/src/tests/samples/operators8.py +++ b/packages/pyright-internal/src/tests/samples/operators8.py @@ -43,7 +43,7 @@ def func2(cond: bool): def func3(cond: bool): c1 = b"Hi " + (b"Steve" if cond else b"Amy") - reveal_type(c1, expected_text="Literal[b'Hi Steve', b'Hi Amy']") + reveal_type(c1, expected_text='Literal[b"Hi Steve", b"Hi Amy"]') def func4(a: Literal[True], b: Literal[False]): diff --git a/packages/pyright-internal/src/tests/samples/operators9.py b/packages/pyright-internal/src/tests/samples/operators9.py new file mode 100644 index 000000000..f3acb70d0 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/operators9.py @@ -0,0 +1,25 @@ +# This sample tests bidirectional type inference for | operators. This +# should apply only to TypedDict types. + +from typing import Literal, TypeVar, Generic, Callable, Union + +T1 = TypeVar("T1") +T2 = TypeVar("T2") + + +class S(Generic[T1]): + def __or__(self, other: "S[T2]") -> "S[Union[T1, T2]]": + ... + + +def to(x: Callable[..., T1]) -> "S[T1]": + ... + + +x1 = to(int) | to(float) + + +def func1(f: set[Literal["A", "B"]]): + v1: set[Literal["A", "B"]] = f | f + + v2 = " ".join({"A"} | {"B"}) diff --git a/packages/pyright-internal/src/tests/samples/optional2.py b/packages/pyright-internal/src/tests/samples/optional2.py index 654ee212b..87969db23 100644 --- a/packages/pyright-internal/src/tests/samples/optional2.py +++ b/packages/pyright-internal/src/tests/samples/optional2.py @@ -16,8 +16,8 @@ def __gt__(self, other: "Cmp") -> bool: def valid(value: Optional[Cmp], needed: Cmp): - x = value >= needed + x = value > needed y = value == needed # This should generate an error if reportOptionalOperand is enabled. - z = value <= needed + z = value < needed diff --git a/packages/pyright-internal/src/tests/samples/overload1.py b/packages/pyright-internal/src/tests/samples/overload1.py index 5c2abf6e5..ad06b133a 100644 --- a/packages/pyright-internal/src/tests/samples/overload1.py +++ b/packages/pyright-internal/src/tests/samples/overload1.py @@ -5,46 +5,45 @@ @overload -def from_json_timestamp(ts: int) -> datetime: +def func1(ts: int) -> datetime: ... @overload -def from_json_timestamp(ts: None) -> None: +def func1(ts: None) -> None: ... -def from_json_timestamp(ts: Optional[int]) -> Optional[datetime]: +@overload +def func1(ts: complex): + ... + + +def func1(ts: int | complex | None) -> datetime | None: return ( None - if ts is None + if not isinstance(ts, int) else (datetime(1970, 1, 1, tzinfo=timezone.utc) + timedelta(milliseconds=ts)) ) -result1: datetime = from_json_timestamp(2418049) - -# This should generate an error -result2: datetime = from_json_timestamp(None) - -result3: None = from_json_timestamp(None) - -# This should generate an error -result4: None = from_json_timestamp(2345) +reveal_type(func1(2418049), expected_text="datetime") +reveal_type(func1(None), expected_text="None") +reveal_type(func1(3j), expected_text="Unknown") @overload -def func1(x: int) -> int: +def func2(x: int) -> int: ... @overload -def func1(x: float) -> float: +def func2(x: float) -> float: ... -def func1(x): +def func2(x): return x -reveal_type(func1(abs(0.0)), expected_text="float") +reveal_type(func2(abs(0.0)), expected_text="float") diff --git a/packages/pyright-internal/src/tests/samples/overload12.py b/packages/pyright-internal/src/tests/samples/overload12.py new file mode 100644 index 000000000..ce0c1b15f --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/overload12.py @@ -0,0 +1,121 @@ +# This sample tests overload matching in cases where one or more +# matches are found due to an Any or Unknown argument. + +from typing import Any, Literal, overload +from typing_extensions import LiteralString + + +@overload +def overload1(x: int, y: float) -> float: + ... + + +@overload +def overload1(x: str, y: float) -> str: + ... + + +def overload1(x: str | int, y: float) -> float | str: + ... + + +def func1(a: Any): + v1 = overload1(1, 3.4) + reveal_type(v1, expected_text="float") + + v2 = overload1("", 3.4) + reveal_type(v2, expected_text="str") + + v3 = overload1(a, 3.4) + reveal_type(v3, expected_text="Unknown") + + v4 = overload1("", a) + reveal_type(v4, expected_text="str") + + +@overload +def overload2(x: int) -> Any: + ... + + +@overload +def overload2(x: str) -> str: + ... + + +def overload2(x: str | int) -> Any | str: + ... + + +def func2(a: Any): + v1 = overload2("") + reveal_type(v1, expected_text="str") + + v2 = overload2(3) + reveal_type(v2, expected_text="Any") + + v3 = overload2(a) + reveal_type(v3, expected_text="Any") + + +@overload +def overload3(x: LiteralString) -> LiteralString: + ... + + +@overload +def overload3(x: str) -> str: + ... + + +def overload3(x: str) -> str: + ... + + +def func3(a: Any, b: str): + v1 = overload3("") + reveal_type(v1, expected_text="LiteralString") + + v2 = overload3(b) + reveal_type(v2, expected_text="str") + + v3 = overload3(a) + reveal_type(v3, expected_text="str") + + +def func4(a: Any): + d = dict(a) + reveal_type(d, expected_text="dict[Any, Any]") + + +@overload +def overload4(x: str, *, flag: Literal[True]) -> int: + ... + + +@overload +def overload4(x: str, *, flag: Literal[False] = ...) -> str: + ... + + +@overload +def overload4(x: str, *, flag: bool = ...) -> int | str: + ... + + +def overload4(x: str, *, flag: bool = False) -> int | str: + ... + + +reveal_type(overload4("0"), expected_text="str") +reveal_type(overload4("0", flag=True), expected_text="int") +reveal_type(overload4("0", flag=False), expected_text="str") + + +def unknown_any() -> Any: + ... + + +def func5(a: Any): + reveal_type(overload4(a, flag=False), expected_text="str") + reveal_type(overload4("0", flag=a), expected_text="Unknown") diff --git a/packages/pyright-internal/src/tests/samples/overload13.py b/packages/pyright-internal/src/tests/samples/overload13.py new file mode 100644 index 000000000..0bd5f6dd4 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/overload13.py @@ -0,0 +1,6 @@ +# This sample tests the case of nested overload resolution where the +# selected overload depends on bidirectional inference. + +l: list[str] = [] +"{s}".format(s="\n".join(sorted(l))) + diff --git a/packages/pyright-internal/src/tests/samples/overload14.py b/packages/pyright-internal/src/tests/samples/overload14.py new file mode 100644 index 000000000..258eb13e6 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/overload14.py @@ -0,0 +1,8 @@ +# This sample tests the case where the overloads have different +# parameter counts. This particular sample exposed a bug +# in pyright's logic at one point. + +import subprocess + +def my_method(cmd, *args, **kwargs): + return subprocess.run(cmd, *args, **kwargs) diff --git a/packages/pyright-internal/src/tests/samples/overload15.py b/packages/pyright-internal/src/tests/samples/overload15.py new file mode 100644 index 000000000..686d9613d --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/overload15.py @@ -0,0 +1,121 @@ +# This sample tests the handling of overloads with a ParamSpec. + +from typing import Callable, Concatenate, overload, TypeVar, ParamSpec + +P = ParamSpec("P") +R = TypeVar("R") + + +def callable1( + func: Callable[P, R], *args: P.args, **kwargs: P.kwargs +) -> Callable[[], R]: + ... + + +@overload +def func1() -> None: + ... + + +@overload +def func1(a: int) -> None: + ... + + +def func1(a: int = 1) -> None: + ... + + +callable1(func1) +callable1(func1, 1) +callable1(func1, a=1) + +# This should generate an error because none of the overloads +# captured by the ParamSpec match those arguments. +callable1(func1, 1, 2) + +# This should generate an error because none of the overloads +# captured by the ParamSpec match those arguments. +callable1(func1, b=2) + + +def callable2( + func: Callable[Concatenate[int, P], R], *args: P.args, **kwargs: P.kwargs +) -> Callable[[], R]: + ... + + +@overload +def func2() -> None: + ... + + +@overload +def func2(a: int) -> int: + ... + + +@overload +def func2(a: int, b: str) -> str: + ... + + +def func2(a: int = 1, b: str = "") -> None | int | str: + ... + + +callable2(func2) +callable2(func2, "") +callable2(func2, b="") + +# This should generate an error because none of the overloads +# captured by the ParamSpec match those arguments. +callable2(func2, 1, "") + + +def callable3(func: Callable[P, R]) -> Callable[Concatenate[int, P], R]: + ... + + +c3_2 = callable3(func2) +c3_2(1) +c3_2(1, a=1) +c3_2(1, 1, b="") + +# This should generate an error because none of the overloads +# match these arguments. +c3_2(1, "") + +# This should generate an error because none of the overloads +# match these arguments. +c3_2(1, 1, c="") + + +@overload +def func3(x: int) -> None: + ... + + +@overload +def func3(x: str) -> None: + ... + + +def func3(x) -> None: + pass + + +def callable4(func: Callable[P, R], *args: P.args, **kwargs: P.kwargs) -> R: + ... + + +callable4(func3, 1) +callable4(func3, x=1) +callable4(func3, "") +callable4(func3, x="") + +# This should generate an error. +callable4(func3, 1.0) + +# This should generate an error. +callable4(func3, y=1) diff --git a/packages/pyright-internal/src/tests/samples/overload5.py b/packages/pyright-internal/src/tests/samples/overload5.py index 93d7b94a9..0acae1462 100644 --- a/packages/pyright-internal/src/tests/samples/overload5.py +++ b/packages/pyright-internal/src/tests/samples/overload5.py @@ -7,6 +7,7 @@ List, Literal, Optional, + Protocol, Sequence, Tuple, Type, @@ -320,14 +321,43 @@ def method1(self, x: Any) -> Any: @overload -def func18(s: Sequence[_T1], extra: Literal[False]) -> list[_T1]: ... +def func18(s: Sequence[_T1], extra: Literal[False]) -> list[_T1]: + ... + @overload -def func18(s: Sequence[_T1], extra: Literal[True]) -> list[_T1] | tuple[_T1]: ... +def func18(s: Sequence[_T1], extra: Literal[True]) -> list[_T1] | tuple[_T1]: + ... + @overload -def func18(s: Sequence[_T1], extra: bool) -> list[_T1] | tuple[_T1]: ... +def func18(s: Sequence[_T1], extra: bool) -> list[_T1] | tuple[_T1]: + ... + def func18(s: Sequence[_T1], extra: bool) -> list[_T1] | tuple[_T1]: ... + +class DProto1(Protocol): + def __radd__(self, other: Any, /) -> Any: + ... + + +class DProto2(Protocol): + def __radd__(self: _T1, other: Any, /) -> _T1: + ... + + +@overload +def func19(a: Any, b: DProto2) -> DProto2: + ... + + +@overload +def func19(a: Any, b: DProto1) -> Any: + ... + + +def func19(a: Any, b: Any) -> Any: + return a + b diff --git a/packages/pyright-internal/src/tests/samples/overload8.py b/packages/pyright-internal/src/tests/samples/overload8.py index f23aba796..270e0c8f2 100644 --- a/packages/pyright-internal/src/tests/samples/overload8.py +++ b/packages/pyright-internal/src/tests/samples/overload8.py @@ -108,3 +108,18 @@ def overloaded3(x: str | bytes) -> str | bytes: def func3(y: _T2): overloaded3(y) + + +_T3 = TypeVar("_T3") + +def func5(a: _T3) -> _T3: + return a + +@overload +def overloaded4(b: str) -> str: ... +@overload +def overloaded4(b: int) -> int: ... +def overloaded4(b: Union[str, int]) -> Union[str, int]: ... + +def func6(x: Union[str, int]) -> None: + y: Union[str, int] = overloaded4(func5(x)) diff --git a/packages/pyright-internal/src/tests/samples/override1.py b/packages/pyright-internal/src/tests/samples/override1.py new file mode 100644 index 000000000..b7dce33a9 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/override1.py @@ -0,0 +1,75 @@ +# This sample tests the handling of the @override decorator as described +# in PEP 698. + +from typing_extensions import Any, overload, override + +class ClassA: + def method1(self) -> None: + pass + +class ClassB: + def method3(self) -> None: + pass + + @overload + def method5(self, x: int) -> int: ... + @overload + def method5(self, x: str) -> str: ... + def method5(self, x: int | str) -> int | str: + ... + + +class ClassC(ClassA, ClassB): + @property + @override + # This should generate an error because prop_a doesn't + # override anything in its base class. + def prop_a(self) -> int: + raise NotImplementedError + + @override + def method1(self) -> None: + pass + + def method2(self) -> None: + pass + + @override + def method3(self) -> None: + pass + + @override + # This should generate an error because method3 does not + # override anything in a base class. + def method4(self) -> None: + pass + + @overload + def method5(self, x: int) -> int: ... + @overload + def method5(self, x: str) -> str: ... + + @override + def method5(self, x: int | str) -> int | str: + ... + + + @overload + def method6(self, x: int) -> int: ... + @overload + def method6(self, x: str) -> str: ... + + @override + # This should generate an error because method6 does not + # override anything in a base class. + def method6(self, x: int | str) -> int | str: + ... + + +class ClassD(Any): + ... + +class ClassE(ClassD): + @override + def method1(self) -> None: + pass diff --git a/packages/pyright-internal/src/tests/samples/override2.py b/packages/pyright-internal/src/tests/samples/override2.py new file mode 100644 index 000000000..6c874e14e --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/override2.py @@ -0,0 +1,31 @@ +# This sample tests the reportImplicitOverride diagnostic check +# (strict enforcement of PEP 698). + +from typing_extensions import override + + +class Base: + @override + def __init__(self): + pass + + def method1(self): + pass + + @property + def prop_c(self) -> int: + return 0 + + +class Child(Base): + def __init__(self): + pass + + # This should generate an error if reportImplicitOverride is enabled. + def method1(self): + pass + + @property + # This should generate an error if reportImplicitOverride is enabled. + def prop_c(self) -> int: + return 0 diff --git a/packages/pyright-internal/src/tests/samples/paramInference1.py b/packages/pyright-internal/src/tests/samples/paramInference1.py index 7378d4aa7..0ece9d28f 100644 --- a/packages/pyright-internal/src/tests/samples/paramInference1.py +++ b/packages/pyright-internal/src/tests/samples/paramInference1.py @@ -3,11 +3,18 @@ class Parent: + def __init__(self, a: int, b: str): + ... + def func1(self, a: int, b: str) -> float: ... class Child(Parent): + def __init__(self, a, b): + reveal_type(a, expected_text="int") + reveal_type(b, expected_text="str") + def func1(self, a, b): reveal_type(self, expected_text="Self@Child") reveal_type(a, expected_text="int") @@ -25,3 +32,12 @@ def func3(a=(1, 2), b=[1,2], c={1: 2}): reveal_type(a, expected_text="Unknown") reveal_type(b, expected_text="Unknown") reveal_type(c, expected_text="Unknown") + +class _Undefined: pass +Undefined = _Undefined() + +def func4(a=1, b=None, c=Undefined): + reveal_type(a, expected_text="int") + reveal_type(b, expected_text="Unknown | None") + reveal_type(c, expected_text="_Undefined | Unknown") + diff --git a/packages/pyright-internal/src/tests/samples/paramNames1.py b/packages/pyright-internal/src/tests/samples/paramNames1.py index 1aef85d32..6c0edae8a 100644 --- a/packages/pyright-internal/src/tests/samples/paramNames1.py +++ b/packages/pyright-internal/src/tests/samples/paramNames1.py @@ -1,6 +1,9 @@ # This sample tests the reportSelfClsParameterName setting. +from typing import Union, overload + + def foo(): pass @@ -31,6 +34,23 @@ def foo4(cls): def foo5(self): return 4 + @overload + # This should generate an error or warning if the setting + # is enabled because "self" is expected. + def foo6(x: "Class1") -> int: + ... + + @overload + # This should generate an error or warning if the setting + # is enabled because "self" is expected. + def foo6(x: "Class1") -> str: + ... + + # This should generate an error or warning if the setting + # is enabled because "self" is expected. + def foo6(x) -> Union[int, str]: + ... + class Metaclass(type): # This should not generate a error because the class derives diff --git a/packages/pyright-internal/src/tests/samples/paramSpec3.py b/packages/pyright-internal/src/tests/samples/paramSpec3.py index f16059a01..b8aa5f11b 100644 --- a/packages/pyright-internal/src/tests/samples/paramSpec3.py +++ b/packages/pyright-internal/src/tests/samples/paramSpec3.py @@ -57,9 +57,10 @@ def bar(x: Union[int, str]) -> Optional[str]: return x -# This should generate an error because ParamSpec cannot -# be used with an overloaded function. x = add_logging(bar) +reveal_type( + x, expected_text="Overload[(x: int) -> Awaitable[None], (x: str) -> Awaitable[str]]" +) class Foo(Generic[Ps, R]): diff --git a/packages/pyright-internal/src/tests/samples/paramSpec35.py b/packages/pyright-internal/src/tests/samples/paramSpec35.py index 02b2c99c1..51866cf7f 100644 --- a/packages/pyright-internal/src/tests/samples/paramSpec35.py +++ b/packages/pyright-internal/src/tests/samples/paramSpec35.py @@ -17,8 +17,12 @@ def a1(p0: int) -> int: def a2(p0: int, p2: str) -> int: ... -func1(a1, a1) -func1(a2, a2) + +v1 = func1(a1, a1) +reveal_type(v1, expected_text="(p0: int) -> bool") + +v2 = func1(a2, a2) +reveal_type(v2, expected_text="(p0: int, p2: str) -> bool") # This should generate an error because a1 and a2 are not compatible. -func1(a1, a2) +v3 = func1(a1, a2) diff --git a/packages/pyright-internal/src/tests/samples/paramSpec39.py b/packages/pyright-internal/src/tests/samples/paramSpec39.py new file mode 100644 index 000000000..2cc88165c --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/paramSpec39.py @@ -0,0 +1,16 @@ +# This sample tests the case where a function that uses a ParamSpec +# is passed to itself. This should not cause a crash or infinite recursion +# within the type evaluator. + +from typing import TypeVar, Callable +from typing_extensions import ParamSpec + +P = ParamSpec("P") +T = TypeVar("T") + + +def test(x: Callable[P, T]) -> Callable[P, T]: + return x + + +test(test) diff --git a/packages/pyright-internal/src/tests/samples/paramSpec40.py b/packages/pyright-internal/src/tests/samples/paramSpec40.py new file mode 100644 index 000000000..41dac064a --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/paramSpec40.py @@ -0,0 +1,27 @@ +# This sample tests the interaction between a generic callable parameterized +# with a ParamSpec and another generic callable that is parameterized +# with a TypeVar. + +from typing import Callable, ParamSpec, TypeVar + +_P = ParamSpec("_P") +_R = TypeVar("_R") + + +def call(obj: Callable[_P, _R], *args: _P.args, **kwargs: _P.kwargs) -> _R: + return obj(*args, **kwargs) + + +def func1(): + return 0 + + +def func2(): + return 0.0 + + +result1 = map(call, [func1]) +reveal_type(result1, expected_text="map[int]") + +result2 = map(call, [func1, func2]) +reveal_type(result2, expected_text="map[float]") diff --git a/packages/pyright-internal/src/tests/samples/parserRecovery1.py b/packages/pyright-internal/src/tests/samples/parserRecovery1.py new file mode 100644 index 000000000..ec041fb60 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/parserRecovery1.py @@ -0,0 +1,4 @@ +def func1(input: str): + if input[0] == "[": + +def func2(ch: str): diff --git a/packages/pyright-internal/src/tests/samples/parserRecovery2.py b/packages/pyright-internal/src/tests/samples/parserRecovery2.py new file mode 100644 index 000000000..d1cf3a707 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/parserRecovery2.py @@ -0,0 +1,4 @@ +def func1(input: str): + if input[0] == "[": + + def func2(ch: str): diff --git a/packages/pyright-internal/src/tests/samples/parserRecovery3.py b/packages/pyright-internal/src/tests/samples/parserRecovery3.py new file mode 100644 index 000000000..756313b23 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/parserRecovery3.py @@ -0,0 +1,6 @@ +def func1(input: str): + if True: + if False: + if False: + +def func2(ch: str): diff --git a/packages/pyright-internal/src/tests/samples/partial3.py b/packages/pyright-internal/src/tests/samples/partial3.py new file mode 100644 index 000000000..bda6ae1ca --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/partial3.py @@ -0,0 +1,31 @@ +# This sample tests that the functools.partial special-case logic +# properly handles bidirectional type inference for argument evaluation. + +from functools import partial + + +class BaseClass: + pass + + +class SubClass(BaseClass): + pass + + +def func(base: BaseClass): + pass + + +def func_list(base: list[BaseClass]): + pass + + +def func_set(base: set[BaseClass]): + pass + + +sub = SubClass() + +partial(func, sub) +partial(func_list, [sub]) +partial(func_set, {sub}) diff --git a/packages/pyright-internal/src/tests/samples/properties14.py b/packages/pyright-internal/src/tests/samples/properties14.py new file mode 100644 index 000000000..a3f4cac52 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/properties14.py @@ -0,0 +1,23 @@ +# This sample handles the case where a property setter contains +# a function-scoped TypeVar. + +from typing import Hashable, TypeVar, Sequence + +HashableT = TypeVar("HashableT", bound=Hashable) + +class Foo: + def __init__(self): + self._something = [] + + @property + def something(self) -> Sequence[Hashable]: + return self._something + + @something.setter + def something(self, thing: list[HashableT]): + self._something = thing + + +f = Foo() +f.something = ["a", "b", "c"] + diff --git a/packages/pyright-internal/src/tests/samples/protocol17.py b/packages/pyright-internal/src/tests/samples/protocol17.py index 7b6a1637f..f0b977f79 100644 --- a/packages/pyright-internal/src/tests/samples/protocol17.py +++ b/packages/pyright-internal/src/tests/samples/protocol17.py @@ -92,3 +92,7 @@ class Protocol9(Protocol[_T1_co]): @property def prop1(self) -> _T1_co: ... + +class Protocol10(Protocol[_T1_co]): + def m1(self) -> type[_T1_co]: + ... diff --git a/packages/pyright-internal/src/tests/samples/protocol28.py b/packages/pyright-internal/src/tests/samples/protocol28.py index 5d7027b25..06386436e 100644 --- a/packages/pyright-internal/src/tests/samples/protocol28.py +++ b/packages/pyright-internal/src/tests/samples/protocol28.py @@ -7,7 +7,7 @@ _T1 = TypeVar("_T1", contravariant=True) _T2 = TypeVar("_T2", covariant=True) _T3 = TypeVar("_T3", covariant=True) -Tv_my_callable = TypeVar("Tv_my_callable", bound="MyCallable[object]") +Tv_my_callable = TypeVar("Tv_my_callable", bound="MyCallable[Any]") class MyCallable(Protocol[_T1]): diff --git a/packages/pyright-internal/src/tests/samples/protocol3.py b/packages/pyright-internal/src/tests/samples/protocol3.py index c7e585f3e..c6df4756f 100644 --- a/packages/pyright-internal/src/tests/samples/protocol3.py +++ b/packages/pyright-internal/src/tests/samples/protocol3.py @@ -1,7 +1,7 @@ # This sample tests the assignment of protocols that # include property declarations. -from typing import Protocol, TypeVar +from typing import ContextManager, Protocol, TypeVar class Foo1(Protocol): @@ -108,3 +108,19 @@ def real(self) -> _T_co: ... foo5 = Foo5() h: MockFoo5[Foo5] = foo5 + + +_MockFoo6 = TypeVar("_MockFoo6", bound="MockFoo6") +_Foo6 = TypeVar("_Foo6", bound="Foo6") + + +class MockFoo6(Protocol): + @property + def bar(self: _MockFoo6) -> ContextManager[_MockFoo6]: ... + +class Foo6(): + @property + def bar(self: _Foo6) -> ContextManager[_Foo6]: ... + + +i: MockFoo6 = Foo6() diff --git a/packages/pyright-internal/src/tests/samples/protocol32.py b/packages/pyright-internal/src/tests/samples/protocol32.py index 936595022..96787c6a0 100644 --- a/packages/pyright-internal/src/tests/samples/protocol32.py +++ b/packages/pyright-internal/src/tests/samples/protocol32.py @@ -1,7 +1,7 @@ # This sample tests the case where a protocol class derives from # another protocol class. -from typing import Generic, TypeVar, Protocol +from typing import Generic, TypeVar, Protocol, overload Arg = TypeVar("Arg", contravariant=True) Value = TypeVar("Value") @@ -65,3 +65,18 @@ def func3(arg: Arg, value: Value) -> Interface[Arg, Value]: return Implementation3[Arg, Value]() +class Base4(Protocol): + @overload + def method3(self, message: int) -> int: + ... + + @overload + def method3(self, message: str) -> str: + ... + + def method3(self, message: str | int): + return message + +class Implementation4(Base4): + ... + diff --git a/packages/pyright-internal/src/tests/samples/protocol36.py b/packages/pyright-internal/src/tests/samples/protocol36.py new file mode 100644 index 000000000..5c6aea43d --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/protocol36.py @@ -0,0 +1,18 @@ +# This sample tests the handling of nested protocols. + +from typing import Protocol, TypeVar, overload + +_T_co = TypeVar("_T_co", covariant=True) + +class _NestedSequence(Protocol[_T_co]): + @overload + def __getitem__(self, __i: int) -> _T_co | "_NestedSequence[_T_co]": + ... + @overload + def __getitem__(self, __s: slice) -> "_NestedSequence[_T_co]": + ... + + +def func(v1: list[list[list[int]]]): + a: _NestedSequence[int] = v1 + b: _NestedSequence[int] = [[[3, 4]]] diff --git a/packages/pyright-internal/src/tests/samples/protocol37.py b/packages/pyright-internal/src/tests/samples/protocol37.py new file mode 100644 index 000000000..b007a29ab --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/protocol37.py @@ -0,0 +1,19 @@ +# This sample tests that a method can be satisfied by a metaclass +# when doing protocol matching. + +from typing import Iterator + + +class StyleMeta(type): + def __iter__(cls) -> Iterator[str]: + yield "a" + yield "b" + yield "c" + + +class Style(metaclass=StyleMeta): + pass + + +x: type[Style] = Style +print(list(x)) diff --git a/packages/pyright-internal/src/tests/samples/protocol38.py b/packages/pyright-internal/src/tests/samples/protocol38.py new file mode 100644 index 000000000..d300d85bc --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/protocol38.py @@ -0,0 +1,20 @@ +# This sample tests the case where a protocol is specialized with +# a literal type. + +from typing import Literal, Protocol, Self + + +class Negatable(Protocol): + def __neg__(self) -> Self: + ... + + +def func1(x: Negatable) -> None: + ... + + +func1(0) + + +def func2(val: Literal[0, 1]): + func1(val) diff --git a/packages/pyright-internal/src/tests/samples/protocol4.py b/packages/pyright-internal/src/tests/samples/protocol4.py index 2733a2bc1..8032f224a 100644 --- a/packages/pyright-internal/src/tests/samples/protocol4.py +++ b/packages/pyright-internal/src/tests/samples/protocol4.py @@ -4,7 +4,7 @@ from typing import ClassVar, List, Protocol -class Template(Protocol): +class ProtoA(Protocol): a: int b: ClassVar[str] @@ -20,3 +20,14 @@ def cls_method(cls) -> None: # This should be an error cls.test2 = 3 + +class ProtoB(Protocol): + x: ClassVar[int] + +class B: + x: int + +# This should generate an error because x is not a ClassVar in B. +a: ProtoB = B() + + \ No newline at end of file diff --git a/packages/pyright-internal/src/tests/samples/protocol6.py b/packages/pyright-internal/src/tests/samples/protocol6.py index da8ab6e03..c4265aba8 100644 --- a/packages/pyright-internal/src/tests/samples/protocol6.py +++ b/packages/pyright-internal/src/tests/samples/protocol6.py @@ -63,3 +63,19 @@ class Cow: d: Ungulate[bytes] = Camel() e: Ungulate[str] = Cow() f: CamelLike = Camel() + + + +class CallTreeProto(Protocol): + subcalls: list["CallTreeProto"] + +class MyCallTree: + subcalls: list["MyCallTree"] + +class OtherCallTree: + subcalls: list["CallTreeProto"] + +# This should generate an error. +x1: CallTreeProto = MyCallTree() + +x2: CallTreeProto = OtherCallTree() diff --git a/packages/pyright-internal/src/tests/samples/pyrightComment1.py b/packages/pyright-internal/src/tests/samples/pyrightComment1.py new file mode 100644 index 000000000..d51206cee --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/pyrightComment1.py @@ -0,0 +1,19 @@ +# This sample tests error handling for pyright comments. + +# This should generate an error because "stricter" isn't a valid directive. +# pyright: basic , stricter + +# This should generate an error because it's missing a directive. +# pyright: + +# This should generate an error because the value is missing. +# pyright: reportMissingTypeStubs + +# This should generate an error because the value is missing. +# pyright: reportMissingTypeStubs= + +# This should generate two errors because the values are invalid. +# pyright: reportMissingTypeStubs = blah , strictListInference = none + +# This should generate two errors because the rule is invalid. +# pyright: reportBlahBlah = true diff --git a/packages/pyright-internal/src/tests/samples/pyrightIgnore2.py b/packages/pyright-internal/src/tests/samples/pyrightIgnore2.py index d2ff24507..0ea0ced52 100644 --- a/packages/pyright-internal/src/tests/samples/pyrightIgnore2.py +++ b/packages/pyright-internal/src/tests/samples/pyrightIgnore2.py @@ -1,4 +1,4 @@ -# This sample tests the use of a # pyright: ignore comment in conjunction +# This sample tests the use of a pyright ignore comment in conjunction # with the reportUnnecessaryTypeIgnoreComment mechanism. from typing import Optional @@ -19,6 +19,6 @@ def foo(self, x: Optional[int]) -> str: v4 = x + x # pyright: ignore [] # One of these is unnecessary - v5 = x + "hi" # pyright: ignore [reportGeneralTypeIssues, foo] + v5 = x + "hi" # test # pyright: ignore [reportGeneralTypeIssues, foo] return 3 # pyright: ignore [reportGeneralTypeIssues] diff --git a/packages/pyright-internal/src/tests/samples/recursiveTypeAlias1.py b/packages/pyright-internal/src/tests/samples/recursiveTypeAlias1.py index d13283f48..357686f71 100644 --- a/packages/pyright-internal/src/tests/samples/recursiveTypeAlias1.py +++ b/packages/pyright-internal/src/tests/samples/recursiveTypeAlias1.py @@ -26,13 +26,11 @@ bar1: Foo = [True, [True, False]] bar2: Foo = [True, [True], {True: False}] -bar3: Foo = {[True]: False} bar4: Foo = {True: [False]} # These should generate errors. baz1: Foo = [True, ["True", False]] baz2: Foo = [True, [True], {True: "False"}] -baz3: Foo = {["True"]: False} baz4: Foo = {True: ["False"]} Json = Union[None, int, str, float, List["Json"], Dict[str, "Json"]] diff --git a/packages/pyright-internal/src/tests/samples/recursiveTypeAlias10.py b/packages/pyright-internal/src/tests/samples/recursiveTypeAlias10.py new file mode 100644 index 000000000..e977dba88 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/recursiveTypeAlias10.py @@ -0,0 +1,35 @@ +# This sample tests the case where two recursive type aliases +# with different definitions overlap. + +from typing import Mapping, Optional, Sequence, Union + +JsonArr1 = Sequence[Optional["JsonVal1"]] +JsonObj1 = Mapping[str, Optional["JsonVal1"]] +JsonVal1 = Union[bool, float, int, str, "JsonArr1", "JsonObj1"] + +JsonArr2 = Sequence[Optional["JsonVal2"]] +JsonObj2 = Mapping[str, Optional["JsonVal2"]] +JsonVal2 = Union[bool, float, int, str, "JsonArr2", "JsonObj2"] + + +def func1(v: JsonVal1): + x: JsonVal2 = v + + return x + + +def func2(v: Optional[JsonVal1]): + # This should generate an error. + x: JsonVal2 = v + + return x + + +def func3(v: Optional[JsonVal1]): + # This should generate an error. + x: Optional[JsonVal2] = v + + return x + + + \ No newline at end of file diff --git a/packages/pyright-internal/src/tests/samples/recursiveTypeAlias11.py b/packages/pyright-internal/src/tests/samples/recursiveTypeAlias11.py new file mode 100644 index 000000000..40239e928 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/recursiveTypeAlias11.py @@ -0,0 +1,46 @@ +# This sample tests the case where a recursive type alias makes use of +# a bound or constrained TypeVar. + + +from typing import Any, Generic, TypeVar + +""" Test bound TypeVar """ + + +class ClassA1: + pass + + +T1 = TypeVar("T1", bound=ClassA1) + + +class ClassA2(ClassA1, Generic[T1]): + pass + + +class ClassA3(ClassA1): + pass + + +TA1 = ClassA2["TA1"] | ClassA3 + + +""" Test constrained TypeVar """ + + +class ClassB1: + pass + + +T2 = TypeVar("T2", "ClassB2[Any] | ClassB3", int) + + +class ClassB2(ClassB1, Generic[T2]): + pass + + +class ClassB3(ClassB1): + pass + + +TA2 = ClassB2["TA2"] | ClassB3 diff --git a/packages/pyright-internal/src/tests/samples/recursiveTypeAlias12.py b/packages/pyright-internal/src/tests/samples/recursiveTypeAlias12.py new file mode 100644 index 000000000..b8ad60846 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/recursiveTypeAlias12.py @@ -0,0 +1,24 @@ +# This sample tests the case where a recursive type alias is evaluated +# for type compatibility with a recursive protocol. We want to make sure +# this doesn't lead to extremely long evaluation times or stack overflows. + +from collections.abc import Callable +from types import FrameType +from typing import Any, Protocol, Self, TypeAlias + + +class TraceFunctionProto(Protocol): + def __call__(self, frame: FrameType, event: str, arg: Any) -> Self | None: + ... + +TraceFunction: TypeAlias = Callable[[FrameType, str, Any], "TraceFunction | None"] + +def settrace(tf: TraceFunction | None) -> None: ... + +def func1(frame: FrameType, event: str, arg: Any) -> TraceFunction: + ... + +def func2(tf: TraceFunctionProto | None): + settrace(tf) + settrace(func1) + diff --git a/packages/pyright-internal/src/tests/samples/recursiveTypeAlias13.py b/packages/pyright-internal/src/tests/samples/recursiveTypeAlias13.py new file mode 100644 index 000000000..ae00c4561 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/recursiveTypeAlias13.py @@ -0,0 +1,22 @@ +# This sample tests the case where a recursive type alias previous +# led to infinite recursion. + +from typing import Iterable, TypeVar, Union + +T = TypeVar("T") +Tree = list[Union["Tree[T]", T]] + + +def _flatten(tree: Union[Tree[T], T]) -> Iterable[T]: + if not isinstance(tree, list): + yield tree + return + for v in tree: + yield from _flatten(v) + + +def flatten(tree: Tree[T]) -> Iterable[T]: + return _flatten(tree) + + +flatten([1, [2, 3]]) diff --git a/packages/pyright-internal/src/tests/samples/recursiveTypeAlias5.pyi b/packages/pyright-internal/src/tests/samples/recursiveTypeAlias5.pyi index 8bbcad803..e1cbf6c47 100644 --- a/packages/pyright-internal/src/tests/samples/recursiveTypeAlias5.pyi +++ b/packages/pyright-internal/src/tests/samples/recursiveTypeAlias5.pyi @@ -1,5 +1,6 @@ # This sample tests the case where a recursive type alias -# indirectly refers to itself in a way that is illegal. +# indirectly refers to itself through either a parameter +# annotation or return type annotation. _str = str diff --git a/packages/pyright-internal/src/tests/samples/regionComments1.py b/packages/pyright-internal/src/tests/samples/regionComments1.py new file mode 100644 index 000000000..4f74f3a87 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/regionComments1.py @@ -0,0 +1,18 @@ +# This sample tests Pyright's handling of #region/#endregion comments + +#region A +# region B +# endregion +#endregion + +#region_not a region +#region: foo +#endregion + +#region Extra endregion +#endregion +#endregion + +#region +#region Unclosed region +#endregion diff --git a/packages/pyright-internal/src/tests/samples/required2.py b/packages/pyright-internal/src/tests/samples/required2.py index 30ad9e351..6b71f40e6 100644 --- a/packages/pyright-internal/src/tests/samples/required2.py +++ b/packages/pyright-internal/src/tests/samples/required2.py @@ -3,14 +3,14 @@ # pyright: reportMissingModuleSource=false -from typing import Literal, Optional, Type, TypedDict +from typing import Literal, Optional, Type, TypedDict, Annotated from typing_extensions import NotRequired, Required class TD1(TypedDict, total=False): - a: Required[int] - b: NotRequired[str] - c: Required[int | str] + a: Annotated["Required[int]", ""] + b: Annotated[NotRequired[str], ""] + c: "Required[int | str]" d: Required[Optional[str]] e: Required[Literal[1, 2, 3]] f: Required[None] diff --git a/packages/pyright-internal/src/tests/samples/self6.py b/packages/pyright-internal/src/tests/samples/self6.py new file mode 100644 index 000000000..b39a5fab2 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/self6.py @@ -0,0 +1,14 @@ +# This sample tests that a Self type used within a `__new__` method does +# not preclude the use of a contravariant TypeVar within a generic class. + +from typing import Self, TypeVar, Generic + +T_contra = TypeVar("T_contra", contravariant=True) + + +class MyClass(Generic[T_contra]): + def __new__(cls: type[Self]) -> Self: + ... + + +MyClass[int]() diff --git a/packages/pyright-internal/src/tests/samples/self7.py b/packages/pyright-internal/src/tests/samples/self7.py new file mode 100644 index 000000000..3223be8ae --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/self7.py @@ -0,0 +1,11 @@ +# This sample tests the case where type[Self] is returned but Self +# is expected. + +from typing import Self + + +class Foo: + @classmethod + def bar(cls) -> Self: + # This should generate an error. + return cls diff --git a/packages/pyright-internal/src/tests/samples/self8.py b/packages/pyright-internal/src/tests/samples/self8.py new file mode 100644 index 000000000..624a4a876 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/self8.py @@ -0,0 +1,23 @@ +# This sample tests that a __new__ method allows for the Self +# to be associated with the provided `cls` argument rather than +# the class bound to the `__new__` method. + +import enum +from typing_extensions import Self, reveal_type + + +class Enum1(enum.IntEnum): + def __new__(cls, value: int, doc: str) -> Self: + member = int.__new__(cls, value) + reveal_type(member, expected_text="Self@Enum1") + member._value_ = value + member.__doc__ = doc + return member + + +class MyStr(str): + pass + + +v1 = str.__new__(MyStr) +reveal_type(v1, expected_text="MyStr") diff --git a/packages/pyright-internal/src/tests/samples/specialForm1.py b/packages/pyright-internal/src/tests/samples/specialForm1.py new file mode 100644 index 000000000..e54b4a557 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/specialForm1.py @@ -0,0 +1,17 @@ +# This sample tests the case where the special-form aliases for +# the stdlib collection classes are instantiated. + +# This should generate an error. +from typing import Dict, List, Set, Tuple + +# This should generate an error. +t1 = Dict() + +# This should generate an error. +t2 = List() + +# This should generate an error. +t3 = Set() + +# This should generate an error. +t4 = Tuple() diff --git a/packages/pyright-internal/src/tests/samples/staticExpressions1.py b/packages/pyright-internal/src/tests/samples/staticExpressions1.py index 692786a0a..63a4416ae 100644 --- a/packages/pyright-internal/src/tests/samples/staticExpressions1.py +++ b/packages/pyright-internal/src/tests/samples/staticExpressions1.py @@ -50,3 +50,25 @@ x = 1 else: x = "error!" + +class Dummy: + DEFINED_FALSE: bool + DEFINED_TRUE: bool + DEFINED_STR: str + +dummy = Dummy() + +if dummy.DEFINED_TRUE: + x = 1 +else: + x = "error!" + +if not dummy.DEFINED_FALSE: + x = 1 +else: + x = "error!" + +if dummy.DEFINED_STR == "hi!": + x = 1 +else: + x = "error!" diff --git a/packages/pyright-internal/src/tests/samples/subscript4.py b/packages/pyright-internal/src/tests/samples/subscript4.py new file mode 100644 index 000000000..01bec6b8a --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/subscript4.py @@ -0,0 +1,10 @@ +# This sample tests the handling of a subscript in a loop that includes +# a del statement. + +# pyright: strict + +def func1(lst: list[tuple[int, int]]): + for _ in range(1): + lst[-1] = lst[-1][1], lst[-1][0] + del lst[-1] + diff --git a/packages/pyright-internal/src/tests/samples/super10.py b/packages/pyright-internal/src/tests/samples/super10.py new file mode 100644 index 000000000..8c790952a --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/super10.py @@ -0,0 +1,20 @@ +# This sample tests that super() calls use Self for binding. + +class A: + def clone(self): + return self + + +class B(A): + def clone(self): + return super().clone() + + +class C(B): + def clone(self): + return super().clone() + + +reveal_type(A().clone(), expected_text="A") +reveal_type(B().clone(), expected_text="B") +reveal_type(C().clone(), expected_text="C") diff --git a/packages/pyright-internal/src/tests/samples/super6.py b/packages/pyright-internal/src/tests/samples/super6.py index e0113f70a..34c34612c 100644 --- a/packages/pyright-internal/src/tests/samples/super6.py +++ b/packages/pyright-internal/src/tests/samples/super6.py @@ -15,3 +15,27 @@ def __new__(cls): f = Foo() reveal_type(f, expected_text="Foo") + + + +class FirstLevelMeta(type): + def __new__(cls, name: str, bases, dct): + new_class = super().__new__(cls, name, bases, dct) + reveal_type(new_class, expected_text='Self@FirstLevelMeta') + return new_class + + +class SecondLevelMeta(FirstLevelMeta): + def __new__(cls, name: str, bases, dct): + new_class = super().__new__(cls, name, bases, dct) + reveal_type(new_class, expected_text='Self@SecondLevelMeta') + return new_class + + +class ThirdLevelMeta(SecondLevelMeta): + def __new__(cls, name: str, bases, dct): + new_class = super().__new__(cls, name, bases, dct) + reveal_type(new_class, expected_text='Self@ThirdLevelMeta') + return new_class + + diff --git a/packages/pyright-internal/src/tests/samples/super7.py b/packages/pyright-internal/src/tests/samples/super7.py index 84afae2aa..3b5340792 100644 --- a/packages/pyright-internal/src/tests/samples/super7.py +++ b/packages/pyright-internal/src/tests/samples/super7.py @@ -33,7 +33,7 @@ def classmethod_super_extra_arg(cls, value: int) -> int: self = cls() reveal_type(super(__class__, self), expected_text="BaseClass") - # This should generate an errorr. + # This should generate an error. return super(__class__, self).my_method(self, value) @staticmethod diff --git a/packages/pyright-internal/src/tests/samples/tryExcept1.py b/packages/pyright-internal/src/tests/samples/tryExcept1.py index 92f712cc3..ca49b13f3 100644 --- a/packages/pyright-internal/src/tests/samples/tryExcept1.py +++ b/packages/pyright-internal/src/tests/samples/tryExcept1.py @@ -36,4 +36,17 @@ def func3(): # except or finally clause. try: pass - \ No newline at end of file + +class Exception1(BaseException): ... + +base_exceptions = (RuntimeError, NameError) + +class Exception2(*base_exceptions): ... + +def func4(): + try: + pass + except Exception1: + pass + except Exception2: + pass diff --git a/packages/pyright-internal/src/tests/samples/tryExcept7.py b/packages/pyright-internal/src/tests/samples/tryExcept7.py index af88ebadc..7cf6b0b19 100644 --- a/packages/pyright-internal/src/tests/samples/tryExcept7.py +++ b/packages/pyright-internal/src/tests/samples/tryExcept7.py @@ -9,7 +9,7 @@ def func1(): # This should generate an error if using Python 3.10 or earlier. except* ValueError as e: - reveal_type(e, expected_text="ExceptionGroup[ValueError]") + reveal_type(e, expected_text="BaseExceptionGroup[ValueError]") pass # This should generate an error if using Python 3.10 or earlier. diff --git a/packages/pyright-internal/src/tests/samples/tupleUnpack1.py b/packages/pyright-internal/src/tests/samples/tupleUnpack1.py index 8d234670f..513cf4d6e 100644 --- a/packages/pyright-internal/src/tests/samples/tupleUnpack1.py +++ b/packages/pyright-internal/src/tests/samples/tupleUnpack1.py @@ -61,3 +61,16 @@ def func12(*v11: Unpack[tuple[int, int]]): def func13(t: type): if t is Unpack: ... + +def func14( + *args: Unpack[tuple[int]], + other: str, +) -> None: + ... + +func14(1, other="hi") + +# This should generate an error because the second argument +# corresponds to a keyword-only parameter. +func14(1, "hi") + diff --git a/packages/pyright-internal/src/tests/samples/tuples1.py b/packages/pyright-internal/src/tests/samples/tuples1.py index eb26d5c8c..10d2182ba 100644 --- a/packages/pyright-internal/src/tests/samples/tuples1.py +++ b/packages/pyright-internal/src/tests/samples/tuples1.py @@ -1,10 +1,13 @@ # This sample file tests various aspects of type analysis for tuples. -from typing import List, Tuple, Union import os +from typing import Callable +from typing_extensions import TypeVarTuple, Unpack +Ts = TypeVarTuple("Ts") -def func1() -> Tuple[int, int, int]: + +def func1() -> tuple[int, int, int]: a = 1, 2, 3 # This should generate an error because @@ -25,7 +28,7 @@ def func1() -> Tuple[int, int, int]: return a -def func2() -> Tuple[int, int, str]: +def func2() -> tuple[int, int, str]: a = 1, 2, 3 # This should generate an error because the @@ -33,16 +36,16 @@ def func2() -> Tuple[int, int, str]: return a -def func3() -> Tuple[str, ...]: +def func3() -> tuple[str, ...]: a = "1", 2, 3 # This should generate an error because the - # heterogenous tuple can't be assigned to - # the homogenous tuple type. + # heterogeneous tuple can't be assigned to + # the homogeneous tuple type. return a -def func4() -> Tuple[str, ...]: +def func4() -> tuple[str, ...]: a = (1,) # This should generate an error because the first @@ -55,7 +58,7 @@ def func6(): a.index("1") -def func7(a: Tuple) -> Tuple[()]: +def func7(a: tuple) -> tuple[()]: return () @@ -71,7 +74,7 @@ def func8() -> str: return dirname -def func9(param1: Tuple[int, ...]): +def func9(param1: tuple[int, ...]): pass @@ -125,17 +128,20 @@ def func11() -> float: def func12(): data = ["a", "b"] data1 = (*map(str.split, data),) - data2: Tuple[List[str], ...] = (*map(str.split, data),) + data2: tuple[list[str], ...] = (*map(str.split, data),) data3 = (*map(str.split, data),) - data4: Tuple[List[str], ...] = (*map(str.split, data),) + data4: tuple[list[str], ...] = (*map(str.split, data),) # Tests for index-out-of-range error. def func13( - a: Tuple[int, str], - b: Tuple[()], - c: Tuple[int, ...], - d: Union[Tuple[int], Tuple[str, str], Tuple[int, ...]], + a: tuple[int, str], + b: tuple[()], + c: tuple[int, ...], + d: tuple[int] | tuple[str, str] | tuple[int, ...], + e: tuple[int, Unpack[tuple[str, ...]], float], + f: tuple[int, Unpack[Ts], float], + g: tuple[Unpack[Ts]], ): v1 = a[0] reveal_type(v1, expected_text="int") @@ -177,9 +183,32 @@ def func13( # This should generate an error. v13[0] + v14 = e[0] + reveal_type(v14, expected_text="int | str | float") + + v15 = f[0] + reveal_type(v15, expected_text="int | Union[*Ts@func13] | float") + -# Test for construction using the tuple constructor def func14(): list1 = [1, 2, 3] v1 = tuple(list1) reveal_type(v1, expected_text="tuple[int, ...]") + + +def func15(var: tuple[()]) -> str: + raise NotImplementedError + + +def func16(var: tuple[int, int]) -> str: + raise NotImplementedError + + +def func17(var: tuple[int, int, int]) -> str: + raise NotImplementedError + + +f: Callable[[tuple[int, ...]], str] +f = func15 +f = func16 +f = func17 diff --git a/packages/pyright-internal/src/tests/samples/tuples15.py b/packages/pyright-internal/src/tests/samples/tuples15.py index 6b6c61d3a..fdaf16000 100644 --- a/packages/pyright-internal/src/tests/samples/tuples15.py +++ b/packages/pyright-internal/src/tests/samples/tuples15.py @@ -14,3 +14,15 @@ def func1(a: Tuple[int, int, int], b: Tuple[str, str]): def func2(a: Tuple[int, int, int], b: Tuple[str, ...]): reveal_type(a + b, expected_text="tuple[int | str, ...]") + + +def func3(input_list): + output_tuple = () + + for _, value in enumerate([]): + if value is None: + output_tuple += (None,) + continue + output_tuple += (input_list[value],) + + return output_tuple diff --git a/packages/pyright-internal/src/tests/samples/tuples17.py b/packages/pyright-internal/src/tests/samples/tuples17.py new file mode 100644 index 000000000..366c18a4b --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/tuples17.py @@ -0,0 +1,11 @@ +# This sample tests a limiter that prevents infinite recursion +# in the tuple inference logic. + +def func1(val: int): + t = None + while True: + t = (val or t, val) + val += 1 + if val > 1000: + break + return t diff --git a/packages/pyright-internal/src/tests/samples/tuples4.py b/packages/pyright-internal/src/tests/samples/tuples4.py index 2e848d35b..642113fa8 100644 --- a/packages/pyright-internal/src/tests/samples/tuples4.py +++ b/packages/pyright-internal/src/tests/samples/tuples4.py @@ -1,4 +1,4 @@ -# This sample tests the translation of a heterogenous tuple +# This sample tests the translation of a heterogeneous tuple # into an Iterable. from typing import Iterable, TypeVar, Union diff --git a/packages/pyright-internal/src/tests/samples/typeAlias13.py b/packages/pyright-internal/src/tests/samples/typeAlias13.py index 36814a2e4..d9c9d53bc 100644 --- a/packages/pyright-internal/src/tests/samples/typeAlias13.py +++ b/packages/pyright-internal/src/tests/samples/typeAlias13.py @@ -4,9 +4,9 @@ from typing import Any, Callable, Concatenate, Coroutine, TypeVar, Union from typing_extensions import ParamSpec -T = TypeVar('T') +T = TypeVar("T") U = TypeVar("U") -P = ParamSpec('P') +P = ParamSpec("P") Method = Callable[Concatenate[T, P], U] @@ -17,6 +17,7 @@ CoroMethod = Method[T, P, Coro[U]] CoroMaybeMethod = Union[CoroMethod[T, P, U], CoroFunc[P, U]] + class D: ... @@ -32,22 +33,29 @@ class F: DT = TypeVar("DT", bound=D) Error = CoroMaybeMethod[DT, [F, E], Any] -reveal_type(Error, expected_text="((DT@Error, F, E) -> Coroutine[Any, Any, Any]) | ((F, E) -> Coroutine[Any, Any, Any])") +reveal_type( + Error, + expected_text="Type[(DT@Error, F, E) -> Coroutine[Any, Any, Any]] | Type[(F, E) -> Coroutine[Any, Any, Any]]", +) class A: ... + class B: ... + class C: ... -BT = TypeVar('BT', bound=B) +BT = TypeVar("BT", bound=B) Something = CoroMaybeMethod[A, [BT, C], Any] -reveal_type(Something, expected_text="((A, BT@Something, C) -> Coroutine[Any, Any, Any]) | ((BT@Something, C) -> Coroutine[Any, Any, Any])") - \ No newline at end of file +reveal_type( + Something, + expected_text="Type[(A, BT@Something, C) -> Coroutine[Any, Any, Any]] | Type[(BT@Something, C) -> Coroutine[Any, Any, Any]]", +) diff --git a/packages/pyright-internal/src/tests/samples/typeAlias16.py b/packages/pyright-internal/src/tests/samples/typeAlias16.py index 337d8a258..783e918da 100644 --- a/packages/pyright-internal/src/tests/samples/typeAlias16.py +++ b/packages/pyright-internal/src/tests/samples/typeAlias16.py @@ -5,7 +5,7 @@ Mode = Literal["read", "write"] T = TypeVar("T") -Entry: TypeAlias = dict[T, int] +Entry: "TypeAlias" = dict[T, int] Entry2: TypeAlias = dict[Mode, int] diff --git a/packages/pyright-internal/src/tests/samples/typeAlias17.py b/packages/pyright-internal/src/tests/samples/typeAlias17.py new file mode 100644 index 000000000..0c9cf5b11 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/typeAlias17.py @@ -0,0 +1,47 @@ +# This sample tests reporting of type argument count mismatch when +# used with generic type aliases. + +from typing import Callable, ParamSpec, TypeVar, TypeVarTuple, Unpack + + +T1 = TypeVar("T1") +T2 = TypeVar("T2") +P = ParamSpec("P") +Tv1 = TypeVarTuple("Tv1") + +TA1 = dict[T1, T2] + +# This should generate an error if reportMissingTypeArguments is enabled. +a1: TA1 +# This should generate an error because of too few type arguments. +a2: TA1[str] +a3: TA1[str, str] +# This should generate an error because of too many type arguments. +a4: TA1[str, str, str] + +TA2 = Callable[P, T1] + +# This should generate an error if reportMissingTypeArguments is enabled. +b1: TA2 +# This should generate an error because of too few type arguments. +b2: TA2[...] +b3: TA2[..., int] +# This should generate an error because of too many type arguments. +b4: TA2[..., int, int] + +TA3 = Callable[P, int] + +# This should generate an error if reportMissingTypeArguments is enabled. +c1: TA3 +c2: TA3[int] +c3: TA3[int, int] +c4: TA3[int, int, int] + + +TA4 = list[T1] | tuple[Unpack[Tv1]] + +# This should generate an error if reportMissingTypeArguments is enabled. +d1: TA4 +d2: TA4[int] +d3: TA4[int, int] +d4: TA4[int, int, int] diff --git a/packages/pyright-internal/src/tests/samples/typeAlias18.py b/packages/pyright-internal/src/tests/samples/typeAlias18.py new file mode 100644 index 000000000..34898b411 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/typeAlias18.py @@ -0,0 +1,45 @@ +# This sample tests the case where a type alias is used in a class +# declaration. We want to ensure that the variance of type variables +# is compatible with the usage within the type alias. + +from typing import Callable, Generic, TypeVar, TypeAlias + +T1 = TypeVar("T1") +T2 = TypeVar("T2", covariant=True) +T3 = TypeVar("T3", contravariant=True) + + +class A(Generic[T1]): + pass + + +A_Alias_1: TypeAlias = A[T2] + +A_Alias_2: TypeAlias = A_Alias_1[T2 | int] + + +# This should generate an error because the variance is incompatible. +class A_1(A_Alias_1[T2]): + ... + + +# This should generate an error because the variance is incompatible. +class A_2(A_Alias_2[T2]): + ... + + +# This should generate an error because the variance is incompatible. +class A_3(A[T2]): + ... + + +class B(Generic[T1, T2]): + pass + + +B_Alias_1 = B[T2, T3] + + +# This should generate an error because the variance is incompatible. +class C(B_Alias_1[T3, T2]): + ... diff --git a/packages/pyright-internal/src/tests/samples/typeAlias19.py b/packages/pyright-internal/src/tests/samples/typeAlias19.py new file mode 100644 index 000000000..2547b43f0 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/typeAlias19.py @@ -0,0 +1,4 @@ +# This sample is used to test that TypeAlias can be aliased +# and re-exported. It is used with typeAlias20.py. + +from typing import TypeAlias as TA diff --git a/packages/pyright-internal/src/tests/samples/typeAlias20.py b/packages/pyright-internal/src/tests/samples/typeAlias20.py new file mode 100644 index 000000000..5b17d7786 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/typeAlias20.py @@ -0,0 +1,10 @@ +# This sample is used to test that TypeAlias can be aliased +# and re-exported. It is used with typeAlias19.py. + +from .typeAlias19 import TA as TA2 + +TA3 = TA2 + +x: TA2 = dict[str, str] + +y: x = {"": ""} diff --git a/packages/pyright-internal/src/tests/samples/typeAlias4.py b/packages/pyright-internal/src/tests/samples/typeAlias4.py index 8189ca8a7..8873432b4 100644 --- a/packages/pyright-internal/src/tests/samples/typeAlias4.py +++ b/packages/pyright-internal/src/tests/samples/typeAlias4.py @@ -1,7 +1,8 @@ # This sample tests the handling of the Python 3.9 # TypeAlias feature as documented in PEP 613. -from typing import Type, TypeAlias as TA, Union +import sys +from typing import Type, TypeAlias as TA, Union, cast type1: TA = Union[int, str] @@ -29,7 +30,9 @@ def requires_string(a: str): # is later declared as a TypeAlias. my_type3 = int -my_type3: TA = Union[int, str] +# This should generate an error because it is obscured +# by another type alias declaration. +my_type3: "TA" = Union[int, str] # This should generate an error because the symbol # was previously declared as a TypeAlias. @@ -53,9 +56,10 @@ def requires_string(a: str): ExplicitAlias: TA = int SimpleNonAlias: Type[int] = int -reveal_type(SimpleAlias, expected_text="Type[int]") -reveal_type(ExplicitAlias, expected_text="Type[int]") -reveal_type(SimpleNonAlias, expected_text="Type[int]") +if sys.version_info > (3, 9): + reveal_type(SimpleAlias, expected_text="Type[int]") + reveal_type(ExplicitAlias, expected_text="Type[int]") + reveal_type(SimpleNonAlias, expected_text="Type[int]") class ClassB: @@ -66,3 +70,9 @@ def func1(): # This should generate an error because type aliases are allowed # only in classes or modules. my_type1: TA = int + + +_Obj = cast(type[object], object) +# This should generate an error because _Obj is a variable, +# which isn't allowed in a TypeAlias statement. +Obj: TA = _Obj diff --git a/packages/pyright-internal/src/tests/samples/typeAlias5.py b/packages/pyright-internal/src/tests/samples/typeAlias5.py index 6f926d98f..614b0fb12 100644 --- a/packages/pyright-internal/src/tests/samples/typeAlias5.py +++ b/packages/pyright-internal/src/tests/samples/typeAlias5.py @@ -11,6 +11,8 @@ MyUnion2 = Union[float, datetime] +# This should generate an error because two type arguements are +# expected, but only one was provided. MyUnion3 = MyUnion1[MyUnion2] MyUnion4 = MyUnion1[MyUnion2, IO] diff --git a/packages/pyright-internal/src/tests/samples/typeAlias6.py b/packages/pyright-internal/src/tests/samples/typeAlias6.py index dd3bb3126..723011067 100644 --- a/packages/pyright-internal/src/tests/samples/typeAlias6.py +++ b/packages/pyright-internal/src/tests/samples/typeAlias6.py @@ -35,12 +35,6 @@ T_TypeVar() -T_Tuple1 = Tuple[int, ...] - -# This should generate an error -T_Tuple1([3, 4]) - - I = int I(3) diff --git a/packages/pyright-internal/src/tests/samples/typeAlias9.py b/packages/pyright-internal/src/tests/samples/typeAlias9.py index f465da2e8..8e55f178f 100644 --- a/packages/pyright-internal/src/tests/samples/typeAlias9.py +++ b/packages/pyright-internal/src/tests/samples/typeAlias9.py @@ -30,6 +30,6 @@ def foo2(f: Bar) -> None: Baz = Dict[K, V] -# This should generate an error because Baz is only partially specialized. +# This should generate two errors because Baz is only partially specialized. def foo3(f: Baz[int]) -> None: pass diff --git a/packages/pyright-internal/src/tests/samples/typeAliasStatement1.py b/packages/pyright-internal/src/tests/samples/typeAliasStatement1.py index abf24a11e..72cdfa1ad 100644 --- a/packages/pyright-internal/src/tests/samples/typeAliasStatement1.py +++ b/packages/pyright-internal/src/tests/samples/typeAliasStatement1.py @@ -1,4 +1,5 @@ -# This sample tests error cases associated with the "type" statement. +# This sample tests error cases associated with the "type" statement +# introduced in PEP 695. from typing import Callable @@ -12,7 +13,6 @@ class ClassA[T2]: type TA4 = int - # This should generate an error because T2 is in use. T2 = 4 @@ -34,3 +34,15 @@ class ClassA[T2]: else: type TA7 = int + +def func1() -> type[int]: + ... + +# This should generate an error because a call expression is not +# allowed in a type alias definition. +type TA8 = func1() + +# This should generate an error because a tuple and index expression is not +# allowed in a type alias definition. +type TA9 = (int, str, str)[0] + diff --git a/packages/pyright-internal/src/tests/samples/typeAliasStatement2.py b/packages/pyright-internal/src/tests/samples/typeAliasStatement2.py index 107f4f422..eb0e2c01d 100644 --- a/packages/pyright-internal/src/tests/samples/typeAliasStatement2.py +++ b/packages/pyright-internal/src/tests/samples/typeAliasStatement2.py @@ -1,4 +1,5 @@ -# This sample tests that "type" statements are illegal prior to Python 3.12. +# This sample tests that "type" statements (introduced in PEP 695) +# are illegal prior to Python 3.12. # This should generate an error if less than Python 3.12. type TA1[T1] = int diff --git a/packages/pyright-internal/src/tests/samples/typeAliasStatement3.py b/packages/pyright-internal/src/tests/samples/typeAliasStatement3.py index f99d5801c..bb6b1f4e2 100644 --- a/packages/pyright-internal/src/tests/samples/typeAliasStatement3.py +++ b/packages/pyright-internal/src/tests/samples/typeAliasStatement3.py @@ -1,5 +1,5 @@ # This sample tests the error case where traditional type variables -# are used in a new-style type alias statement. +# are used in a new-style type alias statement introduced in PEP 695. from typing import TypeVar diff --git a/packages/pyright-internal/src/tests/samples/typeAliasStatement4.py b/packages/pyright-internal/src/tests/samples/typeAliasStatement4.py index 0913a2e3c..1a8f9b1a3 100644 --- a/packages/pyright-internal/src/tests/samples/typeAliasStatement4.py +++ b/packages/pyright-internal/src/tests/samples/typeAliasStatement4.py @@ -1,4 +1,5 @@ -# This sample tests the use of recursive (self-referencing) type aliases. +# This sample tests the use of recursive (self-referencing) type aliases, +# which are allowed in PEP 695. from typing import Callable diff --git a/packages/pyright-internal/src/tests/samples/typeGuard1.py b/packages/pyright-internal/src/tests/samples/typeGuard1.py index 08f155329..0143e2748 100644 --- a/packages/pyright-internal/src/tests/samples/typeGuard1.py +++ b/packages/pyright-internal/src/tests/samples/typeGuard1.py @@ -66,3 +66,38 @@ def bad5(a: int) -> TypeGuard[int]: # This should generate an error because only # bool values can be returned. return 3 + + +# This should generate an error because a type guard function must +# accept at least one parameter. +def bad6() -> TypeGuard[int]: + return True + + +class ClassA: + # This should generate an error because a type guard function must + # accept at least one parameter. + def method1(self) -> TypeGuard[int]: + return True + + +class IsInt: + def __call__(self, value: Any) -> TypeGuard[int]: + return isinstance(value, int) + + +def func3(x: Any): + i = IsInt() + if i(x): + reveal_type(x, expected_text="int") + + +def is_int(obj: type) -> TypeGuard[type[int]]: + ... + + +def func4(typ: type[_T]) -> _T: + if not is_int(typ): + raise Exception("Unsupported type") + + return typ() diff --git a/packages/pyright-internal/src/tests/samples/typeNarrowing1.py b/packages/pyright-internal/src/tests/samples/typeNarrowing1.py index d212108af..1d9c3ac92 100644 --- a/packages/pyright-internal/src/tests/samples/typeNarrowing1.py +++ b/packages/pyright-internal/src/tests/samples/typeNarrowing1.py @@ -3,6 +3,8 @@ # pyright: reportOptionalMemberAccess=false +from random import random + class Foo: def bar(self): @@ -54,3 +56,13 @@ def bar(self): a.bar() # This should be flagged as an error b.bar() + + +def func1(a: str, b: str | bool) -> bool: + x: str | bool = a and a in [] + reveal_type(x, expected_text="bool | Literal['']") + + if random() > 0.5: + return (a and a in [""]) or True + else: + return x or True diff --git a/packages/pyright-internal/src/tests/samples/typeNarrowing5.py b/packages/pyright-internal/src/tests/samples/typeNarrowing5.py index da7e65a0f..d4ecc8ab4 100644 --- a/packages/pyright-internal/src/tests/samples/typeNarrowing5.py +++ b/packages/pyright-internal/src/tests/samples/typeNarrowing5.py @@ -2,7 +2,7 @@ # where the source contains Unknown or Any type # arguments. -from typing import Any, Dict +from typing import Any, Dict, Generic, TypeVar def func1(struct: Dict[Any, Any]): @@ -17,3 +17,15 @@ def func2(struct: Any): if isinstance(struct, Dict): a2: Dict[str, Any] = struct reveal_type(a2, expected_text="Dict[str, Any]") + + +T = TypeVar("T") +class A(Generic[T]): ... + +def func3(val: A[Any]): + x: A[int] = val + reveal_type(x, expected_text="A[int]") + +def func4(val: A[list[Any]]): + x: A[list[int]] = val + reveal_type(x, expected_text="A[list[int]]") diff --git a/packages/pyright-internal/src/tests/samples/typeNarrowingFalsy1.py b/packages/pyright-internal/src/tests/samples/typeNarrowingFalsy1.py index ca917c3a1..b5f8219cb 100644 --- a/packages/pyright-internal/src/tests/samples/typeNarrowingFalsy1.py +++ b/packages/pyright-internal/src/tests/samples/typeNarrowingFalsy1.py @@ -1,6 +1,6 @@ -# This sample tests type narrowing for falsy and truthy values. +# This sample tests type narrowing for falsey and truthy values. -from typing import Iterable, List, Literal, Optional, Union +from typing import AnyStr, Iterable, List, Literal, NamedTuple, Optional, Union class A: @@ -26,14 +26,14 @@ def func1(x: Union[int, List[int], A, B, C, D, None]) -> None: if x: reveal_type(x, expected_text="int | List[int] | A | B | D") else: - reveal_type(x, expected_text="int | List[int] | B | C | None") + reveal_type(x, expected_text="List[int] | B | C | Literal[0] | None") def func2(maybe_int: Optional[int]): if bool(maybe_int): reveal_type(maybe_int, expected_text="int") else: - reveal_type(maybe_int, expected_text="int | None") + reveal_type(maybe_int, expected_text="Literal[0] | None") def func3(maybe_a: Optional[A]): @@ -48,3 +48,68 @@ def func4(foo: Iterable[int]) -> None: reveal_type(foo, expected_text="Iterable[int]") else: reveal_type(foo, expected_text="Iterable[int]") + + +def func5(foo: tuple[int]) -> None: + if foo: + reveal_type(foo, expected_text="tuple[int]") + else: + reveal_type(foo, expected_text="Never") + + +def func6(foo: tuple[int, ...]) -> None: + if foo: + reveal_type(foo, expected_text="tuple[int, ...]") + else: + reveal_type(foo, expected_text="tuple[int, ...]") + + +def func7(foo: tuple[()]) -> None: + if foo: + reveal_type(foo, expected_text="Never") + else: + reveal_type(foo, expected_text="tuple[()]") + + +class NT1(NamedTuple): + foo: int + + +def func8(foo: NT1) -> None: + if foo: + reveal_type(foo, expected_text="NT1") + else: + reveal_type(foo, expected_text="Never") + + +class NT2(NT1): + pass + + +def func9(foo: NT2) -> None: + if foo: + reveal_type(foo, expected_text="NT2") + else: + reveal_type(foo, expected_text="Never") + + +class E: + def __init__(self, value: int = 0) -> None: + self.value = value + + def __bool__(self) -> bool: + return self.value >= 0 + + def method(self) -> None: + while not self: + reveal_type(self, expected_text="Self@E") + self.value += 1 + + +def func10(val: Optional[AnyStr]): + return 1 + + +def func11(val: Optional[AnyStr]): + assert val + reveal_type(val, expected_text="AnyStr@func11") diff --git a/packages/pyright-internal/src/tests/samples/typeNarrowingIn1.py b/packages/pyright-internal/src/tests/samples/typeNarrowingIn1.py index aed53e928..4b768e8cd 100644 --- a/packages/pyright-internal/src/tests/samples/typeNarrowingIn1.py +++ b/packages/pyright-internal/src/tests/samples/typeNarrowingIn1.py @@ -68,7 +68,7 @@ def func2(a: Literal[1, 2, 3]): if a in x: reveal_type(a, expected_text="Literal[1, 2]") else: - reveal_type(a, expected_text="Literal[1, 2, 3]") + reveal_type(a, expected_text="Literal[3]") def func3(val: str | None, container: frozenset[str]): @@ -115,3 +115,26 @@ def func7(x: object | bytes, y: str, z: int): def func8(x: object): if x in ("a", "b", 2, None): reveal_type(x, expected_text="Literal['a', 'b', 2] | None") + + +def func9(x: Literal["A", "B", "C", None, True]): + if x in (None, "B", True): + reveal_type(x, expected_text="Literal['B', True] | None") + else: + reveal_type(x, expected_text="Literal['A', 'C']") + if x not in ("A", "C"): + reveal_type(x, expected_text="Never") + else: + reveal_type(x, expected_text="Literal['A', 'C']") + + if x in ("A", "B"): + reveal_type(x, expected_text="Literal['B', 'A']") + else: + reveal_type(x, expected_text="Literal[True, 'C'] | None") + + +def func10(x: Literal["A", "B"], y: tuple[Literal["A"], ...]): + if x in y: + reveal_type(x, expected_text="Literal['A']") + else: + reveal_type(x, expected_text="Literal['A', 'B']") diff --git a/packages/pyright-internal/src/tests/samples/typeNarrowingIn2.py b/packages/pyright-internal/src/tests/samples/typeNarrowingIn2.py new file mode 100644 index 000000000..8eb43e1a3 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/typeNarrowingIn2.py @@ -0,0 +1,25 @@ +# This sample tests type narrowing for Enums using the "in" operator. + +import enum + + +class MyEnum(enum.Enum): + A = enum.auto() + B = enum.auto() + C = enum.auto() + + +def func0(x: MyEnum): + if x is MyEnum.C: + return + elif x in (MyEnum.A, MyEnum.B): + reveal_type(x, expected_text="Literal[MyEnum.A, MyEnum.B]") + else: + reveal_type(x, expected_text="Never") + + +def func1(x: MyEnum): + if x in (MyEnum.A, MyEnum.B): + reveal_type(x, expected_text="Literal[MyEnum.A, MyEnum.B]") + else: + reveal_type(x, expected_text="Literal[MyEnum.C]") diff --git a/packages/pyright-internal/src/tests/samples/typeNarrowingIsEllipsis1.py b/packages/pyright-internal/src/tests/samples/typeNarrowingIsEllipsis1.py new file mode 100644 index 000000000..51b58c38e --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/typeNarrowingIsEllipsis1.py @@ -0,0 +1,37 @@ +# This sample tests the type analyzer's type narrowing logic for +# conditions of the form "X is ...", "X is not ...", +# "X == .." and "X != ...". + +import types +from typing import TypeVar + + +_T = TypeVar("_T", str, ellipsis) + + +def func1(val: int | ellipsis): + if val is not ...: + reveal_type(val, expected_text="int") + else: + reveal_type(val, expected_text="ellipsis") + + +def func2(val: _T): + if val is ...: + reveal_type(val, expected_text="ellipsis*") + else: + reveal_type(val, expected_text="str*") + + +def func3(val: int | types.EllipsisType): + if val != ...: + reveal_type(val, expected_text="int") + else: + reveal_type(val, expected_text="ellipsis") + + +def func4(val: int | ellipsis): + if not val == ...: + reveal_type(val, expected_text="int") + else: + reveal_type(val, expected_text="ellipsis") diff --git a/packages/pyright-internal/src/tests/samples/typeNarrowingIsinstance1.py b/packages/pyright-internal/src/tests/samples/typeNarrowingIsinstance1.py index 851121cbf..133cd2537 100644 --- a/packages/pyright-internal/src/tests/samples/typeNarrowingIsinstance1.py +++ b/packages/pyright-internal/src/tests/samples/typeNarrowingIsinstance1.py @@ -1,5 +1,6 @@ # This sample exercises the type analyzer's isinstance type narrowing logic. +from types import NoneType from typing import List, Optional, Sized, Type, TypeVar, Union, Any @@ -160,3 +161,10 @@ def func8(a: int | list[int] | dict[str, int] | None): reveal_type(a, expected_text="int | list[int] | None") else: reveal_type(a, expected_text="dict[str, int]") + + +def func9(a: int | None): + if not isinstance(a, NoneType): + reveal_type(a, expected_text="int") + else: + reveal_type(a, expected_text="None") diff --git a/packages/pyright-internal/src/tests/samples/typeNarrowingIsinstance11.py b/packages/pyright-internal/src/tests/samples/typeNarrowingIsinstance11.py new file mode 100644 index 000000000..1b0f6fb21 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/typeNarrowingIsinstance11.py @@ -0,0 +1,17 @@ +# This sample tests the case where the class type passed as the second +# argument to isinstance is incomplete the first time the type guard +# is evaluated because it's in an loop. + +class X: + pass + + +class Y: + p: type + + +def f(xs: list[X | Y]) -> None: + for x in xs: + if not isinstance(x, X): + if x.p == X: + pass diff --git a/packages/pyright-internal/src/tests/samples/typeNarrowingIsinstance12.py b/packages/pyright-internal/src/tests/samples/typeNarrowingIsinstance12.py new file mode 100644 index 000000000..4717206af --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/typeNarrowingIsinstance12.py @@ -0,0 +1,46 @@ +# This sample tests the case where a symbol with type `|Any` +# is narrowed using an `isinstance` type guard. + +from typing import Any + + +def func1(val: Any): + if isinstance(val, str): + reveal_type(val, expected_text="str") + else: + reveal_type(val, expected_text="Any") + + +def func2(val: str): + if isinstance(val, str): + reveal_type(val, expected_text="str") + else: + reveal_type(val, expected_text="Never") + + +def func3(val: str | int): + if isinstance(val, str): + reveal_type(val, expected_text="str") + else: + reveal_type(val, expected_text="int") + + +def func4(val: str | Any): + if isinstance(val, str): + reveal_type(val, expected_text="str") + else: + reveal_type(val, expected_text="Any") + + +def func5(val: str | int | Any): + if isinstance(val, str): + reveal_type(val, expected_text="str") + else: + reveal_type(val, expected_text="int | Any") + + +def func6(val: list[str] | Any): + if isinstance(val, list): + reveal_type(val, expected_text="list[str]") + else: + reveal_type(val, expected_text="Any") diff --git a/packages/pyright-internal/src/tests/samples/typeNarrowingLiteral1.py b/packages/pyright-internal/src/tests/samples/typeNarrowingLiteral1.py index 50e488440..e927d022b 100644 --- a/packages/pyright-internal/src/tests/samples/typeNarrowingLiteral1.py +++ b/packages/pyright-internal/src/tests/samples/typeNarrowingLiteral1.py @@ -17,14 +17,9 @@ def func_1(p1: Literal["a", "b", "c"]): else: reveal_type(p1, expected_text="Literal['a']") - if "a" != p1: - reveal_type(p1, expected_text="Literal['c', 'b']") - else: - reveal_type(p1, expected_text="Literal['a']") - def func2(p1: Literal[1, 4, 7]): - if 4 == p1 or 1 == p1: + if p1 == 4 or p1 == 1: reveal_type(p1, expected_text="Literal[4, 1]") else: reveal_type(p1, expected_text="Literal[7]") diff --git a/packages/pyright-internal/src/tests/samples/typeNarrowingLiteralMember1.py b/packages/pyright-internal/src/tests/samples/typeNarrowingLiteralMember1.py index 5fad8ad71..57ee43290 100644 --- a/packages/pyright-internal/src/tests/samples/typeNarrowingLiteralMember1.py +++ b/packages/pyright-internal/src/tests/samples/typeNarrowingLiteralMember1.py @@ -138,3 +138,20 @@ def test(x: E | F) -> None: else: reveal_type(x, expected_type="E") +class G: + type: Literal[0] + +class H: + type: Literal[1] + +class I: + thing: G | H + + def method1(self) -> None: + if self.thing.type == 1: + reveal_type(self.thing, expected_text="H") + + local = self.thing + if local.type == 1: + reveal_type(local, expected_text="H") + diff --git a/packages/pyright-internal/src/tests/samples/typeNarrowingTuple1.py b/packages/pyright-internal/src/tests/samples/typeNarrowingTuple1.py index 7fdba94d8..243315a57 100644 --- a/packages/pyright-internal/src/tests/samples/typeNarrowingTuple1.py +++ b/packages/pyright-internal/src/tests/samples/typeNarrowingTuple1.py @@ -1,23 +1,69 @@ # This sample tests the type narrowing for known-length tuples # that have an entry with a declared literal type. -from typing import Tuple, Union, Literal +from enum import Enum +from typing import Literal -MsgA = Tuple[Literal[1], str] -MsgB = Tuple[Literal[2], float] +MsgA = tuple[Literal[1], str] +MsgB = tuple[Literal[2], float] -Msg = Union[MsgA, MsgB] +MsgAOrB = MsgA | MsgB -def func1(m: Msg): +def func1(m: MsgAOrB): if m[0] == 1: - reveal_type(m, expected_text="Tuple[Literal[1], str]") + reveal_type(m, expected_text="tuple[Literal[1], str]") else: - reveal_type(m, expected_text="Tuple[Literal[2], float]") + reveal_type(m, expected_text="tuple[Literal[2], float]") -def func2(m: Msg): +def func2(m: MsgAOrB): if m[0] != 1: - reveal_type(m, expected_text="Tuple[Literal[2], float]") + reveal_type(m, expected_text="tuple[Literal[2], float]") else: - reveal_type(m, expected_text="Tuple[Literal[1], str]") + reveal_type(m, expected_text="tuple[Literal[1], str]") + + +MsgC = tuple[Literal[True], str] +MsgD = tuple[Literal[False], float] + +MsgCOrD = MsgC | MsgD + + +def func3(m: MsgCOrD): + if m[0] is True: + reveal_type(m, expected_text="tuple[Literal[True], str]") + else: + reveal_type(m, expected_text="tuple[Literal[False], float]") + + +def func4(m: MsgCOrD): + if m[0] is not True: + reveal_type(m, expected_text="tuple[Literal[False], float]") + else: + reveal_type(m, expected_text="tuple[Literal[True], str]") + + +class MyEnum(Enum): + A = 0 + B = 1 + + +MsgE = tuple[Literal[MyEnum.A], str] +MsgF = tuple[Literal[MyEnum.B], float] + +MsgEOrF = MsgE | MsgF + + +def func5(m: MsgEOrF): + if m[0] is MyEnum.A: + reveal_type(m, expected_text="tuple[Literal[MyEnum.A], str]") + else: + reveal_type(m, expected_text="tuple[Literal[MyEnum.B], float]") + + +def func6(m: MsgEOrF): + if m[0] is not MyEnum.A: + reveal_type(m, expected_text="tuple[Literal[MyEnum.B], float]") + else: + reveal_type(m, expected_text="tuple[Literal[MyEnum.A], str]") diff --git a/packages/pyright-internal/src/tests/samples/typeNarrowingTypeEquals1.py b/packages/pyright-internal/src/tests/samples/typeNarrowingTypeEquals1.py new file mode 100644 index 000000000..804d681a4 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/typeNarrowingTypeEquals1.py @@ -0,0 +1,110 @@ +# This sample exercises the type analyzer's type narrowing +# logic for tests of the form "type(X) == Y" or "type(X) != Y". + +from typing import Any, Dict, Generic, Optional, TypeVar, Union, final + + +def func1(a: Union[str, int]) -> int: + + if type(a) != str: + # This should generate an error because + # "a" is potentially a subclass of str. + return a + + # This should generate an error because + # "a" is provably type str at this point. + return a + + +def func2(a: Optional[str]) -> str: + + if type(a) == str: + return a + + # This should generate an error because + # "a" is provably type str at this point. + return a + + +def func3(a: Dict[str, Any]) -> str: + val = a.get("hello") + if type(val) == str: + return val + + return "none" + + +class A: + pass + + +class B(A): + pass + + +def func4(a: Union[str, A]): + if type(a) == B: + reveal_type(a, expected_text="B") + else: + reveal_type(a, expected_text="str | A") + + +T = TypeVar("T") + + +class C(Generic[T]): + def __init__(self, a: T): + self.a = a + + +class D: + pass + + +E = Union[C[T], D] + + +def func5(x: E[T]) -> None: + if type(x) == C: + reveal_type(x, expected_text="C[T@func5]") + + +@final +class AFinal: + pass + + +@final +class BFinal: + pass + + +def func6(val: Union[AFinal, BFinal]) -> None: + if type(val) == AFinal: + reveal_type(val, expected_text="AFinal") + else: + reveal_type(val, expected_text="BFinal") + + +def func7(val: Any): + if type(val) == int: + reveal_type(val, expected_text="int") + else: + reveal_type(val, expected_text="Any") + + reveal_type(val, expected_text="int | Any") + +class CParent: + ... + +class CChild(CParent): + ... + +_TC = TypeVar("_TC", bound=CParent) + +def func8(a: _TC, b: _TC) -> _TC: + if type(a) == CChild: + reveal_type(a, expected_text="CChild*") + return a + reveal_type(a, expected_text="CParent*") + return a diff --git a/packages/pyright-internal/src/tests/samples/typeNarrowingTypeIs1.py b/packages/pyright-internal/src/tests/samples/typeNarrowingTypeIs1.py index 1f37d1b5b..b3e46a295 100644 --- a/packages/pyright-internal/src/tests/samples/typeNarrowingTypeIs1.py +++ b/packages/pyright-internal/src/tests/samples/typeNarrowingTypeIs1.py @@ -93,3 +93,18 @@ def func7(val: Any): reveal_type(val, expected_text="Any") reveal_type(val, expected_text="int | Any") + +class CParent: + ... + +class CChild(CParent): + ... + +_TC = TypeVar("_TC", bound=CParent) + +def func8(a: _TC, b: _TC) -> _TC: + if type(a) is CChild: + reveal_type(a, expected_text="CChild*") + return a + reveal_type(a, expected_text="CParent*") + return a diff --git a/packages/pyright-internal/src/tests/samples/typeNarrowingTypedDict1.py b/packages/pyright-internal/src/tests/samples/typeNarrowingTypedDict1.py index a5563bd57..62bb47449 100644 --- a/packages/pyright-internal/src/tests/samples/typeNarrowingTypedDict1.py +++ b/packages/pyright-internal/src/tests/samples/typeNarrowingTypedDict1.py @@ -80,7 +80,7 @@ def f6(p: Union[TD1, TD2, TD3]): reveal_type(v5, expected_text="str") # This should generate three errors, two for TD1 and TD2 (because - # "d" is not a valid key) and one for TD3 (beacuse "d" is not required). + # "d" is not a valid key) and one for TD3 (because "d" is not required). v6 = p["d"] diff --git a/packages/pyright-internal/src/tests/samples/typeNarrowingTypedDict2.py b/packages/pyright-internal/src/tests/samples/typeNarrowingTypedDict2.py index abed423c4..c3dc9f9ba 100644 --- a/packages/pyright-internal/src/tests/samples/typeNarrowingTypedDict2.py +++ b/packages/pyright-internal/src/tests/samples/typeNarrowingTypedDict2.py @@ -23,7 +23,7 @@ class OtherEvent(TypedDict): Event = Union[NewJobEvent, CancelJobEvent, OtherEvent] -def process_event(event: Event) -> None: +def process_event1(event: Event) -> None: if event["tag"] == "new-job": reveal_type(event, expected_text="NewJobEvent") event["job_name"] @@ -33,3 +33,25 @@ def process_event(event: Event) -> None: else: reveal_type(event, expected_text="OtherEvent") event["message"] + + +def process_event2(event: Event) -> None: + if event["tag"] is "new-job": + reveal_type(event, expected_text="NewJobEvent") + event["job_name"] + elif event["tag"] is 2: + reveal_type(event, expected_text="CancelJobEvent") + event["job_id"] + else: + reveal_type(event, expected_text="OtherEvent") + event["message"] + + +class ClassA: + job_event: NewJobEvent | OtherEvent + + def method1(self): + if self.job_event["tag"] == "new-job": + reveal_type(self.job_event, expected_text="NewJobEvent") + else: + reveal_type(self.job_event, expected_text="OtherEvent") diff --git a/packages/pyright-internal/src/tests/samples/typeParams1.py b/packages/pyright-internal/src/tests/samples/typeParams1.py index 256142c20..f3327700b 100644 --- a/packages/pyright-internal/src/tests/samples/typeParams1.py +++ b/packages/pyright-internal/src/tests/samples/typeParams1.py @@ -1,6 +1,5 @@ -# This sample tests the type parameter syntax for generic classes and -# functions. In particular, it tests various error conditions involving -# name collisions. +# This sample tests the PEP 695 type parameter syntax for generic classes +# and functions. T1 = 0 @@ -29,7 +28,6 @@ class ClassC[T3, S1, T3]: def func3[T3, S1, T3](): ... -# This should generate an error because T4 is duplicated. def func4[T4](T4: int): ... @@ -52,12 +50,11 @@ def inner_func1[T7](): global T2 class ClassB[T2]: - # This should generate an error because T2 refers to a type param. global T2 class ClassC[T3]: - ... + T3 = 4 T3 = 4 diff --git a/packages/pyright-internal/src/tests/samples/typeParams2.py b/packages/pyright-internal/src/tests/samples/typeParams2.py index fedb5e1a1..1e404c126 100644 --- a/packages/pyright-internal/src/tests/samples/typeParams2.py +++ b/packages/pyright-internal/src/tests/samples/typeParams2.py @@ -1,4 +1,4 @@ -# This sample tests that the use of type parameter syntax for generic +# This sample tests that the use of PEP 695 type parameter syntax for generic # classes and functions is flagged as an error if the version of Python # is < 3.12. diff --git a/packages/pyright-internal/src/tests/samples/typeParams3.py b/packages/pyright-internal/src/tests/samples/typeParams3.py index e068453c7..920f2d886 100644 --- a/packages/pyright-internal/src/tests/samples/typeParams3.py +++ b/packages/pyright-internal/src/tests/samples/typeParams3.py @@ -1,5 +1,5 @@ -# This sample tests error conditions related to the use of type parameters -# outside of their valid scope. +# This sample tests error conditions related to the use of PEP 695 +# type parameters outside of their valid scope. class ClassA[S]: s: S diff --git a/packages/pyright-internal/src/tests/samples/typeParams4.py b/packages/pyright-internal/src/tests/samples/typeParams4.py index 429671288..00c270398 100644 --- a/packages/pyright-internal/src/tests/samples/typeParams4.py +++ b/packages/pyright-internal/src/tests/samples/typeParams4.py @@ -1,5 +1,5 @@ # This sample tests errors related to the use of a Generic -# or Protocol base class with type parameter syntax. +# or Protocol base class with PEP 695 type parameter syntax. from typing import Generic, Protocol diff --git a/packages/pyright-internal/src/tests/samples/typeParams5.py b/packages/pyright-internal/src/tests/samples/typeParams5.py index 1ca8a6223..f53e25f12 100644 --- a/packages/pyright-internal/src/tests/samples/typeParams5.py +++ b/packages/pyright-internal/src/tests/samples/typeParams5.py @@ -1,4 +1,4 @@ -# This sample tests the handling of type parameter syntax used for +# This sample tests the handling of PEP 695 type parameter syntax used for # bounded and constrained TypeVars, TypeVarTuples, and ParamSpecs. from typing import Any diff --git a/packages/pyright-internal/src/tests/samples/typeParams6.py b/packages/pyright-internal/src/tests/samples/typeParams6.py index 25538272e..7d187ea91 100644 --- a/packages/pyright-internal/src/tests/samples/typeParams6.py +++ b/packages/pyright-internal/src/tests/samples/typeParams6.py @@ -1,5 +1,5 @@ # This sample tests the interactions between traditional TypeVars and -# new type parameter syntax. +# PEP 695 type parameter syntax. from typing import Generic, TypeVar diff --git a/packages/pyright-internal/src/tests/samples/typeParams7.py b/packages/pyright-internal/src/tests/samples/typeParams7.py index 41af8a360..c449e426c 100644 --- a/packages/pyright-internal/src/tests/samples/typeParams7.py +++ b/packages/pyright-internal/src/tests/samples/typeParams7.py @@ -1,5 +1,5 @@ # This sample tests the handling of bound and constrained type parameters -# as specified in type parameter statements. +# as specified in PEP 695 type parameter statements. class ClassA[**P, R: str]: ... diff --git a/packages/pyright-internal/src/tests/samples/typeVar12.py b/packages/pyright-internal/src/tests/samples/typeVar12.py new file mode 100644 index 000000000..69699fe2f --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/typeVar12.py @@ -0,0 +1,51 @@ +# This sample tests the case where a function-scoped TypeVar or +# ParamSpec is used only within a function's return type and only within +# a single Callable within that return type. In such cases, the TypeVar or +# ParamSpec is rescoped to the Callable rather than the function. + +from typing import Callable, Generic, Optional, ParamSpec, TypeVar + +S = TypeVar('S') +T = TypeVar('T') +P = ParamSpec('P') + +CallableAlias1 = Callable[[T], T] +CallableAlias2 = Callable[[T], T] | T + +def func1() -> Callable[[T], T] | None: + # This should generate an error. + x: Optional[T] = None + +def func2() -> Callable[[T], T] | list[T] | None: + x: Optional[T] = None + +def func3() -> CallableAlias1[T] | None: + # This should generate an error. + x: Optional[T] = None + +def func4() -> CallableAlias2[T] | None: + x: Optional[T] = None + +def func5() -> Callable[[list[T]], set[T]] | None: + # This should generate an error. + x: Optional[T] = None + +def func6() -> Callable[[list[T]], set[T]] | Callable[[set[T]], set[T]] | None: + x: Optional[T] = None + +def func7() -> Callable[P, None] | None: + # This should generate two errors, once for each P reference. + def inner(*args: P.args, **kwargs: P.kwargs) -> None: + pass + return + + +class A(Generic[T]): + def method1(self) -> Callable[[T], T] | None: + x: Optional[T] = None + +class B(Generic[S]): + def method1(self) -> Callable[[T], T] | None: + # This should generate an error. + x: Optional[T] = None + diff --git a/packages/pyright-internal/src/tests/samples/typeVar3.py b/packages/pyright-internal/src/tests/samples/typeVar3.py index db516b6c5..9f69177c1 100644 --- a/packages/pyright-internal/src/tests/samples/typeVar3.py +++ b/packages/pyright-internal/src/tests/samples/typeVar3.py @@ -67,7 +67,7 @@ class InnerClass3(Generic[_T]): def foo() -> Callable[[T], T]: def inner(v: T) -> T: - reveal_type(v, expected_text="T@foo") + reveal_type(v, expected_text="T@inner") return v return inner diff --git a/packages/pyright-internal/src/tests/samples/typeVar9.py b/packages/pyright-internal/src/tests/samples/typeVar9.py index a8ca44e59..4cc2f8db8 100644 --- a/packages/pyright-internal/src/tests/samples/typeVar9.py +++ b/packages/pyright-internal/src/tests/samples/typeVar9.py @@ -4,7 +4,7 @@ # pyright: reportInvalidTypeVarUse=true -from typing import AnyStr, Callable, Dict, Generic, List, TypeVar +from typing import AnyStr, Callable, Dict, Generic, List, TypeVar, overload _T = TypeVar("_T") @@ -116,3 +116,31 @@ def __init__(self, *, mode: AnyStr = ...) -> None: class C(Generic[AnyStr]): def __init__(self, *, mode: AnyStr = "") -> None: ... + + +@overload +def f16(default: int = ...) -> list[int]: + ... + + +@overload +def f16(default: _T) -> list[_T]: + ... + + +def f16(default: _T = ...) -> list[int] | list[_T]: + ... + + +class ClassA(Generic[_T]): + # This should generate an error because _T can go unsolved. + def __init__(self, x: _T = ...) -> None: + ... + + +_T2 = TypeVar("_T2", default=int) + + +class ClassB(Generic[_T2]): + def __init__(self, x: _T2 = ...) -> None: + ... diff --git a/packages/pyright-internal/src/tests/samples/typeVarDefault1.py b/packages/pyright-internal/src/tests/samples/typeVarDefault1.py new file mode 100644 index 000000000..71d6c169a --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/typeVarDefault1.py @@ -0,0 +1,84 @@ +# This sample tests basic support for PEP 696 -- default types for TypeVars. + +from typing import Any, ParamSpec +from typing_extensions import TypeVar, TypeVarTuple, Unpack + +S1 = TypeVar("S1") +S2 = TypeVar("S2", bound=int) +S3 = TypeVar("S3", bytes, str) + +Ts0 = TypeVarTuple("Ts0") + +P0 = ParamSpec("P0") + + +T1 = TypeVar("T1", default=int) + +# This should generate an error because default must be a type expression. +T2 = TypeVar("T2", default=3) + +TInt = TypeVar("TInt", bound=int) +T3 = TypeVar("T3", bound=float, default=TInt) + +# This should generate an error because default must be a subtype of bound. +T4 = TypeVar("T4", bound=int, default=float) + +# This should generate an error because S1 is not a subtype of int. +T6 = TypeVar("T6", bound=int, default=S1) + +T7 = TypeVar("T7", bound=float, default=S2) + +# This should generate an error because S3 is not a subtype of int. +T8 = TypeVar("T8", bound=float, default=S3) + +T9 = TypeVar("T9", bound=list[Any], default=list[S1]) + +T10 = TypeVar("T10", bytes, str, default=str) + +# This should generate an error because str | bytes isn't one of the constrained types. +T11 = TypeVar("T11", bytes, str, default=str | bytes) + +# This should generate an error because S1 isn't one of the constrained types. +T12 = TypeVar("T12", bytes, str, default=S1) + + + +Ts1 = TypeVarTuple("Ts1", default=Unpack[tuple[int]]) + +# This should generate an error because default must be unpacked tuple. +Ts2 = TypeVarTuple("Ts2", default=tuple[int]) + +# This should generate an error because default must be unpacked tuple. +Ts3 = TypeVarTuple("Ts3", default=int) + +Ts4 = TypeVarTuple("Ts4", default=Unpack[Ts0]) + +# This should generate an error because default must be unpacked. +Ts5 = TypeVarTuple("Ts5", default=Ts0) + +Ts6 = TypeVarTuple("Ts6", default=Unpack[tuple[int, ...]]) + +Ts7 = TypeVarTuple("Ts7", default=Unpack[tuple[S1, S2]]) + + +P1 = ParamSpec("P1", default=[]) + +P2 = ParamSpec("P2", default=[int, str, None, int | None]) + +P3 = ParamSpec("P3", default=[int, S1]) + +P4 = ParamSpec("P4", default=[int]) + +P5 = ParamSpec("P5", default=...) + +# This should generate an error because ParamSpec must be a list of types. +P6 = ParamSpec("P6", default=int) + +# This should generate an error because ParamSpec must be a list of types. +P7 = ParamSpec("P7", default=3) + +# This should generate an error because ParamSpec must be a list of types. +P8 = ParamSpec("P8", default=(1, int)) + +P9 = ParamSpec("P9", default=P0) + diff --git a/packages/pyright-internal/src/tests/samples/typeVarDefault2.py b/packages/pyright-internal/src/tests/samples/typeVarDefault2.py new file mode 100644 index 000000000..607cc3f9a --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/typeVarDefault2.py @@ -0,0 +1,91 @@ +# This sample tests the PEP 695 type parameter syntax extensions introduced +# in PEP 696 (default types for TypeVarLike). + +from typing import Any, ParamSpec, TypeVar, Unpack +from typing_extensions import TypeVarTuple + +T1 = TypeVar("T1") +Ts1 = TypeVarTuple("Ts1") +P1 = ParamSpec("P1") + + +# This should generate an error because default must be a type expression. +class ClassT1[T = 3]: ... + +class ClassT2[T: float = int]: ... + +# This should generate an error because default must be a subtype of bound. +class ClassT3[T: int = float]: ... + +class ClassT4[T: list[Any] = list[int]]: ... + +class ClassT5[T: (bytes, str) = str]: ... + +# This should generate an error because str | bytes isn't one of the constrained types. +class ClassT6[T: (bytes, str) = str | bytes]: ... + +# This should generate an error because T1 is not a valid default. +class ClassT7[T = T1]: ... + +# This should generate an error because Ts1 is not a valid default. +class ClassT8[T = Ts1]: ... + +# This should generate an error because P1 is not a valid default. +class ClassT9[T = P1]: ... + + +class ClassTs1[*Ts = *tuple[int]]: ... + +class ClassTs2[*Ts = Unpack[tuple[int]]]: ... + +# This should generate an error because default must be unpacked tuple. +class ClassTs3[*Ts = tuple[int]]: ... + +# This should generate an error because default must be unpacked tuple. +class ClassTs4[*Ts = int]: ... + +# This should generate an error because default must be unpacked tuple. +class ClassTs5[*Ts = T1]: ... + +# This should generate an error because default must be unpacked tuple. +class ClassTs6[*Ts = Ts1]: ... + +# This should generate an error because default must be unpacked tuple. +class ClassTs7[*Ts = P1]: ... + +class ClassTs8[*Ts = Unpack[tuple[int, ...]]]: ... + +# This should generate an error because T1 isn't legal here. +class ClassTs9[*Ts = Unpack[tuple[T1, T1]]]: ... + +# This should generate an error because ... isn't legal here. +class ClassTs10[*Ts = ...]: ... + + +class ClassP1[**P = [int]]: ... + +class ClassP2[**P = ...]: ... + +class ClassP3[**P = []]: ... + +class ClassP4[**P = [int, str, None, int | None]]: ... + +# This should generate an error because T1 isn't legal here. +class ClassP5[**P = [T1]]: ... + +# This should generate an error because ParamSpec must be a list of types. +class ClassP6[**P = int]: ... + +# This should generate an error because ParamSpec must be a list of types. +class ClassP7[**P = 3]: ... + +# This should generate an error because ParamSpec must be a list of types. +class ClassP8[**P = [1, int]]: ... + +# This should generate an error because it combines a traditional ParamSpec +# with a new-style (PEP 695) ParamSpec. +class ClassP9[**P = P1]: ... + +# This should generate an error because ParamSpec must be a list of types. +class ClassP10[**P = Ts1]: ... + diff --git a/packages/pyright-internal/src/tests/samples/typeVarDefault3.py b/packages/pyright-internal/src/tests/samples/typeVarDefault3.py new file mode 100644 index 000000000..831cf6260 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/typeVarDefault3.py @@ -0,0 +1,26 @@ +# This sample tests error handling for PEP 696. TypeVars without default +# types cannot be after TypeVars with default types. + +from typing import Generic, TypeVar + + +T1 = TypeVar("T1") +T2 = TypeVar("T2", default=str) + +# This should generate an error because T1 is after T2. +class ClassA(Generic[T2, T1]): ... + +# This should generate an error because T1 is after T2. +class ClassB(dict[T2, T1]): ... + +class ClassC(dict[T2, T1], Generic[T1, T2]): ... + + +# This should generate an error because T1 is after T2. +def funcA(a: T2, b: T1) -> T1 | T2: + ... + +# This should generate an error because T1 is after T2. +TA_A = dict[T2, T1] + + diff --git a/packages/pyright-internal/src/tests/samples/typeVarDefault4.py b/packages/pyright-internal/src/tests/samples/typeVarDefault4.py new file mode 100644 index 000000000..18146b7d3 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/typeVarDefault4.py @@ -0,0 +1,17 @@ +# This sample tests error handling for PEP 696. TypeVars without default +# types cannot be after TypeVars with default types. This is the same as +# typeVarDefault3 except that it uses PEP 695 syntax. + +from typing import TypeVar + +# This should generate an error because T1 is after T2. +class ClassA[T2=str, T1]: ... + +# This should generate an error because T1 is after T2. +def funcA[T2=str, T1](a: T2, b: T1) -> T1 | T2: + ... + +# This should generate an error because T1 is after T2. +type TA_A[T2=str, T1] = dict[T2, T1] + + diff --git a/packages/pyright-internal/src/tests/samples/typeVarDefault5.py b/packages/pyright-internal/src/tests/samples/typeVarDefault5.py new file mode 100644 index 000000000..79b2ea6c4 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/typeVarDefault5.py @@ -0,0 +1,14 @@ +# This sample tests the handling of TypeVar defaults in classes +# with a constructor that defines an __init__ but no __new__. + +from dataclasses import dataclass + +class ClassA: ... + +@dataclass +class ClassB[T: ClassA = ClassA]: + owner: T + +def post_comment[T: ClassA](owner: T) -> ClassB[T]: + return ClassB(owner) + diff --git a/packages/pyright-internal/src/tests/samples/typeVarDefaultClass1.py b/packages/pyright-internal/src/tests/samples/typeVarDefaultClass1.py new file mode 100644 index 000000000..6e9594994 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/typeVarDefaultClass1.py @@ -0,0 +1,87 @@ +# This sample tests support for PEP 696 -- default types for TypeVars. +# In particular, it tests the handling of default TypeVar types for +# generic classes. + +from typing import Generic +from typing_extensions import TypeVar, ParamSpec, TypeVarTuple, Unpack + + +T1 = TypeVar("T1") +T2 = TypeVar("T2", default=int) +T3 = TypeVar("T3", default=str) + + +class ClassA1(Generic[T2, T3]): + ... + + +def func_a1(a: ClassA1, b: ClassA1[float], c: ClassA1[float, float]): + reveal_type(a, expected_text="ClassA1[int, str]") + reveal_type(b, expected_text="ClassA1[float, str]") + reveal_type(c, expected_text="ClassA1[float, float]") + + +class ClassA2(Generic[T1, T2, T3]): + ... + + +def func_a2( + a: ClassA2, + b: ClassA2[float], + c: ClassA2[float, float], + d: ClassA2[float, float, float], +): + reveal_type(a, expected_text="ClassA2[Unknown, int, str]") + reveal_type(b, expected_text="ClassA2[float, int, str]") + reveal_type(c, expected_text="ClassA2[float, float, str]") + reveal_type(d, expected_text="ClassA2[float, float, float]") + + +P1 = ParamSpec("P1") +P2 = ParamSpec("P2", default=[int, str]) +P3 = ParamSpec("P3", default=...) + + +class ClassB1(Generic[P2, P3]): + ... + + +def func_b1(a: ClassB1, b: ClassB1[[float]], c: ClassB1[[float], [float]]): + reveal_type(a, expected_text="ClassB1[(int, str), (...)]") + reveal_type(b, expected_text="ClassB1[(float), (...)]") + reveal_type(c, expected_text="ClassB1[(float), (float)]") + + +Ts1 = TypeVarTuple("Ts1") +Ts2 = TypeVarTuple("Ts2", default=Unpack[tuple[int, str]]) +Ts3 = TypeVarTuple("Ts3", default=Unpack[tuple[float, ...]]) +Ts4 = TypeVarTuple("Ts4", default=Unpack[tuple[()]]) + + +class ClassC1(Generic[*Ts2]): + ... + + +class ClassC2(Generic[T3, *Ts3]): + ... + + +class ClassC3(Generic[T3, *Ts4]): + ... + + +def func_c1(a: ClassC1, b: ClassC1[*tuple[float]]): + reveal_type(a, expected_text="ClassC1[int, str]") + reveal_type(b, expected_text="ClassC1[float]") + + +def func_c2(a: ClassC2, b: ClassC2[int], c: ClassC2[int, *tuple[()]]): + reveal_type(a, expected_text="ClassC2[str, *tuple[float, ...]]") + reveal_type(b, expected_text="ClassC2[int, *tuple[float, ...]]") + reveal_type(c, expected_text="ClassC2[int]") + + +def func_c3(a: ClassC3, b: ClassC3[int], c: ClassC3[int, *tuple[float]]): + reveal_type(a, expected_text="ClassC3[str]") + reveal_type(b, expected_text="ClassC3[int]") + reveal_type(c, expected_text="ClassC3[int, float]") diff --git a/packages/pyright-internal/src/tests/samples/typeVarDefaultClass2.py b/packages/pyright-internal/src/tests/samples/typeVarDefaultClass2.py new file mode 100644 index 000000000..483fe6773 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/typeVarDefaultClass2.py @@ -0,0 +1,196 @@ +# This sample tests the case where a TypeVar default refers to another +# TypeVar in a class declaration. This sample uses classic TypeVar syntax. +# If you make a change to this file, reflect the change in typeVarDefault7 +# which uses PEP 695 syntax. + +from typing import Generic, ParamSpec, TypeVar, TypeVarTuple, Unpack + + +T1 = TypeVar("T1", default=str) +T2 = TypeVar("T2", default=T1) +T3 = TypeVar("T3", default=list[T2]) +T4 = TypeVar("T4", default=dict[T1, T2]) +T5 = TypeVar("T5", default="T5") + + +class ClassA(dict[T1, T2]): + ... + + +a1 = ClassA[int]() +reveal_type(a1, expected_text="ClassA[int, int]") + +a2 = ClassA() +reveal_type(a2, expected_text="ClassA[str, str]") + + +# This should generate an error because T2 depends on T1. +class ClassC(Generic[T2, T1]): + ... + + +class ClassD(dict[T2, T1], Generic[T1, T2]): + ... + + +d1 = ClassD[int]() +reveal_type(d1, expected_text="ClassD[int, int]") + +d2 = ClassD() +reveal_type(d2, expected_text="ClassD[str, str]") + +# This should generate an error because T5 refers to itself. +class ClassE(Generic[T5]): + ... + + +class ClassH(Generic[T1, T2, T3]): + ... + + +h1 = ClassH() +reveal_type(h1, expected_text="ClassH[str, str, list[str]]") + +h2 = ClassH[int]() +reveal_type(h2, expected_text="ClassH[int, int, list[int]]") + +h3 = ClassH[int, float]() +reveal_type(h3, expected_text="ClassH[int, float, list[float]]") + +# This should generate an error because T2 depends on T1. +class ClassI(Generic[T2]): + ... + + +# This should generate an error because T4 depends on T2. +class ClassJ(Generic[T1, T4]): + ... + + +class ClassK(Generic[T1]): + # This should generate an error because T2 depends on T1, which + # is defined in an outer scope. + class ClassL(Generic[T2]): + ... + + +class ClassMChild1(Generic[T1]): + a: T1 + + +class ClassMChild2(Generic[T1]): + b: T1 + + +class ClassM(ClassMChild1[T1], ClassMChild2[T2]): + ... + + +m1 = ClassM[int]() +reveal_type(m1.a, expected_text="int") +reveal_type(m1.b, expected_text="int") + +m2 = ClassM() +reveal_type(m2.a, expected_text="str") +reveal_type(m2.b, expected_text="str") + + +class ClassNChild(Generic[T1]): + a: T1 + + +class ClassN(ClassNChild): + ... + + +n1 = ClassN() +reveal_type(n1.a, expected_text="str") + + +P1 = ParamSpec("P1", default=...) +P2 = ParamSpec("P2", default=P1) +P3 = ParamSpec("P3", default=P2) +P4 = ParamSpec("P4", default=[int, T1]) + + +class ClassPA(Generic[P1, P2, P3]): + ... + + +pa1 = ClassPA() +reveal_type(pa1, expected_text="ClassPA[(...), (...), (...)]") + +pa2 = ClassPA[[str]]() +reveal_type(pa2, expected_text="ClassPA[(str), (str), (str)]") + +pa3 = ClassPA[..., [float]]() +reveal_type(pa3, expected_text="ClassPA[(...), (float), (float)]") + +pa4 = ClassPA[..., [int, int], [float]]() +reveal_type(pa4, expected_text="ClassPA[(...), (int, int), (float)]") + + +# This should generate an error because P1 depends on P2. +class ClassPB(Generic[P2, P1]): + ... + + +class ClassPC(Generic[T1, P4]): + ... + + +pc1 = ClassPC() +reveal_type(pc1, expected_text="ClassPC[str, (int, str)]") + +pc2 = ClassPC[float]() +reveal_type(pc2, expected_text="ClassPC[float, (int, float)]") + +pc3 = ClassPC[float, ...]() +reveal_type(pc3, expected_text="ClassPC[float, (...)]") + + +# This should generate an error because P4 depends on T1. +class ClassPD(Generic[P4, T1]): + ... + + +Ts1 = TypeVarTuple("Ts1", default=Unpack[tuple[T1, T2]]) +Ts2 = TypeVarTuple("Ts2", default=Unpack[tuple[T1, ...]]) + + +class ClassTA(Generic[T1, T2, *Ts1]): + ... + + +ta1 = ClassTA() +reveal_type(ta1, expected_text="ClassTA[str, str, str, str]") + +ta2 = ClassTA[int]() +reveal_type(ta2, expected_text="ClassTA[int, int, int, int]") + +ta3 = ClassTA[int, float]() +reveal_type(ta3, expected_text="ClassTA[int, float, int, float]") + +ta4 = ClassTA[int, float, *tuple[None, ...]]() +reveal_type(ta4, expected_text="ClassTA[int, float, *tuple[None, ...]]") + +# This should generate an error because Ts1 depends on T2. +class ClassTB(Generic[T1, *Ts1, T2]): + ... + + +class ClassTC(Generic[T1, *Ts2]): + ... + + +tc1 = ClassTC() +reveal_type(tc1, expected_text="ClassTC[str, *tuple[str, ...]]") + +tc2 = ClassTC[int]() +reveal_type(tc2, expected_text="ClassTC[int, *tuple[int, ...]]") + +tc3 = ClassTC[int, *tuple[()]]() +reveal_type(tc3, expected_text="ClassTC[int]") + +tc4 = ClassTC[int, *tuple[None]]() +reveal_type(tc4, expected_text="ClassTC[int, None]") diff --git a/packages/pyright-internal/src/tests/samples/typeVarDefaultClass3.py b/packages/pyright-internal/src/tests/samples/typeVarDefaultClass3.py new file mode 100644 index 000000000..a4f2b9150 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/typeVarDefaultClass3.py @@ -0,0 +1,117 @@ +# This sample tests the case where a TypeVar default refers to another +# TypeVar in a class declaration. This sample uses PEP 695 syntax. + +from typing import Unpack + + +class ClassA[T1=str, T2=T1](dict[T1, T2]): ... + +a1 = ClassA[int]() +reveal_type(a1, expected_text="ClassA[int, int]") + +a2 = ClassA() +reveal_type(a2, expected_text="ClassA[str, str]") + + +# This should generate an error because T2 depends on T1. +class ClassC[T2=T1, T1=str]: ... + +class ClassD[T1=str, T2=T1](dict[T2, T1]): ... + +d1 = ClassD[int]() +reveal_type(d1, expected_text="ClassD[int, int]") + +d2 = ClassD() +reveal_type(d2, expected_text="ClassD[str, str]") + +# This should generate an error because T5 refers to itself. +class ClassE[T5=T5]: ... + +class ClassH[T1=str, T2=T1, T3=list[T2]]: ... + +h1 = ClassH() +reveal_type(h1, expected_text="ClassH[str, str, list[str]]") + +h2 = ClassH[int]() +reveal_type(h2, expected_text="ClassH[int, int, list[int]]") + +h3 = ClassH[int, float]() +reveal_type(h3, expected_text="ClassH[int, float, list[float]]") + +# This should generate an error because T2 depends on T1. +class ClassI[T2=T1]: ... + +# This should generate an error because T4 depends on T2. +class ClassJ[T1=str, T4=dict[T1, T2]]: ... + +class ClassK[T1=str]: + # This should generate an error because T2 depends on T1, which + # is defined in an outer scope. + class ClassL[T2=T1]: ... + + +class ClassPA[**P1, **P2=P1, **P3=P2]: ... + +pa1 = ClassPA() +reveal_type(pa1, expected_text="ClassPA[(...), (...), (...)]") + +pa2 = ClassPA[[str]]() +reveal_type(pa2, expected_text="ClassPA[(str), (str), (str)]") + +pa3 = ClassPA[..., [float]]() +reveal_type(pa3, expected_text="ClassPA[(...), (float), (float)]") + +pa4 = ClassPA[..., [int, int], [float]]() +reveal_type(pa4, expected_text="ClassPA[(...), (int, int), (float)]") + + +# This should generate an error because P1 depends on P2. +class ClassPB[**P2=P1, **P1=...]: ... + +class ClassPC[T1=str, **P4=[int, T1]]: ... + +pc1 = ClassPC() +reveal_type(pc1, expected_text="ClassPC[str, (int, str)]") + +pc2 = ClassPC[float]() +reveal_type(pc2, expected_text="ClassPC[float, (int, float)]") + +pc3 = ClassPC[float, ...]() +reveal_type(pc3, expected_text="ClassPC[float, (...)]") + + +# This should generate an error because P4 depends on T1. +class ClassPD[**P4=[int, T1], T1=str]: ... + + +class ClassTA[T1=str, T2=T1, *Ts1=Unpack[tuple[T1, T2]]]: ... + +ta1 = ClassTA() +reveal_type(ta1, expected_text="ClassTA[str, str, str, str]") + +ta2 = ClassTA[int]() +reveal_type(ta2, expected_text="ClassTA[int, int, int, int]") + +ta3 = ClassTA[int, float]() +reveal_type(ta3, expected_text="ClassTA[int, float, int, float]") + +ta4 = ClassTA[int, float, *tuple[None, ...]]() +reveal_type(ta4, expected_text="ClassTA[int, float, *tuple[None, ...]]") + +# This should generate an error because Ts1 depends on T2. +class ClassTB[T1=str, *Ts1=Unpack[tuple[T1, T2]], T2=T1]: ... + +class ClassTC[T1=str, *Ts2=Unpack[tuple[T1, ...]]]: ... + +tc1 = ClassTC() +reveal_type(tc1, expected_text="ClassTC[str, *tuple[str, ...]]") + +tc2 = ClassTC[int]() +reveal_type(tc2, expected_text="ClassTC[int, *tuple[int, ...]]") + +tc3 = ClassTC[int, *tuple[()]]() +reveal_type(tc3, expected_text="ClassTC[int]") + +tc4 = ClassTC[int, *tuple[None]]() +reveal_type(tc4, expected_text="ClassTC[int, None]") + diff --git a/packages/pyright-internal/src/tests/samples/typeVarDefaultFunction1.py b/packages/pyright-internal/src/tests/samples/typeVarDefaultFunction1.py new file mode 100644 index 000000000..0df3cb667 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/typeVarDefaultFunction1.py @@ -0,0 +1,56 @@ +# This sample tests support for PEP 696 -- default types for TypeVars. +# In particular, it tests the case where a TypeVarLike goes unsolved +# in a call, and a default value is used rather than Unknown. + +from typing import Callable, Generic, ParamSpec, TypeVar, TypeVarTuple, Unpack + +T = TypeVar("T", default=str) + + +def func1(x: int | T) -> list[T]: + ... + + +v1_1 = func1(3.4) +reveal_type(v1_1, expected_text="list[float]") + +v1_2 = func1(3) +reveal_type(v1_2, expected_text="list[str]") + + +P = ParamSpec("P", default=[int, str, str]) + + +class ClassA(Generic[P]): + def __init__(self, x: Callable[P, None]) -> None: + ... + + +def func2(x: int | ClassA[P]) -> ClassA[P]: + ... + + +def callback1(x: str) -> None: + ... + + +v2_1 = func2(ClassA(callback1)) +reveal_type(v2_1, expected_text="ClassA[(x: str)]") + + +v2_2 = func2(3) +reveal_type(v2_2, expected_text="ClassA[(int, str, str)]") + + +Ts = TypeVarTuple("Ts", default=Unpack[tuple[int, str, float]]) + + +def func3(x: int | Callable[[*Ts], None]) -> tuple[*Ts]: + ... + + +v3_1 = func3(callback1) +reveal_type(v3_1, expected_text="tuple[str]") + +v3_2 = func3(3) +reveal_type(v3_2, expected_text="tuple[int, str, float]") diff --git a/packages/pyright-internal/src/tests/samples/typeVarDefaultFunction2.py b/packages/pyright-internal/src/tests/samples/typeVarDefaultFunction2.py new file mode 100644 index 000000000..007b5eba1 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/typeVarDefaultFunction2.py @@ -0,0 +1,36 @@ +# This sample tests support for PEP 696 (default types for TypeVars) +# when used to define generic functions and with defaults type +# expressions that refer to other type variables. + +from typing import Generic, Self, TypeVar + +T1 = TypeVar("T1", default=str) +T2 = TypeVar("T2", default=list[T1]) + + +def func1(x: T1, y: int | T2 = 0) -> T2 | list[T1]: + ... + + +v1_1 = func1("hi", 3.4) +reveal_type(v1_1, expected_text="float | list[str]") + +v1_2 = func1("") +reveal_type(v1_2, expected_text="list[str]") + + +# This should generate an error because T1 depends on T2. +def func2(x: T2, y: T1) -> list[T1 | T2]: + ... + + +T3 = TypeVar("T3", default=int) + + +class ClassA(Generic[T3]): + def __init__(self, value: T3): + self.value = value + + def func1(self, value: T3) -> Self: + self.value = value + return self diff --git a/packages/pyright-internal/src/tests/samples/typeVarDefaultFunction3.py b/packages/pyright-internal/src/tests/samples/typeVarDefaultFunction3.py new file mode 100644 index 000000000..876134b19 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/typeVarDefaultFunction3.py @@ -0,0 +1,21 @@ +# This sample tests support for PEP 696 (default types for TypeVars) +# when used to define generic functions and with defaults type +# expressions that refer to other type variables. This is the same +# as typeVarDefaultFunction2 except that it uses the PEP 695 syntax. + +from typing import TypeVar + +def func1[T1, T2 = list[T1]](x: T1, y: int | T2 = 0) -> T2 | list[T1]: + ... + +v1_1 = func1("hi", 3.4) +reveal_type(v1_1, expected_text="float | list[str]") + +v1_2 = func1("") +reveal_type(v1_2, expected_text="list[str]") + + +# This should generate an error because T1 depends on T2. +def func2[T2=list[T1], T1=str]() -> None: + ... + diff --git a/packages/pyright-internal/src/tests/samples/typeVarDefaultTypeAlias1.py b/packages/pyright-internal/src/tests/samples/typeVarDefaultTypeAlias1.py new file mode 100644 index 000000000..86100b337 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/typeVarDefaultTypeAlias1.py @@ -0,0 +1,72 @@ +# This sample tests support for PEP 696 -- default types for TypeVars. +# In particular, it tests the handling of default TypeVar types for +# generic type aliases. + +from collections.abc import Callable +from typing import Any, TypeAlias +from typing_extensions import TypeVar, ParamSpec, TypeVarTuple, Unpack + + +T1 = TypeVar("T1") +T2 = TypeVar("T2", default=int) +T3 = TypeVar("T3", default=str) + +TA1: TypeAlias = dict[T2, T3] + + +def func_a1(a: TA1, b: TA1[float], c: TA1[float, float]): + reveal_type(a, expected_text="dict[int, str]") + reveal_type(b, expected_text="dict[float, str]") + reveal_type(c, expected_text="dict[float, float]") + + +TA2: TypeAlias = dict[T1, T2] | list[T3] + + +def func_a2(a: TA2, b: TA2[float], c: TA2[float, float], d: TA2[float, float, float]): + reveal_type(a, expected_text="dict[Unknown, int] | list[str]") + reveal_type(b, expected_text="dict[float, int] | list[str]") + reveal_type(c, expected_text="dict[float, float] | list[str]") + reveal_type(d, expected_text="dict[float, float] | list[float]") + + +P1 = ParamSpec("P1") +P2 = ParamSpec("P2", default=[int, str]) +P3 = ParamSpec("P3", default=...) + +TA3: TypeAlias = Callable[P2, Any] | Callable[P3, Any] + + +def func_b1(a: TA3, b: TA3[[float]], c: TA3[[float], [list[float]]]): + reveal_type(a, expected_text="((int, str) -> Any) | ((...) -> Any)") + reveal_type(b, expected_text="((float) -> Any) | ((...) -> Any)") + reveal_type(c, expected_text="((float) -> Any) | ((list[float]) -> Any)") + + +Ts1 = TypeVarTuple("Ts1") +Ts2 = TypeVarTuple("Ts2", default=Unpack[tuple[int, str]]) +Ts3 = TypeVarTuple("Ts3", default=Unpack[tuple[float, ...]]) +Ts4 = TypeVarTuple("Ts4", default=Unpack[tuple[()]]) + +TA4: TypeAlias = tuple[*Ts2] + +TA5: TypeAlias = tuple[T3, *Ts3] + +TA6: TypeAlias = tuple[T3, *Ts4] + + +def func_c1(a: TA4, b: TA4[*tuple[float]]): + reveal_type(a, expected_text="tuple[int, str]") + reveal_type(b, expected_text="tuple[float]") + + +def func_c2(a: TA5, b: TA5[int], c: TA5[int, *tuple[()]]): + reveal_type(a, expected_text="tuple[str, *tuple[float, ...]]") + reveal_type(b, expected_text="tuple[int, *tuple[float, ...]]") + reveal_type(c, expected_text="tuple[int]") + + +def func_c3(a: TA6, b: TA6[int], c: TA6[int, *tuple[float]]): + reveal_type(a, expected_text="tuple[str]") + reveal_type(b, expected_text="tuple[int]") + reveal_type(c, expected_text="tuple[int, float]") diff --git a/packages/pyright-internal/src/tests/samples/typeVarDefaultTypeAlias2.py b/packages/pyright-internal/src/tests/samples/typeVarDefaultTypeAlias2.py new file mode 100644 index 000000000..74b281034 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/typeVarDefaultTypeAlias2.py @@ -0,0 +1,133 @@ +# This sample tests support for PEP 696 (default types for TypeVars). +# In particular, it tests the handling of default TypeVar types for +# generic type aliases when one TypeVar default expression refers +# to another. + +from typing import Callable, Generic, ParamSpec, TypeVar, TypeVarTuple, Unpack + +T1 = TypeVar("T1", default=str) +T2 = TypeVar("T2", default=T1) +T3 = TypeVar("T3", default=list[T2]) +T4 = TypeVar("T4", default=dict[T1, T2]) +T5 = TypeVar("T5", default="T5") + +TA_A = dict[T1, T2] + + +def func1(a1: TA_A[int], a2: TA_A): + reveal_type(a1, expected_text="dict[int, int]") + reveal_type(a2, expected_text="dict[str, str]") + + +# This should generate an error because T2 depends on T1. +TA_B = dict[T2, T1] + +# This should generate an error because T5 refers to itself. +TA_C = list[T5] + +TA_D = tuple[T1, T2, T3] + + +def func2(d1: TA_D, d2: TA_D[int], d3: TA_D[int, float]): + reveal_type(d1, expected_text="tuple[str, str, list[str]]") + reveal_type(d2, expected_text="tuple[int, int, list[int]]") + reveal_type(d3, expected_text="tuple[int, float, list[float]]") + + +# This should generate an error because T2 depends on T1. +TA_E = list[T2] + +# This should generate an error because T4 depends on T2. +TA_F = dict[T2, T4] + + +class ClassK(Generic[T1]): + # This should generate an error because T2 depends on T1, which + # is defined in an outer scope. + TA_G = list[T2] + + +P1 = ParamSpec("P1", default=...) +P2 = ParamSpec("P2", default=P1) +P3 = ParamSpec("P3", default=P2) +P4 = ParamSpec("P4", default=[int, T1]) + +TA_PA = tuple[Callable[P1, None], Callable[P2, None], Callable[P3, None]] + + +def func3( + pa1: TA_PA, + pa2: TA_PA[[str]], + pa3: TA_PA[..., [float]], + pa4: TA_PA[..., [int, int], [float]], +): + reveal_type(pa1, expected_text="tuple[(...) -> None, (...) -> None, (...) -> None]") + reveal_type(pa2, expected_text="tuple[(str) -> None, (str) -> None, (str) -> None]") + reveal_type( + pa3, expected_text="tuple[(...) -> None, (float) -> None, (float) -> None]" + ) + reveal_type( + pa4, expected_text="tuple[(...) -> None, (int, int) -> None, (float) -> None]" + ) + + +# This should generate an error because P1 depends on P2. +TA_PB = tuple[Callable[P2, None], Callable[P1, None]] + +TA_PC = T1 | Callable[P4, T1] + + +def func4(pc1: TA_PC, pc2: TA_PC[float], pc3: TA_PC[float, ...]): + reveal_type(pc1, expected_text="str | ((int, str) -> str)") + reveal_type(pc2, expected_text="float | ((int, float) -> float)") + reveal_type(pc3, expected_text="float | ((...) -> float)") + + +# This should generate an error because P4 depends on T1. +TA_PD = Callable[P4, T1] + + +Ts1 = TypeVarTuple("Ts1", default=Unpack[tuple[T1, T2]]) +Ts2 = TypeVarTuple("Ts2", default=Unpack[tuple[T1, ...]]) + + +class ClassTA(Generic[T1, T2, *Ts1]): + ... + + +TA_TA = ClassTA[T1, T2, *Ts1] + + +def func5( + ta1: TA_TA, + ta2: TA_TA[int], + ta3: TA_TA[int, float], + ta4: TA_TA[int, float, *tuple[None, ...]], +): + reveal_type(ta1, expected_text="ClassTA[str, str, str, str]") + reveal_type(ta2, expected_text="ClassTA[int, int, int, int]") + reveal_type(ta3, expected_text="ClassTA[int, float, int, float]") + reveal_type(ta4, expected_text="ClassTA[int, float, *tuple[None, ...]]") + + +# This should generate an error because Ts1 depends on T2. +TA_TB = tuple[T1, *Ts1, T2] + + +class ClassTC(Generic[T1, *Ts2]): + ... + + +TA_TC = ClassTC[T1, *Ts2] + + +def func6( + tc1: TA_TC, + tc2: TA_TC[int], + tc3: TA_TC[int, *tuple[()]], + tc4: TA_TC[int, *tuple[None]], +): + reveal_type(tc1, expected_text="ClassTC[str, *tuple[str, ...]]") + reveal_type(tc2, expected_text="ClassTC[int, *tuple[int, ...]]") + reveal_type(tc3, expected_text="ClassTC[int]") + reveal_type(tc4, expected_text="ClassTC[int, None]") diff --git a/packages/pyright-internal/src/tests/samples/typeVarDefaultTypeAlias3.py b/packages/pyright-internal/src/tests/samples/typeVarDefaultTypeAlias3.py new file mode 100644 index 000000000..c207ef38a --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/typeVarDefaultTypeAlias3.py @@ -0,0 +1,85 @@ +# This sample tests support for PEP 696 (default types for TypeVars). +# In particular, it tests the handling of default TypeVar types for +# generic type aliases when one TypeVar default expression refers +# to another. This is the same as typeVarDefaultTypeAlias2 except +# that it uses PEP 695 syntax. + +from typing import Callable, Unpack + +type TA_A[T1=str, T2=T1] = dict[T1, T2] + +def func1(a1: TA_A[int], a2: TA_A): + reveal_type(a1, expected_text="dict[int, int]") + reveal_type(a2, expected_text="dict[str, str]") + +# This should generate an error because T2 depends on T1. +type TA_B[T2=T1, T1=str] = None + +# This should generate an error because T5 refers to itself. +type TA_C[T5=T5] = None + +type TA_D[T1=str, T2=T1, T3=list[T2]] = tuple[T1, T2, T3] + +def func2(d1: TA_D, d2: TA_D[int], d3: TA_D[int, float]): + reveal_type(d1, expected_text="tuple[str, str, list[str]]") + reveal_type(d2, expected_text="tuple[int, int, list[int]]") + reveal_type(d3, expected_text="tuple[int, float, list[float]]") + +# This should generate an error because T2 depends on T1. +type TA_E[T2=T1] = list[T2] + +# This should generate two errors because T4 depends on T2 and T1. +type TA_F[T2=T1, T4=dict[T1, T2]] = dict[T2, T4] + +class ClassK[T1]: + # This should generate an error because T2 depends on T1, which + # is defined in an outer scope. + type TA_G[T2=T1] = list[T2] + + +type TA_PA[**P1, **P2=P1, **P3=P2] = tuple[Callable[P1, None], Callable[P2, None], Callable[P3, None]] + +def func3(pa1: TA_PA, pa2: TA_PA[[str]], pa3: TA_PA[..., [float]], pa4: TA_PA[..., [int, int], [float]]): + reveal_type(pa1, expected_text="tuple[(...) -> None, (...) -> None, (...) -> None]") + reveal_type(pa2, expected_text="tuple[(str) -> None, (str) -> None, (str) -> None]") + reveal_type(pa3, expected_text="tuple[(...) -> None, (float) -> None, (float) -> None]") + reveal_type(pa4, expected_text="tuple[(...) -> None, (int, int) -> None, (float) -> None]") + +# This should generate an error because P1 depends on P2. +type TA_PB[**P2=P1, **P1=...] = tuple[Callable[P2, None], Callable[P1, None]] + +type TA_PC[T1=str, **P4=[int, T1, ]] = T1 | Callable[P4, T1] + +def func4(pc1: TA_PC, pc2: TA_PC[float], pc3: TA_PC[float, ...]): + reveal_type(pc1, expected_text="str | ((int, str) -> str)") + reveal_type(pc2, expected_text="float | ((int, float) -> float)") + reveal_type(pc3, expected_text="float | ((...) -> float)") + + +# This should generate an error because P4 depends on T1. +type TA_PD[**P4=[int, T1], T1=str] = Callable[P4, T1] + + +class ClassTA[T1, T2, *Ts1]: ... + +type TA_TA[T1=str, T2=T1, *Ts1=Unpack[tuple[T1, T2]]] = ClassTA[T1, T2, *Ts1] + +def func5(ta1: TA_TA, ta2: TA_TA[int], ta3: TA_TA[int, float], ta4: TA_TA[int, float, *tuple[None, ...]]): + reveal_type(ta1, expected_text="ClassTA[str, str, str, str]") + reveal_type(ta2, expected_text="ClassTA[int, int, int, int]") + reveal_type(ta3, expected_text="ClassTA[int, float, int, float]") + reveal_type(ta4, expected_text="ClassTA[int, float, *tuple[None, ...]]") + +# This should generate an error because Ts1 depends on T2. +type TA_TB[T1=str, *Ts1=Unpack[tuple[T1, T2]], T2=T1] = tuple[T1, *Ts1, T2] + +class ClassTC[T1, *Ts2]: ... + +type TA_TC[T1=str, *Ts2=Unpack[tuple[T1, ...]]] = ClassTC[T1, *Ts2] + +def func6(tc1: TA_TC, tc2: TA_TC[int], tc3: TA_TC[int, *tuple[()]], tc4: TA_TC[int, *tuple[None]]): + reveal_type(tc1, expected_text="ClassTC[str, *tuple[str, ...]]") + reveal_type(tc2, expected_text="ClassTC[int, *tuple[int, ...]]") + reveal_type(tc3, expected_text="ClassTC[int]") + reveal_type(tc4, expected_text="ClassTC[int, None]") + diff --git a/packages/pyright-internal/src/tests/samples/typedDict11.py b/packages/pyright-internal/src/tests/samples/typedDict11.py index 5bdfcbc39..b038356b6 100644 --- a/packages/pyright-internal/src/tests/samples/typedDict11.py +++ b/packages/pyright-internal/src/tests/samples/typedDict11.py @@ -1,7 +1,7 @@ # This sample tests bidirectional type inference (expected type) for # lists that include TypedDicts. -from typing import List, TypedDict +from typing import List, TypeVar, TypedDict MessageTypeDef = TypedDict("MessageTypeDef", {"Id": str, "Handle": str}) @@ -10,3 +10,12 @@ list2: List[MessageTypeDef] = [ {"Id": msg["Id"], "Handle": msg["Handle"]} for msg in msgs ] + +TMessage = TypeVar("TMessage", bound=MessageTypeDef) + + +def func1(x: list[TMessage]) -> TMessage: + ... + + +func1([{"Id": "", "Handle": ""}]) diff --git a/packages/pyright-internal/src/tests/samples/typedDict12.py b/packages/pyright-internal/src/tests/samples/typedDict12.py index 2f978778f..cc774ef35 100644 --- a/packages/pyright-internal/src/tests/samples/typedDict12.py +++ b/packages/pyright-internal/src/tests/samples/typedDict12.py @@ -1,7 +1,5 @@ # This sample tests the synthesized methods get, setdefault -# pop, and __delitem__ for a TypedDict. - -# pyright: strict +# pop, __delitem__, clear, and popitem for a TypedDict. from typing import Optional, TypedDict, Union, final from typing_extensions import NotRequired, Required @@ -46,19 +44,19 @@ class TD2(TD1): @final -class A(TypedDict): +class TD3(TypedDict): foo: int baz: NotRequired[int] -class B(TypedDict): +class TD4(TypedDict): bar: str -C = Union[A, B] +C = Union[TD3, TD4] -def test(a: A, b: B, c: C, s: str) -> Optional[int]: +def test(a: TD3, b: TD4, c: C, s: str) -> Optional[int]: a1 = a.get("foo") reveal_type(a1, expected_text="int") a2 = a.get("foo", 1.0) @@ -101,3 +99,30 @@ def test(a: A, b: B, c: C, s: str) -> Optional[int]: reveal_type(c5, expected_text="int | Any | None") c6 = c.get("baz", 1.0) reveal_type(c6, expected_text="int | float | Any") + + +@final +class TD5(TypedDict, total=False): + a: int + + +@final +class TD6(TypedDict): + a: NotRequired[int] + b: Required[int] + + +td5: TD5 = {"a": 1} + +reveal_type(td5.clear, expected_text="() -> None") +reveal_type(td5.popitem, expected_text="() -> tuple[str, Unknown]") +td5.clear() +td5.popitem() + +td6: TD6 = {"b": 1} + +# This should generate an error because not all elements are NotRequired. +td6.clear() + +# This should generate an error because not all elements are NotRequired. +td6.popitem() diff --git a/packages/pyright-internal/src/tests/samples/typedDict18.py b/packages/pyright-internal/src/tests/samples/typedDict18.py index f04c46c39..1949aeeba 100644 --- a/packages/pyright-internal/src/tests/samples/typedDict18.py +++ b/packages/pyright-internal/src/tests/samples/typedDict18.py @@ -1,7 +1,7 @@ # This sample tests the handling of generic TypedDicts which are # supported in Python 3.11 and newer. -from typing import Generic, Literal, TypeVar, TypedDict +from typing import Generic, Literal, TypeVar, TypedDict, Unpack _T1 = TypeVar("_T1") _T2 = TypeVar("_T2") @@ -107,3 +107,20 @@ def func6(a: TD8) -> Literal[1]: f4: TD8 = {"x": 1, "y": 1, "z": "a"} reveal_type(func6({"x": 1, "y": 1, "z": "a"})) + +class TD9(TypedDict, Generic[_T1]): + x: _T1 + + +class ClassA(Generic[_T1]): + def __init__(self, **attrs: Unpack[TD9[_T1]]) -> None: + ... + + +f5 = ClassA[int](x=1) + +# This should generate an error because 1 isn't a valid type. +f6 = ClassA[str](x=1) + +f7 = ClassA(x=1) +reveal_type(f7, expected_text='ClassA[int]') diff --git a/packages/pyright-internal/src/tests/samples/typedDict22.py b/packages/pyright-internal/src/tests/samples/typedDict22.py new file mode 100644 index 000000000..36e7142e1 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/typedDict22.py @@ -0,0 +1,12 @@ +# This sample tests that class variables for TypedDict are accessible. + +from typing import TypedDict + + +class TD1(TypedDict): + ... + + +reveal_type(TD1.__required_keys__, expected_text="frozenset[str]") +reveal_type(TD1.__optional_keys__, expected_text="frozenset[str]") +reveal_type(TD1.__total__, expected_text="bool") diff --git a/packages/pyright-internal/src/tests/samples/typedDict3.py b/packages/pyright-internal/src/tests/samples/typedDict3.py index d15e8b500..68d79dc79 100644 --- a/packages/pyright-internal/src/tests/samples/typedDict3.py +++ b/packages/pyright-internal/src/tests/samples/typedDict3.py @@ -1,6 +1,6 @@ # This sample tests the type analyzer's handling of TypedDict classes. -from typing import TypedDict +from typing import TypeVar, TypedDict class Movie(TypedDict, total=False): diff --git a/packages/pyright-internal/src/tests/samples/typedDict6.py b/packages/pyright-internal/src/tests/samples/typedDict6.py index bd8943663..2e753d592 100644 --- a/packages/pyright-internal/src/tests/samples/typedDict6.py +++ b/packages/pyright-internal/src/tests/samples/typedDict6.py @@ -1,7 +1,7 @@ # This sample tests the type analyzer's handling of TypedDict # "alternate syntax" defined in PEP 589. -from typing import TypedDict +from typing import NotRequired, Required, TypedDict Movie = TypedDict("Movie", {"name": str, "year": int}) @@ -75,3 +75,8 @@ def get_movie_name(movie: Movie): def foo(unknown_str_value: str): a = movie5[unknown_str_value] + +Movie12 = TypedDict("Movie12", {"title": Required[str], "predecessor": NotRequired["Movie12"]}) + +movie12: Movie12 = {"title": "Two Towers", "predecessor": {"title": "Fellowship"}} + diff --git a/packages/pyright-internal/src/tests/samples/typedDictInline1.py b/packages/pyright-internal/src/tests/samples/typedDictInline1.py new file mode 100644 index 000000000..586643e9f --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/typedDictInline1.py @@ -0,0 +1,36 @@ +# This sample tests support for inlined TypedDict definitions. + +from typing import Dict + + +td1: dict[{"a": int, "b": str}] = {"a": 0, "b": ""} + +td2: dict[{"a": dict[{"b": int}]}] = {"a": {"b": 0}} + +td3: dict[{"a": "list[float]"}] = {"a": [3]} + +# This should generate two errors because dictionary literals can be used +# only with dict or Dict. +err1: list[{"a": 1}] + +# This should generate an error because dictionary comprehensions +# are not allowed. +err2: dict[{"a": int for _ in range(1)}] + +# This should generate an error because unpacked dictionary +# entries are not allowed. +err3: dict[{**{"a": int}}] + +# This should generate three errors because Dict doesn't support inlined +# TypedDict. It generates an exception at runtime. +err4: Dict[{"c": int}] + +# This should generate an error because an extra type argument is provided. +err5: dict[{"a": int}, str] + + +def func1(val: dict[{"a": int}]) -> dict[{"a": int}]: + return {"a": val["a"] + 1} + + +func1({"a": 3}) diff --git a/packages/pyright-internal/src/tests/samples/unpack5.py b/packages/pyright-internal/src/tests/samples/unpack5.py new file mode 100644 index 000000000..b8490da41 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/unpack5.py @@ -0,0 +1,85 @@ +# This sample tests unpacking of tuples that contain PEP 646-style +# tuples with unknown length within them. + +def suffix() -> tuple[int, str, *tuple[bool, ...]]: + return 1, "a", True + + +def test_suffix(): + a1, a2, a3 = suffix() + reveal_type(a1, expected_text="int") + reveal_type(a2, expected_text="str") + reveal_type(a3, expected_text="bool") + + *b1, b2, b3 = suffix() + # This case is ambiguous. + reveal_type(b1, expected_text="list[int]") + reveal_type(b2, expected_text="str") + reveal_type(b3, expected_text="bool") + + c1, *c2, c3 = suffix() + # This case is ambiguous. + reveal_type(c1, expected_text="int") + reveal_type(c2, expected_text="list[str]") + reveal_type(c3, expected_text="bool") + + d1, d2, *d3 = suffix() + reveal_type(d1, expected_text="int") + reveal_type(d2, expected_text="str") + reveal_type(d3, expected_text="list[bool]") + + +def prefix() -> tuple[*tuple[int, ...], str, bool]: + return 1, "a", True + + +def test_prefix(): + a1, a2, a3 = prefix() + reveal_type(a1, expected_text="int") + reveal_type(a2, expected_text="str") + reveal_type(a3, expected_text="bool") + + *b1, b2, b3 = prefix() + reveal_type(b1, expected_text="list[int]") + reveal_type(b2, expected_text="str") + reveal_type(b3, expected_text="bool") + + c1, *c2, c3 = prefix() + # This case is ambiguous. + reveal_type(c1, expected_text="int") + reveal_type(c2, expected_text="list[str]") + reveal_type(c3, expected_text="bool") + + d1, d2, *d3 = prefix() + # This case is ambiguous. + reveal_type(d1, expected_text="int") + reveal_type(d2, expected_text="str") + reveal_type(d3, expected_text="list[bool]") + + +def middle() -> tuple[int, *tuple[str, ...], bool]: + return 1, "a", True + + +def test_middle(): + a1, a2, a3 = middle() + reveal_type(a1, expected_text="int") + reveal_type(a2, expected_text="str") + reveal_type(a3, expected_text="bool") + + *b1, b2, b3 = middle() + # This case is ambiguous. + reveal_type(b1, expected_text="list[int]") + reveal_type(b2, expected_text="str") + reveal_type(b3, expected_text="bool") + + c1, *c2, c3 = middle() + reveal_type(c1, expected_text="int") + reveal_type(c2, expected_text="list[str]") + reveal_type(c3, expected_text="bool") + + d1, d2, *d3 = middle() + # This case is ambiguous. + reveal_type(d1, expected_text="int") + reveal_type(d2, expected_text="str") + reveal_type(d3, expected_text="list[bool]") diff --git a/packages/pyright-internal/src/tests/samples/unreachable1.py b/packages/pyright-internal/src/tests/samples/unreachable1.py index de4b21798..d3a38067a 100644 --- a/packages/pyright-internal/src/tests/samples/unreachable1.py +++ b/packages/pyright-internal/src/tests/samples/unreachable1.py @@ -3,6 +3,7 @@ from abc import abstractmethod import os import sys +from typing import NoReturn def func1(): @@ -38,7 +39,7 @@ def method4(self) -> None: print(self.b) raise RuntimeError() - def method5(self): + def method5(self) -> NoReturn: print(self.b) raise RuntimeError() @@ -78,7 +79,7 @@ def func7(foo: Foo): return 3 -def func8(): +def func8() -> NoReturn: raise NameError() @@ -93,20 +94,18 @@ def func10(): e = OSError() a1 = os.name == "nt" and None == e.errno reveal_type(a1, expected_text="bool") - + a2 = True and os.name == "nt" reveal_type(a2, expected_text="bool") - + if os.name == "nt": # This should be marked unreachable. - b = e.errno + b = e.errno if sys.version_info >= (4, 0): # This should be marked unreachable. b = e.errno - + return # This should be marked unreachable. b = e.errno - - \ No newline at end of file diff --git a/packages/pyright-internal/src/tests/samples/unusedExpression1.py b/packages/pyright-internal/src/tests/samples/unusedExpression1.py index cd7800c4c..b936123e3 100644 --- a/packages/pyright-internal/src/tests/samples/unusedExpression1.py +++ b/packages/pyright-internal/src/tests/samples/unusedExpression1.py @@ -32,3 +32,24 @@ # This should generate a diagnostic. t + +# This should generate a diagnostic. +(1, 2, 3) + +# This should generate a diagnostic. +{1: 2} + +# This should generate a diagnostic. +{1, 2, 3} + +# This should generate a diagnostic. +[1, 2, 3] + +[x for x in range(3)] +{x: x for x in range(3)} +{x for x in range(3)} + + + + + diff --git a/packages/pyright-internal/src/tests/samples/unusedImport1.py b/packages/pyright-internal/src/tests/samples/unusedImport1.py new file mode 100644 index 000000000..a2bbc06d8 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/unusedImport1.py @@ -0,0 +1,5 @@ +# This sample tests the reportUnusedImport diagnostic rule. +import sys as sys # Assumes export +import os as os2 # Should error +from sys import path as p # Should error +from os import environ as environ # Assumes export \ No newline at end of file diff --git a/packages/pyright-internal/src/tests/samples/variadicTypeVar11.py b/packages/pyright-internal/src/tests/samples/variadicTypeVar11.py index 00e68cf7f..a48f6ad4e 100644 --- a/packages/pyright-internal/src/tests/samples/variadicTypeVar11.py +++ b/packages/pyright-internal/src/tests/samples/variadicTypeVar11.py @@ -54,8 +54,8 @@ def func3(p1: Tuple[int], p2: Tuple[int, str]): v4 = func2((3, "hi"), p2) reveal_type(v4, expected_text="str") - # This should generate an error v5 = func2((3, 3), p2) + reveal_type(v5, expected_text="str | int") def func4(a: int, *args: *_Xs, **kwargs: str) -> Tuple[int, *_Xs]: diff --git a/packages/pyright-internal/src/tests/samples/variadicTypeVar15.py b/packages/pyright-internal/src/tests/samples/variadicTypeVar15.py new file mode 100644 index 000000000..6c0513aea --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/variadicTypeVar15.py @@ -0,0 +1,23 @@ +# This sample tests the capture of an unbounded (unknown-length) tuple +# by a TypeVarTuple. + +from typing import Any, Generic +from typing_extensions import TypeVarTuple, Unpack + +Shape = TypeVarTuple("Shape") + + +class Array(Generic[Unpack[Shape]]): + ... + + +def func0(x: Array[Unpack[Shape]]) -> Array[Unpack[Shape]]: + ... + + +def func1(y: Array[int, Unpack[tuple[Any, ...]]]): + reveal_type(func0(y), expected_text="Array[int, *tuple[Any, ...]]") + + +def func2(y: Array[Unpack[tuple[int, ...]], int]): + reveal_type(func0(y), expected_text="Array[*tuple[int, ...], int]") diff --git a/packages/pyright-internal/src/tests/samples/variadicTypeVar16.py b/packages/pyright-internal/src/tests/samples/variadicTypeVar16.py new file mode 100644 index 000000000..b4c9187c1 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/variadicTypeVar16.py @@ -0,0 +1,28 @@ +# This sample tests the case where a classmethod or staticmethod are +# used with a TypeVarTuple that requires specialization. + +from typing import Generic + +from typing_extensions import TypeVarTuple, Unpack + +T2 = TypeVarTuple("T2") + + +class Base(Generic[Unpack[T2]]): + @classmethod + def method1(cls, *args: Unpack[T2]) -> int: + ... + + @staticmethod + def method2(*args: Unpack[T2]) -> int: + ... + + +class Child(Base[int, str]): + ... + + +Child.method1(1, "") +Child.method2(1, "") + + diff --git a/packages/pyright-internal/src/tests/samples/variadicTypeVar17.py b/packages/pyright-internal/src/tests/samples/variadicTypeVar17.py new file mode 100644 index 000000000..8212daa42 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/variadicTypeVar17.py @@ -0,0 +1,53 @@ +# This sample tests the case where an unpacked tuple argument in a call +# expression is matched to an `*args` parameter that has a declared type +# that includes an unpacked TypeVarTuple. + +from typing_extensions import TypeVarTuple + +Ts = TypeVarTuple("Ts") + + +def call0(*args: *Ts) -> tuple[*Ts]: + ... + +def call1(*args: *tuple[int, *Ts]) -> tuple[*Ts]: + ... + +def call2(*args: *tuple[*Ts, float]) -> tuple[*Ts]: + ... + +def call3(*args: *tuple[int, *Ts, float]) -> tuple[*Ts]: + ... + +def call4(*args: *tuple[*tuple[int, *tuple[*Ts], float]]) -> tuple[*Ts]: + ... + + +def func1(*args: *tuple[int, str]): + reveal_type(call0(*args), expected_text="tuple[int, str]") + +def func2(*args: *tuple[int, ...]): + reveal_type(call0(*args), expected_text="tuple[int, ...]") + +def func3(*args: *tuple[int, *tuple[str, ...], float]): + reveal_type(call0(*args), expected_text="tuple[int, *tuple[str, ...], float]") + +def func4(*args: *Ts) -> tuple[*Ts]: + call0(*args) + return args + +def func5(x: int, y: str, z: float): + v1 = call1(*(x, y, z)) + reveal_type(v1, expected_text="tuple[str, float]") + + v2 = call2(*(x, y, z)) + reveal_type(v2, expected_text="tuple[int, str]") + + v3 = call3(*(x, y, z)) + reveal_type(v3, expected_text="tuple[str]") + + v4 = call4(*(x, *(y, z))) + reveal_type(v4, expected_text="tuple[str]") + +def func6(*args: *tuple[int, *tuple[None, ...], float]): + reveal_type(call2(*args), expected_text="tuple[int, *tuple[None, ...]]") diff --git a/packages/pyright-internal/src/tests/samples/variadicTypeVar18.py b/packages/pyright-internal/src/tests/samples/variadicTypeVar18.py new file mode 100644 index 000000000..839ebeafb --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/variadicTypeVar18.py @@ -0,0 +1,18 @@ +# This sample tests the case where an unpacked TypeVar is used in +# an iterator. + +from typing import Any, Callable, TypeVarTuple + + +Ts = TypeVarTuple("Ts") + +def func1(f: Callable[[*Ts], Any], p: tuple[*Ts]): + f(*p) + + # This should generate an error because p is not unpacked. + f(p) + + for i in p: + # This should generate an error. + f(i) + \ No newline at end of file diff --git a/packages/pyright-internal/src/tests/samples/variadicTypeVar19.py b/packages/pyright-internal/src/tests/samples/variadicTypeVar19.py new file mode 100644 index 000000000..8a768ae8f --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/variadicTypeVar19.py @@ -0,0 +1,54 @@ +# This sample tests the case where an unpacked TypeVarTuple is used +# as one or more type arguments for a tuple. + +from typing import Generator, Iterable, TypeVar, TypeVarTuple, Union + +T = TypeVar("T") +Ts = TypeVarTuple("Ts") + +def func1(a: Iterable[T], b: Iterable[T]): + i = iter(a) + j = iter(b) + while True: + try: + yield (next(i), next(j)) + except StopIteration: + break + +reveal_type(func1, expected_text="(a: Iterable[T@func1], b: Iterable[T@func1]) -> Generator[tuple[T@func1, T@func1], None, None]") + +def func2(a: tuple[*Ts], b: tuple[*Ts]): + for i in func1(a, b): + yield i + +reveal_type(func2, expected_text="(a: tuple[*Ts@func2], b: tuple[*Ts@func2]) -> Generator[tuple[Union[*Ts@func2], Union[*Ts@func2]], None, None]") + +def func3(): + v1 = func2((1, "foo"), (2, "bar")) + reveal_type(v1, expected_text="Generator[tuple[int | str, int | str], None, None]") + + for i in v1: + reveal_type(i, expected_text="tuple[int | str, int | str]") + + +def func5(x: "Iterable[Union[*Ts]]") -> Iterable[Union[*Ts]]: + ... + +def func6(): + v1: list[int] = [i for i in func5([1, 2, 3])] + v2: list[int | str] = [i for i in func5([1, "foo"])] + + +def func7(t: "tuple[*Ts]") -> "tuple[Union[*Ts], ...]": ... + +def func8(a: int, b: str): + v1 = func7(((a, b),)) + reveal_type(v1, expected_text="tuple[tuple[int, str], ...]") + +def func9(x: "tuple[T, ...]", y: "tuple[*Ts]") -> Generator[T | Union[*Ts], None, None]: + z = x + y + reveal_type(z, expected_text="tuple[T@func9 | Union[*Ts@func9], ...]") + for e in z: + reveal_type(e, expected_text="T@func9 | Union[*Ts@func9]") + yield e + diff --git a/packages/pyright-internal/src/tests/samples/variadicTypeVar20.py b/packages/pyright-internal/src/tests/samples/variadicTypeVar20.py new file mode 100644 index 000000000..046db4afd --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/variadicTypeVar20.py @@ -0,0 +1,18 @@ +# This sample tests the case where an unpacked TypeVarTuple is assigned +# to a non-variadic TypeVar during constraint solving. + +from typing import TypeVar, Tuple, Union +from typing_extensions import reveal_type, TypeVarTuple + +T = TypeVar("T") +Ts = TypeVarTuple("Ts") + +def func1(*args: T) -> Tuple[T, ...]: + return args + +def func2(x: "Tuple[*Ts]") -> list[Union[*Ts]]: + r = func1(*x) + reveal_type(r, expected_text='Tuple[Union[*Ts@func2], ...]') + v = [i for i in r] + reveal_type(v, expected_text='list[Union[*Ts@func2]]') + return v diff --git a/packages/pyright-internal/src/tests/samples/variadicTypeVar21.py b/packages/pyright-internal/src/tests/samples/variadicTypeVar21.py new file mode 100644 index 000000000..0a50f41a8 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/variadicTypeVar21.py @@ -0,0 +1,15 @@ +# This sample tests the case where a tuple including an unpacked +# TypeVarTuple is used in an unpacked argument and assigned to another +# TypeVarTuple parameter. + +from typing import TypeVar, TypeVarTuple, Union, Unpack + +T = TypeVar("T") +Ts = TypeVarTuple("Ts") + +def f(*args: Unpack[Ts]) -> Union[Unpack[Ts]]: ... + +def g(x: tuple[T, Unpack[Ts]]) -> Union[T, Unpack[Ts]]: + f(*x) + return x[0] + \ No newline at end of file diff --git a/packages/pyright-internal/src/tests/samples/variadicTypeVar22.py b/packages/pyright-internal/src/tests/samples/variadicTypeVar22.py new file mode 100644 index 000000000..9629948fb --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/variadicTypeVar22.py @@ -0,0 +1,37 @@ +# This sample tests the case where a TypeVarTuple is solved using +# a tuple with literal values. + +from typing import Callable, Literal, TypeVarTuple, Union, Unpack + +Ts = TypeVarTuple("Ts") + +def func1(f: Callable[[Unpack[Ts]], None], vs: tuple[Unpack[Ts]]) -> Union[Unpack[Ts]]: ... + +def func2(f: Callable[[Literal[1, 2]], None], vs: tuple[Literal[1, 2]]): + v1 = func1(f, vs) + reveal_type(v1, expected_text='Literal[1, 2]') + +def func3(f: Callable[[Literal[1, 2, 3]], None], vs: tuple[Literal[1, 2]]): + v1 = func1(f, vs) + reveal_type(v1, expected_text='Literal[1, 2]') + +def func4(f: Callable[[int], None], vs: tuple[Literal[1, 2]]): + v1 = func1(f, vs) + reveal_type(v1, expected_text='int') + +def func5(f: Callable[[Literal[1, 2]], None], vs: tuple[Literal[1, 2, 3]]): + # This should result in an error. + func1(f, vs) + +def func6(f: Callable[[Literal[1, 2]], None], vs: tuple[int]): + # This should result in an error. + func1(f, vs) + +def func7(f: Callable[[int, int, int], None], vs: tuple[int, ...]): + v1 = func1(f, vs) + reveal_type(v1, expected_text='int') + +def func8(f: Callable[[Unpack[tuple[int, ...]]], None], vs: tuple[int]): + v1 = func1(f, vs) + reveal_type(v1, expected_text='int') + diff --git a/packages/pyright-internal/src/tests/samples/variadicTypeVar3.py b/packages/pyright-internal/src/tests/samples/variadicTypeVar3.py index 82c0aa983..cf24e3117 100644 --- a/packages/pyright-internal/src/tests/samples/variadicTypeVar3.py +++ b/packages/pyright-internal/src/tests/samples/variadicTypeVar3.py @@ -3,7 +3,7 @@ # pyright: reportMissingModuleSource=false -from typing import Generic, List, Sequence, Tuple, TypeVar, Union +from typing import Generic, Sequence, TypeVar, Union from typing_extensions import TypeVarTuple, Unpack @@ -13,7 +13,7 @@ class Array(Generic[Unpack[_Xs]]): def __init__(self, *args: Unpack[_Xs]) -> None: - self.x: Tuple[Unpack[_Xs]] = args + self.x: tuple[Unpack[_Xs]] = args reveal_type(args, expected_text="tuple[*_Xs@Array]") # This should generate an error because _Xs is not unpacked. @@ -26,14 +26,14 @@ def linearize(value: Array[Unpack[_Xs]]) -> Sequence[Union[Unpack[_Xs]]]: return [] -def array_to_tuple(value: Array[Unpack[_Xs]]) -> Tuple[complex, Unpack[_Xs]]: +def array_to_tuple(value: Array[Unpack[_Xs]]) -> tuple[complex, Unpack[_Xs]]: ... def func1(x: Array[int, str, str, float], y: Array[()]): reveal_type(x, expected_text="Array[int, str, str, float]") - reveal_type(y, expected_text="Array[()]") + reveal_type(y, expected_text="Array[*tuple[()]]") a1 = Array(3, 3.5, "b") reveal_type(a1, expected_text="Array[int, float, str]") @@ -42,16 +42,16 @@ def func1(x: Array[int, str, str, float], y: Array[()]): reveal_type(a2, expected_text="Sequence[int | float | str]") b1 = Array() - reveal_type(b1, expected_text="Array[()]") + reveal_type(b1, expected_text="Array[*tuple[()]]") b2 = linearize(b1) - reveal_type(b2, expected_text="Sequence[Unknown]") + reveal_type(b2, expected_text="Sequence[Never]") e = array_to_tuple(x) - reveal_type(e, expected_text="Tuple[complex, int, str, str, float]") + reveal_type(e, expected_text="tuple[complex, int, str, str, float]") f = array_to_tuple(y) - reveal_type(f, expected_text="Tuple[complex]") + reveal_type(f, expected_text="tuple[complex]") class ArrayIntStr(Array[int, str, _T]): @@ -73,13 +73,12 @@ def __init__(self, val: _T) -> None: v5: Array[int, str] = v1 -def test1(p1: Tuple[str, int], p2: List[str]): - # This should generate an error because unpacked - # arguments are not supported for variadic parameters. +def test1(p1: tuple[str, int], p2: list[str]): v6 = Array(*p1) + reveal_type(v6, expected_text="Array[str, int]") - # Same thing. - v7 = Array(int, *p1, str) + v7 = Array(1, *p1, "") + reveal_type(v7, expected_text="Array[int, str, int, str]") # This should generate an error because open-ended # tuple types should not be allowed. diff --git a/packages/pyright-internal/src/tests/samples/variadicTypeVar4.py b/packages/pyright-internal/src/tests/samples/variadicTypeVar4.py index 83e66f788..f10c5185c 100644 --- a/packages/pyright-internal/src/tests/samples/variadicTypeVar4.py +++ b/packages/pyright-internal/src/tests/samples/variadicTypeVar4.py @@ -53,8 +53,8 @@ def func3(p1: Tuple[int], p2: Tuple[int, str]): v4 = func2((3, "hi"), p2) reveal_type(v4, expected_text="str") - # This should generate an error v5 = func2((3, 3), p2) + reveal_type(v5, expected_text="str | int") def func4(a: int, *args: Unpack[_Xs], **kwargs: str) -> Tuple[int, Unpack[_Xs]]: diff --git a/packages/pyright-internal/src/tests/samples/variadicTypeVar5.py b/packages/pyright-internal/src/tests/samples/variadicTypeVar5.py index 665c9ae2c..c180d1c84 100644 --- a/packages/pyright-internal/src/tests/samples/variadicTypeVar5.py +++ b/packages/pyright-internal/src/tests/samples/variadicTypeVar5.py @@ -129,3 +129,10 @@ def callback8(a: int, b: str, c: complex, d: int) -> int: d5_3 = func4(callback8) reveal_type(d5_3, expected_text="(int, str, complex) -> int") + + +def func5(x: Callable[[Unpack[_Xs]], None], y: tuple[Unpack[_Xs]]): + pass + +def func6(x: Callable[[Unpack[_Xs]], None], y: tuple[Unpack[_Xs]]): + func5(x, y) diff --git a/packages/pyright-internal/src/tests/samples/variadicTypeVar8.py b/packages/pyright-internal/src/tests/samples/variadicTypeVar8.py index f293345a7..0f4df007e 100644 --- a/packages/pyright-internal/src/tests/samples/variadicTypeVar8.py +++ b/packages/pyright-internal/src/tests/samples/variadicTypeVar8.py @@ -83,8 +83,8 @@ def test1(a: int, b: str, c: List[int], d: Union[complex, str]): # This should generate an error v5_1 = func5(a) + # This should generate an error v5_2 = func5(a, a) - reveal_type(v5_2, expected_text="int") # This should generate an error v5_3 = func5(a, b) @@ -103,6 +103,9 @@ def test1(a: int, b: str, c: List[int], d: Union[complex, str]): v6_3 = func6(a, b, d) reveal_type(v6_3, expected_text="int | str | complex") + v6_4 = func6() + reveal_type(v6_4, expected_text="Never") + # --------- v7_1 = func7([a]) diff --git a/packages/pyright-internal/src/tests/samples/with6.py b/packages/pyright-internal/src/tests/samples/with6.py new file mode 100644 index 000000000..2ac6b67e0 --- /dev/null +++ b/packages/pyright-internal/src/tests/samples/with6.py @@ -0,0 +1,22 @@ +# This sample tests that classes whose metaclass implements a context +# manager work with the "with" statement. + +from types import TracebackType +from typing import Self + + +class ClassA(type): + def __enter__(cls) -> Self: + print("Enter A") + return cls + + def __exit__(cls, exc_typ: type[Exception], exc_val: Exception, exc_tbc: TracebackType) -> None: + print("Exit A") + +class ClassB(metaclass=ClassA): + ... + + +with ClassB as b: + ... + diff --git a/packages/pyright-internal/src/tests/service.test.ts b/packages/pyright-internal/src/tests/service.test.ts new file mode 100644 index 000000000..f9f33bd92 --- /dev/null +++ b/packages/pyright-internal/src/tests/service.test.ts @@ -0,0 +1,189 @@ +/* + * service.test.ts + * + * service tests. + */ + +import assert from 'assert'; + +import { getDirectoryPath } from '../common/pathUtils'; +import { parseAndGetTestState } from './harness/fourslash/testState'; + +test('basic file change', () => { + const code = ` +// @filename: test.py +//// [|/*marker*/|] + `; + + testSourceFileWatchChange(code); +}); + +test('non python file', () => { + const code = ` +// @filename: test.pyc +//// [|/*marker*/|] + `; + + testSourceFileWatchChange(code, /* expected */ false); +}); + +test('temp file', () => { + const code = ` +// @filename: test.py.12345678901234567890123456789012.py +//// [|/*marker*/|] + `; + + testSourceFileWatchChange(code, /* expected */ false); +}); + +test('excluded file', () => { + const code = ` +// @filename: pyrightconfig.json +//// { +//// "exclude": ["**/excluded.py"] +//// } + +// @filename: included.py +//// # empty + +// @filename: excluded.py +//// [|/*marker*/|] + `; + + testSourceFileWatchChange(code, /* expected */ false); +}); + +test('excluded but still part of program', () => { + const code = ` +// @filename: pyrightconfig.json +//// { +//// "exclude": ["**/excluded.py"] +//// } + +// @filename: included.py +//// from . import excluded + +// @filename: excluded.py +//// [|/*marker*/|] + `; + + const state = parseAndGetTestState(code, '/projectRoot').state; + const marker = state.getMarkerByName('marker'); + + while (state.workspace.service.test_program.analyze()); + + assert.strictEqual( + state.workspace.service.test_shouldHandleSourceFileWatchChanges(marker.fileName, /* isFile */ true), + true + ); +}); + +test('random folder changed', () => { + const code = ` +// @filename: notUsed.py +//// # empty + `; + + const state = parseAndGetTestState(code, '/projectRoot').state; + + assert.strictEqual( + state.workspace.service.test_shouldHandleSourceFileWatchChanges('/randomFolder', /* isFile */ false), + false + ); +}); + +test('excluded folder changed', () => { + const code = ` +// @filename: pyrightconfig.json +//// { +//// "exclude": ["**/.*"] +//// } + +// @filename: .excluded/notUsed.py +//// [|/*marker*/|] + `; + + testSourceFileWatchChange(code, /* expected */ false, /* isFile */ false); +}); + +test('file under excluded folder changed', () => { + const code = ` +// @filename: pyrightconfig.json +//// { +//// "exclude": ["**/.*"] +//// } + +// @filename: included.py +//// # empty + +// @filename: .excluded/notUsed.py +//// [|/*marker*/|] + `; + + testSourceFileWatchChange(code, /* expected */ false); +}); + +test('folder under excluded folder changed', () => { + const code = ` +// @filename: pyrightconfig.json +//// { +//// "exclude": ["**/.*"] +//// } + +// @filename: .excluded/nested/notUsed.py +//// [|/*marker*/|] + `; + + testSourceFileWatchChange(code, /* expected */ false, /* isFile */ false); +}); + +test('folder that contains no file has changed', () => { + const code = ` +// @filename: pyrightconfig.json +//// { +//// "exclude": ["**/excluded.py"] +//// } + +// @filename: included.py +//// # empty + +// @filename: lib/excluded.py +//// [|/*marker*/|] + `; + + testSourceFileWatchChange(code, /* expected */ false, /* isFile */ false); +}); + +test('folder that contains a file has changed', () => { + const code = ` +// @filename: lib/included.py +//// [|/*marker*/|] + `; + + testSourceFileWatchChange(code, /* expected */ true, /* isFile */ false); +}); + +test('folder that contains no file but whose parent has __init__ has changed', () => { + const code = ` +// @filename: pyrightconfig.json +//// { +//// "exclude": ["**/excluded.py"] +//// } + +// @filename: lib/__init__.py +//// # empty + +// @filename: lib/nested/excluded.py +//// [|/*marker*/|] + `; + + testSourceFileWatchChange(code, /* expected */ true, /* isFile */ false); +}); + +function testSourceFileWatchChange(code: string, expected = true, isFile = true) { + const state = parseAndGetTestState(code, '/projectRoot').state; + const marker = state.getMarkerByName('marker'); + const path = isFile ? marker.fileName : getDirectoryPath(marker.fileName); + + assert.strictEqual(state.workspace.service.test_shouldHandleSourceFileWatchChanges(path, isFile), expected); +} diff --git a/packages/pyright-internal/src/tests/signatureHelp.test.ts b/packages/pyright-internal/src/tests/signatureHelp.test.ts new file mode 100644 index 000000000..ec11c2474 --- /dev/null +++ b/packages/pyright-internal/src/tests/signatureHelp.test.ts @@ -0,0 +1,90 @@ +/* + * signatureHelp.test.ts + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT license. + * + * Unit tests for signature help. + */ + +import assert from 'assert'; +import { CancellationToken, MarkupKind } from 'vscode-languageserver'; + +import { convertOffsetToPosition } from '../common/positionUtils'; +import { parseAndGetTestState } from './harness/fourslash/testState'; + +test('invalid position in format string segment', () => { + const code = ` +// @filename: test.py +//// f'{"(".capit[|/*marker*/|]alize()}' + `; + + checkSignatureHelp(code, false); +}); + +test('valid position in format string segment', () => { + const code = ` +// @filename: test.py +//// f'{"(".capitalize([|/*marker*/|])}' + `; + + checkSignatureHelp(code, true); +}); + +test('valid position in the second format string segment', () => { + const code = ` +// @filename: test.py +//// f'{print("hello")} {"(".capitalize([|/*marker*/|])}' + `; + + checkSignatureHelp(code, true); +}); + +test('invalid position in the second format string segment', () => { + const code = ` +// @filename: test.py +//// f'{print("hello")} {"(".capitalize [|/*marker*/|] ()}' + `; + + checkSignatureHelp(code, false); +}); + +test('nested call in format string segment', () => { + const code = ` +// @filename: test.py +//// def foo(): +//// pass +//// +//// f'{"(".capitalize(foo([|/*marker*/|]))}' + `; + + checkSignatureHelp(code, true); +}); + +test('within arguments in format string segment', () => { + const code = ` +// @filename: test.py +//// def foo(): +//// pass +//// +//// f'{"(".capitalize(fo[|/*marker*/|]o())}' + `; + + checkSignatureHelp(code, true); +}); + +function checkSignatureHelp(code: string, expects: boolean) { + const state = parseAndGetTestState(code).state; + const marker = state.getMarkerByName('marker'); + + const parseResults = state.workspace.service.getParseResult(marker.fileName)!; + const position = convertOffsetToPosition(marker.position, parseResults.tokenizerOutput.lines); + + const actual = state.workspace.service.getSignatureHelpForPosition( + marker.fileName, + position, + MarkupKind.Markdown, + CancellationToken.None + ); + + assert.strictEqual(!!actual, expects); +} diff --git a/packages/pyright-internal/src/tests/sourceFile.test.ts b/packages/pyright-internal/src/tests/sourceFile.test.ts index ea756db71..b49e20484 100644 --- a/packages/pyright-internal/src/tests/sourceFile.test.ts +++ b/packages/pyright-internal/src/tests/sourceFile.test.ts @@ -6,6 +6,7 @@ * * Unit tests for pyright sourceFile module. */ +import * as assert from 'assert'; import { ImportResolver } from '../analyzer/importResolver'; import { SourceFile } from '../analyzer/sourceFile'; @@ -13,6 +14,7 @@ import { ConfigOptions } from '../common/configOptions'; import { FullAccessHost } from '../common/fullAccessHost'; import { combinePaths } from '../common/pathUtils'; import { createFromRealFileSystem } from '../common/realFileSystem'; +import { parseAndGetTestState } from './harness/fourslash/testState'; test('Empty', () => { const filePath = combinePaths(process.cwd(), 'tests/samples/test_file1.py'); @@ -23,3 +25,21 @@ test('Empty', () => { sourceFile.parse(configOptions, importResolver); }); + +test('Empty Open file', () => { + const code = ` +// @filename: test.py +//// [|/*marker*/# Content|] + `; + + const state = parseAndGetTestState(code).state; + const marker = state.getMarkerByName('marker'); + + assert.strictEqual( + state.workspace.service.test_program.getSourceFile(marker.fileName)?.getFileContent(), + '# Content' + ); + + state.workspace.service.updateOpenFileContents(marker.fileName, 1, [{ text: '' }]); + assert.strictEqual(state.workspace.service.test_program.getSourceFile(marker.fileName)?.getFileContent(), ''); +}); diff --git a/packages/pyright-internal/src/tests/sourceMapperUtils.test.ts b/packages/pyright-internal/src/tests/sourceMapperUtils.test.ts new file mode 100644 index 000000000..3c85c0be9 --- /dev/null +++ b/packages/pyright-internal/src/tests/sourceMapperUtils.test.ts @@ -0,0 +1,154 @@ +/* + * sourceFile.test.ts + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT license. + * + * Unit tests for pyright sourceMapperUtils module. + */ +import * as assert from 'assert'; +import { CancellationTokenSource } from 'vscode-jsonrpc'; + +import { buildImportTree } from '../analyzer/sourceMapperUtils'; + +describe('BuildImportTree', () => { + const tokenSource = new CancellationTokenSource(); + test('Simple', () => { + const results = buildImportTree( + 'A', + 'C', + (f) => { + switch (f) { + case 'C': + return ['B']; + case 'B': + return ['A']; + default: + break; + } + return []; + }, + tokenSource.token + ); + assert.deepEqual(results, ['C', 'B']); + }); + + test('Recursion', () => { + const results = buildImportTree( + 'A', + 'E', + (f) => { + switch (f) { + case 'E': + return ['D']; + case 'D': + return ['C', 'B']; + case 'C': + return ['D']; + case 'B': + return ['A']; + default: + break; + } + return []; + }, + tokenSource.token + ); + assert.deepEqual(results, ['E', 'D', 'B']); + }); + + test('Multiple Paths', () => { + const results = buildImportTree( + 'A', + 'G', + (f) => { + switch (f) { + case 'G': + return ['F', 'H', 'I']; + case 'F': + return ['D', 'E']; + case 'D': + return ['C', 'B']; + case 'C': + return ['E']; + case 'B': + return ['A']; + default: + break; + } + return []; + }, + tokenSource.token + ); + assert.deepEqual(results, ['G', 'F', 'D', 'B']); + }); + + test('No paths', () => { + const results = buildImportTree( + 'A', + 'G', + (f) => { + switch (f) { + case 'G': + return ['F', 'H', 'I']; + case 'F': + return ['D', 'E']; + case 'D': + return ['C', 'B']; + case 'C': + return ['E']; + default: + break; + } + return []; + }, + tokenSource.token + ); + assert.deepEqual(results, ['G']); + }); + + function genArray(start: number, end: number): string[] { + return Array(end - start) + .fill(0) + .map(() => String.fromCharCode(start++)); + } + + test('Too deep', () => { + const results = buildImportTree( + 'Z', + 'A', + (f) => { + const start = f.charCodeAt(0); + const end = 'Y'.charCodeAt(0); + return genArray(start, end); + }, + tokenSource.token + ); + assert.deepEqual(results, ['A']); + }); + + test('Canceled', () => { + const canceled = new CancellationTokenSource(); + canceled.cancel(); + const results = buildImportTree( + 'A', + 'E', + (f) => { + switch (f) { + case 'E': + return ['D']; + case 'D': + return ['C', 'B']; + case 'C': + return ['D']; + case 'B': + return ['A']; + default: + break; + } + return []; + }, + canceled.token + ); + assert.deepEqual(results, ['E']); + }); +}); diff --git a/packages/pyright-internal/src/tests/testStateUtils.ts b/packages/pyright-internal/src/tests/testStateUtils.ts index a6e47a43f..1d324da14 100644 --- a/packages/pyright-internal/src/tests/testStateUtils.ts +++ b/packages/pyright-internal/src/tests/testStateUtils.ts @@ -14,11 +14,26 @@ import { assertNever } from '../common/debug'; import { FileEditAction, FileEditActions } from '../common/editAction'; import { FileSystem } from '../common/fileSystem'; import { convertUriToPath, getDirectoryPath, isFile } from '../common/pathUtils'; -import { convertRangeToTextRange } from '../common/positionUtils'; -import { rangesAreEqual, TextRange } from '../common/textRange'; +import { rangesAreEqual } from '../common/textRange'; +import { applyTextEditsToString } from '../common/workspaceEditUtils'; import { Range } from './harness/fourslash/fourSlashTypes'; import { TestState } from './harness/fourslash/testState'; +export function convertFileEditActionToString(edit: FileEditAction): string { + return `'${edit.replacementText.replace(/\n/g, '!n!')}'@'${edit.filePath}:(${edit.range.start.line},${ + edit.range.start.character + })-(${edit.range.end.line},${edit.range.end.character})'`; +} + +export function convertRangeToFileEditAction(state: TestState, range: Range, replacementText?: string): FileEditAction { + const data = range.marker?.data as { r: string } | undefined; + return { + filePath: range.fileName, + replacementText: (replacementText ?? data?.r ?? 'N/A').replace(/!n!/g, '\n'), + range: state.convertPositionRange(range), + }; +} + export function verifyEdits( state: TestState, fileEditActions: FileEditActions, @@ -26,20 +41,18 @@ export function verifyEdits( replacementText: string | undefined ) { for (const edit of fileEditActions.edits) { + const expected: FileEditAction[] = ranges.map((r) => convertRangeToFileEditAction(state, r, replacementText)); assert( - ranges.some((r) => { - const data = r.marker?.data as { r: string } | undefined; - const expectedText = replacementText ?? data?.r ?? 'N/A'; - const expectedRange = state.convertPositionRange(r); + expected.some((a) => { return ( - r.fileName === edit.filePath && - rangesAreEqual(expectedRange, edit.range) && - expectedText.replace(/!n!/g, '\n') === edit.replacementText + a.filePath === edit.filePath && + rangesAreEqual(a.range, edit.range) && + a.replacementText === edit.replacementText ); }), - `can't find '${replacementText ?? edit.replacementText}'@'${edit.filePath}:(${edit.range.start.line},${ - edit.range.start.character - })'` + `can't find ${convertFileEditActionToString(edit)} in ${expected + .map((a) => convertFileEditActionToString(a)) + .join('|')}` ); } } @@ -106,18 +119,11 @@ function _applyEdits(state: TestState, filePath: string, edits: FileEditAction[] const sourceFile = state.program.getBoundSourceFile(filePath)!; const parseResults = sourceFile.getParseResults()!; - const editsWithOffset = edits - .map((e) => ({ - range: convertRangeToTextRange(e.range, parseResults.tokenizerOutput.lines)!, - text: e.replacementText, - })) - .sort((e1, e2) => e2.range.start - e1.range.start); - - // Apply change in reverse order. - let current = parseResults.text; - for (const change of editsWithOffset) { - current = current.substr(0, change.range.start) + change.text + current.substr(TextRange.getEnd(change.range)); - } + const current = applyTextEditsToString( + edits.filter((e) => e.filePath === filePath), + parseResults.tokenizerOutput.lines, + parseResults.text + ); return { version: sourceFile.getClientVersion(), text: current }; } diff --git a/packages/pyright-internal/src/tests/testUtils.ts b/packages/pyright-internal/src/tests/testUtils.ts index a2f23ec31..d5c7d1520 100644 --- a/packages/pyright-internal/src/tests/testUtils.ts +++ b/packages/pyright-internal/src/tests/testUtils.ts @@ -19,6 +19,7 @@ import { IPythonMode } from '../analyzer/sourceFile'; import { NameTypeWalker } from '../analyzer/testWalker'; import { TypeEvaluator } from '../analyzer/typeEvaluatorTypes'; import { cloneDiagnosticRuleSet, ConfigOptions, ExecutionEnvironment } from '../common/configOptions'; +import { ConsoleWithLogLevel } from '../common/console'; import { fail } from '../common/debug'; import { Diagnostic, DiagnosticCategory } from '../common/diagnostic'; import { DiagnosticSink, TextRangeDiagnosticSink } from '../common/diagnosticSink'; @@ -105,7 +106,7 @@ export function buildAnalyzerFileInfo( const fileInfo: AnalyzerFileInfo = { importLookup: (_) => undefined, - futureImports: new Map(), + futureImports: new Set(), builtinsScope: undefined, diagnosticSink: analysisDiagnostics, executionEnvironment: configOptions.findExecEnvironment(filePath), @@ -152,7 +153,8 @@ export function bindSampleFile(fileName: string, configOptions = new ConfigOptio export function typeAnalyzeSampleFiles( fileNames: string[], - configOptions = new ConfigOptions('.') + configOptions = new ConfigOptions('.'), + console?: ConsoleWithLogLevel ): FileAnalysisResult[] { // Always enable "test mode". configOptions.internalTestMode = true; @@ -160,7 +162,7 @@ export function typeAnalyzeSampleFiles( const fs = createFromRealFileSystem(); const importResolver = new ImportResolver(fs, configOptions, new FullAccessHost(fs)); - const program = new Program(importResolver, configOptions); + const program = new Program(importResolver, configOptions, console); const filePaths = fileNames.map((name) => resolveSampleFilePath(name)); program.setTrackedFiles(filePaths); @@ -172,6 +174,20 @@ export function typeAnalyzeSampleFiles( nameTypeWalker.walk(parseResults.parseTree); }); + const results = getAnalysisResults(program, filePaths, configOptions); + + program.dispose(); + return results; +} + +export function getAnalysisResults( + program: Program, + filePaths: string[], + configOptions = new ConfigOptions('.') +): FileAnalysisResult[] { + // Always enable "test mode". + configOptions.internalTestMode = true; + while (program.analyze()) { // Continue to call analyze until it completes. Since we're not // specifying a timeout, it should complete the first time. diff --git a/packages/pyright-internal/src/tests/textEditUtil.test.ts b/packages/pyright-internal/src/tests/textEditUtil.test.ts new file mode 100644 index 000000000..01b207356 --- /dev/null +++ b/packages/pyright-internal/src/tests/textEditUtil.test.ts @@ -0,0 +1,137 @@ +/* + * textEditUtil.test.ts + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT license. + */ + +import assert from 'assert'; +import { CancellationToken } from 'vscode-jsonrpc'; + +import { FileEditAction } from '../common/editAction'; +import { TextEditTracker } from '../common/textEditTracker'; +import { Range } from './harness/fourslash/fourSlashTypes'; +import { parseAndGetTestState, TestState } from './harness/fourslash/testState'; +import { convertRangeToFileEditAction } from './testStateUtils'; + +test('simple add', () => { + const code = ` +//// import [|{|"r":"bar"|}foo|] + `; + + verifyEdits(code); +}); + +test('multiple edits', () => { + const code = ` +//// import [|{|"r":"bar"|}foo|][|{|"r":"!n!import os"|}|] + `; + + verifyEdits(code); +}); + +test('delete and add', () => { + const code = ` +//// [|{|"r":""|}import foo|][|{|"r":"import os"|}|] + `; + + verifyEdits(code); +}); + +test('overlapped delete', () => { + const code = ` +//// [|{|"e":""|}[|{|"r":""|}import [|{|"r":""|}foo|]|]|] + `; + + verifyEdits(code); +}); + +test('overlapped delete and add', () => { + const code = ` +//// [|{|"r":""|}import foo[|{|"r":"!n!import os"|}|] +//// |] + `; + + verifyEdits(code); +}); + +test('dup with same range', () => { + const code = ` +//// [|{|"e":"import os"|}[|{|"r":"import os"|}[|{|"r":"import os"|}import foo|]|]|] + `; + + verifyEdits(code); +}); + +test('delete and add with merge', () => { + const code = ` +//// [|{|"e":"import os"|}[|{|"r":""|}import foo|][|{|"r":"import os"|}|]|] + `; + + verifyEdits(code, false); +}); + +test('overlapped delete with merge', () => { + const code = ` +//// [|{|"e":""|}[|{|"r":""|}import [|{|"r":""|}foo|]|]|] + `; + + verifyEdits(code, false); +}); + +test('overlapped delete and add with merge', () => { + const code = ` +//// [|{|"e":"!n!import os"|}[|{|"r":""|}import foo[|{|"r":"!n!import os"|}|] +//// |]|] + `; + + verifyEdits(code, false); +}); + +test('dup with overlapped range', () => { + const code = ` +//// [|{|"e":"import os"|}[|{|"r":""|}import sys!n!|][|{|"r":"import os"|}[|{|"r":"import os"|}import foo|]|]|] + `; + + verifyEdits(code, false); +}); + +function verifyEdits(code: string, mergeOnlyDuplications = true) { + const state = parseAndGetTestState(code).state; + const tracker = new TextEditTracker(mergeOnlyDuplications); + + const ranges = state.getRanges(); + const changeRanges = _getChangeRanges(ranges); + for (const range of changeRanges) { + const edit = convertRangeToFileEditAction(state, range); + tracker.addEdit(edit.filePath, edit.range, edit.replacementText); + } + + const edits = tracker.getEdits(CancellationToken.None); + + const editRanges = _getEditRanges(ranges); + assert.strictEqual(edits.length, editRanges.length); + assert( + _areEqual( + edits, + editRanges.map((r) => _createFileActionEdit(state, r)) + ) + ); +} + +function _getChangeRanges(ranges: Range[]) { + return ranges.filter((r) => r.marker?.data && (r.marker.data as { r: string }).r !== undefined); +} + +function _getEditRanges(ranges: Range[]) { + const editRanges = ranges.filter((r) => r.marker?.data && (r.marker.data as { e: string }).e !== undefined); + return editRanges.length > 0 ? editRanges : _getChangeRanges(ranges); +} + +function _areEqual(a1: FileEditAction[], a2: FileEditAction[]) { + return a1.some((e1) => a2.some((e2) => FileEditAction.areEqual(e1, e2))); +} + +function _createFileActionEdit(state: TestState, range: Range): FileEditAction { + const replacementText = (range.marker!.data as { e: string }).e; + return convertRangeToFileEditAction(state, range, replacementText); +} diff --git a/packages/pyright-internal/src/tests/tokenizer.test.ts b/packages/pyright-internal/src/tests/tokenizer.test.ts index 0828b6950..66e6f61fb 100644 --- a/packages/pyright-internal/src/tests/tokenizer.test.ts +++ b/packages/pyright-internal/src/tests/tokenizer.test.ts @@ -330,16 +330,19 @@ test('IndentDedent', () => { assert.equal(results.tokens.getItemAt(1).type, TokenType.NewLine); assert.equal(results.tokens.getItemAt(2).type, TokenType.Indent); assert.equal((results.tokens.getItemAt(2) as IndentToken).indentAmount, 2); + assert.equal((results.tokens.getItemAt(2) as IndentToken).length, 2); assert.equal(results.tokens.getItemAt(3).type, TokenType.Identifier); assert.equal(results.tokens.getItemAt(4).type, TokenType.NewLine); assert.equal(results.tokens.getItemAt(5).type, TokenType.Identifier); assert.equal(results.tokens.getItemAt(6).type, TokenType.NewLine); assert.equal(results.tokens.getItemAt(7).type, TokenType.Indent); assert.equal((results.tokens.getItemAt(7) as IndentToken).indentAmount, 8); + assert.equal((results.tokens.getItemAt(7) as IndentToken).length, 3); assert.equal(results.tokens.getItemAt(8).type, TokenType.Identifier); assert.equal(results.tokens.getItemAt(9).type, TokenType.NewLine); assert.equal(results.tokens.getItemAt(10).type, TokenType.Indent); assert.equal((results.tokens.getItemAt(10) as IndentToken).isIndentAmbiguous, true); + assert.equal((results.tokens.getItemAt(10) as IndentToken).length, 1); assert.equal(results.tokens.getItemAt(11).type, TokenType.Identifier); assert.equal(results.tokens.getItemAt(12).type, TokenType.NewLine); assert.equal(results.tokens.getItemAt(13).type, TokenType.Dedent); @@ -1123,8 +1126,8 @@ test('Decimal number operator', () => { test('Floating point number', () => { const t = new Tokenizer(); - const results = t.tokenize('3.0 .2 ++.3e+12 --.4e1 1e-4 0.01'); - assert.equal(results.tokens.count, 10 + _implicitTokenCount); + const results = t.tokenize('3.0 .2 ++.3e+12 --.4e1 1e-4 0.01 01.0'); + assert.equal(results.tokens.count, 11 + _implicitTokenCount); assert.equal(results.tokens.getItemAt(0).type, TokenType.Number); assert.equal((results.tokens.getItemAt(0) as NumberToken).value, 3); @@ -1167,6 +1170,11 @@ test('Floating point number', () => { assert.equal((results.tokens.getItemAt(9) as NumberToken).value, 0.01); assert.equal((results.tokens.getItemAt(9) as NumberToken).isInteger, false); assert.equal(results.tokens.getItemAt(9).length, 4); + + assert.equal(results.tokens.getItemAt(10).type, TokenType.Number); + assert.equal((results.tokens.getItemAt(10) as NumberToken).value, 1.0); + assert.equal((results.tokens.getItemAt(10) as NumberToken).isInteger, false); + assert.equal(results.tokens.getItemAt(10).length, 4); }); test('Floating point numbers with parens', () => { diff --git a/packages/pyright-internal/src/tests/typeEvaluator1.test.ts b/packages/pyright-internal/src/tests/typeEvaluator1.test.ts index a20bbcec7..aae3233bd 100644 --- a/packages/pyright-internal/src/tests/typeEvaluator1.test.ts +++ b/packages/pyright-internal/src/tests/typeEvaluator1.test.ts @@ -40,6 +40,7 @@ test('Builtins1', () => { 'AssertionError', 'AttributeError', 'BaseException', + 'BaseExceptionGroup', 'BlockingIOError', 'BrokenPipeError', 'BufferError', @@ -55,6 +56,7 @@ test('Builtins1', () => { 'EncodingWarning', 'EnvironmentError', 'Exception', + 'ExceptionGroup', 'FileExistsError', 'FileNotFoundError', 'FloatingPointError', @@ -225,6 +227,11 @@ test('Builtins1', () => { } }); +test('Builtins2', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['builtins2.py']); + TestUtils.validateResults(analysisResults, 0); +}); + test('Complex1', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['complex1.py']); TestUtils.validateResults(analysisResults, 0); @@ -290,6 +297,12 @@ test('TypeNarrowingTypeIs1', () => { TestUtils.validateResults(analysisResults, 3); }); +test('TypeNarrowingTypeEquals1', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typeNarrowingTypeEquals1.py']); + + TestUtils.validateResults(analysisResults, 3); +}); + test('TypeNarrowingIsNone1', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typeNarrowingIsNone1.py']); @@ -314,6 +327,12 @@ test('TypeNarrowingIsNoneTuple2', () => { TestUtils.validateResults(analysisResults, 0); }); +test('TypeNarrowingIsEllipsis1', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typeNarrowingIsEllipsis1.py']); + + TestUtils.validateResults(analysisResults, 0); +}); + test('TypeNarrowingLiteral1', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typeNarrowingLiteral1.py']); @@ -386,6 +405,18 @@ test('TypeNarrowingIsinstance10', () => { TestUtils.validateResults(analysisResults, 0); }); +test('TypeNarrowingIsinstance11', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typeNarrowingIsinstance11.py']); + + TestUtils.validateResults(analysisResults, 0); +}); + +test('TypeNarrowingIsinstance12', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typeNarrowingIsinstance12.py']); + + TestUtils.validateResults(analysisResults, 0); +}); + test('TypeNarrowingTupleLength1', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typeNarrowingTupleLength1.py']); @@ -398,6 +429,12 @@ test('TypeNarrowingIn1', () => { TestUtils.validateResults(analysisResults, 2); }); +test('TypeNarrowingIn2', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typeNarrowingIn2.py']); + + TestUtils.validateResults(analysisResults, 0); +}); + test('TypeNarrowingLiteralMember1', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typeNarrowingLiteralMember1.py']); @@ -570,6 +607,14 @@ test('Unpack4', () => { TestUtils.validateResults(analysisResults39, 1); }); +test('Unpack4', () => { + const configOptions = new ConfigOptions('.'); + + configOptions.defaultPythonVersion = PythonVersion.V3_11; + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['unpack5.py'], configOptions); + TestUtils.validateResults(analysisResults, 0); +}); + test('Lambda1', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['lambda1.py']); @@ -606,6 +651,24 @@ test('Lambda6', () => { TestUtils.validateResults(analysisResults, 1); }); +test('Lambda7', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['lambda7.py']); + + TestUtils.validateResults(analysisResults, 0); +}); + +test('Lambda8', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['lambda8.py']); + + TestUtils.validateResults(analysisResults, 0); +}); + +test('Lambda9', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['lambda9.py']); + + TestUtils.validateResults(analysisResults, 0); +}); + test('Call1', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['call1.py']); @@ -615,7 +678,7 @@ test('Call1', () => { test('Call2', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['call2.py']); - TestUtils.validateResults(analysisResults, 12); + TestUtils.validateResults(analysisResults, 13); }); test('Call3', () => { @@ -624,12 +687,12 @@ test('Call3', () => { // Analyze with Python 3.7 settings. This will generate more errors. configOptions.defaultPythonVersion = PythonVersion.V3_7; const analysisResults37 = TestUtils.typeAnalyzeSampleFiles(['call3.py'], configOptions); - TestUtils.validateResults(analysisResults37, 32); + TestUtils.validateResults(analysisResults37, 36); // Analyze with Python 3.8 settings. configOptions.defaultPythonVersion = PythonVersion.V3_8; const analysisResults38 = TestUtils.typeAnalyzeSampleFiles(['call3.py'], configOptions); - TestUtils.validateResults(analysisResults38, 18); + TestUtils.validateResults(analysisResults38, 20); }); test('Call4', () => { @@ -656,6 +719,18 @@ test('Call7', () => { TestUtils.validateResults(analysisResults, 4); }); +test('Call8', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['call8.py']); + + TestUtils.validateResults(analysisResults, 0); +}); + +test('Call9', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['call9.py']); + + TestUtils.validateResults(analysisResults, 1); +}); + test('Function1', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['function1.py']); @@ -716,6 +791,12 @@ test('Function11', () => { TestUtils.validateResults(analysisResults, 0); }); +test('Function12', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['function12.py']); + + TestUtils.validateResults(analysisResults, 0); +}); + test('KwargsUnpack1', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['kwargsUnpack1.py']); @@ -743,7 +824,7 @@ test('FunctionMember2', () => { test('Annotations1', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['annotations1.py']); - TestUtils.validateResults(analysisResults, 9); + TestUtils.validateResults(analysisResults, 11); }); test('Annotations2', () => { @@ -871,6 +952,12 @@ test('CodeFlow7', () => { TestUtils.validateResults(analysisResults, 0); }); +test('CodeFlow8', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['codeFlow8.py']); + + TestUtils.validateResults(analysisResults, 0); +}); + test('CapturedVariable1', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['capturedVariable1.py']); @@ -963,6 +1050,12 @@ test('Properties13', () => { TestUtils.validateResults(analysisResults, 0); }); +test('Properties14', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['properties14.py']); + + TestUtils.validateResults(analysisResults, 0); +}); + test('Operators1', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['operators1.py']); @@ -1005,6 +1098,18 @@ test('Operators8', () => { TestUtils.validateResults(analysisResults, 0); }); +test('Operators9', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['operators9.py']); + + TestUtils.validateResults(analysisResults, 0); +}); + +test('Operators10', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['operators10.py']); + + TestUtils.validateResults(analysisResults, 1); +}); + test('Optional1', () => { const configOptions = new ConfigOptions('.'); @@ -1143,6 +1248,12 @@ test('Tuples16', () => { TestUtils.validateResults(analysisResults, 0); }); +test('Tuples17', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['tuples17.py']); + + TestUtils.validateResults(analysisResults, 0); +}); + test('NamedTuples1', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['namedTuples1.py']); @@ -1245,6 +1356,24 @@ test('Self5', () => { TestUtils.validateResults(analysisResults, 0); }); +test('Self6', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['self6.py']); + + TestUtils.validateResults(analysisResults, 0); +}); + +test('Self7', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['self7.py']); + + TestUtils.validateResults(analysisResults, 1); +}); + +test('Self8', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['self8.py']); + + TestUtils.validateResults(analysisResults, 0); +}); + test('UnusedVariable1', () => { const configOptions = new ConfigOptions('.'); @@ -1281,6 +1410,12 @@ test('Partial2', () => { TestUtils.validateResults(analysisResults, 0); }); +test('Partial3', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['partial3.py']); + + TestUtils.validateResults(analysisResults, 0); +}); + test('TotalOrdering1', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['totalOrdering1.py']); @@ -1290,7 +1425,7 @@ test('TotalOrdering1', () => { test('TupleUnpack1', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['tupleUnpack1.py']); - TestUtils.validateResults(analysisResults, 5); + TestUtils.validateResults(analysisResults, 6); }); test('TupleUnpack2', () => { @@ -1322,7 +1457,7 @@ test('PseudoGeneric1', () => { test('LiteralString1', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['literalString1.py']); - TestUtils.validateResults(analysisResults, 7); + TestUtils.validateResults(analysisResults, 8); }); test('LiteralString2', () => { @@ -1331,6 +1466,12 @@ test('LiteralString2', () => { TestUtils.validateResults(analysisResults, 0); }); +test('LiteralString3', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['literalString3.py']); + + TestUtils.validateResults(analysisResults, 0); +}); + test('ParamInference1', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['paramInference1.py']); @@ -1368,13 +1509,13 @@ test('StaticExpressions1', () => { configOptions.defaultPythonPlatform = 'windows'; const analysisResults1 = TestUtils.typeAnalyzeSampleFiles(['staticExpressions1.py'], configOptions); - TestUtils.validateResults(analysisResults1, 6); + TestUtils.validateResults(analysisResults1, 9); configOptions.defaultPythonVersion = PythonVersion.V3_11; configOptions.defaultPythonPlatform = 'Linux'; const analysisResults2 = TestUtils.typeAnalyzeSampleFiles(['staticExpressions1.py'], configOptions); - TestUtils.validateResults(analysisResults2, 3); + TestUtils.validateResults(analysisResults2, 6); configOptions.defineConstant.set('DEFINED_TRUE', true); configOptions.defineConstant.set('DEFINED_FALSE', false); @@ -1382,3 +1523,9 @@ test('StaticExpressions1', () => { const analysisResults3 = TestUtils.typeAnalyzeSampleFiles(['staticExpressions1.py'], configOptions); TestUtils.validateResults(analysisResults3, 0); }); + +test('SpecialForm1', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['specialForm1.py']); + + TestUtils.validateResults(analysisResults, 4); +}); diff --git a/packages/pyright-internal/src/tests/typeEvaluator2.test.ts b/packages/pyright-internal/src/tests/typeEvaluator2.test.ts index 7d1a482cc..771ab164e 100644 --- a/packages/pyright-internal/src/tests/typeEvaluator2.test.ts +++ b/packages/pyright-internal/src/tests/typeEvaluator2.test.ts @@ -15,7 +15,7 @@ import * as TestUtils from './testUtils'; test('CallbackProtocol1', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['callbackProtocol1.py']); - TestUtils.validateResults(analysisResults, 8); + TestUtils.validateResults(analysisResults, 9); }); test('CallbackProtocol2', () => { @@ -60,6 +60,12 @@ test('CallbackProtocol8', () => { TestUtils.validateResults(analysisResults, 0); }); +test('CallbackProtocol9', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['callbackProtocol9.py']); + + TestUtils.validateResults(analysisResults, 2); +}); + test('Assignment1', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['assignment1.py']); @@ -120,6 +126,23 @@ test('Assignment10', () => { TestUtils.validateResults(analysisResults, 0); }); +test('Assignment11', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['assignment11.py']); + + TestUtils.validateResults(analysisResults, 2); +}); + +test('Assignment12', () => { + const configOptions = new ConfigOptions('.'); + + const analysisResults1 = TestUtils.typeAnalyzeSampleFiles(['assignment12.py'], configOptions); + TestUtils.validateResults(analysisResults1, 0); + + configOptions.diagnosticRuleSet.reportUnknownVariableType = 'error'; + const analysisResults2 = TestUtils.typeAnalyzeSampleFiles(['assignment12.py'], configOptions); + TestUtils.validateResults(analysisResults2, 2); +}); + test('AugmentedAssignment1', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['augmentedAssignment1.py']); @@ -192,6 +215,12 @@ test('Super9', () => { TestUtils.validateResults(analysisResults, 0); }); +test('Super10', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['super10.py']); + + TestUtils.validateResults(analysisResults, 0); +}); + test('MissingSuper1', () => { const configOptions = new ConfigOptions('.'); @@ -206,7 +235,7 @@ test('MissingSuper1', () => { test('NewType1', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['newType1.py']); - TestUtils.validateResults(analysisResults, 1); + TestUtils.validateResults(analysisResults, 6); }); test('NewType2', () => { @@ -945,7 +974,7 @@ test('GenericTypes93', () => { test('GenericTypes94', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['genericTypes94.py']); - TestUtils.validateResults(analysisResults, 0); + TestUtils.validateResults(analysisResults, 2); }); test('GenericTypes95', () => { @@ -954,6 +983,60 @@ test('GenericTypes95', () => { TestUtils.validateResults(analysisResults, 0); }); +test('GenericTypes96', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['genericTypes96.py']); + + TestUtils.validateResults(analysisResults, 0); +}); + +test('GenericTypes97', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['genericTypes97.py']); + + TestUtils.validateResults(analysisResults, 18); +}); + +test('GenericTypes98', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['genericTypes98.py']); + + TestUtils.validateResults(analysisResults, 0); +}); + +test('GenericTypes99', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['genericTypes99.py']); + + TestUtils.validateResults(analysisResults, 0); +}); + +test('GenericTypes100', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['genericTypes100.py']); + + TestUtils.validateResults(analysisResults, 2); +}); + +test('GenericTypes101', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['genericTypes101.py']); + + TestUtils.validateResults(analysisResults, 0); +}); + +test('GenericTypes102', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['genericTypes102.py']); + + TestUtils.validateResults(analysisResults, 0); +}); + +test('GenericTypes103', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['genericTypes103.py']); + + TestUtils.validateResults(analysisResults, 0); +}); + +test('GenericTypes104', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['genericTypes104.py']); + + TestUtils.validateResults(analysisResults, 1); +}); + test('Protocol1', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocol1.py']); @@ -975,7 +1058,7 @@ test('Protocol3', () => { test('Protocol4', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocol4.py']); - TestUtils.validateResults(analysisResults, 2); + TestUtils.validateResults(analysisResults, 3); }); test('Protocol5', () => { @@ -987,7 +1070,7 @@ test('Protocol5', () => { test('Protocol6', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocol6.py']); - TestUtils.validateResults(analysisResults, 2); + TestUtils.validateResults(analysisResults, 3); }); test('Protocol7', () => { @@ -1168,6 +1251,24 @@ test('Protocol35', () => { TestUtils.validateResults(analysisResults, 1); }); +test('Protocol36', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocol36.py']); + + TestUtils.validateResults(analysisResults, 0); +}); + +test('Protocol37', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocol37.py']); + + TestUtils.validateResults(analysisResults, 0); +}); + +test('Protocol38', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocol38.py']); + + TestUtils.validateResults(analysisResults, 0); +}); + test('TypedDict1', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typedDict1.py']); @@ -1237,7 +1338,7 @@ test('TypedDict11', () => { test('TypedDict12', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typedDict12.py']); - TestUtils.validateResults(analysisResults, 4); + TestUtils.validateResults(analysisResults, 6); }); test('TypedDict13', () => { @@ -1273,7 +1374,7 @@ test('TypedDict17', () => { test('TypedDict18', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typedDict18.py']); - TestUtils.validateResults(analysisResults, 2); + TestUtils.validateResults(analysisResults, 3); }); test('TypedDict19', () => { @@ -1293,3 +1394,15 @@ test('TypedDict21', () => { TestUtils.validateResults(analysisResults, 1); }); + +test('TypedDict22', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typedDict22.py']); + + TestUtils.validateResults(analysisResults, 0); +}); + +test('TypedDictInline1', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typedDictInline1.py']); + + TestUtils.validateResults(analysisResults, 8); +}); diff --git a/packages/pyright-internal/src/tests/typeEvaluator3.test.ts b/packages/pyright-internal/src/tests/typeEvaluator3.test.ts index 5939380bc..6f3cdac9d 100644 --- a/packages/pyright-internal/src/tests/typeEvaluator3.test.ts +++ b/packages/pyright-internal/src/tests/typeEvaluator3.test.ts @@ -120,6 +120,12 @@ test('Generators15', () => { TestUtils.validateResults(analysisResults, 3); }); +test('Generators16', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['generators16.py']); + + TestUtils.validateResults(analysisResults, 1); +}); + test('Await1', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['await1.py']); @@ -133,7 +139,12 @@ test('Await2', () => { }); test('Coroutines1', () => { - const analysisResults = TestUtils.typeAnalyzeSampleFiles(['coroutines1.py']); + const configOptions = new ConfigOptions('.'); + + // This functionality is deprecated in Python 3.11, so the type no longer + // exists in typing.pyi after that point. + configOptions.defaultPythonVersion = PythonVersion.V3_10; + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['coroutines1.py'], configOptions); TestUtils.validateResults(analysisResults, 4); }); @@ -317,6 +328,60 @@ test('Loops27', () => { TestUtils.validateResults(analysisResults, 0); }); +test('Loops28', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['loops28.py']); + + TestUtils.validateResults(analysisResults, 0); +}); + +test('Loops29', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['loops29.py']); + + TestUtils.validateResults(analysisResults, 0); +}); + +test('Loops30', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['loops30.py']); + + TestUtils.validateResults(analysisResults, 0); +}); + +test('Loops31', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['loops31.py']); + + TestUtils.validateResults(analysisResults, 1); +}); + +test('Loops32', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['loops32.py']); + + TestUtils.validateResults(analysisResults, 0); +}); + +test('Loops33', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['loops33.py']); + + TestUtils.validateResults(analysisResults, 0); +}); + +test('Loops34', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['loops34.py']); + + TestUtils.validateResults(analysisResults, 0); +}); + +test('Loops35', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['loops35.py']); + + TestUtils.validateResults(analysisResults, 0); +}); + +test('Loops36', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['loops36.py']); + + TestUtils.validateResults(analysisResults, 0); +}); + test('ForLoop1', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['forLoop1.py']); @@ -377,6 +442,12 @@ test('ListComprehension8', () => { TestUtils.validateResults(analysisResults, 0); }); +test('ListComprehension9', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['listComprehension9.py']); + + TestUtils.validateResults(analysisResults, 0); +}); + test('SetComprehension1', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['setComprehension1.py']); @@ -448,23 +519,23 @@ test('TypeAlias4', () => { configOptions.defaultPythonVersion = PythonVersion.V3_9; const analysisResults3_9 = TestUtils.typeAnalyzeSampleFiles(['typeAlias4.py'], configOptions); - TestUtils.validateResults(analysisResults3_9, 8); + TestUtils.validateResults(analysisResults3_9, 1); configOptions.defaultPythonVersion = PythonVersion.V3_10; const analysisResults3_10 = TestUtils.typeAnalyzeSampleFiles(['typeAlias4.py'], configOptions); - TestUtils.validateResults(analysisResults3_10, 7); + TestUtils.validateResults(analysisResults3_10, 11); }); test('TypeAlias5', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typeAlias5.py']); - TestUtils.validateResults(analysisResults, 3); + TestUtils.validateResults(analysisResults, 4); }); test('TypeAlias6', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typeAlias6.py']); - TestUtils.validateResults(analysisResults, 6); + TestUtils.validateResults(analysisResults, 5); }); test('TypeAlias7', () => { @@ -482,7 +553,7 @@ test('TypeAlias8', () => { test('TypeAlias9', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typeAlias9.py']); - TestUtils.validateResults(analysisResults, 3); + TestUtils.validateResults(analysisResults, 4); }); test('TypeAlias10', () => { @@ -527,10 +598,33 @@ test('TypeAlias16', () => { TestUtils.validateResults(analysisResults, 0); }); +test('TypeAlias17', () => { + const configOptions = new ConfigOptions('.'); + + const analysisResults1 = TestUtils.typeAnalyzeSampleFiles(['typeAlias17.py'], configOptions); + TestUtils.validateResults(analysisResults1, 4); + + configOptions.diagnosticRuleSet.reportMissingTypeArgument = 'error'; + const analysisResults2 = TestUtils.typeAnalyzeSampleFiles(['typeAlias17.py'], configOptions); + TestUtils.validateResults(analysisResults2, 8); +}); + +test('TypeAlias18', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typeAlias18.py']); + + TestUtils.validateResults(analysisResults, 4); +}); + +test('TypeAlias20', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typeAlias20.py']); + + TestUtils.validateResults(analysisResults, 0); +}); + test('RecursiveTypeAlias1', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['recursiveTypeAlias1.py']); - TestUtils.validateResults(analysisResults, 14); + TestUtils.validateResults(analysisResults, 13); }); test('RecursiveTypeAlias2', () => { @@ -557,7 +651,7 @@ test('RecursiveTypeAlias4', () => { test('RecursiveTypeAlias5', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['recursiveTypeAlias5.pyi']); - TestUtils.validateResults(analysisResults, 2); + TestUtils.validateResults(analysisResults, 0); }); test('RecursiveTypeAlias6', () => { @@ -584,6 +678,30 @@ test('RecursiveTypeAlias9', () => { TestUtils.validateResults(analysisResults, 0); }); +test('RecursiveTypeAlias10', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['recursiveTypeAlias10.py']); + + TestUtils.validateResults(analysisResults, 1); +}); + +test('RecursiveTypeAlias11', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['recursiveTypeAlias11.py']); + + TestUtils.validateResults(analysisResults, 0); +}); + +test('RecursiveTypeAlias12', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['recursiveTypeAlias12.py']); + + TestUtils.validateResults(analysisResults, 0); +}); + +test('RecursiveTypeAlias13', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['recursiveTypeAlias13.py']); + + TestUtils.validateResults(analysisResults, 0); +}); + test('Classes1', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['classes1.py']); @@ -633,6 +751,18 @@ test('Classes8', () => { TestUtils.validateResults(analysisResults, 0); }); +test('Classes9', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['classes9.py']); + + TestUtils.validateResults(analysisResults, 1); +}); + +test('Methods1', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['methods1.py']); + + TestUtils.validateResults(analysisResults, 0); +}); + test('MethodOverride1', () => { const configOptions = new ConfigOptions('.'); @@ -643,7 +773,7 @@ test('MethodOverride1', () => { // Turn on errors. configOptions.diagnosticRuleSet.reportIncompatibleMethodOverride = 'error'; analysisResults = TestUtils.typeAnalyzeSampleFiles(['methodOverride1.py'], configOptions); - TestUtils.validateResults(analysisResults, 34); + TestUtils.validateResults(analysisResults, 35); }); test('MethodOverride2', () => { @@ -677,6 +807,14 @@ test('MethodOverride4', () => { TestUtils.validateResults(analysisResults, 0); }); +test('MethodOverride5', () => { + const configOptions = new ConfigOptions('.'); + + configOptions.defaultPythonVersion = PythonVersion.V3_11; + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['methodOverride5.py'], configOptions); + TestUtils.validateResults(analysisResults, 0); +}); + test('Enums1', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['enums1.py']); @@ -731,10 +869,16 @@ test('Enums9', () => { TestUtils.validateResults(analysisResults, 0); }); +test('Enums10', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['enums10.py']); + + TestUtils.validateResults(analysisResults, 0); +}); + test('TypeGuard1', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typeGuard1.py']); - TestUtils.validateResults(analysisResults, 5); + TestUtils.validateResults(analysisResults, 7); }); test('TypeGuard2', () => { @@ -758,13 +902,13 @@ test('TypeGuard4', () => { test('Never1', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['never1.py']); - TestUtils.validateResults(analysisResults, 0); + TestUtils.validateResults(analysisResults, 5); }); test('Never2', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['never2.py']); - TestUtils.validateResults(analysisResults, 4); + TestUtils.validateResults(analysisResults, 1); }); test('TypePromotions1', () => { @@ -812,7 +956,7 @@ test('VariadicTypeVar3', () => { configOptions.defaultPythonVersion = PythonVersion.V3_11; const analysisResults = TestUtils.typeAnalyzeSampleFiles(['variadicTypeVar3.py'], configOptions); - TestUtils.validateResults(analysisResults, 7); + TestUtils.validateResults(analysisResults, 5); }); test('VariadicTypeVar4', () => { @@ -820,7 +964,7 @@ test('VariadicTypeVar4', () => { configOptions.defaultPythonVersion = PythonVersion.V3_11; const analysisResults = TestUtils.typeAnalyzeSampleFiles(['variadicTypeVar4.py'], configOptions); - TestUtils.validateResults(analysisResults, 4); + TestUtils.validateResults(analysisResults, 3); }); test('VariadicTypeVar5', () => { @@ -852,7 +996,7 @@ test('VariadicTypeVar8', () => { configOptions.defaultPythonVersion = PythonVersion.V3_11; const analysisResults = TestUtils.typeAnalyzeSampleFiles(['variadicTypeVar8.py'], configOptions); - TestUtils.validateResults(analysisResults, 4); + TestUtils.validateResults(analysisResults, 5); }); test('VariadicTypeVar9', () => { @@ -876,7 +1020,7 @@ test('VariadicTypeVar11', () => { configOptions.defaultPythonVersion = PythonVersion.V3_11; const analysisResults = TestUtils.typeAnalyzeSampleFiles(['variadicTypeVar11.py'], configOptions); - TestUtils.validateResults(analysisResults, 4); + TestUtils.validateResults(analysisResults, 3); }); test('VariadicTypeVar12', () => { @@ -903,6 +1047,70 @@ test('VariadicTypeVar14', () => { TestUtils.validateResults(analysisResults, 6); }); +test('VariadicTypeVar15', () => { + const configOptions = new ConfigOptions('.'); + + configOptions.defaultPythonVersion = PythonVersion.V3_11; + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['variadicTypeVar15.py'], configOptions); + TestUtils.validateResults(analysisResults, 0); +}); + +test('VariadicTypeVar16', () => { + const configOptions = new ConfigOptions('.'); + + configOptions.defaultPythonVersion = PythonVersion.V3_11; + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['variadicTypeVar16.py'], configOptions); + TestUtils.validateResults(analysisResults, 0); +}); + +test('VariadicTypeVar17', () => { + const configOptions = new ConfigOptions('.'); + + configOptions.defaultPythonVersion = PythonVersion.V3_11; + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['variadicTypeVar17.py'], configOptions); + TestUtils.validateResults(analysisResults, 0); +}); + +test('VariadicTypeVar18', () => { + const configOptions = new ConfigOptions('.'); + + configOptions.defaultPythonVersion = PythonVersion.V3_11; + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['variadicTypeVar18.py'], configOptions); + TestUtils.validateResults(analysisResults, 2); +}); + +test('VariadicTypeVar19', () => { + const configOptions = new ConfigOptions('.'); + + configOptions.defaultPythonVersion = PythonVersion.V3_11; + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['variadicTypeVar19.py'], configOptions); + TestUtils.validateResults(analysisResults, 0); +}); + +test('VariadicTypeVar20', () => { + const configOptions = new ConfigOptions('.'); + + configOptions.defaultPythonVersion = PythonVersion.V3_11; + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['variadicTypeVar20.py'], configOptions); + TestUtils.validateResults(analysisResults, 0); +}); + +test('VariadicTypeVar21', () => { + const configOptions = new ConfigOptions('.'); + + configOptions.defaultPythonVersion = PythonVersion.V3_11; + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['variadicTypeVar21.py'], configOptions); + TestUtils.validateResults(analysisResults, 0); +}); + +test('VariadicTypeVar22', () => { + const configOptions = new ConfigOptions('.'); + + configOptions.defaultPythonVersion = PythonVersion.V3_11; + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['variadicTypeVar22.py'], configOptions); + TestUtils.validateResults(analysisResults, 2); +}); + test('Match1', () => { const configOptions = new ConfigOptions('.'); @@ -988,9 +1196,21 @@ test('Match10', () => { TestUtils.validateResults(analysisResults2, 4); }); +test('Match11', () => { + const configOptions = new ConfigOptions('.'); + + configOptions.defaultPythonVersion = PythonVersion.V3_10; + const analysisResults1 = TestUtils.typeAnalyzeSampleFiles(['match11.py'], configOptions); + TestUtils.validateResults(analysisResults1, 0); + + configOptions.diagnosticRuleSet.reportUnnecessaryComparison = 'error'; + const analysisResults2 = TestUtils.typeAnalyzeSampleFiles(['match11.py'], configOptions); + TestUtils.validateResults(analysisResults2, 7); +}); + test('List1', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['list1.py']); - TestUtils.validateResults(analysisResults, 1); + TestUtils.validateResults(analysisResults, 3); }); test('List2', () => { @@ -998,6 +1218,11 @@ test('List2', () => { TestUtils.validateResults(analysisResults, 0); }); +test('List3', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['list3.py']); + TestUtils.validateResults(analysisResults, 0); +}); + test('Comparison1', () => { const configOptions = new ConfigOptions('.'); @@ -1017,7 +1242,7 @@ test('Comparison2', () => { configOptions.diagnosticRuleSet.reportUnnecessaryComparison = 'error'; const analysisResults2 = TestUtils.typeAnalyzeSampleFiles(['comparison2.py'], configOptions); - TestUtils.validateResults(analysisResults2, 7); + TestUtils.validateResults(analysisResults2, 10); }); test('EmptyContainers1', () => { @@ -1133,6 +1358,12 @@ test('Constructor14', () => { TestUtils.validateResults(analysisResults, 0); }); +test('Constructor15', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['constructor15.py']); + + TestUtils.validateResults(analysisResults, 0); +}); + test('InconsistentConstructor1', () => { const configOptions = new ConfigOptions('.'); @@ -1233,6 +1464,11 @@ test('Subscript3', () => { // TestUtils.validateResults(analysisResults310, 11); }); +test('Subscript4', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['subscript4.py']); + TestUtils.validateResults(analysisResults, 0); +}); + test('Decorator1', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['decorator1.py']); @@ -1286,19 +1522,19 @@ test('Decorator7', () => { test('DataclassTransform1', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['dataclassTransform1.py']); - TestUtils.validateResults(analysisResults, 4); + TestUtils.validateResults(analysisResults, 6); }); test('DataclassTransform2', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['dataclassTransform2.py']); - TestUtils.validateResults(analysisResults, 4); + TestUtils.validateResults(analysisResults, 6); }); test('DataclassTransform3', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['dataclassTransform3.py']); - TestUtils.validateResults(analysisResults, 4); + TestUtils.validateResults(analysisResults, 6); }); test('DataclassTransform4', () => { diff --git a/packages/pyright-internal/src/tests/typeEvaluator4.test.ts b/packages/pyright-internal/src/tests/typeEvaluator4.test.ts index ee7d56ea1..301d4835c 100644 --- a/packages/pyright-internal/src/tests/typeEvaluator4.test.ts +++ b/packages/pyright-internal/src/tests/typeEvaluator4.test.ts @@ -43,7 +43,7 @@ test('Required3', () => { test('Metaclass1', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['metaclass1.py']); - TestUtils.validateResults(analysisResults, 0); + TestUtils.validateResults(analysisResults, 2); }); test('Metaclass2', () => { @@ -86,14 +86,19 @@ test('Metaclass9', () => { TestUtils.validateResults(analysisResults, 6); }); +test('Metaclass10', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['metaclass10.py']); + TestUtils.validateResults(analysisResults, 0); +}); + test('AssignmentExpr1', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['assignmentExpr1.py']); - TestUtils.validateResults(analysisResults, 5); + TestUtils.validateResults(analysisResults, 7); }); test('AssignmentExpr2', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['assignmentExpr2.py']); - TestUtils.validateResults(analysisResults, 6); + TestUtils.validateResults(analysisResults, 4); }); test('AssignmentExpr3', () => { @@ -197,6 +202,16 @@ test('Import14', () => { assert.strictEqual(analysisResults[1].errors.length, 0); }); +test('Import15', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['import15.py']); + TestUtils.validateResults(analysisResults, 0); +}); + +test('Import16', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['import16.py']); + TestUtils.validateResults(analysisResults, 0); +}); + test('DunderAll1', () => { const configOptions = new ConfigOptions('.'); @@ -244,7 +259,7 @@ test('DunderAll3', () => { test('Overload1', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['overload1.py']); - TestUtils.validateResults(analysisResults, 2); + TestUtils.validateResults(analysisResults, 0); }); test('Overload2', () => { @@ -304,6 +319,26 @@ test('Overload11', () => { TestUtils.validateResults(analysisResults, 1); }); +test('Overload12', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['overload12.py']); + TestUtils.validateResults(analysisResults, 0); +}); + +test('Overload13', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['overload13.py']); + TestUtils.validateResults(analysisResults, 0); +}); + +test('Overload14', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['overload14.py']); + TestUtils.validateResults(analysisResults, 0); +}); + +test('Overload15', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['overload15.py']); + TestUtils.validateResults(analysisResults, 9); +}); + test('Final1', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['final1.py']); TestUtils.validateResults(analysisResults, 1); @@ -334,6 +369,11 @@ test('InferredTypes1', () => { TestUtils.validateResults(analysisResults, 0); }); +test('InferredTypes2', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['inferredTypes2.py']); + TestUtils.validateResults(analysisResults, 0); +}); + test('CallSite2', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['callSite2.py']); TestUtils.validateResults(analysisResults, 0); @@ -341,7 +381,7 @@ test('CallSite2', () => { test('FString1', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['fstring1.py']); - TestUtils.validateResults(analysisResults, 5, 1); + TestUtils.validateResults(analysisResults, 7, 1); }); test('FString2', () => { @@ -468,6 +508,16 @@ test('MemberAccess19', () => { TestUtils.validateResults(analysisResults, 5); }); +test('MemberAccess20', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['memberAccess20.py']); + TestUtils.validateResults(analysisResults, 1); +}); + +test('MemberAccess21', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['memberAccess21.py']); + TestUtils.validateResults(analysisResults, 1); +}); + test('DataClass1', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['dataclass1.py']); @@ -489,7 +539,7 @@ test('DataClass3', () => { test('DataClass4', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['dataclass4.py']); - TestUtils.validateResults(analysisResults, 5); + TestUtils.validateResults(analysisResults, 6); }); test('DataClass5', () => { @@ -543,7 +593,7 @@ test('DataClass12', () => { test('DataClass13', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['dataclass13.py']); - TestUtils.validateResults(analysisResults, 3); + TestUtils.validateResults(analysisResults, 4); }); test('DataClass14', () => { @@ -571,7 +621,7 @@ test('DataClass17', () => { configOptions.defaultPythonVersion = PythonVersion.V3_10; const analysisResults = TestUtils.typeAnalyzeSampleFiles(['dataclass17.py'], configOptions); - TestUtils.validateResults(analysisResults, 3); + TestUtils.validateResults(analysisResults, 5); }); test('DataClass18', () => { @@ -610,6 +660,12 @@ test('DataClass23', () => { TestUtils.validateResults(analysisResults, 0); }); +test('DataClass24', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['dataclass24.py']); + + TestUtils.validateResults(analysisResults, 1); +}); + test('DataClassPostInit1', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['dataclassPostInit1.py']); @@ -726,10 +782,7 @@ test('Unions6', () => { }); test('ParamSpec1', () => { - const configOptions = new ConfigOptions('.'); - - configOptions.defaultPythonVersion = PythonVersion.V3_10; - const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec1.py'], configOptions); + const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec1.py']); TestUtils.validateResults(results, 9); }); @@ -746,290 +799,192 @@ test('ParamSpec2', () => { }); test('ParamSpec3', () => { - const configOptions = new ConfigOptions('.'); - - configOptions.defaultPythonVersion = PythonVersion.V3_10; - const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec3.py'], configOptions); - TestUtils.validateResults(results, 2); + const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec3.py']); + TestUtils.validateResults(results, 1); }); test('ParamSpec4', () => { - const configOptions = new ConfigOptions('.'); - - configOptions.defaultPythonVersion = PythonVersion.V3_10; - const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec4.py'], configOptions); + const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec4.py']); TestUtils.validateResults(results, 7); }); test('ParamSpec5', () => { - const configOptions = new ConfigOptions('.'); - - configOptions.defaultPythonVersion = PythonVersion.V3_10; - const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec5.py'], configOptions); + const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec5.py']); TestUtils.validateResults(results, 0); }); test('ParamSpec6', () => { - const configOptions = new ConfigOptions('.'); - - configOptions.defaultPythonVersion = PythonVersion.V3_10; - const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec6.py'], configOptions); + const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec6.py']); TestUtils.validateResults(results, 0); }); test('ParamSpec7', () => { - const configOptions = new ConfigOptions('.'); - - configOptions.defaultPythonVersion = PythonVersion.V3_10; - const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec7.py'], configOptions); + const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec7.py']); TestUtils.validateResults(results, 0); }); test('ParamSpec8', () => { - const configOptions = new ConfigOptions('.'); - - configOptions.defaultPythonVersion = PythonVersion.V3_10; - const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec8.py'], configOptions); + const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec8.py']); TestUtils.validateResults(results, 5); }); test('ParamSpec9', () => { - const configOptions = new ConfigOptions('.'); - - configOptions.defaultPythonVersion = PythonVersion.V3_10; - const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec9.py'], configOptions); + const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec9.py']); TestUtils.validateResults(results, 9); }); test('ParamSpec10', () => { - const configOptions = new ConfigOptions('.'); - - configOptions.defaultPythonVersion = PythonVersion.V3_10; - const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec10.py'], configOptions); + const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec10.py']); TestUtils.validateResults(results, 0); }); test('ParamSpec11', () => { - const configOptions = new ConfigOptions('.'); - - configOptions.defaultPythonVersion = PythonVersion.V3_10; - const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec11.py'], configOptions); + const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec11.py']); TestUtils.validateResults(results, 0); }); test('ParamSpec12', () => { - const configOptions = new ConfigOptions('.'); - - configOptions.defaultPythonVersion = PythonVersion.V3_10; - const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec12.py'], configOptions); + const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec12.py']); TestUtils.validateResults(results, 16); }); test('ParamSpec13', () => { - const configOptions = new ConfigOptions('.'); - - configOptions.defaultPythonVersion = PythonVersion.V3_10; - const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec13.py'], configOptions); + const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec13.py']); TestUtils.validateResults(results, 6); }); test('ParamSpec14', () => { - const configOptions = new ConfigOptions('.'); - - configOptions.defaultPythonVersion = PythonVersion.V3_10; - const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec14.py'], configOptions); + const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec14.py']); TestUtils.validateResults(results, 0); }); test('ParamSpec15', () => { - const configOptions = new ConfigOptions('.'); - - configOptions.defaultPythonVersion = PythonVersion.V3_10; - const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec15.py'], configOptions); + const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec15.py']); TestUtils.validateResults(results, 0); }); test('ParamSpec16', () => { - const configOptions = new ConfigOptions('.'); - - configOptions.defaultPythonVersion = PythonVersion.V3_10; - const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec16.py'], configOptions); + const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec16.py']); TestUtils.validateResults(results, 0); }); test('ParamSpec17', () => { - const configOptions = new ConfigOptions('.'); - - configOptions.defaultPythonVersion = PythonVersion.V3_10; - const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec17.py'], configOptions); + const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec17.py']); TestUtils.validateResults(results, 0); }); test('ParamSpec18', () => { - const configOptions = new ConfigOptions('.'); - - configOptions.defaultPythonVersion = PythonVersion.V3_10; - const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec18.py'], configOptions); + const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec18.py']); TestUtils.validateResults(results, 0); }); test('ParamSpec19', () => { - const configOptions = new ConfigOptions('.'); - - configOptions.defaultPythonVersion = PythonVersion.V3_10; - const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec19.py'], configOptions); + const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec19.py']); TestUtils.validateResults(results, 0); }); test('ParamSpec20', () => { - const configOptions = new ConfigOptions('.'); - - configOptions.defaultPythonVersion = PythonVersion.V3_10; - const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec20.py'], configOptions); + const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec20.py']); TestUtils.validateResults(results, 6); }); test('ParamSpec21', () => { - const configOptions = new ConfigOptions('.'); - - configOptions.defaultPythonVersion = PythonVersion.V3_10; - const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec21.py'], configOptions); + const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec21.py']); TestUtils.validateResults(results, 0); }); test('ParamSpec22', () => { - const configOptions = new ConfigOptions('.'); - - configOptions.defaultPythonVersion = PythonVersion.V3_10; - const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec22.py'], configOptions); + const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec22.py']); TestUtils.validateResults(results, 0); }); test('ParamSpec23', () => { - const configOptions = new ConfigOptions('.'); - - configOptions.defaultPythonVersion = PythonVersion.V3_10; - const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec23.py'], configOptions); + const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec23.py']); TestUtils.validateResults(results, 0); }); test('ParamSpec24', () => { - const configOptions = new ConfigOptions('.'); - - configOptions.defaultPythonVersion = PythonVersion.V3_10; - const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec24.py'], configOptions); + const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec24.py']); TestUtils.validateResults(results, 0); }); test('ParamSpec25', () => { - const configOptions = new ConfigOptions('.'); - - configOptions.defaultPythonVersion = PythonVersion.V3_10; - const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec25.py'], configOptions); + const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec25.py']); TestUtils.validateResults(results, 0); }); test('ParamSpec26', () => { - const configOptions = new ConfigOptions('.'); - - configOptions.defaultPythonVersion = PythonVersion.V3_10; - const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec26.py'], configOptions); + const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec26.py']); TestUtils.validateResults(results, 0); }); test('ParamSpec27', () => { - const configOptions = new ConfigOptions('.'); - - configOptions.defaultPythonVersion = PythonVersion.V3_10; - const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec27.py'], configOptions); + const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec27.py']); TestUtils.validateResults(results, 2); }); test('ParamSpec28', () => { - const configOptions = new ConfigOptions('.'); - - configOptions.defaultPythonVersion = PythonVersion.V3_10; - const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec28.py'], configOptions); + const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec28.py']); TestUtils.validateResults(results, 0); }); test('ParamSpec29', () => { - const configOptions = new ConfigOptions('.'); - - configOptions.defaultPythonVersion = PythonVersion.V3_10; - const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec29.py'], configOptions); + const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec29.py']); TestUtils.validateResults(results, 3); }); test('ParamSpec30', () => { - const configOptions = new ConfigOptions('.'); - - configOptions.defaultPythonVersion = PythonVersion.V3_10; - const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec30.py'], configOptions); + const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec30.py']); TestUtils.validateResults(results, 0); }); test('ParamSpec31', () => { - const configOptions = new ConfigOptions('.'); - - configOptions.defaultPythonVersion = PythonVersion.V3_10; - const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec31.py'], configOptions); + const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec31.py']); TestUtils.validateResults(results, 0); }); test('ParamSpec32', () => { - const configOptions = new ConfigOptions('.'); - - configOptions.defaultPythonVersion = PythonVersion.V3_10; - const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec32.py'], configOptions); + const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec32.py']); TestUtils.validateResults(results, 4); }); test('ParamSpec33', () => { - const configOptions = new ConfigOptions('.'); - - configOptions.defaultPythonVersion = PythonVersion.V3_10; - const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec33.py'], configOptions); + const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec33.py']); TestUtils.validateResults(results, 4); }); test('ParamSpec34', () => { - const configOptions = new ConfigOptions('.'); - - configOptions.defaultPythonVersion = PythonVersion.V3_10; - const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec34.py'], configOptions); + const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec34.py']); TestUtils.validateResults(results, 0); }); test('ParamSpec35', () => { - const configOptions = new ConfigOptions('.'); - - configOptions.defaultPythonVersion = PythonVersion.V3_10; - const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec35.py'], configOptions); + const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec35.py']); TestUtils.validateResults(results, 1); }); test('ParamSpec36', () => { - const configOptions = new ConfigOptions('.'); - - configOptions.defaultPythonVersion = PythonVersion.V3_10; - const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec36.py'], configOptions); + const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec36.py']); TestUtils.validateResults(results, 2); }); test('ParamSpec37', () => { - const configOptions = new ConfigOptions('.'); - - configOptions.defaultPythonVersion = PythonVersion.V3_10; - const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec37.py'], configOptions); + const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec37.py']); TestUtils.validateResults(results, 0); }); test('ParamSpec38', () => { - const configOptions = new ConfigOptions('.'); + const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec38.py']); + TestUtils.validateResults(results, 0); +}); - configOptions.defaultPythonVersion = PythonVersion.V3_10; - const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec38.py'], configOptions); +test('ParamSpec39', () => { + const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec39.py']); + TestUtils.validateResults(results, 0); +}); + +test('ParamSpec40', () => { + const results = TestUtils.typeAnalyzeSampleFiles(['paramSpec40.py']); TestUtils.validateResults(results, 0); }); @@ -1108,7 +1063,7 @@ test('TypeVar8', () => { test('TypeVar9', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typeVar9.py']); - TestUtils.validateResults(analysisResults, 10); + TestUtils.validateResults(analysisResults, 11); }); test('TypeVar10', () => { @@ -1123,6 +1078,12 @@ test('TypeVar11', () => { TestUtils.validateResults(analysisResults, 0); }); +test('TypeVar12', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typeVar12.py']); + + TestUtils.validateResults(analysisResults, 6); +}); + test('Annotated1', () => { const configOptions = new ConfigOptions('.'); @@ -1138,7 +1099,7 @@ test('Annotated1', () => { test('Circular1', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['circular1.py']); - TestUtils.validateResults(analysisResults, 0); + TestUtils.validateResults(analysisResults, 2); }); test('Circular2', () => { diff --git a/packages/pyright-internal/src/tests/typeEvaluator5.test.ts b/packages/pyright-internal/src/tests/typeEvaluator5.test.ts index 50065f225..78d2e67b7 100644 --- a/packages/pyright-internal/src/tests/typeEvaluator5.test.ts +++ b/packages/pyright-internal/src/tests/typeEvaluator5.test.ts @@ -17,7 +17,7 @@ test('TypeParams1', () => { configOptions.defaultPythonVersion = PythonVersion.V3_12; const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typeParams1.py'], configOptions); - TestUtils.validateResults(analysisResults, 6); + TestUtils.validateResults(analysisResults, 4); }); test('TypeParams2', () => { @@ -61,7 +61,7 @@ test('TypeParams6', () => { configOptions.defaultPythonVersion = PythonVersion.V3_12; const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typeParams6.py'], configOptions); - TestUtils.validateResults(analysisResults, 2); + TestUtils.validateResults(analysisResults, 3); }); test('TypeParams7', () => { @@ -88,12 +88,28 @@ test('AutoVariance2', () => { TestUtils.validateResults(analysisResults, 0); }); +test('AutoVariance3', () => { + const configOptions = new ConfigOptions('.'); + configOptions.defaultPythonVersion = PythonVersion.V3_12; + + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['autoVariance3.py'], configOptions); + TestUtils.validateResults(analysisResults, 13); +}); + +test('AutoVariance4', () => { + const configOptions = new ConfigOptions('.'); + configOptions.defaultPythonVersion = PythonVersion.V3_12; + + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['autoVariance4.py'], configOptions); + TestUtils.validateResults(analysisResults, 4); +}); + test('TypeAliasStatement1', () => { const configOptions = new ConfigOptions('.'); configOptions.defaultPythonVersion = PythonVersion.V3_12; const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typeAliasStatement1.py'], configOptions); - TestUtils.validateResults(analysisResults, 2); + TestUtils.validateResults(analysisResults, 3); }); test('TypeAliasStatement2', () => { @@ -123,3 +139,130 @@ test('TypeAliasStatement4', () => { const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typeAliasStatement4.py'], configOptions); TestUtils.validateResults(analysisResults, 5); }); + +test('Hashability1', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['hashability1.py']); + TestUtils.validateResults(analysisResults, 10); +}); + +test('Override1', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['override1.py']); + TestUtils.validateResults(analysisResults, 3); +}); + +test('Override2', () => { + const configOptions = new ConfigOptions('.'); + + const analysisResults1 = TestUtils.typeAnalyzeSampleFiles(['override2.py'], configOptions); + TestUtils.validateResults(analysisResults1, 0); + + configOptions.diagnosticRuleSet.reportImplicitOverride = 'error'; + const analysisResults2 = TestUtils.typeAnalyzeSampleFiles(['override2.py'], configOptions); + TestUtils.validateResults(analysisResults2, 2); +}); + +test('TypeVarDefault1', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typeVarDefault1.py']); + TestUtils.validateResults(analysisResults, 12); +}); + +test('TypeVarDefault2', () => { + const configOptions = new ConfigOptions('.'); + configOptions.defaultPythonVersion = PythonVersion.V3_12; + + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typeVarDefault2.py'], configOptions); + TestUtils.validateResults(analysisResults, 22); +}); + +test('TypeVarDefault3', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typeVarDefault3.py']); + TestUtils.validateResults(analysisResults, 4); +}); + +test('TypeVarDefault4', () => { + const configOptions = new ConfigOptions('.'); + configOptions.defaultPythonVersion = PythonVersion.V3_12; + + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typeVarDefault4.py'], configOptions); + TestUtils.validateResults(analysisResults, 3); +}); + +test('TypeVarDefault5', () => { + const configOptions = new ConfigOptions('.'); + configOptions.defaultPythonVersion = PythonVersion.V3_12; + + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typeVarDefault5.py'], configOptions); + TestUtils.validateResults(analysisResults, 0); +}); + +test('TypeVarDefaultClass1', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typeVarDefaultClass1.py']); + TestUtils.validateResults(analysisResults, 0); +}); + +test('TypeVarDefaultClass2', () => { + const configOptions = new ConfigOptions('.'); + configOptions.defaultPythonVersion = PythonVersion.V3_12; + + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typeVarDefaultClass2.py'], configOptions); + TestUtils.validateResults(analysisResults, 8); +}); + +test('TypeVarDefaultClass3', () => { + const configOptions = new ConfigOptions('.'); + configOptions.defaultPythonVersion = PythonVersion.V3_12; + + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typeVarDefaultClass3.py'], configOptions); + TestUtils.validateResults(analysisResults, 8); +}); + +test('TypeVarDefaultTypeAlias1', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typeVarDefaultTypeAlias1.py']); + TestUtils.validateResults(analysisResults, 0); +}); + +test('TypeVarDefaultTypeAlias2', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typeVarDefaultTypeAlias2.py']); + TestUtils.validateResults(analysisResults, 9); +}); + +test('TypeVarDefaultTypeAlias3', () => { + const configOptions = new ConfigOptions('.'); + configOptions.defaultPythonVersion = PythonVersion.V3_12; + + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typeVarDefaultTypeAlias3.py'], configOptions); + TestUtils.validateResults(analysisResults, 9); +}); + +test('TypeVarDefaultFunction1', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typeVarDefaultFunction1.py']); + TestUtils.validateResults(analysisResults, 0); +}); + +test('TypeVarDefaultFunction2', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typeVarDefaultFunction2.py']); + TestUtils.validateResults(analysisResults, 1); +}); + +test('TypeVarDefaultFunction3', () => { + const configOptions = new ConfigOptions('.'); + configOptions.defaultPythonVersion = PythonVersion.V3_12; + + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typeVarDefaultFunction3.py'], configOptions); + TestUtils.validateResults(analysisResults, 1); +}); + +test('FutureImport1', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['futureImport1.py']); + TestUtils.validateResults(analysisResults, 0); +}); + +test('FutureImport2', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['futureImport2.py']); + TestUtils.validateResults(analysisResults, 2); +}); + +test('FutureImport3', () => { + const analysisResults = TestUtils.typeAnalyzeSampleFiles(['futureImport3.py']); + TestUtils.validateResults(analysisResults, 1); +}); diff --git a/packages/pyright-internal/src/tests/typePrinter.test.ts b/packages/pyright-internal/src/tests/typePrinter.test.ts new file mode 100644 index 000000000..c74734070 --- /dev/null +++ b/packages/pyright-internal/src/tests/typePrinter.test.ts @@ -0,0 +1,203 @@ +/* + * typePrinter.test.ts + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT license. + * Author: Eric Traut + * + * Unit tests for typePrinter module. + */ + +import * as assert from 'assert'; + +import { printType, PrintTypeFlags } from '../analyzer/typePrinter'; +import { + AnyType, + ClassType, + ClassTypeFlags, + combineTypes, + FunctionType, + FunctionTypeFlags, + ModuleType, + NoneType, + TypeVarType, + UnboundType, + UnknownType, +} from '../analyzer/types'; +import { ParameterCategory } from '../parser/parseNodes'; + +function returnTypeCallback(type: FunctionType) { + return type.details.declaredReturnType ?? UnknownType.create(/* isEllipsis */ true); +} + +test('SimpleTypes', () => { + const anyType = AnyType.create(/* isEllipsis */ false); + assert.strictEqual(printType(anyType, PrintTypeFlags.None, returnTypeCallback), 'Any'); + + const ellipsisType = AnyType.create(/* isEllipsis */ true); + assert.strictEqual(printType(ellipsisType, PrintTypeFlags.None, returnTypeCallback), '...'); + + const unknownType = UnknownType.create(); + assert.strictEqual(printType(unknownType, PrintTypeFlags.None, returnTypeCallback), 'Unknown'); + assert.strictEqual(printType(unknownType, PrintTypeFlags.PrintUnknownWithAny, returnTypeCallback), 'Any'); + assert.strictEqual(printType(unknownType, PrintTypeFlags.PythonSyntax, returnTypeCallback), 'Any'); + + const unboundType = UnboundType.create(); + assert.strictEqual(printType(unboundType, PrintTypeFlags.None, returnTypeCallback), 'Unbound'); + assert.strictEqual(printType(unboundType, PrintTypeFlags.PythonSyntax, returnTypeCallback), 'Any'); + + const noneInstanceType = NoneType.createInstance(); + assert.strictEqual(printType(noneInstanceType, PrintTypeFlags.None, returnTypeCallback), 'None'); + + const noneInstantiableType = NoneType.createType(); + assert.strictEqual(printType(noneInstantiableType, PrintTypeFlags.None, returnTypeCallback), 'Type[None]'); + + const moduleType = ModuleType.create('Test', ''); + assert.strictEqual(printType(moduleType, PrintTypeFlags.None, returnTypeCallback), 'Module("Test")'); + assert.strictEqual(printType(moduleType, PrintTypeFlags.PythonSyntax, returnTypeCallback), 'Any'); +}); + +test('TypeVarTypes', () => { + const typeVarType = TypeVarType.createInstance('T'); + assert.strictEqual(printType(typeVarType, PrintTypeFlags.None, returnTypeCallback), 'T'); + + const paramSpecType = TypeVarType.createInstance('P'); + paramSpecType.details.isParamSpec = true; + assert.strictEqual(printType(paramSpecType, PrintTypeFlags.None, returnTypeCallback), 'P'); + + const typeVarTupleType = TypeVarType.createInstance('Ts'); + paramSpecType.details.isVariadic = true; + assert.strictEqual(printType(typeVarTupleType, PrintTypeFlags.None, returnTypeCallback), 'Ts'); +}); + +test('ClassTypes', () => { + const classTypeA = ClassType.createInstantiable( + 'A', + '', + '', + '', + ClassTypeFlags.None, + 0, + /* declaredMetaclass*/ undefined, + /* effectiveMetaclass */ undefined + ); + + const typeVarS = TypeVarType.createInstance('S'); + const typeVarT = TypeVarType.createInstance('T'); + + classTypeA.details.typeParameters.push(typeVarS, typeVarT); + + assert.strictEqual(printType(classTypeA, PrintTypeFlags.None, returnTypeCallback), 'Type[A[S, T]]'); + + const instanceA = ClassType.cloneAsInstance(classTypeA); + assert.strictEqual(printType(instanceA, PrintTypeFlags.None, returnTypeCallback), 'A[S, T]'); + + const classTypeInt = ClassType.createInstantiable( + 'int', + '', + '', + '', + ClassTypeFlags.None, + 0, + /* declaredMetaclass*/ undefined, + /* effectiveMetaclass */ undefined + ); + const instanceInt = ClassType.cloneAsInstance(classTypeInt); + + const specializedA = ClassType.cloneForSpecialization( + instanceA, + [instanceInt, instanceInt], + /* isTypeArgumentExplicit */ true + ); + + assert.strictEqual(printType(specializedA, PrintTypeFlags.None, returnTypeCallback), 'A[int, int]'); + + const unionType = combineTypes([instanceInt, specializedA, typeVarS]); + assert.strictEqual(printType(unionType, PrintTypeFlags.None, returnTypeCallback), 'Union[int, A[int, int], S]'); + assert.strictEqual(printType(unionType, PrintTypeFlags.PEP604, returnTypeCallback), 'int | A[int, int] | S'); +}); + +test('FunctionTypes', () => { + const funcTypeA = FunctionType.createInstance('A', '', '', FunctionTypeFlags.None); + + FunctionType.addParameter(funcTypeA, { + category: ParameterCategory.Simple, + hasDeclaredType: true, + type: NoneType.createInstance(), + name: 'a', + }); + + FunctionType.addParameter(funcTypeA, { + category: ParameterCategory.Simple, + hasDeclaredType: true, + type: AnyType.create(), + }); + + FunctionType.addParameter(funcTypeA, { + category: ParameterCategory.VarArgList, + hasDeclaredType: true, + type: AnyType.create(), + name: 'args', + }); + + FunctionType.addParameter(funcTypeA, { + category: ParameterCategory.VarArgDictionary, + hasDeclaredType: true, + type: AnyType.create(), + name: 'kwargs', + }); + + funcTypeA.details.declaredReturnType = NoneType.createInstance(); + + assert.strictEqual( + printType(funcTypeA, PrintTypeFlags.None, returnTypeCallback), + '(a: None, /, *args: Any, **kwargs: Any) -> None' + ); + assert.strictEqual(printType(funcTypeA, PrintTypeFlags.PythonSyntax, returnTypeCallback), 'Callable[..., None]'); + + const funcTypeB = FunctionType.createInstance('B', '', '', FunctionTypeFlags.None); + + FunctionType.addParameter(funcTypeB, { + category: ParameterCategory.Simple, + hasDeclaredType: true, + type: NoneType.createInstance(), + name: 'a', + }); + + FunctionType.addParameter(funcTypeB, { + category: ParameterCategory.Simple, + hasDeclaredType: true, + type: NoneType.createInstance(), + }); + + const paramSpecP = TypeVarType.createInstance('P'); + paramSpecP.details.isParamSpec = true; + funcTypeB.details.paramSpec = paramSpecP; + + funcTypeB.details.declaredReturnType = NoneType.createInstance(); + + assert.strictEqual(printType(funcTypeB, PrintTypeFlags.None, returnTypeCallback), '(a: None, /, **P) -> None'); + assert.strictEqual( + printType(funcTypeB, PrintTypeFlags.PythonSyntax, returnTypeCallback), + 'Callable[Concatenate[None, P], None]' + ); + + const funcTypeC = FunctionType.createInstance('C', '', '', FunctionTypeFlags.None); + + const typeVarTupleTs = TypeVarType.createInstance('Ts'); + typeVarTupleTs.details.isVariadic = true; + const unpackedTs = TypeVarType.cloneForUnpacked(typeVarTupleTs); + + FunctionType.addParameter(funcTypeC, { + category: ParameterCategory.VarArgList, + hasDeclaredType: true, + type: unpackedTs, + name: 'args', + }); + + assert.strictEqual(printType(funcTypeC, PrintTypeFlags.None, returnTypeCallback), '(*args: *Ts) -> Unknown'); + assert.strictEqual( + printType(funcTypeC, PrintTypeFlags.UseTypingUnpack, returnTypeCallback), + '(*args: Unpack[Ts]) -> Unknown' + ); + assert.strictEqual(printType(funcTypeC, PrintTypeFlags.PythonSyntax, returnTypeCallback), 'Callable[..., Any]'); +}); diff --git a/packages/pyright-internal/src/tests/updateSymbolReference.test.ts b/packages/pyright-internal/src/tests/updateSymbolReference.test.ts deleted file mode 100644 index 4d4b90716..000000000 --- a/packages/pyright-internal/src/tests/updateSymbolReference.test.ts +++ /dev/null @@ -1,1107 +0,0 @@ -/* - * moveSymbolAtPosition.test.ts - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT license. - * - * Tests Program.moveSymbol - */ - -import { parseAndGetTestState } from './harness/fourslash/testState'; -import { testMoveSymbolAtPosition } from './renameModuleTestUtils'; - -test('move symbol to another file - simple from import', () => { - const code = ` -// @filename: test.py -//// def [|/*marker*/foo|](): pass - -// @filename: moved.py -//// [|/*dest*/|] - -// @filename: used.py -//// from [|{|"r":"moved"|}test|] import foo - `; - - testFromCode(code); -}); - -test('move symbol to another file - nested file', () => { - const code = ` -// @filename: test.py -//// def [|/*marker*/foo|](): pass - -// @filename: nested/moved.py -//// [|/*dest*/|] - -// @filename: used.py -//// from [|{|"r":"nested.moved"|}test|] import foo - `; - - testFromCode(code); -}); - -test('move symbol to another file - parent file', () => { - const code = ` -// @filename: nested/test.py -//// def [|/*marker*/foo|](): pass - -// @filename: moved.py -//// [|/*dest*/|] - -// @filename: used.py -//// from [|{|"r":"moved"|}nested.test|] import foo - `; - - testFromCode(code); -}); - -test('move symbol to another file - multiple import', () => { - const code = ` -// @filename: test.py -//// def [|/*marker*/foo|](): pass -//// -//// def stay(): pass - -// @filename: moved.py -//// [|/*dest*/|] - -// @filename: used.py -//// [|{|"r":"from moved import foo!n!"|}|]from test import [|{|"r":""|}foo, |]stay - `; - - testFromCode(code); -}); - -test('move symbol to another file - multiple import with submodules', () => { - const code = ` -// @filename: nested/__init__.py -//// def [|/*marker*/foo|](): pass - -// @filename: nested/test.py -//// # empty - -// @filename: moved.py -//// [|/*dest*/|] - -// @filename: used.py -//// [|{|"r":"from moved import foo!n!"|}|]from nested import [|{|"r":""|}foo, |]test - `; - - testFromCode(code); -}); - -test('move symbol to another file - no merge with existing imports', () => { - const code = ` -// @filename: test.py -//// def [|/*marker*/foo|](): pass - -// @filename: moved.py -//// [|/*dest*/|] -//// def stay(): pass - -// @filename: used.py -//// from [|{|"r":"moved"|}test|] import foo -//// from moved import stay - `; - - testFromCode(code); -}); - -test('move symbol to another file - merge with existing imports', () => { - const code = ` -// @filename: test.py -//// def [|/*marker*/foo|](): pass -//// def bar(): pass - -// @filename: moved.py -//// [|/*dest*/|] -//// def stay(): pass - -// @filename: used.py -//// from test import bar[|{|"r":""|}, foo|] -//// from moved import [|{|"r":"foo, "|}|]stay - `; - - testFromCode(code); -}); - -test('move symbol to another file - multiple import - nested folder', () => { - const code = ` -// @filename: test.py -//// def [|/*marker*/foo|](): pass -//// -//// def stay(): pass - -// @filename: nested/moved.py -//// [|/*dest*/|] - -// @filename: used.py -//// [|{|"r":"from nested.moved import foo!n!"|}|]from test import [|{|"r":""|}foo, |]stay - `; - - testFromCode(code); -}); - -test('move symbol to another file - multiple import with submodules - parent folder', () => { - const code = ` -// @filename: nested/__init__.py -//// def [|/*marker*/foo|](): pass - -// @filename: nested/test.py -//// # empty - -// @filename: moved.py -//// [|/*dest*/|] - -// @filename: used.py -//// [|{|"r":"from moved import foo!n!"|}|]from nested import [|{|"r":""|}foo, |]test - `; - - testFromCode(code); -}); - -test('move symbol to another file - no merge with existing imports - nested folder', () => { - const code = ` -// @filename: test.py -//// def [|/*marker*/foo|](): pass - -// @filename: nested/moved.py -//// [|/*dest*/|] -//// def stay(): pass - -// @filename: used.py -//// from [|{|"r":"nested.moved"|}test|] import foo -//// from nested.moved import stay - `; - - testFromCode(code); -}); - -test('move symbol to another file - merge with existing imports - nested folder', () => { - const code = ` -// @filename: test.py -//// def [|/*marker*/foo|](): pass -//// def bar(): pass - -// @filename: nested/moved.py -//// [|/*dest*/|] -//// def stay(): pass - -// @filename: used.py -//// from test import bar[|{|"r":""|}, foo|] -//// from nested.moved import [|{|"r":"foo, "|}|]stay - `; - - testFromCode(code); -}); - -test('move symbol to another file - multiple import - parent folder', () => { - const code = ` -// @filename: nested/test.py -//// def [|/*marker*/foo|](): pass -//// -//// def stay(): pass - -// @filename: moved.py -//// [|/*dest*/|] - -// @filename: used.py -//// [|{|"r":"from moved import foo!n!"|}|]from nested.test import [|{|"r":""|}foo, |]stay - `; - - testFromCode(code); -}); - -test('move symbol to another file - multiple import with submodules - sibling folder', () => { - const code = ` -// @filename: nested/__init__.py -//// def [|/*marker*/foo|](): pass - -// @filename: nested/test.py -//// # empty - -// @filename: nested/moved.py -//// [|/*dest*/|] - -// @filename: used.py -//// from nested import [|{|"r":""|}foo, |]test[|{|"r":"!n!from nested.moved import foo"|}|] - `; - - testFromCode(code); -}); - -test('move symbol to another file - no merge with existing imports - parent folder', () => { - const code = ` -// @filename: nested/test.py -//// def [|/*marker*/foo|](): pass - -// @filename: moved.py -//// [|/*dest*/|] -//// def stay(): pass - -// @filename: used.py -//// from [|{|"r":"moved"|}nested.test|] import foo -//// from moved import stay - `; - - testFromCode(code); -}); - -test('move symbol to another file - merge with existing imports - parent folder', () => { - const code = ` -// @filename: nested/test.py -//// def [|/*marker*/foo|](): pass -//// def bar(): pass - -// @filename: moved.py -//// [|/*dest*/|] -//// def stay(): pass - -// @filename: used.py -//// from nested.test import bar[|{|"r":""|}, foo|] -//// from moved import [|{|"r":"foo, "|}|]stay - `; - - testFromCode(code); -}); - -test('move symbol to another file - simple from import - relative path', () => { - const code = ` -// @filename: test.py -//// def [|/*marker*/foo|](): pass - -// @filename: moved.py -//// [|/*dest*/|] - -// @filename: used.py -//// from [|{|"r":".moved"|}.test|] import foo - `; - - testFromCode(code); -}); - -test('move symbol to another file - nested file - relative path', () => { - const code = ` -// @filename: test.py -//// def [|/*marker*/foo|](): pass - -// @filename: nested/moved.py -//// [|/*dest*/|] - -// @filename: nested/used.py -//// from [|{|"r":".moved"|}..test|] import foo - `; - - testFromCode(code); -}); - -test('move symbol to another file - parent file - relative path', () => { - const code = ` -// @filename: nested/test.py -//// def [|/*marker*/foo|](): pass - -// @filename: moved.py -//// [|/*dest*/|] - -// @filename: used.py -//// from [|{|"r":".moved"|}.nested.test|] import foo - `; - - testFromCode(code); -}); - -test('move symbol to another file - multiple import - relative path', () => { - const code = ` -// @filename: test.py -//// def [|/*marker*/foo|](): pass -//// -//// def stay(): pass - -// @filename: moved.py -//// [|/*dest*/|] - -// @filename: nested/used.py -//// [|{|"r":"from ..moved import foo!n!"|}|]from ..test import [|{|"r":""|}foo, |]stay - `; - - testFromCode(code); -}); - -test('move symbol to another file - multiple import with submodules - relative path', () => { - const code = ` -// @filename: nested/__init__.py -//// def [|/*marker*/foo|](): pass - -// @filename: nested/test.py -//// # empty - -// @filename: moved.py -//// [|/*dest*/|] - -// @filename: used.py -//// [|{|"r":"from .moved import foo!n!"|}|]from .nested import [|{|"r":""|}foo, |]test - `; - - testFromCode(code); -}); - -test('move symbol to another file - no merge with existing imports - relative path', () => { - const code = ` -// @filename: test.py -//// def [|/*marker*/foo|](): pass - -// @filename: moved.py -//// [|/*dest*/|] -//// def stay(): pass - -// @filename: used.py -//// from [|{|"r":".moved"|}.test|] import foo -//// from moved import stay - `; - - testFromCode(code); -}); - -test('move symbol to another file - merge with existing imports - relative path', () => { - const code = ` -// @filename: test.py -//// def [|/*marker*/foo|](): pass -//// def bar(): pass - -// @filename: moved.py -//// [|/*dest*/|] -//// def stay(): pass - -// @filename: used.py -//// from .test import bar[|{|"r":""|}, foo|] -//// from .moved import [|{|"r":"foo, "|}|]stay - `; - - testFromCode(code); -}); - -test('member off import', () => { - const code = ` -// @filename: test.py -//// def [|/*marker*/foo|](): pass - -// @filename: moved.py -//// [|/*dest*/|] - -// @filename: used.py -//// import [|{|"r":"moved"|}test|] -//// [|{|"r":"moved"|}test|].foo() - `; - - testFromCode(code); -}); - -test('member off import with existing import', () => { - const code = ` -// @filename: test.py -//// def [|/*marker*/foo|](): pass - -// @filename: moved.py -//// [|/*dest*/|] - -// @filename: used.py -//// [|{|"r":""|}import test -//// |]import moved -//// [|{|"r":"moved"|}test|].foo() - `; - - testFromCode(code); -}); - -test('member off import with existing import with alias', () => { - const code = ` -// @filename: test.py -//// def [|/*marker*/foo|](): pass - -// @filename: moved.py -//// [|/*dest*/|] - -// @filename: used.py -//// [|{|"r":""|}import test -//// |]import moved as m -//// [|{|"r":"m"|}test|].foo() - `; - - testFromCode(code); -}); - -test('member off import with existing import - multiple imports', () => { - const code = ` -// @filename: test.py -//// def [|/*marker*/foo|](): pass - -// @filename: moved.py -//// [|/*dest*/|] - -// @filename: used.py -//// import moved[|{|"r":""|}, test|] -//// [|{|"r":"moved"|}test|].foo() - `; - - testFromCode(code); -}); - -test('member off import with existing import - multiple imports with alias', () => { - const code = ` -// @filename: test.py -//// def [|/*marker*/foo|](): pass - -// @filename: moved.py -//// [|/*dest*/|] - -// @filename: used.py -//// import moved as m[|{|"r":""|}, test|] -//// [|{|"r":"m"|}test|].foo() - `; - - testFromCode(code); -}); - -test('member off from import with existing import', () => { - const code = ` -// @filename: test.py -//// def [|/*marker*/foo|](): pass - -// @filename: moved.py -//// [|/*dest*/|] - -// @filename: used.py -//// [|{|"r":""|}from . import test -//// |]import moved -//// [|{|"r":"moved"|}test|].foo() - `; - - testFromCode(code); -}); - -test('member off from import with existing import with alias', () => { - const code = ` -// @filename: test.py -//// def [|/*marker*/foo|](): pass - -// @filename: moved.py -//// [|/*dest*/|] - -// @filename: used.py -//// [|{|"r":""|}from . import test -//// |]import moved as m -//// [|{|"r":"m"|}test|].foo() - `; - - testFromCode(code); -}); - -test('member off from import with existing from import', () => { - const code = ` -// @filename: test.py -//// def [|/*marker*/foo|](): pass - -// @filename: moved.py -//// [|/*dest*/|] - -// @filename: used.py -//// [|{|"r":""|}from . import test -//// |]from . import moved -//// [|{|"r":"moved"|}test|].foo() - `; - - testFromCode(code); -}); - -test('member off from import with existing from import with alias', () => { - const code = ` -// @filename: test.py -//// def [|/*marker*/foo|](): pass - -// @filename: moved.py -//// [|/*dest*/|] - -// @filename: used.py -//// [|{|"r":""|}from . import test -//// |]from . import moved as m -//// [|{|"r":"m"|}test|].foo() - `; - - testFromCode(code); -}); - -test('member off from import with existing import - multiple imports', () => { - const code = ` -// @filename: test.py -//// def [|/*marker*/foo|](): pass - -// @filename: moved.py -//// [|/*dest*/|] - -// @filename: used.py -//// from . import moved[|{|"r":""|}, test|] -//// [|{|"r":"moved"|}test|].foo() - `; - - testFromCode(code); -}); - -test('member off from import with existing import - multiple imports with alias', () => { - const code = ` -// @filename: test.py -//// def [|/*marker*/foo|](): pass - -// @filename: moved.py -//// [|/*dest*/|] - -// @filename: used.py -//// from . import moved as m[|{|"r":""|}, test|] -//// [|{|"r":"m"|}test|].foo() - `; - - testFromCode(code); -}); - -test('member off submodule', () => { - const code = ` -// @filename: test.py -//// def [|/*marker*/foo|](): pass - -// @filename: moved.py -//// [|/*dest*/|] - -// @filename: used.py -//// from . import [|{|"r":"moved"|}test|] -//// [|{|"r":"moved"|}test|].foo() - `; - - testFromCode(code); -}); - -test('member off import - dotted name', () => { - const code = ` -// @filename: test.py -//// def [|/*marker*/foo|](): pass - -// @filename: nested/moved.py -//// [|/*dest*/|] - -// @filename: used.py -//// import [|{|"r":"nested.moved"|}test|] -//// [|{|"r":"nested.moved"|}test|].foo() - `; - - testFromCode(code); -}); - -test('member off submodule - dotted name', () => { - const code = ` -// @filename: test.py -//// def [|/*marker*/foo|](): pass - -// @filename: nested/moved.py -//// [|/*dest*/|] - -// @filename: used.py -//// from [|{|"r":".nested"|}.|] import [|{|"r":"moved"|}test|] -//// [|{|"r":"moved"|}test|].foo() - `; - - testFromCode(code); -}); - -test('member off import with alias', () => { - const code = ` -// @filename: test.py -//// def [|/*marker*/foo|](): pass - -// @filename: moved.py -//// [|/*dest*/|] - -// @filename: used.py -//// import [|{|"r":"moved"|}test|] as t -//// t.foo() - `; - - testFromCode(code); -}); - -test('member off submodule with alias', () => { - const code = ` -// @filename: test.py -//// def [|/*marker*/foo|](): pass - -// @filename: moved.py -//// [|/*dest*/|] - -// @filename: used.py -//// from . import [|{|"r":"moved"|}test|] as test -//// test.foo() - `; - - testFromCode(code); -}); - -test('member off import with alias - dotted name', () => { - const code = ` -// @filename: test.py -//// def [|/*marker*/foo|](): pass - -// @filename: nested/moved.py -//// [|/*dest*/|] - -// @filename: used.py -//// import [|{|"r":"nested.moved"|}test|] as t -//// t.foo() - `; - - testFromCode(code); -}); - -test('member off submodule with alias - dotted name', () => { - const code = ` -// @filename: nested/test.py -//// def [|/*marker*/foo|](): pass - -// @filename: sub/moved.py -//// [|/*dest*/|] - -// @filename: used.py -//// from [|{|"r":"sub"|}nested|] import [|{|"r":"moved"|}test|] as test -//// test.foo() - `; - - testFromCode(code); -}); - -test('member off import - multiple symbols', () => { - const code = ` -// @filename: test.py -//// def [|/*marker*/foo|](): pass -//// def bar(): pass - -// @filename: moved.py -//// [|/*dest*/|] - -// @filename: used.py -//// [|{|"r":"import moved!n!"|}|]import test -//// [|{|"r":"moved"|}test|].foo() -//// test.bar() - `; - - testFromCode(code); -}); - -test('member off import - multiple symbols - existing import', () => { - const code = ` -// @filename: test.py -//// def [|/*marker*/foo|](): pass -//// def bar(): pass - -// @filename: moved.py -//// [|/*dest*/|] - -// @filename: used.py -//// import moved -//// import test -//// -//// [|{|"r":"moved"|}test|].foo() -//// test.bar() - `; - - testFromCode(code); -}); - -test('member off import - multiple symbols - existing import with alias', () => { - const code = ` -// @filename: test.py -//// def [|/*marker*/foo|](): pass -//// def bar(): pass - -// @filename: moved.py -//// [|/*dest*/|] - -// @filename: used.py -//// import moved as m -//// import test -//// -//// [|{|"r":"m"|}test|].foo() -//// test.bar() - `; - - testFromCode(code); -}); - -test('member off import - multiple symbols with alias - existing import', () => { - const code = ` -// @filename: test.py -//// def [|/*marker*/foo|](): pass -//// def bar(): pass - -// @filename: moved.py -//// [|/*dest*/|] - -// @filename: used.py -//// import moved -//// import test as t -//// -//// [|{|"r":"moved"|}t|].foo() -//// t.bar() - `; - - testFromCode(code); -}); - -test('member off import - multiple symbols with alias - new import', () => { - const code = ` -// @filename: test.py -//// def [|/*marker*/foo|](): pass -//// def bar(): pass - -// @filename: moved.py -//// [|/*dest*/|] - -// @filename: used.py -//// [|{|"r":"import moved!n!"|}|]import test as t -//// -//// [|{|"r":"moved"|}t|].foo() -//// t.bar() - `; - - testFromCode(code); -}); - -test('member off import - multiple symbols with alias - existing import with alias', () => { - const code = ` -// @filename: test.py -//// def [|/*marker*/foo|](): pass -//// def bar(): pass - -// @filename: moved.py -//// [|/*dest*/|] - -// @filename: used.py -//// import moved as m -//// import test as t -//// -//// [|{|"r":"m"|}t|].foo() -//// t.bar() - `; - - testFromCode(code); -}); - -test('member off import - multiple symbols - existing from import', () => { - const code = ` -// @filename: test.py -//// def [|/*marker*/foo|](): pass -//// def bar(): pass - -// @filename: moved.py -//// [|/*dest*/|] - -// @filename: used.py -//// from . import moved -//// import test -//// -//// [|{|"r":"moved"|}test|].foo() -//// test.bar() - `; - - testFromCode(code); -}); - -test('member off import - multiple symbols - existing from import with alias', () => { - const code = ` -// @filename: test.py -//// def [|/*marker*/foo|](): pass -//// def bar(): pass - -// @filename: moved.py -//// [|/*dest*/|] - -// @filename: used.py -//// from . import moved as m -//// import test -//// -//// [|{|"r":"m"|}test|].foo() -//// test.bar() - `; - - testFromCode(code); -}); - -test('member off import - multiple symbols - existing from import', () => { - const code = ` -// @filename: test.py -//// def [|/*marker*/foo|](): pass -//// def bar(): pass - -// @filename: moved.py -//// [|/*dest*/|] - -// @filename: used.py -//// from . import moved -//// import test -//// -//// [|{|"r":"moved"|}test|].foo() -//// test.bar() - `; - - testFromCode(code); -}); - -test('member off import - multiple symbols - existing from import with alias', () => { - const code = ` -// @filename: test.py -//// def [|/*marker*/foo|](): pass -//// def bar(): pass - -// @filename: moved.py -//// [|/*dest*/|] - -// @filename: used.py -//// from . import moved as m -//// import test -//// -//// [|{|"r":"m"|}test|].foo() -//// test.bar() - `; - - testFromCode(code); -}); - -test('member off from import - multiple symbols', () => { - const code = ` -// @filename: test.py -//// def [|/*marker*/foo|](): pass -//// def bar(): pass - -// @filename: moved.py -//// [|/*dest*/|] - -// @filename: used.py -//// [|{|"r":"import moved!n!"|}|]from . import test -//// [|{|"r":"moved"|}test|].foo() -//// test.bar() - `; - - testFromCode(code); -}); - -test('member off from import - multiple symbols - existing import', () => { - const code = ` -// @filename: test.py -//// def [|/*marker*/foo|](): pass -//// def bar(): pass - -// @filename: moved.py -//// [|/*dest*/|] - -// @filename: used.py -//// import moved -//// from . import test -//// -//// [|{|"r":"moved"|}test|].foo() -//// test.bar() - `; - - testFromCode(code); -}); - -test('member off from import - multiple symbols - existing import with alias', () => { - const code = ` -// @filename: test.py -//// def [|/*marker*/foo|](): pass -//// def bar(): pass - -// @filename: moved.py -//// [|/*dest*/|] - -// @filename: used.py -//// import moved as m -//// from . import test -//// -//// [|{|"r":"m"|}test|].foo() -//// test.bar() - `; - - testFromCode(code); -}); - -test('member off from import - multiple symbols with alias - existing import', () => { - const code = ` -// @filename: test.py -//// def [|/*marker*/foo|](): pass -//// def bar(): pass - -// @filename: moved.py -//// [|/*dest*/|] - -// @filename: used.py -//// import moved -//// from . import test as t -//// -//// [|{|"r":"moved"|}t|].foo() -//// t.bar() - `; - - testFromCode(code); -}); - -test('member off from import - multiple symbols with alias - new import', () => { - const code = ` -// @filename: test.py -//// def [|/*marker*/foo|](): pass -//// def bar(): pass - -// @filename: moved.py -//// [|/*dest*/|] - -// @filename: used.py -//// [|{|"r":"import moved!n!"|}|]from . import test as t -//// -//// [|{|"r":"moved"|}t|].foo() -//// t.bar() - `; - - testFromCode(code); -}); - -test('member off from import - multiple symbols with alias - existing import with alias', () => { - const code = ` -// @filename: test.py -//// def [|/*marker*/foo|](): pass -//// def bar(): pass - -// @filename: moved.py -//// [|/*dest*/|] - -// @filename: used.py -//// import moved as m -//// from . import test as t -//// -//// [|{|"r":"m"|}t|].foo() -//// t.bar() - `; - - testFromCode(code); -}); - -test('member off from import - multiple symbols - existing from import', () => { - const code = ` -// @filename: test.py -//// def [|/*marker*/foo|](): pass -//// def bar(): pass - -// @filename: moved.py -//// [|/*dest*/|] - -// @filename: used.py -//// from . import moved -//// from . import test -//// -//// [|{|"r":"moved"|}test|].foo() -//// test.bar() - `; - - testFromCode(code); -}); - -test('member off from import - multiple symbols - existing from import with alias', () => { - const code = ` -// @filename: test.py -//// def [|/*marker*/foo|](): pass -//// def bar(): pass - -// @filename: moved.py -//// [|/*dest*/|] - -// @filename: used.py -//// from . import moved as m -//// from . import test -//// -//// [|{|"r":"m"|}test|].foo() -//// test.bar() - `; - - testFromCode(code); -}); - -test('member off import - error case that we dont touch - function return module', () => { - // We could put import in test so test module still has symbol "foo" but - // for now, we won't handle such corner case. - const code = ` -// @filename: test.py -//// def [|/*marker*/foo|](): pass - -// @filename: test2.py -//// def foo(): pass - -// @filename: moved.py -//// [|/*dest*/|] - -// @filename: used.py -//// from test -//// from test2 -//// def getTestModule(a): -//// return test if a > 0 else test2 -//// -//// getTestModule(1).foo() - `; - - testFromCode(code); -}); - -test('member off import - error case that we dont touch - field return module', () => { - // We could put import in test so test module still has symbol "foo" but - // for now, we won't handle such corner case. - const code = ` -// @filename: test.py -//// def [|/*marker*/foo|](): pass - -// @filename: test2.py -//// def foo(): pass - -// @filename: moved.py -//// [|/*dest*/|] - -// @filename: used.py -//// from test -//// from test2 -//// module = test if a > 0 else test2 -//// -//// module.foo() - `; - - testFromCode(code); -}); - -test('simple symbol reference', () => { - const code = ` -// @filename: test.py -//// def [|/*marker*/foo|](): -//// return 1 - -// @filename: moved.py -//// [|/*dest*/|] - -// @filename: used.py -//// from [|{|"r":"moved"|}test|] import foo -//// -//// foo() -//// b = foo().real - `; - - testFromCode(code); -}); - -function testFromCode(code: string) { - const state = parseAndGetTestState(code).state; - - testMoveSymbolAtPosition( - state, - state.getMarkerByName('marker').fileName, - state.getMarkerByName('dest').fileName, - state.getPositionRange('marker').start - ); -} diff --git a/packages/pyright-internal/src/tests/workspaceEditUtils.test.ts b/packages/pyright-internal/src/tests/workspaceEditUtils.test.ts new file mode 100644 index 000000000..8385e1836 --- /dev/null +++ b/packages/pyright-internal/src/tests/workspaceEditUtils.test.ts @@ -0,0 +1,202 @@ +/* + * workspaceEditUtils.test.ts + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT license. + * + * test workspaceEditUtils + */ + +import * as assert from 'assert'; +import { TextDocumentEdit } from 'vscode-languageserver-types'; + +import { convertPathToUri } from '../common/pathUtils'; +import { applyWorkspaceEdit, generateWorkspaceEdit } from '../common/workspaceEditUtils'; +import { AnalyzerServiceExecutor } from '../languageService/analyzerServiceExecutor'; +import { TestLanguageService } from './harness/fourslash/testLanguageService'; +import { parseAndGetTestState, TestState } from './harness/fourslash/testState'; +import { verifyWorkspaceEdit } from './harness/fourslash/workspaceEditTestUtils'; + +test('test applyWorkspaceEdits changes', async () => { + const code = ` +// @filename: test.py +//// [|/*marker*/|] + `; + + const state = parseAndGetTestState(code).state; + const cloned = await getClonedService(state); + const range = state.getRangeByMarkerName('marker')!; + + const fileChanged = new Set(); + applyWorkspaceEdit( + cloned, + { + changes: { + [convertPathToUri(cloned.fs, range.fileName)]: [ + { + range: state.convertPositionRange(range), + newText: 'Text Changed', + }, + ], + }, + }, + fileChanged + ); + + assert.strictEqual(fileChanged.size, 1); + assert.strictEqual(cloned.test_program.getSourceFile(range.fileName)?.getFileContent(), 'Text Changed'); +}); + +test('test applyWorkspaceEdits documentChanges', async () => { + const code = ` +// @filename: test.py +//// [|/*marker*/|] + `; + + const state = parseAndGetTestState(code).state; + const cloned = await getClonedService(state); + const range = state.getRangeByMarkerName('marker')!; + + const fileChanged = new Set(); + applyWorkspaceEdit( + cloned, + { + documentChanges: [ + TextDocumentEdit.create( + { + uri: convertPathToUri(cloned.fs, range.fileName), + version: null, + }, + [ + { + range: state.convertPositionRange(range), + newText: 'Text Changed', + }, + ] + ), + ], + }, + fileChanged + ); + + assert.strictEqual(fileChanged.size, 1); + assert.strictEqual(cloned.test_program.getSourceFile(range.fileName)?.getFileContent(), 'Text Changed'); +}); + +test('test generateWorkspaceEdits', async () => { + const code = ` +// @filename: test1.py +//// [|/*marker1*/|] + +// @filename: test2.py +//// [|/*marker2*/|] + `; + + const state = parseAndGetTestState(code).state; + const cloned = await getClonedService(state); + const range1 = state.getRangeByMarkerName('marker1')!; + + const fileChanged = new Set(); + applyWorkspaceEdit( + cloned, + { + changes: { + [convertPathToUri(cloned.fs, range1.fileName)]: [ + { + range: state.convertPositionRange(range1), + newText: 'Test1 Changed', + }, + ], + }, + }, + fileChanged + ); + + applyWorkspaceEdit( + cloned, + { + documentChanges: [ + TextDocumentEdit.create( + { + uri: convertPathToUri(cloned.fs, range1.fileName), + version: null, + }, + [ + { + range: { start: { line: 0, character: 0 }, end: { line: 0, character: 5 } }, + newText: 'NewTest1', + }, + ] + ), + ], + }, + fileChanged + ); + + const range2 = state.getRangeByMarkerName('marker2')!; + applyWorkspaceEdit( + cloned, + { + documentChanges: [ + TextDocumentEdit.create( + { + uri: convertPathToUri(cloned.fs, range2.fileName), + version: null, + }, + [ + { + range: state.convertPositionRange(range2), + newText: 'Test2 Changed', + }, + ] + ), + ], + }, + fileChanged + ); + + applyWorkspaceEdit( + cloned, + { + changes: { + [convertPathToUri(cloned.fs, range2.fileName)]: [ + { + range: { start: { line: 0, character: 0 }, end: { line: 0, character: 5 } }, + newText: 'NewTest2', + }, + ], + }, + }, + fileChanged + ); + + assert.strictEqual(fileChanged.size, 2); + + const actualEdits = generateWorkspaceEdit(state.workspace.service, cloned, fileChanged); + verifyWorkspaceEdit( + { + changes: { + [convertPathToUri(cloned.fs, range1.fileName)]: [ + { + range: state.convertPositionRange(range1), + newText: 'NewTest1 Changed', + }, + ], + [convertPathToUri(cloned.fs, range2.fileName)]: [ + { + range: state.convertPositionRange(range1), + newText: 'NewTest2 Changed', + }, + ], + }, + }, + actualEdits + ); +}); + +async function getClonedService(state: TestState) { + return await AnalyzerServiceExecutor.cloneService( + new TestLanguageService(state.workspace, state.console, state.workspace.service.fs), + state.workspace, + { useBackgroundAnalysis: false } + ); +} diff --git a/packages/pyright-internal/src/workspaceFactory.ts b/packages/pyright-internal/src/workspaceFactory.ts new file mode 100644 index 000000000..89961b86c --- /dev/null +++ b/packages/pyright-internal/src/workspaceFactory.ts @@ -0,0 +1,607 @@ +/* + * workspaceFactory.ts + * + * Workspace management related functionality. + */ + +import { InitializeParams, WorkspaceFoldersChangeEvent } from 'vscode-languageserver'; + +import { AnalyzerService } from './analyzer/service'; +import { ConsoleInterface } from './common/console'; +import { createDeferred } from './common/deferred'; +import { UriParser } from './common/uriParser'; + +let WorkspaceFactoryIdCounter = 0; + +export enum WellKnownWorkspaceKinds { + Default = 'default', + Regular = 'regular', + Limited = 'limited', + Cloned = 'cloned', + Test = 'test', +} + +export enum WorkspacePythonPathKind { + Immutable = 'immutable', + Mutable = 'mutable', +} + +export interface InitStatus { + resolve(): void; + reset(): InitStatus; + markCalled(): void; + promise: Promise; + resolved(): boolean; +} + +export function createInitStatus(): InitStatus { + // Due to the way we get `python path`, `include/exclude` from settings to initialize workspace, + // we need to wait for getSettings to finish before letting IDE features to use workspace (`isInitialized` field). + // So most of cases, whenever we create new workspace, we send request to workspace/configuration right way + // except one place which is `initialize` LSP call. + // In `initialize` method where we create `initial workspace`, we can't do that since LSP spec doesn't allow + // LSP server from sending any request to client until `initialized` method is called. + // This flag indicates whether we had our initial updateSetting call or not after `initialized` call. + let called = false; + + const deferred = createDeferred(); + const self = { + promise: deferred.promise, + resolve: () => { + called = true; + deferred.resolve(); + }, + markCalled: () => { + called = true; + }, + reset: () => { + if (!called) { + return self; + } + + return createInitStatus(); + }, + resolved: () => { + return deferred.resolved; + }, + }; + + return self; +} + +// path and uri will point to a workspace itself. It could be a folder +// if the workspace represents a folder. it could be '' if it is the default workspace. +// But it also could be a file if it is a virtual workspace. +// rootPath will always point to the folder that contains the workspace. +export interface Workspace { + workspaceName: string; + rootPath: string; + uri: string; + kinds: string[]; + service: AnalyzerService; + disableLanguageServices: boolean; + disableOrganizeImports: boolean; + disableWorkspaceSymbol: boolean; + isInitialized: InitStatus; + searchPathsToWatch: string[]; + pythonPath: string | undefined; + pythonPathKind: WorkspacePythonPathKind; +} + +export class WorkspaceFactory { + private _defaultWorkspacePath = ''; + private _map = new Map(); + private _id = WorkspaceFactoryIdCounter++; + + constructor( + private readonly _console: ConsoleInterface, + private readonly _uriParser: UriParser, + private readonly _createService: ( + name: string, + rootPath: string, + uri: string, + kinds: string[] + ) => AnalyzerService, + private readonly _isPythonPathImmutable: (path: string) => boolean, + private readonly _onWorkspaceCreated: (workspace: Workspace) => void + ) { + this._console.log(`WorkspaceFactory ${this._id} created`); + } + + handleInitialize(params: InitializeParams) { + // Create a service instance for each of the workspace folders. + if (params.workspaceFolders) { + params.workspaceFolders.forEach((folder) => { + const path = this._uriParser.decodeTextDocumentUri(folder.uri); + this._add(folder.uri, path, folder.name, undefined, WorkspacePythonPathKind.Mutable, [ + WellKnownWorkspaceKinds.Regular, + ]); + }); + } else if (params.rootPath) { + this._add(params.rootUri || '', params.rootPath, '', undefined, WorkspacePythonPathKind.Mutable, [ + WellKnownWorkspaceKinds.Regular, + ]); + } + } + + handleWorkspaceFoldersChanged(params: WorkspaceFoldersChangeEvent) { + params.removed.forEach((workspaceInfo) => { + const rootPath = this._uriParser.decodeTextDocumentUri(workspaceInfo.uri); + // Delete all workspaces for this folder. Even the ones generated for notebook kernels. + const workspaces = this.getNonDefaultWorkspaces().filter((w) => w.rootPath === rootPath); + workspaces.forEach((w) => { + this._remove(w); + }); + }); + + params.added.forEach((workspaceInfo) => { + const rootPath = this._uriParser.decodeTextDocumentUri(workspaceInfo.uri); + + // If there's a workspace that contains this folder, we need to mimic files from this workspace to + // to the new one. Otherwise the subfolder won't have the changes for the files in it. + const containing = this.items().filter((w) => rootPath.startsWith(w.rootPath))[0]; + + // Add the new workspace. + const newWorkspace = this._add( + workspaceInfo.uri, + rootPath, + workspaceInfo.name, + undefined, + WorkspacePythonPathKind.Mutable, + [WellKnownWorkspaceKinds.Regular] + ); + + // Move files from the containing workspace to the new one that are in the new folder. + if (containing) { + this._mimicOpenFiles(containing, newWorkspace, (f) => f.startsWith(rootPath)); + } + }); + } + + items() { + return [...this._map.values()]; + } + + applyPythonPath(workspace: Workspace, newPythonPath: string | undefined): string | undefined { + // See if were allowed to apply the new python path + if (workspace.pythonPathKind === WorkspacePythonPathKind.Mutable && newPythonPath) { + const originalPythonPath = workspace.pythonPath; + workspace.pythonPath = newPythonPath; + + // This may not be the workspace in our map. Update the workspace in the map too. + // This can happen during startup were the Initialize creates a workspace and then + // onDidChangeConfiguration is called right away. + const key = this._getWorkspaceKey(workspace); + const workspaceInMap = this._map.get(key); + if (workspaceInMap) { + workspaceInMap.pythonPath = newPythonPath; + } + + // If the python path has changed, we may need to move the immutable files to the correct workspace. + if (originalPythonPath && originalPythonPath !== newPythonPath && workspaceInMap) { + // Potentially move immutable files from one workspace to another. + this._moveImmutableFilesToCorrectWorkspace(originalPythonPath, workspaceInMap); + } + } + + // Return the python path that should be used (whether hardcoded or configured) + return workspace.pythonPath; + } + + clear() { + this._map.forEach((workspace) => { + workspace.isInitialized.resolve(); + workspace.service.dispose(); + }); + this._map.clear(); + this._console.log(`WorkspaceFactory ${this._id} clear`); + } + + hasMultipleWorkspaces(kind?: string) { + if (this._map.size === 0 || this._map.size === 1) { + return false; + } + + let count = 0; + for (const kv of this._map) { + if (!kind || kv[1].kinds.some((k) => k === kind)) { + count++; + } + + if (count > 1) { + return true; + } + } + + return false; + } + + getContainingWorkspace(filePath: string, pythonPath?: string) { + return this._getBestRegularWorkspace( + this.getNonDefaultWorkspaces(WellKnownWorkspaceKinds.Regular).filter((w) => + filePath.startsWith(w.rootPath) + ), + pythonPath + ); + } + + moveFiles(filePaths: string[], fromWorkspace: Workspace, toWorkspace: Workspace) { + if (fromWorkspace === toWorkspace) { + return; + } + + try { + filePaths.forEach((f) => { + const fileInfo = fromWorkspace.service.backgroundAnalysisProgram.program.getSourceFileInfo(f); + if (fileInfo) { + // Copy the source file data (closing can destroy the sourceFile) + const version = fileInfo.sourceFile.getClientVersion() || null; + const content = fileInfo.sourceFile.getFileContent() || ''; + const ipythonMode = fileInfo.sourceFile.getIPythonMode(); + const chainedSourceFile = fileInfo.chainedSourceFile?.sourceFile.getFilePath(); + const realFilePath = fileInfo.sourceFile.getRealFilePath(); + + // Remove the file from the old workspace first (closing will propagate to the toWorkspace automatically). + fromWorkspace.service.setFileClosed(f, /*isTracked*/ false); + + // Then open it in the toWorkspace so that it is marked tracked there. + toWorkspace.service.setFileOpened( + f, + version, + content, + ipythonMode, + chainedSourceFile, + realFilePath + ); + } + }); + + // If the fromWorkspace has no more files in it (and it's an immutable pythonPath), then remove it. + this.removeUnused(fromWorkspace); + } catch (e: any) { + this._console.error(e.toString()); + } + } + + getNonDefaultWorkspaces(kind?: string): Workspace[] { + const workspaces: Workspace[] = []; + this._map.forEach((workspace) => { + if (!workspace.rootPath) { + return; + } + + if (kind && !workspace.kinds.some((k) => k === kind)) { + return; + } + + workspaces.push(workspace); + }); + + return workspaces; + } + + // Returns the best workspace for a file. Waits for the workspace to be finished handling other events before + // returning the appropriate workspace. + async getWorkspaceForFile(filePath: string, pythonPath: string | undefined): Promise { + // Wait for all workspaces to be initialized before attempting to find the best workspace. Otherwise + // the list of files won't be complete and the `contains` check might fail. + await Promise.all(this.items().map((w) => w.isInitialized.promise)); + + // Find or create best match. + const workspace = await this._getOrCreateBestWorkspaceForFile(filePath, pythonPath); + + // The workspace may have just been created. Wait for it to be initialized before returning it. + await workspace.isInitialized.promise; + + return workspace; + } + + async getContainingWorkspacesForFile(filePath: string): Promise { + // Wait for all workspaces to be initialized before attempting to find the best workspace. Otherwise + // the list of files won't be complete and the `contains` check might fail. + await Promise.all(this.items().map((w) => w.isInitialized.promise)); + + // All workspaces that track the file should be considered. + let workspaces = this.items().filter((w) => w.service.isTracked(filePath)); + + // If that list is empty, get the best workspace + if (workspaces.length === 0) { + workspaces.push(this._getOrCreateBestWorkspaceFileSync(filePath, undefined)); + } + + // If the file is immutable, then only return that workspace. + if (this._isPythonPathImmutable(filePath)) { + workspaces = workspaces.filter((w) => w.pythonPathKind === WorkspacePythonPathKind.Immutable); + } + + // The workspaces may have just been created, wait for them all to be initialized + await Promise.all(workspaces.map((w) => w.isInitialized.promise)); + + return workspaces; + } + + removeUnused(workspace: Workspace) { + // Only remove this workspace is it's not being used for immutable files and it's an immutable path kind. + if ( + workspace.service.getOpenFiles().filter((f) => this._isPythonPathImmutable(f)).length === 0 && + workspace.pythonPathKind === WorkspacePythonPathKind.Immutable + ) { + // Destroy the workspace since it only had immutable files in it. + this._remove(workspace); + } + } + + private async _moveImmutableFilesToCorrectWorkspace(oldPythonPath: string, mutableWorkspace: Workspace) { + // If the python path changes we may need to move some immutable files around. + // For example, if a notebook had the old python path, we need to create a new workspace + // for the notebook. + // If a notebook has the new python path but is currently in a workspace with the path hardcoded, we need to move it to + // this workspace. + const oldPathFiles = [ + ...new Set(mutableWorkspace.service.getOpenFiles().filter((f) => this._isPythonPathImmutable(f))), + ]; + const exitingWorkspaceWithSamePath = this.items().find( + (w) => w.pythonPath === mutableWorkspace.pythonPath && w !== mutableWorkspace + ); + const newPathFiles = new Set( + exitingWorkspaceWithSamePath?.service.getOpenFiles().filter((f) => this._isPythonPathImmutable(f)) + ); + + // Immutable files that were in this mutableWorkspace have to be moved + // to a (potentially) new workspace (with the old path). + if (oldPathFiles.length > 0) { + // Given that all of these files were in the same workspace, there should be only + // one immutable workspace for all of them. So we can just use the first file. + const workspace = this._getOrCreateBestWorkspaceFileSync(oldPathFiles[0], oldPythonPath); + if (workspace !== mutableWorkspace) { + this.moveFiles(oldPathFiles, mutableWorkspace, workspace); + } + } + + // Immutable files from a different workspace (with the same path as the new path) + // have to be moved to the mutable workspace (which now has the new path) + if (exitingWorkspaceWithSamePath) { + this.moveFiles([...newPathFiles], exitingWorkspaceWithSamePath!, mutableWorkspace); + this.removeUnused(exitingWorkspaceWithSamePath); + } + } + + private _add( + rootUri: string, + rootPath: string, + name: string, + pythonPath: string | undefined, + pythonPathKind: WorkspacePythonPathKind, + kinds: string[] + ) { + // Update the kind based of the uri is local or not + if (!this._uriParser.isLocal(rootUri)) { + // Web based workspace should be limited. + kinds = [...kinds, WellKnownWorkspaceKinds.Limited]; + } + + const result: Workspace = { + workspaceName: name, + rootPath, + uri: rootUri, + kinds, + pythonPath, + pythonPathKind, + service: this._createService(name, rootPath, rootUri, kinds), + disableLanguageServices: false, + disableOrganizeImports: false, + disableWorkspaceSymbol: false, + isInitialized: createInitStatus(), + searchPathsToWatch: [], + }; + + // Tell our owner we added something + this._onWorkspaceCreated(result); + + // Stick in our map + const key = this._getWorkspaceKey(result); + + // Make sure to delete existing workspaces if there are any. + this._remove(result); + this._console.log(`WorkspaceFactory ${this._id} add ${key}`); + this._map.set(key, result); + + return result; + } + + private _remove(value: Workspace) { + const key = this._getWorkspaceKey(value); + const workspace = this._map.get(key); + if (workspace) { + workspace.isInitialized.resolve(); + workspace.service.dispose(); + this._console.log(`WorkspaceFactory ${this._id} remove ${key}`); + this._map.delete(key); + } + } + + private _getDefaultWorskpaceKey(pythonPath: string | undefined) { + return `${this._defaultWorkspacePath}:${pythonPath ? pythonPath : WorkspacePythonPathKind.Mutable}`; + } + + private _getWorkspaceKey(value: Workspace) { + // Special the root path for the default workspace. It will be created + // without a root path + const rootPath = value.kinds.includes(WellKnownWorkspaceKinds.Default) + ? this._defaultWorkspacePath + : value.rootPath; + + // Key is defined by the rootPath and the pythonPath. We might include platform in this, but for now + // platform is only used by the import resolver. + return `${rootPath}:${ + value.pythonPathKind === WorkspacePythonPathKind.Mutable ? value.pythonPathKind : value.pythonPath + }`; + } + + private async _getOrCreateBestWorkspaceForFile( + filePath: string, + pythonPath: string | undefined + ): Promise { + // Find the current best workspace (without creating a new one) + let bestInstance = this._getBestWorkspaceForFile(filePath, pythonPath); + + // Make sure the best instance is initialized so that it has its pythonPath. + await bestInstance.isInitialized.promise; + + // If this best instance doesn't match the pythonPath, then we need to create a new one. + if (pythonPath && bestInstance.pythonPath !== pythonPath) { + bestInstance = this._createImmutableCopy(bestInstance, pythonPath); + } + + return bestInstance; + } + + private _getOrCreateBestWorkspaceFileSync(filePath: string, pythonPath: string | undefined) { + // Find the current best workspace (without creating a new one) + let bestInstance = this._getBestWorkspaceForFile(filePath, pythonPath); + + // If this best instance doesn't match the pythonPath, then we need to create a new one. + if (pythonPath && bestInstance.pythonPath !== pythonPath) { + bestInstance = this._createImmutableCopy(bestInstance, pythonPath); + } + + return bestInstance; + } + + private _mimicOpenFiles(source: Workspace, dest: Workspace, predicate: (f: string) => boolean) { + // All mutable open files in the first workspace should be opened in the new workspace. + // Immutable files should stay where they are since they're tied to a specific workspace. + const files = source.service.getOpenFiles().filter((f) => !this._isPythonPathImmutable(f)); + for (const file of files) { + const sourceFileInfo = source.service.backgroundAnalysisProgram.program.getSourceFileInfo(file); + if (sourceFileInfo && predicate(file)) { + const sourceFile = sourceFileInfo.sourceFile; + const fileContents = sourceFile.getFileContent(); + dest.service.setFileOpened( + file, + sourceFile.getClientVersion() || null, + fileContents || '', + sourceFile.getIPythonMode(), + sourceFileInfo.chainedSourceFile?.sourceFile.getFilePath(), + sourceFile.getRealFilePath() + ); + } + } + } + + private _createImmutableCopy(workspace: Workspace, pythonPath: string): Workspace { + const result = this._add( + workspace.uri, + workspace.rootPath, + workspace.workspaceName, + pythonPath, + WorkspacePythonPathKind.Immutable, + workspace.kinds + ); + + // Copy over the open files + this._mimicOpenFiles(workspace, result, () => true); + + return result; + } + + private _getBestWorkspaceForFile(filePath: string, pythonPath: string | undefined): Workspace { + let bestInstance: Workspace | undefined; + + // The order of how we find the best matching workspace for the given file is + // 1. The given file is the workspace itself (ex, a file being a virtual workspace itself). + // 2. The given file matches the fileSpec of the service under the workspace + // (the file is a user file the workspace provides LSP service for). + // 3. The given file doesn't match anything but we have only 1 regular workspace + // (ex, open a library file from the workspace). + // 4. The given file doesn't match anything and there are multiple workspaces but one of workspaces + // contains the file (ex, open a library file already imported by a workspace). + // 5. If none of the above works, then it matches the default workspace. + + // First find the workspaces that are tracking the file + const regularWorkspaces = this.getNonDefaultWorkspaces(WellKnownWorkspaceKinds.Regular); + const trackingWorkspaces = this.items().filter((w) => w.service.isTracked(filePath)); + + // Then find the best in all of those that actually matches the pythonPath. + bestInstance = this._getBestRegularWorkspace(trackingWorkspaces, pythonPath); + + // If it's not in a tracked workspace, see if we only have regular workspaces with the same + // length root path + if ( + bestInstance === undefined && + regularWorkspaces.every((w) => w.rootPath.length === regularWorkspaces[0].rootPath.length) + ) { + bestInstance = this._getBestRegularWorkspace(regularWorkspaces, pythonPath); + } + + // If the regular workspaces don't all have the same length, then try the workspaces that already have the file open or scanned. + if (bestInstance === undefined) { + bestInstance = this._getBestRegularWorkspace( + regularWorkspaces.filter((w) => w.service.hasSourceFile(filePath)), + pythonPath + ); + } + + // If that still didn't work, that must mean we don't have a workspace. Create a default one. + if (bestInstance === undefined) { + bestInstance = this._getOrCreateDefaultWorkspace(pythonPath); + } + + return bestInstance; + } + + private _getOrCreateDefaultWorkspace(pythonPath: string | undefined): Workspace { + // Default key depends upon the pythonPath + let defaultWorkspace = this._map.get(this._getDefaultWorskpaceKey(pythonPath)); + if (!defaultWorkspace) { + // Create a default workspace for files that are outside + // of all workspaces. + defaultWorkspace = this._add( + '', + '', + this._defaultWorkspacePath, + pythonPath, + pythonPath ? WorkspacePythonPathKind.Immutable : WorkspacePythonPathKind.Mutable, + [WellKnownWorkspaceKinds.Default] + ); + } + + return defaultWorkspace; + } + + private _getLongestPathWorkspace(workspaces: Workspace[]): Workspace { + const longestPath = workspaces.reduce((previousPath, currentWorkspace) => { + if (!previousPath) { + return currentWorkspace.rootPath; + } + if (currentWorkspace.rootPath.length > previousPath.length) { + return currentWorkspace.rootPath; + } + + return previousPath; + }, ''); + return workspaces.find((w) => w.rootPath === longestPath)!; + } + + private _getBestRegularWorkspace(workspaces: Workspace[], pythonPath?: string): Workspace | undefined { + if (workspaces.length === 0) { + return undefined; + } + + // If there's only one, then it's the best. + if (workspaces.length === 1) { + return workspaces[0]; + } + + // If there's any that match the python path, take the one with the longest path from those. + if (pythonPath) { + const matchingWorkspaces = workspaces.filter((w) => w.pythonPath === pythonPath); + if (matchingWorkspaces.length > 0) { + return this._getLongestPathWorkspace(matchingWorkspaces); + } + } + + // Otherwise, just take the longest path. + return this._getLongestPathWorkspace(workspaces); + } +} diff --git a/packages/pyright-internal/src/workspaceMap.ts b/packages/pyright-internal/src/workspaceMap.ts deleted file mode 100644 index 316c0aaa0..000000000 --- a/packages/pyright-internal/src/workspaceMap.ts +++ /dev/null @@ -1,118 +0,0 @@ -/* - * workspaceMap.ts - * - * Workspace management related functionality. - */ - -import { createDeferred } from './common/deferred'; -import { LanguageServerBase, WellKnownWorkspaceKinds, WorkspaceServiceInstance } from './languageServerBase'; - -export class WorkspaceMap extends Map { - private _defaultWorkspacePath = ''; - - override delete(key: string): boolean { - const workspace = this.get(key); - if (!workspace) { - return false; - } - - // Make sure we shutdown BG for the workspace. - workspace.serviceInstance.backgroundAnalysisProgram.backgroundAnalysis?.shutdown(); - return super.delete(key); - } - - hasMultipleWorkspaces(kind?: string) { - if (this.size === 0 || this.size === 1) { - return false; - } - - let count = 0; - for (const kv of this) { - if (!kind || kv[1].kinds.some((k) => k === kind)) { - count++; - } - - if (count > 1) { - return true; - } - } - - return false; - } - - getNonDefaultWorkspaces(kind?: string): WorkspaceServiceInstance[] { - const workspaces: WorkspaceServiceInstance[] = []; - this.forEach((workspace) => { - if (!workspace.path) { - return; - } - - if (kind && !workspace.kinds.some((k) => k === kind)) { - return; - } - - workspaces.push(workspace); - }); - - return workspaces; - } - - getWorkspaceForFile(ls: LanguageServerBase, filePath: string): WorkspaceServiceInstance { - let bestRootPath: string | undefined; - let bestInstance: WorkspaceServiceInstance | undefined; - - this.forEach((workspace) => { - if (workspace.path) { - // Is the file is under this workspace folder? - if (!workspace.owns(filePath)) { - return; - } - - // Is this the fist candidate? If not, is this workspace folder - // contained within the previous candidate folder? We always want - // to select the innermost folder, since that overrides the - // outer folders. - if (bestRootPath === undefined || workspace.path.startsWith(bestRootPath)) { - bestRootPath = workspace.path; - bestInstance = workspace; - } - } - }); - - // If there were multiple workspaces or we couldn't find any, - // create a default one to use for this file. - if (bestInstance === undefined) { - let defaultWorkspace = this.get(this._defaultWorkspacePath); - if (!defaultWorkspace) { - // If there is only one workspace, use that one. - const workspaceNames = [...this.keys()]; - if (workspaceNames.length === 1) { - return this.get(workspaceNames[0])!; - } - - // Create a default workspace for files that are outside - // of all workspaces. - defaultWorkspace = { - workspaceName: '', - rootPath: '', - path: '', - uri: '', - serviceInstance: ls.createAnalyzerService(this._defaultWorkspacePath), - kinds: [WellKnownWorkspaceKinds.Default], - disableLanguageServices: false, - disableOrganizeImports: false, - disableWorkspaceSymbol: false, - isInitialized: createDeferred(), - searchPathsToWatch: [], - owns: (f) => true, - }; - this.set(this._defaultWorkspacePath, defaultWorkspace); - ls.updateSettingsForWorkspace(defaultWorkspace).ignoreErrors(); - } - - return defaultWorkspace; - } - - return bestInstance; - } -} diff --git a/packages/pyright-internal/typeshed-fallback/LICENSE b/packages/pyright-internal/typeshed-fallback/LICENSE index e5833ae42..132644875 100644 --- a/packages/pyright-internal/typeshed-fallback/LICENSE +++ b/packages/pyright-internal/typeshed-fallback/LICENSE @@ -235,4 +235,3 @@ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. = = = = = - diff --git a/packages/pyright-internal/typeshed-fallback/README.md b/packages/pyright-internal/typeshed-fallback/README.md index afd140b10..d5d806dd1 100644 --- a/packages/pyright-internal/typeshed-fallback/README.md +++ b/packages/pyright-internal/typeshed-fallback/README.md @@ -1,8 +1,8 @@ # typeshed -[![Build status](https://github.com/python/typeshed/workflows/Check%20stubs/badge.svg)](https://github.com/python/typeshed/actions?query=workflow%3A%22Check+stubs%22) +[![Tests](https://github.com/python/typeshed/actions/workflows/tests.yml/badge.svg)](https://github.com/python/typeshed/actions/workflows/tests.yml) [![Chat at https://gitter.im/python/typing](https://badges.gitter.im/python/typing.svg)](https://gitter.im/python/typing?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -[![Pull Requests Welcome](https://img.shields.io/badge/pull%20requests-welcome-brightgreen.svg)](https://github.com/python/typeshed/blob/master/CONTRIBUTING.md) +[![Pull Requests Welcome](https://img.shields.io/badge/pull%20requests-welcome-brightgreen.svg)](https://github.com/python/typeshed/blob/main/CONTRIBUTING.md) ## About @@ -17,18 +17,25 @@ contributors can be found in [CONTRIBUTING.md](CONTRIBUTING.md). **Please read it before submitting pull requests; do not report issues with annotations to the project the stubs are for, but instead report them here to typeshed.** -Typeshed supports Python versions 2.7 and 3.6 and up. +Further documentation on stub files, typeshed, and Python's typing system in +general, can also be found at https://typing.readthedocs.io/en/latest/. + +Typeshed supports Python versions 3.7 and up. ## Using -If you're just using mypy (or pytype or PyCharm), as opposed to +If you're just using a type checker ([mypy](https://github.com/python/mypy/), +[pyright](https://github.com/microsoft/pyright), +[pytype](https://github.com/google/pytype/), PyCharm, ...), as opposed to developing it, you don't need to interact with the typeshed repo at -all: a copy of standard library part of typeshed is bundled with mypy. +all: a copy of standard library part of typeshed is bundled with type checkers. And type stubs for third party packages and modules you are using can be installed from PyPI. For example, if you are using `six` and `requests`, you can install the type stubs using - $ pip install types-six types-requests +```bash +$ pip install types-six types-requests +``` These PyPI packages follow [PEP 561](http://www.python.org/dev/peps/pep-0561/) and are automatically released (multiple times a day, when needed) by @@ -42,7 +49,7 @@ details, see the documentation for your type checker. typeshed includes a package `_typeshed` as part of the standard library. This package and its submodules contains utility types, but is not available at runtime. For more information about how to use this package, -[see the `stdlib/_typeshed` directory](https://github.com/python/typeshed/tree/master/stdlib/_typeshed). +[see the `stdlib/_typeshed` directory](https://github.com/python/typeshed/tree/main/stdlib/_typeshed). ## Discussion diff --git a/packages/pyright-internal/typeshed-fallback/commit.txt b/packages/pyright-internal/typeshed-fallback/commit.txt index 10c6e7ae5..3208cb04b 100644 --- a/packages/pyright-internal/typeshed-fallback/commit.txt +++ b/packages/pyright-internal/typeshed-fallback/commit.txt @@ -1 +1 @@ -d7a5a147a0740816b837614c5f8fd429d0b8756e +8080e491d2fa92b1b1390c87fac23a1a38dcd919 diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/VERSIONS b/packages/pyright-internal/typeshed-fallback/stdlib/VERSIONS index d396ce4d0..d24aa35fa 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/VERSIONS +++ b/packages/pyright-internal/typeshed-fallback/stdlib/VERSIONS @@ -27,6 +27,7 @@ _collections_abc: 3.3- _compat_pickle: 3.1- _compression: 3.5- _csv: 2.7- +_ctypes: 2.7- _curses: 2.7- _decimal: 3.3- _dummy_thread: 3.0-3.8 @@ -151,6 +152,7 @@ importlib: 2.7- importlib.metadata: 3.8- importlib.metadata._meta: 3.10- importlib.resources: 3.7- +importlib.resources.abc: 3.11- inspect: 2.7- io: 2.7- ipaddress: 3.3- diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/_ast.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/_ast.pyi index c68e921ba..7bc47266d 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/_ast.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/_ast.pyi @@ -104,14 +104,14 @@ class Assign(stmt): class AugAssign(stmt): if sys.version_info >= (3, 10): __match_args__ = ("target", "op", "value") - target: expr + target: Name | Attribute | Subscript op: operator value: expr class AnnAssign(stmt): if sys.version_info >= (3, 10): __match_args__ = ("target", "annotation", "value", "simple") - target: expr + target: Name | Attribute | Subscript annotation: expr value: expr | None simple: int @@ -194,7 +194,7 @@ class Import(stmt): class ImportFrom(stmt): if sys.version_info >= (3, 10): __match_args__ = ("module", "names", "level") - module: _Identifier | None + module: str | None names: list[alias] level: int @@ -329,7 +329,7 @@ class JoinedStr(expr): if sys.version_info < (3, 8): class Num(expr): # Deprecated in 3.8; use Constant - n: complex + n: int | float | complex class Str(expr): # Deprecated in 3.8; use Constant s: str @@ -349,13 +349,13 @@ class Constant(expr): kind: str | None # Aliases for value, for backwards compatibility s: Any - n: complex + n: int | float | complex if sys.version_info >= (3, 8): class NamedExpr(expr): if sys.version_info >= (3, 10): __match_args__ = ("target", "value") - target: expr + target: Name value: expr class Attribute(expr): diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/_bisect.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/_bisect.pyi index d902e1eea..58488e3d1 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/_bisect.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/_bisect.pyi @@ -1,6 +1,6 @@ import sys -from _typeshed import SupportsRichComparisonT -from collections.abc import Callable, MutableSequence, Sequence +from _typeshed import SupportsLenAndGetItem, SupportsRichComparisonT +from collections.abc import Callable, MutableSequence from typing import TypeVar, overload _T = TypeVar("_T") @@ -8,67 +8,77 @@ _T = TypeVar("_T") if sys.version_info >= (3, 10): @overload def bisect_left( - a: Sequence[SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int = ..., hi: int | None = ..., *, key: None = ... + a: SupportsLenAndGetItem[SupportsRichComparisonT], + x: SupportsRichComparisonT, + lo: int = 0, + hi: int | None = None, + *, + key: None = None, ) -> int: ... @overload def bisect_left( - a: Sequence[_T], + a: SupportsLenAndGetItem[_T], x: SupportsRichComparisonT, - lo: int = ..., - hi: int | None = ..., + lo: int = 0, + hi: int | None = None, *, - key: Callable[[_T], SupportsRichComparisonT] = ..., + key: Callable[[_T], SupportsRichComparisonT], ) -> int: ... @overload def bisect_right( - a: Sequence[SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int = ..., hi: int | None = ..., *, key: None = ... + a: SupportsLenAndGetItem[SupportsRichComparisonT], + x: SupportsRichComparisonT, + lo: int = 0, + hi: int | None = None, + *, + key: None = None, ) -> int: ... @overload def bisect_right( - a: Sequence[_T], + a: SupportsLenAndGetItem[_T], x: SupportsRichComparisonT, - lo: int = ..., - hi: int | None = ..., + lo: int = 0, + hi: int | None = None, *, - key: Callable[[_T], SupportsRichComparisonT] = ..., + key: Callable[[_T], SupportsRichComparisonT], ) -> int: ... @overload def insort_left( a: MutableSequence[SupportsRichComparisonT], x: SupportsRichComparisonT, - lo: int = ..., - hi: int | None = ..., + lo: int = 0, + hi: int | None = None, *, - key: None = ..., + key: None = None, ) -> None: ... @overload def insort_left( - a: MutableSequence[_T], x: _T, lo: int = ..., hi: int | None = ..., *, key: Callable[[_T], SupportsRichComparisonT] = ... + a: MutableSequence[_T], x: _T, lo: int = 0, hi: int | None = None, *, key: Callable[[_T], SupportsRichComparisonT] ) -> None: ... @overload def insort_right( a: MutableSequence[SupportsRichComparisonT], x: SupportsRichComparisonT, - lo: int = ..., - hi: int | None = ..., + lo: int = 0, + hi: int | None = None, *, - key: None = ..., + key: None = None, ) -> None: ... @overload def insort_right( - a: MutableSequence[_T], x: _T, lo: int = ..., hi: int | None = ..., *, key: Callable[[_T], SupportsRichComparisonT] = ... + a: MutableSequence[_T], x: _T, lo: int = 0, hi: int | None = None, *, key: Callable[[_T], SupportsRichComparisonT] ) -> None: ... else: def bisect_left( - a: Sequence[SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int = ..., hi: int | None = ... + a: SupportsLenAndGetItem[SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int = 0, hi: int | None = None ) -> int: ... def bisect_right( - a: Sequence[SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int = ..., hi: int | None = ... + a: SupportsLenAndGetItem[SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int = 0, hi: int | None = None ) -> int: ... def insort_left( - a: MutableSequence[SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int = ..., hi: int | None = ... + a: MutableSequence[SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int = 0, hi: int | None = None ) -> None: ... def insort_right( - a: MutableSequence[SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int = ..., hi: int | None = ... + a: MutableSequence[SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int = 0, hi: int | None = None ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/_bootlocale.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/_bootlocale.pyi index ee2d89347..233d4934f 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/_bootlocale.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/_bootlocale.pyi @@ -1 +1 @@ -def getpreferredencoding(do_setlocale: bool = ...) -> str: ... +def getpreferredencoding(do_setlocale: bool = True) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/_codecs.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/_codecs.pyi index 9241ac6a7..51f17f01c 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/_codecs.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/_codecs.pyi @@ -1,5 +1,6 @@ import codecs import sys +from _typeshed import ReadableBuffer from collections.abc import Callable from typing import overload from typing_extensions import Literal, TypeAlias @@ -44,86 +45,94 @@ _BytesToBytesEncoding: TypeAlias = Literal[ _StrToStrEncoding: TypeAlias = Literal["rot13", "rot_13"] @overload -def encode(obj: bytes, encoding: _BytesToBytesEncoding, errors: str = ...) -> bytes: ... +def encode(obj: ReadableBuffer, encoding: _BytesToBytesEncoding, errors: str = "strict") -> bytes: ... @overload -def encode(obj: str, encoding: _StrToStrEncoding, errors: str = ...) -> str: ... # type: ignore[misc] +def encode(obj: str, encoding: _StrToStrEncoding, errors: str = "strict") -> str: ... # type: ignore[misc] @overload -def encode(obj: str, encoding: str = ..., errors: str = ...) -> bytes: ... +def encode(obj: str, encoding: str = "utf-8", errors: str = "strict") -> bytes: ... @overload -def decode(obj: bytes, encoding: _BytesToBytesEncoding, errors: str = ...) -> bytes: ... # type: ignore[misc] +def decode(obj: ReadableBuffer, encoding: _BytesToBytesEncoding, errors: str = "strict") -> bytes: ... # type: ignore[misc] @overload -def decode(obj: str, encoding: _StrToStrEncoding, errors: str = ...) -> str: ... +def decode(obj: str, encoding: _StrToStrEncoding, errors: str = "strict") -> str: ... # these are documented as text encodings but in practice they also accept str as input @overload def decode( - obj: str, encoding: Literal["unicode_escape", "unicode-escape", "raw_unicode_escape", "raw-unicode-escape"], errors: str = ... + obj: str, + encoding: Literal["unicode_escape", "unicode-escape", "raw_unicode_escape", "raw-unicode-escape"], + errors: str = "strict", ) -> str: ... # hex is officially documented as a bytes to bytes encoding, but it appears to also work with str @overload -def decode(obj: str, encoding: Literal["hex", "hex_codec"], errors: str = ...) -> bytes: ... +def decode(obj: str, encoding: Literal["hex", "hex_codec"], errors: str = "strict") -> bytes: ... @overload -def decode(obj: bytes, encoding: str = ..., errors: str = ...) -> str: ... +def decode(obj: ReadableBuffer, encoding: str = "utf-8", errors: str = "strict") -> str: ... def lookup(__encoding: str) -> codecs.CodecInfo: ... def charmap_build(__map: str) -> _CharMap: ... -def ascii_decode(__data: bytes, __errors: str | None = ...) -> tuple[str, int]: ... -def ascii_encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ... -def charmap_decode(__data: bytes, __errors: str | None = ..., __mapping: _CharMap | None = ...) -> tuple[str, int]: ... -def charmap_encode(__str: str, __errors: str | None = ..., __mapping: _CharMap | None = ...) -> tuple[bytes, int]: ... -def escape_decode(__data: str | bytes, __errors: str | None = ...) -> tuple[str, int]: ... -def escape_encode(__data: bytes, __errors: str | None = ...) -> tuple[bytes, int]: ... -def latin_1_decode(__data: bytes, __errors: str | None = ...) -> tuple[str, int]: ... -def latin_1_encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ... +def ascii_decode(__data: ReadableBuffer, __errors: str | None = None) -> tuple[str, int]: ... +def ascii_encode(__str: str, __errors: str | None = None) -> tuple[bytes, int]: ... +def charmap_decode(__data: ReadableBuffer, __errors: str | None = None, __mapping: _CharMap | None = None) -> tuple[str, int]: ... +def charmap_encode(__str: str, __errors: str | None = None, __mapping: _CharMap | None = None) -> tuple[bytes, int]: ... +def escape_decode(__data: str | ReadableBuffer, __errors: str | None = None) -> tuple[str, int]: ... +def escape_encode(__data: bytes, __errors: str | None = None) -> tuple[bytes, int]: ... +def latin_1_decode(__data: ReadableBuffer, __errors: str | None = None) -> tuple[str, int]: ... +def latin_1_encode(__str: str, __errors: str | None = None) -> tuple[bytes, int]: ... if sys.version_info >= (3, 9): - def raw_unicode_escape_decode(__data: str | bytes, __errors: str | None = ..., __final: bool = ...) -> tuple[str, int]: ... + def raw_unicode_escape_decode( + __data: str | ReadableBuffer, __errors: str | None = None, __final: bool = True + ) -> tuple[str, int]: ... else: - def raw_unicode_escape_decode(__data: str | bytes, __errors: str | None = ...) -> tuple[str, int]: ... + def raw_unicode_escape_decode(__data: str | ReadableBuffer, __errors: str | None = None) -> tuple[str, int]: ... -def raw_unicode_escape_encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ... -def readbuffer_encode(__data: str | bytes, __errors: str | None = ...) -> tuple[bytes, int]: ... +def raw_unicode_escape_encode(__str: str, __errors: str | None = None) -> tuple[bytes, int]: ... +def readbuffer_encode(__data: str | ReadableBuffer, __errors: str | None = None) -> tuple[bytes, int]: ... if sys.version_info >= (3, 9): - def unicode_escape_decode(__data: str | bytes, __errors: str | None = ..., __final: bool = ...) -> tuple[str, int]: ... + def unicode_escape_decode( + __data: str | ReadableBuffer, __errors: str | None = None, __final: bool = True + ) -> tuple[str, int]: ... else: - def unicode_escape_decode(__data: str | bytes, __errors: str | None = ...) -> tuple[str, int]: ... + def unicode_escape_decode(__data: str | ReadableBuffer, __errors: str | None = None) -> tuple[str, int]: ... -def unicode_escape_encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ... +def unicode_escape_encode(__str: str, __errors: str | None = None) -> tuple[bytes, int]: ... if sys.version_info < (3, 8): - def unicode_internal_decode(__obj: str | bytes, __errors: str | None = ...) -> tuple[str, int]: ... - def unicode_internal_encode(__obj: str | bytes, __errors: str | None = ...) -> tuple[bytes, int]: ... + def unicode_internal_decode(__obj: str | ReadableBuffer, __errors: str | None = None) -> tuple[str, int]: ... + def unicode_internal_encode(__obj: str | ReadableBuffer, __errors: str | None = None) -> tuple[bytes, int]: ... -def utf_16_be_decode(__data: bytes, __errors: str | None = ..., __final: int = ...) -> tuple[str, int]: ... -def utf_16_be_encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ... -def utf_16_decode(__data: bytes, __errors: str | None = ..., __final: int = ...) -> tuple[str, int]: ... -def utf_16_encode(__str: str, __errors: str | None = ..., __byteorder: int = ...) -> tuple[bytes, int]: ... +def utf_16_be_decode(__data: ReadableBuffer, __errors: str | None = None, __final: bool = False) -> tuple[str, int]: ... +def utf_16_be_encode(__str: str, __errors: str | None = None) -> tuple[bytes, int]: ... +def utf_16_decode(__data: ReadableBuffer, __errors: str | None = None, __final: bool = False) -> tuple[str, int]: ... +def utf_16_encode(__str: str, __errors: str | None = None, __byteorder: int = 0) -> tuple[bytes, int]: ... def utf_16_ex_decode( - __data: bytes, __errors: str | None = ..., __byteorder: int = ..., __final: int = ... + __data: ReadableBuffer, __errors: str | None = None, __byteorder: int = 0, __final: bool = False ) -> tuple[str, int, int]: ... -def utf_16_le_decode(__data: bytes, __errors: str | None = ..., __final: int = ...) -> tuple[str, int]: ... -def utf_16_le_encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ... -def utf_32_be_decode(__data: bytes, __errors: str | None = ..., __final: int = ...) -> tuple[str, int]: ... -def utf_32_be_encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ... -def utf_32_decode(__data: bytes, __errors: str | None = ..., __final: int = ...) -> tuple[str, int]: ... -def utf_32_encode(__str: str, __errors: str | None = ..., __byteorder: int = ...) -> tuple[bytes, int]: ... +def utf_16_le_decode(__data: ReadableBuffer, __errors: str | None = None, __final: bool = False) -> tuple[str, int]: ... +def utf_16_le_encode(__str: str, __errors: str | None = None) -> tuple[bytes, int]: ... +def utf_32_be_decode(__data: ReadableBuffer, __errors: str | None = None, __final: bool = False) -> tuple[str, int]: ... +def utf_32_be_encode(__str: str, __errors: str | None = None) -> tuple[bytes, int]: ... +def utf_32_decode(__data: ReadableBuffer, __errors: str | None = None, __final: bool = False) -> tuple[str, int]: ... +def utf_32_encode(__str: str, __errors: str | None = None, __byteorder: int = 0) -> tuple[bytes, int]: ... def utf_32_ex_decode( - __data: bytes, __errors: str | None = ..., __byteorder: int = ..., __final: int = ... + __data: ReadableBuffer, __errors: str | None = None, __byteorder: int = 0, __final: bool = False ) -> tuple[str, int, int]: ... -def utf_32_le_decode(__data: bytes, __errors: str | None = ..., __final: int = ...) -> tuple[str, int]: ... -def utf_32_le_encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ... -def utf_7_decode(__data: bytes, __errors: str | None = ..., __final: int = ...) -> tuple[str, int]: ... -def utf_7_encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ... -def utf_8_decode(__data: bytes, __errors: str | None = ..., __final: int = ...) -> tuple[str, int]: ... -def utf_8_encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ... +def utf_32_le_decode(__data: ReadableBuffer, __errors: str | None = None, __final: bool = False) -> tuple[str, int]: ... +def utf_32_le_encode(__str: str, __errors: str | None = None) -> tuple[bytes, int]: ... +def utf_7_decode(__data: ReadableBuffer, __errors: str | None = None, __final: bool = False) -> tuple[str, int]: ... +def utf_7_encode(__str: str, __errors: str | None = None) -> tuple[bytes, int]: ... +def utf_8_decode(__data: ReadableBuffer, __errors: str | None = None, __final: bool = False) -> tuple[str, int]: ... +def utf_8_encode(__str: str, __errors: str | None = None) -> tuple[bytes, int]: ... if sys.platform == "win32": - def mbcs_decode(__data: bytes, __errors: str | None = ..., __final: int = ...) -> tuple[str, int]: ... - def mbcs_encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ... - def code_page_decode(__codepage: int, __data: bytes, __errors: str | None = ..., __final: int = ...) -> tuple[str, int]: ... - def code_page_encode(__code_page: int, __str: str, __errors: str | None = ...) -> tuple[bytes, int]: ... - def oem_decode(__data: bytes, __errors: str | None = ..., __final: int = ...) -> tuple[str, int]: ... - def oem_encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ... + def mbcs_decode(__data: ReadableBuffer, __errors: str | None = None, __final: bool = False) -> tuple[str, int]: ... + def mbcs_encode(__str: str, __errors: str | None = None) -> tuple[bytes, int]: ... + def code_page_decode( + __codepage: int, __data: ReadableBuffer, __errors: str | None = None, __final: bool = False + ) -> tuple[str, int]: ... + def code_page_encode(__code_page: int, __str: str, __errors: str | None = None) -> tuple[bytes, int]: ... + def oem_decode(__data: ReadableBuffer, __errors: str | None = None, __final: bool = False) -> tuple[str, int]: ... + def oem_encode(__str: str, __errors: str | None = None) -> tuple[bytes, int]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/_collections_abc.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/_collections_abc.pyi index 8373fe836..352da6cfb 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/_collections_abc.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/_collections_abc.pyi @@ -1,6 +1,6 @@ import sys from types import MappingProxyType -from typing import ( # noqa: Y027,Y038 +from typing import ( # noqa: Y022,Y038 AbstractSet as Set, AsyncGenerator as AsyncGenerator, AsyncIterable as AsyncIterable, diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/_compression.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/_compression.pyi index 7047a7bcd..817f25158 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/_compression.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/_compression.pyi @@ -21,5 +21,5 @@ class DecompressReader(RawIOBase): **decomp_args: Any, ) -> None: ... def readinto(self, b: WriteableBuffer) -> int: ... - def read(self, size: int = ...) -> bytes: ... - def seek(self, offset: int, whence: int = ...) -> int: ... + def read(self, size: int = -1) -> bytes: ... + def seek(self, offset: int, whence: int = 0) -> int: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/_csv.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/_csv.pyi index 7d15365d3..c9b9f47e6 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/_csv.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/_csv.pyi @@ -1,9 +1,9 @@ from _typeshed import SupportsWrite from collections.abc import Iterable, Iterator -from typing import Any, Union -from typing_extensions import Literal, TypeAlias +from typing import Any +from typing_extensions import Final, Literal, TypeAlias -__version__: str +__version__: Final[str] QUOTE_ALL: Literal[1] QUOTE_MINIMAL: Literal[0] @@ -27,7 +27,7 @@ class Dialect: strict: bool def __init__(self) -> None: ... -_DialectLike: TypeAlias = Union[str, Dialect, type[Dialect]] +_DialectLike: TypeAlias = str | Dialect | type[Dialect] class _reader(Iterator[list[str]]): @property @@ -43,42 +43,42 @@ class _writer: def writer( csvfile: SupportsWrite[str], - dialect: _DialectLike = ..., + dialect: _DialectLike = "excel", *, - delimiter: str = ..., - quotechar: str | None = ..., - escapechar: str | None = ..., - doublequote: bool = ..., - skipinitialspace: bool = ..., - lineterminator: str = ..., - quoting: _QuotingType = ..., - strict: bool = ..., + delimiter: str = ",", + quotechar: str | None = '"', + escapechar: str | None = None, + doublequote: bool = True, + skipinitialspace: bool = False, + lineterminator: str = "\r\n", + quoting: _QuotingType = 0, + strict: bool = False, ) -> _writer: ... def reader( csvfile: Iterable[str], - dialect: _DialectLike = ..., + dialect: _DialectLike = "excel", *, - delimiter: str = ..., - quotechar: str | None = ..., - escapechar: str | None = ..., - doublequote: bool = ..., - skipinitialspace: bool = ..., - lineterminator: str = ..., - quoting: _QuotingType = ..., - strict: bool = ..., + delimiter: str = ",", + quotechar: str | None = '"', + escapechar: str | None = None, + doublequote: bool = True, + skipinitialspace: bool = False, + lineterminator: str = "\r\n", + quoting: _QuotingType = 0, + strict: bool = False, ) -> _reader: ... def register_dialect( name: str, - dialect: Any = ..., + dialect: type[Dialect] = ..., *, - delimiter: str = ..., - quotechar: str | None = ..., - escapechar: str | None = ..., - doublequote: bool = ..., - skipinitialspace: bool = ..., - lineterminator: str = ..., - quoting: _QuotingType = ..., - strict: bool = ..., + delimiter: str = ",", + quotechar: str | None = '"', + escapechar: str | None = None, + doublequote: bool = True, + skipinitialspace: bool = False, + lineterminator: str = "\r\n", + quoting: _QuotingType = 0, + strict: bool = False, ) -> None: ... def unregister_dialect(name: str) -> None: ... def get_dialect(name: str) -> Dialect: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/_ctypes.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/_ctypes.pyi new file mode 100644 index 000000000..0ad2fcb57 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stdlib/_ctypes.pyi @@ -0,0 +1,29 @@ +import sys +from ctypes import _CArgObject, _PointerLike +from typing_extensions import TypeAlias + +FUNCFLAG_CDECL: int +FUNCFLAG_PYTHONAPI: int +FUNCFLAG_USE_ERRNO: int +FUNCFLAG_USE_LASTERROR: int +RTLD_GLOBAL: int +RTLD_LOCAL: int + +if sys.version_info >= (3, 11): + CTYPES_MAX_ARGCOUNT: int + +if sys.platform == "win32": + # Description, Source, HelpFile, HelpContext, scode + _COMError_Details: TypeAlias = tuple[str | None, str | None, str | None, int | None, int | None] + + class COMError(Exception): + hresult: int + text: str | None + details: _COMError_Details + + def __init__(self, hresult: int, text: str | None, details: _COMError_Details) -> None: ... + + def CopyComPointer(src: _PointerLike, dst: _PointerLike | _CArgObject) -> int: ... + + FUNCFLAG_HRESULT: int + FUNCFLAG_STDCALL: int diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/_curses.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/_curses.pyi index adb1ea84e..61881fc09 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/_curses.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/_curses.pyi @@ -1,9 +1,10 @@ import sys -from _typeshed import SupportsRead +from _typeshed import ReadOnlyBuffer, SupportsRead from typing import IO, Any, NamedTuple, overload from typing_extensions import TypeAlias, final if sys.platform != "win32": + # Handled by PyCurses_ConvertToChtype in _cursesmodule.c. _ChType: TypeAlias = str | bytes | int # ACS codes are only initialized after initscr is called @@ -273,7 +274,7 @@ if sys.platform != "win32": def baudrate() -> int: ... def beep() -> None: ... def can_change_color() -> bool: ... - def cbreak(__flag: bool = ...) -> None: ... + def cbreak(__flag: bool = True) -> None: ... def color_content(__color_number: int) -> tuple[int, int, int]: ... # Changed in Python 3.8.8 and 3.9.2 if sys.version_info >= (3, 8): @@ -286,7 +287,7 @@ if sys.platform != "win32": def def_shell_mode() -> None: ... def delay_output(__ms: int) -> None: ... def doupdate() -> None: ... - def echo(__flag: bool = ...) -> None: ... + def echo(__flag: bool = True) -> None: ... def endwin() -> None: ... def erasechar() -> bytes: ... def filter() -> None: ... @@ -322,7 +323,7 @@ if sys.platform != "win32": def napms(__ms: int) -> int: ... def newpad(__nlines: int, __ncols: int) -> _CursesWindow: ... def newwin(__nlines: int, __ncols: int, __begin_y: int = ..., __begin_x: int = ...) -> _CursesWindow: ... - def nl(__flag: bool = ...) -> None: ... + def nl(__flag: bool = True) -> None: ... def nocbreak() -> None: ... def noecho() -> None: ... def nonl() -> None: ... @@ -330,9 +331,9 @@ if sys.platform != "win32": def noraw() -> None: ... def pair_content(__pair_number: int) -> tuple[int, int]: ... def pair_number(__attr: int) -> int: ... - def putp(__string: bytes) -> None: ... - def qiflush(__flag: bool = ...) -> None: ... - def raw(__flag: bool = ...) -> None: ... + def putp(__string: ReadOnlyBuffer) -> None: ... + def qiflush(__flag: bool = True) -> None: ... + def raw(__flag: bool = True) -> None: ... def reset_prog_mode() -> None: ... def reset_shell_mode() -> None: ... def resetty() -> None: ... @@ -344,7 +345,7 @@ if sys.platform != "win32": def set_tabsize(__size: int) -> None: ... def setsyx(__y: int, __x: int) -> None: ... - def setupterm(term: str | None = ..., fd: int = ...) -> None: ... + def setupterm(term: str | None = None, fd: int = -1) -> None: ... def start_color() -> None: ... def termattrs() -> int: ... def termname() -> bytes: ... @@ -352,16 +353,16 @@ if sys.platform != "win32": def tigetnum(__capname: str) -> int: ... def tigetstr(__capname: str) -> bytes | None: ... def tparm( - __str: bytes, - __i1: int = ..., - __i2: int = ..., - __i3: int = ..., - __i4: int = ..., - __i5: int = ..., - __i6: int = ..., - __i7: int = ..., - __i8: int = ..., - __i9: int = ..., + __str: ReadOnlyBuffer, + __i1: int = 0, + __i2: int = 0, + __i3: int = 0, + __i4: int = 0, + __i5: int = 0, + __i6: int = 0, + __i7: int = 0, + __i8: int = 0, + __i9: int = 0, ) -> bytes: ... def typeahead(__fd: int) -> None: ... def unctrl(__ch: _ChType) -> bytes: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/_decimal.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/_decimal.pyi index f4b377c22..60c609456 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/_decimal.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/_decimal.pyi @@ -1,22 +1,21 @@ import numbers import sys -from _typeshed import Self from collections.abc import Container, Sequence from types import TracebackType -from typing import Any, ClassVar, NamedTuple, Union, overload -from typing_extensions import TypeAlias +from typing import Any, ClassVar, NamedTuple, overload +from typing_extensions import Final, Literal, Self, TypeAlias _Decimal: TypeAlias = Decimal | int -_DecimalNew: TypeAlias = Union[Decimal, float, str, tuple[int, Sequence[int], int]] +_DecimalNew: TypeAlias = Decimal | float | str | tuple[int, Sequence[int], int] _ComparableNum: TypeAlias = Decimal | float | numbers.Rational -__version__: str -__libmpdec_version__: str +__version__: Final[str] +__libmpdec_version__: Final[str] class DecimalTuple(NamedTuple): sign: int digits: tuple[int, ...] - exponent: int + exponent: int | Literal["n", "N", "F"] ROUND_DOWN: str ROUND_HALF_UP: str @@ -53,7 +52,7 @@ def getcontext() -> Context: ... if sys.version_info >= (3, 11): def localcontext( - ctx: Context | None = ..., + ctx: Context | None = None, *, prec: int | None = ..., rounding: str | None = ..., @@ -66,41 +65,41 @@ if sys.version_info >= (3, 11): ) -> _ContextManager: ... else: - def localcontext(ctx: Context | None = ...) -> _ContextManager: ... + def localcontext(ctx: Context | None = None) -> _ContextManager: ... class Decimal: - def __new__(cls: type[Self], value: _DecimalNew = ..., context: Context | None = ...) -> Self: ... + def __new__(cls, value: _DecimalNew = ..., context: Context | None = ...) -> Self: ... @classmethod - def from_float(cls: type[Self], __f: float) -> Self: ... + def from_float(cls, __f: float) -> Self: ... def __bool__(self) -> bool: ... - def compare(self, other: _Decimal, context: Context | None = ...) -> Decimal: ... + def compare(self, other: _Decimal, context: Context | None = None) -> Decimal: ... def as_tuple(self) -> DecimalTuple: ... def as_integer_ratio(self) -> tuple[int, int]: ... - def to_eng_string(self, context: Context | None = ...) -> str: ... + def to_eng_string(self, context: Context | None = None) -> str: ... def __abs__(self) -> Decimal: ... - def __add__(self, __other: _Decimal) -> Decimal: ... - def __divmod__(self, __other: _Decimal) -> tuple[Decimal, Decimal]: ... - def __eq__(self, __other: object) -> bool: ... - def __floordiv__(self, __other: _Decimal) -> Decimal: ... - def __ge__(self, __other: _ComparableNum) -> bool: ... - def __gt__(self, __other: _ComparableNum) -> bool: ... - def __le__(self, __other: _ComparableNum) -> bool: ... - def __lt__(self, __other: _ComparableNum) -> bool: ... - def __mod__(self, __other: _Decimal) -> Decimal: ... - def __mul__(self, __other: _Decimal) -> Decimal: ... + def __add__(self, __value: _Decimal) -> Decimal: ... + def __divmod__(self, __value: _Decimal) -> tuple[Decimal, Decimal]: ... + def __eq__(self, __value: object) -> bool: ... + def __floordiv__(self, __value: _Decimal) -> Decimal: ... + def __ge__(self, __value: _ComparableNum) -> bool: ... + def __gt__(self, __value: _ComparableNum) -> bool: ... + def __le__(self, __value: _ComparableNum) -> bool: ... + def __lt__(self, __value: _ComparableNum) -> bool: ... + def __mod__(self, __value: _Decimal) -> Decimal: ... + def __mul__(self, __value: _Decimal) -> Decimal: ... def __neg__(self) -> Decimal: ... def __pos__(self) -> Decimal: ... - def __pow__(self, __other: _Decimal, __modulo: _Decimal | None = ...) -> Decimal: ... - def __radd__(self, __other: _Decimal) -> Decimal: ... - def __rdivmod__(self, __other: _Decimal) -> tuple[Decimal, Decimal]: ... - def __rfloordiv__(self, __other: _Decimal) -> Decimal: ... - def __rmod__(self, __other: _Decimal) -> Decimal: ... - def __rmul__(self, __other: _Decimal) -> Decimal: ... - def __rsub__(self, __other: _Decimal) -> Decimal: ... - def __rtruediv__(self, __other: _Decimal) -> Decimal: ... - def __sub__(self, __other: _Decimal) -> Decimal: ... - def __truediv__(self, __other: _Decimal) -> Decimal: ... - def remainder_near(self, other: _Decimal, context: Context | None = ...) -> Decimal: ... + def __pow__(self, __value: _Decimal, __mod: _Decimal | None = None) -> Decimal: ... + def __radd__(self, __value: _Decimal) -> Decimal: ... + def __rdivmod__(self, __value: _Decimal) -> tuple[Decimal, Decimal]: ... + def __rfloordiv__(self, __value: _Decimal) -> Decimal: ... + def __rmod__(self, __value: _Decimal) -> Decimal: ... + def __rmul__(self, __value: _Decimal) -> Decimal: ... + def __rsub__(self, __value: _Decimal) -> Decimal: ... + def __rtruediv__(self, __value: _Decimal) -> Decimal: ... + def __sub__(self, __value: _Decimal) -> Decimal: ... + def __truediv__(self, __value: _Decimal) -> Decimal: ... + def remainder_near(self, other: _Decimal, context: Context | None = None) -> Decimal: ... def __float__(self) -> float: ... def __int__(self) -> int: ... def __trunc__(self) -> int: ... @@ -116,56 +115,56 @@ class Decimal: def __round__(self, __ndigits: int) -> Decimal: ... def __floor__(self) -> int: ... def __ceil__(self) -> int: ... - def fma(self, other: _Decimal, third: _Decimal, context: Context | None = ...) -> Decimal: ... - def __rpow__(self, __other: _Decimal, __context: Context | None = ...) -> Decimal: ... - def normalize(self, context: Context | None = ...) -> Decimal: ... - def quantize(self, exp: _Decimal, rounding: str | None = ..., context: Context | None = ...) -> Decimal: ... - def same_quantum(self, other: _Decimal, context: Context | None = ...) -> bool: ... - def to_integral_exact(self, rounding: str | None = ..., context: Context | None = ...) -> Decimal: ... - def to_integral_value(self, rounding: str | None = ..., context: Context | None = ...) -> Decimal: ... - def to_integral(self, rounding: str | None = ..., context: Context | None = ...) -> Decimal: ... - def sqrt(self, context: Context | None = ...) -> Decimal: ... - def max(self, other: _Decimal, context: Context | None = ...) -> Decimal: ... - def min(self, other: _Decimal, context: Context | None = ...) -> Decimal: ... + def fma(self, other: _Decimal, third: _Decimal, context: Context | None = None) -> Decimal: ... + def __rpow__(self, __value: _Decimal, __mod: Context | None = None) -> Decimal: ... + def normalize(self, context: Context | None = None) -> Decimal: ... + def quantize(self, exp: _Decimal, rounding: str | None = None, context: Context | None = None) -> Decimal: ... + def same_quantum(self, other: _Decimal, context: Context | None = None) -> bool: ... + def to_integral_exact(self, rounding: str | None = None, context: Context | None = None) -> Decimal: ... + def to_integral_value(self, rounding: str | None = None, context: Context | None = None) -> Decimal: ... + def to_integral(self, rounding: str | None = None, context: Context | None = None) -> Decimal: ... + def sqrt(self, context: Context | None = None) -> Decimal: ... + def max(self, other: _Decimal, context: Context | None = None) -> Decimal: ... + def min(self, other: _Decimal, context: Context | None = None) -> Decimal: ... def adjusted(self) -> int: ... def canonical(self) -> Decimal: ... - def compare_signal(self, other: _Decimal, context: Context | None = ...) -> Decimal: ... - def compare_total(self, other: _Decimal, context: Context | None = ...) -> Decimal: ... - def compare_total_mag(self, other: _Decimal, context: Context | None = ...) -> Decimal: ... + def compare_signal(self, other: _Decimal, context: Context | None = None) -> Decimal: ... + def compare_total(self, other: _Decimal, context: Context | None = None) -> Decimal: ... + def compare_total_mag(self, other: _Decimal, context: Context | None = None) -> Decimal: ... def copy_abs(self) -> Decimal: ... def copy_negate(self) -> Decimal: ... - def copy_sign(self, other: _Decimal, context: Context | None = ...) -> Decimal: ... - def exp(self, context: Context | None = ...) -> Decimal: ... + def copy_sign(self, other: _Decimal, context: Context | None = None) -> Decimal: ... + def exp(self, context: Context | None = None) -> Decimal: ... def is_canonical(self) -> bool: ... def is_finite(self) -> bool: ... def is_infinite(self) -> bool: ... def is_nan(self) -> bool: ... - def is_normal(self, context: Context | None = ...) -> bool: ... + def is_normal(self, context: Context | None = None) -> bool: ... def is_qnan(self) -> bool: ... def is_signed(self) -> bool: ... def is_snan(self) -> bool: ... - def is_subnormal(self, context: Context | None = ...) -> bool: ... + def is_subnormal(self, context: Context | None = None) -> bool: ... def is_zero(self) -> bool: ... - def ln(self, context: Context | None = ...) -> Decimal: ... - def log10(self, context: Context | None = ...) -> Decimal: ... - def logb(self, context: Context | None = ...) -> Decimal: ... - def logical_and(self, other: _Decimal, context: Context | None = ...) -> Decimal: ... - def logical_invert(self, context: Context | None = ...) -> Decimal: ... - def logical_or(self, other: _Decimal, context: Context | None = ...) -> Decimal: ... - def logical_xor(self, other: _Decimal, context: Context | None = ...) -> Decimal: ... - def max_mag(self, other: _Decimal, context: Context | None = ...) -> Decimal: ... - def min_mag(self, other: _Decimal, context: Context | None = ...) -> Decimal: ... - def next_minus(self, context: Context | None = ...) -> Decimal: ... - def next_plus(self, context: Context | None = ...) -> Decimal: ... - def next_toward(self, other: _Decimal, context: Context | None = ...) -> Decimal: ... - def number_class(self, context: Context | None = ...) -> str: ... + def ln(self, context: Context | None = None) -> Decimal: ... + def log10(self, context: Context | None = None) -> Decimal: ... + def logb(self, context: Context | None = None) -> Decimal: ... + def logical_and(self, other: _Decimal, context: Context | None = None) -> Decimal: ... + def logical_invert(self, context: Context | None = None) -> Decimal: ... + def logical_or(self, other: _Decimal, context: Context | None = None) -> Decimal: ... + def logical_xor(self, other: _Decimal, context: Context | None = None) -> Decimal: ... + def max_mag(self, other: _Decimal, context: Context | None = None) -> Decimal: ... + def min_mag(self, other: _Decimal, context: Context | None = None) -> Decimal: ... + def next_minus(self, context: Context | None = None) -> Decimal: ... + def next_plus(self, context: Context | None = None) -> Decimal: ... + def next_toward(self, other: _Decimal, context: Context | None = None) -> Decimal: ... + def number_class(self, context: Context | None = None) -> str: ... def radix(self) -> Decimal: ... - def rotate(self, other: _Decimal, context: Context | None = ...) -> Decimal: ... - def scaleb(self, other: _Decimal, context: Context | None = ...) -> Decimal: ... - def shift(self, other: _Decimal, context: Context | None = ...) -> Decimal: ... - def __reduce__(self: Self) -> tuple[type[Self], tuple[str]]: ... - def __copy__(self: Self) -> Self: ... - def __deepcopy__(self: Self, __memo: Any) -> Self: ... + def rotate(self, other: _Decimal, context: Context | None = None) -> Decimal: ... + def scaleb(self, other: _Decimal, context: Context | None = None) -> Decimal: ... + def shift(self, other: _Decimal, context: Context | None = None) -> Decimal: ... + def __reduce__(self) -> tuple[type[Self], tuple[str]]: ... + def __copy__(self) -> Self: ... + def __deepcopy__(self, __memo: Any) -> Self: ... def __format__(self, __specifier: str, __context: Context | None = ...) -> str: ... class _ContextManager: @@ -178,6 +177,11 @@ class _ContextManager: _TrapType: TypeAlias = type[DecimalException] class Context: + # TODO: Context doesn't allow you to delete *any* attributes from instances of the class at runtime, + # even settable attributes like `prec` and `rounding`, + # but that's inexpressable in the stub. + # Type checkers either ignore it or misinterpret it + # if you add a `def __delattr__(self, __name: str) -> NoReturn` method to the stub prec: int rounding: str Emin: int @@ -198,9 +202,7 @@ class Context: traps: None | dict[_TrapType, bool] | Container[_TrapType] = ..., _ignored_flags: list[_TrapType] | None = ..., ) -> None: ... - # __setattr__() only allows to set a specific set of attributes, - # already defined above. - def __reduce__(self: Self) -> tuple[type[Self], tuple[Any, ...]]: ... + def __reduce__(self) -> tuple[type[Self], tuple[Any, ...]]: ... def clear_flags(self) -> None: ... def clear_traps(self) -> None: ... def copy(self) -> Context: ... @@ -209,7 +211,7 @@ class Context: __hash__: ClassVar[None] # type: ignore[assignment] def Etiny(self) -> int: ... def Etop(self) -> int: ... - def create_decimal(self, __num: _DecimalNew = ...) -> Decimal: ... + def create_decimal(self, __num: _DecimalNew = "0") -> Decimal: ... def create_decimal_from_float(self, __f: float) -> Decimal: ... def abs(self, __x: _Decimal) -> Decimal: ... def add(self, __x: _Decimal, __y: _Decimal) -> Decimal: ... @@ -256,7 +258,7 @@ class Context: def normalize(self, __x: _Decimal) -> Decimal: ... def number_class(self, __x: _Decimal) -> str: ... def plus(self, __x: _Decimal) -> Decimal: ... - def power(self, a: _Decimal, b: _Decimal, modulo: _Decimal | None = ...) -> Decimal: ... + def power(self, a: _Decimal, b: _Decimal, modulo: _Decimal | None = None) -> Decimal: ... def quantize(self, __x: _Decimal, __y: _Decimal) -> Decimal: ... def radix(self) -> Decimal: ... def remainder(self, __x: _Decimal, __y: _Decimal) -> Decimal: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/_dummy_thread.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/_dummy_thread.pyi index ff16b1d3d..e371dd0e9 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/_dummy_thread.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/_dummy_thread.pyi @@ -11,12 +11,12 @@ def start_new_thread(function: Callable[..., object], args: tuple[Any, ...], kwa def exit() -> NoReturn: ... def get_ident() -> int: ... def allocate_lock() -> LockType: ... -def stack_size(size: int | None = ...) -> int: ... +def stack_size(size: int | None = None) -> int: ... class LockType: locked_status: bool - def acquire(self, waitflag: bool | None = ..., timeout: int = ...) -> bool: ... - def __enter__(self, waitflag: bool | None = ..., timeout: int = ...) -> bool: ... + def acquire(self, waitflag: bool | None = None, timeout: int = -1) -> bool: ... + def __enter__(self, waitflag: bool | None = None, timeout: int = -1) -> bool: ... def __exit__(self, typ: type[BaseException] | None, val: BaseException | None, tb: TracebackType | None) -> None: ... def release(self) -> bool: ... def locked(self) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/_dummy_threading.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/_dummy_threading.pyi index c956946c8..9a49dfa96 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/_dummy_threading.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/_dummy_threading.pyi @@ -41,7 +41,7 @@ def enumerate() -> list[Thread]: ... def main_thread() -> Thread: ... def settrace(func: TraceFunction) -> None: ... def setprofile(func: ProfileFunction | None) -> None: ... -def stack_size(size: int = ...) -> int: ... +def stack_size(size: int | None = None) -> int: ... TIMEOUT_MAX: float @@ -59,17 +59,17 @@ class Thread: def ident(self) -> int | None: ... def __init__( self, - group: None = ..., - target: Callable[..., object] | None = ..., - name: str | None = ..., + group: None = None, + target: Callable[..., object] | None = None, + name: str | None = None, args: Iterable[Any] = ..., - kwargs: Mapping[str, Any] | None = ..., + kwargs: Mapping[str, Any] | None = None, *, - daemon: bool | None = ..., + daemon: bool | None = None, ) -> None: ... def start(self) -> None: ... def run(self) -> None: ... - def join(self, timeout: float | None = ...) -> None: ... + def join(self, timeout: float | None = None) -> None: ... def getName(self) -> str: ... def setName(self, name: str) -> None: ... if sys.version_info >= (3, 8): @@ -86,7 +86,6 @@ class Thread: class _DummyThread(Thread): ... class Lock: - def __init__(self) -> None: ... def __enter__(self) -> bool: ... def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None @@ -96,37 +95,36 @@ class Lock: def locked(self) -> bool: ... class _RLock: - def __init__(self) -> None: ... def __enter__(self) -> bool: ... def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None ) -> bool | None: ... - def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ... + def acquire(self, blocking: bool = True, timeout: float = -1) -> bool: ... def release(self) -> None: ... RLock = _RLock class Condition: - def __init__(self, lock: Lock | _RLock | None = ...) -> None: ... + def __init__(self, lock: Lock | _RLock | None = None) -> None: ... def __enter__(self) -> bool: ... def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None ) -> bool | None: ... def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ... def release(self) -> None: ... - def wait(self, timeout: float | None = ...) -> bool: ... - def wait_for(self, predicate: Callable[[], _T], timeout: float | None = ...) -> _T: ... - def notify(self, n: int = ...) -> None: ... + 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: ... def notify_all(self) -> None: ... def notifyAll(self) -> None: ... class Semaphore: - def __init__(self, value: int = ...) -> None: ... + def __init__(self, value: int = 1) -> None: ... def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None ) -> bool | None: ... - def acquire(self, blocking: bool = ..., timeout: float | None = ...) -> bool: ... - def __enter__(self, blocking: bool = ..., timeout: float | None = ...) -> bool: ... + def acquire(self, blocking: bool = True, timeout: float | None = None) -> bool: ... + def __enter__(self, blocking: bool = True, timeout: float | None = None) -> bool: ... if sys.version_info >= (3, 9): def release(self, n: int = ...) -> None: ... else: @@ -135,11 +133,10 @@ class Semaphore: class BoundedSemaphore(Semaphore): ... class Event: - def __init__(self) -> None: ... def is_set(self) -> bool: ... def set(self) -> None: ... def clear(self) -> None: ... - def wait(self, timeout: float | None = ...) -> bool: ... + def wait(self, timeout: float | None = None) -> bool: ... if sys.version_info >= (3, 8): from _thread import _excepthook, _ExceptHookArgs @@ -152,8 +149,8 @@ class Timer(Thread): self, interval: float, function: Callable[..., object], - args: Iterable[Any] | None = ..., - kwargs: Mapping[str, Any] | None = ..., + args: Iterable[Any] | None = None, + kwargs: Mapping[str, Any] | None = None, ) -> None: ... def cancel(self) -> None: ... @@ -164,8 +161,8 @@ class Barrier: def n_waiting(self) -> int: ... @property def broken(self) -> bool: ... - def __init__(self, parties: int, action: Callable[[], None] | None = ..., timeout: float | None = ...) -> None: ... - def wait(self, timeout: float | None = ...) -> int: ... + def __init__(self, parties: int, action: Callable[[], None] | None = None, timeout: float | None = None) -> None: ... + def wait(self, timeout: float | None = None) -> int: ... def reset(self) -> None: ... def abort(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/_heapq.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/_heapq.pyi index 90dc28deb..8d6c3e881 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/_heapq.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/_heapq.pyi @@ -1,8 +1,9 @@ from typing import Any, TypeVar +from typing_extensions import Final _T = TypeVar("_T") -__about__: str +__about__: Final[str] def heapify(__heap: list[Any]) -> None: ... def heappop(__heap: list[_T]) -> _T: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/_imp.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/_imp.pyi index 2b54a0f6f..adab2e803 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/_imp.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/_imp.pyi @@ -8,7 +8,7 @@ check_hash_based_pycs: str def source_hash(key: int, source: ReadableBuffer) -> bytes: ... def create_builtin(__spec: ModuleSpec) -> types.ModuleType: ... -def create_dynamic(__spec: ModuleSpec, __file: Any = ...) -> types.ModuleType: ... +def create_dynamic(__spec: ModuleSpec, __file: Any = None) -> types.ModuleType: ... def acquire_lock() -> None: ... def exec_builtin(__mod: types.ModuleType) -> int: ... def exec_dynamic(__mod: types.ModuleType) -> int: ... @@ -21,8 +21,8 @@ def lock_held() -> bool: ... def release_lock() -> None: ... if sys.version_info >= (3, 11): - def find_frozen(__name: str, *, withdata: bool = ...) -> tuple[memoryview | None, bool, str | None] | None: ... - def get_frozen_object(__name: str, __data: ReadableBuffer | None = ...) -> types.CodeType: ... + def find_frozen(__name: str, *, withdata: bool = False) -> tuple[memoryview | None, bool, str | None] | None: ... + def get_frozen_object(__name: str, __data: ReadableBuffer | None = None) -> types.CodeType: ... else: def get_frozen_object(__name: str) -> types.CodeType: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/_markupbase.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/_markupbase.pyi index 7d2a39a7a..62bad25e5 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/_markupbase.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/_markupbase.pyi @@ -5,9 +5,9 @@ class ParserBase: def reset(self) -> None: ... def getpos(self) -> tuple[int, int]: ... def unknown_decl(self, data: str) -> None: ... - def parse_comment(self, i: int, report: int = ...) -> int: ... # undocumented + def parse_comment(self, i: int, report: int = 1) -> int: ... # undocumented def parse_declaration(self, i: int) -> int: ... # undocumented - def parse_marked_section(self, i: int, report: int = ...) -> int: ... # undocumented + def parse_marked_section(self, i: int, report: int = 1) -> int: ... # undocumented def updatepos(self, i: int, j: int) -> int: ... # undocumented if sys.version_info < (3, 10): # Removed from ParserBase: https://bugs.python.org/issue31844 diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/_msi.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/_msi.pyi index 9dda8a598..2fdbdfd0e 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/_msi.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/_msi.pyi @@ -1,7 +1,6 @@ import sys if sys.platform == "win32": - # Actual typename View, not exposed by the implementation class _View: def Execute(self, params: _Record | None = ...) -> None: ... @@ -12,24 +11,27 @@ if sys.platform == "win32": # Don't exist at runtime __new__: None # type: ignore[assignment] __init__: None # type: ignore[assignment] - # Actual typename Summary, not exposed by the implementation - class _Summary: - def GetProperty(self, propid: int) -> str | bytes | None: ... + + # Actual typename SummaryInformation, not exposed by the implementation + class _SummaryInformation: + def GetProperty(self, field: int) -> int | bytes | None: ... def GetPropertyCount(self) -> int: ... - def SetProperty(self, propid: int, value: str | bytes) -> None: ... + def SetProperty(self, field: int, value: int | str) -> None: ... def Persist(self) -> None: ... # Don't exist at runtime __new__: None # type: ignore[assignment] __init__: None # type: ignore[assignment] + # Actual typename Database, not exposed by the implementation class _Database: def OpenView(self, sql: str) -> _View: ... def Commit(self) -> None: ... - def GetSummaryInformation(self, updateCount: int) -> _Summary: ... + def GetSummaryInformation(self, updateCount: int) -> _SummaryInformation: ... def Close(self) -> None: ... # Don't exist at runtime __new__: None # type: ignore[assignment] __init__: None # type: ignore[assignment] + # Actual typename Record, not exposed by the implementation class _Record: def GetFieldCount(self) -> int: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/_operator.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/_operator.pyi index 92e04d0f4..e7d1a98c4 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/_operator.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/_operator.pyi @@ -1,5 +1,6 @@ import sys -from collections.abc import Callable, Container, Iterable, Mapping, MutableMapping, MutableSequence, Sequence +from _typeshed import SupportsGetItem +from collections.abc import Callable, Container, Iterable, MutableMapping, MutableSequence, Sequence from typing import Any, AnyStr, Generic, Protocol, SupportsAbs, TypeVar, overload from typing_extensions import ParamSpec, SupportsIndex, TypeAlias, final @@ -77,11 +78,9 @@ def delitem(__a: MutableSequence[Any], __b: slice) -> None: ... @overload def delitem(__a: MutableMapping[_K, Any], __b: _K) -> None: ... @overload -def getitem(__a: Sequence[_T], __b: SupportsIndex) -> _T: ... -@overload def getitem(__a: Sequence[_T], __b: slice) -> Sequence[_T]: ... @overload -def getitem(__a: Mapping[_K, _V], __b: _K) -> _V: ... +def getitem(__a: SupportsGetItem[_K, _V], __b: _K) -> _V: ... def indexOf(__a: Iterable[_T], __b: _T) -> int: ... @overload def setitem(__a: MutableSequence[_T], __b: SupportsIndex, __c: _T) -> None: ... @@ -89,7 +88,7 @@ def setitem(__a: MutableSequence[_T], __b: SupportsIndex, __c: _T) -> None: ... def setitem(__a: MutableSequence[_T], __b: slice, __c: Sequence[_T]) -> None: ... @overload def setitem(__a: MutableMapping[_K, _V], __b: _K, __c: _V) -> None: ... -def length_hint(__obj: object, __default: int = ...) -> int: ... +def length_hint(__obj: object, __default: int = 0) -> int: ... @final class attrgetter(Generic[_T_co]): @overload @@ -106,17 +105,30 @@ class attrgetter(Generic[_T_co]): @final class itemgetter(Generic[_T_co]): + # mypy lacks support for PEP 646 https://github.com/python/mypy/issues/12280 + # So we have to define all of these overloads to simulate unpacking the arguments @overload - def __new__(cls, item: Any) -> itemgetter[Any]: ... + def __new__(cls, item: _T_co) -> itemgetter[_T_co]: ... @overload - def __new__(cls, item: Any, __item2: Any) -> itemgetter[tuple[Any, Any]]: ... + def __new__(cls, item: _T_co, __item2: _T_co) -> itemgetter[tuple[_T_co, _T_co]]: ... @overload - def __new__(cls, item: Any, __item2: Any, __item3: Any) -> itemgetter[tuple[Any, Any, Any]]: ... + def __new__(cls, item: _T_co, __item2: _T_co, __item3: _T_co) -> itemgetter[tuple[_T_co, _T_co, _T_co]]: ... @overload - def __new__(cls, item: Any, __item2: Any, __item3: Any, __item4: Any) -> itemgetter[tuple[Any, Any, Any, Any]]: ... + def __new__( + cls, item: _T_co, __item2: _T_co, __item3: _T_co, __item4: _T_co + ) -> itemgetter[tuple[_T_co, _T_co, _T_co, _T_co]]: ... @overload - def __new__(cls, item: Any, *items: Any) -> itemgetter[tuple[Any, ...]]: ... - def __call__(self, obj: Any) -> _T_co: ... + def __new__( + cls, item: _T_co, __item2: _T_co, __item3: _T_co, __item4: _T_co, *items: _T_co + ) -> itemgetter[tuple[_T_co, ...]]: ... + # __key: _KT_contra in SupportsGetItem seems to be causing variance issues, ie: + # TypeVar "_KT_contra@SupportsGetItem" is contravariant + # "tuple[int, int]" is incompatible with protocol "SupportsIndex" + # preventing [_T_co, ...] instead of [Any, ...] + # + # A suspected mypy issue prevents using [..., _T] instead of [..., Any] here. + # https://github.com/python/mypy/issues/14032 + def __call__(self, obj: SupportsGetItem[Any, Any]) -> Any: ... @final class methodcaller: diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/_osx_support.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/_osx_support.pyi index 7fd0ee922..3eb6f4ddc 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/_osx_support.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/_osx_support.pyi @@ -12,10 +12,10 @@ _UNIVERSAL_CONFIG_VARS: tuple[str, ...] # undocumented _COMPILER_CONFIG_VARS: tuple[str, ...] # undocumented _INITPRE: str # undocumented -def _find_executable(executable: str, path: str | None = ...) -> str | None: ... # undocumented +def _find_executable(executable: str, path: str | None = None) -> str | None: ... # undocumented if sys.version_info >= (3, 8): - def _read_output(commandstring: str, capture_stderr: bool = ...) -> str | None: ... # undocumented + def _read_output(commandstring: str, capture_stderr: bool = False) -> str | None: ... # undocumented else: def _read_output(commandstring: str) -> str | None: ... # undocumented diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/_posixsubprocess.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/_posixsubprocess.pyi index 2d221c489..ca95336bb 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/_posixsubprocess.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/_posixsubprocess.pyi @@ -1,24 +1,32 @@ import sys +from _typeshed import StrOrBytesPath from collections.abc import Callable, Sequence +from typing_extensions import SupportsIndex if sys.platform != "win32": def cloexec_pipe() -> tuple[int, int]: ... def fork_exec( - args: Sequence[str], - executable_list: Sequence[bytes], - close_fds: bool, - fds_to_keep: Sequence[int], - cwd: str, - env_list: Sequence[bytes], - p2cread: int, - p2cwrite: int, - c2pred: int, - c2pwrite: int, - errread: int, - errwrite: int, - errpipe_read: int, - errpipe_write: int, - restore_signals: int, - start_new_session: int, - preexec_fn: Callable[[], None], + __process_args: Sequence[StrOrBytesPath] | None, + __executable_list: Sequence[bytes], + __close_fds: bool, + __fds_to_keep: tuple[int, ...], + __cwd_obj: str, + __env_list: Sequence[bytes] | None, + __p2cread: int, + __p2cwrite: int, + __c2pred: int, + __c2pwrite: int, + __errread: int, + __errwrite: int, + __errpipe_read: int, + __errpipe_write: int, + __restore_signals: int, + __call_setsid: int, + __pgid_to_set: int, + __gid_object: SupportsIndex | None, + __groups_list: list[int] | None, + __uid_object: SupportsIndex | None, + __child_umask: int, + __preexec_fn: Callable[[], None], + __allow_vfork: bool, ) -> int: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/_py_abc.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/_py_abc.pyi index ddf04364a..cc45c6ad3 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/_py_abc.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/_py_abc.pyi @@ -1,4 +1,4 @@ -from _typeshed import Self +import _typeshed from typing import Any, NewType, TypeVar _T = TypeVar("_T") @@ -8,5 +8,7 @@ _CacheToken = NewType("_CacheToken", int) def get_cache_token() -> _CacheToken: ... class ABCMeta(type): - def __new__(__mcls: type[Self], __name: str, __bases: tuple[type[Any], ...], __namespace: dict[str, Any]) -> Self: ... + def __new__( + __mcls: type[_typeshed.Self], __name: str, __bases: tuple[type[Any], ...], __namespace: dict[str, Any] + ) -> _typeshed.Self: ... def register(cls, subclass: type[_T]) -> type[_T]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/_random.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/_random.pyi index c4b235f0c..7c5803ede 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/_random.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/_random.pyi @@ -5,7 +5,7 @@ _State: TypeAlias = tuple[int, ...] class Random: def __init__(self, seed: object = ...) -> None: ... - def seed(self, __n: object = ...) -> None: ... + def seed(self, __n: object = None) -> None: ... def getstate(self) -> _State: ... def setstate(self, __state: _State) -> None: ... def random(self) -> float: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/_sitebuiltins.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/_sitebuiltins.pyi index 4a35921e1..3bda2d884 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/_sitebuiltins.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/_sitebuiltins.pyi @@ -6,7 +6,7 @@ class Quitter: name: str eof: str def __init__(self, name: str, eof: str) -> None: ... - def __call__(self, code: int | None = ...) -> NoReturn: ... + def __call__(self, code: int | None = None) -> NoReturn: ... class _Printer: MAXLINES: ClassVar[Literal[23]] diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/_socket.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/_socket.pyi index 09dbaae3d..f7b0e6901 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/_socket.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/_socket.pyi @@ -15,10 +15,10 @@ _CMSG: TypeAlias = tuple[int, int, bytes] _CMSGArg: TypeAlias = tuple[int, int, ReadableBuffer] # Addresses can be either tuples of varying lengths (AF_INET, AF_INET6, -# AF_NETLINK, AF_TIPC) or strings (AF_UNIX). -_Address: TypeAlias = tuple[Any, ...] | str +# AF_NETLINK, AF_TIPC) or strings/buffers (AF_UNIX). +# See getsockaddrarg() in socketmodule.c. +_Address: TypeAlias = tuple[Any, ...] | str | ReadableBuffer _RetAddress: TypeAlias = Any -# TODO Most methods allow bytes as address objects # ----- Constants ----- # Some socket families are listed in the "Socket families" section of the docs, @@ -583,11 +583,15 @@ class socket: def proto(self) -> int: ... @property def timeout(self) -> float | None: ... - def __init__(self, family: int = ..., type: int = ..., proto: int = ..., fileno: _FD | None = ...) -> None: ... - def bind(self, __address: _Address | bytes) -> None: ... + if sys.platform == "win32": + def __init__(self, family: int = ..., type: int = ..., proto: int = ..., fileno: _FD | bytes | None = ...) -> None: ... + else: + def __init__(self, family: int = ..., type: int = ..., proto: int = ..., fileno: _FD | None = ...) -> None: ... + + def bind(self, __address: _Address) -> None: ... def close(self) -> None: ... - def connect(self, __address: _Address | bytes) -> None: ... - def connect_ex(self, __address: _Address | bytes) -> int: ... + def connect(self, __address: _Address) -> None: ... + def connect_ex(self, __address: _Address) -> int: ... def detach(self) -> int: ... def fileno(self) -> int: ... def getpeername(self) -> _RetAddress: ... @@ -624,7 +628,7 @@ class socket: __buffers: Iterable[ReadableBuffer], __ancdata: Iterable[_CMSGArg] = ..., __flags: int = ..., - __address: _Address = ..., + __address: _Address | None = ..., ) -> int: ... if sys.platform == "linux": def sendmsg_afalg( @@ -634,7 +638,7 @@ class socket: def setblocking(self, __flag: bool) -> None: ... def settimeout(self, __value: float | None) -> None: ... @overload - def setsockopt(self, __level: int, __optname: int, __value: int | bytes) -> None: ... + def setsockopt(self, __level: int, __optname: int, __value: int | ReadableBuffer) -> None: ... @overload def setsockopt(self, __level: int, __optname: int, __value: None, __optlen: int) -> None: ... if sys.platform == "win32": @@ -671,9 +675,9 @@ def ntohs(__x: int) -> int: ... # param & ret val are 16-bit ints def htonl(__x: int) -> int: ... # param & ret val are 32-bit ints def htons(__x: int) -> int: ... # param & ret val are 16-bit ints def inet_aton(__ip_string: str) -> bytes: ... # ret val 4 bytes in length -def inet_ntoa(__packed_ip: bytes) -> str: ... +def inet_ntoa(__packed_ip: ReadableBuffer) -> str: ... def inet_pton(__address_family: int, __ip_string: str) -> bytes: ... -def inet_ntop(__address_family: int, __packed_ip: bytes) -> str: ... +def inet_ntop(__address_family: int, __packed_ip: ReadableBuffer) -> str: ... def getdefaulttimeout() -> float | None: ... def setdefaulttimeout(__timeout: float | None) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/_threading_local.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/_threading_local.pyi index d455ce092..98683dabc 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/_threading_local.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/_threading_local.pyi @@ -14,3 +14,4 @@ class _localimpl: class local: def __getattribute__(self, name: str) -> Any: ... def __setattr__(self, name: str, value: Any) -> None: ... + def __delattr__(self, name: str) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/_tkinter.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/_tkinter.pyi index c2cf55505..89610e21d 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/_tkinter.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/_tkinter.pyi @@ -17,15 +17,17 @@ from typing_extensions import Literal, final # (, ) @final class Tcl_Obj: - string: str | bytes - typename: str + @property + def string(self) -> str: ... + @property + def typename(self) -> str: ... __hash__: ClassVar[None] # type: ignore[assignment] - def __eq__(self, __other): ... - def __ge__(self, __other): ... - def __gt__(self, __other): ... - def __le__(self, __other): ... - def __lt__(self, __other): ... - def __ne__(self, __other): ... + def __eq__(self, __value): ... + def __ge__(self, __value): ... + def __gt__(self, __value): ... + def __le__(self, __value): ... + def __lt__(self, __value): ... + def __ne__(self, __value): ... class TclError(Exception): ... @@ -58,7 +60,7 @@ class TkappType: def createtimerhandler(self, __milliseconds, __func): ... def deletecommand(self, __name): ... - def dooneevent(self, __flags: int = ...): ... + def dooneevent(self, __flags: int = 0): ... def eval(self, __script: str) -> str: ... def evalfile(self, __fileName): ... def exprboolean(self, __s): ... @@ -74,7 +76,7 @@ class TkappType: def globalunsetvar(self, *args, **kwargs): ... def interpaddr(self): ... def loadtk(self) -> None: ... - def mainloop(self, __threshold: int = ...): ... + def mainloop(self, __threshold: int = 0): ... def quit(self): ... def record(self, __script): ... def setvar(self, *ags, **kwargs): ... @@ -105,15 +107,29 @@ TK_VERSION: str class TkttType: def deletetimerhandler(self): ... -def create( - __screenName: str | None = ..., - __baseName: str | None = ..., - __className: str = ..., - __interactive: bool = ..., - __wantobjects: bool = ..., - __wantTk: bool = ..., - __sync: bool = ..., - __use: str | None = ..., -): ... +if sys.version_info >= (3, 8): + def create( + __screenName: str | None = None, + __baseName: str = "", + __className: str = "Tk", + __interactive: bool = False, + __wantobjects: bool = False, + __wantTk: bool = True, + __sync: bool = False, + __use: str | None = None, + ): ... + +else: + def create( + __screenName: str | None = None, + __baseName: str | None = None, + __className: str = "Tk", + __interactive: bool = False, + __wantobjects: bool = False, + __wantTk: bool = True, + __sync: bool = False, + __use: str | None = None, + ): ... + def getbusywaitinterval(): ... def setbusywaitinterval(__new_val): ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/_tracemalloc.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/_tracemalloc.pyi index 2262d4b16..1b79d9dc5 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/_tracemalloc.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/_tracemalloc.pyi @@ -13,5 +13,5 @@ def is_tracing() -> bool: ... if sys.version_info >= (3, 9): def reset_peak() -> None: ... -def start(__nframe: int = ...) -> None: ... +def start(__nframe: int = 1) -> None: ... def stop() -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/_typeshed/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/_typeshed/__init__.pyi index 89ca9d816..3c29032b6 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/_typeshed/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/_typeshed/__init__.pyi @@ -7,10 +7,11 @@ import ctypes import mmap import pickle import sys -from collections.abc import Awaitable, Callable, Container, Iterable, Set as AbstractSet +from collections.abc import Awaitable, Callable, Iterable, Set as AbstractSet +from dataclasses import Field from os import PathLike from types import FrameType, TracebackType -from typing import Any, AnyStr, Generic, Protocol, TypeVar, Union +from typing import Any, AnyStr, ClassVar, Generic, Protocol, TypeVar from typing_extensions import Final, Literal, LiteralString, TypeAlias, final _KT = TypeVar("_KT") @@ -36,6 +37,9 @@ AnyStr_co = TypeVar("AnyStr_co", str, bytes, covariant=True) # noqa: Y001 # "Incomplete | None" instead of "Any | None". Incomplete: TypeAlias = Any +# To describe a function parameter that is unused and will work with anything. +Unused: TypeAlias = object + # stable class IdentityFunction(Protocol): def __call__(self, __x: _T) -> _T: ... @@ -115,16 +119,17 @@ class SupportsItems(Protocol[_KT_co, _VT_co]): # stable class SupportsKeysAndGetItem(Protocol[_KT, _VT_co]): def keys(self) -> Iterable[_KT]: ... - def __getitem__(self, __k: _KT) -> _VT_co: ... + def __getitem__(self, __key: _KT) -> _VT_co: ... # stable -class SupportsGetItem(Container[_KT_contra], Protocol[_KT_contra, _VT_co]): - def __getitem__(self, __k: _KT_contra) -> _VT_co: ... +class SupportsGetItem(Protocol[_KT_contra, _VT_co]): + def __contains__(self, __x: Any) -> bool: ... + def __getitem__(self, __key: _KT_contra) -> _VT_co: ... # stable class SupportsItemAccess(SupportsGetItem[_KT_contra, _VT], Protocol[_KT_contra, _VT]): - def __setitem__(self, __k: _KT_contra, __v: _VT) -> None: ... - def __delitem__(self, __v: _KT_contra) -> None: ... + def __setitem__(self, __key: _KT_contra, __value: _VT) -> None: ... + def __delitem__(self, __key: _KT_contra) -> None: ... StrPath: TypeAlias = str | PathLike[str] # stable BytesPath: TypeAlias = bytes | PathLike[bytes] # stable @@ -204,6 +209,7 @@ class HasFileno(Protocol): FileDescriptor: TypeAlias = int # stable FileDescriptorLike: TypeAlias = int | HasFileno # stable +FileDescriptorOrPath: TypeAlias = int | StrOrBytesPath # stable class SupportsRead(Protocol[_T_co]): @@ -233,9 +239,33 @@ else: WriteableBuffer: TypeAlias = bytearray | memoryview | array.array[Any] | mmap.mmap | ctypes._CData # stable # Same as _WriteableBuffer, but also includes read-only buffer types (like bytes). ReadableBuffer: TypeAlias = ReadOnlyBuffer | WriteableBuffer # stable +_BufferWithLen: TypeAlias = ReadableBuffer # not stable # noqa: Y047 + +# Anything that implements the read-write buffer interface, and can be sliced/indexed. +SliceableBuffer: TypeAlias = bytes | bytearray | memoryview | array.array[Any] | mmap.mmap +IndexableBuffer: TypeAlias = bytes | bytearray | memoryview | array.array[Any] | mmap.mmap +# https://github.com/python/typeshed/pull/9115#issuecomment-1304905864 +# Post PEP 688, they should be rewritten as such: +# from collections.abc import Sequence +# from typing import Sized, overload +# class SliceableBuffer(Protocol): +# def __buffer__(self, __flags: int) -> memoryview: ... +# def __getitem__(self, __slice: slice) -> Sequence[int]: ... +# class IndexableBuffer(Protocol): +# def __buffer__(self, __flags: int) -> memoryview: ... +# def __getitem__(self, __i: int) -> int: ... +# class SupportsGetItemBuffer(SliceableBuffer, IndexableBuffer, Protocol): +# def __buffer__(self, __flags: int) -> memoryview: ... +# def __contains__(self, __x: Any) -> bool: ... +# @overload +# def __getitem__(self, __slice: slice) -> Sequence[int]: ... +# @overload +# def __getitem__(self, __i: int) -> int: ... +# class SizedBuffer(Sized, Protocol): # instead of _BufferWithLen +# def __buffer__(self, __flags: int) -> memoryview: ... ExcInfo: TypeAlias = tuple[type[BaseException], BaseException, TracebackType] -OptExcInfo: TypeAlias = Union[ExcInfo, tuple[None, None, None]] +OptExcInfo: TypeAlias = ExcInfo | tuple[None, None, None] # stable if sys.version_info >= (3, 10): @@ -263,7 +293,7 @@ class structseq(Generic[_T_co]): # https://github.com/python/typeshed/pull/6560#discussion_r767149830 def __new__(cls: type[Self], sequence: Iterable[_T_co], dict: dict[str, Any] = ...) -> Self: ... -# Superset of typing.AnyStr that also inclues LiteralString +# Superset of typing.AnyStr that also includes LiteralString AnyOrLiteralStr = TypeVar("AnyOrLiteralStr", str, bytes, LiteralString) # noqa: Y001 # Represents when str or LiteralStr is acceptable. Useful for string processing @@ -274,5 +304,11 @@ StrOrLiteralStr = TypeVar("StrOrLiteralStr", LiteralString, str) # noqa: Y001 ProfileFunction: TypeAlias = Callable[[FrameType, str, Any], object] # Objects suitable to be passed to sys.settrace, threading.settrace, and similar -# TODO: Ideally this would be a recursive type alias -TraceFunction: TypeAlias = Callable[[FrameType, str, Any], Callable[[FrameType, str, Any], Any] | None] +TraceFunction: TypeAlias = Callable[[FrameType, str, Any], TraceFunction | None] + +# experimental +# Might not work as expected for pyright, see +# https://github.com/python/typeshed/pull/9362 +# https://github.com/microsoft/pyright/issues/4339 +class DataclassInstance(Protocol): + __dataclass_fields__: ClassVar[dict[str, Field[Any]]] diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/_warnings.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/_warnings.pyi index 2eb9ae478..0981dfeaa 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/_warnings.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/_warnings.pyi @@ -5,9 +5,9 @@ _onceregistry: dict[Any, Any] filters: list[tuple[str, str | None, type[Warning], str | None, int]] @overload -def warn(message: str, category: type[Warning] | None = ..., stacklevel: int = ..., source: Any | None = ...) -> None: ... +def warn(message: str, category: type[Warning] | None = None, stacklevel: int = 1, source: Any | None = None) -> None: ... @overload -def warn(message: Warning, category: Any = ..., stacklevel: int = ..., source: Any | None = ...) -> None: ... +def warn(message: Warning, category: Any = None, stacklevel: int = 1, source: Any | None = None) -> None: ... @overload def warn_explicit( message: str, diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/_weakref.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/_weakref.pyi index 742bc3ad9..b6044fac4 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/_weakref.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/_weakref.pyi @@ -1,8 +1,7 @@ import sys -from _typeshed import Self from collections.abc import Callable from typing import Any, Generic, TypeVar, overload -from typing_extensions import final +from typing_extensions import Self, final if sys.version_info >= (3, 9): from types import GenericAlias @@ -21,7 +20,7 @@ class ProxyType(Generic[_T]): # "weakproxy" class ReferenceType(Generic[_T]): __callback__: Callable[[ReferenceType[_T]], Any] - def __new__(cls: type[Self], o: _T, callback: Callable[[ReferenceType[_T]], Any] | None = ...) -> Self: ... + def __new__(cls, __o: _T, __callback: Callable[[ReferenceType[_T]], Any] | None = ...) -> Self: ... def __call__(self) -> _T | None: ... if sys.version_info >= (3, 9): def __class_getitem__(cls, item: Any) -> GenericAlias: ... @@ -33,6 +32,6 @@ def getweakrefs(__object: Any) -> list[Any]: ... # Return CallableProxyType if object is callable, ProxyType otherwise @overload -def proxy(__object: _C, __callback: Callable[[_C], Any] | None = ...) -> CallableProxyType[_C]: ... +def proxy(__object: _C, __callback: Callable[[_C], Any] | None = None) -> CallableProxyType[_C]: ... @overload -def proxy(__object: _T, __callback: Callable[[_T], Any] | None = ...) -> Any: ... +def proxy(__object: _T, __callback: Callable[[_T], Any] | None = None) -> Any: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/_weakrefset.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/_weakrefset.pyi index da09442e8..d73d79155 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/_weakrefset.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/_weakrefset.pyi @@ -1,7 +1,7 @@ import sys -from _typeshed import Self from collections.abc import Iterable, Iterator, MutableSet from typing import Any, Generic, TypeVar, overload +from typing_extensions import Self if sys.version_info >= (3, 9): from types import GenericAlias @@ -13,26 +13,26 @@ _T = TypeVar("_T") class WeakSet(MutableSet[_T], Generic[_T]): @overload - def __init__(self, data: None = ...) -> None: ... + def __init__(self, data: None = None) -> None: ... @overload def __init__(self, data: Iterable[_T]) -> None: ... def add(self, item: _T) -> None: ... def discard(self, item: _T) -> None: ... - def copy(self: Self) -> Self: ... + def copy(self) -> Self: ... def remove(self, item: _T) -> None: ... def update(self, other: Iterable[_T]) -> None: ... def __contains__(self, item: object) -> bool: ... def __len__(self) -> int: ... def __iter__(self) -> Iterator[_T]: ... - def __ior__(self: Self, other: Iterable[_T]) -> Self: ... # type: ignore[override,misc] - def difference(self: Self, other: Iterable[_T]) -> Self: ... - def __sub__(self: Self, other: Iterable[Any]) -> Self: ... + def __ior__(self, other: Iterable[_T]) -> Self: ... # type: ignore[override,misc] + def difference(self, other: Iterable[_T]) -> Self: ... + def __sub__(self, other: Iterable[Any]) -> Self: ... def difference_update(self, other: Iterable[Any]) -> None: ... - def __isub__(self: Self, other: Iterable[Any]) -> Self: ... - def intersection(self: Self, other: Iterable[_T]) -> Self: ... - def __and__(self: Self, other: Iterable[Any]) -> Self: ... + def __isub__(self, other: Iterable[Any]) -> Self: ... + def intersection(self, other: Iterable[_T]) -> Self: ... + def __and__(self, other: Iterable[Any]) -> Self: ... def intersection_update(self, other: Iterable[Any]) -> None: ... - def __iand__(self: Self, other: Iterable[Any]) -> Self: ... + def __iand__(self, other: Iterable[Any]) -> Self: ... def issubset(self, other: Iterable[_T]) -> bool: ... def __le__(self, other: Iterable[_T]) -> bool: ... def __lt__(self, other: Iterable[_T]) -> bool: ... @@ -43,7 +43,7 @@ class WeakSet(MutableSet[_T], Generic[_T]): def symmetric_difference(self, other: Iterable[_S]) -> WeakSet[_S | _T]: ... def __xor__(self, other: Iterable[_S]) -> WeakSet[_S | _T]: ... def symmetric_difference_update(self, other: Iterable[_T]) -> None: ... - def __ixor__(self: Self, other: Iterable[_T]) -> Self: ... # type: ignore[override,misc] + def __ixor__(self, other: Iterable[_T]) -> Self: ... # type: ignore[override,misc] def union(self, other: Iterable[_S]) -> WeakSet[_S | _T]: ... def __or__(self, other: Iterable[_S]) -> WeakSet[_S | _T]: ... def isdisjoint(self, other: Iterable[_T]) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/_winapi.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/_winapi.pyi index 259293c51..e21402b80 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/_winapi.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/_winapi.pyi @@ -1,16 +1,19 @@ import sys +from _typeshed import ReadableBuffer from collections.abc import Sequence from typing import Any, NoReturn, overload from typing_extensions import Literal, final if sys.platform == "win32": - ABOVE_NORMAL_PRIORITY_CLASS: Literal[32768] - BELOW_NORMAL_PRIORITY_CLASS: Literal[16384] - CREATE_BREAKAWAY_FROM_JOB: Literal[16777216] - CREATE_DEFAULT_ERROR_MODE: Literal[67108864] - CREATE_NO_WINDOW: Literal[134217728] - CREATE_NEW_CONSOLE: Literal[16] - CREATE_NEW_PROCESS_GROUP: Literal[512] + ABOVE_NORMAL_PRIORITY_CLASS: Literal[0x8000] + BELOW_NORMAL_PRIORITY_CLASS: Literal[0x4000] + + CREATE_BREAKAWAY_FROM_JOB: Literal[0x1000000] + CREATE_DEFAULT_ERROR_MODE: Literal[0x4000000] + CREATE_NO_WINDOW: Literal[0x8000000] + CREATE_NEW_CONSOLE: Literal[0x10] + CREATE_NEW_PROCESS_GROUP: Literal[0x200] + DETACHED_PROCESS: Literal[8] DUPLICATE_CLOSE_SOURCE: Literal[1] DUPLICATE_SAME_ACCESS: Literal[2] @@ -27,40 +30,43 @@ if sys.platform == "win32": ERROR_PIPE_CONNECTED: Literal[535] ERROR_SEM_TIMEOUT: Literal[121] - FILE_FLAG_FIRST_PIPE_INSTANCE: Literal[524288] - FILE_FLAG_OVERLAPPED: Literal[1073741824] + FILE_FLAG_FIRST_PIPE_INSTANCE: Literal[0x80000] + FILE_FLAG_OVERLAPPED: Literal[0x40000000] + FILE_GENERIC_READ: Literal[1179785] FILE_GENERIC_WRITE: Literal[1179926] + if sys.version_info >= (3, 8): FILE_MAP_ALL_ACCESS: Literal[983071] FILE_MAP_COPY: Literal[1] FILE_MAP_EXECUTE: Literal[32] FILE_MAP_READ: Literal[4] FILE_MAP_WRITE: Literal[2] + FILE_TYPE_CHAR: Literal[2] FILE_TYPE_DISK: Literal[1] FILE_TYPE_PIPE: Literal[3] FILE_TYPE_REMOTE: Literal[32768] FILE_TYPE_UNKNOWN: Literal[0] - GENERIC_READ: Literal[2147483648] - GENERIC_WRITE: Literal[1073741824] - HIGH_PRIORITY_CLASS: Literal[128] - INFINITE: Literal[4294967295] + GENERIC_READ: Literal[0x80000000] + GENERIC_WRITE: Literal[0x40000000] + HIGH_PRIORITY_CLASS: Literal[0x80] + INFINITE: Literal[0xFFFFFFFF] if sys.version_info >= (3, 8): - INVALID_HANDLE_VALUE: int # very large number - IDLE_PRIORITY_CLASS: Literal[64] - NORMAL_PRIORITY_CLASS: Literal[32] - REALTIME_PRIORITY_CLASS: Literal[256] - NMPWAIT_WAIT_FOREVER: Literal[4294967295] + INVALID_HANDLE_VALUE: Literal[0xFFFFFFFFFFFFFFFF] + IDLE_PRIORITY_CLASS: Literal[0x40] + NORMAL_PRIORITY_CLASS: Literal[0x20] + REALTIME_PRIORITY_CLASS: Literal[0x100] + NMPWAIT_WAIT_FOREVER: Literal[0xFFFFFFFF] if sys.version_info >= (3, 8): - MEM_COMMIT: Literal[4096] - MEM_FREE: Literal[65536] - MEM_IMAGE: Literal[16777216] - MEM_MAPPED: Literal[262144] - MEM_PRIVATE: Literal[131072] - MEM_RESERVE: Literal[8192] + MEM_COMMIT: Literal[0x1000] + MEM_FREE: Literal[0x10000] + MEM_IMAGE: Literal[0x1000000] + MEM_MAPPED: Literal[0x40000] + MEM_PRIVATE: Literal[0x20000] + MEM_RESERVE: Literal[0x2000] NULL: Literal[0] OPEN_EXISTING: Literal[3] @@ -71,42 +77,47 @@ if sys.platform == "win32": PIPE_TYPE_MESSAGE: Literal[4] PIPE_UNLIMITED_INSTANCES: Literal[255] PIPE_WAIT: Literal[0] + if sys.version_info >= (3, 8): - PAGE_EXECUTE: Literal[16] - PAGE_EXECUTE_READ: Literal[32] - PAGE_EXECUTE_READWRITE: Literal[64] - PAGE_EXECUTE_WRITECOPY: Literal[128] - PAGE_GUARD: Literal[256] - PAGE_NOACCESS: Literal[1] - PAGE_NOCACHE: Literal[512] - PAGE_READONLY: Literal[2] - PAGE_READWRITE: Literal[4] - PAGE_WRITECOMBINE: Literal[1024] - PAGE_WRITECOPY: Literal[8] - - PROCESS_ALL_ACCESS: Literal[2097151] - PROCESS_DUP_HANDLE: Literal[64] + PAGE_EXECUTE: Literal[0x10] + PAGE_EXECUTE_READ: Literal[0x20] + PAGE_EXECUTE_READWRITE: Literal[0x40] + PAGE_EXECUTE_WRITECOPY: Literal[0x80] + PAGE_GUARD: Literal[0x100] + PAGE_NOACCESS: Literal[0x1] + PAGE_NOCACHE: Literal[0x200] + PAGE_READONLY: Literal[0x2] + PAGE_READWRITE: Literal[0x4] + PAGE_WRITECOMBINE: Literal[0x400] + PAGE_WRITECOPY: Literal[0x8] + + PROCESS_ALL_ACCESS: Literal[0x1FFFFF] + PROCESS_DUP_HANDLE: Literal[0x40] + if sys.version_info >= (3, 8): - SEC_COMMIT: Literal[134217728] - SEC_IMAGE: Literal[16777216] - SEC_LARGE_PAGES: Literal[2147483648] - SEC_NOCACHE: Literal[268435456] - SEC_RESERVE: Literal[67108864] - SEC_WRITECOMBINE: Literal[1073741824] - STARTF_USESHOWWINDOW: Literal[1] - STARTF_USESTDHANDLES: Literal[256] - STD_ERROR_HANDLE: Literal[4294967284] - STD_INPUT_HANDLE: Literal[4294967286] - STD_OUTPUT_HANDLE: Literal[4294967285] + SEC_COMMIT: Literal[0x8000000] + SEC_IMAGE: Literal[0x1000000] + SEC_LARGE_PAGES: Literal[0x80000000] + SEC_NOCACHE: Literal[0x10000000] + SEC_RESERVE: Literal[0x4000000] + SEC_WRITECOMBINE: Literal[0x40000000] + + STARTF_USESHOWWINDOW: Literal[0x1] + STARTF_USESTDHANDLES: Literal[0x100] + + STD_ERROR_HANDLE: Literal[0xFFFFFFF4] + STD_OUTPUT_HANDLE: Literal[0xFFFFFFF5] + STD_INPUT_HANDLE: Literal[0xFFFFFFF6] + STILL_ACTIVE: Literal[259] SW_HIDE: Literal[0] if sys.version_info >= (3, 8): - SYNCHRONIZE: Literal[1048576] + SYNCHRONIZE: Literal[0x100000] WAIT_ABANDONED_0: Literal[128] WAIT_OBJECT_0: Literal[0] WAIT_TIMEOUT: Literal[258] - if sys.version_info >= (3, 11): + if sys.version_info >= (3, 10): LOCALE_NAME_INVARIANT: str LOCALE_NAME_MAX_LENGTH: int LOCALE_NAME_SYSTEM_DEFAULT: str @@ -127,7 +138,7 @@ if sys.platform == "win32": @overload def ConnectNamedPipe(handle: int, overlapped: Literal[True]) -> Overlapped: ... @overload - def ConnectNamedPipe(handle: int, overlapped: Literal[False] = ...) -> None: ... + def ConnectNamedPipe(handle: int, overlapped: Literal[False] = False) -> None: ... @overload def ConnectNamedPipe(handle: int, overlapped: bool) -> Overlapped | None: ... def CreateFile( @@ -168,7 +179,7 @@ if sys.platform == "win32": __target_process_handle: int, __desired_access: int, __inherit_handle: bool, - __options: int = ..., + __options: int = 0, ) -> int: ... def ExitProcess(__ExitCode: int) -> NoReturn: ... def GetACP() -> int: ... @@ -180,29 +191,30 @@ if sys.platform == "win32": def GetStdHandle(__std_handle: int) -> int: ... def GetVersion() -> int: ... def OpenProcess(__desired_access: int, __inherit_handle: bool, __process_id: int) -> int: ... - def PeekNamedPipe(__handle: int, __size: int = ...) -> tuple[int, int] | tuple[bytes, int, int]: ... - if sys.version_info >= (3, 11): + def PeekNamedPipe(__handle: int, __size: int = 0) -> tuple[int, int] | tuple[bytes, int, int]: ... + if sys.version_info >= (3, 10): def LCMapStringEx(locale: str, flags: int, src: str) -> str: ... + def UnmapViewOfFile(__address: int) -> None: ... @overload def ReadFile(handle: int, size: int, overlapped: Literal[True]) -> tuple[Overlapped, int]: ... @overload - def ReadFile(handle: int, size: int, overlapped: Literal[False] = ...) -> tuple[bytes, int]: ... + def ReadFile(handle: int, size: int, overlapped: Literal[False] = False) -> tuple[bytes, int]: ... @overload def ReadFile(handle: int, size: int, overlapped: int | bool) -> tuple[Any, int]: ... def SetNamedPipeHandleState( __named_pipe: int, __mode: int | None, __max_collection_count: int | None, __collect_data_timeout: int | None ) -> None: ... def TerminateProcess(__handle: int, __exit_code: int) -> None: ... - def WaitForMultipleObjects(__handle_seq: Sequence[int], __wait_flag: bool, __milliseconds: int = ...) -> int: ... + def WaitForMultipleObjects(__handle_seq: Sequence[int], __wait_flag: bool, __milliseconds: int = 0xFFFFFFFF) -> int: ... def WaitForSingleObject(__handle: int, __milliseconds: int) -> int: ... def WaitNamedPipe(__name: str, __timeout: int) -> None: ... @overload - def WriteFile(handle: int, buffer: bytes, overlapped: Literal[True]) -> tuple[Overlapped, int]: ... + def WriteFile(handle: int, buffer: ReadableBuffer, overlapped: Literal[True]) -> tuple[Overlapped, int]: ... @overload - def WriteFile(handle: int, buffer: bytes, overlapped: Literal[False] = ...) -> tuple[int, int]: ... + def WriteFile(handle: int, buffer: ReadableBuffer, overlapped: Literal[False] = False) -> tuple[int, int]: ... @overload - def WriteFile(handle: int, buffer: bytes, overlapped: int | bool) -> tuple[Any, int]: ... + def WriteFile(handle: int, buffer: ReadableBuffer, overlapped: int | bool) -> tuple[Any, int]: ... @final class Overlapped: event: int diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/abc.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/abc.pyi index f7f82333a..ec04d8f85 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/abc.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/abc.pyi @@ -1,40 +1,41 @@ +import _typeshed import sys -from _typeshed import Self, SupportsWrite +from _typeshed import SupportsWrite from collections.abc import Callable -from typing import Any, Generic, TypeVar -from typing_extensions import Literal +from typing import Any, TypeVar +from typing_extensions import Concatenate, Literal, ParamSpec _T = TypeVar("_T") _R_co = TypeVar("_R_co", covariant=True) _FuncT = TypeVar("_FuncT", bound=Callable[..., Any]) +_P = ParamSpec("_P") # These definitions have special processing in mypy class ABCMeta(type): __abstractmethods__: frozenset[str] if sys.version_info >= (3, 11): def __new__( - __mcls: type[Self], __name: str, __bases: tuple[type, ...], __namespace: dict[str, Any], **kwargs: Any - ) -> Self: ... + __mcls: type[_typeshed.Self], __name: str, __bases: tuple[type, ...], __namespace: dict[str, Any], **kwargs: Any + ) -> _typeshed.Self: ... else: - # pyright doesn't like the first parameter being called mcls, hence the `pyright: ignore` def __new__( - mcls: type[Self], name: str, bases: tuple[type, ...], namespace: dict[str, Any], **kwargs: Any # pyright: ignore - ) -> Self: ... + mcls: type[_typeshed.Self], name: str, bases: tuple[type, ...], namespace: dict[str, Any], **kwargs: Any + ) -> _typeshed.Self: ... - def __instancecheck__(cls: ABCMeta, instance: Any) -> Any: ... - def __subclasscheck__(cls: ABCMeta, subclass: Any) -> Any: ... - def _dump_registry(cls: ABCMeta, file: SupportsWrite[str] | None = ...) -> None: ... + def __instancecheck__(cls: ABCMeta, instance: Any) -> bool: ... + def __subclasscheck__(cls: ABCMeta, subclass: type) -> bool: ... + def _dump_registry(cls: ABCMeta, file: SupportsWrite[str] | None = None) -> None: ... def register(cls: ABCMeta, subclass: type[_T]) -> type[_T]: ... def abstractmethod(funcobj: _FuncT) -> _FuncT: ... -class abstractclassmethod(classmethod[_R_co], Generic[_R_co]): +class abstractclassmethod(classmethod[_T, _P, _R_co]): __isabstractmethod__: Literal[True] - def __init__(self: abstractclassmethod[_R_co], callable: Callable[..., _R_co]) -> None: ... + def __init__(self, callable: Callable[Concatenate[_T, _P], _R_co]) -> None: ... -class abstractstaticmethod(staticmethod[_R_co], Generic[_R_co]): +class abstractstaticmethod(staticmethod[_P, _R_co]): __isabstractmethod__: Literal[True] - def __init__(self, callable: Callable[..., _R_co]) -> None: ... + def __init__(self, callable: Callable[_P, _R_co]) -> None: ... class abstractproperty(property): __isabstractmethod__: Literal[True] diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/aifc.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/aifc.pyi index 14e824f3d..ab0c18ed6 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/aifc.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/aifc.pyi @@ -1,8 +1,7 @@ import sys -from _typeshed import Self from types import TracebackType from typing import IO, Any, NamedTuple, overload -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal, Self, TypeAlias if sys.version_info >= (3, 9): __all__ = ["Error", "open"] @@ -24,7 +23,7 @@ _Marker: TypeAlias = tuple[int, int, bytes] class Aifc_read: def __init__(self, f: _File) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None ) -> None: ... @@ -48,7 +47,7 @@ class Aifc_read: class Aifc_write: def __init__(self, f: _File) -> None: ... def __del__(self) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None ) -> None: ... @@ -81,7 +80,7 @@ def open(f: _File, mode: Literal["r", "rb"]) -> Aifc_read: ... @overload def open(f: _File, mode: Literal["w", "wb"]) -> Aifc_write: ... @overload -def open(f: _File, mode: str | None = ...) -> Any: ... +def open(f: _File, mode: str | None = None) -> Any: ... if sys.version_info < (3, 9): @overload @@ -89,4 +88,4 @@ if sys.version_info < (3, 9): @overload def openfp(f: _File, mode: Literal["w", "wb"]) -> Aifc_write: ... @overload - def openfp(f: _File, mode: str | None = ...) -> Any: ... + def openfp(f: _File, mode: str | None = None) -> Any: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/antigravity.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/antigravity.pyi index e30917511..3986e7d1c 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/antigravity.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/antigravity.pyi @@ -1 +1,3 @@ -def geohash(latitude: float, longitude: float, datedow: bytes) -> None: ... +from _typeshed import ReadableBuffer + +def geohash(latitude: float, longitude: float, datedow: ReadableBuffer) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/argparse.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/argparse.pyi index 1b86a4e10..eb0b707ba 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/argparse.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/argparse.pyi @@ -78,7 +78,7 @@ class _ActionsContainer: _has_negative_number_optionals: list[bool] def __init__(self, description: str | None, prefix_chars: str, argument_default: Any, conflict_handler: str) -> None: ... def register(self, registry_name: str, value: Any, object: Any) -> None: ... - def _registry_get(self, registry_name: str, value: Any, default: Any = ...) -> Any: ... + def _registry_get(self, registry_name: str, value: Any, default: Any = None) -> Any: ... def set_defaults(self, **kwargs: Any) -> None: ... def get_default(self, dest: str) -> Any: ... def add_argument( @@ -104,7 +104,7 @@ class _ActionsContainer: def _add_container_actions(self, container: _ActionsContainer) -> None: ... def _get_positional_kwargs(self, dest: str, **kwargs: Any) -> dict[str, Any]: ... def _get_optional_kwargs(self, *args: Any, **kwargs: Any) -> dict[str, Any]: ... - def _pop_action_class(self, kwargs: Any, default: type[Action] | None = ...) -> type[Action]: ... + def _pop_action_class(self, kwargs: Any, default: type[Action] | None = None) -> type[Action]: ... def _get_handler(self) -> Callable[[Action, Iterable[tuple[str, Action]]], Any]: ... def _check_conflict(self, action: Action) -> None: ... def _handle_conflict_error(self, action: Action, conflicting_actions: Iterable[tuple[str, Action]]) -> NoReturn: ... @@ -127,50 +127,46 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer): _optionals: _ArgumentGroup _subparsers: _ArgumentGroup | None + # Note: the constructor arguments are also used in _SubParsersAction.add_parser. if sys.version_info >= (3, 9): def __init__( self, - prog: str | None = ..., - usage: str | None = ..., - description: str | None = ..., - epilog: str | None = ..., + prog: str | None = None, + usage: str | None = None, + description: str | None = None, + epilog: str | None = None, parents: Sequence[ArgumentParser] = ..., formatter_class: _FormatterClass = ..., - prefix_chars: str = ..., - fromfile_prefix_chars: str | None = ..., - argument_default: Any = ..., - conflict_handler: str = ..., - add_help: bool = ..., - allow_abbrev: bool = ..., - exit_on_error: bool = ..., + prefix_chars: str = "-", + fromfile_prefix_chars: str | None = None, + argument_default: Any = None, + conflict_handler: str = "error", + add_help: bool = True, + allow_abbrev: bool = True, + exit_on_error: bool = True, ) -> None: ... else: def __init__( self, - prog: str | None = ..., - usage: str | None = ..., - description: str | None = ..., - epilog: str | None = ..., + prog: str | None = None, + usage: str | None = None, + description: str | None = None, + epilog: str | None = None, parents: Sequence[ArgumentParser] = ..., formatter_class: _FormatterClass = ..., - prefix_chars: str = ..., - fromfile_prefix_chars: str | None = ..., - argument_default: Any = ..., - conflict_handler: str = ..., - add_help: bool = ..., - allow_abbrev: bool = ..., + prefix_chars: str = "-", + fromfile_prefix_chars: str | None = None, + argument_default: Any = None, + conflict_handler: str = "error", + add_help: bool = True, + allow_abbrev: bool = True, ) -> None: ... - # The type-ignores in these overloads should be temporary. See: - # https://github.com/python/typeshed/pull/2643#issuecomment-442280277 + # Ignore errors about overlapping overloads @overload - def parse_args(self, args: Sequence[str] | None = ...) -> Namespace: ... - @overload - def parse_args(self, args: Sequence[str] | None, namespace: None) -> Namespace: ... # type: ignore[misc] + def parse_args(self, args: Sequence[str] | None = None, namespace: None = None) -> Namespace: ... # type: ignore[misc] @overload def parse_args(self, args: Sequence[str] | None, namespace: _N) -> _N: ... @overload - def parse_args(self, *, namespace: None) -> Namespace: ... # type: ignore[misc] - @overload def parse_args(self, *, namespace: _N) -> _N: ... @overload def add_subparsers( @@ -201,19 +197,19 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer): help: str | None = ..., metavar: str | None = ..., ) -> _SubParsersAction[_ArgumentParserT]: ... - def print_usage(self, file: IO[str] | None = ...) -> None: ... - def print_help(self, file: IO[str] | None = ...) -> None: ... + def print_usage(self, file: IO[str] | None = None) -> None: ... + def print_help(self, file: IO[str] | None = None) -> None: ... def format_usage(self) -> str: ... def format_help(self) -> str: ... def parse_known_args( - self, args: Sequence[str] | None = ..., namespace: Namespace | None = ... + self, args: Sequence[str] | None = None, namespace: Namespace | None = None ) -> tuple[Namespace, list[str]]: ... def convert_arg_line_to_args(self, arg_line: str) -> list[str]: ... - def exit(self, status: int = ..., message: str | None = ...) -> NoReturn: ... + def exit(self, status: int = 0, message: str | None = None) -> NoReturn: ... def error(self, message: str) -> NoReturn: ... - def parse_intermixed_args(self, args: Sequence[str] | None = ..., namespace: Namespace | None = ...) -> Namespace: ... + def parse_intermixed_args(self, args: Sequence[str] | None = None, namespace: Namespace | None = None) -> Namespace: ... def parse_known_intermixed_args( - self, args: Sequence[str] | None = ..., namespace: Namespace | None = ... + self, args: Sequence[str] | None = None, namespace: Namespace | None = None ) -> tuple[Namespace, list[str]]: ... # undocumented def _get_optional_actions(self) -> list[Action]: ... @@ -229,7 +225,7 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer): def _get_value(self, action: Action, arg_string: str) -> Any: ... def _check_value(self, action: Action, value: Any) -> None: ... def _get_formatter(self) -> HelpFormatter: ... - def _print_message(self, message: str, file: IO[str] | None = ...) -> None: ... + def _print_message(self, message: str, file: IO[str] | None = None) -> None: ... class HelpFormatter: # undocumented @@ -245,7 +241,7 @@ class HelpFormatter: _whitespace_matcher: Pattern[str] _long_break_matcher: Pattern[str] _Section: type[Any] # Nested class - def __init__(self, prog: str, indent_increment: int = ..., max_help_position: int = ..., width: int | None = ...) -> None: ... + def __init__(self, prog: str, indent_increment: int = 2, max_help_position: int = 24, width: int | None = None) -> None: ... def _indent(self) -> None: ... def _dedent(self) -> None: ... def _add_item(self, func: Callable[..., str], args: Iterable[Any]) -> None: ... @@ -253,7 +249,7 @@ class HelpFormatter: def end_section(self) -> None: ... def add_text(self, text: str | None) -> None: ... def add_usage( - self, usage: str | None, actions: Iterable[Action], groups: Iterable[_ArgumentGroup], prefix: str | None = ... + self, usage: str | None, actions: Iterable[Action], groups: Iterable[_ArgumentGroup], prefix: str | None = None ) -> None: ... def add_argument(self, action: Action) -> None: ... def add_arguments(self, actions: Iterable[Action]) -> None: ... @@ -296,17 +292,17 @@ class Action(_AttributeHolder): self, option_strings: Sequence[str], dest: str, - nargs: int | str | None = ..., - const: _T | None = ..., - default: _T | str | None = ..., - type: Callable[[str], _T] | FileType | None = ..., - choices: Iterable[_T] | None = ..., - required: bool = ..., - help: str | None = ..., - metavar: str | tuple[str, ...] | None = ..., + nargs: int | str | None = None, + const: _T | None = None, + default: _T | str | None = None, + type: Callable[[str], _T] | FileType | None = None, + choices: Iterable[_T] | None = None, + required: bool = False, + help: str | None = None, + metavar: str | tuple[str, ...] | None = None, ) -> None: ... def __call__( - self, parser: ArgumentParser, namespace: Namespace, values: str | Sequence[Any] | None, option_string: str | None = ... + self, parser: ArgumentParser, namespace: Namespace, values: str | Sequence[Any] | None, option_string: str | None = None ) -> None: ... if sys.version_info >= (3, 9): def format_usage(self) -> str: ... @@ -317,12 +313,12 @@ if sys.version_info >= (3, 9): self, option_strings: Sequence[str], dest: str, - default: _T | str | None = ..., - type: Callable[[str], _T] | FileType | None = ..., - choices: Iterable[_T] | None = ..., - required: bool = ..., - help: str | None = ..., - metavar: str | tuple[str, ...] | None = ..., + default: _T | str | None = None, + type: Callable[[str], _T] | FileType | None = None, + choices: Iterable[_T] | None = None, + required: bool = False, + help: str | None = None, + metavar: str | tuple[str, ...] | None = None, ) -> None: ... class Namespace(_AttributeHolder): @@ -338,7 +334,7 @@ class FileType: _bufsize: int _encoding: str | None _errors: str | None - def __init__(self, mode: str = ..., bufsize: int = ..., encoding: str | None = ..., errors: str | None = ...) -> None: ... + def __init__(self, mode: str = "r", bufsize: int = -1, encoding: str | None = None, errors: str | None = None) -> None: ... def __call__(self, string: str) -> IO[Any]: ... # undocumented @@ -346,14 +342,14 @@ class _ArgumentGroup(_ActionsContainer): title: str | None _group_actions: list[Action] def __init__( - self, container: _ActionsContainer, title: str | None = ..., description: str | None = ..., **kwargs: Any + self, container: _ActionsContainer, title: str | None = None, description: str | None = None, **kwargs: Any ) -> None: ... # undocumented class _MutuallyExclusiveGroup(_ArgumentGroup): required: bool _container: _ActionsContainer - def __init__(self, container: _ActionsContainer, required: bool = ...) -> None: ... + def __init__(self, container: _ActionsContainer, required: bool = False) -> None: ... # undocumented class _StoreAction(Action): ... @@ -365,11 +361,11 @@ class _StoreConstAction(Action): self, option_strings: Sequence[str], dest: str, - const: Any | None = ..., - default: Any = ..., - required: bool = ..., - help: str | None = ..., - metavar: str | tuple[str, ...] | None = ..., + const: Any | None = None, + default: Any = None, + required: bool = False, + help: str | None = None, + metavar: str | tuple[str, ...] | None = None, ) -> None: ... else: def __init__( @@ -377,27 +373,31 @@ class _StoreConstAction(Action): option_strings: Sequence[str], dest: str, const: Any, - default: Any = ..., - required: bool = ..., - help: str | None = ..., - metavar: str | tuple[str, ...] | None = ..., + default: Any = None, + required: bool = False, + help: str | None = None, + metavar: str | tuple[str, ...] | None = None, ) -> None: ... # undocumented class _StoreTrueAction(_StoreConstAction): def __init__( - self, option_strings: Sequence[str], dest: str, default: bool = ..., required: bool = ..., help: str | None = ... + self, option_strings: Sequence[str], dest: str, default: bool = False, required: bool = False, help: str | None = None ) -> None: ... # undocumented class _StoreFalseAction(_StoreConstAction): def __init__( - self, option_strings: Sequence[str], dest: str, default: bool = ..., required: bool = ..., help: str | None = ... + self, option_strings: Sequence[str], dest: str, default: bool = True, required: bool = False, help: str | None = None ) -> None: ... # undocumented class _AppendAction(Action): ... +# undocumented +if sys.version_info >= (3, 8): + class _ExtendAction(_AppendAction): ... + # undocumented class _AppendConstAction(Action): if sys.version_info >= (3, 11): @@ -405,11 +405,11 @@ class _AppendConstAction(Action): self, option_strings: Sequence[str], dest: str, - const: Any | None = ..., - default: Any = ..., - required: bool = ..., - help: str | None = ..., - metavar: str | tuple[str, ...] | None = ..., + const: Any | None = None, + default: Any = None, + required: bool = False, + help: str | None = None, + metavar: str | tuple[str, ...] | None = None, ) -> None: ... else: def __init__( @@ -417,27 +417,34 @@ class _AppendConstAction(Action): option_strings: Sequence[str], dest: str, const: Any, - default: Any = ..., - required: bool = ..., - help: str | None = ..., - metavar: str | tuple[str, ...] | None = ..., + default: Any = None, + required: bool = False, + help: str | None = None, + metavar: str | tuple[str, ...] | None = None, ) -> None: ... # undocumented class _CountAction(Action): def __init__( - self, option_strings: Sequence[str], dest: str, default: Any = ..., required: bool = ..., help: str | None = ... + self, option_strings: Sequence[str], dest: str, default: Any = None, required: bool = False, help: str | None = None ) -> None: ... # undocumented class _HelpAction(Action): - def __init__(self, option_strings: Sequence[str], dest: str = ..., default: str = ..., help: str | None = ...) -> None: ... + def __init__( + self, option_strings: Sequence[str], dest: str = "==SUPPRESS==", default: str = "==SUPPRESS==", help: str | None = None + ) -> None: ... # undocumented class _VersionAction(Action): version: str | None def __init__( - self, option_strings: Sequence[str], version: str | None = ..., dest: str = ..., default: str = ..., help: str = ... + self, + option_strings: Sequence[str], + version: str | None = None, + dest: str = "==SUPPRESS==", + default: str = "==SUPPRESS==", + help: str = "show program's version number and exit", ) -> None: ... # undocumented @@ -453,13 +460,58 @@ class _SubParsersAction(Action, Generic[_ArgumentParserT]): option_strings: Sequence[str], prog: str, parser_class: type[_ArgumentParserT], - dest: str = ..., - required: bool = ..., - help: str | None = ..., - metavar: str | tuple[str, ...] | None = ..., + dest: str = "==SUPPRESS==", + required: bool = False, + help: str | None = None, + metavar: str | tuple[str, ...] | None = None, ) -> None: ... - # TODO: Type keyword args properly. - def add_parser(self, name: str, **kwargs: Any) -> _ArgumentParserT: ... + + # Note: `add_parser` accepts all kwargs of `ArgumentParser.__init__`. It also + # accepts its own `help` and `aliases` kwargs. + if sys.version_info >= (3, 9): + def add_parser( + self, + name: str, + *, + help: str | None = ..., + aliases: Sequence[str] = ..., + # Kwargs from ArgumentParser constructor + prog: str | None = ..., + usage: str | None = ..., + description: str | None = ..., + epilog: str | None = ..., + parents: Sequence[_ArgumentParserT] = ..., + formatter_class: _FormatterClass = ..., + prefix_chars: str = ..., + fromfile_prefix_chars: str | None = ..., + argument_default: Any = ..., + conflict_handler: str = ..., + add_help: bool = ..., + allow_abbrev: bool = ..., + exit_on_error: bool = ..., + ) -> _ArgumentParserT: ... + else: + def add_parser( + self, + name: str, + *, + help: str | None = ..., + aliases: Sequence[str] = ..., + # Kwargs from ArgumentParser constructor + prog: str | None = ..., + usage: str | None = ..., + description: str | None = ..., + epilog: str | None = ..., + parents: Sequence[_ArgumentParserT] = ..., + formatter_class: _FormatterClass = ..., + prefix_chars: str = ..., + fromfile_prefix_chars: str | None = ..., + argument_default: Any = ..., + conflict_handler: str = ..., + add_help: bool = ..., + allow_abbrev: bool = ..., + ) -> _ArgumentParserT: ... + def _get_subactions(self) -> list[Action]: ... # undocumented diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/array.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/array.pyi index 2d27cd72e..38a815b58 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/array.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/array.pyi @@ -1,10 +1,10 @@ import sys -from _typeshed import ReadableBuffer, Self, SupportsRead, SupportsWrite +from _typeshed import ReadableBuffer, SupportsRead, SupportsWrite from collections.abc import Iterable # pytype crashes if array inherits from collections.abc.MutableSequence instead of typing.MutableSequence -from typing import Any, Generic, MutableSequence, TypeVar, overload # noqa: Y027 -from typing_extensions import Literal, SupportsIndex, TypeAlias +from typing import Any, Generic, MutableSequence, TypeVar, overload # noqa: Y022 +from typing_extensions import Literal, Self, SupportsIndex, TypeAlias _IntTypeCode: TypeAlias = Literal["b", "B", "h", "H", "i", "I", "l", "L", "q", "Q"] _FloatTypeCode: TypeAlias = Literal["f", "d"] @@ -21,15 +21,19 @@ class array(MutableSequence[_T], Generic[_T]): @property def itemsize(self) -> int: ... @overload - def __init__(self: array[int], __typecode: _IntTypeCode, __initializer: bytes | Iterable[int] = ...) -> None: ... + def __init__(self: array[int], __typecode: _IntTypeCode, __initializer: bytes | bytearray | Iterable[int] = ...) -> None: ... @overload - def __init__(self: array[float], __typecode: _FloatTypeCode, __initializer: bytes | Iterable[float] = ...) -> None: ... + def __init__( + self: array[float], __typecode: _FloatTypeCode, __initializer: bytes | bytearray | Iterable[float] = ... + ) -> None: ... @overload - def __init__(self: array[str], __typecode: _UnicodeTypeCode, __initializer: bytes | Iterable[str] = ...) -> None: ... + def __init__( + self: array[str], __typecode: _UnicodeTypeCode, __initializer: bytes | bytearray | Iterable[str] = ... + ) -> None: ... @overload def __init__(self, __typecode: str, __initializer: Iterable[_T]) -> None: ... @overload - def __init__(self, __typecode: str, __initializer: bytes = ...) -> None: ... + def __init__(self, __typecode: str, __initializer: bytes | bytearray = ...) -> None: ... def append(self, __v: _T) -> None: ... def buffer_info(self) -> tuple[int, int]: ... def byteswap(self) -> None: ... @@ -40,40 +44,40 @@ class array(MutableSequence[_T], Generic[_T]): def fromlist(self, __list: list[_T]) -> None: ... def fromunicode(self, __ustr: str) -> None: ... if sys.version_info >= (3, 10): - def index(self, __v: _T, __start: int = ..., __stop: int = ...) -> int: ... + def index(self, __v: _T, __start: int = 0, __stop: int = sys.maxsize) -> int: ... else: def index(self, __v: _T) -> int: ... # type: ignore[override] def insert(self, __i: int, __v: _T) -> None: ... - def pop(self, __i: int = ...) -> _T: ... + def pop(self, __i: int = -1) -> _T: ... def remove(self, __v: _T) -> None: ... def tobytes(self) -> bytes: ... def tofile(self, __f: SupportsWrite[bytes]) -> None: ... def tolist(self) -> list[_T]: ... def tounicode(self) -> str: ... if sys.version_info < (3, 9): - def fromstring(self, __buffer: bytes) -> None: ... + def fromstring(self, __buffer: str | ReadableBuffer) -> None: ... def tostring(self) -> bytes: ... def __len__(self) -> int: ... @overload - def __getitem__(self, __i: SupportsIndex) -> _T: ... + def __getitem__(self, __key: SupportsIndex) -> _T: ... @overload - def __getitem__(self, __s: slice) -> array[_T]: ... + def __getitem__(self, __key: slice) -> array[_T]: ... @overload # type: ignore[override] - def __setitem__(self, __i: SupportsIndex, __o: _T) -> None: ... + def __setitem__(self, __key: SupportsIndex, __value: _T) -> None: ... @overload - def __setitem__(self, __s: slice, __o: array[_T]) -> None: ... - def __delitem__(self, __i: SupportsIndex | slice) -> None: ... - def __add__(self, __x: array[_T]) -> array[_T]: ... - def __ge__(self, __other: array[_T]) -> bool: ... - def __gt__(self, __other: array[_T]) -> bool: ... - def __iadd__(self: Self, __x: array[_T]) -> Self: ... # type: ignore[override] - def __imul__(self: Self, __n: int) -> Self: ... - def __le__(self, __other: array[_T]) -> bool: ... - def __lt__(self, __other: array[_T]) -> bool: ... - def __mul__(self, __n: int) -> array[_T]: ... - def __rmul__(self, __n: int) -> array[_T]: ... + def __setitem__(self, __key: slice, __value: array[_T]) -> None: ... + def __delitem__(self, __key: SupportsIndex | slice) -> None: ... + def __add__(self, __value: array[_T]) -> array[_T]: ... + def __ge__(self, __value: array[_T]) -> bool: ... + def __gt__(self, __value: array[_T]) -> bool: ... + def __iadd__(self, __value: array[_T]) -> Self: ... # type: ignore[override] + def __imul__(self, __value: int) -> Self: ... + def __le__(self, __value: array[_T]) -> bool: ... + def __lt__(self, __value: array[_T]) -> bool: ... + def __mul__(self, __value: int) -> array[_T]: ... + def __rmul__(self, __value: int) -> array[_T]: ... def __copy__(self) -> array[_T]: ... def __deepcopy__(self, __unused: Any) -> array[_T]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/ast.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/ast.pyi index 3a54d158a..ea899e150 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/ast.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/ast.pyi @@ -1,25 +1,31 @@ +import os import sys from _ast import * +from _typeshed import ReadableBuffer, Unused from collections.abc import Iterator from typing import Any, TypeVar, overload from typing_extensions import Literal if sys.version_info >= (3, 8): - class Num(Constant): - value: complex + class _ABC(type): + if sys.version_info >= (3, 9): + def __init__(cls, *args: Unused) -> None: ... - class Str(Constant): + class Num(Constant, metaclass=_ABC): + value: int | float | complex + + class Str(Constant, metaclass=_ABC): value: str # Aliases for value, for backwards compatibility s: str - class Bytes(Constant): + class Bytes(Constant, metaclass=_ABC): value: bytes # Aliases for value, for backwards compatibility s: bytes - class NameConstant(Constant): ... - class Ellipsis(Constant): ... + class NameConstant(Constant, metaclass=_ABC): ... + class Ellipsis(Constant, metaclass=_ABC): ... if sys.version_info >= (3, 9): class slice(AST): ... @@ -83,6 +89,7 @@ class NodeVisitor: def visit_Constant(self, node: Constant) -> Any: ... if sys.version_info >= (3, 8): def visit_NamedExpr(self, node: NamedExpr) -> Any: ... + def visit_TypeIgnore(self, node: TypeIgnore) -> Any: ... def visit_Attribute(self, node: Attribute) -> Any: ... def visit_Subscript(self, node: Subscript) -> Any: ... @@ -129,6 +136,19 @@ class NodeVisitor: def visit_keyword(self, node: keyword) -> Any: ... def visit_alias(self, node: alias) -> Any: ... def visit_withitem(self, node: withitem) -> Any: ... + if sys.version_info >= (3, 10): + def visit_Match(self, node: Match) -> Any: ... + def visit_MatchValue(self, node: MatchValue) -> Any: ... + def visit_MatchSequence(self, node: MatchSequence) -> Any: ... + def visit_MatchStar(self, node: MatchStar) -> Any: ... + def visit_MatchMapping(self, node: MatchMapping) -> Any: ... + def visit_MatchClass(self, node: MatchClass) -> Any: ... + def visit_MatchAs(self, node: MatchAs) -> Any: ... + def visit_MatchOr(self, node: MatchOr) -> Any: ... + + if sys.version_info >= (3, 11): + def visit_TryStar(self, node: TryStar) -> Any: ... + # visit methods for deprecated nodes def visit_ExtSlice(self, node: ExtSlice) -> Any: ... def visit_Index(self, node: Index) -> Any: ... @@ -153,87 +173,97 @@ _T = TypeVar("_T", bound=AST) if sys.version_info >= (3, 8): @overload def parse( - source: str | bytes, - filename: str | bytes = ..., - mode: Literal["exec"] = ..., + source: str | ReadableBuffer, + filename: str | ReadableBuffer | os.PathLike[Any] = "", + mode: Literal["exec"] = "exec", *, - type_comments: bool = ..., - feature_version: None | int | tuple[int, int] = ..., + type_comments: bool = False, + feature_version: None | int | tuple[int, int] = None, ) -> Module: ... @overload def parse( - source: str | bytes, - filename: str | bytes, + source: str | ReadableBuffer, + filename: str | ReadableBuffer | os.PathLike[Any], mode: Literal["eval"], *, - type_comments: bool = ..., - feature_version: None | int | tuple[int, int] = ..., + type_comments: bool = False, + feature_version: None | int | tuple[int, int] = None, ) -> Expression: ... @overload def parse( - source: str | bytes, - filename: str | bytes, + source: str | ReadableBuffer, + filename: str | ReadableBuffer | os.PathLike[Any], mode: Literal["func_type"], *, - type_comments: bool = ..., - feature_version: None | int | tuple[int, int] = ..., + type_comments: bool = False, + feature_version: None | int | tuple[int, int] = None, ) -> FunctionType: ... @overload def parse( - source: str | bytes, - filename: str | bytes, + source: str | ReadableBuffer, + filename: str | ReadableBuffer | os.PathLike[Any], mode: Literal["single"], *, - type_comments: bool = ..., - feature_version: None | int | tuple[int, int] = ..., + type_comments: bool = False, + feature_version: None | int | tuple[int, int] = None, ) -> Interactive: ... @overload def parse( - source: str | bytes, + source: str | ReadableBuffer, *, mode: Literal["eval"], - type_comments: bool = ..., - feature_version: None | int | tuple[int, int] = ..., + type_comments: bool = False, + feature_version: None | int | tuple[int, int] = None, ) -> Expression: ... @overload def parse( - source: str | bytes, + source: str | ReadableBuffer, *, mode: Literal["func_type"], - type_comments: bool = ..., - feature_version: None | int | tuple[int, int] = ..., + type_comments: bool = False, + feature_version: None | int | tuple[int, int] = None, ) -> FunctionType: ... @overload def parse( - source: str | bytes, + source: str | ReadableBuffer, *, mode: Literal["single"], - type_comments: bool = ..., - feature_version: None | int | tuple[int, int] = ..., + type_comments: bool = False, + feature_version: None | int | tuple[int, int] = None, ) -> Interactive: ... @overload def parse( - source: str | bytes, - filename: str | bytes = ..., - mode: str = ..., + source: str | ReadableBuffer, + filename: str | ReadableBuffer | os.PathLike[Any] = "", + mode: str = "exec", *, - type_comments: bool = ..., - feature_version: None | int | tuple[int, int] = ..., + type_comments: bool = False, + feature_version: None | int | tuple[int, int] = None, ) -> AST: ... else: @overload - def parse(source: str | bytes, filename: str | bytes = ..., mode: Literal["exec"] = ...) -> Module: ... + def parse( + source: str | ReadableBuffer, + filename: str | ReadableBuffer | os.PathLike[Any] = "", + mode: Literal["exec"] = "exec", + ) -> Module: ... @overload - def parse(source: str | bytes, filename: str | bytes, mode: Literal["eval"]) -> Expression: ... + def parse( + source: str | ReadableBuffer, filename: str | ReadableBuffer | os.PathLike[Any], mode: Literal["eval"] + ) -> Expression: ... @overload - def parse(source: str | bytes, filename: str | bytes, mode: Literal["single"]) -> Interactive: ... + def parse( + source: str | ReadableBuffer, filename: str | ReadableBuffer | os.PathLike[Any], mode: Literal["single"] + ) -> Interactive: ... @overload - def parse(source: str | bytes, *, mode: Literal["eval"]) -> Expression: ... + def parse(source: str | ReadableBuffer, *, mode: Literal["eval"]) -> Expression: ... @overload - def parse(source: str | bytes, *, mode: Literal["single"]) -> Interactive: ... + def parse(source: str | ReadableBuffer, *, mode: Literal["single"]) -> Interactive: ... @overload - def parse(source: str | bytes, filename: str | bytes = ..., mode: str = ...) -> AST: ... + def parse( + source: str | ReadableBuffer, filename: str | ReadableBuffer | os.PathLike[Any] = "", mode: str = "exec" + ) -> AST: ... if sys.version_info >= (3, 9): def unparse(ast_obj: AST) -> str: ... @@ -242,21 +272,21 @@ def copy_location(new_node: _T, old_node: AST) -> _T: ... if sys.version_info >= (3, 9): def dump( - node: AST, annotate_fields: bool = ..., include_attributes: bool = ..., *, indent: int | str | None = ... + node: AST, annotate_fields: bool = True, include_attributes: bool = False, *, indent: int | str | None = None ) -> str: ... else: - def dump(node: AST, annotate_fields: bool = ..., include_attributes: bool = ...) -> str: ... + def dump(node: AST, annotate_fields: bool = True, include_attributes: bool = False) -> str: ... def fix_missing_locations(node: _T) -> _T: ... -def get_docstring(node: AST, clean: bool = ...) -> str | None: ... -def increment_lineno(node: _T, n: int = ...) -> _T: ... +def get_docstring(node: AsyncFunctionDef | FunctionDef | ClassDef | Module, clean: bool = True) -> str | None: ... +def increment_lineno(node: _T, n: int = 1) -> _T: ... def iter_child_nodes(node: AST) -> Iterator[AST]: ... def iter_fields(node: AST) -> Iterator[tuple[str, Any]]: ... def literal_eval(node_or_string: str | AST) -> Any: ... if sys.version_info >= (3, 8): - def get_source_segment(source: str, node: AST, *, padded: bool = ...) -> str | None: ... + def get_source_segment(source: str, node: AST, *, padded: bool = False) -> str | None: ... def walk(node: AST) -> Iterator[AST]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/asynchat.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/asynchat.pyi index 4d43b02c0..79a70d1c1 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/asynchat.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/asynchat.pyi @@ -2,7 +2,7 @@ import asyncore from abc import abstractmethod class simple_producer: - def __init__(self, data: bytes, buffer_size: int = ...) -> None: ... + def __init__(self, data: bytes, buffer_size: int = 512) -> None: ... def more(self) -> bytes: ... class async_chat(asyncore.dispatcher): diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/base_events.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/base_events.pyi index 8697bfe30..3b8f28671 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/base_events.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/base_events.pyi @@ -1,11 +1,11 @@ import ssl import sys -from _typeshed import FileDescriptorLike, WriteableBuffer +from _typeshed import FileDescriptorLike, ReadableBuffer, WriteableBuffer from asyncio.events import AbstractEventLoop, AbstractServer, Handle, TimerHandle, _TaskFactory from asyncio.futures import Future from asyncio.protocols import BaseProtocol from asyncio.tasks import Task -from asyncio.transports import BaseTransport, ReadTransport, SubprocessTransport, WriteTransport +from asyncio.transports import BaseTransport, DatagramTransport, ReadTransport, SubprocessTransport, Transport, WriteTransport from collections.abc import Awaitable, Callable, Coroutine, Generator, Iterable, Sequence from contextvars import Context from socket import AddressFamily, SocketKind, _Address, _RetAddress, socket @@ -34,7 +34,7 @@ class Server(AbstractServer): ssl_context: _SSLContext, backlog: int, ssl_handshake_timeout: float | None, - ssl_shutdown_timeout: float | None = ..., + ssl_shutdown_timeout: float | None = None, ) -> None: ... else: def __init__( @@ -74,42 +74,44 @@ class BaseEventLoop(AbstractEventLoop): def close(self) -> None: ... async def shutdown_asyncgens(self) -> None: ... # Methods scheduling callbacks. All these return Handles. - def call_soon(self, callback: Callable[..., object], *args: Any, context: Context | None = ...) -> Handle: ... + def call_soon(self, callback: Callable[..., object], *args: Any, context: Context | None = None) -> Handle: ... def call_later( - self, delay: float, callback: Callable[..., object], *args: Any, context: Context | None = ... + self, delay: float, callback: Callable[..., object], *args: Any, context: Context | None = None + ) -> TimerHandle: ... + def call_at( + self, when: float, callback: Callable[..., object], *args: Any, context: Context | None = None ) -> TimerHandle: ... - def call_at(self, when: float, callback: Callable[..., object], *args: Any, context: Context | None = ...) -> TimerHandle: ... def time(self) -> float: ... # Future methods def create_future(self) -> Future[Any]: ... # Tasks methods if sys.version_info >= (3, 11): def create_task( - self, coro: Coroutine[Any, Any, _T] | Generator[Any, None, _T], *, name: object = ..., context: Context | None = ... + self, coro: Coroutine[Any, Any, _T] | Generator[Any, None, _T], *, name: object = None, context: Context | None = None ) -> Task[_T]: ... elif sys.version_info >= (3, 8): - def create_task(self, coro: Coroutine[Any, Any, _T] | Generator[Any, None, _T], *, name: object = ...) -> Task[_T]: ... + def create_task(self, coro: Coroutine[Any, Any, _T] | Generator[Any, None, _T], *, name: object = None) -> Task[_T]: ... else: def create_task(self, coro: Coroutine[Any, Any, _T] | Generator[Any, None, _T]) -> Task[_T]: ... def set_task_factory(self, factory: _TaskFactory | None) -> None: ... def get_task_factory(self) -> _TaskFactory | None: ... # Methods for interacting with threads - def call_soon_threadsafe(self, callback: Callable[..., object], *args: Any, context: Context | None = ...) -> Handle: ... + def call_soon_threadsafe(self, callback: Callable[..., object], *args: Any, context: Context | None = None) -> Handle: ... def run_in_executor(self, executor: Any, func: Callable[..., _T], *args: Any) -> Future[_T]: ... def set_default_executor(self, executor: Any) -> None: ... # Network I/O methods returning Futures. async def getaddrinfo( self, host: bytes | str | None, - port: str | int | None, + port: bytes | str | int | None, *, - family: int = ..., - type: int = ..., - proto: int = ..., - flags: int = ..., + family: int = 0, + type: int = 0, + proto: int = 0, + flags: int = 0, ) -> list[tuple[AddressFamily, SocketKind, int, str, tuple[str, int] | tuple[str, int, int, int]]]: ... - async def getnameinfo(self, sockaddr: tuple[str, int] | tuple[str, int, int, int], flags: int = ...) -> tuple[str, str]: ... + async def getnameinfo(self, sockaddr: tuple[str, int] | tuple[str, int, int, int], flags: int = 0) -> tuple[str, str]: ... if sys.version_info >= (3, 11): @overload async def create_connection( @@ -118,37 +120,37 @@ class BaseEventLoop(AbstractEventLoop): host: str = ..., port: int = ..., *, - ssl: _SSLContext = ..., - family: int = ..., - proto: int = ..., - flags: int = ..., - sock: None = ..., - local_addr: tuple[str, int] | None = ..., - server_hostname: str | None = ..., - ssl_handshake_timeout: float | None = ..., - ssl_shutdown_timeout: float | None = ..., - happy_eyeballs_delay: float | None = ..., - interleave: int | None = ..., - ) -> tuple[BaseTransport, _ProtocolT]: ... + ssl: _SSLContext = None, + family: int = 0, + proto: int = 0, + flags: int = 0, + sock: None = None, + local_addr: tuple[str, int] | 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, + ) -> tuple[Transport, _ProtocolT]: ... @overload async def create_connection( self, protocol_factory: Callable[[], _ProtocolT], - host: None = ..., - port: None = ..., + host: None = None, + port: None = None, *, - ssl: _SSLContext = ..., - family: int = ..., - proto: int = ..., - flags: int = ..., + ssl: _SSLContext = None, + family: int = 0, + proto: int = 0, + flags: int = 0, sock: socket, - local_addr: None = ..., - server_hostname: str | None = ..., - ssl_handshake_timeout: float | None = ..., - ssl_shutdown_timeout: float | None = ..., - happy_eyeballs_delay: float | None = ..., - interleave: int | None = ..., - ) -> tuple[BaseTransport, _ProtocolT]: ... + 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, + ) -> tuple[Transport, _ProtocolT]: ... elif sys.version_info >= (3, 8): @overload async def create_connection( @@ -157,35 +159,35 @@ class BaseEventLoop(AbstractEventLoop): host: str = ..., port: int = ..., *, - ssl: _SSLContext = ..., - family: int = ..., - proto: int = ..., - flags: int = ..., - sock: None = ..., - local_addr: tuple[str, int] | None = ..., - server_hostname: str | None = ..., - ssl_handshake_timeout: float | None = ..., - happy_eyeballs_delay: float | None = ..., - interleave: int | None = ..., - ) -> tuple[BaseTransport, _ProtocolT]: ... + ssl: _SSLContext = None, + family: int = 0, + proto: int = 0, + flags: int = 0, + sock: None = None, + local_addr: tuple[str, int] | None = None, + server_hostname: str | None = None, + ssl_handshake_timeout: float | None = None, + happy_eyeballs_delay: float | None = None, + interleave: int | None = None, + ) -> tuple[Transport, _ProtocolT]: ... @overload async def create_connection( self, protocol_factory: Callable[[], _ProtocolT], - host: None = ..., - port: None = ..., + host: None = None, + port: None = None, *, - ssl: _SSLContext = ..., - family: int = ..., - proto: int = ..., - flags: int = ..., + ssl: _SSLContext = None, + family: int = 0, + proto: int = 0, + flags: int = 0, sock: socket, - local_addr: None = ..., - server_hostname: str | None = ..., - ssl_handshake_timeout: float | None = ..., - happy_eyeballs_delay: float | None = ..., - interleave: int | None = ..., - ) -> tuple[BaseTransport, _ProtocolT]: ... + local_addr: None = None, + server_hostname: str | None = None, + ssl_handshake_timeout: float | None = None, + happy_eyeballs_delay: float | None = None, + interleave: int | None = None, + ) -> tuple[Transport, _ProtocolT]: ... else: @overload async def create_connection( @@ -194,67 +196,67 @@ class BaseEventLoop(AbstractEventLoop): host: str = ..., port: int = ..., *, - ssl: _SSLContext = ..., - family: int = ..., - proto: int = ..., - flags: int = ..., - sock: None = ..., - local_addr: tuple[str, int] | None = ..., - server_hostname: str | None = ..., - ssl_handshake_timeout: float | None = ..., - ) -> tuple[BaseTransport, _ProtocolT]: ... + ssl: _SSLContext = None, + family: int = 0, + proto: int = 0, + flags: int = 0, + sock: None = None, + local_addr: tuple[str, int] | None = None, + server_hostname: str | None = None, + ssl_handshake_timeout: float | None = None, + ) -> tuple[Transport, _ProtocolT]: ... @overload async def create_connection( self, protocol_factory: Callable[[], _ProtocolT], - host: None = ..., - port: None = ..., + host: None = None, + port: None = None, *, - ssl: _SSLContext = ..., - family: int = ..., - proto: int = ..., - flags: int = ..., + ssl: _SSLContext = None, + family: int = 0, + proto: int = 0, + flags: int = 0, sock: socket, - local_addr: None = ..., - server_hostname: str | None = ..., - ssl_handshake_timeout: float | None = ..., - ) -> tuple[BaseTransport, _ProtocolT]: ... + local_addr: None = None, + server_hostname: str | None = None, + ssl_handshake_timeout: float | None = None, + ) -> tuple[Transport, _ProtocolT]: ... if sys.version_info >= (3, 11): @overload async def create_server( self, protocol_factory: _ProtocolFactory, - host: str | Sequence[str] | None = ..., + host: str | Sequence[str] | None = None, port: int = ..., *, family: int = ..., flags: int = ..., - sock: None = ..., - backlog: int = ..., - ssl: _SSLContext = ..., - reuse_address: bool | None = ..., - reuse_port: bool | None = ..., - ssl_handshake_timeout: float | None = ..., - ssl_shutdown_timeout: float | None = ..., - start_serving: bool = ..., + sock: None = None, + backlog: int = 100, + ssl: _SSLContext = None, + reuse_address: bool | None = None, + reuse_port: bool | None = None, + ssl_handshake_timeout: float | None = None, + ssl_shutdown_timeout: float | None = None, + start_serving: bool = True, ) -> Server: ... @overload async def create_server( self, protocol_factory: _ProtocolFactory, - host: None = ..., - port: None = ..., + host: None = None, + port: None = None, *, family: int = ..., flags: int = ..., sock: socket = ..., - backlog: int = ..., - ssl: _SSLContext = ..., - reuse_address: bool | None = ..., - reuse_port: bool | None = ..., - ssl_handshake_timeout: float | None = ..., - ssl_shutdown_timeout: float | None = ..., - start_serving: bool = ..., + backlog: int = 100, + ssl: _SSLContext = None, + reuse_address: bool | None = None, + reuse_port: bool | None = None, + ssl_handshake_timeout: float | None = None, + ssl_shutdown_timeout: float | None = None, + start_serving: bool = True, ) -> Server: ... async def start_tls( self, @@ -262,54 +264,54 @@ class BaseEventLoop(AbstractEventLoop): protocol: BaseProtocol, sslcontext: ssl.SSLContext, *, - server_side: bool = ..., - server_hostname: str | None = ..., - ssl_handshake_timeout: float | None = ..., - ssl_shutdown_timeout: float | None = ..., - ) -> BaseTransport: ... + server_side: bool = False, + server_hostname: str | None = None, + ssl_handshake_timeout: float | None = None, + ssl_shutdown_timeout: float | None = None, + ) -> Transport: ... async def connect_accepted_socket( self, protocol_factory: Callable[[], _ProtocolT], sock: socket, *, - ssl: _SSLContext = ..., - ssl_handshake_timeout: float | None = ..., - ssl_shutdown_timeout: float | None = ..., - ) -> tuple[BaseTransport, _ProtocolT]: ... + ssl: _SSLContext = None, + ssl_handshake_timeout: float | None = None, + ssl_shutdown_timeout: float | None = None, + ) -> tuple[Transport, _ProtocolT]: ... else: @overload async def create_server( self, protocol_factory: _ProtocolFactory, - host: str | Sequence[str] | None = ..., + host: str | Sequence[str] | None = None, port: int = ..., *, family: int = ..., flags: int = ..., - sock: None = ..., - backlog: int = ..., - ssl: _SSLContext = ..., - reuse_address: bool | None = ..., - reuse_port: bool | None = ..., - ssl_handshake_timeout: float | None = ..., - start_serving: bool = ..., + sock: None = None, + backlog: int = 100, + ssl: _SSLContext = None, + reuse_address: bool | None = None, + reuse_port: bool | None = None, + ssl_handshake_timeout: float | None = None, + start_serving: bool = True, ) -> Server: ... @overload async def create_server( self, protocol_factory: _ProtocolFactory, - host: None = ..., - port: None = ..., + host: None = None, + port: None = None, *, family: int = ..., flags: int = ..., sock: socket = ..., - backlog: int = ..., - ssl: _SSLContext = ..., - reuse_address: bool | None = ..., - reuse_port: bool | None = ..., - ssl_handshake_timeout: float | None = ..., - start_serving: bool = ..., + backlog: int = 100, + ssl: _SSLContext = None, + reuse_address: bool | None = None, + reuse_port: bool | None = None, + ssl_handshake_timeout: float | None = None, + start_serving: bool = True, ) -> Server: ... async def start_tls( self, @@ -317,54 +319,54 @@ class BaseEventLoop(AbstractEventLoop): protocol: BaseProtocol, sslcontext: ssl.SSLContext, *, - server_side: bool = ..., - server_hostname: str | None = ..., - ssl_handshake_timeout: float | None = ..., - ) -> BaseTransport: ... + server_side: bool = False, + server_hostname: str | None = None, + ssl_handshake_timeout: float | None = None, + ) -> Transport: ... async def connect_accepted_socket( self, protocol_factory: Callable[[], _ProtocolT], sock: socket, *, - ssl: _SSLContext = ..., - ssl_handshake_timeout: float | None = ..., - ) -> tuple[BaseTransport, _ProtocolT]: ... + ssl: _SSLContext = None, + ssl_handshake_timeout: float | None = None, + ) -> tuple[Transport, _ProtocolT]: ... async def sock_sendfile( - self, sock: socket, file: IO[bytes], offset: int = ..., count: int | None = ..., *, fallback: bool | None = ... + self, sock: socket, file: IO[bytes], offset: int = 0, count: int | None = None, *, fallback: bool | None = True ) -> int: ... async def sendfile( - self, transport: BaseTransport, file: IO[bytes], offset: int = ..., count: int | None = ..., *, fallback: bool = ... + self, transport: WriteTransport, file: IO[bytes], offset: int = 0, count: int | None = None, *, fallback: bool = True ) -> int: ... if sys.version_info >= (3, 11): async def create_datagram_endpoint( # type: ignore[override] self, protocol_factory: Callable[[], _ProtocolT], - local_addr: tuple[str, int] | None = ..., - remote_addr: tuple[str, int] | None = ..., + local_addr: tuple[str, int] | str | None = None, + remote_addr: tuple[str, int] | str | None = None, *, - family: int = ..., - proto: int = ..., - flags: int = ..., - reuse_port: bool | None = ..., - allow_broadcast: bool | None = ..., - sock: socket | None = ..., - ) -> tuple[BaseTransport, _ProtocolT]: ... + family: int = 0, + proto: int = 0, + flags: int = 0, + reuse_port: bool | None = None, + allow_broadcast: bool | None = None, + sock: socket | None = None, + ) -> tuple[DatagramTransport, _ProtocolT]: ... else: async def create_datagram_endpoint( self, protocol_factory: Callable[[], _ProtocolT], - local_addr: tuple[str, int] | None = ..., - remote_addr: tuple[str, int] | None = ..., + local_addr: tuple[str, int] | str | None = None, + remote_addr: tuple[str, int] | str | None = None, *, - family: int = ..., - proto: int = ..., - flags: int = ..., + family: int = 0, + proto: int = 0, + flags: int = 0, reuse_address: bool | None = ..., - reuse_port: bool | None = ..., - allow_broadcast: bool | None = ..., - sock: socket | None = ..., - ) -> tuple[BaseTransport, _ProtocolT]: ... + reuse_port: bool | None = None, + allow_broadcast: bool | None = None, + sock: socket | None = None, + ) -> tuple[DatagramTransport, _ProtocolT]: ... # Pipes and subprocesses. async def connect_read_pipe( self, protocol_factory: Callable[[], _ProtocolT], pipe: Any @@ -377,15 +379,15 @@ class BaseEventLoop(AbstractEventLoop): protocol_factory: Callable[[], _ProtocolT], cmd: bytes | str, *, - stdin: int | IO[Any] | None = ..., - stdout: int | IO[Any] | None = ..., - stderr: int | IO[Any] | None = ..., - universal_newlines: Literal[False] = ..., - shell: Literal[True] = ..., - bufsize: Literal[0] = ..., - encoding: None = ..., - errors: None = ..., - text: Literal[False, None] = ..., + stdin: int | IO[Any] | None = -1, + stdout: int | IO[Any] | None = -1, + stderr: int | IO[Any] | None = -1, + universal_newlines: Literal[False] = False, + shell: Literal[True] = True, + bufsize: Literal[0] = 0, + encoding: None = None, + errors: None = None, + text: Literal[False, None] = None, **kwargs: Any, ) -> tuple[SubprocessTransport, _ProtocolT]: ... async def subprocess_exec( @@ -393,14 +395,14 @@ class BaseEventLoop(AbstractEventLoop): protocol_factory: Callable[[], _ProtocolT], program: Any, *args: Any, - stdin: int | IO[Any] | None = ..., - stdout: int | IO[Any] | None = ..., - stderr: int | IO[Any] | None = ..., - universal_newlines: Literal[False] = ..., - shell: Literal[True] = ..., - bufsize: Literal[0] = ..., - encoding: None = ..., - errors: None = ..., + stdin: int | IO[Any] | None = -1, + stdout: int | IO[Any] | None = -1, + stderr: int | IO[Any] | None = -1, + universal_newlines: Literal[False] = False, + shell: Literal[False] = False, + bufsize: Literal[0] = 0, + encoding: None = None, + errors: None = None, **kwargs: Any, ) -> tuple[SubprocessTransport, _ProtocolT]: ... def add_reader(self, fd: FileDescriptorLike, callback: Callable[..., Any], *args: Any) -> None: ... @@ -411,13 +413,13 @@ class BaseEventLoop(AbstractEventLoop): # BaseEventLoop, only on subclasses. We list them here for now for convenience. async def sock_recv(self, sock: socket, nbytes: int) -> bytes: ... async def sock_recv_into(self, sock: socket, buf: WriteableBuffer) -> int: ... - async def sock_sendall(self, sock: socket, data: bytes) -> None: ... + async def sock_sendall(self, sock: socket, data: ReadableBuffer) -> None: ... async def sock_connect(self, sock: socket, address: _Address) -> None: ... async def sock_accept(self, sock: socket) -> tuple[socket, _RetAddress]: ... if sys.version_info >= (3, 11): async def sock_recvfrom(self, sock: socket, bufsize: int) -> bytes: ... - async def sock_recvfrom_into(self, sock: socket, buf: WriteableBuffer, nbytes: int = ...) -> int: ... - async def sock_sendto(self, sock: socket, data: bytes, address: _Address) -> None: ... + async def sock_recvfrom_into(self, sock: socket, buf: WriteableBuffer, nbytes: int = 0) -> int: ... + async def sock_sendto(self, sock: socket, data: ReadableBuffer, address: _Address) -> None: ... # Signal handling. def add_signal_handler(self, sig: int, callback: Callable[..., Any], *args: Any) -> None: ... def remove_signal_handler(self, sig: int) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/base_subprocess.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/base_subprocess.pyi index d3ab16a3e..8f262cd5c 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/base_subprocess.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/base_subprocess.pyi @@ -9,7 +9,6 @@ from . import events, futures, protocols, transports _File: TypeAlias = int | IO[Any] | None class BaseSubprocessTransport(transports.SubprocessTransport): - _closed: bool # undocumented _protocol: protocols.SubprocessProtocol # undocumented _loop: events.AbstractEventLoop # undocumented @@ -30,8 +29,8 @@ class BaseSubprocessTransport(transports.SubprocessTransport): stdout: _File, stderr: _File, bufsize: int, - waiter: futures.Future[Any] | None = ..., - extra: Any | None = ..., + waiter: futures.Future[Any] | None = None, + extra: Any | None = None, **kwargs: Any, ) -> None: ... def _start( @@ -47,7 +46,7 @@ class BaseSubprocessTransport(transports.SubprocessTransport): def get_pid(self) -> int | None: ... # type: ignore[override] def get_pipe_transport(self, fd: int) -> _File: ... # type: ignore[override] def _check_proc(self) -> None: ... # undocumented - def send_signal(self, signal: int) -> None: ... # type: ignore[override] + def send_signal(self, signal: int) -> None: ... async def _connect_pipes(self, waiter: futures.Future[Any] | None) -> None: ... # undocumented def _call(self, cb: Callable[..., object], *data: Any) -> None: ... # undocumented def _pipe_connection_lost(self, fd: int, exc: BaseException | None) -> None: ... # undocumented diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/events.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/events.pyi index 586116136..f97afe873 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/events.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/events.pyi @@ -1,18 +1,18 @@ import ssl import sys -from _typeshed import FileDescriptorLike, Self, StrPath, WriteableBuffer +from _typeshed import FileDescriptorLike, ReadableBuffer, StrPath, Unused, WriteableBuffer from abc import ABCMeta, abstractmethod from collections.abc import Awaitable, Callable, Coroutine, Generator, Sequence from contextvars import Context from socket import AddressFamily, SocketKind, _Address, _RetAddress, socket from typing import IO, Any, Protocol, TypeVar, overload -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal, Self, TypeAlias from .base_events import Server from .futures import Future from .protocols import BaseProtocol from .tasks import Task -from .transports import BaseTransport, ReadTransport, SubprocessTransport, WriteTransport +from .transports import BaseTransport, DatagramTransport, ReadTransport, SubprocessTransport, Transport, WriteTransport from .unix_events import AbstractChildWatcher if sys.version_info >= (3, 8): @@ -70,7 +70,7 @@ class Handle: _cancelled: bool _args: Sequence[Any] def __init__( - self, callback: Callable[..., object], args: Sequence[Any], loop: AbstractEventLoop, context: Context | None = ... + self, callback: Callable[..., object], args: Sequence[Any], loop: AbstractEventLoop, context: Context | None = None ) -> None: ... def cancel(self) -> None: ... def _run(self) -> None: ... @@ -83,7 +83,7 @@ class TimerHandle(Handle): callback: Callable[..., object], args: Sequence[Any], loop: AbstractEventLoop, - context: Context | None = ..., + context: Context | None = None, ) -> None: ... def when(self) -> float: ... def __lt__(self, other: TimerHandle) -> bool: ... @@ -95,8 +95,8 @@ class TimerHandle(Handle): class AbstractServer: @abstractmethod def close(self) -> None: ... - async def __aenter__(self: Self) -> Self: ... - async def __aexit__(self, *exc: object) -> None: ... + async def __aenter__(self) -> Self: ... + async def __aexit__(self, *exc: Unused) -> None: ... @abstractmethod def get_loop(self) -> AbstractEventLoop: ... @abstractmethod @@ -132,14 +132,14 @@ class AbstractEventLoop: # Methods scheduling callbacks. All these return Handles. if sys.version_info >= (3, 9): # "context" added in 3.9.10/3.10.2 @abstractmethod - def call_soon(self, callback: Callable[..., object], *args: Any, context: Context | None = ...) -> Handle: ... + def call_soon(self, callback: Callable[..., object], *args: Any, context: Context | None = None) -> Handle: ... @abstractmethod def call_later( - self, delay: float, callback: Callable[..., object], *args: Any, context: Context | None = ... + self, delay: float, callback: Callable[..., object], *args: Any, context: Context | None = None ) -> TimerHandle: ... @abstractmethod def call_at( - self, when: float, callback: Callable[..., object], *args: Any, context: Context | None = ... + self, when: float, callback: Callable[..., object], *args: Any, context: Context | None = None ) -> TimerHandle: ... else: @abstractmethod @@ -161,13 +161,13 @@ class AbstractEventLoop: self, coro: Coroutine[Any, Any, _T] | Generator[Any, None, _T], *, - name: str | None = ..., - context: Context | None = ..., + name: str | None = None, + context: Context | None = None, ) -> Task[_T]: ... elif sys.version_info >= (3, 8): @abstractmethod def create_task( - self, coro: Coroutine[Any, Any, _T] | Generator[Any, None, _T], *, name: str | None = ... + self, coro: Coroutine[Any, Any, _T] | Generator[Any, None, _T], *, name: str | None = None ) -> Task[_T]: ... else: @abstractmethod @@ -180,7 +180,7 @@ class AbstractEventLoop: # Methods for interacting with threads if sys.version_info >= (3, 9): # "context" added in 3.9.10/3.10.2 @abstractmethod - def call_soon_threadsafe(self, callback: Callable[..., object], *args: Any, context: Context | None = ...) -> Handle: ... + def call_soon_threadsafe(self, callback: Callable[..., object], *args: Any, context: Context | None = None) -> Handle: ... else: @abstractmethod def call_soon_threadsafe(self, callback: Callable[..., object], *args: Any) -> Handle: ... @@ -194,15 +194,15 @@ class AbstractEventLoop: async def getaddrinfo( self, host: bytes | str | None, - port: str | int | None, + port: bytes | str | int | None, *, - family: int = ..., - type: int = ..., - proto: int = ..., - flags: int = ..., + family: int = 0, + type: int = 0, + proto: int = 0, + flags: int = 0, ) -> list[tuple[AddressFamily, SocketKind, int, str, tuple[str, int] | tuple[str, int, int, int]]]: ... @abstractmethod - async def getnameinfo(self, sockaddr: tuple[str, int] | tuple[str, int, int, int], flags: int = ...) -> tuple[str, str]: ... + async def getnameinfo(self, sockaddr: tuple[str, int] | tuple[str, int, int, int], flags: int = 0) -> tuple[str, str]: ... if sys.version_info >= (3, 11): @overload @abstractmethod @@ -212,38 +212,38 @@ class AbstractEventLoop: host: str = ..., port: int = ..., *, - ssl: _SSLContext = ..., - family: int = ..., - proto: int = ..., - flags: int = ..., - sock: None = ..., - local_addr: tuple[str, int] | None = ..., - server_hostname: str | None = ..., - ssl_handshake_timeout: float | None = ..., - ssl_shutdown_timeout: float | None = ..., - happy_eyeballs_delay: float | None = ..., - interleave: int | None = ..., - ) -> tuple[BaseTransport, _ProtocolT]: ... + ssl: _SSLContext = None, + family: int = 0, + proto: int = 0, + flags: int = 0, + sock: None = None, + local_addr: tuple[str, int] | 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, + ) -> tuple[Transport, _ProtocolT]: ... @overload @abstractmethod async def create_connection( self, protocol_factory: Callable[[], _ProtocolT], - host: None = ..., - port: None = ..., + host: None = None, + port: None = None, *, - ssl: _SSLContext = ..., - family: int = ..., - proto: int = ..., - flags: int = ..., + ssl: _SSLContext = None, + family: int = 0, + proto: int = 0, + flags: int = 0, sock: socket, - local_addr: None = ..., - server_hostname: str | None = ..., - ssl_handshake_timeout: float | None = ..., - ssl_shutdown_timeout: float | None = ..., - happy_eyeballs_delay: float | None = ..., - interleave: int | None = ..., - ) -> tuple[BaseTransport, _ProtocolT]: ... + 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, + ) -> tuple[Transport, _ProtocolT]: ... elif sys.version_info >= (3, 8): @overload @abstractmethod @@ -253,36 +253,36 @@ class AbstractEventLoop: host: str = ..., port: int = ..., *, - ssl: _SSLContext = ..., - family: int = ..., - proto: int = ..., - flags: int = ..., - sock: None = ..., - local_addr: tuple[str, int] | None = ..., - server_hostname: str | None = ..., - ssl_handshake_timeout: float | None = ..., - happy_eyeballs_delay: float | None = ..., - interleave: int | None = ..., - ) -> tuple[BaseTransport, _ProtocolT]: ... + ssl: _SSLContext = None, + family: int = 0, + proto: int = 0, + flags: int = 0, + sock: None = None, + local_addr: tuple[str, int] | None = None, + server_hostname: str | None = None, + ssl_handshake_timeout: float | None = None, + happy_eyeballs_delay: float | None = None, + interleave: int | None = None, + ) -> tuple[Transport, _ProtocolT]: ... @overload @abstractmethod async def create_connection( self, protocol_factory: Callable[[], _ProtocolT], - host: None = ..., - port: None = ..., + host: None = None, + port: None = None, *, - ssl: _SSLContext = ..., - family: int = ..., - proto: int = ..., - flags: int = ..., + ssl: _SSLContext = None, + family: int = 0, + proto: int = 0, + flags: int = 0, sock: socket, - local_addr: None = ..., - server_hostname: str | None = ..., - ssl_handshake_timeout: float | None = ..., - happy_eyeballs_delay: float | None = ..., - interleave: int | None = ..., - ) -> tuple[BaseTransport, _ProtocolT]: ... + local_addr: None = None, + server_hostname: str | None = None, + ssl_handshake_timeout: float | None = None, + happy_eyeballs_delay: float | None = None, + interleave: int | None = None, + ) -> tuple[Transport, _ProtocolT]: ... else: @overload @abstractmethod @@ -292,94 +292,94 @@ class AbstractEventLoop: host: str = ..., port: int = ..., *, - ssl: _SSLContext = ..., - family: int = ..., - proto: int = ..., - flags: int = ..., - sock: None = ..., - local_addr: tuple[str, int] | None = ..., - server_hostname: str | None = ..., - ssl_handshake_timeout: float | None = ..., - ) -> tuple[BaseTransport, _ProtocolT]: ... + ssl: _SSLContext = None, + family: int = 0, + proto: int = 0, + flags: int = 0, + sock: None = None, + local_addr: tuple[str, int] | None = None, + server_hostname: str | None = None, + ssl_handshake_timeout: float | None = None, + ) -> tuple[Transport, _ProtocolT]: ... @overload @abstractmethod async def create_connection( self, protocol_factory: Callable[[], _ProtocolT], - host: None = ..., - port: None = ..., + host: None = None, + port: None = None, *, - ssl: _SSLContext = ..., - family: int = ..., - proto: int = ..., - flags: int = ..., + ssl: _SSLContext = None, + family: int = 0, + proto: int = 0, + flags: int = 0, sock: socket, - local_addr: None = ..., - server_hostname: str | None = ..., - ssl_handshake_timeout: float | None = ..., - ) -> tuple[BaseTransport, _ProtocolT]: ... + local_addr: None = None, + server_hostname: str | None = None, + ssl_handshake_timeout: float | None = None, + ) -> tuple[Transport, _ProtocolT]: ... if sys.version_info >= (3, 11): @overload @abstractmethod async def create_server( self, protocol_factory: _ProtocolFactory, - host: str | Sequence[str] | None = ..., + host: str | Sequence[str] | None = None, port: int = ..., *, family: int = ..., flags: int = ..., - sock: None = ..., - backlog: int = ..., - ssl: _SSLContext = ..., - reuse_address: bool | None = ..., - reuse_port: bool | None = ..., - ssl_handshake_timeout: float | None = ..., - ssl_shutdown_timeout: float | None = ..., - start_serving: bool = ..., + sock: None = None, + backlog: int = 100, + ssl: _SSLContext = None, + reuse_address: bool | None = None, + reuse_port: bool | None = None, + ssl_handshake_timeout: float | None = None, + ssl_shutdown_timeout: float | None = None, + start_serving: bool = True, ) -> Server: ... @overload @abstractmethod async def create_server( self, protocol_factory: _ProtocolFactory, - host: None = ..., - port: None = ..., + host: None = None, + port: None = None, *, family: int = ..., flags: int = ..., sock: socket = ..., - backlog: int = ..., - ssl: _SSLContext = ..., - reuse_address: bool | None = ..., - reuse_port: bool | None = ..., - ssl_handshake_timeout: float | None = ..., - ssl_shutdown_timeout: float | None = ..., - start_serving: bool = ..., + backlog: int = 100, + ssl: _SSLContext = None, + reuse_address: bool | None = None, + reuse_port: bool | None = None, + ssl_handshake_timeout: float | None = None, + ssl_shutdown_timeout: float | None = None, + start_serving: bool = True, ) -> Server: ... @abstractmethod async def start_tls( self, - transport: BaseTransport, + transport: WriteTransport, protocol: BaseProtocol, sslcontext: ssl.SSLContext, *, - server_side: bool = ..., - server_hostname: str | None = ..., - ssl_handshake_timeout: float | None = ..., - ssl_shutdown_timeout: float | None = ..., - ) -> BaseTransport: ... + server_side: bool = False, + server_hostname: str | None = None, + ssl_handshake_timeout: float | None = None, + ssl_shutdown_timeout: float | None = None, + ) -> Transport: ... async def create_unix_server( self, protocol_factory: _ProtocolFactory, - path: StrPath | None = ..., + path: StrPath | None = None, *, - sock: socket | None = ..., - backlog: int = ..., - ssl: _SSLContext = ..., - ssl_handshake_timeout: float | None = ..., - ssl_shutdown_timeout: float | None = ..., - start_serving: bool = ..., + sock: socket | None = None, + backlog: int = 100, + ssl: _SSLContext = None, + ssl_handshake_timeout: float | None = None, + ssl_shutdown_timeout: float | None = None, + start_serving: bool = True, ) -> Server: ... else: @overload @@ -387,36 +387,36 @@ class AbstractEventLoop: async def create_server( self, protocol_factory: _ProtocolFactory, - host: str | Sequence[str] | None = ..., + host: str | Sequence[str] | None = None, port: int = ..., *, family: int = ..., flags: int = ..., - sock: None = ..., - backlog: int = ..., - ssl: _SSLContext = ..., - reuse_address: bool | None = ..., - reuse_port: bool | None = ..., - ssl_handshake_timeout: float | None = ..., - start_serving: bool = ..., + sock: None = None, + backlog: int = 100, + ssl: _SSLContext = None, + reuse_address: bool | None = None, + reuse_port: bool | None = None, + ssl_handshake_timeout: float | None = None, + start_serving: bool = True, ) -> Server: ... @overload @abstractmethod async def create_server( self, protocol_factory: _ProtocolFactory, - host: None = ..., - port: None = ..., + host: None = None, + port: None = None, *, family: int = ..., flags: int = ..., sock: socket = ..., - backlog: int = ..., - ssl: _SSLContext = ..., - reuse_address: bool | None = ..., - reuse_port: bool | None = ..., - ssl_handshake_timeout: float | None = ..., - start_serving: bool = ..., + backlog: int = 100, + ssl: _SSLContext = None, + reuse_address: bool | None = None, + reuse_port: bool | None = None, + ssl_handshake_timeout: float | None = None, + start_serving: bool = True, ) -> Server: ... @abstractmethod async def start_tls( @@ -425,20 +425,20 @@ class AbstractEventLoop: protocol: BaseProtocol, sslcontext: ssl.SSLContext, *, - server_side: bool = ..., - server_hostname: str | None = ..., - ssl_handshake_timeout: float | None = ..., - ) -> BaseTransport: ... + server_side: bool = False, + server_hostname: str | None = None, + ssl_handshake_timeout: float | None = None, + ) -> Transport: ... async def create_unix_server( self, protocol_factory: _ProtocolFactory, - path: StrPath | None = ..., + path: StrPath | None = None, *, - sock: socket | None = ..., - backlog: int = ..., - ssl: _SSLContext = ..., - ssl_handshake_timeout: float | None = ..., - start_serving: bool = ..., + sock: socket | None = None, + backlog: int = 100, + ssl: _SSLContext = None, + ssl_handshake_timeout: float | None = None, + start_serving: bool = True, ) -> Server: ... if sys.version_info >= (3, 11): async def connect_accepted_socket( @@ -446,66 +446,66 @@ class AbstractEventLoop: protocol_factory: Callable[[], _ProtocolT], sock: socket, *, - ssl: _SSLContext = ..., - ssl_handshake_timeout: float | None = ..., - ssl_shutdown_timeout: float | None = ..., - ) -> tuple[BaseTransport, _ProtocolT]: ... + ssl: _SSLContext = None, + ssl_handshake_timeout: float | None = None, + ssl_shutdown_timeout: float | None = None, + ) -> tuple[Transport, _ProtocolT]: ... elif sys.version_info >= (3, 10): async def connect_accepted_socket( self, protocol_factory: Callable[[], _ProtocolT], sock: socket, *, - ssl: _SSLContext = ..., - ssl_handshake_timeout: float | None = ..., - ) -> tuple[BaseTransport, _ProtocolT]: ... + ssl: _SSLContext = None, + ssl_handshake_timeout: float | None = None, + ) -> tuple[Transport, _ProtocolT]: ... if sys.version_info >= (3, 11): async def create_unix_connection( self, protocol_factory: Callable[[], _ProtocolT], - path: str | None = ..., + path: str | None = None, *, - ssl: _SSLContext = ..., - sock: socket | None = ..., - server_hostname: str | None = ..., - ssl_handshake_timeout: float | None = ..., - ssl_shutdown_timeout: float | None = ..., - ) -> tuple[BaseTransport, _ProtocolT]: ... + ssl: _SSLContext = None, + sock: socket | None = None, + server_hostname: str | None = None, + ssl_handshake_timeout: float | None = None, + ssl_shutdown_timeout: float | None = None, + ) -> tuple[Transport, _ProtocolT]: ... else: async def create_unix_connection( self, protocol_factory: Callable[[], _ProtocolT], - path: str | None = ..., + path: str | None = None, *, - ssl: _SSLContext = ..., - sock: socket | None = ..., - server_hostname: str | None = ..., - ssl_handshake_timeout: float | None = ..., - ) -> tuple[BaseTransport, _ProtocolT]: ... + ssl: _SSLContext = None, + sock: socket | None = None, + server_hostname: str | None = None, + ssl_handshake_timeout: float | None = None, + ) -> tuple[Transport, _ProtocolT]: ... @abstractmethod async def sock_sendfile( - self, sock: socket, file: IO[bytes], offset: int = ..., count: int | None = ..., *, fallback: bool | None = ... + self, sock: socket, file: IO[bytes], offset: int = 0, count: int | None = None, *, fallback: bool | None = None ) -> int: ... @abstractmethod async def sendfile( - self, transport: BaseTransport, file: IO[bytes], offset: int = ..., count: int | None = ..., *, fallback: bool = ... + self, transport: WriteTransport, file: IO[bytes], offset: int = 0, count: int | None = None, *, fallback: bool = True ) -> int: ... @abstractmethod async def create_datagram_endpoint( self, protocol_factory: Callable[[], _ProtocolT], - local_addr: tuple[str, int] | None = ..., - remote_addr: tuple[str, int] | None = ..., + local_addr: tuple[str, int] | str | None = None, + remote_addr: tuple[str, int] | str | None = None, *, - family: int = ..., - proto: int = ..., - flags: int = ..., - reuse_address: bool | None = ..., - reuse_port: bool | None = ..., - allow_broadcast: bool | None = ..., - sock: socket | None = ..., - ) -> tuple[BaseTransport, _ProtocolT]: ... + family: int = 0, + proto: int = 0, + flags: int = 0, + reuse_address: bool | None = None, + reuse_port: bool | None = None, + allow_broadcast: bool | None = None, + sock: socket | None = None, + ) -> tuple[DatagramTransport, _ProtocolT]: ... # Pipes and subprocesses. @abstractmethod async def connect_read_pipe( @@ -521,14 +521,14 @@ class AbstractEventLoop: protocol_factory: Callable[[], _ProtocolT], cmd: bytes | str, *, - stdin: int | IO[Any] | None = ..., - stdout: int | IO[Any] | None = ..., - stderr: int | IO[Any] | None = ..., - universal_newlines: Literal[False] = ..., - shell: Literal[True] = ..., - bufsize: Literal[0] = ..., - encoding: None = ..., - errors: None = ..., + stdin: int | IO[Any] | None = -1, + stdout: int | IO[Any] | None = -1, + stderr: int | IO[Any] | None = -1, + universal_newlines: Literal[False] = False, + shell: Literal[True] = True, + bufsize: Literal[0] = 0, + encoding: None = None, + errors: None = None, text: Literal[False, None] = ..., **kwargs: Any, ) -> tuple[SubprocessTransport, _ProtocolT]: ... @@ -538,14 +538,14 @@ class AbstractEventLoop: protocol_factory: Callable[[], _ProtocolT], program: Any, *args: Any, - stdin: int | IO[Any] | None = ..., - stdout: int | IO[Any] | None = ..., - stderr: int | IO[Any] | None = ..., - universal_newlines: Literal[False] = ..., - shell: Literal[True] = ..., - bufsize: Literal[0] = ..., - encoding: None = ..., - errors: None = ..., + stdin: int | IO[Any] | None = -1, + stdout: int | IO[Any] | None = -1, + stderr: int | IO[Any] | None = -1, + universal_newlines: Literal[False] = False, + shell: Literal[False] = False, + bufsize: Literal[0] = 0, + encoding: None = None, + errors: None = None, **kwargs: Any, ) -> tuple[SubprocessTransport, _ProtocolT]: ... @abstractmethod @@ -562,7 +562,7 @@ class AbstractEventLoop: @abstractmethod async def sock_recv_into(self, sock: socket, buf: WriteableBuffer) -> int: ... @abstractmethod - async def sock_sendall(self, sock: socket, data: bytes) -> None: ... + async def sock_sendall(self, sock: socket, data: ReadableBuffer) -> None: ... @abstractmethod async def sock_connect(self, sock: socket, address: _Address) -> None: ... @abstractmethod @@ -571,9 +571,9 @@ class AbstractEventLoop: @abstractmethod async def sock_recvfrom(self, sock: socket, bufsize: int) -> bytes: ... @abstractmethod - async def sock_recvfrom_into(self, sock: socket, buf: WriteableBuffer, nbytes: int = ...) -> int: ... + async def sock_recvfrom_into(self, sock: socket, buf: WriteableBuffer, nbytes: int = 0) -> int: ... @abstractmethod - async def sock_sendto(self, sock: socket, data: bytes, address: _Address) -> None: ... + async def sock_sendto(self, sock: socket, data: ReadableBuffer, address: _Address) -> None: ... # Signal handling. @abstractmethod def add_signal_handler(self, sig: int, callback: Callable[..., object], *args: Any) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/format_helpers.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/format_helpers.pyi index 4e2ef8d3f..1c78dff39 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/format_helpers.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/format_helpers.pyi @@ -16,5 +16,5 @@ def _get_function_source(func: _FuncType) -> tuple[str, int]: ... def _get_function_source(func: object) -> tuple[str, int] | None: ... def _format_callback_source(func: object, args: Iterable[Any]) -> str: ... def _format_args_and_kwargs(args: Iterable[Any], kwargs: dict[str, Any]) -> str: ... -def _format_callback(func: object, args: Iterable[Any], kwargs: dict[str, Any], suffix: str = ...) -> str: ... -def extract_stack(f: FrameType | None = ..., limit: int | None = ...) -> traceback.StackSummary: ... +def _format_callback(func: object, args: Iterable[Any], kwargs: dict[str, Any], suffix: str = "") -> str: ... +def extract_stack(f: FrameType | None = None, limit: int | None = None) -> traceback.StackSummary: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/futures.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/futures.pyi index f917bd5de..79209f5ed 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/futures.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/futures.pyi @@ -1,9 +1,8 @@ import sys -from _typeshed import Self from collections.abc import Awaitable, Callable, Generator, Iterable from concurrent.futures._base import Error, Future as _ConcurrentFuture from typing import Any, TypeVar -from typing_extensions import Literal, TypeGuard +from typing_extensions import Literal, Self, TypeGuard from .events import AbstractEventLoop @@ -43,10 +42,10 @@ class Future(Awaitable[_T], Iterable[_T]): def __del__(self) -> None: ... def get_loop(self) -> AbstractEventLoop: ... @property - def _callbacks(self: Self) -> list[tuple[Callable[[Self], Any], Context]]: ... - def add_done_callback(self: Self, __fn: Callable[[Self], object], *, context: Context | None = ...) -> None: ... + def _callbacks(self) -> list[tuple[Callable[[Self], Any], Context]]: ... + def add_done_callback(self, __fn: Callable[[Self], object], *, context: Context | None = None) -> None: ... if sys.version_info >= (3, 9): - def cancel(self, msg: Any | None = ...) -> bool: ... + def cancel(self, msg: Any | None = None) -> bool: ... else: def cancel(self) -> bool: ... @@ -54,7 +53,7 @@ class Future(Awaitable[_T], Iterable[_T]): def done(self) -> bool: ... def result(self) -> _T: ... def exception(self) -> BaseException | None: ... - def remove_done_callback(self: Self, __fn: Callable[[Self], object]) -> int: ... + def remove_done_callback(self, __fn: Callable[[Self], object]) -> int: ... def set_result(self, __result: _T) -> None: ... def set_exception(self, __exception: type | BaseException) -> None: ... def __iter__(self) -> Generator[Any, None, _T]: ... @@ -64,4 +63,4 @@ class Future(Awaitable[_T], Iterable[_T]): if sys.version_info >= (3, 9): def __class_getitem__(cls, item: Any) -> GenericAlias: ... -def wrap_future(future: _ConcurrentFuture[_T] | Future[_T], *, loop: AbstractEventLoop | None = ...) -> Future[_T]: ... +def wrap_future(future: _ConcurrentFuture[_T] | Future[_T], *, loop: AbstractEventLoop | None = None) -> Future[_T]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/locks.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/locks.pyi index a5cdf9aa1..ab4e63ab5 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/locks.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/locks.pyi @@ -1,11 +1,11 @@ import enum import sys -from _typeshed import Self +from _typeshed import Unused from collections import deque from collections.abc import Callable, Generator from types import TracebackType from typing import Any, TypeVar -from typing_extensions import Literal +from typing_extensions import Literal, Self from .events import AbstractEventLoop from .futures import Future @@ -31,7 +31,7 @@ else: class _ContextManager: def __init__(self, lock: Lock | Semaphore) -> None: ... def __enter__(self) -> None: ... - def __exit__(self, *args: object) -> None: ... + def __exit__(self, *args: Unused) -> None: ... class _ContextManagerMixin: # Apparently this exists to *prohibit* use as a context manager. @@ -45,20 +45,20 @@ else: ) -> None: ... class Lock(_ContextManagerMixin): - if sys.version_info >= (3, 11): + if sys.version_info >= (3, 10): def __init__(self) -> None: ... else: - def __init__(self, *, loop: AbstractEventLoop | None = ...) -> None: ... + def __init__(self, *, loop: AbstractEventLoop | None = None) -> None: ... def locked(self) -> bool: ... async def acquire(self) -> Literal[True]: ... def release(self) -> None: ... class Event: - if sys.version_info >= (3, 11): + if sys.version_info >= (3, 10): def __init__(self) -> None: ... else: - def __init__(self, *, loop: AbstractEventLoop | None = ...) -> None: ... + def __init__(self, *, loop: AbstractEventLoop | None = None) -> None: ... def is_set(self) -> bool: ... def set(self) -> None: ... @@ -66,26 +66,26 @@ class Event: async def wait(self) -> Literal[True]: ... class Condition(_ContextManagerMixin): - if sys.version_info >= (3, 11): - def __init__(self, lock: Lock | None = ...) -> None: ... + if sys.version_info >= (3, 10): + def __init__(self, lock: Lock | None = None) -> None: ... else: - def __init__(self, lock: Lock | None = ..., *, loop: AbstractEventLoop | None = ...) -> None: ... + def __init__(self, lock: Lock | None = None, *, loop: AbstractEventLoop | None = None) -> None: ... def locked(self) -> bool: ... async def acquire(self) -> Literal[True]: ... def release(self) -> None: ... async def wait(self) -> Literal[True]: ... async def wait_for(self, predicate: Callable[[], _T]) -> _T: ... - def notify(self, n: int = ...) -> None: ... + def notify(self, n: int = 1) -> None: ... def notify_all(self) -> None: ... class Semaphore(_ContextManagerMixin): _value: int _waiters: deque[Future[Any]] - if sys.version_info >= (3, 11): - def __init__(self, value: int = ...) -> None: ... + if sys.version_info >= (3, 10): + def __init__(self, value: int = 1) -> None: ... else: - def __init__(self, value: int = ..., *, loop: AbstractEventLoop | None = ...) -> None: ... + def __init__(self, value: int = 1, *, loop: AbstractEventLoop | None = None) -> None: ... def locked(self) -> bool: ... async def acquire(self) -> Literal[True]: ... @@ -103,8 +103,8 @@ if sys.version_info >= (3, 11): class Barrier(_LoopBoundMixin): def __init__(self, parties: int) -> None: ... - async def __aenter__(self: Self) -> Self: ... - async def __aexit__(self, *args: object) -> None: ... + async def __aenter__(self) -> Self: ... + async def __aexit__(self, *args: Unused) -> None: ... async def wait(self) -> int: ... async def abort(self) -> None: ... async def reset(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/mixins.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/mixins.pyi index 3e04f2b37..6ebcf543e 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/mixins.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/mixins.pyi @@ -1,9 +1,9 @@ import sys import threading -from typing import NoReturn +from typing_extensions import Never _global_lock: threading.Lock class _LoopBoundMixin: if sys.version_info < (3, 11): - def __init__(self, *, loop: NoReturn = ...) -> None: ... + def __init__(self, *, loop: Never = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/proactor_events.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/proactor_events.pyi index 704939450..33fdf84ad 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/proactor_events.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/proactor_events.pyi @@ -20,9 +20,9 @@ class _ProactorBasePipeTransport(transports._FlowControlMixin, transports.BaseTr loop: events.AbstractEventLoop, sock: socket, protocol: streams.StreamReaderProtocol, - waiter: futures.Future[Any] | None = ..., - extra: Mapping[Any, Any] | None = ..., - server: events.AbstractServer | None = ..., + waiter: futures.Future[Any] | None = None, + extra: Mapping[Any, Any] | None = None, + server: events.AbstractServer | None = None, ) -> None: ... if sys.version_info >= (3, 8): def __del__(self, _warn: _WarnCallbackProtocol = ...) -> None: ... @@ -36,10 +36,10 @@ class _ProactorReadPipeTransport(_ProactorBasePipeTransport, transports.ReadTran loop: events.AbstractEventLoop, sock: socket, protocol: streams.StreamReaderProtocol, - waiter: futures.Future[Any] | None = ..., - extra: Mapping[Any, Any] | None = ..., - server: events.AbstractServer | None = ..., - buffer_size: int = ..., + waiter: futures.Future[Any] | None = None, + extra: Mapping[Any, Any] | None = None, + server: events.AbstractServer | None = None, + buffer_size: int = 65536, ) -> None: ... else: def __init__( @@ -47,9 +47,9 @@ class _ProactorReadPipeTransport(_ProactorBasePipeTransport, transports.ReadTran loop: events.AbstractEventLoop, sock: socket, protocol: streams.StreamReaderProtocol, - waiter: futures.Future[Any] | None = ..., - extra: Mapping[Any, Any] | None = ..., - server: events.AbstractServer | None = ..., + waiter: futures.Future[Any] | None = None, + extra: Mapping[Any, Any] | None = None, + server: events.AbstractServer | None = None, ) -> None: ... class _ProactorBaseWritePipeTransport(_ProactorBasePipeTransport, transports.WriteTransport): ... @@ -57,16 +57,15 @@ class _ProactorWritePipeTransport(_ProactorBaseWritePipeTransport): ... class _ProactorDuplexPipeTransport(_ProactorReadPipeTransport, _ProactorBaseWritePipeTransport, transports.Transport): ... class _ProactorSocketTransport(_ProactorReadPipeTransport, _ProactorBaseWritePipeTransport, transports.Transport): - _sendfile_compatible: ClassVar[constants._SendfileMode] def __init__( self, loop: events.AbstractEventLoop, sock: socket, protocol: streams.StreamReaderProtocol, - waiter: futures.Future[Any] | None = ..., - extra: Mapping[Any, Any] | None = ..., - server: events.AbstractServer | None = ..., + waiter: futures.Future[Any] | None = None, + extra: Mapping[Any, Any] | None = None, + server: events.AbstractServer | None = None, ) -> None: ... def _set_extra(self, sock: socket) -> None: ... def can_write_eof(self) -> Literal[True]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/queues.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/queues.pyi index 90ba39aeb..f56a09524 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/queues.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/queues.pyi @@ -13,10 +13,10 @@ class QueueFull(Exception): ... _T = TypeVar("_T") class Queue(Generic[_T]): - if sys.version_info >= (3, 11): - def __init__(self, maxsize: int = ...) -> None: ... + if sys.version_info >= (3, 10): + def __init__(self, maxsize: int = 0) -> None: ... else: - def __init__(self, maxsize: int = ..., *, loop: AbstractEventLoop | None = ...) -> None: ... + def __init__(self, maxsize: int = 0, *, loop: AbstractEventLoop | None = None) -> None: ... def _init(self, maxsize: int) -> None: ... def _get(self) -> _T: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/runners.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/runners.pyi index 49d236bbe..847072b63 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/runners.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/runners.pyi @@ -1,8 +1,9 @@ import sys -from _typeshed import Self +from _typeshed import Unused from collections.abc import Callable, Coroutine from contextvars import Context from typing import Any, TypeVar +from typing_extensions import Self, final from .events import AbstractEventLoop @@ -13,16 +14,22 @@ else: _T = TypeVar("_T") if sys.version_info >= (3, 11): + @final class Runner: - def __init__(self, *, debug: bool | None = ..., loop_factory: Callable[[], AbstractEventLoop] | None = ...) -> None: ... - def __enter__(self: Self) -> Self: ... - def __exit__(self, exc_type: object, exc_val: object, exc_tb: object) -> None: ... + def __init__(self, *, debug: bool | None = None, loop_factory: Callable[[], AbstractEventLoop] | None = None) -> None: ... + def __enter__(self) -> Self: ... + 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 = ...) -> _T: ... + def run(self, coro: Coroutine[Any, Any, _T], *, context: Context | None = None) -> _T: ... -if sys.version_info >= (3, 8): - def run(main: Coroutine[Any, Any, _T], *, debug: bool | None = ...) -> _T: ... +if sys.version_info >= (3, 12): + def run( + main: Coroutine[Any, Any, _T], *, debug: bool | None = ..., loop_factory: Callable[[], AbstractEventLoop] | None = ... + ) -> _T: ... + +elif sys.version_info >= (3, 8): + def run(main: Coroutine[Any, Any, _T], *, debug: bool | None = None) -> _T: ... else: - def run(main: Coroutine[Any, Any, _T], *, debug: bool = ...) -> _T: ... + def run(main: Coroutine[Any, Any, _T], *, debug: bool = False) -> _T: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/selector_events.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/selector_events.pyi index c5468d4d7..430f2dd40 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/selector_events.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/selector_events.pyi @@ -5,4 +5,4 @@ from . import base_events __all__ = ("BaseSelectorEventLoop",) class BaseSelectorEventLoop(base_events.BaseEventLoop): - def __init__(self, selector: selectors.BaseSelector | None = ...) -> None: ... + def __init__(self, selector: selectors.BaseSelector | None = None) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/sslproto.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/sslproto.pyi index 3bb4db69c..aadc7d32b 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/sslproto.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/sslproto.pyi @@ -35,7 +35,6 @@ else: if sys.version_info < (3, 11): class _SSLPipe: - max_size: ClassVar[int] _context: ssl.SSLContext @@ -48,7 +47,7 @@ if sys.version_info < (3, 11): _need_ssldata: bool _handshake_cb: Callable[[BaseException | None], None] | None _shutdown_cb: Callable[[], None] | None - def __init__(self, context: ssl.SSLContext, server_side: bool, server_hostname: str | None = ...) -> None: ... + def __init__(self, context: ssl.SSLContext, server_side: bool, server_hostname: str | None = None) -> None: ... @property def context(self) -> ssl.SSLContext: ... @property @@ -57,29 +56,28 @@ if sys.version_info < (3, 11): def need_ssldata(self) -> bool: ... @property def wrapped(self) -> bool: ... - def do_handshake(self, callback: Callable[[BaseException | None], object] | None = ...) -> list[bytes]: ... - def shutdown(self, callback: Callable[[], object] | None = ...) -> list[bytes]: ... + def do_handshake(self, callback: Callable[[BaseException | None], object] | None = None) -> list[bytes]: ... + def shutdown(self, callback: Callable[[], object] | None = None) -> list[bytes]: ... def feed_eof(self) -> None: ... - def feed_ssldata(self, data: bytes, only_handshake: bool = ...) -> tuple[list[bytes], list[bytes]]: ... - def feed_appdata(self, data: bytes, offset: int = ...) -> tuple[list[bytes], int]: ... + def feed_ssldata(self, data: bytes, only_handshake: bool = False) -> tuple[list[bytes], list[bytes]]: ... + def feed_appdata(self, data: bytes, offset: int = 0) -> tuple[list[bytes], int]: ... class _SSLProtocolTransport(transports._FlowControlMixin, transports.Transport): - _sendfile_compatible: ClassVar[constants._SendfileMode] _loop: events.AbstractEventLoop _ssl_protocol: SSLProtocol _closed: bool def __init__(self, loop: events.AbstractEventLoop, ssl_protocol: SSLProtocol) -> None: ... - def get_extra_info(self, name: str, default: Any | None = ...) -> dict[str, Any]: ... + def get_extra_info(self, name: str, default: Any | None = None) -> dict[str, Any]: ... @property def _protocol_paused(self) -> bool: ... - def write(self, data: bytes) -> None: ... + def write(self, data: bytes | bytearray | memoryview) -> None: ... def can_write_eof(self) -> Literal[False]: ... if sys.version_info >= (3, 11): def get_write_buffer_limits(self) -> tuple[int, int]: ... def get_read_buffer_limits(self) -> tuple[int, int]: ... - def set_read_buffer_limits(self, high: int | None = ..., low: int | None = ...) -> None: ... + def set_read_buffer_limits(self, high: int | None = None, low: int | None = None) -> None: ... def get_read_buffer_size(self) -> int: ... if sys.version_info >= (3, 11): @@ -118,11 +116,11 @@ class SSLProtocol(_SSLProtocolBase): app_protocol: protocols.BaseProtocol, sslcontext: ssl.SSLContext, waiter: futures.Future[Any], - server_side: bool = ..., - server_hostname: str | None = ..., - call_connection_made: bool = ..., - ssl_handshake_timeout: int | None = ..., - ssl_shutdown_timeout: float | None = ..., + server_side: bool = False, + server_hostname: str | None = None, + call_connection_made: bool = True, + ssl_handshake_timeout: int | None = None, + ssl_shutdown_timeout: float | None = None, ) -> None: ... else: def __init__( @@ -131,17 +129,17 @@ class SSLProtocol(_SSLProtocolBase): app_protocol: protocols.BaseProtocol, sslcontext: ssl.SSLContext, waiter: futures.Future[Any], - server_side: bool = ..., - server_hostname: str | None = ..., - call_connection_made: bool = ..., - ssl_handshake_timeout: int | None = ..., + server_side: bool = False, + server_hostname: str | None = None, + call_connection_made: bool = True, + ssl_handshake_timeout: int | None = None, ) -> None: ... def _set_app_protocol(self, app_protocol: protocols.BaseProtocol) -> None: ... - def _wakeup_waiter(self, exc: BaseException | None = ...) -> None: ... + def _wakeup_waiter(self, exc: BaseException | None = None) -> None: ... def connection_lost(self, exc: BaseException | None) -> None: ... def eof_received(self) -> None: ... - def _get_extra_info(self, name: str, default: Any | None = ...) -> Any: ... + def _get_extra_info(self, name: str, default: Any | None = None) -> Any: ... def _start_shutdown(self) -> None: ... if sys.version_info >= (3, 11): def _write_appdata(self, list_of_data: list[bytes]) -> None: ... @@ -151,7 +149,7 @@ class SSLProtocol(_SSLProtocolBase): def _start_handshake(self) -> None: ... def _check_handshake_timeout(self) -> None: ... def _on_handshake_complete(self, handshake_exc: BaseException | None) -> None: ... - def _fatal_error(self, exc: BaseException, message: str = ...) -> None: ... + def _fatal_error(self, exc: BaseException, message: str = "Fatal error on transport") -> None: ... def _abort(self) -> None: ... if sys.version_info >= (3, 11): def get_buffer(self, n: int) -> memoryview: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/staggered.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/staggered.pyi index 610d6f70b..3324777f4 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/staggered.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/staggered.pyi @@ -6,5 +6,5 @@ from . import events __all__ = ("staggered_race",) async def staggered_race( - coro_fns: Iterable[Callable[[], Awaitable[Any]]], delay: float | None, *, loop: events.AbstractEventLoop | None = ... + coro_fns: Iterable[Callable[[], Awaitable[Any]]], delay: float | None, *, loop: events.AbstractEventLoop | None = None ) -> tuple[Any, int | None, list[Exception | None]]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/streams.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/streams.pyi index 139d86b29..f30c57305 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/streams.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/streams.pyi @@ -1,9 +1,9 @@ import ssl import sys -from _typeshed import Self, StrPath +from _typeshed import StrPath from collections.abc import AsyncIterator, Awaitable, Callable, Iterable, Sequence from typing import Any -from typing_extensions import TypeAlias +from typing_extensions import Self, SupportsIndex, TypeAlias from . import events, protocols, transports from .base_events import Server @@ -59,40 +59,40 @@ if sys.version_info < (3, 8): if sys.version_info >= (3, 10): async def open_connection( - host: str | None = ..., - port: int | str | None = ..., + host: str | None = None, + port: int | str | None = None, *, - limit: int = ..., + limit: int = 65536, ssl_handshake_timeout: float | None = ..., **kwds: Any, ) -> tuple[StreamReader, StreamWriter]: ... async def start_server( client_connected_cb: _ClientConnectedCallback, - host: str | Sequence[str] | None = ..., - port: int | str | None = ..., + host: str | Sequence[str] | None = None, + port: int | str | None = None, *, - limit: int = ..., + limit: int = 65536, ssl_handshake_timeout: float | None = ..., **kwds: Any, ) -> Server: ... else: async def open_connection( - host: str | None = ..., - port: int | str | None = ..., + host: str | None = None, + port: int | str | None = None, *, - loop: events.AbstractEventLoop | None = ..., - limit: int = ..., + loop: events.AbstractEventLoop | None = None, + limit: int = 65536, ssl_handshake_timeout: float | None = ..., **kwds: Any, ) -> tuple[StreamReader, StreamWriter]: ... async def start_server( client_connected_cb: _ClientConnectedCallback, - host: str | None = ..., - port: int | str | None = ..., + host: str | None = None, + port: int | str | None = None, *, - loop: events.AbstractEventLoop | None = ..., - limit: int = ..., + loop: events.AbstractEventLoop | None = None, + limit: int = 65536, ssl_handshake_timeout: float | None = ..., **kwds: Any, ) -> Server: ... @@ -100,33 +100,33 @@ else: if sys.platform != "win32": if sys.version_info >= (3, 10): async def open_unix_connection( - path: StrPath | None = ..., *, limit: int = ..., **kwds: Any + path: StrPath | None = None, *, limit: int = 65536, **kwds: Any ) -> tuple[StreamReader, StreamWriter]: ... async def start_unix_server( - client_connected_cb: _ClientConnectedCallback, path: StrPath | None = ..., *, limit: int = ..., **kwds: Any + client_connected_cb: _ClientConnectedCallback, path: StrPath | None = None, *, limit: int = 65536, **kwds: Any ) -> Server: ... else: async def open_unix_connection( - path: StrPath | None = ..., *, loop: events.AbstractEventLoop | None = ..., limit: int = ..., **kwds: Any + path: StrPath | None = None, *, loop: events.AbstractEventLoop | None = None, limit: int = 65536, **kwds: Any ) -> tuple[StreamReader, StreamWriter]: ... async def start_unix_server( client_connected_cb: _ClientConnectedCallback, - path: StrPath | None = ..., + path: StrPath | None = None, *, - loop: events.AbstractEventLoop | None = ..., - limit: int = ..., + loop: events.AbstractEventLoop | None = None, + limit: int = 65536, **kwds: Any, ) -> Server: ... class FlowControlMixin(protocols.Protocol): - def __init__(self, loop: events.AbstractEventLoop | None = ...) -> None: ... + def __init__(self, loop: events.AbstractEventLoop | None = None) -> None: ... class StreamReaderProtocol(FlowControlMixin, protocols.Protocol): def __init__( self, stream_reader: StreamReader, - client_connected_cb: _ClientConnectedCallback | None = ..., - loop: events.AbstractEventLoop | None = ..., + client_connected_cb: _ClientConnectedCallback | None = None, + loop: events.AbstractEventLoop | None = None, ) -> None: ... class StreamWriter: @@ -139,31 +139,32 @@ class StreamWriter: ) -> None: ... @property def transport(self) -> transports.WriteTransport: ... - def write(self, data: bytes) -> None: ... - def writelines(self, data: Iterable[bytes]) -> None: ... + def write(self, data: bytes | bytearray | memoryview) -> None: ... + def writelines(self, data: Iterable[bytes | bytearray | memoryview]) -> None: ... def write_eof(self) -> None: ... def can_write_eof(self) -> bool: ... def close(self) -> None: ... def is_closing(self) -> bool: ... async def wait_closed(self) -> None: ... - def get_extra_info(self, name: str, default: Any = ...) -> Any: ... + def get_extra_info(self, name: str, default: Any = None) -> Any: ... async def drain(self) -> None: ... if sys.version_info >= (3, 11): async def start_tls( - self, sslcontext: ssl.SSLContext, *, server_hostname: str | None = ..., ssl_handshake_timeout: float | None = ... + self, sslcontext: ssl.SSLContext, *, server_hostname: str | None = None, ssl_handshake_timeout: float | None = None ) -> None: ... class StreamReader(AsyncIterator[bytes]): - def __init__(self, limit: int = ..., loop: events.AbstractEventLoop | None = ...) -> None: ... + def __init__(self, limit: int = 65536, loop: events.AbstractEventLoop | None = None) -> None: ... def exception(self) -> Exception: ... def set_exception(self, exc: Exception) -> None: ... def set_transport(self, transport: transports.BaseTransport) -> None: ... def feed_eof(self) -> None: ... def at_eof(self) -> bool: ... - def feed_data(self, data: bytes) -> None: ... + def feed_data(self, data: Iterable[SupportsIndex]) -> None: ... async def readline(self) -> bytes: ... - async def readuntil(self, separator: bytes = ...) -> bytes: ... - async def read(self, n: int = ...) -> bytes: ... + # Can be any buffer that supports len(); consider changing to a Protocol if PEP 688 is accepted + async def readuntil(self, separator: bytes | bytearray | memoryview = b"\n") -> bytes: ... + async def read(self, n: int = -1) -> bytes: ... async def readexactly(self, n: int) -> bytes: ... - def __aiter__(self: Self) -> Self: ... + def __aiter__(self) -> Self: ... async def __anext__(self) -> bytes: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/subprocess.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/subprocess.pyi index 32fcf1a65..b8877b360 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/subprocess.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/subprocess.pyi @@ -2,7 +2,7 @@ import subprocess import sys from _typeshed import StrOrBytesPath from asyncio import events, protocols, streams, transports -from collections.abc import Callable +from collections.abc import Callable, Collection from typing import IO, Any from typing_extensions import Literal, TypeAlias @@ -38,114 +38,198 @@ class Process: def send_signal(self, signal: int) -> None: ... def terminate(self) -> None: ... def kill(self) -> None: ... - async def communicate(self, input: bytes | None = ...) -> tuple[bytes, bytes]: ... + async def communicate(self, input: bytes | bytearray | memoryview | None = None) -> tuple[bytes, bytes]: ... -if sys.version_info >= (3, 10): +if sys.version_info >= (3, 11): async def create_subprocess_shell( cmd: str | bytes, - stdin: int | IO[Any] | None = ..., - stdout: int | IO[Any] | None = ..., - stderr: int | IO[Any] | None = ..., - limit: int = ..., + stdin: int | IO[Any] | None = None, + stdout: int | IO[Any] | None = None, + stderr: int | IO[Any] | None = None, + limit: int = 65536, *, # These parameters are forced to these values by BaseEventLoop.subprocess_shell - universal_newlines: Literal[False] = ..., - shell: Literal[True] = ..., - bufsize: Literal[0] = ..., - encoding: None = ..., - errors: None = ..., - text: Literal[False, None] = ..., + universal_newlines: Literal[False] = False, + shell: Literal[True] = True, + bufsize: Literal[0] = 0, + encoding: None = None, + errors: None = None, + text: Literal[False, None] = None, # These parameters are taken by subprocess.Popen, which this ultimately delegates to - executable: StrOrBytesPath | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: subprocess._ENV | None = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + executable: StrOrBytesPath | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + cwd: StrOrBytesPath | None = None, + env: subprocess._ENV | None = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., + group: None | str | int = None, + extra_groups: None | Collection[str | int] = None, + user: None | str | int = None, + umask: int = -1, + process_group: int | None = None, + pipesize: int = -1, ) -> Process: ... async def create_subprocess_exec( program: _ExecArg, *args: _ExecArg, - stdin: int | IO[Any] | None = ..., - stdout: int | IO[Any] | None = ..., - stderr: int | IO[Any] | None = ..., - limit: int = ..., + stdin: int | IO[Any] | None = None, + stdout: int | IO[Any] | None = None, + stderr: int | IO[Any] | None = None, + limit: int = 65536, # These parameters are forced to these values by BaseEventLoop.subprocess_shell - universal_newlines: Literal[False] = ..., - shell: Literal[True] = ..., - bufsize: Literal[0] = ..., - encoding: None = ..., - errors: None = ..., + universal_newlines: Literal[False] = False, + shell: Literal[True] = True, + bufsize: Literal[0] = 0, + encoding: None = None, + errors: None = None, # These parameters are taken by subprocess.Popen, which this ultimately delegates to - text: bool | None = ..., - executable: StrOrBytesPath | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: subprocess._ENV | None = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + text: bool | None = None, + executable: StrOrBytesPath | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + cwd: StrOrBytesPath | None = None, + env: subprocess._ENV | None = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., + group: None | str | int = None, + extra_groups: None | Collection[str | int] = None, + user: None | str | int = None, + umask: int = -1, + process_group: int | None = None, + pipesize: int = -1, ) -> Process: ... -else: +elif sys.version_info >= (3, 10): + async def create_subprocess_shell( + cmd: str | bytes, + stdin: int | IO[Any] | None = None, + stdout: int | IO[Any] | None = None, + stderr: int | IO[Any] | None = None, + limit: int = 65536, + *, + # These parameters are forced to these values by BaseEventLoop.subprocess_shell + universal_newlines: Literal[False] = False, + shell: Literal[True] = True, + bufsize: Literal[0] = 0, + encoding: None = None, + errors: None = None, + text: Literal[False, None] = None, + # These parameters are taken by subprocess.Popen, which this ultimately delegates to + executable: StrOrBytesPath | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + cwd: StrOrBytesPath | None = None, + env: subprocess._ENV | None = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., + group: None | str | int = None, + extra_groups: None | Collection[str | int] = None, + user: None | str | int = None, + umask: int = -1, + pipesize: int = -1, + ) -> Process: ... + async def create_subprocess_exec( + program: _ExecArg, + *args: _ExecArg, + stdin: int | IO[Any] | None = None, + stdout: int | IO[Any] | None = None, + stderr: int | IO[Any] | None = None, + limit: int = 65536, + # These parameters are forced to these values by BaseEventLoop.subprocess_shell + universal_newlines: Literal[False] = False, + shell: Literal[True] = True, + bufsize: Literal[0] = 0, + encoding: None = None, + errors: None = None, + # These parameters are taken by subprocess.Popen, which this ultimately delegates to + text: bool | None = None, + executable: StrOrBytesPath | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + cwd: StrOrBytesPath | None = None, + env: subprocess._ENV | None = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., + group: None | str | int = None, + extra_groups: None | Collection[str | int] = None, + user: None | str | int = None, + umask: int = -1, + pipesize: int = -1, + ) -> Process: ... + +else: # >= 3.9 async def create_subprocess_shell( cmd: str | bytes, - stdin: int | IO[Any] | None = ..., - stdout: int | IO[Any] | None = ..., - stderr: int | IO[Any] | None = ..., - loop: events.AbstractEventLoop | None = ..., - limit: int = ..., + stdin: int | IO[Any] | None = None, + stdout: int | IO[Any] | None = None, + stderr: int | IO[Any] | None = None, + loop: events.AbstractEventLoop | None = None, + limit: int = 65536, *, # These parameters are forced to these values by BaseEventLoop.subprocess_shell - universal_newlines: Literal[False] = ..., - shell: Literal[True] = ..., - bufsize: Literal[0] = ..., - encoding: None = ..., - errors: None = ..., - text: Literal[False, None] = ..., + universal_newlines: Literal[False] = False, + shell: Literal[True] = True, + bufsize: Literal[0] = 0, + encoding: None = None, + errors: None = None, + text: Literal[False, None] = None, # These parameters are taken by subprocess.Popen, which this ultimately delegates to - executable: StrOrBytesPath | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: subprocess._ENV | None = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + executable: StrOrBytesPath | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + cwd: StrOrBytesPath | None = None, + env: subprocess._ENV | None = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., + group: None | str | int = None, + extra_groups: None | Collection[str | int] = None, + user: None | str | int = None, + umask: int = -1, ) -> Process: ... async def create_subprocess_exec( program: _ExecArg, *args: _ExecArg, - stdin: int | IO[Any] | None = ..., - stdout: int | IO[Any] | None = ..., - stderr: int | IO[Any] | None = ..., - loop: events.AbstractEventLoop | None = ..., - limit: int = ..., + stdin: int | IO[Any] | None = None, + stdout: int | IO[Any] | None = None, + stderr: int | IO[Any] | None = None, + loop: events.AbstractEventLoop | None = None, + limit: int = 65536, # These parameters are forced to these values by BaseEventLoop.subprocess_shell - universal_newlines: Literal[False] = ..., - shell: Literal[True] = ..., - bufsize: Literal[0] = ..., - encoding: None = ..., - errors: None = ..., + universal_newlines: Literal[False] = False, + shell: Literal[True] = True, + bufsize: Literal[0] = 0, + encoding: None = None, + errors: None = None, # These parameters are taken by subprocess.Popen, which this ultimately delegates to - text: bool | None = ..., - executable: StrOrBytesPath | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: subprocess._ENV | None = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + text: bool | None = None, + executable: StrOrBytesPath | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + cwd: StrOrBytesPath | None = None, + env: subprocess._ENV | None = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., + group: None | str | int = None, + extra_groups: None | Collection[str | int] = None, + user: None | str | int = None, + umask: int = -1, ) -> Process: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/taskgroups.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/taskgroups.pyi index 9b2f15506..8daa96f1e 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/taskgroups.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/taskgroups.pyi @@ -1,10 +1,10 @@ # This only exists in 3.11+. See VERSIONS. -from _typeshed import Self from collections.abc import Coroutine, Generator from contextvars import Context from types import TracebackType from typing import Any, TypeVar +from typing_extensions import Self from .tasks import Task @@ -13,9 +13,8 @@ __all__ = ["TaskGroup"] _T = TypeVar("_T") class TaskGroup: - def __init__(self) -> None: ... - async def __aenter__(self: Self) -> Self: ... + async def __aenter__(self) -> Self: ... async def __aexit__(self, et: type[BaseException] | None, exc: BaseException | None, tb: TracebackType | None) -> None: ... def create_task( - self, coro: Generator[Any, None, _T] | Coroutine[Any, Any, _T], *, name: str | None = ..., context: Context | None = ... + self, coro: Generator[Any, None, _T] | Coroutine[Any, Any, _T], *, name: str | None = None, context: Context | None = None ) -> Task[_T]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/tasks.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/tasks.pyi index 76755f110..308453709 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/tasks.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/tasks.pyi @@ -36,6 +36,7 @@ __all__ = ( ) _T = TypeVar("_T") +_T_co = TypeVar("_T_co", covariant=True) _T1 = TypeVar("_T1") _T2 = TypeVar("_T2") _T3 = TypeVar("_T3") @@ -50,17 +51,17 @@ FIRST_EXCEPTION = concurrent.futures.FIRST_EXCEPTION ALL_COMPLETED = concurrent.futures.ALL_COMPLETED if sys.version_info >= (3, 10): - def as_completed(fs: Iterable[_FutureLike[_T]], *, timeout: float | None = ...) -> Iterator[Future[_T]]: ... + def as_completed(fs: Iterable[_FutureLike[_T]], *, timeout: float | None = None) -> Iterator[Future[_T]]: ... else: def as_completed( - fs: Iterable[_FutureLike[_T]], *, loop: AbstractEventLoop | None = ..., timeout: float | None = ... + fs: Iterable[_FutureLike[_T]], *, loop: AbstractEventLoop | None = None, timeout: float | None = None ) -> Iterator[Future[_T]]: ... @overload -def ensure_future(coro_or_future: _FT, *, loop: AbstractEventLoop | None = ...) -> _FT: ... # type: ignore[misc] +def ensure_future(coro_or_future: _FT, *, loop: AbstractEventLoop | None = None) -> _FT: ... # type: ignore[misc] @overload -def ensure_future(coro_or_future: Awaitable[_T], *, loop: AbstractEventLoop | None = ...) -> Task[_T]: ... +def ensure_future(coro_or_future: Awaitable[_T], *, loop: AbstractEventLoop | None = None) -> Task[_T]: ... # `gather()` actually returns a list with length equal to the number # of tasks passed; however, Tuple is used similar to the annotation for @@ -71,10 +72,10 @@ def ensure_future(coro_or_future: Awaitable[_T], *, loop: AbstractEventLoop | No # but having overlapping overloads is the only way to get acceptable type inference in all edge cases. if sys.version_info >= (3, 10): @overload - def gather(__coro_or_future1: _FutureLike[_T1], *, return_exceptions: Literal[False] = ...) -> Future[tuple[_T1]]: ... # type: ignore[misc] + def gather(__coro_or_future1: _FutureLike[_T1], *, return_exceptions: Literal[False] = False) -> Future[tuple[_T1]]: ... # type: ignore[misc] @overload def gather( # type: ignore[misc] - __coro_or_future1: _FutureLike[_T1], __coro_or_future2: _FutureLike[_T2], *, return_exceptions: Literal[False] = ... + __coro_or_future1: _FutureLike[_T1], __coro_or_future2: _FutureLike[_T2], *, return_exceptions: Literal[False] = False ) -> Future[tuple[_T1, _T2]]: ... @overload def gather( # type: ignore[misc] @@ -82,7 +83,7 @@ if sys.version_info >= (3, 10): __coro_or_future2: _FutureLike[_T2], __coro_or_future3: _FutureLike[_T3], *, - return_exceptions: Literal[False] = ..., + return_exceptions: Literal[False] = False, ) -> Future[tuple[_T1, _T2, _T3]]: ... @overload def gather( # type: ignore[misc] @@ -91,7 +92,7 @@ if sys.version_info >= (3, 10): __coro_or_future3: _FutureLike[_T3], __coro_or_future4: _FutureLike[_T4], *, - return_exceptions: Literal[False] = ..., + return_exceptions: Literal[False] = False, ) -> Future[tuple[_T1, _T2, _T3, _T4]]: ... @overload def gather( # type: ignore[misc] @@ -101,7 +102,7 @@ if sys.version_info >= (3, 10): __coro_or_future4: _FutureLike[_T4], __coro_or_future5: _FutureLike[_T5], *, - return_exceptions: Literal[False] = ..., + return_exceptions: Literal[False] = False, ) -> Future[tuple[_T1, _T2, _T3, _T4, _T5]]: ... @overload def gather(__coro_or_future1: _FutureLike[_T1], *, return_exceptions: bool) -> Future[tuple[_T1 | BaseException]]: ... # type: ignore[misc] @@ -139,20 +140,20 @@ if sys.version_info >= (3, 10): tuple[_T1 | BaseException, _T2 | BaseException, _T3 | BaseException, _T4 | BaseException, _T5 | BaseException] ]: ... @overload - def gather(*coros_or_futures: _FutureLike[Any], return_exceptions: bool = ...) -> Future[list[Any]]: ... # type: ignore[misc] + def gather(*coros_or_futures: _FutureLike[Any], return_exceptions: bool = False) -> Future[list[Any]]: ... else: @overload def gather( # type: ignore[misc] - __coro_or_future1: _FutureLike[_T1], *, loop: AbstractEventLoop | None = ..., return_exceptions: Literal[False] = ... + __coro_or_future1: _FutureLike[_T1], *, loop: AbstractEventLoop | None = None, return_exceptions: Literal[False] = False ) -> Future[tuple[_T1]]: ... @overload def gather( # type: ignore[misc] __coro_or_future1: _FutureLike[_T1], __coro_or_future2: _FutureLike[_T2], *, - loop: AbstractEventLoop | None = ..., - return_exceptions: Literal[False] = ..., + loop: AbstractEventLoop | None = None, + return_exceptions: Literal[False] = False, ) -> Future[tuple[_T1, _T2]]: ... @overload def gather( # type: ignore[misc] @@ -160,8 +161,8 @@ else: __coro_or_future2: _FutureLike[_T2], __coro_or_future3: _FutureLike[_T3], *, - loop: AbstractEventLoop | None = ..., - return_exceptions: Literal[False] = ..., + loop: AbstractEventLoop | None = None, + return_exceptions: Literal[False] = False, ) -> Future[tuple[_T1, _T2, _T3]]: ... @overload def gather( # type: ignore[misc] @@ -170,8 +171,8 @@ else: __coro_or_future3: _FutureLike[_T3], __coro_or_future4: _FutureLike[_T4], *, - loop: AbstractEventLoop | None = ..., - return_exceptions: Literal[False] = ..., + loop: AbstractEventLoop | None = None, + return_exceptions: Literal[False] = False, ) -> Future[tuple[_T1, _T2, _T3, _T4]]: ... @overload def gather( # type: ignore[misc] @@ -181,19 +182,19 @@ else: __coro_or_future4: _FutureLike[_T4], __coro_or_future5: _FutureLike[_T5], *, - loop: AbstractEventLoop | None = ..., - return_exceptions: Literal[False] = ..., + loop: AbstractEventLoop | None = None, + return_exceptions: Literal[False] = False, ) -> Future[tuple[_T1, _T2, _T3, _T4, _T5]]: ... @overload def gather( # type: ignore[misc] - __coro_or_future1: _FutureLike[_T1], *, loop: AbstractEventLoop | None = ..., return_exceptions: bool + __coro_or_future1: _FutureLike[_T1], *, loop: AbstractEventLoop | None = None, return_exceptions: bool ) -> Future[tuple[_T1 | BaseException]]: ... @overload def gather( # type: ignore[misc] __coro_or_future1: _FutureLike[_T1], __coro_or_future2: _FutureLike[_T2], *, - loop: AbstractEventLoop | None = ..., + loop: AbstractEventLoop | None = None, return_exceptions: bool, ) -> Future[tuple[_T1 | BaseException, _T2 | BaseException]]: ... @overload @@ -202,7 +203,7 @@ else: __coro_or_future2: _FutureLike[_T2], __coro_or_future3: _FutureLike[_T3], *, - loop: AbstractEventLoop | None = ..., + loop: AbstractEventLoop | None = None, return_exceptions: bool, ) -> Future[tuple[_T1 | BaseException, _T2 | BaseException, _T3 | BaseException]]: ... @overload @@ -212,7 +213,7 @@ else: __coro_or_future3: _FutureLike[_T3], __coro_or_future4: _FutureLike[_T4], *, - loop: AbstractEventLoop | None = ..., + loop: AbstractEventLoop | None = None, return_exceptions: bool, ) -> Future[tuple[_T1 | BaseException, _T2 | BaseException, _T3 | BaseException, _T4 | BaseException]]: ... @overload @@ -223,14 +224,14 @@ else: __coro_or_future4: _FutureLike[_T4], __coro_or_future5: _FutureLike[_T5], *, - loop: AbstractEventLoop | None = ..., + loop: AbstractEventLoop | None = None, return_exceptions: bool, ) -> Future[ tuple[_T1 | BaseException, _T2 | BaseException, _T3 | BaseException, _T4 | BaseException, _T5 | BaseException] ]: ... @overload - def gather( # type: ignore[misc] - *coros_or_futures: _FutureLike[Any], loop: AbstractEventLoop | None = ..., return_exceptions: bool = ... + def gather( + *coros_or_futures: _FutureLike[Any], loop: AbstractEventLoop | None = None, return_exceptions: bool = False ) -> Future[list[Any]]: ... def run_coroutine_threadsafe(coro: _FutureLike[_T], loop: AbstractEventLoop) -> concurrent.futures.Future[_T]: ... @@ -242,74 +243,86 @@ if sys.version_info >= (3, 10): @overload async def sleep(delay: float, result: _T) -> _T: ... @overload - async def wait(fs: Iterable[_FT], *, timeout: float | None = ..., return_when: str = ...) -> tuple[set[_FT], set[_FT]]: ... # type: ignore[misc] + async def wait(fs: Iterable[_FT], *, timeout: float | None = None, return_when: str = "ALL_COMPLETED") -> tuple[set[_FT], set[_FT]]: ... # type: ignore[misc] @overload async def wait( - fs: Iterable[Awaitable[_T]], *, timeout: float | None = ..., return_when: str = ... + fs: Iterable[Awaitable[_T]], *, timeout: float | None = None, return_when: str = "ALL_COMPLETED" ) -> tuple[set[Task[_T]], set[Task[_T]]]: ... async def wait_for(fut: _FutureLike[_T], timeout: float | None) -> _T: ... else: - def shield(arg: _FutureLike[_T], *, loop: AbstractEventLoop | None = ...) -> Future[_T]: ... + def shield(arg: _FutureLike[_T], *, loop: AbstractEventLoop | None = None) -> Future[_T]: ... @overload - async def sleep(delay: float, *, loop: AbstractEventLoop | None = ...) -> None: ... + async def sleep(delay: float, *, loop: AbstractEventLoop | None = None) -> None: ... @overload - async def sleep(delay: float, result: _T, *, loop: AbstractEventLoop | None = ...) -> _T: ... + async def sleep(delay: float, result: _T, *, loop: AbstractEventLoop | None = None) -> _T: ... @overload async def wait( # type: ignore[misc] - fs: Iterable[_FT], *, loop: AbstractEventLoop | None = ..., timeout: float | None = ..., return_when: str = ... + fs: Iterable[_FT], + *, + loop: AbstractEventLoop | None = None, + timeout: float | None = None, + return_when: str = "ALL_COMPLETED", ) -> tuple[set[_FT], set[_FT]]: ... @overload async def wait( - fs: Iterable[Awaitable[_T]], *, loop: AbstractEventLoop | None = ..., timeout: float | None = ..., return_when: str = ... + fs: Iterable[Awaitable[_T]], + *, + loop: AbstractEventLoop | None = None, + timeout: float | None = None, + return_when: str = "ALL_COMPLETED", ) -> tuple[set[Task[_T]], set[Task[_T]]]: ... - async def wait_for(fut: _FutureLike[_T], timeout: float | None, *, loop: AbstractEventLoop | None = ...) -> _T: ... + async def wait_for(fut: _FutureLike[_T], timeout: float | None, *, loop: AbstractEventLoop | None = None) -> _T: ... -class Task(Future[_T], Generic[_T]): +# mypy and pyright complain that a subclass of an invariant class shouldn't be covariant. +# While this is true in general, here it's sort-of okay to have a covariant subclass, +# since the only reason why `asyncio.Future` is invariant is the `set_result()` method, +# and `asyncio.Task.set_result()` always raises. +class Task(Future[_T_co], Generic[_T_co]): # type: ignore[type-var] # pyright: ignore[reportGeneralTypeIssues] if sys.version_info >= (3, 8): def __init__( self, - coro: Generator[_TaskYieldType, None, _T] | Awaitable[_T], + coro: Generator[_TaskYieldType, None, _T_co] | Awaitable[_T_co], *, loop: AbstractEventLoop = ..., name: str | None = ..., ) -> None: ... else: def __init__( - self, coro: Generator[_TaskYieldType, None, _T] | Awaitable[_T], *, loop: AbstractEventLoop = ... + self, coro: Generator[_TaskYieldType, None, _T_co] | Awaitable[_T_co], *, loop: AbstractEventLoop = ... ) -> None: ... if sys.version_info >= (3, 8): - def get_coro(self) -> Generator[_TaskYieldType, None, _T] | Awaitable[_T]: ... + def get_coro(self) -> Generator[_TaskYieldType, None, _T_co] | Awaitable[_T_co]: ... def get_name(self) -> str: ... def set_name(self, __value: object) -> None: ... - def get_stack(self, *, limit: int | None = ...) -> list[FrameType]: ... - def print_stack(self, *, limit: int | None = ..., file: TextIO | None = ...) -> None: ... + def get_stack(self, *, limit: int | None = None) -> list[FrameType]: ... + def print_stack(self, *, limit: int | None = None, file: TextIO | None = None) -> None: ... if sys.version_info >= (3, 11): def cancelling(self) -> int: ... def uncancel(self) -> int: ... if sys.version_info < (3, 9): @classmethod - def current_task(cls, loop: AbstractEventLoop | None = ...) -> Task[Any] | None: ... + def current_task(cls, loop: AbstractEventLoop | None = None) -> Task[Any] | None: ... @classmethod - def all_tasks(cls, loop: AbstractEventLoop | None = ...) -> set[Task[Any]]: ... + def all_tasks(cls, loop: AbstractEventLoop | None = None) -> set[Task[Any]]: ... if sys.version_info >= (3, 9): def __class_getitem__(cls, item: Any) -> GenericAlias: ... -def all_tasks(loop: AbstractEventLoop | None = ...) -> set[Task[Any]]: ... +def all_tasks(loop: AbstractEventLoop | None = None) -> set[Task[Any]]: ... if sys.version_info >= (3, 11): def create_task( - coro: Generator[Any, None, _T] | Coroutine[Any, Any, _T], *, name: str | None = ..., context: Context | None = ... + coro: Generator[Any, None, _T] | Coroutine[Any, Any, _T], *, name: str | None = None, context: Context | None = None ) -> Task[_T]: ... elif sys.version_info >= (3, 8): - def create_task(coro: Generator[Any, None, _T] | Coroutine[Any, Any, _T], *, name: str | None = ...) -> Task[_T]: ... + def create_task(coro: Generator[Any, None, _T] | Coroutine[Any, Any, _T], *, name: str | None = None) -> Task[_T]: ... else: def create_task(coro: Generator[Any, None, _T] | Coroutine[Any, Any, _T]) -> Task[_T]: ... -def current_task(loop: AbstractEventLoop | None = ...) -> Task[Any] | None: ... +def current_task(loop: AbstractEventLoop | None = None) -> Task[Any] | None: ... def _enter_task(loop: AbstractEventLoop, task: Task[Any]) -> None: ... def _leave_task(loop: AbstractEventLoop, task: Task[Any]) -> None: ... def _register_task(task: Task[Any]) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/timeouts.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/timeouts.pyi index be516b585..2d31b777b 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/timeouts.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/timeouts.pyi @@ -1,6 +1,5 @@ -from _typeshed import Self from types import TracebackType -from typing_extensions import final +from typing_extensions import Self, final __all__ = ("Timeout", "timeout", "timeout_at") @@ -10,7 +9,7 @@ class Timeout: def when(self) -> float | None: ... def reschedule(self, when: float | None) -> None: ... def expired(self) -> bool: ... - async def __aenter__(self: Self) -> Self: ... + async def __aenter__(self) -> Self: ... async def __aexit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/transports.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/transports.pyi index 52937c9bc..531f77672 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/transports.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/transports.pyi @@ -1,14 +1,14 @@ from asyncio.events import AbstractEventLoop from asyncio.protocols import BaseProtocol -from collections.abc import Mapping +from collections.abc import Iterable, Mapping from socket import _Address from typing import Any __all__ = ("BaseTransport", "ReadTransport", "WriteTransport", "Transport", "DatagramTransport", "SubprocessTransport") class BaseTransport: - def __init__(self, extra: Mapping[Any, Any] | None = ...) -> None: ... - def get_extra_info(self, name: Any, default: Any = ...) -> Any: ... + def __init__(self, extra: Mapping[str, Any] | None = None) -> None: ... + def get_extra_info(self, name: str, default: Any = None) -> Any: ... def is_closing(self) -> bool: ... def close(self) -> None: ... def set_protocol(self, protocol: BaseProtocol) -> None: ... @@ -20,11 +20,11 @@ class ReadTransport(BaseTransport): def resume_reading(self) -> None: ... class WriteTransport(BaseTransport): - def set_write_buffer_limits(self, high: int | None = ..., low: int | None = ...) -> None: ... + def set_write_buffer_limits(self, high: int | None = None, low: int | None = None) -> None: ... def get_write_buffer_size(self) -> int: ... def get_write_buffer_limits(self) -> tuple[int, int]: ... - def write(self, data: Any) -> None: ... - def writelines(self, list_of_data: list[Any]) -> None: ... + def write(self, data: bytes | bytearray | memoryview) -> None: ... + def writelines(self, list_of_data: Iterable[bytes | bytearray | memoryview]) -> None: ... def write_eof(self) -> None: ... def can_write_eof(self) -> bool: ... def abort(self) -> None: ... @@ -32,16 +32,16 @@ class WriteTransport(BaseTransport): class Transport(ReadTransport, WriteTransport): ... class DatagramTransport(BaseTransport): - def sendto(self, data: Any, addr: _Address | None = ...) -> None: ... + def sendto(self, data: bytes | bytearray | memoryview, addr: _Address | None = None) -> None: ... def abort(self) -> None: ... class SubprocessTransport(BaseTransport): def get_pid(self) -> int: ... def get_returncode(self) -> int | None: ... def get_pipe_transport(self, fd: int) -> BaseTransport | None: ... - def send_signal(self, signal: int) -> int: ... + def send_signal(self, signal: int) -> None: ... def terminate(self) -> None: ... def kill(self) -> None: ... class _FlowControlMixin(Transport): - def __init__(self, extra: Mapping[Any, Any] | None = ..., loop: AbstractEventLoop | None = ...) -> None: ... + def __init__(self, extra: Mapping[str, Any] | None = None, loop: AbstractEventLoop | None = None) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/trsock.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/trsock.pyi index b8972e43d..742216a84 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/trsock.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/trsock.pyi @@ -1,5 +1,6 @@ import socket import sys +from _typeshed import ReadableBuffer from builtins import type as Type # alias to avoid name clashes with property named "type" from collections.abc import Iterable from types import TracebackType @@ -7,7 +8,7 @@ from typing import Any, BinaryIO, NoReturn, overload from typing_extensions import TypeAlias # These are based in socket, maybe move them out into _typeshed.pyi or such -_Address: TypeAlias = tuple[Any, ...] | str +_Address: TypeAlias = socket._Address _RetAddress: TypeAlias = Any _WriteBuffer: TypeAlias = bytearray | memoryview _CMSG: TypeAlias = tuple[int, int, bytes] @@ -30,7 +31,7 @@ class TransportSocket: @overload def getsockopt(self, level: int, optname: int, buflen: int) -> bytes: ... @overload - def setsockopt(self, level: int, optname: int, value: int | bytes) -> None: ... + def setsockopt(self, level: int, optname: int, value: int | ReadableBuffer) -> None: ... @overload def setsockopt(self, level: int, optname: int, value: None, optlen: int) -> None: ... def getpeername(self) -> _RetAddress: ... @@ -42,9 +43,9 @@ class TransportSocket: if sys.version_info < (3, 11): def _na(self, what: str) -> None: ... def accept(self) -> tuple[socket.socket, _RetAddress]: ... - def connect(self, address: _Address | bytes) -> None: ... - def connect_ex(self, address: _Address | bytes) -> int: ... - def bind(self, address: _Address | bytes) -> None: ... + def connect(self, address: _Address) -> None: ... + def connect_ex(self, address: _Address) -> int: ... + def bind(self, address: _Address) -> None: ... if sys.platform == "win32": def ioctl(self, control: int, option: int | tuple[int, int, int] | bool) -> None: ... else: @@ -57,22 +58,26 @@ class TransportSocket: def detach(self) -> int: ... if sys.platform == "linux": def sendmsg_afalg( - self, msg: Iterable[bytes] = ..., *, op: int, iv: Any = ..., assoclen: int = ..., flags: int = ... + self, msg: Iterable[ReadableBuffer] = ..., *, op: int, iv: Any = ..., assoclen: int = ..., flags: int = ... ) -> int: ... else: def sendmsg_afalg( - self, msg: Iterable[bytes] = ..., *, op: int, iv: Any = ..., assoclen: int = ..., flags: int = ... + self, msg: Iterable[ReadableBuffer] = ..., *, op: int, iv: Any = ..., assoclen: int = ..., flags: int = ... ) -> NoReturn: ... def sendmsg( - self, __buffers: Iterable[bytes], __ancdata: Iterable[_CMSG] = ..., __flags: int = ..., __address: _Address = ... + self, + __buffers: Iterable[ReadableBuffer], + __ancdata: Iterable[_CMSG] = ..., + __flags: int = ..., + __address: _Address = ..., ) -> int: ... @overload - def sendto(self, data: bytes, address: _Address) -> int: ... + def sendto(self, data: ReadableBuffer, address: _Address) -> int: ... @overload - def sendto(self, data: bytes, flags: int, address: _Address) -> int: ... - def send(self, data: bytes, flags: int = ...) -> int: ... - def sendall(self, data: bytes, flags: int = ...) -> None: ... + def sendto(self, data: ReadableBuffer, flags: int, address: _Address) -> int: ... + def send(self, data: ReadableBuffer, flags: int = ...) -> int: ... + def sendall(self, data: ReadableBuffer, flags: int = ...) -> None: ... def set_inheritable(self, inheritable: bool) -> None: ... if sys.platform == "win32": def share(self, process_id: int) -> bytes: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/unix_events.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/unix_events.pyi index f63011a37..e28d64b52 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/unix_events.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/unix_events.pyi @@ -1,10 +1,9 @@ import sys import types -from _typeshed import Self from abc import ABCMeta, abstractmethod from collections.abc import Callable from typing import Any -from typing_extensions import Literal +from typing_extensions import Literal, Self from .events import AbstractEventLoop, BaseDefaultEventLoopPolicy from .selector_events import BaseSelectorEventLoop @@ -22,7 +21,7 @@ class AbstractChildWatcher: @abstractmethod def close(self) -> None: ... @abstractmethod - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... @abstractmethod def __exit__(self, typ: type[BaseException] | None, exc: BaseException | None, tb: types.TracebackType | None) -> None: ... if sys.version_info >= (3, 8): @@ -64,13 +63,13 @@ if sys.platform != "win32": def attach_loop(self, loop: AbstractEventLoop | None) -> None: ... class SafeChildWatcher(BaseChildWatcher): - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__(self, a: type[BaseException] | None, b: BaseException | None, c: types.TracebackType | None) -> None: ... def add_child_handler(self, pid: int, callback: Callable[..., object], *args: Any) -> None: ... def remove_child_handler(self, pid: int) -> bool: ... class FastChildWatcher(BaseChildWatcher): - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__(self, a: type[BaseException] | None, b: BaseException | None, c: types.TracebackType | None) -> None: ... def add_child_handler(self, pid: int, callback: Callable[..., object], *args: Any) -> None: ... def remove_child_handler(self, pid: int) -> bool: ... @@ -85,7 +84,6 @@ if sys.platform != "win32": DefaultEventLoopPolicy = _UnixDefaultEventLoopPolicy if sys.version_info >= (3, 8): - from typing import Protocol class _Warn(Protocol): @@ -96,7 +94,7 @@ if sys.platform != "win32": class MultiLoopChildWatcher(AbstractChildWatcher): def is_active(self) -> bool: ... def close(self) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: types.TracebackType | None ) -> None: ... @@ -107,7 +105,7 @@ if sys.platform != "win32": class ThreadedChildWatcher(AbstractChildWatcher): def is_active(self) -> Literal[True]: ... def close(self) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: types.TracebackType | None ) -> None: ... @@ -118,8 +116,7 @@ if sys.platform != "win32": if sys.version_info >= (3, 9): class PidfdChildWatcher(AbstractChildWatcher): - def __init__(self) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: types.TracebackType | None ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/windows_events.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/windows_events.pyi index ffb487fff..2942a25c0 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/windows_events.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/windows_events.pyi @@ -1,6 +1,6 @@ import socket import sys -from _typeshed import WriteableBuffer +from _typeshed import Incomplete, WriteableBuffer from collections.abc import Callable from typing import IO, Any, ClassVar, NoReturn from typing_extensions import Literal @@ -33,7 +33,7 @@ if sys.platform == "win32": class _WindowsSelectorEventLoop(selector_events.BaseSelectorEventLoop): ... class ProactorEventLoop(proactor_events.BaseProactorEventLoop): - def __init__(self, proactor: IocpProactor | None = ...) -> None: ... + def __init__(self, proactor: IocpProactor | None = None) -> None: ... async def create_pipe_connection( self, protocol_factory: Callable[[], streams.StreamReaderProtocol], address: str ) -> tuple[proactor_events._ProactorDuplexPipeTransport, streams.StreamReaderProtocol]: ... @@ -42,19 +42,23 @@ if sys.platform == "win32": ) -> list[PipeServer]: ... class IocpProactor: - def __init__(self, concurrency: int = ...) -> None: ... + def __init__(self, concurrency: int = 0xFFFFFFFF) -> None: ... def __del__(self) -> None: ... def set_loop(self, loop: events.AbstractEventLoop) -> None: ... - def select(self, timeout: int | None = ...) -> list[futures.Future[Any]]: ... - def recv(self, conn: socket.socket, nbytes: int, flags: int = ...) -> futures.Future[bytes]: ... - def recv_into(self, conn: socket.socket, buf: WriteableBuffer, flags: int = ...) -> futures.Future[Any]: ... - def send(self, conn: socket.socket, buf: WriteableBuffer, flags: int = ...) -> futures.Future[Any]: ... + def select(self, timeout: int | None = None) -> list[futures.Future[Any]]: ... + def recv(self, conn: socket.socket, nbytes: int, flags: int = 0) -> futures.Future[bytes]: ... + def recv_into(self, conn: socket.socket, buf: WriteableBuffer, flags: int = 0) -> futures.Future[Any]: ... + def send(self, conn: socket.socket, buf: WriteableBuffer, flags: int = 0) -> futures.Future[Any]: ... def accept(self, listener: socket.socket) -> futures.Future[Any]: ... - def connect(self, conn: socket.socket, address: bytes) -> futures.Future[Any]: ... + def connect( + self, + conn: socket.socket, + address: tuple[Incomplete, Incomplete] | tuple[Incomplete, Incomplete, Incomplete, Incomplete], + ) -> futures.Future[Any]: ... def sendfile(self, sock: socket.socket, file: IO[bytes], offset: int, count: int) -> futures.Future[Any]: ... def accept_pipe(self, pipe: socket.socket) -> futures.Future[Any]: ... - async def connect_pipe(self, address: bytes) -> windows_utils.PipeHandle: ... - def wait_for_handle(self, handle: windows_utils.PipeHandle, timeout: int | None = ...) -> bool: ... + async def connect_pipe(self, address: str) -> windows_utils.PipeHandle: ... + def wait_for_handle(self, handle: windows_utils.PipeHandle, timeout: int | None = None) -> bool: ... def close(self) -> None: ... SelectorEventLoop = _WindowsSelectorEventLoop diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/windows_utils.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/windows_utils.pyi index 6e170dcb0..f3a82e2b8 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/windows_utils.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/windows_utils.pyi @@ -1,10 +1,9 @@ import subprocess import sys -from _typeshed import Self from collections.abc import Callable from types import TracebackType from typing import Any, AnyStr, Protocol -from typing_extensions import Literal +from typing_extensions import Literal, Self if sys.platform == "win32": __all__ = ("pipe", "Popen", "PIPE", "PipeHandle") @@ -16,7 +15,7 @@ if sys.platform == "win32": BUFSIZE: Literal[8192] PIPE = subprocess.PIPE STDOUT = subprocess.STDOUT - def pipe(*, duplex: bool = ..., overlapped: tuple[bool, bool] = ..., bufsize: int = ...) -> tuple[int, int]: ... + def pipe(*, duplex: bool = False, overlapped: tuple[bool, bool] = ..., bufsize: int = 8192) -> tuple[int, int]: ... class PipeHandle: def __init__(self, handle: int) -> None: ... @@ -25,7 +24,7 @@ if sys.platform == "win32": else: def __del__(self) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__(self, t: type[BaseException] | None, v: BaseException | None, tb: TracebackType | None) -> None: ... @property def handle(self) -> int: ... @@ -41,7 +40,7 @@ if sys.platform == "win32": # subprocess.Popen takes other positional-or-keyword arguments before # stdin. def __new__( - cls: type[Self], + cls, args: subprocess._CMD, stdin: subprocess._FILE | None = ..., stdout: subprocess._FILE | None = ..., @@ -51,8 +50,8 @@ if sys.platform == "win32": def __init__( self, args: subprocess._CMD, - stdin: subprocess._FILE | None = ..., - stdout: subprocess._FILE | None = ..., - stderr: subprocess._FILE | None = ..., + stdin: subprocess._FILE | None = None, + stdout: subprocess._FILE | None = None, + stderr: subprocess._FILE | None = None, **kwds: Any, ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/asyncore.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/asyncore.pyi index 0025ec3f9..47c8e2207 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/asyncore.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/asyncore.pyi @@ -1,5 +1,5 @@ import sys -from _typeshed import FileDescriptorLike +from _typeshed import FileDescriptorLike, ReadableBuffer from socket import socket from typing import Any, overload from typing_extensions import TypeAlias @@ -15,17 +15,16 @@ class ExitNow(Exception): ... def read(obj: Any) -> None: ... def write(obj: Any) -> None: ... def readwrite(obj: Any, flags: int) -> None: ... -def poll(timeout: float = ..., map: _MapType | None = ...) -> None: ... -def poll2(timeout: float = ..., map: _MapType | None = ...) -> None: ... +def poll(timeout: float = 0.0, map: _MapType | None = None) -> None: ... +def poll2(timeout: float = 0.0, map: _MapType | None = None) -> None: ... poll3 = poll2 -def loop(timeout: float = ..., use_poll: bool = ..., map: _MapType | None = ..., count: int | None = ...) -> None: ... +def loop(timeout: float = 30.0, use_poll: bool = False, map: _MapType | None = None, count: int | None = None) -> None: ... # Not really subclass of socket.socket; it's only delegation. # It is not covariant to it. class dispatcher: - debug: bool connected: bool accepting: bool @@ -33,11 +32,11 @@ class dispatcher: closing: bool ignore_log_types: frozenset[str] socket: _Socket | None - def __init__(self, sock: _Socket | None = ..., map: _MapType | None = ...) -> None: ... - def add_channel(self, map: _MapType | None = ...) -> None: ... - def del_channel(self, map: _MapType | None = ...) -> None: ... + def __init__(self, sock: _Socket | None = None, map: _MapType | None = None) -> None: ... + def add_channel(self, map: _MapType | None = None) -> None: ... + def del_channel(self, map: _MapType | None = None) -> None: ... def create_socket(self, family: int = ..., type: int = ...) -> None: ... - def set_socket(self, sock: _Socket, map: _MapType | None = ...) -> None: ... + def set_socket(self, sock: _Socket, map: _MapType | None = None) -> None: ... def set_reuse_addr(self) -> None: ... def readable(self) -> bool: ... def writable(self) -> bool: ... @@ -45,11 +44,11 @@ class dispatcher: def bind(self, addr: tuple[Any, ...] | str) -> None: ... def connect(self, address: tuple[Any, ...] | str) -> None: ... def accept(self) -> tuple[_Socket, Any] | None: ... - def send(self, data: bytes) -> int: ... + def send(self, data: ReadableBuffer) -> int: ... def recv(self, buffer_size: int) -> bytes: ... def close(self) -> None: ... def log(self, message: Any) -> None: ... - def log_info(self, message: Any, type: str = ...) -> None: ... + def log_info(self, message: Any, type: str = "info") -> None: ... def handle_read_event(self) -> None: ... def handle_connect_event(self) -> None: ... def handle_write_event(self) -> None: ... @@ -68,7 +67,7 @@ class dispatcher_with_send(dispatcher): # def send(self, data: bytes) -> int | None: ... def compact_traceback() -> tuple[tuple[str, str, str], type, type, str]: ... -def close_all(map: _MapType | None = ..., ignore_all: bool = ...) -> None: ... +def close_all(map: _MapType | None = None, ignore_all: bool = False) -> None: ... if sys.platform != "win32": class file_wrapper: @@ -77,7 +76,7 @@ if sys.platform != "win32": def recv(self, bufsize: int, flags: int = ...) -> bytes: ... def send(self, data: bytes, flags: int = ...) -> int: ... @overload - def getsockopt(self, level: int, optname: int, buflen: None = ...) -> int: ... + def getsockopt(self, level: int, optname: int, buflen: None = None) -> int: ... @overload def getsockopt(self, level: int, optname: int, buflen: int) -> bytes: ... def read(self, bufsize: int, flags: int = ...) -> bytes: ... @@ -86,5 +85,5 @@ if sys.platform != "win32": def fileno(self) -> int: ... class file_dispatcher(dispatcher): - def __init__(self, fd: FileDescriptorLike, map: _MapType | None = ...) -> None: ... + def __init__(self, fd: FileDescriptorLike, map: _MapType | None = None) -> None: ... def set_file(self, fd: int) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/audioop.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/audioop.pyi index 62b54ced9..b5934516e 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/audioop.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/audioop.pyi @@ -32,8 +32,8 @@ def ratecv( __inrate: int, __outrate: int, __state: _RatecvState | None, - __weightA: int = ..., - __weightB: int = ..., + __weightA: int = 1, + __weightB: int = 0, ) -> tuple[bytes, _RatecvState]: ... def reverse(__fragment: bytes, __width: int) -> bytes: ... def rms(__fragment: bytes, __width: int) -> int: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/base64.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/base64.pyi index c2ec85cac..24830cbfb 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/base64.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/base64.pyi @@ -26,24 +26,28 @@ __all__ = [ if sys.version_info >= (3, 10): __all__ += ["b32hexencode", "b32hexdecode"] -def b64encode(s: ReadableBuffer, altchars: ReadableBuffer | None = ...) -> bytes: ... -def b64decode(s: str | ReadableBuffer, altchars: ReadableBuffer | None = ..., validate: bool = ...) -> bytes: ... +def b64encode(s: ReadableBuffer, altchars: ReadableBuffer | None = None) -> bytes: ... +def b64decode(s: str | ReadableBuffer, altchars: ReadableBuffer | None = None, validate: bool = False) -> bytes: ... def standard_b64encode(s: ReadableBuffer) -> bytes: ... def standard_b64decode(s: str | ReadableBuffer) -> bytes: ... def urlsafe_b64encode(s: ReadableBuffer) -> bytes: ... def urlsafe_b64decode(s: str | ReadableBuffer) -> bytes: ... def b32encode(s: ReadableBuffer) -> bytes: ... -def b32decode(s: str | ReadableBuffer, casefold: bool = ..., map01: bytes | None = ...) -> bytes: ... +def b32decode(s: str | ReadableBuffer, casefold: bool = False, map01: bytes | None = None) -> bytes: ... def b16encode(s: ReadableBuffer) -> bytes: ... -def b16decode(s: str | ReadableBuffer, casefold: bool = ...) -> bytes: ... +def b16decode(s: str | ReadableBuffer, casefold: bool = False) -> bytes: ... if sys.version_info >= (3, 10): def b32hexencode(s: ReadableBuffer) -> bytes: ... - def b32hexdecode(s: str | ReadableBuffer, casefold: bool = ...) -> bytes: ... + def b32hexdecode(s: str | ReadableBuffer, casefold: bool = False) -> bytes: ... -def a85encode(b: ReadableBuffer, *, foldspaces: bool = ..., wrapcol: int = ..., pad: bool = ..., adobe: bool = ...) -> bytes: ... -def a85decode(b: str | ReadableBuffer, *, foldspaces: bool = ..., adobe: bool = ..., ignorechars: str | bytes = ...) -> bytes: ... -def b85encode(b: ReadableBuffer, pad: bool = ...) -> bytes: ... +def a85encode( + b: ReadableBuffer, *, foldspaces: bool = False, wrapcol: int = 0, pad: bool = False, adobe: bool = False +) -> bytes: ... +def a85decode( + b: str | ReadableBuffer, *, foldspaces: bool = False, adobe: bool = False, ignorechars: bytearray | bytes = b" \t\n\r\x0b" +) -> bytes: ... +def b85encode(b: ReadableBuffer, pad: bool = False) -> bytes: ... def b85decode(b: str | ReadableBuffer) -> bytes: ... def decode(input: IO[bytes], output: IO[bytes]) -> None: ... def encode(input: IO[bytes], output: IO[bytes]) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/bdb.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/bdb.pyi index 58808632b..2a1fdddff 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/bdb.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/bdb.pyi @@ -24,7 +24,7 @@ class Bdb: stopframe: FrameType | None returnframe: FrameType | None stoplineno: int - def __init__(self, skip: Iterable[str] | None = ...) -> None: ... + def __init__(self, skip: Iterable[str] | None = None) -> None: ... def canonic(self, filename: str) -> str: ... def reset(self) -> None: ... def trace_dispatch(self, frame: FrameType, event: str, arg: Any) -> TraceFunction: ... @@ -41,15 +41,15 @@ class Bdb: def user_line(self, frame: FrameType) -> None: ... def user_return(self, frame: FrameType, return_value: Any) -> None: ... def user_exception(self, frame: FrameType, exc_info: ExcInfo) -> None: ... - def set_until(self, frame: FrameType, lineno: int | None = ...) -> None: ... + def set_until(self, frame: FrameType, lineno: int | None = None) -> None: ... def set_step(self) -> None: ... def set_next(self, frame: FrameType) -> None: ... def set_return(self, frame: FrameType) -> None: ... - def set_trace(self, frame: FrameType | None = ...) -> None: ... + def set_trace(self, frame: FrameType | None = None) -> None: ... def set_continue(self) -> None: ... def set_quit(self) -> None: ... def set_break( - self, filename: str, lineno: int, temporary: bool = ..., cond: str | None = ..., funcname: str | None = ... + self, filename: str, lineno: int, temporary: bool = False, cond: str | None = None, funcname: str | None = None ) -> None: ... def clear_break(self, filename: str, lineno: int) -> None: ... def clear_bpbynumber(self, arg: SupportsInt) -> None: ... @@ -61,14 +61,15 @@ class Bdb: def get_file_breaks(self, filename: str) -> list[Breakpoint]: ... def get_all_breaks(self) -> list[Breakpoint]: ... def get_stack(self, f: FrameType | None, t: TracebackType | None) -> tuple[list[tuple[FrameType, int]], int]: ... - def format_stack_entry(self, frame_lineno: int, lprefix: str = ...) -> str: ... - def run(self, cmd: str | CodeType, globals: dict[str, Any] | None = ..., locals: Mapping[str, Any] | None = ...) -> None: ... - def runeval(self, expr: str, globals: dict[str, Any] | None = ..., locals: Mapping[str, Any] | None = ...) -> None: ... + def format_stack_entry(self, frame_lineno: int, lprefix: str = ": ") -> str: ... + def run( + self, cmd: str | CodeType, globals: dict[str, Any] | None = None, locals: Mapping[str, Any] | None = None + ) -> None: ... + def runeval(self, expr: str, globals: dict[str, Any] | None = None, locals: Mapping[str, Any] | None = None) -> None: ... def runctx(self, cmd: str | CodeType, globals: dict[str, Any] | None, locals: Mapping[str, Any] | None) -> None: ... def runcall(self, __func: Callable[_P, _T], *args: _P.args, **kwds: _P.kwargs) -> _T | None: ... class Breakpoint: - next: int bplist: dict[tuple[str, int], list[Breakpoint]] bpbynumber: list[Breakpoint | None] @@ -84,7 +85,7 @@ class Breakpoint: hits: int number: int def __init__( - self, file: str, line: int, temporary: bool = ..., cond: str | None = ..., funcname: str | None = ... + self, file: str, line: int, temporary: bool = False, cond: str | None = None, funcname: str | None = None ) -> None: ... if sys.version_info >= (3, 11): @staticmethod @@ -93,7 +94,7 @@ class Breakpoint: def deleteMe(self) -> None: ... def enable(self) -> None: ... def disable(self) -> None: ... - def bpprint(self, out: IO[str] | None = ...) -> None: ... + def bpprint(self, out: IO[str] | None = None) -> None: ... def bpformat(self) -> str: ... def checkfuncname(b: Breakpoint, frame: FrameType) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/binascii.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/binascii.pyi index 6f834f786..759b6c393 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/binascii.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/binascii.pyi @@ -7,17 +7,17 @@ from typing_extensions import TypeAlias _AsciiBuffer: TypeAlias = str | ReadableBuffer def a2b_uu(__data: _AsciiBuffer) -> bytes: ... -def b2a_uu(__data: ReadableBuffer, *, backtick: bool = ...) -> bytes: ... +def b2a_uu(__data: ReadableBuffer, *, backtick: bool = False) -> bytes: ... if sys.version_info >= (3, 11): - def a2b_base64(__data: _AsciiBuffer, *, strict_mode: bool = ...) -> bytes: ... + def a2b_base64(__data: _AsciiBuffer, *, strict_mode: bool = False) -> bytes: ... else: def a2b_base64(__data: _AsciiBuffer) -> bytes: ... -def b2a_base64(__data: ReadableBuffer, *, newline: bool = ...) -> bytes: ... -def a2b_qp(data: _AsciiBuffer, header: bool = ...) -> bytes: ... -def b2a_qp(data: ReadableBuffer, quotetabs: bool = ..., istext: bool = ..., header: bool = ...) -> bytes: ... +def b2a_base64(__data: ReadableBuffer, *, newline: bool = True) -> bytes: ... +def a2b_qp(data: _AsciiBuffer, header: bool = False) -> bytes: ... +def b2a_qp(data: ReadableBuffer, quotetabs: bool = False, istext: bool = True, header: bool = False) -> bytes: ... if sys.version_info < (3, 11): def a2b_hqx(__data: _AsciiBuffer) -> bytes: ... @@ -26,7 +26,7 @@ if sys.version_info < (3, 11): def b2a_hqx(__data: ReadableBuffer) -> bytes: ... def crc_hqx(__data: ReadableBuffer, __crc: int) -> int: ... -def crc32(__data: ReadableBuffer, __crc: int = ...) -> int: ... +def crc32(__data: ReadableBuffer, __crc: int = 0) -> int: ... if sys.version_info >= (3, 8): # sep must be str or bytes, not bytearray or any other buffer diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/binhex.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/binhex.pyi index 27aa379f1..e0993c840 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/binhex.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/binhex.pyi @@ -1,3 +1,4 @@ +from _typeshed import _BufferWithLen from typing import IO, Any from typing_extensions import Literal, TypeAlias @@ -10,7 +11,6 @@ LINELEN: Literal[64] RUNCHAR: Literal[b"\x90"] class FInfo: - def __init__(self) -> None: ... Type: str Creator: str Flags: int @@ -28,9 +28,9 @@ class openrsrc: class BinHex: def __init__(self, name_finfo_dlen_rlen: _FileInfoTuple, ofp: _FileHandleUnion) -> None: ... - def write(self, data: bytes) -> None: ... + def write(self, data: _BufferWithLen) -> None: ... def close_data(self) -> None: ... - def write_rsrc(self, data: bytes) -> None: ... + def write_rsrc(self, data: _BufferWithLen) -> None: ... def close(self) -> None: ... def binhex(inp: str, out: str) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/builtins.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/builtins.pyi index 82907fe7a..2b191734c 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/builtins.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/builtins.pyi @@ -1,17 +1,17 @@ +import _ast +import _typeshed import sys import types -from _ast import AST from _collections_abc import dict_items, dict_keys, dict_values from _typeshed import ( AnyStr_co, + FileDescriptorOrPath, OpenBinaryMode, OpenBinaryModeReading, OpenBinaryModeUpdating, OpenBinaryModeWriting, OpenTextMode, ReadableBuffer, - Self, - StrOrBytesPath, SupportsAdd, SupportsAiter, SupportsAnext, @@ -32,7 +32,7 @@ from io import BufferedRandom, BufferedReader, BufferedWriter, FileIO, TextIOWra from types import CodeType, TracebackType, _Cell # mypy crashes if any of {ByteString, Sequence, MutableSequence, Mapping, MutableMapping} are imported from collections.abc in builtins.pyi -from typing import ( # noqa: Y027 +from typing import ( # noqa: Y022 IO, Any, BinaryIO, @@ -50,11 +50,11 @@ from typing import ( # noqa: Y027 SupportsComplex, SupportsFloat, SupportsInt, - SupportsRound, TypeVar, overload, + type_check_only, ) -from typing_extensions import Literal, LiteralString, SupportsIndex, TypeAlias, TypeGuard, final +from typing_extensions import Concatenate, Literal, LiteralString, ParamSpec, Self, SupportsIndex, TypeAlias, TypeGuard, final if sys.version_info >= (3, 9): from types import GenericAlias @@ -75,6 +75,7 @@ _SupportsNextT = TypeVar("_SupportsNextT", bound=SupportsNext[Any], covariant=Tr _SupportsAnextT = TypeVar("_SupportsAnextT", bound=SupportsAnext[Any], covariant=True) _AwaitableT = TypeVar("_AwaitableT", bound=Awaitable[Any]) _AwaitableT_co = TypeVar("_AwaitableT_co", bound=Awaitable[Any], covariant=True) +_P = ParamSpec("_P") class object: __doc__: str | None @@ -82,18 +83,18 @@ class object: __module__: str __annotations__: dict[str, Any] @property - def __class__(self: Self) -> type[Self]: ... + def __class__(self) -> type[Self]: ... # Ignore errors about type mismatch between property getter and setter @__class__.setter def __class__(self, __type: type[object]) -> None: ... # noqa: F811 def __init__(self) -> None: ... - def __new__(cls: type[Self]) -> Self: ... + def __new__(cls) -> Self: ... # N.B. `object.__setattr__` and `object.__delattr__` are heavily special-cased by type checkers. # Overriding them in subclasses has different semantics, even if the override has an identical signature. def __setattr__(self, __name: str, __value: Any) -> None: ... def __delattr__(self, __name: str) -> None: ... - def __eq__(self, __o: object) -> bool: ... - def __ne__(self, __o: object) -> bool: ... + def __eq__(self, __value: object) -> bool: ... + def __ne__(self, __value: object) -> bool: ... def __str__(self) -> str: ... # noqa: Y029 def __repr__(self) -> str: ... # noqa: Y029 def __hash__(self) -> int: ... @@ -110,33 +111,35 @@ class object: def __dir__(self) -> Iterable[str]: ... def __init_subclass__(cls) -> None: ... + @classmethod + def __subclasshook__(cls, __subclass: type) -> bool: ... -class staticmethod(Generic[_R_co]): +class staticmethod(Generic[_P, _R_co]): @property - def __func__(self) -> Callable[..., _R_co]: ... + def __func__(self) -> Callable[_P, _R_co]: ... @property def __isabstractmethod__(self) -> bool: ... - def __init__(self: staticmethod[_R_co], __f: Callable[..., _R_co]) -> None: ... - def __get__(self, __obj: _T, __type: type[_T] | None = ...) -> Callable[..., _R_co]: ... + def __init__(self, __f: Callable[_P, _R_co]) -> None: ... + def __get__(self, __instance: _T, __owner: type[_T] | None = None) -> Callable[_P, _R_co]: ... if sys.version_info >= (3, 10): __name__: str __qualname__: str @property - def __wrapped__(self) -> Callable[..., _R_co]: ... - def __call__(self, *args: Any, **kwargs: Any) -> _R_co: ... + def __wrapped__(self) -> Callable[_P, _R_co]: ... + def __call__(self, *args: _P.args, **kwargs: _P.kwargs) -> _R_co: ... -class classmethod(Generic[_R_co]): +class classmethod(Generic[_T, _P, _R_co]): @property - def __func__(self) -> Callable[..., _R_co]: ... + def __func__(self) -> Callable[Concatenate[_T, _P], _R_co]: ... @property def __isabstractmethod__(self) -> bool: ... - def __init__(self: classmethod[_R_co], __f: Callable[..., _R_co]) -> None: ... - def __get__(self, __obj: _T, __type: type[_T] | None = ...) -> Callable[..., _R_co]: ... + def __init__(self, __f: Callable[Concatenate[_T, _P], _R_co]) -> None: ... + def __get__(self, __instance: _T, __owner: type[_T] | None = None) -> Callable[_P, _R_co]: ... if sys.version_info >= (3, 10): __name__: str __qualname__: str @property - def __wrapped__(self) -> Callable[..., _R_co]: ... + def __wrapped__(self) -> Callable[Concatenate[_T, _P], _R_co]: ... class type: @property @@ -168,9 +171,11 @@ class type: @overload def __new__(cls, __o: object) -> type: ... @overload - def __new__(cls: type[Self], __name: str, __bases: tuple[type, ...], __namespace: dict[str, Any], **kwds: Any) -> Self: ... + def __new__( + cls: type[_typeshed.Self], __name: str, __bases: tuple[type, ...], __namespace: dict[str, Any], **kwds: Any + ) -> _typeshed.Self: ... def __call__(self, *args: Any, **kwds: Any) -> Any: ... - def __subclasses__(self: Self) -> list[Self]: ... + def __subclasses__(self: _typeshed.Self) -> list[_typeshed.Self]: ... # Note: the documentation doesn't specify what the return type is, the standard # implementation seems to be returning a list. def mro(self) -> list[type]: ... @@ -179,8 +184,8 @@ class type: @classmethod def __prepare__(metacls, __name: str, __bases: tuple[type, ...], **kwds: Any) -> Mapping[str, object]: ... if sys.version_info >= (3, 10): - def __or__(self, __t: Any) -> types.UnionType: ... - def __ror__(self, __t: Any) -> types.UnionType: ... + def __or__(self, __value: Any) -> types.UnionType: ... + def __ror__(self, __value: Any) -> types.UnionType: ... class super: @overload @@ -196,9 +201,9 @@ _LiteralInteger = _PositiveInteger | _NegativeInteger | Literal[0] # noqa: Y026 class int: @overload - def __new__(cls: type[Self], __x: str | ReadableBuffer | SupportsInt | SupportsIndex | SupportsTrunc = ...) -> Self: ... + def __new__(cls, __x: str | ReadableBuffer | SupportsInt | SupportsIndex | SupportsTrunc = ...) -> Self: ... @overload - def __new__(cls: type[Self], __x: str | bytes | bytearray, base: SupportsIndex) -> Self: ... + def __new__(cls, __x: str | bytes | bytearray, base: SupportsIndex) -> Self: ... if sys.version_info >= (3, 8): def as_integer_ratio(self) -> tuple[int, Literal[1]]: ... @@ -217,68 +222,66 @@ class int: if sys.version_info >= (3, 11): def to_bytes( - self, length: SupportsIndex = ..., byteorder: Literal["little", "big"] = ..., *, signed: bool = ... + self, length: SupportsIndex = 1, byteorder: Literal["little", "big"] = "big", *, signed: bool = False ) -> bytes: ... @classmethod def from_bytes( - cls: type[Self], + cls, bytes: Iterable[SupportsIndex] | SupportsBytes | ReadableBuffer, - byteorder: Literal["little", "big"] = ..., + byteorder: Literal["little", "big"] = "big", *, - signed: bool = ..., + signed: bool = False, ) -> Self: ... else: - def to_bytes(self, length: SupportsIndex, byteorder: Literal["little", "big"], *, signed: bool = ...) -> bytes: ... + def to_bytes(self, length: SupportsIndex, byteorder: Literal["little", "big"], *, signed: bool = False) -> bytes: ... @classmethod def from_bytes( - cls: type[Self], + cls, bytes: Iterable[SupportsIndex] | SupportsBytes | ReadableBuffer, byteorder: Literal["little", "big"], *, - signed: bool = ..., + signed: bool = False, ) -> Self: ... - def __add__(self, __x: int) -> int: ... - def __sub__(self, __x: int) -> int: ... - def __mul__(self, __x: int) -> int: ... - def __floordiv__(self, __x: int) -> int: ... - def __truediv__(self, __x: int) -> float: ... - def __mod__(self, __x: int) -> int: ... - def __divmod__(self, __x: int) -> tuple[int, int]: ... - def __radd__(self, __x: int) -> int: ... - def __rsub__(self, __x: int) -> int: ... - def __rmul__(self, __x: int) -> int: ... - def __rfloordiv__(self, __x: int) -> int: ... - def __rtruediv__(self, __x: int) -> float: ... - def __rmod__(self, __x: int) -> int: ... - def __rdivmod__(self, __x: int) -> tuple[int, int]: ... + def __add__(self, __value: int) -> int: ... + def __sub__(self, __value: int) -> int: ... + def __mul__(self, __value: int) -> int: ... + def __floordiv__(self, __value: int) -> int: ... + def __truediv__(self, __value: int) -> float: ... + def __mod__(self, __value: int) -> int: ... + def __divmod__(self, __value: int) -> tuple[int, int]: ... + def __radd__(self, __value: int) -> int: ... + def __rsub__(self, __value: int) -> int: ... + def __rmul__(self, __value: int) -> int: ... + def __rfloordiv__(self, __value: int) -> int: ... + def __rtruediv__(self, __value: int) -> float: ... + def __rmod__(self, __value: int) -> int: ... + def __rdivmod__(self, __value: int) -> tuple[int, int]: ... @overload def __pow__(self, __x: Literal[0]) -> Literal[1]: ... @overload - def __pow__(self, __x: Literal[0], __modulo: None) -> Literal[1]: ... + def __pow__(self, __value: Literal[0], __mod: None) -> Literal[1]: ... @overload - def __pow__(self, __x: _PositiveInteger, __modulo: None = ...) -> int: ... + def __pow__(self, __value: _PositiveInteger, __mod: None = None) -> int: ... @overload - def __pow__(self, __x: _NegativeInteger, __modulo: None = ...) -> float: ... + def __pow__(self, __value: _NegativeInteger, __mod: None = None) -> float: ... # positive x -> int; negative x -> float # return type must be Any as `int | float` causes too many false-positive errors @overload - def __pow__(self, __x: int, __modulo: None = ...) -> Any: ... - @overload - def __pow__(self, __x: int, __modulo: Literal[0]) -> NoReturn: ... - @overload - def __pow__(self, __x: int, __modulo: int) -> int: ... - def __rpow__(self, __x: int, __mod: int | None = ...) -> Any: ... - def __and__(self, __n: int) -> int: ... - def __or__(self, __n: int) -> int: ... - def __xor__(self, __n: int) -> int: ... - def __lshift__(self, __n: int) -> int: ... - def __rshift__(self, __n: int) -> int: ... - def __rand__(self, __n: int) -> int: ... - def __ror__(self, __n: int) -> int: ... - def __rxor__(self, __n: int) -> int: ... - def __rlshift__(self, __n: int) -> int: ... - def __rrshift__(self, __n: int) -> int: ... + def __pow__(self, __value: int, __mod: None = None) -> Any: ... + @overload + def __pow__(self, __value: int, __mod: int) -> int: ... + def __rpow__(self, __value: int, __mod: int | None = None) -> Any: ... + def __and__(self, __value: int) -> int: ... + def __or__(self, __value: int) -> int: ... + def __xor__(self, __value: int) -> int: ... + def __lshift__(self, __value: int) -> int: ... + def __rshift__(self, __value: int) -> int: ... + def __rand__(self, __value: int) -> int: ... + def __ror__(self, __value: int) -> int: ... + def __rxor__(self, __value: int) -> int: ... + def __rlshift__(self, __value: int) -> int: ... + def __rrshift__(self, __value: int) -> int: ... def __neg__(self) -> int: ... def __pos__(self) -> int: ... def __invert__(self) -> int: ... @@ -287,12 +290,12 @@ class int: def __floor__(self) -> int: ... def __round__(self, __ndigits: SupportsIndex = ...) -> int: ... def __getnewargs__(self) -> tuple[int]: ... - def __eq__(self, __x: object) -> bool: ... - def __ne__(self, __x: object) -> bool: ... - def __lt__(self, __x: int) -> bool: ... - def __le__(self, __x: int) -> bool: ... - def __gt__(self, __x: int) -> bool: ... - def __ge__(self, __x: int) -> bool: ... + def __eq__(self, __value: object) -> bool: ... + def __ne__(self, __value: object) -> bool: ... + def __lt__(self, __value: int) -> bool: ... + def __le__(self, __value: int) -> bool: ... + def __gt__(self, __value: int) -> bool: ... + def __ge__(self, __value: int) -> bool: ... def __float__(self) -> float: ... def __int__(self) -> int: ... def __abs__(self) -> int: ... @@ -300,44 +303,44 @@ class int: def __index__(self) -> int: ... class float: - def __new__(cls: type[Self], x: SupportsFloat | SupportsIndex | str | ReadableBuffer = ...) -> Self: ... + def __new__(cls, __x: SupportsFloat | SupportsIndex | str | ReadableBuffer = ...) -> Self: ... def as_integer_ratio(self) -> tuple[int, int]: ... def hex(self) -> str: ... def is_integer(self) -> bool: ... @classmethod - def fromhex(cls: type[Self], __s: str) -> Self: ... + def fromhex(cls, __string: str) -> Self: ... @property def real(self) -> float: ... @property def imag(self) -> float: ... def conjugate(self) -> float: ... - def __add__(self, __x: float) -> float: ... - def __sub__(self, __x: float) -> float: ... - def __mul__(self, __x: float) -> float: ... - def __floordiv__(self, __x: float) -> float: ... - def __truediv__(self, __x: float) -> float: ... - def __mod__(self, __x: float) -> float: ... - def __divmod__(self, __x: float) -> tuple[float, float]: ... - @overload - def __pow__(self, __x: int, __mod: None = ...) -> float: ... + def __add__(self, __value: float) -> float: ... + def __sub__(self, __value: float) -> float: ... + def __mul__(self, __value: float) -> float: ... + def __floordiv__(self, __value: float) -> float: ... + def __truediv__(self, __value: float) -> float: ... + def __mod__(self, __value: float) -> float: ... + def __divmod__(self, __value: float) -> tuple[float, float]: ... + @overload + def __pow__(self, __value: int, __mod: None = None) -> float: ... # positive x -> float; negative x -> complex # return type must be Any as `float | complex` causes too many false-positive errors @overload - def __pow__(self, __x: float, __mod: None = ...) -> Any: ... - def __radd__(self, __x: float) -> float: ... - def __rsub__(self, __x: float) -> float: ... - def __rmul__(self, __x: float) -> float: ... - def __rfloordiv__(self, __x: float) -> float: ... - def __rtruediv__(self, __x: float) -> float: ... - def __rmod__(self, __x: float) -> float: ... - def __rdivmod__(self, __x: float) -> tuple[float, float]: ... + def __pow__(self, __value: float, __mod: None = None) -> Any: ... + def __radd__(self, __value: float) -> float: ... + def __rsub__(self, __value: float) -> float: ... + def __rmul__(self, __value: float) -> float: ... + def __rfloordiv__(self, __value: float) -> float: ... + def __rtruediv__(self, __value: float) -> float: ... + def __rmod__(self, __value: float) -> float: ... + def __rdivmod__(self, __value: float) -> tuple[float, float]: ... @overload - def __rpow__(self, __x: _PositiveInteger, __modulo: None = ...) -> float: ... + def __rpow__(self, __value: _PositiveInteger, __mod: None = None) -> float: ... @overload - def __rpow__(self, __x: _NegativeInteger, __mod: None = ...) -> complex: ... + def __rpow__(self, __value: _NegativeInteger, __mod: None = None) -> complex: ... # Returning `complex` for the general case gives too many false-positive errors. @overload - def __rpow__(self, __x: float, __mod: None = ...) -> Any: ... + def __rpow__(self, __value: float, __mod: None = None) -> Any: ... def __getnewargs__(self) -> tuple[float]: ... def __trunc__(self) -> int: ... if sys.version_info >= (3, 9): @@ -345,15 +348,15 @@ class float: def __floor__(self) -> int: ... @overload - def __round__(self, __ndigits: None = ...) -> int: ... + def __round__(self, __ndigits: None = None) -> int: ... @overload def __round__(self, __ndigits: SupportsIndex) -> float: ... - def __eq__(self, __x: object) -> bool: ... - def __ne__(self, __x: object) -> bool: ... - def __lt__(self, __x: float) -> bool: ... - def __le__(self, __x: float) -> bool: ... - def __gt__(self, __x: float) -> bool: ... - def __ge__(self, __x: float) -> bool: ... + def __eq__(self, __value: object) -> bool: ... + def __ne__(self, __value: object) -> bool: ... + def __lt__(self, __value: float) -> bool: ... + def __le__(self, __value: float) -> bool: ... + def __gt__(self, __value: float) -> bool: ... + def __ge__(self, __value: float) -> bool: ... def __neg__(self) -> float: ... def __pos__(self) -> float: ... def __int__(self) -> int: ... @@ -366,37 +369,35 @@ class complex: # Python doesn't currently accept SupportsComplex for the second argument @overload def __new__( - cls: type[Self], + cls, real: complex | SupportsComplex | SupportsFloat | SupportsIndex = ..., imag: complex | SupportsFloat | SupportsIndex = ..., ) -> Self: ... @overload - def __new__(cls: type[Self], real: str | SupportsComplex | SupportsFloat | SupportsIndex | complex) -> Self: ... + def __new__(cls, real: str | SupportsComplex | SupportsFloat | SupportsIndex | complex) -> Self: ... else: @overload - def __new__( - cls: type[Self], real: complex | SupportsComplex | SupportsFloat = ..., imag: complex | SupportsFloat = ... - ) -> Self: ... + def __new__(cls, real: complex | SupportsComplex | SupportsFloat = ..., imag: complex | SupportsFloat = ...) -> Self: ... @overload - def __new__(cls: type[Self], real: str | SupportsComplex | SupportsFloat | complex) -> Self: ... + def __new__(cls, real: str | SupportsComplex | SupportsFloat | complex) -> Self: ... @property def real(self) -> float: ... @property def imag(self) -> float: ... def conjugate(self) -> complex: ... - def __add__(self, __x: complex) -> complex: ... - def __sub__(self, __x: complex) -> complex: ... - def __mul__(self, __x: complex) -> complex: ... - def __pow__(self, __x: complex, __mod: None = ...) -> complex: ... - def __truediv__(self, __x: complex) -> complex: ... - def __radd__(self, __x: complex) -> complex: ... - def __rsub__(self, __x: complex) -> complex: ... - def __rmul__(self, __x: complex) -> complex: ... - def __rpow__(self, __x: complex, __mod: None = ...) -> complex: ... - def __rtruediv__(self, __x: complex) -> complex: ... - def __eq__(self, __x: object) -> bool: ... - def __ne__(self, __x: object) -> bool: ... + def __add__(self, __value: complex) -> complex: ... + def __sub__(self, __value: complex) -> complex: ... + def __mul__(self, __value: complex) -> complex: ... + def __pow__(self, __value: complex, __mod: None = None) -> complex: ... + def __truediv__(self, __value: complex) -> complex: ... + def __radd__(self, __value: complex) -> complex: ... + def __rsub__(self, __value: complex) -> complex: ... + def __rmul__(self, __value: complex) -> complex: ... + def __rpow__(self, __value: complex, __mod: None = None) -> complex: ... + def __rtruediv__(self, __value: complex) -> complex: ... + def __eq__(self, __value: object) -> bool: ... + def __ne__(self, __value: object) -> bool: ... def __neg__(self) -> complex: ... def __pos__(self) -> complex: ... def __abs__(self) -> float: ... @@ -407,11 +408,14 @@ class complex: class _FormatMapMapping(Protocol): def __getitem__(self, __key: str) -> Any: ... +class _TranslateTable(Protocol): + def __getitem__(self, __key: int) -> str | int | None: ... + class str(Sequence[str]): @overload - def __new__(cls: type[Self], object: object = ...) -> Self: ... + def __new__(cls, object: object = ...) -> Self: ... @overload - def __new__(cls: type[Self], object: ReadableBuffer, encoding: str = ..., errors: str = ...) -> Self: ... + def __new__(cls, object: ReadableBuffer, encoding: str = ..., errors: str = ...) -> Self: ... @overload def capitalize(self: LiteralString) -> LiteralString: ... @overload @@ -421,30 +425,30 @@ class str(Sequence[str]): @overload def casefold(self) -> str: ... # type: ignore[misc] @overload - def center(self: LiteralString, __width: SupportsIndex, __fillchar: LiteralString = ...) -> LiteralString: ... + def center(self: LiteralString, __width: SupportsIndex, __fillchar: LiteralString = " ") -> LiteralString: ... @overload - def center(self, __width: SupportsIndex, __fillchar: str = ...) -> str: ... # type: ignore[misc] + def center(self, __width: SupportsIndex, __fillchar: str = " ") -> str: ... # type: ignore[misc] def count(self, x: str, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...) -> int: ... - def encode(self, encoding: str = ..., errors: str = ...) -> bytes: ... + def encode(self, encoding: str = "utf-8", errors: str = "strict") -> bytes: ... def endswith( self, __suffix: str | tuple[str, ...], __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ... ) -> bool: ... if sys.version_info >= (3, 8): @overload - def expandtabs(self: LiteralString, tabsize: SupportsIndex = ...) -> LiteralString: ... + def expandtabs(self: LiteralString, tabsize: SupportsIndex = 8) -> LiteralString: ... @overload - def expandtabs(self, tabsize: SupportsIndex = ...) -> str: ... # type: ignore[misc] + def expandtabs(self, tabsize: SupportsIndex = 8) -> str: ... # type: ignore[misc] else: @overload - def expandtabs(self: LiteralString, tabsize: int = ...) -> LiteralString: ... + def expandtabs(self: LiteralString, tabsize: int = 8) -> LiteralString: ... @overload - def expandtabs(self, tabsize: int = ...) -> str: ... # type: ignore[misc] + def expandtabs(self, tabsize: int = 8) -> str: ... # type: ignore[misc] def find(self, __sub: str, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...) -> int: ... @overload def format(self: LiteralString, *args: LiteralString, **kwargs: LiteralString) -> LiteralString: ... @overload - def format(self, *args: object, **kwargs: object) -> str: ... # type: ignore[misc] + def format(self, *args: object, **kwargs: object) -> str: ... def format_map(self, map: _FormatMapMapping) -> str: ... def index(self, __sub: str, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...) -> int: ... def isalnum(self) -> bool: ... @@ -464,27 +468,27 @@ class str(Sequence[str]): @overload def join(self, __iterable: Iterable[str]) -> str: ... # type: ignore[misc] @overload - def ljust(self: LiteralString, __width: SupportsIndex, __fillchar: LiteralString = ...) -> LiteralString: ... + def ljust(self: LiteralString, __width: SupportsIndex, __fillchar: LiteralString = " ") -> LiteralString: ... @overload - def ljust(self, __width: SupportsIndex, __fillchar: str = ...) -> str: ... # type: ignore[misc] + def ljust(self, __width: SupportsIndex, __fillchar: str = " ") -> str: ... # type: ignore[misc] @overload def lower(self: LiteralString) -> LiteralString: ... @overload def lower(self) -> str: ... # type: ignore[misc] @overload - def lstrip(self: LiteralString, __chars: LiteralString | None = ...) -> LiteralString: ... + def lstrip(self: LiteralString, __chars: LiteralString | None = None) -> LiteralString: ... @overload - def lstrip(self, __chars: str | None = ...) -> str: ... # type: ignore[misc] + def lstrip(self, __chars: str | None = None) -> str: ... # type: ignore[misc] @overload def partition(self: LiteralString, __sep: LiteralString) -> tuple[LiteralString, LiteralString, LiteralString]: ... @overload def partition(self, __sep: str) -> tuple[str, str, str]: ... # type: ignore[misc] @overload def replace( - self: LiteralString, __old: LiteralString, __new: LiteralString, __count: SupportsIndex = ... + self: LiteralString, __old: LiteralString, __new: LiteralString, __count: SupportsIndex = -1 ) -> LiteralString: ... @overload - def replace(self, __old: str, __new: str, __count: SupportsIndex = ...) -> str: ... # type: ignore[misc] + def replace(self, __old: str, __new: str, __count: SupportsIndex = -1) -> str: ... # type: ignore[misc] if sys.version_info >= (3, 9): @overload def removeprefix(self: LiteralString, __prefix: LiteralString) -> LiteralString: ... @@ -498,36 +502,36 @@ class str(Sequence[str]): def rfind(self, __sub: str, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...) -> int: ... def rindex(self, __sub: str, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...) -> int: ... @overload - def rjust(self: LiteralString, __width: SupportsIndex, __fillchar: LiteralString = ...) -> LiteralString: ... + def rjust(self: LiteralString, __width: SupportsIndex, __fillchar: LiteralString = " ") -> LiteralString: ... @overload - def rjust(self, __width: SupportsIndex, __fillchar: str = ...) -> str: ... # type: ignore[misc] + def rjust(self, __width: SupportsIndex, __fillchar: str = " ") -> str: ... # type: ignore[misc] @overload def rpartition(self: LiteralString, __sep: LiteralString) -> tuple[LiteralString, LiteralString, LiteralString]: ... @overload def rpartition(self, __sep: str) -> tuple[str, str, str]: ... # type: ignore[misc] @overload - def rsplit(self: LiteralString, sep: LiteralString | None = ..., maxsplit: SupportsIndex = ...) -> list[LiteralString]: ... + def rsplit(self: LiteralString, sep: LiteralString | None = None, maxsplit: SupportsIndex = -1) -> list[LiteralString]: ... @overload - def rsplit(self, sep: str | None = ..., maxsplit: SupportsIndex = ...) -> list[str]: ... # type: ignore[misc] + def rsplit(self, sep: str | None = None, maxsplit: SupportsIndex = -1) -> list[str]: ... # type: ignore[misc] @overload - def rstrip(self: LiteralString, __chars: LiteralString | None = ...) -> LiteralString: ... + def rstrip(self: LiteralString, __chars: LiteralString | None = None) -> LiteralString: ... @overload - def rstrip(self, __chars: str | None = ...) -> str: ... # type: ignore[misc] + def rstrip(self, __chars: str | None = None) -> str: ... # type: ignore[misc] @overload - def split(self: LiteralString, sep: LiteralString | None = ..., maxsplit: SupportsIndex = ...) -> list[LiteralString]: ... + def split(self: LiteralString, sep: LiteralString | None = None, maxsplit: SupportsIndex = -1) -> list[LiteralString]: ... @overload - def split(self, sep: str | None = ..., maxsplit: SupportsIndex = ...) -> list[str]: ... # type: ignore[misc] + def split(self, sep: str | None = None, maxsplit: SupportsIndex = -1) -> list[str]: ... # type: ignore[misc] @overload - def splitlines(self: LiteralString, keepends: bool = ...) -> list[LiteralString]: ... + def splitlines(self: LiteralString, keepends: bool = False) -> list[LiteralString]: ... @overload - def splitlines(self, keepends: bool = ...) -> list[str]: ... # type: ignore[misc] + def splitlines(self, keepends: bool = False) -> list[str]: ... # type: ignore[misc] def startswith( self, __prefix: str | tuple[str, ...], __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ... ) -> bool: ... @overload - def strip(self: LiteralString, __chars: LiteralString | None = ...) -> LiteralString: ... + def strip(self: LiteralString, __chars: LiteralString | None = None) -> LiteralString: ... @overload - def strip(self, __chars: str | None = ...) -> str: ... # type: ignore[misc] + def strip(self, __chars: str | None = None) -> str: ... # type: ignore[misc] @overload def swapcase(self: LiteralString) -> LiteralString: ... @overload @@ -536,7 +540,7 @@ class str(Sequence[str]): def title(self: LiteralString) -> LiteralString: ... @overload def title(self) -> str: ... # type: ignore[misc] - def translate(self, __table: Mapping[int, int | str | None] | Sequence[int | str | None]) -> str: ... + def translate(self, __table: _TranslateTable) -> str: ... @overload def upper(self: LiteralString) -> LiteralString: ... @overload @@ -550,56 +554,55 @@ class str(Sequence[str]): def maketrans(__x: dict[int, _T] | dict[str, _T] | dict[str | int, _T]) -> dict[int, _T]: ... @staticmethod @overload - def maketrans(__x: str, __y: str, __z: str | None = ...) -> dict[int, int | None]: ... + def maketrans(__x: str, __y: str) -> dict[int, int]: ... + @staticmethod @overload - def __add__(self: LiteralString, __s: LiteralString) -> LiteralString: ... + def maketrans(__x: str, __y: str, __z: str) -> dict[int, int | None]: ... @overload - def __add__(self, __s: str) -> str: ... # type: ignore[misc] + def __add__(self: LiteralString, __value: LiteralString) -> LiteralString: ... + @overload + def __add__(self, __value: str) -> str: ... # type: ignore[misc] # Incompatible with Sequence.__contains__ - def __contains__(self, __o: str) -> bool: ... # type: ignore[override] - def __eq__(self, __x: object) -> bool: ... - def __ge__(self, __x: str) -> bool: ... - def __getitem__(self, __i: SupportsIndex | slice) -> str: ... - def __gt__(self, __x: str) -> bool: ... + def __contains__(self, __key: str) -> bool: ... # type: ignore[override] + def __eq__(self, __value: object) -> bool: ... + def __ge__(self, __value: str) -> bool: ... + def __getitem__(self, __key: SupportsIndex | slice) -> str: ... + def __gt__(self, __value: str) -> bool: ... @overload def __iter__(self: LiteralString) -> Iterator[LiteralString]: ... @overload def __iter__(self) -> Iterator[str]: ... # type: ignore[misc] - def __le__(self, __x: str) -> bool: ... + def __le__(self, __value: str) -> bool: ... def __len__(self) -> int: ... - def __lt__(self, __x: str) -> bool: ... + def __lt__(self, __value: str) -> bool: ... @overload - def __mod__(self: LiteralString, __x: LiteralString | tuple[LiteralString, ...]) -> LiteralString: ... + def __mod__(self: LiteralString, __value: LiteralString | tuple[LiteralString, ...]) -> LiteralString: ... @overload - def __mod__(self, __x: Any) -> str: ... # type: ignore[misc] + def __mod__(self, __value: Any) -> str: ... @overload - def __mul__(self: LiteralString, __n: SupportsIndex) -> LiteralString: ... + def __mul__(self: LiteralString, __value: SupportsIndex) -> LiteralString: ... @overload - def __mul__(self, __n: SupportsIndex) -> str: ... # type: ignore[misc] - def __ne__(self, __x: object) -> bool: ... + def __mul__(self, __value: SupportsIndex) -> str: ... # type: ignore[misc] + def __ne__(self, __value: object) -> bool: ... @overload - def __rmul__(self: LiteralString, __n: SupportsIndex) -> LiteralString: ... + def __rmul__(self: LiteralString, __value: SupportsIndex) -> LiteralString: ... @overload - def __rmul__(self, __n: SupportsIndex) -> str: ... # type: ignore[misc] + def __rmul__(self, __value: SupportsIndex) -> str: ... # type: ignore[misc] def __getnewargs__(self) -> tuple[str]: ... class bytes(ByteString): @overload - def __new__(cls: type[Self], __ints: Iterable[SupportsIndex]) -> Self: ... - @overload - def __new__(cls: type[Self], __string: str, encoding: str, errors: str = ...) -> Self: ... + def __new__(cls, __o: Iterable[SupportsIndex] | SupportsIndex | SupportsBytes | ReadableBuffer) -> Self: ... @overload - def __new__(cls: type[Self], __length: SupportsIndex) -> Self: ... + def __new__(cls, __string: str, encoding: str, errors: str = ...) -> Self: ... @overload - def __new__(cls: type[Self]) -> Self: ... - @overload - def __new__(cls: type[Self], __o: SupportsBytes) -> Self: ... + def __new__(cls) -> Self: ... def capitalize(self) -> bytes: ... - def center(self, __width: SupportsIndex, __fillchar: bytes = ...) -> bytes: ... + def center(self, __width: SupportsIndex, __fillchar: bytes = b" ") -> bytes: ... def count( self, __sub: ReadableBuffer | SupportsIndex, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ... ) -> int: ... - def decode(self, encoding: str = ..., errors: str = ...) -> str: ... + def decode(self, encoding: str = "utf-8", errors: str = "strict") -> str: ... def endswith( self, __suffix: ReadableBuffer | tuple[ReadableBuffer, ...], @@ -607,7 +610,7 @@ class bytes(ByteString): __end: SupportsIndex | None = ..., ) -> bool: ... if sys.version_info >= (3, 8): - def expandtabs(self, tabsize: SupportsIndex = ...) -> bytes: ... + def expandtabs(self, tabsize: SupportsIndex = 8) -> bytes: ... else: def expandtabs(self, tabsize: int = ...) -> bytes: ... @@ -631,11 +634,11 @@ class bytes(ByteString): def istitle(self) -> bool: ... def isupper(self) -> bool: ... def join(self, __iterable_of_bytes: Iterable[ReadableBuffer]) -> bytes: ... - def ljust(self, __width: SupportsIndex, __fillchar: bytes | bytearray = ...) -> bytes: ... + def ljust(self, __width: SupportsIndex, __fillchar: bytes | bytearray = b" ") -> bytes: ... def lower(self) -> bytes: ... - def lstrip(self, __bytes: ReadableBuffer | None = ...) -> bytes: ... + def lstrip(self, __bytes: ReadableBuffer | None = None) -> bytes: ... def partition(self, __sep: ReadableBuffer) -> tuple[bytes, bytes, bytes]: ... - def replace(self, __old: ReadableBuffer, __new: ReadableBuffer, __count: SupportsIndex = ...) -> bytes: ... + def replace(self, __old: ReadableBuffer, __new: ReadableBuffer, __count: SupportsIndex = -1) -> bytes: ... if sys.version_info >= (3, 9): def removeprefix(self, __prefix: ReadableBuffer) -> bytes: ... def removesuffix(self, __suffix: ReadableBuffer) -> bytes: ... @@ -646,46 +649,46 @@ class bytes(ByteString): def rindex( self, __sub: ReadableBuffer | SupportsIndex, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ... ) -> int: ... - def rjust(self, __width: SupportsIndex, __fillchar: bytes | bytearray = ...) -> bytes: ... + def rjust(self, __width: SupportsIndex, __fillchar: bytes | bytearray = b" ") -> bytes: ... def rpartition(self, __sep: ReadableBuffer) -> tuple[bytes, bytes, bytes]: ... - def rsplit(self, sep: ReadableBuffer | None = ..., maxsplit: SupportsIndex = ...) -> list[bytes]: ... - def rstrip(self, __bytes: ReadableBuffer | None = ...) -> bytes: ... - def split(self, sep: ReadableBuffer | None = ..., maxsplit: SupportsIndex = ...) -> list[bytes]: ... - def splitlines(self, keepends: bool = ...) -> list[bytes]: ... + def rsplit(self, sep: ReadableBuffer | None = None, maxsplit: SupportsIndex = -1) -> list[bytes]: ... + def rstrip(self, __bytes: ReadableBuffer | None = None) -> bytes: ... + def split(self, sep: ReadableBuffer | None = None, maxsplit: SupportsIndex = -1) -> list[bytes]: ... + def splitlines(self, keepends: bool = False) -> list[bytes]: ... def startswith( self, __prefix: ReadableBuffer | tuple[ReadableBuffer, ...], __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ..., ) -> bool: ... - def strip(self, __bytes: ReadableBuffer | None = ...) -> bytes: ... + def strip(self, __bytes: ReadableBuffer | None = None) -> bytes: ... def swapcase(self) -> bytes: ... def title(self) -> bytes: ... - def translate(self, __table: ReadableBuffer | None, delete: bytes = ...) -> bytes: ... + def translate(self, __table: ReadableBuffer | None, delete: bytes = b"") -> bytes: ... def upper(self) -> bytes: ... def zfill(self, __width: SupportsIndex) -> bytes: ... @classmethod - def fromhex(cls: type[Self], __s: str) -> Self: ... + def fromhex(cls, __string: str) -> Self: ... @staticmethod def maketrans(__frm: ReadableBuffer, __to: ReadableBuffer) -> bytes: ... def __len__(self) -> int: ... def __iter__(self) -> Iterator[int]: ... @overload - def __getitem__(self, __i: SupportsIndex) -> int: ... + def __getitem__(self, __key: SupportsIndex) -> int: ... @overload - def __getitem__(self, __s: slice) -> bytes: ... - def __add__(self, __s: ReadableBuffer) -> bytes: ... - def __mul__(self, __n: SupportsIndex) -> bytes: ... - def __rmul__(self, __n: SupportsIndex) -> bytes: ... + def __getitem__(self, __key: slice) -> bytes: ... + def __add__(self, __value: ReadableBuffer) -> bytes: ... + def __mul__(self, __value: SupportsIndex) -> bytes: ... + def __rmul__(self, __value: SupportsIndex) -> bytes: ... def __mod__(self, __value: Any) -> bytes: ... # Incompatible with Sequence.__contains__ - def __contains__(self, __o: SupportsIndex | bytes) -> bool: ... # type: ignore[override] - def __eq__(self, __x: object) -> bool: ... - def __ne__(self, __x: object) -> bool: ... - def __lt__(self, __x: bytes) -> bool: ... - def __le__(self, __x: bytes) -> bool: ... - def __gt__(self, __x: bytes) -> bool: ... - def __ge__(self, __x: bytes) -> bool: ... + def __contains__(self, __key: SupportsIndex | ReadableBuffer) -> bool: ... # type: ignore[override] + def __eq__(self, __value: object) -> bool: ... + def __ne__(self, __value: object) -> bool: ... + def __lt__(self, __value: bytes) -> bool: ... + def __le__(self, __value: bytes) -> bool: ... + def __gt__(self, __value: bytes) -> bool: ... + def __ge__(self, __value: bytes) -> bool: ... def __getnewargs__(self) -> tuple[bytes]: ... if sys.version_info >= (3, 11): def __bytes__(self) -> bytes: ... @@ -694,19 +697,17 @@ class bytearray(MutableSequence[int], ByteString): @overload def __init__(self) -> None: ... @overload - def __init__(self, __ints: Iterable[SupportsIndex]) -> None: ... + def __init__(self, __ints: Iterable[SupportsIndex] | SupportsIndex | ReadableBuffer) -> None: ... @overload def __init__(self, __string: str, encoding: str, errors: str = ...) -> None: ... - @overload - def __init__(self, __length: SupportsIndex) -> None: ... def append(self, __item: SupportsIndex) -> None: ... def capitalize(self) -> bytearray: ... - def center(self, __width: SupportsIndex, __fillchar: bytes = ...) -> bytearray: ... + def center(self, __width: SupportsIndex, __fillchar: bytes = b" ") -> bytearray: ... def count( self, __sub: ReadableBuffer | SupportsIndex, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ... ) -> int: ... def copy(self) -> bytearray: ... - def decode(self, encoding: str = ..., errors: str = ...) -> str: ... + def decode(self, encoding: str = "utf-8", errors: str = "strict") -> str: ... def endswith( self, __suffix: ReadableBuffer | tuple[ReadableBuffer, ...], @@ -714,7 +715,7 @@ class bytearray(MutableSequence[int], ByteString): __end: SupportsIndex | None = ..., ) -> bool: ... if sys.version_info >= (3, 8): - def expandtabs(self, tabsize: SupportsIndex = ...) -> bytearray: ... + def expandtabs(self, tabsize: SupportsIndex = 8) -> bytearray: ... else: def expandtabs(self, tabsize: int = ...) -> bytearray: ... @@ -740,76 +741,76 @@ class bytearray(MutableSequence[int], ByteString): def istitle(self) -> bool: ... def isupper(self) -> bool: ... def join(self, __iterable_of_bytes: Iterable[ReadableBuffer]) -> bytearray: ... - def ljust(self, __width: SupportsIndex, __fillchar: bytes | bytearray = ...) -> bytearray: ... + def ljust(self, __width: SupportsIndex, __fillchar: bytes | bytearray = b" ") -> bytearray: ... def lower(self) -> bytearray: ... - def lstrip(self, __bytes: ReadableBuffer | None = ...) -> bytearray: ... + def lstrip(self, __bytes: ReadableBuffer | None = None) -> bytearray: ... def partition(self, __sep: ReadableBuffer) -> tuple[bytearray, bytearray, bytearray]: ... - def pop(self, __index: int = ...) -> int: ... + def pop(self, __index: int = -1) -> int: ... def remove(self, __value: int) -> None: ... if sys.version_info >= (3, 9): def removeprefix(self, __prefix: ReadableBuffer) -> bytearray: ... def removesuffix(self, __suffix: ReadableBuffer) -> bytearray: ... - def replace(self, __old: ReadableBuffer, __new: ReadableBuffer, __count: SupportsIndex = ...) -> bytearray: ... + def replace(self, __old: ReadableBuffer, __new: ReadableBuffer, __count: SupportsIndex = -1) -> bytearray: ... def rfind( self, __sub: ReadableBuffer | SupportsIndex, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ... ) -> int: ... def rindex( self, __sub: ReadableBuffer | SupportsIndex, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ... ) -> int: ... - def rjust(self, __width: SupportsIndex, __fillchar: bytes | bytearray = ...) -> bytearray: ... + def rjust(self, __width: SupportsIndex, __fillchar: bytes | bytearray = b" ") -> bytearray: ... def rpartition(self, __sep: ReadableBuffer) -> tuple[bytearray, bytearray, bytearray]: ... - def rsplit(self, sep: ReadableBuffer | None = ..., maxsplit: SupportsIndex = ...) -> list[bytearray]: ... - def rstrip(self, __bytes: ReadableBuffer | None = ...) -> bytearray: ... - def split(self, sep: ReadableBuffer | None = ..., maxsplit: SupportsIndex = ...) -> list[bytearray]: ... - def splitlines(self, keepends: bool = ...) -> list[bytearray]: ... + def rsplit(self, sep: ReadableBuffer | None = None, maxsplit: SupportsIndex = -1) -> list[bytearray]: ... + def rstrip(self, __bytes: ReadableBuffer | None = None) -> bytearray: ... + def split(self, sep: ReadableBuffer | None = None, maxsplit: SupportsIndex = -1) -> list[bytearray]: ... + def splitlines(self, keepends: bool = False) -> list[bytearray]: ... def startswith( self, __prefix: ReadableBuffer | tuple[ReadableBuffer, ...], __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ..., ) -> bool: ... - def strip(self, __bytes: ReadableBuffer | None = ...) -> bytearray: ... + def strip(self, __bytes: ReadableBuffer | None = None) -> bytearray: ... def swapcase(self) -> bytearray: ... def title(self) -> bytearray: ... - def translate(self, __table: ReadableBuffer | None, delete: bytes = ...) -> bytearray: ... + def translate(self, __table: ReadableBuffer | None, delete: bytes = b"") -> bytearray: ... def upper(self) -> bytearray: ... def zfill(self, __width: SupportsIndex) -> bytearray: ... @classmethod - def fromhex(cls: type[Self], __string: str) -> Self: ... + def fromhex(cls, __string: str) -> Self: ... @staticmethod def maketrans(__frm: ReadableBuffer, __to: ReadableBuffer) -> bytes: ... def __len__(self) -> int: ... def __iter__(self) -> Iterator[int]: ... __hash__: ClassVar[None] # type: ignore[assignment] @overload - def __getitem__(self, __i: SupportsIndex) -> int: ... + def __getitem__(self, __key: SupportsIndex) -> int: ... @overload - def __getitem__(self, __s: slice) -> bytearray: ... + def __getitem__(self, __key: slice) -> bytearray: ... @overload - def __setitem__(self, __i: SupportsIndex, __x: SupportsIndex) -> None: ... + def __setitem__(self, __key: SupportsIndex, __value: SupportsIndex) -> None: ... @overload - def __setitem__(self, __s: slice, __x: Iterable[SupportsIndex] | bytes) -> None: ... - def __delitem__(self, __i: SupportsIndex | slice) -> None: ... - def __add__(self, __s: ReadableBuffer) -> bytearray: ... + def __setitem__(self, __key: slice, __value: Iterable[SupportsIndex] | bytes) -> None: ... + def __delitem__(self, __key: SupportsIndex | slice) -> None: ... + def __add__(self, __value: ReadableBuffer) -> bytearray: ... # The superclass wants us to accept Iterable[int], but that fails at runtime. - def __iadd__(self: Self, __s: ReadableBuffer) -> Self: ... # type: ignore[override] - def __mul__(self, __n: SupportsIndex) -> bytearray: ... - def __rmul__(self, __n: SupportsIndex) -> bytearray: ... - def __imul__(self: Self, __n: SupportsIndex) -> Self: ... + def __iadd__(self, __value: ReadableBuffer) -> Self: ... # type: ignore[override] + def __mul__(self, __value: SupportsIndex) -> bytearray: ... + def __rmul__(self, __value: SupportsIndex) -> bytearray: ... + def __imul__(self, __value: SupportsIndex) -> Self: ... def __mod__(self, __value: Any) -> bytes: ... # Incompatible with Sequence.__contains__ - def __contains__(self, __o: SupportsIndex | ReadableBuffer) -> bool: ... # type: ignore[override] - def __eq__(self, __x: object) -> bool: ... - def __ne__(self, __x: object) -> bool: ... - def __lt__(self, __x: bytes) -> bool: ... - def __le__(self, __x: bytes) -> bool: ... - def __gt__(self, __x: bytes) -> bool: ... - def __ge__(self, __x: bytes) -> bool: ... + def __contains__(self, __key: SupportsIndex | ReadableBuffer) -> bool: ... # type: ignore[override] + def __eq__(self, __value: object) -> bool: ... + def __ne__(self, __value: object) -> bool: ... + def __lt__(self, __value: ReadableBuffer) -> bool: ... + def __le__(self, __value: ReadableBuffer) -> bool: ... + def __gt__(self, __value: ReadableBuffer) -> bool: ... + def __ge__(self, __value: ReadableBuffer) -> bool: ... def __alloc__(self) -> int: ... @final -class memoryview(Sized, Sequence[int]): +class memoryview(Sequence[int]): @property def format(self) -> str: ... @property @@ -825,7 +826,7 @@ class memoryview(Sized, Sequence[int]): @property def ndim(self) -> int: ... @property - def obj(self) -> bytes | bytearray: ... + def obj(self) -> ReadableBuffer: ... @property def c_contiguous(self) -> bool: ... @property @@ -835,24 +836,26 @@ class memoryview(Sized, Sequence[int]): @property def nbytes(self) -> int: ... def __init__(self, obj: ReadableBuffer) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, __exc_type: type[BaseException] | None, __exc_val: BaseException | None, __exc_tb: TracebackType | None ) -> None: ... def cast(self, format: str, shape: list[int] | tuple[int, ...] = ...) -> memoryview: ... @overload - def __getitem__(self, __i: SupportsIndex) -> int: ... + def __getitem__(self, __key: SupportsIndex) -> int: ... @overload - def __getitem__(self, __s: slice) -> memoryview: ... + def __getitem__(self, __key: slice) -> memoryview: ... def __contains__(self, __x: object) -> bool: ... def __iter__(self) -> Iterator[int]: ... def __len__(self) -> int: ... @overload - def __setitem__(self, __s: slice, __o: ReadableBuffer) -> None: ... + def __setitem__(self, __key: slice, __value: ReadableBuffer) -> None: ... @overload - def __setitem__(self, __i: SupportsIndex, __o: SupportsIndex) -> None: ... - if sys.version_info >= (3, 8): - def tobytes(self, order: Literal["C", "F", "A"] | None = ...) -> bytes: ... + def __setitem__(self, __key: SupportsIndex, __value: SupportsIndex) -> None: ... + if sys.version_info >= (3, 10): + def tobytes(self, order: Literal["C", "F", "A"] | None = "C") -> bytes: ... + elif sys.version_info >= (3, 8): + def tobytes(self, order: Literal["C", "F", "A"] | None = None) -> bytes: ... else: def tobytes(self) -> bytes: ... @@ -868,33 +871,33 @@ class memoryview(Sized, Sequence[int]): @final class bool(int): - def __new__(cls: type[Self], __o: object = ...) -> Self: ... + def __new__(cls, __o: object = ...) -> Self: ... # The following overloads could be represented more elegantly with a TypeVar("_B", bool, int), # however mypy has a bug regarding TypeVar constraints (https://github.com/python/mypy/issues/11880). @overload - def __and__(self, __x: bool) -> bool: ... + def __and__(self, __value: bool) -> bool: ... @overload - def __and__(self, __x: int) -> int: ... + def __and__(self, __value: int) -> int: ... @overload - def __or__(self, __x: bool) -> bool: ... + def __or__(self, __value: bool) -> bool: ... @overload - def __or__(self, __x: int) -> int: ... + def __or__(self, __value: int) -> int: ... @overload - def __xor__(self, __x: bool) -> bool: ... + def __xor__(self, __value: bool) -> bool: ... @overload - def __xor__(self, __x: int) -> int: ... + def __xor__(self, __value: int) -> int: ... @overload - def __rand__(self, __x: bool) -> bool: ... + def __rand__(self, __value: bool) -> bool: ... @overload - def __rand__(self, __x: int) -> int: ... + def __rand__(self, __value: int) -> int: ... @overload - def __ror__(self, __x: bool) -> bool: ... + def __ror__(self, __value: bool) -> bool: ... @overload - def __ror__(self, __x: int) -> int: ... + def __ror__(self, __value: int) -> int: ... @overload - def __rxor__(self, __x: bool) -> bool: ... + def __rxor__(self, __value: bool) -> bool: ... @overload - def __rxor__(self, __x: int) -> int: ... + def __rxor__(self, __value: int) -> int: ... def __getnewargs__(self) -> tuple[int]: ... @final @@ -913,31 +916,32 @@ class slice: def indices(self, __len: SupportsIndex) -> tuple[int, int, int]: ... class tuple(Sequence[_T_co], Generic[_T_co]): - def __new__(cls: type[Self], __iterable: Iterable[_T_co] = ...) -> Self: ... + def __new__(cls, __iterable: Iterable[_T_co] = ...) -> Self: ... def __len__(self) -> int: ... - def __contains__(self, __x: object) -> bool: ... + def __contains__(self, __key: object) -> bool: ... @overload - def __getitem__(self, __x: SupportsIndex) -> _T_co: ... + def __getitem__(self, __key: SupportsIndex) -> _T_co: ... @overload - def __getitem__(self, __x: slice) -> tuple[_T_co, ...]: ... + def __getitem__(self, __key: slice) -> tuple[_T_co, ...]: ... def __iter__(self) -> Iterator[_T_co]: ... - def __lt__(self, __x: tuple[_T_co, ...]) -> bool: ... - def __le__(self, __x: tuple[_T_co, ...]) -> bool: ... - def __gt__(self, __x: tuple[_T_co, ...]) -> bool: ... - def __ge__(self, __x: tuple[_T_co, ...]) -> bool: ... + def __lt__(self, __value: tuple[_T_co, ...]) -> bool: ... + def __le__(self, __value: tuple[_T_co, ...]) -> bool: ... + def __gt__(self, __value: tuple[_T_co, ...]) -> bool: ... + def __ge__(self, __value: tuple[_T_co, ...]) -> bool: ... @overload - def __add__(self, __x: tuple[_T_co, ...]) -> tuple[_T_co, ...]: ... + def __add__(self, __value: tuple[_T_co, ...]) -> tuple[_T_co, ...]: ... @overload - def __add__(self, __x: tuple[_T, ...]) -> tuple[_T_co | _T, ...]: ... - def __mul__(self, __n: SupportsIndex) -> tuple[_T_co, ...]: ... - def __rmul__(self, __n: SupportsIndex) -> tuple[_T_co, ...]: ... + def __add__(self, __value: tuple[_T, ...]) -> tuple[_T_co | _T, ...]: ... + def __mul__(self, __value: SupportsIndex) -> tuple[_T_co, ...]: ... + def __rmul__(self, __value: SupportsIndex) -> tuple[_T_co, ...]: ... def count(self, __value: Any) -> int: ... - def index(self, __value: Any, __start: SupportsIndex = ..., __stop: SupportsIndex = ...) -> int: ... + def index(self, __value: Any, __start: SupportsIndex = 0, __stop: SupportsIndex = sys.maxsize) -> int: ... if sys.version_info >= (3, 9): def __class_getitem__(cls, __item: Any) -> GenericAlias: ... # Doesn't exist at runtime, but deleting this breaks mypy. See #2999 @final +@type_check_only class function: # Make sure this class definition stays roughly in line with `types.FunctionType` @property @@ -957,7 +961,7 @@ class function: __module__: str # mypy uses `builtins.function.__get__` to represent methods, properties, and getset_descriptors so we type the return as Any. - def __get__(self, obj: object | None, type: type | None = ...) -> Any: ... + def __get__(self, __instance: object, __owner: type | None = None) -> Any: ... class list(MutableSequence[_T], Generic[_T]): @overload @@ -967,10 +971,10 @@ class list(MutableSequence[_T], Generic[_T]): def copy(self) -> list[_T]: ... def append(self, __object: _T) -> None: ... def extend(self, __iterable: Iterable[_T]) -> None: ... - def pop(self, __index: SupportsIndex = ...) -> _T: ... + def pop(self, __index: SupportsIndex = -1) -> _T: ... # Signature of `list.index` should be kept in line with `collections.UserList.index()` # and multiprocessing.managers.ListProxy.index() - def index(self, __value: _T, __start: SupportsIndex = ..., __stop: SupportsIndex = ...) -> int: ... + def index(self, __value: _T, __start: SupportsIndex = 0, __stop: SupportsIndex = sys.maxsize) -> int: ... def count(self, __value: _T) -> int: ... def insert(self, __index: SupportsIndex, __object: _T) -> None: ... def remove(self, __value: _T) -> None: ... @@ -980,9 +984,9 @@ class list(MutableSequence[_T], Generic[_T]): # Use list[SupportsRichComparisonT] for the first overload rather than [SupportsRichComparison] # to work around invariance @overload - def sort(self: list[SupportsRichComparisonT], *, key: None = ..., reverse: bool = ...) -> None: ... + def sort(self: list[SupportsRichComparisonT], *, key: None = None, reverse: bool = False) -> None: ... @overload - def sort(self, *, key: Callable[[_T], SupportsRichComparison], reverse: bool = ...) -> None: ... + def sort(self, *, key: Callable[[_T], SupportsRichComparison], reverse: bool = False) -> None: ... def __len__(self) -> int: ... def __iter__(self) -> Iterator[_T]: ... __hash__: ClassVar[None] # type: ignore[assignment] @@ -991,25 +995,25 @@ class list(MutableSequence[_T], Generic[_T]): @overload def __getitem__(self, __s: slice) -> list[_T]: ... @overload - def __setitem__(self, __i: SupportsIndex, __o: _T) -> None: ... + def __setitem__(self, __key: SupportsIndex, __value: _T) -> None: ... @overload - def __setitem__(self, __s: slice, __o: Iterable[_T]) -> None: ... - def __delitem__(self, __i: SupportsIndex | slice) -> None: ... + def __setitem__(self, __key: slice, __value: Iterable[_T]) -> None: ... + def __delitem__(self, __key: SupportsIndex | slice) -> None: ... # Overloading looks unnecessary, but is needed to work around complex mypy problems @overload - def __add__(self, __x: list[_T]) -> list[_T]: ... + def __add__(self, __value: list[_T]) -> list[_T]: ... @overload - def __add__(self, __x: list[_S]) -> list[_S | _T]: ... - def __iadd__(self: Self, __x: Iterable[_T]) -> Self: ... # type: ignore[misc] - def __mul__(self, __n: SupportsIndex) -> list[_T]: ... - def __rmul__(self, __n: SupportsIndex) -> list[_T]: ... - def __imul__(self: Self, __n: SupportsIndex) -> Self: ... - def __contains__(self, __o: object) -> bool: ... + def __add__(self, __value: list[_S]) -> list[_S | _T]: ... + def __iadd__(self, __value: Iterable[_T]) -> Self: ... # type: ignore[misc] + def __mul__(self, __value: SupportsIndex) -> list[_T]: ... + def __rmul__(self, __value: SupportsIndex) -> list[_T]: ... + def __imul__(self, __value: SupportsIndex) -> Self: ... + def __contains__(self, __key: object) -> bool: ... def __reversed__(self) -> Iterator[_T]: ... - def __gt__(self, __x: list[_T]) -> bool: ... - def __ge__(self, __x: list[_T]) -> bool: ... - def __lt__(self, __x: list[_T]) -> bool: ... - def __le__(self, __x: list[_T]) -> bool: ... + def __gt__(self, __value: list[_T]) -> bool: ... + def __ge__(self, __value: list[_T]) -> bool: ... + def __lt__(self, __value: list[_T]) -> bool: ... + def __le__(self, __value: list[_T]) -> bool: ... if sys.version_info >= (3, 9): def __class_getitem__(cls, __item: Any) -> GenericAlias: ... @@ -1021,14 +1025,18 @@ class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]): @overload def __init__(self: dict[str, _VT], **kwargs: _VT) -> None: ... @overload - def __init__(self, __map: SupportsKeysAndGetItem[_KT, _VT], **kwargs: _VT) -> None: ... + def __init__(self, __map: SupportsKeysAndGetItem[_KT, _VT]) -> None: ... + @overload + def __init__(self: dict[str, _VT], __map: SupportsKeysAndGetItem[str, _VT], **kwargs: _VT) -> None: ... @overload - def __init__(self, __iterable: Iterable[tuple[_KT, _VT]], **kwargs: _VT) -> None: ... + def __init__(self, __iterable: Iterable[tuple[_KT, _VT]]) -> None: ... + @overload + def __init__(self: dict[str, _VT], __iterable: Iterable[tuple[str, _VT]], **kwargs: _VT) -> None: ... # Next overload is for dict(string.split(sep) for string in iterable) # Cannot be Iterable[Sequence[_T]] or otherwise dict(["foo", "bar", "baz"]) is not an error @overload def __init__(self: dict[str, str], __iterable: Iterable[list[str]]) -> None: ... - def __new__(cls: type[Self], *args: Any, **kwargs: Any) -> Self: ... + def __new__(cls, *args: Any, **kwargs: Any) -> Self: ... def copy(self) -> dict[_KT, _VT]: ... def keys(self) -> dict_keys[_KT, _VT]: ... def values(self) -> dict_values[_KT, _VT]: ... @@ -1038,7 +1046,7 @@ class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]): # See #3800 & https://github.com/python/typing/issues/548#issuecomment-683336963. @classmethod @overload - def fromkeys(cls, __iterable: Iterable[_T], __value: None = ...) -> dict[_T, Any | None]: ... + def fromkeys(cls, __iterable: Iterable[_T], __value: None = None) -> dict[_T, Any | None]: ... @classmethod @overload def fromkeys(cls, __iterable: Iterable[_T], __value: _S) -> dict[_T, _S]: ... @@ -1052,9 +1060,9 @@ class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]): @overload def pop(self, __key: _KT, __default: _VT | _T) -> _VT | _T: ... def __len__(self) -> int: ... - def __getitem__(self, __k: _KT) -> _VT: ... - def __setitem__(self, __k: _KT, __v: _VT) -> None: ... - def __delitem__(self, __v: _KT) -> None: ... + def __getitem__(self, __key: _KT) -> _VT: ... + def __setitem__(self, __key: _KT, __value: _VT) -> None: ... + def __delitem__(self, __key: _KT) -> None: ... def __iter__(self) -> Iterator[_KT]: ... if sys.version_info >= (3, 8): def __reversed__(self) -> Iterator[_KT]: ... @@ -1065,9 +1073,9 @@ class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]): def __ror__(self, __value: Mapping[_T1, _T2]) -> dict[_KT | _T1, _VT | _T2]: ... # dict.__ior__ should be kept roughly in line with MutableMapping.update() @overload # type: ignore[misc] - def __ior__(self: Self, __value: SupportsKeysAndGetItem[_KT, _VT]) -> Self: ... + def __ior__(self, __value: SupportsKeysAndGetItem[_KT, _VT]) -> Self: ... @overload - def __ior__(self: Self, __value: Iterable[tuple[_KT, _VT]]) -> Self: ... + def __ior__(self, __value: Iterable[tuple[_KT, _VT]]) -> Self: ... class set(MutableSet[_T], Generic[_T]): @overload @@ -1092,27 +1100,27 @@ class set(MutableSet[_T], Generic[_T]): def __len__(self) -> int: ... def __contains__(self, __o: object) -> bool: ... def __iter__(self) -> Iterator[_T]: ... - def __and__(self, __s: AbstractSet[object]) -> set[_T]: ... - def __iand__(self: Self, __s: AbstractSet[object]) -> Self: ... - def __or__(self, __s: AbstractSet[_S]) -> set[_T | _S]: ... - def __ior__(self: Self, __s: AbstractSet[_T]) -> Self: ... # type: ignore[override,misc] - def __sub__(self, __s: AbstractSet[_T | None]) -> set[_T]: ... - def __isub__(self: Self, __s: AbstractSet[object]) -> Self: ... - def __xor__(self, __s: AbstractSet[_S]) -> set[_T | _S]: ... - def __ixor__(self: Self, __s: AbstractSet[_T]) -> Self: ... # type: ignore[override,misc] - def __le__(self, __s: AbstractSet[object]) -> bool: ... - def __lt__(self, __s: AbstractSet[object]) -> bool: ... - def __ge__(self, __s: AbstractSet[object]) -> bool: ... - def __gt__(self, __s: AbstractSet[object]) -> bool: ... + def __and__(self, __value: AbstractSet[object]) -> set[_T]: ... + def __iand__(self, __value: AbstractSet[object]) -> Self: ... + def __or__(self, __value: AbstractSet[_S]) -> set[_T | _S]: ... + def __ior__(self, __value: AbstractSet[_T]) -> Self: ... # type: ignore[override,misc] + def __sub__(self, __value: AbstractSet[_T | None]) -> set[_T]: ... + def __isub__(self, __value: AbstractSet[object]) -> Self: ... + def __xor__(self, __value: AbstractSet[_S]) -> set[_T | _S]: ... + def __ixor__(self, __value: AbstractSet[_T]) -> Self: ... # type: ignore[override,misc] + def __le__(self, __value: AbstractSet[object]) -> bool: ... + def __lt__(self, __value: AbstractSet[object]) -> bool: ... + def __ge__(self, __value: AbstractSet[object]) -> bool: ... + def __gt__(self, __value: AbstractSet[object]) -> bool: ... __hash__: ClassVar[None] # type: ignore[assignment] if sys.version_info >= (3, 9): def __class_getitem__(cls, __item: Any) -> GenericAlias: ... class frozenset(AbstractSet[_T_co], Generic[_T_co]): @overload - def __new__(cls: type[Self]) -> Self: ... + def __new__(cls) -> Self: ... @overload - def __new__(cls: type[Self], __iterable: Iterable[_T_co]) -> Self: ... + def __new__(cls, __iterable: Iterable[_T_co]) -> Self: ... def copy(self) -> frozenset[_T_co]: ... def difference(self, *s: Iterable[object]) -> frozenset[_T_co]: ... def intersection(self, *s: Iterable[object]) -> frozenset[_T_co]: ... @@ -1124,20 +1132,20 @@ class frozenset(AbstractSet[_T_co], Generic[_T_co]): def __len__(self) -> int: ... def __contains__(self, __o: object) -> bool: ... def __iter__(self) -> Iterator[_T_co]: ... - def __and__(self, __s: AbstractSet[_T_co]) -> frozenset[_T_co]: ... - def __or__(self, __s: AbstractSet[_S]) -> frozenset[_T_co | _S]: ... - def __sub__(self, __s: AbstractSet[_T_co]) -> frozenset[_T_co]: ... - def __xor__(self, __s: AbstractSet[_S]) -> frozenset[_T_co | _S]: ... - def __le__(self, __s: AbstractSet[object]) -> bool: ... - def __lt__(self, __s: AbstractSet[object]) -> bool: ... - def __ge__(self, __s: AbstractSet[object]) -> bool: ... - def __gt__(self, __s: AbstractSet[object]) -> bool: ... + def __and__(self, __value: AbstractSet[_T_co]) -> frozenset[_T_co]: ... + def __or__(self, __value: AbstractSet[_S]) -> frozenset[_T_co | _S]: ... + def __sub__(self, __value: AbstractSet[_T_co]) -> frozenset[_T_co]: ... + def __xor__(self, __value: AbstractSet[_S]) -> frozenset[_T_co | _S]: ... + def __le__(self, __value: AbstractSet[object]) -> bool: ... + def __lt__(self, __value: AbstractSet[object]) -> bool: ... + def __ge__(self, __value: AbstractSet[object]) -> bool: ... + def __gt__(self, __value: AbstractSet[object]) -> bool: ... if sys.version_info >= (3, 9): def __class_getitem__(cls, __item: Any) -> GenericAlias: ... class enumerate(Iterator[tuple[int, _T]], Generic[_T]): def __init__(self, iterable: Iterable[_T], start: int = ...) -> None: ... - def __iter__(self: Self) -> Self: ... + def __iter__(self) -> Self: ... def __next__(self) -> tuple[int, _T]: ... if sys.version_info >= (3, 9): def __class_getitem__(cls, __item: Any) -> GenericAlias: ... @@ -1157,12 +1165,12 @@ class range(Sequence[int]): def count(self, __value: int) -> int: ... def index(self, __value: int) -> int: ... # type: ignore[override] def __len__(self) -> int: ... - def __contains__(self, __o: object) -> bool: ... + def __contains__(self, __key: object) -> bool: ... def __iter__(self) -> Iterator[int]: ... @overload - def __getitem__(self, __i: SupportsIndex) -> int: ... + def __getitem__(self, __key: SupportsIndex) -> int: ... @overload - def __getitem__(self, __s: slice) -> range: ... + def __getitem__(self, __key: slice) -> range: ... def __reversed__(self) -> Iterator[int]: ... class property: @@ -1180,15 +1188,15 @@ class property: def getter(self, __fget: Callable[[Any], Any]) -> property: ... def setter(self, __fset: Callable[[Any, Any], None]) -> property: ... def deleter(self, __fdel: Callable[[Any], None]) -> property: ... - def __get__(self, __obj: Any, __type: type | None = ...) -> Any: ... - def __set__(self, __obj: Any, __value: Any) -> None: ... - def __delete__(self, __obj: Any) -> None: ... + def __get__(self, __instance: Any, __owner: type | None = None) -> Any: ... + def __set__(self, __instance: Any, __value: Any) -> None: ... + def __delete__(self, __instance: Any) -> None: ... @final -class _NotImplementedType(Any): # type: ignore[misc] +class _NotImplementedType(Any): # A little weird, but typing the __call__ as NotImplemented makes the error message # for NotImplemented() much better - __call__: NotImplemented # type: ignore[valid-type] + __call__: NotImplemented # type: ignore[valid-type] # pyright: ignore[reportGeneralTypeIssues] NotImplemented: _NotImplementedType @@ -1220,27 +1228,90 @@ if sys.version_info >= (3, 10): @overload async def anext(__i: SupportsAnext[_T], default: _VT) -> _T | _VT: ... -# TODO: `compile` has a more precise return type in reality; work on a way of expressing that? +# compile() returns a CodeType, unless the flags argument includes PyCF_ONLY_AST (=1024), +# in which case it returns ast.AST. We have overloads for flag 0 (the default) and for +# explicitly passing PyCF_ONLY_AST. We fall back to Any for other values of flags. if sys.version_info >= (3, 8): + @overload + def compile( + source: str | ReadableBuffer | _ast.Module | _ast.Expression | _ast.Interactive, + filename: str | ReadableBuffer | _PathLike[Any], + mode: str, + flags: Literal[0], + dont_inherit: bool = False, + optimize: int = -1, + *, + _feature_version: int = -1, + ) -> CodeType: ... + @overload def compile( - source: str | ReadableBuffer | AST, + source: str | ReadableBuffer | _ast.Module | _ast.Expression | _ast.Interactive, filename: str | ReadableBuffer | _PathLike[Any], mode: str, - flags: int = ..., - dont_inherit: int = ..., - optimize: int = ..., *, - _feature_version: int = ..., + dont_inherit: bool = False, + optimize: int = -1, + _feature_version: int = -1, + ) -> CodeType: ... + @overload + def compile( + source: str | ReadableBuffer | _ast.Module | _ast.Expression | _ast.Interactive, + filename: str | ReadableBuffer | _PathLike[Any], + mode: str, + flags: Literal[1024], + dont_inherit: bool = False, + optimize: int = -1, + *, + _feature_version: int = -1, + ) -> _ast.AST: ... + @overload + def compile( + source: str | ReadableBuffer | _ast.Module | _ast.Expression | _ast.Interactive, + filename: str | ReadableBuffer | _PathLike[Any], + mode: str, + flags: int, + dont_inherit: bool = False, + optimize: int = -1, + *, + _feature_version: int = -1, ) -> Any: ... else: + @overload + def compile( + source: str | ReadableBuffer | _ast.Module | _ast.Expression | _ast.Interactive, + filename: str | ReadableBuffer | _PathLike[Any], + mode: str, + flags: Literal[0], + dont_inherit: bool = False, + optimize: int = -1, + ) -> CodeType: ... + @overload + def compile( + source: str | ReadableBuffer | _ast.Module | _ast.Expression | _ast.Interactive, + filename: str | ReadableBuffer | _PathLike[Any], + mode: str, + *, + dont_inherit: bool = False, + optimize: int = -1, + ) -> CodeType: ... + @overload def compile( - source: str | ReadableBuffer | AST, + source: str | ReadableBuffer | _ast.Module | _ast.Expression | _ast.Interactive, filename: str | ReadableBuffer | _PathLike[Any], mode: str, - flags: int = ..., - dont_inherit: int = ..., - optimize: int = ..., + flags: Literal[1024], + dont_inherit: bool = False, + optimize: int = -1, + ) -> _ast.AST: ... + @overload + def compile( + source: str | ReadableBuffer | _ast.Module | _ast.Expression | _ast.Interactive, + filename: str | ReadableBuffer | _PathLike[Any], + mode: str, + flags: int, + dont_inherit: bool = False, + optimize: int = -1, ) -> Any: ... def copyright() -> None: ... @@ -1255,27 +1326,29 @@ def divmod(__x: _T_contra, __y: SupportsRDivMod[_T_contra, _T_co]) -> _T_co: ... # The `globals` argument to `eval` has to be `dict[str, Any]` rather than `dict[str, object]` due to invariance. # (The `globals` argument has to be a "real dict", rather than any old mapping, unlike the `locals` argument.) def eval( - __source: str | ReadableBuffer | CodeType, __globals: dict[str, Any] | None = ..., __locals: Mapping[str, object] | None = ... + __source: str | ReadableBuffer | CodeType, + __globals: dict[str, Any] | None = None, + __locals: Mapping[str, object] | None = None, ) -> Any: ... # Comment above regarding `eval` applies to `exec` as well if sys.version_info >= (3, 11): def exec( __source: str | ReadableBuffer | CodeType, - __globals: dict[str, Any] | None = ..., - __locals: Mapping[str, object] | None = ..., + __globals: dict[str, Any] | None = None, + __locals: Mapping[str, object] | None = None, *, - closure: tuple[_Cell, ...] | None = ..., + closure: tuple[_Cell, ...] | None = None, ) -> None: ... else: def exec( __source: str | ReadableBuffer | CodeType, - __globals: dict[str, Any] | None = ..., - __locals: Mapping[str, object] | None = ..., + __globals: dict[str, Any] | None = None, + __locals: Mapping[str, object] | None = None, ) -> None: ... -def exit(code: object = ...) -> NoReturn: ... +def exit(code: sys._ExitCode = None) -> NoReturn: ... class filter(Iterator[_T], Generic[_T]): @overload @@ -1284,10 +1357,10 @@ class filter(Iterator[_T], Generic[_T]): def __init__(self, __function: Callable[[_S], TypeGuard[_T]], __iterable: Iterable[_S]) -> None: ... @overload def __init__(self, __function: Callable[[_T], Any], __iterable: Iterable[_T]) -> None: ... - def __iter__(self: Self) -> Self: ... + def __iter__(self) -> Self: ... def __next__(self) -> _T: ... -def format(__value: object, __format_spec: str = ...) -> str: ... # TODO unicode +def format(__value: object, __format_spec: str = "") -> str: ... @overload def getattr(__o: object, __name: str) -> Any: ... @@ -1310,7 +1383,7 @@ def hash(__obj: object) -> int: ... def help(request: object = ...) -> None: ... def hex(__number: int | SupportsIndex) -> str: ... def id(__obj: object) -> int: ... -def input(__prompt: object = ...) -> str: ... +def input(__prompt: object = "") -> str: ... class _GetItemIterable(Protocol[_T_co]): def __getitem__(self, __i: int) -> _T_co: ... @@ -1324,19 +1397,14 @@ def iter(__function: Callable[[], _T | None], __sentinel: None) -> Iterator[_T]: @overload def iter(__function: Callable[[], _T], __sentinel: object) -> Iterator[_T]: ... -# We need recursive types to express the type of the second argument to `isinstance` properly, hence the use of `Any` +# Keep this alias in sync with unittest.case._ClassInfo if sys.version_info >= (3, 10): - def isinstance( - __obj: object, __class_or_tuple: type | types.UnionType | tuple[type | types.UnionType | tuple[Any, ...], ...] - ) -> bool: ... - def issubclass( - __cls: type, __class_or_tuple: type | types.UnionType | tuple[type | types.UnionType | tuple[Any, ...], ...] - ) -> bool: ... - + _ClassInfo: TypeAlias = type | types.UnionType | tuple[_ClassInfo, ...] else: - def isinstance(__obj: object, __class_or_tuple: type | tuple[type | tuple[Any, ...], ...]) -> bool: ... - def issubclass(__cls: type, __class_or_tuple: type | tuple[type | tuple[Any, ...], ...]) -> bool: ... + _ClassInfo: TypeAlias = type | tuple[_ClassInfo, ...] +def isinstance(__obj: object, __class_or_tuple: _ClassInfo) -> bool: ... +def issubclass(__cls: type, __class_or_tuple: _ClassInfo) -> bool: ... def len(__obj: Sized) -> int: ... def license() -> None: ... def locals() -> dict[str, Any]: ... @@ -1381,35 +1449,35 @@ class map(Iterator[_S], Generic[_S]): __iter6: Iterable[Any], *iterables: Iterable[Any], ) -> None: ... - def __iter__(self: Self) -> Self: ... + def __iter__(self) -> Self: ... def __next__(self) -> _S: ... @overload def max( - __arg1: SupportsRichComparisonT, __arg2: SupportsRichComparisonT, *_args: SupportsRichComparisonT, key: None = ... + __arg1: SupportsRichComparisonT, __arg2: SupportsRichComparisonT, *_args: SupportsRichComparisonT, key: None = None ) -> SupportsRichComparisonT: ... @overload def max(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], SupportsRichComparison]) -> _T: ... @overload -def max(__iterable: Iterable[SupportsRichComparisonT], *, key: None = ...) -> SupportsRichComparisonT: ... +def max(__iterable: Iterable[SupportsRichComparisonT], *, key: None = None) -> SupportsRichComparisonT: ... @overload def max(__iterable: Iterable[_T], *, key: Callable[[_T], SupportsRichComparison]) -> _T: ... @overload -def max(__iterable: Iterable[SupportsRichComparisonT], *, key: None = ..., default: _T) -> SupportsRichComparisonT | _T: ... +def max(__iterable: Iterable[SupportsRichComparisonT], *, key: None = None, default: _T) -> SupportsRichComparisonT | _T: ... @overload def max(__iterable: Iterable[_T1], *, key: Callable[[_T1], SupportsRichComparison], default: _T2) -> _T1 | _T2: ... @overload def min( - __arg1: SupportsRichComparisonT, __arg2: SupportsRichComparisonT, *_args: SupportsRichComparisonT, key: None = ... + __arg1: SupportsRichComparisonT, __arg2: SupportsRichComparisonT, *_args: SupportsRichComparisonT, key: None = None ) -> SupportsRichComparisonT: ... @overload def min(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], SupportsRichComparison]) -> _T: ... @overload -def min(__iterable: Iterable[SupportsRichComparisonT], *, key: None = ...) -> SupportsRichComparisonT: ... +def min(__iterable: Iterable[SupportsRichComparisonT], *, key: None = None) -> SupportsRichComparisonT: ... @overload def min(__iterable: Iterable[_T], *, key: Callable[[_T], SupportsRichComparison]) -> _T: ... @overload -def min(__iterable: Iterable[SupportsRichComparisonT], *, key: None = ..., default: _T) -> SupportsRichComparisonT | _T: ... +def min(__iterable: Iterable[SupportsRichComparisonT], *, key: None = None, default: _T) -> SupportsRichComparisonT | _T: ... @overload def min(__iterable: Iterable[_T1], *, key: Callable[[_T1], SupportsRichComparison], default: _T2) -> _T1 | _T2: ... @overload @@ -1418,94 +1486,93 @@ def next(__i: SupportsNext[_T]) -> _T: ... def next(__i: SupportsNext[_T], __default: _VT) -> _T | _VT: ... def oct(__number: int | SupportsIndex) -> str: ... -_OpenFile = StrOrBytesPath | int # noqa: Y026 # TODO: Use TypeAlias once mypy bugs are fixed _Opener: TypeAlias = Callable[[str, int], int] # Text mode: always returns a TextIOWrapper @overload def open( - file: _OpenFile, - mode: OpenTextMode = ..., - buffering: int = ..., - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., - closefd: bool = ..., - opener: _Opener | None = ..., + file: FileDescriptorOrPath, + mode: OpenTextMode = "r", + buffering: int = -1, + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, + closefd: bool = True, + opener: _Opener | None = None, ) -> TextIOWrapper: ... # Unbuffered binary mode: returns a FileIO @overload def open( - file: _OpenFile, + file: FileDescriptorOrPath, mode: OpenBinaryMode, buffering: Literal[0], - encoding: None = ..., - errors: None = ..., - newline: None = ..., - closefd: bool = ..., - opener: _Opener | None = ..., + encoding: None = None, + errors: None = None, + newline: None = None, + closefd: bool = True, + opener: _Opener | None = None, ) -> FileIO: ... # Buffering is on: return BufferedRandom, BufferedReader, or BufferedWriter @overload def open( - file: _OpenFile, + file: FileDescriptorOrPath, mode: OpenBinaryModeUpdating, - buffering: Literal[-1, 1] = ..., - encoding: None = ..., - errors: None = ..., - newline: None = ..., - closefd: bool = ..., - opener: _Opener | None = ..., + buffering: Literal[-1, 1] = -1, + encoding: None = None, + errors: None = None, + newline: None = None, + closefd: bool = True, + opener: _Opener | None = None, ) -> BufferedRandom: ... @overload def open( - file: _OpenFile, + file: FileDescriptorOrPath, mode: OpenBinaryModeWriting, - buffering: Literal[-1, 1] = ..., - encoding: None = ..., - errors: None = ..., - newline: None = ..., - closefd: bool = ..., - opener: _Opener | None = ..., + buffering: Literal[-1, 1] = -1, + encoding: None = None, + errors: None = None, + newline: None = None, + closefd: bool = True, + opener: _Opener | None = None, ) -> BufferedWriter: ... @overload def open( - file: _OpenFile, + file: FileDescriptorOrPath, mode: OpenBinaryModeReading, - buffering: Literal[-1, 1] = ..., - encoding: None = ..., - errors: None = ..., - newline: None = ..., - closefd: bool = ..., - opener: _Opener | None = ..., + buffering: Literal[-1, 1] = -1, + encoding: None = None, + errors: None = None, + newline: None = None, + closefd: bool = True, + opener: _Opener | None = None, ) -> BufferedReader: ... # Buffering cannot be determined: fall back to BinaryIO @overload def open( - file: _OpenFile, + file: FileDescriptorOrPath, mode: OpenBinaryMode, - buffering: int = ..., - encoding: None = ..., - errors: None = ..., - newline: None = ..., - closefd: bool = ..., - opener: _Opener | None = ..., + buffering: int = -1, + encoding: None = None, + errors: None = None, + newline: None = None, + closefd: bool = True, + opener: _Opener | None = None, ) -> BinaryIO: ... # Fallback if mode is not specified @overload def open( - file: _OpenFile, + file: FileDescriptorOrPath, mode: str, - buffering: int = ..., - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., - closefd: bool = ..., - opener: _Opener | None = ..., + buffering: int = -1, + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, + closefd: bool = True, + opener: _Opener | None = None, ) -> IO[Any]: ... def ord(__c: str | bytes | bytearray) -> int: ... @@ -1515,14 +1582,14 @@ class _SupportsWriteAndFlush(SupportsWrite[_T_contra], Protocol[_T_contra]): @overload def print( *values: object, - sep: str | None = ..., - end: str | None = ..., - file: SupportsWrite[str] | None = ..., - flush: Literal[False] = ..., + sep: str | None = " ", + end: str | None = "\n", + file: SupportsWrite[str] | None = None, + flush: Literal[False] = False, ) -> None: ... @overload def print( - *values: object, sep: str | None = ..., end: str | None = ..., file: _SupportsWriteAndFlush[str] | None = ..., flush: bool + *values: object, sep: str | None = " ", end: str | None = "\n", file: _SupportsWriteAndFlush[str] | None = None, flush: bool ) -> None: ... _E = TypeVar("_E", contravariant=True) @@ -1532,7 +1599,7 @@ class _SupportsPow2(Protocol[_E, _T_co]): def __pow__(self, __other: _E) -> _T_co: ... class _SupportsPow3NoneOnly(Protocol[_E, _T_co]): - def __pow__(self, __other: _E, __modulo: None = ...) -> _T_co: ... + def __pow__(self, __other: _E, __modulo: None = None) -> _T_co: ... class _SupportsPow3(Protocol[_E, _M, _T_co]): def __pow__(self, __other: _E, __modulo: _M) -> _T_co: ... @@ -1542,106 +1609,113 @@ _SupportsSomeKindOfPow = ( # noqa: Y026 # TODO: Use TypeAlias once mypy bugs a ) if sys.version_info >= (3, 8): - @overload - def pow(base: int, exp: int, mod: Literal[0]) -> NoReturn: ... + # TODO: `pow(int, int, Literal[0])` fails at runtime, + # but adding a `NoReturn` overload isn't a good solution for expressing that (see #8566). @overload def pow(base: int, exp: int, mod: int) -> int: ... @overload - def pow(base: int, exp: Literal[0], mod: None = ...) -> Literal[1]: ... # type: ignore[misc] + def pow(base: int, exp: Literal[0], mod: None = None) -> Literal[1]: ... @overload - def pow(base: int, exp: _PositiveInteger, mod: None = ...) -> int: ... # type: ignore[misc] + def pow(base: int, exp: _PositiveInteger, mod: None = None) -> int: ... @overload - def pow(base: int, exp: _NegativeInteger, mod: None = ...) -> float: ... # type: ignore[misc] + def pow(base: int, exp: _NegativeInteger, mod: None = None) -> float: ... # int base & positive-int exp -> int; int base & negative-int exp -> float # return type must be Any as `int | float` causes too many false-positive errors @overload - def pow(base: int, exp: int, mod: None = ...) -> Any: ... + def pow(base: int, exp: int, mod: None = None) -> Any: ... @overload - def pow(base: _PositiveInteger, exp: float, mod: None = ...) -> float: ... + def pow(base: _PositiveInteger, exp: float, mod: None = None) -> float: ... @overload - def pow(base: _NegativeInteger, exp: float, mod: None = ...) -> complex: ... + def pow(base: _NegativeInteger, exp: float, mod: None = None) -> complex: ... @overload - def pow(base: float, exp: int, mod: None = ...) -> float: ... + def pow(base: float, exp: int, mod: None = None) -> float: ... # float base & float exp could return float or complex # return type must be Any (same as complex base, complex exp), # as `float | complex` causes too many false-positive errors @overload - def pow(base: float, exp: complex | _SupportsSomeKindOfPow, mod: None = ...) -> Any: ... + def pow(base: float, exp: complex | _SupportsSomeKindOfPow, mod: None = None) -> Any: ... @overload - def pow(base: complex, exp: complex | _SupportsSomeKindOfPow, mod: None = ...) -> complex: ... + def pow(base: complex, exp: complex | _SupportsSomeKindOfPow, mod: None = None) -> complex: ... @overload - def pow(base: _SupportsPow2[_E, _T_co], exp: _E, mod: None = ...) -> _T_co: ... + def pow(base: _SupportsPow2[_E, _T_co], exp: _E, mod: None = None) -> _T_co: ... @overload - def pow(base: _SupportsPow3NoneOnly[_E, _T_co], exp: _E, mod: None = ...) -> _T_co: ... + def pow(base: _SupportsPow3NoneOnly[_E, _T_co], exp: _E, mod: None = None) -> _T_co: ... @overload - def pow(base: _SupportsPow3[_E, _M, _T_co], exp: _E, mod: _M = ...) -> _T_co: ... + def pow(base: _SupportsPow3[_E, _M, _T_co], exp: _E, mod: _M) -> _T_co: ... @overload - def pow(base: _SupportsSomeKindOfPow, exp: float, mod: None = ...) -> Any: ... + def pow(base: _SupportsSomeKindOfPow, exp: float, mod: None = None) -> Any: ... @overload - def pow(base: _SupportsSomeKindOfPow, exp: complex, mod: None = ...) -> complex: ... + def pow(base: _SupportsSomeKindOfPow, exp: complex, mod: None = None) -> complex: ... else: @overload - def pow(__base: int, __exp: int, __mod: Literal[0]) -> NoReturn: ... + def pow(__x: int, __y: int, __z: int) -> int: ... @overload - def pow(__base: int, __exp: int, __mod: int) -> int: ... + def pow(__x: int, __y: Literal[0], __z: None = None) -> Literal[1]: ... @overload - def pow(__base: int, __exp: Literal[0], __mod: None = ...) -> Literal[1]: ... # type: ignore[misc] + def pow(__x: int, __y: _PositiveInteger, __z: None = None) -> int: ... @overload - def pow(__base: int, __exp: _PositiveInteger, __mod: None = ...) -> int: ... # type: ignore[misc] + def pow(__x: int, __y: _NegativeInteger, __z: None = None) -> float: ... @overload - def pow(__base: int, __exp: _NegativeInteger, __mod: None = ...) -> float: ... # type: ignore[misc] + def pow(__x: int, __y: int, __z: None = None) -> Any: ... @overload - def pow(__base: int, __exp: int, __mod: None = ...) -> Any: ... + def pow(__x: _PositiveInteger, __y: float, __z: None = None) -> float: ... @overload - def pow(__base: _PositiveInteger, __exp: float, __mod: None = ...) -> float: ... + def pow(__x: _NegativeInteger, __y: float, __z: None = None) -> complex: ... @overload - def pow(__base: _NegativeInteger, __exp: float, __mod: None = ...) -> complex: ... + def pow(__x: float, __y: int, __z: None = None) -> float: ... @overload - def pow(__base: float, __exp: int, __mod: None = ...) -> float: ... + def pow(__x: float, __y: complex | _SupportsSomeKindOfPow, __z: None = None) -> Any: ... @overload - def pow(__base: float, __exp: complex | _SupportsSomeKindOfPow, __mod: None = ...) -> Any: ... + def pow(__x: complex, __y: complex | _SupportsSomeKindOfPow, __z: None = None) -> complex: ... @overload - def pow(__base: complex, __exp: complex | _SupportsSomeKindOfPow, __mod: None = ...) -> complex: ... + def pow(__x: _SupportsPow2[_E, _T_co], __y: _E, __z: None = None) -> _T_co: ... @overload - def pow(__base: _SupportsPow2[_E, _T_co], __exp: _E, __mod: None = ...) -> _T_co: ... + def pow(__x: _SupportsPow3NoneOnly[_E, _T_co], __y: _E, __z: None = None) -> _T_co: ... @overload - def pow(__base: _SupportsPow3NoneOnly[_E, _T_co], __exp: _E, __mod: None = ...) -> _T_co: ... + def pow(__x: _SupportsPow3[_E, _M, _T_co], __y: _E, __z: _M) -> _T_co: ... @overload - def pow(__base: _SupportsPow3[_E, _M, _T_co], __exp: _E, __mod: _M = ...) -> _T_co: ... + def pow(__x: _SupportsSomeKindOfPow, __y: float, __z: None = None) -> Any: ... @overload - def pow(__base: _SupportsSomeKindOfPow, __exp: float, __mod: None = ...) -> Any: ... - @overload - def pow(__base: _SupportsSomeKindOfPow, __exp: complex, __mod: None = ...) -> complex: ... + def pow(__x: _SupportsSomeKindOfPow, __y: complex, __z: None = None) -> complex: ... -def quit(code: object = ...) -> NoReturn: ... +def quit(code: sys._ExitCode = None) -> NoReturn: ... class reversed(Iterator[_T], Generic[_T]): @overload def __init__(self, __sequence: Reversible[_T]) -> None: ... @overload def __init__(self, __sequence: SupportsLenAndGetItem[_T]) -> None: ... - def __iter__(self: Self) -> Self: ... + def __iter__(self) -> Self: ... def __next__(self) -> _T: ... def __length_hint__(self) -> int: ... def repr(__obj: object) -> str: ... + +# See https://github.com/python/typeshed/pull/9141 +# and https://github.com/python/typeshed/pull/9151 +# on why we don't use `SupportsRound` from `typing.pyi` + +class _SupportsRound1(Protocol[_T_co]): + def __round__(self) -> _T_co: ... + +class _SupportsRound2(Protocol[_T_co]): + def __round__(self, __ndigits: int) -> _T_co: ... + @overload -def round(number: SupportsRound[Any]) -> int: ... -@overload -def round(number: SupportsRound[Any], ndigits: None) -> int: ... +def round(number: _SupportsRound1[_T], ndigits: None = None) -> _T: ... @overload -def round(number: SupportsRound[_T], ndigits: SupportsIndex) -> _T: ... +def round(number: _SupportsRound2[_T], ndigits: SupportsIndex) -> _T: ... # See https://github.com/python/typeshed/pull/6292#discussion_r748875189 # for why arg 3 of `setattr` should be annotated with `Any` and not `object` def setattr(__obj: object, __name: str, __value: Any) -> None: ... @overload def sorted( - __iterable: Iterable[SupportsRichComparisonT], *, key: None = ..., reverse: bool = ... + __iterable: Iterable[SupportsRichComparisonT], *, key: None = None, reverse: bool = False ) -> list[SupportsRichComparisonT]: ... @overload -def sorted(__iterable: Iterable[_T], *, key: Callable[[_T], SupportsRichComparison], reverse: bool = ...) -> list[_T]: ... +def sorted(__iterable: Iterable[_T], *, key: Callable[[_T], SupportsRichComparison], reverse: bool = False) -> list[_T]: ... _AddableT1 = TypeVar("_AddableT1", bound=SupportsAdd[Any, Any]) _AddableT2 = TypeVar("_AddableT2", bound=SupportsAdd[Any, Any]) @@ -1656,11 +1730,11 @@ _SupportsSumNoDefaultT = TypeVar("_SupportsSumNoDefaultT", bound=_SupportsSumWit # Instead, we special-case the most common examples of this: bool and literal integers. if sys.version_info >= (3, 8): @overload - def sum(__iterable: Iterable[bool | _LiteralInteger], start: int = ...) -> int: ... # type: ignore[misc] + def sum(__iterable: Iterable[bool | _LiteralInteger], start: int = 0) -> int: ... # type: ignore[misc] else: @overload - def sum(__iterable: Iterable[bool | _LiteralInteger], __start: int = ...) -> int: ... # type: ignore[misc] + def sum(__iterable: Iterable[bool | _LiteralInteger], __start: int = 0) -> int: ... # type: ignore[misc] @overload def sum(__iterable: Iterable[_SupportsSumNoDefaultT]) -> _SupportsSumNoDefaultT | Literal[0]: ... @@ -1673,8 +1747,12 @@ else: @overload def sum(__iterable: Iterable[_AddableT1], __start: _AddableT2) -> _AddableT1 | _AddableT2: ... -# The argument to `vars()` has to have a `__dict__` attribute, so can't be annotated with `object` +# The argument to `vars()` has to have a `__dict__` attribute, so the second overload can't be annotated with `object` # (A "SupportsDunderDict" protocol doesn't work) +# Use a type: ignore to make complaints about overlapping overloads go away +@overload +def vars(__object: type) -> types.MappingProxyType[str, Any]: ... # type: ignore[misc] +@overload def vars(__object: Any = ...) -> dict[str, Any]: ... class zip(Iterator[_T_co], Generic[_T_co]): @@ -1752,23 +1830,24 @@ class zip(Iterator[_T_co], Generic[_T_co]): *iterables: Iterable[Any], ) -> zip[tuple[Any, ...]]: ... - def __iter__(self: Self) -> Self: ... + def __iter__(self) -> Self: ... def __next__(self) -> _T_co: ... # Signature of `builtins.__import__` should be kept identical to `importlib.__import__` # Return type of `__import__` should be kept the same as return type of `importlib.import_module` def __import__( name: str, - globals: Mapping[str, object] | None = ..., - locals: Mapping[str, object] | None = ..., + globals: Mapping[str, object] | None = None, + locals: Mapping[str, object] | None = None, fromlist: Sequence[str] = ..., - level: int = ..., + level: int = 0, ) -> types.ModuleType: ... def __build_class__(__func: Callable[[], _Cell | Any], __name: str, *bases: Any, metaclass: Any = ..., **kwds: Any) -> Any: ... # Actually the type of Ellipsis is , but since it's # not exposed anywhere under that name, we make it private here. @final +@type_check_only class ellipsis: ... Ellipsis: ellipsis @@ -1781,7 +1860,7 @@ class BaseException: __traceback__: TracebackType | None def __init__(self, *args: object) -> None: ... def __setstate__(self, __state: dict[str, Any] | None) -> None: ... - def with_traceback(self: Self, __tb: TracebackType | None) -> Self: ... + def with_traceback(self, __tb: TracebackType | None) -> Self: ... if sys.version_info >= (3, 11): # only present after add_note() is called __notes__: list[str] @@ -1791,15 +1870,13 @@ class GeneratorExit(BaseException): ... class KeyboardInterrupt(BaseException): ... class SystemExit(BaseException): - code: int + code: sys._ExitCode class Exception(BaseException): ... class StopIteration(Exception): value: Any -_StandardError = Exception - class OSError(Exception): errno: int strerror: str @@ -1814,37 +1891,38 @@ IOError = OSError if sys.platform == "win32": WindowsError = OSError -class ArithmeticError(_StandardError): ... -class AssertionError(_StandardError): ... +class ArithmeticError(Exception): ... +class AssertionError(Exception): ... -class AttributeError(_StandardError): +class AttributeError(Exception): if sys.version_info >= (3, 10): + def __init__(self, *args: object, name: str | None = ..., obj: object = ...) -> None: ... name: str obj: object -class BufferError(_StandardError): ... -class EOFError(_StandardError): ... +class BufferError(Exception): ... +class EOFError(Exception): ... -class ImportError(_StandardError): +class ImportError(Exception): def __init__(self, *args: object, name: str | None = ..., path: str | None = ...) -> None: ... name: str | None path: str | None msg: str # undocumented -class LookupError(_StandardError): ... -class MemoryError(_StandardError): ... +class LookupError(Exception): ... +class MemoryError(Exception): ... -class NameError(_StandardError): +class NameError(Exception): if sys.version_info >= (3, 10): name: str -class ReferenceError(_StandardError): ... -class RuntimeError(_StandardError): ... +class ReferenceError(Exception): ... +class RuntimeError(Exception): ... class StopAsyncIteration(Exception): value: Any -class SyntaxError(_StandardError): +class SyntaxError(Exception): msg: str lineno: int | None offset: int | None @@ -1854,9 +1932,9 @@ class SyntaxError(_StandardError): end_lineno: int | None end_offset: int | None -class SystemError(_StandardError): ... -class TypeError(_StandardError): ... -class ValueError(_StandardError): ... +class SystemError(Exception): ... +class TypeError(Exception): ... +class ValueError(Exception): ... class FloatingPointError(ArithmeticError): ... class OverflowError(ArithmeticError): ... class ZeroDivisionError(ArithmeticError): ... @@ -1933,29 +2011,48 @@ if sys.version_info >= (3, 11): _ExceptionT_co = TypeVar("_ExceptionT_co", bound=Exception, covariant=True) _ExceptionT = TypeVar("_ExceptionT", bound=Exception) + # See `check_exception_group.py` for use-cases and comments. class BaseExceptionGroup(BaseException, Generic[_BaseExceptionT_co]): - def __new__(cls: type[Self], __message: str, __exceptions: Sequence[_BaseExceptionT_co]) -> Self: ... + def __new__(cls, __message: str, __exceptions: Sequence[_BaseExceptionT_co]) -> Self: ... + def __init__(self, __message: str, __exceptions: Sequence[_BaseExceptionT_co]) -> None: ... @property def message(self) -> str: ... @property def exceptions(self) -> tuple[_BaseExceptionT_co | BaseExceptionGroup[_BaseExceptionT_co], ...]: ... @overload + def subgroup( + self, __condition: type[_ExceptionT] | tuple[type[_ExceptionT], ...] + ) -> ExceptionGroup[_ExceptionT] | None: ... + @overload def subgroup( self, __condition: type[_BaseExceptionT] | tuple[type[_BaseExceptionT], ...] ) -> BaseExceptionGroup[_BaseExceptionT] | None: ... @overload - def subgroup(self: Self, __condition: Callable[[_BaseExceptionT_co], bool]) -> Self | None: ... + def subgroup( + self, __condition: Callable[[_BaseExceptionT_co | Self], bool] + ) -> BaseExceptionGroup[_BaseExceptionT_co] | None: ... @overload def split( - self: Self, __condition: type[_BaseExceptionT] | tuple[type[_BaseExceptionT], ...] - ) -> tuple[BaseExceptionGroup[_BaseExceptionT] | None, Self | None]: ... + self, __condition: type[_ExceptionT] | tuple[type[_ExceptionT], ...] + ) -> tuple[ExceptionGroup[_ExceptionT] | None, BaseExceptionGroup[_BaseExceptionT_co] | None]: ... @overload - def split(self: Self, __condition: Callable[[_BaseExceptionT_co], bool]) -> tuple[Self | None, Self | None]: ... - def derive(self: Self, __excs: Sequence[_BaseExceptionT_co]) -> Self: ... + def split( + self, __condition: type[_BaseExceptionT] | tuple[type[_BaseExceptionT], ...] + ) -> tuple[BaseExceptionGroup[_BaseExceptionT] | None, BaseExceptionGroup[_BaseExceptionT_co] | None]: ... + @overload + def split( + self, __condition: Callable[[_BaseExceptionT_co | Self], bool] + ) -> tuple[BaseExceptionGroup[_BaseExceptionT_co] | None, BaseExceptionGroup[_BaseExceptionT_co] | None]: ... + # In reality it is `NonEmptySequence`: + @overload + def derive(self, __excs: Sequence[_ExceptionT]) -> ExceptionGroup[_ExceptionT]: ... + @overload + def derive(self, __excs: Sequence[_BaseExceptionT]) -> BaseExceptionGroup[_BaseExceptionT]: ... def __class_getitem__(cls, __item: Any) -> GenericAlias: ... class ExceptionGroup(BaseExceptionGroup[_ExceptionT_co], Exception): - def __new__(cls: type[Self], __message: str, __exceptions: Sequence[_ExceptionT_co]) -> Self: ... + def __new__(cls, __message: str, __exceptions: Sequence[_ExceptionT_co]) -> Self: ... + def __init__(self, __message: str, __exceptions: Sequence[_ExceptionT_co]) -> None: ... @property def exceptions(self) -> tuple[_ExceptionT_co | ExceptionGroup[_ExceptionT_co], ...]: ... # We accept a narrower type, but that's OK. @@ -1964,10 +2061,12 @@ if sys.version_info >= (3, 11): self, __condition: type[_ExceptionT] | tuple[type[_ExceptionT], ...] ) -> ExceptionGroup[_ExceptionT] | None: ... @overload - def subgroup(self: Self, __condition: Callable[[_ExceptionT_co], bool]) -> Self | None: ... + def subgroup(self, __condition: Callable[[_ExceptionT_co | Self], bool]) -> ExceptionGroup[_ExceptionT_co] | None: ... @overload # type: ignore[override] def split( - self: Self, __condition: type[_ExceptionT] | tuple[type[_ExceptionT], ...] - ) -> tuple[ExceptionGroup[_ExceptionT] | None, Self | None]: ... + self, __condition: type[_ExceptionT] | tuple[type[_ExceptionT], ...] + ) -> tuple[ExceptionGroup[_ExceptionT] | None, ExceptionGroup[_ExceptionT_co] | None]: ... @overload - def split(self: Self, __condition: Callable[[_ExceptionT_co], bool]) -> tuple[Self | None, Self | None]: ... + def split( + self, __condition: Callable[[_ExceptionT_co | Self], bool] + ) -> tuple[ExceptionGroup[_ExceptionT_co] | None, ExceptionGroup[_ExceptionT_co] | None]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/bz2.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/bz2.pyi index cea317e28..9ad80ee6f 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/bz2.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/bz2.pyi @@ -1,10 +1,10 @@ import _compression import sys from _compression import BaseStream -from _typeshed import ReadableBuffer, Self, StrOrBytesPath, WriteableBuffer +from _typeshed import ReadableBuffer, StrOrBytesPath, WriteableBuffer from collections.abc import Iterable from typing import IO, Any, Protocol, TextIO, overload -from typing_extensions import Literal, SupportsIndex, TypeAlias, final +from typing_extensions import Literal, Self, SupportsIndex, TypeAlias, final __all__ = ["BZ2File", "BZ2Compressor", "BZ2Decompressor", "open", "compress", "decompress"] @@ -19,8 +19,8 @@ class _WritableFileobj(Protocol): # def fileno(self) -> int: ... # def close(self) -> object: ... -def compress(data: bytes, compresslevel: int = ...) -> bytes: ... -def decompress(data: bytes) -> bytes: ... +def compress(data: ReadableBuffer, compresslevel: int = 9) -> bytes: ... +def decompress(data: ReadableBuffer) -> bytes: ... _ReadBinaryMode: TypeAlias = Literal["", "r", "rb"] _WriteBinaryMode: TypeAlias = Literal["w", "wb", "x", "xb", "a", "ab"] @@ -30,114 +30,114 @@ _WriteTextMode: TypeAlias = Literal["wt", "xt", "at"] @overload def open( filename: _ReadableFileobj, - mode: _ReadBinaryMode = ..., - compresslevel: int = ..., - encoding: None = ..., - errors: None = ..., - newline: None = ..., + mode: _ReadBinaryMode = "rb", + compresslevel: int = 9, + encoding: None = None, + errors: None = None, + newline: None = None, ) -> BZ2File: ... @overload def open( filename: _ReadableFileobj, mode: _ReadTextMode, - compresslevel: int = ..., - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., + compresslevel: int = 9, + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, ) -> TextIO: ... @overload def open( filename: _WritableFileobj, mode: _WriteBinaryMode, - compresslevel: int = ..., - encoding: None = ..., - errors: None = ..., - newline: None = ..., + compresslevel: int = 9, + encoding: None = None, + errors: None = None, + newline: None = None, ) -> BZ2File: ... @overload def open( filename: _WritableFileobj, mode: _WriteTextMode, - compresslevel: int = ..., - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., + compresslevel: int = 9, + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, ) -> TextIO: ... @overload def open( filename: StrOrBytesPath, - mode: _ReadBinaryMode | _WriteBinaryMode = ..., - compresslevel: int = ..., - encoding: None = ..., - errors: None = ..., - newline: None = ..., + mode: _ReadBinaryMode | _WriteBinaryMode = "rb", + compresslevel: int = 9, + encoding: None = None, + errors: None = None, + newline: None = None, ) -> BZ2File: ... @overload def open( filename: StrOrBytesPath, mode: _ReadTextMode | _WriteTextMode, - compresslevel: int = ..., - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., + compresslevel: int = 9, + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, ) -> TextIO: ... @overload def open( filename: StrOrBytesPath | _ReadableFileobj | _WritableFileobj, mode: str, - compresslevel: int = ..., - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., + compresslevel: int = 9, + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, ) -> BZ2File | TextIO: ... class BZ2File(BaseStream, IO[bytes]): - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... if sys.version_info >= (3, 9): @overload - def __init__(self, filename: _WritableFileobj, mode: _WriteBinaryMode, *, compresslevel: int = ...) -> None: ... + def __init__(self, filename: _WritableFileobj, mode: _WriteBinaryMode, *, compresslevel: int = 9) -> None: ... @overload - def __init__(self, filename: _ReadableFileobj, mode: _ReadBinaryMode = ..., *, compresslevel: int = ...) -> None: ... + def __init__(self, filename: _ReadableFileobj, mode: _ReadBinaryMode = "r", *, compresslevel: int = 9) -> None: ... @overload def __init__( - self, filename: StrOrBytesPath, mode: _ReadBinaryMode | _WriteBinaryMode = ..., *, compresslevel: int = ... + self, filename: StrOrBytesPath, mode: _ReadBinaryMode | _WriteBinaryMode = "r", *, compresslevel: int = 9 ) -> None: ... else: @overload def __init__( - self, filename: _WritableFileobj, mode: _WriteBinaryMode, buffering: Any | None = ..., compresslevel: int = ... + self, filename: _WritableFileobj, mode: _WriteBinaryMode, buffering: Any | None = None, compresslevel: int = 9 ) -> None: ... @overload def __init__( - self, filename: _ReadableFileobj, mode: _ReadBinaryMode = ..., buffering: Any | None = ..., compresslevel: int = ... + self, filename: _ReadableFileobj, mode: _ReadBinaryMode = "r", buffering: Any | None = None, compresslevel: int = 9 ) -> None: ... @overload def __init__( self, filename: StrOrBytesPath, - mode: _ReadBinaryMode | _WriteBinaryMode = ..., - buffering: Any | None = ..., - compresslevel: int = ..., + mode: _ReadBinaryMode | _WriteBinaryMode = "r", + buffering: Any | None = None, + compresslevel: int = 9, ) -> None: ... - def read(self, size: int | None = ...) -> bytes: ... - def read1(self, size: int = ...) -> bytes: ... - def readline(self, size: SupportsIndex = ...) -> bytes: ... # type: ignore[override] + def read(self, size: int | None = -1) -> bytes: ... + def read1(self, size: int = -1) -> bytes: ... + def readline(self, size: SupportsIndex = -1) -> bytes: ... # type: ignore[override] def readinto(self, b: WriteableBuffer) -> int: ... - def readlines(self, size: SupportsIndex = ...) -> list[bytes]: ... - def seek(self, offset: int, whence: int = ...) -> int: ... + def readlines(self, size: SupportsIndex = -1) -> list[bytes]: ... + def seek(self, offset: int, whence: int = 0) -> int: ... def write(self, data: ReadableBuffer) -> int: ... def writelines(self, seq: Iterable[ReadableBuffer]) -> None: ... @final class BZ2Compressor: def __init__(self, compresslevel: int = ...) -> None: ... - def compress(self, __data: bytes) -> bytes: ... + def compress(self, __data: ReadableBuffer) -> bytes: ... def flush(self) -> bytes: ... @final class BZ2Decompressor: - def decompress(self, data: bytes, max_length: int = ...) -> bytes: ... + def decompress(self, data: ReadableBuffer, max_length: int = -1) -> bytes: ... @property def eof(self) -> bool: ... @property diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/cProfile.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/cProfile.pyi index 6e21fc92a..8945b2142 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/cProfile.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/cProfile.pyi @@ -1,15 +1,15 @@ import sys -from _typeshed import Self, StrOrBytesPath +from _typeshed import StrOrBytesPath, Unused from collections.abc import Callable from types import CodeType from typing import Any, TypeVar -from typing_extensions import ParamSpec, TypeAlias +from typing_extensions import ParamSpec, Self, TypeAlias __all__ = ["run", "runctx", "Profile"] -def run(statement: str, filename: str | None = ..., sort: str | int = ...) -> None: ... +def run(statement: str, filename: str | None = None, sort: str | int = -1) -> None: ... def runctx( - statement: str, globals: dict[str, Any], locals: dict[str, Any], filename: str | None = ..., sort: str | int = ... + statement: str, globals: dict[str, Any], locals: dict[str, Any], filename: str | None = None, sort: str | int = -1 ) -> None: ... _T = TypeVar("_T") @@ -23,15 +23,15 @@ class Profile: ) -> None: ... def enable(self) -> None: ... def disable(self) -> None: ... - def print_stats(self, sort: str | int = ...) -> None: ... + def print_stats(self, sort: str | int = -1) -> None: ... def dump_stats(self, file: StrOrBytesPath) -> None: ... def create_stats(self) -> None: ... def snapshot_stats(self) -> None: ... - def run(self: Self, cmd: str) -> Self: ... - def runctx(self: Self, cmd: str, globals: dict[str, Any], locals: dict[str, Any]) -> Self: ... + def run(self, cmd: str) -> Self: ... + def runctx(self, cmd: str, globals: dict[str, Any], locals: dict[str, Any]) -> Self: ... def runcall(self, __func: Callable[_P, _T], *args: _P.args, **kw: _P.kwargs) -> _T: ... if sys.version_info >= (3, 8): - def __enter__(self: Self) -> Self: ... - def __exit__(self, *exc_info: object) -> None: ... + def __enter__(self) -> Self: ... + def __exit__(self, *exc_info: Unused) -> None: ... def label(code: str | CodeType) -> _Label: ... # undocumented diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/calendar.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/calendar.pyi index 4faee8053..255a12d33 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/calendar.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/calendar.pyi @@ -1,7 +1,9 @@ import datetime import sys +from _typeshed import Unused from collections.abc import Iterable, Sequence from time import struct_time +from typing import ClassVar from typing_extensions import Literal, TypeAlias __all__ = [ @@ -49,7 +51,7 @@ def monthrange(year: int, month: int) -> tuple[int, int]: ... class Calendar: firstweekday: int - def __init__(self, firstweekday: int = ...) -> None: ... + def __init__(self, firstweekday: int = 0) -> None: ... def getfirstweekday(self) -> int: ... def setfirstweekday(self, firstweekday: int) -> None: ... def iterweekdays(self) -> Iterable[int]: ... @@ -59,9 +61,9 @@ class Calendar: def monthdatescalendar(self, year: int, month: int) -> list[list[datetime.date]]: ... def monthdays2calendar(self, year: int, month: int) -> list[list[tuple[int, int]]]: ... def monthdayscalendar(self, year: int, month: int) -> list[list[int]]: ... - def yeardatescalendar(self, year: int, width: int = ...) -> list[list[int]]: ... - def yeardays2calendar(self, year: int, width: int = ...) -> list[list[tuple[int, int]]]: ... - def yeardayscalendar(self, year: int, width: int = ...) -> list[list[int]]: ... + def yeardatescalendar(self, year: int, width: int = 3) -> list[list[int]]: ... + def yeardays2calendar(self, year: int, width: int = 3) -> list[list[tuple[int, int]]]: ... + def yeardayscalendar(self, year: int, width: int = 3) -> list[list[int]]: ... def itermonthdays3(self, year: int, month: int) -> Iterable[tuple[int, int, int]]: ... def itermonthdays4(self, year: int, month: int) -> Iterable[tuple[int, int, int, int]]: ... @@ -71,59 +73,59 @@ class TextCalendar(Calendar): def formatweek(self, theweek: int, width: int) -> str: ... def formatweekday(self, day: int, width: int) -> str: ... def formatweekheader(self, width: int) -> str: ... - def formatmonthname(self, theyear: int, themonth: int, width: int, withyear: bool = ...) -> str: ... - def prmonth(self, theyear: int, themonth: int, w: int = ..., l: int = ...) -> None: ... - def formatmonth(self, theyear: int, themonth: int, w: int = ..., l: int = ...) -> str: ... - def formatyear(self, theyear: int, w: int = ..., l: int = ..., c: int = ..., m: int = ...) -> str: ... - def pryear(self, theyear: int, w: int = ..., l: int = ..., c: int = ..., m: int = ...) -> None: ... + def formatmonthname(self, theyear: int, themonth: int, width: int, withyear: bool = True) -> str: ... + def prmonth(self, theyear: int, themonth: int, w: int = 0, l: int = 0) -> None: ... + def formatmonth(self, theyear: int, themonth: int, w: int = 0, l: int = 0) -> str: ... + def formatyear(self, theyear: int, w: int = 2, l: int = 1, c: int = 6, m: int = 3) -> str: ... + def pryear(self, theyear: int, w: int = 0, l: int = 0, c: int = 6, m: int = 3) -> None: ... def firstweekday() -> int: ... def monthcalendar(year: int, month: int) -> list[list[int]]: ... def prweek(theweek: int, width: int) -> None: ... def week(theweek: int, width: int) -> str: ... def weekheader(width: int) -> str: ... -def prmonth(theyear: int, themonth: int, w: int = ..., l: int = ...) -> None: ... -def month(theyear: int, themonth: int, w: int = ..., l: int = ...) -> str: ... -def calendar(theyear: int, w: int = ..., l: int = ..., c: int = ..., m: int = ...) -> str: ... -def prcal(theyear: int, w: int = ..., l: int = ..., c: int = ..., m: int = ...) -> None: ... +def prmonth(theyear: int, themonth: int, w: int = 0, l: int = 0) -> None: ... +def month(theyear: int, themonth: int, w: int = 0, l: int = 0) -> str: ... +def calendar(theyear: int, w: int = 2, l: int = 1, c: int = 6, m: int = 3) -> str: ... +def prcal(theyear: int, w: int = 0, l: int = 0, c: int = 6, m: int = 3) -> None: ... class HTMLCalendar(Calendar): + cssclasses: ClassVar[list[str]] + cssclass_noday: ClassVar[str] + cssclasses_weekday_head: ClassVar[list[str]] + cssclass_month_head: ClassVar[str] + cssclass_month: ClassVar[str] + cssclass_year: ClassVar[str] + cssclass_year_head: ClassVar[str] def formatday(self, day: int, weekday: int) -> str: ... def formatweek(self, theweek: int) -> str: ... def formatweekday(self, day: int) -> str: ... def formatweekheader(self) -> str: ... - def formatmonthname(self, theyear: int, themonth: int, withyear: bool = ...) -> str: ... - def formatmonth(self, theyear: int, themonth: int, withyear: bool = ...) -> str: ... - def formatyear(self, theyear: int, width: int = ...) -> str: ... - def formatyearpage(self, theyear: int, width: int = ..., css: str | None = ..., encoding: str | None = ...) -> str: ... - cssclasses: list[str] - cssclass_noday: str - cssclasses_weekday_head: list[str] - cssclass_month_head: str - cssclass_month: str - cssclass_year: str - cssclass_year_head: str + def formatmonthname(self, theyear: int, themonth: int, withyear: bool = True) -> str: ... + def formatmonth(self, theyear: int, themonth: int, withyear: bool = True) -> str: ... + def formatyear(self, theyear: int, width: int = 3) -> str: ... + def formatyearpage( + self, theyear: int, width: int = 3, css: str | None = "calendar.css", encoding: str | None = None + ) -> str: ... class different_locale: def __init__(self, locale: _LocaleType) -> None: ... def __enter__(self) -> None: ... - def __exit__(self, *args: object) -> None: ... + def __exit__(self, *args: Unused) -> None: ... class LocaleTextCalendar(TextCalendar): - def __init__(self, firstweekday: int = ..., locale: _LocaleType | None = ...) -> None: ... - def formatweekday(self, day: int, width: int) -> str: ... - def formatmonthname(self, theyear: int, themonth: int, width: int, withyear: bool = ...) -> str: ... + def __init__(self, firstweekday: int = 0, locale: _LocaleType | None = None) -> None: ... class LocaleHTMLCalendar(HTMLCalendar): - def __init__(self, firstweekday: int = ..., locale: _LocaleType | None = ...) -> None: ... + def __init__(self, firstweekday: int = 0, locale: _LocaleType | None = None) -> None: ... def formatweekday(self, day: int) -> str: ... - def formatmonthname(self, theyear: int, themonth: int, withyear: bool = ...) -> str: ... + def formatmonthname(self, theyear: int, themonth: int, withyear: bool = True) -> str: ... c: TextCalendar def setfirstweekday(firstweekday: int) -> None: ... -def format(cols: int, colwidth: int = ..., spacing: int = ...) -> str: ... -def formatstring(cols: int, colwidth: int = ..., spacing: int = ...) -> str: ... +def format(cols: int, colwidth: int = 20, spacing: int = 6) -> str: ... +def formatstring(cols: int, colwidth: int = 20, spacing: int = 6) -> str: ... def timegm(tuple: tuple[int, ...] | struct_time) -> int: ... # Data attributes diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/cgi.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/cgi.pyi index 523b44793..a2acfa92d 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/cgi.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/cgi.pyi @@ -1,9 +1,11 @@ import sys -from _typeshed import Self, SupportsGetItem, SupportsItemAccess +from _typeshed import SupportsGetItem, SupportsItemAccess, Unused from builtins import list as _list, type as _type from collections.abc import Iterable, Iterator, Mapping +from email.message import Message from types import TracebackType from typing import IO, Any, Protocol +from typing_extensions import Self __all__ = [ "MiniFieldStorage", @@ -24,11 +26,11 @@ if sys.version_info < (3, 8): __all__ += ["parse_qs", "parse_qsl", "escape"] def parse( - fp: IO[Any] | None = ..., + fp: IO[Any] | None = None, environ: SupportsItemAccess[str, str] = ..., keep_blank_values: bool = ..., strict_parsing: bool = ..., - separator: str = ..., + separator: str = "&", ) -> dict[str, list[str]]: ... if sys.version_info < (3, 8): @@ -36,7 +38,7 @@ if sys.version_info < (3, 8): def parse_qsl(qs: str, keep_blank_values: bool = ..., strict_parsing: bool = ...) -> list[tuple[str, str]]: ... def parse_multipart( - fp: IO[Any], pdict: SupportsGetItem[str, bytes], encoding: str = ..., errors: str = ..., separator: str = ... + fp: IO[Any], pdict: SupportsGetItem[str, bytes], encoding: str = "utf-8", errors: str = "replace", separator: str = "&" ) -> dict[str, list[Any]]: ... class _Environ(Protocol): @@ -51,7 +53,7 @@ def print_directory() -> None: ... def print_environ_usage() -> None: ... if sys.version_info < (3, 8): - def escape(s: str, quote: bool | None = ...) -> str: ... + def escape(s: str, quote: bool | None = None) -> str: ... class MiniFieldStorage: # The first five "Any" attributes here are always None, but mypy doesn't support that @@ -72,7 +74,7 @@ class FieldStorage: keep_blank_values: int strict_parsing: int qs_on_post: str | None - headers: Mapping[str, str] + headers: Mapping[str, str] | Message fp: IO[bytes] encoding: str errors: str @@ -92,24 +94,24 @@ class FieldStorage: value: None | bytes | _list[Any] def __init__( self, - fp: IO[Any] | None = ..., - headers: Mapping[str, str] | None = ..., - outerboundary: bytes = ..., + fp: IO[Any] | None = None, + headers: Mapping[str, str] | Message | None = None, + outerboundary: bytes = b"", environ: SupportsGetItem[str, str] = ..., - keep_blank_values: int = ..., - strict_parsing: int = ..., - limit: int | None = ..., - encoding: str = ..., - errors: str = ..., - max_num_fields: int | None = ..., - separator: str = ..., + keep_blank_values: int = 0, + strict_parsing: int = 0, + limit: int | None = None, + encoding: str = "utf-8", + errors: str = "replace", + max_num_fields: int | None = None, + separator: str = "&", ) -> None: ... - def __enter__(self: Self) -> Self: ... - def __exit__(self, *args: object) -> None: ... + def __enter__(self) -> Self: ... + def __exit__(self, *args: Unused) -> None: ... def __iter__(self) -> Iterator[str]: ... def __getitem__(self, key: str) -> Any: ... - def getvalue(self, key: str, default: Any = ...) -> Any: ... - def getfirst(self, key: str, default: Any = ...) -> Any: ... + def getvalue(self, key: str, default: Any = None) -> Any: ... + def getfirst(self, key: str, default: Any = None) -> Any: ... def getlist(self, key: str) -> _list[Any]: ... def keys(self) -> _list[str]: ... def __contains__(self, key: str) -> bool: ... @@ -119,9 +121,9 @@ class FieldStorage: def make_file(self) -> IO[Any]: ... def print_exception( - type: type[BaseException] | None = ..., - value: BaseException | None = ..., - tb: TracebackType | None = ..., - limit: int | None = ..., + type: type[BaseException] | None = None, + value: BaseException | None = None, + tb: TracebackType | None = None, + limit: int | None = None, ) -> None: ... def print_arguments() -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/cgitb.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/cgitb.pyi index ea5a8341b..4c315bf6c 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/cgitb.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/cgitb.pyi @@ -2,8 +2,9 @@ from _typeshed import OptExcInfo, StrOrBytesPath from collections.abc import Callable from types import FrameType, TracebackType from typing import IO, Any +from typing_extensions import Final -__UNDEF__: object # undocumented sentinel +__UNDEF__: Final[object] # undocumented sentinel def reset() -> str: ... # undocumented def small(text: str) -> str: ... # undocumented @@ -13,20 +14,20 @@ def lookup(name: str, frame: FrameType, locals: dict[str, Any]) -> tuple[str | N def scanvars( reader: Callable[[], bytes], frame: FrameType, locals: dict[str, Any] ) -> list[tuple[str, str | None, Any]]: ... # undocumented -def html(einfo: OptExcInfo, context: int = ...) -> str: ... -def text(einfo: OptExcInfo, context: int = ...) -> str: ... +def html(einfo: OptExcInfo, context: int = 5) -> str: ... +def text(einfo: OptExcInfo, context: int = 5) -> str: ... class Hook: # undocumented def __init__( self, - display: int = ..., - logdir: StrOrBytesPath | None = ..., - context: int = ..., - file: IO[str] | None = ..., - format: str = ..., + display: int = 1, + logdir: StrOrBytesPath | None = None, + context: int = 5, + file: IO[str] | None = None, + format: str = "html", ) -> None: ... def __call__(self, etype: type[BaseException] | None, evalue: BaseException | None, etb: TracebackType | None) -> None: ... - def handle(self, info: OptExcInfo | None = ...) -> None: ... + def handle(self, info: OptExcInfo | None = None) -> None: ... -def handler(info: OptExcInfo | None = ...) -> None: ... -def enable(display: int = ..., logdir: StrOrBytesPath | None = ..., context: int = ..., format: str = ...) -> None: ... +def handler(info: OptExcInfo | None = None) -> None: ... +def enable(display: int = 1, logdir: StrOrBytesPath | None = None, context: int = 5, format: str = "html") -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/chunk.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/chunk.pyi index 50ff267c5..9788d35f6 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/chunk.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/chunk.pyi @@ -9,12 +9,12 @@ class Chunk: size_read: int offset: int seekable: bool - def __init__(self, file: IO[bytes], align: bool = ..., bigendian: bool = ..., inclheader: bool = ...) -> None: ... + def __init__(self, file: IO[bytes], align: bool = True, bigendian: bool = True, inclheader: bool = False) -> None: ... def getname(self) -> bytes: ... def getsize(self) -> int: ... def close(self) -> None: ... def isatty(self) -> bool: ... - def seek(self, pos: int, whence: int = ...) -> None: ... + def seek(self, pos: int, whence: int = 0) -> None: ... def tell(self) -> int: ... - def read(self, size: int = ...) -> bytes: ... + def read(self, size: int = -1) -> bytes: ... def skip(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/cmath.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/cmath.pyi index 30ada5d5b..0a85600e9 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/cmath.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/cmath.pyi @@ -27,7 +27,7 @@ def atanh(__z: _C) -> complex: ... def cos(__z: _C) -> complex: ... def cosh(__z: _C) -> complex: ... def exp(__z: _C) -> complex: ... -def isclose(a: _C, b: _C, *, rel_tol: SupportsFloat = ..., abs_tol: SupportsFloat = ...) -> bool: ... +def isclose(a: _C, b: _C, *, rel_tol: SupportsFloat = 1e-09, abs_tol: SupportsFloat = 0.0) -> bool: ... def isinf(__z: _C) -> bool: ... def isnan(__z: _C) -> bool: ... def log(__x: _C, __y_obj: _C = ...) -> complex: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/cmd.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/cmd.pyi index ddefff2ed..b658a8734 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/cmd.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/cmd.pyi @@ -23,9 +23,9 @@ class Cmd: stdout: IO[str] cmdqueue: list[str] completekey: str - def __init__(self, completekey: str = ..., stdin: IO[str] | None = ..., stdout: IO[str] | None = ...) -> None: ... + def __init__(self, completekey: str = "tab", stdin: IO[str] | None = None, stdout: IO[str] | None = None) -> None: ... old_completer: Callable[[str, int], str | None] | None - def cmdloop(self, intro: Any | None = ...) -> None: ... + def cmdloop(self, intro: Any | None = None) -> None: ... def precmd(self, line: str) -> str: ... def postcmd(self, stop: bool, line: str) -> bool: ... def preloop(self) -> None: ... @@ -43,4 +43,4 @@ class Cmd: def complete_help(self, *args: Any) -> list[str]: ... def do_help(self, arg: str) -> bool | None: ... def print_topics(self, header: str, cmds: list[str] | None, cmdlen: Any, maxcol: int) -> None: ... - def columnize(self, list: list[str] | None, displaywidth: int = ...) -> None: ... + def columnize(self, list: list[str] | None, displaywidth: int = 80) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/code.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/code.pyi index 59318aa35..4715bd866 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/code.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/code.pyi @@ -8,26 +8,26 @@ __all__ = ["InteractiveInterpreter", "InteractiveConsole", "interact", "compile_ class InteractiveInterpreter: locals: Mapping[str, Any] # undocumented compile: CommandCompiler # undocumented - def __init__(self, locals: Mapping[str, Any] | None = ...) -> None: ... - def runsource(self, source: str, filename: str = ..., symbol: str = ...) -> bool: ... + def __init__(self, locals: Mapping[str, Any] | None = None) -> None: ... + def runsource(self, source: str, filename: str = "", symbol: str = "single") -> bool: ... def runcode(self, code: CodeType) -> None: ... - def showsyntaxerror(self, filename: str | None = ...) -> None: ... + def showsyntaxerror(self, filename: str | None = None) -> None: ... def showtraceback(self) -> None: ... def write(self, data: str) -> None: ... class InteractiveConsole(InteractiveInterpreter): buffer: list[str] # undocumented filename: str # undocumented - def __init__(self, locals: Mapping[str, Any] | None = ..., filename: str = ...) -> None: ... - def interact(self, banner: str | None = ..., exitmsg: str | None = ...) -> None: ... + def __init__(self, locals: Mapping[str, Any] | None = None, filename: str = "") -> None: ... + def interact(self, banner: str | None = None, exitmsg: str | None = None) -> None: ... def push(self, line: str) -> bool: ... def resetbuffer(self) -> None: ... - def raw_input(self, prompt: str = ...) -> str: ... + def raw_input(self, prompt: str = "") -> str: ... def interact( - banner: str | None = ..., - readfunc: Callable[[str], str] | None = ..., - local: Mapping[str, Any] | None = ..., - exitmsg: str | None = ..., + banner: str | None = None, + readfunc: Callable[[str], str] | None = None, + local: Mapping[str, Any] | None = None, + exitmsg: str | None = None, ) -> None: ... -def compile_command(source: str, filename: str = ..., symbol: str = ...) -> CodeType | None: ... +def compile_command(source: str, filename: str = "", symbol: str = "single") -> CodeType | None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/codecs.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/codecs.pyi index a7b60e38d..3f6d2d3d1 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/codecs.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/codecs.pyi @@ -1,11 +1,11 @@ +import sys import types -from _typeshed import Self +from _codecs import * +from _typeshed import ReadableBuffer from abc import abstractmethod from collections.abc import Callable, Generator, Iterable from typing import Any, BinaryIO, Protocol, TextIO -from typing_extensions import Literal - -from _codecs import * +from typing_extensions import Literal, Self __all__ = [ "register", @@ -110,16 +110,16 @@ class CodecInfo(tuple[_Encoder, _Decoder, _StreamReader, _StreamWriter]): def incrementaldecoder(self) -> _IncrementalDecoder: ... name: str def __new__( - cls: type[Self], + cls, encode: _Encoder, decode: _Decoder, - streamreader: _StreamReader | None = ..., - streamwriter: _StreamWriter | None = ..., - incrementalencoder: _IncrementalEncoder | None = ..., - incrementaldecoder: _IncrementalDecoder | None = ..., - name: str | None = ..., + streamreader: _StreamReader | None = None, + streamwriter: _StreamWriter | None = None, + incrementalencoder: _IncrementalEncoder | None = None, + incrementaldecoder: _IncrementalDecoder | None = None, + name: str | None = None, *, - _is_text_encoding: bool | None = ..., + _is_text_encoding: bool | None = None, ) -> Self: ... def getencoder(encoding: str) -> _Encoder: ... @@ -128,12 +128,20 @@ def getincrementalencoder(encoding: str) -> _IncrementalEncoder: ... def getincrementaldecoder(encoding: str) -> _IncrementalDecoder: ... def getreader(encoding: str) -> _StreamReader: ... def getwriter(encoding: str) -> _StreamWriter: ... -def open( - filename: str, mode: str = ..., encoding: str | None = ..., errors: str = ..., buffering: int = ... -) -> StreamReaderWriter: ... -def EncodedFile(file: _Stream, data_encoding: str, file_encoding: str | None = ..., errors: str = ...) -> StreamRecoder: ... -def iterencode(iterator: Iterable[str], encoding: str, errors: str = ...) -> Generator[bytes, None, None]: ... -def iterdecode(iterator: Iterable[bytes], encoding: str, errors: str = ...) -> Generator[str, None, None]: ... + +if sys.version_info >= (3, 8): + def open( + filename: str, mode: str = "r", encoding: str | None = None, errors: str = "strict", buffering: int = -1 + ) -> StreamReaderWriter: ... + +else: + def open( + filename: str, mode: str = "r", encoding: str | None = None, errors: str = "strict", buffering: int = 1 + ) -> StreamReaderWriter: ... + +def EncodedFile(file: _Stream, data_encoding: str, file_encoding: str | None = None, errors: str = "strict") -> StreamRecoder: ... +def iterencode(iterator: Iterable[str], encoding: str, errors: str = "strict") -> Generator[bytes, None, None]: ... +def iterdecode(iterator: Iterable[bytes], encoding: str, errors: str = "strict") -> Generator[str, None, None]: ... BOM: Literal[b"\xff\xfe", b"\xfe\xff"] # depends on `sys.byteorder` BOM_BE: Literal[b"\xfe\xff"] @@ -156,14 +164,14 @@ def namereplace_errors(exception: UnicodeError) -> tuple[str | bytes, int]: ... class Codec: # These are sort of @abstractmethod but sort of not. # The StreamReader and StreamWriter subclasses only implement one. - def encode(self, input: str, errors: str = ...) -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = ...) -> tuple[str, int]: ... + def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... + def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... class IncrementalEncoder: errors: str - def __init__(self, errors: str = ...) -> None: ... + def __init__(self, errors: str = "strict") -> None: ... @abstractmethod - def encode(self, input: str, final: bool = ...) -> bytes: ... + def encode(self, input: str, final: bool = False) -> bytes: ... def reset(self) -> None: ... # documentation says int but str is needed for the subclass. def getstate(self) -> int | str: ... @@ -171,9 +179,9 @@ class IncrementalEncoder: class IncrementalDecoder: errors: str - def __init__(self, errors: str = ...) -> None: ... + def __init__(self, errors: str = "strict") -> None: ... @abstractmethod - def decode(self, input: bytes, final: bool = ...) -> str: ... + def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... def reset(self) -> None: ... def getstate(self) -> tuple[bytes, int]: ... def setstate(self, state: tuple[bytes, int]) -> None: ... @@ -181,42 +189,42 @@ class IncrementalDecoder: # These are not documented but used in encodings/*.py implementations. class BufferedIncrementalEncoder(IncrementalEncoder): buffer: str - def __init__(self, errors: str = ...) -> None: ... + def __init__(self, errors: str = "strict") -> None: ... @abstractmethod - def _buffer_encode(self, input: str, errors: str, final: bool) -> bytes: ... - def encode(self, input: str, final: bool = ...) -> bytes: ... + def _buffer_encode(self, input: str, errors: str, final: bool) -> tuple[bytes, int]: ... + def encode(self, input: str, final: bool = False) -> bytes: ... class BufferedIncrementalDecoder(IncrementalDecoder): buffer: bytes - def __init__(self, errors: str = ...) -> None: ... + def __init__(self, errors: str = "strict") -> None: ... @abstractmethod - def _buffer_decode(self, input: bytes, errors: str, final: bool) -> tuple[str, int]: ... - def decode(self, input: bytes, final: bool = ...) -> str: ... + def _buffer_decode(self, input: ReadableBuffer, errors: str, final: bool) -> tuple[str, int]: ... + def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... # TODO: it is not possible to specify the requirement that all other # attributes and methods are passed-through from the stream. class StreamWriter(Codec): stream: _WritableStream errors: str - def __init__(self, stream: _WritableStream, errors: str = ...) -> None: ... + def __init__(self, stream: _WritableStream, errors: str = "strict") -> None: ... def write(self, object: str) -> None: ... def writelines(self, list: Iterable[str]) -> None: ... def reset(self) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__(self, type: type[BaseException] | None, value: BaseException | None, tb: types.TracebackType | None) -> None: ... def __getattr__(self, name: str, getattr: Callable[[str], Any] = ...) -> Any: ... class StreamReader(Codec): stream: _ReadableStream errors: str - def __init__(self, stream: _ReadableStream, errors: str = ...) -> None: ... - def read(self, size: int = ..., chars: int = ..., firstline: bool = ...) -> str: ... - def readline(self, size: int | None = ..., keepends: bool = ...) -> str: ... - def readlines(self, sizehint: int | None = ..., keepends: bool = ...) -> list[str]: ... + def __init__(self, stream: _ReadableStream, errors: str = "strict") -> None: ... + def read(self, size: int = -1, chars: int = -1, firstline: bool = False) -> str: ... + def readline(self, size: int | None = None, keepends: bool = True) -> str: ... + def readlines(self, sizehint: int | None = None, keepends: bool = True) -> list[str]: ... def reset(self) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__(self, type: type[BaseException] | None, value: BaseException | None, tb: types.TracebackType | None) -> None: ... - def __iter__(self: Self) -> Self: ... + def __iter__(self) -> Self: ... def __next__(self) -> str: ... def __getattr__(self, name: str, getattr: Callable[[str], Any] = ...) -> Any: ... @@ -224,17 +232,17 @@ class StreamReader(Codec): # and delegates attributes to the underlying binary stream with __getattr__. class StreamReaderWriter(TextIO): stream: _Stream - def __init__(self, stream: _Stream, Reader: _StreamReader, Writer: _StreamWriter, errors: str = ...) -> None: ... - def read(self, size: int = ...) -> str: ... - def readline(self, size: int | None = ...) -> str: ... - def readlines(self, sizehint: int | None = ...) -> list[str]: ... + def __init__(self, stream: _Stream, Reader: _StreamReader, Writer: _StreamWriter, errors: str = "strict") -> None: ... + def read(self, size: int = -1) -> str: ... + def readline(self, size: int | None = None) -> str: ... + def readlines(self, sizehint: int | None = None) -> list[str]: ... def __next__(self) -> str: ... - def __iter__(self: Self) -> Self: ... + def __iter__(self) -> Self: ... def write(self, data: str) -> None: ... # type: ignore[override] def writelines(self, list: Iterable[str]) -> None: ... def reset(self) -> None: ... - def seek(self, offset: int, whence: int = ...) -> None: ... # type: ignore[override] - def __enter__(self: Self) -> Self: ... + def seek(self, offset: int, whence: int = 0) -> None: ... # type: ignore[override] + def __enter__(self) -> Self: ... def __exit__(self, type: type[BaseException] | None, value: BaseException | None, tb: types.TracebackType | None) -> None: ... def __getattr__(self, name: str) -> Any: ... # These methods don't actually exist directly, but they are needed to satisfy the TextIO @@ -251,20 +259,27 @@ class StreamReaderWriter(TextIO): class StreamRecoder(BinaryIO): def __init__( - self, stream: _Stream, encode: _Encoder, decode: _Decoder, Reader: _StreamReader, Writer: _StreamWriter, errors: str = ... + self, + stream: _Stream, + encode: _Encoder, + decode: _Decoder, + Reader: _StreamReader, + Writer: _StreamWriter, + errors: str = "strict", ) -> None: ... - def read(self, size: int = ...) -> bytes: ... - def readline(self, size: int | None = ...) -> bytes: ... - def readlines(self, sizehint: int | None = ...) -> list[bytes]: ... + def read(self, size: int = -1) -> bytes: ... + def readline(self, size: int | None = None) -> bytes: ... + def readlines(self, sizehint: int | None = None) -> list[bytes]: ... def __next__(self) -> bytes: ... - def __iter__(self: Self) -> Self: ... + def __iter__(self) -> Self: ... + # Base class accepts more types than just bytes def write(self, data: bytes) -> None: ... # type: ignore[override] - def writelines(self, list: Iterable[bytes]) -> None: ... + def writelines(self, list: Iterable[bytes]) -> None: ... # type: ignore[override] def reset(self) -> None: ... def __getattr__(self, name: str) -> Any: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__(self, type: type[BaseException] | None, value: BaseException | None, tb: types.TracebackType | None) -> None: ... - def seek(self, offset: int, whence: int = ...) -> None: ... # type: ignore[override] + def seek(self, offset: int, whence: int = 0) -> None: ... # type: ignore[override] # These methods don't actually exist directly, but they are needed to satisfy the BinaryIO # interface. At runtime, they are delegated through __getattr__. def close(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/codeop.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/codeop.pyi index 1c00e13fd..6a51b7786 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/codeop.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/codeop.pyi @@ -2,14 +2,12 @@ from types import CodeType __all__ = ["compile_command", "Compile", "CommandCompiler"] -def compile_command(source: str, filename: str = ..., symbol: str = ...) -> CodeType | None: ... +def compile_command(source: str, filename: str = "", symbol: str = "single") -> CodeType | None: ... class Compile: flags: int - def __init__(self) -> None: ... def __call__(self, source: str, filename: str, symbol: str) -> CodeType: ... class CommandCompiler: compiler: Compile - def __init__(self) -> None: ... - def __call__(self, source: str, filename: str = ..., symbol: str = ...) -> CodeType | None: ... + def __call__(self, source: str, filename: str = "", symbol: str = "single") -> CodeType | None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/collections/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/collections/__init__.pyi index b546c45ab..1a4042114 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/collections/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/collections/__init__.pyi @@ -1,14 +1,26 @@ import sys from _collections_abc import dict_items, dict_keys, dict_values -from _typeshed import Self, SupportsKeysAndGetItem, SupportsRichComparison, SupportsRichComparisonT +from _typeshed import SupportsKeysAndGetItem, SupportsRichComparison, SupportsRichComparisonT from typing import Any, Generic, NoReturn, TypeVar, overload -from typing_extensions import SupportsIndex, final +from typing_extensions import Self, SupportsIndex, final if sys.version_info >= (3, 9): from types import GenericAlias if sys.version_info >= (3, 10): - from collections.abc import Callable, Iterable, Iterator, Mapping, MutableMapping, MutableSequence, Reversible, Sequence + from collections.abc import ( + Callable, + ItemsView, + Iterable, + Iterator, + KeysView, + Mapping, + MutableMapping, + MutableSequence, + Reversible, + Sequence, + ValuesView, + ) else: from _collections_abc import * @@ -28,22 +40,26 @@ def namedtuple( typename: str, field_names: str | Iterable[str], *, - rename: bool = ..., - module: str | None = ..., - defaults: Iterable[Any] | None = ..., + rename: bool = False, + module: str | None = None, + defaults: Iterable[Any] | None = None, ) -> type[tuple[Any, ...]]: ... class UserDict(MutableMapping[_KT, _VT], Generic[_KT, _VT]): data: dict[_KT, _VT] # __init__ should be kept roughly in line with `dict.__init__`, which has the same semantics @overload - def __init__(self, __dict: None = ...) -> None: ... + def __init__(self, __dict: None = None) -> None: ... @overload - def __init__(self: UserDict[str, _VT], __dict: None = ..., **kwargs: _VT) -> None: ... + def __init__(self: UserDict[str, _VT], __dict: None = None, **kwargs: _VT) -> None: ... @overload - def __init__(self, __dict: SupportsKeysAndGetItem[_KT, _VT], **kwargs: _VT) -> None: ... + def __init__(self, __dict: SupportsKeysAndGetItem[_KT, _VT]) -> None: ... @overload - def __init__(self, __iterable: Iterable[tuple[_KT, _VT]], **kwargs: _VT) -> None: ... + def __init__(self: UserDict[str, _VT], __dict: SupportsKeysAndGetItem[str, _VT], **kwargs: _VT) -> None: ... + @overload + def __init__(self, __iterable: Iterable[tuple[_KT, _VT]]) -> None: ... + @overload + def __init__(self: UserDict[str, _VT], __iterable: Iterable[tuple[str, _VT]], **kwargs: _VT) -> None: ... @overload def __init__(self: UserDict[str, str], __iterable: Iterable[list[str]]) -> None: ... def __len__(self) -> int: ... @@ -52,15 +68,15 @@ class UserDict(MutableMapping[_KT, _VT], Generic[_KT, _VT]): def __delitem__(self, key: _KT) -> None: ... def __iter__(self) -> Iterator[_KT]: ... def __contains__(self, key: object) -> bool: ... - def copy(self: Self) -> Self: ... - def __copy__(self: Self) -> Self: ... + def copy(self) -> Self: ... + def __copy__(self) -> Self: ... # `UserDict.fromkeys` has the same semantics as `dict.fromkeys`, so should be kept in line with `dict.fromkeys`. # TODO: Much like `dict.fromkeys`, the true signature of `UserDict.fromkeys` is inexpressible in the current type system. # See #3800 & https://github.com/python/typing/issues/548#issuecomment-683336963. @classmethod @overload - def fromkeys(cls, iterable: Iterable[_T], value: None = ...) -> UserDict[_T, Any | None]: ... + def fromkeys(cls, iterable: Iterable[_T], value: None = None) -> UserDict[_T, Any | None]: ... @classmethod @overload def fromkeys(cls, iterable: Iterable[_T], value: _S) -> UserDict[_T, _S]: ... @@ -69,14 +85,14 @@ class UserDict(MutableMapping[_KT, _VT], Generic[_KT, _VT]): def __ror__(self, other: UserDict[_T1, _T2] | dict[_T1, _T2]) -> UserDict[_KT | _T1, _VT | _T2]: ... # type: ignore[misc] # UserDict.__ior__ should be kept roughly in line with MutableMapping.update() @overload # type: ignore[misc] - def __ior__(self: Self, other: SupportsKeysAndGetItem[_KT, _VT]) -> Self: ... + def __ior__(self, other: SupportsKeysAndGetItem[_KT, _VT]) -> Self: ... @overload - def __ior__(self: Self, other: Iterable[tuple[_KT, _VT]]) -> Self: ... + def __ior__(self, other: Iterable[tuple[_KT, _VT]]) -> Self: ... class UserList(MutableSequence[_T]): data: list[_T] @overload - def __init__(self, initlist: None = ...) -> None: ... + def __init__(self, initlist: None = None) -> None: ... @overload def __init__(self, initlist: Iterable[_T]) -> None: ... def __lt__(self, other: list[_T] | UserList[_T]) -> bool: ... @@ -89,32 +105,32 @@ class UserList(MutableSequence[_T]): @overload def __getitem__(self, i: SupportsIndex) -> _T: ... @overload - def __getitem__(self: Self, i: slice) -> Self: ... + def __getitem__(self, i: slice) -> Self: ... @overload def __setitem__(self, i: SupportsIndex, item: _T) -> None: ... @overload def __setitem__(self, i: slice, item: Iterable[_T]) -> None: ... def __delitem__(self, i: SupportsIndex | slice) -> None: ... - def __add__(self: Self, other: Iterable[_T]) -> Self: ... - def __radd__(self: Self, other: Iterable[_T]) -> Self: ... - def __iadd__(self: Self, other: Iterable[_T]) -> Self: ... - def __mul__(self: Self, n: int) -> Self: ... - def __rmul__(self: Self, n: int) -> Self: ... - def __imul__(self: Self, n: int) -> Self: ... + def __add__(self, other: Iterable[_T]) -> Self: ... + def __radd__(self, other: Iterable[_T]) -> Self: ... + def __iadd__(self, other: Iterable[_T]) -> Self: ... + def __mul__(self, n: int) -> Self: ... + def __rmul__(self, n: int) -> Self: ... + def __imul__(self, n: int) -> Self: ... def append(self, item: _T) -> None: ... def insert(self, i: int, item: _T) -> None: ... - def pop(self, i: int = ...) -> _T: ... + def pop(self, i: int = -1) -> _T: ... def remove(self, item: _T) -> None: ... - def copy(self: Self) -> Self: ... - def __copy__(self: Self) -> Self: ... + def copy(self) -> Self: ... + def __copy__(self) -> Self: ... def count(self, item: _T) -> int: ... # All arguments are passed to `list.index` at runtime, so the signature should be kept in line with `list.index`. - def index(self, item: _T, __start: SupportsIndex = ..., __stop: SupportsIndex = ...) -> int: ... + def index(self, item: _T, __start: SupportsIndex = 0, __stop: SupportsIndex = sys.maxsize) -> int: ... # All arguments are passed to `list.sort` at runtime, so the signature should be kept in line with `list.sort`. @overload - def sort(self: UserList[SupportsRichComparisonT], *, key: None = ..., reverse: bool = ...) -> None: ... + def sort(self: UserList[SupportsRichComparisonT], *, key: None = None, reverse: bool = False) -> None: ... @overload - def sort(self, *, key: Callable[[_T], SupportsRichComparison], reverse: bool = ...) -> None: ... + def sort(self, *, key: Callable[[_T], SupportsRichComparison], reverse: bool = False) -> None: ... def extend(self, other: Iterable[_T]) -> None: ... class UserString(Sequence[UserString]): @@ -131,34 +147,34 @@ class UserString(Sequence[UserString]): def __eq__(self, string: object) -> bool: ... def __contains__(self, char: object) -> bool: ... def __len__(self) -> int: ... - def __getitem__(self: Self, index: SupportsIndex | slice) -> Self: ... - def __iter__(self: Self) -> Iterator[Self]: ... - def __reversed__(self: Self) -> Iterator[Self]: ... - def __add__(self: Self, other: object) -> Self: ... - def __radd__(self: Self, other: object) -> Self: ... - def __mul__(self: Self, n: int) -> Self: ... - def __rmul__(self: Self, n: int) -> Self: ... - def __mod__(self: Self, args: Any) -> Self: ... + def __getitem__(self, index: SupportsIndex | slice) -> Self: ... + def __iter__(self) -> Iterator[Self]: ... + def __reversed__(self) -> Iterator[Self]: ... + def __add__(self, other: object) -> Self: ... + def __radd__(self, other: object) -> Self: ... + def __mul__(self, n: int) -> Self: ... + def __rmul__(self, n: int) -> Self: ... + def __mod__(self, args: Any) -> Self: ... if sys.version_info >= (3, 8): - def __rmod__(self: Self, template: object) -> Self: ... + def __rmod__(self, template: object) -> Self: ... else: - def __rmod__(self: Self, format: Any) -> Self: ... + def __rmod__(self, format: Any) -> Self: ... - def capitalize(self: Self) -> Self: ... - def casefold(self: Self) -> Self: ... - def center(self: Self, width: int, *args: Any) -> Self: ... - def count(self, sub: str | UserString, start: int = ..., end: int = ...) -> int: ... + def capitalize(self) -> Self: ... + def casefold(self) -> Self: ... + def center(self, width: int, *args: Any) -> Self: ... + def count(self, sub: str | UserString, start: int = 0, end: int = sys.maxsize) -> int: ... if sys.version_info >= (3, 8): - def encode(self: UserString, encoding: str | None = ..., errors: str | None = ...) -> bytes: ... + def encode(self: UserString, encoding: str | None = "utf-8", errors: str | None = "strict") -> bytes: ... else: - def encode(self: Self, encoding: str | None = ..., errors: str | None = ...) -> Self: ... + def encode(self, encoding: str | None = None, errors: str | None = None) -> Self: ... - def endswith(self, suffix: str | tuple[str, ...], start: int | None = ..., end: int | None = ...) -> bool: ... - def expandtabs(self: Self, tabsize: int = ...) -> Self: ... - def find(self, sub: str | UserString, start: int = ..., end: int = ...) -> int: ... + def endswith(self, suffix: str | tuple[str, ...], start: int | None = 0, end: int | None = sys.maxsize) -> bool: ... + def expandtabs(self, tabsize: int = 8) -> Self: ... + def find(self, sub: str | UserString, start: int = 0, end: int = sys.maxsize) -> int: ... def format(self, *args: Any, **kwds: Any) -> str: ... def format_map(self, mapping: Mapping[str, Any]) -> str: ... - def index(self, sub: str, start: int = ..., end: int = ...) -> int: ... + def index(self, sub: str, start: int = 0, end: int = sys.maxsize) -> int: ... def isalpha(self) -> bool: ... def isalnum(self) -> bool: ... def isdecimal(self) -> bool: ... @@ -172,91 +188,86 @@ class UserString(Sequence[UserString]): def isupper(self) -> bool: ... def isascii(self) -> bool: ... def join(self, seq: Iterable[str]) -> str: ... - def ljust(self: Self, width: int, *args: Any) -> Self: ... - def lower(self: Self) -> Self: ... - def lstrip(self: Self, chars: str | None = ...) -> Self: ... - @staticmethod - @overload - def maketrans(x: dict[int, _T] | dict[str, _T] | dict[str | int, _T]) -> dict[int, _T]: ... - @staticmethod - @overload - def maketrans(x: str, y: str, z: str = ...) -> dict[int, int | None]: ... + def ljust(self, width: int, *args: Any) -> Self: ... + def lower(self) -> Self: ... + def lstrip(self, chars: str | None = None) -> Self: ... + maketrans = str.maketrans def partition(self, sep: str) -> tuple[str, str, str]: ... if sys.version_info >= (3, 9): - def removeprefix(self: Self, __prefix: str | UserString) -> Self: ... - def removesuffix(self: Self, __suffix: str | UserString) -> Self: ... + def removeprefix(self, __prefix: str | UserString) -> Self: ... + def removesuffix(self, __suffix: str | UserString) -> Self: ... - def replace(self: Self, old: str | UserString, new: str | UserString, maxsplit: int = ...) -> Self: ... - def rfind(self, sub: str | UserString, start: int = ..., end: int = ...) -> int: ... - def rindex(self, sub: str | UserString, start: int = ..., end: int = ...) -> int: ... - def rjust(self: Self, width: int, *args: Any) -> Self: ... + def replace(self, old: str | UserString, new: str | UserString, maxsplit: int = -1) -> Self: ... + def rfind(self, sub: str | UserString, start: int = 0, end: int = sys.maxsize) -> int: ... + def rindex(self, sub: str | UserString, start: int = 0, end: int = sys.maxsize) -> int: ... + def rjust(self, width: int, *args: Any) -> Self: ... def rpartition(self, sep: str) -> tuple[str, str, str]: ... - def rstrip(self: Self, chars: str | None = ...) -> Self: ... - def split(self, sep: str | None = ..., maxsplit: int = ...) -> list[str]: ... - def rsplit(self, sep: str | None = ..., maxsplit: int = ...) -> list[str]: ... - def splitlines(self, keepends: bool = ...) -> list[str]: ... - def startswith(self, prefix: str | tuple[str, ...], start: int | None = ..., end: int | None = ...) -> bool: ... - def strip(self: Self, chars: str | None = ...) -> Self: ... - def swapcase(self: Self) -> Self: ... - def title(self: Self) -> Self: ... - def translate(self: Self, *args: Any) -> Self: ... - def upper(self: Self) -> Self: ... - def zfill(self: Self, width: int) -> Self: ... + def rstrip(self, chars: str | None = None) -> Self: ... + def split(self, sep: str | None = None, maxsplit: int = -1) -> list[str]: ... + def rsplit(self, sep: str | None = None, maxsplit: int = -1) -> list[str]: ... + def splitlines(self, keepends: bool = False) -> list[str]: ... + def startswith(self, prefix: str | tuple[str, ...], start: int | None = 0, end: int | None = sys.maxsize) -> bool: ... + def strip(self, chars: str | None = None) -> Self: ... + def swapcase(self) -> Self: ... + def title(self) -> Self: ... + def translate(self, *args: Any) -> Self: ... + def upper(self) -> Self: ... + def zfill(self, width: int) -> Self: ... class deque(MutableSequence[_T], Generic[_T]): @property def maxlen(self) -> int | None: ... @overload - def __init__(self, *, maxlen: int | None = ...) -> None: ... + def __init__(self, *, maxlen: int | None = None) -> None: ... @overload - def __init__(self, iterable: Iterable[_T], maxlen: int | None = ...) -> None: ... + def __init__(self, iterable: Iterable[_T], maxlen: int | None = None) -> None: ... def append(self, __x: _T) -> None: ... def appendleft(self, __x: _T) -> None: ... - def copy(self: Self) -> Self: ... + def copy(self) -> Self: ... def count(self, __x: _T) -> int: ... def extend(self, __iterable: Iterable[_T]) -> None: ... def extendleft(self, __iterable: Iterable[_T]) -> None: ... def insert(self, __i: int, __x: _T) -> None: ... - def index(self, __x: _T, __start: int = ..., __stop: int = ...) -> int: ... + def index(self, __x: _T, __start: int = 0, __stop: int = ...) -> int: ... def pop(self) -> _T: ... # type: ignore[override] def popleft(self) -> _T: ... def remove(self, __value: _T) -> None: ... - def rotate(self, __n: int = ...) -> None: ... - def __copy__(self: Self) -> Self: ... + def rotate(self, __n: int = 1) -> None: ... + def __copy__(self) -> Self: ... def __len__(self) -> int: ... # These methods of deque don't take slices, unlike MutableSequence, hence the type: ignores - def __getitem__(self, __index: SupportsIndex) -> _T: ... # type: ignore[override] - def __setitem__(self, __i: SupportsIndex, __x: _T) -> None: ... # type: ignore[override] - def __delitem__(self, __i: SupportsIndex) -> None: ... # type: ignore[override] - def __contains__(self, __o: object) -> bool: ... - def __reduce__(self: Self) -> tuple[type[Self], tuple[()], None, Iterator[_T]]: ... - def __iadd__(self: Self, __iterable: Iterable[_T]) -> Self: ... - def __add__(self: Self, __other: Self) -> Self: ... - def __mul__(self: Self, __other: int) -> Self: ... - def __imul__(self: Self, __other: int) -> Self: ... - def __lt__(self, __other: deque[_T]) -> bool: ... - def __le__(self, __other: deque[_T]) -> bool: ... - def __gt__(self, __other: deque[_T]) -> bool: ... - def __ge__(self, __other: deque[_T]) -> bool: ... + def __getitem__(self, __key: SupportsIndex) -> _T: ... # type: ignore[override] + def __setitem__(self, __key: SupportsIndex, __value: _T) -> None: ... # type: ignore[override] + def __delitem__(self, __key: SupportsIndex) -> None: ... # type: ignore[override] + def __contains__(self, __key: object) -> bool: ... + def __reduce__(self) -> tuple[type[Self], tuple[()], None, Iterator[_T]]: ... + def __iadd__(self, __value: Iterable[_T]) -> Self: ... + def __add__(self, __value: Self) -> Self: ... + def __mul__(self, __value: int) -> Self: ... + def __imul__(self, __value: int) -> Self: ... + def __lt__(self, __value: deque[_T]) -> bool: ... + def __le__(self, __value: deque[_T]) -> bool: ... + def __gt__(self, __value: deque[_T]) -> bool: ... + def __ge__(self, __value: deque[_T]) -> bool: ... if sys.version_info >= (3, 9): def __class_getitem__(cls, __item: Any) -> GenericAlias: ... class Counter(dict[_T, int], Generic[_T]): @overload - def __init__(self, __iterable: None = ...) -> None: ... + def __init__(self, __iterable: None = None) -> None: ... @overload - def __init__(self: Counter[str], __iterable: None = ..., **kwargs: int) -> None: ... + def __init__(self: Counter[str], __iterable: None = None, **kwargs: int) -> None: ... @overload def __init__(self, __mapping: SupportsKeysAndGetItem[_T, int]) -> None: ... @overload def __init__(self, __iterable: Iterable[_T]) -> None: ... - def copy(self: Self) -> Self: ... + def copy(self) -> Self: ... def elements(self) -> Iterator[_T]: ... - def most_common(self, n: int | None = ...) -> list[tuple[_T, int]]: ... + def most_common(self, n: int | None = None) -> list[tuple[_T, int]]: ... @classmethod - def fromkeys(cls, iterable: Any, v: int | None = ...) -> NoReturn: ... # type: ignore[override] + def fromkeys(cls, iterable: Any, v: int | None = None) -> NoReturn: ... # type: ignore[override] @overload - def subtract(self, __iterable: None = ...) -> None: ... + def subtract(self, __iterable: None = None) -> None: ... @overload def subtract(self, __mapping: Mapping[_T, int]) -> None: ... @overload @@ -270,9 +281,9 @@ class Counter(dict[_T, int], Generic[_T]): @overload # type: ignore[override] def update(self, __m: Mapping[_T, int], **kwargs: int) -> None: ... @overload - def update(self, __m: Iterable[_T], **kwargs: int) -> None: ... + def update(self, __iterable: Iterable[_T], **kwargs: int) -> None: ... @overload - def update(self, __m: None = ..., **kwargs: int) -> None: ... + def update(self, __iterable: None = None, **kwargs: int) -> None: ... def __missing__(self, key: _T) -> int: ... def __delitem__(self, elem: object) -> None: ... if sys.version_info >= (3, 10): @@ -286,10 +297,10 @@ class Counter(dict[_T, int], Generic[_T]): def __pos__(self) -> Counter[_T]: ... def __neg__(self) -> Counter[_T]: ... # several type: ignores because __iadd__ is supposedly incompatible with __add__, etc. - def __iadd__(self: Self, other: Counter[_T]) -> Self: ... # type: ignore[misc] - def __isub__(self: Self, other: Counter[_T]) -> Self: ... - def __iand__(self: Self, other: Counter[_T]) -> Self: ... - def __ior__(self: Self, other: Counter[_T]) -> Self: ... # type: ignore[override,misc] + def __iadd__(self, other: Counter[_T]) -> Self: ... # type: ignore[misc] + def __isub__(self, other: Counter[_T]) -> Self: ... + def __iand__(self, other: Counter[_T]) -> Self: ... + def __ior__(self, other: Counter[_T]) -> Self: ... # type: ignore[override,misc] if sys.version_info >= (3, 10): def total(self) -> int: ... def __le__(self, other: Counter[Any]) -> bool: ... @@ -297,38 +308,53 @@ class Counter(dict[_T, int], Generic[_T]): def __ge__(self, other: Counter[Any]) -> bool: ... def __gt__(self, other: Counter[Any]) -> bool: ... +# The pure-Python implementations of the "views" classes +# These are exposed at runtime in `collections/__init__.py` +class _OrderedDictKeysView(KeysView[_KT_co], Reversible[_KT_co]): + def __reversed__(self) -> Iterator[_KT_co]: ... + +class _OrderedDictItemsView(ItemsView[_KT_co, _VT_co], Reversible[tuple[_KT_co, _VT_co]]): + def __reversed__(self) -> Iterator[tuple[_KT_co, _VT_co]]: ... + +class _OrderedDictValuesView(ValuesView[_VT_co], Reversible[_VT_co]): + def __reversed__(self) -> Iterator[_VT_co]: ... + +# The C implementations of the "views" classes +# (At runtime, these are called `odict_keys`, `odict_items` and `odict_values`, +# but they are not exposed anywhere) +# pyright doesn't have a specific error code for subclassing error! @final -class _OrderedDictKeysView(dict_keys[_KT_co, _VT_co], Reversible[_KT_co]): # type: ignore[misc] +class _odict_keys(dict_keys[_KT_co, _VT_co], Reversible[_KT_co]): # type: ignore[misc] # pyright: ignore def __reversed__(self) -> Iterator[_KT_co]: ... @final -class _OrderedDictItemsView(dict_items[_KT_co, _VT_co], Reversible[tuple[_KT_co, _VT_co]]): # type: ignore[misc] +class _odict_items(dict_items[_KT_co, _VT_co], Reversible[tuple[_KT_co, _VT_co]]): # type: ignore[misc] # pyright: ignore def __reversed__(self) -> Iterator[tuple[_KT_co, _VT_co]]: ... @final -class _OrderedDictValuesView(dict_values[_KT_co, _VT_co], Reversible[_VT_co], Generic[_KT_co, _VT_co]): # type: ignore[misc] +class _odict_values(dict_values[_KT_co, _VT_co], Reversible[_VT_co], Generic[_KT_co, _VT_co]): # type: ignore[misc] # pyright: ignore def __reversed__(self) -> Iterator[_VT_co]: ... class OrderedDict(dict[_KT, _VT], Reversible[_KT], Generic[_KT, _VT]): - def popitem(self, last: bool = ...) -> tuple[_KT, _VT]: ... - def move_to_end(self, key: _KT, last: bool = ...) -> None: ... - def copy(self: Self) -> Self: ... + def popitem(self, last: bool = True) -> tuple[_KT, _VT]: ... + def move_to_end(self, key: _KT, last: bool = True) -> None: ... + def copy(self) -> Self: ... def __reversed__(self) -> Iterator[_KT]: ... - def keys(self) -> _OrderedDictKeysView[_KT, _VT]: ... - def items(self) -> _OrderedDictItemsView[_KT, _VT]: ... - def values(self) -> _OrderedDictValuesView[_KT, _VT]: ... + def keys(self) -> _odict_keys[_KT, _VT]: ... + def items(self) -> _odict_items[_KT, _VT]: ... + def values(self) -> _odict_values[_KT, _VT]: ... # The signature of OrderedDict.fromkeys should be kept in line with `dict.fromkeys`, modulo positional-only differences. # Like dict.fromkeys, its true signature is not expressible in the current type system. # See #3800 & https://github.com/python/typing/issues/548#issuecomment-683336963. @classmethod @overload - def fromkeys(cls, iterable: Iterable[_T], value: None = ...) -> OrderedDict[_T, Any | None]: ... + def fromkeys(cls, iterable: Iterable[_T], value: None = None) -> OrderedDict[_T, Any | None]: ... @classmethod @overload def fromkeys(cls, iterable: Iterable[_T], value: _S) -> OrderedDict[_T, _S]: ... # Keep OrderedDict.setdefault in line with MutableMapping.setdefault, modulo positional-only differences. @overload - def setdefault(self: OrderedDict[_KT, _T | None], key: _KT) -> _T | None: ... + def setdefault(self: OrderedDict[_KT, _T | None], key: _KT, default: None = None) -> _T | None: ... @overload def setdefault(self, key: _KT, default: _VT) -> _VT: ... @@ -361,15 +387,15 @@ class defaultdict(dict[_KT, _VT], Generic[_KT, _VT]): **kwargs: _VT, ) -> None: ... def __missing__(self, __key: _KT) -> _VT: ... - def __copy__(self: Self) -> Self: ... - def copy(self: Self) -> Self: ... + def __copy__(self) -> Self: ... + def copy(self) -> Self: ... class ChainMap(MutableMapping[_KT, _VT], Generic[_KT, _VT]): maps: list[MutableMapping[_KT, _VT]] def __init__(self, *maps: MutableMapping[_KT, _VT]) -> None: ... - def new_child(self: Self, m: MutableMapping[_KT, _VT] | None = ...) -> Self: ... + def new_child(self, m: MutableMapping[_KT, _VT] | None = None) -> Self: ... @property - def parents(self: Self) -> Self: ... + def parents(self) -> Self: ... def __setitem__(self, key: _KT, value: _VT) -> None: ... def __delitem__(self, key: _KT) -> None: ... def __getitem__(self, key: _KT) -> _VT: ... @@ -378,17 +404,21 @@ class ChainMap(MutableMapping[_KT, _VT], Generic[_KT, _VT]): def __contains__(self, key: object) -> bool: ... def __missing__(self, key: _KT) -> _VT: ... # undocumented def __bool__(self) -> bool: ... - def setdefault(self, key: _KT, default: _VT = ...) -> _VT: ... + # Keep ChainMap.setdefault in line with MutableMapping.setdefault, modulo positional-only differences. + @overload + def setdefault(self: ChainMap[_KT, _T | None], key: _KT, default: None = None) -> _T | None: ... + @overload + def setdefault(self, key: _KT, default: _VT) -> _VT: ... @overload def pop(self, key: _KT) -> _VT: ... @overload - def pop(self, key: _KT, default: _VT | _T = ...) -> _VT | _T: ... - def copy(self: Self) -> Self: ... + def pop(self, key: _KT, default: _VT | _T) -> _VT | _T: ... + def copy(self) -> Self: ... __copy__ = copy # All arguments to `fromkeys` are passed to `dict.fromkeys` at runtime, so the signature should be kept in line with `dict.fromkeys`. @classmethod @overload - def fromkeys(cls, iterable: Iterable[_T], __value: None = ...) -> ChainMap[_T, Any | None]: ... + def fromkeys(cls, iterable: Iterable[_T], __value: None = None) -> ChainMap[_T, Any | None]: ... @classmethod @overload def fromkeys(cls, __iterable: Iterable[_T], __value: _S) -> ChainMap[_T, _S]: ... @@ -397,6 +427,6 @@ class ChainMap(MutableMapping[_KT, _VT], Generic[_KT, _VT]): def __ror__(self, other: Mapping[_T1, _T2]) -> ChainMap[_KT | _T1, _VT | _T2]: ... # ChainMap.__ior__ should be kept roughly in line with MutableMapping.update() @overload # type: ignore[misc] - def __ior__(self: Self, other: SupportsKeysAndGetItem[_KT, _VT]) -> Self: ... + def __ior__(self, other: SupportsKeysAndGetItem[_KT, _VT]) -> Self: ... @overload - def __ior__(self: Self, other: Iterable[tuple[_KT, _VT]]) -> Self: ... + def __ior__(self, other: Iterable[tuple[_KT, _VT]]) -> Self: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/compileall.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/compileall.pyi index dd1de3f49..7520c2f5b 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/compileall.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/compileall.pyi @@ -8,70 +8,104 @@ __all__ = ["compile_dir", "compile_file", "compile_path"] class _SupportsSearch(Protocol): def search(self, string: str) -> Any: ... -if sys.version_info >= (3, 9): +if sys.version_info >= (3, 10): def compile_dir( dir: StrPath, - maxlevels: int | None = ..., - ddir: StrPath | None = ..., - force: bool = ..., - rx: _SupportsSearch | None = ..., - quiet: int = ..., - legacy: bool = ..., - optimize: int = ..., - workers: int = ..., - invalidation_mode: PycInvalidationMode | None = ..., + maxlevels: int | None = None, + ddir: StrPath | None = None, + force: bool = False, + rx: _SupportsSearch | None = None, + quiet: int = 0, + legacy: bool = False, + optimize: int = -1, + workers: int = 1, + invalidation_mode: PycInvalidationMode | None = None, *, - stripdir: str | None = ..., # TODO: change to StrPath | None once https://bugs.python.org/issue40447 is resolved - prependdir: StrPath | None = ..., - limit_sl_dest: StrPath | None = ..., - hardlink_dupes: bool = ..., + stripdir: StrPath | None = None, + prependdir: StrPath | None = None, + limit_sl_dest: StrPath | None = None, + hardlink_dupes: bool = False, ) -> int: ... def compile_file( fullname: StrPath, - ddir: StrPath | None = ..., - force: bool = ..., - rx: _SupportsSearch | None = ..., - quiet: int = ..., - legacy: bool = ..., - optimize: int = ..., - invalidation_mode: PycInvalidationMode | None = ..., + ddir: StrPath | None = None, + force: bool = False, + rx: _SupportsSearch | None = None, + quiet: int = 0, + legacy: bool = False, + optimize: int = -1, + invalidation_mode: PycInvalidationMode | None = None, *, - stripdir: str | None = ..., # TODO: change to StrPath | None once https://bugs.python.org/issue40447 is resolved - prependdir: StrPath | None = ..., - limit_sl_dest: StrPath | None = ..., - hardlink_dupes: bool = ..., + stripdir: StrPath | None = None, + prependdir: StrPath | None = None, + limit_sl_dest: StrPath | None = None, + hardlink_dupes: bool = False, + ) -> int: ... + +elif sys.version_info >= (3, 9): + def compile_dir( + dir: StrPath, + maxlevels: int | None = None, + ddir: StrPath | None = None, + force: bool = False, + rx: _SupportsSearch | None = None, + quiet: int = 0, + legacy: bool = False, + optimize: int = -1, + workers: int = 1, + invalidation_mode: PycInvalidationMode | None = None, + *, + stripdir: str | None = None, # https://bugs.python.org/issue40447 + prependdir: StrPath | None = None, + limit_sl_dest: StrPath | None = None, + hardlink_dupes: bool = False, + ) -> int: ... + def compile_file( + fullname: StrPath, + ddir: StrPath | None = None, + force: bool = False, + rx: _SupportsSearch | None = None, + quiet: int = 0, + legacy: bool = False, + optimize: int = -1, + invalidation_mode: PycInvalidationMode | None = None, + *, + stripdir: str | None = None, # https://bugs.python.org/issue40447 + prependdir: StrPath | None = None, + limit_sl_dest: StrPath | None = None, + hardlink_dupes: bool = False, ) -> int: ... else: def compile_dir( dir: StrPath, - maxlevels: int = ..., - ddir: StrPath | None = ..., - force: bool = ..., - rx: _SupportsSearch | None = ..., - quiet: int = ..., - legacy: bool = ..., - optimize: int = ..., - workers: int = ..., - invalidation_mode: PycInvalidationMode | None = ..., + maxlevels: int = 10, + ddir: StrPath | None = None, + force: bool = False, + rx: _SupportsSearch | None = None, + quiet: int = 0, + legacy: bool = False, + optimize: int = -1, + workers: int = 1, + invalidation_mode: PycInvalidationMode | None = None, ) -> int: ... def compile_file( fullname: StrPath, - ddir: StrPath | None = ..., - force: bool = ..., - rx: _SupportsSearch | None = ..., - quiet: int = ..., - legacy: bool = ..., - optimize: int = ..., - invalidation_mode: PycInvalidationMode | None = ..., + ddir: StrPath | None = None, + force: bool = False, + rx: _SupportsSearch | None = None, + quiet: int = 0, + legacy: bool = False, + optimize: int = -1, + invalidation_mode: PycInvalidationMode | None = None, ) -> int: ... def compile_path( skip_curdir: bool = ..., - maxlevels: int = ..., - force: bool = ..., - quiet: int = ..., - legacy: bool = ..., - optimize: int = ..., - invalidation_mode: PycInvalidationMode | None = ..., + maxlevels: int = 0, + force: bool = False, + quiet: int = 0, + legacy: bool = False, + optimize: int = -1, + invalidation_mode: PycInvalidationMode | None = None, ) -> int: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/concurrent/futures/_base.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/concurrent/futures/_base.pyi index 3885abf8d..eb5ca4e2d 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/concurrent/futures/_base.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/concurrent/futures/_base.pyi @@ -1,11 +1,11 @@ import sys import threading -from _typeshed import Self -from collections.abc import Callable, Iterable, Iterator, Sequence +from _typeshed import Unused +from collections.abc import Callable, Iterable, Iterator from logging import Logger from types import TracebackType -from typing import Any, Generic, TypeVar, overload -from typing_extensions import Literal, ParamSpec, SupportsIndex +from typing import Any, Generic, NamedTuple, TypeVar +from typing_extensions import Literal, ParamSpec, Self if sys.version_info >= (3, 9): from types import GenericAlias @@ -35,16 +35,15 @@ _T = TypeVar("_T") _P = ParamSpec("_P") class Future(Generic[_T]): - def __init__(self) -> None: ... def cancel(self) -> bool: ... def cancelled(self) -> bool: ... def running(self) -> bool: ... def done(self) -> bool: ... def add_done_callback(self, fn: Callable[[Future[_T]], object]) -> None: ... - def result(self, timeout: float | None = ...) -> _T: ... + def result(self, timeout: float | None = None) -> _T: ... def set_running_or_notify_cancel(self) -> bool: ... def set_result(self, result: _T) -> None: ... - def exception(self, timeout: float | None = ...) -> BaseException | None: ... + def exception(self, timeout: float | None = None) -> BaseException | None: ... def set_exception(self, exception: BaseException | None) -> None: ... if sys.version_info >= (3, 9): def __class_getitem__(cls, item: Any) -> GenericAlias: ... @@ -56,68 +55,48 @@ class Executor: def submit(self, fn: Callable[_P, _T], *args: _P.args, **kwargs: _P.kwargs) -> Future[_T]: ... def map( - self, fn: Callable[..., _T], *iterables: Iterable[Any], timeout: float | None = ..., chunksize: int = ... + self, fn: Callable[..., _T], *iterables: Iterable[Any], timeout: float | None = None, chunksize: int = 1 ) -> Iterator[_T]: ... if sys.version_info >= (3, 9): - def shutdown(self, wait: bool = ..., *, cancel_futures: bool = ...) -> None: ... + def shutdown(self, wait: bool = True, *, cancel_futures: bool = False) -> None: ... else: - def shutdown(self, wait: bool = ...) -> None: ... + def shutdown(self, wait: bool = True) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None ) -> bool | None: ... -def as_completed(fs: Iterable[Future[_T]], timeout: float | None = ...) -> Iterator[Future[_T]]: ... - -# Ideally this would be a namedtuple, but mypy doesn't support generic tuple types. See #1976 -class DoneAndNotDoneFutures(Sequence[set[Future[_T]]]): - if sys.version_info >= (3, 10): - __match_args__ = ("done", "not_done") - @property - def done(self) -> set[Future[_T]]: ... - @property - def not_done(self) -> set[Future[_T]]: ... - def __new__(_cls, done: set[Future[_T]], not_done: set[Future[_T]]) -> DoneAndNotDoneFutures[_T]: ... - def __len__(self) -> int: ... - @overload - def __getitem__(self, __i: SupportsIndex) -> set[Future[_T]]: ... - @overload - def __getitem__(self, __s: slice) -> DoneAndNotDoneFutures[_T]: ... - -def wait(fs: Iterable[Future[_T]], timeout: float | None = ..., return_when: str = ...) -> DoneAndNotDoneFutures[_T]: ... +def as_completed(fs: Iterable[Future[_T]], timeout: float | None = None) -> Iterator[Future[_T]]: ... + +class DoneAndNotDoneFutures(NamedTuple, Generic[_T]): + done: set[Future[_T]] + not_done: set[Future[_T]] + +def wait( + fs: Iterable[Future[_T]], timeout: float | None = None, return_when: str = "ALL_COMPLETED" +) -> DoneAndNotDoneFutures[_T]: ... class _Waiter: event: threading.Event finished_futures: list[Future[Any]] - def __init__(self) -> None: ... def add_result(self, future: Future[Any]) -> None: ... def add_exception(self, future: Future[Any]) -> None: ... def add_cancelled(self, future: Future[Any]) -> None: ... class _AsCompletedWaiter(_Waiter): lock: threading.Lock - def __init__(self) -> None: ... - def add_result(self, future: Future[Any]) -> None: ... - def add_exception(self, future: Future[Any]) -> None: ... - def add_cancelled(self, future: Future[Any]) -> None: ... -class _FirstCompletedWaiter(_Waiter): - def add_result(self, future: Future[Any]) -> None: ... - def add_exception(self, future: Future[Any]) -> None: ... - def add_cancelled(self, future: Future[Any]) -> None: ... +class _FirstCompletedWaiter(_Waiter): ... class _AllCompletedWaiter(_Waiter): num_pending_calls: int stop_on_exception: bool lock: threading.Lock def __init__(self, num_pending_calls: int, stop_on_exception: bool) -> None: ... - def add_result(self, future: Future[Any]) -> None: ... - def add_exception(self, future: Future[Any]) -> None: ... - def add_cancelled(self, future: Future[Any]) -> None: ... class _AcquireFutures: futures: Iterable[Future[Any]] def __init__(self, futures: Iterable[Future[Any]]) -> None: ... def __enter__(self) -> None: ... - def __exit__(self, *args: object) -> None: ... + def __exit__(self, *args: Unused) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/concurrent/futures/process.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/concurrent/futures/process.pyi index 211107cf3..85af2e7f8 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/concurrent/futures/process.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/concurrent/futures/process.pyi @@ -19,7 +19,6 @@ class _ThreadWakeup: _closed: bool _reader: Connection _writer: Connection - def __init__(self) -> None: ... def close(self) -> None: ... def wakeup(self) -> None: ... def clear(self) -> None: ... @@ -56,10 +55,10 @@ class _ResultItem: if sys.version_info >= (3, 11): exit_pid: int | None def __init__( - self, work_id: int, exception: Exception | None = ..., result: Any | None = ..., exit_pid: int | None = ... + self, work_id: int, exception: Exception | None = None, result: Any | None = None, exit_pid: int | None = None ) -> None: ... else: - def __init__(self, work_id: int, exception: Exception | None = ..., result: Any | None = ...) -> None: ... + def __init__(self, work_id: int, exception: Exception | None = None, result: Any | None = None) -> None: ... class _CallItem: work_id: int @@ -75,7 +74,7 @@ class _SafeQueue(Queue[Future[Any]]): if sys.version_info >= (3, 9): def __init__( self, - max_size: int | None = ..., + max_size: int | None = 0, *, ctx: BaseContext, pending_work_items: dict[int, _WorkItem[Any]], @@ -84,7 +83,7 @@ class _SafeQueue(Queue[Future[Any]]): ) -> None: ... else: def __init__( - self, max_size: int | None = ..., *, ctx: BaseContext, pending_work_items: dict[int, _WorkItem[Any]] + self, max_size: int | None = 0, *, ctx: BaseContext, pending_work_items: dict[int, _WorkItem[Any]] ) -> None: ... def _on_queue_feeder_error(self, e: Exception, obj: _CallItem) -> None: ... @@ -96,14 +95,14 @@ if sys.version_info >= (3, 11): def _sendback_result( result_queue: SimpleQueue[_WorkItem[Any]], work_id: int, - result: Any | None = ..., - exception: Exception | None = ..., - exit_pid: int | None = ..., + result: Any | None = None, + exception: Exception | None = None, + exit_pid: int | None = None, ) -> None: ... else: def _sendback_result( - result_queue: SimpleQueue[_WorkItem[Any]], work_id: int, result: Any | None = ..., exception: Exception | None = ... + result_queue: SimpleQueue[_WorkItem[Any]], work_id: int, result: Any | None = None, exception: Exception | None = None ) -> None: ... if sys.version_info >= (3, 11): @@ -112,7 +111,7 @@ if sys.version_info >= (3, 11): result_queue: SimpleQueue[_ResultItem], initializer: Callable[..., object] | None, initargs: tuple[Any, ...], - max_tasks: int | None = ..., + max_tasks: int | None = None, ) -> None: ... else: @@ -172,19 +171,19 @@ class ProcessPoolExecutor(Executor): if sys.version_info >= (3, 11): def __init__( self, - max_workers: int | None = ..., - mp_context: BaseContext | None = ..., - initializer: Callable[..., object] | None = ..., + max_workers: int | None = None, + mp_context: BaseContext | None = None, + initializer: Callable[..., object] | None = None, initargs: tuple[Any, ...] = ..., *, - max_tasks_per_child: int | None = ..., + max_tasks_per_child: int | None = None, ) -> None: ... else: def __init__( self, - max_workers: int | None = ..., - mp_context: BaseContext | None = ..., - initializer: Callable[..., object] | None = ..., + max_workers: int | None = None, + mp_context: BaseContext | None = None, + initializer: Callable[..., object] | None = None, initargs: tuple[Any, ...] = ..., ) -> None: ... if sys.version_info >= (3, 9): diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/concurrent/futures/thread.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/concurrent/futures/thread.pyi index 387ce0d7e..e43dd3dfa 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/concurrent/futures/thread.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/concurrent/futures/thread.pyi @@ -50,9 +50,9 @@ class ThreadPoolExecutor(Executor): _work_queue: queue.SimpleQueue[_WorkItem[Any]] def __init__( self, - max_workers: int | None = ..., - thread_name_prefix: str = ..., - initializer: Callable[..., object] | None = ..., + max_workers: int | None = None, + thread_name_prefix: str = "", + initializer: Callable[..., object] | None = None, initargs: tuple[Any, ...] = ..., ) -> None: ... def _adjust_thread_count(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/configparser.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/configparser.pyi index 00a23588b..2c5b68385 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/configparser.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/configparser.pyi @@ -65,32 +65,48 @@ class RawConfigParser(_Parser): @overload def __init__( self, - defaults: Mapping[str, str | None] | None = ..., + defaults: Mapping[str, str | None] | None = None, dict_type: type[Mapping[str, str]] = ..., - allow_no_value: Literal[True] = ..., *, + allow_no_value: Literal[True], delimiters: Sequence[str] = ..., comment_prefixes: Sequence[str] = ..., - inline_comment_prefixes: Sequence[str] | None = ..., - strict: bool = ..., - empty_lines_in_values: bool = ..., - default_section: str = ..., + inline_comment_prefixes: Sequence[str] | None = None, + strict: bool = True, + empty_lines_in_values: bool = True, + default_section: str = "DEFAULT", interpolation: Interpolation | None = ..., converters: _ConvertersMap = ..., ) -> None: ... @overload def __init__( self, - defaults: _Section | None = ..., + defaults: Mapping[str, str | None] | None, + dict_type: type[Mapping[str, str]], + allow_no_value: Literal[True], + *, + delimiters: Sequence[str] = ..., + comment_prefixes: Sequence[str] = ..., + inline_comment_prefixes: Sequence[str] | None = None, + strict: bool = True, + empty_lines_in_values: bool = True, + default_section: str = "DEFAULT", + interpolation: Interpolation | None = ..., + converters: _ConvertersMap = ..., + ) -> None: ... + @overload + def __init__( + self, + defaults: _Section | None = None, dict_type: type[Mapping[str, str]] = ..., - allow_no_value: bool = ..., + allow_no_value: bool = False, *, delimiters: Sequence[str] = ..., comment_prefixes: Sequence[str] = ..., - inline_comment_prefixes: Sequence[str] | None = ..., - strict: bool = ..., - empty_lines_in_values: bool = ..., - default_section: str = ..., + inline_comment_prefixes: Sequence[str] | None = None, + strict: bool = True, + empty_lines_in_values: bool = True, + default_section: str = "DEFAULT", interpolation: Interpolation | None = ..., converters: _ConvertersMap = ..., ) -> None: ... @@ -106,30 +122,30 @@ class RawConfigParser(_Parser): def has_section(self, section: str) -> bool: ... def options(self, section: str) -> list[str]: ... def has_option(self, section: str, option: str) -> bool: ... - def read(self, filenames: StrOrBytesPath | Iterable[StrOrBytesPath], encoding: str | None = ...) -> list[str]: ... - def read_file(self, f: Iterable[str], source: str | None = ...) -> None: ... - def read_string(self, string: str, source: str = ...) -> None: ... - def read_dict(self, dictionary: Mapping[str, Mapping[str, Any]], source: str = ...) -> None: ... - def readfp(self, fp: Iterable[str], filename: str | None = ...) -> None: ... + def read(self, filenames: StrOrBytesPath | Iterable[StrOrBytesPath], encoding: str | None = None) -> list[str]: ... + def read_file(self, f: Iterable[str], source: str | None = None) -> None: ... + def read_string(self, string: str, source: str = "") -> None: ... + def read_dict(self, dictionary: Mapping[str, Mapping[str, Any]], source: str = "") -> None: ... + def readfp(self, fp: Iterable[str], filename: str | None = None) -> None: ... # These get* methods are partially applied (with the same names) in # SectionProxy; the stubs should be kept updated together @overload - def getint(self, section: str, option: str, *, raw: bool = ..., vars: _Section | None = ...) -> int: ... + def getint(self, section: str, option: str, *, raw: bool = False, vars: _Section | None = None) -> int: ... @overload def getint( - self, section: str, option: str, *, raw: bool = ..., vars: _Section | None = ..., fallback: _T = ... + self, section: str, option: str, *, raw: bool = False, vars: _Section | None = None, fallback: _T = ... ) -> int | _T: ... @overload - def getfloat(self, section: str, option: str, *, raw: bool = ..., vars: _Section | None = ...) -> float: ... + def getfloat(self, section: str, option: str, *, raw: bool = False, vars: _Section | None = None) -> float: ... @overload def getfloat( - self, section: str, option: str, *, raw: bool = ..., vars: _Section | None = ..., fallback: _T = ... + self, section: str, option: str, *, raw: bool = False, vars: _Section | None = None, fallback: _T = ... ) -> float | _T: ... @overload - def getboolean(self, section: str, option: str, *, raw: bool = ..., vars: _Section | None = ...) -> bool: ... + def getboolean(self, section: str, option: str, *, raw: bool = False, vars: _Section | None = None) -> bool: ... @overload def getboolean( - self, section: str, option: str, *, raw: bool = ..., vars: _Section | None = ..., fallback: _T = ... + self, section: str, option: str, *, raw: bool = False, vars: _Section | None = None, fallback: _T = ... ) -> bool | _T: ... def _get_conv( self, @@ -137,21 +153,23 @@ class RawConfigParser(_Parser): option: str, conv: Callable[[str], _T], *, - raw: bool = ..., - vars: _Section | None = ..., + raw: bool = False, + vars: _Section | None = None, fallback: _T = ..., ) -> _T: ... # This is incompatible with MutableMapping so we ignore the type @overload # type: ignore[override] - def get(self, section: str, option: str, *, raw: bool = ..., vars: _Section | None = ...) -> str | Any: ... + def get(self, section: str, option: str, *, raw: bool = False, vars: _Section | None = None) -> str | Any: ... @overload - def get(self, section: str, option: str, *, raw: bool = ..., vars: _Section | None = ..., fallback: _T) -> str | _T | Any: ... + def get( + self, section: str, option: str, *, raw: bool = False, vars: _Section | None = None, fallback: _T + ) -> str | _T | Any: ... @overload - def items(self, *, raw: bool = ..., vars: _Section | None = ...) -> ItemsView[str, SectionProxy]: ... + def items(self, *, raw: bool = False, vars: _Section | None = None) -> ItemsView[str, SectionProxy]: ... @overload - def items(self, section: str, raw: bool = ..., vars: _Section | None = ...) -> list[tuple[str, str]]: ... - def set(self, section: str, option: str, value: str | None = ...) -> None: ... - def write(self, fp: SupportsWrite[str], space_around_delimiters: bool = ...) -> None: ... + def items(self, section: str, raw: bool = False, vars: _Section | None = None) -> list[tuple[str, str]]: ... + def set(self, section: str, option: str, value: str | None = None) -> None: ... + def write(self, fp: SupportsWrite[str], space_around_delimiters: bool = True) -> None: ... def remove_option(self, section: str, option: str) -> bool: ... def remove_section(self, section: str) -> bool: ... def optionxform(self, optionstr: str) -> str: ... @@ -159,9 +177,9 @@ class RawConfigParser(_Parser): class ConfigParser(RawConfigParser): # This is incompatible with MutableMapping so we ignore the type @overload # type: ignore[override] - def get(self, section: str, option: str, *, raw: bool = ..., vars: _Section | None = ...) -> str: ... + def get(self, section: str, option: str, *, raw: bool = False, vars: _Section | None = None) -> str: ... @overload - def get(self, section: str, option: str, *, raw: bool = ..., vars: _Section | None = ..., fallback: _T) -> str | _T: ... + def get(self, section: str, option: str, *, raw: bool = False, vars: _Section | None = None, fallback: _T) -> str | _T: ... if sys.version_info < (3, 12): class SafeConfigParser(ConfigParser): ... # deprecated alias @@ -181,11 +199,11 @@ class SectionProxy(MutableMapping[str, str]): def get( # type: ignore[override] self, option: str, - fallback: str | None = ..., + fallback: str | None = None, *, - raw: bool = ..., - vars: _Section | None = ..., - _impl: Any | None = ..., + raw: bool = False, + vars: _Section | None = None, + _impl: Any | None = None, **kwargs: Any, ) -> str | Any: ... # can be None in RawConfigParser's sections # These are partially-applied version of the methods with the same names in @@ -216,7 +234,7 @@ class ConverterMapping(MutableMapping[str, _ConverterCallback | None]): class Error(Exception): message: str - def __init__(self, msg: str = ...) -> None: ... + def __init__(self, msg: str = "") -> None: ... class NoSectionError(Error): section: str @@ -226,14 +244,14 @@ class DuplicateSectionError(Error): section: str source: str | None lineno: int | None - def __init__(self, section: str, source: str | None = ..., lineno: int | None = ...) -> None: ... + def __init__(self, section: str, source: str | None = None, lineno: int | None = None) -> None: ... class DuplicateOptionError(Error): section: str option: str source: str | None lineno: int | None - def __init__(self, section: str, option: str, source: str | None = ..., lineno: int | None = ...) -> None: ... + def __init__(self, section: str, option: str, source: str | None = None, lineno: int | None = None) -> None: ... class NoOptionError(Error): section: str @@ -257,7 +275,7 @@ class InterpolationSyntaxError(InterpolationError): ... class ParsingError(Error): source: str errors: list[tuple[int, str]] - def __init__(self, source: str | None = ..., filename: str | None = ...) -> None: ... + def __init__(self, source: str | None = None, filename: str | None = None) -> None: ... def append(self, lineno: int, line: str) -> None: ... class MissingSectionHeaderError(ParsingError): diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/contextlib.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/contextlib.pyi index 83f1cbf08..dc2101dc0 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/contextlib.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/contextlib.pyi @@ -1,10 +1,11 @@ +import abc import sys -from _typeshed import Self, StrOrBytesPath +from _typeshed import FileDescriptorOrPath, Unused from abc import 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 -from typing_extensions import ParamSpec, TypeAlias +from typing_extensions import ParamSpec, Self, TypeAlias __all__ = [ "contextmanager", @@ -63,9 +64,14 @@ class _GeneratorContextManager(AbstractContextManager[_T_co], ContextDecorator, func: Callable[..., Generator[_T_co, Any, Any]] args: tuple[Any, ...] kwds: dict[str, Any] - def __exit__( - self, typ: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None - ) -> bool | None: ... + if sys.version_info >= (3, 9): + def __exit__( + self, typ: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None + ) -> bool | None: ... + else: + def __exit__( + self, type: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None + ) -> bool | None: ... def contextmanager(func: Callable[_P, Iterator[_T_co]]) -> Callable[_P, _GeneratorContextManager[_T_co]]: ... @@ -107,7 +113,7 @@ _SupportsCloseT = TypeVar("_SupportsCloseT", bound=_SupportsClose) class closing(AbstractContextManager[_SupportsCloseT]): def __init__(self, thing: _SupportsCloseT) -> None: ... - def __exit__(self, *exc_info: object) -> None: ... + def __exit__(self, *exc_info: Unused) -> None: ... if sys.version_info >= (3, 10): class _SupportsAclose(Protocol): @@ -116,7 +122,7 @@ if sys.version_info >= (3, 10): class aclosing(AbstractAsyncContextManager[_SupportsAcloseT]): def __init__(self, thing: _SupportsAcloseT) -> None: ... - async def __aexit__(self, *exc_info: object) -> None: ... + async def __aexit__(self, *exc_info: Unused) -> None: ... class suppress(AbstractContextManager[None]): def __init__(self, *exceptions: type[BaseException]) -> None: ... @@ -133,23 +139,27 @@ class _RedirectStream(AbstractContextManager[_T_io]): class redirect_stdout(_RedirectStream[_T_io]): ... class redirect_stderr(_RedirectStream[_T_io]): ... -class ExitStack: - def __init__(self) -> None: ... +# In reality this is a subclass of `AbstractContextManager`; +# see #7961 for why we don't do that in the stub +class ExitStack(metaclass=abc.ABCMeta): def enter_context(self, cm: AbstractContextManager[_T]) -> _T: ... def push(self, exit: _CM_EF) -> _CM_EF: ... def callback(self, __callback: Callable[_P, _T], *args: _P.args, **kwds: _P.kwargs) -> Callable[_P, _T]: ... - def pop_all(self: Self) -> Self: ... + def pop_all(self) -> Self: ... def close(self) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, __exc_type: type[BaseException] | None, __exc_value: BaseException | None, __traceback: TracebackType | None ) -> bool: ... -_ExitCoroFunc: TypeAlias = Callable[[type[BaseException] | None, BaseException | None, TracebackType | None], Awaitable[bool]] +_ExitCoroFunc: TypeAlias = Callable[ + [type[BaseException] | None, BaseException | None, TracebackType | None], Awaitable[bool | None] +] _ACM_EF = TypeVar("_ACM_EF", bound=AbstractAsyncContextManager[Any] | _ExitCoroFunc) -class AsyncExitStack: - def __init__(self) -> None: ... +# In reality this is a subclass of `AbstractAsyncContextManager`; +# see #7961 for why we don't do that in the stub +class AsyncExitStack(metaclass=abc.ABCMeta): def enter_context(self, cm: AbstractContextManager[_T]) -> _T: ... async def enter_async_context(self, cm: AbstractAsyncContextManager[_T]) -> _T: ... def push(self, exit: _CM_EF) -> _CM_EF: ... @@ -158,9 +168,9 @@ class AsyncExitStack: def push_async_callback( self, __callback: Callable[_P, Awaitable[_T]], *args: _P.args, **kwds: _P.kwargs ) -> Callable[_P, Awaitable[_T]]: ... - def pop_all(self: Self) -> Self: ... + def pop_all(self) -> Self: ... async def aclose(self) -> None: ... - async def __aenter__(self: Self) -> Self: ... + async def __aenter__(self) -> Self: ... async def __aexit__( self, __exc_type: type[BaseException] | None, __exc_value: BaseException | None, __traceback: TracebackType | None ) -> bool: ... @@ -169,29 +179,29 @@ if sys.version_info >= (3, 10): class nullcontext(AbstractContextManager[_T], AbstractAsyncContextManager[_T]): enter_result: _T @overload - def __init__(self: nullcontext[None], enter_result: None = ...) -> None: ... + def __init__(self: nullcontext[None], enter_result: None = None) -> None: ... @overload def __init__(self: nullcontext[_T], enter_result: _T) -> None: ... def __enter__(self) -> _T: ... - def __exit__(self, *exctype: object) -> None: ... + def __exit__(self, *exctype: Unused) -> None: ... async def __aenter__(self) -> _T: ... - async def __aexit__(self, *exctype: object) -> None: ... + async def __aexit__(self, *exctype: Unused) -> None: ... else: class nullcontext(AbstractContextManager[_T]): enter_result: _T @overload - def __init__(self: nullcontext[None], enter_result: None = ...) -> None: ... + def __init__(self: nullcontext[None], enter_result: None = None) -> None: ... @overload def __init__(self: nullcontext[_T], enter_result: _T) -> None: ... def __enter__(self) -> _T: ... - def __exit__(self, *exctype: object) -> None: ... + def __exit__(self, *exctype: Unused) -> None: ... if sys.version_info >= (3, 11): - _T_fd_or_any_path = TypeVar("_T_fd_or_any_path", bound=int | StrOrBytesPath) + _T_fd_or_any_path = TypeVar("_T_fd_or_any_path", bound=FileDescriptorOrPath) class chdir(AbstractContextManager[None], Generic[_T_fd_or_any_path]): path: _T_fd_or_any_path def __init__(self, path: _T_fd_or_any_path) -> None: ... def __enter__(self) -> None: ... - def __exit__(self, *excinfo: object) -> None: ... + def __exit__(self, *excinfo: Unused) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/contextvars.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/contextvars.pyi index 266d96bce..ef6e2700e 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/contextvars.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/contextvars.pyi @@ -22,8 +22,13 @@ class ContextVar(Generic[_T]): def name(self) -> str: ... @overload def get(self) -> _T: ... - @overload - def get(self, default: _D | _T) -> _D | _T: ... + if sys.version_info >= (3, 8): + @overload + def get(self, default: _D | _T) -> _D | _T: ... + else: + @overload + def get(self, __default: _D | _T) -> _D | _T: ... + def set(self, __value: _T) -> Token[_T]: ... def reset(self, __token: Token[_T]) -> None: ... if sys.version_info >= (3, 9): diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/copy.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/copy.pyi index b53f418b3..f68965d3d 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/copy.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/copy.pyi @@ -8,7 +8,7 @@ _T = TypeVar("_T") PyStringMap: Any # Note: memo and _nil are internal kwargs. -def deepcopy(x: _T, memo: dict[int, Any] | None = ..., _nil: Any = ...) -> _T: ... +def deepcopy(x: _T, memo: dict[int, Any] | None = None, _nil: Any = ...) -> _T: ... def copy(x: _T) -> _T: ... class Error(Exception): ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/copyreg.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/copyreg.pyi index 4403550b5..8f7fd957f 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/copyreg.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/copyreg.pyi @@ -1,16 +1,16 @@ from collections.abc import Callable, Hashable -from typing import Any, SupportsInt, TypeVar, Union +from typing import Any, SupportsInt, TypeVar from typing_extensions import TypeAlias _T = TypeVar("_T") -_Reduce: TypeAlias = Union[tuple[Callable[..., _T], tuple[Any, ...]], tuple[Callable[..., _T], tuple[Any, ...], Any | None]] +_Reduce: TypeAlias = tuple[Callable[..., _T], tuple[Any, ...]] | tuple[Callable[..., _T], tuple[Any, ...], Any | None] __all__ = ["pickle", "constructor", "add_extension", "remove_extension", "clear_extension_cache"] def pickle( ob_type: type[_T], pickle_function: Callable[[_T], str | _Reduce[_T]], - constructor_ob: Callable[[_Reduce[_T]], _T] | None = ..., + constructor_ob: Callable[[_Reduce[_T]], _T] | None = None, ) -> None: ... def constructor(object: Callable[[_Reduce[_T]], _T]) -> None: ... def add_extension(module: Hashable, name: Hashable, code: SupportsInt) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/crypt.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/crypt.pyi index 83ad45d5c..1ad0a384e 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/crypt.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/crypt.pyi @@ -8,5 +8,5 @@ if sys.platform != "win32": METHOD_SHA512: _Method METHOD_BLOWFISH: _Method methods: list[_Method] - def mksalt(method: _Method | None = ..., *, rounds: int | None = ...) -> str: ... - def crypt(word: str, salt: str | _Method | None = ...) -> str: ... + def mksalt(method: _Method | None = None, *, rounds: int | None = None) -> str: ... + def crypt(word: str, salt: str | _Method | None = None) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/csv.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/csv.pyi index e9552c759..59f2e7a3c 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/csv.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/csv.pyi @@ -21,10 +21,10 @@ from _csv import ( unregister_dialect as unregister_dialect, writer as writer, ) -from _typeshed import Self, SupportsWrite +from _typeshed import SupportsWrite from collections.abc import Collection, Iterable, Iterator, Mapping, Sequence from typing import Any, Generic, TypeVar, overload -from typing_extensions import Literal +from typing_extensions import Literal, Self if sys.version_info >= (3, 8): from builtins import dict as _DictReadMapping @@ -60,24 +60,9 @@ __all__ = [ _T = TypeVar("_T") -class excel(Dialect): - delimiter: str - quotechar: str - doublequote: bool - skipinitialspace: bool - lineterminator: str - quoting: _QuotingType - -class excel_tab(excel): - delimiter: str - -class unix_dialect(Dialect): - delimiter: str - quotechar: str - doublequote: bool - skipinitialspace: bool - lineterminator: str - quoting: _QuotingType +class excel(Dialect): ... +class excel_tab(excel): ... +class unix_dialect(Dialect): ... class DictReader(Generic[_T], Iterator[_DictReadMapping[_T | Any, str | Any]]): fieldnames: Sequence[_T] | None @@ -91,38 +76,38 @@ class DictReader(Generic[_T], Iterator[_DictReadMapping[_T | Any, str | Any]]): self, f: Iterable[str], fieldnames: Sequence[_T], - restkey: str | None = ..., - restval: str | None = ..., - dialect: _DialectLike = ..., + restkey: str | None = None, + restval: str | None = None, + dialect: _DialectLike = "excel", *, - delimiter: str = ..., - quotechar: str | None = ..., - escapechar: str | None = ..., - doublequote: bool = ..., - skipinitialspace: bool = ..., - lineterminator: str = ..., - quoting: _QuotingType = ..., - strict: bool = ..., + delimiter: str = ",", + quotechar: str | None = '"', + escapechar: str | None = None, + doublequote: bool = True, + skipinitialspace: bool = False, + lineterminator: str = "\r\n", + quoting: _QuotingType = 0, + strict: bool = False, ) -> None: ... @overload def __init__( self: DictReader[str], f: Iterable[str], - fieldnames: Sequence[str] | None = ..., - restkey: str | None = ..., - restval: str | None = ..., - dialect: _DialectLike = ..., + fieldnames: Sequence[str] | None = None, + restkey: str | None = None, + restval: str | None = None, + dialect: _DialectLike = "excel", *, - delimiter: str = ..., - quotechar: str | None = ..., - escapechar: str | None = ..., - doublequote: bool = ..., - skipinitialspace: bool = ..., - lineterminator: str = ..., - quoting: _QuotingType = ..., - strict: bool = ..., + delimiter: str = ",", + quotechar: str | None = '"', + escapechar: str | None = None, + doublequote: bool = True, + skipinitialspace: bool = False, + lineterminator: str = "\r\n", + quoting: _QuotingType = 0, + strict: bool = False, ) -> None: ... - def __iter__(self: Self) -> Self: ... + def __iter__(self) -> Self: ... def __next__(self) -> _DictReadMapping[_T | Any, str | Any]: ... if sys.version_info >= (3, 12): def __class_getitem__(cls, item: Any) -> GenericAlias: ... @@ -136,18 +121,18 @@ class DictWriter(Generic[_T]): self, f: SupportsWrite[str], fieldnames: Collection[_T], - restval: Any | None = ..., - extrasaction: Literal["raise", "ignore"] = ..., - dialect: _DialectLike = ..., + restval: Any | None = "", + extrasaction: Literal["raise", "ignore"] = "raise", + dialect: _DialectLike = "excel", *, - delimiter: str = ..., - quotechar: str | None = ..., - escapechar: str | None = ..., - doublequote: bool = ..., - skipinitialspace: bool = ..., - lineterminator: str = ..., - quoting: _QuotingType = ..., - strict: bool = ..., + delimiter: str = ",", + quotechar: str | None = '"', + escapechar: str | None = None, + doublequote: bool = True, + skipinitialspace: bool = False, + lineterminator: str = "\r\n", + quoting: _QuotingType = 0, + strict: bool = False, ) -> None: ... if sys.version_info >= (3, 8): def writeheader(self) -> Any: ... @@ -161,6 +146,5 @@ class DictWriter(Generic[_T]): class Sniffer: preferred: list[str] - def __init__(self) -> None: ... - def sniff(self, sample: str, delimiters: str | None = ...) -> type[Dialect]: ... + def sniff(self, sample: str, delimiters: str | None = None) -> type[Dialect]: ... def has_header(self, sample: str) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/ctypes/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/ctypes/__init__.pyi index 48694fc6c..f4f1dae14 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/ctypes/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/ctypes/__init__.pyi @@ -1,9 +1,10 @@ import sys -from _typeshed import ReadableBuffer, Self, WriteableBuffer +from _ctypes import RTLD_GLOBAL as RTLD_GLOBAL, RTLD_LOCAL as RTLD_LOCAL +from _typeshed import ReadableBuffer, WriteableBuffer from abc import abstractmethod from collections.abc import Callable, Iterable, Iterator, Mapping, Sequence -from typing import Any, ClassVar, Generic, TypeVar, Union as _UnionT, overload -from typing_extensions import TypeAlias +from typing import Any, ClassVar, Generic, TypeVar, overload +from typing_extensions import Self, TypeAlias if sys.version_info >= (3, 9): from types import GenericAlias @@ -12,8 +13,6 @@ _T = TypeVar("_T") _DLLT = TypeVar("_DLLT", bound=CDLL) _CT = TypeVar("_CT", bound=_CData) -RTLD_GLOBAL: int -RTLD_LOCAL: int DEFAULT_MODE: int class CDLL: @@ -27,14 +26,19 @@ class CDLL: self, name: str | None, mode: int = ..., - handle: int | None = ..., - use_errno: bool = ..., - use_last_error: bool = ..., - winmode: int | None = ..., + handle: int | None = None, + use_errno: bool = False, + use_last_error: bool = False, + winmode: int | None = None, ) -> None: ... else: def __init__( - self, name: str | None, mode: int = ..., handle: int | None = ..., use_errno: bool = ..., use_last_error: bool = ... + self, + name: str | None, + mode: int = ..., + handle: int | None = None, + use_errno: bool = False, + use_last_error: bool = False, ) -> None: ... def __getattr__(self, name: str) -> _NamedFuncPointer: ... @@ -65,29 +69,29 @@ class _CDataMeta(type): # By default mypy complains about the following two methods, because strictly speaking cls # might not be a Type[_CT]. However this can never actually happen, because the only class that # uses _CDataMeta as its metaclass is _CData. So it's safe to ignore the errors here. - def __mul__(cls: type[_CT], other: int) -> type[Array[_CT]]: ... # type: ignore[misc] - def __rmul__(cls: type[_CT], other: int) -> type[Array[_CT]]: ... # type: ignore[misc] + def __mul__(cls: type[_CT], other: int) -> type[Array[_CT]]: ... # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues] + def __rmul__(cls: type[_CT], other: int) -> type[Array[_CT]]: ... # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues] class _CData(metaclass=_CDataMeta): - _b_base: int + _b_base_: int _b_needsfree_: bool _objects: Mapping[Any, int] | None @classmethod - def from_buffer(cls: type[Self], source: WriteableBuffer, offset: int = ...) -> Self: ... + def from_buffer(cls, source: WriteableBuffer, offset: int = ...) -> Self: ... @classmethod - def from_buffer_copy(cls: type[Self], source: ReadableBuffer, offset: int = ...) -> Self: ... + def from_buffer_copy(cls, source: ReadableBuffer, offset: int = ...) -> Self: ... @classmethod - def from_address(cls: type[Self], address: int) -> Self: ... + def from_address(cls, address: int) -> Self: ... @classmethod - def from_param(cls: type[Self], obj: Any) -> Self | _CArgObject: ... + def from_param(cls, obj: Any) -> Self | _CArgObject: ... @classmethod - def in_dll(cls: type[Self], library: CDLL, name: str) -> Self: ... + def in_dll(cls, library: CDLL, name: str) -> Self: ... class _CanCastTo(_CData): ... class _PointerLike(_CanCastTo): ... _ECT: TypeAlias = Callable[[type[_CData] | None, _FuncPointer, tuple[_CData, ...]], _CData] -_PF: TypeAlias = _UnionT[tuple[int], tuple[int, str], tuple[int, str, Any]] +_PF: TypeAlias = tuple[int] | tuple[int, str] | tuple[int, str, Any] class _FuncPointer(_PointerLike, _CData): restype: type[_CData] | Callable[[int], Any] | None @@ -137,11 +141,11 @@ def byref(obj: _CData, offset: int = ...) -> _CArgObject: ... _CastT = TypeVar("_CastT", bound=_CanCastTo) def cast(obj: _CData | _CArgObject | int, typ: type[_CastT]) -> _CastT: ... -def create_string_buffer(init: int | bytes, size: int | None = ...) -> Array[c_char]: ... +def create_string_buffer(init: int | bytes, size: int | None = None) -> Array[c_char]: ... c_buffer = create_string_buffer -def create_unicode_buffer(init: int | str, size: int | None = ...) -> Array[c_wchar]: ... +def create_unicode_buffer(init: int | str, size: int | None = None) -> Array[c_wchar]: ... if sys.platform == "win32": def DllCanUnloadNow() -> int: ... @@ -166,13 +170,10 @@ class _Pointer(Generic[_CT], _PointerLike, _CData): @overload def __init__(self, arg: _CT) -> None: ... @overload - def __getitem__(self, __i: int) -> _CT: ... + def __getitem__(self, __key: int) -> Any: ... @overload - def __getitem__(self, __s: slice) -> list[_CT]: ... - @overload - def __setitem__(self, __i: int, __o: _CT) -> None: ... - @overload - def __setitem__(self, __s: slice, __o: Iterable[_CT]) -> None: ... + def __getitem__(self, __key: slice) -> list[Any]: ... + def __setitem__(self, __key: int, __value: Any) -> None: ... def pointer(__arg: _CT) -> _Pointer[_CT]: ... def resize(obj: _CData, size: int) -> None: ... @@ -182,12 +183,12 @@ if sys.platform == "win32": def set_last_error(value: int) -> int: ... def sizeof(obj_or_type: _CData | type[_CData]) -> int: ... -def string_at(address: _CVoidConstPLike, size: int = ...) -> bytes: ... +def string_at(address: _CVoidConstPLike, size: int = -1) -> bytes: ... if sys.platform == "win32": - def WinError(code: int | None = ..., descr: str | None = ...) -> OSError: ... + def WinError(code: int | None = None, descr: str | None = None) -> OSError: ... -def wstring_at(address: _CVoidConstPLike, size: int = ...) -> str: ... +def wstring_at(address: _CVoidConstPLike, size: int = -1) -> str: ... class _SimpleCData(Generic[_T], _CData): value: _T @@ -198,7 +199,7 @@ class _SimpleCData(Generic[_T], _CData): class c_byte(_SimpleCData[int]): ... class c_char(_SimpleCData[bytes]): - def __init__(self, value: int | bytes = ...) -> None: ... + def __init__(self, value: int | bytes | bytearray = ...) -> None: ... class c_char_p(_PointerLike, _SimpleCData[bytes | None]): def __init__(self, value: int | bytes | None = ...) -> None: ... @@ -270,7 +271,11 @@ class Array(Generic[_CT], _CData): def _type_(self) -> type[_CT]: ... @_type_.setter def _type_(self, value: type[_CT]) -> None: ... - raw: bytes # Note: only available if _CT == c_char + # Note: only available if _CT == c_char + @property + def raw(self) -> bytes: ... + @raw.setter + def raw(self, value: ReadableBuffer) -> None: ... value: Any # Note: bytes if _CT == c_char, str if _CT == c_wchar, unavailable otherwise # TODO These methods cannot be annotated correctly at the moment. # All of these "Any"s stand for the array's element type, but it's not possible to use _CT @@ -286,13 +291,13 @@ class Array(Generic[_CT], _CData): # the array element type would belong are annotated with Any instead. def __init__(self, *args: Any) -> None: ... @overload - def __getitem__(self, __i: int) -> Any: ... + def __getitem__(self, __key: int) -> Any: ... @overload - def __getitem__(self, __s: slice) -> list[Any]: ... + def __getitem__(self, __key: slice) -> list[Any]: ... @overload - def __setitem__(self, __i: int, __o: Any) -> None: ... + def __setitem__(self, __key: int, __value: Any) -> None: ... @overload - def __setitem__(self, __s: slice, __o: Iterable[Any]) -> None: ... + def __setitem__(self, __key: slice, __value: Iterable[Any]) -> None: ... def __iter__(self) -> Iterator[Any]: ... # Can't inherit from Sized because the metaclass conflict between # Sized and _CData prevents using _CDataMeta. diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/curses/textpad.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/curses/textpad.pyi index ad9983431..4d28b4dfb 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/curses/textpad.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/curses/textpad.pyi @@ -7,7 +7,7 @@ if sys.platform != "win32": class Textbox: stripspaces: bool - def __init__(self, win: _CursesWindow, insert_mode: bool = ...) -> None: ... - def edit(self, validate: Callable[[int], int] | None = ...) -> str: ... + def __init__(self, win: _CursesWindow, insert_mode: bool = False) -> None: ... + def edit(self, validate: Callable[[int], int] | None = None) -> str: ... def do_command(self, ch: str | int) -> None: ... def gather(self) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/dataclasses.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/dataclasses.pyi index 04ae771fc..d254a594d 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/dataclasses.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/dataclasses.pyi @@ -1,10 +1,11 @@ import enum import sys import types +from _typeshed import DataclassInstance from builtins import type as Type # alias to avoid name clashes with fields named "type" from collections.abc import Callable, Iterable, Mapping from typing import Any, Generic, Protocol, TypeVar, overload -from typing_extensions import Literal +from typing_extensions import Literal, TypeAlias, TypeGuard if sys.version_info >= (3, 9): from types import GenericAlias @@ -30,6 +31,8 @@ __all__ = [ if sys.version_info >= (3, 10): __all__ += ["KW_ONLY"] +_DataclassT = TypeVar("_DataclassT", bound=DataclassInstance) + # define _MISSING_TYPE as an enum within the type stubs, # even though that is not really its type at runtime # this allows us to use Literal[_MISSING_TYPE.MISSING] @@ -44,62 +47,68 @@ if sys.version_info >= (3, 10): class KW_ONLY: ... @overload -def asdict(obj: Any) -> dict[str, Any]: ... +def asdict(obj: DataclassInstance) -> dict[str, Any]: ... @overload -def asdict(obj: Any, *, dict_factory: Callable[[list[tuple[str, Any]]], _T]) -> _T: ... +def asdict(obj: DataclassInstance, *, dict_factory: Callable[[list[tuple[str, Any]]], _T]) -> _T: ... @overload -def astuple(obj: Any) -> tuple[Any, ...]: ... +def astuple(obj: DataclassInstance) -> tuple[Any, ...]: ... @overload -def astuple(obj: Any, *, tuple_factory: Callable[[list[Any]], _T]) -> _T: ... +def astuple(obj: DataclassInstance, *, tuple_factory: Callable[[list[Any]], _T]) -> _T: ... if sys.version_info >= (3, 8): # cls argument is now positional-only @overload - def dataclass(__cls: type[_T]) -> type[_T]: ... - @overload def dataclass(__cls: None) -> Callable[[type[_T]], type[_T]]: ... + @overload + def dataclass(__cls: type[_T]) -> type[_T]: ... else: - @overload - def dataclass(_cls: type[_T]) -> type[_T]: ... @overload def dataclass(_cls: None) -> Callable[[type[_T]], type[_T]]: ... + @overload + def dataclass(_cls: type[_T]) -> type[_T]: ... if sys.version_info >= (3, 11): @overload def dataclass( *, - init: bool = ..., - repr: bool = ..., - eq: bool = ..., - order: bool = ..., - unsafe_hash: bool = ..., - frozen: bool = ..., - match_args: bool = ..., - kw_only: bool = ..., - slots: bool = ..., - weakref_slot: bool = ..., + init: bool = True, + repr: bool = True, + eq: bool = True, + order: bool = False, + unsafe_hash: bool = False, + frozen: bool = False, + match_args: bool = True, + kw_only: bool = False, + slots: bool = False, + weakref_slot: bool = False, ) -> Callable[[type[_T]], type[_T]]: ... elif sys.version_info >= (3, 10): @overload def dataclass( *, - init: bool = ..., - repr: bool = ..., - eq: bool = ..., - order: bool = ..., - unsafe_hash: bool = ..., - frozen: bool = ..., - match_args: bool = ..., - kw_only: bool = ..., - slots: bool = ..., + init: bool = True, + repr: bool = True, + eq: bool = True, + order: bool = False, + unsafe_hash: bool = False, + frozen: bool = False, + match_args: bool = True, + kw_only: bool = False, + slots: bool = False, ) -> Callable[[type[_T]], type[_T]]: ... else: @overload def dataclass( - *, init: bool = ..., repr: bool = ..., eq: bool = ..., order: bool = ..., unsafe_hash: bool = ..., frozen: bool = ... + *, + init: bool = True, + repr: bool = True, + eq: bool = True, + order: bool = False, + unsafe_hash: bool = False, + frozen: bool = False, ) -> Callable[[type[_T]], type[_T]]: ... # See https://github.com/python/mypy/issues/10750 @@ -152,32 +161,32 @@ if sys.version_info >= (3, 10): def field( *, default: _T, - init: bool = ..., - repr: bool = ..., - hash: bool | None = ..., - compare: bool = ..., - metadata: Mapping[Any, Any] | None = ..., + init: bool = True, + repr: bool = True, + hash: bool | None = None, + compare: bool = True, + metadata: Mapping[Any, Any] | None = None, kw_only: bool = ..., ) -> _T: ... @overload def field( *, default_factory: Callable[[], _T], - init: bool = ..., - repr: bool = ..., - hash: bool | None = ..., - compare: bool = ..., - metadata: Mapping[Any, Any] | None = ..., + init: bool = True, + repr: bool = True, + hash: bool | None = None, + compare: bool = True, + metadata: Mapping[Any, Any] | None = None, kw_only: bool = ..., ) -> _T: ... @overload def field( *, - init: bool = ..., - repr: bool = ..., - hash: bool | None = ..., - compare: bool = ..., - metadata: Mapping[Any, Any] | None = ..., + init: bool = True, + repr: bool = True, + hash: bool | None = None, + compare: bool = True, + metadata: Mapping[Any, Any] | None = None, kw_only: bool = ..., ) -> Any: ... @@ -186,38 +195,50 @@ else: def field( *, default: _T, - init: bool = ..., - repr: bool = ..., - hash: bool | None = ..., - compare: bool = ..., - metadata: Mapping[Any, Any] | None = ..., + init: bool = True, + repr: bool = True, + hash: bool | None = None, + compare: bool = True, + metadata: Mapping[Any, Any] | None = None, ) -> _T: ... @overload def field( *, default_factory: Callable[[], _T], - init: bool = ..., - repr: bool = ..., - hash: bool | None = ..., - compare: bool = ..., - metadata: Mapping[Any, Any] | None = ..., + init: bool = True, + repr: bool = True, + hash: bool | None = None, + compare: bool = True, + metadata: Mapping[Any, Any] | None = None, ) -> _T: ... @overload def field( *, - init: bool = ..., - repr: bool = ..., - hash: bool | None = ..., - compare: bool = ..., - metadata: Mapping[Any, Any] | None = ..., + init: bool = True, + repr: bool = True, + hash: bool | None = None, + compare: bool = True, + metadata: Mapping[Any, Any] | None = None, ) -> Any: ... -def fields(class_or_instance: Any) -> tuple[Field[Any], ...]: ... -def is_dataclass(obj: Any) -> bool: ... +def fields(class_or_instance: DataclassInstance | type[DataclassInstance]) -> tuple[Field[Any], ...]: ... +@overload +def is_dataclass(obj: DataclassInstance) -> Literal[True]: ... +@overload +def is_dataclass(obj: type) -> TypeGuard[type[DataclassInstance]]: ... +@overload +def is_dataclass(obj: object) -> TypeGuard[DataclassInstance | type[DataclassInstance]]: ... class FrozenInstanceError(AttributeError): ... -class InitVar(Generic[_T]): +if sys.version_info >= (3, 9): + _InitVarMeta: TypeAlias = type +else: + class _InitVarMeta(type): + # Not used, instead `InitVar.__class_getitem__` is called. + def __getitem__(self, params: Any) -> InitVar[Any]: ... + +class InitVar(Generic[_T], metaclass=_InitVarMeta): type: Type[_T] def __init__(self, type: Type[_T]) -> None: ... if sys.version_info >= (3, 9): @@ -232,17 +253,17 @@ if sys.version_info >= (3, 11): fields: Iterable[str | tuple[str, type] | tuple[str, type, Any]], *, bases: tuple[type, ...] = ..., - namespace: dict[str, Any] | None = ..., - init: bool = ..., - repr: bool = ..., - eq: bool = ..., - order: bool = ..., - unsafe_hash: bool = ..., - frozen: bool = ..., - match_args: bool = ..., - kw_only: bool = ..., - slots: bool = ..., - weakref_slot: bool = ..., + namespace: dict[str, Any] | None = None, + init: bool = True, + repr: bool = True, + eq: bool = True, + order: bool = False, + unsafe_hash: bool = False, + frozen: bool = False, + match_args: bool = True, + kw_only: bool = False, + slots: bool = False, + weakref_slot: bool = False, ) -> type: ... elif sys.version_info >= (3, 10): @@ -251,16 +272,16 @@ elif sys.version_info >= (3, 10): fields: Iterable[str | tuple[str, type] | tuple[str, type, Any]], *, bases: tuple[type, ...] = ..., - namespace: dict[str, Any] | None = ..., - init: bool = ..., - repr: bool = ..., - eq: bool = ..., - order: bool = ..., - unsafe_hash: bool = ..., - frozen: bool = ..., - match_args: bool = ..., - kw_only: bool = ..., - slots: bool = ..., + namespace: dict[str, Any] | None = None, + init: bool = True, + repr: bool = True, + eq: bool = True, + order: bool = False, + unsafe_hash: bool = False, + frozen: bool = False, + match_args: bool = True, + kw_only: bool = False, + slots: bool = False, ) -> type: ... else: @@ -269,13 +290,13 @@ else: fields: Iterable[str | tuple[str, type] | tuple[str, type, Any]], *, bases: tuple[type, ...] = ..., - namespace: dict[str, Any] | None = ..., - init: bool = ..., - repr: bool = ..., - eq: bool = ..., - order: bool = ..., - unsafe_hash: bool = ..., - frozen: bool = ..., + namespace: dict[str, Any] | None = None, + init: bool = True, + repr: bool = True, + eq: bool = True, + order: bool = False, + unsafe_hash: bool = False, + frozen: bool = False, ) -> type: ... -def replace(__obj: _T, **changes: Any) -> _T: ... +def replace(__obj: _DataclassT, **changes: Any) -> _DataclassT: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/datetime.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/datetime.pyi index 780ee941b..f78737e98 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/datetime.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/datetime.pyi @@ -1,8 +1,8 @@ import sys -from _typeshed import Self +from abc import abstractmethod from time import struct_time -from typing import ClassVar, NamedTuple, NoReturn, SupportsAbs, TypeVar, overload -from typing_extensions import Literal, TypeAlias, final +from typing import ClassVar, NamedTuple, NoReturn, TypeVar, overload +from typing_extensions import Literal, Self, TypeAlias, final if sys.version_info >= (3, 11): __all__ = ("date", "datetime", "time", "timedelta", "timezone", "tzinfo", "MINYEAR", "MAXYEAR", "UTC") @@ -15,8 +15,11 @@ MINYEAR: Literal[1] MAXYEAR: Literal[9999] class tzinfo: + @abstractmethod def tzname(self, __dt: datetime | None) -> str | None: ... + @abstractmethod def utcoffset(self, __dt: datetime | None) -> timedelta | None: ... + @abstractmethod def dst(self, __dt: datetime | None) -> timedelta | None: ... def fromutc(self, __dt: datetime) -> datetime: ... @@ -29,6 +32,9 @@ class timezone(tzinfo): min: ClassVar[timezone] max: ClassVar[timezone] def __init__(self, offset: timedelta, name: str = ...) -> None: ... + def tzname(self, __dt: datetime | None) -> str: ... + def utcoffset(self, __dt: datetime | None) -> timedelta: ... + def dst(self, __dt: datetime | None) -> None: ... if sys.version_info >= (3, 11): UTC: timezone @@ -43,18 +49,18 @@ class date: min: ClassVar[date] max: ClassVar[date] resolution: ClassVar[timedelta] - def __new__(cls: type[Self], year: int, month: int, day: int) -> Self: ... + def __new__(cls, year: int, month: int, day: int) -> Self: ... @classmethod - def fromtimestamp(cls: type[Self], __timestamp: float) -> Self: ... + def fromtimestamp(cls, __timestamp: float) -> Self: ... @classmethod - def today(cls: type[Self]) -> Self: ... + def today(cls) -> Self: ... @classmethod - def fromordinal(cls: type[Self], __n: int) -> Self: ... + def fromordinal(cls, __n: int) -> Self: ... @classmethod - def fromisoformat(cls: type[Self], __date_string: str) -> Self: ... + def fromisoformat(cls, __date_string: str) -> Self: ... if sys.version_info >= (3, 8): @classmethod - def fromisocalendar(cls: type[Self], year: int, week: int, day: int) -> Self: ... + def fromisocalendar(cls, year: int, week: int, day: int) -> Self: ... @property def year(self) -> int: ... @@ -63,35 +69,42 @@ class date: @property def day(self) -> int: ... def ctime(self) -> str: ... - def strftime(self, __format: str) -> str: ... + # On <3.12, the name of the parameter in the pure-Python implementation + # didn't match the name in the C implementation, + # meaning it is only *safe* to pass it as a keyword argument on 3.12+ + if sys.version_info >= (3, 12): + def strftime(self, format: str) -> str: ... + else: + def strftime(self, __format: str) -> str: ... + def __format__(self, __fmt: str) -> str: ... def isoformat(self) -> str: ... def timetuple(self) -> struct_time: ... def toordinal(self) -> int: ... - def replace(self: Self, year: int = ..., month: int = ..., day: int = ...) -> Self: ... - def __le__(self, __other: date) -> bool: ... - def __lt__(self, __other: date) -> bool: ... - def __ge__(self, __other: date) -> bool: ... - def __gt__(self, __other: date) -> bool: ... + def replace(self, year: int = ..., month: int = ..., day: int = ...) -> Self: ... + def __le__(self, __value: date) -> bool: ... + def __lt__(self, __value: date) -> bool: ... + def __ge__(self, __value: date) -> bool: ... + def __gt__(self, __value: date) -> bool: ... if sys.version_info >= (3, 8): - def __add__(self: Self, __other: timedelta) -> Self: ... - def __radd__(self: Self, __other: timedelta) -> Self: ... + def __add__(self, __value: timedelta) -> Self: ... + def __radd__(self, __value: timedelta) -> Self: ... @overload - def __sub__(self: Self, __other: timedelta) -> Self: ... + def __sub__(self, __value: timedelta) -> Self: ... @overload - def __sub__(self, __other: datetime) -> NoReturn: ... + def __sub__(self, __value: datetime) -> NoReturn: ... @overload - def __sub__(self: _D, __other: _D) -> timedelta: ... + def __sub__(self: _D, __value: _D) -> timedelta: ... else: # Prior to Python 3.8, arithmetic operations always returned `date`, even in subclasses - def __add__(self, __other: timedelta) -> date: ... - def __radd__(self, __other: timedelta) -> date: ... + def __add__(self, __value: timedelta) -> date: ... + def __radd__(self, __value: timedelta) -> date: ... @overload - def __sub__(self, __other: timedelta) -> date: ... + def __sub__(self, __value: timedelta) -> date: ... @overload - def __sub__(self, __other: datetime) -> NoReturn: ... + def __sub__(self, __value: datetime) -> NoReturn: ... @overload - def __sub__(self, __other: date) -> timedelta: ... + def __sub__(self, __value: date) -> timedelta: ... def weekday(self) -> int: ... def isoweekday(self) -> int: ... @@ -105,7 +118,7 @@ class time: max: ClassVar[time] resolution: ClassVar[timedelta] def __new__( - cls: type[Self], + cls, hour: int = ..., minute: int = ..., second: int = ..., @@ -126,20 +139,27 @@ class time: def tzinfo(self) -> _TzInfo | None: ... @property def fold(self) -> int: ... - def __le__(self, __other: time) -> bool: ... - def __lt__(self, __other: time) -> bool: ... - def __ge__(self, __other: time) -> bool: ... - def __gt__(self, __other: time) -> bool: ... + def __le__(self, __value: time) -> bool: ... + def __lt__(self, __value: time) -> bool: ... + def __ge__(self, __value: time) -> bool: ... + def __gt__(self, __value: time) -> bool: ... def isoformat(self, timespec: str = ...) -> str: ... @classmethod - def fromisoformat(cls: type[Self], __time_string: str) -> Self: ... - def strftime(self, __format: str) -> str: ... + def fromisoformat(cls, __time_string: str) -> Self: ... + # On <3.12, the name of the parameter in the pure-Python implementation + # didn't match the name in the C implementation, + # meaning it is only *safe* to pass it as a keyword argument on 3.12+ + if sys.version_info >= (3, 12): + def strftime(self, format: str) -> str: ... + else: + def strftime(self, __format: str) -> str: ... + def __format__(self, __fmt: str) -> str: ... def utcoffset(self) -> timedelta | None: ... def tzname(self) -> str | None: ... def dst(self) -> timedelta | None: ... def replace( - self: Self, + self, hour: int = ..., minute: int = ..., second: int = ..., @@ -152,12 +172,12 @@ class time: _Date: TypeAlias = date _Time: TypeAlias = time -class timedelta(SupportsAbs[timedelta]): +class timedelta: min: ClassVar[timedelta] max: ClassVar[timedelta] resolution: ClassVar[timedelta] def __new__( - cls: type[Self], + cls, days: float = ..., seconds: float = ..., microseconds: float = ..., @@ -173,37 +193,36 @@ class timedelta(SupportsAbs[timedelta]): @property def microseconds(self) -> int: ... def total_seconds(self) -> float: ... - def __add__(self, __other: timedelta) -> timedelta: ... - def __radd__(self, __other: timedelta) -> timedelta: ... - def __sub__(self, __other: timedelta) -> timedelta: ... - def __rsub__(self, __other: timedelta) -> timedelta: ... + def __add__(self, __value: timedelta) -> timedelta: ... + def __radd__(self, __value: timedelta) -> timedelta: ... + def __sub__(self, __value: timedelta) -> timedelta: ... + def __rsub__(self, __value: timedelta) -> timedelta: ... def __neg__(self) -> timedelta: ... def __pos__(self) -> timedelta: ... def __abs__(self) -> timedelta: ... - def __mul__(self, __other: float) -> timedelta: ... - def __rmul__(self, __other: float) -> timedelta: ... + def __mul__(self, __value: float) -> timedelta: ... + def __rmul__(self, __value: float) -> timedelta: ... @overload - def __floordiv__(self, __other: timedelta) -> int: ... + def __floordiv__(self, __value: timedelta) -> int: ... @overload - def __floordiv__(self, __other: int) -> timedelta: ... + def __floordiv__(self, __value: int) -> timedelta: ... @overload - def __truediv__(self, __other: timedelta) -> float: ... + def __truediv__(self, __value: timedelta) -> float: ... @overload - def __truediv__(self, __other: float) -> timedelta: ... - def __mod__(self, __other: timedelta) -> timedelta: ... - def __divmod__(self, __other: timedelta) -> tuple[int, timedelta]: ... - def __le__(self, __other: timedelta) -> bool: ... - def __lt__(self, __other: timedelta) -> bool: ... - def __ge__(self, __other: timedelta) -> bool: ... - def __gt__(self, __other: timedelta) -> bool: ... + def __truediv__(self, __value: float) -> timedelta: ... + def __mod__(self, __value: timedelta) -> timedelta: ... + def __divmod__(self, __value: timedelta) -> tuple[int, timedelta]: ... + def __le__(self, __value: timedelta) -> bool: ... + def __lt__(self, __value: timedelta) -> bool: ... + def __ge__(self, __value: timedelta) -> bool: ... + def __gt__(self, __value: timedelta) -> bool: ... def __bool__(self) -> bool: ... class datetime(date): min: ClassVar[datetime] max: ClassVar[datetime] - resolution: ClassVar[timedelta] def __new__( - cls: type[Self], + cls, year: int, month: int, day: int, @@ -227,37 +246,40 @@ class datetime(date): def tzinfo(self) -> _TzInfo | None: ... @property def fold(self) -> int: ... - # The first parameter in `fromtimestamp` is actually positional-or-keyword, - # but it is named "timestamp" in the C implementation and "t" in the Python implementation, - # so it is only truly *safe* to pass it as a positional argument. - @classmethod - def fromtimestamp(cls: type[Self], __timestamp: float, tz: _TzInfo | None = ...) -> Self: ... + # On <3.12, the name of the first parameter in the pure-Python implementation + # didn't match the name in the C implementation, + # meaning it is only *safe* to pass it as a keyword argument on 3.12+ + if sys.version_info >= (3, 12): + @classmethod + def fromtimestamp(cls, timestamp: float, tz: _TzInfo | None = ...) -> Self: ... + else: + @classmethod + def fromtimestamp(cls, __timestamp: float, tz: _TzInfo | None = ...) -> Self: ... + @classmethod - def utcfromtimestamp(cls: type[Self], __t: float) -> Self: ... + def utcfromtimestamp(cls, __t: float) -> Self: ... if sys.version_info >= (3, 8): @classmethod - def now(cls: type[Self], tz: _TzInfo | None = ...) -> Self: ... + def now(cls, tz: _TzInfo | None = None) -> Self: ... else: @overload @classmethod - def now(cls: type[Self], tz: None = ...) -> Self: ... + def now(cls, tz: None = None) -> Self: ... @overload @classmethod def now(cls, tz: _TzInfo) -> datetime: ... @classmethod - def utcnow(cls: type[Self]) -> Self: ... + def utcnow(cls) -> Self: ... @classmethod - def combine(cls, date: _Date, time: _Time, tzinfo: _TzInfo | None = ...) -> datetime: ... - @classmethod - def fromisoformat(cls: type[Self], __date_string: str) -> Self: ... + def combine(cls, date: _Date, time: _Time, tzinfo: _TzInfo | None = ...) -> Self: ... def timestamp(self) -> float: ... def utctimetuple(self) -> struct_time: ... def date(self) -> _Date: ... def time(self) -> _Time: ... def timetz(self) -> _Time: ... def replace( - self: Self, + self, year: int = ..., month: int = ..., day: int = ..., @@ -270,35 +292,30 @@ class datetime(date): fold: int = ..., ) -> Self: ... if sys.version_info >= (3, 8): - def astimezone(self: Self, tz: _TzInfo | None = ...) -> Self: ... + def astimezone(self, tz: _TzInfo | None = ...) -> Self: ... else: def astimezone(self, tz: _TzInfo | None = ...) -> datetime: ... - def ctime(self) -> str: ... def isoformat(self, sep: str = ..., timespec: str = ...) -> str: ... @classmethod - def strptime(cls, __date_string: str, __format: str) -> datetime: ... + def strptime(cls, __date_string: str, __format: str) -> Self: ... def utcoffset(self) -> timedelta | None: ... def tzname(self) -> str | None: ... def dst(self) -> timedelta | None: ... - def __le__(self, __other: datetime) -> bool: ... # type: ignore[override] - def __lt__(self, __other: datetime) -> bool: ... # type: ignore[override] - def __ge__(self, __other: datetime) -> bool: ... # type: ignore[override] - def __gt__(self, __other: datetime) -> bool: ... # type: ignore[override] + def __le__(self, __value: datetime) -> bool: ... # type: ignore[override] + def __lt__(self, __value: datetime) -> bool: ... # type: ignore[override] + def __ge__(self, __value: datetime) -> bool: ... # type: ignore[override] + def __gt__(self, __value: datetime) -> bool: ... # type: ignore[override] if sys.version_info >= (3, 8): @overload # type: ignore[override] - def __sub__(self: Self, __other: timedelta) -> Self: ... + def __sub__(self, __value: timedelta) -> Self: ... @overload - def __sub__(self: _D, __other: _D) -> timedelta: ... + def __sub__(self: _D, __value: _D) -> timedelta: ... else: # Prior to Python 3.8, arithmetic operations always returned `datetime`, even in subclasses - def __add__(self, __other: timedelta) -> datetime: ... - def __radd__(self, __other: timedelta) -> datetime: ... + def __add__(self, __value: timedelta) -> datetime: ... + def __radd__(self, __value: timedelta) -> datetime: ... @overload # type: ignore[override] - def __sub__(self, __other: datetime) -> timedelta: ... + def __sub__(self, __value: datetime) -> timedelta: ... @overload - def __sub__(self, __other: timedelta) -> datetime: ... - if sys.version_info >= (3, 9): - def isocalendar(self) -> _IsoCalendarDate: ... - else: - def isocalendar(self) -> tuple[int, int, int]: ... + def __sub__(self, __value: timedelta) -> datetime: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/dbm/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/dbm/__init__.pyi index 9e99f0d5e..0068d67b6 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/dbm/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/dbm/__init__.pyi @@ -1,12 +1,11 @@ -from _typeshed import Self from collections.abc import Iterator, MutableMapping from types import TracebackType -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal, Self, TypeAlias __all__ = ["open", "whichdb", "error"] _KeyType: TypeAlias = str | bytes -_ValueType: TypeAlias = str | bytes +_ValueType: TypeAlias = str | bytes | bytearray _TFlags: TypeAlias = Literal[ "r", "w", @@ -82,7 +81,7 @@ class _Database(MutableMapping[_KeyType, bytes]): def __iter__(self) -> Iterator[bytes]: ... def __len__(self) -> int: ... def __del__(self) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None ) -> None: ... @@ -92,4 +91,4 @@ class _error(Exception): ... error: tuple[type[_error], type[OSError]] def whichdb(filename: str) -> str: ... -def open(file: str, flag: _TFlags = ..., mode: int = ...) -> _Database: ... +def open(file: str, flag: _TFlags = "r", mode: int = 0o666) -> _Database: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/dbm/dumb.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/dbm/dumb.pyi index 4fd199f19..1fc68cf71 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/dbm/dumb.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/dbm/dumb.pyi @@ -1,7 +1,6 @@ -from _typeshed import Self from collections.abc import Iterator, MutableMapping from types import TracebackType -from typing_extensions import TypeAlias +from typing_extensions import Self, TypeAlias __all__ = ["error", "open"] @@ -10,8 +9,11 @@ _ValueType: TypeAlias = str | bytes error = OSError +# This class doesn't exist at runtime. open() can return an instance of +# any of the three implementations of dbm (dumb, gnu, ndbm), and this +# class is intended to represent the common interface supported by all three. class _Database(MutableMapping[_KeyType, bytes]): - def __init__(self, filebasename: str, mode: str, flag: str = ...) -> None: ... + def __init__(self, filebasename: str, mode: str, flag: str = "c") -> None: ... def sync(self) -> None: ... def iterkeys(self) -> Iterator[bytes]: ... # undocumented def close(self) -> None: ... @@ -21,9 +23,9 @@ class _Database(MutableMapping[_KeyType, bytes]): def __iter__(self) -> Iterator[bytes]: ... def __len__(self) -> int: ... def __del__(self) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None ) -> None: ... -def open(file: str, flag: str = ..., mode: int = ...) -> _Database: ... +def open(file: str, flag: str = "c", mode: int = 0o666) -> _Database: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/dbm/gnu.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/dbm/gnu.pyi index 561206c4e..3dc66a30c 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/dbm/gnu.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/dbm/gnu.pyi @@ -1,13 +1,13 @@ import sys -from _typeshed import Self +from _typeshed import ReadOnlyBuffer from types import TracebackType from typing import TypeVar, overload -from typing_extensions import TypeAlias +from typing_extensions import Self, TypeAlias if sys.platform != "win32": _T = TypeVar("_T") - _KeyType: TypeAlias = str | bytes - _ValueType: TypeAlias = str | bytes + _KeyType: TypeAlias = str | ReadOnlyBuffer + _ValueType: TypeAlias = str | ReadOnlyBuffer open_flags: str @@ -24,17 +24,17 @@ if sys.platform != "win32": def __delitem__(self, key: _KeyType) -> None: ... def __contains__(self, key: _KeyType) -> bool: ... def __len__(self) -> int: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None ) -> None: ... @overload def get(self, k: _KeyType) -> bytes | None: ... @overload - def get(self, k: _KeyType, default: bytes | _T) -> bytes | _T: ... + def get(self, k: _KeyType, default: _T) -> bytes | _T: ... def keys(self) -> list[bytes]: ... def setdefault(self, k: _KeyType, default: _ValueType = ...) -> bytes: ... # Don't exist at runtime __new__: None # type: ignore[assignment] __init__: None # type: ignore[assignment] - def open(__filename: str, __flags: str = ..., __mode: int = ...) -> _gdbm: ... + def open(__filename: str, __flags: str = "r", __mode: int = 0o666) -> _gdbm: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/dbm/ndbm.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/dbm/ndbm.pyi index f1032bf3c..1106fb2a8 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/dbm/ndbm.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/dbm/ndbm.pyi @@ -1,13 +1,13 @@ import sys -from _typeshed import Self +from _typeshed import ReadOnlyBuffer from types import TracebackType from typing import TypeVar, overload -from typing_extensions import TypeAlias +from typing_extensions import Self, TypeAlias if sys.platform != "win32": _T = TypeVar("_T") - _KeyType: TypeAlias = str | bytes - _ValueType: TypeAlias = str | bytes + _KeyType: TypeAlias = str | ReadOnlyBuffer + _ValueType: TypeAlias = str | ReadOnlyBuffer class error(OSError): ... library: str @@ -20,17 +20,17 @@ if sys.platform != "win32": def __delitem__(self, key: _KeyType) -> None: ... def __len__(self) -> int: ... def __del__(self) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None ) -> None: ... @overload def get(self, k: _KeyType) -> bytes | None: ... @overload - def get(self, k: _KeyType, default: bytes | _T) -> bytes | _T: ... + def get(self, k: _KeyType, default: _T) -> bytes | _T: ... def keys(self) -> list[bytes]: ... def setdefault(self, k: _KeyType, default: _ValueType = ...) -> bytes: ... # Don't exist at runtime __new__: None # type: ignore[assignment] __init__: None # type: ignore[assignment] - def open(__filename: str, __flags: str = ..., __mode: int = ...) -> _dbm: ... + def open(__filename: str, __flags: str = "r", __mode: int = 0o666) -> _dbm: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/difflib.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/difflib.pyi index 854a53d43..894ebaaec 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/difflib.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/difflib.pyi @@ -29,110 +29,112 @@ class Match(NamedTuple): class SequenceMatcher(Generic[_T]): @overload - def __init__(self, isjunk: Callable[[_T], bool] | None, a: Sequence[_T], b: Sequence[_T], autojunk: bool = ...) -> None: ... + def __init__(self, isjunk: Callable[[_T], bool] | None, a: Sequence[_T], b: Sequence[_T], autojunk: bool = True) -> None: ... @overload - def __init__(self, *, a: Sequence[_T], b: Sequence[_T], autojunk: bool = ...) -> None: ... + def __init__(self, *, a: Sequence[_T], b: Sequence[_T], autojunk: bool = True) -> None: ... @overload def __init__( self: SequenceMatcher[str], - isjunk: Callable[[str], bool] | None = ..., - a: Sequence[str] = ..., - b: Sequence[str] = ..., - autojunk: bool = ..., + isjunk: Callable[[str], bool] | None = None, + a: Sequence[str] = "", + b: Sequence[str] = "", + autojunk: bool = True, ) -> None: ... def set_seqs(self, a: Sequence[_T], b: Sequence[_T]) -> None: ... def set_seq1(self, a: Sequence[_T]) -> None: ... def set_seq2(self, b: Sequence[_T]) -> None: ... if sys.version_info >= (3, 9): - def find_longest_match(self, alo: int = ..., ahi: int | None = ..., blo: int = ..., bhi: int | None = ...) -> Match: ... + def find_longest_match(self, alo: int = 0, ahi: int | None = None, blo: int = 0, bhi: int | None = None) -> Match: ... else: def find_longest_match(self, alo: int, ahi: int, blo: int, bhi: int) -> Match: ... def get_matching_blocks(self) -> list[Match]: ... def get_opcodes(self) -> list[tuple[str, int, int, int, int]]: ... - def get_grouped_opcodes(self, n: int = ...) -> Iterable[list[tuple[str, int, int, int, int]]]: ... + def get_grouped_opcodes(self, n: int = 3) -> Iterable[list[tuple[str, int, int, int, int]]]: ... def ratio(self) -> float: ... def quick_ratio(self) -> float: ... def real_quick_ratio(self) -> float: ... if sys.version_info >= (3, 9): def __class_getitem__(cls, item: Any) -> GenericAlias: ... -# mypy thinks the signatures of the overloads overlap, but the types still work fine @overload -def get_close_matches(word: AnyStr, possibilities: Iterable[AnyStr], n: int = ..., cutoff: float = ...) -> list[AnyStr]: ... # type: ignore[misc] +def get_close_matches(word: AnyStr, possibilities: Iterable[AnyStr], n: int = 3, cutoff: float = 0.6) -> list[AnyStr]: ... @overload def get_close_matches( - word: Sequence[_T], possibilities: Iterable[Sequence[_T]], n: int = ..., cutoff: float = ... + word: Sequence[_T], possibilities: Iterable[Sequence[_T]], n: int = 3, cutoff: float = 0.6 ) -> list[Sequence[_T]]: ... class Differ: - def __init__(self, linejunk: Callable[[str], bool] | None = ..., charjunk: Callable[[str], bool] | None = ...) -> None: ... + def __init__(self, linejunk: Callable[[str], bool] | None = None, charjunk: Callable[[str], bool] | None = None) -> None: ... def compare(self, a: Sequence[str], b: Sequence[str]) -> Iterator[str]: ... def IS_LINE_JUNK(line: str, pat: Any = ...) -> bool: ... # pat is undocumented -def IS_CHARACTER_JUNK(ch: str, ws: str = ...) -> bool: ... # ws is undocumented +def IS_CHARACTER_JUNK(ch: str, ws: str = " \t") -> bool: ... # ws is undocumented def unified_diff( a: Sequence[str], b: Sequence[str], - fromfile: str = ..., - tofile: str = ..., - fromfiledate: str = ..., - tofiledate: str = ..., - n: int = ..., - lineterm: str = ..., + fromfile: str = "", + tofile: str = "", + fromfiledate: str = "", + tofiledate: str = "", + n: int = 3, + lineterm: str = "\n", ) -> Iterator[str]: ... def context_diff( a: Sequence[str], b: Sequence[str], - fromfile: str = ..., - tofile: str = ..., - fromfiledate: str = ..., - tofiledate: str = ..., - n: int = ..., - lineterm: str = ..., + fromfile: str = "", + tofile: str = "", + fromfiledate: str = "", + tofiledate: str = "", + n: int = 3, + lineterm: str = "\n", ) -> Iterator[str]: ... def ndiff( - a: Sequence[str], b: Sequence[str], linejunk: Callable[[str], bool] | None = ..., charjunk: Callable[[str], bool] | None = ... + a: Sequence[str], + b: Sequence[str], + linejunk: Callable[[str], bool] | None = None, + charjunk: Callable[[str], bool] | None = ..., ) -> Iterator[str]: ... class HtmlDiff: def __init__( self, - tabsize: int = ..., - wrapcolumn: int | None = ..., - linejunk: Callable[[str], bool] | None = ..., + tabsize: int = 8, + wrapcolumn: int | None = None, + linejunk: Callable[[str], bool] | None = None, charjunk: Callable[[str], bool] | None = ..., ) -> None: ... def make_file( self, fromlines: Sequence[str], tolines: Sequence[str], - fromdesc: str = ..., - todesc: str = ..., - context: bool = ..., - numlines: int = ..., + fromdesc: str = "", + todesc: str = "", + context: bool = False, + numlines: int = 5, *, - charset: str = ..., + charset: str = "utf-8", ) -> str: ... def make_table( self, fromlines: Sequence[str], tolines: Sequence[str], - fromdesc: str = ..., - todesc: str = ..., - context: bool = ..., - numlines: int = ..., + fromdesc: str = "", + todesc: str = "", + context: bool = False, + numlines: int = 5, ) -> str: ... def restore(delta: Iterable[str], which: int) -> Iterator[str]: ... def diff_bytes( dfunc: Callable[[Sequence[str], Sequence[str], str, str, str, str, int, str], Iterator[str]], - a: Sequence[bytes], - b: Sequence[bytes], - fromfile: bytes = ..., - tofile: bytes = ..., - fromfiledate: bytes = ..., - tofiledate: bytes = ..., - n: int = ..., - lineterm: bytes = ..., + a: Iterable[bytes | bytearray], + b: Iterable[bytes | bytearray], + fromfile: bytes | bytearray = b"", + tofile: bytes | bytearray = b"", + fromfiledate: bytes | bytearray = b"", + tofiledate: bytes | bytearray = b"", + n: int = 3, + lineterm: bytes | bytearray = b"\n", ) -> Iterator[bytes]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/dis.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/dis.pyi index dd31d9810..ac0c5356f 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/dis.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/dis.pyi @@ -1,10 +1,9 @@ import sys import types -from _typeshed import Self from collections.abc import Callable, Iterator from opcode import * # `dis` re-exports it as a part of public API from typing import IO, Any, NamedTuple -from typing_extensions import TypeAlias +from typing_extensions import Self, TypeAlias __all__ = [ "code_info", @@ -37,7 +36,6 @@ __all__ = [ # Strictly this should not have to include Callable, but mypy doesn't use FunctionType # for functions (python/mypy#3171) _HaveCodeType: TypeAlias = types.MethodType | types.FunctionType | types.CodeType | type | Callable[..., Any] -_HaveCodeOrStringType: TypeAlias = _HaveCodeType | str | bytes if sys.version_info >= (3, 11): class Positions(NamedTuple): @@ -75,23 +73,21 @@ class Bytecode: if sys.version_info >= (3, 11): def __init__( self, - x: _HaveCodeOrStringType, + x: _HaveCodeType | str, *, - first_line: int | None = ..., - current_offset: int | None = ..., - show_caches: bool = ..., - adaptive: bool = ..., + first_line: int | None = None, + current_offset: int | None = None, + show_caches: bool = False, + adaptive: bool = False, ) -> None: ... @classmethod - def from_traceback( - cls: type[Self], tb: types.TracebackType, *, show_caches: bool = ..., adaptive: bool = ... - ) -> Self: ... + def from_traceback(cls, tb: types.TracebackType, *, show_caches: bool = False, adaptive: bool = False) -> Self: ... else: def __init__( - self, x: _HaveCodeOrStringType, *, first_line: int | None = ..., current_offset: int | None = ... + self, x: _HaveCodeType | str, *, first_line: int | None = None, current_offset: int | None = None ) -> None: ... @classmethod - def from_traceback(cls: type[Self], tb: types.TracebackType) -> Self: ... + def from_traceback(cls, tb: types.TracebackType) -> Self: ... def __iter__(self) -> Iterator[Instruction]: ... def info(self) -> str: ... @@ -102,39 +98,41 @@ COMPILER_FLAG_NAMES: dict[int, str] def findlabels(code: _HaveCodeType) -> list[int]: ... def findlinestarts(code: _HaveCodeType) -> Iterator[tuple[int, int]]: ... def pretty_flags(flags: int) -> str: ... -def code_info(x: _HaveCodeOrStringType) -> str: ... +def code_info(x: _HaveCodeType | str) -> str: ... if sys.version_info >= (3, 11): def dis( - x: _HaveCodeOrStringType | None = ..., + x: _HaveCodeType | str | bytes | bytearray | None = None, *, - file: IO[str] | None = ..., - depth: int | None = ..., - show_caches: bool = ..., - adaptive: bool = ..., + file: IO[str] | None = None, + depth: int | None = None, + show_caches: bool = False, + adaptive: bool = False, ) -> None: ... else: - def dis(x: _HaveCodeOrStringType | None = ..., *, file: IO[str] | None = ..., depth: int | None = ...) -> None: ... + def dis( + x: _HaveCodeType | str | bytes | bytearray | None = None, *, file: IO[str] | None = None, depth: int | None = None + ) -> None: ... if sys.version_info >= (3, 11): def disassemble( - co: _HaveCodeType, lasti: int = ..., *, file: IO[str] | None = ..., show_caches: bool = ..., adaptive: bool = ... + co: _HaveCodeType, lasti: int = -1, *, file: IO[str] | None = None, show_caches: bool = False, adaptive: bool = False ) -> None: ... def disco( - co: _HaveCodeType, lasti: int = ..., *, file: IO[str] | None = ..., show_caches: bool = ..., adaptive: bool = ... + co: _HaveCodeType, lasti: int = -1, *, file: IO[str] | None = None, show_caches: bool = False, adaptive: bool = False ) -> None: ... def distb( - tb: types.TracebackType | None = ..., *, file: IO[str] | None = ..., show_caches: bool = ..., adaptive: bool = ... + tb: types.TracebackType | None = None, *, file: IO[str] | None = None, show_caches: bool = False, adaptive: bool = False ) -> None: ... def get_instructions( - x: _HaveCodeType, *, first_line: int | None = ..., show_caches: bool = ..., adaptive: bool = ... + x: _HaveCodeType, *, first_line: int | None = None, show_caches: bool = False, adaptive: bool = False ) -> Iterator[Instruction]: ... else: - def disassemble(co: _HaveCodeType, lasti: int = ..., *, file: IO[str] | None = ...) -> None: ... - def disco(co: _HaveCodeType, lasti: int = ..., *, file: IO[str] | None = ...) -> None: ... - def distb(tb: types.TracebackType | None = ..., *, file: IO[str] | None = ...) -> None: ... - def get_instructions(x: _HaveCodeType, *, first_line: int | None = ...) -> Iterator[Instruction]: ... + def disassemble(co: _HaveCodeType, lasti: int = -1, *, file: IO[str] | None = None) -> None: ... + def disco(co: _HaveCodeType, lasti: int = -1, *, file: IO[str] | None = None) -> None: ... + def distb(tb: types.TracebackType | None = None, *, file: IO[str] | None = None) -> None: ... + def get_instructions(x: _HaveCodeType, *, first_line: int | None = None) -> Iterator[Instruction]: ... -def show_code(co: _HaveCodeType, *, file: IO[str] | None = ...) -> None: ... +def show_code(co: _HaveCodeType, *, file: IO[str] | None = None) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/distutils/archive_util.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/distutils/archive_util.pyi index 38458fc0e..a8947ce35 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/distutils/archive_util.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/distutils/archive_util.pyi @@ -1,20 +1,20 @@ def make_archive( base_name: str, format: str, - root_dir: str | None = ..., - base_dir: str | None = ..., - verbose: int = ..., - dry_run: int = ..., - owner: str | None = ..., - group: str | None = ..., + root_dir: str | None = None, + base_dir: str | None = None, + verbose: int = 0, + dry_run: int = 0, + owner: str | None = None, + group: str | None = None, ) -> str: ... def make_tarball( base_name: str, base_dir: str, - compress: str | None = ..., - verbose: int = ..., - dry_run: int = ..., - owner: str | None = ..., - group: str | None = ..., + compress: str | None = "gzip", + verbose: int = 0, + dry_run: int = 0, + owner: str | None = None, + group: str | None = None, ) -> str: ... -def make_zipfile(base_name: str, base_dir: str, verbose: int = ..., dry_run: int = ...) -> str: ... +def make_zipfile(base_name: str, base_dir: str, verbose: int = 0, dry_run: int = 0) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/distutils/ccompiler.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/distutils/ccompiler.pyi index 5b92c5f5c..e7277aa3f 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/distutils/ccompiler.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/distutils/ccompiler.pyi @@ -1,16 +1,16 @@ from collections.abc import Callable -from typing import Any, Union +from typing import Any from typing_extensions import TypeAlias -_Macro: TypeAlias = Union[tuple[str], tuple[str, str | None]] +_Macro: TypeAlias = tuple[str] | tuple[str, str | None] def gen_lib_options( compiler: CCompiler, library_dirs: list[str], runtime_library_dirs: list[str], libraries: list[str] ) -> list[str]: ... def gen_preprocess_options(macros: list[_Macro], include_dirs: list[str]) -> list[str]: ... -def get_default_compiler(osname: str | None = ..., platform: str | None = ...) -> str: ... +def get_default_compiler(osname: str | None = None, platform: str | None = None) -> str: ... def new_compiler( - plat: str | None = ..., compiler: str | None = ..., verbose: int = ..., dry_run: int = ..., force: int = ... + plat: str | None = None, compiler: str | None = None, verbose: int = 0, dry_run: int = 0, force: int = 0 ) -> CCompiler: ... def show_compilers() -> None: ... @@ -25,7 +25,7 @@ class CCompiler: library_dirs: list[str] runtime_library_dirs: list[str] objects: list[str] - def __init__(self, verbose: int = ..., dry_run: int = ..., force: int = ...) -> None: ... + def __init__(self, verbose: int = 0, dry_run: int = 0, force: int = 0) -> None: ... def add_include_dir(self, dir: str) -> None: ... def set_include_dirs(self, dirs: list[str]) -> None: ... def add_library(self, libname: str) -> None: ... @@ -34,7 +34,7 @@ class CCompiler: def set_library_dirs(self, dirs: list[str]) -> None: ... def add_runtime_library_dir(self, dir: str) -> None: ... def set_runtime_library_dirs(self, dirs: list[str]) -> None: ... - def define_macro(self, name: str, value: str | None = ...) -> None: ... + def define_macro(self, name: str, value: str | None = None) -> None: ... def undefine_macro(self, name: str) -> None: ... def add_link_object(self, object: str) -> None: ... def set_link_objects(self, objects: list[str]) -> None: ... @@ -43,10 +43,10 @@ class CCompiler: def has_function( self, funcname: str, - includes: list[str] | None = ..., - include_dirs: list[str] | None = ..., - libraries: list[str] | None = ..., - library_dirs: list[str] | None = ..., + includes: list[str] | None = None, + include_dirs: list[str] | None = None, + libraries: list[str] | None = None, + library_dirs: list[str] | None = None, ) -> bool: ... def library_dir_option(self, dir: str) -> str: ... def library_option(self, lib: str) -> str: ... @@ -55,98 +55,98 @@ class CCompiler: def compile( self, sources: list[str], - output_dir: str | None = ..., - macros: _Macro | None = ..., - include_dirs: list[str] | None = ..., + output_dir: str | None = None, + macros: _Macro | None = None, + include_dirs: list[str] | None = None, debug: bool = ..., - extra_preargs: list[str] | None = ..., - extra_postargs: list[str] | None = ..., - depends: list[str] | None = ..., + extra_preargs: list[str] | None = None, + extra_postargs: list[str] | None = None, + depends: list[str] | None = None, ) -> list[str]: ... def create_static_lib( self, objects: list[str], output_libname: str, - output_dir: str | None = ..., + output_dir: str | None = None, debug: bool = ..., - target_lang: str | None = ..., + target_lang: str | None = None, ) -> None: ... def link( self, target_desc: str, objects: list[str], output_filename: str, - output_dir: str | None = ..., - libraries: list[str] | None = ..., - library_dirs: list[str] | None = ..., - runtime_library_dirs: list[str] | None = ..., - export_symbols: list[str] | None = ..., + output_dir: str | None = None, + libraries: list[str] | None = None, + library_dirs: list[str] | None = None, + runtime_library_dirs: list[str] | None = None, + export_symbols: list[str] | None = None, debug: bool = ..., - extra_preargs: list[str] | None = ..., - extra_postargs: list[str] | None = ..., - build_temp: str | None = ..., - target_lang: str | None = ..., + extra_preargs: list[str] | None = None, + extra_postargs: list[str] | None = None, + build_temp: str | None = None, + target_lang: str | None = None, ) -> None: ... def link_executable( self, objects: list[str], output_progname: str, - output_dir: str | None = ..., - libraries: list[str] | None = ..., - library_dirs: list[str] | None = ..., - runtime_library_dirs: list[str] | None = ..., + output_dir: str | None = None, + libraries: list[str] | None = None, + library_dirs: list[str] | None = None, + runtime_library_dirs: list[str] | None = None, debug: bool = ..., - extra_preargs: list[str] | None = ..., - extra_postargs: list[str] | None = ..., - target_lang: str | None = ..., + extra_preargs: list[str] | None = None, + extra_postargs: list[str] | None = None, + target_lang: str | None = None, ) -> None: ... def link_shared_lib( self, objects: list[str], output_libname: str, - output_dir: str | None = ..., - libraries: list[str] | None = ..., - library_dirs: list[str] | None = ..., - runtime_library_dirs: list[str] | None = ..., - export_symbols: list[str] | None = ..., + output_dir: str | None = None, + libraries: list[str] | None = None, + library_dirs: list[str] | None = None, + runtime_library_dirs: list[str] | None = None, + export_symbols: list[str] | None = None, debug: bool = ..., - extra_preargs: list[str] | None = ..., - extra_postargs: list[str] | None = ..., - build_temp: str | None = ..., - target_lang: str | None = ..., + extra_preargs: list[str] | None = None, + extra_postargs: list[str] | None = None, + build_temp: str | None = None, + target_lang: str | None = None, ) -> None: ... def link_shared_object( self, objects: list[str], output_filename: str, - output_dir: str | None = ..., - libraries: list[str] | None = ..., - library_dirs: list[str] | None = ..., - runtime_library_dirs: list[str] | None = ..., - export_symbols: list[str] | None = ..., + output_dir: str | None = None, + libraries: list[str] | None = None, + library_dirs: list[str] | None = None, + runtime_library_dirs: list[str] | None = None, + export_symbols: list[str] | None = None, debug: bool = ..., - extra_preargs: list[str] | None = ..., - extra_postargs: list[str] | None = ..., - build_temp: str | None = ..., - target_lang: str | None = ..., + extra_preargs: list[str] | None = None, + extra_postargs: list[str] | None = None, + build_temp: str | None = None, + target_lang: str | None = None, ) -> None: ... def preprocess( self, source: str, - output_file: str | None = ..., - macros: list[_Macro] | None = ..., - include_dirs: list[str] | None = ..., - extra_preargs: list[str] | None = ..., - extra_postargs: list[str] | None = ..., + output_file: str | None = None, + macros: list[_Macro] | None = None, + include_dirs: list[str] | None = None, + extra_preargs: list[str] | None = None, + extra_postargs: list[str] | None = None, ) -> None: ... - def executable_filename(self, basename: str, strip_dir: int = ..., output_dir: str = ...) -> str: ... - def library_filename(self, libname: str, lib_type: str = ..., strip_dir: int = ..., output_dir: str = ...) -> str: ... - def object_filenames(self, source_filenames: list[str], strip_dir: int = ..., output_dir: str = ...) -> list[str]: ... - def shared_object_filename(self, basename: str, strip_dir: int = ..., output_dir: str = ...) -> str: ... - def execute(self, func: Callable[..., object], args: tuple[Any, ...], msg: str | None = ..., level: int = ...) -> None: ... + def executable_filename(self, basename: str, strip_dir: int = 0, output_dir: str = "") -> str: ... + def library_filename(self, libname: str, lib_type: str = "static", strip_dir: int = 0, output_dir: str = "") -> str: ... + def object_filenames(self, source_filenames: list[str], strip_dir: int = 0, output_dir: str = "") -> list[str]: ... + def shared_object_filename(self, basename: str, strip_dir: int = 0, output_dir: str = "") -> str: ... + def execute(self, func: Callable[..., object], args: tuple[Any, ...], msg: str | None = None, level: int = 1) -> None: ... def spawn(self, cmd: list[str]) -> None: ... - def mkpath(self, name: str, mode: int = ...) -> None: ... + def mkpath(self, name: str, mode: int = 0o777) -> None: ... def move_file(self, src: str, dst: str) -> str: ... - def announce(self, msg: str, level: int = ...) -> None: ... + def announce(self, msg: str, level: int = 1) -> None: ... def warn(self, msg: str) -> None: ... def debug_print(self, msg: str) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/distutils/cmd.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/distutils/cmd.pyi index e706bdbc5..61fce37b8 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/distutils/cmd.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/distutils/cmd.pyi @@ -1,9 +1,11 @@ +from _typeshed import Incomplete from abc import abstractmethod from collections.abc import Callable, Iterable from distutils.dist import Distribution from typing import Any class Command: + distribution: Distribution sub_commands: list[tuple[str, Callable[[Command], bool] | None]] def __init__(self, dist: Distribution) -> None: ... @abstractmethod @@ -12,49 +14,43 @@ class Command: def finalize_options(self) -> None: ... @abstractmethod def run(self) -> None: ... - def announce(self, msg: str, level: int = ...) -> None: ... + def announce(self, msg: str, level: int = 1) -> None: ... def debug_print(self, msg: str) -> None: ... - def ensure_string(self, option: str, default: str | None = ...) -> None: ... + def ensure_string(self, option: str, default: str | None = None) -> None: ... def ensure_string_list(self, option: str | list[str]) -> None: ... def ensure_filename(self, option: str) -> None: ... def ensure_dirname(self, option: str) -> None: ... def get_command_name(self) -> str: ... def set_undefined_options(self, src_cmd: str, *option_pairs: tuple[str, str]) -> None: ... - def get_finalized_command(self, command: str, create: int = ...) -> Command: ... - def reinitialize_command(self, command: Command | str, reinit_subcommands: int = ...) -> Command: ... + def get_finalized_command(self, command: str, create: int = 1) -> Command: ... + def reinitialize_command(self, command: Command | str, reinit_subcommands: int = 0) -> Command: ... def run_command(self, command: str) -> None: ... def get_sub_commands(self) -> list[str]: ... def warn(self, msg: str) -> None: ... - def execute(self, func: Callable[..., object], args: Iterable[Any], msg: str | None = ..., level: int = ...) -> None: ... - def mkpath(self, name: str, mode: int = ...) -> None: ... + def execute(self, func: Callable[..., object], args: Iterable[Any], msg: str | None = None, level: int = 1) -> None: ... + def mkpath(self, name: str, mode: int = 0o777) -> None: ... def copy_file( - self, - infile: str, - outfile: str, - preserve_mode: int = ..., - preserve_times: int = ..., - link: str | None = ..., - level: Any = ..., + self, infile: str, outfile: str, preserve_mode: int = 1, preserve_times: int = 1, link: str | None = None, level: Any = 1 ) -> tuple[str, bool]: ... # level is not used def copy_tree( self, infile: str, outfile: str, - preserve_mode: int = ..., - preserve_times: int = ..., - preserve_symlinks: int = ..., - level: Any = ..., + preserve_mode: int = 1, + preserve_times: int = 1, + preserve_symlinks: int = 0, + level: Any = 1, ) -> list[str]: ... # level is not used - def move_file(self, src: str, dst: str, level: Any = ...) -> str: ... # level is not used - def spawn(self, cmd: Iterable[str], search_path: int = ..., level: Any = ...) -> None: ... # level is not used + def move_file(self, src: str, dst: str, level: Any = 1) -> str: ... # level is not used + def spawn(self, cmd: Iterable[str], search_path: int = 1, level: Any = 1) -> None: ... # level is not used def make_archive( self, base_name: str, format: str, - root_dir: str | None = ..., - base_dir: str | None = ..., - owner: str | None = ..., - group: str | None = ..., + root_dir: str | None = None, + base_dir: str | None = None, + owner: str | None = None, + group: str | None = None, ) -> str: ... def make_file( self, @@ -62,7 +58,9 @@ class Command: outfile: str, func: Callable[..., object], args: list[Any], - exec_msg: str | None = ..., - skip_msg: str | None = ..., - level: Any = ..., + exec_msg: str | None = None, + skip_msg: str | None = None, + level: Any = 1, ) -> None: ... # level is not used + def ensure_finalized(self) -> None: ... + def dump_options(self, header: Incomplete | None = None, indent: str = "") -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/distutils/command/bdist_msi.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/distutils/command/bdist_msi.pyi index 66202e841..fa98e86d5 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/distutils/command/bdist_msi.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/distutils/command/bdist_msi.pyi @@ -9,9 +9,9 @@ if sys.platform == "win32": class PyDialog(Dialog): def __init__(self, *args, **kw) -> None: ... def title(self, title) -> None: ... - def back(self, title, next, name: str = ..., active: int = ...): ... - def cancel(self, title, next, name: str = ..., active: int = ...): ... - def next(self, title, next, name: str = ..., active: int = ...): ... + def back(self, title, next, name: str = "Back", active: int = 1): ... + def cancel(self, title, next, name: str = "Cancel", active: int = 1): ... + def next(self, title, next, name: str = "Next", active: int = 1): ... def xbutton(self, name, title, next, xpos): ... class bdist_msi(Command): diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/distutils/command/bdist_wininst.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/distutils/command/bdist_wininst.pyi index 1091fb278..8491d3126 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/distutils/command/bdist_wininst.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/distutils/command/bdist_wininst.pyi @@ -11,6 +11,6 @@ class bdist_wininst(Command): def finalize_options(self) -> None: ... def run(self) -> None: ... def get_inidata(self) -> str: ... - def create_exe(self, arcname: StrOrBytesPath, fullname: str, bitmap: StrOrBytesPath | None = ...) -> None: ... + def create_exe(self, arcname: StrOrBytesPath, fullname: str, bitmap: StrOrBytesPath | None = None) -> None: ... def get_installer_filename(self, fullname: str) -> str: ... def get_exe_bytes(self) -> bytes: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/distutils/command/build_ext.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/distutils/command/build_ext.pyi index 80cd78936..5eb541fb9 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/distutils/command/build_ext.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/distutils/command/build_ext.pyi @@ -43,8 +43,8 @@ class build_ext(Command): def build_extension(self, ext) -> None: ... def swig_sources(self, sources, extension): ... def find_swig(self): ... - def get_ext_fullpath(self, ext_name): ... - def get_ext_fullname(self, ext_name): ... - def get_ext_filename(self, ext_name): ... + def get_ext_fullpath(self, ext_name: str) -> str: ... + def get_ext_fullname(self, ext_name: str) -> str: ... + def get_ext_filename(self, ext_name: str) -> str: ... def get_export_symbols(self, ext): ... def get_libraries(self, ext): ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/distutils/command/build_py.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/distutils/command/build_py.pyi index 3c6e022c2..ca4e4ed7e 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/distutils/command/build_py.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/distutils/command/build_py.pyi @@ -32,7 +32,7 @@ class build_py(Command): def find_all_modules(self): ... def get_source_files(self): ... def get_module_outfile(self, build_dir, package, module): ... - def get_outputs(self, include_bytecode: int = ...): ... + def get_outputs(self, include_bytecode: int = 1): ... def build_module(self, module, module_file, package): ... def build_modules(self) -> None: ... def build_packages(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/distutils/command/check.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/distutils/command/check.pyi index cdbe40fff..9cbcc6c87 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/distutils/command/check.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/distutils/command/check.pyi @@ -6,6 +6,8 @@ from ..cmd import Command _Reporter: TypeAlias = Any # really docutils.utils.Reporter # Only defined if docutils is installed. +# Depends on a third-party stub. Since distutils is deprecated anyway, +# it's easier to just suppress the "any subclassing" error. class SilentReporter(_Reporter): messages: Any def __init__( diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/distutils/command/config.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/distutils/command/config.pyi index 03466ca72..81fdf76b2 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/distutils/command/config.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/distutils/command/config.pyi @@ -24,60 +24,60 @@ class config(Command): def run(self) -> None: ... def try_cpp( self, - body: str | None = ..., - headers: Sequence[str] | None = ..., - include_dirs: Sequence[str] | None = ..., - lang: str = ..., + body: str | None = None, + headers: Sequence[str] | None = None, + include_dirs: Sequence[str] | None = None, + lang: str = "c", ) -> bool: ... def search_cpp( self, pattern: Pattern[str] | str, - body: str | None = ..., - headers: Sequence[str] | None = ..., - include_dirs: Sequence[str] | None = ..., - lang: str = ..., + body: str | None = None, + headers: Sequence[str] | None = None, + include_dirs: Sequence[str] | None = None, + lang: str = "c", ) -> bool: ... def try_compile( - self, body: str, headers: Sequence[str] | None = ..., include_dirs: Sequence[str] | None = ..., lang: str = ... + self, body: str, headers: Sequence[str] | None = None, include_dirs: Sequence[str] | None = None, lang: str = "c" ) -> bool: ... def try_link( self, body: str, - headers: Sequence[str] | None = ..., - include_dirs: Sequence[str] | None = ..., - libraries: Sequence[str] | None = ..., - library_dirs: Sequence[str] | None = ..., - lang: str = ..., + headers: Sequence[str] | None = None, + include_dirs: Sequence[str] | None = None, + libraries: Sequence[str] | None = None, + library_dirs: Sequence[str] | None = None, + lang: str = "c", ) -> bool: ... def try_run( self, body: str, - headers: Sequence[str] | None = ..., - include_dirs: Sequence[str] | None = ..., - libraries: Sequence[str] | None = ..., - library_dirs: Sequence[str] | None = ..., - lang: str = ..., + headers: Sequence[str] | None = None, + include_dirs: Sequence[str] | None = None, + libraries: Sequence[str] | None = None, + library_dirs: Sequence[str] | None = None, + lang: str = "c", ) -> bool: ... def check_func( self, func: str, - headers: Sequence[str] | None = ..., - include_dirs: Sequence[str] | None = ..., - libraries: Sequence[str] | None = ..., - library_dirs: Sequence[str] | None = ..., - decl: int = ..., - call: int = ..., + headers: Sequence[str] | None = None, + include_dirs: Sequence[str] | None = None, + libraries: Sequence[str] | None = None, + library_dirs: Sequence[str] | None = None, + decl: int = 0, + call: int = 0, ) -> bool: ... def check_lib( self, library: str, - library_dirs: Sequence[str] | None = ..., - headers: Sequence[str] | None = ..., - include_dirs: Sequence[str] | None = ..., + library_dirs: Sequence[str] | None = None, + headers: Sequence[str] | None = None, + include_dirs: Sequence[str] | None = None, other_libraries: list[str] = ..., ) -> bool: ... def check_header( - self, header: str, include_dirs: Sequence[str] | None = ..., library_dirs: Sequence[str] | None = ..., lang: str = ... + self, header: str, include_dirs: Sequence[str] | None = None, library_dirs: Sequence[str] | None = None, lang: str = "c" ) -> bool: ... -def dump_file(filename: str, head: Any | None = ...) -> None: ... +def dump_file(filename: str, head: Any | None = None) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/distutils/command/register.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/distutils/command/register.pyi index a1a7a45fb..f88b94113 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/distutils/command/register.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/distutils/command/register.pyi @@ -15,4 +15,4 @@ class register(PyPIRCCommand): def verify_metadata(self) -> None: ... def send_metadata(self) -> None: ... def build_post_data(self, action): ... - def post_to_server(self, data, auth: Any | None = ...): ... + def post_to_server(self, data, auth: Any | None = None): ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/distutils/core.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/distutils/core.pyi index 199a4d70a..7b0bdd1b3 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/distutils/core.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/distutils/core.pyi @@ -1,9 +1,17 @@ +from _typeshed import StrOrBytesPath from collections.abc import Mapping from distutils.cmd import Command as Command from distutils.dist import Distribution as Distribution from distutils.extension import Extension as Extension from typing import Any +USAGE: str + +def gen_usage(script_name: StrOrBytesPath) -> str: ... + +setup_keywords: tuple[str, ...] +extension_keywords: tuple[str, ...] + def setup( *, name: str = ..., @@ -46,4 +54,4 @@ def setup( fullname: str = ..., **attrs: Any, ) -> None: ... -def run_setup(script_name: str, script_args: list[str] | None = ..., stop_after: str = ...) -> Distribution: ... +def run_setup(script_name: str, script_args: list[str] | None = None, stop_after: str = "run") -> Distribution: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/distutils/cygwinccompiler.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/distutils/cygwinccompiler.pyi index 1f85b2548..a990c3e28 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/distutils/cygwinccompiler.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/distutils/cygwinccompiler.pyi @@ -1,4 +1,20 @@ from distutils.unixccompiler import UnixCCompiler +from distutils.version import LooseVersion +from re import Pattern +from typing_extensions import Literal + +def get_msvcr() -> list[str] | None: ... class CygwinCCompiler(UnixCCompiler): ... class Mingw32CCompiler(CygwinCCompiler): ... + +CONFIG_H_OK: str +CONFIG_H_NOTOK: str +CONFIG_H_UNCERTAIN: str + +def check_config_h() -> tuple[Literal["ok", "not ok", "uncertain"], str]: ... + +RE_VERSION: Pattern[bytes] + +def get_versions() -> tuple[LooseVersion | None, ...]: ... +def is_cygwingcc() -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/distutils/dep_util.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/distutils/dep_util.pyi index 929d6ffd0..096ce19d4 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/distutils/dep_util.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/distutils/dep_util.pyi @@ -1,3 +1,3 @@ def newer(source: str, target: str) -> bool: ... def newer_pairwise(sources: list[str], targets: list[str]) -> list[tuple[str, str]]: ... -def newer_group(sources: list[str], target: str, missing: str = ...) -> bool: ... +def newer_group(sources: list[str], target: str, missing: str = "error") -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/distutils/dir_util.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/distutils/dir_util.pyi index ffe5ff1cf..2324a2d50 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/distutils/dir_util.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/distutils/dir_util.pyi @@ -1,13 +1,13 @@ -def mkpath(name: str, mode: int = ..., verbose: int = ..., dry_run: int = ...) -> list[str]: ... -def create_tree(base_dir: str, files: list[str], mode: int = ..., verbose: int = ..., dry_run: int = ...) -> None: ... +def mkpath(name: str, mode: int = 0o777, verbose: int = 1, dry_run: int = 0) -> list[str]: ... +def create_tree(base_dir: str, files: list[str], mode: int = 0o777, verbose: int = 1, dry_run: int = 0) -> None: ... def copy_tree( src: str, dst: str, - preserve_mode: int = ..., - preserve_times: int = ..., - preserve_symlinks: int = ..., - update: int = ..., - verbose: int = ..., - dry_run: int = ..., + preserve_mode: int = 1, + preserve_times: int = 1, + preserve_symlinks: int = 0, + update: int = 0, + verbose: int = 1, + dry_run: int = 0, ) -> list[str]: ... -def remove_tree(directory: str, verbose: int = ..., dry_run: int = ...) -> None: ... +def remove_tree(directory: str, verbose: int = 1, dry_run: int = 0) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/distutils/dist.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/distutils/dist.pyi index ef47e4e4d..697bd896f 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/distutils/dist.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/distutils/dist.pyi @@ -1,10 +1,17 @@ -from _typeshed import StrOrBytesPath, SupportsWrite +from _typeshed import FileDescriptorOrPath, Incomplete, SupportsWrite from collections.abc import Iterable, Mapping from distutils.cmd import Command -from typing import IO, Any +from re import Pattern +from typing import IO, Any, ClassVar, TypeVar, overload +from typing_extensions import TypeAlias + +command_re: Pattern[str] + +_OptionsList: TypeAlias = list[tuple[str, str | None, str, int] | tuple[str, str | None, str]] +_CommandT = TypeVar("_CommandT", bound=Command) class DistributionMetadata: - def __init__(self, path: int | StrOrBytesPath | None = ...) -> None: ... + def __init__(self, path: FileDescriptorOrPath | None = None) -> None: ... name: str | None version: str | None author: str | None @@ -53,7 +60,87 @@ class DistributionMetadata: class Distribution: cmdclass: dict[str, type[Command]] metadata: DistributionMetadata - def __init__(self, attrs: Mapping[str, Any] | None = ...) -> None: ... + def __init__(self, attrs: Mapping[str, Any] | None = None) -> None: ... def get_option_dict(self, command: str) -> dict[str, tuple[str, str]]: ... - def parse_config_files(self, filenames: Iterable[str] | None = ...) -> None: ... - def get_command_obj(self, command: str, create: bool = ...) -> Command | None: ... + def parse_config_files(self, filenames: Iterable[str] | None = None) -> None: ... + def get_command_obj(self, command: str, create: bool = True) -> Command | None: ... + global_options: ClassVar[_OptionsList] + common_usage: ClassVar[str] + display_options: ClassVar[_OptionsList] + display_option_names: ClassVar[list[str]] + negative_opt: ClassVar[dict[str, str]] + verbose: int + dry_run: int + help: int + command_packages: list[str] | None + script_name: str | None + script_args: list[str] | None + command_options: dict[str, dict[str, tuple[str, str]]] + dist_files: list[tuple[str, str, str]] + packages: Incomplete + package_data: dict[str, list[str]] + package_dir: Incomplete + py_modules: Incomplete + libraries: Incomplete + headers: Incomplete + ext_modules: Incomplete + ext_package: Incomplete + include_dirs: Incomplete + extra_path: Incomplete + scripts: Incomplete + data_files: Incomplete + password: str + command_obj: Incomplete + have_run: Incomplete + want_user_cfg: bool + def dump_option_dicts( + self, header: Incomplete | None = None, commands: Incomplete | None = None, indent: str = "" + ) -> None: ... + def find_config_files(self): ... + commands: Incomplete + def parse_command_line(self): ... + def finalize_options(self) -> None: ... + def handle_display_options(self, option_order): ... + def print_command_list(self, commands, header, max_length) -> None: ... + def print_commands(self) -> None: ... + def get_command_list(self): ... + def get_command_packages(self): ... + def get_command_class(self, command: str) -> type[Command]: ... + @overload + def reinitialize_command(self, command: str, reinit_subcommands: bool = False) -> Command: ... + @overload + def reinitialize_command(self, command: _CommandT, reinit_subcommands: bool = False) -> _CommandT: ... + def announce(self, msg, level: int = ...) -> None: ... + def run_commands(self) -> None: ... + def run_command(self, command: str) -> None: ... + def has_pure_modules(self) -> bool: ... + def has_ext_modules(self) -> bool: ... + def has_c_libraries(self) -> bool: ... + def has_modules(self) -> bool: ... + def has_headers(self) -> bool: ... + def has_scripts(self) -> bool: ... + def has_data_files(self) -> bool: ... + def is_pure(self) -> bool: ... + + # Getter methods generated in __init__ + def get_name(self) -> str: ... + def get_version(self) -> str: ... + def get_fullname(self) -> str: ... + def get_author(self) -> str: ... + def get_author_email(self) -> str: ... + def get_maintainer(self) -> str: ... + def get_maintainer_email(self) -> str: ... + def get_contact(self) -> str: ... + def get_contact_email(self) -> str: ... + def get_url(self) -> str: ... + def get_license(self) -> str: ... + def get_licence(self) -> str: ... + def get_description(self) -> str: ... + def get_long_description(self) -> str: ... + def get_keywords(self) -> str | list[str]: ... + def get_platforms(self) -> str | list[str]: ... + def get_classifiers(self) -> str | list[str]: ... + def get_download_url(self) -> str: ... + def get_requires(self) -> list[str]: ... + def get_provides(self) -> list[str]: ... + def get_obsoletes(self) -> list[str]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/distutils/extension.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/distutils/extension.pyi index 5639f44a6..789bbf6ec 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/distutils/extension.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/distutils/extension.pyi @@ -19,18 +19,18 @@ class Extension: self, name: str, sources: list[str], - include_dirs: list[str] | None = ..., - define_macros: list[tuple[str, str | None]] | None = ..., - undef_macros: list[str] | None = ..., - library_dirs: list[str] | None = ..., - libraries: list[str] | None = ..., - runtime_library_dirs: list[str] | None = ..., - extra_objects: list[str] | None = ..., - extra_compile_args: list[str] | None = ..., - extra_link_args: list[str] | None = ..., - export_symbols: list[str] | None = ..., - swig_opts: list[str] | None = ..., - depends: list[str] | None = ..., - language: str | None = ..., - optional: bool | None = ..., + include_dirs: list[str] | None = None, + define_macros: list[tuple[str, str | None]] | None = None, + undef_macros: list[str] | None = None, + library_dirs: list[str] | None = None, + libraries: list[str] | None = None, + runtime_library_dirs: list[str] | None = None, + extra_objects: list[str] | None = None, + extra_compile_args: list[str] | None = None, + extra_link_args: list[str] | None = None, + export_symbols: list[str] | None = None, + swig_opts: list[str] | None = None, + depends: list[str] | None = None, + language: str | None = None, + optional: bool | None = None, ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/distutils/fancy_getopt.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/distutils/fancy_getopt.pyi index 6a7124bd1..c15bb8a16 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/distutils/fancy_getopt.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/distutils/fancy_getopt.pyi @@ -1,24 +1,34 @@ from collections.abc import Iterable, Mapping +from re import Pattern from typing import Any, overload from typing_extensions import TypeAlias _Option: TypeAlias = tuple[str, str | None, str] _GR: TypeAlias = tuple[list[str], OptionDummy] -def fancy_getopt( - options: list[_Option], negative_opt: Mapping[_Option, _Option], object: Any, args: list[str] | None -) -> list[str] | _GR: ... -def wrap_text(text: str, width: int) -> list[str]: ... +longopt_pat: str +longopt_re: Pattern[str] +neg_alias_re: Pattern[str] +longopt_xlate: dict[int, int] class FancyGetopt: - def __init__(self, option_table: list[_Option] | None = ...) -> None: ... + def __init__(self, option_table: list[_Option] | None = None) -> None: ... # TODO kinda wrong, `getopt(object=object())` is invalid @overload - def getopt(self, args: list[str] | None = ...) -> _GR: ... + def getopt(self, args: list[str] | None = None) -> _GR: ... @overload def getopt(self, args: list[str] | None, object: Any) -> list[str]: ... def get_option_order(self) -> list[tuple[str, str]]: ... - def generate_help(self, header: str | None = ...) -> list[str]: ... + def generate_help(self, header: str | None = None) -> list[str]: ... + +def fancy_getopt( + options: list[_Option], negative_opt: Mapping[_Option, _Option], object: Any, args: list[str] | None +) -> list[str] | _GR: ... + +WS_TRANS: dict[int, str] + +def wrap_text(text: str, width: int) -> list[str]: ... +def translate_longopt(opt: str) -> str: ... class OptionDummy: def __init__(self, options: Iterable[str] = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/distutils/file_util.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/distutils/file_util.pyi index b3127841b..a97dfca60 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/distutils/file_util.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/distutils/file_util.pyi @@ -6,7 +6,7 @@ def copy_file( preserve_mode: bool = ..., preserve_times: bool = ..., update: bool = ..., - link: str | None = ..., + link: str | None = None, verbose: bool = ..., dry_run: bool = ..., ) -> tuple[str, str]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/distutils/filelist.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/distutils/filelist.pyi index 1cfdcf08d..bea48ac16 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/distutils/filelist.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/distutils/filelist.pyi @@ -7,9 +7,9 @@ from typing_extensions import Literal class FileList: allfiles: Iterable[str] | None files: list[str] - def __init__(self, warn: None = ..., debug_print: None = ...) -> None: ... + def __init__(self, warn: None = None, debug_print: None = None) -> None: ... def set_allfiles(self, allfiles: Iterable[str]) -> None: ... - def findall(self, dir: str = ...) -> None: ... + def findall(self, dir: str = ".") -> None: ... def debug_print(self, msg: str) -> None: ... def append(self, item: str) -> None: ... def extend(self, items: Iterable[str]) -> None: ... @@ -18,34 +18,34 @@ class FileList: def process_template_line(self, line: str) -> None: ... @overload def include_pattern( - self, pattern: str, anchor: bool | Literal[0, 1] = ..., prefix: str | None = ..., is_regex: Literal[0, False] = ... + self, pattern: str, anchor: bool | Literal[0, 1] = 1, prefix: str | None = None, is_regex: Literal[0, False] = 0 ) -> bool: ... @overload - def include_pattern(self, pattern: str | Pattern[str], *, is_regex: Literal[True, 1] = ...) -> bool: ... + def include_pattern(self, pattern: str | Pattern[str], *, is_regex: Literal[True, 1]) -> bool: ... @overload def include_pattern( - self, pattern: str | Pattern[str], anchor: bool | Literal[0, 1] = ..., prefix: str | None = ..., is_regex: int = ... + self, pattern: str | Pattern[str], anchor: bool | Literal[0, 1] = 1, prefix: str | None = None, is_regex: int = 0 ) -> bool: ... @overload def exclude_pattern( - self, pattern: str, anchor: bool | Literal[0, 1] = ..., prefix: str | None = ..., is_regex: Literal[0, False] = ... + self, pattern: str, anchor: bool | Literal[0, 1] = 1, prefix: str | None = None, is_regex: Literal[0, False] = 0 ) -> bool: ... @overload - def exclude_pattern(self, pattern: str | Pattern[str], *, is_regex: Literal[True, 1] = ...) -> bool: ... + def exclude_pattern(self, pattern: str | Pattern[str], *, is_regex: Literal[True, 1]) -> bool: ... @overload def exclude_pattern( - self, pattern: str | Pattern[str], anchor: bool | Literal[0, 1] = ..., prefix: str | None = ..., is_regex: int = ... + self, pattern: str | Pattern[str], anchor: bool | Literal[0, 1] = 1, prefix: str | None = None, is_regex: int = 0 ) -> bool: ... -def findall(dir: str = ...) -> list[str]: ... +def findall(dir: str = ".") -> list[str]: ... def glob_to_re(pattern: str) -> str: ... @overload def translate_pattern( - pattern: str, anchor: bool | Literal[0, 1] = ..., prefix: str | None = ..., is_regex: Literal[False, 0] = ... + pattern: str, anchor: bool | Literal[0, 1] = 1, prefix: str | None = None, is_regex: Literal[False, 0] = 0 ) -> Pattern[str]: ... @overload -def translate_pattern(pattern: str | Pattern[str], *, is_regex: Literal[True, 1] = ...) -> Pattern[str]: ... +def translate_pattern(pattern: str | Pattern[str], *, is_regex: Literal[True, 1]) -> Pattern[str]: ... @overload def translate_pattern( - pattern: str | Pattern[str], anchor: bool | Literal[0, 1] = ..., prefix: str | None = ..., is_regex: int = ... + pattern: str | Pattern[str], anchor: bool | Literal[0, 1] = 1, prefix: str | None = None, is_regex: int = 0 ) -> Pattern[str]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/distutils/log.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/distutils/log.pyi index 549b569e7..14ed8d8ae 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/distutils/log.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/distutils/log.pyi @@ -7,7 +7,7 @@ ERROR: int FATAL: int class Log: - def __init__(self, threshold: int = ...) -> None: ... + def __init__(self, threshold: int = 3) -> None: ... def log(self, level: int, msg: str, *args: Any) -> None: ... def debug(self, msg: str, *args: Any) -> None: ... def info(self, msg: str, *args: Any) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/distutils/spawn.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/distutils/spawn.pyi index dda05ad7e..a8a2c4140 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/distutils/spawn.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/distutils/spawn.pyi @@ -1,2 +1,2 @@ def spawn(cmd: list[str], search_path: bool = ..., verbose: bool = ..., dry_run: bool = ...) -> None: ... -def find_executable(executable: str, path: str | None = ...) -> str | None: ... +def find_executable(executable: str, path: str | None = None) -> str | None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/distutils/sysconfig.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/distutils/sysconfig.pyi index bf7db9c8f..464cfb639 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/distutils/sysconfig.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/distutils/sysconfig.pyi @@ -1,13 +1,22 @@ +import sys from collections.abc import Mapping from distutils.ccompiler import CCompiler PREFIX: str EXEC_PREFIX: str +BASE_PREFIX: str +BASE_EXEC_PREFIX: str +project_base: str +python_build: bool +def expand_makefile_vars(s: str, vars: Mapping[str, str]) -> str: ... def get_config_var(name: str) -> int | str | None: ... def get_config_vars(*args: str) -> Mapping[str, int | str]: ... def get_config_h_filename() -> str: ... def get_makefile_filename() -> str: ... -def get_python_inc(plat_specific: bool = ..., prefix: str | None = ...) -> str: ... -def get_python_lib(plat_specific: bool = ..., standard_lib: bool = ..., prefix: str | None = ...) -> str: ... +def get_python_inc(plat_specific: bool = ..., prefix: str | None = None) -> str: ... +def get_python_lib(plat_specific: bool = ..., standard_lib: bool = ..., prefix: str | None = None) -> str: ... def customize_compiler(compiler: CCompiler) -> None: ... + +if sys.version_info < (3, 10): + def get_python_version() -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/distutils/text_file.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/distutils/text_file.pyi index ace642e02..4a6cf1db7 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/distutils/text_file.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/distutils/text_file.pyi @@ -3,8 +3,8 @@ from typing import IO class TextFile: def __init__( self, - filename: str | None = ..., - file: IO[str] | None = ..., + filename: str | None = None, + file: IO[str] | None = None, *, strip_comments: bool = ..., lstrip_ws: bool = ..., @@ -15,7 +15,7 @@ class TextFile: ) -> None: ... def open(self, filename: str) -> None: ... def close(self) -> None: ... - def warn(self, msg: str, line: list[int] | tuple[int, int] | int | None = ...) -> None: ... + def warn(self, msg: str, line: list[int] | tuple[int, int] | int | None = None) -> None: ... def readline(self) -> str | None: ... def readlines(self) -> list[str]: ... def unreadline(self, line: str) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/distutils/util.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/distutils/util.pyi index da8d66063..83b03747f 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/distutils/util.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/distutils/util.pyi @@ -1,8 +1,12 @@ -from _typeshed import StrPath +import sys +from _typeshed import StrPath, Unused from collections.abc import Callable, Container, Iterable, Mapping from typing import Any from typing_extensions import Literal +if sys.version_info >= (3, 8): + def get_host_platform() -> str: ... + def get_platform() -> str: ... def convert_path(pathname: str) -> str: ... def change_root(new_root: str, pathname: str) -> str: ... @@ -10,33 +14,33 @@ def check_environ() -> None: ... def subst_vars(s: str, local_vars: Mapping[str, str]) -> None: ... def split_quoted(s: str) -> list[str]: ... def execute( - func: Callable[..., object], args: tuple[Any, ...], msg: str | None = ..., verbose: bool = ..., dry_run: bool = ... + func: Callable[..., object], args: tuple[Any, ...], msg: str | None = None, verbose: bool = ..., dry_run: bool = ... ) -> None: ... def strtobool(val: str) -> Literal[0, 1]: ... def byte_compile( py_files: list[str], - optimize: int = ..., + optimize: int = 0, force: bool = ..., - prefix: str | None = ..., - base_dir: str | None = ..., + prefix: str | None = None, + base_dir: str | None = None, verbose: bool = ..., dry_run: bool = ..., - direct: bool | None = ..., + direct: bool | None = None, ) -> None: ... def rfc822_escape(header: str) -> str: ... def run_2to3( files: Iterable[str], - fixer_names: Iterable[str] | None = ..., - options: Mapping[str, Any] | None = ..., - explicit: Container[str] | None = ..., # unused + fixer_names: Iterable[str] | None = None, + options: Mapping[str, Any] | None = None, + explicit: Unused = None, ) -> None: ... def copydir_run_2to3( src: StrPath, dest: StrPath, - template: str | None = ..., - fixer_names: Iterable[str] | None = ..., - options: Mapping[str, Any] | None = ..., - explicit: Container[str] | None = ..., + template: str | None = None, + fixer_names: Iterable[str] | None = None, + options: Mapping[str, Any] | None = None, + explicit: Container[str] | None = None, ) -> list[str]: ... class Mixin2to3: diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/distutils/version.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/distutils/version.pyi index 627d45067..47da65ef8 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/distutils/version.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/distutils/version.pyi @@ -1,36 +1,36 @@ -from _typeshed import Self from abc import abstractmethod from re import Pattern +from typing_extensions import Self class Version: def __eq__(self, other: object) -> bool: ... - def __lt__(self: Self, other: Self | str) -> bool: ... - def __le__(self: Self, other: Self | str) -> bool: ... - def __gt__(self: Self, other: Self | str) -> bool: ... - def __ge__(self: Self, other: Self | str) -> bool: ... + def __lt__(self, other: Self | str) -> bool: ... + def __le__(self, other: Self | str) -> bool: ... + def __gt__(self, other: Self | str) -> bool: ... + def __ge__(self, other: Self | str) -> bool: ... @abstractmethod - def __init__(self, vstring: str | None = ...) -> None: ... + def __init__(self, vstring: str | None = None) -> None: ... @abstractmethod - def parse(self: Self, vstring: str) -> Self: ... + def parse(self, vstring: str) -> Self: ... @abstractmethod def __str__(self) -> str: ... @abstractmethod - def _cmp(self: Self, other: Self | str) -> bool: ... + def _cmp(self, other: Self | str) -> bool: ... class StrictVersion(Version): version_re: Pattern[str] version: tuple[int, int, int] prerelease: tuple[str, int] | None - def __init__(self, vstring: str | None = ...) -> None: ... - def parse(self: Self, vstring: str) -> Self: ... + def __init__(self, vstring: str | None = None) -> None: ... + def parse(self, vstring: str) -> Self: ... def __str__(self) -> str: ... # noqa: Y029 - def _cmp(self: Self, other: Self | str) -> bool: ... + def _cmp(self, other: Self | str) -> bool: ... class LooseVersion(Version): component_re: Pattern[str] vstring: str version: tuple[str | int, ...] - def __init__(self, vstring: str | None = ...) -> None: ... - def parse(self: Self, vstring: str) -> Self: ... + def __init__(self, vstring: str | None = None) -> None: ... + def parse(self, vstring: str) -> Self: ... def __str__(self) -> str: ... # noqa: Y029 - def _cmp(self: Self, other: Self | str) -> bool: ... + def _cmp(self, other: Self | str) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/doctest.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/doctest.pyi index 382d9578c..88d066fdc 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/doctest.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/doctest.pyi @@ -80,10 +80,10 @@ class Example: self, source: str, want: str, - exc_msg: str | None = ..., - lineno: int = ..., - indent: int = ..., - options: dict[int, bool] | None = ..., + exc_msg: str | None = None, + lineno: int = 0, + indent: int = 0, + options: dict[int, bool] | None = None, ) -> None: ... def __eq__(self, other: object) -> bool: ... @@ -107,21 +107,21 @@ class DocTest: def __eq__(self, other: object) -> bool: ... class DocTestParser: - def parse(self, string: str, name: str = ...) -> list[str | Example]: ... + def parse(self, string: str, name: str = "") -> list[str | Example]: ... def get_doctest(self, string: str, globs: dict[str, Any], name: str, filename: str | None, lineno: int | None) -> DocTest: ... - def get_examples(self, string: str, name: str = ...) -> list[Example]: ... + def get_examples(self, string: str, name: str = "") -> list[Example]: ... class DocTestFinder: def __init__( - self, verbose: bool = ..., parser: DocTestParser = ..., recurse: bool = ..., exclude_empty: bool = ... + self, verbose: bool = False, parser: DocTestParser = ..., recurse: bool = True, exclude_empty: bool = True ) -> None: ... def find( self, obj: object, - name: str | None = ..., - module: None | bool | types.ModuleType = ..., - globs: dict[str, Any] | None = ..., - extraglobs: dict[str, Any] | None = ..., + name: str | None = None, + module: None | bool | types.ModuleType = None, + globs: dict[str, Any] | None = None, + extraglobs: dict[str, Any] | None = None, ) -> list[DocTest]: ... _Out: TypeAlias = Callable[[str], object] @@ -133,15 +133,15 @@ class DocTestRunner: tries: int failures: int test: DocTest - def __init__(self, checker: OutputChecker | None = ..., verbose: bool | None = ..., optionflags: int = ...) -> None: ... + def __init__(self, checker: OutputChecker | None = None, verbose: bool | None = None, optionflags: int = 0) -> None: ... def report_start(self, out: _Out, test: DocTest, example: Example) -> None: ... def report_success(self, out: _Out, test: DocTest, example: Example, got: str) -> None: ... def report_failure(self, out: _Out, test: DocTest, example: Example, got: str) -> None: ... def report_unexpected_exception(self, out: _Out, test: DocTest, example: Example, exc_info: ExcInfo) -> None: ... def run( - self, test: DocTest, compileflags: int | None = ..., out: _Out | None = ..., clear_globs: bool = ... + self, test: DocTest, compileflags: int | None = None, out: _Out | None = None, clear_globs: bool = True ) -> TestResults: ... - def summarize(self, verbose: bool | None = ...) -> TestResults: ... + def summarize(self, verbose: bool | None = None) -> TestResults: ... def merge(self, other: DocTestRunner) -> None: ... class OutputChecker: @@ -165,32 +165,37 @@ class DebugRunner(DocTestRunner): ... master: DocTestRunner | None def testmod( - m: types.ModuleType | None = ..., - name: str | None = ..., - globs: dict[str, Any] | None = ..., - verbose: bool | None = ..., - report: bool = ..., - optionflags: int = ..., - extraglobs: dict[str, Any] | None = ..., - raise_on_error: bool = ..., - exclude_empty: bool = ..., + m: types.ModuleType | None = None, + name: str | None = None, + globs: dict[str, Any] | None = None, + verbose: bool | None = None, + report: bool = True, + optionflags: int = 0, + extraglobs: dict[str, Any] | None = None, + raise_on_error: bool = False, + exclude_empty: bool = False, ) -> TestResults: ... def testfile( filename: str, - module_relative: bool = ..., - name: str | None = ..., - package: None | str | types.ModuleType = ..., - globs: dict[str, Any] | None = ..., - verbose: bool | None = ..., - report: bool = ..., - optionflags: int = ..., - extraglobs: dict[str, Any] | None = ..., - raise_on_error: bool = ..., + module_relative: bool = True, + name: str | None = None, + package: None | str | types.ModuleType = None, + globs: dict[str, Any] | None = None, + verbose: bool | None = None, + report: bool = True, + optionflags: int = 0, + extraglobs: dict[str, Any] | None = None, + raise_on_error: bool = False, parser: DocTestParser = ..., - encoding: str | None = ..., + encoding: str | None = None, ) -> TestResults: ... def run_docstring_examples( - f: object, globs: dict[str, Any], verbose: bool = ..., name: str = ..., compileflags: int | None = ..., optionflags: int = ... + f: object, + globs: dict[str, Any], + verbose: bool = False, + name: str = "NoName", + compileflags: int | None = None, + optionflags: int = 0, ) -> None: ... def set_unittest_reportflags(flags: int) -> int: ... @@ -198,52 +203,43 @@ class DocTestCase(unittest.TestCase): def __init__( self, test: DocTest, - optionflags: int = ..., - setUp: Callable[[DocTest], object] | None = ..., - tearDown: Callable[[DocTest], object] | None = ..., - checker: OutputChecker | None = ..., + optionflags: int = 0, + setUp: Callable[[DocTest], Any] | None = None, + tearDown: Callable[[DocTest], Any] | None = None, + checker: OutputChecker | None = None, ) -> None: ... - def setUp(self) -> None: ... - def tearDown(self) -> None: ... def runTest(self) -> None: ... def format_failure(self, err: str) -> str: ... - def debug(self) -> None: ... - def id(self) -> str: ... def __eq__(self, other: object) -> bool: ... - def shortDescription(self) -> str: ... class SkipDocTestCase(DocTestCase): def __init__(self, module: types.ModuleType) -> None: ... - def setUp(self) -> None: ... def test_skip(self) -> None: ... - def shortDescription(self) -> str: ... class _DocTestSuite(unittest.TestSuite): ... def DocTestSuite( - module: None | str | types.ModuleType = ..., - globs: dict[str, Any] | None = ..., - extraglobs: dict[str, Any] | None = ..., - test_finder: DocTestFinder | None = ..., + module: None | str | types.ModuleType = None, + globs: dict[str, Any] | None = None, + extraglobs: dict[str, Any] | None = None, + test_finder: DocTestFinder | None = None, **options: Any, ) -> _DocTestSuite: ... -class DocFileCase(DocTestCase): - def id(self) -> str: ... - def format_failure(self, err: str) -> str: ... +class DocFileCase(DocTestCase): ... def DocFileTest( path: str, - module_relative: bool = ..., - package: None | str | types.ModuleType = ..., - globs: dict[str, Any] | None = ..., + module_relative: bool = True, + package: None | str | types.ModuleType = None, + globs: dict[str, Any] | None = None, parser: DocTestParser = ..., - encoding: str | None = ..., + encoding: str | None = None, **options: Any, ) -> DocFileCase: ... def DocFileSuite(*paths: str, **kw: Any) -> _DocTestSuite: ... def script_from_examples(s: str) -> str: ... def testsource(module: None | str | types.ModuleType, name: str) -> str: ... -def debug_src(src: str, pm: bool = ..., globs: dict[str, Any] | None = ...) -> None: ... -def debug_script(src: str, pm: bool = ..., globs: dict[str, Any] | None = ...) -> None: ... -def debug(module: None | str | types.ModuleType, name: str, pm: bool = ...) -> None: ... +def debug_src(src: str, pm: bool = False, globs: dict[str, Any] | None = None) -> None: ... +def debug_script(src: str, pm: bool = False, globs: dict[str, Any] | None = None) -> None: ... +def debug(module: None | str | types.ModuleType, name: str, pm: bool = False) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/email/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/email/__init__.pyi index 4591b2c33..fca302f5f 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/email/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/email/__init__.pyi @@ -1,15 +1,15 @@ from collections.abc import Callable from email.message import Message from email.policy import Policy -from typing import IO, Union +from typing import IO from typing_extensions import TypeAlias # Definitions imported by multiple submodules in typeshed -_ParamType: TypeAlias = Union[str, tuple[str | None, str | None, str]] # noqa: Y047 -_ParamsType: TypeAlias = Union[str, None, tuple[str, str | None, str]] # noqa: Y047 +_ParamType: TypeAlias = str | tuple[str | None, str | None, str] # noqa: Y047 +_ParamsType: TypeAlias = str | None | tuple[str, str | None, str] # noqa: Y047 def message_from_string(s: str, _class: Callable[[], Message] = ..., *, policy: Policy = ...) -> Message: ... -def message_from_bytes(s: bytes, _class: Callable[[], Message] = ..., *, policy: Policy = ...) -> Message: ... +def message_from_bytes(s: bytes | bytearray, _class: Callable[[], Message] = ..., *, policy: Policy = ...) -> Message: ... def message_from_file(fp: IO[str], _class: Callable[[], Message] = ..., *, policy: Policy = ...) -> Message: ... def message_from_binary_file(fp: IO[bytes], _class: Callable[[], Message] = ..., *, policy: Policy = ...) -> Message: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/email/_header_value_parser.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/email/_header_value_parser.pyi index 00d5c9882..97008140e 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/email/_header_value_parser.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/email/_header_value_parser.pyi @@ -1,11 +1,10 @@ import sys -from _typeshed import Self from collections.abc import Iterable, Iterator from email.errors import HeaderParseError, MessageDefect from email.policy import Policy from re import Pattern from typing import Any -from typing_extensions import Final +from typing_extensions import Final, Self WSP: Final[set[str]] CFWS_LEADER: Final[set[str]] @@ -39,14 +38,10 @@ class TokenList(list[TokenList | Terminal]): @property def comments(self) -> list[str]: ... def fold(self, *, policy: Policy) -> str: ... - def pprint(self, indent: str = ...) -> None: ... - def ppstr(self, indent: str = ...) -> str: ... + def pprint(self, indent: str = "") -> None: ... + def ppstr(self, indent: str = "") -> str: ... -class WhiteSpaceTokenList(TokenList): - @property - def value(self) -> str: ... - @property - def comments(self) -> list[str]: ... +class WhiteSpaceTokenList(TokenList): ... class UnstructuredTokenList(TokenList): token_type: str @@ -84,16 +79,12 @@ class QuotedString(TokenList): class BareQuotedString(QuotedString): token_type: str - @property - def value(self) -> str: ... class Comment(WhiteSpaceTokenList): token_type: str def quote(self, value: Any) -> str: ... @property def content(self) -> str: ... - @property - def comments(self) -> list[str]: ... class AddressList(TokenList): token_type: str @@ -217,8 +208,6 @@ class AddrSpec(TokenList): @property def domain(self) -> str: ... @property - def value(self) -> str: ... - @property def addr_spec(self) -> str: ... class ObsLocalPart(TokenList): @@ -227,18 +216,13 @@ class ObsLocalPart(TokenList): class DisplayName(Phrase): token_type: str - ew_combine_allowed: bool @property def display_name(self) -> str: ... - @property - def value(self) -> str: ... class LocalPart(TokenList): token_type: str as_ew_allowed: bool @property - def value(self) -> str: ... - @property def local_part(self) -> str: ... class DomainLiteral(TokenList): @@ -333,7 +317,7 @@ class Terminal(str): syntactic_break: bool token_type: str defects: list[MessageDefect] - def __new__(cls: type[Self], value: str, token_type: str) -> Self: ... + def __new__(cls, value: str, token_type: str) -> Self: ... def pprint(self) -> None: ... @property def all_defects(self) -> list[MessageDefect]: ... @@ -352,10 +336,7 @@ class ValueTerminal(Terminal): def value(self) -> ValueTerminal: ... def startswith_fws(self) -> bool: ... -class EWWhiteSpaceTerminal(WhiteSpaceTerminal): - @property - def value(self) -> str: ... - +class EWWhiteSpaceTerminal(WhiteSpaceTerminal): ... class _InvalidEwError(HeaderParseError): ... DOT: Final[ValueTerminal] diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/email/base64mime.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/email/base64mime.pyi index e55658046..563cd7f66 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/email/base64mime.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/email/base64mime.pyi @@ -1,9 +1,13 @@ __all__ = ["body_decode", "body_encode", "decode", "decodestring", "header_encode", "header_length"] -def header_length(bytearray: str | bytes) -> int: ... -def header_encode(header_bytes: str | bytes, charset: str = ...) -> str: ... -def body_encode(s: bytes, maxlinelen: int = ..., eol: str = ...) -> str: ... -def decode(string: str | bytes) -> bytes: ... +from _typeshed import ReadableBuffer + +def header_length(bytearray: str | bytes | bytearray) -> int: ... +def header_encode(header_bytes: str | ReadableBuffer, charset: str = "iso-8859-1") -> str: ... + +# First argument should be a buffer that supports slicing and len(). +def body_encode(s: bytes | bytearray, maxlinelen: int = 76, eol: str = "\n") -> str: ... +def decode(string: str | ReadableBuffer) -> bytes: ... body_decode = decode decodestring = decode diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/email/charset.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/email/charset.pyi index 236908537..e612847c7 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/email/charset.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/email/charset.pyi @@ -13,17 +13,17 @@ class Charset: output_charset: str | None input_codec: str | None output_codec: str | None - def __init__(self, input_charset: str = ...) -> None: ... + def __init__(self, input_charset: str = "us-ascii") -> None: ... def get_body_encoding(self) -> str: ... def get_output_charset(self) -> str | None: ... def header_encode(self, string: str) -> str: ... def header_encode_lines(self, string: str, maxlengths: Iterator[int]) -> list[str]: ... def body_encode(self, string: str) -> str: ... def __eq__(self, other: object) -> bool: ... - def __ne__(self, __other: object) -> bool: ... + def __ne__(self, __value: object) -> bool: ... def add_charset( - charset: str, header_enc: int | None = ..., body_enc: int | None = ..., output_charset: str | None = ... + charset: str, header_enc: int | None = None, body_enc: int | None = None, output_charset: str | None = None ) -> None: ... def add_alias(alias: str, canonical: str) -> None: ... def add_codec(charset: str, codecname: str) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/email/contentmanager.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/email/contentmanager.pyi index 3ac665eaa..3214f1a47 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/email/contentmanager.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/email/contentmanager.pyi @@ -3,7 +3,6 @@ from email.message import Message from typing import Any class ContentManager: - def __init__(self) -> None: ... def get_content(self, msg: Message, *args: Any, **kw: Any) -> Any: ... def set_content(self, msg: Message, obj: Any, *args: Any, **kw: Any) -> Any: ... def add_get_handler(self, key: str, handler: Callable[..., Any]) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/email/errors.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/email/errors.pyi index 656cbd374..c54f1560c 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/email/errors.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/email/errors.pyi @@ -8,7 +8,7 @@ class MultipartConversionError(MessageError, TypeError): ... class CharsetError(MessageError): ... class MessageDefect(ValueError): - def __init__(self, line: str | None = ...) -> None: ... + def __init__(self, line: str | None = None) -> None: ... class NoBoundaryInMultipartDefect(MessageDefect): ... class StartBoundaryNotFoundDefect(MessageDefect): ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/email/feedparser.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/email/feedparser.pyi index c535c353d..4b7f73b9c 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/email/feedparser.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/email/feedparser.pyi @@ -9,7 +9,7 @@ _MessageT = TypeVar("_MessageT", bound=Message) class FeedParser(Generic[_MessageT]): @overload - def __init__(self: FeedParser[Message], _factory: None = ..., *, policy: Policy = ...) -> None: ... + def __init__(self: FeedParser[Message], _factory: None = None, *, policy: Policy = ...) -> None: ... @overload def __init__(self, _factory: Callable[[], _MessageT], *, policy: Policy = ...) -> None: ... def feed(self, data: str) -> None: ... @@ -17,8 +17,8 @@ class FeedParser(Generic[_MessageT]): class BytesFeedParser(Generic[_MessageT]): @overload - def __init__(self: BytesFeedParser[Message], _factory: None = ..., *, policy: Policy = ...) -> None: ... + def __init__(self: BytesFeedParser[Message], _factory: None = None, *, policy: Policy = ...) -> None: ... @overload def __init__(self, _factory: Callable[[], _MessageT], *, policy: Policy = ...) -> None: ... - def feed(self, data: bytes) -> None: ... + def feed(self, data: bytes | bytearray) -> None: ... def close(self) -> _MessageT: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/email/generator.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/email/generator.pyi index 5a6b6374d..8362dd9c4 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/email/generator.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/email/generator.pyi @@ -10,12 +10,12 @@ class Generator: def __init__( self, outfp: SupportsWrite[str], - mangle_from_: bool | None = ..., - maxheaderlen: int | None = ..., + mangle_from_: bool | None = None, + maxheaderlen: int | None = None, *, - policy: Policy | None = ..., + policy: Policy | None = None, ) -> None: ... - def flatten(self, msg: Message, unixfrom: bool = ..., linesep: str | None = ...) -> None: ... + def flatten(self, msg: Message, unixfrom: bool = False, linesep: str | None = None) -> None: ... class BytesGenerator: def clone(self, fp: SupportsWrite[bytes]) -> BytesGenerator: ... @@ -23,20 +23,20 @@ class BytesGenerator: def __init__( self, outfp: SupportsWrite[bytes], - mangle_from_: bool | None = ..., - maxheaderlen: int | None = ..., + mangle_from_: bool | None = None, + maxheaderlen: int | None = None, *, - policy: Policy | None = ..., + policy: Policy | None = None, ) -> None: ... - def flatten(self, msg: Message, unixfrom: bool = ..., linesep: str | None = ...) -> None: ... + def flatten(self, msg: Message, unixfrom: bool = False, linesep: str | None = None) -> None: ... class DecodedGenerator(Generator): def __init__( self, outfp: SupportsWrite[str], - mangle_from_: bool | None = ..., - maxheaderlen: int | None = ..., - fmt: str | None = ..., + mangle_from_: bool | None = None, + maxheaderlen: int | None = None, + fmt: str | None = None, *, - policy: Policy | None = ..., + policy: Policy | None = None, ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/email/header.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/email/header.pyi index 924875916..fc9d73331 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/email/header.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/email/header.pyi @@ -1,3 +1,4 @@ +from collections.abc import Iterable from email.charset import Charset from typing import Any @@ -6,25 +7,25 @@ __all__ = ["Header", "decode_header", "make_header"] class Header: def __init__( self, - s: bytes | str | None = ..., - charset: Charset | str | None = ..., - maxlinelen: int | None = ..., - header_name: str | None = ..., - continuation_ws: str = ..., - errors: str = ..., + s: bytes | bytearray | str | None = None, + charset: Charset | str | None = None, + maxlinelen: int | None = None, + header_name: str | None = None, + continuation_ws: str = " ", + errors: str = "strict", ) -> None: ... - def append(self, s: bytes | str, charset: Charset | str | None = ..., errors: str = ...) -> None: ... - def encode(self, splitchars: str = ..., maxlinelen: int | None = ..., linesep: str = ...) -> str: ... + def append(self, s: bytes | bytearray | str, charset: Charset | str | None = None, errors: str = "strict") -> None: ... + def encode(self, splitchars: str = ";, \t", maxlinelen: int | None = None, linesep: str = "\n") -> str: ... def __eq__(self, other: object) -> bool: ... - def __ne__(self, __other: object) -> bool: ... + def __ne__(self, __value: object) -> bool: ... # decode_header() either returns list[tuple[str, None]] if the header # contains no encoded parts, or list[tuple[bytes, str | None]] if the header # contains at least one encoded part. def decode_header(header: Header | str) -> list[tuple[Any, Any | None]]: ... def make_header( - decoded_seq: list[tuple[bytes, str | None]], - maxlinelen: int | None = ..., - header_name: str | None = ..., - continuation_ws: str = ..., + decoded_seq: Iterable[tuple[bytes | bytearray | str, str | None]], + maxlinelen: int | None = None, + header_name: str | None = None, + continuation_ws: str = " ", ) -> Header: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/email/headerregistry.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/email/headerregistry.pyi index 7f1d86b98..e158e8981 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/email/headerregistry.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/email/headerregistry.pyi @@ -1,6 +1,5 @@ import sys import types -from _typeshed import Self from collections.abc import Iterable, Mapping from datetime import datetime as _datetime from email._header_value_parser import ( @@ -14,8 +13,8 @@ from email._header_value_parser import ( ) from email.errors import MessageDefect from email.policy import Policy -from typing import Any, ClassVar -from typing_extensions import Literal +from typing import Any, ClassVar, Protocol +from typing_extensions import Literal, Self class BaseHeader(str): # max_count is actually more of an abstract ClassVar (not defined on the base class, but expected to be defined in subclasses) @@ -24,7 +23,7 @@ class BaseHeader(str): def name(self) -> str: ... @property def defects(self) -> tuple[MessageDefect, ...]: ... - def __new__(cls: type[Self], name: str, value: Any) -> Self: ... + def __new__(cls, name: str, value: Any) -> Self: ... def init(self, name: str, *, parse_tree: TokenList, defects: Iterable[MessageDefect]) -> None: ... def fold(self, *, policy: Policy) -> str: ... @@ -141,9 +140,19 @@ if sys.version_info >= (3, 8): @staticmethod def value_parser(value: str) -> MessageID: ... +class _HeaderParser(Protocol): + max_count: ClassVar[Literal[1] | None] + @staticmethod + def value_parser(value: str) -> TokenList: ... + @classmethod + def parse(cls, value: str, kwds: dict[str, Any]) -> None: ... + class HeaderRegistry: + registry: dict[str, type[_HeaderParser]] + base_class: type[BaseHeader] + default_class: type[_HeaderParser] def __init__( - self, base_class: type[BaseHeader] = ..., default_class: type[BaseHeader] = ..., use_default_map: bool = ... + self, base_class: type[BaseHeader] = ..., default_class: type[_HeaderParser] = ..., use_default_map: bool = True ) -> None: ... def map_to_type(self, name: str, cls: type[BaseHeader]) -> None: ... def __getitem__(self, name: str) -> type[BaseHeader]: ... @@ -159,7 +168,7 @@ class Address: @property def addr_spec(self) -> str: ... def __init__( - self, display_name: str = ..., username: str | None = ..., domain: str | None = ..., addr_spec: str | None = ... + self, display_name: str = "", username: str | None = "", domain: str | None = "", addr_spec: str | None = None ) -> None: ... def __eq__(self, other: object) -> bool: ... @@ -168,5 +177,5 @@ class Group: def display_name(self) -> str | None: ... @property def addresses(self) -> tuple[Address, ...]: ... - def __init__(self, display_name: str | None = ..., addresses: Iterable[Address] | None = ...) -> None: ... + def __init__(self, display_name: str | None = None, addresses: Iterable[Address] | None = None) -> None: ... def __eq__(self, other: object) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/email/iterators.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/email/iterators.pyi index 29068819a..d964d6843 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/email/iterators.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/email/iterators.pyi @@ -4,9 +4,9 @@ from email.message import Message __all__ = ["body_line_iterator", "typed_subpart_iterator", "walk"] -def body_line_iterator(msg: Message, decode: bool = ...) -> Iterator[str]: ... -def typed_subpart_iterator(msg: Message, maintype: str = ..., subtype: str | None = ...) -> Iterator[str]: ... +def body_line_iterator(msg: Message, decode: bool = False) -> Iterator[str]: ... +def typed_subpart_iterator(msg: Message, maintype: str = "text", subtype: str | None = None) -> Iterator[str]: ... def walk(self: Message) -> Iterator[Message]: ... # We include the seemingly private function because it is documented in the stdlib documentation. -def _structure(msg: Message, fp: SupportsWrite[str] | None = ..., level: int = ..., include_default: bool = ...) -> None: ... +def _structure(msg: Message, fp: SupportsWrite[str] | None = None, level: int = 0, include_default: bool = False) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/email/message.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/email/message.pyi index 4e8f600f7..14e018073 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/email/message.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/email/message.pyi @@ -1,18 +1,17 @@ -from _typeshed import Self from collections.abc import Generator, Iterator, Sequence from email import _ParamsType, _ParamType from email.charset import Charset from email.contentmanager import ContentManager from email.errors import MessageDefect from email.policy import Policy -from typing import Any, TypeVar -from typing_extensions import TypeAlias +from typing import Any, TypeVar, overload +from typing_extensions import Self, TypeAlias __all__ = ["Message", "EmailMessage"] _T = TypeVar("_T") -_PayloadType: TypeAlias = list[Message] | str | bytes +_PayloadType: TypeAlias = list[Message] | str | bytes | bytearray _CharsetType: TypeAlias = Charset | str | None _HeaderType: TypeAlias = Any @@ -25,8 +24,8 @@ class Message: def set_unixfrom(self, unixfrom: str) -> None: ... def get_unixfrom(self) -> str | None: ... def attach(self, payload: Message) -> None: ... - def get_payload(self, i: int | None = ..., decode: bool = ...) -> Any: ... # returns _PayloadType | None - def set_payload(self, payload: _PayloadType, charset: _CharsetType = ...) -> None: ... + def get_payload(self, i: int | None = None, decode: bool = False) -> Any: ... # returns _PayloadType | None + def set_payload(self, payload: _PayloadType, charset: _CharsetType = None) -> None: ... def set_charset(self, charset: _CharsetType) -> None: ... def get_charset(self) -> _CharsetType: ... def __len__(self) -> int: ... @@ -38,8 +37,14 @@ class Message: def keys(self) -> list[str]: ... def values(self) -> list[_HeaderType]: ... def items(self) -> list[tuple[str, _HeaderType]]: ... - def get(self, name: str, failobj: _T = ...) -> _HeaderType | _T: ... - def get_all(self, name: str, failobj: _T = ...) -> list[_HeaderType] | _T: ... + @overload + def get(self, name: str, failobj: None = None) -> _HeaderType | None: ... + @overload + def get(self, name: str, failobj: _T) -> _HeaderType | _T: ... + @overload + def get_all(self, name: str, failobj: None = None) -> list[_HeaderType] | None: ... + @overload + def get_all(self, name: str, failobj: _T) -> list[_HeaderType] | _T: ... def add_header(self, _name: str, _value: str, **_params: _ParamsType) -> None: ... def replace_header(self, _name: str, _value: _HeaderType) -> None: ... def get_content_type(self) -> str: ... @@ -47,51 +52,73 @@ class Message: def get_content_subtype(self) -> str: ... def get_default_type(self) -> str: ... def set_default_type(self, ctype: str) -> None: ... - def get_params(self, failobj: _T = ..., header: str = ..., unquote: bool = ...) -> list[tuple[str, str]] | _T: ... - def get_param(self, param: str, failobj: _T = ..., header: str = ..., unquote: bool = ...) -> _T | _ParamType: ... - def del_param(self, param: str, header: str = ..., requote: bool = ...) -> None: ... - def set_type(self, type: str, header: str = ..., requote: bool = ...) -> None: ... - def get_filename(self, failobj: _T = ...) -> _T | str: ... - def get_boundary(self, failobj: _T = ...) -> _T | str: ... + @overload + def get_params( + self, failobj: None = None, header: str = "content-type", unquote: bool = True + ) -> list[tuple[str, str]] | None: ... + @overload + def get_params(self, failobj: _T, header: str = "content-type", unquote: bool = True) -> list[tuple[str, str]] | _T: ... + @overload + def get_param( + self, param: str, failobj: None = None, header: str = "content-type", unquote: bool = True + ) -> _ParamType | None: ... + @overload + def get_param(self, param: str, failobj: _T, header: str = "content-type", unquote: bool = True) -> _ParamType | _T: ... + def del_param(self, param: str, header: str = "content-type", requote: bool = True) -> None: ... + def set_type(self, type: str, header: str = "Content-Type", requote: bool = True) -> None: ... + @overload + def get_filename(self, failobj: None = None) -> str | None: ... + @overload + def get_filename(self, failobj: _T) -> str | _T: ... + @overload + def get_boundary(self, failobj: None = None) -> str | None: ... + @overload + def get_boundary(self, failobj: _T) -> str | _T: ... def set_boundary(self, boundary: str) -> None: ... - def get_content_charset(self, failobj: _T = ...) -> _T | str: ... - def get_charsets(self, failobj: _T = ...) -> _T | list[str]: ... - def walk(self: Self) -> Generator[Self, None, None]: ... + @overload + def get_content_charset(self) -> str | None: ... + @overload + def get_content_charset(self, failobj: _T) -> str | _T: ... + @overload + def get_charsets(self, failobj: None = None) -> list[str] | None: ... + @overload + def get_charsets(self, failobj: _T) -> list[str] | _T: ... + def walk(self) -> Generator[Self, None, None]: ... def get_content_disposition(self) -> str | None: ... - def as_string(self, unixfrom: bool = ..., maxheaderlen: int = ..., policy: Policy | None = ...) -> str: ... - def as_bytes(self, unixfrom: bool = ..., policy: Policy | None = ...) -> bytes: ... + def as_string(self, unixfrom: bool = False, maxheaderlen: int = 0, policy: Policy | None = None) -> str: ... + def as_bytes(self, unixfrom: bool = False, policy: Policy | None = None) -> bytes: ... def __bytes__(self) -> bytes: ... def set_param( self, param: str, value: str, - header: str = ..., - requote: bool = ..., - charset: str | None = ..., - language: str = ..., - replace: bool = ..., + header: str = "Content-Type", + requote: bool = True, + charset: str | None = None, + language: str = "", + replace: bool = False, ) -> None: ... def __init__(self, policy: Policy = ...) -> None: ... # The following two methods are undocumented, but a source code comment states that they are public API - def set_raw(self, name: str, value: str) -> None: ... - def raw_items(self) -> Iterator[tuple[str, str]]: ... + def set_raw(self, name: str, value: _HeaderType) -> None: ... + def raw_items(self) -> Iterator[tuple[str, _HeaderType]]: ... class MIMEPart(Message): - def __init__(self, policy: Policy | None = ...) -> None: ... + def __init__(self, policy: Policy | None = None) -> None: ... def get_body(self, preferencelist: Sequence[str] = ...) -> Message | None: ... def iter_attachments(self) -> Iterator[Message]: ... def iter_parts(self) -> Iterator[Message]: ... - def get_content(self, *args: Any, content_manager: ContentManager | None = ..., **kw: Any) -> Any: ... - def set_content(self, *args: Any, content_manager: ContentManager | None = ..., **kw: Any) -> None: ... - def make_related(self, boundary: str | None = ...) -> None: ... - def make_alternative(self, boundary: str | None = ...) -> None: ... - def make_mixed(self, boundary: str | None = ...) -> None: ... + def get_content(self, *args: Any, content_manager: ContentManager | None = None, **kw: Any) -> Any: ... + def set_content(self, *args: Any, content_manager: ContentManager | None = None, **kw: Any) -> None: ... + def make_related(self, boundary: str | None = None) -> None: ... + def make_alternative(self, boundary: str | None = None) -> None: ... + def make_mixed(self, boundary: str | None = None) -> None: ... def add_related(self, *args: Any, content_manager: ContentManager | None = ..., **kw: Any) -> None: ... def add_alternative(self, *args: Any, content_manager: ContentManager | None = ..., **kw: Any) -> None: ... def add_attachment(self, *args: Any, content_manager: ContentManager | None = ..., **kw: Any) -> None: ... def clear(self) -> None: ... def clear_content(self) -> None: ... - def as_string(self, unixfrom: bool = ..., maxheaderlen: int | None = ..., policy: Policy | None = ...) -> str: ... + def as_string(self, unixfrom: bool = False, maxheaderlen: int | None = None, policy: Policy | None = None) -> str: ... def is_attachment(self) -> bool: ... class EmailMessage(MIMEPart): ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/email/mime/application.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/email/mime/application.pyi index dfff85265..a7ab9dc75 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/email/mime/application.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/email/mime/application.pyi @@ -8,10 +8,10 @@ __all__ = ["MIMEApplication"] class MIMEApplication(MIMENonMultipart): def __init__( self, - _data: str | bytes, - _subtype: str = ..., + _data: str | bytes | bytearray, + _subtype: str = "octet-stream", _encoder: Callable[[MIMEApplication], object] = ..., *, - policy: Policy | None = ..., + policy: Policy | None = None, **_params: _ParamsType, ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/email/mime/audio.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/email/mime/audio.pyi index b355d5507..090dfb960 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/email/mime/audio.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/email/mime/audio.pyi @@ -8,10 +8,10 @@ __all__ = ["MIMEAudio"] class MIMEAudio(MIMENonMultipart): def __init__( self, - _audiodata: str | bytes, - _subtype: str | None = ..., + _audiodata: str | bytes | bytearray, + _subtype: str | None = None, _encoder: Callable[[MIMEAudio], object] = ..., *, - policy: Policy | None = ..., + policy: Policy | None = None, **_params: _ParamsType, ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/email/mime/base.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/email/mime/base.pyi index c8f2fe6db..b733709f1 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/email/mime/base.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/email/mime/base.pyi @@ -5,4 +5,4 @@ from email.policy import Policy __all__ = ["MIMEBase"] class MIMEBase(email.message.Message): - def __init__(self, _maintype: str, _subtype: str, *, policy: Policy | None = ..., **_params: _ParamsType) -> None: ... + def __init__(self, _maintype: str, _subtype: str, *, policy: Policy | None = None, **_params: _ParamsType) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/email/mime/image.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/email/mime/image.pyi index f575103de..b47afa6ce 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/email/mime/image.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/email/mime/image.pyi @@ -8,10 +8,10 @@ __all__ = ["MIMEImage"] class MIMEImage(MIMENonMultipart): def __init__( self, - _imagedata: str | bytes, - _subtype: str | None = ..., + _imagedata: str | bytes | bytearray, + _subtype: str | None = None, _encoder: Callable[[MIMEImage], object] = ..., *, - policy: Policy | None = ..., + policy: Policy | None = None, **_params: _ParamsType, ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/email/mime/message.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/email/mime/message.pyi index 9e7cd04b6..23cf58619 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/email/mime/message.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/email/mime/message.pyi @@ -5,4 +5,4 @@ from email.policy import Policy __all__ = ["MIMEMessage"] class MIMEMessage(MIMENonMultipart): - def __init__(self, _msg: Message, _subtype: str = ..., *, policy: Policy | None = ...) -> None: ... + def __init__(self, _msg: Message, _subtype: str = "rfc822", *, policy: Policy | None = None) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/email/mime/multipart.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/email/mime/multipart.pyi index 6cd480ccf..6163810ed 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/email/mime/multipart.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/email/mime/multipart.pyi @@ -9,10 +9,10 @@ __all__ = ["MIMEMultipart"] class MIMEMultipart(MIMEBase): def __init__( self, - _subtype: str = ..., - boundary: str | None = ..., - _subparts: Sequence[Message] | None = ..., + _subtype: str = "mixed", + boundary: str | None = None, + _subparts: Sequence[Message] | None = None, *, - policy: Policy | None = ..., + policy: Policy | None = None, **_params: _ParamsType, ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/email/mime/text.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/email/mime/text.pyi index 9672c3b71..74d5ef4c5 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/email/mime/text.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/email/mime/text.pyi @@ -4,4 +4,6 @@ from email.policy import Policy __all__ = ["MIMEText"] class MIMEText(MIMENonMultipart): - def __init__(self, _text: str, _subtype: str = ..., _charset: str | None = ..., *, policy: Policy | None = ...) -> None: ... + def __init__( + self, _text: str, _subtype: str = "plain", _charset: str | None = None, *, policy: Policy | None = None + ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/email/parser.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/email/parser.pyi index dcd346c1b..28b6aca85 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/email/parser.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/email/parser.pyi @@ -1,27 +1,26 @@ +from _typeshed import SupportsRead from collections.abc import Callable from email.feedparser import BytesFeedParser as BytesFeedParser, FeedParser as FeedParser from email.message import Message from email.policy import Policy -from typing import BinaryIO, TextIO +from typing import IO __all__ = ["Parser", "HeaderParser", "BytesParser", "BytesHeaderParser", "FeedParser", "BytesFeedParser"] class Parser: - def __init__(self, _class: Callable[[], Message] | None = ..., *, policy: Policy = ...) -> None: ... - def parse(self, fp: TextIO, headersonly: bool = ...) -> Message: ... - def parsestr(self, text: str, headersonly: bool = ...) -> Message: ... + def __init__(self, _class: Callable[[], Message] | None = None, *, policy: Policy = ...) -> None: ... + def parse(self, fp: SupportsRead[str], headersonly: bool = False) -> Message: ... + def parsestr(self, text: str, headersonly: bool = False) -> Message: ... class HeaderParser(Parser): - def __init__(self, _class: Callable[[], Message] | None = ..., *, policy: Policy = ...) -> None: ... - def parse(self, fp: TextIO, headersonly: bool = ...) -> Message: ... - def parsestr(self, text: str, headersonly: bool = ...) -> Message: ... - -class BytesHeaderParser(BytesParser): - def __init__(self, _class: Callable[[], Message] = ..., *, policy: Policy = ...) -> None: ... - def parse(self, fp: BinaryIO, headersonly: bool = ...) -> Message: ... - def parsebytes(self, text: bytes, headersonly: bool = ...) -> Message: ... + def parse(self, fp: SupportsRead[str], headersonly: bool = True) -> Message: ... + def parsestr(self, text: str, headersonly: bool = True) -> Message: ... class BytesParser: def __init__(self, _class: Callable[[], Message] = ..., *, policy: Policy = ...) -> None: ... - def parse(self, fp: BinaryIO, headersonly: bool = ...) -> Message: ... - def parsebytes(self, text: bytes, headersonly: bool = ...) -> Message: ... + def parse(self, fp: IO[bytes], headersonly: bool = False) -> Message: ... + def parsebytes(self, text: bytes | bytearray, headersonly: bool = False) -> Message: ... + +class BytesHeaderParser(BytesParser): + def parse(self, fp: IO[bytes], headersonly: bool = True) -> Message: ... + def parsebytes(self, text: bytes | bytearray, headersonly: bool = True) -> Message: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/email/quoprimime.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/email/quoprimime.pyi index c5d324d17..87d08eecc 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/email/quoprimime.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/email/quoprimime.pyi @@ -1,3 +1,5 @@ +from collections.abc import Iterable + __all__ = [ "body_decode", "body_encode", @@ -13,13 +15,13 @@ __all__ = [ def header_check(octet: int) -> bool: ... def body_check(octet: int) -> bool: ... -def header_length(bytearray: bytes) -> int: ... -def body_length(bytearray: bytes) -> int: ... -def unquote(s: str | bytes) -> str: ... -def quote(c: str | bytes) -> str: ... -def header_encode(header_bytes: bytes, charset: str = ...) -> str: ... -def body_encode(body: str, maxlinelen: int = ..., eol: str = ...) -> str: ... -def decode(encoded: str, eol: str = ...) -> str: ... +def header_length(bytearray: Iterable[int]) -> int: ... +def body_length(bytearray: Iterable[int]) -> int: ... +def unquote(s: str | bytes | bytearray) -> str: ... +def quote(c: str | bytes | bytearray) -> str: ... +def header_encode(header_bytes: bytes | bytearray, charset: str = "iso-8859-1") -> str: ... +def body_encode(body: str, maxlinelen: int = 76, eol: str = "\n") -> str: ... +def decode(encoded: str, eol: str = "\n") -> str: ... def header_decode(s: str) -> str: ... body_decode = decode diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/email/utils.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/email/utils.pyi index 480c5f795..090ddf9e3 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/email/utils.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/email/utils.pyi @@ -28,7 +28,7 @@ _PDTZ: TypeAlias = tuple[int, int, int, int, int, int, int, int, int, int | None def quote(str: str) -> str: ... def unquote(str: str) -> str: ... def parseaddr(addr: str | None) -> tuple[str, str]: ... -def formataddr(pair: tuple[str | None, str], charset: str | Charset = ...) -> str: ... +def formataddr(pair: tuple[str | None, str], charset: str | Charset = "utf-8") -> str: ... def getaddresses(fieldvalues: list[str]) -> list[tuple[str, str]]: ... @overload def parsedate(data: None) -> None: ... @@ -49,11 +49,11 @@ else: def parsedate_to_datetime(data: str) -> datetime.datetime: ... def mktime_tz(data: _PDTZ) -> int: ... -def formatdate(timeval: float | None = ..., localtime: bool = ..., usegmt: bool = ...) -> str: ... -def format_datetime(dt: datetime.datetime, usegmt: bool = ...) -> str: ... -def localtime(dt: datetime.datetime | None = ..., isdst: int = ...) -> datetime.datetime: ... -def make_msgid(idstring: str | None = ..., domain: str | None = ...) -> str: ... +def formatdate(timeval: float | None = None, localtime: bool = False, usegmt: bool = False) -> str: ... +def format_datetime(dt: datetime.datetime, usegmt: bool = False) -> str: ... +def localtime(dt: datetime.datetime | None = None, isdst: int = -1) -> datetime.datetime: ... +def make_msgid(idstring: str | None = None, domain: str | None = None) -> str: ... def decode_rfc2231(s: str) -> tuple[str | None, str | None, str]: ... -def encode_rfc2231(s: str, charset: str | None = ..., language: str | None = ...) -> str: ... -def collapse_rfc2231_value(value: _ParamType, errors: str = ..., fallback_charset: str = ...) -> str: ... +def encode_rfc2231(s: str, charset: str | None = None, language: str | None = None) -> str: ... +def collapse_rfc2231_value(value: _ParamType, errors: str = "replace", fallback_charset: str = "us-ascii") -> str: ... def decode_params(params: list[tuple[str, str]]) -> list[tuple[str, _ParamType]]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/encodings/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/encodings/__init__.pyi index d86466762..2e83f0f65 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/encodings/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/encodings/__init__.pyi @@ -1,5 +1,5 @@ +from _typeshed import Incomplete from codecs import CodecInfo -from typing import Any class CodecRegistryError(LookupError, SystemError): ... @@ -7,4 +7,4 @@ def normalize_encoding(encoding: str | bytes) -> str: ... def search_function(encoding: str) -> CodecInfo | None: ... # Needed for submodules -def __getattr__(name: str) -> Any: ... # incomplete +def __getattr__(name: str) -> Incomplete: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/encodings/utf_8.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/encodings/utf_8.pyi index 568fa6013..0de51026f 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/encodings/utf_8.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/encodings/utf_8.pyi @@ -1,20 +1,21 @@ import codecs +from _typeshed import ReadableBuffer class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = ...) -> bytes: ... + def encode(self, input: str, final: bool = False) -> bytes: ... class IncrementalDecoder(codecs.BufferedIncrementalDecoder): @staticmethod - def _buffer_decode(__data: bytes, __errors: str | None = ..., __final: bool = ...) -> tuple[str, int]: ... + def _buffer_decode(__data: ReadableBuffer, __errors: str | None = None, __final: bool = False) -> tuple[str, int]: ... class StreamWriter(codecs.StreamWriter): @staticmethod - def encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ... + def encode(__str: str, __errors: str | None = None) -> tuple[bytes, int]: ... class StreamReader(codecs.StreamReader): @staticmethod - def decode(__data: bytes, __errors: str | None = ..., __final: bool = ...) -> tuple[str, int]: ... + def decode(__data: ReadableBuffer, __errors: str | None = None, __final: bool = False) -> tuple[str, int]: ... def getregentry() -> codecs.CodecInfo: ... -def encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ... -def decode(input: bytes, errors: str | None = ...) -> tuple[str, int]: ... +def encode(__str: str, __errors: str | None = None) -> tuple[bytes, int]: ... +def decode(input: ReadableBuffer, errors: str | None = "strict") -> tuple[str, int]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/encodings/utf_8_sig.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/encodings/utf_8_sig.pyi index bf52e8a6f..af69217d6 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/encodings/utf_8_sig.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/encodings/utf_8_sig.pyi @@ -1,27 +1,22 @@ import codecs +from _typeshed import ReadableBuffer class IncrementalEncoder(codecs.IncrementalEncoder): - def __init__(self, errors: str = ...) -> None: ... - def encode(self, input: str, final: bool = ...) -> bytes: ... - def reset(self) -> None: ... - def getstate(self) -> int: ... # type: ignore[override] + def __init__(self, errors: str = "strict") -> None: ... + def encode(self, input: str, final: bool = False) -> bytes: ... + def getstate(self) -> int: ... def setstate(self, state: int) -> None: ... # type: ignore[override] class IncrementalDecoder(codecs.BufferedIncrementalDecoder): - def __init__(self, errors: str = ...) -> None: ... - def _buffer_decode(self, input: bytes, errors: str | None, final: bool) -> tuple[str, int]: ... - def reset(self) -> None: ... - def getstate(self) -> tuple[bytes, int]: ... - def setstate(self, state: tuple[bytes, int]) -> None: ... + def __init__(self, errors: str = "strict") -> None: ... + def _buffer_decode(self, input: ReadableBuffer, errors: str | None, final: bool) -> tuple[str, int]: ... class StreamWriter(codecs.StreamWriter): - def reset(self) -> None: ... - def encode(self, input: str, errors: str | None = ...) -> tuple[bytes, int]: ... + def encode(self, input: str, errors: str | None = "strict") -> tuple[bytes, int]: ... class StreamReader(codecs.StreamReader): - def reset(self) -> None: ... - def decode(self, input: bytes, errors: str | None = ...) -> tuple[str, int]: ... + def decode(self, input: ReadableBuffer, errors: str | None = "strict") -> tuple[str, int]: ... def getregentry() -> codecs.CodecInfo: ... -def encode(input: str, errors: str | None = ...) -> tuple[bytes, int]: ... -def decode(input: bytes, errors: str | None = ...) -> tuple[str, int]: ... +def encode(input: str, errors: str | None = "strict") -> tuple[bytes, int]: ... +def decode(input: ReadableBuffer, errors: str | None = "strict") -> tuple[str, int]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/ensurepip/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/ensurepip/__init__.pyi index e2686b8d5..332fb1845 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/ensurepip/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/ensurepip/__init__.pyi @@ -3,10 +3,10 @@ __all__ = ["version", "bootstrap"] def version() -> str: ... def bootstrap( *, - root: str | None = ..., - upgrade: bool = ..., - user: bool = ..., - altinstall: bool = ..., - default_pip: bool = ..., - verbosity: int = ..., + root: str | None = None, + upgrade: bool = False, + user: bool = False, + altinstall: bool = False, + default_pip: bool = False, + verbosity: int = 0, ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/enum.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/enum.pyi index a14744f1b..5a39c456b 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/enum.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/enum.pyi @@ -1,11 +1,12 @@ +import _typeshed import sys import types -from _typeshed import Self, SupportsKeysAndGetItem +from _typeshed import SupportsKeysAndGetItem, Unused from abc import ABCMeta from builtins import property as _builtins_property from collections.abc import Iterable, Iterator, Mapping from typing import Any, Generic, TypeVar, overload -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal, Self, TypeAlias __all__ = ["EnumMeta", "Enum", "IntEnum", "Flag", "IntFlag", "auto", "unique"] @@ -80,19 +81,21 @@ class _EnumDict(dict[str, Any]): class EnumMeta(ABCMeta): if sys.version_info >= (3, 11): def __new__( - metacls: type[Self], + metacls: type[_typeshed.Self], cls: str, bases: tuple[type, ...], classdict: _EnumDict, *, - boundary: FlagBoundary | None = ..., - _simple: bool = ..., + boundary: FlagBoundary | None = None, + _simple: bool = False, **kwds: Any, - ) -> Self: ... + ) -> _typeshed.Self: ... elif sys.version_info >= (3, 9): - def __new__(metacls: type[Self], cls: str, bases: tuple[type, ...], classdict: _EnumDict, **kwds: Any) -> Self: ... + def __new__( + metacls: type[_typeshed.Self], cls: str, bases: tuple[type, ...], classdict: _EnumDict, **kwds: Any + ) -> _typeshed.Self: ... else: - def __new__(metacls: type[Self], cls: str, bases: tuple[type, ...], classdict: _EnumDict) -> Self: ... + def __new__(metacls: type[_typeshed.Self], cls: str, bases: tuple[type, ...], classdict: _EnumDict) -> _typeshed.Self: ... if sys.version_info >= (3, 9): @classmethod @@ -103,7 +106,15 @@ class EnumMeta(ABCMeta): def __iter__(self: type[_EnumMemberT]) -> Iterator[_EnumMemberT]: ... def __reversed__(self: type[_EnumMemberT]) -> Iterator[_EnumMemberT]: ... - def __contains__(self: type[Any], obj: object) -> bool: ... + if sys.version_info >= (3, 12): + def __contains__(self: type[Any], value: object) -> bool: ... + elif sys.version_info >= (3, 11): + def __contains__(self: type[Any], member: object) -> bool: ... + elif sys.version_info >= (3, 10): + def __contains__(self: type[Any], obj: object) -> bool: ... + else: + def __contains__(self: type[Any], member: object) -> bool: ... + def __getitem__(self: type[_EnumMemberT], name: str) -> _EnumMemberT: ... @_builtins_property def __members__(self: type[_EnumMemberT]) -> types.MappingProxyType[str, _EnumMemberT]: ... @@ -111,8 +122,8 @@ class EnumMeta(ABCMeta): def __bool__(self) -> Literal[True]: ... def __dir__(self) -> list[str]: ... # Simple value lookup - @overload # type: ignore[override] - def __call__(cls: type[_EnumMemberT], value: Any, names: None = ...) -> _EnumMemberT: ... + @overload + def __call__(cls: type[_EnumMemberT], value: Any, names: None = None) -> _EnumMemberT: ... # Functional Enum API if sys.version_info >= (3, 11): @overload @@ -121,11 +132,11 @@ class EnumMeta(ABCMeta): value: str, names: _EnumNames, *, - module: str | None = ..., - qualname: str | None = ..., - type: type | None = ..., - start: int = ..., - boundary: FlagBoundary | None = ..., + module: str | None = None, + qualname: str | None = None, + type: type | None = None, + start: int = 1, + boundary: FlagBoundary | None = None, ) -> type[Enum]: ... else: @overload @@ -134,10 +145,10 @@ class EnumMeta(ABCMeta): value: str, names: _EnumNames, *, - module: str | None = ..., - qualname: str | None = ..., - type: type | None = ..., - start: int = ..., + module: str | None = None, + qualname: str | None = None, + type: type | None = None, + start: int = 1, ) -> type[Enum]: ... _member_names_: list[str] # undocumented _member_map_: dict[str, Enum] # undocumented @@ -174,10 +185,10 @@ class Enum(metaclass=EnumMeta): # However, using `Any` causes too many false-positives for those using mypy's `--disallow-any-expr` # (see #7752, #2539, mypy/#5788), # and in practice using `object` here has the same effect as using `Any`. - def __new__(cls: type[Self], value: object) -> Self: ... + def __new__(cls, value: object) -> Self: ... def __dir__(self) -> list[str]: ... def __format__(self, format_spec: str) -> str: ... - def __reduce_ex__(self, proto: object) -> tuple[Any, ...]: ... + def __reduce_ex__(self, proto: Unused) -> tuple[Any, ...]: ... if sys.version_info >= (3, 11): class ReprEnum(Enum): ... @@ -191,7 +202,7 @@ class IntEnum(int, _IntEnumBase): _value_: int @_magic_enum_attr def value(self) -> int: ... - def __new__(cls: type[Self], value: int) -> Self: ... + def __new__(cls, value: int) -> Self: ... def unique(enumeration: _EnumerationT) -> _EnumerationT: ... @@ -202,7 +213,7 @@ class auto(IntFlag): _value_: Any @_magic_enum_attr def value(self) -> Any: ... - def __new__(cls: type[Self]) -> Self: ... + def __new__(cls) -> Self: ... class Flag(Enum): _name_: str | None # type: ignore[assignment] @@ -211,14 +222,14 @@ class Flag(Enum): def name(self) -> str | None: ... # type: ignore[override] @_magic_enum_attr def value(self) -> int: ... - def __contains__(self: Self, other: Self) -> bool: ... + def __contains__(self, other: Self) -> bool: ... def __bool__(self) -> bool: ... - def __or__(self: Self, other: Self) -> Self: ... - def __and__(self: Self, other: Self) -> Self: ... - def __xor__(self: Self, other: Self) -> Self: ... - def __invert__(self: Self) -> Self: ... + def __or__(self, other: Self) -> Self: ... + def __and__(self, other: Self) -> Self: ... + def __xor__(self, other: Self) -> Self: ... + def __invert__(self) -> Self: ... if sys.version_info >= (3, 11): - def __iter__(self: Self) -> Iterator[Self]: ... + def __iter__(self) -> Iterator[Self]: ... def __len__(self) -> int: ... __ror__ = __or__ __rand__ = __and__ @@ -226,28 +237,28 @@ class Flag(Enum): if sys.version_info >= (3, 11): # The body of the class is the same, but the base classes are different. - class IntFlag(int, ReprEnum, Flag, boundary=KEEP): - def __new__(cls: type[Self], value: int) -> Self: ... - def __or__(self: Self, other: int) -> Self: ... - def __and__(self: Self, other: int) -> Self: ... - def __xor__(self: Self, other: int) -> Self: ... + class IntFlag(int, ReprEnum, Flag, boundary=KEEP): # type: ignore[misc] # complaints about incompatible bases + def __new__(cls, value: int) -> Self: ... + def __or__(self, other: int) -> Self: ... + def __and__(self, other: int) -> Self: ... + def __xor__(self, other: int) -> Self: ... __ror__ = __or__ __rand__ = __and__ __rxor__ = __xor__ else: - class IntFlag(int, Flag): - def __new__(cls: type[Self], value: int) -> Self: ... - def __or__(self: Self, other: int) -> Self: ... - def __and__(self: Self, other: int) -> Self: ... - def __xor__(self: Self, other: int) -> Self: ... + class IntFlag(int, Flag): # type: ignore[misc] # complaints about incompatible bases + def __new__(cls, value: int) -> Self: ... + def __or__(self, other: int) -> Self: ... + def __and__(self, other: int) -> Self: ... + def __xor__(self, other: int) -> Self: ... __ror__ = __or__ __rand__ = __and__ __rxor__ = __xor__ if sys.version_info >= (3, 11): class StrEnum(str, ReprEnum): - def __new__(cls: type[Self], value: str) -> Self: ... + def __new__(cls, value: str) -> Self: ... _value_: str @_magic_enum_attr def value(self) -> str: ... @@ -275,6 +286,6 @@ if sys.version_info >= (3, 11): KEEP = FlagBoundary.KEEP def global_str(self: Enum) -> str: ... - def global_enum(cls: _EnumerationT, update_str: bool = ...) -> _EnumerationT: ... + def global_enum(cls: _EnumerationT, update_str: bool = False) -> _EnumerationT: ... def global_enum_repr(self: Enum) -> str: ... def global_flag_repr(self: Flag) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/fcntl.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/fcntl.pyi index 69863bf58..90676e365 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/fcntl.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/fcntl.pyi @@ -101,16 +101,16 @@ if sys.platform != "win32": I_SWROPT: int I_UNLINK: int @overload - def fcntl(__fd: FileDescriptorLike, __cmd: int, __arg: int = ...) -> int: ... + def fcntl(__fd: FileDescriptorLike, __cmd: int, __arg: int = 0) -> int: ... @overload - def fcntl(__fd: FileDescriptorLike, __cmd: int, __arg: bytes) -> bytes: ... + def fcntl(__fd: FileDescriptorLike, __cmd: int, __arg: str | ReadOnlyBuffer) -> bytes: ... @overload - def ioctl(__fd: FileDescriptorLike, __request: int, __arg: int = ..., __mutate_flag: bool = ...) -> int: ... + def ioctl(__fd: FileDescriptorLike, __request: int, __arg: int = 0, __mutate_flag: bool = True) -> int: ... @overload - def ioctl(__fd: FileDescriptorLike, __request: int, __arg: WriteableBuffer, __mutate_flag: Literal[True] = ...) -> int: ... + def ioctl(__fd: FileDescriptorLike, __request: int, __arg: WriteableBuffer, __mutate_flag: Literal[True] = True) -> int: ... @overload def ioctl(__fd: FileDescriptorLike, __request: int, __arg: WriteableBuffer, __mutate_flag: Literal[False]) -> bytes: ... @overload - def ioctl(__fd: FileDescriptorLike, __request: int, __arg: ReadOnlyBuffer, __mutate_flag: bool = ...) -> bytes: ... + def ioctl(__fd: FileDescriptorLike, __request: int, __arg: ReadOnlyBuffer, __mutate_flag: bool = True) -> bytes: ... def flock(__fd: FileDescriptorLike, __operation: int) -> None: ... - def lockf(__fd: FileDescriptorLike, __cmd: int, __len: int = ..., __start: int = ..., __whence: int = ...) -> Any: ... + def lockf(__fd: FileDescriptorLike, __cmd: int, __len: int = 0, __start: int = 0, __whence: int = 0) -> Any: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/filecmp.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/filecmp.pyi index dd4a0628b..008d7a44e 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/filecmp.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/filecmp.pyi @@ -12,9 +12,9 @@ __all__ = ["clear_cache", "cmp", "dircmp", "cmpfiles", "DEFAULT_IGNORES"] DEFAULT_IGNORES: list[str] BUFSIZE: Literal[8192] -def cmp(f1: StrOrBytesPath, f2: StrOrBytesPath, shallow: bool | Literal[0, 1] = ...) -> bool: ... +def cmp(f1: StrOrBytesPath, f2: StrOrBytesPath, shallow: bool | Literal[0, 1] = True) -> bool: ... def cmpfiles( - a: GenericPath[AnyStr], b: GenericPath[AnyStr], common: Iterable[GenericPath[AnyStr]], shallow: bool | Literal[0, 1] = ... + a: GenericPath[AnyStr], b: GenericPath[AnyStr], common: Iterable[GenericPath[AnyStr]], shallow: bool | Literal[0, 1] = True ) -> tuple[list[AnyStr], list[AnyStr], list[AnyStr]]: ... class dircmp(Generic[AnyStr]): @@ -22,8 +22,8 @@ class dircmp(Generic[AnyStr]): self, a: GenericPath[AnyStr], b: GenericPath[AnyStr], - ignore: Sequence[AnyStr] | None = ..., - hide: Sequence[AnyStr] | None = ..., + ignore: Sequence[AnyStr] | None = None, + hide: Sequence[AnyStr] | None = None, ) -> None: ... left: AnyStr right: AnyStr diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/fileinput.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/fileinput.pyi index e0babbcd4..e9f3713b4 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/fileinput.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/fileinput.pyi @@ -1,9 +1,9 @@ import sys -from _typeshed import AnyStr_co, Self, StrOrBytesPath +from _typeshed import AnyStr_co, StrOrBytesPath from collections.abc import Callable, Iterable, Iterator from types import TracebackType from typing import IO, Any, AnyStr, Generic, Protocol, overload -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal, Self, TypeAlias if sys.version_info >= (3, 9): from types import GenericAlias @@ -36,89 +36,89 @@ if sys.version_info >= (3, 10): # encoding and errors are added @overload def input( - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ..., - inplace: bool = ..., - backup: str = ..., + files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, + inplace: bool = False, + backup: str = "", *, - mode: _TextMode = ..., - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[str]] | None = ..., - encoding: str | None = ..., - errors: str | None = ..., + mode: _TextMode = "r", + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[str]] | None = None, + encoding: str | None = None, + errors: str | None = None, ) -> FileInput[str]: ... @overload def input( - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ..., - inplace: bool = ..., - backup: str = ..., + files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, + inplace: bool = False, + backup: str = "", *, mode: Literal["rb"], - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[bytes]] | None = ..., - encoding: None = ..., - errors: None = ..., + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[bytes]] | None = None, + encoding: None = None, + errors: None = None, ) -> FileInput[bytes]: ... @overload def input( - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ..., - inplace: bool = ..., - backup: str = ..., + files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, + inplace: bool = False, + backup: str = "", *, mode: str, - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[Any]] | None = ..., - encoding: str | None = ..., - errors: str | None = ..., + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[Any]] | None = None, + encoding: str | None = None, + errors: str | None = None, ) -> FileInput[Any]: ... elif sys.version_info >= (3, 8): # bufsize is dropped and mode and openhook become keyword-only @overload def input( - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ..., - inplace: bool = ..., - backup: str = ..., + files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, + inplace: bool = False, + backup: str = "", *, - mode: _TextMode = ..., - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[str]] | None = ..., + mode: _TextMode = "r", + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[str]] | None = None, ) -> FileInput[str]: ... @overload def input( - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ..., - inplace: bool = ..., - backup: str = ..., + files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, + inplace: bool = False, + backup: str = "", *, mode: Literal["rb"], - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[bytes]] | None = ..., + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[bytes]] | None = None, ) -> FileInput[bytes]: ... @overload def input( - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ..., - inplace: bool = ..., - backup: str = ..., + files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, + inplace: bool = False, + backup: str = "", *, mode: str, - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[Any]] | None = ..., + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[Any]] | None = None, ) -> FileInput[Any]: ... else: @overload def input( - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ..., - inplace: bool = ..., - backup: str = ..., - bufsize: int = ..., - mode: _TextMode = ..., - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[str]] | None = ..., + files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, + inplace: bool = False, + backup: str = "", + bufsize: int = 0, + mode: _TextMode = "r", + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[str]] | None = None, ) -> FileInput[str]: ... # Because mode isn't keyword-only here yet, we need two overloads each for # the bytes case and the fallback case. @overload def input( - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ..., - inplace: bool = ..., - backup: str = ..., - bufsize: int = ..., + files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, + inplace: bool = False, + backup: str = "", + bufsize: int = 0, *, mode: Literal["rb"], - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[bytes]] | None = ..., + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[bytes]] | None = None, ) -> FileInput[bytes]: ... @overload def input( @@ -127,17 +127,17 @@ else: backup: str, bufsize: int, mode: Literal["rb"], - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[bytes]] | None = ..., + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[bytes]] | None = None, ) -> FileInput[bytes]: ... @overload def input( - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ..., - inplace: bool = ..., - backup: str = ..., - bufsize: int = ..., + files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, + inplace: bool = False, + backup: str = "", + bufsize: int = 0, *, mode: str, - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[Any]] | None = ..., + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[Any]] | None = None, ) -> FileInput[Any]: ... @overload def input( @@ -146,7 +146,7 @@ else: backup: str, bufsize: int, mode: str, - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[Any]] | None = ..., + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[Any]] | None = None, ) -> FileInput[Any]: ... def close() -> None: ... @@ -164,38 +164,38 @@ class FileInput(Iterator[AnyStr], Generic[AnyStr]): @overload def __init__( self: FileInput[str], - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ..., - inplace: bool = ..., - backup: str = ..., + files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, + inplace: bool = False, + backup: str = "", *, - mode: _TextMode = ..., - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[str]] | None = ..., - encoding: str | None = ..., - errors: str | None = ..., + mode: _TextMode = "r", + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[str]] | None = None, + encoding: str | None = None, + errors: str | None = None, ) -> None: ... @overload def __init__( self: FileInput[bytes], - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ..., - inplace: bool = ..., - backup: str = ..., + files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, + inplace: bool = False, + backup: str = "", *, mode: Literal["rb"], - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[bytes]] | None = ..., - encoding: None = ..., - errors: None = ..., + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[bytes]] | None = None, + encoding: None = None, + errors: None = None, ) -> None: ... @overload def __init__( self: FileInput[Any], - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ..., - inplace: bool = ..., - backup: str = ..., + files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, + inplace: bool = False, + backup: str = "", *, mode: str, - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[Any]] | None = ..., - encoding: str | None = ..., - errors: str | None = ..., + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[Any]] | None = None, + encoding: str | None = None, + errors: str | None = None, ) -> None: ... elif sys.version_info >= (3, 8): @@ -203,57 +203,57 @@ class FileInput(Iterator[AnyStr], Generic[AnyStr]): @overload def __init__( self: FileInput[str], - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ..., - inplace: bool = ..., - backup: str = ..., + files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, + inplace: bool = False, + backup: str = "", *, - mode: _TextMode = ..., - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[str]] | None = ..., + mode: _TextMode = "r", + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[str]] | None = None, ) -> None: ... @overload def __init__( self: FileInput[bytes], - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ..., - inplace: bool = ..., - backup: str = ..., + files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, + inplace: bool = False, + backup: str = "", *, mode: Literal["rb"], - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[bytes]] | None = ..., + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[bytes]] | None = None, ) -> None: ... @overload def __init__( self: FileInput[Any], - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ..., - inplace: bool = ..., - backup: str = ..., + files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, + inplace: bool = False, + backup: str = "", *, mode: str, - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[Any]] | None = ..., + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[Any]] | None = None, ) -> None: ... else: @overload def __init__( self: FileInput[str], - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ..., - inplace: bool = ..., - backup: str = ..., - bufsize: int = ..., - mode: _TextMode = ..., - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[str]] | None = ..., + files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, + inplace: bool = False, + backup: str = "", + bufsize: int = 0, + mode: _TextMode = "r", + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[str]] | None = None, ) -> None: ... # Because mode isn't keyword-only here yet, we need two overloads each for # the bytes case and the fallback case. @overload def __init__( self: FileInput[bytes], - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ..., - inplace: bool = ..., - backup: str = ..., - bufsize: int = ..., + files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, + inplace: bool = False, + backup: str = "", + bufsize: int = 0, *, mode: Literal["rb"], - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[bytes]] | None = ..., + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[bytes]] | None = None, ) -> None: ... @overload def __init__( @@ -263,18 +263,18 @@ class FileInput(Iterator[AnyStr], Generic[AnyStr]): backup: str, bufsize: int, mode: Literal["rb"], - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[bytes]] | None = ..., + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[bytes]] | None = None, ) -> None: ... @overload def __init__( self: FileInput[Any], - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ..., - inplace: bool = ..., - backup: str = ..., - bufsize: int = ..., + files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, + inplace: bool = False, + backup: str = "", + bufsize: int = 0, *, mode: str, - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[Any]] | None = ..., + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[Any]] | None = None, ) -> None: ... @overload def __init__( @@ -284,16 +284,16 @@ class FileInput(Iterator[AnyStr], Generic[AnyStr]): backup: str, bufsize: int, mode: str, - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[Any]] | None = ..., + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[Any]] | None = None, ) -> None: ... def __del__(self) -> None: ... def close(self) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, type: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None ) -> None: ... - def __iter__(self: Self) -> Self: ... + def __iter__(self) -> Self: ... def __next__(self) -> AnyStr: ... if sys.version_info < (3, 11): def __getitem__(self, i: int) -> AnyStr: ... @@ -311,10 +311,10 @@ class FileInput(Iterator[AnyStr], Generic[AnyStr]): if sys.version_info >= (3, 10): def hook_compressed( - filename: StrOrBytesPath, mode: str, *, encoding: str | None = ..., errors: str | None = ... + filename: StrOrBytesPath, mode: str, *, encoding: str | None = None, errors: str | None = None ) -> IO[Any]: ... else: def hook_compressed(filename: StrOrBytesPath, mode: str) -> IO[Any]: ... -def hook_encoded(encoding: str, errors: str | None = ...) -> Callable[[StrOrBytesPath, str], IO[Any]]: ... +def hook_encoded(encoding: str, errors: str | None = None) -> Callable[[StrOrBytesPath, str], IO[Any]]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/formatter.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/formatter.pyi index 0aac0a5f9..05c3c8b3d 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/formatter.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/formatter.pyi @@ -8,11 +8,11 @@ _StylesType: TypeAlias = tuple[Any, ...] class NullFormatter: writer: NullWriter | None - def __init__(self, writer: NullWriter | None = ...) -> None: ... + def __init__(self, writer: NullWriter | None = None) -> None: ... def end_paragraph(self, blankline: int) -> None: ... def add_line_break(self) -> None: ... def add_hor_rule(self, *args: Any, **kw: Any) -> None: ... - def add_label_data(self, format: str, counter: int, blankline: int | None = ...) -> None: ... + def add_label_data(self, format: str, counter: int, blankline: int | None = None) -> None: ... def add_flowing_data(self, data: str) -> None: ... def add_literal_data(self, data: str) -> None: ... def flush_softspace(self) -> None: ... @@ -24,8 +24,8 @@ class NullFormatter: def pop_margin(self) -> None: ... def set_spacing(self, spacing: str | None) -> None: ... def push_style(self, *styles: _StylesType) -> None: ... - def pop_style(self, n: int = ...) -> None: ... - def assert_line_data(self, flag: int = ...) -> None: ... + def pop_style(self, n: int = 1) -> None: ... + def assert_line_data(self, flag: int = 1) -> None: ... class AbstractFormatter: writer: NullWriter @@ -45,7 +45,7 @@ class AbstractFormatter: def end_paragraph(self, blankline: int) -> None: ... def add_line_break(self) -> None: ... def add_hor_rule(self, *args: Any, **kw: Any) -> None: ... - def add_label_data(self, format: str, counter: int, blankline: int | None = ...) -> None: ... + def add_label_data(self, format: str, counter: int, blankline: int | None = None) -> None: ... def format_counter(self, format: Iterable[str], counter: int) -> str: ... def format_letter(self, case: str, counter: int) -> str: ... def format_roman(self, case: str, counter: int) -> str: ... @@ -60,11 +60,10 @@ class AbstractFormatter: def pop_margin(self) -> None: ... def set_spacing(self, spacing: str | None) -> None: ... def push_style(self, *styles: _StylesType) -> None: ... - def pop_style(self, n: int = ...) -> None: ... - def assert_line_data(self, flag: int = ...) -> None: ... + def pop_style(self, n: int = 1) -> None: ... + def assert_line_data(self, flag: int = 1) -> None: ... class NullWriter: - def __init__(self) -> None: ... def flush(self) -> None: ... def new_alignment(self, align: str | None) -> None: ... def new_font(self, font: _FontType) -> None: ... @@ -78,28 +77,12 @@ class NullWriter: def send_flowing_data(self, data: str) -> None: ... def send_literal_data(self, data: str) -> None: ... -class AbstractWriter(NullWriter): - def new_alignment(self, align: str | None) -> None: ... - def new_font(self, font: _FontType) -> None: ... - def new_margin(self, margin: int, level: int) -> None: ... - def new_spacing(self, spacing: str | None) -> None: ... - def new_styles(self, styles: tuple[Any, ...]) -> None: ... - def send_paragraph(self, blankline: int) -> None: ... - def send_line_break(self) -> None: ... - def send_hor_rule(self, *args: Any, **kw: Any) -> None: ... - def send_label_data(self, data: str) -> None: ... - def send_flowing_data(self, data: str) -> None: ... - def send_literal_data(self, data: str) -> None: ... +class AbstractWriter(NullWriter): ... class DumbWriter(NullWriter): file: IO[str] maxcol: int - def __init__(self, file: IO[str] | None = ..., maxcol: int = ...) -> None: ... + def __init__(self, file: IO[str] | None = None, maxcol: int = 72) -> None: ... def reset(self) -> None: ... - def send_paragraph(self, blankline: int) -> None: ... - def send_line_break(self) -> None: ... - def send_hor_rule(self, *args: Any, **kw: Any) -> None: ... - def send_literal_data(self, data: str) -> None: ... - def send_flowing_data(self, data: str) -> None: ... -def test(file: str | None = ...) -> None: ... +def test(file: str | None = None) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/fractions.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/fractions.pyi index e05f59e3d..3c84978c1 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/fractions.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/fractions.pyi @@ -1,10 +1,9 @@ import sys -from _typeshed import Self from collections.abc import Callable from decimal import Decimal from numbers import Integral, Rational, Real from typing import Any, overload -from typing_extensions import Literal, SupportsIndex, TypeAlias +from typing_extensions import Literal, Self, SupportsIndex, TypeAlias _ComparableNum: TypeAlias = int | float | Decimal | Real @@ -24,15 +23,15 @@ else: class Fraction(Rational): @overload def __new__( - cls: type[Self], numerator: int | Rational = ..., denominator: int | Rational | None = ..., *, _normalize: bool = ... + cls, numerator: int | Rational = 0, denominator: int | Rational | None = None, *, _normalize: bool = True ) -> Self: ... @overload - def __new__(cls: type[Self], __value: float | Decimal | str, *, _normalize: bool = ...) -> Self: ... + def __new__(cls, __value: float | Decimal | str, *, _normalize: bool = True) -> Self: ... @classmethod - def from_float(cls: type[Self], f: float) -> Self: ... + def from_float(cls, f: float) -> Self: ... @classmethod - def from_decimal(cls: type[Self], dec: Decimal) -> Self: ... - def limit_denominator(self, max_denominator: int = ...) -> Fraction: ... + def from_decimal(cls, dec: Decimal) -> Self: ... + def limit_denominator(self, max_denominator: int = 1000000) -> Fraction: ... if sys.version_info >= (3, 8): def as_integer_ratio(self) -> tuple[int, int]: ... @@ -104,14 +103,25 @@ class Fraction(Rational): def __rmod__(b, a: int | Fraction) -> Fraction: ... @overload def __rmod__(b, a: float) -> float: ... - @overload - def __divmod__(a, b: int | Fraction) -> tuple[int, Fraction]: ... - @overload - def __divmod__(a, b: float) -> tuple[float, Fraction]: ... - @overload - def __rdivmod__(b, a: int | Fraction) -> tuple[int, Fraction]: ... - @overload - def __rdivmod__(b, a: float) -> tuple[float, Fraction]: ... + if sys.version_info >= (3, 8): + @overload + def __divmod__(a, b: int | Fraction) -> tuple[int, Fraction]: ... + @overload + def __divmod__(a, b: float) -> tuple[float, Fraction]: ... + @overload + def __rdivmod__(a, b: int | Fraction) -> tuple[int, Fraction]: ... + @overload + def __rdivmod__(a, b: float) -> tuple[float, Fraction]: ... + else: + @overload + def __divmod__(self, other: int | Fraction) -> tuple[int, Fraction]: ... + @overload + def __divmod__(self, other: float) -> tuple[float, Fraction]: ... + @overload + def __rdivmod__(self, other: int | Fraction) -> tuple[int, Fraction]: ... + @overload + def __rdivmod__(self, other: float) -> tuple[float, Fraction]: ... + @overload def __pow__(a, b: int) -> Fraction: ... @overload @@ -129,7 +139,7 @@ class Fraction(Rational): def __floor__(a) -> int: ... def __ceil__(a) -> int: ... @overload - def __round__(self, ndigits: None = ...) -> int: ... + def __round__(self, ndigits: None = None) -> int: ... @overload def __round__(self, ndigits: int) -> Fraction: ... def __hash__(self) -> int: ... @@ -139,8 +149,8 @@ class Fraction(Rational): def __le__(a, b: _ComparableNum) -> bool: ... def __ge__(a, b: _ComparableNum) -> bool: ... def __bool__(a) -> bool: ... - def __copy__(self: Self) -> Self: ... - def __deepcopy__(self: Self, memo: Any) -> Self: ... + def __copy__(self) -> Self: ... + def __deepcopy__(self, memo: Any) -> Self: ... if sys.version_info >= (3, 11): def __int__(a, _index: Callable[[SupportsIndex], int] = ...) -> int: ... # Not actually defined within fractions.py, but provides more useful diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/ftplib.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/ftplib.pyi index 3d284c597..76d9dc02a 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/ftplib.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/ftplib.pyi @@ -1,11 +1,11 @@ import sys -from _typeshed import Self, SupportsRead, SupportsReadline +from _typeshed import SupportsRead, SupportsReadline from collections.abc import Callable, Iterable, Iterator from socket import socket from ssl import SSLContext from types import TracebackType from typing import Any, TextIO -from typing_extensions import Literal +from typing_extensions import Literal, Self __all__ = ["FTP", "error_reply", "error_temp", "error_perm", "error_proto", "all_errors", "FTP_TLS"] @@ -36,7 +36,7 @@ class FTP: lastresp: str file: TextIO | None encoding: str - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None ) -> None: ... @@ -44,28 +44,28 @@ class FTP: if sys.version_info >= (3, 9): def __init__( self, - host: str = ..., - user: str = ..., - passwd: str = ..., - acct: str = ..., + host: str = "", + user: str = "", + passwd: str = "", + acct: str = "", timeout: float = ..., - source_address: tuple[str, int] | None = ..., + source_address: tuple[str, int] | None = None, *, - encoding: str = ..., + encoding: str = "utf-8", ) -> None: ... else: def __init__( self, - host: str = ..., - user: str = ..., - passwd: str = ..., - acct: str = ..., + host: str = "", + user: str = "", + passwd: str = "", + acct: str = "", timeout: float = ..., - source_address: tuple[str, int] | None = ..., + source_address: tuple[str, int] | None = None, ) -> None: ... def connect( - self, host: str = ..., port: int = ..., timeout: float = ..., source_address: tuple[str, int] | None = ... + self, host: str = "", port: int = 0, timeout: float = -999, source_address: tuple[str, int] | None = None ) -> str: ... def getwelcome(self) -> str: ... def set_debuglevel(self, level: int) -> None: ... @@ -85,28 +85,28 @@ class FTP: def sendeprt(self, host: str, port: int) -> str: ... def makeport(self) -> socket: ... def makepasv(self) -> tuple[str, int]: ... - def login(self, user: str = ..., passwd: str = ..., acct: str = ...) -> str: ... + def login(self, user: str = "", passwd: str = "", acct: str = "") -> str: ... # In practice, `rest` rest can actually be anything whose str() is an integer sequence, so to make it simple we allow integers. - def ntransfercmd(self, cmd: str, rest: int | str | None = ...) -> tuple[socket, int]: ... - def transfercmd(self, cmd: str, rest: int | str | None = ...) -> socket: ... + def ntransfercmd(self, cmd: str, rest: int | str | None = None) -> tuple[socket, int]: ... + def transfercmd(self, cmd: str, rest: int | str | None = None) -> socket: ... def retrbinary( - self, cmd: str, callback: Callable[[bytes], object], blocksize: int = ..., rest: int | str | None = ... + self, cmd: str, callback: Callable[[bytes], object], blocksize: int = 8192, rest: int | str | None = None ) -> str: ... def storbinary( self, cmd: str, fp: SupportsRead[bytes], - blocksize: int = ..., - callback: Callable[[bytes], object] | None = ..., - rest: int | str | None = ..., + blocksize: int = 8192, + callback: Callable[[bytes], object] | None = None, + rest: int | str | None = None, ) -> str: ... - def retrlines(self, cmd: str, callback: Callable[[str], object] | None = ...) -> str: ... - def storlines(self, cmd: str, fp: SupportsReadline[bytes], callback: Callable[[bytes], object] | None = ...) -> str: ... + def retrlines(self, cmd: str, callback: Callable[[str], object] | None = None) -> str: ... + def storlines(self, cmd: str, fp: SupportsReadline[bytes], callback: Callable[[bytes], object] | None = None) -> str: ... def acct(self, password: str) -> str: ... def nlst(self, *args: str) -> list[str]: ... # Technically only the last arg can be a Callable but ... def dir(self, *args: str | Callable[[str], object]) -> None: ... - def mlsd(self, path: str = ..., facts: Iterable[str] = ...) -> Iterator[tuple[str, dict[str, str]]]: ... + def mlsd(self, path: str = "", facts: Iterable[str] = ...) -> Iterator[tuple[str, dict[str, str]]]: ... def rename(self, fromname: str, toname: str) -> str: ... def delete(self, filename: str) -> str: ... def cwd(self, dirname: str) -> str: ... @@ -121,36 +121,36 @@ class FTP_TLS(FTP): if sys.version_info >= (3, 9): def __init__( self, - host: str = ..., - user: str = ..., - passwd: str = ..., - acct: str = ..., - keyfile: str | None = ..., - certfile: str | None = ..., - context: SSLContext | None = ..., + host: str = "", + user: str = "", + passwd: str = "", + acct: str = "", + keyfile: str | None = None, + certfile: str | None = None, + context: SSLContext | None = None, timeout: float = ..., - source_address: tuple[str, int] | None = ..., + source_address: tuple[str, int] | None = None, *, - encoding: str = ..., + encoding: str = "utf-8", ) -> None: ... else: def __init__( self, - host: str = ..., - user: str = ..., - passwd: str = ..., - acct: str = ..., - keyfile: str | None = ..., - certfile: str | None = ..., - context: SSLContext | None = ..., + host: str = "", + user: str = "", + passwd: str = "", + acct: str = "", + keyfile: str | None = None, + certfile: str | None = None, + context: SSLContext | None = None, timeout: float = ..., - source_address: tuple[str, int] | None = ..., + source_address: tuple[str, int] | None = None, ) -> None: ... ssl_version: int keyfile: str | None certfile: str | None context: SSLContext - def login(self, user: str = ..., passwd: str = ..., acct: str = ..., secure: bool = ...) -> str: ... + def login(self, user: str = "", passwd: str = "", acct: str = "", secure: bool = True) -> str: ... def auth(self) -> str: ... def prot_p(self) -> str: ... def prot_c(self) -> str: ... @@ -161,5 +161,5 @@ def parse227(resp: str) -> tuple[str, int]: ... # undocumented def parse229(resp: str, peer: Any) -> tuple[str, int]: ... # undocumented def parse257(resp: str) -> str: ... # undocumented def ftpcp( - source: FTP, sourcename: str, target: FTP, targetname: str = ..., type: Literal["A", "I"] = ... + source: FTP, sourcename: str, target: FTP, targetname: str = "", type: Literal["A", "I"] = "I" ) -> None: ... # undocumented diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/functools.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/functools.pyi index 5c3f662c3..20b612123 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/functools.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/functools.pyi @@ -1,9 +1,9 @@ import sys import types -from _typeshed import IdentityFunction, Self, SupportsAllComparisons, SupportsItems +from _typeshed import SupportsAllComparisons, SupportsItems from collections.abc import Callable, Hashable, Iterable, Sequence, Sized from typing import Any, Generic, NamedTuple, TypeVar, overload -from typing_extensions import Literal, TypeAlias, final +from typing_extensions import Literal, ParamSpec, Self, TypeAlias, final if sys.version_info >= (3, 9): from types import GenericAlias @@ -28,10 +28,12 @@ if sys.version_info >= (3, 8): if sys.version_info >= (3, 9): __all__ += ["cache"] -_AnyCallable: TypeAlias = Callable[..., object] - _T = TypeVar("_T") _S = TypeVar("_S") +_PWrapped = ParamSpec("_PWrapped") +_RWrapped = TypeVar("_RWrapped") +_PWrapper = ParamSpec("_PWrapper") +_RWapper = TypeVar("_RWapper") @overload def reduce(function: Callable[[_T, _S], _T], sequence: Iterable[_S], initial: _T) -> _T: ... @@ -41,7 +43,7 @@ def reduce(function: Callable[[_T, _T], _T], sequence: Iterable[_T]) -> _T: ... class _CacheInfo(NamedTuple): hits: int misses: int - maxsize: int + maxsize: int | None currsize: int @final @@ -55,20 +57,37 @@ class _lru_cache_wrapper(Generic[_T]): if sys.version_info >= (3, 8): @overload - def lru_cache(maxsize: int | None = ..., typed: bool = ...) -> Callable[[Callable[..., _T]], _lru_cache_wrapper[_T]]: ... + def lru_cache(maxsize: int | None = 128, typed: bool = False) -> Callable[[Callable[..., _T]], _lru_cache_wrapper[_T]]: ... @overload - def lru_cache(maxsize: Callable[..., _T], typed: bool = ...) -> _lru_cache_wrapper[_T]: ... + def lru_cache(maxsize: Callable[..., _T], typed: bool = False) -> _lru_cache_wrapper[_T]: ... else: - def lru_cache(maxsize: int | None = ..., typed: bool = ...) -> Callable[[Callable[..., _T]], _lru_cache_wrapper[_T]]: ... + def lru_cache(maxsize: int | None = 128, typed: bool = False) -> Callable[[Callable[..., _T]], _lru_cache_wrapper[_T]]: ... WRAPPER_ASSIGNMENTS: tuple[ - Literal["__module__"], Literal["__name__"], Literal["__qualname__"], Literal["__doc__"], Literal["__annotations__"], + Literal["__module__"], Literal["__name__"], Literal["__qualname__"], Literal["__doc__"], Literal["__annotations__"] ] WRAPPER_UPDATES: tuple[Literal["__dict__"]] -def update_wrapper(wrapper: _T, wrapped: _AnyCallable, assigned: Sequence[str] = ..., updated: Sequence[str] = ...) -> _T: ... -def wraps(wrapped: _AnyCallable, assigned: Sequence[str] = ..., updated: Sequence[str] = ...) -> IdentityFunction: ... +class _Wrapped(Generic[_PWrapped, _RWrapped, _PWrapper, _RWapper]): + __wrapped__: Callable[_PWrapped, _RWrapped] + def __call__(self, *args: _PWrapper.args, **kwargs: _PWrapper.kwargs) -> _RWapper: ... + # as with ``Callable``, we'll assume that these attributes exist + __name__: str + __qualname__: str + +class _Wrapper(Generic[_PWrapped, _RWrapped]): + def __call__(self, f: Callable[_PWrapper, _RWapper]) -> _Wrapped[_PWrapped, _RWrapped, _PWrapper, _RWapper]: ... + +def update_wrapper( + wrapper: Callable[_PWrapper, _RWapper], + wrapped: Callable[_PWrapped, _RWrapped], + assigned: Sequence[str] = ..., + updated: Sequence[str] = ..., +) -> _Wrapped[_PWrapped, _RWrapped, _PWrapper, _RWapper]: ... +def wraps( + wrapped: Callable[_PWrapped, _RWrapped], assigned: Sequence[str] = ..., updated: Sequence[str] = ... +) -> _Wrapper[_PWrapped, _RWrapped]: ... def total_ordering(cls: type[_T]) -> type[_T]: ... def cmp_to_key(mycmp: Callable[[_T, _T], int]) -> Callable[[_T], SupportsAllComparisons]: ... @@ -79,7 +98,7 @@ class partial(Generic[_T]): def args(self) -> tuple[Any, ...]: ... @property def keywords(self) -> dict[str, Any]: ... - def __new__(cls: type[Self], __func: Callable[..., _T], *args: Any, **kwargs: Any) -> Self: ... + def __new__(cls, __func: Callable[..., _T], *args: Any, **kwargs: Any) -> Self: ... def __call__(__self, *args: Any, **kwargs: Any) -> _T: ... if sys.version_info >= (3, 9): def __class_getitem__(cls, item: Any) -> GenericAlias: ... @@ -96,7 +115,7 @@ class partialmethod(Generic[_T]): @overload def __init__(self, __func: _Descriptor, *args: Any, **keywords: Any) -> None: ... if sys.version_info >= (3, 8): - def __get__(self, obj: Any, cls: type[Any] | None = ...) -> Callable[..., _T]: ... + def __get__(self, obj: Any, cls: type[Any] | None = None) -> Callable[..., _T]: ... else: def __get__(self, obj: Any, cls: type[Any] | None) -> Callable[..., _T]: ... @@ -111,11 +130,11 @@ class _SingleDispatchCallable(Generic[_T]): # @fun.register(complex) # def _(arg, verbose=False): ... @overload - def register(self, cls: type[Any], func: None = ...) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ... + def register(self, cls: type[Any], func: None = None) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ... # @fun.register # def _(arg: int, verbose=False): @overload - def register(self, cls: Callable[..., _T], func: None = ...) -> Callable[..., _T]: ... + def register(self, cls: Callable[..., _T], func: None = None) -> Callable[..., _T]: ... # fun.register(int, lambda x: x) @overload def register(self, cls: type[Any], func: Callable[..., _T]) -> Callable[..., _T]: ... @@ -132,22 +151,24 @@ if sys.version_info >= (3, 8): @property def __isabstractmethod__(self) -> bool: ... @overload - def register(self, cls: type[Any], method: None = ...) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ... + def register(self, cls: type[Any], method: None = None) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ... @overload - def register(self, cls: Callable[..., _T], method: None = ...) -> Callable[..., _T]: ... + def register(self, cls: Callable[..., _T], method: None = None) -> Callable[..., _T]: ... @overload def register(self, cls: type[Any], method: Callable[..., _T]) -> Callable[..., _T]: ... - def __get__(self, obj: _S, cls: type[_S] | None = ...) -> Callable[..., _T]: ... + def __get__(self, obj: _S, cls: type[_S] | None = None) -> Callable[..., _T]: ... class cached_property(Generic[_T]): func: Callable[[Any], _T] attrname: str | None def __init__(self, func: Callable[[Any], _T]) -> None: ... @overload - def __get__(self, instance: None, owner: type[Any] | None = ...) -> cached_property[_T]: ... + def __get__(self, instance: None, owner: type[Any] | None = None) -> cached_property[_T]: ... @overload - def __get__(self, instance: object, owner: type[Any] | None = ...) -> _T: ... + def __get__(self, instance: object, owner: type[Any] | None = None) -> _T: ... def __set_name__(self, owner: type[Any], name: str) -> None: ... + # __set__ is not defined at runtime, but @cached_property is designed to be settable + def __set__(self, instance: object, value: _T) -> None: ... if sys.version_info >= (3, 9): def __class_getitem__(cls, item: Any) -> GenericAlias: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/gc.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/gc.pyi index d24b7c1f4..27cee726b 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/gc.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/gc.pyi @@ -14,14 +14,14 @@ _CallbackType: TypeAlias = Callable[[Literal["start", "stop"], dict[str, int]], callbacks: list[_CallbackType] garbage: list[Any] -def collect(generation: int = ...) -> int: ... +def collect(generation: int = 2) -> int: ... def disable() -> None: ... def enable() -> None: ... def get_count() -> tuple[int, int, int]: ... def get_debug() -> int: ... if sys.version_info >= (3, 8): - def get_objects(generation: int | None = ...) -> list[Any]: ... + def get_objects(generation: int | None = None) -> list[Any]: ... else: def get_objects() -> list[Any]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/genericpath.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/genericpath.pyi index 911d582fd..46426b63c 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/genericpath.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/genericpath.pyi @@ -1,5 +1,5 @@ import os -from _typeshed import BytesPath, StrOrBytesPath, StrPath, SupportsRichComparisonT +from _typeshed import BytesPath, FileDescriptorOrPath, StrPath, SupportsRichComparisonT from collections.abc import Sequence from typing import overload from typing_extensions import Literal, LiteralString @@ -31,16 +31,16 @@ def commonprefix(m: Sequence[BytesPath]) -> bytes | Literal[""]: ... def commonprefix(m: Sequence[list[SupportsRichComparisonT]]) -> Sequence[SupportsRichComparisonT]: ... @overload def commonprefix(m: Sequence[tuple[SupportsRichComparisonT, ...]]) -> Sequence[SupportsRichComparisonT]: ... -def exists(path: StrOrBytesPath | int) -> bool: ... -def getsize(filename: StrOrBytesPath | int) -> int: ... -def isfile(path: StrOrBytesPath | int) -> bool: ... -def isdir(s: StrOrBytesPath | int) -> bool: ... +def exists(path: FileDescriptorOrPath) -> bool: ... +def getsize(filename: FileDescriptorOrPath) -> int: ... +def isfile(path: FileDescriptorOrPath) -> bool: ... +def isdir(s: FileDescriptorOrPath) -> bool: ... # These return float if os.stat_float_times() == True, # but int is a subclass of float. -def getatime(filename: StrOrBytesPath | int) -> float: ... -def getmtime(filename: StrOrBytesPath | int) -> float: ... -def getctime(filename: StrOrBytesPath | int) -> float: ... -def samefile(f1: StrOrBytesPath | int, f2: StrOrBytesPath | int) -> bool: ... +def getatime(filename: FileDescriptorOrPath) -> float: ... +def getmtime(filename: FileDescriptorOrPath) -> float: ... +def getctime(filename: FileDescriptorOrPath) -> float: ... +def samefile(f1: FileDescriptorOrPath, f2: FileDescriptorOrPath) -> bool: ... def sameopenfile(fp1: int, fp2: int) -> bool: ... def samestat(s1: os.stat_result, s2: os.stat_result) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/getopt.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/getopt.pyi index 42ddb1cb7..14d63dbd6 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/getopt.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/getopt.pyi @@ -6,6 +6,6 @@ def gnu_getopt(args: list[str], shortopts: str, longopts: list[str] = ...) -> tu class GetoptError(Exception): msg: str opt: str - def __init__(self, msg: str, opt: str = ...) -> None: ... + def __init__(self, msg: str, opt: str = "") -> None: ... error = GetoptError diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/getpass.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/getpass.pyi index 153db2f4c..6104e0ded 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/getpass.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/getpass.pyi @@ -2,7 +2,7 @@ from typing import TextIO __all__ = ["getpass", "getuser", "GetPassWarning"] -def getpass(prompt: str = ..., stream: TextIO | None = ...) -> str: ... +def getpass(prompt: str = "Password: ", stream: TextIO | None = None) -> str: ... def getuser() -> str: ... class GetPassWarning(UserWarning): ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/gettext.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/gettext.pyi index 3c07abeb2..57e81120b 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/gettext.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/gettext.pyi @@ -32,7 +32,7 @@ class _TranslationsReader(Protocol): # name: str class NullTranslations: - def __init__(self, fp: _TranslationsReader | None = ...) -> None: ... + def __init__(self, fp: _TranslationsReader | None = None) -> None: ... def _parse(self, fp: _TranslationsReader) -> None: ... def add_fallback(self, fallback: NullTranslations) -> None: ... def gettext(self, message: str) -> str: ... @@ -49,7 +49,7 @@ class NullTranslations: def lgettext(self, message: str) -> str: ... def lngettext(self, msgid1: str, msgid2: str, n: int) -> str: ... - def install(self, names: Container[str] | None = ...) -> None: ... + def install(self, names: Container[str] | None = None) -> None: ... class GNUTranslations(NullTranslations): LE_MAGIC: Final[int] @@ -57,16 +57,18 @@ class GNUTranslations(NullTranslations): CONTEXT: str VERSIONS: Sequence[int] -@overload # ignores incompatible overloads -def find( # type: ignore[misc] - domain: str, localedir: StrPath | None = ..., languages: Iterable[str] | None = ..., all: Literal[False] = ... +@overload +def find( + domain: str, localedir: StrPath | None = None, languages: Iterable[str] | None = None, all: Literal[False] = False ) -> str | None: ... @overload def find( - domain: str, localedir: StrPath | None = ..., languages: Iterable[str] | None = ..., all: Literal[True] = ... + domain: str, localedir: StrPath | None = None, languages: Iterable[str] | None = None, *, all: Literal[True] ) -> list[str]: ... @overload -def find(domain: str, localedir: StrPath | None = ..., languages: Iterable[str] | None = ..., all: bool = ...) -> Any: ... +def find(domain: str, localedir: StrPath | None, languages: Iterable[str] | None, all: Literal[True]) -> list[str]: ... +@overload +def find(domain: str, localedir: StrPath | None = None, languages: Iterable[str] | None = None, all: bool = False) -> Any: ... _NullTranslationsT = TypeVar("_NullTranslationsT", bound=NullTranslations) @@ -74,19 +76,19 @@ if sys.version_info >= (3, 11): @overload def translation( domain: str, - localedir: StrPath | None = ..., - languages: Iterable[str] | None = ..., - class_: None = ..., - fallback: Literal[False] = ..., + localedir: StrPath | None = None, + languages: Iterable[str] | None = None, + class_: None = None, + fallback: Literal[False] = False, ) -> GNUTranslations: ... @overload def translation( domain: str, - localedir: StrPath | None = ..., - languages: Iterable[str] | None = ..., + localedir: StrPath | None = None, + languages: Iterable[str] | None = None, *, class_: Callable[[io.BufferedReader], _NullTranslationsT], - fallback: Literal[False] = ..., + fallback: Literal[False] = False, ) -> _NullTranslationsT: ... @overload def translation( @@ -94,37 +96,37 @@ if sys.version_info >= (3, 11): localedir: StrPath | None, languages: Iterable[str] | None, class_: Callable[[io.BufferedReader], _NullTranslationsT], - fallback: Literal[False] = ..., + fallback: Literal[False] = False, ) -> _NullTranslationsT: ... @overload def translation( domain: str, - localedir: StrPath | None = ..., - languages: Iterable[str] | None = ..., - class_: Callable[[io.BufferedReader], NullTranslations] | None = ..., - fallback: bool = ..., + localedir: StrPath | None = None, + languages: Iterable[str] | None = None, + class_: Callable[[io.BufferedReader], NullTranslations] | None = None, + fallback: bool = False, ) -> NullTranslations: ... - def install(domain: str, localedir: StrPath | None = ..., *, names: Container[str] | None = ...) -> None: ... + def install(domain: str, localedir: StrPath | None = None, *, names: Container[str] | None = None) -> None: ... else: @overload def translation( domain: str, - localedir: StrPath | None = ..., - languages: Iterable[str] | None = ..., - class_: None = ..., - fallback: Literal[False] = ..., - codeset: str | None = ..., + localedir: StrPath | None = None, + languages: Iterable[str] | None = None, + class_: None = None, + fallback: Literal[False] = False, + codeset: str | None = None, ) -> GNUTranslations: ... @overload def translation( domain: str, - localedir: StrPath | None = ..., - languages: Iterable[str] | None = ..., + localedir: StrPath | None = None, + languages: Iterable[str] | None = None, *, class_: Callable[[io.BufferedReader], _NullTranslationsT], - fallback: Literal[False] = ..., - codeset: str | None = ..., + fallback: Literal[False] = False, + codeset: str | None = None, ) -> _NullTranslationsT: ... @overload def translation( @@ -132,24 +134,24 @@ else: localedir: StrPath | None, languages: Iterable[str] | None, class_: Callable[[io.BufferedReader], _NullTranslationsT], - fallback: Literal[False] = ..., - codeset: str | None = ..., + fallback: Literal[False] = False, + codeset: str | None = None, ) -> _NullTranslationsT: ... @overload def translation( domain: str, - localedir: StrPath | None = ..., - languages: Iterable[str] | None = ..., - class_: Callable[[io.BufferedReader], NullTranslations] | None = ..., - fallback: bool = ..., - codeset: str | None = ..., + localedir: StrPath | None = None, + languages: Iterable[str] | None = None, + class_: Callable[[io.BufferedReader], NullTranslations] | None = None, + fallback: bool = False, + codeset: str | None = None, ) -> NullTranslations: ... def install( - domain: str, localedir: StrPath | None = ..., codeset: str | None = ..., names: Container[str] | None = ... + domain: str, localedir: StrPath | None = None, codeset: str | None = None, names: Container[str] | None = None ) -> None: ... -def textdomain(domain: str | None = ...) -> str: ... -def bindtextdomain(domain: str, localedir: StrPath | None = ...) -> str: ... +def textdomain(domain: str | None = None) -> str: ... +def bindtextdomain(domain: str, localedir: StrPath | None = None) -> str: ... def dgettext(domain: str, message: str) -> str: ... def dngettext(domain: str, msgid1: str, msgid2: str, n: int) -> str: ... def gettext(message: str) -> str: ... @@ -166,6 +168,6 @@ if sys.version_info < (3, 11): def ldgettext(domain: str, message: str) -> str: ... def lngettext(msgid1: str, msgid2: str, n: int) -> str: ... def ldngettext(domain: str, msgid1: str, msgid2: str, n: int) -> str: ... - def bind_textdomain_codeset(domain: str, codeset: str | None = ...) -> str: ... + def bind_textdomain_codeset(domain: str, codeset: str | None = None) -> str: ... Catalog = translation diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/glob.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/glob.pyi index c63563d19..914ccc12e 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/glob.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/glob.pyi @@ -12,31 +12,31 @@ if sys.version_info >= (3, 11): def glob( pathname: AnyStr, *, - root_dir: StrOrBytesPath | None = ..., - dir_fd: int | None = ..., - recursive: bool = ..., - include_hidden: bool = ..., + root_dir: StrOrBytesPath | None = None, + dir_fd: int | None = None, + recursive: bool = False, + include_hidden: bool = False, ) -> list[AnyStr]: ... def iglob( pathname: AnyStr, *, - root_dir: StrOrBytesPath | None = ..., - dir_fd: int | None = ..., - recursive: bool = ..., - include_hidden: bool = ..., + root_dir: StrOrBytesPath | None = None, + dir_fd: int | None = None, + recursive: bool = False, + include_hidden: bool = False, ) -> Iterator[AnyStr]: ... elif sys.version_info >= (3, 10): def glob( - pathname: AnyStr, *, root_dir: StrOrBytesPath | None = ..., dir_fd: int | None = ..., recursive: bool = ... + pathname: AnyStr, *, root_dir: StrOrBytesPath | None = None, dir_fd: int | None = None, recursive: bool = False ) -> list[AnyStr]: ... def iglob( - pathname: AnyStr, *, root_dir: StrOrBytesPath | None = ..., dir_fd: int | None = ..., recursive: bool = ... + pathname: AnyStr, *, root_dir: StrOrBytesPath | None = None, dir_fd: int | None = None, recursive: bool = False ) -> Iterator[AnyStr]: ... else: - def glob(pathname: AnyStr, *, recursive: bool = ...) -> list[AnyStr]: ... - def iglob(pathname: AnyStr, *, recursive: bool = ...) -> Iterator[AnyStr]: ... + def glob(pathname: AnyStr, *, recursive: bool = False) -> list[AnyStr]: ... + def iglob(pathname: AnyStr, *, recursive: bool = False) -> Iterator[AnyStr]: ... def escape(pathname: AnyStr) -> AnyStr: ... def has_magic(s: str | bytes) -> bool: ... # undocumented diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/graphlib.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/graphlib.pyi index 4c6959dec..c02d447ad 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/graphlib.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/graphlib.pyi @@ -12,7 +12,7 @@ if sys.version_info >= (3, 11): class TopologicalSorter(Generic[_T]): @overload - def __init__(self, graph: None = ...) -> None: ... + def __init__(self, graph: None = None) -> None: ... @overload def __init__(self, graph: SupportsItems[_T, Iterable[_T]]) -> None: ... def add(self, node: _T, *predecessors: _T) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/gzip.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/gzip.pyi index abf12925a..6a794f381 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/gzip.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/gzip.pyi @@ -1,9 +1,9 @@ import _compression import sys import zlib -from _typeshed import ReadableBuffer, StrOrBytesPath +from _typeshed import ReadableBuffer, StrOrBytesPath, _BufferWithLen from io import FileIO -from typing import Any, Protocol, TextIO, overload +from typing import Protocol, TextIO, overload from typing_extensions import Literal, TypeAlias if sys.version_info >= (3, 8): @@ -15,20 +15,26 @@ _ReadBinaryMode: TypeAlias = Literal["r", "rb"] _WriteBinaryMode: TypeAlias = Literal["a", "ab", "w", "wb", "x", "xb"] _OpenTextMode: TypeAlias = Literal["rt", "at", "wt", "xt"] -READ: Literal[1] -WRITE: Literal[2] +READ: Literal[1] # undocumented +WRITE: Literal[2] # undocumented + +FTEXT: int # actually Literal[1] # undocumented +FHCRC: int # actually Literal[2] # undocumented +FEXTRA: int # actually Literal[4] # undocumented +FNAME: int # actually Literal[8] # undocumented +FCOMMENT: int # actually Literal[16] # undocumented class _ReadableFileobj(Protocol): def read(self, __n: int) -> bytes: ... - def seek(self, __n: int) -> Any: ... + def seek(self, __n: int) -> object: ... # The following attributes and methods are optional: # name: str # mode: str # def fileno() -> int: ... class _WritableFileobj(Protocol): - def write(self, __b: bytes) -> Any: ... - def flush(self) -> Any: ... + def write(self, __b: bytes) -> object: ... + def flush(self) -> object: ... # The following attributes and methods are optional: # name: str # mode: str @@ -37,45 +43,45 @@ class _WritableFileobj(Protocol): @overload def open( filename: StrOrBytesPath | _ReadableFileobj, - mode: _ReadBinaryMode = ..., - compresslevel: int = ..., - encoding: None = ..., - errors: None = ..., - newline: None = ..., + mode: _ReadBinaryMode = "rb", + compresslevel: int = 9, + encoding: None = None, + errors: None = None, + newline: None = None, ) -> GzipFile: ... @overload def open( filename: StrOrBytesPath | _WritableFileobj, mode: _WriteBinaryMode, - compresslevel: int = ..., - encoding: None = ..., - errors: None = ..., - newline: None = ..., + compresslevel: int = 9, + encoding: None = None, + errors: None = None, + newline: None = None, ) -> GzipFile: ... @overload def open( filename: StrOrBytesPath, mode: _OpenTextMode, - compresslevel: int = ..., - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., + compresslevel: int = 9, + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, ) -> TextIO: ... @overload def open( filename: StrOrBytesPath | _ReadableFileobj | _WritableFileobj, mode: str, - compresslevel: int = ..., - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., + compresslevel: int = 9, + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, ) -> GzipFile | TextIO: ... class _PaddedFile: file: _ReadableFileobj - def __init__(self, f: _ReadableFileobj, prepend: bytes = ...) -> None: ... + def __init__(self, f: _ReadableFileobj, prepend: bytes = b"") -> None: ... def read(self, size: int) -> bytes: ... - def prepend(self, prepend: bytes = ...) -> None: ... + def prepend(self, prepend: bytes = b"") -> None: ... def seek(self, off: int) -> int: ... def seekable(self) -> bool: ... @@ -93,45 +99,45 @@ class GzipFile(_compression.BaseStream): self, filename: StrOrBytesPath | None, mode: _ReadBinaryMode, - compresslevel: int = ..., - fileobj: _ReadableFileobj | None = ..., - mtime: float | None = ..., + compresslevel: int = 9, + fileobj: _ReadableFileobj | None = None, + mtime: float | None = None, ) -> None: ... @overload def __init__( self, *, mode: _ReadBinaryMode, - compresslevel: int = ..., - fileobj: _ReadableFileobj | None = ..., - mtime: float | None = ..., + compresslevel: int = 9, + fileobj: _ReadableFileobj | None = None, + mtime: float | None = None, ) -> None: ... @overload def __init__( self, filename: StrOrBytesPath | None, mode: _WriteBinaryMode, - compresslevel: int = ..., - fileobj: _WritableFileobj | None = ..., - mtime: float | None = ..., + compresslevel: int = 9, + fileobj: _WritableFileobj | None = None, + mtime: float | None = None, ) -> None: ... @overload def __init__( self, *, mode: _WriteBinaryMode, - compresslevel: int = ..., - fileobj: _WritableFileobj | None = ..., - mtime: float | None = ..., + compresslevel: int = 9, + fileobj: _WritableFileobj | None = None, + mtime: float | None = None, ) -> None: ... @overload def __init__( self, - filename: StrOrBytesPath | None = ..., - mode: str | None = ..., - compresslevel: int = ..., - fileobj: _ReadableFileobj | _WritableFileobj | None = ..., - mtime: float | None = ..., + filename: StrOrBytesPath | None = None, + mode: str | None = None, + compresslevel: int = 9, + fileobj: _ReadableFileobj | _WritableFileobj | None = None, + mtime: float | None = None, ) -> None: ... @property def filename(self) -> str: ... @@ -139,29 +145,23 @@ class GzipFile(_compression.BaseStream): def mtime(self) -> int | None: ... crc: int def write(self, data: ReadableBuffer) -> int: ... - def read(self, size: int | None = ...) -> bytes: ... - def read1(self, size: int = ...) -> bytes: ... + def read(self, size: int | None = -1) -> bytes: ... + def read1(self, size: int = -1) -> bytes: ... def peek(self, n: int) -> bytes: ... - @property - def closed(self) -> bool: ... def close(self) -> None: ... - def flush(self, zlib_mode: int = ...) -> None: ... + def flush(self, zlib_mode: int = 2) -> None: ... def fileno(self) -> int: ... def rewind(self) -> None: ... - def readable(self) -> bool: ... - def writable(self) -> bool: ... - def seekable(self) -> bool: ... - def seek(self, offset: int, whence: int = ...) -> int: ... - def readline(self, size: int | None = ...) -> bytes: ... + def seek(self, offset: int, whence: int = 0) -> int: ... + def readline(self, size: int | None = -1) -> bytes: ... class _GzipReader(_compression.DecompressReader): def __init__(self, fp: _ReadableFileobj) -> None: ... - def read(self, size: int = ...) -> bytes: ... if sys.version_info >= (3, 8): - def compress(data: bytes, compresslevel: int = ..., *, mtime: float | None = ...) -> bytes: ... + def compress(data: _BufferWithLen, compresslevel: int = 9, *, mtime: float | None = None) -> bytes: ... else: - def compress(data: bytes, compresslevel: int = ...) -> bytes: ... + def compress(data: _BufferWithLen, compresslevel: int = 9) -> bytes: ... -def decompress(data: bytes) -> bytes: ... +def decompress(data: ReadableBuffer) -> bytes: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/hashlib.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/hashlib.pyi index 2a417364b..18b1ab549 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/hashlib.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/hashlib.pyi @@ -1,8 +1,8 @@ import sys -from _typeshed import ReadableBuffer, Self +from _typeshed import ReadableBuffer from collections.abc import Callable, Set as AbstractSet from typing import Protocol -from typing_extensions import final +from typing_extensions import Self, final if sys.version_info >= (3, 11): __all__ = ( @@ -56,31 +56,31 @@ class _Hash: @property def name(self) -> str: ... def __init__(self, data: ReadableBuffer = ...) -> None: ... - def copy(self: Self) -> Self: ... + def copy(self) -> Self: ... def digest(self) -> bytes: ... def hexdigest(self) -> str: ... def update(self, __data: ReadableBuffer) -> None: ... if sys.version_info >= (3, 9): - def new(name: str, data: ReadableBuffer = ..., *, usedforsecurity: bool = ...) -> _Hash: ... - def md5(string: ReadableBuffer = ..., *, usedforsecurity: bool = ...) -> _Hash: ... - def sha1(string: ReadableBuffer = ..., *, usedforsecurity: bool = ...) -> _Hash: ... - def sha224(string: ReadableBuffer = ..., *, usedforsecurity: bool = ...) -> _Hash: ... - def sha256(string: ReadableBuffer = ..., *, usedforsecurity: bool = ...) -> _Hash: ... - def sha384(string: ReadableBuffer = ..., *, usedforsecurity: bool = ...) -> _Hash: ... - def sha512(string: ReadableBuffer = ..., *, usedforsecurity: bool = ...) -> _Hash: ... + def new(name: str, data: ReadableBuffer = b"", *, usedforsecurity: bool = ...) -> _Hash: ... + def md5(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> _Hash: ... + def sha1(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> _Hash: ... + def sha224(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> _Hash: ... + def sha256(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> _Hash: ... + def sha384(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> _Hash: ... + def sha512(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> _Hash: ... elif sys.version_info >= (3, 8): - def new(name: str, data: ReadableBuffer = ...) -> _Hash: ... - def md5(string: ReadableBuffer = ...) -> _Hash: ... - def sha1(string: ReadableBuffer = ...) -> _Hash: ... - def sha224(string: ReadableBuffer = ...) -> _Hash: ... - def sha256(string: ReadableBuffer = ...) -> _Hash: ... - def sha384(string: ReadableBuffer = ...) -> _Hash: ... - def sha512(string: ReadableBuffer = ...) -> _Hash: ... + def new(name: str, data: ReadableBuffer = b"") -> _Hash: ... + def md5(string: ReadableBuffer = b"") -> _Hash: ... + def sha1(string: ReadableBuffer = b"") -> _Hash: ... + def sha224(string: ReadableBuffer = b"") -> _Hash: ... + def sha256(string: ReadableBuffer = b"") -> _Hash: ... + def sha384(string: ReadableBuffer = b"") -> _Hash: ... + def sha512(string: ReadableBuffer = b"") -> _Hash: ... else: - def new(name: str, data: ReadableBuffer = ...) -> _Hash: ... + def new(name: str, data: ReadableBuffer = b"") -> _Hash: ... def md5(__string: ReadableBuffer = ...) -> _Hash: ... def sha1(__string: ReadableBuffer = ...) -> _Hash: ... def sha224(__string: ReadableBuffer = ...) -> _Hash: ... @@ -92,7 +92,7 @@ algorithms_guaranteed: AbstractSet[str] algorithms_available: AbstractSet[str] def pbkdf2_hmac( - hash_name: str, password: ReadableBuffer, salt: ReadableBuffer, iterations: int, dklen: int | None = ... + hash_name: str, password: ReadableBuffer, salt: ReadableBuffer, iterations: int, dklen: int | None = None ) -> bytes: ... class _VarLenHash: @@ -115,12 +115,12 @@ shake_256 = _VarLenHash def scrypt( password: ReadableBuffer, *, - salt: ReadableBuffer | None = ..., - n: int | None = ..., - r: int | None = ..., - p: int | None = ..., - maxmem: int = ..., - dklen: int = ..., + salt: ReadableBuffer | None = None, + n: int | None = None, + r: int | None = None, + p: int | None = None, + maxmem: int = 0, + dklen: int = 64, ) -> bytes: ... @final class _BlakeHash(_Hash): @@ -177,5 +177,5 @@ if sys.version_info >= (3, 11): def readable(self) -> bool: ... def file_digest( - __fileobj: _BytesIOLike | _FileDigestFileObj, __digest: str | Callable[[], _Hash], *, _bufsize: int = ... + __fileobj: _BytesIOLike | _FileDigestFileObj, __digest: str | Callable[[], _Hash], *, _bufsize: int = 262144 ) -> _Hash: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/heapq.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/heapq.pyi index b28032268..3f4f274b9 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/heapq.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/heapq.pyi @@ -2,16 +2,17 @@ from _heapq import * from _typeshed import SupportsRichComparison from collections.abc import Callable, Iterable from typing import Any, TypeVar +from typing_extensions import Final __all__ = ["heappush", "heappop", "heapify", "heapreplace", "merge", "nlargest", "nsmallest", "heappushpop"] _S = TypeVar("_S") -__about__: str +__about__: Final[str] def merge( - *iterables: Iterable[_S], key: Callable[[_S], SupportsRichComparison] | None = ..., reverse: bool = ... + *iterables: Iterable[_S], key: Callable[[_S], SupportsRichComparison] | None = None, reverse: bool = False ) -> Iterable[_S]: ... -def nlargest(n: int, iterable: Iterable[_S], key: Callable[[_S], SupportsRichComparison] | None = ...) -> list[_S]: ... -def nsmallest(n: int, iterable: Iterable[_S], key: Callable[[_S], SupportsRichComparison] | None = ...) -> list[_S]: ... -def _heapify_max(__x: list[Any]) -> None: ... # undocumented +def nlargest(n: int, iterable: Iterable[_S], key: Callable[[_S], SupportsRichComparison] | None = None) -> list[_S]: ... +def nsmallest(n: int, iterable: Iterable[_S], key: Callable[[_S], SupportsRichComparison] | None = None) -> list[_S]: ... +def _heapify_max(__heap: list[Any]) -> None: ... # undocumented diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/hmac.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/hmac.pyi index af69fc7ea..ee8af1b48 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/hmac.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/hmac.pyi @@ -1,5 +1,5 @@ import sys -from _typeshed import ReadableBuffer +from _typeshed import ReadableBuffer, _BufferWithLen from collections.abc import Callable from types import ModuleType from typing import Any, AnyStr, overload @@ -18,19 +18,25 @@ if sys.version_info >= (3, 8): # In reality digestmod has a default value, but the function always throws an error # if the argument is not given, so we pretend it is a required argument. @overload - def new(key: bytes, msg: ReadableBuffer | None, digestmod: _DigestMod) -> HMAC: ... + def new(key: bytes | bytearray, msg: ReadableBuffer | None, digestmod: _DigestMod) -> HMAC: ... @overload - def new(key: bytes, *, digestmod: _DigestMod) -> HMAC: ... + def new(key: bytes | bytearray, *, digestmod: _DigestMod) -> HMAC: ... else: - def new(key: bytes, msg: ReadableBuffer | None = ..., digestmod: _DigestMod | None = ...) -> HMAC: ... + def new(key: bytes | bytearray, msg: ReadableBuffer | None = None, digestmod: _DigestMod | None = None) -> HMAC: ... class HMAC: digest_size: int block_size: int @property def name(self) -> str: ... - def __init__(self, key: bytes, msg: ReadableBuffer | None = ..., digestmod: _DigestMod = ...) -> None: ... + if sys.version_info >= (3, 8): + def __init__(self, key: bytes | bytearray, msg: ReadableBuffer | None = None, digestmod: _DigestMod = "") -> None: ... + else: + def __init__( + self, key: bytes | bytearray, msg: ReadableBuffer | None = None, digestmod: _DigestMod | None = None + ) -> None: ... + def update(self, msg: ReadableBuffer) -> None: ... def digest(self) -> bytes: ... def hexdigest(self) -> str: ... @@ -40,4 +46,4 @@ class HMAC: def compare_digest(__a: ReadableBuffer, __b: ReadableBuffer) -> bool: ... @overload def compare_digest(__a: AnyStr, __b: AnyStr) -> bool: ... -def digest(key: bytes, msg: ReadableBuffer, digest: _DigestMod) -> bytes: ... +def digest(key: _BufferWithLen, msg: ReadableBuffer, digest: _DigestMod) -> bytes: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/html/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/html/__init__.pyi index 109c5f4b5..afba90832 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/html/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/html/__init__.pyi @@ -2,5 +2,5 @@ from typing import AnyStr __all__ = ["escape", "unescape"] -def escape(s: AnyStr, quote: bool = ...) -> AnyStr: ... +def escape(s: AnyStr, quote: bool = True) -> AnyStr: ... def unescape(s: AnyStr) -> AnyStr: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/html/parser.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/html/parser.pyi index 2948eadc9..d322ade96 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/html/parser.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/html/parser.pyi @@ -4,11 +4,9 @@ from re import Pattern __all__ = ["HTMLParser"] class HTMLParser(ParserBase): - def __init__(self, *, convert_charrefs: bool = ...) -> None: ... + def __init__(self, *, convert_charrefs: bool = True) -> None: ... def feed(self, data: str) -> None: ... def close(self) -> None: ... - def reset(self) -> None: ... - def getpos(self) -> tuple[int, int]: ... def get_starttag_text(self) -> str | None: ... def handle_starttag(self, tag: str, attrs: list[tuple[str, str | None]]) -> None: ... def handle_endtag(self, tag: str) -> None: ... @@ -19,7 +17,6 @@ class HTMLParser(ParserBase): def handle_comment(self, data: str) -> None: ... def handle_decl(self, decl: str) -> None: ... def handle_pi(self, data: str) -> None: ... - def unknown_decl(self, data: str) -> None: ... CDATA_CONTENT_ELEMENTS: tuple[str, ...] def check_for_whole_start_tag(self, i: int) -> int: ... # undocumented def clear_cdata_mode(self) -> None: ... # undocumented diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/http/client.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/http/client.pyi index 08c3f2c8b..cc142fbb2 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/http/client.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/http/client.pyi @@ -2,11 +2,11 @@ import email.message import io import ssl import types -from _typeshed import Self, WriteableBuffer +from _typeshed import ReadableBuffer, SupportsRead, WriteableBuffer from collections.abc import Callable, Iterable, Iterator, Mapping from socket import socket -from typing import IO, Any, BinaryIO, TypeVar, overload -from typing_extensions import TypeAlias +from typing import Any, BinaryIO, TypeVar, overload +from typing_extensions import Self, TypeAlias __all__ = [ "HTTPResponse", @@ -30,7 +30,7 @@ __all__ = [ "HTTPSConnection", ] -_DataType: TypeAlias = bytes | IO[Any] | Iterable[bytes] | str +_DataType: TypeAlias = SupportsRead[bytes] | Iterable[ReadableBuffer] | ReadableBuffer _T = TypeVar("_T") HTTP_PORT: int @@ -101,7 +101,7 @@ class HTTPMessage(email.message.Message): def parse_headers(fp: io.BufferedIOBase, _class: Callable[[], email.message.Message] = ...) -> HTTPMessage: ... -class HTTPResponse(io.BufferedIOBase, BinaryIO): +class HTTPResponse(io.BufferedIOBase, BinaryIO): # type: ignore[misc] # incompatible method definitions in the base classes msg: HTTPMessage headers: HTTPMessage version: int @@ -114,21 +114,20 @@ class HTTPResponse(io.BufferedIOBase, BinaryIO): chunk_left: int | None length: int | None will_close: bool - def __init__(self, sock: socket, debuglevel: int = ..., method: str | None = ..., url: str | None = ...) -> None: ... - def peek(self, n: int = ...) -> bytes: ... - def read(self, amt: int | None = ...) -> bytes: ... - def read1(self, n: int = ...) -> bytes: ... + def __init__(self, sock: socket, debuglevel: int = 0, method: str | None = None, url: str | None = None) -> None: ... + def peek(self, n: int = -1) -> bytes: ... + def read(self, amt: int | None = None) -> bytes: ... + def read1(self, n: int = -1) -> bytes: ... def readinto(self, b: WriteableBuffer) -> int: ... - def readline(self, limit: int = ...) -> bytes: ... # type: ignore[override] + def readline(self, limit: int = -1) -> bytes: ... # type: ignore[override] @overload def getheader(self, name: str) -> str | None: ... @overload def getheader(self, name: str, default: _T) -> str | _T: ... def getheaders(self) -> list[tuple[str, str]]: ... - def fileno(self) -> int: ... def isclosed(self) -> bool: ... def __iter__(self) -> Iterator[bytes]: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: types.TracebackType | None ) -> None: ... @@ -149,39 +148,45 @@ class HTTPConnection: def __init__( self, host: str, - port: int | None = ..., + port: int | None = None, timeout: float | None = ..., - source_address: tuple[str, int] | None = ..., - blocksize: int = ..., + source_address: tuple[str, int] | None = None, + blocksize: int = 8192, ) -> None: ... def request( - self, method: str, url: str, body: _DataType | None = ..., headers: Mapping[str, str] = ..., *, encode_chunked: bool = ... + self, + method: str, + url: str, + body: _DataType | str | None = None, + headers: Mapping[str, str] = ..., + *, + encode_chunked: bool = False, ) -> None: ... def getresponse(self) -> HTTPResponse: ... def set_debuglevel(self, level: int) -> None: ... - def set_tunnel(self, host: str, port: int | None = ..., headers: Mapping[str, str] | None = ...) -> None: ... + def set_tunnel(self, host: str, port: int | None = None, headers: Mapping[str, str] | None = None) -> None: ... def connect(self) -> None: ... def close(self) -> None: ... - def putrequest(self, method: str, url: str, skip_host: bool = ..., skip_accept_encoding: bool = ...) -> None: ... + def putrequest(self, method: str, url: str, skip_host: bool = False, skip_accept_encoding: bool = False) -> None: ... def putheader(self, header: str, *argument: str) -> None: ... - def endheaders(self, message_body: _DataType | None = ..., *, encode_chunked: bool = ...) -> None: ... - def send(self, data: _DataType) -> None: ... + def endheaders(self, message_body: _DataType | None = None, *, encode_chunked: bool = False) -> None: ... + def send(self, data: _DataType | str) -> None: ... class HTTPSConnection(HTTPConnection): # Can be `None` if `.connect()` was not called: - sock: ssl.SSLSocket | Any # type: ignore[override] + sock: ssl.SSLSocket | Any def __init__( self, host: str, - port: int | None = ..., - key_file: str | None = ..., - cert_file: str | None = ..., + port: int | None = None, + key_file: str | None = None, + cert_file: str | None = None, timeout: float | None = ..., - source_address: tuple[str, int] | None = ..., + source_address: tuple[str, int] | None = None, *, - context: ssl.SSLContext | None = ..., - check_hostname: bool | None = ..., - blocksize: int = ..., + context: ssl.SSLContext | None = None, + check_hostname: bool | None = None, + blocksize: int = 8192, ) -> None: ... class HTTPException(Exception): ... @@ -198,7 +203,7 @@ class UnknownTransferEncoding(HTTPException): ... class UnimplementedFileMode(HTTPException): ... class IncompleteRead(HTTPException): - def __init__(self, partial: bytes, expected: int | None = ...) -> None: ... + def __init__(self, partial: bytes, expected: int | None = None) -> None: ... partial: bytes expected: int | None diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/http/cookiejar.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/http/cookiejar.pyi index dc3c0e17d..7f2c9c6cc 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/http/cookiejar.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/http/cookiejar.pyi @@ -28,14 +28,14 @@ class CookieJar(Iterable[Cookie]): domain_re: ClassVar[Pattern[str]] # undocumented dots_re: ClassVar[Pattern[str]] # undocumented magic_re: ClassVar[Pattern[str]] # undocumented - def __init__(self, policy: CookiePolicy | None = ...) -> None: ... + def __init__(self, policy: CookiePolicy | None = None) -> None: ... def add_cookie_header(self, request: Request) -> None: ... def extract_cookies(self, response: HTTPResponse, request: Request) -> None: ... def set_policy(self, policy: CookiePolicy) -> None: ... def make_cookies(self, response: HTTPResponse, request: Request) -> Sequence[Cookie]: ... def set_cookie(self, cookie: Cookie) -> None: ... def set_cookie_if_ok(self, cookie: Cookie, request: Request) -> None: ... - def clear(self, domain: str | None = ..., path: str | None = ..., name: str | None = ...) -> None: ... + def clear(self, domain: str | None = None, path: str | None = None, name: str | None = None) -> None: ... def clear_session_cookies(self) -> None: ... def clear_expired_cookies(self) -> None: ... # undocumented def __iter__(self) -> Iterator[Cookie]: ... @@ -45,20 +45,22 @@ class FileCookieJar(CookieJar): filename: str delayload: bool if sys.version_info >= (3, 8): - def __init__(self, filename: StrPath | None = ..., delayload: bool = ..., policy: CookiePolicy | None = ...) -> None: ... + def __init__( + self, filename: StrPath | None = None, delayload: bool = False, policy: CookiePolicy | None = None + ) -> None: ... else: - def __init__(self, filename: str | None = ..., delayload: bool = ..., policy: CookiePolicy | None = ...) -> None: ... + def __init__(self, filename: str | None = None, delayload: bool = False, policy: CookiePolicy | None = None) -> None: ... - def save(self, filename: str | None = ..., ignore_discard: bool = ..., ignore_expires: bool = ...) -> None: ... - def load(self, filename: str | None = ..., ignore_discard: bool = ..., ignore_expires: bool = ...) -> None: ... - def revert(self, filename: str | None = ..., ignore_discard: bool = ..., ignore_expires: bool = ...) -> None: ... + def save(self, filename: str | None = None, ignore_discard: bool = False, ignore_expires: bool = False) -> None: ... + def load(self, filename: str | None = None, ignore_discard: bool = False, ignore_expires: bool = False) -> None: ... + def revert(self, filename: str | None = None, ignore_discard: bool = False, ignore_expires: bool = False) -> None: ... class MozillaCookieJar(FileCookieJar): if sys.version_info < (3, 10): header: ClassVar[str] # undocumented class LWPCookieJar(FileCookieJar): - def as_lwp_str(self, ignore_discard: bool = ..., ignore_expires: bool = ...) -> str: ... # undocumented + def as_lwp_str(self, ignore_discard: bool = True, ignore_expires: bool = True) -> str: ... # undocumented class CookiePolicy: netscape: bool @@ -85,35 +87,35 @@ class DefaultCookiePolicy(CookiePolicy): if sys.version_info >= (3, 8): def __init__( self, - blocked_domains: Sequence[str] | None = ..., - allowed_domains: Sequence[str] | None = ..., - netscape: bool = ..., - rfc2965: bool = ..., - rfc2109_as_netscape: bool | None = ..., - hide_cookie2: bool = ..., - strict_domain: bool = ..., - strict_rfc2965_unverifiable: bool = ..., - strict_ns_unverifiable: bool = ..., - strict_ns_domain: int = ..., - strict_ns_set_initial_dollar: bool = ..., - strict_ns_set_path: bool = ..., + blocked_domains: Sequence[str] | None = None, + allowed_domains: Sequence[str] | None = None, + netscape: bool = True, + rfc2965: bool = False, + rfc2109_as_netscape: bool | None = None, + hide_cookie2: bool = False, + strict_domain: bool = False, + strict_rfc2965_unverifiable: bool = True, + strict_ns_unverifiable: bool = False, + strict_ns_domain: int = 0, + strict_ns_set_initial_dollar: bool = False, + strict_ns_set_path: bool = False, secure_protocols: Sequence[str] = ..., ) -> None: ... else: def __init__( self, - blocked_domains: Sequence[str] | None = ..., - allowed_domains: Sequence[str] | None = ..., - netscape: bool = ..., - rfc2965: bool = ..., - rfc2109_as_netscape: bool | None = ..., - hide_cookie2: bool = ..., - strict_domain: bool = ..., - strict_rfc2965_unverifiable: bool = ..., - strict_ns_unverifiable: bool = ..., - strict_ns_domain: int = ..., - strict_ns_set_initial_dollar: bool = ..., - strict_ns_set_path: bool = ..., + blocked_domains: Sequence[str] | None = None, + allowed_domains: Sequence[str] | None = None, + netscape: bool = True, + rfc2965: bool = False, + rfc2109_as_netscape: bool | None = None, + hide_cookie2: bool = False, + strict_domain: bool = False, + strict_rfc2965_unverifiable: bool = True, + strict_ns_unverifiable: bool = False, + strict_ns_domain: int = 0, + strict_ns_set_initial_dollar: bool = False, + strict_ns_set_path: bool = False, ) -> None: ... def blocked_domains(self) -> tuple[str, ...]: ... @@ -170,7 +172,7 @@ class Cookie: comment: str | None, comment_url: str | None, rest: dict[str, str], - rfc2109: bool = ..., + rfc2109: bool = False, ) -> None: ... def has_nonstandard_attr(self, name: str) -> bool: ... @overload @@ -178,4 +180,4 @@ class Cookie: @overload def get_nonstandard_attr(self, name: str, default: _T) -> str | _T: ... def set_nonstandard_attr(self, name: str, value: str) -> None: ... - def is_expired(self, now: int | None = ...) -> bool: ... + def is_expired(self, now: int | None = None) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/http/cookies.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/http/cookies.pyi index e2fe44d30..e24ef9cbd 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/http/cookies.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/http/cookies.pyi @@ -31,29 +31,29 @@ class Morsel(dict[str, Any], Generic[_T]): def key(self) -> str: ... def __init__(self) -> None: ... def set(self, key: str, val: str, coded_val: _T) -> None: ... - def setdefault(self, key: str, val: str | None = ...) -> str: ... + def setdefault(self, key: str, val: str | None = None) -> str: ... # The dict update can also get a keywords argument so this is incompatible @overload # type: ignore[override] def update(self, values: Mapping[str, str]) -> None: ... @overload def update(self, values: Iterable[tuple[str, str]]) -> None: ... def isReservedKey(self, K: str) -> bool: ... - def output(self, attrs: list[str] | None = ..., header: str = ...) -> str: ... + def output(self, attrs: list[str] | None = None, header: str = "Set-Cookie:") -> str: ... __str__ = output - def js_output(self, attrs: list[str] | None = ...) -> str: ... - def OutputString(self, attrs: list[str] | None = ...) -> str: ... + def js_output(self, attrs: list[str] | None = None) -> str: ... + def OutputString(self, attrs: list[str] | None = None) -> str: ... def __eq__(self, morsel: object) -> bool: ... def __setitem__(self, K: str, V: Any) -> None: ... if sys.version_info >= (3, 9): def __class_getitem__(cls, item: Any) -> GenericAlias: ... class BaseCookie(dict[str, Morsel[_T]], Generic[_T]): - def __init__(self, input: _DataType | None = ...) -> None: ... + def __init__(self, input: _DataType | None = None) -> None: ... def value_decode(self, val: str) -> _T: ... def value_encode(self, val: _T) -> str: ... - def output(self, attrs: list[str] | None = ..., header: str = ..., sep: str = ...) -> str: ... + def output(self, attrs: list[str] | None = None, header: str = "Set-Cookie:", sep: str = "\r\n") -> str: ... __str__ = output - def js_output(self, attrs: list[str] | None = ...) -> str: ... + def js_output(self, attrs: list[str] | None = None) -> str: ... def load(self, rawdata: _DataType) -> None: ... def __setitem__(self, key: str, value: str | Morsel[_T]) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/http/server.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/http/server.pyi index e73497bb1..c9700f70e 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/http/server.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/http/server.pyi @@ -1,6 +1,8 @@ +import _socket import email.message import io import socketserver +import sys from _typeshed import StrPath, SupportsRead, SupportsWrite from collections.abc import Mapping, Sequence from typing import Any, AnyStr, BinaryIO, ClassVar @@ -11,12 +13,10 @@ class HTTPServer(socketserver.TCPServer): server_name: str server_port: int -class ThreadingHTTPServer(socketserver.ThreadingMixIn, HTTPServer): - daemon_threads: bool # undocumented +class ThreadingHTTPServer(socketserver.ThreadingMixIn, HTTPServer): ... class BaseHTTPRequestHandler(socketserver.StreamRequestHandler): client_address: tuple[str, int] - server: socketserver.BaseServer close_connection: bool requestline: str command: str @@ -33,30 +33,34 @@ class BaseHTTPRequestHandler(socketserver.StreamRequestHandler): default_request_version: str # undocumented weekdayname: ClassVar[Sequence[str]] # undocumented monthname: ClassVar[Sequence[str | None]] # undocumented - def __init__(self, request: bytes, client_address: tuple[str, int], server: socketserver.BaseServer) -> None: ... - def handle(self) -> None: ... def handle_one_request(self) -> None: ... def handle_expect_100(self) -> bool: ... - def send_error(self, code: int, message: str | None = ..., explain: str | None = ...) -> None: ... - def send_response(self, code: int, message: str | None = ...) -> None: ... + def send_error(self, code: int, message: str | None = None, explain: str | None = None) -> None: ... + def send_response(self, code: int, message: str | None = None) -> None: ... def send_header(self, keyword: str, value: str) -> None: ... - def send_response_only(self, code: int, message: str | None = ...) -> None: ... + def send_response_only(self, code: int, message: str | None = None) -> None: ... def end_headers(self) -> None: ... def flush_headers(self) -> None: ... - def log_request(self, code: int | str = ..., size: int | str = ...) -> None: ... + def log_request(self, code: int | str = "-", size: int | str = "-") -> None: ... def log_error(self, format: str, *args: Any) -> None: ... def log_message(self, format: str, *args: Any) -> None: ... def version_string(self) -> str: ... - def date_time_string(self, timestamp: int | None = ...) -> str: ... + def date_time_string(self, timestamp: int | None = None) -> str: ... def log_date_time_string(self) -> str: ... def address_string(self) -> str: ... def parse_request(self) -> bool: ... # undocumented class SimpleHTTPRequestHandler(BaseHTTPRequestHandler): - server_version: str extensions_map: dict[str, str] + if sys.version_info >= (3, 12): + index_pages: ClassVar[tuple[str, ...]] def __init__( - self, request: bytes, client_address: tuple[str, int], server: socketserver.BaseServer, directory: str | None = ... + self, + request: socketserver._RequestType, + client_address: _socket._RetAddress, + server: socketserver.BaseServer, + *, + directory: str | None = None, ) -> None: ... def do_GET(self) -> None: ... def do_HEAD(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/imaplib.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/imaplib.pyi index a313b20a9..1c2112dd3 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/imaplib.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/imaplib.pyi @@ -1,15 +1,16 @@ import subprocess import sys import time -from _typeshed import Self +from _typeshed import ReadableBuffer, _BufferWithLen from builtins import list as _list # conflicts with a method named "list" from collections.abc import Callable +from datetime import datetime from re import Pattern from socket import socket as _socket from ssl import SSLContext, SSLSocket from types import TracebackType -from typing import IO, Any -from typing_extensions import Literal, TypeAlias +from typing import IO, Any, SupportsAbs, SupportsInt +from typing_extensions import Literal, Self, TypeAlias __all__ = ["IMAP4", "IMAP4_stream", "Internaldate2tuple", "Int2AP", "ParseFlags", "Time2Internaldate", "IMAP4_SSL"] @@ -40,11 +41,11 @@ class IMAP4: capabilities: tuple[str, ...] PROTOCOL_VERSION: str if sys.version_info >= (3, 9): - def __init__(self, host: str = ..., port: int = ..., timeout: float | None = ...) -> None: ... - def open(self, host: str = ..., port: int = ..., timeout: float | None = ...) -> None: ... + def __init__(self, host: str = "", port: int = 143, timeout: float | None = None) -> None: ... + def open(self, host: str = "", port: int = 143, timeout: float | None = None) -> None: ... else: - def __init__(self, host: str = ..., port: int = ...) -> None: ... - def open(self, host: str = ..., port: int = ...) -> None: ... + def __init__(self, host: str = "", port: int = 143) -> None: ... + def open(self, host: str = "", port: int = 143) -> None: ... def __getattr__(self, attr: str) -> Any: ... host: str @@ -53,12 +54,12 @@ class IMAP4: file: IO[str] | IO[bytes] def read(self, size: int) -> bytes: ... def readline(self) -> bytes: ... - def send(self, data: bytes) -> None: ... + def send(self, data: ReadableBuffer) -> None: ... def shutdown(self) -> None: ... def socket(self) -> _socket: ... def recent(self) -> _CommandResults: ... def response(self, code: str) -> _CommandResults: ... - def append(self, mailbox: str, flags: str, date_time: str, message: bytes) -> str: ... + def append(self, mailbox: str, flags: str, date_time: str, message: ReadableBuffer) -> str: ... def authenticate(self, mechanism: str, authobject: Callable[[bytes], bytes | None]) -> tuple[str, str]: ... def capability(self) -> _CommandResults: ... def check(self) -> _CommandResults: ... @@ -68,7 +69,7 @@ class IMAP4: def delete(self, mailbox: str) -> _CommandResults: ... def deleteacl(self, mailbox: str, who: str) -> _CommandResults: ... def enable(self, capability: str) -> _CommandResults: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__(self, t: type[BaseException] | None, v: BaseException | None, tb: TracebackType | None) -> None: ... def expunge(self) -> _CommandResults: ... def fetch(self, message_set: str, message_parts: str) -> tuple[str, _AnyResponseData]: ... @@ -76,11 +77,11 @@ class IMAP4: def getannotation(self, mailbox: str, entry: str, attribute: str) -> _CommandResults: ... def getquota(self, root: str) -> _CommandResults: ... def getquotaroot(self, mailbox: str) -> _CommandResults: ... - def list(self, directory: str = ..., pattern: str = ...) -> tuple[str, _AnyResponseData]: ... + def list(self, directory: str = '""', pattern: str = "*") -> tuple[str, _AnyResponseData]: ... def login(self, user: str, password: str) -> tuple[Literal["OK"], _list[bytes]]: ... def login_cram_md5(self, user: str, password: str) -> _CommandResults: ... def logout(self) -> tuple[str, _AnyResponseData]: ... - def lsub(self, directory: str = ..., pattern: str = ...) -> _CommandResults: ... + def lsub(self, directory: str = '""', pattern: str = "*") -> _CommandResults: ... def myrights(self, mailbox: str) -> _CommandResults: ... def namespace(self) -> _CommandResults: ... def noop(self) -> tuple[str, _list[bytes]]: ... @@ -88,12 +89,12 @@ class IMAP4: def proxyauth(self, user: str) -> _CommandResults: ... def rename(self, oldmailbox: str, newmailbox: str) -> _CommandResults: ... def search(self, charset: str | None, *criteria: str) -> _CommandResults: ... - def select(self, mailbox: str = ..., readonly: bool = ...) -> tuple[str, _list[bytes | None]]: ... + def select(self, mailbox: str = "INBOX", readonly: bool = False) -> tuple[str, _list[bytes | None]]: ... def setacl(self, mailbox: str, who: str, what: str) -> _CommandResults: ... def setannotation(self, *args: str) -> _CommandResults: ... def setquota(self, root: str, limits: str) -> _CommandResults: ... def sort(self, sort_criteria: str, charset: str, *search_criteria: str) -> _CommandResults: ... - def starttls(self, ssl_context: Any | None = ...) -> tuple[Literal["OK"], _list[None]]: ... + def starttls(self, ssl_context: Any | None = None) -> tuple[Literal["OK"], _list[None]]: ... def status(self, mailbox: str, names: str) -> _CommandResults: ... def store(self, message_set: str, command: str, flags: str) -> _CommandResults: ... def subscribe(self, mailbox: str) -> _CommandResults: ... @@ -112,67 +113,51 @@ class IMAP4_SSL(IMAP4): if sys.version_info >= (3, 9): def __init__( self, - host: str = ..., - port: int = ..., - keyfile: str | None = ..., - certfile: str | None = ..., - ssl_context: SSLContext | None = ..., - timeout: float | None = ..., + host: str = "", + port: int = 993, + keyfile: str | None = None, + certfile: str | None = None, + ssl_context: SSLContext | None = None, + timeout: float | None = None, ) -> None: ... else: def __init__( self, - host: str = ..., - port: int = ..., - keyfile: str | None = ..., - certfile: str | None = ..., - ssl_context: SSLContext | None = ..., + host: str = "", + port: int = 993, + keyfile: str | None = None, + certfile: str | None = None, + ssl_context: SSLContext | None = None, ) -> None: ... - host: str - port: int - sock: _socket sslobj: SSLSocket file: IO[Any] if sys.version_info >= (3, 9): - def open(self, host: str = ..., port: int | None = ..., timeout: float | None = ...) -> None: ... + def open(self, host: str = "", port: int | None = 993, timeout: float | None = None) -> None: ... else: - def open(self, host: str = ..., port: int | None = ...) -> None: ... + def open(self, host: str = "", port: int | None = 993) -> None: ... - def read(self, size: int) -> bytes: ... - def readline(self) -> bytes: ... - def send(self, data: bytes) -> None: ... - def shutdown(self) -> None: ... - def socket(self) -> _socket: ... def ssl(self) -> SSLSocket: ... class IMAP4_stream(IMAP4): command: str def __init__(self, command: str) -> None: ... - host: str - port: int - sock: _socket file: IO[Any] process: subprocess.Popen[bytes] writefile: IO[Any] readfile: IO[Any] if sys.version_info >= (3, 9): - def open(self, host: str | None = ..., port: int | None = ..., timeout: float | None = ...) -> None: ... + def open(self, host: str | None = None, port: int | None = None, timeout: float | None = None) -> None: ... else: - def open(self, host: str | None = ..., port: int | None = ...) -> None: ... - - def read(self, size: int) -> bytes: ... - def readline(self) -> bytes: ... - def send(self, data: bytes) -> None: ... - def shutdown(self) -> None: ... + def open(self, host: str | None = None, port: int | None = None) -> None: ... class _Authenticator: - mech: Callable[[bytes], bytes] - def __init__(self, mechinst: Callable[[bytes], bytes]) -> None: ... + mech: Callable[[bytes], bytes | bytearray | memoryview | str | None] + def __init__(self, mechinst: Callable[[bytes], bytes | bytearray | memoryview | str | None]) -> None: ... def process(self, data: str) -> str: ... - def encode(self, inp: bytes) -> str: ... - def decode(self, inp: str) -> bytes: ... + def encode(self, inp: bytes | bytearray | memoryview) -> str: ... + def decode(self, inp: str | _BufferWithLen) -> bytes: ... -def Internaldate2tuple(resp: bytes) -> time.struct_time: ... -def Int2AP(num: int) -> str: ... -def ParseFlags(resp: bytes) -> tuple[bytes, ...]: ... -def Time2Internaldate(date_time: float | time.struct_time | str) -> str: ... +def Internaldate2tuple(resp: ReadableBuffer) -> time.struct_time | None: ... +def Int2AP(num: SupportsAbs[SupportsInt]) -> bytes: ... +def ParseFlags(resp: ReadableBuffer) -> tuple[bytes, ...]: ... +def Time2Internaldate(date_time: float | time.struct_time | time._TimeTuple | datetime | str) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/imghdr.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/imghdr.pyi index 5f439779a..ed3647f20 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/imghdr.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/imghdr.pyi @@ -10,7 +10,7 @@ class _ReadableBinary(Protocol): def seek(self, offset: int) -> Any: ... @overload -def what(file: StrPath | _ReadableBinary, h: None = ...) -> str | None: ... +def what(file: StrPath | _ReadableBinary, h: None = None) -> str | None: ... @overload def what(file: Any, h: bytes) -> str | None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/imp.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/imp.pyi index 3054a4465..3f2920de9 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/imp.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/imp.pyi @@ -1,9 +1,4 @@ import types -from _typeshed import StrPath -from os import PathLike -from types import TracebackType -from typing import IO, Any, Protocol - from _imp import ( acquire_lock as acquire_lock, create_dynamic as create_dynamic, @@ -15,6 +10,10 @@ from _imp import ( lock_held as lock_held, release_lock as release_lock, ) +from _typeshed import StrPath +from os import PathLike +from types import TracebackType +from typing import IO, Any, Protocol SEARCH_ERROR: int PY_SOURCE: int @@ -30,7 +29,7 @@ IMP_HOOK: int def new_module(name: str) -> types.ModuleType: ... def get_magic() -> bytes: ... def get_tag() -> str: ... -def cache_from_source(path: StrPath, debug_override: bool | None = ...) -> str: ... +def cache_from_source(path: StrPath, debug_override: bool | None = None) -> str: ... def source_from_cache(path: StrPath) -> str: ... def get_suffixes() -> list[tuple[str, str, int]]: ... @@ -49,15 +48,15 @@ class _FileLike(Protocol): def __exit__(self, typ: type[BaseException] | None, exc: BaseException | None, tb: TracebackType | None) -> Any: ... # PathLike doesn't work for the pathname argument here -def load_source(name: str, pathname: str, file: _FileLike | None = ...) -> types.ModuleType: ... -def load_compiled(name: str, pathname: str, file: _FileLike | None = ...) -> types.ModuleType: ... +def load_source(name: str, pathname: str, file: _FileLike | None = None) -> types.ModuleType: ... +def load_compiled(name: str, pathname: str, file: _FileLike | None = None) -> types.ModuleType: ... def load_package(name: str, path: StrPath) -> types.ModuleType: ... def load_module(name: str, file: _FileLike | None, filename: str, details: tuple[str, str, int]) -> types.ModuleType: ... # IO[Any] is a TextIOWrapper if name is a .py file, and a FileIO otherwise. def find_module( - name: str, path: None | list[str] | list[PathLike[str]] | list[StrPath] = ... + name: str, path: None | list[str] | list[PathLike[str]] | list[StrPath] = None ) -> tuple[IO[Any], str, tuple[str, str, int]]: ... def reload(module: types.ModuleType) -> types.ModuleType: ... def init_builtin(name: str) -> types.ModuleType | None: ... -def load_dynamic(name: str, path: str, file: Any = ...) -> types.ModuleType: ... # file argument is ignored +def load_dynamic(name: str, path: str, file: Any = None) -> types.ModuleType: ... # file argument is ignored diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/importlib/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/importlib/__init__.pyi index 42401a00b..1747b2741 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/importlib/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/importlib/__init__.pyi @@ -7,14 +7,14 @@ __all__ = ["__import__", "import_module", "invalidate_caches", "reload"] # Signature of `builtins.__import__` should be kept identical to `importlib.__import__` def __import__( name: str, - globals: Mapping[str, object] | None = ..., - locals: Mapping[str, object] | None = ..., + globals: Mapping[str, object] | None = None, + locals: Mapping[str, object] | None = None, fromlist: Sequence[str] = ..., - level: int = ..., + level: int = 0, ) -> ModuleType: ... # `importlib.import_module` return type should be kept the same as `builtins.__import__` -def import_module(name: str, package: str | None = ...) -> ModuleType: ... -def find_loader(name: str, path: str | None = ...) -> Loader | None: ... +def import_module(name: str, package: str | None = None) -> ModuleType: ... +def find_loader(name: str, path: str | None = None) -> Loader | None: ... def invalidate_caches() -> None: ... def reload(module: ModuleType) -> ModuleType: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/importlib/abc.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/importlib/abc.pyi index b46d42a41..4bf46104b 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/importlib/abc.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/importlib/abc.pyi @@ -1,3 +1,4 @@ +import _ast import sys import types from _typeshed import ( @@ -6,7 +7,7 @@ from _typeshed import ( OpenBinaryModeUpdating, OpenBinaryModeWriting, OpenTextMode, - StrOrBytesPath, + ReadableBuffer, StrPath, ) from abc import ABCMeta, abstractmethod @@ -14,7 +15,7 @@ from collections.abc import Iterator, Mapping, Sequence from importlib.machinery import ModuleSpec from io import BufferedRandom, BufferedReader, BufferedWriter, FileIO, TextIOWrapper from typing import IO, Any, BinaryIO, NoReturn, Protocol, overload, runtime_checkable -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal if sys.version_info >= (3, 11): __all__ = [ @@ -32,72 +33,70 @@ if sys.version_info >= (3, 11): "TraversableResources", ] -_Path: TypeAlias = bytes | str - class Finder(metaclass=ABCMeta): ... +class Loader(metaclass=ABCMeta): + def load_module(self, fullname: str) -> types.ModuleType: ... + def module_repr(self, module: types.ModuleType) -> str: ... + def create_module(self, spec: ModuleSpec) -> types.ModuleType | None: ... + # Not defined on the actual class for backwards-compatibility reasons, + # but expected in new code. + def exec_module(self, module: types.ModuleType) -> None: ... + class ResourceLoader(Loader): @abstractmethod - def get_data(self, path: _Path) -> bytes: ... + def get_data(self, path: str) -> bytes: ... class InspectLoader(Loader): def is_package(self, fullname: str) -> bool: ... def get_code(self, fullname: str) -> types.CodeType | None: ... - def load_module(self, fullname: str) -> types.ModuleType: ... @abstractmethod def get_source(self, fullname: str) -> str | None: ... def exec_module(self, module: types.ModuleType) -> None: ... @staticmethod - def source_to_code(data: bytes | str, path: str = ...) -> types.CodeType: ... + def source_to_code( + data: ReadableBuffer | str | _ast.Module | _ast.Expression | _ast.Interactive, path: ReadableBuffer | StrPath = "" + ) -> types.CodeType: ... class ExecutionLoader(InspectLoader): @abstractmethod - def get_filename(self, fullname: str) -> _Path: ... - def get_code(self, fullname: str) -> types.CodeType | None: ... + def get_filename(self, fullname: str) -> str: ... class SourceLoader(ResourceLoader, ExecutionLoader, metaclass=ABCMeta): - def path_mtime(self, path: _Path) -> float: ... - def set_data(self, path: _Path, data: bytes) -> None: ... + def path_mtime(self, path: str) -> float: ... + def set_data(self, path: str, data: bytes) -> None: ... def get_source(self, fullname: str) -> str | None: ... - def path_stats(self, path: _Path) -> Mapping[str, Any]: ... + def path_stats(self, path: str) -> Mapping[str, Any]: ... # Please keep in sync with sys._MetaPathFinder class MetaPathFinder(Finder): - def find_module(self, fullname: str, path: Sequence[_Path] | None) -> Loader | None: ... + def find_module(self, fullname: str, path: Sequence[str] | None) -> Loader | None: ... def invalidate_caches(self) -> None: ... # Not defined on the actual class, but expected to exist. def find_spec( - self, fullname: str, path: Sequence[_Path] | None, target: types.ModuleType | None = ... + self, fullname: str, path: Sequence[str] | None, target: types.ModuleType | None = ... ) -> ModuleSpec | None: ... class PathEntryFinder(Finder): def find_module(self, fullname: str) -> Loader | None: ... - def find_loader(self, fullname: str) -> tuple[Loader | None, Sequence[_Path]]: ... + def find_loader(self, fullname: str) -> tuple[Loader | None, Sequence[str]]: ... def invalidate_caches(self) -> None: ... # Not defined on the actual class, but expected to exist. def find_spec(self, fullname: str, target: types.ModuleType | None = ...) -> ModuleSpec | None: ... -class Loader(metaclass=ABCMeta): - def load_module(self, fullname: str) -> types.ModuleType: ... - def module_repr(self, module: types.ModuleType) -> str: ... - def create_module(self, spec: ModuleSpec) -> types.ModuleType | None: ... - # Not defined on the actual class for backwards-compatibility reasons, - # but expected in new code. - def exec_module(self, module: types.ModuleType) -> None: ... - class FileLoader(ResourceLoader, ExecutionLoader, metaclass=ABCMeta): name: str - path: _Path - def __init__(self, fullname: str, path: _Path) -> None: ... - def get_data(self, path: _Path) -> bytes: ... - def get_filename(self, name: str | None = ...) -> _Path: ... - def load_module(self, name: str | None = ...) -> types.ModuleType: ... + path: str + def __init__(self, fullname: str, path: str) -> None: ... + def get_data(self, path: str) -> bytes: ... + def get_filename(self, name: str | None = None) -> str: ... + def load_module(self, name: str | None = None) -> types.ModuleType: ... class ResourceReader(metaclass=ABCMeta): @abstractmethod - def open_resource(self, resource: StrOrBytesPath) -> IO[bytes]: ... + def open_resource(self, resource: str) -> IO[bytes]: ... @abstractmethod - def resource_path(self, resource: StrOrBytesPath) -> str: ... + def resource_path(self, resource: str) -> str: ... if sys.version_info >= (3, 10): @abstractmethod def is_resource(self, path: str) -> bool: ... @@ -117,14 +116,18 @@ if sys.version_info >= (3, 9): def is_file(self) -> bool: ... @abstractmethod def iterdir(self) -> Iterator[Traversable]: ... - @abstractmethod - def joinpath(self, child: StrPath) -> Traversable: ... + if sys.version_info >= (3, 11): + @abstractmethod + def joinpath(self, *descendants: str) -> Traversable: ... + else: + @abstractmethod + def joinpath(self, child: str) -> Traversable: ... # The .open method comes from pathlib.pyi and should be kept in sync. @overload @abstractmethod def open( self, - mode: OpenTextMode = ..., + mode: OpenTextMode = "r", buffering: int = ..., encoding: str | None = ..., errors: str | None = ..., @@ -134,7 +137,7 @@ if sys.version_info >= (3, 9): @overload @abstractmethod def open( - self, mode: OpenBinaryMode, buffering: Literal[0], encoding: None = ..., errors: None = ..., newline: None = ... + self, mode: OpenBinaryMode, buffering: Literal[0], encoding: None = None, errors: None = None, newline: None = None ) -> FileIO: ... # Buffering is on: return BufferedRandom, BufferedReader, or BufferedWriter @overload @@ -143,9 +146,9 @@ if sys.version_info >= (3, 9): self, mode: OpenBinaryModeUpdating, buffering: Literal[-1, 1] = ..., - encoding: None = ..., - errors: None = ..., - newline: None = ..., + encoding: None = None, + errors: None = None, + newline: None = None, ) -> BufferedRandom: ... @overload @abstractmethod @@ -153,9 +156,9 @@ if sys.version_info >= (3, 9): self, mode: OpenBinaryModeWriting, buffering: Literal[-1, 1] = ..., - encoding: None = ..., - errors: None = ..., - newline: None = ..., + encoding: None = None, + errors: None = None, + newline: None = None, ) -> BufferedWriter: ... @overload @abstractmethod @@ -163,15 +166,15 @@ if sys.version_info >= (3, 9): self, mode: OpenBinaryModeReading, buffering: Literal[-1, 1] = ..., - encoding: None = ..., - errors: None = ..., - newline: None = ..., + encoding: None = None, + errors: None = None, + newline: None = None, ) -> BufferedReader: ... # Buffering cannot be determined: fall back to BinaryIO @overload @abstractmethod def open( - self, mode: OpenBinaryMode, buffering: int = ..., encoding: None = ..., errors: None = ..., newline: None = ... + self, mode: OpenBinaryMode, buffering: int = ..., encoding: None = None, errors: None = None, newline: None = None ) -> BinaryIO: ... # Fallback if mode is not specified @overload @@ -180,18 +183,19 @@ if sys.version_info >= (3, 9): self, mode: str, buffering: int = ..., encoding: str | None = ..., errors: str | None = ..., newline: str | None = ... ) -> IO[Any]: ... @property + @abstractmethod def name(self) -> str: ... @abstractmethod - def __truediv__(self, child: StrPath) -> Traversable: ... + def __truediv__(self, child: str) -> Traversable: ... @abstractmethod def read_bytes(self) -> bytes: ... @abstractmethod - def read_text(self, encoding: str | None = ...) -> str: ... + def read_text(self, encoding: str | None = None) -> str: ... class TraversableResources(ResourceReader): @abstractmethod def files(self) -> Traversable: ... - def open_resource(self, resource: StrPath) -> BufferedReader: ... # type: ignore[override] + def open_resource(self, resource: str) -> BufferedReader: ... def resource_path(self, resource: Any) -> NoReturn: ... - def is_resource(self, path: StrPath) -> bool: ... + def is_resource(self, path: str) -> bool: ... def contents(self) -> Iterator[str]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/importlib/machinery.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/importlib/machinery.pyi index 09abdc6f3..5aaefce87 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/importlib/machinery.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/importlib/machinery.pyi @@ -1,6 +1,7 @@ import importlib.abc import sys import types +from _typeshed import ReadableBuffer from collections.abc import Callable, Iterable, Sequence from typing import Any @@ -13,9 +14,9 @@ class ModuleSpec: name: str, loader: importlib.abc.Loader | None, *, - origin: str | None = ..., - loader_state: Any = ..., - is_package: bool | None = ..., + origin: str | None = None, + loader_state: Any = None, + is_package: bool | None = None, ) -> None: ... name: str loader: importlib.abc.Loader | None @@ -31,10 +32,10 @@ class ModuleSpec: class BuiltinImporter(importlib.abc.MetaPathFinder, importlib.abc.InspectLoader): # MetaPathFinder @classmethod - def find_module(cls, fullname: str, path: Sequence[importlib.abc._Path] | None = ...) -> importlib.abc.Loader | None: ... + def find_module(cls, fullname: str, path: Sequence[str] | None = None) -> importlib.abc.Loader | None: ... @classmethod def find_spec( - cls, fullname: str, path: Sequence[importlib.abc._Path] | None = ..., target: types.ModuleType | None = ... + cls, fullname: str, path: Sequence[str] | None = None, target: types.ModuleType | None = None ) -> ModuleSpec | None: ... # InspectLoader @classmethod @@ -62,10 +63,10 @@ class BuiltinImporter(importlib.abc.MetaPathFinder, importlib.abc.InspectLoader) class FrozenImporter(importlib.abc.MetaPathFinder, importlib.abc.InspectLoader): # MetaPathFinder @classmethod - def find_module(cls, fullname: str, path: Sequence[importlib.abc._Path] | None = ...) -> importlib.abc.Loader | None: ... + def find_module(cls, fullname: str, path: Sequence[str] | None = None) -> importlib.abc.Loader | None: ... @classmethod def find_spec( - cls, fullname: str, path: Sequence[importlib.abc._Path] | None = ..., target: types.ModuleType | None = ... + cls, fullname: str, path: Sequence[str] | None = None, target: types.ModuleType | None = None ) -> ModuleSpec | None: ... # InspectLoader @classmethod @@ -91,10 +92,10 @@ class FrozenImporter(importlib.abc.MetaPathFinder, importlib.abc.InspectLoader): class WindowsRegistryFinder(importlib.abc.MetaPathFinder): @classmethod - def find_module(cls, fullname: str, path: Sequence[importlib.abc._Path] | None = ...) -> importlib.abc.Loader | None: ... + def find_module(cls, fullname: str, path: Sequence[str] | None = None) -> importlib.abc.Loader | None: ... @classmethod def find_spec( - cls, fullname: str, path: Sequence[importlib.abc._Path] | None = ..., target: types.ModuleType | None = ... + cls, fullname: str, path: Sequence[str] | None = None, target: types.ModuleType | None = None ) -> ModuleSpec | None: ... class PathFinder: @@ -113,10 +114,10 @@ class PathFinder: @classmethod def find_spec( - cls, fullname: str, path: Sequence[bytes | str] | None = ..., target: types.ModuleType | None = ... + cls, fullname: str, path: Sequence[str] | None = None, target: types.ModuleType | None = None ) -> ModuleSpec | None: ... @classmethod - def find_module(cls, fullname: str, path: Sequence[bytes | str] | None = ...) -> importlib.abc.Loader | None: ... + def find_module(cls, fullname: str, path: Sequence[str] | None = None) -> importlib.abc.Loader | None: ... SOURCE_SUFFIXES: list[str] DEBUG_BYTECODE_SUFFIXES: list[str] @@ -135,16 +136,15 @@ class FileFinder(importlib.abc.PathEntryFinder): ) -> Callable[[str], importlib.abc.PathEntryFinder]: ... class SourceFileLoader(importlib.abc.FileLoader, importlib.abc.SourceLoader): - def set_data(self, path: importlib.abc._Path, data: bytes, *, _mode: int = ...) -> None: ... + def set_data(self, path: str, data: ReadableBuffer, *, _mode: int = 0o666) -> None: ... class SourcelessFileLoader(importlib.abc.FileLoader, importlib.abc.SourceLoader): ... class ExtensionFileLoader(importlib.abc.ExecutionLoader): - def __init__(self, name: str, path: importlib.abc._Path) -> None: ... - def get_filename(self, name: str | None = ...) -> importlib.abc._Path: ... + def __init__(self, name: str, path: str) -> None: ... + def get_filename(self, name: str | None = None) -> str: ... def get_source(self, fullname: str) -> None: ... def create_module(self, spec: ModuleSpec) -> types.ModuleType: ... def exec_module(self, module: types.ModuleType) -> None: ... - def is_package(self, fullname: str) -> bool: ... def get_code(self, fullname: str) -> None: ... def __eq__(self, other: object) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/importlib/metadata/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/importlib/metadata/__init__.pyi index 99fecb414..083453cd3 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/importlib/metadata/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/importlib/metadata/__init__.pyi @@ -1,7 +1,7 @@ import abc import pathlib import sys -from _typeshed import Self, StrPath +from _typeshed import StrPath from collections.abc import Iterable, Mapping from email.message import Message from importlib.abc import MetaPathFinder @@ -9,6 +9,7 @@ from os import PathLike from pathlib import Path from re import Pattern from typing import Any, ClassVar, NamedTuple, overload +from typing_extensions import Self __all__ = [ "Distribution", @@ -41,6 +42,9 @@ class _EntryPointBase(NamedTuple): class EntryPoint(_EntryPointBase): pattern: ClassVar[Pattern[str]] + if sys.version_info >= (3, 11): + def __init__(self, name: str, value: str, group: str) -> None: ... + def load(self) -> Any: ... # Callable[[], Any] or an importable module @property def extras(self) -> list[str]: ... @@ -83,13 +87,13 @@ if sys.version_info >= (3, 10): class SelectableGroups(dict[str, EntryPoints]): # use as dict is deprecated since 3.10 @classmethod - def load(cls: type[Self], eps: Iterable[EntryPoint]) -> Self: ... + def load(cls, eps: Iterable[EntryPoint]) -> Self: ... @property def groups(self) -> set[str]: ... @property def names(self) -> set[str]: ... @overload - def select(self: Self) -> Self: ... # type: ignore[misc] + def select(self) -> Self: ... # type: ignore[misc] @overload def select( self, @@ -103,7 +107,7 @@ if sys.version_info >= (3, 10): ) -> EntryPoints: ... class PackagePath(pathlib.PurePosixPath): - def read_text(self, encoding: str = ...) -> str: ... + def read_text(self, encoding: str = "utf-8") -> str: ... def read_binary(self) -> bytes: ... def locate(self) -> PathLike[str]: ... # The following attributes are not defined on PackagePath, but are dynamically added by Distribution.files: @@ -129,7 +133,7 @@ class Distribution: @overload @classmethod def discover( - cls, *, context: None = ..., name: str | None = ..., path: list[str] = ..., **kwargs: Any + cls, *, context: None = None, name: str | None = ..., path: list[str] = ..., **kwargs: Any ) -> Iterable[Distribution]: ... @staticmethod def at(path: StrPath) -> PathDistribution: ... @@ -182,7 +186,7 @@ def distribution(distribution_name: str) -> Distribution: ... def distributions(*, context: DistributionFinder.Context) -> Iterable[Distribution]: ... @overload def distributions( - *, context: None = ..., name: str | None = ..., path: list[str] = ..., **kwargs: Any + *, context: None = None, name: str | None = ..., path: list[str] = ..., **kwargs: Any ) -> Iterable[Distribution]: ... if sys.version_info >= (3, 10): diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/importlib/resources.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/importlib/resources.pyi deleted file mode 100644 index 28ca107f4..000000000 --- a/packages/pyright-internal/typeshed-fallback/stdlib/importlib/resources.pyi +++ /dev/null @@ -1,39 +0,0 @@ -import os -import sys -from collections.abc import Iterator -from contextlib import AbstractContextManager -from pathlib import Path -from types import ModuleType -from typing import Any, BinaryIO, TextIO -from typing_extensions import TypeAlias - -__all__ = ["Package", "Resource", "contents", "is_resource", "open_binary", "open_text", "path", "read_binary", "read_text"] - -if sys.version_info >= (3, 9): - __all__ += ["as_file", "files"] - -if sys.version_info >= (3, 10): - __all__ += ["ResourceReader"] - -Package: TypeAlias = str | ModuleType - -if sys.version_info >= (3, 11): - Resource: TypeAlias = str -else: - Resource: TypeAlias = str | os.PathLike[Any] - -def open_binary(package: Package, resource: Resource) -> BinaryIO: ... -def open_text(package: Package, resource: Resource, encoding: str = ..., errors: str = ...) -> TextIO: ... -def read_binary(package: Package, resource: Resource) -> bytes: ... -def read_text(package: Package, resource: Resource, encoding: str = ..., errors: str = ...) -> str: ... -def path(package: Package, resource: Resource) -> AbstractContextManager[Path]: ... -def is_resource(package: Package, name: str) -> bool: ... -def contents(package: Package) -> Iterator[str]: ... - -if sys.version_info >= (3, 9): - from importlib.abc import Traversable - def files(package: Package) -> Traversable: ... - def as_file(path: Traversable) -> AbstractContextManager[Path]: ... - -if sys.version_info >= (3, 10): - from importlib.abc import ResourceReader as ResourceReader diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/importlib/resources/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/importlib/resources/__init__.pyi new file mode 100644 index 000000000..ba3d9b087 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stdlib/importlib/resources/__init__.pyi @@ -0,0 +1,39 @@ +import os +import sys +from collections.abc import Iterator +from contextlib import AbstractContextManager +from pathlib import Path +from types import ModuleType +from typing import Any, BinaryIO, TextIO +from typing_extensions import TypeAlias + +__all__ = ["Package", "Resource", "contents", "is_resource", "open_binary", "open_text", "path", "read_binary", "read_text"] + +if sys.version_info >= (3, 9): + __all__ += ["as_file", "files"] + +if sys.version_info >= (3, 10): + __all__ += ["ResourceReader"] + +Package: TypeAlias = str | ModuleType + +if sys.version_info >= (3, 11): + Resource: TypeAlias = str +else: + Resource: TypeAlias = str | os.PathLike[Any] + +def open_binary(package: Package, resource: Resource) -> BinaryIO: ... +def open_text(package: Package, resource: Resource, encoding: str = "utf-8", errors: str = "strict") -> TextIO: ... +def read_binary(package: Package, resource: Resource) -> bytes: ... +def read_text(package: Package, resource: Resource, encoding: str = "utf-8", errors: str = "strict") -> str: ... +def path(package: Package, resource: Resource) -> AbstractContextManager[Path]: ... +def is_resource(package: Package, name: str) -> bool: ... +def contents(package: Package) -> Iterator[str]: ... + +if sys.version_info >= (3, 9): + from importlib.abc import Traversable + def files(package: Package) -> Traversable: ... + def as_file(path: Traversable) -> AbstractContextManager[Path]: ... + +if sys.version_info >= (3, 10): + from importlib.abc import ResourceReader as ResourceReader diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/importlib/resources/abc.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/importlib/resources/abc.pyi new file mode 100644 index 000000000..a36c952d0 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stdlib/importlib/resources/abc.pyi @@ -0,0 +1,12 @@ +import sys + +if sys.version_info >= (3, 11): + # These are all actually defined in this file on 3.11+, + # and re-exported from importlib.abc, + # but it's much less code duplication for typeshed if we pretend that they're still defined + # in importlib.abc on 3.11+, and re-exported from this file + from importlib.abc import ( + ResourceReader as ResourceReader, + Traversable as Traversable, + TraversableResources as TraversableResources, + ) diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/importlib/util.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/importlib/util.pyi index dca4778fd..f988eb270 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/importlib/util.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/importlib/util.pyi @@ -1,7 +1,7 @@ import importlib.abc import importlib.machinery import types -from _typeshed import StrOrBytesPath +from _typeshed import ReadableBuffer, StrOrBytesPath from collections.abc import Callable from typing import Any from typing_extensions import ParamSpec @@ -15,18 +15,18 @@ def resolve_name(name: str, package: str | None) -> str: ... MAGIC_NUMBER: bytes -def cache_from_source(path: str, debug_override: bool | None = ..., *, optimization: Any | None = ...) -> str: ... +def cache_from_source(path: str, debug_override: bool | None = None, *, optimization: Any | None = None) -> str: ... def source_from_cache(path: str) -> str: ... -def decode_source(source_bytes: bytes) -> str: ... -def find_spec(name: str, package: str | None = ...) -> importlib.machinery.ModuleSpec | None: ... +def decode_source(source_bytes: ReadableBuffer) -> str: ... +def find_spec(name: str, package: str | None = None) -> importlib.machinery.ModuleSpec | None: ... def spec_from_loader( - name: str, loader: importlib.abc.Loader | None, *, origin: str | None = ..., is_package: bool | None = ... + name: str, loader: importlib.abc.Loader | None, *, origin: str | None = None, is_package: bool | None = None ) -> importlib.machinery.ModuleSpec | None: ... def spec_from_file_location( name: str, - location: StrOrBytesPath | None = ..., + location: StrOrBytesPath | None = None, *, - loader: importlib.abc.Loader | None = ..., + loader: importlib.abc.Loader | None = None, submodule_search_locations: list[str] | None = ..., ) -> importlib.machinery.ModuleSpec | None: ... def module_from_spec(spec: importlib.machinery.ModuleSpec) -> types.ModuleType: ... @@ -35,7 +35,6 @@ class LazyLoader(importlib.abc.Loader): def __init__(self, loader: importlib.abc.Loader) -> None: ... @classmethod def factory(cls, loader: importlib.abc.Loader) -> Callable[..., LazyLoader]: ... - def create_module(self, spec: importlib.machinery.ModuleSpec) -> types.ModuleType | None: ... def exec_module(self, module: types.ModuleType) -> None: ... -def source_hash(source_bytes: bytes) -> int: ... +def source_hash(source_bytes: ReadableBuffer) -> int: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/inspect.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/inspect.pyi index 7f9667c6e..b9283475f 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/inspect.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/inspect.pyi @@ -2,7 +2,6 @@ import dis import enum import sys import types -from _typeshed import Self from collections import OrderedDict from collections.abc import AsyncGenerator, Awaitable, Callable, Coroutine, Generator, Mapping, Sequence, Set as AbstractSet from types import ( @@ -25,8 +24,8 @@ from types import ( TracebackType, WrapperDescriptorType, ) -from typing import Any, ClassVar, NamedTuple, Protocol, TypeVar, Union, overload -from typing_extensions import Literal, ParamSpec, TypeAlias, TypeGuard +from typing import Any, ClassVar, NamedTuple, Protocol, TypeVar, overload +from typing_extensions import Literal, ParamSpec, Self, TypeAlias, TypeGuard if sys.version_info >= (3, 11): __all__ = [ @@ -162,13 +161,21 @@ TPFLAGS_IS_ABSTRACT: Literal[1048576] modulesbyfile: dict[str, Any] +_GetMembersPredicateTypeGuard: TypeAlias = Callable[[Any], TypeGuard[_T]] _GetMembersPredicate: TypeAlias = Callable[[Any], bool] +_GetMembersReturnTypeGuard: TypeAlias = list[tuple[str, _T]] _GetMembersReturn: TypeAlias = list[tuple[str, Any]] -def getmembers(object: object, predicate: _GetMembersPredicate | None = ...) -> _GetMembersReturn: ... +@overload +def getmembers(object: object, predicate: _GetMembersPredicateTypeGuard[_T]) -> _GetMembersReturnTypeGuard[_T]: ... +@overload +def getmembers(object: object, predicate: _GetMembersPredicate | None = None) -> _GetMembersReturn: ... if sys.version_info >= (3, 11): - def getmembers_static(object: object, predicate: _GetMembersPredicate | None = ...) -> _GetMembersReturn: ... + @overload + def getmembers_static(object: object, predicate: _GetMembersPredicateTypeGuard[_T]) -> _GetMembersReturnTypeGuard[_T]: ... + @overload + def getmembers_static(object: object, predicate: _GetMembersPredicate | None = None) -> _GetMembersReturn: ... def getmodulename(path: str) -> str | None: ... def ismodule(object: object) -> TypeGuard[ModuleType]: ... @@ -264,17 +271,17 @@ def isdatadescriptor(object: object) -> TypeGuard[_SupportsSet[Any, Any] | _Supp # # Retrieving source code # -_SourceObjectType: TypeAlias = Union[ - ModuleType, type[Any], MethodType, FunctionType, TracebackType, FrameType, CodeType, Callable[..., Any] -] +_SourceObjectType: TypeAlias = ( + ModuleType | type[Any] | MethodType | FunctionType | TracebackType | FrameType | CodeType | Callable[..., Any] +) def findsource(object: _SourceObjectType) -> tuple[list[str], int]: ... -def getabsfile(object: _SourceObjectType, _filename: str | None = ...) -> str: ... +def getabsfile(object: _SourceObjectType, _filename: str | None = None) -> str: ... def getblock(lines: Sequence[str]) -> Sequence[str]: ... def getdoc(object: object) -> str | None: ... def getcomments(object: object) -> str | None: ... def getfile(object: _SourceObjectType) -> str: ... -def getmodule(object: object, _filename: str | None = ...) -> ModuleType | None: ... +def getmodule(object: object, _filename: str | None = None) -> ModuleType | None: ... def getsourcefile(object: _SourceObjectType) -> str | None: ... def getsourcelines(object: _SourceObjectType) -> tuple[list[str], int]: ... def getsource(object: _SourceObjectType) -> str: ... @@ -290,21 +297,21 @@ if sys.version_info >= (3, 10): def signature( obj: _IntrospectableCallable, *, - follow_wrapped: bool = ..., - globals: Mapping[str, Any] | None = ..., - locals: Mapping[str, Any] | None = ..., - eval_str: bool = ..., + follow_wrapped: bool = True, + globals: Mapping[str, Any] | None = None, + locals: Mapping[str, Any] | None = None, + eval_str: bool = False, ) -> Signature: ... else: - def signature(obj: _IntrospectableCallable, *, follow_wrapped: bool = ...) -> Signature: ... + def signature(obj: _IntrospectableCallable, *, follow_wrapped: bool = True) -> Signature: ... class _void: ... class _empty: ... class Signature: def __init__( - self, parameters: Sequence[Parameter] | None = ..., *, return_annotation: Any = ..., __validate_parameters__: bool = ... + self, parameters: Sequence[Parameter] | None = None, *, return_annotation: Any = ..., __validate_parameters__: bool = True ) -> None: ... empty = _empty @property @@ -313,23 +320,21 @@ class Signature: def return_annotation(self) -> Any: ... def bind(self, *args: Any, **kwargs: Any) -> BoundArguments: ... def bind_partial(self, *args: Any, **kwargs: Any) -> BoundArguments: ... - def replace( - self: Self, *, parameters: Sequence[Parameter] | type[_void] | None = ..., return_annotation: Any = ... - ) -> Self: ... + def replace(self, *, parameters: Sequence[Parameter] | type[_void] | None = ..., return_annotation: Any = ...) -> Self: ... if sys.version_info >= (3, 10): @classmethod def from_callable( - cls: type[Self], + cls, obj: _IntrospectableCallable, *, - follow_wrapped: bool = ..., - globals: Mapping[str, Any] | None = ..., - locals: Mapping[str, Any] | None = ..., - eval_str: bool = ..., + follow_wrapped: bool = True, + globals: Mapping[str, Any] | None = None, + locals: Mapping[str, Any] | None = None, + eval_str: bool = False, ) -> Self: ... else: @classmethod - def from_callable(cls: type[Self], obj: _IntrospectableCallable, *, follow_wrapped: bool = ...) -> Self: ... + def from_callable(cls, obj: _IntrospectableCallable, *, follow_wrapped: bool = True) -> Self: ... def __eq__(self, other: object) -> bool: ... @@ -337,9 +342,9 @@ if sys.version_info >= (3, 10): def get_annotations( obj: Callable[..., object] | type[Any] | ModuleType, *, - globals: Mapping[str, Any] | None = ..., - locals: Mapping[str, Any] | None = ..., - eval_str: bool = ..., + globals: Mapping[str, Any] | None = None, + locals: Mapping[str, Any] | None = None, + eval_str: bool = False, ) -> dict[str, Any]: ... # The name is the same as the enum's name in CPython @@ -372,7 +377,7 @@ class Parameter: @property def annotation(self) -> Any: ... def replace( - self: Self, + self, *, name: str | type[_void] = ..., kind: _ParameterKind | type[_void] = ..., @@ -400,8 +405,8 @@ class BoundArguments: # TODO: The actual return type should be list[_ClassTreeItem] but mypy doesn't # seem to be supporting this at the moment: # _ClassTreeItem = list[_ClassTreeItem] | Tuple[type, Tuple[type, ...]] -def getclasstree(classes: list[type], unique: bool = ...) -> list[Any]: ... -def walktree(classes: list[type], children: dict[type[Any], list[type]], parent: type[Any] | None) -> list[Any]: ... +def getclasstree(classes: list[type], unique: bool = False) -> list[Any]: ... +def walktree(classes: list[type], children: Mapping[type[Any], list[type]], parent: type[Any] | None) -> list[Any]: ... class Arguments(NamedTuple): args: list[str] @@ -436,18 +441,18 @@ class ArgInfo(NamedTuple): locals: dict[str, Any] def getargvalues(frame: FrameType) -> ArgInfo: ... -def formatannotation(annotation: object, base_module: str | None = ...) -> str: ... +def formatannotation(annotation: object, base_module: str | None = None) -> str: ... def formatannotationrelativeto(object: object) -> Callable[[object], str]: ... if sys.version_info < (3, 11): def formatargspec( args: list[str], - varargs: str | None = ..., - varkw: str | None = ..., - defaults: tuple[Any, ...] | None = ..., + varargs: str | None = None, + varkw: str | None = None, + defaults: tuple[Any, ...] | None = None, kwonlyargs: Sequence[str] | None = ..., - kwonlydefaults: dict[str, Any] | None = ..., - annotations: dict[str, Any] = ..., + kwonlydefaults: Mapping[str, Any] | None = ..., + annotations: Mapping[str, Any] = ..., formatarg: Callable[[str], str] = ..., formatvarargs: Callable[[str], str] = ..., formatvarkw: Callable[[str], str] = ..., @@ -460,7 +465,7 @@ def formatargvalues( args: list[str], varargs: str | None, varkw: str | None, - locals: dict[str, Any] | None, + locals: Mapping[str, Any] | None, formatarg: Callable[[str], str] | None = ..., formatvarargs: Callable[[str], str] | None = ..., formatvarkw: Callable[[str], str] | None = ..., @@ -476,7 +481,7 @@ class ClosureVars(NamedTuple): unbound: AbstractSet[str] def getclosurevars(func: _IntrospectableCallable) -> ClosureVars: ... -def unwrap(func: Callable[..., Any], *, stop: Callable[[Callable[..., Any]], Any] | None = ...) -> Any: ... +def unwrap(func: Callable[..., Any], *, stop: Callable[[Callable[..., Any]], Any] | None = None) -> Any: ... # # The interpreter stack @@ -493,14 +498,14 @@ if sys.version_info >= (3, 11): class Traceback(_Traceback): positions: dis.Positions | None def __new__( - cls: type[Self], + cls, filename: str, lineno: int, function: str, code_context: list[str] | None, index: int | None, *, - positions: dis.Positions | None = ..., + positions: dis.Positions | None = None, ) -> Self: ... class _FrameInfo(NamedTuple): @@ -514,7 +519,7 @@ if sys.version_info >= (3, 11): class FrameInfo(_FrameInfo): positions: dis.Positions | None def __new__( - cls: type[Self], + cls, frame: FrameType, filename: str, lineno: int, @@ -522,7 +527,7 @@ if sys.version_info >= (3, 11): code_context: list[str] | None, index: int | None, *, - positions: dis.Positions | None = ..., + positions: dis.Positions | None = None, ) -> Self: ... else: @@ -541,13 +546,13 @@ else: code_context: list[str] | None index: int | None # type: ignore[assignment] -def getframeinfo(frame: FrameType | TracebackType, context: int = ...) -> Traceback: ... -def getouterframes(frame: Any, context: int = ...) -> list[FrameInfo]: ... -def getinnerframes(tb: TracebackType, context: int = ...) -> list[FrameInfo]: ... +def getframeinfo(frame: FrameType | TracebackType, context: int = 1) -> Traceback: ... +def getouterframes(frame: Any, context: int = 1) -> list[FrameInfo]: ... +def getinnerframes(tb: TracebackType, context: int = 1) -> list[FrameInfo]: ... def getlineno(frame: FrameType) -> int: ... def currentframe() -> FrameType | None: ... -def stack(context: int = ...) -> list[FrameInfo]: ... -def trace(context: int = ...) -> list[FrameInfo]: ... +def stack(context: int = 1) -> list[FrameInfo]: ... +def trace(context: int = 1) -> list[FrameInfo]: ... # # Fetching attributes statically @@ -585,7 +590,7 @@ _Object: TypeAlias = object class Attribute(NamedTuple): name: str - kind: str + kind: Literal["class method", "static method", "property", "method", "data"] defining_class: type object: _Object diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/io.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/io.pyi index f47a9ddf3..c114f8395 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/io.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/io.pyi @@ -2,12 +2,12 @@ import abc import builtins import codecs import sys -from _typeshed import ReadableBuffer, Self, StrOrBytesPath, WriteableBuffer +from _typeshed import FileDescriptorOrPath, ReadableBuffer, WriteableBuffer from collections.abc import Callable, Iterable, Iterator from os import _Opener from types import TracebackType from typing import IO, Any, BinaryIO, TextIO -from typing_extensions import Literal +from typing_extensions import Literal, Self __all__ = [ "BlockingIOError", @@ -51,7 +51,7 @@ class UnsupportedOperation(OSError, ValueError): ... class IOBase(metaclass=abc.ABCMeta): def __iter__(self) -> Iterator[bytes]: ... def __next__(self) -> bytes: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None ) -> None: ... @@ -61,7 +61,7 @@ class IOBase(metaclass=abc.ABCMeta): def isatty(self) -> bool: ... def readable(self) -> bool: ... read: Callable[..., Any] - def readlines(self, __hint: int = ...) -> list[bytes]: ... + def readlines(self, __hint: int = -1) -> list[bytes]: ... def seek(self, __offset: int, __whence: int = ...) -> int: ... def seekable(self) -> bool: ... def tell(self) -> int: ... @@ -69,7 +69,7 @@ class IOBase(metaclass=abc.ABCMeta): def writable(self) -> bool: ... write: Callable[..., Any] def writelines(self, __lines: Iterable[ReadableBuffer]) -> None: ... - def readline(self, __size: int | None = ...) -> bytes: ... + def readline(self, __size: int | None = -1) -> bytes: ... def __del__(self) -> None: ... @property def closed(self) -> bool: ... @@ -79,7 +79,7 @@ class RawIOBase(IOBase): def readall(self) -> bytes: ... def readinto(self, __buffer: WriteableBuffer) -> int | None: ... def write(self, __b: ReadableBuffer) -> int | None: ... - def read(self, __size: int = ...) -> bytes | None: ... + def read(self, __size: int = -1) -> bytes | None: ... class BufferedIOBase(IOBase): raw: RawIOBase # This is not part of the BufferedIOBase API and may not exist on some implementations. @@ -90,45 +90,42 @@ class BufferedIOBase(IOBase): def read(self, __size: int | None = ...) -> bytes: ... def read1(self, __size: int = ...) -> bytes: ... -class FileIO(RawIOBase, BinaryIO): +class FileIO(RawIOBase, BinaryIO): # type: ignore[misc] # incompatible definitions of writelines in the base classes mode: str - name: StrOrBytesPath | int # type: ignore[assignment] + name: FileDescriptorOrPath # type: ignore[assignment] def __init__( - self, file: StrOrBytesPath | int, mode: str = ..., closefd: bool = ..., opener: _Opener | None = ... + self, file: FileDescriptorOrPath, mode: str = ..., closefd: bool = ..., opener: _Opener | None = ... ) -> None: ... @property def closefd(self) -> bool: ... def write(self, __b: ReadableBuffer) -> int: ... - def read(self, __size: int = ...) -> bytes: ... - def __enter__(self: Self) -> Self: ... + def read(self, __size: int = -1) -> bytes: ... + def __enter__(self) -> Self: ... -class BytesIO(BufferedIOBase, BinaryIO): - def __init__(self, initial_bytes: bytes = ...) -> None: ... +class BytesIO(BufferedIOBase, BinaryIO): # type: ignore[misc] # incompatible definitions of methods in the base classes + def __init__(self, initial_bytes: ReadableBuffer = ...) -> None: ... # BytesIO does not contain a "name" field. This workaround is necessary # to allow BytesIO sub-classes to add this field, as it is defined # as a read-only property on IO[]. name: Any - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def getvalue(self) -> bytes: ... def getbuffer(self) -> memoryview: ... - def read1(self, __size: int | None = ...) -> bytes: ... + def read1(self, __size: int | None = -1) -> bytes: ... -class BufferedReader(BufferedIOBase, BinaryIO): - def __enter__(self: Self) -> Self: ... +class BufferedReader(BufferedIOBase, BinaryIO): # type: ignore[misc] # incompatible definitions of methods in the base classes + def __enter__(self) -> Self: ... def __init__(self, raw: RawIOBase, buffer_size: int = ...) -> None: ... - def peek(self, __size: int = ...) -> bytes: ... - def read1(self, __size: int = ...) -> bytes: ... + def peek(self, __size: int = 0) -> bytes: ... -class BufferedWriter(BufferedIOBase, BinaryIO): - def __enter__(self: Self) -> Self: ... +class BufferedWriter(BufferedIOBase, BinaryIO): # type: ignore[misc] # incompatible definitions of writelines in the base classes + def __enter__(self) -> Self: ... def __init__(self, raw: RawIOBase, buffer_size: int = ...) -> None: ... def write(self, __buffer: ReadableBuffer) -> int: ... -class BufferedRandom(BufferedReader, BufferedWriter): - def __enter__(self: Self) -> Self: ... - def __init__(self, raw: RawIOBase, buffer_size: int = ...) -> None: ... - def seek(self, __target: int, __whence: int = ...) -> int: ... - def read1(self, __size: int = ...) -> bytes: ... +class BufferedRandom(BufferedReader, BufferedWriter): # type: ignore[misc] # incompatible definitions of methods in the base classes + def __enter__(self) -> Self: ... + def seek(self, __target: int, __whence: int = 0) -> int: ... # stubtest needs this class BufferedRWPair(BufferedIOBase): def __init__(self, reader: RawIOBase, writer: RawIOBase, buffer_size: int = ...) -> None: ... @@ -144,11 +141,10 @@ class TextIOBase(IOBase): def write(self, __s: str) -> int: ... def writelines(self, __lines: Iterable[str]) -> None: ... # type: ignore[override] def readline(self, __size: int = ...) -> str: ... # type: ignore[override] - def readlines(self, __hint: int = ...) -> list[str]: ... # type: ignore[override] + def readlines(self, __hint: int = -1) -> list[str]: ... # type: ignore[override] def read(self, __size: int | None = ...) -> str: ... - def tell(self) -> int: ... -class TextIOWrapper(TextIOBase, TextIO): +class TextIOWrapper(TextIOBase, TextIO): # type: ignore[misc] # incompatible definitions of write in the base classes def __init__( self, buffer: IO[bytes], @@ -169,20 +165,20 @@ class TextIOWrapper(TextIOBase, TextIO): def reconfigure( self, *, - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., - line_buffering: bool | None = ..., - write_through: bool | None = ..., + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, + line_buffering: bool | None = None, + write_through: bool | None = None, ) -> None: ... # These are inherited from TextIOBase, but must exist in the stub to satisfy mypy. - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __iter__(self) -> Iterator[str]: ... # type: ignore[override] def __next__(self) -> str: ... # type: ignore[override] def writelines(self, __lines: Iterable[str]) -> None: ... # type: ignore[override] - def readline(self, __size: int = ...) -> str: ... # type: ignore[override] - def readlines(self, __hint: int = ...) -> list[str]: ... # type: ignore[override] - def seek(self, __cookie: int, __whence: int = ...) -> int: ... + def readline(self, __size: int = -1) -> str: ... # type: ignore[override] + def readlines(self, __hint: int = -1) -> list[str]: ... # type: ignore[override] + def seek(self, __cookie: int, __whence: int = 0) -> int: ... # stubtest needs this class StringIO(TextIOWrapper): def __init__(self, initial_value: str | None = ..., newline: str | None = ...) -> None: ... @@ -194,7 +190,7 @@ class StringIO(TextIOWrapper): class IncrementalNewlineDecoder(codecs.IncrementalDecoder): def __init__(self, decoder: codecs.IncrementalDecoder | None, translate: bool, errors: str = ...) -> None: ... - def decode(self, input: bytes | str, final: bool = ...) -> str: ... + def decode(self, input: ReadableBuffer | str, final: bool = False) -> str: ... @property def newlines(self) -> str | tuple[str, ...] | None: ... def setstate(self, __state: tuple[bytes, int]) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/ipaddress.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/ipaddress.pyi index d324f52ac..7a4146885 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/ipaddress.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/ipaddress.pyi @@ -1,8 +1,7 @@ import sys -from _typeshed import Self from collections.abc import Container, Iterable, Iterator from typing import Any, Generic, SupportsInt, TypeVar, overload -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal, Self, TypeAlias # Undocumented length constants IPV4LENGTH: Literal[32] @@ -15,8 +14,12 @@ _RawIPAddress: TypeAlias = int | str | bytes | IPv4Address | IPv6Address _RawNetworkPart: TypeAlias = IPv4Network | IPv6Network | IPv4Interface | IPv6Interface def ip_address(address: _RawIPAddress) -> IPv4Address | IPv6Address: ... -def ip_network(address: _RawIPAddress | _RawNetworkPart, strict: bool = ...) -> IPv4Network | IPv6Network: ... -def ip_interface(address: _RawIPAddress | _RawNetworkPart) -> IPv4Interface | IPv6Interface: ... +def ip_network( + address: _RawIPAddress | _RawNetworkPart | tuple[_RawIPAddress] | tuple[_RawIPAddress, int], strict: bool = True +) -> IPv4Network | IPv6Network: ... +def ip_interface( + address: _RawIPAddress | _RawNetworkPart | tuple[_RawIPAddress] | tuple[_RawIPAddress, int] +) -> IPv4Interface | IPv6Interface: ... class _IPAddressBase: @property @@ -30,20 +33,22 @@ class _IPAddressBase: class _BaseAddress(_IPAddressBase, SupportsInt): def __init__(self, address: object) -> None: ... - def __add__(self: Self, other: int) -> Self: ... + def __add__(self, other: int) -> Self: ... def __int__(self) -> int: ... - def __sub__(self: Self, other: int) -> Self: ... - def __format__(self, fmt: str) -> str: ... + def __sub__(self, other: int) -> Self: ... + if sys.version_info >= (3, 9): + def __format__(self, fmt: str) -> str: ... + def __eq__(self, other: object) -> bool: ... - def __lt__(self: Self, other: Self) -> bool: ... + def __lt__(self, other: Self) -> bool: ... if sys.version_info >= (3, 11): - def __ge__(self: Self, other: Self) -> bool: ... - def __gt__(self: Self, other: Self) -> bool: ... - def __le__(self: Self, other: Self) -> bool: ... + def __ge__(self, other: Self) -> bool: ... + def __gt__(self, other: Self) -> bool: ... + def __le__(self, other: Self) -> bool: ... else: - def __ge__(self: Self, other: Self, NotImplemented: Any = ...) -> bool: ... - def __gt__(self: Self, other: Self, NotImplemented: Any = ...) -> bool: ... - def __le__(self: Self, other: Self, NotImplemented: Any = ...) -> bool: ... + def __ge__(self, other: Self, NotImplemented: Any = ...) -> bool: ... + def __gt__(self, other: Self, NotImplemented: Any = ...) -> bool: ... + def __le__(self, other: Self, NotImplemented: Any = ...) -> bool: ... @property def is_global(self) -> bool: ... @@ -72,20 +77,20 @@ class _BaseNetwork(_IPAddressBase, Container[_A], Iterable[_A], Generic[_A]): def __getitem__(self, n: int) -> _A: ... def __iter__(self) -> Iterator[_A]: ... def __eq__(self, other: object) -> bool: ... - def __lt__(self: Self, other: Self) -> bool: ... + def __lt__(self, other: Self) -> bool: ... if sys.version_info >= (3, 11): - def __ge__(self: Self, other: Self) -> bool: ... - def __gt__(self: Self, other: Self) -> bool: ... - def __le__(self: Self, other: Self) -> bool: ... + def __ge__(self, other: Self) -> bool: ... + def __gt__(self, other: Self) -> bool: ... + def __le__(self, other: Self) -> bool: ... else: - def __ge__(self: Self, other: Self, NotImplemented: Any = ...) -> bool: ... - def __gt__(self: Self, other: Self, NotImplemented: Any = ...) -> bool: ... - def __le__(self: Self, other: Self, NotImplemented: Any = ...) -> bool: ... + def __ge__(self, other: Self, NotImplemented: Any = ...) -> bool: ... + def __gt__(self, other: Self, NotImplemented: Any = ...) -> bool: ... + def __le__(self, other: Self, NotImplemented: Any = ...) -> bool: ... - def address_exclude(self: Self, other: Self) -> Iterator[Self]: ... + def address_exclude(self, other: Self) -> Iterator[Self]: ... @property def broadcast_address(self) -> _A: ... - def compare_networks(self: Self, other: Self) -> int: ... + def compare_networks(self, other: Self) -> int: ... def hosts(self) -> Iterator[_A]: ... @property def is_global(self) -> bool: ... @@ -108,10 +113,10 @@ class _BaseNetwork(_IPAddressBase, Container[_A], Iterable[_A], Generic[_A]): def overlaps(self, other: _BaseNetwork[IPv4Address] | _BaseNetwork[IPv6Address]) -> bool: ... @property def prefixlen(self) -> int: ... - def subnet_of(self: Self, other: Self) -> bool: ... - def supernet_of(self: Self, other: Self) -> bool: ... - def subnets(self: Self, prefixlen_diff: int = ..., new_prefix: int | None = ...) -> Iterator[Self]: ... - def supernet(self: Self, prefixlen_diff: int = ..., new_prefix: int | None = ...) -> Self: ... + def subnet_of(self, other: Self) -> bool: ... + def supernet_of(self, other: Self) -> bool: ... + def subnets(self, prefixlen_diff: int = 1, new_prefix: int | None = None) -> Iterator[Self]: ... + def supernet(self, prefixlen_diff: int = 1, new_prefix: int | None = None) -> Self: ... @property def with_hostmask(self) -> str: ... @property diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/itertools.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/itertools.pyi index 7299ee820..c7b92c3ae 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/itertools.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/itertools.pyi @@ -1,8 +1,7 @@ import sys -from _typeshed import Self from collections.abc import Callable, Iterable, Iterator from typing import Any, Generic, SupportsComplex, SupportsFloat, SupportsInt, TypeVar, overload -from typing_extensions import Literal, SupportsIndex, TypeAlias +from typing_extensions import Literal, Self, SupportsIndex, TypeAlias if sys.version_info >= (3, 9): from types import GenericAlias @@ -32,12 +31,12 @@ class count(Iterator[_N], Generic[_N]): @overload def __new__(cls, *, step: _N) -> count[_N]: ... def __next__(self) -> _N: ... - def __iter__(self: Self) -> Self: ... + def __iter__(self) -> Self: ... class cycle(Iterator[_T], Generic[_T]): def __init__(self, __iterable: Iterable[_T]) -> None: ... def __next__(self) -> _T: ... - def __iter__(self: Self) -> Self: ... + def __iter__(self) -> Self: ... class repeat(Iterator[_T], Generic[_T]): @overload @@ -45,25 +44,25 @@ class repeat(Iterator[_T], Generic[_T]): @overload def __init__(self, object: _T, times: int) -> None: ... def __next__(self) -> _T: ... - def __iter__(self: Self) -> Self: ... + def __iter__(self) -> Self: ... def __length_hint__(self) -> int: ... class accumulate(Iterator[_T], Generic[_T]): if sys.version_info >= (3, 8): @overload - def __init__(self, iterable: Iterable[_T], func: None = ..., *, initial: _T | None = ...) -> None: ... + def __init__(self, iterable: Iterable[_T], func: None = None, *, initial: _T | None = ...) -> None: ... @overload def __init__(self, iterable: Iterable[_S], func: Callable[[_T, _S], _T], *, initial: _T | None = ...) -> None: ... else: def __init__(self, iterable: Iterable[_T], func: Callable[[_T, _T], _T] | None = ...) -> None: ... - def __iter__(self: Self) -> Self: ... + def __iter__(self) -> Self: ... def __next__(self) -> _T: ... class chain(Iterator[_T], Generic[_T]): def __init__(self, *iterables: Iterable[_T]) -> None: ... def __next__(self) -> _T: ... - def __iter__(self: Self) -> Self: ... + def __iter__(self) -> Self: ... @classmethod # We use type[Any] and not type[_S] to not lose the type inference from __iterable def from_iterable(cls: type[Any], __iterable: Iterable[Iterable[_S]]) -> chain[_S]: ... @@ -72,25 +71,25 @@ class chain(Iterator[_T], Generic[_T]): class compress(Iterator[_T], Generic[_T]): def __init__(self, data: Iterable[_T], selectors: Iterable[Any]) -> None: ... - def __iter__(self: Self) -> Self: ... + def __iter__(self) -> Self: ... def __next__(self) -> _T: ... class dropwhile(Iterator[_T], Generic[_T]): def __init__(self, __predicate: _Predicate[_T], __iterable: Iterable[_T]) -> None: ... - def __iter__(self: Self) -> Self: ... + def __iter__(self) -> Self: ... def __next__(self) -> _T: ... class filterfalse(Iterator[_T], Generic[_T]): def __init__(self, __predicate: _Predicate[_T] | None, __iterable: Iterable[_T]) -> None: ... - def __iter__(self: Self) -> Self: ... + def __iter__(self) -> Self: ... def __next__(self) -> _T: ... class groupby(Iterator[tuple[_T, Iterator[_S]]], Generic[_T, _S]): @overload - def __new__(cls, iterable: Iterable[_T1], key: None = ...) -> groupby[_T1, _T1]: ... + def __new__(cls, iterable: Iterable[_T1], key: None = None) -> groupby[_T1, _T1]: ... @overload def __new__(cls, iterable: Iterable[_T1], key: Callable[[_T1], _T2]) -> groupby[_T2, _T1]: ... - def __iter__(self: Self) -> Self: ... + def __iter__(self) -> Self: ... def __next__(self) -> tuple[_T, Iterator[_S]]: ... class islice(Iterator[_T], Generic[_T]): @@ -98,20 +97,20 @@ class islice(Iterator[_T], Generic[_T]): def __init__(self, __iterable: Iterable[_T], __stop: int | None) -> None: ... @overload def __init__(self, __iterable: Iterable[_T], __start: int | None, __stop: int | None, __step: int | None = ...) -> None: ... - def __iter__(self: Self) -> Self: ... + def __iter__(self) -> Self: ... def __next__(self) -> _T: ... class starmap(Iterator[_T], Generic[_T]): def __init__(self, __function: Callable[..., _T], __iterable: Iterable[Iterable[Any]]) -> None: ... - def __iter__(self: Self) -> Self: ... + def __iter__(self) -> Self: ... def __next__(self) -> _T: ... class takewhile(Iterator[_T], Generic[_T]): def __init__(self, __predicate: _Predicate[_T], __iterable: Iterable[_T]) -> None: ... - def __iter__(self: Self) -> Self: ... + def __iter__(self) -> Self: ... def __next__(self) -> _T: ... -def tee(__iterable: Iterable[_T], __n: int = ...) -> tuple[Iterator[_T], ...]: ... +def tee(__iterable: Iterable[_T], __n: int = 2) -> tuple[Iterator[_T], ...]: ... class zip_longest(Iterator[_T_co], Generic[_T_co]): # one iterable (fillvalue doesn't matter) @@ -190,7 +189,7 @@ class zip_longest(Iterator[_T_co], Generic[_T_co]): *iterables: Iterable[_T], fillvalue: _T, ) -> zip_longest[tuple[_T, ...]]: ... - def __iter__(self: Self) -> Self: ... + def __iter__(self) -> Self: ... def __next__(self) -> _T_co: ... class product(Iterator[_T_co], Generic[_T_co]): @@ -239,12 +238,12 @@ class product(Iterator[_T_co], Generic[_T_co]): def __new__(cls, *iterables: Iterable[_T1], repeat: int) -> product[tuple[_T1, ...]]: ... @overload def __new__(cls, *iterables: Iterable[Any], repeat: int = ...) -> product[tuple[Any, ...]]: ... - def __iter__(self: Self) -> Self: ... + def __iter__(self) -> Self: ... def __next__(self) -> _T_co: ... class permutations(Iterator[tuple[_T, ...]], Generic[_T]): def __init__(self, iterable: Iterable[_T], r: int | None = ...) -> None: ... - def __iter__(self: Self) -> Self: ... + def __iter__(self) -> Self: ... def __next__(self) -> tuple[_T, ...]: ... class combinations(Iterator[_T_co], Generic[_T_co]): @@ -258,16 +257,22 @@ class combinations(Iterator[_T_co], Generic[_T_co]): def __new__(cls, iterable: Iterable[_T], r: Literal[5]) -> combinations[tuple[_T, _T, _T, _T, _T]]: ... @overload def __new__(cls, iterable: Iterable[_T], r: int) -> combinations[tuple[_T, ...]]: ... - def __iter__(self: Self) -> Self: ... + def __iter__(self) -> Self: ... def __next__(self) -> _T_co: ... class combinations_with_replacement(Iterator[tuple[_T, ...]], Generic[_T]): def __init__(self, iterable: Iterable[_T], r: int) -> None: ... - def __iter__(self: Self) -> Self: ... + def __iter__(self) -> Self: ... def __next__(self) -> tuple[_T, ...]: ... if sys.version_info >= (3, 10): class pairwise(Iterator[_T_co], Generic[_T_co]): def __new__(cls, __iterable: Iterable[_T]) -> pairwise[tuple[_T, _T]]: ... - def __iter__(self: Self) -> Self: ... + def __iter__(self) -> Self: ... def __next__(self) -> _T_co: ... + +if sys.version_info >= (3, 12): + class batched(Iterator[_T_co], Generic[_T_co]): + def __new__(cls, iterable: Iterable[_T_co], n: int) -> Self: ... + def __iter__(self) -> Self: ... + def __next__(self) -> tuple[_T_co, ...]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/json/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/json/__init__.pyi index 2fd87622e..63e9718ee 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/json/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/json/__init__.pyi @@ -1,6 +1,6 @@ -from _typeshed import SupportsRead +from _typeshed import SupportsRead, SupportsWrite from collections.abc import Callable -from typing import IO, Any +from typing import Any from .decoder import JSONDecodeError as JSONDecodeError, JSONDecoder as JSONDecoder from .encoder import JSONEncoder as JSONEncoder @@ -10,52 +10,52 @@ __all__ = ["dump", "dumps", "load", "loads", "JSONDecoder", "JSONDecodeError", " def dumps( obj: Any, *, - skipkeys: bool = ..., - ensure_ascii: bool = ..., - check_circular: bool = ..., - allow_nan: bool = ..., - cls: type[JSONEncoder] | None = ..., - indent: None | int | str = ..., - separators: tuple[str, str] | None = ..., - default: Callable[[Any], Any] | None = ..., - sort_keys: bool = ..., + skipkeys: bool = False, + ensure_ascii: bool = True, + check_circular: bool = True, + allow_nan: bool = True, + cls: type[JSONEncoder] | None = None, + indent: None | int | str = None, + separators: tuple[str, str] | None = None, + default: Callable[[Any], Any] | None = None, + sort_keys: bool = False, **kwds: Any, ) -> str: ... def dump( obj: Any, - fp: IO[str], + fp: SupportsWrite[str], *, - skipkeys: bool = ..., - ensure_ascii: bool = ..., - check_circular: bool = ..., - allow_nan: bool = ..., - cls: type[JSONEncoder] | None = ..., - indent: None | int | str = ..., - separators: tuple[str, str] | None = ..., - default: Callable[[Any], Any] | None = ..., - sort_keys: bool = ..., + skipkeys: bool = False, + ensure_ascii: bool = True, + check_circular: bool = True, + allow_nan: bool = True, + cls: type[JSONEncoder] | None = None, + indent: None | int | str = None, + separators: tuple[str, str] | None = None, + default: Callable[[Any], Any] | None = None, + sort_keys: bool = False, **kwds: Any, ) -> None: ... def loads( - s: str | bytes, + s: str | bytes | bytearray, *, - cls: type[JSONDecoder] | None = ..., - object_hook: Callable[[dict[Any, Any]], Any] | None = ..., - parse_float: Callable[[str], Any] | None = ..., - parse_int: Callable[[str], Any] | None = ..., - parse_constant: Callable[[str], Any] | None = ..., - object_pairs_hook: Callable[[list[tuple[Any, Any]]], Any] | None = ..., + cls: type[JSONDecoder] | None = None, + object_hook: Callable[[dict[Any, Any]], Any] | None = None, + parse_float: Callable[[str], Any] | None = None, + parse_int: Callable[[str], Any] | None = None, + parse_constant: Callable[[str], Any] | None = None, + object_pairs_hook: Callable[[list[tuple[Any, Any]]], Any] | None = None, **kwds: Any, ) -> Any: ... def load( fp: SupportsRead[str | bytes], *, - cls: type[JSONDecoder] | None = ..., - object_hook: Callable[[dict[Any, Any]], Any] | None = ..., - parse_float: Callable[[str], Any] | None = ..., - parse_int: Callable[[str], Any] | None = ..., - parse_constant: Callable[[str], Any] | None = ..., - object_pairs_hook: Callable[[list[tuple[Any, Any]]], Any] | None = ..., + cls: type[JSONDecoder] | None = None, + object_hook: Callable[[dict[Any, Any]], Any] | None = None, + parse_float: Callable[[str], Any] | None = None, + parse_int: Callable[[str], Any] | None = None, + parse_constant: Callable[[str], Any] | None = None, + object_pairs_hook: Callable[[list[tuple[Any, Any]]], Any] | None = None, **kwds: Any, ) -> Any: ... -def detect_encoding(b: bytes) -> str: ... # undocumented +def detect_encoding(b: bytes | bytearray) -> str: ... # undocumented diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/json/decoder.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/json/decoder.pyi index 2060cf17d..8debfe6cd 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/json/decoder.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/json/decoder.pyi @@ -21,12 +21,12 @@ class JSONDecoder: def __init__( self, *, - object_hook: Callable[[dict[str, Any]], Any] | None = ..., - parse_float: Callable[[str], Any] | None = ..., - parse_int: Callable[[str], Any] | None = ..., - parse_constant: Callable[[str], Any] | None = ..., - strict: bool = ..., - object_pairs_hook: Callable[[list[tuple[str, Any]]], Any] | None = ..., + object_hook: Callable[[dict[str, Any]], Any] | None = None, + parse_float: Callable[[str], Any] | None = None, + parse_int: Callable[[str], Any] | None = None, + parse_constant: Callable[[str], Any] | None = None, + strict: bool = True, + object_pairs_hook: Callable[[list[tuple[str, Any]]], Any] | None = None, ) -> None: ... def decode(self, s: str, _w: Callable[..., Any] = ...) -> Any: ... # _w is undocumented - def raw_decode(self, s: str, idx: int = ...) -> tuple[Any, int]: ... + def raw_decode(self, s: str, idx: int = 0) -> tuple[Any, int]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/json/encoder.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/json/encoder.pyi index 60e820619..0c0d366eb 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/json/encoder.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/json/encoder.pyi @@ -20,19 +20,19 @@ class JSONEncoder: check_circular: bool allow_nan: bool sort_keys: bool - indent: int + indent: int | str def __init__( self, *, - skipkeys: bool = ..., - ensure_ascii: bool = ..., - check_circular: bool = ..., - allow_nan: bool = ..., - sort_keys: bool = ..., - indent: int | None = ..., - separators: tuple[str, str] | None = ..., - default: Callable[..., Any] | None = ..., + skipkeys: bool = False, + ensure_ascii: bool = True, + check_circular: bool = True, + allow_nan: bool = True, + sort_keys: bool = False, + indent: int | str | None = None, + separators: tuple[str, str] | None = None, + default: Callable[..., Any] | None = None, ) -> None: ... def default(self, o: Any) -> Any: ... def encode(self, o: Any) -> str: ... - def iterencode(self, o: Any, _one_shot: bool = ...) -> Iterator[str]: ... + def iterencode(self, o: Any, _one_shot: bool = False) -> Iterator[str]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/keyword.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/keyword.pyi index c17c58012..46c386048 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/keyword.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/keyword.pyi @@ -1,5 +1,6 @@ import sys from collections.abc import Sequence +from typing_extensions import Final if sys.version_info >= (3, 9): __all__ = ["iskeyword", "issoftkeyword", "kwlist", "softkwlist"] @@ -8,8 +9,13 @@ else: def iskeyword(s: str) -> bool: ... -kwlist: Sequence[str] +# a list at runtime, but you're not meant to mutate it; +# type it as a sequence +kwlist: Final[Sequence[str]] if sys.version_info >= (3, 9): def issoftkeyword(s: str) -> bool: ... - softkwlist: Sequence[str] + + # a list at runtime, but you're not meant to mutate it; + # type it as a sequence + softkwlist: Final[Sequence[str]] diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/pgen2/driver.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/pgen2/driver.pyi index 45c9aeaa5..9f6e4d677 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/pgen2/driver.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/pgen2/driver.pyi @@ -12,13 +12,13 @@ class Driver: grammar: Grammar logger: Logger convert: _Convert - def __init__(self, grammar: Grammar, convert: _Convert | None = ..., logger: Logger | None = ...) -> None: ... - def parse_tokens(self, tokens: Iterable[Any], debug: bool = ...) -> _NL: ... - def parse_stream_raw(self, stream: IO[str], debug: bool = ...) -> _NL: ... - def parse_stream(self, stream: IO[str], debug: bool = ...) -> _NL: ... - def parse_file(self, filename: StrPath, encoding: str | None = ..., debug: bool = ...) -> _NL: ... - def parse_string(self, text: str, debug: bool = ...) -> _NL: ... + def __init__(self, grammar: Grammar, convert: _Convert | None = None, logger: Logger | None = None) -> None: ... + def parse_tokens(self, tokens: Iterable[Any], debug: bool = False) -> _NL: ... + def parse_stream_raw(self, stream: IO[str], debug: bool = False) -> _NL: ... + def parse_stream(self, stream: IO[str], debug: bool = False) -> _NL: ... + def parse_file(self, filename: StrPath, encoding: str | None = None, debug: bool = False) -> _NL: ... + def parse_string(self, text: str, debug: bool = False) -> _NL: ... def load_grammar( - gt: str = ..., gp: str | None = ..., save: bool = ..., force: bool = ..., logger: Logger | None = ... + gt: str = "Grammar.txt", gp: str | None = None, save: bool = True, force: bool = False, logger: Logger | None = None ) -> Grammar: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/pgen2/grammar.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/pgen2/grammar.pyi index 4d298ec69..bef0a7922 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/pgen2/grammar.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/pgen2/grammar.pyi @@ -1,5 +1,5 @@ -from _typeshed import Self, StrPath -from typing_extensions import TypeAlias +from _typeshed import StrPath +from typing_extensions import Self, TypeAlias _Label: TypeAlias = tuple[int, str | None] _DFA: TypeAlias = list[list[tuple[int, int]]] @@ -15,10 +15,9 @@ class Grammar: tokens: dict[int, int] symbol2label: dict[str, int] start: int - def __init__(self) -> None: ... def dump(self, filename: StrPath) -> None: ... def load(self, filename: StrPath) -> None: ... - def copy(self: Self) -> Self: ... + def copy(self) -> Self: ... def report(self) -> None: ... opmap_raw: str diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/pgen2/parse.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/pgen2/parse.pyi index 6a07c4a4a..51eb671f4 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/pgen2/parse.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/pgen2/parse.pyi @@ -20,8 +20,8 @@ class Parser: stack: list[tuple[_DFAS, int, _RawNode]] rootnode: _NL | None used_names: set[str] - def __init__(self, grammar: Grammar, convert: _Convert | None = ...) -> None: ... - def setup(self, start: int | None = ...) -> None: ... + def __init__(self, grammar: Grammar, convert: _Convert | None = None) -> None: ... + def setup(self, start: int | None = None) -> None: ... def addtoken(self, type: int, value: str | None, context: _Context) -> bool: ... def classify(self, type: int, value: str | None, context: _Context) -> int: ... def shift(self, type: int, value: str | None, newstate: int, context: _Context) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/pgen2/pgen.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/pgen2/pgen.pyi index e3ea07432..d346739d4 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/pgen2/pgen.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/pgen2/pgen.pyi @@ -11,7 +11,7 @@ class ParserGenerator: stream: IO[str] generator: Iterator[_TokenInfo] first: dict[str, dict[str, int]] - def __init__(self, filename: StrPath, stream: IO[str] | None = ...) -> None: ... + def __init__(self, filename: StrPath, stream: IO[str] | None = None) -> None: ... def make_grammar(self) -> PgenGrammar: ... def make_first(self, c: PgenGrammar, name: str) -> dict[int, int]: ... def make_label(self, c: PgenGrammar, label: str) -> int: ... @@ -26,14 +26,13 @@ class ParserGenerator: def parse_alt(self) -> tuple[NFAState, NFAState]: ... def parse_item(self) -> tuple[NFAState, NFAState]: ... def parse_atom(self) -> tuple[NFAState, NFAState]: ... - def expect(self, type: int, value: Any | None = ...) -> str: ... + def expect(self, type: int, value: Any | None = None) -> str: ... def gettoken(self) -> None: ... def raise_error(self, msg: str, *args: Any) -> NoReturn: ... class NFAState: arcs: list[tuple[str | None, NFAState]] - def __init__(self) -> None: ... - def addarc(self, next: NFAState, label: str | None = ...) -> None: ... + def addarc(self, next: NFAState, label: str | None = None) -> None: ... class DFAState: nfaset: dict[NFAState, Any] @@ -44,4 +43,4 @@ class DFAState: def unifystate(self, old: DFAState, new: DFAState) -> None: ... def __eq__(self, other: DFAState) -> bool: ... # type: ignore[override] -def generate_grammar(filename: StrPath = ...) -> PgenGrammar: ... +def generate_grammar(filename: StrPath = "Grammar.txt") -> PgenGrammar: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/pgen2/tokenize.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/pgen2/tokenize.pyi index c9ad1e7bb..2a9c3fbba 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/pgen2/tokenize.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/pgen2/tokenize.pyi @@ -87,7 +87,6 @@ class Untokenizer: tokens: list[str] prev_row: int prev_col: int - def __init__(self) -> None: ... def add_whitespace(self, start: _Coord) -> None: ... def untokenize(self, iterable: Iterable[_TokenInfo]) -> str: ... def compat(self, token: tuple[int, str], iterable: Iterable[_TokenInfo]) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/pygram.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/pygram.pyi index bf96a55c4..00fdbd1a1 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/pygram.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/pygram.pyi @@ -1,3 +1,4 @@ +import sys from lib2to3.pgen2.grammar import Grammar class Symbols: @@ -110,4 +111,6 @@ class pattern_symbols(Symbols): python_grammar: Grammar python_grammar_no_print_statement: Grammar +if sys.version_info >= (3, 8): + python_grammar_no_print_and_exec_statement: Grammar pattern_grammar: Grammar diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/pytree.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/pytree.pyi index 4db9ab99b..4f756c976 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/pytree.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/pytree.pyi @@ -1,8 +1,7 @@ -from _typeshed import Self from collections.abc import Iterator from lib2to3.pgen2.grammar import Grammar from typing import Any -from typing_extensions import TypeAlias +from typing_extensions import Self, TypeAlias _NL: TypeAlias = Node | Leaf _Context: TypeAlias = tuple[str, int, int] @@ -21,8 +20,8 @@ class Base: was_changed: bool was_checked: bool def __eq__(self, other: object) -> bool: ... - def _eq(self: Self, other: Self) -> bool: ... - def clone(self: Self) -> Self: ... + def _eq(self, other: Self) -> bool: ... + def clone(self) -> Self: ... def post_order(self) -> Iterator[_NL]: ... def pre_order(self) -> Iterator[_NL]: ... def replace(self, new: _NL | list[_NL]) -> None: ... @@ -43,9 +42,9 @@ class Node(Base): self, type: int, children: list[_NL], - context: Any | None = ..., - prefix: str | None = ..., - fixers_applied: list[Any] | None = ..., + context: Any | None = None, + prefix: str | None = None, + fixers_applied: list[Any] | None = None, ) -> None: ... def set_child(self, i: int, child: _NL) -> None: ... def insert_child(self, i: int, child: _NL) -> None: ... @@ -58,7 +57,7 @@ class Leaf(Base): value: str fixers_applied: list[Any] def __init__( - self, type: int, value: str, context: _Context | None = ..., prefix: str | None = ..., fixers_applied: list[Any] = ... + self, type: int, value: str, context: _Context | None = None, prefix: str | None = None, fixers_applied: list[Any] = ... ) -> None: ... def __unicode__(self) -> str: ... @@ -69,23 +68,23 @@ class BasePattern: content: str | None name: str | None def optimize(self) -> BasePattern: ... # sic, subclasses are free to optimize themselves into different patterns - def match(self, node: _NL, results: _Results | None = ...) -> bool: ... - def match_seq(self, nodes: list[_NL], results: _Results | None = ...) -> bool: ... + def match(self, node: _NL, results: _Results | None = None) -> bool: ... + def match_seq(self, nodes: list[_NL], results: _Results | None = None) -> bool: ... def generate_matches(self, nodes: list[_NL]) -> Iterator[tuple[int, _Results]]: ... class LeafPattern(BasePattern): - def __init__(self, type: int | None = ..., content: str | None = ..., name: str | None = ...) -> None: ... + def __init__(self, type: int | None = None, content: str | None = None, name: str | None = None) -> None: ... class NodePattern(BasePattern): wildcards: bool - def __init__(self, type: int | None = ..., content: str | None = ..., name: str | None = ...) -> None: ... + def __init__(self, type: int | None = None, content: str | None = None, name: str | None = None) -> None: ... class WildcardPattern(BasePattern): min: int max: int - def __init__(self, content: str | None = ..., min: int = ..., max: int = ..., name: str | None = ...) -> None: ... + def __init__(self, content: str | None = None, min: int = 0, max: int = 0x7FFFFFFF, name: str | None = None) -> None: ... class NegatedPattern(BasePattern): - def __init__(self, content: str | None = ...) -> None: ... + def __init__(self, content: str | None = None) -> None: ... def generate_matches(patterns: list[BasePattern], nodes: list[_NL]) -> Iterator[tuple[int, _Results]]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/refactor.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/refactor.pyi index 3aaea0e51..f1d89679a 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/refactor.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/refactor.pyi @@ -8,7 +8,7 @@ from .pgen2.grammar import Grammar _Driver: TypeAlias = Any # really lib2to3.driver.Driver _BottomMatcher: TypeAlias = Any # really lib2to3.btm_matcher.BottomMatcher -def get_all_fix_names(fixer_pkg: str, remove_prefix: bool = ...) -> list[str]: ... +def get_all_fix_names(fixer_pkg: str, remove_prefix: bool = True) -> list[str]: ... def get_fixers_from_package(pkg_name: str) -> list[str]: ... class FixerError(Exception): ... @@ -33,25 +33,25 @@ class RefactoringTool: bmi_pre_order: list[Any] bmi_post_order: list[Any] def __init__( - self, fixer_names: Iterable[str], options: Mapping[str, Any] | None = ..., explicit: Container[str] | None = ... + self, fixer_names: Iterable[str], options: Mapping[str, Any] | None = None, explicit: Container[str] | None = None ) -> None: ... def get_fixers(self) -> tuple[list[Any], list[Any]]: ... def log_error(self, msg: str, *args: Any, **kwds: Any) -> NoReturn: ... def log_message(self, msg: str, *args: Any) -> None: ... def log_debug(self, msg: str, *args: Any) -> None: ... def print_output(self, old_text: str, new_text: str, filename: str, equal): ... - def refactor(self, items: Iterable[str], write: bool = ..., doctests_only: bool = ...) -> None: ... - def refactor_dir(self, dir_name: str, write: bool = ..., doctests_only: bool = ...) -> None: ... + def refactor(self, items: Iterable[str], write: bool = False, doctests_only: bool = False) -> None: ... + def refactor_dir(self, dir_name: str, write: bool = False, doctests_only: bool = False) -> None: ... def _read_python_source(self, filename: str) -> tuple[str, str]: ... - def refactor_file(self, filename: str, write: bool = ..., doctests_only: bool = ...) -> None: ... + def refactor_file(self, filename: str, write: bool = False, doctests_only: bool = False) -> None: ... def refactor_string(self, data: str, name: str): ... - def refactor_stdin(self, doctests_only: bool = ...) -> None: ... + def refactor_stdin(self, doctests_only: bool = False) -> None: ... def refactor_tree(self, tree, name: str) -> bool: ... def traverse_by(self, fixers, traversal) -> None: ... def processed_file( - self, new_text: str, filename: str, old_text: str | None = ..., write: bool = ..., encoding: str | None = ... + self, new_text: str, filename: str, old_text: str | None = None, write: bool = False, encoding: str | None = None ) -> None: ... - def write_file(self, new_text: str, filename: str, old_text: str, encoding: str | None = ...) -> None: ... + def write_file(self, new_text: str, filename: str, old_text: str, encoding: str | None = None) -> None: ... PS1: ClassVar[str] PS2: ClassVar[str] def refactor_docstring(self, input: str, filename: str) -> str: ... @@ -68,4 +68,6 @@ class MultiprocessingUnsupported(Exception): ... class MultiprocessRefactoringTool(RefactoringTool): queue: Any | None output_lock: Any | None - def refactor(self, items: Iterable[str], write: bool = ..., doctests_only: bool = ..., num_processes: int = ...) -> None: ... + def refactor( + self, items: Iterable[str], write: bool = False, doctests_only: bool = False, num_processes: int = 1 + ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/linecache.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/linecache.pyi index df54fd80a..8e317dd38 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/linecache.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/linecache.pyi @@ -15,9 +15,9 @@ class _SourceLoader(Protocol): cache: dict[str, _SourceLoader | _ModuleMetadata] # undocumented -def getline(filename: str, lineno: int, module_globals: _ModuleGlobals | None = ...) -> str: ... +def getline(filename: str, lineno: int, module_globals: _ModuleGlobals | None = None) -> str: ... def clearcache() -> None: ... -def getlines(filename: str, module_globals: _ModuleGlobals | None = ...) -> list[str]: ... -def checkcache(filename: str | None = ...) -> None: ... -def updatecache(filename: str, module_globals: _ModuleGlobals | None = ...) -> list[str]: ... +def getlines(filename: str, module_globals: _ModuleGlobals | None = None) -> list[str]: ... +def checkcache(filename: str | None = None) -> None: ... +def updatecache(filename: str, module_globals: _ModuleGlobals | None = None) -> list[str]: ... def lazycache(filename: str, module_globals: _ModuleGlobals) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/locale.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/locale.pyi index 9a3ea65d1..0b0dd9456 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/locale.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/locale.pyi @@ -111,19 +111,19 @@ CHAR_MAX: int class Error(Exception): ... -def setlocale(category: int, locale: _str | Iterable[_str | None] | None = ...) -> _str: ... +def setlocale(category: int, locale: _str | Iterable[_str | None] | None = None) -> _str: ... def localeconv() -> Mapping[_str, int | _str | list[int]]: ... def nl_langinfo(__key: int) -> _str: ... def getdefaultlocale(envvars: tuple[_str, ...] = ...) -> tuple[_str | None, _str | None]: ... def getlocale(category: int = ...) -> tuple[_str | None, _str | None]: ... -def getpreferredencoding(do_setlocale: bool = ...) -> _str: ... +def getpreferredencoding(do_setlocale: bool = True) -> _str: ... def normalize(localename: _str) -> _str: ... def resetlocale(category: int = ...) -> None: ... def strcoll(__os1: _str, __os2: _str) -> int: ... def strxfrm(__string: _str) -> _str: ... -def format(percent: _str, value: float | Decimal, grouping: bool = ..., monetary: bool = ..., *additional: Any) -> _str: ... -def format_string(f: _str, val: Any, grouping: bool = ..., monetary: bool = ...) -> _str: ... -def currency(val: float | Decimal, symbol: bool = ..., grouping: bool = ..., international: bool = ...) -> _str: ... +def format(percent: _str, value: float | Decimal, grouping: bool = False, monetary: bool = False, *additional: Any) -> _str: ... +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: ... def atof(string: _str, func: Callable[[_str], float] = ...) -> float: ... def atoi(string: _str) -> int: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/logging/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/logging/__init__.pyi index 0d3e80ddc..3c547a6e0 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/logging/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/logging/__init__.pyi @@ -1,14 +1,14 @@ import sys import threading -from _typeshed import Self, StrPath, SupportsWrite +from _typeshed import StrPath, SupportsWrite from collections.abc import Callable, Iterable, Mapping, MutableMapping, Sequence from io import TextIOWrapper from re import Pattern from string import Template from time import struct_time from types import FrameType, TracebackType -from typing import Any, ClassVar, Generic, TextIO, TypeVar, Union, overload -from typing_extensions import Literal, TypeAlias +from typing import Any, ClassVar, Generic, TextIO, TypeVar, overload +from typing_extensions import Literal, Self, TypeAlias if sys.version_info >= (3, 11): from types import GenericAlias @@ -61,10 +61,10 @@ __all__ = [ if sys.version_info >= (3, 11): __all__ += ["getLevelNamesMapping"] -_SysExcInfoType: TypeAlias = Union[tuple[type[BaseException], BaseException, TracebackType | None], tuple[None, None, None]] +_SysExcInfoType: TypeAlias = tuple[type[BaseException], BaseException, TracebackType | None] | tuple[None, None, None] _ExcInfoType: TypeAlias = None | bool | _SysExcInfoType | BaseException _ArgsType: TypeAlias = tuple[object, ...] | Mapping[str, object] -_FilterType: TypeAlias = Filter | Callable[[LogRecord], int] +_FilterType: TypeAlias = Filter | Callable[[LogRecord], bool] _Level: TypeAlias = int | str _FormatStyle: TypeAlias = Literal["%", "{", "$"] @@ -81,7 +81,6 @@ _nameToLevel: dict[str, int] class Filterer: filters: list[Filter] - def __init__(self) -> None: ... def addFilter(self, filter: _FilterType) -> None: ... def removeFilter(self, filter: _FilterType) -> None: ... def filter(self, record: LogRecord) -> bool: ... @@ -107,178 +106,177 @@ class Logger(Filterer): disabled: bool # undocumented root: ClassVar[RootLogger] # undocumented manager: Manager # undocumented - def __init__(self, name: str, level: _Level = ...) -> None: ... + def __init__(self, name: str, level: _Level = 0) -> None: ... def setLevel(self, level: _Level) -> None: ... def isEnabledFor(self, level: int) -> bool: ... def getEffectiveLevel(self) -> int: ... - def getChild(self: Self, suffix: str) -> Self: ... # see python/typing#980 + def getChild(self, suffix: str) -> Self: ... # see python/typing#980 if sys.version_info >= (3, 8): def debug( self, msg: object, *args: object, - exc_info: _ExcInfoType = ..., - stack_info: bool = ..., - stacklevel: int = ..., - extra: Mapping[str, object] | None = ..., + exc_info: _ExcInfoType = None, + stack_info: bool = False, + stacklevel: int = 1, + extra: Mapping[str, object] | None = None, ) -> None: ... def info( self, msg: object, *args: object, - exc_info: _ExcInfoType = ..., - stack_info: bool = ..., - stacklevel: int = ..., - extra: Mapping[str, object] | None = ..., + exc_info: _ExcInfoType = None, + stack_info: bool = False, + stacklevel: int = 1, + extra: Mapping[str, object] | None = None, ) -> None: ... def warning( self, msg: object, *args: object, - exc_info: _ExcInfoType = ..., - stack_info: bool = ..., - stacklevel: int = ..., - extra: Mapping[str, object] | None = ..., + exc_info: _ExcInfoType = None, + stack_info: bool = False, + stacklevel: int = 1, + extra: Mapping[str, object] | None = None, ) -> None: ... def warn( self, msg: object, *args: object, - exc_info: _ExcInfoType = ..., - stack_info: bool = ..., - stacklevel: int = ..., - extra: Mapping[str, object] | None = ..., + exc_info: _ExcInfoType = None, + stack_info: bool = False, + stacklevel: int = 1, + extra: Mapping[str, object] | None = None, ) -> None: ... def error( self, msg: object, *args: object, - exc_info: _ExcInfoType = ..., - stack_info: bool = ..., - stacklevel: int = ..., - extra: Mapping[str, object] | None = ..., + exc_info: _ExcInfoType = None, + stack_info: bool = False, + stacklevel: int = 1, + extra: Mapping[str, object] | None = None, ) -> None: ... def exception( self, msg: object, *args: object, - exc_info: _ExcInfoType = ..., - stack_info: bool = ..., - stacklevel: int = ..., - extra: Mapping[str, object] | None = ..., + exc_info: _ExcInfoType = True, + stack_info: bool = False, + stacklevel: int = 1, + extra: Mapping[str, object] | None = None, ) -> None: ... def critical( self, msg: object, *args: object, - exc_info: _ExcInfoType = ..., - stack_info: bool = ..., - stacklevel: int = ..., - extra: Mapping[str, object] | None = ..., + exc_info: _ExcInfoType = None, + stack_info: bool = False, + stacklevel: int = 1, + extra: Mapping[str, object] | None = None, ) -> None: ... def log( self, level: int, msg: object, *args: object, - exc_info: _ExcInfoType = ..., - stack_info: bool = ..., - stacklevel: int = ..., - extra: Mapping[str, object] | None = ..., + exc_info: _ExcInfoType = None, + stack_info: bool = False, + stacklevel: int = 1, + extra: Mapping[str, object] | None = None, ) -> None: ... def _log( self, level: int, msg: object, args: _ArgsType, - exc_info: _ExcInfoType | None = ..., - extra: Mapping[str, object] | None = ..., - stack_info: bool = ..., - stacklevel: int = ..., + exc_info: _ExcInfoType | None = None, + extra: Mapping[str, object] | None = None, + stack_info: bool = False, + stacklevel: int = 1, ) -> None: ... # undocumented else: def debug( self, msg: object, *args: object, - exc_info: _ExcInfoType = ..., - stack_info: bool = ..., - extra: Mapping[str, object] | None = ..., + exc_info: _ExcInfoType = None, + stack_info: bool = False, + extra: Mapping[str, object] | None = None, ) -> None: ... def info( self, msg: object, *args: object, - exc_info: _ExcInfoType = ..., - stack_info: bool = ..., - extra: Mapping[str, object] | None = ..., + exc_info: _ExcInfoType = None, + stack_info: bool = False, + extra: Mapping[str, object] | None = None, ) -> None: ... def warning( self, msg: object, *args: object, - exc_info: _ExcInfoType = ..., - stack_info: bool = ..., - extra: Mapping[str, object] | None = ..., + exc_info: _ExcInfoType = None, + stack_info: bool = False, + extra: Mapping[str, object] | None = None, ) -> None: ... def warn( self, msg: object, *args: object, - exc_info: _ExcInfoType = ..., - stack_info: bool = ..., - extra: Mapping[str, object] | None = ..., + exc_info: _ExcInfoType = None, + stack_info: bool = False, + extra: Mapping[str, object] | None = None, ) -> None: ... def error( self, msg: object, *args: object, - exc_info: _ExcInfoType = ..., - stack_info: bool = ..., - extra: Mapping[str, object] | None = ..., + exc_info: _ExcInfoType = None, + stack_info: bool = False, + extra: Mapping[str, object] | None = None, ) -> None: ... def critical( self, msg: object, *args: object, - exc_info: _ExcInfoType = ..., - stack_info: bool = ..., - extra: Mapping[str, object] | None = ..., + exc_info: _ExcInfoType = None, + stack_info: bool = False, + extra: Mapping[str, object] | None = None, ) -> None: ... def log( self, level: int, msg: object, *args: object, - exc_info: _ExcInfoType = ..., - stack_info: bool = ..., - extra: Mapping[str, object] | None = ..., + exc_info: _ExcInfoType = None, + stack_info: bool = False, + extra: Mapping[str, object] | None = None, ) -> None: ... def exception( self, msg: object, *args: object, - exc_info: _ExcInfoType = ..., - stack_info: bool = ..., - extra: Mapping[str, object] | None = ..., + exc_info: _ExcInfoType = True, + stack_info: bool = False, + extra: Mapping[str, object] | None = None, ) -> None: ... def _log( self, level: int, msg: object, args: _ArgsType, - exc_info: _ExcInfoType | None = ..., - extra: Mapping[str, object] | None = ..., - stack_info: bool = ..., + exc_info: _ExcInfoType | None = None, + extra: Mapping[str, object] | None = None, + stack_info: bool = False, ) -> None: ... # undocumented fatal = critical - def filter(self, record: LogRecord) -> bool: ... def addHandler(self, hdlr: Handler) -> None: ... def removeHandler(self, hdlr: Handler) -> None: ... if sys.version_info >= (3, 8): - def findCaller(self, stack_info: bool = ..., stacklevel: int = ...) -> tuple[str, int, str, str | None]: ... + def findCaller(self, stack_info: bool = False, stacklevel: int = 1) -> tuple[str, int, str, str | None]: ... else: - def findCaller(self, stack_info: bool = ...) -> tuple[str, int, str, str | None]: ... + def findCaller(self, stack_info: bool = False) -> tuple[str, int, str, str | None]: ... def handle(self, record: LogRecord) -> None: ... def makeRecord( @@ -290,9 +288,9 @@ class Logger(Filterer): msg: object, args: _ArgsType, exc_info: _SysExcInfoType | None, - func: str | None = ..., - extra: Mapping[str, object] | None = ..., - sinfo: str | None = ..., + func: str | None = None, + extra: Mapping[str, object] | None = None, + sinfo: str | None = None, ) -> LogRecord: ... def hasHandlers(self) -> bool: ... def callHandlers(self, record: LogRecord) -> None: ... # undocumented @@ -311,7 +309,7 @@ class Handler(Filterer): formatter: Formatter | None # undocumented lock: threading.Lock | None # undocumented name: str | None # undocumented - def __init__(self, level: _Level = ...) -> None: ... + def __init__(self, level: _Level = 0) -> None: ... def get_name(self) -> str: ... # undocumented def set_name(self, name: str) -> None: ... # undocumented def createLock(self) -> None: ... @@ -319,7 +317,6 @@ class Handler(Filterer): def release(self) -> None: ... def setLevel(self, level: _Level) -> None: ... def setFormatter(self, fmt: Formatter | None) -> None: ... - def filter(self, record: LogRecord) -> bool: ... def flush(self) -> None: ... def close(self) -> None: ... def handle(self, record: LogRecord) -> bool: ... @@ -341,22 +338,22 @@ class Formatter: if sys.version_info >= (3, 10): def __init__( self, - fmt: str | None = ..., - datefmt: str | None = ..., - style: _FormatStyle = ..., - validate: bool = ..., + fmt: str | None = None, + datefmt: str | None = None, + style: _FormatStyle = "%", + validate: bool = True, *, - defaults: Mapping[str, Any] | None = ..., + defaults: Mapping[str, Any] | None = None, ) -> None: ... elif sys.version_info >= (3, 8): def __init__( - self, fmt: str | None = ..., datefmt: str | None = ..., style: _FormatStyle = ..., validate: bool = ... + self, fmt: str | None = None, datefmt: str | None = None, style: _FormatStyle = "%", validate: bool = True ) -> None: ... else: - def __init__(self, fmt: str | None = ..., datefmt: str | None = ..., style: _FormatStyle = ...) -> None: ... + def __init__(self, fmt: str | None = None, datefmt: str | None = None, style: _FormatStyle = "%") -> None: ... def format(self, record: LogRecord) -> str: ... - def formatTime(self, record: LogRecord, datefmt: str | None = ...) -> str: ... + def formatTime(self, record: LogRecord, datefmt: str | None = None) -> str: ... def formatException(self, ei: _SysExcInfoType) -> str: ... def formatMessage(self, record: LogRecord) -> str: ... # undocumented def formatStack(self, stack_info: str) -> str: ... @@ -364,7 +361,7 @@ class Formatter: class BufferingFormatter: linefmt: Formatter - def __init__(self, linefmt: Formatter | None = ...) -> None: ... + def __init__(self, linefmt: Formatter | None = None) -> None: ... def formatHeader(self, records: Sequence[LogRecord]) -> str: ... def formatFooter(self, records: Sequence[LogRecord]) -> str: ... def format(self, records: Sequence[LogRecord]) -> str: ... @@ -372,7 +369,7 @@ class BufferingFormatter: class Filter: name: str # undocumented nlen: int # undocumented - def __init__(self, name: str = ...) -> None: ... + def __init__(self, name: str = "") -> None: ... def filter(self, record: LogRecord) -> bool: ... class LogRecord: @@ -410,8 +407,8 @@ class LogRecord: msg: object, args: _ArgsType | None, exc_info: _SysExcInfoType | None, - func: str | None = ..., - sinfo: str | None = ..., + func: str | None = None, + sinfo: str | None = None, ) -> None: ... def getMessage(self) -> str: ... # Allows setting contextual information on LogRecord objects as per the docs, see #7833 @@ -424,7 +421,7 @@ class LoggerAdapter(Generic[_L]): manager: Manager # undocumented if sys.version_info >= (3, 10): extra: Mapping[str, object] | None - def __init__(self, logger: _L, extra: Mapping[str, object] | None = ...) -> None: ... + def __init__(self, logger: _L, extra: Mapping[str, object] | None = None) -> None: ... else: extra: Mapping[str, object] def __init__(self, logger: _L, extra: Mapping[str, object]) -> None: ... @@ -435,70 +432,70 @@ class LoggerAdapter(Generic[_L]): self, msg: object, *args: object, - exc_info: _ExcInfoType = ..., - stack_info: bool = ..., - stacklevel: int = ..., - extra: Mapping[str, object] | None = ..., + exc_info: _ExcInfoType = None, + stack_info: bool = False, + stacklevel: int = 1, + extra: Mapping[str, object] | None = None, **kwargs: object, ) -> None: ... def info( self, msg: object, *args: object, - exc_info: _ExcInfoType = ..., - stack_info: bool = ..., - stacklevel: int = ..., - extra: Mapping[str, object] | None = ..., + exc_info: _ExcInfoType = None, + stack_info: bool = False, + stacklevel: int = 1, + extra: Mapping[str, object] | None = None, **kwargs: object, ) -> None: ... def warning( self, msg: object, *args: object, - exc_info: _ExcInfoType = ..., - stack_info: bool = ..., - stacklevel: int = ..., - extra: Mapping[str, object] | None = ..., + exc_info: _ExcInfoType = None, + stack_info: bool = False, + stacklevel: int = 1, + extra: Mapping[str, object] | None = None, **kwargs: object, ) -> None: ... def warn( self, msg: object, *args: object, - exc_info: _ExcInfoType = ..., - stack_info: bool = ..., - stacklevel: int = ..., - extra: Mapping[str, object] | None = ..., + exc_info: _ExcInfoType = None, + stack_info: bool = False, + stacklevel: int = 1, + extra: Mapping[str, object] | None = None, **kwargs: object, ) -> None: ... def error( self, msg: object, *args: object, - exc_info: _ExcInfoType = ..., - stack_info: bool = ..., - stacklevel: int = ..., - extra: Mapping[str, object] | None = ..., + exc_info: _ExcInfoType = None, + stack_info: bool = False, + stacklevel: int = 1, + extra: Mapping[str, object] | None = None, **kwargs: object, ) -> None: ... def exception( self, msg: object, *args: object, - exc_info: _ExcInfoType = ..., - stack_info: bool = ..., - stacklevel: int = ..., - extra: Mapping[str, object] | None = ..., + exc_info: _ExcInfoType = True, + stack_info: bool = False, + stacklevel: int = 1, + extra: Mapping[str, object] | None = None, **kwargs: object, ) -> None: ... def critical( self, msg: object, *args: object, - exc_info: _ExcInfoType = ..., - stack_info: bool = ..., - stacklevel: int = ..., - extra: Mapping[str, object] | None = ..., + exc_info: _ExcInfoType = None, + stack_info: bool = False, + stacklevel: int = 1, + extra: Mapping[str, object] | None = None, **kwargs: object, ) -> None: ... def log( @@ -506,10 +503,10 @@ class LoggerAdapter(Generic[_L]): level: int, msg: object, *args: object, - exc_info: _ExcInfoType = ..., - stack_info: bool = ..., - stacklevel: int = ..., - extra: Mapping[str, object] | None = ..., + exc_info: _ExcInfoType = None, + stack_info: bool = False, + stacklevel: int = 1, + extra: Mapping[str, object] | None = None, **kwargs: object, ) -> None: ... else: @@ -517,63 +514,63 @@ class LoggerAdapter(Generic[_L]): self, msg: object, *args: object, - exc_info: _ExcInfoType = ..., - stack_info: bool = ..., - extra: Mapping[str, object] | None = ..., + exc_info: _ExcInfoType = None, + stack_info: bool = False, + extra: Mapping[str, object] | None = None, **kwargs: object, ) -> None: ... def info( self, msg: object, *args: object, - exc_info: _ExcInfoType = ..., - stack_info: bool = ..., - extra: Mapping[str, object] | None = ..., + exc_info: _ExcInfoType = None, + stack_info: bool = False, + extra: Mapping[str, object] | None = None, **kwargs: object, ) -> None: ... def warning( self, msg: object, *args: object, - exc_info: _ExcInfoType = ..., - stack_info: bool = ..., - extra: Mapping[str, object] | None = ..., + exc_info: _ExcInfoType = None, + stack_info: bool = False, + extra: Mapping[str, object] | None = None, **kwargs: object, ) -> None: ... def warn( self, msg: object, *args: object, - exc_info: _ExcInfoType = ..., - stack_info: bool = ..., - extra: Mapping[str, object] | None = ..., + exc_info: _ExcInfoType = None, + stack_info: bool = False, + extra: Mapping[str, object] | None = None, **kwargs: object, ) -> None: ... def error( self, msg: object, *args: object, - exc_info: _ExcInfoType = ..., - stack_info: bool = ..., - extra: Mapping[str, object] | None = ..., + exc_info: _ExcInfoType = None, + stack_info: bool = False, + extra: Mapping[str, object] | None = None, **kwargs: object, ) -> None: ... def exception( self, msg: object, *args: object, - exc_info: _ExcInfoType = ..., - stack_info: bool = ..., - extra: Mapping[str, object] | None = ..., + exc_info: _ExcInfoType = True, + stack_info: bool = False, + extra: Mapping[str, object] | None = None, **kwargs: object, ) -> None: ... def critical( self, msg: object, *args: object, - exc_info: _ExcInfoType = ..., - stack_info: bool = ..., - extra: Mapping[str, object] | None = ..., + exc_info: _ExcInfoType = None, + stack_info: bool = False, + extra: Mapping[str, object] | None = None, **kwargs: object, ) -> None: ... def log( @@ -581,9 +578,9 @@ class LoggerAdapter(Generic[_L]): level: int, msg: object, *args: object, - exc_info: _ExcInfoType = ..., - stack_info: bool = ..., - extra: Mapping[str, object] | None = ..., + exc_info: _ExcInfoType = None, + stack_info: bool = False, + extra: Mapping[str, object] | None = None, **kwargs: object, ) -> None: ... @@ -596,16 +593,16 @@ class LoggerAdapter(Generic[_L]): level: int, msg: object, args: _ArgsType, - exc_info: _ExcInfoType | None = ..., - extra: Mapping[str, object] | None = ..., - stack_info: bool = ..., + exc_info: _ExcInfoType | None = None, + extra: Mapping[str, object] | None = None, + stack_info: bool = False, ) -> None: ... # undocumented @property def name(self) -> str: ... # undocumented if sys.version_info >= (3, 11): def __class_getitem__(cls, item: Any) -> GenericAlias: ... -def getLogger(name: str | None = ...) -> Logger: ... +def getLogger(name: str | None = None) -> Logger: ... def getLoggerClass() -> type[Logger]: ... def getLogRecordFactory() -> Callable[..., LogRecord]: ... @@ -613,103 +610,131 @@ if sys.version_info >= (3, 8): def debug( msg: object, *args: object, - exc_info: _ExcInfoType = ..., - stack_info: bool = ..., - stacklevel: int = ..., - extra: Mapping[str, object] | None = ..., + exc_info: _ExcInfoType = None, + stack_info: bool = False, + stacklevel: int = 1, + extra: Mapping[str, object] | None = None, ) -> None: ... def info( msg: object, *args: object, - exc_info: _ExcInfoType = ..., - stack_info: bool = ..., - stacklevel: int = ..., - extra: Mapping[str, object] | None = ..., + exc_info: _ExcInfoType = None, + stack_info: bool = False, + stacklevel: int = 1, + extra: Mapping[str, object] | None = None, ) -> None: ... def warning( msg: object, *args: object, - exc_info: _ExcInfoType = ..., - stack_info: bool = ..., - stacklevel: int = ..., - extra: Mapping[str, object] | None = ..., + exc_info: _ExcInfoType = None, + stack_info: bool = False, + stacklevel: int = 1, + extra: Mapping[str, object] | None = None, ) -> None: ... def warn( msg: object, *args: object, - exc_info: _ExcInfoType = ..., - stack_info: bool = ..., - stacklevel: int = ..., - extra: Mapping[str, object] | None = ..., + exc_info: _ExcInfoType = None, + stack_info: bool = False, + stacklevel: int = 1, + extra: Mapping[str, object] | None = None, ) -> None: ... def error( msg: object, *args: object, - exc_info: _ExcInfoType = ..., - stack_info: bool = ..., - stacklevel: int = ..., - extra: Mapping[str, object] | None = ..., + exc_info: _ExcInfoType = None, + stack_info: bool = False, + stacklevel: int = 1, + extra: Mapping[str, object] | None = None, ) -> None: ... def critical( msg: object, *args: object, - exc_info: _ExcInfoType = ..., - stack_info: bool = ..., - stacklevel: int = ..., - extra: Mapping[str, object] | None = ..., + exc_info: _ExcInfoType = None, + stack_info: bool = False, + stacklevel: int = 1, + extra: Mapping[str, object] | None = None, ) -> None: ... def exception( msg: object, *args: object, - exc_info: _ExcInfoType = ..., - stack_info: bool = ..., - stacklevel: int = ..., - extra: Mapping[str, object] | None = ..., + exc_info: _ExcInfoType = True, + stack_info: bool = False, + stacklevel: int = 1, + extra: Mapping[str, object] | None = None, ) -> None: ... def log( level: int, msg: object, *args: object, - exc_info: _ExcInfoType = ..., - stack_info: bool = ..., - stacklevel: int = ..., - extra: Mapping[str, object] | None = ..., + exc_info: _ExcInfoType = None, + stack_info: bool = False, + stacklevel: int = 1, + extra: Mapping[str, object] | None = None, ) -> None: ... else: def debug( - msg: object, *args: object, exc_info: _ExcInfoType = ..., stack_info: bool = ..., extra: Mapping[str, object] | None = ... + msg: object, + *args: object, + exc_info: _ExcInfoType = None, + stack_info: bool = False, + extra: Mapping[str, object] | None = None, ) -> None: ... def info( - msg: object, *args: object, exc_info: _ExcInfoType = ..., stack_info: bool = ..., extra: Mapping[str, object] | None = ... + msg: object, + *args: object, + exc_info: _ExcInfoType = None, + stack_info: bool = False, + extra: Mapping[str, object] | None = None, ) -> None: ... def warning( - msg: object, *args: object, exc_info: _ExcInfoType = ..., stack_info: bool = ..., extra: Mapping[str, object] | None = ... + msg: object, + *args: object, + exc_info: _ExcInfoType = None, + stack_info: bool = False, + extra: Mapping[str, object] | None = None, ) -> None: ... def warn( - msg: object, *args: object, exc_info: _ExcInfoType = ..., stack_info: bool = ..., extra: Mapping[str, object] | None = ... + msg: object, + *args: object, + exc_info: _ExcInfoType = None, + stack_info: bool = False, + extra: Mapping[str, object] | None = None, ) -> None: ... def error( - msg: object, *args: object, exc_info: _ExcInfoType = ..., stack_info: bool = ..., extra: Mapping[str, object] | None = ... + msg: object, + *args: object, + exc_info: _ExcInfoType = None, + stack_info: bool = False, + extra: Mapping[str, object] | None = None, ) -> None: ... def critical( - msg: object, *args: object, exc_info: _ExcInfoType = ..., stack_info: bool = ..., extra: Mapping[str, object] | None = ... + msg: object, + *args: object, + exc_info: _ExcInfoType = None, + stack_info: bool = False, + extra: Mapping[str, object] | None = None, ) -> None: ... def exception( - msg: object, *args: object, exc_info: _ExcInfoType = ..., stack_info: bool = ..., extra: Mapping[str, object] | None = ... + msg: object, + *args: object, + exc_info: _ExcInfoType = True, + stack_info: bool = False, + extra: Mapping[str, object] | None = None, ) -> None: ... def log( level: int, msg: object, *args: object, - exc_info: _ExcInfoType = ..., - stack_info: bool = ..., - extra: Mapping[str, object] | None = ..., + exc_info: _ExcInfoType = None, + stack_info: bool = False, + extra: Mapping[str, object] | None = None, ) -> None: ... fatal = critical -def disable(level: int = ...) -> None: ... +def disable(level: int = 50) -> None: ... def addLevelName(level: int, levelName: str) -> None: ... def getLevelName(level: _Level) -> Any: ... @@ -774,7 +799,7 @@ class StreamHandler(Handler, Generic[_StreamT]): stream: _StreamT # undocumented terminator: str @overload - def __init__(self: StreamHandler[TextIO], stream: None = ...) -> None: ... + def __init__(self: StreamHandler[TextIO], stream: None = None) -> None: ... @overload def __init__(self: StreamHandler[_StreamT], stream: _StreamT) -> None: ... def setStream(self, stream: _StreamT) -> _StreamT | None: ... @@ -789,10 +814,10 @@ class FileHandler(StreamHandler[TextIOWrapper]): if sys.version_info >= (3, 9): errors: str | None # undocumented def __init__( - self, filename: StrPath, mode: str = ..., encoding: str | None = ..., delay: bool = ..., errors: str | None = ... + self, filename: StrPath, mode: str = "a", encoding: str | None = None, delay: bool = False, errors: str | None = None ) -> None: ... else: - def __init__(self, filename: StrPath, mode: str = ..., encoding: str | None = ..., delay: bool = ...) -> None: ... + def __init__(self, filename: StrPath, mode: str = "a", encoding: str | None = None, delay: bool = False) -> None: ... def _open(self) -> TextIOWrapper: ... # undocumented @@ -818,7 +843,7 @@ class PercentStyle: # undocumented validation_pattern: Pattern[str] _fmt: str if sys.version_info >= (3, 10): - def __init__(self, fmt: str, *, defaults: Mapping[str, Any] | None = ...) -> None: ... + def __init__(self, fmt: str, *, defaults: Mapping[str, Any] | None = None) -> None: ... else: def __init__(self, fmt: str) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/logging/config.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/logging/config.pyi index 12e222680..f76f655a6 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/logging/config.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/logging/config.pyi @@ -49,18 +49,18 @@ def dictConfig(config: _DictConfigArgs | dict[str, Any]) -> None: ... if sys.version_info >= (3, 10): def fileConfig( fname: StrOrBytesPath | IO[str] | RawConfigParser, - defaults: dict[str, str] | None = ..., - disable_existing_loggers: bool = ..., - encoding: str | None = ..., + defaults: dict[str, str] | None = None, + disable_existing_loggers: bool = True, + encoding: str | None = None, ) -> None: ... else: def fileConfig( fname: StrOrBytesPath | IO[str] | RawConfigParser, - defaults: dict[str, str] | None = ..., - disable_existing_loggers: bool = ..., + defaults: dict[str, str] | None = None, + disable_existing_loggers: bool = True, ) -> None: ... def valid_ident(s: str) -> Literal[True]: ... # undocumented -def listen(port: int = ..., verify: Callable[[bytes], bytes | None] | None = ...) -> Thread: ... +def listen(port: int = 9030, verify: Callable[[bytes], bytes | None] | None = None) -> Thread: ... def stopListening() -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/logging/handlers.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/logging/handlers.pyi index eec4ed969..7e0bfd705 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/logging/handlers.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/logging/handlers.pyi @@ -2,7 +2,7 @@ import datetime import http.client import ssl import sys -from _typeshed import StrPath +from _typeshed import ReadableBuffer, StrPath from collections.abc import Callable from logging import FileHandler, Handler, LogRecord from queue import Queue, SimpleQueue @@ -22,10 +22,10 @@ class WatchedFileHandler(FileHandler): ino: int # undocumented if sys.version_info >= (3, 9): def __init__( - self, filename: StrPath, mode: str = ..., encoding: str | None = ..., delay: bool = ..., errors: str | None = ... + self, filename: StrPath, mode: str = "a", encoding: str | None = None, delay: bool = False, errors: str | None = None ) -> None: ... else: - def __init__(self, filename: StrPath, mode: str = ..., encoding: str | None = ..., delay: bool = ...) -> None: ... + def __init__(self, filename: StrPath, mode: str = "a", encoding: str | None = None, delay: bool = False) -> None: ... def _statstream(self) -> None: ... # undocumented def reopenIfNeeded(self) -> None: ... @@ -35,10 +35,10 @@ class BaseRotatingHandler(FileHandler): rotator: Callable[[str, str], None] | None if sys.version_info >= (3, 9): def __init__( - self, filename: StrPath, mode: str, encoding: str | None = ..., delay: bool = ..., errors: str | None = ... + self, filename: StrPath, mode: str, encoding: str | None = None, delay: bool = False, errors: str | None = None ) -> None: ... else: - def __init__(self, filename: StrPath, mode: str, encoding: str | None = ..., delay: bool = ...) -> None: ... + def __init__(self, filename: StrPath, mode: str, encoding: str | None = None, delay: bool = False) -> None: ... def rotation_filename(self, default_name: str) -> str: ... def rotate(self, source: str, dest: str) -> None: ... @@ -50,22 +50,22 @@ class RotatingFileHandler(BaseRotatingHandler): def __init__( self, filename: StrPath, - mode: str = ..., - maxBytes: int = ..., - backupCount: int = ..., - encoding: str | None = ..., - delay: bool = ..., - errors: str | None = ..., + mode: str = "a", + maxBytes: int = 0, + backupCount: int = 0, + encoding: str | None = None, + delay: bool = False, + errors: str | None = None, ) -> None: ... else: def __init__( self, filename: StrPath, - mode: str = ..., - maxBytes: int = ..., - backupCount: int = ..., - encoding: str | None = ..., - delay: bool = ..., + mode: str = "a", + maxBytes: int = 0, + backupCount: int = 0, + encoding: str | None = None, + delay: bool = False, ) -> None: ... def doRollover(self) -> None: ... @@ -85,26 +85,26 @@ class TimedRotatingFileHandler(BaseRotatingHandler): def __init__( self, filename: StrPath, - when: str = ..., - interval: int = ..., - backupCount: int = ..., - encoding: str | None = ..., - delay: bool = ..., - utc: bool = ..., - atTime: datetime.time | None = ..., - errors: str | None = ..., + when: str = "h", + interval: int = 1, + backupCount: int = 0, + encoding: str | None = None, + delay: bool = False, + utc: bool = False, + atTime: datetime.time | None = None, + errors: str | None = None, ) -> None: ... else: def __init__( self, filename: StrPath, - when: str = ..., - interval: int = ..., - backupCount: int = ..., - encoding: str | None = ..., - delay: bool = ..., - utc: bool = ..., - atTime: datetime.time | None = ..., + when: str = "h", + interval: int = 1, + backupCount: int = 0, + encoding: str | None = None, + delay: bool = False, + utc: bool = False, + atTime: datetime.time | None = None, ) -> None: ... def doRollover(self) -> None: ... @@ -123,9 +123,9 @@ class SocketHandler(Handler): retryFactor: float # undocumented retryMax: float # undocumented def __init__(self, host: str, port: int | None) -> None: ... - def makeSocket(self, timeout: float = ...) -> socket: ... # timeout is undocumented + def makeSocket(self, timeout: float = 1) -> socket: ... # timeout is undocumented def makePickle(self, record: LogRecord) -> bytes: ... - def send(self, s: bytes) -> None: ... + def send(self, s: ReadableBuffer) -> None: ... def createSocket(self) -> None: ... class DatagramHandler(SocketHandler): @@ -177,7 +177,7 @@ class SysLogHandler(Handler): priority_names: ClassVar[dict[str, int]] # undocumented facility_names: ClassVar[dict[str, int]] # undocumented priority_map: ClassVar[dict[str, str]] # undocumented - def __init__(self, address: tuple[str, int] | str = ..., facility: int = ..., socktype: SocketKind | None = ...) -> None: ... + def __init__(self, address: tuple[str, int] | str = ..., facility: int = 1, socktype: SocketKind | None = None) -> None: ... if sys.version_info >= (3, 11): def createSocket(self) -> None: ... @@ -185,7 +185,7 @@ class SysLogHandler(Handler): def mapPriority(self, levelName: str) -> str: ... class NTEventLogHandler(Handler): - def __init__(self, appname: str, dllname: str | None = ..., logtype: str = ...) -> None: ... + def __init__(self, appname: str, dllname: str | None = None, logtype: str = "Application") -> None: ... def getEventCategory(self, record: LogRecord) -> int: ... # TODO correct return value? def getEventType(self, record: LogRecord) -> int: ... @@ -208,9 +208,9 @@ class SMTPHandler(Handler): fromaddr: str, toaddrs: str | list[str], subject: str, - credentials: tuple[str, str] | None = ..., - secure: tuple[()] | tuple[str] | tuple[str, str] | None = ..., - timeout: float = ..., + credentials: tuple[str, str] | None = None, + secure: tuple[()] | tuple[str] | tuple[str, str] | None = None, + timeout: float = 5.0, ) -> None: ... def getSubject(self, record: LogRecord) -> str: ... @@ -224,7 +224,7 @@ class MemoryHandler(BufferingHandler): flushLevel: int # undocumented target: Handler | None # undocumented flushOnClose: bool # undocumented - def __init__(self, capacity: int, flushLevel: int = ..., target: Handler | None = ..., flushOnClose: bool = ...) -> None: ... + def __init__(self, capacity: int, flushLevel: int = 40, target: Handler | None = None, flushOnClose: bool = True) -> None: ... def setTarget(self, target: Handler | None) -> None: ... class HTTPHandler(Handler): @@ -238,10 +238,10 @@ class HTTPHandler(Handler): self, host: str, url: str, - method: str = ..., - secure: bool = ..., - credentials: tuple[str, str] | None = ..., - context: ssl.SSLContext | None = ..., + method: str = "GET", + secure: bool = False, + credentials: tuple[str, str] | None = None, + context: ssl.SSLContext | None = None, ) -> None: ... def mapLogRecord(self, record: LogRecord) -> dict[str, Any]: ... if sys.version_info >= (3, 9): @@ -257,7 +257,7 @@ class QueueListener: handlers: tuple[Handler, ...] # undocumented respect_handler_level: bool # undocumented queue: SimpleQueue[Any] | Queue[Any] # undocumented - def __init__(self, queue: SimpleQueue[Any] | Queue[Any], *handlers: Handler, respect_handler_level: bool = ...) -> None: ... + def __init__(self, queue: SimpleQueue[Any] | Queue[Any], *handlers: Handler, respect_handler_level: bool = False) -> None: ... def dequeue(self, block: bool) -> LogRecord: ... def prepare(self, record: LogRecord) -> Any: ... def start(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/lzma.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/lzma.pyi index d4c7977b8..8e296bb5b 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/lzma.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/lzma.pyi @@ -1,8 +1,8 @@ import io -from _typeshed import ReadableBuffer, Self, StrOrBytesPath +from _typeshed import ReadableBuffer, StrOrBytesPath from collections.abc import Mapping, Sequence from typing import IO, Any, TextIO, overload -from typing_extensions import Literal, TypeAlias, final +from typing_extensions import Literal, Self, TypeAlias, final __all__ = [ "CHECK_NONE", @@ -83,7 +83,7 @@ PRESET_EXTREME: int # v big number @final class LZMADecompressor: def __init__(self, format: int | None = ..., memlimit: int | None = ..., filters: _FilterChain | None = ...) -> None: ... - def decompress(self, data: bytes, max_length: int = ...) -> bytes: ... + def decompress(self, data: ReadableBuffer, max_length: int = -1) -> bytes: ... @property def check(self) -> int: ... @property @@ -99,105 +99,99 @@ class LZMACompressor: def __init__( self, format: int | None = ..., check: int = ..., preset: int | None = ..., filters: _FilterChain | None = ... ) -> None: ... - def compress(self, __data: bytes) -> bytes: ... + def compress(self, __data: ReadableBuffer) -> bytes: ... def flush(self) -> bytes: ... class LZMAError(Exception): ... -class LZMAFile(io.BufferedIOBase, IO[bytes]): +class LZMAFile(io.BufferedIOBase, IO[bytes]): # type: ignore[misc] # incompatible definitions of writelines in the base classes def __init__( self, - filename: _PathOrFile | None = ..., - mode: str = ..., + filename: _PathOrFile | None = None, + mode: str = "r", *, - format: int | None = ..., - check: int = ..., - preset: int | None = ..., - filters: _FilterChain | None = ..., + format: int | None = None, + check: int = -1, + preset: int | None = None, + filters: _FilterChain | None = None, ) -> None: ... - def __enter__(self: Self) -> Self: ... - def close(self) -> None: ... - @property - def closed(self) -> bool: ... - def fileno(self) -> int: ... - def seekable(self) -> bool: ... - def readable(self) -> bool: ... - def writable(self) -> bool: ... - def peek(self, size: int = ...) -> bytes: ... - def read(self, size: int | None = ...) -> bytes: ... - def read1(self, size: int = ...) -> bytes: ... - def readline(self, size: int | None = ...) -> bytes: ... + def __enter__(self) -> Self: ... + def peek(self, size: int = -1) -> bytes: ... + def read(self, size: int | None = -1) -> bytes: ... + def read1(self, size: int = -1) -> bytes: ... + def readline(self, size: int | None = -1) -> bytes: ... def write(self, data: ReadableBuffer) -> int: ... - def seek(self, offset: int, whence: int = ...) -> int: ... - def tell(self) -> int: ... + def seek(self, offset: int, whence: int = 0) -> int: ... @overload def open( filename: _PathOrFile, - mode: Literal["r", "rb"] = ..., + mode: Literal["r", "rb"] = "rb", *, - format: int | None = ..., - check: Literal[-1] = ..., - preset: None = ..., - filters: _FilterChain | None = ..., - encoding: None = ..., - errors: None = ..., - newline: None = ..., + format: int | None = None, + check: Literal[-1] = -1, + preset: None = None, + filters: _FilterChain | None = None, + encoding: None = None, + errors: None = None, + newline: None = None, ) -> LZMAFile: ... @overload def open( filename: _PathOrFile, mode: _OpenBinaryWritingMode, *, - format: int | None = ..., - check: int = ..., - preset: int | None = ..., - filters: _FilterChain | None = ..., - encoding: None = ..., - errors: None = ..., - newline: None = ..., + format: int | None = None, + check: int = -1, + preset: int | None = None, + filters: _FilterChain | None = None, + encoding: None = None, + errors: None = None, + newline: None = None, ) -> LZMAFile: ... @overload def open( filename: StrOrBytesPath, mode: Literal["rt"], *, - format: int | None = ..., - check: Literal[-1] = ..., - preset: None = ..., - filters: _FilterChain | None = ..., - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., + format: int | None = None, + check: Literal[-1] = -1, + preset: None = None, + filters: _FilterChain | None = None, + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, ) -> TextIO: ... @overload def open( filename: StrOrBytesPath, mode: _OpenTextWritingMode, *, - format: int | None = ..., - check: int = ..., - preset: int | None = ..., - filters: _FilterChain | None = ..., - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., + format: int | None = None, + check: int = -1, + preset: int | None = None, + filters: _FilterChain | None = None, + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, ) -> TextIO: ... @overload def open( filename: _PathOrFile, mode: str, *, - format: int | None = ..., - check: int = ..., - preset: int | None = ..., - filters: _FilterChain | None = ..., - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., + format: int | None = None, + check: int = -1, + preset: int | None = None, + filters: _FilterChain | None = None, + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, ) -> LZMAFile | TextIO: ... def compress( - data: bytes, format: int = ..., check: int = ..., preset: int | None = ..., filters: _FilterChain | None = ... + data: ReadableBuffer, format: int = 1, check: int = -1, preset: int | None = None, filters: _FilterChain | None = None +) -> bytes: ... +def decompress( + data: ReadableBuffer, format: int = 0, memlimit: int | None = None, filters: _FilterChain | None = None ) -> bytes: ... -def decompress(data: bytes, format: int = ..., memlimit: int | None = ..., filters: _FilterChain | None = ...) -> bytes: ... def is_check_supported(__check_id: int) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/mailbox.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/mailbox.pyi index 3169e8cfa..8053fad88 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/mailbox.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/mailbox.pyi @@ -1,11 +1,12 @@ import email.message +import io import sys -from _typeshed import Self, StrOrBytesPath +from _typeshed import StrPath, SupportsNoArgReadline, SupportsRead from abc import ABCMeta, abstractmethod from collections.abc import Callable, Iterable, Iterator, Mapping, Sequence from types import TracebackType from typing import IO, Any, AnyStr, Generic, Protocol, TypeVar, overload -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal, Self, TypeAlias if sys.version_info >= (3, 9): from types import GenericAlias @@ -32,7 +33,10 @@ __all__ = [ _T = TypeVar("_T") _MessageT = TypeVar("_MessageT", bound=Message) -_MessageData: TypeAlias = email.message.Message | bytes | str | IO[str] | IO[bytes] + +class _SupportsReadAndReadline(SupportsRead[bytes], SupportsNoArgReadline[bytes], Protocol): ... + +_MessageData: TypeAlias = email.message.Message | bytes | str | io.StringIO | _SupportsReadAndReadline class _HasIteritems(Protocol): def iteritems(self) -> Iterator[tuple[str, _MessageData]]: ... @@ -43,13 +47,12 @@ class _HasItems(Protocol): linesep: bytes class Mailbox(Generic[_MessageT]): - - _path: bytes | str # undocumented + _path: str # undocumented _factory: Callable[[IO[Any]], _MessageT] | None # undocumented @overload - def __init__(self, path: StrOrBytesPath, factory: Callable[[IO[Any]], _MessageT], create: bool = ...) -> None: ... + def __init__(self, path: StrPath, factory: Callable[[IO[Any]], _MessageT], create: bool = True) -> None: ... @overload - def __init__(self, path: StrOrBytesPath, factory: None = ..., create: bool = ...) -> None: ... + def __init__(self, path: StrPath, factory: None = None, create: bool = True) -> None: ... @abstractmethod def add(self, message: _MessageData) -> str: ... @abstractmethod @@ -59,7 +62,7 @@ class Mailbox(Generic[_MessageT]): @abstractmethod def __setitem__(self, key: str, message: _MessageData) -> None: ... @overload - def get(self, key: str, default: None = ...) -> _MessageT | None: ... + def get(self, key: str, default: None = None) -> _MessageT | None: ... @overload def get(self, key: str, default: _T) -> _MessageT | _T: ... def __getitem__(self, key: str) -> _MessageT: ... @@ -85,11 +88,11 @@ class Mailbox(Generic[_MessageT]): def __len__(self) -> int: ... def clear(self) -> None: ... @overload - def pop(self, key: str, default: None = ...) -> _MessageT | None: ... + def pop(self, key: str, default: None = None) -> _MessageT | None: ... @overload - def pop(self, key: str, default: _T = ...) -> _MessageT | _T: ... + def pop(self, key: str, default: _T) -> _MessageT | _T: ... def popitem(self) -> tuple[str, _MessageT]: ... - def update(self, arg: _HasIteritems | _HasItems | Iterable[tuple[str, _MessageData]] | None = ...) -> None: ... + def update(self, arg: _HasIteritems | _HasItems | Iterable[tuple[str, _MessageData]] | None = None) -> None: ... @abstractmethod def flush(self) -> None: ... @abstractmethod @@ -102,10 +105,9 @@ class Mailbox(Generic[_MessageT]): def __class_getitem__(cls, item: Any) -> GenericAlias: ... class Maildir(Mailbox[MaildirMessage]): - colon: str def __init__( - self, dirname: StrOrBytesPath, factory: Callable[[IO[Any]], MaildirMessage] | None = ..., create: bool = ... + self, dirname: StrPath, factory: Callable[[IO[Any]], MaildirMessage] | None = None, create: bool = True ) -> None: ... def add(self, message: _MessageData) -> str: ... def remove(self, key: str) -> None: ... @@ -141,24 +143,18 @@ class _singlefileMailbox(Mailbox[_MessageT], metaclass=ABCMeta): class _mboxMMDF(_singlefileMailbox[_MessageT]): def get_message(self, key: str) -> _MessageT: ... - def get_file(self, key: str, from_: bool = ...) -> _PartialFile[bytes]: ... - def get_bytes(self, key: str, from_: bool = ...) -> bytes: ... - def get_string(self, key: str, from_: bool = ...) -> str: ... + def get_file(self, key: str, from_: bool = False) -> _PartialFile[bytes]: ... + def get_bytes(self, key: str, from_: bool = False) -> bytes: ... + def get_string(self, key: str, from_: bool = False) -> str: ... class mbox(_mboxMMDF[mboxMessage]): - def __init__( - self, path: StrOrBytesPath, factory: Callable[[IO[Any]], mboxMessage] | None = ..., create: bool = ... - ) -> None: ... + def __init__(self, path: StrPath, factory: Callable[[IO[Any]], mboxMessage] | None = None, create: bool = True) -> None: ... class MMDF(_mboxMMDF[MMDFMessage]): - def __init__( - self, path: StrOrBytesPath, factory: Callable[[IO[Any]], MMDFMessage] | None = ..., create: bool = ... - ) -> None: ... + def __init__(self, path: StrPath, factory: Callable[[IO[Any]], MMDFMessage] | None = None, create: bool = True) -> None: ... class MH(Mailbox[MHMessage]): - def __init__( - self, path: StrOrBytesPath, factory: Callable[[IO[Any]], MHMessage] | None = ..., create: bool = ... - ) -> None: ... + def __init__(self, path: StrPath, factory: Callable[[IO[Any]], MHMessage] | None = None, create: bool = True) -> None: ... def add(self, message: _MessageData) -> str: ... def remove(self, key: str) -> None: ... def __setitem__(self, key: str, message: _MessageData) -> None: ... @@ -173,24 +169,22 @@ class MH(Mailbox[MHMessage]): def unlock(self) -> None: ... def close(self) -> None: ... def list_folders(self) -> list[str]: ... - def get_folder(self, folder: StrOrBytesPath) -> MH: ... - def add_folder(self, folder: StrOrBytesPath) -> MH: ... - def remove_folder(self, folder: StrOrBytesPath) -> None: ... + def get_folder(self, folder: StrPath) -> MH: ... + def add_folder(self, folder: StrPath) -> MH: ... + def remove_folder(self, folder: StrPath) -> None: ... def get_sequences(self) -> dict[str, list[int]]: ... def set_sequences(self, sequences: Mapping[str, Sequence[int]]) -> None: ... def pack(self) -> None: ... class Babyl(_singlefileMailbox[BabylMessage]): - def __init__( - self, path: StrOrBytesPath, factory: Callable[[IO[Any]], BabylMessage] | None = ..., create: bool = ... - ) -> None: ... + def __init__(self, path: StrPath, factory: Callable[[IO[Any]], BabylMessage] | None = None, create: bool = True) -> None: ... def get_message(self, key: str) -> BabylMessage: ... def get_bytes(self, key: str) -> bytes: ... def get_file(self, key: str) -> IO[bytes]: ... def get_labels(self) -> list[str]: ... class Message(email.message.Message): - def __init__(self, message: _MessageData | None = ...) -> None: ... + def __init__(self, message: _MessageData | None = None) -> None: ... class MaildirMessage(Message): def get_subdir(self) -> str: ... @@ -206,7 +200,7 @@ class MaildirMessage(Message): class _mboxMMDFMessage(Message): def get_from(self) -> str: ... - def set_from(self, from_: str, time_: bool | tuple[int, int, int, int, int, int, int, int, int] | None = ...) -> None: ... + def set_from(self, from_: str, time_: bool | tuple[int, int, int, int, int, int, int, int, int] | None = None) -> None: ... def get_flags(self) -> str: ... def set_flags(self, flags: Iterable[str]) -> None: ... def add_flag(self, flag: str) -> None: ... @@ -232,16 +226,16 @@ class BabylMessage(Message): class MMDFMessage(_mboxMMDFMessage): ... class _ProxyFile(Generic[AnyStr]): - def __init__(self, f: IO[AnyStr], pos: int | None = ...) -> None: ... - def read(self, size: int | None = ...) -> AnyStr: ... - def read1(self, size: int | None = ...) -> AnyStr: ... - def readline(self, size: int | None = ...) -> AnyStr: ... - def readlines(self, sizehint: int | None = ...) -> list[AnyStr]: ... + def __init__(self, f: IO[AnyStr], pos: int | None = None) -> None: ... + def read(self, size: int | None = None) -> AnyStr: ... + def read1(self, size: int | None = None) -> AnyStr: ... + def readline(self, size: int | None = None) -> AnyStr: ... + def readlines(self, sizehint: int | None = None) -> list[AnyStr]: ... def __iter__(self) -> Iterator[AnyStr]: ... def tell(self) -> int: ... - def seek(self, offset: int, whence: int = ...) -> None: ... + def seek(self, offset: int, whence: int = 0) -> None: ... def close(self) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__(self, exc_type: type[BaseException] | None, exc: BaseException | None, tb: TracebackType | None) -> None: ... def readable(self) -> bool: ... def writable(self) -> bool: ... @@ -253,7 +247,7 @@ class _ProxyFile(Generic[AnyStr]): def __class_getitem__(cls, item: Any) -> GenericAlias: ... class _PartialFile(_ProxyFile[AnyStr]): - def __init__(self, f: IO[AnyStr], start: int | None = ..., stop: int | None = ...) -> None: ... + def __init__(self, f: IO[AnyStr], start: int | None = None, stop: int | None = None) -> None: ... class Error(Exception): ... class NoSuchMailboxError(Error): ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/mailcap.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/mailcap.pyi index e1637ad6e..5905f5826 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/mailcap.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/mailcap.pyi @@ -6,6 +6,6 @@ _Cap: TypeAlias = dict[str, str | int] __all__ = ["getcaps", "findmatch"] def findmatch( - caps: Mapping[str, list[_Cap]], MIMEtype: str, key: str = ..., filename: str = ..., plist: Sequence[str] = ... + caps: Mapping[str, list[_Cap]], MIMEtype: str, key: str = "view", filename: str = "/dev/null", plist: Sequence[str] = ... ) -> tuple[str | None, _Cap | None]: ... def getcaps() -> dict[str, list[_Cap]]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/marshal.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/marshal.pyi index b2fde674a..21f05c908 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/marshal.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/marshal.pyi @@ -1,8 +1,33 @@ -from typing import IO, Any +import builtins +import types +from _typeshed import ReadableBuffer, SupportsRead, SupportsWrite +from typing import Any +from typing_extensions import TypeAlias version: int -def dump(__value: Any, __file: IO[Any], __version: int = ...) -> None: ... -def load(__file: IO[Any]) -> Any: ... -def dumps(__value: Any, __version: int = ...) -> bytes: ... -def loads(__bytes: bytes) -> Any: ... +_Marshallable: TypeAlias = ( + # handled in w_object() in marshal.c + None + | type[StopIteration] + | builtins.ellipsis + | bool + # handled in w_complex_object() in marshal.c + | int + | float + | complex + | bytes + | str + | tuple[_Marshallable, ...] + | list[Any] + | dict[Any, Any] + | set[Any] + | frozenset[_Marshallable] + | types.CodeType + | ReadableBuffer +) + +def dump(__value: _Marshallable, __file: SupportsWrite[bytes], __version: int = 4) -> None: ... +def load(__file: SupportsRead[bytes]) -> Any: ... +def dumps(__value: _Marshallable, __version: int = 4) -> bytes: ... +def loads(__bytes: ReadableBuffer) -> Any: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/math.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/math.pyi index 58eda98d8..231964f39 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/math.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/math.pyi @@ -1,9 +1,11 @@ import sys -from _typeshed import SupportsTrunc from collections.abc import Iterable -from typing import SupportsFloat, overload +from typing import Protocol, SupportsFloat, TypeVar, overload from typing_extensions import SupportsIndex, TypeAlias +_T = TypeVar("_T") +_T_co = TypeVar("_T_co", covariant=True) + if sys.version_info >= (3, 8): _SupportsFloatOrIndex: TypeAlias = SupportsFloat | SupportsIndex else: @@ -26,6 +28,12 @@ def atanh(__x: _SupportsFloatOrIndex) -> float: ... if sys.version_info >= (3, 11): def cbrt(__x: _SupportsFloatOrIndex) -> float: ... +class _SupportsCeil(Protocol[_T_co]): + def __ceil__(self) -> _T_co: ... + +@overload +def ceil(__x: _SupportsCeil[_T]) -> _T: ... +@overload def ceil(__x: _SupportsFloatOrIndex) -> int: ... if sys.version_info >= (3, 8): @@ -55,6 +63,12 @@ if sys.version_info >= (3, 8): else: def factorial(__x: int) -> int: ... +class _SupportsFloor(Protocol[_T_co]): + def __floor__(self) -> _T_co: ... + +@overload +def floor(__x: _SupportsFloor[_T]) -> _T: ... +@overload def floor(__x: _SupportsFloatOrIndex) -> int: ... def fmod(__x: _SupportsFloatOrIndex, __y: _SupportsFloatOrIndex) -> float: ... def frexp(__x: _SupportsFloatOrIndex) -> tuple[float, int]: ... @@ -77,8 +91,8 @@ def isclose( a: _SupportsFloatOrIndex, b: _SupportsFloatOrIndex, *, - rel_tol: _SupportsFloatOrIndex = ..., - abs_tol: _SupportsFloatOrIndex = ..., + rel_tol: _SupportsFloatOrIndex = 1e-09, + abs_tol: _SupportsFloatOrIndex = 0.0, ) -> bool: ... def isinf(__x: _SupportsFloatOrIndex) -> bool: ... def isfinite(__x: _SupportsFloatOrIndex) -> bool: ... @@ -102,15 +116,15 @@ if sys.version_info >= (3, 9): def nextafter(__x: _SupportsFloatOrIndex, __y: _SupportsFloatOrIndex) -> float: ... if sys.version_info >= (3, 8): - def perm(__n: SupportsIndex, __k: SupportsIndex | None = ...) -> int: ... + def perm(__n: SupportsIndex, __k: SupportsIndex | None = None) -> int: ... def pow(__x: _SupportsFloatOrIndex, __y: _SupportsFloatOrIndex) -> float: ... if sys.version_info >= (3, 8): @overload - def prod(__iterable: Iterable[SupportsIndex], *, start: SupportsIndex = ...) -> int: ... # type: ignore[misc] + def prod(__iterable: Iterable[SupportsIndex], *, start: SupportsIndex = 1) -> int: ... # type: ignore[misc] @overload - def prod(__iterable: Iterable[_SupportsFloatOrIndex], *, start: _SupportsFloatOrIndex = ...) -> float: ... + def prod(__iterable: Iterable[_SupportsFloatOrIndex], *, start: _SupportsFloatOrIndex = 1) -> float: ... def radians(__x: _SupportsFloatOrIndex) -> float: ... def remainder(__x: _SupportsFloatOrIndex, __y: _SupportsFloatOrIndex) -> float: ... @@ -119,7 +133,12 @@ def sinh(__x: _SupportsFloatOrIndex) -> float: ... def sqrt(__x: _SupportsFloatOrIndex) -> float: ... def tan(__x: _SupportsFloatOrIndex) -> float: ... def tanh(__x: _SupportsFloatOrIndex) -> float: ... -def trunc(__x: SupportsTrunc) -> int: ... + +# Is different from `_typeshed.SupportsTrunc`, which is not generic +class _SupportsTrunc(Protocol[_T_co]): + def __trunc__(self) -> _T_co: ... + +def trunc(__x: _SupportsTrunc[_T]) -> _T: ... if sys.version_info >= (3, 9): def ulp(__x: _SupportsFloatOrIndex) -> float: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/mimetypes.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/mimetypes.pyi index c2b6ff202..fd3908680 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/mimetypes.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/mimetypes.pyi @@ -20,16 +20,16 @@ __all__ = [ ] if sys.version_info >= (3, 8): - def guess_type(url: StrPath, strict: bool = ...) -> tuple[str | None, str | None]: ... + def guess_type(url: StrPath, strict: bool = True) -> tuple[str | None, str | None]: ... else: - def guess_type(url: str, strict: bool = ...) -> tuple[str | None, str | None]: ... + def guess_type(url: str, strict: bool = True) -> tuple[str | None, str | None]: ... -def guess_all_extensions(type: str, strict: bool = ...) -> list[str]: ... -def guess_extension(type: str, strict: bool = ...) -> str | None: ... -def init(files: Sequence[str] | None = ...) -> None: ... +def guess_all_extensions(type: str, strict: bool = True) -> list[str]: ... +def guess_extension(type: str, strict: bool = True) -> str | None: ... +def init(files: Sequence[str] | None = None) -> None: ... def read_mime_types(file: str) -> dict[str, str] | None: ... -def add_type(type: str, ext: str, strict: bool = ...) -> None: ... +def add_type(type: str, ext: str, strict: bool = True) -> None: ... inited: bool knownfiles: list[str] @@ -43,15 +43,15 @@ class MimeTypes: encodings_map: dict[str, str] types_map: tuple[dict[str, str], dict[str, str]] types_map_inv: tuple[dict[str, str], dict[str, str]] - def __init__(self, filenames: tuple[str, ...] = ..., strict: bool = ...) -> None: ... - def guess_extension(self, type: str, strict: bool = ...) -> str | None: ... + def __init__(self, filenames: tuple[str, ...] = ..., strict: bool = True) -> None: ... + def guess_extension(self, type: str, strict: bool = True) -> str | None: ... if sys.version_info >= (3, 8): - def guess_type(self, url: StrPath, strict: bool = ...) -> tuple[str | None, str | None]: ... + def guess_type(self, url: StrPath, strict: bool = True) -> tuple[str | None, str | None]: ... else: - def guess_type(self, url: str, strict: bool = ...) -> tuple[str | None, str | None]: ... + def guess_type(self, url: str, strict: bool = True) -> tuple[str | None, str | None]: ... - def guess_all_extensions(self, type: str, strict: bool = ...) -> list[str]: ... - def read(self, filename: str, strict: bool = ...) -> None: ... - def readfp(self, fp: IO[str], strict: bool = ...) -> None: ... + def guess_all_extensions(self, type: str, strict: bool = True) -> list[str]: ... + def read(self, filename: str, strict: bool = True) -> None: ... + def readfp(self, fp: IO[str], strict: bool = True) -> None: ... if sys.platform == "win32": - def read_windows_registry(self, strict: bool = ...) -> None: ... + def read_windows_registry(self, strict: bool = True) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/mmap.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/mmap.pyi index 8dbec2388..8da4ea7ca 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/mmap.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/mmap.pyi @@ -1,7 +1,8 @@ import sys -from _typeshed import ReadableBuffer, Self +from _typeshed import ReadableBuffer, Unused from collections.abc import Iterable, Iterator, Sized from typing import NoReturn, overload +from typing_extensions import Self ACCESS_DEFAULT: int ACCESS_READ: int @@ -59,19 +60,22 @@ class mmap(Iterable[int], Sized): def read(self, n: int | None = ...) -> bytes: ... def write(self, bytes: ReadableBuffer) -> int: ... @overload - def __getitem__(self, __index: int) -> int: ... + def __getitem__(self, __key: int) -> int: ... @overload - def __getitem__(self, __index: slice) -> bytes: ... - def __delitem__(self, __index: int | slice) -> NoReturn: ... + def __getitem__(self, __key: slice) -> bytes: ... + def __delitem__(self, __key: int | slice) -> NoReturn: ... @overload - def __setitem__(self, __index: int, __object: int) -> None: ... + def __setitem__(self, __key: int, __value: int) -> None: ... @overload - def __setitem__(self, __index: slice, __object: ReadableBuffer) -> None: ... - # Doesn't actually exist, but the object is actually iterable because it has __getitem__ and - # __len__, so we claim that there is also an __iter__ to help type checkers. + def __setitem__(self, __key: slice, __value: ReadableBuffer) -> None: ... + # Doesn't actually exist, but the object actually supports "in" because it has __getitem__, + # so we claim that there is also a __contains__ to help type checkers. + def __contains__(self, __o: object) -> bool: ... + # Doesn't actually exist, but the object is actually iterable because it has __getitem__ and __len__, + # so we claim that there is also an __iter__ to help type checkers. def __iter__(self) -> Iterator[int]: ... - def __enter__(self: Self) -> Self: ... - def __exit__(self, *args: object) -> None: ... + def __enter__(self) -> Self: ... + def __exit__(self, *args: Unused) -> None: ... if sys.version_info >= (3, 8) and sys.platform != "win32": MADV_NORMAL: int diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/modulefinder.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/modulefinder.pyi index caed7efad..6f1917644 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/modulefinder.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/modulefinder.pyi @@ -20,10 +20,9 @@ replacePackageMap: dict[str, str] # undocumented def ReplacePackage(oldname: str, newname: str) -> None: ... class Module: # undocumented - def __init__(self, name: str, file: str | None = ..., path: str | None = ...) -> None: ... + def __init__(self, name: str, file: str | None = None, path: str | None = None) -> None: ... class ModuleFinder: - modules: dict[str, Module] path: list[str] # undocumented badmodules: dict[str, dict[str, int]] # undocumented @@ -35,16 +34,16 @@ class ModuleFinder: if sys.version_info >= (3, 8): def __init__( self, - path: list[str] | None = ..., - debug: int = ..., - excludes: Container[str] | None = ..., - replace_paths: Sequence[tuple[str, str]] | None = ..., + path: list[str] | None = None, + debug: int = 0, + excludes: Container[str] | None = None, + replace_paths: Sequence[tuple[str, str]] | None = None, ) -> None: ... else: def __init__( self, - path: list[str] | None = ..., - debug: int = ..., + path: list[str] | None = None, + debug: int = 0, excludes: Container[str] = ..., replace_paths: Sequence[tuple[str, str]] = ..., ) -> None: ... @@ -55,12 +54,12 @@ class ModuleFinder: def run_script(self, pathname: str) -> None: ... def load_file(self, pathname: str) -> None: ... # undocumented def import_hook( - self, name: str, caller: Module | None = ..., fromlist: list[str] | None = ..., level: int = ... + self, name: str, caller: Module | None = None, fromlist: list[str] | None = None, level: int = -1 ) -> Module | None: ... # undocumented - def determine_parent(self, caller: Module | None, level: int = ...) -> Module | None: ... # undocumented + def determine_parent(self, caller: Module | None, level: int = -1) -> Module | None: ... # undocumented def find_head_package(self, parent: Module, name: str) -> tuple[Module, str]: ... # undocumented def load_tail(self, q: Module, tail: str) -> Module: ... # undocumented - def ensure_fromlist(self, m: Module, fromlist: Iterable[str], recursive: int = ...) -> None: ... # undocumented + def ensure_fromlist(self, m: Module, fromlist: Iterable[str], recursive: int = 0) -> None: ... # undocumented def find_all_submodules(self, m: Module) -> Iterable[str]: ... # undocumented def import_module(self, partname: str, fqname: str, parent: Module) -> Module | None: ... # undocumented def load_module(self, fqname: str, fp: IO[str], pathname: str, file_info: tuple[str, str, str]) -> Module: ... # undocumented @@ -69,7 +68,7 @@ class ModuleFinder: def load_package(self, fqname: str, pathname: str) -> Module: ... # undocumented def add_module(self, fqname: str) -> Module: ... # undocumented def find_module( - self, name: str, path: str | None, parent: Module | None = ... + self, name: str, path: str | None, parent: Module | None = None ) -> tuple[IO[Any] | None, str | None, tuple[str, str, int]]: ... # undocumented def report(self) -> None: ... def any_missing(self) -> list[str]: ... # undocumented diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/msilib/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/msilib/__init__.pyi index 0e18350b2..9f7367d15 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/msilib/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/msilib/__init__.pyi @@ -24,7 +24,6 @@ if sys.platform == "win32": knownbits: Literal[0x3FFF] class Table: - name: str fields: list[tuple[int, str, int]] def __init__(self, name: str) -> None: ... @@ -50,7 +49,6 @@ if sys.platform == "win32": def gen_uuid() -> str: ... class CAB: - name: str files: list[tuple[str, str]] filenames: set[str] @@ -62,7 +60,6 @@ if sys.platform == "win32": _directories: set[str] class Directory: - db: _Database cab: CAB basedir: str @@ -82,28 +79,26 @@ if sys.platform == "win32": physical: str, _logical: str, default: str, - componentflags: int | None = ..., + componentflags: int | None = None, ) -> None: ... def start_component( self, - component: str | None = ..., - feature: Feature | None = ..., - flags: int | None = ..., - keyfile: str | None = ..., - uuid: str | None = ..., + component: str | None = None, + feature: Feature | None = None, + flags: int | None = None, + keyfile: str | None = None, + uuid: str | None = None, ) -> None: ... def make_short(self, file: str) -> str: ... - def add_file(self, file: str, src: str | None = ..., version: str | None = ..., language: str | None = ...) -> str: ... - def glob(self, pattern: str, exclude: Container[str] | None = ...) -> list[str]: ... + def add_file(self, file: str, src: str | None = None, version: str | None = None, language: str | None = None) -> str: ... + def glob(self, pattern: str, exclude: Container[str] | None = None) -> list[str]: ... def remove_pyc(self) -> None: ... class Binary: - name: str def __init__(self, fname: str) -> None: ... class Feature: - id: str def __init__( self, @@ -112,31 +107,28 @@ if sys.platform == "win32": title: str, desc: str, display: int, - level: int = ..., - parent: Feature | None = ..., - directory: str | None = ..., - attributes: int = ..., + level: int = 1, + parent: Feature | None = None, + directory: str | None = None, + attributes: int = 0, ) -> None: ... def set_current(self) -> None: ... class Control: - dlg: Dialog name: str def __init__(self, dlg: Dialog, name: str) -> None: ... - def event(self, event: str, argument: str, condition: str = ..., ordering: int | None = ...) -> None: ... + def event(self, event: str, argument: str, condition: str = "1", ordering: int | None = None) -> None: ... def mapping(self, event: str, attribute: str) -> None: ... def condition(self, action: str, condition: str) -> None: ... class RadioButtonGroup(Control): - property: str index: int def __init__(self, dlg: Dialog, name: str, property: str) -> None: ... - def add(self, name: str, x: int, y: int, w: int, h: int, text: str, value: str | None = ...) -> None: ... + def add(self, name: str, x: int, y: int, w: int, h: int, text: str, value: str | None = None) -> None: ... class Dialog: - db: _Database name: str x: int diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/msilib/sequence.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/msilib/sequence.pyi index 9cc1e0eae..b8af09f46 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/msilib/sequence.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/msilib/sequence.pyi @@ -2,7 +2,6 @@ import sys from typing_extensions import TypeAlias if sys.platform == "win32": - _SequenceType: TypeAlias = list[tuple[str, str | None, int]] AdminExecuteSequence: _SequenceType diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/msilib/text.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/msilib/text.pyi index 879429ece..1353cf8a2 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/msilib/text.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/msilib/text.pyi @@ -1,7 +1,6 @@ import sys if sys.platform == "win32": - ActionText: list[tuple[str, str, str | None]] UIText: list[tuple[str, str | None]] diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/msvcrt.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/msvcrt.pyi index 0bea8ce22..5849b9b00 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/msvcrt.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/msvcrt.pyi @@ -21,8 +21,8 @@ if sys.platform == "win32": def getwch() -> str: ... def getche() -> bytes: ... def getwche() -> str: ... - def putch(__char: bytes) -> None: ... + def putch(__char: bytes | bytearray) -> None: ... def putwch(__unicode_char: str) -> None: ... - def ungetch(__char: bytes) -> None: ... + def ungetch(__char: bytes | bytearray) -> None: ... def ungetwch(__unicode_char: str) -> None: ... def heapmin() -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/connection.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/connection.pyi index 489e8bd9a..d03437371 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/connection.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/connection.pyi @@ -1,18 +1,18 @@ import socket import sys import types -from _typeshed import Self +from _typeshed import ReadableBuffer from collections.abc import Iterable -from typing import Any, Union -from typing_extensions import SupportsIndex, TypeAlias +from typing import Any +from typing_extensions import Self, SupportsIndex, TypeAlias __all__ = ["Client", "Listener", "Pipe", "wait"] # https://docs.python.org/3/library/multiprocessing.html#address-formats -_Address: TypeAlias = Union[str, tuple[str, int]] +_Address: TypeAlias = str | tuple[str, int] class _ConnectionBase: - def __init__(self, handle: SupportsIndex, readable: bool = ..., writable: bool = ...) -> None: ... + def __init__(self, handle: SupportsIndex, readable: bool = True, writable: bool = True) -> None: ... @property def closed(self) -> bool: ... # undocumented @property @@ -21,13 +21,13 @@ class _ConnectionBase: def writable(self) -> bool: ... # undocumented def fileno(self) -> int: ... def close(self) -> None: ... - def send_bytes(self, buf: bytes, offset: int = ..., size: int | None = ...) -> None: ... + def send_bytes(self, buf: ReadableBuffer, offset: int = 0, size: int | None = None) -> None: ... def send(self, obj: Any) -> None: ... - def recv_bytes(self, maxlength: int | None = ...) -> bytes: ... - def recv_bytes_into(self, buf: Any, offset: int = ...) -> int: ... + def recv_bytes(self, maxlength: int | None = None) -> bytes: ... + def recv_bytes_into(self, buf: Any, offset: int = 0) -> int: ... def recv(self) -> Any: ... - def poll(self, timeout: float | None = ...) -> bool: ... - def __enter__(self: Self) -> Self: ... + def poll(self, timeout: float | None = 0.0) -> bool: ... + def __enter__(self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, exc_value: BaseException | None, exc_tb: types.TracebackType | None ) -> None: ... @@ -39,7 +39,7 @@ if sys.platform == "win32": class Listener: def __init__( - self, address: _Address | None = ..., family: str | None = ..., backlog: int = ..., authkey: bytes | None = ... + self, address: _Address | None = None, family: str | None = None, backlog: int = 1, authkey: bytes | None = None ) -> None: ... def accept(self) -> Connection: ... def close(self) -> None: ... @@ -47,7 +47,7 @@ class Listener: def address(self) -> _Address: ... @property def last_accepted(self) -> _Address | None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, exc_value: BaseException | None, exc_tb: types.TracebackType | None ) -> None: ... @@ -55,7 +55,15 @@ class Listener: def deliver_challenge(connection: Connection, authkey: bytes) -> None: ... def answer_challenge(connection: Connection, authkey: bytes) -> None: ... def wait( - object_list: Iterable[Connection | socket.socket | int], timeout: float | None = ... + object_list: Iterable[Connection | socket.socket | int], timeout: float | None = None ) -> list[Connection | socket.socket | int]: ... -def Client(address: _Address, family: str | None = ..., authkey: bytes | None = ...) -> Connection: ... -def Pipe(duplex: bool = ...) -> tuple[_ConnectionBase, _ConnectionBase]: ... +def Client(address: _Address, family: str | None = None, authkey: bytes | None = None) -> Connection: ... + +# N.B. Keep this in sync with multiprocessing.context.BaseContext.Pipe. +# _ConnectionBase is the common base class of Connection and PipeConnection +# and can be used in cross-platform code. +if sys.platform != "win32": + def Pipe(duplex: bool = True) -> tuple[Connection, Connection]: ... + +else: + def Pipe(duplex: bool = True) -> tuple[PipeConnection, PipeConnection]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/context.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/context.pyi index 16b7cfe9e..c498649a7 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/context.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/context.pyi @@ -2,9 +2,8 @@ import ctypes import sys from collections.abc import Callable, Iterable, Sequence from ctypes import _CData -from logging import Logger +from logging import Logger, _Level as _LoggingLevel from multiprocessing import popen_fork, popen_forkserver, popen_spawn_posix, popen_spawn_win32, queues, synchronize -from multiprocessing.connection import _ConnectionBase from multiprocessing.managers import SyncManager from multiprocessing.pool import Pool as _Pool from multiprocessing.process import BaseProcess @@ -12,6 +11,11 @@ from multiprocessing.sharedctypes import SynchronizedArray, SynchronizedBase from typing import Any, ClassVar, TypeVar, overload from typing_extensions import Literal, TypeAlias +if sys.platform != "win32": + from multiprocessing.connection import Connection +else: + from multiprocessing.connection import PipeConnection + if sys.version_info >= (3, 8): __all__ = () else: @@ -43,25 +47,33 @@ class BaseContext: def active_children() -> list[BaseProcess]: ... def cpu_count(self) -> int: ... def Manager(self) -> SyncManager: ... - def Pipe(self, duplex: bool = ...) -> tuple[_ConnectionBase, _ConnectionBase]: ... + + # N.B. Keep this in sync with multiprocessing.connection.Pipe. + # _ConnectionBase is the common base class of Connection and PipeConnection + # and can be used in cross-platform code. + if sys.platform != "win32": + def Pipe(self, duplex: bool = True) -> tuple[Connection, Connection]: ... + else: + def Pipe(self, duplex: bool = True) -> tuple[PipeConnection, PipeConnection]: ... + def Barrier( - self, parties: int, action: Callable[..., object] | None = ..., timeout: float | None = ... + self, parties: int, action: Callable[..., object] | None = None, timeout: float | None = None ) -> synchronize.Barrier: ... - def BoundedSemaphore(self, value: int = ...) -> synchronize.BoundedSemaphore: ... - def Condition(self, lock: _LockLike | None = ...) -> synchronize.Condition: ... + def BoundedSemaphore(self, value: int = 1) -> synchronize.BoundedSemaphore: ... + def Condition(self, lock: _LockLike | None = None) -> synchronize.Condition: ... def Event(self) -> synchronize.Event: ... def Lock(self) -> synchronize.Lock: ... def RLock(self) -> synchronize.RLock: ... - def Semaphore(self, value: int = ...) -> synchronize.Semaphore: ... - def Queue(self, maxsize: int = ...) -> queues.Queue[Any]: ... - def JoinableQueue(self, maxsize: int = ...) -> queues.JoinableQueue[Any]: ... + def Semaphore(self, value: int = 1) -> synchronize.Semaphore: ... + def Queue(self, maxsize: int = 0) -> queues.Queue[Any]: ... + def JoinableQueue(self, maxsize: int = 0) -> queues.JoinableQueue[Any]: ... def SimpleQueue(self) -> queues.SimpleQueue[Any]: ... def Pool( self, - processes: int | None = ..., - initializer: Callable[..., object] | None = ..., + processes: int | None = None, + initializer: Callable[..., object] | None = None, initargs: Iterable[Any] = ..., - maxtasksperchild: int | None = ..., + maxtasksperchild: int | None = None, ) -> _Pool: ... @overload def RawValue(self, typecode_or_type: type[_CT], *args: Any) -> _CT: ... @@ -74,34 +86,34 @@ class BaseContext: @overload def Value(self, typecode_or_type: type[_CT], *args: Any, lock: Literal[False]) -> _CT: ... @overload - def Value(self, typecode_or_type: type[_CT], *args: Any, lock: Literal[True] | _LockLike = ...) -> SynchronizedBase[_CT]: ... + def Value(self, typecode_or_type: type[_CT], *args: Any, lock: Literal[True] | _LockLike = True) -> SynchronizedBase[_CT]: ... @overload - def Value(self, typecode_or_type: str, *args: Any, lock: Literal[True] | _LockLike = ...) -> SynchronizedBase[Any]: ... + def Value(self, typecode_or_type: str, *args: Any, lock: Literal[True] | _LockLike = True) -> SynchronizedBase[Any]: ... @overload - def Value(self, typecode_or_type: str | type[_CData], *args: Any, lock: bool | _LockLike = ...) -> Any: ... + def Value(self, typecode_or_type: str | type[_CData], *args: Any, lock: bool | _LockLike = True) -> Any: ... @overload def Array(self, typecode_or_type: type[_CT], size_or_initializer: int | Sequence[Any], *, lock: Literal[False]) -> _CT: ... @overload def Array( - self, typecode_or_type: type[_CT], size_or_initializer: int | Sequence[Any], *, lock: Literal[True] | _LockLike = ... + self, typecode_or_type: type[_CT], size_or_initializer: int | Sequence[Any], *, lock: Literal[True] | _LockLike = True ) -> SynchronizedArray[_CT]: ... @overload def Array( - self, typecode_or_type: str, size_or_initializer: int | Sequence[Any], *, lock: Literal[True] | _LockLike = ... + self, typecode_or_type: str, size_or_initializer: int | Sequence[Any], *, lock: Literal[True] | _LockLike = True ) -> SynchronizedArray[Any]: ... @overload def Array( - self, typecode_or_type: str | type[_CData], size_or_initializer: int | Sequence[Any], *, lock: bool | _LockLike = ... + self, typecode_or_type: str | type[_CData], size_or_initializer: int | Sequence[Any], *, lock: bool | _LockLike = True ) -> Any: ... def freeze_support(self) -> None: ... def get_logger(self) -> Logger: ... - def log_to_stderr(self, level: str | None = ...) -> Logger: ... + def log_to_stderr(self, level: _LoggingLevel | None = None) -> Logger: ... def allow_connection_pickling(self) -> None: ... def set_executable(self, executable: str) -> None: ... def set_forkserver_preload(self, module_names: list[str]) -> None: ... if sys.platform != "win32": @overload - def get_context(self, method: None = ...) -> DefaultContext: ... + def get_context(self, method: None = None) -> DefaultContext: ... @overload def get_context(self, method: Literal["spawn"]) -> SpawnContext: ... @overload @@ -112,17 +124,17 @@ class BaseContext: def get_context(self, method: str) -> BaseContext: ... else: @overload - def get_context(self, method: None = ...) -> DefaultContext: ... + def get_context(self, method: None = None) -> DefaultContext: ... @overload def get_context(self, method: Literal["spawn"]) -> SpawnContext: ... @overload def get_context(self, method: str) -> BaseContext: ... @overload - def get_start_method(self, allow_none: Literal[False] = ...) -> str: ... + def get_start_method(self, allow_none: Literal[False] = False) -> str: ... @overload def get_start_method(self, allow_none: bool) -> str | None: ... - def set_start_method(self, method: str | None, force: bool = ...) -> None: ... + def set_start_method(self, method: str | None, force: bool = False) -> None: ... @property def reducer(self) -> str: ... @reducer.setter @@ -137,8 +149,7 @@ class Process(BaseProcess): class DefaultContext(BaseContext): Process: ClassVar[type[Process]] def __init__(self, context: BaseContext) -> None: ... - def set_start_method(self, method: str | None, force: bool = ...) -> None: ... - def get_start_method(self, allow_none: bool = ...) -> str: ... + def get_start_method(self, allow_none: bool = False) -> str: ... def get_all_start_methods(self) -> list[str]: ... if sys.version_info < (3, 8): __all__: ClassVar[list[str]] diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/dummy/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/dummy/__init__.pyi index 5d289c058..5b2a33772 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/dummy/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/dummy/__init__.pyi @@ -47,9 +47,9 @@ class DummyProcess(threading.Thread): def exitcode(self) -> Literal[0] | None: ... def __init__( self, - group: Any = ..., - target: Callable[..., object] | None = ..., - name: str | None = ..., + group: Any = None, + target: Callable[..., object] | None = None, + name: str | None = None, args: Iterable[Any] = ..., kwargs: Mapping[str, Any] = ..., ) -> None: ... @@ -65,11 +65,13 @@ class Value: _typecode: Any _value: Any value: Any - def __init__(self, typecode: Any, value: Any, lock: Any = ...) -> None: ... + def __init__(self, typecode: Any, value: Any, lock: Any = True) -> None: ... -def Array(typecode: Any, sequence: Sequence[Any], lock: Any = ...) -> array.array[Any]: ... +def Array(typecode: Any, sequence: Sequence[Any], lock: Any = True) -> array.array[Any]: ... def Manager() -> Any: ... -def Pool(processes: int | None = ..., initializer: Callable[..., object] | None = ..., initargs: Iterable[Any] = ...) -> Any: ... +def Pool( + processes: int | None = None, initializer: Callable[..., object] | None = None, initargs: Iterable[Any] = ... +) -> Any: ... def active_children() -> list[Any]: ... current_process = threading.current_thread diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/dummy/connection.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/dummy/connection.pyi index fd909d0d3..d7e982129 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/dummy/connection.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/dummy/connection.pyi @@ -1,15 +1,13 @@ -from _typeshed import Self +from multiprocessing.connection import _Address from queue import Queue from types import TracebackType -from typing import Any, Union -from typing_extensions import TypeAlias +from typing import Any +from typing_extensions import Self __all__ = ["Client", "Listener", "Pipe"] families: list[None] -_Address: TypeAlias = Union[str, tuple[str, int]] - class Connection: _in: Any _out: Any @@ -17,25 +15,25 @@ class Connection: recv_bytes: Any send: Any send_bytes: Any - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, exc_value: BaseException | None, exc_tb: TracebackType | None ) -> None: ... def __init__(self, _in: Any, _out: Any) -> None: ... def close(self) -> None: ... - def poll(self, timeout: float = ...) -> bool: ... + def poll(self, timeout: float = 0.0) -> bool: ... class Listener: _backlog_queue: Queue[Any] | None @property def address(self) -> Queue[Any] | None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, exc_value: BaseException | None, exc_tb: TracebackType | None ) -> None: ... - def __init__(self, address: _Address | None = ..., family: int | None = ..., backlog: int = ...) -> None: ... + def __init__(self, address: _Address | None = None, family: int | None = None, backlog: int = 1) -> None: ... def accept(self) -> Connection: ... def close(self) -> None: ... def Client(address: _Address) -> Connection: ... -def Pipe(duplex: bool = ...) -> tuple[Connection, Connection]: ... +def Pipe(duplex: bool = True) -> tuple[Connection, Connection]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/forkserver.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/forkserver.pyi index 93777d926..df435f00e 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/forkserver.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/forkserver.pyi @@ -1,4 +1,4 @@ -from _typeshed import FileDescriptorLike +from _typeshed import FileDescriptorLike, Unused from collections.abc import Sequence from struct import Struct from typing import Any @@ -9,7 +9,6 @@ MAXFDS_TO_SEND: int SIGNED_STRUCT: Struct class ForkServer: - def __init__(self) -> None: ... def set_forkserver_preload(self, modules_names: list[str]) -> None: ... def get_inherited_fds(self) -> list[int] | None: ... def connect_to_new_process(self, fds: Sequence[int]) -> tuple[int, int]: ... @@ -19,8 +18,8 @@ def main( listener_fd: int | None, alive_r: FileDescriptorLike, preload: Sequence[str], - main_path: str | None = ..., - sys_path: object | None = ..., + main_path: str | None = None, + sys_path: Unused = None, ) -> None: ... def read_signed(fd: int) -> Any: ... def write_signed(fd: int, n: int) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/heap.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/heap.pyi index 9c8f55604..b5e2ced5e 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/heap.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/heap.pyi @@ -15,7 +15,7 @@ class Arena: def __init__(self, size: int) -> None: ... else: fd: int - def __init__(self, size: int, fd: int = ...) -> None: ... + def __init__(self, size: int, fd: int = -1) -> None: ... _Block: TypeAlias = tuple[Arena, int, int] diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/managers.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/managers.pyi index dfbcb395e..ad147fca3 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/managers.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/managers.pyi @@ -1,11 +1,11 @@ import queue import sys import threading -from _typeshed import Self, SupportsKeysAndGetItem, SupportsRichComparison, SupportsRichComparisonT +from _typeshed import SupportsKeysAndGetItem, SupportsRichComparison, SupportsRichComparisonT from collections.abc import Callable, Iterable, Iterator, Mapping, MutableMapping, MutableSequence, Sequence from types import TracebackType from typing import Any, AnyStr, ClassVar, Generic, TypeVar, overload -from typing_extensions import SupportsIndex, TypeAlias +from typing_extensions import Self, SupportsIndex, TypeAlias from .connection import Connection from .context import BaseContext @@ -47,11 +47,11 @@ class BaseProxy: self, token: Any, serializer: str, - manager: Any = ..., - authkey: AnyStr | None = ..., - exposed: Any = ..., - incref: bool = ..., - manager_owned: bool = ..., + manager: Any = None, + authkey: AnyStr | None = None, + exposed: Any = None, + incref: bool = True, + manager_owned: bool = False, ) -> None: ... def __deepcopy__(self, memo: Any | None) -> Any: ... def _callmethod(self, methodname: str, args: tuple[Any, ...] = ..., kwds: dict[Any, Any] = ...) -> None: ... @@ -68,9 +68,9 @@ class ValueProxy(BaseProxy, Generic[_T]): class DictProxy(BaseProxy, MutableMapping[_KT, _VT]): __builtins__: ClassVar[dict[str, Any]] def __len__(self) -> int: ... - def __getitem__(self, __k: _KT) -> _VT: ... - def __setitem__(self, __k: _KT, __v: _VT) -> None: ... - def __delitem__(self, __v: _KT) -> None: ... + def __getitem__(self, __key: _KT) -> _VT: ... + def __setitem__(self, __key: _KT, __value: _VT) -> None: ... + def __delitem__(self, __key: _KT) -> None: ... def __iter__(self) -> Iterator[_KT]: ... def copy(self) -> dict[_KT, _VT]: ... @overload @@ -82,8 +82,8 @@ class DictProxy(BaseProxy, MutableMapping[_KT, _VT]): @overload def pop(self, __key: _KT, __default: _VT | _T) -> _VT | _T: ... def keys(self) -> list[_KT]: ... # type: ignore[override] - def values(self) -> list[tuple[_KT, _VT]]: ... # type: ignore[override] - def items(self) -> list[_VT]: ... # type: ignore[override] + def items(self) -> list[tuple[_KT, _VT]]: ... # type: ignore[override] + def values(self) -> list[_VT]: ... # type: ignore[override] class BaseListProxy(BaseProxy, MutableSequence[_T]): __builtins__: ClassVar[dict[str, Any]] @@ -111,13 +111,13 @@ class BaseListProxy(BaseProxy, MutableSequence[_T]): # Use BaseListProxy[SupportsRichComparisonT] for the first overload rather than [SupportsRichComparison] # to work around invariance @overload - def sort(self: BaseListProxy[SupportsRichComparisonT], *, key: None = ..., reverse: bool = ...) -> None: ... + def sort(self: BaseListProxy[SupportsRichComparisonT], *, key: None = None, reverse: bool = ...) -> None: ... @overload def sort(self, *, key: Callable[[_T], SupportsRichComparison], reverse: bool = ...) -> None: ... class ListProxy(BaseListProxy[_T]): - def __iadd__(self: Self, __x: Iterable[_T]) -> Self: ... # type: ignore[override] - def __imul__(self: Self, __n: SupportsIndex) -> Self: ... # type: ignore[override] + def __iadd__(self, __value: Iterable[_T]) -> Self: ... # type: ignore[override] + def __imul__(self, __value: SupportsIndex) -> Self: ... # type: ignore[override] # Returned by BaseManager.get_server() class Server: @@ -132,36 +132,40 @@ class BaseManager: if sys.version_info >= (3, 11): def __init__( self, - address: Any | None = ..., - authkey: bytes | None = ..., - serializer: str = ..., - ctx: BaseContext | None = ..., + address: Any | None = None, + authkey: bytes | None = None, + serializer: str = "pickle", + ctx: BaseContext | None = None, *, - shutdown_timeout: float = ..., + shutdown_timeout: float = 1.0, ) -> None: ... else: def __init__( - self, address: Any | None = ..., authkey: bytes | None = ..., serializer: str = ..., ctx: BaseContext | None = ... + self, + address: Any | None = None, + authkey: bytes | None = None, + serializer: str = "pickle", + ctx: BaseContext | None = None, ) -> None: ... def get_server(self) -> Server: ... def connect(self) -> None: ... - def start(self, initializer: Callable[..., object] | None = ..., initargs: Iterable[Any] = ...) -> None: ... + def start(self, initializer: Callable[..., object] | None = None, initargs: Iterable[Any] = ...) -> None: ... def shutdown(self) -> None: ... # only available after start() was called - def join(self, timeout: float | None = ...) -> None: ... # undocumented + def join(self, timeout: float | None = None) -> None: ... # undocumented @property def address(self) -> Any: ... @classmethod def register( cls, typeid: str, - callable: Callable[..., object] | None = ..., - proxytype: Any = ..., - exposed: Sequence[str] | None = ..., - method_to_typeid: Mapping[str, str] | None = ..., - create_method: bool = ..., + callable: Callable[..., object] | None = None, + proxytype: Any = None, + exposed: Sequence[str] | None = None, + method_to_typeid: Mapping[str, str] | None = None, + create_method: bool = True, ) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None ) -> None: ... @@ -183,9 +187,13 @@ class SyncManager(BaseManager): @overload def dict(self, **kwargs: _VT) -> DictProxy[str, _VT]: ... @overload - def dict(self, __map: SupportsKeysAndGetItem[_KT, _VT], **kwargs: _VT) -> DictProxy[_KT, _VT]: ... + def dict(self, __map: SupportsKeysAndGetItem[_KT, _VT]) -> DictProxy[_KT, _VT]: ... + @overload + def dict(self, __map: SupportsKeysAndGetItem[str, _VT], **kwargs: _VT) -> DictProxy[str, _VT]: ... + @overload + def dict(self, __iterable: Iterable[tuple[_KT, _VT]]) -> DictProxy[_KT, _VT]: ... @overload - def dict(self, __iterable: Iterable[tuple[_KT, _VT]], **kwargs: _VT) -> DictProxy[_KT, _VT]: ... + def dict(self, __iterable: Iterable[tuple[str, _VT]], **kwargs: _VT) -> DictProxy[str, _VT]: ... @overload def dict(self, __iterable: Iterable[list[str]]) -> DictProxy[str, str]: ... @overload diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/pool.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/pool.pyi index 2b97e16f0..a19dd555e 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/pool.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/pool.pyi @@ -1,9 +1,8 @@ import sys -from _typeshed import Self from collections.abc import Callable, Iterable, Iterator, Mapping from types import TracebackType from typing import Any, Generic, TypeVar -from typing_extensions import Literal +from typing_extensions import Literal, Self if sys.version_info >= (3, 9): from types import GenericAlias @@ -26,8 +25,8 @@ class ApplyResult(Generic[_T]): error_callback: Callable[[BaseException], object] | None, ) -> None: ... - def get(self, timeout: float | None = ...) -> _T: ... - def wait(self, timeout: float | None = ...) -> None: ... + def get(self, timeout: float | None = None) -> _T: ... + def wait(self, timeout: float | None = None) -> None: ... def ready(self) -> bool: ... def successful(self) -> bool: ... if sys.version_info >= (3, 9): @@ -62,20 +61,20 @@ class IMapIterator(Iterator[_T]): else: def __init__(self, cache: dict[int, IMapIterator[Any]]) -> None: ... - def __iter__(self: Self) -> Self: ... - def next(self, timeout: float | None = ...) -> _T: ... - def __next__(self, timeout: float | None = ...) -> _T: ... + def __iter__(self) -> Self: ... + def next(self, timeout: float | None = None) -> _T: ... + def __next__(self, timeout: float | None = None) -> _T: ... class IMapUnorderedIterator(IMapIterator[_T]): ... class Pool: def __init__( self, - processes: int | None = ..., - initializer: Callable[..., object] | None = ..., + processes: int | None = None, + initializer: Callable[..., object] | None = None, initargs: Iterable[Any] = ..., - maxtasksperchild: int | None = ..., - context: Any | None = ..., + maxtasksperchild: int | None = None, + context: Any | None = None, ) -> None: ... def apply(self, func: Callable[..., _T], args: Iterable[Any] = ..., kwds: Mapping[str, Any] = ...) -> _T: ... def apply_async( @@ -83,42 +82,40 @@ class Pool: func: Callable[..., _T], args: Iterable[Any] = ..., kwds: Mapping[str, Any] = ..., - callback: Callable[[_T], object] | None = ..., - error_callback: Callable[[BaseException], object] | None = ..., + callback: Callable[[_T], object] | None = None, + error_callback: Callable[[BaseException], object] | None = None, ) -> AsyncResult[_T]: ... - def map(self, func: Callable[[_S], _T], iterable: Iterable[_S], chunksize: int | None = ...) -> list[_T]: ... + def map(self, func: Callable[[_S], _T], iterable: Iterable[_S], chunksize: int | None = None) -> list[_T]: ... def map_async( self, func: Callable[[_S], _T], iterable: Iterable[_S], - chunksize: int | None = ..., - callback: Callable[[_T], object] | None = ..., - error_callback: Callable[[BaseException], object] | None = ..., + chunksize: int | None = None, + callback: Callable[[_T], object] | None = None, + error_callback: Callable[[BaseException], object] | None = None, ) -> MapResult[_T]: ... - def imap(self, func: Callable[[_S], _T], iterable: Iterable[_S], chunksize: int | None = ...) -> IMapIterator[_T]: ... - def imap_unordered( - self, func: Callable[[_S], _T], iterable: Iterable[_S], chunksize: int | None = ... - ) -> IMapIterator[_T]: ... - def starmap(self, func: Callable[..., _T], iterable: Iterable[Iterable[Any]], chunksize: int | None = ...) -> list[_T]: ... + def imap(self, func: Callable[[_S], _T], iterable: Iterable[_S], chunksize: int | None = 1) -> IMapIterator[_T]: ... + def imap_unordered(self, func: Callable[[_S], _T], iterable: Iterable[_S], chunksize: int | None = 1) -> IMapIterator[_T]: ... + def starmap(self, func: Callable[..., _T], iterable: Iterable[Iterable[Any]], chunksize: int | None = None) -> list[_T]: ... def starmap_async( self, func: Callable[..., _T], iterable: Iterable[Iterable[Any]], - chunksize: int | None = ..., - callback: Callable[[_T], object] | None = ..., - error_callback: Callable[[BaseException], object] | None = ..., + chunksize: int | None = None, + callback: Callable[[_T], object] | None = None, + error_callback: Callable[[BaseException], object] | None = None, ) -> AsyncResult[list[_T]]: ... def close(self) -> None: ... def terminate(self) -> None: ... def join(self) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None ) -> None: ... class ThreadPool(Pool): def __init__( - self, processes: int | None = ..., initializer: Callable[..., object] | None = ..., initargs: Iterable[Any] = ... + self, processes: int | None = None, initializer: Callable[..., object] | None = None, initargs: Iterable[Any] = ... ) -> None: ... # undocumented diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/popen_fork.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/popen_fork.pyi index 3db6a8439..4fcbfd99a 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/popen_fork.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/popen_fork.pyi @@ -16,8 +16,8 @@ if sys.platform != "win32": def __init__(self, process_obj: BaseProcess) -> None: ... def duplicate_for_child(self, fd: int) -> int: ... - def poll(self, flag: int = ...) -> int | None: ... - def wait(self, timeout: float | None = ...) -> int | None: ... + def poll(self, flag: int = 1) -> int | None: ... + def wait(self, timeout: float | None = None) -> int | None: ... def terminate(self) -> None: ... def kill(self) -> None: ... def close(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/popen_forkserver.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/popen_forkserver.pyi index d28c7245f..f7d53bbb3 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/popen_forkserver.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/popen_forkserver.pyi @@ -1,5 +1,4 @@ import sys -from multiprocessing.process import BaseProcess from typing import ClassVar from . import popen_fork @@ -15,8 +14,3 @@ if sys.platform != "win32": class Popen(popen_fork.Popen): DupFd: ClassVar[type[_DupFd]] finalizer: Finalize - sentinel: int - - def __init__(self, process_obj: BaseProcess) -> None: ... - def duplicate_for_child(self, fd: int) -> int: ... - def poll(self, flag: int = ...) -> int | None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/popen_spawn_posix.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/popen_spawn_posix.pyi index 81aaac7ca..7e81d3960 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/popen_spawn_posix.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/popen_spawn_posix.pyi @@ -1,5 +1,4 @@ import sys -from multiprocessing.process import BaseProcess from typing import ClassVar from . import popen_fork @@ -19,6 +18,3 @@ if sys.platform != "win32": finalizer: Finalize pid: int # may not exist if _launch raises in second try / except sentinel: int # may not exist if _launch raises in second try / except - - def __init__(self, process_obj: BaseProcess) -> None: ... - def duplicate_for_child(self, fd: int) -> int: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/popen_spawn_win32.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/popen_spawn_win32.pyi index f5cb0a6c4..3dc9d5bd7 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/popen_spawn_win32.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/popen_spawn_win32.pyi @@ -21,7 +21,7 @@ if sys.platform == "win32": def __init__(self, process_obj: BaseProcess) -> None: ... def duplicate_for_child(self, handle: int) -> int: ... - def wait(self, timeout: float | None = ...) -> int | None: ... + def wait(self, timeout: float | None = None) -> int | None: ... def poll(self) -> int | None: ... def terminate(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/process.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/process.pyi index 7c8422e39..ef1b4b596 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/process.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/process.pyi @@ -14,20 +14,20 @@ class BaseProcess: _identity: tuple[int, ...] # undocumented def __init__( self, - group: None = ..., - target: Callable[..., object] | None = ..., - name: str | None = ..., + group: None = None, + target: Callable[..., object] | None = None, + name: str | None = None, args: Iterable[Any] = ..., kwargs: Mapping[str, Any] = ..., *, - daemon: bool | None = ..., + daemon: bool | None = None, ) -> None: ... def run(self) -> None: ... def start(self) -> None: ... def terminate(self) -> None: ... def kill(self) -> None: ... def close(self) -> None: ... - def join(self, timeout: float | None = ...) -> None: ... + def join(self, timeout: float | None = None) -> None: ... def is_alive(self) -> bool: ... @property def exitcode(self) -> int | None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/queues.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/queues.pyi index 1d31fa694..f821b6df4 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/queues.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/queues.pyi @@ -12,21 +12,16 @@ _T = TypeVar("_T") class Queue(queue.Queue[_T]): # FIXME: `ctx` is a circular dependency and it's not actually optional. # It's marked as such to be able to use the generic Queue in __init__.pyi. - def __init__(self, maxsize: int = ..., *, ctx: Any = ...) -> None: ... - def get(self, block: bool = ..., timeout: float | None = ...) -> _T: ... - def put(self, obj: _T, block: bool = ..., timeout: float | None = ...) -> None: ... - def qsize(self) -> int: ... - def empty(self) -> bool: ... - def full(self) -> bool: ... - def put_nowait(self, item: _T) -> None: ... + def __init__(self, maxsize: int = 0, *, ctx: Any = ...) -> None: ... + def get(self, block: bool = True, timeout: float | None = None) -> _T: ... + def put(self, obj: _T, block: bool = True, timeout: float | None = None) -> None: ... + def put_nowait(self, obj: _T) -> None: ... def get_nowait(self) -> _T: ... def close(self) -> None: ... def join_thread(self) -> None: ... def cancel_join_thread(self) -> None: ... -class JoinableQueue(Queue[_T]): - def task_done(self) -> None: ... - def join(self) -> None: ... +class JoinableQueue(Queue[_T]): ... class SimpleQueue(Generic[_T]): def __init__(self, *, ctx: Any = ...) -> None: ... @@ -35,6 +30,6 @@ class SimpleQueue(Generic[_T]): def empty(self) -> bool: ... def get(self) -> _T: ... - def put(self, item: _T) -> None: ... + def put(self, obj: _T) -> None: ... if sys.version_info >= (3, 9): def __class_getitem__(cls, item: Any) -> GenericAlias: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/reduction.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/reduction.pyi index a22c16828..e5a8cde8f 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/reduction.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/reduction.pyi @@ -1,8 +1,12 @@ import pickle import sys -from _typeshed import HasFileno +from _typeshed import HasFileno, SupportsWrite, Unused from abc import ABCMeta +from builtins import type as Type # alias to avoid name clash +from collections.abc import Callable from copyreg import _DispatchTableType +from multiprocessing import connection +from pickle import _ReducedType from socket import socket from typing import Any from typing_extensions import Literal @@ -12,34 +16,36 @@ if sys.platform == "win32": else: __all__ = ["send_handle", "recv_handle", "ForkingPickler", "register", "dump", "DupFd", "sendfds", "recvfds"] +HAVE_SEND_HANDLE: bool + class ForkingPickler(pickle.Pickler): dispatch_table: _DispatchTableType - def __init__(self, *args) -> None: ... + def __init__(self, file: SupportsWrite[bytes], protocol: int | None = ...) -> None: ... @classmethod - def register(cls, type, reduce) -> None: ... + def register(cls, type: Type, reduce: Callable[[Any], _ReducedType]) -> None: ... @classmethod - def dumps(cls, obj, protocol: Any | None = ...): ... + def dumps(cls, obj: Any, protocol: int | None = None) -> memoryview: ... loads = pickle.loads register = ForkingPickler.register -def dump(obj, file, protocol: Any | None = ...) -> None: ... +def dump(obj: Any, file: SupportsWrite[bytes], protocol: int | None = None) -> None: ... if sys.platform == "win32": if sys.version_info >= (3, 8): def duplicate( - handle: int, target_process: int | None = ..., inheritable: bool = ..., *, source_process: int | None = ... + handle: int, target_process: int | None = None, inheritable: bool = False, *, source_process: int | None = None ) -> int: ... else: - def duplicate(handle: int, target_process: int | None = ..., inheritable: bool = ...) -> int: ... + def duplicate(handle: int, target_process: int | None = None, inheritable: bool = False) -> int: ... - def steal_handle(source_pid, handle): ... - def send_handle(conn, handle, destination_pid) -> None: ... - def recv_handle(conn): ... + def steal_handle(source_pid: int, handle: int) -> int: ... + def send_handle(conn: connection.PipeConnection, handle: int, destination_pid: int) -> None: ... + def recv_handle(conn: connection.PipeConnection) -> int: ... class DupHandle: - def __init__(self, handle, access, pid: Any | None = ...) -> None: ... - def detach(self): ... + def __init__(self, handle: int, access: int, pid: int | None = None) -> None: ... + def detach(self) -> int: ... else: if sys.platform == "darwin": @@ -48,10 +54,10 @@ else: ACKNOWLEDGE: Literal[False] def recvfds(sock: socket, size: int) -> list[int]: ... - def send_handle(conn, handle, destination_pid) -> None: ... + def send_handle(conn: HasFileno, handle: int, destination_pid: Unused) -> None: ... def recv_handle(conn: HasFileno) -> int: ... - def sendfds(sock, fds) -> None: ... - def DupFd(fd): ... + def sendfds(sock: socket, fds: list[int]) -> None: ... + def DupFd(fd: int) -> Any: ... # Return type is really hard to get right # These aliases are to work around pyright complaints. # Pyright doesn't like it when a class object is defined as an alias @@ -85,4 +91,4 @@ class AbstractReducer(metaclass=ABCMeta): sendfds = _sendfds recvfds = _recvfds DupFd = _DupFd - def __init__(self, *args) -> None: ... + def __init__(self, *args: Unused) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/resource_sharer.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/resource_sharer.pyi index 7708df9b6..5fee7cf31 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/resource_sharer.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/resource_sharer.pyi @@ -17,4 +17,4 @@ else: def __init__(self, fd: int) -> None: ... def detach(self) -> int: ... -def stop(timeout: float | None = ...) -> None: ... +def stop(timeout: float | None = None) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/resource_tracker.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/resource_tracker.pyi index 98abb075f..e2b940796 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/resource_tracker.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/resource_tracker.pyi @@ -1,10 +1,9 @@ -from _typeshed import Incomplete, StrOrBytesPath +from _typeshed import FileDescriptorOrPath, Incomplete from collections.abc import Sized __all__ = ["ensure_running", "register", "unregister"] class ResourceTracker: - def __init__(self) -> None: ... def getfd(self) -> int | None: ... def ensure_running(self) -> None: ... def register(self, name: Sized, rtype: Incomplete) -> None: ... @@ -16,4 +15,4 @@ register = _resource_tracker.register unregister = _resource_tracker.unregister getfd = _resource_tracker.getfd -def main(fd: StrOrBytesPath | int) -> None: ... +def main(fd: FileDescriptorOrPath) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/shared_memory.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/shared_memory.pyi index 3ce0ca386..ae6e2a0ed 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/shared_memory.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/shared_memory.pyi @@ -1,7 +1,7 @@ import sys -from _typeshed import Self from collections.abc import Iterable from typing import Any, Generic, TypeVar, overload +from typing_extensions import Self if sys.version_info >= (3, 9): from types import GenericAlias @@ -11,7 +11,7 @@ __all__ = ["SharedMemory", "ShareableList"] _SLT = TypeVar("_SLT", int, float, bool, str, bytes, None) class SharedMemory: - def __init__(self, name: str | None = ..., create: bool = ..., size: int = ...) -> None: ... + def __init__(self, name: str | None = None, create: bool = False, size: int = 0) -> None: ... @property def buf(self) -> memoryview: ... @property @@ -24,12 +24,12 @@ class SharedMemory: class ShareableList(Generic[_SLT]): shm: SharedMemory @overload - def __init__(self, sequence: None = ..., *, name: str | None = ...) -> None: ... + def __init__(self, sequence: None = None, *, name: str | None = None) -> None: ... @overload - def __init__(self, sequence: Iterable[_SLT], *, name: str | None = ...) -> None: ... + def __init__(self, sequence: Iterable[_SLT], *, name: str | None = None) -> None: ... def __getitem__(self, position: int) -> _SLT: ... def __setitem__(self, position: int, value: _SLT) -> None: ... - def __reduce__(self: Self) -> tuple[Self, tuple[_SLT, ...]]: ... + def __reduce__(self) -> tuple[Self, tuple[_SLT, ...]]: ... def __len__(self) -> int: ... @property def format(self) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/sharedctypes.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/sharedctypes.pyi index e988cda32..686a45d9a 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/sharedctypes.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/sharedctypes.pyi @@ -21,56 +21,56 @@ def RawArray(typecode_or_type: type[_CT], size_or_initializer: int | Sequence[An @overload def RawArray(typecode_or_type: str, size_or_initializer: int | Sequence[Any]) -> Any: ... @overload -def Value(typecode_or_type: type[_CT], *args: Any, lock: Literal[False], ctx: BaseContext | None = ...) -> _CT: ... +def Value(typecode_or_type: type[_CT], *args: Any, lock: Literal[False], ctx: BaseContext | None = None) -> _CT: ... @overload def Value( - typecode_or_type: type[_CT], *args: Any, lock: Literal[True] | _LockLike = ..., ctx: BaseContext | None = ... + typecode_or_type: type[_CT], *args: Any, lock: Literal[True] | _LockLike = True, ctx: BaseContext | None = None ) -> SynchronizedBase[_CT]: ... @overload def Value( - typecode_or_type: str, *args: Any, lock: Literal[True] | _LockLike = ..., ctx: BaseContext | None = ... + typecode_or_type: str, *args: Any, lock: Literal[True] | _LockLike = True, ctx: BaseContext | None = None ) -> SynchronizedBase[Any]: ... @overload def Value( - typecode_or_type: str | type[_CData], *args: Any, lock: bool | _LockLike = ..., ctx: BaseContext | None = ... + typecode_or_type: str | type[_CData], *args: Any, lock: bool | _LockLike = True, ctx: BaseContext | None = None ) -> Any: ... @overload def Array( - typecode_or_type: type[_CT], size_or_initializer: int | Sequence[Any], *, lock: Literal[False], ctx: BaseContext | None = ... + typecode_or_type: type[_CT], size_or_initializer: int | Sequence[Any], *, lock: Literal[False], ctx: BaseContext | None = None ) -> _CT: ... @overload def Array( typecode_or_type: type[_CT], size_or_initializer: int | Sequence[Any], *, - lock: Literal[True] | _LockLike = ..., - ctx: BaseContext | None = ..., + lock: Literal[True] | _LockLike = True, + ctx: BaseContext | None = None, ) -> SynchronizedArray[_CT]: ... @overload def Array( typecode_or_type: str, size_or_initializer: int | Sequence[Any], *, - lock: Literal[True] | _LockLike = ..., - ctx: BaseContext | None = ..., + lock: Literal[True] | _LockLike = True, + ctx: BaseContext | None = None, ) -> SynchronizedArray[Any]: ... @overload def Array( typecode_or_type: str | type[_CData], size_or_initializer: int | Sequence[Any], *, - lock: bool | _LockLike = ..., - ctx: BaseContext | None = ..., + lock: bool | _LockLike = True, + ctx: BaseContext | None = None, ) -> Any: ... def copy(obj: _CT) -> _CT: ... @overload -def synchronized(obj: _SimpleCData[_T], lock: _LockLike | None = ..., ctx: Any | None = ...) -> Synchronized[_T]: ... +def synchronized(obj: _SimpleCData[_T], lock: _LockLike | None = None, ctx: Any | None = None) -> Synchronized[_T]: ... @overload -def synchronized(obj: ctypes.Array[c_char], lock: _LockLike | None = ..., ctx: Any | None = ...) -> SynchronizedString: ... +def synchronized(obj: ctypes.Array[c_char], lock: _LockLike | None = None, ctx: Any | None = None) -> SynchronizedString: ... @overload -def synchronized(obj: ctypes.Array[_CT], lock: _LockLike | None = ..., ctx: Any | None = ...) -> SynchronizedArray[_CT]: ... +def synchronized(obj: ctypes.Array[_CT], lock: _LockLike | None = None, ctx: Any | None = None) -> SynchronizedArray[_CT]: ... @overload -def synchronized(obj: _CT, lock: _LockLike | None = ..., ctx: Any | None = ...) -> SynchronizedBase[_CT]: ... +def synchronized(obj: _CT, lock: _LockLike | None = None, ctx: Any | None = None) -> SynchronizedBase[_CT]: ... class _AcquireFunc(Protocol): def __call__(self, block: bool = ..., timeout: float | None = ...) -> bool: ... @@ -78,7 +78,7 @@ class _AcquireFunc(Protocol): class SynchronizedBase(Generic[_CT]): acquire: _AcquireFunc release: Callable[[], None] - def __init__(self, obj: Any, lock: _LockLike | None = ..., ctx: Any | None = ...) -> None: ... + def __init__(self, obj: Any, lock: _LockLike | None = None, ctx: Any | None = None) -> None: ... def __reduce__(self) -> tuple[Callable[[Any, _LockLike], SynchronizedBase[Any]], tuple[Any, _LockLike]]: ... def get_obj(self) -> _CT: ... def get_lock(self) -> _LockLike: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/spawn.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/spawn.pyi index 50570ff37..26ff16575 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/spawn.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/spawn.pyi @@ -20,7 +20,7 @@ def get_executable() -> str: ... def is_forking(argv: Sequence[str]) -> bool: ... def freeze_support() -> None: ... def get_command_line(**kwds: Any) -> list[str]: ... -def spawn_main(pipe_handle: int, parent_pid: int | None = ..., tracker_fd: int | None = ...) -> None: ... +def spawn_main(pipe_handle: int, parent_pid: int | None = None, tracker_fd: int | None = None) -> None: ... # undocumented def _main(fd: int) -> Any: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/synchronize.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/synchronize.pyi index c89142f2c..6c2e18954 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/synchronize.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/synchronize.pyi @@ -11,18 +11,18 @@ _LockLike: TypeAlias = Lock | RLock class Barrier(threading.Barrier): def __init__( - self, parties: int, action: Callable[[], object] | None = ..., timeout: float | None = ..., *ctx: BaseContext + self, parties: int, action: Callable[[], object] | None = None, timeout: float | None = None, *ctx: BaseContext ) -> None: ... class BoundedSemaphore(Semaphore): - def __init__(self, value: int = ..., *, ctx: BaseContext) -> None: ... + def __init__(self, value: int = 1, *, ctx: BaseContext) -> None: ... class Condition(AbstractContextManager[bool]): - def __init__(self, lock: _LockLike | None = ..., *, ctx: BaseContext) -> None: ... - def notify(self, n: int = ...) -> None: ... + def __init__(self, lock: _LockLike | None = None, *, ctx: BaseContext) -> None: ... + def notify(self, n: int = 1) -> None: ... def notify_all(self) -> None: ... - def wait(self, timeout: float | None = ...) -> bool: ... - def wait_for(self, predicate: Callable[[], bool], timeout: float | None = ...) -> bool: ... + def wait(self, timeout: float | None = None) -> bool: ... + def wait_for(self, predicate: Callable[[], bool], timeout: float | None = None) -> bool: ... def acquire(self, block: bool = ..., timeout: float | None = ...) -> bool: ... def release(self) -> None: ... def __exit__( @@ -30,11 +30,11 @@ class Condition(AbstractContextManager[bool]): ) -> None: ... class Event: - def __init__(self, lock: _LockLike | None = ..., *, ctx: BaseContext) -> None: ... + def __init__(self, *, ctx: BaseContext) -> None: ... def is_set(self) -> bool: ... def set(self) -> None: ... def clear(self) -> None: ... - def wait(self, timeout: float | None = ...) -> bool: ... + def wait(self, timeout: float | None = None) -> bool: ... class Lock(SemLock): def __init__(self, *, ctx: BaseContext) -> None: ... @@ -43,7 +43,7 @@ class RLock(SemLock): def __init__(self, *, ctx: BaseContext) -> None: ... class Semaphore(SemLock): - def __init__(self, value: int = ..., *, ctx: BaseContext) -> None: ... + def __init__(self, value: int = 1, *, ctx: BaseContext) -> None: ... # Not part of public API class SemLock(AbstractContextManager[bool]): diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/util.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/util.pyi index e89b4a71c..006ec3a9f 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/util.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/multiprocessing/util.pyi @@ -1,7 +1,7 @@ import threading -from _typeshed import Incomplete, ReadableBuffer, SupportsTrunc +from _typeshed import Incomplete, ReadableBuffer, SupportsTrunc, Unused from collections.abc import Callable, Iterable, Mapping, MutableMapping, Sequence -from logging import Logger +from logging import Logger, _Level as _LoggingLevel from typing import Any, SupportsInt from typing_extensions import SupportsIndex @@ -37,7 +37,7 @@ def debug(msg: object, *args: object) -> None: ... def info(msg: object, *args: object) -> None: ... def sub_warning(msg: object, *args: object) -> None: ... def get_logger() -> Logger: ... -def log_to_stderr(level: int | None = ...) -> Logger: ... +def log_to_stderr(level: _LoggingLevel | None = None) -> Logger: ... def is_abstract_socket_namespace(address: str | bytes | None) -> bool: ... abstract_sockets_supported: bool @@ -51,12 +51,12 @@ class Finalize: obj: Incomplete | None, callback: Callable[..., Incomplete], args: Sequence[Any] = ..., - kwargs: Mapping[str, Any] | None = ..., - exitpriority: int | None = ..., + kwargs: Mapping[str, Any] | None = None, + exitpriority: int | None = None, ) -> None: ... def __call__( self, - wr: object = ..., + wr: Unused = None, _finalizer_registry: MutableMapping[Incomplete, Incomplete] = ..., sub_debug: Callable[..., object] = ..., getpid: Callable[[], int] = ..., @@ -69,12 +69,10 @@ def is_exiting() -> bool: ... class ForkAwareThreadLock: acquire: Callable[[bool, float], bool] release: Callable[[], None] - def __init__(self) -> None: ... def __enter__(self) -> bool: ... - def __exit__(self, *args: object) -> None: ... + def __exit__(self, *args: Unused) -> None: ... -class ForkAwareLocal(threading.local): - def __init__(self) -> None: ... +class ForkAwareLocal(threading.local): ... MAXFD: int diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/netrc.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/netrc.pyi index 803c78073..480f55a46 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/netrc.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/netrc.pyi @@ -1,3 +1,4 @@ +import sys from _typeshed import StrOrBytesPath from typing_extensions import TypeAlias @@ -7,13 +8,16 @@ class NetrcParseError(Exception): filename: str | None lineno: int | None msg: str - def __init__(self, msg: str, filename: StrOrBytesPath | None = ..., lineno: int | None = ...) -> None: ... + def __init__(self, msg: str, filename: StrOrBytesPath | None = None, lineno: int | None = None) -> None: ... # (login, account, password) tuple -_NetrcTuple: TypeAlias = tuple[str, str | None, str | None] +if sys.version_info >= (3, 11): + _NetrcTuple: TypeAlias = tuple[str, str, str] +else: + _NetrcTuple: TypeAlias = tuple[str, str | None, str | None] class netrc: hosts: dict[str, _NetrcTuple] macros: dict[str, list[str]] - def __init__(self, file: StrOrBytesPath | None = ...) -> None: ... + def __init__(self, file: StrOrBytesPath | None = None) -> None: ... def authenticators(self, host: str) -> _NetrcTuple | None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/nntplib.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/nntplib.pyi index aa5bcba57..f948c1430 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/nntplib.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/nntplib.pyi @@ -2,11 +2,11 @@ import datetime import socket import ssl import sys -from _typeshed import Self +from _typeshed import Unused from builtins import list as _list # conflicts with a method named "list" from collections.abc import Iterable from typing import IO, Any, NamedTuple -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal, Self, TypeAlias __all__ = [ "NNTP", @@ -65,49 +65,49 @@ class NNTP: def __init__( self, host: str, - port: int = ..., - user: str | None = ..., - password: str | None = ..., - readermode: bool | None = ..., - usenetrc: bool = ..., + port: int = 119, + user: str | None = None, + password: str | None = None, + readermode: bool | None = None, + usenetrc: bool = False, timeout: float = ..., ) -> None: ... - def __enter__(self: Self) -> Self: ... - def __exit__(self, *args: object) -> None: ... + def __enter__(self) -> Self: ... + def __exit__(self, *args: Unused) -> None: ... def getwelcome(self) -> str: ... def getcapabilities(self) -> dict[str, _list[str]]: ... def set_debuglevel(self, level: int) -> None: ... def debug(self, level: int) -> None: ... def capabilities(self) -> tuple[str, dict[str, _list[str]]]: ... - def newgroups(self, date: datetime.date | datetime.datetime, *, file: _File = ...) -> tuple[str, _list[str]]: ... - def newnews(self, group: str, date: datetime.date | datetime.datetime, *, file: _File = ...) -> tuple[str, _list[str]]: ... - def list(self, group_pattern: str | None = ..., *, file: _File = ...) -> tuple[str, _list[str]]: ... + def newgroups(self, date: datetime.date | datetime.datetime, *, file: _File = None) -> tuple[str, _list[str]]: ... + def newnews(self, group: str, date: datetime.date | datetime.datetime, *, file: _File = None) -> tuple[str, _list[str]]: ... + def list(self, group_pattern: str | None = None, *, file: _File = None) -> tuple[str, _list[str]]: ... def description(self, group: str) -> str: ... def descriptions(self, group_pattern: str) -> tuple[str, dict[str, str]]: ... def group(self, name: str) -> tuple[str, int, int, int, str]: ... - def help(self, *, file: _File = ...) -> tuple[str, _list[str]]: ... - def stat(self, message_spec: Any = ...) -> tuple[str, int, str]: ... + def help(self, *, file: _File = None) -> tuple[str, _list[str]]: ... + def stat(self, message_spec: Any = None) -> tuple[str, int, str]: ... def next(self) -> tuple[str, int, str]: ... def last(self) -> tuple[str, int, str]: ... - def head(self, message_spec: Any = ..., *, file: _File = ...) -> tuple[str, ArticleInfo]: ... - def body(self, message_spec: Any = ..., *, file: _File = ...) -> tuple[str, ArticleInfo]: ... - def article(self, message_spec: Any = ..., *, file: _File = ...) -> tuple[str, ArticleInfo]: ... + def head(self, message_spec: Any = None, *, file: _File = None) -> tuple[str, ArticleInfo]: ... + def body(self, message_spec: Any = None, *, file: _File = None) -> tuple[str, ArticleInfo]: ... + def article(self, message_spec: Any = None, *, file: _File = None) -> tuple[str, ArticleInfo]: ... def slave(self) -> str: ... - def xhdr(self, hdr: str, str: Any, *, file: _File = ...) -> tuple[str, _list[str]]: ... - def xover(self, start: int, end: int, *, file: _File = ...) -> tuple[str, _list[tuple[int, dict[str, str]]]]: ... + def xhdr(self, hdr: str, str: Any, *, file: _File = None) -> tuple[str, _list[str]]: ... + def xover(self, start: int, end: int, *, file: _File = None) -> tuple[str, _list[tuple[int, dict[str, str]]]]: ... def over( - self, message_spec: None | str | _list[Any] | tuple[Any, ...], *, file: _File = ... + self, message_spec: None | str | _list[Any] | tuple[Any, ...], *, file: _File = None ) -> tuple[str, _list[tuple[int, dict[str, str]]]]: ... if sys.version_info < (3, 9): - def xgtitle(self, group: str, *, file: _File = ...) -> tuple[str, _list[tuple[str, str]]]: ... + def xgtitle(self, group: str, *, file: _File = None) -> tuple[str, _list[tuple[str, str]]]: ... def xpath(self, id: Any) -> tuple[str, str]: ... def date(self) -> tuple[str, datetime.datetime]: ... def post(self, data: bytes | Iterable[bytes]) -> str: ... def ihave(self, message_id: Any, data: bytes | Iterable[bytes]) -> str: ... def quit(self) -> str: ... - def login(self, user: str | None = ..., password: str | None = ..., usenetrc: bool = ...) -> None: ... - def starttls(self, context: ssl.SSLContext | None = ...) -> None: ... + def login(self, user: str | None = None, password: str | None = None, usenetrc: bool = True) -> None: ... + def starttls(self, context: ssl.SSLContext | None = None) -> None: ... class NNTP_SSL(NNTP): ssl_context: ssl.SSLContext | None @@ -115,11 +115,11 @@ class NNTP_SSL(NNTP): def __init__( self, host: str, - port: int = ..., - user: str | None = ..., - password: str | None = ..., - ssl_context: ssl.SSLContext | None = ..., - readermode: bool | None = ..., - usenetrc: bool = ..., + port: int = 563, + user: str | None = None, + password: str | None = None, + ssl_context: ssl.SSLContext | None = None, + readermode: bool | None = None, + usenetrc: bool = False, timeout: float = ..., ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/ntpath.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/ntpath.pyi index 0cd3e4464..f1fa137c6 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/ntpath.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/ntpath.pyi @@ -101,9 +101,9 @@ def join(__path: BytesPath, *paths: BytesPath) -> bytes: ... if sys.platform == "win32": if sys.version_info >= (3, 10): @overload - def realpath(path: PathLike[AnyStr], *, strict: bool = ...) -> AnyStr: ... + def realpath(path: PathLike[AnyStr], *, strict: bool = False) -> AnyStr: ... @overload - def realpath(path: AnyStr, *, strict: bool = ...) -> AnyStr: ... + def realpath(path: AnyStr, *, strict: bool = False) -> AnyStr: ... else: @overload def realpath(path: PathLike[AnyStr]) -> AnyStr: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/numbers.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/numbers.pyi index d94ae7faf..55f21041a 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/numbers.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/numbers.pyi @@ -60,7 +60,7 @@ class Real(Complex, SupportsFloat): def __ceil__(self) -> int: ... @abstractmethod @overload - def __round__(self, ndigits: None = ...) -> int: ... + def __round__(self, ndigits: None = None) -> int: ... @abstractmethod @overload def __round__(self, ndigits: int) -> Any: ... @@ -99,7 +99,7 @@ class Integral(Rational): def __int__(self) -> int: ... def __index__(self) -> int: ... @abstractmethod - def __pow__(self, exponent: Any, modulus: Any | None = ...) -> Any: ... + def __pow__(self, exponent: Any, modulus: Any | None = None) -> Any: ... @abstractmethod def __lshift__(self, other: Any) -> Any: ... @abstractmethod diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/opcode.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/opcode.pyi index 402dbb74c..1232454e7 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/opcode.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/opcode.pyi @@ -49,9 +49,9 @@ HAVE_ARGUMENT: Literal[90] EXTENDED_ARG: Literal[144] if sys.version_info >= (3, 8): - def stack_effect(__opcode: int, __oparg: int | None = ..., *, jump: bool | None = ...) -> int: ... + def stack_effect(__opcode: int, __oparg: int | None = None, *, jump: bool | None = None) -> int: ... else: - def stack_effect(__opcode: int, __oparg: int | None = ...) -> int: ... + def stack_effect(__opcode: int, __oparg: int | None = None) -> int: ... hasnargs: list[int] diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/operator.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/operator.pyi index c3fc4b0a8..a0e5df797 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/operator.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/operator.pyi @@ -1,5 +1,4 @@ import sys - from _operator import * __all__ = [ diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/optparse.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/optparse.pyi index b571ff068..a8c1c4cfb 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/optparse.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/optparse.pyi @@ -42,7 +42,6 @@ class AmbiguousOptionError(BadOptionError): def __init__(self, opt_str: str, possibilities: Sequence[str]) -> None: ... class OptionError(OptParseError): - msg: str option_id: str def __init__(self, msg: str, option: Option) -> None: ... @@ -83,14 +82,14 @@ class HelpFormatter: class IndentedHelpFormatter(HelpFormatter): def __init__( - self, indent_increment: int = ..., max_help_position: int = ..., width: int | None = ..., short_first: int = ... + self, indent_increment: int = 2, max_help_position: int = 24, width: int | None = None, short_first: int = 1 ) -> None: ... def format_heading(self, heading: str) -> str: ... def format_usage(self, usage: str) -> str: ... class TitledHelpFormatter(HelpFormatter): def __init__( - self, indent_increment: int = ..., max_help_position: int = ..., width: int | None = ..., short_first: int = ... + self, indent_increment: int = 0, max_help_position: int = 24, width: int | None = None, short_first: int = 0 ) -> None: ... def format_heading(self, heading: str) -> str: ... def format_usage(self, usage: str) -> str: ... @@ -168,18 +167,18 @@ class OptionGroup(OptionContainer): option_list: list[Option] parser: OptionParser title: str - def __init__(self, parser: OptionParser, title: str, description: str | None = ...) -> None: ... + def __init__(self, parser: OptionParser, title: str, description: str | None = None) -> None: ... def _create_option_list(self) -> None: ... def set_title(self, title: str) -> None: ... class Values: - def __init__(self, defaults: Mapping[str, Any] | None = ...) -> None: ... + def __init__(self, defaults: Mapping[str, Any] | None = None) -> None: ... def _update(self, dict: Mapping[str, Any], mode: Any) -> None: ... def _update_careful(self, dict: Mapping[str, Any]) -> None: ... def _update_loose(self, dict: Mapping[str, Any]) -> None: ... def ensure_value(self, attr: str, value: Any) -> Any: ... - def read_file(self, filename: str, mode: str = ...) -> None: ... - def read_module(self, modname: str, mode: str = ...) -> None: ... + def read_file(self, filename: str, mode: str = "careful") -> None: ... + def read_module(self, modname: str, mode: str = "careful") -> None: ... def __getattr__(self, name: str) -> Any: ... def __setattr__(self, __name: str, __value: Any) -> None: ... def __eq__(self, other: object) -> bool: ... @@ -200,16 +199,16 @@ class OptionParser(OptionContainer): version: str def __init__( self, - usage: str | None = ..., - option_list: Iterable[Option] | None = ..., + usage: str | None = None, + option_list: Iterable[Option] | None = None, option_class: type[Option] = ..., - version: str | None = ..., - conflict_handler: str = ..., - description: str | None = ..., - formatter: HelpFormatter | None = ..., - add_help_option: bool = ..., - prog: str | None = ..., - epilog: str | None = ..., + version: str | None = None, + conflict_handler: str = "error", + description: str | None = None, + formatter: HelpFormatter | None = None, + add_help_option: bool = True, + prog: str | None = None, + epilog: str | None = None, ) -> None: ... def _add_help_option(self) -> None: ... def _add_version_option(self) -> None: ... @@ -218,7 +217,7 @@ class OptionParser(OptionContainer): def _get_args(self, args: Iterable[Any]) -> list[Any]: ... def _init_parsing_state(self) -> None: ... def _match_long_opt(self, opt: str) -> str: ... - def _populate_option_list(self, option_list: Iterable[Option], add_help: bool = ...) -> None: ... + def _populate_option_list(self, option_list: Iterable[Option], add_help: bool = True) -> None: ... def _process_args(self, largs: list[Any], rargs: list[Any], values: Values) -> None: ... def _process_long_opt(self, rargs: list[Any], values: Any) -> None: ... def _process_short_opts(self, rargs: list[Any], values: Any) -> None: ... @@ -230,23 +229,23 @@ class OptionParser(OptionContainer): def disable_interspersed_args(self) -> None: ... def enable_interspersed_args(self) -> None: ... def error(self, msg: str) -> None: ... - def exit(self, status: int = ..., msg: str | None = ...) -> None: ... + def exit(self, status: int = 0, msg: str | None = None) -> None: ... def expand_prog_name(self, s: str | None) -> Any: ... def format_epilog(self, formatter: HelpFormatter) -> Any: ... - def format_help(self, formatter: HelpFormatter | None = ...) -> str: ... - def format_option_help(self, formatter: HelpFormatter | None = ...) -> str: ... + def format_help(self, formatter: HelpFormatter | None = None) -> str: ... + def format_option_help(self, formatter: HelpFormatter | None = None) -> str: ... def get_default_values(self) -> Values: ... def get_option_group(self, opt_str: str) -> Any: ... def get_prog_name(self) -> str: ... def get_usage(self) -> str: ... def get_version(self) -> str: ... @overload - def parse_args(self, args: None = ..., values: Values | None = ...) -> tuple[Values, list[str]]: ... + def parse_args(self, args: None = None, values: Values | None = None) -> tuple[Values, list[str]]: ... @overload - def parse_args(self, args: Sequence[AnyStr], values: Values | None = ...) -> tuple[Values, list[AnyStr]]: ... - def print_usage(self, file: IO[str] | None = ...) -> None: ... - def print_help(self, file: IO[str] | None = ...) -> None: ... - def print_version(self, file: IO[str] | None = ...) -> None: ... + def parse_args(self, args: Sequence[AnyStr], values: Values | None = None) -> tuple[Values, list[AnyStr]]: ... + def print_usage(self, file: IO[str] | None = None) -> None: ... + def print_help(self, file: IO[str] | None = None) -> None: ... + def print_version(self, file: IO[str] | None = None) -> None: ... def set_default(self, dest: Any, value: Any) -> None: ... def set_defaults(self, **kwargs: Any) -> None: ... def set_process_default_values(self, process: Any) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/os/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/os/__init__.pyi index e3d428555..efe80d82f 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/os/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/os/__init__.pyi @@ -3,15 +3,19 @@ from _typeshed import ( AnyStr_co, BytesPath, FileDescriptorLike, + FileDescriptorOrPath, GenericPath, OpenBinaryMode, OpenBinaryModeReading, OpenBinaryModeUpdating, OpenBinaryModeWriting, OpenTextMode, - Self, + ReadableBuffer, StrOrBytesPath, StrPath, + SupportsLenAndGetItem, + Unused, + WriteableBuffer, structseq, ) from abc import abstractmethod @@ -21,7 +25,7 @@ from contextlib import AbstractContextManager from io import BufferedRandom, BufferedReader, BufferedWriter, FileIO, TextIOWrapper as _TextIOWrapper from subprocess import Popen from typing import IO, Any, AnyStr, BinaryIO, Generic, NoReturn, Protocol, TypeVar, overload, runtime_checkable -from typing_extensions import Final, Literal, TypeAlias, final +from typing_extensions import Final, Literal, Self, TypeAlias, final from . import path as _path @@ -240,9 +244,9 @@ class _Environ(MutableMapping[AnyStr, AnyStr], Generic[AnyStr]): # overloading MutableMapping.update in stdlib/typing.pyi # The type: ignore is needed due to incompatible __or__/__ior__ signatures @overload # type: ignore[misc] - def __ior__(self: Self, other: Mapping[AnyStr, AnyStr]) -> Self: ... + def __ior__(self, other: Mapping[AnyStr, AnyStr]) -> Self: ... @overload - def __ior__(self: Self, other: Iterable[tuple[AnyStr, AnyStr]]) -> Self: ... + def __ior__(self, other: Iterable[tuple[AnyStr, AnyStr]]) -> Self: ... environ: _Environ[str] if sys.platform != "win32": @@ -362,14 +366,11 @@ class PathLike(Protocol[AnyStr_co]): def __fspath__(self) -> AnyStr_co: ... @overload -def listdir(path: StrPath | None = ...) -> list[str]: ... +def listdir(path: StrPath | None = None) -> list[str]: ... @overload def listdir(path: BytesPath) -> list[bytes]: ... @overload def listdir(path: int) -> list[str]: ... - -_FdOrAnyPath: TypeAlias = int | StrOrBytesPath - @final class DirEntry(Generic[AnyStr]): # This is what the scandir iterator yields @@ -380,10 +381,10 @@ class DirEntry(Generic[AnyStr]): @property def path(self) -> AnyStr: ... def inode(self) -> int: ... - def is_dir(self, *, follow_symlinks: bool = ...) -> bool: ... - def is_file(self, *, follow_symlinks: bool = ...) -> bool: ... + def is_dir(self, *, follow_symlinks: bool = True) -> bool: ... + def is_file(self, *, follow_symlinks: bool = True) -> bool: ... def is_symlink(self) -> bool: ... - def stat(self, *, follow_symlinks: bool = ...) -> stat_result: ... + def stat(self, *, follow_symlinks: bool = True) -> stat_result: ... def __fspath__(self) -> AnyStr: ... if sys.version_info >= (3, 9): def __class_getitem__(cls, item: Any) -> GenericAlias: ... @@ -435,7 +436,7 @@ def fspath(path: str) -> str: ... def fspath(path: bytes) -> bytes: ... @overload def fspath(path: PathLike[AnyStr]) -> AnyStr: ... -def get_exec_path(env: Mapping[str, str] | None = ...) -> list[str]: ... +def get_exec_path(env: Mapping[str, str] | None = None) -> list[str]: ... def getlogin() -> str: ... def getpid() -> int: ... def getppid() -> int: ... @@ -500,20 +501,23 @@ if sys.platform != "win32": def getenvb(key: bytes) -> bytes | None: ... @overload def getenvb(key: bytes, default: _T) -> bytes | _T: ... + def putenv(__name: StrOrBytesPath, __value: StrOrBytesPath) -> None: ... + def unsetenv(__name: StrOrBytesPath) -> None: ... -def putenv(__name: bytes | str, __value: bytes | str) -> None: ... +else: + def putenv(__name: str, __value: str) -> None: ... -if sys.platform != "win32" or sys.version_info >= (3, 9): - def unsetenv(__name: bytes | str) -> None: ... + if sys.version_info >= (3, 9): + def unsetenv(__name: str) -> None: ... _Opener: TypeAlias = Callable[[str, int], int] @overload def fdopen( fd: int, - mode: OpenTextMode = ..., - buffering: int = ..., - encoding: str | None = ..., + mode: OpenTextMode = "r", + buffering: int = -1, + encoding: str | None = None, errors: str | None = ..., newline: str | None = ..., closefd: bool = ..., @@ -524,9 +528,9 @@ def fdopen( fd: int, mode: OpenBinaryMode, buffering: Literal[0], - encoding: None = ..., - errors: None = ..., - newline: None = ..., + encoding: None = None, + errors: None = None, + newline: None = None, closefd: bool = ..., opener: _Opener | None = ..., ) -> FileIO: ... @@ -534,10 +538,10 @@ def fdopen( def fdopen( fd: int, mode: OpenBinaryModeUpdating, - buffering: Literal[-1, 1] = ..., - encoding: None = ..., - errors: None = ..., - newline: None = ..., + buffering: Literal[-1, 1] = -1, + encoding: None = None, + errors: None = None, + newline: None = None, closefd: bool = ..., opener: _Opener | None = ..., ) -> BufferedRandom: ... @@ -545,10 +549,10 @@ def fdopen( def fdopen( fd: int, mode: OpenBinaryModeWriting, - buffering: Literal[-1, 1] = ..., - encoding: None = ..., - errors: None = ..., - newline: None = ..., + buffering: Literal[-1, 1] = -1, + encoding: None = None, + errors: None = None, + newline: None = None, closefd: bool = ..., opener: _Opener | None = ..., ) -> BufferedWriter: ... @@ -556,10 +560,10 @@ def fdopen( def fdopen( fd: int, mode: OpenBinaryModeReading, - buffering: Literal[-1, 1] = ..., - encoding: None = ..., - errors: None = ..., - newline: None = ..., + buffering: Literal[-1, 1] = -1, + encoding: None = None, + errors: None = None, + newline: None = None, closefd: bool = ..., opener: _Opener | None = ..., ) -> BufferedReader: ... @@ -567,10 +571,10 @@ def fdopen( def fdopen( fd: int, mode: OpenBinaryMode, - buffering: int = ..., - encoding: None = ..., - errors: None = ..., - newline: None = ..., + buffering: int = -1, + encoding: None = None, + errors: None = None, + newline: None = None, closefd: bool = ..., opener: _Opener | None = ..., ) -> BinaryIO: ... @@ -578,8 +582,8 @@ def fdopen( def fdopen( fd: int, mode: str, - buffering: int = ..., - encoding: str | None = ..., + buffering: int = -1, + encoding: str | None = None, errors: str | None = ..., newline: str | None = ..., closefd: bool = ..., @@ -589,7 +593,7 @@ def close(fd: int) -> None: ... def closerange(__fd_low: int, __fd_high: int) -> None: ... def device_encoding(fd: int) -> str | None: ... def dup(__fd: int) -> int: ... -def dup2(fd: int, fd2: int, inheritable: bool = ...) -> int: ... +def dup2(fd: int, fd2: int, inheritable: bool = True) -> int: ... def fstat(fd: int) -> stat_result: ... def ftruncate(__fd: int, __length: int) -> None: ... def fsync(fd: FileDescriptorLike) -> None: ... @@ -599,12 +603,11 @@ if sys.platform != "win32" and sys.version_info >= (3, 11): def login_tty(__fd: int) -> None: ... def lseek(__fd: int, __position: int, __how: int) -> int: ... -def open(path: StrOrBytesPath, flags: int, mode: int = ..., *, dir_fd: int | None = ...) -> int: ... +def open(path: StrOrBytesPath, flags: int, mode: int = 0o777, *, dir_fd: int | None = None) -> int: ... def pipe() -> tuple[int, int]: ... def read(__fd: int, __length: int) -> bytes: ... if sys.platform != "win32": - # Unix only def fchmod(fd: int, mode: int) -> None: ... def fchown(fd: int, uid: int, gid: int) -> None: ... def fpathconf(__fd: int, __name: str | int) -> int: ... @@ -620,12 +623,13 @@ if sys.platform != "win32": def posix_fadvise(__fd: int, __offset: int, __length: int, __advice: int) -> None: ... def pread(__fd: int, __length: int, __offset: int) -> bytes: ... - def pwrite(__fd: int, __buffer: bytes, __offset: int) -> int: ... + def pwrite(__fd: int, __buffer: ReadableBuffer, __offset: int) -> int: ... + # In CI, stubtest sometimes reports that these are available on MacOS, sometimes not + def preadv(__fd: int, __buffers: SupportsLenAndGetItem[WriteableBuffer], __offset: int, __flags: int = 0) -> int: ... + def pwritev(__fd: int, __buffers: SupportsLenAndGetItem[ReadableBuffer], __offset: int, __flags: int = 0) -> int: ... if sys.platform != "darwin": if sys.version_info >= (3, 10): RWF_APPEND: int # docs say available on 3.7+, stubtest says otherwise - def preadv(__fd: int, __buffers: Iterable[bytes], __offset: int, __flags: int = ...) -> int: ... - def pwritev(__fd: int, __buffers: Iterable[bytes], __offset: int, __flags: int = ...) -> int: ... RWF_DSYNC: int RWF_SYNC: int RWF_HIPRI: int @@ -638,12 +642,12 @@ if sys.platform != "win32": in_fd: int, offset: int, count: int, - headers: Sequence[bytes] = ..., - trailers: Sequence[bytes] = ..., - flags: int = ..., + headers: Sequence[ReadableBuffer] = ..., + trailers: Sequence[ReadableBuffer] = ..., + flags: int = 0, ) -> int: ... # FreeBSD and Mac OS X only - def readv(__fd: int, __buffers: Sequence[bytearray]) -> int: ... - def writev(__fd: int, __buffers: Sequence[bytes]) -> int: ... + def readv(__fd: int, __buffers: SupportsLenAndGetItem[WriteableBuffer]) -> int: ... + def writev(__fd: int, __buffers: SupportsLenAndGetItem[ReadableBuffer]) -> int: ... @final class terminal_size(structseq[int], tuple[int, int]): @@ -668,118 +672,134 @@ if sys.platform != "win32": def tcsetpgrp(__fd: int, __pgid: int) -> None: ... def ttyname(__fd: int) -> str: ... -def write(__fd: int, __data: bytes) -> int: ... +def write(__fd: int, __data: ReadableBuffer) -> int: ... def access( - path: _FdOrAnyPath, mode: int, *, dir_fd: int | None = ..., effective_ids: bool = ..., follow_symlinks: bool = ... + path: FileDescriptorOrPath, mode: int, *, dir_fd: int | None = None, effective_ids: bool = False, follow_symlinks: bool = True ) -> bool: ... -def chdir(path: _FdOrAnyPath) -> None: ... +def chdir(path: FileDescriptorOrPath) -> None: ... if sys.platform != "win32": def fchdir(fd: FileDescriptorLike) -> None: ... def getcwd() -> str: ... def getcwdb() -> bytes: ... -def chmod(path: _FdOrAnyPath, mode: int, *, dir_fd: int | None = ..., follow_symlinks: bool = ...) -> None: ... +def chmod(path: FileDescriptorOrPath, mode: int, *, dir_fd: int | None = None, follow_symlinks: bool = True) -> None: ... if sys.platform != "win32" and sys.platform != "linux": - def chflags(path: StrOrBytesPath, flags: int, follow_symlinks: bool = ...) -> None: ... # some flavors of Unix + def chflags(path: StrOrBytesPath, flags: int, follow_symlinks: bool = True) -> None: ... # some flavors of Unix def lchflags(path: StrOrBytesPath, flags: int) -> None: ... def lchmod(path: StrOrBytesPath, mode: int) -> None: ... if sys.platform != "win32": def chroot(path: StrOrBytesPath) -> None: ... - def chown(path: _FdOrAnyPath, uid: int, gid: int, *, dir_fd: int | None = ..., follow_symlinks: bool = ...) -> None: ... + def chown( + path: FileDescriptorOrPath, uid: int, gid: int, *, dir_fd: int | None = None, follow_symlinks: bool = True + ) -> None: ... def lchown(path: StrOrBytesPath, uid: int, gid: int) -> None: ... def link( src: StrOrBytesPath, dst: StrOrBytesPath, *, - src_dir_fd: int | None = ..., - dst_dir_fd: int | None = ..., - follow_symlinks: bool = ..., + src_dir_fd: int | None = None, + dst_dir_fd: int | None = None, + follow_symlinks: bool = True, ) -> None: ... -def lstat(path: StrOrBytesPath, *, dir_fd: int | None = ...) -> stat_result: ... -def mkdir(path: StrOrBytesPath, mode: int = ..., *, dir_fd: int | None = ...) -> None: ... +def lstat(path: StrOrBytesPath, *, dir_fd: int | None = None) -> stat_result: ... +def mkdir(path: StrOrBytesPath, mode: int = 0o777, *, dir_fd: int | None = None) -> None: ... if sys.platform != "win32": - def mkfifo(path: StrOrBytesPath, mode: int = ..., *, dir_fd: int | None = ...) -> None: ... # Unix only + def mkfifo(path: StrOrBytesPath, mode: int = 0o666, *, dir_fd: int | None = None) -> None: ... # Unix only -def makedirs(name: StrOrBytesPath, mode: int = ..., exist_ok: bool = ...) -> None: ... +def makedirs(name: StrOrBytesPath, mode: int = 0o777, exist_ok: bool = False) -> None: ... if sys.platform != "win32": - def mknod(path: StrOrBytesPath, mode: int = ..., device: int = ..., *, dir_fd: int | None = ...) -> None: ... + def mknod(path: StrOrBytesPath, mode: int = 0o600, device: int = 0, *, dir_fd: int | None = None) -> None: ... def major(__device: int) -> int: ... def minor(__device: int) -> int: ... def makedev(__major: int, __minor: int) -> int: ... - def pathconf(path: _FdOrAnyPath, name: str | int) -> int: ... # Unix only + def pathconf(path: FileDescriptorOrPath, name: str | int) -> int: ... # Unix only -def readlink(path: GenericPath[AnyStr], *, dir_fd: int | None = ...) -> AnyStr: ... -def remove(path: StrOrBytesPath, *, dir_fd: int | None = ...) -> None: ... +def readlink(path: GenericPath[AnyStr], *, dir_fd: int | None = None) -> AnyStr: ... +def remove(path: StrOrBytesPath, *, dir_fd: int | None = None) -> None: ... def removedirs(name: StrOrBytesPath) -> None: ... -def rename(src: StrOrBytesPath, dst: StrOrBytesPath, *, src_dir_fd: int | None = ..., dst_dir_fd: int | None = ...) -> None: ... +def rename(src: StrOrBytesPath, dst: StrOrBytesPath, *, src_dir_fd: int | None = None, dst_dir_fd: int | None = None) -> None: ... def renames(old: StrOrBytesPath, new: StrOrBytesPath) -> None: ... -def replace(src: StrOrBytesPath, dst: StrOrBytesPath, *, src_dir_fd: int | None = ..., dst_dir_fd: int | None = ...) -> None: ... -def rmdir(path: StrOrBytesPath, *, dir_fd: int | None = ...) -> None: ... +def replace( + src: StrOrBytesPath, dst: StrOrBytesPath, *, src_dir_fd: int | None = None, dst_dir_fd: int | None = None +) -> None: ... +def rmdir(path: StrOrBytesPath, *, dir_fd: int | None = None) -> None: ... class _ScandirIterator(Iterator[DirEntry[AnyStr]], AbstractContextManager[_ScandirIterator[AnyStr]]): def __next__(self) -> DirEntry[AnyStr]: ... - def __exit__(self, *args: object) -> None: ... + def __exit__(self, *args: Unused) -> None: ... def close(self) -> None: ... @overload -def scandir(path: None = ...) -> _ScandirIterator[str]: ... +def scandir(path: None = None) -> _ScandirIterator[str]: ... @overload def scandir(path: int) -> _ScandirIterator[str]: ... @overload def scandir(path: GenericPath[AnyStr]) -> _ScandirIterator[AnyStr]: ... -def stat(path: _FdOrAnyPath, *, dir_fd: int | None = ..., follow_symlinks: bool = ...) -> stat_result: ... +def stat(path: FileDescriptorOrPath, *, dir_fd: int | None = None, follow_symlinks: bool = True) -> stat_result: ... if sys.platform != "win32": - def statvfs(path: _FdOrAnyPath) -> statvfs_result: ... # Unix only + def statvfs(path: FileDescriptorOrPath) -> statvfs_result: ... # Unix only -def symlink(src: StrOrBytesPath, dst: StrOrBytesPath, target_is_directory: bool = ..., *, dir_fd: int | None = ...) -> None: ... +def symlink( + src: StrOrBytesPath, dst: StrOrBytesPath, target_is_directory: bool = False, *, dir_fd: int | None = None +) -> None: ... if sys.platform != "win32": def sync() -> None: ... # Unix only -def truncate(path: _FdOrAnyPath, length: int) -> None: ... # Unix only up to version 3.4 -def unlink(path: StrOrBytesPath, *, dir_fd: int | None = ...) -> None: ... +def truncate(path: FileDescriptorOrPath, length: int) -> None: ... # Unix only up to version 3.4 +def unlink(path: StrOrBytesPath, *, dir_fd: int | None = None) -> None: ... def utime( - path: _FdOrAnyPath, - times: tuple[int, int] | tuple[float, float] | None = ..., + path: FileDescriptorOrPath, + times: tuple[int, int] | tuple[float, float] | None = None, *, ns: tuple[int, int] = ..., - dir_fd: int | None = ..., - follow_symlinks: bool = ..., + dir_fd: int | None = None, + follow_symlinks: bool = True, ) -> None: ... _OnError: TypeAlias = Callable[[OSError], object] def walk( - top: GenericPath[AnyStr], topdown: bool = ..., onerror: _OnError | None = ..., followlinks: bool = ... + top: GenericPath[AnyStr], topdown: bool = True, onerror: _OnError | None = None, followlinks: bool = False ) -> Iterator[tuple[AnyStr, list[AnyStr], list[AnyStr]]]: ... if sys.platform != "win32": @overload def fwalk( - top: StrPath = ..., - topdown: bool = ..., - onerror: _OnError | None = ..., + top: StrPath = ".", + topdown: bool = True, + onerror: _OnError | None = None, *, - follow_symlinks: bool = ..., - dir_fd: int | None = ..., + follow_symlinks: bool = False, + dir_fd: int | None = None, ) -> Iterator[tuple[str, list[str], list[str], int]]: ... @overload def fwalk( - top: bytes, topdown: bool = ..., onerror: _OnError | None = ..., *, follow_symlinks: bool = ..., dir_fd: int | None = ... + top: BytesPath, + topdown: bool = True, + onerror: _OnError | None = None, + *, + follow_symlinks: bool = False, + dir_fd: int | None = None, ) -> Iterator[tuple[bytes, list[bytes], list[bytes], int]]: ... if sys.platform == "linux": - def getxattr(path: _FdOrAnyPath, attribute: StrOrBytesPath, *, follow_symlinks: bool = ...) -> bytes: ... - def listxattr(path: _FdOrAnyPath | None = ..., *, follow_symlinks: bool = ...) -> list[str]: ... - def removexattr(path: _FdOrAnyPath, attribute: StrOrBytesPath, *, follow_symlinks: bool = ...) -> None: ... + def getxattr(path: FileDescriptorOrPath, attribute: StrOrBytesPath, *, follow_symlinks: bool = True) -> bytes: ... + def listxattr(path: FileDescriptorOrPath | None = None, *, follow_symlinks: bool = True) -> list[str]: ... + def removexattr(path: FileDescriptorOrPath, attribute: StrOrBytesPath, *, follow_symlinks: bool = True) -> None: ... def setxattr( - path: _FdOrAnyPath, attribute: StrOrBytesPath, value: bytes, flags: int = ..., *, follow_symlinks: bool = ... + path: FileDescriptorOrPath, + attribute: StrOrBytesPath, + value: ReadableBuffer, + flags: int = 0, + *, + follow_symlinks: bool = True, ) -> None: ... def abort() -> NoReturn: ... @@ -807,10 +827,14 @@ _ExecVArgs: TypeAlias = ( | list[str | PathLike[Any]] | list[bytes | str | PathLike[Any]] ) +# Depending on the OS, the keys and values are passed either to +# PyUnicode_FSDecoder (which accepts str | ReadableBuffer) or to +# PyUnicode_FSConverter (which accepts StrOrBytesPath). For simplicity, +# we limit to str | bytes. _ExecEnv: TypeAlias = Mapping[bytes, bytes | str] | Mapping[str, bytes | str] def execv(__path: StrOrBytesPath, __argv: _ExecVArgs) -> NoReturn: ... -def execve(path: _FdOrAnyPath, argv: _ExecVArgs, env: _ExecEnv) -> NoReturn: ... +def execve(path: FileDescriptorOrPath, argv: _ExecVArgs, env: _ExecEnv) -> NoReturn: ... def execvp(file: StrOrBytesPath, args: _ExecVArgs) -> NoReturn: ... def execvpe(file: StrOrBytesPath, args: _ExecVArgs, env: _ExecEnv) -> NoReturn: ... def _exit(status: int) -> NoReturn: ... @@ -829,7 +853,7 @@ class _wrap_close(_TextIOWrapper): def __init__(self, stream: _TextIOWrapper, proc: Popen[str]) -> None: ... def close(self) -> int | None: ... # type: ignore[override] -def popen(cmd: str, mode: str = ..., buffering: int = ...) -> _wrap_close: ... +def popen(cmd: str, mode: str = "r", buffering: int = -1) -> _wrap_close: ... def spawnl(mode: int, file: StrOrBytesPath, arg0: StrOrBytesPath, *args: StrOrBytesPath) -> int: ... def spawnle(mode: int, file: StrOrBytesPath, arg0: StrOrBytesPath, *args: Any) -> int: ... # Imprecise sig @@ -861,7 +885,10 @@ def times() -> times_result: ... def waitpid(__pid: int, __options: int) -> tuple[int, int]: ... if sys.platform == "win32": - def startfile(path: StrOrBytesPath, operation: str | None = ...) -> None: ... + if sys.version_info >= (3, 8): + def startfile(path: StrOrBytesPath, operation: str | None = None) -> None: ... + else: + def startfile(filepath: StrOrBytesPath, operation: str | None = None) -> None: ... else: def spawnlp(mode: int, file: StrOrBytesPath, arg0: StrOrBytesPath, *args: StrOrBytesPath) -> int: ... @@ -933,7 +960,7 @@ if sys.platform != "win32": class sched_param(structseq[int], tuple[int]): if sys.version_info >= (3, 10): __match_args__: Final = ("sched_priority",) - def __new__(cls: type[Self], sched_priority: int) -> Self: ... + def __new__(cls, sched_priority: int) -> Self: ... @property def sched_priority(self) -> int: ... @@ -958,7 +985,7 @@ if sys.platform != "win32": def sysconf(__name: str | int) -> int: ... if sys.platform == "linux": - def getrandom(size: int, flags: int = ...) -> bytes: ... + def getrandom(size: int, flags: int = 0) -> bytes: ... def urandom(__size: int) -> bytes: ... @@ -976,8 +1003,8 @@ if sys.version_info >= (3, 8): path: str | None def __init__(self, path: str | None, cookie: _T, remove_dll_directory: Callable[[_T], object]) -> None: ... def close(self) -> None: ... - def __enter__(self: Self) -> Self: ... - def __exit__(self, *args: object) -> None: ... + def __enter__(self) -> Self: ... + def __exit__(self, *args: Unused) -> None: ... def add_dll_directory(path: str) -> _AddedDllDirectory: ... if sys.platform == "linux": diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/pathlib.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/pathlib.pyi index 2a0f1760c..114678ed5 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/pathlib.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/pathlib.pyi @@ -5,15 +5,16 @@ from _typeshed import ( OpenBinaryModeUpdating, OpenBinaryModeWriting, OpenTextMode, - Self, + ReadableBuffer, + StrOrBytesPath, StrPath, ) -from collections.abc import Generator, Sequence +from collections.abc import Callable, Generator, Iterator, Sequence from io import BufferedRandom, BufferedReader, BufferedWriter, FileIO, TextIOWrapper from os import PathLike, stat_result from types import TracebackType from typing import IO, Any, BinaryIO, overload -from typing_extensions import Literal +from typing_extensions import Literal, Self if sys.version_info >= (3, 9): from types import GenericAlias @@ -37,15 +38,15 @@ class PurePath(PathLike[str]): def suffixes(self) -> list[str]: ... @property def stem(self) -> str: ... - def __new__(cls: type[Self], *args: StrPath) -> Self: ... + def __new__(cls, *args: StrPath) -> Self: ... def __eq__(self, other: object) -> bool: ... def __fspath__(self) -> str: ... def __lt__(self, other: PurePath) -> bool: ... def __le__(self, other: PurePath) -> bool: ... def __gt__(self, other: PurePath) -> bool: ... def __ge__(self, other: PurePath) -> bool: ... - def __truediv__(self: Self, key: StrPath) -> Self: ... - def __rtruediv__(self: Self, key: StrPath) -> Self: ... + def __truediv__(self, key: StrPath) -> Self: ... + def __rtruediv__(self, key: StrPath) -> Self: ... def __bytes__(self) -> bytes: ... def as_posix(self) -> str: ... def as_uri(self) -> str: ... @@ -55,17 +56,17 @@ class PurePath(PathLike[str]): def is_relative_to(self, *other: StrPath) -> bool: ... def match(self, path_pattern: str) -> bool: ... - def relative_to(self: Self, *other: StrPath) -> Self: ... - def with_name(self: Self, name: str) -> Self: ... + def relative_to(self, *other: StrPath) -> Self: ... + def with_name(self, name: str) -> Self: ... if sys.version_info >= (3, 9): - def with_stem(self: Self, stem: str) -> Self: ... + def with_stem(self, stem: str) -> Self: ... - def with_suffix(self: Self, suffix: str) -> Self: ... - def joinpath(self: Self, *other: StrPath) -> Self: ... + def with_suffix(self, suffix: str) -> Self: ... + def joinpath(self, *other: StrPath) -> Self: ... @property - def parents(self: Self) -> Sequence[Self]: ... + def parents(self) -> Sequence[Self]: ... @property - def parent(self: Self) -> Self: ... + def parent(self) -> Self: ... if sys.version_info >= (3, 9) and sys.version_info < (3, 11): def __class_getitem__(cls, type: Any) -> GenericAlias: ... @@ -73,20 +74,20 @@ class PurePosixPath(PurePath): ... class PureWindowsPath(PurePath): ... class Path(PurePath): - def __new__(cls: type[Self], *args: StrPath, **kwargs: Any) -> Self: ... - def __enter__(self: Self) -> Self: ... + def __new__(cls, *args: StrPath, **kwargs: Any) -> Self: ... + def __enter__(self) -> Self: ... def __exit__(self, t: type[BaseException] | None, v: BaseException | None, tb: TracebackType | None) -> None: ... @classmethod - def cwd(cls: type[Self]) -> Self: ... + def cwd(cls) -> Self: ... if sys.version_info >= (3, 10): - def stat(self, *, follow_symlinks: bool = ...) -> stat_result: ... - def chmod(self, mode: int, *, follow_symlinks: bool = ...) -> None: ... + def stat(self, *, follow_symlinks: bool = True) -> stat_result: ... + def chmod(self, mode: int, *, follow_symlinks: bool = True) -> None: ... else: def stat(self) -> stat_result: ... def chmod(self, mode: int) -> None: ... def exists(self) -> bool: ... - def glob(self: Self, pattern: str) -> Generator[Self, None, None]: ... + def glob(self, pattern: str) -> Generator[Self, None, None]: ... def is_dir(self) -> bool: ... def is_file(self) -> bool: ... def is_symlink(self) -> bool: ... @@ -94,64 +95,64 @@ class Path(PurePath): def is_fifo(self) -> bool: ... def is_block_device(self) -> bool: ... def is_char_device(self) -> bool: ... - def iterdir(self: Self) -> Generator[Self, None, None]: ... + def iterdir(self) -> Generator[Self, None, None]: ... def lchmod(self, mode: int) -> None: ... def lstat(self) -> stat_result: ... - def mkdir(self, mode: int = ..., parents: bool = ..., exist_ok: bool = ...) -> None: ... + def mkdir(self, mode: int = 0o777, parents: bool = False, exist_ok: bool = False) -> None: ... # Adapted from builtins.open # Text mode: always returns a TextIOWrapper # The Traversable .open in stdlib/importlib/abc.pyi should be kept in sync with this. @overload def open( self, - mode: OpenTextMode = ..., - buffering: int = ..., - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., + mode: OpenTextMode = "r", + buffering: int = -1, + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, ) -> TextIOWrapper: ... # Unbuffered binary mode: returns a FileIO @overload def open( - self, mode: OpenBinaryMode, buffering: Literal[0], encoding: None = ..., errors: None = ..., newline: None = ... + self, mode: OpenBinaryMode, buffering: Literal[0], encoding: None = None, errors: None = None, newline: None = None ) -> FileIO: ... # Buffering is on: return BufferedRandom, BufferedReader, or BufferedWriter @overload def open( self, mode: OpenBinaryModeUpdating, - buffering: Literal[-1, 1] = ..., - encoding: None = ..., - errors: None = ..., - newline: None = ..., + buffering: Literal[-1, 1] = -1, + encoding: None = None, + errors: None = None, + newline: None = None, ) -> BufferedRandom: ... @overload def open( self, mode: OpenBinaryModeWriting, - buffering: Literal[-1, 1] = ..., - encoding: None = ..., - errors: None = ..., - newline: None = ..., + buffering: Literal[-1, 1] = -1, + encoding: None = None, + errors: None = None, + newline: None = None, ) -> BufferedWriter: ... @overload def open( self, mode: OpenBinaryModeReading, - buffering: Literal[-1, 1] = ..., - encoding: None = ..., - errors: None = ..., - newline: None = ..., + buffering: Literal[-1, 1] = -1, + encoding: None = None, + errors: None = None, + newline: None = None, ) -> BufferedReader: ... # Buffering cannot be determined: fall back to BinaryIO @overload def open( - self, mode: OpenBinaryMode, buffering: int = ..., encoding: None = ..., errors: None = ..., newline: None = ... + self, mode: OpenBinaryMode, buffering: int = -1, encoding: None = None, errors: None = None, newline: None = None ) -> BinaryIO: ... # Fallback if mode is not specified @overload def open( - self, mode: str, buffering: int = ..., encoding: str | None = ..., errors: str | None = ..., newline: str | None = ... + self, mode: str, buffering: int = -1, encoding: str | None = None, errors: str | None = None, newline: str | None = None ) -> IO[Any]: ... if sys.platform != "win32": # These methods do "exist" on Windows, but they always raise NotImplementedError, @@ -161,43 +162,47 @@ class Path(PurePath): def is_mount(self) -> bool: ... if sys.version_info >= (3, 9): - def readlink(self: Self) -> Self: ... + def readlink(self) -> Self: ... if sys.version_info >= (3, 8): - def rename(self: Self, target: str | PurePath) -> Self: ... - def replace(self: Self, target: str | PurePath) -> Self: ... + def rename(self, target: str | PurePath) -> Self: ... + def replace(self, target: str | PurePath) -> Self: ... else: def rename(self, target: str | PurePath) -> None: ... def replace(self, target: str | PurePath) -> None: ... - def resolve(self: Self, strict: bool = ...) -> Self: ... - def rglob(self: Self, pattern: str) -> Generator[Self, None, None]: ... + def resolve(self, strict: bool = False) -> Self: ... + def rglob(self, pattern: str) -> Generator[Self, None, None]: ... def rmdir(self) -> None: ... - def symlink_to(self, target: str | Path, target_is_directory: bool = ...) -> None: ... + def symlink_to(self, target: str | Path, target_is_directory: bool = False) -> None: ... if sys.version_info >= (3, 10): def hardlink_to(self, target: str | Path) -> None: ... - def touch(self, mode: int = ..., exist_ok: bool = ...) -> None: ... + def touch(self, mode: int = 0o666, exist_ok: bool = True) -> None: ... if sys.version_info >= (3, 8): - def unlink(self, missing_ok: bool = ...) -> None: ... + def unlink(self, missing_ok: bool = False) -> None: ... else: def unlink(self) -> None: ... @classmethod - def home(cls: type[Self]) -> Self: ... - def absolute(self: Self) -> Self: ... - def expanduser(self: Self) -> Self: ... + def home(cls) -> Self: ... + def absolute(self) -> Self: ... + def expanduser(self) -> Self: ... def read_bytes(self) -> bytes: ... - def read_text(self, encoding: str | None = ..., errors: str | None = ...) -> str: ... - def samefile(self, other_path: str | bytes | int | Path) -> bool: ... - def write_bytes(self, data: bytes) -> int: ... + def read_text(self, encoding: str | None = None, errors: str | None = None) -> str: ... + def samefile(self, other_path: StrPath) -> bool: ... + def write_bytes(self, data: ReadableBuffer) -> int: ... if sys.version_info >= (3, 10): def write_text( - self, data: str, encoding: str | None = ..., errors: str | None = ..., newline: str | None = ... + self, data: str, encoding: str | None = None, errors: str | None = None, newline: str | None = None ) -> int: ... else: - def write_text(self, data: str, encoding: str | None = ..., errors: str | None = ...) -> int: ... - if sys.version_info >= (3, 8): - def link_to(self, target: StrPath | bytes) -> None: ... + def write_text(self, data: str, encoding: str | None = None, errors: str | None = None) -> int: ... + if sys.version_info >= (3, 8) and sys.version_info < (3, 12): + def link_to(self, target: StrOrBytesPath) -> None: ... + if sys.version_info >= (3, 12): + def walk( + self, top_down: bool = ..., on_error: Callable[[OSError], object] | None = ..., follow_symlinks: bool = ... + ) -> Iterator[tuple[Self, list[str], list[str]]]: ... class PosixPath(Path, PurePosixPath): ... class WindowsPath(Path, PureWindowsPath): ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/pdb.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/pdb.pyi index 6e95dcff6..e2871bb54 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/pdb.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/pdb.pyi @@ -1,13 +1,12 @@ import signal import sys -from _typeshed import Self from bdb import Bdb from cmd import Cmd from collections.abc import Callable, Iterable, Mapping, Sequence from inspect import _SourceObjectType from types import CodeType, FrameType, TracebackType from typing import IO, Any, ClassVar, TypeVar -from typing_extensions import ParamSpec +from typing_extensions import ParamSpec, Self __all__ = ["run", "pm", "Pdb", "runeval", "runctx", "runcall", "set_trace", "post_mortem", "help"] @@ -18,12 +17,12 @@ line_prefix: str # undocumented class Restart(Exception): ... -def run(statement: str, globals: dict[str, Any] | None = ..., locals: Mapping[str, Any] | None = ...) -> None: ... -def runeval(expression: str, globals: dict[str, Any] | None = ..., locals: Mapping[str, Any] | None = ...) -> Any: ... +def run(statement: str, globals: dict[str, Any] | None = None, locals: Mapping[str, Any] | None = None) -> None: ... +def runeval(expression: str, globals: dict[str, Any] | None = None, locals: Mapping[str, Any] | None = None) -> Any: ... def runctx(statement: str, globals: dict[str, Any], locals: Mapping[str, Any]) -> None: ... def runcall(func: Callable[_P, _T], *args: _P.args, **kwds: _P.kwargs) -> _T | None: ... -def set_trace(*, header: str | None = ...) -> None: ... -def post_mortem(t: TracebackType | None = ...) -> None: ... +def set_trace(*, header: str | None = None) -> None: ... +def post_mortem(t: TracebackType | None = None) -> None: ... def pm() -> None: ... class Pdb(Bdb, Cmd): @@ -47,12 +46,12 @@ class Pdb(Bdb, Cmd): curframe_locals: Mapping[str, Any] def __init__( self, - completekey: str = ..., - stdin: IO[str] | None = ..., - stdout: IO[str] | None = ..., - skip: Iterable[str] | None = ..., - nosigint: bool = ..., - readrc: bool = ..., + completekey: str = "tab", + stdin: IO[str] | None = None, + stdout: IO[str] | None = None, + skip: Iterable[str] | None = None, + nosigint: bool = False, + readrc: bool = True, ) -> None: ... def forget(self) -> None: ... def setup(self, f: FrameType | None, tb: TracebackType | None) -> None: ... @@ -66,7 +65,7 @@ class Pdb(Bdb, Cmd): def checkline(self, filename: str, lineno: int) -> int: ... def _getval(self, arg: str) -> object: ... def print_stack_trace(self) -> None: ... - def print_stack_entry(self, frame_lineno: tuple[FrameType, int], prompt_prefix: str = ...) -> None: ... + def print_stack_entry(self, frame_lineno: tuple[FrameType, int], prompt_prefix: str = "\n-> ") -> None: ... def lookupmodule(self, filename: str) -> str | None: ... if sys.version_info < (3, 11): def _runscript(self, filename: str) -> None: ... @@ -127,9 +126,9 @@ class Pdb(Bdb, Cmd): def message(self, msg: str) -> None: ... def error(self, msg: str) -> None: ... def _select_frame(self, number: int) -> None: ... - def _getval_except(self, arg: str, frame: FrameType | None = ...) -> object: ... + def _getval_except(self, arg: str, frame: FrameType | None = None) -> object: ... def _print_lines( - self, lines: Sequence[str], start: int, breaks: Sequence[int] = ..., frame: FrameType | None = ... + self, lines: Sequence[str], start: int, breaks: Sequence[int] = ..., frame: FrameType | None = None ) -> None: ... def _cmdloop(self) -> None: ... def do_display(self, arg: str) -> bool | None: ... @@ -173,4 +172,4 @@ def getsourcelines(obj: _SourceObjectType) -> tuple[list[str], int]: ... def lasti2lineno(code: CodeType, lasti: int) -> int: ... class _rstr(str): - def __repr__(self: Self) -> Self: ... + def __repr__(self) -> Self: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/pickle.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/pickle.pyi index 9a94e9ece..57c4cb03e 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/pickle.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/pickle.pyi @@ -1,7 +1,7 @@ import sys -from _typeshed import ReadableBuffer +from _typeshed import ReadableBuffer, SupportsWrite from collections.abc import Callable, Iterable, Iterator, Mapping -from typing import Any, ClassVar, Protocol, SupportsBytes, Union +from typing import Any, ClassVar, Protocol, SupportsBytes from typing_extensions import SupportsIndex, TypeAlias, final __all__ = [ @@ -97,9 +97,6 @@ class _ReadableFileobj(Protocol): def read(self, __n: int) -> bytes: ... def readline(self) -> bytes: ... -class _WritableFileobj(Protocol): - def write(self, __b: bytes) -> Any: ... - if sys.version_info >= (3, 8): @final class PickleBuffer: @@ -109,49 +106,49 @@ if sys.version_info >= (3, 8): _BufferCallback: TypeAlias = Callable[[PickleBuffer], Any] | None def dump( obj: Any, - file: _WritableFileobj, - protocol: int | None = ..., + file: SupportsWrite[bytes], + protocol: int | None = None, *, - fix_imports: bool = ..., - buffer_callback: _BufferCallback = ..., + fix_imports: bool = True, + buffer_callback: _BufferCallback = None, ) -> None: ... def dumps( - obj: Any, protocol: int | None = ..., *, fix_imports: bool = ..., buffer_callback: _BufferCallback = ... + obj: Any, protocol: int | None = None, *, fix_imports: bool = True, buffer_callback: _BufferCallback = None ) -> bytes: ... def load( file: _ReadableFileobj, *, - fix_imports: bool = ..., - encoding: str = ..., - errors: str = ..., + fix_imports: bool = True, + encoding: str = "ASCII", + errors: str = "strict", buffers: Iterable[Any] | None = ..., ) -> Any: ... def loads( __data: ReadableBuffer, *, - fix_imports: bool = ..., - encoding: str = ..., - errors: str = ..., + fix_imports: bool = True, + encoding: str = "ASCII", + errors: str = "strict", buffers: Iterable[Any] | None = ..., ) -> Any: ... else: - def dump(obj: Any, file: _WritableFileobj, protocol: int | None = ..., *, fix_imports: bool = ...) -> None: ... - def dumps(obj: Any, protocol: int | None = ..., *, fix_imports: bool = ...) -> bytes: ... - def load(file: _ReadableFileobj, *, fix_imports: bool = ..., encoding: str = ..., errors: str = ...) -> Any: ... - def loads(data: ReadableBuffer, *, fix_imports: bool = ..., encoding: str = ..., errors: str = ...) -> Any: ... + def dump(obj: Any, file: SupportsWrite[bytes], protocol: int | None = None, *, fix_imports: bool = True) -> None: ... + def dumps(obj: Any, protocol: int | None = None, *, fix_imports: bool = True) -> bytes: ... + def load(file: _ReadableFileobj, *, fix_imports: bool = True, encoding: str = "ASCII", errors: str = "strict") -> Any: ... + def loads(data: ReadableBuffer, *, fix_imports: bool = True, encoding: str = "ASCII", errors: str = "strict") -> Any: ... class PickleError(Exception): ... class PicklingError(PickleError): ... class UnpicklingError(PickleError): ... -_ReducedType: TypeAlias = Union[ - str, - tuple[Callable[..., Any], tuple[Any, ...]], - tuple[Callable[..., Any], tuple[Any, ...], Any], - tuple[Callable[..., Any], tuple[Any, ...], Any, Iterator[Any] | None], - tuple[Callable[..., Any], tuple[Any, ...], Any, Iterator[Any] | None, Iterator[Any] | None], -] +_ReducedType: TypeAlias = ( + str + | tuple[Callable[..., Any], tuple[Any, ...]] + | tuple[Callable[..., Any], tuple[Any, ...], Any] + | tuple[Callable[..., Any], tuple[Any, ...], Any, Iterator[Any] | None] + | tuple[Callable[..., Any], tuple[Any, ...], Any, Iterator[Any] | None, Iterator[Any] | None] +) class Pickler: fast: bool @@ -162,7 +159,7 @@ class Pickler: if sys.version_info >= (3, 8): def __init__( self, - file: _WritableFileobj, + file: SupportsWrite[bytes], protocol: int | None = ..., *, fix_imports: bool = ..., @@ -170,7 +167,7 @@ class Pickler: ) -> None: ... def reducer_override(self, obj: Any) -> Any: ... else: - def __init__(self, file: _WritableFileobj, protocol: int | None = ..., *, fix_imports: bool = ...) -> None: ... + def __init__(self, file: SupportsWrite[bytes], protocol: int | None = ..., *, fix_imports: bool = ...) -> None: ... def dump(self, __obj: Any) -> None: ... def clear_memo(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/pickletools.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/pickletools.pyi index c78848464..542172814 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/pickletools.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/pickletools.pyi @@ -40,7 +40,7 @@ def read_uint8(f: IO[bytes]) -> int: ... uint8: ArgumentDescriptor -def read_stringnl(f: IO[bytes], decode: bool = ..., stripquotes: bool = ...) -> bytes | str: ... +def read_stringnl(f: IO[bytes], decode: bool = True, stripquotes: bool = True) -> bytes | str: ... stringnl: ArgumentDescriptor @@ -156,12 +156,12 @@ class OpcodeInfo: opcodes: list[OpcodeInfo] -def genops(pickle: bytes | IO[bytes]) -> Iterator[tuple[OpcodeInfo, Any | None, int | None]]: ... -def optimize(p: bytes | IO[bytes]) -> bytes: ... +def genops(pickle: bytes | bytearray | IO[bytes]) -> Iterator[tuple[OpcodeInfo, Any | None, int | None]]: ... +def optimize(p: bytes | bytearray | IO[bytes]) -> bytes: ... def dis( - pickle: bytes | IO[bytes], - out: IO[str] | None = ..., - memo: MutableMapping[int, Any] | None = ..., - indentlevel: int = ..., - annotate: int = ..., + pickle: bytes | bytearray | IO[bytes], + out: IO[str] | None = None, + memo: MutableMapping[int, Any] | None = None, + indentlevel: int = 4, + annotate: int = 0, ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/pipes.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/pipes.pyi index d6bbd7eaf..fe680bfdd 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/pipes.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/pipes.pyi @@ -3,7 +3,6 @@ import os __all__ = ["Template"] class Template: - def __init__(self) -> None: ... def reset(self) -> None: ... def clone(self) -> Template: ... def debug(self, flag: bool) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/pkgutil.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/pkgutil.pyi index f91ab78ff..f9808c9e5 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/pkgutil.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/pkgutil.pyi @@ -29,7 +29,7 @@ class ModuleInfo(NamedTuple): def extend_path(path: _PathT, name: str) -> _PathT: ... class ImpImporter: - def __init__(self, path: str | None = ...) -> None: ... + def __init__(self, path: str | None = None) -> None: ... class ImpLoader: def __init__(self, fullname: str, file: IO[str], filename: str, etc: tuple[str, str, int]) -> None: ... @@ -37,11 +37,11 @@ class ImpLoader: def find_loader(fullname: str) -> Loader | None: ... def get_importer(path_item: str) -> PathEntryFinder | None: ... def get_loader(module_or_name: str) -> Loader | None: ... -def iter_importers(fullname: str = ...) -> Iterator[MetaPathFinder | PathEntryFinder]: ... -def iter_modules(path: Iterable[str] | None = ..., prefix: str = ...) -> Iterator[ModuleInfo]: ... +def iter_importers(fullname: str = "") -> Iterator[MetaPathFinder | PathEntryFinder]: ... +def iter_modules(path: Iterable[str] | None = None, prefix: str = "") -> Iterator[ModuleInfo]: ... def read_code(stream: SupportsRead[bytes]) -> Any: ... # undocumented def walk_packages( - path: Iterable[str] | None = ..., prefix: str = ..., onerror: Callable[[str], object] | None = ... + path: Iterable[str] | None = None, prefix: str = "", onerror: Callable[[str], object] | None = None ) -> Iterator[ModuleInfo]: ... def get_data(package: str, resource: str) -> bytes | None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/platform.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/platform.pyi index 765a7a5ea..291f302b4 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/platform.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/platform.pyi @@ -7,37 +7,39 @@ if sys.version_info < (3, 8): from typing import NamedTuple if sys.version_info >= (3, 8): - def libc_ver(executable: str | None = ..., lib: str = ..., version: str = ..., chunksize: int = ...) -> tuple[str, str]: ... + def libc_ver(executable: str | None = None, lib: str = "", version: str = "", chunksize: int = 16384) -> tuple[str, str]: ... else: - def libc_ver(executable: str = ..., lib: str = ..., version: str = ..., chunksize: int = ...) -> tuple[str, str]: ... + def libc_ver( + executable: str = sys.executable, lib: str = "", version: str = "", chunksize: int = 16384 + ) -> tuple[str, str]: ... if sys.version_info < (3, 8): def linux_distribution( - distname: str = ..., - version: str = ..., - id: str = ..., + distname: str = "", + version: str = "", + id: str = "", supported_dists: tuple[str, ...] = ..., full_distribution_name: bool = ..., ) -> tuple[str, str, str]: ... def dist( - distname: str = ..., version: str = ..., id: str = ..., supported_dists: tuple[str, ...] = ... + distname: str = "", version: str = "", id: str = "", supported_dists: tuple[str, ...] = ... ) -> tuple[str, str, str]: ... -def win32_ver(release: str = ..., version: str = ..., csd: str = ..., ptype: str = ...) -> tuple[str, str, str, str]: ... +def win32_ver(release: str = "", version: str = "", csd: str = "", ptype: str = "") -> tuple[str, str, str, str]: ... if sys.version_info >= (3, 8): def win32_edition() -> str: ... def win32_is_iot() -> bool: ... def mac_ver( - release: str = ..., versioninfo: tuple[str, str, str] = ..., machine: str = ... + release: str = "", versioninfo: tuple[str, str, str] = ..., machine: str = "" ) -> tuple[str, tuple[str, str, str], str]: ... def java_ver( - release: str = ..., vendor: str = ..., vminfo: tuple[str, str, str] = ..., osinfo: tuple[str, str, str] = ... + release: str = "", vendor: str = "", vminfo: tuple[str, str, str] = ..., osinfo: tuple[str, str, str] = ... ) -> tuple[str, str, tuple[str, str, str], tuple[str, str, str]]: ... def system_alias(system: str, release: str, version: str) -> tuple[str, str, str]: ... -def architecture(executable: str = ..., bits: str = ..., linkage: str = ...) -> tuple[str, str]: ... +def architecture(executable: str = sys.executable, bits: str = "", linkage: str = "") -> tuple[str, str]: ... class uname_result(NamedTuple): system: str diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/plistlib.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/plistlib.pyi index 9dcfcdb12..5b76c935f 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/plistlib.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/plistlib.pyi @@ -1,9 +1,10 @@ import sys -from _typeshed import Self +from _typeshed import ReadableBuffer from collections.abc import Mapping, MutableMapping from datetime import datetime from enum import Enum from typing import IO, Any +from typing_extensions import Self if sys.version_info >= (3, 9): __all__ = ["InvalidFileException", "FMT_XML", "FMT_BINARY", "load", "dump", "loads", "dumps", "UID"] @@ -47,45 +48,47 @@ FMT_XML = PlistFormat.FMT_XML FMT_BINARY = PlistFormat.FMT_BINARY if sys.version_info >= (3, 9): - def load(fp: IO[bytes], *, fmt: PlistFormat | None = ..., dict_type: type[MutableMapping[str, Any]] = ...) -> Any: ... - def loads(value: bytes, *, fmt: PlistFormat | None = ..., dict_type: type[MutableMapping[str, Any]] = ...) -> Any: ... + def load(fp: IO[bytes], *, fmt: PlistFormat | None = None, dict_type: type[MutableMapping[str, Any]] = ...) -> Any: ... + def loads( + value: ReadableBuffer, *, fmt: PlistFormat | None = None, dict_type: type[MutableMapping[str, Any]] = ... + ) -> Any: ... else: def load( fp: IO[bytes], *, - fmt: PlistFormat | None = ..., - use_builtin_types: bool = ..., + fmt: PlistFormat | None = None, + use_builtin_types: bool = True, dict_type: type[MutableMapping[str, Any]] = ..., ) -> Any: ... def loads( - value: bytes, + value: ReadableBuffer, *, - fmt: PlistFormat | None = ..., - use_builtin_types: bool = ..., + fmt: PlistFormat | None = None, + use_builtin_types: bool = True, dict_type: type[MutableMapping[str, Any]] = ..., ) -> Any: ... def dump( - value: Mapping[str, Any] | list[Any] | tuple[Any, ...] | str | bool | float | bytes | datetime, + value: Mapping[str, Any] | list[Any] | tuple[Any, ...] | str | bool | float | bytes | bytearray | datetime, fp: IO[bytes], *, fmt: PlistFormat = ..., - sort_keys: bool = ..., - skipkeys: bool = ..., + sort_keys: bool = True, + skipkeys: bool = False, ) -> None: ... def dumps( - value: Mapping[str, Any] | list[Any] | tuple[Any, ...] | str | bool | float | bytes | datetime, + value: Mapping[str, Any] | list[Any] | tuple[Any, ...] | str | bool | float | bytes | bytearray | datetime, *, fmt: PlistFormat = ..., - skipkeys: bool = ..., - sort_keys: bool = ..., + skipkeys: bool = False, + sort_keys: bool = True, ) -> bytes: ... if sys.version_info < (3, 9): def readPlist(pathOrFile: str | IO[bytes]) -> Any: ... def writePlist(value: Mapping[str, Any], pathOrFile: str | IO[bytes]) -> None: ... - def readPlistFromBytes(data: bytes) -> Any: ... + def readPlistFromBytes(data: ReadableBuffer) -> Any: ... def writePlistToBytes(value: Mapping[str, Any]) -> bytes: ... if sys.version_info < (3, 9): @@ -98,8 +101,8 @@ if sys.version_info >= (3, 8): data: int def __init__(self, data: int) -> None: ... def __index__(self) -> int: ... - def __reduce__(self: Self) -> tuple[type[Self], tuple[int]]: ... + def __reduce__(self) -> tuple[type[Self], tuple[int]]: ... def __eq__(self, other: object) -> bool: ... class InvalidFileException(ValueError): - def __init__(self, message: str = ...) -> None: ... + def __init__(self, message: str = "Invalid file") -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/poplib.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/poplib.pyi index fd7afedaa..c64e47e8e 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/poplib.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/poplib.pyi @@ -25,13 +25,13 @@ class POP3: sock: socket.socket file: BinaryIO welcome: bytes - def __init__(self, host: str, port: int = ..., timeout: float = ...) -> None: ... + def __init__(self, host: str, port: int = 110, timeout: float = ...) -> None: ... def getwelcome(self) -> bytes: ... def set_debuglevel(self, level: int) -> None: ... def user(self, user: str) -> bytes: ... def pass_(self, pswd: str) -> bytes: ... def stat(self) -> tuple[int, int]: ... - def list(self, which: Any | None = ...) -> _LongResp: ... + def list(self, which: Any | None = None) -> _LongResp: ... def retr(self, which: Any) -> _LongResp: ... def dele(self, which: Any) -> bytes: ... def noop(self) -> bytes: ... @@ -48,17 +48,17 @@ class POP3: def uidl(self, which: Any) -> bytes: ... def utf8(self) -> bytes: ... def capa(self) -> dict[str, _list[str]]: ... - def stls(self, context: ssl.SSLContext | None = ...) -> bytes: ... + def stls(self, context: ssl.SSLContext | None = None) -> bytes: ... class POP3_SSL(POP3): def __init__( self, host: str, - port: int = ..., - keyfile: str | None = ..., - certfile: str | None = ..., + port: int = 995, + keyfile: str | None = None, + certfile: str | None = None, timeout: float = ..., - context: ssl.SSLContext | None = ..., + context: ssl.SSLContext | None = None, ) -> None: ... # "context" is actually the last argument, but that breaks LSP and it doesn't really matter because all the arguments are ignored - def stls(self, context: Any = ..., keyfile: Any = ..., certfile: Any = ...) -> NoReturn: ... + def stls(self, context: Any = None, keyfile: Any = None, certfile: Any = None) -> NoReturn: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/posix.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/posix.pyi index 7055f15f3..ffd967575 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/posix.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/posix.pyi @@ -309,17 +309,10 @@ if sys.platform != "win32": copy_file_range as copy_file_range, memfd_create as memfd_create, ) - from os import register_at_fork as register_at_fork + from os import preadv as preadv, pwritev as pwritev, register_at_fork as register_at_fork if sys.platform != "darwin": - from os import ( - RWF_DSYNC as RWF_DSYNC, - RWF_HIPRI as RWF_HIPRI, - RWF_NOWAIT as RWF_NOWAIT, - RWF_SYNC as RWF_SYNC, - preadv as preadv, - pwritev as pwritev, - ) + from os import RWF_DSYNC as RWF_DSYNC, RWF_HIPRI as RWF_HIPRI, RWF_NOWAIT as RWF_NOWAIT, RWF_SYNC as RWF_SYNC # Not same as os.environ or os.environb # Because of this variable, we can't do "from posix import *" in os/__init__.pyi diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/posixpath.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/posixpath.pyi index 8d880a072..1945190be 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/posixpath.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/posixpath.pyi @@ -1,5 +1,5 @@ import sys -from _typeshed import AnyOrLiteralStr, BytesPath, StrOrBytesPath, StrPath +from _typeshed import AnyOrLiteralStr, BytesPath, FileDescriptorOrPath, StrOrBytesPath, StrPath from collections.abc import Sequence from genericpath import ( commonprefix as commonprefix, @@ -118,9 +118,9 @@ def join(__a: BytesPath, *paths: BytesPath) -> bytes: ... if sys.version_info >= (3, 10): @overload - def realpath(filename: PathLike[AnyStr], *, strict: bool = ...) -> AnyStr: ... + def realpath(filename: PathLike[AnyStr], *, strict: bool = False) -> AnyStr: ... @overload - def realpath(filename: AnyStr, *, strict: bool = ...) -> AnyStr: ... + def realpath(filename: AnyStr, *, strict: bool = False) -> AnyStr: ... else: @overload @@ -129,11 +129,11 @@ else: def realpath(filename: AnyStr) -> AnyStr: ... @overload -def relpath(path: LiteralString, start: LiteralString | None = ...) -> LiteralString: ... +def relpath(path: LiteralString, start: LiteralString | None = None) -> LiteralString: ... @overload -def relpath(path: BytesPath, start: BytesPath | None = ...) -> bytes: ... +def relpath(path: BytesPath, start: BytesPath | None = None) -> bytes: ... @overload -def relpath(path: StrPath, start: StrPath | None = ...) -> str: ... +def relpath(path: StrPath, start: StrPath | None = None) -> str: ... @overload def split(p: PathLike[AnyStr]) -> tuple[AnyStr, AnyStr]: ... @overload @@ -147,6 +147,6 @@ def splitext(p: PathLike[AnyStr]) -> tuple[AnyStr, AnyStr]: ... @overload def splitext(p: AnyOrLiteralStr) -> tuple[AnyOrLiteralStr, AnyOrLiteralStr]: ... def isabs(s: StrOrBytesPath) -> bool: ... -def islink(path: StrOrBytesPath | int) -> bool: ... -def ismount(path: StrOrBytesPath | int) -> bool: ... -def lexists(path: StrOrBytesPath | int) -> bool: ... +def islink(path: FileDescriptorOrPath) -> bool: ... +def ismount(path: FileDescriptorOrPath) -> bool: ... +def lexists(path: FileDescriptorOrPath) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/pprint.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/pprint.pyi index 0addc8f53..5a909c69b 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/pprint.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/pprint.pyi @@ -9,28 +9,28 @@ else: if sys.version_info >= (3, 10): def pformat( object: object, - indent: int = ..., - width: int = ..., - depth: int | None = ..., + indent: int = 1, + width: int = 80, + depth: int | None = None, *, - compact: bool = ..., - sort_dicts: bool = ..., - underscore_numbers: bool = ..., + compact: bool = False, + sort_dicts: bool = True, + underscore_numbers: bool = False, ) -> str: ... elif sys.version_info >= (3, 8): def pformat( object: object, - indent: int = ..., - width: int = ..., - depth: int | None = ..., + indent: int = 1, + width: int = 80, + depth: int | None = None, *, - compact: bool = ..., - sort_dicts: bool = ..., + compact: bool = False, + sort_dicts: bool = True, ) -> str: ... else: - def pformat(object: object, indent: int = ..., width: int = ..., depth: int | None = ..., *, compact: bool = ...) -> str: ... + def pformat(object: object, indent: int = 1, width: int = 80, depth: int | None = None, *, compact: bool = False) -> str: ... if sys.version_info >= (3, 10): def pp( @@ -41,7 +41,7 @@ if sys.version_info >= (3, 10): depth: int | None = ..., *, compact: bool = ..., - sort_dicts: bool = ..., + sort_dicts: bool = False, underscore_numbers: bool = ..., ) -> None: ... @@ -54,43 +54,43 @@ elif sys.version_info >= (3, 8): depth: int | None = ..., *, compact: bool = ..., - sort_dicts: bool = ..., + sort_dicts: bool = False, ) -> None: ... if sys.version_info >= (3, 10): def pprint( object: object, - stream: IO[str] | None = ..., - indent: int = ..., - width: int = ..., - depth: int | None = ..., + stream: IO[str] | None = None, + indent: int = 1, + width: int = 80, + depth: int | None = None, *, - compact: bool = ..., - sort_dicts: bool = ..., - underscore_numbers: bool = ..., + compact: bool = False, + sort_dicts: bool = True, + underscore_numbers: bool = False, ) -> None: ... elif sys.version_info >= (3, 8): def pprint( object: object, - stream: IO[str] | None = ..., - indent: int = ..., - width: int = ..., - depth: int | None = ..., + stream: IO[str] | None = None, + indent: int = 1, + width: int = 80, + depth: int | None = None, *, - compact: bool = ..., - sort_dicts: bool = ..., + compact: bool = False, + sort_dicts: bool = True, ) -> None: ... else: def pprint( object: object, - stream: IO[str] | None = ..., - indent: int = ..., - width: int = ..., - depth: int | None = ..., + stream: IO[str] | None = None, + indent: int = 1, + width: int = 80, + depth: int | None = None, *, - compact: bool = ..., + compact: bool = False, ) -> None: ... def isreadable(object: object) -> bool: ... @@ -101,35 +101,35 @@ class PrettyPrinter: if sys.version_info >= (3, 10): def __init__( self, - indent: int = ..., - width: int = ..., - depth: int | None = ..., - stream: IO[str] | None = ..., + indent: int = 1, + width: int = 80, + depth: int | None = None, + stream: IO[str] | None = None, *, - compact: bool = ..., - sort_dicts: bool = ..., - underscore_numbers: bool = ..., + compact: bool = False, + sort_dicts: bool = True, + underscore_numbers: bool = False, ) -> None: ... elif sys.version_info >= (3, 8): def __init__( self, - indent: int = ..., - width: int = ..., - depth: int | None = ..., - stream: IO[str] | None = ..., + indent: int = 1, + width: int = 80, + depth: int | None = None, + stream: IO[str] | None = None, *, - compact: bool = ..., - sort_dicts: bool = ..., + compact: bool = False, + sort_dicts: bool = True, ) -> None: ... else: def __init__( self, - indent: int = ..., - width: int = ..., - depth: int | None = ..., - stream: IO[str] | None = ..., + indent: int = 1, + width: int = 80, + depth: int | None = None, + stream: IO[str] | None = None, *, - compact: bool = ..., + compact: bool = False, ) -> None: ... def pformat(self, object: object) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/profile.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/profile.pyi index 4b3f832d3..6ae375004 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/profile.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/profile.pyi @@ -1,13 +1,13 @@ -from _typeshed import Self, StrOrBytesPath +from _typeshed import StrOrBytesPath from collections.abc import Callable from typing import Any, TypeVar -from typing_extensions import ParamSpec, TypeAlias +from typing_extensions import ParamSpec, Self, TypeAlias __all__ = ["run", "runctx", "Profile"] -def run(statement: str, filename: str | None = ..., sort: str | int = ...) -> None: ... +def run(statement: str, filename: str | None = None, sort: str | int = -1) -> None: ... def runctx( - statement: str, globals: dict[str, Any], locals: dict[str, Any], filename: str | None = ..., sort: str | int = ... + statement: str, globals: dict[str, Any], locals: dict[str, Any], filename: str | None = None, sort: str | int = -1 ) -> None: ... _T = TypeVar("_T") @@ -17,15 +17,15 @@ _Label: TypeAlias = tuple[str, int, str] class Profile: bias: int stats: dict[_Label, tuple[int, int, int, int, dict[_Label, tuple[int, int, int, int]]]] # undocumented - def __init__(self, timer: Callable[[], float] | None = ..., bias: int | None = ...) -> None: ... + def __init__(self, timer: Callable[[], float] | None = None, bias: int | None = None) -> None: ... def set_cmd(self, cmd: str) -> None: ... def simulate_call(self, name: str) -> None: ... def simulate_cmd_complete(self) -> None: ... - def print_stats(self, sort: str | int = ...) -> None: ... + def print_stats(self, sort: str | int = -1) -> None: ... def dump_stats(self, file: StrOrBytesPath) -> None: ... def create_stats(self) -> None: ... def snapshot_stats(self) -> None: ... - def run(self: Self, cmd: str) -> Self: ... - def runctx(self: Self, cmd: str, globals: dict[str, Any], locals: dict[str, Any]) -> Self: ... + def run(self, cmd: str) -> Self: ... + def runctx(self, cmd: str, globals: dict[str, Any], locals: dict[str, Any]) -> Self: ... def runcall(self, __func: Callable[_P, _T], *args: _P.args, **kw: _P.kwargs) -> _T: ... - def calibrate(self, m: int, verbose: int = ...) -> float: ... + def calibrate(self, m: int, verbose: int = 0) -> float: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/pstats.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/pstats.pyi index 7629cd634..5d25d1bb3 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/pstats.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/pstats.pyi @@ -1,11 +1,11 @@ import sys -from _typeshed import Self, StrOrBytesPath +from _typeshed import StrOrBytesPath from collections.abc import Iterable from cProfile import Profile as _cProfile from enum import Enum from profile import Profile from typing import IO, Any, overload -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal, Self, TypeAlias if sys.version_info >= (3, 9): __all__ = ["Stats", "SortKey", "FunctionProfile", "StatsProfile"] @@ -30,7 +30,7 @@ if sys.version_info >= (3, 9): @dataclass(unsafe_hash=True) class FunctionProfile: - ncalls: int + ncalls: str tottime: float percall_tottime: float cumtime: float @@ -47,33 +47,33 @@ _SortArgDict: TypeAlias = dict[str, tuple[tuple[tuple[int, int], ...], str]] class Stats: sort_arg_dict_default: _SortArgDict def __init__( - self: Self, + self, __arg: None | str | Profile | _cProfile = ..., *args: None | str | Profile | _cProfile | Self, - stream: IO[Any] | None = ..., + stream: IO[Any] | None = None, ) -> None: ... def init(self, arg: None | str | Profile | _cProfile) -> None: ... def load_stats(self, arg: None | str | Profile | _cProfile) -> None: ... def get_top_level_stats(self) -> None: ... - def add(self: Self, *arg_list: None | str | Profile | _cProfile | Self) -> Self: ... + def add(self, *arg_list: None | str | Profile | _cProfile | Self) -> Self: ... def dump_stats(self, filename: StrOrBytesPath) -> None: ... def get_sort_arg_defs(self) -> _SortArgDict: ... @overload - def sort_stats(self: Self, field: Literal[-1, 0, 1, 2]) -> Self: ... + def sort_stats(self, field: Literal[-1, 0, 1, 2]) -> Self: ... @overload - def sort_stats(self: Self, *field: str) -> Self: ... - def reverse_order(self: Self) -> Self: ... - def strip_dirs(self: Self) -> Self: ... + def sort_stats(self, *field: str) -> Self: ... + def reverse_order(self) -> Self: ... + def strip_dirs(self) -> Self: ... def calc_callees(self) -> None: ... def eval_print_amount(self, sel: _Selector, list: list[str], msg: str) -> tuple[list[str], str]: ... if sys.version_info >= (3, 9): def get_stats_profile(self) -> StatsProfile: ... def get_print_list(self, sel_list: Iterable[_Selector]) -> tuple[int, list[str]]: ... - def print_stats(self: Self, *amount: _Selector) -> Self: ... - def print_callees(self: Self, *amount: _Selector) -> Self: ... - def print_callers(self: Self, *amount: _Selector) -> Self: ... + def print_stats(self, *amount: _Selector) -> Self: ... + def print_callees(self, *amount: _Selector) -> Self: ... + def print_callers(self, *amount: _Selector) -> Self: ... def print_call_heading(self, name_size: int, column_title: str) -> None: ... - def print_call_line(self, name_size: int, source: str, call_dict: dict[str, Any], arrow: str = ...) -> None: ... + def print_call_line(self, name_size: int, source: str, call_dict: dict[str, Any], arrow: str = "->") -> None: ... def print_title(self) -> None: ... def print_line(self, func: str) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/py_compile.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/py_compile.pyi index 1e9b6c2cb..48f1d7dc3 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/py_compile.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/py_compile.pyi @@ -9,7 +9,7 @@ class PyCompileError(Exception): exc_value: BaseException file: str msg: str - def __init__(self, exc_type: type[BaseException], exc_value: BaseException, file: str, msg: str = ...) -> None: ... + def __init__(self, exc_type: type[BaseException], exc_value: BaseException, file: str, msg: str = "") -> None: ... class PycInvalidationMode(enum.Enum): TIMESTAMP: int @@ -21,26 +21,26 @@ def _get_default_invalidation_mode() -> PycInvalidationMode: ... if sys.version_info >= (3, 8): def compile( file: AnyStr, - cfile: AnyStr | None = ..., - dfile: AnyStr | None = ..., - doraise: bool = ..., - optimize: int = ..., - invalidation_mode: PycInvalidationMode | None = ..., - quiet: int = ..., + cfile: AnyStr | None = None, + dfile: AnyStr | None = None, + doraise: bool = False, + optimize: int = -1, + invalidation_mode: PycInvalidationMode | None = None, + quiet: int = 0, ) -> AnyStr | None: ... else: def compile( file: AnyStr, - cfile: AnyStr | None = ..., - dfile: AnyStr | None = ..., - doraise: bool = ..., - optimize: int = ..., - invalidation_mode: PycInvalidationMode | None = ..., + cfile: AnyStr | None = None, + dfile: AnyStr | None = None, + doraise: bool = False, + optimize: int = -1, + invalidation_mode: PycInvalidationMode | None = None, ) -> AnyStr | None: ... if sys.version_info >= (3, 10): def main() -> None: ... else: - def main(args: list[str] | None = ...) -> int: ... + def main(args: list[str] | None = None) -> int: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/pyclbr.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/pyclbr.pyi index ab19b44d7..38658a031 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/pyclbr.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/pyclbr.pyi @@ -25,13 +25,13 @@ class Class: super_: list[Class | str] | None, file: str, lineno: int, - parent: Class | None = ..., + parent: Class | None = None, *, - end_lineno: int | None = ..., + end_lineno: int | None = None, ) -> None: ... else: def __init__( - self, module: str, name: str, super: list[Class | str] | None, file: str, lineno: int, parent: Class | None = ... + self, module: str, name: str, super: list[Class | str] | None, file: str, lineno: int, parent: Class | None = None ) -> None: ... class Function: @@ -54,13 +54,13 @@ class Function: name: str, file: str, lineno: int, - parent: Function | Class | None = ..., - is_async: bool = ..., + parent: Function | Class | None = None, + is_async: bool = False, *, - end_lineno: int | None = ..., + end_lineno: int | None = None, ) -> None: ... else: - def __init__(self, module: str, name: str, file: str, lineno: int, parent: Function | Class | None = ...) -> None: ... + def __init__(self, module: str, name: str, file: str, lineno: int, parent: Function | Class | None = None) -> None: ... -def readmodule(module: str, path: Sequence[str] | None = ...) -> dict[str, Class]: ... -def readmodule_ex(module: str, path: Sequence[str] | None = ...) -> dict[str, Class | Function | list[str]]: ... +def readmodule(module: str, path: Sequence[str] | None = None) -> dict[str, Class]: ... +def readmodule_ex(module: str, path: Sequence[str] | None = None) -> dict[str, Class | Function | list[str]]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/pydoc.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/pydoc.pyi index abcffc311..f09976ad3 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/pydoc.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/pydoc.pyi @@ -6,15 +6,16 @@ from collections.abc import Callable, Container, Mapping, MutableMapping from reprlib import Repr from types import MethodType, ModuleType, TracebackType from typing import IO, Any, AnyStr, NoReturn, TypeVar +from typing_extensions import Final, TypeGuard __all__ = ["help"] _T = TypeVar("_T") -__author__: str -__date__: str -__version__: str -__credits__: str +__author__: Final[str] +__date__: Final[str] +__version__: Final[str] +__credits__: Final[str] def pathdirs() -> list[str]: ... def getdoc(object: object) -> str: ... @@ -25,7 +26,7 @@ def replace(text: AnyStr, *pairs: AnyStr) -> AnyStr: ... def cram(text: str, maxlen: int) -> str: ... def stripid(text: str) -> str: ... def allmethods(cl: type) -> MutableMapping[str, MethodType]: ... -def visiblename(name: str, all: Container[str] | None = ..., obj: object | None = ...) -> bool: ... +def visiblename(name: str, all: Container[str] | None = None, obj: object = None) -> bool: ... def classify_class_attrs(object: object) -> list[tuple[str, str, type, str]]: ... def ispackage(path: str) -> bool: ... def source_synopsis(file: IO[AnyStr]) -> AnyStr | None: ... @@ -39,33 +40,27 @@ class ErrorDuringImport(Exception): def __init__(self, filename: str, exc_info: OptExcInfo) -> None: ... def importfile(path: str) -> ModuleType: ... -def safeimport(path: str, forceload: bool = ..., cache: MutableMapping[str, ModuleType] = ...) -> ModuleType: ... +def safeimport(path: str, forceload: bool = ..., cache: MutableMapping[str, ModuleType] = ...) -> ModuleType | None: ... class Doc: PYTHONDOCS: str - def document(self, object: object, name: str | None = ..., *args: Any) -> str: ... - def fail(self, object: object, name: str | None = ..., *args: Any) -> NoReturn: ... + def document(self, object: object, name: str | None = None, *args: Any) -> str: ... + def fail(self, object: object, name: str | None = None, *args: Any) -> NoReturn: ... @abstractmethod - def docmodule(self, object: object, name: str | None = ..., *args: Any) -> str: ... + def docmodule(self, object: object, name: str | None = None, *args: Any) -> str: ... @abstractmethod - def docclass(self, object: object, name: str | None = ..., *args: Any) -> str: ... + def docclass(self, object: object, name: str | None = None, *args: Any) -> str: ... @abstractmethod - def docroutine(self, object: object, name: str | None = ..., *args: Any) -> str: ... + def docroutine(self, object: object, name: str | None = None, *args: Any) -> str: ... @abstractmethod - def docother(self, object: object, name: str | None = ..., *args: Any) -> str: ... + def docother(self, object: object, name: str | None = None, *args: Any) -> str: ... @abstractmethod - def docproperty(self, object: object, name: str | None = ..., *args: Any) -> str: ... + def docproperty(self, object: object, name: str | None = None, *args: Any) -> str: ... @abstractmethod - def docdata(self, object: object, name: str | None = ..., *args: Any) -> str: ... + def docdata(self, object: object, name: str | None = None, *args: Any) -> str: ... def getdocloc(self, object: object, basedir: str = ...) -> str | None: ... class HTMLRepr(Repr): - maxlist: int - maxtuple: int - maxdict: int - maxstring: int - maxother: int - def __init__(self) -> None: ... def escape(self, text: str) -> str: ... def repr(self, object: object) -> str: ... def repr1(self, x: object, level: complex) -> str: ... @@ -80,32 +75,32 @@ class HTMLDoc(Doc): escape = _repr_instance.escape def page(self, title: str, contents: str) -> str: ... if sys.version_info >= (3, 11): - def heading(self, title: str, extras: str = ...) -> str: ... + def heading(self, title: str, extras: str = "") -> str: ... def section( self, title: str, cls: str, contents: str, - width: int = ..., - prelude: str = ..., - marginalia: str | None = ..., - gap: str = ..., + width: int = 6, + prelude: str = "", + marginalia: str | None = None, + gap: str = " ", ) -> str: ... def multicolumn(self, list: list[_T], format: Callable[[_T], str]) -> str: ... else: - def heading(self, title: str, fgcol: str, bgcol: str, extras: str = ...) -> str: ... + def heading(self, title: str, fgcol: str, bgcol: str, extras: str = "") -> str: ... def section( self, title: str, fgcol: str, bgcol: str, contents: str, - width: int = ..., - prelude: str = ..., - marginalia: str | None = ..., - gap: str = ..., + width: int = 6, + prelude: str = "", + marginalia: str | None = None, + gap: str = " ", ) -> str: ... - def multicolumn(self, list: list[_T], format: Callable[[_T], str], cols: int = ...) -> str: ... + def multicolumn(self, list: list[_T], format: Callable[[_T], str], cols: int = 4) -> str: ... def bigsection(self, title: str, *args: Any) -> str: ... def preformat(self, text: str) -> str: ... @@ -117,20 +112,20 @@ class HTMLDoc(Doc): def markup( self, text: str, - escape: Callable[[str], str] | None = ..., + escape: Callable[[str], str] | None = None, funcs: Mapping[str, str] = ..., classes: Mapping[str, str] = ..., methods: Mapping[str, str] = ..., ) -> str: ... def formattree( - self, tree: list[tuple[type, tuple[type, ...]] | list[Any]], modname: str, parent: type | None = ... + self, tree: list[tuple[type, tuple[type, ...]] | list[Any]], modname: str, parent: type | None = None ) -> str: ... - def docmodule(self, object: object, name: str | None = ..., mod: str | None = ..., *ignored: Any) -> str: ... + def docmodule(self, object: object, name: str | None = None, mod: str | None = None, *ignored: Any) -> str: ... def docclass( self, object: object, - name: str | None = ..., - mod: str | None = ..., + name: str | None = None, + mod: str | None = None, funcs: Mapping[str, str] = ..., classes: Mapping[str, str] = ..., *ignored: Any, @@ -139,26 +134,20 @@ class HTMLDoc(Doc): def docroutine( # type: ignore[override] self, object: object, - name: str | None = ..., - mod: str | None = ..., + name: str | None = None, + mod: str | None = None, funcs: Mapping[str, str] = ..., classes: Mapping[str, str] = ..., methods: Mapping[str, str] = ..., - cl: type | None = ..., + cl: type | None = None, ) -> str: ... - def docproperty(self, object: object, name: str | None = ..., mod: str | None = ..., cl: Any | None = ...) -> str: ... # type: ignore[override] - def docother(self, object: object, name: str | None = ..., mod: Any | None = ..., *ignored: Any) -> str: ... - def docdata(self, object: object, name: str | None = ..., mod: Any | None = ..., cl: Any | None = ...) -> str: ... # type: ignore[override] - def index(self, dir: str, shadowed: MutableMapping[str, bool] | None = ...) -> str: ... + def docproperty(self, object: object, name: str | None = None, mod: str | None = None, cl: Any | None = None) -> str: ... # type: ignore[override] + def docother(self, object: object, name: str | None = None, mod: Any | None = None, *ignored: Any) -> str: ... + def docdata(self, object: object, name: str | None = None, mod: Any | None = None, cl: Any | None = None) -> str: ... # type: ignore[override] + def index(self, dir: str, shadowed: MutableMapping[str, bool] | None = None) -> str: ... def filelink(self, url: str, path: str) -> str: ... class TextRepr(Repr): - maxlist: int - maxtuple: int - maxdict: int - maxstring: int - maxother: int - def __init__(self) -> None: ... def repr1(self, x: object, level: complex) -> str: ... def repr_string(self, x: str, level: complex) -> str: ... def repr_str(self, x: str, level: complex) -> str: ... @@ -168,25 +157,25 @@ class TextDoc(Doc): _repr_instance: TextRepr = ... repr = _repr_instance.repr def bold(self, text: str) -> str: ... - def indent(self, text: str, prefix: str = ...) -> str: ... + def indent(self, text: str, prefix: str = " ") -> str: ... def section(self, title: str, contents: str) -> str: ... def formattree( - self, tree: list[tuple[type, tuple[type, ...]] | list[Any]], modname: str, parent: type | None = ..., prefix: str = ... + self, tree: list[tuple[type, tuple[type, ...]] | list[Any]], modname: str, parent: type | None = None, prefix: str = "" ) -> str: ... - def docmodule(self, object: object, name: str | None = ..., mod: Any | None = ...) -> str: ... # type: ignore[override] - def docclass(self, object: object, name: str | None = ..., mod: str | None = ..., *ignored: Any) -> str: ... + def docmodule(self, object: object, name: str | None = None, mod: Any | None = None) -> str: ... # type: ignore[override] + def docclass(self, object: object, name: str | None = None, mod: str | None = None, *ignored: Any) -> str: ... def formatvalue(self, object: object) -> str: ... - def docroutine(self, object: object, name: str | None = ..., mod: str | None = ..., cl: Any | None = ...) -> str: ... # type: ignore[override] - def docproperty(self, object: object, name: str | None = ..., mod: Any | None = ..., cl: Any | None = ...) -> str: ... # type: ignore[override] - def docdata(self, object: object, name: str | None = ..., mod: str | None = ..., cl: Any | None = ...) -> str: ... # type: ignore[override] + def docroutine(self, object: object, name: str | None = None, mod: str | None = None, cl: Any | None = None) -> str: ... # type: ignore[override] + def docproperty(self, object: object, name: str | None = None, mod: Any | None = None, cl: Any | None = None) -> str: ... # type: ignore[override] + def docdata(self, object: object, name: str | None = None, mod: str | None = None, cl: Any | None = None) -> str: ... # type: ignore[override] def docother( # type: ignore[override] self, object: object, - name: str | None = ..., - mod: str | None = ..., - parent: str | None = ..., - maxlen: int | None = ..., - doc: Any | None = ..., + name: str | None = None, + mod: str | None = None, + parent: str | None = None, + maxlen: int | None = None, + doc: Any | None = None, ) -> str: ... def pager(text: str) -> None: ... @@ -203,16 +192,23 @@ text: TextDoc html: HTMLDoc def resolve(thing: str | object, forceload: bool = ...) -> tuple[object, str] | None: ... -def render_doc(thing: str | object, title: str = ..., forceload: bool = ..., renderer: Doc | None = ...) -> str: ... -def doc(thing: str | object, title: str = ..., forceload: bool = ..., output: SupportsWrite[str] | None = ...) -> None: ... +def render_doc( + thing: str | object, title: str = "Python Library Documentation: %s", forceload: bool = ..., renderer: Doc | None = None +) -> str: ... +def doc( + thing: str | object, + title: str = "Python Library Documentation: %s", + forceload: bool = ..., + output: SupportsWrite[str] | None = None, +) -> None: ... def writedoc(thing: str | object, forceload: bool = ...) -> None: ... -def writedocs(dir: str, pkgpath: str = ..., done: Any | None = ...) -> None: ... +def writedocs(dir: str, pkgpath: str = "", done: Any | None = None) -> None: ... class Helper: keywords: dict[str, str | tuple[str, str]] symbols: dict[str, str] topics: dict[str, str | tuple[str, ...]] - def __init__(self, input: IO[str] | None = ..., output: IO[str] | None = ...) -> None: ... + def __init__(self, input: IO[str] | None = None, output: IO[str] | None = None) -> None: ... @property def input(self) -> IO[str]: ... @property @@ -222,13 +218,13 @@ class Helper: def getline(self, prompt: str) -> str: ... def help(self, request: Any) -> None: ... def intro(self) -> None: ... - def list(self, items: _list[str], columns: int = ..., width: int = ...) -> None: ... + def list(self, items: _list[str], columns: int = 4, width: int = 80) -> None: ... def listkeywords(self) -> None: ... def listsymbols(self) -> None: ... def listtopics(self) -> None: ... - def showtopic(self, topic: str, more_xrefs: str = ...) -> None: ... + def showtopic(self, topic: str, more_xrefs: str = "") -> None: ... def showsymbol(self, symbol: str) -> None: ... - def listmodules(self, key: str = ...) -> None: ... + def listmodules(self, key: str = "") -> None: ... help: Helper @@ -237,11 +233,11 @@ class ModuleScanner: def run( self, callback: Callable[[str | None, str, str], object], - key: str | None = ..., - completer: Callable[[], object] | None = ..., - onerror: Callable[[str], object] | None = ..., + key: str | None = None, + completer: Callable[[], object] | None = None, + onerror: Callable[[str], object] | None = None, ) -> None: ... def apropos(key: str) -> None: ... -def ispath(x: Any) -> bool: ... +def ispath(x: object) -> TypeGuard[str]: ... def cli() -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/pyexpat/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/pyexpat/__init__.pyi index 6a4ed891f..9e1eea08b 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/pyexpat/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/pyexpat/__init__.pyi @@ -1,7 +1,6 @@ -import pyexpat.errors as errors -import pyexpat.model as model -from _typeshed import SupportsRead +from _typeshed import ReadableBuffer, SupportsRead from collections.abc import Callable +from pyexpat import errors as errors, model as model from typing import Any from typing_extensions import TypeAlias, final @@ -25,14 +24,14 @@ _Model: TypeAlias = tuple[int, int, str | None, tuple[Any, ...]] @final class XMLParserType: - def Parse(self, __data: str | bytes, __isfinal: bool = ...) -> int: ... + def Parse(self, __data: str | ReadableBuffer, __isfinal: bool = False) -> int: ... def ParseFile(self, __file: SupportsRead[bytes]) -> int: ... def SetBase(self, __base: str) -> None: ... def GetBase(self) -> str | None: ... def GetInputContext(self) -> bytes | None: ... def ExternalEntityParserCreate(self, __context: str | None, __encoding: str = ...) -> XMLParserType: ... def SetParamEntityParsing(self, __flag: int) -> int: ... - def UseForeignDTD(self, __flag: bool = ...) -> None: ... + def UseForeignDTD(self, __flag: bool = True) -> None: ... @property def intern(self) -> dict[str, str]: ... buffer_size: int @@ -77,5 +76,5 @@ def ErrorString(__code: int) -> str: ... # intern is undocumented def ParserCreate( - encoding: str | None = ..., namespace_separator: str | None = ..., intern: dict[str, Any] | None = ... + encoding: str | None = None, namespace_separator: str | None = None, intern: dict[str, Any] | None = None ) -> XMLParserType: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/queue.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/queue.pyi index 7ea4beb66..3537e445e 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/queue.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/queue.pyi @@ -23,14 +23,14 @@ class Queue(Generic[_T]): # Despite the fact that `queue` has `deque` type, # we treat it as `Any` to allow different implementations in subtypes. queue: Any # undocumented - def __init__(self, maxsize: int = ...) -> None: ... + def __init__(self, maxsize: int = 0) -> None: ... def _init(self, maxsize: int) -> None: ... def empty(self) -> bool: ... def full(self) -> bool: ... - def get(self, block: bool = ..., timeout: float | None = ...) -> _T: ... + def get(self, block: bool = True, timeout: float | None = None) -> _T: ... def get_nowait(self) -> _T: ... def _get(self) -> _T: ... - def put(self, item: _T, block: bool = ..., timeout: float | None = ...) -> None: ... + def put(self, item: _T, block: bool = True, timeout: float | None = None) -> None: ... def put_nowait(self, item: _T) -> None: ... def _put(self, item: _T) -> None: ... def join(self) -> None: ... @@ -49,9 +49,9 @@ class LifoQueue(Queue[_T]): class SimpleQueue(Generic[_T]): def __init__(self) -> None: ... def empty(self) -> bool: ... - def get(self, block: bool = ..., timeout: float | None = ...) -> _T: ... + def get(self, block: bool = True, timeout: float | None = None) -> _T: ... def get_nowait(self) -> _T: ... - def put(self, item: _T, block: bool = ..., timeout: float | None = ...) -> None: ... + def put(self, item: _T, block: bool = True, timeout: float | None = None) -> None: ... def put_nowait(self, item: _T) -> None: ... def qsize(self) -> int: ... if sys.version_info >= (3, 9): diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/quopri.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/quopri.pyi index b8dc0787f..b652e139b 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/quopri.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/quopri.pyi @@ -1,8 +1,11 @@ -from typing import BinaryIO +from _typeshed import ReadableBuffer, SupportsNoArgReadline, SupportsRead, SupportsWrite +from typing import Protocol __all__ = ["encode", "decode", "encodestring", "decodestring"] -def encode(input: BinaryIO, output: BinaryIO, quotetabs: int, header: int = ...) -> None: ... -def encodestring(s: bytes, quotetabs: int = ..., header: int = ...) -> bytes: ... -def decode(input: BinaryIO, output: BinaryIO, header: int = ...) -> None: ... -def decodestring(s: bytes, header: int = ...) -> bytes: ... +class _Input(SupportsRead[bytes], SupportsNoArgReadline[bytes], Protocol): ... + +def encode(input: _Input, output: SupportsWrite[bytes], quotetabs: int, header: bool = False) -> None: ... +def encodestring(s: ReadableBuffer, quotetabs: bool = False, header: bool = False) -> bytes: ... +def decode(input: _Input, output: SupportsWrite[bytes], header: bool = False) -> None: ... +def decodestring(s: str | ReadableBuffer, header: bool = False) -> bytes: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/random.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/random.pyi index 3bb999bfa..484987869 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/random.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/random.pyi @@ -39,19 +39,18 @@ _T = TypeVar("_T") class Random(_random.Random): VERSION: ClassVar[int] - def __init__(self, x: Any = ...) -> None: ... + def __init__(self, x: Any = None) -> None: ... # Using other `seed` types is deprecated since 3.9 and removed in 3.11 # Ignore Y041, since random.seed doesn't treat int like a float subtype. Having an explicit # int better documents conventional usage of random.seed. if sys.version_info >= (3, 9): - def seed(self, a: int | float | str | bytes | bytearray | None = ..., version: int = ...) -> None: ... # type: ignore[override] # noqa: Y041 + def seed(self, a: int | float | str | bytes | bytearray | None = None, version: int = 2) -> None: ... # type: ignore[override] # noqa: Y041 else: - def seed(self, a: Any = ..., version: int = ...) -> None: ... + def seed(self, a: Any = None, version: int = 2) -> None: ... def getstate(self) -> tuple[Any, ...]: ... def setstate(self, state: tuple[Any, ...]) -> None: ... - def getrandbits(self, __k: int) -> int: ... - def randrange(self, start: int, stop: int | None = ..., step: int = ...) -> int: ... + def randrange(self, start: int, stop: int | None = None, step: int = 1) -> int: ... def randint(self, a: int, b: int) -> int: ... if sys.version_info >= (3, 9): def randbytes(self, n: int) -> bytes: ... @@ -60,33 +59,32 @@ class Random(_random.Random): def choices( self, population: SupportsLenAndGetItem[_T], - weights: Sequence[float | Fraction] | None = ..., + weights: Sequence[float | Fraction] | None = None, *, - cum_weights: Sequence[float | Fraction] | None = ..., - k: int = ..., + cum_weights: Sequence[float | Fraction] | None = None, + k: int = 1, ) -> list[_T]: ... if sys.version_info >= (3, 11): def shuffle(self, x: MutableSequence[Any]) -> None: ... else: - def shuffle(self, x: MutableSequence[Any], random: Callable[[], float] | None = ...) -> None: ... + def shuffle(self, x: MutableSequence[Any], random: Callable[[], float] | None = None) -> None: ... if sys.version_info >= (3, 11): - def sample(self, population: Sequence[_T], k: int, *, counts: Iterable[int] | None = ...) -> list[_T]: ... + def sample(self, population: Sequence[_T], k: int, *, counts: Iterable[int] | None = None) -> list[_T]: ... elif sys.version_info >= (3, 9): def sample( - self, population: Sequence[_T] | AbstractSet[_T], k: int, *, counts: Iterable[int] | None = ... + self, population: Sequence[_T] | AbstractSet[_T], k: int, *, counts: Iterable[int] | None = None ) -> list[_T]: ... else: def sample(self, population: Sequence[_T] | AbstractSet[_T], k: int) -> list[_T]: ... - def random(self) -> float: ... def uniform(self, a: float, b: float) -> float: ... - def triangular(self, low: float = ..., high: float = ..., mode: float | None = ...) -> float: ... + def triangular(self, low: float = 0.0, high: float = 1.0, mode: float | None = None) -> float: ... def betavariate(self, alpha: float, beta: float) -> float: ... def expovariate(self, lambd: float) -> float: ... def gammavariate(self, alpha: float, beta: float) -> float: ... if sys.version_info >= (3, 11): - def gauss(self, mu: float = ..., sigma: float = ...) -> float: ... - def normalvariate(self, mu: float = ..., sigma: float = ...) -> float: ... + def gauss(self, mu: float = 0.0, sigma: float = 1.0) -> float: ... + def normalvariate(self, mu: float = 0.0, sigma: float = 1.0) -> float: ... else: def gauss(self, mu: float, sigma: float) -> float: ... def normalvariate(self, mu: float, sigma: float) -> float: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/re.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/re.pyi index 3e52d209e..4e53141ad 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/re.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/re.pyi @@ -67,10 +67,12 @@ class Match(Generic[AnyStr]): @overload def expand(self: Match[str], template: str) -> str: ... @overload - def expand(self: Match[bytes], template: ReadableBuffer) -> bytes: ... + def expand(self: Match[bytes], template: ReadableBuffer) -> bytes: ... # type: ignore[misc] + @overload + def expand(self, template: AnyStr) -> AnyStr: ... # group() returns "AnyStr" or "AnyStr | None", depending on the pattern. @overload - def group(self, __group: Literal[0] = ...) -> AnyStr: ... + def group(self, __group: Literal[0] = 0) -> AnyStr: ... @overload def group(self, __group: str | int) -> AnyStr | Any: ... @overload @@ -87,9 +89,9 @@ class Match(Generic[AnyStr]): def groupdict(self) -> dict[str, AnyStr | Any]: ... @overload def groupdict(self, default: _T) -> dict[str, AnyStr | _T]: ... - def start(self, __group: int | str = ...) -> int: ... - def end(self, __group: int | str = ...) -> int: ... - def span(self, __group: int | str = ...) -> tuple[int, int]: ... + def start(self, __group: int | str = 0) -> int: ... + def end(self, __group: int | str = 0) -> int: ... + def span(self, __group: int | str = 0) -> tuple[int, int]: ... @property def regs(self) -> tuple[tuple[int, int], ...]: ... # undocumented # __getitem__() returns "AnyStr" or "AnyStr | None", depending on the pattern. @@ -113,48 +115,64 @@ class Pattern(Generic[AnyStr]): @property def pattern(self) -> AnyStr: ... @overload - def search(self: Pattern[str], string: str, pos: int = ..., endpos: int = ...) -> Match[str] | None: ... + def search(self: Pattern[str], string: str, pos: int = 0, endpos: int = sys.maxsize) -> Match[str] | None: ... + @overload + def search(self: Pattern[bytes], string: ReadableBuffer, pos: int = 0, endpos: int = sys.maxsize) -> Match[bytes] | None: ... # type: ignore[misc] + @overload + def search(self, string: AnyStr, pos: int = 0, endpos: int = sys.maxsize) -> Match[AnyStr] | None: ... + @overload + def match(self: Pattern[str], string: str, pos: int = 0, endpos: int = sys.maxsize) -> Match[str] | None: ... + @overload + def match(self: Pattern[bytes], string: ReadableBuffer, pos: int = 0, endpos: int = sys.maxsize) -> Match[bytes] | None: ... # type: ignore[misc] @overload - def search(self: Pattern[bytes], string: ReadableBuffer, pos: int = ..., endpos: int = ...) -> Match[bytes] | None: ... + def match(self, string: AnyStr, pos: int = 0, endpos: int = sys.maxsize) -> Match[AnyStr] | None: ... @overload - def match(self: Pattern[str], string: str, pos: int = ..., endpos: int = ...) -> Match[str] | None: ... + def fullmatch(self: Pattern[str], string: str, pos: int = 0, endpos: int = sys.maxsize) -> Match[str] | None: ... @overload - def match(self: Pattern[bytes], string: ReadableBuffer, pos: int = ..., endpos: int = ...) -> Match[bytes] | None: ... + def fullmatch(self: Pattern[bytes], string: ReadableBuffer, pos: int = 0, endpos: int = sys.maxsize) -> Match[bytes] | None: ... # type: ignore[misc] @overload - def fullmatch(self: Pattern[str], string: str, pos: int = ..., endpos: int = ...) -> Match[str] | None: ... + def fullmatch(self, string: AnyStr, pos: int = 0, endpos: int = sys.maxsize) -> Match[AnyStr] | None: ... @overload - def fullmatch(self: Pattern[bytes], string: ReadableBuffer, pos: int = ..., endpos: int = ...) -> Match[bytes] | None: ... + def split(self: Pattern[str], string: str, maxsplit: int = 0) -> list[str | Any]: ... @overload - def split(self: Pattern[str], string: str, maxsplit: int = ...) -> list[str | Any]: ... + def split(self: Pattern[bytes], string: ReadableBuffer, maxsplit: int = 0) -> list[bytes | Any]: ... @overload - def split(self: Pattern[bytes], string: ReadableBuffer, maxsplit: int = ...) -> list[bytes | Any]: ... + def split(self, string: AnyStr, maxsplit: int = 0) -> list[AnyStr | Any]: ... # return type depends on the number of groups in the pattern @overload - def findall(self: Pattern[str], string: str, pos: int = ..., endpos: int = ...) -> list[Any]: ... + def findall(self: Pattern[str], string: str, pos: int = 0, endpos: int = sys.maxsize) -> list[Any]: ... @overload - def findall(self: Pattern[bytes], string: ReadableBuffer, pos: int = ..., endpos: int = ...) -> list[Any]: ... + def findall(self: Pattern[bytes], string: ReadableBuffer, pos: int = 0, endpos: int = sys.maxsize) -> list[Any]: ... @overload - def finditer(self: Pattern[str], string: str, pos: int = ..., endpos: int = ...) -> Iterator[Match[str]]: ... + def findall(self, string: AnyStr, pos: int = 0, endpos: int = sys.maxsize) -> list[AnyStr]: ... @overload - def finditer(self: Pattern[bytes], string: ReadableBuffer, pos: int = ..., endpos: int = ...) -> Iterator[Match[bytes]]: ... + def finditer(self: Pattern[str], string: str, pos: int = 0, endpos: int = sys.maxsize) -> Iterator[Match[str]]: ... @overload - def sub(self: Pattern[str], repl: str | Callable[[Match[str]], str], string: str, count: int = ...) -> str: ... + def finditer(self: Pattern[bytes], string: ReadableBuffer, pos: int = 0, endpos: int = sys.maxsize) -> Iterator[Match[bytes]]: ... # type: ignore[misc] @overload - def sub( + def finditer(self, string: AnyStr, pos: int = 0, endpos: int = sys.maxsize) -> Iterator[Match[AnyStr]]: ... + @overload + def sub(self: Pattern[str], repl: str | Callable[[Match[str]], str], string: str, count: int = 0) -> str: ... + @overload + def sub( # type: ignore[misc] self: Pattern[bytes], repl: ReadableBuffer | Callable[[Match[bytes]], ReadableBuffer], string: ReadableBuffer, - count: int = ..., + count: int = 0, ) -> bytes: ... @overload - def subn(self: Pattern[str], repl: str | Callable[[Match[str]], str], string: str, count: int = ...) -> tuple[str, int]: ... + def sub(self, repl: AnyStr | Callable[[Match[AnyStr]], AnyStr], string: AnyStr, count: int = 0) -> AnyStr: ... @overload - def subn( + def subn(self: Pattern[str], repl: str | Callable[[Match[str]], str], string: str, count: int = 0) -> tuple[str, int]: ... + @overload + def subn( # type: ignore[misc] self: Pattern[bytes], repl: ReadableBuffer | Callable[[Match[bytes]], ReadableBuffer], string: ReadableBuffer, - count: int = ..., + count: int = 0, ) -> tuple[bytes, int]: ... + @overload + def subn(self, repl: AnyStr | Callable[[Match[AnyStr]], AnyStr], string: AnyStr, count: int = 0) -> tuple[AnyStr, int]: ... def __copy__(self) -> Pattern[AnyStr]: ... def __deepcopy__(self, __memo: Any) -> Pattern[AnyStr]: ... if sys.version_info >= (3, 9): @@ -212,59 +230,59 @@ _FlagsType: TypeAlias = int | RegexFlag # pattern arguments do *not* accept arbitrary buffers such as bytearray, # because the pattern must be hashable. @overload -def compile(pattern: AnyStr, flags: _FlagsType = ...) -> Pattern[AnyStr]: ... +def compile(pattern: AnyStr, flags: _FlagsType = 0) -> Pattern[AnyStr]: ... @overload -def compile(pattern: Pattern[AnyStr], flags: _FlagsType = ...) -> Pattern[AnyStr]: ... +def compile(pattern: Pattern[AnyStr], flags: _FlagsType = 0) -> Pattern[AnyStr]: ... @overload -def search(pattern: str | Pattern[str], string: str, flags: _FlagsType = ...) -> Match[str] | None: ... +def search(pattern: str | Pattern[str], string: str, flags: _FlagsType = 0) -> Match[str] | None: ... @overload -def search(pattern: bytes | Pattern[bytes], string: ReadableBuffer, flags: _FlagsType = ...) -> Match[bytes] | None: ... +def search(pattern: bytes | Pattern[bytes], string: ReadableBuffer, flags: _FlagsType = 0) -> Match[bytes] | None: ... @overload -def match(pattern: str | Pattern[str], string: str, flags: _FlagsType = ...) -> Match[str] | None: ... +def match(pattern: str | Pattern[str], string: str, flags: _FlagsType = 0) -> Match[str] | None: ... @overload -def match(pattern: bytes | Pattern[bytes], string: ReadableBuffer, flags: _FlagsType = ...) -> Match[bytes] | None: ... +def match(pattern: bytes | Pattern[bytes], string: ReadableBuffer, flags: _FlagsType = 0) -> Match[bytes] | None: ... @overload -def fullmatch(pattern: str | Pattern[str], string: str, flags: _FlagsType = ...) -> Match[str] | None: ... +def fullmatch(pattern: str | Pattern[str], string: str, flags: _FlagsType = 0) -> Match[str] | None: ... @overload -def fullmatch(pattern: bytes | Pattern[bytes], string: ReadableBuffer, flags: _FlagsType = ...) -> Match[bytes] | None: ... +def fullmatch(pattern: bytes | Pattern[bytes], string: ReadableBuffer, flags: _FlagsType = 0) -> Match[bytes] | None: ... @overload -def split(pattern: str | Pattern[str], string: str, maxsplit: int = ..., flags: _FlagsType = ...) -> list[str | Any]: ... +def split(pattern: str | Pattern[str], string: str, maxsplit: int = 0, flags: _FlagsType = 0) -> list[str | Any]: ... @overload def split( - pattern: bytes | Pattern[bytes], string: ReadableBuffer, maxsplit: int = ..., flags: _FlagsType = ... + pattern: bytes | Pattern[bytes], string: ReadableBuffer, maxsplit: int = 0, flags: _FlagsType = 0 ) -> list[bytes | Any]: ... @overload -def findall(pattern: str | Pattern[str], string: str, flags: _FlagsType = ...) -> list[Any]: ... +def findall(pattern: str | Pattern[str], string: str, flags: _FlagsType = 0) -> list[Any]: ... @overload -def findall(pattern: bytes | Pattern[bytes], string: ReadableBuffer, flags: _FlagsType = ...) -> list[Any]: ... +def findall(pattern: bytes | Pattern[bytes], string: ReadableBuffer, flags: _FlagsType = 0) -> list[Any]: ... @overload -def finditer(pattern: str | Pattern[str], string: str, flags: _FlagsType = ...) -> Iterator[Match[str]]: ... +def finditer(pattern: str | Pattern[str], string: str, flags: _FlagsType = 0) -> Iterator[Match[str]]: ... @overload -def finditer(pattern: bytes | Pattern[bytes], string: ReadableBuffer, flags: _FlagsType = ...) -> Iterator[Match[bytes]]: ... +def finditer(pattern: bytes | Pattern[bytes], string: ReadableBuffer, flags: _FlagsType = 0) -> Iterator[Match[bytes]]: ... @overload def sub( - pattern: str | Pattern[str], repl: str | Callable[[Match[str]], str], string: str, count: int = ..., flags: _FlagsType = ... + pattern: str | Pattern[str], repl: str | Callable[[Match[str]], str], string: str, count: int = 0, flags: _FlagsType = 0 ) -> str: ... @overload def sub( pattern: bytes | Pattern[bytes], repl: ReadableBuffer | Callable[[Match[bytes]], ReadableBuffer], string: ReadableBuffer, - count: int = ..., - flags: _FlagsType = ..., + count: int = 0, + flags: _FlagsType = 0, ) -> bytes: ... @overload def subn( - pattern: str | Pattern[str], repl: str | Callable[[Match[str]], str], string: str, count: int = ..., flags: _FlagsType = ... + pattern: str | Pattern[str], repl: str | Callable[[Match[str]], str], string: str, count: int = 0, flags: _FlagsType = 0 ) -> tuple[str, int]: ... @overload def subn( pattern: bytes | Pattern[bytes], repl: ReadableBuffer | Callable[[Match[bytes]], ReadableBuffer], string: ReadableBuffer, - count: int = ..., - flags: _FlagsType = ..., + count: int = 0, + flags: _FlagsType = 0, ) -> tuple[bytes, int]: ... def escape(pattern: AnyStr) -> AnyStr: ... def purge() -> None: ... -def template(pattern: AnyStr | Pattern[AnyStr], flags: _FlagsType = ...) -> Pattern[AnyStr]: ... +def template(pattern: AnyStr | Pattern[AnyStr], flags: _FlagsType = 0) -> Pattern[AnyStr]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/readline.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/readline.pyi index ceca2e32f..14c01a986 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/readline.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/readline.pyi @@ -8,13 +8,13 @@ if sys.platform != "win32": _CompDisp: TypeAlias = Callable[[str, Sequence[str], int], None] def parse_and_bind(__string: str) -> None: ... - def read_init_file(__filename: StrOrBytesPath | None = ...) -> None: ... + def read_init_file(__filename: StrOrBytesPath | None = None) -> None: ... def get_line_buffer() -> str: ... def insert_text(__string: str) -> None: ... def redisplay() -> None: ... - def read_history_file(__filename: StrOrBytesPath | None = ...) -> None: ... - def write_history_file(__filename: StrOrBytesPath | None = ...) -> None: ... - def append_history_file(__nelements: int, __filename: StrOrBytesPath | None = ...) -> None: ... + def read_history_file(__filename: StrOrBytesPath | None = None) -> None: ... + def write_history_file(__filename: StrOrBytesPath | None = None) -> None: ... + def append_history_file(__nelements: int, __filename: StrOrBytesPath | None = None) -> None: ... def get_history_length() -> int: ... def set_history_length(__length: int) -> None: ... def clear_history() -> None: ... @@ -24,13 +24,13 @@ if sys.platform != "win32": def replace_history_item(__pos: int, __line: str) -> None: ... def add_history(__string: str) -> None: ... def set_auto_history(__enabled: bool) -> None: ... - def set_startup_hook(__function: Callable[[], object] | None = ...) -> None: ... - def set_pre_input_hook(__function: Callable[[], object] | None = ...) -> None: ... - def set_completer(__function: _Completer | None = ...) -> None: ... + def set_startup_hook(__function: Callable[[], object] | None = None) -> None: ... + def set_pre_input_hook(__function: Callable[[], object] | None = None) -> None: ... + def set_completer(__function: _Completer | None = None) -> None: ... def get_completer() -> _Completer | None: ... def get_completion_type() -> int: ... def get_begidx() -> int: ... def get_endidx() -> int: ... def set_completer_delims(__string: str) -> None: ... def get_completer_delims() -> str: ... - def set_completion_display_matches_hook(__function: _CompDisp | None = ...) -> None: ... + def set_completion_display_matches_hook(__function: _CompDisp | None = None) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/reprlib.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/reprlib.pyi index d5554344c..21c8a5cd4 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/reprlib.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/reprlib.pyi @@ -8,7 +8,7 @@ __all__ = ["Repr", "repr", "recursive_repr"] _ReprFunc: TypeAlias = Callable[[Any], str] -def recursive_repr(fillvalue: str = ...) -> Callable[[_ReprFunc], _ReprFunc]: ... +def recursive_repr(fillvalue: str = "...") -> Callable[[_ReprFunc], _ReprFunc]: ... class Repr: maxlevel: int @@ -22,7 +22,6 @@ class Repr: maxlong: int maxstring: int maxother: int - def __init__(self) -> None: ... def repr(self, x: Any) -> str: ... def repr1(self, x: Any, level: int) -> str: ... def repr_tuple(self, x: tuple[Any, ...], level: int) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/rlcompleter.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/rlcompleter.pyi index 1840b7cfc..8d9477e3e 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/rlcompleter.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/rlcompleter.pyi @@ -3,7 +3,7 @@ from typing import Any __all__ = ["Completer"] class Completer: - def __init__(self, namespace: dict[str, Any] | None = ...) -> None: ... + def __init__(self, namespace: dict[str, Any] | None = None) -> None: ... def complete(self, text: str, state: int) -> str | None: ... def attr_matches(self, text: str) -> list[str]: ... def global_matches(self, text: str) -> list[str]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/runpy.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/runpy.pyi index 256f8dab1..d4406ea4a 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/runpy.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/runpy.pyi @@ -1,6 +1,7 @@ -from _typeshed import Self +from _typeshed import Unused from types import ModuleType from typing import Any +from typing_extensions import Self __all__ = ["run_module", "run_path"] @@ -8,16 +9,16 @@ class _TempModule: mod_name: str module: ModuleType def __init__(self, mod_name: str) -> None: ... - def __enter__(self: Self) -> Self: ... - def __exit__(self, *args: object) -> None: ... + def __enter__(self) -> Self: ... + def __exit__(self, *args: Unused) -> None: ... class _ModifiedArgv0: value: Any def __init__(self, value: Any) -> None: ... def __enter__(self) -> None: ... - def __exit__(self, *args: object) -> None: ... + def __exit__(self, *args: Unused) -> None: ... def run_module( - mod_name: str, init_globals: dict[str, Any] | None = ..., run_name: str | None = ..., alter_sys: bool = ... + mod_name: str, init_globals: dict[str, Any] | None = None, run_name: str | None = None, alter_sys: bool = False ) -> dict[str, Any]: ... -def run_path(path_name: str, init_globals: dict[str, Any] | None = ..., run_name: str | None = ...) -> dict[str, Any]: ... +def run_path(path_name: str, init_globals: dict[str, Any] | None = None, run_name: str | None = None) -> dict[str, Any]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/sched.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/sched.pyi index 29c84f951..a8ec78d68 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/sched.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/sched.pyi @@ -35,7 +35,7 @@ class scheduler: def enter( self, delay: float, priority: Any, action: _ActionCallback, argument: tuple[Any, ...] = ..., kwargs: dict[str, Any] = ... ) -> Event: ... - def run(self, blocking: bool = ...) -> float | None: ... + def run(self, blocking: bool = True) -> float | None: ... def cancel(self, event: Event) -> None: ... def empty(self) -> bool: ... @property diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/secrets.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/secrets.pyi index 99b7c14eb..4861b6f09 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/secrets.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/secrets.pyi @@ -10,6 +10,6 @@ _T = TypeVar("_T") def randbelow(exclusive_upper_bound: int) -> int: ... def randbits(k: int) -> int: ... def choice(seq: SupportsLenAndGetItem[_T]) -> _T: ... -def token_bytes(nbytes: int | None = ...) -> bytes: ... -def token_hex(nbytes: int | None = ...) -> str: ... -def token_urlsafe(nbytes: int | None = ...) -> str: ... +def token_bytes(nbytes: int | None = None) -> bytes: ... +def token_hex(nbytes: int | None = None) -> str: ... +def token_urlsafe(nbytes: int | None = None) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/select.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/select.pyi index 7cfea9ea0..c86d20c35 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/select.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/select.pyi @@ -1,9 +1,9 @@ import sys -from _typeshed import FileDescriptorLike, Self +from _typeshed import FileDescriptorLike from collections.abc import Iterable from types import TracebackType from typing import Any -from typing_extensions import final +from typing_extensions import Self, final if sys.platform != "win32": PIPE_BUF: int @@ -21,14 +21,13 @@ if sys.platform != "win32": POLLWRNORM: int class poll: - def __init__(self) -> None: ... def register(self, fd: FileDescriptorLike, eventmask: int = ...) -> None: ... def modify(self, fd: FileDescriptorLike, eventmask: int) -> None: ... def unregister(self, fd: FileDescriptorLike) -> None: ... def poll(self, timeout: float | None = ...) -> list[tuple[int, int]]: ... def select( - __rlist: Iterable[Any], __wlist: Iterable[Any], __xlist: Iterable[Any], __timeout: float | None = ... + __rlist: Iterable[Any], __wlist: Iterable[Any], __xlist: Iterable[Any], __timeout: float | None = None ) -> tuple[list[Any], list[Any], list[Any]]: ... error = OSError @@ -59,7 +58,7 @@ if sys.platform != "linux" and sys.platform != "win32": def __init__(self) -> None: ... def close(self) -> None: ... def control( - self, __changelist: Iterable[kevent] | None, __maxevents: int, __timeout: float | None = ... + self, __changelist: Iterable[kevent] | None, __maxevents: int, __timeout: float | None = None ) -> list[kevent]: ... def fileno(self) -> int: ... @classmethod @@ -107,12 +106,12 @@ if sys.platform == "linux": @final class epoll: def __init__(self, sizehint: int = ..., flags: int = ...) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, - __exc_type: type[BaseException] | None = ..., - __exc_val: BaseException | None = ..., - __exc_tb: TracebackType | None = ..., + __exc_type: type[BaseException] | None = None, + __exc_value: BaseException | None = ..., + __exc_tb: TracebackType | None = None, ) -> None: ... def close(self) -> None: ... closed: bool @@ -120,7 +119,7 @@ if sys.platform == "linux": def register(self, fd: FileDescriptorLike, eventmask: int = ...) -> None: ... def modify(self, fd: FileDescriptorLike, eventmask: int) -> None: ... def unregister(self, fd: FileDescriptorLike) -> None: ... - def poll(self, timeout: float | None = ..., maxevents: int = ...) -> list[tuple[int, int]]: ... + def poll(self, timeout: float | None = None, maxevents: int = -1) -> list[tuple[int, int]]: ... @classmethod def fromfd(cls, __fd: FileDescriptorLike) -> epoll: ... EPOLLERR: int diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/selectors.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/selectors.pyi index 95dfaa41a..90a923f09 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/selectors.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/selectors.pyi @@ -1,9 +1,9 @@ import sys -from _typeshed import FileDescriptor, FileDescriptorLike, Self +from _typeshed import FileDescriptor, FileDescriptorLike, Unused from abc import ABCMeta, abstractmethod from collections.abc import Mapping from typing import Any, NamedTuple -from typing_extensions import TypeAlias +from typing_extensions import Self, TypeAlias _EventMask: TypeAlias = int @@ -18,38 +18,38 @@ class SelectorKey(NamedTuple): class BaseSelector(metaclass=ABCMeta): @abstractmethod - def register(self, fileobj: FileDescriptorLike, events: _EventMask, data: Any = ...) -> SelectorKey: ... + def register(self, fileobj: FileDescriptorLike, events: _EventMask, data: Any = None) -> SelectorKey: ... @abstractmethod def unregister(self, fileobj: FileDescriptorLike) -> SelectorKey: ... - def modify(self, fileobj: FileDescriptorLike, events: _EventMask, data: Any = ...) -> SelectorKey: ... + def modify(self, fileobj: FileDescriptorLike, events: _EventMask, data: Any = None) -> SelectorKey: ... @abstractmethod - def select(self, timeout: float | None = ...) -> list[tuple[SelectorKey, _EventMask]]: ... + def select(self, timeout: float | None = None) -> list[tuple[SelectorKey, _EventMask]]: ... def close(self) -> None: ... def get_key(self, fileobj: FileDescriptorLike) -> SelectorKey: ... @abstractmethod def get_map(self) -> Mapping[FileDescriptorLike, SelectorKey]: ... - def __enter__(self: Self) -> Self: ... - def __exit__(self, *args: object) -> None: ... + def __enter__(self) -> Self: ... + def __exit__(self, *args: Unused) -> None: ... class SelectSelector(BaseSelector): - def register(self, fileobj: FileDescriptorLike, events: _EventMask, data: Any = ...) -> SelectorKey: ... + def register(self, fileobj: FileDescriptorLike, events: _EventMask, data: Any = None) -> SelectorKey: ... def unregister(self, fileobj: FileDescriptorLike) -> SelectorKey: ... - def select(self, timeout: float | None = ...) -> list[tuple[SelectorKey, _EventMask]]: ... + def select(self, timeout: float | None = None) -> list[tuple[SelectorKey, _EventMask]]: ... def get_map(self) -> Mapping[FileDescriptorLike, SelectorKey]: ... if sys.platform != "win32": class PollSelector(BaseSelector): - def register(self, fileobj: FileDescriptorLike, events: _EventMask, data: Any = ...) -> SelectorKey: ... + def register(self, fileobj: FileDescriptorLike, events: _EventMask, data: Any = None) -> SelectorKey: ... def unregister(self, fileobj: FileDescriptorLike) -> SelectorKey: ... - def select(self, timeout: float | None = ...) -> list[tuple[SelectorKey, _EventMask]]: ... + def select(self, timeout: float | None = None) -> list[tuple[SelectorKey, _EventMask]]: ... def get_map(self) -> Mapping[FileDescriptorLike, SelectorKey]: ... if sys.platform == "linux": class EpollSelector(BaseSelector): def fileno(self) -> int: ... - def register(self, fileobj: FileDescriptorLike, events: _EventMask, data: Any = ...) -> SelectorKey: ... + def register(self, fileobj: FileDescriptorLike, events: _EventMask, data: Any = None) -> SelectorKey: ... def unregister(self, fileobj: FileDescriptorLike) -> SelectorKey: ... - def select(self, timeout: float | None = ...) -> list[tuple[SelectorKey, _EventMask]]: ... + def select(self, timeout: float | None = None) -> list[tuple[SelectorKey, _EventMask]]: ... def get_map(self) -> Mapping[FileDescriptorLike, SelectorKey]: ... class DevpollSelector(BaseSelector): @@ -61,13 +61,13 @@ class DevpollSelector(BaseSelector): class KqueueSelector(BaseSelector): def fileno(self) -> int: ... - def register(self, fileobj: FileDescriptorLike, events: _EventMask, data: Any = ...) -> SelectorKey: ... + def register(self, fileobj: FileDescriptorLike, events: _EventMask, data: Any = None) -> SelectorKey: ... def unregister(self, fileobj: FileDescriptorLike) -> SelectorKey: ... - def select(self, timeout: float | None = ...) -> list[tuple[SelectorKey, _EventMask]]: ... + def select(self, timeout: float | None = None) -> list[tuple[SelectorKey, _EventMask]]: ... def get_map(self) -> Mapping[FileDescriptorLike, SelectorKey]: ... class DefaultSelector(BaseSelector): - def register(self, fileobj: FileDescriptorLike, events: _EventMask, data: Any = ...) -> SelectorKey: ... + def register(self, fileobj: FileDescriptorLike, events: _EventMask, data: Any = None) -> SelectorKey: ... def unregister(self, fileobj: FileDescriptorLike) -> SelectorKey: ... - def select(self, timeout: float | None = ...) -> list[tuple[SelectorKey, _EventMask]]: ... + def select(self, timeout: float | None = None) -> list[tuple[SelectorKey, _EventMask]]: ... def get_map(self) -> Mapping[FileDescriptorLike, SelectorKey]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/shelve.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/shelve.pyi index c801ecd3f..82d0b03f4 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/shelve.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/shelve.pyi @@ -1,8 +1,8 @@ -from _typeshed import Self from collections.abc import Iterator, MutableMapping from dbm import _TFlags from types import TracebackType from typing import Any, TypeVar, overload +from typing_extensions import Self __all__ = ["Shelf", "BsdDbShelf", "DbfilenameShelf", "open"] @@ -11,7 +11,7 @@ _VT = TypeVar("_VT") class Shelf(MutableMapping[str, _VT]): def __init__( - self, dict: MutableMapping[bytes, bytes], protocol: int | None = ..., writeback: bool = ..., keyencoding: str = ... + self, dict: MutableMapping[bytes, bytes], protocol: int | None = None, writeback: bool = False, keyencoding: str = "utf-8" ) -> None: ... def __iter__(self) -> Iterator[str]: ... def __len__(self) -> int: ... @@ -23,7 +23,7 @@ class Shelf(MutableMapping[str, _VT]): def __setitem__(self, key: str, value: _VT) -> None: ... def __delitem__(self, key: str) -> None: ... def __contains__(self, key: str) -> bool: ... # type: ignore[override] - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, type: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None ) -> None: ... @@ -38,6 +38,6 @@ class BsdDbShelf(Shelf[_VT]): def last(self) -> tuple[str, _VT]: ... class DbfilenameShelf(Shelf[_VT]): - def __init__(self, filename: str, flag: _TFlags = ..., protocol: int | None = ..., writeback: bool = ...) -> None: ... + def __init__(self, filename: str, flag: _TFlags = "c", protocol: int | None = None, writeback: bool = False) -> None: ... -def open(filename: str, flag: _TFlags = ..., protocol: int | None = ..., writeback: bool = ...) -> Shelf[Any]: ... +def open(filename: str, flag: _TFlags = "c", protocol: int | None = None, writeback: bool = False) -> Shelf[Any]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/shlex.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/shlex.pyi index f9d660594..fa04932db 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/shlex.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/shlex.pyi @@ -1,14 +1,14 @@ import sys -from _typeshed import Self from collections.abc import Iterable from typing import TextIO +from typing_extensions import Self if sys.version_info >= (3, 8): __all__ = ["shlex", "split", "quote", "join"] else: __all__ = ["shlex", "split", "quote"] -def split(s: str, comments: bool = ..., posix: bool = ...) -> list[str]: ... +def split(s: str, comments: bool = False, posix: bool = True) -> list[str]: ... if sys.version_info >= (3, 8): def join(split_command: Iterable[str]) -> str: ... @@ -34,17 +34,17 @@ class shlex(Iterable[str]): def punctuation_chars(self) -> str: ... def __init__( self, - instream: str | TextIO | None = ..., - infile: str | None = ..., - posix: bool = ..., - punctuation_chars: bool | str = ..., + instream: str | TextIO | None = None, + infile: str | None = None, + posix: bool = False, + punctuation_chars: bool | str = False, ) -> None: ... def get_token(self) -> str: ... def push_token(self, tok: str) -> None: ... def read_token(self) -> str: ... def sourcehook(self, newfile: str) -> tuple[str, TextIO]: ... - def push_source(self, newstream: str | TextIO, newfile: str | None = ...) -> None: ... + def push_source(self, newstream: str | TextIO, newfile: str | None = None) -> None: ... def pop_source(self) -> None: ... - def error_leader(self, infile: str | None = ..., lineno: int | None = ...) -> None: ... - def __iter__(self: Self) -> Self: ... + def error_leader(self, infile: str | None = None, lineno: int | None = None) -> None: ... + def __iter__(self) -> Self: ... def __next__(self) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/shutil.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/shutil.pyi index 13c706de1..0e4f521e5 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/shutil.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/shutil.pyi @@ -1,8 +1,8 @@ import os import sys -from _typeshed import BytesPath, StrOrBytesPath, StrPath, SupportsRead, SupportsWrite +from _typeshed import BytesPath, FileDescriptorOrPath, StrOrBytesPath, StrPath, SupportsRead, SupportsWrite from collections.abc import Callable, Iterable, Sequence -from typing import Any, AnyStr, NamedTuple, TypeVar, overload +from typing import Any, AnyStr, NamedTuple, Protocol, TypeVar, overload from typing_extensions import TypeAlias __all__ = [ @@ -47,50 +47,64 @@ class ExecError(OSError): ... class ReadError(OSError): ... class RegistryError(Exception): ... -def copyfileobj(fsrc: SupportsRead[AnyStr], fdst: SupportsWrite[AnyStr], length: int = ...) -> None: ... -def copyfile(src: StrOrBytesPath, dst: _StrOrBytesPathT, *, follow_symlinks: bool = ...) -> _StrOrBytesPathT: ... -def copymode(src: StrOrBytesPath, dst: StrOrBytesPath, *, follow_symlinks: bool = ...) -> None: ... -def copystat(src: StrOrBytesPath, dst: StrOrBytesPath, *, follow_symlinks: bool = ...) -> None: ... +if sys.version_info >= (3, 8): + def copyfileobj(fsrc: SupportsRead[AnyStr], fdst: SupportsWrite[AnyStr], length: int = 0) -> None: ... + +else: + def copyfileobj(fsrc: SupportsRead[AnyStr], fdst: SupportsWrite[AnyStr], length: int = 16384) -> None: ... + +def copyfile(src: StrOrBytesPath, dst: _StrOrBytesPathT, *, follow_symlinks: bool = True) -> _StrOrBytesPathT: ... +def copymode(src: StrOrBytesPath, dst: StrOrBytesPath, *, follow_symlinks: bool = True) -> None: ... +def copystat(src: StrOrBytesPath, dst: StrOrBytesPath, *, follow_symlinks: bool = True) -> None: ... @overload -def copy(src: StrPath, dst: StrPath, *, follow_symlinks: bool = ...) -> _PathReturn: ... +def copy(src: StrPath, dst: StrPath, *, follow_symlinks: bool = True) -> _PathReturn: ... @overload -def copy(src: BytesPath, dst: BytesPath, *, follow_symlinks: bool = ...) -> _PathReturn: ... +def copy(src: BytesPath, dst: BytesPath, *, follow_symlinks: bool = True) -> _PathReturn: ... @overload -def copy2(src: StrPath, dst: StrPath, *, follow_symlinks: bool = ...) -> _PathReturn: ... +def copy2(src: StrPath, dst: StrPath, *, follow_symlinks: bool = True) -> _PathReturn: ... @overload -def copy2(src: BytesPath, dst: BytesPath, *, follow_symlinks: bool = ...) -> _PathReturn: ... +def copy2(src: BytesPath, dst: BytesPath, *, follow_symlinks: bool = True) -> _PathReturn: ... def ignore_patterns(*patterns: StrPath) -> Callable[[Any, list[str]], set[str]]: ... if sys.version_info >= (3, 8): def copytree( src: StrPath, dst: StrPath, - symlinks: bool = ..., - ignore: None | Callable[[str, list[str]], Iterable[str]] | Callable[[StrPath, list[str]], Iterable[str]] = ..., + symlinks: bool = False, + ignore: None | Callable[[str, list[str]], Iterable[str]] | Callable[[StrPath, list[str]], Iterable[str]] = None, copy_function: Callable[[str, str], object] = ..., - ignore_dangling_symlinks: bool = ..., - dirs_exist_ok: bool = ..., + ignore_dangling_symlinks: bool = False, + dirs_exist_ok: bool = False, ) -> _PathReturn: ... else: def copytree( src: StrPath, dst: StrPath, - symlinks: bool = ..., - ignore: None | Callable[[str, list[str]], Iterable[str]] | Callable[[StrPath, list[str]], Iterable[str]] = ..., + symlinks: bool = False, + ignore: None | Callable[[str, list[str]], Iterable[str]] | Callable[[StrPath, list[str]], Iterable[str]] = None, copy_function: Callable[[str, str], object] = ..., - ignore_dangling_symlinks: bool = ..., + ignore_dangling_symlinks: bool = False, ) -> _PathReturn: ... _OnErrorCallback: TypeAlias = Callable[[Callable[..., Any], Any, Any], object] -if sys.version_info >= (3, 11): - def rmtree( - path: StrOrBytesPath, ignore_errors: bool = ..., onerror: _OnErrorCallback | None = ..., *, dir_fd: int | None = ... - ) -> None: ... +class _RmtreeType(Protocol): + avoids_symlink_attacks: bool + if sys.version_info >= (3, 11): + def __call__( + self, + path: StrOrBytesPath, + ignore_errors: bool = ..., + onerror: _OnErrorCallback | None = ..., + *, + dir_fd: int | None = ..., + ) -> None: ... -else: - def rmtree(path: StrOrBytesPath, ignore_errors: bool = ..., onerror: _OnErrorCallback | None = ...) -> None: ... + else: + def __call__(self, path: StrOrBytesPath, ignore_errors: bool = ..., onerror: _OnErrorCallback | None = ...) -> None: ... + +rmtree: _RmtreeType _CopyFn: TypeAlias = Callable[[str, str], object] | Callable[[StrPath, StrPath], object] @@ -109,15 +123,15 @@ class _ntuple_diskusage(NamedTuple): used: int free: int -def disk_usage(path: int | StrOrBytesPath) -> _ntuple_diskusage: ... +def disk_usage(path: FileDescriptorOrPath) -> _ntuple_diskusage: ... # While chown can be imported on Windows, it doesn't actually work; # see https://bugs.python.org/issue33140. We keep it here because it's # in __all__. @overload -def chown(path: StrOrBytesPath, user: str | int, group: None = ...) -> None: ... +def chown(path: StrOrBytesPath, user: str | int, group: None = None) -> None: ... @overload -def chown(path: StrOrBytesPath, user: None = ..., *, group: str | int) -> None: ... +def chown(path: StrOrBytesPath, user: None = None, *, group: str | int) -> None: ... @overload def chown(path: StrOrBytesPath, user: None, group: str | int) -> None: ... @overload @@ -125,46 +139,46 @@ def chown(path: StrOrBytesPath, user: str | int, group: str | int) -> None: ... if sys.version_info >= (3, 8): @overload - def which(cmd: _StrPathT, mode: int = ..., path: StrPath | None = ...) -> str | _StrPathT | None: ... + def which(cmd: _StrPathT, mode: int = 1, path: StrPath | None = None) -> str | _StrPathT | None: ... @overload - def which(cmd: bytes, mode: int = ..., path: StrPath | None = ...) -> bytes | None: ... + def which(cmd: bytes, mode: int = 1, path: StrPath | None = None) -> bytes | None: ... else: - def which(cmd: _StrPathT, mode: int = ..., path: StrPath | None = ...) -> str | _StrPathT | None: ... + def which(cmd: _StrPathT, mode: int = 1, path: StrPath | None = None) -> str | _StrPathT | None: ... def make_archive( base_name: str, format: str, - root_dir: StrPath | None = ..., - base_dir: StrPath | None = ..., + root_dir: StrPath | None = None, + base_dir: StrPath | None = None, verbose: bool = ..., dry_run: bool = ..., - owner: str | None = ..., - group: str | None = ..., - logger: Any | None = ..., + owner: str | None = None, + group: str | None = None, + logger: Any | None = None, ) -> str: ... def get_archive_formats() -> list[tuple[str, str]]: ... @overload def register_archive_format( - name: str, function: Callable[..., object], extra_args: Sequence[tuple[str, Any] | list[Any]], description: str = ... + name: str, function: Callable[..., object], extra_args: Sequence[tuple[str, Any] | list[Any]], description: str = "" ) -> None: ... @overload def register_archive_format( - name: str, function: Callable[[str, str], object], extra_args: None = ..., description: str = ... + name: str, function: Callable[[str, str], object], extra_args: None = None, description: str = "" ) -> None: ... def unregister_archive_format(name: str) -> None: ... -def unpack_archive(filename: StrPath, extract_dir: StrPath | None = ..., format: str | None = ...) -> None: ... +def unpack_archive(filename: StrPath, extract_dir: StrPath | None = None, format: str | None = None) -> None: ... @overload def register_unpack_format( name: str, extensions: list[str], function: Callable[..., object], extra_args: Sequence[tuple[str, Any]], - description: str = ..., + description: str = "", ) -> None: ... @overload def register_unpack_format( - name: str, extensions: list[str], function: Callable[[str, str], object], extra_args: None = ..., description: str = ... + name: str, extensions: list[str], function: Callable[[str, str], object], extra_args: None = None, description: str = "" ) -> None: ... def unregister_unpack_format(name: str) -> None: ... def get_unpack_formats() -> list[tuple[str, list[str], str]]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/signal.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/signal.pyi index 8e9bd990a..4c961a0c9 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/signal.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/signal.pyi @@ -3,7 +3,7 @@ from _typeshed import structseq from collections.abc import Callable, Iterable from enum import IntEnum from types import FrameType -from typing import Any, Union +from typing import Any from typing_extensions import Final, Never, TypeAlias, final NSIG: int @@ -53,6 +53,8 @@ class Signals(IntEnum): SIGPWR: int SIGRTMAX: int SIGRTMIN: int + if sys.version_info >= (3, 11): + SIGSTKFLT: int class Handlers(IntEnum): SIG_DFL: int @@ -62,7 +64,7 @@ SIG_DFL: Handlers SIG_IGN: Handlers _SIGNUM: TypeAlias = int | Signals -_HANDLER: TypeAlias = Union[Callable[[int, FrameType | None], Any], int, Handlers, None] +_HANDLER: TypeAlias = Callable[[int, FrameType | None], Any] | int | Handlers | None def default_int_handler(__signalnum: int, __frame: FrameType | None) -> Never: ... @@ -113,7 +115,7 @@ else: SIGXCPU: Signals SIGXFSZ: Signals - class ItimerError(IOError): ... + class ItimerError(OSError): ... ITIMER_PROF: int ITIMER_REAL: int ITIMER_VIRTUAL: int @@ -134,7 +136,7 @@ else: else: def pthread_sigmask(__how: int, __mask: Iterable[int]) -> set[_SIGNUM]: ... - def setitimer(__which: int, __seconds: float, __interval: float = ...) -> tuple[float, float]: ... + def setitimer(__which: int, __seconds: float, __interval: float = 0.0) -> tuple[float, float]: ... def siginterrupt(__signalnum: int, __flag: bool) -> None: ... def sigpending() -> Any: ... if sys.version_info >= (3, 10): # argument changed in 3.10.2 @@ -147,6 +149,8 @@ else: SIGPWR: Signals SIGRTMAX: Signals SIGRTMIN: Signals + if sys.version_info >= (3, 11): + SIGSTKFLT: Signals @final class struct_siginfo(structseq[int], tuple[int, int, int, int, int, int, int]): if sys.version_info >= (3, 10): @@ -178,4 +182,4 @@ def set_wakeup_fd(fd: int, *, warn_on_full_buffer: bool = ...) -> int: ... if sys.version_info >= (3, 9): if sys.platform == "linux": - def pidfd_send_signal(__pidfd: int, __sig: int, __siginfo: None = ..., __flags: int = ...) -> None: ... + def pidfd_send_signal(__pidfd: int, __sig: int, __siginfo: None = None, __flags: int = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/site.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/site.pyi index 53199db0e..a8c6bcb41 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/site.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/site.pyi @@ -9,14 +9,14 @@ USER_BASE: str | None def main() -> None: ... def abs_paths() -> None: ... # undocumented def addpackage(sitedir: StrPath, name: StrPath, known_paths: set[str] | None) -> set[str] | None: ... # undocumented -def addsitedir(sitedir: str, known_paths: set[str] | None = ...) -> None: ... -def addsitepackages(known_paths: set[str] | None, prefixes: Iterable[str] | None = ...) -> set[str] | None: ... # undocumented +def addsitedir(sitedir: str, known_paths: set[str] | None = None) -> None: ... +def addsitepackages(known_paths: set[str] | None, prefixes: Iterable[str] | None = None) -> set[str] | None: ... # undocumented def addusersitepackages(known_paths: set[str] | None) -> set[str] | None: ... # undocumented def check_enableusersite() -> bool | None: ... # undocumented def enablerlcompleter() -> None: ... # undocumented def execsitecustomize() -> None: ... # undocumented def execusercustomize() -> None: ... # undocumented -def getsitepackages(prefixes: Iterable[str] | None = ...) -> list[str]: ... +def getsitepackages(prefixes: Iterable[str] | None = None) -> list[str]: ... def getuserbase() -> str: ... def getusersitepackages() -> str: ... def makepath(*paths: StrPath) -> tuple[str, str]: ... # undocumented diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/smtpd.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/smtpd.pyi index f2de6c155..7392bd516 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/smtpd.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/smtpd.pyi @@ -41,10 +41,10 @@ class SMTPChannel(asynchat.async_chat): server: SMTPServer, conn: socket.socket, addr: Any, - data_size_limit: int = ..., - map: asyncore._MapType | None = ..., - enable_SMTPUTF8: bool = ..., - decode_data: bool = ..., + data_size_limit: int = 33554432, + map: asyncore._MapType | None = None, + enable_SMTPUTF8: bool = False, + decode_data: bool = False, ) -> None: ... # base asynchat.async_chat.push() accepts bytes def push(self, msg: str) -> None: ... # type: ignore[override] @@ -71,10 +71,10 @@ class SMTPServer(asyncore.dispatcher): self, localaddr: _Address, remoteaddr: _Address, - data_size_limit: int = ..., - map: asyncore._MapType | None = ..., - enable_SMTPUTF8: bool = ..., - decode_data: bool = ..., + data_size_limit: int = 33554432, + map: asyncore._MapType | None = None, + enable_SMTPUTF8: bool = False, + decode_data: bool = False, ) -> None: ... def handle_accepted(self, conn: socket.socket, addr: Any) -> None: ... def process_message( diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/smtplib.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/smtplib.pyi index c42841c43..0d7595fc1 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/smtplib.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/smtplib.pyi @@ -1,5 +1,6 @@ import sys -from _typeshed import Self +from _socket import _Address as _SourceAddress +from _typeshed import ReadableBuffer, _BufferWithLen from collections.abc import Sequence from email.message import Message as _Message from re import Pattern @@ -7,7 +8,7 @@ from socket import socket from ssl import SSLContext from types import TracebackType from typing import Any, Protocol, overload -from typing_extensions import TypeAlias +from typing_extensions import Self, TypeAlias __all__ = [ "SMTPException", @@ -28,8 +29,6 @@ __all__ = [ _Reply: TypeAlias = tuple[int, bytes] _SendErrs: TypeAlias = dict[str, _Reply] -# Should match source_address for socket.create_connection -_SourceAddress: TypeAlias = tuple[bytearray | bytes | str, int] SMTP_PORT: int SMTP_SSL_PORT: int @@ -49,7 +48,6 @@ class SMTPResponseException(SMTPException): def __init__(self, code: int, msg: bytes | str) -> None: ... class SMTPSenderRefused(SMTPResponseException): - smtp_code: int smtp_error: bytes sender: str args: tuple[int, bytes, str] @@ -70,7 +68,7 @@ def quotedata(data: str) -> str: ... class _AuthObject(Protocol): @overload - def __call__(self, challenge: None = ...) -> str | None: ... + def __call__(self, challenge: None = None) -> str | None: ... @overload def __call__(self, challenge: bytes) -> str: ... @@ -91,59 +89,59 @@ class SMTP: local_hostname: str def __init__( self, - host: str = ..., - port: int = ..., - local_hostname: str | None = ..., + host: str = "", + port: int = 0, + local_hostname: str | None = None, timeout: float = ..., - source_address: _SourceAddress | None = ..., + source_address: _SourceAddress | None = None, ) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, exc_value: BaseException | None, tb: TracebackType | None ) -> None: ... def set_debuglevel(self, debuglevel: int) -> None: ... - def connect(self, host: str = ..., port: int = ..., source_address: _SourceAddress | None = ...) -> _Reply: ... - def send(self, s: bytes | str) -> None: ... - def putcmd(self, cmd: str, args: str = ...) -> None: ... + def connect(self, host: str = "localhost", port: int = 0, source_address: _SourceAddress | None = None) -> _Reply: ... + def send(self, s: ReadableBuffer | str) -> None: ... + def putcmd(self, cmd: str, args: str = "") -> None: ... def getreply(self) -> _Reply: ... - def docmd(self, cmd: str, args: str = ...) -> _Reply: ... - def helo(self, name: str = ...) -> _Reply: ... - def ehlo(self, name: str = ...) -> _Reply: ... + def docmd(self, cmd: str, args: str = "") -> _Reply: ... + def helo(self, name: str = "") -> _Reply: ... + def ehlo(self, name: str = "") -> _Reply: ... def has_extn(self, opt: str) -> bool: ... - def help(self, args: str = ...) -> bytes: ... + def help(self, args: str = "") -> bytes: ... def rset(self) -> _Reply: ... def noop(self) -> _Reply: ... def mail(self, sender: str, options: Sequence[str] = ...) -> _Reply: ... def rcpt(self, recip: str, options: Sequence[str] = ...) -> _Reply: ... - def data(self, msg: bytes | str) -> _Reply: ... + def data(self, msg: ReadableBuffer | str) -> _Reply: ... def verify(self, address: str) -> _Reply: ... vrfy = verify def expn(self, address: str) -> _Reply: ... def ehlo_or_helo_if_needed(self) -> None: ... user: str password: str - def auth(self, mechanism: str, authobject: _AuthObject, *, initial_response_ok: bool = ...) -> _Reply: ... + def auth(self, mechanism: str, authobject: _AuthObject, *, initial_response_ok: bool = True) -> _Reply: ... @overload - def auth_cram_md5(self, challenge: None = ...) -> None: ... + def auth_cram_md5(self, challenge: None = None) -> None: ... @overload - def auth_cram_md5(self, challenge: bytes) -> str: ... - def auth_plain(self, challenge: bytes | None = ...) -> str: ... - def auth_login(self, challenge: bytes | None = ...) -> str: ... - def login(self, user: str, password: str, *, initial_response_ok: bool = ...) -> _Reply: ... - def starttls(self, keyfile: str | None = ..., certfile: str | None = ..., context: SSLContext | None = ...) -> _Reply: ... + def auth_cram_md5(self, challenge: ReadableBuffer) -> str: ... + def auth_plain(self, challenge: ReadableBuffer | None = None) -> str: ... + def auth_login(self, challenge: ReadableBuffer | None = None) -> str: ... + def login(self, user: str, password: str, *, initial_response_ok: bool = True) -> _Reply: ... + def starttls(self, keyfile: str | None = None, certfile: str | None = None, context: SSLContext | None = None) -> _Reply: ... def sendmail( self, from_addr: str, to_addrs: str | Sequence[str], - msg: bytes | str, + msg: _BufferWithLen | str, mail_options: Sequence[str] = ..., rcpt_options: Sequence[str] = ..., ) -> _SendErrs: ... def send_message( self, msg: _Message, - from_addr: str | None = ..., - to_addrs: str | Sequence[str] | None = ..., + from_addr: str | None = None, + to_addrs: str | Sequence[str] | None = None, mail_options: Sequence[str] = ..., rcpt_options: Sequence[str] = ..., ) -> _SendErrs: ... @@ -151,20 +149,19 @@ class SMTP: def quit(self) -> _Reply: ... class SMTP_SSL(SMTP): - default_port: int keyfile: str | None certfile: str | None context: SSLContext def __init__( self, - host: str = ..., - port: int = ..., - local_hostname: str | None = ..., - keyfile: str | None = ..., - certfile: str | None = ..., + host: str = "", + port: int = 0, + local_hostname: str | None = None, + keyfile: str | None = None, + certfile: str | None = None, timeout: float = ..., - source_address: _SourceAddress | None = ..., - context: SSLContext | None = ..., + source_address: _SourceAddress | None = None, + context: SSLContext | None = None, ) -> None: ... LMTP_PORT: int @@ -173,13 +170,17 @@ class LMTP(SMTP): if sys.version_info >= (3, 9): def __init__( self, - host: str = ..., - port: int = ..., - local_hostname: str | None = ..., - source_address: _SourceAddress | None = ..., + host: str = "", + port: int = 2003, + local_hostname: str | None = None, + source_address: _SourceAddress | None = None, timeout: float = ..., ) -> None: ... else: def __init__( - self, host: str = ..., port: int = ..., local_hostname: str | None = ..., source_address: _SourceAddress | None = ... + self, + host: str = "", + port: int = 2003, + local_hostname: str | None = None, + source_address: _SourceAddress | None = None, ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/socket.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/socket.pyi index a0f5708bf..6c897b919 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/socket.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/socket.pyi @@ -1,15 +1,8 @@ -import sys -from _typeshed import ReadableBuffer, Self, WriteableBuffer -from collections.abc import Iterable -from enum import IntEnum, IntFlag -from io import BufferedReader, BufferedRWPair, BufferedWriter, IOBase, RawIOBase, TextIOWrapper -from typing import Any, Protocol, overload -from typing_extensions import Literal - # Ideally, we'd just do "from _socket import *". Unfortunately, socket # overrides some definitions from _socket incompatibly. mypy incorrectly # prefers the definitions from _socket over those defined here. import _socket +import sys from _socket import ( _FD, EAI_AGAIN as EAI_AGAIN, @@ -119,6 +112,12 @@ from _socket import ( setdefaulttimeout as setdefaulttimeout, timeout as timeout, ) +from _typeshed import ReadableBuffer, Unused, WriteableBuffer +from collections.abc import Iterable +from enum import IntEnum, IntFlag +from io import BufferedReader, BufferedRWPair, BufferedWriter, IOBase, RawIOBase, TextIOWrapper +from typing import Any, Protocol, overload +from typing_extensions import Literal, Self if sys.platform != "darwin" or sys.version_info >= (3, 9): from _socket import ( @@ -297,6 +296,20 @@ if sys.platform == "linux": CAN_RAW_RECV_OWN_MSGS as CAN_RAW_RECV_OWN_MSGS, CAN_RTR_FLAG as CAN_RTR_FLAG, CAN_SFF_MASK as CAN_SFF_MASK, + NETLINK_ARPD as NETLINK_ARPD, + NETLINK_CRYPTO as NETLINK_CRYPTO, + NETLINK_DNRTMSG as NETLINK_DNRTMSG, + NETLINK_FIREWALL as NETLINK_FIREWALL, + NETLINK_IP6_FW as NETLINK_IP6_FW, + NETLINK_NFLOG as NETLINK_NFLOG, + NETLINK_ROUTE as NETLINK_ROUTE, + NETLINK_ROUTE6 as NETLINK_ROUTE6, + NETLINK_SKIP as NETLINK_SKIP, + NETLINK_TAPBASE as NETLINK_TAPBASE, + NETLINK_TCPDIAG as NETLINK_TCPDIAG, + NETLINK_USERSOCK as NETLINK_USERSOCK, + NETLINK_W1 as NETLINK_W1, + NETLINK_XFRM as NETLINK_XFRM, PACKET_BROADCAST as PACKET_BROADCAST, PACKET_FASTROUTE as PACKET_FASTROUTE, PACKET_HOST as PACKET_HOST, @@ -642,53 +655,53 @@ class _SendableFile(Protocol): class socket(_socket.socket): def __init__( - self, family: AddressFamily | int = ..., type: SocketKind | int = ..., proto: int = ..., fileno: int | None = ... + self, family: AddressFamily | int = -1, type: SocketKind | int = -1, proto: int = -1, fileno: int | None = None ) -> None: ... - def __enter__(self: Self) -> Self: ... - def __exit__(self, *args: object) -> None: ... - def dup(self: Self) -> Self: ... # noqa: F811 + def __enter__(self) -> Self: ... + def __exit__(self, *args: Unused) -> None: ... + def dup(self) -> Self: ... # noqa: F811 def accept(self) -> tuple[socket, _RetAddress]: ... # Note that the makefile's documented windows-specific behavior is not represented # mode strings with duplicates are intentionally excluded @overload - def makefile( # type: ignore[misc] + def makefile( self, mode: Literal["b", "rb", "br", "wb", "bw", "rwb", "rbw", "wrb", "wbr", "brw", "bwr"], buffering: Literal[0], *, - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, ) -> SocketIO: ... @overload def makefile( self, mode: Literal["rwb", "rbw", "wrb", "wbr", "brw", "bwr"], - buffering: Literal[-1, 1] | None = ..., + buffering: Literal[-1, 1] | None = None, *, - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, ) -> BufferedRWPair: ... @overload def makefile( self, mode: Literal["rb", "br"], - buffering: Literal[-1, 1] | None = ..., + buffering: Literal[-1, 1] | None = None, *, - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, ) -> BufferedReader: ... @overload def makefile( self, mode: Literal["wb", "bw"], - buffering: Literal[-1, 1] | None = ..., + buffering: Literal[-1, 1] | None = None, *, - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, ) -> BufferedWriter: ... @overload def makefile( @@ -696,47 +709,46 @@ class socket(_socket.socket): mode: Literal["b", "rb", "br", "wb", "bw", "rwb", "rbw", "wrb", "wbr", "brw", "bwr"], buffering: int, *, - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, ) -> IOBase: ... @overload def makefile( self, - mode: Literal["r", "w", "rw", "wr", ""] = ..., - buffering: int | None = ..., + mode: Literal["r", "w", "rw", "wr", ""] = "r", + buffering: int | None = None, *, - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, ) -> TextIOWrapper: ... - def sendfile(self, file: _SendableFile, offset: int = ..., count: int | None = ...) -> int: ... + def sendfile(self, file: _SendableFile, offset: int = 0, count: int | None = None) -> int: ... @property - def family(self) -> AddressFamily: ... # type: ignore[override] + def family(self) -> AddressFamily: ... @property - def type(self) -> SocketKind: ... # type: ignore[override] + def type(self) -> SocketKind: ... def get_inheritable(self) -> bool: ... def set_inheritable(self, inheritable: bool) -> None: ... -def fromfd(fd: _FD, family: AddressFamily | int, type: SocketKind | int, proto: int = ...) -> socket: ... +def fromfd(fd: _FD, family: AddressFamily | int, type: SocketKind | int, proto: int = 0) -> socket: ... if sys.platform != "win32": if sys.version_info >= (3, 9): - # flags and address appear to be unused in send_fds and recv_fds def send_fds( - sock: socket, buffers: Iterable[bytes], fds: bytes | Iterable[int], flags: int = ..., address: None = ... + sock: socket, buffers: Iterable[ReadableBuffer], fds: Iterable[int], flags: Unused = 0, address: Unused = None ) -> int: ... - def recv_fds(sock: socket, bufsize: int, maxfds: int, flags: int = ...) -> tuple[bytes, list[int], int, Any]: ... + def recv_fds(sock: socket, bufsize: int, maxfds: int, flags: int = 0) -> tuple[bytes, list[int], int, Any]: ... if sys.platform == "win32": def fromshare(info: bytes) -> socket: ... if sys.platform == "win32": - def socketpair(family: int = ..., type: int = ..., proto: int = ...) -> tuple[socket, socket]: ... + def socketpair(family: int = ..., type: int = ..., proto: int = 0) -> tuple[socket, socket]: ... else: def socketpair( - family: int | AddressFamily | None = ..., type: SocketType | int = ..., proto: int = ... + family: int | AddressFamily | None = None, type: SocketType | int = ..., proto: int = 0 ) -> tuple[socket, socket]: ... class SocketIO(RawIOBase): @@ -748,31 +760,34 @@ class SocketIO(RawIOBase): @property def mode(self) -> Literal["rb", "wb", "rwb"]: ... -def getfqdn(name: str = ...) -> str: ... +def getfqdn(name: str = "") -> str: ... if sys.version_info >= (3, 11): def create_connection( address: tuple[str | None, int], timeout: float | None = ..., # noqa: F811 - source_address: tuple[bytearray | bytes | str, int] | None = ..., + source_address: _Address | None = None, *, - all_errors: bool = ..., + all_errors: bool = False, ) -> socket: ... else: def create_connection( - address: tuple[str | None, int], - timeout: float | None = ..., # noqa: F811 - source_address: tuple[bytearray | bytes | str, int] | None = ..., + address: tuple[str | None, int], timeout: float | None = ..., source_address: _Address | None = None # noqa: F811 ) -> socket: ... if sys.version_info >= (3, 8): def has_dualstack_ipv6() -> bool: ... def create_server( - address: _Address, *, family: int = ..., backlog: int | None = ..., reuse_port: bool = ..., dualstack_ipv6: bool = ... + address: _Address, + *, + family: int = ..., + backlog: int | None = None, + reuse_port: bool = False, + dualstack_ipv6: bool = False, ) -> socket: ... # the 5th tuple item is an address def getaddrinfo( - host: bytes | str | None, port: str | int | None, family: int = ..., type: int = ..., proto: int = ..., flags: int = ... + host: bytes | str | None, port: bytes | str | int | None, family: int = 0, type: int = 0, proto: int = 0, flags: int = 0 ) -> list[tuple[AddressFamily, SocketKind, int, str, tuple[str, int] | tuple[str, int, int, int]]]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/socketserver.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/socketserver.pyi index f1d127ebe..3799d82a0 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/socketserver.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/socketserver.pyi @@ -1,10 +1,11 @@ import sys import types -from _typeshed import Self +from _socket import _Address, _RetAddress +from _typeshed import ReadableBuffer from collections.abc import Callable from socket import socket as _socket -from typing import Any, BinaryIO, ClassVar, Union -from typing_extensions import TypeAlias +from typing import Any, BinaryIO, ClassVar +from typing_extensions import Self, TypeAlias __all__ = [ "BaseServer", @@ -28,40 +29,37 @@ if sys.platform != "win32": "UnixStreamServer", ] -_RequestType: TypeAlias = Union[_socket, tuple[bytes, _socket]] -_AddressType: TypeAlias = Union[tuple[str, int], str] +_RequestType: TypeAlias = _socket | tuple[bytes, _socket] +_AfUnixAddress: TypeAlias = str | ReadableBuffer # address acceptable for an AF_UNIX socket +_AfInetAddress: TypeAlias = tuple[str | bytes | bytearray, int] # address acceptable for an AF_INET socket # This can possibly be generic at some point: class BaseServer: address_family: int - server_address: tuple[str, int] + server_address: _Address socket: _socket allow_reuse_address: bool request_queue_size: int socket_type: int timeout: float | None + RequestHandlerClass: Callable[[Any, _RetAddress, Self], BaseRequestHandler] def __init__( - self: Self, server_address: Any, RequestHandlerClass: Callable[[Any, Any, Self], BaseRequestHandler] + self, server_address: _Address, RequestHandlerClass: Callable[[Any, _RetAddress, Self], BaseRequestHandler] ) -> None: ... - # It is not actually a `@property`, but we need a `Self` type: - @property - def RequestHandlerClass(self: Self) -> Callable[[Any, Any, Self], BaseRequestHandler]: ... - @RequestHandlerClass.setter - def RequestHandlerClass(self: Self, val: Callable[[Any, Any, Self], BaseRequestHandler]) -> None: ... def fileno(self) -> int: ... def handle_request(self) -> None: ... - def serve_forever(self, poll_interval: float = ...) -> None: ... + def serve_forever(self, poll_interval: float = 0.5) -> None: ... def shutdown(self) -> None: ... def server_close(self) -> None: ... - def finish_request(self, request: _RequestType, client_address: _AddressType) -> None: ... + def finish_request(self, request: _RequestType, client_address: _RetAddress) -> None: ... def get_request(self) -> tuple[Any, Any]: ... - def handle_error(self, request: _RequestType, client_address: _AddressType) -> None: ... + def handle_error(self, request: _RequestType, client_address: _RetAddress) -> None: ... def handle_timeout(self) -> None: ... - def process_request(self, request: _RequestType, client_address: _AddressType) -> None: ... + def process_request(self, request: _RequestType, client_address: _RetAddress) -> None: ... def server_activate(self) -> None: ... def server_bind(self) -> None: ... - def verify_request(self, request: _RequestType, client_address: _AddressType) -> bool: ... - def __enter__(self: Self) -> Self: ... + def verify_request(self, request: _RequestType, client_address: _RetAddress) -> bool: ... + def __enter__(self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: types.TracebackType | None ) -> None: ... @@ -70,37 +68,38 @@ class BaseServer: def close_request(self, request: _RequestType) -> None: ... # undocumented class TCPServer(BaseServer): - allow_reuse_port: bool - request_queue_size: int + if sys.version_info >= (3, 11): + allow_reuse_port: bool + server_address: _AfInetAddress def __init__( - self: Self, - server_address: tuple[str, int], - RequestHandlerClass: Callable[[Any, Any, Self], BaseRequestHandler], - bind_and_activate: bool = ..., + self, + server_address: _AfInetAddress, + RequestHandlerClass: Callable[[Any, _RetAddress, Self], BaseRequestHandler], + bind_and_activate: bool = True, ) -> None: ... - def get_request(self) -> tuple[_socket, Any]: ... + def get_request(self) -> tuple[_socket, _RetAddress]: ... -class UDPServer(BaseServer): - if sys.version_info >= (3, 11): - allow_reuse_port: bool +class UDPServer(TCPServer): max_packet_size: ClassVar[int] - def get_request(self) -> tuple[tuple[bytes, _socket], Any]: ... + def get_request(self) -> tuple[tuple[bytes, _socket], _RetAddress]: ... # type: ignore[override] if sys.platform != "win32": class UnixStreamServer(BaseServer): + server_address: _AfUnixAddress # type: ignore[assignment] def __init__( - self: Self, - server_address: str | bytes, - RequestHandlerClass: Callable[[Any, Any, Self], BaseRequestHandler], - bind_and_activate: bool = ..., + self, + server_address: _AfUnixAddress, + RequestHandlerClass: Callable[[Any, _RetAddress, Self], BaseRequestHandler], + bind_and_activate: bool = True, ) -> None: ... class UnixDatagramServer(BaseServer): + server_address: _AfUnixAddress # type: ignore[assignment] def __init__( - self: Self, - server_address: str | bytes, - RequestHandlerClass: Callable[[Any, Any, Self], BaseRequestHandler], - bind_and_activate: bool = ..., + self, + server_address: _AfUnixAddress, + RequestHandlerClass: Callable[[Any, _RetAddress, Self], BaseRequestHandler], + bind_and_activate: bool = True, ) -> None: ... if sys.platform != "win32": @@ -109,17 +108,17 @@ if sys.platform != "win32": active_children: set[int] | None # undocumented max_children: int # undocumented block_on_close: bool - def collect_children(self, *, blocking: bool = ...) -> None: ... # undocumented + def collect_children(self, *, blocking: bool = False) -> None: ... # undocumented def handle_timeout(self) -> None: ... # undocumented def service_actions(self) -> None: ... # undocumented - def process_request(self, request: _RequestType, client_address: _AddressType) -> None: ... + def process_request(self, request: _RequestType, client_address: _RetAddress) -> None: ... def server_close(self) -> None: ... class ThreadingMixIn: daemon_threads: bool block_on_close: bool - def process_request_thread(self, request: _RequestType, client_address: _AddressType) -> None: ... # undocumented - def process_request(self, request: _RequestType, client_address: _AddressType) -> None: ... + def process_request_thread(self, request: _RequestType, client_address: _RetAddress) -> None: ... # undocumented + def process_request(self, request: _RequestType, client_address: _RetAddress) -> None: ... def server_close(self) -> None: ... if sys.platform != "win32": @@ -134,16 +133,16 @@ if sys.platform != "win32": class ThreadingUnixDatagramServer(ThreadingMixIn, UnixDatagramServer): ... class BaseRequestHandler: - # Those are technically of types, respectively: - # * _RequestType - # * _AddressType - # But there are some concerns that having unions here would cause + # `request` is technically of type _RequestType, + # but there are some concerns that having a union here would cause # too much inconvenience to people using it (see # https://github.com/python/typeshed/pull/384#issuecomment-234649696) + # + # Note also that _RetAddress is also just an alias for `Any` request: Any - client_address: Any + client_address: _RetAddress server: BaseServer - def __init__(self, request: _RequestType, client_address: _AddressType, server: BaseServer) -> None: ... + def __init__(self, request: _RequestType, client_address: _RetAddress, server: BaseServer) -> None: ... def setup(self) -> None: ... def handle(self) -> None: ... def finish(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/sqlite3/dbapi2.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/sqlite3/dbapi2.pyi index 83d2df1e6..da58c3aa9 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/sqlite3/dbapi2.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/sqlite3/dbapi2.pyi @@ -1,11 +1,11 @@ import sqlite3 import sys -from _typeshed import ReadableBuffer, Self, StrOrBytesPath, SupportsLenAndGetItem +from _typeshed import Incomplete, ReadableBuffer, StrOrBytesPath, SupportsLenAndGetItem, Unused from collections.abc import Callable, Generator, Iterable, Iterator, Mapping from datetime import date, datetime, time from types import TracebackType from typing import Any, Protocol, TypeVar, overload -from typing_extensions import Literal, SupportsIndex, TypeAlias, final +from typing_extensions import Literal, Self, SupportsIndex, TypeAlias, final _T = TypeVar("_T") _CursorT = TypeVar("_CursorT", bound=Cursor) @@ -217,7 +217,7 @@ def enable_callback_tracebacks(__enable: bool) -> None: ... # takes a pos-or-keyword argument because there is a C wrapper def enable_shared_cache(enable: int) -> None: ... -if sys.version_info >= (3, 11): +if sys.version_info >= (3, 10): def register_adapter(__type: type[_T], __adapter: _Adapter[_T]) -> None: ... def register_converter(__typename: str, __converter: _Converter) -> None: ... @@ -227,9 +227,9 @@ else: if sys.version_info < (3, 8): class Cache: - def __init__(self, *args, **kwargs) -> None: ... - def display(self, *args, **kwargs) -> None: ... - def get(self, *args, **kwargs) -> None: ... + def __init__(self, *args: Incomplete, **kwargs: Unused) -> None: ... + def display(self, *args: Incomplete, **kwargs: Incomplete) -> None: ... + def get(self, *args: Incomplete, **kwargs: Incomplete) -> None: ... class _AggregateProtocol(Protocol): def step(self, __value: int) -> object: ... @@ -294,7 +294,7 @@ class Connection: ) -> None: ... def close(self) -> None: ... if sys.version_info >= (3, 11): - def blobopen(self, __table: str, __column: str, __row: int, *, readonly: bool = ..., name: str = ...) -> Blob: ... + def blobopen(self, __table: str, __column: str, __row: int, *, readonly: bool = False, name: str = "main") -> Blob: ... def commit(self) -> None: ... def create_aggregate(self, name: str, n_arg: int, aggregate_class: Callable[[], _AggregateProtocol]) -> None: ... @@ -318,13 +318,13 @@ class Connection: def create_collation(self, __name: str, __callback: Callable[[str, str], int | SupportsIndex] | None) -> None: ... if sys.version_info >= (3, 8): def create_function( - self, name: str, narg: int, func: Callable[..., _SqliteData], *, deterministic: bool = ... + self, name: str, narg: int, func: Callable[..., _SqliteData] | None, *, deterministic: bool = False ) -> None: ... else: - def create_function(self, name: str, num_params: int, func: Callable[..., _SqliteData]) -> None: ... + def create_function(self, name: str, num_params: int, func: Callable[..., _SqliteData] | None) -> None: ... @overload - def cursor(self, cursorClass: None = ...) -> Cursor: ... + def cursor(self, cursorClass: None = None) -> Cursor: ... @overload def cursor(self, cursorClass: Callable[[], _CursorT]) -> _CursorT: ... def execute(self, sql: str, parameters: _Parameters = ...) -> Cursor: ... @@ -340,25 +340,25 @@ class Connection: def set_trace_callback(self, trace_callback: Callable[[str], object] | None) -> None: ... # enable_load_extension and load_extension is not available on python distributions compiled # without sqlite3 loadable extension support. see footnotes https://docs.python.org/3/library/sqlite3.html#f1 - def enable_load_extension(self, __enabled: bool) -> None: ... + def enable_load_extension(self, __enable: bool) -> None: ... def load_extension(self, __name: str) -> None: ... def backup( self, target: Connection, *, - pages: int = ..., - progress: Callable[[int, int, int], object] | None = ..., - name: str = ..., - sleep: float = ..., + pages: int = -1, + progress: Callable[[int, int, int], object] | None = None, + name: str = "main", + sleep: float = 0.25, ) -> None: ... if sys.version_info >= (3, 11): def setlimit(self, __category: int, __limit: int) -> int: ... def getlimit(self, __category: int) -> int: ... - def serialize(self, *, name: str = ...) -> bytes: ... - def deserialize(self, __data: ReadableBuffer, *, name: str = ...) -> None: ... + def serialize(self, *, name: str = "main") -> bytes: ... + def deserialize(self, __data: ReadableBuffer, *, name: str = "main") -> None: ... def __call__(self, __sql: str) -> _Statement: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, __type: type[BaseException] | None, __value: BaseException | None, __traceback: TracebackType | None ) -> Literal[False]: ... @@ -377,17 +377,17 @@ class Cursor(Iterator[Any]): def rowcount(self) -> int: ... def __init__(self, __cursor: Connection) -> None: ... def close(self) -> None: ... - def execute(self: Self, __sql: str, __parameters: _Parameters = ...) -> Self: ... - def executemany(self: Self, __sql: str, __seq_of_parameters: Iterable[_Parameters]) -> Self: ... + def execute(self, __sql: str, __parameters: _Parameters = ...) -> Self: ... + def executemany(self, __sql: str, __seq_of_parameters: Iterable[_Parameters]) -> Self: ... def executescript(self, __sql_script: str) -> Cursor: ... def fetchall(self) -> list[Any]: ... - def fetchmany(self, size: int | None = ...) -> list[Any]: ... + def fetchmany(self, size: int | None = 1) -> list[Any]: ... # Returns either a row (as created by the row_factory) or None, but # putting None in the return annotation causes annoying false positives. def fetchone(self) -> Any: ... - def setinputsizes(self, __sizes: object) -> None: ... # does nothing - def setoutputsize(self, __size: object, __column: object = ...) -> None: ... # does nothing - def __iter__(self: Self) -> Self: ... + def setinputsizes(self, __sizes: Unused) -> None: ... # does nothing + def setoutputsize(self, __size: Unused, __column: Unused = None) -> None: ... # does nothing + def __iter__(self) -> Self: ... def __next__(self) -> Any: ... class DataError(DatabaseError): ... @@ -417,18 +417,18 @@ class Row: def __init__(self, __cursor: Cursor, __data: tuple[Any, ...]) -> None: ... def keys(self) -> list[str]: ... @overload - def __getitem__(self, __index: int | str) -> Any: ... + def __getitem__(self, __key: int | str) -> Any: ... @overload - def __getitem__(self, __index: slice) -> tuple[Any, ...]: ... + def __getitem__(self, __key: slice) -> tuple[Any, ...]: ... def __iter__(self) -> Iterator[Any]: ... def __len__(self) -> int: ... # These return NotImplemented for anything that is not a Row. - def __eq__(self, __other: object) -> bool: ... - def __ge__(self, __other: object) -> bool: ... - def __gt__(self, __other: object) -> bool: ... - def __le__(self, __other: object) -> bool: ... - def __lt__(self, __other: object) -> bool: ... - def __ne__(self, __other: object) -> bool: ... + def __eq__(self, __value: object) -> bool: ... + def __ge__(self, __value: object) -> bool: ... + def __gt__(self, __value: object) -> bool: ... + def __le__(self, __value: object) -> bool: ... + def __lt__(self, __value: object) -> bool: ... + def __ne__(self, __value: object) -> bool: ... if sys.version_info >= (3, 8): @final @@ -437,7 +437,7 @@ if sys.version_info >= (3, 8): else: @final class Statement: - def __init__(self, *args, **kwargs): ... + def __init__(self, *args: Incomplete, **kwargs: Incomplete) -> None: ... _Statement: TypeAlias = Statement class Warning(Exception): ... @@ -446,13 +446,13 @@ if sys.version_info >= (3, 11): @final class Blob: def close(self) -> None: ... - def read(self, __length: int = ...) -> bytes: ... - def write(self, __data: bytes) -> None: ... + def read(self, __length: int = -1) -> bytes: ... + def write(self, __data: ReadableBuffer) -> None: ... def tell(self) -> int: ... # whence must be one of os.SEEK_SET, os.SEEK_CUR, os.SEEK_END - def seek(self, __offset: int, __origin: int = ...) -> None: ... + def seek(self, __offset: int, __origin: int = 0) -> None: ... def __len__(self) -> int: ... - def __enter__(self: Self) -> Self: ... - def __exit__(self, __typ: object, __val: object, __tb: object) -> Literal[False]: ... - def __getitem__(self, __item: SupportsIndex | slice) -> int: ... - def __setitem__(self, __item: SupportsIndex | slice, __value: int) -> None: ... + def __enter__(self) -> Self: ... + def __exit__(self, __type: object, __val: object, __tb: object) -> Literal[False]: ... + def __getitem__(self, __key: SupportsIndex | slice) -> int: ... + def __setitem__(self, __key: SupportsIndex | slice, __value: int) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/sre_compile.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/sre_compile.pyi index a9f4d577d..2d04a886c 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/sre_compile.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/sre_compile.pyi @@ -8,4 +8,4 @@ MAXCODE: int def dis(code: list[_NamedIntConstant]) -> None: ... def isstring(obj: Any) -> bool: ... -def compile(p: str | bytes | SubPattern, flags: int = ...) -> Pattern[Any]: ... +def compile(p: str | bytes | SubPattern, flags: int = 0) -> Pattern[Any]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/sre_constants.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/sre_constants.pyi index e7344fae3..d522372c4 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/sre_constants.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/sre_constants.pyi @@ -1,6 +1,6 @@ import sys -from _typeshed import Self from typing import Any +from typing_extensions import Self MAXGROUPS: int @@ -12,11 +12,11 @@ class error(Exception): pos: int | None lineno: int colno: int - def __init__(self, msg: str, pattern: str | bytes | None = ..., pos: int | None = ...) -> None: ... + def __init__(self, msg: str, pattern: str | bytes | None = None, pos: int | None = None) -> None: ... class _NamedIntConstant(int): name: Any - def __new__(cls: type[Self], value: int, name: str) -> Self: ... + def __new__(cls, value: int, name: str) -> Self: ... MAXREPEAT: _NamedIntConstant OPCODES: list[_NamedIntConstant] @@ -79,6 +79,10 @@ REPEAT: _NamedIntConstant REPEAT_ONE: _NamedIntConstant SUBPATTERN: _NamedIntConstant MIN_REPEAT_ONE: _NamedIntConstant +if sys.version_info >= (3, 11): + ATOMIC_GROUP: _NamedIntConstant + POSSESSIVE_REPEAT: _NamedIntConstant + POSSESSIVE_REPEAT_ONE: _NamedIntConstant RANGE_UNI_IGNORE: _NamedIntConstant GROUPREF_LOC_IGNORE: _NamedIntConstant GROUPREF_UNI_IGNORE: _NamedIntConstant diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/sre_parse.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/sre_parse.pyi index e4d66d1ba..56f10bb41 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/sre_parse.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/sre_parse.pyi @@ -27,7 +27,6 @@ class _State: groupdict: dict[str, int] groupwidths: list[int | None] lookbehindgroups: int | None - def __init__(self) -> None: ... @property def groups(self) -> int: ... def opengroup(self, name: str | None = ...) -> int: ... @@ -53,12 +52,12 @@ class SubPattern: if sys.version_info >= (3, 8): state: State - def __init__(self, state: State, data: list[_CodeType] | None = ...) -> None: ... + def __init__(self, state: State, data: list[_CodeType] | None = None) -> None: ... else: pattern: Pattern - def __init__(self, pattern: Pattern, data: list[_CodeType] | None = ...) -> None: ... + def __init__(self, pattern: Pattern, data: list[_CodeType] | None = None) -> None: ... - def dump(self, level: int = ...) -> None: ... + def dump(self, level: int = 0) -> None: ... def __len__(self) -> int: ... def __delitem__(self, index: int | slice) -> None: ... def __getitem__(self, index: int | slice) -> SubPattern | _CodeType: ... @@ -86,7 +85,7 @@ class Tokenizer: def pos(self) -> int: ... def tell(self) -> int: ... def seek(self, index: int) -> None: ... - def error(self, msg: str, offset: int = ...) -> _Error: ... + def error(self, msg: str, offset: int = 0) -> _Error: ... if sys.version_info >= (3, 11): def checkgroupname(self, name: str, offset: int, nested: int) -> None: ... @@ -96,14 +95,14 @@ def fix_flags(src: str | bytes, flags: int) -> int: ... _TemplateType: TypeAlias = tuple[list[tuple[int, int]], list[str | None]] _TemplateByteType: TypeAlias = tuple[list[tuple[int, int]], list[bytes | None]] if sys.version_info >= (3, 8): - def parse(str: str, flags: int = ..., state: State | None = ...) -> SubPattern: ... + def parse(str: str, flags: int = 0, state: State | None = None) -> SubPattern: ... @overload def parse_template(source: str, state: _Pattern[Any]) -> _TemplateType: ... @overload def parse_template(source: bytes, state: _Pattern[Any]) -> _TemplateByteType: ... else: - def parse(str: str, flags: int = ..., pattern: Pattern | None = ...) -> SubPattern: ... + def parse(str: str, flags: int = 0, pattern: Pattern | None = None) -> SubPattern: ... @overload def parse_template(source: str, pattern: _Pattern[Any]) -> _TemplateType: ... @overload diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/ssl.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/ssl.pyi index 09c8d0778..20b8802bd 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/ssl.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/ssl.pyi @@ -1,17 +1,17 @@ import enum import socket import sys -from _typeshed import ReadableBuffer, Self, StrOrBytesPath, WriteableBuffer +from _typeshed import ReadableBuffer, StrOrBytesPath, WriteableBuffer from collections.abc import Callable, Iterable -from typing import Any, NamedTuple, Union, overload -from typing_extensions import Literal, TypeAlias, TypedDict, final +from typing import Any, NamedTuple, overload +from typing_extensions import Literal, Self, TypeAlias, TypedDict, final _PCTRTT: TypeAlias = tuple[tuple[str, str], ...] _PCTRTTT: TypeAlias = tuple[_PCTRTT, ...] _PeerCertRetDictType: TypeAlias = dict[str, str | _PCTRTTT | _PCTRTT] _PeerCertRetType: TypeAlias = _PeerCertRetDictType | bytes | None _EnumRetType: TypeAlias = list[tuple[bytes, str, set[str] | bool]] -_PasswordType: TypeAlias = Union[Callable[[], str | bytes], str, bytes] +_PasswordType: TypeAlias = Callable[[], str | bytes | bytearray] | str | bytes | bytearray _SrvnmeCbType: TypeAlias = Callable[[SSLSocket | SSLObject, str | None, SSLSocket], int | None] @@ -46,55 +46,74 @@ CertificateError = SSLCertVerificationError def wrap_socket( sock: socket.socket, - keyfile: StrOrBytesPath | None = ..., - certfile: StrOrBytesPath | None = ..., - server_side: bool = ..., + keyfile: StrOrBytesPath | None = None, + certfile: StrOrBytesPath | None = None, + server_side: bool = False, cert_reqs: int = ..., ssl_version: int = ..., - ca_certs: str | None = ..., - do_handshake_on_connect: bool = ..., - suppress_ragged_eofs: bool = ..., - ciphers: str | None = ..., + ca_certs: str | None = None, + do_handshake_on_connect: bool = True, + suppress_ragged_eofs: bool = True, + ciphers: str | None = None, ) -> SSLSocket: ... def create_default_context( purpose: Purpose = ..., *, - cafile: StrOrBytesPath | None = ..., - capath: StrOrBytesPath | None = ..., - cadata: str | bytes | None = ..., -) -> SSLContext: ... -def _create_unverified_context( - protocol: int = ..., - *, - cert_reqs: int = ..., - check_hostname: bool = ..., - purpose: Purpose = ..., - certfile: StrOrBytesPath | None = ..., - keyfile: StrOrBytesPath | None = ..., - cafile: StrOrBytesPath | None = ..., - capath: StrOrBytesPath | None = ..., - cadata: str | bytes | None = ..., + cafile: StrOrBytesPath | None = None, + capath: StrOrBytesPath | None = None, + cadata: str | ReadableBuffer | None = None, ) -> SSLContext: ... +if sys.version_info >= (3, 10): + def _create_unverified_context( + protocol: int | None = None, + *, + cert_reqs: int = ..., + check_hostname: bool = False, + purpose: Purpose = ..., + certfile: StrOrBytesPath | None = None, + keyfile: StrOrBytesPath | None = None, + cafile: StrOrBytesPath | None = None, + capath: StrOrBytesPath | None = None, + cadata: str | ReadableBuffer | None = None, + ) -> SSLContext: ... + +else: + def _create_unverified_context( + protocol: int = ..., + *, + cert_reqs: int = ..., + check_hostname: bool = False, + purpose: Purpose = ..., + certfile: StrOrBytesPath | None = None, + keyfile: StrOrBytesPath | None = None, + cafile: StrOrBytesPath | None = None, + capath: StrOrBytesPath | None = None, + cadata: str | ReadableBuffer | None = None, + ) -> SSLContext: ... + _create_default_https_context: Callable[..., SSLContext] -def RAND_bytes(__num: int) -> bytes: ... -def RAND_pseudo_bytes(__num: int) -> tuple[bytes, bool]: ... +def RAND_bytes(__n: int) -> bytes: ... +def RAND_pseudo_bytes(__n: int) -> tuple[bytes, bool]: ... def RAND_status() -> bool: ... def RAND_egd(path: str) -> None: ... -def RAND_add(__s: bytes, __entropy: float) -> None: ... -def match_hostname(cert: _PeerCertRetType, hostname: str) -> None: ... +def RAND_add(__string: str | ReadableBuffer, __entropy: float) -> None: ... + +if sys.version_info < (3, 12): + def match_hostname(cert: _PeerCertRetDictType, hostname: str) -> None: ... + def cert_time_to_seconds(cert_time: str) -> int: ... if sys.version_info >= (3, 10): def get_server_certificate( - addr: tuple[str, int], ssl_version: int = ..., ca_certs: str | None = ..., timeout: float = ... + addr: tuple[str, int], ssl_version: int = ..., ca_certs: str | None = None, timeout: float = ... ) -> str: ... else: - def get_server_certificate(addr: tuple[str, int], ssl_version: int = ..., ca_certs: str | None = ...) -> str: ... + def get_server_certificate(addr: tuple[str, int], ssl_version: int = ..., ca_certs: str | None = None) -> str: ... -def DER_cert_to_PEM_cert(der_cert_bytes: bytes) -> str: ... +def DER_cert_to_PEM_cert(der_cert_bytes: ReadableBuffer) -> str: ... def PEM_cert_to_DER_cert(pem_cert_string: str) -> bytes: ... class DefaultVerifyPaths(NamedTuple): @@ -177,6 +196,8 @@ class Options(enum.IntFlag): OP_NO_RENEGOTIATION: int if sys.version_info >= (3, 8): OP_ENABLE_MIDDLEBOX_COMPAT: int + if sys.platform == "linux": + OP_IGNORE_UNEXPECTED_EOF: int OP_ALL: Options OP_NO_SSLv2: Options @@ -193,6 +214,8 @@ OP_NO_TICKET: Options OP_NO_RENEGOTIATION: Options if sys.version_info >= (3, 8): OP_ENABLE_MIDDLEBOX_COMPAT: Options + if sys.platform == "linux": + OP_IGNORE_UNEXPECTED_EOF: Options HAS_NEVER_CHECK_COMMON_NAME: bool HAS_SSLv2: bool @@ -268,15 +291,18 @@ ALERT_DESCRIPTION_UNSUPPORTED_CERTIFICATE: AlertDescription ALERT_DESCRIPTION_UNSUPPORTED_EXTENSION: AlertDescription ALERT_DESCRIPTION_USER_CANCELLED: AlertDescription -class _ASN1Object(NamedTuple): +class _ASN1ObjectBase(NamedTuple): nid: int shortname: str longname: str oid: str + +class _ASN1Object(_ASN1ObjectBase): + def __new__(cls, oid: str) -> Self: ... @classmethod - def fromnid(cls: type[Self], nid: int) -> Self: ... + def fromnid(cls, nid: int) -> Self: ... @classmethod - def fromname(cls: type[Self], name: str) -> Self: ... + def fromname(cls, name: str) -> Self: ... class Purpose(_ASN1Object, enum.Enum): SERVER_AUTH: _ASN1Object @@ -290,26 +316,26 @@ class SSLSocket(socket.socket): @property def session_reused(self) -> bool | None: ... def __init__(self, *args: Any, **kwargs: Any) -> None: ... - def connect(self, addr: socket._Address | bytes) -> None: ... - def connect_ex(self, addr: socket._Address | bytes) -> int: ... - def recv(self, buflen: int = ..., flags: int = ...) -> bytes: ... - def recv_into(self, buffer: WriteableBuffer, nbytes: int | None = ..., flags: int = ...) -> int: ... - def recvfrom(self, buflen: int = ..., flags: int = ...) -> tuple[bytes, socket._RetAddress]: ... + def connect(self, addr: socket._Address) -> None: ... + def connect_ex(self, addr: socket._Address) -> int: ... + def recv(self, buflen: int = 1024, flags: int = 0) -> bytes: ... + def recv_into(self, buffer: WriteableBuffer, nbytes: int | None = None, flags: int = 0) -> int: ... + def recvfrom(self, buflen: int = 1024, flags: int = 0) -> tuple[bytes, socket._RetAddress]: ... def recvfrom_into( - self, buffer: WriteableBuffer, nbytes: int | None = ..., flags: int = ... + self, buffer: WriteableBuffer, nbytes: int | None = None, flags: int = 0 ) -> tuple[int, socket._RetAddress]: ... - def send(self, data: ReadableBuffer, flags: int = ...) -> int: ... - def sendall(self, data: ReadableBuffer, flags: int = ...) -> None: ... + def send(self, data: ReadableBuffer, flags: int = 0) -> int: ... + def sendall(self, data: ReadableBuffer, flags: int = 0) -> None: ... @overload - def sendto(self, data: ReadableBuffer, flags_or_addr: socket._Address) -> int: ... + def sendto(self, data: ReadableBuffer, flags_or_addr: socket._Address, addr: None = None) -> int: ... @overload - def sendto(self, data: ReadableBuffer, flags_or_addr: int | socket._Address, addr: socket._Address | None = ...) -> int: ... + def sendto(self, data: ReadableBuffer, flags_or_addr: int, addr: socket._Address) -> int: ... def shutdown(self, how: int) -> None: ... - def read(self, len: int = ..., buffer: bytearray | None = ...) -> bytes: ... - def write(self, data: bytes) -> int: ... - def do_handshake(self, block: bool = ...) -> None: ... # block is undocumented + def read(self, len: int = 1024, buffer: bytearray | None = None) -> bytes: ... + def write(self, data: ReadableBuffer) -> int: ... + def do_handshake(self, block: bool = False) -> None: ... # block is undocumented @overload - def getpeercert(self, binary_form: Literal[False] = ...) -> _PeerCertRetDictType | None: ... + def getpeercert(self, binary_form: Literal[False] = False) -> _PeerCertRetDictType | None: ... @overload def getpeercert(self, binary_form: Literal[True]) -> bytes | None: ... @overload @@ -317,7 +343,7 @@ class SSLSocket(socket.socket): def cipher(self) -> tuple[str, str, int] | None: ... def shared_ciphers(self) -> list[tuple[str, str, int]] | None: ... def compression(self) -> str | None: ... - def get_channel_binding(self, cb_type: str = ...) -> bytes | None: ... + def get_channel_binding(self, cb_type: str = "tls-unique") -> bytes | None: ... def selected_alpn_protocol(self) -> str | None: ... def selected_npn_protocol(self) -> str | None: ... def accept(self) -> tuple[SSLSocket, socket._RetAddress]: ... @@ -355,22 +381,32 @@ class SSLContext: if sys.version_info >= (3, 8): keylog_filename: str post_handshake_auth: bool - def __new__(cls: type[Self], protocol: int = ..., *args: Any, **kwargs: Any) -> Self: ... - def __init__(self, protocol: int = ...) -> None: ... + if sys.version_info >= (3, 10): + security_level: int + if sys.version_info >= (3, 10): + # Using the default (None) for the `protocol` parameter is deprecated, + # but there isn't a good way of marking that in the stub unless/until PEP 702 is accepted + def __new__(cls, protocol: int | None = None, *args: Any, **kwargs: Any) -> Self: ... + else: + def __new__(cls, protocol: int = ..., *args: Any, **kwargs: Any) -> Self: ... + def cert_store_stats(self) -> dict[str, int]: ... def load_cert_chain( - self, certfile: StrOrBytesPath, keyfile: StrOrBytesPath | None = ..., password: _PasswordType | None = ... + self, certfile: StrOrBytesPath, keyfile: StrOrBytesPath | None = None, password: _PasswordType | None = None ) -> None: ... def load_default_certs(self, purpose: Purpose = ...) -> None: ... def load_verify_locations( - self, cafile: StrOrBytesPath | None = ..., capath: StrOrBytesPath | None = ..., cadata: str | bytes | None = ... + self, + cafile: StrOrBytesPath | None = None, + capath: StrOrBytesPath | None = None, + cadata: str | ReadableBuffer | None = None, ) -> None: ... @overload - def get_ca_certs(self, binary_form: Literal[False] = ...) -> list[_PeerCertRetDictType]: ... + def get_ca_certs(self, binary_form: Literal[False] = False) -> list[_PeerCertRetDictType]: ... @overload def get_ca_certs(self, binary_form: Literal[True]) -> list[bytes]: ... @overload - def get_ca_certs(self, binary_form: bool = ...) -> Any: ... + def get_ca_certs(self, binary_form: bool = False) -> Any: ... def get_ciphers(self) -> list[_Cipher]: ... def set_default_verify_paths(self) -> None: ... def set_ciphers(self, __cipherlist: str) -> None: ... @@ -382,19 +418,19 @@ class SSLContext: def wrap_socket( self, sock: socket.socket, - server_side: bool = ..., - do_handshake_on_connect: bool = ..., - suppress_ragged_eofs: bool = ..., - server_hostname: str | None = ..., - session: SSLSession | None = ..., + server_side: bool = False, + do_handshake_on_connect: bool = True, + suppress_ragged_eofs: bool = True, + server_hostname: str | None = None, + session: SSLSession | None = None, ) -> SSLSocket: ... def wrap_bio( self, incoming: MemoryBIO, outgoing: MemoryBIO, - server_side: bool = ..., - server_hostname: str | None = ..., - session: SSLSession | None = ..., + server_side: bool = False, + server_hostname: str | None = None, + session: SSLSession | None = None, ) -> SSLObject: ... def session_stats(self) -> dict[str, int]: ... @@ -408,10 +444,10 @@ class SSLObject: @property def session_reused(self) -> bool: ... def __init__(self, *args: Any, **kwargs: Any) -> None: ... - def read(self, len: int = ..., buffer: bytearray | None = ...) -> bytes: ... - def write(self, data: bytes) -> int: ... + def read(self, len: int = 1024, buffer: bytearray | None = None) -> bytes: ... + def write(self, data: ReadableBuffer) -> int: ... @overload - def getpeercert(self, binary_form: Literal[False] = ...) -> _PeerCertRetDictType | None: ... + def getpeercert(self, binary_form: Literal[False] = False) -> _PeerCertRetDictType | None: ... @overload def getpeercert(self, binary_form: Literal[True]) -> bytes | None: ... @overload @@ -425,7 +461,7 @@ class SSLObject: def do_handshake(self) -> None: ... def unwrap(self) -> None: ... def version(self) -> str | None: ... - def get_channel_binding(self, cb_type: str = ...) -> bytes | None: ... + def get_channel_binding(self, cb_type: str = "tls-unique") -> bytes | None: ... if sys.version_info >= (3, 8): def verify_client_post_handshake(self) -> None: ... @@ -433,17 +469,22 @@ class SSLObject: class MemoryBIO: pending: int eof: bool - def read(self, __size: int = ...) -> bytes: ... - def write(self, __buf: bytes) -> int: ... + def read(self, __size: int = -1) -> bytes: ... + def write(self, __b: ReadableBuffer) -> int: ... def write_eof(self) -> None: ... @final class SSLSession: - id: bytes - time: int - timeout: int - ticket_lifetime_hint: int - has_ticket: bool + @property + def has_ticket(self) -> bool: ... + @property + def id(self) -> bytes: ... + @property + def ticket_lifetime_hint(self) -> int: ... + @property + def time(self) -> int: ... + @property + def timeout(self) -> int: ... class SSLErrorNumber(enum.IntEnum): SSL_ERROR_EOF: int diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/statistics.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/statistics.pyi index a01665ad8..1358b1f90 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/statistics.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/statistics.pyi @@ -1,10 +1,10 @@ import sys -from _typeshed import Self, SupportsRichComparisonT +from _typeshed import SupportsRichComparisonT from collections.abc import Hashable, Iterable, Sequence from decimal import Decimal from fractions import Fraction from typing import Any, NamedTuple, SupportsFloat, TypeVar -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal, Self, TypeAlias __all__ = [ "StatisticsError", @@ -37,7 +37,7 @@ _HashableT = TypeVar("_HashableT", bound=Hashable) class StatisticsError(ValueError): ... if sys.version_info >= (3, 11): - def fmean(data: Iterable[SupportsFloat], weights: Iterable[SupportsFloat] | None = ...) -> float: ... + def fmean(data: Iterable[SupportsFloat], weights: Iterable[SupportsFloat] | None = None) -> float: ... elif sys.version_info >= (3, 8): def fmean(data: Iterable[SupportsFloat]) -> float: ... @@ -48,7 +48,7 @@ if sys.version_info >= (3, 8): def mean(data: Iterable[_NumberT]) -> _NumberT: ... if sys.version_info >= (3, 10): - def harmonic_mean(data: Iterable[_NumberT], weights: Iterable[_Number] | None = ...) -> _NumberT: ... + def harmonic_mean(data: Iterable[_NumberT], weights: Iterable[_Number] | None = None) -> _NumberT: ... else: def harmonic_mean(data: Iterable[_NumberT]) -> _NumberT: ... @@ -58,30 +58,30 @@ def median_low(data: Iterable[SupportsRichComparisonT]) -> SupportsRichCompariso def median_high(data: Iterable[SupportsRichComparisonT]) -> SupportsRichComparisonT: ... if sys.version_info >= (3, 11): - def median_grouped(data: Iterable[SupportsFloat], interval: SupportsFloat = ...) -> float: ... + def median_grouped(data: Iterable[SupportsFloat], interval: SupportsFloat = 1.0) -> float: ... else: - def median_grouped(data: Iterable[_NumberT], interval: _NumberT = ...) -> _NumberT | float: ... + def median_grouped(data: Iterable[_NumberT], interval: _NumberT | float = 1) -> _NumberT | float: ... def mode(data: Iterable[_HashableT]) -> _HashableT: ... if sys.version_info >= (3, 8): def multimode(data: Iterable[_HashableT]) -> list[_HashableT]: ... -def pstdev(data: Iterable[_NumberT], mu: _NumberT | None = ...) -> _NumberT: ... -def pvariance(data: Iterable[_NumberT], mu: _NumberT | None = ...) -> _NumberT: ... +def pstdev(data: Iterable[_NumberT], mu: _NumberT | None = None) -> _NumberT: ... +def pvariance(data: Iterable[_NumberT], mu: _NumberT | None = None) -> _NumberT: ... if sys.version_info >= (3, 8): def quantiles( - data: Iterable[_NumberT], *, n: int = ..., method: Literal["inclusive", "exclusive"] = ... + data: Iterable[_NumberT], *, n: int = 4, method: Literal["inclusive", "exclusive"] = "exclusive" ) -> list[_NumberT]: ... -def stdev(data: Iterable[_NumberT], xbar: _NumberT | None = ...) -> _NumberT: ... -def variance(data: Iterable[_NumberT], xbar: _NumberT | None = ...) -> _NumberT: ... +def stdev(data: Iterable[_NumberT], xbar: _NumberT | None = None) -> _NumberT: ... +def variance(data: Iterable[_NumberT], xbar: _NumberT | None = None) -> _NumberT: ... if sys.version_info >= (3, 8): class NormalDist: - def __init__(self, mu: float = ..., sigma: float = ...) -> None: ... + def __init__(self, mu: float = 0.0, sigma: float = 1.0) -> None: ... @property def mean(self) -> float: ... @property @@ -93,13 +93,13 @@ if sys.version_info >= (3, 8): @property def variance(self) -> float: ... @classmethod - def from_samples(cls: type[Self], data: Iterable[SupportsFloat]) -> Self: ... - def samples(self, n: int, *, seed: Any | None = ...) -> list[float]: ... + def from_samples(cls, data: Iterable[SupportsFloat]) -> Self: ... + def samples(self, n: int, *, seed: Any | None = None) -> list[float]: ... def pdf(self, x: float) -> float: ... def cdf(self, x: float) -> float: ... def inv_cdf(self, p: float) -> float: ... def overlap(self, other: NormalDist) -> float: ... - def quantiles(self, n: int = ...) -> list[float]: ... + def quantiles(self, n: int = 4) -> list[float]: ... if sys.version_info >= (3, 9): def zscore(self, x: float) -> float: ... @@ -124,7 +124,7 @@ if sys.version_info >= (3, 10): if sys.version_info >= (3, 11): def linear_regression( - __regressor: Sequence[_Number], __dependent_variable: Sequence[_Number], *, proportional: bool = ... + __regressor: Sequence[_Number], __dependent_variable: Sequence[_Number], *, proportional: bool = False ) -> LinearRegression: ... elif sys.version_info >= (3, 10): diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/string.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/string.pyi index 1b9ba5b58..dc9a449e0 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/string.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/string.pyi @@ -2,8 +2,8 @@ import sys from _typeshed import StrOrLiteralStr from collections.abc import Iterable, Mapping, Sequence from re import Pattern, RegexFlag -from typing import Any, overload -from typing_extensions import LiteralString +from typing import Any, ClassVar, overload +from typing_extensions import LiteralString, TypeAlias __all__ = [ "ascii_letters", @@ -30,15 +30,22 @@ punctuation: LiteralString printable: LiteralString whitespace: LiteralString -def capwords(s: StrOrLiteralStr, sep: StrOrLiteralStr | None = ...) -> StrOrLiteralStr: ... +def capwords(s: StrOrLiteralStr, sep: StrOrLiteralStr | None = None) -> StrOrLiteralStr: ... -class Template: +if sys.version_info >= (3, 9): + _TemplateMetaclass: TypeAlias = type +else: + class _TemplateMetaclass(type): + pattern: ClassVar[str] + def __init__(cls, name: str, bases: tuple[type, ...], dct: dict[str, Any]) -> None: ... + +class Template(metaclass=_TemplateMetaclass): template: str - delimiter: str - idpattern: str - braceidpattern: str | None - flags: RegexFlag - pattern: Pattern[str] + delimiter: ClassVar[str] + idpattern: ClassVar[str] + braceidpattern: ClassVar[str | None] + flags: ClassVar[RegexFlag] + pattern: ClassVar[Pattern[str]] def __init__(self, template: str) -> None: ... def substitute(self, __mapping: Mapping[str, object] = ..., **kwds: object) -> str: ... def safe_substitute(self, __mapping: Mapping[str, object] = ..., **kwds: object) -> str: ... @@ -57,11 +64,20 @@ class Formatter: ) -> LiteralString: ... @overload def vformat(self, format_string: str, args: Sequence[Any], kwargs: Mapping[str, Any]) -> str: ... + def _vformat( # undocumented + self, + format_string: str, + args: Sequence[Any], + kwargs: Mapping[str, Any], + used_args: set[int | str], + recursion_depth: int, + auto_arg_index: int = 0, + ) -> tuple[str, int]: ... def parse( self, format_string: StrOrLiteralStr ) -> Iterable[tuple[StrOrLiteralStr, StrOrLiteralStr | None, StrOrLiteralStr | None, StrOrLiteralStr | None]]: ... def get_field(self, field_name: str, args: Sequence[Any], kwargs: Mapping[str, Any]) -> Any: ... def get_value(self, key: int | str, args: Sequence[Any], kwargs: Mapping[str, Any]) -> Any: ... - def check_unused_args(self, used_args: Sequence[int | str], args: Sequence[Any], kwargs: Mapping[str, Any]) -> None: ... + def check_unused_args(self, used_args: set[int | str], args: Sequence[Any], kwargs: Mapping[str, Any]) -> None: ... def format_field(self, value: Any, format_spec: str) -> Any: ... def convert_field(self, value: Any, conversion: str) -> Any: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/struct.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/struct.pyi index f7eff2b76..4220cd825 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/struct.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/struct.pyi @@ -6,19 +6,21 @@ __all__ = ["calcsize", "pack", "pack_into", "unpack", "unpack_from", "iter_unpac class error(Exception): ... -def pack(fmt: str | bytes, *v: Any) -> bytes: ... -def pack_into(fmt: str | bytes, buffer: WriteableBuffer, offset: int, *v: Any) -> None: ... +def pack(__fmt: str | bytes, *v: Any) -> bytes: ... +def pack_into(__fmt: str | bytes, __buffer: WriteableBuffer, __offset: int, *v: Any) -> None: ... def unpack(__format: str | bytes, __buffer: ReadableBuffer) -> tuple[Any, ...]: ... -def unpack_from(__format: str | bytes, buffer: ReadableBuffer, offset: int = ...) -> tuple[Any, ...]: ... +def unpack_from(__format: str | bytes, buffer: ReadableBuffer, offset: int = 0) -> tuple[Any, ...]: ... def iter_unpack(__format: str | bytes, __buffer: ReadableBuffer) -> Iterator[tuple[Any, ...]]: ... def calcsize(__format: str | bytes) -> int: ... class Struct: - format: str - size: int + @property + def format(self) -> str: ... + @property + def size(self) -> int: ... def __init__(self, format: str | bytes) -> None: ... def pack(self, *v: Any) -> bytes: ... def pack_into(self, buffer: WriteableBuffer, offset: int, *v: Any) -> None: ... def unpack(self, __buffer: ReadableBuffer) -> tuple[Any, ...]: ... - def unpack_from(self, buffer: ReadableBuffer, offset: int = ...) -> tuple[Any, ...]: ... + def unpack_from(self, buffer: ReadableBuffer, offset: int = 0) -> tuple[Any, ...]: ... def iter_unpack(self, __buffer: ReadableBuffer) -> Iterator[tuple[Any, ...]]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/subprocess.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/subprocess.pyi index fded3f749..3c8041811 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/subprocess.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/subprocess.pyi @@ -1,9 +1,9 @@ import sys -from _typeshed import Self, StrOrBytesPath -from collections.abc import Callable, Iterable, Mapping, Sequence +from _typeshed import ReadableBuffer, StrOrBytesPath +from collections.abc import Callable, Collection, Iterable, Mapping, Sequence from types import TracebackType from typing import IO, Any, AnyStr, Generic, TypeVar, overload -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal, Self, TypeAlias if sys.version_info >= (3, 9): from types import GenericAlias @@ -63,13 +63,13 @@ if sys.platform == "win32": # except TimeoutError as e: # reveal_type(e.cmd) # Any, but morally is _CMD _FILE: TypeAlias = None | int | IO[Any] -_TXT: TypeAlias = bytes | str +_InputString: TypeAlias = ReadableBuffer | str if sys.version_info >= (3, 8): _CMD: TypeAlias = StrOrBytesPath | Sequence[StrOrBytesPath] else: # Python 3.7 doesn't support _CMD being a single PathLike. # See: https://bugs.python.org/issue31961 - _CMD: TypeAlias = _TXT | Sequence[StrOrBytesPath] + _CMD: TypeAlias = str | bytes | Sequence[StrOrBytesPath] if sys.platform == "win32": _ENV: TypeAlias = Mapping[str, str] else: @@ -91,14 +91,7 @@ class CompletedProcess(Generic[_T]): # and writing all the overloads would be horrific. stdout: _T stderr: _T - # pyright ignore on __init__ because the TypeVar can technically be unsolved, but see comment above - def __init__( - self, - args: _CMD, - returncode: int, - stdout: _T | None = ..., # pyright: ignore[reportInvalidTypeVarUse] - stderr: _T | None = ..., # pyright: ignore[reportInvalidTypeVarUse] - ) -> None: ... + def __init__(self, args: _CMD, returncode: int, stdout: _T | None = None, stderr: _T | None = None) -> None: ... def check_returncode(self) -> None: ... if sys.version_info >= (3, 9): def __class_getitem__(cls, item: Any) -> GenericAlias: ... @@ -108,207 +101,207 @@ if sys.version_info >= (3, 11): @overload def run( args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE = ..., - stdout: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE = None, + stdout: _FILE = None, + stderr: _FILE = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., - encoding: str | None = ..., - errors: str | None = ..., - input: str | None = ..., + capture_output: bool = False, + check: bool = False, + encoding: str | None = None, + errors: str | None = None, + input: str | None = None, text: Literal[True], - timeout: float | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., - process_group: int | None = ..., + timeout: float | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, + process_group: int | None = None, ) -> CompletedProcess[str]: ... @overload def run( args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE = ..., - stdout: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE = None, + stdout: _FILE = None, + stderr: _FILE = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., + capture_output: bool = False, + check: bool = False, encoding: str, - errors: str | None = ..., - input: str | None = ..., - text: bool | None = ..., - timeout: float | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., - process_group: int | None = ..., + errors: str | None = None, + input: str | None = None, + text: bool | None = None, + timeout: float | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, + process_group: int | None = None, ) -> CompletedProcess[str]: ... @overload def run( args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE = ..., - stdout: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE = None, + stdout: _FILE = None, + stderr: _FILE = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., - encoding: str | None = ..., + capture_output: bool = False, + check: bool = False, + encoding: str | None = None, errors: str, - input: str | None = ..., - text: bool | None = ..., - timeout: float | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., - process_group: int | None = ..., + input: str | None = None, + text: bool | None = None, + timeout: float | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, + process_group: int | None = None, ) -> CompletedProcess[str]: ... @overload def run( args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE = ..., - stdout: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE = None, + stdout: _FILE = None, + stderr: _FILE = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, *, universal_newlines: Literal[True], - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + startupinfo: Any = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., # where the *real* keyword only args start - capture_output: bool = ..., - check: bool = ..., - encoding: str | None = ..., - errors: str | None = ..., - input: str | None = ..., - text: bool | None = ..., - timeout: float | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., - process_group: int | None = ..., + capture_output: bool = False, + check: bool = False, + encoding: str | None = None, + errors: str | None = None, + input: str | None = None, + text: bool | None = None, + timeout: float | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, + process_group: int | None = None, ) -> CompletedProcess[str]: ... @overload def run( args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE = ..., - stdout: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: Literal[False] = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE = None, + stdout: _FILE = None, + stderr: _FILE = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: Literal[False, None] = None, + startupinfo: Any = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., - encoding: None = ..., - errors: None = ..., - input: bytes | None = ..., - text: Literal[None, False] = ..., - timeout: float | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., - process_group: int | None = ..., + capture_output: bool = False, + check: bool = False, + encoding: None = None, + errors: None = None, + input: ReadableBuffer | None = None, + text: Literal[None, False] = None, + timeout: float | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, + process_group: int | None = None, ) -> CompletedProcess[bytes]: ... @overload def run( args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE = ..., - stdout: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE = None, + stdout: _FILE = None, + stderr: _FILE = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., - encoding: str | None = ..., - errors: str | None = ..., - input: _TXT | None = ..., - text: bool | None = ..., - timeout: float | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., - process_group: int | None = ..., + capture_output: bool = False, + check: bool = False, + encoding: str | None = None, + errors: str | None = None, + input: _InputString | None = None, + text: bool | None = None, + timeout: float | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, + process_group: int | None = None, ) -> CompletedProcess[Any]: ... elif sys.version_info >= (3, 10): @@ -316,201 +309,201 @@ elif sys.version_info >= (3, 10): @overload def run( args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE = ..., - stdout: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE = None, + stdout: _FILE = None, + stderr: _FILE = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., - encoding: str | None = ..., - errors: str | None = ..., - input: str | None = ..., + capture_output: bool = False, + check: bool = False, + encoding: str | None = None, + errors: str | None = None, + input: str | None = None, text: Literal[True], - timeout: float | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., + timeout: float | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, ) -> CompletedProcess[str]: ... @overload def run( args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE = ..., - stdout: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE = None, + stdout: _FILE = None, + stderr: _FILE = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., + capture_output: bool = False, + check: bool = False, encoding: str, - errors: str | None = ..., - input: str | None = ..., - text: bool | None = ..., - timeout: float | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., + errors: str | None = None, + input: str | None = None, + text: bool | None = None, + timeout: float | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, ) -> CompletedProcess[str]: ... @overload def run( args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE = ..., - stdout: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE = None, + stdout: _FILE = None, + stderr: _FILE = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., - encoding: str | None = ..., + capture_output: bool = False, + check: bool = False, + encoding: str | None = None, errors: str, - input: str | None = ..., - text: bool | None = ..., - timeout: float | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., + input: str | None = None, + text: bool | None = None, + timeout: float | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, ) -> CompletedProcess[str]: ... @overload def run( args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE = ..., - stdout: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE = None, + stdout: _FILE = None, + stderr: _FILE = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, *, universal_newlines: Literal[True], - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + startupinfo: Any = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., # where the *real* keyword only args start - capture_output: bool = ..., - check: bool = ..., - encoding: str | None = ..., - errors: str | None = ..., - input: str | None = ..., - text: bool | None = ..., - timeout: float | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., + capture_output: bool = False, + check: bool = False, + encoding: str | None = None, + errors: str | None = None, + input: str | None = None, + text: bool | None = None, + timeout: float | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, ) -> CompletedProcess[str]: ... @overload def run( args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE = ..., - stdout: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: Literal[False] = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE = None, + stdout: _FILE = None, + stderr: _FILE = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: Literal[False, None] = None, + startupinfo: Any = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., - encoding: None = ..., - errors: None = ..., - input: bytes | None = ..., - text: Literal[None, False] = ..., - timeout: float | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., + capture_output: bool = False, + check: bool = False, + encoding: None = None, + errors: None = None, + input: ReadableBuffer | None = None, + text: Literal[None, False] = None, + timeout: float | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, ) -> CompletedProcess[bytes]: ... @overload def run( args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE = ..., - stdout: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE = None, + stdout: _FILE = None, + stderr: _FILE = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., - encoding: str | None = ..., - errors: str | None = ..., - input: _TXT | None = ..., - text: bool | None = ..., - timeout: float | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., + capture_output: bool = False, + check: bool = False, + encoding: str | None = None, + errors: str | None = None, + input: _InputString | None = None, + text: bool | None = None, + timeout: float | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, ) -> CompletedProcess[Any]: ... elif sys.version_info >= (3, 9): @@ -518,366 +511,366 @@ elif sys.version_info >= (3, 9): @overload def run( args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE = ..., - stdout: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE = None, + stdout: _FILE = None, + stderr: _FILE = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., - encoding: str | None = ..., - errors: str | None = ..., - input: str | None = ..., + capture_output: bool = False, + check: bool = False, + encoding: str | None = None, + errors: str | None = None, + input: str | None = None, text: Literal[True], - timeout: float | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., + timeout: float | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, ) -> CompletedProcess[str]: ... @overload def run( args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE = ..., - stdout: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE = None, + stdout: _FILE = None, + stderr: _FILE = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., + capture_output: bool = False, + check: bool = False, encoding: str, - errors: str | None = ..., - input: str | None = ..., - text: bool | None = ..., - timeout: float | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., + errors: str | None = None, + input: str | None = None, + text: bool | None = None, + timeout: float | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, ) -> CompletedProcess[str]: ... @overload def run( args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE = ..., - stdout: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE = None, + stdout: _FILE = None, + stderr: _FILE = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., - encoding: str | None = ..., + capture_output: bool = False, + check: bool = False, + encoding: str | None = None, errors: str, - input: str | None = ..., - text: bool | None = ..., - timeout: float | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., + input: str | None = None, + text: bool | None = None, + timeout: float | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, ) -> CompletedProcess[str]: ... @overload def run( args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE = ..., - stdout: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE = None, + stdout: _FILE = None, + stderr: _FILE = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, *, universal_newlines: Literal[True], - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + startupinfo: Any = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., # where the *real* keyword only args start - capture_output: bool = ..., - check: bool = ..., - encoding: str | None = ..., - errors: str | None = ..., - input: str | None = ..., - text: bool | None = ..., - timeout: float | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., + capture_output: bool = False, + check: bool = False, + encoding: str | None = None, + errors: str | None = None, + input: str | None = None, + text: bool | None = None, + timeout: float | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, ) -> CompletedProcess[str]: ... @overload def run( args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE = ..., - stdout: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: Literal[False] = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE = None, + stdout: _FILE = None, + stderr: _FILE = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: Literal[False, None] = None, + startupinfo: Any = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., - encoding: None = ..., - errors: None = ..., - input: bytes | None = ..., - text: Literal[None, False] = ..., - timeout: float | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., + capture_output: bool = False, + check: bool = False, + encoding: None = None, + errors: None = None, + input: ReadableBuffer | None = None, + text: Literal[None, False] = None, + timeout: float | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, ) -> CompletedProcess[bytes]: ... @overload def run( args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE = ..., - stdout: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE = None, + stdout: _FILE = None, + stderr: _FILE = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., - encoding: str | None = ..., - errors: str | None = ..., - input: _TXT | None = ..., - text: bool | None = ..., - timeout: float | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., + capture_output: bool = False, + check: bool = False, + encoding: str | None = None, + errors: str | None = None, + input: _InputString | None = None, + text: bool | None = None, + timeout: float | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, ) -> CompletedProcess[Any]: ... else: @overload def run( args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE = ..., - stdout: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE = None, + stdout: _FILE = None, + stderr: _FILE = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., - encoding: str | None = ..., - errors: str | None = ..., - input: str | None = ..., + capture_output: bool = False, + check: bool = False, + encoding: str | None = None, + errors: str | None = None, + input: str | None = None, text: Literal[True], - timeout: float | None = ..., + timeout: float | None = None, ) -> CompletedProcess[str]: ... @overload def run( args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE = ..., - stdout: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE = None, + stdout: _FILE = None, + stderr: _FILE = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., + capture_output: bool = False, + check: bool = False, encoding: str, - errors: str | None = ..., - input: str | None = ..., - text: bool | None = ..., - timeout: float | None = ..., + errors: str | None = None, + input: str | None = None, + text: bool | None = None, + timeout: float | None = None, ) -> CompletedProcess[str]: ... @overload def run( args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE = ..., - stdout: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE = None, + stdout: _FILE = None, + stderr: _FILE = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., - encoding: str | None = ..., + capture_output: bool = False, + check: bool = False, + encoding: str | None = None, errors: str, - input: str | None = ..., - text: bool | None = ..., - timeout: float | None = ..., + input: str | None = None, + text: bool | None = None, + timeout: float | None = None, ) -> CompletedProcess[str]: ... @overload def run( args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE = ..., - stdout: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE = None, + stdout: _FILE = None, + stderr: _FILE = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, *, universal_newlines: Literal[True], - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + startupinfo: Any = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., # where the *real* keyword only args start - capture_output: bool = ..., - check: bool = ..., - encoding: str | None = ..., - errors: str | None = ..., - input: str | None = ..., - text: bool | None = ..., - timeout: float | None = ..., + capture_output: bool = False, + check: bool = False, + encoding: str | None = None, + errors: str | None = None, + input: str | None = None, + text: bool | None = None, + timeout: float | None = None, ) -> CompletedProcess[str]: ... @overload def run( args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE = ..., - stdout: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: Literal[False] = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE = None, + stdout: _FILE = None, + stderr: _FILE = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: Literal[False, None] = None, + startupinfo: Any = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., - encoding: None = ..., - errors: None = ..., - input: bytes | None = ..., - text: Literal[None, False] = ..., - timeout: float | None = ..., + capture_output: bool = False, + check: bool = False, + encoding: None = None, + errors: None = None, + input: ReadableBuffer | None = None, + text: Literal[None, False] = None, + timeout: float | None = None, ) -> CompletedProcess[bytes]: ... @overload def run( args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE = ..., - stdout: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE = None, + stdout: _FILE = None, + stderr: _FILE = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., - encoding: str | None = ..., - errors: str | None = ..., - input: _TXT | None = ..., - text: bool | None = ..., - timeout: float | None = ..., + capture_output: bool = False, + check: bool = False, + encoding: str | None = None, + errors: str | None = None, + input: _InputString | None = None, + text: bool | None = None, + timeout: float | None = None, ) -> CompletedProcess[Any]: ... # Same args as Popen.__init__ @@ -885,114 +878,114 @@ if sys.version_info >= (3, 11): # 3.11 adds "process_group" argument def call( args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE = ..., - stdout: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE = None, + stdout: _FILE = None, + stderr: _FILE = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., - text: bool | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., - process_group: int | None = ..., + timeout: float | None = None, + text: bool | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, + process_group: int | None = None, ) -> int: ... elif sys.version_info >= (3, 10): # 3.10 adds "pipesize" argument def call( args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE = ..., - stdout: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE = None, + stdout: _FILE = None, + stderr: _FILE = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., - text: bool | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., + timeout: float | None = None, + text: bool | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, ) -> int: ... elif sys.version_info >= (3, 9): # 3.9 adds arguments "user", "group", "extra_groups" and "umask" def call( args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE = ..., - stdout: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE = None, + stdout: _FILE = None, + stderr: _FILE = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., - text: bool | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., + timeout: float | None = None, + text: bool | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, ) -> int: ... else: def call( args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE = ..., - stdout: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE = None, + stdout: _FILE = None, + stderr: _FILE = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., - text: bool | None = ..., + timeout: float | None = None, + text: bool | None = None, ) -> int: ... # Same args as Popen.__init__ @@ -1000,114 +993,114 @@ if sys.version_info >= (3, 11): # 3.11 adds "process_group" argument def check_call( args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath = ..., - stdin: _FILE = ..., - stdout: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE = None, + stdout: _FILE = None, + stderr: _FILE = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., timeout: float | None = ..., *, - text: bool | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., - process_group: int | None = ..., + text: bool | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, + process_group: int | None = None, ) -> int: ... elif sys.version_info >= (3, 10): # 3.10 adds "pipesize" argument def check_call( args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath = ..., - stdin: _FILE = ..., - stdout: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE = None, + stdout: _FILE = None, + stderr: _FILE = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., timeout: float | None = ..., *, - text: bool | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., + text: bool | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, ) -> int: ... elif sys.version_info >= (3, 9): # 3.9 adds arguments "user", "group", "extra_groups" and "umask" def check_call( args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath = ..., - stdin: _FILE = ..., - stdout: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE = None, + stdout: _FILE = None, + stderr: _FILE = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., timeout: float | None = ..., *, - text: bool | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., + text: bool | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, ) -> int: ... else: def check_call( args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath = ..., - stdin: _FILE = ..., - stdout: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE = None, + stdout: _FILE = None, + stderr: _FILE = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., timeout: float | None = ..., *, - text: bool | None = ..., + text: bool | None = None, ) -> int: ... if sys.version_info >= (3, 11): @@ -1115,705 +1108,705 @@ if sys.version_info >= (3, 11): @overload def check_output( args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE = None, + stderr: _FILE = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., - input: _TXT | None = ..., - encoding: str | None = ..., - errors: str | None = ..., + timeout: float | None = None, + input: _InputString | None = ..., + encoding: str | None = None, + errors: str | None = None, text: Literal[True], - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., - process_group: int | None = ..., + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, + process_group: int | None = None, ) -> str: ... @overload def check_output( args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE = None, + stderr: _FILE = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., - input: _TXT | None = ..., + timeout: float | None = None, + input: _InputString | None = ..., encoding: str, - errors: str | None = ..., - text: bool | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., - process_group: int | None = ..., + errors: str | None = None, + text: bool | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, + process_group: int | None = None, ) -> str: ... @overload def check_output( args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE = None, + stderr: _FILE = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., - input: _TXT | None = ..., - encoding: str | None = ..., + timeout: float | None = None, + input: _InputString | None = ..., + encoding: str | None = None, errors: str, - text: bool | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., - process_group: int | None = ..., + text: bool | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, + process_group: int | None = None, ) -> str: ... @overload def check_output( args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE = None, + stderr: _FILE = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, *, universal_newlines: Literal[True], - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + startupinfo: Any = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., # where the real keyword only ones start - timeout: float | None = ..., - input: _TXT | None = ..., - encoding: str | None = ..., - errors: str | None = ..., - text: bool | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., - process_group: int | None = ..., + timeout: float | None = None, + input: _InputString | None = ..., + encoding: str | None = None, + errors: str | None = None, + text: bool | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, + process_group: int | None = None, ) -> str: ... @overload def check_output( args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: Literal[False] = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE = None, + stderr: _FILE = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: Literal[False, None] = None, + startupinfo: Any = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., - input: _TXT | None = ..., - encoding: None = ..., - errors: None = ..., - text: Literal[None, False] = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., - process_group: int | None = ..., + timeout: float | None = None, + input: _InputString | None = ..., + encoding: None = None, + errors: None = None, + text: Literal[None, False] = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, + process_group: int | None = None, ) -> bytes: ... @overload def check_output( args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE = None, + stderr: _FILE = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., - input: _TXT | None = ..., - encoding: str | None = ..., - errors: str | None = ..., - text: bool | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., - process_group: int | None = ..., - ) -> Any: ... # morally: -> _TXT + timeout: float | None = None, + input: _InputString | None = ..., + encoding: str | None = None, + errors: str | None = None, + text: bool | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, + process_group: int | None = None, + ) -> Any: ... # morally: -> str | bytes elif sys.version_info >= (3, 10): # 3.10 adds "pipesize" argument @overload def check_output( args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE = None, + stderr: _FILE = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., - input: _TXT | None = ..., - encoding: str | None = ..., - errors: str | None = ..., + timeout: float | None = None, + input: _InputString | None = ..., + encoding: str | None = None, + errors: str | None = None, text: Literal[True], - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, ) -> str: ... @overload def check_output( args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE = None, + stderr: _FILE = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., - input: _TXT | None = ..., + timeout: float | None = None, + input: _InputString | None = ..., encoding: str, - errors: str | None = ..., - text: bool | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., + errors: str | None = None, + text: bool | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, ) -> str: ... @overload def check_output( args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE = None, + stderr: _FILE = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., - input: _TXT | None = ..., - encoding: str | None = ..., + timeout: float | None = None, + input: _InputString | None = ..., + encoding: str | None = None, errors: str, - text: bool | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., + text: bool | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, ) -> str: ... @overload def check_output( args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE = None, + stderr: _FILE = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, *, universal_newlines: Literal[True], - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + startupinfo: Any = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., # where the real keyword only ones start - timeout: float | None = ..., - input: _TXT | None = ..., - encoding: str | None = ..., - errors: str | None = ..., - text: bool | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., + timeout: float | None = None, + input: _InputString | None = ..., + encoding: str | None = None, + errors: str | None = None, + text: bool | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, ) -> str: ... @overload def check_output( args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: Literal[False] = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE = None, + stderr: _FILE = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: Literal[False, None] = None, + startupinfo: Any = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., - input: _TXT | None = ..., - encoding: None = ..., - errors: None = ..., - text: Literal[None, False] = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., + timeout: float | None = None, + input: _InputString | None = ..., + encoding: None = None, + errors: None = None, + text: Literal[None, False] = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, ) -> bytes: ... @overload def check_output( args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE = None, + stderr: _FILE = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., - input: _TXT | None = ..., - encoding: str | None = ..., - errors: str | None = ..., - text: bool | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., - ) -> Any: ... # morally: -> _TXT + timeout: float | None = None, + input: _InputString | None = ..., + encoding: str | None = None, + errors: str | None = None, + text: bool | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, + ) -> Any: ... # morally: -> str | bytes elif sys.version_info >= (3, 9): # 3.9 adds arguments "user", "group", "extra_groups" and "umask" @overload def check_output( args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE = None, + stderr: _FILE = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., - input: _TXT | None = ..., - encoding: str | None = ..., - errors: str | None = ..., + timeout: float | None = None, + input: _InputString | None = ..., + encoding: str | None = None, + errors: str | None = None, text: Literal[True], - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, ) -> str: ... @overload def check_output( args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE = None, + stderr: _FILE = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., - input: _TXT | None = ..., + timeout: float | None = None, + input: _InputString | None = ..., encoding: str, - errors: str | None = ..., - text: bool | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., + errors: str | None = None, + text: bool | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, ) -> str: ... @overload def check_output( args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE = None, + stderr: _FILE = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., - input: _TXT | None = ..., - encoding: str | None = ..., + timeout: float | None = None, + input: _InputString | None = ..., + encoding: str | None = None, errors: str, - text: bool | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., + text: bool | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, ) -> str: ... @overload def check_output( args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE = None, + stderr: _FILE = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, *, universal_newlines: Literal[True], - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + startupinfo: Any = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., # where the real keyword only ones start - timeout: float | None = ..., - input: _TXT | None = ..., - encoding: str | None = ..., - errors: str | None = ..., - text: bool | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., + timeout: float | None = None, + input: _InputString | None = ..., + encoding: str | None = None, + errors: str | None = None, + text: bool | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, ) -> str: ... @overload def check_output( args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: Literal[False] = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE = None, + stderr: _FILE = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: Literal[False, None] = None, + startupinfo: Any = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., - input: _TXT | None = ..., - encoding: None = ..., - errors: None = ..., - text: Literal[None, False] = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., + timeout: float | None = None, + input: _InputString | None = ..., + encoding: None = None, + errors: None = None, + text: Literal[None, False] = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, ) -> bytes: ... @overload def check_output( args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE = None, + stderr: _FILE = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., - input: _TXT | None = ..., - encoding: str | None = ..., - errors: str | None = ..., - text: bool | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - ) -> Any: ... # morally: -> _TXT + timeout: float | None = None, + input: _InputString | None = ..., + encoding: str | None = None, + errors: str | None = None, + text: bool | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + ) -> Any: ... # morally: -> str | bytes else: @overload def check_output( args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE = None, + stderr: _FILE = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., - input: _TXT | None = ..., - encoding: str | None = ..., - errors: str | None = ..., + timeout: float | None = None, + input: _InputString | None = ..., + encoding: str | None = None, + errors: str | None = None, text: Literal[True], ) -> str: ... @overload def check_output( args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE = None, + stderr: _FILE = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., - input: _TXT | None = ..., + timeout: float | None = None, + input: _InputString | None = ..., encoding: str, - errors: str | None = ..., - text: bool | None = ..., + errors: str | None = None, + text: bool | None = None, ) -> str: ... @overload def check_output( args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE = None, + stderr: _FILE = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., - input: _TXT | None = ..., - encoding: str | None = ..., + timeout: float | None = None, + input: _InputString | None = ..., + encoding: str | None = None, errors: str, - text: bool | None = ..., + text: bool | None = None, ) -> str: ... @overload def check_output( args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE = None, + stderr: _FILE = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, *, universal_newlines: Literal[True], - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + startupinfo: Any = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., # where the real keyword only ones start - timeout: float | None = ..., - input: _TXT | None = ..., - encoding: str | None = ..., - errors: str | None = ..., - text: bool | None = ..., + timeout: float | None = None, + input: _InputString | None = ..., + encoding: str | None = None, + errors: str | None = None, + text: bool | None = None, ) -> str: ... @overload def check_output( args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: Literal[False] = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE = None, + stderr: _FILE = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: Literal[False, None] = None, + startupinfo: Any = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., - input: _TXT | None = ..., - encoding: None = ..., - errors: None = ..., - text: Literal[None, False] = ..., + timeout: float | None = None, + input: _InputString | None = ..., + encoding: None = None, + errors: None = None, + text: Literal[None, False] = None, ) -> bytes: ... @overload def check_output( args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE = None, + stderr: _FILE = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., - input: _TXT | None = ..., - encoding: str | None = ..., - errors: str | None = ..., - text: bool | None = ..., - ) -> Any: ... # morally: -> _TXT + timeout: float | None = None, + input: _InputString | None = ..., + encoding: str | None = None, + errors: str | None = None, + text: bool | None = None, + ) -> Any: ... # morally: -> str | bytes PIPE: int STDOUT: int @@ -1822,26 +1815,30 @@ DEVNULL: int class SubprocessError(Exception): ... class TimeoutExpired(SubprocessError): - def __init__(self, cmd: _CMD, timeout: float, output: _TXT | None = ..., stderr: _TXT | None = ...) -> None: ... + def __init__( + self, cmd: _CMD, timeout: float, output: str | bytes | None = None, stderr: str | bytes | None = None + ) -> None: ... # morally: _CMD cmd: Any timeout: float - # morally: _TXT | None + # morally: str | bytes | None output: Any - stdout: Any - stderr: Any + stdout: bytes | None + stderr: bytes | None class CalledProcessError(SubprocessError): returncode: int # morally: _CMD cmd: Any - # morally: _TXT | None + # morally: str | bytes | None output: Any - # morally: _TXT | None + # morally: str | bytes | None stdout: Any stderr: Any - def __init__(self, returncode: int, cmd: _CMD, output: _TXT | None = ..., stderr: _TXT | None = ...) -> None: ... + def __init__( + self, returncode: int, cmd: _CMD, output: str | bytes | None = None, stderr: str | bytes | None = None + ) -> None: ... class Popen(Generic[AnyStr]): args: _CMD @@ -1858,188 +1855,188 @@ class Popen(Generic[AnyStr]): def __init__( self: Popen[str], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - text: bool | None = ..., + text: bool | None = None, encoding: str, - errors: str | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., - process_group: int | None = ..., + errors: str | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, + process_group: int | None = None, ) -> None: ... @overload def __init__( self: Popen[str], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - text: bool | None = ..., - encoding: str | None = ..., + text: bool | None = None, + encoding: str | None = None, errors: str, - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., - process_group: int | None = ..., + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, + process_group: int | None = None, ) -> None: ... @overload def __init__( self: Popen[str], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, *, universal_newlines: Literal[True], - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., # where the *real* keyword only args start - text: bool | None = ..., - encoding: str | None = ..., - errors: str | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., - process_group: int | None = ..., + text: bool | None = None, + encoding: str | None = None, + errors: str | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, + process_group: int | None = None, ) -> None: ... @overload def __init__( self: Popen[str], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, text: Literal[True], - encoding: str | None = ..., - errors: str | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., - process_group: int | None = ..., + encoding: str | None = None, + errors: str | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, + process_group: int | None = None, ) -> None: ... @overload def __init__( self: Popen[bytes], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: Literal[False] = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: Literal[False, None] = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - text: Literal[None, False] = ..., - encoding: None = ..., - errors: None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., - process_group: int | None = ..., + text: Literal[None, False] = None, + encoding: None = None, + errors: None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, + process_group: int | None = None, ) -> None: ... @overload def __init__( self: Popen[Any], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - text: bool | None = ..., - encoding: str | None = ..., - errors: str | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., - process_group: int | None = ..., + text: bool | None = None, + encoding: str | None = None, + errors: str | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, + process_group: int | None = None, ) -> None: ... elif sys.version_info >= (3, 10): # pipesize is added in 3.10 @@ -2047,182 +2044,182 @@ class Popen(Generic[AnyStr]): def __init__( self: Popen[str], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - text: bool | None = ..., + text: bool | None = None, encoding: str, - errors: str | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., + errors: str | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, ) -> None: ... @overload def __init__( self: Popen[str], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - text: bool | None = ..., - encoding: str | None = ..., + text: bool | None = None, + encoding: str | None = None, errors: str, - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, ) -> None: ... @overload def __init__( self: Popen[str], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, *, universal_newlines: Literal[True], - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., # where the *real* keyword only args start - text: bool | None = ..., - encoding: str | None = ..., - errors: str | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., + text: bool | None = None, + encoding: str | None = None, + errors: str | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, ) -> None: ... @overload def __init__( self: Popen[str], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, text: Literal[True], - encoding: str | None = ..., - errors: str | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., + encoding: str | None = None, + errors: str | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, ) -> None: ... @overload def __init__( self: Popen[bytes], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: Literal[False] = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: Literal[False, None] = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - text: Literal[None, False] = ..., - encoding: None = ..., - errors: None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., + text: Literal[None, False] = None, + encoding: None = None, + errors: None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, ) -> None: ... @overload def __init__( self: Popen[Any], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - text: bool | None = ..., - encoding: str | None = ..., - errors: str | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., + text: bool | None = None, + encoding: str | None = None, + errors: str | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, ) -> None: ... elif sys.version_info >= (3, 9): # user, group, extra_groups, umask were added in 3.9 @@ -2230,343 +2227,340 @@ class Popen(Generic[AnyStr]): def __init__( self: Popen[str], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - text: bool | None = ..., + text: bool | None = None, encoding: str, - errors: str | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., + errors: str | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, ) -> None: ... @overload def __init__( self: Popen[str], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - text: bool | None = ..., - encoding: str | None = ..., + text: bool | None = None, + encoding: str | None = None, errors: str, - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, ) -> None: ... @overload def __init__( self: Popen[str], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, *, universal_newlines: Literal[True], - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., # where the *real* keyword only args start - text: bool | None = ..., - encoding: str | None = ..., - errors: str | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., + text: bool | None = None, + encoding: str | None = None, + errors: str | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, ) -> None: ... @overload def __init__( self: Popen[str], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, text: Literal[True], - encoding: str | None = ..., - errors: str | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., + encoding: str | None = None, + errors: str | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, ) -> None: ... @overload def __init__( self: Popen[bytes], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: Literal[False] = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: Literal[False, None] = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - text: Literal[None, False] = ..., - encoding: None = ..., - errors: None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., + text: Literal[None, False] = None, + encoding: None = None, + errors: None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, ) -> None: ... @overload def __init__( self: Popen[Any], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - text: bool | None = ..., - encoding: str | None = ..., - errors: str | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., + text: bool | None = None, + encoding: str | None = None, + errors: str | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, ) -> None: ... else: @overload def __init__( self: Popen[str], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - text: bool | None = ..., + text: bool | None = None, encoding: str, - errors: str | None = ..., + errors: str | None = None, ) -> None: ... @overload def __init__( self: Popen[str], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - text: bool | None = ..., - encoding: str | None = ..., + text: bool | None = None, + encoding: str | None = None, errors: str, ) -> None: ... @overload def __init__( self: Popen[str], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, *, universal_newlines: Literal[True], - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., # where the *real* keyword only args start - text: bool | None = ..., - encoding: str | None = ..., - errors: str | None = ..., + text: bool | None = None, + encoding: str | None = None, + errors: str | None = None, ) -> None: ... @overload def __init__( self: Popen[str], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, text: Literal[True], - encoding: str | None = ..., - errors: str | None = ..., + encoding: str | None = None, + errors: str | None = None, ) -> None: ... @overload def __init__( self: Popen[bytes], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: Literal[False] = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: Literal[False, None] = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - text: Literal[None, False] = ..., - encoding: None = ..., - errors: None = ..., + text: Literal[None, False] = None, + encoding: None = None, + errors: None = None, ) -> None: ... @overload def __init__( self: Popen[Any], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, + pass_fds: Collection[int] = ..., *, - text: bool | None = ..., - encoding: str | None = ..., - errors: str | None = ..., + text: bool | None = None, + encoding: str | None = None, + errors: str | None = None, ) -> None: ... def poll(self) -> int | None: ... - def wait(self, timeout: float | None = ...) -> int: ... - # Return str/bytes - def communicate( - self, - input: AnyStr | None = ..., - timeout: float | None = ..., - # morally this should be optional - ) -> tuple[AnyStr, AnyStr]: ... + def wait(self, timeout: float | None = None) -> int: ... + # morally the members of the returned tuple should be optional + # TODO this should allow ReadableBuffer for Popen[bytes], but adding + # overloads for that runs into a mypy bug (python/mypy#14070). + def communicate(self, input: AnyStr | None = None, timeout: float | None = None) -> tuple[AnyStr, AnyStr]: ... def send_signal(self, sig: int) -> None: ... def terminate(self) -> None: ... def kill(self) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None ) -> None: ... @@ -2575,12 +2569,12 @@ class Popen(Generic[AnyStr]): # The result really is always a str. if sys.version_info >= (3, 11): - def getstatusoutput(cmd: _TXT, *, encoding: str | None = ..., errors: str | None = ...) -> tuple[int, str]: ... - def getoutput(cmd: _TXT, *, encoding: str | None = ..., errors: str | None = ...) -> str: ... + def getstatusoutput(cmd: str | bytes, *, encoding: str | None = None, errors: str | None = None) -> tuple[int, str]: ... + def getoutput(cmd: str | bytes, *, encoding: str | None = None, errors: str | None = None) -> str: ... else: - def getstatusoutput(cmd: _TXT) -> tuple[int, str]: ... - def getoutput(cmd: _TXT) -> str: ... + def getstatusoutput(cmd: str | bytes) -> tuple[int, str]: ... + def getoutput(cmd: str | bytes) -> str: ... if sys.version_info >= (3, 8): def list2cmdline(seq: Iterable[StrOrBytesPath]) -> str: ... # undocumented @@ -2593,12 +2587,12 @@ if sys.platform == "win32": def __init__( self, *, - dwFlags: int = ..., - hStdInput: Any | None = ..., - hStdOutput: Any | None = ..., - hStdError: Any | None = ..., - wShowWindow: int = ..., - lpAttributeList: Mapping[str, Any] | None = ..., + dwFlags: int = 0, + hStdInput: Any | None = None, + hStdOutput: Any | None = None, + hStdError: Any | None = None, + wShowWindow: int = 0, + lpAttributeList: Mapping[str, Any] | None = None, ) -> None: ... dwFlags: int hStdInput: Any | None diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/sunau.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/sunau.pyi index 5b21cb03d..6109b368c 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/sunau.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/sunau.pyi @@ -1,7 +1,7 @@ import sys -from _typeshed import Self +from _typeshed import Unused from typing import IO, Any, NamedTuple, NoReturn, overload -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal, Self, TypeAlias _File: TypeAlias = str | IO[bytes] @@ -32,8 +32,8 @@ class _sunau_params(NamedTuple): class Au_read: def __init__(self, f: _File) -> None: ... - def __enter__(self: Self) -> Self: ... - def __exit__(self, *args: object) -> None: ... + def __enter__(self) -> Self: ... + def __exit__(self, *args: Unused) -> None: ... def getfp(self) -> IO[bytes] | None: ... def rewind(self) -> None: ... def close(self) -> None: ... @@ -52,8 +52,8 @@ class Au_read: class Au_write: def __init__(self, f: _File) -> None: ... - def __enter__(self: Self) -> Self: ... - def __exit__(self, *args: object) -> None: ... + def __enter__(self) -> Self: ... + def __exit__(self, *args: Unused) -> None: ... def setnchannels(self, nchannels: int) -> None: ... def getnchannels(self) -> int: ... def setsampwidth(self, sampwidth: int) -> None: ... @@ -78,7 +78,7 @@ def open(f: _File, mode: Literal["r", "rb"]) -> Au_read: ... @overload def open(f: _File, mode: Literal["w", "wb"]) -> Au_write: ... @overload -def open(f: _File, mode: str | None = ...) -> Any: ... +def open(f: _File, mode: str | None = None) -> Any: ... if sys.version_info < (3, 9): openfp = open diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/symtable.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/symtable.pyi index d44b2d792..304ae8bf8 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/symtable.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/symtable.pyi @@ -38,11 +38,11 @@ class Class(SymbolTable): class Symbol: if sys.version_info >= (3, 8): def __init__( - self, name: str, flags: int, namespaces: Sequence[SymbolTable] | None = ..., *, module_scope: bool = ... + self, name: str, flags: int, namespaces: Sequence[SymbolTable] | None = None, *, module_scope: bool = False ) -> None: ... def is_nonlocal(self) -> bool: ... else: - def __init__(self, name: str, flags: int, namespaces: Sequence[SymbolTable] | None = ...) -> None: ... + def __init__(self, name: str, flags: int, namespaces: Sequence[SymbolTable] | None = None) -> None: ... def get_name(self) -> str: ... def is_referenced(self) -> bool: ... @@ -59,6 +59,5 @@ class Symbol: def get_namespace(self) -> SymbolTable: ... class SymbolTableFactory: - def __init__(self) -> None: ... def new(self, table: Any, filename: str) -> SymbolTable: ... def __call__(self, table: Any, filename: str) -> SymbolTable: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/sys.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/sys.pyi index a1c875561..6e97fbb32 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/sys.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/sys.pyi @@ -7,10 +7,12 @@ from importlib.machinery import ModuleSpec from io import TextIOWrapper from types import FrameType, ModuleType, TracebackType from typing import Any, NoReturn, Protocol, TextIO, TypeVar, overload -from typing_extensions import Literal, TypeAlias, final +from typing_extensions import Final, Literal, TypeAlias, final _T = TypeVar("_T") +# see https://github.com/python/typeshed/issues/8513#issue-1333671093 for the rationale behind this alias +_ExitCode: TypeAlias = str | int | None _OptExcInfo: TypeAlias = OptExcInfo # noqa: Y047 # TODO: obsolete, remove fall 2022 or later # Intentionally omits one deprecated and one optional method of `importlib.abc.MetaPathFinder` @@ -60,9 +62,10 @@ stdout: TextIO stderr: TextIO if sys.version_info >= (3, 10): stdlib_module_names: frozenset[str] -__stdin__: TextIOWrapper -__stdout__: TextIOWrapper -__stderr__: TextIOWrapper + +__stdin__: Final[TextIOWrapper] # Contains the original value of stdin +__stdout__: Final[TextIOWrapper] # Contains the original value of stdout +__stderr__: Final[TextIOWrapper] # Contains the original value of stderr tracebacklimit: int version: str api_version: int @@ -188,11 +191,15 @@ class _implementation: int_info: _int_info @final -class _int_info(structseq[int], tuple[int, int]): +class _int_info(structseq[int], tuple[int, int, int, int]): @property def bits_per_digit(self) -> int: ... @property def sizeof_digit(self) -> int: ... + @property + def default_max_str_digits(self) -> int: ... + @property + def str_digits_check_threshold(self) -> int: ... @final class _version_info(_UninstantiableStructseq, tuple[int, int, int, str, int]): @@ -212,17 +219,16 @@ version_info: _version_info def call_tracing(__func: Callable[..., _T], __args: Any) -> _T: ... def _clear_type_cache() -> None: ... def _current_frames() -> dict[int, FrameType]: ... -def _getframe(__depth: int = ...) -> FrameType: ... +def _getframe(__depth: int = 0) -> FrameType: ... def _debugmallocstats() -> None: ... -def __displayhook__(__value: object) -> None: ... +def __displayhook__(__object: object) -> None: ... def __excepthook__(__exctype: type[BaseException], __value: BaseException, __traceback: TracebackType | None) -> None: ... def exc_info() -> OptExcInfo: ... if sys.version_info >= (3, 11): def exception() -> BaseException | None: ... -# sys.exit() accepts an optional argument of anything printable -def exit(__status: object = ...) -> NoReturn: ... +def exit(__status: _ExitCode = None) -> NoReturn: ... def getallocatedblocks() -> int: ... def getdefaultencoding() -> str: ... @@ -272,11 +278,10 @@ if sys.platform == "win32": def intern(__string: str) -> str: ... def is_finalizing() -> bool: ... - -__breakpointhook__: Any # contains the original value of breakpointhook - def breakpointhook(*args: Any, **kwargs: Any) -> Any: ... +__breakpointhook__ = breakpointhook # Contains the original value of breakpointhook + if sys.platform != "win32": def setdlopenflags(__flags: int) -> None: ... @@ -299,7 +304,7 @@ if sys.version_info >= (3, 8): exc_value: BaseException | None exc_traceback: TracebackType | None err_msg: str | None - object: _object | None + object: _object unraisablehook: Callable[[UnraisableHookArgs], Any] def __unraisablehook__(__unraisable: UnraisableHookArgs) -> Any: ... def addaudithook(hook: Callable[[str, tuple[Any, ...]], Any]) -> None: ... @@ -327,3 +332,8 @@ if sys.version_info < (3, 8): _CoroWrapper: TypeAlias = Callable[[Coroutine[Any, Any, Any]], Any] def set_coroutine_wrapper(__wrapper: _CoroWrapper) -> None: ... def get_coroutine_wrapper() -> _CoroWrapper: ... + +# The following two functions were added in 3.11.0, 3.10.7, 3.9.14, 3.8.14, & 3.7.14, +# as part of the response to CVE-2020-10735 +def set_int_max_str_digits(maxdigits: int) -> None: ... +def get_int_max_str_digits() -> int: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/sysconfig.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/sysconfig.pyi index 03362b5ca..7e29cf132 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/sysconfig.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/sysconfig.pyi @@ -16,7 +16,7 @@ __all__ = [ "parse_config_h", ] -def get_config_var(name: str) -> str | None: ... +def get_config_var(name: str) -> Any: ... @overload def get_config_vars() -> dict[str, Any]: ... @overload @@ -28,11 +28,17 @@ if sys.version_info >= (3, 10): def get_preferred_scheme(key: Literal["prefix", "home", "user"]) -> str: ... def get_path_names() -> tuple[str, ...]: ... -def get_path(name: str, scheme: str = ..., vars: dict[str, Any] | None = ..., expand: bool = ...) -> str: ... -def get_paths(scheme: str = ..., vars: dict[str, Any] | None = ..., expand: bool = ...) -> dict[str, str]: ... +def get_path(name: str, scheme: str = ..., vars: dict[str, Any] | None = None, expand: bool = True) -> str: ... +def get_paths(scheme: str = ..., vars: dict[str, Any] | None = None, expand: bool = True) -> dict[str, str]: ... def get_python_version() -> str: ... def get_platform() -> str: ... -def is_python_build(check_home: bool = ...) -> bool: ... -def parse_config_h(fp: IO[Any], vars: dict[str, Any] | None = ...) -> dict[str, Any]: ... + +if sys.version_info >= (3, 11): + def is_python_build(check_home: object = None) -> bool: ... + +else: + def is_python_build(check_home: bool = False) -> bool: ... + +def parse_config_h(fp: IO[Any], vars: dict[str, Any] | None = None) -> dict[str, Any]: ... def get_config_h_filename() -> str: ... def get_makefile_filename() -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/tarfile.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/tarfile.pyi index cf74899a8..5cf1d55ca 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/tarfile.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/tarfile.pyi @@ -1,13 +1,13 @@ import bz2 import io import sys -from _typeshed import Self, StrOrBytesPath, StrPath -from builtins import list as _list, type as Type # aliases to avoid name clashes with fields named "type" or "list" +from _typeshed import StrOrBytesPath, StrPath +from builtins import list as _list # aliases to avoid name clashes with fields named "type" or "list" from collections.abc import Callable, Iterable, Iterator, Mapping from gzip import _ReadableFileobj as _GzipReadableFileobj, _WritableFileobj as _GzipWritableFileobj from types import TracebackType -from typing import IO, Protocol, overload -from typing_extensions import Literal +from typing import IO, ClassVar, Protocol, overload +from typing_extensions import Literal, Self __all__ = [ "TarFile", @@ -89,10 +89,10 @@ PAX_NAME_FIELDS: set[str] ENCODING: str def open( - name: StrOrBytesPath | None = ..., - mode: str = ..., - fileobj: IO[bytes] | None = ..., # depends on mode - bufsize: int = ..., + name: StrOrBytesPath | None = None, + mode: str = "r", + fileobj: IO[bytes] | None = None, # depends on mode + bufsize: int = 10240, *, format: int | None = ..., tarinfo: type[TarInfo] | None = ..., @@ -110,7 +110,7 @@ class ExFileObject(io.BufferedReader): def __init__(self, tarfile: TarFile, tarinfo: TarInfo) -> None: ... class TarFile: - OPEN_METH: Mapping[str, str] + OPEN_METH: ClassVar[Mapping[str, str]] name: StrOrBytesPath | None mode: Literal["r", "a", "w", "x"] fileobj: _Fileobj | None @@ -127,32 +127,32 @@ class TarFile: offset: int # undocumented def __init__( self, - name: StrOrBytesPath | None = ..., - mode: Literal["r", "a", "w", "x"] = ..., - fileobj: _Fileobj | None = ..., - format: int | None = ..., - tarinfo: type[TarInfo] | None = ..., - dereference: bool | None = ..., - ignore_zeros: bool | None = ..., - encoding: str | None = ..., - errors: str = ..., - pax_headers: Mapping[str, str] | None = ..., - debug: int | None = ..., - errorlevel: int | None = ..., - copybufsize: int | None = ..., # undocumented + name: StrOrBytesPath | None = None, + mode: Literal["r", "a", "w", "x"] = "r", + fileobj: _Fileobj | None = None, + format: int | None = None, + tarinfo: type[TarInfo] | None = None, + dereference: bool | None = None, + ignore_zeros: bool | None = None, + encoding: str | None = None, + errors: str = "surrogateescape", + pax_headers: Mapping[str, str] | None = None, + debug: int | None = None, + errorlevel: int | None = None, + copybufsize: int | None = None, # undocumented ) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, type: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None ) -> None: ... def __iter__(self) -> Iterator[TarInfo]: ... @classmethod def open( - cls: type[Self], - name: StrOrBytesPath | None = ..., - mode: str = ..., - fileobj: IO[bytes] | None = ..., # depends on mode - bufsize: int = ..., + cls, + name: StrOrBytesPath | None = None, + mode: str = "r", + fileobj: IO[bytes] | None = None, # depends on mode + bufsize: int = 10240, *, format: int | None = ..., tarinfo: type[TarInfo] | None = ..., @@ -166,10 +166,10 @@ class TarFile: ) -> Self: ... @classmethod def taropen( - cls: type[Self], + cls, name: StrOrBytesPath | None, - mode: Literal["r", "a", "w", "x"] = ..., - fileobj: _Fileobj | None = ..., + mode: Literal["r", "a", "w", "x"] = "r", + fileobj: _Fileobj | None = None, *, compresslevel: int = ..., format: int | None = ..., @@ -184,11 +184,11 @@ class TarFile: @overload @classmethod def gzopen( - cls: type[Self], + cls, name: StrOrBytesPath | None, - mode: Literal["r"] = ..., - fileobj: _GzipReadableFileobj | None = ..., - compresslevel: int = ..., + mode: Literal["r"] = "r", + fileobj: _GzipReadableFileobj | None = None, + compresslevel: int = 9, *, format: int | None = ..., tarinfo: type[TarInfo] | None = ..., @@ -202,11 +202,11 @@ class TarFile: @overload @classmethod def gzopen( - cls: type[Self], + cls, name: StrOrBytesPath | None, mode: Literal["w", "x"], - fileobj: _GzipWritableFileobj | None = ..., - compresslevel: int = ..., + fileobj: _GzipWritableFileobj | None = None, + compresslevel: int = 9, *, format: int | None = ..., tarinfo: type[TarInfo] | None = ..., @@ -220,11 +220,11 @@ class TarFile: @overload @classmethod def bz2open( - cls: type[Self], + cls, name: StrOrBytesPath | None, mode: Literal["w", "x"], - fileobj: _Bz2WritableFileobj | None = ..., - compresslevel: int = ..., + fileobj: _Bz2WritableFileobj | None = None, + compresslevel: int = 9, *, format: int | None = ..., tarinfo: type[TarInfo] | None = ..., @@ -238,11 +238,11 @@ class TarFile: @overload @classmethod def bz2open( - cls: type[Self], + cls, name: StrOrBytesPath | None, - mode: Literal["r"] = ..., - fileobj: _Bz2ReadableFileobj | None = ..., - compresslevel: int = ..., + mode: Literal["r"] = "r", + fileobj: _Bz2ReadableFileobj | None = None, + compresslevel: int = 9, *, format: int | None = ..., tarinfo: type[TarInfo] | None = ..., @@ -255,11 +255,11 @@ class TarFile: ) -> Self: ... @classmethod def xzopen( - cls: type[Self], + cls, name: StrOrBytesPath | None, - mode: Literal["r", "w", "x"] = ..., - fileobj: IO[bytes] | None = ..., - preset: int | None = ..., + mode: Literal["r", "w", "x"] = "r", + fileobj: IO[bytes] | None = None, + preset: int | None = None, *, format: int | None = ..., tarinfo: type[TarInfo] | None = ..., @@ -273,16 +273,16 @@ class TarFile: def getmember(self, name: str) -> TarInfo: ... def getmembers(self) -> _list[TarInfo]: ... def getnames(self) -> _list[str]: ... - def list(self, verbose: bool = ..., *, members: _list[TarInfo] | None = ...) -> None: ... + def list(self, verbose: bool = True, *, members: _list[TarInfo] | None = None) -> None: ... def next(self) -> TarInfo | None: ... def extractall( - self, path: StrOrBytesPath = ..., members: Iterable[TarInfo] | None = ..., *, numeric_owner: bool = ... + self, path: StrOrBytesPath = ".", members: Iterable[TarInfo] | None = None, *, numeric_owner: bool = False ) -> None: ... def extract( - self, member: str | TarInfo, path: StrOrBytesPath = ..., set_attrs: bool = ..., *, numeric_owner: bool = ... + self, member: str | TarInfo, path: StrOrBytesPath = "", set_attrs: bool = True, *, numeric_owner: bool = False ) -> None: ... def _extract_member( - self, tarinfo: TarInfo, targetpath: str, set_attrs: bool = ..., numeric_owner: bool = ... + self, tarinfo: TarInfo, targetpath: str, set_attrs: bool = True, numeric_owner: bool = False ) -> None: ... # undocumented def extractfile(self, member: str | TarInfo) -> IO[bytes] | None: ... def makedir(self, tarinfo: TarInfo, targetpath: StrOrBytesPath) -> None: ... # undocumented @@ -297,14 +297,14 @@ class TarFile: def add( self, name: StrPath, - arcname: StrPath | None = ..., - recursive: bool = ..., + arcname: StrPath | None = None, + recursive: bool = True, *, - filter: Callable[[TarInfo], TarInfo | None] | None = ..., + filter: Callable[[TarInfo], TarInfo | None] | None = None, ) -> None: ... - def addfile(self, tarinfo: TarInfo, fileobj: IO[bytes] | None = ...) -> None: ... + def addfile(self, tarinfo: TarInfo, fileobj: IO[bytes] | None = None) -> None: ... def gettarinfo( - self, name: StrOrBytesPath | None = ..., arcname: str | None = ..., fileobj: IO[bytes] | None = ... + self, name: StrOrBytesPath | None = None, arcname: str | None = None, fileobj: IO[bytes] | None = None ) -> TarInfo: ... def close(self) -> None: ... @@ -344,17 +344,21 @@ class TarInfo: uname: str gname: str pax_headers: Mapping[str, str] - def __init__(self, name: str = ...) -> None: ... + def __init__(self, name: str = "") -> None: ... @classmethod - def frombuf(cls: Type[Self], buf: bytes, encoding: str, errors: str) -> Self: ... + def frombuf(cls, buf: bytes | bytearray, encoding: str, errors: str) -> Self: ... @classmethod - def fromtarfile(cls: Type[Self], tarfile: TarFile) -> Self: ... + def fromtarfile(cls, tarfile: TarFile) -> Self: ... @property def linkpath(self) -> str: ... @linkpath.setter def linkpath(self, linkname: str) -> None: ... def get_info(self) -> Mapping[str, str | int | bytes | Mapping[str, str]]: ... - def tobuf(self, format: int | None = ..., encoding: str | None = ..., errors: str = ...) -> bytes: ... + if sys.version_info >= (3, 8): + def tobuf(self, format: int | None = 2, encoding: str | None = "utf-8", errors: str = "surrogateescape") -> bytes: ... + else: + def tobuf(self, format: int | None = 1, encoding: str | None = "utf-8", errors: str = "surrogateescape") -> bytes: ... + def create_ustar_header( self, info: Mapping[str, str | int | bytes | Mapping[str, str]], encoding: str, errors: str ) -> bytes: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/telnetlib.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/telnetlib.pyi index 67ae5fcc8..10f6e4930 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/telnetlib.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/telnetlib.pyi @@ -1,9 +1,9 @@ import socket -from _typeshed import Self from collections.abc import Callable, Sequence from re import Match, Pattern from types import TracebackType from typing import Any +from typing_extensions import Self __all__ = ["Telnet"] @@ -88,15 +88,15 @@ NOOPT: bytes class Telnet: host: str | None # undocumented - def __init__(self, host: str | None = ..., port: int = ..., timeout: float = ...) -> None: ... - def open(self, host: str, port: int = ..., timeout: float = ...) -> None: ... + def __init__(self, host: str | None = None, port: int = 0, timeout: float = ...) -> None: ... + def open(self, host: str, port: int = 0, timeout: float = ...) -> None: ... def msg(self, msg: str, *args: Any) -> None: ... def set_debuglevel(self, debuglevel: int) -> None: ... def close(self) -> None: ... def get_socket(self) -> socket.socket: ... def fileno(self) -> int: ... def write(self, buffer: bytes) -> None: ... - def read_until(self, match: bytes, timeout: float | None = ...) -> bytes: ... + def read_until(self, match: bytes, timeout: float | None = None) -> bytes: ... def read_all(self) -> bytes: ... def read_some(self) -> bytes: ... def read_very_eager(self) -> bytes: ... @@ -113,9 +113,9 @@ class Telnet: def mt_interact(self) -> None: ... def listener(self) -> None: ... def expect( - self, list: Sequence[Pattern[bytes] | bytes], timeout: float | None = ... + self, list: Sequence[Pattern[bytes] | bytes], timeout: float | None = None ) -> tuple[int, Match[bytes] | None, bytes]: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, type: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/tempfile.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/tempfile.pyi index 2c096f0fb..cd27e91fb 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/tempfile.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/tempfile.pyi @@ -1,10 +1,10 @@ import io import sys -from _typeshed import BytesPath, GenericPath, Self, StrPath, WriteableBuffer +from _typeshed import BytesPath, GenericPath, ReadableBuffer, StrPath, WriteableBuffer from collections.abc import Iterable, Iterator from types import TracebackType from typing import IO, Any, AnyStr, Generic, overload -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal, Self, TypeAlias if sys.version_info >= (3, 9): from types import GenericAlias @@ -37,76 +37,76 @@ if sys.version_info >= (3, 8): @overload def NamedTemporaryFile( mode: _StrMode, - buffering: int = ..., - encoding: str | None = ..., - newline: str | None = ..., - suffix: AnyStr | None = ..., - prefix: AnyStr | None = ..., - dir: GenericPath[AnyStr] | None = ..., - delete: bool = ..., + buffering: int = -1, + encoding: str | None = None, + newline: str | None = None, + suffix: AnyStr | None = None, + prefix: AnyStr | None = None, + dir: GenericPath[AnyStr] | None = None, + delete: bool = True, *, - errors: str | None = ..., + errors: str | None = None, ) -> _TemporaryFileWrapper[str]: ... @overload def NamedTemporaryFile( - mode: _BytesMode = ..., - buffering: int = ..., - encoding: str | None = ..., - newline: str | None = ..., - suffix: AnyStr | None = ..., - prefix: AnyStr | None = ..., - dir: GenericPath[AnyStr] | None = ..., - delete: bool = ..., + mode: _BytesMode = "w+b", + buffering: int = -1, + encoding: str | None = None, + newline: str | None = None, + suffix: AnyStr | None = None, + prefix: AnyStr | None = None, + dir: GenericPath[AnyStr] | None = None, + delete: bool = True, *, - errors: str | None = ..., + errors: str | None = None, ) -> _TemporaryFileWrapper[bytes]: ... @overload def NamedTemporaryFile( - mode: str = ..., - buffering: int = ..., - encoding: str | None = ..., - newline: str | None = ..., - suffix: AnyStr | None = ..., - prefix: AnyStr | None = ..., - dir: GenericPath[AnyStr] | None = ..., - delete: bool = ..., + mode: str = "w+b", + buffering: int = -1, + encoding: str | None = None, + newline: str | None = None, + suffix: AnyStr | None = None, + prefix: AnyStr | None = None, + dir: GenericPath[AnyStr] | None = None, + delete: bool = True, *, - errors: str | None = ..., + errors: str | None = None, ) -> _TemporaryFileWrapper[Any]: ... else: @overload def NamedTemporaryFile( mode: _StrMode, - buffering: int = ..., - encoding: str | None = ..., - newline: str | None = ..., - suffix: AnyStr | None = ..., - prefix: AnyStr | None = ..., - dir: GenericPath[AnyStr] | None = ..., - delete: bool = ..., + buffering: int = -1, + encoding: str | None = None, + newline: str | None = None, + suffix: AnyStr | None = None, + prefix: AnyStr | None = None, + dir: GenericPath[AnyStr] | None = None, + delete: bool = True, ) -> _TemporaryFileWrapper[str]: ... @overload def NamedTemporaryFile( - mode: _BytesMode = ..., - buffering: int = ..., - encoding: str | None = ..., - newline: str | None = ..., - suffix: AnyStr | None = ..., - prefix: AnyStr | None = ..., - dir: GenericPath[AnyStr] | None = ..., - delete: bool = ..., + mode: _BytesMode = "w+b", + buffering: int = -1, + encoding: str | None = None, + newline: str | None = None, + suffix: AnyStr | None = None, + prefix: AnyStr | None = None, + dir: GenericPath[AnyStr] | None = None, + delete: bool = True, ) -> _TemporaryFileWrapper[bytes]: ... @overload def NamedTemporaryFile( - mode: str = ..., - buffering: int = ..., - encoding: str | None = ..., - newline: str | None = ..., - suffix: AnyStr | None = ..., - prefix: AnyStr | None = ..., - dir: GenericPath[AnyStr] | None = ..., - delete: bool = ..., + mode: str = "w+b", + buffering: int = -1, + encoding: str | None = None, + newline: str | None = None, + suffix: AnyStr | None = None, + prefix: AnyStr | None = None, + dir: GenericPath[AnyStr] | None = None, + delete: bool = True, ) -> _TemporaryFileWrapper[Any]: ... if sys.platform == "win32": @@ -116,38 +116,38 @@ else: @overload def TemporaryFile( mode: _StrMode, - buffering: int = ..., - encoding: str | None = ..., - newline: str | None = ..., - suffix: AnyStr | None = ..., - prefix: AnyStr | None = ..., - dir: GenericPath[AnyStr] | None = ..., + buffering: int = -1, + encoding: str | None = None, + newline: str | None = None, + suffix: AnyStr | None = None, + prefix: AnyStr | None = None, + dir: GenericPath[AnyStr] | None = None, *, - errors: str | None = ..., + errors: str | None = None, ) -> IO[str]: ... @overload def TemporaryFile( - mode: _BytesMode = ..., - buffering: int = ..., - encoding: str | None = ..., - newline: str | None = ..., - suffix: AnyStr | None = ..., - prefix: AnyStr | None = ..., - dir: GenericPath[AnyStr] | None = ..., + mode: _BytesMode = "w+b", + buffering: int = -1, + encoding: str | None = None, + newline: str | None = None, + suffix: AnyStr | None = None, + prefix: AnyStr | None = None, + dir: GenericPath[AnyStr] | None = None, *, - errors: str | None = ..., + errors: str | None = None, ) -> IO[bytes]: ... @overload def TemporaryFile( - mode: str = ..., - buffering: int = ..., - encoding: str | None = ..., - newline: str | None = ..., - suffix: AnyStr | None = ..., - prefix: AnyStr | None = ..., - dir: GenericPath[AnyStr] | None = ..., + mode: str = "w+b", + buffering: int = -1, + encoding: str | None = None, + newline: str | None = None, + suffix: AnyStr | None = None, + prefix: AnyStr | None = None, + dir: GenericPath[AnyStr] | None = None, *, - errors: str | None = ..., + errors: str | None = None, ) -> IO[Any]: ... else: @overload @@ -185,8 +185,8 @@ class _TemporaryFileWrapper(Generic[AnyStr], IO[AnyStr]): file: IO[AnyStr] # io.TextIOWrapper, io.BufferedReader or io.BufferedWriter name: str delete: bool - def __init__(self, file: IO[AnyStr], name: str, delete: bool = ...) -> None: ... - def __enter__(self: Self) -> Self: ... + def __init__(self, file: IO[AnyStr], name: str, delete: bool = True) -> None: ... + def __enter__(self) -> Self: ... def __exit__(self, exc: type[BaseException] | None, value: BaseException | None, tb: TracebackType | None) -> None: ... def __getattr__(self, name: str) -> Any: ... def close(self) -> None: ... @@ -215,7 +215,17 @@ class _TemporaryFileWrapper(Generic[AnyStr], IO[AnyStr]): def tell(self) -> int: ... def truncate(self, size: int | None = ...) -> int: ... def writable(self) -> bool: ... + @overload + def write(self: _TemporaryFileWrapper[str], s: str) -> int: ... + @overload + def write(self: _TemporaryFileWrapper[bytes], s: ReadableBuffer) -> int: ... + @overload def write(self, s: AnyStr) -> int: ... + @overload + def writelines(self: _TemporaryFileWrapper[str], lines: Iterable[str]) -> None: ... + @overload + def writelines(self: _TemporaryFileWrapper[bytes], lines: Iterable[ReadableBuffer]) -> None: ... + @overload def writelines(self, lines: Iterable[AnyStr]) -> None: ... if sys.version_info >= (3, 11): @@ -235,44 +245,72 @@ class SpooledTemporaryFile(IO[AnyStr], _SpooledTemporaryFileBase): @overload def __init__( self: SpooledTemporaryFile[bytes], - max_size: int = ..., - mode: _BytesMode = ..., - buffering: int = ..., - encoding: str | None = ..., - newline: str | None = ..., - suffix: str | None = ..., - prefix: str | None = ..., - dir: str | None = ..., + max_size: int = 0, + mode: _BytesMode = "w+b", + buffering: int = -1, + encoding: str | None = None, + newline: str | None = None, + suffix: str | None = None, + prefix: str | None = None, + dir: str | None = None, *, - errors: str | None = ..., + errors: str | None = None, ) -> None: ... @overload def __init__( self: SpooledTemporaryFile[str], - max_size: int = ..., - mode: _StrMode = ..., - buffering: int = ..., - encoding: str | None = ..., - newline: str | None = ..., - suffix: str | None = ..., - prefix: str | None = ..., - dir: str | None = ..., + max_size: int, + mode: _StrMode, + buffering: int = -1, + encoding: str | None = None, + newline: str | None = None, + suffix: str | None = None, + prefix: str | None = None, + dir: str | None = None, + *, + errors: str | None = None, + ) -> None: ... + @overload + def __init__( + self: SpooledTemporaryFile[str], + max_size: int = 0, *, - errors: str | None = ..., + mode: _StrMode, + buffering: int = -1, + encoding: str | None = None, + newline: str | None = None, + suffix: str | None = None, + prefix: str | None = None, + dir: str | None = None, + errors: str | None = None, ) -> None: ... @overload def __init__( self, - max_size: int = ..., - mode: str = ..., - buffering: int = ..., - encoding: str | None = ..., - newline: str | None = ..., - suffix: str | None = ..., - prefix: str | None = ..., - dir: str | None = ..., + max_size: int, + mode: str, + buffering: int = -1, + encoding: str | None = None, + newline: str | None = None, + suffix: str | None = None, + prefix: str | None = None, + dir: str | None = None, + *, + errors: str | None = None, + ) -> None: ... + @overload + def __init__( + self, + max_size: int = 0, *, - errors: str | None = ..., + mode: str, + buffering: int = -1, + encoding: str | None = None, + newline: str | None = None, + suffix: str | None = None, + prefix: str | None = None, + dir: str | None = None, + errors: str | None = None, ) -> None: ... @property def errors(self) -> str | None: ... @@ -280,42 +318,68 @@ class SpooledTemporaryFile(IO[AnyStr], _SpooledTemporaryFileBase): @overload def __init__( self: SpooledTemporaryFile[bytes], - max_size: int = ..., - mode: _BytesMode = ..., - buffering: int = ..., - encoding: str | None = ..., - newline: str | None = ..., - suffix: str | None = ..., - prefix: str | None = ..., - dir: str | None = ..., + max_size: int = 0, + mode: _BytesMode = "w+b", + buffering: int = -1, + encoding: str | None = None, + newline: str | None = None, + suffix: str | None = None, + prefix: str | None = None, + dir: str | None = None, ) -> None: ... @overload def __init__( self: SpooledTemporaryFile[str], - max_size: int = ..., - mode: _StrMode = ..., - buffering: int = ..., - encoding: str | None = ..., - newline: str | None = ..., - suffix: str | None = ..., - prefix: str | None = ..., - dir: str | None = ..., + max_size: int, + mode: _StrMode, + buffering: int = -1, + encoding: str | None = None, + newline: str | None = None, + suffix: str | None = None, + prefix: str | None = None, + dir: str | None = None, + ) -> None: ... + @overload + def __init__( + self: SpooledTemporaryFile[str], + max_size: int = 0, + *, + mode: _StrMode, + buffering: int = -1, + encoding: str | None = None, + newline: str | None = None, + suffix: str | None = None, + prefix: str | None = None, + dir: str | None = None, ) -> None: ... @overload def __init__( self, - max_size: int = ..., - mode: str = ..., - buffering: int = ..., - encoding: str | None = ..., - newline: str | None = ..., - suffix: str | None = ..., - prefix: str | None = ..., - dir: str | None = ..., + max_size: int, + mode: str, + buffering: int = -1, + encoding: str | None = None, + newline: str | None = None, + suffix: str | None = None, + prefix: str | None = None, + dir: str | None = None, + ) -> None: ... + @overload + def __init__( + self, + max_size: int = 0, + *, + mode: str, + buffering: int = -1, + encoding: str | None = None, + newline: str | None = None, + suffix: str | None = None, + prefix: str | None = None, + dir: str | None = None, ) -> None: ... def rollover(self) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__(self, exc: type[BaseException] | None, value: BaseException | None, tb: TracebackType | None) -> None: ... # These methods are copied from the abstract methods of IO, because # SpooledTemporaryFile implements IO. @@ -337,9 +401,19 @@ class SpooledTemporaryFile(IO[AnyStr], _SpooledTemporaryFileBase): def readlines(self, __hint: int = ...) -> list[AnyStr]: ... # type: ignore[override] def seek(self, offset: int, whence: int = ...) -> int: ... def tell(self) -> int: ... - def truncate(self, size: int | None = ...) -> None: ... # type: ignore[override] + def truncate(self, size: int | None = None) -> None: ... # type: ignore[override] + @overload + def write(self: SpooledTemporaryFile[str], s: str) -> int: ... + @overload + def write(self: SpooledTemporaryFile[bytes], s: ReadableBuffer) -> int: ... + @overload def write(self, s: AnyStr) -> int: ... - def writelines(self, iterable: Iterable[AnyStr]) -> None: ... # type: ignore[override] + @overload + def writelines(self: SpooledTemporaryFile[str], iterable: Iterable[str]) -> None: ... + @overload + def writelines(self: SpooledTemporaryFile[bytes], iterable: Iterable[ReadableBuffer]) -> None: ... + @overload + def writelines(self, iterable: Iterable[AnyStr]) -> None: ... def __iter__(self) -> Iterator[AnyStr]: ... # type: ignore[override] # These exist at runtime only on 3.11+. def readable(self) -> bool: ... @@ -355,27 +429,30 @@ class TemporaryDirectory(Generic[AnyStr]): @overload def __init__( self: TemporaryDirectory[str], - suffix: str | None = ..., - prefix: str | None = ..., - dir: StrPath | None = ..., - ignore_cleanup_errors: bool = ..., + suffix: str | None = None, + prefix: str | None = None, + dir: StrPath | None = None, + ignore_cleanup_errors: bool = False, ) -> None: ... @overload def __init__( self: TemporaryDirectory[bytes], - suffix: bytes | None = ..., - prefix: bytes | None = ..., - dir: BytesPath | None = ..., - ignore_cleanup_errors: bool = ..., + suffix: bytes | None = None, + prefix: bytes | None = None, + dir: BytesPath | None = None, + ignore_cleanup_errors: bool = False, ) -> None: ... else: @overload def __init__( - self: TemporaryDirectory[str], suffix: str | None = ..., prefix: str | None = ..., dir: StrPath | None = ... + self: TemporaryDirectory[str], suffix: str | None = None, prefix: str | None = None, dir: StrPath | None = None ) -> None: ... @overload def __init__( - self: TemporaryDirectory[bytes], suffix: bytes | None = ..., prefix: bytes | None = ..., dir: BytesPath | None = ... + self: TemporaryDirectory[bytes], + suffix: bytes | None = None, + prefix: bytes | None = None, + dir: BytesPath | None = None, ) -> None: ... def cleanup(self) -> None: ... @@ -387,19 +464,19 @@ class TemporaryDirectory(Generic[AnyStr]): # The overloads overlap, but they should still work fine. @overload def mkstemp( # type: ignore[misc] - suffix: str | None = ..., prefix: str | None = ..., dir: StrPath | None = ..., text: bool = ... + suffix: str | None = None, prefix: str | None = None, dir: StrPath | None = None, text: bool = False ) -> tuple[int, str]: ... @overload def mkstemp( - suffix: bytes | None = ..., prefix: bytes | None = ..., dir: BytesPath | None = ..., text: bool = ... + suffix: bytes | None = None, prefix: bytes | None = None, dir: BytesPath | None = None, text: bool = False ) -> tuple[int, bytes]: ... # The overloads overlap, but they should still work fine. @overload -def mkdtemp(suffix: str | None = ..., prefix: str | None = ..., dir: StrPath | None = ...) -> str: ... # type: ignore[misc] +def mkdtemp(suffix: str | None = None, prefix: str | None = None, dir: StrPath | None = None) -> str: ... # type: ignore[misc] @overload -def mkdtemp(suffix: bytes | None = ..., prefix: bytes | None = ..., dir: BytesPath | None = ...) -> bytes: ... -def mktemp(suffix: str = ..., prefix: str = ..., dir: StrPath | None = ...) -> str: ... +def mkdtemp(suffix: bytes | None = None, prefix: bytes | None = None, dir: BytesPath | None = None) -> bytes: ... +def mktemp(suffix: str = "", prefix: str = "tmp", dir: StrPath | None = None) -> str: ... def gettempdirb() -> bytes: ... def gettempprefixb() -> bytes: ... def gettempdir() -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/termios.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/termios.pyi index 494162a49..bf8d7bee2 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/termios.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/termios.pyi @@ -4,9 +4,9 @@ from typing import Any from typing_extensions import TypeAlias if sys.platform != "win32": + # Must be a list of length 7, containing 6 ints and a list of NCCS 1-character bytes or ints. _Attr: TypeAlias = list[int | list[bytes | int]] - # TODO constants not really documented B0: int B1000000: int B110: int @@ -44,17 +44,22 @@ if sys.platform != "win32": BSDLY: int CBAUD: int CBAUDEX: int + CDEL: int CDSUSP: int CEOF: int CEOL: int + CEOL2: int CEOT: int CERASE: int + CESC: int CFLUSH: int CIBAUD: int CINTR: int CKILL: int CLNEXT: int CLOCAL: int + CNUL: int + COMMON: int CQUIT: int CR0: int CR1: int @@ -73,6 +78,7 @@ if sys.platform != "win32": CSTOP: int CSTOPB: int CSUSP: int + CSWTCH: int CWERASE: int ECHO: int ECHOCTL: int @@ -93,6 +99,7 @@ if sys.platform != "win32": FIONREAD: int FLUSHO: int HUPCL: int + IBSHIFT: int ICANON: int ICRNL: int IEXTEN: int @@ -100,6 +107,7 @@ if sys.platform != "win32": IGNCR: int IGNPAR: int IMAXBEL: int + INIT_C_CC: int INLCR: int INPCK: int IOCSIZE_MASK: int @@ -110,17 +118,18 @@ if sys.platform != "win32": IXANY: int IXOFF: int IXON: int + N_MOUSE: int + N_PPP: int + N_SLIP: int + N_STRIP: int + N_TTY: int NCC: int NCCS: int NL0: int NL1: int NLDLY: int NOFLSH: int - N_MOUSE: int - N_PPP: int - N_SLIP: int - N_STRIP: int - N_TTY: int + NSWTCH: int OCRNL: int OFDEL: int OFILL: int @@ -151,6 +160,7 @@ if sys.platform != "win32": TCSADRAIN: int TCSAFLUSH: int TCSANOW: int + TCSASOFT: int TCSBRK: int TCSBRKP: int TCSETA: int @@ -167,15 +177,11 @@ if sys.platform != "win32": TIOCGLCKTRMIOS: int TIOCGPGRP: int TIOCGSERIAL: int + TIOCGSIZE: int TIOCGSOFTCAR: int TIOCGWINSZ: int TIOCINQ: int TIOCLINUX: int - TIOCMBIC: int - TIOCMBIS: int - TIOCMGET: int - TIOCMIWAIT: int - TIOCMSET: int TIOCM_CAR: int TIOCM_CD: int TIOCM_CTS: int @@ -187,10 +193,14 @@ if sys.platform != "win32": TIOCM_RTS: int TIOCM_SR: int TIOCM_ST: int + TIOCMBIC: int + TIOCMBIS: int + TIOCMGET: int + TIOCMIWAIT: int + TIOCMSET: int TIOCNOTTY: int TIOCNXCL: int TIOCOUTQ: int - TIOCPKT: int TIOCPKT_DATA: int TIOCPKT_DOSTOP: int TIOCPKT_FLUSHREAD: int @@ -198,7 +208,9 @@ if sys.platform != "win32": TIOCPKT_NOSTOP: int TIOCPKT_START: int TIOCPKT_STOP: int + TIOCPKT: int TIOCSCTTY: int + TIOCSER_TEMT: int TIOCSERCONFIG: int TIOCSERGETLSR: int TIOCSERGETMULTI: int @@ -206,14 +218,15 @@ if sys.platform != "win32": TIOCSERGWILD: int TIOCSERSETMULTI: int TIOCSERSWILD: int - TIOCSER_TEMT: int TIOCSETD: int TIOCSLCKTRMIOS: int TIOCSPGRP: int TIOCSSERIAL: int + TIOCSSIZE: int TIOCSSOFTCAR: int TIOCSTI: int TIOCSWINSZ: int + TIOCTTYGSTRUCT: int TOSTOP: int VDISCARD: int VEOF: int @@ -238,7 +251,8 @@ if sys.platform != "win32": VWERASE: int XCASE: int XTABS: int - def tcgetattr(__fd: FileDescriptorLike) -> list[Any]: ... + + def tcgetattr(__fd: FileDescriptorLike) -> list[Any]: ... # Returns _Attr; we use Any to avoid a union in the return type def tcsetattr(__fd: FileDescriptorLike, __when: int, __attributes: _Attr) -> None: ... def tcsendbreak(__fd: FileDescriptorLike, __duration: int) -> None: ... def tcdrain(__fd: FileDescriptorLike) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/textwrap.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/textwrap.pyi index 9e423cb5c..c00cce3c2 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/textwrap.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/textwrap.pyi @@ -27,19 +27,19 @@ class TextWrapper: x: str # leaked loop variable def __init__( self, - width: int = ..., - initial_indent: str = ..., - subsequent_indent: str = ..., - expand_tabs: bool = ..., - replace_whitespace: bool = ..., - fix_sentence_endings: bool = ..., - break_long_words: bool = ..., - drop_whitespace: bool = ..., - break_on_hyphens: bool = ..., - tabsize: int = ..., + width: int = 70, + initial_indent: str = "", + subsequent_indent: str = "", + expand_tabs: bool = True, + replace_whitespace: bool = True, + fix_sentence_endings: bool = False, + break_long_words: bool = True, + drop_whitespace: bool = True, + break_on_hyphens: bool = True, + tabsize: int = 8, *, - max_lines: int | None = ..., - placeholder: str = ..., + max_lines: int | None = None, + placeholder: str = " [...]", ) -> None: ... # Private methods *are* part of the documented API for subclasses. def _munge_whitespace(self, text: str) -> str: ... @@ -53,51 +53,51 @@ class TextWrapper: def wrap( text: str, - width: int = ..., + width: int = 70, *, - initial_indent: str = ..., - subsequent_indent: str = ..., - expand_tabs: bool = ..., - tabsize: int = ..., - replace_whitespace: bool = ..., - fix_sentence_endings: bool = ..., - break_long_words: bool = ..., - break_on_hyphens: bool = ..., - drop_whitespace: bool = ..., - max_lines: int = ..., - placeholder: str = ..., + initial_indent: str = "", + subsequent_indent: str = "", + expand_tabs: bool = True, + tabsize: int = 8, + replace_whitespace: bool = True, + fix_sentence_endings: bool = False, + break_long_words: bool = True, + break_on_hyphens: bool = True, + drop_whitespace: bool = True, + max_lines: int | None = None, + placeholder: str = " [...]", ) -> list[str]: ... def fill( text: str, - width: int = ..., + width: int = 70, *, - initial_indent: str = ..., - subsequent_indent: str = ..., - expand_tabs: bool = ..., - tabsize: int = ..., - replace_whitespace: bool = ..., - fix_sentence_endings: bool = ..., - break_long_words: bool = ..., - break_on_hyphens: bool = ..., - drop_whitespace: bool = ..., - max_lines: int = ..., - placeholder: str = ..., + initial_indent: str = "", + subsequent_indent: str = "", + expand_tabs: bool = True, + tabsize: int = 8, + replace_whitespace: bool = True, + fix_sentence_endings: bool = False, + break_long_words: bool = True, + break_on_hyphens: bool = True, + drop_whitespace: bool = True, + max_lines: int | None = None, + placeholder: str = " [...]", ) -> str: ... def shorten( text: str, width: int, *, - initial_indent: str = ..., - subsequent_indent: str = ..., - expand_tabs: bool = ..., - tabsize: int = ..., - replace_whitespace: bool = ..., - fix_sentence_endings: bool = ..., - break_long_words: bool = ..., - break_on_hyphens: bool = ..., - drop_whitespace: bool = ..., + initial_indent: str = "", + subsequent_indent: str = "", + expand_tabs: bool = True, + tabsize: int = 8, + replace_whitespace: bool = True, + fix_sentence_endings: bool = False, + break_long_words: bool = True, + break_on_hyphens: bool = True, + drop_whitespace: bool = True, # Omit `max_lines: int = None`, it is forced to 1 here. - placeholder: str = ..., + placeholder: str = " [...]", ) -> str: ... def dedent(text: str) -> str: ... -def indent(text: str, prefix: str, predicate: Callable[[str], bool] | None = ...) -> str: ... +def indent(text: str, prefix: str, predicate: Callable[[str], bool] | None = None) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/threading.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/threading.pyi index 289a86826..c01797880 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/threading.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/threading.pyi @@ -3,6 +3,7 @@ from _typeshed import ProfileFunction, TraceFunction from collections.abc import Callable, Iterable, Mapping from types import TracebackType from typing import Any, TypeVar +from typing_extensions import final _T = TypeVar("_T") @@ -74,17 +75,17 @@ class Thread: daemon: bool def __init__( self, - group: None = ..., - target: Callable[..., object] | None = ..., - name: str | None = ..., + group: None = None, + target: Callable[..., object] | None = None, + name: str | None = None, args: Iterable[Any] = ..., - kwargs: Mapping[str, Any] | None = ..., + kwargs: Mapping[str, Any] | None = None, *, - daemon: bool | None = ..., + daemon: bool | None = None, ) -> None: ... def start(self) -> None: ... def run(self) -> None: ... - def join(self, timeout: float | None = ...) -> None: ... + def join(self, timeout: float | None = None) -> None: ... if sys.version_info >= (3, 8): @property def native_id(self) -> int | None: ... # only available on some platforms @@ -101,8 +102,8 @@ class Thread: class _DummyThread(Thread): def __init__(self) -> None: ... +@final class Lock: - def __init__(self) -> None: ... def __enter__(self) -> bool: ... def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None @@ -111,9 +112,9 @@ class Lock: def release(self) -> None: ... def locked(self) -> bool: ... +@final class _RLock: - def __init__(self) -> None: ... - def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ... + def acquire(self, blocking: bool = True, timeout: float = -1) -> bool: ... def release(self) -> None: ... __enter__ = acquire def __exit__(self, t: type[BaseException] | None, v: BaseException | None, tb: TracebackType | None) -> None: ... @@ -121,39 +122,38 @@ class _RLock: RLock = _RLock class Condition: - def __init__(self, lock: Lock | _RLock | None = ...) -> None: ... + def __init__(self, lock: Lock | _RLock | None = None) -> None: ... def __enter__(self) -> bool: ... def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None ) -> None: ... def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ... def release(self) -> None: ... - def wait(self, timeout: float | None = ...) -> bool: ... - def wait_for(self, predicate: Callable[[], _T], timeout: float | None = ...) -> _T: ... - def notify(self, n: int = ...) -> None: ... + 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: ... def notify_all(self) -> None: ... def notifyAll(self) -> None: ... # deprecated alias for notify_all() class Semaphore: _value: int - def __init__(self, value: int = ...) -> None: ... + def __init__(self, value: int = 1) -> None: ... def __exit__(self, t: type[BaseException] | None, v: BaseException | None, tb: TracebackType | None) -> None: ... - def acquire(self, blocking: bool = ..., timeout: float | None = ...) -> bool: ... - def __enter__(self, blocking: bool = ..., timeout: float | None = ...) -> bool: ... + def acquire(self, blocking: bool = True, timeout: float | None = None) -> bool: ... + def __enter__(self, blocking: bool = True, timeout: float | None = None) -> bool: ... if sys.version_info >= (3, 9): - def release(self, n: int = ...) -> None: ... + def release(self, n: int = 1) -> None: ... else: def release(self) -> None: ... class BoundedSemaphore(Semaphore): ... class Event: - def __init__(self) -> None: ... def is_set(self) -> bool: ... def isSet(self) -> bool: ... # deprecated alias for is_set() def set(self) -> None: ... def clear(self) -> None: ... - def wait(self, timeout: float | None = ...) -> bool: ... + def wait(self, timeout: float | None = None) -> bool: ... if sys.version_info >= (3, 8): from _thread import _excepthook, _ExceptHookArgs @@ -172,8 +172,8 @@ class Timer(Thread): self, interval: float, function: Callable[..., object], - args: Iterable[Any] | None = ..., - kwargs: Mapping[str, Any] | None = ..., + args: Iterable[Any] | None = None, + kwargs: Mapping[str, Any] | None = None, ) -> None: ... def cancel(self) -> None: ... @@ -184,8 +184,8 @@ class Barrier: def n_waiting(self) -> int: ... @property def broken(self) -> bool: ... - def __init__(self, parties: int, action: Callable[[], None] | None = ..., timeout: float | None = ...) -> None: ... - def wait(self, timeout: float | None = ...) -> int: ... + def __init__(self, parties: int, action: Callable[[], None] | None = None, timeout: float | None = None) -> None: ... + def wait(self, timeout: float | None = None) -> int: ... def reset(self) -> None: ... def abort(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/timeit.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/timeit.pyi index dda6cefed..a5da943c8 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/timeit.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/timeit.pyi @@ -11,22 +11,22 @@ default_timer: _Timer class Timer: def __init__( - self, stmt: _Stmt = ..., setup: _Stmt = ..., timer: _Timer = ..., globals: dict[str, Any] | None = ... + self, stmt: _Stmt = "pass", setup: _Stmt = "pass", timer: _Timer = ..., globals: dict[str, Any] | None = None ) -> None: ... - def print_exc(self, file: IO[str] | None = ...) -> None: ... - def timeit(self, number: int = ...) -> float: ... - def repeat(self, repeat: int = ..., number: int = ...) -> list[float]: ... - def autorange(self, callback: Callable[[int, float], object] | None = ...) -> tuple[int, float]: ... + def print_exc(self, file: IO[str] | None = None) -> None: ... + def timeit(self, number: int = 1000000) -> float: ... + def repeat(self, repeat: int = 5, number: int = 1000000) -> list[float]: ... + def autorange(self, callback: Callable[[int, float], object] | None = None) -> tuple[int, float]: ... def timeit( - stmt: _Stmt = ..., setup: _Stmt = ..., timer: _Timer = ..., number: int = ..., globals: dict[str, Any] | None = ... + stmt: _Stmt = "pass", setup: _Stmt = "pass", timer: _Timer = ..., number: int = 1000000, globals: dict[str, Any] | None = None ) -> float: ... def repeat( - stmt: _Stmt = ..., - setup: _Stmt = ..., + stmt: _Stmt = "pass", + setup: _Stmt = "pass", timer: _Timer = ..., - repeat: int = ..., - number: int = ..., - globals: dict[str, Any] | None = ..., + repeat: int = 5, + number: int = 1000000, + globals: dict[str, Any] | None = None, ) -> list[float]: ... -def main(args: Sequence[str] | None = ..., *, _wrap_timer: Callable[[_Timer], _Timer] | None = ...) -> None: ... +def main(args: Sequence[str] | None = None, *, _wrap_timer: Callable[[_Timer], _Timer] | None = None) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/__init__.pyi index d8dd463b5..7b4b06be4 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/__init__.pyi @@ -6,7 +6,7 @@ from enum import Enum from tkinter.constants import * from tkinter.font import _FontDescription from types import TracebackType -from typing import Any, Generic, NamedTuple, Protocol, TypeVar, Union, overload +from typing import Any, Generic, NamedTuple, Protocol, TypeVar, overload, type_check_only from typing_extensions import Literal, TypeAlias, TypedDict if sys.version_info >= (3, 9): @@ -178,19 +178,17 @@ _ButtonCommand: TypeAlias = str | Callable[[], Any] # accepts string of tcl cod _CanvasItemId: TypeAlias = int _Color: TypeAlias = str # typically '#rrggbb', '#rgb' or color names. _Compound: TypeAlias = Literal["top", "left", "center", "right", "bottom", "none"] # -compound in manual page named 'options' -_Cursor: TypeAlias = Union[ - str, tuple[str], tuple[str, str], tuple[str, str, str], tuple[str, str, str, str] -] # manual page: Tk_GetCursor -_EntryValidateCommand: TypeAlias = ( - str | list[str] | tuple[str, ...] | Callable[[], bool] -) # example when it's sequence: entry['invalidcommand'] = [entry.register(print), '%P'] -_GridIndex: TypeAlias = int | str | Literal["all"] +# manual page: Tk_GetCursor +_Cursor: TypeAlias = str | tuple[str] | tuple[str, str] | tuple[str, str, str] | tuple[str, str, str, str] +# example when it's sequence: entry['invalidcommand'] = [entry.register(print), '%P'] +_EntryValidateCommand: TypeAlias = str | list[str] | tuple[str, ...] | Callable[[], bool] +_GridIndex: TypeAlias = int | str _ImageSpec: TypeAlias = _Image | str # str can be from e.g. tkinter.image_names() _Relief: TypeAlias = Literal["raised", "sunken", "flat", "ridge", "solid", "groove"] # manual page: Tk_GetRelief _ScreenUnits: TypeAlias = str | float # Often the right type instead of int. Manual page: Tk_GetPixels # -xscrollcommand and -yscrollcommand in 'options' manual page _XYScrollCommand: TypeAlias = str | Callable[[float, float], object] -_TakeFocusValue: TypeAlias = Union[int, Literal[""], Callable[[str], bool | None]] # -takefocus in manual page named 'options' +_TakeFocusValue: TypeAlias = int | Literal[""] | Callable[[str], bool | None] # -takefocus in manual page named 'options' if sys.version_info >= (3, 11): class _VersionInfoType(NamedTuple): @@ -271,7 +269,7 @@ def NoDefaultRoot() -> None: ... _TraceMode: TypeAlias = Literal["array", "read", "write", "unset"] class Variable: - def __init__(self, master: Misc | None = ..., value: Incomplete | None = ..., name: str | None = ...) -> None: ... + def __init__(self, master: Misc | None = None, value: Incomplete | None = None, name: str | None = None) -> None: ... def set(self, value) -> None: ... initialize = set def get(self): ... @@ -285,30 +283,30 @@ class Variable: def __eq__(self, other: object) -> bool: ... class StringVar(Variable): - def __init__(self, master: Misc | None = ..., value: str | None = ..., name: str | None = ...) -> None: ... + def __init__(self, master: Misc | None = None, value: str | None = None, name: str | None = None) -> None: ... def set(self, value: str) -> None: ... initialize = set def get(self) -> str: ... class IntVar(Variable): - def __init__(self, master: Misc | None = ..., value: int | None = ..., name: str | None = ...) -> None: ... + def __init__(self, master: Misc | None = None, value: int | None = None, name: str | None = None) -> None: ... def set(self, value: int) -> None: ... initialize = set def get(self) -> int: ... class DoubleVar(Variable): - def __init__(self, master: Misc | None = ..., value: float | None = ..., name: str | None = ...) -> None: ... + def __init__(self, master: Misc | None = None, value: float | None = None, name: str | None = None) -> None: ... def set(self, value: float) -> None: ... initialize = set def get(self) -> float: ... class BooleanVar(Variable): - def __init__(self, master: Misc | None = ..., value: bool | None = ..., name: str | None = ...) -> None: ... + def __init__(self, master: Misc | None = None, value: bool | None = None, name: str | None = None) -> None: ... def set(self, value: bool) -> None: ... initialize = set def get(self) -> bool: ... -def mainloop(n: int = ...) -> None: ... +def mainloop(n: int = 0) -> None: ... getint: Incomplete getdouble: Incomplete @@ -327,15 +325,15 @@ class Misc: children: dict[str, Widget] def destroy(self) -> None: ... def deletecommand(self, name: str) -> None: ... - def tk_strictMotif(self, boolean: Incomplete | None = ...): ... + def tk_strictMotif(self, boolean: Incomplete | None = None): ... def tk_bisque(self) -> None: ... def tk_setPalette(self, *args, **kw) -> None: ... - def wait_variable(self, name: str | Variable = ...) -> None: ... + def wait_variable(self, name: str | Variable = "PY_VAR") -> None: ... waitvar = wait_variable - def wait_window(self, window: Misc | None = ...) -> None: ... - def wait_visibility(self, window: Misc | None = ...) -> None: ... - def setvar(self, name: str = ..., value: str = ...) -> None: ... - def getvar(self, name: str = ...): ... + def wait_window(self, window: Misc | None = None) -> None: ... + def wait_visibility(self, window: Misc | None = None) -> None: ... + def setvar(self, name: str = "PY_VAR", value: str = "1") -> None: ... + def getvar(self, name: str = "PY_VAR"): ... def getint(self, s): ... def getdouble(self, s): ... def getboolean(self, s): ... @@ -349,13 +347,13 @@ class Misc: def tk_focusNext(self) -> Misc | None: ... def tk_focusPrev(self) -> Misc | None: ... @overload - def after(self, ms: int, func: None = ...) -> None: ... + def after(self, ms: int, func: None = None) -> None: ... @overload def after(self, ms: int | Literal["idle"], func: Callable[..., object], *args: Any) -> str: ... # after_idle is essentially partialmethod(after, "idle") def after_idle(self, func: Callable[..., object], *args: Any) -> str: ... def after_cancel(self, id: str) -> None: ... - def bell(self, displayof: Literal[0] | Misc | None = ...) -> None: ... + def bell(self, displayof: Literal[0] | Misc | None = 0) -> None: ... def clipboard_get(self, *, displayof: Misc = ..., type: str = ...) -> str: ... def clipboard_clear(self, *, displayof: Misc = ...) -> None: ... def clipboard_append(self, string: str, *, displayof: Misc = ..., format: str = ..., type: str = ...) -> None: ... @@ -365,42 +363,42 @@ class Misc: def grab_set_global(self) -> None: ... def grab_status(self) -> Literal["local", "global"] | None: ... def option_add( - self, pattern, value, priority: int | Literal["widgetDefault", "startupFile", "userDefault", "interactive"] | None = ... + self, pattern, value, priority: int | Literal["widgetDefault", "startupFile", "userDefault", "interactive"] | None = None ) -> None: ... def option_clear(self) -> None: ... def option_get(self, name, className): ... - def option_readfile(self, fileName, priority: Incomplete | None = ...) -> None: ... + def option_readfile(self, fileName, priority: Incomplete | None = None) -> None: ... def selection_clear(self, **kw) -> None: ... def selection_get(self, **kw): ... def selection_handle(self, command, **kw) -> None: ... def selection_own(self, **kw) -> None: ... def selection_own_get(self, **kw): ... def send(self, interp, cmd, *args): ... - def lower(self, belowThis: Incomplete | None = ...) -> None: ... - def tkraise(self, aboveThis: Incomplete | None = ...) -> None: ... + def lower(self, belowThis: Incomplete | None = None) -> None: ... + def tkraise(self, aboveThis: Incomplete | None = None) -> None: ... lift = tkraise if sys.version_info >= (3, 11): def info_patchlevel(self) -> _VersionInfoType: ... - def winfo_atom(self, name: str, displayof: Literal[0] | Misc | None = ...) -> int: ... - def winfo_atomname(self, id: int, displayof: Literal[0] | Misc | None = ...) -> str: ... + def winfo_atom(self, name: str, displayof: Literal[0] | Misc | None = 0) -> int: ... + def winfo_atomname(self, id: int, displayof: Literal[0] | Misc | None = 0) -> str: ... def winfo_cells(self) -> int: ... def winfo_children(self) -> list[Widget]: ... # Widget because it can't be Toplevel or Tk def winfo_class(self) -> str: ... def winfo_colormapfull(self) -> bool: ... - def winfo_containing(self, rootX: int, rootY: int, displayof: Literal[0] | Misc | None = ...) -> Misc | None: ... + def winfo_containing(self, rootX: int, rootY: int, displayof: Literal[0] | Misc | None = 0) -> Misc | None: ... def winfo_depth(self) -> int: ... def winfo_exists(self) -> bool: ... def winfo_fpixels(self, number: _ScreenUnits) -> float: ... def winfo_geometry(self) -> str: ... def winfo_height(self) -> int: ... def winfo_id(self) -> int: ... - def winfo_interps(self, displayof: Literal[0] | Misc | None = ...) -> tuple[str, ...]: ... + def winfo_interps(self, displayof: Literal[0] | Misc | None = 0) -> tuple[str, ...]: ... def winfo_ismapped(self) -> bool: ... def winfo_manager(self) -> str: ... def winfo_name(self) -> str: ... def winfo_parent(self) -> str: ... # return value needs nametowidget() - def winfo_pathname(self, id: int, displayof: Literal[0] | Misc | None = ...): ... + def winfo_pathname(self, id: int, displayof: Literal[0] | Misc | None = 0): ... def winfo_pixels(self, number: _ScreenUnits) -> int: ... def winfo_pointerx(self) -> int: ... def winfo_pointerxy(self) -> tuple[int, int]: ... @@ -423,7 +421,7 @@ class Misc: def winfo_viewable(self) -> bool: ... def winfo_visual(self) -> str: ... def winfo_visualid(self) -> str: ... - def winfo_visualsavailable(self, includeids: int = ...) -> list[tuple[str, int]]: ... + def winfo_visualsavailable(self, includeids: bool = False) -> list[tuple[str, int]]: ... def winfo_vrootheight(self) -> int: ... def winfo_vrootwidth(self) -> int: ... def winfo_vrootx(self) -> int: ... @@ -434,7 +432,7 @@ class Misc: def update(self) -> None: ... def update_idletasks(self) -> None: ... @overload - def bindtags(self, tagList: None = ...) -> tuple[str, ...]: ... + def bindtags(self, tagList: None = None) -> tuple[str, ...]: ... @overload def bindtags(self, tagList: list[str] | tuple[str, ...]) -> None: ... # bind with isinstance(func, str) doesn't return anything, but all other @@ -442,49 +440,49 @@ class Misc: @overload def bind( self, - sequence: str | None = ..., - func: Callable[[Event[Misc]], object] | None = ..., - add: Literal["", "+"] | bool | None = ..., + sequence: str | None = None, + func: Callable[[Event[Misc]], object] | None = None, + add: Literal["", "+"] | bool | None = None, ) -> str: ... @overload - def bind(self, sequence: str | None, func: str, add: Literal["", "+"] | bool | None = ...) -> None: ... + def bind(self, sequence: str | None, func: str, add: Literal["", "+"] | bool | None = None) -> None: ... @overload - def bind(self, *, func: str, add: Literal["", "+"] | bool | None = ...) -> None: ... + def bind(self, *, func: str, add: Literal["", "+"] | bool | None = None) -> None: ... # There's no way to know what type of widget bind_all and bind_class # callbacks will get, so those are Misc. @overload def bind_all( self, - sequence: str | None = ..., - func: Callable[[Event[Misc]], object] | None = ..., - add: Literal["", "+"] | bool | None = ..., + sequence: str | None = None, + func: Callable[[Event[Misc]], object] | None = None, + add: Literal["", "+"] | bool | None = None, ) -> str: ... @overload - def bind_all(self, sequence: str | None, func: str, add: Literal["", "+"] | bool | None = ...) -> None: ... + def bind_all(self, sequence: str | None, func: str, add: Literal["", "+"] | bool | None = None) -> None: ... @overload - def bind_all(self, *, func: str, add: Literal["", "+"] | bool | None = ...) -> None: ... + def bind_all(self, *, func: str, add: Literal["", "+"] | bool | None = None) -> None: ... @overload def bind_class( self, className: str, - sequence: str | None = ..., - func: Callable[[Event[Misc]], object] | None = ..., - add: Literal["", "+"] | bool | None = ..., + sequence: str | None = None, + func: Callable[[Event[Misc]], object] | None = None, + add: Literal["", "+"] | bool | None = None, ) -> str: ... @overload - def bind_class(self, className: str, sequence: str | None, func: str, add: Literal["", "+"] | bool | None = ...) -> None: ... + def bind_class(self, className: str, sequence: str | None, func: str, add: Literal["", "+"] | bool | None = None) -> None: ... @overload - def bind_class(self, className: str, *, func: str, add: Literal["", "+"] | bool | None = ...) -> None: ... - def unbind(self, sequence: str, funcid: str | None = ...) -> None: ... + def bind_class(self, className: str, *, func: str, add: Literal["", "+"] | bool | None = None) -> None: ... + def unbind(self, sequence: str, funcid: str | None = None) -> None: ... def unbind_all(self, sequence: str) -> None: ... def unbind_class(self, className: str, sequence: str) -> None: ... - def mainloop(self, n: int = ...) -> None: ... + def mainloop(self, n: int = 0) -> None: ... def quit(self) -> None: ... @property def _windowingsystem(self) -> Literal["win32", "aqua", "x11"]: ... def nametowidget(self, name: str | Misc | _tkinter.Tcl_Obj) -> Any: ... def register( - self, func: Callable[..., object], subst: Callable[..., Sequence[Any]] | None = ..., needcleanup: int = ... + self, func: Callable[..., object], subst: Callable[..., Sequence[Any]] | None = None, needcleanup: int = 1 ) -> str: ... def keys(self) -> list[str]: ... @overload @@ -492,14 +490,14 @@ class Misc: @overload def pack_propagate(self) -> None: ... propagate = pack_propagate - def grid_anchor(self, anchor: _Anchor | None = ...) -> None: ... + def grid_anchor(self, anchor: _Anchor | None = None) -> None: ... anchor = grid_anchor @overload def grid_bbox( - self, column: None = ..., row: None = ..., col2: None = ..., row2: None = ... + self, column: None = None, row: None = None, col2: None = None, row2: None = None ) -> tuple[int, int, int, int] | None: ... @overload - def grid_bbox(self, column: int, row: int, col2: None = ..., row2: None = ...) -> tuple[int, int, int, int] | None: ... + def grid_bbox(self, column: int, row: int, col2: None = None, row2: None = None) -> tuple[int, int, int, int] | None: ... @overload def grid_bbox(self, column: int, row: int, col2: int, row2: int) -> tuple[int, int, int, int] | None: ... bbox = grid_bbox @@ -534,7 +532,7 @@ class Misc: size = grid_size # Widget because Toplevel or Tk is never a slave def pack_slaves(self) -> list[Widget]: ... - def grid_slaves(self, row: int | None = ..., column: int | None = ...) -> list[Widget]: ... + def grid_slaves(self, row: int | None = None, column: int | None = None) -> list[Widget]: ... def place_slaves(self) -> list[Widget]: ... slaves = pack_slaves def event_add(self, virtual: str, *sequences: str) -> None: ... @@ -571,14 +569,14 @@ class Misc: x: _ScreenUnits = ..., y: _ScreenUnits = ..., ) -> None: ... - def event_info(self, virtual: str | None = ...) -> tuple[str, ...]: ... + def event_info(self, virtual: str | None = None) -> tuple[str, ...]: ... def image_names(self) -> tuple[str, ...]: ... def image_types(self) -> tuple[str, ...]: ... # See #4363 and #4891 def __setitem__(self, key: str, value: Any) -> None: ... def __getitem__(self, key: str) -> Any: ... def cget(self, key: str) -> Any: ... - def configure(self, cnf: Any = ...) -> Any: ... + def configure(self, cnf: Any = None) -> Any: ... # TODO: config is an alias of configure, but adding that here creates lots of mypy errors class CallWrapper: @@ -615,7 +613,7 @@ class Wm: def wm_aspect(self, minNumer: int, minDenom: int, maxNumer: int, maxDenom: int) -> None: ... @overload def wm_aspect( - self, minNumer: None = ..., minDenom: None = ..., maxNumer: None = ..., maxDenom: None = ... + self, minNumer: None = None, minDenom: None = None, maxNumer: None = None, maxDenom: None = None ) -> tuple[int, int, int, int] | None: ... aspect = wm_aspect @overload @@ -625,7 +623,7 @@ class Wm: @overload def wm_attributes(self, __option: str, __value, *__other_option_value_pairs: Any) -> None: ... attributes = wm_attributes - def wm_client(self, name: str | None = ...) -> str: ... + def wm_client(self, name: str | None = None) -> str: ... client = wm_client @overload def wm_colormapwindows(self) -> list[Misc]: ... @@ -634,91 +632,91 @@ class Wm: @overload def wm_colormapwindows(self, __first_wlist_item: Misc, *other_wlist_items: Misc) -> None: ... colormapwindows = wm_colormapwindows - def wm_command(self, value: str | None = ...) -> str: ... + def wm_command(self, value: str | None = None) -> str: ... command = wm_command # Some of these always return empty string, but return type is set to None to prevent accidentally using it def wm_deiconify(self) -> None: ... deiconify = wm_deiconify - def wm_focusmodel(self, model: Literal["active", "passive"] | None = ...) -> Literal["active", "passive", ""]: ... + def wm_focusmodel(self, model: Literal["active", "passive"] | None = None) -> Literal["active", "passive", ""]: ... focusmodel = wm_focusmodel def wm_forget(self, window: Wm) -> None: ... forget = wm_forget def wm_frame(self) -> str: ... frame = wm_frame @overload - def wm_geometry(self, newGeometry: None = ...) -> str: ... + def wm_geometry(self, newGeometry: None = None) -> str: ... @overload def wm_geometry(self, newGeometry: str) -> None: ... geometry = wm_geometry def wm_grid( self, - baseWidth: Incomplete | None = ..., - baseHeight: Incomplete | None = ..., - widthInc: Incomplete | None = ..., - heightInc: Incomplete | None = ..., + baseWidth: Incomplete | None = None, + baseHeight: Incomplete | None = None, + widthInc: Incomplete | None = None, + heightInc: Incomplete | None = None, ): ... grid = wm_grid - def wm_group(self, pathName: Incomplete | None = ...): ... + def wm_group(self, pathName: Incomplete | None = None): ... group = wm_group - def wm_iconbitmap(self, bitmap: Incomplete | None = ..., default: Incomplete | None = ...): ... + def wm_iconbitmap(self, bitmap: Incomplete | None = None, default: Incomplete | None = None): ... iconbitmap = wm_iconbitmap def wm_iconify(self) -> None: ... iconify = wm_iconify - def wm_iconmask(self, bitmap: Incomplete | None = ...): ... + def wm_iconmask(self, bitmap: Incomplete | None = None): ... iconmask = wm_iconmask - def wm_iconname(self, newName: Incomplete | None = ...) -> str: ... + def wm_iconname(self, newName: Incomplete | None = None) -> str: ... iconname = wm_iconname - def wm_iconphoto(self, default: bool, __image1: Image, *args: Image) -> None: ... + def wm_iconphoto(self, default: bool, __image1: _PhotoImageLike | str, *args: _PhotoImageLike | str) -> None: ... iconphoto = wm_iconphoto - def wm_iconposition(self, x: int | None = ..., y: int | None = ...) -> tuple[int, int] | None: ... + def wm_iconposition(self, x: int | None = None, y: int | None = None) -> tuple[int, int] | None: ... iconposition = wm_iconposition - def wm_iconwindow(self, pathName: Incomplete | None = ...): ... + def wm_iconwindow(self, pathName: Incomplete | None = None): ... iconwindow = wm_iconwindow def wm_manage(self, widget) -> None: ... manage = wm_manage @overload - def wm_maxsize(self, width: None = ..., height: None = ...) -> tuple[int, int]: ... + def wm_maxsize(self, width: None = None, height: None = None) -> tuple[int, int]: ... @overload def wm_maxsize(self, width: int, height: int) -> None: ... maxsize = wm_maxsize @overload - def wm_minsize(self, width: None = ..., height: None = ...) -> tuple[int, int]: ... + def wm_minsize(self, width: None = None, height: None = None) -> tuple[int, int]: ... @overload def wm_minsize(self, width: int, height: int) -> None: ... minsize = wm_minsize @overload - def wm_overrideredirect(self, boolean: None = ...) -> bool | None: ... # returns True or None + def wm_overrideredirect(self, boolean: None = None) -> bool | None: ... # returns True or None @overload def wm_overrideredirect(self, boolean: bool) -> None: ... overrideredirect = wm_overrideredirect - def wm_positionfrom(self, who: Literal["program", "user"] | None = ...) -> Literal["", "program", "user"]: ... + def wm_positionfrom(self, who: Literal["program", "user"] | None = None) -> Literal["", "program", "user"]: ... positionfrom = wm_positionfrom @overload def wm_protocol(self, name: str, func: Callable[[], object] | str) -> None: ... @overload - def wm_protocol(self, name: str, func: None = ...) -> str: ... + def wm_protocol(self, name: str, func: None = None) -> str: ... @overload - def wm_protocol(self, name: None = ..., func: None = ...) -> tuple[str, ...]: ... + def wm_protocol(self, name: None = None, func: None = None) -> tuple[str, ...]: ... protocol = wm_protocol @overload - def wm_resizable(self, width: None = ..., height: None = ...) -> tuple[bool, bool]: ... + def wm_resizable(self, width: None = None, height: None = None) -> tuple[bool, bool]: ... @overload def wm_resizable(self, width: bool, height: bool) -> None: ... resizable = wm_resizable - def wm_sizefrom(self, who: Literal["program", "user"] | None = ...) -> Literal["", "program", "user"]: ... + def wm_sizefrom(self, who: Literal["program", "user"] | None = None) -> Literal["", "program", "user"]: ... sizefrom = wm_sizefrom @overload - def wm_state(self, newstate: None = ...) -> str: ... + def wm_state(self, newstate: None = None) -> str: ... @overload def wm_state(self, newstate: str) -> None: ... state = wm_state @overload - def wm_title(self, string: None = ...) -> str: ... + def wm_title(self, string: None = None) -> str: ... @overload def wm_title(self, string: str) -> None: ... title = wm_title @overload - def wm_transient(self, master: None = ...) -> _tkinter.Tcl_Obj: ... + def wm_transient(self, master: None = None) -> _tkinter.Tcl_Obj: ... @overload def wm_transient(self, master: Wm | _tkinter.Tcl_Obj) -> None: ... transient = wm_transient @@ -735,17 +733,17 @@ class Tk(Misc, Wm): # args. # use `git grep screenName` to find them self, - screenName: str | None = ..., - baseName: str | None = ..., - className: str = ..., - useTk: bool = ..., - sync: bool = ..., - use: str | None = ..., + screenName: str | None = None, + baseName: str | None = None, + className: str = "Tk", + useTk: bool = True, + sync: bool = False, + use: str | None = None, ) -> None: ... @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, background: _Color = ..., bd: _ScreenUnits = ..., @@ -802,7 +800,7 @@ class Tk(Misc, Wm): def wantobjects(self, *args, **kwargs): ... def willdispatch(self): ... -def Tcl(screenName: str | None = ..., baseName: str | None = ..., className: str = ..., useTk: bool = ...) -> Tk: ... +def Tcl(screenName: str | None = None, baseName: str | None = None, className: str = "Tk", useTk: bool = False) -> Tk: ... _InMiscTotal = TypedDict("_InMiscTotal", {"in": Misc}) _InMiscNonTotal = TypedDict("_InMiscNonTotal", {"in": Misc}, total=False) @@ -933,14 +931,14 @@ class Widget(BaseWidget, Pack, Place, Grid): @overload def bind( self: _W, - sequence: str | None = ..., - func: Callable[[Event[_W]], object] | None = ..., - add: Literal["", "+"] | bool | None = ..., + sequence: str | None = None, + func: Callable[[Event[_W]], object] | None = None, + add: Literal["", "+"] | bool | None = None, ) -> str: ... @overload - def bind(self, sequence: str | None, func: str, add: Literal["", "+"] | bool | None = ...) -> None: ... + def bind(self, sequence: str | None, func: str, add: Literal["", "+"] | bool | None = None) -> None: ... @overload - def bind(self, *, func: str, add: Literal["", "+"] | bool | None = ...) -> None: ... + def bind(self, *, func: str, add: Literal["", "+"] | bool | None = None) -> None: ... class Toplevel(BaseWidget, Wm): # Toplevel and Tk have the same options because they correspond to the same @@ -948,7 +946,7 @@ class Toplevel(BaseWidget, Wm): # copy/pasted here instead of aliasing as 'config = Tk.config'. def __init__( self, - master: Misc | None = ..., + master: Misc | None = None, cnf: dict[str, Any] | None = ..., *, background: _Color = ..., @@ -978,7 +976,7 @@ class Toplevel(BaseWidget, Wm): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, background: _Color = ..., bd: _ScreenUnits = ..., @@ -1004,7 +1002,7 @@ class Toplevel(BaseWidget, Wm): class Button(Widget): def __init__( self, - master: Misc | None = ..., + master: Misc | None = None, cnf: dict[str, Any] | None = ..., *, activebackground: _Color = ..., @@ -1053,7 +1051,7 @@ class Button(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, activebackground: _Color = ..., activeforeground: _Color = ..., @@ -1101,7 +1099,7 @@ class Button(Widget): class Canvas(Widget, XView, YView): def __init__( self, - master: Misc | None = ..., + master: Misc | None = None, cnf: dict[str, Any] | None = ..., *, background: _Color = ..., @@ -1144,7 +1142,7 @@ class Canvas(Widget, XView, YView): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, background: _Color = ..., bd: _ScreenUnits = ..., @@ -1189,8 +1187,8 @@ class Canvas(Widget, XView, YView): newtag: str, x: _ScreenUnits, y: _ScreenUnits, - halo: _ScreenUnits | None = ..., - start: str | _CanvasItemId | None = ..., + halo: _ScreenUnits | None = None, + start: str | _CanvasItemId | None = None, ) -> None: ... def addtag_enclosed(self, newtag: str, x1: _ScreenUnits, y1: _ScreenUnits, x2: _ScreenUnits, y2: _ScreenUnits) -> None: ... def addtag_overlapping(self, newtag: str, x1: _ScreenUnits, y1: _ScreenUnits, x2: _ScreenUnits, y2: _ScreenUnits) -> None: ... @@ -1200,7 +1198,7 @@ class Canvas(Widget, XView, YView): def find_all(self) -> tuple[_CanvasItemId, ...]: ... def find_below(self, tagOrId: str | _CanvasItemId) -> tuple[_CanvasItemId, ...]: ... def find_closest( - self, x: _ScreenUnits, y: _ScreenUnits, halo: _ScreenUnits | None = ..., start: str | _CanvasItemId | None = ... + self, x: _ScreenUnits, y: _ScreenUnits, halo: _ScreenUnits | None = None, start: str | _CanvasItemId | None = None ) -> tuple[_CanvasItemId, ...]: ... def find_enclosed( self, x1: _ScreenUnits, y1: _ScreenUnits, x2: _ScreenUnits, y2: _ScreenUnits @@ -1213,19 +1211,19 @@ class Canvas(Widget, XView, YView): def tag_bind( self, tagOrId: str | _CanvasItemId, - sequence: str | None = ..., - func: Callable[[Event[Canvas]], object] | None = ..., - add: Literal["", "+"] | bool | None = ..., + sequence: str | None = None, + func: Callable[[Event[Canvas]], object] | None = None, + add: Literal["", "+"] | bool | None = None, ) -> str: ... @overload def tag_bind( - self, tagOrId: str | int, sequence: str | None, func: str, add: Literal["", "+"] | bool | None = ... + self, tagOrId: str | int, sequence: str | None, func: str, add: Literal["", "+"] | bool | None = None ) -> None: ... @overload - def tag_bind(self, tagOrId: str | _CanvasItemId, *, func: str, add: Literal["", "+"] | bool | None = ...) -> None: ... - def tag_unbind(self, tagOrId: str | _CanvasItemId, sequence: str, funcid: str | None = ...) -> None: ... - def canvasx(self, screenx, gridspacing: Incomplete | None = ...): ... - def canvasy(self, screeny, gridspacing: Incomplete | None = ...): ... + def tag_bind(self, tagOrId: str | _CanvasItemId, *, func: str, add: Literal["", "+"] | bool | None = None) -> None: ... + def tag_unbind(self, tagOrId: str | _CanvasItemId, sequence: str, funcid: str | None = None) -> None: ... + def canvasx(self, screenx, gridspacing: Incomplete | None = None): ... + def canvasy(self, screeny, gridspacing: Incomplete | None = None): ... @overload def coords(self, __tagOrId: str | _CanvasItemId) -> list[float]: ... @overload @@ -1716,12 +1714,12 @@ class Canvas(Widget, XView, YView): def itemcget(self, tagOrId, option): ... # itemconfigure kwargs depend on item type, which is not known when type checking def itemconfigure( - self, tagOrId: str | _CanvasItemId, cnf: dict[str, Any] | None = ..., **kw: Any + self, tagOrId: str | _CanvasItemId, cnf: dict[str, Any] | None = None, **kw: Any ) -> dict[str, tuple[str, str, str, str, str]] | None: ... itemconfig = itemconfigure def move(self, *args) -> None: ... if sys.version_info >= (3, 8): - def moveto(self, tagOrId: str | _CanvasItemId, x: Literal[""] | float = ..., y: Literal[""] | float = ...) -> None: ... + def moveto(self, tagOrId: str | _CanvasItemId, x: Literal[""] | float = "", y: Literal[""] | float = "") -> None: ... def postscript(self, cnf=..., **kw): ... # tkinter does: @@ -1736,7 +1734,7 @@ class Canvas(Widget, XView, YView): def lift(self, __first: str | _CanvasItemId, __second: str | _CanvasItemId | None = ...) -> None: ... # type: ignore[override] def scale(self, *args) -> None: ... def scan_mark(self, x, y) -> None: ... - def scan_dragto(self, x, y, gain: int = ...) -> None: ... + def scan_dragto(self, x, y, gain: int = 10) -> None: ... def select_adjust(self, tagOrId, index) -> None: ... def select_clear(self) -> None: ... def select_from(self, tagOrId, index) -> None: ... @@ -1747,7 +1745,7 @@ class Canvas(Widget, XView, YView): class Checkbutton(Widget): def __init__( self, - master: Misc | None = ..., + master: Misc | None = None, cnf: dict[str, Any] | None = ..., *, activebackground: _Color = ..., @@ -1807,7 +1805,7 @@ class Checkbutton(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, activebackground: _Color = ..., activeforeground: _Color = ..., @@ -1866,7 +1864,7 @@ _EntryIndex: TypeAlias = str | int # "INDICES" in manual page class Entry(Widget, XView): def __init__( self, - master: Misc | None = ..., + master: Misc | None = None, cnf: dict[str, Any] | None = ..., *, background: _Color = ..., @@ -1911,7 +1909,7 @@ class Entry(Widget, XView): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, background: _Color = ..., bd: _ScreenUnits = ..., @@ -1954,7 +1952,7 @@ class Entry(Widget, XView): @overload def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... config = configure - def delete(self, first: _EntryIndex, last: _EntryIndex | None = ...) -> None: ... + def delete(self, first: _EntryIndex, last: _EntryIndex | None = None) -> None: ... def get(self) -> str: ... def icursor(self, index: _EntryIndex) -> None: ... def index(self, index: _EntryIndex) -> int: ... @@ -1977,7 +1975,7 @@ class Entry(Widget, XView): class Frame(Widget): def __init__( self, - master: Misc | None = ..., + master: Misc | None = None, cnf: dict[str, Any] | None = ..., *, background: _Color = ..., @@ -2004,7 +2002,7 @@ class Frame(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, background: _Color = ..., bd: _ScreenUnits = ..., @@ -2029,7 +2027,7 @@ class Frame(Widget): class Label(Widget): def __init__( self, - master: Misc | None = ..., + master: Misc | None = None, cnf: dict[str, Any] | None = ..., *, activebackground: _Color = ..., @@ -2068,7 +2066,7 @@ class Label(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, activebackground: _Color = ..., activeforeground: _Color = ..., @@ -2109,7 +2107,7 @@ class Label(Widget): class Listbox(Widget, XView, YView): def __init__( self, - master: Misc | None = ..., + master: Misc | None = None, cnf: dict[str, Any] | None = ..., *, activestyle: Literal["dotbox", "none", "underline"] = ..., @@ -2160,7 +2158,7 @@ class Listbox(Widget, XView, YView): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, activestyle: Literal["dotbox", "none", "underline"] = ..., background: _Color = ..., @@ -2198,8 +2196,8 @@ class Listbox(Widget, XView, YView): def activate(self, index: str | int) -> None: ... def bbox(self, index: str | int) -> tuple[int, int, int, int] | None: ... # type: ignore[override] def curselection(self): ... - def delete(self, first: str | int, last: str | int | None = ...) -> None: ... - def get(self, first: str | int, last: str | int | None = ...): ... + def delete(self, first: str | int, last: str | int | None = None) -> None: ... + def get(self, first: str | int, last: str | int | None = None): ... def index(self, index: str | int) -> int: ... def insert(self, index: str | int, *elements: str | float) -> None: ... def nearest(self, y): ... @@ -2208,21 +2206,21 @@ class Listbox(Widget, XView, YView): def see(self, index: str | int) -> None: ... def selection_anchor(self, index: str | int) -> None: ... select_anchor = selection_anchor - def selection_clear(self, first: str | int, last: str | int | None = ...) -> None: ... # type: ignore[override] + def selection_clear(self, first: str | int, last: str | int | None = None) -> None: ... # type: ignore[override] select_clear = selection_clear def selection_includes(self, index: str | int): ... select_includes = selection_includes - def selection_set(self, first: str | int, last: str | int | None = ...) -> None: ... + def selection_set(self, first: str | int, last: str | int | None = None) -> None: ... select_set = selection_set def size(self) -> int: ... # type: ignore[override] def itemcget(self, index: str | int, option): ... - def itemconfigure(self, index: str | int, cnf: Incomplete | None = ..., **kw): ... + def itemconfigure(self, index: str | int, cnf: Incomplete | None = None, **kw): ... itemconfig = itemconfigure class Menu(Widget): def __init__( self, - master: Misc | None = ..., + master: Misc | None = None, cnf: dict[str, Any] | None = ..., *, activebackground: _Color = ..., @@ -2254,7 +2252,7 @@ class Menu(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, activebackground: _Color = ..., activeborderwidth: _ScreenUnits = ..., @@ -2281,7 +2279,7 @@ class Menu(Widget): @overload def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... config = configure - def tk_popup(self, x: int, y: int, entry: str | int = ...) -> None: ... + def tk_popup(self, x: int, y: int, entry: str | int = "") -> None: ... def activate(self, index: str | int) -> None: ... def add(self, itemType, cnf=..., **kw): ... # docstring says "Internal function." def insert(self, index, itemType, cnf=..., **kw): ... # docstring says "Internal function." @@ -2475,10 +2473,10 @@ class Menu(Widget): variable: Variable = ..., ) -> None: ... def insert_separator(self, index: str | int, cnf: dict[str, Any] | None = ..., *, background: _Color = ...) -> None: ... - def delete(self, index1: str | int, index2: str | int | None = ...) -> None: ... + def delete(self, index1: str | int, index2: str | int | None = None) -> None: ... def entrycget(self, index: str | int, option: str) -> Any: ... def entryconfigure( - self, index: str | int, cnf: dict[str, Any] | None = ..., **kw: Any + self, index: str | int, cnf: dict[str, Any] | None = None, **kw: Any ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ... entryconfig = entryconfigure def index(self, index: str | int) -> int | None: ... @@ -2492,7 +2490,7 @@ class Menu(Widget): class Menubutton(Widget): def __init__( self, - master: Misc | None = ..., + master: Misc | None = None, cnf: dict[str, Any] | None = ..., *, activebackground: _Color = ..., @@ -2534,7 +2532,7 @@ class Menubutton(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, activebackground: _Color = ..., activeforeground: _Color = ..., @@ -2578,7 +2576,7 @@ class Menubutton(Widget): class Message(Widget): def __init__( self, - master: Misc | None = ..., + master: Misc | None = None, cnf: dict[str, Any] | None = ..., *, anchor: _Anchor = ..., @@ -2609,7 +2607,7 @@ class Message(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, anchor: _Anchor = ..., aspect: int = ..., @@ -2641,7 +2639,7 @@ class Message(Widget): class Radiobutton(Widget): def __init__( self, - master: Misc | None = ..., + master: Misc | None = None, cnf: dict[str, Any] | None = ..., *, activebackground: _Color = ..., @@ -2690,7 +2688,7 @@ class Radiobutton(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, activebackground: _Color = ..., activeforeground: _Color = ..., @@ -2745,7 +2743,7 @@ class Radiobutton(Widget): class Scale(Widget): def __init__( self, - master: Misc | None = ..., + master: Misc | None = None, cnf: dict[str, Any] | None = ..., *, activebackground: _Color = ..., @@ -2788,7 +2786,7 @@ class Scale(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, activebackground: _Color = ..., background: _Color = ..., @@ -2830,13 +2828,13 @@ class Scale(Widget): config = configure def get(self) -> float: ... def set(self, value) -> None: ... - def coords(self, value: float | None = ...) -> tuple[int, int]: ... + def coords(self, value: float | None = None) -> tuple[int, int]: ... def identify(self, x, y) -> Literal["", "slider", "trough1", "trough2"]: ... class Scrollbar(Widget): def __init__( self, - master: Misc | None = ..., + master: Misc | None = None, cnf: dict[str, Any] | None = ..., *, activebackground: _Color = ..., @@ -2869,7 +2867,7 @@ class Scrollbar(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, activebackground: _Color = ..., activerelief: _Relief = ..., @@ -2896,7 +2894,7 @@ class Scrollbar(Widget): @overload def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... config = configure - def activate(self, index: Incomplete | None = ...): ... + def activate(self, index: Incomplete | None = None): ... def delta(self, deltax: int, deltay: int) -> float: ... def fraction(self, x: int, y: int) -> float: ... def identify(self, x: int, y: int) -> Literal["arrow1", "arrow2", "slider", "trough1", "trough2", ""]: ... @@ -2908,7 +2906,7 @@ _TextIndex: TypeAlias = _tkinter.Tcl_Obj | str | float | Misc class Text(Widget, XView, YView): def __init__( self, - master: Misc | None = ..., + master: Misc | None = None, cnf: dict[str, Any] | None = ..., *, autoseparators: bool = ..., @@ -2965,7 +2963,7 @@ class Text(Widget, XView, YView): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, autoseparators: bool = ..., background: _Color = ..., @@ -3020,17 +3018,17 @@ class Text(Widget, XView, YView): def compare(self, index1: _TextIndex, op: Literal["<", "<=", "==", ">=", ">", "!="], index2: _TextIndex) -> bool: ... def count(self, index1, index2, *args): ... # TODO @overload - def debug(self, boolean: None = ...) -> bool: ... + def debug(self, boolean: None = None) -> bool: ... @overload def debug(self, boolean: bool) -> None: ... - def delete(self, index1: _TextIndex, index2: _TextIndex | None = ...) -> None: ... + def delete(self, index1: _TextIndex, index2: _TextIndex | None = None) -> None: ... def dlineinfo(self, index: _TextIndex) -> tuple[int, int, int, int, int] | None: ... @overload def dump( self, index1: _TextIndex, - index2: _TextIndex | None = ..., - command: None = ..., + index2: _TextIndex | None = None, + command: None = None, *, all: bool = ..., image: bool = ..., @@ -3057,7 +3055,7 @@ class Text(Widget, XView, YView): def dump( self, index1: _TextIndex, - index2: _TextIndex | None = ..., + index2: _TextIndex | None = None, *, command: Callable[[str, str, str], object] | str, all: bool = ..., @@ -3069,23 +3067,23 @@ class Text(Widget, XView, YView): ) -> None: ... def edit(self, *args): ... # docstring says "Internal method" @overload - def edit_modified(self, arg: None = ...) -> bool: ... # actually returns Literal[0, 1] + def edit_modified(self, arg: None = None) -> bool: ... # actually returns Literal[0, 1] @overload def edit_modified(self, arg: bool) -> None: ... # actually returns empty string def edit_redo(self) -> None: ... # actually returns empty string def edit_reset(self) -> None: ... # actually returns empty string def edit_separator(self) -> None: ... # actually returns empty string def edit_undo(self) -> None: ... # actually returns empty string - def get(self, index1: _TextIndex, index2: _TextIndex | None = ...) -> str: ... + def get(self, index1: _TextIndex, index2: _TextIndex | None = None) -> str: ... # TODO: image_* methods def image_cget(self, index, option): ... - def image_configure(self, index, cnf: Incomplete | None = ..., **kw): ... + def image_configure(self, index, cnf: Incomplete | None = None, **kw): ... def image_create(self, index, cnf=..., **kw): ... def image_names(self): ... def index(self, index: _TextIndex) -> str: ... def insert(self, index: _TextIndex, chars: str, *args: str | list[str] | tuple[str, ...]) -> None: ... @overload - def mark_gravity(self, markName: str, direction: None = ...) -> Literal["left", "right"]: ... + def mark_gravity(self, markName: str, direction: None = None) -> Literal["left", "right"]: ... @overload def mark_gravity(self, markName: str, direction: Literal["left", "right"]) -> None: ... # actually returns empty string def mark_names(self) -> tuple[str, ...]: ... @@ -3103,14 +3101,14 @@ class Text(Widget, XView, YView): self, pattern: str, index: _TextIndex, - stopindex: _TextIndex | None = ..., - forwards: bool | None = ..., - backwards: bool | None = ..., - exact: bool | None = ..., - regexp: bool | None = ..., - nocase: bool | None = ..., - count: Variable | None = ..., - elide: bool | None = ..., + stopindex: _TextIndex | None = None, + forwards: bool | None = None, + backwards: bool | None = None, + exact: bool | None = None, + regexp: bool | None = None, + nocase: bool | None = None, + count: Variable | None = None, + elide: bool | None = None, ) -> str: ... # returns empty string for not found def see(self, index: _TextIndex) -> None: ... def tag_add(self, tagName: str, index1: _TextIndex, *args: _TextIndex) -> None: ... @@ -3121,18 +3119,18 @@ class Text(Widget, XView, YView): tagName: str, sequence: str | None, func: Callable[[Event[Text]], object] | None, - add: Literal["", "+"] | bool | None = ..., + add: Literal["", "+"] | bool | None = None, ) -> str: ... @overload - def tag_bind(self, tagName: str, sequence: str | None, func: str, add: Literal["", "+"] | bool | None = ...) -> None: ... - def tag_unbind(self, tagName: str, sequence: str, funcid: str | None = ...) -> None: ... + def tag_bind(self, tagName: str, sequence: str | None, func: str, add: Literal["", "+"] | bool | None = None) -> None: ... + def tag_unbind(self, tagName: str, sequence: str, funcid: str | None = None) -> None: ... # allowing any string for cget instead of just Literals because there's no other way to look up tag options def tag_cget(self, tagName: str, option: str): ... @overload def tag_configure( self, tagName: str, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, background: _Color = ..., bgstipple: _Bitmap = ..., @@ -3167,24 +3165,28 @@ class Text(Widget, XView, YView): def tag_configure(self, tagName: str, cnf: str) -> tuple[str, str, str, Any, Any]: ... tag_config = tag_configure def tag_delete(self, __first_tag_name: str, *tagNames: str) -> None: ... # error if no tag names given - def tag_lower(self, tagName: str, belowThis: str | None = ...) -> None: ... - def tag_names(self, index: _TextIndex | None = ...) -> tuple[str, ...]: ... - def tag_nextrange(self, tagName: str, index1: _TextIndex, index2: _TextIndex | None = ...) -> tuple[str, str] | tuple[()]: ... - def tag_prevrange(self, tagName: str, index1: _TextIndex, index2: _TextIndex | None = ...) -> tuple[str, str] | tuple[()]: ... - def tag_raise(self, tagName: str, aboveThis: str | None = ...) -> None: ... + def tag_lower(self, tagName: str, belowThis: str | None = None) -> None: ... + def tag_names(self, index: _TextIndex | None = None) -> tuple[str, ...]: ... + def tag_nextrange( + self, tagName: str, index1: _TextIndex, index2: _TextIndex | None = None + ) -> tuple[str, str] | tuple[()]: ... + def tag_prevrange( + self, tagName: str, index1: _TextIndex, index2: _TextIndex | None = None + ) -> tuple[str, str] | tuple[()]: ... + def tag_raise(self, tagName: str, aboveThis: str | None = None) -> None: ... def tag_ranges(self, tagName: str) -> tuple[_tkinter.Tcl_Obj, ...]: ... # tag_remove and tag_delete are different - def tag_remove(self, tagName: str, index1: _TextIndex, index2: _TextIndex | None = ...) -> None: ... + def tag_remove(self, tagName: str, index1: _TextIndex, index2: _TextIndex | None = None) -> None: ... # TODO: window_* methods def window_cget(self, index, option): ... - def window_configure(self, index, cnf: Incomplete | None = ..., **kw): ... + def window_configure(self, index, cnf: Incomplete | None = None, **kw): ... window_config = window_configure def window_create(self, index, cnf=..., **kw) -> None: ... def window_names(self): ... def yview_pickplace(self, *what): ... # deprecated class _setit: - def __init__(self, var, value, callback: Incomplete | None = ...) -> None: ... + def __init__(self, var, value, callback: Incomplete | None = None) -> None: ... def __call__(self, *args) -> None: ... # manual page: tk_optionMenu @@ -3204,16 +3206,23 @@ class OptionMenu(Menubutton): # configure, config, cget are inherited from Menubutton # destroy and __getitem__ are overridden, signature does not change -class _Image(Protocol): - tk: _tkinter.TkappType - def height(self) -> int: ... - def width(self) -> int: ... +# Marker to indicate that it is a valid bitmap/photo image. PIL implements compatible versions +# which don't share a class hierarchy. The actual API is a __str__() which returns a valid name, +# not something that type checkers can detect. +@type_check_only +class _Image: ... + +@type_check_only +class _BitmapImageLike(_Image): ... + +@type_check_only +class _PhotoImageLike(_Image): ... -class Image: +class Image(_Image): name: Incomplete tk: _tkinter.TkappType def __init__( - self, imgtype, name: Incomplete | None = ..., cnf=..., master: Misc | _tkinter.TkappType | None = ..., **kw + self, imgtype, name: Incomplete | None = None, cnf=..., master: Misc | _tkinter.TkappType | None = None, **kw ) -> None: ... def __del__(self) -> None: ... def __setitem__(self, key, value) -> None: ... @@ -3224,12 +3233,13 @@ class Image: def type(self): ... def width(self) -> int: ... -class PhotoImage(Image): +class PhotoImage(Image, _PhotoImageLike): + # This should be kept in sync with PIL.ImageTK.PhotoImage.__init__() def __init__( self, - name: str | None = ..., + name: str | None = None, cnf: dict[str, Any] = ..., - master: Misc | _tkinter.TkappType | None = ..., + master: Misc | _tkinter.TkappType | None = None, *, data: str | bytes = ..., # not same as data argument of put() format: str = ..., @@ -3255,8 +3265,8 @@ class PhotoImage(Image): def cget(self, option: str) -> str: ... def __getitem__(self, key: str) -> str: ... # always string: image['height'] can be '0' def copy(self) -> PhotoImage: ... - def zoom(self, x: int, y: int | Literal[""] = ...) -> PhotoImage: ... - def subsample(self, x: int, y: int | Literal[""] = ...) -> PhotoImage: ... + def zoom(self, x: int, y: int | Literal[""] = "") -> PhotoImage: ... + def subsample(self, x: int, y: int | Literal[""] = "") -> PhotoImage: ... def get(self, x: int, y: int) -> tuple[int, int, int]: ... def put( self, @@ -3269,19 +3279,20 @@ class PhotoImage(Image): | tuple[list[_Color], ...] | tuple[tuple[_Color, ...], ...] ), - to: tuple[int, int] | None = ..., + to: tuple[int, int] | None = None, ) -> None: ... - def write(self, filename: StrOrBytesPath, format: str | None = ..., from_coords: tuple[int, int] | None = ...) -> None: ... + def write(self, filename: StrOrBytesPath, format: str | None = None, from_coords: tuple[int, int] | None = None) -> None: ... if sys.version_info >= (3, 8): def transparency_get(self, x: int, y: int) -> bool: ... def transparency_set(self, x: int, y: int, boolean: bool) -> None: ... -class BitmapImage(Image): +class BitmapImage(Image, _BitmapImageLike): + # This should be kept in sync with PIL.ImageTK.BitmapImage.__init__() def __init__( self, - name: Incomplete | None = ..., + name: Incomplete | None = None, cnf: dict[str, Any] = ..., - master: Misc | _tkinter.TkappType | None = ..., + master: Misc | _tkinter.TkappType | None = None, *, background: _Color = ..., data: str | bytes = ..., @@ -3297,7 +3308,7 @@ def image_types() -> tuple[str, ...]: ... class Spinbox(Widget, XView): def __init__( self, - master: Misc | None = ..., + master: Misc | None = None, cnf: dict[str, Any] | None = ..., *, activebackground: _Color = ..., @@ -3356,7 +3367,7 @@ class Spinbox(Widget, XView): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, activebackground: _Color = ..., background: _Color = ..., @@ -3413,7 +3424,7 @@ class Spinbox(Widget, XView): def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... config = configure def bbox(self, index) -> tuple[int, int, int, int] | None: ... # type: ignore[override] - def delete(self, first, last: Incomplete | None = ...) -> Literal[""]: ... + def delete(self, first, last: Incomplete | None = None) -> Literal[""]: ... def get(self) -> str: ... def icursor(self, index): ... def identify(self, x: int, y: int) -> Literal["", "buttondown", "buttonup", "entry"]: ... @@ -3427,7 +3438,7 @@ class Spinbox(Widget, XView): def selection(self, *args) -> tuple[int, ...]: ... def selection_adjust(self, index): ... def selection_clear(self): ... - def selection_element(self, element: Incomplete | None = ...): ... + def selection_element(self, element: Incomplete | None = None): ... if sys.version_info >= (3, 8): def selection_from(self, index: int) -> None: ... def selection_present(self) -> None: ... @@ -3437,7 +3448,7 @@ class Spinbox(Widget, XView): class LabelFrame(Widget): def __init__( self, - master: Misc | None = ..., + master: Misc | None = None, cnf: dict[str, Any] | None = ..., *, background: _Color = ..., @@ -3471,7 +3482,7 @@ class LabelFrame(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, background: _Color = ..., bd: _ScreenUnits = ..., @@ -3502,7 +3513,7 @@ class LabelFrame(Widget): class PanedWindow(Widget): def __init__( self, - master: Misc | None = ..., + master: Misc | None = None, cnf: dict[str, Any] | None = ..., *, background: _Color = ..., @@ -3531,7 +3542,7 @@ class PanedWindow(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, background: _Color = ..., bd: _ScreenUnits = ..., @@ -3571,7 +3582,7 @@ class PanedWindow(Widget): def sash_mark(self, index): ... def sash_place(self, index, x, y): ... def panecget(self, child, option): ... - def paneconfigure(self, tagOrId, cnf: Incomplete | None = ..., **kw): ... + def paneconfigure(self, tagOrId, cnf: Incomplete | None = None, **kw): ... paneconfig: Incomplete def panes(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/colorchooser.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/colorchooser.pyi index ac2ea187b..4300d94f5 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/colorchooser.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/colorchooser.pyi @@ -1,4 +1,5 @@ import sys +from tkinter import Misc, _Color from tkinter.commondialog import Dialog from typing import ClassVar @@ -8,4 +9,12 @@ if sys.version_info >= (3, 9): class Chooser(Dialog): command: ClassVar[str] -def askcolor(color: str | bytes | None = ..., **options) -> tuple[None, None] | tuple[tuple[float, float, float], str]: ... +if sys.version_info >= (3, 9): + def askcolor( + color: str | bytes | None = None, *, initialcolor: _Color = ..., parent: Misc = ..., title: str = ... + ) -> tuple[None, None] | tuple[tuple[int, int, int], str]: ... + +else: + def askcolor( + color: str | bytes | None = None, *, initialcolor: _Color = ..., parent: Misc = ..., title: str = ... + ) -> tuple[None, None] | tuple[tuple[float, float, float], str]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/commondialog.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/commondialog.pyi index 49101c7e6..eba3ab5be 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/commondialog.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/commondialog.pyi @@ -10,5 +10,5 @@ class Dialog: command: ClassVar[str | None] master: Incomplete | None options: Mapping[str, Incomplete] - def __init__(self, master: Incomplete | None = ..., **options) -> None: ... - def show(self, **options): ... + def __init__(self, master: Incomplete | None = None, **options: Incomplete) -> None: ... + def show(self, **options: Incomplete) -> Incomplete: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/dialog.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/dialog.pyi index ef7713f40..8825188c7 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/dialog.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/dialog.pyi @@ -12,5 +12,5 @@ DIALOG_ICON: str class Dialog(Widget): widgetName: str num: int - def __init__(self, master: Incomplete | None = ..., cnf: Mapping[str, Any] = ..., **kw) -> None: ... + def __init__(self, master: Incomplete | None = None, cnf: Mapping[str, Any] = ..., **kw: Incomplete) -> None: ... def destroy(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/dnd.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/dnd.pyi index e2cfc43f6..4a6ab42b3 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/dnd.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/dnd.pyi @@ -11,9 +11,9 @@ class _DndSource(Protocol): class DndHandler: root: ClassVar[Tk | None] def __init__(self, source: _DndSource, event: Event[Misc]) -> None: ... - def cancel(self, event: Event[Misc] | None = ...) -> None: ... - def finish(self, event: Event[Misc] | None, commit: int = ...) -> None: ... + def cancel(self, event: Event[Misc] | None = None) -> None: ... + def finish(self, event: Event[Misc] | None, commit: int = 0) -> None: ... def on_motion(self, event: Event[Misc]) -> None: ... def on_release(self, event: Event[Misc]) -> None: ... -def dnd_start(source, event) -> DndHandler | None: ... +def dnd_start(source: _DndSource, event: Event[Misc]) -> DndHandler | None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/filedialog.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/filedialog.pyi index d0b7e451f..10b36e4d3 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/filedialog.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/filedialog.pyi @@ -41,21 +41,21 @@ class FileDialog: filter_button: Button cancel_button: Button def __init__( - self, master, title: Incomplete | None = ... + self, master, title: Incomplete | None = None ) -> None: ... # title is usually a str or None, but e.g. int doesn't raise en exception either how: Incomplete | None - def go(self, dir_or_file=..., pattern: str = ..., default: str = ..., key: Incomplete | None = ...): ... - def quit(self, how: Incomplete | None = ...) -> None: ... + def go(self, dir_or_file=".", pattern: str = "*", default: str = "", key: Incomplete | None = None): ... + def quit(self, how: Incomplete | None = None) -> None: ... def dirs_double_event(self, event) -> None: ... def dirs_select_event(self, event) -> None: ... def files_double_event(self, event) -> None: ... def files_select_event(self, event) -> None: ... def ok_event(self, event) -> None: ... def ok_command(self) -> None: ... - def filter_command(self, event: Incomplete | None = ...) -> None: ... + def filter_command(self, event: Incomplete | None = None) -> None: ... def get_filter(self): ... def get_selection(self): ... - def cancel_command(self, event: Incomplete | None = ...) -> None: ... + def cancel_command(self, event: Incomplete | None = None) -> None: ... def set_filter(self, dir, pat) -> None: ... def set_selection(self, file) -> None: ... @@ -116,7 +116,7 @@ def askdirectory( # TODO: If someone actually uses these, overload to have the actual return type of open(..., mode) def asksaveasfile( - mode: str = ..., + mode: str = "w", *, confirmoverwrite: bool | None = ..., defaultextension: str | None = ..., @@ -128,7 +128,7 @@ def asksaveasfile( typevariable: StringVar | str | None = ..., ) -> IO[Incomplete] | None: ... def askopenfile( - mode: str = ..., + mode: str = "r", *, defaultextension: str | None = ..., filetypes: Iterable[tuple[str, str | list[str] | tuple[str, ...]]] | None = ..., @@ -139,7 +139,7 @@ def askopenfile( typevariable: StringVar | str | None = ..., ) -> IO[Incomplete] | None: ... def askopenfiles( - mode: str = ..., + mode: str = "r", *, defaultextension: str | None = ..., filetypes: Iterable[tuple[str, str | list[str] | tuple[str, ...]]] | None = ..., diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/font.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/font.pyi index dff84e9fa..0a557e921 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/font.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/font.pyi @@ -41,10 +41,10 @@ class Font: self, # In tkinter, 'root' refers to tkinter.Tk by convention, but the code # actually works with any tkinter widget so we use tkinter.Misc. - root: tkinter.Misc | None = ..., - font: _FontDescription | None = ..., - name: str | None = ..., - exists: bool = ..., + root: tkinter.Misc | None = None, + font: _FontDescription | None = None, + name: str | None = None, + exists: bool = False, *, family: str = ..., size: int = ..., @@ -68,19 +68,19 @@ class Font: def cget(self, option: str) -> Any: ... __getitem__ = cget @overload - def actual(self, option: Literal["family"], displayof: tkinter.Misc | None = ...) -> str: ... + def actual(self, option: Literal["family"], displayof: tkinter.Misc | None = None) -> str: ... @overload - def actual(self, option: Literal["size"], displayof: tkinter.Misc | None = ...) -> int: ... + def actual(self, option: Literal["size"], displayof: tkinter.Misc | None = None) -> int: ... @overload - def actual(self, option: Literal["weight"], displayof: tkinter.Misc | None = ...) -> Literal["normal", "bold"]: ... + def actual(self, option: Literal["weight"], displayof: tkinter.Misc | None = None) -> Literal["normal", "bold"]: ... @overload - def actual(self, option: Literal["slant"], displayof: tkinter.Misc | None = ...) -> Literal["roman", "italic"]: ... + def actual(self, option: Literal["slant"], displayof: tkinter.Misc | None = None) -> Literal["roman", "italic"]: ... @overload - def actual(self, option: Literal["underline", "overstrike"], displayof: tkinter.Misc | None = ...) -> bool: ... + def actual(self, option: Literal["underline", "overstrike"], displayof: tkinter.Misc | None = None) -> bool: ... @overload - def actual(self, option: None, displayof: tkinter.Misc | None = ...) -> _FontDict: ... + def actual(self, option: None, displayof: tkinter.Misc | None = None) -> _FontDict: ... @overload - def actual(self, *, displayof: tkinter.Misc | None = ...) -> _FontDict: ... + def actual(self, *, displayof: tkinter.Misc | None = None) -> _FontDict: ... def config( self, *, @@ -99,14 +99,14 @@ class Font: def metrics(self, __option: Literal["fixed"], *, displayof: tkinter.Misc | None = ...) -> bool: ... @overload def metrics(self, *, displayof: tkinter.Misc | None = ...) -> _MetricsDict: ... - def measure(self, text: str, displayof: tkinter.Misc | None = ...) -> int: ... + def measure(self, text: str, displayof: tkinter.Misc | None = None) -> int: ... def __eq__(self, other: object) -> bool: ... -def families(root: tkinter.Misc | None = ..., displayof: tkinter.Misc | None = ...) -> tuple[str, ...]: ... -def names(root: tkinter.Misc | None = ...) -> tuple[str, ...]: ... +def families(root: tkinter.Misc | None = None, displayof: tkinter.Misc | None = None) -> tuple[str, ...]: ... +def names(root: tkinter.Misc | None = None) -> tuple[str, ...]: ... if sys.version_info >= (3, 10): - def nametofont(name: str, root: tkinter.Misc | None = ...) -> Font: ... + def nametofont(name: str, root: tkinter.Misc | None = None) -> Font: ... else: def nametofont(name: str) -> Font: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/messagebox.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/messagebox.pyi index d99c588e3..5a04b66d7 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/messagebox.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/messagebox.pyi @@ -34,11 +34,11 @@ NO: str class Message(Dialog): command: ClassVar[str] -def showinfo(title: str | None = ..., message: str | None = ..., **options) -> str: ... -def showwarning(title: str | None = ..., message: str | None = ..., **options) -> str: ... -def showerror(title: str | None = ..., message: str | None = ..., **options) -> str: ... -def askquestion(title: str | None = ..., message: str | None = ..., **options) -> str: ... -def askokcancel(title: str | None = ..., message: str | None = ..., **options) -> bool: ... -def askyesno(title: str | None = ..., message: str | None = ..., **options) -> bool: ... -def askyesnocancel(title: str | None = ..., message: str | None = ..., **options) -> bool | None: ... -def askretrycancel(title: str | None = ..., message: str | None = ..., **options) -> bool: ... +def showinfo(title: str | None = None, message: str | None = None, **options) -> str: ... +def showwarning(title: str | None = None, message: str | None = None, **options) -> str: ... +def showerror(title: str | None = None, message: str | None = None, **options) -> str: ... +def askquestion(title: str | None = None, message: str | None = None, **options) -> str: ... +def askokcancel(title: str | None = None, message: str | None = None, **options) -> bool: ... +def askyesno(title: str | None = None, message: str | None = None, **options) -> bool: ... +def askyesnocancel(title: str | None = None, message: str | None = None, **options) -> bool | None: ... +def askretrycancel(title: str | None = None, message: str | None = None, **options) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/scrolledtext.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/scrolledtext.pyi index 72f6ca8c0..114f8c3de 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/scrolledtext.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/scrolledtext.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from tkinter import Frame, Misc, Scrollbar, Text __all__ = ["ScrolledText"] @@ -6,4 +7,4 @@ __all__ = ["ScrolledText"] class ScrolledText(Text): frame: Frame vbar: Scrollbar - def __init__(self, master: Misc | None = ..., **kwargs) -> None: ... + def __init__(self, master: Misc | None = None, **kwargs: Incomplete) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/simpledialog.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/simpledialog.pyi index 8ae8b6d28..2c57cce73 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/simpledialog.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/simpledialog.pyi @@ -1,11 +1,11 @@ from tkinter import Event, Frame, Misc, Toplevel class Dialog(Toplevel): - def __init__(self, parent: Misc | None, title: str | None = ...) -> None: ... + def __init__(self, parent: Misc | None, title: str | None = None) -> None: ... def body(self, master: Frame) -> Misc | None: ... def buttonbox(self) -> None: ... - def ok(self, event: Event[Misc] | None = ...) -> None: ... - def cancel(self, event: Event[Misc] | None = ...) -> None: ... + def ok(self, event: Event[Misc] | None = None) -> None: ... + def cancel(self, event: Event[Misc] | None = None) -> None: ... def validate(self) -> bool: ... def apply(self) -> None: ... @@ -13,12 +13,12 @@ class SimpleDialog: def __init__( self, master: Misc | None, - text: str = ..., + text: str = "", buttons: list[str] = ..., - default: int | None = ..., - cancel: int | None = ..., - title: str | None = ..., - class_: str | None = ..., + default: int | None = None, + cancel: int | None = None, + title: str | None = None, + class_: str | None = None, ) -> None: ... def go(self) -> int | None: ... def return_event(self, event: Event[Misc]) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/tix.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/tix.pyi index db568bc4a..5dd6f040f 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/tix.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/tix.pyi @@ -38,22 +38,22 @@ TCL_ALL_EVENTS: Literal[0] class tixCommand: def tix_addbitmapdir(self, directory: str) -> None: ... def tix_cget(self, option: str) -> Any: ... - def tix_configure(self, cnf: dict[str, Any] | None = ..., **kw: Any) -> Any: ... - def tix_filedialog(self, dlgclass: str | None = ...) -> str: ... + def tix_configure(self, cnf: dict[str, Any] | None = None, **kw: Any) -> Any: ... + def tix_filedialog(self, dlgclass: str | None = None) -> str: ... def tix_getbitmap(self, name: str) -> str: ... def tix_getimage(self, name: str) -> str: ... def tix_option_get(self, name: str) -> Any: ... - def tix_resetoptions(self, newScheme: str, newFontSet: str, newScmPrio: str | None = ...) -> None: ... + def tix_resetoptions(self, newScheme: str, newFontSet: str, newScmPrio: str | None = None) -> None: ... class Tk(tkinter.Tk, tixCommand): - def __init__(self, screenName: str | None = ..., baseName: str | None = ..., className: str = ...) -> None: ... + def __init__(self, screenName: str | None = None, baseName: str | None = None, className: str = "Tix") -> None: ... class TixWidget(tkinter.Widget): def __init__( self, - master: tkinter.Misc | None = ..., - widgetName: str | None = ..., - static_options: list[str] | None = ..., + master: tkinter.Misc | None = None, + widgetName: str | None = None, + static_options: list[str] | None = None, cnf: dict[str, Any] = ..., kw: dict[str, Any] = ..., ) -> None: ... @@ -62,52 +62,50 @@ class TixWidget(tkinter.Widget): def subwidget(self, name: str) -> tkinter.Widget: ... def subwidgets_all(self) -> list[tkinter.Widget]: ... def config_all(self, option: Any, value: Any) -> None: ... - def image_create(self, imgtype: str, cnf: dict[str, Any] = ..., master: tkinter.Widget | None = ..., **kw) -> None: ... + def image_create(self, imgtype: str, cnf: dict[str, Any] = ..., master: tkinter.Widget | None = None, **kw) -> None: ... def image_delete(self, imgname: str) -> None: ... class TixSubWidget(TixWidget): - def __init__( - self, master: tkinter.Widget, name: str, destroy_physically: int = ..., check_intermediate: int = ... - ) -> None: ... + def __init__(self, master: tkinter.Widget, name: str, destroy_physically: int = 1, check_intermediate: int = 1) -> None: ... class DisplayStyle: - def __init__(self, itemtype: str, cnf: dict[str, Any] = ..., *, master: tkinter.Widget | None = ..., **kw) -> None: ... + def __init__(self, itemtype: str, cnf: dict[str, Any] = ..., *, master: tkinter.Widget | None = None, **kw) -> None: ... def __getitem__(self, key: str): ... def __setitem__(self, key: str, value: Any) -> None: ... def delete(self) -> None: ... def config(self, cnf: dict[str, Any] = ..., **kw): ... class Balloon(TixWidget): - def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw) -> None: ... + def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> None: ... def bind_widget(self, widget: tkinter.Widget, cnf: dict[str, Any] = ..., **kw) -> None: ... def unbind_widget(self, widget: tkinter.Widget) -> None: ... class ButtonBox(TixWidget): - def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw) -> None: ... + def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> None: ... def add(self, name: str, cnf: dict[str, Any] = ..., **kw) -> tkinter.Widget: ... def invoke(self, name: str) -> None: ... class ComboBox(TixWidget): - def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw) -> None: ... + def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> None: ... def add_history(self, str: str) -> None: ... def append_history(self, str: str) -> None: ... def insert(self, index: int, str: str) -> None: ... def pick(self, index: int) -> None: ... class Control(TixWidget): - def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw) -> None: ... + def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> None: ... def decrement(self) -> None: ... def increment(self) -> None: ... def invoke(self) -> None: ... class LabelEntry(TixWidget): - def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw) -> None: ... + def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> None: ... class LabelFrame(TixWidget): - def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw) -> None: ... + def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> None: ... class Meter(TixWidget): - def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw) -> None: ... + def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> None: ... class OptionMenu(TixWidget): def __init__(self, master: tkinter.Widget | None, cnf: dict[str, Any] = ..., **kw) -> None: ... @@ -129,7 +127,7 @@ class Select(TixWidget): def invoke(self, name: str) -> None: ... class StdButtonBox(TixWidget): - def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw) -> None: ... + def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> None: ... def invoke(self, name: str) -> None: ... class DirList(TixWidget): @@ -164,13 +162,13 @@ class FileEntry(TixWidget): def file_dialog(self) -> None: ... class HList(TixWidget, tkinter.XView, tkinter.YView): - def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw) -> None: ... + def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> None: ... def add(self, entry: str, cnf: dict[str, Any] = ..., **kw) -> tkinter.Widget: ... - def add_child(self, parent: str | None = ..., cnf: dict[str, Any] = ..., **kw) -> tkinter.Widget: ... + def add_child(self, parent: str | None = None, cnf: dict[str, Any] = ..., **kw) -> tkinter.Widget: ... def anchor_set(self, entry: str) -> None: ... def anchor_clear(self) -> None: ... # FIXME: Overload, certain combos return, others don't - def column_width(self, col: int = ..., width: int | None = ..., chars: int | None = ...) -> int | None: ... + def column_width(self, col: int = 0, width: int | None = None, chars: int | None = None) -> int | None: ... def delete_all(self) -> None: ... def delete_entry(self, entry: str) -> None: ... def delete_offsprings(self, entry: str) -> None: ... @@ -195,7 +193,7 @@ class HList(TixWidget, tkinter.XView, tkinter.YView): def indicator_size(self, entry: str) -> int: ... def info_anchor(self) -> str: ... def info_bbox(self, entry: str) -> tuple[int, int, int, int]: ... - def info_children(self, entry: str | None = ...) -> tuple[str, ...]: ... + def info_children(self, entry: str | None = None) -> tuple[str, ...]: ... def info_data(self, entry: str) -> Any: ... def info_dragsite(self) -> str: ... def info_dropsite(self) -> str: ... @@ -216,34 +214,34 @@ class HList(TixWidget, tkinter.XView, tkinter.YView): def see(self, entry: str) -> None: ... def selection_clear(self, cnf: dict[str, Any] = ..., **kw) -> None: ... def selection_includes(self, entry: str) -> bool: ... - def selection_set(self, first: str, last: str | None = ...) -> None: ... + def selection_set(self, first: str, last: str | None = None) -> None: ... def show_entry(self, entry: str) -> None: ... class CheckList(TixWidget): - def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw) -> None: ... + def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> None: ... def autosetmode(self) -> None: ... def close(self, entrypath: str) -> None: ... def getmode(self, entrypath: str) -> str: ... def open(self, entrypath: str) -> None: ... - def getselection(self, mode: str = ...) -> tuple[str, ...]: ... + def getselection(self, mode: str = "on") -> tuple[str, ...]: ... def getstatus(self, entrypath: str) -> str: ... - def setstatus(self, entrypath: str, mode: str = ...) -> None: ... + def setstatus(self, entrypath: str, mode: str = "on") -> None: ... class Tree(TixWidget): - def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw) -> None: ... + def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> None: ... def autosetmode(self) -> None: ... def close(self, entrypath: str) -> None: ... def getmode(self, entrypath: str) -> str: ... def open(self, entrypath: str) -> None: ... - def setmode(self, entrypath: str, mode: str = ...) -> None: ... + def setmode(self, entrypath: str, mode: str = "none") -> None: ... class TList(TixWidget, tkinter.XView, tkinter.YView): - def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw) -> None: ... + def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> None: ... def active_set(self, index: int) -> None: ... def active_clear(self) -> None: ... def anchor_set(self, index: int) -> None: ... def anchor_clear(self) -> None: ... - def delete(self, from_: int, to: int | None = ...) -> None: ... + def delete(self, from_: int, to: int | None = None) -> None: ... def dragsite_set(self, index: int) -> None: ... def dragsite_clear(self) -> None: ... def dropsite_set(self, index: int) -> None: ... @@ -261,7 +259,7 @@ class TList(TixWidget, tkinter.XView, tkinter.YView): def see(self, index: int) -> None: ... def selection_clear(self, cnf: dict[str, Any] = ..., **kw) -> None: ... def selection_includes(self, index: int) -> bool: ... - def selection_set(self, first: int, last: int | None = ...) -> None: ... + def selection_set(self, first: int, last: int | None = None) -> None: ... class PanedWindow(TixWidget): def __init__(self, master: tkinter.Widget | None, cnf: dict[str, Any] = ..., **kw) -> None: ... @@ -280,7 +278,7 @@ class ListNoteBook(TixWidget): def raise_page(self, name: str) -> None: ... class NoteBook(TixWidget): - def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw) -> None: ... + def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> None: ... def add(self, name: str, cnf: dict[str, Any] = ..., **kw) -> None: ... def delete(self, name: str) -> None: ... def page(self, name: str) -> tkinter.Widget: ... @@ -289,7 +287,7 @@ class NoteBook(TixWidget): def raised(self) -> bool: ... class InputOnly(TixWidget): - def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw) -> None: ... + def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> None: ... class Form: def __setitem__(self, key: str, value: Any) -> None: ... @@ -297,6 +295,6 @@ class Form: def form(self, cnf: dict[str, Any] = ..., **kw) -> None: ... def check(self) -> bool: ... def forget(self) -> None: ... - def grid(self, xsize: int = ..., ysize: int = ...) -> tuple[int, int] | None: ... - def info(self, option: str | None = ...): ... + def grid(self, xsize: int = 0, ysize: int = 0) -> tuple[int, int] | None: ... + def info(self, option: str | None = None): ... def slaves(self) -> list[tkinter.Widget]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/ttk.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/ttk.pyi index a191b3be2..61ebc0e27 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/ttk.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/ttk.pyi @@ -4,7 +4,7 @@ import tkinter from _typeshed import Incomplete from collections.abc import Callable from tkinter.font import _FontDescription -from typing import Any, Union, overload +from typing import Any, overload from typing_extensions import Literal, TypeAlias, TypedDict __all__ = [ @@ -36,15 +36,15 @@ __all__ = [ ] def tclobjs_to_py(adict: dict[Any, Any]) -> dict[Any, Any]: ... -def setup_master(master: Incomplete | None = ...): ... +def setup_master(master: Incomplete | None = None): ... -_Padding: TypeAlias = Union[ - tkinter._ScreenUnits, - tuple[tkinter._ScreenUnits], - tuple[tkinter._ScreenUnits, tkinter._ScreenUnits], - tuple[tkinter._ScreenUnits, tkinter._ScreenUnits, tkinter._ScreenUnits], - tuple[tkinter._ScreenUnits, tkinter._ScreenUnits, tkinter._ScreenUnits, tkinter._ScreenUnits], -] +_Padding: TypeAlias = ( + tkinter._ScreenUnits + | tuple[tkinter._ScreenUnits] + | tuple[tkinter._ScreenUnits, tkinter._ScreenUnits] + | tuple[tkinter._ScreenUnits, tkinter._ScreenUnits, tkinter._ScreenUnits] + | tuple[tkinter._ScreenUnits, tkinter._ScreenUnits, tkinter._ScreenUnits, tkinter._ScreenUnits] +) # from ttk_widget (aka ttk::widget) manual page, differs from tkinter._Compound _TtkCompound: TypeAlias = Literal["text", "image", tkinter._Compound] @@ -52,32 +52,32 @@ _TtkCompound: TypeAlias = Literal["text", "image", tkinter._Compound] class Style: master: Incomplete tk: _tkinter.TkappType - def __init__(self, master: tkinter.Misc | None = ...) -> None: ... - def configure(self, style, query_opt: Incomplete | None = ..., **kw): ... - def map(self, style, query_opt: Incomplete | None = ..., **kw): ... - def lookup(self, style, option, state: Incomplete | None = ..., default: Incomplete | None = ...): ... - def layout(self, style, layoutspec: Incomplete | None = ...): ... + def __init__(self, master: tkinter.Misc | None = None) -> None: ... + def configure(self, style, query_opt: Incomplete | None = None, **kw): ... + def map(self, style, query_opt: Incomplete | None = None, **kw): ... + def lookup(self, style, option, state: Incomplete | None = None, default: Incomplete | None = None): ... + def layout(self, style, layoutspec: Incomplete | None = None): ... def element_create(self, elementname, etype, *args, **kw) -> None: ... def element_names(self): ... def element_options(self, elementname): ... - def theme_create(self, themename, parent: Incomplete | None = ..., settings: Incomplete | None = ...) -> None: ... + def theme_create(self, themename, parent: Incomplete | None = None, settings: Incomplete | None = None) -> None: ... def theme_settings(self, themename, settings) -> None: ... def theme_names(self) -> tuple[str, ...]: ... @overload def theme_use(self, themename: str) -> None: ... @overload - def theme_use(self, themename: None = ...) -> str: ... + def theme_use(self, themename: None = None) -> str: ... class Widget(tkinter.Widget): - def __init__(self, master: tkinter.Misc | None, widgetname, kw: Incomplete | None = ...) -> None: ... + def __init__(self, master: tkinter.Misc | None, widgetname, kw: Incomplete | None = None) -> None: ... def identify(self, x: int, y: int) -> str: ... - def instate(self, statespec, callback: Incomplete | None = ..., *args, **kw): ... - def state(self, statespec: Incomplete | None = ...): ... + def instate(self, statespec, callback: Incomplete | None = None, *args, **kw): ... + def state(self, statespec: Incomplete | None = None): ... class Button(Widget): def __init__( self, - master: tkinter.Misc | None = ..., + master: tkinter.Misc | None = None, *, class_: str = ..., command: tkinter._ButtonCommand = ..., @@ -98,7 +98,7 @@ class Button(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, command: tkinter._ButtonCommand = ..., compound: _TtkCompound = ..., @@ -122,7 +122,7 @@ class Button(Widget): class Checkbutton(Widget): def __init__( self, - master: tkinter.Misc | None = ..., + master: tkinter.Misc | None = None, *, class_: str = ..., command: tkinter._ButtonCommand = ..., @@ -148,7 +148,7 @@ class Checkbutton(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, command: tkinter._ButtonCommand = ..., compound: _TtkCompound = ..., @@ -174,8 +174,8 @@ class Checkbutton(Widget): class Entry(Widget, tkinter.Entry): def __init__( self, - master: tkinter.Misc | None = ..., - widget: str | None = ..., + master: tkinter.Misc | None = None, + widget: str | None = None, *, background: tkinter._Color = ..., # undocumented class_: str = ..., @@ -199,7 +199,7 @@ class Entry(Widget, tkinter.Entry): @overload # type: ignore[override] def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, background: tkinter._Color = ..., cursor: tkinter._Cursor = ..., @@ -224,7 +224,7 @@ class Entry(Widget, tkinter.Entry): @overload # type: ignore[override] def config( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, background: tkinter._Color = ..., cursor: tkinter._Cursor = ..., @@ -252,7 +252,7 @@ class Entry(Widget, tkinter.Entry): class Combobox(Entry): def __init__( self, - master: tkinter.Misc | None = ..., + master: tkinter.Misc | None = None, *, background: tkinter._Color = ..., # undocumented class_: str = ..., @@ -279,7 +279,7 @@ class Combobox(Entry): @overload # type: ignore[override] def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, background: tkinter._Color = ..., cursor: tkinter._Cursor = ..., @@ -307,7 +307,7 @@ class Combobox(Entry): @overload # type: ignore[override] def config( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, background: tkinter._Color = ..., cursor: tkinter._Cursor = ..., @@ -331,13 +331,13 @@ class Combobox(Entry): ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ... @overload def config(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... - def current(self, newindex: int | None = ...) -> int: ... + def current(self, newindex: int | None = None) -> int: ... def set(self, value: Any) -> None: ... class Frame(Widget): def __init__( self, - master: tkinter.Misc | None = ..., + master: tkinter.Misc | None = None, *, border: tkinter._ScreenUnits = ..., borderwidth: tkinter._ScreenUnits = ..., @@ -354,7 +354,7 @@ class Frame(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, border: tkinter._ScreenUnits = ..., borderwidth: tkinter._ScreenUnits = ..., @@ -373,7 +373,7 @@ class Frame(Widget): class Label(Widget): def __init__( self, - master: tkinter.Misc | None = ..., + master: tkinter.Misc | None = None, *, anchor: tkinter._Anchor = ..., background: tkinter._Color = ..., @@ -401,7 +401,7 @@ class Label(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, anchor: tkinter._Anchor = ..., background: tkinter._Color = ..., @@ -431,7 +431,7 @@ class Label(Widget): class Labelframe(Widget): def __init__( self, - master: tkinter.Misc | None = ..., + master: tkinter.Misc | None = None, *, border: tkinter._ScreenUnits = ..., borderwidth: tkinter._ScreenUnits = ..., # undocumented @@ -452,7 +452,7 @@ class Labelframe(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, border: tkinter._ScreenUnits = ..., borderwidth: tkinter._ScreenUnits = ..., @@ -477,7 +477,7 @@ LabelFrame = Labelframe class Menubutton(Widget): def __init__( self, - master: tkinter.Misc | None = ..., + master: tkinter.Misc | None = None, *, class_: str = ..., compound: _TtkCompound = ..., @@ -498,7 +498,7 @@ class Menubutton(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, compound: _TtkCompound = ..., cursor: tkinter._Cursor = ..., @@ -521,7 +521,7 @@ class Menubutton(Widget): class Notebook(Widget): def __init__( self, - master: tkinter.Misc | None = ..., + master: tkinter.Misc | None = None, *, class_: str = ..., cursor: tkinter._Cursor = ..., @@ -535,7 +535,7 @@ class Notebook(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, cursor: tkinter._Cursor = ..., height: int = ..., @@ -564,15 +564,15 @@ class Notebook(Widget): def identify(self, x: int, y: int) -> str: ... def index(self, tab_id): ... def insert(self, pos, child, **kw) -> None: ... - def select(self, tab_id: Incomplete | None = ...): ... - def tab(self, tab_id, option: Incomplete | None = ..., **kw): ... + def select(self, tab_id: Incomplete | None = None): ... + def tab(self, tab_id, option: Incomplete | None = None, **kw): ... def tabs(self): ... def enable_traversal(self) -> None: ... class Panedwindow(Widget, tkinter.PanedWindow): def __init__( self, - master: tkinter.Misc | None = ..., + master: tkinter.Misc | None = None, *, class_: str = ..., cursor: tkinter._Cursor = ..., @@ -588,7 +588,7 @@ class Panedwindow(Widget, tkinter.PanedWindow): @overload # type: ignore[override] def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, cursor: tkinter._Cursor = ..., height: int = ..., @@ -602,7 +602,7 @@ class Panedwindow(Widget, tkinter.PanedWindow): @overload # type: ignore[override] def config( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, cursor: tkinter._Cursor = ..., height: int = ..., @@ -614,15 +614,15 @@ class Panedwindow(Widget, tkinter.PanedWindow): def config(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... forget: Incomplete def insert(self, pos, child, **kw) -> None: ... - def pane(self, pane, option: Incomplete | None = ..., **kw): ... - def sashpos(self, index, newpos: Incomplete | None = ...): ... + def pane(self, pane, option: Incomplete | None = None, **kw): ... + def sashpos(self, index, newpos: Incomplete | None = None): ... PanedWindow = Panedwindow class Progressbar(Widget): def __init__( self, - master: tkinter.Misc | None = ..., + master: tkinter.Misc | None = None, *, class_: str = ..., cursor: tkinter._Cursor = ..., @@ -640,7 +640,7 @@ class Progressbar(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, cursor: tkinter._Cursor = ..., length: tkinter._ScreenUnits = ..., @@ -656,14 +656,14 @@ class Progressbar(Widget): @overload def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... config = configure - def start(self, interval: Literal["idle"] | int | None = ...) -> None: ... - def step(self, amount: float | None = ...) -> None: ... + def start(self, interval: Literal["idle"] | int | None = None) -> None: ... + def step(self, amount: float | None = None) -> None: ... def stop(self) -> None: ... class Radiobutton(Widget): def __init__( self, - master: tkinter.Misc | None = ..., + master: tkinter.Misc | None = None, *, class_: str = ..., command: tkinter._ButtonCommand = ..., @@ -685,7 +685,7 @@ class Radiobutton(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, command: tkinter._ButtonCommand = ..., compound: _TtkCompound = ..., @@ -711,7 +711,7 @@ class Radiobutton(Widget): class Scale(Widget, tkinter.Scale): # type: ignore[misc] def __init__( self, - master: tkinter.Misc | None = ..., + master: tkinter.Misc | None = None, *, class_: str = ..., command: str | Callable[[str], object] = ..., @@ -730,7 +730,7 @@ class Scale(Widget, tkinter.Scale): # type: ignore[misc] @overload # type: ignore[override] def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, command: str | Callable[[str], object] = ..., cursor: tkinter._Cursor = ..., @@ -750,7 +750,7 @@ class Scale(Widget, tkinter.Scale): # type: ignore[misc] @overload # type: ignore[override] def config( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, command: str | Callable[[str], object] = ..., cursor: tkinter._Cursor = ..., @@ -766,13 +766,13 @@ class Scale(Widget, tkinter.Scale): # type: ignore[misc] ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ... @overload def config(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... - def get(self, x: int | None = ..., y: int | None = ...) -> float: ... + def get(self, x: int | None = None, y: int | None = None) -> float: ... # type ignore, because identify() methods of Widget and tkinter.Scale are incompatible class Scrollbar(Widget, tkinter.Scrollbar): # type: ignore[misc] def __init__( self, - master: tkinter.Misc | None = ..., + master: tkinter.Misc | None = None, *, class_: str = ..., command: Callable[..., tuple[float, float] | None] | str = ..., @@ -785,7 +785,7 @@ class Scrollbar(Widget, tkinter.Scrollbar): # type: ignore[misc] @overload # type: ignore[override] def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, command: Callable[..., tuple[float, float] | None] | str = ..., cursor: tkinter._Cursor = ..., @@ -799,7 +799,7 @@ class Scrollbar(Widget, tkinter.Scrollbar): # type: ignore[misc] @overload # type: ignore[override] def config( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, command: Callable[..., tuple[float, float] | None] | str = ..., cursor: tkinter._Cursor = ..., @@ -813,7 +813,7 @@ class Scrollbar(Widget, tkinter.Scrollbar): # type: ignore[misc] class Separator(Widget): def __init__( self, - master: tkinter.Misc | None = ..., + master: tkinter.Misc | None = None, *, class_: str = ..., cursor: tkinter._Cursor = ..., @@ -825,7 +825,7 @@ class Separator(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, cursor: tkinter._Cursor = ..., orient: Literal["horizontal", "vertical"] = ..., @@ -839,7 +839,7 @@ class Separator(Widget): class Sizegrip(Widget): def __init__( self, - master: tkinter.Misc | None = ..., + master: tkinter.Misc | None = None, *, class_: str = ..., cursor: tkinter._Cursor = ..., @@ -850,7 +850,7 @@ class Sizegrip(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, cursor: tkinter._Cursor = ..., style: str = ..., @@ -863,7 +863,7 @@ class Sizegrip(Widget): class Spinbox(Entry): def __init__( self, - master: tkinter.Misc | None = ..., + master: tkinter.Misc | None = None, *, background: tkinter._Color = ..., # undocumented class_: str = ..., @@ -894,7 +894,7 @@ class Spinbox(Entry): @overload # type: ignore[override] def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, background: tkinter._Color = ..., command: Callable[[], object] | str | list[str] | tuple[str, ...] = ..., @@ -937,7 +937,7 @@ class _TreeviewTagDict(TypedDict): foreground: tkinter._Color background: tkinter._Color font: _FontDescription - image: Literal[""] | str # not wrapped in list :D + image: str # not wrapped in list :D class _TreeviewHeaderDict(TypedDict): text: str @@ -958,12 +958,12 @@ _TreeviewColumnId: TypeAlias = int | str # manual page: "COLUMN IDENTIFIERS" class Treeview(Widget, tkinter.XView, tkinter.YView): def __init__( self, - master: tkinter.Misc | None = ..., + master: tkinter.Misc | None = None, *, class_: str = ..., columns: str | list[str] | tuple[str, ...] = ..., cursor: tkinter._Cursor = ..., - displaycolumns: str | list[str] | tuple[str, ...] | list[int] | tuple[int, ...] | Literal["#all"] = ..., + displaycolumns: str | list[str] | tuple[str, ...] | list[int] | tuple[int, ...] = ..., height: int = ..., name: str = ..., padding: _Padding = ..., @@ -981,11 +981,11 @@ class Treeview(Widget, tkinter.XView, tkinter.YView): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, columns: str | list[str] | tuple[str, ...] = ..., cursor: tkinter._Cursor = ..., - displaycolumns: str | list[str] | tuple[str, ...] | list[int] | tuple[int, ...] | Literal["#all"] = ..., + displaycolumns: str | list[str] | tuple[str, ...] | list[int] | tuple[int, ...] = ..., height: int = ..., padding: _Padding = ..., selectmode: Literal["extended", "browse", "none"] = ..., @@ -998,8 +998,8 @@ class Treeview(Widget, tkinter.XView, tkinter.YView): @overload def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... config = configure - def bbox(self, item, column: _TreeviewColumnId | None = ...) -> tuple[int, int, int, int] | Literal[""]: ... # type: ignore[override] - def get_children(self, item: str | None = ...) -> tuple[str, ...]: ... + def bbox(self, item, column: _TreeviewColumnId | None = None) -> tuple[int, int, int, int] | Literal[""]: ... # type: ignore[override] + def get_children(self, item: str | None = None) -> tuple[str, ...]: ... def set_children(self, item: str, *newchildren: str) -> None: ... @overload def column(self, column: _TreeviewColumnId, option: Literal["width", "minwidth"]) -> int: ... @@ -1015,7 +1015,7 @@ class Treeview(Widget, tkinter.XView, tkinter.YView): def column( self, column: _TreeviewColumnId, - option: None = ..., + option: None = None, *, width: int = ..., minwidth: int = ..., @@ -1027,7 +1027,7 @@ class Treeview(Widget, tkinter.XView, tkinter.YView): def detach(self, *items: str) -> None: ... def exists(self, item: str) -> bool: ... @overload # type: ignore[override] - def focus(self, item: None = ...) -> str: ... # can return empty string + def focus(self, item: None = None) -> str: ... # can return empty string @overload def focus(self, item: str) -> Literal[""]: ... @overload @@ -1041,12 +1041,12 @@ class Treeview(Widget, tkinter.XView, tkinter.YView): @overload def heading(self, column: _TreeviewColumnId, option: str) -> Any: ... @overload - def heading(self, column: _TreeviewColumnId, option: None = ...) -> _TreeviewHeaderDict: ... # type: ignore[misc] + def heading(self, column: _TreeviewColumnId, option: None = None) -> _TreeviewHeaderDict: ... # type: ignore[misc] @overload def heading( self, column: _TreeviewColumnId, - option: None = ..., + option: None = None, *, text: str = ..., image: tkinter._ImageSpec = ..., @@ -1063,7 +1063,7 @@ class Treeview(Widget, tkinter.XView, tkinter.YView): self, parent: str, index: int | Literal["end"], - iid: str | None = ..., + iid: str | None = None, *, id: str = ..., # same as iid text: str = ..., @@ -1085,12 +1085,12 @@ class Treeview(Widget, tkinter.XView, tkinter.YView): @overload def item(self, item: str, option: str) -> Any: ... @overload - def item(self, item: str, option: None = ...) -> _TreeviewItemDict: ... # type: ignore[misc] + def item(self, item: str, option: None = None) -> _TreeviewItemDict: ... # type: ignore[misc] @overload def item( self, item: str, - option: None = ..., + option: None = None, *, text: str = ..., image: tkinter._ImageSpec = ..., @@ -1107,23 +1107,23 @@ class Treeview(Widget, tkinter.XView, tkinter.YView): if sys.version_info >= (3, 8): def selection(self) -> tuple[str, ...]: ... else: - def selection(self, selop: Incomplete | None = ..., items: Incomplete | None = ...) -> tuple[str, ...]: ... + def selection(self, selop: Incomplete | None = ..., items: Incomplete | None = None) -> tuple[str, ...]: ... def selection_set(self, items: str | list[str] | tuple[str, ...]) -> None: ... def selection_add(self, items: str | list[str] | tuple[str, ...]) -> None: ... def selection_remove(self, items: str | list[str] | tuple[str, ...]) -> None: ... def selection_toggle(self, items: str | list[str] | tuple[str, ...]) -> None: ... @overload - def set(self, item: str, column: None = ..., value: None = ...) -> dict[str, Any]: ... + def set(self, item: str, column: None = None, value: None = None) -> dict[str, Any]: ... @overload - def set(self, item: str, column: _TreeviewColumnId, value: None = ...) -> Any: ... + def set(self, item: str, column: _TreeviewColumnId, value: None = None) -> Any: ... @overload def set(self, item: str, column: _TreeviewColumnId, value: Any) -> Literal[""]: ... # There's no tag_unbind() or 'add' argument for whatever reason. # Also, it's 'callback' instead of 'func' here. @overload def tag_bind( - self, tagname: str, sequence: str | None = ..., callback: Callable[[tkinter.Event[Treeview]], object] | None = ... + self, tagname: str, sequence: str | None = None, callback: Callable[[tkinter.Event[Treeview]], object] | None = None ) -> str: ... @overload def tag_bind(self, tagname: str, sequence: str | None, callback: str) -> None: ... @@ -1139,7 +1139,7 @@ class Treeview(Widget, tkinter.XView, tkinter.YView): def tag_configure( self, tagname: str, - option: None = ..., + option: None = None, *, # There is also 'text' and 'anchor', but they don't seem to do anything, using them is likely a bug foreground: tkinter._Color = ..., @@ -1148,7 +1148,7 @@ class Treeview(Widget, tkinter.XView, tkinter.YView): image: tkinter._ImageSpec = ..., ) -> _TreeviewTagDict | Any: ... # can be None but annoying to check @overload - def tag_has(self, tagname: str, item: None = ...) -> tuple[str, ...]: ... + def tag_has(self, tagname: str, item: None = None) -> tuple[str, ...]: ... @overload def tag_has(self, tagname: str, item: str) -> bool: ... @@ -1158,10 +1158,10 @@ class LabeledScale(Frame): # TODO: don't any-type **kw. That goes to Frame.__init__. def __init__( self, - master: tkinter.Misc | None = ..., - variable: tkinter.IntVar | tkinter.DoubleVar | None = ..., - from_: float = ..., - to: float = ..., + master: tkinter.Misc | None = None, + variable: tkinter.IntVar | tkinter.DoubleVar | None = None, + from_: float = 0, + to: float = 10, *, compound: Literal["top", "bottom"] = ..., **kw, @@ -1174,7 +1174,7 @@ class OptionMenu(Menubutton): self, master, variable, - default: str | None = ..., + default: str | None = None, *values: str, # rest of these are keyword-only because *args syntax used above style: str = ..., @@ -1183,4 +1183,4 @@ class OptionMenu(Menubutton): ) -> None: ... # configure, config, cget, destroy are inherited from Menubutton # destroy and __setitem__ are overridden, signature does not change - def set_menu(self, default: Incomplete | None = ..., *values) -> None: ... + def set_menu(self, default: Incomplete | None = None, *values) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/tokenize.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/tokenize.pyi index 1a67736e7..ba57402fb 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/tokenize.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/tokenize.pyi @@ -1,5 +1,5 @@ import sys -from _typeshed import StrOrBytesPath +from _typeshed import FileDescriptorOrPath from collections.abc import Callable, Generator, Iterable, Sequence from re import Pattern from token import * @@ -115,7 +115,6 @@ class Untokenizer: prev_row: int prev_col: int encoding: str | None - def __init__(self) -> None: ... def add_whitespace(self, start: _Position) -> None: ... def untokenize(self, iterable: Iterable[_Token]) -> str: ... def compat(self, token: Sequence[int | str], iterable: Iterable[_Token]) -> None: ... @@ -123,10 +122,10 @@ class Untokenizer: # the docstring says "returns bytes" but is incorrect -- # if the ENCODING token is missing, it skips the encode def untokenize(iterable: Iterable[_Token]) -> Any: ... -def detect_encoding(readline: Callable[[], bytes]) -> tuple[str, Sequence[bytes]]: ... -def tokenize(readline: Callable[[], bytes]) -> Generator[TokenInfo, None, None]: ... +def detect_encoding(readline: Callable[[], bytes | bytearray]) -> tuple[str, Sequence[bytes]]: ... +def tokenize(readline: Callable[[], bytes | bytearray]) -> Generator[TokenInfo, None, None]: ... def generate_tokens(readline: Callable[[], str]) -> Generator[TokenInfo, None, None]: ... # undocumented -def open(filename: StrOrBytesPath | int) -> TextIO: ... +def open(filename: FileDescriptorOrPath) -> TextIO: ... def group(*choices: str) -> str: ... # undocumented def any(*choices: str) -> str: ... # undocumented def maybe(*choices: str) -> str: ... # undocumented diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/trace.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/trace.pyi index 1f0de1d4d..f79b38f1c 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/trace.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/trace.pyi @@ -14,35 +14,35 @@ _FileModuleFunction: TypeAlias = tuple[str, str | None, str] class CoverageResults: def __init__( self, - counts: dict[tuple[str, int], int] | None = ..., - calledfuncs: dict[_FileModuleFunction, int] | None = ..., - infile: StrPath | None = ..., - callers: dict[tuple[_FileModuleFunction, _FileModuleFunction], int] | None = ..., - outfile: StrPath | None = ..., + counts: dict[tuple[str, int], int] | None = None, + calledfuncs: dict[_FileModuleFunction, int] | None = None, + infile: StrPath | None = None, + callers: dict[tuple[_FileModuleFunction, _FileModuleFunction], int] | None = None, + outfile: StrPath | None = None, ) -> None: ... # undocumented def update(self, other: CoverageResults) -> None: ... - def write_results(self, show_missing: bool = ..., summary: bool = ..., coverdir: StrPath | None = ...) -> None: ... + def write_results(self, show_missing: bool = True, summary: bool = False, coverdir: StrPath | None = None) -> None: ... def write_results_file( - self, path: StrPath, lines: Sequence[str], lnotab: Any, lines_hit: Mapping[int, int], encoding: str | None = ... + self, path: StrPath, lines: Sequence[str], lnotab: Any, lines_hit: Mapping[int, int], encoding: str | None = None ) -> tuple[int, int]: ... def is_ignored_filename(self, filename: str) -> bool: ... # undocumented class Trace: def __init__( self, - count: int = ..., - trace: int = ..., - countfuncs: int = ..., - countcallers: int = ..., + count: int = 1, + trace: int = 1, + countfuncs: int = 0, + countcallers: int = 0, ignoremods: Sequence[str] = ..., ignoredirs: Sequence[str] = ..., - infile: StrPath | None = ..., - outfile: StrPath | None = ..., - timing: bool = ..., + infile: StrPath | None = None, + outfile: StrPath | None = None, + timing: bool = False, ) -> None: ... def run(self, cmd: str | types.CodeType) -> None: ... def runctx( - self, cmd: str | types.CodeType, globals: Mapping[str, Any] | None = ..., locals: Mapping[str, Any] | None = ... + self, cmd: str | types.CodeType, globals: Mapping[str, Any] | None = None, locals: Mapping[str, Any] | None = None ) -> None: ... if sys.version_info >= (3, 9): def runfunc(self, __func: Callable[_P, _T], *args: _P.args, **kw: _P.kwargs) -> _T: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/traceback.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/traceback.pyi index fcaa39bf4..a6d6d3e16 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/traceback.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/traceback.pyi @@ -1,9 +1,9 @@ import sys -from _typeshed import Self, SupportsWrite +from _typeshed import SupportsWrite from collections.abc import Generator, Iterable, Iterator, Mapping from types import FrameType, TracebackType from typing import Any, overload -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal, Self, TypeAlias __all__ = [ "extract_stack", @@ -29,7 +29,7 @@ __all__ = [ _PT: TypeAlias = tuple[str, int, str, str | None] -def print_tb(tb: TracebackType | None, limit: int | None = ..., file: SupportsWrite[str] | None = ...) -> None: ... +def print_tb(tb: TracebackType | None, limit: int | None = None, file: SupportsWrite[str] | None = None) -> None: ... if sys.version_info >= (3, 10): @overload @@ -37,51 +37,51 @@ if sys.version_info >= (3, 10): __exc: type[BaseException] | None, value: BaseException | None = ..., tb: TracebackType | None = ..., - limit: int | None = ..., - file: SupportsWrite[str] | None = ..., - chain: bool = ..., + limit: int | None = None, + file: SupportsWrite[str] | None = None, + chain: bool = True, ) -> None: ... @overload def print_exception( - __exc: BaseException, *, limit: int | None = ..., file: SupportsWrite[str] | None = ..., chain: bool = ... + __exc: BaseException, *, limit: int | None = None, file: SupportsWrite[str] | None = None, chain: bool = True ) -> None: ... @overload def format_exception( __exc: type[BaseException] | None, value: BaseException | None = ..., tb: TracebackType | None = ..., - limit: int | None = ..., - chain: bool = ..., + limit: int | None = None, + chain: bool = True, ) -> list[str]: ... @overload - def format_exception(__exc: BaseException, *, limit: int | None = ..., chain: bool = ...) -> list[str]: ... + def format_exception(__exc: BaseException, *, limit: int | None = None, chain: bool = True) -> list[str]: ... else: def print_exception( etype: type[BaseException] | None, value: BaseException | None, tb: TracebackType | None, - limit: int | None = ..., - file: SupportsWrite[str] | None = ..., - chain: bool = ..., + limit: int | None = None, + file: SupportsWrite[str] | None = None, + chain: bool = True, ) -> None: ... def format_exception( etype: type[BaseException] | None, value: BaseException | None, tb: TracebackType | None, - limit: int | None = ..., - chain: bool = ..., + limit: int | None = None, + chain: bool = True, ) -> list[str]: ... -def print_exc(limit: int | None = ..., file: SupportsWrite[str] | None = ..., chain: bool = ...) -> None: ... -def print_last(limit: int | None = ..., file: SupportsWrite[str] | None = ..., chain: bool = ...) -> None: ... -def print_stack(f: FrameType | None = ..., limit: int | None = ..., file: SupportsWrite[str] | None = ...) -> None: ... -def extract_tb(tb: TracebackType | None, limit: int | None = ...) -> StackSummary: ... -def extract_stack(f: FrameType | None = ..., limit: int | None = ...) -> StackSummary: ... +def print_exc(limit: int | None = None, file: SupportsWrite[str] | None = None, chain: bool = True) -> None: ... +def print_last(limit: int | None = None, file: SupportsWrite[str] | None = None, chain: bool = True) -> None: ... +def print_stack(f: FrameType | None = None, limit: int | None = None, file: SupportsWrite[str] | None = None) -> None: ... +def extract_tb(tb: TracebackType | None, limit: int | None = None) -> StackSummary: ... +def extract_stack(f: FrameType | None = None, limit: int | None = None) -> StackSummary: ... def format_list(extracted_list: list[FrameSummary]) -> list[str]: ... # undocumented -def print_list(extracted_list: list[FrameSummary], file: SupportsWrite[str] | None = ...) -> None: ... +def print_list(extracted_list: list[FrameSummary], file: SupportsWrite[str] | None = None) -> None: ... if sys.version_info >= (3, 10): def format_exception_only(__exc: type[BaseException] | None, value: BaseException | None = ...) -> list[str]: ... @@ -89,18 +89,17 @@ if sys.version_info >= (3, 10): else: def format_exception_only(etype: type[BaseException] | None, value: BaseException | None) -> list[str]: ... -def format_exc(limit: int | None = ..., chain: bool = ...) -> str: ... -def format_tb(tb: TracebackType | None, limit: int | None = ...) -> list[str]: ... -def format_stack(f: FrameType | None = ..., limit: int | None = ...) -> list[str]: ... -def clear_frames(tb: TracebackType) -> None: ... +def format_exc(limit: int | None = None, chain: bool = True) -> str: ... +def format_tb(tb: TracebackType | None, limit: int | None = None) -> list[str]: ... +def format_stack(f: FrameType | None = None, limit: int | None = None) -> list[str]: ... +def clear_frames(tb: TracebackType | None) -> None: ... def walk_stack(f: FrameType | None) -> Iterator[tuple[FrameType, int]]: ... def walk_tb(tb: TracebackType | None) -> Iterator[tuple[FrameType, int]]: ... if sys.version_info >= (3, 11): class _ExceptionPrintContext: - def __init__(self) -> None: ... def indent(self) -> str: ... - def emit(self, text_gen: str | Iterable[str], margin_char: str | None = ...) -> Generator[str, None, None]: ... + def emit(self, text_gen: str | Iterable[str], margin_char: str | None = None) -> Generator[str, None, None]: ... class TracebackException: __cause__: TracebackException @@ -120,25 +119,25 @@ class TracebackException: exc_value: BaseException, exc_traceback: TracebackType | None, *, - limit: int | None = ..., - lookup_lines: bool = ..., - capture_locals: bool = ..., - compact: bool = ..., - max_group_width: int = ..., - max_group_depth: int = ..., - _seen: set[int] | None = ..., + limit: int | None = None, + lookup_lines: bool = True, + capture_locals: bool = False, + compact: bool = False, + max_group_width: int = 15, + max_group_depth: int = 10, + _seen: set[int] | None = None, ) -> None: ... @classmethod def from_exception( - cls: type[Self], + cls, exc: BaseException, *, - limit: int | None = ..., - lookup_lines: bool = ..., - capture_locals: bool = ..., - compact: bool = ..., - max_group_width: int = ..., - max_group_depth: int = ..., + limit: int | None = None, + lookup_lines: bool = True, + capture_locals: bool = False, + compact: bool = False, + max_group_width: int = 15, + max_group_depth: int = 10, ) -> Self: ... elif sys.version_info >= (3, 10): def __init__( @@ -147,21 +146,21 @@ class TracebackException: exc_value: BaseException, exc_traceback: TracebackType | None, *, - limit: int | None = ..., - lookup_lines: bool = ..., - capture_locals: bool = ..., - compact: bool = ..., - _seen: set[int] | None = ..., + limit: int | None = None, + lookup_lines: bool = True, + capture_locals: bool = False, + compact: bool = False, + _seen: set[int] | None = None, ) -> None: ... @classmethod def from_exception( - cls: type[Self], + cls, exc: BaseException, *, - limit: int | None = ..., - lookup_lines: bool = ..., - capture_locals: bool = ..., - compact: bool = ..., + limit: int | None = None, + lookup_lines: bool = True, + capture_locals: bool = False, + compact: bool = False, ) -> Self: ... else: def __init__( @@ -170,26 +169,26 @@ class TracebackException: exc_value: BaseException, exc_traceback: TracebackType | None, *, - limit: int | None = ..., - lookup_lines: bool = ..., - capture_locals: bool = ..., - _seen: set[int] | None = ..., + limit: int | None = None, + lookup_lines: bool = True, + capture_locals: bool = False, + _seen: set[int] | None = None, ) -> None: ... @classmethod def from_exception( - cls: type[Self], exc: BaseException, *, limit: int | None = ..., lookup_lines: bool = ..., capture_locals: bool = ... + cls, exc: BaseException, *, limit: int | None = None, lookup_lines: bool = True, capture_locals: bool = False ) -> Self: ... def __eq__(self, other: object) -> bool: ... if sys.version_info >= (3, 11): - def format(self, *, chain: bool = ..., _ctx: _ExceptionPrintContext | None = ...) -> Generator[str, None, None]: ... + def format(self, *, chain: bool = True, _ctx: _ExceptionPrintContext | None = None) -> Generator[str, None, None]: ... else: - def format(self, *, chain: bool = ...) -> Generator[str, None, None]: ... + def format(self, *, chain: bool = True) -> Generator[str, None, None]: ... def format_exception_only(self) -> Generator[str, None, None]: ... if sys.version_info >= (3, 11): - def print(self, *, file: SupportsWrite[str] | None = ..., chain: bool = ...) -> None: ... + def print(self, *, file: SupportsWrite[str] | None = None, chain: bool = True) -> None: ... class FrameSummary(Iterable[Any]): if sys.version_info >= (3, 11): @@ -199,12 +198,12 @@ class FrameSummary(Iterable[Any]): lineno: int | None, name: str, *, - lookup_line: bool = ..., - locals: Mapping[str, str] | None = ..., - line: str | None = ..., - end_lineno: int | None = ..., - colno: int | None = ..., - end_colno: int | None = ..., + lookup_line: bool = True, + locals: Mapping[str, str] | None = None, + line: str | None = None, + end_lineno: int | None = None, + colno: int | None = None, + end_colno: int | None = None, ) -> None: ... end_lineno: int | None colno: int | None @@ -216,9 +215,9 @@ class FrameSummary(Iterable[Any]): lineno: int | None, name: str, *, - lookup_line: bool = ..., - locals: Mapping[str, str] | None = ..., - line: str | None = ..., + lookup_line: bool = True, + locals: Mapping[str, str] | None = None, + line: str | None = None, ) -> None: ... filename: str lineno: int | None @@ -247,9 +246,9 @@ class StackSummary(list[FrameSummary]): cls, frame_gen: Iterable[tuple[FrameType, int]], *, - limit: int | None = ..., - lookup_lines: bool = ..., - capture_locals: bool = ..., + limit: int | None = None, + lookup_lines: bool = True, + capture_locals: bool = False, ) -> StackSummary: ... @classmethod def from_list(cls, a_list: Iterable[FrameSummary | _PT]) -> StackSummary: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/tracemalloc.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/tracemalloc.pyi index ed9526166..3dc8b8603 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/tracemalloc.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/tracemalloc.pyi @@ -1,7 +1,7 @@ import sys from _tracemalloc import * from collections.abc import Sequence -from typing import Any, Union, overload +from typing import Any, overload from typing_extensions import SupportsIndex, TypeAlias def get_object_traceback(obj: object) -> Traceback | None: ... @@ -23,7 +23,12 @@ class Filter(BaseFilter): def filename_pattern(self) -> str: ... all_frames: bool def __init__( - self, inclusive: bool, filename_pattern: str, lineno: int | None = ..., all_frames: bool = ..., domain: int | None = ... + self, + inclusive: bool, + filename_pattern: str, + lineno: int | None = None, + all_frames: bool = False, + domain: int | None = None, ) -> None: ... class Statistic: @@ -62,7 +67,7 @@ class Frame: def __le__(self, other: Frame, NotImplemented: Any = ...) -> bool: ... if sys.version_info >= (3, 9): - _TraceTuple: TypeAlias = Union[tuple[int, int, Sequence[_FrameTuple], int | None], tuple[int, int, Sequence[_FrameTuple]]] + _TraceTuple: TypeAlias = tuple[int, int, Sequence[_FrameTuple], int | None] | tuple[int, int, Sequence[_FrameTuple]] else: _TraceTuple: TypeAlias = tuple[int, int, Sequence[_FrameTuple]] @@ -80,11 +85,11 @@ class Traceback(Sequence[Frame]): if sys.version_info >= (3, 9): @property def total_nframe(self) -> int | None: ... - def __init__(self, frames: Sequence[_FrameTuple], total_nframe: int | None = ...) -> None: ... + def __init__(self, frames: Sequence[_FrameTuple], total_nframe: int | None = None) -> None: ... else: def __init__(self, frames: Sequence[_FrameTuple]) -> None: ... - def format(self, limit: int | None = ..., most_recent_first: bool = ...) -> list[str]: ... + def format(self, limit: int | None = None, most_recent_first: bool = False) -> list[str]: ... @overload def __getitem__(self, index: SupportsIndex) -> Frame: ... @overload @@ -104,11 +109,11 @@ class Traceback(Sequence[Frame]): class Snapshot: def __init__(self, traces: Sequence[_TraceTuple], traceback_limit: int) -> None: ... - def compare_to(self, old_snapshot: Snapshot, key_type: str, cumulative: bool = ...) -> list[StatisticDiff]: ... + def compare_to(self, old_snapshot: Snapshot, key_type: str, cumulative: bool = False) -> list[StatisticDiff]: ... def dump(self, filename: str) -> None: ... def filter_traces(self, filters: Sequence[DomainFilter | Filter]) -> Snapshot: ... @staticmethod def load(filename: str) -> Snapshot: ... - def statistics(self, key_type: str, cumulative: bool = ...) -> list[Statistic]: ... + def statistics(self, key_type: str, cumulative: bool = False) -> list[Statistic]: ... traceback_limit: int traces: Sequence[Trace] diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/tty.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/tty.pyi index 8edae9ec2..43f2e1cf9 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/tty.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/tty.pyi @@ -15,5 +15,5 @@ if sys.platform != "win32": ISPEED: int OSPEED: int CC: int - def setraw(fd: _FD, when: int = ...) -> None: ... - def setcbreak(fd: _FD, when: int = ...) -> None: ... + def setraw(fd: _FD, when: int = 2) -> None: ... + def setcbreak(fd: _FD, when: int = 2) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/turtle.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/turtle.pyi index 13197c336..8017c8290 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/turtle.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/turtle.pyi @@ -1,8 +1,7 @@ -from _typeshed import Self from collections.abc import Callable, Sequence from tkinter import Canvas, Frame, Misc, PhotoImage, Scrollbar -from typing import Any, ClassVar, Union, overload -from typing_extensions import TypeAlias +from typing import Any, ClassVar, overload +from typing_extensions import Self, TypeAlias __all__ = [ "ScrolledCanvas", @@ -133,7 +132,7 @@ __all__ = [ # alias we use for return types. Really, these two aliases should be the # same, but as per the "no union returns" typeshed policy, we'll return # Any instead. -_Color: TypeAlias = Union[str, tuple[float, float, float]] +_Color: TypeAlias = str | tuple[float, float, float] _AnyColor: TypeAlias = Any # TODO: Replace this with a TypedDict once it becomes standardized. @@ -143,7 +142,7 @@ _Speed: TypeAlias = str | float _PolygonCoords: TypeAlias = Sequence[tuple[float, float]] class Vec2D(tuple[float, float]): - def __new__(cls: type[Self], x: float, y: float) -> Self: ... + def __new__(cls, x: float, y: float) -> Self: ... def __add__(self, other: tuple[float, float]) -> Vec2D: ... # type: ignore[override] @overload # type: ignore[override] def __mul__(self, other: Vec2D) -> float: ... @@ -161,11 +160,11 @@ class ScrolledCanvas(Canvas, Frame): # type: ignore[misc] hscroll: Scrollbar vscroll: Scrollbar def __init__( - self, master: Misc | None, width: int = ..., height: int = ..., canvwidth: int = ..., canvheight: int = ... + self, master: Misc | None, width: int = 500, height: int = 350, canvwidth: int = 600, canvheight: int = 500 ) -> None: ... canvwidth: int canvheight: int - def reset(self, canvwidth: int | None = ..., canvheight: int | None = ..., bg: str | None = ...) -> None: ... + def reset(self, canvwidth: int | None = None, canvheight: int | None = None, bg: str | None = None) -> None: ... class TurtleScreenBase: cv: Canvas @@ -177,27 +176,27 @@ class TurtleScreenBase: def mainloop(self) -> None: ... def textinput(self, title: str, prompt: str) -> str | None: ... def numinput( - self, title: str, prompt: str, default: float | None = ..., minval: float | None = ..., maxval: float | None = ... + self, title: str, prompt: str, default: float | None = None, minval: float | None = None, maxval: float | None = None ) -> float | None: ... class Terminator(Exception): ... class TurtleGraphicsError(Exception): ... class Shape: - def __init__(self, type_: str, data: _PolygonCoords | PhotoImage | None = ...) -> None: ... - def addcomponent(self, poly: _PolygonCoords, fill: _Color, outline: _Color | None = ...) -> None: ... + def __init__(self, type_: str, data: _PolygonCoords | PhotoImage | None = None) -> None: ... + def addcomponent(self, poly: _PolygonCoords, fill: _Color, outline: _Color | None = None) -> None: ... class TurtleScreen(TurtleScreenBase): - def __init__(self, cv: Canvas, mode: str = ..., colormode: float = ..., delay: int = ...) -> None: ... + def __init__(self, cv: Canvas, mode: str = "standard", colormode: float = 1.0, delay: int = 10) -> None: ... def clear(self) -> None: ... @overload - def mode(self, mode: None = ...) -> str: ... + def mode(self, mode: None = None) -> str: ... @overload def mode(self, mode: str) -> None: ... def setworldcoordinates(self, llx: float, lly: float, urx: float, ury: float) -> None: ... - def register_shape(self, name: str, shape: _PolygonCoords | Shape | None = ...) -> None: ... + def register_shape(self, name: str, shape: _PolygonCoords | Shape | None = None) -> None: ... @overload - def colormode(self, cmode: None = ...) -> float: ... + def colormode(self, cmode: None = None) -> float: ... @overload def colormode(self, cmode: float) -> None: ... def reset(self) -> None: ... @@ -209,11 +208,11 @@ class TurtleScreen(TurtleScreenBase): @overload def bgcolor(self, r: float, g: float, b: float) -> None: ... @overload - def tracer(self, n: None = ...) -> int: ... + def tracer(self, n: None = None) -> int: ... @overload - def tracer(self, n: int, delay: int | None = ...) -> None: ... + def tracer(self, n: int, delay: int | None = None) -> None: ... @overload - def delay(self, delay: None = ...) -> int: ... + def delay(self, delay: None = None) -> int: ... @overload def delay(self, delay: int) -> None: ... def update(self) -> None: ... @@ -221,24 +220,24 @@ class TurtleScreen(TurtleScreenBase): def window_height(self) -> int: ... def getcanvas(self) -> Canvas: ... def getshapes(self) -> list[str]: ... - def onclick(self, fun: Callable[[float, float], object], btn: int = ..., add: Any | None = ...) -> None: ... + def onclick(self, fun: Callable[[float, float], object], btn: int = 1, add: Any | None = None) -> None: ... def onkey(self, fun: Callable[[], object], key: str) -> None: ... - def listen(self, xdummy: float | None = ..., ydummy: float | None = ...) -> None: ... - def ontimer(self, fun: Callable[[], object], t: int = ...) -> None: ... + def listen(self, xdummy: float | None = None, ydummy: float | None = None) -> None: ... + def ontimer(self, fun: Callable[[], object], t: int = 0) -> None: ... @overload - def bgpic(self, picname: None = ...) -> str: ... + def bgpic(self, picname: None = None) -> str: ... @overload def bgpic(self, picname: str) -> None: ... @overload - def screensize(self, canvwidth: None = ..., canvheight: None = ..., bg: None = ...) -> tuple[int, int]: ... + def screensize(self, canvwidth: None = None, canvheight: None = None, bg: None = None) -> tuple[int, int]: ... # Looks like if self.cv is not a ScrolledCanvas, this could return a tuple as well @overload - def screensize(self, canvwidth: int, canvheight: int, bg: _Color | None = ...) -> None: ... + def screensize(self, canvwidth: int, canvheight: int, bg: _Color | None = None) -> None: ... onscreenclick = onclick resetscreen = reset clearscreen = clear addshape = register_shape - def onkeypress(self, fun: Callable[[], object], key: str | None = ...) -> None: ... + def onkeypress(self, fun: Callable[[], object], key: str | None = None) -> None: ... onkeyrelease = onkey class TNavigator: @@ -246,9 +245,9 @@ class TNavigator: DEFAULT_MODE: str DEFAULT_ANGLEOFFSET: int DEFAULT_ANGLEORIENT: int - def __init__(self, mode: str = ...) -> None: ... + def __init__(self, mode: str = "standard") -> None: ... def reset(self) -> None: ... - def degrees(self, fullcircle: float = ...) -> None: ... + def degrees(self, fullcircle: float = 360.0) -> None: ... def radians(self) -> None: ... def forward(self, distance: float) -> None: ... def back(self, distance: float) -> None: ... @@ -258,23 +257,23 @@ class TNavigator: def xcor(self) -> float: ... def ycor(self) -> float: ... @overload - def goto(self, x: tuple[float, float], y: None = ...) -> None: ... + def goto(self, x: tuple[float, float], y: None = None) -> None: ... @overload def goto(self, x: float, y: float) -> None: ... def home(self) -> None: ... def setx(self, x: float) -> None: ... def sety(self, y: float) -> None: ... @overload - def distance(self, x: TNavigator | tuple[float, float], y: None = ...) -> float: ... + def distance(self, x: TNavigator | tuple[float, float], y: None = None) -> float: ... @overload def distance(self, x: float, y: float) -> float: ... @overload - def towards(self, x: TNavigator | tuple[float, float], y: None = ...) -> float: ... + def towards(self, x: TNavigator | tuple[float, float], y: None = None) -> float: ... @overload def towards(self, x: float, y: float) -> float: ... def heading(self) -> float: ... def setheading(self, to_angle: float) -> None: ... - def circle(self, radius: float, extent: float | None = ..., steps: int | None = ...) -> None: ... + def circle(self, radius: float, extent: float | None = None, steps: int | None = None) -> None: ... fd = forward bk = back backward = back @@ -286,20 +285,20 @@ class TNavigator: seth = setheading class TPen: - def __init__(self, resizemode: str = ...) -> None: ... + def __init__(self, resizemode: str = "noresize") -> None: ... @overload - def resizemode(self, rmode: None = ...) -> str: ... + def resizemode(self, rmode: None = None) -> str: ... @overload def resizemode(self, rmode: str) -> None: ... @overload - def pensize(self, width: None = ...) -> int: ... + def pensize(self, width: None = None) -> int: ... @overload def pensize(self, width: int) -> None: ... def penup(self) -> None: ... def pendown(self) -> None: ... def isdown(self) -> bool: ... @overload - def speed(self, speed: None = ...) -> int: ... + def speed(self, speed: None = None) -> int: ... @overload def speed(self, speed: _Speed) -> None: ... @overload @@ -331,7 +330,7 @@ class TPen: @overload def pen( self, - pen: _PenState | None = ..., + pen: _PenState | None = None, *, shown: bool = ..., pendown: bool = ..., @@ -356,15 +355,19 @@ class RawTurtle(TPen, TNavigator): screen: TurtleScreen screens: ClassVar[list[TurtleScreen]] def __init__( - self, canvas: Canvas | TurtleScreen | None = ..., shape: str = ..., undobuffersize: int = ..., visible: bool = ... + self, + canvas: Canvas | TurtleScreen | None = None, + shape: str = "classic", + undobuffersize: int = 1000, + visible: bool = True, ) -> None: ... def reset(self) -> None: ... def setundobuffer(self, size: int | None) -> None: ... def undobufferentries(self) -> int: ... def clear(self) -> None: ... - def clone(self: Self) -> Self: ... + def clone(self) -> Self: ... @overload - def shape(self, name: None = ...) -> str: ... + def shape(self, name: None = None) -> str: ... @overload def shape(self, name: str) -> None: ... # Unsafely overlaps when no arguments are provided @@ -372,10 +375,10 @@ class RawTurtle(TPen, TNavigator): def shapesize(self) -> tuple[float, float, float]: ... # type: ignore[misc] @overload def shapesize( - self, stretch_wid: float | None = ..., stretch_len: float | None = ..., outline: float | None = ... + self, stretch_wid: float | None = None, stretch_len: float | None = None, outline: float | None = None ) -> None: ... @overload - def shearfactor(self, shear: None = ...) -> float: ... + def shearfactor(self, shear: None = None) -> float: ... @overload def shearfactor(self, shear: float) -> None: ... # Unsafely overlaps when no arguments are provided @@ -383,12 +386,12 @@ class RawTurtle(TPen, TNavigator): def shapetransform(self) -> tuple[float, float, float, float]: ... # type: ignore[misc] @overload def shapetransform( - self, t11: float | None = ..., t12: float | None = ..., t21: float | None = ..., t22: float | None = ... + self, t11: float | None = None, t12: float | None = None, t21: float | None = None, t22: float | None = None ) -> None: ... def get_shapepoly(self) -> _PolygonCoords | None: ... def settiltangle(self, angle: float) -> None: ... @overload - def tiltangle(self, angle: None = ...) -> float: ... + def tiltangle(self, angle: None = None) -> float: ... @overload def tiltangle(self, angle: float) -> None: ... def tilt(self, angle: float) -> None: ... @@ -397,21 +400,21 @@ class RawTurtle(TPen, TNavigator): # we return Any. def stamp(self) -> Any: ... def clearstamp(self, stampid: int | tuple[int, ...]) -> None: ... - def clearstamps(self, n: int | None = ...) -> None: ... + def clearstamps(self, n: int | None = None) -> None: ... def filling(self) -> bool: ... def begin_fill(self) -> None: ... def end_fill(self) -> None: ... - def dot(self, size: int | None = ..., *color: _Color) -> None: ... - def write(self, arg: object, move: bool = ..., align: str = ..., font: tuple[str, int, str] = ...) -> None: ... + def dot(self, size: int | None = None, *color: _Color) -> None: ... + def write(self, arg: object, move: bool = False, align: str = "left", font: tuple[str, int, str] = ...) -> None: ... def begin_poly(self) -> None: ... def end_poly(self) -> None: ... def get_poly(self) -> _PolygonCoords | None: ... def getscreen(self) -> TurtleScreen: ... - def getturtle(self: Self) -> Self: ... + def getturtle(self) -> Self: ... getpen = getturtle - def onclick(self, fun: Callable[[float, float], object], btn: int = ..., add: bool | None = ...) -> None: ... - def onrelease(self, fun: Callable[[float, float], object], btn: int = ..., add: bool | None = ...) -> None: ... - def ondrag(self, fun: Callable[[float, float], object], btn: int = ..., add: bool | None = ...) -> None: ... + def onclick(self, fun: Callable[[float, float], object], btn: int = 1, add: bool | None = None) -> None: ... + def onrelease(self, fun: Callable[[float, float], object], btn: int = 1, add: bool | None = None) -> None: ... + def ondrag(self, fun: Callable[[float, float], object], btn: int = 1, add: bool | None = None) -> None: ... def undo(self) -> None: ... turtlesize = shapesize @@ -420,22 +423,22 @@ class _Screen(TurtleScreen): # Note int and float are interpreted differently, hence the Union instead of just float def setup( self, - width: int | float = ..., # noqa: Y041 - height: int | float = ..., # noqa: Y041 - startx: int | None = ..., - starty: int | None = ..., + width: int | float = 0.5, # noqa: Y041 + height: int | float = 0.75, # noqa: Y041 + startx: int | None = None, + starty: int | None = None, ) -> None: ... def title(self, titlestring: str) -> None: ... def bye(self) -> None: ... def exitonclick(self) -> None: ... class Turtle(RawTurtle): - def __init__(self, shape: str = ..., undobuffersize: int = ..., visible: bool = ...) -> None: ... + def __init__(self, shape: str = "classic", undobuffersize: int = 1000, visible: bool = True) -> None: ... RawPen = RawTurtle Pen = Turtle -def write_docstringdict(filename: str = ...) -> None: ... +def write_docstringdict(filename: str = "turtle_docstringdict") -> None: ... # Note: it's somewhat unfortunate that we have to copy the function signatures. # It would be nice if we could partially reduce the redundancy by doing something @@ -453,20 +456,20 @@ def write_docstringdict(filename: str = ...) -> None: ... def mainloop() -> None: ... def textinput(title: str, prompt: str) -> str | None: ... def numinput( - title: str, prompt: str, default: float | None = ..., minval: float | None = ..., maxval: float | None = ... + title: str, prompt: str, default: float | None = None, minval: float | None = None, maxval: float | None = None ) -> float | None: ... # Functions copied from TurtleScreen: def clear() -> None: ... @overload -def mode(mode: None = ...) -> str: ... +def mode(mode: None = None) -> str: ... @overload def mode(mode: str) -> None: ... def setworldcoordinates(llx: float, lly: float, urx: float, ury: float) -> None: ... -def register_shape(name: str, shape: _PolygonCoords | Shape | None = ...) -> None: ... +def register_shape(name: str, shape: _PolygonCoords | Shape | None = None) -> None: ... @overload -def colormode(cmode: None = ...) -> float: ... +def colormode(cmode: None = None) -> float: ... @overload def colormode(cmode: float) -> None: ... def reset() -> None: ... @@ -478,11 +481,11 @@ def bgcolor(color: _Color) -> None: ... @overload def bgcolor(r: float, g: float, b: float) -> None: ... @overload -def tracer(n: None = ...) -> int: ... +def tracer(n: None = None) -> int: ... @overload -def tracer(n: int, delay: int | None = ...) -> None: ... +def tracer(n: int, delay: int | None = None) -> None: ... @overload -def delay(delay: None = ...) -> int: ... +def delay(delay: None = None) -> int: ... @overload def delay(delay: int) -> None: ... def update() -> None: ... @@ -490,31 +493,31 @@ def window_width() -> int: ... def window_height() -> int: ... def getcanvas() -> Canvas: ... def getshapes() -> list[str]: ... -def onclick(fun: Callable[[float, float], object], btn: int = ..., add: Any | None = ...) -> None: ... +def onclick(fun: Callable[[float, float], object], btn: int = 1, add: Any | None = None) -> None: ... def onkey(fun: Callable[[], object], key: str) -> None: ... -def listen(xdummy: float | None = ..., ydummy: float | None = ...) -> None: ... -def ontimer(fun: Callable[[], object], t: int = ...) -> None: ... +def listen(xdummy: float | None = None, ydummy: float | None = None) -> None: ... +def ontimer(fun: Callable[[], object], t: int = 0) -> None: ... @overload -def bgpic(picname: None = ...) -> str: ... +def bgpic(picname: None = None) -> str: ... @overload def bgpic(picname: str) -> None: ... @overload -def screensize(canvwidth: None = ..., canvheight: None = ..., bg: None = ...) -> tuple[int, int]: ... +def screensize(canvwidth: None = None, canvheight: None = None, bg: None = None) -> tuple[int, int]: ... @overload -def screensize(canvwidth: int, canvheight: int, bg: _Color | None = ...) -> None: ... +def screensize(canvwidth: int, canvheight: int, bg: _Color | None = None) -> None: ... onscreenclick = onclick resetscreen = reset clearscreen = clear addshape = register_shape -def onkeypress(fun: Callable[[], object], key: str | None = ...) -> None: ... +def onkeypress(fun: Callable[[], object], key: str | None = None) -> None: ... onkeyrelease = onkey # Functions copied from _Screen: -def setup(width: float = ..., height: float = ..., startx: int | None = ..., starty: int | None = ...) -> None: ... +def setup(width: float = 0.5, height: float = 0.75, startx: int | None = None, starty: int | None = None) -> None: ... def title(titlestring: str) -> None: ... def bye() -> None: ... def exitonclick() -> None: ... @@ -522,7 +525,7 @@ def Screen() -> _Screen: ... # Functions copied from TNavigator: -def degrees(fullcircle: float = ...) -> None: ... +def degrees(fullcircle: float = 360.0) -> None: ... def radians() -> None: ... def forward(distance: float) -> None: ... def back(distance: float) -> None: ... @@ -532,23 +535,23 @@ def pos() -> Vec2D: ... def xcor() -> float: ... def ycor() -> float: ... @overload -def goto(x: tuple[float, float], y: None = ...) -> None: ... +def goto(x: tuple[float, float], y: None = None) -> None: ... @overload def goto(x: float, y: float) -> None: ... def home() -> None: ... def setx(x: float) -> None: ... def sety(y: float) -> None: ... @overload -def distance(x: TNavigator | tuple[float, float], y: None = ...) -> float: ... +def distance(x: TNavigator | tuple[float, float], y: None = None) -> float: ... @overload def distance(x: float, y: float) -> float: ... @overload -def towards(x: TNavigator | tuple[float, float], y: None = ...) -> float: ... +def towards(x: TNavigator | tuple[float, float], y: None = None) -> float: ... @overload def towards(x: float, y: float) -> float: ... def heading() -> float: ... def setheading(to_angle: float) -> None: ... -def circle(radius: float, extent: float | None = ..., steps: int | None = ...) -> None: ... +def circle(radius: float, extent: float | None = None, steps: int | None = None) -> None: ... fd = forward bk = back @@ -562,18 +565,18 @@ seth = setheading # Functions copied from TPen: @overload -def resizemode(rmode: None = ...) -> str: ... +def resizemode(rmode: None = None) -> str: ... @overload def resizemode(rmode: str) -> None: ... @overload -def pensize(width: None = ...) -> int: ... +def pensize(width: None = None) -> int: ... @overload def pensize(width: int) -> None: ... def penup() -> None: ... def pendown() -> None: ... def isdown() -> bool: ... @overload -def speed(speed: None = ...) -> int: ... +def speed(speed: None = None) -> int: ... @overload def speed(speed: _Speed) -> None: ... @overload @@ -605,7 +608,7 @@ def isvisible() -> bool: ... def pen() -> _PenState: ... # type: ignore[misc] @overload def pen( - pen: _PenState | None = ..., + pen: _PenState | None = None, *, shown: bool = ..., pendown: bool = ..., @@ -632,7 +635,7 @@ ht = hideturtle def setundobuffer(size: int | None) -> None: ... def undobufferentries() -> int: ... @overload -def shape(name: None = ...) -> str: ... +def shape(name: None = None) -> str: ... @overload def shape(name: str) -> None: ... @@ -640,9 +643,9 @@ def shape(name: str) -> None: ... @overload def shapesize() -> tuple[float, float, float]: ... # type: ignore[misc] @overload -def shapesize(stretch_wid: float | None = ..., stretch_len: float | None = ..., outline: float | None = ...) -> None: ... +def shapesize(stretch_wid: float | None = None, stretch_len: float | None = None, outline: float | None = None) -> None: ... @overload -def shearfactor(shear: None = ...) -> float: ... +def shearfactor(shear: None = None) -> float: ... @overload def shearfactor(shear: float) -> None: ... @@ -651,12 +654,12 @@ def shearfactor(shear: float) -> None: ... def shapetransform() -> tuple[float, float, float, float]: ... # type: ignore[misc] @overload def shapetransform( - t11: float | None = ..., t12: float | None = ..., t21: float | None = ..., t22: float | None = ... + t11: float | None = None, t12: float | None = None, t21: float | None = None, t22: float | None = None ) -> None: ... def get_shapepoly() -> _PolygonCoords | None: ... def settiltangle(angle: float) -> None: ... @overload -def tiltangle(angle: None = ...) -> float: ... +def tiltangle(angle: None = None) -> float: ... @overload def tiltangle(angle: float) -> None: ... def tilt(angle: float) -> None: ... @@ -666,12 +669,12 @@ def tilt(angle: float) -> None: ... # we return Any. def stamp() -> Any: ... def clearstamp(stampid: int | tuple[int, ...]) -> None: ... -def clearstamps(n: int | None = ...) -> None: ... +def clearstamps(n: int | None = None) -> None: ... def filling() -> bool: ... def begin_fill() -> None: ... def end_fill() -> None: ... -def dot(size: int | None = ..., *color: _Color) -> None: ... -def write(arg: object, move: bool = ..., align: str = ..., font: tuple[str, int, str] = ...) -> None: ... +def dot(size: int | None = None, *color: _Color) -> None: ... +def write(arg: object, move: bool = False, align: str = "left", font: tuple[str, int, str] = ...) -> None: ... def begin_poly() -> None: ... def end_poly() -> None: ... def get_poly() -> _PolygonCoords | None: ... @@ -680,8 +683,8 @@ def getturtle() -> Turtle: ... getpen = getturtle -def onrelease(fun: Callable[[float, float], object], btn: int = ..., add: Any | None = ...) -> None: ... -def ondrag(fun: Callable[[float, float], object], btn: int = ..., add: Any | None = ...) -> None: ... +def onrelease(fun: Callable[[float, float], object], btn: int = 1, add: Any | None = None) -> None: ... +def ondrag(fun: Callable[[float, float], object], btn: int = 1, add: Any | None = None) -> None: ... def undo() -> None: ... turtlesize = shapesize diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/types.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/types.pyi index 28fce697f..2b3e58b8a 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/types.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/types.pyi @@ -16,7 +16,7 @@ from collections.abc import ( from importlib.machinery import ModuleSpec # pytype crashes if types.MappingProxyType inherits from collections.abc.Mapping instead of typing.Mapping -from typing import Any, ClassVar, Generic, Mapping, Protocol, TypeVar, overload # noqa: Y027 +from typing import Any, ClassVar, Generic, Mapping, Protocol, TypeVar, overload # noqa: Y022 from typing_extensions import Literal, ParamSpec, final __all__ = [ @@ -68,6 +68,9 @@ _V_co = TypeVar("_V_co", covariant=True) @final class _Cell: + if sys.version_info >= (3, 8): + def __init__(self, __contents: object = ...) -> None: ... + __hash__: ClassVar[None] # type: ignore[assignment] cell_contents: Any @@ -100,9 +103,9 @@ class FunctionType: ) -> None: ... def __call__(self, *args: Any, **kwargs: Any) -> Any: ... @overload - def __get__(self, obj: None, type: type) -> FunctionType: ... + def __get__(self, __instance: None, __owner: type) -> FunctionType: ... @overload - def __get__(self, obj: object, type: type | None = ...) -> MethodType: ... + def __get__(self, __instance: object, __owner: type | None = None) -> MethodType: ... LambdaType = FunctionType @@ -238,13 +241,13 @@ class CodeType: def replace( self, *, - co_argcount: int = ..., - co_posonlyargcount: int = ..., - co_kwonlyargcount: int = ..., - co_nlocals: int = ..., - co_stacksize: int = ..., - co_flags: int = ..., - co_firstlineno: int = ..., + co_argcount: int = -1, + co_posonlyargcount: int = -1, + co_kwonlyargcount: int = -1, + co_nlocals: int = -1, + co_stacksize: int = -1, + co_flags: int = -1, + co_firstlineno: int = -1, co_code: bytes = ..., co_consts: tuple[object, ...] = ..., co_names: tuple[str, ...] = ..., @@ -261,13 +264,13 @@ class CodeType: def replace( self, *, - co_argcount: int = ..., - co_posonlyargcount: int = ..., - co_kwonlyargcount: int = ..., - co_nlocals: int = ..., - co_stacksize: int = ..., - co_flags: int = ..., - co_firstlineno: int = ..., + co_argcount: int = -1, + co_posonlyargcount: int = -1, + co_kwonlyargcount: int = -1, + co_nlocals: int = -1, + co_stacksize: int = -1, + co_flags: int = -1, + co_firstlineno: int = -1, co_code: bytes = ..., co_consts: tuple[object, ...] = ..., co_names: tuple[str, ...] = ..., @@ -282,13 +285,13 @@ class CodeType: def replace( self, *, - co_argcount: int = ..., - co_posonlyargcount: int = ..., - co_kwonlyargcount: int = ..., - co_nlocals: int = ..., - co_stacksize: int = ..., - co_flags: int = ..., - co_firstlineno: int = ..., + co_argcount: int = -1, + co_posonlyargcount: int = -1, + co_kwonlyargcount: int = -1, + co_nlocals: int = -1, + co_stacksize: int = -1, + co_flags: int = -1, + co_firstlineno: int = -1, co_code: bytes = ..., co_consts: tuple[object, ...] = ..., co_names: tuple[str, ...] = ..., @@ -304,9 +307,10 @@ class CodeType: class MappingProxyType(Mapping[_KT, _VT_co], Generic[_KT, _VT_co]): __hash__: ClassVar[None] # type: ignore[assignment] def __init__(self, mapping: SupportsKeysAndGetItem[_KT, _VT_co]) -> None: ... - def __getitem__(self, __k: _KT) -> _VT_co: ... + def __getitem__(self, __key: _KT) -> _VT_co: ... def __iter__(self) -> Iterator[_KT]: ... def __len__(self) -> int: ... + def __eq__(self, __value: object) -> bool: ... def copy(self) -> dict[_KT, _VT_co]: ... def keys(self) -> KeysView[_KT]: ... def values(self) -> ValuesView[_VT_co]: ... @@ -344,12 +348,6 @@ class ModuleType: @final class GeneratorType(Generator[_T_co, _T_contra, _V_co]): - @property - def gi_code(self) -> CodeType: ... - @property - def gi_frame(self) -> FrameType: ... - @property - def gi_running(self) -> bool: ... @property def gi_yieldfrom(self) -> GeneratorType[_T_co, _T_contra, Any] | None: ... if sys.version_info >= (3, 11): @@ -359,25 +357,18 @@ class GeneratorType(Generator[_T_co, _T_contra, _V_co]): __qualname__: str def __iter__(self) -> GeneratorType[_T_co, _T_contra, _V_co]: ... def __next__(self) -> _T_co: ... - def close(self) -> None: ... def send(self, __arg: _T_contra) -> _T_co: ... @overload def throw( self, __typ: type[BaseException], __val: BaseException | object = ..., __tb: TracebackType | None = ... ) -> _T_co: ... @overload - def throw(self, __typ: BaseException, __val: None = ..., __tb: TracebackType | None = ...) -> _T_co: ... + def throw(self, __typ: BaseException, __val: None = None, __tb: TracebackType | None = ...) -> _T_co: ... @final class AsyncGeneratorType(AsyncGenerator[_T_co, _T_contra]): @property def ag_await(self) -> Awaitable[Any] | None: ... - @property - def ag_frame(self) -> FrameType: ... - @property - def ag_running(self) -> bool: ... - @property - def ag_code(self) -> CodeType: ... __name__: str __qualname__: str def __aiter__(self) -> AsyncGeneratorType[_T_co, _T_contra]: ... @@ -388,7 +379,7 @@ class AsyncGeneratorType(AsyncGenerator[_T_co, _T_contra]): self, __typ: type[BaseException], __val: BaseException | object = ..., __tb: TracebackType | None = ... ) -> _T_co: ... @overload - async def athrow(self, __typ: BaseException, __val: None = ..., __tb: TracebackType | None = ...) -> _T_co: ... + async def athrow(self, __typ: BaseException, __val: None = None, __tb: TracebackType | None = ...) -> _T_co: ... def aclose(self) -> Coroutine[Any, Any, None]: ... if sys.version_info >= (3, 9): def __class_getitem__(cls, __item: Any) -> GenericAlias: ... @@ -398,14 +389,6 @@ class CoroutineType(Coroutine[_T_co, _T_contra, _V_co]): __name__: str __qualname__: str @property - def cr_await(self) -> Any | None: ... - @property - def cr_code(self) -> CodeType: ... - @property - def cr_frame(self) -> FrameType: ... - @property - def cr_running(self) -> bool: ... - @property def cr_origin(self) -> tuple[tuple[str, int, str], ...] | None: ... if sys.version_info >= (3, 11): @property @@ -419,7 +402,7 @@ class CoroutineType(Coroutine[_T_co, _T_contra, _V_co]): self, __typ: type[BaseException], __val: BaseException | object = ..., __tb: TracebackType | None = ... ) -> _T_co: ... @overload - def throw(self, __typ: BaseException, __val: None = ..., __tb: TracebackType | None = ...) -> _T_co: ... + def throw(self, __typ: BaseException, __val: None = None, __tb: TracebackType | None = ...) -> _T_co: ... class _StaticFunctionType: # Fictional type to correct the type of MethodType.__func__. @@ -431,7 +414,7 @@ class _StaticFunctionType: # By wrapping FunctionType in _StaticFunctionType, we get the right result; # similar to wrapping a function in staticmethod() at runtime to prevent it # being bound as a method. - def __get__(self, obj: object | None, type: type | None) -> FunctionType: ... + def __get__(self, obj: object, type: type | None) -> FunctionType: ... @final class MethodType: @@ -471,7 +454,7 @@ class WrapperDescriptorType: @property def __objclass__(self) -> type: ... def __call__(self, *args: Any, **kwargs: Any) -> Any: ... - def __get__(self, __obj: Any, __type: type = ...) -> Any: ... + def __get__(self, __instance: Any, __owner: type | None = None) -> Any: ... @final class MethodWrapperType: @@ -484,8 +467,8 @@ class MethodWrapperType: @property def __objclass__(self) -> type: ... def __call__(self, *args: Any, **kwargs: Any) -> Any: ... - def __eq__(self, __other: object) -> bool: ... - def __ne__(self, __other: object) -> bool: ... + def __eq__(self, __value: object) -> bool: ... + def __ne__(self, __value: object) -> bool: ... @final class MethodDescriptorType: @@ -496,7 +479,7 @@ class MethodDescriptorType: @property def __objclass__(self) -> type: ... def __call__(self, *args: Any, **kwargs: Any) -> Any: ... - def __get__(self, obj: Any, type: type = ...) -> Any: ... + def __get__(self, __instance: Any, __owner: type | None = None) -> Any: ... @final class ClassMethodDescriptorType: @@ -507,7 +490,7 @@ class ClassMethodDescriptorType: @property def __objclass__(self) -> type: ... def __call__(self, *args: Any, **kwargs: Any) -> Any: ... - def __get__(self, obj: Any, type: type = ...) -> Any: ... + def __get__(self, __instance: Any, __owner: type | None = None) -> Any: ... @final class TracebackType: @@ -553,9 +536,9 @@ class GetSetDescriptorType: def __qualname__(self) -> str: ... @property def __objclass__(self) -> type: ... - def __get__(self, __obj: Any, __type: type = ...) -> Any: ... + def __get__(self, __instance: Any, __owner: type | None = None) -> Any: ... def __set__(self, __instance: Any, __value: Any) -> None: ... - def __delete__(self, __obj: Any) -> None: ... + def __delete__(self, __instance: Any) -> None: ... @final class MemberDescriptorType: @@ -565,19 +548,19 @@ class MemberDescriptorType: def __qualname__(self) -> str: ... @property def __objclass__(self) -> type: ... - def __get__(self, __obj: Any, __type: type = ...) -> Any: ... + def __get__(self, __instance: Any, __owner: type | None = None) -> Any: ... def __set__(self, __instance: Any, __value: Any) -> None: ... - def __delete__(self, __obj: Any) -> None: ... + def __delete__(self, __instance: Any) -> None: ... def new_class( name: str, bases: Iterable[object] = ..., - kwds: dict[str, Any] | None = ..., - exec_body: Callable[[dict[str, Any]], object] | None = ..., + kwds: dict[str, Any] | None = None, + exec_body: Callable[[dict[str, Any]], object] | None = None, ) -> type: ... def resolve_bases(bases: Iterable[object]) -> tuple[Any, ...]: ... def prepare_class( - name: str, bases: tuple[type, ...] = ..., kwds: dict[str, Any] | None = ... + name: str, bases: tuple[type, ...] = ..., kwds: dict[str, Any] | None = None ) -> tuple[type, dict[str, Any], dict[str, Any]]: ... # Actually a different type, but `property` is special and we want that too. @@ -590,7 +573,7 @@ _P = ParamSpec("_P") # it's not really an Awaitable, but can be used in an await expression. Real type: Generator & Awaitable # The type: ignore is due to overlapping overloads, not the use of ParamSpec @overload -def coroutine(func: Callable[_P, Generator[_R, Any, Any]]) -> Callable[_P, Awaitable[_R]]: ... # type: ignore[misc] +def coroutine(func: Callable[_P, Generator[Any, Any, _R]]) -> Callable[_P, Awaitable[_R]]: ... # type: ignore[misc] @overload def coroutine(func: _Fn) -> _Fn: ... @@ -606,13 +589,15 @@ if sys.version_info >= (3, 9): @property def __parameters__(self) -> tuple[Any, ...]: ... def __init__(self, origin: type, args: Any) -> None: ... + def __getitem__(self, __typeargs: Any) -> GenericAlias: ... if sys.version_info >= (3, 11): @property def __unpacked__(self) -> bool: ... @property def __typing_unpacked_tuple_args__(self) -> tuple[Any, ...] | None: ... - def __getattr__(self, name: str) -> Any: ... # incomplete + # GenericAlias delegates attr access to `__origin__` + def __getattr__(self, name: str) -> Any: ... if sys.version_info >= (3, 10): @final @@ -626,5 +611,5 @@ if sys.version_info >= (3, 10): class UnionType: @property def __args__(self) -> tuple[Any, ...]: ... - def __or__(self, __obj: Any) -> UnionType: ... - def __ror__(self, __obj: Any) -> UnionType: ... + def __or__(self, __value: Any) -> UnionType: ... + def __ror__(self, __value: Any) -> UnionType: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/typing.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/typing.pyi index cda01e53a..0a8de1a7b 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/typing.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/typing.pyi @@ -1,6 +1,8 @@ import collections # Needed by aliases like DefaultDict, see mypy issue 2986 import sys -from _typeshed import IdentityFunction, Incomplete, Self as TypeshedSelf, SupportsKeysAndGetItem +import typing_extensions +from _collections_abc import dict_items, dict_keys, dict_values +from _typeshed import IdentityFunction, Incomplete, ReadableBuffer, SupportsKeysAndGetItem from abc import ABCMeta, abstractmethod from contextlib import AbstractAsyncContextManager, AbstractContextManager from re import Match as Match, Pattern as Pattern @@ -16,7 +18,12 @@ from types import ( TracebackType, WrapperDescriptorType, ) -from typing_extensions import ParamSpec as _ParamSpec, final as _final +from typing_extensions import Never as _Never, ParamSpec as _ParamSpec, final as _final + +if sys.version_info >= (3, 10): + from types import UnionType +if sys.version_info >= (3, 9): + from types import GenericAlias __all__ = [ "AbstractSet", @@ -135,7 +142,7 @@ class TypeVar: __covariant__: bool __contravariant__: bool def __init__( - self, name: str, *constraints: Any, bound: Any | None = ..., covariant: bool = ..., contravariant: bool = ... + self, name: str, *constraints: Any, bound: Any | None = None, covariant: bool = False, contravariant: bool = False ) -> None: ... if sys.version_info >= (3, 10): def __or__(self, right: Any) -> _SpecialForm: ... @@ -173,10 +180,10 @@ Protocol: _SpecialForm = ... Callable: _SpecialForm = ... Type: _SpecialForm = ... NoReturn: _SpecialForm = ... +ClassVar: _SpecialForm = ... Optional: _SpecialForm Tuple: _SpecialForm -ClassVar: _SpecialForm if sys.version_info >= (3, 8): Final: _SpecialForm def final(f: _T) -> _T: ... @@ -213,7 +220,9 @@ if sys.version_info >= (3, 10): __bound__: Any | None __covariant__: bool __contravariant__: bool - def __init__(self, name: str, *, bound: Any | None = ..., contravariant: bool = ..., covariant: bool = ...) -> None: ... + def __init__( + self, name: str, *, bound: Any | None = None, contravariant: bool = False, covariant: bool = False + ) -> None: ... @property def args(self) -> ParamSpecArgs: ... @property @@ -250,7 +259,7 @@ _T_contra = TypeVar("_T_contra", contravariant=True) # Ditto contravariant. _TC = TypeVar("_TC", bound=Type[object]) def no_type_check(arg: _F) -> _F: ... -def no_type_check_decorator(decorator: Callable[_P, _T]) -> Callable[_P, _T]: ... # type: ignore[misc] +def no_type_check_decorator(decorator: Callable[_P, _T]) -> Callable[_P, _T]: ... # Type aliases and type constructors @@ -358,11 +367,11 @@ class Generator(Iterator[_T_co], Generic[_T_co, _T_contra, _V_co]): @overload @abstractmethod def throw( - self, __typ: Type[BaseException], __val: BaseException | object = ..., __tb: TracebackType | None = ... + self, __typ: Type[BaseException], __val: BaseException | object = None, __tb: TracebackType | None = None ) -> _T_co: ... @overload @abstractmethod - def throw(self, __typ: BaseException, __val: None = ..., __tb: TracebackType | None = ...) -> _T_co: ... + def throw(self, __typ: BaseException, __val: None = None, __tb: TracebackType | None = None) -> _T_co: ... def close(self) -> None: ... def __iter__(self) -> Generator[_T_co, _T_contra, _V_co]: ... @property @@ -395,11 +404,11 @@ class Coroutine(Awaitable[_V_co], Generic[_T_co, _T_contra, _V_co]): @overload @abstractmethod def throw( - self, __typ: Type[BaseException], __val: BaseException | object = ..., __tb: TracebackType | None = ... + self, __typ: Type[BaseException], __val: BaseException | object = None, __tb: TracebackType | None = None ) -> _T_co: ... @overload @abstractmethod - def throw(self, __typ: BaseException, __val: None = ..., __tb: TracebackType | None = ...) -> _T_co: ... + def throw(self, __typ: BaseException, __val: None = None, __tb: TracebackType | None = None) -> _T_co: ... @abstractmethod def close(self) -> None: ... @@ -428,11 +437,11 @@ class AsyncGenerator(AsyncIterator[_T_co], Generic[_T_co, _T_contra]): @overload @abstractmethod def athrow( - self, __typ: Type[BaseException], __val: BaseException | object = ..., __tb: TracebackType | None = ... + self, __typ: Type[BaseException], __val: BaseException | object = None, __tb: TracebackType | None = None ) -> Awaitable[_T_co]: ... @overload @abstractmethod - def athrow(self, __typ: BaseException, __val: None = ..., __tb: TracebackType | None = ...) -> Awaitable[_T_co]: ... + def athrow(self, __typ: BaseException, __val: None = None, __tb: TracebackType | None = None) -> Awaitable[_T_co]: ... def aclose(self) -> Awaitable[None]: ... @property def ag_await(self) -> Any: ... @@ -445,6 +454,7 @@ class AsyncGenerator(AsyncIterator[_T_co], Generic[_T_co, _T_contra]): @runtime_checkable class Container(Protocol[_T_co]): + # This is generic more on vibes than anything else @abstractmethod def __contains__(self, __x: object) -> bool: ... @@ -462,7 +472,7 @@ class Sequence(Collection[_T_co], Reversible[_T_co], Generic[_T_co]): @abstractmethod def __getitem__(self, index: slice) -> Sequence[_T_co]: ... # Mixin methods - def index(self, value: Any, start: int = ..., stop: int = ...) -> int: ... + def index(self, value: Any, start: int = 0, stop: int = ...) -> int: ... def count(self, value: Any) -> int: ... def __contains__(self, value: object) -> bool: ... def __iter__(self) -> Iterator[_T_co]: ... @@ -494,9 +504,9 @@ class MutableSequence(Sequence[_T], Generic[_T]): def clear(self) -> None: ... def extend(self, values: Iterable[_T]) -> None: ... def reverse(self) -> None: ... - def pop(self, index: int = ...) -> _T: ... + def pop(self, index: int = -1) -> _T: ... def remove(self, value: _T) -> None: ... - def __iadd__(self: TypeshedSelf, values: Iterable[_T]) -> TypeshedSelf: ... + def __iadd__(self, values: Iterable[_T]) -> typing_extensions.Self: ... class AbstractSet(Collection[_T_co], Generic[_T_co]): @abstractmethod @@ -522,10 +532,10 @@ class MutableSet(AbstractSet[_T], Generic[_T]): def clear(self) -> None: ... def pop(self) -> _T: ... def remove(self, value: _T) -> None: ... - def __ior__(self: TypeshedSelf, it: AbstractSet[_T]) -> TypeshedSelf: ... # type: ignore[override,misc] - def __iand__(self: TypeshedSelf, it: AbstractSet[Any]) -> TypeshedSelf: ... - def __ixor__(self: TypeshedSelf, it: AbstractSet[_T]) -> TypeshedSelf: ... # type: ignore[override,misc] - def __isub__(self: TypeshedSelf, it: AbstractSet[Any]) -> TypeshedSelf: ... + def __ior__(self, it: AbstractSet[_T]) -> typing_extensions.Self: ... # type: ignore[override,misc] + def __iand__(self, it: AbstractSet[Any]) -> typing_extensions.Self: ... + def __ixor__(self, it: AbstractSet[_T]) -> typing_extensions.Self: ... # type: ignore[override,misc] + def __isub__(self, it: AbstractSet[Any]) -> typing_extensions.Self: ... class MappingView(Sized): def __init__(self, mapping: Mapping[Any, Any]) -> None: ... # undocumented @@ -563,7 +573,7 @@ class KeysView(MappingView, AbstractSet[_KT_co], Generic[_KT_co]): def __xor__(self, other: Iterable[_T]) -> set[_KT_co | _T]: ... def __rxor__(self, other: Iterable[_T]) -> set[_KT_co | _T]: ... -class ValuesView(MappingView, Iterable[_VT_co], Generic[_VT_co]): +class ValuesView(MappingView, Collection[_VT_co], Generic[_VT_co]): def __init__(self, mapping: Mapping[Any, _VT_co]) -> None: ... # undocumented def __contains__(self, value: object) -> bool: ... def __iter__(self) -> Iterator[_VT_co]: ... @@ -574,7 +584,7 @@ class Mapping(Collection[_KT], Generic[_KT, _VT_co]): # TODO: We wish the key type could also be covariant, but that doesn't work, # see discussion in https://github.com/python/typing/pull/273. @abstractmethod - def __getitem__(self, __k: _KT) -> _VT_co: ... + def __getitem__(self, __key: _KT) -> _VT_co: ... # Mixin methods @overload def get(self, __key: _KT) -> _VT_co | None: ... @@ -583,13 +593,13 @@ class Mapping(Collection[_KT], Generic[_KT, _VT_co]): def items(self) -> ItemsView[_KT, _VT_co]: ... def keys(self) -> KeysView[_KT]: ... def values(self) -> ValuesView[_VT_co]: ... - def __contains__(self, __o: object) -> bool: ... + def __contains__(self, __key: object) -> bool: ... class MutableMapping(Mapping[_KT, _VT], Generic[_KT, _VT]): @abstractmethod - def __setitem__(self, __k: _KT, __v: _VT) -> None: ... + def __setitem__(self, __key: _KT, __value: _VT) -> None: ... @abstractmethod - def __delitem__(self, __v: _KT) -> None: ... + def __delitem__(self, __key: _KT) -> None: ... def clear(self) -> None: ... @overload def pop(self, __key: _KT) -> _VT: ... @@ -597,9 +607,13 @@ class MutableMapping(Mapping[_KT, _VT], Generic[_KT, _VT]): def pop(self, __key: _KT, default: _VT | _T) -> _VT | _T: ... def popitem(self) -> tuple[_KT, _VT]: ... # This overload should be allowed only if the value type is compatible with None. - # Keep OrderedDict.setdefault in line with MutableMapping.setdefault, modulo positional-only differences. + # + # Keep the following methods in line with MutableMapping.setdefault, modulo positional-only differences: + # -- collections.OrderedDict.setdefault + # -- collections.ChainMap.setdefault + # -- weakref.WeakKeyDictionary.setdefault @overload - def setdefault(self: MutableMapping[_KT, _T | None], __key: _KT) -> _T | None: ... + def setdefault(self: MutableMapping[_KT, _T | None], __key: _KT, __default: None = None) -> _T | None: ... @overload def setdefault(self, __key: _KT, __default: _VT) -> _VT: ... # 'update' used to take a Union, but using overloading is better. @@ -618,6 +632,8 @@ class MutableMapping(Mapping[_KT, _VT], Generic[_KT, _VT]): # -- os._Environ.__ior__ # -- collections.UserDict.__ior__ # -- collections.ChainMap.__ior__ + # -- peewee.attrdict.__add__ + # -- peewee.attrdict.__iadd__ # -- weakref.WeakValueDictionary.__ior__ # -- weakref.WeakKeyDictionary.__ior__ @overload @@ -635,7 +651,9 @@ TYPE_CHECKING: bool # This differs from runtime, but better reflects the fact that in reality # classes deriving from IO use different names for the arguments. class IO(Iterator[AnyStr], Generic[AnyStr]): - # TODO use abstract properties + # At runtime these are all abstract properties, + # but making them abstract in the stub is hugely disruptive, for not much gain. + # See #8726 @property def mode(self) -> str: ... @property @@ -651,26 +669,40 @@ class IO(Iterator[AnyStr], Generic[AnyStr]): @abstractmethod def isatty(self) -> bool: ... @abstractmethod - def read(self, __n: int = ...) -> AnyStr: ... + def read(self, __n: int = -1) -> AnyStr: ... @abstractmethod def readable(self) -> bool: ... @abstractmethod - def readline(self, __limit: int = ...) -> AnyStr: ... + def readline(self, __limit: int = -1) -> AnyStr: ... @abstractmethod - def readlines(self, __hint: int = ...) -> list[AnyStr]: ... + def readlines(self, __hint: int = -1) -> list[AnyStr]: ... @abstractmethod - def seek(self, __offset: int, __whence: int = ...) -> int: ... + def seek(self, __offset: int, __whence: int = 0) -> int: ... @abstractmethod def seekable(self) -> bool: ... @abstractmethod def tell(self) -> int: ... @abstractmethod - def truncate(self, __size: int | None = ...) -> int: ... + def truncate(self, __size: int | None = None) -> int: ... @abstractmethod def writable(self) -> bool: ... @abstractmethod + @overload + def write(self: IO[str], __s: str) -> int: ... + @abstractmethod + @overload + def write(self: IO[bytes], __s: ReadableBuffer) -> int: ... + @abstractmethod + @overload def write(self, __s: AnyStr) -> int: ... @abstractmethod + @overload + def writelines(self: IO[str], __lines: Iterable[str]) -> None: ... + @abstractmethod + @overload + def writelines(self: IO[bytes], __lines: Iterable[ReadableBuffer]) -> None: ... + @abstractmethod + @overload def writelines(self, __lines: Iterable[AnyStr]) -> None: ... @abstractmethod def __next__(self) -> AnyStr: ... @@ -680,7 +712,7 @@ class IO(Iterator[AnyStr], Generic[AnyStr]): def __enter__(self) -> IO[AnyStr]: ... @abstractmethod def __exit__( - self, __t: Type[BaseException] | None, __value: BaseException | None, __traceback: TracebackType | None + self, __type: Type[BaseException] | None, __value: BaseException | None, __traceback: TracebackType | None ) -> None: ... class BinaryIO(IO[bytes]): @@ -688,7 +720,7 @@ class BinaryIO(IO[bytes]): def __enter__(self) -> BinaryIO: ... class TextIO(IO[str]): - # TODO use abstractproperty + # See comment regarding the @properties in the `IO` class @property def buffer(self) -> BinaryIO: ... @property @@ -706,7 +738,7 @@ class ByteString(Sequence[int], metaclass=ABCMeta): ... # Functions -_get_type_hints_obj_allowed_types = ( # noqa: Y026 # TODO: Use TypeAlias once mypy bugs are fixed +_get_type_hints_obj_allowed_types: typing_extensions.TypeAlias = ( # noqa: Y042 object | Callable[..., Any] | FunctionType @@ -721,20 +753,32 @@ _get_type_hints_obj_allowed_types = ( # noqa: Y026 # TODO: Use TypeAlias once if sys.version_info >= (3, 9): def get_type_hints( obj: _get_type_hints_obj_allowed_types, - globalns: dict[str, Any] | None = ..., - localns: dict[str, Any] | None = ..., - include_extras: bool = ..., + globalns: dict[str, Any] | None = None, + localns: dict[str, Any] | None = None, + include_extras: bool = False, ) -> dict[str, Any]: ... else: def get_type_hints( - obj: _get_type_hints_obj_allowed_types, globalns: dict[str, Any] | None = ..., localns: dict[str, Any] | None = ... + obj: _get_type_hints_obj_allowed_types, globalns: dict[str, Any] | None = None, localns: dict[str, Any] | None = None ) -> dict[str, Any]: ... if sys.version_info >= (3, 8): - def get_origin(tp: Any) -> Any | None: ... def get_args(tp: Any) -> tuple[Any, ...]: ... + if sys.version_info >= (3, 10): + @overload + def get_origin(tp: ParamSpecArgs | ParamSpecKwargs) -> ParamSpec: ... + @overload + def get_origin(tp: UnionType) -> type[UnionType]: ... + if sys.version_info >= (3, 9): + @overload + def get_origin(tp: GenericAlias) -> type: ... + @overload + def get_origin(tp: Any) -> Any | None: ... + else: + def get_origin(tp: Any) -> Any | None: ... + @overload def cast(typ: Type[_T], val: Any) -> _T: ... @overload @@ -750,9 +794,10 @@ if sys.version_info >= (3, 11): def get_overloads(func: Callable[..., object]) -> Sequence[Callable[..., object]]: ... def dataclass_transform( *, - eq_default: bool = ..., - order_default: bool = ..., - kw_only_default: bool = ..., + eq_default: bool = True, + order_default: bool = False, + kw_only_default: bool = False, + frozen_default: bool = False, # on 3.11, runtime accepts it as part of kwargs field_specifiers: tuple[type[Any] | Callable[..., Any], ...] = ..., **kwargs: Any, ) -> IdentityFunction: ... @@ -770,7 +815,7 @@ class NamedTuple(tuple[Any, ...]): @overload def __init__(self, typename: str, fields: Iterable[tuple[str, Any]] = ...) -> None: ... @overload - def __init__(self, typename: str, fields: None = ..., **kwargs: Any) -> None: ... + def __init__(self, typename: str, fields: None = None, **kwargs: Any) -> None: ... @classmethod def _make(cls: Type[_T], iterable: Iterable[Any]) -> _T: ... if sys.version_info >= (3, 8): @@ -778,23 +823,30 @@ class NamedTuple(tuple[Any, ...]): else: def _asdict(self) -> collections.OrderedDict[str, Any]: ... - def _replace(self: TypeshedSelf, **kwargs: Any) -> TypeshedSelf: ... + def _replace(self, **kwargs: Any) -> typing_extensions.Self: ... # Internal mypy fallback type for all typed dicts (does not exist at runtime) +# N.B. Keep this mostly in sync with typing_extensions._TypedDict/mypy_extensions._TypedDict +@type_check_only class _TypedDict(Mapping[str, object], metaclass=ABCMeta): - def copy(self: TypeshedSelf) -> TypeshedSelf: ... - # Using NoReturn so that only calls using mypy plugin hook that specialize the signature + __total__: ClassVar[bool] + if sys.version_info >= (3, 9): + __required_keys__: ClassVar[frozenset[str]] + __optional_keys__: ClassVar[frozenset[str]] + def copy(self) -> typing_extensions.Self: ... + # Using Never so that only calls using mypy plugin hook that specialize the signature # can go through. - def setdefault(self, k: NoReturn, default: object) -> object: ... + def setdefault(self, k: _Never, default: object) -> object: ... # Mypy plugin hook for 'pop' expects that 'default' has a type variable type. - def pop(self, k: NoReturn, default: _T = ...) -> object: ... # pyright: ignore[reportInvalidTypeVarUse] + def pop(self, k: _Never, default: _T = ...) -> object: ... # pyright: ignore[reportInvalidTypeVarUse] def update(self: _T, __m: _T) -> None: ... - def __delitem__(self, k: NoReturn) -> None: ... - def items(self) -> ItemsView[str, object]: ... - def keys(self) -> KeysView[str]: ... - def values(self) -> ValuesView[object]: ... - def __or__(self: TypeshedSelf, __value: TypeshedSelf) -> TypeshedSelf: ... - def __ior__(self: TypeshedSelf, __value: TypeshedSelf) -> TypeshedSelf: ... + def __delitem__(self, k: _Never) -> None: ... + def items(self) -> dict_items[str, object]: ... + def keys(self) -> dict_keys[str, object]: ... + def values(self) -> dict_values[str, object]: ... + if sys.version_info >= (3, 9): + def __or__(self, __value: typing_extensions.Self) -> typing_extensions.Self: ... + def __ior__(self, __value: typing_extensions.Self) -> typing_extensions.Self: ... @_final class ForwardRef: @@ -807,11 +859,17 @@ class ForwardRef: __forward_module__: Any | None if sys.version_info >= (3, 9): # The module and is_class arguments were added in later Python 3.9 versions. - def __init__(self, arg: str, is_argument: bool = ..., module: Any | None = ..., *, is_class: bool = ...) -> None: ... + def __init__(self, arg: str, is_argument: bool = True, module: Any | None = None, *, is_class: bool = False) -> None: ... + else: + def __init__(self, arg: str, is_argument: bool = True) -> None: ... + + if sys.version_info >= (3, 9): + def _evaluate( + self, globalns: dict[str, Any] | None, localns: dict[str, Any] | None, recursive_guard: frozenset[str] + ) -> Any | None: ... else: - def __init__(self, arg: str, is_argument: bool = ...) -> None: ... + def _evaluate(self, globalns: dict[str, Any] | None, localns: dict[str, Any] | None) -> Any | None: ... - def _evaluate(self, globalns: dict[str, Any] | None, localns: dict[str, Any] | None) -> Any | None: ... def __eq__(self, other: object) -> bool: ... if sys.version_info >= (3, 11): def __or__(self, other: Any) -> _SpecialForm: ... @@ -819,3 +877,5 @@ class ForwardRef: if sys.version_info >= (3, 10): def is_typeddict(tp: object) -> bool: ... + +def _type_repr(obj: object) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/typing_extensions.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/typing_extensions.pyi index 11f188292..d8cf4e800 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/typing_extensions.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/typing_extensions.pyi @@ -1,11 +1,13 @@ import abc import collections import sys -from _typeshed import IdentityFunction, Self as TypeshedSelf # see #6932 for why the Self alias cannot have a leading underscore +import typing +from _collections_abc import dict_items, dict_keys, dict_values +from _typeshed import IdentityFunction, Incomplete from collections.abc import Iterable -from typing import ( # noqa: Y022,Y027,Y039 +from typing import ( # noqa: Y022,Y039 TYPE_CHECKING as TYPE_CHECKING, - Any, + Any as Any, AsyncContextManager as AsyncContextManager, AsyncGenerator as AsyncGenerator, AsyncIterable as AsyncIterable, @@ -19,21 +21,24 @@ from typing import ( # noqa: Y022,Y027,Y039 Counter as Counter, DefaultDict as DefaultDict, Deque as Deque, - ItemsView, - KeysView, Mapping, NewType as NewType, NoReturn as NoReturn, Sequence, Text as Text, Type as Type, - TypeVar, - ValuesView, _Alias, overload as overload, + type_check_only, ) +if sys.version_info >= (3, 10): + from types import UnionType +if sys.version_info >= (3, 9): + from types import GenericAlias + __all__ = [ + "Any", "ClassVar", "Concatenate", "Final", @@ -43,6 +48,7 @@ __all__ = [ "ParamSpecKwargs", "Self", "Type", + "TypeVar", "TypeVarTuple", "Unpack", "Awaitable", @@ -64,12 +70,14 @@ __all__ = [ "assert_never", "assert_type", "dataclass_transform", + "deprecated", "final", "IntVar", "is_typeddict", "Literal", "NewType", "overload", + "override", "Protocol", "reveal_type", "runtime", @@ -89,9 +97,9 @@ __all__ = [ "get_type_hints", ] -_T = TypeVar("_T") -_F = TypeVar("_F", bound=Callable[..., Any]) -_TC = TypeVar("_TC", bound=Type[object]) +_T = typing.TypeVar("_T") +_F = typing.TypeVar("_F", bound=Callable[..., Any]) +_TC = typing.TypeVar("_TC", bound=Type[object]) # unfortunately we have to duplicate this class definition from typing.pyi or we break pytype class _SpecialForm: @@ -120,21 +128,26 @@ Literal: _SpecialForm def IntVar(name: str) -> Any: ... # returns a new TypeVar # Internal mypy fallback type for all typed dicts (does not exist at runtime) +# N.B. Keep this mostly in sync with typing._TypedDict/mypy_extensions._TypedDict +@type_check_only class _TypedDict(Mapping[str, object], metaclass=abc.ABCMeta): - __required_keys__: frozenset[str] - __optional_keys__: frozenset[str] - __total__: bool - def copy(self: TypeshedSelf) -> TypeshedSelf: ... - # Using NoReturn so that only calls using mypy plugin hook that specialize the signature + __required_keys__: ClassVar[frozenset[str]] + __optional_keys__: ClassVar[frozenset[str]] + __total__: ClassVar[bool] + def copy(self) -> Self: ... + # Using Never so that only calls using mypy plugin hook that specialize the signature # can go through. - def setdefault(self, k: NoReturn, default: object) -> object: ... + def setdefault(self, k: Never, default: object) -> object: ... # Mypy plugin hook for 'pop' expects that 'default' has a type variable type. - def pop(self, k: NoReturn, default: _T = ...) -> object: ... # pyright: ignore[reportInvalidTypeVarUse] + def pop(self, k: Never, default: _T = ...) -> object: ... # pyright: ignore[reportInvalidTypeVarUse] def update(self: _T, __m: _T) -> None: ... - def items(self) -> ItemsView[str, object]: ... - def keys(self) -> KeysView[str]: ... - def values(self) -> ValuesView[object]: ... - def __delitem__(self, k: NoReturn) -> None: ... + def items(self) -> dict_items[str, object]: ... + def keys(self) -> dict_keys[str, object]: ... + def values(self) -> dict_values[str, object]: ... + def __delitem__(self, k: Never) -> None: ... + if sys.version_info >= (3, 9): + def __or__(self, __value: Self) -> Self: ... + def __ior__(self, __value: Self) -> Self: ... # TypedDict is a (non-subscriptable) special form. TypedDict: object @@ -143,11 +156,23 @@ OrderedDict = _Alias() def get_type_hints( obj: Callable[..., Any], - globalns: dict[str, Any] | None = ..., - localns: dict[str, Any] | None = ..., - include_extras: bool = ..., + globalns: dict[str, Any] | None = None, + localns: dict[str, Any] | None = None, + include_extras: bool = False, ) -> dict[str, Any]: ... def get_args(tp: Any) -> tuple[Any, ...]: ... + +if sys.version_info >= (3, 10): + @overload + def get_origin(tp: UnionType) -> type[UnionType]: ... + +if sys.version_info >= (3, 9): + @overload + def get_origin(tp: GenericAlias) -> type: ... + +@overload +def get_origin(tp: ParamSpecArgs | ParamSpecKwargs) -> ParamSpec: ... +@overload def get_origin(tp: Any) -> Any | None: ... Annotated: _SpecialForm @@ -162,7 +187,6 @@ class SupportsIndex(Protocol, metaclass=abc.ABCMeta): if sys.version_info >= (3, 10): from typing import ( Concatenate as Concatenate, - ParamSpec as ParamSpec, ParamSpecArgs as ParamSpecArgs, ParamSpecKwargs as ParamSpecKwargs, TypeAlias as TypeAlias, @@ -178,18 +202,6 @@ else: __origin__: ParamSpec def __init__(self, origin: ParamSpec) -> None: ... - class ParamSpec: - __name__: str - __bound__: type[Any] | None - __covariant__: bool - __contravariant__: bool - def __init__( - self, name: str, *, bound: None | type[Any] | str = ..., contravariant: bool = ..., covariant: bool = ... - ) -> None: ... - @property - def args(self) -> ParamSpecArgs: ... - @property - def kwargs(self) -> ParamSpecKwargs: ... Concatenate: _SpecialForm TypeAlias: _SpecialForm TypeGuard: _SpecialForm @@ -205,7 +217,6 @@ if sys.version_info >= (3, 11): NotRequired as NotRequired, Required as Required, Self as Self, - TypeVarTuple as TypeVarTuple, Unpack as Unpack, assert_never as assert_never, assert_type as assert_type, @@ -216,9 +227,9 @@ if sys.version_info >= (3, 11): ) else: Self: _SpecialForm - Never: _SpecialForm + Never: _SpecialForm = ... def reveal_type(__obj: _T) -> _T: ... - def assert_never(__arg: NoReturn) -> NoReturn: ... + def assert_never(__arg: Never) -> Never: ... def assert_type(__val: _T, __typ: Any) -> _T: ... def clear_overloads() -> None: ... def get_overloads(func: Callable[..., object]) -> Sequence[Callable[..., object]]: ... @@ -228,17 +239,12 @@ else: LiteralString: _SpecialForm Unpack: _SpecialForm - @final - class TypeVarTuple: - __name__: str - def __init__(self, name: str) -> None: ... - def __iter__(self) -> Any: ... # Unpack[Self] - def dataclass_transform( *, - eq_default: bool = ..., - order_default: bool = ..., - kw_only_default: bool = ..., + eq_default: bool = True, + order_default: bool = False, + kw_only_default: bool = False, + frozen_default: bool = False, field_specifiers: tuple[type[Any] | Callable[..., Any], ...] = ..., **kwargs: object, ) -> IdentityFunction: ... @@ -254,17 +260,75 @@ else: @overload def __init__(self, typename: str, fields: Iterable[tuple[str, Any]] = ...) -> None: ... @overload - def __init__(self, typename: str, fields: None = ..., **kwargs: Any) -> None: ... + def __init__(self, typename: str, fields: None = None, **kwargs: Any) -> None: ... @classmethod - def _make(cls: type[TypeshedSelf], iterable: Iterable[Any]) -> TypeshedSelf: ... + def _make(cls, iterable: Iterable[Any]) -> Self: ... if sys.version_info >= (3, 8): def _asdict(self) -> dict[str, Any]: ... else: def _asdict(self) -> collections.OrderedDict[str, Any]: ... - def _replace(self: TypeshedSelf, **kwargs: Any) -> TypeshedSelf: ... + def _replace(self, **kwargs: Any) -> Self: ... + +# New things in 3.xx +# The `default` parameter was added to TypeVar, ParamSpec, and TypeVarTuple (PEP 696) +# The `infer_variance` parameter was added to TypeVar (PEP 695) +# typing_extensions.override (PEP 698) +@final +class TypeVar: + __name__: str + __bound__: Any | None + __constraints__: tuple[Any, ...] + __covariant__: bool + __contravariant__: bool + __default__: Any | None + def __init__( + self, + name: str, + *constraints: Any, + bound: Any | None = None, + covariant: bool = False, + contravariant: bool = False, + default: Any | None = None, + infer_variance: bool = False, + ) -> None: ... + if sys.version_info >= (3, 10): + def __or__(self, right: Any) -> _SpecialForm: ... + def __ror__(self, left: Any) -> _SpecialForm: ... + if sys.version_info >= (3, 11): + def __typing_subst__(self, arg: Incomplete) -> Incomplete: ... + +@final +class ParamSpec: + __name__: str + __bound__: type[Any] | None + __covariant__: bool + __contravariant__: bool + __default__: type[Any] | None + def __init__( + self, + name: str, + *, + bound: None | type[Any] | str = None, + contravariant: bool = False, + covariant: bool = False, + default: type[Any] | str | None = None, + ) -> None: ... + @property + def args(self) -> ParamSpecArgs: ... + @property + def kwargs(self) -> ParamSpecKwargs: ... + +@final +class TypeVarTuple: + __name__: str + __default__: Any | None + def __init__(self, name: str, *, default: Any | None = None) -> None: ... + def __iter__(self) -> Any: ... # Unpack[Self] + +def override(__arg: _F) -> _F: ... +def deprecated(__msg: str, *, category: type[Warning] | None = ..., stacklevel: int = 1) -> Callable[[_T], _T]: ... -# Types not yet implemented in typing_extensions library # Proposed extension to PEP 647 StrictTypeGuard: _SpecialForm = ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/unicodedata.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/unicodedata.pyi index 7337ab878..5a1f7fe66 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/unicodedata.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/unicodedata.pyi @@ -1,6 +1,7 @@ import sys -from typing import Any, TypeVar -from typing_extensions import final +from _typeshed import ReadOnlyBuffer +from typing import Any, TypeVar, overload +from typing_extensions import Literal, TypeAlias, final ucd_3_2_0: UCD unidata_version: str @@ -13,36 +14,63 @@ _T = TypeVar("_T") def bidirectional(__chr: str) -> str: ... def category(__chr: str) -> str: ... def combining(__chr: str) -> int: ... -def decimal(__chr: str, __default: _T = ...) -> int | _T: ... +@overload +def decimal(__chr: str) -> int: ... +@overload +def decimal(__chr: str, __default: _T) -> int | _T: ... def decomposition(__chr: str) -> str: ... -def digit(__chr: str, __default: _T = ...) -> int | _T: ... -def east_asian_width(__chr: str) -> str: ... +@overload +def digit(__chr: str) -> int: ... +@overload +def digit(__chr: str, __default: _T) -> int | _T: ... + +_EastAsianWidth: TypeAlias = Literal["F", "H", "W", "Na", "A", "N"] + +def east_asian_width(__chr: str) -> _EastAsianWidth: ... if sys.version_info >= (3, 8): def is_normalized(__form: str, __unistr: str) -> bool: ... -def lookup(__name: str | bytes) -> str: ... +def lookup(__name: str | ReadOnlyBuffer) -> str: ... def mirrored(__chr: str) -> int: ... -def name(__chr: str, __default: _T = ...) -> str | _T: ... +@overload +def name(__chr: str) -> str: ... +@overload +def name(__chr: str, __default: _T) -> str | _T: ... def normalize(__form: str, __unistr: str) -> str: ... -def numeric(__chr: str, __default: _T = ...) -> float | _T: ... +@overload +def numeric(__chr: str) -> float: ... +@overload +def numeric(__chr: str, __default: _T) -> float | _T: ... @final class UCD: # The methods below are constructed from the same array in C - # (unicodedata_functions) and hence identical to the methods above. + # (unicodedata_functions) and hence identical to the functions above. unidata_version: str def bidirectional(self, __chr: str) -> str: ... def category(self, __chr: str) -> str: ... def combining(self, __chr: str) -> int: ... - def decimal(self, __chr: str, __default: _T = ...) -> int | _T: ... + @overload + def decimal(self, __chr: str) -> int: ... + @overload + def decimal(self, __chr: str, __default: _T) -> int | _T: ... def decomposition(self, __chr: str) -> str: ... - def digit(self, __chr: str, __default: _T = ...) -> int | _T: ... - def east_asian_width(self, __chr: str) -> str: ... + @overload + def digit(self, __chr: str) -> int: ... + @overload + def digit(self, __chr: str, __default: _T) -> int | _T: ... + def east_asian_width(self, __chr: str) -> _EastAsianWidth: ... if sys.version_info >= (3, 8): def is_normalized(self, __form: str, __unistr: str) -> bool: ... - def lookup(self, __name: str | bytes) -> str: ... + def lookup(self, __name: str | ReadOnlyBuffer) -> str: ... def mirrored(self, __chr: str) -> int: ... - def name(self, __chr: str, __default: _T = ...) -> str | _T: ... + @overload + def name(self, __chr: str) -> str: ... + @overload + def name(self, __chr: str, __default: _T) -> str | _T: ... def normalize(self, __form: str, __unistr: str) -> str: ... - def numeric(self, __chr: str, __default: _T = ...) -> float | _T: ... + @overload + def numeric(self, __chr: str) -> float: ... + @overload + def numeric(self, __chr: str, __default: _T) -> float | _T: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/unittest/case.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/unittest/case.pyi index 7db217077..45c39e3f3 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/unittest/case.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/unittest/case.pyi @@ -1,26 +1,13 @@ import logging import sys import unittest.result -from _typeshed import Self, SupportsDunderGE, SupportsDunderGT, SupportsDunderLE, SupportsDunderLT, SupportsRSub, SupportsSub +from _typeshed import SupportsDunderGE, SupportsDunderGT, SupportsDunderLE, SupportsDunderLT, SupportsRSub, SupportsSub from collections.abc import Callable, Container, Iterable, Mapping, Sequence, Set as AbstractSet from contextlib import AbstractContextManager from re import Pattern from types import TracebackType -from typing import ( - Any, - AnyStr, - ClassVar, - Generic, - NamedTuple, - NoReturn, - Protocol, - SupportsAbs, - SupportsRound, - TypeVar, - Union, - overload, -) -from typing_extensions import ParamSpec, TypeAlias +from typing import Any, AnyStr, ClassVar, Generic, NamedTuple, NoReturn, Protocol, SupportsAbs, SupportsRound, TypeVar, overload +from typing_extensions import ParamSpec, Self, TypeAlias from warnings import WarningMessage if sys.version_info >= (3, 9): @@ -61,11 +48,11 @@ else: def __init__(self, test_case: TestCase, logger_name: str, level: int) -> None: ... def __enter__(self) -> _LoggingWatcher: ... def __exit__( - self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None + self, exc_type: type[BaseException] | None, exc_value: BaseException | None, tb: TracebackType | None ) -> bool | None: ... if sys.version_info >= (3, 8): - def addModuleCleanup(__function: Callable[_P, object], *args: _P.args, **kwargs: _P.kwargs) -> None: ... + def addModuleCleanup(__function: Callable[_P, Any], *args: _P.args, **kwargs: _P.kwargs) -> None: ... def doModuleCleanups() -> None: ... if sys.version_info >= (3, 11): @@ -81,10 +68,13 @@ class SkipTest(Exception): class _SupportsAbsAndDunderGE(SupportsDunderGE[Any], SupportsAbs[Any], Protocol): ... +# Keep this alias in sync with builtins._ClassInfo +# We can't import it from builtins or pytype crashes, +# due to the fact that pytype uses a custom builtins stub rather than typeshed's builtins stub if sys.version_info >= (3, 10): - _IsInstanceClassInfo: TypeAlias = Union[type, UnionType, tuple[type | UnionType | tuple[Any, ...], ...]] + _ClassInfo: TypeAlias = type | UnionType | tuple[_ClassInfo, ...] else: - _IsInstanceClassInfo: TypeAlias = Union[type, tuple[type | tuple[Any, ...], ...]] + _ClassInfo: TypeAlias = type | tuple[_ClassInfo, ...] class TestCase: failureException: type[BaseException] @@ -94,7 +84,7 @@ class TestCase: _testMethodName: str # undocumented _testMethodDoc: str - def __init__(self, methodName: str = ...) -> None: ... + def __init__(self, methodName: str = "runTest") -> None: ... def __eq__(self, other: object) -> bool: ... def setUp(self) -> None: ... def tearDown(self) -> None: ... @@ -102,47 +92,47 @@ class TestCase: def setUpClass(cls) -> None: ... @classmethod def tearDownClass(cls) -> None: ... - def run(self, result: unittest.result.TestResult | None = ...) -> unittest.result.TestResult | None: ... + def run(self, result: unittest.result.TestResult | None = None) -> unittest.result.TestResult | None: ... def __call__(self, result: unittest.result.TestResult | None = ...) -> unittest.result.TestResult | None: ... - def skipTest(self, reason: Any) -> None: ... + def skipTest(self, reason: Any) -> NoReturn: ... def subTest(self, msg: Any = ..., **params: Any) -> AbstractContextManager[None]: ... def debug(self) -> None: ... if sys.version_info < (3, 11): def _addSkip(self, result: unittest.result.TestResult, test_case: TestCase, reason: str) -> None: ... - def assertEqual(self, first: Any, second: Any, msg: Any = ...) -> None: ... - def assertNotEqual(self, first: Any, second: Any, msg: Any = ...) -> None: ... - def assertTrue(self, expr: Any, msg: Any = ...) -> None: ... - def assertFalse(self, expr: Any, msg: Any = ...) -> None: ... - def assertIs(self, expr1: object, expr2: object, msg: Any = ...) -> None: ... - def assertIsNot(self, expr1: object, expr2: object, msg: Any = ...) -> None: ... - def assertIsNone(self, obj: object, msg: Any = ...) -> None: ... - def assertIsNotNone(self, obj: object, msg: Any = ...) -> None: ... - def assertIn(self, member: Any, container: Iterable[Any] | Container[Any], msg: Any = ...) -> None: ... - def assertNotIn(self, member: Any, container: Iterable[Any] | Container[Any], msg: Any = ...) -> None: ... - def assertIsInstance(self, obj: object, cls: _IsInstanceClassInfo, msg: Any = ...) -> None: ... - def assertNotIsInstance(self, obj: object, cls: _IsInstanceClassInfo, msg: Any = ...) -> None: ... + def assertEqual(self, first: Any, second: Any, msg: Any = None) -> None: ... + def assertNotEqual(self, first: Any, second: Any, msg: Any = None) -> None: ... + def assertTrue(self, expr: Any, msg: Any = None) -> None: ... + def assertFalse(self, expr: Any, msg: Any = None) -> None: ... + def assertIs(self, expr1: object, expr2: object, msg: Any = None) -> None: ... + def assertIsNot(self, expr1: object, expr2: object, msg: Any = None) -> None: ... + def assertIsNone(self, obj: object, msg: Any = None) -> None: ... + def assertIsNotNone(self, obj: object, msg: Any = None) -> None: ... + def assertIn(self, member: Any, container: Iterable[Any] | Container[Any], msg: Any = None) -> None: ... + def assertNotIn(self, member: Any, container: Iterable[Any] | Container[Any], msg: Any = None) -> None: ... + def assertIsInstance(self, obj: object, cls: _ClassInfo, msg: Any = None) -> None: ... + def assertNotIsInstance(self, obj: object, cls: _ClassInfo, msg: Any = None) -> None: ... @overload - def assertGreater(self, a: SupportsDunderGT[_T], b: _T, msg: Any = ...) -> None: ... + def assertGreater(self, a: SupportsDunderGT[_T], b: _T, msg: Any = None) -> None: ... @overload - def assertGreater(self, a: _T, b: SupportsDunderLT[_T], msg: Any = ...) -> None: ... + def assertGreater(self, a: _T, b: SupportsDunderLT[_T], msg: Any = None) -> None: ... @overload - def assertGreaterEqual(self, a: SupportsDunderGE[_T], b: _T, msg: Any = ...) -> None: ... + def assertGreaterEqual(self, a: SupportsDunderGE[_T], b: _T, msg: Any = None) -> None: ... @overload - def assertGreaterEqual(self, a: _T, b: SupportsDunderLE[_T], msg: Any = ...) -> None: ... + def assertGreaterEqual(self, a: _T, b: SupportsDunderLE[_T], msg: Any = None) -> None: ... @overload - def assertLess(self, a: SupportsDunderLT[_T], b: _T, msg: Any = ...) -> None: ... + def assertLess(self, a: SupportsDunderLT[_T], b: _T, msg: Any = None) -> None: ... @overload - def assertLess(self, a: _T, b: SupportsDunderGT[_T], msg: Any = ...) -> None: ... + def assertLess(self, a: _T, b: SupportsDunderGT[_T], msg: Any = None) -> None: ... @overload - def assertLessEqual(self, a: SupportsDunderLT[_T], b: _T, msg: Any = ...) -> None: ... + def assertLessEqual(self, a: SupportsDunderLT[_T], b: _T, msg: Any = None) -> None: ... @overload - def assertLessEqual(self, a: _T, b: SupportsDunderGT[_T], msg: Any = ...) -> None: ... + def assertLessEqual(self, a: _T, b: SupportsDunderGT[_T], msg: Any = None) -> None: ... # `assertRaises`, `assertRaisesRegex`, and `assertRaisesRegexp` # are not using `ParamSpec` intentionally, # because they might be used with explicitly wrong arg types to raise some error in tests. @overload - def assertRaises( # type: ignore[misc] + def assertRaises( self, expected_exception: type[BaseException] | tuple[type[BaseException], ...], callable: Callable[..., Any], @@ -150,126 +140,124 @@ class TestCase: **kwargs: Any, ) -> None: ... @overload - def assertRaises(self, expected_exception: type[_E] | tuple[type[_E], ...], msg: Any = ...) -> _AssertRaisesContext[_E]: ... + def assertRaises( + self, expected_exception: type[_E] | tuple[type[_E], ...], *, msg: Any = ... + ) -> _AssertRaisesContext[_E]: ... @overload - def assertRaisesRegex( # type: ignore[misc] + def assertRaisesRegex( self, expected_exception: type[BaseException] | tuple[type[BaseException], ...], - expected_regex: str | bytes | Pattern[str] | Pattern[bytes], - callable: Callable[..., object], + expected_regex: str | Pattern[str], + callable: Callable[..., Any], *args: Any, **kwargs: Any, ) -> None: ... @overload def assertRaisesRegex( - self, - expected_exception: type[_E] | tuple[type[_E], ...], - expected_regex: str | bytes | Pattern[str] | Pattern[bytes], - msg: Any = ..., + self, expected_exception: type[_E] | tuple[type[_E], ...], expected_regex: str | Pattern[str], *, msg: Any = ... ) -> _AssertRaisesContext[_E]: ... @overload - def assertWarns( # type: ignore[misc] + def assertWarns( self, expected_warning: type[Warning] | tuple[type[Warning], ...], - callable: Callable[_P, object], + callable: Callable[_P, Any], *args: _P.args, **kwargs: _P.kwargs, ) -> None: ... @overload - def assertWarns(self, expected_warning: type[Warning] | tuple[type[Warning], ...], msg: Any = ...) -> _AssertWarnsContext: ... + def assertWarns( + self, expected_warning: type[Warning] | tuple[type[Warning], ...], *, msg: Any = ... + ) -> _AssertWarnsContext: ... @overload - def assertWarnsRegex( # type: ignore[misc] + def assertWarnsRegex( self, expected_warning: type[Warning] | tuple[type[Warning], ...], - expected_regex: str | bytes | Pattern[str] | Pattern[bytes], - callable: Callable[_P, object], + expected_regex: str | Pattern[str], + callable: Callable[_P, Any], *args: _P.args, **kwargs: _P.kwargs, ) -> None: ... @overload def assertWarnsRegex( - self, - expected_warning: type[Warning] | tuple[type[Warning], ...], - expected_regex: str | bytes | Pattern[str] | Pattern[bytes], - msg: Any = ..., + self, expected_warning: type[Warning] | tuple[type[Warning], ...], expected_regex: str | Pattern[str], *, msg: Any = ... ) -> _AssertWarnsContext: ... def assertLogs( - self, logger: str | logging.Logger | None = ..., level: int | str | None = ... + self, logger: str | logging.Logger | None = None, level: int | str | None = None ) -> _AssertLogsContext[_LoggingWatcher]: ... if sys.version_info >= (3, 10): def assertNoLogs( - self, logger: str | logging.Logger | None = ..., level: int | str | None = ... + self, logger: str | logging.Logger | None = None, level: int | str | None = None ) -> _AssertLogsContext[None]: ... @overload def assertAlmostEqual(self, first: _S, second: _S, places: None, msg: Any, delta: _SupportsAbsAndDunderGE) -> None: ... @overload def assertAlmostEqual( - self, first: _S, second: _S, places: None = ..., msg: Any = ..., *, delta: _SupportsAbsAndDunderGE + self, first: _S, second: _S, places: None = None, msg: Any = None, *, delta: _SupportsAbsAndDunderGE ) -> None: ... @overload def assertAlmostEqual( self, first: SupportsSub[_T, SupportsAbs[SupportsRound[object]]], second: _T, - places: int | None = ..., - msg: Any = ..., - delta: None = ..., + places: int | None = None, + msg: Any = None, + delta: None = None, ) -> None: ... @overload def assertAlmostEqual( self, first: _T, second: SupportsRSub[_T, SupportsAbs[SupportsRound[object]]], - places: int | None = ..., - msg: Any = ..., - delta: None = ..., + places: int | None = None, + msg: Any = None, + delta: None = None, ) -> None: ... @overload def assertNotAlmostEqual(self, first: _S, second: _S, places: None, msg: Any, delta: _SupportsAbsAndDunderGE) -> None: ... @overload def assertNotAlmostEqual( - self, first: _S, second: _S, places: None = ..., msg: Any = ..., *, delta: _SupportsAbsAndDunderGE + self, first: _S, second: _S, places: None = None, msg: Any = None, *, delta: _SupportsAbsAndDunderGE ) -> None: ... @overload def assertNotAlmostEqual( self, first: SupportsSub[_T, SupportsAbs[SupportsRound[object]]], second: _T, - places: int | None = ..., - msg: Any = ..., - delta: None = ..., + places: int | None = None, + msg: Any = None, + delta: None = None, ) -> None: ... @overload def assertNotAlmostEqual( self, first: _T, second: SupportsRSub[_T, SupportsAbs[SupportsRound[object]]], - places: int | None = ..., - msg: Any = ..., - delta: None = ..., + places: int | None = None, + msg: Any = None, + delta: None = None, ) -> None: ... - def assertRegex(self, text: AnyStr, expected_regex: AnyStr | Pattern[AnyStr], msg: Any = ...) -> None: ... - def assertNotRegex(self, text: AnyStr, unexpected_regex: AnyStr | Pattern[AnyStr], msg: Any = ...) -> None: ... - def assertCountEqual(self, first: Iterable[Any], second: Iterable[Any], msg: Any = ...) -> None: ... + def assertRegex(self, text: AnyStr, expected_regex: AnyStr | Pattern[AnyStr], msg: Any = None) -> None: ... + def assertNotRegex(self, text: AnyStr, unexpected_regex: AnyStr | Pattern[AnyStr], msg: Any = None) -> None: ... + def assertCountEqual(self, first: Iterable[Any], second: Iterable[Any], msg: Any = None) -> None: ... def addTypeEqualityFunc(self, typeobj: type[Any], function: Callable[..., None]) -> None: ... - def assertMultiLineEqual(self, first: str, second: str, msg: Any = ...) -> None: ... + def assertMultiLineEqual(self, first: str, second: str, msg: Any = None) -> None: ... def assertSequenceEqual( - self, seq1: Sequence[Any], seq2: Sequence[Any], msg: Any = ..., seq_type: type[Sequence[Any]] | None = ... + self, seq1: Sequence[Any], seq2: Sequence[Any], msg: Any = None, seq_type: type[Sequence[Any]] | None = None ) -> None: ... - def assertListEqual(self, list1: list[Any], list2: list[Any], msg: Any = ...) -> None: ... - def assertTupleEqual(self, tuple1: tuple[Any, ...], tuple2: tuple[Any, ...], msg: Any = ...) -> None: ... - def assertSetEqual(self, set1: AbstractSet[object], set2: AbstractSet[object], msg: Any = ...) -> None: ... - def assertDictEqual(self, d1: Mapping[Any, object], d2: Mapping[Any, object], msg: Any = ...) -> None: ... - def fail(self, msg: Any = ...) -> NoReturn: ... + def assertListEqual(self, list1: list[Any], list2: list[Any], msg: Any = None) -> None: ... + def assertTupleEqual(self, tuple1: tuple[Any, ...], tuple2: tuple[Any, ...], msg: Any = None) -> None: ... + def assertSetEqual(self, set1: AbstractSet[object], set2: AbstractSet[object], msg: Any = None) -> None: ... + def assertDictEqual(self, d1: Mapping[Any, object], d2: Mapping[Any, object], msg: Any = None) -> None: ... + def fail(self, msg: Any = None) -> NoReturn: ... def countTestCases(self) -> int: ... def defaultTestResult(self) -> unittest.result.TestResult: ... def id(self) -> str: ... def shortDescription(self) -> str | None: ... if sys.version_info >= (3, 8): - def addCleanup(self, __function: Callable[_P, object], *args: _P.args, **kwargs: _P.kwargs) -> None: ... + def addCleanup(self, __function: Callable[_P, Any], *args: _P.args, **kwargs: _P.kwargs) -> None: ... else: - def addCleanup(self, function: Callable[_P, object], *args: _P.args, **kwargs: _P.kwargs) -> None: ... + def addCleanup(self, function: Callable[_P, Any], *args: _P.args, **kwargs: _P.kwargs) -> None: ... if sys.version_info >= (3, 11): def enterContext(self, cm: AbstractContextManager[_T]) -> _T: ... @@ -277,7 +265,7 @@ class TestCase: def doCleanups(self) -> None: ... if sys.version_info >= (3, 8): @classmethod - def addClassCleanup(cls, __function: Callable[_P, object], *args: _P.args, **kwargs: _P.kwargs) -> None: ... + def addClassCleanup(cls, __function: Callable[_P, Any], *args: _P.args, **kwargs: _P.kwargs) -> None: ... @classmethod def doClassCleanups(cls) -> None: ... @@ -304,22 +292,22 @@ class TestCase: assertNotRegexpMatches = assertNotRegex assertRaisesRegexp = assertRaisesRegex def assertDictContainsSubset( - self, subset: Mapping[Any, Any], dictionary: Mapping[Any, Any], msg: object = ... + self, subset: Mapping[Any, Any], dictionary: Mapping[Any, Any], msg: object = None ) -> None: ... class FunctionTestCase(TestCase): def __init__( self, - testFunc: Callable[[], object], - setUp: Callable[[], object] | None = ..., - tearDown: Callable[[], object] | None = ..., - description: str | None = ..., + testFunc: Callable[[], Any], + setUp: Callable[[], Any] | None = None, + tearDown: Callable[[], Any] | None = None, + description: str | None = None, ) -> None: ... def runTest(self) -> None: ... class _AssertRaisesContext(Generic[_E]): exception: _E - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, exc_value: BaseException | None, tb: TracebackType | None ) -> bool: ... @@ -331,7 +319,7 @@ class _AssertWarnsContext: filename: str lineno: int warnings: list[WarningMessage] - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, exc_value: BaseException | None, tb: TracebackType | None ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/unittest/loader.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/unittest/loader.pyi index 9ba04b084..f3850c939 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/unittest/loader.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/unittest/loader.pyi @@ -18,11 +18,14 @@ class TestLoader: testNamePatterns: list[str] | None suiteClass: _SuiteClass def loadTestsFromTestCase(self, testCaseClass: type[unittest.case.TestCase]) -> unittest.suite.TestSuite: ... - def loadTestsFromModule(self, module: ModuleType, *args: Any, pattern: Any = ...) -> unittest.suite.TestSuite: ... - def loadTestsFromName(self, name: str, module: ModuleType | None = ...) -> unittest.suite.TestSuite: ... - def loadTestsFromNames(self, names: Sequence[str], module: ModuleType | None = ...) -> unittest.suite.TestSuite: ... + def loadTestsFromModule(self, module: ModuleType, *args: Any, pattern: Any = None) -> unittest.suite.TestSuite: ... + def loadTestsFromName(self, name: str, module: ModuleType | None = None) -> unittest.suite.TestSuite: ... + def loadTestsFromNames(self, names: Sequence[str], module: ModuleType | None = None) -> unittest.suite.TestSuite: ... def getTestCaseNames(self, testCaseClass: type[unittest.case.TestCase]) -> Sequence[str]: ... - def discover(self, start_dir: str, pattern: str = ..., top_level_dir: str | None = ...) -> unittest.suite.TestSuite: ... + def discover( + self, start_dir: str, pattern: str = "test*.py", top_level_dir: str | None = None + ) -> unittest.suite.TestSuite: ... + def _match_path(self, path: str, full_path: str, pattern: str) -> bool: ... defaultTestLoader: TestLoader @@ -30,14 +33,14 @@ def getTestCaseNames( testCaseClass: type[unittest.case.TestCase], prefix: str, sortUsing: _SortComparisonMethod = ..., - testNamePatterns: list[str] | None = ..., + testNamePatterns: list[str] | None = None, ) -> Sequence[str]: ... def makeSuite( testCaseClass: type[unittest.case.TestCase], - prefix: str = ..., + prefix: str = "test", sortUsing: _SortComparisonMethod = ..., suiteClass: _SuiteClass = ..., ) -> unittest.suite.TestSuite: ... def findTestCases( - module: ModuleType, prefix: str = ..., sortUsing: _SortComparisonMethod = ..., suiteClass: _SuiteClass = ... + module: ModuleType, prefix: str = "test", sortUsing: _SortComparisonMethod = ..., suiteClass: _SuiteClass = ... ) -> unittest.suite.TestSuite: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/unittest/main.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/unittest/main.pyi index 915d559cc..6d970c920 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/unittest/main.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/unittest/main.pyi @@ -25,23 +25,23 @@ class TestProgram: testNamePatterns: list[str] | None def __init__( self, - module: None | str | ModuleType = ..., - defaultTest: str | Iterable[str] | None = ..., - argv: list[str] | None = ..., - testRunner: type[_TestRunner] | _TestRunner | None = ..., + module: None | str | ModuleType = "__main__", + defaultTest: str | Iterable[str] | None = None, + argv: list[str] | None = None, + testRunner: type[_TestRunner] | _TestRunner | None = None, testLoader: unittest.loader.TestLoader = ..., - exit: bool = ..., - verbosity: int = ..., - failfast: bool | None = ..., - catchbreak: bool | None = ..., - buffer: bool | None = ..., - warnings: str | None = ..., + exit: bool = True, + verbosity: int = 1, + failfast: bool | None = None, + catchbreak: bool | None = None, + buffer: bool | None = None, + warnings: str | None = None, *, - tb_locals: bool = ..., + tb_locals: bool = False, ) -> None: ... - def usageExit(self, msg: Any = ...) -> None: ... + def usageExit(self, msg: Any = None) -> None: ... def parseArgs(self, argv: list[str]) -> None: ... - def createTests(self, from_discovery: bool = ..., Loader: unittest.loader.TestLoader | None = ...) -> None: ... + def createTests(self, from_discovery: bool = False, Loader: unittest.loader.TestLoader | None = None) -> None: ... def runTests(self) -> None: ... # undocumented main = TestProgram diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/unittest/mock.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/unittest/mock.pyi index 473299459..953480549 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/unittest/mock.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/unittest/mock.pyi @@ -1,14 +1,15 @@ import sys -from _typeshed import Self -from collections.abc import Awaitable, Callable, Iterable, Mapping, Sequence +from collections.abc import Awaitable, Callable, Coroutine, Iterable, Mapping, Sequence from contextlib import _GeneratorContextManager from types import TracebackType from typing import Any, Generic, TypeVar, overload -from typing_extensions import Literal, TypeAlias +from typing_extensions import Final, Literal, Self, TypeAlias _T = TypeVar("_T") _TT = TypeVar("_TT", bound=type[Any]) _R = TypeVar("_R") +_F = TypeVar("_F", bound=Callable[..., Any]) +_AF = TypeVar("_AF", bound=Callable[..., Coroutine[Any, Any, Any]]) if sys.version_info >= (3, 8): __all__ = ( @@ -46,7 +47,7 @@ else: "seal", ) -__version__: str +__version__: Final[str] FILTER_DIR: Any @@ -55,7 +56,6 @@ class _SentinelObject: def __init__(self, name: Any) -> None: ... class _Sentinel: - def __init__(self) -> None: ... def __getattr__(self, name: str) -> Any: ... sentinel: Any @@ -67,23 +67,23 @@ _CallValue: TypeAlias = str | tuple[Any, ...] | Mapping[str, Any] | _ArgsKwargs class _Call(tuple[Any, ...]): def __new__( - cls: type[Self], - value: _CallValue = ..., - name: str | None = ..., - parent: Any | None = ..., - two: bool = ..., - from_kall: bool = ..., + cls, value: _CallValue = ..., name: str | None = "", parent: Any | None = None, two: bool = False, from_kall: bool = True ) -> Self: ... name: Any parent: Any from_kall: Any def __init__( - self, value: _CallValue = ..., name: str | None = ..., parent: Any | None = ..., two: bool = ..., from_kall: bool = ... + self, + value: _CallValue = ..., + name: str | None = None, + parent: Any | None = None, + two: bool = False, + from_kall: bool = True, ) -> None: ... def __eq__(self, other: object) -> bool: ... - def __ne__(self, __other: object) -> bool: ... + def __ne__(self, __value: object) -> bool: ... def __call__(self, *args: Any, **kwargs: Any) -> _Call: ... - def __getattr__(self, attr: Any) -> Any: ... + def __getattr__(self, attr: str) -> Any: ... def __getattribute__(self, attr: str) -> Any: ... if sys.version_info >= (3, 8): @property @@ -101,21 +101,23 @@ class _CallList(list[_Call]): class Base: def __init__(self, *args: Any, **kwargs: Any) -> None: ... +# We subclass with "Any" because mocks are explicitly designed to stand in for other types, +# something that can't be expressed with our static type system. class NonCallableMock(Base, Any): - def __new__(__cls: type[Self], *args: Any, **kw: Any) -> Self: ... + def __new__(__cls, *args: Any, **kw: Any) -> Self: ... def __init__( self, - spec: list[str] | object | type[object] | None = ..., - wraps: Any | None = ..., - name: str | None = ..., - spec_set: list[str] | object | type[object] | None = ..., - parent: NonCallableMock | None = ..., - _spec_state: Any | None = ..., - _new_name: str = ..., - _new_parent: NonCallableMock | None = ..., - _spec_as_instance: bool = ..., - _eat_self: bool | None = ..., - unsafe: bool = ..., + spec: list[str] | object | type[object] | None = None, + wraps: Any | None = None, + name: str | None = None, + spec_set: list[str] | object | type[object] | None = None, + parent: NonCallableMock | None = None, + _spec_state: Any | None = None, + _new_name: str = "", + _new_parent: NonCallableMock | None = None, + _spec_as_instance: bool = False, + _eat_self: bool | None = None, + unsafe: bool = False, **kwargs: Any, ) -> None: ... def __getattr__(self, name: str) -> Any: ... @@ -123,11 +125,11 @@ class NonCallableMock(Base, Any): def __setattr__(self, name: str, value: Any) -> None: ... def __dir__(self) -> list[str]: ... if sys.version_info >= (3, 8): - def _calls_repr(self, prefix: str = ...) -> str: ... + def _calls_repr(self, prefix: str = "Calls") -> str: ... def assert_called_with(self, *args: Any, **kwargs: Any) -> None: ... def assert_not_called(self) -> None: ... def assert_called_once_with(self, *args: Any, **kwargs: Any) -> None: ... - def _format_mock_failure_message(self, args: Any, kwargs: Any, action: str = ...) -> str: ... + def _format_mock_failure_message(self, args: Any, kwargs: Any, action: str = "call") -> str: ... else: def assert_called_with(_mock_self, *args: Any, **kwargs: Any) -> None: ... def assert_not_called(_mock_self) -> None: ... @@ -140,13 +142,13 @@ class NonCallableMock(Base, Any): def assert_called(_mock_self) -> None: ... def assert_called_once(_mock_self) -> None: ... - def reset_mock(self, visited: Any = ..., *, return_value: bool = ..., side_effect: bool = ...) -> None: ... + def reset_mock(self, visited: Any = None, *, return_value: bool = False, side_effect: bool = False) -> None: ... def _extract_mock_name(self) -> str: ... def _get_call_signature_from_name(self, name: str) -> Any: ... def assert_any_call(self, *args: Any, **kwargs: Any) -> None: ... - def assert_has_calls(self, calls: Sequence[_Call], any_order: bool = ...) -> None: ... - def mock_add_spec(self, spec: Any, spec_set: bool = ...) -> None: ... - def _mock_add_spec(self, spec: Any, spec_set: bool, _spec_as_instance: bool = ..., _eat_self: bool = ...) -> None: ... + def assert_has_calls(self, calls: Sequence[_Call], any_order: bool = False) -> None: ... + def mock_add_spec(self, spec: Any, spec_set: bool = False) -> None: ... + def _mock_add_spec(self, spec: Any, spec_set: bool, _spec_as_instance: bool = False, _eat_self: bool = False) -> None: ... def attach_mock(self, mock: NonCallableMock, attribute: str) -> None: ... def configure_mock(self, **kwargs: Any) -> None: ... return_value: Any @@ -164,16 +166,16 @@ class CallableMixin(Base): side_effect: Any def __init__( self, - spec: Any | None = ..., - side_effect: Any | None = ..., + spec: Any | None = None, + side_effect: Any | None = None, return_value: Any = ..., - wraps: Any | None = ..., - name: Any | None = ..., - spec_set: Any | None = ..., - parent: Any | None = ..., - _spec_state: Any | None = ..., - _new_name: Any = ..., - _new_parent: Any | None = ..., + wraps: Any | None = None, + name: Any | None = None, + spec_set: Any | None = None, + parent: Any | None = None, + _spec_state: Any | None = None, + _new_name: Any = "", + _new_parent: Any | None = None, **kwargs: Any, ) -> None: ... if sys.version_info >= (3, 8): @@ -211,7 +213,7 @@ class _patch(Generic[_T]): new_callable: Any | None, kwargs: Mapping[str, Any], *, - unsafe: bool = ..., + unsafe: bool = False, ) -> None: ... else: def __init__( @@ -257,8 +259,12 @@ class _patch_dict: in_dict: Any values: Any clear: Any - def __init__(self, in_dict: Any, values: Any = ..., clear: Any = ..., **kwargs: Any) -> None: ... + def __init__(self, in_dict: Any, values: Any = ..., clear: Any = False, **kwargs: Any) -> None: ... def __call__(self, f: Any) -> Any: ... + if sys.version_info >= (3, 10): + def decorate_callable(self, f: _F) -> _F: ... + def decorate_async_callable(self, f: _AF) -> _AF: ... + def decorate_class(self, klass: Any) -> Any: ... def __enter__(self) -> Any: ... def __exit__(self, *args: object) -> Any: ... @@ -301,8 +307,8 @@ class _patcher: **kwargs: Any, ) -> _patch[_Mock]: ... @overload + @staticmethod def object( # type: ignore[misc] - self, target: Any, attribute: str, new: _T, @@ -314,8 +320,8 @@ class _patcher: **kwargs: Any, ) -> _patch[_T]: ... @overload + @staticmethod def object( - self, target: Any, attribute: str, *, @@ -326,8 +332,8 @@ class _patcher: new_callable: Any | None = ..., **kwargs: Any, ) -> _patch[_Mock]: ... + @staticmethod def multiple( - self, target: Any, spec: Any | None = ..., create: bool = ..., @@ -336,18 +342,16 @@ class _patcher: new_callable: Any | None = ..., **kwargs: Any, ) -> _patch[Any]: ... - def stopall(self) -> None: ... + @staticmethod + def stopall() -> None: ... patch: _patcher class MagicMixin: def __init__(self, *args: Any, **kw: Any) -> None: ... -class NonCallableMagicMock(MagicMixin, NonCallableMock): - def mock_add_spec(self, spec: Any, spec_set: bool = ...) -> None: ... - -class MagicMock(MagicMixin, Mock): - def mock_add_spec(self, spec: Any, spec_set: bool = ...) -> None: ... +class NonCallableMagicMock(MagicMixin, NonCallableMock): ... +class MagicMock(MagicMixin, Mock): ... if sys.version_info >= (3, 8): class AsyncMockMixin(Base): @@ -358,7 +362,7 @@ if sys.version_info >= (3, 8): def assert_awaited_with(self, *args: Any, **kwargs: Any) -> None: ... def assert_awaited_once_with(self, *args: Any, **kwargs: Any) -> None: ... def assert_any_await(self, *args: Any, **kwargs: Any) -> None: ... - def assert_has_awaits(self, calls: Iterable[_Call], any_order: bool = ...) -> None: ... + def assert_has_awaits(self, calls: Iterable[_Call], any_order: bool = False) -> None: ... def assert_not_awaited(self) -> None: ... def reset_mock(self, *args: Any, **kwargs: Any) -> None: ... await_count: int @@ -378,7 +382,7 @@ class MagicProxy: def __call__(self, *args: Any, **kwargs: Any) -> Any: ... def create_mock(self) -> Any: ... - def __get__(self, obj: Any, _type: Any | None = ...) -> Any: ... + def __get__(self, obj: Any, _type: Any | None = None) -> Any: ... class _ANY: def __eq__(self, other: object) -> Literal[True]: ... @@ -389,18 +393,23 @@ ANY: Any if sys.version_info >= (3, 10): def create_autospec( spec: Any, - spec_set: Any = ..., - instance: Any = ..., - _parent: Any | None = ..., - _name: Any | None = ..., + spec_set: Any = False, + instance: Any = False, + _parent: Any | None = None, + _name: Any | None = None, *, - unsafe: bool = ..., + unsafe: bool = False, **kwargs: Any, ) -> Any: ... else: def create_autospec( - spec: Any, spec_set: Any = ..., instance: Any = ..., _parent: Any | None = ..., _name: Any | None = ..., **kwargs: Any + spec: Any, + spec_set: Any = False, + instance: Any = False, + _parent: Any | None = None, + _name: Any | None = None, + **kwargs: Any, ) -> Any: ... class _SpecState: @@ -413,21 +422,21 @@ class _SpecState: def __init__( self, spec: Any, - spec_set: Any = ..., - parent: Any | None = ..., - name: Any | None = ..., - ids: Any | None = ..., - instance: Any = ..., + spec_set: Any = False, + parent: Any | None = None, + name: Any | None = None, + ids: Any | None = None, + instance: Any = False, ) -> None: ... -def mock_open(mock: Any | None = ..., read_data: Any = ...) -> Any: ... +def mock_open(mock: Any | None = None, read_data: Any = "") -> Any: ... class PropertyMock(Mock): if sys.version_info >= (3, 8): - def __get__(self: Self, obj: _T, obj_type: type[_T] | None = ...) -> Self: ... + def __get__(self, obj: _T, obj_type: type[_T] | None = None) -> Self: ... else: - def __get__(self: Self, obj: _T, obj_type: type[_T] | None) -> Self: ... + def __get__(self, obj: _T, obj_type: type[_T] | None) -> Self: ... - def __set__(self, obj: Any, value: Any) -> None: ... + def __set__(self, obj: Any, val: Any) -> None: ... def seal(mock: Any) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/unittest/result.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/unittest/result.pyi index 5dfec13cb..8d78bc0f7 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/unittest/result.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/unittest/result.pyi @@ -22,7 +22,7 @@ class TestResult: buffer: bool failfast: bool tb_locals: bool - def __init__(self, stream: TextIO | None = ..., descriptions: bool | None = ..., verbosity: int | None = ...) -> None: ... + def __init__(self, stream: TextIO | None = None, descriptions: bool | None = None, verbosity: int | None = None) -> None: ... def printErrors(self) -> None: ... def wasSuccessful(self) -> bool: ... def stop(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/unittest/runner.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/unittest/runner.pyi index 1f1b89bc1..c0ddcdb49 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/unittest/runner.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/unittest/runner.pyi @@ -16,22 +16,21 @@ class TextTestResult(unittest.result.TestResult): stream: TextIO # undocumented def __init__(self, stream: TextIO, descriptions: bool, verbosity: int) -> None: ... def getDescription(self, test: unittest.case.TestCase) -> str: ... - def printErrors(self) -> None: ... def printErrorList(self, flavour: str, errors: Iterable[tuple[unittest.case.TestCase, str]]) -> None: ... class TextTestRunner: resultclass: _ResultClassType def __init__( self, - stream: TextIO | None = ..., - descriptions: bool = ..., - verbosity: int = ..., - failfast: bool = ..., - buffer: bool = ..., - resultclass: _ResultClassType | None = ..., - warnings: type[Warning] | None = ..., + stream: TextIO | None = None, + descriptions: bool = True, + verbosity: int = 1, + failfast: bool = False, + buffer: bool = False, + resultclass: _ResultClassType | None = None, + warnings: type[Warning] | None = None, *, - tb_locals: bool = ..., + tb_locals: bool = False, ) -> None: ... def _makeResult(self) -> unittest.result.TestResult: ... def run(self, test: unittest.suite.TestSuite | unittest.case.TestCase) -> unittest.result.TestResult: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/unittest/signals.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/unittest/signals.pyi index 89e108d92..a60133ada 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/unittest/signals.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/unittest/signals.pyi @@ -10,6 +10,6 @@ def installHandler() -> None: ... def registerResult(result: unittest.result.TestResult) -> None: ... def removeResult(result: unittest.result.TestResult) -> bool: ... @overload -def removeHandler(method: None = ...) -> None: ... +def removeHandler(method: None = None) -> None: ... @overload def removeHandler(method: Callable[_P, _T]) -> Callable[_P, _T]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/unittest/suite.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/unittest/suite.pyi index 26bef658f..f6b8ef003 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/unittest/suite.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/unittest/suite.pyi @@ -19,4 +19,4 @@ class BaseTestSuite(Iterable[_TestType]): def __eq__(self, other: object) -> bool: ... class TestSuite(BaseTestSuite): - def run(self, result: unittest.result.TestResult, debug: bool = ...) -> unittest.result.TestResult: ... + def run(self, result: unittest.result.TestResult, debug: bool = False) -> unittest.result.TestResult: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/unittest/util.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/unittest/util.pyi index f62c72876..845accfeb 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/unittest/util.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/unittest/util.pyi @@ -14,7 +14,7 @@ _MIN_DIFF_LEN: int def _shorten(s: str, prefixlen: int, suffixlen: int) -> str: ... def _common_shorten_repr(*args: str) -> tuple[str, ...]: ... -def safe_repr(obj: object, short: bool = ...) -> str: ... +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: Sequence[_T], actual: Sequence[_T]) -> tuple[list[_T], list[_T]]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/urllib/error.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/urllib/error.pyi index 7a4de10d7..89cec9bf2 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/urllib/error.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/urllib/error.pyi @@ -4,13 +4,15 @@ from urllib.response import addinfourl __all__ = ["URLError", "HTTPError", "ContentTooShortError"] -class URLError(IOError): +class URLError(OSError): reason: str | BaseException - def __init__(self, reason: str | BaseException, filename: str | None = ...) -> None: ... + def __init__(self, reason: str | BaseException, filename: str | None = None) -> None: ... class HTTPError(URLError, addinfourl): @property - def headers(self) -> Message: ... # type: ignore[override] + def headers(self) -> Message: ... + @headers.setter + def headers(self, headers: Message) -> None: ... @property def reason(self) -> str: ... # type: ignore[override] code: int diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/urllib/parse.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/urllib/parse.pyi index 7e1ec903a..8e179ca76 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/urllib/parse.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/urllib/parse.pyi @@ -1,7 +1,7 @@ import sys -from collections.abc import Callable, Mapping, Sequence -from typing import Any, AnyStr, Generic, NamedTuple, overload -from typing_extensions import TypeAlias +from collections.abc import Callable, Iterable, Mapping, Sequence +from typing import Any, AnyStr, Generic, NamedTuple, TypeVar, overload +from typing_extensions import Literal, TypeAlias if sys.version_info >= (3, 9): from types import GenericAlias @@ -30,8 +30,6 @@ __all__ = [ "SplitResultBytes", ] -_Str: TypeAlias = bytes | str - uses_relative: list[str] uses_netloc: list[str] uses_params: list[str] @@ -42,14 +40,11 @@ scheme_chars: str if sys.version_info < (3, 11): MAX_CACHE_SIZE: int -class _ResultMixinBase(Generic[AnyStr]): - def geturl(self) -> AnyStr: ... - -class _ResultMixinStr(_ResultMixinBase[str]): - def encode(self, encoding: str = ..., errors: str = ...) -> _ResultMixinBytes: ... +class _ResultMixinStr: + def encode(self, encoding: str = "ascii", errors: str = "strict") -> _ResultMixinBytes: ... -class _ResultMixinBytes(_ResultMixinBase[bytes]): - def decode(self, encoding: str = ..., errors: str = ...) -> _ResultMixinStr: ... +class _ResultMixinBytes: + def decode(self, encoding: str = "ascii", errors: str = "strict") -> _ResultMixinStr: ... class _NetlocResultMixinBase(Generic[AnyStr]): @property @@ -66,107 +61,141 @@ class _NetlocResultMixinBase(Generic[AnyStr]): class _NetlocResultMixinStr(_NetlocResultMixinBase[str], _ResultMixinStr): ... class _NetlocResultMixinBytes(_NetlocResultMixinBase[bytes], _ResultMixinBytes): ... -# Ideally this would be a generic fixed-length tuple, -# but mypy doesn't support that yet: https://github.com/python/mypy/issues/685#issuecomment-992014179 -class _DefragResultBase(tuple[AnyStr, ...], Generic[AnyStr]): - if sys.version_info >= (3, 10): - __match_args__ = ("url", "fragment") - @property - def url(self) -> AnyStr: ... - @property - def fragment(self) -> AnyStr: ... - -class _SplitResultBase(NamedTuple): - scheme: str - netloc: str - path: str - query: str - fragment: str - -class _SplitResultBytesBase(NamedTuple): - scheme: bytes - netloc: bytes - path: bytes - query: bytes - fragment: bytes - -class _ParseResultBase(NamedTuple): - scheme: str - netloc: str - path: str - params: str - query: str - fragment: str - -class _ParseResultBytesBase(NamedTuple): - scheme: bytes - netloc: bytes - path: bytes - params: bytes - query: bytes - fragment: bytes +class _DefragResultBase(NamedTuple, Generic[AnyStr]): + url: AnyStr + fragment: AnyStr + +class _SplitResultBase(NamedTuple, Generic[AnyStr]): + scheme: AnyStr + netloc: AnyStr + path: AnyStr + query: AnyStr + fragment: AnyStr + +class _ParseResultBase(NamedTuple, Generic[AnyStr]): + scheme: AnyStr + netloc: AnyStr + path: AnyStr + params: AnyStr + query: AnyStr + fragment: AnyStr # Structured result objects for string data -class DefragResult(_DefragResultBase[str], _ResultMixinStr): ... -class SplitResult(_SplitResultBase, _NetlocResultMixinStr): ... -class ParseResult(_ParseResultBase, _NetlocResultMixinStr): ... +class DefragResult(_DefragResultBase[str], _ResultMixinStr): + def geturl(self) -> str: ... + +class SplitResult(_SplitResultBase[str], _NetlocResultMixinStr): + def geturl(self) -> str: ... + +class ParseResult(_ParseResultBase[str], _NetlocResultMixinStr): + def geturl(self) -> str: ... # Structured result objects for bytes data -class DefragResultBytes(_DefragResultBase[bytes], _ResultMixinBytes): ... -class SplitResultBytes(_SplitResultBytesBase, _NetlocResultMixinBytes): ... -class ParseResultBytes(_ParseResultBytesBase, _NetlocResultMixinBytes): ... +class DefragResultBytes(_DefragResultBase[bytes], _ResultMixinBytes): + def geturl(self) -> bytes: ... + +class SplitResultBytes(_SplitResultBase[bytes], _NetlocResultMixinBytes): + def geturl(self) -> bytes: ... + +class ParseResultBytes(_ParseResultBase[bytes], _NetlocResultMixinBytes): + def geturl(self) -> bytes: ... def parse_qs( qs: AnyStr | None, - keep_blank_values: bool = ..., - strict_parsing: bool = ..., - encoding: str = ..., - errors: str = ..., - max_num_fields: int | None = ..., - separator: str = ..., + keep_blank_values: bool = False, + strict_parsing: bool = False, + encoding: str = "utf-8", + errors: str = "replace", + max_num_fields: int | None = None, + separator: str = "&", ) -> dict[AnyStr, list[AnyStr]]: ... def parse_qsl( qs: AnyStr | None, - keep_blank_values: bool = ..., - strict_parsing: bool = ..., - encoding: str = ..., - errors: str = ..., - max_num_fields: int | None = ..., - separator: str = ..., + keep_blank_values: bool = False, + strict_parsing: bool = False, + encoding: str = "utf-8", + errors: str = "replace", + max_num_fields: int | None = None, + separator: str = "&", ) -> list[tuple[AnyStr, AnyStr]]: ... @overload -def quote(string: str, safe: _Str = ..., encoding: str | None = ..., errors: str | None = ...) -> str: ... +def quote(string: str, safe: str | Iterable[int] = "/", encoding: str | None = None, errors: str | None = None) -> str: ... @overload -def quote(string: bytes, safe: _Str = ...) -> str: ... -def quote_from_bytes(bs: bytes, safe: _Str = ...) -> str: ... +def quote(string: bytes | bytearray, safe: str | Iterable[int] = "/") -> str: ... +def quote_from_bytes(bs: bytes | bytearray, safe: str | Iterable[int] = "/") -> str: ... @overload -def quote_plus(string: str, safe: _Str = ..., encoding: str | None = ..., errors: str | None = ...) -> str: ... +def quote_plus(string: str, safe: str | Iterable[int] = "", encoding: str | None = None, errors: str | None = None) -> str: ... @overload -def quote_plus(string: bytes, safe: _Str = ...) -> str: ... -def unquote(string: str, encoding: str = ..., errors: str = ...) -> str: ... -def unquote_to_bytes(string: _Str) -> bytes: ... -def unquote_plus(string: str, encoding: str = ..., errors: str = ...) -> str: ... +def quote_plus(string: bytes | bytearray, safe: str | Iterable[int] = "") -> str: ... + +if sys.version_info >= (3, 9): + def unquote(string: str | bytes, encoding: str = "utf-8", errors: str = "replace") -> str: ... + +else: + def unquote(string: str, encoding: str = "utf-8", errors: str = "replace") -> str: ... + +def unquote_to_bytes(string: str | bytes | bytearray) -> bytes: ... +def unquote_plus(string: str, encoding: str = "utf-8", errors: str = "replace") -> str: ... @overload def urldefrag(url: str) -> DefragResult: ... @overload -def urldefrag(url: bytes | None) -> DefragResultBytes: ... +def urldefrag(url: bytes | bytearray | None) -> DefragResultBytes: ... + +_Q = TypeVar("_Q", bound=str | Iterable[int]) +_QueryType: TypeAlias = ( + Mapping[Any, Any] | Mapping[Any, Sequence[Any]] | Sequence[tuple[Any, Any]] | Sequence[tuple[Any, Sequence[Any]]] +) + +@overload def urlencode( - query: Mapping[Any, Any] | Mapping[Any, Sequence[Any]] | Sequence[tuple[Any, Any]] | Sequence[tuple[Any, Sequence[Any]]], - doseq: bool = ..., - safe: _Str = ..., - encoding: str = ..., - errors: str = ..., - quote_via: Callable[[AnyStr, _Str, str, str], str] = ..., + query: _QueryType, + doseq: bool = False, + safe: str = "", + encoding: str | None = None, + errors: str | None = None, + quote_via: Callable[[AnyStr, str, str, str], str] = ..., ) -> str: ... -def urljoin(base: AnyStr, url: AnyStr | None, allow_fragments: bool = ...) -> AnyStr: ... @overload -def urlparse(url: str, scheme: str | None = ..., allow_fragments: bool = ...) -> ParseResult: ... +def urlencode( + query: _QueryType, + doseq: bool, + safe: _Q, + encoding: str | None = None, + errors: str | None = None, + quote_via: Callable[[AnyStr, _Q, str, str], str] = ..., +) -> str: ... @overload -def urlparse(url: bytes | None, scheme: bytes | None = ..., allow_fragments: bool = ...) -> ParseResultBytes: ... +def urlencode( + query: _QueryType, + doseq: bool = False, + *, + safe: _Q, + encoding: str | None = None, + errors: str | None = None, + quote_via: Callable[[AnyStr, _Q, str, str], str] = ..., +) -> str: ... +def urljoin(base: AnyStr, url: AnyStr | None, allow_fragments: bool = True) -> AnyStr: ... +@overload +def urlparse(url: str, scheme: str = "", allow_fragments: bool = True) -> ParseResult: ... @overload -def urlsplit(url: str, scheme: str | None = ..., allow_fragments: bool = ...) -> SplitResult: ... +def urlparse( + url: bytes | bytearray | None, scheme: bytes | bytearray | None | Literal[""] = "", allow_fragments: bool = True +) -> ParseResultBytes: ... @overload -def urlsplit(url: bytes | None, scheme: bytes | None = ..., allow_fragments: bool = ...) -> SplitResultBytes: ... +def urlsplit(url: str, scheme: str = "", allow_fragments: bool = True) -> SplitResult: ... + +if sys.version_info >= (3, 11): + @overload + def urlsplit( + url: bytes | None, scheme: bytes | None | Literal[""] = "", allow_fragments: bool = True + ) -> SplitResultBytes: ... + +else: + @overload + def urlsplit( + url: bytes | bytearray | None, scheme: bytes | bytearray | None | Literal[""] = "", allow_fragments: bool = True + ) -> SplitResultBytes: ... + @overload def urlunparse( components: tuple[AnyStr | None, AnyStr | None, AnyStr | None, AnyStr | None, AnyStr | None, AnyStr | None] diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/urllib/request.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/urllib/request.pyi index 88f4f5250..09ce27961 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/urllib/request.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/urllib/request.pyi @@ -1,6 +1,6 @@ import ssl import sys -from _typeshed import StrOrBytesPath, SupportsRead +from _typeshed import ReadableBuffer, StrOrBytesPath, SupportsRead from collections.abc import Callable, Iterable, Mapping, MutableMapping, Sequence from email.message import Message from http.client import HTTPConnection, HTTPMessage, HTTPResponse @@ -50,17 +50,17 @@ __all__ = [ _T = TypeVar("_T") _UrlopenRet: TypeAlias = Any -_DataType: TypeAlias = bytes | SupportsRead[bytes] | Iterable[bytes] | None +_DataType: TypeAlias = ReadableBuffer | SupportsRead[bytes] | Iterable[bytes] | None def urlopen( url: str | Request, - data: _DataType | None = ..., + data: _DataType | None = None, timeout: float | None = ..., *, - cafile: str | None = ..., - capath: str | None = ..., - cadefault: bool = ..., - context: ssl.SSLContext | None = ..., + cafile: str | None = None, + capath: str | None = None, + cadefault: bool = False, + context: ssl.SSLContext | None = None, ) -> _UrlopenRet: ... def install_opener(opener: OpenerDirector) -> None: ... def build_opener(*handlers: BaseHandler | Callable[[], BaseHandler]) -> OpenerDirector: ... @@ -79,7 +79,7 @@ if sys.platform == "win32" or sys.platform == "darwin": def proxy_bypass(host: str) -> Any: ... # undocumented else: - def proxy_bypass(host: str, proxies: Mapping[str, str] | None = ...) -> Any: ... # undocumented + def proxy_bypass(host: str, proxies: Mapping[str, str] | None = None) -> Any: ... # undocumented class Request: @property @@ -101,11 +101,11 @@ class Request: def __init__( self, url: str, - data: _DataType = ..., + data: _DataType = None, headers: MutableMapping[str, str] = ..., - origin_req_host: str | None = ..., - unverifiable: bool = ..., - method: str | None = ..., + origin_req_host: str | None = None, + unverifiable: bool = False, + method: str | None = None, ) -> None: ... def get_method(self) -> str: ... def add_header(self, key: str, val: str) -> None: ... @@ -124,7 +124,7 @@ class Request: class OpenerDirector: addheaders: list[tuple[str, str]] def add_handler(self, handler: BaseHandler) -> None: ... - def open(self, fullurl: str | Request, data: _DataType = ..., timeout: float | None = ...) -> _UrlopenRet: ... + def open(self, fullurl: str | Request, data: _DataType = None, timeout: float | None = ...) -> _UrlopenRet: ... def error(self, proto: str, *args: Any) -> _UrlopenRet: ... def close(self) -> None: ... @@ -158,14 +158,14 @@ class HTTPRedirectHandler(BaseHandler): class HTTPCookieProcessor(BaseHandler): cookiejar: CookieJar - def __init__(self, cookiejar: CookieJar | None = ...) -> None: ... + def __init__(self, cookiejar: CookieJar | None = None) -> None: ... def http_request(self, request: Request) -> Request: ... # undocumented def http_response(self, request: Request, response: HTTPResponse) -> HTTPResponse: ... # undocumented def https_request(self, request: Request) -> Request: ... # undocumented def https_response(self, request: Request, response: HTTPResponse) -> HTTPResponse: ... # undocumented class ProxyHandler(BaseHandler): - def __init__(self, proxies: dict[str, str] | None = ...) -> None: ... + def __init__(self, proxies: dict[str, str] | None = None) -> None: ... def proxy_open(self, req: Request, proxy: str, type: str) -> _UrlopenRet | None: ... # undocumented # TODO add a method for every (common) proxy protocol @@ -173,7 +173,7 @@ class HTTPPasswordMgr: def add_password(self, realm: str, uri: str | Sequence[str], user: str, passwd: str) -> None: ... def find_user_password(self, realm: str, authuri: str) -> tuple[str | None, str | None]: ... def is_suburi(self, base: str, test: str) -> bool: ... # undocumented - def reduce_uri(self, uri: str, default_port: bool = ...) -> str: ... # undocumented + def reduce_uri(self, uri: str, default_port: bool = True) -> str: ... # undocumented class HTTPPasswordMgrWithDefaultRealm(HTTPPasswordMgr): def add_password(self, realm: str | None, uri: str | Sequence[str], user: str, passwd: str) -> None: ... @@ -181,16 +181,16 @@ class HTTPPasswordMgrWithDefaultRealm(HTTPPasswordMgr): class HTTPPasswordMgrWithPriorAuth(HTTPPasswordMgrWithDefaultRealm): def add_password( - self, realm: str | None, uri: str | Sequence[str], user: str, passwd: str, is_authenticated: bool = ... + self, realm: str | None, uri: str | Sequence[str], user: str, passwd: str, is_authenticated: bool = False ) -> None: ... - def update_authenticated(self, uri: str | Sequence[str], is_authenticated: bool = ...) -> None: ... + def update_authenticated(self, uri: str | Sequence[str], is_authenticated: bool = False) -> None: ... def is_authenticated(self, authuri: str) -> bool: ... class AbstractBasicAuthHandler: rx: ClassVar[Pattern[str]] # undocumented passwd: HTTPPasswordMgr add_password: Callable[[str, str | Sequence[str], str, str], None] - def __init__(self, password_mgr: HTTPPasswordMgr | None = ...) -> None: ... + def __init__(self, password_mgr: HTTPPasswordMgr | None = None) -> None: ... def http_error_auth_reqed(self, authreq: str, host: str, req: Request, headers: HTTPMessage) -> None: ... def http_request(self, req: Request) -> Request: ... # undocumented def http_response(self, req: Request, response: HTTPResponse) -> HTTPResponse: ... # undocumented @@ -207,14 +207,14 @@ class ProxyBasicAuthHandler(AbstractBasicAuthHandler, BaseHandler): def http_error_407(self, req: Request, fp: IO[bytes], code: int, msg: str, headers: HTTPMessage) -> _UrlopenRet | None: ... class AbstractDigestAuthHandler: - def __init__(self, passwd: HTTPPasswordMgr | None = ...) -> None: ... + def __init__(self, passwd: HTTPPasswordMgr | None = None) -> None: ... def reset_retry_count(self) -> None: ... def http_error_auth_reqed(self, auth_header: str, host: str, req: Request, headers: HTTPMessage) -> None: ... def retry_http_digest_auth(self, req: Request, auth: str) -> _UrlopenRet | None: ... def get_cnonce(self, nonce: str) -> str: ... def get_authorization(self, req: Request, chal: Mapping[str, str]) -> str: ... def get_algorithm_impls(self, algorithm: str) -> tuple[Callable[[str], str], Callable[[str, str], str]]: ... - def get_entity_digest(self, data: bytes | None, chal: Mapping[str, str]) -> str | None: ... + def get_entity_digest(self, data: ReadableBuffer | None, chal: Mapping[str, str]) -> str | None: ... class HTTPDigestAuthHandler(BaseHandler, AbstractDigestAuthHandler): auth_header: ClassVar[str] # undocumented @@ -235,7 +235,7 @@ class _HTTPConnectionProtocol(Protocol): ) -> HTTPConnection: ... class AbstractHTTPHandler(BaseHandler): # undocumented - def __init__(self, debuglevel: int = ...) -> None: ... + def __init__(self, debuglevel: int = 0) -> None: ... def set_http_debuglevel(self, level: int) -> None: ... def do_request_(self, request: Request) -> Request: ... def do_open(self, http_class: _HTTPConnectionProtocol, req: Request, **http_conn_args: Any) -> HTTPResponse: ... @@ -246,7 +246,7 @@ class HTTPHandler(AbstractHTTPHandler): class HTTPSHandler(AbstractHTTPHandler): def __init__( - self, debuglevel: int = ..., context: ssl.SSLContext | None = ..., check_hostname: bool | None = ... + self, debuglevel: int = 0, context: ssl.SSLContext | None = None, check_hostname: bool | None = None ) -> None: ... def https_open(self, req: Request) -> HTTPResponse: ... def https_request(self, request: Request) -> Request: ... # undocumented @@ -262,7 +262,7 @@ class DataHandler(BaseHandler): class ftpwrapper: # undocumented def __init__( - self, user: str, passwd: str, host: str, port: int, dirs: str, timeout: float | None = ..., persistent: bool = ... + self, user: str, passwd: str, host: str, port: int, dirs: str, timeout: float | None = None, persistent: bool = True ) -> None: ... def close(self) -> None: ... def endtransfer(self) -> None: ... @@ -282,9 +282,6 @@ class CacheFTPHandler(FTPHandler): def setMaxConns(self, m: int) -> None: ... def check_cache(self) -> None: ... # undocumented def clear_cache(self) -> None: ... # undocumented - def connect_ftp( - self, user: str, passwd: str, host: str, port: int, dirs: str, timeout: float - ) -> ftpwrapper: ... # undocumented class UnknownHandler(BaseHandler): def unknown_open(self, req: Request) -> NoReturn: ... @@ -295,59 +292,59 @@ class HTTPErrorProcessor(BaseHandler): def urlretrieve( url: str, - filename: StrOrBytesPath | None = ..., - reporthook: Callable[[int, int, int], object] | None = ..., - data: _DataType = ..., + filename: StrOrBytesPath | None = None, + reporthook: Callable[[int, int, int], object] | None = None, + data: _DataType = None, ) -> tuple[str, HTTPMessage]: ... def urlcleanup() -> None: ... class URLopener: version: ClassVar[str] - def __init__(self, proxies: dict[str, str] | None = ..., **x509: str) -> None: ... - def open(self, fullurl: str, data: bytes | None = ...) -> _UrlopenRet: ... - def open_unknown(self, fullurl: str, data: bytes | None = ...) -> _UrlopenRet: ... + def __init__(self, proxies: dict[str, str] | None = None, **x509: str) -> None: ... + def open(self, fullurl: str, data: ReadableBuffer | None = None) -> _UrlopenRet: ... + def open_unknown(self, fullurl: str, data: ReadableBuffer | None = None) -> _UrlopenRet: ... def retrieve( self, url: str, - filename: str | None = ..., - reporthook: Callable[[int, int, int], object] | None = ..., - data: bytes | None = ..., + filename: str | None = None, + reporthook: Callable[[int, int, int], object] | None = None, + data: ReadableBuffer | None = None, ) -> tuple[str, Message | None]: ... def addheader(self, *args: tuple[str, str]) -> None: ... # undocumented def cleanup(self) -> None: ... # undocumented def close(self) -> None: ... # undocumented def http_error( - self, url: str, fp: IO[bytes], errcode: int, errmsg: str, headers: HTTPMessage, data: bytes | None = ... + self, url: str, fp: IO[bytes], errcode: int, errmsg: str, headers: HTTPMessage, data: bytes | None = None ) -> _UrlopenRet: ... # undocumented def http_error_default( self, url: str, fp: IO[bytes], errcode: int, errmsg: str, headers: HTTPMessage ) -> _UrlopenRet: ... # undocumented - def open_data(self, url: str, data: bytes | None = ...) -> addinfourl: ... # undocumented + def open_data(self, url: str, data: ReadableBuffer | None = None) -> addinfourl: ... # undocumented def open_file(self, url: str) -> addinfourl: ... # undocumented def open_ftp(self, url: str) -> addinfourl: ... # undocumented - def open_http(self, url: str, data: bytes | None = ...) -> _UrlopenRet: ... # undocumented - def open_https(self, url: str, data: bytes | None = ...) -> _UrlopenRet: ... # undocumented + def open_http(self, url: str, data: ReadableBuffer | None = None) -> _UrlopenRet: ... # undocumented + def open_https(self, url: str, data: ReadableBuffer | None = None) -> _UrlopenRet: ... # undocumented def open_local_file(self, url: str) -> addinfourl: ... # undocumented - def open_unknown_proxy(self, proxy: str, fullurl: str, data: bytes | None = ...) -> None: ... # undocumented + def open_unknown_proxy(self, proxy: str, fullurl: str, data: ReadableBuffer | None = None) -> None: ... # undocumented class FancyURLopener(URLopener): def prompt_user_passwd(self, host: str, realm: str) -> tuple[str, str]: ... - def get_user_passwd(self, host: str, realm: str, clear_cache: int = ...) -> tuple[str, str]: ... # undocumented + def get_user_passwd(self, host: str, realm: str, clear_cache: int = 0) -> tuple[str, str]: ... # undocumented def http_error_301( - self, url: str, fp: IO[bytes], errcode: int, errmsg: str, headers: HTTPMessage, data: bytes | None = ... + self, url: str, fp: IO[bytes], errcode: int, errmsg: str, headers: HTTPMessage, data: ReadableBuffer | None = None ) -> _UrlopenRet | addinfourl | None: ... # undocumented def http_error_302( - self, url: str, fp: IO[bytes], errcode: int, errmsg: str, headers: HTTPMessage, data: bytes | None = ... + self, url: str, fp: IO[bytes], errcode: int, errmsg: str, headers: HTTPMessage, data: ReadableBuffer | None = None ) -> _UrlopenRet | addinfourl | None: ... # undocumented def http_error_303( - self, url: str, fp: IO[bytes], errcode: int, errmsg: str, headers: HTTPMessage, data: bytes | None = ... + self, url: str, fp: IO[bytes], errcode: int, errmsg: str, headers: HTTPMessage, data: ReadableBuffer | None = None ) -> _UrlopenRet | addinfourl | None: ... # undocumented def http_error_307( - self, url: str, fp: IO[bytes], errcode: int, errmsg: str, headers: HTTPMessage, data: bytes | None = ... + self, url: str, fp: IO[bytes], errcode: int, errmsg: str, headers: HTTPMessage, data: ReadableBuffer | None = None ) -> _UrlopenRet | addinfourl | None: ... # undocumented if sys.version_info >= (3, 11): def http_error_308( - self, url: str, fp: IO[bytes], errcode: int, errmsg: str, headers: HTTPMessage, data: bytes | None = ... + self, url: str, fp: IO[bytes], errcode: int, errmsg: str, headers: HTTPMessage, data: ReadableBuffer | None = None ) -> _UrlopenRet | addinfourl | None: ... # undocumented def http_error_401( @@ -357,8 +354,8 @@ class FancyURLopener(URLopener): errcode: int, errmsg: str, headers: HTTPMessage, - data: bytes | None = ..., - retry: bool = ..., + data: ReadableBuffer | None = None, + retry: bool = False, ) -> _UrlopenRet | None: ... # undocumented def http_error_407( self, @@ -367,20 +364,24 @@ class FancyURLopener(URLopener): errcode: int, errmsg: str, headers: HTTPMessage, - data: bytes | None = ..., - retry: bool = ..., + data: ReadableBuffer | None = None, + retry: bool = False, ) -> _UrlopenRet | None: ... # undocumented def http_error_default( self, url: str, fp: IO[bytes], errcode: int, errmsg: str, headers: HTTPMessage ) -> addinfourl: ... # undocumented def redirect_internal( - self, url: str, fp: IO[bytes], errcode: int, errmsg: str, headers: HTTPMessage, data: bytes | None + self, url: str, fp: IO[bytes], errcode: int, errmsg: str, headers: HTTPMessage, data: ReadableBuffer | None + ) -> _UrlopenRet | None: ... # undocumented + def retry_http_basic_auth( + self, url: str, realm: str, data: ReadableBuffer | None = None + ) -> _UrlopenRet | None: ... # undocumented + def retry_https_basic_auth( + self, url: str, realm: str, data: ReadableBuffer | None = None ) -> _UrlopenRet | None: ... # undocumented - def retry_http_basic_auth(self, url: str, realm: str, data: bytes | None = ...) -> _UrlopenRet | None: ... # undocumented - def retry_https_basic_auth(self, url: str, realm: str, data: bytes | None = ...) -> _UrlopenRet | None: ... # undocumented def retry_proxy_http_basic_auth( - self, url: str, realm: str, data: bytes | None = ... + self, url: str, realm: str, data: ReadableBuffer | None = None ) -> _UrlopenRet | None: ... # undocumented def retry_proxy_https_basic_auth( - self, url: str, realm: str, data: bytes | None = ... + self, url: str, realm: str, data: ReadableBuffer | None = None ) -> _UrlopenRet | None: ... # undocumented diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/urllib/response.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/urllib/response.pyi index 8c9a600f3..61ba68707 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/urllib/response.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/urllib/response.pyi @@ -1,20 +1,21 @@ import sys -from _typeshed import Self +from _typeshed import ReadableBuffer from collections.abc import Callable, Iterable from email.message import Message from types import TracebackType from typing import IO, Any, BinaryIO +from typing_extensions import Self __all__ = ["addbase", "addclosehook", "addinfo", "addinfourl"] class addbase(BinaryIO): fp: IO[bytes] def __init__(self, fp: IO[bytes]) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, type: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None ) -> None: ... - def __iter__(self: Self) -> Self: ... + def __iter__(self) -> Self: ... def __next__(self) -> bytes: ... def close(self) -> None: ... # These methods don't actually exist, but the class inherits at runtime from @@ -33,8 +34,8 @@ class addbase(BinaryIO): def tell(self) -> int: ... def truncate(self, size: int | None = ...) -> int: ... def writable(self) -> bool: ... - def write(self, s: bytes) -> int: ... - def writelines(self, lines: Iterable[bytes]) -> None: ... + def write(self, s: ReadableBuffer) -> int: ... + def writelines(self, lines: Iterable[ReadableBuffer]) -> None: ... class addclosehook(addbase): closehook: Callable[..., object] @@ -53,6 +54,6 @@ class addinfourl(addinfo): @property def status(self) -> int | None: ... - def __init__(self, fp: IO[bytes], headers: Message, url: str, code: int | None = ...) -> None: ... + def __init__(self, fp: IO[bytes], headers: Message, url: str, code: int | None = None) -> None: ... def geturl(self) -> str: ... def getcode(self) -> int | None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/urllib/robotparser.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/urllib/robotparser.pyi index 795cf83fc..d218c3dc6 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/urllib/robotparser.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/urllib/robotparser.pyi @@ -9,7 +9,7 @@ class RequestRate(NamedTuple): seconds: int class RobotFileParser: - def __init__(self, url: str = ...) -> None: ... + def __init__(self, url: str = "") -> None: ... def set_url(self, url: str) -> None: ... def read(self) -> None: ... def parse(self, lines: Iterable[str]) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/uu.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/uu.pyi index 95a7f3dfa..324053e04 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/uu.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/uu.pyi @@ -7,5 +7,7 @@ _File: TypeAlias = str | BinaryIO class Error(Exception): ... -def encode(in_file: _File, out_file: _File, name: str | None = ..., mode: int | None = ..., *, backtick: bool = ...) -> None: ... -def decode(in_file: _File, out_file: _File | None = ..., mode: int | None = ..., quiet: int = ...) -> None: ... +def encode( + in_file: _File, out_file: _File, name: str | None = None, mode: int | None = None, *, backtick: bool = False +) -> None: ... +def decode(in_file: _File, out_file: _File | None = None, mode: int | None = None, quiet: bool = False) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/uuid.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/uuid.pyi index 3d9b89a0b..249257783 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/uuid.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/uuid.pyi @@ -1,3 +1,5 @@ +import sys +from _typeshed import Unused from enum import Enum from typing_extensions import TypeAlias @@ -14,12 +16,12 @@ class SafeUUID(Enum): class UUID: def __init__( self, - hex: str | None = ..., - bytes: _Bytes | None = ..., - bytes_le: _Bytes | None = ..., - fields: _FieldsType | None = ..., - int: _Int | None = ..., - version: _Int | None = ..., + hex: str | None = None, + bytes: _Bytes | None = None, + bytes_le: _Bytes | None = None, + fields: _FieldsType | None = None, + int: _Int | None = None, + version: _Int | None = None, *, is_safe: SafeUUID = ..., ) -> None: ... @@ -64,8 +66,13 @@ class UUID: def __gt__(self, other: UUID) -> bool: ... def __ge__(self, other: UUID) -> bool: ... -def getnode() -> int: ... -def uuid1(node: _Int | None = ..., clock_seq: _Int | None = ...) -> UUID: ... +if sys.version_info >= (3, 9): + def getnode() -> int: ... + +else: + def getnode(*, getters: Unused = None) -> int: ... # undocumented + +def uuid1(node: _Int | None = None, clock_seq: _Int | None = None) -> UUID: ... def uuid3(namespace: UUID, name: str) -> UUID: ... def uuid4() -> UUID: ... def uuid5(namespace: UUID, name: str) -> UUID: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/venv/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/venv/__init__.pyi index 6afe328ac..f184649f1 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/venv/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/venv/__init__.pyi @@ -1,8 +1,11 @@ -from collections.abc import Sequence +import logging import sys from _typeshed import StrOrBytesPath +from collections.abc import Sequence from types import SimpleNamespace +logger: logging.Logger + if sys.version_info >= (3, 9): CORE_VENV_DEPS: tuple[str, ...] @@ -17,23 +20,23 @@ class EnvBuilder: if sys.version_info >= (3, 9): def __init__( self, - system_site_packages: bool = ..., - clear: bool = ..., - symlinks: bool = ..., - upgrade: bool = ..., - with_pip: bool = ..., - prompt: str | None = ..., - upgrade_deps: bool = ..., + system_site_packages: bool = False, + clear: bool = False, + symlinks: bool = False, + upgrade: bool = False, + with_pip: bool = False, + prompt: str | None = None, + upgrade_deps: bool = False, ) -> None: ... else: def __init__( self, - system_site_packages: bool = ..., - clear: bool = ..., - symlinks: bool = ..., - upgrade: bool = ..., - with_pip: bool = ..., - prompt: str | None = ..., + system_site_packages: bool = False, + clear: bool = False, + symlinks: bool = False, + upgrade: bool = False, + with_pip: bool = False, + prompt: str | None = None, ) -> None: ... def create(self, env_dir: StrOrBytesPath) -> None: ... @@ -41,7 +44,7 @@ class EnvBuilder: def ensure_directories(self, env_dir: StrOrBytesPath) -> SimpleNamespace: ... def create_configuration(self, context: SimpleNamespace) -> None: ... def symlink_or_copy( - self, src: StrOrBytesPath, dst: StrOrBytesPath, relative_symlinks_ok: bool = ... + self, src: StrOrBytesPath, dst: StrOrBytesPath, relative_symlinks_ok: bool = False ) -> None: ... # undocumented def setup_python(self, context: SimpleNamespace) -> None: ... def _setup_pip(self, context: SimpleNamespace) -> None: ... # undocumented @@ -55,22 +58,22 @@ class EnvBuilder: if sys.version_info >= (3, 9): def create( env_dir: StrOrBytesPath, - system_site_packages: bool = ..., - clear: bool = ..., - symlinks: bool = ..., - with_pip: bool = ..., - prompt: str | None = ..., - upgrade_deps: bool = ..., + system_site_packages: bool = False, + clear: bool = False, + symlinks: bool = False, + with_pip: bool = False, + prompt: str | None = None, + upgrade_deps: bool = False, ) -> None: ... else: def create( env_dir: StrOrBytesPath, - system_site_packages: bool = ..., - clear: bool = ..., - symlinks: bool = ..., - with_pip: bool = ..., - prompt: str | None = ..., + system_site_packages: bool = False, + clear: bool = False, + symlinks: bool = False, + with_pip: bool = False, + prompt: str | None = None, ) -> None: ... -def main(args: Sequence[str] | None = ...) -> None: ... +def main(args: Sequence[str] | None = None) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/warnings.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/warnings.pyi index 5cc6b9464..6222eb659 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/warnings.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/warnings.pyi @@ -22,18 +22,20 @@ _ActionKind: TypeAlias = Literal["default", "error", "ignore", "always", "module filters: Sequence[tuple[str, str | None, type[Warning], str | None, int]] # undocumented, do not mutate def showwarning( - message: Warning | str, category: type[Warning], filename: str, lineno: int, file: TextIO | None = ..., line: str | None = ... + message: Warning | str, + category: type[Warning], + filename: str, + lineno: int, + file: TextIO | None = None, + line: str | None = None, ) -> None: ... -def formatwarning(message: Warning | str, category: type[Warning], filename: str, lineno: int, line: str | None = ...) -> str: ... +def formatwarning( + message: Warning | str, category: type[Warning], filename: str, lineno: int, line: str | None = None +) -> str: ... def filterwarnings( - action: _ActionKind, - message: str = ..., - category: type[Warning] = ..., - module: str = ..., - lineno: int = ..., - append: bool = ..., + action: _ActionKind, message: str = "", category: type[Warning] = ..., module: str = "", lineno: int = 0, append: bool = False ) -> None: ... -def simplefilter(action: _ActionKind, category: type[Warning] = ..., lineno: int = ..., append: bool = ...) -> None: ... +def simplefilter(action: _ActionKind, category: type[Warning] = ..., lineno: int = 0, append: bool = False) -> None: ... def resetwarnings() -> None: ... class _OptionError(Exception): ... @@ -52,9 +54,9 @@ class WarningMessage: category: type[Warning], filename: str, lineno: int, - file: TextIO | None = ..., - line: str | None = ..., - source: Any | None = ..., + file: TextIO | None = None, + line: str | None = None, + source: Any | None = None, ) -> None: ... class catch_warnings(Generic[_W]): @@ -63,45 +65,45 @@ class catch_warnings(Generic[_W]): def __init__( self: catch_warnings[None], *, - record: Literal[False] = ..., - module: ModuleType | None = ..., - action: _ActionKind | None = ..., + record: Literal[False] = False, + module: ModuleType | None = None, + action: _ActionKind | None = None, category: type[Warning] = ..., - lineno: int = ..., - append: bool = ..., + lineno: int = 0, + append: bool = False, ) -> None: ... @overload def __init__( self: catch_warnings[list[WarningMessage]], *, record: Literal[True], - module: ModuleType | None = ..., - action: _ActionKind | None = ..., + module: ModuleType | None = None, + action: _ActionKind | None = None, category: type[Warning] = ..., - lineno: int = ..., - append: bool = ..., + lineno: int = 0, + append: bool = False, ) -> None: ... @overload def __init__( self: catch_warnings[list[WarningMessage] | None], *, record: bool, - module: ModuleType | None = ..., - action: _ActionKind | None = ..., + module: ModuleType | None = None, + action: _ActionKind | None = None, category: type[Warning] = ..., - lineno: int = ..., - append: bool = ..., + lineno: int = 0, + append: bool = False, ) -> None: ... else: @overload - def __init__(self: catch_warnings[None], *, record: Literal[False] = ..., module: ModuleType | None = ...) -> None: ... + def __init__(self: catch_warnings[None], *, record: Literal[False] = False, module: ModuleType | None = None) -> None: ... @overload def __init__( - self: catch_warnings[list[WarningMessage]], *, record: Literal[True], module: ModuleType | None = ... + self: catch_warnings[list[WarningMessage]], *, record: Literal[True], module: ModuleType | None = None ) -> None: ... @overload def __init__( - self: catch_warnings[list[WarningMessage] | None], *, record: bool, module: ModuleType | None = ... + self: catch_warnings[list[WarningMessage] | None], *, record: bool, module: ModuleType | None = None ) -> None: ... def __enter__(self) -> _W: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/wave.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/wave.pyi index 853a26a94..0d004d6b2 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/wave.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/wave.pyi @@ -1,7 +1,7 @@ import sys -from _typeshed import ReadableBuffer, Self +from _typeshed import ReadableBuffer, Unused from typing import IO, Any, BinaryIO, NamedTuple, NoReturn, overload -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal, Self, TypeAlias if sys.version_info >= (3, 9): __all__ = ["open", "Error", "Wave_read", "Wave_write"] @@ -24,8 +24,8 @@ class _wave_params(NamedTuple): class Wave_read: def __init__(self, f: _File) -> None: ... - def __enter__(self: Self) -> Self: ... - def __exit__(self, *args: object) -> None: ... + def __enter__(self) -> Self: ... + def __exit__(self, *args: Unused) -> None: ... def getfp(self) -> BinaryIO | None: ... def rewind(self) -> None: ... def close(self) -> None: ... @@ -44,8 +44,8 @@ class Wave_read: class Wave_write: def __init__(self, f: _File) -> None: ... - def __enter__(self: Self) -> Self: ... - def __exit__(self, *args: object) -> None: ... + def __enter__(self) -> Self: ... + def __exit__(self, *args: Unused) -> None: ... def setnchannels(self, nchannels: int) -> None: ... def getnchannels(self) -> int: ... def setsampwidth(self, sampwidth: int) -> None: ... @@ -72,7 +72,7 @@ def open(f: _File, mode: Literal["r", "rb"]) -> Wave_read: ... @overload def open(f: _File, mode: Literal["w", "wb"]) -> Wave_write: ... @overload -def open(f: _File, mode: str | None = ...) -> Any: ... +def open(f: _File, mode: str | None = None) -> Any: ... if sys.version_info < (3, 9): openfp = open diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/weakref.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/weakref.pyi index af960391e..1e0aac814 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/weakref.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/weakref.pyi @@ -1,10 +1,5 @@ import sys -from _typeshed import Self, SupportsKeysAndGetItem -from _weakrefset import WeakSet as WeakSet -from collections.abc import Callable, Iterable, Iterator, Mapping, MutableMapping -from typing import Any, Generic, TypeVar, overload -from typing_extensions import ParamSpec - +from _typeshed import SupportsKeysAndGetItem from _weakref import ( CallableProxyType as CallableProxyType, ProxyType as ProxyType, @@ -14,6 +9,10 @@ from _weakref import ( proxy as proxy, ref as ref, ) +from _weakrefset import WeakSet as WeakSet +from collections.abc import Callable, Iterable, Iterator, Mapping, MutableMapping +from typing import Any, Generic, TypeVar, overload +from typing_extensions import ParamSpec, Self __all__ = [ "ref", @@ -42,7 +41,7 @@ _P = ParamSpec("_P") ProxyTypes: tuple[type[Any], ...] class WeakMethod(ref[_CallableT], Generic[_CallableT]): - def __new__(cls: type[Self], meth: _CallableT, callback: Callable[[_CallableT], object] | None = ...) -> Self: ... + def __new__(cls, meth: _CallableT, callback: Callable[[_CallableT], object] | None = None) -> Self: ... def __call__(self) -> _CallableT | None: ... def __eq__(self, other: object) -> bool: ... def __ne__(self, other: object) -> bool: ... @@ -64,14 +63,14 @@ class WeakValueDictionary(MutableMapping[_KT, _VT]): def __iter__(self) -> Iterator[_KT]: ... def copy(self) -> WeakValueDictionary[_KT, _VT]: ... __copy__ = copy - def __deepcopy__(self: Self, memo: Any) -> Self: ... + def __deepcopy__(self, memo: Any) -> Self: ... # These are incompatible with Mapping def keys(self) -> Iterator[_KT]: ... # type: ignore[override] def values(self) -> Iterator[_VT]: ... # type: ignore[override] def items(self) -> Iterator[tuple[_KT, _VT]]: ... # type: ignore[override] def itervaluerefs(self) -> Iterator[KeyedRef[_KT, _VT]]: ... def valuerefs(self) -> list[KeyedRef[_KT, _VT]]: ... - def setdefault(self, key: _KT, default: _VT = ...) -> _VT: ... + def setdefault(self, key: _KT, default: _VT) -> _VT: ... # type: ignore[override] @overload def pop(self, key: _KT) -> _VT: ... @overload @@ -81,19 +80,19 @@ class WeakValueDictionary(MutableMapping[_KT, _VT]): def __ror__(self, other: Mapping[_T1, _T2]) -> WeakValueDictionary[_KT | _T1, _VT | _T2]: ... # WeakValueDictionary.__ior__ should be kept roughly in line with MutableMapping.update() @overload # type: ignore[misc] - def __ior__(self: Self, other: SupportsKeysAndGetItem[_KT, _VT]) -> Self: ... + def __ior__(self, other: SupportsKeysAndGetItem[_KT, _VT]) -> Self: ... @overload - def __ior__(self: Self, other: Iterable[tuple[_KT, _VT]]) -> Self: ... + def __ior__(self, other: Iterable[tuple[_KT, _VT]]) -> Self: ... class KeyedRef(ref[_T], Generic[_KT, _T]): key: _KT # This __new__ method uses a non-standard name for the "cls" parameter - def __new__(type: type[Self], ob: _T, callback: Callable[[_T], Any], key: _KT) -> Self: ... + def __new__(type, ob: _T, callback: Callable[[_T], Any], key: _KT) -> Self: ... def __init__(self, ob: _T, callback: Callable[[_T], Any], key: _KT) -> None: ... class WeakKeyDictionary(MutableMapping[_KT, _VT]): @overload - def __init__(self, dict: None = ...) -> None: ... + def __init__(self, dict: None = None) -> None: ... @overload def __init__(self, dict: Mapping[_KT, _VT] | Iterable[tuple[_KT, _VT]]) -> None: ... def __len__(self) -> int: ... @@ -104,13 +103,17 @@ class WeakKeyDictionary(MutableMapping[_KT, _VT]): def __iter__(self) -> Iterator[_KT]: ... def copy(self) -> WeakKeyDictionary[_KT, _VT]: ... __copy__ = copy - def __deepcopy__(self: Self, memo: Any) -> Self: ... + def __deepcopy__(self, memo: Any) -> Self: ... # These are incompatible with Mapping def keys(self) -> Iterator[_KT]: ... # type: ignore[override] def values(self) -> Iterator[_VT]: ... # type: ignore[override] def items(self) -> Iterator[tuple[_KT, _VT]]: ... # type: ignore[override] def keyrefs(self) -> list[ref[_KT]]: ... - def setdefault(self, key: _KT, default: _VT = ...) -> _VT: ... + # Keep WeakKeyDictionary.setdefault in line with MutableMapping.setdefault, modulo positional-only differences + @overload + def setdefault(self: WeakKeyDictionary[_KT, _VT | None], key: _KT, default: None = None) -> _VT: ... + @overload + def setdefault(self, key: _KT, default: _VT) -> _VT: ... @overload def pop(self, key: _KT) -> _VT: ... @overload @@ -120,13 +123,13 @@ class WeakKeyDictionary(MutableMapping[_KT, _VT]): def __ror__(self, other: Mapping[_T1, _T2]) -> WeakKeyDictionary[_KT | _T1, _VT | _T2]: ... # WeakKeyDictionary.__ior__ should be kept roughly in line with MutableMapping.update() @overload # type: ignore[misc] - def __ior__(self: Self, other: SupportsKeysAndGetItem[_KT, _VT]) -> Self: ... + def __ior__(self, other: SupportsKeysAndGetItem[_KT, _VT]) -> Self: ... @overload - def __ior__(self: Self, other: Iterable[tuple[_KT, _VT]]) -> Self: ... + def __ior__(self, other: Iterable[tuple[_KT, _VT]]) -> Self: ... class finalize: # TODO: This is a good candidate for to be a `Generic[_P, _T]` class def __init__(self, __obj: object, __func: Callable[_P, Any], *args: _P.args, **kwargs: _P.kwargs) -> None: ... - def __call__(self, _: Any = ...) -> Any | None: ... + def __call__(self, _: Any = None) -> Any | None: ... def detach(self) -> tuple[Any, Any, tuple[Any, ...], dict[str, Any]] | None: ... def peek(self) -> tuple[Any, Any, tuple[Any, ...], dict[str, Any]] | None: ... @property diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/webbrowser.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/webbrowser.pyi index 8cf8935ff..02edd42e7 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/webbrowser.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/webbrowser.pyi @@ -8,10 +8,10 @@ __all__ = ["Error", "open", "open_new", "open_new_tab", "get", "register"] class Error(Exception): ... def register( - name: str, klass: Callable[[], BaseBrowser] | None, instance: BaseBrowser | None = ..., *, preferred: bool = ... + name: str, klass: Callable[[], BaseBrowser] | None, instance: BaseBrowser | None = None, *, preferred: bool = False ) -> None: ... -def get(using: str | None = ...) -> BaseBrowser: ... -def open(url: str, new: int = ..., autoraise: bool = ...) -> bool: ... +def get(using: str | None = None) -> BaseBrowser: ... +def open(url: str, new: int = 0, autoraise: bool = True) -> bool: ... def open_new(url: str) -> bool: ... def open_new_tab(url: str) -> bool: ... @@ -19,20 +19,20 @@ class BaseBrowser: args: list[str] name: str basename: str - def __init__(self, name: str = ...) -> None: ... + def __init__(self, name: str = "") -> None: ... @abstractmethod - def open(self, url: str, new: int = ..., autoraise: bool = ...) -> bool: ... + def open(self, url: str, new: int = 0, autoraise: bool = True) -> bool: ... def open_new(self, url: str) -> bool: ... def open_new_tab(self, url: str) -> bool: ... class GenericBrowser(BaseBrowser): def __init__(self, name: str | Sequence[str]) -> None: ... - def open(self, url: str, new: int = ..., autoraise: bool = ...) -> bool: ... + def open(self, url: str, new: int = 0, autoraise: bool = True) -> bool: ... class BackgroundBrowser(GenericBrowser): ... class UnixBrowser(BaseBrowser): - def open(self, url: str, new: Literal[0, 1, 2] = ..., autoraise: bool = ...) -> bool: ... # type: ignore[override] + def open(self, url: str, new: Literal[0, 1, 2] = 0, autoraise: bool = True) -> bool: ... # type: ignore[override] raise_opts: list[str] | None background: bool redirect_stdout: bool @@ -51,18 +51,23 @@ class Opera(UnixBrowser): ... class Elinks(UnixBrowser): ... class Konqueror(BaseBrowser): - def open(self, url: str, new: int = ..., autoraise: bool = ...) -> bool: ... + def open(self, url: str, new: int = 0, autoraise: bool = True) -> bool: ... class Grail(BaseBrowser): - def open(self, url: str, new: int = ..., autoraise: bool = ...) -> bool: ... + def open(self, url: str, new: int = 0, autoraise: bool = True) -> bool: ... if sys.platform == "win32": class WindowsDefault(BaseBrowser): - def open(self, url: str, new: int = ..., autoraise: bool = ...) -> bool: ... + def open(self, url: str, new: int = 0, autoraise: bool = True) -> bool: ... if sys.platform == "darwin": class MacOSX(BaseBrowser): - def open(self, url: str, new: int = ..., autoraise: bool = ...) -> bool: ... + def open(self, url: str, new: int = 0, autoraise: bool = True) -> bool: ... class MacOSXOSAScript(BaseBrowser): # In runtime this class does not have `name` and `basename` - def open(self, url: str, new: int = ..., autoraise: bool = ...) -> bool: ... + if sys.version_info >= (3, 11): + def __init__(self, name: str = "default") -> None: ... + else: + def __init__(self, name: str) -> None: ... + + def open(self, url: str, new: int = 0, autoraise: bool = True) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/winreg.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/winreg.pyi index 2cc42318f..70ea6a1ce 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/winreg.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/winreg.pyi @@ -1,25 +1,24 @@ import sys -from _typeshed import Self from types import TracebackType from typing import Any -from typing_extensions import Literal, TypeAlias, final +from typing_extensions import Literal, Self, TypeAlias, final if sys.platform == "win32": _KeyType: TypeAlias = HKEYType | int def CloseKey(__hkey: _KeyType) -> None: ... def ConnectRegistry(__computer_name: str | None, __key: _KeyType) -> HKEYType: ... def CreateKey(__key: _KeyType, __sub_key: str | None) -> HKEYType: ... - def CreateKeyEx(key: _KeyType, sub_key: str | None, reserved: int = ..., access: int = ...) -> HKEYType: ... + def CreateKeyEx(key: _KeyType, sub_key: str | None, reserved: int = 0, access: int = 131078) -> HKEYType: ... def DeleteKey(__key: _KeyType, __sub_key: str) -> None: ... - def DeleteKeyEx(key: _KeyType, sub_key: str, access: int = ..., reserved: int = ...) -> None: ... + def DeleteKeyEx(key: _KeyType, sub_key: str, access: int = 256, reserved: int = 0) -> None: ... def DeleteValue(__key: _KeyType, __value: str) -> None: ... def EnumKey(__key: _KeyType, __index: int) -> str: ... def EnumValue(__key: _KeyType, __index: int) -> tuple[str, Any, int]: ... - def ExpandEnvironmentStrings(__str: str) -> str: ... + 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 = ..., access: int = ...) -> HKEYType: ... - def OpenKeyEx(key: _KeyType, sub_key: str, reserved: int = ..., access: int = ...) -> HKEYType: ... + 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 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]: ... @@ -93,7 +92,7 @@ if sys.platform == "win32": class HKEYType: def __bool__(self) -> bool: ... def __int__(self) -> int: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None ) -> bool | None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/winsound.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/winsound.pyi index 588bd5969..9b2b57a38 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/winsound.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/winsound.pyi @@ -1,4 +1,5 @@ import sys +from _typeshed import ReadableBuffer from typing import overload from typing_extensions import Literal @@ -21,7 +22,7 @@ if sys.platform == "win32": def Beep(frequency: int, duration: int) -> None: ... # Can actually accept anything ORed with 4, and if not it's definitely str, but that's inexpressible @overload - def PlaySound(sound: bytes | None, flags: Literal[4]) -> None: ... + def PlaySound(sound: ReadableBuffer | None, flags: Literal[4]) -> None: ... @overload - def PlaySound(sound: str | bytes | None, flags: int) -> None: ... - def MessageBeep(type: int = ...) -> None: ... + def PlaySound(sound: str | ReadableBuffer | None, flags: int) -> None: ... + def MessageBeep(type: int = 0) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/wsgiref/handlers.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/wsgiref/handlers.pyi index 655fba668..ebead5400 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/wsgiref/handlers.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/wsgiref/handlers.pyi @@ -38,7 +38,7 @@ class BaseHandler: def set_content_length(self) -> None: ... def cleanup_headers(self) -> None: ... def start_response( - self, status: str, headers: list[tuple[str, str]], exc_info: OptExcInfo | None = ... + self, status: str, headers: list[tuple[str, str]], exc_info: OptExcInfo | None = None ) -> Callable[[bytes], None]: ... def send_preamble(self) -> None: ... def write(self, data: bytes) -> None: ... @@ -73,8 +73,8 @@ class SimpleHandler(BaseHandler): stdout: IO[bytes], stderr: ErrorStream, environ: MutableMapping[str, str], - multithread: bool = ..., - multiprocess: bool = ..., + multithread: bool = True, + multiprocess: bool = False, ) -> None: ... def get_stdin(self) -> InputStream: ... def get_stderr(self) -> ErrorStream: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/wsgiref/headers.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/wsgiref/headers.pyi index dd963d9b4..2654d79bf 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/wsgiref/headers.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/wsgiref/headers.pyi @@ -7,7 +7,7 @@ _HeaderList: TypeAlias = list[tuple[str, str]] tspecials: Pattern[str] # undocumented class Headers: - def __init__(self, headers: _HeaderList | None = ...) -> None: ... + def __init__(self, headers: _HeaderList | None = None) -> None: ... def __len__(self) -> int: ... def __setitem__(self, name: str, val: str) -> None: ... def __delitem__(self, name: str) -> None: ... @@ -17,7 +17,7 @@ class Headers: @overload def get(self, name: str, default: str) -> str: ... @overload - def get(self, name: str, default: str | None = ...) -> str | None: ... + def get(self, name: str, default: str | None = None) -> str | None: ... def keys(self) -> list[str]: ... def values(self) -> list[str]: ... def items(self) -> _HeaderList: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/wsgiref/simple_server.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/wsgiref/simple_server.pyi index 1dc84e9fb..547f562cc 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/wsgiref/simple_server.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/wsgiref/simple_server.pyi @@ -12,7 +12,6 @@ software_version: str # undocumented class ServerHandler(SimpleHandler): # undocumented server_software: str - def close(self) -> None: ... class WSGIServer(HTTPServer): application: WSGIApplication | None @@ -25,7 +24,6 @@ class WSGIRequestHandler(BaseHTTPRequestHandler): server_version: str def get_environ(self) -> WSGIEnvironment: ... def get_stderr(self) -> ErrorStream: ... - def handle(self) -> None: ... def demo_app(environ: WSGIEnvironment, start_response: StartResponse) -> list[bytes]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/wsgiref/util.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/wsgiref/util.pyi index 36e5c1e69..962fac2c5 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/wsgiref/util.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/wsgiref/util.pyi @@ -9,7 +9,7 @@ class FileWrapper: filelike: IO[bytes] blksize: int close: Callable[[], None] # only exists if filelike.close exists - def __init__(self, filelike: IO[bytes], blksize: int = ...) -> None: ... + def __init__(self, filelike: IO[bytes], blksize: int = 8192) -> None: ... if sys.version_info < (3, 11): def __getitem__(self, key: Any) -> bytes: ... @@ -18,7 +18,7 @@ class FileWrapper: def guess_scheme(environ: WSGIEnvironment) -> str: ... def application_uri(environ: WSGIEnvironment) -> str: ... -def request_uri(environ: WSGIEnvironment, include_query: bool = ...) -> str: ... +def request_uri(environ: WSGIEnvironment, include_query: bool = True) -> str: ... def shift_path_info(environ: WSGIEnvironment) -> str | None: ... def setup_testing_defaults(environ: WSGIEnvironment) -> None: ... def is_hop_by_hop(header_name: str) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/xdrlib.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/xdrlib.pyi index e0b8c6a54..78f3ecec8 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/xdrlib.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/xdrlib.pyi @@ -12,7 +12,6 @@ class Error(Exception): class ConversionError(Error): ... class Packer: - def __init__(self) -> None: ... def reset(self) -> None: ... def get_buffer(self) -> bytes: ... def get_buf(self) -> bytes: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/xml/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/xml/__init__.pyi index c524ac2b1..a487d2467 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/xml/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/xml/__init__.pyi @@ -1 +1 @@ -import xml.parsers as parsers +from xml import parsers as parsers diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/xml/dom/domreg.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/xml/dom/domreg.pyi index 5a276ae5f..a46d3ff09 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/xml/dom/domreg.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/xml/dom/domreg.pyi @@ -5,4 +5,6 @@ well_known_implementations: dict[str, str] registered: dict[str, Callable[[], DOMImplementation]] def registerDOMImplementation(name: str, factory: Callable[[], DOMImplementation]) -> None: ... -def getDOMImplementation(name: str | None = ..., features: str | Iterable[tuple[str, str | None]] = ...) -> DOMImplementation: ... +def getDOMImplementation( + name: str | None = None, features: str | Iterable[tuple[str, str | None]] = ... +) -> DOMImplementation: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/xml/dom/expatbuilder.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/xml/dom/expatbuilder.pyi index 58914e8fa..45f0af7aa 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/xml/dom/expatbuilder.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/xml/dom/expatbuilder.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete, ReadableBuffer, SupportsRead from typing import Any, NoReturn from xml.dom.minidom import Document, DOMImplementation, Node, TypeInfo from xml.dom.xmlbuilder import DOMBuilderFilter, Options @@ -12,8 +13,8 @@ FILTER_INTERRUPT = DOMBuilderFilter.FILTER_INTERRUPT theDOMImplementation: DOMImplementation | None class ElementInfo: - tagName: Any - def __init__(self, tagName, model: Any | None = ...) -> None: ... + tagName: Incomplete + def __init__(self, tagName, model: Incomplete | None = None) -> None: ... def getAttributeType(self, aname) -> TypeInfo: ... def getAttributeTypeNS(self, namespaceURI, localName) -> TypeInfo: ... def isElementContent(self) -> bool: ... @@ -23,14 +24,14 @@ class ElementInfo: class ExpatBuilder: document: Document # Created in self.reset() - curNode: Any # Created in self.reset() - def __init__(self, options: Options | None = ...) -> None: ... + curNode: Incomplete # Created in self.reset() + def __init__(self, options: Options | None = None) -> None: ... def createParser(self): ... def getParser(self): ... def reset(self) -> None: ... def install(self, parser) -> None: ... - def parseFile(self, file) -> Document: ... - def parseString(self, string: str) -> Document: ... + def parseFile(self, file: SupportsRead[ReadableBuffer | str]) -> Document: ... + def parseString(self, string: str | ReadableBuffer) -> Document: ... def start_doctype_decl_handler(self, doctypeName, systemId, publicId, has_internal_subset) -> None: ... def end_doctype_decl_handler(self) -> None: ... def pi_handler(self, target, data) -> None: ... @@ -67,10 +68,10 @@ class Skipper(FilterCrutch): def end_element_handler(self, *args: Any) -> None: ... class FragmentBuilder(ExpatBuilder): - fragment: Any | None - originalDocument: Any - context: Any - def __init__(self, context, options: Options | None = ...) -> None: ... + fragment: Incomplete | None + originalDocument: Incomplete + context: Incomplete + def __init__(self, context, options: Options | None = None) -> None: ... class Namespaces: def createParser(self): ... @@ -86,14 +87,14 @@ class ParseEscape(Exception): ... class InternalSubsetExtractor(ExpatBuilder): subset: Any | None def getSubset(self) -> Any | None: ... - def parseFile(self, file) -> None: ... # type: ignore[override] - def parseString(self, string: str) -> None: ... # type: ignore[override] + def parseFile(self, file: SupportsRead[ReadableBuffer | str]) -> None: ... # type: ignore[override] + def parseString(self, string: str | ReadableBuffer) -> None: ... # type: ignore[override] def start_doctype_decl_handler(self, name, publicId, systemId, has_internal_subset) -> None: ... # type: ignore[override] def end_doctype_decl_handler(self) -> NoReturn: ... def start_element_handler(self, name, attrs) -> NoReturn: ... -def parse(file, namespaces: bool = ...): ... -def parseString(string: str, namespaces: bool = ...): ... -def parseFragment(file, context, namespaces: bool = ...): ... -def parseFragmentString(string: str, context, namespaces: bool = ...): ... +def parse(file: str | SupportsRead[ReadableBuffer | str], namespaces: bool = True): ... +def parseString(string: str | ReadableBuffer, namespaces: bool = True): ... +def parseFragment(file, context, namespaces: bool = True): ... +def parseFragmentString(string: str, context, namespaces: bool = True): ... def makeBuilder(options: Options) -> ExpatBuilderNS | ExpatBuilder: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/xml/dom/minidom.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/xml/dom/minidom.pyi index 7645bd79e..ecc7bb6bc 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/xml/dom/minidom.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/xml/dom/minidom.pyi @@ -1,22 +1,25 @@ import sys import xml.dom -from _typeshed import Self, SupportsRead -from typing import Any -from typing_extensions import Literal +from _typeshed import Incomplete, ReadableBuffer, SupportsRead, SupportsWrite +from typing import NoReturn, TypeVar +from typing_extensions import Literal, Self +from xml.dom.minicompat import NodeList from xml.dom.xmlbuilder import DocumentLS, DOMImplementationLS from xml.sax.xmlreader import XMLReader -def parse(file: str | SupportsRead[bytes] | SupportsRead[str], parser: XMLReader | None = ..., bufsize: int | None = ...): ... -def parseString(string: str | bytes, parser: XMLReader | None = ...): ... -def getDOMImplementation(features=...) -> DOMImplementation | None: ... +_N = TypeVar("_N", bound=Node) + +def parse(file: str | SupportsRead[ReadableBuffer | str], parser: XMLReader | None = None, bufsize: int | None = None): ... +def parseString(string: str | ReadableBuffer, parser: XMLReader | None = None): ... +def getDOMImplementation(features=None) -> DOMImplementation | None: ... class Node(xml.dom.Node): namespaceURI: str | None - parentNode: Any - ownerDocument: Any - nextSibling: Any - previousSibling: Any - prefix: Any + parentNode: Incomplete + ownerDocument: Incomplete + nextSibling: Incomplete + previousSibling: Incomplete + prefix: Incomplete @property def firstChild(self) -> Node | None: ... @property @@ -25,15 +28,17 @@ class Node(xml.dom.Node): def localName(self) -> str | None: ... def __bool__(self) -> Literal[True]: ... if sys.version_info >= (3, 9): - def toxml(self, encoding: Any | None = ..., standalone: Any | None = ...): ... - def toprettyxml(self, indent: str = ..., newl: str = ..., encoding: Any | None = ..., standalone: Any | None = ...): ... + def toxml(self, encoding: str | None = None, standalone: bool | None = None): ... + def toprettyxml( + self, indent: str = "\t", newl: str = "\n", encoding: str | None = None, standalone: bool | None = None + ): ... else: - def toxml(self, encoding: Any | None = ...): ... - def toprettyxml(self, indent: str = ..., newl: str = ..., encoding: Any | None = ...): ... + def toxml(self, encoding: str | None = None): ... + def toprettyxml(self, indent: str = "\t", newl: str = "\n", encoding: str | None = None): ... def hasChildNodes(self) -> bool: ... def insertBefore(self, newChild, refChild): ... - def appendChild(self, node): ... + def appendChild(self, node: _N) -> _N: ... def replaceChild(self, newChild, oldChild): ... def removeChild(self, oldChild): ... def normalize(self) -> None: ... @@ -43,40 +48,40 @@ class Node(xml.dom.Node): def getInterface(self, feature): ... def getUserData(self, key): ... def setUserData(self, key, data, handler): ... - childNodes: Any + childNodes: Incomplete def unlink(self) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__(self, et, ev, tb) -> None: ... class DocumentFragment(Node): - nodeType: Any + nodeType: int nodeName: str - nodeValue: Any - attributes: Any - parentNode: Any - childNodes: Any + nodeValue: Incomplete + attributes: Incomplete + parentNode: Incomplete + childNodes: Incomplete def __init__(self) -> None: ... class Attr(Node): name: str - nodeType: Any - attributes: Any + nodeType: int + attributes: Incomplete specified: bool - ownerElement: Any + ownerElement: Incomplete namespaceURI: str | None - childNodes: Any - nodeName: Any + childNodes: Incomplete + nodeName: Incomplete nodeValue: str value: str - prefix: Any + prefix: Incomplete def __init__( - self, qName: str, namespaceURI: str | None = ..., localName: Any | None = ..., prefix: Any | None = ... + self, qName: str, namespaceURI: str | None = None, localName: str | None = None, prefix: Incomplete | None = None ) -> None: ... def unlink(self) -> None: ... @property def isId(self) -> bool: ... @property - def schemaType(self) -> Any: ... + def schemaType(self): ... class NamedNodeMap: def __init__(self, attrs, attrsNS, ownerElement) -> None: ... @@ -87,45 +92,45 @@ class NamedNodeMap: def keys(self): ... def keysNS(self): ... def values(self): ... - def get(self, name, value: Any | None = ...): ... + def get(self, name: str, value: Incomplete | None = None): ... def __len__(self) -> int: ... def __eq__(self, other: object) -> bool: ... - def __ge__(self, other: Any) -> bool: ... - def __gt__(self, other: Any) -> bool: ... - def __le__(self, other: Any) -> bool: ... - def __lt__(self, other: Any) -> bool: ... - def __getitem__(self, attname_or_tuple): ... - def __setitem__(self, attname, value) -> None: ... - def getNamedItem(self, name): ... - def getNamedItemNS(self, namespaceURI: str, localName): ... - def removeNamedItem(self, name): ... - def removeNamedItemNS(self, namespaceURI: str, localName): ... - def setNamedItem(self, node): ... - def setNamedItemNS(self, node): ... - def __delitem__(self, attname_or_tuple) -> None: ... + def __ge__(self, other: NamedNodeMap) -> bool: ... + def __gt__(self, other: NamedNodeMap) -> bool: ... + def __le__(self, other: NamedNodeMap) -> bool: ... + def __lt__(self, other: NamedNodeMap) -> bool: ... + def __getitem__(self, attname_or_tuple: tuple[str, str | None] | str): ... + def __setitem__(self, attname: str, value: Attr | str) -> None: ... + def getNamedItem(self, name: str) -> Attr | None: ... + def getNamedItemNS(self, namespaceURI: str, localName: str | None) -> Attr | None: ... + def removeNamedItem(self, name: str) -> Attr: ... + def removeNamedItemNS(self, namespaceURI: str, localName: str | None): ... + def setNamedItem(self, node: Attr) -> Attr: ... + def setNamedItemNS(self, node: Attr) -> Attr: ... + def __delitem__(self, attname_or_tuple: tuple[str, str | None] | str) -> None: ... @property def length(self) -> int: ... AttributeList = NamedNodeMap class TypeInfo: - namespace: Any - name: Any - def __init__(self, namespace, name) -> None: ... + namespace: Incomplete | None + name: str + def __init__(self, namespace: Incomplete | None, name: str) -> None: ... class Element(Node): - nodeType: Any - nodeValue: Any - schemaType: Any - parentNode: Any + nodeType: int + nodeValue: Incomplete + schemaType: Incomplete + parentNode: Incomplete tagName: str nodeName: str - prefix: Any + prefix: Incomplete namespaceURI: str | None - childNodes: Any - nextSibling: Any + childNodes: Incomplete + nextSibling: Incomplete def __init__( - self, tagName, namespaceURI: str | None = ..., prefix: Any | None = ..., localName: Any | None = ... + self, tagName, namespaceURI: str | None = None, prefix: Incomplete | None = None, localName: Incomplete | None = None ) -> None: ... def unlink(self) -> None: ... def getAttribute(self, attname: str) -> str: ... @@ -135,16 +140,16 @@ class Element(Node): def getAttributeNode(self, attrname: str): ... def getAttributeNodeNS(self, namespaceURI: str, localName): ... def setAttributeNode(self, attr): ... - setAttributeNodeNS: Any + setAttributeNodeNS: Incomplete def removeAttribute(self, name: str) -> None: ... def removeAttributeNS(self, namespaceURI: str, localName) -> None: ... def removeAttributeNode(self, node): ... - removeAttributeNodeNS: Any + removeAttributeNodeNS: Incomplete def hasAttribute(self, name: str) -> bool: ... def hasAttributeNS(self, namespaceURI: str, localName) -> bool: ... - def getElementsByTagName(self, name: str): ... + def getElementsByTagName(self, name: str) -> NodeList[Node]: ... def getElementsByTagNameNS(self, namespaceURI: str, localName): ... - def writexml(self, writer, indent: str = ..., addindent: str = ..., newl: str = ...) -> None: ... + def writexml(self, writer: SupportsWrite[str], indent: str = "", addindent: str = "", newl: str = "") -> None: ... def hasAttributes(self) -> bool: ... def setIdAttribute(self, name) -> None: ... def setIdAttributeNS(self, namespaceURI: str, localName) -> None: ... @@ -153,33 +158,33 @@ class Element(Node): def attributes(self) -> NamedNodeMap: ... class Childless: - attributes: Any - childNodes: Any - firstChild: Any - lastChild: Any - def appendChild(self, node) -> None: ... + attributes: Incomplete + childNodes: Incomplete + firstChild: Incomplete + lastChild: Incomplete + def appendChild(self, node) -> NoReturn: ... def hasChildNodes(self) -> bool: ... - def insertBefore(self, newChild, refChild) -> None: ... - def removeChild(self, oldChild) -> None: ... + def insertBefore(self, newChild, refChild) -> NoReturn: ... + def removeChild(self, oldChild) -> NoReturn: ... def normalize(self) -> None: ... - def replaceChild(self, newChild, oldChild) -> None: ... + def replaceChild(self, newChild, oldChild) -> NoReturn: ... class ProcessingInstruction(Childless, Node): - nodeType: Any - target: Any - data: Any + nodeType: int + target: Incomplete + data: Incomplete def __init__(self, target, data) -> None: ... - nodeValue: Any - nodeName: Any - def writexml(self, writer, indent: str = ..., addindent: str = ..., newl: str = ...) -> None: ... + nodeValue: Incomplete + nodeName: Incomplete + def writexml(self, writer: SupportsWrite[str], indent: str = "", addindent: str = "", newl: str = "") -> None: ... class CharacterData(Childless, Node): - ownerDocument: Any - previousSibling: Any + ownerDocument: Incomplete + previousSibling: Incomplete def __init__(self) -> None: ... def __len__(self) -> int: ... data: str - nodeValue: Any + nodeValue: Incomplete def substringData(self, offset: int, count: int) -> str: ... def appendData(self, arg: str) -> None: ... def insertData(self, offset: int, arg: str) -> None: ... @@ -189,12 +194,12 @@ class CharacterData(Childless, Node): def length(self) -> int: ... class Text(CharacterData): - nodeType: Any + nodeType: int nodeName: str - attributes: Any - data: Any + attributes: Incomplete + data: Incomplete def splitText(self, offset): ... - def writexml(self, writer, indent: str = ..., addindent: str = ..., newl: str = ...) -> None: ... + def writexml(self, writer: SupportsWrite[str], indent: str = "", addindent: str = "", newl: str = "") -> None: ... def replaceWholeText(self, content): ... @property def isWhitespaceInElementContent(self) -> bool: ... @@ -202,19 +207,19 @@ class Text(CharacterData): def wholeText(self) -> str: ... class Comment(CharacterData): - nodeType: Any + nodeType: int nodeName: str def __init__(self, data) -> None: ... - def writexml(self, writer, indent: str = ..., addindent: str = ..., newl: str = ...) -> None: ... + def writexml(self, writer: SupportsWrite[str], indent: str = "", addindent: str = "", newl: str = "") -> None: ... class CDATASection(Text): - nodeType: Any + nodeType: int nodeName: str - def writexml(self, writer, indent: str = ..., addindent: str = ..., newl: str = ...) -> None: ... + def writexml(self, writer: SupportsWrite[str], indent: str = "", addindent: str = "", newl: str = "") -> None: ... class ReadOnlySequentialNamedNodeMap: def __init__(self, seq=...) -> None: ... - def __len__(self): ... + def __len__(self) -> int: ... def getNamedItem(self, name): ... def getNamedItemNS(self, namespaceURI: str, localName): ... def __getitem__(self, name_or_tuple): ... @@ -227,51 +232,51 @@ class ReadOnlySequentialNamedNodeMap: def length(self) -> int: ... class Identified: - publicId: Any - systemId: Any + publicId: Incomplete + systemId: Incomplete class DocumentType(Identified, Childless, Node): - nodeType: Any - nodeValue: Any - name: Any - internalSubset: Any - entities: Any - notations: Any - nodeName: Any + nodeType: int + nodeValue: Incomplete + name: Incomplete + internalSubset: Incomplete + entities: Incomplete + notations: Incomplete + nodeName: Incomplete def __init__(self, qualifiedName: str) -> None: ... def cloneNode(self, deep): ... - def writexml(self, writer, indent: str = ..., addindent: str = ..., newl: str = ...) -> None: ... + def writexml(self, writer: SupportsWrite[str], indent: str = "", addindent: str = "", newl: str = "") -> None: ... class Entity(Identified, Node): - attributes: Any - nodeType: Any - nodeValue: Any - actualEncoding: Any - encoding: Any - version: Any - nodeName: Any - notationName: Any - childNodes: Any + attributes: Incomplete + nodeType: int + nodeValue: Incomplete + actualEncoding: Incomplete + encoding: Incomplete + version: Incomplete + nodeName: Incomplete + notationName: Incomplete + childNodes: Incomplete def __init__(self, name, publicId, systemId, notation) -> None: ... - def appendChild(self, newChild) -> None: ... - def insertBefore(self, newChild, refChild) -> None: ... - def removeChild(self, oldChild) -> None: ... - def replaceChild(self, newChild, oldChild) -> None: ... + def appendChild(self, newChild) -> NoReturn: ... + def insertBefore(self, newChild, refChild) -> NoReturn: ... + def removeChild(self, oldChild) -> NoReturn: ... + def replaceChild(self, newChild, oldChild) -> NoReturn: ... class Notation(Identified, Childless, Node): - nodeType: Any - nodeValue: Any - nodeName: Any + nodeType: int + nodeValue: Incomplete + nodeName: Incomplete def __init__(self, name, publicId, systemId) -> None: ... class DOMImplementation(DOMImplementationLS): - def hasFeature(self, feature, version) -> bool: ... - def createDocument(self, namespaceURI: str | None, qualifiedName: str | None, doctype): ... - def createDocumentType(self, qualifiedName: str | None, publicId, systemId): ... - def getInterface(self, feature): ... + def hasFeature(self, feature: str, version: str | None) -> bool: ... + def createDocument(self, namespaceURI: str | None, qualifiedName: str | None, doctype: DocumentType | None) -> Document: ... + def createDocumentType(self, qualifiedName: str | None, publicId: str, systemId: str) -> DocumentType: ... + def getInterface(self, feature: str) -> Self | None: ... class ElementInfo: - tagName: Any + tagName: Incomplete def __init__(self, name) -> None: ... def getAttributeType(self, aname): ... def getAttributeTypeNS(self, namespaceURI: str, localName): ... @@ -281,56 +286,61 @@ class ElementInfo: def isIdNS(self, namespaceURI: str, localName): ... class Document(Node, DocumentLS): - implementation: Any - nodeType: Any + implementation: Incomplete + nodeType: int nodeName: str - nodeValue: Any - attributes: Any - parentNode: Any - previousSibling: Any - nextSibling: Any - actualEncoding: Any - encoding: Any - standalone: Any - version: Any + nodeValue: Incomplete + attributes: Incomplete + parentNode: Incomplete + previousSibling: Incomplete + nextSibling: Incomplete + actualEncoding: Incomplete + encoding: str | None + standalone: bool | None + version: Incomplete strictErrorChecking: bool - errorHandler: Any - documentURI: Any - doctype: Any - childNodes: Any + errorHandler: Incomplete + documentURI: Incomplete + doctype: DocumentType | None + childNodes: Incomplete def __init__(self) -> None: ... - def appendChild(self, node): ... - documentElement: Any + def appendChild(self, node: _N) -> _N: ... + documentElement: Incomplete def removeChild(self, oldChild): ... def unlink(self) -> None: ... def cloneNode(self, deep): ... - def createDocumentFragment(self): ... - def createElement(self, tagName: str): ... - def createTextNode(self, data): ... - def createCDATASection(self, data): ... - def createComment(self, data): ... + def createDocumentFragment(self) -> DocumentFragment: ... + def createElement(self, tagName: str) -> Element: ... + def createTextNode(self, data: str) -> Text: ... + def createCDATASection(self, data: str) -> CDATASection: ... + def createComment(self, data: str) -> Comment: ... def createProcessingInstruction(self, target, data): ... def createAttribute(self, qName) -> Attr: ... def createElementNS(self, namespaceURI: str, qualifiedName: str): ... def createAttributeNS(self, namespaceURI: str, qualifiedName: str) -> Attr: ... def getElementById(self, id): ... - def getElementsByTagName(self, name: str): ... + def getElementsByTagName(self, name: str) -> NodeList[Node]: ... def getElementsByTagNameNS(self, namespaceURI: str, localName): ... - def isSupported(self, feature, version): ... + def isSupported(self, feature: str, version: str | None) -> bool: ... def importNode(self, node, deep): ... if sys.version_info >= (3, 9): def writexml( self, - writer, - indent: str = ..., - addindent: str = ..., - newl: str = ..., - encoding: Any | None = ..., - standalone: Any | None = ..., + writer: SupportsWrite[str], + indent: str = "", + addindent: str = "", + newl: str = "", + encoding: str | None = None, + standalone: bool | None = None, ) -> None: ... else: def writexml( - self, writer, indent: str = ..., addindent: str = ..., newl: str = ..., encoding: Any | None = ... + self, + writer: SupportsWrite[str], + indent: str = "", + addindent: str = "", + newl: str = "", + encoding: Incomplete | None = None, ) -> None: ... def renameNode(self, n, namespaceURI: str, name): ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/xml/dom/pulldom.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/xml/dom/pulldom.pyi index 07f220ddd..920905160 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/xml/dom/pulldom.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/xml/dom/pulldom.pyi @@ -1,7 +1,6 @@ import sys -from _typeshed import SupportsRead +from _typeshed import Incomplete, SupportsRead from collections.abc import Sequence -from typing import Any from typing_extensions import Literal, TypeAlias from xml.dom.minidom import Document, DOMImplementation, Element, Text from xml.sax.handler import ContentHandler @@ -36,11 +35,11 @@ _Event: TypeAlias = tuple[ class PullDOM(ContentHandler): document: Document | None documentFactory: _DocumentFactory - firstEvent: Any - lastEvent: Any - elementStack: Sequence[Any] - pending_events: Sequence[Any] - def __init__(self, documentFactory: _DocumentFactory = ...) -> None: ... + firstEvent: Incomplete + lastEvent: Incomplete + elementStack: Sequence[Incomplete] + pending_events: Sequence[Incomplete] + def __init__(self, documentFactory: _DocumentFactory = None) -> None: ... def pop(self) -> Element: ... def setDocumentLocator(self, locator) -> None: ... def startPrefixMapping(self, prefix, uri) -> None: ... @@ -68,7 +67,7 @@ class DOMEventStream: parser: XMLReader bufsize: int def __init__(self, stream: SupportsRead[bytes] | SupportsRead[str], parser: XMLReader, bufsize: int) -> None: ... - pulldom: Any + pulldom: Incomplete if sys.version_info < (3, 11): def __getitem__(self, pos): ... @@ -89,6 +88,6 @@ class SAX2DOM(PullDOM): default_bufsize: int def parse( - stream_or_string: str | SupportsRead[bytes] | SupportsRead[str], parser: XMLReader | None = ..., bufsize: int | None = ... + stream_or_string: str | SupportsRead[bytes] | SupportsRead[str], parser: XMLReader | None = None, bufsize: int | None = None ) -> DOMEventStream: ... -def parseString(string: str, parser: XMLReader | None = ...) -> DOMEventStream: ... +def parseString(string: str, parser: XMLReader | None = None) -> DOMEventStream: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/xml/dom/xmlbuilder.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/xml/dom/xmlbuilder.pyi index f6afd8aa2..c07e4ba24 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/xml/dom/xmlbuilder.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/xml/dom/xmlbuilder.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete, Unused from typing import Any, NoReturn from typing_extensions import Literal, TypeAlias from urllib.request import OpenerDirector @@ -11,20 +12,20 @@ __all__ = ["DOMBuilder", "DOMEntityResolver", "DOMInputSource"] # The same as `_DOMBuilderErrorHandlerType`? # Maybe `xml.sax.handler.ErrorHandler`? # - Return type of DOMBuilder.getFeature(). -# We could get rid of the `Any` if we knew more +# We could get rid of the `Incomplete` if we knew more # about `Options.errorHandler`. # ALIASES REPRESENTING MORE UNKNOWN TYPES: # probably the same as `Options.errorHandler`? # Maybe `xml.sax.handler.ErrorHandler`? -_DOMBuilderErrorHandlerType: TypeAlias = Any | None +_DOMBuilderErrorHandlerType: TypeAlias = Incomplete | None # probably some kind of IO... -_DOMInputSourceCharacterStreamType: TypeAlias = Any | None +_DOMInputSourceCharacterStreamType: TypeAlias = Incomplete | None # probably a string?? -_DOMInputSourceStringDataType: TypeAlias = Any | None +_DOMInputSourceStringDataType: TypeAlias = Incomplete | None # probably a string?? -_DOMInputSourceEncodingType: TypeAlias = Any | None +_DOMInputSourceEncodingType: TypeAlias = Incomplete | None class Options: namespaces: int @@ -55,18 +56,17 @@ class DOMBuilder: ACTION_APPEND_AS_CHILDREN: Literal[2] ACTION_INSERT_AFTER: Literal[3] ACTION_INSERT_BEFORE: Literal[4] - def __init__(self) -> None: ... def setFeature(self, name: str, state: int) -> None: ... def supportsFeature(self, name: str) -> bool: ... def canSetFeature(self, name: str, state: int) -> bool: ... # getFeature could return any attribute from an instance of `Options` - def getFeature(self, name: str) -> Any: ... + def getFeature(self, name: str) -> Incomplete: ... def parseURI(self, uri: str) -> ExpatBuilder | ExpatBuilderNS: ... def parse(self, input: DOMInputSource) -> ExpatBuilder | ExpatBuilderNS: ... # `input` and `cnode` argtypes for `parseWithContext` are unknowable # as the function does nothing with them, and always raises an exception. # But `input` is *probably* `DOMInputSource`? - def parseWithContext(self, input: object, cnode: object, action: Literal[1, 2, 3, 4]) -> NoReturn: ... + def parseWithContext(self, input: Unused, cnode: Unused, action: Literal[1, 2, 3, 4]) -> NoReturn: ... class DOMEntityResolver: def resolveEntity(self, publicId: str | None, systemId: str) -> DOMInputSource: ... @@ -86,9 +86,8 @@ class DOMBuilderFilter: FILTER_SKIP: Literal[3] FILTER_INTERRUPT: Literal[4] whatToShow: int - # The argtypes for acceptNode and startContainer appear to be irrelevant. - def acceptNode(self, element: object) -> Literal[1]: ... - def startContainer(self, element: object) -> Literal[1]: ... + def acceptNode(self, element: Unused) -> Literal[1]: ... + def startContainer(self, element: Unused) -> Literal[1]: ... class DocumentLS: async_: bool @@ -97,8 +96,8 @@ class DocumentLS: # so the argtypes of `uri` and `source` are unknowable. # `source` is *probably* `DOMInputSource`? # `uri` is *probably* a str? (see DOMBuilder.parseURI()) - def load(self, uri: object) -> NoReturn: ... - def loadXML(self, source: object) -> NoReturn: ... + def load(self, uri: Unused) -> NoReturn: ... + def loadXML(self, source: Unused) -> NoReturn: ... def saveXML(self, snode: Node | None) -> str: ... class DOMImplementationLS: diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/xml/etree/ElementInclude.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/xml/etree/ElementInclude.pyi index 7bb78d062..cbba15dd3 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/xml/etree/ElementInclude.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/xml/etree/ElementInclude.pyi @@ -1,4 +1,5 @@ import sys +from _typeshed import FileDescriptorOrPath from collections.abc import Callable from xml.etree.ElementTree import Element @@ -11,17 +12,17 @@ if sys.version_info >= (3, 9): class FatalIncludeError(SyntaxError): ... -def default_loader(href: str | bytes | int, parse: str, encoding: str | None = ...) -> str | Element: ... +def default_loader(href: FileDescriptorOrPath, parse: str, encoding: str | None = None) -> str | Element: ... # TODO: loader is of type default_loader ie it takes a callable that has the # same signature as default_loader. But default_loader has a keyword argument # Which can't be represented using Callable... if sys.version_info >= (3, 9): def include( - elem: Element, loader: Callable[..., str | Element] | None = ..., base_url: str | None = ..., max_depth: int | None = ... + elem: Element, loader: Callable[..., str | Element] | None = None, base_url: str | None = None, max_depth: int | None = 6 ) -> None: ... class LimitedRecursiveIncludeError(FatalIncludeError): ... else: - def include(elem: Element, loader: Callable[..., str | Element] | None = ...) -> None: ... + def include(elem: Element, loader: Callable[..., str | Element] | None = None) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/xml/etree/ElementPath.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/xml/etree/ElementPath.pyi index 94ce93358..c3f6207ea 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/xml/etree/ElementPath.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/xml/etree/ElementPath.pyi @@ -10,7 +10,7 @@ _Token: TypeAlias = tuple[str, str] _Next: TypeAlias = Callable[[], _Token] _Callback: TypeAlias = Callable[[_SelectorContext, list[Element]], Generator[Element, None, None]] -def xpath_tokenizer(pattern: str, namespaces: dict[str, str] | None = ...) -> Generator[_Token, None, None]: ... +def xpath_tokenizer(pattern: str, namespaces: dict[str, str] | None = None) -> Generator[_Token, None, None]: ... def get_parent_map(context: _SelectorContext) -> dict[Element, Element]: ... def prepare_child(next: _Next, token: _Token) -> _Callback: ... def prepare_star(next: _Next, token: _Token) -> _Callback: ... @@ -28,7 +28,7 @@ class _SelectorContext: _T = TypeVar("_T") -def iterfind(elem: Element, path: str, namespaces: dict[str, str] | None = ...) -> Generator[Element, None, None]: ... -def find(elem: Element, path: str, namespaces: dict[str, str] | None = ...) -> Element | None: ... -def findall(elem: Element, path: str, namespaces: dict[str, str] | None = ...) -> list[Element]: ... -def findtext(elem: Element, path: str, default: _T | None = ..., namespaces: dict[str, str] | None = ...) -> _T | str: ... +def iterfind(elem: Element, path: str, namespaces: dict[str, str] | None = None) -> Generator[Element, None, None]: ... +def find(elem: Element, path: str, namespaces: dict[str, str] | None = None) -> Element | None: ... +def findall(elem: Element, path: str, namespaces: dict[str, str] | None = None) -> list[Element]: ... +def findtext(elem: Element, path: str, default: _T | None = None, namespaces: dict[str, str] | None = None) -> _T | str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/xml/etree/ElementTree.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/xml/etree/ElementTree.pyi index 84059bc21..2cf8dbbe7 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/xml/etree/ElementTree.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/xml/etree/ElementTree.pyi @@ -1,6 +1,6 @@ import sys from _collections_abc import dict_keys -from _typeshed import FileDescriptor, StrOrBytesPath, SupportsRead, SupportsWrite +from _typeshed import FileDescriptorOrPath, ReadableBuffer, SupportsRead, SupportsWrite from collections.abc import Callable, Generator, ItemsView, Iterable, Iterator, Mapping, Sequence from typing import Any, TypeVar, overload from typing_extensions import Literal, SupportsIndex, TypeAlias, TypeGuard @@ -38,8 +38,8 @@ if sys.version_info >= (3, 9): __all__ += ["indent"] _T = TypeVar("_T") -_FileRead: TypeAlias = StrOrBytesPath | FileDescriptor | SupportsRead[bytes] | SupportsRead[str] -_FileWriteC14N: TypeAlias = StrOrBytesPath | FileDescriptor | SupportsWrite[bytes] +_FileRead: TypeAlias = FileDescriptorOrPath | SupportsRead[bytes] | SupportsRead[str] +_FileWriteC14N: TypeAlias = FileDescriptorOrPath | SupportsWrite[bytes] _FileWrite: TypeAlias = _FileWriteC14N | SupportsWrite[str] VERSION: str @@ -54,31 +54,31 @@ def iselement(element: object) -> TypeGuard[Element]: ... if sys.version_info >= (3, 8): @overload def canonicalize( - xml_data: str | bytes | None = ..., + xml_data: str | ReadableBuffer | None = None, *, - out: None = ..., - from_file: _FileRead | None = ..., - with_comments: bool = ..., - strip_text: bool = ..., - rewrite_prefixes: bool = ..., - qname_aware_tags: Iterable[str] | None = ..., - qname_aware_attrs: Iterable[str] | None = ..., - exclude_attrs: Iterable[str] | None = ..., - exclude_tags: Iterable[str] | None = ..., + out: None = None, + from_file: _FileRead | None = None, + with_comments: bool = False, + strip_text: bool = False, + rewrite_prefixes: bool = False, + qname_aware_tags: Iterable[str] | None = None, + qname_aware_attrs: Iterable[str] | None = None, + exclude_attrs: Iterable[str] | None = None, + exclude_tags: Iterable[str] | None = None, ) -> str: ... @overload def canonicalize( - xml_data: str | bytes | None = ..., + xml_data: str | ReadableBuffer | None = None, *, out: SupportsWrite[str], - from_file: _FileRead | None = ..., - with_comments: bool = ..., - strip_text: bool = ..., - rewrite_prefixes: bool = ..., - qname_aware_tags: Iterable[str] | None = ..., - qname_aware_attrs: Iterable[str] | None = ..., - exclude_attrs: Iterable[str] | None = ..., - exclude_tags: Iterable[str] | None = ..., + from_file: _FileRead | None = None, + with_comments: bool = False, + strip_text: bool = False, + rewrite_prefixes: bool = False, + qname_aware_tags: Iterable[str] | None = None, + qname_aware_attrs: Iterable[str] | None = None, + exclude_attrs: Iterable[str] | None = None, + exclude_tags: Iterable[str] | None = None, ) -> None: ... class Element: @@ -90,20 +90,20 @@ class Element: def append(self, __subelement: Element) -> None: ... def clear(self) -> None: ... def extend(self, __elements: Iterable[Element]) -> None: ... - def find(self, path: str, namespaces: dict[str, str] | None = ...) -> Element | None: ... - def findall(self, path: str, namespaces: dict[str, str] | None = ...) -> list[Element]: ... + def find(self, path: str, namespaces: dict[str, str] | None = None) -> Element | None: ... + def findall(self, path: str, namespaces: dict[str, str] | None = None) -> list[Element]: ... @overload - def findtext(self, path: str, default: None = ..., namespaces: dict[str, str] | None = ...) -> str | None: ... + def findtext(self, path: str, default: None = None, namespaces: dict[str, str] | None = None) -> str | None: ... @overload - def findtext(self, path: str, default: _T, namespaces: dict[str, str] | None = ...) -> _T | str: ... + def findtext(self, path: str, default: _T, namespaces: dict[str, str] | None = None) -> _T | str: ... @overload - def get(self, key: str, default: None = ...) -> str | None: ... + def get(self, key: str, default: None = None) -> str | None: ... @overload def get(self, key: str, default: _T) -> str | _T: ... def insert(self, __index: int, __subelement: Element) -> None: ... def items(self) -> ItemsView[str, str]: ... - def iter(self, tag: str | None = ...) -> Generator[Element, None, None]: ... - def iterfind(self, path: str, namespaces: dict[str, str] | None = ...) -> Generator[Element, None, None]: ... + def iter(self, tag: str | None = None) -> Generator[Element, None, None]: ... + def iterfind(self, path: str, namespaces: dict[str, str] | None = None) -> Generator[Element, None, None]: ... def itertext(self) -> Generator[str, None, None]: ... def keys(self) -> dict_keys[str, str]: ... # makeelement returns the type of self in Python impl, but not in C impl @@ -112,31 +112,31 @@ class Element: def set(self, __key: str, __value: str) -> None: ... def __copy__(self) -> Element: ... # returns the type of self in Python impl, but not in C impl def __deepcopy__(self, __memo: Any) -> Element: ... # Only exists in C impl - def __delitem__(self, __i: SupportsIndex | slice) -> None: ... + def __delitem__(self, __key: SupportsIndex | slice) -> None: ... @overload - def __getitem__(self, __i: SupportsIndex) -> Element: ... + def __getitem__(self, __key: SupportsIndex) -> Element: ... @overload - def __getitem__(self, __s: slice) -> list[Element]: ... + def __getitem__(self, __key: slice) -> list[Element]: ... def __len__(self) -> int: ... # Doesn't actually exist at runtime, but instance of the class are indeed iterable due to __getitem__. def __iter__(self) -> Iterator[Element]: ... @overload - def __setitem__(self, __i: SupportsIndex, __o: Element) -> None: ... + def __setitem__(self, __key: SupportsIndex, __value: Element) -> None: ... @overload - def __setitem__(self, __s: slice, __o: Iterable[Element]) -> None: ... + def __setitem__(self, __key: slice, __value: Iterable[Element]) -> None: ... if sys.version_info < (3, 9): def getchildren(self) -> list[Element]: ... - def getiterator(self, tag: str | None = ...) -> list[Element]: ... + def getiterator(self, tag: str | None = None) -> list[Element]: ... def SubElement(parent: Element, tag: str, attrib: dict[str, str] = ..., **extra: str) -> Element: ... -def Comment(text: str | None = ...) -> Element: ... -def ProcessingInstruction(target: str, text: str | None = ...) -> Element: ... +def Comment(text: str | None = None) -> Element: ... +def ProcessingInstruction(target: str, text: str | None = None) -> Element: ... PI: Callable[..., Element] class QName: text: str - def __init__(self, text_or_uri: str, tag: str | None = ...) -> None: ... + def __init__(self, text_or_uri: str, tag: str | None = None) -> None: ... def __lt__(self, other: QName | str) -> bool: ... def __le__(self, other: QName | str) -> bool: ... def __gt__(self, other: QName | str) -> bool: ... @@ -144,29 +144,29 @@ class QName: def __eq__(self, other: object) -> bool: ... class ElementTree: - def __init__(self, element: Element | None = ..., file: _FileRead | None = ...) -> None: ... + def __init__(self, element: Element | None = None, file: _FileRead | None = None) -> None: ... def getroot(self) -> Element | Any: ... - def parse(self, source: _FileRead, parser: XMLParser | None = ...) -> Element: ... - def iter(self, tag: str | None = ...) -> Generator[Element, None, None]: ... + def parse(self, source: _FileRead, parser: XMLParser | None = None) -> Element: ... + def iter(self, tag: str | None = None) -> Generator[Element, None, None]: ... if sys.version_info < (3, 9): - def getiterator(self, tag: str | None = ...) -> list[Element]: ... + def getiterator(self, tag: str | None = None) -> list[Element]: ... - def find(self, path: str, namespaces: dict[str, str] | None = ...) -> Element | None: ... + def find(self, path: str, namespaces: dict[str, str] | None = None) -> Element | None: ... @overload - def findtext(self, path: str, default: None = ..., namespaces: dict[str, str] | None = ...) -> str | None: ... + def findtext(self, path: str, default: None = None, namespaces: dict[str, str] | None = None) -> str | None: ... @overload - def findtext(self, path: str, default: _T, namespaces: dict[str, str] | None = ...) -> _T | str: ... - def findall(self, path: str, namespaces: dict[str, str] | None = ...) -> list[Element]: ... - def iterfind(self, path: str, namespaces: dict[str, str] | None = ...) -> Generator[Element, None, None]: ... + def findtext(self, path: str, default: _T, namespaces: dict[str, str] | None = None) -> _T | str: ... + def findall(self, path: str, namespaces: dict[str, str] | None = None) -> list[Element]: ... + def iterfind(self, path: str, namespaces: dict[str, str] | None = None) -> Generator[Element, None, None]: ... def write( self, file_or_filename: _FileWrite, - encoding: str | None = ..., - xml_declaration: bool | None = ..., - default_namespace: str | None = ..., - method: str | None = ..., + encoding: str | None = None, + xml_declaration: bool | None = None, + default_namespace: str | None = None, + method: str | None = None, *, - short_empty_elements: bool = ..., + short_empty_elements: bool = True, ) -> None: ... def write_c14n(self, file: _FileWriteC14N) -> None: ... @@ -176,113 +176,113 @@ if sys.version_info >= (3, 8): @overload def tostring( element: Element, - encoding: None = ..., - method: str | None = ..., + encoding: None = None, + method: str | None = None, *, - xml_declaration: bool | None = ..., - default_namespace: str | None = ..., - short_empty_elements: bool = ..., + xml_declaration: bool | None = None, + default_namespace: str | None = None, + short_empty_elements: bool = True, ) -> bytes: ... @overload def tostring( element: Element, encoding: Literal["unicode"], - method: str | None = ..., + method: str | None = None, *, - xml_declaration: bool | None = ..., - default_namespace: str | None = ..., - short_empty_elements: bool = ..., + xml_declaration: bool | None = None, + default_namespace: str | None = None, + short_empty_elements: bool = True, ) -> str: ... @overload def tostring( element: Element, encoding: str, - method: str | None = ..., + method: str | None = None, *, - xml_declaration: bool | None = ..., - default_namespace: str | None = ..., - short_empty_elements: bool = ..., + xml_declaration: bool | None = None, + default_namespace: str | None = None, + short_empty_elements: bool = True, ) -> Any: ... @overload def tostringlist( element: Element, - encoding: None = ..., - method: str | None = ..., + encoding: None = None, + method: str | None = None, *, - xml_declaration: bool | None = ..., - default_namespace: str | None = ..., - short_empty_elements: bool = ..., + xml_declaration: bool | None = None, + default_namespace: str | None = None, + short_empty_elements: bool = True, ) -> list[bytes]: ... @overload def tostringlist( element: Element, encoding: Literal["unicode"], - method: str | None = ..., + method: str | None = None, *, - xml_declaration: bool | None = ..., - default_namespace: str | None = ..., - short_empty_elements: bool = ..., + xml_declaration: bool | None = None, + default_namespace: str | None = None, + short_empty_elements: bool = True, ) -> list[str]: ... @overload def tostringlist( element: Element, encoding: str, - method: str | None = ..., + method: str | None = None, *, - xml_declaration: bool | None = ..., - default_namespace: str | None = ..., - short_empty_elements: bool = ..., + xml_declaration: bool | None = None, + default_namespace: str | None = None, + short_empty_elements: bool = True, ) -> list[Any]: ... else: @overload def tostring( - element: Element, encoding: None = ..., method: str | None = ..., *, short_empty_elements: bool = ... + element: Element, encoding: None = None, method: str | None = None, *, short_empty_elements: bool = True ) -> bytes: ... @overload def tostring( - element: Element, encoding: Literal["unicode"], method: str | None = ..., *, short_empty_elements: bool = ... + element: Element, encoding: Literal["unicode"], method: str | None = None, *, short_empty_elements: bool = True ) -> str: ... @overload - def tostring(element: Element, encoding: str, method: str | None = ..., *, short_empty_elements: bool = ...) -> Any: ... + def tostring(element: Element, encoding: str, method: str | None = None, *, short_empty_elements: bool = True) -> Any: ... @overload def tostringlist( - element: Element, encoding: None = ..., method: str | None = ..., *, short_empty_elements: bool = ... + element: Element, encoding: None = None, method: str | None = None, *, short_empty_elements: bool = True ) -> list[bytes]: ... @overload def tostringlist( - element: Element, encoding: Literal["unicode"], method: str | None = ..., *, short_empty_elements: bool = ... + element: Element, encoding: Literal["unicode"], method: str | None = None, *, short_empty_elements: bool = True ) -> list[str]: ... @overload def tostringlist( - element: Element, encoding: str, method: str | None = ..., *, short_empty_elements: bool = ... + element: Element, encoding: str, method: str | None = None, *, short_empty_elements: bool = True ) -> list[Any]: ... def dump(elem: Element) -> None: ... if sys.version_info >= (3, 9): - def indent(tree: Element | ElementTree, space: str = ..., level: int = ...) -> None: ... + def indent(tree: Element | ElementTree, space: str = " ", level: int = 0) -> None: ... -def parse(source: _FileRead, parser: XMLParser | None = ...) -> ElementTree: ... +def parse(source: _FileRead, parser: XMLParser | None = None) -> ElementTree: ... def iterparse( - source: _FileRead, events: Sequence[str] | None = ..., parser: XMLParser | None = ... + source: _FileRead, events: Sequence[str] | None = None, parser: XMLParser | None = None ) -> Iterator[tuple[str, Any]]: ... class XMLPullParser: - def __init__(self, events: Sequence[str] | None = ..., *, _parser: XMLParser | None = ...) -> None: ... - def feed(self, data: str | bytes) -> None: ... + def __init__(self, events: Sequence[str] | None = None, *, _parser: XMLParser | None = None) -> None: ... + def feed(self, data: str | ReadableBuffer) -> None: ... def close(self) -> None: ... # Second element in the tuple could be `Element`, `tuple[str, str]` or `None`. # Use `Any` to avoid false-positive errors. def read_events(self) -> Iterator[tuple[str, Any]]: ... -def XML(text: str | bytes, parser: XMLParser | None = ...) -> Element: ... -def XMLID(text: str | bytes, parser: XMLParser | None = ...) -> tuple[Element, dict[str, Element]]: ... +def XML(text: str | ReadableBuffer, parser: XMLParser | None = None) -> Element: ... +def XMLID(text: str | ReadableBuffer, parser: XMLParser | None = None) -> tuple[Element, dict[str, Element]]: ... # This is aliased to XML in the source. fromstring = XML -def fromstringlist(sequence: Sequence[str | bytes], parser: XMLParser | None = ...) -> Element: ... +def fromstringlist(sequence: Sequence[str | ReadableBuffer], parser: XMLParser | None = None) -> Element: ... # This type is both not precise enough and too precise. The TreeBuilder # requires the elementfactory to accept tag and attrs in its args and produce @@ -313,13 +313,15 @@ class TreeBuilder: def __init__(self, element_factory: _ElementFactory | None = ...) -> None: ... def close(self) -> Element: ... - def data(self, __data: str | bytes) -> None: ... - def start(self, __tag: str | bytes, __attrs: dict[str | bytes, str | bytes]) -> Element: ... - def end(self, __tag: str | bytes) -> Element: ... + def data(self, __data: str) -> None: ... + # tag and attrs are passed to the element_factory, so they could be anything + # depending on what the particular factory supports. + def start(self, __tag: Any, __attrs: dict[Any, Any]) -> Element: ... + def end(self, __tag: str) -> Element: ... if sys.version_info >= (3, 8): # These two methods have pos-only parameters in the C implementation def comment(self, __text: str | None) -> Element: ... - def pi(self, __target: str, __text: str | None = ...) -> Element: ... + def pi(self, __target: str, __text: str | None = None) -> Element: ... if sys.version_info >= (3, 8): class C14NWriterTarget: @@ -327,13 +329,13 @@ if sys.version_info >= (3, 8): self, write: Callable[[str], object], *, - with_comments: bool = ..., - strip_text: bool = ..., - rewrite_prefixes: bool = ..., - qname_aware_tags: Iterable[str] | None = ..., - qname_aware_attrs: Iterable[str] | None = ..., - exclude_attrs: Iterable[str] | None = ..., - exclude_tags: Iterable[str] | None = ..., + with_comments: bool = False, + strip_text: bool = False, + rewrite_prefixes: bool = False, + qname_aware_tags: Iterable[str] | None = None, + qname_aware_attrs: Iterable[str] | None = None, + exclude_attrs: Iterable[str] | None = None, + exclude_tags: Iterable[str] | None = None, ) -> None: ... def data(self, data: str) -> None: ... def start_ns(self, prefix: str, uri: str) -> None: ... @@ -355,4 +357,4 @@ class XMLParser: def doctype(self, __name: str, __pubid: str, __system: str) -> None: ... def close(self) -> Any: ... - def feed(self, __data: str | bytes) -> None: ... + def feed(self, __data: str | ReadableBuffer) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/xml/parsers/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/xml/parsers/__init__.pyi index cac086235..cebdb6a30 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/xml/parsers/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/xml/parsers/__init__.pyi @@ -1 +1 @@ -import xml.parsers.expat as expat +from xml.parsers import expat as expat diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/xml/sax/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/xml/sax/__init__.pyi index af4ee0524..ca981a00d 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/xml/sax/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/xml/sax/__init__.pyi @@ -1,5 +1,5 @@ import sys -from _typeshed import SupportsRead, _T_co +from _typeshed import ReadableBuffer, StrPath, SupportsRead, _T_co from collections.abc import Iterable from typing import Any, NoReturn, Protocol from xml.sax.handler import ContentHandler as ContentHandler, ErrorHandler as ErrorHandler @@ -9,13 +9,13 @@ class _SupportsReadClose(SupportsRead[_T_co], Protocol[_T_co]): def close(self) -> None: ... class SAXException(Exception): - def __init__(self, msg: str, exception: Exception | None = ...) -> None: ... + def __init__(self, msg: str, exception: Exception | None = None) -> None: ... def getMessage(self) -> str: ... def getException(self) -> Exception: ... def __getitem__(self, ix: Any) -> NoReturn: ... class SAXParseException(SAXException): - def __init__(self, msg: str, exception: Exception, locator: Locator) -> None: ... + def __init__(self, msg: str, exception: Exception | None, locator: Locator) -> None: ... def getColumnNumber(self) -> int: ... def getLineNumber(self) -> int: ... def getPublicId(self): ... @@ -29,12 +29,19 @@ default_parser_list: list[str] if sys.version_info >= (3, 8): def make_parser(parser_list: Iterable[str] = ...) -> XMLReader: ... + def parse( + source: StrPath | _SupportsReadClose[bytes] | _SupportsReadClose[str], + handler: ContentHandler, + errorHandler: ErrorHandler = ..., + ) -> None: ... else: def make_parser(parser_list: list[str] = ...) -> XMLReader: ... + def parse( + source: str | _SupportsReadClose[bytes] | _SupportsReadClose[str], + handler: ContentHandler, + errorHandler: ErrorHandler = ..., + ) -> None: ... -def parse( - source: str | _SupportsReadClose[bytes] | _SupportsReadClose[str], handler: ContentHandler, errorHandler: ErrorHandler = ... -) -> None: ... -def parseString(string: bytes | str, handler: ContentHandler, errorHandler: ErrorHandler | None = ...) -> None: ... +def parseString(string: ReadableBuffer | str, handler: ContentHandler, errorHandler: ErrorHandler | None = ...) -> None: ... def _create_parser(parser_name: str) -> XMLReader: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/xml/sax/handler.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/xml/sax/handler.pyi index abf124f83..63b725bd6 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/xml/sax/handler.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/xml/sax/handler.pyi @@ -1,14 +1,14 @@ import sys +from typing import NoReturn version: str class ErrorHandler: - def error(self, exception): ... - def fatalError(self, exception): ... - def warning(self, exception): ... + def error(self, exception: BaseException) -> NoReturn: ... + def fatalError(self, exception: BaseException) -> NoReturn: ... + def warning(self, exception: BaseException) -> None: ... class ContentHandler: - def __init__(self) -> None: ... def setDocumentLocator(self, locator): ... def startDocument(self): ... def endDocument(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/xml/sax/saxutils.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/xml/sax/saxutils.pyi index 1361949d0..67a06d2fc 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/xml/sax/saxutils.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/xml/sax/saxutils.pyi @@ -11,9 +11,9 @@ def quoteattr(data: str, entities: Mapping[str, str] = ...) -> str: ... class XMLGenerator(handler.ContentHandler): def __init__( self, - out: TextIOBase | RawIOBase | StreamWriter | StreamReaderWriter | SupportsWrite[str] | None = ..., - encoding: str = ..., - short_empty_elements: bool = ..., + out: TextIOBase | RawIOBase | StreamWriter | StreamReaderWriter | SupportsWrite[str] | None = None, + encoding: str = "iso-8859-1", + short_empty_elements: bool = False, ) -> None: ... def startDocument(self): ... def endDocument(self): ... @@ -28,7 +28,7 @@ class XMLGenerator(handler.ContentHandler): def processingInstruction(self, target, data): ... class XMLFilterBase(xmlreader.XMLReader): - def __init__(self, parent: xmlreader.XMLReader | None = ...) -> None: ... + def __init__(self, parent: xmlreader.XMLReader | None = None) -> None: ... def error(self, exception): ... def fatalError(self, exception): ... def warning(self, exception): ... @@ -57,4 +57,4 @@ class XMLFilterBase(xmlreader.XMLReader): def getParent(self): ... def setParent(self, parent): ... -def prepare_input_source(source, base=...): ... +def prepare_input_source(source, base=""): ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/xml/sax/xmlreader.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/xml/sax/xmlreader.pyi index d7d4db5b0..0bf167b04 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/xml/sax/xmlreader.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/xml/sax/xmlreader.pyi @@ -1,7 +1,6 @@ from collections.abc import Mapping class XMLReader: - def __init__(self) -> None: ... def parse(self, source): ... def getContentHandler(self): ... def setContentHandler(self, handler): ... @@ -18,7 +17,7 @@ class XMLReader: def setProperty(self, name, value): ... class IncrementalParser(XMLReader): - def __init__(self, bufsize: int = ...) -> None: ... + def __init__(self, bufsize: int = 65536) -> None: ... def parse(self, source): ... def feed(self, data): ... def prepareParser(self, source): ... @@ -32,7 +31,7 @@ class Locator: def getSystemId(self): ... class InputSource: - def __init__(self, system_id: str | None = ...) -> None: ... + def __init__(self, system_id: str | None = None) -> None: ... def setPublicId(self, public_id): ... def getPublicId(self): ... def setSystemId(self, system_id): ... @@ -54,11 +53,11 @@ class AttributesImpl: def getQNameByName(self, name): ... def getNames(self): ... def getQNames(self): ... - def __len__(self): ... + def __len__(self) -> int: ... def __getitem__(self, name): ... def keys(self): ... def __contains__(self, name): ... - def get(self, name, alternative=...): ... + def get(self, name, alternative=None): ... def copy(self): ... def items(self): ... def values(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/xmlrpc/client.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/xmlrpc/client.pyi index 7c0ba5c62..7bf701ae7 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/xmlrpc/client.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/xmlrpc/client.pyi @@ -2,23 +2,36 @@ import gzip import http.client import sys import time -from _typeshed import Self, SupportsRead, SupportsWrite +from _typeshed import ReadableBuffer, SupportsRead, SupportsWrite, _BufferWithLen from collections.abc import Callable, Iterable, Mapping from datetime import datetime from io import BytesIO from types import TracebackType -from typing import Any, Protocol, Union, overload -from typing_extensions import Literal, TypeAlias +from typing import Any, Protocol, overload +from typing_extensions import Literal, Self, TypeAlias class _SupportsTimeTuple(Protocol): def timetuple(self) -> time.struct_time: ... _DateTimeComparable: TypeAlias = DateTime | datetime | str | _SupportsTimeTuple _Marshallable: TypeAlias = ( - bool | int | float | str | bytes | None | tuple[Any, ...] | list[Any] | dict[Any, Any] | datetime | DateTime | Binary + bool + | int + | float + | str + | bytes + | bytearray + | None + | tuple[_Marshallable, ...] + # Ideally we'd use _Marshallable for list and dict, but invariance makes that impractical + | list[Any] + | dict[str, Any] + | datetime + | DateTime + | Binary ) _XMLDate: TypeAlias = int | datetime | tuple[int, ...] | time.struct_time -_HostType: TypeAlias = Union[tuple[str, dict[str, str]], str] +_HostType: TypeAlias = tuple[str, dict[str, str]] | str def escape(s: str) -> str: ... # undocumented @@ -42,7 +55,6 @@ INTERNAL_ERROR: int # undocumented class Error(Exception): ... class ProtocolError(Error): - url: str errcode: int errmsg: str @@ -52,7 +64,6 @@ class ProtocolError(Error): class ResponseError(Error): ... class Fault(Error): - faultCode: int faultString: str def __init__(self, faultCode: int, faultString: str, **extra: Any) -> None: ... @@ -64,9 +75,8 @@ def _iso8601_format(value: datetime) -> str: ... # undocumented def _strftime(value: _XMLDate) -> str: ... # undocumented class DateTime: - value: str # undocumented - def __init__(self, value: int | str | datetime | time.struct_time | tuple[int, ...] = ...) -> None: ... + def __init__(self, value: int | str | datetime | time.struct_time | tuple[int, ...] = 0) -> None: ... def __lt__(self, other: _DateTimeComparable) -> bool: ... def __le__(self, other: _DateTimeComparable) -> bool: ... def __gt__(self, other: _DateTimeComparable) -> bool: ... @@ -81,20 +91,19 @@ def _datetime(data: Any) -> DateTime: ... # undocumented def _datetime_type(data: str) -> datetime: ... # undocumented class Binary: - data: bytes - def __init__(self, data: bytes | None = ...) -> None: ... - def decode(self, data: bytes) -> None: ... + def __init__(self, data: bytes | bytearray | None = None) -> None: ... + def decode(self, data: ReadableBuffer) -> None: ... def encode(self, out: SupportsWrite[str]) -> None: ... def __eq__(self, other: object) -> bool: ... -def _binary(data: bytes) -> Binary: ... # undocumented +def _binary(data: ReadableBuffer) -> Binary: ... # undocumented WRAPPERS: tuple[type[DateTime], type[Binary]] # undocumented class ExpatParser: # undocumented def __init__(self, target: Unmarshaller) -> None: ... - def feed(self, data: str | bytes) -> None: ... + def feed(self, data: str | ReadableBuffer) -> None: ... def close(self) -> None: ... _WriteCallback: TypeAlias = Callable[[str], object] @@ -106,7 +115,7 @@ class Marshaller: data: None encoding: str | None allow_none: bool - def __init__(self, encoding: str | None = ..., allow_none: bool = ...) -> None: ... + def __init__(self, encoding: str | None = None, allow_none: bool = False) -> None: ... def dumps(self, values: Fault | Iterable[_Marshallable]) -> str: ... def __dump(self, value: _Marshallable, write: _WriteCallback) -> None: ... # undocumented def dump_nil(self, value: None, write: _WriteCallback) -> None: ... @@ -115,7 +124,7 @@ class Marshaller: def dump_int(self, value: int, write: _WriteCallback) -> None: ... def dump_double(self, value: float, write: _WriteCallback) -> None: ... def dump_unicode(self, value: str, write: _WriteCallback, escape: Callable[[str], str] = ...) -> None: ... - def dump_bytes(self, value: bytes, write: _WriteCallback) -> None: ... + def dump_bytes(self, value: ReadableBuffer, write: _WriteCallback) -> None: ... def dump_array(self, value: Iterable[_Marshallable], write: _WriteCallback) -> None: ... def dump_struct( self, value: Mapping[str, _Marshallable], write: _WriteCallback, escape: Callable[[str], str] = ... @@ -124,7 +133,6 @@ class Marshaller: def dump_instance(self, value: object, write: _WriteCallback) -> None: ... class Unmarshaller: - dispatch: dict[str, Callable[[Unmarshaller, str], None]] _type: str | None @@ -137,7 +145,7 @@ class Unmarshaller: append: Callable[[Any], None] _use_datetime: bool _use_builtin_types: bool - def __init__(self, use_datetime: bool = ..., use_builtin_types: bool = ...) -> None: ... + def __init__(self, use_datetime: bool = False, use_builtin_types: bool = False) -> None: ... def close(self) -> tuple[_Marshallable, ...]: ... def getmethodname(self) -> str | None: ... def xml(self, encoding: str, standalone: Any) -> None: ... # Standalone is ignored @@ -161,7 +169,6 @@ class Unmarshaller: def end_methodName(self, data: str) -> None: ... class _MultiCallMethod: # undocumented - __call_list: list[tuple[str, tuple[_Marshallable, ...]]] __name: str def __init__(self, call_list: list[tuple[str, _Marshallable]], name: str) -> None: ... @@ -169,13 +176,11 @@ class _MultiCallMethod: # undocumented def __call__(self, *args: _Marshallable) -> None: ... class MultiCallIterator: # undocumented - results: list[list[_Marshallable]] def __init__(self, results: list[list[_Marshallable]]) -> None: ... def __getitem__(self, i: int) -> _Marshallable: ... class MultiCall: - __server: ServerProxy __call_list: list[tuple[str, tuple[_Marshallable, ...]]] def __init__(self, server: ServerProxy) -> None: ... @@ -187,26 +192,25 @@ FastMarshaller: Marshaller | None FastParser: ExpatParser | None FastUnmarshaller: Unmarshaller | None -def getparser(use_datetime: bool = ..., use_builtin_types: bool = ...) -> tuple[ExpatParser, Unmarshaller]: ... +def getparser(use_datetime: bool = False, use_builtin_types: bool = False) -> tuple[ExpatParser, Unmarshaller]: ... def dumps( params: Fault | tuple[_Marshallable, ...], - methodname: str | None = ..., - methodresponse: bool | None = ..., - encoding: str | None = ..., - allow_none: bool = ..., + methodname: str | None = None, + methodresponse: bool | None = None, + encoding: str | None = None, + allow_none: bool = False, ) -> str: ... -def loads(data: str, use_datetime: bool = ..., use_builtin_types: bool = ...) -> tuple[tuple[_Marshallable, ...], str | None]: ... -def gzip_encode(data: bytes) -> bytes: ... # undocumented -def gzip_decode(data: bytes, max_decode: int = ...) -> bytes: ... # undocumented +def loads( + data: str, use_datetime: bool = False, use_builtin_types: bool = False +) -> tuple[tuple[_Marshallable, ...], str | None]: ... +def gzip_encode(data: ReadableBuffer) -> bytes: ... # undocumented +def gzip_decode(data: ReadableBuffer, max_decode: int = 20971520) -> bytes: ... # undocumented class GzipDecodedResponse(gzip.GzipFile): # undocumented - io: BytesIO - def __init__(self, response: SupportsRead[bytes]) -> None: ... - def close(self) -> None: ... + def __init__(self, response: SupportsRead[ReadableBuffer]) -> None: ... class _Method: # undocumented - __send: Callable[[str, tuple[_Marshallable, ...]], _Marshallable] __name: str def __init__(self, send: Callable[[str, tuple[_Marshallable, ...]], _Marshallable], name: str) -> None: ... @@ -214,7 +218,6 @@ class _Method: # undocumented def __call__(self, *args: _Marshallable) -> _Marshallable: ... class Transport: - user_agent: str accept_gzip_encoding: bool encode_threshold: int | None @@ -227,42 +230,46 @@ class Transport: if sys.version_info >= (3, 8): def __init__( - self, use_datetime: bool = ..., use_builtin_types: bool = ..., *, headers: Iterable[tuple[str, str]] = ... + self, use_datetime: bool = False, use_builtin_types: bool = False, *, headers: Iterable[tuple[str, str]] = ... ) -> None: ... else: - def __init__(self, use_datetime: bool = ..., use_builtin_types: bool = ...) -> None: ... + def __init__(self, use_datetime: bool = False, use_builtin_types: bool = False) -> None: ... - def request(self, host: _HostType, handler: str, request_body: bytes, verbose: bool = ...) -> tuple[_Marshallable, ...]: ... + def request( + self, host: _HostType, handler: str, request_body: _BufferWithLen, verbose: bool = False + ) -> tuple[_Marshallable, ...]: ... def single_request( - self, host: _HostType, handler: str, request_body: bytes, verbose: bool = ... + self, host: _HostType, handler: str, request_body: _BufferWithLen, verbose: bool = False ) -> tuple[_Marshallable, ...]: ... def getparser(self) -> tuple[ExpatParser, Unmarshaller]: ... def get_host_info(self, host: _HostType) -> tuple[str, list[tuple[str, str]], dict[str, str]]: ... def make_connection(self, host: _HostType) -> http.client.HTTPConnection: ... def close(self) -> None: ... - def send_request(self, host: _HostType, handler: str, request_body: bytes, debug: bool) -> http.client.HTTPConnection: ... + def send_request( + self, host: _HostType, handler: str, request_body: _BufferWithLen, debug: bool + ) -> http.client.HTTPConnection: ... def send_headers(self, connection: http.client.HTTPConnection, headers: list[tuple[str, str]]) -> None: ... - def send_content(self, connection: http.client.HTTPConnection, request_body: bytes) -> None: ... + def send_content(self, connection: http.client.HTTPConnection, request_body: _BufferWithLen) -> None: ... def parse_response(self, response: http.client.HTTPResponse) -> tuple[_Marshallable, ...]: ... class SafeTransport(Transport): - if sys.version_info >= (3, 8): def __init__( self, - use_datetime: bool = ..., - use_builtin_types: bool = ..., + use_datetime: bool = False, + use_builtin_types: bool = False, *, headers: Iterable[tuple[str, str]] = ..., - context: Any | None = ..., + context: Any | None = None, ) -> None: ... else: - def __init__(self, use_datetime: bool = ..., use_builtin_types: bool = ..., *, context: Any | None = ...) -> None: ... + def __init__( + self, use_datetime: bool = False, use_builtin_types: bool = False, *, context: Any | None = None + ) -> None: ... def make_connection(self, host: _HostType) -> http.client.HTTPSConnection: ... class ServerProxy: - __host: str __handler: str __transport: Transport @@ -274,28 +281,28 @@ class ServerProxy: def __init__( self, uri: str, - transport: Transport | None = ..., - encoding: str | None = ..., - verbose: bool = ..., - allow_none: bool = ..., - use_datetime: bool = ..., - use_builtin_types: bool = ..., + transport: Transport | None = None, + encoding: str | None = None, + verbose: bool = False, + allow_none: bool = False, + use_datetime: bool = False, + use_builtin_types: bool = False, *, headers: Iterable[tuple[str, str]] = ..., - context: Any | None = ..., + context: Any | None = None, ) -> None: ... else: def __init__( self, uri: str, - transport: Transport | None = ..., - encoding: str | None = ..., - verbose: bool = ..., - allow_none: bool = ..., - use_datetime: bool = ..., - use_builtin_types: bool = ..., + transport: Transport | None = None, + encoding: str | None = None, + verbose: bool = False, + allow_none: bool = False, + use_datetime: bool = False, + use_builtin_types: bool = False, *, - context: Any | None = ..., + context: Any | None = None, ) -> None: ... def __getattr__(self, name: str) -> _Method: ... @@ -305,7 +312,7 @@ class ServerProxy: def __call__(self, attr: Literal["transport"]) -> Transport: ... @overload def __call__(self, attr: str) -> Callable[[], None] | Transport: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/xmlrpc/server.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/xmlrpc/server.pyi index e4fc30034..800c20551 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/xmlrpc/server.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/xmlrpc/server.pyi @@ -2,14 +2,10 @@ import http.server import pydoc import socketserver from collections.abc import Callable, Iterable, Mapping -from datetime import datetime from re import Pattern from typing import Any, ClassVar, Protocol from typing_extensions import TypeAlias -from xmlrpc.client import Fault - -# TODO: Recursive type on tuple, list, dict -_Marshallable: TypeAlias = None | bool | int | float | str | bytes | tuple[Any, ...] | list[Any] | dict[Any, Any] | datetime +from xmlrpc.client import Fault, _Marshallable # The dispatch accepts anywhere from 0 to N arguments, no easy way to allow this in mypy class _DispatchArity0(Protocol): @@ -36,26 +32,25 @@ _DispatchProtocol: TypeAlias = ( _DispatchArity0 | _DispatchArity1 | _DispatchArity2 | _DispatchArity3 | _DispatchArity4 | _DispatchArityN ) -def resolve_dotted_attribute(obj: Any, attr: str, allow_dotted_names: bool = ...) -> Any: ... # undocumented +def resolve_dotted_attribute(obj: Any, attr: str, allow_dotted_names: bool = True) -> Any: ... # undocumented def list_public_methods(obj: Any) -> list[str]: ... # undocumented class SimpleXMLRPCDispatcher: # undocumented - funcs: dict[str, _DispatchProtocol] instance: Any | None allow_none: bool encoding: str use_builtin_types: bool - def __init__(self, allow_none: bool = ..., encoding: str | None = ..., use_builtin_types: bool = ...) -> None: ... - def register_instance(self, instance: Any, allow_dotted_names: bool = ...) -> None: ... - def register_function(self, function: _DispatchProtocol | None = ..., name: str | None = ...) -> Callable[..., Any]: ... + def __init__(self, allow_none: bool = False, encoding: str | None = None, use_builtin_types: bool = False) -> None: ... + def register_instance(self, instance: Any, allow_dotted_names: bool = False) -> None: ... + def register_function(self, function: _DispatchProtocol | None = None, name: str | None = None) -> Callable[..., Any]: ... def register_introspection_functions(self) -> None: ... def register_multicall_functions(self) -> None: ... def _marshaled_dispatch( self, data: str, - dispatch_method: Callable[[str | None, tuple[_Marshallable, ...]], Fault | tuple[_Marshallable, ...]] | None = ..., - path: Any | None = ..., + dispatch_method: Callable[[str | None, tuple[_Marshallable, ...]], Fault | tuple[_Marshallable, ...]] | None = None, + path: Any | None = None, ) -> str: ... # undocumented def system_listMethods(self) -> list[str]: ... # undocumented def system_methodSignature(self, method_name: str) -> str: ... # undocumented @@ -72,72 +67,58 @@ class SimpleXMLRPCRequestHandler(http.server.BaseHTTPRequestHandler): def do_POST(self) -> None: ... def decode_request_content(self, data: bytes) -> bytes | None: ... def report_404(self) -> None: ... - def log_request(self, code: int | str = ..., size: int | str = ...) -> None: ... class SimpleXMLRPCServer(socketserver.TCPServer, SimpleXMLRPCDispatcher): - - allow_reuse_address: bool _send_traceback_handler: bool def __init__( self, addr: tuple[str, int], requestHandler: type[SimpleXMLRPCRequestHandler] = ..., - logRequests: bool = ..., - allow_none: bool = ..., - encoding: str | None = ..., - bind_and_activate: bool = ..., - use_builtin_types: bool = ..., + logRequests: bool = True, + allow_none: bool = False, + encoding: str | None = None, + bind_and_activate: bool = True, + use_builtin_types: bool = False, ) -> None: ... class MultiPathXMLRPCServer(SimpleXMLRPCServer): # undocumented - dispatchers: dict[str, SimpleXMLRPCDispatcher] - allow_none: bool - encoding: str def __init__( self, addr: tuple[str, int], requestHandler: type[SimpleXMLRPCRequestHandler] = ..., - logRequests: bool = ..., - allow_none: bool = ..., - encoding: str | None = ..., - bind_and_activate: bool = ..., - use_builtin_types: bool = ..., + logRequests: bool = True, + allow_none: bool = False, + encoding: str | None = None, + bind_and_activate: bool = True, + use_builtin_types: bool = False, ) -> None: ... def add_dispatcher(self, path: str, dispatcher: SimpleXMLRPCDispatcher) -> SimpleXMLRPCDispatcher: ... def get_dispatcher(self, path: str) -> SimpleXMLRPCDispatcher: ... - def _marshaled_dispatch( - self, - data: str, - dispatch_method: Callable[[str | None, tuple[_Marshallable, ...]], Fault | tuple[_Marshallable, ...]] | None = ..., - path: Any | None = ..., - ) -> str: ... class CGIXMLRPCRequestHandler(SimpleXMLRPCDispatcher): - def __init__(self, allow_none: bool = ..., encoding: str | None = ..., use_builtin_types: bool = ...) -> None: ... + def __init__(self, allow_none: bool = False, encoding: str | None = None, use_builtin_types: bool = False) -> None: ... def handle_xmlrpc(self, request_text: str) -> None: ... def handle_get(self) -> None: ... - def handle_request(self, request_text: str | None = ...) -> None: ... + def handle_request(self, request_text: str | None = None) -> None: ... class ServerHTMLDoc(pydoc.HTMLDoc): # undocumented def docroutine( # type: ignore[override] self, object: object, name: str, - mod: str | None = ..., + mod: str | None = None, funcs: Mapping[str, str] = ..., classes: Mapping[str, str] = ..., methods: Mapping[str, str] = ..., - cl: type | None = ..., + cl: type | None = None, ) -> str: ... def docserver(self, server_name: str, package_documentation: str, methods: dict[str, str]) -> str: ... class XMLRPCDocGenerator: # undocumented - server_name: str server_documentation: str server_title: str - def __init__(self) -> None: ... def set_server_title(self, server_title: str) -> None: ... def set_server_name(self, server_name: str) -> None: ... def set_server_documentation(self, server_documentation: str) -> None: ... @@ -151,11 +132,11 @@ class DocXMLRPCServer(SimpleXMLRPCServer, XMLRPCDocGenerator): self, addr: tuple[str, int], requestHandler: type[SimpleXMLRPCRequestHandler] = ..., - logRequests: bool = ..., - allow_none: bool = ..., - encoding: str | None = ..., - bind_and_activate: bool = ..., - use_builtin_types: bool = ..., + logRequests: bool = True, + allow_none: bool = False, + encoding: str | None = None, + bind_and_activate: bool = True, + use_builtin_types: bool = False, ) -> None: ... class DocCGIXMLRPCRequestHandler(CGIXMLRPCRequestHandler, XMLRPCDocGenerator): diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/zipapp.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/zipapp.pyi index 3363161c3..c7cf1704b 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/zipapp.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/zipapp.pyi @@ -11,10 +11,10 @@ class ZipAppError(ValueError): ... def create_archive( source: _Path, - target: _Path | None = ..., - interpreter: str | None = ..., - main: str | None = ..., - filter: Callable[[Path], bool] | None = ..., - compressed: bool = ..., + target: _Path | None = None, + interpreter: str | None = None, + main: str | None = None, + filter: Callable[[Path], bool] | None = None, + compressed: bool = False, ) -> None: ... def get_interpreter(archive: _Path) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/zipfile.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/zipfile.pyi index da1710787..b969d0cf9 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/zipfile.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/zipfile.pyi @@ -1,11 +1,11 @@ import io import sys -from _typeshed import Self, StrOrBytesPath, StrPath +from _typeshed import StrOrBytesPath, StrPath, _BufferWithLen from collections.abc import Callable, Iterable, Iterator from os import PathLike from types import TracebackType from typing import IO, Any, Protocol, overload -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal, Self, TypeAlias __all__ = [ "BadZipFile", @@ -70,7 +70,7 @@ class ZipExtFile(io.BufferedIOBase): fileobj: _ClosableZipStream, mode: _ReadWriteMode, zipinfo: ZipInfo, - pwd: bytes | None = ..., + pwd: bytes | None = None, *, close_fileobj: Literal[True], ) -> None: ... @@ -80,14 +80,14 @@ class ZipExtFile(io.BufferedIOBase): fileobj: _ZipStream, mode: _ReadWriteMode, zipinfo: ZipInfo, - pwd: bytes | None = ..., - close_fileobj: Literal[False] = ..., + pwd: bytes | None = None, + close_fileobj: Literal[False] = False, ) -> None: ... - def read(self, n: int | None = ...) -> bytes: ... - def readline(self, limit: int = ...) -> bytes: ... # type: ignore[override] - def peek(self, n: int = ...) -> bytes: ... + def read(self, n: int | None = -1) -> bytes: ... + def readline(self, limit: int = -1) -> bytes: ... # type: ignore[override] + def peek(self, n: int = 1) -> bytes: ... def read1(self, n: int | None) -> bytes: ... # type: ignore[override] - def seek(self, offset: int, whence: int = ...) -> int: ... + def seek(self, offset: int, whence: int = 0) -> int: ... class _Writer(Protocol): def write(self, __s: str) -> object: ... @@ -103,54 +103,54 @@ class ZipFile: compression: int # undocumented compresslevel: int | None # undocumented mode: _ZipFileMode # undocumented - pwd: str | None # undocumented + pwd: bytes | None # undocumented if sys.version_info >= (3, 11): @overload def __init__( self, file: StrPath | IO[bytes], - mode: Literal["r"] = ..., - compression: int = ..., - allowZip64: bool = ..., - compresslevel: int | None = ..., + mode: Literal["r"] = "r", + compression: int = 0, + allowZip64: bool = True, + compresslevel: int | None = None, *, - strict_timestamps: bool = ..., + strict_timestamps: bool = True, metadata_encoding: str | None, ) -> None: ... @overload def __init__( self, file: StrPath | IO[bytes], - mode: _ZipFileMode = ..., - compression: int = ..., - allowZip64: bool = ..., - compresslevel: int | None = ..., + mode: _ZipFileMode = "r", + compression: int = 0, + allowZip64: bool = True, + compresslevel: int | None = None, *, - strict_timestamps: bool = ..., - metadata_encoding: None = ..., + strict_timestamps: bool = True, + metadata_encoding: None = None, ) -> None: ... elif sys.version_info >= (3, 8): def __init__( self, file: StrPath | IO[bytes], - mode: _ZipFileMode = ..., - compression: int = ..., - allowZip64: bool = ..., - compresslevel: int | None = ..., + mode: _ZipFileMode = "r", + compression: int = 0, + allowZip64: bool = True, + compresslevel: int | None = None, *, - strict_timestamps: bool = ..., + strict_timestamps: bool = True, ) -> None: ... else: def __init__( self, file: StrPath | IO[bytes], - mode: _ZipFileMode = ..., - compression: int = ..., - allowZip64: bool = ..., - compresslevel: int | None = ..., + mode: _ZipFileMode = "r", + compression: int = 0, + allowZip64: bool = True, + compresslevel: int | None = None, ) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, type: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None ) -> None: ... @@ -159,30 +159,38 @@ class ZipFile: def infolist(self) -> list[ZipInfo]: ... def namelist(self) -> list[str]: ... def open( - self, name: str | ZipInfo, mode: _ReadWriteMode = ..., pwd: bytes | None = ..., *, force_zip64: bool = ... + self, name: str | ZipInfo, mode: _ReadWriteMode = "r", pwd: bytes | None = None, *, force_zip64: bool = False ) -> IO[bytes]: ... - def extract(self, member: str | ZipInfo, path: StrPath | None = ..., pwd: bytes | None = ...) -> str: ... + def extract(self, member: str | ZipInfo, path: StrPath | None = None, pwd: bytes | None = None) -> str: ... def extractall( - self, path: StrPath | None = ..., members: Iterable[str | ZipInfo] | None = ..., pwd: bytes | None = ... + self, path: StrPath | None = None, members: Iterable[str | ZipInfo] | None = None, pwd: bytes | None = None ) -> None: ... - def printdir(self, file: _Writer | None = ...) -> None: ... + def printdir(self, file: _Writer | None = None) -> None: ... def setpassword(self, pwd: bytes) -> None: ... - def read(self, name: str | ZipInfo, pwd: bytes | None = ...) -> bytes: ... + def read(self, name: str | ZipInfo, pwd: bytes | None = None) -> bytes: ... def testzip(self) -> str | None: ... def write( - self, filename: StrPath, arcname: StrPath | None = ..., compress_type: int | None = ..., compresslevel: int | None = ... + self, + filename: StrPath, + arcname: StrPath | None = None, + compress_type: int | None = None, + compresslevel: int | None = None, ) -> None: ... def writestr( - self, zinfo_or_arcname: str | ZipInfo, data: bytes | str, compress_type: int | None = ..., compresslevel: int | None = ... + self, + zinfo_or_arcname: str | ZipInfo, + data: _BufferWithLen | str, + compress_type: int | None = None, + compresslevel: int | None = None, ) -> None: ... if sys.version_info >= (3, 11): - def mkdir(self, zinfo_or_directory_name: str | ZipInfo, mode: int = ...) -> None: ... + def mkdir(self, zinfo_or_directory_name: str | ZipInfo, mode: int = 0o777) -> None: ... class PyZipFile(ZipFile): def __init__( - self, file: str | IO[bytes], mode: _ZipFileMode = ..., compression: int = ..., allowZip64: bool = ..., optimize: int = ... + self, file: str | IO[bytes], mode: _ZipFileMode = "r", compression: int = 0, allowZip64: bool = True, optimize: int = -1 ) -> None: ... - def writepy(self, pathname: str, basename: str = ..., filterfunc: Callable[[str], bool] | None = ...) -> None: ... + def writepy(self, pathname: str, basename: str = "", filterfunc: Callable[[str], bool] | None = None) -> None: ... class ZipInfo: filename: str @@ -203,18 +211,16 @@ class ZipInfo: compress_size: int file_size: int orig_filename: str # undocumented - def __init__(self, filename: str = ..., date_time: _DateTuple = ...) -> None: ... + def __init__(self, filename: str = "NoName", date_time: _DateTuple = ...) -> None: ... if sys.version_info >= (3, 8): @classmethod - def from_file( - cls: type[Self], filename: StrPath, arcname: StrPath | None = ..., *, strict_timestamps: bool = ... - ) -> Self: ... + def from_file(cls, filename: StrPath, arcname: StrPath | None = None, *, strict_timestamps: bool = True) -> Self: ... else: @classmethod - def from_file(cls: type[Self], filename: StrPath, arcname: StrPath | None = ...) -> Self: ... + def from_file(cls, filename: StrPath, arcname: StrPath | None = None) -> Self: ... def is_dir(self) -> bool: ... - def FileHeader(self, zip64: bool | None = ...) -> bytes: ... + def FileHeader(self, zip64: bool | None = None) -> bytes: ... class _PathOpenProtocol(Protocol): def __call__(self, mode: _ReadWriteMode = ..., pwd: bytes | None = ..., *, force_zip64: bool = ...) -> IO[bytes]: ... @@ -236,9 +242,11 @@ if sys.version_info >= (3, 8): @property def stem(self) -> str: ... - def __init__(self, root: ZipFile | StrPath | IO[bytes], at: str = ...) -> None: ... + def __init__(self, root: ZipFile | StrPath | IO[bytes], at: str = "") -> None: ... if sys.version_info >= (3, 9): - def open(self, mode: _ReadWriteBinaryMode = ..., *args: Any, pwd: bytes | None = ..., **kwargs: Any) -> IO[bytes]: ... + def open( + self, mode: _ReadWriteBinaryMode = "r", *args: Any, pwd: bytes | None = None, **kwargs: Any + ) -> IO[bytes]: ... else: @property def open(self) -> _PathOpenProtocol: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/zipimport.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/zipimport.pyi index db0654413..ee97faace 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/zipimport.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/zipimport.pyi @@ -1,9 +1,8 @@ -import os import sys +from _typeshed import StrOrBytesPath from importlib.abc import ResourceReader from importlib.machinery import ModuleSpec from types import CodeType, ModuleType -from typing import Any if sys.version_info >= (3, 8): __all__ = ["ZipImportError", "zipimporter"] @@ -13,16 +12,20 @@ class ZipImportError(ImportError): ... class zipimporter: archive: str prefix: str - def __init__(self, path: str | bytes | os.PathLike[Any]) -> None: ... - def find_loader(self, fullname: str, path: str | None = ...) -> tuple[zipimporter | None, list[str]]: ... # undocumented - def find_module(self, fullname: str, path: str | None = ...) -> zipimporter | None: ... + if sys.version_info >= (3, 11): + def __init__(self, path: str) -> None: ... + else: + def __init__(self, path: StrOrBytesPath) -> None: ... + + def find_loader(self, fullname: str, path: str | None = None) -> tuple[zipimporter | None, list[str]]: ... # undocumented + def find_module(self, fullname: str, path: str | None = None) -> zipimporter | None: ... def get_code(self, fullname: str) -> CodeType: ... - def get_data(self, pathname: str) -> str: ... + def get_data(self, pathname: str) -> bytes: ... def get_filename(self, fullname: str) -> str: ... def get_resource_reader(self, fullname: str) -> ResourceReader | None: ... # undocumented def get_source(self, fullname: str) -> str | None: ... def is_package(self, fullname: str) -> bool: ... def load_module(self, fullname: str) -> ModuleType: ... if sys.version_info >= (3, 10): - def find_spec(self, fullname: str, target: ModuleType | None = ...) -> ModuleSpec | None: ... + def find_spec(self, fullname: str, target: ModuleType | None = None) -> ModuleSpec | None: ... def invalidate_caches(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/zlib.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/zlib.pyi index cfd6784bb..c3419af0d 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/zlib.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/zlib.pyi @@ -1,6 +1,5 @@ import sys -from array import array -from typing import Any +from _typeshed import ReadableBuffer from typing_extensions import Literal DEFLATED: Literal[8] @@ -29,7 +28,7 @@ Z_TREES: Literal[6] class error(Exception): ... class _Compress: - def compress(self, data: bytes) -> bytes: ... + def compress(self, data: ReadableBuffer) -> bytes: ... def flush(self, mode: int = ...) -> bytes: ... def copy(self) -> _Compress: ... @@ -37,21 +36,21 @@ class _Decompress: unused_data: bytes unconsumed_tail: bytes eof: bool - def decompress(self, data: bytes, max_length: int = ...) -> bytes: ... + def decompress(self, data: ReadableBuffer, max_length: int = ...) -> bytes: ... def flush(self, length: int = ...) -> bytes: ... def copy(self) -> _Decompress: ... -def adler32(__data: bytes, __value: int = ...) -> int: ... +def adler32(__data: ReadableBuffer, __value: int = 1) -> int: ... if sys.version_info >= (3, 11): - def compress(__data: bytes, level: int = ..., wbits: int = ...) -> bytes: ... + def compress(__data: ReadableBuffer, level: int = -1, wbits: int = 15) -> bytes: ... else: - def compress(__data: bytes, level: int = ...) -> bytes: ... + def compress(__data: ReadableBuffer, level: int = -1) -> bytes: ... def compressobj( - level: int = ..., method: int = ..., wbits: int = ..., memLevel: int = ..., strategy: int = ..., zdict: bytes | None = ... + level: int = -1, method: int = 8, wbits: int = 15, memLevel: int = 8, strategy: int = 0, zdict: ReadableBuffer | None = None ) -> _Compress: ... -def crc32(__data: array[Any] | bytes, __value: int = ...) -> int: ... -def decompress(__data: bytes, wbits: int = ..., bufsize: int = ...) -> bytes: ... -def decompressobj(wbits: int = ..., zdict: bytes = ...) -> _Decompress: ... +def crc32(__data: ReadableBuffer, __value: int = 0) -> int: ... +def decompress(__data: ReadableBuffer, wbits: int = 15, bufsize: int = 16384) -> bytes: ... +def decompressobj(wbits: int = 15, zdict: ReadableBuffer = b"") -> _Decompress: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/zoneinfo/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/zoneinfo/__init__.pyi index 1a0760862..fe994be3e 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/zoneinfo/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/zoneinfo/__init__.pyi @@ -1,7 +1,8 @@ -from _typeshed import Self, StrPath +from _typeshed import StrPath from collections.abc import Iterable, Sequence -from datetime import tzinfo +from datetime import datetime, timedelta, tzinfo from typing import Any, Protocol +from typing_extensions import Self __all__ = ["ZoneInfo", "reset_tzpath", "available_timezones", "TZPATH", "ZoneInfoNotFoundError", "InvalidTZPathWarning"] @@ -14,16 +15,19 @@ class ZoneInfo(tzinfo): def key(self) -> str: ... def __init__(self, key: str) -> None: ... @classmethod - def no_cache(cls: type[Self], key: str) -> Self: ... + def no_cache(cls, key: str) -> Self: ... @classmethod - def from_file(cls: type[Self], __fobj: _IOBytes, key: str | None = ...) -> Self: ... + def from_file(cls, __fobj: _IOBytes, key: str | None = ...) -> Self: ... @classmethod - def clear_cache(cls, *, only_keys: Iterable[str] = ...) -> None: ... + def clear_cache(cls, *, only_keys: Iterable[str] | None = ...) -> None: ... + def tzname(self, __dt: datetime | None) -> str | None: ... + def utcoffset(self, __dt: datetime | None) -> timedelta | None: ... + def dst(self, __dt: datetime | None) -> timedelta | None: ... # Note: Both here and in clear_cache, the types allow the use of `str` where # a sequence of strings is required. This should be remedied if a solution # to this typing bug is found: https://github.com/python/typing/issues/256 -def reset_tzpath(to: Sequence[StrPath] | None = ...) -> None: ... +def reset_tzpath(to: Sequence[StrPath] | None = None) -> None: ... def available_timezones() -> set[str]: ... TZPATH: Sequence[str] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/D3DShot/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/D3DShot/METADATA.toml new file mode 100644 index 000000000..2d07bb359 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/D3DShot/METADATA.toml @@ -0,0 +1,9 @@ +version = "0.1.*" +requires = ["types-Pillow"] + +[tool.stubtest] +ignore_missing_stub = true +# TODO: figure out how to run stubtest for this package +# (the package pins Pillow in a problematic way) +skip = true +platforms = ["win32"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/D3DShot/d3dshot/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/D3DShot/d3dshot/__init__.pyi new file mode 100644 index 000000000..17f1dd8e9 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/D3DShot/d3dshot/__init__.pyi @@ -0,0 +1,12 @@ +from d3dshot.capture_output import CaptureOutputs as CaptureOutputs +from d3dshot.d3dshot import D3DShot as D3DShot + +pil_is_available: bool +numpy_is_available: bool +pytorch_is_available: bool +pytorch_gpu_is_available: bool +capture_output_mapping: dict[str, CaptureOutputs] +capture_outputs: list[str] + +def determine_available_capture_outputs() -> list[CaptureOutputs]: ... +def create(capture_output: str = ..., frame_buffer_size: int = ...) -> D3DShot: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/D3DShot/d3dshot/capture_output.pyi b/packages/pyright-internal/typeshed-fallback/stubs/D3DShot/d3dshot/capture_output.pyi new file mode 100644 index 000000000..0fc75136e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/D3DShot/d3dshot/capture_output.pyi @@ -0,0 +1,42 @@ +import enum +from _typeshed import Incomplete +from collections.abc import Sequence +from ctypes import _CVoidConstPLike +from typing_extensions import Literal, TypeAlias + +from PIL import Image + +_Frame: TypeAlias = Image.Image | Incomplete +# stub_uploader doesn't allow numpy and torch because D3DShot doesn't declare it as a dependency +# from torch import Tensor +# import numpy.typing as npt +# _Frame: TypeAlias = Image.Image | npt.NDArray[np.int32] | npt.NDArray[np.float32] | Tensor + +class CaptureOutputs(enum.Enum): + PIL: int + NUMPY: int + NUMPY_FLOAT: int + PYTORCH: int + PYTORCH_FLOAT: int + PYTORCH_GPU: int + PYTORCH_FLOAT_GPU: int + +class CaptureOutputError(BaseException): ... + +# All CaptureOutput methods just reference the backend. Making this both a base class and a wrapper. +class CaptureOutput: + # `backend` is a subclass of CaptureOutput based on the CaptureOutputs enum passed to __init__ + backend: CaptureOutput + def __init__(self, backend: CaptureOutputs = ...) -> None: ... + def process( + self, + pointer: _CVoidConstPLike, + pitch: int, + size: int, + width: int, + height: int, + region: tuple[int, int, int, int], + rotation: int, + ) -> _Frame: ... + def to_pil(self, frame: _Frame) -> Image.Image: ... + def stack(self, frames: Sequence[_Frame], stack_dimension: Literal["first", "last"]) -> _Frame: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/D3DShot/d3dshot/capture_outputs/__init__.pyi similarity index 100% rename from packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/__init__.pyi rename to packages/pyright-internal/typeshed-fallback/stubs/D3DShot/d3dshot/capture_outputs/__init__.pyi diff --git a/packages/pyright-internal/typeshed-fallback/stubs/D3DShot/d3dshot/capture_outputs/numpy_capture_output.pyi b/packages/pyright-internal/typeshed-fallback/stubs/D3DShot/d3dshot/capture_outputs/numpy_capture_output.pyi new file mode 100644 index 000000000..0aec1bc85 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/D3DShot/d3dshot/capture_outputs/numpy_capture_output.pyi @@ -0,0 +1,28 @@ +from _typeshed import Incomplete +from collections.abc import Sequence +from ctypes import _CVoidConstPLike +from typing_extensions import Literal, TypeAlias + +from d3dshot.capture_output import CaptureOutput +from PIL import Image + +# stub_uploader doesn't allow numpy because D3DShot doesn't declare it as a dependency +# import numpy as np +# import numpy.typing as npt +# _NDArray: TypeAlias = npt.NDArray[np.int32] +_NDArray: TypeAlias = Incomplete + +class NumpyCaptureOutput(CaptureOutput): + def __init__(self) -> None: ... + def process( + self, + pointer: _CVoidConstPLike, + pitch: int, + size: int, + width: int, + height: int, + region: tuple[int, int, int, int], + rotation: int, + ) -> _NDArray: ... + def to_pil(self, frame: _NDArray) -> Image.Image: ... + def stack(self, frames: Sequence[_NDArray] | _NDArray, stack_dimension: Literal["first", "last"]) -> _NDArray: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/D3DShot/d3dshot/capture_outputs/numpy_float_capture_output.pyi b/packages/pyright-internal/typeshed-fallback/stubs/D3DShot/d3dshot/capture_outputs/numpy_float_capture_output.pyi new file mode 100644 index 000000000..2bf3331d4 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/D3DShot/d3dshot/capture_outputs/numpy_float_capture_output.pyi @@ -0,0 +1,5 @@ +from d3dshot.capture_outputs.numpy_capture_output import NumpyCaptureOutput + +# stub_uploader doesn't allow numpy because D3DShot doesn't declare it as a dependency +# this CaptureOutput should be float based +class NumpyFloatCaptureOutput(NumpyCaptureOutput): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/D3DShot/d3dshot/capture_outputs/pil_capture_output.pyi b/packages/pyright-internal/typeshed-fallback/stubs/D3DShot/d3dshot/capture_outputs/pil_capture_output.pyi new file mode 100644 index 000000000..d1e2c8782 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/D3DShot/d3dshot/capture_outputs/pil_capture_output.pyi @@ -0,0 +1,24 @@ +from _typeshed import Unused +from collections.abc import Sequence +from ctypes import _CVoidConstPLike +from typing import TypeVar + +from d3dshot.capture_output import CaptureOutput +from PIL import Image + +_ImageT = TypeVar("_ImageT", bound=Image.Image) + +class PILCaptureOutput(CaptureOutput): + def __init__(self) -> None: ... + def process( + self, + pointer: _CVoidConstPLike, + pitch: int, + size: int, + width: int, + height: int, + region: tuple[int, int, int, int], + rotation: int, + ) -> Image.Image: ... + def to_pil(self, frame: _ImageT) -> _ImageT: ... + def stack(self, frames: Sequence[_ImageT], stack_dimension: Unused) -> Sequence[_ImageT]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/D3DShot/d3dshot/capture_outputs/pytorch_capture_output.pyi b/packages/pyright-internal/typeshed-fallback/stubs/D3DShot/d3dshot/capture_outputs/pytorch_capture_output.pyi new file mode 100644 index 000000000..9fc7df7e3 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/D3DShot/d3dshot/capture_outputs/pytorch_capture_output.pyi @@ -0,0 +1,26 @@ +from _typeshed import Incomplete +from collections.abc import Sequence +from ctypes import _CVoidConstPLike +from typing_extensions import Literal, TypeAlias + +from d3dshot.capture_output import CaptureOutput +from PIL import Image + +# stub_uploader doesn't allow torch because D3DShot doesn't declare it as a dependency +# from torch import Tensor +_Tensor: TypeAlias = Incomplete + +class PytorchCaptureOutput(CaptureOutput): + def __init__(self) -> None: ... + def process( + self, + pointer: _CVoidConstPLike, + pitch: int, + size: int, + width: int, + height: int, + region: tuple[int, int, int, int], + rotation: int, + ) -> _Tensor: ... + def to_pil(self, frame: _Tensor) -> Image.Image: ... + def stack(self, frames: Sequence[_Tensor], stack_dimension: Literal["first", "last"]) -> _Tensor: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/D3DShot/d3dshot/capture_outputs/pytorch_float_capture_output.pyi b/packages/pyright-internal/typeshed-fallback/stubs/D3DShot/d3dshot/capture_outputs/pytorch_float_capture_output.pyi new file mode 100644 index 000000000..53e7a73d7 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/D3DShot/d3dshot/capture_outputs/pytorch_float_capture_output.pyi @@ -0,0 +1,3 @@ +from d3dshot.capture_outputs.pytorch_capture_output import PytorchCaptureOutput + +class PytorchFloatCaptureOutput(PytorchCaptureOutput): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/D3DShot/d3dshot/capture_outputs/pytorch_float_gpu_capture_output.pyi b/packages/pyright-internal/typeshed-fallback/stubs/D3DShot/d3dshot/capture_outputs/pytorch_float_gpu_capture_output.pyi new file mode 100644 index 000000000..2e7c6c105 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/D3DShot/d3dshot/capture_outputs/pytorch_float_gpu_capture_output.pyi @@ -0,0 +1,3 @@ +from d3dshot.capture_outputs.pytorch_gpu_capture_output import PytorchGPUCaptureOutput + +class PytorchFloatGPUCaptureOutput(PytorchGPUCaptureOutput): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/D3DShot/d3dshot/capture_outputs/pytorch_gpu_capture_output.pyi b/packages/pyright-internal/typeshed-fallback/stubs/D3DShot/d3dshot/capture_outputs/pytorch_gpu_capture_output.pyi new file mode 100644 index 000000000..d78cc60eb --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/D3DShot/d3dshot/capture_outputs/pytorch_gpu_capture_output.pyi @@ -0,0 +1,3 @@ +from d3dshot.capture_outputs.pytorch_capture_output import PytorchCaptureOutput + +class PytorchGPUCaptureOutput(PytorchCaptureOutput): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/D3DShot/d3dshot/d3dshot.pyi b/packages/pyright-internal/typeshed-fallback/stubs/D3DShot/d3dshot/d3dshot.pyi new file mode 100644 index 000000000..5424517ee --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/D3DShot/d3dshot/d3dshot.pyi @@ -0,0 +1,45 @@ +from collections import deque +from collections.abc import Iterable + +from d3dshot.capture_output import CaptureOutput as CaptureOutput, CaptureOutputs as CaptureOutputs, _Frame +from d3dshot.display import Display as Display + +class Singleton(type): ... + +class D3DShot(metaclass=Singleton): + displays: list[Display] + display: Display + capture_output: CaptureOutput + frame_buffer_size: int + frame_buffer: deque[_Frame] + previous_screenshot: _Frame | None + region: tuple[int, int, int, int] | None + + def __init__( + self, + capture_output: CaptureOutputs = ..., + frame_buffer_size: int = ..., + pil_is_available: bool = ..., + numpy_is_available: bool = ..., + pytorch_is_available: bool = ..., + pytorch_gpu_is_available: bool = ..., + ) -> None: ... + @property + def is_capturing(self) -> bool: ... + def get_latest_frame(self) -> _Frame | None: ... + def get_frame(self, frame_index: int) -> _Frame | None: ... + def get_frames(self, frame_indices: Iterable[int]) -> list[_Frame]: ... + def get_frame_stack(self, frame_indices: Iterable[int], stack_dimension: str | None = ...) -> _Frame: ... + def screenshot(self, region: tuple[int, int, int, int] | None = ...) -> _Frame | None: ... + def screenshot_to_disk( + self, directory: str | None = ..., file_name: str | None = ..., region: tuple[int, int, int, int] | None = ... + ) -> str: ... + def frame_buffer_to_disk(self, directory: str | None = ...) -> None: ... + def capture(self, target_fps: int = ..., region: tuple[int, int, int, int] | None = ...) -> bool: ... + def screenshot_every(self, interval: float, region: tuple[int, int, int, int] | None = ...) -> bool: ... + def screenshot_to_disk_every( + self, interval: float, directory: str | None = ..., region: tuple[int, int, int, int] | None = ... + ) -> bool: ... + def stop(self) -> bool: ... + def benchmark(self) -> None: ... + def detect_displays(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/D3DShot/d3dshot/display.pyi b/packages/pyright-internal/typeshed-fallback/stubs/D3DShot/d3dshot/display.pyi new file mode 100644 index 000000000..fb30dd2b5 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/D3DShot/d3dshot/display.pyi @@ -0,0 +1,49 @@ +from ctypes import _Pointer +from typing_extensions import TypedDict + +from d3dshot.dll import _ProcessFunc, _ProcessFuncRegionArg, _ProcessFuncReturn +from d3dshot.dll.d3d import ID3D11Device, ID3D11DeviceContext +from d3dshot.dll.dxgi import IDXGIAdapter, IDXGIOutput1, IDXGIOutputDuplication + +class _PositionDict(TypedDict): + left: int + top: int + right: int + bottom: int + +class Display: + name: str + adapter_name: str + resolution: tuple[int, int] + position: _PositionDict + rotation: int + scale_factor: float + is_primary: bool + hmonitor: int + dxgi_output: IDXGIOutput1 | None + dxgi_adapter: _Pointer[IDXGIAdapter] | None + # Note that Display.d3d_device and Display.d3d_device_context can never be None. + # Despite initially being set to None in __init__, + # they're always immediately set in _initialize_dxgi_output_duplication() + d3d_device: ID3D11Device + d3d_device_context: ID3D11DeviceContext + dxgi_output_duplication: _Pointer[IDXGIOutputDuplication] + + def __init__( + self, + name: str | None = ..., + adapter_name: str | None = ..., + resolution: tuple[int, int] | None = ..., + position: _PositionDict | None = ..., + rotation: int | None = ..., + scale_factor: float | None = ..., + is_primary: bool = ..., + hmonitor: int | None = ..., + dxgi_output: IDXGIOutput1 | None = ..., + dxgi_adapter: _Pointer[IDXGIAdapter] | None = ..., + ) -> None: ... + def capture( + self, process_func: _ProcessFunc[_ProcessFuncRegionArg, _ProcessFuncReturn] | None, region: _ProcessFuncRegionArg = ... + ) -> _ProcessFuncReturn: ... + @classmethod + def discover_displays(cls) -> list[Display]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/D3DShot/d3dshot/dll/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/D3DShot/d3dshot/dll/__init__.pyi new file mode 100644 index 000000000..82dc9b18b --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/D3DShot/d3dshot/dll/__init__.pyi @@ -0,0 +1,28 @@ +import sys +from _typeshed import Incomplete +from collections.abc import Callable +from ctypes import _CData, c_ulong +from ctypes.wintypes import PFLOAT +from typing import TypeVar +from typing_extensions import TypeAlias + +from d3dshot.capture_output import _Frame + +_ProcessFuncRegionArg = TypeVar("_ProcessFuncRegionArg", tuple[int, int, int, int], None) +_ProcessFuncReturn = TypeVar("_ProcessFuncReturn", _Frame, None) +# The _ProcessFunc alias is used in multiple submodules +_ProcessFunc: TypeAlias = Callable[[PFLOAT, int, int, int, int, _ProcessFuncRegionArg, int], _ProcessFuncReturn] # noqa: Y047 + +if sys.platform == "win32": + from ctypes import HRESULT + + _HRESULT: TypeAlias = HRESULT +else: + _HRESULT: TypeAlias = Incomplete + +# comtypes is not typed +# from comtypes import IUnknown +class _IUnknown(_CData): + def QueryInterface(self, interface: type, iid: _CData | None = ...) -> _HRESULT: ... + def AddRef(self) -> c_ulong: ... + def Release(self) -> c_ulong: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/D3DShot/d3dshot/dll/d3d.pyi b/packages/pyright-internal/typeshed-fallback/stubs/D3DShot/d3dshot/dll/d3d.pyi new file mode 100644 index 000000000..e412c2dbb --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/D3DShot/d3dshot/dll/d3d.pyi @@ -0,0 +1,214 @@ +from ctypes import Structure, _Pointer, c_int32, c_uint, c_void_p +from ctypes.wintypes import FLOAT, UINT + +from d3dshot.dll import _HRESULT, _IUnknown +from d3dshot.dll.dxgi import IDXGIAdapter + +class DXGI_SAMPLE_DESC(Structure): + Count: UINT + Quality: UINT + +class D3D11_BOX(Structure): + left: UINT + top: UINT + front: UINT + right: UINT + bottom: UINT + back: UINT + +class D3D11_TEXTURE2D_DESC(Structure): + Width: UINT + Height: UINT + MipLevels: UINT + ArraySize: UINT + Format: UINT + SampleDesc: DXGI_SAMPLE_DESC + Usage: UINT + BindFlags: UINT + CPUAccessFlags: UINT + MiscFlags: UINT + +class ID3D11DeviceChild(_IUnknown): + def GetDevice(self) -> None: ... + def GetPrivateData(self) -> _HRESULT: ... + def SetPrivateData(self) -> _HRESULT: ... + def SetPrivateDataInterface(self) -> _HRESULT: ... + +class ID3D11Resource(ID3D11DeviceChild): + def GetType(self) -> None: ... + def SetEvictionPriority(self) -> None: ... + def GetEvictionPriority(self) -> UINT: ... + +class ID3D11Texture2D(ID3D11Resource): + def GetDesc(self, __pDesc: _Pointer[D3D11_TEXTURE2D_DESC]) -> None: ... + +class ID3D11DeviceContext(ID3D11DeviceChild): + def VSSetConstantBuffers(self) -> None: ... + def PSSetShaderResources(self) -> None: ... + def PSSetShader(self) -> None: ... + def PSSetSamplers(self) -> None: ... + def VSSetShader(self) -> None: ... + def DrawIndexed(self) -> None: ... + def Draw(self) -> None: ... + def Map(self) -> _HRESULT: ... + def Unmap(self) -> None: ... + def PSSetConstantBuffers(self) -> None: ... + def IASetInputLayout(self) -> None: ... + def IASetVertexBuffers(self) -> None: ... + def IASetIndexBuffer(self) -> None: ... + def DrawIndexedInstanced(self) -> None: ... + def DrawInstanced(self) -> None: ... + def GSSetConstantBuffers(self) -> None: ... + def GSSetShader(self) -> None: ... + def IASetPrimitiveTopology(self) -> None: ... + def VSSetShaderResources(self) -> None: ... + def VSSetSamplers(self) -> None: ... + def Begin(self) -> None: ... + def End(self) -> None: ... + def GetData(self) -> _HRESULT: ... + def SetPredication(self) -> None: ... + def GSSetShaderResources(self) -> None: ... + def GSSetSamplers(self) -> None: ... + def OMSetRenderTargets(self) -> None: ... + def OMSetRenderTargetsAndUnorderedAccessViews(self) -> None: ... + def OMSetBlendState(self) -> None: ... + def OMSetDepthStencilState(self) -> None: ... + def SOSetTargets(self) -> None: ... + def DrawAuto(self) -> None: ... + def DrawIndexedInstancedIndirect(self) -> None: ... + def DrawInstancedIndirect(self) -> None: ... + def Dispatch(self) -> None: ... + def DispatchIndirect(self) -> None: ... + def RSSetState(self) -> None: ... + def RSSetViewports(self) -> None: ... + def RSSetScissorRects(self) -> None: ... + def CopySubresourceRegion( + self, + __pDstResource: _Pointer[ID3D11Resource], + __DstSubresource: UINT, + __DstX: UINT, + __DstY: UINT, + __DstZ: UINT, + __pSrcResource: _Pointer[ID3D11Resource], + __SrcSubresource: UINT, + __pSrcBox: _Pointer[D3D11_BOX], + ) -> None: ... + def CopyResource(self, __pDstResource: _Pointer[ID3D11Resource], __pSrcResource: _Pointer[ID3D11Resource]) -> None: ... + def UpdateSubresource(self) -> None: ... + def CopyStructureCount(self) -> None: ... + def ClearRenderTargetView(self) -> None: ... + def ClearUnorderedAccessViewUint(self) -> None: ... + def ClearUnorderedAccessViewFloat(self) -> None: ... + def ClearDepthStencilView(self) -> None: ... + def GenerateMips(self) -> None: ... + def SetResourceMinLOD(self) -> None: ... + def GetResourceMinLOD(self) -> FLOAT: ... + def ResolveSubresource(self) -> None: ... + def ExecuteCommandList(self) -> None: ... + def HSSetShaderResources(self) -> None: ... + def HSSetShader(self) -> None: ... + def HSSetSamplers(self) -> None: ... + def HSSetConstantBuffers(self) -> None: ... + def DSSetShaderResources(self) -> None: ... + def DSSetShader(self) -> None: ... + def DSSetSamplers(self) -> None: ... + def DSSetConstantBuffers(self) -> None: ... + def CSSetShaderResources(self) -> None: ... + def CSSetUnorderedAccessViews(self) -> None: ... + def CSSetShader(self) -> None: ... + def CSSetSamplers(self) -> None: ... + def CSSetConstantBuffers(self) -> None: ... + def VSGetConstantBuffers(self) -> None: ... + def PSGetShaderResources(self) -> None: ... + def PSGetShader(self) -> None: ... + def PSGetSamplers(self) -> None: ... + def VSGetShader(self) -> None: ... + def PSGetConstantBuffers(self) -> None: ... + def IAGetInputLayout(self) -> None: ... + def IAGetVertexBuffers(self) -> None: ... + def IAGetIndexBuffer(self) -> None: ... + def GSGetConstantBuffers(self) -> None: ... + def GSGetShader(self) -> None: ... + def IAGetPrimitiveTopology(self) -> None: ... + def VSGetShaderResources(self) -> None: ... + def VSGetSamplers(self) -> None: ... + def GetPredication(self) -> None: ... + def GSGetShaderResources(self) -> None: ... + def GSGetSamplers(self) -> None: ... + def OMGetRenderTargets(self) -> None: ... + def OMGetRenderTargetsAndUnorderedAccessViews(self) -> None: ... + def OMGetBlendState(self) -> None: ... + def OMGetDepthStencilState(self) -> None: ... + def SOGetTargets(self) -> None: ... + def RSGetState(self) -> None: ... + def RSGetViewports(self) -> None: ... + def RSGetScissorRects(self) -> None: ... + def HSGetShaderResources(self) -> None: ... + def HSGetShader(self) -> None: ... + def HSGetSamplers(self) -> None: ... + def HSGetConstantBuffers(self) -> None: ... + def DSGetShaderResources(self) -> None: ... + def DSGetShader(self) -> None: ... + def DSGetSamplers(self) -> None: ... + def DSGetConstantBuffers(self) -> None: ... + def CSGetShaderResources(self) -> None: ... + def CSGetUnorderedAccessViews(self) -> None: ... + def CSGetShader(self) -> None: ... + def CSGetSamplers(self) -> None: ... + def CSGetConstantBuffers(self) -> None: ... + def ClearState(self) -> None: ... + def Flush(self) -> None: ... + def GetType(self) -> None: ... + def GetContextFlags(self) -> UINT: ... + def FinishCommandList(self) -> _HRESULT: ... + +class ID3D11Device(_IUnknown): + def CreateBuffer(self) -> _HRESULT: ... + def CreateTexture1D(self) -> _HRESULT: ... + def CreateTexture2D( + self, + __pDesc: _Pointer[D3D11_TEXTURE2D_DESC], + __pInitialData: c_void_p, + __ppTexture2D: _Pointer[_Pointer[ID3D11Texture2D]], + ) -> _HRESULT: ... + def CreateTexture3D(self) -> _HRESULT: ... + def CreateShaderResourceView(self) -> _HRESULT: ... + def CreateUnorderedAccessView(self) -> _HRESULT: ... + def CreateRenderTargetView(self) -> _HRESULT: ... + def CreateDepthStencilView(self) -> _HRESULT: ... + def CreateInputLayout(self) -> _HRESULT: ... + def CreateVertexShader(self) -> _HRESULT: ... + def CreateGeometryShader(self) -> _HRESULT: ... + def CreateGeometryShaderWithStreamOutput(self) -> _HRESULT: ... + def CreatePixelShader(self) -> _HRESULT: ... + def CreateHullShader(self) -> _HRESULT: ... + def CreateDomainShader(self) -> _HRESULT: ... + def CreateComputeShader(self) -> _HRESULT: ... + def CreateClassLinkage(self) -> _HRESULT: ... + def CreateBlendState(self) -> _HRESULT: ... + def CreateDepthStencilState(self) -> _HRESULT: ... + def CreateRasterizerState(self) -> _HRESULT: ... + def CreateSamplerState(self) -> _HRESULT: ... + def CreateQuery(self) -> _HRESULT: ... + def CreatePredicate(self) -> _HRESULT: ... + def CreateCounter(self) -> _HRESULT: ... + def CreateDeferredContext(self) -> _HRESULT: ... + def OpenSharedResource(self) -> _HRESULT: ... + def CheckFormatSupport(self) -> _HRESULT: ... + def CheckMultisampleQualityLevels(self) -> _HRESULT: ... + def CheckCounterInfo(self) -> _HRESULT: ... + def CheckCounter(self) -> _HRESULT: ... + def CheckFeatureSupport(self) -> _HRESULT: ... + def GetPrivateData(self) -> _HRESULT: ... + def SetPrivateData(self) -> _HRESULT: ... + def SetPrivateDataInterface(self) -> _HRESULT: ... + def GetFeatureLevel(self) -> c_int32: ... + def GetCreationFlags(self) -> c_uint: ... + def GetDeviceRemovedReason(self) -> _HRESULT: ... + def GetImmediateContext(self, __ppImmediateContext: _Pointer[_Pointer[ID3D11DeviceContext]]) -> None: ... + def SetExceptionMode(self) -> _HRESULT: ... + def GetExceptionMode(self) -> c_uint: ... + +def initialize_d3d_device(dxgi_adapter: _Pointer[IDXGIAdapter]) -> tuple[ID3D11Device, ID3D11DeviceContext]: ... +def describe_d3d11_texture_2d(d3d11_texture_2d: ID3D11Texture2D) -> D3D11_TEXTURE2D_DESC: ... +def prepare_d3d11_texture_2d_for_cpu(d3d11_texture_2d: ID3D11Texture2D, d3d_device: ID3D11Device) -> ID3D11Texture2D: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/D3DShot/d3dshot/dll/dxgi.pyi b/packages/pyright-internal/typeshed-fallback/stubs/D3DShot/d3dshot/dll/dxgi.pyi new file mode 100644 index 000000000..d26d46867 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/D3DShot/d3dshot/dll/dxgi.pyi @@ -0,0 +1,154 @@ +from ctypes import Array, Structure, _Pointer, c_uint +from ctypes.wintypes import BOOL, DWORD, HMONITOR, INT, LARGE_INTEGER, LONG, PFLOAT, POINT, RECT, UINT, ULARGE_INTEGER, WCHAR +from typing_extensions import TypedDict + +from d3dshot.dll import _HRESULT, _IUnknown, _ProcessFunc, _ProcessFuncRegionArg, _ProcessFuncReturn +from d3dshot.dll.d3d import ID3D11Device + +class _DXGIOutputPosition(TypedDict): + left: LONG + top: LONG + right: LONG + bottom: LONG + +class _DXGIOutput(TypedDict): + name: str + position: _DXGIOutputPosition + resolution: tuple[tuple[LONG, LONG], tuple[LONG, LONG]] + rotation: int + is_attached_to_desktop: bool + +class LUID(Structure): + LowPart: DWORD + HighPart: LONG + +class DXGI_ADAPTER_DESC1(Structure): + Description: Array[WCHAR] + VendorId: UINT + DeviceId: UINT + SubSysId: UINT + Revision: UINT + DedicatedVideoMemory: ULARGE_INTEGER + DedicatedSystemMemory: ULARGE_INTEGER + SharedSystemMemory: ULARGE_INTEGER + AdapterLuid: LUID + Flags: UINT + +class DXGI_OUTPUT_DESC(Structure): + DeviceName: Array[WCHAR] + DesktopCoordinates: RECT + AttachedToDesktop: BOOL + Rotation: UINT + Monitor: HMONITOR + +class DXGI_OUTDUPL_POINTER_POSITION(Structure): + Position: POINT + Visible: BOOL + +class DXGI_OUTDUPL_FRAME_INFO(Structure): + LastPresentTime: LARGE_INTEGER + LastMouseUpdateTime: LARGE_INTEGER + AccumulatedFrames: UINT + RectsCoalesced: BOOL + ProtectedContentMaskedOut: BOOL + PointerPosition: DXGI_OUTDUPL_POINTER_POSITION + TotalMetadataBufferSize: UINT + PointerShapeBufferSize: UINT + +class DXGI_MAPPED_RECT(Structure): + Pitch: INT + pBits: PFLOAT + +class IDXGIObject(_IUnknown): + def SetPrivateData(self) -> _HRESULT: ... + def SetPrivateDataInterface(self) -> _HRESULT: ... + def GetPrivateData(self) -> _HRESULT: ... + def GetParent(self) -> _HRESULT: ... + +class IDXGIDeviceSubObject(IDXGIObject): + def GetDevice(self) -> _HRESULT: ... + +class IDXGIResource(IDXGIDeviceSubObject): + def GetSharedHandle(self) -> _HRESULT: ... + def GetUsage(self) -> _HRESULT: ... + def SetEvictionPriority(self) -> _HRESULT: ... + def GetEvictionPriority(self) -> _HRESULT: ... + +class IDXGISurface(IDXGIDeviceSubObject): + def GetDesc(self) -> _HRESULT: ... + def Map(self, __pLockedRect: _Pointer[DXGI_MAPPED_RECT], __MapFlags: UINT) -> _HRESULT: ... + def Unmap(self) -> _HRESULT: ... + +class IDXGIOutputDuplication(IDXGIObject): + def GetDesc(self) -> None: ... + def AcquireNextFrame( + self, + __TimeoutInMilliseconds: UINT, + __pFrameInfo: _Pointer[DXGI_OUTDUPL_FRAME_INFO], + __ppDesktopResource: _Pointer[_Pointer[IDXGIResource]], + ) -> _HRESULT: ... + def GetFrameDirtyRects(self) -> _HRESULT: ... + def GetFrameMoveRects(self) -> _HRESULT: ... + def GetFramePointerShape(self) -> _HRESULT: ... + def MapDesktopSurface(self) -> _HRESULT: ... + def UnMapDesktopSurface(self) -> _HRESULT: ... + def ReleaseFrame(self) -> _HRESULT: ... + +class IDXGIOutput(IDXGIObject): + def GetDesc(self, __pDesc: _Pointer[DXGI_OUTPUT_DESC]) -> _HRESULT: ... + def GetDisplayModeList(self) -> _HRESULT: ... + def FindClosestMatchingMode(self) -> _HRESULT: ... + def WaitForVBlank(self) -> _HRESULT: ... + def TakeOwnership(self) -> _HRESULT: ... + def ReleaseOwnership(self) -> None: ... + def GetGammaControlCapabilities(self) -> _HRESULT: ... + def SetGammaControl(self) -> _HRESULT: ... + def GetGammaControl(self) -> _HRESULT: ... + def SetDisplaySurface(self) -> _HRESULT: ... + def GetDisplaySurfaceData(self) -> _HRESULT: ... + def GetFrameStatistics(self) -> _HRESULT: ... + +class IDXGIOutput1(IDXGIOutput): + def GetDisplayModeList1(self) -> _HRESULT: ... + def FindClosestMatchingMode1(self) -> _HRESULT: ... + def GetDisplaySurfaceData1(self) -> _HRESULT: ... + def DuplicateOutput( + self, __pDevice: _Pointer[ID3D11Device], __ppOutputDuplication: _Pointer[_Pointer[IDXGIOutputDuplication]] + ) -> _HRESULT: ... + +class IDXGIAdapter(IDXGIObject): + def EnumOutputs(self, __Output: UINT, __ppOutput: _Pointer[_Pointer[IDXGIOutput]]) -> _HRESULT: ... + def GetDesc(self) -> _HRESULT: ... + def CheckInterfaceSupport(self) -> _HRESULT: ... + +class IDXGIAdapter1(IDXGIAdapter): + def GetDesc1(self, __pDesc: _Pointer[DXGI_ADAPTER_DESC1]) -> _HRESULT: ... + +class IDXGIFactory(IDXGIObject): + def EnumAdapters(self) -> _HRESULT: ... + def MakeWindowAssociation(self) -> _HRESULT: ... + def GetWindowAssociation(self) -> _HRESULT: ... + def CreateSwapChain(self) -> _HRESULT: ... + def CreateSoftwareAdapter(self) -> _HRESULT: ... + +class IDXGIFactory1(IDXGIFactory): + def EnumAdapters1(self, __Adapter: c_uint, __ppAdapter: _Pointer[_Pointer[IDXGIAdapter1]]) -> _HRESULT: ... + def IsCurrent(self) -> BOOL: ... + +def initialize_dxgi_factory() -> _Pointer[IDXGIFactory1]: ... +def discover_dxgi_adapters(dxgi_factory: IDXGIFactory1) -> list[_Pointer[IDXGIAdapter1]]: ... +def describe_dxgi_adapter(dxgi_adapter: IDXGIAdapter1) -> Array[WCHAR]: ... +def discover_dxgi_outputs(dxgi_adapter: IDXGIAdapter) -> list[_Pointer[IDXGIOutput1]]: ... +def describe_dxgi_output(dxgi_output: IDXGIOutput) -> _DXGIOutput: ... +def initialize_dxgi_output_duplication( + dxgi_output: IDXGIOutput1, d3d_device: _Pointer[ID3D11Device] +) -> _Pointer[IDXGIOutputDuplication]: ... +def get_dxgi_output_duplication_frame( + dxgi_output_duplication: IDXGIOutputDuplication, + d3d_device: ID3D11Device, + process_func: _ProcessFunc[_ProcessFuncRegionArg, _ProcessFuncReturn] | None = ..., + width: int = ..., + height: int = ..., + region: _ProcessFuncRegionArg = ..., + rotation: int = ..., +) -> _ProcessFuncReturn | None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/D3DShot/d3dshot/dll/shcore.pyi b/packages/pyright-internal/typeshed-fallback/stubs/D3DShot/d3dshot/dll/shcore.pyi new file mode 100644 index 000000000..3fd5237ef --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/D3DShot/d3dshot/dll/shcore.pyi @@ -0,0 +1,3 @@ +from ctypes.wintypes import HMONITOR + +def get_scale_factor_for_monitor(hmonitor: HMONITOR) -> float: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/D3DShot/d3dshot/dll/user32.pyi b/packages/pyright-internal/typeshed-fallback/stubs/D3DShot/d3dshot/dll/user32.pyi new file mode 100644 index 000000000..a8dfaec82 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/D3DShot/d3dshot/dll/user32.pyi @@ -0,0 +1,13 @@ +import ctypes +from ctypes import wintypes + +class DISPLAY_DEVICE(ctypes.Structure): + cb: wintypes.DWORD + DeviceName: wintypes.WCHAR + DeviceString: wintypes.WCHAR + StateFlags: wintypes.DWORD + DeviceID: wintypes.WCHAR + DeviceKey: wintypes.WCHAR + +def get_display_device_name_mapping() -> dict[str, tuple[str, bool]]: ... +def get_hmonitor_by_point(x: wintypes.LONG, y: wintypes.LONG) -> wintypes.HMONITOR: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/DateTimeRange/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/DateTimeRange/METADATA.toml index a682c0c1f..47a9b6f7c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/DateTimeRange/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/DateTimeRange/METADATA.toml @@ -1,5 +1,3 @@ -version = "1.2.*" +version = "2.0.*" requires = ["types-python-dateutil"] - -[tool.stubtest] -ignore_missing_stub = false +obsolete_since = "2.1.0" # Released on 2023-02-19 diff --git a/packages/pyright-internal/typeshed-fallback/stubs/DateTimeRange/datetimerange/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/DateTimeRange/datetimerange/__init__.pyi index ec530c724..7f1d403af 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/DateTimeRange/datetimerange/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/DateTimeRange/datetimerange/__init__.pyi @@ -1,7 +1,7 @@ import datetime -from _typeshed import Self from collections.abc import Iterable from typing import ClassVar +from typing_extensions import Self from dateutil.relativedelta import relativedelta @@ -33,9 +33,9 @@ class DateTimeRange: def __eq__(self, other: object) -> bool: ... def __ne__(self, other: object) -> bool: ... def __add__(self, other: datetime.timedelta) -> DateTimeRange: ... - def __iadd__(self: Self, other: datetime.timedelta) -> Self: ... + def __iadd__(self, other: datetime.timedelta) -> Self: ... def __sub__(self, other: datetime.timedelta) -> DateTimeRange: ... - def __isub__(self: Self, other: datetime.timedelta) -> Self: ... + def __isub__(self, other: datetime.timedelta) -> Self: ... def __contains__(self, x: datetime.timedelta | datetime.datetime | DateTimeRange | str) -> bool: ... @property def start_datetime(self) -> datetime.datetime: ... @@ -46,7 +46,7 @@ class DateTimeRange: def is_set(self) -> bool: ... def validate_time_inversion(self) -> None: ... def is_valid_timerange(self) -> bool: ... - def is_intersection(self, x: DateTimeRange) -> bool: ... + def is_intersection(self, x: DateTimeRange, intersection_threshold: datetime.timedelta | None = None) -> bool: ... def get_start_time_str(self) -> str: ... def get_end_time_str(self) -> str: ... def get_timedelta_second(self) -> float: ... @@ -54,7 +54,7 @@ class DateTimeRange: def set_end_datetime(self, value: datetime.datetime | str | None, timezone: str | None = ...) -> None: ... def set_time_range(self, start: datetime.datetime | str | None, end: datetime.datetime | str | None) -> None: ... def range(self, step: datetime.timedelta | relativedelta) -> Iterable[datetime.datetime]: ... - def intersection(self, x: DateTimeRange) -> DateTimeRange: ... + def intersection(self, x: DateTimeRange, intersection_threshold: datetime.timedelta | None = None) -> DateTimeRange: ... def encompass(self, x: DateTimeRange) -> DateTimeRange: ... def truncate(self, percentage: float) -> None: ... def split(self, separator: str | datetime.datetime) -> list[DateTimeRange]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Deprecated/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/Deprecated/METADATA.toml index 5c234dc06..3d4d518df 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Deprecated/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/Deprecated/METADATA.toml @@ -1,5 +1,2 @@ version = "1.2.*" requires = [] - -[tool.stubtest] -ignore_missing_stub = false diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ExifRead/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/ExifRead/METADATA.toml new file mode 100644 index 000000000..4a8e90c0c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ExifRead/METADATA.toml @@ -0,0 +1 @@ +version = "3.0.*" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ExifRead/exifread/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ExifRead/exifread/__init__.pyi new file mode 100644 index 000000000..c8b41bc1a --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ExifRead/exifread/__init__.pyi @@ -0,0 +1,17 @@ +from logging import Logger +from typing import Any + +from ._types import Reader + +__version__: str +logger: Logger + +def process_file( + fh: Reader, + stop_tag: str = ..., + details: bool = ..., + strict: bool = ..., + debug: bool = ..., + truncate_tags: bool = ..., + auto_seek: bool = ..., +) -> dict[str, Any]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ExifRead/exifread/_types.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ExifRead/exifread/_types.pyi new file mode 100644 index 000000000..819d7c106 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ExifRead/exifread/_types.pyi @@ -0,0 +1,14 @@ +# Stubs-only module with type aliases for ExifRead. + +from typing import Any, Protocol +from typing_extensions import Literal, 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) -> bytes: ... + def read(self, __size: int) -> bytes: ... + def tell(self) -> int: ... + def seek(self, __offset: int, __whence: Literal[0, 1] = ...) -> object: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ExifRead/exifread/classes.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ExifRead/exifread/classes.pyi new file mode 100644 index 000000000..669fb7414 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ExifRead/exifread/classes.pyi @@ -0,0 +1,48 @@ +from logging import Logger +from typing import Any +from typing_extensions import 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 = ..., + detailed: bool = ..., + truncate_tags: bool = ..., + ) -> None: ... + def s2n(self, offset: int, length: int, signed: bool = ...) -> 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 = ..., relative: int = ..., stop_tag: str = ... + ) -> 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/packages/pyright-internal/typeshed-fallback/stubs/ExifRead/exifread/exceptions.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ExifRead/exifread/exceptions.pyi new file mode 100644 index 000000000..47b39e309 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ExifRead/exifread/exceptions.pyi @@ -0,0 +1,2 @@ +class InvalidExif(Exception): ... +class ExifNotFound(Exception): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ExifRead/exifread/exif_log.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ExifRead/exifread/exif_log.pyi new file mode 100644 index 000000000..15899f4da --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ExifRead/exifread/exif_log.pyi @@ -0,0 +1,24 @@ +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 = ..., color: bool = ...) -> None: ... + +class Handler(logging.StreamHandler[TextIO]): + color: bool + debug: bool + def __init__(self, log_level: logging._Level, debug: bool = ..., color: bool = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ExifRead/exifread/heic.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ExifRead/exifread/heic.pyi new file mode 100644 index 000000000..7fd0e1f83 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ExifRead/exifread/heic.pyi @@ -0,0 +1,56 @@ +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/packages/pyright-internal/typeshed-fallback/stubs/ExifRead/exifread/jpeg.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ExifRead/exifread/jpeg.pyi new file mode 100644 index 000000000..9b1791504 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ExifRead/exifread/jpeg.pyi @@ -0,0 +1,7 @@ +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/packages/pyright-internal/typeshed-fallback/stubs/ExifRead/exifread/tags/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ExifRead/exifread/tags/__init__.pyi new file mode 100644 index 000000000..ce0670d24 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ExifRead/exifread/tags/__init__.pyi @@ -0,0 +1,15 @@ +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/packages/pyright-internal/typeshed-fallback/stubs/ExifRead/exifread/tags/exif.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ExifRead/exifread/tags/exif.pyi new file mode 100644 index 000000000..569609e93 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ExifRead/exifread/tags/exif.pyi @@ -0,0 +1,7 @@ +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/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/bindings/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ExifRead/exifread/tags/makernote/__init__.pyi similarity index 100% rename from packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/bindings/__init__.pyi rename to packages/pyright-internal/typeshed-fallback/stubs/ExifRead/exifread/tags/makernote/__init__.pyi diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ExifRead/exifread/tags/makernote/apple.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ExifRead/exifread/tags/makernote/apple.pyi new file mode 100644 index 000000000..c72072637 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ExifRead/exifread/tags/makernote/apple.pyi @@ -0,0 +1,3 @@ +from exifread._types import TagDict + +TAGS: TagDict diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ExifRead/exifread/tags/makernote/canon.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ExifRead/exifread/tags/makernote/canon.pyi new file mode 100644 index 000000000..97d4f93c5 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ExifRead/exifread/tags/makernote/canon.pyi @@ -0,0 +1,26 @@ +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/packages/pyright-internal/typeshed-fallback/stubs/ExifRead/exifread/tags/makernote/casio.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ExifRead/exifread/tags/makernote/casio.pyi new file mode 100644 index 000000000..c72072637 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ExifRead/exifread/tags/makernote/casio.pyi @@ -0,0 +1,3 @@ +from exifread._types import TagDict + +TAGS: TagDict diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ExifRead/exifread/tags/makernote/fujifilm.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ExifRead/exifread/tags/makernote/fujifilm.pyi new file mode 100644 index 000000000..c72072637 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ExifRead/exifread/tags/makernote/fujifilm.pyi @@ -0,0 +1,3 @@ +from exifread._types import TagDict + +TAGS: TagDict diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ExifRead/exifread/tags/makernote/nikon.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ExifRead/exifread/tags/makernote/nikon.pyi new file mode 100644 index 000000000..ffa7101f5 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ExifRead/exifread/tags/makernote/nikon.pyi @@ -0,0 +1,6 @@ +from exifread._types import TagDict + +def ev_bias(seq: list[int]) -> str: ... + +TAGS_NEW: TagDict +TAGS_OLD: TagDict diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ExifRead/exifread/tags/makernote/olympus.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ExifRead/exifread/tags/makernote/olympus.pyi new file mode 100644 index 000000000..0744c7738 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ExifRead/exifread/tags/makernote/olympus.pyi @@ -0,0 +1,6 @@ +from exifread._types import TagDict + +def special_mode(val: bytes) -> str: ... + +TAGS: TagDict +TAG_0x2020: TagDict diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ExifRead/exifread/utils.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ExifRead/exifread/utils.pyi new file mode 100644 index 000000000..d534019c3 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ExifRead/exifread/utils.pyi @@ -0,0 +1,22 @@ +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: ... # type: ignore[misc] +@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 = ..., denominator: int | None = ...) -> Self: ... + @property + def num(self) -> int: ... + @property + def den(self) -> int: ... + def decimal(self) -> float: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Flask-Cors/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/Flask-Cors/METADATA.toml index 4a8e90c0c..b39fb0d7a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Flask-Cors/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/Flask-Cors/METADATA.toml @@ -1 +1,6 @@ version = "3.0.*" +# Requires a version of flask with a `py.typed` file +requires = ["Flask>=2.0.0"] + +[tool.stubtest] +ignore_missing_stub = true diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Flask-Cors/flask_cors/core.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Flask-Cors/flask_cors/core.pyi index 52fabdf29..475a0a2f9 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Flask-Cors/flask_cors/core.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Flask-Cors/flask_cors/core.pyi @@ -5,10 +5,10 @@ from re import Pattern from typing import Any, TypeVar, overload from typing_extensions import TypeAlias, TypedDict +import flask + _IterableT = TypeVar("_IterableT", bound=Iterable[Any]) _T = TypeVar("_T") -_App: TypeAlias = Any # flask is not part of typeshed -_Response: TypeAlias = Any # flask is not part of typeshed _MultiDict: TypeAlias = Any # werkzeug is not part of typeshed class _Options(TypedDict, total=False): @@ -45,13 +45,13 @@ def get_regexp_pattern(regexp: str | Pattern[str]) -> str: ... def get_cors_origins(options: _Options, request_origin: str | None) -> list[str] | None: ... def get_allow_headers(options: _Options, acl_request_headers: str | None) -> str | None: ... def get_cors_headers(options: _Options, request_headers: dict[str, Any], request_method: str) -> _MultiDict: ... -def set_cors_headers(resp: _Response, options: _Options) -> _Response: ... +def set_cors_headers(resp: flask.Response, options: _Options) -> flask.Response: ... def probably_regex(maybe_regex: str | Pattern[str]) -> bool: ... def re_fix(reg: str) -> str: ... def try_match_any(inst: str, patterns: Iterable[str | Pattern[str]]) -> bool: ... def try_match(request_origin: str, maybe_regex: str | Pattern[str]) -> bool: ... -def get_cors_options(appInstance: _App | None, *dicts: _Options) -> _Options: ... -def get_app_kwarg_dict(appInstance: _App | None = ...) -> _Options: ... +def get_cors_options(appInstance: flask.Flask | None, *dicts: _Options) -> _Options: ... +def get_app_kwarg_dict(appInstance: flask.Flask | None = ...) -> _Options: ... def flexible_str(obj: object) -> str | None: ... def serialize_option(options_dict: _Options, key: str, upper: bool = ...) -> None: ... @overload diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Flask-Cors/flask_cors/extension.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Flask-Cors/flask_cors/extension.pyi index 99cfb445e..aef6c137c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Flask-Cors/flask_cors/extension.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Flask-Cors/flask_cors/extension.pyi @@ -1,17 +1,17 @@ +from _typeshed import Incomplete from collections.abc import Callable, Iterable from datetime import timedelta from logging import Logger from typing import Any -from typing_extensions import TypeAlias -_App: TypeAlias = Any # flask is not part of typeshed +import flask LOG: Logger class CORS: def __init__( self, - app: Any | None = ..., + app: Incomplete | None = ..., *, resources: dict[str, dict[str, Any]] | list[str] | str | None = ..., origins: str | list[str] | None = ..., @@ -26,7 +26,7 @@ class CORS: ) -> None: ... def init_app( self, - app: _App, + app: flask.Flask, *, resources: dict[str, dict[str, Any]] | list[str] | str = ..., origins: str | list[str] = ..., diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Flask-Migrate/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/Flask-Migrate/METADATA.toml new file mode 100644 index 000000000..7e798f1a2 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/Flask-Migrate/METADATA.toml @@ -0,0 +1,6 @@ +version = "4.0.*" +# Requires a version of flask with a `py.typed` file +requires = ["Flask>=2.0.0", "types-Flask-SQLAlchemy"] + +[tool.stubtest] +ignore_missing_stub = true diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Flask-Migrate/flask_migrate/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Flask-Migrate/flask_migrate/__init__.pyi new file mode 100644 index 000000000..6a68c7c6f --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/Flask-Migrate/flask_migrate/__init__.pyi @@ -0,0 +1,106 @@ +from collections.abc import Callable, Iterable, Sequence +from logging import Logger +from typing import Any, TypeVar +from typing_extensions import ParamSpec, TypeAlias + +import flask +from flask_sqlalchemy import SQLAlchemy + +_T = TypeVar("_T") +_P = ParamSpec("_P") +_ConfigureCallback: TypeAlias = Callable[[Config], Config] + +alembic_version: tuple[int, int, int] +log: Logger + +class Config: # should inherit from alembic.config.Config which is not possible yet + template_directory: str | None + def __init__(self, *args, **kwargs) -> None: ... + def get_template_directory(self) -> str: ... + +class Migrate: + configure_callbacks: list[_ConfigureCallback] + db: SQLAlchemy | None + directory: str + alembic_ctx_kwargs: dict[str, Any] + def __init__( + self, + app: flask.Flask | None = ..., + db: SQLAlchemy | None = ..., + directory: str = ..., + command: str = ..., + compare_type: bool = ..., + render_as_batch: bool = ..., + **kwargs, + ) -> None: ... + def init_app( + self, + app: flask.Flask, + db: SQLAlchemy | None = ..., + directory: str | None = ..., + command: str | None = ..., + compare_type: bool | None = ..., + render_as_batch: bool | None = ..., + **kwargs, + ) -> None: ... + def configure(self, f: _ConfigureCallback) -> _ConfigureCallback: ... + def call_configure_callbacks(self, config: Config): ... + def get_config( + self, directory: str | None = ..., x_arg: str | Sequence[str] | None = ..., opts: Iterable[str] | None = ... + ): ... + +def catch_errors(f: Callable[_P, _T]) -> Callable[_P, _T]: ... +def list_templates() -> None: ... +def init(directory: str | None = ..., multidb: bool = ..., template: str | None = ..., package: bool = ...) -> None: ... +def revision( + directory: str | None = ..., + message: str | None = ..., + autogenerate: bool = ..., + sql: bool = ..., + head: str = ..., + splice: bool = ..., + branch_label: str | None = ..., + version_path: str | None = ..., + rev_id: str | None = ..., +) -> None: ... +def migrate( + directory: str | None = ..., + message: str | None = ..., + sql: bool = ..., + head: str = ..., + splice: bool = ..., + branch_label: str | None = ..., + version_path: str | None = ..., + rev_id: str | None = ..., + x_arg: str | Sequence[str] | None = ..., +) -> None: ... +def edit(directory: str | None = ..., revision: str = ...) -> None: ... +def merge( + directory: str | None = ..., + revisions: str = ..., + message: str | None = ..., + branch_label: str | None = ..., + rev_id: str | None = ..., +) -> None: ... +def upgrade( + directory: str | None = ..., + revision: str = ..., + sql: bool = ..., + tag: str | None = ..., + x_arg: str | Sequence[str] | None = ..., +) -> None: ... +def downgrade( + directory: str | None = ..., + revision: str = ..., + sql: bool = ..., + tag: str | None = ..., + x_arg: str | Sequence[str] | None = ..., +) -> None: ... +def show(directory: str | None = ..., revision: str = ...) -> None: ... +def history( + directory: str | None = ..., rev_range: str | None = ..., verbose: bool = ..., indicate_current: bool = ... +) -> None: ... +def heads(directory: str | None = ..., verbose: bool = ..., resolve_dependencies: bool = ...) -> None: ... +def branches(directory: str | None = ..., verbose: bool = ...) -> None: ... +def current(directory: str | None = ..., verbose: bool = ...) -> None: ... +def stamp(directory: str | None = ..., revision: str = ..., sql: bool = ..., tag: str | None = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Flask-SQLAlchemy/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/Flask-SQLAlchemy/METADATA.toml index 1fafe940f..d3d266df0 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Flask-SQLAlchemy/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/Flask-SQLAlchemy/METADATA.toml @@ -1,2 +1,6 @@ version = "2.5.*" requires = ["types-SQLAlchemy"] +obsolete_since = "3.0.1" # Released on 2022-10-11 + +[tool.stubtest] +ignore_missing_stub = true diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Flask-SQLAlchemy/flask_sqlalchemy/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Flask-SQLAlchemy/flask_sqlalchemy/__init__.pyi index 4872e63ef..e2fadfce8 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Flask-SQLAlchemy/flask_sqlalchemy/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Flask-SQLAlchemy/flask_sqlalchemy/__init__.pyi @@ -2,6 +2,7 @@ from _typeshed import Incomplete from collections.abc import Generator from typing import Any, Generic, TypeVar +from sqlalchemy.orm import scoped_session from sqlalchemy.orm.query import Query from sqlalchemy.orm.session import Session @@ -14,7 +15,7 @@ before_models_committed: Any class SignallingSession(Session): app: Any def __init__(self, db, autocommit: bool = ..., autoflush: bool = ..., **options) -> None: ... - def get_bind(self, mapper: Any | None = ..., clause: Any | None = ...): ... # type: ignore[override] + def get_bind(self, mapper: Incomplete | None = ..., clause: Incomplete | None = ...): ... # type: ignore[override] def get_debug_queries(): ... @@ -59,38 +60,38 @@ def get_state(app): ... class SQLAlchemy: Query: Any use_native_unicode: Any - session: Any - Model: Any + session: scoped_session + Model: Model app: Any def __init__( self, - app: Any | None = ..., + app: Incomplete | None = ..., use_native_unicode: bool = ..., - session_options: Any | None = ..., - metadata: Any | None = ..., + session_options: Incomplete | None = ..., + metadata: Incomplete | None = ..., query_class=..., model_class=..., - engine_options: Any | None = ..., + engine_options: Incomplete | None = ..., ) -> None: ... @property def metadata(self): ... - def create_scoped_session(self, options: Any | None = ...): ... + def create_scoped_session(self, options: Incomplete | None = ...): ... def create_session(self, options): ... - def make_declarative_base(self, model, metadata: Any | None = ...): ... + def make_declarative_base(self, model, metadata: Incomplete | None = ...): ... def init_app(self, app): ... def apply_pool_defaults(self, app, options): ... def apply_driver_hacks(self, app, sa_url, options): ... @property def engine(self): ... - def make_connector(self, app: Any | None = ..., bind: Any | None = ...): ... - def get_engine(self, app: Any | None = ..., bind: Any | None = ...): ... + def make_connector(self, app: Incomplete | None = ..., bind: Incomplete | None = ...): ... + def get_engine(self, app: Incomplete | None = ..., bind: Incomplete | None = ...): ... def create_engine(self, sa_url, engine_opts): ... - def get_app(self, reference_app: Any | None = ...): ... - def get_tables_for_bind(self, bind: Any | None = ...): ... - def get_binds(self, app: Any | None = ...): ... - def create_all(self, bind: str = ..., app: Any | None = ...) -> None: ... - def drop_all(self, bind: str = ..., app: Any | None = ...) -> None: ... - def reflect(self, bind: str = ..., app: Any | None = ...) -> None: ... + def get_app(self, reference_app: Incomplete | None = ...): ... + def get_tables_for_bind(self, bind: Incomplete | None = ...): ... + def get_binds(self, app: Incomplete | None = ...): ... + def create_all(self, bind: str = ..., app: Incomplete | None = ...) -> None: ... + def drop_all(self, bind: str = ..., app: Incomplete | None = ...) -> None: ... + def reflect(self, bind: str = ..., app: Incomplete | None = ...) -> None: ... def __getattr__(self, name: str) -> Any: ... # exposes dynamically classes of SQLAlchemy class FSADeprecationWarning(DeprecationWarning): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Flask-SQLAlchemy/flask_sqlalchemy/model.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Flask-SQLAlchemy/flask_sqlalchemy/model.pyi index b8250ae16..f1780c090 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Flask-SQLAlchemy/flask_sqlalchemy/model.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Flask-SQLAlchemy/flask_sqlalchemy/model.pyi @@ -1,12 +1,10 @@ from re import Pattern -from typing import Any, Generic, TypeVar +from typing import Any from sqlalchemy import Table from sqlalchemy.ext.declarative import DeclarativeMeta from sqlalchemy.orm import Query -_ModelT = TypeVar("_ModelT") - def should_set_tablename(cls: type) -> bool: ... camelcase_re: Pattern[str] @@ -22,6 +20,6 @@ class BindMetaMixin(type): class DefaultMeta(NameMetaMixin, BindMetaMixin, DeclarativeMeta): ... -class Model(Generic[_ModelT]): - query_class: type[Query[_ModelT]] | None - query: Query[_ModelT] | None +class Model: + query_class: type[Query[Any]] | None + query: Query[Any] | None diff --git a/packages/pyright-internal/typeshed-fallback/stubs/JACK-Client/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/JACK-Client/METADATA.toml index 5e65c85ad..9bc819273 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/JACK-Client/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/JACK-Client/METADATA.toml @@ -1,4 +1,11 @@ version = "0.5.*" +# Requires a version of numpy with a `py.typed` file +requires = ["numpy>=1.20", "types-cffi"] [tool.stubtest] +# darwin and win32 are equivalent +platforms = ["darwin", "linux"] apt_dependencies = ["libjack-dev"] +brew_dependencies = ["jack"] +# No need to install on the CI. Leaving here as information for Windows contributors. +# choco_dependencies = ["jack"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/JACK-Client/jack/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/JACK-Client/jack/__init__.pyi index 96b5b97b1..8d5c1adfd 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/JACK-Client/jack/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/JACK-Client/jack/__init__.pyi @@ -1,11 +1,38 @@ -from _typeshed import Self +import sys +from _typeshed import Unused from collections.abc import Callable, Generator, Iterable, Iterator, Sequence -from typing import Any, overload -from typing_extensions import Literal, TypeAlias +from typing import Any, NoReturn, overload +from typing_extensions import Literal, Self -_NDArray: TypeAlias = Any # FIXME: no typings for numpy arrays +import numpy +from _cffi_backend import _CDataBase +from numpy.typing import NDArray -class _JackPositionT: ... +# Aka jack_position_t +# Actual type: _cffi_backend.__CDataOwn +# This is not a real subclassing. Just ensuring type-checkers sees this type as compatible with _CDataBase +# pyright has no error code for subclassing final +class _JackPositionT(_CDataBase): # type: ignore[misc] # pyright: ignore + audio_frames_per_video_frame: float + bar: int + bar_start_tick: float + bbt_offset: int + beat: int + beat_type: float + beats_per_bar: float + beats_per_minute: float + frame: int + frame_rate: int + frame_time: float + next_time: float + padding: _CDataBase # + tick: int + ticks_per_beat: float + unique_1: int + unique_2: int + usecs: int + valid: int + video_offset: int class _CBufferType: @overload @@ -53,8 +80,8 @@ class Client: servername: str | None = ..., session_id: str | None = ..., ) -> None: ... - def __enter__(self: Self) -> Self: ... - def __exit__(self, *args: object) -> None: ... + def __enter__(self) -> Self: ... + def __exit__(self, *args: Unused) -> None: ... @property def name(self) -> str: ... @property @@ -99,9 +126,9 @@ class Client: @transport_frame.setter def transport_frame(self, frame: int) -> None: ... def transport_locate(self, frame: int) -> None: ... - def transport_query(self) -> tuple[TransportState, dict[str, Any]]: ... + def transport_query(self) -> tuple[TransportState, dict[str, Any]]: ... # Anyof[int, float, _CDataBase] def transport_query_struct(self) -> tuple[TransportState, _JackPositionT]: ... - def transport_reposition_struct(self, position: _JackPositionT) -> None: ... # TODO + def transport_reposition_struct(self, position: _JackPositionT) -> None: ... def set_sync_timeout(self, timeout: int) -> None: ... def set_freewheel(self, onoff: bool) -> None: ... def set_shutdown_callback(self, callback: Callable[[Status, str], object]) -> None: ... @@ -148,7 +175,8 @@ class Client: def remove_all_properties(self) -> None: ... class Port: - def __init__(self, port_ptr: Any, client: Client) -> None: ... + # + def __init__(self, port_ptr: _CDataBase, client: Client) -> None: ... def __eq__(self, other: object) -> bool: ... def __ne__(self, other: object) -> bool: ... @property @@ -195,12 +223,14 @@ class OwnPort(Port): def disconnect(self, other: str | Port | None = ...) -> None: ... def unregister(self) -> None: ... def get_buffer(self) -> _CBufferType: ... - def get_array(self) -> _NDArray: ... + def get_array(self) -> NDArray[numpy.float32]: ... class OwnMidiPort(MidiPort, OwnPort): - def __init__(self, *args: Any, **kwargs: Any) -> None: ... - def get_buffer(self) -> _CBufferType: ... - def get_array(self) -> _NDArray: ... + def __init__(self, port_ptr: _CDataBase, client: Client) -> None: ... + # The implementation raises NotImplementedError, but this is not an abstract class. + # `get_buffer()` and `get_array()` are disabled for OwnMidiPort + def get_buffer(self) -> NoReturn: ... + def get_array(self) -> NoReturn: ... @property def max_event_size(self) -> int: ... @property @@ -211,7 +241,7 @@ class OwnMidiPort(MidiPort, OwnPort): def reserve_midi_event(self, time: int, size: int) -> _CBufferType: ... class Ports: - def __init__(self, client: Client, porttype: Any, flag: Any) -> None: ... + def __init__(self, client: Client, porttype: str, flag: int) -> None: ... def __len__(self) -> int: ... def __getitem__(self, name: str) -> Port: ... def __iter__(self) -> Iterator[Port]: ... @@ -277,7 +307,7 @@ class CallbackExit(Exception): ... def get_property(subject: int | str, key: str) -> tuple[bytes, str] | None: ... def get_properties(subject: int | str) -> dict[str, tuple[bytes, str]]: ... def get_all_properties() -> dict[str, dict[str, tuple[bytes, str]]]: ... -def position2dict(pos: _JackPositionT) -> dict[str, Any]: ... +def position2dict(pos: _JackPositionT) -> dict[str, Any]: ... # Anyof[int, float, _CDataBase] def version() -> tuple[int, int, int, int]: ... def version_string() -> str: ... def client_name_size() -> int: ... @@ -285,3 +315,15 @@ def port_name_size() -> int: ... def set_error_function(callback: Callable[[str], object] | None = ...) -> None: ... def set_info_function(callback: Callable[[str], object] | None = ...) -> None: ... def client_pid(name: str) -> int: ... + +METADATA_CONNECTED: str +METADATA_HARDWARE: str +METADATA_ICON_LARGE: str +METADATA_ICON_SMALL: str +METADATA_PORT_GROUP: str +METADATA_PRETTY_NAME: str +if sys.platform != "linux": + METADATA_EVENT_TYPES: str + METADATA_ICON_NAME: str + METADATA_ORDER: str + METADATA_SIGNAL_TYPE: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Markdown/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/Markdown/METADATA.toml index 27115ac40..9914b4e00 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Markdown/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/Markdown/METADATA.toml @@ -1 +1,4 @@ version = "3.4.*" + +[tool.stubtest] +ignore_missing_stub = true diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Markdown/markdown/blockprocessors.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Markdown/markdown/blockprocessors.pyi index d81ac2939..70919f799 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Markdown/markdown/blockprocessors.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Markdown/markdown/blockprocessors.pyi @@ -16,7 +16,7 @@ class BlockProcessor: tab_length: int def __init__(self, parser: BlockParser) -> None: ... def lastChild(self, parent: Element) -> Element | None: ... - def detab(self, text: str, length: int | None = ...) -> str: ... + def detab(self, text: str, length: int | None = ...) -> tuple[str, str]: ... def looseDetab(self, text: str, level: int = ...) -> str: ... def test(self, parent: Element, block: str) -> bool: ... def run(self, parent: Element, blocks: list[str]) -> bool | None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Markdown/markdown/core.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Markdown/markdown/core.pyi index 96aa61a37..394417945 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Markdown/markdown/core.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Markdown/markdown/core.pyi @@ -1,7 +1,6 @@ -from _typeshed import Self from collections.abc import Callable, Mapping, Sequence from typing import Any, ClassVar, Protocol -from typing_extensions import Literal +from typing_extensions import Literal, Self from xml.etree.ElementTree import Element from .blockparser import BlockParser @@ -45,7 +44,7 @@ class Markdown: def registerExtensions(self, extensions: Sequence[Extension | str], configs: Mapping[str, Mapping[str, Any]]) -> Markdown: ... def build_extension(self, ext_name: str, configs: Mapping[str, str]) -> Extension: ... def registerExtension(self, extension: Extension) -> Markdown: ... - def reset(self: Self) -> Self: ... + def reset(self) -> Self: ... def set_output_format(self, format: Literal["xhtml", "html"]) -> Markdown: ... def is_block_level(self, tag: str) -> bool: ... def convert(self, source: str) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Markdown/markdown/extensions/codehilite.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Markdown/markdown/extensions/codehilite.pyi index bcd43c347..2526ce4c0 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Markdown/markdown/extensions/codehilite.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Markdown/markdown/extensions/codehilite.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from markdown.extensions import Extension @@ -21,16 +22,16 @@ class CodeHilite: options: dict[str, Any] def __init__( self, - src: Any | None = ..., + src: Incomplete | None = ..., *, - linenums: Any | None = ..., + linenums: Incomplete | None = ..., guess_lang: bool = ..., css_class: str = ..., - lang: Any | None = ..., + lang: Incomplete | None = ..., style: str = ..., noclasses: bool = ..., tab_length: int = ..., - hl_lines: Any | None = ..., + hl_lines: Incomplete | None = ..., use_pygments: bool = ..., **options: Any, ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Markdown/markdown/extensions/footnotes.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Markdown/markdown/extensions/footnotes.pyi index 9786679b6..3f9320314 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Markdown/markdown/extensions/footnotes.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Markdown/markdown/extensions/footnotes.pyi @@ -1,6 +1,7 @@ from re import Pattern from typing import Any +from markdown.core import Markdown from markdown.extensions import Extension from markdown.inlinepatterns import InlineProcessor from markdown.postprocessors import Postprocessor @@ -19,7 +20,7 @@ class FootnoteExtension(Extension): used_refs: Any def __init__(self, **kwargs) -> None: ... parser: Any - md: Any + md: Markdown footnotes: Any def reset(self) -> None: ... def unique_ref(self, reference, found: bool = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Markdown/markdown/extensions/meta.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Markdown/markdown/extensions/meta.pyi index 267d3c01a..deca6e244 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Markdown/markdown/extensions/meta.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Markdown/markdown/extensions/meta.pyi @@ -1,6 +1,7 @@ from re import Pattern from typing import Any +from markdown.core import Markdown from markdown.extensions import Extension from markdown.preprocessors import Preprocessor @@ -11,7 +12,7 @@ BEGIN_RE: Pattern[str] END_RE: Pattern[str] class MetaExtension(Extension): - md: Any + md: Markdown def reset(self) -> None: ... class MetaPreprocessor(Preprocessor): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Markdown/markdown/extensions/toc.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Markdown/markdown/extensions/toc.pyi index 453e3dcb4..519880bb9 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Markdown/markdown/extensions/toc.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Markdown/markdown/extensions/toc.pyi @@ -1,6 +1,7 @@ from re import Pattern from typing import Any +from markdown.core import Markdown from markdown.extensions import Extension from markdown.treeprocessors import Treeprocessor @@ -39,7 +40,7 @@ class TocTreeprocessor(Treeprocessor): class TocExtension(Extension): TreeProcessorClass: Any def __init__(self, **kwargs) -> None: ... - md: Any + md: Markdown def reset(self) -> None: ... def makeExtension(**kwargs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Markdown/markdown/extensions/wikilinks.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Markdown/markdown/extensions/wikilinks.pyi index 044edb0e3..81c6455f2 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Markdown/markdown/extensions/wikilinks.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Markdown/markdown/extensions/wikilinks.pyi @@ -1,5 +1,6 @@ from typing import Any +from markdown.core import Markdown from markdown.extensions import Extension from markdown.inlinepatterns import InlineProcessor @@ -7,7 +8,7 @@ def build_url(label, base, end): ... class WikiLinkExtension(Extension): def __init__(self, **kwargs) -> None: ... - md: Any + md: Markdown class WikiLinksInlineProcessor(InlineProcessor): config: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Markdown/markdown/inlinepatterns.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Markdown/markdown/inlinepatterns.pyi index 3483f3236..6cea38b1f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Markdown/markdown/inlinepatterns.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Markdown/markdown/inlinepatterns.pyi @@ -3,6 +3,8 @@ from re import Match from typing import Any, ClassVar from xml.etree.ElementTree import Element +from markdown.core import Markdown + def build_inlinepatterns(md, **kwargs): ... NOIMG: str @@ -37,8 +39,8 @@ class Pattern: ANCESTOR_EXCLUDES: Any pattern: Any compiled_re: Any - md: Any - def __init__(self, pattern, md: Any | None = ...) -> None: ... + md: Markdown + def __init__(self, pattern, md: Markdown | None = ...) -> None: ... def getCompiledRegExp(self): ... def handleMatch(self, m: Match[str]) -> str | Element | None: ... def type(self): ... @@ -46,7 +48,7 @@ class Pattern: class InlineProcessor(Pattern): safe_mode: bool = ... - def __init__(self, pattern, md: Any | None = ...) -> None: ... + def __init__(self, pattern, md: Markdown | None = ...) -> None: ... def handleMatch(self, m: Match[str], data) -> tuple[Element, int, int] | tuple[None, None, None]: ... # type: ignore[override] class SimpleTextPattern(Pattern): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Markdown/markdown/treeprocessors.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Markdown/markdown/treeprocessors.pyi index 26cd06b43..86968de15 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Markdown/markdown/treeprocessors.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Markdown/markdown/treeprocessors.pyi @@ -1,4 +1,7 @@ -from typing import Any +from _typeshed import Incomplete +from re import Pattern +from typing import Any, ClassVar +from xml.etree.ElementTree import Element from . import util @@ -6,7 +9,7 @@ def build_treeprocessors(md, **kwargs): ... def isString(s): ... class Treeprocessor(util.Processor): - def run(self, root) -> Any | None: ... + def run(self, root: Element) -> Element | None: ... class InlineProcessor(Treeprocessor): inlinePatterns: Any @@ -14,6 +17,10 @@ class InlineProcessor(Treeprocessor): def __init__(self, md) -> None: ... stashed_nodes: Any parent_map: Any - def run(self, tree, ancestors: Any | None = ...): ... + def run(self, tree: Element, ancestors: Incomplete | None = ...) -> Element: ... class PrettifyTreeprocessor(Treeprocessor): ... + +class UnescapeTreeprocessor(Treeprocessor): + RE: ClassVar[Pattern[str]] + def unescape(self, text: str) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Markdown/markdown/util.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Markdown/markdown/util.pyi index 66f6f2b33..865abdd55 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Markdown/markdown/util.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Markdown/markdown/util.pyi @@ -1,6 +1,8 @@ from re import Pattern from typing import Any, overload +from markdown.core import Markdown + BLOCK_LEVEL_ELEMENTS: Any STX: str ETX: str @@ -16,12 +18,13 @@ RTL_BIDI_RANGES: Any def deprecated(message: str, stacklevel: int = ...): ... def parseBoolValue(value: object, fail_on_errors: bool = ..., preserve_none: bool = ...) -> bool | None: ... def code_escape(text: str) -> str: ... +def nearing_recursion_limit() -> bool: ... class AtomicString(str): ... class Processor: - md: Any - def __init__(self, md: Any | None = ...) -> None: ... + md: Markdown + def __init__(self, md: Markdown | None = ...) -> None: ... class HtmlStash: html_counter: int = ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/METADATA.toml index a6930073a..b4d21d1eb 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/METADATA.toml @@ -1 +1,5 @@ -version = "9.2.*" +version = "9.4.*" + +[tool.stubtest] +stubtest_requirements = ["olefile"] +ignore_missing_stub = true diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/BlpImagePlugin.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/BlpImagePlugin.pyi index be0f72154..1ad9df579 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/BlpImagePlugin.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/BlpImagePlugin.pyi @@ -1,15 +1,31 @@ +from enum import IntEnum from typing import Any, ClassVar from typing_extensions import Literal from .ImageFile import ImageFile, PyDecoder -BLP_FORMAT_JPEG: int -BLP_ENCODING_UNCOMPRESSED: int -BLP_ENCODING_DXT: int -BLP_ENCODING_UNCOMPRESSED_RAW_BGRA: int -BLP_ALPHA_ENCODING_DXT1: int -BLP_ALPHA_ENCODING_DXT3: int -BLP_ALPHA_ENCODING_DXT5: int +class Format(IntEnum): + JPEG: int + +BLP_FORMAT_JPEG: Literal[Format.JPEG] + +class Encoding(IntEnum): + UNCOMPRESSED: int + DXT: int + UNCOMPRESSED_RAW_BGRA: int + +BLP_ENCODING_UNCOMPRESSED: Literal[Encoding.UNCOMPRESSED] +BLP_ENCODING_DXT: Literal[Encoding.DXT] +BLP_ENCODING_UNCOMPRESSED_RAW_BGRA: Literal[Encoding.UNCOMPRESSED_RAW_BGRA] + +class AlphaEncoding(IntEnum): + DXT1: int + DXT3: int + DXT5: int + +BLP_ALPHA_ENCODING_DXT1: Literal[AlphaEncoding.DXT1] +BLP_ALPHA_ENCODING_DXT3: Literal[AlphaEncoding.DXT3] +BLP_ALPHA_ENCODING_DXT5: Literal[AlphaEncoding.DXT5] def unpack_565(i): ... def decode_dxt1(data, alpha: bool = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ExifTags.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ExifTags.pyi index ada23d329..7ac53b0ac 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ExifTags.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ExifTags.pyi @@ -1,4 +1,42 @@ from collections.abc import Mapping +from enum import IntEnum TAGS: Mapping[int, str] GPSTAGS: Mapping[int, str] + +class Interop(IntEnum): + InteropIndex: int + InteropVersion: int + RelatedImageFileFormat: int + RelatedImageWidth: int + RleatedImageHeight: int + +class IFD(IntEnum): + Exif: int + GPSInfo: int + Makernote: int + Interop: int + IFD1: int + +class LightSource(IntEnum): + Unknown: int + Daylight: int + Fluorescent: int + Tungsten: int + Flash: int + Fine: int + Cloudy: int + Shade: int + DaylightFluorescent: int + DayWhiteFluorescent: int + CoolWhiteFluorescent: int + WhiteFluorescent: int + StandardLightA: int + StandardLightB: int + StandardLightC: int + D55: int + D65: int + D75: int + D50: int + ISO: int + Other: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/FpxImagePlugin.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/FpxImagePlugin.pyi index 069cb6b20..226a10f27 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/FpxImagePlugin.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/FpxImagePlugin.pyi @@ -1,12 +1,22 @@ +from _typeshed import Incomplete from typing import Any, ClassVar -from typing_extensions import Literal +from typing_extensions import Literal, TypeAlias from .ImageFile import ImageFile -MODES: Any +_OleFileIO: TypeAlias = Any # olefile.OleFileIO +_OleStream: TypeAlias = Any # olefile.OleStream + +MODES: dict[tuple[int, ...], tuple[str, str]] class FpxImageFile(ImageFile): + ole: _OleFileIO format: ClassVar[Literal["FPX"]] format_description: ClassVar[str] - fp: Any + fp: _OleStream | None + maxid: int + rawmode: str + jpeg: dict[int, Incomplete] + tile_prefix: Incomplete + stream: list[str] def load(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/FtexImagePlugin.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/FtexImagePlugin.pyi index 3205880ef..0535ec47c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/FtexImagePlugin.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/FtexImagePlugin.pyi @@ -1,11 +1,17 @@ +from enum import IntEnum from typing import ClassVar from typing_extensions import Literal from .ImageFile import ImageFile MAGIC: bytes -FORMAT_DXT1: int -FORMAT_UNCOMPRESSED: int + +class Format(IntEnum): + DXT1: int + UNCOMPRESSED: int + +FORMAT_DXT1: Literal[Format.DXT1] +FORMAT_UNCOMPRESSED: Literal[Format.UNCOMPRESSED] class FtexImageFile(ImageFile): format: ClassVar[Literal["FTEX"]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/GifImagePlugin.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/GifImagePlugin.pyi index ff064cc50..26278948a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/GifImagePlugin.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/GifImagePlugin.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any, ClassVar from typing_extensions import Literal @@ -19,5 +20,5 @@ class GifImageFile(ImageFile): RAWMODE: Any def get_interlace(im): ... -def getheader(im, palette: Any | None = ..., info: Any | None = ...): ... +def getheader(im, palette: Incomplete | None = ..., info: Incomplete | None = ...): ... def getdata(im, offset=..., **params): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/IcnsImagePlugin.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/IcnsImagePlugin.pyi index 42714148c..bc0b57784 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/IcnsImagePlugin.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/IcnsImagePlugin.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any, ClassVar from typing_extensions import Literal @@ -20,7 +21,7 @@ class IcnsFile: def itersizes(self): ... def bestsize(self): ... def dataforsize(self, size): ... - def getimage(self, size: Any | None = ...): ... + def getimage(self, size: Incomplete | None = ...): ... class IcnsImageFile(ImageFile): format: ClassVar[Literal["ICNS"]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/Image.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/Image.pyi index ee5a4c3e7..5a1983a79 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/Image.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/Image.pyi @@ -1,9 +1,11 @@ -from _typeshed import Self, SupportsRead, SupportsWrite +from _typeshed import Incomplete, SupportsRead, SupportsWrite, Unused from collections.abc import Callable, Iterable, Iterator, MutableMapping, Sequence from enum import IntEnum from pathlib import Path -from typing import Any, ClassVar, Protocol, SupportsBytes, Union -from typing_extensions import Literal, TypeAlias +from typing import Any, ClassVar, Protocol, SupportsBytes +from typing_extensions import Literal, Self, TypeAlias + +from PIL.PyAccess import PyAccess from ._imaging import ( DEFAULT_STRATEGY as DEFAULT_STRATEGY, @@ -20,64 +22,29 @@ _Resample: TypeAlias = Literal[0, 1, 2, 3, 4, 5] _Size: TypeAlias = tuple[int, int] _Box: TypeAlias = tuple[int, int, int, int] -_ConversionMatrix: TypeAlias = Union[ - tuple[float, float, float, float], tuple[float, float, float, float, float, float, float, float, float, float, float, float], -] +_ConversionMatrix: TypeAlias = ( + tuple[float, float, float, float] | tuple[float, float, float, float, float, float, float, float, float, float, float, float] +) # `str` values are only accepted if mode="RGB" for an `Image` object # `float` values are only accepted for certain modes such as "F" # See https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.new -_Color: TypeAlias = Union[int, tuple[int], tuple[int, int, int], tuple[int, int, int, int], str, float, tuple[float]] +_Color: TypeAlias = int | tuple[int] | tuple[int, int, int] | tuple[int, int, int, int] | str | float | tuple[float] class _Writeable(SupportsWrite[bytes], Protocol): def seek(self, __offset: int) -> Any: ... -# obsolete -NORMAL: Literal[0] -SEQUENCE: Literal[1] -CONTAINER: Literal[2] +NORMAL: Literal[0] # deprecated +SEQUENCE: Literal[1] # deprecated +CONTAINER: Literal[2] # deprecated class DecompressionBombWarning(RuntimeWarning): ... class DecompressionBombError(Exception): ... -MAX_IMAGE_PIXELS: int - -NONE: Literal[0] - -FLIP_LEFT_RIGHT: Literal[0] -FLIP_TOP_BOTTOM: Literal[1] -ROTATE_90: Literal[2] -ROTATE_180: Literal[3] -ROTATE_270: Literal[4] -TRANSPOSE: Literal[5] -TRANSVERSE: Literal[6] - -AFFINE: Literal[0] -EXTENT: Literal[1] -PERSPECTIVE: Literal[2] -QUAD: Literal[3] -MESH: Literal[4] +MAX_IMAGE_PIXELS: int | None -NEAREST: Literal[0] -BOX: Literal[4] -BILINEAR: Literal[2] -LINEAR: Literal[2] -HAMMING: Literal[5] -BICUBIC: Literal[3] -CUBIC: Literal[3] -LANCZOS: Literal[1] -ANTIALIAS: Literal[1] - -ORDERED: Literal[1] -RASTERIZE: Literal[2] -FLOYDSTEINBERG: Literal[3] - -WEB: Literal[0] -ADAPTIVE: Literal[1] - -MEDIANCUT: Literal[0] -MAXCOVERAGE: Literal[1] -FASTOCTREE: Literal[2] -LIBIMAGEQUANT: Literal[3] +LINEAR: Literal[Resampling.BILINEAR] # deprecated +CUBIC: Literal[Resampling.BICUBIC] # deprecated +ANTIALIAS: Literal[Resampling.LANCZOS] # deprecated class Transpose(IntEnum): FLIP_LEFT_RIGHT: Literal[0] @@ -88,6 +55,15 @@ class Transpose(IntEnum): TRANSPOSE: Literal[5] TRANSVERSE: Literal[6] +# All Transpose items +FLIP_LEFT_RIGHT: Literal[0] +FLIP_TOP_BOTTOM: Literal[1] +ROTATE_90: Literal[2] +ROTATE_180: Literal[3] +ROTATE_270: Literal[4] +TRANSPOSE: Literal[5] +TRANSVERSE: Literal[6] + class Transform(IntEnum): AFFINE: Literal[0] EXTENT: Literal[1] @@ -95,6 +71,13 @@ class Transform(IntEnum): QUAD: Literal[3] MESH: Literal[4] +# All Transform items +AFFINE: Literal[0] +EXTENT: Literal[1] +PERSPECTIVE: Literal[2] +QUAD: Literal[3] +MESH: Literal[4] + class Resampling(IntEnum): NEAREST: Literal[0] LANCZOS: Literal[1] @@ -103,22 +86,46 @@ class Resampling(IntEnum): BOX: Literal[4] HAMMING: Literal[5] +# All Resampling items +NEAREST: Literal[0] +LANCZOS: Literal[1] +BILINEAR: Literal[2] +BICUBIC: Literal[3] +BOX: Literal[4] +HAMMING: Literal[5] + class Dither(IntEnum): NONE: Literal[0] ORDERED: Literal[1] RASTERIZE: Literal[2] FLOYDSTEINBERG: Literal[3] +# All Dither items +NONE: Literal[0] +ORDERED: Literal[1] +RASTERIZE: Literal[2] +FLOYDSTEINBERG: Literal[3] + class Palette(IntEnum): WEB: Literal[0] ADAPTIVE: Literal[1] +# All Palette items +WEB: Literal[0] +ADAPTIVE: Literal[1] + class Quantize(IntEnum): MEDIANCUT: Literal[0] MAXCOVERAGE: Literal[1] FASTOCTREE: Literal[2] LIBIMAGEQUANT: Literal[3] +# All Quantize items +MEDIANCUT: Literal[0] +MAXCOVERAGE: Literal[1] +FASTOCTREE: Literal[2] +LIBIMAGEQUANT: Literal[3] + ID: list[str] OPEN: dict[str, Any] MIME: dict[str, str] @@ -153,17 +160,19 @@ class Image: palette: Any info: dict[Any, Any] readonly: int - pyaccess: Any + pyaccess: PyAccess | None is_animated: bool # not present on all Image objects n_frames: int # not present on all Image objects + # Only defined after a call to save(). + encoderconfig: tuple[Incomplete, ...] @property def width(self) -> int: ... @property def height(self) -> int: ... @property def size(self) -> tuple[int, int]: ... - def __enter__(self: Self) -> Self: ... - def __exit__(self, *args: object) -> None: ... + def __enter__(self) -> Self: ... + def __exit__(self, *args: Unused) -> None: ... def close(self) -> None: ... def __eq__(self, other: object) -> bool: ... def __getstate__(self) -> _ImageState: ... @@ -178,13 +187,13 @@ class Image: mode: _Mode | None = ..., matrix: _ConversionMatrix | None = ..., dither: int | None = ..., - palette: Literal[Palette.WEB] = ..., + palette: Palette | Literal[0, 1] = ..., colors: int = ..., ) -> Image: ... def quantize( self, colors: int = ..., - method: Literal[0, 1, 2, 3] | None = ..., + method: Quantize | Literal[0, 1, 2, 3] | None = ..., kmeans: int = ..., palette: Image | None = ..., dither: int = ..., @@ -200,6 +209,7 @@ class Image: def getdata(self, band: int | None = ...): ... def getextrema(self): ... def getexif(self) -> Exif: ... + def get_child_images(self) -> list[Image]: ... def getim(self): ... def getpalette(self, rawmode: str | None = ...) -> list[int] | None: ... def getpixel(self, xy: tuple[int, int]): ... @@ -238,6 +248,7 @@ class Image: *, save_all: bool = ..., bitmap_format: Literal["bmp", "png"] = ..., # for ICO files + optimize: bool = ..., **params: Any, ) -> None: ... def seek(self, frame: int) -> None: ... @@ -295,6 +306,7 @@ class Exif(MutableMapping[int, Any]): def load(self, data: bytes) -> None: ... def tobytes(self, offset: int = ...) -> bytes: ... def get_ifd(self, tag: int): ... + def hide_offsets(self) -> None: ... def __len__(self) -> int: ... def __getitem__(self, tag: int) -> Any: ... def __contains__(self, tag: object) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageCms.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageCms.pyi index c0d004e96..cc750ee55 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageCms.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageCms.pyi @@ -1,17 +1,34 @@ +from _typeshed import Incomplete +from enum import IntEnum from typing import Any +from typing_extensions import Literal from .Image import ImagePointHandler DESCRIPTION: str VERSION: str core: Any -INTENT_PERCEPTUAL: int -INTENT_RELATIVE_COLORIMETRIC: int -INTENT_SATURATION: int -INTENT_ABSOLUTE_COLORIMETRIC: int -DIRECTION_INPUT: int -DIRECTION_OUTPUT: int -DIRECTION_PROOF: int + +class Intent(IntEnum): + PERCEPTUAL: int + RELATIVE_COLORIMETRIC: int + SATURATION: int + ABSOLUTE_COLORIMETRIC: int + +INTENT_PERCEPTUAL: Literal[Intent.PERCEPTUAL] +INTENT_RELATIVE_COLORIMETRIC: Literal[Intent.RELATIVE_COLORIMETRIC] +INTENT_SATURATION: Literal[Intent.SATURATION] +INTENT_ABSOLUTE_COLORIMETRIC: Literal[Intent.ABSOLUTE_COLORIMETRIC] + +class Direction(IntEnum): + INPUT: int + OUTPUT: int + PROOF: int + +DIRECTION_INPUT: Literal[Direction.INPUT] +DIRECTION_OUTPUT: Literal[Direction.OUTPUT] +DIRECTION_PROOF: Literal[Direction.PROOF] + FLAGS: Any class ImageCmsProfile: @@ -24,18 +41,32 @@ class ImageCmsTransform(ImagePointHandler): output_mode: Any output_profile: Any def __init__( - self, input, output, input_mode, output_mode, intent=..., proof: Any | None = ..., proof_intent=..., flags: int = ... + self, + input, + output, + input_mode, + output_mode, + intent=..., + proof: Incomplete | None = ..., + proof_intent=..., + flags: int = ..., ) -> None: ... def point(self, im): ... - def apply(self, im, imOut: Any | None = ...): ... + def apply(self, im, imOut: Incomplete | None = ...): ... def apply_in_place(self, im): ... -def get_display_profile(handle: Any | None = ...): ... +def get_display_profile(handle: Incomplete | None = ...): ... class PyCMSError(Exception): ... def profileToProfile( - im, inputProfile, outputProfile, renderingIntent=..., outputMode: Any | None = ..., inPlace: bool = ..., flags: int = ... + im, + inputProfile, + outputProfile, + renderingIntent=..., + outputMode: Incomplete | None = ..., + inPlace: bool = ..., + flags: int = ..., ): ... def getOpenProfile(profileFilename): ... def buildTransform(inputProfile, outputProfile, inMode, outMode, renderingIntent=..., flags: int = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageColor.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageColor.pyi index 1815d7004..62fba216b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageColor.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageColor.pyi @@ -1,7 +1,6 @@ -from typing import Union from typing_extensions import TypeAlias -_RGB: TypeAlias = Union[tuple[int, int, int], tuple[int, int, int, int]] +_RGB: TypeAlias = tuple[int, int, int] | tuple[int, int, int, int] _Ink: TypeAlias = str | int | _RGB _GreyScale: TypeAlias = tuple[int, int] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageDraw.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageDraw.pyi index f4ba2e075..a146d856c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageDraw.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageDraw.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from collections.abc import Container, Sequence from typing import Any, overload from typing_extensions import Literal, TypeAlias @@ -82,7 +83,7 @@ class ImageDraw: spacing: float = ..., align: Literal["left", "center", "right"] = ..., direction: Literal["rtl", "ltr", "ttb"] | None = ..., - features: Any | None = ..., + features: Incomplete | None = ..., language: str | None = ..., stroke_width: int = ..., stroke_fill: _Ink | None = ..., @@ -116,7 +117,7 @@ class ImageDraw: features: Sequence[str] | None = ..., language: str | None = ..., embedded_color: bool = ..., - ) -> int: ... + ) -> float: ... def textbbox( self, xy: tuple[float, float], @@ -126,7 +127,7 @@ class ImageDraw: spacing: float = ..., align: Literal["left", "center", "right"] = ..., direction: Literal["rtl", "ltr", "ttb"] | None = ..., - features: Any | None = ..., + features: Incomplete | None = ..., language: str | None = ..., stroke_width: int = ..., embedded_color: bool = ..., @@ -140,7 +141,7 @@ class ImageDraw: spacing: float = ..., align: Literal["left", "center", "right"] = ..., direction: Literal["rtl", "ltr", "ttb"] | None = ..., - features: Any | None = ..., + features: Incomplete | None = ..., language: str | None = ..., stroke_width: int = ..., embedded_color: bool = ..., diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageDraw2.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageDraw2.pyi index 5b30711d3..b38d3e803 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageDraw2.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageDraw2.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any class Pen: @@ -18,9 +19,9 @@ class Draw: draw: Any image: Any transform: Any - def __init__(self, image, size: Any | None = ..., color: Any | None = ...) -> None: ... + def __init__(self, image, size: Incomplete | None = ..., color: Incomplete | None = ...) -> None: ... def flush(self): ... - def render(self, op, xy, pen, brush: Any | None = ...) -> None: ... + def render(self, op, xy, pen, brush: Incomplete | None = ...) -> None: ... def settransform(self, offset) -> None: ... def arc(self, xy, start, end, *options) -> None: ... def chord(self, xy, start, end, *options) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageFile.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageFile.pyi index d6f359bbe..215a47246 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageFile.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageFile.pyi @@ -1,5 +1,6 @@ -from _typeshed import Self +from _typeshed import Incomplete, Unused from typing import Any, NoReturn +from typing_extensions import Self from .Image import Image @@ -12,13 +13,13 @@ def raise_oserror(error) -> NoReturn: ... class ImageFile(Image): custom_mimetype: Any - tile: Any + tile: list[Incomplete] | None readonly: int decoderconfig: Any decodermaxblock: Any fp: Any filename: Any - def __init__(self, fp: Any | None = ..., filename: Any | None = ...) -> None: ... + def __init__(self, fp: Incomplete | None = ..., filename: Incomplete | None = ...) -> None: ... def get_format_mimetype(self): ... def verify(self) -> None: ... map: Any @@ -31,17 +32,17 @@ class StubImageFile(ImageFile): def load(self) -> None: ... class Parser: - incremental: Any | None - image: Any | None - data: Any | None - decoder: Any | None + incremental: Incomplete | None + image: Incomplete | None + data: Incomplete | None + decoder: Incomplete | None offset: int finished: bool def reset(self) -> None: ... decode: Any def feed(self, data) -> None: ... - def __enter__(self: Self) -> Self: ... - def __exit__(self, *args: object) -> None: ... + def __enter__(self) -> Self: ... + def __exit__(self, *args: Unused) -> None: ... def close(self) -> Image: ... class PyCodecState: @@ -64,5 +65,5 @@ class PyDecoder: def decode(self, buffer) -> None: ... def cleanup(self) -> None: ... def setfd(self, fd) -> None: ... - def setimage(self, im, extents: Any | None = ...) -> None: ... - def set_as_raw(self, data, rawmode: Any | None = ...) -> None: ... + def setimage(self, im, extents: Incomplete | None = ...) -> None: ... + def set_as_raw(self, data, rawmode: Incomplete | None = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageFilter.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageFilter.pyi index fec57d3cc..bbb647a4b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageFilter.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageFilter.pyi @@ -1,7 +1,7 @@ -from _typeshed import Self +from _typeshed import Incomplete from collections.abc import Callable, Iterable, Sequence from typing import Any -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal, Self, TypeAlias from .Image import Image @@ -18,7 +18,7 @@ class BuiltinFilter(MultibandFilter): class Kernel(BuiltinFilter): name: str filterargs: _FilterArgs - def __init__(self, size: Sequence[int], kernel: Sequence[int], scale: Any | None = ..., offset: int = ...) -> None: ... + def __init__(self, size: Sequence[int], kernel: Sequence[int], scale: Incomplete | None = ..., offset: int = ...) -> None: ... class RankFilter(Filter): name: str @@ -122,17 +122,17 @@ class Color3DLUT(MultibandFilter): ) -> None: ... @classmethod def generate( - cls: type[Self], + cls, size: int | tuple[int, int, int], callback: Callable[[float, float, float], Iterable[float]], channels: int = ..., target_mode: str | None = ..., ) -> Self: ... def transform( - self: Self, + self, callback: Callable[..., Iterable[float]], with_normals: bool = ..., channels: Literal[3, 4] | None = ..., - target_mode: Any | None = ..., + target_mode: Incomplete | None = ..., ) -> Self: ... def filter(self, image) -> Image: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageFont.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageFont.pyi index aa79a956a..63e566dc0 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageFont.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageFont.pyi @@ -1,9 +1,14 @@ -from _typeshed import StrOrBytesPath, SupportsRead -from typing import Any, Protocol +from _typeshed import FileDescriptorOrPath, Incomplete, SupportsRead +from enum import IntEnum +from typing import Protocol from typing_extensions import Literal -LAYOUT_BASIC: Literal[0] -LAYOUT_RAQM: Literal[1] +class Layout(IntEnum): + BASIC: Literal[0] + RAQM: Literal[1] + +LAYOUT_BASIC: Literal[Layout.BASIC] +LAYOUT_RAQM: Literal[Layout.RAQM] class _Font(Protocol): def getmask(self, text: str | bytes, mode: str = ..., direction=..., features=...): ... @@ -17,14 +22,14 @@ class FreeTypeFont: size: int index: int encoding: str - layout_engine: Any + layout_engine: Layout def __init__( self, font: str | bytes | SupportsRead[bytes] | None = ..., size: int = ..., index: int = ..., encoding: str = ..., - layout_engine: int | None = ..., + layout_engine: Layout | None = ..., ) -> None: ... def getname(self) -> tuple[str, str]: ... def getmetrics(self) -> tuple[int, int]: ... @@ -33,7 +38,7 @@ class FreeTypeFont: text: str | bytes, mode: str = ..., direction: Literal["ltr", "rtl", "ttb"] | None = ..., - features: Any | None = ..., + features: Incomplete | None = ..., language: str | None = ..., ) -> int: ... def getbbox( @@ -50,7 +55,7 @@ class FreeTypeFont: self, text: str | bytes, direction: Literal["ltr", "rtl", "ttb"] | None = ..., - features: Any | None = ..., + features: Incomplete | None = ..., language: str | None = ..., stroke_width: int = ..., ) -> tuple[int, int]: ... @@ -59,7 +64,7 @@ class FreeTypeFont: text: str | bytes, direction: Literal["ltr", "rtl", "ttb"] | None = ..., spacing: float = ..., - features: Any | None = ..., + features: Incomplete | None = ..., language: str | None = ..., stroke_width: float = ..., ) -> tuple[int, int]: ... @@ -69,11 +74,12 @@ class FreeTypeFont: text: str | bytes, mode: str = ..., direction: Literal["ltr", "rtl", "ttb"] | None = ..., - features: Any | None = ..., + features: Incomplete | None = ..., language: str | None = ..., stroke_width: float = ..., anchor: str | None = ..., ink=..., + start: tuple[float, float] | None = ..., ): ... def getmask2( self, @@ -81,11 +87,12 @@ class FreeTypeFont: mode: str = ..., fill=..., direction: Literal["ltr", "rtl", "ttb"] | None = ..., - features: Any | None = ..., + features: Incomplete | None = ..., language: str | None = ..., stroke_width: float = ..., anchor: str | None = ..., ink=..., + start: tuple[float, float] | None = ..., *args, **kwargs, ): ... @@ -95,7 +102,7 @@ class FreeTypeFont: size: int | None = ..., index: int | None = ..., encoding: str | None = ..., - layout_engine: int | None = ..., + layout_engine: Layout | None = ..., ) -> FreeTypeFont: ... def get_variation_names(self): ... def set_variation_by_name(self, name): ... @@ -107,13 +114,13 @@ class TransposedFont: def getsize(self, text: str | bytes, *args, **kwargs) -> tuple[int, int]: ... def getmask(self, text: str | bytes, mode: str = ..., *args, **kwargs): ... -def load(filename: StrOrBytesPath | int) -> ImageFont: ... +def load(filename: FileDescriptorOrPath) -> ImageFont: ... def truetype( font: str | bytes | SupportsRead[bytes] | None = ..., size: int = ..., index: int = ..., encoding: str = ..., - layout_engine: int | None = ..., + layout_engine: Layout | None = ..., ) -> FreeTypeFont: ... def load_path(filename: str | bytes) -> ImageFont: ... def load_default() -> ImageFont: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageGrab.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageGrab.pyi index 31411f35d..513b2caa8 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageGrab.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageGrab.pyi @@ -1,8 +1,8 @@ -from typing import Any +from _typeshed import Incomplete from .Image import Image, _Box def grab( - bbox: _Box | None = ..., include_layered_windows: bool = ..., all_screens: bool = ..., xdisplay: Any | None = ... + bbox: _Box | None = ..., include_layered_windows: bool = ..., all_screens: bool = ..., xdisplay: Incomplete | None = ... ) -> Image: ... def grabclipboard() -> Image | None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageMath.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageMath.pyi index 1dc14d743..6f524aa81 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageMath.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageMath.pyi @@ -1,10 +1,11 @@ +from _typeshed import Incomplete from typing import Any class _Operand: im: Any def __init__(self, im) -> None: ... - def apply(self, op, im1, im2: Any | None = ..., mode: Any | None = ...): ... - def __bool__(self): ... + def apply(self, op, im1, im2: Incomplete | None = ..., mode: Incomplete | None = ...): ... + def __bool__(self) -> bool: ... def __abs__(self): ... def __pos__(self): ... def __neg__(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageOps.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageOps.pyi index 999879c59..9cc148018 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageOps.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageOps.pyi @@ -1,11 +1,12 @@ +from _typeshed import Incomplete from collections.abc import Iterable -from typing import Any, Protocol, Union +from typing import Protocol from typing_extensions import TypeAlias from .Image import Image, Resampling, _Resample, _Size from .ImageColor import _Ink -_Border: TypeAlias = Union[int, tuple[int, int], tuple[int, int, int, int]] +_Border: TypeAlias = int | tuple[int, int] | tuple[int, int, int, int] class _Deformer(Protocol): def getmesh(self, image: Image): ... @@ -24,12 +25,16 @@ def colorize( ) -> Image: ... def contain(image: Image, size: _Size, method: Resampling | _Resample = ...) -> Image: ... def pad( - image: Image, size: _Size, method: Resampling | _Resample = ..., color: Any | None = ..., centering: Iterable[float] = ... + image: Image, + size: _Size, + method: Resampling | _Resample = ..., + color: Incomplete | None = ..., + centering: Iterable[float] = ..., ) -> Image: ... def crop(image: Image, border: _Border = ...) -> Image: ... def scale(image: Image, factor: float, resample: Resampling | _Resample = ...) -> Image: ... def deform(image: Image, deformer: _Deformer, resample: Resampling | _Resample = ...) -> Image: ... -def equalize(image: Image, mask: Any | None = ...) -> Image: ... +def equalize(image: Image, mask: Incomplete | None = ...) -> Image: ... def expand(image: Image, border: _Border = ..., fill: _Ink = ...) -> Image: ... def fit( image: Image, size: _Size, method: Resampling | _Resample = ..., bleed: float = ..., centering: Iterable[float] = ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImagePalette.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImagePalette.pyi index 7e1f80e1b..76d6582fa 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImagePalette.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImagePalette.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from .Image import Image @@ -8,7 +9,7 @@ class ImagePalette: palette: Any colors: Any dirty: Any - def __init__(self, mode: str = ..., palette: Any | None = ..., size: int = ...) -> None: ... + def __init__(self, mode: str = ..., palette: Incomplete | None = ..., size: int = ...) -> None: ... def copy(self) -> ImagePalette: ... def getdata(self): ... def tobytes(self) -> bytes: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageQt.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageQt.pyi index 472837033..f11ae150e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageQt.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageQt.pyi @@ -3,20 +3,23 @@ from typing_extensions import Literal, TypeAlias from .Image import Image -QImage: TypeAlias = Any # imported from either of {PyQt6,PySide6,PyQt5,PySide2}.QtGui -QPixmap: TypeAlias = Any +# imported from either of {PyQt6,PySide6,PyQt5,PySide2}.QtGui +# These are way too complex, with 4 different possible sources (2 deprecated) +# And we don't want to force the user to install PyQt or Pyside when they may not even use it. +_QImage: TypeAlias = Any +_QPixmap: TypeAlias = Any qt_versions: Any qt_is_installed: bool qt_version: Any def rgb(r: int, g: int, b: int, a: int = ...) -> int: ... -def fromqimage(im: Image | QImage) -> Image: ... -def fromqpixmap(im: Image | QImage) -> Image: ... +def fromqimage(im: ImageQt | _QImage) -> Image: ... +def fromqpixmap(im: ImageQt | _QImage) -> Image: ... def align8to32(bytes: bytes, width: int, mode: Literal["1", "L", "P"]) -> bytes: ... -class ImageQt(QImage): +class ImageQt(_QImage): def __init__(self, im: Image) -> None: ... def toqimage(im: Image) -> ImageQt: ... -def toqpixmap(im: Image) -> QPixmap: ... +def toqpixmap(im: Image) -> _QPixmap: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageSequence.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageSequence.pyi index cdcad977c..dcf42c4fa 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageSequence.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageSequence.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any class Iterator: @@ -8,4 +9,4 @@ class Iterator: def __iter__(self): ... def __next__(self): ... -def all_frames(im, func: Any | None = ...): ... +def all_frames(im, func: Incomplete | None = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageShow.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageShow.pyi index 67b73309d..851c88555 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageShow.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageShow.pyi @@ -3,7 +3,7 @@ from typing import Any from typing_extensions import Literal def register(viewer, order: int = ...) -> None: ... -def show(image, title: Any | None = ..., **options): ... +def show(image, title: Incomplete | None = ..., **options): ... class Viewer: def show(self, image, **options): ... @@ -45,7 +45,7 @@ class EogViewer(UnixViewer): def get_command_ex(self, file, **options): ... class XVViewer(UnixViewer): - def get_command_ex(self, file, title: Any | None = ..., **options): ... + def get_command_ex(self, file, title: Incomplete | None = ..., **options): ... class IPythonViewer(Viewer): def show_image(self, image, **options): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageStat.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageStat.pyi index 13f08c5dc..82723e301 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageStat.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageStat.pyi @@ -1,9 +1,10 @@ +from _typeshed import Incomplete from typing import Any class Stat: h: Any bands: Any - def __init__(self, image_or_list, mask: Any | None = ...) -> None: ... - def __getattr__(self, id): ... + def __init__(self, image_or_list, mask: Incomplete | None = ...) -> None: ... + def __getattr__(self, id: str): ... Global = Stat diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageTk.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageTk.pyi index 87efd5ecd..af3bd4fc2 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageTk.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageTk.pyi @@ -1,17 +1,52 @@ +import _tkinter +import tkinter +from _typeshed import ReadableBuffer, StrOrBytesPath, SupportsRead from typing import Any -class PhotoImage: - tk: Any - def __init__(self, image: Any | None = ..., size: Any | None = ..., **kw) -> None: ... +from PIL.Image import Image, _Box, _Mode, _Size + +class PhotoImage(tkinter._PhotoImageLike): + tk: _tkinter.TkappType + def __init__( + self, + image: Image | _Mode | None = None, + size: _Size | None = None, + *, + file: StrOrBytesPath | SupportsRead[bytes] = ..., + data: ReadableBuffer = ..., + # These are forwarded to tkinter.PhotoImage.__init__(): + name: str | None = None, + cnf: dict[str, Any] = ..., + format: str = ..., + gamma: float = ..., + height: int = ..., + palette: int | str = ..., + width: int = ..., + ) -> None: ... def __del__(self) -> None: ... - def width(self): ... - def height(self): ... - def paste(self, im, box: Any | None = ...) -> None: ... + def width(self) -> int: ... + def height(self) -> int: ... + # box is deprecated and unused + def paste(self, im: Image, box: _Box | None = ...) -> None: ... -class BitmapImage: - def __init__(self, image: Any | None = ..., **kw) -> None: ... +class BitmapImage(tkinter._BitmapImageLike): + def __init__( + self, + image: Image | None = None, + *, + file: StrOrBytesPath | SupportsRead[bytes] = ..., + data: ReadableBuffer = ..., + # These are forwarded to tkinter.Bitmap.__init__(): + name: str | None = None, + cnf: dict[str, Any] = ..., + master: tkinter.Misc | _tkinter.TkappType | None = None, + background: tkinter._Color = ..., + foreground: tkinter._Color = ..., + maskdata: str = ..., + maskfile: StrOrBytesPath = ..., + ) -> None: ... def __del__(self) -> None: ... - def width(self): ... - def height(self): ... + def width(self) -> int: ... + def height(self) -> int: ... -def getimage(photo): ... +def getimage(photo: tkinter.PhotoImage) -> Image: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageWin.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageWin.pyi index 4af82167e..a51ae49bf 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageWin.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageWin.pyi @@ -1,30 +1,31 @@ +from _typeshed import Incomplete from typing import Any class HDC: dc: Any def __init__(self, dc) -> None: ... - def __int__(self): ... + def __int__(self) -> int: ... class HWND: wnd: Any def __init__(self, wnd) -> None: ... - def __int__(self): ... + def __int__(self) -> int: ... class Dib: image: Any mode: Any size: Any - def __init__(self, image, size: Any | None = ...) -> None: ... + def __init__(self, image, size: Incomplete | None = ...) -> None: ... def expose(self, handle): ... - def draw(self, handle, dst, src: Any | None = ...): ... + def draw(self, handle, dst, src: Incomplete | None = ...): ... def query_palette(self, handle): ... - def paste(self, im, box: Any | None = ...) -> None: ... + def paste(self, im, box: Incomplete | None = ...) -> None: ... def frombytes(self, buffer): ... def tobytes(self): ... class Window: hwnd: Any - def __init__(self, title: str = ..., width: Any | None = ..., height: Any | None = ...) -> None: ... + def __init__(self, title: str = ..., width: Incomplete | None = ..., height: Incomplete | None = ...) -> None: ... def ui_handle_clear(self, dc, x0, y0, x1, y1) -> None: ... def ui_handle_damage(self, x0, y0, x1, y1) -> None: ... def ui_handle_destroy(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/JpegImagePlugin.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/JpegImagePlugin.pyi index 3e2fefd0a..c558a1329 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/JpegImagePlugin.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/JpegImagePlugin.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any, ClassVar from typing_extensions import Literal @@ -29,4 +30,4 @@ samplings: Any def convert_dict_qtables(qtables): ... def get_sampling(im): ... -def jpeg_factory(fp: Any | None = ..., filename: Any | None = ...): ... +def jpeg_factory(fp: Incomplete | None = ..., filename: Incomplete | None = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/MicImagePlugin.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/MicImagePlugin.pyi index b4fdc9d05..839f91cdd 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/MicImagePlugin.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/MicImagePlugin.pyi @@ -1,11 +1,18 @@ from typing import Any, ClassVar -from typing_extensions import Literal +from typing_extensions import Literal, TypeAlias from .TiffImagePlugin import TiffImageFile +_OleFileIO: TypeAlias = Any # olefile.OleFileIO +_OleStream: TypeAlias = Any # olefile.OleStream + class MicImageFile(TiffImageFile): + ole: _OleFileIO format: ClassVar[Literal["MIC"]] - fp: Any - frame: Any - def seek(self, frame) -> None: ... - def tell(self): ... + format_description: ClassVar[str] + fp: _OleStream + frame: int | None + images: list[list[str]] + is_animated: bool + def seek(self, frame: int) -> None: ... + def tell(self) -> int | None: ... # type: ignore[override] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/MpoImagePlugin.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/MpoImagePlugin.pyi index 2096c466c..14761e5da 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/MpoImagePlugin.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/MpoImagePlugin.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any, ClassVar from typing_extensions import Literal @@ -12,4 +13,4 @@ class MpoImageFile(JpegImageFile): def seek(self, frame) -> None: ... def tell(self): ... @staticmethod - def adopt(jpeg_instance, mpheader: Any | None = ...): ... + def adopt(jpeg_instance, mpheader: Incomplete | None = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/PSDraw.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/PSDraw.pyi index 2386f284a..d25d1cba6 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/PSDraw.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/PSDraw.pyi @@ -1,4 +1,4 @@ -from _typeshed import SupportsWrite +from _typeshed import SupportsWrite, Unused from .Image import Image @@ -6,7 +6,7 @@ class PSDraw: fp: SupportsWrite[bytes] def __init__(self, fp: SupportsWrite[bytes] | None = ...) -> None: ... isofont: dict[bytes, int] - def begin_document(self, id: object | None = ...) -> None: ... + def begin_document(self, id: Unused = None) -> None: ... def end_document(self) -> None: ... def setfont(self, font: str, size: int) -> None: ... def line(self, xy0: tuple[int, int], xy1: tuple[int, int]) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/PdfParser.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/PdfParser.pyi index 991e506d9..a2130bd06 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/PdfParser.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/PdfParser.pyi @@ -1,5 +1,8 @@ import collections +from _typeshed import Incomplete +from types import TracebackType from typing import Any +from typing_extensions import Literal def encode_text(s: str) -> bytes: ... @@ -12,10 +15,10 @@ class PdfFormatError(RuntimeError): ... def check_format_condition(condition, error_message) -> None: ... class IndirectReference: - def __bytes__(self): ... + def __bytes__(self) -> bytes: ... def __eq__(self, other): ... def __ne__(self, other): ... - def __hash__(self): ... + def __hash__(self) -> int: ... class IndirectObjectDef(IndirectReference): ... @@ -29,7 +32,7 @@ class XrefTable: def __getitem__(self, key): ... def __delitem__(self, key) -> None: ... def __contains__(self, key): ... - def __len__(self): ... + def __len__(self) -> int: ... def keys(self): ... def write(self, f): ... @@ -38,24 +41,24 @@ class PdfName: def __init__(self, name) -> None: ... def name_as_str(self): ... def __eq__(self, other): ... - def __hash__(self): ... + def __hash__(self) -> int: ... @classmethod def from_pdf_stream(cls, data): ... allowed_chars: Any - def __bytes__(self): ... + def __bytes__(self) -> bytes: ... class PdfArray(list[Any]): - def __bytes__(self): ... + def __bytes__(self) -> bytes: ... class PdfDict(collections.UserDict[bytes, Any]): - def __setattr__(self, key, value) -> None: ... - def __getattr__(self, key): ... + def __setattr__(self, key: str, value) -> None: ... + def __getattr__(self, key: str): ... def __bytes__(self) -> bytes: ... class PdfBinary: data: Any def __init__(self, data) -> None: ... - def __bytes__(self): ... + def __bytes__(self) -> bytes: ... class PdfStream: dictionary: Any @@ -86,10 +89,17 @@ class PdfParser: trailer_dict: Any xref_table: Any def __init__( - self, filename: Any | None = ..., f: Any | None = ..., buf: Any | None = ..., start_offset: int = ..., mode: str = ... + self, + filename: Incomplete | None = ..., + f: Incomplete | None = ..., + buf: Incomplete | None = ..., + start_offset: int = ..., + mode: str = ..., ) -> None: ... def __enter__(self): ... - def __exit__(self, exc_type, exc_value, traceback): ... + def __exit__( + self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None + ) -> Literal[False]: ... def start_writing(self) -> None: ... def close_buf(self) -> None: ... def close(self) -> None: ... @@ -98,7 +108,7 @@ class PdfParser: def write_comment(self, s) -> None: ... def write_catalog(self): ... def rewrite_pages(self) -> None: ... - def write_xref_and_trailer(self, new_root_ref: Any | None = ...) -> None: ... + def write_xref_and_trailer(self, new_root_ref: Incomplete | None = ...) -> None: ... def write_page(self, ref, *objs, **dict_obj): ... def write_obj(self, ref, *objs, **dict_obj): ... def del_root(self) -> None: ... @@ -106,7 +116,7 @@ class PdfParser: def get_buf_from_file(f): ... file_size_this: Any def read_pdf_info(self) -> None: ... - def next_object_id(self, offset: Any | None = ...): ... + def next_object_id(self, offset: Incomplete | None = ...): ... delimiter: bytes delimiter_or_ws: bytes whitespace: bytes @@ -145,7 +155,7 @@ class PdfParser: re_stream_start: Any re_stream_end: Any @classmethod - def get_value(cls, data, offset, expect_indirect: Any | None = ..., max_nesting: int = ...): ... + def get_value(cls, data, offset, expect_indirect: Incomplete | None = ..., max_nesting: int = ...): ... re_lit_str_token: Any escaped_chars: Any @classmethod @@ -155,4 +165,4 @@ class PdfParser: re_xref_entry: Any def read_xref_table(self, xref_section_offset): ... def read_indirect(self, ref, max_nesting: int = ...): ... - def linearize_page_tree(self, node: Any | None = ...): ... + def linearize_page_tree(self, node: Incomplete | None = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/PngImagePlugin.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/PngImagePlugin.pyi index b2033e678..e47e20153 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/PngImagePlugin.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/PngImagePlugin.pyi @@ -1,3 +1,5 @@ +from _typeshed import Incomplete, Unused +from enum import IntEnum from typing import Any, ClassVar from typing_extensions import Literal @@ -8,11 +10,22 @@ logger: Any is_cid: Any MAX_TEXT_CHUNK: Any MAX_TEXT_MEMORY: Any -APNG_DISPOSE_OP_NONE: int -APNG_DISPOSE_OP_BACKGROUND: int -APNG_DISPOSE_OP_PREVIOUS: int -APNG_BLEND_OP_SOURCE: int -APNG_BLEND_OP_OVER: int + +class Disposal(IntEnum): + OP_NONE: int + OP_BACKGROUND: int + OP_PREVIOUS: int + +APNG_DISPOSE_OP_NONE: Literal[Disposal.OP_NONE] +APNG_DISPOSE_OP_BACKGROUND: Literal[Disposal.OP_BACKGROUND] +APNG_DISPOSE_OP_PREVIOUS: Literal[Disposal.OP_PREVIOUS] + +class Blend(IntEnum): + OP_SOURCE: int + OP_OVER: int + +APNG_BLEND_OP_SOURCE: Literal[Blend.OP_SOURCE] +APNG_BLEND_OP_OVER: Literal[Blend.OP_OVER] class ChunkStream: fp: Any @@ -20,7 +33,7 @@ class ChunkStream: def __init__(self, fp) -> None: ... def read(self): ... def __enter__(self): ... - def __exit__(self, *args) -> None: ... + def __exit__(self, *args: Unused) -> None: ... def close(self) -> None: ... def push(self, cid, pos, length) -> None: ... def call(self, cid, pos, length): ... @@ -32,7 +45,7 @@ class iTXt(str): lang: Any tkey: Any @staticmethod - def __new__(cls, text, lang: Any | None = ..., tkey: Any | None = ...): ... + def __new__(cls, text, lang: Incomplete | None = ..., tkey: Incomplete | None = ...): ... class PngInfo: chunks: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/PyAccess.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/PyAccess.pyi index 2d87adf90..3d9231274 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/PyAccess.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/PyAccess.pyi @@ -10,7 +10,7 @@ class PyAccess: image32: Any image: Any def __init__(self, img, readonly: bool = ...) -> None: ... - def __setitem__(self, xy, color): ... + def __setitem__(self, xy, color) -> None: ... def __getitem__(self, xy): ... putpixel: Any getpixel: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/SpiderImagePlugin.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/SpiderImagePlugin.pyi index 17f5e6d3a..2c115b347 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/SpiderImagePlugin.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/SpiderImagePlugin.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any, ClassVar from typing_extensions import Literal @@ -24,5 +25,5 @@ class SpiderImageFile(ImageFile): def convert2byte(self, depth: int = ...): ... def tkPhotoImage(self): ... -def loadImageSeries(filelist: Any | None = ...): ... +def loadImageSeries(filelist: Incomplete | None = ...): ... def makeSpiderHeader(im): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/TarIO.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/TarIO.pyi index 54748270f..60a3dedc4 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/TarIO.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/TarIO.pyi @@ -1,3 +1,4 @@ +from _typeshed import Unused from typing import Any from .ContainerIO import ContainerIO @@ -6,5 +7,5 @@ class TarIO(ContainerIO): fh: Any def __init__(self, tarfile, file) -> None: ... def __enter__(self): ... - def __exit__(self, *args) -> None: ... + def __exit__(self, *args: Unused) -> None: ... def close(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/TiffImagePlugin.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/TiffImagePlugin.pyi index d56baa35c..d39e79581 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/TiffImagePlugin.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/TiffImagePlugin.pyi @@ -1,5 +1,7 @@ +from _typeshed import Incomplete from collections.abc import MutableMapping from numbers import Rational +from types import TracebackType from typing import Any, ClassVar from typing_extensions import Literal @@ -59,7 +61,7 @@ class IFDRational(Rational): @property def denominator(a): ... def limit_rational(self, max_denominator): ... - def __hash__(self): ... + def __hash__(self) -> int: ... def __eq__(self, other): ... __add__: Any __radd__: Any @@ -109,7 +111,7 @@ class ImageFileDirectory_v2(MutableMapping[int, Any]): def load_byte(self, data, legacy_api: bool = ...): ... def write_byte(self, data): ... def load_string(self, data, legacy_api: bool = ...): ... - def write_string(self, value): ... + def write_string(self, value: int | str | bytes) -> bytes: ... def load_rational(self, data, legacy_api: bool = ...): ... def write_rational(self, *values): ... def load_undefined(self, data, legacy_api: bool = ...): ... @@ -131,7 +133,7 @@ class ImageFileDirectory_v1(ImageFileDirectory_v2): def from_v2(cls, original): ... def to_v2(self): ... def __contains__(self, tag): ... - def __len__(self): ... + def __len__(self) -> int: ... def __iter__(self): ... def __setitem__(self, tag, value) -> None: ... def __getitem__(self, tag): ... @@ -143,7 +145,7 @@ class TiffImageFile(ImageFile): format_description: ClassVar[str] tag_v2: Any tag: Any - def __init__(self, fp: Any | None = ..., filename: Any | None = ...) -> None: ... + def __init__(self, fp: Incomplete | None = ..., filename: Incomplete | None = ...) -> None: ... @property def n_frames(self): ... im: Any @@ -170,7 +172,9 @@ class AppendingTiffWriter: def finalize(self) -> None: ... def newFrame(self) -> None: ... def __enter__(self): ... - def __exit__(self, exc_type, exc_value, traceback): ... + def __exit__( + self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None + ) -> Literal[False]: ... def tell(self): ... def seek(self, offset, whence=...): ... def goToEnd(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/TiffTags.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/TiffTags.pyi index e4582c889..f546f604b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/TiffTags.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/TiffTags.pyi @@ -1,4 +1,5 @@ -from typing import Any, NamedTuple, Union +from _typeshed import Incomplete +from typing import Any, NamedTuple from typing_extensions import Literal, TypeAlias class _TagInfo(NamedTuple): @@ -11,7 +12,7 @@ class _TagInfo(NamedTuple): class TagInfo(_TagInfo): def __new__( cls, - value: Any | None = ..., + value: Incomplete | None = ..., name: str = ..., type: _TagType | None = ..., length: int | None = ..., @@ -36,7 +37,7 @@ DOUBLE: Literal[12] IFD: Literal[13] _TagType: TypeAlias = Literal[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13] -_TagTuple: TypeAlias = Union[tuple[str, _TagType, int], tuple[str, _TagInfo, int, dict[str, int]]] +_TagTuple: TypeAlias = tuple[str, _TagType, int] | tuple[str, _TagInfo, int, dict[str, int]] TAGS_V2: dict[int, _TagTuple] TAGS_V2_GROUPS: dict[int, dict[int, _TagTuple]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/WebPImagePlugin.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/WebPImagePlugin.pyi index f7b7e6c5d..1b3d97718 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/WebPImagePlugin.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/WebPImagePlugin.pyi @@ -1,13 +1,15 @@ from typing import Any, ClassVar -from typing_extensions import Literal +from typing_extensions import Literal, TypeAlias from .ImageFile import ImageFile SUPPORTED: bool +_XMP_Tags: TypeAlias = dict[str, str | _XMP_Tags] class WebPImageFile(ImageFile): format: ClassVar[Literal["WEBP"]] format_description: ClassVar[str] + def getxmp(self) -> _XMP_Tags: ... def seek(self, frame) -> None: ... fp: Any tile: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/WmfImagePlugin.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/WmfImagePlugin.pyi index 5f7c4d4ec..0834c0b2a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/WmfImagePlugin.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/WmfImagePlugin.pyi @@ -1,3 +1,5 @@ +import sys +from _typeshed import Incomplete from typing import Any, ClassVar from typing_extensions import Literal @@ -5,12 +7,13 @@ from .ImageFile import StubImageFile def register_handler(handler) -> None: ... -class WmfHandler: - bbox: Any - def open(self, im) -> None: ... - def load(self, im): ... +if sys.platform == "win32": + class WmfHandler: + bbox: Any + def open(self, im) -> None: ... + def load(self, im): ... class WmfStubImageFile(StubImageFile): format: ClassVar[Literal["WMF"]] format_description: ClassVar[str] - def load(self, dpi: Any | None = ...) -> None: ... + def load(self, dpi: Incomplete | None = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/__init__.pyi index 8873f33c3..73d7019df 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/__init__.pyi @@ -1,3 +1,3 @@ __version__: str -class UnidentifiedImageError(IOError): ... +class UnidentifiedImageError(OSError): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/_imaging.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/_imaging.pyi index 44d41cede..b9435b8fe 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/_imaging.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/_imaging.pyi @@ -1,5 +1,5 @@ +from _typeshed import Incomplete from collections.abc import Sequence -from typing import Any from typing_extensions import Literal DEFAULT_STRATEGY: Literal[0] @@ -9,7 +9,7 @@ RLE: Literal[3] FIXED: Literal[4] class _Path: - def __getattr__(self, item: str) -> Any: ... # incomplete + def __getattr__(self, item: str) -> Incomplete: ... def path(__x: Sequence[tuple[float, float]] | Sequence[float]) -> _Path: ... -def __getattr__(__name: str) -> Any: ... # incomplete +def __getattr__(__name: str) -> Incomplete: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/features.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/features.pyi index ff7304c0f..a6deedd47 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/features.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/features.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any modules: Any @@ -20,4 +21,4 @@ def get_supported_features(): ... def check(feature): ... def version(feature): ... def get_supported(): ... -def pilinfo(out: Any | None = ..., supported_formats: bool = ...) -> None: ... +def pilinfo(out: Incomplete | None = ..., supported_formats: bool = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/PyAutoGUI/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/PyAutoGUI/METADATA.toml new file mode 100644 index 000000000..db0b3838d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/PyAutoGUI/METADATA.toml @@ -0,0 +1,2 @@ +version = "0.9.*" +requires = ["types-Pillow", "types-PyScreeze"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/PyAutoGUI/pyautogui/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/PyAutoGUI/pyautogui/__init__.pyi new file mode 100644 index 000000000..771f0cd24 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/PyAutoGUI/pyautogui/__init__.pyi @@ -0,0 +1,244 @@ +import contextlib +from collections.abc import Callable, Iterable, Sequence +from datetime import datetime +from typing import NamedTuple, SupportsInt, TypeVar +from typing_extensions import Final, ParamSpec, SupportsIndex, TypeAlias + +from pyscreeze import ( + center as center, + grab as grab, + locate as locate, + locateAll as locateAll, + locateAllOnScreen as locateAllOnScreen, + locateCenterOnScreen as locateCenterOnScreen, + locateOnScreen as locateOnScreen, + locateOnWindow as locateOnWindow, + pixel as pixel, + pixelMatchesColor as pixelMatchesColor, + screenshot as screenshot, +) + +_P = ParamSpec("_P") +_R = TypeVar("_R") +_NormalizeableXArg: TypeAlias = str | SupportsInt | Sequence[SupportsInt] + +# Constants +KEY_NAMES: list[str] +KEYBOARD_KEYS: list[str] +LEFT: Final = "left" +MIDDLE: Final = "middle" +RIGHT: Final = "right" +PRIMARY: Final = "primary" +SECONDARY: Final = "secondary" +G_LOG_SCREENSHOTS_FILENAMES: list[str] +# Implementation details +QWERTY: Final[str] +QWERTZ: Final[str] +MINIMUM_SLEEP: Final[float] + +# These are meant to be overridable +LOG_SCREENSHOTS: bool +LOG_SCREENSHOTS_LIMIT: int | None +# https://pyautogui.readthedocs.io/en/latest/index.html#fail-safes +FAILSAFE: bool +PAUSE: float +DARWIN_CATCH_UP_TIME: float +FAILSAFE_POINTS: list[tuple[int, int]] +# https://pyautogui.readthedocs.io/en/latest/mouse.htmln#mouse-movement +MINIMUM_DURATION: float + +class PyAutoGUIException(Exception): ... +class FailSafeException(PyAutoGUIException): ... +class ImageNotFoundException(PyAutoGUIException): ... + +def raisePyAutoGUIImageNotFoundException(wrappedFunction: Callable[_P, _R]) -> Callable[_P, _R]: ... +def mouseInfo() -> None: ... +def useImageNotFoundException(value: bool | None = None) -> None: ... +def isShiftCharacter(character: str) -> bool: ... + +class Point(NamedTuple): + x: float + y: float + +class Size(NamedTuple): + width: int + height: int + +def getPointOnLine(x1: float, y1: float, x2: float, y2: float, n: float) -> tuple[float, float]: ... +def linear(n: float) -> float: ... +def position(x: int | None = None, y: int | None = None) -> Point: ... +def size() -> Size: ... +def onScreen(x: _NormalizeableXArg | None, y: SupportsInt | None = None) -> bool: ... +def mouseDown( + x: _NormalizeableXArg | None = None, + y: SupportsInt | None = None, + # Docstring says `button` can also be `int`, but `.lower()` is called unconditionally in `_normalizeButton()` + button: str = "primary", + duration: float = 0.0, + tween: Callable[[float], float] = ..., + logScreenshot: bool | None = None, + _pause: bool = True, +) -> None: ... +def mouseUp( + x: _NormalizeableXArg | None = None, + y: SupportsInt | None = None, + # Docstring says `button` can also be `int`, but `.lower()` is called unconditionally in `_normalizeButton()` + button: str = "primary", + duration: float = 0.0, + tween: Callable[[float], float] = ..., + logScreenshot: bool | None = None, + _pause: bool = True, +) -> None: ... +def click( + x: _NormalizeableXArg | None = None, + y: SupportsInt | None = None, + clicks: SupportsIndex = 1, + interval: float = 0.0, + # Docstring says `button` can also be `int`, but `.lower()` is called unconditionally in `_normalizeButton()` + button: str = "primary", + duration: float = 0.0, + tween: Callable[[float], float] = ..., + logScreenshot: bool | None = None, + _pause: bool = True, +) -> None: ... +def leftClick( + x: _NormalizeableXArg | None = None, + y: SupportsInt | None = None, + interval: float = 0.0, + duration: float = 0.0, + tween: Callable[[float], float] = ..., + logScreenshot: bool | None = None, + _pause: bool = True, +) -> None: ... +def rightClick( + x: _NormalizeableXArg | None = None, + y: SupportsInt | None = None, + interval: float = 0.0, + duration: float = 0.0, + tween: Callable[[float], float] = ..., + logScreenshot: bool | None = None, + _pause: bool = True, +) -> None: ... +def middleClick( + x: _NormalizeableXArg | None = None, + y: SupportsInt | None = None, + interval: float = 0.0, + duration: float = 0.0, + tween: Callable[[float], float] = ..., + logScreenshot: bool | None = None, + _pause: bool = True, +) -> None: ... +def doubleClick( + x: _NormalizeableXArg | None = None, + y: SupportsInt | None = None, + interval: float = 0.0, + # Docstring says `button` can also be `int`, but `.lower()` is called unconditionally in `_normalizeButton()` + button: str = "left", + duration: float = 0.0, + tween: Callable[[float], float] = ..., + logScreenshot: bool | None = None, + _pause: bool = True, +) -> None: ... +def tripleClick( + x: _NormalizeableXArg | None = None, + y: SupportsInt | None = None, + interval: float = 0.0, + # Docstring says `button` can also be `int`, but `.lower()` is called unconditionally in `_normalizeButton()` + button: str = "left", + duration: float = 0.0, + tween: Callable[[float], float] = ..., + logScreenshot: bool | None = None, + _pause: bool = True, +) -> None: ... +def scroll( + clicks: float, + x: _NormalizeableXArg | None = None, + y: SupportsInt | None = None, + logScreenshot: bool | None = None, + _pause: bool = True, +) -> None: ... +def hscroll( + clicks: float, + x: _NormalizeableXArg | None = None, + y: SupportsInt | None = None, + logScreenshot: bool | None = None, + _pause: bool = True, +) -> None: ... +def vscroll( + clicks: float, + x: _NormalizeableXArg | None = None, + y: SupportsInt | None = None, + logScreenshot: bool | None = None, + _pause: bool = True, +) -> None: ... +def moveTo( + x: _NormalizeableXArg | None = None, + y: SupportsInt | None = None, + duration: float = 0.0, + tween: Callable[[float], float] = ..., + logScreenshot: bool = False, + _pause: bool = True, +) -> None: ... +def moveRel( + xOffset: _NormalizeableXArg | None = None, + yOffset: SupportsInt | None = None, + duration: float = 0.0, + tween: Callable[[float], float] = ..., + logScreenshot: bool = False, + _pause: bool = True, +) -> None: ... + +move = moveRel + +def dragTo( + x: _NormalizeableXArg | None = None, + y: SupportsInt | None = None, + duration: float = 0.0, + tween: Callable[[float], float] = ..., + # Docstring says `button` can also be `int`, but `.lower()` is called unconditionally in `_normalizeButton()` + button: str = "primary", + logScreenshot: bool | None = None, + _pause: bool = True, + mouseDownUp: bool = True, +) -> None: ... +def dragRel( + xOffset: _NormalizeableXArg | None = 0, + yOffset: SupportsInt | None = 0, + duration: float = 0.0, + tween: Callable[[float], float] = ..., + # Docstring says `button` can also be `int`, but `.lower()` is called unconditionally in `_normalizeButton()` + button: str = "primary", + logScreenshot: bool | None = None, + _pause: bool = True, + mouseDownUp: bool = True, +) -> None: ... + +drag = dragRel + +def isValidKey(key: str) -> bool: ... +def keyDown(key: str, logScreenshot: bool | None = None, _pause: bool = True) -> None: ... +def keyUp(key: str, logScreenshot: bool | None = None, _pause: bool = True) -> None: ... +def press( + keys: str | Iterable[str], + presses: SupportsIndex = 1, + interval: float = 0.0, + logScreenshot: bool | None = None, + _pause: bool = True, +) -> None: ... +def hold( + keys: str | Iterable[str], logScreenshot: bool | None = None, _pause: bool = True +) -> contextlib._GeneratorContextManager[None]: ... +def typewrite( + message: str | Sequence[str], interval: float = 0.0, logScreenshot: bool | None = None, _pause: bool = True +) -> None: ... + +write = typewrite + +def hotkey(*args: str, logScreenshot: bool | None = None, interval: float = 0.0) -> None: ... +def failSafeCheck() -> None: ... +def displayMousePosition(xOffset: float = 0, yOffset: float = 0) -> None: ... +def sleep(seconds: float) -> None: ... +def countdown(seconds: SupportsIndex) -> None: ... +def run(commandStr: str, _ssCount: Sequence[int] | None = None) -> None: ... +def printInfo(dontPrint: bool = False) -> str: ... +def getInfo() -> tuple[str, str, str, str, Size, datetime]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/PyMySQL/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/PyMySQL/METADATA.toml index f3e83f9c4..50057fed1 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/PyMySQL/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/PyMySQL/METADATA.toml @@ -1 +1,4 @@ version = "1.0.*" + +[tool.stubtest] +ignore_missing_stub = true diff --git a/packages/pyright-internal/typeshed-fallback/stubs/PyMySQL/pymysql/charset.pyi b/packages/pyright-internal/typeshed-fallback/stubs/PyMySQL/pymysql/charset.pyi index c47679a78..0a36fa695 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/PyMySQL/pymysql/charset.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/PyMySQL/pymysql/charset.pyi @@ -7,7 +7,6 @@ class Charset: def __init__(self, id, name, collation, is_default): ... class Charsets: - def __init__(self): ... def add(self, c): ... def by_id(self, id): ... def by_name(self, name): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/PyMySQL/pymysql/connections.pyi b/packages/pyright-internal/typeshed-fallback/stubs/PyMySQL/pymysql/connections.pyi index ca98f0aa2..e17b91807 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/PyMySQL/pymysql/connections.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/PyMySQL/pymysql/connections.pyi @@ -1,7 +1,8 @@ -from _typeshed import Self +from _typeshed import Incomplete from collections.abc import Mapping from socket import socket as _socket from typing import Any, AnyStr, Generic, TypeVar, overload +from typing_extensions import Self from .charset import charset_by_id as charset_by_id, charset_by_name as charset_by_name from .constants import CLIENT as CLIENT, COMMAND as COMMAND, FIELD_TYPE as FIELD_TYPE, SERVER_STATUS as SERVER_STATUS @@ -81,19 +82,19 @@ class Connection(Generic[_C]): self: Connection[Cursor], # different between overloads *, host: str | None = ..., - user: Any | None = ..., + user: Incomplete | None = ..., password: str = ..., - database: Any | None = ..., + database: Incomplete | None = ..., port: int = ..., - unix_socket: Any | None = ..., + unix_socket: Incomplete | None = ..., charset: str = ..., - sql_mode: Any | None = ..., - read_default_file: Any | None = ..., + sql_mode: Incomplete | None = ..., + read_default_file: Incomplete | None = ..., conv=..., use_unicode: bool | None = ..., client_flag: int = ..., cursorclass: None = ..., # different between overloads - init_command: Any | None = ..., + init_command: Incomplete | None = ..., connect_timeout: int | None = ..., ssl: Mapping[Any, Any] | None = ..., ssl_ca=..., @@ -102,21 +103,21 @@ class Connection(Generic[_C]): ssl_key=..., ssl_verify_cert=..., ssl_verify_identity=..., - read_default_group: Any | None = ..., - compress: Any | None = ..., - named_pipe: Any | None = ..., + read_default_group: Incomplete | None = ..., + compress: Incomplete | None = ..., + named_pipe: Incomplete | None = ..., autocommit: bool | None = ..., - db: Any | None = ..., - passwd: Any | None = ..., - local_infile: Any | None = ..., + db: Incomplete | None = ..., + passwd: Incomplete | None = ..., + local_infile: Incomplete | None = ..., max_allowed_packet: int = ..., defer_connect: bool | None = ..., auth_plugin_map: Mapping[Any, Any] | None = ..., read_timeout: float | None = ..., write_timeout: float | None = ..., - bind_address: Any | None = ..., + bind_address: Incomplete | None = ..., binary_prefix: bool | None = ..., - program_name: Any | None = ..., + program_name: Incomplete | None = ..., server_public_key: bytes | None = ..., ): ... @overload @@ -124,19 +125,19 @@ class Connection(Generic[_C]): self: Connection[_C], # different between overloads *, host: str | None = ..., - user: Any | None = ..., + user: Incomplete | None = ..., password: str = ..., - database: Any | None = ..., + database: Incomplete | None = ..., port: int = ..., - unix_socket: Any | None = ..., + unix_socket: Incomplete | None = ..., charset: str = ..., - sql_mode: Any | None = ..., - read_default_file: Any | None = ..., + sql_mode: Incomplete | None = ..., + read_default_file: Incomplete | None = ..., conv=..., use_unicode: bool | None = ..., client_flag: int = ..., cursorclass: type[_C] = ..., # different between overloads - init_command: Any | None = ..., + init_command: Incomplete | None = ..., connect_timeout: int | None = ..., ssl: Mapping[Any, Any] | None = ..., ssl_ca=..., @@ -145,21 +146,21 @@ class Connection(Generic[_C]): ssl_key=..., ssl_verify_cert=..., ssl_verify_identity=..., - read_default_group: Any | None = ..., - compress: Any | None = ..., - named_pipe: Any | None = ..., + read_default_group: Incomplete | None = ..., + compress: Incomplete | None = ..., + named_pipe: Incomplete | None = ..., autocommit: bool | None = ..., - db: Any | None = ..., - passwd: Any | None = ..., - local_infile: Any | None = ..., + db: Incomplete | None = ..., + passwd: Incomplete | None = ..., + local_infile: Incomplete | None = ..., max_allowed_packet: int = ..., defer_connect: bool | None = ..., auth_plugin_map: Mapping[Any, Any] | None = ..., read_timeout: float | None = ..., write_timeout: float | None = ..., - bind_address: Any | None = ..., + bind_address: Incomplete | None = ..., binary_prefix: bool | None = ..., - program_name: Any | None = ..., + program_name: Incomplete | None = ..., server_public_key: bytes | None = ..., ): ... socket: Any @@ -197,7 +198,7 @@ class Connection(Generic[_C]): def get_proto_info(self): ... def get_server_info(self): ... def show_warnings(self): ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__(self, *exc_info: object) -> None: ... Warning: Any Error: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/PyMySQL/pymysql/converters.pyi b/packages/pyright-internal/typeshed-fallback/stubs/PyMySQL/pymysql/converters.pyi index 850ca799d..6ce9f25eb 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/PyMySQL/pymysql/converters.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/PyMySQL/pymysql/converters.pyi @@ -1,5 +1,6 @@ import datetime import time +from _typeshed import Unused from collections.abc import Callable, Mapping, Sequence from decimal import Decimal from typing import Any, TypeVar @@ -25,7 +26,7 @@ def escape_time(obj: datetime.time, mapping: _EscaperMapping = ...) -> str: ... def escape_datetime(obj: datetime.datetime, mapping: _EscaperMapping = ...) -> str: ... def escape_date(obj: datetime.date, mapping: _EscaperMapping = ...) -> str: ... def escape_struct_time(obj: time.struct_time, mapping: _EscaperMapping = ...) -> str: ... -def Decimal2Literal(o: Decimal, d: object) -> str: ... +def Decimal2Literal(o: Decimal, d: Unused) -> str: ... def convert_datetime(obj: str | bytes) -> datetime.datetime | str: ... def convert_timedelta(obj: str | bytes) -> datetime.timedelta | str: ... def convert_time(obj: str | bytes) -> datetime.time | str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/PyMySQL/pymysql/cursors.pyi b/packages/pyright-internal/typeshed-fallback/stubs/PyMySQL/pymysql/cursors.pyi index df0388631..4f2d374b9 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/PyMySQL/pymysql/cursors.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/PyMySQL/pymysql/cursors.pyi @@ -1,6 +1,6 @@ -from _typeshed import Self from collections.abc import Iterable, Iterator from typing import Any +from typing_extensions import Self from .connections import Connection @@ -24,7 +24,7 @@ class Cursor: def executemany(self, query: str, args: Iterable[object]) -> int | None: ... def callproc(self, procname: str, args: Iterable[Any] = ...) -> Any: ... def scroll(self, value: int, mode: str = ...) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__(self, *exc_info: object) -> None: ... # Methods returning result tuples are below. def fetchone(self) -> tuple[Any, ...] | None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/PyScreeze/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/PyScreeze/METADATA.toml new file mode 100644 index 000000000..52120c0be --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/PyScreeze/METADATA.toml @@ -0,0 +1,2 @@ +version = "0.1.*" +requires = ["types-Pillow"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/PyScreeze/pyscreeze/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/PyScreeze/pyscreeze/__init__.pyi new file mode 100644 index 000000000..5c52490e9 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/PyScreeze/pyscreeze/__init__.pyi @@ -0,0 +1,203 @@ +from _typeshed import Incomplete, StrOrBytesPath, Unused +from collections.abc import Callable, Generator +from typing import NamedTuple, SupportsFloat, TypeVar, overload +from typing_extensions import Final, ParamSpec, SupportsIndex, TypeAlias + +from PIL import Image + +_P = ParamSpec("_P") +_R = TypeVar("_R") +# TODO: cv2.Mat is not available as a type yet: +# https://github.com/microsoft/python-type-stubs/issues/211 +# https://github.com/microsoft/python-type-stubs/tree/main/cv2 +# https://github.com/opencv/opencv/pull/20370 +# cv2.Mat is just an alias for a numpy NDArray, but can't import that either. +# Because pyscreeze does not declare it as a dependency, stub_uploader won't let it. +_Mat: TypeAlias = Incomplete + +useOpenCV: Final[bool] +RUNNING_PYTHON_2: Final = False +GRAYSCALE_DEFAULT: Final = False +scrotExists: Final[bool] +# Meant to be overridable for backward-compatibility +USE_IMAGE_NOT_FOUND_EXCEPTION: bool + +class Box(NamedTuple): + left: int + top: int + width: int + height: int + +class Point(NamedTuple): + x: int + y: int + +class RGB(NamedTuple): + red: int + green: int + blue: int + +class PyScreezeException(Exception): ... +class ImageNotFoundException(PyScreezeException): ... + +# _locateAll_opencv +def requiresPillow(wrappedFunction: Callable[_P, _R]) -> Callable[_P, _R]: ... +@overload +def locate( + needleImage: str | Image.Image | _Mat, + haystackImage: str | Image.Image | _Mat, + *, + grayscale: bool | None = None, + limit: Unused = 1, + region: tuple[int, int, int, int] | None = None, + step: int = 1, + confidence: SupportsFloat | SupportsIndex | str = 0.999, +) -> Box | None: ... + +# _locateAll_python / _locateAll_pillow +@overload +def locate( + needleImage: str | Image.Image, + haystackImage: str | Image.Image, + *, + grayscale: bool | None = None, + limit: Unused = 1, + region: tuple[int, int, int, int] | None = None, + step: int = 1, + confidence: None = None, +) -> Box | None: ... + +# _locateAll_opencv +@overload +def locateOnScreen( + image: str | Image.Image | _Mat, + minSearchTime: float = 0, + *, + grayscale: bool | None = None, + limit: Unused = 1, + region: tuple[int, int, int, int] | None = None, + step: int = 1, + confidence: SupportsFloat | SupportsIndex | str = 0.999, +) -> Box | None: ... + +# _locateAll_python / _locateAll_pillow +@overload +def locateOnScreen( + image: str | Image.Image, + minSearchTime: float = 0, + *, + grayscale: bool | None = None, + limit: Unused = 1, + region: tuple[int, int, int, int] | None = None, + step: int = 1, + confidence: None = None, +) -> Box | None: ... + +# _locateAll_opencv +@overload +def locateAllOnScreen( + image: str | Image.Image | _Mat, + *, + grayscale: bool | None = None, + limit: int = 1000, + region: tuple[int, int, int, int] | None = None, + step: int = 1, + confidence: SupportsFloat | SupportsIndex | str = 0.999, +) -> Generator[Box, None, None]: ... + +# _locateAll_python / _locateAll_pillow +@overload +def locateAllOnScreen( + image: str | Image.Image, + *, + grayscale: bool | None = None, + limit: int | None = None, + region: tuple[int, int, int, int] | None = None, + step: int = 1, + confidence: None = None, +) -> Generator[Box, None, None]: ... + +# _locateAll_opencv +@overload +def locateCenterOnScreen( + image: str | Image.Image | _Mat, + *, + minSearchTime: float, + grayscale: bool | None = None, + limit: Unused = 1, + region: tuple[int, int, int, int] | None = None, + step: int = 1, + confidence: SupportsFloat | SupportsIndex | str = 0.999, +) -> Point | None: ... + +# _locateAll_python / _locateAll_pillow +@overload +def locateCenterOnScreen( + image: str | Image.Image, + *, + minSearchTime: float, + grayscale: bool | None = None, + limit: Unused = 1, + region: tuple[int, int, int, int] | None = None, + step: int = 1, + confidence: None = None, +) -> Point | None: ... + +# _locateAll_opencv +@overload +def locateOnWindow( + image: str | Image.Image | _Mat, + title: str, + *, + grayscale: bool | None = None, + limit: Unused = 1, + step: int = 1, + confidence: SupportsFloat | SupportsIndex | str = 0.999, +) -> Box | None: ... + +# _locateAll_python / _locateAll_pillow +@overload +def locateOnWindow( + image: str | Image.Image, + title: str, + *, + grayscale: bool | None = None, + limit: Unused = 1, + step: int = 1, + confidence: None = None, +) -> Box | None: ... +def showRegionOnScreen( + region: tuple[int, int, int, int], outlineColor: str = "red", filename: str = "_showRegionOnScreen.png" +) -> None: ... +def center(coords: tuple[int, int, int, int]) -> Point: ... +def pixelMatchesColor( + x: int, y: int, expectedRGBColor: tuple[int, int, int] | tuple[int, int, int, int], tolerance: int = 0 +) -> bool: ... +def pixel(x: int, y: int) -> tuple[int, int, int]: ... +def screenshot(imageFilename: StrOrBytesPath | None = None, region: tuple[int, int, int, int] | None = None) -> Image.Image: ... + +grab = screenshot + +# _locateAll_opencv +@overload +def locateAll( + needleImage: str | Image.Image | _Mat, + haystackImage: str | Image.Image | _Mat, + grayscale: bool | None = None, + limit: int = 1000, + region: tuple[int, int, int, int] | None = None, + step: int = 1, + confidence: SupportsFloat | SupportsIndex | str = 0.999, +) -> Generator[Box, None, None]: ... + +# _locateAll_python / _locateAll_pillow +@overload +def locateAll( + needleImage: str | Image.Image, + haystackImage: str | Image.Image, + grayscale: bool | None = None, + limit: int | None = None, + region: tuple[int, int, int, int] | None = None, + step: int = 1, + confidence: None = None, +) -> Generator[Box, None, None]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/PyYAML/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/PyYAML/METADATA.toml index 5dbca7b29..39a61569b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/PyYAML/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/PyYAML/METADATA.toml @@ -1,4 +1 @@ version = "6.0.*" - -[tool.stubtest] -ignore_missing_stub = false diff --git a/packages/pyright-internal/typeshed-fallback/stubs/PyYAML/yaml/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/PyYAML/yaml/__init__.pyi index 04b68a86a..e42fc881d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/PyYAML/yaml/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/PyYAML/yaml/__init__.pyi @@ -1,4 +1,4 @@ -from collections.abc import Callable, Iterable, Iterator, Mapping, Sequence +from collections.abc import Callable, Iterable, Iterator, Mapping from re import Pattern from typing import Any, TypeVar, overload from typing_extensions import TypeAlias @@ -6,11 +6,14 @@ from typing_extensions import TypeAlias from . import resolver as resolver # Help mypy a bit; this is implied by loader and dumper from .constructor import BaseConstructor from .cyaml import * +from .cyaml import _CLoader from .dumper import * +from .dumper import _Inf from .emitter import _WriteStream from .error import * from .events import * from .loader import * +from .loader import _Loader from .nodes import * from .reader import _ReadStream from .representer import BaseRepresenter @@ -20,20 +23,20 @@ from .tokens import * # FIXME: the functions really return str if encoding is None, otherwise bytes. Waiting for python/mypy#5621 _Yaml: TypeAlias = Any -__with_libyaml__: Any -__version__: str - _T = TypeVar("_T") _Constructor = TypeVar("_Constructor", bound=BaseConstructor) _Representer = TypeVar("_Representer", bound=BaseRepresenter) +__with_libyaml__: bool +__version__: str + def warnings(settings=...): ... -def scan(stream, Loader=...): ... -def parse(stream, Loader=...): ... -def compose(stream, Loader=...): ... -def compose_all(stream, Loader=...): ... -def load(stream: _ReadStream, Loader) -> Any: ... -def load_all(stream: _ReadStream, Loader) -> Iterator[Any]: ... +def scan(stream, Loader: type[_Loader | _CLoader] = ...): ... +def parse(stream, Loader: type[_Loader | _CLoader] = ...): ... +def compose(stream, Loader: type[_Loader | _CLoader] = ...): ... +def compose_all(stream, Loader: type[_Loader | _CLoader] = ...): ... +def load(stream: _ReadStream, Loader: type[_Loader | _CLoader]) -> Any: ... +def load_all(stream: _ReadStream, Loader: type[_Loader | _CLoader]) -> Iterator[Any]: ... def full_load(stream: _ReadStream) -> Any: ... def full_load_all(stream: _ReadStream) -> Iterator[Any]: ... def safe_load(stream: _ReadStream) -> Any: ... @@ -46,7 +49,7 @@ def emit( Dumper=..., canonical: bool | None = ..., indent: int | None = ..., - width: int | None = ..., + width: int | _Inf | None = ..., allow_unicode: bool | None = ..., line_break: str | None = ..., ): ... @@ -57,7 +60,7 @@ def serialize_all( Dumper=..., canonical: bool | None = ..., indent: int | None = ..., - width: int | None = ..., + width: int | _Inf | None = ..., allow_unicode: bool | None = ..., line_break: str | None = ..., encoding: str | None = ..., @@ -73,7 +76,7 @@ def serialize_all( Dumper=..., canonical: bool | None = ..., indent: int | None = ..., - width: int | None = ..., + width: int | _Inf | None = ..., allow_unicode: bool | None = ..., line_break: str | None = ..., encoding: str | None = ..., @@ -90,7 +93,7 @@ def serialize( *, canonical: bool | None = ..., indent: int | None = ..., - width: int | None = ..., + width: int | _Inf | None = ..., allow_unicode: bool | None = ..., line_break: str | None = ..., encoding: str | None = ..., @@ -107,7 +110,7 @@ def serialize( *, canonical: bool | None = ..., indent: int | None = ..., - width: int | None = ..., + width: int | _Inf | None = ..., allow_unicode: bool | None = ..., line_break: str | None = ..., encoding: str | None = ..., @@ -118,14 +121,14 @@ def serialize( ) -> _Yaml: ... @overload def dump_all( - documents: Sequence[Any], + documents: Iterable[Any], stream: _WriteStream[Any], Dumper=..., default_style: str | None = ..., default_flow_style: bool | None = ..., canonical: bool | None = ..., indent: int | None = ..., - width: int | None = ..., + width: int | _Inf | None = ..., allow_unicode: bool | None = ..., line_break: str | None = ..., encoding: str | None = ..., @@ -137,14 +140,14 @@ def dump_all( ) -> None: ... @overload def dump_all( - documents: Sequence[Any], + documents: Iterable[Any], stream: None = ..., Dumper=..., default_style: str | None = ..., default_flow_style: bool | None = ..., canonical: bool | None = ..., indent: int | None = ..., - width: int | None = ..., + width: int | _Inf | None = ..., allow_unicode: bool | None = ..., line_break: str | None = ..., encoding: str | None = ..., @@ -164,7 +167,7 @@ def dump( default_flow_style: bool | None = ..., canonical: bool | None = ..., indent: int | None = ..., - width: int | None = ..., + width: int | _Inf | None = ..., allow_unicode: bool | None = ..., line_break: str | None = ..., encoding: str | None = ..., @@ -184,7 +187,7 @@ def dump( default_flow_style: bool | None = ..., canonical: bool | None = ..., indent: int | None = ..., - width: int | None = ..., + width: int | _Inf | None = ..., allow_unicode: bool | None = ..., line_break: str | None = ..., encoding: str | None = ..., @@ -196,14 +199,14 @@ def dump( ) -> _Yaml: ... @overload def safe_dump_all( - documents: Sequence[Any], + documents: Iterable[Any], stream: _WriteStream[Any], *, default_style: str | None = ..., default_flow_style: bool | None = ..., canonical: bool | None = ..., indent: int | None = ..., - width: int | None = ..., + width: int | _Inf | None = ..., allow_unicode: bool | None = ..., line_break: str | None = ..., encoding: str | None = ..., @@ -215,14 +218,14 @@ def safe_dump_all( ) -> None: ... @overload def safe_dump_all( - documents: Sequence[Any], + documents: Iterable[Any], stream: None = ..., *, default_style: str | None = ..., default_flow_style: bool | None = ..., canonical: bool | None = ..., indent: int | None = ..., - width: int | None = ..., + width: int | _Inf | None = ..., allow_unicode: bool | None = ..., line_break: str | None = ..., encoding: str | None = ..., @@ -241,7 +244,7 @@ def safe_dump( default_flow_style: bool | None = ..., canonical: bool | None = ..., indent: int | None = ..., - width: int | None = ..., + width: int | _Inf | None = ..., allow_unicode: bool | None = ..., line_break: str | None = ..., encoding: str | None = ..., @@ -260,7 +263,7 @@ def safe_dump( default_flow_style: bool | None = ..., canonical: bool | None = ..., indent: int | None = ..., - width: int | None = ..., + width: int | _Inf | None = ..., allow_unicode: bool | None = ..., line_break: str | None = ..., encoding: str | None = ..., diff --git a/packages/pyright-internal/typeshed-fallback/stubs/PyYAML/yaml/_yaml.pyi b/packages/pyright-internal/typeshed-fallback/stubs/PyYAML/yaml/_yaml.pyi index 5eacde576..33dfb5969 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/PyYAML/yaml/_yaml.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/PyYAML/yaml/_yaml.pyi @@ -1,4 +1,4 @@ -from _typeshed import SupportsRead +from _typeshed import Incomplete, SupportsRead from collections.abc import Mapping, Sequence from typing import IO, Any @@ -38,14 +38,14 @@ class CEmitter: def __init__( self, stream: IO[Any], - canonical: Any | None = ..., + canonical: Incomplete | None = ..., indent: int | None = ..., width: int | None = ..., - allow_unicode: Any | None = ..., + allow_unicode: Incomplete | None = ..., line_break: str | None = ..., encoding: str | None = ..., - explicit_start: Any | None = ..., - explicit_end: Any | None = ..., + explicit_start: Incomplete | None = ..., + explicit_end: Incomplete | None = ..., version: Sequence[int] | None = ..., tags: Mapping[str, str] | None = ..., ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/PyYAML/yaml/constructor.pyi b/packages/pyright-internal/typeshed-fallback/stubs/PyYAML/yaml/constructor.pyi index 75da27e7a..fb383a7db 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/PyYAML/yaml/constructor.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/PyYAML/yaml/constructor.pyi @@ -1,13 +1,16 @@ -from collections.abc import Callable +from collections.abc import Callable, Hashable +from datetime import date from re import Pattern -from typing import Any, TypeVar +from typing import Any, ClassVar, TypeVar from typing_extensions import TypeAlias from yaml.error import MarkedYAMLError -from yaml.loader import BaseLoader, FullLoader, Loader, SafeLoader, UnsafeLoader -from yaml.nodes import Node, ScalarNode +from yaml.nodes import MappingNode, Node, ScalarNode, SequenceNode -_L = TypeVar("_L", bound=Loader | BaseLoader | FullLoader | SafeLoader | UnsafeLoader) +from .cyaml import _CLoader +from .loader import _Loader + +_L = TypeVar("_L", bound=_Loader | _CLoader) _N = TypeVar("_N", bound=Node) _Scalar: TypeAlias = str | int | float | bool | None @@ -29,8 +32,8 @@ class BaseConstructor: def construct_document(self, node): ... def construct_object(self, node, deep=...): ... def construct_scalar(self, node: ScalarNode) -> _Scalar: ... - def construct_sequence(self, node, deep=...): ... - def construct_mapping(self, node, deep=...): ... + def construct_sequence(self, node: SequenceNode, deep: bool = ...) -> list[Any]: ... + def construct_mapping(self, node: MappingNode, deep: bool = ...) -> dict[Hashable, Any]: ... def construct_pairs(self, node, deep=...): ... @classmethod # Use typevars so we can have covariant behaviour in the parameter types @@ -40,18 +43,18 @@ class BaseConstructor: class SafeConstructor(BaseConstructor): def construct_scalar(self, node: ScalarNode) -> _Scalar: ... - def flatten_mapping(self, node): ... - def construct_mapping(self, node, deep=...): ... - def construct_yaml_null(self, node): ... - bool_values: Any - def construct_yaml_bool(self, node): ... - def construct_yaml_int(self, node): ... - inf_value: Any - nan_value: Any - def construct_yaml_float(self, node): ... - def construct_yaml_binary(self, node): ... - timestamp_regexp: Any - def construct_yaml_timestamp(self, node): ... + def flatten_mapping(self, node: MappingNode) -> None: ... + def construct_mapping(self, node: MappingNode, deep: bool = ...) -> dict[Hashable, Any]: ... + def construct_yaml_null(self, node: ScalarNode) -> None: ... + bool_values: ClassVar[dict[str, bool]] + def construct_yaml_bool(self, node: ScalarNode) -> bool: ... + def construct_yaml_int(self, node: ScalarNode) -> int: ... + inf_value: ClassVar[float] + nan_value: ClassVar[float] + def construct_yaml_float(self, node: ScalarNode) -> float: ... + def construct_yaml_binary(self, node: ScalarNode) -> bytes: ... + timestamp_regexp: ClassVar[Pattern[str]] + def construct_yaml_timestamp(self, node: ScalarNode) -> date: ... def construct_yaml_omap(self, node): ... def construct_yaml_pairs(self, node): ... def construct_yaml_set(self, node): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/PyYAML/yaml/cyaml.pyi b/packages/pyright-internal/typeshed-fallback/stubs/PyYAML/yaml/cyaml.pyi index 3fced1def..90870b0e0 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/PyYAML/yaml/cyaml.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/PyYAML/yaml/cyaml.pyi @@ -1,4 +1,4 @@ -from _typeshed import SupportsRead +from _typeshed import Incomplete, SupportsRead from collections.abc import Mapping, Sequence from typing import IO, Any from typing_extensions import TypeAlias @@ -11,6 +11,7 @@ from .resolver import BaseResolver, Resolver __all__ = ["CBaseLoader", "CSafeLoader", "CFullLoader", "CUnsafeLoader", "CLoader", "CBaseDumper", "CSafeDumper", "CDumper"] _Readable: TypeAlias = SupportsRead[str | bytes] +_CLoader: TypeAlias = CLoader | CBaseLoader | CFullLoader | CSafeLoader | CUnsafeLoader # noqa: Y047 # Used in other modules class CBaseLoader(CParser, BaseConstructor, BaseResolver): def __init__(self, stream: str | bytes | _Readable) -> None: ... @@ -33,14 +34,14 @@ class CBaseDumper(CEmitter, BaseRepresenter, BaseResolver): stream: IO[Any], default_style: str | None = ..., default_flow_style: bool | None = ..., - canonical: Any | None = ..., + canonical: Incomplete | None = ..., indent: int | None = ..., width: int | None = ..., - allow_unicode: Any | None = ..., + allow_unicode: Incomplete | None = ..., line_break: str | None = ..., encoding: str | None = ..., - explicit_start: Any | None = ..., - explicit_end: Any | None = ..., + explicit_start: Incomplete | None = ..., + explicit_end: Incomplete | None = ..., version: Sequence[int] | None = ..., tags: Mapping[str, str] | None = ..., sort_keys: bool = ..., @@ -52,14 +53,14 @@ class CDumper(CEmitter, SafeRepresenter, Resolver): stream: IO[Any], default_style: str | None = ..., default_flow_style: bool = ..., - canonical: Any | None = ..., + canonical: Incomplete | None = ..., indent: int | None = ..., width: int | None = ..., - allow_unicode: Any | None = ..., + allow_unicode: Incomplete | None = ..., line_break: str | None = ..., encoding: str | None = ..., - explicit_start: Any | None = ..., - explicit_end: Any | None = ..., + explicit_start: Incomplete | None = ..., + explicit_end: Incomplete | None = ..., version: Sequence[int] | None = ..., tags: Mapping[str, str] | None = ..., sort_keys: bool = ..., diff --git a/packages/pyright-internal/typeshed-fallback/stubs/PyYAML/yaml/dumper.pyi b/packages/pyright-internal/typeshed-fallback/stubs/PyYAML/yaml/dumper.pyi index 040aa0fed..7203aaeab 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/PyYAML/yaml/dumper.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/PyYAML/yaml/dumper.pyi @@ -1,5 +1,6 @@ from collections.abc import Mapping from typing import Any +from typing_extensions import TypeAlias from yaml.emitter import Emitter from yaml.representer import BaseRepresenter, Representer, SafeRepresenter @@ -8,6 +9,10 @@ from yaml.serializer import Serializer from .emitter import _WriteStream +# Ideally, there would be a way to limit these values to only +/- float("inf"), +# but that's not possible at the moment (https://github.com/python/typing/issues/1160). +_Inf: TypeAlias = float + class BaseDumper(Emitter, Serializer, BaseRepresenter, BaseResolver): def __init__( self, @@ -16,7 +21,7 @@ class BaseDumper(Emitter, Serializer, BaseRepresenter, BaseResolver): default_flow_style: bool | None = ..., canonical: bool | None = ..., indent: int | None = ..., - width: int | None = ..., + width: int | _Inf | None = ..., allow_unicode: bool | None = ..., line_break: str | None = ..., encoding: str | None = ..., @@ -35,7 +40,7 @@ class SafeDumper(Emitter, Serializer, SafeRepresenter, Resolver): default_flow_style: bool | None = ..., canonical: bool | None = ..., indent: int | None = ..., - width: int | None = ..., + width: int | _Inf | None = ..., allow_unicode: bool | None = ..., line_break: str | None = ..., encoding: str | None = ..., @@ -54,7 +59,7 @@ class Dumper(Emitter, Serializer, Representer, Resolver): default_flow_style: bool | None = ..., canonical: bool | None = ..., indent: int | None = ..., - width: int | None = ..., + width: int | _Inf | None = ..., allow_unicode: bool | None = ..., line_break: str | None = ..., encoding: str | None = ..., diff --git a/packages/pyright-internal/typeshed-fallback/stubs/PyYAML/yaml/loader.pyi b/packages/pyright-internal/typeshed-fallback/stubs/PyYAML/yaml/loader.pyi index 89dea9aaf..950f18f9c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/PyYAML/yaml/loader.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/PyYAML/yaml/loader.pyi @@ -1,3 +1,5 @@ +from typing_extensions import TypeAlias + from yaml.composer import Composer from yaml.constructor import BaseConstructor, Constructor, FullConstructor, SafeConstructor from yaml.parser import Parser @@ -7,6 +9,8 @@ from yaml.scanner import Scanner from .reader import _ReadStream +_Loader: TypeAlias = Loader | BaseLoader | FullLoader | SafeLoader | UnsafeLoader # noqa: Y047 # Used in other modules + class BaseLoader(Reader, Scanner, Parser, Composer, BaseConstructor, BaseResolver): def __init__(self, stream: _ReadStream) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/PyYAML/yaml/nodes.pyi b/packages/pyright-internal/typeshed-fallback/stubs/PyYAML/yaml/nodes.pyi index 98e61e296..4ee971260 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/PyYAML/yaml/nodes.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/PyYAML/yaml/nodes.pyi @@ -2,6 +2,9 @@ from typing import Any, ClassVar from yaml.error import Mark +# Any Unions: Avoid forcing the user to check for None when they know what Node was instantiated with +# Using generics may be overkill without support for default Generics +# Permissive Unions could also be useful here. class Node: tag: str value: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/PyYAML/yaml/representer.pyi b/packages/pyright-internal/typeshed-fallback/stubs/PyYAML/yaml/representer.pyi index f9802d2df..35f82355c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/PyYAML/yaml/representer.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/PyYAML/yaml/representer.pyi @@ -1,5 +1,5 @@ import datetime -from _typeshed import SupportsItems +from _typeshed import Incomplete, ReadableBuffer, SupportsItems from collections.abc import Callable, Iterable, Mapping from types import BuiltinFunctionType, FunctionType, ModuleType from typing import Any, ClassVar, NoReturn, TypeVar @@ -15,12 +15,12 @@ class RepresenterError(YAMLError): ... class BaseRepresenter: yaml_representers: ClassVar[dict[type[Any], Callable[[BaseRepresenter, Any], Node]]] yaml_multi_representers: ClassVar[dict[type[Any], Callable[[BaseRepresenter, Any], Node]]] - default_style: str | Any + default_style: str | Incomplete sort_keys: bool default_flow_style: bool represented_objects: dict[int, Node] object_keeper: list[Any] - alias_key: int | Any + alias_key: int | Incomplete def __init__(self, default_style: str | None = ..., default_flow_style: bool = ..., sort_keys: bool = ...) -> None: ... def represent(self, data) -> None: ... def represent_data(self, data) -> Node: ... @@ -40,7 +40,7 @@ class SafeRepresenter(BaseRepresenter): def ignore_aliases(self, data) -> bool: ... def represent_none(self, data) -> ScalarNode: ... def represent_str(self, data: str) -> ScalarNode: ... - def represent_binary(self, data: bytes) -> ScalarNode: ... + def represent_binary(self, data: ReadableBuffer) -> ScalarNode: ... def represent_bool(self, data: bool) -> ScalarNode: ... def represent_int(self, data: int) -> ScalarNode: ... def represent_float(self, data: float) -> ScalarNode: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/METADATA.toml index 36c4da25e..3f4ba4a90 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/METADATA.toml @@ -1,2 +1,6 @@ -version = "2.12.*" +version = "2.14.*" requires = ["types-docutils", "types-setuptools"] + +[tool.stubtest] +stubtest_requirements = ["sphinx"] +ignore_missing_stub = true diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/cmdline.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/cmdline.pyi index 2226b9834..76dbb3b3a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/cmdline.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/cmdline.pyi @@ -1,9 +1,11 @@ import argparse -from typing import Any +from _typeshed import Incomplete def main_inner(parser, argns): ... class HelpFormatter(argparse.HelpFormatter): - def __init__(self, prog, indent_increment: int = ..., max_help_position: int = ..., width: Any | None = ...) -> None: ... + def __init__( + self, prog, indent_increment: int = ..., max_help_position: int = ..., width: Incomplete | None = ... + ) -> None: ... def main(args=...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/filter.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/filter.pyi index b1437328b..52676b63c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/filter.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/filter.pyi @@ -1,10 +1,11 @@ +from _typeshed import Incomplete from collections.abc import Iterable, Iterator from typing import Any from pygments.lexer import Lexer from pygments.token import _TokenType -def apply_filters(stream, filters, lexer: Any | None = ...): ... +def apply_filters(stream, filters, lexer: Incomplete | None = ...): ... def simplefilter(f): ... class Filter: diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/html.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/html.pyi index b04ca1e51..b34348ff9 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/html.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/html.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any, TypeVar from pygments.formatter import Formatter @@ -32,9 +33,9 @@ class HtmlFormatter(Formatter[_T]): linespans: Any anchorlinenos: Any hl_lines: Any - def get_style_defs(self, arg: Any | None = ...): ... - def get_token_style_defs(self, arg: Any | None = ...): ... - def get_background_style_defs(self, arg: Any | None = ...): ... + def get_style_defs(self, arg: Incomplete | None = ...): ... + def get_token_style_defs(self, arg: Incomplete | None = ...): ... + def get_background_style_defs(self, arg: Incomplete | None = ...): ... def get_linenos_style_defs(self): ... def get_css_prefix(self, arg): ... def wrap(self, source): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/terminal256.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/terminal256.pyi index 69f30cc19..82b06aecb 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/terminal256.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/terminal256.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any, TypeVar from pygments.formatter import Formatter @@ -11,7 +12,12 @@ class EscapeSequence: underline: Any italic: Any def __init__( - self, fg: Any | None = ..., bg: Any | None = ..., bold: bool = ..., underline: bool = ..., italic: bool = ... + self, + fg: Incomplete | None = ..., + bg: Incomplete | None = ..., + bold: bool = ..., + underline: bool = ..., + italic: bool = ..., ) -> None: ... def escape(self, attrs): ... def color_string(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/lexer.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/lexer.pyi index 6267debf3..deda4ff56 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/lexer.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/lexer.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from collections.abc import Iterable, Iterator, Sequence from typing import Any @@ -46,9 +47,9 @@ class combined(tuple[Any, ...]): class _PseudoMatch: def __init__(self, start, text) -> None: ... - def start(self, arg: Any | None = ...): ... - def end(self, arg: Any | None = ...): ... - def group(self, arg: Any | None = ...): ... + def start(self, arg: Incomplete | None = ...): ... + def end(self, arg: Incomplete | None = ...): ... + def group(self, arg: Incomplete | None = ...): ... def groups(self): ... def groupdict(self): ... @@ -72,7 +73,7 @@ class words(Future): def get(self): ... class RegexLexerMeta(LexerMeta): - def process_tokendef(cls, name, tokendefs: Any | None = ...): ... + def process_tokendef(cls, name, tokendefs: Incomplete | None = ...): ... def get_tokendefs(cls): ... def __call__(cls, *args, **kwds): ... @@ -86,7 +87,7 @@ class LexerContext: pos: Any end: Any stack: Any - def __init__(self, text, pos, stack: Any | None = ..., end: Any | None = ...) -> None: ... + def __init__(self, text, pos, stack: Incomplete | None = ..., end: Incomplete | None = ...) -> None: ... class ExtendedRegexLexer(RegexLexer): def get_tokens_unprocessed( # type: ignore[override] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/lexers/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/lexers/__init__.pyi index 71c5d856f..4421d7a29 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/lexers/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/lexers/__init__.pyi @@ -1,22 +1,19 @@ -from _typeshed import StrOrBytesPath, StrPath +from _typeshed import FileDescriptorOrPath, Incomplete, StrPath from collections.abc import Iterator from typing import Any -from typing_extensions import TypeAlias from pygments.lexer import Lexer, LexerMeta -_OpenFile: TypeAlias = StrOrBytesPath | int # copy/pasted from builtins.pyi - def get_all_lexers(plugins: bool = ...) -> 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: _OpenFile, lexername: str = ..., **options: Any) -> Lexer: ... +def load_lexer_from_file(filename: FileDescriptorOrPath, lexername: str = ..., **options: Any) -> Lexer: ... def find_lexer_class_for_filename(_fn: StrPath, code: str | bytes | None = ...) -> LexerMeta | None: ... def get_lexer_for_filename(_fn: StrPath, code: str | bytes | 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) -> LexerMeta | None: ... +def guess_lexer_for_filename(_fn: StrPath, _text: str, **options: Any) -> LexerMeta: ... def guess_lexer(_text: str | bytes, **options: Any) -> Lexer: ... # Having every lexer class here doesn't seem to be worth it -def __getattr__(name: str) -> Any: ... +def __getattr__(name: str) -> Incomplete: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/styles/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/styles/__init__.pyi index 842f507ab..77d42db8f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/styles/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/styles/__init__.pyi @@ -1,13 +1,13 @@ +from _typeshed import Incomplete from collections.abc import Iterator, Mapping -from typing import Any -from pygments.style import StyleMeta +from pygments.style import Style from pygments.util import ClassNotFound as ClassNotFound STYLE_MAP: Mapping[str, str] -def get_style_by_name(name) -> StyleMeta: ... +def get_style_by_name(name) -> type[Style]: ... def get_all_styles() -> Iterator[str]: ... # Having every style class here doesn't seem to be worth it -def __getattr__(name: str) -> Any: ... +def __getattr__(name: str) -> Incomplete: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/token.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/token.pyi index 9fb24b751..cd63f2b61 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/token.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/token.pyi @@ -1,6 +1,6 @@ -from _typeshed import Self from collections.abc import Mapping from typing import Any +from typing_extensions import Self class _TokenType(tuple[str, ...]): parent: _TokenType | None @@ -8,8 +8,8 @@ class _TokenType(tuple[str, ...]): subtypes: set[_TokenType] def __contains__(self, val: _TokenType) -> bool: ... # type: ignore[override] def __getattr__(self, name: str) -> _TokenType: ... - def __copy__(self: Self) -> Self: ... - def __deepcopy__(self: Self, memo: Any) -> Self: ... + def __copy__(self) -> Self: ... + def __deepcopy__(self, memo: Any) -> Self: ... Token: _TokenType Text: _TokenType diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/util.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/util.pyi index 23addc163..13ecaabe0 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/util.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/util.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from io import TextIOWrapper from typing import Any @@ -9,10 +10,10 @@ xml_decl_re: Any class ClassNotFound(ValueError): ... class OptionError(Exception): ... -def get_choice_opt(options, optname, allowed, default: Any | None = ..., normcase: bool = ...): ... -def get_bool_opt(options, optname, default: Any | None = ...): ... -def get_int_opt(options, optname, default: Any | None = ...): ... -def get_list_opt(options, optname, default: Any | None = ...): ... +def get_choice_opt(options, optname, allowed, default: Incomplete | None = ..., normcase: bool = ...): ... +def get_bool_opt(options, optname, default: Incomplete | None = ...): ... +def get_int_opt(options, optname, default: Incomplete | None = ...): ... +def get_list_opt(options, optname, default: Incomplete | None = ...): ... def docstring_headline(obj): ... def make_analysator(f): ... def shebang_matches(text, regex): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/METADATA.toml index 5a3c17ff0..ac906398b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/METADATA.toml @@ -1,5 +1,10 @@ -version = "1.4.*" +version = "1.4.46" extra_description = """\ The `sqlalchemy-stubs` package is an alternative to this package and also \ includes a mypy plugin for more precise types.\ """ +obsolete_since = "2.0.0" # Released on 2023-01-26 + +[tool.stubtest] +stubtest_requirements = ["pytest"] +ignore_missing_stub = true diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/connectors/mxodbc.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/connectors/mxodbc.pyi index d3bfccd46..350b3df4a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/connectors/mxodbc.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/connectors/mxodbc.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete from . import Connector @@ -13,5 +13,5 @@ class MxODBCConnector(Connector): def on_connect(self): ... def create_connect_args(self, url): ... def is_disconnect(self, e, connection, cursor): ... - def do_executemany(self, cursor, statement, parameters, context: Any | None = ...) -> None: ... - def do_execute(self, cursor, statement, parameters, context: Any | None = ...) -> None: ... + def do_executemany(self, cursor, statement, parameters, context: Incomplete | None = ...) -> None: ... + def do_execute(self, cursor, statement, parameters, context: Incomplete | None = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/connectors/pyodbc.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/connectors/pyodbc.pyi index e821b1964..b0b7ce25d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/connectors/pyodbc.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/connectors/pyodbc.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from . import Connector @@ -12,7 +13,7 @@ class PyODBCConnector(Connector): default_paramstyle: str use_setinputsizes: bool pyodbc_driver_name: Any - def __init__(self, supports_unicode_binds: Any | None = ..., use_setinputsizes: bool = ..., **kw) -> None: ... + def __init__(self, supports_unicode_binds: Incomplete | None = ..., use_setinputsizes: bool = ..., **kw) -> None: ... @classmethod def dbapi(cls): ... def create_connect_args(self, url): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/cresultproxy.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/cresultproxy.pyi index a1e830277..4bf9b9ea1 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/cresultproxy.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/cresultproxy.pyi @@ -1,11 +1,23 @@ -from typing import Any +from _typeshed import Incomplete +from collections.abc import Callable, Iterable, Iterator +from typing import Any, overload class BaseRow: - def __init__(self, parent, processors, keymap, key_style, data) -> None: ... - def __reduce__(self): ... - def __iter__(self): ... - def __len__(self): ... - def __hash__(self): ... - __getitem__: Any + def __init__( + self, + __parent, + __processors: Iterable[Callable[[Any], Any]] | None, + __keymap: dict[Incomplete, Incomplete], + __key_style: int, + __row: Iterable[Any], + ) -> None: ... + def __reduce__(self) -> tuple[Incomplete, tuple[Incomplete, Incomplete]]: ... + def __iter__(self) -> Iterator[Any]: ... + def __len__(self) -> int: ... + def __hash__(self) -> int: ... + @overload + def __getitem__(self, __key: str | int) -> tuple[Any, ...]: ... + @overload + def __getitem__(self, __key: slice) -> tuple[tuple[Any, ...]]: ... def safe_rowproxy_reconstructor(__cls, __state): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/base.pyi index d6764ab69..564282e8e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/base.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/base.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from sqlalchemy import sql, types as sqltypes @@ -21,15 +22,15 @@ RESERVED_WORDS: Any class _StringType(sqltypes.String): charset: Any - def __init__(self, charset: Any | None = ..., **kw) -> None: ... + def __init__(self, charset: Incomplete | None = ..., **kw) -> None: ... class VARCHAR(_StringType, sqltypes.VARCHAR): __visit_name__: str - def __init__(self, length: Any | None = ..., **kwargs) -> None: ... + def __init__(self, length: Incomplete | None = ..., **kwargs) -> None: ... class CHAR(_StringType, sqltypes.CHAR): __visit_name__: str - def __init__(self, length: Any | None = ..., **kwargs) -> None: ... + def __init__(self, length: Incomplete | None = ..., **kwargs) -> None: ... class _FBDateTime(sqltypes.DateTime): def bind_processor(self, dialect): ... @@ -96,13 +97,13 @@ class FBDialect(default.DefaultDialect): def __init__(self, *args, **kwargs) -> None: ... implicit_returning: Any def initialize(self, connection) -> None: ... - def has_table(self, connection, table_name, schema: Any | None = ...): ... # type: ignore[override] - def has_sequence(self, connection, sequence_name, schema: Any | None = ...): ... # type: ignore[override] - def get_table_names(self, connection, schema: Any | None = ..., **kw): ... - def get_view_names(self, connection, schema: Any | None = ..., **kw): ... - def get_view_definition(self, connection, view_name, schema: Any | None = ..., **kw): ... - def get_pk_constraint(self, connection, table_name, schema: Any | None = ..., **kw): ... - def get_column_sequence(self, connection, table_name, column_name, schema: Any | None = ..., **kw): ... - def get_columns(self, connection, table_name, schema: Any | None = ..., **kw): ... - def get_foreign_keys(self, connection, table_name, schema: Any | None = ..., **kw): ... - def get_indexes(self, connection, table_name, schema: Any | None = ..., **kw): ... + def has_table(self, connection, table_name, schema: Incomplete | None = ...): ... # type: ignore[override] + def has_sequence(self, connection, sequence_name, schema: Incomplete | None = ...): ... # type: ignore[override] + def get_table_names(self, connection, schema: Incomplete | None = ..., **kw): ... + def get_view_names(self, connection, schema: Incomplete | None = ..., **kw): ... + def get_view_definition(self, connection, view_name, schema: Incomplete | None = ..., **kw): ... + def get_pk_constraint(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... + def get_column_sequence(self, connection, table_name, column_name, schema: Incomplete | None = ..., **kw): ... + def get_columns(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... + def get_foreign_keys(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... + def get_indexes(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/kinterbasdb.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/kinterbasdb.pyi index a46e1c361..09d3dabd6 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/kinterbasdb.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/kinterbasdb.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from ...types import Float, Numeric @@ -29,7 +30,7 @@ class FBDialect_kinterbasdb(FBDialect): ) -> None: ... @classmethod def dbapi(cls): ... - def do_execute(self, cursor, statement, parameters, context: Any | None = ...) -> None: ... + def do_execute(self, cursor, statement, parameters, context: Incomplete | None = ...) -> None: ... def do_rollback(self, dbapi_connection) -> None: ... def do_commit(self, dbapi_connection) -> None: ... def create_connect_args(self, url): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/base.pyi index 3ff313abf..47b9703ad 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/base.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/base.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any, overload from typing_extensions import Literal @@ -46,7 +47,7 @@ class _MSDate(sqltypes.Date): class TIME(sqltypes.TIME): precision: Any - def __init__(self, precision: Any | None = ..., **kwargs) -> None: ... + def __init__(self, precision: Incomplete | None = ..., **kwargs) -> None: ... def bind_processor(self, dialect): ... def result_processor(self, dialect, coltype): ... @@ -66,12 +67,12 @@ class SMALLDATETIME(_DateTimeBase, sqltypes.DateTime): class DATETIME2(_DateTimeBase, sqltypes.DateTime): __visit_name__: str precision: Any - def __init__(self, precision: Any | None = ..., **kw) -> None: ... + def __init__(self, precision: Incomplete | None = ..., **kw) -> None: ... class DATETIMEOFFSET(_DateTimeBase, sqltypes.DateTime): __visit_name__: str precision: Any - def __init__(self, precision: Any | None = ..., **kw) -> None: ... + def __init__(self, precision: Incomplete | None = ..., **kw) -> None: ... class _UnicodeLiteral: def literal_processor(self, dialect): ... @@ -100,7 +101,7 @@ class VARBINARY(sqltypes.VARBINARY, sqltypes.LargeBinary): @overload def __init__(self, *, filestream: Literal[True]) -> None: ... @overload - def __init__(self, length: Any | None = ..., filestream: Literal[False] = ...) -> None: ... + def __init__(self, length: Incomplete | None = ..., filestream: Literal[False] = ...) -> None: ... class IMAGE(sqltypes.LargeBinary): __visit_name__: str @@ -222,7 +223,7 @@ class MSSQLCompiler(compiler.SQLCompiler): def translate_select_structure(self, select_stmt, **kwargs): ... def visit_table(self, table, mssql_aliased: bool = ..., iscrud: bool = ..., **kwargs): ... # type: ignore[override] def visit_alias(self, alias, **kw): ... - def visit_column(self, column, add_to_result_map: Any | None = ..., **kw): ... # type: ignore[override] + def visit_column(self, column, add_to_result_map: Incomplete | None = ..., **kw): ... # type: ignore[override] def visit_extract(self, extract, **kw): ... def visit_savepoint(self, savepoint_stmt): ... def visit_rollback_to_savepoint(self, savepoint_stmt): ... @@ -261,7 +262,7 @@ class MSDDLCompiler(compiler.DDLCompiler): class MSIdentifierPreparer(compiler.IdentifierPreparer): reserved_words: Any def __init__(self, dialect) -> None: ... - def quote_schema(self, schema, force: Any | None = ...): ... + def quote_schema(self, schema, force: Incomplete | None = ...): ... class MSDialect(default.DefaultDialect): name: str @@ -295,20 +296,21 @@ class MSDialect(default.DefaultDialect): isolation_level: Any def __init__( self, - query_timeout: Any | None = ..., + query_timeout: Incomplete | None = ..., use_scope_identity: bool = ..., schema_name: str = ..., - isolation_level: Any | None = ..., - deprecate_large_types: Any | None = ..., - json_serializer: Any | None = ..., - json_deserializer: Any | None = ..., - legacy_schema_aliasing: Any | None = ..., + isolation_level: Incomplete | None = ..., + deprecate_large_types: Incomplete | None = ..., + json_serializer: Incomplete | None = ..., + json_deserializer: Incomplete | None = ..., + legacy_schema_aliasing: Incomplete | None = ..., + ignore_no_transaction_on_rollback: bool = ..., **opts, ) -> None: ... def do_savepoint(self, connection, name) -> None: ... def do_release_savepoint(self, connection, name) -> None: ... def set_isolation_level(self, connection, level) -> None: ... - def get_isolation_level(self, connection): ... + def get_isolation_level(self, dbapi_connection): ... def initialize(self, connection) -> None: ... def on_connect(self): ... def has_table(self, connection, tablename, dbname, owner, schema): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/mxodbc.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/mxodbc.pyi index bddc1929a..ee58d3dec 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/mxodbc.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/mxodbc.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from ...connectors.mxodbc import MxODBCConnector @@ -21,6 +22,6 @@ class MSDialect_mxodbc(MxODBCConnector, MSDialect): supports_statement_cache: bool colspecs: Any description_encoding: Any - def __init__(self, description_encoding: Any | None = ..., **params) -> None: ... + def __init__(self, description_encoding: Incomplete | None = ..., **params) -> None: ... dialect = MSDialect_mxodbc diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/pyodbc.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/pyodbc.pyi index 907824cea..0ee156b64 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/pyodbc.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/pyodbc.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from ...connectors.pyodbc import PyODBCConnector @@ -36,9 +37,9 @@ class MSDialect_pyodbc(PyODBCConnector, MSDialect): description_encoding: Any use_scope_identity: Any fast_executemany: Any - def __init__(self, description_encoding: Any | None = ..., fast_executemany: bool = ..., **params) -> None: ... + def __init__(self, description_encoding: Incomplete | None = ..., fast_executemany: bool = ..., **params) -> None: ... def on_connect(self): ... - def do_executemany(self, cursor, statement, parameters, context: Any | None = ...) -> None: ... + def do_executemany(self, cursor, statement, parameters, context: Incomplete | None = ...) -> None: ... def is_disconnect(self, e, connection, cursor): ... dialect = MSDialect_pyodbc diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/aiomysql.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/aiomysql.pyi index 4021fd906..3dc245d01 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/aiomysql.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/aiomysql.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from ...engine import AdaptedConnection @@ -18,12 +19,12 @@ class AsyncAdapt_aiomysql_cursor: @property def lastrowid(self): ... def close(self) -> None: ... - def execute(self, operation, parameters: Any | None = ...): ... + def execute(self, operation, parameters: Incomplete | None = ...): ... def executemany(self, operation, seq_of_parameters): ... def setinputsizes(self, *inputsizes) -> None: ... def __iter__(self): ... def fetchone(self): ... - def fetchmany(self, size: Any | None = ...): ... + def fetchmany(self, size: Incomplete | None = ...): ... def fetchall(self): ... class AsyncAdapt_aiomysql_ss_cursor(AsyncAdapt_aiomysql_cursor): @@ -32,7 +33,7 @@ class AsyncAdapt_aiomysql_ss_cursor(AsyncAdapt_aiomysql_cursor): def __init__(self, adapt_connection) -> None: ... def close(self) -> None: ... def fetchone(self): ... - def fetchmany(self, size: Any | None = ...): ... + def fetchmany(self, size: Incomplete | None = ...): ... def fetchall(self): ... class AsyncAdapt_aiomysql_connection(AdaptedConnection): diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/asyncmy.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/asyncmy.pyi index 68d058563..69a9d5576 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/asyncmy.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/asyncmy.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from ...engine import AdaptedConnection @@ -18,12 +19,12 @@ class AsyncAdapt_asyncmy_cursor: @property def lastrowid(self): ... def close(self) -> None: ... - def execute(self, operation, parameters: Any | None = ...): ... + def execute(self, operation, parameters: Incomplete | None = ...): ... def executemany(self, operation, seq_of_parameters): ... def setinputsizes(self, *inputsizes) -> None: ... def __iter__(self): ... def fetchone(self): ... - def fetchmany(self, size: Any | None = ...): ... + def fetchmany(self, size: Incomplete | None = ...): ... def fetchall(self): ... class AsyncAdapt_asyncmy_ss_cursor(AsyncAdapt_asyncmy_cursor): @@ -32,7 +33,7 @@ class AsyncAdapt_asyncmy_ss_cursor(AsyncAdapt_asyncmy_cursor): def __init__(self, adapt_connection) -> None: ... def close(self) -> None: ... def fetchone(self): ... - def fetchmany(self, size: Any | None = ...): ... + def fetchmany(self, size: Incomplete | None = ...): ... def fetchall(self): ... class AsyncAdapt_asyncmy_connection(AdaptedConnection): diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/base.pyi index a7b58f6ea..129de51eb 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/base.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/base.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from ...engine import default @@ -88,13 +89,13 @@ class MySQLCompiler(compiler.SQLCompiler): def visit_mysql_match(self, element, **kw): ... def visit_match_op_binary(self, binary, operator, **kw): ... def get_from_hint_text(self, table, text): ... - def visit_typeclause(self, typeclause, type_: Any | None = ..., **kw): ... + def visit_typeclause(self, typeclause, type_: Incomplete | None = ..., **kw): ... def visit_cast(self, cast, **kw): ... def render_literal_value(self, value, type_): ... def visit_true(self, element, **kw): ... def visit_false(self, element, **kw): ... def get_select_precolumns(self, select, **kw): ... - def visit_join(self, join, asfrom: bool = ..., from_linter: Any | None = ..., **kwargs): ... + def visit_join(self, join, asfrom: bool = ..., from_linter: Incomplete | None = ..., **kwargs): ... def for_update_clause(self, select, **kw): ... def limit_clause(self, select, **kw): ... def update_limit_clause(self, update_stmt): ... @@ -198,10 +199,10 @@ class MySQLDialect(default.DefaultDialect): isolation_level: Any def __init__( self, - isolation_level: Any | None = ..., - json_serializer: Any | None = ..., - json_deserializer: Any | None = ..., - is_mariadb: Any | None = ..., + isolation_level: Incomplete | None = ..., + json_serializer: Incomplete | None = ..., + json_deserializer: Incomplete | None = ..., + is_mariadb: Incomplete | None = ..., **kwargs, ) -> None: ... def on_connect(self): ... @@ -213,27 +214,27 @@ class MySQLDialect(default.DefaultDialect): def do_commit_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...) -> None: ... def do_recover_twophase(self, connection): ... def is_disconnect(self, e, connection, cursor): ... - def has_table(self, connection, table_name, schema: Any | None = ...): ... # type: ignore[override] - def has_sequence(self, connection, sequence_name, schema: Any | None = ...): ... # type: ignore[override] - def get_sequence_names(self, connection, schema: Any | None = ..., **kw): ... + def has_table(self, connection, table_name, schema: Incomplete | None = ...): ... # type: ignore[override] + def has_sequence(self, connection, sequence_name, schema: Incomplete | None = ...): ... # type: ignore[override] + def get_sequence_names(self, connection, schema: Incomplete | None = ..., **kw): ... identifier_preparer: Any def initialize(self, connection) -> None: ... def get_schema_names(self, connection, **kw): ... - def get_table_names(self, connection, schema: Any | None = ..., **kw): ... - def get_view_names(self, connection, schema: Any | None = ..., **kw): ... - def get_table_options(self, connection, table_name, schema: Any | None = ..., **kw): ... - def get_columns(self, connection, table_name, schema: Any | None = ..., **kw): ... - def get_pk_constraint(self, connection, table_name, schema: Any | None = ..., **kw): ... - def get_foreign_keys(self, connection, table_name, schema: Any | None = ..., **kw): ... - def get_check_constraints(self, connection, table_name, schema: Any | None = ..., **kw): ... - def get_table_comment(self, connection, table_name, schema: Any | None = ..., **kw): ... - def get_indexes(self, connection, table_name, schema: Any | None = ..., **kw): ... - def get_unique_constraints(self, connection, table_name, schema: Any | None = ..., **kw): ... - def get_view_definition(self, connection, view_name, schema: Any | None = ..., **kw): ... + def get_table_names(self, connection, schema: Incomplete | None = ..., **kw): ... + def get_view_names(self, connection, schema: Incomplete | None = ..., **kw): ... + def get_table_options(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... + def get_columns(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... + def get_pk_constraint(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... + def get_foreign_keys(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... + def get_check_constraints(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... + def get_table_comment(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... + def get_indexes(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... + def get_unique_constraints(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... + def get_view_definition(self, connection, view_name, schema: Incomplete | None = ..., **kw): ... class _DecodingRow: rowproxy: Any charset: Any def __init__(self, rowproxy, charset) -> None: ... def __getitem__(self, index): ... - def __getattr__(self, attr): ... + def __getattr__(self, attr: str): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/mysqldb.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/mysqldb.pyi index bb41d161d..a8479ad8b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/mysqldb.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/mysqldb.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from ...util import memoized_property @@ -26,7 +27,7 @@ class MySQLDialect_mysqldb(MySQLDialect): def dbapi(cls): ... def on_connect(self): ... def do_ping(self, dbapi_connection): ... - def do_executemany(self, cursor, statement, parameters, context: Any | None = ...) -> None: ... - def create_connect_args(self, url, _translate_args: Any | None = ...): ... + def do_executemany(self, cursor, statement, parameters, context: Incomplete | None = ...) -> None: ... + def create_connect_args(self, url, _translate_args: Incomplete | None = ...): ... dialect = MySQLDialect_mysqldb diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/oursql.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/oursql.pyi index 40d1d6919..1bc65d97b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/oursql.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/oursql.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from .base import BIT, MySQLDialect, MySQLExecutionContext @@ -20,17 +21,17 @@ class MySQLDialect_oursql(MySQLDialect): colspecs: Any @classmethod def dbapi(cls): ... - def do_execute(self, cursor, statement, parameters, context: Any | None = ...) -> None: ... + def do_execute(self, cursor, statement, parameters, context: Incomplete | None = ...) -> None: ... def do_begin(self, connection) -> None: ... def do_begin_twophase(self, connection, xid) -> None: ... def do_prepare_twophase(self, connection, xid) -> None: ... def do_rollback_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...) -> None: ... def do_commit_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...) -> None: ... - def has_table(self, connection, table_name, schema: Any | None = ...): ... # type: ignore[override] - def get_table_options(self, connection, table_name, schema: Any | None = ..., **kw): ... - def get_columns(self, connection, table_name, schema: Any | None = ..., **kw): ... - def get_view_names(self, connection, schema: Any | None = ..., **kw): ... - def get_table_names(self, connection, schema: Any | None = ..., **kw): ... + def has_table(self, connection, table_name, schema: Incomplete | None = ...): ... # type: ignore[override] + def get_table_options(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... + def get_columns(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... + def get_view_names(self, connection, schema: Incomplete | None = ..., **kw): ... + def get_table_names(self, connection, schema: Incomplete | None = ..., **kw): ... def get_schema_names(self, connection, **kw): ... def initialize(self, connection): ... def is_disconnect(self, e, connection, cursor): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/pymysql.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/pymysql.pyi index a4f6cb64f..fa7a49088 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/pymysql.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/pymysql.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from ...util import memoized_property @@ -13,7 +14,7 @@ class MySQLDialect_pymysql(MySQLDialect_mysqldb): def supports_server_side_cursors(self): ... @classmethod def dbapi(cls): ... - def create_connect_args(self, url, _translate_args: Any | None = ...): ... + def create_connect_args(self, url, _translate_args: Incomplete | None = ...): ... def is_disconnect(self, e, connection, cursor): ... dialect = MySQLDialect_pymysql diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/reflection.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/reflection.pyi index 0df92ff88..f27c18525 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/reflection.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/reflection.pyi @@ -7,7 +7,6 @@ class ReflectedState: keys: Any fk_constraints: Any ck_constraints: Any - def __init__(self) -> None: ... class MySQLTableDefinitionParser: logger: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/types.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/types.pyi index 3086e6379..5db2c9257 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/types.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/types.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any import sqlalchemy.types as sqltypes @@ -9,11 +10,13 @@ class _NumericType: class _FloatType(_NumericType, sqltypes.Float): scale: Any - def __init__(self, precision: Any | None = ..., scale: Any | None = ..., asdecimal: bool = ..., **kw) -> None: ... + def __init__( + self, precision: Incomplete | None = ..., scale: Incomplete | None = ..., asdecimal: bool = ..., **kw + ) -> None: ... class _IntegerType(_NumericType, sqltypes.Integer): display_width: Any - def __init__(self, display_width: Any | None = ..., **kw) -> None: ... + def __init__(self, display_width: Incomplete | None = ..., **kw) -> None: ... class _StringType(sqltypes.String): charset: Any @@ -23,8 +26,8 @@ class _StringType(sqltypes.String): national: Any def __init__( self, - charset: Any | None = ..., - collation: Any | None = ..., + charset: Incomplete | None = ..., + collation: Incomplete | None = ..., ascii: bool = ..., binary: bool = ..., unicode: bool = ..., @@ -37,75 +40,85 @@ class _MatchType(sqltypes.Float, sqltypes.MatchType): # type: ignore[misc] # i class NUMERIC(_NumericType, sqltypes.NUMERIC): __visit_name__: str - def __init__(self, precision: Any | None = ..., scale: Any | None = ..., asdecimal: bool = ..., **kw) -> None: ... + def __init__( + self, precision: Incomplete | None = ..., scale: Incomplete | None = ..., asdecimal: bool = ..., **kw + ) -> None: ... class DECIMAL(_NumericType, sqltypes.DECIMAL): __visit_name__: str - def __init__(self, precision: Any | None = ..., scale: Any | None = ..., asdecimal: bool = ..., **kw) -> None: ... + def __init__( + self, precision: Incomplete | None = ..., scale: Incomplete | None = ..., asdecimal: bool = ..., **kw + ) -> None: ... class DOUBLE(_FloatType): __visit_name__: str - def __init__(self, precision: Any | None = ..., scale: Any | None = ..., asdecimal: bool = ..., **kw) -> None: ... + def __init__( + self, precision: Incomplete | None = ..., scale: Incomplete | None = ..., asdecimal: bool = ..., **kw + ) -> None: ... class REAL(_FloatType, sqltypes.REAL): __visit_name__: str - def __init__(self, precision: Any | None = ..., scale: Any | None = ..., asdecimal: bool = ..., **kw) -> None: ... + def __init__( + self, precision: Incomplete | None = ..., scale: Incomplete | None = ..., asdecimal: bool = ..., **kw + ) -> None: ... class FLOAT(_FloatType, sqltypes.FLOAT): __visit_name__: str - def __init__(self, precision: Any | None = ..., scale: Any | None = ..., asdecimal: bool = ..., **kw) -> None: ... + def __init__( + self, precision: Incomplete | None = ..., scale: Incomplete | None = ..., asdecimal: bool = ..., **kw + ) -> None: ... def bind_processor(self, dialect) -> None: ... class INTEGER(_IntegerType, sqltypes.INTEGER): __visit_name__: str - def __init__(self, display_width: Any | None = ..., **kw) -> None: ... + def __init__(self, display_width: Incomplete | None = ..., **kw) -> None: ... class BIGINT(_IntegerType, sqltypes.BIGINT): __visit_name__: str - def __init__(self, display_width: Any | None = ..., **kw) -> None: ... + def __init__(self, display_width: Incomplete | None = ..., **kw) -> None: ... class MEDIUMINT(_IntegerType): __visit_name__: str - def __init__(self, display_width: Any | None = ..., **kw) -> None: ... + def __init__(self, display_width: Incomplete | None = ..., **kw) -> None: ... class TINYINT(_IntegerType): __visit_name__: str - def __init__(self, display_width: Any | None = ..., **kw) -> None: ... + def __init__(self, display_width: Incomplete | None = ..., **kw) -> None: ... class SMALLINT(_IntegerType, sqltypes.SMALLINT): __visit_name__: str - def __init__(self, display_width: Any | None = ..., **kw) -> None: ... + def __init__(self, display_width: Incomplete | None = ..., **kw) -> None: ... class BIT(sqltypes.TypeEngine): __visit_name__: str length: Any - def __init__(self, length: Any | None = ...) -> None: ... + def __init__(self, length: Incomplete | None = ...) -> None: ... def result_processor(self, dialect, coltype): ... class TIME(sqltypes.TIME): __visit_name__: str fsp: Any - def __init__(self, timezone: bool = ..., fsp: Any | None = ...) -> None: ... + def __init__(self, timezone: bool = ..., fsp: Incomplete | None = ...) -> None: ... def result_processor(self, dialect, coltype): ... class TIMESTAMP(sqltypes.TIMESTAMP): __visit_name__: str fsp: Any - def __init__(self, timezone: bool = ..., fsp: Any | None = ...) -> None: ... + def __init__(self, timezone: bool = ..., fsp: Incomplete | None = ...) -> None: ... class DATETIME(sqltypes.DATETIME): __visit_name__: str fsp: Any - def __init__(self, timezone: bool = ..., fsp: Any | None = ...) -> None: ... + def __init__(self, timezone: bool = ..., fsp: Incomplete | None = ...) -> None: ... class YEAR(sqltypes.TypeEngine): __visit_name__: str display_width: Any - def __init__(self, display_width: Any | None = ...) -> None: ... + def __init__(self, display_width: Incomplete | None = ...) -> None: ... class TEXT(_StringType, sqltypes.TEXT): __visit_name__: str - def __init__(self, length: Any | None = ..., **kw) -> None: ... + def __init__(self, length: Incomplete | None = ..., **kw) -> None: ... class TINYTEXT(_StringType): __visit_name__: str @@ -121,19 +134,19 @@ class LONGTEXT(_StringType): class VARCHAR(_StringType, sqltypes.VARCHAR): __visit_name__: str - def __init__(self, length: Any | None = ..., **kwargs) -> None: ... + def __init__(self, length: Incomplete | None = ..., **kwargs) -> None: ... class CHAR(_StringType, sqltypes.CHAR): __visit_name__: str - def __init__(self, length: Any | None = ..., **kwargs) -> None: ... + def __init__(self, length: Incomplete | None = ..., **kwargs) -> None: ... class NVARCHAR(_StringType, sqltypes.NVARCHAR): __visit_name__: str - def __init__(self, length: Any | None = ..., **kwargs) -> None: ... + def __init__(self, length: Incomplete | None = ..., **kwargs) -> None: ... class NCHAR(_StringType, sqltypes.NCHAR): __visit_name__: str - def __init__(self, length: Any | None = ..., **kwargs) -> None: ... + def __init__(self, length: Incomplete | None = ..., **kwargs) -> None: ... class TINYBLOB(sqltypes._Binary): __visit_name__: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/oracle/base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/oracle/base.pyi index 6b9668957..9b41e88b2 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/oracle/base.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/oracle/base.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from sqlalchemy.sql import ClauseElement @@ -34,7 +35,9 @@ NVARCHAR2 = NVARCHAR class NUMBER(sqltypes.Numeric, sqltypes.Integer): __visit_name__: str - def __init__(self, precision: Any | None = ..., scale: Any | None = ..., asdecimal: Any | None = ...) -> None: ... + def __init__( + self, precision: Incomplete | None = ..., scale: Incomplete | None = ..., asdecimal: Incomplete | None = ... + ) -> None: ... def adapt(self, impltype): ... class DOUBLE_PRECISION(sqltypes.Float): @@ -59,7 +62,7 @@ class INTERVAL(sqltypes.NativeForEmulated, sqltypes._AbstractInterval): __visit_name__: str day_precision: Any second_precision: Any - def __init__(self, day_precision: Any | None = ..., second_precision: Any | None = ...) -> None: ... + def __init__(self, day_precision: Incomplete | None = ..., second_precision: Incomplete | None = ...) -> None: ... def as_generic(self, allow_nulltype: bool = ...): ... def coerce_compared_value(self, op, value): ... @@ -112,7 +115,7 @@ class OracleCompiler(compiler.SQLCompiler): def visit_function(self, func, **kw): ... def visit_table_valued_column(self, element, **kw): ... def default_from(self): ... - def visit_join(self, join, from_linter: Any | None = ..., **kwargs): ... # type: ignore[override] + def visit_join(self, join, from_linter: Incomplete | None = ..., **kwargs): ... # type: ignore[override] def visit_outer_join_column(self, vc, **kw): ... def visit_sequence(self, seq, **kw): ... def get_render_as_alias_suffix(self, alias_name_text): ... @@ -179,7 +182,7 @@ class OracleDialect(default.DefaultDialect): self, use_ansi: bool = ..., optimize_limits: bool = ..., - use_binds_for_limits: Any | None = ..., + use_binds_for_limits: Incomplete | None = ..., use_nchar_for_unicode: bool = ..., exclude_tablespaces=..., **kwargs, @@ -190,28 +193,28 @@ class OracleDialect(default.DefaultDialect): def get_isolation_level(self, connection) -> None: ... def get_default_isolation_level(self, dbapi_conn): ... def set_isolation_level(self, connection, level) -> None: ... - def has_table(self, connection, table_name, schema: Any | None = ...): ... # type: ignore[override] - def has_sequence(self, connection, sequence_name, schema: Any | None = ...): ... # type: ignore[override] + def has_table(self, connection, table_name, schema: Incomplete | None = ...): ... # type: ignore[override] + def has_sequence(self, connection, sequence_name, schema: Incomplete | None = ...): ... # type: ignore[override] def get_schema_names(self, connection, **kw): ... - def get_table_names(self, connection, schema: Any | None = ..., **kw): ... + def get_table_names(self, connection, schema: Incomplete | None = ..., **kw): ... def get_temp_table_names(self, connection, **kw): ... - def get_view_names(self, connection, schema: Any | None = ..., **kw): ... - def get_sequence_names(self, connection, schema: Any | None = ..., **kw): ... - def get_table_options(self, connection, table_name, schema: Any | None = ..., **kw): ... - def get_columns(self, connection, table_name, schema: Any | None = ..., **kw): ... + def get_view_names(self, connection, schema: Incomplete | None = ..., **kw): ... + def get_sequence_names(self, connection, schema: Incomplete | None = ..., **kw): ... + def get_table_options(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... + def get_columns(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... def get_table_comment( - self, connection, table_name, schema: Any | None = ..., resolve_synonyms: bool = ..., dblink: str = ..., **kw + self, connection, table_name, schema: Incomplete | None = ..., resolve_synonyms: bool = ..., dblink: str = ..., **kw ): ... def get_indexes( - self, connection, table_name, schema: Any | None = ..., resolve_synonyms: bool = ..., dblink: str = ..., **kw + self, connection, table_name, schema: Incomplete | None = ..., resolve_synonyms: bool = ..., dblink: str = ..., **kw ): ... - def get_pk_constraint(self, connection, table_name, schema: Any | None = ..., **kw): ... - def get_foreign_keys(self, connection, table_name, schema: Any | None = ..., **kw): ... - def get_unique_constraints(self, connection, table_name, schema: Any | None = ..., **kw): ... + def get_pk_constraint(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... + def get_foreign_keys(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... + def get_unique_constraints(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... def get_view_definition( - self, connection, view_name, schema: Any | None = ..., resolve_synonyms: bool = ..., dblink: str = ..., **kw + self, connection, view_name, schema: Incomplete | None = ..., resolve_synonyms: bool = ..., dblink: str = ..., **kw ): ... - def get_check_constraints(self, connection, table_name, schema: Any | None = ..., include_all: bool = ..., **kw): ... + def get_check_constraints(self, connection, table_name, schema: Incomplete | None = ..., include_all: bool = ..., **kw): ... class _OuterJoinColumn(ClauseElement): __visit_name__: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/oracle/cx_oracle.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/oracle/cx_oracle.pyi index 05f26b87b..3484c83e0 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/oracle/cx_oracle.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/oracle/cx_oracle.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any import sqlalchemy.types as sqltypes @@ -103,8 +104,8 @@ class OracleDialect_cx_oracle(OracleDialect): coerce_to_unicode: bool = ..., coerce_to_decimal: bool = ..., arraysize: int = ..., - encoding_errors: Any | None = ..., - threaded: Any | None = ..., + encoding_errors: Incomplete | None = ..., + threaded: Incomplete | None = ..., **kwargs, ): ... @classmethod @@ -116,7 +117,7 @@ class OracleDialect_cx_oracle(OracleDialect): def create_connect_args(self, url): ... def is_disconnect(self, e, connection, cursor): ... def create_xid(self): ... - def do_executemany(self, cursor, statement, parameters, context: Any | None = ...) -> None: ... + def do_executemany(self, cursor, statement, parameters, context: Incomplete | None = ...) -> None: ... def do_begin_twophase(self, connection, xid) -> None: ... def do_prepare_twophase(self, connection, xid) -> None: ... def do_rollback_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/__init__.pyi index 67a7995dd..9a213981d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/__init__.pyi @@ -16,6 +16,7 @@ from .base import ( INTEGER as INTEGER, INTERVAL as INTERVAL, MACADDR as MACADDR, + MACADDR8 as MACADDR8, MONEY as MONEY, NUMERIC as NUMERIC, OID as OID, @@ -59,6 +60,7 @@ __all__ = ( "UUID", "BIT", "MACADDR", + "MACADDR8", "MONEY", "OID", "REGCLASS", diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/array.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/array.pyi index 5bcc21b1c..fe7c0e8bc 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/array.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/array.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any as _Any import sqlalchemy.types as sqltypes @@ -13,7 +14,7 @@ class array(expression.ClauseList, expression.ColumnElement[_Any]): inherit_cache: bool type: _Any def __init__(self, clauses, **kw) -> None: ... - def self_group(self, against: _Any | None = ...): ... + def self_group(self, against: Incomplete | None = ...): ... CONTAINS: _Any CONTAINED_BY: _Any @@ -29,7 +30,9 @@ class ARRAY(sqltypes.ARRAY): as_tuple: _Any dimensions: _Any zero_indexes: _Any - def __init__(self, item_type, as_tuple: bool = ..., dimensions: _Any | None = ..., zero_indexes: bool = ...) -> None: ... + def __init__( + self, item_type, as_tuple: bool = ..., dimensions: Incomplete | None = ..., zero_indexes: bool = ... + ) -> None: ... @property def hashable(self): ... @property diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/asyncpg.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/asyncpg.pyi index 0645aa783..dfe48e376 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/asyncpg.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/asyncpg.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from ...engine import AdaptedConnection @@ -86,12 +87,12 @@ class AsyncAdapt_asyncpg_cursor: rowcount: int def __init__(self, adapt_connection) -> None: ... def close(self) -> None: ... - def execute(self, operation, parameters: Any | None = ...) -> None: ... + def execute(self, operation, parameters: Incomplete | None = ...) -> None: ... def executemany(self, operation, seq_of_parameters): ... def setinputsizes(self, *inputsizes) -> None: ... def __iter__(self): ... def fetchone(self): ... - def fetchmany(self, size: Any | None = ...): ... + def fetchmany(self, size: Incomplete | None = ...): ... def fetchall(self): ... class AsyncAdapt_asyncpg_ss_cursor(AsyncAdapt_asyncpg_cursor): @@ -101,7 +102,7 @@ class AsyncAdapt_asyncpg_ss_cursor(AsyncAdapt_asyncpg_cursor): def __aiter__(self): ... async def __anext__(self) -> None: ... def fetchone(self): ... - def fetchmany(self, size: Any | None = ...): ... + def fetchmany(self, size: Incomplete | None = ...): ... def fetchall(self): ... def executemany(self, operation, seq_of_parameters) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/base.pyi index 88de9ce35..d72b1ed8d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/base.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/base.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from ...engine import characteristics, default, reflection @@ -43,6 +44,11 @@ class MACADDR(sqltypes.TypeEngine): PGMacAddr = MACADDR +class MACADDR8(sqltypes.TypeEngine): + __visit_name__: str + +PGMacAddr8 = MACADDR8 + class MONEY(sqltypes.TypeEngine): __visit_name__: str @@ -54,18 +60,18 @@ class REGCLASS(sqltypes.TypeEngine): class TIMESTAMP(sqltypes.TIMESTAMP): precision: Any - def __init__(self, timezone: bool = ..., precision: Any | None = ...) -> None: ... + def __init__(self, timezone: bool = ..., precision: Incomplete | None = ...) -> None: ... class TIME(sqltypes.TIME): precision: Any - def __init__(self, timezone: bool = ..., precision: Any | None = ...) -> None: ... + def __init__(self, timezone: bool = ..., precision: Incomplete | None = ...) -> None: ... class INTERVAL(sqltypes.NativeForEmulated, sqltypes._AbstractInterval): __visit_name__: str native: bool precision: Any fields: Any - def __init__(self, precision: Any | None = ..., fields: Any | None = ...) -> None: ... + def __init__(self, precision: Incomplete | None = ..., fields: Incomplete | None = ...) -> None: ... @classmethod def adapt_emulated_to_native(cls, interval, **kw): ... def as_generic(self, allow_nulltype: bool = ...): ... @@ -79,7 +85,7 @@ class BIT(sqltypes.TypeEngine): __visit_name__: str length: Any varying: Any - def __init__(self, length: Any | None = ..., varying: bool = ...) -> None: ... + def __init__(self, length: Incomplete | None = ..., varying: bool = ...) -> None: ... PGBit = BIT @@ -102,8 +108,8 @@ class ENUM(sqltypes.NativeForEmulated, sqltypes.Enum): # type: ignore[misc] # def __init__(self, *enums, **kw) -> None: ... @classmethod def adapt_emulated_to_native(cls, impl, **kw): ... - def create(self, bind: Any | None = ..., checkfirst: bool = ...) -> None: ... - def drop(self, bind: Any | None = ..., checkfirst: bool = ...) -> None: ... + def create(self, bind: Incomplete | None = ..., checkfirst: bool = ...) -> None: ... + def drop(self, bind: Incomplete | None = ..., checkfirst: bool = ...) -> None: ... class EnumGenerator(DDLBase): checkfirst: Any @@ -189,7 +195,7 @@ class PGTypeCompiler(compiler.GenericTypeCompiler): def visit_TSTZRANGE(self, type_, **kw): ... def visit_datetime(self, type_, **kw): ... def visit_enum(self, type_, **kw): ... - def visit_ENUM(self, type_, identifier_preparer: Any | None = ..., **kw): ... + def visit_ENUM(self, type_, identifier_preparer: Incomplete | None = ..., **kw): ... def visit_TIMESTAMP(self, type_, **kw): ... def visit_TIME(self, type_, **kw): ... def visit_INTERVAL(self, type_, **kw): ... @@ -204,10 +210,10 @@ class PGIdentifierPreparer(compiler.IdentifierPreparer): def format_type(self, type_, use_schema: bool = ...): ... class PGInspector(reflection.Inspector): - def get_table_oid(self, table_name, schema: Any | None = ...): ... - def get_enums(self, schema: Any | None = ...): ... - def get_foreign_table_names(self, schema: Any | None = ...): ... - def get_view_names(self, schema: Any | None = ..., include=...): ... + def get_table_oid(self, table_name, schema: Incomplete | None = ...): ... + def get_enums(self, schema: Incomplete | None = ...): ... + def get_foreign_table_names(self, schema: Incomplete | None = ...): ... + def get_view_names(self, schema: Incomplete | None = ..., include=...): ... class CreateEnumType(_CreateDropBase): __visit_name__: str @@ -266,7 +272,11 @@ class PGDialect(default.DefaultDialect): construct_arguments: Any reflection_options: Any def __init__( - self, isolation_level: Any | None = ..., json_serializer: Any | None = ..., json_deserializer: Any | None = ..., **kwargs + self, + isolation_level: Incomplete | None = ..., + json_serializer: Incomplete | None = ..., + json_deserializer: Incomplete | None = ..., + **kwargs, ) -> None: ... def initialize(self, connection) -> None: ... def on_connect(self): ... @@ -282,21 +292,21 @@ class PGDialect(default.DefaultDialect): def do_commit_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...) -> None: ... def do_recover_twophase(self, connection): ... def has_schema(self, connection, schema): ... - def has_table(self, connection, table_name, schema: Any | None = ...): ... # type: ignore[override] - def has_sequence(self, connection, sequence_name, schema: Any | None = ...): ... # type: ignore[override] - def has_type(self, connection, type_name, schema: Any | None = ...): ... - def get_table_oid(self, connection, table_name, schema: Any | None = ..., **kw): ... + def has_table(self, connection, table_name, schema: Incomplete | None = ...): ... # type: ignore[override] + def has_sequence(self, connection, sequence_name, schema: Incomplete | None = ...): ... # type: ignore[override] + def has_type(self, connection, type_name, schema: Incomplete | None = ...): ... + def get_table_oid(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... def get_schema_names(self, connection, **kw): ... - def get_table_names(self, connection, schema: Any | None = ..., **kw): ... - def get_view_names(self, connection, schema: Any | None = ..., include=..., **kw): ... - def get_sequence_names(self, connection, schema: Any | None = ..., **kw): ... - def get_view_definition(self, connection, view_name, schema: Any | None = ..., **kw): ... - def get_columns(self, connection, table_name, schema: Any | None = ..., **kw): ... - def get_pk_constraint(self, connection, table_name, schema: Any | None = ..., **kw): ... + def get_table_names(self, connection, schema: Incomplete | None = ..., **kw): ... + def get_view_names(self, connection, schema: Incomplete | None = ..., include=..., **kw): ... + def get_sequence_names(self, connection, schema: Incomplete | None = ..., **kw): ... + def get_view_definition(self, connection, view_name, schema: Incomplete | None = ..., **kw): ... + def get_columns(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... + def get_pk_constraint(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... def get_foreign_keys( - self, connection, table_name, schema: Any | None = ..., postgresql_ignore_search_path: bool = ..., **kw + self, connection, table_name, schema: Incomplete | None = ..., postgresql_ignore_search_path: bool = ..., **kw ): ... def get_indexes(self, connection, table_name, schema, **kw): ... - def get_unique_constraints(self, connection, table_name, schema: Any | None = ..., **kw): ... - def get_table_comment(self, connection, table_name, schema: Any | None = ..., **kw): ... - def get_check_constraints(self, connection, table_name, schema: Any | None = ..., **kw): ... + def get_unique_constraints(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... + def get_table_comment(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... + def get_check_constraints(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/dml.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/dml.pyi index cfa9b38b3..9ddcfcce2 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/dml.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/dml.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from ...sql.dml import Insert as StandardInsert @@ -11,14 +12,14 @@ class Insert(StandardInsert): def excluded(self): ... def on_conflict_do_update( self, - constraint: Any | None = ..., - index_elements: Any | None = ..., - index_where: Any | None = ..., - set_: Any | None = ..., - where: Any | None = ..., + constraint: Incomplete | None = ..., + index_elements: Incomplete | None = ..., + index_where: Incomplete | None = ..., + set_: Incomplete | None = ..., + where: Incomplete | None = ..., ) -> None: ... def on_conflict_do_nothing( - self, constraint: Any | None = ..., index_elements: Any | None = ..., index_where: Any | None = ... + self, constraint: Incomplete | None = ..., index_elements: Incomplete | None = ..., index_where: Incomplete | None = ... ) -> None: ... insert: Any @@ -28,7 +29,9 @@ class OnConflictClause(ClauseElement): constraint_target: Any inferred_target_elements: Any inferred_target_whereclause: Any - def __init__(self, constraint: Any | None = ..., index_elements: Any | None = ..., index_where: Any | None = ...) -> None: ... + def __init__( + self, constraint: Incomplete | None = ..., index_elements: Incomplete | None = ..., index_where: Incomplete | None = ... + ) -> None: ... class OnConflictDoNothing(OnConflictClause): __visit_name__: str @@ -39,9 +42,9 @@ class OnConflictDoUpdate(OnConflictClause): update_whereclause: Any def __init__( self, - constraint: Any | None = ..., - index_elements: Any | None = ..., - index_where: Any | None = ..., - set_: Any | None = ..., - where: Any | None = ..., + constraint: Incomplete | None = ..., + index_elements: Incomplete | None = ..., + index_where: Incomplete | None = ..., + set_: Incomplete | None = ..., + where: Incomplete | None = ..., ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/ext.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/ext.pyi index 66fd97542..c9e682f0c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/ext.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/ext.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from ...sql import expression @@ -6,12 +7,11 @@ from ...sql.schema import ColumnCollectionConstraint class aggregate_order_by(expression.ColumnElement[Any]): __visit_name__: str stringify_dialect: str - inherit_cache: bool target: Any type: Any order_by: Any def __init__(self, target, *order_by) -> None: ... - def self_group(self, against: Any | None = ...): ... + def self_group(self, against: Incomplete | None = ...): ... def get_children(self, **kwargs): ... class ExcludeConstraint(ColumnCollectionConstraint): diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/hstore.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/hstore.pyi index 4206ae880..3f37cdef1 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/hstore.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/hstore.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any import sqlalchemy.types as sqltypes @@ -8,7 +9,7 @@ class HSTORE(sqltypes.Indexable, sqltypes.Concatenable, sqltypes.TypeEngine): __visit_name__: str hashable: bool text_type: Any - def __init__(self, text_type: Any | None = ...) -> None: ... + def __init__(self, text_type: Incomplete | None = ...) -> None: ... class Comparator(sqltypes.Indexable.Comparator[Any], sqltypes.Concatenable.Comparator[Any]): def has_key(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/json.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/json.pyi index fe4c63d39..728842b88 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/json.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/json.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any import sqlalchemy.types as sqltypes @@ -8,7 +9,7 @@ class JSONPathType(sqltypes.JSON.JSONPathType): class JSON(sqltypes.JSON): astext_type: Any - def __init__(self, none_as_null: bool = ..., astext_type: Any | None = ...) -> None: ... + def __init__(self, none_as_null: bool = ..., astext_type: Incomplete | None = ...) -> None: ... class Comparator(sqltypes.JSON.Comparator): @property diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/pg8000.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/pg8000.pyi index fc60c1038..d87f2c0b5 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/pg8000.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/pg8000.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any import sqlalchemy.types as sqltypes @@ -83,14 +84,14 @@ class ServerSideCursor: def rowcount(self): ... @property def description(self): ... - def execute(self, operation, args=..., stream: Any | None = ...): ... + def execute(self, operation, args=..., stream: Incomplete | None = ...): ... def executemany(self, operation, param_sets): ... def fetchone(self): ... - def fetchmany(self, num: Any | None = ...): ... + def fetchmany(self, num: Incomplete | None = ...): ... def fetchall(self): ... def close(self) -> None: ... def setinputsizes(self, *sizes) -> None: ... - def setoutputsize(self, size, column: Any | None = ...) -> None: ... + def setoutputsize(self, size, column: Incomplete | None = ...) -> None: ... class PGCompiler_pg8000(PGCompiler): def visit_mod_binary(self, binary, operator, **kw): ... @@ -112,7 +113,7 @@ class PGDialect_pg8000(PGDialect): description_encoding: Any colspecs: Any client_encoding: Any - def __init__(self, client_encoding: Any | None = ..., **kwargs) -> None: ... + def __init__(self, client_encoding: Incomplete | None = ..., **kwargs) -> None: ... @classmethod def dbapi(cls): ... def create_connect_args(self, url): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/psycopg2.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/psycopg2.pyi index 7a5fa9941..e94fb3e02 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/psycopg2.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/psycopg2.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any import sqlalchemy.types as sqltypes @@ -70,7 +71,7 @@ class PGDialect_psycopg2(PGDialect): def __init__( self, use_native_unicode: bool = ..., - client_encoding: Any | None = ..., + client_encoding: Incomplete | None = ..., use_native_hstore: bool = ..., use_native_uuid: bool = ..., executemany_mode: str = ..., @@ -88,7 +89,7 @@ class PGDialect_psycopg2(PGDialect): def get_deferrable(self, connection): ... def do_ping(self, dbapi_connection): ... def on_connect(self): ... - def do_executemany(self, cursor, statement, parameters, context: Any | None = ...) -> None: ... + def do_executemany(self, cursor, statement, parameters, context: Incomplete | None = ...) -> None: ... def create_connect_args(self, url): ... def is_disconnect(self, e, connection, cursor): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/aiosqlite.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/aiosqlite.pyi index dfc3247d5..8d48580c1 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/aiosqlite.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/aiosqlite.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from ...engine import AdaptedConnection @@ -13,12 +14,12 @@ class AsyncAdapt_aiosqlite_cursor: def __init__(self, adapt_connection) -> None: ... def close(self) -> None: ... lastrowid: int - def execute(self, operation, parameters: Any | None = ...) -> None: ... + def execute(self, operation, parameters: Incomplete | None = ...) -> None: ... def executemany(self, operation, seq_of_parameters) -> None: ... def setinputsizes(self, *inputsizes) -> None: ... def __iter__(self): ... def fetchone(self): ... - def fetchmany(self, size: Any | None = ...): ... + def fetchmany(self, size: Incomplete | None = ...): ... def fetchall(self): ... class AsyncAdapt_aiosqlite_ss_cursor(AsyncAdapt_aiosqlite_cursor): @@ -26,7 +27,7 @@ class AsyncAdapt_aiosqlite_ss_cursor(AsyncAdapt_aiosqlite_cursor): def __init__(self, *arg, **kw) -> None: ... def close(self) -> None: ... def fetchone(self): ... - def fetchmany(self, size: Any | None = ...): ... + def fetchmany(self, size: Incomplete | None = ...): ... def fetchall(self): ... class AsyncAdapt_aiosqlite_connection(AdaptedConnection): diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/base.pyi index 31efadb6c..bb7d0c25e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/base.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/base.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any import sqlalchemy.types as sqltypes @@ -24,7 +25,7 @@ class _SQliteJson(JSON): def result_processor(self, dialect, coltype): ... class _DateTimeMixin: - def __init__(self, storage_format: Any | None = ..., regexp: Any | None = ..., **kw) -> None: ... + def __init__(self, storage_format: Incomplete | None = ..., regexp: Incomplete | None = ..., **kw) -> None: ... @property def format_is_text_affinity(self): ... def adapt(self, cls, **kw): ... @@ -116,27 +117,27 @@ class SQLiteDialect(default.DefaultDialect): native_datetime: Any def __init__( self, - isolation_level: Any | None = ..., + isolation_level: Incomplete | None = ..., native_datetime: bool = ..., - json_serializer: Any | None = ..., - json_deserializer: Any | None = ..., - _json_serializer: Any | None = ..., - _json_deserializer: Any | None = ..., + json_serializer: Incomplete | None = ..., + json_deserializer: Incomplete | None = ..., + _json_serializer: Incomplete | None = ..., + _json_deserializer: Incomplete | None = ..., **kwargs, ) -> None: ... def set_isolation_level(self, connection, level) -> None: ... def get_isolation_level(self, connection): ... def on_connect(self): ... def get_schema_names(self, connection, **kw): ... - def get_table_names(self, connection, schema: Any | None = ..., **kw): ... + def get_table_names(self, connection, schema: Incomplete | None = ..., **kw): ... def get_temp_table_names(self, connection, **kw): ... def get_temp_view_names(self, connection, **kw): ... - def has_table(self, connection, table_name, schema: Any | None = ...): ... # type: ignore[override] - def get_view_names(self, connection, schema: Any | None = ..., **kw): ... - def get_view_definition(self, connection, view_name, schema: Any | None = ..., **kw): ... - def get_columns(self, connection, table_name, schema: Any | None = ..., **kw): ... - def get_pk_constraint(self, connection, table_name, schema: Any | None = ..., **kw): ... - def get_foreign_keys(self, connection, table_name, schema: Any | None = ..., **kw): ... - def get_unique_constraints(self, connection, table_name, schema: Any | None = ..., **kw): ... - def get_check_constraints(self, connection, table_name, schema: Any | None = ..., **kw): ... - def get_indexes(self, connection, table_name, schema: Any | None = ..., **kw): ... + def has_table(self, connection, table_name, schema: Incomplete | None = ...): ... # type: ignore[override] + def get_view_names(self, connection, schema: Incomplete | None = ..., **kw): ... + def get_view_definition(self, connection, view_name, schema: Incomplete | None = ..., **kw): ... + def get_columns(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... + def get_pk_constraint(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... + def get_foreign_keys(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... + def get_unique_constraints(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... + def get_check_constraints(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... + def get_indexes(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/dml.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/dml.pyi index 208ceca97..da20b23ad 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/dml.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/dml.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from ...sql.dml import Insert as StandardInsert @@ -10,9 +11,13 @@ class Insert(StandardInsert): @memoized_property def excluded(self): ... def on_conflict_do_update( - self, index_elements: Any | None = ..., index_where: Any | None = ..., set_: Any | None = ..., where: Any | None = ... + self, + index_elements: Incomplete | None = ..., + index_where: Incomplete | None = ..., + set_: Incomplete | None = ..., + where: Incomplete | None = ..., ) -> None: ... - def on_conflict_do_nothing(self, index_elements: Any | None = ..., index_where: Any | None = ...) -> None: ... + def on_conflict_do_nothing(self, index_elements: Incomplete | None = ..., index_where: Incomplete | None = ...) -> None: ... insert: Any @@ -21,7 +26,7 @@ class OnConflictClause(ClauseElement): constraint_target: Any inferred_target_elements: Any inferred_target_whereclause: Any - def __init__(self, index_elements: Any | None = ..., index_where: Any | None = ...) -> None: ... + def __init__(self, index_elements: Incomplete | None = ..., index_where: Incomplete | None = ...) -> None: ... class OnConflictDoNothing(OnConflictClause): __visit_name__: str @@ -31,5 +36,9 @@ class OnConflictDoUpdate(OnConflictClause): update_values_to_set: Any update_whereclause: Any def __init__( - self, index_elements: Any | None = ..., index_where: Any | None = ..., set_: Any | None = ..., where: Any | None = ... + self, + index_elements: Incomplete | None = ..., + index_where: Incomplete | None = ..., + set_: Incomplete | None = ..., + where: Incomplete | None = ..., ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/base.pyi index 40d48d646..f6a90151b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/base.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/base.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from sqlalchemy import types as sqltypes @@ -76,7 +77,7 @@ ischema_names: Any class SybaseInspector(reflection.Inspector): def __init__(self, conn) -> None: ... - def get_table_id(self, table_name, schema: Any | None = ...): ... + def get_table_id(self, table_name, schema: Incomplete | None = ...): ... class SybaseExecutionContext(default.DefaultExecutionContext): def set_ddl_autocommit(self, connection, value) -> None: ... @@ -123,13 +124,13 @@ class SybaseDialect(default.DefaultDialect): def __init__(self, *args, **kwargs) -> None: ... max_identifier_length: int def initialize(self, connection) -> None: ... - def get_table_id(self, connection, table_name, schema: Any | None = ..., **kw): ... - def get_columns(self, connection, table_name, schema: Any | None = ..., **kw): ... - def get_foreign_keys(self, connection, table_name, schema: Any | None = ..., **kw): ... - def get_indexes(self, connection, table_name, schema: Any | None = ..., **kw): ... - def get_pk_constraint(self, connection, table_name, schema: Any | None = ..., **kw): ... + def get_table_id(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... + def get_columns(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... + def get_foreign_keys(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... + def get_indexes(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... + def get_pk_constraint(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... def get_schema_names(self, connection, **kw): ... - def get_table_names(self, connection, schema: Any | None = ..., **kw): ... - def get_view_definition(self, connection, view_name, schema: Any | None = ..., **kw): ... - def get_view_names(self, connection, schema: Any | None = ..., **kw): ... - def has_table(self, connection, table_name, schema: Any | None = ...): ... # type: ignore[override] + def get_table_names(self, connection, schema: Incomplete | None = ..., **kw): ... + def get_view_definition(self, connection, view_name, schema: Incomplete | None = ..., **kw): ... + def get_view_names(self, connection, schema: Incomplete | None = ..., **kw): ... + def has_table(self, connection, table_name, schema: Incomplete | None = ...): ... # type: ignore[override] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/pysybase.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/pysybase.pyi index ae8c0591f..d0a7a81aa 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/pysybase.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/pysybase.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from sqlalchemy import types as sqltypes @@ -21,7 +22,7 @@ class SybaseDialect_pysybase(SybaseDialect): @classmethod def dbapi(cls): ... def create_connect_args(self, url): ... - def do_executemany(self, cursor, statement, parameters, context: Any | None = ...) -> None: ... + def do_executemany(self, cursor, statement, parameters, context: Incomplete | None = ...) -> None: ... def is_disconnect(self, e, connection, cursor): ... dialect = SybaseDialect_pysybase diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/base.pyi index a4f152de5..9d7376520 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/base.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/base.pyi @@ -1,10 +1,10 @@ -from _typeshed import Self +from _typeshed import Incomplete from _typeshed.dbapi import DBAPIConnection from abc import abstractmethod from collections.abc import Callable, Mapping from types import TracebackType from typing import Any, TypeVar, overload -from typing_extensions import Concatenate, ParamSpec, TypeAlias +from typing_extensions import Concatenate, ParamSpec, Self, TypeAlias from ..log import Identified, _EchoFlag, echo_property from ..pool import Pool @@ -33,14 +33,14 @@ class Connection(Connectable): engine: Engine, connection: DBAPIConnection | None = ..., close_with_result: bool = ..., - _branch_from: Any | None = ..., - _execution_options: Any | None = ..., - _dispatch: Any | None = ..., - _has_events: Any | None = ..., + _branch_from: Incomplete | None = ..., + _execution_options: Incomplete | None = ..., + _dispatch: Incomplete | None = ..., + _has_events: Incomplete | None = ..., _allow_revalidate: bool = ..., ) -> None: ... def schema_for_object(self, obj) -> str | None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, type_: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None ) -> None: ... @@ -62,7 +62,7 @@ class Connection(Connectable): def detach(self) -> None: ... def begin(self) -> Transaction: ... def begin_nested(self) -> Transaction | None: ... - def begin_twophase(self, xid: Any | None = ...) -> TwoPhaseTransaction: ... + def begin_twophase(self, xid: Incomplete | None = ...) -> TwoPhaseTransaction: ... def recover_twophase(self): ... def rollback_prepared(self, xid, recover: bool = ...) -> None: ... def commit_prepared(self, xid, recover: bool = ...) -> None: ... @@ -80,7 +80,9 @@ class Connection(Connectable): def execute(self, statement: _Executable, *multiparams: Mapping[str, Any], **params) -> CursorResult: ... @overload def execute(self, statement: str, *multiparams: Any | tuple[Any, ...] | Mapping[str, Any], **params) -> CursorResult: ... - def exec_driver_sql(self, statement: str, parameters: Any | None = ..., execution_options: Any | None = ...): ... + def exec_driver_sql( + self, statement: str, parameters: Incomplete | None = ..., execution_options: Incomplete | None = ... + ): ... def transaction(self, callable_: Callable[Concatenate[Connection, _P], _T], *args: _P.args, **kwargs: _P.kwargs) -> _T: ... def run_callable(self, callable_: Callable[Concatenate[Connection, _P], _T], *args: _P.args, **kwargs: _P.kwargs) -> _T: ... @@ -183,12 +185,10 @@ class Engine(Connectable, Identified): ) -> None: ... def begin(self, close_with_result: bool = ...) -> _trans_ctx: ... - # TODO: - # def transaction(self, callable_: Callable[Concatenate[Connection, _P], _T], *args: _P.args, **kwargs: _P.kwargs) -> _T | None: ... - def transaction(self, callable_: Callable[..., _T], *args: Any, **kwargs: Any) -> _T | None: ... - # TODO: - # def run_callable(self, callable_: Callable[Concatenate[Connection, _P], _T], *args: _P.args, **kwargs: _P.kwargs) -> _T: ... - def run_callable(self, callable_: Callable[..., _T], *args: Any, **kwargs: Any) -> _T: ... + def transaction( + self, callable_: Callable[Concatenate[Connection, _P], _T], *args: _P.args, **kwargs: _P.kwargs + ) -> _T | None: ... + def run_callable(self, callable_: Callable[Concatenate[Connection, _P], _T], *args: _P.args, **kwargs: _P.kwargs) -> _T: ... @overload # type: ignore[override] def execute(self, statement: _Executable, *multiparams: Mapping[str, Any], **params: Any) -> CursorResult: ... @overload @@ -198,8 +198,8 @@ class Engine(Connectable, Identified): @overload def scalar(self, statement: str, *multiparams: Any | tuple[Any, ...] | Mapping[str, Any], **params: Any) -> Any: ... def connect(self, close_with_result: bool = ...) -> Connection: ... # type: ignore[override] - def table_names(self, schema: Any | None = ..., connection: Connection | None = ...): ... - def has_table(self, table_name: str, schema: Any | None = ...) -> bool: ... + def table_names(self, schema: Incomplete | None = ..., connection: Connection | None = ...): ... + def has_table(self, table_name: str, schema: Incomplete | None = ...) -> bool: ... def raw_connection(self, _connection: Connection | None = ...) -> DBAPIConnection: ... class OptionEngineMixin: diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/create.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/create.pyi index 40c6b29fd..97070a374 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/create.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/create.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from collections.abc import Mapping from typing import Any, overload from typing_extensions import Literal @@ -12,10 +13,10 @@ from .url import URL def create_engine(url: URL | str, *, strategy: Literal["mock"], **kwargs) -> MockConnection: ... # type: ignore[misc] @overload def create_engine( - url: URL | str, *, module: Any | None = ..., enable_from_linting: bool = ..., future: Literal[True], **kwargs + url: URL | str, *, module: Incomplete | None = ..., enable_from_linting: bool = ..., future: Literal[True], **kwargs ) -> FutureEngine: ... @overload def create_engine( - url: URL | str, *, module: Any | None = ..., enable_from_linting: bool = ..., future: Literal[False] = ..., **kwargs + url: URL | str, *, module: Incomplete | None = ..., enable_from_linting: bool = ..., future: Literal[False] = ..., **kwargs ) -> Engine: ... def engine_from_config(configuration: Mapping[str, Any], prefix: str = ..., **kwargs) -> Engine: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/cursor.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/cursor.pyi index 980290818..76d0d369d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/cursor.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/cursor.pyi @@ -1,4 +1,5 @@ import abc +from _typeshed import Incomplete from typing import Any from ..util import memoized_property @@ -26,7 +27,7 @@ class ResultFetchStrategy: def hard_close(self, result, dbapi_cursor) -> None: ... def yield_per(self, result, dbapi_cursor, num) -> None: ... def fetchone(self, result, dbapi_cursor, hard_close: bool = ...) -> None: ... - def fetchmany(self, result, dbapi_cursor, size: Any | None = ...) -> None: ... + def fetchmany(self, result, dbapi_cursor, size: Incomplete | None = ...) -> None: ... def fetchall(self, result) -> None: ... def handle_exception(self, result, dbapi_cursor, err) -> None: ... @@ -34,7 +35,7 @@ class NoCursorFetchStrategy(ResultFetchStrategy): def soft_close(self, result, dbapi_cursor) -> None: ... def hard_close(self, result, dbapi_cursor) -> None: ... def fetchone(self, result, dbapi_cursor, hard_close: bool = ...): ... - def fetchmany(self, result, dbapi_cursor, size: Any | None = ...): ... + def fetchmany(self, result, dbapi_cursor, size: Incomplete | None = ...): ... def fetchall(self, result, dbapi_cursor): ... class NoCursorDQLFetchStrategy(NoCursorFetchStrategy): ... @@ -46,28 +47,32 @@ class CursorFetchStrategy(ResultFetchStrategy): def handle_exception(self, result, dbapi_cursor, err) -> None: ... def yield_per(self, result, dbapi_cursor, num) -> None: ... def fetchone(self, result, dbapi_cursor, hard_close: bool = ...): ... - def fetchmany(self, result, dbapi_cursor, size: Any | None = ...): ... + def fetchmany(self, result, dbapi_cursor, size: Incomplete | None = ...): ... def fetchall(self, result, dbapi_cursor): ... class BufferedRowCursorFetchStrategy(CursorFetchStrategy): - def __init__(self, dbapi_cursor, execution_options, growth_factor: int = ..., initial_buffer: Any | None = ...) -> None: ... + def __init__( + self, dbapi_cursor, execution_options, growth_factor: int = ..., initial_buffer: Incomplete | None = ... + ) -> None: ... @classmethod def create(cls, result): ... def yield_per(self, result, dbapi_cursor, num) -> None: ... def soft_close(self, result, dbapi_cursor) -> None: ... def hard_close(self, result, dbapi_cursor) -> None: ... def fetchone(self, result, dbapi_cursor, hard_close: bool = ...): ... - def fetchmany(self, result, dbapi_cursor, size: Any | None = ...): ... + def fetchmany(self, result, dbapi_cursor, size: Incomplete | None = ...): ... def fetchall(self, result, dbapi_cursor): ... class FullyBufferedCursorFetchStrategy(CursorFetchStrategy): alternate_cursor_description: Any - def __init__(self, dbapi_cursor, alternate_description: Any | None = ..., initial_buffer: Any | None = ...) -> None: ... + def __init__( + self, dbapi_cursor, alternate_description: Incomplete | None = ..., initial_buffer: Incomplete | None = ... + ) -> None: ... def yield_per(self, result, dbapi_cursor, num) -> None: ... def soft_close(self, result, dbapi_cursor) -> None: ... def hard_close(self, result, dbapi_cursor) -> None: ... def fetchone(self, result, dbapi_cursor, hard_close: bool = ...): ... - def fetchmany(self, result, dbapi_cursor, size: Any | None = ...): ... + def fetchmany(self, result, dbapi_cursor, size: Incomplete | None = ...): ... def fetchall(self, result, dbapi_cursor): ... class _NoResultMetaData(ResultMetaData): diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/default.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/default.pyi index 9e521bbb6..fa725cb70 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/default.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/default.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any, ClassVar from .. import types as sqltypes @@ -90,13 +91,13 @@ class DefaultDialect(interfaces.Dialect): # type: ignore[misc] self, convert_unicode: bool = ..., encoding: str = ..., - paramstyle: Any | None = ..., - dbapi: Any | None = ..., - implicit_returning: Any | None = ..., + paramstyle: Incomplete | None = ..., + dbapi: Incomplete | None = ..., + implicit_returning: Incomplete | None = ..., case_sensitive: bool = ..., - supports_native_boolean: Any | None = ..., - max_identifier_length: Any | None = ..., - label_length: Any | None = ..., + supports_native_boolean: Incomplete | None = ..., + max_identifier_length: Incomplete | None = ..., + label_length: Incomplete | None = ..., compiler_linting=..., server_side_cursors: bool = ..., **kwargs, @@ -115,7 +116,7 @@ class DefaultDialect(interfaces.Dialect): # type: ignore[misc] def on_connect(self) -> None: ... def get_default_isolation_level(self, dbapi_conn): ... def type_descriptor(self, typeobj): ... - def has_index(self, connection, table_name, index_name, schema: Any | None = ...): ... + def has_index(self, connection, table_name, index_name, schema: Incomplete | None = ...): ... def validate_identifier(self, ident) -> None: ... def connect(self, *cargs, **cparams): ... def create_connect_args(self, url): ... @@ -130,9 +131,9 @@ class DefaultDialect(interfaces.Dialect): # type: ignore[misc] def do_savepoint(self, connection, name) -> None: ... def do_rollback_to_savepoint(self, connection, name) -> None: ... def do_release_savepoint(self, connection, name) -> None: ... - def do_executemany(self, cursor, statement, parameters, context: Any | None = ...) -> None: ... - def do_execute(self, cursor, statement, parameters, context: Any | None = ...) -> None: ... - def do_execute_no_params(self, cursor, statement, context: Any | None = ...) -> None: ... # type: ignore[override] + def do_executemany(self, cursor, statement, parameters, context: Incomplete | None = ...) -> None: ... + def do_execute(self, cursor, statement, parameters, context: Incomplete | None = ...) -> None: ... + def do_execute_no_params(self, cursor, statement, context: Incomplete | None = ...) -> None: ... # type: ignore[override] def is_disconnect(self, e, connection, cursor): ... def reset_isolation_level(self, dbapi_conn) -> None: ... def normalize_name(self, name): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/interfaces.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/interfaces.pyi index 4e962d1ea..7b6eac7d8 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/interfaces.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/interfaces.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from _typeshed.dbapi import DBAPIConnection, DBAPICursor from abc import abstractmethod from collections.abc import Callable, Collection, Mapping @@ -53,24 +54,24 @@ class Dialect: # as abstract. @classmethod def type_descriptor(cls, typeobj) -> None: ... - def get_columns(self, connection, table_name, schema: Any | None = ..., **kw) -> None: ... - def get_pk_constraint(self, connection, table_name, schema: Any | None = ..., **kw) -> None: ... - def get_foreign_keys(self, connection, table_name, schema: Any | None = ..., **kw) -> None: ... - def get_table_names(self, connection, schema: Any | None = ..., **kw) -> None: ... - def get_temp_table_names(self, connection, schema: Any | None = ..., **kw) -> None: ... - def get_view_names(self, connection, schema: Any | None = ..., **kw) -> None: ... - def get_sequence_names(self, connection, schema: Any | None = ..., **kw) -> None: ... - def get_temp_view_names(self, connection, schema: Any | None = ..., **kw) -> None: ... - def get_view_definition(self, connection, view_name, schema: Any | None = ..., **kw) -> None: ... - def get_indexes(self, connection, table_name, schema: Any | None = ..., **kw) -> None: ... - def get_unique_constraints(self, connection, table_name, schema: Any | None = ..., **kw) -> None: ... - def get_check_constraints(self, connection, table_name, schema: Any | None = ..., **kw) -> None: ... - def get_table_comment(self, connection, table_name, schema: Any | None = ..., **kw) -> None: ... + def get_columns(self, connection, table_name, schema: Incomplete | None = ..., **kw) -> None: ... + def get_pk_constraint(self, connection, table_name, schema: Incomplete | None = ..., **kw) -> None: ... + def get_foreign_keys(self, connection, table_name, schema: Incomplete | None = ..., **kw) -> None: ... + def get_table_names(self, connection, schema: Incomplete | None = ..., **kw) -> None: ... + def get_temp_table_names(self, connection, schema: Incomplete | None = ..., **kw) -> None: ... + def get_view_names(self, connection, schema: Incomplete | None = ..., **kw) -> None: ... + def get_sequence_names(self, connection, schema: Incomplete | None = ..., **kw) -> None: ... + def get_temp_view_names(self, connection, schema: Incomplete | None = ..., **kw) -> None: ... + def get_view_definition(self, connection, view_name, schema: Incomplete | None = ..., **kw) -> None: ... + def get_indexes(self, connection, table_name, schema: Incomplete | None = ..., **kw) -> None: ... + def get_unique_constraints(self, connection, table_name, schema: Incomplete | None = ..., **kw) -> None: ... + def get_check_constraints(self, connection, table_name, schema: Incomplete | None = ..., **kw) -> None: ... + def get_table_comment(self, connection, table_name, schema: Incomplete | None = ..., **kw) -> None: ... def normalize_name(self, name) -> None: ... def denormalize_name(self, name) -> None: ... - def has_table(self, connection, table_name, schema: Any | None = ..., **kw) -> None: ... - def has_index(self, connection, table_name, index_name, schema: Any | None = ...) -> None: ... - def has_sequence(self, connection, sequence_name, schema: Any | None = ..., **kw) -> None: ... + def has_table(self, connection, table_name, schema: Incomplete | None = ..., **kw) -> None: ... + def has_index(self, connection, table_name, index_name, schema: Incomplete | None = ...) -> None: ... + def has_sequence(self, connection, sequence_name, schema: Incomplete | None = ..., **kw) -> None: ... def do_begin(self, dbapi_connection) -> None: ... def do_rollback(self, dbapi_connection) -> None: ... def do_commit(self, dbapi_connection) -> None: ... @@ -85,9 +86,9 @@ class Dialect: def do_rollback_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...) -> None: ... def do_commit_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...) -> None: ... def do_recover_twophase(self, connection) -> None: ... - def do_executemany(self, cursor, statement, parameters, context: Any | None = ...) -> None: ... - def do_execute(self, cursor, statement, parameters, context: Any | None = ...) -> None: ... - def do_execute_no_params(self, cursor, statement, parameters, context: Any | None = ...) -> None: ... + def do_executemany(self, cursor, statement, parameters, context: Incomplete | None = ...) -> None: ... + def do_execute(self, cursor, statement, parameters, context: Incomplete | None = ...) -> None: ... + def do_execute_no_params(self, cursor, statement, parameters, context: Incomplete | None = ...) -> None: ... def is_disconnect(self, e, connection, cursor) -> None: ... def connect(self, *cargs, **cparams) -> DBAPIConnection: ... def reset_isolation_level(self, dbapi_conn) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/mock.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/mock.pyi index dc685760d..bfd800725 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/mock.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/mock.pyi @@ -1,7 +1,7 @@ -from _typeshed import Self from abc import abstractmethod from collections.abc import Mapping from typing import Any, overload +from typing_extensions import Self from .base import _Executable from .cursor import CursorResult @@ -11,7 +11,7 @@ from .url import URL class MockConnection(Connectable): def __init__(self, dialect: Dialect, execute) -> None: ... @property - def engine(self: Self) -> Self: ... # type: ignore[override] + def engine(self) -> Self: ... # type: ignore[override] @property def dialect(self) -> Dialect: ... @property diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/reflection.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/reflection.pyi index fcfd262c2..350ba42ee 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/reflection.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/reflection.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete def cache(fn, self, con, *args, **kw): ... @@ -9,24 +9,24 @@ class Inspector: @property def default_schema_name(self): ... def get_schema_names(self): ... - def get_table_names(self, schema: Any | None = ...): ... - def has_table(self, table_name, schema: Any | None = ...): ... - def has_sequence(self, sequence_name, schema: Any | None = ...): ... - def get_sorted_table_and_fkc_names(self, schema: Any | None = ...): ... + def get_table_names(self, schema: Incomplete | None = ...): ... + def has_table(self, table_name, schema: Incomplete | None = ...): ... + def has_sequence(self, sequence_name, schema: Incomplete | None = ...): ... + def get_sorted_table_and_fkc_names(self, schema: Incomplete | None = ...): ... def get_temp_table_names(self): ... def get_temp_view_names(self): ... - def get_table_options(self, table_name, schema: Any | None = ..., **kw): ... - def get_view_names(self, schema: Any | None = ...): ... - def get_sequence_names(self, schema: Any | None = ...): ... - def get_view_definition(self, view_name, schema: Any | None = ...): ... - def get_columns(self, table_name, schema: Any | None = ..., **kw): ... - def get_pk_constraint(self, table_name, schema: Any | None = ..., **kw): ... - def get_foreign_keys(self, table_name, schema: Any | None = ..., **kw): ... - def get_indexes(self, table_name, schema: Any | None = ..., **kw): ... - def get_unique_constraints(self, table_name, schema: Any | None = ..., **kw): ... - def get_table_comment(self, table_name, schema: Any | None = ..., **kw): ... - def get_check_constraints(self, table_name, schema: Any | None = ..., **kw): ... + def get_table_options(self, table_name, schema: Incomplete | None = ..., **kw): ... + def get_view_names(self, schema: Incomplete | None = ...): ... + def get_sequence_names(self, schema: Incomplete | None = ...): ... + def get_view_definition(self, view_name, schema: Incomplete | None = ...): ... + def get_columns(self, table_name, schema: Incomplete | None = ..., **kw): ... + def get_pk_constraint(self, table_name, schema: Incomplete | None = ..., **kw): ... + def get_foreign_keys(self, table_name, schema: Incomplete | None = ..., **kw): ... + def get_indexes(self, table_name, schema: Incomplete | None = ..., **kw): ... + def get_unique_constraints(self, table_name, schema: Incomplete | None = ..., **kw): ... + def get_table_comment(self, table_name, schema: Incomplete | None = ..., **kw): ... + def get_check_constraints(self, table_name, schema: Incomplete | None = ..., **kw): ... def reflecttable(self, *args, **kwargs): ... def reflect_table( - self, table, include_columns, exclude_columns=..., resolve_fks: bool = ..., _extend_on: Any | None = ... + self, table, include_columns, exclude_columns=..., resolve_fks: bool = ..., _extend_on: Incomplete | None = ... ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/result.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/result.pyi index e6bb880db..7328eb5e2 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/result.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/result.pyi @@ -1,6 +1,7 @@ -from _typeshed import Self +from _typeshed import Incomplete from collections.abc import Generator, KeysView from typing import Any +from typing_extensions import Self from ..sql.base import InPlaceGenerative from .row import Row @@ -11,7 +12,7 @@ class ResultMetaData: class RMKeyView(KeysView[Any]): def __init__(self, parent) -> None: ... - def __len__(self): ... + def __len__(self) -> int: ... def __iter__(self): ... def __contains__(self, item): ... def __eq__(self, other): ... @@ -21,14 +22,14 @@ class SimpleResultMetaData(ResultMetaData): def __init__( self, keys, - extra: Any | None = ..., - _processors: Any | None = ..., - _tuplefilter: Any | None = ..., - _translated_indexes: Any | None = ..., - _unique_filters: Any | None = ..., + extra: Incomplete | None = ..., + _processors: Incomplete | None = ..., + _tuplefilter: Incomplete | None = ..., + _translated_indexes: Incomplete | None = ..., + _unique_filters: Incomplete | None = ..., ) -> None: ... -def result_tuple(fields, extra: Any | None = ...): ... +def result_tuple(fields, extra: Incomplete | None = ...): ... class ResultInternal(InPlaceGenerative): ... @@ -38,8 +39,8 @@ class _WithKeys: class Result(_WithKeys, ResultInternal): def __init__(self, cursor_metadata) -> None: ... def close(self) -> None: ... - def yield_per(self: Self, num: int) -> Self: ... - def unique(self: Self, strategy: Any | None = ...) -> Self: ... + def yield_per(self, num: int) -> Self: ... + def unique(self, strategy: Incomplete | None = ...) -> Self: ... def columns(self, *col_expressions): ... def scalars(self, index: int = ...) -> ScalarResult: ... def mappings(self) -> MappingResult: ... @@ -63,10 +64,10 @@ class FilterResult(ResultInternal): ... class ScalarResult(FilterResult): def __init__(self, real_result, index) -> None: ... - def unique(self, strategy: Any | None = ...): ... - def partitions(self, size: Any | None = ...) -> None: ... + def unique(self, strategy: Incomplete | None = ...): ... + def partitions(self, size: Incomplete | None = ...) -> None: ... def fetchall(self): ... - def fetchmany(self, size: Any | None = ...): ... + def fetchmany(self, size: Incomplete | None = ...): ... def all(self): ... def __iter__(self): ... def __next__(self): ... @@ -76,12 +77,12 @@ class ScalarResult(FilterResult): class MappingResult(_WithKeys, FilterResult): def __init__(self, result) -> None: ... - def unique(self, strategy: Any | None = ...): ... + def unique(self, strategy: Incomplete | None = ...): ... def columns(self, *col_expressions): ... - def partitions(self, size: Any | None = ...) -> None: ... + def partitions(self, size: Incomplete | None = ...) -> None: ... def fetchall(self): ... def fetchone(self): ... - def fetchmany(self, size: Any | None = ...): ... + def fetchmany(self, size: Incomplete | None = ...): ... def all(self): ... def __iter__(self): ... def __next__(self): ... @@ -100,7 +101,7 @@ class FrozenResult: class IteratorResult(Result): iterator: Any raw: Any - def __init__(self, cursor_metadata, iterator, raw: Any | None = ..., _source_supports_scalars: bool = ...) -> None: ... + def __init__(self, cursor_metadata, iterator, raw: Incomplete | None = ..., _source_supports_scalars: bool = ...) -> None: ... def null_result() -> IteratorResult: ... @@ -110,7 +111,12 @@ class ChunkedIteratorResult(IteratorResult): iterator: Any dynamic_yield_per: Any def __init__( - self, cursor_metadata, chunks, source_supports_scalars: bool = ..., raw: Any | None = ..., dynamic_yield_per: bool = ... + self, + cursor_metadata, + chunks, + source_supports_scalars: bool = ..., + raw: Incomplete | None = ..., + dynamic_yield_per: bool = ..., ) -> None: ... class MergedResult(IteratorResult): diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/row.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/row.pyi index 2c588e9b9..330af3e9e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/row.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/row.pyi @@ -1,9 +1,10 @@ -import abc -from collections.abc import ItemsView, KeysView, Mapping, Sequence, ValuesView -from typing import Any +from collections.abc import ItemsView, Iterator, KeysView, Mapping, Sequence, ValuesView +from typing import Any, Generic, TypeVar from ..cresultproxy import BaseRow as BaseRow +_VT_co = TypeVar("_VT_co", covariant=True) + MD_INDEX: int def rowproxy_reconstructor(cls, state): ... @@ -13,45 +14,48 @@ KEY_OBJECTS_ONLY: int KEY_OBJECTS_BUT_WARN: int KEY_OBJECTS_NO_WARN: int -class Row(BaseRow, Sequence[Any], metaclass=abc.ABCMeta): +class Row(BaseRow, Sequence[Any]): + # The count and index methods are inherited from Sequence. + # If the result set contains columns with the same names, these + # fields contains their respective values, instead. We don't reflect + # this in the stubs. + __hash__ = BaseRow.__hash__ # type: ignore[assignment] + def __lt__(self, other: Row | tuple[Any, ...]) -> bool: ... + def __le__(self, other: Row | tuple[Any, ...]) -> bool: ... + def __ge__(self, other: Row | tuple[Any, ...]) -> bool: ... + def __gt__(self, other: Row | tuple[Any, ...]) -> bool: ... + def __eq__(self, other: object) -> bool: ... + def __ne__(self, other: object) -> bool: ... + def keys(self) -> list[str]: ... + # The following methods are public, but have a leading underscore + # to prevent conflicts with column names. @property - def count(self): ... + def _mapping(self) -> RowMapping: ... @property - def index(self): ... - def __contains__(self, key): ... - __hash__ = BaseRow.__hash__ - def __lt__(self, other): ... - def __le__(self, other): ... - def __ge__(self, other): ... - def __gt__(self, other): ... - def __eq__(self, other): ... - def __ne__(self, other): ... - def keys(self): ... - -class LegacyRow(Row, metaclass=abc.ABCMeta): - def __contains__(self, key): ... - def has_key(self, key): ... - def items(self): ... - def iterkeys(self): ... - def itervalues(self): ... - def values(self): ... + def _fields(self) -> tuple[str, ...]: ... + def _asdict(self) -> dict[str, Any]: ... + +class LegacyRow(Row): + def has_key(self, key: str) -> bool: ... + def items(self) -> list[tuple[str, Any]]: ... + def iterkeys(self) -> Iterator[str]: ... + def itervalues(self) -> Iterator[Any]: ... + def values(self) -> list[Any]: ... BaseRowProxy = BaseRow RowProxy = Row -class ROMappingView(KeysView[Any], ValuesView[Any], ItemsView[Any, Any]): - def __init__(self, mapping, items) -> None: ... - def __len__(self): ... - def __iter__(self): ... - def __contains__(self, item): ... - def __eq__(self, other): ... - def __ne__(self, other): ... +class ROMappingView(KeysView[str], ValuesView[_VT_co], ItemsView[str, _VT_co], Generic[_VT_co]): # type: ignore[misc] + def __init__(self, mapping: RowMapping, items: list[_VT_co]) -> None: ... + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[_VT_co]: ... # type: ignore[override] + def __eq__(self, other: ROMappingView[_VT_co]) -> bool: ... # type: ignore[override] + def __ne__(self, other: ROMappingView[_VT_co]) -> bool: ... # type: ignore[override] -class RowMapping(BaseRow, Mapping[Any, Any]): +class RowMapping(BaseRow, Mapping[str, Row]): __getitem__: Any - def __iter__(self): ... - def __len__(self): ... - def __contains__(self, key): ... - def items(self): ... - def keys(self): ... - def values(self): ... + def __iter__(self) -> Iterator[str]: ... + def __len__(self) -> int: ... + def items(self) -> ROMappingView[tuple[str, Any]]: ... # type: ignore[override] + def keys(self) -> list[str]: ... # type: ignore[override] + def values(self) -> ROMappingView[Any]: ... # type: ignore[override] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi index 30625dfce..6d4281113 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi @@ -1,16 +1,19 @@ -from _typeshed import Self, SupportsItems +from _typeshed import SupportsItems, Unused from collections.abc import Iterable, Mapping, Sequence from typing import Any, NamedTuple -from typing_extensions import TypeAlias +from typing_extensions import Self, TypeAlias from ..util import immutabledict from .interfaces import Dialect +# object that produces a password when called with str() +_PasswordObject: TypeAlias = object + # stub-only helper class class _URLTuple(NamedTuple): drivername: str username: str | None - password: str | object | None # object that produces a password when called with str() + password: str | _PasswordObject | None host: str | None port: int | None database: str | None @@ -24,32 +27,32 @@ class URL(_URLTuple): cls, drivername: str, username: str | None = ..., - password: str | object | None = ..., # object that produces a password when called with str() + password: str | _PasswordObject | None = None, host: str | None = ..., port: int | None = ..., database: str | None = ..., query: _Query | None = ..., ) -> URL: ... def set( - self: Self, + self, drivername: str | None = ..., username: str | None = ..., - password: str | object | None = ..., + password: str | _PasswordObject | None = None, host: str | None = ..., port: int | None = ..., database: str | None = ..., query: _Query | None = ..., ) -> Self: ... - def update_query_string(self: Self, query_string: str, append: bool = ...) -> Self: ... - def update_query_pairs(self: Self, key_value_pairs: Iterable[tuple[str, str]], append: bool = ...) -> Self: ... - def update_query_dict(self: Self, query_parameters: SupportsItems[str, str | Sequence[str]], append: bool = ...) -> Self: ... + def update_query_string(self, query_string: str, append: bool = ...) -> Self: ... + def update_query_pairs(self, key_value_pairs: Iterable[tuple[str, str]], append: bool = ...) -> Self: ... + def update_query_dict(self, query_parameters: SupportsItems[str, str | Sequence[str]], append: bool = ...) -> Self: ... def difference_update_query(self, names: Iterable[str]) -> URL: ... @property def normalized_query(self) -> immutabledict[str, tuple[str, ...]]: ... def __to_string__(self, hide_password: bool = ...) -> str: ... def render_as_string(self, hide_password: bool = ...) -> str: ... - def __copy__(self: Self) -> Self: ... - def __deepcopy__(self: Self, memo: object) -> Self: ... + def __copy__(self) -> Self: ... + def __deepcopy__(self, memo: Unused) -> Self: ... def __hash__(self) -> int: ... def __eq__(self, other: object) -> bool: ... def __ne__(self, other: object) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/util.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/util.pyi index f711f0c83..0fdef7435 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/util.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/util.pyi @@ -1,12 +1,12 @@ -from _typeshed import Self from collections.abc import Callable from types import TracebackType from typing import Any +from typing_extensions import Self def connection_memoize(key: str) -> Callable[..., Any]: ... class TransactionalContext: - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, type_: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/event/attr.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/event/attr.pyi index f0d04c802..5f03e16bc 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/event/attr.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/event/attr.pyi @@ -43,19 +43,19 @@ class _EmptyListener(_InstanceLevelDispatch): remove: Any clear: Any def __call__(self, *args, **kw) -> None: ... - def __len__(self): ... + def __len__(self) -> int: ... def __iter__(self): ... - def __bool__(self): ... - __nonzero__: Any + def __bool__(self) -> bool: ... + def __nonzero__(self) -> bool: ... class _CompoundListener(_InstanceLevelDispatch): def exec_once(self, *args, **kw) -> None: ... def exec_once_unless_exception(self, *args, **kw) -> None: ... def __call__(self, *args, **kw) -> None: ... - def __len__(self): ... + def __len__(self) -> int: ... def __iter__(self): ... - def __bool__(self): ... - __nonzero__: Any + def __bool__(self) -> bool: ... + def __nonzero__(self) -> bool: ... class _ListenerCollection(_CompoundListener): parent_listeners: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/event/base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/event/base.pyi index 4237aa096..9b1341c16 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/event/base.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/event/base.pyi @@ -1,11 +1,12 @@ +from _typeshed import Incomplete from typing import Any class _UnpickleDispatch: def __call__(self, _instance_cls): ... class _Dispatch: - def __init__(self, parent, instance_cls: Any | None = ...) -> None: ... - def __getattr__(self, name): ... + def __init__(self, parent, instance_cls: Incomplete | None = ...) -> None: ... + def __getattr__(self, name: str): ... def __reduce__(self): ... class _EventMeta(type): @@ -18,7 +19,7 @@ class _JoinedDispatcher: local: Any parent: Any def __init__(self, local, parent) -> None: ... - def __getattr__(self, name): ... + def __getattr__(self, name: str): ... class dispatcher: dispatch: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/event/registry.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/event/registry.pyi index 54fcc63a9..f513b9664 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/event/registry.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/event/registry.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any class _EventKey: @@ -7,14 +8,14 @@ class _EventKey: fn_key: Any fn_wrap: Any dispatch_target: Any - def __init__(self, target, identifier, fn, dispatch_target, _fn_wrap: Any | None = ...) -> None: ... + def __init__(self, target, identifier, fn, dispatch_target, _fn_wrap: Incomplete | None = ...) -> None: ... def with_wrapper(self, fn_wrap): ... def with_dispatch_target(self, dispatch_target): ... def listen(self, *args, **kw) -> None: ... def remove(self) -> None: ... def contains(self): ... def base_listen( - self, propagate: bool = ..., insert: bool = ..., named: bool = ..., retval: Any | None = ..., asyncio: bool = ... + self, propagate: bool = ..., insert: bool = ..., named: bool = ..., retval: Incomplete | None = ..., asyncio: bool = ... ) -> None: ... def append_to_list(self, owner, list_): ... def remove_from_list(self, owner, list_) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/exc.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/exc.pyi index b8775e9ad..30dba09fc 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/exc.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/exc.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any, ClassVar class HasDescriptionCode: @@ -21,7 +22,7 @@ class AmbiguousForeignKeysError(ArgumentError): ... class CircularDependencyError(SQLAlchemyError): cycles: Any edges: Any - def __init__(self, message, cycles, edges, msg: Any | None = ..., code: Any | None = ...) -> None: ... + def __init__(self, message, cycles, edges, msg: Incomplete | None = ..., code: Incomplete | None = ...) -> None: ... def __reduce__(self): ... class CompileError(SQLAlchemyError): ... @@ -82,7 +83,14 @@ class StatementError(SQLAlchemyError): hide_parameters: Any detail: Any def __init__( - self, message, statement, params, orig, hide_parameters: bool = ..., code: Any | None = ..., ismulti: Any | None = ... + self, + message, + statement, + params, + orig, + hide_parameters: bool = ..., + code: Incomplete | None = ..., + ismulti: Incomplete | None = ..., ) -> None: ... def add_detail(self, msg) -> None: ... def __reduce__(self): ... @@ -98,8 +106,8 @@ class DBAPIError(StatementError): dbapi_base_err, hide_parameters: bool = ..., connection_invalidated: bool = ..., - dialect: Any | None = ..., - ismulti: Any | None = ..., + dialect: Incomplete | None = ..., + ismulti: Incomplete | None = ..., ): ... def __reduce__(self): ... connection_invalidated: Any @@ -110,8 +118,8 @@ class DBAPIError(StatementError): orig, hide_parameters: bool = ..., connection_invalidated: bool = ..., - code: Any | None = ..., - ismulti: Any | None = ..., + code: Incomplete | None = ..., + ismulti: Incomplete | None = ..., ) -> None: ... class InterfaceError(DBAPIError): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/associationproxy.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/associationproxy.pyi index f44cbaf8b..d72c6d7ee 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/associationproxy.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/associationproxy.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from ..orm import interfaces @@ -24,17 +25,17 @@ class AssociationProxy(interfaces.InspectionAttrInfo): self, target_collection, attr, - creator: Any | None = ..., - getset_factory: Any | None = ..., - proxy_factory: Any | None = ..., - proxy_bulk_set: Any | None = ..., - info: Any | None = ..., + creator: Incomplete | None = ..., + getset_factory: Incomplete | None = ..., + proxy_factory: Incomplete | None = ..., + proxy_bulk_set: Incomplete | None = ..., + info: Incomplete | None = ..., cascade_scalar_deletes: bool = ..., ) -> None: ... def __get__(self, obj, class_): ... - def __set__(self, obj, values): ... - def __delete__(self, obj): ... - def for_class(self, class_, obj: Any | None = ...): ... + def __set__(self, obj, values) -> None: ... + def __delete__(self, obj) -> None: ... + def for_class(self, class_, obj: Incomplete | None = ...): ... class AssociationProxyInstance: parent: Any @@ -61,15 +62,15 @@ class AssociationProxyInstance: def get(self, obj): ... def set(self, obj, values) -> None: ... def delete(self, obj) -> None: ... - def any(self, criterion: Any | None = ..., **kwargs): ... - def has(self, criterion: Any | None = ..., **kwargs): ... + def any(self, criterion: Incomplete | None = ..., **kwargs): ... + def has(self, criterion: Incomplete | None = ..., **kwargs): ... class AmbiguousAssociationProxyInstance(AssociationProxyInstance): def get(self, obj): ... def __eq__(self, obj): ... def __ne__(self, obj): ... - def any(self, criterion: Any | None = ..., **kwargs) -> None: ... - def has(self, criterion: Any | None = ..., **kwargs) -> None: ... + def any(self, criterion: Incomplete | None = ..., **kwargs) -> None: ... + def has(self, criterion: Incomplete | None = ..., **kwargs) -> None: ... class ObjectAssociationProxyInstance(AssociationProxyInstance): def contains(self, obj): ... @@ -95,9 +96,9 @@ class _AssociationCollection: def __init__(self, lazy_collection, creator, getter, setter, parent) -> None: ... @property def col(self): ... - def __len__(self): ... - def __bool__(self): ... - __nonzero__: Any + def __len__(self) -> int: ... + def __bool__(self) -> bool: ... + def __nonzero__(self) -> bool: ... class _AssociationList(_AssociationCollection): def __getitem__(self, index): ... @@ -132,7 +133,7 @@ class _AssociationList(_AssociationCollection): def __imul__(self, n): ... def index(self, item, *args): ... def copy(self): ... - def __hash__(self): ... + def __hash__(self) -> int: ... class _AssociationDict(_AssociationCollection): def __getitem__(self, key): ... @@ -149,8 +150,8 @@ class _AssociationDict(_AssociationCollection): def __gt__(self, other): ... def __ge__(self, other): ... def __cmp__(self, other): ... - def get(self, key, default: Any | None = ...): ... - def setdefault(self, key, default: Any | None = ...): ... + def get(self, key, default: Incomplete | None = ...): ... + def setdefault(self, key, default: Incomplete | None = ...): ... def keys(self): ... def items(self): ... def values(self): ... @@ -158,12 +159,12 @@ class _AssociationDict(_AssociationCollection): def popitem(self): ... def update(self, *a, **kw) -> None: ... def copy(self): ... - def __hash__(self): ... + def __hash__(self) -> int: ... class _AssociationSet(_AssociationCollection): - def __len__(self): ... - def __bool__(self): ... - __nonzero__: Any + def __len__(self) -> int: ... + def __bool__(self) -> bool: ... + def __nonzero__(self) -> bool: ... def __contains__(self, value): ... def __iter__(self): ... def add(self, value) -> None: ... @@ -196,4 +197,4 @@ class _AssociationSet(_AssociationCollection): def __le__(self, other): ... def __gt__(self, other): ... def __ge__(self, other): ... - def __hash__(self): ... + def __hash__(self) -> int: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/base.pyi index 8c8894687..61f3579ae 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/base.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/base.pyi @@ -1,4 +1,5 @@ import abc +from types import TracebackType class ReversibleProxy: ... @@ -8,9 +9,11 @@ class StartableContext(abc.ABC, metaclass=abc.ABCMeta): def __await__(self): ... async def __aenter__(self): ... @abc.abstractmethod - async def __aexit__(self, type_, value, traceback): ... + async def __aexit__( + self, type_: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None + ) -> None: ... class ProxyComparable(ReversibleProxy): - def __hash__(self): ... + def __hash__(self) -> int: ... def __eq__(self, other): ... def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/engine.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/engine.pyi index dbc88f378..26538f549 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/engine.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/engine.pyi @@ -1,3 +1,5 @@ +from _typeshed import Incomplete +from types import TracebackType from typing import Any from .base import ProxyComparable, StartableContext @@ -10,7 +12,7 @@ class AsyncConnection(ProxyComparable, StartableContext, AsyncConnectable): engine: Any sync_engine: Any sync_connection: Any - def __init__(self, async_engine, sync_connection: Any | None = ...) -> None: ... + def __init__(self, async_engine, sync_connection: Incomplete | None = ...) -> None: ... async def start(self, is_ctxmanager: bool = ...): ... @property def connection(self) -> None: ... @@ -19,7 +21,7 @@ class AsyncConnection(ProxyComparable, StartableContext, AsyncConnectable): def info(self): ... def begin(self): ... def begin_nested(self): ... - async def invalidate(self, exception: Any | None = ...): ... + async def invalidate(self, exception: Incomplete | None = ...): ... async def get_isolation_level(self): ... async def set_isolation_level(self): ... def in_transaction(self): ... @@ -30,15 +32,17 @@ class AsyncConnection(ProxyComparable, StartableContext, AsyncConnectable): async def commit(self) -> None: ... async def rollback(self) -> None: ... async def close(self) -> None: ... - async def exec_driver_sql(self, statement, parameters: Any | None = ..., execution_options=...): ... - async def stream(self, statement, parameters: Any | None = ..., execution_options=...): ... - async def execute(self, statement, parameters: Any | None = ..., execution_options=...): ... - async def scalar(self, statement, parameters: Any | None = ..., execution_options=...): ... - async def scalars(self, statement, parameters: Any | None = ..., execution_options=...): ... - async def stream_scalars(self, statement, parameters: Any | None = ..., execution_options=...): ... + async def exec_driver_sql(self, statement, parameters: Incomplete | None = ..., execution_options=...): ... + async def stream(self, statement, parameters: Incomplete | None = ..., execution_options=...): ... + async def execute(self, statement, parameters: Incomplete | None = ..., execution_options=...): ... + async def scalar(self, statement, parameters: Incomplete | None = ..., execution_options=...): ... + async def scalars(self, statement, parameters: Incomplete | None = ..., execution_options=...): ... + async def stream_scalars(self, statement, parameters: Incomplete | None = ..., execution_options=...): ... async def run_sync(self, fn, *arg, **kw): ... def __await__(self): ... - async def __aexit__(self, type_, value, traceback) -> None: ... + async def __aexit__( + self, type_: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None + ) -> None: ... # proxied from Connection dialect: Any @property @@ -54,7 +58,9 @@ class AsyncEngine(ProxyComparable, AsyncConnectable): def __init__(self, conn) -> None: ... transaction: Any async def start(self, is_ctxmanager: bool = ...): ... - async def __aexit__(self, type_, value, traceback) -> None: ... + async def __aexit__( + self, type_: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None + ) -> None: ... sync_engine: Any def __init__(self, sync_engine) -> None: ... def begin(self): ... @@ -90,4 +96,6 @@ class AsyncTransaction(ProxyComparable, StartableContext): async def rollback(self) -> None: ... async def commit(self) -> None: ... async def start(self, is_ctxmanager: bool = ...): ... - async def __aexit__(self, type_, value, traceback) -> None: ... + async def __aexit__( + self, type_: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None + ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/result.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/result.pyi index c04258ab1..43a2a3b0b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/result.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/result.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete from ...engine.result import FilterResult @@ -8,11 +8,11 @@ class AsyncCommon(FilterResult): class AsyncResult(AsyncCommon): def __init__(self, real_result) -> None: ... def keys(self): ... - def unique(self, strategy: Any | None = ...): ... + def unique(self, strategy: Incomplete | None = ...): ... def columns(self, *col_expressions): ... - async def partitions(self, size: Any | None = ...) -> None: ... + async def partitions(self, size: Incomplete | None = ...) -> None: ... async def fetchone(self): ... - async def fetchmany(self, size: Any | None = ...): ... + async def fetchmany(self, size: Incomplete | None = ...): ... async def all(self): ... def __aiter__(self): ... async def __anext__(self): ... @@ -23,16 +23,15 @@ class AsyncResult(AsyncCommon): async def one(self): ... async def scalar(self): ... async def freeze(self): ... - def merge(self, *others): ... def scalars(self, index: int = ...): ... def mappings(self): ... class AsyncScalarResult(AsyncCommon): def __init__(self, real_result, index) -> None: ... - def unique(self, strategy: Any | None = ...): ... - async def partitions(self, size: Any | None = ...) -> None: ... + def unique(self, strategy: Incomplete | None = ...): ... + async def partitions(self, size: Incomplete | None = ...) -> None: ... async def fetchall(self): ... - async def fetchmany(self, size: Any | None = ...): ... + async def fetchmany(self, size: Incomplete | None = ...): ... async def all(self): ... def __aiter__(self): ... async def __anext__(self): ... @@ -43,12 +42,12 @@ class AsyncScalarResult(AsyncCommon): class AsyncMappingResult(AsyncCommon): def __init__(self, result) -> None: ... def keys(self): ... - def unique(self, strategy: Any | None = ...): ... + def unique(self, strategy: Incomplete | None = ...): ... def columns(self, *col_expressions): ... - async def partitions(self, size: Any | None = ...) -> None: ... + async def partitions(self, size: Incomplete | None = ...) -> None: ... async def fetchall(self): ... async def fetchone(self): ... - async def fetchmany(self, size: Any | None = ...): ... + async def fetchmany(self, size: Incomplete | None = ...): ... async def all(self): ... def __aiter__(self): ... async def __anext__(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/scoping.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/scoping.pyi index 90e44bc0d..a71390ced 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/scoping.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/scoping.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from ...orm.scoping import ScopedSessionMixin @@ -29,38 +30,38 @@ class async_scoped_session(ScopedSessionMixin): async def connection(self, **kw): ... async def delete(self, instance): ... async def execute( - self, statement, params: Any | None = ..., execution_options=..., bind_arguments: Any | None = ..., **kw + self, statement, params: Incomplete | None = ..., execution_options=..., bind_arguments: Incomplete | None = ..., **kw ): ... - def expire(self, instance, attribute_names: Any | None = ...) -> None: ... + def expire(self, instance, attribute_names: Incomplete | None = ...) -> None: ... def expire_all(self) -> None: ... def expunge(self, instance) -> None: ... def expunge_all(self) -> None: ... - async def flush(self, objects: Any | None = ...) -> None: ... + async def flush(self, objects: Incomplete | None = ...) -> None: ... async def get( self, entity, ident, - options: Any | None = ..., + options: Incomplete | None = ..., populate_existing: bool = ..., - with_for_update: Any | None = ..., - identity_token: Any | None = ..., + with_for_update: Incomplete | None = ..., + identity_token: Incomplete | None = ..., ): ... - def get_bind(self, mapper: Any | None = ..., clause: Any | None = ..., bind: Any | None = ..., **kw): ... + def get_bind(self, mapper: Incomplete | None = ..., clause: Incomplete | None = ..., bind: Incomplete | None = ..., **kw): ... def is_modified(self, instance, include_collections: bool = ...): ... - async def merge(self, instance, load: bool = ..., options: Any | None = ...): ... - async def refresh(self, instance, attribute_names: Any | None = ..., with_for_update: Any | None = ...): ... + async def merge(self, instance, load: bool = ..., options: Incomplete | None = ...): ... + async def refresh(self, instance, attribute_names: Incomplete | None = ..., with_for_update: Incomplete | None = ...): ... async def rollback(self): ... async def scalar( - self, statement, params: Any | None = ..., execution_options=..., bind_arguments: Any | None = ..., **kw + self, statement, params: Incomplete | None = ..., execution_options=..., bind_arguments: Incomplete | None = ..., **kw ): ... async def scalars( - self, statement, params: Any | None = ..., execution_options=..., bind_arguments: Any | None = ..., **kw + self, statement, params: Incomplete | None = ..., execution_options=..., bind_arguments: Incomplete | None = ..., **kw ): ... async def stream( - self, statement, params: Any | None = ..., execution_options=..., bind_arguments: Any | None = ..., **kw + self, statement, params: Incomplete | None = ..., execution_options=..., bind_arguments: Incomplete | None = ..., **kw ): ... async def stream_scalars( - self, statement, params: Any | None = ..., execution_options=..., bind_arguments: Any | None = ..., **kw + self, statement, params: Incomplete | None = ..., execution_options=..., bind_arguments: Incomplete | None = ..., **kw ): ... @property def dirty(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/session.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/session.pyi index 3b8a3c028..02e1e942f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/session.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/session.pyi @@ -1,5 +1,7 @@ -from _typeshed import Self +from _typeshed import Incomplete +from types import TracebackType from typing import Any +from typing_extensions import Self from ...util import memoized_property from .base import ReversibleProxy, StartableContext @@ -10,39 +12,41 @@ class AsyncSession(ReversibleProxy): binds: Any sync_session_class: Any sync_session: Any - def __init__(self, bind: Any | None = ..., binds: Any | None = ..., sync_session_class: Any | None = ..., **kw) -> None: ... - async def refresh(self, instance, attribute_names: Any | None = ..., with_for_update: Any | None = ...): ... + def __init__( + self, bind: Incomplete | None = ..., binds: Incomplete | None = ..., sync_session_class: Incomplete | None = ..., **kw + ) -> None: ... + async def refresh(self, instance, attribute_names: Incomplete | None = ..., with_for_update: Incomplete | None = ...): ... async def run_sync(self, fn, *arg, **kw): ... async def execute( - self, statement, params: Any | None = ..., execution_options=..., bind_arguments: Any | None = ..., **kw + self, statement, params: Incomplete | None = ..., execution_options=..., bind_arguments: Incomplete | None = ..., **kw ): ... async def scalar( - self, statement, params: Any | None = ..., execution_options=..., bind_arguments: Any | None = ..., **kw + self, statement, params: Incomplete | None = ..., execution_options=..., bind_arguments: Incomplete | None = ..., **kw ): ... async def scalars( - self, statement, params: Any | None = ..., execution_options=..., bind_arguments: Any | None = ..., **kw + self, statement, params: Incomplete | None = ..., execution_options=..., bind_arguments: Incomplete | None = ..., **kw ): ... async def get( self, entity, ident, - options: Any | None = ..., + options: Incomplete | None = ..., populate_existing: bool = ..., - with_for_update: Any | None = ..., - identity_token: Any | None = ..., + with_for_update: Incomplete | None = ..., + identity_token: Incomplete | None = ..., ): ... async def stream( - self, statement, params: Any | None = ..., execution_options=..., bind_arguments: Any | None = ..., **kw + self, statement, params: Incomplete | None = ..., execution_options=..., bind_arguments: Incomplete | None = ..., **kw ): ... async def stream_scalars( - self, statement, params: Any | None = ..., execution_options=..., bind_arguments: Any | None = ..., **kw + self, statement, params: Incomplete | None = ..., execution_options=..., bind_arguments: Incomplete | None = ..., **kw ): ... async def delete(self, instance): ... - async def merge(self, instance, load: bool = ..., options: Any | None = ...): ... - async def flush(self, objects: Any | None = ...) -> None: ... + async def merge(self, instance, load: bool = ..., options: Incomplete | None = ...): ... + async def flush(self, objects: Incomplete | None = ...) -> None: ... def get_transaction(self): ... def get_nested_transaction(self): ... - def get_bind(self, mapper: Any | None = ..., clause: Any | None = ..., bind: Any | None = ..., **kw): ... + def get_bind(self, mapper: Incomplete | None = ..., clause: Incomplete | None = ..., bind: Incomplete | None = ..., **kw): ... async def connection(self, **kw): ... def begin(self, **kw): ... def begin_nested(self, **kw): ... @@ -51,8 +55,10 @@ class AsyncSession(ReversibleProxy): async def close(self): ... @classmethod async def close_all(cls): ... - async def __aenter__(self: Self) -> Self: ... - async def __aexit__(self, type_, value, traceback) -> None: ... + async def __aenter__(self) -> Self: ... + async def __aexit__( + self, type_: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None + ) -> None: ... # proxied from Session identity_map: Any autoflush: Any @@ -64,7 +70,7 @@ class AsyncSession(ReversibleProxy): def __iter__(self): ... def add(self, instance, _warn: bool = ...) -> None: ... def add_all(self, instances) -> None: ... - def expire(self, instance, attribute_names: Any | None = ...) -> None: ... + def expire(self, instance, attribute_names: Incomplete | None = ...) -> None: ... def expire_all(self) -> None: ... def expunge(self, instance) -> None: ... def expunge_all(self) -> None: ... @@ -89,7 +95,9 @@ class _AsyncSessionContextManager: def __init__(self, async_session) -> None: ... trans: Any async def __aenter__(self): ... - async def __aexit__(self, type_, value, traceback) -> None: ... + async def __aexit__( + self, type_: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None + ) -> None: ... class AsyncSessionTransaction(ReversibleProxy, StartableContext): session: Any @@ -101,7 +109,9 @@ class AsyncSessionTransaction(ReversibleProxy, StartableContext): async def rollback(self) -> None: ... async def commit(self) -> None: ... async def start(self, is_ctxmanager: bool = ...): ... - async def __aexit__(self, type_, value, traceback) -> None: ... + async def __aexit__( + self, type_: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None + ) -> None: ... def async_object_session(instance): ... def async_session(session): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/automap.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/automap.pyi index 13b709903..f17b2d3b6 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/automap.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/automap.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any def classname_for_table(base, tablename, table): ... @@ -11,16 +12,16 @@ class AutomapBase: @classmethod def prepare( cls, - autoload_with: Any | None = ..., - engine: Any | None = ..., + autoload_with: Incomplete | None = ..., + engine: Incomplete | None = ..., reflect: bool = ..., - schema: Any | None = ..., - classname_for_table: Any | None = ..., - collection_class: Any | None = ..., - name_for_scalar_relationship: Any | None = ..., - name_for_collection_relationship: Any | None = ..., - generate_relationship: Any | None = ..., + schema: Incomplete | None = ..., + classname_for_table: Incomplete | None = ..., + collection_class: Incomplete | None = ..., + name_for_scalar_relationship: Incomplete | None = ..., + name_for_collection_relationship: Incomplete | None = ..., + generate_relationship: Incomplete | None = ..., reflection_options=..., ) -> None: ... -def automap_base(declarative_base: Any | None = ..., **kw): ... +def automap_base(declarative_base: Incomplete | None = ..., **kw): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/baked.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/baked.pyi index 664c226ac..2cf3c3250 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/baked.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/baked.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any log: Any @@ -12,7 +13,7 @@ class BakedQuery: steps: Any def __init__(self, bakery, initial_fn, args=...) -> None: ... @classmethod - def bakery(cls, size: int = ..., _size_alert: Any | None = ...): ... + def bakery(cls, size: int = ..., _size_alert: Incomplete | None = ...): ... def __iadd__(self, other): ... def __add__(self, other): ... def add_criteria(self, fn, *args): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/compiler.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/compiler.pyi index cc2363f1a..79b29eea9 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/compiler.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/compiler.pyi @@ -5,5 +5,4 @@ def deregister(class_) -> None: ... class _dispatcher: specs: Any - def __init__(self) -> None: ... def __call__(self, element, compiler, **kw): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/horizontal_shard.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/horizontal_shard.pyi index b217b31b9..08a80eb03 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/horizontal_shard.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/horizontal_shard.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any, Generic, TypeVar from ..orm.query import Query @@ -18,8 +19,16 @@ class ShardedSession(Session): execute_chooser: Any query_chooser: Any def __init__( - self, shard_chooser, id_chooser, execute_chooser: Any | None = ..., shards: Any | None = ..., query_cls=..., **kwargs + self, + shard_chooser, + id_chooser, + execute_chooser: Incomplete | None = ..., + shards: Incomplete | None = ..., + query_cls=..., + **kwargs, ): ... - def connection_callable(self, mapper: Any | None = ..., instance: Any | None = ..., shard_id: Any | None = ..., **kwargs): ... - def get_bind(self, mapper: Any | None = ..., shard_id: Any | None = ..., instance: Any | None = ..., clause: Any | None = ..., **kw): ... # type: ignore[override] + def connection_callable( + self, mapper: Incomplete | None = ..., instance: Incomplete | None = ..., shard_id: Incomplete | None = ..., **kwargs + ): ... + def get_bind(self, mapper: Incomplete | None = ..., shard_id: Incomplete | None = ..., instance: Incomplete | None = ..., clause: Incomplete | None = ..., **kw): ... # type: ignore[override] def bind_shard(self, shard_id, bind) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/hybrid.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/hybrid.pyi index 5c3c186ce..eda35d683 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/hybrid.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/hybrid.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from ..orm import interfaces @@ -9,7 +10,7 @@ class hybrid_method(interfaces.InspectionAttrInfo): is_attribute: bool extension_type: Any func: Any - def __init__(self, func, expr: Any | None = ...) -> None: ... + def __init__(self, func, expr: Incomplete | None = ...) -> None: ... def __get__(self, instance, owner): ... expr: Any def expression(self, expr): ... @@ -26,11 +27,11 @@ class hybrid_property(interfaces.InspectionAttrInfo): def __init__( self, fget, - fset: Any | None = ..., - fdel: Any | None = ..., - expr: Any | None = ..., - custom_comparator: Any | None = ..., - update_expr: Any | None = ..., + fset: Incomplete | None = ..., + fdel: Incomplete | None = ..., + expr: Incomplete | None = ..., + custom_comparator: Incomplete | None = ..., + update_expr: Incomplete | None = ..., ) -> None: ... def __get__(self, instance, owner): ... def __set__(self, instance, value) -> None: ... @@ -58,7 +59,7 @@ class ExprComparator(Comparator): expression: Any hybrid: Any def __init__(self, cls, expression, hybrid) -> None: ... - def __getattr__(self, key): ... + def __getattr__(self, key: str): ... @_property def info(self): ... @_property diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/indexable.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/indexable.pyi index 0150ec714..1178ebd4f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/indexable.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/indexable.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from ..ext.hybrid import hybrid_property @@ -8,7 +9,9 @@ class index_property(hybrid_property): default: Any datatype: Any onebased: Any - def __init__(self, attr_name, index, default=..., datatype: Any | None = ..., mutable: bool = ..., onebased: bool = ...): ... + def __init__( + self, attr_name, index, default=..., datatype: Incomplete | None = ..., mutable: bool = ..., onebased: bool = ... + ): ... def fget(self, instance): ... def fset(self, instance, value) -> None: ... def fdel(self, instance) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/instrumentation.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/instrumentation.pyi index 6420c913f..d054f2def 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/instrumentation.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/instrumentation.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from ..orm.instrumentation import ClassManager, InstrumentationFactory @@ -46,8 +47,8 @@ class _ClassInstrumentationAdapter(ClassManager): def uninstall_member(self, key) -> None: ... def instrument_collection_class(self, key, collection_class): ... def initialize_collection(self, key, state, factory): ... - def new_instance(self, state: Any | None = ...): ... - def setup_instance(self, instance, state: Any | None = ...): ... + def new_instance(self, state: Incomplete | None = ...): ... + def setup_instance(self, instance, state: Incomplete | None = ...): ... def teardown_instance(self, instance) -> None: ... def has_state(self, instance): ... def state_getter(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/mypy/apply.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/mypy/apply.pyi deleted file mode 100644 index 651f37c03..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/mypy/apply.pyi +++ /dev/null @@ -1,27 +0,0 @@ -from typing import Any -from typing_extensions import TypeAlias - -from . import util - -_AssignmentStmt: TypeAlias = Any # mypy.nodes.AssignmentStmt -_NameExpr: TypeAlias = Any # mypy.nodes.NameExpr -_StrExpr: TypeAlias = Any # mypy.nodes.StrExpr -_SemanticAnalyzerPluginInterface: TypeAlias = Any # mypy.plugin.SemanticAnalyzerPluginInterface -_ProperType: TypeAlias = Any # mypy.types.ProperType - -def apply_mypy_mapped_attr( - cls, api: _SemanticAnalyzerPluginInterface, item: _NameExpr | _StrExpr, attributes: list[util.SQLAlchemyAttribute] -) -> None: ... -def re_apply_declarative_assignments( - cls, api: _SemanticAnalyzerPluginInterface, attributes: list[util.SQLAlchemyAttribute] -) -> None: ... -def apply_type_to_mapped_statement( - api: _SemanticAnalyzerPluginInterface, - stmt: _AssignmentStmt, - lvalue: _NameExpr, - left_hand_explicit_type: _ProperType | None, - python_type_for_type: _ProperType | None, -) -> None: ... -def add_additional_orm_attributes( - cls, api: _SemanticAnalyzerPluginInterface, attributes: list[util.SQLAlchemyAttribute] -) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/mypy/decl_class.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/mypy/decl_class.pyi deleted file mode 100644 index 9b68ea889..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/mypy/decl_class.pyi +++ /dev/null @@ -1,10 +0,0 @@ -from typing import Any -from typing_extensions import TypeAlias - -from . import util - -_SemanticAnalyzerPluginInterface: TypeAlias = Any # mypy.plugin.SemanticAnalyzerPluginInterface - -def scan_declarative_assignments_and_apply_types( - cls, api: _SemanticAnalyzerPluginInterface, is_mixin_scan: bool = ... -) -> list[util.SQLAlchemyAttribute] | None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/mypy/infer.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/mypy/infer.pyi deleted file mode 100644 index 0ffb05b70..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/mypy/infer.pyi +++ /dev/null @@ -1,25 +0,0 @@ -from collections.abc import Sequence -from typing import Any -from typing_extensions import TypeAlias - -_AssignmentStmt: TypeAlias = Any # mypy.nodes.AssignmentStmt -_Expression: TypeAlias = Any # mypy.nodes.Expression -_RefExpr: TypeAlias = Any # mypy.nodes.RefExpr -_TypeInfo: TypeAlias = Any # mypy.nodes.TypeInfo -_Var: TypeAlias = Any # mypy.nodes.Var -_SemanticAnalyzerPluginInterface: TypeAlias = Any # mypy.plugin.SemanticAnalyzerPluginInterface -_ProperType: TypeAlias = Any # mypy.types.ProperType - -def infer_type_from_right_hand_nameexpr( - api: _SemanticAnalyzerPluginInterface, - stmt: _AssignmentStmt, - node: _Var, - left_hand_explicit_type: _ProperType | None, - infer_from_right_side: _RefExpr, -) -> _ProperType | None: ... -def infer_type_from_left_hand_type_only( - api: _SemanticAnalyzerPluginInterface, node: _Var, left_hand_explicit_type: _ProperType | None -) -> _ProperType | None: ... -def extract_python_type_from_typeengine( - api: _SemanticAnalyzerPluginInterface, node: _TypeInfo, type_args: Sequence[_Expression] -) -> _ProperType: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/mypy/names.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/mypy/names.pyi deleted file mode 100644 index ab998e2bc..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/mypy/names.pyi +++ /dev/null @@ -1,38 +0,0 @@ -from typing import Any -from typing_extensions import TypeAlias - -from ...util import symbol - -_ClassDef: TypeAlias = Any # mypy.nodes.ClassDef -_Expression: TypeAlias = Any # mypy.nodes.Expression -_MemberExpr: TypeAlias = Any # mypy.nodes.MemberExpr -_NameExpr: TypeAlias = Any # mypy.nodes.NameExpr -_SymbolNode: TypeAlias = Any # mypy.nodes.SymbolNode -_TypeInfo: TypeAlias = Any # mypy.nodes.TypeInfo -_SemanticAnalyzerPluginInterface: TypeAlias = Any # mypy.plugin.SemanticAnalyzerPluginInterface -_UnboundType: TypeAlias = Any # mypy.types.UnboundType - -COLUMN: symbol -RELATIONSHIP: symbol -REGISTRY: symbol -COLUMN_PROPERTY: symbol -TYPEENGINE: symbol -MAPPED: symbol -DECLARATIVE_BASE: symbol -DECLARATIVE_META: symbol -MAPPED_DECORATOR: symbol -SYNONYM_PROPERTY: symbol -COMPOSITE_PROPERTY: symbol -DECLARED_ATTR: symbol -MAPPER_PROPERTY: symbol -AS_DECLARATIVE: symbol -AS_DECLARATIVE_BASE: symbol -DECLARATIVE_MIXIN: symbol -QUERY_EXPRESSION: symbol - -def has_base_type_id(info: _TypeInfo, type_id: int) -> bool: ... -def mro_has_id(mro: list[_TypeInfo], type_id: int) -> bool: ... -def type_id_for_unbound_type(type_: _UnboundType, cls: _ClassDef, api: _SemanticAnalyzerPluginInterface) -> int | None: ... -def type_id_for_callee(callee: _Expression) -> int | None: ... -def type_id_for_named_node(node: _NameExpr | _MemberExpr | _SymbolNode) -> int | None: ... -def type_id_for_fullname(fullname: str) -> int | None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/mypy/plugin.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/mypy/plugin.pyi deleted file mode 100644 index c9e943a1e..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/mypy/plugin.pyi +++ /dev/null @@ -1,21 +0,0 @@ -from collections.abc import Callable -from typing import Any -from typing_extensions import TypeAlias - -_MypyFile: TypeAlias = Any # mypy.nodes.MypyFile -_AttributeContext: TypeAlias = Any # mypy.plugin.AttributeContext -_ClassDefContext: TypeAlias = Any # mypy.plugin.ClassDefContext -_DynamicClassDefContext: TypeAlias = Any # mypy.plugin.DynamicClassDefContext -_Plugin: TypeAlias = Any # mypy.plugin.Plugin -_Type: TypeAlias = Any # mypy.types.Type - -class SQLAlchemyPlugin(_Plugin): - def get_dynamic_class_hook(self, fullname: str) -> Callable[[_DynamicClassDefContext], None] | None: ... - def get_customize_class_mro_hook(self, fullname: str) -> Callable[[_ClassDefContext], None] | None: ... - def get_class_decorator_hook(self, fullname: str) -> Callable[[_ClassDefContext], None] | None: ... - def get_metaclass_hook(self, fullname: str) -> Callable[[_ClassDefContext], None] | None: ... - def get_base_class_hook(self, fullname: str) -> Callable[[_ClassDefContext], None] | None: ... - def get_attribute_hook(self, fullname: str) -> Callable[[_AttributeContext], _Type] | None: ... - def get_additional_deps(self, file: _MypyFile) -> list[tuple[int, str, int]]: ... - -def plugin(version: str) -> type[SQLAlchemyPlugin]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/mypy/util.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/mypy/util.pyi deleted file mode 100644 index 43edf16d8..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/mypy/util.pyi +++ /dev/null @@ -1,49 +0,0 @@ -from collections.abc import Iterable, Iterator -from typing import Any, TypeVar, overload -from typing_extensions import TypeAlias - -_CallExpr: TypeAlias = Any # mypy.nodes._CallExpr -_Context: TypeAlias = Any # mypy.nodes._Context -_Expression: TypeAlias = Any # mypy.nodes._Expression -_JsonDict: TypeAlias = Any # mypy.nodes._JsonDict -_NameExpr: TypeAlias = Any # mypy.nodes._NameExpr -_Statement: TypeAlias = Any # mypy.nodes._Statement -_TypeInfo: TypeAlias = Any # mypy.nodes._TypeInfo -_ClassDefContext: TypeAlias = Any # mypy.plugin._ClassDefContext -_DynamicClassDefContext: TypeAlias = Any # mypy.plugin._DynamicClassDefContext -_SemanticAnalyzerPluginInterface: TypeAlias = Any # mypy.plugin._SemanticAnalyzerPluginInterface -_Type: TypeAlias = Any # mypy.types._Type - -_TArgType = TypeVar("_TArgType", bound=_CallExpr | _NameExpr) - -class SQLAlchemyAttribute: - name: Any - line: Any - column: Any - type: Any - info: Any - def __init__(self, name: str, line: int, column: int, typ: _Type | None, info: _TypeInfo) -> None: ... - def serialize(self) -> _JsonDict: ... - def expand_typevar_from_subtype(self, sub_type: _TypeInfo) -> None: ... - @classmethod - def deserialize(cls, info: _TypeInfo, data: _JsonDict, api: _SemanticAnalyzerPluginInterface) -> SQLAlchemyAttribute: ... - -def name_is_dunder(name): ... -def establish_as_sqlalchemy(info: _TypeInfo) -> None: ... -def set_is_base(info: _TypeInfo) -> None: ... -def get_is_base(info: _TypeInfo) -> bool: ... -def has_declarative_base(info: _TypeInfo) -> bool: ... -def set_has_table(info: _TypeInfo) -> None: ... -def get_has_table(info: _TypeInfo) -> bool: ... -def get_mapped_attributes(info: _TypeInfo, api: _SemanticAnalyzerPluginInterface) -> list[SQLAlchemyAttribute] | None: ... -def set_mapped_attributes(info: _TypeInfo, attributes: list[SQLAlchemyAttribute]) -> None: ... -def fail(api: _SemanticAnalyzerPluginInterface, msg: str, ctx: _Context) -> None: ... -def add_global(ctx: _ClassDefContext | _DynamicClassDefContext, module: str, symbol_name: str, asname: str) -> None: ... -@overload -def get_callexpr_kwarg(callexpr: _CallExpr, name: str, *, expr_types: None = ...) -> _CallExpr | _NameExpr | None: ... -@overload -def get_callexpr_kwarg(callexpr: _CallExpr, name: str, *, expr_types: tuple[type[_TArgType], ...]) -> _TArgType | None: ... -def flatten_typechecking(stmts: Iterable[_Statement]) -> Iterator[_Statement]: ... -def unbound_to_instance(api: _SemanticAnalyzerPluginInterface, typ: _Type) -> _Type: ... -def info_for_cls(cls, api: _SemanticAnalyzerPluginInterface) -> _TypeInfo | None: ... -def expr_to_mapped_constructor(expr: _Expression) -> _CallExpr: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/orderinglist.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/orderinglist.pyi index a4fe8305f..7c86012ba 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/orderinglist.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/orderinglist.pyi @@ -1,13 +1,14 @@ +from _typeshed import Incomplete from typing import Any -def ordering_list(attr, count_from: Any | None = ..., **kw): ... +def ordering_list(attr, count_from: Incomplete | None = ..., **kw): ... class OrderingList(list[Any]): ordering_attr: Any ordering_func: Any reorder_on_append: Any def __init__( - self, ordering_attr: Any | None = ..., ordering_func: Any | None = ..., reorder_on_append: bool = ... + self, ordering_attr: Incomplete | None = ..., ordering_func: Incomplete | None = ..., reorder_on_append: bool = ... ) -> None: ... def reorder(self) -> None: ... def append(self, entity) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/serializer.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/serializer.pyi index d4a4a2cad..4177beb2f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/serializer.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/serializer.pyi @@ -1,6 +1,8 @@ -from typing import Any +from _typeshed import Incomplete def Serializer(*args, **kw): ... -def Deserializer(file, metadata: Any | None = ..., scoped_session: Any | None = ..., engine: Any | None = ...): ... +def Deserializer( + file, metadata: Incomplete | None = ..., scoped_session: Incomplete | None = ..., engine: Incomplete | None = ... +): ... def dumps(obj, protocol=...): ... -def loads(data, metadata: Any | None = ..., scoped_session: Any | None = ..., engine: Any | None = ...): ... +def loads(data, metadata: Incomplete | None = ..., scoped_session: Incomplete | None = ..., engine: Incomplete | None = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/future/engine.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/future/engine.pyi index bd4ff1dfa..f1b3362d1 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/future/engine.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/future/engine.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any, overload from typing_extensions import Literal @@ -12,7 +13,7 @@ NO_OPTIONS: Any def create_engine(url: URL | str, *, strategy: Literal["mock"], **kwargs) -> MockConnection: ... # type: ignore[misc] @overload def create_engine( - url: URL | str, *, module: Any | None = ..., enable_from_linting: bool = ..., future: bool = ..., **kwargs + url: URL | str, *, module: Incomplete | None = ..., enable_from_linting: bool = ..., future: bool = ..., **kwargs ) -> Engine: ... class Connection(_LegacyConnection): @@ -21,8 +22,8 @@ class Connection(_LegacyConnection): def commit(self) -> None: ... def rollback(self) -> None: ... def close(self) -> None: ... - def execute(self, statement, parameters: Any | None = ..., execution_options: Any | None = ...): ... # type: ignore[override] - def scalar(self, statement, parameters: Any | None = ..., execution_options: Any | None = ...): ... # type: ignore[override] + def execute(self, statement, parameters: Incomplete | None = ..., execution_options: Incomplete | None = ...): ... # type: ignore[override] + def scalar(self, statement, parameters: Incomplete | None = ..., execution_options: Incomplete | None = ...): ... # type: ignore[override] class Engine(_LegacyEngine): transaction: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/log.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/log.pyi index 54b045cbc..98b20ef91 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/log.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/log.pyi @@ -1,7 +1,7 @@ -from _typeshed import Self +from _typeshed import Unused from logging import Logger from typing import Any, TypeVar, overload -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal, Self, TypeAlias _ClsT = TypeVar("_ClsT", bound=type) _EchoFlag: TypeAlias = bool | Literal["debug"] | None @@ -33,7 +33,7 @@ def instance_logger(instance: Identified, echoflag: _EchoFlag = ...) -> None: .. class echo_property: __doc__: str @overload - def __get__(self: Self, instance: None, owner: object) -> Self: ... + def __get__(self, instance: None, owner: Unused) -> Self: ... @overload - def __get__(self, instance: Identified, owner: object) -> _EchoFlag: ... + def __get__(self, instance: Identified, owner: Unused) -> _EchoFlag: ... def __set__(self, instance: Identified, value: _EchoFlag) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/__init__.pyi index e4b08eeb9..6e32aa68b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/__init__.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from ..util.langhelpers import public_factory as public_factory @@ -84,7 +85,7 @@ from .util import ( with_polymorphic as with_polymorphic, ) -def create_session(bind: Any | None = ..., **kwargs): ... +def create_session(bind: Incomplete | None = ..., **kwargs): ... with_loader_criteria: Any relationship: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/attributes.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/attributes.pyi index e68ec23f9..c054153ee 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/attributes.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/attributes.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any, Generic, NamedTuple, TypeVar from ..sql import base as sql_base, roles, traversals @@ -31,9 +32,9 @@ class QueryableAttribute( class_, key, parententity, - impl: Any | None = ..., - comparator: Any | None = ..., - of_type: Any | None = ..., + impl: Incomplete | None = ..., + comparator: Incomplete | None = ..., + of_type: Incomplete | None = ..., extra_criteria=..., ) -> None: ... def __reduce__(self): ... @@ -52,7 +53,7 @@ class QueryableAttribute( def operate(self, op, *other, **kwargs): ... def reverse_operate(self, op, other, **kwargs): ... def hasparent(self, state, optimistic: bool = ...): ... - def __getattr__(self, key): ... + def __getattr__(self, key: str): ... @memoized_property def property(self): ... @@ -112,12 +113,12 @@ class AttributeImpl: callable_, dispatch, trackparent: bool = ..., - compare_function: Any | None = ..., + compare_function: Incomplete | None = ..., active_history: bool = ..., - parent_token: Any | None = ..., + parent_token: Incomplete | None = ..., load_on_unexpire: bool = ..., send_modified_events: bool = ..., - accepts_scalar_loader: Any | None = ..., + accepts_scalar_loader: Incomplete | None = ..., **kwargs, ) -> None: ... active_history: Any @@ -129,7 +130,7 @@ class AttributeImpl: def append(self, state, dict_, value, initiator, passive=...) -> None: ... def remove(self, state, dict_, value, initiator, passive=...) -> None: ... def pop(self, state, dict_, value, initiator, passive=...) -> None: ... - def set(self, state, dict_, value, initiator, passive=..., check_old: Any | None = ..., pop: bool = ...) -> None: ... + def set(self, state, dict_, value, initiator, passive=..., check_old: Incomplete | None = ..., pop: bool = ...) -> None: ... def get_committed_value(self, state, dict_, passive=...): ... def set_committed_value(self, state, dict_, value): ... @@ -142,7 +143,7 @@ class ScalarAttributeImpl(AttributeImpl): def __init__(self, *arg, **kw) -> None: ... def delete(self, state, dict_) -> None: ... def get_history(self, state, dict_, passive=...): ... - def set(self, state, dict_, value, initiator, passive=..., check_old: Any | None = ..., pop: bool = ...) -> None: ... + def set(self, state, dict_, value, initiator, passive=..., check_old: Incomplete | None = ..., pop: bool = ...) -> None: ... def fire_replace_event(self, state, dict_, value, previous, initiator): ... def fire_remove_event(self, state, dict_, value, initiator) -> None: ... @property @@ -156,7 +157,7 @@ class ScalarObjectAttributeImpl(ScalarAttributeImpl): def delete(self, state, dict_) -> None: ... def get_history(self, state, dict_, passive=...): ... def get_all_pending(self, state, dict_, passive=...): ... - def set(self, state, dict_, value, initiator, passive=..., check_old: Any | None = ..., pop: bool = ...) -> None: ... + def set(self, state, dict_, value, initiator, passive=..., check_old: Incomplete | None = ..., pop: bool = ...) -> None: ... def fire_remove_event(self, state, dict_, value, initiator) -> None: ... def fire_replace_event(self, state, dict_, value, previous, initiator): ... @@ -174,10 +175,10 @@ class CollectionAttributeImpl(AttributeImpl): key, callable_, dispatch, - typecallable: Any | None = ..., + typecallable: Incomplete | None = ..., trackparent: bool = ..., - copy_function: Any | None = ..., - compare_function: Any | None = ..., + copy_function: Incomplete | None = ..., + compare_function: Incomplete | None = ..., **kwargs, ) -> None: ... def get_history(self, state, dict_, passive=...): ... @@ -195,20 +196,20 @@ class CollectionAttributeImpl(AttributeImpl): state, dict_, value, - initiator: Any | None = ..., + initiator: Incomplete | None = ..., passive=..., - check_old: Any | None = ..., + check_old: Incomplete | None = ..., pop: bool = ..., _adapt: bool = ..., ) -> None: ... def set_committed_value(self, state, dict_, value): ... - def get_collection(self, state, dict_, user_data: Any | None = ..., passive=...): ... + def get_collection(self, state, dict_, user_data: Incomplete | None = ..., passive=...): ... def backref_listeners(attribute, key, uselist): ... class History: - def __bool__(self): ... - __nonzero__: Any + def __bool__(self) -> bool: ... + def __nonzero__(self) -> bool: ... def empty(self): ... def sum(self): ... def non_deleted(self): ... @@ -232,18 +233,20 @@ def register_attribute_impl( class_, key, uselist: bool = ..., - callable_: Any | None = ..., + callable_: Incomplete | None = ..., useobject: bool = ..., - impl_class: Any | None = ..., - backref: Any | None = ..., + impl_class: Incomplete | None = ..., + backref: Incomplete | None = ..., **kw, ): ... -def register_descriptor(class_, key, comparator: Any | None = ..., parententity: Any | None = ..., doc: Any | None = ...): ... +def register_descriptor( + class_, key, comparator: Incomplete | None = ..., parententity: Incomplete | None = ..., doc: Incomplete | None = ... +): ... def unregister_attribute(class_, key) -> None: ... def init_collection(obj, key): ... def init_state_collection(state, dict_, key): ... def set_committed_value(instance, key, value) -> None: ... -def set_attribute(instance, key, value, initiator: Any | None = ...) -> None: ... +def set_attribute(instance, key, value, initiator: Incomplete | None = ...) -> None: ... def get_attribute(instance, key): ... def del_attribute(instance, key) -> None: ... def flag_modified(instance, key) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/clsregistry.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/clsregistry.pyi index 585189669..b21f02a3a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/clsregistry.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/clsregistry.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any def add_class(classname, cls, decl_class_registry) -> None: ... @@ -6,7 +7,7 @@ def remove_class(classname, cls, decl_class_registry) -> None: ... class _MultipleClassMarker: on_remove: Any contents: Any - def __init__(self, classes, on_remove: Any | None = ...) -> None: ... + def __init__(self, classes, on_remove: Incomplete | None = ...) -> None: ... def remove_item(self, cls) -> None: ... def __iter__(self): ... def attempt_get(self, path, key): ... @@ -28,18 +29,18 @@ class _ModuleMarker: class _ModNS: def __init__(self, parent) -> None: ... - def __getattr__(self, key): ... + def __getattr__(self, key: str): ... class _GetColumns: cls: Any def __init__(self, cls) -> None: ... - def __getattr__(self, key): ... + def __getattr__(self, key: str): ... class _GetTable: key: Any metadata: Any def __init__(self, key, metadata) -> None: ... - def __getattr__(self, key): ... + def __getattr__(self, key: str): ... class _class_resolver: cls: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/collections.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/collections.pyi index fd59745d0..0160b4919 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/collections.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/collections.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any class _PlainColumnGetter: @@ -63,22 +64,22 @@ class CollectionAdapter: @property def data(self): ... def bulk_appender(self): ... - def append_with_event(self, item, initiator: Any | None = ...) -> None: ... + def append_with_event(self, item, initiator: Incomplete | None = ...) -> None: ... def append_without_event(self, item) -> None: ... def append_multiple_without_event(self, items) -> None: ... def bulk_remover(self): ... - def remove_with_event(self, item, initiator: Any | None = ...) -> None: ... + def remove_with_event(self, item, initiator: Incomplete | None = ...) -> None: ... def remove_without_event(self, item) -> None: ... - def clear_with_event(self, initiator: Any | None = ...) -> None: ... + def clear_with_event(self, initiator: Incomplete | None = ...) -> None: ... def clear_without_event(self) -> None: ... def __iter__(self): ... - def __len__(self): ... - def __bool__(self): ... - __nonzero__: Any - def fire_append_wo_mutation_event(self, item, initiator: Any | None = ...): ... - def fire_append_event(self, item, initiator: Any | None = ...): ... - def fire_remove_event(self, item, initiator: Any | None = ...) -> None: ... - def fire_pre_remove_event(self, initiator: Any | None = ...) -> None: ... + def __len__(self) -> int: ... + def __bool__(self) -> bool: ... + def __nonzero__(self) -> bool: ... + def fire_append_wo_mutation_event(self, item, initiator: Incomplete | None = ...): ... + def fire_append_event(self, item, initiator: Incomplete | None = ...): ... + def fire_remove_event(self, item, initiator: Incomplete | None = ...) -> None: ... + def fire_pre_remove_event(self, initiator: Incomplete | None = ...) -> None: ... class InstrumentedList(list[Any]): ... class InstrumentedSet(set[Any]): ... @@ -87,5 +88,5 @@ class InstrumentedDict(dict[Any, Any]): ... class MappedCollection(dict[Any, Any]): keyfunc: Any def __init__(self, keyfunc) -> None: ... - def set(self, value, _sa_initiator: Any | None = ...) -> None: ... - def remove(self, value, _sa_initiator: Any | None = ...) -> None: ... + def set(self, value, _sa_initiator: Incomplete | None = ...) -> None: ... + def remove(self, value, _sa_initiator: Incomplete | None = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/context.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/context.pyi index 8e6edadac..423eeb985 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/context.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/context.pyi @@ -37,8 +37,8 @@ class QueryContext: params, session, load_options, - execution_options: Any | None = ..., - bind_arguments: Any | None = ..., + execution_options: Incomplete | None = ..., + bind_arguments: Incomplete | None = ..., ) -> None: ... class ORMCompileState(CompileState): diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/decl_api.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/decl_api.pyi index 5970c26d7..dc181862a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/decl_api.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/decl_api.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete, Unused from collections.abc import Callable from typing import Any, ClassVar, TypeVar, overload from typing_extensions import TypeAlias @@ -27,7 +28,7 @@ _DeclarativeBaseMeta: TypeAlias = Callable[[str, tuple[type[Any], ...], dict[str def has_inherited_table(cls: type[Any]) -> bool: ... class DeclarativeMeta(type): - def __init__(cls, classname: str, bases: tuple[type[Any], ...], dict_: dict[str, Any], **kw: object) -> None: ... + def __init__(cls, classname: str, bases: tuple[type[Any], ...], dict_: dict[str, Any], **kw: Unused) -> None: ... def __setattr__(cls, key: str, value: Any) -> None: ... def __delattr__(cls, key: str) -> None: ... @@ -49,7 +50,7 @@ def declarative_mixin(cls: _ClsT) -> _ClsT: ... def declarative_base( bind: Connectable | None = ..., metadata: MetaData | None = ..., - mapper: Any | None = ..., + mapper: Incomplete | None = ..., cls: type[Any] | tuple[type[Any], ...] = ..., name: str = ..., constructor: Callable[..., None] = ..., @@ -59,7 +60,7 @@ def declarative_base( def declarative_base( bind: Connectable | None = ..., metadata: MetaData | None = ..., - mapper: Any | None = ..., + mapper: Incomplete | None = ..., cls: type[Any] | tuple[type[Any], ...] = ..., name: str = ..., constructor: Callable[..., None] = ..., @@ -71,7 +72,7 @@ def declarative_base( def declarative_base( bind: Connectable | None, metadata: MetaData | None, - mapper: Any | None, + mapper: Incomplete | None, cls: type[Any] | tuple[type[Any], ...], name: str, constructor: Callable[..., None], @@ -95,12 +96,12 @@ class registry: def dispose(self, cascade: bool = ...) -> None: ... @overload def generate_base( - self, mapper: Any | None = ..., cls: type[Any] | tuple[type[Any], ...] = ..., name: str = ... + self, mapper: Incomplete | None = ..., cls: type[Any] | tuple[type[Any], ...] = ..., name: str = ... ) -> type[_DeclarativeBase]: ... @overload def generate_base( self, - mapper: Any | None = ..., + mapper: Incomplete | None = ..., cls: type[Any] | tuple[type[Any], ...] = ..., name: str = ..., *, @@ -108,19 +109,23 @@ class registry: ) -> _DeclT: ... @overload def generate_base( - self, mapper: Any | None, cls: type[Any] | tuple[type[Any], ...], name: str, metaclass: _DeclarativeBaseMeta[_DeclT] + self, + mapper: Incomplete | None, + cls: type[Any] | tuple[type[Any], ...], + name: str, + metaclass: _DeclarativeBaseMeta[_DeclT], ) -> type[_DeclarativeBase]: ... def mapped(self, cls: _ClsT) -> _ClsT: ... # Return type of the callable is a _DeclarativeBase class with the passed in class as base. # This could be better approximated with Intersection[PassedInClass, _DeclarativeBase]. @overload - def as_declarative_base(self, *, mapper: Any | None = ...) -> Callable[[_ClsT], _ClsT | DeclarativeMeta | Any]: ... + def as_declarative_base(self, *, mapper: Incomplete | None = ...) -> Callable[[_ClsT], _ClsT | DeclarativeMeta | Any]: ... @overload def as_declarative_base( - self, *, mapper: Any | None = ..., metaclass: _DeclarativeBaseMeta[_DeclT] + self, *, mapper: Incomplete | None = ..., metaclass: _DeclarativeBaseMeta[_DeclT] ) -> Callable[[_ClsT], _ClsT | _DeclT | Any]: ... def map_declaratively(self, cls): ... - def map_imperatively(self, class_, local_table: Any | None = ..., **kw): ... + def map_imperatively(self, class_, local_table: Incomplete | None = ..., **kw): ... @overload def as_declarative( @@ -128,7 +133,7 @@ def as_declarative( bind: Connectable | None = ..., metadata: MetaData | None = ..., class_registry: dict[str, type[Any]] | None = ..., - mapper: Any | None = ..., + mapper: Incomplete | None = ..., ) -> Callable[[_ClsT], _ClsT | DeclarativeMeta | Any]: ... @overload def as_declarative( @@ -136,6 +141,6 @@ def as_declarative( bind: Connectable | None = ..., metadata: MetaData | None = ..., class_registry: dict[str, type[Any]] | None = ..., - mapper: Any | None = ..., + mapper: Incomplete | None = ..., metaclass: _DeclarativeBaseMeta[_DeclT], ) -> Callable[[_ClsT], _ClsT | _DeclT | Any]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/descriptor_props.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/descriptor_props.pyi index 3021db358..f4e8b7930 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/descriptor_props.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/descriptor_props.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any, ClassVar, Generic, TypeVar from ..sql.operators import ColumnOperators @@ -60,11 +61,11 @@ class SynonymProperty(DescriptorProperty): def __init__( self, name, - map_column: Any | None = ..., - descriptor: Any | None = ..., - comparator_factory: Any | None = ..., - doc: Any | None = ..., - info: Any | None = ..., + map_column: Incomplete | None = ..., + descriptor: Incomplete | None = ..., + comparator_factory: Incomplete | None = ..., + doc: Incomplete | None = ..., + info: Incomplete | None = ..., ) -> None: ... @property def uses_objects(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/dynamic.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/dynamic.pyi index 801fe6aa9..40193a48f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/dynamic.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/dynamic.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any, Generic, TypeVar from . import attributes, strategies @@ -20,20 +21,20 @@ class DynamicAttributeImpl(attributes.AttributeImpl): target_mapper: Any query_class: Any def __init__( - self, class_, key, typecallable, dispatch, target_mapper, order_by, query_class: Any | None = ..., **kw + self, class_, key, typecallable, dispatch, target_mapper, order_by, query_class: Incomplete | None = ..., **kw ) -> None: ... def get(self, state, dict_, passive=...): ... - def get_collection(self, state, dict_, user_data: Any | None = ..., passive=...): ... - def fire_append_event(self, state, dict_, value, initiator, collection_history: Any | None = ...) -> None: ... - def fire_remove_event(self, state, dict_, value, initiator, collection_history: Any | None = ...) -> None: ... + def get_collection(self, state, dict_, user_data: Incomplete | None = ..., passive=...): ... + def fire_append_event(self, state, dict_, value, initiator, collection_history: Incomplete | None = ...) -> None: ... + def fire_remove_event(self, state, dict_, value, initiator, collection_history: Incomplete | None = ...) -> None: ... def set( self, state, dict_, value, - initiator: Any | None = ..., + initiator: Incomplete | None = ..., passive=..., - check_old: Any | None = ..., + check_old: Incomplete | None = ..., pop: bool = ..., _adapt: bool = ..., ) -> None: ... @@ -49,9 +50,9 @@ class DynamicCollectionAdapter: data: Any def __init__(self, data) -> None: ... def __iter__(self): ... - def __len__(self): ... - def __bool__(self): ... - __nonzero__: Any + def __len__(self) -> int: ... + def __bool__(self) -> bool: ... + def __nonzero__(self) -> bool: ... class AppenderMixin: query_class: Any @@ -73,7 +74,7 @@ class CollectionHistory: unchanged_items: Any added_items: Any deleted_items: Any - def __init__(self, attr, state, apply_to: Any | None = ...) -> None: ... + def __init__(self, attr, state, apply_to: Incomplete | None = ...) -> None: ... @property def added_plus_unchanged(self): ... @property diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/evaluator.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/evaluator.pyi index dbf481ab5..9091e9694 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/evaluator.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/evaluator.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from ..sql import operators @@ -10,7 +11,7 @@ class _NoObject(operators.ColumnOperators[Any]): class EvaluatorCompiler: target_cls: Any - def __init__(self, target_cls: Any | None = ...) -> None: ... + def __init__(self, target_cls: Incomplete | None = ...) -> None: ... def process(self, *clauses): ... def visit_grouping(self, clause): ... def visit_null(self, clause): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/exc.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/exc.pyi index 28a664a27..384ffdf11 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/exc.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/exc.pyi @@ -1,6 +1,8 @@ +from _typeshed import Incomplete from typing import Any from .. import exc as sa_exc +from ..exc import NoResultFound as NoResultFound NO_STATE: Any @@ -16,15 +18,15 @@ class DetachedInstanceError(sa_exc.SQLAlchemyError): code: str class UnmappedInstanceError(UnmappedError): - def __init__(self, obj, msg: Any | None = ...) -> None: ... + def __init__(self, obj, msg: Incomplete | None = ...) -> None: ... def __reduce__(self): ... class UnmappedClassError(UnmappedError): - def __init__(self, cls, msg: Any | None = ...) -> None: ... + def __init__(self, cls, msg: Incomplete | None = ...) -> None: ... def __reduce__(self): ... class ObjectDeletedError(sa_exc.InvalidRequestError): - def __init__(self, state, msg: Any | None = ...) -> None: ... + def __init__(self, state, msg: Incomplete | None = ...) -> None: ... def __reduce__(self): ... class UnmappedColumnError(sa_exc.InvalidRequestError): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/identity.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/identity.pyi index deb590c27..062e91c0c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/identity.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/identity.pyi @@ -1,7 +1,6 @@ -from typing import Any +from _typeshed import Incomplete class IdentityMap: - def __init__(self) -> None: ... def keys(self): ... def replace(self, state) -> None: ... def add(self, state) -> None: ... @@ -11,8 +10,8 @@ class IdentityMap: def has_key(self, key): ... def popitem(self) -> None: ... def pop(self, key, *args) -> None: ... - def setdefault(self, key, default: Any | None = ...) -> None: ... - def __len__(self): ... + def setdefault(self, key, default: Incomplete | None = ...) -> None: ... + def __len__(self) -> int: ... def copy(self) -> None: ... def __setitem__(self, key, value) -> None: ... def __delitem__(self, key) -> None: ... @@ -23,7 +22,7 @@ class WeakInstanceDict(IdentityMap): def contains_state(self, state): ... def replace(self, state): ... def add(self, state): ... - def get(self, key, default: Any | None = ...): ... + def get(self, key, default: Incomplete | None = ...): ... def items(self): ... def values(self): ... def __iter__(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/instrumentation.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/instrumentation.pyi index d3fcb9d9e..6c972cef5 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/instrumentation.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/instrumentation.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from ..util import HasMemoized, hybridmethod @@ -24,7 +25,7 @@ class ClassManager(HasMemoized, dict[Any, Any]): local_attrs: Any originals: Any def __init__(self, class_) -> None: ... - def __hash__(self): ... + def __hash__(self) -> int: ... # type: ignore[override] def __eq__(self, other): ... @property def is_mapped(self): ... @@ -52,13 +53,13 @@ class ClassManager(HasMemoized, dict[Any, Any]): def get_impl(self, key): ... @property def attributes(self): ... - def new_instance(self, state: Any | None = ...): ... - def setup_instance(self, instance, state: Any | None = ...) -> None: ... + def new_instance(self, state: Incomplete | None = ...): ... + def setup_instance(self, instance, state: Incomplete | None = ...) -> None: ... def teardown_instance(self, instance) -> None: ... def has_state(self, instance): ... def has_parent(self, state, key, optimistic: bool = ...): ... - def __bool__(self): ... - __nonzero__: Any + def __bool__(self) -> bool: ... + def __nonzero__(self) -> bool: ... class _SerializeManager: class_: Any @@ -77,11 +78,11 @@ manager_of_class = base.manager_of_class def register_class( class_, finalize: bool = ..., - mapper: Any | None = ..., - registry: Any | None = ..., - declarative_scan: Any | None = ..., - expired_attribute_loader: Any | None = ..., - init_method: Any | None = ..., + mapper: Incomplete | None = ..., + registry: Incomplete | None = ..., + declarative_scan: Incomplete | None = ..., + expired_attribute_loader: Incomplete | None = ..., + init_method: Incomplete | None = ..., ): ... def unregister_class(class_) -> None: ... def is_instrumented(instance, key): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/interfaces.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/interfaces.pyi index ccc638095..61b1c7f7e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/interfaces.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/interfaces.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any, Generic, TypeVar from .. import util @@ -45,7 +46,7 @@ class MapperProperty(HasCacheKey, _MappedAttribute, InspectionAttr, util.Memoize is_property: bool def setup(self, context, query_entity, path, adapter, **kwargs) -> None: ... def create_row_processor(self, context, query_entity, path, mapper, result, adapter, populators) -> None: ... - def cascade_iterator(self, type_, state, dict_, visited_states, halt_on: Any | None = ...): ... + def cascade_iterator(self, type_, state, dict_, visited_states, halt_on: Incomplete | None = ...): ... parent: Any def set_parent(self, parent, init) -> None: ... def instrument_class(self, mapper) -> None: ... @@ -63,7 +64,7 @@ class PropComparator(operators.ColumnOperators[_T], Generic[_T]): __visit_name__: str prop: Any property: Any - def __init__(self, prop, parentmapper, adapt_to_entity: Any | None = ...) -> None: ... + def __init__(self, prop, parentmapper, adapt_to_entity: Incomplete | None = ...) -> None: ... def __clause_element__(self) -> None: ... def adapt_to_entity(self, adapt_to_entity): ... @property @@ -78,8 +79,8 @@ class PropComparator(operators.ColumnOperators[_T], Generic[_T]): def of_type_op(a, class_): ... def of_type(self, class_): ... def and_(self, *criteria): ... - def any(self, criterion: Any | None = ..., **kwargs): ... - def has(self, criterion: Any | None = ..., **kwargs): ... + def any(self, criterion: Incomplete | None = ..., **kwargs): ... + def has(self, criterion: Incomplete | None = ..., **kwargs): ... class StrategizedProperty(MapperProperty): inherit_cache: bool @@ -110,7 +111,7 @@ class CriteriaOption(CompileStateOption): class UserDefinedOption(ORMOption): propagate_to_loaders: bool payload: Any - def __init__(self, payload: Any | None = ...) -> None: ... + def __init__(self, payload: Incomplete | None = ...) -> None: ... class MapperOption(ORMOption): propagate_to_loaders: bool diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/loading.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/loading.pyi index ce8486f59..834124598 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/loading.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/loading.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any def instances(cursor, context): ... @@ -8,10 +9,10 @@ def load_on_ident( session, statement, key, - load_options: Any | None = ..., - refresh_state: Any | None = ..., - with_for_update: Any | None = ..., - only_load_props: Any | None = ..., + load_options: Incomplete | None = ..., + refresh_state: Incomplete | None = ..., + with_for_update: Incomplete | None = ..., + only_load_props: Incomplete | None = ..., no_autoflush: bool = ..., bind_arguments=..., execution_options=..., @@ -20,11 +21,11 @@ def load_on_pk_identity( session, statement, primary_key_identity, - load_options: Any | None = ..., - refresh_state: Any | None = ..., - with_for_update: Any | None = ..., - only_load_props: Any | None = ..., - identity_token: Any | None = ..., + load_options: Incomplete | None = ..., + refresh_state: Incomplete | None = ..., + with_for_update: Incomplete | None = ..., + only_load_props: Incomplete | None = ..., + identity_token: Incomplete | None = ..., no_autoflush: bool = ..., bind_arguments=..., execution_options=..., @@ -34,7 +35,6 @@ class PostLoad: loaders: Any states: Any load_keys: Any - def __init__(self) -> None: ... def add_state(self, state, overwrite) -> None: ... def invoke(self, context, path) -> None: ... @classmethod diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/mapper.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/mapper.pyi index 931bde703..999ad8981 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/mapper.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/mapper.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from ..sql import base as sql_base @@ -45,27 +46,27 @@ class Mapper(ORMFromClauseRole, ORMEntityColumnsClauseRole, sql_base.MemoizedHas def __init__( self, class_, - local_table: Any | None = ..., - properties: Any | None = ..., - primary_key: Any | None = ..., + local_table: Incomplete | None = ..., + properties: Incomplete | None = ..., + primary_key: Incomplete | None = ..., non_primary: bool = ..., - inherits: Any | None = ..., - inherit_condition: Any | None = ..., - inherit_foreign_keys: Any | None = ..., + inherits: Incomplete | None = ..., + inherit_condition: Incomplete | None = ..., + inherit_foreign_keys: Incomplete | None = ..., always_refresh: bool = ..., - version_id_col: Any | None = ..., - version_id_generator: Any | None = ..., - polymorphic_on: Any | None = ..., - _polymorphic_map: Any | None = ..., - polymorphic_identity: Any | None = ..., + version_id_col: Incomplete | None = ..., + version_id_generator: Incomplete | None = ..., + polymorphic_on: Incomplete | None = ..., + _polymorphic_map: Incomplete | None = ..., + polymorphic_identity: Incomplete | None = ..., concrete: bool = ..., - with_polymorphic: Any | None = ..., - polymorphic_load: Any | None = ..., + with_polymorphic: Incomplete | None = ..., + polymorphic_load: Incomplete | None = ..., allow_partial_pks: bool = ..., batch: bool = ..., - column_prefix: Any | None = ..., - include_properties: Any | None = ..., - exclude_properties: Any | None = ..., + column_prefix: Incomplete | None = ..., + include_properties: Incomplete | None = ..., + exclude_properties: Incomplete | None = ..., passive_updates: bool = ..., passive_deletes: bool = ..., confirm_deleted_rows: bool = ..., @@ -125,11 +126,11 @@ class Mapper(ORMFromClauseRole, ORMEntityColumnsClauseRole, sql_base.MemoizedHas def primary_mapper(self): ... @property def primary_base_mapper(self): ... - def identity_key_from_row(self, row, identity_token: Any | None = ..., adapter: Any | None = ...): ... - def identity_key_from_primary_key(self, primary_key, identity_token: Any | None = ...): ... + def identity_key_from_row(self, row, identity_token: Incomplete | None = ..., adapter: Incomplete | None = ...): ... + def identity_key_from_primary_key(self, primary_key, identity_token: Incomplete | None = ...): ... def identity_key_from_instance(self, instance): ... def primary_key_from_instance(self, instance): ... - def cascade_iterator(self, type_, state, halt_on: Any | None = ...) -> None: ... + def cascade_iterator(self, type_, state, halt_on: Incomplete | None = ...) -> None: ... class _OptGetColumnsNotAvailable(Exception): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/path_registry.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/path_registry.pyi index 6d76489c4..9da5d3161 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/path_registry.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/path_registry.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any, ClassVar from ..sql.traversals import HasCacheKey @@ -14,9 +15,9 @@ class PathRegistry(HasCacheKey): def __ne__(self, other): ... def set(self, attributes, key, value) -> None: ... def setdefault(self, attributes, key, value) -> None: ... - def get(self, attributes, key, value: Any | None = ...): ... - def __len__(self): ... - def __hash__(self): ... + def get(self, attributes, key, value: Incomplete | None = ...): ... + def __len__(self) -> int: ... + def __hash__(self) -> int: ... @property def length(self): ... def pairs(self) -> None: ... @@ -93,14 +94,14 @@ class AbstractEntityRegistry(PathRegistry): def entity_path(self): ... @property def mapper(self): ... - def __bool__(self): ... - __nonzero__: Any + def __bool__(self) -> bool: ... + def __nonzero__(self) -> bool: ... def __getitem__(self, entity): ... class SlotsEntityRegistry(AbstractEntityRegistry): inherit_cache: bool -class CachingEntityRegistry(AbstractEntityRegistry, dict): # type: ignore[misc] +class CachingEntityRegistry(AbstractEntityRegistry, dict[Incomplete, Incomplete]): # type: ignore[misc] inherit_cache: bool def __getitem__(self, entity): ... def __missing__(self, key): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/query.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/query.pyi index 21aef16fd..ab769f034 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/query.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/query.pyi @@ -1,7 +1,7 @@ -from _typeshed import Self +from _typeshed import Incomplete from collections.abc import Iterator from typing import Any, Generic, TypeVar -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal, Self, TypeAlias from ..sql.annotation import SupportsCloneAnnotations from ..sql.base import Executable @@ -19,78 +19,80 @@ class Query(_SelectFromElements, SupportsCloneAnnotations, HasPrefixes, HasSuffi logger: Any load_options: Any session: Any - def __init__(self, entities, session: Any | None = ...) -> None: ... + def __init__(self, entities, session: Incomplete | None = ...) -> None: ... @property def statement(self): ... def subquery(self, name: str | None = ..., with_labels: bool = ..., reduce_columns: bool = ...): ... - def cte(self, name: Any | None = ..., recursive: bool = ..., nesting: bool = ...): ... + def cte(self, name: Incomplete | None = ..., recursive: bool = ..., nesting: bool = ...): ... def label(self, name): ... def as_scalar(self): ... def scalar_subquery(self): ... @property def selectable(self): ... def __clause_element__(self): ... - def only_return_tuples(self: Self, value) -> Self: ... + def only_return_tuples(self, value) -> Self: ... @property def is_single_entity(self): ... - def enable_eagerloads(self: Self, value) -> Self: ... + def enable_eagerloads(self, value) -> Self: ... def with_labels(self): ... apply_labels: Any @property def get_label_style(self): ... def set_label_style(self, style): ... - def enable_assertions(self: Self, value) -> Self: ... + def enable_assertions(self, value) -> Self: ... @property def whereclause(self): ... - def with_polymorphic(self: Self, cls_or_mappers, selectable: Any | None = ..., polymorphic_on: Any | None = ...) -> Self: ... - def yield_per(self: Self, count) -> Self: ... + def with_polymorphic( + self, cls_or_mappers, selectable: Incomplete | None = ..., polymorphic_on: Incomplete | None = ... + ) -> Self: ... + def yield_per(self, count) -> Self: ... def get(self, ident): ... @property def lazy_loaded_from(self): ... - def correlate(self: Self, *fromclauses) -> Self: ... - def autoflush(self: Self, setting) -> Self: ... - def populate_existing(self: Self) -> Self: ... - def with_parent(self, instance, property: Any | None = ..., from_entity: Any | None = ...): ... - def add_entity(self: Self, entity, alias: Any | None = ...) -> Self: ... - def with_session(self: Self, session) -> Self: ... + def correlate(self, *fromclauses) -> Self: ... + def autoflush(self, setting) -> Self: ... + def populate_existing(self) -> Self: ... + def with_parent(self, instance, property: Incomplete | None = ..., from_entity: Incomplete | None = ...): ... + def add_entity(self, entity, alias: Incomplete | None = ...) -> Self: ... + def with_session(self, session) -> Self: ... def from_self(self, *entities): ... def values(self, *columns): ... def value(self, column): ... - def with_entities(self: Self, *entities) -> Self: ... - def add_columns(self: Self, *column) -> Self: ... + def with_entities(self, *entities) -> Self: ... + def add_columns(self, *column) -> Self: ... def add_column(self, column): ... - def options(self: Self, *args) -> Self: ... + def options(self, *args) -> Self: ... def with_transformation(self, fn): ... def get_execution_options(self): ... - def execution_options(self: Self, **kwargs) -> Self: ... + def execution_options(self, **kwargs) -> Self: ... def with_for_update( - self: Self, read: bool = ..., nowait: bool = ..., of: Any | None = ..., skip_locked: bool = ..., key_share: bool = ... + self, read: bool = ..., nowait: bool = ..., of: Incomplete | None = ..., skip_locked: bool = ..., key_share: bool = ... ) -> Self: ... - def params(self: Self, *args, **kwargs) -> Self: ... + def params(self, *args, **kwargs) -> Self: ... def where(self, *criterion): ... - def filter(self: Self, *criterion) -> Self: ... - def filter_by(self: Self, **kwargs) -> Self: ... - def order_by(self: Self, *clauses) -> Self: ... - def group_by(self: Self, *clauses) -> Self: ... - def having(self: Self, criterion) -> Self: ... + def filter(self, *criterion) -> Self: ... + def filter_by(self, **kwargs) -> Self: ... + def order_by(self, *clauses) -> Self: ... + def group_by(self, *clauses) -> Self: ... + def having(self, criterion) -> Self: ... def union(self, *q): ... def union_all(self, *q): ... def intersect(self, *q): ... def intersect_all(self, *q): ... def except_(self, *q): ... def except_all(self, *q): ... - def join(self: Self, target, *props, **kwargs) -> Self: ... - def outerjoin(self: Self, target, *props, **kwargs) -> Self: ... - def reset_joinpoint(self: Self) -> Self: ... - def select_from(self: Self, *from_obj) -> Self: ... - def select_entity_from(self: Self, from_obj) -> Self: ... + def join(self, target, *props, **kwargs) -> Self: ... + def outerjoin(self, target, *props, **kwargs) -> Self: ... + def reset_joinpoint(self) -> Self: ... + def select_from(self, *from_obj) -> Self: ... + def select_entity_from(self, from_obj) -> Self: ... def __getitem__(self, item): ... - def slice(self: Self, start, stop) -> Self: ... - def limit(self: Self, limit) -> Self: ... - def offset(self: Self, offset) -> Self: ... - def distinct(self: Self, *expr) -> Self: ... + def slice(self, start, stop) -> Self: ... + def limit(self, limit) -> Self: ... + def offset(self, offset) -> Self: ... + def distinct(self, *expr) -> Self: ... def all(self) -> list[_T]: ... - def from_statement(self: Self, statement) -> Self: ... + def from_statement(self, statement) -> Self: ... def first(self) -> _T | None: ... def one_or_none(self): ... def one(self): ... @@ -98,12 +100,12 @@ class Query(_SelectFromElements, SupportsCloneAnnotations, HasPrefixes, HasSuffi def __iter__(self) -> Iterator[_T]: ... @property def column_descriptions(self): ... - def instances(self, result_proxy, context: Any | None = ...): ... + def instances(self, result_proxy, context: Incomplete | None = ...): ... def merge_result(self, iterator, load: bool = ...): ... def exists(self): ... def count(self) -> int: ... def delete(self, synchronize_session: _SynchronizeSessionArgument = ...) -> int: ... - def update(self, values, synchronize_session: _SynchronizeSessionArgument = ..., update_args: Any | None = ...): ... + def update(self, values, synchronize_session: _SynchronizeSessionArgument = ..., update_args: Incomplete | None = ...): ... class FromStatement(GroupedElement, SelectBase, Executable): __visit_name__: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/relationships.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/relationships.pyi index 09f4eefdf..e7382a512 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/relationships.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/relationships.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any, ClassVar, Generic, TypeVar from ..sql.operators import ColumnOperators @@ -50,39 +51,39 @@ class RelationshipProperty(StrategizedProperty): def __init__( self, argument, - secondary: Any | None = ..., - primaryjoin: Any | None = ..., - secondaryjoin: Any | None = ..., - foreign_keys: Any | None = ..., - uselist: Any | None = ..., + secondary: Incomplete | None = ..., + primaryjoin: Incomplete | None = ..., + secondaryjoin: Incomplete | None = ..., + foreign_keys: Incomplete | None = ..., + uselist: Incomplete | None = ..., order_by: bool = ..., - backref: Any | None = ..., - back_populates: Any | None = ..., - overlaps: Any | None = ..., + backref: Incomplete | None = ..., + back_populates: Incomplete | None = ..., + overlaps: Incomplete | None = ..., post_update: bool = ..., cascade: bool = ..., viewonly: bool = ..., lazy: str = ..., - collection_class: Any | None = ..., + collection_class: Incomplete | None = ..., passive_deletes=..., passive_updates=..., - remote_side: Any | None = ..., + remote_side: Incomplete | None = ..., enable_typechecks=..., - join_depth: Any | None = ..., - comparator_factory: Any | None = ..., + join_depth: Incomplete | None = ..., + comparator_factory: Incomplete | None = ..., single_parent: bool = ..., innerjoin: bool = ..., - distinct_target_key: Any | None = ..., - doc: Any | None = ..., + distinct_target_key: Incomplete | None = ..., + doc: Incomplete | None = ..., active_history=..., cascade_backrefs=..., load_on_pending: bool = ..., bake_queries: bool = ..., - _local_remote_pairs: Any | None = ..., - query_class: Any | None = ..., - info: Any | None = ..., - omit_join: Any | None = ..., - sync_backref: Any | None = ..., + _local_remote_pairs: Incomplete | None = ..., + query_class: Incomplete | None = ..., + info: Incomplete | None = ..., + omit_join: Incomplete | None = ..., + sync_backref: Incomplete | None = ..., _legacy_inactive_history_style: bool = ..., ) -> None: ... def instrument_class(self, mapper) -> None: ... @@ -90,7 +91,12 @@ class RelationshipProperty(StrategizedProperty): class Comparator(PropComparator[_T], Generic[_T]): prop: Any def __init__( - self, prop, parentmapper, adapt_to_entity: Any | None = ..., of_type: Any | None = ..., extra_criteria=... + self, + prop, + parentmapper, + adapt_to_entity: Incomplete | None = ..., + of_type: Incomplete | None = ..., + extra_criteria=..., ) -> None: ... def adapt_to_entity(self, adapt_to_entity): ... @memoized_property @@ -103,8 +109,8 @@ class RelationshipProperty(StrategizedProperty): def in_(self, other) -> ColumnOperators[_T]: ... __hash__: ClassVar[None] # type: ignore[assignment] def __eq__(self, other): ... - def any(self, criterion: Any | None = ..., **kwargs): ... - def has(self, criterion: Any | None = ..., **kwargs): ... + def any(self, criterion: Incomplete | None = ..., **kwargs): ... + def has(self, criterion: Incomplete | None = ..., **kwargs): ... def contains(self, other, **kwargs) -> ColumnOperators[_T]: ... def __ne__(self, other) -> ColumnOperators[_T]: ... # type: ignore[override] @memoized_property @@ -113,7 +119,7 @@ class RelationshipProperty(StrategizedProperty): def merge( self, session, source_state, source_dict, dest_state, dest_dict, load, _recursive, _resolve_conflict_map ) -> None: ... - def cascade_iterator(self, type_, state, dict_, visited_states, halt_on: Any | None = ...) -> None: ... + def cascade_iterator(self, type_, state, dict_, visited_states, halt_on: Incomplete | None = ...) -> None: ... @memoized_property def entity(self): ... @memoized_property @@ -145,16 +151,16 @@ class JoinCondition: child_persist_selectable, parent_local_selectable, child_local_selectable, - primaryjoin: Any | None = ..., - secondary: Any | None = ..., - secondaryjoin: Any | None = ..., - parent_equivalents: Any | None = ..., - child_equivalents: Any | None = ..., - consider_as_foreign_keys: Any | None = ..., - local_remote_pairs: Any | None = ..., - remote_side: Any | None = ..., + primaryjoin: Incomplete | None = ..., + secondary: Incomplete | None = ..., + secondaryjoin: Incomplete | None = ..., + parent_equivalents: Incomplete | None = ..., + child_equivalents: Incomplete | None = ..., + consider_as_foreign_keys: Incomplete | None = ..., + local_remote_pairs: Incomplete | None = ..., + remote_side: Incomplete | None = ..., self_referential: bool = ..., - prop: Any | None = ..., + prop: Incomplete | None = ..., support_sync: bool = ..., can_be_synced_fn=..., ): ... @@ -170,7 +176,9 @@ class JoinCondition: def local_columns(self): ... @memoized_property def foreign_key_columns(self): ... - def join_targets(self, source_selectable, dest_selectable, aliased, single_crit: Any | None = ..., extra_criteria=...): ... + def join_targets( + self, source_selectable, dest_selectable, aliased, single_crit: Incomplete | None = ..., extra_criteria=... + ): ... def create_lazy_clause(self, reverse_direction: bool = ...): ... class _ColInAnnotations: diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/scoping.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/scoping.pyi index 7d739982b..0731e4616 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/scoping.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/scoping.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from ..util import memoized_property @@ -9,9 +10,9 @@ class ScopedSessionMixin: class scoped_session(ScopedSessionMixin): session_factory: Any registry: Any - def __init__(self, session_factory, scopefunc: Any | None = ...) -> None: ... + def __init__(self, session_factory, scopefunc: Incomplete | None = ...) -> None: ... def remove(self) -> None: ... - def query_property(self, query_cls: Any | None = ...): ... + def query_property(self, query_cls: Incomplete | None = ...): ... # dynamically proxied from class Session bind: Any identity_map: Any @@ -44,40 +45,44 @@ class scoped_session(ScopedSessionMixin): def close(self) -> None: ... def commit(self) -> None: ... def connection( - self, bind_arguments: Any | None = ..., close_with_result: bool = ..., execution_options: Any | None = ..., **kw + self, + bind_arguments: Incomplete | None = ..., + close_with_result: bool = ..., + execution_options: Incomplete | None = ..., + **kw, ): ... def delete(self, instance) -> None: ... def execute( self, statement, - params: Any | None = ..., + params: Incomplete | None = ..., execution_options=..., - bind_arguments: Any | None = ..., - _parent_execute_state: Any | None = ..., - _add_event: Any | None = ..., + bind_arguments: Incomplete | None = ..., + _parent_execute_state: Incomplete | None = ..., + _add_event: Incomplete | None = ..., **kw, ): ... - def expire(self, instance, attribute_names: Any | None = ...) -> None: ... + def expire(self, instance, attribute_names: Incomplete | None = ...) -> None: ... def expire_all(self) -> None: ... def expunge(self, instance) -> None: ... def expunge_all(self) -> None: ... - def flush(self, objects: Any | None = ...) -> None: ... + def flush(self, objects: Incomplete | None = ...) -> None: ... def get( self, entity, ident, - options: Any | None = ..., + options: Incomplete | None = ..., populate_existing: bool = ..., - with_for_update: Any | None = ..., - identity_token: Any | None = ..., - execution_options: Any | None = ..., + with_for_update: Incomplete | None = ..., + identity_token: Incomplete | None = ..., + execution_options: Incomplete | None = ..., ): ... def get_bind( self, - mapper: Any | None = ..., - clause: Any | None = ..., - bind: Any | None = ..., - _sa_skip_events: Any | None = ..., + mapper: Incomplete | None = ..., + clause: Incomplete | None = ..., + bind: Incomplete | None = ..., + _sa_skip_events: Incomplete | None = ..., _sa_skip_for_implicit_returning: bool = ..., ): ... def is_modified(self, instance, include_collections: bool = ...): ... @@ -86,11 +91,15 @@ class scoped_session(ScopedSessionMixin): ): ... def bulk_insert_mappings(self, mapper, mappings, return_defaults: bool = ..., render_nulls: bool = ...) -> None: ... def bulk_update_mappings(self, mapper, mappings) -> None: ... - def merge(self, instance, load: bool = ..., options: Any | None = ...): ... + def merge(self, instance, load: bool = ..., options: Incomplete | None = ...): ... def query(self, *entities, **kwargs): ... - def refresh(self, instance, attribute_names: Any | None = ..., with_for_update: Any | None = ...) -> None: ... + def refresh(self, instance, attribute_names: Incomplete | None = ..., with_for_update: Incomplete | None = ...) -> None: ... def rollback(self) -> None: ... - def scalar(self, statement, params: Any | None = ..., execution_options=..., bind_arguments: Any | None = ..., **kw): ... - def scalars(self, statement, params: Any | None = ..., execution_options=..., bind_arguments: Any | None = ..., **kw): ... + def scalar( + self, statement, params: Incomplete | None = ..., execution_options=..., bind_arguments: Incomplete | None = ..., **kw + ): ... + def scalars( + self, statement, params: Incomplete | None = ..., execution_options=..., bind_arguments: Incomplete | None = ..., **kw + ): ... ScopedSession = scoped_session diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/session.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/session.pyi index 8f9d7b09b..9f60a2669 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/session.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/session.pyi @@ -1,6 +1,8 @@ -from _typeshed import Self +from _typeshed import Incomplete from collections.abc import Mapping +from types import TracebackType from typing import Any, TypeVar, overload +from typing_extensions import Self from ..engine.base import Connection from ..engine.result import Result @@ -32,10 +34,10 @@ class ORMExecuteState(MemoizedSlots): ) -> None: ... def invoke_statement( self, - statement: Any | None = ..., - params: Any | None = ..., - execution_options: Any | None = ..., - bind_arguments: Any | None = ..., + statement: Incomplete | None = ..., + params: Incomplete | None = ..., + execution_options: Incomplete | None = ..., + bind_arguments: Incomplete | None = ..., ): ... @property def bind_mapper(self): ... @@ -70,12 +72,12 @@ class ORMExecuteState(MemoizedSlots): class SessionTransaction(TransactionalContext): session: Any nested: Any - def __init__(self, session, parent: Any | None = ..., nested: bool = ..., autobegin: bool = ...) -> None: ... + def __init__(self, session, parent: Incomplete | None = ..., nested: bool = ..., autobegin: bool = ...) -> None: ... @property def parent(self): ... @property def is_active(self): ... - def connection(self, bindkey, execution_options: Any | None = ..., **kwargs): ... + def connection(self, bindkey, execution_options: Incomplete | None = ..., **kwargs): ... def prepare(self) -> None: ... def commit(self, _to_root: bool = ...): ... def rollback(self, _capture_exception: bool = ..., _to_root: bool = ...): ... @@ -93,20 +95,22 @@ class Session(_SessionClassMethods): twophase: Any def __init__( self, - bind: Any | None = ..., + bind: Incomplete | None = ..., autoflush: bool = ..., future: bool = ..., expire_on_commit: bool = ..., autocommit: bool = ..., twophase: bool = ..., - binds: Any | None = ..., + binds: Incomplete | None = ..., enable_baked_queries: bool = ..., - info: Any | None = ..., - query_cls: Any | None = ..., + info: Incomplete | None = ..., + query_cls: Incomplete | None = ..., ) -> None: ... connection_callable: Any - def __enter__(self: Self) -> Self: ... - def __exit__(self, type_, value, traceback) -> None: ... + def __enter__(self) -> Self: ... + def __exit__( + self, type_: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None + ) -> None: ... @property def transaction(self): ... def in_transaction(self): ... @@ -131,15 +135,19 @@ class Session(_SessionClassMethods): def execute( self, statement, - params: Any | None = ..., + params: Incomplete | None = ..., execution_options=..., - bind_arguments: Any | None = ..., - _parent_execute_state: Any | None = ..., - _add_event: Any | None = ..., + bind_arguments: Incomplete | None = ..., + _parent_execute_state: Incomplete | None = ..., + _add_event: Incomplete | None = ..., **kw, ) -> Result: ... - def scalar(self, statement, params: Any | None = ..., execution_options=..., bind_arguments: Any | None = ..., **kw): ... - def scalars(self, statement, params: Any | None = ..., execution_options=..., bind_arguments: Any | None = ..., **kw): ... + def scalar( + self, statement, params: Incomplete | None = ..., execution_options=..., bind_arguments: Incomplete | None = ..., **kw + ): ... + def scalars( + self, statement, params: Incomplete | None = ..., execution_options=..., bind_arguments: Incomplete | None = ..., **kw + ): ... def close(self) -> None: ... def invalidate(self) -> None: ... def expunge_all(self) -> None: ... @@ -147,10 +155,10 @@ class Session(_SessionClassMethods): def bind_table(self, table, bind) -> None: ... def get_bind( self, - mapper: Any | None = ..., - clause: Any | None = ..., - bind: Any | None = ..., - _sa_skip_events: Any | None = ..., + mapper: Incomplete | None = ..., + clause: Incomplete | None = ..., + bind: Incomplete | None = ..., + _sa_skip_events: Incomplete | None = ..., _sa_skip_for_implicit_returning: bool = ..., ): ... @overload @@ -163,9 +171,9 @@ class Session(_SessionClassMethods): def query(self, *entities: type[_T], **kwargs: Any) -> Query[_T]: ... @property def no_autoflush(self) -> None: ... - def refresh(self, instance, attribute_names: Any | None = ..., with_for_update: Any | None = ...) -> None: ... + def refresh(self, instance, attribute_names: Incomplete | None = ..., with_for_update: Incomplete | None = ...) -> None: ... def expire_all(self) -> None: ... - def expire(self, instance, attribute_names: Any | None = ...) -> None: ... + def expire(self, instance, attribute_names: Incomplete | None = ...) -> None: ... def expunge(self, instance) -> None: ... def add(self, instance, _warn: bool = ...) -> None: ... def add_all(self, instances) -> None: ... @@ -174,17 +182,17 @@ class Session(_SessionClassMethods): self, entity, ident, - options: Any | None = ..., + options: Incomplete | None = ..., populate_existing: bool = ..., - with_for_update: Any | None = ..., - identity_token: Any | None = ..., - execution_options: Any | None = ..., + with_for_update: Incomplete | None = ..., + identity_token: Incomplete | None = ..., + execution_options: Incomplete | None = ..., ): ... - def merge(self, instance, load: bool = ..., options: Any | None = ...): ... + def merge(self, instance, load: bool = ..., options: Incomplete | None = ...): ... def enable_relationship_loading(self, obj) -> None: ... def __contains__(self, instance): ... def __iter__(self): ... - def flush(self, objects: Any | None = ...) -> None: ... + def flush(self, objects: Incomplete | None = ...) -> None: ... def bulk_save_objects( self, objects, return_defaults: bool = ..., update_changed_only: bool = ..., preserve_order: bool = ... ): ... @@ -205,12 +213,12 @@ class sessionmaker(_SessionClassMethods): class_: Any def __init__( self, - bind: Any | None = ..., + bind: Incomplete | None = ..., class_=..., autoflush: bool = ..., autocommit: bool = ..., expire_on_commit: bool = ..., - info: Any | None = ..., + info: Incomplete | None = ..., **kw, ) -> None: ... def begin(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/state.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/state.pyi index 134ff2259..60621f0bf 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/state.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/state.pyi @@ -78,6 +78,5 @@ class AttributeState: class PendingCollection: deleted_items: Any added_items: Any - def __init__(self) -> None: ... def append(self, value) -> None: ... def remove(self, value) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/strategies.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/strategies.pyi index 463e13ee3..f4b950814 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/strategies.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/strategies.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any, NamedTuple from .. import util @@ -7,7 +8,7 @@ class UninstrumentedColumnLoader(LoaderStrategy): columns: Any def __init__(self, parent, strategy_key) -> None: ... def setup_query( - self, compile_state, query_entity, path, loadopt, adapter, column_collection: Any | None = ..., **kwargs + self, compile_state, query_entity, path, loadopt, adapter, column_collection: Incomplete | None = ..., **kwargs ) -> None: ... def create_row_processor(self, context, query_entity, path, loadopt, mapper, result, adapter, populators) -> None: ... @@ -38,7 +39,7 @@ class DeferredColumnLoader(LoaderStrategy): def create_row_processor(self, context, query_entity, path, loadopt, mapper, result, adapter, populators) -> None: ... is_class_level: bool def init_class_attribute(self, mapper) -> None: ... - def setup_query(self, compile_state, query_entity, path, loadopt, adapter, column_collection, memoized_populators, only_load_props: Any | None = ..., **kw) -> None: ... # type: ignore[override] + def setup_query(self, compile_state, query_entity, path, loadopt, adapter, column_collection, memoized_populators, only_load_props: Incomplete | None = ..., **kw) -> None: ... # type: ignore[override] class LoadDeferredColumns: key: Any @@ -115,8 +116,8 @@ class JoinedLoader(AbstractRelationshipLoader): path, loadopt, adapter, - column_collection: Any | None = ..., - parentmapper: Any | None = ..., + column_collection: Incomplete | None = ..., + parentmapper: Incomplete | None = ..., chained_from_outerjoin: bool = ..., **kwargs, ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi index 5fa175bbe..5422cfffb 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from ..sql.base import Generative @@ -18,13 +19,13 @@ class Load(Generative, LoaderOption): def process_compile_state(self, compile_state) -> None: ... def options(self, *opts) -> None: ... def set_relationship_strategy(self, attr, strategy, propagate_to_loaders: bool = ...) -> None: ... - def set_column_strategy(self, attrs, strategy, opts: Any | None = ..., opts_only: bool = ...) -> None: ... + def set_column_strategy(self, attrs, strategy, opts: Incomplete | None = ..., opts_only: bool = ...) -> None: ... def set_generic_strategy(self, attrs, strategy) -> None: ... def set_class_strategy(self, strategy, opts) -> None: ... # added dynamically at runtime - def contains_eager(self, attr, alias: Any | None = ...): ... + def contains_eager(self, attr, alias: Incomplete | None = ...): ... def load_only(self, *attrs): ... - def joinedload(self, attr, innerjoin: Any | None = ...): ... + def joinedload(self, attr, innerjoin: Incomplete | None = ...): ... def subqueryload(self, attr): ... def selectinload(self, attr): ... def lazyload(self, attr): ... @@ -44,14 +45,13 @@ class _UnboundLoad(Load): def __init__(self) -> None: ... class loader_option: - def __init__(self) -> None: ... name: Any fn: Any def __call__(self, fn): ... -def contains_eager(loadopt, attr, alias: Any | None = ...): ... +def contains_eager(loadopt, attr, alias: Incomplete | None = ...): ... def load_only(loadopt, *attrs): ... -def joinedload(loadopt, attr, innerjoin: Any | None = ...): ... +def joinedload(loadopt, attr, innerjoin: Incomplete | None = ...): ... def subqueryload(loadopt, attr): ... def selectinload(loadopt, attr): ... def lazyload(loadopt, attr): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/unitofwork.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/unitofwork.pyi index dde05b0a2..20de2df97 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/unitofwork.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/unitofwork.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any def track_cascade_events(descriptor, prop): ... @@ -28,8 +29,8 @@ class UOWTransaction: isdelete: bool = ..., listonly: bool = ..., cancel_delete: bool = ..., - operation: Any | None = ..., - prop: Any | None = ..., + operation: Incomplete | None = ..., + prop: Incomplete | None = ..., ): ... def register_post_update(self, state, post_update_cols) -> None: ... def filter_states_for_dep(self, dep, states): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/util.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/util.pyi index 23a5624b6..b7c6fd4f7 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/util.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/util.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from ..sql import base as sql_base, expression, util as sql_util @@ -40,7 +41,7 @@ class ORMAdapter(sql_util.ColumnAdapter): def __init__( self, entity, - equivalents: Any | None = ..., + equivalents: Incomplete | None = ..., adapt_required: bool = ..., allow_label_resolve: bool = ..., anonymize_labels: bool = ..., @@ -51,17 +52,17 @@ class AliasedClass: def __init__( self, mapped_class_or_ac, - alias: Any | None = ..., - name: Any | None = ..., + alias: Incomplete | None = ..., + name: Incomplete | None = ..., flat: bool = ..., adapt_on_names: bool = ..., with_polymorphic_mappers=..., - with_polymorphic_discriminator: Any | None = ..., - base_alias: Any | None = ..., + with_polymorphic_discriminator: Incomplete | None = ..., + base_alias: Incomplete | None = ..., use_mapper_path: bool = ..., represents_outer_join: bool = ..., ) -> None: ... - def __getattr__(self, key): ... + def __getattr__(self, key: str): ... class AliasedInsp(ORMEntityColumnsClauseRole, ORMFromClauseRole, sql_base.MemoizedHasCacheKey, InspectionAttr): mapper: Any @@ -96,7 +97,7 @@ class AliasedInsp(ORMEntityColumnsClauseRole, ORMFromClauseRole, sql_base.Memoiz class _WrapUserEntity: subject: Any def __init__(self, subject) -> None: ... - def __getattribute__(self, name): ... + def __getattribute__(self, name: str): ... class LoaderCriteriaOption(CriteriaOption): root_entity: Any @@ -118,18 +119,20 @@ class LoaderCriteriaOption(CriteriaOption): def process_compile_state(self, compile_state) -> None: ... def get_global_criteria(self, attributes) -> None: ... -def aliased(element, alias: Any | None = ..., name: Any | None = ..., flat: bool = ..., adapt_on_names: bool = ...): ... +def aliased( + element, alias: Incomplete | None = ..., name: Incomplete | None = ..., flat: bool = ..., adapt_on_names: bool = ... +): ... def with_polymorphic( base, classes, selectable: bool = ..., flat: bool = ..., - polymorphic_on: Any | None = ..., + polymorphic_on: Incomplete | None = ..., aliased: bool = ..., adapt_on_names: bool = ..., innerjoin: bool = ..., _use_mapper_path: bool = ..., - _existing_alias: Any | None = ..., + _existing_alias: Incomplete | None = ..., ) -> AliasedClass: ... class Bundle(ORMColumnsClauseRole, SupportsCloneAnnotations, sql_base.MemoizedHasCacheKey, InspectionAttr): @@ -163,19 +166,28 @@ class _ORMJoin(expression.Join): self, left, right, - onclause: Any | None = ..., + onclause: Incomplete | None = ..., isouter: bool = ..., full: bool = ..., - _left_memo: Any | None = ..., - _right_memo: Any | None = ..., + _left_memo: Incomplete | None = ..., + _right_memo: Incomplete | None = ..., _extra_criteria=..., ) -> None: ... - def join(self, right, onclause: Any | None = ..., isouter: bool = ..., full: bool = ..., join_to_left: Any | None = ...): ... - def outerjoin(self, right, onclause: Any | None = ..., full: bool = ..., join_to_left: Any | None = ...): ... + def join( + self, + right, + onclause: Incomplete | None = ..., + isouter: bool = ..., + full: bool = ..., + join_to_left: Incomplete | None = ..., + ): ... + def outerjoin(self, right, onclause: Incomplete | None = ..., full: bool = ..., join_to_left: Incomplete | None = ...): ... -def join(left, right, onclause: Any | None = ..., isouter: bool = ..., full: bool = ..., join_to_left: Any | None = ...): ... -def outerjoin(left, right, onclause: Any | None = ..., full: bool = ..., join_to_left: Any | None = ...): ... -def with_parent(instance, prop, from_entity: Any | None = ...): ... +def join( + left, right, onclause: Incomplete | None = ..., isouter: bool = ..., full: bool = ..., join_to_left: Incomplete | None = ... +): ... +def outerjoin(left, right, onclause: Incomplete | None = ..., full: bool = ..., join_to_left: Incomplete | None = ...): ... +def with_parent(instance, prop, from_entity: Incomplete | None = ...): ... def has_identity(object_): ... def was_deleted(object_): ... def randomize_unitofwork() -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/pool/base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/pool/base.pyi index 9936b2d12..b169e6d8e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/pool/base.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/pool/base.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from .. import log @@ -25,13 +26,13 @@ class Pool(log.Identified): self, creator, recycle: int = ..., - echo: Any | None = ..., - logging_name: Any | None = ..., + echo: Incomplete | None = ..., + logging_name: Incomplete | None = ..., reset_on_return: bool = ..., - events: Any | None = ..., - dialect: Any | None = ..., + events: Incomplete | None = ..., + dialect: Incomplete | None = ..., pre_ping: bool = ..., - _dispatch: Any | None = ..., + _dispatch: Incomplete | None = ..., ) -> None: ... def recreate(self) -> None: ... def dispose(self) -> None: ... @@ -63,7 +64,7 @@ class _ConnectionRecord: @property def last_connect_time(self): ... def close(self) -> None: ... - def invalidate(self, e: Any | None = ..., soft: bool = ...) -> None: ... + def invalidate(self, e: Incomplete | None = ..., soft: bool = ...) -> None: ... def get_connection(self): ... class _ConnectionFairy: @@ -81,8 +82,8 @@ class _ConnectionFairy: def info(self): ... @property def record_info(self): ... - def invalidate(self, e: Any | None = ..., soft: bool = ...) -> None: ... + def invalidate(self, e: Incomplete | None = ..., soft: bool = ...) -> None: ... def cursor(self, *args, **kwargs): ... - def __getattr__(self, key): ... + def __getattr__(self, key: str): ... def detach(self) -> None: ... def close(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/pool/dbapi_proxy.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/pool/dbapi_proxy.pyi index 909b78d85..6bfa8ae86 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/pool/dbapi_proxy.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/pool/dbapi_proxy.pyi @@ -13,7 +13,7 @@ class _DBProxy: def __init__(self, module, poolclass=..., **kw) -> None: ... def close(self) -> None: ... def __del__(self) -> None: ... - def __getattr__(self, key): ... + def __getattr__(self, key: str): ... def get_pool(self, *args, **kw): ... def connect(self, *args, **kw): ... def dispose(self, *args, **kw) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/processors.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/processors.pyi index be304e64e..2c74bf499 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/processors.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/processors.pyi @@ -1,7 +1,7 @@ -from typing import Any +from _typeshed import Incomplete def str_to_datetime_processor_factory(regexp, type_): ... def py_fallback(): ... -def to_unicode_processor_factory(encoding, errors: Any | None = ...): ... -def to_conditional_unicode_processor_factory(encoding, errors: Any | None = ...): ... +def to_unicode_processor_factory(encoding, errors: Incomplete | None = ...): ... +def to_conditional_unicode_processor_factory(encoding, errors: Incomplete | None = ...): ... def to_decimal_processor_factory(target_class, scale): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/annotation.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/annotation.pyi index ead1cc1f6..e631cb48b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/annotation.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/annotation.pyi @@ -10,7 +10,7 @@ class Annotated: __dict__: Any def __init__(self, element, values) -> None: ... def __reduce__(self): ... - def __hash__(self): ... + def __hash__(self) -> int: ... def __eq__(self, other): ... @property def entity_namespace(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/base.pyi index bcfad9f2c..885aac1d0 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/base.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/base.pyi @@ -1,6 +1,7 @@ -from _typeshed import Self +from _typeshed import Incomplete from collections.abc import MutableMapping from typing import Any, ClassVar +from typing_extensions import Self from .. import util from ..util import HasMemoized, hybridmethod, memoized_property @@ -32,12 +33,12 @@ class _DialectArgView(MutableMapping[Any, Any]): def __getitem__(self, key): ... def __setitem__(self, key, value) -> None: ... def __delitem__(self, key) -> None: ... - def __len__(self): ... + def __len__(self) -> int: ... def __iter__(self): ... class _DialectArgDict(MutableMapping[Any, Any]): def __init__(self) -> None: ... - def __len__(self): ... + def __len__(self) -> int: ... def __iter__(self): ... def __getitem__(self, key): ... def __setitem__(self, key, value) -> None: ... @@ -98,8 +99,8 @@ class Executable(roles.StatementRole, Generative): is_text: bool is_delete: bool is_dml: bool - def options(self: Self, *options) -> Self: ... - def execution_options(self: Self, **kw) -> Self: ... + def options(self, *options) -> Self: ... + def execution_options(self, **kw) -> Self: ... def get_execution_options(self): ... def execute(self, *multiparams, **params): ... def scalar(self, *multiparams, **params): ... @@ -115,33 +116,33 @@ class SchemaVisitor(ClauseVisitor): __traverse_options__: Any class ColumnCollection: - def __init__(self, columns: Any | None = ...) -> None: ... + def __init__(self, columns: Incomplete | None = ...) -> None: ... def keys(self): ... def values(self): ... def items(self): ... - def __bool__(self): ... - def __len__(self): ... + def __bool__(self) -> bool: ... + def __len__(self) -> int: ... def __iter__(self): ... def __getitem__(self, key): ... - def __getattr__(self, key): ... + def __getattr__(self, key: str): ... def __contains__(self, key): ... def compare(self, other): ... def __eq__(self, other): ... - def get(self, key, default: Any | None = ...): ... + def get(self, key, default: Incomplete | None = ...): ... def __setitem__(self, key, value) -> None: ... def __delitem__(self, key) -> None: ... - def __setattr__(self, key, obj) -> None: ... + def __setattr__(self, key: str, obj) -> None: ... def clear(self) -> None: ... def remove(self, column) -> None: ... def update(self, iter_) -> None: ... __hash__: ClassVar[None] # type: ignore[assignment] - def add(self, column, key: Any | None = ...) -> None: ... + def add(self, column, key: Incomplete | None = ...) -> None: ... def contains_column(self, col): ... def as_immutable(self): ... def corresponding_column(self, column, require_embedded: bool = ...): ... class DedupeColumnCollection(ColumnCollection): - def add(self, column, key: Any | None = ...) -> None: ... + def add(self, column, key: Incomplete | None = ...) -> None: ... def extend(self, iter_) -> None: ... def remove(self, column) -> None: ... def replace(self, column) -> None: ... @@ -157,4 +158,4 @@ class ColumnSet(util.ordered_column_set[ColumnElement[Any]]): def extend(self, cols) -> None: ... def __add__(self, other): ... def __eq__(self, other): ... - def __hash__(self): ... + def __hash__(self) -> int: ... # type: ignore[override] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/coercions.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/coercions.pyi index 79a24e98d..034252252 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/coercions.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/coercions.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from . import roles @@ -9,7 +10,14 @@ selectable: Any sqltypes: Any traversals: Any -def expect(role, element, apply_propagate_attrs: Any | None = ..., argname: Any | None = ..., post_inspect: bool = ..., **kw): ... +def expect( + role, + element, + apply_propagate_attrs: Incomplete | None = ..., + argname: Incomplete | None = ..., + post_inspect: bool = ..., + **kw, +): ... def expect_as_key(role, element, **kw): ... def expect_col_expression_collection(role, expressions) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/compiler.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/compiler.pyi index f1fb59ff4..44178d7f6 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/compiler.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/compiler.pyi @@ -1,77 +1,83 @@ -from typing import Any, NamedTuple +from _typeshed import Incomplete +from typing import NamedTuple from ..util import memoized_property from . import elements -RESERVED_WORDS: Any -LEGAL_CHARACTERS: Any -LEGAL_CHARACTERS_PLUS_SPACE: Any -ILLEGAL_INITIAL_CHARACTERS: Any -FK_ON_DELETE: Any -FK_ON_UPDATE: Any -FK_INITIALLY: Any -BIND_PARAMS: Any -BIND_PARAMS_ESC: Any -BIND_TEMPLATES: Any -OPERATORS: Any -FUNCTIONS: Any -EXTRACT_MAP: Any -COMPOUND_KEYWORDS: Any +RESERVED_WORDS: Incomplete +LEGAL_CHARACTERS: Incomplete +LEGAL_CHARACTERS_PLUS_SPACE: Incomplete +ILLEGAL_INITIAL_CHARACTERS: Incomplete +FK_ON_DELETE: Incomplete +FK_ON_UPDATE: Incomplete +FK_INITIALLY: Incomplete +BIND_PARAMS: Incomplete +BIND_PARAMS_ESC: Incomplete +BIND_TEMPLATES: Incomplete +OPERATORS: Incomplete +FUNCTIONS: Incomplete +EXTRACT_MAP: Incomplete +COMPOUND_KEYWORDS: Incomplete RM_RENDERED_NAME: int RM_NAME: int RM_OBJECTS: int RM_TYPE: int class ExpandedState(NamedTuple): - statement: Any - additional_parameters: Any - processors: Any - positiontup: Any - parameter_expansion: Any + statement: Incomplete + additional_parameters: Incomplete + processors: Incomplete + positiontup: Incomplete + parameter_expansion: Incomplete -NO_LINTING: Any -COLLECT_CARTESIAN_PRODUCTS: Any -WARN_LINTING: Any -FROM_LINTING: Any +NO_LINTING: Incomplete +COLLECT_CARTESIAN_PRODUCTS: Incomplete +WARN_LINTING: Incomplete +FROM_LINTING: Incomplete class FromLinter: - def lint(self, start: Any | None = ...): ... + def lint(self, start: Incomplete | None = ...): ... def warn(self) -> None: ... class Compiled: - schema_translate_map: Any - execution_options: Any - compile_state: Any - cache_key: Any - dialect: Any - preparer: Any - statement: Any - can_execute: Any - string: Any + schema_translate_map: Incomplete + execution_options: Incomplete + compile_state: Incomplete + cache_key: Incomplete + dialect: Incomplete + preparer: Incomplete + statement: Incomplete + can_execute: Incomplete + string: Incomplete def __init__( - self, dialect, statement, schema_translate_map: Any | None = ..., render_schema_translate: bool = ..., compile_kwargs=... + self, + dialect, + statement, + schema_translate_map: Incomplete | None = ..., + render_schema_translate: bool = ..., + compile_kwargs=..., ) -> None: ... def visit_unsupported_compilation(self, element, err) -> None: ... @property def sql_compiler(self) -> None: ... def process(self, obj, **kwargs): ... def construct_params( - self, params: Any | None = ..., extracted_parameters: Any | None = ..., escape_names: bool = ... + self, params: Incomplete | None = ..., extracted_parameters: Incomplete | None = ..., escape_names: bool = ... ) -> None: ... @property def params(self): ... class TypeCompiler: ensure_kwarg: str - dialect: Any + dialect: Incomplete def __init__(self, dialect) -> None: ... def process(self, type_, **kw): ... def visit_unsupported_compilation(self, element, err, **kw) -> None: ... -class _CompileLabel(elements.ColumnElement[Any]): +class _CompileLabel(elements.ColumnElement[Incomplete]): __visit_name__: str - element: Any - name: Any + element: Incomplete + name: Incomplete def __init__(self, col, name, alt_names=...) -> None: ... @property def proxy_set(self): ... @@ -80,45 +86,45 @@ class _CompileLabel(elements.ColumnElement[Any]): def self_group(self, **kw): ... class SQLCompiler(Compiled): - extract_map: Any - compound_keywords: Any + extract_map: Incomplete + compound_keywords: Incomplete isdelete: bool isinsert: bool isupdate: bool isplaintext: bool - returning: Any + returning: Incomplete returning_precedes_values: bool render_table_with_column_in_update_from: bool ansi_bind_rules: bool - insert_single_values_expr: Any - literal_execute_params: Any - post_compile_params: Any - escaped_bind_names: Any + insert_single_values_expr: Incomplete + literal_execute_params: Incomplete + post_compile_params: Incomplete + escaped_bind_names: Incomplete has_out_parameters: bool - insert_prefetch: Any - update_prefetch: Any + insert_prefetch: Incomplete + update_prefetch: Incomplete postfetch_lastrowid: bool - positiontup: Any + positiontup: Incomplete inline: bool - column_keys: Any - cache_key: Any - for_executemany: Any - linting: Any - binds: Any - bind_names: Any - stack: Any - positional: Any - bindtemplate: Any - ctes: Any - label_length: Any - anon_map: Any - truncated_names: Any + column_keys: Incomplete + cache_key: Incomplete + for_executemany: Incomplete + linting: Incomplete + binds: Incomplete + bind_names: Incomplete + stack: Incomplete + positional: Incomplete + bindtemplate: Incomplete + ctes: Incomplete + label_length: Incomplete + anon_map: Incomplete + truncated_names: Incomplete def __init__( self, dialect, statement, - cache_key: Any | None = ..., - column_keys: Any | None = ..., + cache_key: Incomplete | None = ..., + column_keys: Incomplete | None = ..., for_executemany: bool = ..., linting=..., **kwargs, @@ -130,7 +136,7 @@ class SQLCompiler(Compiled): def is_subquery(self): ... @property def sql_compiler(self): ... - def construct_params(self, params: Any | None = ..., _group_number: Any | None = ..., _check: bool = ..., extracted_parameters: Any | None = ..., escape_names: bool = ...): ... # type: ignore[override] + def construct_params(self, params: Incomplete | None = ..., _group_number: Incomplete | None = ..., _check: bool = ..., extracted_parameters: Incomplete | None = ..., escape_names: bool = ...): ... # type: ignore[override] @property def params(self): ... def default_from(self): ... @@ -141,16 +147,16 @@ class SQLCompiler(Compiled): def visit_label( self, label, - add_to_result_map: Any | None = ..., + add_to_result_map: Incomplete | None = ..., within_label_clause: bool = ..., within_columns_clause: bool = ..., - render_label_as_label: Any | None = ..., + render_label_as_label: Incomplete | None = ..., result_map_targets=..., **kw, ): ... def visit_lambda_element(self, element, **kw): ... def visit_column( - self, column, add_to_result_map: Any | None = ..., include_table: bool = ..., result_map_targets=..., **kwargs + self, column, add_to_result_map: Incomplete | None = ..., include_table: bool = ..., result_map_targets=..., **kwargs ): ... def visit_collation(self, element, **kw): ... def visit_fromclause(self, fromclause, **kwargs): ... @@ -158,8 +164,8 @@ class SQLCompiler(Compiled): def visit_typeclause(self, typeclause, **kw): ... def post_process_text(self, text): ... def escape_literal_column(self, text): ... - def visit_textclause(self, textclause, add_to_result_map: Any | None = ..., **kw): ... - def visit_textual_select(self, taf, compound_index: Any | None = ..., asfrom: bool = ..., **kw): ... + def visit_textclause(self, textclause, add_to_result_map: Incomplete | None = ..., **kw): ... + def visit_textual_select(self, taf, compound_index: Incomplete | None = ..., asfrom: bool = ..., **kw): ... def visit_null(self, expr, **kw): ... def visit_true(self, expr, **kw): ... def visit_false(self, expr, **kw): ... @@ -173,13 +179,13 @@ class SQLCompiler(Compiled): def visit_funcfilter(self, funcfilter, **kwargs): ... def visit_extract(self, extract, **kwargs): ... def visit_scalar_function_column(self, element, **kw): ... - def visit_function(self, func, add_to_result_map: Any | None = ..., **kwargs): ... + def visit_function(self, func, add_to_result_map: Incomplete | None = ..., **kwargs): ... def visit_next_value_func(self, next_value, **kw): ... def visit_sequence(self, sequence, **kw) -> None: ... def function_argspec(self, func, **kwargs): ... - compile_state: Any - def visit_compound_select(self, cs, asfrom: bool = ..., compound_index: Any | None = ..., **kwargs): ... - def visit_unary(self, unary, add_to_result_map: Any | None = ..., result_map_targets=..., **kw): ... + compile_state: Incomplete + def visit_compound_select(self, cs, asfrom: bool = ..., compound_index: Incomplete | None = ..., **kwargs): ... + def visit_unary(self, unary, add_to_result_map: Incomplete | None = ..., result_map_targets=..., **kw): ... def visit_is_true_unary_operator(self, element, operator, **kw): ... def visit_is_false_unary_operator(self, element, operator, **kw): ... def visit_not_match_op_binary(self, binary, operator, **kw): ... @@ -189,10 +195,10 @@ class SQLCompiler(Compiled): def visit_binary( self, binary, - override_operator: Any | None = ..., + override_operator: Incomplete | None = ..., eager_grouping: bool = ..., - from_linter: Any | None = ..., - lateral_from_linter: Any | None = ..., + from_linter: Incomplete | None = ..., + lateral_from_linter: Incomplete | None = ..., **kw, ): ... def visit_function_as_comparison_op_binary(self, element, operator, **kw): ... @@ -225,27 +231,29 @@ class SQLCompiler(Compiled): render_postcompile: bool = ..., **kwargs, ): ... - def render_literal_bindparam(self, bindparam, render_literal_value=..., **kw): ... + def render_literal_bindparam( + self, bindparam, render_literal_value=..., bind_expression_template: Incomplete | None = ..., **kw + ): ... def render_literal_value(self, value, type_): ... def bindparam_string( self, name, - positional_names: Any | None = ..., + positional_names: Incomplete | None = ..., post_compile: bool = ..., expanding: bool = ..., - escaped_from: Any | None = ..., + escaped_from: Incomplete | None = ..., **kw, ): ... - execution_options: Any + execution_options: Incomplete ctes_recursive: bool def visit_cte( self, cte, asfrom: bool = ..., ashint: bool = ..., - fromhints: Any | None = ..., - visiting_cte: Any | None = ..., - from_linter: Any | None = ..., + fromhints: Incomplete | None = ..., + visiting_cte: Incomplete | None = ..., + from_linter: Incomplete | None = ..., **kwargs, ): ... def visit_table_valued_alias(self, element, **kw): ... @@ -256,34 +264,34 @@ class SQLCompiler(Compiled): asfrom: bool = ..., ashint: bool = ..., iscrud: bool = ..., - fromhints: Any | None = ..., + fromhints: Incomplete | None = ..., subquery: bool = ..., lateral: bool = ..., - enclosing_alias: Any | None = ..., - from_linter: Any | None = ..., + enclosing_alias: Incomplete | None = ..., + from_linter: Incomplete | None = ..., **kwargs, ): ... def visit_subquery(self, subquery, **kw): ... def visit_lateral(self, lateral_, **kw): ... def visit_tablesample(self, tablesample, asfrom: bool = ..., **kw): ... - def visit_values(self, element, asfrom: bool = ..., from_linter: Any | None = ..., **kw): ... + def visit_values(self, element, asfrom: bool = ..., from_linter: Incomplete | None = ..., **kw): ... def get_render_as_alias_suffix(self, alias_name_text): ... def format_from_hint_text(self, sqltext, table, hint, iscrud): ... def get_select_hint_text(self, byfroms) -> None: ... def get_from_hint_text(self, table, text) -> None: ... def get_crud_hint_text(self, table, text) -> None: ... def get_statement_hint_text(self, hint_texts): ... - translate_select_structure: Any + translate_select_structure: Incomplete def visit_select( self, select_stmt, asfrom: bool = ..., insert_into: bool = ..., - fromhints: Any | None = ..., - compound_index: Any | None = ..., - select_wraps_for: Any | None = ..., + fromhints: Incomplete | None = ..., + compound_index: Incomplete | None = ..., + select_wraps_for: Incomplete | None = ..., lateral: bool = ..., - from_linter: Any | None = ..., + from_linter: Incomplete | None = ..., **kwargs, ): ... def get_cte_preamble(self, recursive): ... @@ -300,12 +308,12 @@ class SQLCompiler(Compiled): asfrom: bool = ..., iscrud: bool = ..., ashint: bool = ..., - fromhints: Any | None = ..., + fromhints: Incomplete | None = ..., use_schema: bool = ..., - from_linter: Any | None = ..., + from_linter: Incomplete | None = ..., **kwargs, ): ... - def visit_join(self, join, asfrom: bool = ..., from_linter: Any | None = ..., **kwargs): ... + def visit_join(self, join, asfrom: bool = ..., from_linter: Incomplete | None = ..., **kwargs): ... def visit_insert(self, insert_stmt, **kw): ... def update_limit_clause(self, update_stmt) -> None: ... def update_tables_clause(self, update_stmt, from_table, extra_froms, **kw): ... @@ -339,14 +347,14 @@ class DDLCompiler(Compiled): @memoized_property def type_compiler(self): ... def construct_params( - self, params: Any | None = ..., extracted_parameters: Any | None = ..., escape_names: bool = ... + self, params: Incomplete | None = ..., extracted_parameters: Incomplete | None = ..., escape_names: bool = ... ) -> None: ... def visit_ddl(self, ddl, **kwargs): ... def visit_create_schema(self, create, **kw): ... def visit_drop_schema(self, drop, **kw): ... def visit_create_table(self, create, **kw): ... def visit_create_column(self, create, first_pk: bool = ..., **kw): ... - def create_table_constraints(self, table, _include_foreign_key_constraints: Any | None = ..., **kw): ... + def create_table_constraints(self, table, _include_foreign_key_constraints: Incomplete | None = ..., **kw): ... def visit_drop_table(self, drop, **kw): ... def visit_drop_view(self, drop, **kw): ... def visit_create_index(self, create, include_schema: bool = ..., include_table_schema: bool = ..., **kw): ... @@ -357,7 +365,7 @@ class DDLCompiler(Compiled): def visit_set_column_comment(self, create, **kw): ... def visit_drop_column_comment(self, drop, **kw): ... def get_identity_options(self, identity_options): ... - def visit_create_sequence(self, create, prefix: Any | None = ..., **kw): ... + def visit_create_sequence(self, create, prefix: Incomplete | None = ..., **kw): ... def visit_drop_sequence(self, drop, **kw): ... def visit_drop_constraint(self, drop, **kw): ... def get_column_specification(self, column, **kwargs): ... @@ -422,55 +430,55 @@ class GenericTypeCompiler(TypeCompiler): class StrSQLTypeCompiler(GenericTypeCompiler): def process(self, type_, **kw): ... - def __getattr__(self, key): ... + def __getattr__(self, key: str): ... def visit_null(self, type_, **kw): ... def visit_user_defined(self, type_, **kw): ... class IdentifierPreparer: - reserved_words: Any - legal_characters: Any - illegal_initial_characters: Any - schema_for_object: Any - dialect: Any - initial_quote: Any - final_quote: Any - escape_quote: Any - escape_to_quote: Any - omit_schema: Any - quote_case_sensitive_collations: Any + reserved_words: Incomplete + legal_characters: Incomplete + illegal_initial_characters: Incomplete + schema_for_object: Incomplete + dialect: Incomplete + initial_quote: Incomplete + final_quote: Incomplete + escape_quote: Incomplete + escape_to_quote: Incomplete + omit_schema: Incomplete + quote_case_sensitive_collations: Incomplete def __init__( self, dialect, initial_quote: str = ..., - final_quote: Any | None = ..., + final_quote: Incomplete | None = ..., escape_quote: str = ..., quote_case_sensitive_collations: bool = ..., omit_schema: bool = ..., ) -> None: ... def validate_sql_phrase(self, element, reg): ... def quote_identifier(self, value): ... - def quote_schema(self, schema, force: Any | None = ...): ... - def quote(self, ident, force: Any | None = ...): ... + def quote_schema(self, schema, force: Incomplete | None = ...): ... + def quote(self, ident, force: Incomplete | None = ...): ... def format_collation(self, collation_name): ... def format_sequence(self, sequence, use_schema: bool = ...): ... - def format_label(self, label, name: Any | None = ...): ... - def format_alias(self, alias, name: Any | None = ...): ... - def format_savepoint(self, savepoint, name: Any | None = ...): ... + def format_label(self, label, name: Incomplete | None = ...): ... + def format_alias(self, alias, name: Incomplete | None = ...): ... + def format_savepoint(self, savepoint, name: Incomplete | None = ...): ... def format_constraint(self, constraint, _alembic_quote: bool = ...): ... def truncate_and_render_index_name(self, name, _alembic_quote: bool = ...): ... def truncate_and_render_constraint_name(self, name, _alembic_quote: bool = ...): ... def format_index(self, index): ... - def format_table(self, table, use_schema: bool = ..., name: Any | None = ...): ... + def format_table(self, table, use_schema: bool = ..., name: Incomplete | None = ...): ... def format_schema(self, name): ... - def format_label_name(self, name, anon_map: Any | None = ...): ... + def format_label_name(self, name, anon_map: Incomplete | None = ...): ... def format_column( self, column, use_table: bool = ..., - name: Any | None = ..., - table_name: Any | None = ..., + name: Incomplete | None = ..., + table_name: Incomplete | None = ..., use_schema: bool = ..., - anon_map: Any | None = ..., + anon_map: Incomplete | None = ..., ): ... def format_table_seq(self, table, use_schema: bool = ...): ... def unformat_identifiers(self, identifiers): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/ddl.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/ddl.pyi index 4dba7ea2b..5d34ce026 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/ddl.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/ddl.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from . import roles @@ -11,10 +12,12 @@ class DDLElement(roles.DDLRole, Executable, _DDLCompiles): on: Any dialect: Any callable_: Any - def execute(self, bind: Any | None = ..., target: Any | None = ...): ... # type: ignore[override] + def execute(self, bind: Incomplete | None = ..., target: Incomplete | None = ...): ... # type: ignore[override] def against(self, target) -> None: ... state: Any - def execute_if(self, dialect: Any | None = ..., callable_: Any | None = ..., state: Any | None = ...) -> None: ... + def execute_if( + self, dialect: Incomplete | None = ..., callable_: Incomplete | None = ..., state: Incomplete | None = ... + ) -> None: ... def __call__(self, target, bind, **kw): ... bind: Any @@ -22,7 +25,7 @@ class DDL(DDLElement): __visit_name__: str statement: Any context: Any - def __init__(self, statement, context: Any | None = ..., bind: Any | None = ...) -> None: ... + def __init__(self, statement, context: Incomplete | None = ..., bind: Incomplete | None = ...) -> None: ... class _CreateDropBase(DDLElement): element: Any @@ -30,7 +33,12 @@ class _CreateDropBase(DDLElement): if_exists: Any if_not_exists: Any def __init__( - self, element, bind: Any | None = ..., if_exists: bool = ..., if_not_exists: bool = ..., _legacy_bind: Any | None = ... + self, + element, + bind: Incomplete | None = ..., + if_exists: bool = ..., + if_not_exists: bool = ..., + _legacy_bind: Incomplete | None = ..., ) -> None: ... @property def stringify_dialect(self): ... @@ -38,20 +46,24 @@ class _CreateDropBase(DDLElement): class CreateSchema(_CreateDropBase): __visit_name__: str quote: Any - def __init__(self, name, quote: Any | None = ..., **kw) -> None: ... + def __init__(self, name, quote: Incomplete | None = ..., **kw) -> None: ... class DropSchema(_CreateDropBase): __visit_name__: str quote: Any cascade: Any - def __init__(self, name, quote: Any | None = ..., cascade: bool = ..., **kw) -> None: ... + def __init__(self, name, quote: Incomplete | None = ..., cascade: bool = ..., **kw) -> None: ... class CreateTable(_CreateDropBase): __visit_name__: str columns: Any include_foreign_key_constraints: Any def __init__( - self, element, bind: Any | None = ..., include_foreign_key_constraints: Any | None = ..., if_not_exists: bool = ... + self, + element, + bind: Incomplete | None = ..., + include_foreign_key_constraints: Incomplete | None = ..., + if_not_exists: bool = ..., ) -> None: ... class _DropView(_CreateDropBase): @@ -64,7 +76,7 @@ class CreateColumn(_DDLCompiles): class DropTable(_CreateDropBase): __visit_name__: str - def __init__(self, element, bind: Any | None = ..., if_exists: bool = ...) -> None: ... + def __init__(self, element, bind: Incomplete | None = ..., if_exists: bool = ...) -> None: ... class CreateSequence(_CreateDropBase): __visit_name__: str @@ -74,11 +86,11 @@ class DropSequence(_CreateDropBase): class CreateIndex(_CreateDropBase): __visit_name__: str - def __init__(self, element, bind: Any | None = ..., if_not_exists: bool = ...) -> None: ... + def __init__(self, element, bind: Incomplete | None = ..., if_not_exists: bool = ...) -> None: ... class DropIndex(_CreateDropBase): __visit_name__: str - def __init__(self, element, bind: Any | None = ..., if_exists: bool = ...) -> None: ... + def __init__(self, element, bind: Incomplete | None = ..., if_exists: bool = ...) -> None: ... class AddConstraint(_CreateDropBase): __visit_name__: str @@ -111,10 +123,14 @@ class SchemaGenerator(DDLBase): preparer: Any dialect: Any memo: Any - def __init__(self, dialect, connection, checkfirst: bool = ..., tables: Any | None = ..., **kwargs) -> None: ... + def __init__(self, dialect, connection, checkfirst: bool = ..., tables: Incomplete | None = ..., **kwargs) -> None: ... def visit_metadata(self, metadata) -> None: ... def visit_table( - self, table, create_ok: bool = ..., include_foreign_key_constraints: Any | None = ..., _is_metadata_operation: bool = ... + self, + table, + create_ok: bool = ..., + include_foreign_key_constraints: Incomplete | None = ..., + _is_metadata_operation: bool = ..., ) -> None: ... def visit_foreign_key_constraint(self, constraint) -> None: ... def visit_sequence(self, sequence, create_ok: bool = ...) -> None: ... @@ -126,14 +142,14 @@ class SchemaDropper(DDLBase): preparer: Any dialect: Any memo: Any - def __init__(self, dialect, connection, checkfirst: bool = ..., tables: Any | None = ..., **kwargs) -> None: ... + def __init__(self, dialect, connection, checkfirst: bool = ..., tables: Incomplete | None = ..., **kwargs) -> None: ... def visit_metadata(self, metadata): ... def visit_index(self, index, drop_ok: bool = ...) -> None: ... def visit_table(self, table, drop_ok: bool = ..., _is_metadata_operation: bool = ..., _ignore_sequences=...) -> None: ... def visit_foreign_key_constraint(self, constraint) -> None: ... def visit_sequence(self, sequence, drop_ok: bool = ...) -> None: ... -def sort_tables(tables, skip_fn: Any | None = ..., extra_dependencies: Any | None = ...): ... +def sort_tables(tables, skip_fn: Incomplete | None = ..., extra_dependencies: Incomplete | None = ...): ... def sort_tables_and_constraints( - tables, filter_fn: Any | None = ..., extra_dependencies: Any | None = ..., _warn_for_cycles: bool = ... + tables, filter_fn: Incomplete | None = ..., extra_dependencies: Incomplete | None = ..., _warn_for_cycles: bool = ... ): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/dml.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/dml.pyi index ee31b2343..8dbc7c04b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/dml.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/dml.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from . import roles @@ -41,7 +42,7 @@ class UpdateBase(roles.DMLRole, HasCTE, HasCompileState, DialectKWArgs, HasPrefi def returning(self, *cols) -> None: ... @property def exported_columns(self): ... - def with_hint(self, text, selectable: Any | None = ..., dialect_name: str = ...) -> None: ... + def with_hint(self, text, selectable: Incomplete | None = ..., dialect_name: str = ...) -> None: ... class ValuesBase(UpdateBase): __visit_name__: str @@ -59,11 +60,11 @@ class Insert(ValuesBase): def __init__( self, table, - values: Any | None = ..., + values: Incomplete | None = ..., inline: bool = ..., - bind: Any | None = ..., - prefixes: Any | None = ..., - returning: Any | None = ..., + bind: Incomplete | None = ..., + prefixes: Incomplete | None = ..., + returning: Incomplete | None = ..., return_defaults: bool = ..., **dialect_kw, ) -> None: ... @@ -83,12 +84,12 @@ class Update(DMLWhereBase, ValuesBase): def __init__( self, table, - whereclause: Any | None = ..., - values: Any | None = ..., + whereclause: Incomplete | None = ..., + values: Incomplete | None = ..., inline: bool = ..., - bind: Any | None = ..., - prefixes: Any | None = ..., - returning: Any | None = ..., + bind: Incomplete | None = ..., + prefixes: Incomplete | None = ..., + returning: Incomplete | None = ..., return_defaults: bool = ..., preserve_parameter_order: bool = ..., **dialect_kw, @@ -103,9 +104,9 @@ class Delete(DMLWhereBase, UpdateBase): def __init__( self, table, - whereclause: Any | None = ..., - bind: Any | None = ..., - returning: Any | None = ..., - prefixes: Any | None = ..., + whereclause: Incomplete | None = ..., + bind: Incomplete | None = ..., + returning: Incomplete | None = ..., + prefixes: Incomplete | None = ..., **dialect_kw, ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/elements.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/elements.pyi index 4d3f85442..93c53c0c5 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/elements.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/elements.pyi @@ -1,5 +1,6 @@ +from _typeshed import Incomplete from typing import Any, Generic, TypeVar -from typing_extensions import Literal +from typing_extensions import Literal, Self from .. import util from ..util import HasMemoized, memoized_property @@ -13,8 +14,8 @@ _T = TypeVar("_T") def collate(expression, collation): ... def between(expr, lower_bound, upper_bound, symmetric: bool = ...): ... -def literal(value, type_: Any | None = ...): ... -def outparam(key, type_: Any | None = ...): ... +def literal(value, type_: Incomplete | None = ...): ... +def outparam(key, type_: Incomplete | None = ...): ... def not_(clause): ... class ClauseElement(roles.SQLRole, SupportsWrappingAnnotations, MemoizedHasCacheKey, HasCopyInternals, Traversible): @@ -30,11 +31,11 @@ class ClauseElement(roles.SQLRole, SupportsWrappingAnnotations, MemoizedHasCache def unique_params(self, *optionaldict, **kwargs): ... def params(self, *optionaldict, **kwargs): ... def compare(self, other, **kw): ... - def self_group(self, against: Any | None = ...): ... - def compile(self, bind: Any | None = ..., dialect: Any | None = ..., **kw): ... + def self_group(self, against: Incomplete | None = ...): ... + def compile(self, bind: Incomplete | None = ..., dialect: Incomplete | None = ..., **kw): ... def __invert__(self): ... - def __bool__(self) -> None: ... - __nonzero__: Any + def __bool__(self) -> bool: ... + def __nonzero__(self) -> bool: ... class ColumnElement( roles.ColumnArgumentOrKeyRole, @@ -55,12 +56,12 @@ class ColumnElement( primary_key: bool foreign_keys: Any key: Any - def self_group(self, against: Any | None = ...): ... + def self_group(self, against: Incomplete | None = ...): ... @memoized_property def type(self): ... @HasMemoized.memoized_attribute def comparator(self): ... - def __getattr__(self, key): ... + def __getattr__(self, key: str): ... def operate(self, op, *other, **kwargs): ... def reverse_operate(self, op, other, **kwargs): ... @property @@ -98,16 +99,16 @@ class BindParameter(roles.InElementRole, ColumnElement[_T], Generic[_T]): self, key, value=..., - type_: Any | None = ..., + type_: Incomplete | None = ..., unique: bool = ..., required=..., - quote: Any | None = ..., - callable_: Any | None = ..., + quote: Incomplete | None = ..., + callable_: Incomplete | None = ..., expanding: bool = ..., isoutparam: bool = ..., literal_execute: bool = ..., - _compared_to_operator: Any | None = ..., - _compared_to_type: Any | None = ..., + _compared_to_operator: Incomplete | None = ..., + _compared_to_type: Incomplete | None = ..., _is_crud: bool = ..., ) -> None: ... @property @@ -136,14 +137,14 @@ class TextClause( def __and__(self, other): ... key: Any text: Any - def __init__(self, text, bind: Any | None = ...): ... - def bindparams(self, *binds, **names_to_values) -> None: ... + def __init__(self, text: str, bind: Incomplete | None = None) -> None: ... + def bindparams(self, *binds, **names_to_values) -> Self: ... def columns(self, *cols, **types): ... @property def type(self): ... @property def comparator(self): ... - def self_group(self, against: Any | None = ...): ... + def self_group(self, against: Incomplete | None = ...): ... class Null(SingletonConstant, roles.ConstExprRole, ColumnElement[None]): __visit_name__: str @@ -168,9 +169,9 @@ class ClauseList(roles.InElementRole, roles.OrderByRole, roles.ColumnsClauseRole clauses: Any def __init__(self, *clauses, **kwargs) -> None: ... def __iter__(self): ... - def __len__(self): ... + def __len__(self) -> int: ... def append(self, clause) -> None: ... - def self_group(self, against: Any | None = ...): ... + def self_group(self, against: Incomplete | None = ...): ... class BooleanClauseList(ClauseList, ColumnElement[Any]): __visit_name__: str @@ -180,7 +181,7 @@ class BooleanClauseList(ClauseList, ColumnElement[Any]): def and_(cls, *clauses): ... @classmethod def or_(cls, *clauses): ... - def self_group(self, against: Any | None = ...): ... + def self_group(self, against: Incomplete | None = ...): ... and_: Any or_: Any @@ -189,7 +190,7 @@ class Tuple(ClauseList, ColumnElement[Any]): __visit_name__: str type: Any def __init__(self, *clauses, **kw) -> None: ... - def self_group(self, against: Any | None = ...): ... + def self_group(self, against: Incomplete | None = ...): ... class Case(ColumnElement[Any]): __visit_name__: str @@ -199,7 +200,7 @@ class Case(ColumnElement[Any]): else_: Any def __init__(self, *whens, **kw) -> None: ... -def literal_column(text, type_: Any | None = ...): ... +def literal_column(text, type_: Incomplete | None = ...): ... class Cast(WrapsColumnExpression, ColumnElement[Any]): __visit_name__: str @@ -219,7 +220,7 @@ class TypeCoerce(WrapsColumnExpression, ColumnElement[Any]): def typed_expression(self): ... @property def wrapped_column_expression(self): ... - def self_group(self, against: Any | None = ...): ... + def self_group(self, against: Incomplete | None = ...): ... class Extract(ColumnElement[Any]): __visit_name__: str @@ -248,12 +249,12 @@ class UnaryExpression(ColumnElement[Any]): def __init__( self, element, - operator: Any | None = ..., - modifier: Any | None = ..., - type_: Any | None = ..., + operator: Incomplete | None = ..., + modifier: Incomplete | None = ..., + type_: Incomplete | None = ..., wraps_column_expression: bool = ..., ) -> None: ... - def self_group(self, against: Any | None = ...): ... + def self_group(self, against: Incomplete | None = ...): ... class CollectionAggregate(UnaryExpression): inherit_cache: bool @@ -271,7 +272,7 @@ class AsBoolean(WrapsColumnExpression, UnaryExpression): def __init__(self, element, operator, negate) -> None: ... @property def wrapped_column_expression(self): ... - def self_group(self, against: Any | None = ...): ... + def self_group(self, against: Incomplete | None = ...): ... class BinaryExpression(ColumnElement[Any]): __visit_name__: str @@ -282,13 +283,19 @@ class BinaryExpression(ColumnElement[Any]): negate: Any modifiers: Any def __init__( - self, left, right, operator, type_: Any | None = ..., negate: Any | None = ..., modifiers: Any | None = ... + self, + left, + right, + operator, + type_: Incomplete | None = ..., + negate: Incomplete | None = ..., + modifiers: Incomplete | None = ..., ) -> None: ... - def __bool__(self): ... - __nonzero__: Any + def __bool__(self) -> bool: ... + def __nonzero__(self) -> bool: ... @property def is_comparison(self): ... - def self_group(self, against: Any | None = ...): ... + def self_group(self, against: Incomplete | None = ...): ... class Slice(ColumnElement[Any]): __visit_name__: str @@ -296,21 +303,21 @@ class Slice(ColumnElement[Any]): stop: Any step: Any type: Any - def __init__(self, start, stop, step, _name: Any | None = ...) -> None: ... - def self_group(self, against: Any | None = ...): ... + def __init__(self, start, stop, step, _name: Incomplete | None = ...) -> None: ... + def self_group(self, against: Incomplete | None = ...): ... class IndexExpression(BinaryExpression): inherit_cache: bool class GroupedElement(ClauseElement): __visit_name__: str - def self_group(self, against: Any | None = ...): ... + def self_group(self, against: Incomplete | None = ...): ... class Grouping(GroupedElement, ColumnElement[Any]): element: Any type: Any def __init__(self, element) -> None: ... - def __getattr__(self, attr): ... + def __getattr__(self, attr: str): ... RANGE_UNBOUNDED: Any RANGE_CURRENT: Any @@ -325,10 +332,10 @@ class Over(ColumnElement[Any]): def __init__( self, element, - partition_by: Any | None = ..., - order_by: Any | None = ..., - range_: Any | None = ..., - rows: Any | None = ..., + partition_by: Incomplete | None = ..., + order_by: Incomplete | None = ..., + range_: Incomplete | None = ..., + rows: Incomplete | None = ..., ) -> None: ... def __reduce__(self): ... @memoized_property @@ -341,7 +348,11 @@ class WithinGroup(ColumnElement[Any]): def __init__(self, element, *order_by) -> None: ... def __reduce__(self): ... def over( - self, partition_by: Any | None = ..., order_by: Any | None = ..., range_: Any | None = ..., rows: Any | None = ... + self, + partition_by: Incomplete | None = ..., + order_by: Incomplete | None = ..., + range_: Incomplete | None = ..., + rows: Incomplete | None = ..., ): ... @memoized_property def type(self): ... @@ -353,9 +364,13 @@ class FunctionFilter(ColumnElement[Any]): def __init__(self, func, *criterion) -> None: ... def filter(self, *criterion): ... def over( - self, partition_by: Any | None = ..., order_by: Any | None = ..., range_: Any | None = ..., rows: Any | None = ... + self, + partition_by: Incomplete | None = ..., + order_by: Incomplete | None = ..., + range_: Incomplete | None = ..., + rows: Incomplete | None = ..., ): ... - def self_group(self, against: Any | None = ...): ... + def self_group(self, against: Incomplete | None = ...): ... @memoized_property def type(self): ... @@ -363,13 +378,13 @@ class Label(roles.LabeledColumnExprRole, ColumnElement[Any]): __visit_name__: str name: Any key: Any - def __init__(self, name, element, type_: Any | None = ...) -> None: ... + def __init__(self, name, element, type_: Incomplete | None = ...) -> None: ... def __reduce__(self): ... @memoized_property def type(self): ... @HasMemoized.memoized_attribute def element(self): ... - def self_group(self, against: Any | None = ...): ... + def self_group(self, against: Incomplete | None = ...): ... @property def primary_key(self): ... @property @@ -391,7 +406,9 @@ class ColumnClause(roles.DDLReferredColumnRole, roles.LabeledColumnExprRole, rol server_onupdate: Any key: Any type: Any - def __init__(self, text, type_: Any | None = ..., is_literal: bool = ..., _selectable: Any | None = ...) -> None: ... + def __init__( + self, text, type_: Incomplete | None = ..., is_literal: bool = ..., _selectable: Incomplete | None = ... + ) -> None: ... def get_children(self, column_tables: bool = ..., **kw): ... # type: ignore[override] @property def entity_namespace(self): ... @@ -442,7 +459,7 @@ class AnnotatedColumnElement(Annotated): def info(self): ... class _truncated_label(quoted_name): - def __new__(cls, value, quote: Any | None = ...): ... + def __new__(cls, value, quote: Incomplete | None = ...): ... def __reduce__(self): ... def apply_map(self, map_): ... @@ -450,7 +467,7 @@ class conv(_truncated_label): ... class _anonymous_label(_truncated_label): @classmethod - def safe_construct(cls, seed, body, enclosing_label: Any | None = ..., sanitize_key: bool = ...): ... + def safe_construct(cls, seed, body, enclosing_label: Incomplete | None = ..., sanitize_key: bool = ...): ... def __add__(self, other): ... def __radd__(self, other): ... def apply_map(self, map_): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/expression.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/expression.pyi index 79df689ce..44ca4b6ed 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/expression.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/expression.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete from .base import PARSE_AUTOCOMMIT as PARSE_AUTOCOMMIT, ColumnCollection as ColumnCollection, Executable as Executable from .dml import Delete as Delete, Insert as Insert, Update as Update, UpdateBase as UpdateBase, ValuesBase as ValuesBase @@ -154,48 +154,50 @@ __all__ = [ "values", ] -all_: Any -any_: Any -and_: Any -alias: Any -tablesample: Any -lateral: Any -or_: Any -bindparam: Any -select: Any -text: Any -table: Any -column: Any -over: Any -within_group: Any -label: Any -case: Any -cast: Any -cte: Any -values: Any -extract: Any -tuple_: Any -except_: Any -except_all: Any -intersect: Any -intersect_all: Any -union: Any -union_all: Any -exists: Any -nulls_first: Any -nullsfirst: Any -nulls_last: Any -nullslast: Any -asc: Any -desc: Any -distinct: Any -type_coerce: Any -true: Any -false: Any -null: Any -join: Any -outerjoin: Any -insert: Any -update: Any -delete: Any -funcfilter: Any +all_: Incomplete +any_: Incomplete +and_: Incomplete +alias: Incomplete +tablesample: Incomplete +lateral: Incomplete +or_: Incomplete +bindparam: Incomplete +select: Incomplete + +def text(text: str, bind: Incomplete | None = None) -> TextClause: ... + +table: Incomplete +column: Incomplete +over: Incomplete +within_group: Incomplete +label: Incomplete +case: Incomplete +cast: Incomplete +cte: Incomplete +values: Incomplete +extract: Incomplete +tuple_: Incomplete +except_: Incomplete +except_all: Incomplete +intersect: Incomplete +intersect_all: Incomplete +union: Incomplete +union_all: Incomplete +exists: Incomplete +nulls_first: Incomplete +nullsfirst: Incomplete +nulls_last: Incomplete +nullslast: Incomplete +asc: Incomplete +desc: Incomplete +distinct: Incomplete +type_coerce: Incomplete +true: Incomplete +false: Incomplete +null: Incomplete +join: Incomplete +outerjoin: Incomplete +insert: Incomplete +update: Incomplete +delete: Incomplete +funcfilter: Incomplete diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/functions.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/functions.pyi index 76058ff32..c1a0d1ec4 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/functions.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/functions.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from ..util import HasMemoized @@ -9,12 +10,12 @@ from .visitors import TraversibleType def register_function(identifier, fn, package: str = ...) -> None: ... class FunctionElement(Executable, ColumnElement[Any], FromClause, Generative): # type: ignore[misc] - packagenames: Any - clause_expr: Any + packagenames: Incomplete + clause_expr: Incomplete def __init__(self, *clauses, **kwargs) -> None: ... - def scalar_table_valued(self, name, type_: Any | None = ...): ... + def scalar_table_valued(self, name, type_: Incomplete | None = ...): ... def table_valued(self, *expr, **kw): ... - def column_valued(self, name: Any | None = ...): ... + def column_valued(self, name: str | None = ..., joins_implicitly: bool = ...): ... @property def columns(self): ... @property @@ -22,7 +23,11 @@ class FunctionElement(Executable, ColumnElement[Any], FromClause, Generative): @HasMemoized.memoized_attribute def clauses(self): ... def over( - self, partition_by: Any | None = ..., order_by: Any | None = ..., rows: Any | None = ..., range_: Any | None = ... + self, + partition_by: Incomplete | None = ..., + order_by: Incomplete | None = ..., + rows: Incomplete | None = ..., + range_: Incomplete | None = ..., ): ... def within_group(self, *order_by): ... def filter(self, *criterion): ... @@ -32,18 +37,18 @@ class FunctionElement(Executable, ColumnElement[Any], FromClause, Generative): def select(self): ... def scalar(self): ... def execute(self): ... - def self_group(self, against: Any | None = ...): ... + def self_group(self, against: Incomplete | None = ...): ... @property def entity_namespace(self): ... class FunctionAsBinary(BinaryExpression): - sql_function: Any - left_index: Any - right_index: Any - operator: Any - type: Any - negate: Any - modifiers: Any + sql_function: Incomplete + left_index: Incomplete + right_index: Incomplete + operator: Incomplete + type: Incomplete + negate: Incomplete + modifiers: Incomplete def __init__(self, fn, left_index, right_index) -> None: ... @property def left(self): ... @@ -57,45 +62,45 @@ class FunctionAsBinary(BinaryExpression): class ScalarFunctionColumn(NamedColumn): __visit_name__: str is_literal: bool - table: Any - fn: Any - name: Any - type: Any - def __init__(self, fn, name, type_: Any | None = ...) -> None: ... + table: Incomplete + fn: Incomplete + name: Incomplete + type: Incomplete + def __init__(self, fn, name, type_: Incomplete | None = ...) -> None: ... class _FunctionGenerator: - opts: Any + opts: Incomplete def __init__(self, **opts) -> None: ... - def __getattr__(self, name): ... + def __getattr__(self, name: str): ... def __call__(self, *c, **kwargs): ... -func: Any -modifier: Any +func: Incomplete +modifier: Incomplete class Function(FunctionElement): __visit_name__: str - type: Any - packagenames: Any - name: Any + type: Incomplete + packagenames: Incomplete + name: Incomplete def __init__(self, name, *clauses, **kw) -> None: ... class _GenericMeta(TraversibleType): def __init__(cls, clsname, bases, clsdict) -> None: ... class GenericFunction: - name: Any - identifier: Any + name: Incomplete + identifier: Incomplete coerce_arguments: bool inherit_cache: bool - packagenames: Any - clause_expr: Any - type: Any + packagenames: Incomplete + clause_expr: Incomplete + type: Incomplete def __init__(self, *args, **kwargs) -> None: ... class next_value(GenericFunction): - type: Any + type: Incomplete name: str - sequence: Any + sequence: Incomplete def __init__(self, seq, **kw) -> None: ... def compare(self, other, **kw): ... @@ -120,15 +125,15 @@ class sum(ReturnTypeFromArgs): inherit_cache: bool class now(GenericFunction): - type: Any + type: Incomplete inherit_cache: bool class concat(GenericFunction): - type: Any + type: Incomplete inherit_cache: bool class char_length(GenericFunction): - type: Any + type: Incomplete inherit_cache: bool def __init__(self, arg, **kwargs) -> None: ... @@ -136,48 +141,48 @@ class random(GenericFunction): inherit_cache: bool class count(GenericFunction): - type: Any + type: Incomplete inherit_cache: bool - def __init__(self, expression: Any | None = ..., **kwargs) -> None: ... + def __init__(self, expression: Incomplete | None = ..., **kwargs) -> None: ... class current_date(AnsiFunction): - type: Any + type: Incomplete inherit_cache: bool class current_time(AnsiFunction): - type: Any + type: Incomplete inherit_cache: bool class current_timestamp(AnsiFunction): - type: Any + type: Incomplete inherit_cache: bool class current_user(AnsiFunction): - type: Any + type: Incomplete inherit_cache: bool class localtime(AnsiFunction): - type: Any + type: Incomplete inherit_cache: bool class localtimestamp(AnsiFunction): - type: Any + type: Incomplete inherit_cache: bool class session_user(AnsiFunction): - type: Any + type: Incomplete inherit_cache: bool class sysdate(AnsiFunction): - type: Any + type: Incomplete inherit_cache: bool class user(AnsiFunction): - type: Any + type: Incomplete inherit_cache: bool class array_agg(GenericFunction): - type: Any + type: Incomplete inherit_cache: bool def __init__(self, *args, **kwargs) -> None: ... @@ -198,19 +203,19 @@ class percentile_disc(OrderedSetAgg): inherit_cache: bool class rank(GenericFunction): - type: Any + type: Incomplete inherit_cache: bool class dense_rank(GenericFunction): - type: Any + type: Incomplete inherit_cache: bool class percent_rank(GenericFunction): - type: Any + type: Incomplete inherit_cache: bool class cume_dist(GenericFunction): - type: Any + type: Incomplete inherit_cache: bool class cube(GenericFunction): diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/lambdas.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/lambdas.pyi index 7b2b6e2d2..b6ada6db4 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/lambdas.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/lambdas.pyi @@ -1,4 +1,5 @@ -from typing import Any, Generic, TypeVar +from _typeshed import Incomplete +from typing import Generic, TypeVar from . import elements, roles from .base import Options @@ -9,33 +10,33 @@ _T = TypeVar("_T") class LambdaOptions(Options): enable_tracking: bool track_closure_variables: bool - track_on: Any + track_on: Incomplete global_track_bound_values: bool track_bound_values: bool - lambda_cache: Any + lambda_cache: Incomplete def lambda_stmt( lmb, enable_tracking: bool = ..., track_closure_variables: bool = ..., - track_on: Any | None = ..., + track_on: Incomplete | None = ..., global_track_bound_values: bool = ..., track_bound_values: bool = ..., - lambda_cache: Any | None = ..., + lambda_cache: Incomplete | None = ..., ): ... class LambdaElement(elements.ClauseElement): __visit_name__: str - parent_lambda: Any - fn: Any - role: Any - tracker_key: Any - opts: Any - def __init__(self, fn, role, opts=..., apply_propagate_attrs: Any | None = ...) -> None: ... - def __getattr__(self, key): ... + parent_lambda: Incomplete + fn: Incomplete + role: Incomplete + tracker_key: Incomplete + opts: Incomplete + def __init__(self, fn, role, opts=..., apply_propagate_attrs: Incomplete | None = ...) -> None: ... + def __getattr__(self, key: str): ... class DeferredLambdaElement(LambdaElement): - lambda_args: Any + lambda_args: Incomplete def __init__(self, fn, role, opts=..., lambda_args=...) -> None: ... class StatementLambdaElement(roles.AllowsLambdaRole, LambdaElement): @@ -44,7 +45,7 @@ class StatementLambdaElement(roles.AllowsLambdaRole, LambdaElement): self, other, enable_tracking: bool = ..., - track_on: Any | None = ..., + track_on: Incomplete | None = ..., track_closure_variables: bool = ..., track_bound_values: bool = ..., ): ... @@ -53,62 +54,68 @@ class StatementLambdaElement(roles.AllowsLambdaRole, LambdaElement): class NullLambdaStatement(roles.AllowsLambdaRole, elements.ClauseElement): __visit_name__: str def __init__(self, statement) -> None: ... - def __getattr__(self, key): ... + def __getattr__(self, key: str): ... def __add__(self, other): ... def add_criteria(self, other, **kw): ... class LinkedLambdaElement(StatementLambdaElement): - role: Any - opts: Any - fn: Any - parent_lambda: Any - tracker_key: Any + role: Incomplete + opts: Incomplete + fn: Incomplete + parent_lambda: Incomplete + tracker_key: Incomplete def __init__(self, fn, parent_lambda, opts) -> None: ... class AnalyzedCode: @classmethod def get(cls, fn, lambda_element, lambda_kw, **kw): ... - track_bound_values: Any - track_closure_variables: Any - bindparam_trackers: Any - closure_trackers: Any - build_py_wrappers: Any + track_bound_values: Incomplete + track_closure_variables: Incomplete + bindparam_trackers: Incomplete + closure_trackers: Incomplete + build_py_wrappers: Incomplete def __init__(self, fn, lambda_element, opts) -> None: ... class NonAnalyzedFunction: - closure_bindparams: Any - bindparam_trackers: Any - expr: Any + closure_bindparams: Incomplete + bindparam_trackers: Incomplete + expr: Incomplete def __init__(self, expr) -> None: ... @property def expected_expr(self): ... class AnalyzedFunction: - analyzed_code: Any - fn: Any - closure_pywrappers: Any - tracker_instrumented_fn: Any - expr: Any - bindparam_trackers: Any - expected_expr: Any - is_sequence: Any - propagate_attrs: Any - closure_bindparams: Any + analyzed_code: Incomplete + fn: Incomplete + closure_pywrappers: Incomplete + tracker_instrumented_fn: Incomplete + expr: Incomplete + bindparam_trackers: Incomplete + expected_expr: Incomplete + is_sequence: Incomplete + propagate_attrs: Incomplete + closure_bindparams: Incomplete def __init__(self, analyzed_code, lambda_element, apply_propagate_attrs, fn) -> None: ... class PyWrapper(ColumnOperators[_T], Generic[_T]): - fn: Any - track_bound_values: Any + fn: Incomplete + track_bound_values: Incomplete def __init__( - self, fn, name, to_evaluate, closure_index: Any | None = ..., getter: Any | None = ..., track_bound_values: bool = ... + self, + fn, + name, + to_evaluate, + closure_index: Incomplete | None = ..., + getter: Incomplete | None = ..., + track_bound_values: bool = ..., ) -> None: ... def __call__(self, *arg, **kw): ... def operate(self, op, *other, **kwargs): ... def reverse_operate(self, op, other, **kwargs): ... - def __clause_element__(self): ... - def __bool__(self): ... - def __nonzero__(self): ... - def __getattribute__(self, key): ... + def __clause_element__(self): ... # Field not always present. + def __bool__(self) -> bool: ... + def __nonzero__(self) -> bool: ... + def __getattribute__(self, key: str): ... def __iter__(self): ... def __getitem__(self, key) -> ColumnOperators[_T]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/operators.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/operators.pyi index 2bc47695f..abfafe7c2 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/operators.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/operators.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from collections.abc import Container, Iterable from operator import truediv from typing import Any, Generic, TypeVar @@ -10,7 +11,7 @@ class Operators: def __and__(self, other): ... def __or__(self, other): ... def __invert__(self): ... - def op(self, opstring, precedence: int = ..., is_comparison: bool = ..., return_type: Any | None = ...): ... + def op(self, opstring, precedence: int = ..., is_comparison: bool = ..., return_type: Incomplete | None = ...): ... def bool_op(self, opstring, precedence: int = ...): ... def operate(self, op, *other, **kwargs): ... def reverse_operate(self, op, other, **kwargs): ... @@ -28,7 +29,7 @@ class custom_op: opstring, precedence: int = ..., is_comparison: bool = ..., - return_type: Any | None = ..., + return_type: Incomplete | None = ..., natural_self_precedent: bool = ..., eager_grouping: bool = ..., ) -> None: ... @@ -70,8 +71,8 @@ class ColumnOperators(Operators, Generic[_T]): def endswith(self, other: str, **kwargs) -> ColumnOperators[_T]: ... def contains(self, other: str, **kwargs) -> ColumnOperators[_T]: ... def match(self, other: str, **kwargs) -> ColumnOperators[_T]: ... - def regexp_match(self, pattern, flags: Any | None = ...) -> ColumnOperators[_T]: ... - def regexp_replace(self, pattern, replacement, flags: Any | None = ...) -> ColumnOperators[_T]: ... + def regexp_match(self, pattern, flags: Incomplete | None = ...) -> ColumnOperators[_T]: ... + def regexp_replace(self, pattern, replacement, flags: Incomplete | None = ...) -> ColumnOperators[_T]: ... def desc(self) -> ColumnOperators[_T]: ... def asc(self) -> ColumnOperators[_T]: ... def nulls_first(self) -> ColumnOperators[_T]: ... @@ -122,13 +123,13 @@ isnot = is_not def collate(a, b): ... def op(a, opstring, b): ... -def like_op(a, b, escape: Any | None = ...): ... -def not_like_op(a, b, escape: Any | None = ...): ... +def like_op(a, b, escape: Incomplete | None = ...): ... +def not_like_op(a, b, escape: Incomplete | None = ...): ... notlike_op = not_like_op -def ilike_op(a, b, escape: Any | None = ...): ... -def not_ilike_op(a, b, escape: Any | None = ...): ... +def ilike_op(a, b, escape: Incomplete | None = ...): ... +def not_ilike_op(a, b, escape: Incomplete | None = ...): ... notilike_op = not_ilike_op @@ -145,25 +146,25 @@ notin_op = not_in_op def distinct_op(a): ... def any_op(a): ... def all_op(a): ... -def startswith_op(a, b, escape: Any | None = ..., autoescape: bool = ...): ... -def not_startswith_op(a, b, escape: Any | None = ..., autoescape: bool = ...): ... +def startswith_op(a, b, escape: Incomplete | None = ..., autoescape: bool = ...): ... +def not_startswith_op(a, b, escape: Incomplete | None = ..., autoescape: bool = ...): ... notstartswith_op = not_startswith_op -def endswith_op(a, b, escape: Any | None = ..., autoescape: bool = ...): ... -def not_endswith_op(a, b, escape: Any | None = ..., autoescape: bool = ...): ... +def endswith_op(a, b, escape: Incomplete | None = ..., autoescape: bool = ...): ... +def not_endswith_op(a, b, escape: Incomplete | None = ..., autoescape: bool = ...): ... notendswith_op = not_endswith_op -def contains_op(a, b, escape: Any | None = ..., autoescape: bool = ...): ... -def not_contains_op(a, b, escape: Any | None = ..., autoescape: bool = ...): ... +def contains_op(a, b, escape: Incomplete | None = ..., autoescape: bool = ...): ... +def not_contains_op(a, b, escape: Incomplete | None = ..., autoescape: bool = ...): ... notcontains_op = not_contains_op def match_op(a, b, **kw): ... -def regexp_match_op(a, b, flags: Any | None = ...): ... -def not_regexp_match_op(a, b, flags: Any | None = ...): ... -def regexp_replace_op(a, b, replacement, flags: Any | None = ...): ... +def regexp_match_op(a, b, flags: Incomplete | None = ...): ... +def not_regexp_match_op(a, b, flags: Incomplete | None = ...): ... +def regexp_replace_op(a, b, replacement, flags: Incomplete | None = ...): ... def not_match_op(a, b, **kw): ... notmatch_op = not_match_op diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/schema.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/schema.pyi index 7ecb5c710..21656beed 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/schema.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/schema.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from ..util import memoized_property @@ -31,11 +32,11 @@ class Table(DialectKWArgs, SchemaItem, TableClause): def add_is_dependent_on(self, table) -> None: ... def append_column(self, column, replace_existing: bool = ...) -> None: ... # type: ignore[override] def append_constraint(self, constraint) -> None: ... - def exists(self, bind: Any | None = ...): ... - def create(self, bind: Any | None = ..., checkfirst: bool = ...) -> None: ... - def drop(self, bind: Any | None = ..., checkfirst: bool = ...) -> None: ... - def tometadata(self, metadata, schema=..., referred_schema_fn: Any | None = ..., name: Any | None = ...): ... - def to_metadata(self, metadata, schema=..., referred_schema_fn: Any | None = ..., name: Any | None = ...): ... + def exists(self, bind: Incomplete | None = ...): ... + def create(self, bind: Incomplete | None = ..., checkfirst: bool = ...) -> None: ... + def drop(self, bind: Incomplete | None = ..., checkfirst: bool = ...) -> None: ... + def tometadata(self, metadata, schema=..., referred_schema_fn: Incomplete | None = ..., name: Incomplete | None = ...): ... + def to_metadata(self, metadata, schema=..., referred_schema_fn: Incomplete | None = ..., name: Incomplete | None = ...): ... class Column(DialectKWArgs, SchemaItem, ColumnClause): __visit_name__: str @@ -79,20 +80,20 @@ class ForeignKey(DialectKWArgs, SchemaItem): def __init__( self, column, - _constraint: Any | None = ..., + _constraint: Incomplete | None = ..., use_alter: bool = ..., - name: Any | None = ..., - onupdate: Any | None = ..., - ondelete: Any | None = ..., - deferrable: Any | None = ..., - initially: Any | None = ..., + name: Incomplete | None = ..., + onupdate: Incomplete | None = ..., + ondelete: Incomplete | None = ..., + deferrable: Incomplete | None = ..., + initially: Incomplete | None = ..., link_to_name: bool = ..., - match: Any | None = ..., - info: Any | None = ..., + match: Incomplete | None = ..., + info: Incomplete | None = ..., _unresolvable: bool = ..., **dialect_kw, ) -> None: ... - def copy(self, schema: Any | None = ..., **kw): ... + def copy(self, schema: Incomplete | None = ..., **kw): ... @property def target_fullname(self): ... def references(self, table): ... @@ -107,7 +108,7 @@ class DefaultGenerator(Executable, SchemaItem): column: Any for_update: Any def __init__(self, for_update: bool = ...) -> None: ... - def execute(self, bind: Any | None = ...): ... # type: ignore[override] + def execute(self, bind: Incomplete | None = ...): ... # type: ignore[override] @property def bind(self): ... @@ -133,15 +134,15 @@ class IdentityOptions: order: Any def __init__( self, - start: Any | None = ..., - increment: Any | None = ..., - minvalue: Any | None = ..., - maxvalue: Any | None = ..., - nominvalue: Any | None = ..., - nomaxvalue: Any | None = ..., - cycle: Any | None = ..., - cache: Any | None = ..., - order: Any | None = ..., + start: Incomplete | None = ..., + increment: Incomplete | None = ..., + minvalue: Incomplete | None = ..., + maxvalue: Incomplete | None = ..., + nominvalue: Incomplete | None = ..., + nomaxvalue: Incomplete | None = ..., + cycle: Incomplete | None = ..., + cache: Incomplete | None = ..., + order: Incomplete | None = ..., ) -> None: ... class Sequence(IdentityOptions, DefaultGenerator): @@ -155,21 +156,21 @@ class Sequence(IdentityOptions, DefaultGenerator): def __init__( self, name, - start: Any | None = ..., - increment: Any | None = ..., - minvalue: Any | None = ..., - maxvalue: Any | None = ..., - nominvalue: Any | None = ..., - nomaxvalue: Any | None = ..., - cycle: Any | None = ..., - schema: Any | None = ..., - cache: Any | None = ..., - order: Any | None = ..., - data_type: Any | None = ..., + start: Incomplete | None = ..., + increment: Incomplete | None = ..., + minvalue: Incomplete | None = ..., + maxvalue: Incomplete | None = ..., + nominvalue: Incomplete | None = ..., + nomaxvalue: Incomplete | None = ..., + cycle: Incomplete | None = ..., + schema: Incomplete | None = ..., + cache: Incomplete | None = ..., + order: Incomplete | None = ..., + data_type: Incomplete | None = ..., optional: bool = ..., - quote: Any | None = ..., - metadata: Any | None = ..., - quote_schema: Any | None = ..., + quote: Incomplete | None = ..., + metadata: Incomplete | None = ..., + quote_schema: Incomplete | None = ..., for_update: bool = ..., ) -> None: ... @memoized_property @@ -179,8 +180,8 @@ class Sequence(IdentityOptions, DefaultGenerator): def next_value(self): ... @property def bind(self): ... - def create(self, bind: Any | None = ..., checkfirst: bool = ...) -> None: ... - def drop(self, bind: Any | None = ..., checkfirst: bool = ...) -> None: ... + def create(self, bind: Incomplete | None = ..., checkfirst: bool = ...) -> None: ... + def drop(self, bind: Incomplete | None = ..., checkfirst: bool = ...) -> None: ... class FetchedValue(SchemaEventTarget): is_server_default: bool @@ -204,11 +205,11 @@ class Constraint(DialectKWArgs, SchemaItem): info: Any def __init__( self, - name: Any | None = ..., - deferrable: Any | None = ..., - initially: Any | None = ..., - _create_rule: Any | None = ..., - info: Any | None = ..., + name: Incomplete | None = ..., + deferrable: Incomplete | None = ..., + initially: Incomplete | None = ..., + _create_rule: Incomplete | None = ..., + info: Incomplete | None = ..., _type_bound: bool = ..., **dialect_kw, ) -> None: ... @@ -224,10 +225,10 @@ class ColumnCollectionConstraint(ColumnCollectionMixin, Constraint): def __init__(self, *columns, **kw) -> None: ... columns: Any def __contains__(self, x): ... - def copy(self, target_table: Any | None = ..., **kw): ... + def copy(self, target_table: Incomplete | None = ..., **kw): ... def contains_column(self, col): ... def __iter__(self): ... - def __len__(self): ... + def __len__(self) -> int: ... class CheckConstraint(ColumnCollectionConstraint): __visit_name__: str @@ -235,19 +236,19 @@ class CheckConstraint(ColumnCollectionConstraint): def __init__( self, sqltext, - name: Any | None = ..., - deferrable: Any | None = ..., - initially: Any | None = ..., - table: Any | None = ..., - info: Any | None = ..., - _create_rule: Any | None = ..., + name: Incomplete | None = ..., + deferrable: Incomplete | None = ..., + initially: Incomplete | None = ..., + table: Incomplete | None = ..., + info: Incomplete | None = ..., + _create_rule: Incomplete | None = ..., _autoattach: bool = ..., _type_bound: bool = ..., **kw, ) -> None: ... @property def is_column_level(self): ... - def copy(self, target_table: Any | None = ..., **kw): ... + def copy(self, target_table: Incomplete | None = ..., **kw): ... class ForeignKeyConstraint(ColumnCollectionConstraint): __visit_name__: str @@ -261,16 +262,16 @@ class ForeignKeyConstraint(ColumnCollectionConstraint): self, columns, refcolumns, - name: Any | None = ..., - onupdate: Any | None = ..., - ondelete: Any | None = ..., - deferrable: Any | None = ..., - initially: Any | None = ..., + name: Incomplete | None = ..., + onupdate: Incomplete | None = ..., + ondelete: Incomplete | None = ..., + deferrable: Incomplete | None = ..., + initially: Incomplete | None = ..., use_alter: bool = ..., link_to_name: bool = ..., - match: Any | None = ..., - table: Any | None = ..., - info: Any | None = ..., + match: Incomplete | None = ..., + table: Incomplete | None = ..., + info: Incomplete | None = ..., **dialect_kw, ) -> None: ... columns: Any @@ -278,7 +279,7 @@ class ForeignKeyConstraint(ColumnCollectionConstraint): def referred_table(self): ... @property def column_keys(self): ... - def copy(self, schema: Any | None = ..., target_table: Any | None = ..., **kw): ... # type: ignore[override] + def copy(self, schema: Incomplete | None = ..., target_table: Incomplete | None = ..., **kw): ... # type: ignore[override] class PrimaryKeyConstraint(ColumnCollectionConstraint): __visit_name__: str @@ -299,8 +300,8 @@ class Index(DialectKWArgs, ColumnCollectionMixin, SchemaItem): def __init__(self, name, *expressions, **kw) -> None: ... @property def bind(self): ... - def create(self, bind: Any | None = ..., checkfirst: bool = ...): ... - def drop(self, bind: Any | None = ..., checkfirst: bool = ...) -> None: ... + def create(self, bind: Incomplete | None = ..., checkfirst: bool = ...): ... + def drop(self, bind: Incomplete | None = ..., checkfirst: bool = ...) -> None: ... DEFAULT_NAMING_CONVENTION: Any @@ -312,13 +313,13 @@ class MetaData(SchemaItem): info: Any def __init__( self, - bind: Any | None = ..., - schema: Any | None = ..., - quote_schema: Any | None = ..., - naming_convention: Any | None = ..., - info: Any | None = ..., + bind: Incomplete | None = ..., + schema: Incomplete | None = ..., + quote_schema: Incomplete | None = ..., + naming_convention: Incomplete | None = ..., + info: Incomplete | None = ..., ) -> None: ... - def __contains__(self, table_or_key): ... + def __contains__(self, table_or_key) -> bool: ... def is_bound(self): ... bind: Any def clear(self) -> None: ... @@ -327,17 +328,17 @@ class MetaData(SchemaItem): def sorted_tables(self): ... def reflect( self, - bind: Any | None = ..., - schema: Any | None = ..., + bind: Incomplete | None = ..., + schema: Incomplete | None = ..., views: bool = ..., - only: Any | None = ..., + only: Incomplete | None = ..., extend_existing: bool = ..., autoload_replace: bool = ..., resolve_fks: bool = ..., **dialect_kwargs, ) -> None: ... - def create_all(self, bind: Any | None = ..., tables: Any | None = ..., checkfirst: bool = ...) -> None: ... - def drop_all(self, bind: Any | None = ..., tables: Any | None = ..., checkfirst: bool = ...) -> None: ... + def create_all(self, bind: Incomplete | None = ..., tables: Incomplete | None = ..., checkfirst: bool = ...) -> None: ... + def drop_all(self, bind: Incomplete | None = ..., tables: Incomplete | None = ..., checkfirst: bool = ...) -> None: ... class ThreadLocalMetaData(MetaData): __visit_name__: str @@ -352,8 +353,8 @@ class Computed(FetchedValue, SchemaItem): sqltext: Any persisted: Any column: Any - def __init__(self, sqltext, persisted: Any | None = ...) -> None: ... - def copy(self, target_table: Any | None = ..., **kw): ... + def __init__(self, sqltext, persisted: Incomplete | None = ...) -> None: ... + def copy(self, target_table: Incomplete | None = ..., **kw): ... class Identity(IdentityOptions, FetchedValue, SchemaItem): __visit_name__: str @@ -363,15 +364,15 @@ class Identity(IdentityOptions, FetchedValue, SchemaItem): def __init__( self, always: bool = ..., - on_null: Any | None = ..., - start: Any | None = ..., - increment: Any | None = ..., - minvalue: Any | None = ..., - maxvalue: Any | None = ..., - nominvalue: Any | None = ..., - nomaxvalue: Any | None = ..., - cycle: Any | None = ..., - cache: Any | None = ..., - order: Any | None = ..., + on_null: Incomplete | None = ..., + start: Incomplete | None = ..., + increment: Incomplete | None = ..., + minvalue: Incomplete | None = ..., + maxvalue: Incomplete | None = ..., + nominvalue: Incomplete | None = ..., + nomaxvalue: Incomplete | None = ..., + cycle: Incomplete | None = ..., + cache: Incomplete | None = ..., + order: Incomplete | None = ..., ) -> None: ... def copy(self, **kw): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/selectable.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/selectable.pyi index 892c53230..eb24ab00c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/selectable.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/selectable.pyi @@ -1,5 +1,6 @@ -from _typeshed import Self +from _typeshed import Incomplete from typing import Any +from typing_extensions import Self from .. import util from ..util import HasMemoized, memoized_property @@ -33,31 +34,31 @@ class ReturnsRows(roles.ReturnsRowsRole, ClauseElement): class Selectable(ReturnsRows): __visit_name__: str is_selectable: bool - def lateral(self, name: Any | None = ...): ... + def lateral(self, name: Incomplete | None = ...): ... def replace_selectable(self, old, alias): ... def corresponding_column(self, column, require_embedded: bool = ...): ... class HasPrefixes: - def prefix_with(self: Self, *expr, **kw) -> Self: ... + def prefix_with(self, *expr, **kw) -> Self: ... class HasSuffixes: - def suffix_with(self: Self, *expr, **kw) -> Self: ... + def suffix_with(self, *expr, **kw) -> Self: ... class HasHints: def with_statement_hint(self, text, dialect_name: str = ...): ... - def with_hint(self: Self, selectable, text: str, dialect_name: str = ...) -> Self: ... + def with_hint(self, selectable, text: str, dialect_name: str = ...) -> Self: ... class FromClause(roles.AnonymizedFromClauseRole, Selectable): __visit_name__: str named_with_column: bool schema: Any is_selectable: bool - def select(self, whereclause: Any | None = ..., **kwargs): ... - def join(self, right, onclause: Any | None = ..., isouter: bool = ..., full: bool = ...): ... - def outerjoin(self, right, onclause: Any | None = ..., full: bool = ...): ... - def alias(self, name: Any | None = ..., flat: bool = ...): ... + def select(self, whereclause: Incomplete | None = ..., **kwargs): ... + def join(self, right, onclause: Incomplete | None = ..., isouter: bool = ..., full: bool = ...): ... + def outerjoin(self, right, onclause: Incomplete | None = ..., full: bool = ...): ... + def alias(self, name: Incomplete | None = ..., flat: bool = ...): ... def table_valued(self): ... - def tablesample(self, sampling, name: Any | None = ..., seed: Any | None = ...): ... + def tablesample(self, sampling, name: Incomplete | None = ..., seed: Incomplete | None = ...): ... def is_derived_from(self, fromclause): ... @property def description(self): ... @@ -86,15 +87,15 @@ class Join(roles.DMLTableRole, FromClause): onclause: Any isouter: Any full: Any - def __init__(self, left, right, onclause: Any | None = ..., isouter: bool = ..., full: bool = ...) -> None: ... + def __init__(self, left, right, onclause: Incomplete | None = ..., isouter: bool = ..., full: bool = ...) -> None: ... @property def description(self): ... def is_derived_from(self, fromclause): ... - def self_group(self, against: Any | None = ...): ... - def select(self, whereclause: Any | None = ..., **kwargs): ... + def self_group(self, against: Incomplete | None = ...): ... + def select(self, whereclause: Incomplete | None = ..., **kwargs): ... @property def bind(self): ... - def alias(self, name: Any | None = ..., flat: bool = ...): ... + def alias(self, name: Incomplete | None = ..., flat: bool = ...): ... class NoInit: def __init__(self, *arg, **kw) -> None: ... @@ -117,9 +118,9 @@ class TableValuedAlias(Alias): __visit_name__: str @HasMemoized.memoized_attribute def column(self): ... - def alias(self, name: Any | None = ...): ... # type: ignore[override] - def lateral(self, name: Any | None = ...): ... - def render_derived(self, name: Any | None = ..., with_types: bool = ...): ... + def alias(self, name: Incomplete | None = ...): ... # type: ignore[override] + def lateral(self, name: Incomplete | None = ...): ... + def render_derived(self, name: Incomplete | None = ..., with_types: bool = ...): ... class Lateral(AliasedReturnsRows): __visit_name__: str @@ -130,13 +131,13 @@ class TableSample(AliasedReturnsRows): class CTE(roles.DMLTableRole, roles.IsCTERole, Generative, HasPrefixes, HasSuffixes, AliasedReturnsRows): __visit_name__: str - def alias(self, name: Any | None = ..., flat: bool = ...): ... + def alias(self, name: Incomplete | None = ..., flat: bool = ...): ... def union(self, *other): ... def union_all(self, *other): ... class HasCTE(roles.HasCTERole): def add_cte(self, cte) -> None: ... - def cte(self, name: Any | None = ..., recursive: bool = ..., nesting: bool = ...): ... + def cte(self, name: Incomplete | None = ..., recursive: bool = ..., nesting: bool = ...): ... class Subquery(AliasedReturnsRows): __visit_name__: str @@ -168,21 +169,21 @@ class TableClause(roles.DMLTableRole, Immutable, FromClause): @memoized_property def description(self): ... def append_column(self, c, **kw) -> None: ... - def insert(self, values: Any | None = ..., inline: bool = ..., **kwargs): ... - def update(self, whereclause: Any | None = ..., values: Any | None = ..., inline: bool = ..., **kwargs): ... - def delete(self, whereclause: Any | None = ..., **kwargs): ... + def insert(self, values: Incomplete | None = ..., inline: bool = ..., **kwargs): ... + def update(self, whereclause: Incomplete | None = ..., values: Incomplete | None = ..., inline: bool = ..., **kwargs): ... + def delete(self, whereclause: Incomplete | None = ..., **kwargs): ... class ForUpdateArg(ClauseElement): def __eq__(self, other): ... def __ne__(self, other): ... - def __hash__(self): ... + def __hash__(self) -> int: ... nowait: Any read: Any skip_locked: Any key_share: Any of: Any def __init__( - self, nowait: bool = ..., read: bool = ..., of: Any | None = ..., skip_locked: bool = ..., key_share: bool = ... + self, nowait: bool = ..., read: bool = ..., of: Incomplete | None = ..., skip_locked: bool = ..., key_share: bool = ... ) -> None: ... class Values(Generative, FromClause): @@ -191,9 +192,9 @@ class Values(Generative, FromClause): name: Any literal_binds: Any def __init__(self, *columns, **kw) -> None: ... - def alias(self: Self, name: Any | None, **kw) -> Self: ... # type: ignore[override] - def lateral(self: Self, name: Any | None = ...) -> Self: ... - def data(self: Self, values) -> Self: ... + def alias(self, name: Incomplete | None, **kw) -> Self: ... # type: ignore[override] + def lateral(self, name: Incomplete | None = ...) -> Self: ... + def data(self, values) -> Self: ... class SelectBase( roles.SelectStatementRole, @@ -219,9 +220,9 @@ class SelectBase( def exists(self): ... def scalar_subquery(self): ... def label(self, name): ... - def lateral(self, name: Any | None = ...): ... - def subquery(self, name: Any | None = ...): ... - def alias(self, name: Any | None = ..., flat: bool = ...): ... + def lateral(self, name: Incomplete | None = ...): ... + def subquery(self, name: Incomplete | None = ...): ... + def alias(self, name: Incomplete | None = ..., flat: bool = ...): ... class SelectStatementGrouping(GroupedElement, SelectBase): __visit_name__: str @@ -231,7 +232,7 @@ class SelectStatementGrouping(GroupedElement, SelectBase): def set_label_style(self, label_style): ... @property def select_statement(self): ... - def self_group(self, against: Any | None = ...): ... + def self_group(self, against: Incomplete | None = ...): ... @property def selected_columns(self): ... @@ -244,24 +245,24 @@ class GenerativeSelect(DeprecatedSelectBaseGenerations, SelectBase): self, _label_style=..., use_labels: bool = ..., - limit: Any | None = ..., - offset: Any | None = ..., - order_by: Any | None = ..., - group_by: Any | None = ..., - bind: Any | None = ..., + limit: Incomplete | None = ..., + offset: Incomplete | None = ..., + order_by: Incomplete | None = ..., + group_by: Incomplete | None = ..., + bind: Incomplete | None = ..., ) -> None: ... def with_for_update( - self: Self, nowait: bool = ..., read: bool = ..., of: Any | None = ..., skip_locked: bool = ..., key_share: bool = ... + self, nowait: bool = ..., read: bool = ..., of: Incomplete | None = ..., skip_locked: bool = ..., key_share: bool = ... ) -> Self: ... def get_label_style(self): ... def set_label_style(self, style): ... def apply_labels(self): ... - def limit(self: Self, limit: Any | None) -> Self: ... - def fetch(self: Self, count: Any | None, with_ties: bool = ..., percent: bool = ...) -> Self: ... - def offset(self: Self, offset: Any | None) -> Self: ... - def slice(self: Self, start: Any | None, stop: Any | None) -> Self: ... - def order_by(self: Self, *clauses) -> Self: ... - def group_by(self: Self, *clauses) -> Self: ... + def limit(self, limit: Incomplete | None) -> Self: ... + def fetch(self, count: Incomplete | None, with_ties: bool = ..., percent: bool = ...) -> Self: ... + def offset(self, offset: Incomplete | None) -> Self: ... + def slice(self, start: Incomplete | None, stop: Incomplete | None) -> Self: ... + def order_by(self, *clauses) -> Self: ... + def group_by(self, *clauses) -> Self: ... class CompoundSelectState(CompileState): ... @@ -276,7 +277,7 @@ class CompoundSelect(HasCompileState, GenerativeSelect): keyword: Any selects: Any def __init__(self, keyword, *selects, **kwargs) -> None: ... - def self_group(self, against: Any | None = ...): ... + def self_group(self, against: Incomplete | None = ...): ... def is_derived_from(self, fromclause): ... @property def selected_columns(self): ... @@ -323,14 +324,14 @@ class Select( @classmethod def create_legacy_select( cls, - columns: Any | None = ..., - whereclause: Any | None = ..., - from_obj: Any | None = ..., + columns: Incomplete | None = ..., + whereclause: Incomplete | None = ..., + from_obj: Incomplete | None = ..., distinct: bool = ..., - having: Any | None = ..., + having: Incomplete | None = ..., correlate: bool = ..., - prefixes: Any | None = ..., - suffixes: Any | None = ..., + prefixes: Incomplete | None = ..., + suffixes: Incomplete | None = ..., **kwargs, ): ... def __init__(self) -> None: ... @@ -339,10 +340,10 @@ class Select( @property def column_descriptions(self): ... def from_statement(self, statement): ... - def join(self: Self, target, onclause: Any | None = ..., isouter: bool = ..., full: bool = ...) -> Self: ... - def outerjoin_from(self, from_, target, onclause: Any | None = ..., full: bool = ...): ... - def join_from(self: Self, from_, target, onclause: Any | None = ..., isouter: bool = ..., full: bool = ...) -> Self: ... - def outerjoin(self, target, onclause: Any | None = ..., full: bool = ...): ... + def join(self, target, onclause: Incomplete | None = ..., isouter: bool = ..., full: bool = ...) -> Self: ... + def outerjoin_from(self, from_, target, onclause: Incomplete | None = ..., full: bool = ...): ... + def join_from(self, from_, target, onclause: Incomplete | None = ..., isouter: bool = ..., full: bool = ...) -> Self: ... + def outerjoin(self, target, onclause: Incomplete | None = ..., full: bool = ...): ... def get_final_froms(self): ... @property def froms(self): ... @@ -352,21 +353,21 @@ class Select( def inner_columns(self): ... def is_derived_from(self, fromclause): ... def get_children(self, **kwargs): ... - def add_columns(self: Self, *columns) -> Self: ... + def add_columns(self, *columns) -> Self: ... def column(self, column): ... def reduce_columns(self, only_synonyms: bool = ...): ... - def with_only_columns(self: Self, *columns, **kw) -> Self: ... + def with_only_columns(self, *columns, **kw) -> Self: ... @property def whereclause(self): ... - def where(self: Self, *whereclause) -> Self: ... - def having(self: Self, having) -> Self: ... - def distinct(self: Self, *expr) -> Self: ... - def select_from(self: Self, *froms) -> Self: ... - def correlate(self: Self, *fromclauses) -> Self: ... - def correlate_except(self: Self, *fromclauses) -> Self: ... + def where(self, *whereclause) -> Self: ... + def having(self, having) -> Self: ... + def distinct(self, *expr) -> Self: ... + def select_from(self, *froms) -> Self: ... + def correlate(self, *fromclauses) -> Self: ... + def correlate_except(self, *fromclauses) -> Self: ... @HasMemoized.memoized_attribute def selected_columns(self): ... - def self_group(self, against: Any | None = ...): ... + def self_group(self, against: Incomplete | None = ...): ... def union(self, *other, **kwargs): ... def union_all(self, *other, **kwargs): ... def except_(self, *other, **kwargs): ... @@ -387,15 +388,15 @@ class ScalarSelect(roles.InElementRole, Generative, Grouping): def columns(self) -> None: ... @property def c(self): ... - def where(self: Self, crit) -> Self: ... + def where(self, crit) -> Self: ... def self_group(self, **kwargs): ... - def correlate(self: Self, *fromclauses) -> Self: ... - def correlate_except(self: Self, *fromclauses) -> Self: ... + def correlate(self, *fromclauses) -> Self: ... + def correlate_except(self, *fromclauses) -> Self: ... class Exists(UnaryExpression): inherit_cache: bool def __init__(self, *args, **kwargs) -> None: ... - def select(self, whereclause: Any | None = ..., **kwargs): ... + def select(self, whereclause: Incomplete | None = ..., **kwargs): ... def correlate(self, *fromclause): ... def correlate_except(self, *fromclause): ... def select_from(self, *froms): ... @@ -411,7 +412,7 @@ class TextualSelect(SelectBase): def __init__(self, text, columns, positional: bool = ...) -> None: ... @HasMemoized.memoized_attribute def selected_columns(self): ... - def bindparams(self: Self, *binds, **bind_as_values) -> Self: ... + def bindparams(self, *binds, **bind_as_values) -> Self: ... TextAsFrom = TextualSelect diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/sqltypes.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/sqltypes.pyi index e45932c48..eef39d632 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/sqltypes.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/sqltypes.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any, Generic, TypeVar from .base import SchemaEventTarget @@ -37,10 +38,10 @@ class String(Concatenable, TypeEngine): collation: Any def __init__( self, - length: Any | None = ..., - collation: Any | None = ..., + length: Incomplete | None = ..., + collation: Incomplete | None = ..., convert_unicode: bool = ..., - unicode_error: Any | None = ..., + unicode_error: Incomplete | None = ..., _warn_on_bytestring: bool = ..., _expect_unicode: bool = ..., ) -> None: ... @@ -56,11 +57,11 @@ class Text(String): class Unicode(String): __visit_name__: str - def __init__(self, length: Any | None = ..., **kwargs) -> None: ... + def __init__(self, length: Incomplete | None = ..., **kwargs) -> None: ... class UnicodeText(Text): __visit_name__: str - def __init__(self, length: Any | None = ..., **kwargs) -> None: ... + def __init__(self, length: Incomplete | None = ..., **kwargs) -> None: ... class Integer(_LookupExpressionAdapter, TypeEngine): __visit_name__: str @@ -82,7 +83,11 @@ class Numeric(_LookupExpressionAdapter, TypeEngine): decimal_return_scale: Any asdecimal: Any def __init__( - self, precision: Any | None = ..., scale: Any | None = ..., decimal_return_scale: Any | None = ..., asdecimal: bool = ... + self, + precision: Incomplete | None = ..., + scale: Incomplete | None = ..., + decimal_return_scale: Incomplete | None = ..., + asdecimal: bool = ..., ) -> None: ... def get_dbapi_type(self, dbapi): ... def literal_processor(self, dialect): ... @@ -97,7 +102,9 @@ class Float(Numeric): precision: Any asdecimal: Any decimal_return_scale: Any - def __init__(self, precision: Any | None = ..., asdecimal: bool = ..., decimal_return_scale: Any | None = ...) -> None: ... + def __init__( + self, precision: Incomplete | None = ..., asdecimal: bool = ..., decimal_return_scale: Incomplete | None = ... + ) -> None: ... def result_processor(self, dialect, coltype): ... class DateTime(_LookupExpressionAdapter, TypeEngine): @@ -124,7 +131,7 @@ class Time(_LookupExpressionAdapter, TypeEngine): class _Binary(TypeEngine): length: Any - def __init__(self, length: Any | None = ...) -> None: ... + def __init__(self, length: Incomplete | None = ...) -> None: ... def literal_processor(self, dialect): ... @property def python_type(self): ... @@ -135,7 +142,7 @@ class _Binary(TypeEngine): class LargeBinary(_Binary): __visit_name__: str - def __init__(self, length: Any | None = ...) -> None: ... + def __init__(self, length: Incomplete | None = ...) -> None: ... class SchemaType(SchemaEventTarget): name: Any @@ -144,19 +151,19 @@ class SchemaType(SchemaEventTarget): inherit_schema: Any def __init__( self, - name: Any | None = ..., - schema: Any | None = ..., - metadata: Any | None = ..., + name: Incomplete | None = ..., + schema: Incomplete | None = ..., + metadata: Incomplete | None = ..., inherit_schema: bool = ..., - quote: Any | None = ..., + quote: Incomplete | None = ..., _create_events: bool = ..., ) -> None: ... def copy(self, **kw): ... def adapt(self, impltype, **kw): ... @property def bind(self): ... - def create(self, bind: Any | None = ..., checkfirst: bool = ...) -> None: ... - def drop(self, bind: Any | None = ..., checkfirst: bool = ...) -> None: ... + def create(self, bind: Incomplete | None = ..., checkfirst: bool = ...) -> None: ... + def drop(self, bind: Incomplete | None = ..., checkfirst: bool = ...) -> None: ... class Enum(Emulated, String, SchemaType): __visit_name__: str @@ -184,7 +191,9 @@ class PickleType(TypeDecorator): protocol: Any pickler: Any comparator: Any - def __init__(self, protocol=..., pickler: Any | None = ..., comparator: Any | None = ..., impl: Any | None = ...) -> None: ... + def __init__( + self, protocol=..., pickler: Incomplete | None = ..., comparator: Incomplete | None = ..., impl: Incomplete | None = ... + ) -> None: ... def __reduce__(self): ... def bind_processor(self, dialect): ... def result_processor(self, dialect, coltype): ... @@ -195,7 +204,7 @@ class Boolean(Emulated, TypeEngine, SchemaType): # type: ignore[misc] native: bool create_constraint: Any name: Any - def __init__(self, create_constraint: bool = ..., name: Any | None = ..., _create_events: bool = ...) -> None: ... + def __init__(self, create_constraint: bool = ..., name: Incomplete | None = ..., _create_events: bool = ...) -> None: ... @property def python_type(self): ... def literal_processor(self, dialect): ... @@ -212,7 +221,9 @@ class Interval(Emulated, _AbstractInterval, TypeDecorator): # type: ignore[misc native: Any second_precision: Any day_precision: Any - def __init__(self, native: bool = ..., second_precision: Any | None = ..., day_precision: Any | None = ...) -> None: ... + def __init__( + self, native: bool = ..., second_precision: Incomplete | None = ..., day_precision: Incomplete | None = ... + ) -> None: ... @property def python_type(self): ... def adapt_to_emulated(self, impltype, **kw): ... @@ -260,13 +271,15 @@ class ARRAY(SchemaEventTarget, Indexable, Concatenable, TypeEngine): class Comparator(Indexable.Comparator[_T], Concatenable.Comparator[_T], Generic[_T]): def contains(self, *arg, **kw) -> ColumnOperators[_T]: ... - def any(self, other, operator: Any | None = ...): ... - def all(self, other, operator: Any | None = ...): ... + def any(self, other, operator: Incomplete | None = ...): ... + def all(self, other, operator: Incomplete | None = ...): ... comparator_factory: Any item_type: Any as_tuple: Any dimensions: Any - def __init__(self, item_type, as_tuple: bool = ..., dimensions: Any | None = ..., zero_indexes: bool = ...) -> None: ... + def __init__( + self, item_type, as_tuple: bool = ..., dimensions: Incomplete | None = ..., zero_indexes: bool = ... + ) -> None: ... @property def hashable(self): ... @property diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/traversals.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/traversals.pyi index 4ce0715c4..0bd171287 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/traversals.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/traversals.pyi @@ -22,7 +22,7 @@ class HasCacheKey: class MemoizedHasCacheKey(HasCacheKey, HasMemoized): ... class CacheKey: - def __hash__(self): ... + def __hash__(self) -> int: ... def to_offline_string(self, statement_cache, statement, parameters): ... def __eq__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/type_api.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/type_api.pyi index 93d73afe9..dd3f84929 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/type_api.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/type_api.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any, Generic, TypeVar from .. import util @@ -47,7 +48,7 @@ class TypeEngine(Traversible): def dialect_impl(self, dialect): ... def adapt(self, cls, **kw): ... def coerce_compared_value(self, op, value): ... - def compile(self, dialect: Any | None = ...): ... + def compile(self, dialect: Incomplete | None = ...): ... class VisitableCheckKWArg(util.EnsureKWArgType, TraversibleType): ... @@ -83,7 +84,7 @@ class TypeDecorator(ExternalType, SchemaEventTarget, TypeEngine): def comparator_factory(self): ... def type_engine(self, dialect): ... def load_dialect_impl(self, dialect): ... - def __getattr__(self, key): ... + def __getattr__(self, key: str): ... def process_literal_param(self, value, dialect) -> None: ... def process_bind_param(self, value, dialect) -> None: ... def process_result_value(self, value, dialect) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/util.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/util.pyi index 78dd79992..8bf4c57f9 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/util.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/util.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from . import visitors @@ -41,15 +42,15 @@ class _repr_params(_repr_base): ismulti: Any batches: Any max_chars: Any - def __init__(self, params, batches, max_chars: int = ..., ismulti: Any | None = ...) -> None: ... + def __init__(self, params, batches, max_chars: int = ..., ismulti: Incomplete | None = ...) -> None: ... def adapt_criterion_to_null(crit, nulls): ... -def splice_joins(left, right, stop_on: Any | None = ...): ... +def splice_joins(left, right, stop_on: Incomplete | None = ...): ... def reduce_columns(columns, *clauses, **kw): ... def criterion_as_pairs( expression, - consider_as_foreign_keys: Any | None = ..., - consider_as_referenced_keys: Any | None = ..., + consider_as_foreign_keys: Incomplete | None = ..., + consider_as_referenced_keys: Incomplete | None = ..., any_operator: bool = ..., ): ... @@ -64,12 +65,12 @@ class ClauseAdapter(visitors.ReplacingExternalTraversal): def __init__( self, selectable, - equivalents: Any | None = ..., - include_fn: Any | None = ..., - exclude_fn: Any | None = ..., + equivalents: Incomplete | None = ..., + include_fn: Incomplete | None = ..., + exclude_fn: Incomplete | None = ..., adapt_on_names: bool = ..., anonymize_labels: bool = ..., - adapt_from_selectables: Any | None = ..., + adapt_from_selectables: Incomplete | None = ..., ) -> None: ... def replace(self, col, _include_singleton_constants: bool = ...): ... @@ -80,14 +81,14 @@ class ColumnAdapter(ClauseAdapter): def __init__( self, selectable, - equivalents: Any | None = ..., + equivalents: Incomplete | None = ..., adapt_required: bool = ..., - include_fn: Any | None = ..., - exclude_fn: Any | None = ..., + include_fn: Incomplete | None = ..., + exclude_fn: Incomplete | None = ..., adapt_on_names: bool = ..., allow_label_resolve: bool = ..., anonymize_labels: bool = ..., - adapt_from_selectables: Any | None = ..., + adapt_from_selectables: Incomplete | None = ..., ) -> None: ... class _IncludeExcludeMapping: diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/assertions.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/assertions.pyi index 024be0f28..e8366e906 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/assertions.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/assertions.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete def expect_warnings(*messages, **kw): ... def expect_warnings_on(db, *messages, **kw) -> None: ... @@ -8,64 +8,65 @@ def expect_deprecated_20(*messages, **kw): ... def emits_warning_on(db, *messages): ... def uses_deprecated(*messages): ... def global_cleanup_assertions() -> None: ... -def eq_regex(a, b, msg: Any | None = ...) -> None: ... -def eq_(a, b, msg: Any | None = ...) -> None: ... -def ne_(a, b, msg: Any | None = ...) -> None: ... -def le_(a, b, msg: Any | None = ...) -> None: ... -def is_instance_of(a, b, msg: Any | None = ...) -> None: ... -def is_none(a, msg: Any | None = ...) -> None: ... -def is_not_none(a, msg: Any | None = ...) -> None: ... -def is_true(a, msg: Any | None = ...) -> None: ... -def is_false(a, msg: Any | None = ...) -> None: ... -def is_(a, b, msg: Any | None = ...) -> None: ... -def is_not(a, b, msg: Any | None = ...) -> None: ... +def eq_regex(a, b, msg: Incomplete | None = ...) -> None: ... +def eq_(a, b, msg: Incomplete | None = ...) -> None: ... +def ne_(a, b, msg: Incomplete | None = ...) -> None: ... +def le_(a, b, msg: Incomplete | None = ...) -> None: ... +def is_instance_of(a, b, msg: Incomplete | None = ...) -> None: ... +def is_none(a, msg: Incomplete | None = ...) -> None: ... +def is_not_none(a, msg: Incomplete | None = ...) -> None: ... +def is_true(a, msg: Incomplete | None = ...) -> None: ... +def is_false(a, msg: Incomplete | None = ...) -> None: ... +def is_(a, b, msg: Incomplete | None = ...) -> None: ... +def is_not(a, b, msg: Incomplete | None = ...) -> None: ... is_not_ = is_not -def in_(a, b, msg: Any | None = ...) -> None: ... -def not_in(a, b, msg: Any | None = ...) -> None: ... +def in_(a, b, msg: Incomplete | None = ...) -> None: ... +def not_in(a, b, msg: Incomplete | None = ...) -> None: ... not_in_ = not_in -def startswith_(a, fragment, msg: Any | None = ...) -> None: ... -def eq_ignore_whitespace(a, b, msg: Any | None = ...) -> None: ... +def startswith_(a, fragment, msg: Incomplete | None = ...) -> None: ... +def eq_ignore_whitespace(a, b, msg: Incomplete | None = ...) -> None: ... def assert_raises(except_cls, callable_, *args, **kw): ... def assert_raises_context_ok(except_cls, callable_, *args, **kw): ... def assert_raises_message(except_cls, msg, callable_, *args, **kwargs): ... def assert_raises_message_context_ok(except_cls, msg, callable_, *args, **kwargs): ... class _ErrorContainer: - error: Any + error: Incomplete def expect_raises(except_cls, check_context: bool = ...): ... def expect_raises_message(except_cls, msg, check_context: bool = ...): ... class AssertsCompiledSQL: - test_statement: Any - supports_execution: Any + test_statement: Incomplete + supports_execution: Incomplete def assert_compile( self, clause, result, - params: Any | None = ..., - checkparams: Any | None = ..., + params: Incomplete | None = ..., + checkparams: Incomplete | None = ..., for_executemany: bool = ..., - check_literal_execute: Any | None = ..., - check_post_param: Any | None = ..., - dialect: Any | None = ..., - checkpositional: Any | None = ..., - check_prefetch: Any | None = ..., + check_literal_execute: Incomplete | None = ..., + check_post_param: Incomplete | None = ..., + dialect: Incomplete | None = ..., + checkpositional: Incomplete | None = ..., + check_prefetch: Incomplete | None = ..., use_default_dialect: bool = ..., allow_dialect_select: bool = ..., supports_default_values: bool = ..., supports_default_metavalue: bool = ..., literal_binds: bool = ..., render_postcompile: bool = ..., - schema_translate_map: Any | None = ..., + schema_translate_map: Incomplete | None = ..., render_schema_translate: bool = ..., - default_schema_name: Any | None = ..., + default_schema_name: Incomplete | None = ..., from_linting: bool = ..., - ): ... + check_param_order: bool = ..., + ) -> None: ... class ComparesTables: def assert_tables_equal(self, table, reflected_table, strict_types: bool = ...) -> None: ... @@ -76,7 +77,7 @@ class AssertsExecutionResults: def assert_list(self, result, class_, list_) -> None: ... def assert_row(self, class_, rowobj, desc) -> None: ... def assert_unordered_result(self, result, cls, *expected): ... - def sql_execution_asserter(self, db: Any | None = ...): ... + def sql_execution_asserter(self, db: Incomplete | None = ...): ... def assert_sql_execution(self, db, callable_, *rules): ... def assert_sql(self, db, callable_, rules): ... def assert_sql_count(self, db, callable_, count) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/assertsql.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/assertsql.pyi index 6e30c7727..c02391805 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/assertsql.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/assertsql.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any class AssertRule: @@ -13,7 +14,7 @@ class CursorSQL(SQLMatchRule): statement: Any params: Any consume_statement: Any - def __init__(self, statement, params: Any | None = ..., consume_statement: bool = ...) -> None: ... + def __init__(self, statement, params: Incomplete | None = ..., consume_statement: bool = ...) -> None: ... errormessage: Any is_consumed: bool def process_statement(self, execute_observed) -> None: ... @@ -22,7 +23,7 @@ class CompiledSQL(SQLMatchRule): statement: Any params: Any dialect: Any - def __init__(self, statement, params: Any | None = ..., dialect: str = ...) -> None: ... + def __init__(self, statement, params: Incomplete | None = ..., dialect: str = ...) -> None: ... is_consumed: bool errormessage: Any def process_statement(self, execute_observed) -> None: ... @@ -32,7 +33,7 @@ class RegexSQL(CompiledSQL): orig_regex: Any params: Any dialect: Any - def __init__(self, regex, params: Any | None = ..., dialect: str = ...) -> None: ... + def __init__(self, regex, params: Incomplete | None = ..., dialect: str = ...) -> None: ... class DialectSQL(CompiledSQL): ... @@ -76,7 +77,6 @@ class SQLCursorExecuteObserved: ... class SQLAsserter: accumulated: Any - def __init__(self) -> None: ... def assert_(self, *rules) -> None: ... def assert_engine(engine) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/engines.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/engines.pyi index 1ca2dff85..4f0abf918 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/engines.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/engines.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from collections.abc import Mapping from typing import Any, overload from typing_extensions import Literal @@ -10,7 +11,6 @@ class ConnectionKiller: proxy_refs: Any testing_engines: Any dbapi_connections: Any - def __init__(self) -> None: ... def add_pool(self, pool) -> None: ... def add_engine(self, engine, scope) -> None: ... def rollback_all(self) -> None: ... @@ -30,19 +30,19 @@ def assert_conns_closed(fn, *args, **kw) -> None: ... def rollback_open_connections(fn, *args, **kw) -> None: ... def close_first(fn, *args, **kw) -> None: ... def close_open_connections(fn, *args, **kw) -> None: ... -def all_dialects(exclude: Any | None = ...) -> None: ... +def all_dialects(exclude: Incomplete | None = ...) -> None: ... class ReconnectFixture: dbapi: Any connections: Any is_stopped: bool def __init__(self, dbapi) -> None: ... - def __getattr__(self, key): ... + def __getattr__(self, key: str): ... def connect(self, *args, **kwargs): ... def shutdown(self, stop: bool = ...) -> None: ... def restart(self) -> None: ... -def reconnecting_engine(url: Any | None = ..., options: Any | None = ...): ... +def reconnecting_engine(url: Incomplete | None = ..., options: Incomplete | None = ...): ... @overload def testing_engine( # type: ignore[misc] url: URL | str | None = ..., @@ -59,17 +59,17 @@ def testing_engine( asyncio: Literal[True] = ..., transfer_staticpool: bool = ..., ) -> AsyncEngine: ... -def mock_engine(dialect_name: Any | None = ...): ... +def mock_engine(dialect_name: Incomplete | None = ...): ... class DBAPIProxyCursor: engine: Any connection: Any cursor: Any def __init__(self, engine, conn, *args, **kwargs) -> None: ... - def execute(self, stmt, parameters: Any | None = ..., **kw): ... + def execute(self, stmt, parameters: Incomplete | None = ..., **kw): ... def executemany(self, stmt, params, **kw): ... def __iter__(self): ... - def __getattr__(self, key): ... + def __getattr__(self, key: str): ... class DBAPIProxyConnection: conn: Any @@ -78,6 +78,6 @@ class DBAPIProxyConnection: def __init__(self, engine, cursor_cls) -> None: ... def cursor(self, *args, **kwargs): ... def close(self) -> None: ... - def __getattr__(self, key): ... + def __getattr__(self, key: str): ... def proxying_engine(conn_cls=..., cursor_cls=...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/entities.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/entities.pyi index 0afb34e39..514288954 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/entities.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/entities.pyi @@ -6,4 +6,4 @@ class ComparableMixin: def __eq__(self, other): ... class ComparableEntity(ComparableMixin, BasicEntity): - def __hash__(self): ... + def __hash__(self) -> int: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/exclusions.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/exclusions.pyi index 4cc9913e6..7041a0266 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/exclusions.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/exclusions.pyi @@ -1,13 +1,13 @@ +from _typeshed import Incomplete from typing import Any -def skip_if(predicate, reason: Any | None = ...): ... -def fails_if(predicate, reason: Any | None = ...): ... +def skip_if(predicate, reason: Incomplete | None = ...): ... +def fails_if(predicate, reason: Incomplete | None = ...): ... class compound: fails: Any skips: Any tags: Any - def __init__(self) -> None: ... def __add__(self, other): ... def as_skips(self): ... def add(self, *others): ... @@ -22,17 +22,17 @@ class compound: def requires_tag(tagname): ... def tags(tagnames): ... -def only_if(predicate, reason: Any | None = ...): ... -def succeeds_if(predicate, reason: Any | None = ...): ... +def only_if(predicate, reason: Incomplete | None = ...): ... +def succeeds_if(predicate, reason: Incomplete | None = ...): ... class Predicate: @classmethod - def as_predicate(cls, predicate, description: Any | None = ...): ... + def as_predicate(cls, predicate, description: Incomplete | None = ...): ... class BooleanPredicate(Predicate): value: Any description: Any - def __init__(self, value, description: Any | None = ...) -> None: ... + def __init__(self, value, description: Incomplete | None = ...) -> None: ... def __call__(self, config): ... class SpecPredicate(Predicate): @@ -40,7 +40,9 @@ class SpecPredicate(Predicate): op: Any spec: Any description: Any - def __init__(self, db, op: Any | None = ..., spec: Any | None = ..., description: Any | None = ...) -> None: ... + def __init__( + self, db, op: Incomplete | None = ..., spec: Incomplete | None = ..., description: Incomplete | None = ... + ) -> None: ... def __call__(self, config): ... class LambdaPredicate(Predicate): @@ -48,29 +50,31 @@ class LambdaPredicate(Predicate): args: Any kw: Any description: Any - def __init__(self, lambda_, description: Any | None = ..., args: Any | None = ..., kw: Any | None = ...): ... + def __init__( + self, lambda_, description: Incomplete | None = ..., args: Incomplete | None = ..., kw: Incomplete | None = ... + ): ... def __call__(self, config): ... class NotPredicate(Predicate): predicate: Any description: Any - def __init__(self, predicate, description: Any | None = ...) -> None: ... + def __init__(self, predicate, description: Incomplete | None = ...) -> None: ... def __call__(self, config): ... class OrPredicate(Predicate): predicates: Any description: Any - def __init__(self, predicates, description: Any | None = ...) -> None: ... + def __init__(self, predicates, description: Incomplete | None = ...) -> None: ... def __call__(self, config): ... def db_spec(*dbs): ... def open(): ... def closed(): ... -def fails(reason: Any | None = ...): ... +def fails(reason: Incomplete | None = ...): ... def future(fn, *arg): ... -def fails_on(db, reason: Any | None = ...): ... +def fails_on(db, reason: Incomplete | None = ...): ... def fails_on_everything_except(*dbs): ... -def skip(db, reason: Any | None = ...): ... -def only_on(dbs, reason: Any | None = ...): ... -def exclude(db, op, spec, reason: Any | None = ...): ... +def skip(db, reason: Incomplete | None = ...): ... +def only_on(dbs, reason: Incomplete | None = ...): ... +def exclude(db, op, spec, reason: Incomplete | None = ...): ... def against(config, *queries): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/fixtures.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/fixtures.pyi index 58c6be2e8..817046c91 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/fixtures.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/fixtures.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from . import assertions @@ -9,7 +10,7 @@ class TestBase: __only_on__: Any __skip_if__: Any __leave_connections_for_teardown__: bool - def assert_(self, val, msg: Any | None = ...) -> None: ... + def assert_(self, val, msg: Incomplete | None = ...) -> None: ... def connection_no_trans(self) -> None: ... def connection(self) -> None: ... def registry(self, metadata) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/pickleable.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/pickleable.pyi index 59664bd63..a66684a80 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/pickleable.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/pickleable.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from . import fixtures @@ -14,7 +15,7 @@ class Parent(fixtures.ComparableEntity): ... class Screen: obj: Any parent: Any - def __init__(self, obj, parent: Any | None = ...) -> None: ... + def __init__(self, obj, parent: Incomplete | None = ...) -> None: ... class Foo: data: str @@ -50,13 +51,13 @@ class BarWithoutCompare: class NotComparable: data: Any def __init__(self, data) -> None: ... - def __hash__(self): ... + def __hash__(self) -> int: ... def __eq__(self, other): ... def __ne__(self, other): ... class BrokenComparable: data: Any def __init__(self, data) -> None: ... - def __hash__(self): ... + def __hash__(self) -> int: ... def __eq__(self, other): ... def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/plugin/pytestplugin.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/plugin/pytestplugin.pyi index ded604f35..bfdd0245e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/plugin/pytestplugin.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/plugin/pytestplugin.pyi @@ -1,9 +1,8 @@ -from typing import Any +from typing_extensions import Final from . import plugin_base -has_xdist: bool -py2k: Any +py2k: Final = False def pytest_addoption(parser) -> None: ... def pytest_configure(config) -> None: ... @@ -14,8 +13,6 @@ def collect_types_fixture() -> None: ... def pytest_sessionstart(session) -> None: ... def pytest_sessionfinish(session) -> None: ... def pytest_collection_finish(session): ... -def pytest_configure_node(node) -> None: ... -def pytest_testnodedown(node, error) -> None: ... def pytest_collection_modifyitems(session, config, items): ... def pytest_pycollect_makeitem(collector, name, obj): ... def pytest_runtest_setup(item) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/profiling.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/profiling.pyi index ff48b0d7e..5d3f8927d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/profiling.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/profiling.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any class ProfileStatsFile: @@ -8,7 +9,7 @@ class ProfileStatsFile: data: Any dump: Any sort: Any - def __init__(self, filename, sort: str = ..., dump: Any | None = ...): ... + def __init__(self, filename, sort: str = ..., dump: Incomplete | None = ...): ... @property def platform_key(self): ... def has_stats(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi index ec8c6487d..a6c48328b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi @@ -5,7 +5,6 @@ FOLLOWER_IDENT: Any class register: fns: Any - def __init__(self) -> None: ... @classmethod def init(cls, fn): ... def for_db(self, *dbnames): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/util.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/util.pyi index e716d838a..0da8a3883 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/util.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/util.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any def non_refcount_gc_collect(*args) -> None: ... # only present on Python implementations with non-refcount gc @@ -29,10 +30,10 @@ def metadata_fixture(ddl: str = ...): ... def force_drop_names(*names): ... class adict(dict[Any, Any]): - def __getattribute__(self, key): ... + def __getattribute__(self, key: str): ... def __call__(self, *keys): ... get_all: Any def drop_all_tables_from_metadata(metadata, engine_or_connection) -> None: ... -def drop_all_tables(engine, inspector, schema: Any | None = ..., include_names: Any | None = ...) -> None: ... +def drop_all_tables(engine, inspector, schema: Incomplete | None = ..., include_names: Incomplete | None = ...) -> None: ... def teardown_events(event_cls): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi index 1a8acae9c..9e197be62 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi @@ -1,7 +1,8 @@ import collections.abc -from _typeshed import Self, SupportsKeysAndGetItem +from _typeshed import Incomplete, SupportsKeysAndGetItem, Unused from collections.abc import Callable, Iterable, Iterator, Mapping from typing import Any, Generic, NoReturn, TypeVar, overload +from typing_extensions import Self from ..cimmutabledict import immutabledict as immutabledict @@ -15,9 +16,9 @@ collections_abc = collections.abc EMPTY_SET: frozenset[Any] class ImmutableContainer: - def __delitem__(self, *arg: object, **kw: object) -> NoReturn: ... - def __setitem__(self, *arg: object, **kw: object) -> NoReturn: ... - def __setattr__(self, *arg: object, **kw: object) -> NoReturn: ... + def __delitem__(self, *arg: Unused, **kw: Unused) -> NoReturn: ... + def __setitem__(self, *arg: Unused, **kw: Unused) -> NoReturn: ... + def __setattr__(self, *arg: Unused, **kw: Unused) -> NoReturn: ... @overload def coerce_to_immutabledict(d: None) -> immutabledict[Any, Any]: ... @@ -67,7 +68,7 @@ class ImmutableProperties(ImmutableContainer, Properties[_T], Generic[_T]): ... OrderedDict = dict -def sort_dictionary(d, key: Any | None = ...): ... +def sort_dictionary(d, key: Incomplete | None = ...): ... class OrderedSet(set[_T], Generic[_T]): @overload @@ -82,25 +83,25 @@ class OrderedSet(set[_T], Generic[_T]): def __getitem__(self, key: int) -> _T: ... def __iter__(self) -> Iterator[_T]: ... def __add__(self, other: Iterable[_S]) -> OrderedSet[_S | _T]: ... - def update(self: Self, iterable: Iterable[_T]) -> Self: ... # type: ignore[override] + def update(self, iterable: Iterable[_T]) -> Self: ... # type: ignore[override] __ior__ = update # type: ignore[assignment] def union(self, other: Iterable[_S]) -> OrderedSet[_S | _T]: ... # type: ignore[override] - __or__ = union # type: ignore[assignment] - def intersection(self: Self, other: Iterable[Any]) -> Self: ... # type: ignore[override] - __and__ = intersection # type: ignore[assignment] + __or__ = union # type: ignore[assignment] # pyright: ignore[reportGeneralTypeIssues] + def intersection(self, other: Iterable[Any]) -> Self: ... # type: ignore[override] + __and__ = intersection def symmetric_difference(self, other: Iterable[_S]) -> OrderedSet[_S | _T]: ... - __xor__ = symmetric_difference # type: ignore[assignment] - def difference(self: Self, other: Iterable[Any]) -> Self: ... # type: ignore[override] - __sub__ = difference # type: ignore[assignment] - def intersection_update(self: Self, other: Iterable[Any]) -> Self: ... # type: ignore[override] + __xor__ = symmetric_difference # type: ignore[assignment] # pyright: ignore[reportGeneralTypeIssues] + def difference(self, other: Iterable[Any]) -> Self: ... # type: ignore[override] + __sub__ = difference + def intersection_update(self, other: Iterable[Any]) -> Self: ... # type: ignore[override] __iand__ = intersection_update # type: ignore[assignment] - def symmetric_difference_update(self: Self, other: Iterable[_T]) -> Self: ... # type: ignore[override] + def symmetric_difference_update(self, other: Iterable[_T]) -> Self: ... # type: ignore[override] __ixor__ = symmetric_difference_update # type: ignore[assignment] - def difference_update(self: Self, other: Iterable[Any]) -> Self: ... # type: ignore[override] + def difference_update(self, other: Iterable[Any]) -> Self: ... # type: ignore[override] __isub__ = difference_update # type: ignore[assignment] class IdentitySet: - def __init__(self, iterable: Any | None = ...) -> None: ... + def __init__(self, iterable: Incomplete | None = ...) -> None: ... def add(self, value) -> None: ... def __contains__(self, value): ... def remove(self, value) -> None: ... @@ -134,19 +135,19 @@ class IdentitySet: def __ixor__(self, other): ... def copy(self): ... __copy__: Any - def __len__(self): ... + def __len__(self) -> int: ... def __iter__(self): ... - def __hash__(self): ... + def __hash__(self) -> int: ... class WeakSequence: def __init__(self, __elements=...) -> None: ... def append(self, item) -> None: ... - def __len__(self): ... + def __len__(self) -> int: ... def __iter__(self): ... def __getitem__(self, index): ... class OrderedIdentitySet(IdentitySet): - def __init__(self, iterable: Any | None = ...) -> None: ... + def __init__(self, iterable: Incomplete | None = ...) -> None: ... class PopulateDict(dict[Any, Any]): creator: Any @@ -171,24 +172,24 @@ def unique_list(seq: Iterable[_T], hashfunc: Callable[[_T], Any] | None = ...) - class UniqueAppender: data: Any - def __init__(self, data, via: Any | None = ...) -> None: ... + def __init__(self, data, via: Incomplete | None = ...) -> None: ... def append(self, item) -> None: ... def __iter__(self): ... def coerce_generator_arg(arg): ... -def to_list(x, default: Any | None = ...): ... +def to_list(x, default: Incomplete | None = ...): ... def has_intersection(set_, iterable): ... def to_set(x): ... def to_column_set(x): ... -def update_copy(d, _new: Any | None = ..., **kw): ... +def update_copy(d, _new: Incomplete | None = ..., **kw): ... def flatten_iterator(x) -> None: ... class LRUCache(dict[Any, Any]): capacity: Any threshold: Any size_alert: Any - def __init__(self, capacity: int = ..., threshold: float = ..., size_alert: Any | None = ...) -> None: ... - def get(self, key, default: Any | None = ...): ... + def __init__(self, capacity: int = ..., threshold: float = ..., size_alert: Incomplete | None = ...) -> None: ... + def get(self, key, default: Incomplete | None = ...): ... def __getitem__(self, key): ... def values(self): ... def setdefault(self, key, value): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/_compat_py3k.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/_compat_py3k.pyi index d23165bf6..7f453b9db 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/_compat_py3k.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/_compat_py3k.pyi @@ -1,3 +1,4 @@ +from types import TracebackType from typing import Any class _AsyncGeneratorContextManager: @@ -5,6 +6,8 @@ class _AsyncGeneratorContextManager: __doc__: Any def __init__(self, func, args, kwds) -> None: ... async def __aenter__(self): ... - async def __aexit__(self, typ, value, traceback): ... + async def __aexit__( + self, typ: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None + ) -> bool | None: ... def asynccontextmanager(func): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/_concurrency_py3k.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/_concurrency_py3k.pyi index 702ef9ea1..502245182 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/_concurrency_py3k.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/_concurrency_py3k.pyi @@ -1,19 +1,11 @@ import asyncio as asyncio +from _typeshed import Unused from collections.abc import Callable, Coroutine from typing import Any -from typing_extensions import TypeAlias from .langhelpers import memoized_property -_Greenlet: TypeAlias = Any # actually greenlet.greenlet - def is_exit_exception(e): ... - -class _AsyncIoGreenlet(_Greenlet): - driver: Any - gr_context: Any - def __init__(self, fn, driver) -> None: ... - def await_only(awaitable: Coroutine[Any, Any, Any]) -> Any: ... def await_fallback(awaitable: Coroutine[Any, Any, Any]) -> Any: ... async def greenlet_spawn(fn: Callable[..., Any], *args, _require_await: bool = ..., **kwargs) -> Any: ... @@ -22,6 +14,6 @@ class AsyncAdaptedLock: @memoized_property def mutex(self): ... def __enter__(self): ... - def __exit__(self, *arg, **kw) -> None: ... + def __exit__(self, *arg: Unused, **kw: Unused) -> None: ... def get_event_loop(): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/compat.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/compat.pyi index cd2df046e..5368e9e3f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/compat.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/compat.pyi @@ -5,6 +5,7 @@ import itertools import operator import pickle as pickle import threading as threading +from _typeshed import Incomplete, Unused from abc import ABC as ABC from datetime import timezone as timezone from functools import reduce as reduce @@ -12,6 +13,7 @@ from io import BytesIO as BytesIO, StringIO as StringIO from itertools import zip_longest as zip_longest from time import perf_counter as perf_counter from typing import TYPE_CHECKING as TYPE_CHECKING, Any, NamedTuple +from typing_extensions import Literal from urllib.parse import ( parse_qsl as parse_qsl, quote as quote, @@ -22,17 +24,17 @@ from urllib.parse import ( byte_buffer = BytesIO -py39: Any -py38: Any -py37: Any -py3k: Any -py2k: Any -pypy: Any -cpython: Any -win32: Any -osx: Any -arm: Any -has_refcount_gc: Any +py39: bool +py38: bool +py37: bool +py3k: Literal[True] +py2k: Literal[False] +pypy: bool +cpython: bool +win32: bool +osx: bool +arm: bool +has_refcount_gc: bool contextmanager = contextlib.contextmanager dottedgetter = operator.attrgetter namedtuple = collections.namedtuple # noqa: Y024 @@ -49,9 +51,9 @@ class FullArgSpec(NamedTuple): class nullcontext: enter_result: Any - def __init__(self, enter_result: Any | None = ...) -> None: ... + def __init__(self, enter_result: Incomplete | None = ...) -> None: ... def __enter__(self): ... - def __exit__(self, *excinfo) -> None: ... + def __exit__(self, *excinfo: Unused) -> None: ... def inspect_getfullargspec(func): ... def importlib_metadata_get(group): ... @@ -75,7 +77,9 @@ def b64decode(x): ... def b64encode(x): ... def decode_backslashreplace(text, encoding): ... def cmp(a, b): ... -def raise_(exception, with_traceback: Any | None = ..., replace_context: Any | None = ..., from_: bool = ...) -> None: ... +def raise_( + exception, with_traceback: Incomplete | None = ..., replace_context: Incomplete | None = ..., from_: bool = ... +) -> None: ... def u(s): ... def ue(s): ... @@ -84,9 +88,9 @@ callable = builtins.callable def safe_bytestring(text): ... def inspect_formatargspec( args, - varargs: Any | None = ..., - varkw: Any | None = ..., - defaults: Any | None = ..., + varargs: Incomplete | None = ..., + varkw: Incomplete | None = ..., + defaults: Incomplete | None = ..., kwonlyargs=..., kwonlydefaults=..., annotations=..., @@ -99,6 +103,6 @@ def inspect_formatargspec( ): ... def dataclass_fields(cls): ... def local_dataclass_fields(cls): ... -def raise_from_cause(exception, exc_info: Any | None = ...) -> None: ... -def reraise(tp, value, tb: Any | None = ..., cause: Any | None = ...) -> None: ... +def raise_from_cause(exception, exc_info: Incomplete | None = ...) -> None: ... +def reraise(tp, value, tb: Incomplete | None = ..., cause: Incomplete | None = ...) -> None: ... def with_metaclass(meta, *bases, **kw): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/concurrency.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/concurrency.pyi index 40fbc5750..7fe1879c1 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/concurrency.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/concurrency.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete from ._compat_py3k import asynccontextmanager as asynccontextmanager from ._concurrency_py3k import ( @@ -10,4 +10,4 @@ from ._concurrency_py3k import ( ) have_greenlet: bool -asyncio: Any | None +asyncio: Incomplete | None diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/deprecations.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/deprecations.pyi index 73f7d1722..ca733b24a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/deprecations.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/deprecations.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete from .langhelpers import ( decorator as decorator, @@ -8,18 +8,18 @@ from .langhelpers import ( SQLALCHEMY_WARN_20: bool -def warn_deprecated(msg, version, stacklevel: int = ..., code: Any | None = ...) -> None: ... -def warn_deprecated_limited(msg, args, version, stacklevel: int = ..., code: Any | None = ...) -> None: ... -def warn_deprecated_20(msg, stacklevel: int = ..., code: Any | None = ...) -> None: ... +def warn_deprecated(msg, version, stacklevel: int = ..., code: Incomplete | None = ...) -> None: ... +def warn_deprecated_limited(msg, args, version, stacklevel: int = ..., code: Incomplete | None = ...) -> None: ... +def warn_deprecated_20(msg, stacklevel: int = ..., code: Incomplete | None = ...) -> None: ... def deprecated_cls(version, message, constructor: str = ...): ... -def deprecated_20_cls(clsname, alternative: Any | None = ..., constructor: str = ..., becomes_legacy: bool = ...): ... +def deprecated_20_cls(clsname, alternative: Incomplete | None = ..., constructor: str = ..., becomes_legacy: bool = ...): ... def deprecated( version, - message: Any | None = ..., + message: Incomplete | None = ..., add_deprecation_to_docstring: bool = ..., - warning: Any | None = ..., + warning: Incomplete | None = ..., enable_warnings: bool = ..., ): ... def moved_20(message, **kw): ... -def deprecated_20(api_name, alternative: Any | None = ..., becomes_legacy: bool = ..., **kw): ... +def deprecated_20(api_name, alternative: Incomplete | None = ..., becomes_legacy: bool = ..., **kw): ... def deprecated_params(**specs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi index 8a01199f9..021eee885 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi @@ -1,6 +1,8 @@ -from _typeshed import Self +from _typeshed import Incomplete, Unused from collections.abc import Callable +from types import TracebackType from typing import Any, Generic, TypeVar, overload +from typing_extensions import Self from . import compat @@ -12,7 +14,9 @@ class safe_reraise: warn_only: Any def __init__(self, warn_only: bool = ...) -> None: ... def __enter__(self) -> None: ... - def __exit__(self, type_, value, traceback) -> None: ... + def __exit__( + self, type_: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None + ) -> None: ... def walk_subclasses(cls) -> None: ... def string_or_unprintable(element): ... @@ -21,18 +25,18 @@ def method_is_overridden(instance_or_cls, against_method): ... def decode_slice(slc): ... def map_bits(fn, n) -> None: ... def decorator(target): ... -def public_factory(target, location, class_location: Any | None = ...): ... +def public_factory(target, location, class_location: Incomplete | None = ...): ... class PluginLoader: group: Any impls: Any auto_fn: Any - def __init__(self, group, auto_fn: Any | None = ...) -> None: ... + def __init__(self, group, auto_fn: Incomplete | None = ...) -> None: ... def clear(self) -> None: ... def load(self, name): ... def register(self, name, modulepath, objname): ... -def get_cls_kwargs(cls, _set: Any | None = ...): ... +def get_cls_kwargs(cls, _set: Incomplete | None = ...): ... def get_func_kwargs(func): ... def get_callable_argspec(fn, no_self: bool = ..., _is_init: bool = ...): ... def format_argspec_plus(fn, grouped: bool = ...): ... @@ -42,7 +46,7 @@ def create_proxy_methods( ): ... def getargspec_init(method): ... def unbound_method_to_callable(func_or_cls): ... -def generic_repr(obj, additional_kw=..., to_inspect: Any | None = ..., omit_kwarg=...): ... +def generic_repr(obj, additional_kw=..., to_inspect: Incomplete | None = ..., omit_kwarg=...): ... class portable_instancemethod: target: Any @@ -54,10 +58,15 @@ class portable_instancemethod: def class_hierarchy(cls): ... def iterate_attributes(cls) -> None: ... def monkeypatch_proxied_specials( - into_cls, from_cls, skip: Any | None = ..., only: Any | None = ..., name: str = ..., from_instance: Any | None = ... + into_cls, + from_cls, + skip: Incomplete | None = ..., + only: Incomplete | None = ..., + name: str = ..., + from_instance: Incomplete | None = ..., ) -> None: ... def methods_equivalent(meth1, meth2): ... -def as_interface(obj, cls: Any | None = ..., methods: Any | None = ..., required: Any | None = ...): ... +def as_interface(obj, cls: Incomplete | None = ..., methods: Incomplete | None = ..., required: Incomplete | None = ...): ... class memoized_property(Generic[_R]): fget: Callable[..., _R] @@ -65,9 +74,9 @@ class memoized_property(Generic[_R]): __name__: str def __init__(self, fget: Callable[..., _R], doc: str | None = ...) -> None: ... @overload - def __get__(self: Self, obj: None, cls: object) -> Self: ... + def __get__(self, obj: None, cls: Unused) -> Self: ... @overload - def __get__(self, obj: object, cls: object) -> _R: ... + def __get__(self, obj: object, cls: Unused) -> _R: ... @classmethod def reset(cls, obj: object, name: str) -> None: ... @@ -80,24 +89,24 @@ class HasMemoized: __name__: str def __init__(self, fget: Callable[..., _R], doc: str | None = ...) -> None: ... @overload - def __get__(self: Self, obj: None, cls: object) -> Self: ... + def __get__(self, obj: None, cls: Unused) -> Self: ... @overload - def __get__(self, obj: object, cls: object) -> _R: ... + def __get__(self, obj: object, cls: Unused) -> _R: ... @classmethod def memoized_instancemethod(cls, fn): ... class MemoizedSlots: - def __getattr__(self, key): ... + def __getattr__(self, key: str): ... def asbool(obj): ... def bool_or_str(*text): ... def asint(value): ... -def coerce_kw_type(kw, key, type_, flexi_bool: bool = ..., dest: Any | None = ...) -> None: ... +def coerce_kw_type(kw, key, type_, flexi_bool: bool = ..., dest: Incomplete | None = ...) -> None: ... def constructor_key(obj, cls): ... def constructor_copy(obj, cls, *args, **kw): ... def counter(): ... -def duck_type_collection(specimen, default: Any | None = ...): ... +def duck_type_collection(specimen, default: Incomplete | None = ...): ... def assert_arg_type(arg, argtype, name): ... def dictlike_iteritems(dictlike): ... @@ -114,7 +123,7 @@ class hybridproperty(Generic[_R]): def __get__(self, instance: None, owner: Any) -> _R: ... @overload def __get__(self, instance: object, owner: object) -> _R: ... - def classlevel(self: Self, func: Callable[..., _R]) -> Self: ... + def classlevel(self, func: Callable[..., _R]) -> Self: ... class hybridmethod: func: Any @@ -124,12 +133,12 @@ class hybridmethod: def classlevel(self, func): ... class _symbol(int): - def __new__(cls, name, doc: Any | None = ..., canonical: Any | None = ...): ... + def __new__(cls, name, doc: Incomplete | None = ..., canonical: Incomplete | None = ...): ... def __reduce__(self): ... class symbol: symbols: Any - def __new__(cls, name, doc: Any | None = ..., canonical: Any | None = ...): ... + def __new__(cls, name, doc: Incomplete | None = ..., canonical: Incomplete | None = ...): ... @classmethod def parse_user_argument(cls, arg, choices, name, resolve_symbol_names: bool = ...): ... @@ -139,10 +148,10 @@ def ellipses_string(value, len_: int = ...): ... class _hash_limit_string(compat.text_type): def __new__(cls, value, num, args): ... - def __hash__(self): ... + def __hash__(self) -> int: ... def __eq__(self, other): ... -def warn(msg, code: Any | None = ...) -> None: ... +def warn(msg, code: Incomplete | None = ...) -> None: ... def warn_limited(msg, args) -> None: ... def only_once(fn, retry_on_exception): ... def chop_traceback(tb, exclude_prefix=..., exclude_suffix=...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/queue.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/queue.pyi index d7b986a37..7a26c25d7 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/queue.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/queue.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any class Empty(Exception): ... @@ -12,9 +13,9 @@ class Queue: def qsize(self): ... def empty(self): ... def full(self): ... - def put(self, item, block: bool = ..., timeout: Any | None = ...) -> None: ... + def put(self, item, block: bool = ..., timeout: Incomplete | None = ...) -> None: ... def put_nowait(self, item): ... - def get(self, block: bool = ..., timeout: Any | None = ...): ... + def get(self, block: bool = ..., timeout: Incomplete | None = ...): ... def get_nowait(self): ... class AsyncAdaptedQueue: @@ -26,9 +27,9 @@ class AsyncAdaptedQueue: def full(self): ... def qsize(self): ... def put_nowait(self, item): ... - def put(self, item, block: bool = ..., timeout: Any | None = ...): ... + def put(self, item, block: bool = ..., timeout: Incomplete | None = ...): ... def get_nowait(self): ... - def get(self, block: bool = ..., timeout: Any | None = ...): ... + def get(self, block: bool = ..., timeout: Incomplete | None = ...): ... class FallbackAsyncAdaptedQueue(AsyncAdaptedQueue): await_: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Send2Trash/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/Send2Trash/METADATA.toml index 690242a33..ee7e83f3e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Send2Trash/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/Send2Trash/METADATA.toml @@ -1 +1,4 @@ version = "1.8.*" + +[tool.stubtest] +ignore_missing_stub = true diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Send2Trash/send2trash/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Send2Trash/send2trash/__init__.pyi index 5fa3c599c..9ff00ba71 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Send2Trash/send2trash/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Send2Trash/send2trash/__init__.pyi @@ -1,4 +1,4 @@ -from _typeshed import StrOrBytesPath +from _typeshed import Incomplete, StrOrBytesPath from typing import Any from .exceptions import TrashPermissionError as TrashPermissionError @@ -7,4 +7,4 @@ from .exceptions import TrashPermissionError as TrashPermissionError def send2trash(paths: list[Any] | StrOrBytesPath) -> None: ... # Marked as incomplete because there are platform-specific plat_foo modules -def __getattr__(name: str) -> Any: ... # incomplete +def __getattr__(name: str) -> Incomplete: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Send2Trash/send2trash/compat.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Send2Trash/send2trash/compat.pyi index 91e2bc4de..e148e3523 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Send2Trash/send2trash/compat.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Send2Trash/send2trash/compat.pyi @@ -1,6 +1,7 @@ from typing import Any +from typing_extensions import Literal -PY3: Any +PY3: Literal[True] text_type = str binary_type = bytes environb: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Send2Trash/send2trash/exceptions.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Send2Trash/send2trash/exceptions.pyi index 7e2ca98b7..a263f6551 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Send2Trash/send2trash/exceptions.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Send2Trash/send2trash/exceptions.pyi @@ -1,2 +1,5 @@ +from typing import Any + class TrashPermissionError(PermissionError): - def __init__(self, filename) -> None: ... + # Typed the same as `filename` in `PermissionError`: + def __init__(self, filename: Any) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Send2Trash/send2trash/util.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Send2Trash/send2trash/util.pyi index e23e382a3..c89143c4f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Send2Trash/send2trash/util.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Send2Trash/send2trash/util.pyi @@ -1 +1,5 @@ -def preprocess_paths(paths): ... +from _typeshed import StrOrBytesPath +from typing import Any + +# Should be consistent with `__init__.py` +def preprocess_paths(paths: list[Any] | StrOrBytesPath) -> list[str | bytes]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/aiofiles/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/aiofiles/METADATA.toml index 29511ee7d..156974ce2 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/aiofiles/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/aiofiles/METADATA.toml @@ -1 +1,5 @@ -version = "0.8.*" +version = "23.1.*" + +[tool.stubtest] +# linux and darwin are equivalent +platforms = ["linux", "win32"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/aiofiles/aiofiles/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/aiofiles/aiofiles/__init__.pyi index 468393cba..bc52b8e0c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/aiofiles/aiofiles/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/aiofiles/aiofiles/__init__.pyi @@ -1,2 +1,10 @@ from . import tempfile as tempfile -from .threadpool import open as open +from .threadpool import ( + open as open, + stderr as stderr, + stderr_bytes as stderr_bytes, + stdin as stdin, + stdin_bytes as stdin_bytes, + stdout as stdout, + stdout_bytes as stdout_bytes, +) diff --git a/packages/pyright-internal/typeshed-fallback/stubs/aiofiles/aiofiles/base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/aiofiles/aiofiles/base.pyi index 8919031e2..2cf93d4e7 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/aiofiles/aiofiles/base.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/aiofiles/aiofiles/base.pyi @@ -1,7 +1,7 @@ -from _typeshed import Self -from collections.abc import Coroutine, Generator, Iterator +from collections.abc import Callable, Coroutine, Generator, Iterator from types import CodeType, FrameType, TracebackType, coroutine -from typing import Any, Generic, TypeVar +from typing import Any, BinaryIO, Generic, TextIO, TypeVar +from typing_extensions import Self _T = TypeVar("_T") _T_co = TypeVar("_T_co", covariant=True) @@ -10,9 +10,12 @@ _T_contra = TypeVar("_T_contra", contravariant=True) class AsyncBase(Generic[_T]): def __init__(self, file: str, loop: Any, executor: Any) -> None: ... - def __aiter__(self: Self) -> Self: ... + def __aiter__(self) -> Self: ... async def __anext__(self) -> _T: ... +class AsyncIndirectBase(AsyncBase[_T]): + def __init__(self, name: str, loop: Any, executor: Any, indirect: Callable[[], TextIO | BinaryIO]) -> None: ... + class AiofilesContextManager(Generic[_T_co, _T_contra, _V_co]): def __init__(self, coro: Coroutine[_T_co, _T_contra, _V_co]) -> None: ... def send(self, value: _T_contra) -> _T_co: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/aiofiles/aiofiles/os.pyi b/packages/pyright-internal/typeshed-fallback/stubs/aiofiles/aiofiles/os.pyi index 7e3f63e02..e7d3edb47 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/aiofiles/aiofiles/os.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/aiofiles/aiofiles/os.pyi @@ -1,19 +1,16 @@ import sys -from _typeshed import StrOrBytesPath +from _typeshed import FileDescriptorOrPath, GenericPath, StrOrBytesPath from asyncio.events import AbstractEventLoop from collections.abc import Sequence -from os import stat_result -from typing import Any, overload -from typing_extensions import TypeAlias +from os import _ScandirIterator, stat_result +from typing import Any, AnyStr, overload -from . import ospath +from aiofiles import ospath path = ospath -_FdOrAnyPath: TypeAlias = int | StrOrBytesPath - async def stat( - path: _FdOrAnyPath, # noqa: F811 + path: FileDescriptorOrPath, *, dir_fd: int | None = ..., follow_symlinks: bool = ..., @@ -39,23 +36,26 @@ async def replace( executor: Any = ..., ) -> None: ... async def remove( - path: StrOrBytesPath, *, dir_fd: int | None = ..., loop: AbstractEventLoop | None = ..., executor: Any = ... # noqa: F811 + path: StrOrBytesPath, *, dir_fd: int | None = ..., loop: AbstractEventLoop | None = ..., executor: Any = ... ) -> None: ... async def mkdir( - path: StrOrBytesPath, # noqa: F811 - mode: int = ..., - *, - dir_fd: int | None = ..., - loop: AbstractEventLoop | None = ..., - executor: Any = ..., + path: StrOrBytesPath, mode: int = ..., *, dir_fd: int | None = ..., loop: AbstractEventLoop | None = ..., executor: Any = ... ) -> None: ... async def makedirs( name: StrOrBytesPath, mode: int = ..., exist_ok: bool = ..., *, loop: AbstractEventLoop | None = ..., executor: Any = ... ) -> None: ... async def rmdir( - path: StrOrBytesPath, *, dir_fd: int | None = ..., loop: AbstractEventLoop | None = ..., executor: Any = ... # noqa: F811 + path: StrOrBytesPath, *, dir_fd: int | None = ..., loop: AbstractEventLoop | None = ..., executor: Any = ... ) -> None: ... async def removedirs(name: StrOrBytesPath, *, loop: AbstractEventLoop | None = ..., executor: Any = ...) -> None: ... +@overload +async def scandir(path: None = ..., *, loop: AbstractEventLoop | None = ..., executor: Any = ...) -> _ScandirIterator[str]: ... +@overload +async def scandir(path: int, *, loop: AbstractEventLoop | None = ..., executor: Any = ...) -> _ScandirIterator[str]: ... +@overload +async def scandir( + path: GenericPath[AnyStr], *, loop: AbstractEventLoop | None = ..., executor: Any = ... +) -> _ScandirIterator[AnyStr]: ... if sys.platform != "win32": @overload diff --git a/packages/pyright-internal/typeshed-fallback/stubs/aiofiles/aiofiles/ospath.pyi b/packages/pyright-internal/typeshed-fallback/stubs/aiofiles/aiofiles/ospath.pyi index 4b5735cfa..e58e72898 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/aiofiles/aiofiles/ospath.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/aiofiles/aiofiles/ospath.pyi @@ -1,15 +1,15 @@ -from _typeshed import StrOrBytesPath +from _typeshed import FileDescriptorOrPath from asyncio.events import AbstractEventLoop from typing import Any -async def exists(path: StrOrBytesPath | int, *, loop: AbstractEventLoop | None = ..., executor: Any = ...) -> bool: ... -async def isfile(path: StrOrBytesPath | int, *, loop: AbstractEventLoop | None = ..., executor: Any = ...) -> bool: ... -async def isdir(s: StrOrBytesPath | int, *, loop: AbstractEventLoop | None = ..., executor: Any = ...) -> bool: ... -async def getsize(filename: StrOrBytesPath | int, *, loop: AbstractEventLoop | None = ..., executor: Any = ...) -> int: ... -async def getmtime(filename: StrOrBytesPath | int, *, loop: AbstractEventLoop | None = ..., executor: Any = ...) -> float: ... -async def getatime(filename: StrOrBytesPath | int, *, loop: AbstractEventLoop | None = ..., executor: Any = ...) -> float: ... -async def getctime(filename: StrOrBytesPath | int, *, loop: AbstractEventLoop | None = ..., executor: Any = ...) -> float: ... +async def exists(path: FileDescriptorOrPath, *, loop: AbstractEventLoop | None = ..., executor: Any = ...) -> bool: ... +async def isfile(path: FileDescriptorOrPath, *, loop: AbstractEventLoop | None = ..., executor: Any = ...) -> bool: ... +async def isdir(s: FileDescriptorOrPath, *, loop: AbstractEventLoop | None = ..., executor: Any = ...) -> bool: ... +async def getsize(filename: FileDescriptorOrPath, *, loop: AbstractEventLoop | None = ..., executor: Any = ...) -> int: ... +async def getmtime(filename: FileDescriptorOrPath, *, loop: AbstractEventLoop | None = ..., executor: Any = ...) -> float: ... +async def getatime(filename: FileDescriptorOrPath, *, loop: AbstractEventLoop | None = ..., executor: Any = ...) -> float: ... +async def getctime(filename: FileDescriptorOrPath, *, loop: AbstractEventLoop | None = ..., executor: Any = ...) -> float: ... async def samefile( - f1: StrOrBytesPath | int, f2: StrOrBytesPath | int, *, loop: AbstractEventLoop | None = ..., executor: Any = ... + f1: FileDescriptorOrPath, f2: FileDescriptorOrPath, *, loop: AbstractEventLoop | None = ..., executor: Any = ... ) -> bool: ... async def sameopenfile(fp1: int, fp2: int, *, loop: AbstractEventLoop | None = ..., executor: Any = ...) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/aiofiles/aiofiles/tempfile/temptypes.pyi b/packages/pyright-internal/typeshed-fallback/stubs/aiofiles/aiofiles/tempfile/temptypes.pyi index db6f26b55..211fcafc8 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/aiofiles/aiofiles/tempfile/temptypes.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/aiofiles/aiofiles/tempfile/temptypes.pyi @@ -1,11 +1,12 @@ from _typeshed import Incomplete from asyncio import AbstractEventLoop -from collections.abc import Generator +from collections.abc import Generator, Iterable +from tempfile import TemporaryDirectory, _BytesMode from types import coroutine as coroutine from typing import TypeVar -from ..base import AsyncBase as AsyncBase -from ..threadpool.utils import ( +from aiofiles.base import AsyncBase as AsyncBase +from aiofiles.threadpool.utils import ( cond_delegate_to_executor as cond_delegate_to_executor, delegate_to_executor as delegate_to_executor, proxy_property_directly as proxy_property_directly, @@ -16,31 +17,36 @@ _T = TypeVar("_T") class AsyncSpooledTemporaryFile(AsyncBase[_T]): def fileno(self) -> Generator[Incomplete, Incomplete, Incomplete]: ... def rollover(self) -> Generator[Incomplete, Incomplete, Incomplete]: ... + async def close(self) -> None: ... async def flush(self) -> None: ... async def isatty(self) -> bool: ... - async def read(self, __n: int = ...): ... - async def readline(self, __limit: int | None = ...): ... - async def readlines(self, __hint: int = ...): ... + # All must return `AnyStr`: + async def read(self, __n: int = ...) -> Incomplete: ... + async def readline(self, __limit: int | None = ...) -> Incomplete: ... + async def readlines(self, __hint: int = ...) -> list[Incomplete]: ... + # --- async def seek(self, offset: int, whence: int = ...) -> int: ... async def tell(self) -> int: ... async def truncate(self, size: int | None = ...) -> None: ... @property - def closed(self): ... + def closed(self) -> bool: ... @property - def encoding(self): ... + def encoding(self) -> str: ... @property - def mode(self): ... + def mode(self) -> _BytesMode: ... @property - def name(self): ... - async def newlines(self): ... + def name(self) -> str: ... @property - def softspace(self): ... - async def write(self, s): ... - async def writelines(self, iterable): ... + def newlines(self) -> str: ... + # Both should work with `AnyStr`, like in `tempfile`: + async def write(self, s: Incomplete) -> int: ... + async def writelines(self, iterable: Iterable[Incomplete]) -> None: ... class AsyncTemporaryDirectory: async def cleanup(self) -> None: ... @property - def name(self): ... - def __init__(self, file, loop: AbstractEventLoop | None, executor: Incomplete | None) -> None: ... + def name(self) -> Incomplete: ... # should be `AnyStr` + def __init__( + self, file: TemporaryDirectory[Incomplete], loop: AbstractEventLoop | None, executor: Incomplete | None + ) -> None: ... async def close(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/aiofiles/aiofiles/threadpool/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/aiofiles/aiofiles/threadpool/__init__.pyi index 92d126d83..3176a3a3d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/aiofiles/aiofiles/threadpool/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/aiofiles/aiofiles/threadpool/__init__.pyi @@ -1,27 +1,27 @@ from _typeshed import ( + FileDescriptorOrPath, + Incomplete, OpenBinaryMode, OpenBinaryModeReading, OpenBinaryModeUpdating, OpenBinaryModeWriting, OpenTextMode, - StrOrBytesPath, ) from asyncio import AbstractEventLoop from collections.abc import Callable -from typing import Any, overload +from typing import overload from typing_extensions import Literal, TypeAlias from ..base import AiofilesContextManager -from .binary import AsyncBufferedIOBase, AsyncBufferedReader, AsyncFileIO, _UnknownAsyncBinaryIO -from .text import AsyncTextIOWrapper +from .binary import AsyncBufferedIOBase, AsyncBufferedReader, AsyncFileIO, AsyncIndirectBufferedIOBase, _UnknownAsyncBinaryIO +from .text import AsyncTextIndirectIOWrapper, AsyncTextIOWrapper -_OpenFile: TypeAlias = StrOrBytesPath | int _Opener: TypeAlias = Callable[[str, int], int] # Text mode: always returns AsyncTextIOWrapper @overload def open( - file: _OpenFile, + file: FileDescriptorOrPath, mode: OpenTextMode = ..., buffering: int = ..., encoding: str | None = ..., @@ -31,13 +31,13 @@ def open( opener: _Opener | None = ..., *, loop: AbstractEventLoop | None = ..., - executor: Any | None = ..., + executor: Incomplete | None = ..., ) -> AiofilesContextManager[None, None, AsyncTextIOWrapper]: ... # Unbuffered binary: returns a FileIO @overload def open( - file: _OpenFile, + file: FileDescriptorOrPath, mode: OpenBinaryMode, buffering: Literal[0], encoding: None = ..., @@ -47,13 +47,13 @@ def open( opener: _Opener | None = ..., *, loop: AbstractEventLoop | None = ..., - executor: Any | None = ..., + executor: Incomplete | None = ..., ) -> AiofilesContextManager[None, None, AsyncFileIO]: ... # Buffered binary reading/updating: AsyncBufferedReader @overload def open( - file: _OpenFile, + file: FileDescriptorOrPath, mode: OpenBinaryModeReading | OpenBinaryModeUpdating, buffering: Literal[-1, 1] = ..., encoding: None = ..., @@ -63,13 +63,13 @@ def open( opener: _Opener | None = ..., *, loop: AbstractEventLoop | None = ..., - executor: Any | None = ..., + executor: Incomplete | None = ..., ) -> AiofilesContextManager[None, None, AsyncBufferedReader]: ... # Buffered binary writing: AsyncBufferedIOBase @overload def open( - file: _OpenFile, + file: FileDescriptorOrPath, mode: OpenBinaryModeWriting, buffering: Literal[-1, 1] = ..., encoding: None = ..., @@ -79,13 +79,13 @@ def open( opener: _Opener | None = ..., *, loop: AbstractEventLoop | None = ..., - executor: Any | None = ..., + executor: Incomplete | None = ..., ) -> AiofilesContextManager[None, None, AsyncBufferedIOBase]: ... # Buffering cannot be determined: fall back to _UnknownAsyncBinaryIO @overload def open( - file: _OpenFile, + file: FileDescriptorOrPath, mode: OpenBinaryMode, buffering: int = ..., encoding: None = ..., @@ -95,5 +95,12 @@ def open( opener: _Opener | None = ..., *, loop: AbstractEventLoop | None = ..., - executor: Any | None = ..., + executor: Incomplete | None = ..., ) -> AiofilesContextManager[None, None, _UnknownAsyncBinaryIO]: ... + +stdin: AsyncTextIndirectIOWrapper +stdout: AsyncTextIndirectIOWrapper +stderr: AsyncTextIndirectIOWrapper +stdin_bytes: AsyncIndirectBufferedIOBase +stdout_bytes: AsyncIndirectBufferedIOBase +stderr_bytes: AsyncIndirectBufferedIOBase diff --git a/packages/pyright-internal/typeshed-fallback/stubs/aiofiles/aiofiles/threadpool/binary.pyi b/packages/pyright-internal/typeshed-fallback/stubs/aiofiles/aiofiles/threadpool/binary.pyi index 2f7730064..db6b63315 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/aiofiles/aiofiles/threadpool/binary.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/aiofiles/aiofiles/threadpool/binary.pyi @@ -1,9 +1,11 @@ -from _typeshed import ReadableBuffer, StrOrBytesPath, WriteableBuffer +from _typeshed import FileDescriptorOrPath, ReadableBuffer, WriteableBuffer from collections.abc import Iterable from io import FileIO -from ..base import AsyncBase +from ..base import AsyncBase, AsyncIndirectBase +# This class does not exist at runtime and instead these methods are +# all dynamically patched in. class _UnknownAsyncBinaryIO(AsyncBase[bytes]): async def close(self) -> None: ... async def flush(self) -> None: ... @@ -26,7 +28,7 @@ class _UnknownAsyncBinaryIO(AsyncBase[bytes]): @property def mode(self) -> str: ... @property - def name(self) -> StrOrBytesPath | int: ... + def name(self) -> FileDescriptorOrPath: ... class AsyncBufferedIOBase(_UnknownAsyncBinaryIO): async def read1(self, __size: int = ...) -> bytes: ... @@ -34,8 +36,20 @@ class AsyncBufferedIOBase(_UnknownAsyncBinaryIO): @property def raw(self) -> FileIO: ... +class AsyncIndirectBufferedIOBase(AsyncIndirectBase[bytes], _UnknownAsyncBinaryIO): + async def read1(self, __size: int = ...) -> bytes: ... + def detach(self) -> FileIO: ... + @property + def raw(self) -> FileIO: ... + class AsyncBufferedReader(AsyncBufferedIOBase): async def peek(self, __size: int = ...) -> bytes: ... +class AsyncIndirectBufferedReader(AsyncIndirectBufferedIOBase): + async def peek(self, __size: int = ...) -> bytes: ... + class AsyncFileIO(_UnknownAsyncBinaryIO): async def readall(self) -> bytes: ... + +class AsyncIndirectFileIO(AsyncIndirectBase[bytes], _UnknownAsyncBinaryIO): + async def readall(self) -> bytes: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/aiofiles/aiofiles/threadpool/text.pyi b/packages/pyright-internal/typeshed-fallback/stubs/aiofiles/aiofiles/threadpool/text.pyi index 4712e342e..3e354d62b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/aiofiles/aiofiles/threadpool/text.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/aiofiles/aiofiles/threadpool/text.pyi @@ -1,10 +1,10 @@ -from _typeshed import StrOrBytesPath +from _typeshed import FileDescriptorOrPath from collections.abc import Iterable from typing import BinaryIO -from ..base import AsyncBase +from ..base import AsyncBase, AsyncIndirectBase -class AsyncTextIOWrapper(AsyncBase[str]): +class _UnknownAsyncTextIO(AsyncBase[str]): async def close(self) -> None: ... async def flush(self) -> None: ... async def isatty(self) -> bool: ... @@ -34,6 +34,9 @@ class AsyncTextIOWrapper(AsyncBase[str]): @property def newlines(self) -> str | tuple[str, ...] | None: ... @property - def name(self) -> StrOrBytesPath | int: ... + def name(self) -> FileDescriptorOrPath: ... @property def mode(self) -> str: ... + +class AsyncTextIOWrapper(_UnknownAsyncTextIO): ... +class AsyncTextIndirectIOWrapper(AsyncIndirectBase[str], _UnknownAsyncTextIO): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/aiofiles/aiofiles/threadpool/utils.pyi b/packages/pyright-internal/typeshed-fallback/stubs/aiofiles/aiofiles/threadpool/utils.pyi index 341396135..afff76d0d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/aiofiles/aiofiles/threadpool/utils.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/aiofiles/aiofiles/threadpool/utils.pyi @@ -1,6 +1,11 @@ +from collections.abc import Callable from types import coroutine as coroutine +from typing import TypeVar -def delegate_to_executor(*attrs): ... -def proxy_method_directly(*attrs): ... -def proxy_property_directly(*attrs): ... -def cond_delegate_to_executor(*attrs): ... +_T = TypeVar("_T", bound=type) + +# All these function actually mutate the given type: +def delegate_to_executor(*attrs: str) -> Callable[[_T], _T]: ... +def proxy_method_directly(*attrs: str) -> Callable[[_T], _T]: ... +def proxy_property_directly(*attrs: str) -> Callable[[_T], _T]: ... +def cond_delegate_to_executor(*attrs: str) -> Callable[[_T], _T]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/annoy/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/annoy/METADATA.toml index a5db24bf0..74b2b8d57 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/annoy/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/annoy/METADATA.toml @@ -1,5 +1,2 @@ version = "1.17.*" requires = [] - -[tool.stubtest] -ignore_missing_stub = false diff --git a/packages/pyright-internal/typeshed-fallback/stubs/annoy/annoy/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/annoy/annoy/__init__.pyi index 2a0bb263a..8a1ced3e7 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/annoy/annoy/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/annoy/annoy/__init__.pyi @@ -1,44 +1,5 @@ -from _typeshed import SupportsLenAndGetItem -from typing import overload -from typing_extensions import Literal, TypeAlias +from typing_extensions import TypeAlias -_Vector: TypeAlias = SupportsLenAndGetItem[float] +from .annoylib import Annoy -class AnnoyIndex: - f: int - def __init__(self, f: int, metric: Literal["angular", "euclidean", "manhattan", "hamming", "dot"]) -> None: ... - def load(self, fn: str, prefault: bool = ...) -> Literal[True]: ... - def save(self, fn: str, prefault: bool = ...) -> Literal[True]: ... - @overload - def get_nns_by_item(self, i: int, n: int, search_k: int = ..., include_distances: Literal[False] = ...) -> list[int]: ... - @overload - def get_nns_by_item( - self, i: int, n: int, search_k: int, include_distances: Literal[True] - ) -> tuple[list[int], list[float]]: ... - @overload - def get_nns_by_item( - self, i: int, n: int, search_k: int = ..., *, include_distances: Literal[True] - ) -> tuple[list[int], list[float]]: ... - @overload - def get_nns_by_vector( - self, vector: _Vector, n: int, search_k: int = ..., include_distances: Literal[False] = ... - ) -> list[int]: ... - @overload - def get_nns_by_vector( - self, vector: _Vector, n: int, search_k: int, include_distances: Literal[True] - ) -> tuple[list[int], list[float]]: ... - @overload - def get_nns_by_vector( - self, vector: _Vector, n: int, search_k: int = ..., *, include_distances: Literal[True] - ) -> tuple[list[int], list[float]]: ... - def get_item_vector(self, __i: int) -> list[float]: ... - def add_item(self, i: int, vector: _Vector) -> None: ... - def on_disk_build(self, fn: str) -> Literal[True]: ... - def build(self, n_trees: int, n_jobs: int = ...) -> Literal[True]: ... - def unbuild(self) -> Literal[True]: ... - def unload(self) -> Literal[True]: ... - def get_distance(self, __i: int, __j: int) -> float: ... - def get_n_items(self) -> int: ... - def get_n_trees(self) -> int: ... - def verbose(self, __v: bool) -> Literal[True]: ... - def set_seed(self, __s: int) -> None: ... +AnnoyIndex: TypeAlias = Annoy diff --git a/packages/pyright-internal/typeshed-fallback/stubs/annoy/annoy/annoylib.pyi b/packages/pyright-internal/typeshed-fallback/stubs/annoy/annoy/annoylib.pyi index 41d2fe2ae..cae6dd244 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/annoy/annoy/annoylib.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/annoy/annoy/annoylib.pyi @@ -1,20 +1,44 @@ -from _typeshed import Incomplete +from _typeshed import SupportsLenAndGetItem +from typing import overload +from typing_extensions import Literal, TypeAlias + +_Vector: TypeAlias = SupportsLenAndGetItem[float] class Annoy: - f: Incomplete - def __init__(self, *args, **kwargs) -> None: ... - def add_item(self, *args, **kwargs): ... - def build(self, *args, **kwargs): ... - def get_distance(self, *args, **kwargs): ... - def get_item_vector(self, *args, **kwargs): ... - def get_n_items(self, *args, **kwargs): ... - def get_n_trees(self, *args, **kwargs): ... - def get_nns_by_item(self, *args, **kwargs): ... - def get_nns_by_vector(self, *args, **kwargs): ... - def load(self, *args, **kwargs): ... - def on_disk_build(self, *args, **kwargs): ... - def save(self, *args, **kwargs): ... - def set_seed(self, *args, **kwargs): ... - def unbuild(self, *args, **kwargs): ... - def unload(self, *args, **kwargs): ... - def verbose(self, *args, **kwargs): ... + f: int + def __init__(self, f: int, metric: Literal["angular", "euclidean", "manhattan", "hamming", "dot"]) -> None: ... + def load(self, fn: str, prefault: bool = ...) -> Literal[True]: ... + def save(self, fn: str, prefault: bool = ...) -> Literal[True]: ... + @overload + def get_nns_by_item(self, i: int, n: int, search_k: int = ..., include_distances: Literal[False] = ...) -> list[int]: ... + @overload + def get_nns_by_item( + self, i: int, n: int, search_k: int, include_distances: Literal[True] + ) -> tuple[list[int], list[float]]: ... + @overload + def get_nns_by_item( + self, i: int, n: int, search_k: int = ..., *, include_distances: Literal[True] + ) -> tuple[list[int], list[float]]: ... + @overload + def get_nns_by_vector( + self, vector: _Vector, n: int, search_k: int = ..., include_distances: Literal[False] = ... + ) -> list[int]: ... + @overload + def get_nns_by_vector( + self, vector: _Vector, n: int, search_k: int, include_distances: Literal[True] + ) -> tuple[list[int], list[float]]: ... + @overload + def get_nns_by_vector( + self, vector: _Vector, n: int, search_k: int = ..., *, include_distances: Literal[True] + ) -> tuple[list[int], list[float]]: ... + def get_item_vector(self, __i: int) -> list[float]: ... + def add_item(self, i: int, vector: _Vector) -> None: ... + def on_disk_build(self, fn: str) -> Literal[True]: ... + def build(self, n_trees: int, n_jobs: int = ...) -> Literal[True]: ... + def unbuild(self) -> Literal[True]: ... + def unload(self) -> Literal[True]: ... + def get_distance(self, __i: int, __j: int) -> float: ... + def get_n_items(self) -> int: ... + def get_n_trees(self) -> int: ... + def verbose(self, __v: bool) -> Literal[True]: ... + def set_seed(self, __s: int) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/appdirs/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/appdirs/METADATA.toml deleted file mode 100644 index 3a60aff54..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/appdirs/METADATA.toml +++ /dev/null @@ -1,4 +0,0 @@ -version = "1.4.*" - -[tool.stubtest] -ignore_missing_stub = false diff --git a/packages/pyright-internal/typeshed-fallback/stubs/appdirs/appdirs.pyi b/packages/pyright-internal/typeshed-fallback/stubs/appdirs/appdirs.pyi deleted file mode 100644 index d7c1c5526..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/appdirs/appdirs.pyi +++ /dev/null @@ -1,55 +0,0 @@ -__version_info__: tuple[int, int, int] -PY3: bool -unicode = str -system: str - -def user_data_dir( - appname: str | None = ..., appauthor: str | None = ..., version: str | None = ..., roaming: bool = ... -) -> str: ... -def site_data_dir( - appname: str | None = ..., appauthor: str | None = ..., version: str | None = ..., multipath: bool = ... -) -> str: ... -def user_config_dir( - appname: str | None = ..., appauthor: str | None = ..., version: str | None = ..., roaming: bool = ... -) -> str: ... -def site_config_dir( - appname: str | None = ..., appauthor: str | None = ..., version: str | None = ..., multipath: bool = ... -) -> str: ... -def user_cache_dir( - appname: str | None = ..., appauthor: str | None = ..., version: str | None = ..., opinion: bool = ... -) -> str: ... -def user_state_dir( - appname: str | None = ..., appauthor: str | None = ..., version: str | None = ..., roaming: bool = ... -) -> str: ... -def user_log_dir( - appname: str | None = ..., appauthor: str | None = ..., version: str | None = ..., opinion: bool = ... -) -> str: ... - -class AppDirs: - appname: str - appauthor: str - version: str - roaming: bool - multipath: bool - def __init__( - self, - appname: str | None = ..., - appauthor: str | None = ..., - version: str | None = ..., - roaming: bool = ..., - multipath: bool = ..., - ) -> None: ... - @property - def user_data_dir(self) -> str: ... - @property - def site_data_dir(self) -> str: ... - @property - def user_config_dir(self) -> str: ... - @property - def site_config_dir(self) -> str: ... - @property - def user_cache_dir(self) -> str: ... - @property - def user_state_dir(self) -> str: ... - @property - def user_log_dir(self) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/atomicwrites/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/atomicwrites/METADATA.toml deleted file mode 100644 index 6d3b92238..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/atomicwrites/METADATA.toml +++ /dev/null @@ -1 +0,0 @@ -version = "1.4.*" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/atomicwrites/atomicwrites/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/atomicwrites/atomicwrites/__init__.pyi deleted file mode 100644 index f5ea4ac29..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/atomicwrites/atomicwrites/__init__.pyi +++ /dev/null @@ -1,20 +0,0 @@ -from _typeshed import StrOrBytesPath -from collections.abc import Callable -from contextlib import AbstractContextManager -from typing import IO, Any, AnyStr - -def replace_atomic(src: AnyStr, dst: AnyStr) -> None: ... -def move_atomic(src: AnyStr, dst: AnyStr) -> None: ... - -class AtomicWriter: - def __init__(self, path: StrOrBytesPath, mode: str = ..., overwrite: bool = ...) -> None: ... - def open(self) -> AbstractContextManager[IO[Any]]: ... - def _open(self, get_fileobject: Callable[..., IO[AnyStr]]) -> AbstractContextManager[IO[AnyStr]]: ... - def get_fileobject(self, dir: StrOrBytesPath | None = ..., **kwargs: Any) -> IO[Any]: ... - def sync(self, f: IO[Any]) -> None: ... - def commit(self, f: IO[Any]) -> None: ... - def rollback(self, f: IO[Any]) -> None: ... - -def atomic_write( - path: StrOrBytesPath, writer_cls: type[AtomicWriter] = ..., **cls_kwargs: object -) -> AbstractContextManager[IO[Any]]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/METADATA.toml index 4e51482b6..d4db0c1ac 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/METADATA.toml @@ -1 +1,4 @@ -version = "2.10.*" +version = "2.11.*" + +[tool.stubtest] +ignore_missing_stub = true diff --git a/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/aws_xray_sdk/core/async_context.pyi b/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/aws_xray_sdk/core/async_context.pyi index ebedf69fe..36c2d904b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/aws_xray_sdk/core/async_context.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/aws_xray_sdk/core/async_context.pyi @@ -1,15 +1,15 @@ -from typing import Any +from _typeshed import Incomplete from .context import Context as _Context class AsyncContext(_Context): - def __init__(self, *args, loop: Any | None = ..., use_task_factory: bool = ..., **kwargs) -> None: ... + def __init__(self, *args, loop: Incomplete | None = ..., use_task_factory: bool = ..., **kwargs) -> None: ... def clear_trace_entities(self) -> None: ... class TaskLocalStorage: - def __init__(self, loop: Any | None = ...) -> None: ... - def __setattr__(self, name, value) -> None: ... - def __getattribute__(self, item): ... + def __init__(self, loop: Incomplete | None = ...) -> None: ... + def __setattr__(self, name: str, value) -> None: ... + def __getattribute__(self, item: str): ... def clear(self) -> None: ... def task_factory(loop, coro): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/aws_xray_sdk/core/async_recorder.pyi b/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/aws_xray_sdk/core/async_recorder.pyi index 58b18e1e8..d5d974908 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/aws_xray_sdk/core/async_recorder.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/aws_xray_sdk/core/async_recorder.pyi @@ -1,4 +1,5 @@ -from typing import Any +from _typeshed import Incomplete +from types import TracebackType from .models.segment import SegmentContextManager as SegmentContextManager from .models.subsegment import ( @@ -11,15 +12,19 @@ from .utils import stacktrace as stacktrace class AsyncSegmentContextManager(SegmentContextManager): async def __aenter__(self): ... - async def __aexit__(self, exc_type, exc_val, exc_tb): ... + 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 __aexit__(self, exc_type, exc_val, exc_tb): ... + 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: Any | None = ...): ... - def in_segment_async(self, name: Any | None = ..., **segment_kwargs): ... - def in_subsegment_async(self, name: Any | None = ..., **subsegment_kwargs): ... + def capture_async(self, name: Incomplete | None = ...): ... + def in_segment_async(self, name: Incomplete | None = ..., **segment_kwargs): ... + def in_subsegment_async(self, name: Incomplete | None = ..., **subsegment_kwargs): ... async def record_subsegment_async(self, wrapped, instance, args, kwargs, name, namespace, meta_processor): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/aws_xray_sdk/core/lambda_launcher.pyi b/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/aws_xray_sdk/core/lambda_launcher.pyi index ee184efd4..0c254da64 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/aws_xray_sdk/core/lambda_launcher.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/aws_xray_sdk/core/lambda_launcher.pyi @@ -1,5 +1,5 @@ +from _typeshed import Incomplete from logging import Logger -from typing import Any from aws_xray_sdk import global_sdk_config as global_sdk_config @@ -18,7 +18,7 @@ def check_in_lambda(): ... class LambdaContext(Context): def __init__(self) -> None: ... def put_segment(self, segment) -> None: ... - def end_segment(self, end_time: Any | None = ...) -> None: ... + def end_segment(self, end_time: Incomplete | None = ...) -> None: ... def put_subsegment(self, subsegment) -> None: ... def get_trace_entity(self): ... @property diff --git a/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/aws_xray_sdk/core/models/entity.pyi b/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/aws_xray_sdk/core/models/entity.pyi index b1cabd7c2..8bba421c2 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/aws_xray_sdk/core/models/entity.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/aws_xray_sdk/core/models/entity.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from logging import Logger from traceback import StackSummary from typing import Any @@ -25,8 +26,8 @@ class Entity: cause: Any subsegments: Any end_time: Any - def __init__(self, name, entity_id: Any | None = ...) -> None: ... - def close(self, end_time: Any | None = ...) -> None: ... + def __init__(self, name, entity_id: Incomplete | None = ...) -> None: ... + def close(self, end_time: Incomplete | None = ...) -> None: ... def add_subsegment(self, subsegment) -> None: ... def remove_subsegment(self, subsegment) -> None: ... def put_http_meta(self, key, value) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/aws_xray_sdk/core/models/facade_segment.pyi b/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/aws_xray_sdk/core/models/facade_segment.pyi index a80c456e0..e00b7edd3 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/aws_xray_sdk/core/models/facade_segment.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/aws_xray_sdk/core/models/facade_segment.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from ..exceptions.exceptions import FacadeSegmentMutationException as FacadeSegmentMutationException @@ -8,7 +9,7 @@ MUTATION_UNSUPPORTED_MESSAGE: str class FacadeSegment(Segment): initializing: Any def __init__(self, name, entityid, traceid, sampled) -> None: ... - def close(self, end_time: Any | None = ...) -> None: ... + def close(self, end_time: Incomplete | None = ...) -> None: ... def put_http_meta(self, key, value) -> None: ... def put_annotation(self, key, value) -> None: ... def put_metadata(self, key, value, namespace: str = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/aws_xray_sdk/core/models/segment.pyi b/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/aws_xray_sdk/core/models/segment.pyi index 50c3a8596..e273cebd8 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/aws_xray_sdk/core/models/segment.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/aws_xray_sdk/core/models/segment.pyi @@ -1,3 +1,4 @@ +from types import TracebackType from typing import Any from ..exceptions.exceptions import SegmentNameMissingException as SegmentNameMissingException @@ -16,7 +17,9 @@ class SegmentContextManager: segment: Segment def __init__(self, recorder: AWSXRayRecorder, name: str | None = ..., **segment_kwargs) -> None: ... def __enter__(self): ... - def __exit__(self, exc_type, exc_val, exc_tb) -> None: ... + def __exit__( + self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None + ) -> None: ... class Segment(Entity): trace_id: str | None diff --git a/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/aws_xray_sdk/core/models/subsegment.pyi b/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/aws_xray_sdk/core/models/subsegment.pyi index 97e5a7a49..ddce021dd 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/aws_xray_sdk/core/models/subsegment.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/aws_xray_sdk/core/models/subsegment.pyi @@ -1,4 +1,6 @@ import time +from _typeshed import Incomplete +from types import TracebackType from typing import Any from ...core import AWSXRayRecorder @@ -17,10 +19,12 @@ class SubsegmentContextManager: subsegment_kwargs: dict[str, Any] | None recorder: AWSXRayRecorder subsegment: Subsegment - def __init__(self, recorder: AWSXRayRecorder, name: Any | None = ..., **subsegment_kwargs) -> None: ... + def __init__(self, recorder: AWSXRayRecorder, name: Incomplete | None = ..., **subsegment_kwargs) -> None: ... def __call__(self, wrapped, instance, args: list[Any], kwargs: dict[str, Any]): ... def __enter__(self) -> Subsegment: ... - def __exit__(self, exc_type, exc_val, exc_tb) -> None: ... + def __exit__( + self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None + ) -> None: ... class Subsegment(Entity): parent_segment: Segment diff --git a/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/aws_xray_sdk/core/models/trace_header.pyi b/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/aws_xray_sdk/core/models/trace_header.pyi index ba1d9b06a..cb34fbaab 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/aws_xray_sdk/core/models/trace_header.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/aws_xray_sdk/core/models/trace_header.pyi @@ -1,5 +1,5 @@ -from _typeshed import Self from typing import Any +from typing_extensions import Self log: Any ROOT: str @@ -13,7 +13,7 @@ class TraceHeader: self, root: str | None = ..., parent: str | None = ..., sampled: bool | None = ..., data: dict[str, Any] | None = ... ) -> None: ... @classmethod - def from_header_str(cls: type[Self], header) -> Self: ... + def from_header_str(cls, header) -> Self: ... def to_header_str(self): ... @property def root(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/aws_xray_sdk/core/plugins/ec2_plugin.pyi b/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/aws_xray_sdk/core/plugins/ec2_plugin.pyi index b2ea7957d..801eff411 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/aws_xray_sdk/core/plugins/ec2_plugin.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/aws_xray_sdk/core/plugins/ec2_plugin.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any log: Any @@ -7,6 +8,6 @@ IMDS_URL: str def initialize() -> None: ... def get_token(): ... -def get_metadata(token: Any | None = ...): ... +def get_metadata(token: Incomplete | None = ...): ... def parse_metadata_json(json_str): ... -def do_request(url, headers: Any | None = ..., method: str = ...): ... +def do_request(url, headers: Incomplete | None = ..., method: str = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/aws_xray_sdk/core/sampling/local/sampler.pyi b/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/aws_xray_sdk/core/sampling/local/sampler.pyi index 0fc18cd23..76882c9fa 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/aws_xray_sdk/core/sampling/local/sampler.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/aws_xray_sdk/core/sampling/local/sampler.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from ...exceptions.exceptions import InvalidSamplingManifestError as InvalidSamplingManifestError @@ -8,5 +9,5 @@ SUPPORTED_RULE_VERSION: Any class LocalSampler: def __init__(self, rules=...) -> None: ... - def should_trace(self, sampling_req: Any | None = ...): ... + def should_trace(self, sampling_req: Incomplete | None = ...): ... def load_local_rules(self, rules) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/aws_xray_sdk/core/sampling/sampler.pyi b/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/aws_xray_sdk/core/sampling/sampler.pyi index 631109572..eb5143d56 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/aws_xray_sdk/core/sampling/sampler.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/aws_xray_sdk/core/sampling/sampler.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from .connector import ServiceConnector as ServiceConnector @@ -12,9 +13,9 @@ log: Any class DefaultSampler: def __init__(self) -> None: ... def start(self) -> None: ... - def should_trace(self, sampling_req: Any | None = ...): ... + def should_trace(self, sampling_req: Incomplete | None = ...): ... def load_local_rules(self, rules) -> None: ... - def load_settings(self, daemon_config, context, origin: Any | None = ...) -> None: ... + def load_settings(self, daemon_config, context, origin: Incomplete | None = ...) -> None: ... @property def xray_client(self): ... @xray_client.setter diff --git a/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/aws_xray_sdk/core/sampling/sampling_rule.pyi b/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/aws_xray_sdk/core/sampling/sampling_rule.pyi index 2b47ac65e..0893db197 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/aws_xray_sdk/core/sampling/sampling_rule.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/aws_xray_sdk/core/sampling/sampling_rule.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete from ..utils.search_pattern import wildcard_match as wildcard_match from .reservoir import Reservoir as Reservoir @@ -10,11 +10,11 @@ class SamplingRule: priority, rate, reservoir_size, - host: Any | None = ..., - method: Any | None = ..., - path: Any | None = ..., - service: Any | None = ..., - service_type: Any | None = ..., + host: Incomplete | None = ..., + method: Incomplete | None = ..., + path: Incomplete | None = ..., + service: Incomplete | None = ..., + service_type: Incomplete | None = ..., ) -> None: ... def match(self, sampling_req): ... def is_default(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/aws_xray_sdk/core/utils/compat.pyi b/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/aws_xray_sdk/core/utils/compat.pyi index 676b8b356..32562d540 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/aws_xray_sdk/core/utils/compat.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/aws_xray_sdk/core/utils/compat.pyi @@ -1,7 +1,8 @@ from typing import Any +from typing_extensions import Literal -PY2: Any -PY35: Any +PY2: Literal[False] +PY35: Literal[True] annotation_value_types: Any string_types = str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/aws_xray_sdk/core/utils/stacktrace.pyi b/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/aws_xray_sdk/core/utils/stacktrace.pyi index 8c6c43654..05d8dc2cf 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/aws_xray_sdk/core/utils/stacktrace.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/aws_xray_sdk/core/utils/stacktrace.pyi @@ -1,3 +1,3 @@ -from typing import Any +from _typeshed import Incomplete -def get_stacktrace(limit: Any | None = ...): ... +def get_stacktrace(limit: Incomplete | None = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/babel/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/babel/METADATA.toml index 72ddcc39b..137f94d40 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/babel/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/babel/METADATA.toml @@ -1,2 +1,6 @@ -version = "2.10.*" +version = "2.11.*" requires = ["types-pytz"] +obsolete_since = "2.12.1" # Released on 2023-02-28 + +[tool.stubtest] +ignore_missing_stub = true diff --git a/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/core.pyi b/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/core.pyi index ddd0df911..c969492cd 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/core.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/core.pyi @@ -1,119 +1,135 @@ -from typing import Any +from collections.abc import Iterable, Mapping +from typing import Any, overload from typing_extensions import Literal, TypeAlias +from babel.localedata import LocaleDataDict +from babel.plural import PluralRule + class UnknownLocaleError(Exception): - identifier: Any - def __init__(self, identifier) -> None: ... + identifier: str + def __init__(self, identifier: str) -> None: ... class Locale: - language: Any - territory: Any - script: Any - variant: Any - def __init__(self, language, territory: Any | None = ..., script: Any | None = ..., variant: Any | None = ...) -> None: ... + language: str + territory: str | None + script: str | None + variant: str | None + def __init__( + self, language: str, territory: str | None = ..., script: str | None = ..., variant: str | None = ... + ) -> None: ... + @classmethod + def default(cls, category: str | None = ..., aliases: Mapping[str, str] = ...) -> Locale: ... @classmethod - def default(cls, category: Any | None = ..., aliases=...): ... + def negotiate( + cls, preferred: Iterable[str], available: Iterable[str], sep: str = ..., aliases: Mapping[str, str] = ... + ) -> Locale | None: ... + @overload @classmethod - def negotiate(cls, preferred, available, sep: str = ..., aliases=...): ... + def parse(cls, identifier: None, sep: str = ..., resolve_likely_subtags: bool = ...) -> None: ... + @overload @classmethod - def parse(cls, identifier, sep: str = ..., resolve_likely_subtags: bool = ...): ... - def __eq__(self, other): ... - def __ne__(self, other): ... - def __hash__(self): ... - def get_display_name(self, locale: Any | None = ...): ... + def parse(cls, identifier: str | Locale, sep: str = ..., resolve_likely_subtags: bool = ...) -> Locale: ... + def __eq__(self, other: object) -> bool: ... + def __ne__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def get_display_name(self, locale: Locale | str | None = ...) -> str | None: ... + @property + def display_name(self) -> str | None: ... + def get_language_name(self, locale: Locale | str | None = ...) -> str | None: ... @property - def display_name(self): ... - def get_language_name(self, locale: Any | None = ...): ... + def language_name(self) -> str | None: ... + def get_territory_name(self, locale: Locale | str | None = ...) -> str | None: ... @property - def language_name(self): ... - def get_territory_name(self, locale: Any | None = ...): ... + def territory_name(self) -> str | None: ... + def get_script_name(self, locale: Locale | str | None = ...) -> str | None: ... @property - def territory_name(self): ... - def get_script_name(self, locale: Any | None = ...): ... + def script_name(self) -> str | None: ... @property - def script_name(self): ... + def english_name(self) -> str | None: ... @property - def english_name(self): ... + def languages(self) -> LocaleDataDict: ... @property - def languages(self): ... + def scripts(self) -> LocaleDataDict: ... @property - def scripts(self): ... + def territories(self) -> LocaleDataDict: ... @property - def territories(self): ... + def variants(self) -> LocaleDataDict: ... @property - def variants(self): ... + def currencies(self) -> LocaleDataDict: ... @property - def currencies(self): ... + def currency_symbols(self) -> LocaleDataDict: ... @property - def currency_symbols(self): ... + def number_symbols(self) -> LocaleDataDict: ... @property - def number_symbols(self): ... + def decimal_formats(self) -> LocaleDataDict: ... @property - def decimal_formats(self): ... + def compact_decimal_formats(self) -> LocaleDataDict: ... @property - def currency_formats(self): ... + def currency_formats(self) -> LocaleDataDict: ... @property - def percent_formats(self): ... + def percent_formats(self) -> LocaleDataDict: ... @property - def scientific_formats(self): ... + def scientific_formats(self) -> LocaleDataDict: ... @property - def periods(self): ... + def periods(self) -> LocaleDataDict: ... @property - def day_periods(self): ... + def day_periods(self) -> LocaleDataDict: ... @property - def day_period_rules(self): ... + def day_period_rules(self) -> LocaleDataDict: ... @property - def days(self): ... + def days(self) -> LocaleDataDict: ... @property - def months(self): ... + def months(self) -> LocaleDataDict: ... @property - def quarters(self): ... + def quarters(self) -> LocaleDataDict: ... @property - def eras(self): ... + def eras(self) -> LocaleDataDict: ... @property - def time_zones(self): ... + def time_zones(self) -> LocaleDataDict: ... @property - def meta_zones(self): ... + def meta_zones(self) -> LocaleDataDict: ... @property - def zone_formats(self): ... + def zone_formats(self) -> LocaleDataDict: ... @property - def first_week_day(self): ... + def first_week_day(self) -> int: ... @property - def weekend_start(self): ... + def weekend_start(self) -> int: ... @property - def weekend_end(self): ... + def weekend_end(self) -> int: ... @property - def min_week_days(self): ... + def min_week_days(self) -> int: ... @property - def date_formats(self): ... + def date_formats(self) -> LocaleDataDict: ... @property - def time_formats(self): ... + def time_formats(self) -> LocaleDataDict: ... @property - def datetime_formats(self): ... + def datetime_formats(self) -> LocaleDataDict: ... @property - def datetime_skeletons(self): ... + def datetime_skeletons(self) -> LocaleDataDict: ... @property - def interval_formats(self): ... + def interval_formats(self) -> LocaleDataDict: ... @property - def plural_form(self): ... + def plural_form(self) -> PluralRule: ... @property - def list_patterns(self): ... + def list_patterns(self) -> LocaleDataDict: ... @property - def ordinal_form(self): ... + def ordinal_form(self) -> PluralRule: ... @property - def measurement_systems(self): ... + def measurement_systems(self) -> LocaleDataDict: ... @property - def character_order(self): ... + def character_order(self) -> str: ... @property - def text_direction(self): ... + def text_direction(self) -> str: ... @property - def unit_display_names(self): ... + def unit_display_names(self) -> LocaleDataDict: ... -def default_locale(category: Any | None = ..., aliases=...): ... -def negotiate_locale(preferred, available, sep: str = ..., aliases=...): ... -def parse_locale(identifier, sep: str = ...): ... -def get_locale_identifier(tup, sep: str = ...): ... -def get_global(key: _GLOBAL_KEY): ... +def default_locale(category: str | None = ..., aliases: Mapping[str, str] = ...) -> str | None: ... +def negotiate_locale( + preferred: Iterable[str], available: Iterable[str], sep: str = ..., aliases: Mapping[str, str] = ... +) -> str | None: ... +def parse_locale(identifier: str, sep: str = ...) -> tuple[str, str | None, str | None, str | None]: ... +def get_locale_identifier(tup: tuple[str, str | None, str | None, str | None], sep: str = ...) -> str: ... +def get_global(key: _GLOBAL_KEY) -> Mapping[str, Any]: ... _GLOBAL_KEY: TypeAlias = Literal[ "all_currencies", diff --git a/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/dates.pyi b/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/dates.pyi index ffff795e7..36a5b41a6 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/dates.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/dates.pyi @@ -1,8 +1,10 @@ +from collections.abc import Iterable from datetime import date, datetime, time, timedelta, tzinfo -from typing import Any, overload +from typing import SupportsInt, overload from typing_extensions import Literal, TypeAlias from babel.core import Locale +from babel.localedata import LocaleDataDict from babel.util import LOCALTZ as LOCALTZ, UTC as UTC from pytz import BaseTzInfo @@ -10,20 +12,22 @@ from pytz import BaseTzInfo # http://babel.pocoo.org/en/latest/api/dates.html # Date and Time Formatting -_Instant: TypeAlias = date | time | datetime | float | None +_Instant: TypeAlias = date | time | float | None _PredefinedTimeFormat: TypeAlias = Literal["full", "long", "medium", "short"] +_Context: TypeAlias = Literal["format", "stand-alone"] def format_datetime( - datetime: _Instant = ..., format: _PredefinedTimeFormat | str = ..., tzinfo: tzinfo | None = ..., locale: str | Locale = ... -) -> str: ... -def format_date( - date: date | datetime | None = ..., format: _PredefinedTimeFormat | str = ..., locale: str | Locale = ... + datetime: _Instant = ..., + format: _PredefinedTimeFormat | str = ..., + tzinfo: tzinfo | None = ..., + locale: Locale | str | None = ..., ) -> str: ... +def format_date(date: date | None = ..., format: _PredefinedTimeFormat | str = ..., locale: Locale | str | None = ...) -> str: ... def format_time( time: time | datetime | float | None = ..., format: _PredefinedTimeFormat | str = ..., tzinfo: tzinfo | None = ..., - locale: str | Locale = ..., + locale: Locale | str | None = ..., ) -> str: ... def format_timedelta( delta: timedelta | int, @@ -31,10 +35,10 @@ def format_timedelta( threshold: float = ..., add_direction: bool = ..., format: Literal["narrow", "short", "medium", "long"] = ..., - locale: str | Locale = ..., + locale: Locale | str | None = ..., ) -> str: ... def format_skeleton( - skeleton: str, datetime: _Instant = ..., tzinfo: tzinfo | None = ..., fuzzy: bool = ..., locale: str | Locale = ... + skeleton: str, datetime: _Instant = ..., tzinfo: tzinfo | None = ..., fuzzy: bool = ..., locale: Locale | str | None = ... ) -> str: ... def format_interval( start: _Instant, @@ -42,7 +46,7 @@ def format_interval( skeleton: str | None = ..., tzinfo: tzinfo | None = ..., fuzzy: bool = ..., - locale: str | Locale = ..., + locale: Locale | str | None = ..., ) -> str: ... # Timezone Functionality @@ -53,18 +57,18 @@ def get_timezone(zone: tzinfo) -> tzinfo: ... def get_timezone_gmt( datetime: _Instant = ..., width: Literal["long", "short", "iso8601", "iso8601_short"] = ..., - locale: str | Locale = ..., + locale: Locale | str | None = ..., return_z: bool = ..., ) -> str: ... _DtOrTzinfo: TypeAlias = datetime | tzinfo | str | int | time | None -def get_timezone_location(dt_or_tzinfo: _DtOrTzinfo = ..., locale: str | Locale = ..., return_city: bool = ...) -> str: ... +def get_timezone_location(dt_or_tzinfo: _DtOrTzinfo = ..., locale: Locale | str | None = ..., return_city: bool = ...) -> str: ... def get_timezone_name( dt_or_tzinfo: _DtOrTzinfo = ..., width: Literal["long", "short"] = ..., uncommon: bool = ..., - locale: str | Locale = ..., + locale: Locale | str | None = ..., zone_variant: Literal["generic", "daylight", "standard"] | None = ..., return_zone: bool = ..., ) -> str: ... @@ -95,65 +99,76 @@ class TimezoneTransition: def to_offset(self) -> int: ... # Data Access -def get_period_names(width: str = ..., context: str = ..., locale=...): ... -def get_day_names(width: str = ..., context: str = ..., locale=...): ... -def get_month_names(width: str = ..., context: str = ..., locale=...): ... -def get_quarter_names(width: str = ..., context: str = ..., locale=...): ... -def get_era_names(width: str = ..., locale=...): ... -def get_date_format(format: str = ..., locale=...): ... -def get_datetime_format(format: str = ..., locale=...): ... -def get_time_format(format: str = ..., locale=...): ... +def get_period_names( + width: Literal["abbreviated", "narrow", "wide"] = ..., context: _Context = ..., locale: Locale | str | None = ... +) -> LocaleDataDict: ... +def get_day_names( + width: Literal["abbreviated", "narrow", "short", "wide"] = ..., context: _Context = ..., locale: Locale | str | None = ... +) -> LocaleDataDict: ... +def get_month_names( + width: Literal["abbreviated", "narrow", "wide"] = ..., context: _Context = ..., locale: Locale | str | None = ... +) -> LocaleDataDict: ... +def get_quarter_names( + width: Literal["abbreviated", "narrow", "wide"] = ..., context: _Context = ..., locale: Locale | str | None = ... +) -> LocaleDataDict: ... +def get_era_names(width: Literal["abbreviated", "narrow", "wide"] = ..., locale: Locale | str | None = ...) -> LocaleDataDict: ... +def get_date_format(format: _PredefinedTimeFormat = ..., locale: Locale | str | None = ...) -> DateTimePattern: ... +def get_datetime_format(format: _PredefinedTimeFormat = ..., locale: Locale | str | None = ...) -> DateTimePattern: ... +def get_time_format(format: _PredefinedTimeFormat = ..., locale: Locale | str | None = ...) -> DateTimePattern: ... + +class ParseError(ValueError): ... # Basic Parsing -def parse_date(string, locale=..., format: str = ...): ... -def parse_time(string, locale=..., format: str = ...): ... -def parse_pattern(pattern): ... +def parse_date(string: str, locale: Locale | str | None = ..., format: _PredefinedTimeFormat = ...) -> date: ... +def parse_time(string: str, locale: Locale | str | None = ..., format: _PredefinedTimeFormat = ...) -> time: ... +def parse_pattern(pattern: str) -> DateTimePattern: ... # Undocumented NO_INHERITANCE_MARKER: str -LC_TIME: Any +LC_TIME: str | None date_ = date datetime_ = datetime time_ = time -TIMEDELTA_UNITS: Any +TIMEDELTA_UNITS: tuple[tuple[str, int], ...] -def get_period_id(time, tzinfo: Any | None = ..., type: Any | None = ..., locale=...): ... +def get_period_id( + time: _Instant, tzinfo: BaseTzInfo | None = ..., type: Literal["selection"] | None = ..., locale: Locale | str | None = ... +): ... class DateTimePattern: - pattern: Any - format: Any - def __init__(self, pattern, format) -> None: ... - def __unicode__(self): ... - def __mod__(self, other): ... - def apply(self, datetime, locale): ... + pattern: str + format: DateTimeFormat + def __init__(self, pattern: str, format: DateTimeFormat) -> None: ... + def __mod__(self, other: DateTimeFormat) -> str: ... + def apply(self, datetime: _Instant, locale: Locale | str | None) -> str: ... class DateTimeFormat: - value: Any - locale: Any - def __init__(self, value, locale) -> None: ... - def __getitem__(self, name): ... - def extract(self, char): ... - def format_era(self, char, num): ... - def format_year(self, char, num): ... - def format_quarter(self, char, num): ... - def format_month(self, char, num): ... - def format_week(self, char, num): ... - def format_weekday(self, char: str = ..., num: int = ...): ... - def format_day_of_year(self, num): ... - def format_day_of_week_in_month(self): ... - def format_period(self, char, num): ... - def format_frac_seconds(self, num): ... - def format_milliseconds_in_day(self, num): ... - def format_timezone(self, char, num): ... - def format(self, value, length): ... - def get_day_of_year(self, date: Any | None = ...): ... - def get_week_number(self, day_of_period, day_of_week: Any | None = ...): ... - -PATTERN_CHARS: Any + value: date | time + locale: Locale + def __init__(self, value: date | time, locale: Locale | str) -> None: ... + def __getitem__(self, name: str) -> str: ... + def extract(self, char: str) -> int: ... + def format_era(self, char: str, num: int) -> str: ... + def format_year(self, char: str, num: int) -> str: ... + def format_quarter(self, char: str, num: int) -> str: ... + def format_month(self, char: str, num: int) -> str: ... + def format_week(self, char: str, num: int) -> str: ... + def format_weekday(self, char: str = ..., num: int = ...) -> str: ... + def format_day_of_year(self, num: int) -> str: ... + def format_day_of_week_in_month(self) -> str: ... + def format_period(self, char: str, num: int) -> str: ... + def format_frac_seconds(self, num: int) -> str: ... + def format_milliseconds_in_day(self, num: int) -> str: ... + def format_timezone(self, char: str, num: int) -> str: ... + def format(self, value: SupportsInt, length: int) -> str: ... + def get_day_of_year(self, date: date | None = ...) -> int: ... + def get_week_number(self, day_of_period: int, day_of_week: int | None = ...) -> int: ... + +PATTERN_CHARS: dict[str, list[int] | None] PATTERN_CHAR_ORDER: str -def tokenize_pattern(pattern): ... -def untokenize_pattern(tokens): ... -def split_interval_pattern(pattern): ... -def match_skeleton(skeleton, options, allow_different_fields: bool = ...): ... +def tokenize_pattern(pattern: str) -> list[tuple[str, str | tuple[str, int]]]: ... +def untokenize_pattern(tokens: Iterable[tuple[str, str | tuple[str, int]]]) -> str: ... +def split_interval_pattern(pattern: str) -> list[str]: ... +def match_skeleton(skeleton: str, options: Iterable[str], allow_different_fields: bool = ...) -> str | None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/languages.pyi b/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/languages.pyi index 4495c51be..14ede0355 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/languages.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/languages.pyi @@ -1,2 +1,2 @@ -def get_official_languages(territory, regional: bool = ..., de_facto: bool = ...): ... -def get_territory_language_info(territory): ... +def get_official_languages(territory: str, regional: bool = ..., de_facto: bool = ...) -> tuple[str, ...]: ... +def get_territory_language_info(territory: str) -> dict[str, dict[str, float | str | None]]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/lists.pyi b/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/lists.pyi index 1b0c3a036..da8d8fc0b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/lists.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/lists.pyi @@ -1,5 +1,12 @@ -from typing import Any +from collections.abc import Iterable +from typing_extensions import Literal -DEFAULT_LOCALE: Any +from babel.core import Locale -def format_list(lst, style: str = ..., locale=...): ... +DEFAULT_LOCALE: str | None + +def format_list( + lst: Iterable[str], + style: Literal["standard", "standard-short", "or", "or-short", "unit", "unit-short", "unit-narrow"] = ..., + locale: Locale | str | None = ..., +) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/localedata.pyi b/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/localedata.pyi index c3d1ce005..e2c1a63e2 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/localedata.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/localedata.pyi @@ -1,24 +1,25 @@ -from collections.abc import MutableMapping +from collections.abc import Iterable, Iterator, Mapping, MutableMapping +from os import PathLike from typing import Any -def normalize_locale(name): ... -def resolve_locale_filename(name): ... -def exists(name): ... -def locale_identifiers(): ... -def load(name, merge_inherited: bool = ...): ... -def merge(dict1, dict2) -> None: ... +def normalize_locale(name: str) -> str | None: ... +def resolve_locale_filename(name: PathLike[str] | str) -> str: ... +def exists(name: str) -> bool: ... +def locale_identifiers() -> list[str]: ... +def load(name: PathLike[str] | str, merge_inherited: bool = ...) -> dict[str, Any]: ... +def merge(dict1: MutableMapping[Any, Any], dict2: Mapping[Any, Any]) -> None: ... class Alias: - keys: Any - def __init__(self, keys) -> None: ... - def resolve(self, data): ... + keys: tuple[str, ...] + def __init__(self, keys: Iterable[str]) -> None: ... + def resolve(self, data: Mapping[str, Any]) -> Mapping[str, Any]: ... class LocaleDataDict(MutableMapping[Any, Any]): - base: Any - def __init__(self, data, base: Any | None = ...) -> None: ... - def __len__(self): ... - def __iter__(self): ... - def __getitem__(self, key): ... - def __setitem__(self, key, value) -> None: ... - def __delitem__(self, key) -> None: ... - def copy(self): ... + base: Mapping[str, Any] + def __init__(self, data: Mapping[str | int | None, Any], base: Mapping[str | int | None, Any] | None = ...) -> None: ... + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[str | int | None]: ... + def __getitem__(self, key: str | int | None) -> Any: ... + def __setitem__(self, key: str | int | None, value: Any) -> None: ... + def __delitem__(self, key: str | int | None) -> None: ... + def copy(self) -> LocaleDataDict: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/localtime/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/localtime/__init__.pyi index 6f8a5a577..e3b772256 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/localtime/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/localtime/__init__.pyi @@ -1,16 +1,17 @@ -from datetime import tzinfo -from typing import Any +from datetime import datetime, timedelta, tzinfo -STDOFFSET: Any -DSTOFFSET: Any -DSTDIFF: Any -ZERO: Any +from pytz import BaseTzInfo + +STDOFFSET: timedelta +DSTOFFSET: timedelta +DSTDIFF: timedelta +ZERO: timedelta class _FallbackLocalTimezone(tzinfo): - def utcoffset(self, dt): ... - def dst(self, dt): ... - def tzname(self, dt): ... + def utcoffset(self, dt: datetime | None) -> timedelta: ... + def dst(self, dt: datetime | None) -> timedelta: ... + def tzname(self, dt: datetime | None) -> str: ... -def get_localzone(): ... +def get_localzone() -> BaseTzInfo: ... -LOCALTZ: Any +LOCALTZ: BaseTzInfo | _FallbackLocalTimezone diff --git a/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/localtime/_win32.pyi b/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/localtime/_win32.pyi index b22c83a6f..013330c9b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/localtime/_win32.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/localtime/_win32.pyi @@ -1,6 +1,6 @@ from typing import Any -tz_names: Any +tz_names: dict[str, str] -def valuestodict(key): ... -def get_localzone_name(): ... +def valuestodict(key) -> dict[str, Any]: ... +def get_localzone_name() -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/messages/catalog.pyi b/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/messages/catalog.pyi index 2ed4dae1e..625bdd0e0 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/messages/catalog.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/messages/catalog.pyi @@ -1,106 +1,126 @@ -from typing import Any +import datetime +from collections import OrderedDict +from collections.abc import Generator, Iterable, Iterator +from typing_extensions import TypeAlias + +from babel.core import Locale + +__all__ = ["Message", "Catalog", "TranslationError"] + +_MessageID: TypeAlias = str | tuple[str, ...] | list[str] class Message: - id: Any - string: Any - locations: Any - flags: Any - auto_comments: Any - user_comments: Any - previous_id: Any - lineno: Any - context: Any + id: _MessageID + string: _MessageID + locations: list[tuple[str, int]] + flags: set[str] + auto_comments: list[str] + user_comments: list[str] + previous_id: list[str] + lineno: int | None + context: str | None def __init__( self, - id, + id: str, string: str = ..., - locations=..., - flags=..., - auto_comments=..., - user_comments=..., - previous_id=..., - lineno: Any | None = ..., - context: Any | None = ..., + locations: Iterable[tuple[str, int]] = ..., + flags: Iterable[str] = ..., + auto_comments: Iterable[str] = ..., + user_comments: Iterable[str] = ..., + previous_id: _MessageID = ..., + lineno: int | None = ..., + context: str | None = ..., ) -> None: ... - def __cmp__(self, other): ... - def __gt__(self, other): ... - def __lt__(self, other): ... - def __ge__(self, other): ... - def __le__(self, other): ... - def __eq__(self, other): ... - def __ne__(self, other): ... - def clone(self): ... - def check(self, catalog: Any | None = ...): ... + def __cmp__(self, other: Message) -> int: ... + def __gt__(self, other: Message) -> bool: ... + def __lt__(self, other: Message) -> bool: ... + def __ge__(self, other: Message) -> bool: ... + def __le__(self, other: Message) -> bool: ... + def __eq__(self, other: object) -> bool: ... + def __ne__(self, other: object) -> bool: ... + def is_identical(self, other: Message) -> bool: ... + def clone(self) -> Message: ... + def check(self, catalog: Catalog | None = ...) -> list[TranslationError]: ... @property - def fuzzy(self): ... + def fuzzy(self) -> bool: ... @property - def pluralizable(self): ... + def pluralizable(self) -> bool: ... @property - def python_format(self): ... + def python_format(self) -> bool: ... class TranslationError(Exception): ... class Catalog: - domain: Any - locale: Any - project: Any - version: Any - copyright_holder: Any - msgid_bugs_address: Any - last_translator: Any - language_team: Any - charset: Any - creation_date: Any - revision_date: Any - fuzzy: Any - obsolete: Any + domain: str | None + project: str + version: str + copyright_holder: str + msgid_bugs_address: str + last_translator: str + language_team: str + charset: str + creation_date: datetime.datetime | str + revision_date: datetime.datetime | datetime.time | float | str + fuzzy: bool + obsolete: OrderedDict[str | tuple[str, str], Message] def __init__( self, - locale: Any | None = ..., - domain: Any | None = ..., - header_comment=..., - project: Any | None = ..., - version: Any | None = ..., - copyright_holder: Any | None = ..., - msgid_bugs_address: Any | None = ..., - creation_date: Any | None = ..., - revision_date: Any | None = ..., - last_translator: Any | None = ..., - language_team: Any | None = ..., - charset: Any | None = ..., + locale: str | Locale | None = ..., + domain: str | None = ..., + header_comment: str | None = ..., + project: str | None = ..., + version: str | None = ..., + copyright_holder: str | None = ..., + msgid_bugs_address: str | None = ..., + creation_date: datetime.datetime | str | None = ..., + revision_date: datetime.datetime | datetime.time | float | str | None = ..., + last_translator: str | None = ..., + language_team: str | None = ..., + charset: str | None = ..., fuzzy: bool = ..., ) -> None: ... @property - def locale_identifier(self): ... - header_comment: Any - mime_headers: Any + def locale(self) -> Locale | None: ... + @locale.setter # Assigning a string looks up the right Locale object. + def locale(self, value: Locale | str | None) -> None: ... + @property + def locale_identifier(self) -> str | None: ... + @property + def header_comment(self) -> str: ... + @header_comment.setter + def header_comment(self, value: str) -> None: ... + @property + def mime_headers(self) -> list[tuple[str, str]]: ... + @mime_headers.setter + def mime_headers(self, value: Iterable[tuple[str | bytes, str | bytes]]) -> None: ... @property - def num_plurals(self): ... + def num_plurals(self) -> int: ... @property - def plural_expr(self): ... + def plural_expr(self) -> str: ... @property - def plural_forms(self): ... - def __contains__(self, id): ... - def __len__(self): ... - def __iter__(self): ... - def __delitem__(self, id) -> None: ... - def __getitem__(self, id): ... - def __setitem__(self, id, message) -> None: ... + def plural_forms(self) -> str: ... + def __contains__(self, id: _MessageID) -> bool: ... + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[Message]: ... + def __delitem__(self, id: _MessageID) -> None: ... + def __getitem__(self, id: _MessageID) -> Message: ... + def __setitem__(self, id: _MessageID, message: Message) -> None: ... def add( self, - id, - string: Any | None = ..., - locations=..., - flags=..., - auto_comments=..., - user_comments=..., - previous_id=..., - lineno: Any | None = ..., - context: Any | None = ..., - ): ... - def check(self) -> None: ... - def get(self, id, context: Any | None = ...): ... - def delete(self, id, context: Any | None = ...) -> None: ... + id: _MessageID, + string: _MessageID | None = ..., + locations: Iterable[tuple[str, int]] = ..., + flags: Iterable[str] = ..., + auto_comments: Iterable[str] = ..., + user_comments: Iterable[str] = ..., + previous_id: _MessageID = ..., + lineno: int | None = ..., + context: str | None = ..., + ) -> Message: ... + def check(self) -> Generator[tuple[Message, list[TranslationError]], None, None]: ... + def get(self, id: _MessageID, context: str | None = ...): ... + def delete(self, id, context: str | None = ...) -> None: ... def update( - self, template, no_fuzzy_matching: bool = ..., update_header_comment: bool = ..., keep_user_comments: bool = ... + self, template: Catalog, no_fuzzy_matching: bool = ..., update_header_comment: bool = ..., keep_user_comments: bool = ... ) -> None: ... + def is_identical(self, other: Catalog) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/messages/checkers.pyi b/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/messages/checkers.pyi index 635794118..f115ecb3c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/messages/checkers.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/messages/checkers.pyi @@ -1,6 +1,8 @@ -from typing import Any +from collections.abc import Callable -def num_plurals(catalog, message) -> None: ... -def python_format(catalog, message) -> None: ... +from babel.messages.catalog import Catalog, Message -checkers: Any +def num_plurals(catalog: Catalog | None, message: Message) -> None: ... +def python_format(catalog: Catalog | None, message: Message) -> None: ... + +checkers: list[Callable[[Catalog | None, Message], object]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/messages/extract.pyi b/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/messages/extract.pyi index 5e7127f56..4702a953a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/messages/extract.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/messages/extract.pyi @@ -1,30 +1,85 @@ -from collections.abc import Callable -from typing import Any +from _typeshed import Incomplete, SupportsItems, SupportsRead, SupportsReadline +from collections.abc import Callable, Collection, Generator, Iterable, Mapping +from os import PathLike +from typing import Any, AnyStr, Protocol, overload +from typing_extensions import TypeAlias, TypedDict + +_Keyword: TypeAlias = tuple[int | tuple[int, int] | tuple[int, str], ...] | None GROUP_NAME: str -DEFAULT_KEYWORDS: Any -DEFAULT_MAPPING: Any +DEFAULT_KEYWORDS: dict[str, _Keyword] +DEFAULT_MAPPING: list[tuple[str, str]] empty_msgid_warning: str +@overload +def extract_from_dir( + dirname: AnyStr | PathLike[AnyStr], + method_map: Iterable[tuple[str, str]] = ..., + options_map: SupportsItems[str, dict[str, Any]] | None = ..., + keywords: Mapping[str, _Keyword] = ..., + comment_tags: Collection[str] = ..., + callback: Callable[[AnyStr, str, dict[str, Any]], object] | None = ..., + strip_comment_tags: bool = ..., + directory_filter: Callable[[str], bool] | None = ..., +) -> Generator[tuple[AnyStr, int, str | tuple[str, ...], list[str], str | None], None, None]: ... +@overload def extract_from_dir( - dirname: Any | None = ..., - method_map=..., - options_map: Any | None = ..., - keywords=..., - comment_tags=..., - callback: Any | None = ..., + dirname: None = ..., # No dirname causes os.getcwd() to be used, producing str. + method_map: Iterable[tuple[str, str]] = ..., + options_map: SupportsItems[str, dict[str, Any]] | None = ..., + keywords: Mapping[str, _Keyword] = ..., + comment_tags: Collection[str] = ..., + callback: Callable[[str, str, dict[str, Any]], object] | None = ..., strip_comment_tags: bool = ..., directory_filter: Callable[[str], bool] | None = ..., -) -> None: ... +) -> Generator[tuple[str, int, str | tuple[str, ...], list[str], str | None], None, None]: ... def check_and_call_extract_file( - filepath, method_map, options_map, callback, keywords, comment_tags, strip_comment_tags, dirpath: Any | None = ... -) -> None: ... + filepath: AnyStr | PathLike[AnyStr], + method_map: Iterable[tuple[str, str]], + options_map: SupportsItems[str, dict[str, Any]], + callback: Callable[[AnyStr, str, dict[str, Any]], object] | None, + keywords: Mapping[str, _Keyword], + comment_tags: Collection[str], + strip_comment_tags, + dirpath: Incomplete | None = ..., +) -> Generator[tuple[AnyStr, int, str | tuple[str, ...], list[str], str | None], None, None]: ... def extract_from_file( - method, filename, keywords=..., comment_tags=..., options: Any | None = ..., strip_comment_tags: bool = ... -): ... + method, + filename: AnyStr | PathLike[AnyStr], + keywords: Mapping[str, _Keyword] = ..., + comment_tags: Collection[str] = ..., + options: dict[str, Any] | None = ..., + strip_comment_tags: bool = ..., +) -> list[tuple[AnyStr, int, str | tuple[str, ...], list[str], str | None]]: ... + +class _FileObj(SupportsRead[bytes], SupportsReadline[bytes], Protocol): + def seek(self, __offset: int, __whence: int = ...) -> int: ... + def tell(self) -> int: ... + def extract( - method, fileobj, keywords=..., comment_tags=..., options: Any | None = ..., strip_comment_tags: bool = ... -) -> None: ... -def extract_nothing(fileobj, keywords, comment_tags, options): ... -def extract_python(fileobj, keywords, comment_tags, options): ... -def extract_javascript(fileobj, keywords, comment_tags, options) -> None: ... + method, + fileobj: _FileObj, + keywords: Mapping[str, _Keyword] = ..., + comment_tags: Collection[str] = ..., + options: dict[str, Any] | None = ..., + strip_comment_tags: bool = ..., +) -> Iterable[tuple[int, str | tuple[str, ...], list[str], str | None]]: ... +def extract_nothing( + fileobj: _FileObj, keywords: Mapping[str, _Keyword], comment_tags: Collection[str], options: dict[str, Any] +) -> Iterable[tuple[int, str | tuple[str, ...], list[str], str | None]]: ... + +class _PyOptions(TypedDict, total=False): + encoding: str + +def extract_python( + fileobj: _FileObj, keywords: Mapping[str, _Keyword], comment_tags: Collection[str], options: _PyOptions +) -> Iterable[tuple[int, str | tuple[str, ...], list[str], str | None]]: ... + +class _JSOptions(TypedDict, total=False): + encoding: str + jsx: bool + template_string: bool + +def extract_javascript( + fileobj: _FileObj, keywords: Mapping[str, _Keyword], comment_tags: Collection[str], options: _JSOptions +) -> Iterable[tuple[int, str | tuple[str, ...], list[str], str | None]]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/messages/frontend.pyi b/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/messages/frontend.pyi index 46e866234..8bc7d5e16 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/messages/frontend.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/messages/frontend.pyi @@ -1,8 +1,9 @@ import abc +from _typeshed import Incomplete from distutils.cmd import Command as _Command from typing import Any -def listify_value(arg, split: Any | None = ...): ... +def listify_value(arg, split: Incomplete | None = ...): ... class Command(_Command, metaclass=abc.ABCMeta): as_args: Any @@ -16,7 +17,7 @@ class Command(_Command, metaclass=abc.ABCMeta): force: Any help: int finalized: int - def __init__(self, dist: Any | None = ...) -> None: ... + def __init__(self, dist: Incomplete | None = ...) -> None: ... class compile_catalog(Command): description: str @@ -111,8 +112,8 @@ class CommandLineInterface: command_classes: Any log: Any parser: Any - def run(self, argv: Any | None = ...): ... + def run(self, argv: Incomplete | None = ...): ... def main(): ... -def parse_mapping(fileobj, filename: Any | None = ...): ... +def parse_mapping(fileobj, filename: Incomplete | None = ...): ... def parse_keywords(strings=...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/messages/jslexer.pyi b/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/messages/jslexer.pyi index b08766d69..6eb487394 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/messages/jslexer.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/messages/jslexer.pyi @@ -1,21 +1,24 @@ -from typing import Any, NamedTuple +from collections.abc import Generator, Sequence +from re import Pattern +from typing import NamedTuple -operators: Any -escapes: Any -name_re: Any -dotted_name_re: Any -division_re: Any -regex_re: Any -line_re: Any -line_join_re: Any -uni_escape_re: Any +operators: Sequence[str] +escapes: dict[str, str] +name_re: Pattern[str] +dotted_name_re: Pattern[str] +division_re: Pattern[str] +regex_re: Pattern[str] +line_re: Pattern[str] +line_join_re: Pattern[str] +uni_escape_re: Pattern[str] class Token(NamedTuple): - type: Any - value: Any - lineno: Any + type: str + value: str + lineno: int -def get_rules(jsx, dotted, template_string): ... -def indicates_division(token): ... -def unquote_string(string): ... -def tokenize(source, jsx: bool = ..., dotted: bool = ..., template_string: bool = ...) -> None: ... +# Documented as private +def get_rules(jsx: bool, dotted: bool, template_string: bool) -> list[tuple[str | None, Pattern[str]]]: ... # undocumented +def indicates_division(token: Token) -> bool: ... +def unquote_string(string: str) -> str: ... +def tokenize(source: str, jsx: bool = ..., dotted: bool = ..., template_string: bool = ...) -> Generator[Token, None, None]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/messages/mofile.pyi b/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/messages/mofile.pyi index a7e7362a5..df15e4efd 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/messages/mofile.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/messages/mofile.pyi @@ -1,5 +1,9 @@ +from _typeshed import SupportsRead, SupportsWrite + +from babel.messages.catalog import Catalog + LE_MAGIC: int BE_MAGIC: int -def read_mo(fileobj): ... -def write_mo(fileobj, catalog, use_fuzzy: bool = ...) -> None: ... +def read_mo(fileobj: SupportsRead[bytes]) -> Catalog: ... +def write_mo(fileobj: SupportsWrite[bytes], catalog: Catalog, use_fuzzy: bool = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/messages/plurals.pyi b/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/messages/plurals.pyi index 9f87c986a..2d6ea9c76 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/messages/plurals.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/messages/plurals.pyi @@ -1,8 +1,6 @@ -from typing import Any - -LC_CTYPE: Any -PLURALS: Any -DEFAULT_PLURAL: Any +LC_CTYPE: str +PLURALS: dict[str, tuple[int, str]] +DEFAULT_PLURAL: tuple[int, str] class _PluralTuple(tuple[int, str]): @property @@ -12,4 +10,4 @@ class _PluralTuple(tuple[int, str]): @property def plural_forms(self) -> str: ... -def get_plural(locale=...): ... +def get_plural(locale: str = ...) -> _PluralTuple: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/messages/pofile.pyi b/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/messages/pofile.pyi index 29b451192..b349dc4bd 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/messages/pofile.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/messages/pofile.pyi @@ -1,54 +1,71 @@ -from typing import Any +from _typeshed import SupportsWrite +from collections.abc import Iterable +from re import Pattern -def unescape(string): ... -def denormalize(string): ... +from babel.core import Locale +from babel.messages.catalog import Catalog + +def unescape(string: str) -> str: ... +def denormalize(string: str) -> str: ... class PoFileError(Exception): - catalog: Any - line: Any - lineno: Any - def __init__(self, message, catalog, line, lineno) -> None: ... + catalog: Catalog + line: str + lineno: int + def __init__(self, message: str, catalog: Catalog, line: str, lineno: int) -> None: ... class _NormalizedString: - def __init__(self, *args) -> None: ... - def append(self, s) -> None: ... - def denormalize(self): ... - def __nonzero__(self): ... - __bool__: Any - def __cmp__(self, other): ... - def __gt__(self, other): ... - def __lt__(self, other): ... - def __ge__(self, other): ... - def __le__(self, other): ... - def __eq__(self, other): ... - def __ne__(self, other): ... + def __init__(self, *args: str) -> None: ... + def append(self, s: str) -> None: ... + def denormalize(self) -> str: ... + def __bool__(self) -> bool: ... + def __cmp__(self, other: object) -> int: ... + def __gt__(self, other: object) -> bool: ... + def __lt__(self, other: object) -> bool: ... + def __ge__(self, other: object) -> bool: ... + def __le__(self, other: object) -> bool: ... + def __eq__(self, other: object) -> bool: ... + def __ne__(self, other: object) -> bool: ... class PoFileParser: - catalog: Any - ignore_obsolete: Any + catalog: Catalog + ignore_obsolete: bool counter: int offset: int - abort_invalid: Any + abort_invalid: bool + # Internal variables: + messages: list[_NormalizedString] + # [index, string] lists + translations: list[list[int | _NormalizedString]] + locations: list[tuple[str, int | None]] + flags: list[str] + user_comments: list[str] + auto_comments: list[str] + context: str | None + obsolete: bool + in_msgid: bool + in_msgstr: bool + in_msgctxt: bool def __init__(self, catalog, ignore_obsolete: bool = ..., abort_invalid: bool = ...) -> None: ... - def parse(self, fileobj) -> None: ... + def parse(self, fileobj: Iterable[str | bytes]) -> None: ... def read_po( - fileobj, - locale: Any | None = ..., - domain: Any | None = ..., + fileobj: Iterable[str | bytes], + locale: str | Locale | None = ..., + domain: str | None = ..., ignore_obsolete: bool = ..., - charset: Any | None = ..., + charset: str | None = ..., abort_invalid: bool = ..., -): ... +) -> Catalog: ... -WORD_SEP: Any +WORD_SEP: Pattern[str] -def escape(string): ... -def normalize(string, prefix: str = ..., width: int = ...): ... +def escape(string: str) -> str: ... +def normalize(string: str, prefix: str = ..., width: int = ...) -> str: ... def write_po( - fileobj, - catalog, - width: int = ..., + fileobj: SupportsWrite[bytes], + catalog: Catalog, + width: int | None = ..., no_location: bool = ..., omit_header: bool = ..., sort_output: bool = ..., @@ -56,4 +73,4 @@ def write_po( ignore_obsolete: bool = ..., include_previous: bool = ..., include_lineno: bool = ..., -): ... +) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/numbers.pyi b/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/numbers.pyi index c4b27a560..f8a60df52 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/numbers.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/numbers.pyi @@ -1,94 +1,127 @@ -from typing import Any +import decimal +from datetime import date +from re import Pattern +from typing_extensions import Literal + +from babel.core import Locale long = int -LC_NUMERIC: Any +LC_NUMERIC: str | None class UnknownCurrencyError(Exception): - identifier: Any - def __init__(self, identifier) -> None: ... + identifier: str + def __init__(self, identifier: str) -> None: ... -def list_currencies(locale: Any | None = ...): ... -def validate_currency(currency, locale: Any | None = ...) -> None: ... -def is_currency(currency, locale: Any | None = ...): ... -def normalize_currency(currency, locale: Any | None = ...): ... -def get_currency_name(currency, count: Any | None = ..., locale=...): ... -def get_currency_symbol(currency, locale=...): ... -def get_currency_precision(currency): ... -def get_currency_unit_pattern(currency, count: Any | None = ..., locale=...): ... +def list_currencies(locale: Locale | str | None = ...) -> set[str]: ... +def validate_currency(currency: str, locale: Locale | str | None = ...) -> None: ... +def is_currency(currency: str, locale: Locale | str | None = ...) -> bool: ... +def normalize_currency(currency: str, locale: Locale | str | None = ...) -> str | None: ... +def get_currency_name(currency: str, count: float | decimal.Decimal | None = ..., locale: Locale | str | None = ...) -> str: ... +def get_currency_symbol(currency: str, locale: Locale | str | None = ...) -> str: ... +def get_currency_precision(currency: str) -> int: ... +def get_currency_unit_pattern(currency: str, count: float | None = ..., locale: Locale | str | None = ...) -> str: ... def get_territory_currencies( - territory, - start_date: Any | None = ..., - end_date: Any | None = ..., + territory: str, + start_date: date | None = ..., + end_date: date | None = ..., tender: bool = ..., non_tender: bool = ..., include_details: bool = ..., -): ... -def get_decimal_symbol(locale=...): ... -def get_plus_sign_symbol(locale=...): ... -def get_minus_sign_symbol(locale=...): ... -def get_exponential_symbol(locale=...): ... -def get_group_symbol(locale=...): ... -def format_number(number, locale=...): ... -def get_decimal_precision(number): ... -def get_decimal_quantum(precision): ... +) -> list[str]: ... +def get_decimal_symbol(locale: Locale | str | None = ...) -> str: ... +def get_plus_sign_symbol(locale: Locale | str | None = ...) -> str: ... +def get_minus_sign_symbol(locale: Locale | str | None = ...) -> str: ... +def get_exponential_symbol(locale: Locale | str | None = ...) -> str: ... +def get_group_symbol(locale: Locale | str | None = ...) -> str: ... +def format_number(number: float | decimal.Decimal | str, locale: Locale | str | None = ...) -> str: ... +def get_decimal_precision(number: decimal.Decimal) -> int: ... +def get_decimal_quantum(precision: int | decimal.Decimal) -> decimal.Decimal: ... def format_decimal( - number, format: Any | None = ..., locale=..., decimal_quantization: bool = ..., group_separator: bool = ... + number: float | decimal.Decimal | str, + format: str | None = ..., + locale: Locale | str | None = ..., + decimal_quantization: bool = ..., + group_separator: bool = ..., ): ... +def format_compact_decimal( + number: float, *, format_type: Literal["short", "long"] = ..., locale: Locale | str | None = ..., fraction_digits: int = ... +) -> str: ... class UnknownCurrencyFormatError(KeyError): ... def format_currency( - number, - currency, - format: Any | None = ..., - locale=..., + number: float | decimal.Decimal | str, + currency: str, + format: str | None = ..., + locale: Locale | str | None = ..., currency_digits: bool = ..., - format_type: str = ..., + format_type: Literal["name", "standard", "accounting"] = ..., decimal_quantization: bool = ..., group_separator: bool = ..., -): ... +) -> str: ... def format_percent( - number, format: Any | None = ..., locale=..., decimal_quantization: bool = ..., group_separator: bool = ... -): ... -def format_scientific(number, format: Any | None = ..., locale=..., decimal_quantization: bool = ...): ... + number: float | decimal.Decimal | str, + format: str | None = ..., + locale: Locale | str | None = ..., + decimal_quantization: bool = ..., + group_separator: bool = ..., +) -> str: ... +def format_scientific( + number: float | decimal.Decimal | str, + format: str | None = ..., + locale: Locale | str | None = ..., + decimal_quantization: bool = ..., +) -> str: ... class NumberFormatError(ValueError): - suggestions: Any - def __init__(self, message, suggestions: Any | None = ...) -> None: ... + suggestions: str | None + def __init__(self, message: str, suggestions: str | None = ...) -> None: ... -def parse_number(string, locale=...): ... -def parse_decimal(string, locale=..., strict: bool = ...): ... +def parse_number(string: str, locale: Locale | str | None = ...) -> int: ... +def parse_decimal(string: str, locale: Locale | str | None = ..., strict: bool = ...) -> decimal.Decimal: ... PREFIX_END: str NUMBER_TOKEN: str -PREFIX_PATTERN: Any -NUMBER_PATTERN: Any +PREFIX_PATTERN: str +NUMBER_PATTERN: str SUFFIX_PATTERN: str -number_re: Any +number_re: Pattern[str] -def parse_grouping(p): ... -def parse_pattern(pattern): ... +def parse_grouping(p: str) -> tuple[int, int]: ... +def parse_pattern(pattern: NumberPattern | str) -> NumberPattern: ... class NumberPattern: - pattern: Any - prefix: Any - suffix: Any - grouping: Any - int_prec: Any - frac_prec: Any - exp_prec: Any - exp_plus: Any - scale: Any - def __init__(self, pattern, prefix, suffix, grouping, int_prec, frac_prec, exp_prec, exp_plus) -> None: ... - def compute_scale(self): ... - def scientific_notation_elements(self, value, locale): ... + pattern: str + prefix: tuple[str, str] + suffix: tuple[str, str] + grouping: tuple[int, int] + int_prec: tuple[int, int] + frac_prec: tuple[int, int] + exp_prec: tuple[int, int] | None + exp_plus: bool | None + scale: Literal[0, 2, 3] + def __init__( + self, + pattern: str, + prefix: tuple[str, str], + suffix: tuple[str, str], + grouping: tuple[int, int], + int_prec: tuple[int, int], + frac_prec: tuple[int, int], + exp_prec: tuple[int, int] | None, + exp_plus: bool | None, + ) -> None: ... + def compute_scale(self) -> Literal[0, 2, 3]: ... + def scientific_notation_elements( + self, value: decimal.Decimal, locale: Locale | str | None + ) -> tuple[decimal.Decimal, int, str]: ... def apply( self, - value, - locale, - currency: Any | None = ..., + value: float | decimal.Decimal, + locale: Locale | str | None, + currency: str | None = ..., currency_digits: bool = ..., decimal_quantization: bool = ..., - force_frac: Any | None = ..., + force_frac: int | None = ..., group_separator: bool = ..., - ): ... + ) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/plural.pyi b/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/plural.pyi index 5a22caa7e..51c2ff4f4 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/plural.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/plural.pyi @@ -1,17 +1,20 @@ +import decimal +from _typeshed import Incomplete +from collections.abc import Iterable, Mapping from typing import Any -def extract_operands(source): ... +def extract_operands(source: float | decimal.Decimal) -> tuple[decimal.Decimal, int, int, int, int, int, int, int]: ... class PluralRule: - abstract: Any - def __init__(self, rules) -> None: ... + abstract: list[Any] + def __init__(self, rules: Mapping[str, str] | Iterable[tuple[str, str]]) -> None: ... @classmethod - def parse(cls, rules): ... + def parse(cls, rules: Mapping[str, str] | Iterable[tuple[str, str]] | PluralRule) -> PluralRule: ... @property - def rules(self): ... + def rules(self) -> Mapping[str, str]: ... @property - def tags(self): ... - def __call__(self, n): ... + def tags(self) -> frozenset[str]: ... + def __call__(self, n: float | decimal.Decimal) -> str: ... def to_javascript(rule): ... def to_python(rule): ... @@ -23,8 +26,8 @@ def cldr_modulo(a, b): ... class RuleError(Exception): ... def tokenize_rule(s): ... -def test_next_token(tokens, type_, value: Any | None = ...): ... -def skip_token(tokens, type_, value: Any | None = ...): ... +def test_next_token(tokens, type_, value: Incomplete | None = ...): ... +def skip_token(tokens, type_, value: Incomplete | None = ...): ... def value_node(value): ... def ident_node(name): ... def range_list_node(range_list): ... @@ -34,7 +37,7 @@ class _Parser: tokens: Any ast: Any def __init__(self, string) -> None: ... - def expect(self, type_, value: Any | None = ..., term: Any | None = ...): ... + def expect(self, type_, value: Incomplete | None = ..., term: Incomplete | None = ...): ... def condition(self): ... def and_condition(self): ... def relation(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/support.pyi b/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/support.pyi index 658eb14d7..b7c307ec8 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/support.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/support.pyi @@ -1,30 +1,45 @@ import gettext +from _typeshed import Incomplete +from datetime import date as _date, datetime as _datetime, time as _time, timedelta as _timedelta +from decimal import Decimal from typing import Any +from typing_extensions import Literal + +from babel.core import Locale +from pytz import BaseTzInfo + +from .dates import _PredefinedTimeFormat class Format: - locale: Any - tzinfo: Any - def __init__(self, locale, tzinfo: Any | None = ...) -> None: ... - def date(self, date: Any | None = ..., format: str = ...): ... - def datetime(self, datetime: Any | None = ..., format: str = ...): ... - def time(self, time: Any | None = ..., format: str = ...): ... - def timedelta(self, delta, granularity: str = ..., threshold: float = ..., format: str = ..., add_direction: bool = ...): ... - def number(self, number): ... - def decimal(self, number, format: Any | None = ...): ... - def currency(self, number, currency): ... - def percent(self, number, format: Any | None = ...): ... - def scientific(self, number): ... + locale: Locale + tzinfo: BaseTzInfo | None + def __init__(self, locale: Locale | str, tzinfo: BaseTzInfo | None = ...) -> None: ... + def date(self, date: _date | None = ..., format: _PredefinedTimeFormat | str = ...) -> str: ... + def datetime(self, datetime: _date | None = ..., format: _PredefinedTimeFormat | str = ...) -> str: ... + def time(self, time: _time | _datetime | None = ..., format: _PredefinedTimeFormat | str = ...) -> str: ... + def timedelta( + self, + delta: _timedelta | int, + granularity: Literal["year", "month", "week", "day", "hour", "minute", "second"] = ..., + threshold: float = ..., + format: _PredefinedTimeFormat = ..., + add_direction: bool = ..., + ) -> str: ... + def number(self, number: float | Decimal | str) -> str: ... + def decimal(self, number: float | Decimal | str, format: str | None = ...) -> str: ... + def currency(self, number: float | Decimal | str, currency: str) -> str: ... + def percent(self, number: float | Decimal | str, format: str | None = ...) -> str: ... + def scientific(self, number: float | Decimal | str) -> str: ... class LazyProxy: def __init__(self, func, *args, **kwargs) -> None: ... @property def value(self): ... def __contains__(self, key): ... - def __nonzero__(self): ... + def __bool__(self) -> bool: ... def __dir__(self): ... def __iter__(self): ... - def __len__(self): ... - def __unicode__(self): ... + def __len__(self) -> int: ... def __add__(self, other): ... def __radd__(self, other): ... def __mod__(self, other): ... @@ -38,9 +53,9 @@ class LazyProxy: def __ne__(self, other): ... def __gt__(self, other): ... def __ge__(self, other): ... - def __delattr__(self, name) -> None: ... - def __getattr__(self, name): ... - def __setattr__(self, name, value) -> None: ... + def __delattr__(self, name: str) -> None: ... + def __getattr__(self, name: str): ... + def __setattr__(self, name: str, value) -> None: ... def __delitem__(self, key) -> None: ... def __getitem__(self, key): ... def __setitem__(self, key, value) -> None: ... @@ -52,7 +67,7 @@ class NullTranslations(gettext.NullTranslations): plural: Any files: Any domain: Any - def __init__(self, fp: Any | None = ...): ... + def __init__(self, fp: Incomplete | None = ...): ... def dgettext(self, domain, message): ... def ldgettext(self, domain, message): ... def udgettext(self, domain, message): ... @@ -82,10 +97,10 @@ class NullTranslations(gettext.NullTranslations): class Translations(NullTranslations, gettext.GNUTranslations): DEFAULT_DOMAIN: str domain: Any - def __init__(self, fp: Any | None = ..., domain: Any | None = ...) -> None: ... + def __init__(self, fp: Incomplete | None = ..., domain: Incomplete | None = ...) -> None: ... ugettext: Any ungettext: Any @classmethod - def load(cls, dirname: Any | None = ..., locales: Any | None = ..., domain: Any | None = ...): ... + def load(cls, dirname: Incomplete | None = ..., locales: Incomplete | None = ..., domain: Incomplete | None = ...): ... def add(self, translations, merge: bool = ...): ... def merge(self, translations): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/units.pyi b/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/units.pyi index b11b8ad88..90808cabd 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/units.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/units.pyi @@ -1,16 +1,27 @@ -from typing import Any +import decimal +from typing_extensions import Literal + +from babel.core import Locale class UnknownUnitError(ValueError): - def __init__(self, unit, locale) -> None: ... + def __init__(self, unit: str, locale: Locale) -> None: ... -def get_unit_name(measurement_unit, length: str = ..., locale=...): ... -def format_unit(value, measurement_unit, length: str = ..., format: Any | None = ..., locale=...): ... +def get_unit_name( + measurement_unit: str, length: Literal["short", "long", "narrow"] = ..., locale: Locale | str | None = ... +) -> str: ... +def format_unit( + value: float | decimal.Decimal, + measurement_unit: str, + length: Literal["short", "long", "narrow"] = ..., + format: str | None = ..., + locale: Locale | str | None = ..., +) -> str: ... def format_compound_unit( - numerator_value, - numerator_unit: Any | None = ..., - denominator_value: int = ..., - denominator_unit: Any | None = ..., - length: str = ..., - format: Any | None = ..., - locale=..., -): ... + numerator_value: float | decimal.Decimal, + numerator_unit: str | None = ..., + denominator_value: float | decimal.Decimal = ..., + denominator_unit: str | None = ..., + length: Literal["short", "long", "narrow"] = ..., + format: str | None = ..., + locale: Locale | str | None = ..., +) -> str | None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/util.pyi b/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/util.pyi index 48b6720aa..7b40659de 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/util.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/babel/babel/util.pyi @@ -1,42 +1,46 @@ import collections import textwrap -from datetime import tzinfo -from typing import Any +from collections.abc import Generator, Iterable +from datetime import timedelta, tzinfo +from re import Pattern +from typing import IO, Any, TypeVar from babel import localtime as localtime from pytz import BaseTzInfo -missing: Any +missing: object -def distinct(iterable) -> None: ... +_T = TypeVar("_T") -PYTHON_MAGIC_COMMENT_re: Any +def distinct(iterable: Iterable[_T]) -> Generator[_T, None, None]: ... -def parse_encoding(fp): ... +PYTHON_MAGIC_COMMENT_re: Pattern[bytes] -PYTHON_FUTURE_IMPORT_re: Any +def parse_encoding(fp: IO[bytes]) -> str | None: ... -def parse_future_flags(fp, encoding: str = ...): ... -def pathmatch(pattern, filename): ... +PYTHON_FUTURE_IMPORT_re: Pattern[str] + +def parse_future_flags(fp: IO[bytes], encoding: str = ...) -> int: ... +def pathmatch(pattern: str, filename: str) -> bool: ... class TextWrapper(textwrap.TextWrapper): - wordsep_re: Any + wordsep_re: Pattern[str] def wraptext(text, width: int = ..., initial_indent: str = ..., subsequent_indent: str = ...): ... odict = collections.OrderedDict class FixedOffsetTimezone(tzinfo): - zone: Any - def __init__(self, offset, name: Any | None = ...) -> None: ... - def utcoffset(self, dt): ... - def tzname(self, dt): ... - def dst(self, dt): ... + zone: str + def __init__(self, offset: float, name: str | None = ...) -> None: ... + def utcoffset(self, dt: Any) -> timedelta: ... + def tzname(self, dt: Any) -> str: ... + def dst(self, dt: Any) -> timedelta: ... UTC: BaseTzInfo LOCALTZ: BaseTzInfo get_localzone = localtime.get_localzone -STDOFFSET: Any -DSTOFFSET: Any -DSTDIFF: Any -ZERO: Any +STDOFFSET: timedelta +DSTOFFSET: timedelta +DSTDIFF: timedelta +ZERO: timedelta diff --git a/packages/pyright-internal/typeshed-fallback/stubs/backports.ssl_match_hostname/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/backports.ssl_match_hostname/METADATA.toml deleted file mode 100644 index e48ee2d14..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/backports.ssl_match_hostname/METADATA.toml +++ /dev/null @@ -1,4 +0,0 @@ -version = "3.7.*" - -[tool.stubtest] -ignore_missing_stub = false diff --git a/packages/pyright-internal/typeshed-fallback/stubs/backports.ssl_match_hostname/backports/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/backports.ssl_match_hostname/backports/__init__.pyi deleted file mode 100644 index cb0474fb0..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/backports.ssl_match_hostname/backports/__init__.pyi +++ /dev/null @@ -1,4 +0,0 @@ -from typing import Any - -# Explicitly mark this package as incomplete. -def __getattr__(name: str) -> Any: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/backports.ssl_match_hostname/backports/ssl_match_hostname/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/backports.ssl_match_hostname/backports/ssl_match_hostname/__init__.pyi deleted file mode 100644 index c21998013..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/backports.ssl_match_hostname/backports/ssl_match_hostname/__init__.pyi +++ /dev/null @@ -1,3 +0,0 @@ -class CertificateError(ValueError): ... - -def match_hostname(cert, hostname): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/beautifulsoup4/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/beautifulsoup4/METADATA.toml index 9c5a4bca2..ba9a16498 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/beautifulsoup4/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/beautifulsoup4/METADATA.toml @@ -1 +1,6 @@ version = "4.11.*" +requires = ["types-html5lib"] + +[tool.stubtest] +ignore_missing_stub = true +extras = ["html5lib", "lxml"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/beautifulsoup4/bs4/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/beautifulsoup4/bs4/__init__.pyi index adbecc0a3..21ed6f204 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/beautifulsoup4/bs4/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/beautifulsoup4/bs4/__init__.pyi @@ -1,6 +1,7 @@ -from _typeshed import Self, SupportsRead +from _typeshed import Incomplete, SupportsRead from collections.abc import Sequence from typing import Any +from typing_extensions import Self from .builder import ParserRejectedMarkup as ParserRejectedMarkup, TreeBuilder, XMLParsedAsHTMLWarning as XMLParsedAsHTMLWarning from .element import ( @@ -45,7 +46,7 @@ class BeautifulSoup(Tag): element_classes: dict[type[PageElement], type[Any]] | None = ..., **kwargs, ) -> None: ... - def __copy__(self: Self) -> Self: ... + def __copy__(self) -> Self: ... hidden: bool current_data: Any currentTag: Any @@ -57,32 +58,32 @@ class BeautifulSoup(Tag): def new_tag( self, name, - namespace: Any | None = ..., - nsprefix: Any | None = ..., + namespace: Incomplete | None = ..., + nsprefix: Incomplete | None = ..., attrs=..., - sourceline: Any | None = ..., - sourcepos: Any | None = ..., + sourceline: Incomplete | None = ..., + sourcepos: Incomplete | None = ..., **kwattrs, ) -> Tag: ... - def string_container(self, base_class: Any | None = ...): ... - def new_string(self, s, subclass: Any | None = ...): ... + def string_container(self, base_class: Incomplete | None = ...): ... + def new_string(self, s, subclass: Incomplete | None = ...): ... def insert_before(self, *args) -> None: ... def insert_after(self, *args) -> None: ... def popTag(self): ... def pushTag(self, tag) -> None: ... - def endData(self, containerClass: Any | None = ...) -> None: ... - def object_was_parsed(self, o, parent: Any | None = ..., most_recent_element: Any | None = ...) -> None: ... + def endData(self, containerClass: Incomplete | None = ...) -> None: ... + def object_was_parsed(self, o, parent: Incomplete | None = ..., most_recent_element: Incomplete | None = ...) -> None: ... def handle_starttag( self, name, namespace, nsprefix, attrs, - sourceline: Any | None = ..., - sourcepos: Any | None = ..., + sourceline: Incomplete | None = ..., + sourcepos: Incomplete | None = ..., namespaces: dict[str, str] | None = ..., ): ... - def handle_endtag(self, name, nsprefix: Any | None = ...) -> None: ... + def handle_endtag(self, name, nsprefix: Incomplete | None = ...) -> None: ... def handle_data(self, data) -> None: ... def decode( # type: ignore[override] self, pretty_print: bool = ..., eventual_encoding: str = ..., formatter: str | Formatter = ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/beautifulsoup4/bs4/builder/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/beautifulsoup4/bs4/builder/__init__.pyi index 13c8a48e3..3807629e9 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/beautifulsoup4/bs4/builder/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/beautifulsoup4/bs4/builder/__init__.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any class TreeBuilderRegistry: @@ -34,9 +35,9 @@ class TreeBuilder: def prepare_markup( self, markup, - user_specified_encoding: Any | None = ..., - document_declared_encoding: Any | None = ..., - exclude_encodings: Any | None = ..., + user_specified_encoding: Incomplete | None = ..., + document_declared_encoding: Incomplete | None = ..., + exclude_encodings: Incomplete | None = ..., ) -> None: ... def test_fragment_to_document(self, fragment): ... def set_up_substitutions(self, tag): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/beautifulsoup4/bs4/builder/_html5lib.pyi b/packages/pyright-internal/typeshed-fallback/stubs/beautifulsoup4/bs4/builder/_html5lib.pyi index 5fa502b00..412d1afa7 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/beautifulsoup4/bs4/builder/_html5lib.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/beautifulsoup4/bs4/builder/_html5lib.pyi @@ -1,6 +1,8 @@ +from _typeshed import Incomplete from typing import Any from bs4.builder import HTMLTreeBuilder +from html5lib.treebuilders import base as treebuilder_base class HTML5TreeBuilder(HTMLTreeBuilder): NAME: str @@ -8,18 +10,24 @@ class HTML5TreeBuilder(HTMLTreeBuilder): TRACKS_LINE_NUMBERS: bool user_specified_encoding: Any def prepare_markup( # type: ignore[override] # user_specified_encoding doesn't have a default - self, markup, user_specified_encoding, document_declared_encoding: Any | None = ..., exclude_encodings: Any | None = ... + self, + markup, + user_specified_encoding, + document_declared_encoding: Incomplete | None = ..., + exclude_encodings: Incomplete | None = ..., ) -> None: ... def feed(self, markup) -> None: ... underlying_builder: Any def create_treebuilder(self, namespaceHTMLElements): ... def test_fragment_to_document(self, fragment): ... -class TreeBuilderForHtml5lib(Any): # html5lib.treebuilders.base.TreeBuilder +class TreeBuilderForHtml5lib(treebuilder_base.TreeBuilder): soup: Any parser: Any store_line_numbers: Any - def __init__(self, namespaceHTMLElements, soup: Any | None = ..., store_line_numbers: bool = ..., **kwargs) -> None: ... + def __init__( + self, namespaceHTMLElements, soup: Incomplete | None = ..., store_line_numbers: bool = ..., **kwargs + ) -> None: ... def documentClass(self): ... def insertDoctype(self, token) -> None: ... def elementClass(self, name, namespace): ... @@ -38,11 +46,11 @@ class AttrList: def __setitem__(self, name, value) -> None: ... def items(self): ... def keys(self): ... - def __len__(self): ... + def __len__(self) -> int: ... def __getitem__(self, name): ... def __contains__(self, name): ... -class Element(Any): # html5lib.treebuilders.base.Node +class Element(treebuilder_base.Node): element: Any soup: Any namespace: Any @@ -51,7 +59,7 @@ class Element(Any): # html5lib.treebuilders.base.Node def getAttributes(self): ... def setAttributes(self, attributes) -> None: ... attributes: Any - def insertText(self, data, insertBefore: Any | None = ...) -> None: ... + def insertText(self, data, insertBefore: Incomplete | None = ...) -> None: ... def insertBefore(self, node, refNode) -> None: ... def removeChild(self, node) -> None: ... def reparentChildren(self, new_parent) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/beautifulsoup4/bs4/builder/_htmlparser.pyi b/packages/pyright-internal/typeshed-fallback/stubs/beautifulsoup4/bs4/builder/_htmlparser.pyi index bca74d70c..b21a0d44e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/beautifulsoup4/bs4/builder/_htmlparser.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/beautifulsoup4/bs4/builder/_htmlparser.pyi @@ -1,17 +1,15 @@ +from _typeshed import Incomplete from html.parser import HTMLParser from typing import Any from bs4.builder import HTMLTreeBuilder -class HTMLParseError(Exception): ... - class BeautifulSoupHTMLParser(HTMLParser): IGNORE: str REPLACE: str on_duplicate_attribute: Any already_closed_empty_element: Any def __init__(self, *args, **kwargs) -> None: ... - def error(self, msg: str) -> None: ... def handle_startendtag(self, name, attrs) -> None: ... def handle_starttag(self, name, attrs, handle_empty_element: bool = ...) -> None: ... def handle_endtag(self, name, check_already_closed: bool = ...) -> None: ... @@ -30,12 +28,12 @@ class HTMLParserTreeBuilder(HTMLTreeBuilder): features: Any TRACKS_LINE_NUMBERS: bool parser_args: Any - def __init__(self, parser_args: Any | None = ..., parser_kwargs: Any | None = ..., **kwargs) -> None: ... + def __init__(self, parser_args: Incomplete | None = ..., parser_kwargs: Incomplete | None = ..., **kwargs) -> None: ... def prepare_markup( self, markup, - user_specified_encoding: Any | None = ..., - document_declared_encoding: Any | None = ..., - exclude_encodings: Any | None = ..., + user_specified_encoding: Incomplete | None = ..., + document_declared_encoding: Incomplete | None = ..., + exclude_encodings: Incomplete | None = ..., ) -> None: ... def feed(self, markup) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/beautifulsoup4/bs4/builder/_lxml.pyi b/packages/pyright-internal/typeshed-fallback/stubs/beautifulsoup4/bs4/builder/_lxml.pyi index b206067cd..ef57b0583 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/beautifulsoup4/bs4/builder/_lxml.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/beautifulsoup4/bs4/builder/_lxml.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from bs4.builder import HTMLTreeBuilder, TreeBuilder @@ -18,13 +19,13 @@ class LXMLTreeBuilderForXML(TreeBuilder): empty_element_tags: Any soup: Any nsmaps: Any - def __init__(self, parser: Any | None = ..., empty_element_tags: Any | None = ..., **kwargs) -> None: ... + def __init__(self, parser: Incomplete | None = ..., empty_element_tags: Incomplete | None = ..., **kwargs) -> None: ... def prepare_markup( # type: ignore[override] # the order of the parameters is different self, markup, - user_specified_encoding: Any | None = ..., - exclude_encodings: Any | None = ..., - document_declared_encoding: Any | None = ..., + user_specified_encoding: Incomplete | None = ..., + exclude_encodings: Incomplete | None = ..., + document_declared_encoding: Incomplete | None = ..., ) -> None: ... parser: Any def feed(self, markup) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/beautifulsoup4/bs4/dammit.pyi b/packages/pyright-internal/typeshed-fallback/stubs/beautifulsoup4/bs4/dammit.pyi index 87c3b2be9..6422049e0 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/beautifulsoup4/bs4/dammit.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/beautifulsoup4/bs4/dammit.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from collections.abc import Iterable, Iterator from logging import Logger from typing import Any @@ -29,7 +30,7 @@ class EncodingDetector: known_definite_encodings: list[str] user_encodings: list[str] exclude_encodings: set[str] - chardet_encoding: Any | None + chardet_encoding: Incomplete | None is_html: bool declared_encoding: str | None markup: Any @@ -61,7 +62,7 @@ class UnicodeDammit: detector: EncodingDetector markup: Any unicode_markup: str - original_encoding: Any | None + original_encoding: Incomplete | None def __init__( self, markup, diff --git a/packages/pyright-internal/typeshed-fallback/stubs/beautifulsoup4/bs4/element.pyi b/packages/pyright-internal/typeshed-fallback/stubs/beautifulsoup4/bs4/element.pyi index 3015a7759..f7fa39afa 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/beautifulsoup4/bs4/element.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/beautifulsoup4/bs4/element.pyi @@ -1,8 +1,8 @@ -from _typeshed import Self +from _typeshed import Incomplete from collections.abc import Callable, Iterable, Iterator from re import Pattern from typing import Any, Generic, TypeVar, overload -from typing_extensions import TypeAlias +from typing_extensions import Self, TypeAlias from . import BeautifulSoup from .builder import TreeBuilder @@ -14,7 +14,7 @@ whitespace_re: Pattern[str] PYTHON_SPECIFIC_ENCODINGS: set[str] class NamespacedAttribute(str): - def __new__(cls: type[Self], prefix: str, name: str | None = ..., namespace: str | None = ...) -> Self: ... + def __new__(cls, prefix: str, name: str | None = ..., namespace: str | None = ...) -> Self: ... class AttributeValueWithCharsetSubstitution(str): ... @@ -57,13 +57,13 @@ class PageElement: getText = get_text @property def text(self) -> str: ... - def replace_with(self: Self, *args: PageElement | str) -> Self: ... + def replace_with(self, *args: PageElement | str) -> Self: ... replaceWith = replace_with - def unwrap(self: Self) -> Self: ... + def unwrap(self) -> Self: ... replace_with_children = unwrap replaceWithChildren = unwrap def wrap(self, wrap_inside: _PageElementT) -> _PageElementT: ... - def extract(self: Self, _self_index: int | None = ...) -> Self: ... + def extract(self, _self_index: int | None = ...) -> Self: ... def insert(self, position: int, new_child: PageElement | str) -> None: ... def append(self, tag: PageElement | str) -> None: ... def extend(self, tags: Iterable[PageElement | str]) -> None: ... @@ -182,8 +182,8 @@ class NavigableString(str, PageElement): PREFIX: str SUFFIX: str known_xml: bool | None - def __new__(cls: type[Self], value: str | bytes) -> Self: ... - def __copy__(self: Self) -> Self: ... + def __new__(cls, value: str | bytes) -> Self: ... + def __copy__(self) -> Self: ... def __getnewargs__(self) -> tuple[str]: ... def output_ready(self, formatter: Formatter | str | None = ...) -> str: ... @property @@ -260,7 +260,7 @@ class Tag(PageElement): namespaces: dict[str, str] | None = ..., ) -> None: ... parserClass: type[BeautifulSoup] | None - def __copy__(self: Self) -> Self: ... + def __copy__(self) -> Self: ... @property def is_empty_element(self) -> bool: ... @property @@ -329,8 +329,18 @@ class Tag(PageElement): def children(self) -> Iterable[PageElement]: ... @property def descendants(self) -> Iterable[PageElement]: ... - def select_one(self, selector: str, namespaces: Any | None = ..., **kwargs) -> Tag | None: ... - def select(self, selector: str, namespaces: Any | None = ..., limit: int | None = ..., **kwargs) -> ResultSet[Tag]: ... + def select_one( + self, selector: str, namespaces: Incomplete | None = ..., *, flags: int = ..., custom: dict[str, str] | None = ... + ) -> Tag | None: ... + def select( + self, + selector: str, + namespaces: Incomplete | None = ..., + limit: int | None = ..., + *, + flags: int = ..., + custom: dict[str, str] | None = ..., + ) -> ResultSet[Tag]: ... def childGenerator(self) -> Iterable[PageElement]: ... def recursiveChildGenerator(self) -> Iterable[PageElement]: ... def has_key(self, key: str) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/bleach/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/bleach/METADATA.toml index c98db6304..5221c4123 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/bleach/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/bleach/METADATA.toml @@ -1 +1,4 @@ -version = "5.0.*" +version = "6.0.*" + +[tool.stubtest] +ignore_missing_stub = true diff --git a/packages/pyright-internal/typeshed-fallback/stubs/bleach/bleach/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/bleach/bleach/__init__.pyi index 94186a545..5ce681f23 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/bleach/bleach/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/bleach/bleach/__init__.pyi @@ -1,7 +1,9 @@ from collections.abc import Container, Iterable +from typing_extensions import TypeAlias +from .callbacks import _Callback from .css_sanitizer import CSSSanitizer -from .linkifier import DEFAULT_CALLBACKS as DEFAULT_CALLBACKS, Linker as Linker, _Callback +from .linkifier import DEFAULT_CALLBACKS as DEFAULT_CALLBACKS, Linker as Linker from .sanitizer import ( ALLOWED_ATTRIBUTES as ALLOWED_ATTRIBUTES, ALLOWED_PROTOCOLS as ALLOWED_PROTOCOLS, @@ -15,11 +17,13 @@ __all__ = ["clean", "linkify"] __releasedate__: str __version__: str +_HTMLAttrKey: TypeAlias = tuple[str | None, str] # noqa: Y047 + def clean( text: str, - tags: Container[str] = ..., + tags: Iterable[str] = ..., attributes: _Attributes = ..., - protocols: Container[str] = ..., + protocols: Iterable[str] = ..., strip: bool = ..., strip_comments: bool = ..., css_sanitizer: CSSSanitizer | None = ..., diff --git a/packages/pyright-internal/typeshed-fallback/stubs/bleach/bleach/callbacks.pyi b/packages/pyright-internal/typeshed-fallback/stubs/bleach/bleach/callbacks.pyi index 4fe9723ee..54e94d3e2 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/bleach/bleach/callbacks.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/bleach/bleach/callbacks.pyi @@ -1,8 +1,13 @@ from collections.abc import MutableMapping -from typing import Any +from typing import Protocol from typing_extensions import TypeAlias -_Attrs: TypeAlias = MutableMapping[Any, str] +from bleach import _HTMLAttrKey -def nofollow(attrs: _Attrs, new: bool = ...) -> _Attrs: ... -def target_blank(attrs: _Attrs, new: bool = ...) -> _Attrs: ... +_HTMLAttrs: TypeAlias = MutableMapping[_HTMLAttrKey, str] + +class _Callback(Protocol): # noqa: Y046 + def __call__(self, attrs: _HTMLAttrs, new: bool = ...) -> _HTMLAttrs: ... + +def nofollow(attrs: _HTMLAttrs, new: bool = ...) -> _HTMLAttrs: ... +def target_blank(attrs: _HTMLAttrs, new: bool = ...) -> _HTMLAttrs: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/bleach/bleach/html5lib_shim.pyi b/packages/pyright-internal/typeshed-fallback/stubs/bleach/bleach/html5lib_shim.pyi index 52a028156..bfe7e9cac 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/bleach/bleach/html5lib_shim.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/bleach/bleach/html5lib_shim.pyi @@ -1,17 +1,17 @@ +from _typeshed import Incomplete from collections.abc import Generator, Iterable -from typing import Any class HTMLParser: # actually html5lib.HTMLParser - def __getattr__(self, __name: str) -> Any: ... # incomplete + def __getattr__(self, __name: str) -> Incomplete: ... class Filter: # actually html5lib.filters.base.Filter - def __getattr__(self, __name: str) -> Any: ... # incomplete + def __getattr__(self, __name: str) -> Incomplete: ... class SanitizerFilter: # actually html5lib.filters.sanitizer.Filter - def __getattr__(self, __name: str) -> Any: ... # incomplete + def __getattr__(self, __name: str) -> Incomplete: ... class HTMLSerializer: # actually html5lib.serializer.HTMLSerializer - def __getattr__(self, __name: str) -> Any: ... # incomplete + def __getattr__(self, __name: str) -> Incomplete: ... class BleachHTMLParser(HTMLParser): tags: list[str] | None @@ -24,4 +24,4 @@ class BleachHTMLSerializer(HTMLSerializer): def escape_base_amp(self, stoken: str) -> Generator[str, None, None]: ... def serialize(self, treewalker, encoding: str | None = ...) -> Generator[str, None, None]: ... -def __getattr__(__name: str) -> Any: ... # incomplete +def __getattr__(__name: str) -> Incomplete: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/bleach/bleach/linkifier.pyi b/packages/pyright-internal/typeshed-fallback/stubs/bleach/bleach/linkifier.pyi index fbe3d38a7..d9555a53c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/bleach/bleach/linkifier.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/bleach/bleach/linkifier.pyi @@ -1,15 +1,10 @@ -from collections.abc import Container, Iterable, MutableMapping +from _typeshed import Incomplete +from collections.abc import Container, Iterable, Iterator from re import Pattern -from typing import Any, Protocol -from typing_extensions import TypeAlias +from .callbacks import _Callback from .html5lib_shim import Filter -_Attrs: TypeAlias = MutableMapping[Any, str] - -class _Callback(Protocol): - def __call__(self, attrs: _Attrs, new: bool = ...) -> _Attrs: ... - DEFAULT_CALLBACKS: list[_Callback] TLDS: list[str] @@ -27,8 +22,8 @@ class Linker: def __init__( self, callbacks: Iterable[_Callback] = ..., - skip_tags: Container[str] | None = ..., - parse_email: bool = ..., + skip_tags: Container[str] | None = None, + parse_email: bool = False, url_re: Pattern[str] = ..., email_re: Pattern[str] = ..., recognized_tags: Container[str] | None = ..., @@ -36,12 +31,25 @@ class Linker: def linkify(self, text: str) -> str: ... class LinkifyFilter(Filter): - callbacks: Any + callbacks: Iterable[_Callback] skip_tags: Container[str] parse_email: bool - url_re: Any - email_re: Any + url_re: Pattern[str] + email_re: Pattern[str] def __init__( - self, source, callbacks=..., skip_tags: Container[str] | None = ..., parse_email: bool = ..., url_re=..., email_re=... + self, + source, + callbacks: Iterable[_Callback] | None = ..., + skip_tags: Container[str] | None = None, + parse_email: bool = False, + url_re: Pattern[str] = ..., + email_re: Pattern[str] = ..., ) -> None: ... - def __getattr__(self, item: str) -> Any: ... # incomplete + def apply_callbacks(self, attrs, is_new): ... + def extract_character_data(self, token_list): ... + def handle_email_addresses(self, src_iter): ... + def strip_non_url_bits(self, fragment): ... + def handle_links(self, src_iter): ... + def handle_a_tag(self, token_buffer): ... + def extract_entities(self, token): ... + def __iter__(self) -> Iterator[Incomplete]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/bleach/bleach/sanitizer.pyi b/packages/pyright-internal/typeshed-fallback/stubs/bleach/bleach/sanitizer.pyi index 810b61328..fc2fd8107 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/bleach/bleach/sanitizer.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/bleach/bleach/sanitizer.pyi @@ -1,38 +1,47 @@ -from collections.abc import Callable, Container, Iterable +from _typeshed import Incomplete +from collections.abc import Callable, Iterable from re import Pattern -from typing import Any +from typing import Protocol from typing_extensions import TypeAlias +from . import _HTMLAttrKey from .css_sanitizer import CSSSanitizer from .html5lib_shim import BleachHTMLParser, BleachHTMLSerializer, SanitizerFilter -ALLOWED_TAGS: list[str] +ALLOWED_TAGS: frozenset[str] ALLOWED_ATTRIBUTES: dict[str, list[str]] -ALLOWED_PROTOCOLS: list[str] +ALLOWED_PROTOCOLS: frozenset[str] INVISIBLE_CHARACTERS: str INVISIBLE_CHARACTERS_RE: Pattern[str] INVISIBLE_REPLACEMENT_CHAR: str # A html5lib Filter class -_Filter: TypeAlias = Any +class _Filter(Protocol): + def __call__(self, *, source: BleachSanitizerFilter) -> Incomplete: ... + +_AttributeFilter: TypeAlias = Callable[[str, str, str], bool] +_AttributeDict: TypeAlias = dict[str, list[str] | _AttributeFilter] | dict[str, list[str]] | dict[str, _AttributeFilter] +_Attributes: TypeAlias = _AttributeFilter | _AttributeDict | list[str] + +_TreeWalker: TypeAlias = Callable[[Incomplete], Incomplete] class Cleaner: - tags: Container[str] + tags: Iterable[str] attributes: _Attributes - protocols: Container[str] + protocols: Iterable[str] strip: bool strip_comments: bool filters: Iterable[_Filter] css_sanitizer: CSSSanitizer | None parser: BleachHTMLParser - walker: Any + walker: _TreeWalker serializer: BleachHTMLSerializer def __init__( self, - tags: Container[str] = ..., + tags: Iterable[str] = ..., attributes: _Attributes = ..., - protocols: Container[str] = ..., + protocols: Iterable[str] = ..., strip: bool = ..., strip_comments: bool = ..., filters: Iterable[_Filter] | None = ..., @@ -40,26 +49,30 @@ class Cleaner: ) -> None: ... def clean(self, text: str) -> str: ... -_AttributeFilter: TypeAlias = Callable[[str, str, str], bool] -_AttributeDict: TypeAlias = dict[str, list[str] | _AttributeFilter] | dict[str, list[str]] | dict[str, _AttributeFilter] -_Attributes: TypeAlias = _AttributeFilter | _AttributeDict | list[str] - def attribute_filter_factory(attributes: _Attributes) -> _AttributeFilter: ... class BleachSanitizerFilter(SanitizerFilter): + allowed_tags: frozenset[str] + allowed_protocols: frozenset[str] attr_filter: _AttributeFilter - strip_disallowed_elements: bool + strip_disallowed_tags: bool strip_html_comments: bool + attr_val_is_uri: frozenset[_HTMLAttrKey] + svg_attr_val_allows_ref: frozenset[_HTMLAttrKey] + svg_allow_local_href: frozenset[_HTMLAttrKey] + css_sanitizer: CSSSanitizer | None def __init__( self, source, - allowed_elements: Container[str] = ..., + allowed_tags: Iterable[str] = ..., attributes: _Attributes = ..., - allowed_protocols: Container[str] = ..., - strip_disallowed_elements: bool = ..., - strip_html_comments: bool = ..., - css_sanitizer: CSSSanitizer | None = ..., - **kwargs, + allowed_protocols: Iterable[str] = ..., + attr_val_is_uri: frozenset[_HTMLAttrKey] = ..., + svg_attr_val_allows_ref: frozenset[_HTMLAttrKey] = ..., + svg_allow_local_href: frozenset[_HTMLAttrKey] = ..., + strip_disallowed_tags: bool = False, + strip_html_comments: bool = True, + css_sanitizer: CSSSanitizer | None = None, ) -> None: ... def sanitize_stream(self, token_iterator): ... def merge_characters(self, token_iterator): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/boto/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/boto/METADATA.toml index e34024ecc..ca0c1fad6 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/boto/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/boto/METADATA.toml @@ -1,2 +1,5 @@ version = "2.49.*" -requires = ["types-six"] +requires = [] + +[tool.stubtest] +ignore_missing_stub = true diff --git a/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/__init__.pyi index 6a1c529e2..e3dc24ae1 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/__init__.pyi @@ -1,4 +1,5 @@ import logging +from _typeshed import Incomplete from typing import Any from .s3.connection import S3Connection @@ -20,76 +21,100 @@ class NullHandler(logging.Handler): log: Any perflog: Any -def set_file_logger(name, filepath, level: Any = ..., format_string: Any | None = ...): ... -def set_stream_logger(name, level: Any = ..., format_string: Any | None = ...): ... -def connect_sqs(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ... +def set_file_logger(name, filepath, level: Any = ..., format_string: Incomplete | None = ...): ... +def set_stream_logger(name, level: Any = ..., format_string: Incomplete | None = ...): ... +def connect_sqs(aws_access_key_id: Incomplete | None = ..., aws_secret_access_key: Incomplete | None = ..., **kwargs): ... def connect_s3(aws_access_key_id: str | None = ..., aws_secret_access_key: str | None = ..., **kwargs) -> S3Connection: ... -def connect_gs(gs_access_key_id: Any | None = ..., gs_secret_access_key: Any | None = ..., **kwargs): ... -def connect_ec2(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ... -def connect_elb(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ... -def connect_autoscale(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ... -def connect_cloudwatch(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ... -def connect_sdb(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ... -def connect_fps(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ... -def connect_mturk(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ... -def connect_cloudfront(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ... -def connect_vpc(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ... -def connect_rds(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ... -def connect_rds2(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ... -def connect_emr(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ... -def connect_sns(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ... -def connect_iam(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ... -def connect_route53(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ... -def connect_cloudformation(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ... +def connect_gs(gs_access_key_id: Incomplete | None = ..., gs_secret_access_key: Incomplete | None = ..., **kwargs): ... +def connect_ec2(aws_access_key_id: Incomplete | None = ..., aws_secret_access_key: Incomplete | None = ..., **kwargs): ... +def connect_elb(aws_access_key_id: Incomplete | None = ..., aws_secret_access_key: Incomplete | None = ..., **kwargs): ... +def connect_autoscale(aws_access_key_id: Incomplete | None = ..., aws_secret_access_key: Incomplete | None = ..., **kwargs): ... +def connect_cloudwatch(aws_access_key_id: Incomplete | None = ..., aws_secret_access_key: Incomplete | None = ..., **kwargs): ... +def connect_sdb(aws_access_key_id: Incomplete | None = ..., aws_secret_access_key: Incomplete | None = ..., **kwargs): ... +def connect_fps(aws_access_key_id: Incomplete | None = ..., aws_secret_access_key: Incomplete | None = ..., **kwargs): ... +def connect_mturk(aws_access_key_id: Incomplete | None = ..., aws_secret_access_key: Incomplete | None = ..., **kwargs): ... +def connect_cloudfront(aws_access_key_id: Incomplete | None = ..., aws_secret_access_key: Incomplete | None = ..., **kwargs): ... +def connect_vpc(aws_access_key_id: Incomplete | None = ..., aws_secret_access_key: Incomplete | None = ..., **kwargs): ... +def connect_rds(aws_access_key_id: Incomplete | None = ..., aws_secret_access_key: Incomplete | None = ..., **kwargs): ... +def connect_rds2(aws_access_key_id: Incomplete | None = ..., aws_secret_access_key: Incomplete | None = ..., **kwargs): ... +def connect_emr(aws_access_key_id: Incomplete | None = ..., aws_secret_access_key: Incomplete | None = ..., **kwargs): ... +def connect_sns(aws_access_key_id: Incomplete | None = ..., aws_secret_access_key: Incomplete | None = ..., **kwargs): ... +def connect_iam(aws_access_key_id: Incomplete | None = ..., aws_secret_access_key: Incomplete | None = ..., **kwargs): ... +def connect_route53(aws_access_key_id: Incomplete | None = ..., aws_secret_access_key: Incomplete | None = ..., **kwargs): ... +def connect_cloudformation( + aws_access_key_id: Incomplete | None = ..., aws_secret_access_key: Incomplete | None = ..., **kwargs +): ... def connect_euca( - host: Any | None = ..., - aws_access_key_id: Any | None = ..., - aws_secret_access_key: Any | None = ..., + host: Incomplete | None = ..., + aws_access_key_id: Incomplete | None = ..., + aws_secret_access_key: Incomplete | None = ..., port: int = ..., path: str = ..., is_secure: bool = ..., **kwargs, ): ... -def connect_glacier(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ... -def connect_ec2_endpoint(url, aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ... +def connect_glacier(aws_access_key_id: Incomplete | None = ..., aws_secret_access_key: Incomplete | None = ..., **kwargs): ... +def connect_ec2_endpoint( + url, aws_access_key_id: Incomplete | None = ..., aws_secret_access_key: Incomplete | None = ..., **kwargs +): ... def connect_walrus( - host: Any | None = ..., - aws_access_key_id: Any | None = ..., - aws_secret_access_key: Any | None = ..., + host: Incomplete | None = ..., + aws_access_key_id: Incomplete | None = ..., + aws_secret_access_key: Incomplete | None = ..., port: int = ..., path: str = ..., is_secure: bool = ..., **kwargs, ): ... -def connect_ses(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ... -def connect_sts(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ... -def connect_ia(ia_access_key_id: Any | None = ..., ia_secret_access_key: Any | None = ..., is_secure: bool = ..., **kwargs): ... -def connect_dynamodb(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ... -def connect_swf(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ... -def connect_cloudsearch(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ... +def connect_ses(aws_access_key_id: Incomplete | None = ..., aws_secret_access_key: Incomplete | None = ..., **kwargs): ... +def connect_sts(aws_access_key_id: Incomplete | None = ..., aws_secret_access_key: Incomplete | None = ..., **kwargs): ... +def connect_ia( + ia_access_key_id: Incomplete | None = ..., ia_secret_access_key: Incomplete | None = ..., is_secure: bool = ..., **kwargs +): ... +def connect_dynamodb(aws_access_key_id: Incomplete | None = ..., aws_secret_access_key: Incomplete | None = ..., **kwargs): ... +def connect_swf(aws_access_key_id: Incomplete | None = ..., aws_secret_access_key: Incomplete | None = ..., **kwargs): ... +def connect_cloudsearch(aws_access_key_id: Incomplete | None = ..., aws_secret_access_key: Incomplete | None = ..., **kwargs): ... def connect_cloudsearch2( - aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., sign_request: bool = ..., **kwargs -): ... -def connect_cloudsearchdomain(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ... -def connect_beanstalk(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ... -def connect_elastictranscoder(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ... -def connect_opsworks(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ... -def connect_redshift(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ... -def connect_support(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ... -def connect_cloudtrail(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ... -def connect_directconnect(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ... -def connect_kinesis(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ... -def connect_logs(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ... -def connect_route53domains(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ... -def connect_cognito_identity(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ... -def connect_cognito_sync(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ... -def connect_kms(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ... -def connect_awslambda(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ... -def connect_codedeploy(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ... -def connect_configservice(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ... -def connect_cloudhsm(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ... -def connect_ec2containerservice(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ... -def connect_machinelearning(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ... + aws_access_key_id: Incomplete | None = ..., aws_secret_access_key: Incomplete | None = ..., sign_request: bool = ..., **kwargs +): ... +def connect_cloudsearchdomain( + aws_access_key_id: Incomplete | None = ..., aws_secret_access_key: Incomplete | None = ..., **kwargs +): ... +def connect_beanstalk(aws_access_key_id: Incomplete | None = ..., aws_secret_access_key: Incomplete | None = ..., **kwargs): ... +def connect_elastictranscoder( + aws_access_key_id: Incomplete | None = ..., aws_secret_access_key: Incomplete | None = ..., **kwargs +): ... +def connect_opsworks(aws_access_key_id: Incomplete | None = ..., aws_secret_access_key: Incomplete | None = ..., **kwargs): ... +def connect_redshift(aws_access_key_id: Incomplete | None = ..., aws_secret_access_key: Incomplete | None = ..., **kwargs): ... +def connect_support(aws_access_key_id: Incomplete | None = ..., aws_secret_access_key: Incomplete | None = ..., **kwargs): ... +def connect_cloudtrail(aws_access_key_id: Incomplete | None = ..., aws_secret_access_key: Incomplete | None = ..., **kwargs): ... +def connect_directconnect( + aws_access_key_id: Incomplete | None = ..., aws_secret_access_key: Incomplete | None = ..., **kwargs +): ... +def connect_kinesis(aws_access_key_id: Incomplete | None = ..., aws_secret_access_key: Incomplete | None = ..., **kwargs): ... +def connect_logs(aws_access_key_id: Incomplete | None = ..., aws_secret_access_key: Incomplete | None = ..., **kwargs): ... +def connect_route53domains( + aws_access_key_id: Incomplete | None = ..., aws_secret_access_key: Incomplete | None = ..., **kwargs +): ... +def connect_cognito_identity( + aws_access_key_id: Incomplete | None = ..., aws_secret_access_key: Incomplete | None = ..., **kwargs +): ... +def connect_cognito_sync( + aws_access_key_id: Incomplete | None = ..., aws_secret_access_key: Incomplete | None = ..., **kwargs +): ... +def connect_kms(aws_access_key_id: Incomplete | None = ..., aws_secret_access_key: Incomplete | None = ..., **kwargs): ... +def connect_awslambda(aws_access_key_id: Incomplete | None = ..., aws_secret_access_key: Incomplete | None = ..., **kwargs): ... +def connect_codedeploy(aws_access_key_id: Incomplete | None = ..., aws_secret_access_key: Incomplete | None = ..., **kwargs): ... +def connect_configservice( + aws_access_key_id: Incomplete | None = ..., aws_secret_access_key: Incomplete | None = ..., **kwargs +): ... +def connect_cloudhsm(aws_access_key_id: Incomplete | None = ..., aws_secret_access_key: Incomplete | None = ..., **kwargs): ... +def connect_ec2containerservice( + aws_access_key_id: Incomplete | None = ..., aws_secret_access_key: Incomplete | None = ..., **kwargs +): ... +def connect_machinelearning( + aws_access_key_id: Incomplete | None = ..., aws_secret_access_key: Incomplete | None = ..., **kwargs +): ... def storage_uri( uri_str, default_scheme: str = ..., @@ -102,4 +127,4 @@ def storage_uri( def storage_uri_for_key(key): ... # Explicitly mark this package as incomplete. -def __getattr__(name: str) -> Any: ... +def __getattr__(name: str) -> Incomplete: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/auth.pyi b/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/auth.pyi index 2dc77949c..9beccfa62 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/auth.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/auth.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from boto.auth_handler import AuthHandler @@ -45,7 +46,9 @@ class HmacAuthV4Handler(AuthHandler, HmacKeys): capability: Any service_name: Any region_name: Any - def __init__(self, host, config, provider, service_name: Any | None = ..., region_name: Any | None = ...) -> None: ... + def __init__( + self, host, config, provider, service_name: Incomplete | None = ..., region_name: Incomplete | None = ... + ) -> None: ... def headers_to_sign(self, http_request): ... def host_header(self, host, http_request): ... def query_string(self, http_request): ... @@ -78,7 +81,7 @@ class S3HmacAuthV4Handler(HmacAuthV4Handler, AuthHandler): def mangle_path_and_params(self, req): ... def payload(self, http_request): ... def add_auth(self, req, **kwargs): ... - def presign(self, req, expires, iso_date: Any | None = ...): ... + def presign(self, req, expires, iso_date: Incomplete | None = ...): ... class STSAnonHandler(AuthHandler): capability: Any @@ -104,6 +107,6 @@ class POSTPathQSV2AuthHandler(QuerySignatureV2AuthHandler, AuthHandler): capability: Any def add_auth(self, req, **kwargs): ... -def get_auth_handler(host, config, provider, requested_capability: Any | None = ...): ... +def get_auth_handler(host, config, provider, requested_capability: Incomplete | None = ...): ... def detect_potential_sigv4(func): ... def detect_potential_s3sigv4(func): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/connection.pyi b/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/connection.pyi index 9e069c577..8a86a9804 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/connection.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/connection.pyi @@ -1,7 +1,7 @@ +import http.client +from _typeshed import Incomplete from typing import Any -from six.moves import http_client - HAVE_HTTPS_CONNECTION: bool ON_APP_ENGINE: Any PORTS_BY_SECURITY: Any @@ -40,9 +40,9 @@ class HTTPRequest: def __init__(self, method, protocol, host, port, path, auth_path, params, headers, body) -> None: ... def authorize(self, connection, **kwargs): ... -class HTTPResponse(http_client.HTTPResponse): +class HTTPResponse(http.client.HTTPResponse): def __init__(self, *args, **kwargs) -> None: ... - def read(self, amt: Any | None = ...): ... + def read(self, amt: Incomplete | None = ...): ... class AWSAuthConnection: suppress_consec_slashes: Any @@ -67,22 +67,22 @@ class AWSAuthConnection: def __init__( self, host, - aws_access_key_id: Any | None = ..., - aws_secret_access_key: Any | None = ..., + aws_access_key_id: Incomplete | None = ..., + aws_secret_access_key: Incomplete | None = ..., is_secure: bool = ..., - port: Any | None = ..., - proxy: Any | None = ..., - proxy_port: Any | None = ..., - proxy_user: Any | None = ..., - proxy_pass: Any | None = ..., + port: Incomplete | None = ..., + proxy: Incomplete | None = ..., + proxy_port: Incomplete | None = ..., + proxy_user: Incomplete | None = ..., + proxy_pass: Incomplete | None = ..., debug: int = ..., - https_connection_factory: Any | None = ..., + https_connection_factory: Incomplete | None = ..., path: str = ..., provider: str = ..., - security_token: Any | None = ..., + security_token: Incomplete | None = ..., suppress_consec_slashes: bool = ..., validate_certs: bool = ..., - profile_name: Any | None = ..., + profile_name: Incomplete | None = ..., ) -> None: ... auth_region_name: Any @property @@ -102,7 +102,7 @@ class AWSAuthConnection: @property def profile_name(self): ... def get_path(self, path: str = ...): ... - def server_name(self, port: Any | None = ...): ... + def server_name(self, port: Incomplete | None = ...): ... proxy: Any proxy_port: Any proxy_user: Any @@ -114,8 +114,8 @@ class AWSAuthConnection: def skip_proxy(self, host): ... def new_http_connection(self, host, port, is_secure): ... def put_http_connection(self, host, port, is_secure, connection): ... - def proxy_ssl(self, host: Any | None = ..., port: Any | None = ...): ... - def prefix_proxy_to_path(self, path, host: Any | None = ...): ... + def proxy_ssl(self, host: Incomplete | None = ..., port: Incomplete | None = ...): ... + def prefix_proxy_to_path(self, path, host: Incomplete | None = ...): ... def get_proxy_auth_header(self): ... def get_proxy_url_with_auth(self): ... def set_host_header(self, request): ... @@ -125,23 +125,23 @@ class AWSAuthConnection: method, path, auth_path, - params: Any | None = ..., - headers: Any | None = ..., + params: Incomplete | None = ..., + headers: Incomplete | None = ..., data: str = ..., - host: Any | None = ..., + host: Incomplete | None = ..., ): ... def make_request( self, method, path, - headers: Any | None = ..., + headers: Incomplete | None = ..., data: str = ..., - host: Any | None = ..., - auth_path: Any | None = ..., - sender: Any | None = ..., - override_num_retries: Any | None = ..., - params: Any | None = ..., - retry_handler: Any | None = ..., + host: Incomplete | None = ..., + auth_path: Incomplete | None = ..., + sender: Incomplete | None = ..., + override_num_retries: Incomplete | None = ..., + params: Incomplete | None = ..., + retry_handler: Incomplete | None = ..., ): ... def close(self): ... @@ -150,29 +150,29 @@ class AWSQueryConnection(AWSAuthConnection): ResponseError: Any def __init__( self, - aws_access_key_id: Any | None = ..., - aws_secret_access_key: Any | None = ..., + aws_access_key_id: Incomplete | None = ..., + aws_secret_access_key: Incomplete | None = ..., is_secure: bool = ..., - port: Any | None = ..., - proxy: Any | None = ..., - proxy_port: Any | None = ..., - proxy_user: Any | None = ..., - proxy_pass: Any | None = ..., - host: Any | None = ..., + port: Incomplete | None = ..., + proxy: Incomplete | None = ..., + proxy_port: Incomplete | None = ..., + proxy_user: Incomplete | None = ..., + proxy_pass: Incomplete | None = ..., + host: Incomplete | None = ..., debug: int = ..., - https_connection_factory: Any | None = ..., + https_connection_factory: Incomplete | None = ..., path: str = ..., - security_token: Any | None = ..., + security_token: Incomplete | None = ..., validate_certs: bool = ..., - profile_name: Any | None = ..., + profile_name: Incomplete | None = ..., provider: str = ..., ) -> None: ... def get_utf8_value(self, value): ... def make_request( # type: ignore[override] - self, action, params: Any | None = ..., path: str = ..., verb: str = ..., *args, **kwargs + self, action, params: Incomplete | None = ..., path: str = ..., verb: str = ..., *args, **kwargs ): ... def build_list_params(self, params, items, label): ... def build_complex_list_params(self, params, items, label, names): ... - def get_list(self, action, params, markers, path: str = ..., parent: Any | None = ..., verb: str = ...): ... - def get_object(self, action, params, cls, path: str = ..., parent: Any | None = ..., verb: str = ...): ... - def get_status(self, action, params, path: str = ..., parent: Any | None = ..., verb: str = ...): ... + def get_list(self, action, params, markers, path: str = ..., parent: Incomplete | None = ..., verb: str = ...): ... + def get_object(self, action, params, cls, path: str = ..., parent: Incomplete | None = ..., verb: str = ...): ... + def get_status(self, action, params, path: str = ..., parent: Incomplete | None = ..., verb: str = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/ec2/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/ec2/__init__.pyi index d44f942d0..e21a2bfe4 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/ec2/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/ec2/__init__.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any RegionData: Any @@ -7,4 +8,4 @@ def connect_to_region(region_name, **kw_params): ... def get_region(region_name, **kw_params): ... # Explicitly mark this package as incomplete. -def __getattr__(name: str) -> Any: ... +def __getattr__(name: str) -> Incomplete: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/exception.pyi b/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/exception.pyi index 95ebed393..009da58d1 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/exception.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/exception.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from boto.compat import StandardError @@ -19,9 +20,9 @@ class BotoServerError(StandardError): error_code: Any message: str box_usage: Any - def __init__(self, status, reason, body: Any | None = ..., *args) -> None: ... - def __getattr__(self, name): ... - def __setattr__(self, name, value): ... + def __init__(self, status, reason, body: Incomplete | None = ..., *args) -> None: ... + def __getattr__(self, name: str): ... + def __setattr__(self, name: str, value) -> None: ... def startElement(self, name, attrs, connection): ... def endElement(self, name, value, connection): ... @@ -31,13 +32,13 @@ class ConsoleOutput: timestamp: Any comment: Any output: Any - def __init__(self, parent: Any | None = ...) -> None: ... + def __init__(self, parent: Incomplete | None = ...) -> None: ... def startElement(self, name, attrs, connection): ... def endElement(self, name, value, connection): ... class StorageCreateError(BotoServerError): bucket: Any - def __init__(self, status, reason, body: Any | None = ...) -> None: ... + def __init__(self, status, reason, body: Incomplete | None = ...) -> None: ... def endElement(self, name, value, connection): ... class S3CreateError(StorageCreateError): ... @@ -49,7 +50,7 @@ class GSCopyError(StorageCopyError): ... class SQSError(BotoServerError): detail: Any type: Any - def __init__(self, status, reason, body: Any | None = ...) -> None: ... + def __init__(self, status, reason, body: Incomplete | None = ...) -> None: ... def startElement(self, name, attrs, connection): ... def endElement(self, name, value, connection): ... @@ -59,7 +60,7 @@ class SQSDecodeError(BotoClientError): class StorageResponseError(BotoServerError): resource: Any - def __init__(self, status, reason, body: Any | None = ...) -> None: ... + def __init__(self, status, reason, body: Incomplete | None = ...) -> None: ... def startElement(self, name, attrs, connection): ... def endElement(self, name, value, connection): ... @@ -68,7 +69,7 @@ class GSResponseError(StorageResponseError): ... class EC2ResponseError(BotoServerError): errors: Any - def __init__(self, status, reason, body: Any | None = ...) -> None: ... + def __init__(self, status, reason, body: Incomplete | None = ...) -> None: ... def startElement(self, name, attrs, connection): ... request_id: Any def endElement(self, name, value, connection): ... @@ -79,7 +80,7 @@ class JSONResponseError(BotoServerError): body: Any error_message: Any error_code: Any - def __init__(self, status, reason, body: Any | None = ..., *args) -> None: ... + def __init__(self, status, reason, body: Incomplete | None = ..., *args) -> None: ... class DynamoDBResponseError(JSONResponseError): ... class SWFResponseError(JSONResponseError): ... @@ -89,7 +90,7 @@ class _EC2Error: connection: Any error_code: Any error_message: Any - def __init__(self, connection: Any | None = ...) -> None: ... + def __init__(self, connection: Incomplete | None = ...) -> None: ... def startElement(self, name, attrs, connection): ... def endElement(self, name, value, connection): ... @@ -140,7 +141,7 @@ class TooManyRecordsException(Exception): class PleaseRetryException(Exception): message: Any response: Any - def __init__(self, message, response: Any | None = ...) -> None: ... + def __init__(self, message, response: Incomplete | None = ...) -> None: ... class InvalidInstanceMetadataError(Exception): MSG: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/plugin.pyi b/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/plugin.pyi index 7e9ec2dc6..3723cf68c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/plugin.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/plugin.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any class Plugin: @@ -5,5 +6,5 @@ class Plugin: @classmethod def is_capable(cls, requested_capability): ... -def get_plugin(cls, requested_capability: Any | None = ...): ... +def get_plugin(cls, requested_capability: Incomplete | None = ...): ... def load_plugins(config): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/regioninfo.pyi b/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/regioninfo.pyi index b8cb71e2c..9a400e885 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/regioninfo.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/regioninfo.pyi @@ -1,9 +1,10 @@ +from _typeshed import Incomplete from typing import Any def load_endpoint_json(path): ... def merge_endpoints(defaults, additions): ... def load_regions(): ... -def get_regions(service_name, region_cls: Any | None = ..., connection_cls: Any | None = ...): ... +def get_regions(service_name, region_cls: Incomplete | None = ..., connection_cls: Incomplete | None = ...): ... class RegionInfo: connection: Any @@ -11,7 +12,11 @@ class RegionInfo: endpoint: Any connection_cls: Any def __init__( - self, connection: Any | None = ..., name: Any | None = ..., endpoint: Any | None = ..., connection_cls: Any | None = ... + self, + connection: Incomplete | None = ..., + name: Incomplete | None = ..., + endpoint: Incomplete | None = ..., + connection_cls: Incomplete | None = ..., ) -> None: ... def startElement(self, name, attrs, connection): ... def endElement(self, name, value, connection): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/acl.pyi b/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/acl.pyi index 218f7eac3..1c22780a8 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/acl.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/acl.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from .connection import S3Connection @@ -9,7 +10,7 @@ class Policy: parent: Any namespace: Any acl: ACL - def __init__(self, parent: Any | None = ...) -> None: ... + def __init__(self, parent: Incomplete | None = ...) -> None: ... owner: User def startElement(self, name: str, attrs: dict[str, Any], connection: S3Connection) -> None | User | ACL: ... def endElement(self, name: str, value: Any, connection: S3Connection) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/bucket.pyi b/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/bucket.pyi index 45b0d55f2..9e0656448 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/bucket.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/bucket.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from .bucketlistresultset import BucketListResultSet @@ -32,7 +33,7 @@ class Bucket: self, key_name, headers: dict[str, str] | None = ..., - version_id: Any | None = ..., + version_id: Incomplete | None = ..., response_headers: dict[str, str] | None = ..., validate: bool = ..., ) -> Key: ... @@ -42,7 +43,7 @@ class Bucket: delimiter: str = ..., marker: str = ..., headers: dict[str, str] | None = ..., - encoding_type: Any | None = ..., + encoding_type: Incomplete | None = ..., ) -> BucketListResultSet: ... def list_versions( self, @@ -58,14 +59,14 @@ class Bucket: key_marker: str = ..., upload_id_marker: str = ..., headers: dict[str, str] | None = ..., - encoding_type: Any | None = ..., + encoding_type: Incomplete | None = ..., ): ... def validate_kwarg_names(self, kwargs, names): ... def get_all_keys(self, headers: dict[str, str] | None = ..., **params): ... def get_all_versions(self, headers: dict[str, str] | None = ..., **params): ... def validate_get_all_versions_params(self, params): ... def get_all_multipart_uploads(self, headers: dict[str, str] | None = ..., **params): ... - def new_key(self, key_name: Any | None = ...): ... + def new_key(self, key_name: Incomplete | None = ...): ... def generate_url( self, expires_in, @@ -75,53 +76,64 @@ class Bucket: response_headers: dict[str, str] | None = ..., expires_in_absolute: bool = ..., ): ... - def delete_keys(self, keys, quiet: bool = ..., mfa_token: Any | None = ..., headers: dict[str, str] | None = ...): ... + def delete_keys(self, keys, quiet: bool = ..., mfa_token: Incomplete | None = ..., headers: dict[str, str] | None = ...): ... def delete_key( - self, key_name, headers: dict[str, str] | None = ..., version_id: Any | None = ..., mfa_token: Any | None = ... + self, + key_name, + headers: dict[str, str] | None = ..., + version_id: Incomplete | None = ..., + mfa_token: Incomplete | None = ..., ): ... def copy_key( self, new_key_name, src_bucket_name, src_key_name, - metadata: Any | None = ..., - src_version_id: Any | None = ..., + metadata: Incomplete | None = ..., + src_version_id: Incomplete | None = ..., storage_class: str = ..., preserve_acl: bool = ..., encrypt_key: bool = ..., headers: dict[str, str] | None = ..., - query_args: Any | None = ..., + query_args: Incomplete | None = ..., ): ... def set_canned_acl( - self, acl_str, key_name: str = ..., headers: dict[str, str] | None = ..., version_id: Any | None = ... + self, acl_str, key_name: str = ..., headers: dict[str, str] | None = ..., version_id: Incomplete | None = ... ): ... - def get_xml_acl(self, key_name: str = ..., headers: dict[str, str] | None = ..., version_id: Any | None = ...): ... + def get_xml_acl(self, key_name: str = ..., headers: dict[str, str] | None = ..., version_id: Incomplete | None = ...): ... def set_xml_acl( self, acl_str, key_name: str = ..., headers: dict[str, str] | None = ..., - version_id: Any | None = ..., + version_id: Incomplete | None = ..., query_args: str = ..., ): ... - def set_acl(self, acl_or_str, key_name: str = ..., headers: dict[str, str] | None = ..., version_id: Any | None = ...): ... - def get_acl(self, key_name: str = ..., headers: dict[str, str] | None = ..., version_id: Any | None = ...): ... + def set_acl( + self, acl_or_str, key_name: str = ..., headers: dict[str, str] | None = ..., version_id: Incomplete | None = ... + ): ... + def get_acl(self, key_name: str = ..., headers: dict[str, str] | None = ..., version_id: Incomplete | None = ...): ... def set_subresource( - self, subresource, value, key_name: str = ..., headers: dict[str, str] | None = ..., version_id: Any | None = ... + self, subresource, value, key_name: str = ..., headers: dict[str, str] | None = ..., version_id: Incomplete | None = ... ): ... def get_subresource( - self, subresource, key_name: str = ..., headers: dict[str, str] | None = ..., version_id: Any | None = ... + self, subresource, key_name: str = ..., headers: dict[str, str] | None = ..., version_id: Incomplete | None = ... ): ... def make_public(self, recursive: bool = ..., headers: dict[str, str] | None = ...): ... def add_email_grant(self, permission, email_address, recursive: bool = ..., headers: dict[str, str] | None = ...): ... def add_user_grant( - self, permission, user_id, recursive: bool = ..., headers: dict[str, str] | None = ..., display_name: Any | None = ... + self, + permission, + user_id, + recursive: bool = ..., + headers: dict[str, str] | None = ..., + display_name: Incomplete | None = ..., ): ... def list_grants(self, headers: dict[str, str] | None = ...): ... def get_location(self): ... def set_xml_logging(self, logging_str, headers: dict[str, str] | None = ...): ... def enable_logging( - self, target_bucket, target_prefix: str = ..., grants: Any | None = ..., headers: dict[str, str] | None = ... + self, target_bucket, target_prefix: str = ..., grants: Incomplete | None = ..., headers: dict[str, str] | None = ... ): ... def disable_logging(self, headers: dict[str, str] | None = ...): ... def get_logging_status(self, headers: dict[str, str] | None = ...): ... @@ -129,7 +141,7 @@ class Bucket: def get_request_payment(self, headers: dict[str, str] | None = ...): ... def set_request_payment(self, payer: str = ..., headers: dict[str, str] | None = ...): ... def configure_versioning( - self, versioning, mfa_delete: bool = ..., mfa_token: Any | None = ..., headers: dict[str, str] | None = ... + self, versioning, mfa_delete: bool = ..., mfa_token: Incomplete | None = ..., headers: dict[str, str] | None = ... ): ... def get_versioning_status(self, headers: dict[str, str] | None = ...): ... def configure_lifecycle(self, lifecycle_config, headers: dict[str, str] | None = ...): ... @@ -137,10 +149,10 @@ class Bucket: def delete_lifecycle_configuration(self, headers: dict[str, str] | None = ...): ... def configure_website( self, - suffix: Any | None = ..., - error_key: Any | None = ..., - redirect_all_requests_to: Any | None = ..., - routing_rules: Any | None = ..., + suffix: Incomplete | None = ..., + error_key: Incomplete | None = ..., + redirect_all_requests_to: Incomplete | None = ..., + routing_rules: Incomplete | None = ..., headers: dict[str, str] | None = ..., ): ... def set_website_configuration(self, config, headers: dict[str, str] | None = ...): ... @@ -164,9 +176,9 @@ class Bucket: key_name, headers: dict[str, str] | None = ..., reduced_redundancy: bool = ..., - metadata: Any | None = ..., + metadata: Incomplete | None = ..., encrypt_key: bool = ..., - policy: Any | None = ..., + policy: Incomplete | None = ..., ): ... def complete_multipart_upload(self, key_name, upload_id, xml_body, headers: dict[str, str] | None = ...): ... def cancel_multipart_upload(self, key_name, upload_id, headers: dict[str, str] | None = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/bucketlistresultset.pyi b/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/bucketlistresultset.pyi index 258af6c35..e85adad7b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/bucketlistresultset.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/bucketlistresultset.pyi @@ -1,10 +1,16 @@ +from _typeshed import Incomplete from collections.abc import Iterable, Iterator from typing import Any from .key import Key def bucket_lister( - bucket, prefix: str = ..., delimiter: str = ..., marker: str = ..., headers: Any | None = ..., encoding_type: Any | None = ... + bucket, + prefix: str = ..., + delimiter: str = ..., + marker: str = ..., + headers: Incomplete | None = ..., + encoding_type: Incomplete | None = ..., ): ... class BucketListResultSet(Iterable[Key]): @@ -16,12 +22,12 @@ class BucketListResultSet(Iterable[Key]): encoding_type: Any def __init__( self, - bucket: Any | None = ..., + bucket: Incomplete | None = ..., prefix: str = ..., delimiter: str = ..., marker: str = ..., - headers: Any | None = ..., - encoding_type: Any | None = ..., + headers: Incomplete | None = ..., + encoding_type: Incomplete | None = ..., ) -> None: ... def __iter__(self) -> Iterator[Key]: ... @@ -31,8 +37,8 @@ def versioned_bucket_lister( delimiter: str = ..., key_marker: str = ..., version_id_marker: str = ..., - headers: Any | None = ..., - encoding_type: Any | None = ..., + headers: Incomplete | None = ..., + encoding_type: Incomplete | None = ..., ): ... class VersionedBucketListResultSet: @@ -45,18 +51,22 @@ class VersionedBucketListResultSet: encoding_type: Any def __init__( self, - bucket: Any | None = ..., + bucket: Incomplete | None = ..., prefix: str = ..., delimiter: str = ..., key_marker: str = ..., version_id_marker: str = ..., - headers: Any | None = ..., - encoding_type: Any | None = ..., + headers: Incomplete | None = ..., + encoding_type: Incomplete | None = ..., ) -> None: ... def __iter__(self) -> Iterator[Key]: ... def multipart_upload_lister( - bucket, key_marker: str = ..., upload_id_marker: str = ..., headers: Any | None = ..., encoding_type: Any | None = ... + bucket, + key_marker: str = ..., + upload_id_marker: str = ..., + headers: Incomplete | None = ..., + encoding_type: Incomplete | None = ..., ): ... class MultiPartUploadListResultSet: @@ -67,10 +77,10 @@ class MultiPartUploadListResultSet: encoding_type: Any def __init__( self, - bucket: Any | None = ..., + bucket: Incomplete | None = ..., key_marker: str = ..., upload_id_marker: str = ..., - headers: Any | None = ..., - encoding_type: Any | None = ..., + headers: Incomplete | None = ..., + encoding_type: Incomplete | None = ..., ) -> None: ... def __iter__(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/bucketlogging.pyi b/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/bucketlogging.pyi index f804d172c..bde7fc4fb 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/bucketlogging.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/bucketlogging.pyi @@ -1,10 +1,13 @@ +from _typeshed import Incomplete from typing import Any class BucketLogging: target: Any prefix: Any grants: Any - def __init__(self, target: Any | None = ..., prefix: Any | None = ..., grants: Any | None = ...) -> None: ... + def __init__( + self, target: Incomplete | None = ..., prefix: Incomplete | None = ..., grants: Incomplete | None = ... + ) -> None: ... def add_grant(self, grant): ... def startElement(self, name, attrs, connection): ... def endElement(self, name, value, connection): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/connection.pyi b/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/connection.pyi index 286b1c7fd..5fe8c3c18 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/connection.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/connection.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from boto.connection import AWSAuthConnection @@ -52,26 +53,26 @@ class S3Connection(AWSAuthConnection): anon: Any def __init__( self, - aws_access_key_id: Any | None = ..., - aws_secret_access_key: Any | None = ..., + aws_access_key_id: Incomplete | None = ..., + aws_secret_access_key: Incomplete | None = ..., is_secure: bool = ..., - port: Any | None = ..., - proxy: Any | None = ..., - proxy_port: Any | None = ..., - proxy_user: Any | None = ..., - proxy_pass: Any | None = ..., + port: Incomplete | None = ..., + proxy: Incomplete | None = ..., + proxy_port: Incomplete | None = ..., + proxy_user: Incomplete | None = ..., + proxy_pass: Incomplete | None = ..., host: Any = ..., debug: int = ..., - https_connection_factory: Any | None = ..., + https_connection_factory: Incomplete | None = ..., calling_format: Any = ..., path: str = ..., provider: str = ..., bucket_class: type[Bucket] = ..., - security_token: Any | None = ..., + security_token: Incomplete | None = ..., suppress_consec_slashes: bool = ..., anon: bool = ..., - validate_certs: Any | None = ..., - profile_name: Any | None = ..., + validate_certs: Incomplete | None = ..., + profile_name: Incomplete | None = ..., ) -> None: ... def __iter__(self): ... def __contains__(self, bucket_name): ... @@ -82,14 +83,14 @@ class S3Connection(AWSAuthConnection): bucket_name, key, expires_in: int = ..., - acl: Any | None = ..., - success_action_redirect: Any | None = ..., - max_content_length: Any | None = ..., + acl: Incomplete | None = ..., + success_action_redirect: Incomplete | None = ..., + max_content_length: Incomplete | None = ..., http_method: str = ..., - fields: Any | None = ..., - conditions: Any | None = ..., + fields: Incomplete | None = ..., + conditions: Incomplete | None = ..., storage_class: str = ..., - server_side_encryption: Any | None = ..., + server_side_encryption: Incomplete | None = ..., ): ... def generate_url_sigv4( self, @@ -100,8 +101,8 @@ class S3Connection(AWSAuthConnection): headers: dict[str, str] | None = ..., force_http: bool = ..., response_headers: dict[str, str] | None = ..., - version_id: Any | None = ..., - iso_date: Any | None = ..., + version_id: Incomplete | None = ..., + iso_date: Incomplete | None = ..., ): ... def generate_url( self, @@ -114,26 +115,28 @@ class S3Connection(AWSAuthConnection): force_http: bool = ..., response_headers: dict[str, str] | None = ..., expires_in_absolute: bool = ..., - version_id: Any | None = ..., + version_id: Incomplete | None = ..., ): ... def get_all_buckets(self, headers: dict[str, str] | None = ...): ... def get_canonical_user_id(self, headers: dict[str, str] | None = ...): ... def get_bucket(self, bucket_name: str, validate: bool = ..., headers: dict[str, str] | None = ...) -> Bucket: ... def head_bucket(self, bucket_name, headers: dict[str, str] | None = ...): ... def lookup(self, bucket_name, validate: bool = ..., headers: dict[str, str] | None = ...): ... - def create_bucket(self, bucket_name, headers: dict[str, str] | None = ..., location: Any = ..., policy: Any | None = ...): ... + def create_bucket( + self, bucket_name, headers: dict[str, str] | None = ..., location: Any = ..., policy: Incomplete | None = ... + ): ... def delete_bucket(self, bucket, headers: dict[str, str] | None = ...): ... def make_request( # type: ignore[override] self, method, bucket: str = ..., key: str = ..., - headers: Any | None = ..., + headers: Incomplete | None = ..., data: str = ..., - query_args: Any | None = ..., - sender: Any | None = ..., - override_num_retries: Any | None = ..., - retry_handler: Any | None = ..., + query_args: Incomplete | None = ..., + sender: Incomplete | None = ..., + override_num_retries: Incomplete | None = ..., + retry_handler: Incomplete | None = ..., *args, **kwargs, ): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/cors.pyi b/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/cors.pyi index 125587f9b..1b3e66b52 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/cors.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/cors.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any class CORSRule: @@ -9,12 +10,12 @@ class CORSRule: expose_header: Any def __init__( self, - allowed_method: Any | None = ..., - allowed_origin: Any | None = ..., - id: Any | None = ..., - allowed_header: Any | None = ..., - max_age_seconds: Any | None = ..., - expose_header: Any | None = ..., + allowed_method: Incomplete | None = ..., + allowed_origin: Incomplete | None = ..., + id: Incomplete | None = ..., + allowed_header: Incomplete | None = ..., + max_age_seconds: Incomplete | None = ..., + expose_header: Incomplete | None = ..., ) -> None: ... def startElement(self, name, attrs, connection): ... def endElement(self, name, value, connection): ... @@ -28,8 +29,8 @@ class CORSConfiguration(list[CORSRule]): self, allowed_method, allowed_origin, - id: Any | None = ..., - allowed_header: Any | None = ..., - max_age_seconds: Any | None = ..., - expose_header: Any | None = ..., + id: Incomplete | None = ..., + allowed_header: Incomplete | None = ..., + max_age_seconds: Incomplete | None = ..., + expose_header: Incomplete | None = ..., ): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/deletemarker.pyi b/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/deletemarker.pyi index 83f9b53c0..179f35f83 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/deletemarker.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/deletemarker.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any class DeleteMarker: @@ -7,6 +8,6 @@ class DeleteMarker: is_latest: bool last_modified: Any owner: Any - def __init__(self, bucket: Any | None = ..., name: Any | None = ...) -> None: ... + def __init__(self, bucket: Incomplete | None = ..., name: Incomplete | None = ...) -> None: ... def startElement(self, name, attrs, connection): ... def endElement(self, name, value, connection): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/key.pyi b/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/key.pyi index 539f071b1..52a31fd24 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/key.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/key.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from collections.abc import Callable from typing import Any, overload @@ -31,7 +32,7 @@ class Key: ongoing_restore: Any expiry_date: Any local_hashes: Any - def __init__(self, bucket: Any | None = ..., name: Any | None = ...) -> None: ... + def __init__(self, bucket: Incomplete | None = ..., name: Incomplete | None = ...) -> None: ... def __iter__(self): ... @property def provider(self): ... @@ -48,28 +49,28 @@ class Key: self, headers: dict[str, str] | None = ..., query_args: str = ..., - override_num_retries: Any | None = ..., + override_num_retries: Incomplete | None = ..., response_headers: dict[str, str] | None = ..., ): ... - def open_write(self, headers: dict[str, str] | None = ..., override_num_retries: Any | None = ...): ... + def open_write(self, headers: dict[str, str] | None = ..., override_num_retries: Incomplete | None = ...): ... def open( self, mode: str = ..., headers: dict[str, str] | None = ..., - query_args: Any | None = ..., - override_num_retries: Any | None = ..., + query_args: Incomplete | None = ..., + override_num_retries: Incomplete | None = ..., ): ... closed: bool def close(self, fast: bool = ...): ... def next(self): ... __next__: Any def read(self, size: int = ...): ... - def change_storage_class(self, new_storage_class, dst_bucket: Any | None = ..., validate_dst_bucket: bool = ...): ... + def change_storage_class(self, new_storage_class, dst_bucket: Incomplete | None = ..., validate_dst_bucket: bool = ...): ... def copy( self, dst_bucket, dst_key, - metadata: Any | None = ..., + metadata: Incomplete | None = ..., reduced_redundancy: bool = ..., preserve_acl: bool = ..., encrypt_key: bool = ..., @@ -99,8 +100,8 @@ class Key: force_http: bool = ..., response_headers: dict[str, str] | None = ..., expires_in_absolute: bool = ..., - version_id: Any | None = ..., - policy: Any | None = ..., + version_id: Incomplete | None = ..., + policy: Incomplete | None = ..., reduced_redundancy: bool = ..., encrypt_key: bool = ..., ): ... @@ -110,12 +111,12 @@ class Key: headers: dict[str, str] | None = ..., cb: Callable[[int, int], object] | None = ..., num_cb: int = ..., - query_args: Any | None = ..., + query_args: Incomplete | None = ..., chunked_transfer: bool = ..., - size: Any | None = ..., + size: Incomplete | None = ..., ): ... def should_retry(self, response, chunked_transfer: bool = ...): ... - def compute_md5(self, fp, size: Any | None = ...): ... + def compute_md5(self, fp, size: Incomplete | None = ...): ... def set_contents_from_stream( self, fp, @@ -123,10 +124,10 @@ class Key: replace: bool = ..., cb: Callable[[int, int], object] | None = ..., num_cb: int = ..., - policy: Any | None = ..., + policy: Incomplete | None = ..., reduced_redundancy: bool = ..., - query_args: Any | None = ..., - size: Any | None = ..., + query_args: Incomplete | None = ..., + size: Incomplete | None = ..., ): ... def set_contents_from_file( self, @@ -135,12 +136,12 @@ class Key: replace: bool = ..., cb: Callable[[int, int], object] | None = ..., num_cb: int = ..., - policy: Any | None = ..., - md5: Any | None = ..., + policy: Incomplete | None = ..., + md5: Incomplete | None = ..., reduced_redundancy: bool = ..., - query_args: Any | None = ..., + query_args: Incomplete | None = ..., encrypt_key: bool = ..., - size: Any | None = ..., + size: Incomplete | None = ..., rewind: bool = ..., ): ... def set_contents_from_filename( @@ -150,8 +151,8 @@ class Key: replace: bool = ..., cb: Callable[[int, int], object] | None = ..., num_cb: int = ..., - policy: Any | None = ..., - md5: Any | None = ..., + policy: Incomplete | None = ..., + md5: Incomplete | None = ..., reduced_redundancy: bool = ..., encrypt_key: bool = ..., ): ... @@ -162,8 +163,8 @@ class Key: replace: bool = ..., cb: Callable[[int, int], object] | None = ..., num_cb: int = ..., - policy: Any | None = ..., - md5: Any | None = ..., + policy: Incomplete | None = ..., + md5: Incomplete | None = ..., reduced_redundancy: bool = ..., encrypt_key: bool = ..., ) -> None: ... @@ -174,8 +175,8 @@ class Key: cb: Callable[[int, int], object] | None = ..., num_cb: int = ..., torrent: bool = ..., - version_id: Any | None = ..., - override_num_retries: Any | None = ..., + version_id: Incomplete | None = ..., + override_num_retries: Incomplete | None = ..., response_headers: dict[str, str] | None = ..., ): ... def get_torrent_file( @@ -188,8 +189,8 @@ class Key: cb: Callable[[int, int], object] | None = ..., num_cb: int = ..., torrent: bool = ..., - version_id: Any | None = ..., - res_download_handler: Any | None = ..., + version_id: Incomplete | None = ..., + res_download_handler: Incomplete | None = ..., response_headers: dict[str, str] | None = ..., ): ... def get_contents_to_filename( @@ -199,8 +200,8 @@ class Key: cb: Callable[[int, int], object] | None = ..., num_cb: int = ..., torrent: bool = ..., - version_id: Any | None = ..., - res_download_handler: Any | None = ..., + version_id: Incomplete | None = ..., + res_download_handler: Incomplete | None = ..., response_headers: dict[str, str] | None = ..., ): ... @overload @@ -210,7 +211,7 @@ class Key: cb: Callable[[int, int], object] | None = ..., num_cb: int = ..., torrent: bool = ..., - version_id: Any | None = ..., + version_id: Incomplete | None = ..., response_headers: dict[str, str] | None = ..., encoding: None = ..., ) -> bytes: ... @@ -221,12 +222,14 @@ class Key: cb: Callable[[int, int], object] | None = ..., num_cb: int = ..., torrent: bool = ..., - version_id: Any | None = ..., + version_id: Incomplete | None = ..., response_headers: dict[str, str] | None = ..., *, encoding: str, ) -> str: ... def add_email_grant(self, permission, email_address, headers: dict[str, str] | None = ...): ... - def add_user_grant(self, permission, user_id, headers: dict[str, str] | None = ..., display_name: Any | None = ...): ... + def add_user_grant( + self, permission, user_id, headers: dict[str, str] | None = ..., display_name: Incomplete | None = ... + ): ... def set_remote_metadata(self, metadata_plus, metadata_minus, preserve_acl, headers: dict[str, str] | None = ...): ... def restore(self, days, headers: dict[str, str] | None = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/lifecycle.pyi b/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/lifecycle.pyi index 7919bad71..358faaff8 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/lifecycle.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/lifecycle.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any class Rule: @@ -8,11 +9,11 @@ class Rule: transition: Any def __init__( self, - id: Any | None = ..., - prefix: Any | None = ..., - status: Any | None = ..., - expiration: Any | None = ..., - transition: Any | None = ..., + id: Incomplete | None = ..., + prefix: Incomplete | None = ..., + status: Incomplete | None = ..., + expiration: Incomplete | None = ..., + transition: Incomplete | None = ..., ) -> None: ... def startElement(self, name, attrs, connection): ... def endElement(self, name, value, connection): ... @@ -21,7 +22,7 @@ class Rule: class Expiration: days: Any date: Any - def __init__(self, days: Any | None = ..., date: Any | None = ...) -> None: ... + def __init__(self, days: Incomplete | None = ..., date: Incomplete | None = ...) -> None: ... def startElement(self, name, attrs, connection): ... def endElement(self, name, value, connection): ... def to_xml(self): ... @@ -30,7 +31,9 @@ class Transition: days: Any date: Any storage_class: Any - def __init__(self, days: Any | None = ..., date: Any | None = ..., storage_class: Any | None = ...) -> None: ... + def __init__( + self, days: Incomplete | None = ..., date: Incomplete | None = ..., storage_class: Incomplete | None = ... + ) -> None: ... def to_xml(self): ... class Transitions(list[Transition]): @@ -43,7 +46,9 @@ class Transitions(list[Transition]): def startElement(self, name, attrs, connection): ... def endElement(self, name, value, connection): ... def to_xml(self): ... - def add_transition(self, days: Any | None = ..., date: Any | None = ..., storage_class: Any | None = ...): ... + def add_transition( + self, days: Incomplete | None = ..., date: Incomplete | None = ..., storage_class: Incomplete | None = ... + ): ... @property def days(self): ... @property @@ -57,9 +62,9 @@ class Lifecycle(list[Rule]): def to_xml(self): ... def add_rule( self, - id: Any | None = ..., + id: Incomplete | None = ..., prefix: str = ..., status: str = ..., - expiration: Any | None = ..., - transition: Any | None = ..., + expiration: Incomplete | None = ..., + transition: Incomplete | None = ..., ): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/multidelete.pyi b/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/multidelete.pyi index 8d5ab28a5..3ab86b04d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/multidelete.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/multidelete.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any class Deleted: @@ -7,10 +8,10 @@ class Deleted: delete_marker_version_id: Any def __init__( self, - key: Any | None = ..., - version_id: Any | None = ..., + key: Incomplete | None = ..., + version_id: Incomplete | None = ..., delete_marker: bool = ..., - delete_marker_version_id: Any | None = ..., + delete_marker_version_id: Incomplete | None = ..., ) -> None: ... def startElement(self, name, attrs, connection): ... def endElement(self, name, value, connection): ... @@ -21,7 +22,11 @@ class Error: code: Any message: Any def __init__( - self, key: Any | None = ..., version_id: Any | None = ..., code: Any | None = ..., message: Any | None = ... + self, + key: Incomplete | None = ..., + version_id: Incomplete | None = ..., + code: Incomplete | None = ..., + message: Incomplete | None = ..., ) -> None: ... def startElement(self, name, attrs, connection): ... def endElement(self, name, value, connection): ... @@ -30,6 +35,6 @@ class MultiDeleteResult: bucket: Any deleted: Any errors: Any - def __init__(self, bucket: Any | None = ...) -> None: ... + def __init__(self, bucket: Incomplete | None = ...) -> None: ... def startElement(self, name, attrs, connection): ... def endElement(self, name, value, connection): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/multipart.pyi b/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/multipart.pyi index 7a231caa4..9fd513139 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/multipart.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/multipart.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any class CompleteMultiPartUpload: @@ -8,7 +9,7 @@ class CompleteMultiPartUpload: etag: Any version_id: Any encrypted: Any - def __init__(self, bucket: Any | None = ...) -> None: ... + def __init__(self, bucket: Incomplete | None = ...) -> None: ... def startElement(self, name, attrs, connection): ... def endElement(self, name, value, connection): ... @@ -18,11 +19,11 @@ class Part: last_modified: Any etag: Any size: Any - def __init__(self, bucket: Any | None = ...) -> None: ... + def __init__(self, bucket: Incomplete | None = ...) -> None: ... def startElement(self, name, attrs, connection): ... def endElement(self, name, value, connection): ... -def part_lister(mpupload, part_number_marker: Any | None = ...): ... +def part_lister(mpupload, part_number_marker: Incomplete | None = ...): ... class MultiPartUpload: bucket: Any @@ -37,34 +38,37 @@ class MultiPartUpload: next_part_number_marker: Any max_parts: Any is_truncated: bool - def __init__(self, bucket: Any | None = ...) -> None: ... + def __init__(self, bucket: Incomplete | None = ...) -> None: ... def __iter__(self): ... def to_xml(self): ... def startElement(self, name, attrs, connection): ... def endElement(self, name, value, connection): ... def get_all_parts( - self, max_parts: Any | None = ..., part_number_marker: Any | None = ..., encoding_type: Any | None = ... + self, + max_parts: Incomplete | None = ..., + part_number_marker: Incomplete | None = ..., + encoding_type: Incomplete | None = ..., ): ... def upload_part_from_file( self, fp, part_num, - headers: Any | None = ..., + headers: Incomplete | None = ..., replace: bool = ..., - cb: Any | None = ..., + cb: Incomplete | None = ..., num_cb: int = ..., - md5: Any | None = ..., - size: Any | None = ..., + md5: Incomplete | None = ..., + size: Incomplete | None = ..., ): ... def copy_part_from_key( self, src_bucket_name, src_key_name, part_num, - start: Any | None = ..., - end: Any | None = ..., - src_version_id: Any | None = ..., - headers: Any | None = ..., + start: Incomplete | None = ..., + end: Incomplete | None = ..., + src_version_id: Incomplete | None = ..., + headers: Incomplete | None = ..., ): ... def complete_upload(self): ... def cancel_upload(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/prefix.pyi b/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/prefix.pyi index db66a76d7..b4164f485 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/prefix.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/prefix.pyi @@ -1,9 +1,10 @@ +from _typeshed import Incomplete from typing import Any class Prefix: bucket: Any name: Any - def __init__(self, bucket: Any | None = ..., name: Any | None = ...) -> None: ... + def __init__(self, bucket: Incomplete | None = ..., name: Incomplete | None = ...) -> None: ... def startElement(self, name, attrs, connection): ... def endElement(self, name, value, connection): ... @property diff --git a/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/tagging.pyi b/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/tagging.pyi index 98a954d5f..3515e91c2 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/tagging.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/tagging.pyi @@ -1,9 +1,10 @@ +from _typeshed import Incomplete from typing import Any class Tag: key: Any value: Any - def __init__(self, key: Any | None = ..., value: Any | None = ...) -> None: ... + def __init__(self, key: Incomplete | None = ..., value: Incomplete | None = ...) -> None: ... def startElement(self, name, attrs, connection): ... def endElement(self, name, value, connection): ... def to_xml(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/user.pyi b/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/user.pyi index 18d8a0a31..d5c56ee3a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/user.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/user.pyi @@ -1,10 +1,11 @@ +from _typeshed import Incomplete from typing import Any class User: type: Any id: Any display_name: Any - def __init__(self, parent: Any | None = ..., id: str = ..., display_name: str = ...) -> None: ... + def __init__(self, parent: Incomplete | None = ..., id: str = ..., display_name: str = ...) -> None: ... def startElement(self, name, attrs, connection): ... def endElement(self, name, value, connection): ... def to_xml(self, element_name: str = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/website.pyi b/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/website.pyi index e913f6dde..e7597a0d6 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/website.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/s3/website.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any def tag(key, value): ... @@ -9,10 +10,10 @@ class WebsiteConfiguration: routing_rules: Any def __init__( self, - suffix: Any | None = ..., - error_key: Any | None = ..., - redirect_all_requests_to: Any | None = ..., - routing_rules: Any | None = ..., + suffix: Incomplete | None = ..., + error_key: Incomplete | None = ..., + redirect_all_requests_to: Incomplete | None = ..., + routing_rules: Incomplete | None = ..., ) -> None: ... def startElement(self, name, attrs, connection): ... def endElement(self, name, value, connection): ... @@ -21,7 +22,7 @@ class WebsiteConfiguration: class _XMLKeyValue: translator: Any container: Any - def __init__(self, translator, container: Any | None = ...) -> None: ... + def __init__(self, translator, container: Incomplete | None = ...) -> None: ... def startElement(self, name, attrs, connection): ... def endElement(self, name, value, connection): ... def to_xml(self): ... @@ -30,7 +31,7 @@ class RedirectLocation(_XMLKeyValue): TRANSLATOR: Any hostname: Any protocol: Any - def __init__(self, hostname: Any | None = ..., protocol: Any | None = ...) -> None: ... + def __init__(self, hostname: Incomplete | None = ..., protocol: Incomplete | None = ...) -> None: ... def to_xml(self): ... class RoutingRules(list[RoutingRule]): @@ -42,26 +43,26 @@ class RoutingRules(list[RoutingRule]): class RoutingRule: condition: Any redirect: Any - def __init__(self, condition: Any | None = ..., redirect: Any | None = ...) -> None: ... + def __init__(self, condition: Incomplete | None = ..., redirect: Incomplete | None = ...) -> None: ... def startElement(self, name, attrs, connection): ... def endElement(self, name, value, connection): ... def to_xml(self): ... @classmethod - def when(cls, key_prefix: Any | None = ..., http_error_code: Any | None = ...): ... + def when(cls, key_prefix: Incomplete | None = ..., http_error_code: Incomplete | None = ...): ... def then_redirect( self, - hostname: Any | None = ..., - protocol: Any | None = ..., - replace_key: Any | None = ..., - replace_key_prefix: Any | None = ..., - http_redirect_code: Any | None = ..., + hostname: Incomplete | None = ..., + protocol: Incomplete | None = ..., + replace_key: Incomplete | None = ..., + replace_key_prefix: Incomplete | None = ..., + http_redirect_code: Incomplete | None = ..., ): ... class Condition(_XMLKeyValue): TRANSLATOR: Any key_prefix: Any http_error_code: Any - def __init__(self, key_prefix: Any | None = ..., http_error_code: Any | None = ...) -> None: ... + def __init__(self, key_prefix: Incomplete | None = ..., http_error_code: Incomplete | None = ...) -> None: ... def to_xml(self): ... class Redirect(_XMLKeyValue): @@ -73,10 +74,10 @@ class Redirect(_XMLKeyValue): http_redirect_code: Any def __init__( self, - hostname: Any | None = ..., - protocol: Any | None = ..., - replace_key: Any | None = ..., - replace_key_prefix: Any | None = ..., - http_redirect_code: Any | None = ..., + hostname: Incomplete | None = ..., + protocol: Incomplete | None = ..., + replace_key: Incomplete | None = ..., + replace_key_prefix: Incomplete | None = ..., + http_redirect_code: Incomplete | None = ..., ) -> None: ... def to_xml(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/utils.pyi b/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/utils.pyi index f9ce83d48..ae9a2396b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/utils.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/boto/boto/utils.pyi @@ -3,6 +3,7 @@ import io import logging.handlers import subprocess import time +from _typeshed import StrOrBytesPath from collections.abc import Callable, Iterable, Mapping, Sequence from contextlib import AbstractContextManager from email.message import Message @@ -65,7 +66,7 @@ class ShellCommand: wait: bool fail_fast: bool def __init__( - self, command: subprocess._CMD, wait: bool = ..., fail_fast: bool = ..., cwd: subprocess._TXT | None = ... + self, command: subprocess._CMD, wait: bool = ..., fail_fast: bool = ..., cwd: StrOrBytesPath | None = ... ) -> None: ... process: subprocess.Popen[Any] def run(self, cwd: subprocess._CMD | None = ...) -> int | None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/braintree/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/braintree/METADATA.toml index 6d1ec77af..f0992bef9 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/braintree/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/braintree/METADATA.toml @@ -1 +1,4 @@ -version = "4.16.*" +version = "4.18.*" + +[tool.stubtest] +ignore_missing_stub = true diff --git a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/address.pyi b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/address.pyi index 63d7531c5..e3a3b33e4 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/address.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/address.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete from braintree.configuration import Configuration as Configuration from braintree.error_result import ErrorResult as ErrorResult @@ -14,13 +14,13 @@ class Address(Resource): Electronic: str ShipToStore: str @staticmethod - def create(params: Any | None = ...): ... + def create(params: Incomplete | None = ...): ... @staticmethod def delete(customer_id, address_id): ... @staticmethod def find(customer_id, address_id): ... @staticmethod - def update(customer_id, address_id, params: Any | None = ...): ... + def update(customer_id, address_id, params: Incomplete | None = ...): ... @staticmethod def create_signature(): ... @staticmethod diff --git a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/address_gateway.pyi b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/address_gateway.pyi index bf55fe3f0..15997901b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/address_gateway.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/address_gateway.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from braintree.address import Address as Address @@ -10,7 +11,7 @@ class AddressGateway: gateway: Any config: Any def __init__(self, gateway) -> None: ... - def create(self, params: Any | None = ...): ... + def create(self, params: Incomplete | None = ...): ... def delete(self, customer_id, address_id): ... def find(self, customer_id, address_id): ... - def update(self, customer_id, address_id, params: Any | None = ...): ... + def update(self, customer_id, address_id, params: Incomplete | None = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/attribute_getter.pyi b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/attribute_getter.pyi index bedbb800a..848f30634 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/attribute_getter.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/attribute_getter.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete class AttributeGetter: - def __init__(self, attributes: Any | None = ...) -> None: ... + def __init__(self, attributes: Incomplete | None = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/braintree_gateway.pyi b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/braintree_gateway.pyi index afa470a8a..5f4947b99 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/braintree_gateway.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/braintree_gateway.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from braintree.add_on_gateway import AddOnGateway as AddOnGateway @@ -57,4 +58,4 @@ class BraintreeGateway: verification: Any webhook_notification: Any webhook_testing: Any - def __init__(self, config: Any | None = ..., **kwargs) -> None: ... + def __init__(self, config: Incomplete | None = ..., **kwargs) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/client_token.pyi b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/client_token.pyi index 3e083a212..42afabe60 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/client_token.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/client_token.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete from braintree import exceptions as exceptions from braintree.configuration import Configuration as Configuration @@ -7,6 +7,6 @@ from braintree.util.crypto import Crypto as Crypto class ClientToken: @staticmethod - def generate(params: Any | None = ..., gateway: Any | None = ...): ... + def generate(params: Incomplete | None = ..., gateway: Incomplete | None = ...): ... @staticmethod def generate_signature(): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/client_token_gateway.pyi b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/client_token_gateway.pyi index ddb0b12e6..1f66fe5b7 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/client_token_gateway.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/client_token_gateway.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from braintree import exceptions as exceptions @@ -8,4 +9,4 @@ class ClientTokenGateway: gateway: Any config: Any def __init__(self, gateway) -> None: ... - def generate(self, params: Any | None = ...): ... + def generate(self, params: Incomplete | None = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/configuration.pyi b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/configuration.pyi index 1d8c3fc53..68e415501 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/configuration.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/configuration.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from braintree.credentials_parser import CredentialsParser as CredentialsParser @@ -29,13 +30,13 @@ class Configuration: wrap_http_exceptions: Any def __init__( self, - environment: Any | None = ..., - merchant_id: Any | None = ..., - public_key: Any | None = ..., - private_key: Any | None = ..., - client_id: Any | None = ..., - client_secret: Any | None = ..., - access_token: Any | None = ..., + environment: Incomplete | None = ..., + merchant_id: Incomplete | None = ..., + public_key: Incomplete | None = ..., + private_key: Incomplete | None = ..., + client_id: Incomplete | None = ..., + client_secret: Incomplete | None = ..., + access_token: Incomplete | None = ..., *args, **kwargs, ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/credentials_parser.pyi b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/credentials_parser.pyi index dd1b69ac9..e801f2872 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/credentials_parser.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/credentials_parser.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from braintree.environment import Environment as Environment @@ -7,7 +8,9 @@ class CredentialsParser: client_id: Any client_secret: Any access_token: Any - def __init__(self, client_id: Any | None = ..., client_secret: Any | None = ..., access_token: Any | None = ...) -> None: ... + def __init__( + self, client_id: Incomplete | None = ..., client_secret: Incomplete | None = ..., access_token: Incomplete | None = ... + ) -> None: ... environment: Any def parse_client_credentials(self) -> None: ... merchant_id: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/credit_card.pyi b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/credit_card.pyi index e68500363..8c8958245 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/credit_card.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/credit_card.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from braintree.address import Address as Address @@ -44,9 +45,9 @@ class CreditCard(Resource): Prepaid: Any ProductId: Any @staticmethod - def create(params: Any | None = ...): ... + def create(params: Incomplete | None = ...): ... @staticmethod - def update(credit_card_token, params: Any | None = ...): ... + def update(credit_card_token, params: Incomplete | None = ...): ... @staticmethod def delete(credit_card_token): ... @staticmethod diff --git a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/credit_card_gateway.pyi b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/credit_card_gateway.pyi index 765f808a7..68fbe2d9f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/credit_card_gateway.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/credit_card_gateway.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from braintree.credit_card import CreditCard as CreditCard @@ -12,11 +13,11 @@ class CreditCardGateway: gateway: Any config: Any def __init__(self, gateway) -> None: ... - def create(self, params: Any | None = ...): ... + def create(self, params: Incomplete | None = ...): ... def delete(self, credit_card_token): ... def expired(self): ... def expiring_between(self, start_date, end_date): ... def find(self, credit_card_token): ... def forward(self, credit_card_token, receiving_merchant_id) -> None: ... def from_nonce(self, nonce): ... - def update(self, credit_card_token, params: Any | None = ...): ... + def update(self, credit_card_token, params: Incomplete | None = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/customer.pyi b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/customer.pyi index cd0ffa78a..6c81cc8b4 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/customer.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/customer.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from braintree.address import Address as Address @@ -25,15 +26,15 @@ class Customer(Resource): @staticmethod def all(): ... @staticmethod - def create(params: Any | None = ...): ... + def create(params: Incomplete | None = ...): ... @staticmethod def delete(customer_id): ... @staticmethod - def find(customer_id, association_filter_id: Any | None = ...): ... + def find(customer_id, association_filter_id: Incomplete | None = ...): ... @staticmethod def search(*query): ... @staticmethod - def update(customer_id, params: Any | None = ...): ... + def update(customer_id, params: Incomplete | None = ...): ... @staticmethod def create_signature(): ... @staticmethod diff --git a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/customer_gateway.pyi b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/customer_gateway.pyi index 6b1391ef7..077933ae3 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/customer_gateway.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/customer_gateway.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from braintree.customer import Customer as Customer @@ -13,8 +14,8 @@ class CustomerGateway: config: Any def __init__(self, gateway) -> None: ... def all(self): ... - def create(self, params: Any | None = ...): ... + def create(self, params: Incomplete | None = ...): ... def delete(self, customer_id): ... - def find(self, customer_id, association_filter_id: Any | None = ...): ... + def find(self, customer_id, association_filter_id: Incomplete | None = ...): ... def search(self, *query): ... - def update(self, customer_id, params: Any | None = ...): ... + def update(self, customer_id, params: Incomplete | None = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/document_upload.pyi b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/document_upload.pyi index 428b0d632..e0d47ae14 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/document_upload.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/document_upload.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete from braintree.configuration import Configuration as Configuration from braintree.resource import Resource as Resource @@ -8,7 +8,7 @@ class DocumentUpload(Resource): class Kind: EvidenceDocument: str @staticmethod - def create(params: Any | None = ...): ... + def create(params: Incomplete | None = ...): ... @staticmethod def create_signature(): ... def __init__(self, gateway, attributes) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/document_upload_gateway.pyi b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/document_upload_gateway.pyi index 1c7549d65..c076510cd 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/document_upload_gateway.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/document_upload_gateway.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from braintree.document_upload import DocumentUpload as DocumentUpload @@ -9,4 +10,4 @@ class DocumentUploadGateway: gateway: Any config: Any def __init__(self, gateway) -> None: ... - def create(self, params: Any | None = ...): ... + def create(self, params: Incomplete | None = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/errors.pyi b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/errors.pyi index 52ee0af53..071bdba64 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/errors.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/errors.pyi @@ -9,4 +9,4 @@ class Errors: @property def deep_errors(self): ... def for_object(self, key): ... - def __len__(self): ... + def __len__(self) -> int: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/merchant_account/merchant_account.pyi b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/merchant_account/merchant_account.pyi index 44729c209..45259e0fa 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/merchant_account/merchant_account.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/merchant_account/merchant_account.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from braintree.configuration import Configuration as Configuration @@ -25,7 +26,7 @@ class MerchantAccount(Resource): master_merchant_account: Any def __init__(self, gateway, attributes) -> None: ... @staticmethod - def create(params: Any | None = ...): ... + def create(params: Incomplete | None = ...): ... @staticmethod def update(id, attributes): ... @staticmethod diff --git a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/merchant_account_gateway.pyi b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/merchant_account_gateway.pyi index 5d653eab7..1bd64629a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/merchant_account_gateway.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/merchant_account_gateway.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from braintree.error_result import ErrorResult as ErrorResult @@ -13,8 +14,8 @@ class MerchantAccountGateway: gateway: Any config: Any def __init__(self, gateway) -> None: ... - def create(self, params: Any | None = ...): ... - def update(self, merchant_account_id, params: Any | None = ...): ... + def create(self, params: Incomplete | None = ...): ... + def update(self, merchant_account_id, params: Incomplete | None = ...): ... def find(self, merchant_account_id): ... - def create_for_currency(self, params: Any | None = ...): ... + def create_for_currency(self, params: Incomplete | None = ...): ... def all(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/payment_method.pyi b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/payment_method.pyi index acb99aaca..c2c358115 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/payment_method.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/payment_method.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete from braintree.address import Address as Address from braintree.configuration import Configuration as Configuration @@ -6,13 +6,13 @@ from braintree.resource import Resource as Resource class PaymentMethod(Resource): @staticmethod - def create(params: Any | None = ...): ... + def create(params: Incomplete | None = ...): ... @staticmethod def find(payment_method_token): ... @staticmethod def update(payment_method_token, params): ... @staticmethod - def delete(payment_method_token, options: Any | None = ...): ... + def delete(payment_method_token, options: Incomplete | None = ...): ... @staticmethod def create_signature(): ... @staticmethod diff --git a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/payment_method_gateway.pyi b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/payment_method_gateway.pyi index 370f0aafb..f3d71a7b2 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/payment_method_gateway.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/payment_method_gateway.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from braintree.amex_express_checkout_card import AmexExpressCheckoutCard as AmexExpressCheckoutCard @@ -26,10 +27,10 @@ class PaymentMethodGateway: gateway: Any config: Any def __init__(self, gateway) -> None: ... - def create(self, params: Any | None = ...): ... + def create(self, params: Incomplete | None = ...): ... def find(self, payment_method_token): ... def update(self, payment_method_token, params): ... - def delete(self, payment_method_token, options: Any | None = ...): ... + def delete(self, payment_method_token, options: Incomplete | None = ...): ... options: Any - def grant(self, payment_method_token, options: Any | None = ...): ... + def grant(self, payment_method_token, options: Incomplete | None = ...): ... def revoke(self, payment_method_token): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/paypal_account.pyi b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/paypal_account.pyi index 24a0e923b..6dccea80c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/paypal_account.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/paypal_account.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from braintree.configuration import Configuration as Configuration @@ -9,7 +10,7 @@ class PayPalAccount(Resource): @staticmethod def delete(paypal_account_token): ... @staticmethod - def update(paypal_account_token, params: Any | None = ...): ... + def update(paypal_account_token, params: Incomplete | None = ...): ... @staticmethod def signature(): ... subscriptions: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/paypal_account_gateway.pyi b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/paypal_account_gateway.pyi index fa7a306c0..8716ac8ea 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/paypal_account_gateway.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/paypal_account_gateway.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from braintree.error_result import ErrorResult as ErrorResult @@ -12,4 +13,4 @@ class PayPalAccountGateway: def __init__(self, gateway) -> None: ... def find(self, paypal_account_token): ... def delete(self, paypal_account_token): ... - def update(self, paypal_account_token, params: Any | None = ...): ... + def update(self, paypal_account_token, params: Incomplete | None = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/settlement_batch_summary.pyi b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/settlement_batch_summary.pyi index 6b0a85411..681747e0f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/settlement_batch_summary.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/settlement_batch_summary.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete from braintree.configuration import Configuration as Configuration from braintree.error_result import ErrorResult as ErrorResult @@ -10,4 +10,4 @@ from braintree.util.http import Http as Http class SettlementBatchSummary(Resource): @staticmethod - def generate(settlement_date, group_by_custom_field: Any | None = ...): ... + def generate(settlement_date, group_by_custom_field: Incomplete | None = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/settlement_batch_summary_gateway.pyi b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/settlement_batch_summary_gateway.pyi index 31644a727..f1ef2565d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/settlement_batch_summary_gateway.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/settlement_batch_summary_gateway.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from braintree.error_result import ErrorResult as ErrorResult @@ -9,4 +10,4 @@ class SettlementBatchSummaryGateway: gateway: Any config: Any def __init__(self, gateway) -> None: ... - def generate(self, settlement_date, group_by_custom_field: Any | None = ...): ... + def generate(self, settlement_date, group_by_custom_field: Incomplete | None = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/subscription.pyi b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/subscription.pyi index 7819c0909..5cae727ed 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/subscription.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/subscription.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from braintree.add_on import AddOn as AddOn @@ -30,15 +31,15 @@ class Subscription(Resource): PastDue: str Pending: str @staticmethod - def create(params: Any | None = ...): ... + def create(params: Incomplete | None = ...): ... @staticmethod def create_signature(): ... @staticmethod def find(subscription_id): ... @staticmethod - def retry_charge(subscription_id, amount: Any | None = ..., submit_for_settlement: bool = ...): ... + def retry_charge(subscription_id, amount: Incomplete | None = ..., submit_for_settlement: bool = ...): ... @staticmethod - def update(subscription_id, params: Any | None = ...): ... + def update(subscription_id, params: Incomplete | None = ...): ... @staticmethod def cancel(subscription_id): ... @staticmethod diff --git a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/subscription_gateway.pyi b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/subscription_gateway.pyi index 766dc57e6..08e9dc80b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/subscription_gateway.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/subscription_gateway.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from braintree.error_result import ErrorResult as ErrorResult @@ -13,8 +14,8 @@ class SubscriptionGateway: config: Any def __init__(self, gateway) -> None: ... def cancel(self, subscription_id): ... - def create(self, params: Any | None = ...): ... + def create(self, params: Incomplete | None = ...): ... def find(self, subscription_id): ... - def retry_charge(self, subscription_id, amount: Any | None = ..., submit_for_settlement: bool = ...): ... + def retry_charge(self, subscription_id, amount: Incomplete | None = ..., submit_for_settlement: bool = ...): ... def search(self, *query): ... - def update(self, subscription_id, params: Any | None = ...): ... + def update(self, subscription_id, params: Incomplete | None = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/transaction.pyi b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/transaction.pyi index c89b67033..b0e8ba211 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/transaction.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/transaction.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from braintree.add_on import AddOn as AddOn @@ -103,23 +104,23 @@ class Transaction(Resource): @staticmethod def cancel_release(transaction_id): ... @staticmethod - def credit(params: Any | None = ...): ... + def credit(params: Incomplete | None = ...): ... @staticmethod def find(transaction_id): ... @staticmethod def hold_in_escrow(transaction_id): ... @staticmethod - def refund(transaction_id, amount_or_options: Any | None = ...): ... + def refund(transaction_id, amount_or_options: Incomplete | None = ...): ... @staticmethod - def sale(params: Any | None = ...): ... + def sale(params: Incomplete | None = ...): ... @staticmethod def search(*query): ... @staticmethod def release_from_escrow(transaction_id): ... @staticmethod - def submit_for_settlement(transaction_id, amount: Any | None = ..., params: Any | None = ...): ... + def submit_for_settlement(transaction_id, amount: Incomplete | None = ..., params: Incomplete | None = ...): ... @staticmethod - def update_details(transaction_id, params: Any | None = ...): ... + def update_details(transaction_id, params: Incomplete | None = ...): ... @staticmethod def void(transaction_id): ... @staticmethod @@ -135,7 +136,7 @@ class Transaction(Resource): @staticmethod def refund_signature(): ... @staticmethod - def submit_for_partial_settlement(transaction_id, amount, params: Any | None = ...): ... + def submit_for_partial_settlement(transaction_id, amount, params: Incomplete | None = ...): ... amount: Any tax_amount: Any discount_amount: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/transaction_gateway.pyi b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/transaction_gateway.pyi index 07f69feed..63b5c9136 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/transaction_gateway.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/transaction_gateway.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from braintree.error_result import ErrorResult as ErrorResult @@ -19,11 +20,11 @@ class TransactionGateway: def credit(self, params): ... def find(self, transaction_id): ... def hold_in_escrow(self, transaction_id): ... - def refund(self, transaction_id, amount_or_options: Any | None = ...): ... + def refund(self, transaction_id, amount_or_options: Incomplete | None = ...): ... def sale(self, params): ... def search(self, *query): ... def release_from_escrow(self, transaction_id): ... - def submit_for_settlement(self, transaction_id, amount: Any | None = ..., params: Any | None = ...): ... - def update_details(self, transaction_id, params: Any | None = ...): ... - def submit_for_partial_settlement(self, transaction_id, amount, params: Any | None = ...): ... + def submit_for_settlement(self, transaction_id, amount: Incomplete | None = ..., params: Incomplete | None = ...): ... + def update_details(self, transaction_id, params: Incomplete | None = ...): ... + def submit_for_partial_settlement(self, transaction_id, amount, params: Incomplete | None = ...): ... def void(self, transaction_id): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/util/graphql_client.pyi b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/util/graphql_client.pyi index 16ac5e47d..ec47e43fd 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/util/graphql_client.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/util/graphql_client.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from braintree.exceptions.authentication_error import AuthenticationError as AuthenticationError @@ -14,5 +15,5 @@ class GraphQLClient(Http): @staticmethod def raise_exception_for_graphql_error(response) -> None: ... graphql_headers: Any - def __init__(self, config: Any | None = ..., environment: Any | None = ...) -> None: ... - def query(self, definition, variables: Any | None = ..., operation_name: Any | None = ...): ... + def __init__(self, config: Incomplete | None = ..., environment: Incomplete | None = ...) -> None: ... + def query(self, definition, variables: Incomplete | None = ..., operation_name: Incomplete | None = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/util/http.pyi b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/util/http.pyi index f5e7a1ad6..c782212cd 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/util/http.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/util/http.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from braintree import version as version @@ -29,14 +30,14 @@ class Http: @staticmethod def is_error_status(status): ... @staticmethod - def raise_exception_from_status(status, message: Any | None = ...) -> None: ... + def raise_exception_from_status(status, message: Incomplete | None = ...) -> None: ... config: Any environment: Any - def __init__(self, config, environment: Any | None = ...) -> None: ... - def post(self, path, params: Any | None = ...): ... + def __init__(self, config, environment: Incomplete | None = ...) -> None: ... + def post(self, path, params: Incomplete | None = ...): ... def delete(self, path): ... def get(self, path): ... - def put(self, path, params: Any | None = ...): ... - def post_multipart(self, path, files, params: Any | None = ...): ... + def put(self, path, params: Incomplete | None = ...): ... + def post_multipart(self, path, files, params: Incomplete | None = ...): ... def http_do(self, http_verb, path, headers, request_body): ... def handle_exception(self, exception) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/validation_error_collection.pyi b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/validation_error_collection.pyi index 546dfcf7c..268cd0469 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/validation_error_collection.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/validation_error_collection.pyi @@ -1,10 +1,11 @@ +from _typeshed import Incomplete from typing import Any from braintree.validation_error import ValidationError as ValidationError class ValidationErrorCollection: data: Any - def __init__(self, data: Any | None = ...) -> None: ... + def __init__(self, data: Incomplete | None = ...) -> None: ... @property def deep_errors(self): ... def for_index(self, index): ... @@ -17,4 +18,4 @@ class ValidationErrorCollection: @property def size(self): ... def __getitem__(self, index): ... - def __len__(self): ... + def __len__(self) -> int: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/webhook_testing.pyi b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/webhook_testing.pyi index 6e12f0cd1..78fa449c8 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/webhook_testing.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/webhook_testing.pyi @@ -1,7 +1,7 @@ -from typing import Any +from _typeshed import Incomplete from braintree.configuration import Configuration as Configuration class WebhookTesting: @staticmethod - def sample_notification(kind, id, source_merchant_id: Any | None = ...): ... + def sample_notification(kind, id, source_merchant_id: Incomplete | None = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/webhook_testing_gateway.pyi b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/webhook_testing_gateway.pyi index b11569d05..73c71e931 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/webhook_testing_gateway.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/webhook_testing_gateway.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from braintree.util.crypto import Crypto as Crypto @@ -7,4 +8,4 @@ class WebhookTestingGateway: gateway: Any config: Any def __init__(self, gateway) -> None: ... - def sample_notification(self, kind, id, source_merchant_id: Any | None = ...): ... + def sample_notification(self, kind, id, source_merchant_id: Incomplete | None = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cachetools/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/cachetools/METADATA.toml index afc1fcfda..d7cde2e5e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/cachetools/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/cachetools/METADATA.toml @@ -1,4 +1 @@ -version = "5.2.*" - -[tool.stubtest] -ignore_missing_stub = false +version = "5.3.*" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cachetools/cachetools/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cachetools/cachetools/__init__.pyi index eea24f3f6..d7431feee 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/cachetools/cachetools/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/cachetools/cachetools/__init__.pyi @@ -1,4 +1,4 @@ -from _typeshed import IdentityFunction +from _typeshed import IdentityFunction, Unused from collections.abc import Callable, Iterator, MutableMapping, Sequence from contextlib import AbstractContextManager from typing import Any, Generic, TypeVar, overload @@ -21,7 +21,7 @@ class Cache(MutableMapping[_KT, _VT], Generic[_KT, _VT]): def __missing__(self, key: _KT) -> _VT: ... def __iter__(self) -> Iterator[_KT]: ... def __len__(self) -> int: ... - @overload # type: ignore[override] + @overload def pop(self, key: _KT) -> _VT: ... @overload def pop(self, key: _KT, default: _VT | _T) -> _VT | _T: ... @@ -66,7 +66,7 @@ class _TimedCache(Cache[_KT, _VT]): def __init__(self, timer: Callable[[], float]) -> None: ... def __call__(self) -> float: ... def __enter__(self) -> float: ... - def __exit__(self, *exc: object) -> None: ... + def __exit__(self, *exc: Unused) -> None: ... @property def timer(self) -> _Timer: ... @@ -97,7 +97,10 @@ class TLRUCache(_TimedCache[_KT, _VT]): def expire(self, time: float | None = ...) -> None: ... def cached( - cache: MutableMapping[_KT, Any] | None, key: Callable[..., _KT] = ..., lock: AbstractContextManager[Any] | None = ... + cache: MutableMapping[_KT, Any] | None, + key: Callable[..., _KT] = ..., + lock: AbstractContextManager[Any] | None = None, + info: bool = False, ) -> IdentityFunction: ... def cachedmethod( cache: Callable[[Any], MutableMapping[_KT, Any] | None], diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cachetools/cachetools/keys.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cachetools/cachetools/keys.pyi index 497bc1858..9b48a37ea 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/cachetools/cachetools/keys.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/cachetools/cachetools/keys.pyi @@ -1,7 +1,8 @@ +from _typeshed import Unused from collections.abc import Hashable __all__ = ("hashkey", "methodkey", "typedkey") def hashkey(*args: Hashable, **kwargs: Hashable) -> tuple[Hashable, ...]: ... -def methodkey(self: object, *args: Hashable, **kwargs: Hashable) -> tuple[Hashable, ...]: ... +def methodkey(self: Unused, *args: Hashable, **kwargs: Hashable) -> tuple[Hashable, ...]: ... def typedkey(*args: Hashable, **kwargs: Hashable) -> tuple[Hashable, ...]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/caldav/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/caldav/METADATA.toml index cb3c0d00d..7781cfecf 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/caldav/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/caldav/METADATA.toml @@ -1,3 +1,6 @@ -version = "0.9.*" +version = "1.2.*" # also types-lxml and types-icalendar when those stubs are added requires = ["types-requests", "types-vobject"] + +[tool.stubtest] +ignore_missing_stub = true diff --git a/packages/pyright-internal/typeshed-fallback/stubs/caldav/caldav/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/caldav/caldav/__init__.pyi index 721495fa9..2acc1c3b9 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/caldav/caldav/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/caldav/caldav/__init__.pyi @@ -1,2 +1,4 @@ from .davclient import DAVClient as DAVClient from .objects import * + +__version__: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/caldav/caldav/davclient.pyi b/packages/pyright-internal/typeshed-fallback/stubs/caldav/caldav/davclient.pyi index b624060e1..ffe393ad6 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/caldav/caldav/davclient.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/caldav/caldav/davclient.pyi @@ -1,17 +1,18 @@ -from _typeshed import Self +from _typeshed import Incomplete from collections.abc import Iterable, Mapping -from typing import Any -from typing_extensions import TypeAlias +from types import TracebackType +from typing_extensions import Self, TypeAlias from urllib.parse import ParseResult, SplitResult from requests.auth import AuthBase from requests.models import Response +from requests.sessions import _Timeout from requests.structures import CaseInsensitiveDict from .lib.url import URL from .objects import Calendar, DAVObject, Principal -_Element: TypeAlias = Any # actually lxml.etree._Element +_Element: TypeAlias = Incomplete # actually lxml.etree._Element class DAVResponse: reason: str @@ -25,7 +26,7 @@ class DAVResponse: def validate_status(self, status: str) -> None: ... def find_objects_and_props(self) -> None: ... def expand_simple_props( - self, props: Iterable[Any] = ..., multi_value_props: Iterable[Any] = ..., xpath: str | None = ... + self, props: Iterable[Incomplete] = ..., multi_value_props: Iterable[Incomplete] = ..., xpath: str | None = ... ) -> dict[str, dict[str, str]]: ... class DAVClient: @@ -35,20 +36,25 @@ class DAVClient: username: str | None password: str | None auth: AuthBase | None + timeout: _Timeout | None ssl_verify_cert: bool | str ssl_cert: str | tuple[str, str] | None def __init__( self, url: str, - proxy: str | None = ..., - username: str | None = ..., - password: str | None = ..., - auth: AuthBase | None = ..., - ssl_verify_cert: bool | str = ..., - ssl_cert: str | tuple[str, str] | None = ..., + proxy: str | None = None, + username: str | None = None, + password: str | None = None, + auth: AuthBase | None = None, + timeout: _Timeout | None = None, + ssl_verify_cert: bool | str = True, + ssl_cert: str | tuple[str, str] | None = None, + headers: dict[str, str] = ..., + ) -> None: ... + def __enter__(self) -> Self: ... + def __exit__( + self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None ) -> None: ... - def __enter__(self: Self) -> Self: ... - def __exit__(self, exc_type: object, exc_value: object, traceback: object) -> None: ... def principal(self, *, url: str | ParseResult | SplitResult | URL | None = ...) -> Principal: ... def calendar( self, @@ -56,8 +62,8 @@ class DAVClient: parent: DAVObject | None = ..., name: str | None = ..., id: str | None = ..., - props: Mapping[Any, Any] = ..., - **extra: Any, + props: Mapping[Incomplete, Incomplete] = ..., + **extra: Incomplete, ) -> Calendar: ... def check_dav_support(self) -> str | None: ... def check_cdav_support(self) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/caldav/caldav/elements/base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/caldav/caldav/elements/base.pyi index 264c1c722..c55dbf7d0 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/caldav/caldav/elements/base.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/caldav/caldav/elements/base.pyi @@ -1,7 +1,7 @@ -from _typeshed import Self +from _typeshed import Incomplete from collections.abc import Iterable from typing import Any, ClassVar -from typing_extensions import TypeAlias +from typing_extensions import Self, TypeAlias _Element: TypeAlias = Any # actually lxml.etree._Element @@ -9,13 +9,13 @@ class BaseElement: tag: ClassVar[str | None] children: list[BaseElement] value: str | None - attributes: Any | None - caldav_class: Any | None + attributes: Incomplete | None + caldav_class: Incomplete | None def __init__(self, name: str | None = ..., value: str | bytes | None = ...) -> None: ... - def __add__(self: Self, other: BaseElement) -> Self: ... + def __add__(self, other: BaseElement) -> Self: ... def xmlelement(self) -> _Element: ... def xmlchildren(self, root: _Element) -> None: ... - def append(self: Self, element: BaseElement | Iterable[BaseElement]) -> Self: ... + def append(self, element: BaseElement | Iterable[BaseElement]) -> Self: ... class NamedBaseElement(BaseElement): def __init__(self, name: str | None = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/caldav/caldav/objects.pyi b/packages/pyright-internal/typeshed-fallback/stubs/caldav/caldav/objects.pyi index 903f98a0c..ee62b347f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/caldav/caldav/objects.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/caldav/caldav/objects.pyi @@ -1,19 +1,20 @@ import datetime -from _typeshed import Self -from collections.abc import Iterable, Iterator, Mapping -from typing import Any, TypeVar, overload -from typing_extensions import Literal, TypeAlias +from _typeshed import Incomplete +from collections.abc import Iterable, Iterator, Mapping, Sequence +from typing import TypeVar, overload +from typing_extensions import Literal, Self, TypeAlias from urllib.parse import ParseResult, SplitResult from vobject.base import VBase from .davclient import DAVClient -from .elements.cdav import CompFilter, ScheduleInboxURL, ScheduleOutboxURL +from .elements.cdav import CalendarQuery, CompFilter, ScheduleInboxURL, ScheduleOutboxURL from .lib.url import URL _CC = TypeVar("_CC", bound=CalendarObjectResource) - -_VCalAddress: TypeAlias = Any # actually icalendar.vCalAddress +# Actually "type[Todo] | type[Event] | type[Journal]", but mypy doesn't like that. +_CompClass: TypeAlias = type[CalendarObjectResource] +_VCalAddress: TypeAlias = Incomplete # actually icalendar.vCalAddress class DAVObject: id: str | None @@ -21,8 +22,8 @@ class DAVObject: client: DAVClient | None parent: DAVObject | None name: str | None - props: Mapping[Any, Any] - extra_init_options: dict[str, Any] + props: Mapping[Incomplete, Incomplete] + extra_init_options: dict[str, Incomplete] def __init__( self, client: DAVClient | None = ..., @@ -30,24 +31,24 @@ class DAVObject: parent: DAVObject | None = ..., name: str | None = ..., id: str | None = ..., - props: Mapping[Any, Any] | None = ..., - **extra: Any, + props: Mapping[Incomplete, Incomplete] | None = ..., + **extra: Incomplete, ) -> None: ... @property def canonical_url(self) -> str: ... - def children(self, type: str | None = ...) -> list[tuple[URL, Any, Any]]: ... - def get_property(self, prop, use_cached: bool = ..., **passthrough) -> Any | None: ... + def children(self, type: str | None = ...) -> list[tuple[URL, Incomplete, Incomplete]]: ... + def get_property(self, prop, use_cached: bool = ..., **passthrough) -> Incomplete | None: ... def get_properties( - self, props: Any | None = ..., depth: int = ..., parse_response_xml: bool = ..., parse_props: bool = ... + self, props: Incomplete | None = ..., depth: int = ..., parse_response_xml: bool = ..., parse_props: bool = ... ): ... - def set_properties(self: Self, props: Any | None = ...) -> Self: ... - def save(self: Self) -> Self: ... + def set_properties(self, props: Incomplete | None = ...) -> Self: ... + def save(self) -> Self: ... def delete(self) -> None: ... class CalendarSet(DAVObject): def calendars(self) -> list[Calendar]: ... def make_calendar( - self, name: str | None = ..., cal_id: str | None = ..., supported_calendar_component_set: Any | None = ... + self, name: str | None = ..., cal_id: str | None = ..., supported_calendar_component_set: Incomplete | None = ... ) -> Calendar: ... def calendar(self, name: str | None = ..., cal_id: str | None = ...) -> Calendar: ... @@ -55,9 +56,9 @@ class Principal(DAVObject): def __init__(self, client: DAVClient | None = ..., url: str | ParseResult | SplitResult | URL | None = ...) -> None: ... def calendars(self) -> list[Calendar]: ... def make_calendar( - self, name: str | None = ..., cal_id: str | None = ..., supported_calendar_component_set: Any | None = ... + self, name: str | None = ..., cal_id: str | None = ..., supported_calendar_component_set: Incomplete | None = ... ) -> Calendar: ... - def calendar(self, name: str | None = ..., cal_id: str | None = ...) -> Calendar: ... + def calendar(self, name: str | None = None, cal_id: str | None = None, cal_url: str | None = None) -> Calendar: ... def get_vcal_address(self) -> _VCalAddress: ... calendar_home_set: CalendarSet # can also be set to anything URL.objectify() accepts def freebusy_request(self, dtstart, dtend, attendees): ... @@ -66,12 +67,16 @@ class Principal(DAVObject): def schedule_outbox(self) -> ScheduleOutbox: ... class Calendar(DAVObject): - def get_supported_components(self) -> list[Any]: ... + def get_supported_components(self) -> list[Incomplete]: ... def save_with_invites(self, ical: str, attendees, **attendeeoptions) -> None: ... - def save_event(self, ical: str | None = ..., no_overwrite: bool = ..., no_create: bool = ..., **ical_data: Any) -> Event: ... - def save_todo(self, ical: str | None = ..., no_overwrite: bool = ..., no_create: bool = ..., **ical_data: Any) -> Todo: ... + def save_event( + self, ical: str | None = ..., no_overwrite: bool = ..., no_create: bool = ..., **ical_data: Incomplete + ) -> Event: ... + def save_todo( + self, ical: str | None = ..., no_overwrite: bool = ..., no_create: bool = ..., **ical_data: Incomplete + ) -> Todo: ... def save_journal( - self, ical: str | None = ..., no_overwrite: bool = ..., no_create: bool = ..., **ical_data: Any + self, ical: str | None = ..., no_overwrite: bool = ..., no_create: bool = ..., **ical_data: Incomplete ) -> Journal: ... add_event = save_event add_todo = save_todo @@ -107,20 +112,69 @@ class Calendar(DAVObject): verify_expand: bool = ..., ) -> list[CalendarObjectResource]: ... @overload - def search(self, xml, comp_class: None = ...) -> list[CalendarObjectResource]: ... + def search( + self, + xml: None = ..., + comp_class: None = ..., + todo: bool | None = ..., + include_completed: bool = ..., + sort_keys: Sequence[str] = ..., + split_expanded: bool = ..., + **kwargs, + ) -> list[CalendarObjectResource]: ... @overload - def search(self, xml, comp_class: type[_CC]) -> list[_CC]: ... + def search( + self, + xml, + comp_class: type[_CC], + todo: bool | None = ..., + include_completed: bool = ..., + sort_keys: Sequence[str] = ..., + split_expanded: bool = ..., + **kwargs, + ) -> list[_CC]: ... + @overload + def search( + self, + *, + comp_class: type[_CC], + todo: bool | None = ..., + include_completed: bool = ..., + sort_keys: Sequence[str] = ..., + split_expanded: bool = ..., + **kwargs, + ) -> list[_CC]: ... + def build_search_xml_query( + self, + comp_class: _CompClass | None = ..., + todo: bool | None = ..., + ignore_completed1: bool | None = ..., + ignore_completed2: bool | None = ..., + ignore_completed3: bool | None = ..., + event: bool | None = ..., + filters: list[Incomplete] | None = ..., + expand: bool | None = ..., + start: datetime.datetime | None = ..., + end: datetime.datetime | None = ..., + *, + uid=..., + summary=..., + comment=..., + description=..., + location=..., + status=..., + ) -> tuple[CalendarQuery, _CompClass]: ... def freebusy_request(self, start: datetime.datetime, end: datetime.datetime) -> FreeBusy: ... def todos(self, sort_keys: Iterable[str] = ..., include_completed: bool = ..., sort_key: str | None = ...) -> list[Todo]: ... - def event_by_url(self, href, data: Any | None = ...) -> Event: ... - def object_by_uid(self, uid: str, comp_filter: CompFilter | None = ...) -> Event: ... + def event_by_url(self, href, data: Incomplete | None = ...) -> Event: ... + def object_by_uid(self, uid: str, comp_filter: CompFilter | None = ..., comp_class: _CompClass | None = ...) -> Event: ... def todo_by_uid(self, uid: str) -> CalendarObjectResource: ... def event_by_uid(self, uid: str) -> CalendarObjectResource: ... def journal_by_uid(self, uid: str) -> CalendarObjectResource: ... event = event_by_uid def events(self) -> list[Event]: ... def objects_by_sync_token( - self, sync_token: Any | None = ..., load_objects: bool = ... + self, sync_token: Incomplete | None = ..., load_objects: bool = ... ) -> SynchronizableCalendarObjectCollection: ... objects = objects_by_sync_token def journals(self) -> list[Journal]: ... @@ -142,42 +196,58 @@ class ScheduleOutbox(ScheduleMailbox): class SynchronizableCalendarObjectCollection: def __init__(self, calendar, objects, sync_token) -> None: ... - def __iter__(self) -> Iterator[Any]: ... + def __iter__(self) -> Iterator[Incomplete]: ... + def __len__(self) -> int: ... def objects_by_url(self): ... - def sync(self) -> tuple[Any, Any]: ... + def sync(self) -> tuple[Incomplete, Incomplete]: ... class CalendarObjectResource(DAVObject): def __init__( self, client: DAVClient | None = ..., url: str | ParseResult | SplitResult | URL | None = ..., - data: Any | None = ..., - parent: Any | None = ..., - id: Any | None = ..., - props: Any | None = ..., + data: Incomplete | None = ..., + parent: Incomplete | None = ..., + id: Incomplete | None = ..., + props: Incomplete | None = ..., ) -> None: ... def add_organizer(self) -> None: ... + def split_expanded(self) -> list[Self]: ... + def expand_rrule(self, start: datetime.datetime, end: datetime.datetime) -> None: ... def add_attendee(self, attendee, no_default_parameters: bool = ..., **parameters) -> None: ... def is_invite_request(self) -> bool: ... - def accept_invite(self, calendar: Any | None = ...) -> None: ... - def decline_invite(self, calendar: Any | None = ...) -> None: ... - def tentatively_accept_invite(self, calendar: Any | None = ...) -> None: ... - def copy(self: Self, keep_uid: bool = ..., new_parent: Any | None = ...) -> Self: ... - def load(self: Self) -> Self: ... - def change_attendee_status(self, attendee: Any | None = ..., **kwargs) -> None: ... + def accept_invite(self, calendar: Incomplete | None = ...) -> None: ... + def decline_invite(self, calendar: Incomplete | None = ...) -> None: ... + def tentatively_accept_invite(self, calendar: Incomplete | None = ...) -> None: ... + def copy(self, keep_uid: bool = ..., new_parent: Incomplete | None = ...) -> Self: ... + def load(self, only_if_unloaded: bool = False) -> Self: ... + def change_attendee_status(self, attendee: Incomplete | None = ..., **kwargs) -> None: ... def save( - self: Self, no_overwrite: bool = ..., no_create: bool = ..., obj_type: Any | None = ..., if_schedule_tag_match: bool = ... + self, + no_overwrite: bool = ..., + no_create: bool = ..., + obj_type: str | None = ..., + increase_seqno: bool = ..., + if_schedule_tag_match: bool = ..., ) -> Self: ... - data: Any + def get_duration(self) -> datetime.timedelta: ... + data: Incomplete vobject_instance: VBase - icalendar_instance: Any + icalendar_instance: Incomplete instance: VBase class Event(CalendarObjectResource): ... class Journal(CalendarObjectResource): ... class FreeBusy(CalendarObjectResource): - def __init__(self, parent, data, url: str | ParseResult | SplitResult | URL | None = ..., id: Any | None = ...) -> None: ... + def __init__( + self, parent, data, url: str | ParseResult | SplitResult | URL | None = ..., id: Incomplete | None = ... + ) -> None: ... class Todo(CalendarObjectResource): - def complete(self, completion_timestamp: datetime.datetime | None = ...) -> None: ... + def complete( + self, + completion_timestamp: datetime.datetime | None = ..., + handle_rrule: bool = ..., + rrule_mode: Literal["safe", "this_and_future"] = ..., + ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/caldav/caldav/requests.pyi b/packages/pyright-internal/typeshed-fallback/stubs/caldav/caldav/requests.pyi new file mode 100644 index 000000000..6335655eb --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/caldav/caldav/requests.pyi @@ -0,0 +1,8 @@ +from requests.auth import AuthBase + +class HTTPBearerAuth(AuthBase): + password: str + def __init__(self, password: str) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __ne__(self, other: object) -> bool: ... + def __call__(self, r): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/certifi/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/certifi/METADATA.toml deleted file mode 100644 index a6f1f0aa4..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/certifi/METADATA.toml +++ /dev/null @@ -1,2 +0,0 @@ -version = "2021.10.8" -obsolete_since = "2022.5.18.1" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/certifi/certifi.pyi b/packages/pyright-internal/typeshed-fallback/stubs/certifi/certifi.pyi deleted file mode 100644 index 315f7c822..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/certifi/certifi.pyi +++ /dev/null @@ -1,2 +0,0 @@ -def where() -> str: ... -def contents() -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cffi/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/cffi/METADATA.toml new file mode 100644 index 000000000..e7239b079 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/cffi/METADATA.toml @@ -0,0 +1,5 @@ +version = "1.15.*" + +[tool.stubtest] +# linux and darwin are mostly equivalent, except for a single `RTLD_DEEPBIND` variable +platforms = ["linux", "win32"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cffi/_cffi_backend.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cffi/_cffi_backend.pyi new file mode 100644 index 000000000..1b3d8f20e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/cffi/_cffi_backend.pyi @@ -0,0 +1,266 @@ +import sys +import types +from _typeshed import Incomplete, ReadableBuffer, WriteableBuffer +from collections.abc import Callable, Hashable +from typing import Any, ClassVar, Protocol, TypeVar, overload +from typing_extensions import Literal, TypeAlias, final + +_T = TypeVar("_T") + +class _Allocator(Protocol): + def __call__(self, cdecl: str | CType, init: Any = ...) -> _CDataBase: ... + +__version__: str + +FFI_CDECL: int +FFI_DEFAULT_ABI: int +RTLD_GLOBAL: int +RTLD_LAZY: int +RTLD_LOCAL: int +RTLD_NOW: int +if sys.platform == "linux": + RTLD_DEEPBIND: int +if sys.platform != "win32": + RTLD_NODELETE: int + RTLD_NOLOAD: int + +@final +class CField: + bitshift: Incomplete + bitsize: Incomplete + flags: Incomplete + offset: Incomplete + type: Incomplete + +@final +class CLibrary: + def close_lib(self, *args, **kwargs): ... + def load_function(self, *args, **kwargs): ... + def read_variable(self, *args, **kwargs): ... + def write_variable(self, *args, **kwargs): ... + +@final +class CType: + abi: Incomplete + args: Incomplete + cname: Incomplete + elements: Incomplete + ellipsis: Incomplete + fields: Incomplete + item: Incomplete + kind: Incomplete + length: Incomplete + relements: Incomplete + result: Incomplete + def __dir__(self): ... + +@final +class Lib: + def __dir__(self): ... + +@final +class _CDataBase: + __name__: ClassVar[str] + def __add__(self, other): ... + def __bool__(self) -> bool: ... + def __call__(self, *args, **kwargs): ... + def __complex__(self) -> complex: ... + def __delitem__(self, other) -> None: ... + def __dir__(self): ... + def __enter__(self): ... + def __eq__(self, other): ... + def __exit__(self, type: type[BaseException] | None, value: BaseException | None, traceback: types.TracebackType | None): ... + def __float__(self) -> float: ... + def __ge__(self, other): ... + def __getitem__(self, index): ... + def __gt__(self, other): ... + def __hash__(self) -> int: ... + def __int__(self) -> int: ... + def __iter__(self): ... + def __le__(self, other): ... + def __len__(self) -> int: ... + def __lt__(self, other): ... + def __ne__(self, other): ... + def __radd__(self, other): ... + def __rsub__(self, other): ... + def __setitem__(self, index, object) -> None: ... + def __sub__(self, other): ... + +@final +class buffer: + __hash__: ClassVar[None] # type: ignore[assignment] + def __init__(self, *args, **kwargs) -> None: ... + def __delitem__(self, other) -> None: ... + def __eq__(self, other): ... + def __ge__(self, other): ... + def __getitem__(self, index): ... + def __gt__(self, other): ... + def __le__(self, other): ... + def __len__(self) -> int: ... + def __lt__(self, other): ... + def __ne__(self, other): ... + def __setitem__(self, index, object) -> None: ... + +# These aliases are to work around pyright complaints. +# Pyright doesn't like it when a class object is defined as an alias +# of a global object with the same name. +_tmp_CType = CType +_tmp_buffer = buffer + +class FFI: + CData: TypeAlias = _CDataBase + CType: TypeAlias = _tmp_CType + buffer: TypeAlias = _tmp_buffer # noqa: Y042 + + class error(Exception): ... + NULL: ClassVar[CData] + RTLD_GLOBAL: ClassVar[int] + RTLD_LAZY: ClassVar[int] + RTLD_LOCAL: ClassVar[int] + RTLD_NOW: ClassVar[int] + if sys.platform != "win32": + RTLD_DEEPBIND: ClassVar[int] + RTLD_NODELETE: ClassVar[int] + RTLD_NOLOAD: ClassVar[int] + + errno: int + + def __init__( + self, + module_name: str = ..., + _version: int = ..., + _types: str = ..., + _globals: tuple[str | int, ...] = ..., + _struct_unions: tuple[tuple[str, ...], ...] = ..., + _enums: tuple[str, ...] = ..., + _typenames: tuple[str, ...] = ..., + _includes: tuple[FFI, ...] = ..., + ) -> None: ... + @overload + def addressof(self, __cdata: CData, *field_or_index: str | int) -> CData: ... + @overload + def addressof(self, __library: Lib, __name: str) -> CData: ... + def alignof(self, __cdecl: str | CType | CData) -> int: ... + @overload + def callback( + self, + cdecl: str | CType, + python_callable: None = ..., + error: Any = ..., + onerror: Callable[[Exception, Any, Any], None] | None = ..., + ) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ... + @overload + def callback( + self, + cdecl: str | CType, + python_callable: Callable[..., _T], + error: Any = ..., + onerror: Callable[[Exception, Any, Any], None] | None = ..., + ) -> Callable[..., _T]: ... + def cast(self, cdecl: str | CType, value: CData) -> CData: ... + def def_extern( + self, name: str = ..., error: Any = ..., onerror: Callable[[Exception, Any, types.TracebackType], Any] = ... + ) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ... + def dlclose(self, __lib: Lib) -> None: ... + if sys.platform == "win32": + def dlopen(self, __libpath: str | CData, __flags: int = ...) -> Lib: ... + else: + def dlopen(self, __libpath: str | CData | None = ..., __flags: int = ...) -> Lib: ... + + @overload + def from_buffer(self, cdecl: ReadableBuffer, require_writable: Literal[False] = ...) -> CData: ... + @overload + def from_buffer(self, cdecl: WriteableBuffer, require_writable: Literal[True]) -> CData: ... + @overload + def from_buffer(self, cdecl: str | CType, python_buffer: ReadableBuffer, require_writable: Literal[False] = ...) -> CData: ... + @overload + def from_buffer(self, cdecl: str | CType, python_buffer: WriteableBuffer, require_writable: Literal[True]) -> CData: ... + def from_handle(self, __x: CData) -> Any: ... + @overload + def gc(self, cdata: CData, destructor: Callable[[CData], Any], size: int = ...) -> CData: ... + @overload + def gc(self, cdata: CData, destructor: None, size: int = ...) -> None: ... + def getctype(self, cdecl: str | CType, replace_with: str = ...) -> str: ... + if sys.platform == "win32": + def getwinerror(self, code: int = ...) -> tuple[int, str]: ... + + def init_once(self, func: Callable[[], Any], tag: Hashable) -> Any: ... + def integer_const(self, name: str) -> int: ... + def list_types(self) -> tuple[list[str], list[str], list[str]]: ... + def memmove(self, dest: CData | WriteableBuffer, src: CData | ReadableBuffer, n: int) -> None: ... + def new(self, cdecl: str | CType, init: Any = ...) -> CData: ... + @overload + def new_allocator(self, alloc: None = ..., free: None = ..., should_clear_after_alloc: bool = ...) -> _Allocator: ... + @overload + def new_allocator( + self, alloc: Callable[[int], CData], free: None = ..., should_clear_after_alloc: bool = ... + ) -> _Allocator: ... + @overload + def new_allocator( + self, alloc: Callable[[int], CData], free: Callable[[CData], Any], should_clear_after_alloc: bool = ... + ) -> _Allocator: ... + def new_handle(self, __x: Any) -> CData: ... + def offsetof(self, __cdecl: str | CType, __field_or_index: str | int, *__fields_or_indexes: str | int) -> int: ... + def release(self, __cdata: CData) -> None: ... + def sizeof(self, __cdecl: str | CType | CData) -> int: ... + def string(self, cdata: CData, maxlen: int) -> bytes | str: ... + def typeof(self, cdecl: str | CData) -> CType: ... + def unpack(self, cdata: CData, length: int) -> bytes | str | list[Any]: ... + +def alignof(__cdecl: CType) -> int: ... +def callback( + __cdecl: CType, + __python_callable: Callable[..., _T], + __error: Any = ..., + __onerror: Callable[[Exception, Any, Any], None] | None = ..., +) -> Callable[..., _T]: ... +def cast(__cdecl: CType, __value: _CDataBase) -> _CDataBase: ... +def complete_struct_or_union( + __cdecl: CType, + __fields: list[tuple[str, CType, int, int]], + __ignored: Any, + __total_size: int, + __total_alignment: int, + __sflags: int, + __pack: int, +) -> None: ... +@overload +def from_buffer(__cdecl: CType, __python_buffer: ReadableBuffer, require_writable: Literal[False] = ...) -> _CDataBase: ... +@overload +def from_buffer(__cdecl: CType, __python_buffer: WriteableBuffer, require_writable: Literal[True]) -> _CDataBase: ... +def from_handle(__x: _CDataBase) -> Any: ... +@overload +def gcp(cdata: _CDataBase, destructor: Callable[[_CDataBase], Any], size: int = ...) -> _CDataBase: ... +@overload +def gcp(cdata: _CDataBase, destructor: None, size: int = ...) -> None: ... +def get_errno() -> int: ... +def getcname(__cdecl: CType, __replace_with: str) -> str: ... + +if sys.platform == "win32": + def getwinerror(code: int = ...) -> tuple[int, str]: ... + +if sys.platform == "win32": + def load_library(__libpath: str | _CDataBase, __flags: int = ...) -> CLibrary: ... + +else: + def load_library(__libpath: str | _CDataBase | None = ..., __flags: int = ...) -> CLibrary: ... + +def memmove(dest: _CDataBase | WriteableBuffer, src: _CDataBase | ReadableBuffer, n: int) -> None: ... +def new_array_type(__cdecl: CType, __length: int | None) -> CType: ... +def new_enum_type(__name: str, __enumerators: tuple[str, ...], __enumvalues: tuple[Any, ...], __basetype: CType) -> CType: ... +def new_function_type(__args: tuple[CType, ...], __result: CType, __ellipsis: int, __abi: int) -> CType: ... +def new_pointer_type(__cdecl: CType) -> CType: ... +def new_primitive_type(__name: str) -> CType: ... +def new_struct_type(__name: str) -> CType: ... +def new_union_type(__name: str) -> CType: ... +def new_void_type() -> CType: ... +def newp(__cdecl: CType, __init: Any = ...) -> _CDataBase: ... +def newp_handle(__cdecl: CType, __x: Any) -> _CDataBase: ... +def rawaddressof(__cdecl: CType, __cdata: _CDataBase, __offset: int) -> _CDataBase: ... +def release(__cdata: _CDataBase) -> None: ... +def set_errno(__errno: int) -> None: ... +def sizeof(__cdecl: CType | _CDataBase) -> int: ... +def string(cdata: _CDataBase, maxlen: int) -> bytes | str: ... +def typeof(__cdata: _CDataBase) -> CType: ... +def typeoffsetof(__cdecl: CType, __fieldname: str | int, __following: bool = ...) -> tuple[CType, int]: ... +def unpack(cdata: _CDataBase, length: int) -> bytes | str | list[Any]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cffi/cffi/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cffi/cffi/__init__.pyi new file mode 100644 index 000000000..851066f61 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/cffi/cffi/__init__.pyi @@ -0,0 +1,11 @@ +from .api import FFI as FFI +from .error import ( + CDefError as CDefError, + FFIError as FFIError, + VerificationError as VerificationError, + VerificationMissing as VerificationMissing, +) + +__version__: str +__version_info__: tuple[int, int, int] +__version_verifier_modules__: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cffi/cffi/api.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cffi/cffi/api.pyi new file mode 100644 index 000000000..c95a5b358 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/cffi/cffi/api.pyi @@ -0,0 +1,96 @@ +import distutils.core +import sys +import types +from _typeshed import Incomplete, ReadableBuffer, WriteableBuffer +from collections.abc import Callable, Hashable +from typing import Any, TypeVar, overload +from typing_extensions import Literal, TypeAlias + +import _cffi_backend + +_T = TypeVar("_T") + +basestring: TypeAlias = str # noqa: Y042 + +class FFI: + CData: TypeAlias = _cffi_backend._CDataBase + CType: TypeAlias = _cffi_backend.CType + buffer: TypeAlias = _cffi_backend.buffer # noqa: Y042 + + BVoidP: CType + BCharA: CType + NULL: CType + errno: int + + def __init__(self, backend: types.ModuleType | None = ...) -> None: ... + def cdef(self, csource: str, override: bool = ..., packed: bool = ..., pack: int | None = ...) -> None: ... + def embedding_api(self, csource: str, packed: bool = ..., pack: bool | int | None = ...) -> None: ... + def dlopen(self, name: str, flags: int = ...) -> _cffi_backend.Lib: ... + def dlclose(self, lib: _cffi_backend.Lib) -> None: ... + def typeof(self, cdecl: str | CData | types.BuiltinFunctionType | types.FunctionType) -> CType: ... + def sizeof(self, cdecl: str | CData) -> int: ... + def alignof(self, cdecl: str | CData) -> int: ... + def offsetof(self, cdecl: str | CData, *fields_or_indexes: str | int) -> int: ... + def new(self, cdecl: str | CType, init: Incomplete | None = ...) -> CData: ... + def new_allocator( + self, + alloc: Callable[[int], CData] | None = ..., + free: Callable[[CData], Any] | None = ..., + should_clear_after_alloc: bool = ..., + ) -> _cffi_backend._Allocator: ... + def cast(self, cdecl: str | CType, source: CData) -> CData: ... + def string(self, cdata: CData, maxlen: int = ...) -> bytes | str: ... + def unpack(self, cdata: CData, length: int) -> bytes | str | list[Any]: ... + @overload + def from_buffer(self, cdecl: ReadableBuffer, require_writable: Literal[False] = ...) -> CData: ... + @overload + def from_buffer(self, cdecl: WriteableBuffer, require_writable: Literal[True]) -> CData: ... + @overload + def from_buffer(self, cdecl: str, python_buffer: ReadableBuffer, require_writable: Literal[False] = ...) -> CData: ... + @overload + def from_buffer(self, cdecl: str, python_buffer: WriteableBuffer, require_writable: Literal[True]) -> CData: ... + def memmove(self, dest: CData | WriteableBuffer, src: CData | ReadableBuffer, n: int) -> None: ... + @overload + def callback( + self, + cdecl: str | CType, + python_callable: None = ..., + error: Any = ..., + onerror: Callable[[Exception, Any, Any], None] | None = ..., + ) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ... + @overload + def callback( + self, + cdecl: str | CType, + python_callable: Callable[..., _T], + error: Any = ..., + onerror: Callable[[Exception, Any, Any], None] | None = ..., + ) -> Callable[..., _T]: ... + def getctype(self, cdecl: str | CType, replace_with: str = ...) -> str: ... + @overload + def gc(self, cdata: CData, destructor: Callable[[CData], Any], size: int = ...) -> CData: ... + @overload + def gc(self, cdata: CData, destructor: None, size: int = ...) -> None: ... + def verify(self, source: str = ..., tmpdir: str | None = ..., **kwargs: Any) -> _cffi_backend.Lib: ... + # Technically exists on all OSs, but crashes on all but Windows. So we hide it in stubs + if sys.platform == "win32": + def getwinerror(self, code: int = ...) -> tuple[int, str] | None: ... + + def addressof(self, cdata: CData, *fields_or_indexes: str | int) -> CData: ... + def include(self, ffi_to_include: FFI) -> None: ... + def new_handle(self, x: Any) -> CData: ... + def from_handle(self, x: CData) -> Any: ... + def release(self, x: CData) -> None: ... + def set_unicode(self, enabled_flag: bool) -> None: ... + def set_source(self, module_name: str, source: str, source_extension: str = ..., **kwds: Any) -> None: ... + def set_source_pkgconfig( + self, module_name: str, pkgconfig_libs: list[str], source: str, source_extension: str = ..., **kwds: Any + ) -> None: ... + def distutils_extension(self, tmpdir: str = ..., verbose: bool = ...) -> distutils.core.Extension: ... + def emit_c_code(self, filename: str) -> None: ... + def emit_python_code(self, filename: str) -> None: ... + def compile(self, tmpdir: str = ..., verbose: int = ..., target: str | None = ..., debug: bool | None = ...) -> str: ... + def init_once(self, func: Callable[[], Any], tag: Hashable) -> Any: ... + def embedding_init_code(self, pysource: str) -> None: ... + def def_extern(self, *args: Any, **kwds: Any) -> None: ... + def list_types(self) -> tuple[list[str], list[str], list[str]]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cffi/cffi/backend_ctypes.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cffi/cffi/backend_ctypes.pyi new file mode 100644 index 000000000..32c66b8c6 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/cffi/cffi/backend_ctypes.pyi @@ -0,0 +1,79 @@ +from _typeshed import Incomplete + +unicode = str +long = int +xrange = range +bytechr: Incomplete + +class CTypesType(type): ... + +class CTypesData: + __metaclass__: Incomplete + __name__: str + def __init__(self, *args) -> None: ... + def __iter__(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + def __lt__(self, other): ... + def __le__(self, other): ... + def __gt__(self, other): ... + def __ge__(self, other): ... + def __hash__(self) -> int: ... + def __repr__(self, c_name: str | None = ...): ... + +class CTypesGenericPrimitive(CTypesData): + def __hash__(self) -> int: ... + +class CTypesGenericArray(CTypesData): + def __iter__(self): ... + +class CTypesGenericPtr(CTypesData): + kind: str + def __nonzero__(self) -> bool: ... + def __bool__(self) -> bool: ... + +class CTypesBaseStructOrUnion(CTypesData): ... + +class CTypesBackend: + PRIMITIVE_TYPES: Incomplete + RTLD_LAZY: int + RTLD_NOW: int + RTLD_GLOBAL: Incomplete + RTLD_LOCAL: Incomplete + def __init__(self) -> None: ... + ffi: Incomplete + def set_ffi(self, ffi) -> None: ... + def load_library(self, path, flags: int = ...): ... + def new_void_type(self): ... + def new_primitive_type(self, name): ... + def new_pointer_type(self, BItem): ... + def new_array_type(self, CTypesPtr, length): ... + def new_struct_type(self, name): ... + def new_union_type(self, name): ... + def complete_struct_or_union( + self, CTypesStructOrUnion, fields, tp, totalsize: int = ..., totalalignment: int = ..., sflags: int = ..., pack: int = ... + ): ... + def new_function_type(self, BArgs, BResult, has_varargs): ... + def new_enum_type(self, name, enumerators, enumvalues, CTypesInt): ... + def get_errno(self): ... + def set_errno(self, value) -> None: ... + def string(self, b, maxlen: int = ...): ... + def buffer(self, bptr, size: int = ...) -> None: ... + def sizeof(self, cdata_or_BType): ... + def alignof(self, BType): ... + def newp(self, BType, source): ... + def cast(self, BType, source): ... + def callback(self, BType, source, error, onerror): ... + def gcp(self, cdata, destructor, size: int = ...): ... + typeof: Incomplete + def getcname(self, BType, replace_with): ... + def typeoffsetof(self, BType, fieldname, num: int = ...): ... + def rawaddressof(self, BTypePtr, cdata, offset: Incomplete | None = ...): ... + +class CTypesLibrary: + backend: Incomplete + cdll: Incomplete + def __init__(self, backend, cdll) -> None: ... + def load_function(self, BType, name): ... + def read_variable(self, BType, name): ... + def write_variable(self, BType, name, value) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cffi/cffi/cffi_opcode.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cffi/cffi/cffi_opcode.pyi new file mode 100644 index 000000000..364a0808d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/cffi/cffi/cffi_opcode.pyi @@ -0,0 +1,92 @@ +from _typeshed import Incomplete + +class CffiOp: + op: Incomplete + arg: Incomplete + def __init__(self, op, arg) -> None: ... + def as_c_expr(self): ... + def as_python_bytes(self): ... + +def format_four_bytes(num): ... + +OP_PRIMITIVE: int +OP_POINTER: int +OP_ARRAY: int +OP_OPEN_ARRAY: int +OP_STRUCT_UNION: int +OP_ENUM: int +OP_FUNCTION: int +OP_FUNCTION_END: int +OP_NOOP: int +OP_BITFIELD: int +OP_TYPENAME: int +OP_CPYTHON_BLTN_V: int +OP_CPYTHON_BLTN_N: int +OP_CPYTHON_BLTN_O: int +OP_CONSTANT: int +OP_CONSTANT_INT: int +OP_GLOBAL_VAR: int +OP_DLOPEN_FUNC: int +OP_DLOPEN_CONST: int +OP_GLOBAL_VAR_F: int +OP_EXTERN_PYTHON: int +PRIM_VOID: int +PRIM_BOOL: int +PRIM_CHAR: int +PRIM_SCHAR: int +PRIM_UCHAR: int +PRIM_SHORT: int +PRIM_USHORT: int +PRIM_INT: int +PRIM_UINT: int +PRIM_LONG: int +PRIM_ULONG: int +PRIM_LONGLONG: int +PRIM_ULONGLONG: int +PRIM_FLOAT: int +PRIM_DOUBLE: int +PRIM_LONGDOUBLE: int +PRIM_WCHAR: int +PRIM_INT8: int +PRIM_UINT8: int +PRIM_INT16: int +PRIM_UINT16: int +PRIM_INT32: int +PRIM_UINT32: int +PRIM_INT64: int +PRIM_UINT64: int +PRIM_INTPTR: int +PRIM_UINTPTR: int +PRIM_PTRDIFF: int +PRIM_SIZE: int +PRIM_SSIZE: int +PRIM_INT_LEAST8: int +PRIM_UINT_LEAST8: int +PRIM_INT_LEAST16: int +PRIM_UINT_LEAST16: int +PRIM_INT_LEAST32: int +PRIM_UINT_LEAST32: int +PRIM_INT_LEAST64: int +PRIM_UINT_LEAST64: int +PRIM_INT_FAST8: int +PRIM_UINT_FAST8: int +PRIM_INT_FAST16: int +PRIM_UINT_FAST16: int +PRIM_INT_FAST32: int +PRIM_UINT_FAST32: int +PRIM_INT_FAST64: int +PRIM_UINT_FAST64: int +PRIM_INTMAX: int +PRIM_UINTMAX: int +PRIM_FLOATCOMPLEX: int +PRIM_DOUBLECOMPLEX: int +PRIM_CHAR16: int +PRIM_CHAR32: int +PRIMITIVE_TO_INDEX: Incomplete +F_UNION: int +F_CHECK_FIELDS: int +F_PACKED: int +F_EXTERNAL: int +F_OPAQUE: int +G_FLAGS: Incomplete +CLASS_NAME: Incomplete diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cffi/cffi/commontypes.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cffi/cffi/commontypes.pyi new file mode 100644 index 000000000..fe9e35ee5 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/cffi/cffi/commontypes.pyi @@ -0,0 +1,6 @@ +from _typeshed import Incomplete + +COMMON_TYPES: Incomplete + +def resolve_common_type(parser, commontype): ... +def win_common_types(): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cffi/cffi/cparser.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cffi/cffi/cparser.pyi new file mode 100644 index 000000000..8fcab85b1 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/cffi/cffi/cparser.pyi @@ -0,0 +1,14 @@ +from _typeshed import Incomplete + +lock: Incomplete +CDEF_SOURCE_STRING: str + +class Parser: + def __init__(self) -> None: ... + def convert_pycparser_error(self, e, csource) -> None: ... + def parse( + self, csource, override: bool = ..., packed: bool = ..., pack: Incomplete | None = ..., dllexport: bool = ... + ) -> None: ... + def parse_type(self, cdecl): ... + def parse_type_and_quals(self, cdecl): ... + def include(self, other) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cffi/cffi/error.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cffi/cffi/error.pyi new file mode 100644 index 000000000..a71f17e5d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/cffi/cffi/error.pyi @@ -0,0 +1,14 @@ +class FFIError(Exception): + __module__: str + +class CDefError(Exception): + __module__: str + +class VerificationError(Exception): + __module__: str + +class VerificationMissing(Exception): + __module__: str + +class PkgConfigError(Exception): + __module__: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cffi/cffi/ffiplatform.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cffi/cffi/ffiplatform.pyi new file mode 100644 index 000000000..d96b7559b --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/cffi/cffi/ffiplatform.pyi @@ -0,0 +1,11 @@ +from _typeshed import Incomplete + +LIST_OF_FILE_NAMES: Incomplete + +def get_extension(srcfilename, modname, sources=..., **kwds): ... +def compile(tmpdir, ext, compiler_verbose: int = ..., debug: Incomplete | None = ...): ... +def maybe_relative_path(path): ... + +int_or_long = int + +def flatten(x): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cffi/cffi/lock.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cffi/cffi/lock.pyi new file mode 100644 index 000000000..fc8393af7 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/cffi/cffi/lock.pyi @@ -0,0 +1 @@ +from _thread import allocate_lock as allocate_lock diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cffi/cffi/model.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cffi/cffi/model.pyi new file mode 100644 index 000000000..cc09cdc53 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/cffi/cffi/model.pyi @@ -0,0 +1,162 @@ +from _typeshed import Incomplete +from collections.abc import Generator + +from .error import CDefError as CDefError, VerificationError as VerificationError, VerificationMissing as VerificationMissing +from .lock import allocate_lock as allocate_lock + +Q_CONST: int +Q_RESTRICT: int +Q_VOLATILE: int + +def qualify(quals, replace_with): ... + +class BaseTypeByIdentity: + is_array_type: bool + is_raw_function: bool + def get_c_name(self, replace_with: str = ..., context: str = ..., quals: int = ...): ... + def has_c_name(self): ... + def is_integer_type(self): ... + def get_cached_btype(self, ffi, finishlist, can_delay: bool = ...): ... + +class BaseType(BaseTypeByIdentity): + def __eq__(self, other): ... + def __ne__(self, other): ... + def __hash__(self) -> int: ... + +class VoidType(BaseType): + c_name_with_marker: str + def __init__(self) -> None: ... + def build_backend_type(self, ffi, finishlist): ... + +void_type: Incomplete + +class BasePrimitiveType(BaseType): + def is_complex_type(self): ... + +class PrimitiveType(BasePrimitiveType): + ALL_PRIMITIVE_TYPES: Incomplete + name: Incomplete + c_name_with_marker: Incomplete + def __init__(self, name) -> None: ... + def is_char_type(self): ... + def is_integer_type(self): ... + def is_float_type(self): ... + def is_complex_type(self): ... + def build_backend_type(self, ffi, finishlist): ... + +class UnknownIntegerType(BasePrimitiveType): + name: Incomplete + c_name_with_marker: Incomplete + def __init__(self, name) -> None: ... + def is_integer_type(self): ... + def build_backend_type(self, ffi, finishlist) -> None: ... + +class UnknownFloatType(BasePrimitiveType): + name: Incomplete + c_name_with_marker: Incomplete + def __init__(self, name) -> None: ... + def build_backend_type(self, ffi, finishlist) -> None: ... + +class BaseFunctionType(BaseType): + args: Incomplete + result: Incomplete + ellipsis: Incomplete + abi: Incomplete + c_name_with_marker: Incomplete + def __init__(self, args, result, ellipsis, abi: Incomplete | None = ...) -> None: ... + +class RawFunctionType(BaseFunctionType): + is_raw_function: bool + def build_backend_type(self, ffi, finishlist) -> None: ... + def as_function_pointer(self): ... + +class FunctionPtrType(BaseFunctionType): + def build_backend_type(self, ffi, finishlist): ... + def as_raw_function(self): ... + +class PointerType(BaseType): + totype: Incomplete + quals: Incomplete + c_name_with_marker: Incomplete + def __init__(self, totype, quals: int = ...) -> None: ... + def build_backend_type(self, ffi, finishlist): ... + +voidp_type: Incomplete + +def ConstPointerType(totype): ... + +const_voidp_type: Incomplete + +class NamedPointerType(PointerType): + name: Incomplete + c_name_with_marker: Incomplete + def __init__(self, totype, name, quals: int = ...) -> None: ... + +class ArrayType(BaseType): + is_array_type: bool + item: Incomplete + length: Incomplete + c_name_with_marker: Incomplete + def __init__(self, item, length) -> None: ... + def length_is_unknown(self): ... + def resolve_length(self, newlength): ... + def build_backend_type(self, ffi, finishlist): ... + +char_array_type: Incomplete + +class StructOrUnionOrEnum(BaseTypeByIdentity): + forcename: Incomplete + c_name_with_marker: Incomplete + def build_c_name_with_marker(self) -> None: ... + def force_the_name(self, forcename) -> None: ... + def get_official_name(self): ... + +class StructOrUnion(StructOrUnionOrEnum): + fixedlayout: Incomplete + completed: int + partial: bool + packed: int + name: Incomplete + fldnames: Incomplete + fldtypes: Incomplete + fldbitsize: Incomplete + fldquals: Incomplete + def __init__(self, name, fldnames, fldtypes, fldbitsize, fldquals: Incomplete | None = ...) -> None: ... + def anonymous_struct_fields(self) -> Generator[Incomplete, None, None]: ... + def enumfields(self, expand_anonymous_struct_union: bool = ...) -> Generator[Incomplete, None, None]: ... + def force_flatten(self) -> None: ... + def get_cached_btype(self, ffi, finishlist, can_delay: bool = ...): ... + def finish_backend_type(self, ffi, finishlist) -> None: ... + def check_not_partial(self) -> None: ... + def build_backend_type(self, ffi, finishlist): ... + +class StructType(StructOrUnion): + kind: str + +class UnionType(StructOrUnion): + kind: str + +class EnumType(StructOrUnionOrEnum): + kind: str + partial: bool + partial_resolved: bool + name: Incomplete + enumerators: Incomplete + enumvalues: Incomplete + baseinttype: Incomplete + def __init__(self, name, enumerators, enumvalues, baseinttype: Incomplete | None = ...) -> None: ... + forcename: Incomplete + def force_the_name(self, forcename) -> None: ... + def check_not_partial(self) -> None: ... + def build_backend_type(self, ffi, finishlist): ... + def build_baseinttype(self, ffi, finishlist): ... + +def unknown_type(name, structname: Incomplete | None = ...): ... +def unknown_ptr_type(name, structname: Incomplete | None = ...): ... + +global_lock: Incomplete + +def get_typecache(backend): ... +def global_cache(srctype, ffi, funcname, *args, **kwds): ... +def pointer_cache(ffi, BType): ... +def attach_exception_info(e, name) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cffi/cffi/pkgconfig.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cffi/cffi/pkgconfig.pyi new file mode 100644 index 000000000..bb53098f0 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/cffi/cffi/pkgconfig.pyi @@ -0,0 +1,3 @@ +def merge_flags(cfg1, cfg2): ... +def call(libname, flag, encoding=...): ... +def flags_from_pkgconfig(libs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cffi/cffi/recompiler.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cffi/cffi/recompiler.pyi new file mode 100644 index 000000000..ee17f6b16 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/cffi/cffi/recompiler.pyi @@ -0,0 +1,94 @@ +import io +from _typeshed import Incomplete +from typing_extensions import TypeAlias + +from .cffi_opcode import * + +VERSION_BASE: int +VERSION_EMBEDDED: int +VERSION_CHAR16CHAR32: int +USE_LIMITED_API: Incomplete + +class GlobalExpr: + name: Incomplete + address: Incomplete + type_op: Incomplete + size: Incomplete + check_value: Incomplete + def __init__(self, name, address, type_op, size: int = ..., check_value: int = ...) -> None: ... + def as_c_expr(self): ... + def as_python_expr(self): ... + +class FieldExpr: + name: Incomplete + field_offset: Incomplete + field_size: Incomplete + fbitsize: Incomplete + field_type_op: Incomplete + def __init__(self, name, field_offset, field_size, fbitsize, field_type_op) -> None: ... + def as_c_expr(self): ... + def as_python_expr(self) -> None: ... + def as_field_python_expr(self): ... + +class StructUnionExpr: + name: Incomplete + type_index: Incomplete + flags: Incomplete + size: Incomplete + alignment: Incomplete + comment: Incomplete + first_field_index: Incomplete + c_fields: Incomplete + def __init__(self, name, type_index, flags, size, alignment, comment, first_field_index, c_fields) -> None: ... + def as_c_expr(self): ... + def as_python_expr(self): ... + +class EnumExpr: + name: Incomplete + type_index: Incomplete + size: Incomplete + signed: Incomplete + allenums: Incomplete + def __init__(self, name, type_index, size, signed, allenums) -> None: ... + def as_c_expr(self): ... + def as_python_expr(self): ... + +class TypenameExpr: + name: Incomplete + type_index: Incomplete + def __init__(self, name, type_index) -> None: ... + def as_c_expr(self): ... + def as_python_expr(self): ... + +class Recompiler: + ffi: Incomplete + module_name: Incomplete + target_is_python: Incomplete + def __init__(self, ffi, module_name, target_is_python: bool = ...) -> None: ... + def needs_version(self, ver) -> None: ... + cffi_types: Incomplete + def collect_type_table(self): ... + ALL_STEPS: Incomplete + def collect_step_tables(self): ... + def write_source_to_f(self, f, preamble) -> None: ... + def write_c_source_to_f(self, f, preamble) -> None: ... + def write_py_source_to_f(self, f) -> None: ... + +NativeIO: TypeAlias = io.StringIO + +def make_c_source(ffi, module_name, preamble, target_c_file, verbose: bool = ...): ... +def make_py_source(ffi, module_name, target_py_file, verbose: bool = ...): ... +def recompile( + ffi, + module_name, + preamble, + tmpdir: str = ..., + call_c_compiler: bool = ..., + c_file: Incomplete | None = ..., + source_extension: str = ..., + extradir: Incomplete | None = ..., + compiler_verbose: int = ..., + target: Incomplete | None = ..., + debug: Incomplete | None = ..., + **kwds, +): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cffi/cffi/setuptools_ext.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cffi/cffi/setuptools_ext.pyi new file mode 100644 index 000000000..beb588589 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/cffi/cffi/setuptools_ext.pyi @@ -0,0 +1,6 @@ +basestring = str + +def error(msg) -> None: ... +def execfile(filename, glob) -> None: ... +def add_cffi_module(dist, mod_spec) -> None: ... +def cffi_modules(dist, attr, value) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cffi/cffi/vengine_cpy.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cffi/cffi/vengine_cpy.pyi new file mode 100644 index 000000000..dea9f16f8 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/cffi/cffi/vengine_cpy.pyi @@ -0,0 +1,13 @@ +from _typeshed import Incomplete + +class VCPythonEngine: + verifier: Incomplete + ffi: Incomplete + def __init__(self, verifier) -> None: ... + def patch_extension_kwds(self, kwds) -> None: ... + def find_module(self, module_name, path, so_suffixes): ... + def collect_types(self) -> None: ... + def write_source_to_f(self) -> None: ... + def load_library(self, flags: Incomplete | None = ...): ... + +cffimod_header: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cffi/cffi/vengine_gen.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cffi/cffi/vengine_gen.pyi new file mode 100644 index 000000000..d4477094c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/cffi/cffi/vengine_gen.pyi @@ -0,0 +1,14 @@ +from _typeshed import Incomplete + +class VGenericEngine: + verifier: Incomplete + ffi: Incomplete + export_symbols: Incomplete + def __init__(self, verifier) -> None: ... + def patch_extension_kwds(self, kwds) -> None: ... + def find_module(self, module_name, path, so_suffixes): ... + def collect_types(self) -> None: ... + def write_source_to_f(self) -> None: ... + def load_library(self, flags: int = ...): ... + +cffimod_header: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cffi/cffi/verifier.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cffi/cffi/verifier.pyi new file mode 100644 index 000000000..3b9e558ca --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/cffi/cffi/verifier.pyi @@ -0,0 +1,39 @@ +import io +from _typeshed import Incomplete +from typing_extensions import TypeAlias + +NativeIO: TypeAlias = io.StringIO + +class Verifier: + ffi: Incomplete + preamble: Incomplete + flags: Incomplete + kwds: Incomplete + tmpdir: Incomplete + sourcefilename: Incomplete + modulefilename: Incomplete + ext_package: Incomplete + def __init__( + self, + ffi, + preamble, + tmpdir: Incomplete | None = ..., + modulename: Incomplete | None = ..., + ext_package: Incomplete | None = ..., + tag: str = ..., + force_generic_engine: bool = ..., + source_extension: str = ..., + flags: Incomplete | None = ..., + relative_to: Incomplete | None = ..., + **kwds, + ) -> None: ... + def write_source(self, file: Incomplete | None = ...) -> None: ... + def compile_module(self) -> None: ... + def load_library(self): ... + def get_module_name(self): ... + def get_extension(self): ... + def generates_python_module(self): ... + def make_relative_to(self, kwds, relative_to): ... + +def set_tmpdir(dirname) -> None: ... +def cleanup_tmpdir(tmpdir: Incomplete | None = ..., keep_so: bool = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/chardet/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/chardet/METADATA.toml index c98db6304..a8d4f2a04 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/chardet/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/chardet/METADATA.toml @@ -1 +1,5 @@ version = "5.0.*" +obsolete_since = "5.1.0" # Released on 2022-12-01 + +[tool.stubtest] +ignore_missing_stub = true diff --git a/packages/pyright-internal/typeshed-fallback/stubs/chardet/chardet/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/chardet/chardet/__init__.pyi index f9537b616..0ab162451 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/chardet/chardet/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/chardet/chardet/__init__.pyi @@ -8,7 +8,8 @@ if sys.version_info >= (3, 8): else: from typing_extensions import TypedDict -class _LangModelType(TypedDict): +# unused in this module, but imported in multiple submodules +class _LangModelType(TypedDict): # noqa: Y049 char_to_order_map: tuple[int, ...] precedence_matrix: tuple[int, ...] typical_positive_ratio: float @@ -16,12 +17,5 @@ class _LangModelType(TypedDict): charset_name: str language: str -class _SMModelType(TypedDict): - class_table: tuple[int, ...] - class_factor: int - state_table: tuple[int, ...] - char_len_table: tuple[int, ...] - name: str - def detect(byte_str: bytes | bytearray) -> _FinalResultType: ... def detect_all(byte_str: bytes | bytearray, ignore_threshold: bool = ...) -> list[_IntermediateResultType]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/chevron/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/chevron/METADATA.toml index c562b6633..48faa3822 100755 --- a/packages/pyright-internal/typeshed-fallback/stubs/chevron/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/chevron/METADATA.toml @@ -1 +1,3 @@ version = "0.14.*" + +[tool.stubtest] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/chevron/chevron/main.pyi b/packages/pyright-internal/typeshed-fallback/stubs/chevron/chevron/main.pyi index 99a589d52..a9e2f57e9 100755 --- a/packages/pyright-internal/typeshed-fallback/stubs/chevron/chevron/main.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/chevron/chevron/main.pyi @@ -1,8 +1,5 @@ -from _typeshed import StrOrBytesPath +from _typeshed import FileDescriptorOrPath from typing import Any -from typing_extensions import TypeAlias -_OpenFile: TypeAlias = StrOrBytesPath | int - -def main(template: _OpenFile, data: _OpenFile | None = ..., **kwargs: Any) -> str: ... +def main(template: FileDescriptorOrPath, data: FileDescriptorOrPath | None = ..., **kwargs: Any) -> str: ... def cli_main() -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/chevron/chevron/renderer.pyi b/packages/pyright-internal/typeshed-fallback/stubs/chevron/chevron/renderer.pyi index fb2df7404..1ae8065a4 100755 --- a/packages/pyright-internal/typeshed-fallback/stubs/chevron/chevron/renderer.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/chevron/chevron/renderer.pyi @@ -1,9 +1,12 @@ from _typeshed import StrPath, SupportsRead from collections.abc import MutableSequence, Sequence from typing import Any +from typing_extensions import Literal g_token_cache: dict[str, list[tuple[str, str]]] # undocumented +python3: Literal[True] +def unicode(x: str, y: str) -> str: ... def render( template: SupportsRead[str] | str | Sequence[tuple[str, str]] = ..., data: dict[str, Any] = ..., diff --git a/packages/pyright-internal/typeshed-fallback/stubs/click-spinner/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/click-spinner/METADATA.toml index a8dd8c68c..37dc09b10 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/click-spinner/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/click-spinner/METADATA.toml @@ -1,4 +1 @@ version = "0.1.*" - -[tool.stubtest] -ignore_missing_stub = false diff --git a/packages/pyright-internal/typeshed-fallback/stubs/click-spinner/click_spinner/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/click-spinner/click_spinner/__init__.pyi index 444a4c650..8b3a64fcb 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/click-spinner/click_spinner/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/click-spinner/click_spinner/__init__.pyi @@ -1,9 +1,8 @@ import threading -from _typeshed import Self from collections.abc import Iterator from types import TracebackType from typing import Protocol -from typing_extensions import Literal +from typing_extensions import Literal, Self __version__: str @@ -20,13 +19,13 @@ class Spinner: stream: _Stream stop_running: threading.Event | None spin_thread: threading.Thread | None - def __init__(self, beep: bool, disable: bool, force: bool, stream: _Stream) -> None: ... + def __init__(self, beep: bool = ..., disable: bool = ..., force: bool = ..., stream: _Stream = ...) -> None: ... def start(self) -> None: ... def stop(self) -> None: ... def init_spin(self) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None ) -> Literal[False]: ... -def spinner(beep: bool, disable: bool, force: bool, stream: _Stream) -> Spinner: ... +def spinner(beep: bool = ..., disable: bool = ..., force: bool = ..., stream: _Stream = ...) -> Spinner: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/colorama/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/colorama/METADATA.toml index 582104d3a..34da26594 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/colorama/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/colorama/METADATA.toml @@ -1 +1,4 @@ version = "0.4.*" + +[tool.stubtest] +platforms = ["linux", "win32"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/colorama/colorama/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/colorama/colorama/__init__.pyi index 1fc778d8a..e6d15ec71 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/colorama/colorama/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/colorama/colorama/__init__.pyi @@ -1,3 +1,9 @@ from .ansi import Back as Back, Cursor as Cursor, Fore as Fore, Style as Style from .ansitowin32 import AnsiToWin32 as AnsiToWin32 -from .initialise import colorama_text as colorama_text, deinit as deinit, init as init, reinit as reinit +from .initialise import ( + colorama_text as colorama_text, + deinit as deinit, + init as init, + just_fix_windows_console as just_fix_windows_console, + reinit as reinit, +) diff --git a/packages/pyright-internal/typeshed-fallback/stubs/colorama/colorama/ansitowin32.pyi b/packages/pyright-internal/typeshed-fallback/stubs/colorama/colorama/ansitowin32.pyi index 19a854c05..f406f2e20 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/colorama/colorama/ansitowin32.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/colorama/colorama/ansitowin32.pyi @@ -49,3 +49,4 @@ class AnsiToWin32: def extract_params(self, command: str, paramstring: str) -> tuple[int, ...]: ... def call_win32(self, command: str, params: Sequence[int]) -> None: ... def convert_osc(self, text: str) -> str: ... + def flush(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/colorama/colorama/initialise.pyi b/packages/pyright-internal/typeshed-fallback/stubs/colorama/colorama/initialise.pyi index f0c12f2de..25107f16a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/colorama/colorama/initialise.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/colorama/colorama/initialise.pyi @@ -1,13 +1,16 @@ from contextlib import AbstractContextManager -from typing import Any, TextIO +from typing import Any, TextIO, TypeVar from .ansitowin32 import StreamWrapper +_TextIOT = TypeVar("_TextIOT", bound=TextIO) + orig_stdout: TextIO | None orig_stderr: TextIO | None wrapped_stdout: TextIO | StreamWrapper wrapped_stderr: TextIO | StreamWrapper atexit_done: bool +fixed_windows_console: bool def reset_all() -> None: ... def init(autoreset: bool = ..., convert: bool | None = ..., strip: bool | None = ..., wrap: bool = ...) -> None: ... @@ -15,5 +18,6 @@ def deinit() -> None: ... def colorama_text(*args: Any, **kwargs: Any) -> AbstractContextManager[None]: ... def reinit() -> None: ... def wrap_stream( - stream: TextIO, convert: bool | None, strip: bool | None, autoreset: bool, wrap: bool -) -> TextIO | StreamWrapper: ... + stream: _TextIOT, convert: bool | None, strip: bool | None, autoreset: bool, wrap: bool +) -> _TextIOT | StreamWrapper: ... +def just_fix_windows_console() -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/colorama/colorama/win32.pyi b/packages/pyright-internal/typeshed-fallback/stubs/colorama/colorama/win32.pyi index 713aaf273..38825fa70 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/colorama/colorama/win32.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/colorama/colorama/win32.pyi @@ -4,6 +4,7 @@ from typing_extensions import Literal STDOUT: Literal[-11] STDERR: Literal[-12] +ENABLE_VIRTUAL_TERMINAL_PROCESSING: int if sys.platform == "win32": from ctypes import LibraryLoader, Structure, WinDLL, wintypes @@ -24,6 +25,8 @@ if sys.platform == "win32": def FillConsoleOutputCharacter(stream_id: int, char: str, length: int, start: COORD) -> int: ... def FillConsoleOutputAttribute(stream_id: int, attr: int, length: int, start: COORD) -> wintypes.BOOL: ... def SetConsoleTitle(title: str) -> wintypes.BOOL: ... + def GetConsoleMode(handle: int) -> int: ... + def SetConsoleMode(handle: int, mode: int) -> None: ... else: windll: None diff --git a/packages/pyright-internal/typeshed-fallback/stubs/colorama/colorama/winterm.pyi b/packages/pyright-internal/typeshed-fallback/stubs/colorama/colorama/winterm.pyi index af1dd3db1..0de2c6d51 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/colorama/colorama/winterm.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/colorama/colorama/winterm.pyi @@ -1,7 +1,6 @@ import sys if sys.platform == "win32": - from . import win32 class WinColor: @@ -34,3 +33,5 @@ if sys.platform == "win32": def erase_screen(self, mode: int = ..., on_stderr: bool = ...) -> None: ... def erase_line(self, mode: int = ..., on_stderr: bool = ...) -> None: ... def set_title(self, title: str) -> None: ... + +def enable_vt_processing(fd: int) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/commonmark/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/commonmark/METADATA.toml index 51e869b47..31ce4482b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/commonmark/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/commonmark/METADATA.toml @@ -1 +1,4 @@ version = "0.9.*" + +[tool.stubtest] +ignore_missing_stub = true diff --git a/packages/pyright-internal/typeshed-fallback/stubs/commonmark/commonmark/blocks.pyi b/packages/pyright-internal/typeshed-fallback/stubs/commonmark/commonmark/blocks.pyi index 25504c4b9..7a5bbdc08 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/commonmark/commonmark/blocks.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/commonmark/commonmark/blocks.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any CODE_INDENT: int @@ -24,111 +25,111 @@ def lists_match(list_data, item_data): ... class Block: accepts_lines: Any @staticmethod - def continue_(parser: Any | None = ..., container: Any | None = ...) -> None: ... + def continue_(parser: Incomplete | None = ..., container: Incomplete | None = ...) -> None: ... @staticmethod - def finalize(parser: Any | None = ..., block: Any | None = ...) -> None: ... + def finalize(parser: Incomplete | None = ..., block: Incomplete | None = ...) -> None: ... @staticmethod def can_contain(t) -> None: ... class Document(Block): accepts_lines: bool @staticmethod - def continue_(parser: Any | None = ..., container: Any | None = ...): ... + def continue_(parser: Incomplete | None = ..., container: Incomplete | None = ...): ... @staticmethod - def finalize(parser: Any | None = ..., block: Any | None = ...) -> None: ... + def finalize(parser: Incomplete | None = ..., block: Incomplete | None = ...) -> None: ... @staticmethod def can_contain(t): ... class List(Block): accepts_lines: bool @staticmethod - def continue_(parser: Any | None = ..., container: Any | None = ...): ... + def continue_(parser: Incomplete | None = ..., container: Incomplete | None = ...): ... @staticmethod - def finalize(parser: Any | None = ..., block: Any | None = ...) -> None: ... + def finalize(parser: Incomplete | None = ..., block: Incomplete | None = ...) -> None: ... @staticmethod def can_contain(t): ... class BlockQuote(Block): accepts_lines: bool @staticmethod - def continue_(parser: Any | None = ..., container: Any | None = ...): ... + def continue_(parser: Incomplete | None = ..., container: Incomplete | None = ...): ... @staticmethod - def finalize(parser: Any | None = ..., block: Any | None = ...) -> None: ... + def finalize(parser: Incomplete | None = ..., block: Incomplete | None = ...) -> None: ... @staticmethod def can_contain(t): ... class Item(Block): accepts_lines: bool @staticmethod - def continue_(parser: Any | None = ..., container: Any | None = ...): ... + def continue_(parser: Incomplete | None = ..., container: Incomplete | None = ...): ... @staticmethod - def finalize(parser: Any | None = ..., block: Any | None = ...) -> None: ... + def finalize(parser: Incomplete | None = ..., block: Incomplete | None = ...) -> None: ... @staticmethod def can_contain(t): ... class Heading(Block): accepts_lines: bool @staticmethod - def continue_(parser: Any | None = ..., container: Any | None = ...): ... + def continue_(parser: Incomplete | None = ..., container: Incomplete | None = ...): ... @staticmethod - def finalize(parser: Any | None = ..., block: Any | None = ...) -> None: ... + def finalize(parser: Incomplete | None = ..., block: Incomplete | None = ...) -> None: ... @staticmethod def can_contain(t): ... class ThematicBreak(Block): accepts_lines: bool @staticmethod - def continue_(parser: Any | None = ..., container: Any | None = ...): ... + def continue_(parser: Incomplete | None = ..., container: Incomplete | None = ...): ... @staticmethod - def finalize(parser: Any | None = ..., block: Any | None = ...) -> None: ... + def finalize(parser: Incomplete | None = ..., block: Incomplete | None = ...) -> None: ... @staticmethod def can_contain(t): ... class CodeBlock(Block): accepts_lines: bool @staticmethod - def continue_(parser: Any | None = ..., container: Any | None = ...): ... + def continue_(parser: Incomplete | None = ..., container: Incomplete | None = ...): ... @staticmethod - def finalize(parser: Any | None = ..., block: Any | None = ...) -> None: ... + def finalize(parser: Incomplete | None = ..., block: Incomplete | None = ...) -> None: ... @staticmethod def can_contain(t): ... class HtmlBlock(Block): accepts_lines: bool @staticmethod - def continue_(parser: Any | None = ..., container: Any | None = ...): ... + def continue_(parser: Incomplete | None = ..., container: Incomplete | None = ...): ... @staticmethod - def finalize(parser: Any | None = ..., block: Any | None = ...) -> None: ... + def finalize(parser: Incomplete | None = ..., block: Incomplete | None = ...) -> None: ... @staticmethod def can_contain(t): ... class Paragraph(Block): accepts_lines: bool @staticmethod - def continue_(parser: Any | None = ..., container: Any | None = ...): ... + def continue_(parser: Incomplete | None = ..., container: Incomplete | None = ...): ... @staticmethod - def finalize(parser: Any | None = ..., block: Any | None = ...) -> None: ... + def finalize(parser: Incomplete | None = ..., block: Incomplete | None = ...) -> None: ... @staticmethod def can_contain(t): ... class BlockStarts: METHODS: Any @staticmethod - def block_quote(parser, container: Any | None = ...): ... + def block_quote(parser, container: Incomplete | None = ...): ... @staticmethod - def atx_heading(parser, container: Any | None = ...): ... + def atx_heading(parser, container: Incomplete | None = ...): ... @staticmethod - def fenced_code_block(parser, container: Any | None = ...): ... + def fenced_code_block(parser, container: Incomplete | None = ...): ... @staticmethod - def html_block(parser, container: Any | None = ...): ... + def html_block(parser, container: Incomplete | None = ...): ... @staticmethod - def setext_heading(parser, container: Any | None = ...): ... + def setext_heading(parser, container: Incomplete | None = ...): ... @staticmethod - def thematic_break(parser, container: Any | None = ...): ... + def thematic_break(parser, container: Incomplete | None = ...): ... @staticmethod - def list_item(parser, container: Any | None = ...): ... + def list_item(parser, container: Incomplete | None = ...): ... @staticmethod - def indented_code_block(parser, container: Any | None = ...): ... + def indented_code_block(parser, container: Incomplete | None = ...): ... class Parser: doc: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/commonmark/commonmark/render/html.pyi b/packages/pyright-internal/typeshed-fallback/stubs/commonmark/commonmark/render/html.pyi index b98864128..02637833a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/commonmark/commonmark/render/html.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/commonmark/commonmark/render/html.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from commonmark.render.renderer import Renderer @@ -13,10 +14,10 @@ class HtmlRenderer(Renderer): options: Any def __init__(self, options=...) -> None: ... def escape(self, text): ... - def tag(self, name, attrs: Any | None = ..., selfclosing: Any | None = ...) -> None: ... - def text(self, node, entering: Any | None = ...) -> None: ... - def softbreak(self, node: Any | None = ..., entering: Any | None = ...) -> None: ... - def linebreak(self, node: Any | None = ..., entering: Any | None = ...) -> None: ... + def tag(self, name, attrs: Incomplete | None = ..., selfclosing: Incomplete | None = ...) -> None: ... + def text(self, node, entering: Incomplete | None = ...) -> None: ... + def softbreak(self, node: Incomplete | None = ..., entering: Incomplete | None = ...) -> None: ... + def linebreak(self, node: Incomplete | None = ..., entering: Incomplete | None = ...) -> None: ... def link(self, node, entering) -> None: ... def image(self, node, entering) -> None: ... def emph(self, node, entering) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/console-menu/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/console-menu/METADATA.toml new file mode 100644 index 000000000..29511ee7d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/console-menu/METADATA.toml @@ -0,0 +1 @@ +version = "0.8.*" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/__init__.pyi new file mode 100644 index 000000000..8bc6c6cd7 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/__init__.pyi @@ -0,0 +1,6 @@ +from . import items as items +from .console_menu import ConsoleMenu as ConsoleMenu, Screen as Screen, clear_terminal as clear_terminal +from .menu_formatter import MenuFormatBuilder as MenuFormatBuilder +from .multiselect_menu import MultiSelectMenu as MultiSelectMenu +from .prompt_utils import PromptUtils as PromptUtils +from .selection_menu import SelectionMenu as SelectionMenu diff --git a/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/console_menu.pyi b/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/console_menu.pyi new file mode 100644 index 000000000..a39ec1364 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/console_menu.pyi @@ -0,0 +1,97 @@ +from collections.abc import Callable + +from consolemenu.menu_formatter import MenuFormatBuilder as MenuFormatBuilder +from consolemenu.screen import Screen as Screen + +class ConsoleMenu: + currently_active_menu: ConsoleMenu | None + screen: Screen + clear_screen_before_render: bool + formatter: MenuFormatBuilder + title: str | Callable[[], str] | None + subtitle: str | Callable[[], str] | None + prologue_text: str | Callable[[], str] | None + epilogue_text: str | Callable[[], str] | None + highlight: None + normal: None + show_exit_option: bool + items: list[MenuItem] + parent: ConsoleMenu | None + exit_item: ExitItem + current_option: int + selected_option: int + returned_value: object + should_exit: bool + previous_active_menu: ConsoleMenu | None + def __init__( + self, + title: str | Callable[[], str] | None = ..., + subtitle: str | Callable[[], str] | None = ..., + screen: Screen | None = ..., + formatter: MenuFormatBuilder | None = ..., + prologue_text: str | Callable[[], str] | None = ..., + epilogue_text: str | Callable[[], str] | None = ..., + clear_screen: bool = ..., + show_exit_option: bool = ..., + exit_option_text: str = ..., + exit_menu_char: str | None = None, + ) -> None: ... + @property + def current_item(self) -> MenuItem | None: ... + @property + def selected_item(self) -> MenuItem | None: ... + def append_item(self, item: MenuItem) -> None: ... + def remove_item(self, item: MenuItem) -> bool: ... + def add_exit(self) -> bool: ... + def remove_exit(self) -> bool: ... + def is_selected_item_exit(self) -> bool: ... + def start(self, show_exit_option: bool | None = ...) -> None: ... + def show(self, show_exit_option: bool | None = ...) -> None: ... + def draw(self) -> None: ... + def is_running(self) -> bool: ... + def wait_for_start(self, timeout: float | None = ...) -> bool: ... + def is_alive(self) -> bool: ... + def pause(self) -> None: ... + def resume(self) -> None: ... + def join(self, timeout: float | None = ...) -> None: ... + def get_input(self) -> int: ... + def process_user_input(self) -> int | None: ... + def go_to(self, option: int) -> None: ... + def go_down(self) -> None: ... + def go_up(self) -> None: ... + def select(self) -> None: ... + def exit(self) -> None: ... + def clear_screen(self) -> None: ... + def get_title(self) -> str: ... + def get_subtitle(self) -> str: ... + def get_prologue_text(self) -> str: ... + def get_epilogue_text(self) -> str: ... + +class MenuItem: + text: str + menu: ConsoleMenu | None + should_exit: bool + index_item_separator: str + menu_char: str | None + def __init__( + self, + text: str | Callable[[], str], + menu: ConsoleMenu | None = None, + should_exit: bool = False, + menu_char: str | None = None, + ) -> None: ... + def show(self, index: int) -> str: ... + def set_up(self) -> None: ... + def action(self) -> None: ... + def clean_up(self) -> None: ... + def get_return(self) -> object: ... + def __eq__(self, o: MenuItem) -> bool: ... # type: ignore[override] + def get_text(self) -> str: ... + +class ExitItem(MenuItem): + def __init__( + self, text: str | Callable[[], str] = "Exit", menu: ConsoleMenu | None = None, menu_char: str | None = None + ) -> None: ... + def show(self, index: int, available_width: None = ...) -> str: ... + +def clear_terminal() -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/format/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/format/__init__.pyi new file mode 100644 index 000000000..f43b6c563 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/format/__init__.pyi @@ -0,0 +1,14 @@ +from .menu_borders import ( + AsciiBorderStyle as AsciiBorderStyle, + DoubleLineBorderStyle as DoubleLineBorderStyle, + DoubleLineOuterLightInnerBorderStyle as DoubleLineOuterLightInnerBorderStyle, + HeavyBorderStyle as HeavyBorderStyle, + HeavyOuterLightInnerBorderStyle as HeavyOuterLightInnerBorderStyle, + LightBorderStyle as LightBorderStyle, + MenuBorderStyle as MenuBorderStyle, + MenuBorderStyleFactory as MenuBorderStyleFactory, + MenuBorderStyleType as MenuBorderStyleType, +) +from .menu_margins import MenuMargins as MenuMargins +from .menu_padding import MenuPadding as MenuPadding +from .menu_style import MenuStyle as MenuStyle diff --git a/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/format/menu_borders.pyi b/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/format/menu_borders.pyi new file mode 100644 index 000000000..9710b4abe --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/format/menu_borders.pyi @@ -0,0 +1,194 @@ +import logging + +class MenuBorderStyle: + @property + def bottom_left_corner(self) -> str: ... + @property + def bottom_right_corner(self) -> str: ... + @property + def inner_horizontal(self) -> str: ... + @property + def inner_vertical(self) -> str: ... + @property + def intersection(self) -> str: ... + @property + def outer_horizontal(self) -> str: ... + @property + def outer_horizontal_inner_down(self) -> str: ... + @property + def outer_horizontal_inner_up(self) -> str: ... + @property + def outer_vertical(self) -> str: ... + @property + def outer_vertical_inner_left(self) -> str: ... + @property + def outer_vertical_inner_right(self) -> str: ... + @property + def top_left_corner(self) -> str: ... + @property + def top_right_corner(self) -> str: ... + +class AsciiBorderStyle(MenuBorderStyle): + @property + def bottom_left_corner(self) -> str: ... + @property + def bottom_right_corner(self) -> str: ... + @property + def inner_horizontal(self) -> str: ... + @property + def inner_vertical(self) -> str: ... + @property + def intersection(self) -> str: ... + @property + def outer_horizontal(self) -> str: ... + @property + def outer_horizontal_inner_down(self) -> str: ... + @property + def outer_horizontal_inner_up(self) -> str: ... + @property + def outer_vertical(self) -> str: ... + @property + def outer_vertical_inner_left(self) -> str: ... + @property + def outer_vertical_inner_right(self) -> str: ... + @property + def top_left_corner(self) -> str: ... + @property + def top_right_corner(self) -> str: ... + +class LightBorderStyle(MenuBorderStyle): + @property + def bottom_left_corner(self) -> str: ... + @property + def bottom_right_corner(self) -> str: ... + @property + def inner_horizontal(self) -> str: ... + @property + def inner_vertical(self) -> str: ... + @property + def intersection(self) -> str: ... + @property + def outer_horizontal(self) -> str: ... + @property + def outer_horizontal_inner_down(self) -> str: ... + @property + def outer_horizontal_inner_up(self) -> str: ... + @property + def outer_vertical(self) -> str: ... + @property + def outer_vertical_inner_left(self) -> str: ... + @property + def outer_vertical_inner_right(self) -> str: ... + @property + def top_left_corner(self) -> str: ... + @property + def top_right_corner(self) -> str: ... + +class HeavyBorderStyle(MenuBorderStyle): + @property + def bottom_left_corner(self) -> str: ... + @property + def bottom_right_corner(self) -> str: ... + @property + def inner_horizontal(self) -> str: ... + @property + def inner_vertical(self) -> str: ... + @property + def intersection(self) -> str: ... + @property + def outer_horizontal(self) -> str: ... + @property + def outer_horizontal_inner_down(self) -> str: ... + @property + def outer_horizontal_inner_up(self) -> str: ... + @property + def outer_vertical(self) -> str: ... + @property + def outer_vertical_inner_left(self) -> str: ... + @property + def outer_vertical_inner_right(self) -> str: ... + @property + def top_left_corner(self) -> str: ... + @property + def top_right_corner(self) -> str: ... + +class HeavyOuterLightInnerBorderStyle(HeavyBorderStyle): + @property + def inner_horizontal(self) -> str: ... + @property + def inner_vertical(self) -> str: ... + @property + def intersection(self) -> str: ... + @property + def outer_horizontal_inner_down(self) -> str: ... + @property + def outer_horizontal_inner_up(self) -> str: ... + @property + def outer_vertical_inner_left(self) -> str: ... + @property + def outer_vertical_inner_right(self) -> str: ... + +class DoubleLineBorderStyle(MenuBorderStyle): + @property + def bottom_left_corner(self) -> str: ... + @property + def bottom_right_corner(self) -> str: ... + @property + def inner_horizontal(self) -> str: ... + @property + def inner_vertical(self) -> str: ... + @property + def intersection(self) -> str: ... + @property + def outer_horizontal(self) -> str: ... + @property + def outer_horizontal_inner_down(self) -> str: ... + @property + def outer_horizontal_inner_up(self) -> str: ... + @property + def outer_vertical(self) -> str: ... + @property + def outer_vertical_inner_left(self) -> str: ... + @property + def outer_vertical_inner_right(self) -> str: ... + @property + def top_left_corner(self) -> str: ... + @property + def top_right_corner(self) -> str: ... + +class DoubleLineOuterLightInnerBorderStyle(DoubleLineBorderStyle): + @property + def inner_horizontal(self) -> str: ... + @property + def inner_vertical(self) -> str: ... + @property + def intersection(self) -> str: ... + @property + def outer_horizontal_inner_down(self) -> str: ... + @property + def outer_horizontal_inner_up(self) -> str: ... + @property + def outer_vertical_inner_left(self) -> str: ... + @property + def outer_vertical_inner_right(self) -> str: ... + +class MenuBorderStyleType: + ASCII_BORDER: int + LIGHT_BORDER: int + HEAVY_BORDER: int + DOUBLE_LINE_BORDER: int + HEAVY_OUTER_LIGHT_INNER_BORDER: int + DOUBLE_LINE_OUTER_LIGHT_INNER_BORDER: int + +class MenuBorderStyleFactory: + logger: logging.Logger + def __init__(self) -> None: ... + def create_border(self, border_style_type: MenuBorderStyleType) -> MenuBorderStyle: ... + def create_ascii_border(self) -> AsciiBorderStyle: ... + def create_light_border(self) -> LightBorderStyle: ... + def create_heavy_border(self) -> HeavyBorderStyle: ... + def create_heavy_outer_light_inner_border(self) -> HeavyOuterLightInnerBorderStyle: ... + def create_doubleline_border(self) -> DoubleLineBorderStyle: ... + def create_doubleline_outer_light_inner_border(self) -> DoubleLineOuterLightInnerBorderStyle: ... + @staticmethod + def is_win_python35_or_earlier() -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/format/menu_margins.pyi b/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/format/menu_margins.pyi new file mode 100644 index 000000000..f37b33386 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/format/menu_margins.pyi @@ -0,0 +1,18 @@ +class MenuMargins: + def __init__(self, top: int = ..., left: int = ..., bottom: int = ..., right: int = ...) -> None: ... + @property + def left(self) -> int: ... + @left.setter + def left(self, left: int) -> None: ... + @property + def right(self) -> int: ... + @right.setter + def right(self, right: int) -> None: ... + @property + def top(self) -> int: ... + @top.setter + def top(self, top: int) -> None: ... + @property + def bottom(self) -> int: ... + @bottom.setter + def bottom(self, bottom: int) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/format/menu_padding.pyi b/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/format/menu_padding.pyi new file mode 100644 index 000000000..46855b29d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/format/menu_padding.pyi @@ -0,0 +1,18 @@ +class MenuPadding: + def __init__(self, top: int = ..., left: int = ..., bottom: int = ..., right: int = ...) -> None: ... + @property + def left(self) -> int: ... + @left.setter + def left(self, left: int) -> None: ... + @property + def right(self) -> int: ... + @right.setter + def right(self, right: int) -> None: ... + @property + def top(self) -> int: ... + @top.setter + def top(self, top: int) -> None: ... + @property + def bottom(self) -> int: ... + @bottom.setter + def bottom(self, bottom: int) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/format/menu_style.pyi b/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/format/menu_style.pyi new file mode 100644 index 000000000..e7e3c11c1 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/format/menu_style.pyi @@ -0,0 +1,29 @@ +from consolemenu.format.menu_borders import MenuBorderStyle as MenuBorderStyle, MenuBorderStyleFactory as MenuBorderStyleFactory +from consolemenu.format.menu_margins import MenuMargins as MenuMargins +from consolemenu.format.menu_padding import MenuPadding as MenuPadding + +class MenuStyle: + def __init__( + self, + margins: MenuMargins | None = ..., + padding: MenuPadding | None = ..., + border_style: MenuBorderStyle | None = ..., + border_style_type: int | None = ..., + border_style_factory: MenuBorderStyleFactory | None = ..., + ) -> None: ... + @property + def margins(self) -> MenuMargins: ... + @margins.setter + def margins(self, margins: MenuMargins) -> None: ... + @property + def padding(self) -> MenuPadding: ... + @padding.setter + def padding(self, padding: MenuPadding) -> None: ... + @property + def border_style(self) -> MenuBorderStyle: ... + @border_style.setter + def border_style(self, border_style: MenuBorderStyle) -> None: ... + @property + def border_style_factory(self) -> MenuBorderStyleFactory: ... + @border_style_factory.setter + def border_style_factory(self, border_style_factory: MenuBorderStyleFactory) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/items/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/items/__init__.pyi new file mode 100644 index 000000000..570ff3f5e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/items/__init__.pyi @@ -0,0 +1,6 @@ +from ..console_menu import ExitItem as ExitItem, MenuItem as MenuItem +from .command_item import CommandItem as CommandItem +from .external_item import ExternalItem as ExternalItem +from .function_item import FunctionItem as FunctionItem +from .selection_item import SelectionItem as SelectionItem +from .submenu_item import SubmenuItem as SubmenuItem diff --git a/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/items/command_item.pyi b/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/items/command_item.pyi new file mode 100644 index 000000000..1df604797 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/items/command_item.pyi @@ -0,0 +1,18 @@ +from consolemenu.console_menu import ConsoleMenu +from consolemenu.items import ExternalItem as ExternalItem + +class CommandItem(ExternalItem): + command: str + arguments: list[str] + exit_status: int | None + def __init__( + self, + text: str, + command: str, + arguments: list[str] | None = None, + menu: ConsoleMenu | None = None, + should_exit: bool = False, + menu_char: str | None = None, + ) -> None: ... + def action(self) -> None: ... + def get_return(self) -> int: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/items/external_item.pyi b/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/items/external_item.pyi new file mode 100644 index 000000000..33cf83a8e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/items/external_item.pyi @@ -0,0 +1,5 @@ +from consolemenu.items import MenuItem as MenuItem + +class ExternalItem(MenuItem): + def set_up(self) -> None: ... + def clean_up(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/items/function_item.pyi b/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/items/function_item.pyi new file mode 100644 index 000000000..937932613 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/items/function_item.pyi @@ -0,0 +1,25 @@ +from _typeshed import Incomplete +from collections.abc import Callable, Mapping, Sequence +from typing import Any + +from consolemenu.console_menu import ConsoleMenu +from consolemenu.items import ExternalItem as ExternalItem + +class FunctionItem(ExternalItem): + function: Callable[..., Any] + args: Sequence[Any] + kwargs: Mapping[str, Any] + return_value: Incomplete | None + def __init__( + self, + text: str, + function: Callable[..., Any], + args: Sequence[Any] | None = ..., + kwargs: Mapping[str, Any] | None = ..., + menu: ConsoleMenu | None = ..., + should_exit: bool = ..., + menu_char: str | None = None, + ) -> None: ... + def action(self) -> None: ... + def clean_up(self) -> None: ... + def get_return(self) -> Any | None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/items/selection_item.pyi b/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/items/selection_item.pyi new file mode 100644 index 000000000..ce37a82bb --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/items/selection_item.pyi @@ -0,0 +1,11 @@ +from collections.abc import Callable + +from consolemenu.console_menu import ConsoleMenu +from consolemenu.items import MenuItem as MenuItem + +class SelectionItem(MenuItem): + index: int + def __init__( + self, text: str | Callable[[], str], index: int, menu: ConsoleMenu | None = None, menu_char: str | None = None + ) -> None: ... + def get_return(self) -> int: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/items/submenu_item.pyi b/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/items/submenu_item.pyi new file mode 100644 index 000000000..9cda42875 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/items/submenu_item.pyi @@ -0,0 +1,22 @@ +from collections.abc import Callable + +from consolemenu.console_menu import ConsoleMenu +from consolemenu.items import MenuItem as MenuItem + +class SubmenuItem(MenuItem): + submenu: ConsoleMenu + def __init__( + self, + text: str | Callable[[], str], + submenu: ConsoleMenu, + menu: ConsoleMenu | None = None, + should_exit: bool = False, + menu_char: str | None = None, + ) -> None: ... + menu: ConsoleMenu + def set_menu(self, menu: ConsoleMenu) -> None: ... + def set_up(self) -> None: ... + def action(self) -> None: ... + def clean_up(self) -> None: ... + def get_return(self) -> object: ... + def get_submenu(self) -> ConsoleMenu: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/menu_component.pyi b/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/menu_component.pyi new file mode 100644 index 000000000..651483650 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/menu_component.pyi @@ -0,0 +1,99 @@ +from collections.abc import Generator + +from consolemenu.console_menu import MenuItem +from consolemenu.format import MenuBorderStyle, MenuMargins, MenuPadding, MenuStyle as MenuStyle + +def ansilen(s: str) -> int: ... + +class Dimension: + width: int + height: int + def __init__(self, width: int = ..., height: int = ..., dimension: Dimension | None = ...) -> None: ... + +class MenuComponent: + def __init__(self, menu_style: MenuStyle, max_dimension: Dimension | None = ...) -> None: ... + @property + def max_dimension(self) -> Dimension: ... + @property + def style(self) -> MenuStyle: ... + @property + def margins(self) -> MenuMargins: ... + @property + def padding(self) -> MenuPadding: ... + @property + def border_style(self) -> MenuBorderStyle: ... + def calculate_border_width(self) -> int: ... + def calculate_content_width(self) -> int: ... + def generate(self) -> Generator[str, None, None]: ... + def inner_horizontals(self) -> str: ... + def inner_horizontal_border(self) -> str: ... + def outer_horizontals(self) -> str: ... + def outer_horizontal_border_bottom(self) -> str: ... + def outer_horizontal_border_top(self) -> str: ... + def row(self, content: str = ..., align: str = ..., indent_len: int = ...) -> str: ... + +class MenuHeader(MenuComponent): + title: str + title_align: str + subtitle: str + subtitle_align: str + show_bottom_border: bool + def __init__( + self, + menu_style: MenuStyle, + max_dimension: Dimension | None = ..., + title: str | None = ..., + title_align: str = ..., + subtitle: str | None = ..., + subtitle_align: str = ..., + show_bottom_border: bool = ..., + ) -> None: ... + def generate(self) -> Generator[str, None, None]: ... + +class MenuTextSection(MenuComponent): + text: str + text_align: str + show_top_border: bool + show_bottom_border: bool + def __init__( + self, + menu_style: MenuStyle, + max_dimension: Dimension | None = ..., + text: str | None = ..., + text_align: str = ..., + show_top_border: bool = ..., + show_bottom_border: bool = ..., + ) -> None: ... + def generate(self) -> Generator[str, None, None]: ... + +class MenuItemsSection(MenuComponent): + items_align: str + def __init__( + self, + menu_style: MenuStyle, + max_dimension: Dimension | None = ..., + items: list[MenuItem] | None = ..., + items_align: str = ..., + ) -> None: ... + @property + def items(self) -> list[MenuItem]: ... + @items.setter + def items(self, items: list[MenuItem]) -> None: ... + @property + def items_with_bottom_border(self) -> list[str]: ... + @property + def items_with_top_border(self) -> list[str]: ... + def show_item_bottom_border(self, item_text: str, flag: bool) -> None: ... + def show_item_top_border(self, item_text: str, flag: bool) -> None: ... + def generate(self) -> Generator[str, None, None]: ... + +class MenuFooter(MenuComponent): + def generate(self) -> Generator[str, None, None]: ... + +class MenuPrompt(MenuComponent): + def __init__(self, menu_style: MenuStyle, max_dimension: Dimension | None = ..., prompt_string: str = ...) -> None: ... + @property + def prompt(self) -> str: ... + @prompt.setter + def prompt(self, prompt: str) -> None: ... + def generate(self) -> Generator[str, None, None]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/menu_formatter.pyi b/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/menu_formatter.pyi new file mode 100644 index 000000000..cfd09a695 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/menu_formatter.pyi @@ -0,0 +1,55 @@ +from consolemenu.console_menu import MenuItem +from consolemenu.format import MenuBorderStyleType +from consolemenu.format.menu_borders import MenuBorderStyle as MenuBorderStyle, MenuBorderStyleFactory as MenuBorderStyleFactory +from consolemenu.format.menu_style import MenuStyle as MenuStyle +from consolemenu.menu_component import ( + Dimension as Dimension, + MenuFooter as MenuFooter, + MenuHeader as MenuHeader, + MenuItemsSection as MenuItemsSection, + MenuPrompt as MenuPrompt, + MenuTextSection as MenuTextSection, +) + +class MenuFormatBuilder: + def __init__(self, max_dimension: Dimension | None = ...) -> None: ... + def set_border_style(self, border_style: MenuBorderStyle) -> MenuFormatBuilder: ... + def set_border_style_type(self, border_style_type: MenuBorderStyleType) -> MenuFormatBuilder: ... + def set_border_style_factory(self, border_style_factory: MenuBorderStyleFactory) -> MenuFormatBuilder: ... + def set_bottom_margin(self, bottom_margin: int) -> MenuFormatBuilder: ... + def set_left_margin(self, left_margin: int) -> MenuFormatBuilder: ... + def set_right_margin(self, right_margin: int) -> MenuFormatBuilder: ... + def set_top_margin(self, top_margin: int) -> MenuFormatBuilder: ... + def set_title_align(self, align: str = ...) -> MenuFormatBuilder: ... + def set_subtitle_align(self, align: str = ...) -> MenuFormatBuilder: ... + def set_header_left_padding(self, x: int) -> MenuFormatBuilder: ... + def set_header_right_padding(self, x: int) -> MenuFormatBuilder: ... + def set_header_bottom_padding(self, x: int) -> MenuFormatBuilder: ... + def set_header_top_padding(self, x: int) -> MenuFormatBuilder: ... + def show_header_bottom_border(self, flag: bool) -> MenuFormatBuilder: ... + def set_footer_left_padding(self, x: int) -> MenuFormatBuilder: ... + def set_footer_right_padding(self, x: int) -> MenuFormatBuilder: ... + def set_footer_bottom_padding(self, x: int) -> MenuFormatBuilder: ... + def set_footer_top_padding(self, x: int) -> MenuFormatBuilder: ... + def set_items_left_padding(self, x: int) -> MenuFormatBuilder: ... + def set_items_right_padding(self, x: int) -> MenuFormatBuilder: ... + def set_items_bottom_padding(self, x: int) -> MenuFormatBuilder: ... + def set_items_top_padding(self, x: int) -> MenuFormatBuilder: ... + def show_item_bottom_border(self, item_text: str, flag: bool) -> MenuFormatBuilder: ... + def show_item_top_border(self, item_text: str, flag: bool) -> MenuFormatBuilder: ... + def set_prologue_text_align(self, align: str = ...) -> MenuFormatBuilder: ... + def show_prologue_top_border(self, flag: bool) -> MenuFormatBuilder: ... + def show_prologue_bottom_border(self, flag: bool) -> MenuFormatBuilder: ... + def set_epilogue_text_align(self, align: str = ...) -> MenuFormatBuilder: ... + def show_epilogue_top_border(self, flag: bool) -> MenuFormatBuilder: ... + def show_epilogue_bottom_border(self, flag: bool) -> MenuFormatBuilder: ... + def set_prompt(self, prompt: MenuPrompt) -> MenuFormatBuilder: ... + def clear_data(self) -> None: ... + def format( + self, + title: str | None = ..., + subtitle: str | None = ..., + prologue_text: str | None = ..., + epilogue_text: str | None = ..., + items: list[MenuItem] | None = ..., + ) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/multiselect_menu.pyi b/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/multiselect_menu.pyi new file mode 100644 index 000000000..06e2a5e75 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/multiselect_menu.pyi @@ -0,0 +1,22 @@ +from consolemenu import ConsoleMenu as ConsoleMenu +from consolemenu.console_menu import MenuItem +from consolemenu.items import SubmenuItem as SubmenuItem +from consolemenu.menu_formatter import MenuFormatBuilder + +class MultiSelectMenu(ConsoleMenu): + ack_item_completion: bool + def __init__( + self, + title: str | None = ..., + subtitle: str | None = ..., + formatter: MenuFormatBuilder | None = ..., + prologue_text: str | None = ..., + epilogue_text: str | None = ..., + ack_item_completion: bool = ..., + show_exit_option: bool = ..., + exit_option_text: str = ..., + clear_screen: bool = ..., + ) -> None: ... + def append_item(self, item: MenuItem) -> None: ... + current_option: int + def process_user_input(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/prompt_utils.pyi b/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/prompt_utils.pyi new file mode 100644 index 000000000..507d716f7 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/prompt_utils.pyi @@ -0,0 +1,47 @@ +from collections.abc import Iterable, Sequence +from typing import Any, NamedTuple + +from consolemenu.screen import Screen +from consolemenu.validators.base import BaseValidator + +class InputResult(NamedTuple): + input_string: str + validation_result: bool + +class PromptFormatter: + @staticmethod + def format_prompt( + prompt: str | None = ..., + default: str | None = ..., + enable_quit: bool = ..., + quit_string: str = ..., + quit_message: str = ..., + ) -> str: ... + +class PromptUtils: + def __init__(self, screen: Screen, prompt_formatter: PromptFormatter | None = ...) -> None: ... + @property + def screen(self) -> Screen: ... + def clear(self) -> None: ... + def confirm_answer(self, answer: str, message: str | None = ...) -> bool: ... + def enter_to_continue(self, message: str | None = ...) -> None: ... + def input( + self, + prompt: str | None = ..., + default: str | None = ..., + validators: Iterable[BaseValidator] | None = ..., + enable_quit: bool = ..., + quit_string: str = ..., + quit_message: str = ..., + ) -> InputResult: ... + def input_password(self, message: str | None = ...) -> str: ... + def printf(self, *args: Any) -> None: ... + def println(self, *args: Any) -> None: ... + def prompt_and_confirm_password(self, message: str) -> str: ... + def prompt_for_bilateral_choice(self, prompt: str, option1: str, option2: str) -> str: ... + def prompt_for_trilateral_choice(self, prompt: str, option1: str, option2: str, option3: str) -> str: ... + def prompt_for_yes_or_no(self, prompt: str) -> bool: ... + def prompt_for_numbered_choice(self, choices: Sequence[str], title: str | None = ..., prompt: str = ...) -> int: ... + def validate_input(self, input_string: str, validators: BaseValidator) -> bool: ... + +class UserQuit(Exception): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/screen.pyi b/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/screen.pyi new file mode 100644 index 000000000..712823c8b --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/screen.pyi @@ -0,0 +1,17 @@ +from typing import Any + +class Screen: + def __init__(self) -> None: ... + @property + def screen_height(self) -> int: ... + @property + def screen_width(self) -> int: ... + @staticmethod + def clear() -> None: ... + @staticmethod + def flush() -> None: ... + def input(self, prompt: str = ...) -> str: ... + @staticmethod + def printf(*args: Any) -> None: ... + @staticmethod + def println(*args: Any) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/selection_menu.pyi b/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/selection_menu.pyi new file mode 100644 index 000000000..4735cb80e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/selection_menu.pyi @@ -0,0 +1,31 @@ +from collections.abc import Iterable + +from consolemenu import ConsoleMenu as ConsoleMenu +from consolemenu.items import SelectionItem as SelectionItem +from consolemenu.menu_formatter import MenuFormatBuilder +from consolemenu.screen import Screen + +class SelectionMenu(ConsoleMenu): + def __init__( + self, + strings: Iterable[str], + title: str | None = ..., + subtitle: str | None = ..., + screen: Screen | None = ..., + formatter: MenuFormatBuilder | None = ..., + prologue_text: str | None = ..., + epilogue_text: str | None = ..., + show_exit_option: bool = ..., + exit_option_text: str = ..., + clear_screen: bool = ..., + ) -> None: ... + @classmethod + def get_selection( + cls, + strings: Iterable[str], + title: str = ..., + subtitle: str | None = ..., + show_exit_option: bool = ..., + _menu: ConsoleMenu | None = ..., + ) -> int: ... + def append_string(self, string: str) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/bindings/openssl/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/validators/__init__.pyi similarity index 100% rename from packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/bindings/openssl/__init__.pyi rename to packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/validators/__init__.pyi diff --git a/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/validators/base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/validators/base.pyi new file mode 100644 index 000000000..eaea5c87c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/validators/base.pyi @@ -0,0 +1,11 @@ +import abc +from abc import abstractmethod +from logging import Logger + +class InvalidValidator(Exception): ... + +class BaseValidator(metaclass=abc.ABCMeta): + log: Logger + def __init__(self) -> None: ... + @abstractmethod + def validate(self, input_string: str) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/validators/regex.pyi b/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/validators/regex.pyi new file mode 100644 index 000000000..fdadc44f6 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/validators/regex.pyi @@ -0,0 +1,7 @@ +from consolemenu.validators.base import BaseValidator as BaseValidator + +class RegexValidator(BaseValidator): + def __init__(self, pattern: str) -> None: ... + @property + def pattern(self) -> str: ... + def validate(self, input_string: str) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/validators/url.pyi b/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/validators/url.pyi new file mode 100644 index 000000000..d9e92bb63 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/validators/url.pyi @@ -0,0 +1,5 @@ +from consolemenu.validators.base import BaseValidator as BaseValidator + +class UrlValidator(BaseValidator): + def __init__(self) -> None: ... + def validate(self, input_string: str) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/version.pyi similarity index 100% rename from packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/__init__.pyi rename to packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/version.pyi diff --git a/packages/pyright-internal/typeshed-fallback/stubs/contextvars/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/contextvars/METADATA.toml index 35b625002..ea07e8d31 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/contextvars/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/contextvars/METADATA.toml @@ -1,4 +1 @@ version = "2.4" - -[tool.stubtest] -ignore_missing_stub = false diff --git a/packages/pyright-internal/typeshed-fallback/stubs/croniter/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/croniter/METADATA.toml index 47610a97c..3ea18392d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/croniter/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/croniter/METADATA.toml @@ -1,4 +1 @@ version = "1.3.*" - -[tool.stubtest] -ignore_missing_stub = false diff --git a/packages/pyright-internal/typeshed-fallback/stubs/croniter/croniter/croniter.pyi b/packages/pyright-internal/typeshed-fallback/stubs/croniter/croniter/croniter.pyi index 69c22e969..0799a69f8 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/croniter/croniter/croniter.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/croniter/croniter/croniter.pyi @@ -1,11 +1,22 @@ import datetime -from _typeshed import Self +from _typeshed import ReadableBuffer, Unused +from collections import OrderedDict from collections.abc import Iterator -from typing import Any -from typing_extensions import Literal, TypeAlias +from re import Match, Pattern +from typing import Any, overload +from typing_extensions import Literal, Self, TypeAlias _RetType: TypeAlias = type[float | datetime.datetime] +step_search_re: Pattern[str] +only_int_re: Pattern[str] +star_or_int_re: Pattern[str] +special_weekday_re: Pattern[str] +hash_expression_re: Pattern[str] +VALID_LEN_EXPRESSION: list[int] + +def timedelta_to_seconds(td: datetime.timedelta) -> float: ... + class CroniterError(ValueError): ... class CroniterBadTypeRangeError(TypeError): ... class CroniterBadCronError(CroniterError): ... @@ -58,7 +69,7 @@ class croniter(Iterator[Any]): def get_prev(self, ret_type: _RetType | None = ...) -> Any: ... def get_current(self, ret_type: _RetType | None = ...) -> Any: ... def set_current(self, start_time: float | datetime.datetime | None, force: bool = ...) -> float: ... - def __iter__(self: Self) -> Self: ... + def __iter__(self) -> Self: ... def next( self, ret_type: _RetType | None = ..., start_time: float | datetime.datetime | None = ..., is_prev: bool | None = ... ) -> Any: ... @@ -83,3 +94,42 @@ def croniter_range( exclude_ends: bool = ..., _croniter: type[croniter] | None = ..., ) -> Iterator[Any]: ... + +class HashExpander: + cron: croniter + def __init__(self, cronit: croniter) -> None: ... + @overload + def do( + self, + idx: int, + hash_type: Literal["r"], + hash_id: None = None, + range_end: int | None = None, + range_begin: int | None = None, + ) -> int: ... + @overload + def do( + self, idx: int, hash_type: str, hash_id: ReadableBuffer, range_end: int | None = None, range_begin: int | None = None + ) -> int: ... + @overload + def do( + self, + idx: int, + hash_type: str = "h", + *, + hash_id: ReadableBuffer, + range_end: int | None = None, + range_begin: int | None = None, + ) -> int: ... + def match(self, efl: Unused, idx: Unused, expr: str, hash_id: Unused = None, **kw: Unused) -> Match[str] | None: ... + def expand( + self, + efl: object, + idx: int, + expr: str, + hash_id: ReadableBuffer | None = None, + match: Match[str] | None | Literal[""] = "", + **kw: object, + ) -> str: ... + +EXPANDERS: OrderedDict[str, HashExpander] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/cryptography/METADATA.toml deleted file mode 100644 index 6376d4cca..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/METADATA.toml +++ /dev/null @@ -1,2 +0,0 @@ -version = "3.3.*" -obsolete_since = "3.4.4" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/exceptions.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/exceptions.pyi deleted file mode 100644 index 48041a805..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/exceptions.pyi +++ /dev/null @@ -1,7 +0,0 @@ -class AlreadyFinalized(Exception): ... -class AlreadyUpdated(Exception): ... -class InvalidKey(Exception): ... -class InvalidSignature(Exception): ... -class InvalidTag(Exception): ... -class NotYetFinalized(Exception): ... -class UnsupportedAlgorithm(Exception): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/fernet.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/fernet.pyi deleted file mode 100644 index e42a0c54a..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/fernet.pyi +++ /dev/null @@ -1,23 +0,0 @@ -class InvalidToken(Exception): ... - -class Fernet: - def __init__(self, key: bytes | str) -> None: ... - def decrypt(self, token: bytes, ttl: int | None = ...) -> bytes: ... - # decrypt_at_time accepts None ttl at runtime but it's an implementtion detail and it doesn't really - # make sense for the client code to use it like that, so the parameter is typed as int as opposed to - # int | None. - def decrypt_at_time(self, token: bytes, ttl: int, current_time: int) -> bytes: ... - def encrypt(self, data: bytes) -> bytes: ... - def encrypt_at_time(self, data: bytes, current_time: int) -> bytes: ... - def extract_timestamp(self, token: bytes) -> int: ... - @classmethod - def generate_key(cls) -> bytes: ... - -class MultiFernet: - def __init__(self, fernets: list[Fernet]) -> None: ... - def decrypt(self, token: bytes, ttl: int | None = ...) -> bytes: ... - # See a note above on the typing of the ttl parameter. - def decrypt_at_time(self, token: bytes, ttl: int, current_time: int) -> bytes: ... - def encrypt(self, data: bytes) -> bytes: ... - def encrypt_at_time(self, data: bytes, current_time: int) -> bytes: ... - def rotate(self, msg: bytes) -> bytes: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/__init__.pyi deleted file mode 100644 index e27843e53..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/__init__.pyi +++ /dev/null @@ -1,3 +0,0 @@ -from typing import Any - -def __getattr__(name: str) -> Any: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/backends/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/backends/__init__.pyi deleted file mode 100644 index d452202ee..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/backends/__init__.pyi +++ /dev/null @@ -1,6 +0,0 @@ -from typing import Any - -def default_backend() -> Any: ... - -# TODO: add some backends -def __getattr__(name: str) -> Any: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/backends/interfaces.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/backends/interfaces.pyi deleted file mode 100644 index 9dbbecfbe..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/backends/interfaces.pyi +++ /dev/null @@ -1,196 +0,0 @@ -from abc import ABCMeta, abstractmethod -from typing import Any - -from cryptography.hazmat.primitives.asymmetric.dh import ( - DHParameterNumbers, - DHParameters, - DHPrivateKey, - DHPrivateNumbers, - DHPublicKey, - DHPublicNumbers, -) -from cryptography.hazmat.primitives.asymmetric.dsa import ( - DSAParameterNumbers, - DSAParameters, - DSAPrivateKey, - DSAPrivateNumbers, - DSAPublicKey, - DSAPublicNumbers, -) -from cryptography.hazmat.primitives.asymmetric.ec import ( - EllipticCurve, - EllipticCurvePrivateKey, - EllipticCurvePrivateNumbers, - EllipticCurvePublicKey, - EllipticCurvePublicNumbers, - EllipticCurveSignatureAlgorithm, -) -from cryptography.hazmat.primitives.asymmetric.padding import AsymmetricPadding -from cryptography.hazmat.primitives.asymmetric.rsa import RSAPrivateKey, RSAPrivateNumbers, RSAPublicKey, RSAPublicNumbers -from cryptography.hazmat.primitives.ciphers import BlockCipherAlgorithm, CipherAlgorithm, CipherContext -from cryptography.hazmat.primitives.ciphers.modes import Mode -from cryptography.hazmat.primitives.hashes import HashAlgorithm, HashContext -from cryptography.x509 import ( - Certificate, - CertificateBuilder, - CertificateRevocationList, - CertificateRevocationListBuilder, - CertificateSigningRequest, - CertificateSigningRequestBuilder, - Name, - RevokedCertificate, - RevokedCertificateBuilder, -) - -class CipherBackend(metaclass=ABCMeta): - @abstractmethod - def cipher_supported(self, cipher: CipherAlgorithm, mode: Mode) -> bool: ... - @abstractmethod - def create_symmetric_encryption_ctx(self, cipher: CipherAlgorithm, mode: Mode) -> CipherContext: ... - @abstractmethod - def create_symmetric_decryption_ctx(self, cipher: CipherAlgorithm, mode: Mode) -> CipherContext: ... - -class CMACBackend(metaclass=ABCMeta): - @abstractmethod - def cmac_algorithm_supported(self, algorithm: BlockCipherAlgorithm) -> bool: ... - @abstractmethod - def create_cmac_ctx(self, algorithm: BlockCipherAlgorithm) -> Any: ... - -class DERSerializationBackend(metaclass=ABCMeta): - @abstractmethod - def load_der_parameters(self, data: bytes) -> Any: ... - @abstractmethod - def load_der_private_key(self, data: bytes, password: bytes | None) -> Any: ... - @abstractmethod - def load_der_public_key(self, data: bytes) -> Any: ... - -class DHBackend(metaclass=ABCMeta): - @abstractmethod - def dh_parameters_supported(self, p: int, g: int, q: int | None) -> bool: ... - @abstractmethod - def dh_x942_serialization_supported(self) -> bool: ... - @abstractmethod - def generate_dh_parameters(self, generator: int, key_size: int) -> DHParameters: ... - @abstractmethod - def generate_dh_private_key(self, parameters: DHParameters) -> DHPrivateKey: ... - @abstractmethod - def generate_dh_private_key_and_parameters(self, generator: int, key_size: int) -> DHPrivateKey: ... - @abstractmethod - def load_dh_parameter_numbers(self, numbers: DHParameterNumbers) -> DHParameters: ... - @abstractmethod - def load_dh_private_numbers(self, numbers: DHPrivateNumbers) -> DHPrivateKey: ... - @abstractmethod - def load_dh_public_numbers(self, numbers: DHPublicNumbers) -> DHPublicKey: ... - -class DSABackend(metaclass=ABCMeta): - @abstractmethod - def dsa_hash_supported(self, algorithm: HashAlgorithm) -> bool: ... - @abstractmethod - def dsa_parameters_supported(self, p: int, q: int, g: int) -> bool: ... - @abstractmethod - def generate_dsa_parameters(self, key_size: int) -> DSAParameters: ... - @abstractmethod - def generate_dsa_private_key(self, parameters: DSAParameters) -> DSAPrivateKey: ... - @abstractmethod - def generate_dsa_private_key_and_parameters(self, key_size: int) -> DSAPrivateKey: ... - @abstractmethod - def load_dsa_parameter_numbers(self, numbers: DSAParameterNumbers) -> DSAParameters: ... - @abstractmethod - def load_dsa_private_numbers(self, numbers: DSAPrivateNumbers) -> DSAPrivateKey: ... - @abstractmethod - def load_dsa_public_numbers(self, numbers: DSAPublicNumbers) -> DSAPublicKey: ... - -class EllipticCurveBackend(metaclass=ABCMeta): - @abstractmethod - def derive_elliptic_curve_private_key(self, private_value: int, curve: EllipticCurve) -> EllipticCurvePrivateKey: ... - @abstractmethod - def elliptic_curve_signature_algorithm_supported( - self, signature_algorithm: EllipticCurveSignatureAlgorithm, curve: EllipticCurve - ) -> bool: ... - @abstractmethod - def elliptic_curve_supported(self, curve: EllipticCurve) -> bool: ... - @abstractmethod - def generate_elliptic_curve_private_key(self, curve: EllipticCurve) -> EllipticCurvePrivateKey: ... - @abstractmethod - def load_elliptic_curve_private_numbers(self, numbers: EllipticCurvePrivateNumbers) -> EllipticCurvePrivateKey: ... - @abstractmethod - def load_elliptic_curve_public_numbers(self, numbers: EllipticCurvePublicNumbers) -> EllipticCurvePublicKey: ... - -class HMACBackend(metaclass=ABCMeta): - @abstractmethod - def create_hmac_ctx(self, key: bytes, algorithm: HashAlgorithm) -> HashContext: ... - @abstractmethod - def cmac_algorithm_supported(self, algorithm: HashAlgorithm) -> bool: ... - -class HashBackend(metaclass=ABCMeta): - @abstractmethod - def create_hash_ctx(self, algorithm: HashAlgorithm) -> HashContext: ... - @abstractmethod - def hash_supported(self, algorithm: HashAlgorithm) -> bool: ... - -class PBKDF2HMACBackend(metaclass=ABCMeta): - @abstractmethod - def derive_pbkdf2_hmac( - self, algorithm: HashAlgorithm, length: int, salt: bytes, iterations: int, key_material: bytes - ) -> bytes: ... - @abstractmethod - def pbkdf2_hmac_supported(self, algorithm: HashAlgorithm) -> bool: ... - -class PEMSerializationBackend(metaclass=ABCMeta): - @abstractmethod - def load_pem_parameters(self, data: bytes) -> Any: ... - @abstractmethod - def load_pem_private_key(self, data: bytes, password: bytes | None) -> Any: ... - @abstractmethod - def load_pem_public_key(self, data: bytes) -> Any: ... - -class RSABackend(metaclass=ABCMeta): - @abstractmethod - def generate_rsa_parameters_supported(self, public_exponent: int, key_size: int) -> bool: ... - @abstractmethod - def generate_rsa_private_key(self, public_exponent: int, key_size: int) -> RSAPrivateKey: ... - @abstractmethod - def load_rsa_public_numbers(self, numbers: RSAPublicNumbers) -> RSAPublicKey: ... - @abstractmethod - def load_rsa_private_numbers(self, numbers: RSAPrivateNumbers) -> RSAPrivateKey: ... - @abstractmethod - def rsa_padding_supported(self, padding: AsymmetricPadding) -> bool: ... - -class ScryptBackend(metaclass=ABCMeta): - @abstractmethod - def derive_scrypt(self, key_material: bytes, salt: bytes, length: int, n: int, r: int, p: int) -> bytes: ... - -class X509Backend(metaclass=ABCMeta): - @abstractmethod - def create_x509_certificate( - self, - builder: CertificateBuilder, - private_key: DSAPrivateKey | EllipticCurvePrivateKey | RSAPrivateKey, - algorithm: HashAlgorithm, - ) -> Certificate: ... - @abstractmethod - def create_x509_crl( - self, - builder: CertificateRevocationListBuilder, - private_key: DSAPrivateKey | EllipticCurvePrivateKey | RSAPrivateKey, - algorithm: HashAlgorithm, - ) -> CertificateRevocationList: ... - @abstractmethod - def create_x509_csr( - self, - builder: CertificateSigningRequestBuilder, - private_key: DSAPrivateKey | EllipticCurvePrivateKey | RSAPrivateKey, - algorithm: HashAlgorithm, - ) -> CertificateSigningRequest: ... - @abstractmethod - def create_x509_revoked_certificate(self, builder: RevokedCertificateBuilder) -> RevokedCertificate: ... - @abstractmethod - def load_der_x509_certificate(self, data: bytes) -> Certificate: ... - @abstractmethod - def load_der_x509_csr(self, data: bytes) -> CertificateSigningRequest: ... - @abstractmethod - def load_pem_x509_certificate(self, data: bytes) -> Certificate: ... - @abstractmethod - def load_pem_x509_csr(self, data: bytes) -> CertificateSigningRequest: ... - @abstractmethod - def x509_name_bytes(self, name: Name) -> bytes: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/bindings/openssl/binding.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/bindings/openssl/binding.pyi deleted file mode 100644 index 6b6c6e81d..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/bindings/openssl/binding.pyi +++ /dev/null @@ -1,6 +0,0 @@ -from typing import Any - -class Binding: - ffi: Any | None - lib: Any | None - def init_static_locks(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/__init__.pyi deleted file mode 100644 index e27843e53..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/__init__.pyi +++ /dev/null @@ -1,3 +0,0 @@ -from typing import Any - -def __getattr__(name: str) -> Any: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/asymmetric/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/asymmetric/__init__.pyi deleted file mode 100644 index e27843e53..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/asymmetric/__init__.pyi +++ /dev/null @@ -1,3 +0,0 @@ -from typing import Any - -def __getattr__(name: str) -> Any: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/asymmetric/dh.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/asymmetric/dh.pyi deleted file mode 100644 index 6b2b0ae51..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/asymmetric/dh.pyi +++ /dev/null @@ -1,79 +0,0 @@ -from abc import ABCMeta, abstractmethod - -from cryptography.hazmat.backends.interfaces import DHBackend -from cryptography.hazmat.primitives.serialization import ( - Encoding, - KeySerializationEncryption, - ParameterFormat, - PrivateFormat, - PublicFormat, -) - -class DHParameters(metaclass=ABCMeta): - @abstractmethod - def generate_private_key(self) -> DHPrivateKey: ... - @abstractmethod - def parameter_bytes(self, encoding: Encoding, format: ParameterFormat) -> bytes: ... - @abstractmethod - def parameter_numbers(self) -> DHParameterNumbers: ... - -DHParametersWithSerialization = DHParameters - -class DHParameterNumbers: - @property - def p(self) -> int: ... - @property - def g(self) -> int: ... - @property - def q(self) -> int: ... - def __init__(self, p: int, g: int, q: int | None) -> None: ... - def parameters(self, backend: DHBackend | None = ...) -> DHParameters: ... - -class DHPrivateKey(metaclass=ABCMeta): - @property - def key_size(self) -> int: ... - @abstractmethod - def exchange(self, peer_public_key: DHPublicKey) -> bytes: ... - @abstractmethod - def parameters(self) -> DHParameters: ... - @abstractmethod - def public_key(self) -> DHPublicKey: ... - -class DHPrivateKeyWithSerialization(DHPrivateKey): - @abstractmethod - def private_bytes( - self, encoding: Encoding, format: PrivateFormat, encryption_algorithm: KeySerializationEncryption - ) -> bytes: ... - @abstractmethod - def private_numbers(self) -> DHPrivateNumbers: ... - -class DHPrivateNumbers: - @property - def public_numbers(self) -> DHPublicNumbers: ... - @property - def x(self) -> int: ... - def __init__(self, x: int, public_numbers: DHPublicNumbers) -> None: ... - def private_key(self, backend: DHBackend | None = ...) -> DHPrivateKey: ... - -class DHPublicKey(metaclass=ABCMeta): - @property - @abstractmethod - def key_size(self) -> int: ... - @abstractmethod - def parameters(self) -> DHParameters: ... - @abstractmethod - def public_bytes(self, encoding: Encoding, format: PublicFormat) -> bytes: ... - @abstractmethod - def public_numbers(self) -> DHPublicNumbers: ... - -DHPublicKeyWithSerialization = DHPublicKey - -class DHPublicNumbers: - @property - def parameter_numbers(self) -> DHParameterNumbers: ... - @property - def y(self) -> int: ... - def __init__(self, y: int, parameter_numbers: DHParameterNumbers) -> None: ... - def public_key(self, backend: DHBackend | None = ...) -> DHPublicKey: ... - -def generate_parameters(generator: int, key_size: int, backend: DHBackend | None = ...) -> DHParameters: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/asymmetric/dsa.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/asymmetric/dsa.pyi deleted file mode 100644 index 364376cc6..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/asymmetric/dsa.pyi +++ /dev/null @@ -1,76 +0,0 @@ -from abc import ABCMeta, abstractmethod - -from cryptography.hazmat.backends.interfaces import DSABackend -from cryptography.hazmat.primitives.asymmetric import AsymmetricVerificationContext -from cryptography.hazmat.primitives.asymmetric.utils import Prehashed -from cryptography.hazmat.primitives.hashes import HashAlgorithm -from cryptography.hazmat.primitives.serialization import Encoding, KeySerializationEncryption, PrivateFormat, PublicFormat - -class DSAParameters(metaclass=ABCMeta): - @abstractmethod - def generate_private_key(self) -> DSAPrivateKey: ... - -class DSAParametersWithNumbers(DSAParameters): - @abstractmethod - def parameter_numbers(self) -> DSAParameterNumbers: ... - -class DSAParameterNumbers: - @property - def p(self) -> int: ... - @property - def q(self) -> int: ... - @property - def g(self) -> int: ... - def __init__(self, p: int, q: int, g: int) -> None: ... - def parameters(self, backend: DSABackend | None = ...) -> DSAParameters: ... - -class DSAPrivateKey(metaclass=ABCMeta): - @property - @abstractmethod - def key_size(self) -> int: ... - @abstractmethod - def parameters(self) -> DSAParameters: ... - @abstractmethod - def public_key(self) -> DSAPublicKey: ... - @abstractmethod - def sign(self, data: bytes, algorithm: HashAlgorithm | Prehashed) -> bytes: ... - -class DSAPrivateKeyWithSerialization(DSAPrivateKey): - @abstractmethod - def private_bytes( - self, encoding: Encoding, format: PrivateFormat, encryption_algorithm: KeySerializationEncryption - ) -> bytes: ... - @abstractmethod - def private_numbers(self) -> DSAPrivateNumbers: ... - -class DSAPrivateNumbers: - @property - def x(self) -> int: ... - @property - def public_numbers(self) -> DSAPublicNumbers: ... - def __init__(self, x: int, public_numbers: DSAPublicNumbers) -> None: ... - -class DSAPublicKey(metaclass=ABCMeta): - @property - @abstractmethod - def key_size(self) -> int: ... - @abstractmethod - def public_bytes(self, encoding: Encoding, format: PublicFormat) -> bytes: ... - @abstractmethod - def public_numbers(self) -> DSAPublicNumbers: ... - @abstractmethod - def verifier(self, signature: bytes, signature_algorithm: HashAlgorithm | Prehashed) -> AsymmetricVerificationContext: ... - @abstractmethod - def verify(self, signature: bytes, data: bytes, algorithm: HashAlgorithm | Prehashed) -> None: ... - -DSAPublicKeyWithSerialization = DSAPublicKey - -class DSAPublicNumbers: - @property - def y(self) -> int: ... - @property - def parameter_numbers(self) -> DSAParameterNumbers: ... - def __init__(self, y: int, parameter_numbers: DSAParameterNumbers) -> None: ... - -def generate_parameters(key_size: int, backend: DSABackend | None = ...) -> DSAParameters: ... -def generate_private_key(key_size: int, backend: DSABackend | None = ...) -> DSAPrivateKey: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/asymmetric/ec.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/asymmetric/ec.pyi deleted file mode 100644 index fb6e7457e..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/asymmetric/ec.pyi +++ /dev/null @@ -1,197 +0,0 @@ -from _typeshed import Self -from abc import ABCMeta, abstractmethod -from typing import ClassVar - -from cryptography.hazmat.backends.interfaces import EllipticCurveBackend -from cryptography.hazmat.primitives.asymmetric import AsymmetricVerificationContext -from cryptography.hazmat.primitives.asymmetric.utils import Prehashed -from cryptography.hazmat.primitives.hashes import HashAlgorithm -from cryptography.hazmat.primitives.serialization import Encoding, KeySerializationEncryption, PrivateFormat, PublicFormat -from cryptography.x509 import ObjectIdentifier - -class EllipticCurve(metaclass=ABCMeta): - @property - @abstractmethod - def key_size(self) -> int: ... - @property - @abstractmethod - def name(self) -> str: ... - -class BrainpoolP256R1(EllipticCurve): - key_size: int = ... - name: str = ... - -class BrainpoolP384R1(EllipticCurve): - key_size: int = ... - name: str = ... - -class BrainpoolP512R1(EllipticCurve): - key_size: int = ... - name: str = ... - -class SECP192R1(EllipticCurve): - key_size: int = ... - name: str = ... - -class SECP224R1(EllipticCurve): - key_size: int = ... - name: str = ... - -class SECP256K1(EllipticCurve): - key_size: int = ... - name: str = ... - -class SECP256R1(EllipticCurve): - key_size: int = ... - name: str = ... - -class SECP384R1(EllipticCurve): - key_size: int = ... - name: str = ... - -class SECP521R1(EllipticCurve): - key_size: int = ... - name: str = ... - -class SECT163K1(EllipticCurve): - key_size: int = ... - name: str = ... - -class SECT163R2(EllipticCurve): - key_size: int = ... - name: str = ... - -class SECT233K1(EllipticCurve): - key_size: int = ... - name: str = ... - -class SECT233R1(EllipticCurve): - key_size: int = ... - name: str = ... - -class SECT283K1(EllipticCurve): - key_size: int = ... - name: str = ... - -class SECT283R1(EllipticCurve): - key_size: int = ... - name: str = ... - -class SECT409K1(EllipticCurve): - key_size: int = ... - name: str = ... - -class SECT409R1(EllipticCurve): - key_size: int = ... - name: str = ... - -class SECT571K1(EllipticCurve): - key_size: int = ... - name: str = ... - -class SECT571R1(EllipticCurve): - key_size: int = ... - name: str = ... - -class EllipticCurveOID: - SECP192R1: ClassVar[ObjectIdentifier] - SECP224R1: ClassVar[ObjectIdentifier] - SECP256K1: ClassVar[ObjectIdentifier] - SECP256R1: ClassVar[ObjectIdentifier] - SECP384R1: ClassVar[ObjectIdentifier] - SECP521R1: ClassVar[ObjectIdentifier] - BRAINPOOLP256R1: ClassVar[ObjectIdentifier] - BRAINPOOLP384R1: ClassVar[ObjectIdentifier] - BRAINPOOLP512R1: ClassVar[ObjectIdentifier] - SECT163K1: ClassVar[ObjectIdentifier] - SECT163R2: ClassVar[ObjectIdentifier] - SECT233K1: ClassVar[ObjectIdentifier] - SECT233R1: ClassVar[ObjectIdentifier] - SECT283K1: ClassVar[ObjectIdentifier] - SECT283R1: ClassVar[ObjectIdentifier] - SECT409K1: ClassVar[ObjectIdentifier] - SECT409R1: ClassVar[ObjectIdentifier] - SECT571K1: ClassVar[ObjectIdentifier] - SECT571R1: ClassVar[ObjectIdentifier] - -class EllipticCurvePrivateKey(metaclass=ABCMeta): - @property - @abstractmethod - def curve(self) -> EllipticCurve: ... - @property - @abstractmethod - def key_size(self) -> int: ... - @abstractmethod - def exchange(self, algorithm: ECDH, peer_public_key: EllipticCurvePublicKey) -> bytes: ... - @abstractmethod - def public_key(self) -> EllipticCurvePublicKey: ... - @abstractmethod - def sign(self, data: bytes, signature_algorithm: EllipticCurveSignatureAlgorithm) -> bytes: ... - -class EllipticCurvePrivateKeyWithSerialization(EllipticCurvePrivateKey): - @abstractmethod - def private_bytes( - self, encoding: Encoding, format: PrivateFormat, encryption_algorithm: KeySerializationEncryption - ) -> bytes: ... - @abstractmethod - def private_numbers(self) -> EllipticCurvePrivateNumbers: ... - -class EllipticCurvePrivateNumbers: - @property - def private_value(self) -> int: ... - @property - def public_numbers(self) -> EllipticCurvePublicNumbers: ... - def __init__(self, private_value: int, public_numbers: EllipticCurvePublicNumbers) -> None: ... - def private_key(self, backend: EllipticCurveBackend | None = ...) -> EllipticCurvePrivateKey: ... - -class EllipticCurvePublicKey(metaclass=ABCMeta): - @property - @abstractmethod - def curve(self) -> EllipticCurve: ... - @property - @abstractmethod - def key_size(self) -> int: ... - @classmethod - def from_encoded_point(cls, curve: EllipticCurve, data: bytes) -> EllipticCurvePublicKey: ... - @abstractmethod - def public_bytes(self, encoding: Encoding, format: PublicFormat) -> bytes: ... - @abstractmethod - def public_numbers(self) -> EllipticCurvePublicNumbers: ... - @abstractmethod - def verifier( - self, signature: bytes, signature_algorithm: EllipticCurveSignatureAlgorithm - ) -> AsymmetricVerificationContext: ... - @abstractmethod - def verify(self, signature: bytes, data: bytes, signature_algorithm: EllipticCurveSignatureAlgorithm) -> None: ... - -EllipticCurvePublicKeyWithSerialization = EllipticCurvePublicKey - -class EllipticCurvePublicNumbers: - @property - def curve(self) -> EllipticCurve: ... - @property - def x(self) -> int: ... - @property - def y(self) -> int: ... - def __init__(self, x: int, y: int, curve: EllipticCurve) -> None: ... - @classmethod - def from_encoded_point(cls: type[Self], curve: EllipticCurve, data: bytes) -> Self: ... - def public_key(self, backend: EllipticCurveBackend | None = ...) -> EllipticCurvePublicKey: ... - -class EllipticCurveSignatureAlgorithm(metaclass=ABCMeta): - @property - @abstractmethod - def algorithm(self) -> HashAlgorithm | Prehashed: ... - -class ECDH: ... - -class ECDSA(EllipticCurveSignatureAlgorithm): - def __init__(self, algorithm: HashAlgorithm | Prehashed): ... - @property - def algorithm(self) -> HashAlgorithm | Prehashed: ... - -def derive_private_key( - private_value: int, curve: EllipticCurve, backend: EllipticCurveBackend | None = ... -) -> EllipticCurvePrivateKey: ... -def generate_private_key(curve: EllipticCurve, backend: EllipticCurveBackend | None = ...) -> EllipticCurvePrivateKey: ... -def get_curve_for_oid(oid: ObjectIdentifier) -> EllipticCurve: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/asymmetric/ed25519.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/asymmetric/ed25519.pyi deleted file mode 100644 index 518d2d6b9..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/asymmetric/ed25519.pyi +++ /dev/null @@ -1,25 +0,0 @@ -from abc import ABCMeta, abstractmethod - -from cryptography.hazmat.primitives.serialization import Encoding, KeySerializationEncryption, PrivateFormat, PublicFormat - -class Ed25519PrivateKey(metaclass=ABCMeta): - @classmethod - def generate(cls) -> Ed25519PrivateKey: ... - @classmethod - def from_private_bytes(cls, data: bytes) -> Ed25519PrivateKey: ... - @abstractmethod - def private_bytes( - self, encoding: Encoding, format: PrivateFormat, encryption_algorithm: KeySerializationEncryption - ) -> bytes: ... - @abstractmethod - def public_key(self) -> Ed25519PublicKey: ... - @abstractmethod - def sign(self, data: bytes) -> bytes: ... - -class Ed25519PublicKey(metaclass=ABCMeta): - @classmethod - def from_public_bytes(cls, data: bytes) -> Ed25519PublicKey: ... - @abstractmethod - def public_bytes(self, encoding: Encoding, format: PublicFormat) -> bytes: ... - @abstractmethod - def verify(self, signature: bytes, data: bytes) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/asymmetric/ed448.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/asymmetric/ed448.pyi deleted file mode 100644 index fa43fc1bc..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/asymmetric/ed448.pyi +++ /dev/null @@ -1,25 +0,0 @@ -from abc import ABCMeta, abstractmethod - -from cryptography.hazmat.primitives.serialization import Encoding, KeySerializationEncryption, PrivateFormat, PublicFormat - -class Ed448PrivateKey(metaclass=ABCMeta): - @classmethod - def generate(cls) -> Ed448PrivateKey: ... - @classmethod - def from_private_bytes(cls, data: bytes) -> Ed448PrivateKey: ... - @abstractmethod - def private_bytes( - self, encoding: Encoding, format: PrivateFormat, encryption_algorithm: KeySerializationEncryption - ) -> bytes: ... - @abstractmethod - def public_key(self) -> Ed448PublicKey: ... - @abstractmethod - def sign(self, data: bytes) -> bytes: ... - -class Ed448PublicKey(metaclass=ABCMeta): - @classmethod - def from_public_bytes(cls, data: bytes) -> Ed448PublicKey: ... - @abstractmethod - def public_bytes(self, encoding: Encoding, format: PublicFormat) -> bytes: ... - @abstractmethod - def verify(self, signature: bytes, data: bytes) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/asymmetric/padding.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/asymmetric/padding.pyi deleted file mode 100644 index b2d70c5c7..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/asymmetric/padding.pyi +++ /dev/null @@ -1,27 +0,0 @@ -from abc import ABCMeta, abstractmethod -from typing import ClassVar - -from cryptography.hazmat.primitives.hashes import HashAlgorithm - -class AsymmetricPadding(metaclass=ABCMeta): - @property - @abstractmethod - def name(self) -> str: ... - -class MGF1: - def __init__(self, algorithm: HashAlgorithm) -> None: ... - -class OAEP(AsymmetricPadding): - def __init__(self, mgf: MGF1, algorithm: HashAlgorithm, label: bytes | None) -> None: ... - @property - def name(self) -> str: ... - -class PKCS1v15(AsymmetricPadding): - @property - def name(self) -> str: ... - -class PSS(AsymmetricPadding): - MAX_LENGTH: ClassVar[object] - def __init__(self, mgf: MGF1, salt_length: int | object) -> None: ... - @property - def name(self) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/asymmetric/rsa.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/asymmetric/rsa.pyi deleted file mode 100644 index 2fe8886d2..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/asymmetric/rsa.pyi +++ /dev/null @@ -1,80 +0,0 @@ -from abc import ABCMeta, abstractmethod - -from cryptography.hazmat.backends.interfaces import RSABackend -from cryptography.hazmat.primitives.asymmetric import AsymmetricVerificationContext -from cryptography.hazmat.primitives.asymmetric.padding import AsymmetricPadding -from cryptography.hazmat.primitives.asymmetric.utils import Prehashed -from cryptography.hazmat.primitives.hashes import HashAlgorithm -from cryptography.hazmat.primitives.serialization import Encoding, KeySerializationEncryption, PrivateFormat, PublicFormat - -class RSAPrivateKey(metaclass=ABCMeta): - @property - @abstractmethod - def key_size(self) -> int: ... - @abstractmethod - def decrypt(self, ciphertext: bytes, padding: AsymmetricPadding) -> bytes: ... - @abstractmethod - def public_key(self) -> RSAPublicKey: ... - @abstractmethod - def sign(self, data: bytes, padding: AsymmetricPadding, algorithm: HashAlgorithm | Prehashed) -> bytes: ... - -class RSAPrivateKeyWithSerialization(RSAPrivateKey): - @abstractmethod - def private_bytes( - self, encoding: Encoding, format: PrivateFormat, encryption_algorithm: KeySerializationEncryption - ) -> bytes: ... - @abstractmethod - def private_numbers(self) -> RSAPrivateNumbers: ... - -class RSAPublicKey(metaclass=ABCMeta): - @property - @abstractmethod - def key_size(self) -> int: ... - @abstractmethod - def encrypt(self, plaintext: bytes, padding: AsymmetricPadding) -> bytes: ... - @abstractmethod - def public_bytes(self, encoding: Encoding, format: PublicFormat) -> bytes: ... - @abstractmethod - def public_numbers(self) -> RSAPublicNumbers: ... - @abstractmethod - def verifier( - self, signature: bytes, padding: AsymmetricPadding, algorithm: HashAlgorithm | Prehashed - ) -> AsymmetricVerificationContext: ... - @abstractmethod - def verify(self, signature: bytes, data: bytes, padding: AsymmetricPadding, algorithm: HashAlgorithm | Prehashed) -> None: ... - -RSAPublicKeyWithSerialization = RSAPublicKey - -def generate_private_key( - public_exponent: int, key_size: int, backend: RSABackend | None = ... -) -> RSAPrivateKeyWithSerialization: ... -def rsa_crt_iqmp(p: int, q: int) -> int: ... -def rsa_crt_dmp1(private_exponent: int, p: int) -> int: ... -def rsa_crt_dmq1(private_exponent: int, q: int) -> int: ... -def rsa_recover_prime_factors(n: int, e: int, d: int) -> tuple[int, int]: ... - -class RSAPrivateNumbers: - def __init__(self, p: int, q: int, d: int, dmp1: int, dmq1: int, iqmp: int, public_numbers: RSAPublicNumbers) -> None: ... - @property - def p(self) -> int: ... - @property - def q(self) -> int: ... - @property - def d(self) -> int: ... - @property - def dmp1(self) -> int: ... - @property - def dmq1(self) -> int: ... - @property - def iqmp(self) -> int: ... - @property - def public_numbers(self) -> RSAPublicNumbers: ... - def private_key(self, backend: RSABackend | None = ...) -> RSAPrivateKey: ... - -class RSAPublicNumbers: - def __init__(self, e: int, n: int) -> None: ... - @property - def e(self) -> int: ... - @property - def n(self) -> int: ... - def public_key(self, backend: RSABackend | None = ...) -> RSAPublicKey: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/asymmetric/utils.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/asymmetric/utils.pyi deleted file mode 100644 index 4e5fedaf9..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/asymmetric/utils.pyi +++ /dev/null @@ -1,11 +0,0 @@ -from cryptography.hazmat.primitives.hashes import HashAlgorithm - -def decode_dss_signature(signature: bytes) -> tuple[int, int]: ... -def encode_dss_signature(r: int, s: int) -> bytes: ... - -class Prehashed: - _algorithm: HashAlgorithm # undocumented - _digest_size: int # undocumented - def __init__(self, algorithm: HashAlgorithm) -> None: ... - @property - def digest_size(self) -> int: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/asymmetric/x25519.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/asymmetric/x25519.pyi deleted file mode 100644 index 245878df7..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/asymmetric/x25519.pyi +++ /dev/null @@ -1,23 +0,0 @@ -from abc import ABCMeta, abstractmethod - -from cryptography.hazmat.primitives.serialization import Encoding, KeySerializationEncryption, PrivateFormat, PublicFormat - -class X25519PrivateKey(metaclass=ABCMeta): - @classmethod - def from_private_bytes(cls, data: bytes) -> X25519PrivateKey: ... - @classmethod - def generate(cls) -> X25519PrivateKey: ... - @abstractmethod - def exchange(self, peer_public_key: X25519PublicKey) -> bytes: ... - @abstractmethod - def private_bytes( - self, encoding: Encoding, format: PrivateFormat, encryption_algorithm: KeySerializationEncryption - ) -> bytes: ... - @abstractmethod - def public_key(self) -> X25519PublicKey: ... - -class X25519PublicKey(metaclass=ABCMeta): - @classmethod - def from_public_bytes(cls, data: bytes) -> X25519PublicKey: ... - @abstractmethod - def public_bytes(self, encoding: Encoding, format: PublicFormat) -> bytes: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/asymmetric/x448.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/asymmetric/x448.pyi deleted file mode 100644 index a4620e510..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/asymmetric/x448.pyi +++ /dev/null @@ -1,23 +0,0 @@ -from abc import ABCMeta, abstractmethod - -from cryptography.hazmat.primitives.serialization import Encoding, KeySerializationEncryption, PrivateFormat, PublicFormat - -class X448PrivateKey(metaclass=ABCMeta): - @classmethod - def from_private_bytes(cls, data: bytes) -> X448PrivateKey: ... - @classmethod - def generate(cls) -> X448PrivateKey: ... - @abstractmethod - def exchange(self, peer_public_key: X448PublicKey) -> bytes: ... - @abstractmethod - def private_bytes( - self, encoding: Encoding, format: PrivateFormat, encryption_algorithm: KeySerializationEncryption - ) -> bytes: ... - @abstractmethod - def public_key(self) -> X448PublicKey: ... - -class X448PublicKey(metaclass=ABCMeta): - @classmethod - def from_public_bytes(cls, data: bytes) -> X448PublicKey: ... - @abstractmethod - def public_bytes(self, encoding: Encoding, format: PublicFormat) -> bytes: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/ciphers/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/ciphers/__init__.pyi deleted file mode 100644 index c69bde2b0..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/ciphers/__init__.pyi +++ /dev/null @@ -1,43 +0,0 @@ -from abc import ABCMeta, abstractmethod - -from cryptography.hazmat.backends.interfaces import CipherBackend -from cryptography.hazmat.primitives.ciphers.modes import Mode - -class AEADCipherContext(metaclass=ABCMeta): - @abstractmethod - def authenticate_additional_data(self, data: bytes) -> None: ... - -class AEADDecryptionContext(metaclass=ABCMeta): - @abstractmethod - def finalize_with_tag(self, tag: bytes) -> bytes: ... - -class AEADEncryptionContext(metaclass=ABCMeta): - @property - @abstractmethod - def tag(self) -> bytes: ... - -class BlockCipherAlgorithm(metaclass=ABCMeta): - @property - @abstractmethod - def block_size(self) -> int: ... - -class Cipher: - def __init__(self, algorithm: CipherAlgorithm, mode: Mode | None, backend: CipherBackend | None = ...) -> None: ... - def decryptor(self) -> CipherContext: ... - def encryptor(self) -> CipherContext: ... - -class CipherAlgorithm(metaclass=ABCMeta): - @property - @abstractmethod - def key_size(self) -> int: ... - @property - @abstractmethod - def name(self) -> str: ... - -class CipherContext(metaclass=ABCMeta): - @abstractmethod - def finalize(self) -> bytes: ... - @abstractmethod - def update(self, data: bytes) -> bytes: ... - @abstractmethod - def update_into(self, data: bytes, buf: bytearray) -> int: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/ciphers/aead.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/ciphers/aead.pyi deleted file mode 100644 index 909f701d9..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/ciphers/aead.pyi +++ /dev/null @@ -1,20 +0,0 @@ -class AESCCM: - def __init__(self, key: bytes, tag_length: int | None) -> None: ... - def decrypt(self, nonce: bytes, data: bytes, associated_data: bytes | None) -> bytes: ... - def encrypt(self, nonce: bytes, data: bytes, associated_data: bytes | None) -> bytes: ... - @classmethod - def generate_key(cls, bit_length: int) -> bytes: ... - -class AESGCM: - def __init__(self, key: bytes) -> None: ... - def decrypt(self, nonce: bytes, data: bytes, associated_data: bytes | None) -> bytes: ... - def encrypt(self, nonce: bytes, data: bytes, associated_data: bytes | None) -> bytes: ... - @classmethod - def generate_key(cls, bit_length: int) -> bytes: ... - -class ChaCha20Poly1305: - def __init__(self, key: bytes) -> None: ... - def decrypt(self, nonce: bytes, data: bytes, associated_data: bytes | None) -> bytes: ... - def encrypt(self, nonce: bytes, data: bytes, associated_data: bytes | None) -> bytes: ... - @classmethod - def generate_key(cls) -> bytes: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/ciphers/algorithms.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/ciphers/algorithms.pyi deleted file mode 100644 index 466c70b05..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/ciphers/algorithms.pyi +++ /dev/null @@ -1,74 +0,0 @@ -from cryptography.hazmat.primitives.ciphers import BlockCipherAlgorithm, CipherAlgorithm -from cryptography.hazmat.primitives.ciphers.modes import ModeWithNonce - -class AES(BlockCipherAlgorithm, CipherAlgorithm): - def __init__(self, key: bytes) -> None: ... - block_size: int = ... - name: str = ... - key_sizes: frozenset[int] = ... - @property - def key_size(self) -> int: ... - -class ARC4(CipherAlgorithm): - def __init__(self, key: bytes) -> None: ... - @property - def key_size(self) -> int: ... - name: str = ... - key_sizes: frozenset[int] = ... - -class Blowfish(BlockCipherAlgorithm, CipherAlgorithm): - def __init__(self, key: bytes) -> None: ... - @property - def key_size(self) -> int: ... - block_size: int = ... - name: str = ... - key_sizes: frozenset[int] = ... - -class Camellia(BlockCipherAlgorithm, CipherAlgorithm): - def __init__(self, key: bytes) -> None: ... - @property - def key_size(self) -> int: ... - block_size: int = ... - name: str = ... - key_sizes: frozenset[int] = ... - -class CAST5(BlockCipherAlgorithm, CipherAlgorithm): - def __init__(self, key: bytes) -> None: ... - @property - def key_size(self) -> int: ... - block_size: int = ... - name: str = ... - key_sizes: frozenset[int] = ... - -class ChaCha20(CipherAlgorithm, ModeWithNonce): - def __init__(self, key: bytes, nonce: bytes) -> None: ... - @property - def key_size(self) -> int: ... - name: str = ... - key_sizes: frozenset[int] = ... - @property - def nonce(self) -> bytes: ... - -class IDEA(CipherAlgorithm): - def __init__(self, key: bytes) -> None: ... - @property - def key_size(self) -> int: ... - block_size: int = ... - name: str = ... - key_sizes: frozenset[int] = ... - -class SEED(BlockCipherAlgorithm, CipherAlgorithm): - def __init__(self, key: bytes) -> None: ... - @property - def key_size(self) -> int: ... - block_size: int = ... - name: str = ... - key_sizes: frozenset[int] = ... - -class TripleDES(BlockCipherAlgorithm, CipherAlgorithm): - def __init__(self, key: bytes) -> None: ... - @property - def key_size(self) -> int: ... - block_size: int = ... - name: str = ... - key_sizes: frozenset[int] = ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/ciphers/modes.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/ciphers/modes.pyi deleted file mode 100644 index b99d7a89f..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/ciphers/modes.pyi +++ /dev/null @@ -1,93 +0,0 @@ -from abc import ABCMeta, abstractmethod - -from cryptography.hazmat.primitives.ciphers import CipherAlgorithm - -class Mode(metaclass=ABCMeta): - @property - @abstractmethod - def name(self) -> str: ... - @abstractmethod - def validate_for_algorithm(self, algorithm: CipherAlgorithm) -> None: ... - -class ModeWithAuthenticationTag(metaclass=ABCMeta): - @property - @abstractmethod - def tag(self) -> bytes: ... - -class ModeWithInitializationVector(metaclass=ABCMeta): - @property - @abstractmethod - def initialization_vector(self) -> bytes: ... - -class ModeWithNonce(metaclass=ABCMeta): - @property - @abstractmethod - def nonce(self) -> bytes: ... - -class ModeWithTweak(metaclass=ABCMeta): - @property - @abstractmethod - def tweak(self) -> bytes: ... - -class CBC(Mode, ModeWithInitializationVector): - def __init__(self, initialization_vector: bytes) -> None: ... - @property - def initialization_vector(self) -> bytes: ... - @property - def name(self) -> str: ... - def validate_for_algorithm(self, algorithm: CipherAlgorithm) -> None: ... - -class CTR(Mode, ModeWithNonce): - def __init__(self, nonce: bytes) -> None: ... - @property - def name(self) -> str: ... - @property - def nonce(self) -> bytes: ... - def validate_for_algorithm(self, algorithm: CipherAlgorithm) -> None: ... - -class CFB(Mode, ModeWithInitializationVector): - def __init__(self, initialization_vector: bytes) -> None: ... - @property - def initialization_vector(self) -> bytes: ... - @property - def name(self) -> str: ... - def validate_for_algorithm(self, algorithm: CipherAlgorithm) -> None: ... - -class CFB8(Mode, ModeWithInitializationVector): - def __init__(self, initialization_vector: bytes) -> None: ... - @property - def initialization_vector(self) -> bytes: ... - @property - def name(self) -> str: ... - def validate_for_algorithm(self, algorithm: CipherAlgorithm) -> None: ... - -class ECB(Mode): - @property - def name(self) -> str: ... - def validate_for_algorithm(self, algorithm: CipherAlgorithm) -> None: ... - -class GCM(Mode, ModeWithInitializationVector, ModeWithAuthenticationTag): - def __init__(self, initialization_vector: bytes, tag: bytes | None = ..., min_tag_length: int | None = ...) -> None: ... - @property - def initialization_vector(self) -> bytes: ... - @property - def name(self) -> str: ... - @property - def tag(self) -> bytes: ... - def validate_for_algorithm(self, algorithm: CipherAlgorithm) -> None: ... - -class OFB(Mode, ModeWithInitializationVector): - def __init__(self, initialization_vector: bytes) -> None: ... - @property - def initialization_vector(self) -> bytes: ... - @property - def name(self) -> str: ... - def validate_for_algorithm(self, algorithm: CipherAlgorithm) -> None: ... - -class XTS(Mode, ModeWithTweak): - def __init__(self, tweak: bytes) -> None: ... - @property - def name(self) -> str: ... - @property - def tweak(self) -> bytes: ... - def validate_for_algorithm(self, algorithm: CipherAlgorithm) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/cmac.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/cmac.pyi deleted file mode 100644 index 4be367a7a..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/cmac.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from cryptography.hazmat.backends.interfaces import CMACBackend -from cryptography.hazmat.primitives.ciphers import BlockCipherAlgorithm - -class CMAC: - def __init__(self, algorithm: BlockCipherAlgorithm, backend: CMACBackend | None = ...) -> None: ... - def copy(self) -> CMAC: ... - def finalize(self) -> bytes: ... - def update(self, data: bytes) -> None: ... - def verify(self, signature: bytes) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/constant_time.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/constant_time.pyi deleted file mode 100644 index 9a0733e6e..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/constant_time.pyi +++ /dev/null @@ -1 +0,0 @@ -def bytes_eq(a: bytes, b: bytes) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/hashes.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/hashes.pyi deleted file mode 100644 index ce4fc087b..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/hashes.pyi +++ /dev/null @@ -1,48 +0,0 @@ -from abc import ABCMeta, abstractmethod - -from cryptography.hazmat.backends.interfaces import HashBackend - -# These are actually abstractproperties on HashAlgorithm, -# but let's not worry too much about that. -class HashAlgorithm(metaclass=ABCMeta): - @property - def digest_size(self) -> int: ... - @property - def name(self) -> str: ... - -class HashContext(metaclass=ABCMeta): - @property - def algorithm(self) -> HashAlgorithm: ... - @abstractmethod - def copy(self) -> HashContext: ... - @abstractmethod - def finalize(self) -> bytes: ... - @abstractmethod - def update(self, data: bytes) -> None: ... - -class BLAKE2b(HashAlgorithm): ... -class BLAKE2s(HashAlgorithm): ... -class MD5(HashAlgorithm): ... -class SHA1(HashAlgorithm): ... -class SHA224(HashAlgorithm): ... -class SHA256(HashAlgorithm): ... -class SHA384(HashAlgorithm): ... -class SHA3_224(HashAlgorithm): ... -class SHA3_256(HashAlgorithm): ... -class SHA3_384(HashAlgorithm): ... -class SHA3_512(HashAlgorithm): ... -class SHA512(HashAlgorithm): ... -class SHA512_224(HashAlgorithm): ... -class SHA512_256(HashAlgorithm): ... - -class SHAKE128(HashAlgorithm): - def __init__(self, digest_size: int) -> None: ... - -class SHAKE256(HashAlgorithm): - def __init__(self, digest_size: int) -> None: ... - -class Hash(HashContext): - def __init__(self, algorithm: HashAlgorithm, backend: HashBackend | None = ...): ... - def copy(self) -> Hash: ... - def finalize(self) -> bytes: ... - def update(self, data: bytes) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/hmac.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/hmac.pyi deleted file mode 100644 index 768a9ecc5..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/hmac.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from cryptography.hazmat.backends.interfaces import HMACBackend -from cryptography.hazmat.primitives.hashes import HashAlgorithm - -class HMAC: - def __init__(self, key: bytes, algorithm: HashAlgorithm, backend: HMACBackend | None = ...) -> None: ... - def copy(self) -> HMAC: ... - def finalize(self) -> bytes: ... - def update(self, msg: bytes) -> None: ... - def verify(self, signature: bytes) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/kdf/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/kdf/__init__.pyi deleted file mode 100644 index 549ca9120..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/kdf/__init__.pyi +++ /dev/null @@ -1,7 +0,0 @@ -from abc import ABCMeta, abstractmethod - -class KeyDerivationFunction(metaclass=ABCMeta): - @abstractmethod - def derive(self, key_material: bytes) -> bytes: ... - @abstractmethod - def verify(self, key_material: bytes, expected_key: bytes) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/kdf/concatkdf.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/kdf/concatkdf.pyi deleted file mode 100644 index 157609c30..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/kdf/concatkdf.pyi +++ /dev/null @@ -1,20 +0,0 @@ -from cryptography.hazmat.backends.interfaces import HashBackend, HMACBackend -from cryptography.hazmat.primitives.hashes import HashAlgorithm -from cryptography.hazmat.primitives.kdf import KeyDerivationFunction - -class ConcatKDFHash(KeyDerivationFunction): - def __init__(self, algorithm: HashAlgorithm, length: int, otherinfo: bytes | None, backend: HashBackend | None = ...): ... - def derive(self, key_material: bytes) -> bytes: ... - def verify(self, key_material: bytes, expected_key: bytes) -> None: ... - -class ConcatKDFHMAC(KeyDerivationFunction): - def __init__( - self, - algorithm: HashAlgorithm, - length: int, - salt: bytes | None, - otherinfo: bytes | None, - backend: HMACBackend | None = ..., - ): ... - def derive(self, key_material: bytes) -> bytes: ... - def verify(self, key_material: bytes, expected_key: bytes) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/kdf/hkdf.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/kdf/hkdf.pyi deleted file mode 100644 index 95cae782c..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/kdf/hkdf.pyi +++ /dev/null @@ -1,15 +0,0 @@ -from cryptography.hazmat.backends.interfaces import HMACBackend -from cryptography.hazmat.primitives.hashes import HashAlgorithm -from cryptography.hazmat.primitives.kdf import KeyDerivationFunction - -class HKDF(KeyDerivationFunction): - def __init__( - self, algorithm: HashAlgorithm, length: int, salt: bytes | None, info: bytes | None, backend: HMACBackend | None = ... - ): ... - def derive(self, key_material: bytes) -> bytes: ... - def verify(self, key_material: bytes, expected_key: bytes) -> None: ... - -class HKDFExpand(KeyDerivationFunction): - def __init__(self, algorithm: HashAlgorithm, length: int, info: bytes | None, backend: HMACBackend | None = ...): ... - def derive(self, key_material: bytes) -> bytes: ... - def verify(self, key_material: bytes, expected_key: bytes) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/kdf/kbkdf.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/kdf/kbkdf.pyi deleted file mode 100644 index 375ef66a8..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/kdf/kbkdf.pyi +++ /dev/null @@ -1,29 +0,0 @@ -from enum import Enum - -from cryptography.hazmat.backends.interfaces import HMACBackend -from cryptography.hazmat.primitives.hashes import HashAlgorithm -from cryptography.hazmat.primitives.kdf import KeyDerivationFunction - -class Mode(Enum): - CounterMode: str - -class CounterLocation(Enum): - BeforeFixed: str - AfterFixed: str - -class KBKDFHMAC(KeyDerivationFunction): - def __init__( - self, - algorithm: HashAlgorithm, - mode: Mode, - length: int, - rlen: int, - llen: int, - location: CounterLocation, - label: bytes | None, - context: bytes | None, - fixed: bytes | None, - backend: HMACBackend | None = ..., - ): ... - def derive(self, key_material: bytes) -> bytes: ... - def verify(self, key_material: bytes, expected_key: bytes) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/kdf/pbkdf2.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/kdf/pbkdf2.pyi deleted file mode 100644 index 805450a1c..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/kdf/pbkdf2.pyi +++ /dev/null @@ -1,10 +0,0 @@ -from cryptography.hazmat.backends.interfaces import PBKDF2HMACBackend -from cryptography.hazmat.primitives.hashes import HashAlgorithm -from cryptography.hazmat.primitives.kdf import KeyDerivationFunction - -class PBKDF2HMAC(KeyDerivationFunction): - def __init__( - self, algorithm: HashAlgorithm, length: int, salt: bytes, iterations: int, backend: PBKDF2HMACBackend | None = ... - ): ... - def derive(self, key_material: bytes) -> bytes: ... - def verify(self, key_material: bytes, expected_key: bytes) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/kdf/scrypt.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/kdf/scrypt.pyi deleted file mode 100644 index cd426b0e2..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/kdf/scrypt.pyi +++ /dev/null @@ -1,7 +0,0 @@ -from cryptography.hazmat.backends.interfaces import ScryptBackend -from cryptography.hazmat.primitives.kdf import KeyDerivationFunction - -class Scrypt(KeyDerivationFunction): - def __init__(self, salt: bytes, length: int, n: int, r: int, p: int, backend: ScryptBackend | None = ...): ... - def derive(self, key_material: bytes) -> bytes: ... - def verify(self, key_material: bytes, expected_key: bytes) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/kdf/x963kdf.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/kdf/x963kdf.pyi deleted file mode 100644 index af74f2c07..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/kdf/x963kdf.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from cryptography.hazmat.backends.interfaces import HashBackend -from cryptography.hazmat.primitives.hashes import HashAlgorithm -from cryptography.hazmat.primitives.kdf import KeyDerivationFunction - -class X963KDF(KeyDerivationFunction): - def __init__(self, algorithm: HashAlgorithm, length: int, sharedinfo: bytes | None, backend: HashBackend | None = ...): ... - def derive(self, key_material: bytes) -> bytes: ... - def verify(self, key_material: bytes, expected_key: bytes) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/keywrap.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/keywrap.pyi deleted file mode 100644 index 33ca77d79..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/keywrap.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from cryptography.hazmat.backends.interfaces import CipherBackend - -def aes_key_wrap(wrapping_key: bytes, key_to_wrap: bytes, backend: CipherBackend | None = ...) -> bytes: ... -def aes_key_wrap_with_padding(wrapping_key: bytes, key_to_wrap: bytes, backend: CipherBackend | None = ...) -> bytes: ... -def aes_key_unwrap(wrapping_key: bytes, wrapped_key: bytes, backend: CipherBackend | None = ...) -> bytes: ... -def aes_key_unwrap_with_padding(wrapping_key: bytes, wrapped_key: bytes, backend: CipherBackend | None = ...) -> bytes: ... - -class InvalidUnwrap(Exception): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/padding.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/padding.pyi deleted file mode 100644 index fd5a2b173..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/padding.pyi +++ /dev/null @@ -1,17 +0,0 @@ -from abc import ABCMeta, abstractmethod - -class PaddingContext(metaclass=ABCMeta): - @abstractmethod - def finalize(self) -> bytes: ... - @abstractmethod - def update(self, data: bytes) -> bytes: ... - -class ANSIX923: - def __init__(self, block_size: int) -> None: ... - def padder(self) -> PaddingContext: ... - def unpadder(self) -> PaddingContext: ... - -class PKCS7: - def __init__(self, block_size: int) -> None: ... - def padder(self) -> PaddingContext: ... - def unpadder(self) -> PaddingContext: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/poly1305.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/poly1305.pyi deleted file mode 100644 index a854709f5..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/poly1305.pyi +++ /dev/null @@ -1,9 +0,0 @@ -class Poly1305: - def __init__(self, key: bytes) -> None: ... - def finalize(self) -> bytes: ... - @classmethod - def generate_tag(cls, key: bytes, data: bytes) -> bytes: ... - def update(self, data: bytes) -> None: ... - def verify(self, tag: bytes) -> None: ... - @classmethod - def verify_tag(cls, key: bytes, data: bytes, tag: bytes) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/serialization/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/serialization/__init__.pyi deleted file mode 100644 index e899766b7..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/serialization/__init__.pyi +++ /dev/null @@ -1,60 +0,0 @@ -from abc import ABCMeta -from enum import Enum -from typing import Any - -from cryptography.hazmat.backends.interfaces import ( - DERSerializationBackend, - DSABackend, - EllipticCurveBackend, - PEMSerializationBackend, - RSABackend, -) - -def load_pem_private_key( - data: bytes, password: bytes | None, backend: PEMSerializationBackend | None = ... -) -> Any: ... # actually RSAPrivateKey | DSAPrivateKey | DHPrivateKey | EllipticCurvePrivateKey -def load_pem_public_key( - data: bytes, backend: PEMSerializationBackend | None = ... -) -> Any: ... # actually RSAPublicKey | DSAPublicKey | DHPublicKey | EllipticCurvePublicKey -def load_der_private_key( - data: bytes, password: bytes | None, backend: DERSerializationBackend | None = ... -) -> Any: ... # actually RSAPrivateKey | DSAPrivateKey | DHPrivateKey | EllipticCurvePrivateKey -def load_der_public_key( - data: bytes, backend: DERSerializationBackend | None = ... -) -> Any: ... # actually RSAPublicKey | DSAPublicKey | DHPublicKey | EllipticCurvePublicKey -def load_ssh_public_key( - data: bytes, backend: RSABackend | DSABackend | EllipticCurveBackend | None = ... -) -> Any: ... # actually RSAPublicKey | DSAPublicKey | DHPublicKey | EllipticCurvePublicKey | Ed25519PublicKey - -class Encoding(Enum): - PEM: str - DER: str - OpenSSH: str - Raw: str - X962: str - SMIME: str - -class PrivateFormat(Enum): - PKCS8: str - TraditionalOpenSSL: str - Raw: str - OpenSSH: str - -class PublicFormat(Enum): - SubjectPublicKeyInfo: str - PKCS1: str - OpenSSH: str - Raw: str - CompressedPoint: str - UncompressedPoint: str - -class ParameterFormat(Enum): - PKCS3: str - -class KeySerializationEncryption(metaclass=ABCMeta): ... - -class BestAvailableEncryption(KeySerializationEncryption): - password: bytes - def __init__(self, password: bytes) -> None: ... - -class NoEncryption(KeySerializationEncryption): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/serialization/pkcs12.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/serialization/pkcs12.pyi deleted file mode 100644 index 72c91f7a6..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/serialization/pkcs12.pyi +++ /dev/null @@ -1,18 +0,0 @@ -from typing import Any - -from cryptography.hazmat.primitives.asymmetric.dsa import DSAPrivateKeyWithSerialization -from cryptography.hazmat.primitives.asymmetric.ec import EllipticCurvePrivateKeyWithSerialization -from cryptography.hazmat.primitives.asymmetric.rsa import RSAPrivateKeyWithSerialization -from cryptography.hazmat.primitives.serialization import KeySerializationEncryption -from cryptography.x509 import Certificate - -def load_key_and_certificates( - data: bytes, password: bytes | None, backend: Any | None = ... -) -> tuple[Any | None, Certificate | None, list[Certificate]]: ... -def serialize_key_and_certificates( - name: bytes, - key: RSAPrivateKeyWithSerialization | EllipticCurvePrivateKeyWithSerialization | DSAPrivateKeyWithSerialization, - cert: Certificate | None, - cas: list[Certificate] | None, - enc: KeySerializationEncryption, -) -> bytes: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/serialization/pkcs7.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/serialization/pkcs7.pyi deleted file mode 100644 index 3bf5678a4..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/serialization/pkcs7.pyi +++ /dev/null @@ -1,31 +0,0 @@ -from collections.abc import Iterable -from enum import Enum -from typing import Any - -from cryptography.hazmat.primitives.asymmetric.ec import EllipticCurvePrivateKey -from cryptography.hazmat.primitives.asymmetric.rsa import RSAPrivateKey -from cryptography.hazmat.primitives.hashes import SHA1, SHA224, SHA256, SHA384, SHA512 -from cryptography.hazmat.primitives.serialization import Encoding -from cryptography.x509 import Certificate - -def load_pem_pkcs7_certificates(data: bytes) -> list[Certificate]: ... -def load_der_pkcs7_certificates(data: bytes) -> list[Certificate]: ... - -class PKCS7Options(Enum): - Text: str - Binary: str - DetachedSignature: str - NoCapabilities: str - NoAttributes: str - NoCerts: str - -class PKCS7SignatureBuilder: - def set_data(self, data: bytes) -> PKCS7SignatureBuilder: ... - def add_signer( - self, - certificate: Certificate, - private_key: RSAPrivateKey | EllipticCurvePrivateKey, - hash_algorithm: SHA1 | SHA224 | SHA256 | SHA384 | SHA512, - ) -> PKCS7SignatureBuilder: ... - def add_certificate(self, certificate: Certificate) -> PKCS7SignatureBuilder: ... - def sign(self, encoding: Encoding, options: Iterable[PKCS7Options], backend: Any | None = ...) -> bytes: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/twofactor/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/twofactor/__init__.pyi deleted file mode 100644 index eff812f2a..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/twofactor/__init__.pyi +++ /dev/null @@ -1 +0,0 @@ -class InvalidToken(Exception): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/twofactor/hotp.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/twofactor/hotp.pyi deleted file mode 100644 index 1c0272cbc..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/twofactor/hotp.pyi +++ /dev/null @@ -1,10 +0,0 @@ -from cryptography.hazmat.backends.interfaces import HMACBackend -from cryptography.hazmat.primitives.hashes import HashAlgorithm - -class HOTP: - def __init__( - self, key: bytes, length: int, algorithm: HashAlgorithm, backend: HMACBackend | None = ..., enforce_key_length: bool = ... - ): ... - def generate(self, counter: int) -> bytes: ... - def get_provisioning_uri(self, account_name: str, counter: int, issuer: str | None) -> str: ... - def verify(self, hotp: bytes, counter: int) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/twofactor/totp.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/twofactor/totp.pyi deleted file mode 100644 index 37c4c0ef9..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/hazmat/primitives/twofactor/totp.pyi +++ /dev/null @@ -1,16 +0,0 @@ -from cryptography.hazmat.backends.interfaces import HMACBackend -from cryptography.hazmat.primitives.hashes import HashAlgorithm - -class TOTP: - def __init__( - self, - key: bytes, - length: int, - algorithm: HashAlgorithm, - time_step: int, - backend: HMACBackend | None = ..., - enforce_key_length: bool = ..., - ): ... - def generate(self, time: int) -> bytes: ... - def get_provisioning_uri(self, account_name: str, issuer: str | None) -> str: ... - def verify(self, totp: bytes, time: int) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/x509/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/x509/__init__.pyi deleted file mode 100644 index 0d0610157..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/x509/__init__.pyi +++ /dev/null @@ -1,468 +0,0 @@ -import datetime -from _typeshed import Self -from abc import ABCMeta, abstractmethod -from collections.abc import Generator, Iterable, Sequence -from enum import Enum -from ipaddress import IPv4Address, IPv4Network, IPv6Address, IPv6Network -from typing import Any, ClassVar, Generic, TypeVar - -from cryptography.hazmat.backends.interfaces import X509Backend -from cryptography.hazmat.primitives.asymmetric.dsa import DSAPrivateKey, DSAPublicKey -from cryptography.hazmat.primitives.asymmetric.ec import EllipticCurvePrivateKey, EllipticCurvePublicKey -from cryptography.hazmat.primitives.asymmetric.ed448 import Ed448PrivateKey, Ed448PublicKey -from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PrivateKey, Ed25519PublicKey -from cryptography.hazmat.primitives.asymmetric.rsa import RSAPrivateKey, RSAPublicKey -from cryptography.hazmat.primitives.hashes import HashAlgorithm -from cryptography.hazmat.primitives.serialization import Encoding - -class ObjectIdentifier: - @property - def dotted_string(self) -> str: ... - def __init__(self, dotted_string: str) -> None: ... - -class CRLEntryExtensionOID: - CERTIFICATE_ISSUER: ClassVar[ObjectIdentifier] - CRL_REASON: ClassVar[ObjectIdentifier] - INVALIDITY_DATE: ClassVar[ObjectIdentifier] - -class ExtensionOID: - AUTHORITY_INFORMATION_ACCESS: ClassVar[ObjectIdentifier] - AUTHORITY_KEY_IDENTIFIER: ClassVar[ObjectIdentifier] - BASIC_CONSTRAINTS: ClassVar[ObjectIdentifier] - CERTIFICATE_POLICIES: ClassVar[ObjectIdentifier] - CRL_DISTRIBUTION_POINTS: ClassVar[ObjectIdentifier] - CRL_NUMBER: ClassVar[ObjectIdentifier] - DELTA_CRL_INDICATOR: ClassVar[ObjectIdentifier] - EXTENDED_KEY_USAGE: ClassVar[ObjectIdentifier] - FRESHEST_CRL: ClassVar[ObjectIdentifier] - INHIBIT_ANY_POLICY: ClassVar[ObjectIdentifier] - ISSUER_ALTERNATIVE_NAME: ClassVar[ObjectIdentifier] - ISSUING_DISTRIBUTION_POINT: ClassVar[ObjectIdentifier] - KEY_USAGE: ClassVar[ObjectIdentifier] - NAME_CONSTRAINTS: ClassVar[ObjectIdentifier] - OCSP_NO_CHECK: ClassVar[ObjectIdentifier] - POLICY_CONSTRAINTS: ClassVar[ObjectIdentifier] - POLICY_MAPPINGS: ClassVar[ObjectIdentifier] - PRECERT_POISON: ClassVar[ObjectIdentifier] - PRECERT_SIGNED_CERTIFICATE_TIMESTAMPS: ClassVar[ObjectIdentifier] - SUBJECT_ALTERNATIVE_NAME: ClassVar[ObjectIdentifier] - SUBJECT_DIRECTORY_ATTRIBUTES: ClassVar[ObjectIdentifier] - SUBJECT_INFORMATION_ACCESS: ClassVar[ObjectIdentifier] - SUBJECT_KEY_IDENTIFIER: ClassVar[ObjectIdentifier] - TLS_FEATURE: ClassVar[ObjectIdentifier] - -class NameOID: - BUSINESS_CATEGORY: ClassVar[ObjectIdentifier] - COMMON_NAME: ClassVar[ObjectIdentifier] - COUNTRY_NAME: ClassVar[ObjectIdentifier] - DN_QUALIFIER: ClassVar[ObjectIdentifier] - DOMAIN_COMPONENT: ClassVar[ObjectIdentifier] - EMAIL_ADDRESS: ClassVar[ObjectIdentifier] - GENERATION_QUALIFIER: ClassVar[ObjectIdentifier] - GIVEN_NAME: ClassVar[ObjectIdentifier] - JURISDICTION_COUNTRY_NAME: ClassVar[ObjectIdentifier] - JURISDICTION_LOCALITY_NAME: ClassVar[ObjectIdentifier] - JURISDICTION_STATE_OR_PROVINCE_NAME: ClassVar[ObjectIdentifier] - LOCALITY_NAME: ClassVar[ObjectIdentifier] - ORGANIZATIONAL_UNIT_NAME: ClassVar[ObjectIdentifier] - ORGANIZATION_NAME: ClassVar[ObjectIdentifier] - POSTAL_ADDRESS: ClassVar[ObjectIdentifier] - POSTAL_CODE: ClassVar[ObjectIdentifier] - PSEUDONYM: ClassVar[ObjectIdentifier] - SERIAL_NUMBER: ClassVar[ObjectIdentifier] - STATE_OR_PROVINCE_NAME: ClassVar[ObjectIdentifier] - STREET_ADDRESS: ClassVar[ObjectIdentifier] - SURNAME: ClassVar[ObjectIdentifier] - TITLE: ClassVar[ObjectIdentifier] - USER_ID: ClassVar[ObjectIdentifier] - X500_UNIQUE_IDENTIFIER: ClassVar[ObjectIdentifier] - -class OCSPExtensionOID: - NONCE: ClassVar[ObjectIdentifier] - -class SignatureAlgorithmOID: - DSA_WITH_SHA1: ClassVar[ObjectIdentifier] - DSA_WITH_SHA224: ClassVar[ObjectIdentifier] - DSA_WITH_SHA256: ClassVar[ObjectIdentifier] - ECDSA_WITH_SHA1: ClassVar[ObjectIdentifier] - ECDSA_WITH_SHA224: ClassVar[ObjectIdentifier] - ECDSA_WITH_SHA256: ClassVar[ObjectIdentifier] - ECDSA_WITH_SHA384: ClassVar[ObjectIdentifier] - ECDSA_WITH_SHA512: ClassVar[ObjectIdentifier] - ED25519: ClassVar[ObjectIdentifier] - ED448: ClassVar[ObjectIdentifier] - RSASSA_PSS: ClassVar[ObjectIdentifier] - RSA_WITH_MD5: ClassVar[ObjectIdentifier] - RSA_WITH_SHA1: ClassVar[ObjectIdentifier] - RSA_WITH_SHA224: ClassVar[ObjectIdentifier] - RSA_WITH_SHA256: ClassVar[ObjectIdentifier] - RSA_WITH_SHA384: ClassVar[ObjectIdentifier] - RSA_WITH_SHA512: ClassVar[ObjectIdentifier] - -class ExtendedKeyUsageOID: - SERVER_AUTH: ClassVar[ObjectIdentifier] - CLIENT_AUTH: ClassVar[ObjectIdentifier] - CODE_SIGNING: ClassVar[ObjectIdentifier] - EMAIL_PROTECTION: ClassVar[ObjectIdentifier] - TIME_STAMPING: ClassVar[ObjectIdentifier] - OCSP_SIGNING: ClassVar[ObjectIdentifier] - ANY_EXTENDED_KEY_USAGE: ClassVar[ObjectIdentifier] - -class NameAttribute: - @property - def oid(self) -> ObjectIdentifier: ... - @property - def value(self) -> str: ... - def __init__(self, oid: ObjectIdentifier, value: str) -> None: ... - def rfc4514_string(self) -> str: ... - -class RelativeDistinguishedName: - def __init__(self, attributes: list[NameAttribute]) -> None: ... - def __iter__(self) -> Generator[NameAttribute, None, None]: ... - def get_attributes_for_oid(self, oid: ObjectIdentifier) -> list[NameAttribute]: ... - def rfc4514_string(self) -> str: ... - -class Name: - @property - def rdns(self) -> list[RelativeDistinguishedName]: ... - def __init__(self, attributes: Sequence[NameAttribute | RelativeDistinguishedName]) -> None: ... - def __iter__(self) -> Generator[NameAttribute, None, None]: ... - def __len__(self) -> int: ... - def get_attributes_for_oid(self, oid: ObjectIdentifier) -> list[NameAttribute]: ... - def public_bytes(self, backend: X509Backend | None = ...) -> bytes: ... - def rfc4514_string(self) -> str: ... - -class Version(Enum): - v1: int - v3: int - -# These are actually abstractproperties on Certificate, -# but let's not worry too much about that -class Certificate(metaclass=ABCMeta): - @property - def extensions(self) -> Extensions: ... - @property - def issuer(self) -> Name: ... - @property - def not_valid_after(self) -> datetime.datetime: ... - @property - def not_valid_before(self) -> datetime.datetime: ... - @property - def serial_number(self) -> int: ... - @property - def signature(self) -> bytes: ... - @property - def signature_algorithm_oid(self) -> ObjectIdentifier: ... - @property - def signature_hash_algorithm(self) -> HashAlgorithm: ... - @property - def tbs_certificate_bytes(self) -> bytes: ... - @property - def subject(self) -> Name: ... - @property - def version(self) -> Version: ... - @abstractmethod - def fingerprint(self, algorithm: HashAlgorithm) -> bytes: ... - @abstractmethod - def public_bytes(self, encoding: Encoding) -> bytes: ... - @abstractmethod - def public_key(self) -> DSAPublicKey | Ed25519PublicKey | Ed448PublicKey | EllipticCurvePublicKey | RSAPublicKey: ... - -class CertificateBuilder: - def __init__( - self, - issuer_name: Name | None = ..., - subject_name: Name | None = ..., - public_key: DSAPublicKey | Ed25519PublicKey | Ed448PublicKey | EllipticCurvePublicKey | RSAPublicKey | None = ..., - serial_number: int | None = ..., - not_valid_before: datetime.datetime | None = ..., - not_valid_after: datetime.datetime | None = ..., - extensions: Iterable[ExtensionType] | None = ..., - ) -> None: ... - def add_extension(self, extension: ExtensionType, critical: bool) -> CertificateBuilder: ... - def issuer_name(self, name: Name) -> CertificateBuilder: ... - def not_valid_after(self, time: datetime.datetime) -> CertificateBuilder: ... - def not_valid_before(self, time: datetime.datetime) -> CertificateBuilder: ... - def public_key( - self, public_key: DSAPublicKey | Ed25519PublicKey | Ed448PublicKey | EllipticCurvePublicKey | RSAPublicKey - ) -> CertificateBuilder: ... - def serial_number(self, serial_number: int) -> CertificateBuilder: ... - def sign( - self, - private_key: DSAPrivateKey | Ed25519PrivateKey | Ed448PrivateKey | EllipticCurvePrivateKey | RSAPrivateKey, - algorithm: HashAlgorithm | None, - backend: X509Backend | None = ..., - ) -> Certificate: ... - def subject_name(self, name: Name) -> CertificateBuilder: ... - -class CertificateRevocationList(metaclass=ABCMeta): - @property - def extensions(self) -> Extensions: ... - @property - def issuer(self) -> Name: ... - @property - def last_update(self) -> datetime.datetime: ... - @property - def next_update(self) -> datetime.datetime: ... - @property - def signature(self) -> bytes: ... - @property - def signature_algorithm_oid(self) -> ObjectIdentifier: ... - @property - def signature_hash_algorithm(self) -> HashAlgorithm: ... - @property - def tbs_certlist_bytes(self) -> bytes: ... - @abstractmethod - def fingerprint(self, algorithm: HashAlgorithm) -> bytes: ... - @abstractmethod - def get_revoked_certificate_by_serial_number(self, serial_number: int) -> RevokedCertificate: ... - @abstractmethod - def is_signature_valid( - self, public_key: DSAPublicKey | Ed25519PublicKey | Ed448PublicKey | EllipticCurvePublicKey | RSAPublicKey - ) -> bool: ... - @abstractmethod - def public_bytes(self, encoding: Encoding) -> bytes: ... - -class CertificateRevocationListBuilder: - def add_extension(self, extension: ExtensionType, critical: bool) -> CertificateRevocationListBuilder: ... - def add_revoked_certificate(self, revoked_certificate: RevokedCertificate) -> CertificateRevocationListBuilder: ... - def issuer_name(self, name: Name) -> CertificateRevocationListBuilder: ... - def last_update(self, time: datetime.datetime) -> CertificateRevocationListBuilder: ... - def next_update(self, time: datetime.datetime) -> CertificateRevocationListBuilder: ... - def sign( - self, - private_key: DSAPrivateKey | Ed25519PrivateKey | Ed448PrivateKey | EllipticCurvePrivateKey | RSAPrivateKey, - algorithm: HashAlgorithm | None, - backend: X509Backend | None = ..., - ) -> CertificateRevocationList: ... - -class CertificateSigningRequest(metaclass=ABCMeta): - @property - def extensions(self) -> Extensions: ... - @property - def is_signature_valid(self) -> bool: ... - @property - def signature(self) -> bytes: ... - @property - def signature_algorithm_oid(self) -> ObjectIdentifier: ... - @property - def signature_hash_algorithm(self) -> HashAlgorithm: ... - @property - def subject(self) -> Name: ... - @property - def tbs_certrequest_bytes(self) -> bytes: ... - @abstractmethod - def public_bytes(self, encoding: Encoding) -> bytes: ... - @abstractmethod - def public_key(self) -> DSAPublicKey | Ed25519PublicKey | Ed448PublicKey | EllipticCurvePublicKey | RSAPublicKey: ... - -class CertificateSigningRequestBuilder: - def add_extension(self, extension: ExtensionType, critical: bool) -> CertificateSigningRequestBuilder: ... - def subject_name(self, name: Name) -> CertificateSigningRequestBuilder: ... - def sign( - self, - private_key: DSAPrivateKey | Ed25519PrivateKey | Ed448PrivateKey | EllipticCurvePrivateKey | RSAPrivateKey, - algorithm: HashAlgorithm | None, - backend: X509Backend | None = ..., - ) -> CertificateSigningRequest: ... - -class RevokedCertificate(metaclass=ABCMeta): - @property - def extensions(self) -> Extensions: ... - @property - def revocation_date(self) -> datetime.datetime: ... - @property - def serial_number(self) -> int: ... - -class RevokedCertificateBuilder: - def add_extension(self, extension: ExtensionType, critical: bool) -> RevokedCertificateBuilder: ... - def build(self, backend: X509Backend | None = ...) -> RevokedCertificate: ... - def revocation_date(self, time: datetime.datetime) -> RevokedCertificateBuilder: ... - def serial_number(self, serial_number: int) -> RevokedCertificateBuilder: ... - -# General Name Classes - -class GeneralName(metaclass=ABCMeta): - @property - def value(self): ... - -class DirectoryName(GeneralName): - @property - def value(self) -> Name: ... - def __init__(self, value: Name) -> None: ... - -class DNSName(GeneralName): - @property - def value(self) -> str: ... - def __init__(self, value: str) -> None: ... - -class IPAddress(GeneralName): - @property - def value(self) -> IPv4Address | IPv6Address | IPv4Network | IPv6Network: ... - def __init__(self, value: IPv4Address | IPv6Address | IPv4Network | IPv6Network) -> None: ... - -class OtherName(GeneralName): - @property - def type_id(self) -> ObjectIdentifier: ... - @property - def value(self) -> bytes: ... - def __init__(self, type_id: ObjectIdentifier, value: bytes) -> None: ... - -class RegisteredID(GeneralName): - @property - def value(self) -> ObjectIdentifier: ... - def __init__(self, value: ObjectIdentifier) -> None: ... - -class RFC822Name(GeneralName): - @property - def value(self) -> str: ... - def __init__(self, value: str) -> None: ... - -class UniformResourceIdentifier(GeneralName): - @property - def value(self) -> str: ... - def __init__(self, value: str) -> None: ... - -# X.509 Extensions - -class ExtensionType(metaclass=ABCMeta): - oid: ObjectIdentifier - -_T = TypeVar("_T", bound=ExtensionType) - -class Extension(Generic[_T]): - @property - def critical(self) -> bool: ... - @property - def oid(self) -> ObjectIdentifier: ... - @property - def value(self) -> _T: ... - -class Extensions: - def __init__(self, general_names: list[Extension[Any]]) -> None: ... - def __iter__(self) -> Generator[Extension[Any], None, None]: ... - def get_extension_for_oid(self, oid: ObjectIdentifier) -> Extension[Any]: ... - def get_extension_for_class(self, extclass: type[_T]) -> Extension[_T]: ... - -class DuplicateExtension(Exception): - oid: ObjectIdentifier - def __init__(self, msg: str, oid: ObjectIdentifier) -> None: ... - -class ExtensionNotFound(Exception): - oid: ObjectIdentifier - def __init__(self, msg: str, oid: ObjectIdentifier) -> None: ... - -class IssuerAlternativeName(ExtensionType): - def __init__(self, general_names: list[GeneralName]) -> None: ... - def __iter__(self) -> Generator[GeneralName, None, None]: ... - def get_values_for_type(self, type: type[GeneralName]) -> list[Any]: ... - -class SubjectAlternativeName(ExtensionType): - def __init__(self, general_names: list[GeneralName]) -> None: ... - def __iter__(self) -> Generator[GeneralName, None, None]: ... - def get_values_for_type(self, type: type[GeneralName]) -> list[Any]: ... - -class AuthorityKeyIdentifier(ExtensionType): - @property - def key_identifier(self) -> bytes: ... - @property - def authority_cert_issuer(self) -> list[GeneralName] | None: ... - @property - def authority_cert_serial_number(self) -> int | None: ... - def __init__( - self, key_identifier: bytes, authority_cert_issuer: Iterable[GeneralName] | None, authority_cert_serial_number: int | None - ) -> None: ... - @classmethod - def from_issuer_public_key( - cls: type[Self], public_key: RSAPublicKey | DSAPublicKey | EllipticCurvePublicKey | Ed25519PublicKey | Ed448PublicKey - ) -> Self: ... - @classmethod - def from_issuer_subject_key_identifier(cls: type[Self], ski: SubjectKeyIdentifier) -> Self: ... - -class SubjectKeyIdentifier(ExtensionType): - @property - def digest(self) -> bytes: ... - def __init__(self, digest: bytes) -> None: ... - @classmethod - def from_public_key( - cls: type[Self], public_key: RSAPublicKey | DSAPublicKey | EllipticCurvePublicKey | Ed25519PublicKey | Ed448PublicKey - ) -> Self: ... - -class AccessDescription: - @property - def access_method(self) -> ObjectIdentifier: ... - @property - def access_location(self) -> GeneralName: ... - def __init__(self, access_method: ObjectIdentifier, access_location: GeneralName) -> None: ... - -class AuthorityInformationAccess(ExtensionType): - def __init__(self, descriptions: Iterable[AccessDescription]) -> None: ... - def __len__(self) -> int: ... - def __iter__(self) -> Generator[AccessDescription, None, None]: ... - def __getitem__(self, item: int) -> AccessDescription: ... - -class SubjectInformationAccess(ExtensionType): - def __init__(self, descriptions: Iterable[AccessDescription]) -> None: ... - def __len__(self) -> int: ... - def __iter__(self) -> Generator[AccessDescription, None, None]: ... - def __getitem__(self, item: int) -> AccessDescription: ... - -class BasicConstraints(ExtensionType): - @property - def ca(self) -> bool: ... - @property - def path_length(self) -> int | None: ... - def __init__(self, ca: bool, path_length: int | None) -> None: ... - -class KeyUsage(ExtensionType): - @property - def digital_signature(self) -> bool: ... - @property - def content_commitment(self) -> bool: ... - @property - def key_encipherment(self) -> bool: ... - @property - def data_encipherment(self) -> bool: ... - @property - def key_agreement(self) -> bool: ... - @property - def key_cert_sign(self) -> bool: ... - @property - def crl_sign(self) -> bool: ... - @property - def encipher_only(self) -> bool: ... - @property - def decipher_only(self) -> bool: ... - def __init__( - self, - digital_signature: bool, - content_commitment: bool, - key_encipherment: bool, - data_encipherment: bool, - key_agreement: bool, - key_cert_sign: bool, - crl_sign: bool, - encipher_only: bool, - decipher_only: bool, - ) -> None: ... - -class ExtendedKeyUsage(ExtensionType): - def __init__(self, usages: Iterable[ObjectIdentifier]) -> None: ... - def __len__(self) -> int: ... - def __iter__(self) -> Generator[ObjectIdentifier, None, None]: ... - def __getitem__(self, item: int) -> ObjectIdentifier: ... - -class UnrecognizedExtension(ExtensionType): - @property - def value(self) -> bytes: ... - @property - def oid(self) -> ObjectIdentifier: ... # type: ignore[override] - def __init__(self, oid: ObjectIdentifier, value: bytes) -> None: ... - -def load_der_x509_certificate(data: bytes, backend: X509Backend | None = ...) -> Certificate: ... -def load_pem_x509_certificate(data: bytes, backend: X509Backend | None = ...) -> Certificate: ... -def load_der_x509_crl(data: bytes, backend: X509Backend | None = ...) -> CertificateRevocationList: ... -def load_pem_x509_crl(data: bytes, backend: X509Backend | None = ...) -> CertificateRevocationList: ... -def load_der_x509_csr(data: bytes, backend: X509Backend | None = ...) -> CertificateSigningRequest: ... -def load_pem_x509_csr(data: bytes, backend: X509Backend | None = ...) -> CertificateSigningRequest: ... -def __getattr__(name: str) -> Any: ... # incomplete diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/x509/extensions.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/x509/extensions.pyi deleted file mode 100644 index 207f3bb61..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/x509/extensions.pyi +++ /dev/null @@ -1,26 +0,0 @@ -from collections.abc import Iterator - -from cryptography.x509 import GeneralName, ObjectIdentifier - -class Extension: - @property - def value(self): ... - -class GeneralNames: - def __iter__(self) -> Iterator[GeneralName]: ... - -class DistributionPoint: - @property - def full_name(self) -> GeneralNames: ... - -class CRLDistributionPoints: - def __iter__(self) -> Iterator[DistributionPoint]: ... - -class AccessDescription: - @property - def access_method(self) -> ObjectIdentifier: ... - @property - def access_location(self) -> GeneralName: ... - -class AuthorityInformationAccess: - def __iter__(self) -> Iterator[AccessDescription]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/x509/oid.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/x509/oid.pyi deleted file mode 100644 index 43dd1e206..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/cryptography/cryptography/x509/oid.pyi +++ /dev/null @@ -1,103 +0,0 @@ -from cryptography.hazmat.primitives.hashes import HashAlgorithm -from cryptography.x509 import ObjectIdentifier - -class ExtensionOID: - SUBJECT_DIRECTORY_ATTRIBUTES: ObjectIdentifier = ... - SUBJECT_KEY_IDENTIFIER: ObjectIdentifier = ... - KEY_USAGE: ObjectIdentifier = ... - SUBJECT_ALTERNATIVE_NAME: ObjectIdentifier = ... - ISSUER_ALTERNATIVE_NAME: ObjectIdentifier = ... - BASIC_CONSTRAINTS: ObjectIdentifier = ... - NAME_CONSTRAINTS: ObjectIdentifier = ... - CRL_DISTRIBUTION_POINTS: ObjectIdentifier = ... - CERTIFICATE_POLICIES: ObjectIdentifier = ... - POLICY_MAPPINGS: ObjectIdentifier = ... - AUTHORITY_KEY_IDENTIFIER: ObjectIdentifier = ... - POLICY_CONSTRAINTS: ObjectIdentifier = ... - EXTENDED_KEY_USAGE: ObjectIdentifier = ... - FRESHEST_CRL: ObjectIdentifier = ... - INHIBIT_ANY_POLICY: ObjectIdentifier = ... - ISSUING_DISTRIBUTION_POINT: ObjectIdentifier = ... - AUTHORITY_INFORMATION_ACCESS: ObjectIdentifier = ... - SUBJECT_INFORMATION_ACCESS: ObjectIdentifier = ... - OCSP_NO_CHECK: ObjectIdentifier = ... - TLS_FEATURE: ObjectIdentifier = ... - CRL_NUMBER: ObjectIdentifier = ... - DELTA_CRL_INDICATOR: ObjectIdentifier = ... - PRECERT_SIGNED_CERTIFICATE_TIMESTAMPS: ObjectIdentifier = ... - PRECERT_POISON: ObjectIdentifier = ... - -class OCSPExtensionOID: - NONCE: ObjectIdentifier = ... - -class CRLEntryExtensionOID: - CERTIFICATE_ISSUER: ObjectIdentifier = ... - CRL_REASON: ObjectIdentifier = ... - INVALIDITY_DATE: ObjectIdentifier = ... - -class NameOID: - COMMON_NAME: ObjectIdentifier = ... - COUNTRY_NAME: ObjectIdentifier = ... - LOCALITY_NAME: ObjectIdentifier = ... - STATE_OR_PROVINCE_NAME: ObjectIdentifier = ... - STREET_ADDRESS: ObjectIdentifier = ... - ORGANIZATION_NAME: ObjectIdentifier = ... - ORGANIZATIONAL_UNIT_NAME: ObjectIdentifier = ... - SERIAL_NUMBER: ObjectIdentifier = ... - SURNAME: ObjectIdentifier = ... - GIVEN_NAME: ObjectIdentifier = ... - TITLE: ObjectIdentifier = ... - GENERATION_QUALIFIER: ObjectIdentifier = ... - X500_UNIQUE_IDENTIFIER: ObjectIdentifier = ... - DN_QUALIFIER: ObjectIdentifier = ... - PSEUDONYM: ObjectIdentifier = ... - USER_ID: ObjectIdentifier = ... - DOMAIN_COMPONENT: ObjectIdentifier = ... - EMAIL_ADDRESS: ObjectIdentifier = ... - JURISDICTION_COUNTRY_NAME: ObjectIdentifier = ... - JURISDICTION_LOCALITY_NAME: ObjectIdentifier = ... - JURISDICTION_STATE_OR_PROVINCE_NAME: ObjectIdentifier = ... - BUSINESS_CATEGORY: ObjectIdentifier = ... - POSTAL_ADDRESS: ObjectIdentifier = ... - POSTAL_CODE: ObjectIdentifier = ... - -class SignatureAlgorithmOID: - RSA_WITH_MD5: ObjectIdentifier = ... - RSA_WITH_SHA1: ObjectIdentifier = ... - _RSA_WITH_SHA1: ObjectIdentifier = ... - RSA_WITH_SHA224: ObjectIdentifier = ... - RSA_WITH_SHA256: ObjectIdentifier = ... - RSA_WITH_SHA384: ObjectIdentifier = ... - RSA_WITH_SHA512: ObjectIdentifier = ... - RSASSA_PSS: ObjectIdentifier = ... - ECDSA_WITH_SHA1: ObjectIdentifier = ... - ECDSA_WITH_SHA224: ObjectIdentifier = ... - ECDSA_WITH_SHA256: ObjectIdentifier = ... - ECDSA_WITH_SHA384: ObjectIdentifier = ... - ECDSA_WITH_SHA512: ObjectIdentifier = ... - DSA_WITH_SHA1: ObjectIdentifier = ... - DSA_WITH_SHA224: ObjectIdentifier = ... - DSA_WITH_SHA256: ObjectIdentifier = ... - ED25519: ObjectIdentifier = ... - ED448: ObjectIdentifier = ... - -class ExtendedKeyUsageOID: - SERVER_AUTH: ObjectIdentifier = ... - CLIENT_AUTH: ObjectIdentifier = ... - CODE_SIGNING: ObjectIdentifier = ... - EMAIL_PROTECTION: ObjectIdentifier = ... - TIME_STAMPING: ObjectIdentifier = ... - OCSP_SIGNING: ObjectIdentifier = ... - ANY_EXTENDED_KEY_USAGE: ObjectIdentifier = ... - -class AuthorityInformationAccessOID: - CA_ISSUERS: ObjectIdentifier = ... - OCSP: ObjectIdentifier = ... - -class CertificatePoliciesOID: - CPS_QUALIFIER: ObjectIdentifier = ... - CPS_USER_NOTICE: ObjectIdentifier = ... - ANY_POLICY: ObjectIdentifier = ... - -_OID_NAMES: dict[ObjectIdentifier, str] -_SIG_OIDS_TO_HASH: dict[ObjectIdentifier, HashAlgorithm | None] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/dateparser/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/dateparser/METADATA.toml index c9f594bd7..ced11fa3e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/dateparser/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/dateparser/METADATA.toml @@ -1 +1,4 @@ version = "1.1.*" + +[tool.stubtest] +extras = ["fasttext", "langdetect"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/calendars/hijri_parser.pyi b/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/calendars/hijri_parser.pyi index c78ae2bba..30e804f29 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/calendars/hijri_parser.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/calendars/hijri_parser.pyi @@ -1,12 +1,13 @@ +from _typeshed import Incomplete from typing import Any from dateparser.calendars import non_gregorian_parser class hijri: @classmethod - def to_gregorian(cls, year: Any | None = ..., month: Any | None = ..., day: Any | None = ...): ... + def to_gregorian(cls, year: Incomplete | None = ..., month: Incomplete | None = ..., day: Incomplete | None = ...): ... @classmethod - def from_gregorian(cls, year: Any | None = ..., month: Any | None = ..., day: Any | None = ...): ... + def from_gregorian(cls, year: Incomplete | None = ..., month: Incomplete | None = ..., day: Incomplete | None = ...): ... @classmethod def month_length(cls, year, month): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/conf.pyi b/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/conf.pyi index 7b816d9d6..08883e884 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/conf.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/conf.pyi @@ -1,12 +1,13 @@ -from _typeshed import Self +from _typeshed import Incomplete from typing import Any +from typing_extensions import Self class Settings: - def __new__(cls: type[Self], *args, **kw) -> Self: ... - def __init__(self, settings: Any | None = ...) -> None: ... + def __new__(cls, *args, **kw) -> Self: ... + def __init__(self, settings: Incomplete | None = ...) -> None: ... @classmethod - def get_key(cls, settings: Any | None = ...): ... - def replace(self, mod_settings: Any | None = ..., **kwds): ... + def get_key(cls, settings: Incomplete | None = ...): ... + def replace(self, mod_settings: Incomplete | None = ..., **kwds): ... settings: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/android/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/custom_language_detection/__init__.pyi similarity index 100% rename from packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/android/__init__.pyi rename to packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/custom_language_detection/__init__.pyi diff --git a/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/custom_language_detection/fasttext.pyi b/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/custom_language_detection/fasttext.pyi new file mode 100644 index 000000000..e7440af40 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/custom_language_detection/fasttext.pyi @@ -0,0 +1 @@ +def detect_languages(text: str, confidence_threshold: float) -> list[str]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/custom_language_detection/langdetect.pyi b/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/custom_language_detection/langdetect.pyi new file mode 100644 index 000000000..e7440af40 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/custom_language_detection/langdetect.pyi @@ -0,0 +1 @@ +def detect_languages(text: str, confidence_threshold: float) -> list[str]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/custom_language_detection/language_mapping.pyi b/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/custom_language_detection/language_mapping.pyi new file mode 100644 index 000000000..0f5de55de --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/custom_language_detection/language_mapping.pyi @@ -0,0 +1 @@ +def map_languages(language_codes: list[str]) -> list[str]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/data/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/data/__init__.pyi index e69de29bb..91633ea6b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/data/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/data/__init__.pyi @@ -0,0 +1 @@ +from .languages_info import language_locale_dict as language_locale_dict, language_order as language_order diff --git a/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/data/languages_info.pyi b/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/data/languages_info.pyi index 799fa8b92..21a8e508d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/data/languages_info.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/data/languages_info.pyi @@ -1,4 +1,3 @@ -from typing import Any - -language_order: Any -language_locale_dict: Any +language_order: list[str] +language_locale_dict: dict[str, str] +language_map: dict[str, list[str]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/date.pyi b/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/date.pyi index e5eed6369..de772b0c3 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/date.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/date.pyi @@ -24,12 +24,14 @@ RE_SANITIZE_PERIOD: Pattern[str] RE_SANITIZE_ON: Pattern[str] RE_SANITIZE_APOSTROPHE: Pattern[str] RE_SEARCH_TIMESTAMP: Pattern[str] +RE_SANITIZE_CROATIAN: Pattern[str] +RE_SEARCH_NEGATIVE_TIMESTAMP: Pattern[str] def sanitize_spaces(date_string: str) -> str: ... def date_range(begin, end, **kwargs) -> None: ... def get_intersecting_periods(low, high, period: str = ...) -> None: ... def sanitize_date(date_string: str) -> str: ... -def get_date_from_timestamp(date_string: str, settings: Settings) -> datetime | None: ... +def get_date_from_timestamp(date_string: str, settings: Settings, negative: bool = ...) -> datetime | None: ... def parse_with_formats(date_string: str, date_formats: Iterable[str], settings: Settings) -> DateData: ... class _DateLocaleParser: diff --git a/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/date_parser.pyi b/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/date_parser.pyi index 65abc3b34..b4e92d7a2 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/date_parser.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/date_parser.pyi @@ -1,6 +1,7 @@ +from _typeshed import Incomplete from typing import Any class DateParser: - def parse(self, date_string, parse_method, settings: Any | None = ...): ... + def parse(self, date_string, parse_method, settings: Incomplete | None = ...): ... date_parser: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/freshness_date_parser.pyi b/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/freshness_date_parser.pyi index 41f717efa..06cec0949 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/freshness_date_parser.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/freshness_date_parser.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any PATTERN: Any @@ -6,6 +7,6 @@ class FreshnessDateDataParser: def get_local_tz(self): ... def parse(self, date_string, settings): ... def get_kwargs(self, date_string): ... - def get_date_data(self, date_string, settings: Any | None = ...): ... + def get_date_data(self, date_string, settings: Incomplete | None = ...): ... freshness_date_parser: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/languages/dictionary.pyi b/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/languages/dictionary.pyi index 76a2fd2a4..8ace03eb3 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/languages/dictionary.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/languages/dictionary.pyi @@ -1,8 +1,9 @@ +from _typeshed import Incomplete from typing import Any PARSER_HARDCODED_TOKENS: Any PARSER_KNOWN_TOKENS: Any -ALWAYS_KEEP_TOKENS: Any +ALWAYS_KEEP_TOKENS: list[str] KNOWN_WORD_TOKENS: Any PARENTHESES_PATTERN: Any NUMERAL_PATTERN: Any @@ -12,7 +13,7 @@ class UnknownTokenError(Exception): ... class Dictionary: info: Any - def __init__(self, locale_info, settings: Any | None = ...) -> None: ... + def __init__(self, locale_info, settings: Incomplete | None = ...) -> None: ... def __contains__(self, key): ... def __getitem__(self, key): ... def __iter__(self) -> Any: ... @@ -20,4 +21,4 @@ class Dictionary: def split(self, string, keep_formatting: bool = ...): ... class NormalizedDictionary(Dictionary): - def __init__(self, locale_info, settings: Any | None = ...) -> None: ... + def __init__(self, locale_info, settings: Incomplete | None = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/languages/locale.pyi b/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/languages/locale.pyi index 2a06040b7..cc54a5d57 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/languages/locale.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/languages/locale.pyi @@ -2,7 +2,6 @@ from re import Pattern from dateparser.conf import Settings -DIGIT_GROUP_PATTERN: Pattern[str] NUMERAL_PATTERN: Pattern[str] class Locale: diff --git a/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/parser.pyi b/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/parser.pyi index de87e8e9f..889187a86 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/parser.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/parser.pyi @@ -1,3 +1,5 @@ +import datetime +from _typeshed import Incomplete from typing import Any NSP_COMPATIBLE: Any @@ -11,7 +13,7 @@ def get_unresolved_attrs(parser_object): ... date_order_chart: Any -def resolve_date_order(order, lst: Any | None = ...): ... +def resolve_date_order(order, lst: Incomplete | None = ...): ... class _time_parser: time_directives: Any @@ -41,7 +43,7 @@ class _parser: ordered_num_directives: Any def __init__(self, tokens, settings): ... @classmethod - def parse(cls, datestring, settings): ... + def parse(cls, datestring, settings, tz: datetime.tzinfo | None = ...): ... class tokenizer: digits: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/search/detection.pyi b/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/search/detection.pyi index 69767c2e6..e8d030807 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/search/detection.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/search/detection.pyi @@ -1,17 +1,18 @@ +from _typeshed import Incomplete from typing import Any class BaseLanguageDetector: languages: Any def __init__(self, languages) -> None: ... - def iterate_applicable_languages(self, date_string, modify: bool = ..., settings: Any | None = ...) -> None: ... + def iterate_applicable_languages(self, date_string, modify: bool = ..., settings: Incomplete | None = ...) -> None: ... class AutoDetectLanguage(BaseLanguageDetector): language_pool: Any allow_redetection: Any def __init__(self, languages, allow_redetection: bool = ...) -> None: ... languages: Any - def iterate_applicable_languages(self, date_string, modify: bool = ..., settings: Any | None = ...) -> None: ... + def iterate_applicable_languages(self, date_string, modify: bool = ..., settings: Incomplete | None = ...) -> None: ... class ExactLanguages(BaseLanguageDetector): def __init__(self, languages) -> None: ... - def iterate_applicable_languages(self, date_string, modify: bool = ..., settings: Any | None = ...) -> None: ... + def iterate_applicable_languages(self, date_string, modify: bool = ..., settings: Incomplete | None = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/search/search.pyi b/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/search/search.pyi index d0efac4fd..cd5904a54 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/search/search.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/search/search.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from ..date import _DetectLanguagesFunction @@ -28,12 +29,12 @@ class DateSearchWithDetection: def __init__(self) -> None: ... language_detector: Any def detect_language( - self, text, languages, settings: Any | None = ..., detect_languages_function: _DetectLanguagesFunction | None = ... + self, text, languages, settings: Incomplete | None = ..., detect_languages_function: _DetectLanguagesFunction | None = ... ): ... def search_dates( self, text, - languages: Any | None = ..., - settings: Any | None = ..., + languages: Incomplete | None = ..., + settings: Incomplete | None = ..., detect_languages_function: _DetectLanguagesFunction | None = ..., ): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/timezones.pyi b/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/timezones.pyi index f521c45ad..aeb47a827 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/timezones.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/timezones.pyi @@ -1,3 +1 @@ -from typing import Any - -timezone_info_list: Any +timezone_info_list: list[dict[str, list[str | tuple[str, ...]]]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/utils/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/utils/__init__.pyi index 769e865ce..1814c88fe 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/utils/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/utils/__init__.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from collections import OrderedDict from collections.abc import Mapping from typing import Any @@ -16,7 +17,10 @@ def apply_timezone_from_settings(date_obj, settings): ... def get_last_day_of_month(year, month): ... def get_previous_leap_year(year): ... def get_next_leap_year(year): ... -def set_correct_day_from_settings(date_obj, settings, current_day: Any | None = ...): ... +def set_correct_day_from_settings(date_obj, settings, current_day: Incomplete | None = ...): ... def registry(cls): ... def get_logger() -> Any: ... def setup_logging() -> None: ... + +# TODO: this needs `types-pytz` and a type-alias +def get_timezone_from_tz_string(tz_string: str) -> Incomplete: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/decorator/decorator.pyi b/packages/pyright-internal/typeshed-fallback/stubs/decorator/decorator.pyi index 36dcfe813..3eb509a0c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/decorator/decorator.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/decorator/decorator.pyi @@ -1,10 +1,11 @@ +import inspect from builtins import dict as _dict # alias to avoid conflicts with attribute name from collections.abc import Callable, Iterator from contextlib import _GeneratorContextManager -from inspect import getfullargspec as getfullargspec, iscoroutinefunction as iscoroutinefunction +from inspect import Signature, getfullargspec as getfullargspec, iscoroutinefunction as iscoroutinefunction from re import Pattern from typing import Any, TypeVar -from typing_extensions import ParamSpec +from typing_extensions import Literal, ParamSpec _C = TypeVar("_C", bound=Callable[..., Any]) _Func = TypeVar("_Func", bound=Callable[..., Any]) @@ -14,6 +15,7 @@ _P = ParamSpec("_P") def get_init(cls: type) -> None: ... DEF: Pattern[str] +POS: Literal[inspect._ParameterKind.POSITIONAL_OR_KEYWORD] class FunctionMaker: args: list[str] @@ -56,7 +58,9 @@ class FunctionMaker: **attrs: Any, ) -> Callable[..., Any]: ... +def fix(args: tuple[Any, ...], kwargs: dict[str, Any], sig: Signature) -> tuple[tuple[Any, ...], dict[str, Any]]: ... def decorate(func: _Func, caller: Callable[..., Any], extras: Any = ...) -> _Func: ... +def decoratorx(caller: Callable[..., Any]) -> Callable[..., Any]: ... def decorator( caller: Callable[..., Any], _func: Callable[..., Any] | None = ... ) -> Callable[[Callable[..., Any]], Callable[..., Any]]: ... @@ -65,4 +69,5 @@ class ContextManager(_GeneratorContextManager[_T]): def __call__(self, func: _C) -> _C: ... def contextmanager(func: Callable[_P, Iterator[_T]]) -> Callable[_P, ContextManager[_T]]: ... +def append(a: type, vancestors: list[type]) -> None: ... def dispatch_on(*dispatch_args: Any) -> Callable[[Callable[..., Any]], Callable[..., Any]]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/dj-database-url/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/dj-database-url/METADATA.toml index 516f11f6b..249b0a7c0 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/dj-database-url/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/dj-database-url/METADATA.toml @@ -1,4 +1 @@ -version = "1.0.*" - -[tool.stubtest] -ignore_missing_stub = false +version = "1.2.*" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/dj-database-url/dj_database_url.pyi b/packages/pyright-internal/typeshed-fallback/stubs/dj-database-url/dj_database_url.pyi index 5a39aa933..c0d3f5672 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/dj-database-url/dj_database_url.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/dj-database-url/dj_database_url.pyi @@ -1,7 +1,7 @@ +from _typeshed import Incomplete from typing import Any from typing_extensions import TypedDict -DJANGO_VERSION: tuple[str | int, ...] | None # None if django is not installed DEFAULT_ENV: str SCHEMES: dict[str, str] @@ -21,7 +21,20 @@ class _DBConfig(TypedDict, total=False): TIME_ZONE: str USER: str -def parse(url: str, engine: str | None = ..., conn_max_age: int = ..., ssl_require: bool = ...) -> _DBConfig: ... +def parse( + url: str, + engine: str | None = ..., + conn_max_age: int = ..., + conn_health_checks: bool = ..., + ssl_require: bool = ..., + test_options: dict[Incomplete, Incomplete] | None = ..., +) -> _DBConfig: ... def config( - env: str = ..., default: str | None = ..., engine: str | None = ..., conn_max_age: int = ..., ssl_require: bool = ... + env: str = ..., + default: str | None = ..., + engine: str | None = ..., + conn_max_age: int = ..., + conn_health_checks: bool = ..., + ssl_require: bool = ..., + test_options: dict[Incomplete, Incomplete] | None = ..., ) -> _DBConfig: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/dockerfile-parse/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/dockerfile-parse/METADATA.toml new file mode 100644 index 000000000..58bc38349 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/dockerfile-parse/METADATA.toml @@ -0,0 +1 @@ +version = "2.0.*" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/dockerfile-parse/dockerfile_parse/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/dockerfile-parse/dockerfile_parse/__init__.pyi new file mode 100644 index 000000000..eeb43a016 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/dockerfile-parse/dockerfile_parse/__init__.pyi @@ -0,0 +1,3 @@ +from .parser import DockerfileParser as DockerfileParser + +__version__: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/dockerfile-parse/dockerfile_parse/constants.pyi b/packages/pyright-internal/typeshed-fallback/stubs/dockerfile-parse/dockerfile_parse/constants.pyi new file mode 100644 index 000000000..9bf1c78f3 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/dockerfile-parse/dockerfile_parse/constants.pyi @@ -0,0 +1,2 @@ +DOCKERFILE_FILENAME: str +COMMENT_INSTRUCTION: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/dockerfile-parse/dockerfile_parse/parser.pyi b/packages/pyright-internal/typeshed-fallback/stubs/dockerfile-parse/dockerfile_parse/parser.pyi new file mode 100644 index 000000000..30939a415 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/dockerfile-parse/dockerfile_parse/parser.pyi @@ -0,0 +1,70 @@ +import logging +from collections.abc import Mapping, Sequence +from typing import IO, ClassVar +from typing_extensions import TypedDict + +from .util import Context + +logger: logging.Logger + +class KeyValues(dict[str, str]): + parser_attr: ClassVar[str | None] + parser: DockerfileParser + def __init__(self, key_values: Mapping[str, str], parser: DockerfileParser) -> None: ... + def __delitem__(self, key: str) -> None: ... + def __setitem__(self, key: str, value: str) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... # type: ignore[override] + +class Labels(KeyValues): ... +class Envs(KeyValues): ... +class Args(KeyValues): ... + +class _InstructionDict(TypedDict): + instruction: str + startline: int + endline: int + content: str + value: str + +class DockerfileParser: + fileobj: IO[str] + dockerfile_path: str + cache_content: bool + cached_content: str + env_replace: bool + parent_env: dict[str, str] + build_args: dict[str, str] + def __init__( + self, + path: str | None = ..., + cache_content: bool = ..., + env_replace: bool = ..., + parent_env: dict[str, str] | None = ..., + fileobj: IO[str] | None = ..., + build_args: dict[str, str] | None = ..., + ) -> None: ... + lines: list[str] + content: str + @property + def structure(self) -> list[_InstructionDict]: ... + @property + def json(self) -> str: ... + parent_images: Sequence[str] + @property + def is_multistage(self) -> bool: ... + baseimage: str + cmd: str + labels: Mapping[str, str] + envs: Mapping[str, str] + args: Mapping[str, str] + def add_lines( + self, *lines: str, all_stages: bool | None = ..., at_start: bool | None = ..., skip_scratch: bool | None = ... + ) -> None: ... + def add_lines_at( + self, anchor: str | int | dict[str, int], *lines: str, replace: bool | None = ..., after: bool | None = ... + ) -> None: ... + @property + def context_structure(self) -> list[Context]: ... + +def image_from(from_value: str) -> tuple[str | None, str | None]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/dockerfile-parse/dockerfile_parse/util.pyi b/packages/pyright-internal/typeshed-fallback/stubs/dockerfile-parse/dockerfile_parse/util.pyi new file mode 100644 index 000000000..73f29abeb --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/dockerfile-parse/dockerfile_parse/util.pyi @@ -0,0 +1,49 @@ +from collections.abc import Generator, Mapping, MutableMapping +from io import StringIO +from typing import ClassVar +from typing_extensions import Literal, TypeAlias + +def b2u(string: bytes | str) -> str: ... +def u2b(string: str | bytes) -> bytes: ... + +_Quotes: TypeAlias = Literal["'", '"'] +_ContextType: TypeAlias = Literal["ARG", "ENV", "LABEL"] + +class WordSplitter: + SQUOTE: ClassVar[_Quotes] + DQUOTE: ClassVar[_Quotes] + stream: StringIO + args: Mapping[str, str] | None + envs: Mapping[str, str] | None + quotes: _Quotes | None + escaped: bool + def __init__(self, s: str, args: Mapping[str, str] | None = ..., envs: Mapping[str, str] | None = ...) -> None: ... + def dequote(self) -> str: ... + def split(self, maxsplit: int | None = ..., dequote: bool = ...) -> Generator[str | None, None, None]: ... + +def extract_key_values( + env_replace: bool, args: Mapping[str, str], envs: Mapping[str, str], instruction_value: str +) -> list[tuple[str, str]]: ... +def get_key_val_dictionary( + instruction_value: str, env_replace: bool = ..., args: Mapping[str, str] | None = ..., envs: Mapping[str, str] | None = ... +) -> dict[str, str]: ... + +class Context: + args: MutableMapping[str, str] + envs: MutableMapping[str, str] + labels: MutableMapping[str, str] + line_args: Mapping[str, str] + line_envs: Mapping[str, str] + line_labels: Mapping[str, str] + def __init__( + self, + args: MutableMapping[str, str] | None = ..., + envs: MutableMapping[str, str] | None = ..., + labels: MutableMapping[str, str] | None = ..., + line_args: Mapping[str, str] | None = ..., + line_envs: Mapping[str, str] | None = ..., + line_labels: Mapping[str, str] | None = ..., + ) -> None: ... + def set_line_value(self, context_type: _ContextType, value: Mapping[str, str]) -> None: ... + def get_line_value(self, context_type: _ContextType) -> Mapping[str, str]: ... + def get_values(self, context_type: _ContextType) -> Mapping[str, str]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docopt/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/docopt/METADATA.toml index a95bee1ff..03031f1e9 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docopt/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/docopt/METADATA.toml @@ -1,4 +1 @@ version = "0.6.*" - -[tool.stubtest] -ignore_missing_stub = false diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docopt/docopt.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docopt/docopt.pyi index 570e66120..b31fd6355 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docopt/docopt.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docopt/docopt.pyi @@ -1,12 +1,19 @@ +from _typeshed import Incomplete from collections.abc import Iterable -from typing import Any +from typing import Any, ClassVar from typing_extensions import TypeAlias __version__: str _Argv: TypeAlias = Iterable[str] | str +class DocoptLanguageError(Exception): ... + +class DocoptExit(SystemExit): + usage: ClassVar[str] + def __init__(self, message: str = "") -> None: ... + def printable_usage(doc: str) -> str: ... def docopt( - doc: str, argv: _Argv | None = ..., help: bool = ..., version: Any | None = ..., options_first: bool = ... + doc: str, argv: _Argv | None = ..., help: bool = ..., version: Incomplete | None = ..., options_first: bool = ... ) -> dict[str, Any]: ... # Really should be dict[str, str | bool] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docutils/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/docutils/METADATA.toml index d2a449c6f..1647ad358 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docutils/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/docutils/METADATA.toml @@ -1 +1,4 @@ version = "0.19.*" + +[tool.stubtest] +ignore_missing_stub = true diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/__init__.pyi index cfa9914a6..1a2f9df43 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/__init__.pyi @@ -1,5 +1,5 @@ -from _typeshed import Self from typing import Any, ClassVar, NamedTuple +from typing_extensions import Self __docformat__: str __version__: str @@ -14,13 +14,7 @@ class _VersionInfo(NamedTuple): class VersionInfo(_VersionInfo): def __new__( - cls: type[Self], - major: int = ..., - minor: int = ..., - micro: int = ..., - releaselevel: str = ..., - serial: int = ..., - release: bool = ..., + cls, major: int = ..., minor: int = ..., micro: int = ..., releaselevel: str = ..., serial: int = ..., release: bool = ... ) -> Self: ... __version_info__: VersionInfo diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/core.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/core.pyi index 964e6fa3f..0f6820f05 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/core.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/core.pyi @@ -1,3 +1,3 @@ -from typing import Any +from _typeshed import Incomplete -def __getattr__(name: str) -> Any: ... # incomplete +def __getattr__(name: str) -> Incomplete: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/examples.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/examples.pyi index 964e6fa3f..0f6820f05 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/examples.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/examples.pyi @@ -1,3 +1,3 @@ -from typing import Any +from _typeshed import Incomplete -def __getattr__(name: str) -> Any: ... # incomplete +def __getattr__(name: str) -> Incomplete: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/frontend.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/frontend.pyi index e71907471..328decf96 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/frontend.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/frontend.pyi @@ -1,4 +1,5 @@ import optparse +from _typeshed import Incomplete from collections.abc import Iterable, Mapping from configparser import RawConfigParser from typing import Any, ClassVar @@ -11,39 +12,43 @@ __docformat__: str def store_multiple(option, opt, value, parser, *args, **kwargs) -> None: ... def read_config_file(option, opt, value, parser) -> None: ... -def validate_encoding(setting, value, option_parser, config_parser: Any | None = ..., config_section: Any | None = ...): ... +def validate_encoding( + setting, value, option_parser, config_parser: Incomplete | None = ..., config_section: Incomplete | None = ... +): ... def validate_encoding_error_handler( - setting, value, option_parser, config_parser: Any | None = ..., config_section: Any | None = ... + setting, value, option_parser, config_parser: Incomplete | None = ..., config_section: Incomplete | None = ... ): ... def validate_encoding_and_error_handler( - setting, value, option_parser, config_parser: Any | None = ..., config_section: Any | None = ... + setting, value, option_parser, config_parser: Incomplete | None = ..., config_section: Incomplete | None = ... ): ... def validate_boolean( - setting, value, option_parser, config_parser: Any | None = ..., config_section: Any | None = ... + setting, value, option_parser, config_parser: Incomplete | None = ..., config_section: Incomplete | None = ... ) -> bool: ... def validate_nonnegative_int( - setting, value, option_parser, config_parser: Any | None = ..., config_section: Any | None = ... + setting, value, option_parser, config_parser: Incomplete | None = ..., config_section: Incomplete | None = ... ) -> int: ... def validate_threshold( - setting, value, option_parser, config_parser: Any | None = ..., config_section: Any | None = ... + setting, value, option_parser, config_parser: Incomplete | None = ..., config_section: Incomplete | None = ... ) -> int: ... def validate_colon_separated_string_list( - setting, value, option_parser, config_parser: Any | None = ..., config_section: Any | None = ... + setting, value, option_parser, config_parser: Incomplete | None = ..., config_section: Incomplete | None = ... ) -> list[str]: ... def validate_comma_separated_list( - setting, value, option_parser, config_parser: Any | None = ..., config_section: Any | None = ... + setting, value, option_parser, config_parser: Incomplete | None = ..., config_section: Incomplete | None = ... ) -> list[str]: ... def validate_url_trailing_slash( - setting, value, option_parser, config_parser: Any | None = ..., config_section: Any | None = ... + setting, value, option_parser, config_parser: Incomplete | None = ..., config_section: Incomplete | None = ... ) -> str: ... def validate_dependency_file( - setting, value, option_parser, config_parser: Any | None = ..., config_section: Any | None = ... + setting, value, option_parser, config_parser: Incomplete | None = ..., config_section: Incomplete | None = ... ) -> DependencyList: ... -def validate_strip_class(setting, value, option_parser, config_parser: Any | None = ..., config_section: Any | None = ...): ... +def validate_strip_class( + setting, value, option_parser, config_parser: Incomplete | None = ..., config_section: Incomplete | None = ... +): ... def validate_smartquotes_locales( - setting, value, option_parser, config_parser: Any | None = ..., config_section: Any | None = ... + setting, value, option_parser, config_parser: Incomplete | None = ..., config_section: Incomplete | None = ... ) -> list[tuple[str, str]]: ... -def make_paths_absolute(pathdict, keys, base_path: Any | None = ...) -> None: ... +def make_paths_absolute(pathdict, keys, base_path: Incomplete | None = ...) -> None: ... def make_one_path_absolute(base_path, path) -> str: ... def filter_settings_spec(settings_spec, *exclude, **replace) -> tuple[Any, ...]: ... @@ -70,9 +75,9 @@ class OptionParser(optparse.OptionParser, SettingsSpec): *args, **kwargs, ) -> None: ... - def __getattr__(self, name: str) -> Any: ... # incomplete + def __getattr__(self, name: str) -> Incomplete: ... class ConfigParser(RawConfigParser): - def __getattr__(self, name: str) -> Any: ... # incomplete + def __getattr__(self, name: str) -> Incomplete: ... class ConfigDeprecationWarning(DeprecationWarning): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/io.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/io.pyi index b8d4751e8..8a2a7d072 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/io.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/io.pyi @@ -1,50 +1,78 @@ -from _typeshed import OpenBinaryModeReading, OpenBinaryModeWriting, OpenTextModeReading, OpenTextModeWriting +from _typeshed import ( + Incomplete, + OpenBinaryModeReading, + OpenBinaryModeWriting, + OpenTextModeReading, + OpenTextModeWriting, + SupportsWrite, + Unused, +) +from re import Pattern from typing import Any, ClassVar +from typing_extensions import Literal from docutils import TransformSpec __docformat__: str -class InputError(IOError): ... -class OutputError(IOError): ... +class InputError(OSError): ... +class OutputError(OSError): ... def check_encoding(stream: Any, encoding: str) -> bool | None: ... +def error_string(err: BaseException) -> str: ... class Input(TransformSpec): component_type: ClassVar[str] default_source_path: ClassVar[str | None] def read(self) -> Any: ... - def __getattr__(self, name: str) -> Any: ... # incomplete + def decode(self, data: str | bytes) -> str: ... + coding_slug: ClassVar[Pattern[bytes]] + byte_order_marks: ClassVar[tuple[tuple[bytes, str], ...]] + def determine_encoding_from_data(self, data: str | bytes) -> str | None: ... + def isatty(self) -> bool: ... class Output(TransformSpec): component_type: ClassVar[str] default_destination_path: ClassVar[str | None] def __init__( self, - destination: Any | None = ..., - destination_path: Any | None = ..., + destination: Incomplete | None = ..., + destination_path: Incomplete | None = ..., encoding: str | None = ..., error_handler: str = ..., ) -> None: ... def write(self, data: str) -> Any: ... # returns bytes or str def encode(self, data: str) -> Any: ... # returns bytes or str +class ErrorOutput: + def __init__( + self, + destination: str | SupportsWrite[str] | SupportsWrite[bytes] | Literal[False] | None = ..., + encoding: str | None = ..., + encoding_errors: str = ..., + decoding_errors: str = ..., + ) -> None: ... + def write(self, data: str | bytes | Exception) -> None: ... + def close(self) -> None: ... + def isatty(self) -> bool: ... + class FileInput(Input): def __init__( self, - source: Any | None = ..., - source_path: Any | None = ..., + source: Incomplete | None = ..., + source_path: Incomplete | None = ..., encoding: str | None = ..., error_handler: str = ..., autoclose: bool = ..., mode: OpenTextModeReading | OpenBinaryModeReading = ..., ) -> None: ... + def read(self) -> str: ... def readlines(self) -> list[str]: ... def close(self) -> None: ... class FileOutput(Output): mode: ClassVar[OpenTextModeWriting | OpenBinaryModeWriting] - def __getattr__(self, name: str) -> Any: ... # incomplete + def __getattr__(self, name: str) -> Incomplete: ... class BinaryFileOutput(FileOutput): ... @@ -61,7 +89,7 @@ class NullInput(Input): class NullOutput(Output): default_destination_path: ClassVar[str] - def write(self, data: object) -> None: ... + def write(self, data: Unused) -> None: ... class DocTreeInput(Input): default_source_path: ClassVar[str] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/languages/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/languages/__init__.pyi index d8747739d..3638be182 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/languages/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/languages/__init__.pyi @@ -1,4 +1,5 @@ -from typing import Any, Protocol +from _typeshed import Incomplete +from typing import Protocol from docutils.utils import Reporter @@ -9,6 +10,6 @@ class _LanguageModule(Protocol): class LanguageImporter: def __call__(self, language_code: str, reporter: Reporter | None = ...) -> _LanguageModule: ... - def __getattr__(self, __name: str) -> Any: ... # incomplete + def __getattr__(self, __name: str) -> Incomplete: ... get_language: LanguageImporter diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/nodes.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/nodes.pyi index 6efe7c5e2..80ee6bbe7 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/nodes.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/nodes.pyi @@ -1,9 +1,9 @@ import xml.dom.minidom -from _typeshed import Self +from _typeshed import Incomplete from abc import abstractmethod from collections.abc import Callable, Generator, Iterable, Sequence from typing import Any, ClassVar, Protocol, TypeVar, overload -from typing_extensions import Literal +from typing_extensions import Literal, Self from docutils.transforms import Transformer @@ -26,9 +26,9 @@ class Node: # (although it's not used in the docutils implementation) because it # makes Mypy reject Node() with "Cannot instantiate abstract class". @abstractmethod - def copy(self: Self) -> Self: ... + def copy(self) -> Self: ... @abstractmethod - def deepcopy(self: Self) -> Self: ... + def deepcopy(self) -> Self: ... @abstractmethod def pformat(self, indent: str = ..., level: int = ...) -> str: ... @abstractmethod @@ -97,23 +97,23 @@ class Element(Node): def __delitem__(self, key: str | int | slice) -> None: ... def __add__(self, other: list[Node]) -> list[Node]: ... def __radd__(self, other: list[Node]) -> list[Node]: ... - def __iadd__(self: Self, other: Node | Iterable[Node]) -> Self: ... - def copy(self: Self) -> Self: ... - def deepcopy(self: Self) -> Self: ... + def __iadd__(self, other: Node | Iterable[Node]) -> Self: ... + def copy(self) -> Self: ... + def deepcopy(self) -> Self: ... def pformat(self, indent: str = ..., level: int = ...) -> str: ... def astext(self) -> str: ... - def __getattr__(self, __name: str) -> Any: ... # incomplete + def __getattr__(self, __name: str) -> Incomplete: ... class Text(Node, str): tagname: ClassVar[str] children: tuple[()] # we omit the rawsource parameter because it has been deprecated and is ignored - def __new__(cls: type[Self], data: str) -> Self: ... + def __new__(cls, data: str) -> Self: ... def __init__(self, data: str) -> None: ... def shortrepr(self, maxlen: int = ...) -> str: ... - def copy(self: Self) -> Self: ... - def deepcopy(self: Self) -> Self: ... + def copy(self) -> Self: ... + def deepcopy(self) -> Self: ... def pformat(self, indent: str = ..., level: int = ...) -> str: ... def astext(self) -> str: ... def rstrip(self, chars: str | None = ...) -> str: ... @@ -124,14 +124,14 @@ class Root: ... class document(Root, Structural, Element): transformer: Transformer - def copy(self: Self) -> Self: ... - def deepcopy(self: Self) -> Self: ... + def copy(self) -> Self: ... + def deepcopy(self) -> Self: ... def pformat(self, indent: str = ..., level: int = ...) -> str: ... def astext(self) -> str: ... - def __getattr__(self, __name: str) -> Any: ... # incomplete + def __getattr__(self, __name: str) -> Incomplete: ... class NodeVisitor: def __init__(self, document: document): ... - def __getattr__(self, __name: str) -> Any: ... # incomplete + def __getattr__(self, __name: str) -> Incomplete: ... -def __getattr__(name: str) -> Any: ... # incomplete +def __getattr__(name: str) -> Incomplete: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/parsers/recommonmark_wrapper.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/parsers/recommonmark_wrapper.pyi index 964e6fa3f..0f6820f05 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/parsers/recommonmark_wrapper.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/parsers/recommonmark_wrapper.pyi @@ -1,3 +1,3 @@ -from typing import Any +from _typeshed import Incomplete -def __getattr__(name: str) -> Any: ... # incomplete +def __getattr__(name: str) -> Incomplete: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/parsers/rst/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/parsers/rst/__init__.pyi index b9cc02940..04a24b3d7 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/parsers/rst/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/parsers/rst/__init__.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any, ClassVar from typing_extensions import Literal @@ -9,7 +10,7 @@ class Parser(parsers.Parser): initial_state: Literal["Body", "RFC2822Body"] state_classes: Any inliner: Any - def __init__(self, rfc2822: bool = ..., inliner: Any | None = ...) -> None: ... + def __init__(self, rfc2822: bool = ..., inliner: Incomplete | None = ...) -> None: ... class DirectiveError(Exception): level: Any @@ -29,6 +30,6 @@ class Directive: state: states.RSTState, state_machine: states.RSTStateMachine, ) -> None: ... - def __getattr__(self, name: str) -> Any: ... # incomplete + def __getattr__(self, name: str) -> Incomplete: ... def convert_directive_function(directive_fn): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/parsers/rst/directives/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/parsers/rst/directives/__init__.pyi index 790329106..5ffbcf7a6 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/parsers/rst/directives/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/parsers/rst/directives/__init__.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete from docutils.languages import _LanguageModule from docutils.nodes import document @@ -9,4 +9,4 @@ def register_directive(name: str, directive: type[Directive]) -> None: ... def directive( directive_name: str, language_module: _LanguageModule, document: document ) -> tuple[type[Directive] | None, list[SystemMessage]]: ... -def __getattr__(name: str) -> Any: ... # incomplete +def __getattr__(name: str) -> Incomplete: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/parsers/rst/directives/admonitions.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/parsers/rst/directives/admonitions.pyi index 964e6fa3f..0f6820f05 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/parsers/rst/directives/admonitions.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/parsers/rst/directives/admonitions.pyi @@ -1,3 +1,3 @@ -from typing import Any +from _typeshed import Incomplete -def __getattr__(name: str) -> Any: ... # incomplete +def __getattr__(name: str) -> Incomplete: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/parsers/rst/directives/body.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/parsers/rst/directives/body.pyi index 964e6fa3f..0f6820f05 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/parsers/rst/directives/body.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/parsers/rst/directives/body.pyi @@ -1,3 +1,3 @@ -from typing import Any +from _typeshed import Incomplete -def __getattr__(name: str) -> Any: ... # incomplete +def __getattr__(name: str) -> Incomplete: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/parsers/rst/directives/html.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/parsers/rst/directives/html.pyi index 964e6fa3f..0f6820f05 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/parsers/rst/directives/html.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/parsers/rst/directives/html.pyi @@ -1,3 +1,3 @@ -from typing import Any +from _typeshed import Incomplete -def __getattr__(name: str) -> Any: ... # incomplete +def __getattr__(name: str) -> Incomplete: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/parsers/rst/directives/images.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/parsers/rst/directives/images.pyi index 964e6fa3f..0f6820f05 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/parsers/rst/directives/images.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/parsers/rst/directives/images.pyi @@ -1,3 +1,3 @@ -from typing import Any +from _typeshed import Incomplete -def __getattr__(name: str) -> Any: ... # incomplete +def __getattr__(name: str) -> Incomplete: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/parsers/rst/directives/misc.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/parsers/rst/directives/misc.pyi index 964e6fa3f..0f6820f05 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/parsers/rst/directives/misc.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/parsers/rst/directives/misc.pyi @@ -1,3 +1,3 @@ -from typing import Any +from _typeshed import Incomplete -def __getattr__(name: str) -> Any: ... # incomplete +def __getattr__(name: str) -> Incomplete: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/parsers/rst/directives/parts.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/parsers/rst/directives/parts.pyi index 964e6fa3f..0f6820f05 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/parsers/rst/directives/parts.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/parsers/rst/directives/parts.pyi @@ -1,3 +1,3 @@ -from typing import Any +from _typeshed import Incomplete -def __getattr__(name: str) -> Any: ... # incomplete +def __getattr__(name: str) -> Incomplete: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/parsers/rst/directives/references.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/parsers/rst/directives/references.pyi index 964e6fa3f..0f6820f05 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/parsers/rst/directives/references.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/parsers/rst/directives/references.pyi @@ -1,3 +1,3 @@ -from typing import Any +from _typeshed import Incomplete -def __getattr__(name: str) -> Any: ... # incomplete +def __getattr__(name: str) -> Incomplete: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/parsers/rst/directives/tables.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/parsers/rst/directives/tables.pyi index 964e6fa3f..0f6820f05 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/parsers/rst/directives/tables.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/parsers/rst/directives/tables.pyi @@ -1,3 +1,3 @@ -from typing import Any +from _typeshed import Incomplete -def __getattr__(name: str) -> Any: ... # incomplete +def __getattr__(name: str) -> Incomplete: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/parsers/rst/roles.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/parsers/rst/roles.pyi index f21d07d17..59580d68e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/parsers/rst/roles.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/parsers/rst/roles.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from collections.abc import Callable from typing import Any from typing_extensions import TypeAlias @@ -16,4 +17,4 @@ def register_local_role(name: str, role_fn: _RoleFn) -> None: ... def role( role_name: str, language_module: _LanguageModule, lineno: int, reporter: Reporter ) -> tuple[_RoleFn | None, list[SystemMessage]]: ... -def __getattr__(name: str) -> Any: ... # incomplete +def __getattr__(name: str) -> Incomplete: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/parsers/rst/states.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/parsers/rst/states.pyi index a7f106948..1ef7be910 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/parsers/rst/states.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/parsers/rst/states.pyi @@ -1,6 +1,6 @@ -from typing import Any +from _typeshed import Incomplete class Inliner: def __init__(self) -> None: ... -def __getattr__(name: str) -> Any: ... # incomplete +def __getattr__(name: str) -> Incomplete: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/readers/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/readers/__init__.pyi index 964e6fa3f..0f6820f05 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/readers/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/readers/__init__.pyi @@ -1,3 +1,3 @@ -from typing import Any +from _typeshed import Incomplete -def __getattr__(name: str) -> Any: ... # incomplete +def __getattr__(name: str) -> Incomplete: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/readers/doctree.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/readers/doctree.pyi index 964e6fa3f..0f6820f05 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/readers/doctree.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/readers/doctree.pyi @@ -1,3 +1,3 @@ -from typing import Any +from _typeshed import Incomplete -def __getattr__(name: str) -> Any: ... # incomplete +def __getattr__(name: str) -> Incomplete: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/readers/pep.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/readers/pep.pyi index 964e6fa3f..0f6820f05 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/readers/pep.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/readers/pep.pyi @@ -1,3 +1,3 @@ -from typing import Any +from _typeshed import Incomplete -def __getattr__(name: str) -> Any: ... # incomplete +def __getattr__(name: str) -> Incomplete: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/readers/standalone.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/readers/standalone.pyi index 964e6fa3f..0f6820f05 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/readers/standalone.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/readers/standalone.pyi @@ -1,3 +1,3 @@ -from typing import Any +from _typeshed import Incomplete -def __getattr__(name: str) -> Any: ... # incomplete +def __getattr__(name: str) -> Incomplete: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/statemachine.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/statemachine.pyi index 964e6fa3f..0f6820f05 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/statemachine.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/statemachine.pyi @@ -1,3 +1,3 @@ -from typing import Any +from _typeshed import Incomplete -def __getattr__(name: str) -> Any: ... # incomplete +def __getattr__(name: str) -> Incomplete: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/transforms/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/transforms/__init__.pyi index 92b6fcb2d..1fdb00b4a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/transforms/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/transforms/__init__.pyi @@ -1,14 +1,14 @@ -from typing import Any +from _typeshed import Incomplete from docutils.nodes import Node, document class Transform: def __init__(self, document: document, startnode: Node | None = ...): ... - def __getattr__(self, __name: str) -> Any: ... # incomplete + def __getattr__(self, __name: str) -> Incomplete: ... class Transformer: def __init__(self, document: document): ... def add_transform(self, transform_class: type[Transform], priority: int | None = ..., **kwargs) -> None: ... - def __getattr__(self, __name: str) -> Any: ... # incomplete + def __getattr__(self, __name: str) -> Incomplete: ... -def __getattr__(name: str) -> Any: ... # incomplete +def __getattr__(name: str) -> Incomplete: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/utils/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/utils/__init__.pyi index 782dbb91e..8c3733dbb 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/utils/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/utils/__init__.pyi @@ -1,7 +1,7 @@ import optparse +from _typeshed import Incomplete from builtins import list as _list # alias to avoid name clashes with fields named list from collections.abc import Iterable -from typing import Any from typing_extensions import Literal, TypeAlias from docutils import ApplicationError @@ -28,7 +28,7 @@ class Reporter: source: str report_level: _SystemMessageLevel halt_level: _SystemMessageLevel - def __getattr__(self, __name: str) -> Any: ... # incomplete + def __getattr__(self, __name: str) -> Incomplete: ... class SystemMessage(ApplicationError): level: _SystemMessageLevel @@ -36,4 +36,4 @@ class SystemMessage(ApplicationError): def new_reporter(source_path: str, settings: optparse.Values) -> Reporter: ... def new_document(source_path: str, settings: optparse.Values | None = ...) -> document: ... -def __getattr__(name: str) -> Any: ... # incomplete +def __getattr__(name: str) -> Incomplete: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/writers/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/writers/__init__.pyi index 964e6fa3f..0f6820f05 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/writers/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/writers/__init__.pyi @@ -1,3 +1,3 @@ -from typing import Any +from _typeshed import Incomplete -def __getattr__(name: str) -> Any: ... # incomplete +def __getattr__(name: str) -> Incomplete: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/writers/docutils_xml.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/writers/docutils_xml.pyi index 964e6fa3f..0f6820f05 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/writers/docutils_xml.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/writers/docutils_xml.pyi @@ -1,3 +1,3 @@ -from typing import Any +from _typeshed import Incomplete -def __getattr__(name: str) -> Any: ... # incomplete +def __getattr__(name: str) -> Incomplete: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/writers/html4css1.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/writers/html4css1.pyi index 964e6fa3f..0f6820f05 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/writers/html4css1.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/writers/html4css1.pyi @@ -1,3 +1,3 @@ -from typing import Any +from _typeshed import Incomplete -def __getattr__(name: str) -> Any: ... # incomplete +def __getattr__(name: str) -> Incomplete: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/writers/html5_polyglot.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/writers/html5_polyglot.pyi index 964e6fa3f..0f6820f05 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/writers/html5_polyglot.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/writers/html5_polyglot.pyi @@ -1,3 +1,3 @@ -from typing import Any +from _typeshed import Incomplete -def __getattr__(name: str) -> Any: ... # incomplete +def __getattr__(name: str) -> Incomplete: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/writers/latex2e.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/writers/latex2e.pyi index 964e6fa3f..0f6820f05 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/writers/latex2e.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/writers/latex2e.pyi @@ -1,3 +1,3 @@ -from typing import Any +from _typeshed import Incomplete -def __getattr__(name: str) -> Any: ... # incomplete +def __getattr__(name: str) -> Incomplete: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/writers/manpage.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/writers/manpage.pyi index 964e6fa3f..0f6820f05 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/writers/manpage.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/writers/manpage.pyi @@ -1,3 +1,3 @@ -from typing import Any +from _typeshed import Incomplete -def __getattr__(name: str) -> Any: ... # incomplete +def __getattr__(name: str) -> Incomplete: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/writers/null.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/writers/null.pyi index 964e6fa3f..0f6820f05 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/writers/null.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/writers/null.pyi @@ -1,3 +1,3 @@ -from typing import Any +from _typeshed import Incomplete -def __getattr__(name: str) -> Any: ... # incomplete +def __getattr__(name: str) -> Incomplete: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/writers/odf_odt.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/writers/odf_odt.pyi index 964e6fa3f..0f6820f05 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/writers/odf_odt.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/writers/odf_odt.pyi @@ -1,3 +1,3 @@ -from typing import Any +from _typeshed import Incomplete -def __getattr__(name: str) -> Any: ... # incomplete +def __getattr__(name: str) -> Incomplete: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/writers/pep_html.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/writers/pep_html.pyi index 964e6fa3f..0f6820f05 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/writers/pep_html.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/writers/pep_html.pyi @@ -1,3 +1,3 @@ -from typing import Any +from _typeshed import Incomplete -def __getattr__(name: str) -> Any: ... # incomplete +def __getattr__(name: str) -> Incomplete: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/writers/pseudoxml.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/writers/pseudoxml.pyi index 964e6fa3f..0f6820f05 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/writers/pseudoxml.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/writers/pseudoxml.pyi @@ -1,3 +1,3 @@ -from typing import Any +from _typeshed import Incomplete -def __getattr__(name: str) -> Any: ... # incomplete +def __getattr__(name: str) -> Incomplete: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/writers/s5_html.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/writers/s5_html.pyi index 964e6fa3f..0f6820f05 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/writers/s5_html.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/writers/s5_html.pyi @@ -1,3 +1,3 @@ -from typing import Any +from _typeshed import Incomplete -def __getattr__(name: str) -> Any: ... # incomplete +def __getattr__(name: str) -> Incomplete: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/writers/xetex.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/writers/xetex.pyi index 964e6fa3f..0f6820f05 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/writers/xetex.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/writers/xetex.pyi @@ -1,3 +1,3 @@ -from typing import Any +from _typeshed import Incomplete -def __getattr__(name: str) -> Any: ... # incomplete +def __getattr__(name: str) -> Incomplete: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/editdistance/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/editdistance/METADATA.toml index f3aa6e4dd..03031f1e9 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/editdistance/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/editdistance/METADATA.toml @@ -1,5 +1 @@ version = "0.6.*" - -[tool.stubtest] -ignore_missing_stub = false - diff --git a/packages/pyright-internal/typeshed-fallback/stubs/editdistance/editdistance/bycython.pyi b/packages/pyright-internal/typeshed-fallback/stubs/editdistance/editdistance/bycython.pyi deleted file mode 100644 index 24fc9933d..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/editdistance/editdistance/bycython.pyi +++ /dev/null @@ -1,5 +0,0 @@ -from _typeshed import Incomplete - -def eval(*args, **kwargs) -> Incomplete: ... - -__test__: dict[Incomplete, Incomplete] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/emoji/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/emoji/METADATA.toml index 424bb5bd8..b0a6e7c5f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/emoji/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/emoji/METADATA.toml @@ -1,4 +1,2 @@ -version = "2.0.*" - -[tool.stubtest] -ignore_missing_stub = false +version = "2.1.*" +obsolete_since = "2.2.0" # Released on 2022-10-31 diff --git a/packages/pyright-internal/typeshed-fallback/stubs/emoji/emoji/core.pyi b/packages/pyright-internal/typeshed-fallback/stubs/emoji/emoji/core.pyi index 867b5e5d7..498586dee 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/emoji/emoji/core.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/emoji/emoji/core.pyi @@ -3,10 +3,6 @@ from typing_extensions import Literal, TypedDict _DEFAULT_DELIMITER: str -class _EmojiLisReturn(TypedDict): - emoji: str - location: int - class _EmojiListReturn(TypedDict): emoji: str match_start: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/entrypoints/entrypoints.pyi b/packages/pyright-internal/typeshed-fallback/stubs/entrypoints/entrypoints.pyi index 15f19e99c..08e89ec5a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/entrypoints/entrypoints.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/entrypoints/entrypoints.pyi @@ -1,8 +1,8 @@ import sys -from _typeshed import Self from collections.abc import Iterator, Sequence from configparser import ConfigParser from typing import Any +from typing_extensions import Self if sys.version_info >= (3, 8): from re import Pattern @@ -23,6 +23,8 @@ class NoSuchEntryPoint(Exception): name: str def __init__(self, group: str, name: str) -> None: ... +class CaseSensitiveConfigParser(ConfigParser): ... + class EntryPoint: name: str module_name: str @@ -34,12 +36,14 @@ class EntryPoint: ) -> None: ... def load(self) -> Any: ... @classmethod - def from_string(cls: type[Self], epstr: str, name: str, distro: Distribution | None = ...) -> Self: ... + def from_string(cls, epstr: str, name: str, distro: Distribution | None = ...) -> Self: ... class Distribution: name: str version: str def __init__(self, name: str, version: str) -> None: ... + @classmethod + def from_name_version(cls, name: str) -> Self: ... def iter_files_distros( path: Sequence[str] | None = ..., repeated_distro: str = ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/first/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/first/METADATA.toml index 424bb5bd8..58bc38349 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/first/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/first/METADATA.toml @@ -1,4 +1 @@ version = "2.0.*" - -[tool.stubtest] -ignore_missing_stub = false diff --git a/packages/pyright-internal/typeshed-fallback/stubs/flake8-2020/flake8_2020.pyi b/packages/pyright-internal/typeshed-fallback/stubs/flake8-2020/flake8_2020.pyi index 1ad67f93e..7af7c26b6 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/flake8-2020/flake8_2020.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/flake8-2020/flake8_2020.pyi @@ -6,10 +6,21 @@ import ast from collections.abc import Generator from typing import Any, ClassVar +YTT101: str +YTT102: str +YTT103: str +YTT201: str +YTT202: str +YTT203: str +YTT204: str +YTT301: str +YTT302: str +YTT303: str + +class Visitor(ast.NodeVisitor): ... + class Plugin: name: ClassVar[str] version: ClassVar[str] def __init__(self, tree: ast.AST) -> None: ... def run(self) -> Generator[tuple[int, int, str, type[Any]], None, None]: ... - -def __getattr__(name: str) -> Any: ... # incomplete (other attributes are normally not accessed) diff --git a/packages/pyright-internal/typeshed-fallback/stubs/flake8-bugbear/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/flake8-bugbear/METADATA.toml index 2e024da27..d15c66550 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/flake8-bugbear/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/flake8-bugbear/METADATA.toml @@ -1 +1,4 @@ -version = "22.7.1" +version = "23.3.12" + +[tool.stubtest] +ignore_missing_stub = true diff --git a/packages/pyright-internal/typeshed-fallback/stubs/flake8-bugbear/bugbear.pyi b/packages/pyright-internal/typeshed-fallback/stubs/flake8-bugbear/bugbear.pyi index dac90d0c1..d0b61fa80 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/flake8-bugbear/bugbear.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/flake8-bugbear/bugbear.pyi @@ -1,5 +1,6 @@ import argparse import ast +from _typeshed import Incomplete from collections.abc import Sequence from typing import Any @@ -23,6 +24,6 @@ class BugBearChecker: max_line_length: int = ..., options: argparse.Namespace | None = ..., ) -> None: ... - def __getattr__(self, name: str) -> Any: ... # incomplete (other attributes are normally not accessed) + def __getattr__(self, name: str) -> Incomplete: ... # incomplete (other attributes are normally not accessed) -def __getattr__(name: str) -> Any: ... # incomplete (other attributes are normally not accessed) +def __getattr__(name: str) -> Incomplete: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/flake8-builtins/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/flake8-builtins/METADATA.toml index 97ceca8aa..db11b9ead 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/flake8-builtins/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/flake8-builtins/METADATA.toml @@ -1 +1,4 @@ -version = "1.5.*" +version = "2.1.*" + +[tool.stubtest] +ignore_missing_stub = true diff --git a/packages/pyright-internal/typeshed-fallback/stubs/flake8-builtins/flake8_builtins.pyi b/packages/pyright-internal/typeshed-fallback/stubs/flake8-builtins/flake8_builtins.pyi index ffca177d8..c6aa608ca 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/flake8-builtins/flake8_builtins.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/flake8-builtins/flake8_builtins.pyi @@ -1,4 +1,5 @@ import ast +from _typeshed import Incomplete from collections.abc import Generator from typing import Any, ClassVar @@ -8,4 +9,4 @@ class BuiltinsChecker: def __init__(self, tree: ast.AST, filename: str) -> None: ... def run(self) -> Generator[tuple[int, int, str, type[Any]], None, None]: ... -def __getattr__(name: str) -> Any: ... # incomplete (other attributes are normally not accessed) +def __getattr__(name: str) -> Incomplete: ... # incomplete (other attributes are normally not accessed) diff --git a/packages/pyright-internal/typeshed-fallback/stubs/flake8-docstrings/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/flake8-docstrings/METADATA.toml index 6cf9fae44..bf44fdd13 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/flake8-docstrings/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/flake8-docstrings/METADATA.toml @@ -1 +1,4 @@ -version = "1.6.*" +version = "1.7.*" + +[tool.stubtest] +ignore_missing_stub = true diff --git a/packages/pyright-internal/typeshed-fallback/stubs/flake8-docstrings/flake8_docstrings.pyi b/packages/pyright-internal/typeshed-fallback/stubs/flake8-docstrings/flake8_docstrings.pyi index 08bdc39e0..49d96ed6e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/flake8-docstrings/flake8_docstrings.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/flake8-docstrings/flake8_docstrings.pyi @@ -1,5 +1,6 @@ import argparse import ast +from _typeshed import Incomplete from collections.abc import Generator, Iterable from typing import Any, ClassVar @@ -17,4 +18,4 @@ class pep257Checker: def parse_options(cls, options: argparse.Namespace) -> None: ... def run(self) -> Generator[tuple[int, int, str, type[Any]], None, None]: ... -def __getattr__(name: str) -> Any: ... # incomplete +def __getattr__(name: str) -> Incomplete: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/flake8-plugin-utils/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/flake8-plugin-utils/METADATA.toml index 3ea18392d..9a01e52f1 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/flake8-plugin-utils/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/flake8-plugin-utils/METADATA.toml @@ -1 +1,4 @@ version = "1.3.*" + +[tool.stubtest] +ignore_missing_stub = true diff --git a/packages/pyright-internal/typeshed-fallback/stubs/flake8-rst-docstrings/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/flake8-rst-docstrings/METADATA.toml index a42da251b..c8abb998f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/flake8-rst-docstrings/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/flake8-rst-docstrings/METADATA.toml @@ -1 +1,4 @@ -version = "0.2.*" +version = "0.3.*" + +[tool.stubtest] +ignore_missing_stub = true diff --git a/packages/pyright-internal/typeshed-fallback/stubs/flake8-simplify/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/flake8-simplify/METADATA.toml index d2a449c6f..1647ad358 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/flake8-simplify/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/flake8-simplify/METADATA.toml @@ -1 +1,4 @@ version = "0.19.*" + +[tool.stubtest] +ignore_missing_stub = true diff --git a/packages/pyright-internal/typeshed-fallback/stubs/flake8-typing-imports/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/flake8-typing-imports/METADATA.toml index bcb04b977..93e1f8e07 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/flake8-typing-imports/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/flake8-typing-imports/METADATA.toml @@ -1 +1,4 @@ -version = "1.13.*" +version = "1.14.*" + +[tool.stubtest] +ignore_missing_stub = true diff --git a/packages/pyright-internal/typeshed-fallback/stubs/flake8-typing-imports/flake8_typing_imports.pyi b/packages/pyright-internal/typeshed-fallback/stubs/flake8-typing-imports/flake8_typing_imports.pyi index 8ea857c9b..93212549f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/flake8-typing-imports/flake8_typing_imports.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/flake8-typing-imports/flake8_typing_imports.pyi @@ -1,5 +1,6 @@ import argparse import ast +from _typeshed import Incomplete from collections.abc import Generator from typing import Any, ClassVar @@ -13,4 +14,4 @@ class Plugin: def __init__(self, tree: ast.AST) -> None: ... def run(self) -> Generator[tuple[int, int, str, type[Any]], None, None]: ... -def __getattr__(name: str) -> Any: ... # incomplete (other attributes are normally not accessed) +def __getattr__(name: str) -> Incomplete: ... # incomplete (other attributes are normally not accessed) diff --git a/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/METADATA.toml index 9d6d88794..c83645ebf 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/METADATA.toml @@ -1,2 +1,5 @@ -version = "2.5.*" -requires = ["types-Pillow"] +version = "2.6.1" +requires = ["types-Pillow>=9.2.0"] + +[tool.stubtest] +stubtest_requirements = ["cryptography"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/__init__.pyi index 2ee9dd670..250fb72a4 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/__init__.pyi @@ -1,10 +1,29 @@ from pathlib import Path +from .enums import Align as Align, XPos as XPos, YPos as YPos from .fpdf import FPDF as FPDF, TitleStyle as TitleStyle from .html import HTML2FPDF as HTML2FPDF, HTMLMixin as HTMLMixin -from .template import Template as Template +from .prefs import ViewerPreferences as ViewerPreferences +from .template import FlexTemplate as FlexTemplate, Template as Template __license__: str __version__: str FPDF_VERSION: str FPDF_FONT_DIR: Path + +__all__ = [ + "__version__", + "__license__", + "FPDF", + "Align", + "XPos", + "YPos", + "Template", + "FlexTemplate", + "TitleStyle", + "ViewerPreferences", + "HTMLMixin", + "HTML2FPDF", + "FPDF_VERSION", + "FPDF_FONT_DIR", +] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/_fonttools_shims.pyi b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/_fonttools_shims.pyi new file mode 100644 index 000000000..95c6c6d33 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/_fonttools_shims.pyi @@ -0,0 +1,52 @@ +# from fontTools.misc.loggingTools +from abc import ABCMeta, abstractmethod +from collections.abc import Mapping +from logging import Logger +from typing import Protocol +from typing_extensions import TypeAlias + +# from fonttools.ttLib.ttGlyphSet +class _TTGlyph(Protocol): + def __init__(self, glyphSet: _TTGlyphSet, glyphName: str) -> None: ... + def draw(self, pen) -> None: ... + def drawPoints(self, pen) -> None: ... + +_TTGlyphSet: TypeAlias = Mapping[str, _TTGlyph] # Simplified for our needs + +# from fontTools.misc.loggingTools + +class LogMixin: + @property + def log(self) -> Logger: ... + +# from fontTools.pens.basePen +class AbstractPen: + @abstractmethod + def moveTo(self, pt: tuple[float, float]) -> None: ... + @abstractmethod + def lineTo(self, pt: tuple[float, float]) -> None: ... + @abstractmethod + def curveTo(self, *points: tuple[float, float]) -> None: ... + @abstractmethod + def qCurveTo(self, *points: tuple[float, float]) -> None: ... + def closePath(self) -> None: ... + def endPath(self) -> None: ... + @abstractmethod + def addComponent(self, glyphName: str, transformation: tuple[float, float, float, float, float, float]) -> None: ... + +class LoggingPen(LogMixin, AbstractPen, metaclass=ABCMeta): ... + +class DecomposingPen(LoggingPen, metaclass=ABCMeta): + skipMissingComponents: bool + glyphSet: _TTGlyphSet | None + def __init__(self, glyphSet: _TTGlyphSet | None) -> None: ... + def addComponent(self, glyphName: str, transformation: tuple[float, float, float, float, float, float]) -> None: ... + +class BasePen(DecomposingPen): + def __init__(self, glyphSet: _TTGlyphSet | None = ...) -> None: ... + def closePath(self) -> None: ... + def endPath(self) -> None: ... + def moveTo(self, pt: tuple[float, float]) -> None: ... + def lineTo(self, pt: tuple[float, float]) -> None: ... + def curveTo(self, *points: tuple[float, float]) -> None: ... + def qCurveTo(self, *points: tuple[float, float]) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/actions.pyi b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/actions.pyi index 4ade27738..128155fab 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/actions.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/actions.pyi @@ -1,30 +1,36 @@ from _typeshed import Incomplete -from abc import ABC +from abc import ABC, abstractmethod from .syntax import PDFObject class Action(ABC): next: PDFObject | str | None def __init__(self, next_action: PDFObject | str | None = ...) -> None: ... - def dict_as_string(self, key_values: dict[str, Incomplete] | None = ...) -> str: ... + @abstractmethod + def serialize(self) -> str: ... + +class URIAction(Action): + uri: str + def __init__(self, uri: str, next_action: PDFObject | str | None = ...) -> None: ... + def serialize(self) -> str: ... class NamedAction(Action): - action_name: Incomplete - def __init__(self, action_name, next_action: PDFObject | str | None = ...) -> None: ... - def dict_as_string(self) -> str: ... # type: ignore[override] + action_name: str + def __init__(self, action_name: str, next_action: PDFObject | str | None = ...) -> None: ... + def serialize(self) -> str: ... class GoToAction(Action): dest: Incomplete def __init__(self, dest, next_action: PDFObject | str | None = ...) -> None: ... - def dict_as_string(self) -> str: ... # type: ignore[override] + def serialize(self) -> str: ... class GoToRemoteAction(Action): - file: Incomplete + file: str dest: Incomplete - def __init__(self, file, dest, next_action: PDFObject | str | None = ...) -> None: ... - def dict_as_string(self) -> str: ... # type: ignore[override] + def __init__(self, file: str, dest, next_action: PDFObject | str | None = ...) -> None: ... + def serialize(self) -> str: ... class LaunchAction(Action): - file: Incomplete - def __init__(self, file, next_action: PDFObject | str | None = ...) -> None: ... - def dict_as_string(self) -> str: ... # type: ignore[override] + file: str + def __init__(self, file: str, next_action: PDFObject | str | None = ...) -> None: ... + def serialize(self) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/annotations.pyi b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/annotations.pyi new file mode 100644 index 000000000..acf715b1d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/annotations.pyi @@ -0,0 +1,80 @@ +from _typeshed import Incomplete +from datetime import datetime +from typing import NamedTuple + +from .actions import Action +from .enums import AnnotationFlag, AnnotationName, FileAttachmentAnnotationName +from .syntax import Destination, Name, PDFContentStream, PDFObject + +DEFAULT_ANNOT_FLAGS: Incomplete + +class AnnotationMixin: + type: Name + subtype: Name + rect: str + border: str + f_t: Name | None + v: Incomplete | None + f: int # AnnotationFlags + contents: str | None + a: Action | None + dest: Destination | None + c: str | None + t: str | None + m: str | None + quad_points: str | None + p: Incomplete | None + name: AnnotationName | FileAttachmentAnnotationName | None + ink_list: str | None + f_s: str | None + def __init__( + self, + subtype: str, + x: int, + y: int, + width: int, + height: int, + flags: tuple[AnnotationFlag, ...] = ..., + contents: str | None = ..., + dest: Destination | None = ..., + action: Action | None = ..., + color: tuple[int, int, int] | None = ..., + modification_time: datetime | None = ..., + title: str | None = ..., + quad_points: tuple[float, ...] | None = ..., # multiple of 8 floats + border_width: int = ..., + name: AnnotationName | FileAttachmentAnnotationName | None = ..., + ink_list: tuple[int, ...] = ..., + file_spec: str | None = ..., + field_type: str | None = ..., + value: Incomplete | None = ..., + ) -> None: ... + +class PDFAnnotation(AnnotationMixin, PDFObject): ... + +class AnnotationDict(AnnotationMixin): + def serialize(self) -> str: ... + +class PDFEmbeddedFile(PDFContentStream): + type: Name + params: str + def __init__( + self, + basename: str, + contents: bytes, + desc: str = ..., + creation_date: datetime | None = ..., + modification_date: datetime | None = ..., + compress: bool = ..., + checksum: bool = ..., + ) -> None: ... + def globally_enclosed(self) -> bool: ... + def set_globally_enclosed(self, value: bool) -> None: ... + def basename(self) -> str: ... + def file_spec(self) -> FileSpec: ... + +class FileSpec(NamedTuple): + embedded_file: PDFEmbeddedFile + basename: str + desc: str + def serialize(self) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/deprecation.pyi b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/deprecation.pyi index 044aa1cf7..91885bd3d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/deprecation.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/deprecation.pyi @@ -1,5 +1,5 @@ from types import ModuleType class WarnOnDeprecatedModuleAttributes(ModuleType): - def __getattr__(self, name): ... - def __setattr__(self, name, value) -> None: ... + def __getattr__(self, name: str): ... + def __setattr__(self, name: str, value) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/drawing.pyi b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/drawing.pyi new file mode 100644 index 000000000..24a1b543c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/drawing.pyi @@ -0,0 +1,417 @@ +import decimal +from _typeshed import Incomplete +from collections import OrderedDict +from collections.abc import Callable, Generator, Iterator +from contextlib import contextmanager +from re import Pattern +from typing import Any, ClassVar, NamedTuple, TypeVar +from typing_extensions import Self, TypeAlias + +from .syntax import Name, Raw + +__pdoc__: dict[str, bool] + +_CallableT = TypeVar("_CallableT", bound=Callable[..., Any]) + +def force_nodocument(item: _CallableT) -> _CallableT: ... +def force_document(item: _CallableT) -> _CallableT: ... + +Number: TypeAlias = int | float | decimal.Decimal +NumberClass: tuple[type, ...] +WHITESPACE: frozenset[str] +EOL_CHARS: frozenset[str] +DELIMITERS: frozenset[str] +STR_ESC: Pattern[str] +STR_ESC_MAP: dict[str, str] + +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: ... + +class _DeviceRGBBase(NamedTuple): + r: Number + g: Number + b: Number + a: Number | None + +class DeviceRGB(_DeviceRGBBase): + OPERATOR: ClassVar[str] + def __new__(cls, r: Number, g: Number, b: Number, a: Number | None = ...) -> Self: ... + @property + def colors(self) -> tuple[Number, Number, Number]: ... + def serialize(self) -> str: ... + +class _DeviceGrayBase(NamedTuple): + g: Number + a: Number | None + +class DeviceGray(_DeviceGrayBase): + OPERATOR: ClassVar[str] + def __new__(cls, g: Number, a: Number | None = ...) -> Self: ... + @property + def colors(self) -> tuple[Number]: ... + def serialize(self) -> str: ... + +class _DeviceCMYKBase(NamedTuple): + c: Number + m: Number + y: Number + k: Number + a: Number | None + +class DeviceCMYK(_DeviceCMYKBase): + OPERATOR: ClassVar[str] + def __new__(cls, c: Number, m: Number, y: Number, k: Number, a: Number | None = ...) -> Self: ... + @property + def colors(self) -> tuple[Number, Number, Number, Number]: ... + def serialize(self) -> str: ... + +def rgb8(r, g, b, a: Incomplete | None = ...) -> DeviceRGB: ... +def gray8(g, a: Incomplete | None = ...) -> DeviceGray: ... +def cmyk8(c, m, y, k, a: Incomplete | None = ...) -> DeviceCMYK: ... +def color_from_hex_string(hexstr) -> DeviceRGB: ... +def color_from_rgb_string(rgbstr) -> 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): ... + +class Transform(NamedTuple): + a: Number + b: Number + c: Number + d: Number + e: Number + f: Number + @classmethod + def identity(cls): ... + @classmethod + def translation(cls, x, y): ... + @classmethod + def scaling(cls, x, y: Incomplete | None = ...): ... + @classmethod + def rotation(cls, theta): ... + @classmethod + def rotation_d(cls, theta_d): ... + @classmethod + def shearing(cls, x, y: Incomplete | None = ...): ... + def translate(self, x, y): ... + def scale(self, x, y: Incomplete | None = ...): ... + def rotate(self, theta): ... + def rotate_d(self, theta_d): ... + def shear(self, x, y: Incomplete | None = ...): ... + def about(self, x, y): ... + def __mul__(self, other): ... + def __rmul__(self, other): ... + def __matmul__(self, other): ... + def render(self, last_item): ... + +class GraphicsStyle: + INHERIT: ClassVar[Incomplete] + MERGE_PROPERTIES: ClassVar[tuple[str, ...]] + TRANSPARENCY_KEYS: ClassVar[tuple[Name, ...]] + PDF_STYLE_KEYS: ClassVar[tuple[Name, ...]] + @classmethod + def merge(cls, parent, child): ... + def __init__(self) -> None: ... + def __deepcopy__(self, memo) -> Self: ... + @property + def allow_transparency(self): ... + @allow_transparency.setter + def allow_transparency(self, new): ... + @property + def paint_rule(self): ... + @paint_rule.setter + def paint_rule(self, new) -> None: ... + @property + def auto_close(self): ... + @auto_close.setter + def auto_close(self, new) -> None: ... + @property + def intersection_rule(self): ... + @intersection_rule.setter + def intersection_rule(self, new) -> None: ... + @property + def fill_color(self): ... + @fill_color.setter + def fill_color(self, color) -> None: ... + @property + def fill_opacity(self): ... + @fill_opacity.setter + def fill_opacity(self, new) -> None: ... + @property + def stroke_color(self): ... + @stroke_color.setter + def stroke_color(self, color) -> None: ... + @property + def stroke_opacity(self): ... + @stroke_opacity.setter + def stroke_opacity(self, new) -> None: ... + @property + def blend_mode(self): ... + @blend_mode.setter + def blend_mode(self, value) -> None: ... + @property + def stroke_width(self): ... + @stroke_width.setter + def stroke_width(self, width) -> None: ... + @property + def stroke_cap_style(self): ... + @stroke_cap_style.setter + def stroke_cap_style(self, value) -> None: ... + @property + def stroke_join_style(self): ... + @stroke_join_style.setter + def stroke_join_style(self, value) -> None: ... + @property + def stroke_miter_limit(self): ... + @stroke_miter_limit.setter + def stroke_miter_limit(self, value) -> None: ... + @property + def stroke_dash_pattern(self): ... + @stroke_dash_pattern.setter + def stroke_dash_pattern(self, value) -> None: ... + @property + def stroke_dash_phase(self): ... + @stroke_dash_phase.setter + def stroke_dash_phase(self, value): ... + def serialize(self) -> Raw | None: ... + def resolve_paint_rule(self): ... + +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): ... + +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): ... + +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): ... + +class RelativeLine(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): ... + +class HorizontalLine(NamedTuple): + x: Number + def render(self, gsd_registry, style, last_item, initial_point): ... + def render_debug(self, gsd_registry, style, last_item, initial_point, debug_stream, pfx): ... + +class RelativeHorizontalLine(NamedTuple): + x: Number + def render(self, gsd_registry, style, last_item, initial_point): ... + def render_debug(self, gsd_registry, style, last_item, initial_point, debug_stream, pfx): ... + +class VerticalLine(NamedTuple): + y: Number + def render(self, gsd_registry, style, last_item, initial_point): ... + def render_debug(self, gsd_registry, style, last_item, initial_point, debug_stream, pfx): ... + +class RelativeVerticalLine(NamedTuple): + y: Number + def render(self, gsd_registry, style, last_item, initial_point): ... + def render_debug(self, gsd_registry, style, last_item, initial_point, debug_stream, pfx): ... + +class BezierCurve(NamedTuple): + c1: Point + c2: Point + end: 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): ... + +class RelativeBezierCurve(NamedTuple): + c1: Point + c2: Point + end: 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): ... + +class QuadraticBezierCurve(NamedTuple): + ctrl: Point + end: Point + @property + def end_point(self): ... + 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): ... + +class RelativeQuadraticBezierCurve(NamedTuple): + ctrl: Point + end: 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): ... + +class Arc(NamedTuple): + radii: Point + rotation: Number + large: bool + sweep: bool + end: Point + @staticmethod + def subdivde_sweep(sweep_angle) -> Generator[Incomplete, None, None]: ... + def render(self, gsd_registry, style, last_item, initial_point): ... + def render_debug(self, gsd_registry, style, last_item, initial_point, debug_stream, pfx): ... + +class RelativeArc(NamedTuple): + radii: Point + rotation: Number + large: bool + sweep: bool + end: 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): ... + +class Rectangle(NamedTuple): + org: Point + size: 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): ... + +class RoundedRectangle(NamedTuple): + org: Point + size: Point + corner_radii: 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): ... + +class Ellipse(NamedTuple): + radii: Point + center: 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): ... + +class ImplicitClose(NamedTuple): + def render(self, gsd_registry, style, last_item, initial_point): ... + def render_debug(self, gsd_registry, style, last_item, initial_point, debug_stream, pfx): ... + +class Close(NamedTuple): + def render(self, gsd_registry, style, last_item, initial_point): ... + def render_debug(self, gsd_registry, style, last_item, initial_point, debug_stream, pfx): ... + +class DrawingContext: + def __init__(self) -> None: ... + def add_item(self, item, _copy: bool = ...) -> None: ... + def render(self, gsd_registry, first_point, scale, height, starting_style): ... + def render_debug(self, gsd_registry, first_point, scale, height, starting_style, debug_stream): ... + +class PaintedPath: + def __init__(self, x: int = ..., y: int = ...) -> None: ... + def __deepcopy__(self, memo) -> Self: ... + @property + def style(self): ... + @property + def transform(self): ... + @transform.setter + def transform(self, tf) -> None: ... + @property + def auto_close(self): ... + @auto_close.setter + def auto_close(self, should) -> None: ... + @property + def paint_rule(self): ... + @paint_rule.setter + def paint_rule(self, style) -> None: ... + @property + def clipping_path(self): ... + @clipping_path.setter + def clipping_path(self, new_clipath) -> None: ... + @contextmanager + def transform_group(self, transform) -> Iterator[Self]: ... + def add_path_element(self, item, _copy: bool = ...) -> None: ... + def remove_last_path_element(self) -> None: ... + def rectangle(self, x, y, w, h, rx: int = ..., ry: int = ...) -> 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 close(self) -> None: ... + def render( + self, gsd_registry, style, last_item, initial_point, debug_stream: Incomplete | None = ..., pfx: Incomplete | 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 = ..., y: int = ...) -> None: ... + def render( + self, gsd_registry, style, last_item, initial_point, debug_stream: Incomplete | None = ..., pfx: Incomplete | None = ... + ): ... + def render_debug(self, gsd_registry, style, last_item, initial_point, debug_stream, pfx): ... + +class GraphicsContext: + style: GraphicsStyle + path_items: list[Incomplete] + def __init__(self) -> None: ... + def __deepcopy__(self, memo) -> Self: ... + @property + def transform(self) -> Transform | None: ... + @transform.setter + def transform(self, tf) -> None: ... + @property + def clipping_path(self) -> ClippingPath | None: ... + @clipping_path.setter + def clipping_path(self, new_clipath) -> None: ... + def add_item(self, item, _copy: bool = ...) -> None: ... + def remove_last_item(self) -> None: ... + def merge(self, other_context) -> None: ... + def build_render_list( + self, + gsd_registry, + style, + last_item, + initial_point, + debug_stream: Incomplete | None = ..., + pfx: Incomplete | None = ..., + _push_stack: bool = ..., + ): ... + def render( + self, + gsd_registry, + style: DrawingContext, + last_item, + initial_point, + debug_stream: Incomplete | None = ..., + pfx: Incomplete | None = ..., + _push_stack: bool = ..., + ): ... + def render_debug( + self, gsd_registry, style: DrawingContext, last_item, initial_point, debug_stream, pfx, _push_stack: bool = ... + ): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/encryption.pyi b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/encryption.pyi new file mode 100644 index 000000000..1888d6f3b --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/encryption.pyi @@ -0,0 +1,89 @@ +from _typeshed import Incomplete, SupportsLenAndGetItem +from collections.abc import Generator, Iterable +from typing import ClassVar, Protocol, TypeVar +from typing_extensions import TypeAlias + +from .enums import EncryptionMethod +from .fpdf import FPDF +from .syntax import Name, PDFObject + +_Key: TypeAlias = SupportsLenAndGetItem[int] +_T_co = TypeVar("_T_co", covariant=True) + +import_error: ImportError | None + +class _SupportsGetItem(Protocol[_T_co]): + def __getitem__(self, __k: int) -> _T_co: ... + +class ARC4: + MOD: ClassVar[int] + def KSA(self, key: _Key) -> list[int]: ... + def PRGA(self, S: _SupportsGetItem[int]) -> Generator[int, None, None]: ... + def encrypt(self, key: _Key, text: Iterable[int]) -> list[int]: ... + +class CryptFilter: + type: Name + c_f_m: Name + length: int + def __init__(self, mode, length) -> None: ... + def serialize(self) -> str: ... + +class EncryptionDictionary(PDFObject): + filter: Name + length: int + r: int + o: str + u: str + v: int + p: int + encrypt_metadata: str # not always defined + c_f: str # not always defined + stm_f: Name + str_f: Name + def __init__(self, security_handler: StandardSecurityHandler) -> None: ... + +class StandardSecurityHandler: + DEFAULT_PADDING: ClassVar[bytes] + fpdf: FPDF + access_permission: int + owner_password: str + user_password: str + encryption_method: EncryptionMethod | None + cf: CryptFilter | None + key_length: int + v: int + r: int + encrypt_metadata: bool + + # The following fields are only defined after a call to generate_passwords(). + file_id: Incomplete + info_id: Incomplete + o: str + k: str + u: str + + def __init__( + self, + fpdf: FPDF, + owner_password: str, + user_password: str | None = None, + permission: Incomplete | None = None, + encryption_method: EncryptionMethod | None = None, + encrypt_metadata: bool = False, + ) -> None: ... + def generate_passwords(self, file_id) -> None: ... + def get_encryption_obj(self) -> EncryptionDictionary: ... + def encrypt(self, text: str | bytes | bytearray, obj_id) -> bytes: ... + def encrypt_string(self, string, obj_id): ... + def encrypt_stream(self, stream, obj_id): ... + def is_aes_algorithm(self) -> bool: ... + def encrypt_bytes(self, data, obj_id) -> list[int]: ... + def encrypt_AES_cryptography(self, key, data): ... + def get_initialization_vector(self, size: int) -> bytearray: ... + def padded_password(self, password: str) -> bytearray: ... + def generate_owner_password(self) -> str: ... + def generate_user_password(self) -> str: ... + def generate_encryption_key(self) -> bytes: ... + +def md5(data: bytes) -> bytes: ... +def int32(n: int) -> int: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/enums.pyi b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/enums.pyi index 33db22617..9f82c6008 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/enums.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/enums.pyi @@ -1,21 +1,26 @@ -from _typeshed import Incomplete, Self -from enum import Enum, IntEnum +from enum import Enum, Flag, IntEnum, IntFlag +from typing_extensions import Literal, Self from .syntax import Name -class DocumentState(IntEnum): - UNINITIALIZED: int - READY: int - GENERATING_PAGE: int - CLOSED: int +class SignatureFlag(IntEnum): + SIGNATURES_EXIST: int + APPEND_ONLY: int class CoerciveEnum(Enum): @classmethod - def coerce(cls: type[Self], value: Self | str) -> Self: ... + def coerce(cls, value: Self | str) -> Self: ... class CoerciveIntEnum(IntEnum): @classmethod - def coerce(cls: type[Self], value: Self | str | int) -> Self: ... + def coerce(cls, value: Self | str | int) -> Self: ... + +class CharVPos(CoerciveEnum): + SUP: str + SUB: str + NOM: str + DENOM: str + LINE: str class Align(CoerciveEnum): C: str @@ -122,6 +127,11 @@ class AnnotationName(CoerciveEnum): NEW_PARAGRAPH: Name INSERT: Name +class FileAttachmentAnnotationName(CoerciveEnum): + PUSH_PIN: Name + GRAPH_PUSH_PIN: Name + PAPERCLIP_TAG: Name + class IntersectionRule(CoerciveEnum): NONZERO: str EVENODD: str @@ -166,4 +176,29 @@ class Corner(CoerciveEnum): BOTTOM_RIGHT: str BOTTOM_LEFT: str -__pdoc__: Incomplete +class FontDescriptorFlags(Flag): + FIXED_PITCH: int + SYMBOLIC: int + ITALIC: int + FORCE_BOLD: int + +class AccessPermission(IntFlag): + PRINT_LOW_RES: int + MODIFY: int + COPY: int + ANNOTATION: int + FILL_FORMS: int + COPY_FOR_ACCESSIBILITY: int + ASSEMBLE: int + PRINT_HIGH_RES: int + @classmethod + def all(cls) -> int: ... + @classmethod + def none(cls) -> Literal[0]: ... + +class EncryptionMethod(Enum): + NO_ENCRYPTION: int + RC4: int + AES_128: int + +__pdoc__: dict[str, bool] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/errors.pyi b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/errors.pyi index 637a55e25..c417166e0 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/errors.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/errors.pyi @@ -7,3 +7,6 @@ class FPDFPageFormatException(FPDFException): unknown: Any one: Any def __init__(self, argument, unknown: bool = ..., one: bool = ...) -> None: ... + +class FPDFUnicodeEncodingException(FPDFException): + def __init__(self, text_index, character, font_name) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/fpdf.pyi b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/fpdf.pyi index 2c7569bb6..0c6b86b34 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/fpdf.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/fpdf.pyi @@ -1,53 +1,47 @@ import datetime from _typeshed import Incomplete, StrPath -from collections import defaultdict -from collections.abc import Callable, Sequence +from collections.abc import Callable, Iterable, Sequence from contextlib import _GeneratorContextManager -from enum import IntEnum from io import BytesIO +from pathlib import PurePath +from re import Pattern from typing import Any, ClassVar, NamedTuple, overload from typing_extensions import Literal, TypeAlias +from fpdf import ViewerPreferences from PIL import Image -from .actions import Action -from .enums import Align, AnnotationFlag, AnnotationName, Corner, PageLayout, RenderStyle, TextMarkupType, XPos, YPos +from .annotations import AnnotationDict, PDFEmbeddedFile +from .drawing import DrawingContext, PaintedPath +from .enums import ( + Align, + AnnotationFlag, + AnnotationName, + Corner, + FileAttachmentAnnotationName, + PageLayout, + PathPaintRule, + RenderStyle, + TextMarkupType, + TextMode as TextMode, + XPos as XPos, + YPos as YPos, +) +from .html import HTML2FPDF +from .output import PDFPage from .recorder import FPDFRecorder +from .structure_tree import StructureTreeBuilder from .syntax import DestinationXYZ from .util import _Unit +__all__ = ["FPDF", "XPos", "YPos", "get_page_format", "TextMode", "TitleStyle", "PAGE_FORMATS"] + _Orientation: TypeAlias = Literal["", "portrait", "p", "P", "landscape", "l", "L"] _Format: TypeAlias = Literal["", "a3", "A3", "a4", "A4", "a5", "A5", "letter", "Letter", "legal", "Legal"] _FontStyle: TypeAlias = Literal["", "B", "I"] _FontStyles: TypeAlias = Literal["", "B", "I", "U", "BU", "UB", "BI", "IB", "IU", "UI", "BIU", "BUI", "IBU", "IUB", "UBI", "UIB"] PAGE_FORMATS: dict[_Format, tuple[float, float]] -class DocumentState(IntEnum): - UNINITIALIZED: int - READY: int - GENERATING_PAGE: int - CLOSED: int - -class Annotation(NamedTuple): - type: str - x: int - y: int - width: int - height: int - flags: tuple[AnnotationFlag, ...] = ... - contents: str | None = ... - link: str | int | None = ... - alt_text: str | None = ... - action: Action | None = ... - color: int | None = ... - modification_time: datetime.datetime | None = ... - title: str | None = ... - quad_points: Sequence[int] | None = ... - page: int | None = ... - border_width: int = ... - name: AnnotationName | None = ... - ink_list: tuple[int, ...] = ... - class TitleStyle(NamedTuple): font_family: str | None = ... font_style: str | None = ... @@ -65,66 +59,80 @@ class ToCPlaceholder(NamedTuple): pages: int = ... class SubsetMap: - def __init__(self, identities: list[int]) -> None: ... + def __init__(self, identities: Iterable[int]) -> None: ... + def __len__(self) -> int: ... def pick(self, unicode: int) -> int: ... def dict(self) -> dict[int, int]: ... def get_page_format(format: _Format | tuple[float, float], k: float | None = ...) -> tuple[float, float]: ... # TODO: TypedDicts -_Page: TypeAlias = dict[str, Any] _Font: TypeAlias = dict[str, Any] -_FontFile: TypeAlias = dict[str, Any] _Image: TypeAlias = dict[str, Any] class FPDF: MARKDOWN_BOLD_MARKER: ClassVar[str] MARKDOWN_ITALICS_MARKER: ClassVar[str] MARKDOWN_UNDERLINE_MARKER: ClassVar[str] - offsets: dict[int, int] + MARKDOWN_LINK_REGEX: ClassVar[Pattern[str]] + MARKDOWN_LINK_COLOR: ClassVar[Incomplete | None] + + HTML2FPDF_CLASS: ClassVar[type[HTML2FPDF]] + page: int - n: int - buffer: bytearray - pages: dict[int, _Page] - state: DocumentState + pages: dict[int, PDFPage] fonts: dict[str, _Font] - font_files: dict[str, _FontFile] - diffs: dict[int, int] images: dict[str, _Image] - annots: defaultdict[int, list[Annotation]] links: dict[int, DestinationXYZ] - in_footer: int - lasth: int - current_font: _Font - font_family: str - font_style: str + embedded_files: list[PDFEmbeddedFile] + + in_footer: bool str_alias_nb_pages: str - underline: int - draw_color: str - fill_color: str - text_color: str - ws: int - angle: int + xmp_metadata: str | None image_filter: str page_duration: int page_transition: Incomplete | None - struct_builder: Incomplete - section_title_styles: Incomplete - core_fonts: Incomplete + allow_images_transparency: bool + oversized_images: Incomplete | None + oversized_images_ratio: float + struct_builder: StructureTreeBuilder + section_title_styles: dict[int, Incomplete] + + core_fonts: dict[str, str] core_fonts_encoding: str - font_aliases: Incomplete + font_aliases: dict[str, str] k: float - def_orientation: Incomplete - font_size: float - c_margin: float + + font_family: str + font_style: str + font_size_pt: float + font_stretching: float + char_spacing: float + underline: bool + current_font: _Font + draw_color: str + fill_color: str + text_color: str + page_background: Incomplete | None + dash_pattern: dict[str, int] # TODO: TypedDict line_width: float + text_mode: TextMode + dw_pt: float dh_pt: float - pdf_version: str - + def_orientation: Literal["P", "L"] x: float y: float + l_margin: float + t_margin: float + c_margin: float + viewer_preferences: ViewerPreferences | None + compress: bool + pdf_version: str + creation_date: datetime.datetime + + buffer: bytearray | None # Set during call to _set_orientation(), called from __init__(). cur_orientation: Literal["P", "L"] @@ -132,26 +140,39 @@ class FPDF: h_pt: float w: float h: float + def __init__( self, orientation: _Orientation = ..., unit: _Unit | float = ..., format: _Format | tuple[float, float] = ..., - font_cache_dir: str | Literal["DEPRECATED"] = ..., + font_cache_dir: Literal["DEPRECATED"] = ..., ) -> None: ... + # The following definition crashes stubtest 0.991, but seems to be fixed + # in later versions. + # def set_encryption( + # self, + # owner_password: str, + # user_password: str | None = None, + # encryption_method: EncryptionMethod | str = ..., + # permissions: AccessPermission = ..., + # encrypt_metadata: bool = False, + # ) -> None: ... + # args and kwargs are passed to HTML2FPDF_CLASS constructor. + def write_html(self, text: str, *args: Any, **kwargs: Any) -> None: ... @property - def font_size_pt(self) -> float: ... + def is_ttf_font(self) -> bool: ... @property - def unifontsubset(self) -> bool: ... + def page_mode(self): ... @property def epw(self) -> float: ... @property def eph(self) -> float: ... + @property + def pages_count(self) -> int: ... def set_margin(self, margin: float) -> None: ... def set_margins(self, left: float, top: float, right: float = ...) -> None: ... - l_margin: float def set_left_margin(self, margin: float) -> None: ... - t_margin: float def set_top_margin(self, margin: float) -> None: ... r_margin: float def set_right_margin(self, margin: float) -> None: ... @@ -159,6 +180,8 @@ class FPDF: b_margin: float page_break_trigger: float def set_auto_page_break(self, auto: bool, margin: float = ...) -> None: ... + @property + def default_page_dimensions(self) -> tuple[float, float]: ... zoom_mode: Literal["fullpage", "fullwidth", "real", "default"] | float page_layout: PageLayout | None def set_display_mode( @@ -166,7 +189,6 @@ class FPDF: zoom: Literal["fullpage", "fullwidth", "real", "default"] | float, layout: Literal["single", "continuous", "two", "default"] = ..., ) -> None: ... - compress: bool def set_compression(self, compress: bool) -> None: ... title: str def set_title(self, title: str) -> None: ... @@ -182,14 +204,11 @@ class FPDF: def set_creator(self, creator: str) -> None: ... producer: str def set_producer(self, producer: str) -> None: ... - creation_date: datetime.datetime | bool | None - def set_creation_date(self, date: datetime.datetime | bool | None = ...) -> None: ... + def set_creation_date(self, date: datetime.datetime) -> None: ... def set_xmp_metadata(self, xmp_metadata: str) -> None: ... def set_doc_option(self, opt: str, value: str) -> None: ... def set_image_filter(self, image_filter: str) -> None: ... def alias_nb_pages(self, alias: str = ...) -> None: ... - def open(self) -> None: ... - def close(self) -> None: ... def add_page( self, orientation: _Orientation = ..., @@ -206,6 +225,13 @@ class FPDF: def set_text_color(self, r: int, g: int = ..., b: int = ...) -> None: ... def get_string_width(self, s: str, normalized: bool = ..., markdown: bool = ...) -> float: ... def set_line_width(self, width: float) -> None: ... + def set_page_background(self, background) -> None: ... + def drawing_context(self, debug_stream: Incomplete | None = ...) -> _GeneratorContextManager[DrawingContext]: ... + def new_path( + self, x: float = ..., y: float = ..., paint_rule: PathPaintRule = ..., debug_stream: Incomplete | None = ... + ) -> _GeneratorContextManager[PaintedPath]: ... + def draw_path(self, path: PaintedPath, debug_stream: Incomplete | None = ...) -> None: ... + def set_dash_pattern(self, dash: float = ..., gap: float = ..., phase: float = ...) -> None: ... def line(self, x1: float, y1: float, x2: float, y2: float) -> None: ... def polyline( self, point_list: list[tuple[float, float]], fill: bool = ..., polygon: bool = ..., style: RenderStyle | str | None = ... @@ -243,18 +269,78 @@ class FPDF: rotate_degrees: float = ..., style: RenderStyle | str | None = ..., ): ... + def arc( + self, + x: float, + y: float, + a: float, + start_angle: float, + end_angle: float, + b: float | None = ..., + inclination: float = ..., + clockwise: bool = ..., + start_from_center: bool = ..., + end_at_center: bool = ..., + style: RenderStyle | str | None = ..., + ) -> None: ... + def solid_arc( + self, + x: float, + y: float, + a: float, + start_angle: float, + end_angle: float, + b: float | None = ..., + inclination: float = ..., + clockwise: bool = ..., + style: RenderStyle | str | None = ..., + ) -> None: ... def add_font( - self, family: str, style: _FontStyle = ..., fname: str | None = ..., uni: bool | Literal["DEPRECATED"] = ... + self, + family: str | None = None, + style: _FontStyle = "", + fname: str | PurePath | None = None, + uni: bool | Literal["DEPRECATED"] = "DEPRECATED", ) -> None: ... def set_font(self, family: str | None = ..., style: _FontStyles = ..., size: int = ...) -> None: ... def set_font_size(self, size: float) -> None: ... - font_stretching: float + def set_char_spacing(self, spacing: float) -> None: ... def set_stretching(self, stretching: float) -> None: ... - def add_link(self) -> int: ... - def set_link(self, link, y: int = ..., x: int = ..., page: int = ..., zoom: float | Literal["null"] = ...) -> None: ... + def add_link(self, y: float = 0, x: float = 0, page: int = -1, zoom: float | Literal["null"] = "null") -> int: ... + def set_link(self, link, y: float = 0, x: float = 0, page: int = -1, zoom: float | Literal["null"] = "null") -> None: ... def link( self, x: float, y: float, w: float, h: float, link: str | int, alt_text: str | None = ..., border_width: int = ... - ) -> Annotation: ... + ) -> AnnotationDict: ... + def embed_file( + self, + file_path: StrPath | None = ..., + bytes: bytes | None = ..., + basename: str | None = ..., + modification_date: datetime.datetime | None = ..., + *, + creation_date: datetime.datetime | None = ..., + desc: str = ..., + compress: bool = ..., + checksum: bool = ..., + ) -> str: ... + def file_attachment_annotation( + self, + file_path: StrPath, + x: float, + y: float, + w: float = ..., + h: float = ..., + name: FileAttachmentAnnotationName | str | None = ..., + flags: Iterable[AnnotationFlag | str] = ..., + *, + bytes: bytes | None = ..., + basename: str | None = ..., + creation_date: datetime.datetime | None = ..., + modification_date: datetime.datetime | None = ..., + desc: str = ..., + compress: bool = ..., + checksum: bool = ..., + ) -> AnnotationDict: ... def text_annotation( self, x: float, @@ -284,10 +370,33 @@ class FPDF: color: tuple[float, float, float] = ..., modification_time: datetime.datetime | None = ..., page: int | None = ..., - ) -> Annotation: ... + ) -> AnnotationDict: ... + def ink_annotation( + self, + coords: Iterable[Incomplete], + contents: str = ..., + title: str = ..., + color: Sequence[float] = ..., + border_width: int = ..., + ) -> AnnotationDict: ... def text(self, x: float, y: float, txt: str = ...) -> None: ... def rotate(self, angle: float, x: float | None = ..., y: float | None = ...) -> None: ... def rotation(self, angle: float, x: float | None = ..., y: float | None = ...) -> _GeneratorContextManager[None]: ... + def skew( + self, ax: float = 0, ay: float = 0, x: float | None = None, y: float | None = None + ) -> _GeneratorContextManager[None]: ... + def local_context( + self, + font_family: Incomplete | None = ..., + font_style: Incomplete | None = ..., + font_size: Incomplete | None = ..., + line_width: Incomplete | None = ..., + draw_color: Incomplete | None = ..., + fill_color: Incomplete | None = ..., + text_color: Incomplete | None = ..., + dash_pattern: Incomplete | None = ..., + **kwargs, + ) -> _GeneratorContextManager[None]: ... @property def accept_page_break(self) -> bool: ... def cell( @@ -327,14 +436,15 @@ class FPDF: def image( self, name: str | Image.Image | BytesIO | StrPath, - x: float | None = ..., - y: float | None = ..., - w: float = ..., - h: float = ..., - type: str = ..., - link: str = ..., - title: str | None = ..., - alt_text: str | None = ..., + x: float | Align | None = None, + y: float | None = None, + w: float = 0, + h: float = 0, + type: str = "", + link: str = "", + title: str | None = None, + alt_text: str | None = None, + dims: tuple[float, float] | None = None, ) -> _Image: ... def ln(self, h: float | None = ...) -> None: ... def get_x(self) -> float: ... @@ -347,10 +457,37 @@ class FPDF: @overload def output(self, name: str) -> None: ... def normalize_text(self, txt: str) -> str: ... + def sign_pkcs12( + self, + pkcs_filepath: str, + password: bytes | None = ..., + hashalgo: str = ..., + contact_info: str | None = ..., + location: str | None = ..., + signing_time: datetime.datetime | None = ..., + reason: str | None = ..., + flags: tuple[AnnotationFlag, ...] = ..., + ) -> None: ... + def sign( + self, + key, + cert, + extra_certs: Sequence[Incomplete] = ..., + hashalgo: str = ..., + contact_info: str | None = ..., + location: str | None = ..., + signing_time: datetime.datetime | None = ..., + reason: str | None = ..., + flags: tuple[AnnotationFlag, ...] = ..., + ) -> None: ... + def file_id(self) -> str: ... def interleaved2of5(self, txt, x: float, y: float, w: float = ..., h: float = ...) -> None: ... def code39(self, txt, x: float, y: float, w: float = ..., h: float = ...) -> None: ... def rect_clip(self, x: float, y: float, w: float, h: float) -> _GeneratorContextManager[None]: ... + def elliptic_clip(self, x: float, y: float, w: float, h: float) -> _GeneratorContextManager[None]: ... + def round_clip(self, x: float, y: float, r: float) -> _GeneratorContextManager[None]: ... def unbreakable(self) -> _GeneratorContextManager[FPDFRecorder]: ... + def offset_rendering(self) -> _GeneratorContextManager[FPDFRecorder]: ... def insert_toc_placeholder(self, render_toc_function, pages: int = ...) -> None: ... def set_section_title_styles( self, @@ -362,4 +499,4 @@ class FPDF: level5: TitleStyle | None = ..., level6: TitleStyle | None = ..., ) -> None: ... - def start_section(self, name: str, level: int = ...) -> None: ... + def start_section(self, name: str, level: int = 0, strict: bool = True) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/graphics_state.pyi b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/graphics_state.pyi new file mode 100644 index 000000000..a364a5275 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/graphics_state.pyi @@ -0,0 +1,102 @@ +from typing import Any, ClassVar + +from .drawing import DeviceGray, DeviceRGB +from .enums import TextMode + +class GraphicsStateMixin: + DEFAULT_DRAW_COLOR: ClassVar[DeviceGray] + DEFAULT_FILL_COLOR: ClassVar[DeviceGray] + DEFAULT_TEXT_COLOR: ClassVar[DeviceGray] + def __init__(self, *args, **kwargs) -> None: ... + @property + def draw_color(self) -> DeviceGray | DeviceRGB: ... + @draw_color.setter + def draw_color(self, v: DeviceGray | DeviceRGB) -> None: ... + @property + def fill_color(self) -> DeviceGray | DeviceRGB: ... + @fill_color.setter + def fill_color(self, v: DeviceGray | DeviceRGB) -> None: ... + @property + def text_color(self) -> DeviceGray | DeviceRGB: ... + @text_color.setter + def text_color(self, v: DeviceGray | DeviceRGB) -> None: ... + @property + def underline(self) -> bool: ... + @underline.setter + def underline(self, v: bool) -> None: ... + @property + def font_style(self) -> str: ... + @font_style.setter + def font_style(self, v: str) -> None: ... + @property + def font_stretching(self) -> float: ... + @font_stretching.setter + def font_stretching(self, v: float) -> None: ... + @property + def char_spacing(self) -> float: ... + @char_spacing.setter + def char_spacing(self, v: float) -> None: ... + @property + def font_family(self) -> str: ... + @font_family.setter + def font_family(self, v: str) -> None: ... + @property + def font_size_pt(self) -> float: ... + @font_size_pt.setter + def font_size_pt(self, v: float) -> None: ... + @property + def font_size(self) -> float: ... + @font_size.setter + def font_size(self, v: float) -> None: ... + @property + def current_font(self) -> dict[str, Any]: ... + @current_font.setter + def current_font(self, v: dict[str, Any]) -> None: ... + @property + def dash_pattern(self) -> dict[str, float]: ... + @dash_pattern.setter + def dash_pattern(self, v: dict[str, float]) -> None: ... + @property + def line_width(self) -> float: ... + @line_width.setter + def line_width(self, v: float) -> None: ... + @property + def text_mode(self) -> TextMode: ... + @text_mode.setter + def text_mode(self, v: int | str) -> None: ... + @property + def char_vpos(self): ... + @char_vpos.setter + def char_vpos(self, v) -> None: ... + @property + def sub_scale(self): ... + @sub_scale.setter + def sub_scale(self, v) -> None: ... + @property + def sup_scale(self): ... + @sup_scale.setter + def sup_scale(self, v) -> None: ... + @property + def nom_scale(self): ... + @nom_scale.setter + def nom_scale(self, v) -> None: ... + @property + def denom_scale(self): ... + @denom_scale.setter + def denom_scale(self, v) -> None: ... + @property + def sub_lift(self): ... + @sub_lift.setter + def sub_lift(self, v) -> None: ... + @property + def sup_lift(self): ... + @sup_lift.setter + def sup_lift(self, v) -> None: ... + @property + def nom_lift(self): ... + @nom_lift.setter + def nom_lift(self, v) -> None: ... + @property + def denom_lift(self): ... + @denom_lift.setter + def denom_lift(self, v) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/html.pyi b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/html.pyi index c2e9a3a59..34ae19685 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/html.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/html.pyi @@ -1,53 +1,74 @@ +from _typeshed import Incomplete, Unused +from collections.abc import Callable from html.parser import HTMLParser -from typing import Any +from logging import Logger +from re import Match, Pattern +from typing import ClassVar +from typing_extensions import Final -LOGGER: Any -BULLET_WIN1252: str -DEFAULT_HEADING_SIZES: Any -COLOR_DICT: Any +from fpdf import FPDF -def px2mm(px): ... -def color_as_decimal(color: str = ...): ... +__author__: Final[str] +__copyright__: Final[str] +__license__: Final[str] + +LOGGER: Logger +BULLET_WIN1252: Final[str] +DEFAULT_HEADING_SIZES: dict[str, int] +LEADING_SPACE: Pattern[str] +WHITESPACE: Pattern[str] +TRAILING_SPACE: Pattern[str] + +COLOR_DICT: Final[dict[str, str]] + +def px2mm(px: float) -> float: ... +def color_as_decimal(color: str | None = ...) -> tuple[int, int, int] | None: ... class HTML2FPDF(HTMLParser): - pdf: Any - image_map: Any - li_tag_indent: Any - table_line_separators: Any - ul_bullet_char: Any - style: Any + HTML_UNCLOSED_TAGS: ClassVar[tuple[str, ...]] + pdf: Incomplete + image_map: Incomplete + li_tag_indent: Incomplete + table_line_separators: Incomplete + ul_bullet_char: Incomplete + style: Incomplete href: str align: str - page_links: Any - font_stack: Any + page_links: Incomplete + font_stack: Incomplete indent: int - bullet: Any - font_size: Any - font_color: Any - table: Any - table_col_width: Any - table_col_index: Any - td: Any - th: Any - tr: Any - thead: Any - tfoot: Any - tr_index: Any - theader: Any - tfooter: Any + bullet: Incomplete + font_size: Incomplete + font_color: Incomplete + table: Incomplete + table_col_width: Incomplete + table_col_index: Incomplete + td: Incomplete + th: Incomplete + tr: Incomplete + thead: Incomplete + tfoot: Incomplete + tr_index: Incomplete + theader: Incomplete + tfooter: Incomplete theader_out: bool table_row_height: int - heading_level: Any - heading_sizes: Any + heading_level: Incomplete + heading_sizes: Incomplete + heading_above: float + heading_below: float + warn_on_tags_not_matching: bool def __init__( self, - pdf, - image_map: Any | None = ..., - li_tag_indent: int = ..., - table_line_separators: bool = ..., - ul_bullet_char=..., - heading_sizes: Any | None = ..., - **_, + pdf: FPDF, + image_map: Callable[[str], str] | None = None, + li_tag_indent: int = 5, + dd_tag_indent: int = 10, + table_line_separators: bool = False, + ul_bullet_char: str = ..., + heading_sizes: Incomplete | None = None, + warn_on_tags_not_matching: bool = True, + **_: Unused, ): ... def width2unit(self, length): ... def handle_data(self, data) -> None: ... @@ -56,19 +77,21 @@ class HTML2FPDF(HTMLParser): tfooter_out: bool def output_table_footer(self) -> None: ... def output_table_sep(self) -> None: ... - font_face: Any - table_offset: Any + font_face: Incomplete + table_offset: Incomplete def handle_starttag(self, tag, attrs) -> None: ... - tbody: Any + tbody: Incomplete def handle_endtag(self, tag) -> None: ... - h: Any - def set_font(self, face: Any | None = ..., size: Any | None = ...) -> None: ... - def set_style(self, tag: Any | None = ..., enable: bool = ...) -> None: ... - def set_text_color(self, r: Any | None = ..., g: int = ..., b: int = ...) -> None: ... + h: Incomplete + def set_font(self, face: Incomplete | None = ..., size: Incomplete | None = ...) -> None: ... + def set_style(self, tag: Incomplete | None = ..., enable: bool = ...) -> None: ... + def set_text_color(self, r: Incomplete | None = ..., g: int = ..., b: int = ...) -> None: ... def put_link(self, txt) -> None: ... def render_toc(self, pdf, outline) -> None: ... def error(self, message: str) -> None: ... +def leading_whitespace_repl(matchobj: Match[str]) -> str: ... +def whitespace_repl(matchobj: Match[str]) -> str: ... + class HTMLMixin: - HTML2FPDF_CLASS: Any - def write_html(self, text, *args, **kwargs) -> None: ... + def __init__(self, *args: Incomplete, **kwargs: Incomplete) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/image_parsing.pyi b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/image_parsing.pyi index 586aad2a4..24060e554 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/image_parsing.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/image_parsing.pyi @@ -1,11 +1,15 @@ +from _typeshed import Incomplete from typing import Any from typing_extensions import Literal, TypeAlias +from PIL.Image import Resampling + _ImageFilter: TypeAlias = Literal["AUTO", "FlateDecode", "DCTDecode", "JPXDecode"] +RESAMPLE: Resampling SUPPORTED_IMAGE_FILTERS: tuple[_ImageFilter, ...] def load_image(filename): ... # Returned dict could be typed as a TypedDict. -def get_img_info(img, image_filter: _ImageFilter = ..., dims: Any | None = ...) -> dict[str, Any]: ... +def get_img_info(img, image_filter: _ImageFilter = ..., dims: Incomplete | None = ...) -> dict[str, Any]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/line_break.pyi b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/line_break.pyi new file mode 100644 index 000000000..01d3a3518 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/line_break.pyi @@ -0,0 +1,116 @@ +from _typeshed import Incomplete +from collections.abc import Sequence +from typing import NamedTuple + +SOFT_HYPHEN: str +HYPHEN: str +SPACE: str +NEWLINE: str + +class Fragment: + characters: list[str] + graphics_state: dict[str, Incomplete] + k: float + url: str | None + def __init__( + self, characters: list[str] | str, graphics_state: dict[str, Incomplete], k: float, url: str | None = None + ) -> None: ... + @property + def font(self): ... + @font.setter + def font(self, v) -> None: ... + @property + def is_ttf_font(self): ... + @property + def font_style(self): ... + @property + def font_family(self): ... + @property + def font_size_pt(self): ... + @property + def font_size(self): ... + @property + def font_stretching(self): ... + @property + def char_spacing(self): ... + @property + def text_mode(self): ... + @property + def underline(self): ... + @property + def draw_color(self): ... + @property + def fill_color(self): ... + @property + def text_color(self): ... + @property + def line_width(self): ... + @property + def char_vpos(self): ... + @property + def lift(self): ... + @property + def string(self): ... + def trim(self, index: int): ... + def __eq__(self, other: Fragment) -> bool: ... # type: ignore[override] + def get_width(self, start: int = ..., end: int | None = ..., chars: str | None = ..., initial_cs: bool = ...): ... + def get_character_width(self, character: str, print_sh: bool = ..., initial_cs: bool = ...): ... + +class TextLine(NamedTuple): + fragments: tuple[Incomplete, ...] + text_width: float + number_of_spaces: int + justify: bool + trailing_nl: bool = ... + +class SpaceHint(NamedTuple): + original_fragment_index: int + original_character_index: int + current_line_fragment_index: int + current_line_character_index: int + line_width: float + number_of_spaces: int + +class HyphenHint(NamedTuple): + original_fragment_index: int + original_character_index: int + current_line_fragment_index: int + current_line_character_index: int + line_width: float + number_of_spaces: int + curchar: str + curchar_width: float + graphics_state: dict[str, Incomplete] + k: float + +class CurrentLine: + print_sh: Incomplete + fragments: Incomplete + width: int + number_of_spaces: int + space_break_hint: Incomplete + hyphen_break_hint: Incomplete + def __init__(self, print_sh: bool = ...) -> None: ... + def add_character( + self, + character: str, + character_width: float, + graphics_state: dict[str, Incomplete], + k: float, + original_fragment_index: int, + original_character_index: int, + url: str | None = None, + ): ... + def manual_break(self, justify: bool = ..., trailing_nl: bool = ...): ... + def automatic_break_possible(self): ... + def automatic_break(self, justify: bool): ... + +class MultiLineBreak: + styled_text_fragments: Incomplete + justify: Incomplete + print_sh: Incomplete + fragment_index: int + character_index: int + idx_last_forced_break: Incomplete + def __init__(self, styled_text_fragments: Sequence[Fragment], justify: bool = ..., print_sh: bool = ...) -> None: ... + def get_line_of_given_width(self, maximum_width: float, wordsplit: bool = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/linearization.pyi b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/linearization.pyi new file mode 100644 index 000000000..cfbaaf5ba --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/linearization.pyi @@ -0,0 +1,54 @@ +from _typeshed import Incomplete +from typing_extensions import Final + +from .encryption import StandardSecurityHandler +from .output import ContentWithoutID, OutputProducer +from .syntax import PDFContentStream, PDFObject + +HINT_STREAM_OFFSET_LENGTH_PLACEHOLDER: Final[str] +FIRST_PAGE_END_OFFSET_PLACEHOLDER: Final[str] +MAIN_XREF_1ST_ENTRY_OFFSET_PLACEHOLDER: Final[str] +FILE_LENGTH_PLACEHOLDER: Final[str] + +class PDFLinearization(PDFObject): + linearized: str + n: int + h: str + o: Incomplete | None + e: str + t: str + l: str + def __init__(self, pages_count: int) -> None: ... + +class PDFXrefAndTrailer(ContentWithoutID): + PREV_MAIN_XREF_START_PLACEHOLDER: str + output_builder: Incomplete + count: int + start_obj_id: int + catalog_obj: Incomplete | None + info_obj: Incomplete | None + first_xref: Incomplete | None + main_xref: Incomplete | None + startxref: Incomplete | None + def __init__(self, output_builder) -> None: ... + @property + def is_first_xref(self) -> bool: ... + @property + def is_main_xref(self) -> bool: ... + def serialize(self, _security_handler: StandardSecurityHandler | None = None) -> str: ... + +class PDFHintStream(PDFContentStream): + s: Incomplete | None + t: Incomplete | None + o: Incomplete | None + a: Incomplete | None + e: Incomplete | None + v: Incomplete | None + i: Incomplete | None + c: Incomplete | None + l: Incomplete | None + r: Incomplete | None + b: Incomplete | None + +class LinearizedOutputProducer(OutputProducer): + def bufferize(self) -> bytearray: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/outline.pyi b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/outline.pyi index 0df21fb1a..4e57c1d8e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/outline.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/outline.pyi @@ -1,7 +1,9 @@ -from typing import Any, NamedTuple +from _typeshed import Incomplete +from collections.abc import Generator, Iterable +from typing import NamedTuple from .structure_tree import StructElem -from .syntax import Destination, PDFObject +from .syntax import Destination, PDFObject, PDFString class OutlineSection(NamedTuple): name: str @@ -11,22 +13,24 @@ class OutlineSection(NamedTuple): struct_elem: StructElem | None = ... class OutlineItemDictionary(PDFObject): - title: str - parent: Any | None - prev: Any | None - next: Any | None - first: Any | None - last: Any | None + title: PDFString + parent: Incomplete | None + prev: Incomplete | None + next: Incomplete | None + first: Incomplete | None + last: Incomplete | None count: int - dest: str | None + dest: Destination | None struct_elem: StructElem | None - def __init__(self, title: str, dest: str | None = ..., struct_elem: StructElem | None = ..., **kwargs) -> None: ... + def __init__(self, title: str, dest: Destination | None = ..., struct_elem: StructElem | None = ...) -> None: ... class OutlineDictionary(PDFObject): type: str - first: Any | None - last: Any | None + first: Incomplete | None + last: Incomplete | None count: int - def __init__(self, **kwargs) -> None: ... + def __init__(self) -> None: ... -def serialize_outline(sections, first_object_id: int = ..., fpdf: Any | None = ...): ... +def build_outline_objs( + sections: Iterable[Incomplete], +) -> Generator[Incomplete, None, list[OutlineDictionary | OutlineItemDictionary]]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/output.pyi b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/output.pyi new file mode 100644 index 000000000..686abcbb4 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/output.pyi @@ -0,0 +1,187 @@ +from _typeshed import Incomplete, Unused +from collections import defaultdict +from logging import Logger +from typing_extensions import Final + +from .annotations import AnnotationDict +from .encryption import StandardSecurityHandler +from .syntax import Name, PDFArray, PDFContentStream, PDFObject + +LOGGER: Logger +ZOOM_CONFIGS: Final[dict[str, tuple[str, ...]]] + +class ContentWithoutID: + def serialize(self, _security_handler: StandardSecurityHandler | None = None) -> str | None: ... + +class PDFHeader(ContentWithoutID): + pdf_version: str + def __init__(self, pdf_version: str) -> None: ... + def serialize(self, _security_handler: StandardSecurityHandler | None = None) -> str: ... + +class PDFFont(PDFObject): + type: Name + subtype: Name + base_font: Name + encoding: Name | None + d_w: Incomplete | None + w: Incomplete | None + descendant_fonts: Incomplete | None + to_unicode: Incomplete | None + c_i_d_system_info: Incomplete | None + font_descriptor: Incomplete | None + c_i_d_to_g_i_d_map: Incomplete | None + def __init__( + self, subtype: str, base_font: str, encoding: str | None = ..., d_w: Incomplete | None = ..., w: Incomplete | None = ... + ) -> None: ... + +class PDFFontDescriptor(PDFObject): + type: Name + ascent: Incomplete + descent: Incomplete + cap_height: Incomplete + flags: Incomplete + font_b_box: Incomplete + italic_angle: Incomplete + stem_v: Incomplete + missing_width: Incomplete + font_name: Incomplete | None + def __init__(self, ascent, descent, cap_height, flags, font_b_box, italic_angle, stem_v, missing_width) -> None: ... + +class CIDSystemInfo(PDFObject): + registry: str + ordering: str + supplement: Incomplete + def __init__(self, registry: str | None, ordering: str | None, supplement) -> None: ... + +class PDFInfo(PDFObject): + title: str | None + subject: str | None + author: str | None + keywords: str | None + creator: str | None + producer: str | None + creation_date: Incomplete + def __init__( + self, + title: str | None, + subject: str | None, + author: str | None, + keywords: str | None, + creator: str | None, + producer: str | None, + creation_date, + ) -> None: ... + +class AcroForm: + fields: Incomplete + sig_flags: Incomplete + def __init__(self, fields, sig_flags) -> None: ... + def serialize(self) -> str: ... + +class PDFCatalog(PDFObject): + type: Name + lang: str | None + page_layout: Incomplete | None + page_mode: Incomplete | None + viewer_preferences: Incomplete | None + pages: Incomplete | None + acro_form: Incomplete | None + open_action: Incomplete | None + mark_info: Incomplete | None + metadata: Incomplete | None + names: Incomplete | None + outlines: Incomplete | None + struct_tree_root: Incomplete | None + def __init__( + self, + lang: str | None = ..., + page_layout: Incomplete | None = ..., + page_mode: Incomplete | None = ..., + viewer_preferences: Incomplete | None = ..., + ) -> None: ... + +class PDFResources(PDFObject): + proc_set: Incomplete + font: Incomplete + x_object: Incomplete + ext_g_state: Incomplete + def __init__(self, proc_set, font, x_object, ext_g_state) -> None: ... + +class PDFFontStream(PDFContentStream): + length1: int + def __init__(self, contents: bytes) -> None: ... + +class PDFXmpMetadata(PDFContentStream): + type: Name + subtype: Name + def __init__(self, contents: bytes) -> None: ... + +class PDFXObject(PDFContentStream): + type: Name + subtype: Name + width: Incomplete + height: Incomplete + color_space: Incomplete + bits_per_component: Incomplete + filter: Name + decode: Incomplete | None + decode_parms: Incomplete | None + s_mask: Incomplete | None + def __init__( + self, + contents, + subtype: str, + width, + height, + color_space, + bits_per_component, + img_filter: str | None = ..., + decode: Incomplete | None = ..., + decode_parms: Incomplete | None = ..., + ) -> None: ... + +class PDFPage(PDFObject): + type: Name + contents: Incomplete + dur: Incomplete | None + trans: Incomplete + annots: PDFArray[AnnotationDict] + group: Incomplete | None + media_box: Incomplete | None + struct_parents: Incomplete | None + resources: Incomplete | None + parent: Incomplete | None + def __init__(self, duration: Incomplete | None, transition, contents, index) -> None: ... + def index(self): ... + def dimensions(self) -> tuple[float | None, float | None]: ... + def set_dimensions(self, width_pt: float | None, height_pt: float | None) -> None: ... + +class PDFPagesRoot(PDFObject): + type: Name + count: Incomplete + media_box: Incomplete + kids: Incomplete | None + def __init__(self, count, media_box) -> None: ... + +class PDFExtGState(PDFObject): + def __init__(self, dict_as_str) -> None: ... + def serialize(self, obj_dict: Unused = None, _security_handler: StandardSecurityHandler | None = None) -> str: ... + +class PDFXrefAndTrailer(ContentWithoutID): + output_builder: Incomplete + count: int + catalog_obj: Incomplete | None + info_obj: Incomplete | None + def __init__(self, output_builder) -> None: ... + def serialize(self, _security_handler: StandardSecurityHandler | None = None) -> str: ... + +class OutputProducer: + fpdf: Incomplete + pdf_objs: list[Incomplete] + obj_id: int + offsets: dict[Incomplete, Incomplete] + trace_labels_per_obj_id: dict[Incomplete, Incomplete] + sections_size_per_trace_label: defaultdict[Incomplete, int] + buffer: bytearray + def __init__(self, fpdf) -> None: ... + def bufferize(self) -> bytearray: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/prefs.pyi b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/prefs.pyi new file mode 100644 index 000000000..2ec95cd79 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/prefs.pyi @@ -0,0 +1,24 @@ +from .enums import PageMode + +class ViewerPreferences: + hide_toolbar: bool + hide_menubar: bool + hide_window_u_i: bool + fit_window: bool + center_window: bool + display_doc_title: bool + def __init__( + self, + hide_toolbar: bool = ..., + hide_menubar: bool = ..., + hide_window_u_i: bool = ..., + fit_window: bool = ..., + center_window: bool = ..., + display_doc_title: bool = ..., + non_full_screen_page_mode: PageMode | str = ..., + ) -> None: ... + @property + def non_full_screen_page_mode(self): ... + @non_full_screen_page_mode.setter + def non_full_screen_page_mode(self, page_mode) -> None: ... + def serialize(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/recorder.pyi b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/recorder.pyi index 6401da536..9d73e9fc0 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/recorder.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/recorder.pyi @@ -4,7 +4,7 @@ class FPDFRecorder: pdf: Any accept_page_break: bool def __init__(self, pdf, accept_page_break: bool = ...) -> None: ... - def __getattr__(self, name): ... + def __getattr__(self, name: str): ... def rewind(self) -> None: ... def replay(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/sign.pyi b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/sign.pyi new file mode 100644 index 000000000..e6878ea81 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/sign.pyi @@ -0,0 +1,22 @@ +from _typeshed import Incomplete + +class Signature: + type: str + filter: str + sub_filter: str + contact_info: Incomplete | None + location: Incomplete | None + m: Incomplete | None + reason: Incomplete | None + byte_range: str + contents: str + def __init__( + self, + contact_info: Incomplete | None = ..., + location: Incomplete | None = ..., + m: Incomplete | None = ..., + reason: Incomplete | None = ..., + ) -> None: ... + def serialize(self): ... + +def sign_content(signer, buffer, key, cert, extra_certs, hashalgo, sign_time): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/structure_tree.pyi b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/structure_tree.pyi index b8bc849b3..2aec226f5 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/structure_tree.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/structure_tree.pyi @@ -1,52 +1,48 @@ -from typing import Any, NamedTuple +from _typeshed import Incomplete, Unused +from collections import defaultdict +from collections.abc import Generator, Iterable -from .syntax import PDFObject - -class MarkedContent(NamedTuple): - page_object_id: int - struct_parents_id: int - struct_type: str - mcid: int | None = ... - title: str | None = ... - alt_text: str | None = ... +from .encryption import StandardSecurityHandler +from .syntax import PDFArray, PDFObject, PDFString class NumberTree(PDFObject): - nums: Any - def __init__(self, **kwargs) -> None: ... - def serialize(self, fpdf: Any | None = ..., obj_dict: Any | None = ...): ... + nums: defaultdict[Incomplete, list[Incomplete]] + def __init__(self) -> None: ... + def serialize(self, obj_dict: Unused = None, _security_handler: StandardSecurityHandler | None = None) -> str: ... class StructTreeRoot(PDFObject): type: str - parent_tree: Any - k: Any - def __init__(self, **kwargs) -> None: ... + parent_tree: NumberTree + k: PDFArray[Incomplete] + def __init__(self) -> None: ... class StructElem(PDFObject): type: str - s: Any - p: Any - k: Any - pg: Any - t: Any - alt: Any + s: str + p: PDFObject + k: PDFArray[Incomplete] + t: PDFString | None + alt: PDFString | None + pg: Incomplete | None def __init__( self, struct_type: str, parent: PDFObject, - kids: list[int] | list[StructElem], - page: PDFObject | None = ..., + kids: Iterable[int] | Iterable[StructElem], + page_number: int | None = ..., title: str | None = ..., alt: str | None = ..., - **kwargs, ) -> None: ... + def page_number(self) -> int | None: ... class StructureTreeBuilder: - struct_tree_root: Any - doc_struct_elem: Any - struct_elem_per_mc: Any + struct_tree_root: Incomplete + doc_struct_elem: Incomplete + struct_elem_per_mc: Incomplete def __init__(self) -> None: ... - def add_marked_content(self, marked_content) -> None: ... - def next_mcid_for_page(self, page_object_id): ... - def empty(self): ... - def serialize(self, first_object_id: int = ..., fpdf: Any | None = ...): ... - def assign_ids(self, n): ... + def add_marked_content( + self, page_number: int, struct_type: str, mcid: int | None = ..., title: str | None = ..., alt_text: str | None = ... + ) -> tuple[Incomplete, Incomplete]: ... + def next_mcid_for_page(self, page_number: int) -> int: ... + def empty(self) -> bool: ... + def __iter__(self) -> Generator[Incomplete, None, None]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/svg.pyi b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/svg.pyi new file mode 100644 index 000000000..0d4c9cb43 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/svg.pyi @@ -0,0 +1,89 @@ +from _typeshed import Incomplete +from collections.abc import Callable +from re import Pattern + +from fpdf.drawing import PaintedPath + +from ._fonttools_shims import BasePen, _TTGlyphSet + +__pdoc__: dict[str, bool] + +def force_nodocument(item): ... + +NUMBER_SPLIT: Pattern[str] +TRANSFORM_GETTER: Pattern[str] + +class Percent(float): ... + +unit_splitter: Pattern[str] +relative_length_units: set[str] +absolute_length_units: dict[str, int] +angle_units: dict[str, float] + +def resolve_length(length_str, default_unit: str = ...): ... +def resolve_angle(angle_str, default_unit: str = ...): ... +def xmlns(space, name): ... +def xmlns_lookup(space, *names): ... + +shape_tags: Incomplete + +def svgcolor(colorstr): ... +def convert_stroke_width(incoming): ... +def convert_miterlimit(incoming): ... +def clamp_float(min_val, max_val): ... +def inheritable(value, converter=...): ... +def optional(value, converter=...): ... + +svg_attr_map: dict[str, Callable[[Incomplete], tuple[str, Incomplete]]] + +def parse_style(svg_element) -> None: ... +def apply_styles(stylable, svg_element) -> None: ... + +class ShapeBuilder: + @staticmethod + def new_path(tag): ... + @classmethod + def rect(cls, tag): ... + @classmethod + def circle(cls, tag): ... + @classmethod + def ellipse(cls, tag): ... + @classmethod + def line(cls, tag): ... + @classmethod + def polyline(cls, tag): ... + @classmethod + def polygon(cls, tag): ... + +def convert_transforms(tfstr): ... + +class PathPen(BasePen): + pdf_path: PaintedPath + last_was_line_to: bool + first_is_move: bool | None + def __init__(self, pdf_path: PaintedPath, glyphSet: _TTGlyphSet | None = ...): ... + def arcTo(self, rx, ry, rotation, arc, sweep, end) -> None: ... + +def svg_path_converter(pdf_path: PaintedPath, svg_path: str) -> None: ... + +class SVGObject: + @classmethod + def from_file(cls, filename, *args, encoding: str = ..., **kwargs): ... + cross_references: Incomplete + def __init__(self, svg_text) -> None: ... + preserve_ar: Incomplete + width: Incomplete + height: Incomplete + viewbox: Incomplete + def extract_shape_info(self, root_tag) -> None: ... + base_group: Incomplete + def convert_graphics(self, root_tag) -> None: ... + def transform_to_page_viewport(self, pdf, align_viewbox: bool = ...): ... + def transform_to_rect_viewport(self, scale, width, height, align_viewbox: bool = ..., ignore_svg_top_attrs: bool = ...): ... + def draw_to_page( + self, pdf, x: Incomplete | None = ..., y: Incomplete | None = ..., debug_stream: Incomplete | None = ... + ) -> None: ... + def handle_defs(self, defs) -> None: ... + def build_xref(self, xref): ... + def build_group(self, group, pdf_group: Incomplete | None = ...): ... + def build_path(self, path): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/syntax.pyi b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/syntax.pyi index 02cee6b5c..bff2ec0f0 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/syntax.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/syntax.pyi @@ -1,7 +1,13 @@ -from abc import ABC -from typing import Any +from _typeshed import Incomplete, SupportsItems +from abc import ABC, abstractmethod +from re import Pattern +from typing import ClassVar, Generic, TypeVar from typing_extensions import Literal +from .encryption import StandardSecurityHandler + +_T = TypeVar("_T") + def clear_empty_fields(d): ... def create_dictionary_string( dict_, @@ -13,41 +19,52 @@ def create_dictionary_string( ): ... def create_list_string(list_): ... def iobj_ref(n): ... -def create_stream(stream): ... +def create_stream( + stream: str | bytes | bytearray, encryption_handler: StandardSecurityHandler | None = None, obj_id: Incomplete | None = None +): ... + +class Raw(str): ... + +class Name(str): + NAME_ESC: ClassVar[Pattern[bytes]] + def serialize(self) -> str: ... class PDFObject: - def __init__(self, id: Any | None = ...) -> None: ... + def __init__(self) -> None: ... @property - def id(self): ... + def id(self) -> int: ... @id.setter - def id(self, n) -> None: ... + def id(self, n: int) -> None: ... @property - def ref(self): ... - def serialize(self, fpdf: Any | None = ..., obj_dict: Any | None = ...): ... + def ref(self) -> str: ... + def serialize(self, obj_dict: Incomplete | None = ..., _security_handler: StandardSecurityHandler | None = None) -> str: ... + def content_stream(self) -> bytes: ... + +class PDFContentStream(PDFObject): + filter: Name | None + length: int + def __init__(self, contents: bytes, compress: bool = ...) -> None: ... + def encrypt(self, security_handler: StandardSecurityHandler) -> None: ... +def build_obj_dict(key_values: SupportsItems[str, Incomplete]) -> dict[str, str]: ... def camel_case(snake_case: str) -> str: ... class PDFString(str): - def serialize(self): ... + USE_HEX_ENCODING: ClassVar[bool] + def serialize(self) -> str: ... -class PDFArray(list[Any]): - def serialize(self): ... +class PDFArray(list[_T], Generic[_T]): + def serialize(self) -> str: ... class Destination(ABC): - def as_str(self, pdf: Any | None = ...) -> None: ... + @abstractmethod + def serialize(self) -> str: ... class DestinationXYZ(Destination): - page: int - x: float - y: float + page_number: int + top: float + left: float zoom: float | Literal["null"] - page_as_obj_id: bool - def __init__( - self, page: int, x: float = ..., y: float = ..., zoom: float | Literal["null"] = ..., page_as_obj_id: bool = ... - ) -> None: ... - def as_str(self, pdf: Any | None = ...): ... - -class Raw(str): ... - -class Name(str): - def pdf_repr(self) -> str: ... + page_ref: Incomplete | None + def __init__(self, page: int, top: float, left: float = ..., zoom: float | Literal["null"] = ...) -> None: ... + def serialize(self) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/template.pyi b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/template.pyi index 8ab4d6cb9..c0546012e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/template.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/template.pyi @@ -1,15 +1,20 @@ +from _typeshed import Incomplete from typing import Any +__author__: str +__copyright__: str +__license__: str + class FlexTemplate: pdf: Any splitting_pdf: Any handlers: Any texts: Any - def __init__(self, pdf, elements: Any | None = ...) -> None: ... + def __init__(self, pdf, elements: Incomplete | None = ...) -> None: ... elements: Any keys: Any def load_elements(self, elements) -> None: ... - def parse_csv(self, infile, delimiter: str = ..., decimal_sep: str = ..., encoding: Any | None = ...): ... + def parse_csv(self, infile, delimiter: str = ..., decimal_sep: str = ..., encoding: Incomplete | None = ...): ... def __setitem__(self, name, value) -> None: ... set: Any def __contains__(self, name): ... @@ -20,8 +25,8 @@ class FlexTemplate: class Template(FlexTemplate): def __init__( self, - infile: Any | None = ..., - elements: Any | None = ..., + infile: Incomplete | None = ..., + elements: Incomplete | None = ..., format: str = ..., orientation: str = ..., unit: str = ..., @@ -32,4 +37,4 @@ class Template(FlexTemplate): keywords: str = ..., ) -> None: ... def add_page(self) -> None: ... - def render(self, outfile: Any | None = ..., dest: Any | None = ...) -> None: ... # type: ignore[override] + def render(self, outfile: Incomplete | None = ..., dest: Incomplete | None = ...) -> None: ... # type: ignore[override] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/transitions.pyi b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/transitions.pyi index c1d692275..5180d148a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/transitions.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/transitions.pyi @@ -1,58 +1,59 @@ -from abc import ABC -from typing import Any +from abc import ABC, abstractmethod +from typing_extensions import Literal class Transition(ABC): - def dict_as_string(self) -> None: ... + @abstractmethod + def serialize(self) -> str: ... class SplitTransition(Transition): - dimension: Any - direction: Any - def __init__(self, dimension, direction) -> None: ... - def dict_as_string(self): ... + dimension: Literal["H", "V"] + direction: Literal["I", "O"] + def __init__(self, dimension: Literal["H", "V"], direction: Literal["I", "O"]) -> None: ... + def serialize(self) -> str: ... class BlindsTransition(Transition): - dimension: Any - def __init__(self, dimension) -> None: ... - def dict_as_string(self): ... + dimension: Literal["H", "V"] + def __init__(self, dimension: Literal["H", "V"]) -> None: ... + def serialize(self) -> str: ... class BoxTransition(Transition): - direction: Any - def __init__(self, direction) -> None: ... - def dict_as_string(self): ... + direction: Literal["I", "O"] + def __init__(self, direction: Literal["I", "O"]) -> None: ... + def serialize(self) -> str: ... class WipeTransition(Transition): - direction: Any - def __init__(self, direction) -> None: ... - def dict_as_string(self): ... + direction: Literal[0, 90, 180, 270] + def __init__(self, direction: Literal[0, 90, 180, 270]) -> None: ... + def serialize(self) -> str: ... class DissolveTransition(Transition): - def dict_as_string(self): ... + def serialize(self) -> str: ... class GlitterTransition(Transition): - direction: Any - def __init__(self, direction) -> None: ... - def dict_as_string(self): ... + direction: Literal[0, 270, 315] + def __init__(self, direction: Literal[0, 270, 315]) -> None: ... + def serialize(self) -> str: ... class FlyTransition(Transition): - dimension: Any - direction: Any - def __init__(self, dimension, direction: Any | None = ...) -> None: ... - def dict_as_string(self): ... + dimension: Literal["H", "V"] + direction: Literal[0, 270] | None + def __init__(self, dimension: Literal["H", "V"], direction: Literal[0, 270] | None = ...) -> None: ... + def serialize(self) -> str: ... class PushTransition(Transition): - direction: Any - def __init__(self, direction) -> None: ... - def dict_as_string(self): ... + direction: Literal[0, 270] + def __init__(self, direction: Literal[0, 270]) -> None: ... + def serialize(self) -> str: ... class CoverTransition(Transition): - direction: Any - def __init__(self, direction) -> None: ... - def dict_as_string(self): ... + direction: Literal[0, 270] + def __init__(self, direction: Literal[0, 270]) -> None: ... + def serialize(self) -> str: ... class UncoverTransition(Transition): - direction: Any - def __init__(self, direction) -> None: ... - def dict_as_string(self): ... + direction: Literal[0, 270] + def __init__(self, direction: Literal[0, 270]) -> None: ... + def serialize(self) -> str: ... class FadeTransition(Transition): - def dict_as_string(self): ... + def serialize(self) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/ttfonts.pyi b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/ttfonts.pyi deleted file mode 100644 index 84990f260..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/ttfonts.pyi +++ /dev/null @@ -1,72 +0,0 @@ -from typing import Any - -GF_WORDS: Any -GF_SCALE: Any -GF_MORE: Any -GF_XYSCALE: Any -GF_TWOBYTWO: Any - -def sub32(x, y): ... -def calcChecksum(data): ... - -class TTFontFile: - maxStrLenRead: int - def __init__(self) -> None: ... - filename: Any - charWidths: Any - glyphPos: Any - charToGlyph: Any - tables: Any - otables: Any - ascent: int - descent: int - version: Any - def getMetrics(self, file) -> None: ... - numTables: Any - searchRange: Any - entrySelector: Any - rangeShift: Any - def readTableDirectory(self) -> None: ... - def get_table_pos(self, tag): ... - def seek(self, pos) -> None: ... - def skip(self, delta) -> None: ... - def seek_table(self, tag, offset_in_table: int = ...): ... - def read_tag(self): ... - def read_short(self): ... - def read_ushort(self): ... - def read_ulong(self): ... - def get_ushort(self, pos): ... - @staticmethod - def splice(stream, offset, value): ... - def get_chunk(self, pos, length): ... - def get_table(self, tag): ... - def add(self, tag, data) -> None: ... - sFamilyClass: int - sFamilySubClass: int - name: Any - familyName: Any - styleName: Any - fullName: Any - uniqueFontID: Any - unitsPerEm: Any - bbox: Any - capHeight: Any - stemV: Any - italicAngle: Any - underlinePosition: Any - underlineThickness: Any - flags: int - def extractInfo(self) -> None: ... - maxUni: int - codeToGlyph: Any - glyphdata: Any - def makeSubset(self, file, subset): ... - def getGlyphs(self, originalGlyphIdx, nonlocals) -> None: ... - defaultWidth: Any - def getHMTX(self, numberOfHMetrics, numGlyphs, glyphToChar, scale) -> None: ... - def getHMetric(self, numberOfHMetrics, gid): ... - def getLOCA(self, indexToLocFormat, numGlyphs) -> None: ... - maxUniChar: int - def getCMAP4(self, unicode_cmap_offset, glyphToChar, charToGlyph) -> None: ... - def getCMAP12(self, unicode_cmap_offset, glyphToChar, charToGlyph) -> None: ... - def endTTFile(self, stm): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/util.pyi b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/util.pyi index a98988cbe..805a44c63 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/util.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/util.pyi @@ -1,11 +1,13 @@ +import datetime from collections.abc import Iterable from typing import Any from typing_extensions import Literal, TypeAlias _Unit: TypeAlias = Literal["pt", "mm", "cm", "in"] -def substr(s, start, length: int = ...): ... -def enclose_in_parens(s): ... +def buffer_subst(buffer: bytearray, placeholder: str, value: str) -> bytearray: ... +def format_date(date: datetime.datetime, with_tz: bool = ...) -> str: ... +def enclose_in_parens(s: str) -> str: ... def escape_parens(s): ... def b(s): ... def get_scale_factor(unit: _Unit | float) -> float: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/freezegun/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/freezegun/METADATA.toml deleted file mode 100644 index dd889110a..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/freezegun/METADATA.toml +++ /dev/null @@ -1,2 +0,0 @@ -version = "1.1.*" -obsolete_since = "1.2.1" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/freezegun/freezegun/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/freezegun/freezegun/__init__.pyi deleted file mode 100644 index 1de0916f7..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/freezegun/freezegun/__init__.pyi +++ /dev/null @@ -1 +0,0 @@ -from .api import freeze_time as freeze_time diff --git a/packages/pyright-internal/typeshed-fallback/stubs/freezegun/freezegun/api.pyi b/packages/pyright-internal/typeshed-fallback/stubs/freezegun/freezegun/api.pyi deleted file mode 100644 index e05d2b0d1..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/freezegun/freezegun/api.pyi +++ /dev/null @@ -1,60 +0,0 @@ -from collections.abc import Awaitable, Callable, Iterator, Sequence -from datetime import date, datetime, timedelta -from numbers import Real -from typing import Any, TypeVar, overload -from typing_extensions import TypeAlias - -_T = TypeVar("_T") -_Freezable: TypeAlias = str | datetime | date | timedelta - -class TickingDateTimeFactory: - def __init__(self, time_to_freeze: datetime, start: datetime) -> None: ... - def __call__(self) -> datetime: ... - -class FrozenDateTimeFactory: - def __init__(self, time_to_freeze: datetime) -> None: ... - def __call__(self) -> datetime: ... - def tick(self, delta: float | Real | timedelta = ...) -> None: ... - def move_to(self, target_datetime: _Freezable | None) -> None: ... - -class StepTickTimeFactory: - def __init__(self, time_to_freeze: datetime, step_width: float) -> None: ... - def __call__(self) -> datetime: ... - def tick(self, delta: timedelta | None = ...) -> None: ... - def update_step_width(self, step_width: float) -> None: ... - def move_to(self, target_datetime: _Freezable | None) -> None: ... - -class _freeze_time: - def __init__( - self, - time_to_freeze_str: _Freezable | None, - tz_offset: float, - ignore: Sequence[str], - tick: bool, - as_arg: bool, - as_kwarg: str, - auto_tick_seconds: float, - ) -> None: ... - @overload - def __call__(self, func: type[_T]) -> type[_T]: ... - @overload - def __call__(self, func: Callable[..., Awaitable[_T]]) -> Callable[..., Awaitable[_T]]: ... - @overload - def __call__(self, func: Callable[..., _T]) -> Callable[..., _T]: ... - def __enter__(self) -> FrozenDateTimeFactory | StepTickTimeFactory: ... - def __exit__(self, *args: object) -> None: ... - def start(self) -> Any: ... - def stop(self) -> None: ... - def decorate_class(self, klass: type[_T]) -> _T: ... - def decorate_coroutine(self, coroutine: _T) -> _T: ... - def decorate_callable(self, func: Callable[..., _T]) -> Callable[..., _T]: ... - -def freeze_time( - time_to_freeze: _Freezable | Callable[..., _Freezable] | Iterator[_Freezable] | None = ..., - tz_offset: float | None = ..., - ignore: Sequence[str] | None = ..., - tick: bool | None = ..., - as_arg: bool | None = ..., - as_kwarg: str | None = ..., - auto_tick_seconds: float | None = ..., -) -> _freeze_time: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/gdb/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/gdb/METADATA.toml index 67395fbe8..a0d8f2902 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/gdb/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/gdb/METADATA.toml @@ -3,7 +3,7 @@ extra_description = """\ Type hints for GDB's \ [Python API](https://sourceware.org/gdb/onlinedocs/gdb/Python-API.html). \ Note that this API is available only when running Python scripts under GDB: \ - is is not possible to install the `gdb` package separately, for instance \ + it is not possible to install the `gdb` package separately, for instance \ using `pip`.\ """ diff --git a/packages/pyright-internal/typeshed-fallback/stubs/gdb/gdb/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/gdb/gdb/__init__.pyi index 7c31ee7ab..f343d3aac 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/gdb/gdb/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/gdb/gdb/__init__.pyi @@ -10,6 +10,9 @@ from typing_extensions import TypeAlias import gdb.types +# The following submodules are automatically imported +from . import events as events, printing as printing, prompt as prompt, types as types + # Basic PYTHONDIR: str @@ -55,7 +58,6 @@ _ValueOrNative: TypeAlias = bool | float | str | Value _ValueOrInt: TypeAlias = Value | int class Value: - address: Value is_optimized_out: bool type: Type @@ -75,6 +77,12 @@ class Value: def __xor__(self, other: _ValueOrInt) -> Value: ... def __lshift__(self, other: _ValueOrInt) -> Value: ... def __rshift__(self, other: _ValueOrInt) -> Value: ... + def __eq__(self, other: _ValueOrInt) -> bool: ... # type: ignore[override] + def __ne__(self, other: _ValueOrInt) -> bool: ... # type: ignore[override] + def __lt__(self, other: _ValueOrInt) -> bool: ... + def __le__(self, other: _ValueOrInt) -> bool: ... + def __gt__(self, other: _ValueOrInt) -> bool: ... + def __ge__(self, other: _ValueOrInt) -> bool: ... def __getitem__(self, key: int | str | Field) -> Value: ... def __call__(self, *args: _ValueOrNative) -> Value: ... def __init__(self, val: _ValueOrNative) -> None: ... @@ -111,7 +119,6 @@ class Value: def lookup_type(name: str, block: Block = ...) -> Type: ... class Type: - alignof: int code: int dynamic: bool @@ -135,7 +142,6 @@ class Type: def optimized_out(self) -> Value: ... class Field: - bitpos: int enumval: int name: str | None @@ -195,7 +201,6 @@ pretty_printers: list[_PrettyPrinterLookupFunction] # Filtering Frames class _FrameFilter(Protocol): - name: str enabled: bool priority: int @@ -483,6 +488,12 @@ class Block: is_static: bool def is_valid(self) -> bool: ... + def __iter__(self) -> BlockIterator: ... + +class BlockIterator: + def is_valid(self) -> bool: ... + def __iter__(self: _typeshed.Self) -> _typeshed.Self: ... + def __next__(self) -> Symbol: ... # Symbols @@ -492,7 +503,6 @@ def lookup_static_symbol(name: str, domain: int = ...) -> Symbol | None: ... def lookup_static_symbols(name: str, domain: int = ...) -> list[Symbol]: ... class Symbol: - type: Type | None symtab: Symtab line: int @@ -536,7 +546,6 @@ SYMBOL_LOC_COMMON_BLOCK: int # Symbol tables class Symtab_and_line: - symtab: Symtab pc: int last: int @@ -545,7 +554,6 @@ class Symtab_and_line: def is_valid(self) -> bool: ... class Symtab: - filename: str objfile: Objfile producer: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/gdb/gdb/printing.pyi b/packages/pyright-internal/typeshed-fallback/stubs/gdb/gdb/printing.pyi index 97cb7bea1..591fdd09a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/gdb/gdb/printing.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/gdb/gdb/printing.pyi @@ -1,19 +1,17 @@ -from collections.abc import Iterable +from collections.abc import Callable, Iterable import gdb from gdb import _PrettyPrinterLookupFunction class PrettyPrinter: - name: str - subprinters: list[SubPrettyPrinter] + subprinters: list[SubPrettyPrinter] | None enabled: bool def __init__(self, name: str, subprinters: Iterable[SubPrettyPrinter] | None = ...) -> None: ... def __call__(self, val: gdb.Value) -> gdb._PrettyPrinter | None: ... class SubPrettyPrinter: - name: str enabled: bool @@ -26,4 +24,8 @@ class RegexpCollectionPrettyPrinter(PrettyPrinter): class FlagEnumerationPrinter(PrettyPrinter): def __init__(self, enum_type: str) -> None: ... -def register_pretty_printer(obj: gdb.Objfile | gdb.Progspace | None, printer: PrettyPrinter, replace: bool = ...) -> None: ... +def register_pretty_printer( + obj: gdb.Objfile | gdb.Progspace | None, + printer: PrettyPrinter | Callable[[gdb.Value], gdb._PrettyPrinter | None], + replace: bool = ..., +) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/METADATA.toml index 010ac58b6..63fe58dfb 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/METADATA.toml @@ -1,2 +1,5 @@ -version = "1.11.*" -requires = ["types-six"] +version = "2.1.*" + +[tool.stubtest] +stubtest_requirements = ["protobuf==3.20.2"] +ignore_missing_stub = true diff --git a/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/google/cloud/ndb/_batch.pyi b/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/google/cloud/ndb/_batch.pyi index 0f50383e9..be6e53a0d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/google/cloud/ndb/_batch.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/google/cloud/ndb/_batch.pyi @@ -1,3 +1,3 @@ -from typing import Any +from _typeshed import Incomplete -def get_batch(batch_cls, options: Any | None = ...): ... +def get_batch(batch_cls, options: Incomplete | None = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/google/cloud/ndb/_cache.pyi b/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/google/cloud/ndb/_cache.pyi index e54eb54ef..811eb180c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/google/cloud/ndb/_cache.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/google/cloud/ndb/_cache.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from google.cloud.ndb import tasklets as tasklets @@ -23,7 +24,7 @@ class _GlobalCacheGetBatch(_GlobalCacheBatch): def make_call(self): ... def future_info(self, key): ... -def global_set(key, value, expires: Any | None = ..., read: bool = ...): ... +def global_set(key, value, expires: Incomplete | None = ..., read: bool = ...): ... class _GlobalCacheSetBatch(_GlobalCacheBatch): expires: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/google/cloud/ndb/_datastore_query.pyi b/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/google/cloud/ndb/_datastore_query.pyi index c199db496..597b8810e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/google/cloud/ndb/_datastore_query.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/google/cloud/ndb/_datastore_query.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any class QueryIterator: @@ -14,9 +15,9 @@ class Cursor: @classmethod def from_websafe_string(cls, urlsafe): ... cursor: Any - def __init__(self, cursor: Any | None = ..., urlsafe: Any | None = ...) -> None: ... + def __init__(self, cursor: Incomplete | None = ..., urlsafe: Incomplete | None = ...) -> None: ... def to_websafe_string(self): ... def urlsafe(self): ... def __eq__(self, other): ... def __ne__(self, other): ... - def __hash__(self): ... + def __hash__(self) -> int: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/google/cloud/ndb/_options.pyi b/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/google/cloud/ndb/_options.pyi index bcdbe6d95..a038bc27c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/google/cloud/ndb/_options.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/google/cloud/ndb/_options.pyi @@ -1,15 +1,15 @@ -from typing import Any +from _typeshed import Incomplete class Options: @classmethod def options(cls, wrapped, _disambiguate_from_model_properties: bool = ...): ... @classmethod def slots(cls): ... - def __init__(self, config: Any | None = ..., **kwargs) -> None: ... + def __init__(self, config: Incomplete | None = ..., **kwargs) -> None: ... def __eq__(self, other): ... def __ne__(self, other): ... def copy(self, **kwargs): ... def items(self) -> None: ... class ReadOptions(Options): - def __init__(self, config: Any | None = ..., **kwargs) -> None: ... + def __init__(self, config: Incomplete | None = ..., **kwargs) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/google/cloud/ndb/_transaction.pyi b/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/google/cloud/ndb/_transaction.pyi index c3dc5a473..c19dc18be 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/google/cloud/ndb/_transaction.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/google/cloud/ndb/_transaction.pyi @@ -1,18 +1,20 @@ -from typing import Any +from _typeshed import Incomplete def in_transaction(): ... def transaction( - callback, retries=..., read_only: bool = ..., join: bool = ..., xg: bool = ..., propagation: Any | None = ... + callback, retries=..., read_only: bool = ..., join: bool = ..., xg: bool = ..., propagation: Incomplete | None = ... ): ... def transaction_async( - callback, retries=..., read_only: bool = ..., join: bool = ..., xg: bool = ..., propagation: Any | None = ... + callback, retries=..., read_only: bool = ..., join: bool = ..., xg: bool = ..., propagation: Incomplete | None = ... ): ... def transaction_async_( - callback, retries=..., read_only: bool = ..., join: bool = ..., xg: bool = ..., propagation: Any | None = ... + callback, retries=..., read_only: bool = ..., join: bool = ..., xg: bool = ..., propagation: Incomplete | None = ... +): ... +def transactional(retries=..., read_only: bool = ..., join: bool = ..., xg: bool = ..., propagation: Incomplete | None = ...): ... +def transactional_async( + retries=..., read_only: bool = ..., join: bool = ..., xg: bool = ..., propagation: Incomplete | None = ... ): ... -def transactional(retries=..., read_only: bool = ..., join: bool = ..., xg: bool = ..., propagation: Any | None = ...): ... -def transactional_async(retries=..., read_only: bool = ..., join: bool = ..., xg: bool = ..., propagation: Any | None = ...): ... def transactional_tasklet( - retries=..., read_only: bool = ..., join: bool = ..., xg: bool = ..., propagation: Any | None = ... + retries=..., read_only: bool = ..., join: bool = ..., xg: bool = ..., propagation: Incomplete | None = ... ): ... def non_transactional(allow_existing: bool = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/google/cloud/ndb/client.pyi b/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/google/cloud/ndb/client.pyi index 207673ea1..09812a7ff 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/google/cloud/ndb/client.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/google/cloud/ndb/client.pyi @@ -1,21 +1,33 @@ -from typing import Any +from _typeshed import Incomplete +from collections.abc import Callable, Iterator +from contextlib import contextmanager +from typing import ClassVar -DATASTORE_API_HOST: Any +from google.cloud.ndb import context as context_module, key + +DATASTORE_API_HOST: str class Client: - SCOPE: Any - namespace: Any - host: Any - client_info: Any - secure: Any - stub: Any - def __init__(self, project: Any | None = ..., namespace: Any | None = ..., credentials: Any | None = ...) -> None: ... + SCOPE: ClassVar[tuple[str, ...]] + namespace: str | None + host: str + client_info: Incomplete + secure: bool + stub: Incomplete + def __init__( + self, + project: str | None = ..., + namespace: str | None = ..., + credentials: Incomplete | None = ..., + client_options: Incomplete | None = ..., + ) -> None: ... + @contextmanager def context( self, namespace=..., - cache_policy: Any | None = ..., - global_cache: Any | None = ..., - global_cache_policy: Any | None = ..., - global_cache_timeout_policy: Any | None = ..., + cache_policy: Callable[[key.Key], bool] | None = ..., + global_cache: Incomplete | None = ..., + global_cache_policy: Callable[[key.Key], bool] | None = ..., + global_cache_timeout_policy: Callable[[key.Key], int] | None = ..., legacy_data: bool = ..., - ) -> None: ... + ) -> Iterator[context_module.Context]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/google/cloud/ndb/context.pyi b/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/google/cloud/ndb/context.pyi index 3f54d9add..ec1ca4029 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/google/cloud/ndb/context.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/google/cloud/ndb/context.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from collections.abc import Callable from typing import Any, NamedTuple @@ -35,24 +36,24 @@ class _Context(_ContextTuple): def __new__( cls, client, - id: Any | None = ..., + id: Incomplete | None = ..., namespace=..., - eventloop: Any | None = ..., - batches: Any | None = ..., - commit_batches: Any | None = ..., - transaction: Any | None = ..., - cache: Any | None = ..., - cache_policy: Any | None = ..., - global_cache: Any | None = ..., + eventloop: Incomplete | None = ..., + batches: Incomplete | None = ..., + commit_batches: Incomplete | None = ..., + transaction: Incomplete | None = ..., + cache: Incomplete | None = ..., + cache_policy: Incomplete | None = ..., + global_cache: Incomplete | None = ..., global_cache_policy: Callable[[Key], bool] | None = ..., - global_cache_timeout_policy: Any | None = ..., - datastore_policy: Any | None = ..., - on_commit_callbacks: Any | None = ..., - transaction_complete_callbacks: Any | None = ..., + global_cache_timeout_policy: Incomplete | None = ..., + datastore_policy: Incomplete | None = ..., + on_commit_callbacks: Incomplete | None = ..., + transaction_complete_callbacks: Incomplete | None = ..., legacy_data: bool = ..., - retry: Any | None = ..., - rpc_time: Any | None = ..., - wait_time: Any | None = ..., + retry: Incomplete | None = ..., + rpc_time: Incomplete | None = ..., + wait_time: Incomplete | None = ..., ): ... def new(self, **kwargs): ... rpc_time: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/google/cloud/ndb/global_cache.pyi b/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/google/cloud/ndb/global_cache.pyi index 5bc4170b4..8a495a68c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/google/cloud/ndb/global_cache.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/google/cloud/ndb/global_cache.pyi @@ -1,6 +1,7 @@ import abc -from _typeshed import Self +from _typeshed import Incomplete from typing import Any +from typing_extensions import Self ConnectionError: Any @@ -12,7 +13,7 @@ class GlobalCache(metaclass=abc.ABCMeta): @abc.abstractmethod def get(self, keys): ... @abc.abstractmethod - def set(self, items, expires: Any | None = ...): ... + def set(self, items, expires: Incomplete | None = ...): ... @abc.abstractmethod def delete(self, keys): ... @abc.abstractmethod @@ -20,7 +21,7 @@ class GlobalCache(metaclass=abc.ABCMeta): @abc.abstractmethod def unwatch(self, keys): ... @abc.abstractmethod - def compare_and_swap(self, items, expires: Any | None = ...): ... + def compare_and_swap(self, items, expires: Incomplete | None = ...): ... @abc.abstractmethod def clear(self): ... @@ -28,17 +29,17 @@ class _InProcessGlobalCache(GlobalCache): cache: Any def __init__(self) -> None: ... def get(self, keys): ... - def set(self, items, expires: Any | None = ...) -> None: ... + def set(self, items, expires: Incomplete | None = ...) -> None: ... def delete(self, keys) -> None: ... def watch(self, items) -> None: ... def unwatch(self, keys) -> None: ... - def compare_and_swap(self, items, expires: Any | None = ...): ... + def compare_and_swap(self, items, expires: Incomplete | None = ...): ... def clear(self) -> None: ... class RedisCache(GlobalCache): transient_errors: Any @classmethod - def from_environment(cls: type[Self], strict_read: bool = ..., strict_write: bool = ...) -> Self: ... + def from_environment(cls, strict_read: bool = ..., strict_write: bool = ...) -> Self: ... redis: Any strict_read: Any strict_write: Any @@ -46,11 +47,11 @@ class RedisCache(GlobalCache): @property def pipes(self): ... def get(self, keys): ... - def set(self, items, expires: Any | None = ...) -> None: ... + def set(self, items, expires: Incomplete | None = ...) -> None: ... def delete(self, keys) -> None: ... def watch(self, items) -> None: ... def unwatch(self, keys) -> None: ... - def compare_and_swap(self, items, expires: Any | None = ...): ... + def compare_and_swap(self, items, expires: Incomplete | None = ...): ... def clear(self) -> None: ... class MemcacheCache(GlobalCache): @@ -60,9 +61,7 @@ class MemcacheCache(GlobalCache): def __eq__(self, other): ... transient_errors: Any @classmethod - def from_environment( - cls: type[Self], max_pool_size: int = ..., strict_read: bool = ..., strict_write: bool = ... - ) -> Self: ... + def from_environment(cls, max_pool_size: int = ..., strict_read: bool = ..., strict_write: bool = ...) -> Self: ... client: Any strict_read: Any strict_write: Any @@ -70,9 +69,9 @@ class MemcacheCache(GlobalCache): @property def caskeys(self): ... def get(self, keys): ... - def set(self, items, expires: Any | None = ...): ... + def set(self, items, expires: Incomplete | None = ...): ... def delete(self, keys) -> None: ... def watch(self, items) -> None: ... def unwatch(self, keys) -> None: ... - def compare_and_swap(self, items, expires: Any | None = ...): ... + def compare_and_swap(self, items, expires: Incomplete | None = ...): ... def clear(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/google/cloud/ndb/key.pyi b/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/google/cloud/ndb/key.pyi index 6a9896e3d..5139ae1b7 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/google/cloud/ndb/key.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/google/cloud/ndb/key.pyi @@ -1,10 +1,11 @@ +from _typeshed import Incomplete from typing import Any UNDEFINED: Any class Key: def __new__(cls, *path_args, **kwargs): ... - def __hash__(self): ... + def __hash__(self) -> int: ... def __eq__(self, other): ... def __ne__(self, other): ... def __lt__(self, other): ... @@ -29,69 +30,69 @@ class Key: def to_legacy_urlsafe(self, location_prefix): ... def get( self, - read_consistency: Any | None = ..., - read_policy: Any | None = ..., - transaction: Any | None = ..., - retries: Any | None = ..., - timeout: Any | None = ..., - deadline: Any | None = ..., - use_cache: Any | None = ..., - use_global_cache: Any | None = ..., - use_datastore: Any | None = ..., - global_cache_timeout: Any | None = ..., - use_memcache: Any | None = ..., - memcache_timeout: Any | None = ..., - max_memcache_items: Any | None = ..., - force_writes: Any | None = ..., - _options: Any | None = ..., + read_consistency: Incomplete | None = ..., + read_policy: Incomplete | None = ..., + transaction: Incomplete | None = ..., + retries: Incomplete | None = ..., + timeout: Incomplete | None = ..., + deadline: Incomplete | None = ..., + use_cache: Incomplete | None = ..., + use_global_cache: Incomplete | None = ..., + use_datastore: Incomplete | None = ..., + global_cache_timeout: Incomplete | None = ..., + use_memcache: Incomplete | None = ..., + memcache_timeout: Incomplete | None = ..., + max_memcache_items: Incomplete | None = ..., + force_writes: Incomplete | None = ..., + _options: Incomplete | None = ..., ): ... def get_async( self, - read_consistency: Any | None = ..., - read_policy: Any | None = ..., - transaction: Any | None = ..., - retries: Any | None = ..., - timeout: Any | None = ..., - deadline: Any | None = ..., - use_cache: Any | None = ..., - use_global_cache: Any | None = ..., - use_datastore: Any | None = ..., - global_cache_timeout: Any | None = ..., - use_memcache: Any | None = ..., - memcache_timeout: Any | None = ..., - max_memcache_items: Any | None = ..., - force_writes: Any | None = ..., - _options: Any | None = ..., + read_consistency: Incomplete | None = ..., + read_policy: Incomplete | None = ..., + transaction: Incomplete | None = ..., + retries: Incomplete | None = ..., + timeout: Incomplete | None = ..., + deadline: Incomplete | None = ..., + use_cache: Incomplete | None = ..., + use_global_cache: Incomplete | None = ..., + use_datastore: Incomplete | None = ..., + global_cache_timeout: Incomplete | None = ..., + use_memcache: Incomplete | None = ..., + memcache_timeout: Incomplete | None = ..., + max_memcache_items: Incomplete | None = ..., + force_writes: Incomplete | None = ..., + _options: Incomplete | None = ..., ): ... def delete( self, - retries: Any | None = ..., - timeout: Any | None = ..., - deadline: Any | None = ..., - use_cache: Any | None = ..., - use_global_cache: Any | None = ..., - use_datastore: Any | None = ..., - global_cache_timeout: Any | None = ..., - use_memcache: Any | None = ..., - memcache_timeout: Any | None = ..., - max_memcache_items: Any | None = ..., - force_writes: Any | None = ..., - _options: Any | None = ..., + retries: Incomplete | None = ..., + timeout: Incomplete | None = ..., + deadline: Incomplete | None = ..., + use_cache: Incomplete | None = ..., + use_global_cache: Incomplete | None = ..., + use_datastore: Incomplete | None = ..., + global_cache_timeout: Incomplete | None = ..., + use_memcache: Incomplete | None = ..., + memcache_timeout: Incomplete | None = ..., + max_memcache_items: Incomplete | None = ..., + force_writes: Incomplete | None = ..., + _options: Incomplete | None = ..., ): ... def delete_async( self, - retries: Any | None = ..., - timeout: Any | None = ..., - deadline: Any | None = ..., - use_cache: Any | None = ..., - use_global_cache: Any | None = ..., - use_datastore: Any | None = ..., - global_cache_timeout: Any | None = ..., - use_memcache: Any | None = ..., - memcache_timeout: Any | None = ..., - max_memcache_items: Any | None = ..., - force_writes: Any | None = ..., - _options: Any | None = ..., + retries: Incomplete | None = ..., + timeout: Incomplete | None = ..., + deadline: Incomplete | None = ..., + use_cache: Incomplete | None = ..., + use_global_cache: Incomplete | None = ..., + use_datastore: Incomplete | None = ..., + global_cache_timeout: Incomplete | None = ..., + use_memcache: Incomplete | None = ..., + memcache_timeout: Incomplete | None = ..., + max_memcache_items: Incomplete | None = ..., + force_writes: Incomplete | None = ..., + _options: Incomplete | None = ..., ): ... @classmethod def from_old_key(cls, old_key) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/google/cloud/ndb/metadata.pyi b/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/google/cloud/ndb/metadata.pyi index 6c8d33924..3f52576f4 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/google/cloud/ndb/metadata.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/google/cloud/ndb/metadata.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from google.cloud.ndb import model @@ -45,7 +46,7 @@ class EntityGroup: def __new__(cls, *args, **kwargs): ... def get_entity_group_version(*args, **kwargs) -> None: ... -def get_kinds(start: Any | None = ..., end: Any | None = ...): ... -def get_namespaces(start: Any | None = ..., end: Any | None = ...): ... -def get_properties_of_kind(kind, start: Any | None = ..., end: Any | None = ...): ... -def get_representations_of_kind(kind, start: Any | None = ..., end: Any | None = ...): ... +def get_kinds(start: Incomplete | None = ..., end: Incomplete | None = ...): ... +def get_namespaces(start: Incomplete | None = ..., end: Incomplete | None = ...): ... +def get_properties_of_kind(kind, start: Incomplete | None = ..., end: Incomplete | None = ...): ... +def get_representations_of_kind(kind, start: Incomplete | None = ..., end: Incomplete | None = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/google/cloud/ndb/model.pyi b/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/google/cloud/ndb/model.pyi index 2f7704131..8a8dc1809 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/google/cloud/ndb/model.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/google/cloud/ndb/model.pyi @@ -1,8 +1,8 @@ import datetime -from _typeshed import Self +from _typeshed import Unused from collections.abc import Callable, Iterable, Sequence from typing import Any, NoReturn -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal, Self, TypeAlias from google.cloud.ndb import exceptions, key as key_module, query as query_module, tasklets as tasklets_module @@ -27,7 +27,7 @@ class _NotEqualMixin: _Direction: TypeAlias = Literal["asc", "desc"] class IndexProperty(_NotEqualMixin): - def __new__(cls: type[Self], name: str, direction: _Direction) -> Self: ... + def __new__(cls, name: str, direction: _Direction) -> Self: ... @property def name(self) -> str: ... @property @@ -36,7 +36,7 @@ class IndexProperty(_NotEqualMixin): def __hash__(self) -> int: ... class Index(_NotEqualMixin): - def __new__(cls: type[Self], kind: str, properties: list[IndexProperty], ancestor: bool) -> Self: ... + def __new__(cls, kind: str, properties: list[IndexProperty], ancestor: bool) -> Self: ... @property def kind(self) -> str: ... @property @@ -59,7 +59,7 @@ class IndexState(_NotEqualMixin): class ModelAdapter: # This actually returns NoReturn, but mypy can't handle that - def __new__(cls: type[Self], *args, **kwargs) -> Self: ... + def __new__(cls, *args, **kwargs) -> Self: ... def make_connection(*args, **kwargs) -> NoReturn: ... @@ -78,7 +78,7 @@ class Property(ModelAttribute): indexed: bool | None = ..., repeated: bool | None = ..., required: bool | None = ..., - default: object | None = ..., + default: object = None, choices: Iterable[object] | None = ..., validator: Callable[[Property, Any], object] | None = ..., verbose_name: str | None = ..., @@ -154,7 +154,7 @@ class JsonProperty(BlobProperty): indexed: bool | None = ..., repeated: bool | None = ..., required: bool | None = ..., - default: object | None = ..., + default: object = None, choices: Iterable[object] | None = ..., validator: Callable[[Property, Any], object] | None = ..., verbose_name: str | None = ..., @@ -226,7 +226,7 @@ class TimeProperty(DateTimeProperty): ... class StructuredProperty(Property): def __init__(self, model_class: type, name: str | None = ..., **kwargs) -> None: ... - def __getattr__(self, attrname): ... + def __getattr__(self, attrname: str): ... def IN(self, value: Iterable[object]) -> query_module.DisjunctionNode | query_module.FalseNode: ... class LocalStructuredProperty(BlobProperty): @@ -424,7 +424,7 @@ def get_multi_async( memcache_timeout: int | None = ..., max_memcache_items: int | None = ..., force_writes: bool | None = ..., - _options: object | None = ..., + _options: object = None, ) -> list[type[tasklets_module.Future]]: ... def get_multi( keys: Sequence[type[key_module.Key]], @@ -442,7 +442,7 @@ def get_multi( memcache_timeout: int | None = ..., max_memcache_items: int | None = ..., force_writes: bool | None = ..., - _options: object | None = ..., + _options: object = None, ) -> list[type[Model] | None]: ... def put_multi_async( entities: list[type[Model]], @@ -457,7 +457,7 @@ def put_multi_async( memcache_timeout: int | None = ..., max_memcache_items: int | None = ..., force_writes: bool | None = ..., - _options: object | None = ..., + _options: object = None, ) -> list[tasklets_module.Future]: ... def put_multi( entities: list[Model], @@ -472,7 +472,7 @@ def put_multi( memcache_timeout: int | None = ..., max_memcache_items: int | None = ..., force_writes: bool | None = ..., - _options: object | None = ..., + _options: object = None, ) -> list[key_module.Key]: ... def delete_multi_async( keys: list[key_module.Key], @@ -487,7 +487,7 @@ def delete_multi_async( memcache_timeout: int | None = ..., max_memcache_items: int | None = ..., force_writes: bool | None = ..., - _options: object | None = ..., + _options: object = None, ) -> list[tasklets_module.Future]: ... def delete_multi( keys: Sequence[key_module.Key], @@ -502,7 +502,7 @@ def delete_multi( memcache_timeout: int | None = ..., max_memcache_items: int | None = ..., force_writes: bool | None = ..., - _options: object | None = ..., + _options: object = None, ) -> list[None]: ... -def get_indexes_async(**options: object) -> NoReturn: ... -def get_indexes(**options: object) -> NoReturn: ... +def get_indexes_async(**options: Unused) -> NoReturn: ... +def get_indexes(**options: Unused) -> NoReturn: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/google/cloud/ndb/query.pyi b/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/google/cloud/ndb/query.pyi index 6ca3d6f33..12da5f4f1 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/google/cloud/ndb/query.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/google/cloud/ndb/query.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from google.cloud.ndb import _options @@ -90,7 +91,7 @@ OR = DisjunctionNode class QueryOptions(_options.ReadOptions): project: Any namespace: Any - def __init__(self, config: Any | None = ..., context: Any | None = ..., **kwargs) -> None: ... + def __init__(self, config: Incomplete | None = ..., context: Incomplete | None = ..., **kwargs) -> None: ... class Query: default_options: Any @@ -107,21 +108,21 @@ class Query: distinct_on: Any def __init__( self, - kind: Any | None = ..., - filters: Any | None = ..., - ancestor: Any | None = ..., - order_by: Any | None = ..., - orders: Any | None = ..., - project: Any | None = ..., - app: Any | None = ..., - namespace: Any | None = ..., - projection: Any | None = ..., - distinct_on: Any | None = ..., - group_by: Any | None = ..., - limit: Any | None = ..., - offset: Any | None = ..., - keys_only: Any | None = ..., - default_options: Any | None = ..., + kind: Incomplete | None = ..., + filters: Incomplete | None = ..., + ancestor: Incomplete | None = ..., + order_by: Incomplete | None = ..., + orders: Incomplete | None = ..., + project: Incomplete | None = ..., + app: Incomplete | None = ..., + namespace: Incomplete | None = ..., + projection: Incomplete | None = ..., + distinct_on: Incomplete | None = ..., + group_by: Incomplete | None = ..., + limit: Incomplete | None = ..., + offset: Incomplete | None = ..., + keys_only: Incomplete | None = ..., + default_options: Incomplete | None = ..., ) -> None: ... @property def is_distinct(self): ... @@ -129,17 +130,17 @@ class Query: def order(self, *props): ... def analyze(self): ... def bind(self, *positional, **keyword): ... - def fetch(self, limit: Any | None = ..., **kwargs): ... - def fetch_async(self, limit: Any | None = ..., **kwargs): ... - def run_to_queue(self, queue, conn, options: Any | None = ..., dsquery: Any | None = ...) -> None: ... + def fetch(self, limit: Incomplete | None = ..., **kwargs): ... + 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 def map(self, callback, **kwargs): ... def map_async(self, callback, **kwargs) -> None: ... def get(self, **kwargs): ... def get_async(self, **kwargs) -> None: ... - def count(self, limit: Any | None = ..., **kwargs): ... - def count_async(self, limit: Any | None = ..., **kwargs): ... + def count(self, limit: Incomplete | None = ..., **kwargs): ... + def count_async(self, limit: Incomplete | None = ..., **kwargs): ... def fetch_page(self, page_size, **kwargs): ... def fetch_page_async(self, page_size, **kwargs) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/hdbcli/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/hdbcli/METADATA.toml index f23ed673b..d3860c9ba 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/hdbcli/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/hdbcli/METADATA.toml @@ -1 +1 @@ -version = "2.13.*" +version = "2.15.*" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/hdbcli/hdbcli/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/hdbcli/hdbcli/__init__.pyi index bda5b5a7f..af0d55ba5 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/hdbcli/hdbcli/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/hdbcli/hdbcli/__init__.pyi @@ -1 +1,3 @@ +from . import dbapi as dbapi + __version__: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/hdbcli/hdbcli/dbapi.pyi b/packages/pyright-internal/typeshed-fallback/stubs/hdbcli/hdbcli/dbapi.pyi index 3ec97b6fe..51216e873 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/hdbcli/hdbcli/dbapi.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/hdbcli/hdbcli/dbapi.pyi @@ -1,7 +1,8 @@ import decimal -from _typeshed import ReadableBuffer +from _typeshed import Incomplete, ReadableBuffer from collections.abc import Sequence from datetime import date, datetime, time +from types import TracebackType from typing import Any, overload from typing_extensions import Literal, TypeAlias @@ -33,6 +34,7 @@ class Connection: def getaddress(self) -> str: ... def getautocommit(self) -> bool: ... def getclientinfo(self, key: str = ...) -> str | dict[str, str]: ... + def getproperty(self, *args: Incomplete, **kwargs: Incomplete) -> Incomplete: ... def isconnected(self) -> bool: ... def rollback(self) -> None: ... def setautocommit(self, auto: bool = ...) -> None: ... @@ -53,7 +55,11 @@ class Cursor: statementhash: str | None connection: Connection arraysize: int + refreshts: Incomplete + maxage: int def __init__(self, *args: Any, **kwargs: Any) -> None: ... + def __enter__(self) -> Incomplete: ... + def __exit__(self, typ: type[BaseException] | None, val: BaseException | None, tb: TracebackType | None) -> None: ... def callproc(self, procname: str, parameters: tuple[Any, ...] = ..., overview: bool = ...) -> tuple[Any, ...]: ... def close(self) -> None: ... def description_ext(self) -> Sequence[tuple[Any, ...]]: ... @@ -64,21 +70,29 @@ class Cursor: def fetchone(self, uselob: bool = ...) -> ResultRow | None: ... def fetchall(self) -> list[ResultRow]: ... def fetchmany(self, size: int | None = ...) -> list[ResultRow]: ... + def getrowsaffectedcounts(self) -> tuple[Any, ...]: ... + def getpacketsize(self) -> int: ... def get_resultset_holdability(self) -> int: ... def getwarning(self) -> Warning | None: ... def haswarning(self) -> bool: ... + def clearwarning(self) -> None: ... + def has_result_set(self) -> bool: ... def nextset(self) -> None: ... def parameter_description(self) -> tuple[str, ...]: ... @overload def prepare(self, operation: str, newcursor: Literal[True]) -> Cursor: ... @overload def prepare(self, operation: str, newcursor: Literal[False]) -> Any: ... + def print_message(self, *args: Incomplete, **kwargs: Incomplete) -> Incomplete: ... + def parsenamedquery(self, *args: Incomplete, **kwargs: Incomplete) -> Incomplete: ... def scroll(self, value: int, mode: Literal["absolute", "relative"] = ...) -> None: ... def server_cpu_time(self) -> int: ... def server_memory_usage(self) -> int: ... def server_processing_time(self) -> int: ... def setinputsizes(self, *args: Any, **kwargs: Any) -> None: ... def setfetchsize(self, value: int) -> None: ... + def setquerytimeout(self, value: int) -> None: ... + def setpacketsize(self, value: int) -> None: ... def set_resultset_holdability(self, holdability: int) -> None: ... def setoutputsize(self, *args: Any, **kwargs: Any) -> None: ... @@ -99,6 +113,12 @@ class InternalError(DatabaseError): ... class DataError(DatabaseError): ... class NotSupportedError(DatabaseError): ... +class ExecuteManyError(Error): + errors: Incomplete + +class ExecuteManyErrorEntry(Error): + rownumber: int + def Date(year: int, month: int, day: int) -> date: ... def Time(hour: int, minute: int, second: int, millisecond: int = ...) -> time: ... def Timestamp(year: int, month: int, day: int, hour: int, minute: int, second: int, millisecond: int = ...) -> datetime: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/html5lib/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/html5lib/METADATA.toml index c9f594bd7..0d6ac713a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/html5lib/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/html5lib/METADATA.toml @@ -1 +1,5 @@ version = "1.1.*" + +[tool.stubtest] +ignore_missing_stub = true +extras = ["all"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/_ihatexml.pyi b/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/_ihatexml.pyi index dff7e852e..60edb7028 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/_ihatexml.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/_ihatexml.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any baseChar: str @@ -43,7 +44,7 @@ class InfosetFilter: replaceFormFeedCharacters: bool = ..., preventSingleQuotePubid: bool = ..., ) -> None: ... - def coerceAttribute(self, name, namespace: Any | None = ...): ... + def coerceAttribute(self, name, namespace: Incomplete | None = ...): ... def coerceElement(self, name): ... def coerceComment(self, data): ... def coerceCharacters(self, data): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/_inputstream.pyi b/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/_inputstream.pyi index 56096a058..000193386 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/_inputstream.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/_inputstream.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any spaceCharactersBytes: Any @@ -37,7 +38,7 @@ class HTMLUnicodeInputStream: def openStream(self, source): ... def position(self): ... def char(self): ... - def readChunk(self, chunkSize: Any | None = ...): ... + def readChunk(self, chunkSize: Incomplete | None = ...): ... def characterErrorsUCS4(self, data) -> None: ... def characterErrorsUCS2(self, data) -> None: ... def charsUntil(self, characters, opposite: bool = ...): ... @@ -56,10 +57,10 @@ class HTMLBinaryInputStream(HTMLUnicodeInputStream): def __init__( self, source, - override_encoding: Any | None = ..., - transport_encoding: Any | None = ..., - same_origin_parent_encoding: Any | None = ..., - likely_encoding: Any | None = ..., + override_encoding: Incomplete | None = ..., + transport_encoding: Incomplete | None = ..., + same_origin_parent_encoding: Incomplete | None = ..., + likely_encoding: Incomplete | None = ..., default_encoding: str = ..., useChardet: bool = ..., ) -> None: ... @@ -72,7 +73,7 @@ class HTMLBinaryInputStream(HTMLUnicodeInputStream): def detectEncodingMeta(self): ... class EncodingBytes(bytes): - def __new__(cls, value): ... + def __new__(self, value): ... def __init__(self, value) -> None: ... def __iter__(self): ... def __next__(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/_tokenizer.pyi b/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/_tokenizer.pyi index 22c471637..639a4ca9a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/_tokenizer.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/_tokenizer.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any entitiesTrie: Any @@ -11,11 +12,11 @@ class HTMLTokenizer: state: Any escape: bool currentToken: Any - def __init__(self, stream, parser: Any | None = ..., **kwargs) -> None: ... + def __init__(self, stream, parser: Incomplete | None = ..., **kwargs) -> None: ... tokenQueue: Any def __iter__(self): ... def consumeNumberEntity(self, isHex): ... - def consumeEntity(self, allowedChar: Any | None = ..., fromAttribute: bool = ...) -> None: ... + def consumeEntity(self, allowedChar: Incomplete | None = ..., fromAttribute: bool = ...) -> None: ... def processEntityInAttribute(self, allowedChar) -> None: ... def emitCurrentToken(self) -> None: ... def dataState(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/_trie/_base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/_trie/_base.pyi index 138c91ccd..3b0773a7d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/_trie/_base.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/_trie/_base.pyi @@ -1,9 +1,10 @@ +from _typeshed import Incomplete from abc import ABCMeta from collections.abc import Mapping from typing import Any class Trie(Mapping[Any, Any], metaclass=ABCMeta): - def keys(self, prefix: Any | None = ...): ... + def keys(self, prefix: Incomplete | None = ...): ... def has_keys_with_prefix(self, prefix): ... def longest_prefix(self, prefix): ... def longest_prefix_item(self, prefix): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/_trie/py.pyi b/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/_trie/py.pyi index cd3e66dd4..ec50ef0d5 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/_trie/py.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/_trie/py.pyi @@ -1,12 +1,12 @@ -from typing import Any +from _typeshed import Incomplete from ._base import Trie as ABCTrie class Trie(ABCTrie): def __init__(self, data) -> None: ... def __contains__(self, key): ... - def __len__(self): ... + def __len__(self) -> int: ... def __iter__(self): ... def __getitem__(self, key): ... - def keys(self, prefix: Any | None = ...): ... + def keys(self, prefix: Incomplete | None = ...): ... def has_keys_with_prefix(self, prefix): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/_utils.pyi b/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/_utils.pyi index 1ea974392..cfd97de7e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/_utils.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/_utils.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from collections.abc import Mapping from typing import Any @@ -7,7 +8,7 @@ class MethodDispatcher(dict[Any, Any]): default: Any def __init__(self, items=...) -> None: ... def __getitem__(self, key): ... - def __get__(self, instance, owner: Any | None = ...): ... + def __get__(self, instance, owner: Incomplete | None = ...): ... class BoundMethodDispatcher(Mapping[Any, Any]): instance: Any @@ -16,7 +17,7 @@ class BoundMethodDispatcher(Mapping[Any, Any]): def __getitem__(self, key): ... def get(self, key, default): ... def __iter__(self): ... - def __len__(self): ... + def __len__(self) -> int: ... def __contains__(self, key): ... def isSurrogatePair(data): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/filters/base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/filters/base.pyi index 16d3726e0..166f20404 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/filters/base.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/filters/base.pyi @@ -4,4 +4,4 @@ class Filter: source: Any def __init__(self, source) -> None: ... def __iter__(self): ... - def __getattr__(self, name): ... + def __getattr__(self, name: str): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/html5parser.pyi b/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/html5parser.pyi index d7a873dde..79dc56c0d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/html5parser.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/html5parser.pyi @@ -1,4 +1,4 @@ -from _typeshed import SupportsRead +from _typeshed import Incomplete, SupportsRead from typing import Any, overload from typing_extensions import Literal from xml.etree.ElementTree import Element @@ -23,7 +23,7 @@ class HTMLParser: errors: Any phases: Any def __init__( - self, tree: Any | None = ..., strict: bool = ..., namespaceHTMLElements: bool = ..., debug: bool = ... + self, tree: Incomplete | None = ..., strict: bool = ..., namespaceHTMLElements: bool = ..., debug: bool = ... ) -> None: ... firstStartTag: bool log: Any @@ -41,7 +41,7 @@ class HTMLParser: def mainLoop(self) -> None: ... def parse(self, stream, scripting: bool = ..., **kwargs): ... def parseFragment(self, stream, *args, **kwargs): ... - def parseError(self, errorcode: str = ..., datavars: Any | None = ...) -> None: ... + def parseError(self, errorcode: str = ..., datavars: Incomplete | None = ...) -> None: ... def adjustMathMLAttributes(self, token) -> None: ... def adjustSVGAttributes(self, token) -> None: ... def adjustForeignAttributes(self, token) -> None: ... @@ -52,6 +52,6 @@ class HTMLParser: def getPhases(debug): ... def adjust_attributes(token, replacements) -> None: ... -def impliedTagToken(name, type: str = ..., attributes: Any | None = ..., selfClosing: bool = ...): ... +def impliedTagToken(name, type: str = ..., attributes: Incomplete | None = ..., selfClosing: bool = ...): ... class ParseError(Exception): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/serializer.pyi b/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/serializer.pyi index 210c725cc..dc505f247 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/serializer.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/serializer.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any, overload def htmlentityreplace_errors(exc: Exception) -> tuple[str | bytes, int]: ... @@ -30,8 +31,8 @@ class HTMLSerializer: def encode(self, string): ... def encodeStrict(self, string): ... encoding: Any - def serialize(self, treewalker, encoding: Any | None = ...) -> None: ... - def render(self, treewalker, encoding: Any | None = ...): ... + def serialize(self, treewalker, encoding: Incomplete | None = ...) -> None: ... + def render(self, treewalker, encoding: Incomplete | None = ...): ... def serializeError(self, data: str = ...) -> None: ... class SerializeError(Exception): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/treebuilders/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/treebuilders/__init__.pyi index a9cd20041..f577600b4 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/treebuilders/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/treebuilders/__init__.pyi @@ -1,5 +1,6 @@ +from _typeshed import Incomplete from typing import Any treeBuilderCache: Any -def getTreeBuilder(treeType, implementation: Any | None = ..., **kwargs): ... +def getTreeBuilder(treeType, implementation: Incomplete | None = ..., **kwargs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/treebuilders/base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/treebuilders/base.pyi index 8c73d5257..b1623bae6 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/treebuilders/base.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/treebuilders/base.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any Marker: Any @@ -11,7 +12,7 @@ class Node: childNodes: Any def __init__(self, name) -> None: ... def appendChild(self, node) -> None: ... - def insertText(self, data, insertBefore: Any | None = ...) -> None: ... + def insertText(self, data, insertBefore: Incomplete | None = ...) -> None: ... def insertBefore(self, node, refNode) -> None: ... def removeChild(self, node) -> None: ... def reparentChildren(self, newParent) -> None: ... @@ -37,19 +38,19 @@ class TreeBuilder: insertFromTable: bool document: Any def reset(self) -> None: ... - def elementInScope(self, target, variant: Any | None = ...): ... + def elementInScope(self, target, variant: Incomplete | None = ...): ... def reconstructActiveFormattingElements(self) -> None: ... def clearActiveFormattingElements(self) -> None: ... def elementInActiveFormattingElements(self, name): ... def insertRoot(self, token) -> None: ... def insertDoctype(self, token) -> None: ... - def insertComment(self, token, parent: Any | None = ...) -> None: ... + def insertComment(self, token, parent: Incomplete | None = ...) -> None: ... def createElement(self, token): ... def insertElementNormal(self, token): ... def insertElementTable(self, token): ... - def insertText(self, data, parent: Any | None = ...) -> None: ... + def insertText(self, data, parent: Incomplete | None = ...) -> None: ... def getTableMisnestedNodePosition(self): ... - def generateImpliedEndTags(self, exclude: Any | None = ...) -> None: ... + def generateImpliedEndTags(self, exclude: Incomplete | None = ...) -> None: ... def getDocument(self): ... def getFragment(self): ... def testSerializer(self, node) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/treebuilders/etree_lxml.pyi b/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/treebuilders/etree_lxml.pyi index 9a16c4934..1f76a6fa2 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/treebuilders/etree_lxml.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/treebuilders/etree_lxml.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from . import base @@ -38,7 +39,7 @@ class TreeBuilder(base.TreeBuilder): def getDocument(self): ... def getFragment(self): ... def insertDoctype(self, token) -> None: ... - def insertCommentInitial(self, data, parent: Any | None = ...) -> None: ... - def insertCommentMain(self, data, parent: Any | None = ...) -> None: ... + def insertCommentInitial(self, data, parent: Incomplete | None = ...) -> None: ... + def insertCommentMain(self, data, parent: Incomplete | None = ...) -> None: ... document: Any def insertRoot(self, token) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/treewalkers/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/treewalkers/__init__.pyi index eb1e26e94..0eda70032 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/treewalkers/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/treewalkers/__init__.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete -def getTreeWalker(treeType, implementation: Any | None = ..., **kwargs): ... +def getTreeWalker(treeType, implementation: Incomplete | None = ..., **kwargs): ... def pprint(walker): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/treewalkers/base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/treewalkers/base.pyi index 34eee4b3e..919b22011 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/treewalkers/base.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/treewalkers/base.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any DOCUMENT: Any @@ -18,7 +19,7 @@ class TreeWalker: def endTag(self, namespace, name): ... def text(self, data) -> None: ... def comment(self, data): ... - def doctype(self, name, publicId: Any | None = ..., systemId: Any | None = ...): ... + def doctype(self, name, publicId: Incomplete | None = ..., systemId: Incomplete | None = ...): ... def entity(self, name): ... def unknown(self, nodeType): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/treewalkers/etree_lxml.pyi b/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/treewalkers/etree_lxml.pyi index c9fb06cee..6ef2c4837 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/treewalkers/etree_lxml.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/html5lib/html5lib/treewalkers/etree_lxml.pyi @@ -12,7 +12,7 @@ class Root: def __init__(self, et) -> None: ... def __getitem__(self, key): ... def getnext(self) -> None: ... - def __len__(self): ... + def __len__(self) -> int: ... class Doctype: root_node: Any @@ -36,13 +36,13 @@ class FragmentWrapper: text: Any tail: Any def __init__(self, fragment_root, obj) -> None: ... - def __getattr__(self, name): ... + def __getattr__(self, name: str): ... def getnext(self): ... def __getitem__(self, key): ... - def __bool__(self): ... + def __bool__(self) -> bool: ... def getparent(self) -> None: ... - def __unicode__(self): ... - def __len__(self): ... + def __unicode__(self) -> str: ... + def __len__(self) -> int: ... class TreeWalker(NonRecursiveTreeWalker): fragmentChildren: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/httplib2/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/httplib2/METADATA.toml index ae1fb69ff..e22598a66 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/httplib2/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/httplib2/METADATA.toml @@ -1 +1 @@ -version = "0.20.*" +version = "0.21.*" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/httplib2/httplib2/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/httplib2/httplib2/__init__.pyi index 10249a122..485c09178 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/httplib2/httplib2/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/httplib2/httplib2/__init__.pyi @@ -1,7 +1,8 @@ import http.client -from _typeshed import Self +from _typeshed import Incomplete from collections.abc import Generator -from typing import Any +from typing import Any, ClassVar +from typing_extensions import Self from .error import * @@ -30,7 +31,7 @@ class Authentication: def __gt__(self, auth): ... def __le__(self, auth): ... def __ge__(self, auth): ... - def __bool__(self): ... + def __bool__(self) -> bool: ... class BasicAuthentication(Authentication): def __init__(self, credentials, host, request_uri, headers, response, content, http) -> None: ... @@ -40,7 +41,7 @@ class DigestAuthentication(Authentication): challenge: Any A1: Any def __init__(self, credentials, host, request_uri, headers, response, content, http) -> None: ... - def request(self, method, request_uri, headers, content, cnonce: Any | None = ...): ... + def request(self, method, request_uri, headers, content, cnonce: Incomplete | None = ...): ... def response(self, response, content): ... class HmacDigestAuthentication(Authentication): @@ -48,6 +49,7 @@ class HmacDigestAuthentication(Authentication): hashmod: Any pwhashmod: Any key: Any + __author__: ClassVar[str] def __init__(self, credentials, host, request_uri, headers, response, content, http) -> None: ... def request(self, method, request_uri, headers, content) -> None: ... def response(self, response, content): ... @@ -90,9 +92,9 @@ class ProxyInfo: proxy_host, proxy_port, proxy_rdns: bool = ..., - proxy_user: Any | None = ..., - proxy_pass: Any | None = ..., - proxy_headers: Any | None = ..., + proxy_user: Incomplete | None = ..., + proxy_pass: Incomplete | None = ..., + proxy_headers: Incomplete | None = ..., ) -> None: ... def astuple(self): ... def isgood(self): ... @@ -101,7 +103,9 @@ class ProxyInfo: class HTTPConnectionWithTimeout(http.client.HTTPConnection): proxy_info: Any - def __init__(self, host, port: Any | None = ..., timeout: Any | None = ..., proxy_info: Any | None = ...) -> None: ... + def __init__( + self, host, port: Incomplete | None = ..., timeout: Incomplete | None = ..., proxy_info: Incomplete | None = ... + ) -> None: ... sock: Any def connect(self) -> None: ... @@ -115,16 +119,16 @@ class HTTPSConnectionWithTimeout(http.client.HTTPSConnection): def __init__( self, host, - port: Any | None = ..., - key_file: Any | None = ..., - cert_file: Any | None = ..., - timeout: Any | None = ..., - proxy_info: Any | None = ..., - ca_certs: Any | None = ..., + port: Incomplete | None = ..., + key_file: Incomplete | None = ..., + cert_file: Incomplete | None = ..., + timeout: Incomplete | None = ..., + proxy_info: Incomplete | None = ..., + ca_certs: Incomplete | None = ..., disable_ssl_certificate_validation: bool = ..., - tls_maximum_version: Any | None = ..., - tls_minimum_version: Any | None = ..., - key_password: Any | None = ..., + tls_maximum_version: Incomplete | None = ..., + tls_minimum_version: Incomplete | None = ..., + key_password: Incomplete | None = ..., ) -> None: ... sock: Any def connect(self) -> None: ... @@ -151,26 +155,26 @@ class Http: forward_authorization_headers: bool def __init__( self, - cache: Any | None = ..., - timeout: Any | None = ..., + cache: Incomplete | None = ..., + timeout: Incomplete | None = ..., proxy_info=..., - ca_certs: Any | None = ..., + ca_certs: Incomplete | None = ..., disable_ssl_certificate_validation: bool = ..., - tls_maximum_version: Any | None = ..., - tls_minimum_version: Any | None = ..., + tls_maximum_version: Incomplete | None = ..., + tls_minimum_version: Incomplete | None = ..., ) -> None: ... def close(self) -> None: ... def add_credentials(self, name, password, domain: str = ...) -> None: ... - def add_certificate(self, key, cert, domain, password: Any | None = ...) -> None: ... + def add_certificate(self, key, cert, domain, password: Incomplete | None = ...) -> None: ... def clear_credentials(self) -> None: ... def request( self, uri, method: str = ..., - body: Any | None = ..., - headers: Any | None = ..., + body: Incomplete | None = ..., + headers: Incomplete | None = ..., redirections=..., - connection_type: Any | None = ..., + connection_type: Incomplete | None = ..., ): ... class Response(dict[str, Any]): @@ -181,4 +185,4 @@ class Response(dict[str, Any]): previous: Any def __init__(self, info) -> None: ... @property - def dict(self: Self) -> Self: ... + def dict(self) -> Self: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/httplib2/httplib2/socks.pyi b/packages/pyright-internal/typeshed-fallback/stubs/httplib2/httplib2/socks.pyi index c65363dee..ab1cff460 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/httplib2/httplib2/socks.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/httplib2/httplib2/socks.pyi @@ -1,5 +1,5 @@ import socket -from typing import Any +from _typeshed import Incomplete PROXY_TYPE_SOCKS4: int PROXY_TYPE_SOCKS5: int @@ -14,27 +14,27 @@ class Socks4Error(ProxyError): ... class HTTPError(ProxyError): ... def setdefaultproxy( - proxytype: Any | None = ..., - addr: Any | None = ..., - port: Any | None = ..., + proxytype: Incomplete | None = ..., + addr: Incomplete | None = ..., + port: Incomplete | None = ..., rdns: bool = ..., - username: Any | None = ..., - password: Any | None = ..., + username: Incomplete | None = ..., + password: Incomplete | None = ..., ) -> None: ... def wrapmodule(module) -> None: ... class socksocket(socket.socket): - def __init__(self, family=..., type=..., proto: int = ..., _sock: Any | None = ...) -> None: ... + def __init__(self, family=..., type=..., proto: int = ..., _sock: Incomplete | None = ...) -> None: ... def sendall(self, content, *args): ... def setproxy( self, - proxytype: Any | None = ..., - addr: Any | None = ..., - port: Any | None = ..., + proxytype: Incomplete | None = ..., + addr: Incomplete | None = ..., + port: Incomplete | None = ..., rdns: bool = ..., - username: Any | None = ..., - password: Any | None = ..., - headers: Any | None = ..., + username: Incomplete | None = ..., + password: Incomplete | None = ..., + headers: Incomplete | None = ..., ) -> None: ... def getproxysockname(self): ... def getproxypeername(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/humanfriendly/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/humanfriendly/METADATA.toml index 5ed8ec606..21700a749 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/humanfriendly/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/humanfriendly/METADATA.toml @@ -1 +1,4 @@ version = "10.0.*" + +[tool.stubtest] +stubtest_requirements = ["docutils", "mock"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/humanfriendly/humanfriendly/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/humanfriendly/humanfriendly/__init__.pyi index f906c2f25..7e7761828 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/humanfriendly/humanfriendly/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/humanfriendly/humanfriendly/__init__.pyi @@ -1,4 +1,5 @@ import datetime +from _typeshed import Incomplete from re import Pattern from types import TracebackType from typing import Any, NamedTuple @@ -36,7 +37,7 @@ class Timer: resumable: bool start_time: float total_time: float - def __init__(self, start_time: Any | None = ..., resumable: bool = ...) -> None: ... + def __init__(self, start_time: Incomplete | None = ..., resumable: bool = ...) -> None: ... def __enter__(self): ... def __exit__( self, diff --git a/packages/pyright-internal/typeshed-fallback/stubs/humanfriendly/humanfriendly/case.pyi b/packages/pyright-internal/typeshed-fallback/stubs/humanfriendly/humanfriendly/case.pyi index 57aea27e9..1ab0b0173 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/humanfriendly/humanfriendly/case.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/humanfriendly/humanfriendly/case.pyi @@ -1,5 +1,6 @@ +from _typeshed import Incomplete from collections import OrderedDict -from typing import Any, Generic, TypeVar +from typing import Generic, TypeVar from humanfriendly.compat import unicode @@ -7,20 +8,20 @@ _KT = TypeVar("_KT") _VT = TypeVar("_VT") class CaseInsensitiveDict(OrderedDict[_KT, _VT], Generic[_KT, _VT]): - def __init__(self, other: Any | None = ..., **kw) -> None: ... + def __init__(self, other: Incomplete | None = ..., **kw) -> None: ... def coerce_key(self, key): ... @classmethod - def fromkeys(cls, iterable, value: Any | None = ...): ... - def get(self, key, default: Any | None = ...): ... - def pop(self, key, default: Any | None = ...): ... - def setdefault(self, key, default: Any | None = ...): ... - def update(self, other: Any | None = ..., **kw) -> None: ... # type: ignore[override] + def fromkeys(cls, iterable, value: Incomplete | None = ...): ... + def get(self, key, default: Incomplete | None = ...): ... + def pop(self, key, default: Incomplete | None = ...): ... + def setdefault(self, key, default: Incomplete | None = ...): ... + def update(self, other: Incomplete | None = ..., **kw) -> None: ... # type: ignore[override] def __contains__(self, key): ... - def __delitem__(self, key): ... + def __delitem__(self, key) -> None: ... def __getitem__(self, key): ... - def __setitem__(self, key, value): ... + def __setitem__(self, key, value) -> None: ... class CaseInsensitiveKey(unicode): def __new__(cls, value): ... - def __hash__(self): ... + def __hash__(self) -> int: ... def __eq__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/humanfriendly/humanfriendly/cli.pyi b/packages/pyright-internal/typeshed-fallback/stubs/humanfriendly/humanfriendly/cli.pyi index 200009fc3..a97befdcb 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/humanfriendly/humanfriendly/cli.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/humanfriendly/humanfriendly/cli.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete def main() -> None: ... def run_command(command_line) -> None: ... @@ -10,4 +10,4 @@ def print_formatted_timespan(value) -> None: ... def print_parsed_length(value) -> None: ... def print_parsed_size(value) -> None: ... def demonstrate_ansi_formatting() -> None: ... -def demonstrate_256_colors(i, j, group: Any | None = ...) -> None: ... +def demonstrate_256_colors(i, j, group: Incomplete | None = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/humanfriendly/humanfriendly/deprecation.pyi b/packages/pyright-internal/typeshed-fallback/stubs/humanfriendly/humanfriendly/deprecation.pyi index f384fa8aa..db18163bd 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/humanfriendly/humanfriendly/deprecation.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/humanfriendly/humanfriendly/deprecation.pyi @@ -10,5 +10,5 @@ class DeprecationProxy(types.ModuleType): module: Any aliases: Any def __init__(self, module, aliases) -> None: ... - def __getattr__(self, name): ... + def __getattr__(self, name: str): ... def resolve(self, target): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/humanfriendly/humanfriendly/prompts.pyi b/packages/pyright-internal/typeshed-fallback/stubs/humanfriendly/humanfriendly/prompts.pyi index 9bc7a4fb4..909fa611b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/humanfriendly/humanfriendly/prompts.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/humanfriendly/humanfriendly/prompts.pyi @@ -1,11 +1,12 @@ +from _typeshed import Incomplete from typing import Any MAX_ATTEMPTS: int logger: Any -def prompt_for_confirmation(question, default: Any | None = ..., padding: bool = ...): ... -def prompt_for_choice(choices, default: Any | None = ..., padding: bool = ...): ... -def prompt_for_input(question, default: Any | None = ..., padding: bool = ..., strip: bool = ...): ... +def prompt_for_confirmation(question, default: Incomplete | None = ..., padding: bool = ...): ... +def prompt_for_choice(choices, default: Incomplete | None = ..., padding: bool = ...): ... +def prompt_for_input(question, default: Incomplete | None = ..., padding: bool = ..., strip: bool = ...): ... def prepare_prompt_text(prompt_text, **options): ... def prepare_friendly_prompts() -> None: ... def retry_limit(limit=...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/humanfriendly/humanfriendly/tables.pyi b/packages/pyright-internal/typeshed-fallback/stubs/humanfriendly/humanfriendly/tables.pyi index 0b324b1f3..658a58327 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/humanfriendly/humanfriendly/tables.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/humanfriendly/humanfriendly/tables.pyi @@ -1,6 +1,6 @@ -from typing import Any +from _typeshed import Incomplete def format_smart_table(data, column_names): ... -def format_pretty_table(data, column_names: Any | None = ..., horizontal_bar: str = ..., vertical_bar: str = ...): ... +def format_pretty_table(data, column_names: Incomplete | None = ..., horizontal_bar: str = ..., vertical_bar: str = ...): ... def format_robust_table(data, column_names): ... -def format_rst_table(data, column_names: Any | None = ...): ... +def format_rst_table(data, column_names: Incomplete | None = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/humanfriendly/humanfriendly/terminal/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/humanfriendly/humanfriendly/terminal/__init__.pyi index 8c94e18c0..f7c26eaa4 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/humanfriendly/humanfriendly/terminal/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/humanfriendly/humanfriendly/terminal/__init__.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any ANSI_CSI: str @@ -20,18 +21,18 @@ def ansi_width(text): ... def ansi_wrap(text, **kw): ... def auto_encode(stream, text, *args, **kw) -> None: ... def clean_terminal_output(text): ... -def connected_to_terminal(stream: Any | None = ...): ... +def connected_to_terminal(stream: Incomplete | None = ...): ... def enable_ansi_support(): ... def find_terminal_size(): ... def find_terminal_size_using_ioctl(stream): ... def find_terminal_size_using_stty(): ... -def get_pager_command(text: Any | None = ...): ... +def get_pager_command(text: Incomplete | None = ...): ... def have_windows_native_ansi_support(): ... def message(text, *args, **kw) -> None: ... def output(text, *args, **kw) -> None: ... def readline_strip(expr): ... def readline_wrap(expr): ... def show_pager(formatted_text, encoding=...) -> None: ... -def terminal_supports_colors(stream: Any | None = ...): ... +def terminal_supports_colors(stream: Incomplete | None = ...): ... def usage(usage_text) -> None: ... def warning(text, *args, **kw) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/humanfriendly/humanfriendly/terminal/html.pyi b/packages/pyright-internal/typeshed-fallback/stubs/humanfriendly/humanfriendly/terminal/html.pyi index ad1907b1e..2525fc4ff 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/humanfriendly/humanfriendly/terminal/html.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/humanfriendly/humanfriendly/terminal/html.pyi @@ -1,8 +1,9 @@ +from _typeshed import Incomplete from typing import Any from humanfriendly.compat import HTMLParser -def html_to_ansi(data, callback: Any | None = ...): ... +def html_to_ansi(data, callback: Incomplete | None = ...): ... class HTMLConverter(HTMLParser): BLOCK_TAGS: Any @@ -14,7 +15,7 @@ class HTMLConverter(HTMLParser): def current_style(self): ... stack: Any def close(self) -> None: ... - def emit_style(self, style: Any | None = ...) -> None: ... + def emit_style(self, style: Incomplete | None = ...) -> None: ... def handle_charref(self, value) -> None: ... link_text: Any def handle_data(self, data) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/humanfriendly/humanfriendly/terminal/spinners.pyi b/packages/pyright-internal/typeshed-fallback/stubs/humanfriendly/humanfriendly/terminal/spinners.pyi index d0b7d5ca6..307201e22 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/humanfriendly/humanfriendly/terminal/spinners.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/humanfriendly/humanfriendly/terminal/spinners.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from types import TracebackType from typing import Any @@ -15,7 +16,7 @@ class Spinner: counter: int last_update: int def __init__(self, **options) -> None: ... - def step(self, progress: int = ..., label: Any | None = ...) -> None: ... + def step(self, progress: int = ..., label: Incomplete | None = ...) -> None: ... def sleep(self) -> None: ... def clear(self) -> None: ... def __enter__(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/humanfriendly/humanfriendly/testing.pyi b/packages/pyright-internal/typeshed-fallback/stubs/humanfriendly/humanfriendly/testing.pyi index f3f9fa861..aecfad7ea 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/humanfriendly/humanfriendly/testing.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/humanfriendly/humanfriendly/testing.pyi @@ -1,4 +1,5 @@ import unittest +from _typeshed import Incomplete from types import TracebackType from typing import Any @@ -62,9 +63,9 @@ class MockedProgram(CustomSearchPath): program_returncode: Any program_script: Any program_signal_file: Any - def __init__(self, name, returncode: int = ..., script: Any | None = ...) -> None: ... + def __init__(self, name, returncode: int = ..., script: Incomplete | None = ...) -> None: ... def __enter__(self): ... - def __exit__(self, *args, **kw): ... + def __exit__(self, *args: object, **kw: object): ... class CaptureOutput(ContextManager): stdin: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/humanfriendly/humanfriendly/text.pyi b/packages/pyright-internal/typeshed-fallback/stubs/humanfriendly/humanfriendly/text.pyi index 9c58cff14..98cf0588e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/humanfriendly/humanfriendly/text.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/humanfriendly/humanfriendly/text.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete def compact(text, *args, **kw): ... def compact_empty_lines(text): ... @@ -8,8 +8,8 @@ def format(text, *args, **kw): ... def generate_slug(text, delimiter: str = ...): ... def is_empty_line(text): ... def join_lines(text): ... -def pluralize(count, singular, plural: Any | None = ...): ... -def pluralize_raw(count, singular, plural: Any | None = ...): ... +def pluralize(count, singular, plural: Incomplete | None = ...): ... +def pluralize_raw(count, singular, plural: Incomplete | None = ...): ... def random_string(length=..., characters=...): ... def split(text, delimiter: str = ...): ... def split_paragraphs(text): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ibm-db/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/ibm-db/METADATA.toml new file mode 100644 index 000000000..84307529a --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ibm-db/METADATA.toml @@ -0,0 +1 @@ +version = "3.1.*" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ibm-db/ibm_db.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ibm-db/ibm_db.pyi new file mode 100644 index 000000000..ba3063500 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ibm-db/ibm_db.pyi @@ -0,0 +1,258 @@ +from typing import Any, overload +from typing_extensions import Self, final + +ATTR_CASE: int +CASE_LOWER: int +CASE_NATURAL: int +CASE_UPPER: int +PARAM_FILE: int +QUOTED_LITERAL_REPLACEMENT_OFF: int +QUOTED_LITERAL_REPLACEMENT_ON: int +SQL_API_SQLROWCOUNT: int +SQL_ATTR_AUTOCOMMIT: int +SQL_ATTR_CURRENT_SCHEMA: int +SQL_ATTR_CURSOR_TYPE: int +SQL_ATTR_INFO_ACCTSTR: int +SQL_ATTR_INFO_APPLNAME: int +SQL_ATTR_INFO_PROGRAMNAME: int +SQL_ATTR_INFO_USERID: int +SQL_ATTR_INFO_WRKSTNNAME: int +SQL_ATTR_PARAMSET_SIZE: int +SQL_ATTR_PARAM_BIND_TYPE: int +SQL_ATTR_QUERY_TIMEOUT: int +SQL_ATTR_ROWCOUNT_PREFETCH: int +SQL_ATTR_TRUSTED_CONTEXT_PASSWORD: int +SQL_ATTR_TRUSTED_CONTEXT_USERID: int +SQL_ATTR_USE_TRUSTED_CONTEXT: int +SQL_ATTR_XML_DECLARATION: int +SQL_AUTOCOMMIT_OFF: int +SQL_AUTOCOMMIT_ON: int +SQL_BIGINT: int +SQL_BINARY: int +SQL_BIT: int +SQL_BLOB: int +SQL_BLOB_LOCATOR: int +SQL_BOOLEAN: int +SQL_CHAR: int +SQL_CLOB: int +SQL_CLOB_LOCATOR: int +SQL_CURSOR_DYNAMIC: int +SQL_CURSOR_FORWARD_ONLY: int +SQL_CURSOR_KEYSET_DRIVEN: int +SQL_CURSOR_STATIC: int +SQL_DBCLOB: int +SQL_DBCLOB_LOCATOR: int +SQL_DBMS_NAME: int +SQL_DBMS_VER: int +SQL_DECFLOAT: int +SQL_DECIMAL: int +SQL_DOUBLE: int +SQL_FALSE: int +SQL_FLOAT: int +SQL_GRAPHIC: int +SQL_INDEX_CLUSTERED: int +SQL_INDEX_OTHER: int +SQL_INTEGER: int +SQL_LONGVARBINARY: int +SQL_LONGVARCHAR: int +SQL_LONGVARGRAPHIC: int +SQL_NUMERIC: int +SQL_PARAM_BIND_BY_COLUMN: int +SQL_PARAM_INPUT: int +SQL_PARAM_INPUT_OUTPUT: int +SQL_PARAM_OUTPUT: int +SQL_REAL: int +SQL_ROWCOUNT_PREFETCH_OFF: int +SQL_ROWCOUNT_PREFETCH_ON: int +SQL_SMALLINT: int +SQL_TABLE_STAT: int +SQL_TINYINT: int +SQL_TRUE: int +SQL_TYPE_DATE: int +SQL_TYPE_TIME: int +SQL_TYPE_TIMESTAMP: int +SQL_VARBINARY: int +SQL_VARCHAR: int +SQL_VARGRAPHIC: int +SQL_WCHAR: int +SQL_WLONGVARCHAR: int +SQL_WVARCHAR: int +SQL_XML: int +USE_WCHAR: int +WCHAR_NO: int +WCHAR_YES: int + +@final +class IBM_DBClientInfo: + def __new__(cls, *args: object, **kwargs: object) -> Self: ... + APPL_CODEPAGE: int + CONN_CODEPAGE: int + DATA_SOURCE_NAME: str + DRIVER_NAME: str + DRIVER_ODBC_VER: str + DRIVER_VER: str + ODBC_SQL_CONFORMANCE: str + ODBC_VER: str + +@final +class IBM_DBConnection: + def __new__(cls, *args: object, **kwargs: object) -> Self: ... + +@final +class IBM_DBServerInfo: + def __new__(cls, *args: object, **kwargs: object) -> Self: ... + DBMS_NAME: str + DBMS_VER: str + DB_CODEPAGE: int + DB_NAME: str + DFT_ISOLATION: str + IDENTIFIER_QUOTE_CHAR: str + INST_NAME: str + ISOLATION_OPTION: tuple[str, str, str, str, str] + KEYWORDS: str + LIKE_ESCAPE_CLAUSE: bool + MAX_COL_NAME_LEN: int + MAX_IDENTIFIER_LEN: int + MAX_INDEX_SIZE: int + MAX_PROC_NAME_LEN: int + MAX_ROW_SIZE: int + MAX_SCHEMA_NAME_LEN: int + MAX_STATEMENT_LEN: int + MAX_TABLE_NAME_LEN: int + NON_NULLABLE_COLUMNS: bool + PROCEDURES: bool + SPECIAL_CHARS: str + SQL_CONFORMANCE: str + +@final +class IBM_DBStatement: + def __new__(cls, *args: object, **kwargs: object) -> Self: ... + +def active(__connection: IBM_DBConnection | None) -> bool: ... +def autocommit(__connection: IBM_DBConnection, __value: int = ...) -> int | bool: ... +def bind_param( + __stmt: IBM_DBStatement, + __parameter_number: int, + __variable: str, + __parameter_type: int | None = ..., + __data_type: int | None = ..., + __precision: int | None = ..., + __scale: int | None = ..., + __size: int | None = ..., +) -> bool: ... +@overload +def callproc(__connection: IBM_DBConnection, __procname: str) -> IBM_DBStatement | None: ... +@overload +def callproc(__connection: IBM_DBConnection, __procname: str, __parameters: tuple[object, ...]) -> tuple[object, ...] | None: ... +def check_function_support(__connection: IBM_DBConnection, __function_id: int) -> bool: ... +def client_info(__connection: IBM_DBConnection) -> IBM_DBClientInfo | bool: ... +def close(__connection: IBM_DBConnection) -> bool: ... +def column_privileges( + __connection: IBM_DBConnection, + __qualifier: str | None = ..., + __schema: str | None = ..., + __table_name: str | None = ..., + __column_name: str | None = ..., +) -> IBM_DBStatement: ... +def columns( + __connection: IBM_DBConnection, + __qualifier: str | None = ..., + __schema: str | None = ..., + __table_name: str | None = ..., + __column_name: str | None = ..., +) -> IBM_DBStatement: ... +def commit(__connection: IBM_DBConnection) -> bool: ... +def conn_error(__connection: IBM_DBConnection | None = ...) -> str: ... +def conn_errormsg(__connection: IBM_DBConnection | None = ...) -> str: ... +def conn_warn(__connection: IBM_DBConnection | None = ...) -> str: ... +def connect( + __database: str, + __user: str, + __password: str, + __options: dict[int, int | str] | None = ..., + __replace_quoted_literal: int = ..., +) -> IBM_DBConnection | None: ... +def createdb(__connection: IBM_DBConnection, __dbName: str, __codeSet: str = ..., __mode: str = ...) -> bool: ... +def createdbNX(__connection: IBM_DBConnection, __dbName: str, __codeSet: str = ..., __mode: str = ...) -> bool: ... +def cursor_type(__stmt: IBM_DBStatement) -> int: ... +def dropdb(__connection: IBM_DBConnection, __dbName: str) -> bool: ... +def exec_immediate( + __connection: IBM_DBConnection, __statement: str | None, __options: dict[int, int] = ... +) -> IBM_DBStatement | bool: ... +def execute(__stmt: IBM_DBStatement, __parameters: tuple[object, ...] | None = ...) -> bool: ... +def execute_many( + __stmt: IBM_DBStatement, __seq_of_parameters: tuple[object, ...], __options: dict[int, int] = ... +) -> int | None: ... +def fetch_assoc(__stmt: IBM_DBStatement, __row_number: int = ...) -> dict[str, object] | bool: ... +def fetch_both(__stmt: IBM_DBStatement, __row_number: int = ...) -> dict[int | str, object] | bool: ... +def fetch_row(__stmt: IBM_DBStatement, __row_number: int = ...) -> bool: ... +def fetch_tuple(__stmt: IBM_DBStatement, __row_number: int = ...) -> tuple[object, ...]: ... +def field_display_size(__stmt: IBM_DBStatement, __column: int | str) -> int | bool: ... +def field_name(__stmt: IBM_DBStatement, __column: int | str) -> str | bool: ... +def field_nullable(__stmt: IBM_DBStatement, __column: int | str) -> bool: ... +def field_num(__stmt: IBM_DBStatement, __column: int | str) -> int | bool: ... +def field_precision(__stmt: IBM_DBStatement, __column: int | str) -> int | bool: ... +def field_scale(__stmt: IBM_DBStatement, __column: int | str) -> int | bool: ... +def field_type(__stmt: IBM_DBStatement, __column: int | str) -> str | bool: ... +def field_width(__stmt: IBM_DBStatement, __column: int | str) -> int | bool: ... +def foreign_keys( + __connection: IBM_DBConnection, + __pk_qualifier: str | None, + __pk_schema: str | None, + __pk_table_name: str | None, + __fk_qualifier: str | None = ..., + __fk_schema: str | None = ..., + __fk_table_name: str | None = ..., +) -> IBM_DBStatement: ... +def free_result(__stmt: IBM_DBStatement) -> bool: ... +def free_stmt(__stmt: IBM_DBStatement) -> bool: ... +def get_db_info(__connection: IBM_DBConnection, __option: int) -> str | bool: ... +def get_last_serial_value(__stmt: IBM_DBStatement) -> str | bool: ... +def get_num_result(__stmt: IBM_DBStatement) -> int | bool: ... +def get_option(__resc: IBM_DBConnection | IBM_DBStatement, __options: int, __type: int) -> Any: ... +def next_result(__stmt: IBM_DBStatement) -> IBM_DBStatement | bool: ... +def num_fields(__stmt: IBM_DBStatement) -> int | bool: ... +def num_rows(__stmt: IBM_DBStatement) -> int: ... +def pconnect( + __database: str, __username: str, __password: str, __options: dict[int, int | str] | None = ... +) -> IBM_DBConnection | None: ... +def prepare( + __connection: IBM_DBConnection, __statement: str, __options: dict[int, int | str] | None = ... +) -> IBM_DBStatement | bool: ... +def primary_keys( + __connection: IBM_DBConnection, __qualifier: str | None, __schema: str | None, __table_name: str | None +) -> IBM_DBStatement: ... +def procedure_columns( + __connection: IBM_DBConnection, + __qualifier: str | None, + __schema: str | None, + __procedure: str | None, + __parameter: str | None, +) -> IBM_DBStatement | bool: ... +def procedures( + __connection: IBM_DBConnection, __qualifier: str | None, __schema: str | None, __procedure: str | None +) -> IBM_DBStatement | bool: ... +def recreatedb(__connection: IBM_DBConnection, __dbName: str, __codeSet: str | None = ..., __mode: str | None = ...) -> bool: ... +def result(__stmt: IBM_DBStatement, __column: int | str) -> Any: ... +def rollback(__connection: IBM_DBConnection) -> bool: ... +def server_info(__connection: IBM_DBConnection) -> IBM_DBServerInfo | bool: ... +def set_option(__resc: IBM_DBConnection | IBM_DBStatement, __options: dict[int, int | str], __type: int) -> bool: ... +def special_columns( + __connection: IBM_DBConnection, __qualifier: str | None, __schema: str | None, __table_name: str | None, __scope: int +) -> IBM_DBStatement: ... +def statistics( + __connection: IBM_DBConnection, __qualifier: str | None, __schema: str | None, __table_name: str | None, __unique: bool | None +) -> IBM_DBStatement: ... +def stmt_error(__stmt: IBM_DBStatement = ...) -> str: ... +def stmt_errormsg(__stmt: IBM_DBStatement = ...) -> str: ... +def stmt_warn(__connection: IBM_DBConnection = ...) -> IBM_DBStatement: ... +def table_privileges( + __connection: IBM_DBConnection, __qualifier: str | None = ..., __schema: str | None = ..., __table_name: str | None = ... +) -> IBM_DBStatement | bool: ... +def tables( + __connection: IBM_DBConnection, + __qualifier: str | None = ..., + __schema: str | None = ..., + __table_name: str | None = ..., + __table_type: str | None = ..., +) -> IBM_DBStatement | bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/METADATA.toml new file mode 100644 index 000000000..bf082ace4 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/METADATA.toml @@ -0,0 +1,6 @@ +version = "1.36.*" +requires = ["types-urllib3"] + +[tool.stubtest] +extras = ["extra"] +stubtest_requirements = ["aiohttp"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/__init__.pyi new file mode 100644 index 000000000..b3757b581 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/__init__.pyi @@ -0,0 +1,427 @@ +from influxdb_client.client.authorizations_api import AuthorizationsApi as AuthorizationsApi +from influxdb_client.client.bucket_api import BucketsApi as BucketsApi +from influxdb_client.client.delete_api import DeleteApi as DeleteApi +from influxdb_client.client.influxdb_client import InfluxDBClient as InfluxDBClient +from influxdb_client.client.invokable_scripts_api import InvokableScriptsApi as InvokableScriptsApi +from influxdb_client.client.labels_api import LabelsApi as LabelsApi +from influxdb_client.client.logging_handler import InfluxLoggingHandler as InfluxLoggingHandler +from influxdb_client.client.organizations_api import OrganizationsApi as OrganizationsApi +from influxdb_client.client.query_api import QueryApi as QueryApi +from influxdb_client.client.tasks_api import TasksApi as TasksApi +from influxdb_client.client.users_api import UsersApi as UsersApi +from influxdb_client.client.write.point import Point as Point +from influxdb_client.client.write_api import WriteApi as WriteApi, WriteOptions as WriteOptions +from influxdb_client.configuration import Configuration as Configuration +from influxdb_client.domain.add_resource_member_request_body import AddResourceMemberRequestBody as AddResourceMemberRequestBody +from influxdb_client.domain.analyze_query_response import AnalyzeQueryResponse as AnalyzeQueryResponse +from influxdb_client.domain.analyze_query_response_errors import AnalyzeQueryResponseErrors as AnalyzeQueryResponseErrors +from influxdb_client.domain.array_expression import ArrayExpression as ArrayExpression +from influxdb_client.domain.ast_response import ASTResponse as ASTResponse +from influxdb_client.domain.authorization import Authorization as Authorization +from influxdb_client.domain.authorization_post_request import AuthorizationPostRequest as AuthorizationPostRequest +from influxdb_client.domain.authorization_update_request import AuthorizationUpdateRequest as AuthorizationUpdateRequest +from influxdb_client.domain.authorizations import Authorizations as Authorizations +from influxdb_client.domain.axes import Axes as Axes +from influxdb_client.domain.axis import Axis as Axis +from influxdb_client.domain.axis_scale import AxisScale as AxisScale +from influxdb_client.domain.bad_statement import BadStatement as BadStatement +from influxdb_client.domain.band_view_properties import BandViewProperties as BandViewProperties +from influxdb_client.domain.binary_expression import BinaryExpression as BinaryExpression +from influxdb_client.domain.block import Block as Block +from influxdb_client.domain.boolean_literal import BooleanLiteral as BooleanLiteral +from influxdb_client.domain.bucket import Bucket as Bucket +from influxdb_client.domain.bucket_links import BucketLinks as BucketLinks +from influxdb_client.domain.bucket_metadata_manifest import BucketMetadataManifest as BucketMetadataManifest +from influxdb_client.domain.bucket_retention_rules import BucketRetentionRules as BucketRetentionRules +from influxdb_client.domain.bucket_shard_mapping import BucketShardMapping as BucketShardMapping +from influxdb_client.domain.buckets import Buckets as Buckets +from influxdb_client.domain.builder_aggregate_function_type import BuilderAggregateFunctionType as BuilderAggregateFunctionType +from influxdb_client.domain.builder_config import BuilderConfig as BuilderConfig +from influxdb_client.domain.builder_config_aggregate_window import BuilderConfigAggregateWindow as BuilderConfigAggregateWindow +from influxdb_client.domain.builder_functions_type import BuilderFunctionsType as BuilderFunctionsType +from influxdb_client.domain.builder_tags_type import BuilderTagsType as BuilderTagsType +from influxdb_client.domain.builtin_statement import BuiltinStatement as BuiltinStatement +from influxdb_client.domain.call_expression import CallExpression as CallExpression +from influxdb_client.domain.cell import Cell as Cell +from influxdb_client.domain.cell_links import CellLinks as CellLinks +from influxdb_client.domain.cell_update import CellUpdate as CellUpdate +from influxdb_client.domain.cell_with_view_properties import CellWithViewProperties as CellWithViewProperties +from influxdb_client.domain.check import Check as Check +from influxdb_client.domain.check_base import CheckBase as CheckBase +from influxdb_client.domain.check_base_links import CheckBaseLinks as CheckBaseLinks +from influxdb_client.domain.check_discriminator import CheckDiscriminator as CheckDiscriminator +from influxdb_client.domain.check_patch import CheckPatch as CheckPatch +from influxdb_client.domain.check_status_level import CheckStatusLevel as CheckStatusLevel +from influxdb_client.domain.check_view_properties import CheckViewProperties as CheckViewProperties +from influxdb_client.domain.checks import Checks as Checks +from influxdb_client.domain.column_data_type import ColumnDataType as ColumnDataType +from influxdb_client.domain.column_semantic_type import ColumnSemanticType as ColumnSemanticType +from influxdb_client.domain.conditional_expression import ConditionalExpression as ConditionalExpression +from influxdb_client.domain.config import Config as Config +from influxdb_client.domain.constant_variable_properties import ConstantVariableProperties as ConstantVariableProperties +from influxdb_client.domain.create_cell import CreateCell as CreateCell +from influxdb_client.domain.create_dashboard_request import CreateDashboardRequest as CreateDashboardRequest +from influxdb_client.domain.custom_check import CustomCheck as CustomCheck +from influxdb_client.domain.dashboard import Dashboard as Dashboard +from influxdb_client.domain.dashboard_color import DashboardColor as DashboardColor +from influxdb_client.domain.dashboard_query import DashboardQuery as DashboardQuery +from influxdb_client.domain.dashboard_with_view_properties import DashboardWithViewProperties as DashboardWithViewProperties +from influxdb_client.domain.dashboards import Dashboards as Dashboards +from influxdb_client.domain.date_time_literal import DateTimeLiteral as DateTimeLiteral +from influxdb_client.domain.dbr_ps import DBRPs as DBRPs +from influxdb_client.domain.dbrp import DBRP as DBRP +from influxdb_client.domain.dbrp_create import DBRPCreate as DBRPCreate +from influxdb_client.domain.dbrp_get import DBRPGet as DBRPGet +from influxdb_client.domain.dbrp_update import DBRPUpdate as DBRPUpdate +from influxdb_client.domain.deadman_check import DeadmanCheck as DeadmanCheck +from influxdb_client.domain.decimal_places import DecimalPlaces as DecimalPlaces +from influxdb_client.domain.delete_predicate_request import DeletePredicateRequest as DeletePredicateRequest +from influxdb_client.domain.dialect import Dialect as Dialect +from influxdb_client.domain.dict_expression import DictExpression as DictExpression +from influxdb_client.domain.dict_item import DictItem as DictItem +from influxdb_client.domain.duration import Duration as Duration +from influxdb_client.domain.duration_literal import DurationLiteral as DurationLiteral +from influxdb_client.domain.error import Error as Error +from influxdb_client.domain.expression import Expression as Expression +from influxdb_client.domain.expression_statement import ExpressionStatement as ExpressionStatement +from influxdb_client.domain.field import Field as Field +from influxdb_client.domain.file import File as File +from influxdb_client.domain.float_literal import FloatLiteral as FloatLiteral +from influxdb_client.domain.flux_response import FluxResponse as FluxResponse +from influxdb_client.domain.flux_suggestion import FluxSuggestion as FluxSuggestion +from influxdb_client.domain.flux_suggestions import FluxSuggestions as FluxSuggestions +from influxdb_client.domain.function_expression import FunctionExpression as FunctionExpression +from influxdb_client.domain.gauge_view_properties import GaugeViewProperties as GaugeViewProperties +from influxdb_client.domain.greater_threshold import GreaterThreshold as GreaterThreshold +from influxdb_client.domain.health_check import HealthCheck as HealthCheck +from influxdb_client.domain.heatmap_view_properties import HeatmapViewProperties as HeatmapViewProperties +from influxdb_client.domain.histogram_view_properties import HistogramViewProperties as HistogramViewProperties +from influxdb_client.domain.http_notification_endpoint import HTTPNotificationEndpoint as HTTPNotificationEndpoint +from influxdb_client.domain.http_notification_rule import HTTPNotificationRule as HTTPNotificationRule +from influxdb_client.domain.http_notification_rule_base import HTTPNotificationRuleBase as HTTPNotificationRuleBase +from influxdb_client.domain.identifier import Identifier as Identifier +from influxdb_client.domain.import_declaration import ImportDeclaration as ImportDeclaration +from influxdb_client.domain.index_expression import IndexExpression as IndexExpression +from influxdb_client.domain.integer_literal import IntegerLiteral as IntegerLiteral +from influxdb_client.domain.is_onboarding import IsOnboarding as IsOnboarding +from influxdb_client.domain.label import Label as Label +from influxdb_client.domain.label_create_request import LabelCreateRequest as LabelCreateRequest +from influxdb_client.domain.label_mapping import LabelMapping as LabelMapping +from influxdb_client.domain.label_response import LabelResponse as LabelResponse +from influxdb_client.domain.label_update import LabelUpdate as LabelUpdate +from influxdb_client.domain.labels_response import LabelsResponse as LabelsResponse +from influxdb_client.domain.language_request import LanguageRequest as LanguageRequest +from influxdb_client.domain.legacy_authorization_post_request import ( + LegacyAuthorizationPostRequest as LegacyAuthorizationPostRequest, +) +from influxdb_client.domain.lesser_threshold import LesserThreshold as LesserThreshold +from influxdb_client.domain.line_plus_single_stat_properties import LinePlusSingleStatProperties as LinePlusSingleStatProperties +from influxdb_client.domain.line_protocol_error import LineProtocolError as LineProtocolError +from influxdb_client.domain.line_protocol_length_error import LineProtocolLengthError as LineProtocolLengthError +from influxdb_client.domain.links import Links as Links +from influxdb_client.domain.list_stacks_response import ListStacksResponse as ListStacksResponse +from influxdb_client.domain.log_event import LogEvent as LogEvent +from influxdb_client.domain.logical_expression import LogicalExpression as LogicalExpression +from influxdb_client.domain.logs import Logs as Logs +from influxdb_client.domain.map_variable_properties import MapVariableProperties as MapVariableProperties +from influxdb_client.domain.markdown_view_properties import MarkdownViewProperties as MarkdownViewProperties +from influxdb_client.domain.measurement_schema import MeasurementSchema as MeasurementSchema +from influxdb_client.domain.measurement_schema_column import MeasurementSchemaColumn as MeasurementSchemaColumn +from influxdb_client.domain.measurement_schema_create_request import ( + MeasurementSchemaCreateRequest as MeasurementSchemaCreateRequest, +) +from influxdb_client.domain.measurement_schema_list import MeasurementSchemaList as MeasurementSchemaList +from influxdb_client.domain.measurement_schema_update_request import ( + MeasurementSchemaUpdateRequest as MeasurementSchemaUpdateRequest, +) +from influxdb_client.domain.member_assignment import MemberAssignment as MemberAssignment +from influxdb_client.domain.member_expression import MemberExpression as MemberExpression +from influxdb_client.domain.metadata_backup import MetadataBackup as MetadataBackup +from influxdb_client.domain.model_property import ModelProperty as ModelProperty +from influxdb_client.domain.mosaic_view_properties import MosaicViewProperties as MosaicViewProperties +from influxdb_client.domain.node import Node as Node +from influxdb_client.domain.notification_endpoint import NotificationEndpoint as NotificationEndpoint +from influxdb_client.domain.notification_endpoint_base import NotificationEndpointBase as NotificationEndpointBase +from influxdb_client.domain.notification_endpoint_base_links import NotificationEndpointBaseLinks as NotificationEndpointBaseLinks +from influxdb_client.domain.notification_endpoint_discriminator import ( + NotificationEndpointDiscriminator as NotificationEndpointDiscriminator, +) +from influxdb_client.domain.notification_endpoint_type import NotificationEndpointType as NotificationEndpointType +from influxdb_client.domain.notification_endpoint_update import NotificationEndpointUpdate as NotificationEndpointUpdate +from influxdb_client.domain.notification_endpoints import NotificationEndpoints as NotificationEndpoints +from influxdb_client.domain.notification_rule import NotificationRule as NotificationRule +from influxdb_client.domain.notification_rule_base import NotificationRuleBase as NotificationRuleBase +from influxdb_client.domain.notification_rule_base_links import NotificationRuleBaseLinks as NotificationRuleBaseLinks +from influxdb_client.domain.notification_rule_discriminator import NotificationRuleDiscriminator as NotificationRuleDiscriminator +from influxdb_client.domain.notification_rule_update import NotificationRuleUpdate as NotificationRuleUpdate +from influxdb_client.domain.notification_rules import NotificationRules as NotificationRules +from influxdb_client.domain.object_expression import ObjectExpression as ObjectExpression +from influxdb_client.domain.onboarding_request import OnboardingRequest as OnboardingRequest +from influxdb_client.domain.onboarding_response import OnboardingResponse as OnboardingResponse +from influxdb_client.domain.option_statement import OptionStatement as OptionStatement +from influxdb_client.domain.organization import Organization as Organization +from influxdb_client.domain.organization_links import OrganizationLinks as OrganizationLinks +from influxdb_client.domain.organizations import Organizations as Organizations +from influxdb_client.domain.package import Package as Package +from influxdb_client.domain.package_clause import PackageClause as PackageClause +from influxdb_client.domain.pager_duty_notification_endpoint import PagerDutyNotificationEndpoint as PagerDutyNotificationEndpoint +from influxdb_client.domain.pager_duty_notification_rule import PagerDutyNotificationRule as PagerDutyNotificationRule +from influxdb_client.domain.pager_duty_notification_rule_base import ( + PagerDutyNotificationRuleBase as PagerDutyNotificationRuleBase, +) +from influxdb_client.domain.paren_expression import ParenExpression as ParenExpression +from influxdb_client.domain.password_reset_body import PasswordResetBody as PasswordResetBody +from influxdb_client.domain.patch_bucket_request import PatchBucketRequest as PatchBucketRequest +from influxdb_client.domain.patch_dashboard_request import PatchDashboardRequest as PatchDashboardRequest +from influxdb_client.domain.patch_organization_request import PatchOrganizationRequest as PatchOrganizationRequest +from influxdb_client.domain.patch_retention_rule import PatchRetentionRule as PatchRetentionRule +from influxdb_client.domain.patch_stack_request import PatchStackRequest as PatchStackRequest +from influxdb_client.domain.patch_stack_request_additional_resources import ( + PatchStackRequestAdditionalResources as PatchStackRequestAdditionalResources, +) +from influxdb_client.domain.permission import Permission as Permission +from influxdb_client.domain.permission_resource import PermissionResource as PermissionResource +from influxdb_client.domain.pipe_expression import PipeExpression as PipeExpression +from influxdb_client.domain.pipe_literal import PipeLiteral as PipeLiteral +from influxdb_client.domain.post_bucket_request import PostBucketRequest as PostBucketRequest +from influxdb_client.domain.post_check import PostCheck as PostCheck +from influxdb_client.domain.post_notification_endpoint import PostNotificationEndpoint as PostNotificationEndpoint +from influxdb_client.domain.post_notification_rule import PostNotificationRule as PostNotificationRule +from influxdb_client.domain.post_organization_request import PostOrganizationRequest as PostOrganizationRequest +from influxdb_client.domain.post_restore_kv_response import PostRestoreKVResponse as PostRestoreKVResponse +from influxdb_client.domain.post_stack_request import PostStackRequest as PostStackRequest +from influxdb_client.domain.property_key import PropertyKey as PropertyKey +from influxdb_client.domain.query import Query as Query +from influxdb_client.domain.query_edit_mode import QueryEditMode as QueryEditMode +from influxdb_client.domain.query_variable_properties import QueryVariableProperties as QueryVariableProperties +from influxdb_client.domain.query_variable_properties_values import QueryVariablePropertiesValues as QueryVariablePropertiesValues +from influxdb_client.domain.range_threshold import RangeThreshold as RangeThreshold +from influxdb_client.domain.ready import Ready as Ready +from influxdb_client.domain.regexp_literal import RegexpLiteral as RegexpLiteral +from influxdb_client.domain.remote_connection import RemoteConnection as RemoteConnection +from influxdb_client.domain.remote_connection_creation_request import ( + RemoteConnectionCreationRequest as RemoteConnectionCreationRequest, +) +from influxdb_client.domain.remote_connection_update_request import RemoteConnectionUpdateRequest as RemoteConnectionUpdateRequest +from influxdb_client.domain.remote_connections import RemoteConnections as RemoteConnections +from influxdb_client.domain.renamable_field import RenamableField as RenamableField +from influxdb_client.domain.replication import Replication as Replication +from influxdb_client.domain.replication_creation_request import ReplicationCreationRequest as ReplicationCreationRequest +from influxdb_client.domain.replication_update_request import ReplicationUpdateRequest as ReplicationUpdateRequest +from influxdb_client.domain.replications import Replications as Replications +from influxdb_client.domain.resource_member import ResourceMember as ResourceMember +from influxdb_client.domain.resource_members import ResourceMembers as ResourceMembers +from influxdb_client.domain.resource_members_links import ResourceMembersLinks as ResourceMembersLinks +from influxdb_client.domain.resource_owner import ResourceOwner as ResourceOwner +from influxdb_client.domain.resource_owners import ResourceOwners as ResourceOwners +from influxdb_client.domain.restored_bucket_mappings import RestoredBucketMappings as RestoredBucketMappings +from influxdb_client.domain.retention_policy_manifest import RetentionPolicyManifest as RetentionPolicyManifest +from influxdb_client.domain.return_statement import ReturnStatement as ReturnStatement +from influxdb_client.domain.routes import Routes as Routes +from influxdb_client.domain.routes_external import RoutesExternal as RoutesExternal +from influxdb_client.domain.routes_query import RoutesQuery as RoutesQuery +from influxdb_client.domain.routes_system import RoutesSystem as RoutesSystem +from influxdb_client.domain.rule_status_level import RuleStatusLevel as RuleStatusLevel +from influxdb_client.domain.run import Run as Run +from influxdb_client.domain.run_links import RunLinks as RunLinks +from influxdb_client.domain.run_manually import RunManually as RunManually +from influxdb_client.domain.runs import Runs as Runs +from influxdb_client.domain.scatter_view_properties import ScatterViewProperties as ScatterViewProperties +from influxdb_client.domain.schema_type import SchemaType as SchemaType +from influxdb_client.domain.scraper_target_request import ScraperTargetRequest as ScraperTargetRequest +from influxdb_client.domain.scraper_target_response import ScraperTargetResponse as ScraperTargetResponse +from influxdb_client.domain.scraper_target_responses import ScraperTargetResponses as ScraperTargetResponses +from influxdb_client.domain.script import Script as Script +from influxdb_client.domain.script_create_request import ScriptCreateRequest as ScriptCreateRequest +from influxdb_client.domain.script_invocation_params import ScriptInvocationParams as ScriptInvocationParams +from influxdb_client.domain.script_language import ScriptLanguage as ScriptLanguage +from influxdb_client.domain.script_update_request import ScriptUpdateRequest as ScriptUpdateRequest +from influxdb_client.domain.scripts import Scripts as Scripts +from influxdb_client.domain.secret_keys import SecretKeys as SecretKeys +from influxdb_client.domain.secret_keys_response import SecretKeysResponse as SecretKeysResponse +from influxdb_client.domain.shard_group_manifest import ShardGroupManifest as ShardGroupManifest +from influxdb_client.domain.shard_manifest import ShardManifest as ShardManifest +from influxdb_client.domain.shard_owner import ShardOwner as ShardOwner +from influxdb_client.domain.simple_table_view_properties import SimpleTableViewProperties as SimpleTableViewProperties +from influxdb_client.domain.single_stat_view_properties import SingleStatViewProperties as SingleStatViewProperties +from influxdb_client.domain.slack_notification_endpoint import SlackNotificationEndpoint as SlackNotificationEndpoint +from influxdb_client.domain.slack_notification_rule import SlackNotificationRule as SlackNotificationRule +from influxdb_client.domain.slack_notification_rule_base import SlackNotificationRuleBase as SlackNotificationRuleBase +from influxdb_client.domain.smtp_notification_rule import SMTPNotificationRule as SMTPNotificationRule +from influxdb_client.domain.smtp_notification_rule_base import SMTPNotificationRuleBase as SMTPNotificationRuleBase +from influxdb_client.domain.source import Source as Source +from influxdb_client.domain.source_links import SourceLinks as SourceLinks +from influxdb_client.domain.sources import Sources as Sources +from influxdb_client.domain.stack import Stack as Stack +from influxdb_client.domain.stack_associations import StackAssociations as StackAssociations +from influxdb_client.domain.stack_events import StackEvents as StackEvents +from influxdb_client.domain.stack_links import StackLinks as StackLinks +from influxdb_client.domain.stack_resources import StackResources as StackResources +from influxdb_client.domain.statement import Statement as Statement +from influxdb_client.domain.static_legend import StaticLegend as StaticLegend +from influxdb_client.domain.status_rule import StatusRule as StatusRule +from influxdb_client.domain.string_literal import StringLiteral as StringLiteral +from influxdb_client.domain.subscription_manifest import SubscriptionManifest as SubscriptionManifest +from influxdb_client.domain.table_view_properties import TableViewProperties as TableViewProperties +from influxdb_client.domain.table_view_properties_table_options import ( + TableViewPropertiesTableOptions as TableViewPropertiesTableOptions, +) +from influxdb_client.domain.tag_rule import TagRule as TagRule +from influxdb_client.domain.task import Task as Task +from influxdb_client.domain.task_create_request import TaskCreateRequest as TaskCreateRequest +from influxdb_client.domain.task_links import TaskLinks as TaskLinks +from influxdb_client.domain.task_status_type import TaskStatusType as TaskStatusType +from influxdb_client.domain.task_update_request import TaskUpdateRequest as TaskUpdateRequest +from influxdb_client.domain.tasks import Tasks as Tasks +from influxdb_client.domain.telegraf import Telegraf as Telegraf +from influxdb_client.domain.telegraf_plugin import TelegrafPlugin as TelegrafPlugin +from influxdb_client.domain.telegraf_plugin_request import TelegrafPluginRequest as TelegrafPluginRequest +from influxdb_client.domain.telegraf_plugin_request_plugins import TelegrafPluginRequestPlugins as TelegrafPluginRequestPlugins +from influxdb_client.domain.telegraf_plugins import TelegrafPlugins as TelegrafPlugins +from influxdb_client.domain.telegraf_request import TelegrafRequest as TelegrafRequest +from influxdb_client.domain.telegraf_request_metadata import TelegrafRequestMetadata as TelegrafRequestMetadata +from influxdb_client.domain.telegrafs import Telegrafs as Telegrafs +from influxdb_client.domain.telegram_notification_endpoint import TelegramNotificationEndpoint as TelegramNotificationEndpoint +from influxdb_client.domain.telegram_notification_rule import TelegramNotificationRule as TelegramNotificationRule +from influxdb_client.domain.telegram_notification_rule_base import TelegramNotificationRuleBase as TelegramNotificationRuleBase +from influxdb_client.domain.template_apply import TemplateApply as TemplateApply +from influxdb_client.domain.template_apply_remotes import TemplateApplyRemotes as TemplateApplyRemotes +from influxdb_client.domain.template_apply_template import TemplateApplyTemplate as TemplateApplyTemplate +from influxdb_client.domain.template_chart import TemplateChart as TemplateChart +from influxdb_client.domain.template_export_by_id import TemplateExportByID as TemplateExportByID +from influxdb_client.domain.template_export_by_id_org_ids import TemplateExportByIDOrgIDs as TemplateExportByIDOrgIDs +from influxdb_client.domain.template_export_by_id_resource_filters import ( + TemplateExportByIDResourceFilters as TemplateExportByIDResourceFilters, +) +from influxdb_client.domain.template_export_by_id_resources import TemplateExportByIDResources as TemplateExportByIDResources +from influxdb_client.domain.template_kind import TemplateKind as TemplateKind +from influxdb_client.domain.template_summary import TemplateSummary as TemplateSummary +from influxdb_client.domain.template_summary_diff import TemplateSummaryDiff as TemplateSummaryDiff +from influxdb_client.domain.template_summary_diff_buckets import TemplateSummaryDiffBuckets as TemplateSummaryDiffBuckets +from influxdb_client.domain.template_summary_diff_buckets_new_old import ( + TemplateSummaryDiffBucketsNewOld as TemplateSummaryDiffBucketsNewOld, +) +from influxdb_client.domain.template_summary_diff_checks import TemplateSummaryDiffChecks as TemplateSummaryDiffChecks +from influxdb_client.domain.template_summary_diff_dashboards import TemplateSummaryDiffDashboards as TemplateSummaryDiffDashboards +from influxdb_client.domain.template_summary_diff_dashboards_new_old import ( + TemplateSummaryDiffDashboardsNewOld as TemplateSummaryDiffDashboardsNewOld, +) +from influxdb_client.domain.template_summary_diff_label_mappings import ( + TemplateSummaryDiffLabelMappings as TemplateSummaryDiffLabelMappings, +) +from influxdb_client.domain.template_summary_diff_labels import TemplateSummaryDiffLabels as TemplateSummaryDiffLabels +from influxdb_client.domain.template_summary_diff_labels_new_old import ( + TemplateSummaryDiffLabelsNewOld as TemplateSummaryDiffLabelsNewOld, +) +from influxdb_client.domain.template_summary_diff_notification_endpoints import ( + TemplateSummaryDiffNotificationEndpoints as TemplateSummaryDiffNotificationEndpoints, +) +from influxdb_client.domain.template_summary_diff_notification_rules import ( + TemplateSummaryDiffNotificationRules as TemplateSummaryDiffNotificationRules, +) +from influxdb_client.domain.template_summary_diff_notification_rules_new_old import ( + TemplateSummaryDiffNotificationRulesNewOld as TemplateSummaryDiffNotificationRulesNewOld, +) +from influxdb_client.domain.template_summary_diff_tasks import TemplateSummaryDiffTasks as TemplateSummaryDiffTasks +from influxdb_client.domain.template_summary_diff_tasks_new_old import ( + TemplateSummaryDiffTasksNewOld as TemplateSummaryDiffTasksNewOld, +) +from influxdb_client.domain.template_summary_diff_telegraf_configs import ( + TemplateSummaryDiffTelegrafConfigs as TemplateSummaryDiffTelegrafConfigs, +) +from influxdb_client.domain.template_summary_diff_variables import TemplateSummaryDiffVariables as TemplateSummaryDiffVariables +from influxdb_client.domain.template_summary_diff_variables_new_old import ( + TemplateSummaryDiffVariablesNewOld as TemplateSummaryDiffVariablesNewOld, +) +from influxdb_client.domain.template_summary_errors import TemplateSummaryErrors as TemplateSummaryErrors +from influxdb_client.domain.template_summary_label import TemplateSummaryLabel as TemplateSummaryLabel +from influxdb_client.domain.template_summary_label_properties import ( + TemplateSummaryLabelProperties as TemplateSummaryLabelProperties, +) +from influxdb_client.domain.template_summary_summary import TemplateSummarySummary as TemplateSummarySummary +from influxdb_client.domain.template_summary_summary_buckets import TemplateSummarySummaryBuckets as TemplateSummarySummaryBuckets +from influxdb_client.domain.template_summary_summary_dashboards import ( + TemplateSummarySummaryDashboards as TemplateSummarySummaryDashboards, +) +from influxdb_client.domain.template_summary_summary_label_mappings import ( + TemplateSummarySummaryLabelMappings as TemplateSummarySummaryLabelMappings, +) +from influxdb_client.domain.template_summary_summary_notification_rules import ( + TemplateSummarySummaryNotificationRules as TemplateSummarySummaryNotificationRules, +) +from influxdb_client.domain.template_summary_summary_status_rules import ( + TemplateSummarySummaryStatusRules as TemplateSummarySummaryStatusRules, +) +from influxdb_client.domain.template_summary_summary_tag_rules import ( + TemplateSummarySummaryTagRules as TemplateSummarySummaryTagRules, +) +from influxdb_client.domain.template_summary_summary_tasks import TemplateSummarySummaryTasks as TemplateSummarySummaryTasks +from influxdb_client.domain.template_summary_summary_variables import ( + TemplateSummarySummaryVariables as TemplateSummarySummaryVariables, +) +from influxdb_client.domain.test_statement import TestStatement as TestStatement +from influxdb_client.domain.threshold import Threshold as Threshold +from influxdb_client.domain.threshold_base import ThresholdBase as ThresholdBase +from influxdb_client.domain.threshold_check import ThresholdCheck as ThresholdCheck +from influxdb_client.domain.unary_expression import UnaryExpression as UnaryExpression +from influxdb_client.domain.unsigned_integer_literal import UnsignedIntegerLiteral as UnsignedIntegerLiteral +from influxdb_client.domain.user import User as User +from influxdb_client.domain.user_response import UserResponse as UserResponse +from influxdb_client.domain.user_response_links import UserResponseLinks as UserResponseLinks +from influxdb_client.domain.users import Users as Users +from influxdb_client.domain.variable import Variable as Variable +from influxdb_client.domain.variable_assignment import VariableAssignment as VariableAssignment +from influxdb_client.domain.variable_links import VariableLinks as VariableLinks +from influxdb_client.domain.variable_properties import VariableProperties as VariableProperties +from influxdb_client.domain.variables import Variables as Variables +from influxdb_client.domain.view import View as View +from influxdb_client.domain.view_links import ViewLinks as ViewLinks +from influxdb_client.domain.view_properties import ViewProperties as ViewProperties +from influxdb_client.domain.views import Views as Views +from influxdb_client.domain.write_precision import WritePrecision as WritePrecision +from influxdb_client.domain.xy_geom import XYGeom as XYGeom +from influxdb_client.domain.xy_view_properties import XYViewProperties as XYViewProperties +from influxdb_client.service.authorizations_service import AuthorizationsService as AuthorizationsService +from influxdb_client.service.backup_service import BackupService as BackupService +from influxdb_client.service.bucket_schemas_service import BucketSchemasService as BucketSchemasService +from influxdb_client.service.buckets_service import BucketsService as BucketsService +from influxdb_client.service.cells_service import CellsService as CellsService +from influxdb_client.service.checks_service import ChecksService as ChecksService +from influxdb_client.service.config_service import ConfigService as ConfigService +from influxdb_client.service.dashboards_service import DashboardsService as DashboardsService +from influxdb_client.service.dbr_ps_service import DBRPsService as DBRPsService +from influxdb_client.service.delete_service import DeleteService as DeleteService +from influxdb_client.service.health_service import HealthService as HealthService +from influxdb_client.service.invokable_scripts_service import InvokableScriptsService as InvokableScriptsService +from influxdb_client.service.labels_service import LabelsService as LabelsService +from influxdb_client.service.legacy_authorizations_service import LegacyAuthorizationsService as LegacyAuthorizationsService +from influxdb_client.service.metrics_service import MetricsService as MetricsService +from influxdb_client.service.notification_endpoints_service import NotificationEndpointsService as NotificationEndpointsService +from influxdb_client.service.notification_rules_service import NotificationRulesService as NotificationRulesService +from influxdb_client.service.organizations_service import OrganizationsService as OrganizationsService +from influxdb_client.service.ping_service import PingService as PingService +from influxdb_client.service.query_service import QueryService as QueryService +from influxdb_client.service.ready_service import ReadyService as ReadyService +from influxdb_client.service.remote_connections_service import RemoteConnectionsService as RemoteConnectionsService +from influxdb_client.service.replications_service import ReplicationsService as ReplicationsService +from influxdb_client.service.resources_service import ResourcesService as ResourcesService +from influxdb_client.service.restore_service import RestoreService as RestoreService +from influxdb_client.service.routes_service import RoutesService as RoutesService +from influxdb_client.service.rules_service import RulesService as RulesService +from influxdb_client.service.scraper_targets_service import ScraperTargetsService as ScraperTargetsService +from influxdb_client.service.secrets_service import SecretsService as SecretsService +from influxdb_client.service.setup_service import SetupService as SetupService +from influxdb_client.service.signin_service import SigninService as SigninService +from influxdb_client.service.signout_service import SignoutService as SignoutService +from influxdb_client.service.sources_service import SourcesService as SourcesService +from influxdb_client.service.tasks_service import TasksService as TasksService +from influxdb_client.service.telegraf_plugins_service import TelegrafPluginsService as TelegrafPluginsService +from influxdb_client.service.telegrafs_service import TelegrafsService as TelegrafsService +from influxdb_client.service.templates_service import TemplatesService as TemplatesService +from influxdb_client.service.users_service import UsersService as UsersService +from influxdb_client.service.variables_service import VariablesService as VariablesService +from influxdb_client.service.views_service import ViewsService as ViewsService +from influxdb_client.service.write_service import WriteService as WriteService +from influxdb_client.version import VERSION as VERSION + +__version__ = VERSION diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/blackberry/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/_async/__init__.pyi similarity index 100% rename from packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/blackberry/__init__.pyi rename to packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/_async/__init__.pyi diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/_async/api_client.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/_async/api_client.pyi new file mode 100644 index 000000000..5c06e8a7f --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/_async/api_client.pyi @@ -0,0 +1,65 @@ +from _typeshed import Incomplete + +class ApiClientAsync: + PRIMITIVE_TYPES: Incomplete + NATIVE_TYPES_MAPPING: Incomplete + configuration: Incomplete + pool_threads: Incomplete + rest_client: Incomplete + default_headers: Incomplete + cookie: Incomplete + def __init__( + self, + configuration: Incomplete | None = ..., + header_name: Incomplete | None = ..., + header_value: Incomplete | None = ..., + cookie: Incomplete | None = ..., + pool_threads: Incomplete | None = ..., + **kwargs, + ) -> None: ... + async def close(self) -> None: ... + @property + def pool(self): ... + @property + def user_agent(self): ... + @user_agent.setter + def user_agent(self, value) -> None: ... + def set_default_header(self, header_name, header_value) -> None: ... + def sanitize_for_serialization(self, obj): ... + def deserialize(self, response, response_type): ... + def call_api( + self, + resource_path, + method, + path_params: Incomplete | None = ..., + query_params: Incomplete | None = ..., + header_params: Incomplete | None = ..., + body: Incomplete | None = ..., + post_params: Incomplete | None = ..., + files: Incomplete | None = ..., + response_type: Incomplete | None = ..., + auth_settings: Incomplete | None = ..., + async_req: Incomplete | None = ..., + _return_http_data_only: Incomplete | None = ..., + collection_formats: Incomplete | None = ..., + _preload_content: bool = ..., + _request_timeout: Incomplete | None = ..., + urlopen_kw: Incomplete | None = ..., + ): ... + def request( + self, + method, + url, + query_params: Incomplete | None = ..., + headers: Incomplete | None = ..., + post_params: Incomplete | None = ..., + body: Incomplete | None = ..., + _preload_content: bool = ..., + _request_timeout: Incomplete | None = ..., + **urlopen_kw, + ): ... + def parameters_to_tuples(self, params, collection_formats): ... + def prepare_post_parameters(self, post_params: Incomplete | None = ..., files: Incomplete | None = ...): ... + def select_header_accept(self, accepts): ... + def select_header_content_type(self, content_types): ... + def update_params_for_auth(self, headers, querys, auth_settings) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/_async/rest.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/_async/rest.pyi new file mode 100644 index 000000000..912928e18 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/_async/rest.pyi @@ -0,0 +1,96 @@ +import io +from _typeshed import Incomplete + +class RESTResponseAsync(io.IOBase): + aiohttp_response: Incomplete + status: Incomplete + reason: Incomplete + data: Incomplete + def __init__(self, resp, data) -> None: ... + def getheaders(self): ... + def getheader(self, name, default: Incomplete | None = ...): ... + +class RESTClientObjectAsync: + proxy: Incomplete + proxy_headers: Incomplete + allow_redirects: Incomplete + max_redirects: Incomplete + pool_manager: Incomplete + def __init__(self, configuration, pools_size: int = ..., maxsize: Incomplete | None = ..., **kwargs) -> None: ... + async def close(self) -> None: ... + async def request( + self, + method, + url, + query_params: Incomplete | None = ..., + headers: Incomplete | None = ..., + body: Incomplete | None = ..., + post_params: Incomplete | None = ..., + _preload_content: bool = ..., + _request_timeout: Incomplete | None = ..., + ): ... + async def GET( + self, + url, + headers: Incomplete | None = ..., + query_params: Incomplete | None = ..., + _preload_content: bool = ..., + _request_timeout: Incomplete | None = ..., + ): ... + async def HEAD( + self, + url, + headers: Incomplete | None = ..., + query_params: Incomplete | None = ..., + _preload_content: bool = ..., + _request_timeout: Incomplete | None = ..., + ): ... + async def OPTIONS( + self, + url, + headers: Incomplete | None = ..., + query_params: Incomplete | None = ..., + post_params: Incomplete | None = ..., + body: Incomplete | None = ..., + _preload_content: bool = ..., + _request_timeout: Incomplete | None = ..., + ): ... + async def DELETE( + self, + url, + headers: Incomplete | None = ..., + query_params: Incomplete | None = ..., + body: Incomplete | None = ..., + _preload_content: bool = ..., + _request_timeout: Incomplete | None = ..., + ): ... + async def POST( + self, + url, + headers: Incomplete | None = ..., + query_params: Incomplete | None = ..., + post_params: Incomplete | None = ..., + body: Incomplete | None = ..., + _preload_content: bool = ..., + _request_timeout: Incomplete | None = ..., + ): ... + async def PUT( + self, + url, + headers: Incomplete | None = ..., + query_params: Incomplete | None = ..., + post_params: Incomplete | None = ..., + body: Incomplete | None = ..., + _preload_content: bool = ..., + _request_timeout: Incomplete | None = ..., + ): ... + async def PATCH( + self, + url, + headers: Incomplete | None = ..., + query_params: Incomplete | None = ..., + post_params: Incomplete | None = ..., + body: Incomplete | None = ..., + _preload_content: bool = ..., + _request_timeout: Incomplete | None = ..., + ): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/chrome/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/_sync/__init__.pyi similarity index 100% rename from packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/chrome/__init__.pyi rename to packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/_sync/__init__.pyi diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/_sync/api_client.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/_sync/api_client.pyi new file mode 100644 index 000000000..379ea2e21 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/_sync/api_client.pyi @@ -0,0 +1,65 @@ +from _typeshed import Incomplete + +class ApiClient: + PRIMITIVE_TYPES: Incomplete + NATIVE_TYPES_MAPPING: Incomplete + configuration: Incomplete + pool_threads: Incomplete + rest_client: Incomplete + default_headers: Incomplete + cookie: Incomplete + def __init__( + self, + configuration: Incomplete | None = ..., + header_name: Incomplete | None = ..., + header_value: Incomplete | None = ..., + cookie: Incomplete | None = ..., + pool_threads: Incomplete | None = ..., + retries: bool = ..., + ) -> None: ... + def __del__(self) -> None: ... + @property + def pool(self): ... + @property + def user_agent(self): ... + @user_agent.setter + def user_agent(self, value) -> None: ... + def set_default_header(self, header_name, header_value) -> None: ... + def sanitize_for_serialization(self, obj): ... + def deserialize(self, response, response_type): ... + def call_api( + self, + resource_path, + method, + path_params: Incomplete | None = ..., + query_params: Incomplete | None = ..., + header_params: Incomplete | None = ..., + body: Incomplete | None = ..., + post_params: Incomplete | None = ..., + files: Incomplete | None = ..., + response_type: Incomplete | None = ..., + auth_settings: Incomplete | None = ..., + async_req: Incomplete | None = ..., + _return_http_data_only: Incomplete | None = ..., + collection_formats: Incomplete | None = ..., + _preload_content: bool = ..., + _request_timeout: Incomplete | None = ..., + urlopen_kw: Incomplete | None = ..., + ): ... + def request( + self, + method, + url, + query_params: Incomplete | None = ..., + headers: Incomplete | None = ..., + post_params: Incomplete | None = ..., + body: Incomplete | None = ..., + _preload_content: bool = ..., + _request_timeout: Incomplete | None = ..., + **urlopen_kw, + ): ... + def parameters_to_tuples(self, params, collection_formats): ... + def prepare_post_parameters(self, post_params: Incomplete | None = ..., files: Incomplete | None = ...): ... + def select_header_accept(self, accepts): ... + def select_header_content_type(self, content_types): ... + def update_params_for_auth(self, headers, querys, auth_settings) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/_sync/rest.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/_sync/rest.pyi new file mode 100644 index 000000000..f8b84cce4 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/_sync/rest.pyi @@ -0,0 +1,103 @@ +import io +from _typeshed import Incomplete + +class RESTResponse(io.IOBase): + urllib3_response: Incomplete + status: Incomplete + reason: Incomplete + data: Incomplete + def __init__(self, resp) -> None: ... + def getheaders(self): ... + def getheader(self, name, default: Incomplete | None = ...): ... + +class RESTClientObject: + configuration: Incomplete + pools_size: Incomplete + maxsize: Incomplete + retries: Incomplete + pool_manager: Incomplete + def __init__(self, configuration, pools_size: int = ..., maxsize: Incomplete | None = ..., retries: bool = ...) -> None: ... + def request( + self, + method, + url, + query_params: Incomplete | None = ..., + headers: Incomplete | None = ..., + body: Incomplete | None = ..., + post_params: Incomplete | None = ..., + _preload_content: bool = ..., + _request_timeout: Incomplete | None = ..., + **urlopen_kw, + ): ... + def GET( + self, + url, + headers: Incomplete | None = ..., + query_params: Incomplete | None = ..., + _preload_content: bool = ..., + _request_timeout: Incomplete | None = ..., + **urlopen_kw, + ): ... + def HEAD( + self, + url, + headers: Incomplete | None = ..., + query_params: Incomplete | None = ..., + _preload_content: bool = ..., + _request_timeout: Incomplete | None = ..., + **urlopen_kw, + ): ... + def OPTIONS( + self, + url, + headers: Incomplete | None = ..., + query_params: Incomplete | None = ..., + post_params: Incomplete | None = ..., + body: Incomplete | None = ..., + _preload_content: bool = ..., + _request_timeout: Incomplete | None = ..., + **urlopen_kw, + ): ... + def DELETE( + self, + url, + headers: Incomplete | None = ..., + query_params: Incomplete | None = ..., + body: Incomplete | None = ..., + _preload_content: bool = ..., + _request_timeout: Incomplete | None = ..., + **urlopen_kw, + ): ... + def POST( + self, + url, + headers: Incomplete | None = ..., + query_params: Incomplete | None = ..., + post_params: Incomplete | None = ..., + body: Incomplete | None = ..., + _preload_content: bool = ..., + _request_timeout: Incomplete | None = ..., + **urlopen_kw, + ): ... + def PUT( + self, + url, + headers: Incomplete | None = ..., + query_params: Incomplete | None = ..., + post_params: Incomplete | None = ..., + body: Incomplete | None = ..., + _preload_content: bool = ..., + _request_timeout: Incomplete | None = ..., + **urlopen_kw, + ): ... + def PATCH( + self, + url, + headers: Incomplete | None = ..., + query_params: Incomplete | None = ..., + post_params: Incomplete | None = ..., + body: Incomplete | None = ..., + _preload_content: bool = ..., + _request_timeout: Incomplete | None = ..., + **urlopen_kw, + ): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/__init__.pyi new file mode 100644 index 000000000..4285a8aa3 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/__init__.pyi @@ -0,0 +1,41 @@ +from influxdb_client.service.authorizations_service import AuthorizationsService as AuthorizationsService +from influxdb_client.service.backup_service import BackupService as BackupService +from influxdb_client.service.bucket_schemas_service import BucketSchemasService as BucketSchemasService +from influxdb_client.service.buckets_service import BucketsService as BucketsService +from influxdb_client.service.cells_service import CellsService as CellsService +from influxdb_client.service.checks_service import ChecksService as ChecksService +from influxdb_client.service.config_service import ConfigService as ConfigService +from influxdb_client.service.dashboards_service import DashboardsService as DashboardsService +from influxdb_client.service.dbr_ps_service import DBRPsService as DBRPsService +from influxdb_client.service.delete_service import DeleteService as DeleteService +from influxdb_client.service.health_service import HealthService as HealthService +from influxdb_client.service.invokable_scripts_service import InvokableScriptsService as InvokableScriptsService +from influxdb_client.service.labels_service import LabelsService as LabelsService +from influxdb_client.service.legacy_authorizations_service import LegacyAuthorizationsService as LegacyAuthorizationsService +from influxdb_client.service.metrics_service import MetricsService as MetricsService +from influxdb_client.service.notification_endpoints_service import NotificationEndpointsService as NotificationEndpointsService +from influxdb_client.service.notification_rules_service import NotificationRulesService as NotificationRulesService +from influxdb_client.service.organizations_service import OrganizationsService as OrganizationsService +from influxdb_client.service.ping_service import PingService as PingService +from influxdb_client.service.query_service import QueryService as QueryService +from influxdb_client.service.ready_service import ReadyService as ReadyService +from influxdb_client.service.remote_connections_service import RemoteConnectionsService as RemoteConnectionsService +from influxdb_client.service.replications_service import ReplicationsService as ReplicationsService +from influxdb_client.service.resources_service import ResourcesService as ResourcesService +from influxdb_client.service.restore_service import RestoreService as RestoreService +from influxdb_client.service.routes_service import RoutesService as RoutesService +from influxdb_client.service.rules_service import RulesService as RulesService +from influxdb_client.service.scraper_targets_service import ScraperTargetsService as ScraperTargetsService +from influxdb_client.service.secrets_service import SecretsService as SecretsService +from influxdb_client.service.setup_service import SetupService as SetupService +from influxdb_client.service.signin_service import SigninService as SigninService +from influxdb_client.service.signout_service import SignoutService as SignoutService +from influxdb_client.service.sources_service import SourcesService as SourcesService +from influxdb_client.service.tasks_service import TasksService as TasksService +from influxdb_client.service.telegraf_plugins_service import TelegrafPluginsService as TelegrafPluginsService +from influxdb_client.service.telegrafs_service import TelegrafsService as TelegrafsService +from influxdb_client.service.templates_service import TemplatesService as TemplatesService +from influxdb_client.service.users_service import UsersService as UsersService +from influxdb_client.service.variables_service import VariablesService as VariablesService +from influxdb_client.service.views_service import ViewsService as ViewsService +from influxdb_client.service.write_service import WriteService as WriteService diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/_base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/_base.pyi new file mode 100644 index 000000000..20d5f7e4d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/_base.pyi @@ -0,0 +1,60 @@ +from _typeshed import Incomplete + +from influxdb_client import Configuration + +LOGGERS_NAMES: Incomplete + +class _BaseClient: + url: str + token: str | None + org: str | None + default_tags: Incomplete | None + conf: _Configuration + auth_header_name: Incomplete | None + auth_header_value: Incomplete | None + retries: bool | Incomplete + profilers: Incomplete | None + def __init__( + self, + url: str, + token: str | None, + debug: bool | None = ..., + timeout: int = ..., + enable_gzip: bool = ..., + org: str | None = ..., + default_tags: dict[Incomplete, Incomplete] | None = ..., + http_client_logger: str | None = ..., + *, + verify_ssl: bool = ..., + ssl_ca_cert: Incomplete | None = ..., + cert_file: Incomplete | None = ..., + cert_key_file: Incomplete | None = ..., + cert_key_password: Incomplete | None = ..., + ssl_context: Incomplete | None = ..., + proxy: Incomplete | None = ..., + proxy_headers: Incomplete | None = ..., + connection_pool_maxsize: int = ..., + username: Incomplete | None = ..., + password: Incomplete | None = ..., + auth_basic: bool = ..., + retries: bool | Incomplete = ..., + profilers: Incomplete | None = ..., + ) -> None: ... + +class _BaseQueryApi: + default_dialect: Incomplete + def __init__(self, influxdb_client, query_options: Incomplete | None = ...) -> None: ... + +class _BaseWriteApi: + def __init__(self, influxdb_client, point_settings: Incomplete | None = ...) -> None: ... + +class _BaseDeleteApi: + def __init__(self, influxdb_client) -> None: ... + +class _Configuration(Configuration): + enable_gzip: bool + username: Incomplete + password: Incomplete + def __init__(self) -> None: ... + def update_request_header_params(self, path: str, params: dict[Incomplete, Incomplete]): ... + def update_request_body(self, path: str, body): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/authorizations_api.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/authorizations_api.pyi new file mode 100644 index 000000000..1e4ef9a52 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/authorizations_api.pyi @@ -0,0 +1,23 @@ +from _typeshed import Incomplete + +from influxdb_client import Authorization, Organization, User + +class AuthorizationsApi: + def __init__(self, influxdb_client) -> None: ... + def create_authorization( + self, + org_id: Incomplete | None = ..., + permissions: list[Incomplete] | None = ..., + authorization: Authorization | None = ..., + ) -> Authorization: ... + def find_authorization_by_id(self, auth_id: str) -> Authorization: ... + def find_authorizations(self, **kwargs): ... + def find_authorizations_by_user(self, user: User): ... + def find_authorizations_by_user_id(self, user_id: str): ... + def find_authorizations_by_user_name(self, user_name: str): ... + def find_authorizations_by_org(self, org: Organization): ... + def find_authorizations_by_org_name(self, org_name: str): ... + def find_authorizations_by_org_id(self, org_id: str): ... + def update_authorization(self, auth): ... + def clone_authorization(self, auth) -> Authorization: ... + def delete_authorization(self, auth): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/bucket_api.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/bucket_api.pyi new file mode 100644 index 000000000..1231020d0 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/bucket_api.pyi @@ -0,0 +1,20 @@ +from _typeshed import Incomplete + +from influxdb_client import Bucket + +class BucketsApi: + def __init__(self, influxdb_client) -> None: ... + def create_bucket( + self, + bucket: Incomplete | None = ..., + bucket_name: Incomplete | None = ..., + org_id: Incomplete | None = ..., + retention_rules: Incomplete | None = ..., + description: Incomplete | None = ..., + org: Incomplete | None = ..., + ) -> Bucket: ... + def update_bucket(self, bucket: Bucket) -> Bucket: ... + def delete_bucket(self, bucket): ... + def find_bucket_by_id(self, id): ... + def find_bucket_by_name(self, bucket_name): ... + def find_buckets(self, **kwargs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/delete_api.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/delete_api.pyi new file mode 100644 index 000000000..ad1c992fd --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/delete_api.pyi @@ -0,0 +1,10 @@ +from datetime import datetime + +from influxdb_client import Organization +from influxdb_client.client._base import _BaseDeleteApi + +class DeleteApi(_BaseDeleteApi): + def __init__(self, influxdb_client) -> None: ... + def delete( + self, start: str | datetime, stop: str | datetime, predicate: str, bucket: str, org: str | Organization | None = ... + ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/delete_api_async.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/delete_api_async.pyi new file mode 100644 index 000000000..803794e44 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/delete_api_async.pyi @@ -0,0 +1,10 @@ +from datetime import datetime + +from influxdb_client import Organization +from influxdb_client.client._base import _BaseDeleteApi + +class DeleteApiAsync(_BaseDeleteApi): + def __init__(self, influxdb_client) -> None: ... + async def delete( + self, start: str | datetime, stop: str | datetime, predicate: str, bucket: str, org: str | Organization | None = ... + ) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/exceptions.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/exceptions.pyi new file mode 100644 index 000000000..c3ec26704 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/exceptions.pyi @@ -0,0 +1,11 @@ +from _typeshed import Incomplete + +from urllib3 import HTTPResponse + +logger: Incomplete + +class InfluxDBError(Exception): + response: Incomplete + message: Incomplete + retry_after: Incomplete + def __init__(self, response: HTTPResponse | None = ..., message: str | None = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/flux_csv_parser.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/flux_csv_parser.pyi new file mode 100644 index 000000000..e317ae268 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/flux_csv_parser.pyi @@ -0,0 +1,74 @@ +from _typeshed import Incomplete +from collections.abc import Generator +from enum import Enum +from types import TracebackType +from typing_extensions import Self + +from influxdb_client.client.flux_table import TableList + +ANNOTATION_DEFAULT: str +ANNOTATION_GROUP: str +ANNOTATION_DATATYPE: str +ANNOTATIONS: Incomplete + +class FluxQueryException(Exception): + message: Incomplete + reference: Incomplete + def __init__(self, message, reference) -> None: ... + +class FluxCsvParserException(Exception): ... + +class FluxSerializationMode(Enum): + tables: int + stream: int + dataFrame: int + +class FluxResponseMetadataMode(Enum): + full: int + only_names: int + +class _FluxCsvParserMetadata: + table_index: int + table_id: int + start_new_table: bool + table: Incomplete + groups: Incomplete + parsing_state_error: bool + def __init__(self) -> None: ... + +class FluxCsvParser: + tables: Incomplete + def __init__( + self, + response, + serialization_mode: FluxSerializationMode, + data_frame_index: list[str] | None = ..., + query_options: Incomplete | None = ..., + response_metadata_mode: FluxResponseMetadataMode = ..., + ) -> None: ... + def __enter__(self) -> Self: ... + def __exit__( + self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None + ) -> None: ... + async def __aenter__(self) -> Self: ... + async def __aexit__( + self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None + ) -> None: ... + def generator(self) -> Generator[Incomplete, None, None]: ... + def generator_async(self): ... + def parse_record(self, table_index, table, csv): ... + @staticmethod + def add_data_types(table, data_types) -> None: ... + @staticmethod + def add_groups(table, csv) -> None: ... + @staticmethod + def add_default_empty_values(table, default_values) -> None: ... + @staticmethod + def add_column_names_and_tags(table, csv) -> None: ... + def table_list(self) -> TableList: ... + +class _StreamReaderToWithAsyncRead: + response: Incomplete + decoder: Incomplete + def __init__(self, response) -> None: ... + async def read(self, size: int) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/flux_table.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/flux_table.pyi new file mode 100644 index 000000000..4c2ba1392 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/flux_table.pyi @@ -0,0 +1,56 @@ +from _typeshed import Incomplete +from collections.abc import Iterator +from http.client import HTTPResponse +from json import JSONEncoder + +class FluxStructure: ... + +class FluxStructureEncoder(JSONEncoder): + def default(self, obj): ... + +class FluxTable(FluxStructure): + columns: Incomplete + records: Incomplete + def __init__(self) -> None: ... + def get_group_key(self): ... + def __iter__(self): ... + +class FluxColumn(FluxStructure): + default_value: Incomplete + group: Incomplete + data_type: Incomplete + label: Incomplete + index: Incomplete + def __init__( + self, + index: Incomplete | None = ..., + label: Incomplete | None = ..., + data_type: Incomplete | None = ..., + group: Incomplete | None = ..., + default_value: Incomplete | None = ..., + ) -> None: ... + +class FluxRecord(FluxStructure): + table: Incomplete + values: Incomplete + row: Incomplete + def __init__(self, table, values: Incomplete | None = ...) -> None: ... + def get_start(self): ... + def get_stop(self): ... + def get_time(self): ... + def get_value(self): ... + def get_field(self): ... + def get_measurement(self): ... + def __getitem__(self, key): ... + def __setitem__(self, key, value): ... + +class TableList(list[FluxTable]): + def to_values(self, columns: list[str] | None = ...) -> list[list[object]]: ... + def to_json(self, columns: list[str] | None = ..., **kwargs) -> str: ... + +class CSVIterator(Iterator[list[str]]): + delegate: Incomplete + def __init__(self, response: HTTPResponse) -> None: ... + def __iter__(self): ... + def __next__(self): ... + def to_values(self) -> list[list[str]]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/influxdb_client.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/influxdb_client.pyi new file mode 100644 index 000000000..90c0b28d3 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/influxdb_client.pyi @@ -0,0 +1,70 @@ +from _typeshed import Incomplete +from types import TracebackType +from typing_extensions import Self + +from influxdb_client import HealthCheck, InvokableScriptsApi, Ready +from influxdb_client.client._base import _BaseClient +from influxdb_client.client.authorizations_api import AuthorizationsApi +from influxdb_client.client.bucket_api import BucketsApi +from influxdb_client.client.delete_api import DeleteApi +from influxdb_client.client.labels_api import LabelsApi +from influxdb_client.client.organizations_api import OrganizationsApi +from influxdb_client.client.query_api import QueryApi, QueryOptions +from influxdb_client.client.tasks_api import TasksApi +from influxdb_client.client.users_api import UsersApi +from influxdb_client.client.write_api import PointSettings, WriteApi, WriteOptions + +logger: Incomplete + +class InfluxDBClient(_BaseClient): + api_client: Incomplete + def __init__( + self, + url: str, + token: str | None = ..., + debug: bool | None = ..., + timeout: int = ..., + enable_gzip: bool = ..., + org: str | None = ..., + default_tags: dict[Incomplete, Incomplete] | None = ..., + *, + verify_ssl: bool = ..., + ssl_ca_cert: Incomplete | None = ..., + cert_file: Incomplete | None = ..., + cert_key_file: Incomplete | None = ..., + cert_key_password: Incomplete | None = ..., + ssl_context: Incomplete | None = ..., + proxy: Incomplete | None = ..., + proxy_headers: Incomplete | None = ..., + connection_pool_maxsize: int = ..., + username: Incomplete | None = ..., + password: Incomplete | None = ..., + auth_basic: bool = ..., + retries: bool | Incomplete = ..., + profilers: Incomplete | None = ..., + ) -> None: ... + def __enter__(self) -> Self: ... + def __exit__( + self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None + ) -> None: ... + @classmethod + def from_config_file(cls, config_file: str = ..., debug: Incomplete | None = ..., enable_gzip: bool = ..., **kwargs): ... + @classmethod + def from_env_properties(cls, debug: Incomplete | None = ..., enable_gzip: bool = ..., **kwargs): ... + def write_api(self, write_options: WriteOptions = ..., point_settings: PointSettings = ..., **kwargs) -> WriteApi: ... + def query_api(self, query_options: QueryOptions = ...) -> QueryApi: ... + def invokable_scripts_api(self) -> InvokableScriptsApi: ... + def close(self) -> None: ... + def __del__(self) -> None: ... + def buckets_api(self) -> BucketsApi: ... + def authorizations_api(self) -> AuthorizationsApi: ... + def users_api(self) -> UsersApi: ... + def organizations_api(self) -> OrganizationsApi: ... + def tasks_api(self) -> TasksApi: ... + def labels_api(self) -> LabelsApi: ... + def health(self) -> HealthCheck: ... + def ping(self) -> bool: ... + def version(self) -> str: ... + def build(self) -> str: ... + def ready(self) -> Ready: ... + def delete_api(self) -> DeleteApi: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/influxdb_client_async.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/influxdb_client_async.pyi new file mode 100644 index 000000000..0355f41d9 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/influxdb_client_async.pyi @@ -0,0 +1,54 @@ +from _typeshed import Incomplete +from types import TracebackType +from typing_extensions import Self + +from influxdb_client.client._base import _BaseClient +from influxdb_client.client.delete_api_async import DeleteApiAsync +from influxdb_client.client.query_api import QueryOptions +from influxdb_client.client.query_api_async import QueryApiAsync +from influxdb_client.client.write_api import PointSettings +from influxdb_client.client.write_api_async import WriteApiAsync + +logger: Incomplete + +class InfluxDBClientAsync(_BaseClient): + api_client: Incomplete + def __init__( + self, + url: str, + token: str | None = ..., + org: str | None = ..., + debug: bool | None = ..., + timeout: int = ..., + enable_gzip: bool = ..., + *, + verify_ssl: bool = ..., + ssl_ca_cert: Incomplete | None = ..., + cert_file: Incomplete | None = ..., + cert_key_file: Incomplete | None = ..., + cert_key_password: Incomplete | None = ..., + ssl_context: Incomplete | None = ..., + proxy: Incomplete | None = ..., + proxy_headers: Incomplete | None = ..., + connection_pool_maxsize: int = ..., + username: Incomplete | None = ..., + password: Incomplete | None = ..., + auth_basic: bool = ..., + retries: bool | Incomplete = ..., + profilers: Incomplete | None = ..., + ) -> None: ... + async def __aenter__(self) -> Self: ... + async def __aexit__( + self, exc_type: type[BaseException] | None, exc: BaseException | None, tb: TracebackType | None + ) -> None: ... + async def close(self) -> None: ... + @classmethod + def from_config_file(cls, config_file: str = ..., debug: Incomplete | None = ..., enable_gzip: bool = ..., **kwargs): ... + @classmethod + def from_env_properties(cls, debug: Incomplete | None = ..., enable_gzip: bool = ..., **kwargs): ... + async def ping(self) -> bool: ... + async def version(self) -> str: ... + async def build(self) -> str: ... + def query_api(self, query_options: QueryOptions = ...) -> QueryApiAsync: ... + def write_api(self, point_settings: PointSettings = ...) -> WriteApiAsync: ... + def delete_api(self) -> DeleteApiAsync: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/invokable_scripts_api.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/invokable_scripts_api.pyi new file mode 100644 index 000000000..f4b85afbe --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/invokable_scripts_api.pyi @@ -0,0 +1,26 @@ +from _typeshed import Incomplete +from collections.abc import Generator, Iterator +from typing import Any + +from influxdb_client import Script, ScriptCreateRequest, ScriptUpdateRequest +from influxdb_client.client._base import _BaseQueryApi +from influxdb_client.client.flux_table import CSVIterator, FluxRecord, TableList + +class InvokableScriptsApi(_BaseQueryApi): + def __init__(self, influxdb_client) -> None: ... + def create_script(self, create_request: ScriptCreateRequest) -> Script: ... + def update_script(self, script_id: str, update_request: ScriptUpdateRequest) -> Script: ... + def delete_script(self, script_id: str) -> None: ... + def find_scripts(self, **kwargs): ... + def invoke_script(self, script_id: str, params: dict[Incomplete, Incomplete] | None = ...) -> TableList: ... + def invoke_script_stream( + self, script_id: str, params: dict[Incomplete, Incomplete] | None = ... + ) -> Generator[FluxRecord, Any, None]: ... + def invoke_script_data_frame( + self, script_id: str, params: dict[Incomplete, Incomplete] | None = ..., data_frame_index: list[str] | None = ... + ): ... + def invoke_script_data_frame_stream( + self, script_id: str, params: dict[Incomplete, Incomplete] | None = ..., data_frame_index: list[str] | None = ... + ): ... + def invoke_script_csv(self, script_id: str, params: dict[Incomplete, Incomplete] | None = ...) -> CSVIterator: ... + def invoke_script_raw(self, script_id: str, params: dict[Incomplete, Incomplete] | None = ...) -> Iterator[list[str]]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/labels_api.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/labels_api.pyi new file mode 100644 index 000000000..01d3e06ea --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/labels_api.pyi @@ -0,0 +1,11 @@ +from influxdb_client import Label + +class LabelsApi: + def __init__(self, influxdb_client) -> None: ... + def create_label(self, name: str, org_id: str, properties: dict[str, str] | None = ...) -> Label: ... + def update_label(self, label: Label): ... + def delete_label(self, label: str | Label): ... + def clone_label(self, cloned_name: str, label: Label) -> Label: ... + def find_labels(self, **kwargs) -> list[Label]: ... + def find_label_by_id(self, label_id: str): ... + def find_label_by_org(self, org_id) -> list[Label]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/logging_handler.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/logging_handler.pyi new file mode 100644 index 000000000..28c8363ac --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/logging_handler.pyi @@ -0,0 +1,14 @@ +import logging +from _typeshed import Incomplete + +class InfluxLoggingHandler(logging.Handler): + DEFAULT_LOG_RECORD_KEYS: Incomplete + bucket: Incomplete + client: Incomplete + write_api: Incomplete + def __init__( + self, *, url, token, org, bucket, client_args: Incomplete | None = ..., write_api_args: Incomplete | None = ... + ) -> None: ... + def __del__(self) -> None: ... + def close(self) -> None: ... + def emit(self, record: logging.LogRecord) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/organizations_api.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/organizations_api.pyi new file mode 100644 index 000000000..873cca7ba --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/organizations_api.pyi @@ -0,0 +1,10 @@ +from influxdb_client import Organization + +class OrganizationsApi: + def __init__(self, influxdb_client) -> None: ... + def me(self): ... + def find_organization(self, org_id): ... + def find_organizations(self, **kwargs): ... + def create_organization(self, name: str | None = ..., organization: Organization | None = ...) -> Organization: ... + def update_organization(self, organization: Organization) -> Organization: ... + def delete_organization(self, org_id: str): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/query_api.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/query_api.pyi new file mode 100644 index 000000000..0dc0c97a1 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/query_api.pyi @@ -0,0 +1,40 @@ +from _typeshed import Incomplete +from collections.abc import Callable, Generator +from typing import Any + +from influxdb_client import Dialect +from influxdb_client.client._base import _BaseQueryApi +from influxdb_client.client.flux_table import CSVIterator, FluxRecord, TableList + +class QueryOptions: + profilers: Incomplete + profiler_callback: Incomplete + def __init__(self, profilers: list[str] | None = ..., profiler_callback: Callable[..., Incomplete] | None = ...) -> None: ... + +class QueryApi(_BaseQueryApi): + def __init__(self, influxdb_client, query_options=...) -> None: ... + def query_csv( + self, query: str, org: Incomplete | None = ..., dialect: Dialect = ..., params: dict[Incomplete, Incomplete] | None = ... + ) -> CSVIterator: ... + def query_raw( + self, query: str, org: Incomplete | None = ..., dialect=..., params: dict[Incomplete, Incomplete] | None = ... + ): ... + def query(self, query: str, org: Incomplete | None = ..., params: dict[Incomplete, Incomplete] | None = ...) -> TableList: ... + def query_stream( + self, query: str, org: Incomplete | None = ..., params: dict[Incomplete, Incomplete] | None = ... + ) -> Generator[FluxRecord, Any, None]: ... + def query_data_frame( + self, + query: str, + org: Incomplete | None = ..., + data_frame_index: list[str] | None = ..., + params: dict[Incomplete, Incomplete] | None = ..., + ): ... + def query_data_frame_stream( + self, + query: str, + org: Incomplete | None = ..., + data_frame_index: list[str] | None = ..., + params: dict[Incomplete, Incomplete] | None = ..., + ): ... + def __del__(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/query_api_async.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/query_api_async.pyi new file mode 100644 index 000000000..465e81650 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/query_api_async.pyi @@ -0,0 +1,31 @@ +from _typeshed import Incomplete +from collections.abc import AsyncGenerator + +from influxdb_client.client._base import _BaseQueryApi +from influxdb_client.client.flux_table import FluxRecord, TableList + +class QueryApiAsync(_BaseQueryApi): + def __init__(self, influxdb_client, query_options=...) -> None: ... + async def query( + self, query: str, org: Incomplete | None = ..., params: dict[Incomplete, Incomplete] | None = ... + ) -> TableList: ... + async def query_stream( + self, query: str, org: Incomplete | None = ..., params: dict[Incomplete, Incomplete] | None = ... + ) -> AsyncGenerator[FluxRecord, None]: ... + async def query_data_frame( + self, + query: str, + org: Incomplete | None = ..., + data_frame_index: list[str] | None = ..., + params: dict[Incomplete, Incomplete] | None = ..., + ): ... + async def query_data_frame_stream( + self, + query: str, + org: Incomplete | None = ..., + data_frame_index: list[str] | None = ..., + params: dict[Incomplete, Incomplete] | None = ..., + ): ... + async def query_raw( + self, query: str, org: Incomplete | None = ..., dialect=..., params: dict[Incomplete, Incomplete] | None = ... + ): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/tasks_api.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/tasks_api.pyi new file mode 100644 index 000000000..97d78972f --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/tasks_api.pyi @@ -0,0 +1,32 @@ +from datetime import datetime + +from influxdb_client import LabelResponse, LogEvent, Run, Task, TaskCreateRequest, TaskUpdateRequest + +class TasksApi: + def __init__(self, influxdb_client) -> None: ... + def find_task_by_id(self, task_id) -> Task: ... + def find_tasks(self, **kwargs): ... + def create_task(self, task: Task | None = ..., task_create_request: TaskCreateRequest | None = ...) -> Task: ... + def create_task_every(self, name, flux, every, organization) -> Task: ... + def create_task_cron(self, name: str, flux: str, cron: str, org_id: str) -> Task: ... + def delete_task(self, task_id: str): ... + def update_task(self, task: Task) -> Task: ... + def update_task_request(self, task_id, task_update_request: TaskUpdateRequest) -> Task: ... + def clone_task(self, task: Task) -> Task: ... + def get_labels(self, task_id): ... + def add_label(self, label_id: str, task_id: str) -> LabelResponse: ... + def delete_label(self, label_id: str, task_id: str): ... + def get_members(self, task_id: str): ... + def add_member(self, member_id, task_id): ... + def delete_member(self, member_id, task_id): ... + def get_owners(self, task_id): ... + def add_owner(self, owner_id, task_id): ... + def delete_owner(self, owner_id, task_id): ... + def get_runs(self, task_id, **kwargs) -> list[Run]: ... + def get_run(self, task_id: str, run_id: str) -> Run: ... + def get_run_logs(self, task_id: str, run_id: str) -> list[LogEvent]: ... + def run_manually(self, task_id: str, scheduled_for: datetime | None = ...): ... + def retry_run(self, task_id: str, run_id: str): ... + def cancel_run(self, task_id: str, run_id: str): ... + def get_logs(self, task_id: str) -> list[LogEvent]: ... + def find_tasks_by_user(self, task_user_id): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/users_api.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/users_api.pyi new file mode 100644 index 000000000..8be06535e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/users_api.pyi @@ -0,0 +1,10 @@ +from influxdb_client import User, UserResponse, Users + +class UsersApi: + def __init__(self, influxdb_client) -> None: ... + def me(self) -> User: ... + def create_user(self, name: str) -> User: ... + def update_user(self, user: User) -> UserResponse: ... + def update_password(self, user: str | User | UserResponse, password: str) -> None: ... + def delete_user(self, user: str | User | UserResponse) -> None: ... + def find_users(self, **kwargs) -> Users: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/util/__init__.pyi similarity index 100% rename from packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/__init__.pyi rename to packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/util/__init__.pyi diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/util/date_utils.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/util/date_utils.pyi new file mode 100644 index 000000000..0f5d8ef0c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/util/date_utils.pyi @@ -0,0 +1,16 @@ +from datetime import datetime, timedelta, tzinfo +from threading import Lock + +date_helper: DateHelper | None +lock_: Lock + +class DateHelper: + timezone: tzinfo + def __init__(self, timezone: tzinfo = ...) -> None: ... + # This returns None in the implementation, but a datetime-compatible + # object is monkey-patched in at runtime. + def parse_date(self, date_string: str) -> datetime: ... + def to_nanoseconds(self, delta: timedelta) -> int: ... + def to_utc(self, value: datetime) -> datetime: ... + +def get_date_helper() -> DateHelper: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/util/date_utils_pandas.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/util/date_utils_pandas.pyi new file mode 100644 index 000000000..2cd7570ce --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/util/date_utils_pandas.pyi @@ -0,0 +1,5 @@ +from influxdb_client.client.util.date_utils import DateHelper + +class PandasDateTimeHelper(DateHelper): + def parse_date(self, date_string: str): ... + def to_nanoseconds(self, delta): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/util/helpers.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/util/helpers.pyi new file mode 100644 index 000000000..e5e7609b9 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/util/helpers.pyi @@ -0,0 +1 @@ +def get_org_query_param(org, client, required_id: bool = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/util/multiprocessing_helper.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/util/multiprocessing_helper.pyi new file mode 100644 index 000000000..8889a3817 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/util/multiprocessing_helper.pyi @@ -0,0 +1,25 @@ +import multiprocessing +from _typeshed import Incomplete +from types import TracebackType + +logger: Incomplete + +class _PoisonPill: ... + +class MultiprocessingWriter(multiprocessing.Process): + __started__: bool + __disposed__: bool + kwargs: Incomplete + client: Incomplete + write_api: Incomplete + queue_: Incomplete + def __init__(self, **kwargs) -> None: ... + def write(self, **kwargs) -> None: ... + def run(self) -> None: ... + def start(self) -> None: ... + def terminate(self) -> None: ... + def __enter__(self): ... + def __exit__( + self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None + ) -> None: ... + def __del__(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/warnings.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/warnings.pyi new file mode 100644 index 000000000..e198f507a --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/warnings.pyi @@ -0,0 +1,7 @@ +class MissingPivotFunction(UserWarning): + @staticmethod + def print_warning(query: str): ... + +class CloudOnlyWarning(UserWarning): + @staticmethod + def print_warning(api_name: str, doc_url: str): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/write/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/write/__init__.pyi new file mode 100644 index 000000000..4285a8aa3 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/write/__init__.pyi @@ -0,0 +1,41 @@ +from influxdb_client.service.authorizations_service import AuthorizationsService as AuthorizationsService +from influxdb_client.service.backup_service import BackupService as BackupService +from influxdb_client.service.bucket_schemas_service import BucketSchemasService as BucketSchemasService +from influxdb_client.service.buckets_service import BucketsService as BucketsService +from influxdb_client.service.cells_service import CellsService as CellsService +from influxdb_client.service.checks_service import ChecksService as ChecksService +from influxdb_client.service.config_service import ConfigService as ConfigService +from influxdb_client.service.dashboards_service import DashboardsService as DashboardsService +from influxdb_client.service.dbr_ps_service import DBRPsService as DBRPsService +from influxdb_client.service.delete_service import DeleteService as DeleteService +from influxdb_client.service.health_service import HealthService as HealthService +from influxdb_client.service.invokable_scripts_service import InvokableScriptsService as InvokableScriptsService +from influxdb_client.service.labels_service import LabelsService as LabelsService +from influxdb_client.service.legacy_authorizations_service import LegacyAuthorizationsService as LegacyAuthorizationsService +from influxdb_client.service.metrics_service import MetricsService as MetricsService +from influxdb_client.service.notification_endpoints_service import NotificationEndpointsService as NotificationEndpointsService +from influxdb_client.service.notification_rules_service import NotificationRulesService as NotificationRulesService +from influxdb_client.service.organizations_service import OrganizationsService as OrganizationsService +from influxdb_client.service.ping_service import PingService as PingService +from influxdb_client.service.query_service import QueryService as QueryService +from influxdb_client.service.ready_service import ReadyService as ReadyService +from influxdb_client.service.remote_connections_service import RemoteConnectionsService as RemoteConnectionsService +from influxdb_client.service.replications_service import ReplicationsService as ReplicationsService +from influxdb_client.service.resources_service import ResourcesService as ResourcesService +from influxdb_client.service.restore_service import RestoreService as RestoreService +from influxdb_client.service.routes_service import RoutesService as RoutesService +from influxdb_client.service.rules_service import RulesService as RulesService +from influxdb_client.service.scraper_targets_service import ScraperTargetsService as ScraperTargetsService +from influxdb_client.service.secrets_service import SecretsService as SecretsService +from influxdb_client.service.setup_service import SetupService as SetupService +from influxdb_client.service.signin_service import SigninService as SigninService +from influxdb_client.service.signout_service import SignoutService as SignoutService +from influxdb_client.service.sources_service import SourcesService as SourcesService +from influxdb_client.service.tasks_service import TasksService as TasksService +from influxdb_client.service.telegraf_plugins_service import TelegrafPluginsService as TelegrafPluginsService +from influxdb_client.service.telegrafs_service import TelegrafsService as TelegrafsService +from influxdb_client.service.templates_service import TemplatesService as TemplatesService +from influxdb_client.service.users_service import UsersService as UsersService +from influxdb_client.service.variables_service import VariablesService as VariablesService +from influxdb_client.service.views_service import ViewsService as ViewsService +from influxdb_client.service.write_service import WriteService as WriteService diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/write/dataframe_serializer.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/write/dataframe_serializer.pyi new file mode 100644 index 000000000..b5b4b7ab8 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/write/dataframe_serializer.pyi @@ -0,0 +1,15 @@ +from _typeshed import Incomplete + +logger: Incomplete + +class DataframeSerializer: + data_frame: Incomplete + f: Incomplete + field_indexes: Incomplete + first_field_maybe_null: Incomplete + chunk_size: Incomplete + def __init__(self, data_frame, point_settings, precision=..., chunk_size: int | None = ..., **kwargs) -> None: ... + def serialize(self, chunk_idx: int | None = ...): ... + def number_of_chunks(self): ... + +def data_frame_to_list_of_points(data_frame, point_settings, precision=..., **kwargs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/write/point.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/write/point.pyi new file mode 100644 index 000000000..d18ecc289 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/write/point.pyi @@ -0,0 +1,39 @@ +from _typeshed import Incomplete, SupportsGetItem, SupportsItems +from collections.abc import Iterable +from datetime import datetime, timedelta +from numbers import Integral +from typing import Any +from typing_extensions import Literal, Self, TypeAlias + +from influxdb_client.domain.write_precision import _WritePrecision + +_Value: TypeAlias = Incomplete +_Time: TypeAlias = Integral | str | datetime | timedelta + +EPOCH: datetime +DEFAULT_WRITE_PRECISION: _WritePrecision + +class Point: + @staticmethod + def measurement(measurement: str) -> Point: ... + @staticmethod + def from_dict( + dictionary: SupportsGetItem[str, Any], + write_precision: _WritePrecision = ..., + *, + record_measurement_name: str | None = ..., + record_measurement_key: str = ..., + record_tag_keys: Iterable[str] | None = ..., + record_field_keys: Iterable[str] | None = ..., + record_time_key: str = ..., + fields: SupportsItems[str, Literal["int", "uint", "float"]] = ..., + ) -> Point: ... + def __init__(self, measurement_name: str) -> None: ... + def time(self, time: _Time, write_precision: _WritePrecision = ...) -> Self: ... + def tag(self, key: str, value: _Value) -> Self: ... + def field(self, field: str, value: _Value) -> Self: ... + def to_line_protocol(self, precision: _WritePrecision | None = ...) -> str: ... + @property + def write_precision(self) -> _WritePrecision: ... + @classmethod + def set_str_rep(cls, rep_function: Any) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/write/retry.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/write/retry.pyi new file mode 100644 index 000000000..7a814a49c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/write/retry.pyi @@ -0,0 +1,40 @@ +from _typeshed import Incomplete +from collections.abc import Callable + +from urllib3 import Retry + +logger: Incomplete + +class WritesRetry(Retry): + jitter_interval: Incomplete + total: Incomplete + retry_interval: Incomplete + max_retry_delay: Incomplete + max_retry_time: Incomplete + exponential_base: Incomplete + retry_timeout: Incomplete + retry_callback: Incomplete + def __init__( + self, + jitter_interval: int = ..., + max_retry_delay: int = ..., + exponential_base: int = ..., + max_retry_time: int = ..., + total: int = ..., + retry_interval: int = ..., + retry_callback: Callable[[Exception], int] | None = ..., + **kw, + ) -> None: ... + def new(self, **kw): ... + def is_retry(self, method, status_code, has_retry_after: bool = ...): ... + def get_backoff_time(self): ... + def get_retry_after(self, response): ... + def increment( + self, + method: Incomplete | None = ..., + url: Incomplete | None = ..., + response: Incomplete | None = ..., + error: Incomplete | None = ..., + _pool: Incomplete | None = ..., + _stacktrace: Incomplete | None = ..., + ): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/write_api.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/write_api.pyi new file mode 100644 index 000000000..3707c95b3 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/write_api.pyi @@ -0,0 +1,110 @@ +import logging +from _typeshed import Incomplete +from collections.abc import Iterable +from enum import Enum +from types import TracebackType +from typing import Any +from typing_extensions import Self, TypeAlias + +from influxdb_client.client._base import _BaseWriteApi +from influxdb_client.client.write.point import Point +from influxdb_client.domain.write_precision import _WritePrecision + +_DataClass: TypeAlias = Any # any dataclass +_NamedTuple: TypeAlias = tuple[Any, ...] # any NamedTuple +_Observable: TypeAlias = Any # reactivex.Observable + +logger: logging.Logger + +class WriteType(Enum): + batching: int + asynchronous: int + synchronous: int + +class WriteOptions: + write_type: WriteType + batch_size: int + flush_interval: int + jitter_interval: int + retry_interval: int + max_retries: int + max_retry_delay: int + max_retry_time: int + exponential_base: int + write_scheduler: Incomplete + max_close_wait: int + def __init__( + self, + write_type: WriteType = ..., + batch_size: int = 1_000, + flush_interval: int = 1_000, + jitter_interval: int = 0, + retry_interval: int = 5_000, + max_retries: int = 5, + max_retry_delay: int = 125_000, + max_retry_time: int = 180_000, + exponential_base: int = 2, + max_close_wait: int = 300_000, + write_scheduler=..., + ) -> None: ... + def to_retry_strategy(self, **kwargs): ... + +SYNCHRONOUS: Incomplete +ASYNCHRONOUS: Incomplete + +class PointSettings: + defaultTags: Incomplete + def __init__(self, **default_tags) -> None: ... + def add_default_tag(self, key, value) -> None: ... + +class _BatchItemKey: + bucket: Incomplete + org: Incomplete + precision: Incomplete + def __init__(self, bucket, org, precision=...) -> None: ... + def __hash__(self) -> int: ... + def __eq__(self, o: object) -> bool: ... + +class _BatchItem: + key: Incomplete + data: Incomplete + size: Incomplete + def __init__(self, key: _BatchItemKey, data, size: int = ...) -> None: ... + def to_key_tuple(self) -> tuple[str, str, str]: ... + +class _BatchResponse: + data: Incomplete + exception: Incomplete + def __init__(self, data: _BatchItem, exception: Exception | None = ...) -> None: ... + +class WriteApi(_BaseWriteApi): + def __init__( + self, influxdb_client, write_options: WriteOptions = ..., point_settings: PointSettings = ..., **kwargs + ) -> None: ... + def write( + self, + bucket: str, + org: str | None = ..., + record: str + | Iterable[str] + | Point + | Iterable[Point] + | dict[Incomplete, Incomplete] + | Iterable[dict[Incomplete, Incomplete]] + | bytes + | Iterable[bytes] + | _Observable + | _NamedTuple + | Iterable[_NamedTuple] + | _DataClass + | Iterable[_DataClass] = ..., + write_precision: _WritePrecision = ..., + **kwargs, + ) -> Any: ... + def flush(self) -> None: ... + def close(self) -> None: ... + def __enter__(self) -> Self: ... + def __exit__( + self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None + ) -> None: ... + def __del__(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/write_api_async.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/write_api_async.pyi new file mode 100644 index 000000000..f33896d53 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/write_api_async.pyi @@ -0,0 +1,36 @@ +from _typeshed import Incomplete +from collections.abc import Iterable +from typing import Any +from typing_extensions import TypeAlias + +from influxdb_client.client._base import _BaseWriteApi +from influxdb_client.client.write.point import Point +from influxdb_client.client.write_api import PointSettings +from influxdb_client.domain.write_precision import _WritePrecision + +_DataClass: TypeAlias = Any # any dataclass +_NamedTuple: TypeAlias = tuple[Any, ...] # any NamedTuple + +logger: Incomplete + +class WriteApiAsync(_BaseWriteApi): + def __init__(self, influxdb_client, point_settings: PointSettings = ...) -> None: ... + async def write( + self, + bucket: str, + org: str | None = ..., + record: str + | Iterable[str] + | Point + | Iterable[Point] + | dict[Incomplete, Incomplete] + | Iterable[dict[Incomplete, Incomplete]] + | bytes + | Iterable[bytes] + | _NamedTuple + | Iterable[_NamedTuple] + | _DataClass + | Iterable[_DataClass] = ..., + write_precision: _WritePrecision = ..., + **kwargs, + ) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/configuration.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/configuration.pyi new file mode 100644 index 000000000..eb52aa691 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/configuration.pyi @@ -0,0 +1,50 @@ +from _typeshed import Incomplete + +class TypeWithDefault(type): + def __init__(cls, name, bases, dct) -> None: ... + def __call__(cls): ... + def set_default(cls, default) -> None: ... + +class Configuration(metaclass=TypeWithDefault): + host: str + temp_folder_path: Incomplete + api_key: Incomplete + api_key_prefix: Incomplete + username: str + password: str + loggers: Incomplete + logger_stream_handler: Incomplete + logger_file_handler: Incomplete + verify_ssl: bool + ssl_ca_cert: Incomplete + cert_file: Incomplete + cert_key_file: Incomplete + cert_key_password: Incomplete + assert_hostname: Incomplete + ssl_context: Incomplete + connection_pool_maxsize: Incomplete + timeout: Incomplete + auth_basic: bool + proxy: Incomplete + proxy_headers: Incomplete + safe_chars_for_path_param: str + logger_formatter: Incomplete + def __init__(self) -> None: ... + @property + def logger_file(self): ... + @logger_file.setter + def logger_file(self, value) -> None: ... + @property + def debug(self): ... + @debug.setter + def debug(self, value): ... + @property + def logger_format(self): ... + @logger_format.setter + def logger_format(self, value) -> None: ... + def get_api_key_with_prefix(self, identifier): ... + def get_basic_auth_token(self): ... + def auth_settings(self): ... + def to_debug_report(self): ... + def update_request_header_params(self, path: str, params: dict[Incomplete, Incomplete]): ... + def update_request_body(self, path: str, body): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/__init__.pyi new file mode 100644 index 000000000..def5bd65a --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/__init__.pyi @@ -0,0 +1,373 @@ +from influxdb_client.domain.add_resource_member_request_body import AddResourceMemberRequestBody as AddResourceMemberRequestBody +from influxdb_client.domain.analyze_query_response import AnalyzeQueryResponse as AnalyzeQueryResponse +from influxdb_client.domain.analyze_query_response_errors import AnalyzeQueryResponseErrors as AnalyzeQueryResponseErrors +from influxdb_client.domain.array_expression import ArrayExpression as ArrayExpression +from influxdb_client.domain.ast_response import ASTResponse as ASTResponse +from influxdb_client.domain.authorization import Authorization as Authorization +from influxdb_client.domain.authorization_post_request import AuthorizationPostRequest as AuthorizationPostRequest +from influxdb_client.domain.authorization_update_request import AuthorizationUpdateRequest as AuthorizationUpdateRequest +from influxdb_client.domain.authorizations import Authorizations as Authorizations +from influxdb_client.domain.axes import Axes as Axes +from influxdb_client.domain.axis import Axis as Axis +from influxdb_client.domain.axis_scale import AxisScale as AxisScale +from influxdb_client.domain.bad_statement import BadStatement as BadStatement +from influxdb_client.domain.band_view_properties import BandViewProperties as BandViewProperties +from influxdb_client.domain.binary_expression import BinaryExpression as BinaryExpression +from influxdb_client.domain.block import Block as Block +from influxdb_client.domain.boolean_literal import BooleanLiteral as BooleanLiteral +from influxdb_client.domain.bucket import Bucket as Bucket +from influxdb_client.domain.bucket_links import BucketLinks as BucketLinks +from influxdb_client.domain.bucket_metadata_manifest import BucketMetadataManifest as BucketMetadataManifest +from influxdb_client.domain.bucket_retention_rules import BucketRetentionRules as BucketRetentionRules +from influxdb_client.domain.bucket_shard_mapping import BucketShardMapping as BucketShardMapping +from influxdb_client.domain.buckets import Buckets as Buckets +from influxdb_client.domain.builder_aggregate_function_type import BuilderAggregateFunctionType as BuilderAggregateFunctionType +from influxdb_client.domain.builder_config import BuilderConfig as BuilderConfig +from influxdb_client.domain.builder_config_aggregate_window import BuilderConfigAggregateWindow as BuilderConfigAggregateWindow +from influxdb_client.domain.builder_functions_type import BuilderFunctionsType as BuilderFunctionsType +from influxdb_client.domain.builder_tags_type import BuilderTagsType as BuilderTagsType +from influxdb_client.domain.builtin_statement import BuiltinStatement as BuiltinStatement +from influxdb_client.domain.call_expression import CallExpression as CallExpression +from influxdb_client.domain.cell import Cell as Cell +from influxdb_client.domain.cell_links import CellLinks as CellLinks +from influxdb_client.domain.cell_update import CellUpdate as CellUpdate +from influxdb_client.domain.cell_with_view_properties import CellWithViewProperties as CellWithViewProperties +from influxdb_client.domain.check import Check as Check +from influxdb_client.domain.check_base import CheckBase as CheckBase +from influxdb_client.domain.check_base_links import CheckBaseLinks as CheckBaseLinks +from influxdb_client.domain.check_discriminator import CheckDiscriminator as CheckDiscriminator +from influxdb_client.domain.check_patch import CheckPatch as CheckPatch +from influxdb_client.domain.check_status_level import CheckStatusLevel as CheckStatusLevel +from influxdb_client.domain.check_view_properties import CheckViewProperties as CheckViewProperties +from influxdb_client.domain.checks import Checks as Checks +from influxdb_client.domain.column_data_type import ColumnDataType as ColumnDataType +from influxdb_client.domain.column_semantic_type import ColumnSemanticType as ColumnSemanticType +from influxdb_client.domain.conditional_expression import ConditionalExpression as ConditionalExpression +from influxdb_client.domain.config import Config as Config +from influxdb_client.domain.constant_variable_properties import ConstantVariableProperties as ConstantVariableProperties +from influxdb_client.domain.create_cell import CreateCell as CreateCell +from influxdb_client.domain.create_dashboard_request import CreateDashboardRequest as CreateDashboardRequest +from influxdb_client.domain.custom_check import CustomCheck as CustomCheck +from influxdb_client.domain.dashboard import Dashboard as Dashboard +from influxdb_client.domain.dashboard_color import DashboardColor as DashboardColor +from influxdb_client.domain.dashboard_query import DashboardQuery as DashboardQuery +from influxdb_client.domain.dashboard_with_view_properties import DashboardWithViewProperties as DashboardWithViewProperties +from influxdb_client.domain.dashboards import Dashboards as Dashboards +from influxdb_client.domain.date_time_literal import DateTimeLiteral as DateTimeLiteral +from influxdb_client.domain.dbr_ps import DBRPs as DBRPs +from influxdb_client.domain.dbrp import DBRP as DBRP +from influxdb_client.domain.dbrp_create import DBRPCreate as DBRPCreate +from influxdb_client.domain.dbrp_get import DBRPGet as DBRPGet +from influxdb_client.domain.dbrp_update import DBRPUpdate as DBRPUpdate +from influxdb_client.domain.deadman_check import DeadmanCheck as DeadmanCheck +from influxdb_client.domain.decimal_places import DecimalPlaces as DecimalPlaces +from influxdb_client.domain.delete_predicate_request import DeletePredicateRequest as DeletePredicateRequest +from influxdb_client.domain.dialect import Dialect as Dialect +from influxdb_client.domain.dict_expression import DictExpression as DictExpression +from influxdb_client.domain.dict_item import DictItem as DictItem +from influxdb_client.domain.duration import Duration as Duration +from influxdb_client.domain.duration_literal import DurationLiteral as DurationLiteral +from influxdb_client.domain.error import Error as Error +from influxdb_client.domain.expression import Expression as Expression +from influxdb_client.domain.expression_statement import ExpressionStatement as ExpressionStatement +from influxdb_client.domain.field import Field as Field +from influxdb_client.domain.file import File as File +from influxdb_client.domain.float_literal import FloatLiteral as FloatLiteral +from influxdb_client.domain.flux_response import FluxResponse as FluxResponse +from influxdb_client.domain.flux_suggestion import FluxSuggestion as FluxSuggestion +from influxdb_client.domain.flux_suggestions import FluxSuggestions as FluxSuggestions +from influxdb_client.domain.function_expression import FunctionExpression as FunctionExpression +from influxdb_client.domain.gauge_view_properties import GaugeViewProperties as GaugeViewProperties +from influxdb_client.domain.greater_threshold import GreaterThreshold as GreaterThreshold +from influxdb_client.domain.health_check import HealthCheck as HealthCheck +from influxdb_client.domain.heatmap_view_properties import HeatmapViewProperties as HeatmapViewProperties +from influxdb_client.domain.histogram_view_properties import HistogramViewProperties as HistogramViewProperties +from influxdb_client.domain.http_notification_endpoint import HTTPNotificationEndpoint as HTTPNotificationEndpoint +from influxdb_client.domain.http_notification_rule import HTTPNotificationRule as HTTPNotificationRule +from influxdb_client.domain.http_notification_rule_base import HTTPNotificationRuleBase as HTTPNotificationRuleBase +from influxdb_client.domain.identifier import Identifier as Identifier +from influxdb_client.domain.import_declaration import ImportDeclaration as ImportDeclaration +from influxdb_client.domain.index_expression import IndexExpression as IndexExpression +from influxdb_client.domain.integer_literal import IntegerLiteral as IntegerLiteral +from influxdb_client.domain.is_onboarding import IsOnboarding as IsOnboarding +from influxdb_client.domain.label import Label as Label +from influxdb_client.domain.label_create_request import LabelCreateRequest as LabelCreateRequest +from influxdb_client.domain.label_mapping import LabelMapping as LabelMapping +from influxdb_client.domain.label_response import LabelResponse as LabelResponse +from influxdb_client.domain.label_update import LabelUpdate as LabelUpdate +from influxdb_client.domain.labels_response import LabelsResponse as LabelsResponse +from influxdb_client.domain.language_request import LanguageRequest as LanguageRequest +from influxdb_client.domain.legacy_authorization_post_request import ( + LegacyAuthorizationPostRequest as LegacyAuthorizationPostRequest, +) +from influxdb_client.domain.lesser_threshold import LesserThreshold as LesserThreshold +from influxdb_client.domain.line_plus_single_stat_properties import LinePlusSingleStatProperties as LinePlusSingleStatProperties +from influxdb_client.domain.line_protocol_error import LineProtocolError as LineProtocolError +from influxdb_client.domain.line_protocol_length_error import LineProtocolLengthError as LineProtocolLengthError +from influxdb_client.domain.links import Links as Links +from influxdb_client.domain.list_stacks_response import ListStacksResponse as ListStacksResponse +from influxdb_client.domain.log_event import LogEvent as LogEvent +from influxdb_client.domain.logical_expression import LogicalExpression as LogicalExpression +from influxdb_client.domain.logs import Logs as Logs +from influxdb_client.domain.map_variable_properties import MapVariableProperties as MapVariableProperties +from influxdb_client.domain.markdown_view_properties import MarkdownViewProperties as MarkdownViewProperties +from influxdb_client.domain.measurement_schema import MeasurementSchema as MeasurementSchema +from influxdb_client.domain.measurement_schema_column import MeasurementSchemaColumn as MeasurementSchemaColumn +from influxdb_client.domain.measurement_schema_create_request import ( + MeasurementSchemaCreateRequest as MeasurementSchemaCreateRequest, +) +from influxdb_client.domain.measurement_schema_list import MeasurementSchemaList as MeasurementSchemaList +from influxdb_client.domain.measurement_schema_update_request import ( + MeasurementSchemaUpdateRequest as MeasurementSchemaUpdateRequest, +) +from influxdb_client.domain.member_assignment import MemberAssignment as MemberAssignment +from influxdb_client.domain.member_expression import MemberExpression as MemberExpression +from influxdb_client.domain.metadata_backup import MetadataBackup as MetadataBackup +from influxdb_client.domain.model_property import ModelProperty as ModelProperty +from influxdb_client.domain.mosaic_view_properties import MosaicViewProperties as MosaicViewProperties +from influxdb_client.domain.node import Node as Node +from influxdb_client.domain.notification_endpoint import NotificationEndpoint as NotificationEndpoint +from influxdb_client.domain.notification_endpoint_base import NotificationEndpointBase as NotificationEndpointBase +from influxdb_client.domain.notification_endpoint_base_links import NotificationEndpointBaseLinks as NotificationEndpointBaseLinks +from influxdb_client.domain.notification_endpoint_discriminator import ( + NotificationEndpointDiscriminator as NotificationEndpointDiscriminator, +) +from influxdb_client.domain.notification_endpoint_type import NotificationEndpointType as NotificationEndpointType +from influxdb_client.domain.notification_endpoint_update import NotificationEndpointUpdate as NotificationEndpointUpdate +from influxdb_client.domain.notification_endpoints import NotificationEndpoints as NotificationEndpoints +from influxdb_client.domain.notification_rule import NotificationRule as NotificationRule +from influxdb_client.domain.notification_rule_base import NotificationRuleBase as NotificationRuleBase +from influxdb_client.domain.notification_rule_base_links import NotificationRuleBaseLinks as NotificationRuleBaseLinks +from influxdb_client.domain.notification_rule_discriminator import NotificationRuleDiscriminator as NotificationRuleDiscriminator +from influxdb_client.domain.notification_rule_update import NotificationRuleUpdate as NotificationRuleUpdate +from influxdb_client.domain.notification_rules import NotificationRules as NotificationRules +from influxdb_client.domain.object_expression import ObjectExpression as ObjectExpression +from influxdb_client.domain.onboarding_request import OnboardingRequest as OnboardingRequest +from influxdb_client.domain.onboarding_response import OnboardingResponse as OnboardingResponse +from influxdb_client.domain.option_statement import OptionStatement as OptionStatement +from influxdb_client.domain.organization import Organization as Organization +from influxdb_client.domain.organization_links import OrganizationLinks as OrganizationLinks +from influxdb_client.domain.organizations import Organizations as Organizations +from influxdb_client.domain.package import Package as Package +from influxdb_client.domain.package_clause import PackageClause as PackageClause +from influxdb_client.domain.pager_duty_notification_endpoint import PagerDutyNotificationEndpoint as PagerDutyNotificationEndpoint +from influxdb_client.domain.pager_duty_notification_rule import PagerDutyNotificationRule as PagerDutyNotificationRule +from influxdb_client.domain.pager_duty_notification_rule_base import ( + PagerDutyNotificationRuleBase as PagerDutyNotificationRuleBase, +) +from influxdb_client.domain.paren_expression import ParenExpression as ParenExpression +from influxdb_client.domain.password_reset_body import PasswordResetBody as PasswordResetBody +from influxdb_client.domain.patch_bucket_request import PatchBucketRequest as PatchBucketRequest +from influxdb_client.domain.patch_dashboard_request import PatchDashboardRequest as PatchDashboardRequest +from influxdb_client.domain.patch_organization_request import PatchOrganizationRequest as PatchOrganizationRequest +from influxdb_client.domain.patch_retention_rule import PatchRetentionRule as PatchRetentionRule +from influxdb_client.domain.patch_stack_request import PatchStackRequest as PatchStackRequest +from influxdb_client.domain.patch_stack_request_additional_resources import ( + PatchStackRequestAdditionalResources as PatchStackRequestAdditionalResources, +) +from influxdb_client.domain.permission import Permission as Permission +from influxdb_client.domain.permission_resource import PermissionResource as PermissionResource +from influxdb_client.domain.pipe_expression import PipeExpression as PipeExpression +from influxdb_client.domain.pipe_literal import PipeLiteral as PipeLiteral +from influxdb_client.domain.post_bucket_request import PostBucketRequest as PostBucketRequest +from influxdb_client.domain.post_check import PostCheck as PostCheck +from influxdb_client.domain.post_notification_endpoint import PostNotificationEndpoint as PostNotificationEndpoint +from influxdb_client.domain.post_notification_rule import PostNotificationRule as PostNotificationRule +from influxdb_client.domain.post_organization_request import PostOrganizationRequest as PostOrganizationRequest +from influxdb_client.domain.post_restore_kv_response import PostRestoreKVResponse as PostRestoreKVResponse +from influxdb_client.domain.post_stack_request import PostStackRequest as PostStackRequest +from influxdb_client.domain.property_key import PropertyKey as PropertyKey +from influxdb_client.domain.query import Query as Query +from influxdb_client.domain.query_edit_mode import QueryEditMode as QueryEditMode +from influxdb_client.domain.query_variable_properties import QueryVariableProperties as QueryVariableProperties +from influxdb_client.domain.query_variable_properties_values import QueryVariablePropertiesValues as QueryVariablePropertiesValues +from influxdb_client.domain.range_threshold import RangeThreshold as RangeThreshold +from influxdb_client.domain.ready import Ready as Ready +from influxdb_client.domain.regexp_literal import RegexpLiteral as RegexpLiteral +from influxdb_client.domain.remote_connection import RemoteConnection as RemoteConnection +from influxdb_client.domain.remote_connection_creation_request import ( + RemoteConnectionCreationRequest as RemoteConnectionCreationRequest, +) +from influxdb_client.domain.remote_connection_update_request import RemoteConnectionUpdateRequest as RemoteConnectionUpdateRequest +from influxdb_client.domain.remote_connections import RemoteConnections as RemoteConnections +from influxdb_client.domain.renamable_field import RenamableField as RenamableField +from influxdb_client.domain.replication import Replication as Replication +from influxdb_client.domain.replication_creation_request import ReplicationCreationRequest as ReplicationCreationRequest +from influxdb_client.domain.replication_update_request import ReplicationUpdateRequest as ReplicationUpdateRequest +from influxdb_client.domain.replications import Replications as Replications +from influxdb_client.domain.resource_member import ResourceMember as ResourceMember +from influxdb_client.domain.resource_members import ResourceMembers as ResourceMembers +from influxdb_client.domain.resource_members_links import ResourceMembersLinks as ResourceMembersLinks +from influxdb_client.domain.resource_owner import ResourceOwner as ResourceOwner +from influxdb_client.domain.resource_owners import ResourceOwners as ResourceOwners +from influxdb_client.domain.restored_bucket_mappings import RestoredBucketMappings as RestoredBucketMappings +from influxdb_client.domain.retention_policy_manifest import RetentionPolicyManifest as RetentionPolicyManifest +from influxdb_client.domain.return_statement import ReturnStatement as ReturnStatement +from influxdb_client.domain.routes import Routes as Routes +from influxdb_client.domain.routes_external import RoutesExternal as RoutesExternal +from influxdb_client.domain.routes_query import RoutesQuery as RoutesQuery +from influxdb_client.domain.routes_system import RoutesSystem as RoutesSystem +from influxdb_client.domain.rule_status_level import RuleStatusLevel as RuleStatusLevel +from influxdb_client.domain.run import Run as Run +from influxdb_client.domain.run_links import RunLinks as RunLinks +from influxdb_client.domain.run_manually import RunManually as RunManually +from influxdb_client.domain.runs import Runs as Runs +from influxdb_client.domain.scatter_view_properties import ScatterViewProperties as ScatterViewProperties +from influxdb_client.domain.schema_type import SchemaType as SchemaType +from influxdb_client.domain.scraper_target_request import ScraperTargetRequest as ScraperTargetRequest +from influxdb_client.domain.scraper_target_response import ScraperTargetResponse as ScraperTargetResponse +from influxdb_client.domain.scraper_target_responses import ScraperTargetResponses as ScraperTargetResponses +from influxdb_client.domain.script import Script as Script +from influxdb_client.domain.script_create_request import ScriptCreateRequest as ScriptCreateRequest +from influxdb_client.domain.script_invocation_params import ScriptInvocationParams as ScriptInvocationParams +from influxdb_client.domain.script_language import ScriptLanguage as ScriptLanguage +from influxdb_client.domain.script_update_request import ScriptUpdateRequest as ScriptUpdateRequest +from influxdb_client.domain.scripts import Scripts as Scripts +from influxdb_client.domain.secret_keys import SecretKeys as SecretKeys +from influxdb_client.domain.secret_keys_response import SecretKeysResponse as SecretKeysResponse +from influxdb_client.domain.shard_group_manifest import ShardGroupManifest as ShardGroupManifest +from influxdb_client.domain.shard_manifest import ShardManifest as ShardManifest +from influxdb_client.domain.shard_owner import ShardOwner as ShardOwner +from influxdb_client.domain.simple_table_view_properties import SimpleTableViewProperties as SimpleTableViewProperties +from influxdb_client.domain.single_stat_view_properties import SingleStatViewProperties as SingleStatViewProperties +from influxdb_client.domain.slack_notification_endpoint import SlackNotificationEndpoint as SlackNotificationEndpoint +from influxdb_client.domain.slack_notification_rule import SlackNotificationRule as SlackNotificationRule +from influxdb_client.domain.slack_notification_rule_base import SlackNotificationRuleBase as SlackNotificationRuleBase +from influxdb_client.domain.smtp_notification_rule import SMTPNotificationRule as SMTPNotificationRule +from influxdb_client.domain.smtp_notification_rule_base import SMTPNotificationRuleBase as SMTPNotificationRuleBase +from influxdb_client.domain.source import Source as Source +from influxdb_client.domain.source_links import SourceLinks as SourceLinks +from influxdb_client.domain.sources import Sources as Sources +from influxdb_client.domain.stack import Stack as Stack +from influxdb_client.domain.stack_associations import StackAssociations as StackAssociations +from influxdb_client.domain.stack_events import StackEvents as StackEvents +from influxdb_client.domain.stack_links import StackLinks as StackLinks +from influxdb_client.domain.stack_resources import StackResources as StackResources +from influxdb_client.domain.statement import Statement as Statement +from influxdb_client.domain.static_legend import StaticLegend as StaticLegend +from influxdb_client.domain.status_rule import StatusRule as StatusRule +from influxdb_client.domain.string_literal import StringLiteral as StringLiteral +from influxdb_client.domain.subscription_manifest import SubscriptionManifest as SubscriptionManifest +from influxdb_client.domain.table_view_properties import TableViewProperties as TableViewProperties +from influxdb_client.domain.table_view_properties_table_options import ( + TableViewPropertiesTableOptions as TableViewPropertiesTableOptions, +) +from influxdb_client.domain.tag_rule import TagRule as TagRule +from influxdb_client.domain.task import Task as Task +from influxdb_client.domain.task_create_request import TaskCreateRequest as TaskCreateRequest +from influxdb_client.domain.task_links import TaskLinks as TaskLinks +from influxdb_client.domain.task_status_type import TaskStatusType as TaskStatusType +from influxdb_client.domain.task_update_request import TaskUpdateRequest as TaskUpdateRequest +from influxdb_client.domain.tasks import Tasks as Tasks +from influxdb_client.domain.telegraf import Telegraf as Telegraf +from influxdb_client.domain.telegraf_plugin import TelegrafPlugin as TelegrafPlugin +from influxdb_client.domain.telegraf_plugin_request import TelegrafPluginRequest as TelegrafPluginRequest +from influxdb_client.domain.telegraf_plugin_request_plugins import TelegrafPluginRequestPlugins as TelegrafPluginRequestPlugins +from influxdb_client.domain.telegraf_plugins import TelegrafPlugins as TelegrafPlugins +from influxdb_client.domain.telegraf_request import TelegrafRequest as TelegrafRequest +from influxdb_client.domain.telegraf_request_metadata import TelegrafRequestMetadata as TelegrafRequestMetadata +from influxdb_client.domain.telegrafs import Telegrafs as Telegrafs +from influxdb_client.domain.telegram_notification_endpoint import TelegramNotificationEndpoint as TelegramNotificationEndpoint +from influxdb_client.domain.telegram_notification_rule import TelegramNotificationRule as TelegramNotificationRule +from influxdb_client.domain.telegram_notification_rule_base import TelegramNotificationRuleBase as TelegramNotificationRuleBase +from influxdb_client.domain.template_apply import TemplateApply as TemplateApply +from influxdb_client.domain.template_apply_remotes import TemplateApplyRemotes as TemplateApplyRemotes +from influxdb_client.domain.template_apply_template import TemplateApplyTemplate as TemplateApplyTemplate +from influxdb_client.domain.template_chart import TemplateChart as TemplateChart +from influxdb_client.domain.template_export_by_id import TemplateExportByID as TemplateExportByID +from influxdb_client.domain.template_export_by_id_org_ids import TemplateExportByIDOrgIDs as TemplateExportByIDOrgIDs +from influxdb_client.domain.template_export_by_id_resource_filters import ( + TemplateExportByIDResourceFilters as TemplateExportByIDResourceFilters, +) +from influxdb_client.domain.template_export_by_id_resources import TemplateExportByIDResources as TemplateExportByIDResources +from influxdb_client.domain.template_export_by_name import TemplateExportByName as TemplateExportByName +from influxdb_client.domain.template_export_by_name_resources import ( + TemplateExportByNameResources as TemplateExportByNameResources, +) +from influxdb_client.domain.template_kind import TemplateKind as TemplateKind +from influxdb_client.domain.template_summary import TemplateSummary as TemplateSummary +from influxdb_client.domain.template_summary_diff import TemplateSummaryDiff as TemplateSummaryDiff +from influxdb_client.domain.template_summary_diff_buckets import TemplateSummaryDiffBuckets as TemplateSummaryDiffBuckets +from influxdb_client.domain.template_summary_diff_buckets_new_old import ( + TemplateSummaryDiffBucketsNewOld as TemplateSummaryDiffBucketsNewOld, +) +from influxdb_client.domain.template_summary_diff_checks import TemplateSummaryDiffChecks as TemplateSummaryDiffChecks +from influxdb_client.domain.template_summary_diff_dashboards import TemplateSummaryDiffDashboards as TemplateSummaryDiffDashboards +from influxdb_client.domain.template_summary_diff_dashboards_new_old import ( + TemplateSummaryDiffDashboardsNewOld as TemplateSummaryDiffDashboardsNewOld, +) +from influxdb_client.domain.template_summary_diff_label_mappings import ( + TemplateSummaryDiffLabelMappings as TemplateSummaryDiffLabelMappings, +) +from influxdb_client.domain.template_summary_diff_labels import TemplateSummaryDiffLabels as TemplateSummaryDiffLabels +from influxdb_client.domain.template_summary_diff_labels_new_old import ( + TemplateSummaryDiffLabelsNewOld as TemplateSummaryDiffLabelsNewOld, +) +from influxdb_client.domain.template_summary_diff_notification_endpoints import ( + TemplateSummaryDiffNotificationEndpoints as TemplateSummaryDiffNotificationEndpoints, +) +from influxdb_client.domain.template_summary_diff_notification_rules import ( + TemplateSummaryDiffNotificationRules as TemplateSummaryDiffNotificationRules, +) +from influxdb_client.domain.template_summary_diff_notification_rules_new_old import ( + TemplateSummaryDiffNotificationRulesNewOld as TemplateSummaryDiffNotificationRulesNewOld, +) +from influxdb_client.domain.template_summary_diff_tasks import TemplateSummaryDiffTasks as TemplateSummaryDiffTasks +from influxdb_client.domain.template_summary_diff_tasks_new_old import ( + TemplateSummaryDiffTasksNewOld as TemplateSummaryDiffTasksNewOld, +) +from influxdb_client.domain.template_summary_diff_telegraf_configs import ( + TemplateSummaryDiffTelegrafConfigs as TemplateSummaryDiffTelegrafConfigs, +) +from influxdb_client.domain.template_summary_diff_variables import TemplateSummaryDiffVariables as TemplateSummaryDiffVariables +from influxdb_client.domain.template_summary_diff_variables_new_old import ( + TemplateSummaryDiffVariablesNewOld as TemplateSummaryDiffVariablesNewOld, +) +from influxdb_client.domain.template_summary_errors import TemplateSummaryErrors as TemplateSummaryErrors +from influxdb_client.domain.template_summary_label import TemplateSummaryLabel as TemplateSummaryLabel +from influxdb_client.domain.template_summary_label_properties import ( + TemplateSummaryLabelProperties as TemplateSummaryLabelProperties, +) +from influxdb_client.domain.template_summary_summary import TemplateSummarySummary as TemplateSummarySummary +from influxdb_client.domain.template_summary_summary_buckets import TemplateSummarySummaryBuckets as TemplateSummarySummaryBuckets +from influxdb_client.domain.template_summary_summary_dashboards import ( + TemplateSummarySummaryDashboards as TemplateSummarySummaryDashboards, +) +from influxdb_client.domain.template_summary_summary_label_mappings import ( + TemplateSummarySummaryLabelMappings as TemplateSummarySummaryLabelMappings, +) +from influxdb_client.domain.template_summary_summary_notification_rules import ( + TemplateSummarySummaryNotificationRules as TemplateSummarySummaryNotificationRules, +) +from influxdb_client.domain.template_summary_summary_status_rules import ( + TemplateSummarySummaryStatusRules as TemplateSummarySummaryStatusRules, +) +from influxdb_client.domain.template_summary_summary_tag_rules import ( + TemplateSummarySummaryTagRules as TemplateSummarySummaryTagRules, +) +from influxdb_client.domain.template_summary_summary_tasks import TemplateSummarySummaryTasks as TemplateSummarySummaryTasks +from influxdb_client.domain.template_summary_summary_variables import ( + TemplateSummarySummaryVariables as TemplateSummarySummaryVariables, +) +from influxdb_client.domain.test_statement import TestStatement as TestStatement +from influxdb_client.domain.threshold import Threshold as Threshold +from influxdb_client.domain.threshold_base import ThresholdBase as ThresholdBase +from influxdb_client.domain.threshold_check import ThresholdCheck as ThresholdCheck +from influxdb_client.domain.unary_expression import UnaryExpression as UnaryExpression +from influxdb_client.domain.unsigned_integer_literal import UnsignedIntegerLiteral as UnsignedIntegerLiteral +from influxdb_client.domain.user import User as User +from influxdb_client.domain.user_response import UserResponse as UserResponse +from influxdb_client.domain.user_response_links import UserResponseLinks as UserResponseLinks +from influxdb_client.domain.users import Users as Users +from influxdb_client.domain.variable import Variable as Variable +from influxdb_client.domain.variable_assignment import VariableAssignment as VariableAssignment +from influxdb_client.domain.variable_links import VariableLinks as VariableLinks +from influxdb_client.domain.variable_properties import VariableProperties as VariableProperties +from influxdb_client.domain.variables import Variables as Variables +from influxdb_client.domain.view import View as View +from influxdb_client.domain.view_links import ViewLinks as ViewLinks +from influxdb_client.domain.view_properties import ViewProperties as ViewProperties +from influxdb_client.domain.views import Views as Views +from influxdb_client.domain.write_precision import WritePrecision as WritePrecision +from influxdb_client.domain.xy_geom import XYGeom as XYGeom +from influxdb_client.domain.xy_view_properties import XYViewProperties as XYViewProperties diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/add_resource_member_request_body.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/add_resource_member_request_body.pyi new file mode 100644 index 000000000..5632abf96 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/add_resource_member_request_body.pyi @@ -0,0 +1,19 @@ +from _typeshed import Incomplete + +class AddResourceMemberRequestBody: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, id: Incomplete | None = ..., name: Incomplete | None = ...) -> None: ... + @property + def id(self): ... + @id.setter + def id(self, id) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/analyze_query_response.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/analyze_query_response.pyi new file mode 100644 index 000000000..2736b432e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/analyze_query_response.pyi @@ -0,0 +1,15 @@ +from _typeshed import Incomplete + +class AnalyzeQueryResponse: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, errors: Incomplete | None = ...) -> None: ... + @property + def errors(self): ... + @errors.setter + def errors(self, errors) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/analyze_query_response_errors.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/analyze_query_response_errors.pyi new file mode 100644 index 000000000..6f1078328 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/analyze_query_response_errors.pyi @@ -0,0 +1,33 @@ +from _typeshed import Incomplete + +class AnalyzeQueryResponseErrors: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + line: Incomplete | None = ..., + column: Incomplete | None = ..., + character: Incomplete | None = ..., + message: Incomplete | None = ..., + ) -> None: ... + @property + def line(self): ... + @line.setter + def line(self, line) -> None: ... + @property + def column(self): ... + @column.setter + def column(self, column) -> None: ... + @property + def character(self): ... + @character.setter + def character(self, character) -> None: ... + @property + def message(self): ... + @message.setter + def message(self, message) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/array_expression.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/array_expression.pyi new file mode 100644 index 000000000..8d1a6cb10 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/array_expression.pyi @@ -0,0 +1,21 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.expression import Expression + +class ArrayExpression(Expression): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, type: Incomplete | None = ..., elements: Incomplete | None = ...) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def elements(self): ... + @elements.setter + def elements(self, elements) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/ast_response.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/ast_response.pyi new file mode 100644 index 000000000..586efd22e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/ast_response.pyi @@ -0,0 +1,15 @@ +from _typeshed import Incomplete + +class ASTResponse: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, ast: Incomplete | None = ...) -> None: ... + @property + def ast(self): ... + @ast.setter + def ast(self, ast) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/authorization.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/authorization.pyi new file mode 100644 index 000000000..b8afa636c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/authorization.pyi @@ -0,0 +1,67 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.authorization_update_request import AuthorizationUpdateRequest + +class Authorization(AuthorizationUpdateRequest): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + created_at: Incomplete | None = ..., + updated_at: Incomplete | None = ..., + org_id: Incomplete | None = ..., + permissions: Incomplete | None = ..., + id: Incomplete | None = ..., + token: Incomplete | None = ..., + user_id: Incomplete | None = ..., + user: Incomplete | None = ..., + org: Incomplete | None = ..., + links: Incomplete | None = ..., + status: str = ..., + description: Incomplete | None = ..., + ) -> None: ... + @property + def created_at(self): ... + @created_at.setter + def created_at(self, created_at) -> None: ... + @property + def updated_at(self): ... + @updated_at.setter + def updated_at(self, updated_at) -> None: ... + @property + def org_id(self): ... + @org_id.setter + def org_id(self, org_id) -> None: ... + @property + def permissions(self): ... + @permissions.setter + def permissions(self, permissions) -> None: ... + @property + def id(self): ... + @id.setter + def id(self, id) -> None: ... + @property + def token(self): ... + @token.setter + def token(self, token) -> None: ... + @property + def user_id(self): ... + @user_id.setter + def user_id(self, user_id) -> None: ... + @property + def user(self): ... + @user.setter + def user(self, user) -> None: ... + @property + def org(self): ... + @org.setter + def org(self, org) -> None: ... + @property + def links(self): ... + @links.setter + def links(self, links) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/authorization_post_request.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/authorization_post_request.pyi new file mode 100644 index 000000000..98afba0f1 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/authorization_post_request.pyi @@ -0,0 +1,32 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.authorization_update_request import AuthorizationUpdateRequest + +class AuthorizationPostRequest(AuthorizationUpdateRequest): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + org_id: Incomplete | None = ..., + user_id: Incomplete | None = ..., + permissions: Incomplete | None = ..., + status: str = ..., + description: Incomplete | None = ..., + ) -> None: ... + @property + def org_id(self): ... + @org_id.setter + def org_id(self, org_id) -> None: ... + @property + def user_id(self): ... + @user_id.setter + def user_id(self, user_id) -> None: ... + @property + def permissions(self): ... + @permissions.setter + def permissions(self, permissions) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/authorization_update_request.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/authorization_update_request.pyi new file mode 100644 index 000000000..e6b69b75c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/authorization_update_request.pyi @@ -0,0 +1,19 @@ +from _typeshed import Incomplete + +class AuthorizationUpdateRequest: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, status: str = ..., description: Incomplete | None = ...) -> None: ... + @property + def status(self): ... + @status.setter + def status(self, status) -> None: ... + @property + def description(self): ... + @description.setter + def description(self, description) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/authorizations.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/authorizations.pyi new file mode 100644 index 000000000..1da35137d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/authorizations.pyi @@ -0,0 +1,19 @@ +from _typeshed import Incomplete + +class Authorizations: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, links: Incomplete | None = ..., authorizations: Incomplete | None = ...) -> None: ... + @property + def links(self): ... + @links.setter + def links(self, links) -> None: ... + @property + def authorizations(self): ... + @authorizations.setter + def authorizations(self, authorizations) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/axes.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/axes.pyi new file mode 100644 index 000000000..73989df62 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/axes.pyi @@ -0,0 +1,19 @@ +from _typeshed import Incomplete + +class Axes: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, x: Incomplete | None = ..., y: Incomplete | None = ...) -> None: ... + @property + def x(self): ... + @x.setter + def x(self, x) -> None: ... + @property + def y(self): ... + @y.setter + def y(self, y) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/axis.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/axis.pyi new file mode 100644 index 000000000..0c487a22e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/axis.pyi @@ -0,0 +1,43 @@ +from _typeshed import Incomplete + +class Axis: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + bounds: Incomplete | None = ..., + label: Incomplete | None = ..., + prefix: Incomplete | None = ..., + suffix: Incomplete | None = ..., + base: Incomplete | None = ..., + scale: Incomplete | None = ..., + ) -> None: ... + @property + def bounds(self): ... + @bounds.setter + def bounds(self, bounds) -> None: ... + @property + def label(self): ... + @label.setter + def label(self, label) -> None: ... + @property + def prefix(self): ... + @prefix.setter + def prefix(self, prefix) -> None: ... + @property + def suffix(self): ... + @suffix.setter + def suffix(self, suffix) -> None: ... + @property + def base(self): ... + @base.setter + def base(self, base) -> None: ... + @property + def scale(self): ... + @scale.setter + def scale(self, scale) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/axis_scale.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/axis_scale.pyi new file mode 100644 index 000000000..765352aec --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/axis_scale.pyi @@ -0,0 +1,12 @@ +from _typeshed import Incomplete + +class AxisScale: + LOG: str + LINEAR: str + openapi_types: Incomplete + attribute_map: Incomplete + def __init__(self) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/bad_statement.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/bad_statement.pyi new file mode 100644 index 000000000..306ee23bd --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/bad_statement.pyi @@ -0,0 +1,21 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.statement import Statement + +class BadStatement(Statement): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, type: Incomplete | None = ..., text: Incomplete | None = ...) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def text(self): ... + @text.setter + def text(self, text) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/band_view_properties.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/band_view_properties.pyi new file mode 100644 index 000000000..d39485916 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/band_view_properties.pyi @@ -0,0 +1,155 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.view_properties import ViewProperties + +class BandViewProperties(ViewProperties): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + time_format: Incomplete | None = ..., + type: Incomplete | None = ..., + queries: Incomplete | None = ..., + colors: Incomplete | None = ..., + shape: Incomplete | None = ..., + note: Incomplete | None = ..., + show_note_when_empty: Incomplete | None = ..., + axes: Incomplete | None = ..., + static_legend: Incomplete | None = ..., + x_column: Incomplete | None = ..., + generate_x_axis_ticks: Incomplete | None = ..., + x_total_ticks: Incomplete | None = ..., + x_tick_start: Incomplete | None = ..., + x_tick_step: Incomplete | None = ..., + y_column: Incomplete | None = ..., + generate_y_axis_ticks: Incomplete | None = ..., + y_total_ticks: Incomplete | None = ..., + y_tick_start: Incomplete | None = ..., + y_tick_step: Incomplete | None = ..., + upper_column: Incomplete | None = ..., + main_column: Incomplete | None = ..., + lower_column: Incomplete | None = ..., + hover_dimension: Incomplete | None = ..., + geom: Incomplete | None = ..., + legend_colorize_rows: Incomplete | None = ..., + legend_hide: Incomplete | None = ..., + legend_opacity: Incomplete | None = ..., + legend_orientation_threshold: Incomplete | None = ..., + ) -> None: ... + @property + def time_format(self): ... + @time_format.setter + def time_format(self, time_format) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def queries(self): ... + @queries.setter + def queries(self, queries) -> None: ... + @property + def colors(self): ... + @colors.setter + def colors(self, colors) -> None: ... + @property + def shape(self): ... + @shape.setter + def shape(self, shape) -> None: ... + @property + def note(self): ... + @note.setter + def note(self, note) -> None: ... + @property + def show_note_when_empty(self): ... + @show_note_when_empty.setter + def show_note_when_empty(self, show_note_when_empty) -> None: ... + @property + def axes(self): ... + @axes.setter + def axes(self, axes) -> None: ... + @property + def static_legend(self): ... + @static_legend.setter + def static_legend(self, static_legend) -> None: ... + @property + def x_column(self): ... + @x_column.setter + def x_column(self, x_column) -> None: ... + @property + def generate_x_axis_ticks(self): ... + @generate_x_axis_ticks.setter + def generate_x_axis_ticks(self, generate_x_axis_ticks) -> None: ... + @property + def x_total_ticks(self): ... + @x_total_ticks.setter + def x_total_ticks(self, x_total_ticks) -> None: ... + @property + def x_tick_start(self): ... + @x_tick_start.setter + def x_tick_start(self, x_tick_start) -> None: ... + @property + def x_tick_step(self): ... + @x_tick_step.setter + def x_tick_step(self, x_tick_step) -> None: ... + @property + def y_column(self): ... + @y_column.setter + def y_column(self, y_column) -> None: ... + @property + def generate_y_axis_ticks(self): ... + @generate_y_axis_ticks.setter + def generate_y_axis_ticks(self, generate_y_axis_ticks) -> None: ... + @property + def y_total_ticks(self): ... + @y_total_ticks.setter + def y_total_ticks(self, y_total_ticks) -> None: ... + @property + def y_tick_start(self): ... + @y_tick_start.setter + def y_tick_start(self, y_tick_start) -> None: ... + @property + def y_tick_step(self): ... + @y_tick_step.setter + def y_tick_step(self, y_tick_step) -> None: ... + @property + def upper_column(self): ... + @upper_column.setter + def upper_column(self, upper_column) -> None: ... + @property + def main_column(self): ... + @main_column.setter + def main_column(self, main_column) -> None: ... + @property + def lower_column(self): ... + @lower_column.setter + def lower_column(self, lower_column) -> None: ... + @property + def hover_dimension(self): ... + @hover_dimension.setter + def hover_dimension(self, hover_dimension) -> None: ... + @property + def geom(self): ... + @geom.setter + def geom(self, geom) -> None: ... + @property + def legend_colorize_rows(self): ... + @legend_colorize_rows.setter + def legend_colorize_rows(self, legend_colorize_rows) -> None: ... + @property + def legend_hide(self): ... + @legend_hide.setter + def legend_hide(self, legend_hide) -> None: ... + @property + def legend_opacity(self): ... + @legend_opacity.setter + def legend_opacity(self, legend_opacity) -> None: ... + @property + def legend_orientation_threshold(self): ... + @legend_orientation_threshold.setter + def legend_orientation_threshold(self, legend_orientation_threshold) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/binary_expression.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/binary_expression.pyi new file mode 100644 index 000000000..cfb13da0a --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/binary_expression.pyi @@ -0,0 +1,35 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.expression import Expression + +class BinaryExpression(Expression): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + type: Incomplete | None = ..., + operator: Incomplete | None = ..., + left: Incomplete | None = ..., + right: Incomplete | None = ..., + ) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def operator(self): ... + @operator.setter + def operator(self, operator) -> None: ... + @property + def left(self): ... + @left.setter + def left(self, left) -> None: ... + @property + def right(self): ... + @right.setter + def right(self, right) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/block.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/block.pyi new file mode 100644 index 000000000..48a29bd26 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/block.pyi @@ -0,0 +1,21 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.node import Node + +class Block(Node): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, type: Incomplete | None = ..., body: Incomplete | None = ...) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def body(self): ... + @body.setter + def body(self, body) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/boolean_literal.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/boolean_literal.pyi new file mode 100644 index 000000000..cea20b466 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/boolean_literal.pyi @@ -0,0 +1,21 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.expression import Expression + +class BooleanLiteral(Expression): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, type: Incomplete | None = ..., value: Incomplete | None = ...) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def value(self): ... + @value.setter + def value(self, value) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/bucket.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/bucket.pyi new file mode 100644 index 000000000..1cb791172 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/bucket.pyi @@ -0,0 +1,73 @@ +from _typeshed import Incomplete + +class Bucket: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + links: Incomplete | None = ..., + id: Incomplete | None = ..., + type: str = ..., + name: Incomplete | None = ..., + description: Incomplete | None = ..., + org_id: Incomplete | None = ..., + rp: Incomplete | None = ..., + schema_type: Incomplete | None = ..., + created_at: Incomplete | None = ..., + updated_at: Incomplete | None = ..., + retention_rules: Incomplete | None = ..., + labels: Incomplete | None = ..., + ) -> None: ... + @property + def links(self): ... + @links.setter + def links(self, links) -> None: ... + @property + def id(self): ... + @id.setter + def id(self, id) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def description(self): ... + @description.setter + def description(self, description) -> None: ... + @property + def org_id(self): ... + @org_id.setter + def org_id(self, org_id) -> None: ... + @property + def rp(self): ... + @rp.setter + def rp(self, rp) -> None: ... + @property + def schema_type(self): ... + @schema_type.setter + def schema_type(self, schema_type) -> None: ... + @property + def created_at(self): ... + @created_at.setter + def created_at(self, created_at) -> None: ... + @property + def updated_at(self): ... + @updated_at.setter + def updated_at(self, updated_at) -> None: ... + @property + def retention_rules(self): ... + @retention_rules.setter + def retention_rules(self, retention_rules) -> None: ... + @property + def labels(self): ... + @labels.setter + def labels(self, labels) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/bucket_links.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/bucket_links.pyi new file mode 100644 index 000000000..ace2e00db --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/bucket_links.pyi @@ -0,0 +1,39 @@ +from _typeshed import Incomplete + +class BucketLinks: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + labels: Incomplete | None = ..., + members: Incomplete | None = ..., + org: Incomplete | None = ..., + owners: Incomplete | None = ..., + _self: Incomplete | None = ..., + write: Incomplete | None = ..., + ) -> None: ... + @property + def labels(self): ... + @labels.setter + def labels(self, labels) -> None: ... + @property + def members(self): ... + @members.setter + def members(self, members) -> None: ... + @property + def org(self): ... + @org.setter + def org(self, org) -> None: ... + @property + def owners(self): ... + @owners.setter + def owners(self, owners) -> None: ... + @property + def write(self): ... + @write.setter + def write(self, write) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/bucket_metadata_manifest.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/bucket_metadata_manifest.pyi new file mode 100644 index 000000000..24cce2c97 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/bucket_metadata_manifest.pyi @@ -0,0 +1,48 @@ +from _typeshed import Incomplete + +class BucketMetadataManifest: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + organization_id: Incomplete | None = ..., + organization_name: Incomplete | None = ..., + bucket_id: Incomplete | None = ..., + bucket_name: Incomplete | None = ..., + description: Incomplete | None = ..., + default_retention_policy: Incomplete | None = ..., + retention_policies: Incomplete | None = ..., + ) -> None: ... + @property + def organization_id(self): ... + @organization_id.setter + def organization_id(self, organization_id) -> None: ... + @property + def organization_name(self): ... + @organization_name.setter + def organization_name(self, organization_name) -> None: ... + @property + def bucket_id(self): ... + @bucket_id.setter + def bucket_id(self, bucket_id) -> None: ... + @property + def bucket_name(self): ... + @bucket_name.setter + def bucket_name(self, bucket_name) -> None: ... + @property + def description(self): ... + @description.setter + def description(self, description) -> None: ... + @property + def default_retention_policy(self): ... + @default_retention_policy.setter + def default_retention_policy(self, default_retention_policy) -> None: ... + @property + def retention_policies(self): ... + @retention_policies.setter + def retention_policies(self, retention_policies) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/bucket_retention_rules.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/bucket_retention_rules.pyi new file mode 100644 index 000000000..7ddc6748a --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/bucket_retention_rules.pyi @@ -0,0 +1,25 @@ +from _typeshed import Incomplete + +class BucketRetentionRules: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, type: str = ..., every_seconds: Incomplete | None = ..., shard_group_duration_seconds: Incomplete | None = ... + ) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def every_seconds(self): ... + @every_seconds.setter + def every_seconds(self, every_seconds) -> None: ... + @property + def shard_group_duration_seconds(self): ... + @shard_group_duration_seconds.setter + def shard_group_duration_seconds(self, shard_group_duration_seconds) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/bucket_shard_mapping.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/bucket_shard_mapping.pyi new file mode 100644 index 000000000..3977aa0ce --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/bucket_shard_mapping.pyi @@ -0,0 +1,19 @@ +from _typeshed import Incomplete + +class BucketShardMapping: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, old_id: Incomplete | None = ..., new_id: Incomplete | None = ...) -> None: ... + @property + def old_id(self): ... + @old_id.setter + def old_id(self, old_id) -> None: ... + @property + def new_id(self): ... + @new_id.setter + def new_id(self, new_id) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/buckets.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/buckets.pyi new file mode 100644 index 000000000..d230562db --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/buckets.pyi @@ -0,0 +1,19 @@ +from _typeshed import Incomplete + +class Buckets: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, links: Incomplete | None = ..., buckets: Incomplete | None = ...) -> None: ... + @property + def links(self): ... + @links.setter + def links(self, links) -> None: ... + @property + def buckets(self): ... + @buckets.setter + def buckets(self, buckets) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/builder_aggregate_function_type.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/builder_aggregate_function_type.pyi new file mode 100644 index 000000000..77ebfb9ef --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/builder_aggregate_function_type.pyi @@ -0,0 +1,12 @@ +from _typeshed import Incomplete + +class BuilderAggregateFunctionType: + FILTER: str + GROUP: str + openapi_types: Incomplete + attribute_map: Incomplete + def __init__(self) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/builder_config.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/builder_config.pyi new file mode 100644 index 000000000..c012e523d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/builder_config.pyi @@ -0,0 +1,33 @@ +from _typeshed import Incomplete + +class BuilderConfig: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + buckets: Incomplete | None = ..., + tags: Incomplete | None = ..., + functions: Incomplete | None = ..., + aggregate_window: Incomplete | None = ..., + ) -> None: ... + @property + def buckets(self): ... + @buckets.setter + def buckets(self, buckets) -> None: ... + @property + def tags(self): ... + @tags.setter + def tags(self, tags) -> None: ... + @property + def functions(self): ... + @functions.setter + def functions(self, functions) -> None: ... + @property + def aggregate_window(self): ... + @aggregate_window.setter + def aggregate_window(self, aggregate_window) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/builder_config_aggregate_window.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/builder_config_aggregate_window.pyi new file mode 100644 index 000000000..74848bc03 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/builder_config_aggregate_window.pyi @@ -0,0 +1,19 @@ +from _typeshed import Incomplete + +class BuilderConfigAggregateWindow: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, period: Incomplete | None = ..., fill_values: Incomplete | None = ...) -> None: ... + @property + def period(self): ... + @period.setter + def period(self, period) -> None: ... + @property + def fill_values(self): ... + @fill_values.setter + def fill_values(self, fill_values) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/builder_functions_type.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/builder_functions_type.pyi new file mode 100644 index 000000000..4b6e331da --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/builder_functions_type.pyi @@ -0,0 +1,15 @@ +from _typeshed import Incomplete + +class BuilderFunctionsType: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, name: Incomplete | None = ...) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/builder_tags_type.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/builder_tags_type.pyi new file mode 100644 index 000000000..580c62804 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/builder_tags_type.pyi @@ -0,0 +1,25 @@ +from _typeshed import Incomplete + +class BuilderTagsType: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, key: Incomplete | None = ..., values: Incomplete | None = ..., aggregate_function_type: Incomplete | None = ... + ) -> None: ... + @property + def key(self): ... + @key.setter + def key(self, key) -> None: ... + @property + def values(self): ... + @values.setter + def values(self, values) -> None: ... + @property + def aggregate_function_type(self): ... + @aggregate_function_type.setter + def aggregate_function_type(self, aggregate_function_type) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/builtin_statement.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/builtin_statement.pyi new file mode 100644 index 000000000..5dba736e9 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/builtin_statement.pyi @@ -0,0 +1,21 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.statement import Statement + +class BuiltinStatement(Statement): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, type: Incomplete | None = ..., id: Incomplete | None = ...) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def id(self): ... + @id.setter + def id(self, id) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/call_expression.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/call_expression.pyi new file mode 100644 index 000000000..679705f36 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/call_expression.pyi @@ -0,0 +1,27 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.expression import Expression + +class CallExpression(Expression): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, type: Incomplete | None = ..., callee: Incomplete | None = ..., arguments: Incomplete | None = ... + ) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def callee(self): ... + @callee.setter + def callee(self, callee) -> None: ... + @property + def arguments(self): ... + @arguments.setter + def arguments(self, arguments) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/cell.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/cell.pyi new file mode 100644 index 000000000..9c0be23ee --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/cell.pyi @@ -0,0 +1,48 @@ +from _typeshed import Incomplete + +class Cell: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + id: Incomplete | None = ..., + links: Incomplete | None = ..., + x: Incomplete | None = ..., + y: Incomplete | None = ..., + w: Incomplete | None = ..., + h: Incomplete | None = ..., + view_id: Incomplete | None = ..., + ) -> None: ... + @property + def id(self): ... + @id.setter + def id(self, id) -> None: ... + @property + def links(self): ... + @links.setter + def links(self, links) -> None: ... + @property + def x(self): ... + @x.setter + def x(self, x) -> None: ... + @property + def y(self): ... + @y.setter + def y(self, y) -> None: ... + @property + def w(self): ... + @w.setter + def w(self, w) -> None: ... + @property + def h(self): ... + @h.setter + def h(self, h) -> None: ... + @property + def view_id(self): ... + @view_id.setter + def view_id(self, view_id) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/cell_links.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/cell_links.pyi new file mode 100644 index 000000000..90fbc708f --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/cell_links.pyi @@ -0,0 +1,15 @@ +from _typeshed import Incomplete + +class CellLinks: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, _self: Incomplete | None = ..., view: Incomplete | None = ...) -> None: ... + @property + def view(self): ... + @view.setter + def view(self, view) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/cell_update.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/cell_update.pyi new file mode 100644 index 000000000..78b5f2008 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/cell_update.pyi @@ -0,0 +1,29 @@ +from _typeshed import Incomplete + +class CellUpdate: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, x: Incomplete | None = ..., y: Incomplete | None = ..., w: Incomplete | None = ..., h: Incomplete | None = ... + ) -> None: ... + @property + def x(self): ... + @x.setter + def x(self, x) -> None: ... + @property + def y(self): ... + @y.setter + def y(self, y) -> None: ... + @property + def w(self): ... + @w.setter + def w(self, w) -> None: ... + @property + def h(self): ... + @h.setter + def h(self, h) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/cell_with_view_properties.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/cell_with_view_properties.pyi new file mode 100644 index 000000000..fcb4fa486 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/cell_with_view_properties.pyi @@ -0,0 +1,32 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.cell import Cell + +class CellWithViewProperties(Cell): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + name: Incomplete | None = ..., + properties: Incomplete | None = ..., + id: Incomplete | None = ..., + links: Incomplete | None = ..., + x: Incomplete | None = ..., + y: Incomplete | None = ..., + w: Incomplete | None = ..., + h: Incomplete | None = ..., + view_id: Incomplete | None = ..., + ) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def properties(self): ... + @properties.setter + def properties(self, properties) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/check.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/check.pyi new file mode 100644 index 000000000..d2013bdaf --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/check.pyi @@ -0,0 +1,17 @@ +from _typeshed import Incomplete + +class Check: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator_value_class_map: Incomplete + discriminator: str + def __init__(self, type: Incomplete | None = ...) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + def get_real_child_model(self, data): ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/check_base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/check_base.pyi new file mode 100644 index 000000000..48c7aa77a --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/check_base.pyi @@ -0,0 +1,88 @@ +from _typeshed import Incomplete + +class CheckBase: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + id: Incomplete | None = ..., + name: Incomplete | None = ..., + org_id: Incomplete | None = ..., + task_id: Incomplete | None = ..., + owner_id: Incomplete | None = ..., + created_at: Incomplete | None = ..., + updated_at: Incomplete | None = ..., + query: Incomplete | None = ..., + status: Incomplete | None = ..., + description: Incomplete | None = ..., + latest_completed: Incomplete | None = ..., + last_run_status: Incomplete | None = ..., + last_run_error: Incomplete | None = ..., + labels: Incomplete | None = ..., + links: Incomplete | None = ..., + ) -> None: ... + @property + def id(self): ... + @id.setter + def id(self, id) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def org_id(self): ... + @org_id.setter + def org_id(self, org_id) -> None: ... + @property + def task_id(self): ... + @task_id.setter + def task_id(self, task_id) -> None: ... + @property + def owner_id(self): ... + @owner_id.setter + def owner_id(self, owner_id) -> None: ... + @property + def created_at(self): ... + @created_at.setter + def created_at(self, created_at) -> None: ... + @property + def updated_at(self): ... + @updated_at.setter + def updated_at(self, updated_at) -> None: ... + @property + def query(self): ... + @query.setter + def query(self, query) -> None: ... + @property + def status(self): ... + @status.setter + def status(self, status) -> None: ... + @property + def description(self): ... + @description.setter + def description(self, description) -> None: ... + @property + def latest_completed(self): ... + @latest_completed.setter + def latest_completed(self, latest_completed) -> None: ... + @property + def last_run_status(self): ... + @last_run_status.setter + def last_run_status(self, last_run_status) -> None: ... + @property + def last_run_error(self): ... + @last_run_error.setter + def last_run_error(self, last_run_error) -> None: ... + @property + def labels(self): ... + @labels.setter + def labels(self, labels) -> None: ... + @property + def links(self): ... + @links.setter + def links(self, links) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/check_base_links.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/check_base_links.pyi new file mode 100644 index 000000000..da935fb9c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/check_base_links.pyi @@ -0,0 +1,34 @@ +from _typeshed import Incomplete + +class CheckBaseLinks: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + _self: Incomplete | None = ..., + labels: Incomplete | None = ..., + members: Incomplete | None = ..., + owners: Incomplete | None = ..., + query: Incomplete | None = ..., + ) -> None: ... + @property + def labels(self): ... + @labels.setter + def labels(self, labels) -> None: ... + @property + def members(self): ... + @members.setter + def members(self, members) -> None: ... + @property + def owners(self): ... + @owners.setter + def owners(self, owners) -> None: ... + @property + def query(self): ... + @query.setter + def query(self, query) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/check_discriminator.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/check_discriminator.pyi new file mode 100644 index 000000000..50e776cb7 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/check_discriminator.pyi @@ -0,0 +1,30 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.check_base import CheckBase + +class CheckDiscriminator(CheckBase): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + id: Incomplete | None = ..., + name: Incomplete | None = ..., + org_id: Incomplete | None = ..., + task_id: Incomplete | None = ..., + owner_id: Incomplete | None = ..., + created_at: Incomplete | None = ..., + updated_at: Incomplete | None = ..., + query: Incomplete | None = ..., + status: Incomplete | None = ..., + description: Incomplete | None = ..., + latest_completed: Incomplete | None = ..., + last_run_status: Incomplete | None = ..., + last_run_error: Incomplete | None = ..., + labels: Incomplete | None = ..., + links: Incomplete | None = ..., + ) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/check_patch.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/check_patch.pyi new file mode 100644 index 000000000..9354879ea --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/check_patch.pyi @@ -0,0 +1,25 @@ +from _typeshed import Incomplete + +class CheckPatch: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, name: Incomplete | None = ..., description: Incomplete | None = ..., status: Incomplete | None = ... + ) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def description(self): ... + @description.setter + def description(self, description) -> None: ... + @property + def status(self): ... + @status.setter + def status(self, status) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/check_status_level.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/check_status_level.pyi new file mode 100644 index 000000000..9dafd3a68 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/check_status_level.pyi @@ -0,0 +1,15 @@ +from _typeshed import Incomplete + +class CheckStatusLevel: + UNKNOWN: str + OK: str + INFO: str + CRIT: str + WARN: str + openapi_types: Incomplete + attribute_map: Incomplete + def __init__(self) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/check_view_properties.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/check_view_properties.pyi new file mode 100644 index 000000000..4e2070481 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/check_view_properties.pyi @@ -0,0 +1,65 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.view_properties import ViewProperties + +class CheckViewProperties(ViewProperties): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + type: Incomplete | None = ..., + shape: Incomplete | None = ..., + check_id: Incomplete | None = ..., + check: Incomplete | None = ..., + queries: Incomplete | None = ..., + colors: Incomplete | None = ..., + legend_colorize_rows: Incomplete | None = ..., + legend_hide: Incomplete | None = ..., + legend_opacity: Incomplete | None = ..., + legend_orientation_threshold: Incomplete | None = ..., + ) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def shape(self): ... + @shape.setter + def shape(self, shape) -> None: ... + @property + def check_id(self): ... + @check_id.setter + def check_id(self, check_id) -> None: ... + @property + def check(self): ... + @check.setter + def check(self, check) -> None: ... + @property + def queries(self): ... + @queries.setter + def queries(self, queries) -> None: ... + @property + def colors(self): ... + @colors.setter + def colors(self, colors) -> None: ... + @property + def legend_colorize_rows(self): ... + @legend_colorize_rows.setter + def legend_colorize_rows(self, legend_colorize_rows) -> None: ... + @property + def legend_hide(self): ... + @legend_hide.setter + def legend_hide(self, legend_hide) -> None: ... + @property + def legend_opacity(self): ... + @legend_opacity.setter + def legend_opacity(self, legend_opacity) -> None: ... + @property + def legend_orientation_threshold(self): ... + @legend_orientation_threshold.setter + def legend_orientation_threshold(self, legend_orientation_threshold) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/checks.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/checks.pyi new file mode 100644 index 000000000..d9879c8d5 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/checks.pyi @@ -0,0 +1,19 @@ +from _typeshed import Incomplete + +class Checks: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, checks: Incomplete | None = ..., links: Incomplete | None = ...) -> None: ... + @property + def checks(self): ... + @checks.setter + def checks(self, checks) -> None: ... + @property + def links(self): ... + @links.setter + def links(self, links) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/column_data_type.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/column_data_type.pyi new file mode 100644 index 000000000..fd59dd0ca --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/column_data_type.pyi @@ -0,0 +1,15 @@ +from _typeshed import Incomplete + +class ColumnDataType: + INTEGER: str + FLOAT: str + BOOLEAN: str + STRING: str + UNSIGNED: str + openapi_types: Incomplete + attribute_map: Incomplete + def __init__(self) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/column_semantic_type.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/column_semantic_type.pyi new file mode 100644 index 000000000..feaa3a9e7 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/column_semantic_type.pyi @@ -0,0 +1,13 @@ +from _typeshed import Incomplete + +class ColumnSemanticType: + TIMESTAMP: str + TAG: str + FIELD: str + openapi_types: Incomplete + attribute_map: Incomplete + def __init__(self) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/conditional_expression.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/conditional_expression.pyi new file mode 100644 index 000000000..89493f624 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/conditional_expression.pyi @@ -0,0 +1,35 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.expression import Expression + +class ConditionalExpression(Expression): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + type: Incomplete | None = ..., + test: Incomplete | None = ..., + alternate: Incomplete | None = ..., + consequent: Incomplete | None = ..., + ) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def test(self): ... + @test.setter + def test(self, test) -> None: ... + @property + def alternate(self): ... + @alternate.setter + def alternate(self, alternate) -> None: ... + @property + def consequent(self): ... + @consequent.setter + def consequent(self, consequent) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/config.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/config.pyi new file mode 100644 index 000000000..d81e64af3 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/config.pyi @@ -0,0 +1,15 @@ +from _typeshed import Incomplete + +class Config: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, config: Incomplete | None = ...) -> None: ... + @property + def config(self): ... + @config.setter + def config(self, config) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/constant_variable_properties.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/constant_variable_properties.pyi new file mode 100644 index 000000000..cd0c6ced8 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/constant_variable_properties.pyi @@ -0,0 +1,21 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.variable_properties import VariableProperties + +class ConstantVariableProperties(VariableProperties): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, type: Incomplete | None = ..., values: Incomplete | None = ...) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def values(self): ... + @values.setter + def values(self, values) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/create_cell.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/create_cell.pyi new file mode 100644 index 000000000..ff8b1b42f --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/create_cell.pyi @@ -0,0 +1,43 @@ +from _typeshed import Incomplete + +class CreateCell: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + name: Incomplete | None = ..., + x: Incomplete | None = ..., + y: Incomplete | None = ..., + w: Incomplete | None = ..., + h: Incomplete | None = ..., + using_view: Incomplete | None = ..., + ) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def x(self): ... + @x.setter + def x(self, x) -> None: ... + @property + def y(self): ... + @y.setter + def y(self, y) -> None: ... + @property + def w(self): ... + @w.setter + def w(self, w) -> None: ... + @property + def h(self): ... + @h.setter + def h(self, h) -> None: ... + @property + def using_view(self): ... + @using_view.setter + def using_view(self, using_view) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/create_dashboard_request.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/create_dashboard_request.pyi new file mode 100644 index 000000000..70a915787 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/create_dashboard_request.pyi @@ -0,0 +1,25 @@ +from _typeshed import Incomplete + +class CreateDashboardRequest: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, org_id: Incomplete | None = ..., name: Incomplete | None = ..., description: Incomplete | None = ... + ) -> None: ... + @property + def org_id(self): ... + @org_id.setter + def org_id(self, org_id) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def description(self): ... + @description.setter + def description(self, description) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/custom_check.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/custom_check.pyi new file mode 100644 index 000000000..3734b93c7 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/custom_check.pyi @@ -0,0 +1,35 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.check_discriminator import CheckDiscriminator + +class CustomCheck(CheckDiscriminator): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + type: str = ..., + id: Incomplete | None = ..., + name: Incomplete | None = ..., + org_id: Incomplete | None = ..., + task_id: Incomplete | None = ..., + owner_id: Incomplete | None = ..., + created_at: Incomplete | None = ..., + updated_at: Incomplete | None = ..., + query: Incomplete | None = ..., + status: Incomplete | None = ..., + description: Incomplete | None = ..., + latest_completed: Incomplete | None = ..., + last_run_status: Incomplete | None = ..., + last_run_error: Incomplete | None = ..., + labels: Incomplete | None = ..., + links: Incomplete | None = ..., + ) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/dashboard.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/dashboard.pyi new file mode 100644 index 000000000..105115cef --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/dashboard.pyi @@ -0,0 +1,43 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.create_dashboard_request import CreateDashboardRequest + +class Dashboard(CreateDashboardRequest): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + links: Incomplete | None = ..., + id: Incomplete | None = ..., + meta: Incomplete | None = ..., + cells: Incomplete | None = ..., + labels: Incomplete | None = ..., + org_id: Incomplete | None = ..., + name: Incomplete | None = ..., + description: Incomplete | None = ..., + ) -> None: ... + @property + def links(self): ... + @links.setter + def links(self, links) -> None: ... + @property + def id(self): ... + @id.setter + def id(self, id) -> None: ... + @property + def meta(self): ... + @meta.setter + def meta(self, meta) -> None: ... + @property + def cells(self): ... + @cells.setter + def cells(self, cells) -> None: ... + @property + def labels(self): ... + @labels.setter + def labels(self, labels) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/dashboard_color.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/dashboard_color.pyi new file mode 100644 index 000000000..2afe2bea7 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/dashboard_color.pyi @@ -0,0 +1,38 @@ +from _typeshed import Incomplete + +class DashboardColor: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + id: Incomplete | None = ..., + type: Incomplete | None = ..., + hex: Incomplete | None = ..., + name: Incomplete | None = ..., + value: Incomplete | None = ..., + ) -> None: ... + @property + def id(self): ... + @id.setter + def id(self, id) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def hex(self): ... + @hex.setter + def hex(self, hex) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def value(self): ... + @value.setter + def value(self, value) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/dashboard_query.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/dashboard_query.pyi new file mode 100644 index 000000000..54f9104f2 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/dashboard_query.pyi @@ -0,0 +1,33 @@ +from _typeshed import Incomplete + +class DashboardQuery: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + text: Incomplete | None = ..., + edit_mode: Incomplete | None = ..., + name: Incomplete | None = ..., + builder_config: Incomplete | None = ..., + ) -> None: ... + @property + def text(self): ... + @text.setter + def text(self, text) -> None: ... + @property + def edit_mode(self): ... + @edit_mode.setter + def edit_mode(self, edit_mode) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def builder_config(self): ... + @builder_config.setter + def builder_config(self, builder_config) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/dashboard_with_view_properties.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/dashboard_with_view_properties.pyi new file mode 100644 index 000000000..aaeeff0ec --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/dashboard_with_view_properties.pyi @@ -0,0 +1,43 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.create_dashboard_request import CreateDashboardRequest + +class DashboardWithViewProperties(CreateDashboardRequest): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + links: Incomplete | None = ..., + id: Incomplete | None = ..., + meta: Incomplete | None = ..., + cells: Incomplete | None = ..., + labels: Incomplete | None = ..., + org_id: Incomplete | None = ..., + name: Incomplete | None = ..., + description: Incomplete | None = ..., + ) -> None: ... + @property + def links(self): ... + @links.setter + def links(self, links) -> None: ... + @property + def id(self): ... + @id.setter + def id(self, id) -> None: ... + @property + def meta(self): ... + @meta.setter + def meta(self, meta) -> None: ... + @property + def cells(self): ... + @cells.setter + def cells(self, cells) -> None: ... + @property + def labels(self): ... + @labels.setter + def labels(self, labels) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/dashboards.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/dashboards.pyi new file mode 100644 index 000000000..56b2a9d09 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/dashboards.pyi @@ -0,0 +1,19 @@ +from _typeshed import Incomplete + +class Dashboards: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, links: Incomplete | None = ..., dashboards: Incomplete | None = ...) -> None: ... + @property + def links(self): ... + @links.setter + def links(self, links) -> None: ... + @property + def dashboards(self): ... + @dashboards.setter + def dashboards(self, dashboards) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/date_time_literal.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/date_time_literal.pyi new file mode 100644 index 000000000..c1226ad9a --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/date_time_literal.pyi @@ -0,0 +1,21 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.expression import Expression + +class DateTimeLiteral(Expression): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, type: Incomplete | None = ..., value: Incomplete | None = ...) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def value(self): ... + @value.setter + def value(self, value) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/dbr_ps.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/dbr_ps.pyi new file mode 100644 index 000000000..190351f70 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/dbr_ps.pyi @@ -0,0 +1,15 @@ +from _typeshed import Incomplete + +class DBRPs: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, content: Incomplete | None = ...) -> None: ... + @property + def content(self): ... + @content.setter + def content(self, content) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/dbrp.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/dbrp.pyi new file mode 100644 index 000000000..23ecea546 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/dbrp.pyi @@ -0,0 +1,48 @@ +from _typeshed import Incomplete + +class DBRP: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + id: Incomplete | None = ..., + org_id: Incomplete | None = ..., + bucket_id: Incomplete | None = ..., + database: Incomplete | None = ..., + retention_policy: Incomplete | None = ..., + default: Incomplete | None = ..., + links: Incomplete | None = ..., + ) -> None: ... + @property + def id(self): ... + @id.setter + def id(self, id) -> None: ... + @property + def org_id(self): ... + @org_id.setter + def org_id(self, org_id) -> None: ... + @property + def bucket_id(self): ... + @bucket_id.setter + def bucket_id(self, bucket_id) -> None: ... + @property + def database(self): ... + @database.setter + def database(self, database) -> None: ... + @property + def retention_policy(self): ... + @retention_policy.setter + def retention_policy(self, retention_policy) -> None: ... + @property + def default(self): ... + @default.setter + def default(self, default) -> None: ... + @property + def links(self): ... + @links.setter + def links(self, links) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/dbrp_create.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/dbrp_create.pyi new file mode 100644 index 000000000..3d462b1bc --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/dbrp_create.pyi @@ -0,0 +1,43 @@ +from _typeshed import Incomplete + +class DBRPCreate: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + org_id: Incomplete | None = ..., + org: Incomplete | None = ..., + bucket_id: Incomplete | None = ..., + database: Incomplete | None = ..., + retention_policy: Incomplete | None = ..., + default: Incomplete | None = ..., + ) -> None: ... + @property + def org_id(self): ... + @org_id.setter + def org_id(self, org_id) -> None: ... + @property + def org(self): ... + @org.setter + def org(self, org) -> None: ... + @property + def bucket_id(self): ... + @bucket_id.setter + def bucket_id(self, bucket_id) -> None: ... + @property + def database(self): ... + @database.setter + def database(self, database) -> None: ... + @property + def retention_policy(self): ... + @retention_policy.setter + def retention_policy(self, retention_policy) -> None: ... + @property + def default(self): ... + @default.setter + def default(self, default) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/dbrp_get.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/dbrp_get.pyi new file mode 100644 index 000000000..df0e24b06 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/dbrp_get.pyi @@ -0,0 +1,15 @@ +from _typeshed import Incomplete + +class DBRPGet: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, content: Incomplete | None = ...) -> None: ... + @property + def content(self): ... + @content.setter + def content(self, content) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/dbrp_update.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/dbrp_update.pyi new file mode 100644 index 000000000..e36ca3337 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/dbrp_update.pyi @@ -0,0 +1,19 @@ +from _typeshed import Incomplete + +class DBRPUpdate: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, retention_policy: Incomplete | None = ..., default: Incomplete | None = ...) -> None: ... + @property + def retention_policy(self): ... + @retention_policy.setter + def retention_policy(self, retention_policy) -> None: ... + @property + def default(self): ... + @default.setter + def default(self, default) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/deadman_check.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/deadman_check.pyi new file mode 100644 index 000000000..7f270cee2 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/deadman_check.pyi @@ -0,0 +1,75 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.check_discriminator import CheckDiscriminator + +class DeadmanCheck(CheckDiscriminator): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + type: str = ..., + time_since: Incomplete | None = ..., + stale_time: Incomplete | None = ..., + report_zero: Incomplete | None = ..., + level: Incomplete | None = ..., + every: Incomplete | None = ..., + offset: Incomplete | None = ..., + tags: Incomplete | None = ..., + status_message_template: Incomplete | None = ..., + id: Incomplete | None = ..., + name: Incomplete | None = ..., + org_id: Incomplete | None = ..., + task_id: Incomplete | None = ..., + owner_id: Incomplete | None = ..., + created_at: Incomplete | None = ..., + updated_at: Incomplete | None = ..., + query: Incomplete | None = ..., + status: Incomplete | None = ..., + description: Incomplete | None = ..., + latest_completed: Incomplete | None = ..., + last_run_status: Incomplete | None = ..., + last_run_error: Incomplete | None = ..., + labels: Incomplete | None = ..., + links: Incomplete | None = ..., + ) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def time_since(self): ... + @time_since.setter + def time_since(self, time_since) -> None: ... + @property + def stale_time(self): ... + @stale_time.setter + def stale_time(self, stale_time) -> None: ... + @property + def report_zero(self): ... + @report_zero.setter + def report_zero(self, report_zero) -> None: ... + @property + def level(self): ... + @level.setter + def level(self, level) -> None: ... + @property + def every(self): ... + @every.setter + def every(self, every) -> None: ... + @property + def offset(self): ... + @offset.setter + def offset(self, offset) -> None: ... + @property + def tags(self): ... + @tags.setter + def tags(self, tags) -> None: ... + @property + def status_message_template(self): ... + @status_message_template.setter + def status_message_template(self, status_message_template) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/decimal_places.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/decimal_places.pyi new file mode 100644 index 000000000..15400d4b2 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/decimal_places.pyi @@ -0,0 +1,19 @@ +from _typeshed import Incomplete + +class DecimalPlaces: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, is_enforced: Incomplete | None = ..., digits: Incomplete | None = ...) -> None: ... + @property + def is_enforced(self): ... + @is_enforced.setter + def is_enforced(self, is_enforced) -> None: ... + @property + def digits(self): ... + @digits.setter + def digits(self, digits) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/delete_predicate_request.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/delete_predicate_request.pyi new file mode 100644 index 000000000..a4606ae4e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/delete_predicate_request.pyi @@ -0,0 +1,25 @@ +from _typeshed import Incomplete + +class DeletePredicateRequest: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, start: Incomplete | None = ..., stop: Incomplete | None = ..., predicate: Incomplete | None = ... + ) -> None: ... + @property + def start(self): ... + @start.setter + def start(self, start) -> None: ... + @property + def stop(self): ... + @stop.setter + def stop(self, stop) -> None: ... + @property + def predicate(self): ... + @predicate.setter + def predicate(self, predicate) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/dialect.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/dialect.pyi new file mode 100644 index 000000000..420a1f231 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/dialect.pyi @@ -0,0 +1,38 @@ +from _typeshed import Incomplete + +class Dialect: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + header: bool = ..., + delimiter: str = ..., + annotations: Incomplete | None = ..., + comment_prefix: str = ..., + date_time_format: str = ..., + ) -> None: ... + @property + def header(self): ... + @header.setter + def header(self, header) -> None: ... + @property + def delimiter(self): ... + @delimiter.setter + def delimiter(self, delimiter) -> None: ... + @property + def annotations(self): ... + @annotations.setter + def annotations(self, annotations) -> None: ... + @property + def comment_prefix(self): ... + @comment_prefix.setter + def comment_prefix(self, comment_prefix) -> None: ... + @property + def date_time_format(self): ... + @date_time_format.setter + def date_time_format(self, date_time_format) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/dict_expression.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/dict_expression.pyi new file mode 100644 index 000000000..0200e72cf --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/dict_expression.pyi @@ -0,0 +1,21 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.expression import Expression + +class DictExpression(Expression): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, type: Incomplete | None = ..., elements: Incomplete | None = ...) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def elements(self): ... + @elements.setter + def elements(self, elements) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/dict_item.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/dict_item.pyi new file mode 100644 index 000000000..06ebcad4c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/dict_item.pyi @@ -0,0 +1,23 @@ +from _typeshed import Incomplete + +class DictItem: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, type: Incomplete | None = ..., key: Incomplete | None = ..., val: Incomplete | None = ...) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def key(self): ... + @key.setter + def key(self, key) -> None: ... + @property + def val(self): ... + @val.setter + def val(self, val) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/duration.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/duration.pyi new file mode 100644 index 000000000..4cbf5e986 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/duration.pyi @@ -0,0 +1,25 @@ +from _typeshed import Incomplete + +class Duration: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, type: Incomplete | None = ..., magnitude: Incomplete | None = ..., unit: Incomplete | None = ... + ) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def magnitude(self): ... + @magnitude.setter + def magnitude(self, magnitude) -> None: ... + @property + def unit(self): ... + @unit.setter + def unit(self, unit) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/duration_literal.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/duration_literal.pyi new file mode 100644 index 000000000..783fa7fd2 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/duration_literal.pyi @@ -0,0 +1,21 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.expression import Expression + +class DurationLiteral(Expression): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, type: Incomplete | None = ..., values: Incomplete | None = ...) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def values(self): ... + @values.setter + def values(self, values) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/error.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/error.pyi new file mode 100644 index 000000000..27d3183b4 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/error.pyi @@ -0,0 +1,33 @@ +from _typeshed import Incomplete + +class Error: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + code: Incomplete | None = ..., + message: Incomplete | None = ..., + op: Incomplete | None = ..., + err: Incomplete | None = ..., + ) -> None: ... + @property + def code(self): ... + @code.setter + def code(self, code) -> None: ... + @property + def message(self): ... + @message.setter + def message(self, message) -> None: ... + @property + def op(self): ... + @op.setter + def op(self, op) -> None: ... + @property + def err(self): ... + @err.setter + def err(self, err) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/expression.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/expression.pyi new file mode 100644 index 000000000..0add99c90 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/expression.pyi @@ -0,0 +1,13 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.node import Node + +class Expression(Node): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/expression_statement.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/expression_statement.pyi new file mode 100644 index 000000000..815bfae9e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/expression_statement.pyi @@ -0,0 +1,21 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.statement import Statement + +class ExpressionStatement(Statement): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, type: Incomplete | None = ..., expression: Incomplete | None = ...) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def expression(self): ... + @expression.setter + def expression(self, expression) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/field.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/field.pyi new file mode 100644 index 000000000..830b1567c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/field.pyi @@ -0,0 +1,33 @@ +from _typeshed import Incomplete + +class Field: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + value: Incomplete | None = ..., + type: Incomplete | None = ..., + alias: Incomplete | None = ..., + args: Incomplete | None = ..., + ) -> None: ... + @property + def value(self): ... + @value.setter + def value(self, value) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def alias(self): ... + @alias.setter + def alias(self, alias) -> None: ... + @property + def args(self): ... + @args.setter + def args(self, args) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/file.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/file.pyi new file mode 100644 index 000000000..5a413d6b0 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/file.pyi @@ -0,0 +1,38 @@ +from _typeshed import Incomplete + +class File: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + type: Incomplete | None = ..., + name: Incomplete | None = ..., + package: Incomplete | None = ..., + imports: Incomplete | None = ..., + body: Incomplete | None = ..., + ) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def package(self): ... + @package.setter + def package(self, package) -> None: ... + @property + def imports(self): ... + @imports.setter + def imports(self, imports) -> None: ... + @property + def body(self): ... + @body.setter + def body(self, body) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/float_literal.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/float_literal.pyi new file mode 100644 index 000000000..2033f4309 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/float_literal.pyi @@ -0,0 +1,21 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.expression import Expression + +class FloatLiteral(Expression): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, type: Incomplete | None = ..., value: Incomplete | None = ...) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def value(self): ... + @value.setter + def value(self, value) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/flux_response.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/flux_response.pyi new file mode 100644 index 000000000..edcc9796e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/flux_response.pyi @@ -0,0 +1,15 @@ +from _typeshed import Incomplete + +class FluxResponse: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, flux: Incomplete | None = ...) -> None: ... + @property + def flux(self): ... + @flux.setter + def flux(self, flux) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/flux_suggestion.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/flux_suggestion.pyi new file mode 100644 index 000000000..0eb66df44 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/flux_suggestion.pyi @@ -0,0 +1,19 @@ +from _typeshed import Incomplete + +class FluxSuggestion: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, name: Incomplete | None = ..., params: Incomplete | None = ...) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def params(self): ... + @params.setter + def params(self, params) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/flux_suggestions.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/flux_suggestions.pyi new file mode 100644 index 000000000..8518329c0 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/flux_suggestions.pyi @@ -0,0 +1,15 @@ +from _typeshed import Incomplete + +class FluxSuggestions: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, funcs: Incomplete | None = ...) -> None: ... + @property + def funcs(self): ... + @funcs.setter + def funcs(self, funcs) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/function_expression.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/function_expression.pyi new file mode 100644 index 000000000..5b1fb029f --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/function_expression.pyi @@ -0,0 +1,25 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.expression import Expression + +class FunctionExpression(Expression): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, type: Incomplete | None = ..., params: Incomplete | None = ..., body: Incomplete | None = ...) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def params(self): ... + @params.setter + def params(self, params) -> None: ... + @property + def body(self): ... + @body.setter + def body(self, body) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/gauge_view_properties.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/gauge_view_properties.pyi new file mode 100644 index 000000000..b128a2611 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/gauge_view_properties.pyi @@ -0,0 +1,70 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.view_properties import ViewProperties + +class GaugeViewProperties(ViewProperties): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + type: Incomplete | None = ..., + queries: Incomplete | None = ..., + colors: Incomplete | None = ..., + shape: Incomplete | None = ..., + note: Incomplete | None = ..., + show_note_when_empty: Incomplete | None = ..., + prefix: Incomplete | None = ..., + tick_prefix: Incomplete | None = ..., + suffix: Incomplete | None = ..., + tick_suffix: Incomplete | None = ..., + decimal_places: Incomplete | None = ..., + ) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def queries(self): ... + @queries.setter + def queries(self, queries) -> None: ... + @property + def colors(self): ... + @colors.setter + def colors(self, colors) -> None: ... + @property + def shape(self): ... + @shape.setter + def shape(self, shape) -> None: ... + @property + def note(self): ... + @note.setter + def note(self, note) -> None: ... + @property + def show_note_when_empty(self): ... + @show_note_when_empty.setter + def show_note_when_empty(self, show_note_when_empty) -> None: ... + @property + def prefix(self): ... + @prefix.setter + def prefix(self, prefix) -> None: ... + @property + def tick_prefix(self): ... + @tick_prefix.setter + def tick_prefix(self, tick_prefix) -> None: ... + @property + def suffix(self): ... + @suffix.setter + def suffix(self, suffix) -> None: ... + @property + def tick_suffix(self): ... + @tick_suffix.setter + def tick_suffix(self, tick_suffix) -> None: ... + @property + def decimal_places(self): ... + @decimal_places.setter + def decimal_places(self, decimal_places) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/greater_threshold.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/greater_threshold.pyi new file mode 100644 index 000000000..689b53be9 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/greater_threshold.pyi @@ -0,0 +1,23 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.threshold_base import ThresholdBase + +class GreaterThreshold(ThresholdBase): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, type: str = ..., value: Incomplete | None = ..., level: Incomplete | None = ..., all_values: Incomplete | None = ... + ) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def value(self): ... + @value.setter + def value(self, value) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/health_check.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/health_check.pyi new file mode 100644 index 000000000..c8b1c93f5 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/health_check.pyi @@ -0,0 +1,43 @@ +from _typeshed import Incomplete + +class HealthCheck: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + name: Incomplete | None = ..., + message: Incomplete | None = ..., + checks: Incomplete | None = ..., + status: Incomplete | None = ..., + version: Incomplete | None = ..., + commit: Incomplete | None = ..., + ) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def message(self): ... + @message.setter + def message(self, message) -> None: ... + @property + def checks(self): ... + @checks.setter + def checks(self, checks) -> None: ... + @property + def status(self): ... + @status.setter + def status(self, status) -> None: ... + @property + def version(self): ... + @version.setter + def version(self, version) -> None: ... + @property + def commit(self): ... + @commit.setter + def commit(self, commit) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/heatmap_view_properties.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/heatmap_view_properties.pyi new file mode 100644 index 000000000..4de9504e8 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/heatmap_view_properties.pyi @@ -0,0 +1,165 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.view_properties import ViewProperties + +class HeatmapViewProperties(ViewProperties): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + time_format: Incomplete | None = ..., + type: Incomplete | None = ..., + queries: Incomplete | None = ..., + colors: Incomplete | None = ..., + shape: Incomplete | None = ..., + note: Incomplete | None = ..., + show_note_when_empty: Incomplete | None = ..., + x_column: Incomplete | None = ..., + generate_x_axis_ticks: Incomplete | None = ..., + x_total_ticks: Incomplete | None = ..., + x_tick_start: Incomplete | None = ..., + x_tick_step: Incomplete | None = ..., + y_column: Incomplete | None = ..., + generate_y_axis_ticks: Incomplete | None = ..., + y_total_ticks: Incomplete | None = ..., + y_tick_start: Incomplete | None = ..., + y_tick_step: Incomplete | None = ..., + x_domain: Incomplete | None = ..., + y_domain: Incomplete | None = ..., + x_axis_label: Incomplete | None = ..., + y_axis_label: Incomplete | None = ..., + x_prefix: Incomplete | None = ..., + x_suffix: Incomplete | None = ..., + y_prefix: Incomplete | None = ..., + y_suffix: Incomplete | None = ..., + bin_size: Incomplete | None = ..., + legend_colorize_rows: Incomplete | None = ..., + legend_hide: Incomplete | None = ..., + legend_opacity: Incomplete | None = ..., + legend_orientation_threshold: Incomplete | None = ..., + ) -> None: ... + @property + def time_format(self): ... + @time_format.setter + def time_format(self, time_format) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def queries(self): ... + @queries.setter + def queries(self, queries) -> None: ... + @property + def colors(self): ... + @colors.setter + def colors(self, colors) -> None: ... + @property + def shape(self): ... + @shape.setter + def shape(self, shape) -> None: ... + @property + def note(self): ... + @note.setter + def note(self, note) -> None: ... + @property + def show_note_when_empty(self): ... + @show_note_when_empty.setter + def show_note_when_empty(self, show_note_when_empty) -> None: ... + @property + def x_column(self): ... + @x_column.setter + def x_column(self, x_column) -> None: ... + @property + def generate_x_axis_ticks(self): ... + @generate_x_axis_ticks.setter + def generate_x_axis_ticks(self, generate_x_axis_ticks) -> None: ... + @property + def x_total_ticks(self): ... + @x_total_ticks.setter + def x_total_ticks(self, x_total_ticks) -> None: ... + @property + def x_tick_start(self): ... + @x_tick_start.setter + def x_tick_start(self, x_tick_start) -> None: ... + @property + def x_tick_step(self): ... + @x_tick_step.setter + def x_tick_step(self, x_tick_step) -> None: ... + @property + def y_column(self): ... + @y_column.setter + def y_column(self, y_column) -> None: ... + @property + def generate_y_axis_ticks(self): ... + @generate_y_axis_ticks.setter + def generate_y_axis_ticks(self, generate_y_axis_ticks) -> None: ... + @property + def y_total_ticks(self): ... + @y_total_ticks.setter + def y_total_ticks(self, y_total_ticks) -> None: ... + @property + def y_tick_start(self): ... + @y_tick_start.setter + def y_tick_start(self, y_tick_start) -> None: ... + @property + def y_tick_step(self): ... + @y_tick_step.setter + def y_tick_step(self, y_tick_step) -> None: ... + @property + def x_domain(self): ... + @x_domain.setter + def x_domain(self, x_domain) -> None: ... + @property + def y_domain(self): ... + @y_domain.setter + def y_domain(self, y_domain) -> None: ... + @property + def x_axis_label(self): ... + @x_axis_label.setter + def x_axis_label(self, x_axis_label) -> None: ... + @property + def y_axis_label(self): ... + @y_axis_label.setter + def y_axis_label(self, y_axis_label) -> None: ... + @property + def x_prefix(self): ... + @x_prefix.setter + def x_prefix(self, x_prefix) -> None: ... + @property + def x_suffix(self): ... + @x_suffix.setter + def x_suffix(self, x_suffix) -> None: ... + @property + def y_prefix(self): ... + @y_prefix.setter + def y_prefix(self, y_prefix) -> None: ... + @property + def y_suffix(self): ... + @y_suffix.setter + def y_suffix(self, y_suffix) -> None: ... + @property + def bin_size(self): ... + @bin_size.setter + def bin_size(self, bin_size) -> None: ... + @property + def legend_colorize_rows(self): ... + @legend_colorize_rows.setter + def legend_colorize_rows(self, legend_colorize_rows) -> None: ... + @property + def legend_hide(self): ... + @legend_hide.setter + def legend_hide(self, legend_hide) -> None: ... + @property + def legend_opacity(self): ... + @legend_opacity.setter + def legend_opacity(self, legend_opacity) -> None: ... + @property + def legend_orientation_threshold(self): ... + @legend_orientation_threshold.setter + def legend_orientation_threshold(self, legend_orientation_threshold) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/histogram_view_properties.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/histogram_view_properties.pyi new file mode 100644 index 000000000..54b641b49 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/histogram_view_properties.pyi @@ -0,0 +1,95 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.view_properties import ViewProperties + +class HistogramViewProperties(ViewProperties): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + type: Incomplete | None = ..., + queries: Incomplete | None = ..., + colors: Incomplete | None = ..., + shape: Incomplete | None = ..., + note: Incomplete | None = ..., + show_note_when_empty: Incomplete | None = ..., + x_column: Incomplete | None = ..., + fill_columns: Incomplete | None = ..., + x_domain: Incomplete | None = ..., + x_axis_label: Incomplete | None = ..., + position: Incomplete | None = ..., + bin_count: Incomplete | None = ..., + legend_colorize_rows: Incomplete | None = ..., + legend_hide: Incomplete | None = ..., + legend_opacity: Incomplete | None = ..., + legend_orientation_threshold: Incomplete | None = ..., + ) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def queries(self): ... + @queries.setter + def queries(self, queries) -> None: ... + @property + def colors(self): ... + @colors.setter + def colors(self, colors) -> None: ... + @property + def shape(self): ... + @shape.setter + def shape(self, shape) -> None: ... + @property + def note(self): ... + @note.setter + def note(self, note) -> None: ... + @property + def show_note_when_empty(self): ... + @show_note_when_empty.setter + def show_note_when_empty(self, show_note_when_empty) -> None: ... + @property + def x_column(self): ... + @x_column.setter + def x_column(self, x_column) -> None: ... + @property + def fill_columns(self): ... + @fill_columns.setter + def fill_columns(self, fill_columns) -> None: ... + @property + def x_domain(self): ... + @x_domain.setter + def x_domain(self, x_domain) -> None: ... + @property + def x_axis_label(self): ... + @x_axis_label.setter + def x_axis_label(self, x_axis_label) -> None: ... + @property + def position(self): ... + @position.setter + def position(self, position) -> None: ... + @property + def bin_count(self): ... + @bin_count.setter + def bin_count(self, bin_count) -> None: ... + @property + def legend_colorize_rows(self): ... + @legend_colorize_rows.setter + def legend_colorize_rows(self, legend_colorize_rows) -> None: ... + @property + def legend_hide(self): ... + @legend_hide.setter + def legend_hide(self, legend_hide) -> None: ... + @property + def legend_opacity(self): ... + @legend_opacity.setter + def legend_opacity(self, legend_opacity) -> None: ... + @property + def legend_orientation_threshold(self): ... + @legend_orientation_threshold.setter + def legend_orientation_threshold(self, legend_orientation_threshold) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/http_notification_endpoint.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/http_notification_endpoint.pyi new file mode 100644 index 000000000..e0bdf1532 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/http_notification_endpoint.pyi @@ -0,0 +1,66 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.notification_endpoint_discriminator import NotificationEndpointDiscriminator + +class HTTPNotificationEndpoint(NotificationEndpointDiscriminator): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + url: Incomplete | None = ..., + username: Incomplete | None = ..., + password: Incomplete | None = ..., + token: Incomplete | None = ..., + method: Incomplete | None = ..., + auth_method: Incomplete | None = ..., + content_template: Incomplete | None = ..., + headers: Incomplete | None = ..., + id: Incomplete | None = ..., + org_id: Incomplete | None = ..., + user_id: Incomplete | None = ..., + created_at: Incomplete | None = ..., + updated_at: Incomplete | None = ..., + description: Incomplete | None = ..., + name: Incomplete | None = ..., + status: str = ..., + labels: Incomplete | None = ..., + links: Incomplete | None = ..., + type: str = ..., + ) -> None: ... + @property + def url(self): ... + @url.setter + def url(self, url) -> None: ... + @property + def username(self): ... + @username.setter + def username(self, username) -> None: ... + @property + def password(self): ... + @password.setter + def password(self, password) -> None: ... + @property + def token(self): ... + @token.setter + def token(self, token) -> None: ... + @property + def method(self): ... + @method.setter + def method(self, method) -> None: ... + @property + def auth_method(self): ... + @auth_method.setter + def auth_method(self, auth_method) -> None: ... + @property + def content_template(self): ... + @content_template.setter + def content_template(self, content_template) -> None: ... + @property + def headers(self): ... + @headers.setter + def headers(self, headers) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/http_notification_rule.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/http_notification_rule.pyi new file mode 100644 index 000000000..48b75ff84 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/http_notification_rule.pyi @@ -0,0 +1,40 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.http_notification_rule_base import HTTPNotificationRuleBase + +class HTTPNotificationRule(HTTPNotificationRuleBase): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + type: str = ..., + url: Incomplete | None = ..., + latest_completed: Incomplete | None = ..., + last_run_status: Incomplete | None = ..., + last_run_error: Incomplete | None = ..., + id: Incomplete | None = ..., + endpoint_id: Incomplete | None = ..., + org_id: Incomplete | None = ..., + task_id: Incomplete | None = ..., + owner_id: Incomplete | None = ..., + created_at: Incomplete | None = ..., + updated_at: Incomplete | None = ..., + status: Incomplete | None = ..., + name: Incomplete | None = ..., + sleep_until: Incomplete | None = ..., + every: Incomplete | None = ..., + offset: Incomplete | None = ..., + runbook_link: Incomplete | None = ..., + limit_every: Incomplete | None = ..., + limit: Incomplete | None = ..., + tag_rules: Incomplete | None = ..., + description: Incomplete | None = ..., + status_rules: Incomplete | None = ..., + labels: Incomplete | None = ..., + links: Incomplete | None = ..., + ) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/http_notification_rule_base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/http_notification_rule_base.pyi new file mode 100644 index 000000000..94b8b48fa --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/http_notification_rule_base.pyi @@ -0,0 +1,48 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.notification_rule_discriminator import NotificationRuleDiscriminator + +class HTTPNotificationRuleBase(NotificationRuleDiscriminator): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + type: Incomplete | None = ..., + url: Incomplete | None = ..., + latest_completed: Incomplete | None = ..., + last_run_status: Incomplete | None = ..., + last_run_error: Incomplete | None = ..., + id: Incomplete | None = ..., + endpoint_id: Incomplete | None = ..., + org_id: Incomplete | None = ..., + task_id: Incomplete | None = ..., + owner_id: Incomplete | None = ..., + created_at: Incomplete | None = ..., + updated_at: Incomplete | None = ..., + status: Incomplete | None = ..., + name: Incomplete | None = ..., + sleep_until: Incomplete | None = ..., + every: Incomplete | None = ..., + offset: Incomplete | None = ..., + runbook_link: Incomplete | None = ..., + limit_every: Incomplete | None = ..., + limit: Incomplete | None = ..., + tag_rules: Incomplete | None = ..., + description: Incomplete | None = ..., + status_rules: Incomplete | None = ..., + labels: Incomplete | None = ..., + links: Incomplete | None = ..., + ) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def url(self): ... + @url.setter + def url(self, url) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/identifier.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/identifier.pyi new file mode 100644 index 000000000..9243f8b0b --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/identifier.pyi @@ -0,0 +1,21 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.property_key import PropertyKey + +class Identifier(PropertyKey): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, type: Incomplete | None = ..., name: Incomplete | None = ...) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/import_declaration.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/import_declaration.pyi new file mode 100644 index 000000000..3312ef86f --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/import_declaration.pyi @@ -0,0 +1,19 @@ +from _typeshed import Incomplete + +class ImportDeclaration: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, type: Incomplete | None = ..., _as: Incomplete | None = ..., path: Incomplete | None = ...) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def path(self): ... + @path.setter + def path(self, path) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/index_expression.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/index_expression.pyi new file mode 100644 index 000000000..7fe30f497 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/index_expression.pyi @@ -0,0 +1,25 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.expression import Expression + +class IndexExpression(Expression): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, type: Incomplete | None = ..., array: Incomplete | None = ..., index: Incomplete | None = ...) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def array(self): ... + @array.setter + def array(self, array) -> None: ... + @property + def index(self): ... + @index.setter + def index(self, index) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/integer_literal.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/integer_literal.pyi new file mode 100644 index 000000000..f679b6528 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/integer_literal.pyi @@ -0,0 +1,21 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.expression import Expression + +class IntegerLiteral(Expression): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, type: Incomplete | None = ..., value: Incomplete | None = ...) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def value(self): ... + @value.setter + def value(self, value) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/is_onboarding.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/is_onboarding.pyi new file mode 100644 index 000000000..f0c9af7d5 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/is_onboarding.pyi @@ -0,0 +1,15 @@ +from _typeshed import Incomplete + +class IsOnboarding: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, allowed: Incomplete | None = ...) -> None: ... + @property + def allowed(self): ... + @allowed.setter + def allowed(self, allowed) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/label.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/label.pyi new file mode 100644 index 000000000..913a3cf80 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/label.pyi @@ -0,0 +1,33 @@ +from _typeshed import Incomplete + +class Label: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + id: Incomplete | None = ..., + org_id: Incomplete | None = ..., + name: Incomplete | None = ..., + properties: Incomplete | None = ..., + ) -> None: ... + @property + def id(self): ... + @id.setter + def id(self, id) -> None: ... + @property + def org_id(self): ... + @org_id.setter + def org_id(self, org_id) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def properties(self): ... + @properties.setter + def properties(self, properties) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/label_create_request.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/label_create_request.pyi new file mode 100644 index 000000000..dd1cb27b2 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/label_create_request.pyi @@ -0,0 +1,25 @@ +from _typeshed import Incomplete + +class LabelCreateRequest: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, org_id: Incomplete | None = ..., name: Incomplete | None = ..., properties: Incomplete | None = ... + ) -> None: ... + @property + def org_id(self): ... + @org_id.setter + def org_id(self, org_id) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def properties(self): ... + @properties.setter + def properties(self, properties) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/label_mapping.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/label_mapping.pyi new file mode 100644 index 000000000..951992bad --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/label_mapping.pyi @@ -0,0 +1,15 @@ +from _typeshed import Incomplete + +class LabelMapping: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, label_id: Incomplete | None = ...) -> None: ... + @property + def label_id(self): ... + @label_id.setter + def label_id(self, label_id) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/label_response.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/label_response.pyi new file mode 100644 index 000000000..0d73edee8 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/label_response.pyi @@ -0,0 +1,19 @@ +from _typeshed import Incomplete + +class LabelResponse: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, label: Incomplete | None = ..., links: Incomplete | None = ...) -> None: ... + @property + def label(self): ... + @label.setter + def label(self, label) -> None: ... + @property + def links(self): ... + @links.setter + def links(self, links) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/label_update.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/label_update.pyi new file mode 100644 index 000000000..a7b982fdb --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/label_update.pyi @@ -0,0 +1,19 @@ +from _typeshed import Incomplete + +class LabelUpdate: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, name: Incomplete | None = ..., properties: Incomplete | None = ...) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def properties(self): ... + @properties.setter + def properties(self, properties) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/labels_response.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/labels_response.pyi new file mode 100644 index 000000000..1597ef0b5 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/labels_response.pyi @@ -0,0 +1,19 @@ +from _typeshed import Incomplete + +class LabelsResponse: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, labels: Incomplete | None = ..., links: Incomplete | None = ...) -> None: ... + @property + def labels(self): ... + @labels.setter + def labels(self, labels) -> None: ... + @property + def links(self): ... + @links.setter + def links(self, links) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/language_request.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/language_request.pyi new file mode 100644 index 000000000..6301bec72 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/language_request.pyi @@ -0,0 +1,15 @@ +from _typeshed import Incomplete + +class LanguageRequest: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, query: Incomplete | None = ...) -> None: ... + @property + def query(self): ... + @query.setter + def query(self, query) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/legacy_authorization_post_request.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/legacy_authorization_post_request.pyi new file mode 100644 index 000000000..3a0817d50 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/legacy_authorization_post_request.pyi @@ -0,0 +1,37 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.authorization_update_request import AuthorizationUpdateRequest + +class LegacyAuthorizationPostRequest(AuthorizationUpdateRequest): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + org_id: Incomplete | None = ..., + user_id: Incomplete | None = ..., + token: Incomplete | None = ..., + permissions: Incomplete | None = ..., + status: str = ..., + description: Incomplete | None = ..., + ) -> None: ... + @property + def org_id(self): ... + @org_id.setter + def org_id(self, org_id) -> None: ... + @property + def user_id(self): ... + @user_id.setter + def user_id(self, user_id) -> None: ... + @property + def token(self): ... + @token.setter + def token(self, token) -> None: ... + @property + def permissions(self): ... + @permissions.setter + def permissions(self, permissions) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/lesser_threshold.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/lesser_threshold.pyi new file mode 100644 index 000000000..626af5b40 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/lesser_threshold.pyi @@ -0,0 +1,23 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.threshold_base import ThresholdBase + +class LesserThreshold(ThresholdBase): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, type: str = ..., value: Incomplete | None = ..., level: Incomplete | None = ..., all_values: Incomplete | None = ... + ) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def value(self): ... + @value.setter + def value(self, value) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/line_plus_single_stat_properties.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/line_plus_single_stat_properties.pyi new file mode 100644 index 000000000..aded4747f --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/line_plus_single_stat_properties.pyi @@ -0,0 +1,160 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.view_properties import ViewProperties + +class LinePlusSingleStatProperties(ViewProperties): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + time_format: Incomplete | None = ..., + type: Incomplete | None = ..., + queries: Incomplete | None = ..., + colors: Incomplete | None = ..., + shape: Incomplete | None = ..., + note: Incomplete | None = ..., + show_note_when_empty: Incomplete | None = ..., + axes: Incomplete | None = ..., + static_legend: Incomplete | None = ..., + x_column: Incomplete | None = ..., + generate_x_axis_ticks: Incomplete | None = ..., + x_total_ticks: Incomplete | None = ..., + x_tick_start: Incomplete | None = ..., + x_tick_step: Incomplete | None = ..., + y_column: Incomplete | None = ..., + generate_y_axis_ticks: Incomplete | None = ..., + y_total_ticks: Incomplete | None = ..., + y_tick_start: Incomplete | None = ..., + y_tick_step: Incomplete | None = ..., + shade_below: Incomplete | None = ..., + hover_dimension: Incomplete | None = ..., + position: Incomplete | None = ..., + prefix: Incomplete | None = ..., + suffix: Incomplete | None = ..., + decimal_places: Incomplete | None = ..., + legend_colorize_rows: Incomplete | None = ..., + legend_hide: Incomplete | None = ..., + legend_opacity: Incomplete | None = ..., + legend_orientation_threshold: Incomplete | None = ..., + ) -> None: ... + @property + def time_format(self): ... + @time_format.setter + def time_format(self, time_format) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def queries(self): ... + @queries.setter + def queries(self, queries) -> None: ... + @property + def colors(self): ... + @colors.setter + def colors(self, colors) -> None: ... + @property + def shape(self): ... + @shape.setter + def shape(self, shape) -> None: ... + @property + def note(self): ... + @note.setter + def note(self, note) -> None: ... + @property + def show_note_when_empty(self): ... + @show_note_when_empty.setter + def show_note_when_empty(self, show_note_when_empty) -> None: ... + @property + def axes(self): ... + @axes.setter + def axes(self, axes) -> None: ... + @property + def static_legend(self): ... + @static_legend.setter + def static_legend(self, static_legend) -> None: ... + @property + def x_column(self): ... + @x_column.setter + def x_column(self, x_column) -> None: ... + @property + def generate_x_axis_ticks(self): ... + @generate_x_axis_ticks.setter + def generate_x_axis_ticks(self, generate_x_axis_ticks) -> None: ... + @property + def x_total_ticks(self): ... + @x_total_ticks.setter + def x_total_ticks(self, x_total_ticks) -> None: ... + @property + def x_tick_start(self): ... + @x_tick_start.setter + def x_tick_start(self, x_tick_start) -> None: ... + @property + def x_tick_step(self): ... + @x_tick_step.setter + def x_tick_step(self, x_tick_step) -> None: ... + @property + def y_column(self): ... + @y_column.setter + def y_column(self, y_column) -> None: ... + @property + def generate_y_axis_ticks(self): ... + @generate_y_axis_ticks.setter + def generate_y_axis_ticks(self, generate_y_axis_ticks) -> None: ... + @property + def y_total_ticks(self): ... + @y_total_ticks.setter + def y_total_ticks(self, y_total_ticks) -> None: ... + @property + def y_tick_start(self): ... + @y_tick_start.setter + def y_tick_start(self, y_tick_start) -> None: ... + @property + def y_tick_step(self): ... + @y_tick_step.setter + def y_tick_step(self, y_tick_step) -> None: ... + @property + def shade_below(self): ... + @shade_below.setter + def shade_below(self, shade_below) -> None: ... + @property + def hover_dimension(self): ... + @hover_dimension.setter + def hover_dimension(self, hover_dimension) -> None: ... + @property + def position(self): ... + @position.setter + def position(self, position) -> None: ... + @property + def prefix(self): ... + @prefix.setter + def prefix(self, prefix) -> None: ... + @property + def suffix(self): ... + @suffix.setter + def suffix(self, suffix) -> None: ... + @property + def decimal_places(self): ... + @decimal_places.setter + def decimal_places(self, decimal_places) -> None: ... + @property + def legend_colorize_rows(self): ... + @legend_colorize_rows.setter + def legend_colorize_rows(self, legend_colorize_rows) -> None: ... + @property + def legend_hide(self): ... + @legend_hide.setter + def legend_hide(self, legend_hide) -> None: ... + @property + def legend_opacity(self): ... + @legend_opacity.setter + def legend_opacity(self, legend_opacity) -> None: ... + @property + def legend_orientation_threshold(self): ... + @legend_orientation_threshold.setter + def legend_orientation_threshold(self, legend_orientation_threshold) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/line_protocol_error.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/line_protocol_error.pyi new file mode 100644 index 000000000..f610aed62 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/line_protocol_error.pyi @@ -0,0 +1,38 @@ +from _typeshed import Incomplete + +class LineProtocolError: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + code: Incomplete | None = ..., + message: Incomplete | None = ..., + op: Incomplete | None = ..., + err: Incomplete | None = ..., + line: Incomplete | None = ..., + ) -> None: ... + @property + def code(self): ... + @code.setter + def code(self, code) -> None: ... + @property + def message(self): ... + @message.setter + def message(self, message) -> None: ... + @property + def op(self): ... + @op.setter + def op(self, op) -> None: ... + @property + def err(self): ... + @err.setter + def err(self, err) -> None: ... + @property + def line(self): ... + @line.setter + def line(self, line) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/line_protocol_length_error.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/line_protocol_length_error.pyi new file mode 100644 index 000000000..5a278a79e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/line_protocol_length_error.pyi @@ -0,0 +1,19 @@ +from _typeshed import Incomplete + +class LineProtocolLengthError: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, code: Incomplete | None = ..., message: Incomplete | None = ...) -> None: ... + @property + def code(self): ... + @code.setter + def code(self, code) -> None: ... + @property + def message(self): ... + @message.setter + def message(self, message) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/links.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/links.pyi new file mode 100644 index 000000000..a24c7454f --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/links.pyi @@ -0,0 +1,19 @@ +from _typeshed import Incomplete + +class Links: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, next: Incomplete | None = ..., _self: Incomplete | None = ..., prev: Incomplete | None = ...) -> None: ... + @property + def next(self): ... + @next.setter + def next(self, next) -> None: ... + @property + def prev(self): ... + @prev.setter + def prev(self, prev) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/list_stacks_response.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/list_stacks_response.pyi new file mode 100644 index 000000000..6b550a0a0 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/list_stacks_response.pyi @@ -0,0 +1,15 @@ +from _typeshed import Incomplete + +class ListStacksResponse: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, stacks: Incomplete | None = ...) -> None: ... + @property + def stacks(self): ... + @stacks.setter + def stacks(self, stacks) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/log_event.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/log_event.pyi new file mode 100644 index 000000000..85d8fade2 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/log_event.pyi @@ -0,0 +1,25 @@ +from _typeshed import Incomplete + +class LogEvent: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, time: Incomplete | None = ..., message: Incomplete | None = ..., run_id: Incomplete | None = ... + ) -> None: ... + @property + def time(self): ... + @time.setter + def time(self, time) -> None: ... + @property + def message(self): ... + @message.setter + def message(self, message) -> None: ... + @property + def run_id(self): ... + @run_id.setter + def run_id(self, run_id) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/logical_expression.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/logical_expression.pyi new file mode 100644 index 000000000..154462de0 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/logical_expression.pyi @@ -0,0 +1,35 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.expression import Expression + +class LogicalExpression(Expression): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + type: Incomplete | None = ..., + operator: Incomplete | None = ..., + left: Incomplete | None = ..., + right: Incomplete | None = ..., + ) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def operator(self): ... + @operator.setter + def operator(self, operator) -> None: ... + @property + def left(self): ... + @left.setter + def left(self, left) -> None: ... + @property + def right(self): ... + @right.setter + def right(self, right) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/logs.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/logs.pyi new file mode 100644 index 000000000..a48b6f91c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/logs.pyi @@ -0,0 +1,15 @@ +from _typeshed import Incomplete + +class Logs: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, events: Incomplete | None = ...) -> None: ... + @property + def events(self): ... + @events.setter + def events(self, events) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/map_variable_properties.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/map_variable_properties.pyi new file mode 100644 index 000000000..d624ce949 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/map_variable_properties.pyi @@ -0,0 +1,21 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.variable_properties import VariableProperties + +class MapVariableProperties(VariableProperties): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, type: Incomplete | None = ..., values: Incomplete | None = ...) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def values(self): ... + @values.setter + def values(self, values) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/markdown_view_properties.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/markdown_view_properties.pyi new file mode 100644 index 000000000..77fd8035e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/markdown_view_properties.pyi @@ -0,0 +1,25 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.view_properties import ViewProperties + +class MarkdownViewProperties(ViewProperties): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, type: Incomplete | None = ..., shape: Incomplete | None = ..., note: Incomplete | None = ...) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def shape(self): ... + @shape.setter + def shape(self, shape) -> None: ... + @property + def note(self): ... + @note.setter + def note(self, note) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/measurement_schema.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/measurement_schema.pyi new file mode 100644 index 000000000..c6f8d6e0a --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/measurement_schema.pyi @@ -0,0 +1,48 @@ +from _typeshed import Incomplete + +class MeasurementSchema: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + id: Incomplete | None = ..., + org_id: Incomplete | None = ..., + bucket_id: Incomplete | None = ..., + name: Incomplete | None = ..., + columns: Incomplete | None = ..., + created_at: Incomplete | None = ..., + updated_at: Incomplete | None = ..., + ) -> None: ... + @property + def id(self): ... + @id.setter + def id(self, id) -> None: ... + @property + def org_id(self): ... + @org_id.setter + def org_id(self, org_id) -> None: ... + @property + def bucket_id(self): ... + @bucket_id.setter + def bucket_id(self, bucket_id) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def columns(self): ... + @columns.setter + def columns(self, columns) -> None: ... + @property + def created_at(self): ... + @created_at.setter + def created_at(self, created_at) -> None: ... + @property + def updated_at(self): ... + @updated_at.setter + def updated_at(self, updated_at) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/measurement_schema_column.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/measurement_schema_column.pyi new file mode 100644 index 000000000..b24812dd1 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/measurement_schema_column.pyi @@ -0,0 +1,25 @@ +from _typeshed import Incomplete + +class MeasurementSchemaColumn: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, name: Incomplete | None = ..., type: Incomplete | None = ..., data_type: Incomplete | None = ... + ) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def data_type(self): ... + @data_type.setter + def data_type(self, data_type) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/measurement_schema_create_request.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/measurement_schema_create_request.pyi new file mode 100644 index 000000000..ad1dfdcd7 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/measurement_schema_create_request.pyi @@ -0,0 +1,19 @@ +from _typeshed import Incomplete + +class MeasurementSchemaCreateRequest: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, name: Incomplete | None = ..., columns: Incomplete | None = ...) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def columns(self): ... + @columns.setter + def columns(self, columns) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/measurement_schema_list.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/measurement_schema_list.pyi new file mode 100644 index 000000000..f0fafb2af --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/measurement_schema_list.pyi @@ -0,0 +1,15 @@ +from _typeshed import Incomplete + +class MeasurementSchemaList: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, measurement_schemas: Incomplete | None = ...) -> None: ... + @property + def measurement_schemas(self): ... + @measurement_schemas.setter + def measurement_schemas(self, measurement_schemas) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/measurement_schema_update_request.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/measurement_schema_update_request.pyi new file mode 100644 index 000000000..5bdf02606 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/measurement_schema_update_request.pyi @@ -0,0 +1,15 @@ +from _typeshed import Incomplete + +class MeasurementSchemaUpdateRequest: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, columns: Incomplete | None = ...) -> None: ... + @property + def columns(self): ... + @columns.setter + def columns(self, columns) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/member_assignment.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/member_assignment.pyi new file mode 100644 index 000000000..68e2590f6 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/member_assignment.pyi @@ -0,0 +1,25 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.statement import Statement + +class MemberAssignment(Statement): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, type: Incomplete | None = ..., member: Incomplete | None = ..., init: Incomplete | None = ...) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def member(self): ... + @member.setter + def member(self, member) -> None: ... + @property + def init(self): ... + @init.setter + def init(self, init) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/member_expression.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/member_expression.pyi new file mode 100644 index 000000000..419a6dccb --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/member_expression.pyi @@ -0,0 +1,23 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.expression import Expression + +class MemberExpression(Expression): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, type: Incomplete | None = ..., object: Incomplete | None = ..., _property: Incomplete | None = ... + ) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def object(self): ... + @object.setter + def object(self, object) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/metadata_backup.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/metadata_backup.pyi new file mode 100644 index 000000000..3cf8ef9a4 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/metadata_backup.pyi @@ -0,0 +1,23 @@ +from _typeshed import Incomplete + +class MetadataBackup: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, kv: Incomplete | None = ..., sql: Incomplete | None = ..., buckets: Incomplete | None = ...) -> None: ... + @property + def kv(self): ... + @kv.setter + def kv(self, kv) -> None: ... + @property + def sql(self): ... + @sql.setter + def sql(self, sql) -> None: ... + @property + def buckets(self): ... + @buckets.setter + def buckets(self, buckets) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/model_property.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/model_property.pyi new file mode 100644 index 000000000..759dc4f3e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/model_property.pyi @@ -0,0 +1,23 @@ +from _typeshed import Incomplete + +class ModelProperty: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, type: Incomplete | None = ..., key: Incomplete | None = ..., value: Incomplete | None = ...) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def key(self): ... + @key.setter + def key(self, key) -> None: ... + @property + def value(self): ... + @value.setter + def value(self, value) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/mosaic_view_properties.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/mosaic_view_properties.pyi new file mode 100644 index 000000000..fdc39b0a9 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/mosaic_view_properties.pyi @@ -0,0 +1,160 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.view_properties import ViewProperties + +class MosaicViewProperties(ViewProperties): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + time_format: Incomplete | None = ..., + type: Incomplete | None = ..., + queries: Incomplete | None = ..., + colors: Incomplete | None = ..., + shape: Incomplete | None = ..., + note: Incomplete | None = ..., + show_note_when_empty: Incomplete | None = ..., + x_column: Incomplete | None = ..., + generate_x_axis_ticks: Incomplete | None = ..., + x_total_ticks: Incomplete | None = ..., + x_tick_start: Incomplete | None = ..., + x_tick_step: Incomplete | None = ..., + y_label_column_separator: Incomplete | None = ..., + y_label_columns: Incomplete | None = ..., + y_series_columns: Incomplete | None = ..., + fill_columns: Incomplete | None = ..., + x_domain: Incomplete | None = ..., + y_domain: Incomplete | None = ..., + x_axis_label: Incomplete | None = ..., + y_axis_label: Incomplete | None = ..., + x_prefix: Incomplete | None = ..., + x_suffix: Incomplete | None = ..., + y_prefix: Incomplete | None = ..., + y_suffix: Incomplete | None = ..., + hover_dimension: Incomplete | None = ..., + legend_colorize_rows: Incomplete | None = ..., + legend_hide: Incomplete | None = ..., + legend_opacity: Incomplete | None = ..., + legend_orientation_threshold: Incomplete | None = ..., + ) -> None: ... + @property + def time_format(self): ... + @time_format.setter + def time_format(self, time_format) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def queries(self): ... + @queries.setter + def queries(self, queries) -> None: ... + @property + def colors(self): ... + @colors.setter + def colors(self, colors) -> None: ... + @property + def shape(self): ... + @shape.setter + def shape(self, shape) -> None: ... + @property + def note(self): ... + @note.setter + def note(self, note) -> None: ... + @property + def show_note_when_empty(self): ... + @show_note_when_empty.setter + def show_note_when_empty(self, show_note_when_empty) -> None: ... + @property + def x_column(self): ... + @x_column.setter + def x_column(self, x_column) -> None: ... + @property + def generate_x_axis_ticks(self): ... + @generate_x_axis_ticks.setter + def generate_x_axis_ticks(self, generate_x_axis_ticks) -> None: ... + @property + def x_total_ticks(self): ... + @x_total_ticks.setter + def x_total_ticks(self, x_total_ticks) -> None: ... + @property + def x_tick_start(self): ... + @x_tick_start.setter + def x_tick_start(self, x_tick_start) -> None: ... + @property + def x_tick_step(self): ... + @x_tick_step.setter + def x_tick_step(self, x_tick_step) -> None: ... + @property + def y_label_column_separator(self): ... + @y_label_column_separator.setter + def y_label_column_separator(self, y_label_column_separator) -> None: ... + @property + def y_label_columns(self): ... + @y_label_columns.setter + def y_label_columns(self, y_label_columns) -> None: ... + @property + def y_series_columns(self): ... + @y_series_columns.setter + def y_series_columns(self, y_series_columns) -> None: ... + @property + def fill_columns(self): ... + @fill_columns.setter + def fill_columns(self, fill_columns) -> None: ... + @property + def x_domain(self): ... + @x_domain.setter + def x_domain(self, x_domain) -> None: ... + @property + def y_domain(self): ... + @y_domain.setter + def y_domain(self, y_domain) -> None: ... + @property + def x_axis_label(self): ... + @x_axis_label.setter + def x_axis_label(self, x_axis_label) -> None: ... + @property + def y_axis_label(self): ... + @y_axis_label.setter + def y_axis_label(self, y_axis_label) -> None: ... + @property + def x_prefix(self): ... + @x_prefix.setter + def x_prefix(self, x_prefix) -> None: ... + @property + def x_suffix(self): ... + @x_suffix.setter + def x_suffix(self, x_suffix) -> None: ... + @property + def y_prefix(self): ... + @y_prefix.setter + def y_prefix(self, y_prefix) -> None: ... + @property + def y_suffix(self): ... + @y_suffix.setter + def y_suffix(self, y_suffix) -> None: ... + @property + def hover_dimension(self): ... + @hover_dimension.setter + def hover_dimension(self, hover_dimension) -> None: ... + @property + def legend_colorize_rows(self): ... + @legend_colorize_rows.setter + def legend_colorize_rows(self, legend_colorize_rows) -> None: ... + @property + def legend_hide(self): ... + @legend_hide.setter + def legend_hide(self, legend_hide) -> None: ... + @property + def legend_opacity(self): ... + @legend_opacity.setter + def legend_opacity(self, legend_opacity) -> None: ... + @property + def legend_orientation_threshold(self): ... + @legend_orientation_threshold.setter + def legend_orientation_threshold(self, legend_orientation_threshold) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/node.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/node.pyi new file mode 100644 index 000000000..6535e25d0 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/node.pyi @@ -0,0 +1,10 @@ +from _typeshed import Incomplete + +class Node: + openapi_types: Incomplete + attribute_map: Incomplete + def __init__(self) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/notification_endpoint.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/notification_endpoint.pyi new file mode 100644 index 000000000..de8ffbdce --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/notification_endpoint.pyi @@ -0,0 +1,17 @@ +from _typeshed import Incomplete + +class NotificationEndpoint: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator_value_class_map: Incomplete + discriminator: str + def __init__(self, type: Incomplete | None = ...) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + def get_real_child_model(self, data): ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/notification_endpoint_base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/notification_endpoint_base.pyi new file mode 100644 index 000000000..bb7a37d4c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/notification_endpoint_base.pyi @@ -0,0 +1,68 @@ +from _typeshed import Incomplete + +class NotificationEndpointBase: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + id: Incomplete | None = ..., + org_id: Incomplete | None = ..., + user_id: Incomplete | None = ..., + created_at: Incomplete | None = ..., + updated_at: Incomplete | None = ..., + description: Incomplete | None = ..., + name: Incomplete | None = ..., + status: str = ..., + labels: Incomplete | None = ..., + links: Incomplete | None = ..., + type: Incomplete | None = ..., + ) -> None: ... + @property + def id(self): ... + @id.setter + def id(self, id) -> None: ... + @property + def org_id(self): ... + @org_id.setter + def org_id(self, org_id) -> None: ... + @property + def user_id(self): ... + @user_id.setter + def user_id(self, user_id) -> None: ... + @property + def created_at(self): ... + @created_at.setter + def created_at(self, created_at) -> None: ... + @property + def updated_at(self): ... + @updated_at.setter + def updated_at(self, updated_at) -> None: ... + @property + def description(self): ... + @description.setter + def description(self, description) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def status(self): ... + @status.setter + def status(self, status) -> None: ... + @property + def labels(self): ... + @labels.setter + def labels(self, labels) -> None: ... + @property + def links(self): ... + @links.setter + def links(self, links) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/notification_endpoint_base_links.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/notification_endpoint_base_links.pyi new file mode 100644 index 000000000..e945e848c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/notification_endpoint_base_links.pyi @@ -0,0 +1,29 @@ +from _typeshed import Incomplete + +class NotificationEndpointBaseLinks: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + _self: Incomplete | None = ..., + labels: Incomplete | None = ..., + members: Incomplete | None = ..., + owners: Incomplete | None = ..., + ) -> None: ... + @property + def labels(self): ... + @labels.setter + def labels(self, labels) -> None: ... + @property + def members(self): ... + @members.setter + def members(self, members) -> None: ... + @property + def owners(self): ... + @owners.setter + def owners(self, owners) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/notification_endpoint_discriminator.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/notification_endpoint_discriminator.pyi new file mode 100644 index 000000000..2315c3d5d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/notification_endpoint_discriminator.pyi @@ -0,0 +1,26 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.notification_endpoint_base import NotificationEndpointBase + +class NotificationEndpointDiscriminator(NotificationEndpointBase): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + id: Incomplete | None = ..., + org_id: Incomplete | None = ..., + user_id: Incomplete | None = ..., + created_at: Incomplete | None = ..., + updated_at: Incomplete | None = ..., + description: Incomplete | None = ..., + name: Incomplete | None = ..., + status: str = ..., + labels: Incomplete | None = ..., + links: Incomplete | None = ..., + type: Incomplete | None = ..., + ) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/notification_endpoint_type.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/notification_endpoint_type.pyi new file mode 100644 index 000000000..130fdf443 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/notification_endpoint_type.pyi @@ -0,0 +1,14 @@ +from _typeshed import Incomplete + +class NotificationEndpointType: + SLACK: str + PAGERDUTY: str + HTTP: str + TELEGRAM: str + openapi_types: Incomplete + attribute_map: Incomplete + def __init__(self) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/notification_endpoint_update.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/notification_endpoint_update.pyi new file mode 100644 index 000000000..80f30dffa --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/notification_endpoint_update.pyi @@ -0,0 +1,25 @@ +from _typeshed import Incomplete + +class NotificationEndpointUpdate: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, name: Incomplete | None = ..., description: Incomplete | None = ..., status: Incomplete | None = ... + ) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def description(self): ... + @description.setter + def description(self, description) -> None: ... + @property + def status(self): ... + @status.setter + def status(self, status) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/notification_endpoints.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/notification_endpoints.pyi new file mode 100644 index 000000000..5f3fab0ef --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/notification_endpoints.pyi @@ -0,0 +1,19 @@ +from _typeshed import Incomplete + +class NotificationEndpoints: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, notification_endpoints: Incomplete | None = ..., links: Incomplete | None = ...) -> None: ... + @property + def notification_endpoints(self): ... + @notification_endpoints.setter + def notification_endpoints(self, notification_endpoints) -> None: ... + @property + def links(self): ... + @links.setter + def links(self, links) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/notification_rule.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/notification_rule.pyi new file mode 100644 index 000000000..8eeca7f6c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/notification_rule.pyi @@ -0,0 +1,17 @@ +from _typeshed import Incomplete + +class NotificationRule: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator_value_class_map: Incomplete + discriminator: str + def __init__(self, type: Incomplete | None = ...) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + def get_real_child_model(self, data): ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/notification_rule_base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/notification_rule_base.pyi new file mode 100644 index 000000000..636a256f9 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/notification_rule_base.pyi @@ -0,0 +1,128 @@ +from _typeshed import Incomplete + +class NotificationRuleBase: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + latest_completed: Incomplete | None = ..., + last_run_status: Incomplete | None = ..., + last_run_error: Incomplete | None = ..., + id: Incomplete | None = ..., + endpoint_id: Incomplete | None = ..., + org_id: Incomplete | None = ..., + task_id: Incomplete | None = ..., + owner_id: Incomplete | None = ..., + created_at: Incomplete | None = ..., + updated_at: Incomplete | None = ..., + status: Incomplete | None = ..., + name: Incomplete | None = ..., + sleep_until: Incomplete | None = ..., + every: Incomplete | None = ..., + offset: Incomplete | None = ..., + runbook_link: Incomplete | None = ..., + limit_every: Incomplete | None = ..., + limit: Incomplete | None = ..., + tag_rules: Incomplete | None = ..., + description: Incomplete | None = ..., + status_rules: Incomplete | None = ..., + labels: Incomplete | None = ..., + links: Incomplete | None = ..., + ) -> None: ... + @property + def latest_completed(self): ... + @latest_completed.setter + def latest_completed(self, latest_completed) -> None: ... + @property + def last_run_status(self): ... + @last_run_status.setter + def last_run_status(self, last_run_status) -> None: ... + @property + def last_run_error(self): ... + @last_run_error.setter + def last_run_error(self, last_run_error) -> None: ... + @property + def id(self): ... + @id.setter + def id(self, id) -> None: ... + @property + def endpoint_id(self): ... + @endpoint_id.setter + def endpoint_id(self, endpoint_id) -> None: ... + @property + def org_id(self): ... + @org_id.setter + def org_id(self, org_id) -> None: ... + @property + def task_id(self): ... + @task_id.setter + def task_id(self, task_id) -> None: ... + @property + def owner_id(self): ... + @owner_id.setter + def owner_id(self, owner_id) -> None: ... + @property + def created_at(self): ... + @created_at.setter + def created_at(self, created_at) -> None: ... + @property + def updated_at(self): ... + @updated_at.setter + def updated_at(self, updated_at) -> None: ... + @property + def status(self): ... + @status.setter + def status(self, status) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def sleep_until(self): ... + @sleep_until.setter + def sleep_until(self, sleep_until) -> None: ... + @property + def every(self): ... + @every.setter + def every(self, every) -> None: ... + @property + def offset(self): ... + @offset.setter + def offset(self, offset) -> None: ... + @property + def runbook_link(self): ... + @runbook_link.setter + def runbook_link(self, runbook_link) -> None: ... + @property + def limit_every(self): ... + @limit_every.setter + def limit_every(self, limit_every) -> None: ... + @property + def limit(self): ... + @limit.setter + def limit(self, limit) -> None: ... + @property + def tag_rules(self): ... + @tag_rules.setter + def tag_rules(self, tag_rules) -> None: ... + @property + def description(self): ... + @description.setter + def description(self, description) -> None: ... + @property + def status_rules(self): ... + @status_rules.setter + def status_rules(self, status_rules) -> None: ... + @property + def labels(self): ... + @labels.setter + def labels(self, labels) -> None: ... + @property + def links(self): ... + @links.setter + def links(self, links) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/notification_rule_base_links.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/notification_rule_base_links.pyi new file mode 100644 index 000000000..a745181a2 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/notification_rule_base_links.pyi @@ -0,0 +1,34 @@ +from _typeshed import Incomplete + +class NotificationRuleBaseLinks: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + _self: Incomplete | None = ..., + labels: Incomplete | None = ..., + members: Incomplete | None = ..., + owners: Incomplete | None = ..., + query: Incomplete | None = ..., + ) -> None: ... + @property + def labels(self): ... + @labels.setter + def labels(self, labels) -> None: ... + @property + def members(self): ... + @members.setter + def members(self, members) -> None: ... + @property + def owners(self): ... + @owners.setter + def owners(self, owners) -> None: ... + @property + def query(self): ... + @query.setter + def query(self, query) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/notification_rule_discriminator.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/notification_rule_discriminator.pyi new file mode 100644 index 000000000..bbb750af1 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/notification_rule_discriminator.pyi @@ -0,0 +1,38 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.notification_rule_base import NotificationRuleBase + +class NotificationRuleDiscriminator(NotificationRuleBase): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + latest_completed: Incomplete | None = ..., + last_run_status: Incomplete | None = ..., + last_run_error: Incomplete | None = ..., + id: Incomplete | None = ..., + endpoint_id: Incomplete | None = ..., + org_id: Incomplete | None = ..., + task_id: Incomplete | None = ..., + owner_id: Incomplete | None = ..., + created_at: Incomplete | None = ..., + updated_at: Incomplete | None = ..., + status: Incomplete | None = ..., + name: Incomplete | None = ..., + sleep_until: Incomplete | None = ..., + every: Incomplete | None = ..., + offset: Incomplete | None = ..., + runbook_link: Incomplete | None = ..., + limit_every: Incomplete | None = ..., + limit: Incomplete | None = ..., + tag_rules: Incomplete | None = ..., + description: Incomplete | None = ..., + status_rules: Incomplete | None = ..., + labels: Incomplete | None = ..., + links: Incomplete | None = ..., + ) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/notification_rule_update.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/notification_rule_update.pyi new file mode 100644 index 000000000..84062324d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/notification_rule_update.pyi @@ -0,0 +1,25 @@ +from _typeshed import Incomplete + +class NotificationRuleUpdate: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, name: Incomplete | None = ..., description: Incomplete | None = ..., status: Incomplete | None = ... + ) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def description(self): ... + @description.setter + def description(self, description) -> None: ... + @property + def status(self): ... + @status.setter + def status(self, status) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/notification_rules.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/notification_rules.pyi new file mode 100644 index 000000000..e1d717b6b --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/notification_rules.pyi @@ -0,0 +1,19 @@ +from _typeshed import Incomplete + +class NotificationRules: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, notification_rules: Incomplete | None = ..., links: Incomplete | None = ...) -> None: ... + @property + def notification_rules(self): ... + @notification_rules.setter + def notification_rules(self, notification_rules) -> None: ... + @property + def links(self): ... + @links.setter + def links(self, links) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/object_expression.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/object_expression.pyi new file mode 100644 index 000000000..e251b611e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/object_expression.pyi @@ -0,0 +1,21 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.expression import Expression + +class ObjectExpression(Expression): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, type: Incomplete | None = ..., properties: Incomplete | None = ...) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def properties(self): ... + @properties.setter + def properties(self, properties) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/onboarding_request.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/onboarding_request.pyi new file mode 100644 index 000000000..fa70e8432 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/onboarding_request.pyi @@ -0,0 +1,48 @@ +from _typeshed import Incomplete + +class OnboardingRequest: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + username: Incomplete | None = ..., + password: Incomplete | None = ..., + org: Incomplete | None = ..., + bucket: Incomplete | None = ..., + retention_period_seconds: Incomplete | None = ..., + retention_period_hrs: Incomplete | None = ..., + token: Incomplete | None = ..., + ) -> None: ... + @property + def username(self): ... + @username.setter + def username(self, username) -> None: ... + @property + def password(self): ... + @password.setter + def password(self, password) -> None: ... + @property + def org(self): ... + @org.setter + def org(self, org) -> None: ... + @property + def bucket(self): ... + @bucket.setter + def bucket(self, bucket) -> None: ... + @property + def retention_period_seconds(self): ... + @retention_period_seconds.setter + def retention_period_seconds(self, retention_period_seconds) -> None: ... + @property + def retention_period_hrs(self): ... + @retention_period_hrs.setter + def retention_period_hrs(self, retention_period_hrs) -> None: ... + @property + def token(self): ... + @token.setter + def token(self, token) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/onboarding_response.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/onboarding_response.pyi new file mode 100644 index 000000000..9b81563a1 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/onboarding_response.pyi @@ -0,0 +1,33 @@ +from _typeshed import Incomplete + +class OnboardingResponse: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + user: Incomplete | None = ..., + org: Incomplete | None = ..., + bucket: Incomplete | None = ..., + auth: Incomplete | None = ..., + ) -> None: ... + @property + def user(self): ... + @user.setter + def user(self, user) -> None: ... + @property + def org(self): ... + @org.setter + def org(self, org) -> None: ... + @property + def bucket(self): ... + @bucket.setter + def bucket(self, bucket) -> None: ... + @property + def auth(self): ... + @auth.setter + def auth(self, auth) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/option_statement.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/option_statement.pyi new file mode 100644 index 000000000..a36e898ac --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/option_statement.pyi @@ -0,0 +1,21 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.statement import Statement + +class OptionStatement(Statement): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, type: Incomplete | None = ..., assignment: Incomplete | None = ...) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def assignment(self): ... + @assignment.setter + def assignment(self, assignment) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/organization.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/organization.pyi new file mode 100644 index 000000000..01274bd29 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/organization.pyi @@ -0,0 +1,48 @@ +from _typeshed import Incomplete + +class Organization: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + links: Incomplete | None = ..., + id: Incomplete | None = ..., + name: Incomplete | None = ..., + description: Incomplete | None = ..., + created_at: Incomplete | None = ..., + updated_at: Incomplete | None = ..., + status: str = ..., + ) -> None: ... + @property + def links(self): ... + @links.setter + def links(self, links) -> None: ... + @property + def id(self): ... + @id.setter + def id(self, id) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def description(self): ... + @description.setter + def description(self, description) -> None: ... + @property + def created_at(self): ... + @created_at.setter + def created_at(self, created_at) -> None: ... + @property + def updated_at(self): ... + @updated_at.setter + def updated_at(self, updated_at) -> None: ... + @property + def status(self): ... + @status.setter + def status(self, status) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/organization_links.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/organization_links.pyi new file mode 100644 index 000000000..7f958c5eb --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/organization_links.pyi @@ -0,0 +1,49 @@ +from _typeshed import Incomplete + +class OrganizationLinks: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + _self: Incomplete | None = ..., + members: Incomplete | None = ..., + owners: Incomplete | None = ..., + labels: Incomplete | None = ..., + secrets: Incomplete | None = ..., + buckets: Incomplete | None = ..., + tasks: Incomplete | None = ..., + dashboards: Incomplete | None = ..., + ) -> None: ... + @property + def members(self): ... + @members.setter + def members(self, members) -> None: ... + @property + def owners(self): ... + @owners.setter + def owners(self, owners) -> None: ... + @property + def labels(self): ... + @labels.setter + def labels(self, labels) -> None: ... + @property + def secrets(self): ... + @secrets.setter + def secrets(self, secrets) -> None: ... + @property + def buckets(self): ... + @buckets.setter + def buckets(self, buckets) -> None: ... + @property + def tasks(self): ... + @tasks.setter + def tasks(self, tasks) -> None: ... + @property + def dashboards(self): ... + @dashboards.setter + def dashboards(self, dashboards) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/organizations.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/organizations.pyi new file mode 100644 index 000000000..9cfa3535a --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/organizations.pyi @@ -0,0 +1,19 @@ +from _typeshed import Incomplete + +class Organizations: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, links: Incomplete | None = ..., orgs: Incomplete | None = ...) -> None: ... + @property + def links(self): ... + @links.setter + def links(self, links) -> None: ... + @property + def orgs(self): ... + @orgs.setter + def orgs(self, orgs) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/package.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/package.pyi new file mode 100644 index 000000000..2a9b332ba --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/package.pyi @@ -0,0 +1,33 @@ +from _typeshed import Incomplete + +class Package: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + type: Incomplete | None = ..., + path: Incomplete | None = ..., + package: Incomplete | None = ..., + files: Incomplete | None = ..., + ) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def path(self): ... + @path.setter + def path(self, path) -> None: ... + @property + def package(self): ... + @package.setter + def package(self, package) -> None: ... + @property + def files(self): ... + @files.setter + def files(self, files) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/package_clause.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/package_clause.pyi new file mode 100644 index 000000000..4561d4128 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/package_clause.pyi @@ -0,0 +1,19 @@ +from _typeshed import Incomplete + +class PackageClause: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, type: Incomplete | None = ..., name: Incomplete | None = ...) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/pager_duty_notification_endpoint.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/pager_duty_notification_endpoint.pyi new file mode 100644 index 000000000..c3b15a364 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/pager_duty_notification_endpoint.pyi @@ -0,0 +1,36 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.notification_endpoint_discriminator import NotificationEndpointDiscriminator + +class PagerDutyNotificationEndpoint(NotificationEndpointDiscriminator): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + client_url: Incomplete | None = ..., + routing_key: Incomplete | None = ..., + id: Incomplete | None = ..., + org_id: Incomplete | None = ..., + user_id: Incomplete | None = ..., + created_at: Incomplete | None = ..., + updated_at: Incomplete | None = ..., + description: Incomplete | None = ..., + name: Incomplete | None = ..., + status: str = ..., + labels: Incomplete | None = ..., + links: Incomplete | None = ..., + type: str = ..., + ) -> None: ... + @property + def client_url(self): ... + @client_url.setter + def client_url(self, client_url) -> None: ... + @property + def routing_key(self): ... + @routing_key.setter + def routing_key(self, routing_key) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/pager_duty_notification_rule.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/pager_duty_notification_rule.pyi new file mode 100644 index 000000000..226f29d67 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/pager_duty_notification_rule.pyi @@ -0,0 +1,40 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.pager_duty_notification_rule_base import PagerDutyNotificationRuleBase + +class PagerDutyNotificationRule(PagerDutyNotificationRuleBase): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + type: str = ..., + message_template: Incomplete | None = ..., + latest_completed: Incomplete | None = ..., + last_run_status: Incomplete | None = ..., + last_run_error: Incomplete | None = ..., + id: Incomplete | None = ..., + endpoint_id: Incomplete | None = ..., + org_id: Incomplete | None = ..., + task_id: Incomplete | None = ..., + owner_id: Incomplete | None = ..., + created_at: Incomplete | None = ..., + updated_at: Incomplete | None = ..., + status: Incomplete | None = ..., + name: Incomplete | None = ..., + sleep_until: Incomplete | None = ..., + every: Incomplete | None = ..., + offset: Incomplete | None = ..., + runbook_link: Incomplete | None = ..., + limit_every: Incomplete | None = ..., + limit: Incomplete | None = ..., + tag_rules: Incomplete | None = ..., + description: Incomplete | None = ..., + status_rules: Incomplete | None = ..., + labels: Incomplete | None = ..., + links: Incomplete | None = ..., + ) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/pager_duty_notification_rule_base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/pager_duty_notification_rule_base.pyi new file mode 100644 index 000000000..5b4e9ac62 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/pager_duty_notification_rule_base.pyi @@ -0,0 +1,48 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.notification_rule_discriminator import NotificationRuleDiscriminator + +class PagerDutyNotificationRuleBase(NotificationRuleDiscriminator): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + type: Incomplete | None = ..., + message_template: Incomplete | None = ..., + latest_completed: Incomplete | None = ..., + last_run_status: Incomplete | None = ..., + last_run_error: Incomplete | None = ..., + id: Incomplete | None = ..., + endpoint_id: Incomplete | None = ..., + org_id: Incomplete | None = ..., + task_id: Incomplete | None = ..., + owner_id: Incomplete | None = ..., + created_at: Incomplete | None = ..., + updated_at: Incomplete | None = ..., + status: Incomplete | None = ..., + name: Incomplete | None = ..., + sleep_until: Incomplete | None = ..., + every: Incomplete | None = ..., + offset: Incomplete | None = ..., + runbook_link: Incomplete | None = ..., + limit_every: Incomplete | None = ..., + limit: Incomplete | None = ..., + tag_rules: Incomplete | None = ..., + description: Incomplete | None = ..., + status_rules: Incomplete | None = ..., + labels: Incomplete | None = ..., + links: Incomplete | None = ..., + ) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def message_template(self): ... + @message_template.setter + def message_template(self, message_template) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/paren_expression.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/paren_expression.pyi new file mode 100644 index 000000000..bf43111cf --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/paren_expression.pyi @@ -0,0 +1,21 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.expression import Expression + +class ParenExpression(Expression): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, type: Incomplete | None = ..., expression: Incomplete | None = ...) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def expression(self): ... + @expression.setter + def expression(self, expression) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/password_reset_body.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/password_reset_body.pyi new file mode 100644 index 000000000..fe33edc20 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/password_reset_body.pyi @@ -0,0 +1,15 @@ +from _typeshed import Incomplete + +class PasswordResetBody: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, password: Incomplete | None = ...) -> None: ... + @property + def password(self): ... + @password.setter + def password(self, password) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/patch_bucket_request.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/patch_bucket_request.pyi new file mode 100644 index 000000000..743ce3d64 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/patch_bucket_request.pyi @@ -0,0 +1,25 @@ +from _typeshed import Incomplete + +class PatchBucketRequest: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, name: Incomplete | None = ..., description: Incomplete | None = ..., retention_rules: Incomplete | None = ... + ) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def description(self): ... + @description.setter + def description(self, description) -> None: ... + @property + def retention_rules(self): ... + @retention_rules.setter + def retention_rules(self, retention_rules) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/patch_dashboard_request.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/patch_dashboard_request.pyi new file mode 100644 index 000000000..4101ccf89 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/patch_dashboard_request.pyi @@ -0,0 +1,25 @@ +from _typeshed import Incomplete + +class PatchDashboardRequest: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, name: Incomplete | None = ..., description: Incomplete | None = ..., cells: Incomplete | None = ... + ) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def description(self): ... + @description.setter + def description(self, description) -> None: ... + @property + def cells(self): ... + @cells.setter + def cells(self, cells) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/patch_organization_request.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/patch_organization_request.pyi new file mode 100644 index 000000000..d82975038 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/patch_organization_request.pyi @@ -0,0 +1,19 @@ +from _typeshed import Incomplete + +class PatchOrganizationRequest: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, name: Incomplete | None = ..., description: Incomplete | None = ...) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def description(self): ... + @description.setter + def description(self, description) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/patch_retention_rule.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/patch_retention_rule.pyi new file mode 100644 index 000000000..4078c21f6 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/patch_retention_rule.pyi @@ -0,0 +1,25 @@ +from _typeshed import Incomplete + +class PatchRetentionRule: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, type: str = ..., every_seconds: Incomplete | None = ..., shard_group_duration_seconds: Incomplete | None = ... + ) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def every_seconds(self): ... + @every_seconds.setter + def every_seconds(self, every_seconds) -> None: ... + @property + def shard_group_duration_seconds(self): ... + @shard_group_duration_seconds.setter + def shard_group_duration_seconds(self, shard_group_duration_seconds) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/patch_stack_request.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/patch_stack_request.pyi new file mode 100644 index 000000000..f272f1b35 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/patch_stack_request.pyi @@ -0,0 +1,33 @@ +from _typeshed import Incomplete + +class PatchStackRequest: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + name: Incomplete | None = ..., + description: Incomplete | None = ..., + template_ur_ls: Incomplete | None = ..., + additional_resources: Incomplete | None = ..., + ) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def description(self): ... + @description.setter + def description(self, description) -> None: ... + @property + def template_ur_ls(self): ... + @template_ur_ls.setter + def template_ur_ls(self, template_ur_ls) -> None: ... + @property + def additional_resources(self): ... + @additional_resources.setter + def additional_resources(self, additional_resources) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/patch_stack_request_additional_resources.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/patch_stack_request_additional_resources.pyi new file mode 100644 index 000000000..9976e39ef --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/patch_stack_request_additional_resources.pyi @@ -0,0 +1,25 @@ +from _typeshed import Incomplete + +class PatchStackRequestAdditionalResources: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, resource_id: Incomplete | None = ..., kind: Incomplete | None = ..., template_meta_name: Incomplete | None = ... + ) -> None: ... + @property + def resource_id(self): ... + @resource_id.setter + def resource_id(self, resource_id) -> None: ... + @property + def kind(self): ... + @kind.setter + def kind(self, kind) -> None: ... + @property + def template_meta_name(self): ... + @template_meta_name.setter + def template_meta_name(self, template_meta_name) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/permission.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/permission.pyi new file mode 100644 index 000000000..f755646e6 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/permission.pyi @@ -0,0 +1,19 @@ +from _typeshed import Incomplete + +class Permission: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, action: Incomplete | None = ..., resource: Incomplete | None = ...) -> None: ... + @property + def action(self): ... + @action.setter + def action(self, action) -> None: ... + @property + def resource(self): ... + @resource.setter + def resource(self, resource) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/permission_resource.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/permission_resource.pyi new file mode 100644 index 000000000..6c86fd5a9 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/permission_resource.pyi @@ -0,0 +1,38 @@ +from _typeshed import Incomplete + +class PermissionResource: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + type: Incomplete | None = ..., + id: Incomplete | None = ..., + name: Incomplete | None = ..., + org_id: Incomplete | None = ..., + org: Incomplete | None = ..., + ) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def id(self): ... + @id.setter + def id(self, id) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def org_id(self): ... + @org_id.setter + def org_id(self, org_id) -> None: ... + @property + def org(self): ... + @org.setter + def org(self, org) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/pipe_expression.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/pipe_expression.pyi new file mode 100644 index 000000000..70c9bd868 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/pipe_expression.pyi @@ -0,0 +1,27 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.expression import Expression + +class PipeExpression(Expression): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, type: Incomplete | None = ..., argument: Incomplete | None = ..., call: Incomplete | None = ... + ) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def argument(self): ... + @argument.setter + def argument(self, argument) -> None: ... + @property + def call(self): ... + @call.setter + def call(self, call) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/pipe_literal.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/pipe_literal.pyi new file mode 100644 index 000000000..100806090 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/pipe_literal.pyi @@ -0,0 +1,17 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.expression import Expression + +class PipeLiteral(Expression): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, type: Incomplete | None = ...) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/post_bucket_request.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/post_bucket_request.pyi new file mode 100644 index 000000000..36e452ada --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/post_bucket_request.pyi @@ -0,0 +1,43 @@ +from _typeshed import Incomplete + +class PostBucketRequest: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + org_id: Incomplete | None = ..., + name: Incomplete | None = ..., + description: Incomplete | None = ..., + rp: Incomplete | None = ..., + retention_rules: Incomplete | None = ..., + schema_type: Incomplete | None = ..., + ) -> None: ... + @property + def org_id(self): ... + @org_id.setter + def org_id(self, org_id) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def description(self): ... + @description.setter + def description(self, description) -> None: ... + @property + def rp(self): ... + @rp.setter + def rp(self, rp) -> None: ... + @property + def retention_rules(self): ... + @retention_rules.setter + def retention_rules(self, retention_rules) -> None: ... + @property + def schema_type(self): ... + @schema_type.setter + def schema_type(self, schema_type) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/post_check.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/post_check.pyi new file mode 100644 index 000000000..b2a71ff5f --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/post_check.pyi @@ -0,0 +1,17 @@ +from _typeshed import Incomplete + +class PostCheck: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator_value_class_map: Incomplete + discriminator: str + def __init__(self, type: Incomplete | None = ...) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + def get_real_child_model(self, data): ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/post_notification_endpoint.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/post_notification_endpoint.pyi new file mode 100644 index 000000000..63916caa9 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/post_notification_endpoint.pyi @@ -0,0 +1,17 @@ +from _typeshed import Incomplete + +class PostNotificationEndpoint: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator_value_class_map: Incomplete + discriminator: str + def __init__(self, type: Incomplete | None = ...) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + def get_real_child_model(self, data): ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/post_notification_rule.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/post_notification_rule.pyi new file mode 100644 index 000000000..708f39c9e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/post_notification_rule.pyi @@ -0,0 +1,17 @@ +from _typeshed import Incomplete + +class PostNotificationRule: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator_value_class_map: Incomplete + discriminator: str + def __init__(self, type: Incomplete | None = ...) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + def get_real_child_model(self, data): ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/post_organization_request.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/post_organization_request.pyi new file mode 100644 index 000000000..e5621f0a1 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/post_organization_request.pyi @@ -0,0 +1,19 @@ +from _typeshed import Incomplete + +class PostOrganizationRequest: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, name: Incomplete | None = ..., description: Incomplete | None = ...) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def description(self): ... + @description.setter + def description(self, description) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/post_restore_kv_response.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/post_restore_kv_response.pyi new file mode 100644 index 000000000..b429b19c1 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/post_restore_kv_response.pyi @@ -0,0 +1,15 @@ +from _typeshed import Incomplete + +class PostRestoreKVResponse: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, token: Incomplete | None = ...) -> None: ... + @property + def token(self): ... + @token.setter + def token(self, token) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/post_stack_request.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/post_stack_request.pyi new file mode 100644 index 000000000..91696b89d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/post_stack_request.pyi @@ -0,0 +1,33 @@ +from _typeshed import Incomplete + +class PostStackRequest: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + org_id: Incomplete | None = ..., + name: Incomplete | None = ..., + description: Incomplete | None = ..., + urls: Incomplete | None = ..., + ) -> None: ... + @property + def org_id(self): ... + @org_id.setter + def org_id(self, org_id) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def description(self): ... + @description.setter + def description(self, description) -> None: ... + @property + def urls(self): ... + @urls.setter + def urls(self, urls) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/property_key.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/property_key.pyi new file mode 100644 index 000000000..176730377 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/property_key.pyi @@ -0,0 +1,13 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.expression import Expression + +class PropertyKey(Expression): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/query.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/query.pyi new file mode 100644 index 000000000..35f787ec8 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/query.pyi @@ -0,0 +1,43 @@ +from _typeshed import Incomplete + +class Query: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + extern: Incomplete | None = ..., + query: Incomplete | None = ..., + type: Incomplete | None = ..., + params: Incomplete | None = ..., + dialect: Incomplete | None = ..., + now: Incomplete | None = ..., + ) -> None: ... + @property + def extern(self): ... + @extern.setter + def extern(self, extern) -> None: ... + @property + def query(self): ... + @query.setter + def query(self, query) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def params(self): ... + @params.setter + def params(self, params) -> None: ... + @property + def dialect(self): ... + @dialect.setter + def dialect(self, dialect) -> None: ... + @property + def now(self): ... + @now.setter + def now(self, now) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/query_edit_mode.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/query_edit_mode.pyi new file mode 100644 index 000000000..60ce7aa35 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/query_edit_mode.pyi @@ -0,0 +1,12 @@ +from _typeshed import Incomplete + +class QueryEditMode: + BUILDER: str + ADVANCED: str + openapi_types: Incomplete + attribute_map: Incomplete + def __init__(self) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/query_variable_properties.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/query_variable_properties.pyi new file mode 100644 index 000000000..008172f1b --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/query_variable_properties.pyi @@ -0,0 +1,21 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.variable_properties import VariableProperties + +class QueryVariableProperties(VariableProperties): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, type: Incomplete | None = ..., values: Incomplete | None = ...) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def values(self): ... + @values.setter + def values(self, values) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/query_variable_properties_values.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/query_variable_properties_values.pyi new file mode 100644 index 000000000..e2194b3de --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/query_variable_properties_values.pyi @@ -0,0 +1,19 @@ +from _typeshed import Incomplete + +class QueryVariablePropertiesValues: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, query: Incomplete | None = ..., language: Incomplete | None = ...) -> None: ... + @property + def query(self): ... + @query.setter + def query(self, query) -> None: ... + @property + def language(self): ... + @language.setter + def language(self, language) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/range_threshold.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/range_threshold.pyi new file mode 100644 index 000000000..af6352b71 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/range_threshold.pyi @@ -0,0 +1,37 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.threshold_base import ThresholdBase + +class RangeThreshold(ThresholdBase): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + type: str = ..., + min: Incomplete | None = ..., + max: Incomplete | None = ..., + within: Incomplete | None = ..., + level: Incomplete | None = ..., + all_values: Incomplete | None = ..., + ) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def min(self): ... + @min.setter + def min(self, min) -> None: ... + @property + def max(self): ... + @max.setter + def max(self, max) -> None: ... + @property + def within(self): ... + @within.setter + def within(self, within) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/ready.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/ready.pyi new file mode 100644 index 000000000..60e4c3466 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/ready.pyi @@ -0,0 +1,25 @@ +from _typeshed import Incomplete + +class Ready: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, status: Incomplete | None = ..., started: Incomplete | None = ..., up: Incomplete | None = ... + ) -> None: ... + @property + def status(self): ... + @status.setter + def status(self, status) -> None: ... + @property + def started(self): ... + @started.setter + def started(self, started) -> None: ... + @property + def up(self): ... + @up.setter + def up(self, up) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/regexp_literal.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/regexp_literal.pyi new file mode 100644 index 000000000..7061ab112 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/regexp_literal.pyi @@ -0,0 +1,21 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.expression import Expression + +class RegexpLiteral(Expression): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, type: Incomplete | None = ..., value: Incomplete | None = ...) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def value(self): ... + @value.setter + def value(self, value) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/remote_connection.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/remote_connection.pyi new file mode 100644 index 000000000..4e18ae18f --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/remote_connection.pyi @@ -0,0 +1,48 @@ +from _typeshed import Incomplete + +class RemoteConnection: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + id: Incomplete | None = ..., + name: Incomplete | None = ..., + org_id: Incomplete | None = ..., + description: Incomplete | None = ..., + remote_url: Incomplete | None = ..., + remote_org_id: Incomplete | None = ..., + allow_insecure_tls: bool = ..., + ) -> None: ... + @property + def id(self): ... + @id.setter + def id(self, id) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def org_id(self): ... + @org_id.setter + def org_id(self, org_id) -> None: ... + @property + def description(self): ... + @description.setter + def description(self, description) -> None: ... + @property + def remote_url(self): ... + @remote_url.setter + def remote_url(self, remote_url) -> None: ... + @property + def remote_org_id(self): ... + @remote_org_id.setter + def remote_org_id(self, remote_org_id) -> None: ... + @property + def allow_insecure_tls(self): ... + @allow_insecure_tls.setter + def allow_insecure_tls(self, allow_insecure_tls) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/remote_connection_creation_request.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/remote_connection_creation_request.pyi new file mode 100644 index 000000000..9abbc37cc --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/remote_connection_creation_request.pyi @@ -0,0 +1,48 @@ +from _typeshed import Incomplete + +class RemoteConnectionCreationRequest: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + name: Incomplete | None = ..., + description: Incomplete | None = ..., + org_id: Incomplete | None = ..., + remote_url: Incomplete | None = ..., + remote_api_token: Incomplete | None = ..., + remote_org_id: Incomplete | None = ..., + allow_insecure_tls: bool = ..., + ) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def description(self): ... + @description.setter + def description(self, description) -> None: ... + @property + def org_id(self): ... + @org_id.setter + def org_id(self, org_id) -> None: ... + @property + def remote_url(self): ... + @remote_url.setter + def remote_url(self, remote_url) -> None: ... + @property + def remote_api_token(self): ... + @remote_api_token.setter + def remote_api_token(self, remote_api_token) -> None: ... + @property + def remote_org_id(self): ... + @remote_org_id.setter + def remote_org_id(self, remote_org_id) -> None: ... + @property + def allow_insecure_tls(self): ... + @allow_insecure_tls.setter + def allow_insecure_tls(self, allow_insecure_tls) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/remote_connection_update_request.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/remote_connection_update_request.pyi new file mode 100644 index 000000000..545335441 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/remote_connection_update_request.pyi @@ -0,0 +1,43 @@ +from _typeshed import Incomplete + +class RemoteConnectionUpdateRequest: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + name: Incomplete | None = ..., + description: Incomplete | None = ..., + remote_url: Incomplete | None = ..., + remote_api_token: Incomplete | None = ..., + remote_org_id: Incomplete | None = ..., + allow_insecure_tls: bool = ..., + ) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def description(self): ... + @description.setter + def description(self, description) -> None: ... + @property + def remote_url(self): ... + @remote_url.setter + def remote_url(self, remote_url) -> None: ... + @property + def remote_api_token(self): ... + @remote_api_token.setter + def remote_api_token(self, remote_api_token) -> None: ... + @property + def remote_org_id(self): ... + @remote_org_id.setter + def remote_org_id(self, remote_org_id) -> None: ... + @property + def allow_insecure_tls(self): ... + @allow_insecure_tls.setter + def allow_insecure_tls(self, allow_insecure_tls) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/remote_connections.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/remote_connections.pyi new file mode 100644 index 000000000..a886cfca5 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/remote_connections.pyi @@ -0,0 +1,15 @@ +from _typeshed import Incomplete + +class RemoteConnections: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, remotes: Incomplete | None = ...) -> None: ... + @property + def remotes(self): ... + @remotes.setter + def remotes(self, remotes) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/renamable_field.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/renamable_field.pyi new file mode 100644 index 000000000..1c1cd7386 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/renamable_field.pyi @@ -0,0 +1,25 @@ +from _typeshed import Incomplete + +class RenamableField: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, internal_name: Incomplete | None = ..., display_name: Incomplete | None = ..., visible: Incomplete | None = ... + ) -> None: ... + @property + def internal_name(self): ... + @internal_name.setter + def internal_name(self, internal_name) -> None: ... + @property + def display_name(self): ... + @display_name.setter + def display_name(self, display_name) -> None: ... + @property + def visible(self): ... + @visible.setter + def visible(self, visible) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/replication.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/replication.pyi new file mode 100644 index 000000000..888905326 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/replication.pyi @@ -0,0 +1,73 @@ +from _typeshed import Incomplete + +class Replication: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + id: Incomplete | None = ..., + name: Incomplete | None = ..., + description: Incomplete | None = ..., + org_id: Incomplete | None = ..., + remote_id: Incomplete | None = ..., + local_bucket_id: Incomplete | None = ..., + remote_bucket_id: Incomplete | None = ..., + max_queue_size_bytes: Incomplete | None = ..., + current_queue_size_bytes: Incomplete | None = ..., + latest_response_code: Incomplete | None = ..., + latest_error_message: Incomplete | None = ..., + drop_non_retryable_data: Incomplete | None = ..., + ) -> None: ... + @property + def id(self): ... + @id.setter + def id(self, id) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def description(self): ... + @description.setter + def description(self, description) -> None: ... + @property + def org_id(self): ... + @org_id.setter + def org_id(self, org_id) -> None: ... + @property + def remote_id(self): ... + @remote_id.setter + def remote_id(self, remote_id) -> None: ... + @property + def local_bucket_id(self): ... + @local_bucket_id.setter + def local_bucket_id(self, local_bucket_id) -> None: ... + @property + def remote_bucket_id(self): ... + @remote_bucket_id.setter + def remote_bucket_id(self, remote_bucket_id) -> None: ... + @property + def max_queue_size_bytes(self): ... + @max_queue_size_bytes.setter + def max_queue_size_bytes(self, max_queue_size_bytes) -> None: ... + @property + def current_queue_size_bytes(self): ... + @current_queue_size_bytes.setter + def current_queue_size_bytes(self, current_queue_size_bytes) -> None: ... + @property + def latest_response_code(self): ... + @latest_response_code.setter + def latest_response_code(self, latest_response_code) -> None: ... + @property + def latest_error_message(self): ... + @latest_error_message.setter + def latest_error_message(self, latest_error_message) -> None: ... + @property + def drop_non_retryable_data(self): ... + @drop_non_retryable_data.setter + def drop_non_retryable_data(self, drop_non_retryable_data) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/replication_creation_request.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/replication_creation_request.pyi new file mode 100644 index 000000000..860ce912a --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/replication_creation_request.pyi @@ -0,0 +1,53 @@ +from _typeshed import Incomplete + +class ReplicationCreationRequest: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + name: Incomplete | None = ..., + description: Incomplete | None = ..., + org_id: Incomplete | None = ..., + remote_id: Incomplete | None = ..., + local_bucket_id: Incomplete | None = ..., + remote_bucket_id: Incomplete | None = ..., + max_queue_size_bytes: int = ..., + drop_non_retryable_data: bool = ..., + ) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def description(self): ... + @description.setter + def description(self, description) -> None: ... + @property + def org_id(self): ... + @org_id.setter + def org_id(self, org_id) -> None: ... + @property + def remote_id(self): ... + @remote_id.setter + def remote_id(self, remote_id) -> None: ... + @property + def local_bucket_id(self): ... + @local_bucket_id.setter + def local_bucket_id(self, local_bucket_id) -> None: ... + @property + def remote_bucket_id(self): ... + @remote_bucket_id.setter + def remote_bucket_id(self, remote_bucket_id) -> None: ... + @property + def max_queue_size_bytes(self): ... + @max_queue_size_bytes.setter + def max_queue_size_bytes(self, max_queue_size_bytes) -> None: ... + @property + def drop_non_retryable_data(self): ... + @drop_non_retryable_data.setter + def drop_non_retryable_data(self, drop_non_retryable_data) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/replication_update_request.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/replication_update_request.pyi new file mode 100644 index 000000000..31ef087cb --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/replication_update_request.pyi @@ -0,0 +1,43 @@ +from _typeshed import Incomplete + +class ReplicationUpdateRequest: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + name: Incomplete | None = ..., + description: Incomplete | None = ..., + remote_id: Incomplete | None = ..., + remote_bucket_id: Incomplete | None = ..., + max_queue_size_bytes: Incomplete | None = ..., + drop_non_retryable_data: Incomplete | None = ..., + ) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def description(self): ... + @description.setter + def description(self, description) -> None: ... + @property + def remote_id(self): ... + @remote_id.setter + def remote_id(self, remote_id) -> None: ... + @property + def remote_bucket_id(self): ... + @remote_bucket_id.setter + def remote_bucket_id(self, remote_bucket_id) -> None: ... + @property + def max_queue_size_bytes(self): ... + @max_queue_size_bytes.setter + def max_queue_size_bytes(self, max_queue_size_bytes) -> None: ... + @property + def drop_non_retryable_data(self): ... + @drop_non_retryable_data.setter + def drop_non_retryable_data(self, drop_non_retryable_data) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/replications.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/replications.pyi new file mode 100644 index 000000000..504ae66d4 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/replications.pyi @@ -0,0 +1,15 @@ +from _typeshed import Incomplete + +class Replications: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, replications: Incomplete | None = ...) -> None: ... + @property + def replications(self): ... + @replications.setter + def replications(self, replications) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/resource_member.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/resource_member.pyi new file mode 100644 index 000000000..3ca8877e8 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/resource_member.pyi @@ -0,0 +1,25 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.user_response import UserResponse + +class ResourceMember(UserResponse): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + role: str = ..., + id: Incomplete | None = ..., + oauth_id: Incomplete | None = ..., + name: Incomplete | None = ..., + status: str = ..., + links: Incomplete | None = ..., + ) -> None: ... + @property + def role(self): ... + @role.setter + def role(self, role) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/resource_members.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/resource_members.pyi new file mode 100644 index 000000000..a167c5207 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/resource_members.pyi @@ -0,0 +1,19 @@ +from _typeshed import Incomplete + +class ResourceMembers: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, links: Incomplete | None = ..., users: Incomplete | None = ...) -> None: ... + @property + def links(self): ... + @links.setter + def links(self, links) -> None: ... + @property + def users(self): ... + @users.setter + def users(self, users) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/resource_members_links.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/resource_members_links.pyi new file mode 100644 index 000000000..20aa58c4d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/resource_members_links.pyi @@ -0,0 +1,11 @@ +from _typeshed import Incomplete + +class ResourceMembersLinks: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, _self: Incomplete | None = ...) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/resource_owner.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/resource_owner.pyi new file mode 100644 index 000000000..8fd8644b7 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/resource_owner.pyi @@ -0,0 +1,25 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.user_response import UserResponse + +class ResourceOwner(UserResponse): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + role: str = ..., + id: Incomplete | None = ..., + oauth_id: Incomplete | None = ..., + name: Incomplete | None = ..., + status: str = ..., + links: Incomplete | None = ..., + ) -> None: ... + @property + def role(self): ... + @role.setter + def role(self, role) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/resource_owners.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/resource_owners.pyi new file mode 100644 index 000000000..f1edc5d3d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/resource_owners.pyi @@ -0,0 +1,19 @@ +from _typeshed import Incomplete + +class ResourceOwners: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, links: Incomplete | None = ..., users: Incomplete | None = ...) -> None: ... + @property + def links(self): ... + @links.setter + def links(self, links) -> None: ... + @property + def users(self): ... + @users.setter + def users(self, users) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/restored_bucket_mappings.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/restored_bucket_mappings.pyi new file mode 100644 index 000000000..e64d8cf3d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/restored_bucket_mappings.pyi @@ -0,0 +1,25 @@ +from _typeshed import Incomplete + +class RestoredBucketMappings: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, id: Incomplete | None = ..., name: Incomplete | None = ..., shard_mappings: Incomplete | None = ... + ) -> None: ... + @property + def id(self): ... + @id.setter + def id(self, id) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def shard_mappings(self): ... + @shard_mappings.setter + def shard_mappings(self, shard_mappings) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/retention_policy_manifest.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/retention_policy_manifest.pyi new file mode 100644 index 000000000..735b96693 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/retention_policy_manifest.pyi @@ -0,0 +1,43 @@ +from _typeshed import Incomplete + +class RetentionPolicyManifest: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + name: Incomplete | None = ..., + replica_n: Incomplete | None = ..., + duration: Incomplete | None = ..., + shard_group_duration: Incomplete | None = ..., + shard_groups: Incomplete | None = ..., + subscriptions: Incomplete | None = ..., + ) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def replica_n(self): ... + @replica_n.setter + def replica_n(self, replica_n) -> None: ... + @property + def duration(self): ... + @duration.setter + def duration(self, duration) -> None: ... + @property + def shard_group_duration(self): ... + @shard_group_duration.setter + def shard_group_duration(self, shard_group_duration) -> None: ... + @property + def shard_groups(self): ... + @shard_groups.setter + def shard_groups(self, shard_groups) -> None: ... + @property + def subscriptions(self): ... + @subscriptions.setter + def subscriptions(self, subscriptions) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/return_statement.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/return_statement.pyi new file mode 100644 index 000000000..c4483197d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/return_statement.pyi @@ -0,0 +1,21 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.statement import Statement + +class ReturnStatement(Statement): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, type: Incomplete | None = ..., argument: Incomplete | None = ...) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def argument(self): ... + @argument.setter + def argument(self, argument) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/routes.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/routes.pyi new file mode 100644 index 000000000..72c93de24 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/routes.pyi @@ -0,0 +1,103 @@ +from _typeshed import Incomplete + +class Routes: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + authorizations: Incomplete | None = ..., + buckets: Incomplete | None = ..., + dashboards: Incomplete | None = ..., + external: Incomplete | None = ..., + variables: Incomplete | None = ..., + me: Incomplete | None = ..., + flags: Incomplete | None = ..., + orgs: Incomplete | None = ..., + query: Incomplete | None = ..., + setup: Incomplete | None = ..., + signin: Incomplete | None = ..., + signout: Incomplete | None = ..., + sources: Incomplete | None = ..., + system: Incomplete | None = ..., + tasks: Incomplete | None = ..., + telegrafs: Incomplete | None = ..., + users: Incomplete | None = ..., + write: Incomplete | None = ..., + ) -> None: ... + @property + def authorizations(self): ... + @authorizations.setter + def authorizations(self, authorizations) -> None: ... + @property + def buckets(self): ... + @buckets.setter + def buckets(self, buckets) -> None: ... + @property + def dashboards(self): ... + @dashboards.setter + def dashboards(self, dashboards) -> None: ... + @property + def external(self): ... + @external.setter + def external(self, external) -> None: ... + @property + def variables(self): ... + @variables.setter + def variables(self, variables) -> None: ... + @property + def me(self): ... + @me.setter + def me(self, me) -> None: ... + @property + def flags(self): ... + @flags.setter + def flags(self, flags) -> None: ... + @property + def orgs(self): ... + @orgs.setter + def orgs(self, orgs) -> None: ... + @property + def query(self): ... + @query.setter + def query(self, query) -> None: ... + @property + def setup(self): ... + @setup.setter + def setup(self, setup) -> None: ... + @property + def signin(self): ... + @signin.setter + def signin(self, signin) -> None: ... + @property + def signout(self): ... + @signout.setter + def signout(self, signout) -> None: ... + @property + def sources(self): ... + @sources.setter + def sources(self, sources) -> None: ... + @property + def system(self): ... + @system.setter + def system(self, system) -> None: ... + @property + def tasks(self): ... + @tasks.setter + def tasks(self, tasks) -> None: ... + @property + def telegrafs(self): ... + @telegrafs.setter + def telegrafs(self, telegrafs) -> None: ... + @property + def users(self): ... + @users.setter + def users(self, users) -> None: ... + @property + def write(self): ... + @write.setter + def write(self, write) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/routes_external.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/routes_external.pyi new file mode 100644 index 000000000..3c942fe24 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/routes_external.pyi @@ -0,0 +1,15 @@ +from _typeshed import Incomplete + +class RoutesExternal: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, status_feed: Incomplete | None = ...) -> None: ... + @property + def status_feed(self): ... + @status_feed.setter + def status_feed(self, status_feed) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/routes_query.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/routes_query.pyi new file mode 100644 index 000000000..4341f7fc7 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/routes_query.pyi @@ -0,0 +1,29 @@ +from _typeshed import Incomplete + +class RoutesQuery: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + _self: Incomplete | None = ..., + ast: Incomplete | None = ..., + analyze: Incomplete | None = ..., + suggestions: Incomplete | None = ..., + ) -> None: ... + @property + def ast(self): ... + @ast.setter + def ast(self, ast) -> None: ... + @property + def analyze(self): ... + @analyze.setter + def analyze(self, analyze) -> None: ... + @property + def suggestions(self): ... + @suggestions.setter + def suggestions(self, suggestions) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/routes_system.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/routes_system.pyi new file mode 100644 index 000000000..810c4c3bf --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/routes_system.pyi @@ -0,0 +1,25 @@ +from _typeshed import Incomplete + +class RoutesSystem: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, metrics: Incomplete | None = ..., debug: Incomplete | None = ..., health: Incomplete | None = ... + ) -> None: ... + @property + def metrics(self): ... + @metrics.setter + def metrics(self, metrics) -> None: ... + @property + def debug(self): ... + @debug.setter + def debug(self, debug) -> None: ... + @property + def health(self): ... + @health.setter + def health(self, health) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/rule_status_level.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/rule_status_level.pyi new file mode 100644 index 000000000..73b580cb0 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/rule_status_level.pyi @@ -0,0 +1,16 @@ +from _typeshed import Incomplete + +class RuleStatusLevel: + UNKNOWN: str + OK: str + INFO: str + CRIT: str + WARN: str + ANY: str + openapi_types: Incomplete + attribute_map: Incomplete + def __init__(self) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/run.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/run.pyi new file mode 100644 index 000000000..d89f7c0c0 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/run.pyi @@ -0,0 +1,58 @@ +from _typeshed import Incomplete + +class Run: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + id: Incomplete | None = ..., + task_id: Incomplete | None = ..., + status: Incomplete | None = ..., + scheduled_for: Incomplete | None = ..., + log: Incomplete | None = ..., + started_at: Incomplete | None = ..., + finished_at: Incomplete | None = ..., + requested_at: Incomplete | None = ..., + links: Incomplete | None = ..., + ) -> None: ... + @property + def id(self): ... + @id.setter + def id(self, id) -> None: ... + @property + def task_id(self): ... + @task_id.setter + def task_id(self, task_id) -> None: ... + @property + def status(self): ... + @status.setter + def status(self, status) -> None: ... + @property + def scheduled_for(self): ... + @scheduled_for.setter + def scheduled_for(self, scheduled_for) -> None: ... + @property + def log(self): ... + @log.setter + def log(self, log) -> None: ... + @property + def started_at(self): ... + @started_at.setter + def started_at(self, started_at) -> None: ... + @property + def finished_at(self): ... + @finished_at.setter + def finished_at(self, finished_at) -> None: ... + @property + def requested_at(self): ... + @requested_at.setter + def requested_at(self, requested_at) -> None: ... + @property + def links(self): ... + @links.setter + def links(self, links) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/run_links.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/run_links.pyi new file mode 100644 index 000000000..0c70c4f92 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/run_links.pyi @@ -0,0 +1,19 @@ +from _typeshed import Incomplete + +class RunLinks: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, _self: Incomplete | None = ..., task: Incomplete | None = ..., retry: Incomplete | None = ...) -> None: ... + @property + def task(self): ... + @task.setter + def task(self, task) -> None: ... + @property + def retry(self): ... + @retry.setter + def retry(self, retry) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/run_manually.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/run_manually.pyi new file mode 100644 index 000000000..bd81d4700 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/run_manually.pyi @@ -0,0 +1,15 @@ +from _typeshed import Incomplete + +class RunManually: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, scheduled_for: Incomplete | None = ...) -> None: ... + @property + def scheduled_for(self): ... + @scheduled_for.setter + def scheduled_for(self, scheduled_for) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/runs.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/runs.pyi new file mode 100644 index 000000000..2d79c00a8 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/runs.pyi @@ -0,0 +1,19 @@ +from _typeshed import Incomplete + +class Runs: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, links: Incomplete | None = ..., runs: Incomplete | None = ...) -> None: ... + @property + def links(self): ... + @links.setter + def links(self, links) -> None: ... + @property + def runs(self): ... + @runs.setter + def runs(self, runs) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/scatter_view_properties.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/scatter_view_properties.pyi new file mode 100644 index 000000000..72ec314cb --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/scatter_view_properties.pyi @@ -0,0 +1,170 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.view_properties import ViewProperties + +class ScatterViewProperties(ViewProperties): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + time_format: Incomplete | None = ..., + type: Incomplete | None = ..., + queries: Incomplete | None = ..., + colors: Incomplete | None = ..., + shape: Incomplete | None = ..., + note: Incomplete | None = ..., + show_note_when_empty: Incomplete | None = ..., + x_column: Incomplete | None = ..., + generate_x_axis_ticks: Incomplete | None = ..., + x_total_ticks: Incomplete | None = ..., + x_tick_start: Incomplete | None = ..., + x_tick_step: Incomplete | None = ..., + y_column: Incomplete | None = ..., + generate_y_axis_ticks: Incomplete | None = ..., + y_total_ticks: Incomplete | None = ..., + y_tick_start: Incomplete | None = ..., + y_tick_step: Incomplete | None = ..., + fill_columns: Incomplete | None = ..., + symbol_columns: Incomplete | None = ..., + x_domain: Incomplete | None = ..., + y_domain: Incomplete | None = ..., + x_axis_label: Incomplete | None = ..., + y_axis_label: Incomplete | None = ..., + x_prefix: Incomplete | None = ..., + x_suffix: Incomplete | None = ..., + y_prefix: Incomplete | None = ..., + y_suffix: Incomplete | None = ..., + legend_colorize_rows: Incomplete | None = ..., + legend_hide: Incomplete | None = ..., + legend_opacity: Incomplete | None = ..., + legend_orientation_threshold: Incomplete | None = ..., + ) -> None: ... + @property + def time_format(self): ... + @time_format.setter + def time_format(self, time_format) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def queries(self): ... + @queries.setter + def queries(self, queries) -> None: ... + @property + def colors(self): ... + @colors.setter + def colors(self, colors) -> None: ... + @property + def shape(self): ... + @shape.setter + def shape(self, shape) -> None: ... + @property + def note(self): ... + @note.setter + def note(self, note) -> None: ... + @property + def show_note_when_empty(self): ... + @show_note_when_empty.setter + def show_note_when_empty(self, show_note_when_empty) -> None: ... + @property + def x_column(self): ... + @x_column.setter + def x_column(self, x_column) -> None: ... + @property + def generate_x_axis_ticks(self): ... + @generate_x_axis_ticks.setter + def generate_x_axis_ticks(self, generate_x_axis_ticks) -> None: ... + @property + def x_total_ticks(self): ... + @x_total_ticks.setter + def x_total_ticks(self, x_total_ticks) -> None: ... + @property + def x_tick_start(self): ... + @x_tick_start.setter + def x_tick_start(self, x_tick_start) -> None: ... + @property + def x_tick_step(self): ... + @x_tick_step.setter + def x_tick_step(self, x_tick_step) -> None: ... + @property + def y_column(self): ... + @y_column.setter + def y_column(self, y_column) -> None: ... + @property + def generate_y_axis_ticks(self): ... + @generate_y_axis_ticks.setter + def generate_y_axis_ticks(self, generate_y_axis_ticks) -> None: ... + @property + def y_total_ticks(self): ... + @y_total_ticks.setter + def y_total_ticks(self, y_total_ticks) -> None: ... + @property + def y_tick_start(self): ... + @y_tick_start.setter + def y_tick_start(self, y_tick_start) -> None: ... + @property + def y_tick_step(self): ... + @y_tick_step.setter + def y_tick_step(self, y_tick_step) -> None: ... + @property + def fill_columns(self): ... + @fill_columns.setter + def fill_columns(self, fill_columns) -> None: ... + @property + def symbol_columns(self): ... + @symbol_columns.setter + def symbol_columns(self, symbol_columns) -> None: ... + @property + def x_domain(self): ... + @x_domain.setter + def x_domain(self, x_domain) -> None: ... + @property + def y_domain(self): ... + @y_domain.setter + def y_domain(self, y_domain) -> None: ... + @property + def x_axis_label(self): ... + @x_axis_label.setter + def x_axis_label(self, x_axis_label) -> None: ... + @property + def y_axis_label(self): ... + @y_axis_label.setter + def y_axis_label(self, y_axis_label) -> None: ... + @property + def x_prefix(self): ... + @x_prefix.setter + def x_prefix(self, x_prefix) -> None: ... + @property + def x_suffix(self): ... + @x_suffix.setter + def x_suffix(self, x_suffix) -> None: ... + @property + def y_prefix(self): ... + @y_prefix.setter + def y_prefix(self, y_prefix) -> None: ... + @property + def y_suffix(self): ... + @y_suffix.setter + def y_suffix(self, y_suffix) -> None: ... + @property + def legend_colorize_rows(self): ... + @legend_colorize_rows.setter + def legend_colorize_rows(self, legend_colorize_rows) -> None: ... + @property + def legend_hide(self): ... + @legend_hide.setter + def legend_hide(self, legend_hide) -> None: ... + @property + def legend_opacity(self): ... + @legend_opacity.setter + def legend_opacity(self, legend_opacity) -> None: ... + @property + def legend_orientation_threshold(self): ... + @legend_orientation_threshold.setter + def legend_orientation_threshold(self, legend_orientation_threshold) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/schema_type.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/schema_type.pyi new file mode 100644 index 000000000..aef84af17 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/schema_type.pyi @@ -0,0 +1,12 @@ +from _typeshed import Incomplete + +class SchemaType: + IMPLICIT: str + EXPLICIT: str + openapi_types: Incomplete + attribute_map: Incomplete + def __init__(self) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/scraper_target_request.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/scraper_target_request.pyi new file mode 100644 index 000000000..225d84df2 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/scraper_target_request.pyi @@ -0,0 +1,43 @@ +from _typeshed import Incomplete + +class ScraperTargetRequest: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + name: Incomplete | None = ..., + type: Incomplete | None = ..., + url: Incomplete | None = ..., + org_id: Incomplete | None = ..., + bucket_id: Incomplete | None = ..., + allow_insecure: bool = ..., + ) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def url(self): ... + @url.setter + def url(self, url) -> None: ... + @property + def org_id(self): ... + @org_id.setter + def org_id(self, org_id) -> None: ... + @property + def bucket_id(self): ... + @bucket_id.setter + def bucket_id(self, bucket_id) -> None: ... + @property + def allow_insecure(self): ... + @allow_insecure.setter + def allow_insecure(self, allow_insecure) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/scraper_target_response.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/scraper_target_response.pyi new file mode 100644 index 000000000..12f3caf1b --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/scraper_target_response.pyi @@ -0,0 +1,41 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.scraper_target_request import ScraperTargetRequest + +class ScraperTargetResponse(ScraperTargetRequest): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + id: Incomplete | None = ..., + org: Incomplete | None = ..., + bucket: Incomplete | None = ..., + links: Incomplete | None = ..., + name: Incomplete | None = ..., + type: Incomplete | None = ..., + url: Incomplete | None = ..., + org_id: Incomplete | None = ..., + bucket_id: Incomplete | None = ..., + allow_insecure: bool = ..., + ) -> None: ... + @property + def id(self): ... + @id.setter + def id(self, id) -> None: ... + @property + def org(self): ... + @org.setter + def org(self, org) -> None: ... + @property + def bucket(self): ... + @bucket.setter + def bucket(self, bucket) -> None: ... + @property + def links(self): ... + @links.setter + def links(self, links) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/scraper_target_responses.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/scraper_target_responses.pyi new file mode 100644 index 000000000..cc2b9730b --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/scraper_target_responses.pyi @@ -0,0 +1,15 @@ +from _typeshed import Incomplete + +class ScraperTargetResponses: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, configurations: Incomplete | None = ...) -> None: ... + @property + def configurations(self): ... + @configurations.setter + def configurations(self, configurations) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/script.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/script.pyi new file mode 100644 index 000000000..04fc8c0f4 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/script.pyi @@ -0,0 +1,58 @@ +from _typeshed import Incomplete + +class Script: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + id: Incomplete | None = ..., + name: Incomplete | None = ..., + description: Incomplete | None = ..., + org_id: Incomplete | None = ..., + script: Incomplete | None = ..., + language: Incomplete | None = ..., + url: Incomplete | None = ..., + created_at: Incomplete | None = ..., + updated_at: Incomplete | None = ..., + ) -> None: ... + @property + def id(self): ... + @id.setter + def id(self, id) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def description(self): ... + @description.setter + def description(self, description) -> None: ... + @property + def org_id(self): ... + @org_id.setter + def org_id(self, org_id) -> None: ... + @property + def script(self): ... + @script.setter + def script(self, script) -> None: ... + @property + def language(self): ... + @language.setter + def language(self, language) -> None: ... + @property + def url(self): ... + @url.setter + def url(self, url) -> None: ... + @property + def created_at(self): ... + @created_at.setter + def created_at(self, created_at) -> None: ... + @property + def updated_at(self): ... + @updated_at.setter + def updated_at(self, updated_at) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/script_create_request.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/script_create_request.pyi new file mode 100644 index 000000000..a48f36c75 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/script_create_request.pyi @@ -0,0 +1,33 @@ +from _typeshed import Incomplete + +class ScriptCreateRequest: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + name: Incomplete | None = ..., + description: Incomplete | None = ..., + script: Incomplete | None = ..., + language: Incomplete | None = ..., + ) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def description(self): ... + @description.setter + def description(self, description) -> None: ... + @property + def script(self): ... + @script.setter + def script(self, script) -> None: ... + @property + def language(self): ... + @language.setter + def language(self, language) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/script_invocation_params.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/script_invocation_params.pyi new file mode 100644 index 000000000..c20744958 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/script_invocation_params.pyi @@ -0,0 +1,15 @@ +from _typeshed import Incomplete + +class ScriptInvocationParams: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, params: Incomplete | None = ...) -> None: ... + @property + def params(self): ... + @params.setter + def params(self, params) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/script_language.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/script_language.pyi new file mode 100644 index 000000000..8b969d83a --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/script_language.pyi @@ -0,0 +1,11 @@ +from _typeshed import Incomplete + +class ScriptLanguage: + FLUX: str + openapi_types: Incomplete + attribute_map: Incomplete + def __init__(self) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/script_update_request.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/script_update_request.pyi new file mode 100644 index 000000000..71b5dcab2 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/script_update_request.pyi @@ -0,0 +1,25 @@ +from _typeshed import Incomplete + +class ScriptUpdateRequest: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, name: Incomplete | None = ..., description: Incomplete | None = ..., script: Incomplete | None = ... + ) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def description(self): ... + @description.setter + def description(self, description) -> None: ... + @property + def script(self): ... + @script.setter + def script(self, script) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/scripts.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/scripts.pyi new file mode 100644 index 000000000..723152398 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/scripts.pyi @@ -0,0 +1,15 @@ +from _typeshed import Incomplete + +class Scripts: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, scripts: Incomplete | None = ...) -> None: ... + @property + def scripts(self): ... + @scripts.setter + def scripts(self, scripts) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/secret_keys.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/secret_keys.pyi new file mode 100644 index 000000000..f8c58550d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/secret_keys.pyi @@ -0,0 +1,15 @@ +from _typeshed import Incomplete + +class SecretKeys: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, secrets: Incomplete | None = ...) -> None: ... + @property + def secrets(self): ... + @secrets.setter + def secrets(self, secrets) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/secret_keys_response.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/secret_keys_response.pyi new file mode 100644 index 000000000..877920fd5 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/secret_keys_response.pyi @@ -0,0 +1,17 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.secret_keys import SecretKeys + +class SecretKeysResponse(SecretKeys): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, links: Incomplete | None = ..., secrets: Incomplete | None = ...) -> None: ... + @property + def links(self): ... + @links.setter + def links(self, links) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/shard_group_manifest.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/shard_group_manifest.pyi new file mode 100644 index 000000000..7fcab8696 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/shard_group_manifest.pyi @@ -0,0 +1,43 @@ +from _typeshed import Incomplete + +class ShardGroupManifest: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + id: Incomplete | None = ..., + start_time: Incomplete | None = ..., + end_time: Incomplete | None = ..., + deleted_at: Incomplete | None = ..., + truncated_at: Incomplete | None = ..., + shards: Incomplete | None = ..., + ) -> None: ... + @property + def id(self): ... + @id.setter + def id(self, id) -> None: ... + @property + def start_time(self): ... + @start_time.setter + def start_time(self, start_time) -> None: ... + @property + def end_time(self): ... + @end_time.setter + def end_time(self, end_time) -> None: ... + @property + def deleted_at(self): ... + @deleted_at.setter + def deleted_at(self, deleted_at) -> None: ... + @property + def truncated_at(self): ... + @truncated_at.setter + def truncated_at(self, truncated_at) -> None: ... + @property + def shards(self): ... + @shards.setter + def shards(self, shards) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/shard_manifest.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/shard_manifest.pyi new file mode 100644 index 000000000..1ba7aa6cf --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/shard_manifest.pyi @@ -0,0 +1,19 @@ +from _typeshed import Incomplete + +class ShardManifest: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, id: Incomplete | None = ..., shard_owners: Incomplete | None = ...) -> None: ... + @property + def id(self): ... + @id.setter + def id(self, id) -> None: ... + @property + def shard_owners(self): ... + @shard_owners.setter + def shard_owners(self, shard_owners) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/shard_owner.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/shard_owner.pyi new file mode 100644 index 000000000..4bae41583 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/shard_owner.pyi @@ -0,0 +1,15 @@ +from _typeshed import Incomplete + +class ShardOwner: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, node_id: Incomplete | None = ...) -> None: ... + @property + def node_id(self): ... + @node_id.setter + def node_id(self, node_id) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/simple_table_view_properties.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/simple_table_view_properties.pyi new file mode 100644 index 000000000..4c6610572 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/simple_table_view_properties.pyi @@ -0,0 +1,45 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.view_properties import ViewProperties + +class SimpleTableViewProperties(ViewProperties): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + type: Incomplete | None = ..., + show_all: Incomplete | None = ..., + queries: Incomplete | None = ..., + shape: Incomplete | None = ..., + note: Incomplete | None = ..., + show_note_when_empty: Incomplete | None = ..., + ) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def show_all(self): ... + @show_all.setter + def show_all(self, show_all) -> None: ... + @property + def queries(self): ... + @queries.setter + def queries(self, queries) -> None: ... + @property + def shape(self): ... + @shape.setter + def shape(self, shape) -> None: ... + @property + def note(self): ... + @note.setter + def note(self, note) -> None: ... + @property + def show_note_when_empty(self): ... + @show_note_when_empty.setter + def show_note_when_empty(self, show_note_when_empty) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/single_stat_view_properties.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/single_stat_view_properties.pyi new file mode 100644 index 000000000..320cc4dba --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/single_stat_view_properties.pyi @@ -0,0 +1,75 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.view_properties import ViewProperties + +class SingleStatViewProperties(ViewProperties): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + type: Incomplete | None = ..., + queries: Incomplete | None = ..., + colors: Incomplete | None = ..., + shape: Incomplete | None = ..., + note: Incomplete | None = ..., + show_note_when_empty: Incomplete | None = ..., + prefix: Incomplete | None = ..., + tick_prefix: Incomplete | None = ..., + suffix: Incomplete | None = ..., + tick_suffix: Incomplete | None = ..., + static_legend: Incomplete | None = ..., + decimal_places: Incomplete | None = ..., + ) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def queries(self): ... + @queries.setter + def queries(self, queries) -> None: ... + @property + def colors(self): ... + @colors.setter + def colors(self, colors) -> None: ... + @property + def shape(self): ... + @shape.setter + def shape(self, shape) -> None: ... + @property + def note(self): ... + @note.setter + def note(self, note) -> None: ... + @property + def show_note_when_empty(self): ... + @show_note_when_empty.setter + def show_note_when_empty(self, show_note_when_empty) -> None: ... + @property + def prefix(self): ... + @prefix.setter + def prefix(self, prefix) -> None: ... + @property + def tick_prefix(self): ... + @tick_prefix.setter + def tick_prefix(self, tick_prefix) -> None: ... + @property + def suffix(self): ... + @suffix.setter + def suffix(self, suffix) -> None: ... + @property + def tick_suffix(self): ... + @tick_suffix.setter + def tick_suffix(self, tick_suffix) -> None: ... + @property + def static_legend(self): ... + @static_legend.setter + def static_legend(self, static_legend) -> None: ... + @property + def decimal_places(self): ... + @decimal_places.setter + def decimal_places(self, decimal_places) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/slack_notification_endpoint.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/slack_notification_endpoint.pyi new file mode 100644 index 000000000..76b00f502 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/slack_notification_endpoint.pyi @@ -0,0 +1,36 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.notification_endpoint_discriminator import NotificationEndpointDiscriminator + +class SlackNotificationEndpoint(NotificationEndpointDiscriminator): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + url: Incomplete | None = ..., + token: Incomplete | None = ..., + id: Incomplete | None = ..., + org_id: Incomplete | None = ..., + user_id: Incomplete | None = ..., + created_at: Incomplete | None = ..., + updated_at: Incomplete | None = ..., + description: Incomplete | None = ..., + name: Incomplete | None = ..., + status: str = ..., + labels: Incomplete | None = ..., + links: Incomplete | None = ..., + type: str = ..., + ) -> None: ... + @property + def url(self): ... + @url.setter + def url(self, url) -> None: ... + @property + def token(self): ... + @token.setter + def token(self, token) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/slack_notification_rule.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/slack_notification_rule.pyi new file mode 100644 index 000000000..1f53e48f4 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/slack_notification_rule.pyi @@ -0,0 +1,41 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.slack_notification_rule_base import SlackNotificationRuleBase + +class SlackNotificationRule(SlackNotificationRuleBase): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + type: str = ..., + channel: Incomplete | None = ..., + message_template: Incomplete | None = ..., + latest_completed: Incomplete | None = ..., + last_run_status: Incomplete | None = ..., + last_run_error: Incomplete | None = ..., + id: Incomplete | None = ..., + endpoint_id: Incomplete | None = ..., + org_id: Incomplete | None = ..., + task_id: Incomplete | None = ..., + owner_id: Incomplete | None = ..., + created_at: Incomplete | None = ..., + updated_at: Incomplete | None = ..., + status: Incomplete | None = ..., + name: Incomplete | None = ..., + sleep_until: Incomplete | None = ..., + every: Incomplete | None = ..., + offset: Incomplete | None = ..., + runbook_link: Incomplete | None = ..., + limit_every: Incomplete | None = ..., + limit: Incomplete | None = ..., + tag_rules: Incomplete | None = ..., + description: Incomplete | None = ..., + status_rules: Incomplete | None = ..., + labels: Incomplete | None = ..., + links: Incomplete | None = ..., + ) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/slack_notification_rule_base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/slack_notification_rule_base.pyi new file mode 100644 index 000000000..414ed918c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/slack_notification_rule_base.pyi @@ -0,0 +1,53 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.notification_rule_discriminator import NotificationRuleDiscriminator + +class SlackNotificationRuleBase(NotificationRuleDiscriminator): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + type: Incomplete | None = ..., + channel: Incomplete | None = ..., + message_template: Incomplete | None = ..., + latest_completed: Incomplete | None = ..., + last_run_status: Incomplete | None = ..., + last_run_error: Incomplete | None = ..., + id: Incomplete | None = ..., + endpoint_id: Incomplete | None = ..., + org_id: Incomplete | None = ..., + task_id: Incomplete | None = ..., + owner_id: Incomplete | None = ..., + created_at: Incomplete | None = ..., + updated_at: Incomplete | None = ..., + status: Incomplete | None = ..., + name: Incomplete | None = ..., + sleep_until: Incomplete | None = ..., + every: Incomplete | None = ..., + offset: Incomplete | None = ..., + runbook_link: Incomplete | None = ..., + limit_every: Incomplete | None = ..., + limit: Incomplete | None = ..., + tag_rules: Incomplete | None = ..., + description: Incomplete | None = ..., + status_rules: Incomplete | None = ..., + labels: Incomplete | None = ..., + links: Incomplete | None = ..., + ) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def channel(self): ... + @channel.setter + def channel(self, channel) -> None: ... + @property + def message_template(self): ... + @message_template.setter + def message_template(self, message_template) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/smtp_notification_rule.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/smtp_notification_rule.pyi new file mode 100644 index 000000000..58ef677a2 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/smtp_notification_rule.pyi @@ -0,0 +1,42 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.smtp_notification_rule_base import SMTPNotificationRuleBase + +class SMTPNotificationRule(SMTPNotificationRuleBase): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + type: str = ..., + subject_template: Incomplete | None = ..., + body_template: Incomplete | None = ..., + to: Incomplete | None = ..., + latest_completed: Incomplete | None = ..., + last_run_status: Incomplete | None = ..., + last_run_error: Incomplete | None = ..., + id: Incomplete | None = ..., + endpoint_id: Incomplete | None = ..., + org_id: Incomplete | None = ..., + task_id: Incomplete | None = ..., + owner_id: Incomplete | None = ..., + created_at: Incomplete | None = ..., + updated_at: Incomplete | None = ..., + status: Incomplete | None = ..., + name: Incomplete | None = ..., + sleep_until: Incomplete | None = ..., + every: Incomplete | None = ..., + offset: Incomplete | None = ..., + runbook_link: Incomplete | None = ..., + limit_every: Incomplete | None = ..., + limit: Incomplete | None = ..., + tag_rules: Incomplete | None = ..., + description: Incomplete | None = ..., + status_rules: Incomplete | None = ..., + labels: Incomplete | None = ..., + links: Incomplete | None = ..., + ) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/smtp_notification_rule_base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/smtp_notification_rule_base.pyi new file mode 100644 index 000000000..48017fc82 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/smtp_notification_rule_base.pyi @@ -0,0 +1,58 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.notification_rule_discriminator import NotificationRuleDiscriminator + +class SMTPNotificationRuleBase(NotificationRuleDiscriminator): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + type: Incomplete | None = ..., + subject_template: Incomplete | None = ..., + body_template: Incomplete | None = ..., + to: Incomplete | None = ..., + latest_completed: Incomplete | None = ..., + last_run_status: Incomplete | None = ..., + last_run_error: Incomplete | None = ..., + id: Incomplete | None = ..., + endpoint_id: Incomplete | None = ..., + org_id: Incomplete | None = ..., + task_id: Incomplete | None = ..., + owner_id: Incomplete | None = ..., + created_at: Incomplete | None = ..., + updated_at: Incomplete | None = ..., + status: Incomplete | None = ..., + name: Incomplete | None = ..., + sleep_until: Incomplete | None = ..., + every: Incomplete | None = ..., + offset: Incomplete | None = ..., + runbook_link: Incomplete | None = ..., + limit_every: Incomplete | None = ..., + limit: Incomplete | None = ..., + tag_rules: Incomplete | None = ..., + description: Incomplete | None = ..., + status_rules: Incomplete | None = ..., + labels: Incomplete | None = ..., + links: Incomplete | None = ..., + ) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def subject_template(self): ... + @subject_template.setter + def subject_template(self, subject_template) -> None: ... + @property + def body_template(self): ... + @body_template.setter + def body_template(self, body_template) -> None: ... + @property + def to(self): ... + @to.setter + def to(self, to) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/source.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/source.pyi new file mode 100644 index 000000000..07ddff9a6 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/source.pyi @@ -0,0 +1,93 @@ +from _typeshed import Incomplete + +class Source: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + links: Incomplete | None = ..., + id: Incomplete | None = ..., + org_id: Incomplete | None = ..., + default: Incomplete | None = ..., + name: Incomplete | None = ..., + type: Incomplete | None = ..., + url: Incomplete | None = ..., + insecure_skip_verify: Incomplete | None = ..., + telegraf: Incomplete | None = ..., + token: Incomplete | None = ..., + username: Incomplete | None = ..., + password: Incomplete | None = ..., + shared_secret: Incomplete | None = ..., + meta_url: Incomplete | None = ..., + default_rp: Incomplete | None = ..., + languages: Incomplete | None = ..., + ) -> None: ... + @property + def links(self): ... + @links.setter + def links(self, links) -> None: ... + @property + def id(self): ... + @id.setter + def id(self, id) -> None: ... + @property + def org_id(self): ... + @org_id.setter + def org_id(self, org_id) -> None: ... + @property + def default(self): ... + @default.setter + def default(self, default) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def url(self): ... + @url.setter + def url(self, url) -> None: ... + @property + def insecure_skip_verify(self): ... + @insecure_skip_verify.setter + def insecure_skip_verify(self, insecure_skip_verify) -> None: ... + @property + def telegraf(self): ... + @telegraf.setter + def telegraf(self, telegraf) -> None: ... + @property + def token(self): ... + @token.setter + def token(self, token) -> None: ... + @property + def username(self): ... + @username.setter + def username(self, username) -> None: ... + @property + def password(self): ... + @password.setter + def password(self, password) -> None: ... + @property + def shared_secret(self): ... + @shared_secret.setter + def shared_secret(self, shared_secret) -> None: ... + @property + def meta_url(self): ... + @meta_url.setter + def meta_url(self, meta_url) -> None: ... + @property + def default_rp(self): ... + @default_rp.setter + def default_rp(self, default_rp) -> None: ... + @property + def languages(self): ... + @languages.setter + def languages(self, languages) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/source_links.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/source_links.pyi new file mode 100644 index 000000000..5ce803e59 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/source_links.pyi @@ -0,0 +1,29 @@ +from _typeshed import Incomplete + +class SourceLinks: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + _self: Incomplete | None = ..., + query: Incomplete | None = ..., + health: Incomplete | None = ..., + buckets: Incomplete | None = ..., + ) -> None: ... + @property + def query(self): ... + @query.setter + def query(self, query) -> None: ... + @property + def health(self): ... + @health.setter + def health(self, health) -> None: ... + @property + def buckets(self): ... + @buckets.setter + def buckets(self, buckets) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/sources.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/sources.pyi new file mode 100644 index 000000000..287c49c0a --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/sources.pyi @@ -0,0 +1,19 @@ +from _typeshed import Incomplete + +class Sources: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, links: Incomplete | None = ..., sources: Incomplete | None = ...) -> None: ... + @property + def links(self): ... + @links.setter + def links(self, links) -> None: ... + @property + def sources(self): ... + @sources.setter + def sources(self, sources) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/stack.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/stack.pyi new file mode 100644 index 000000000..36353fe4b --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/stack.pyi @@ -0,0 +1,33 @@ +from _typeshed import Incomplete + +class Stack: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + id: Incomplete | None = ..., + org_id: Incomplete | None = ..., + created_at: Incomplete | None = ..., + events: Incomplete | None = ..., + ) -> None: ... + @property + def id(self): ... + @id.setter + def id(self, id) -> None: ... + @property + def org_id(self): ... + @org_id.setter + def org_id(self, org_id) -> None: ... + @property + def created_at(self): ... + @created_at.setter + def created_at(self, created_at) -> None: ... + @property + def events(self): ... + @events.setter + def events(self, events) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/stack_associations.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/stack_associations.pyi new file mode 100644 index 000000000..deda169d5 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/stack_associations.pyi @@ -0,0 +1,19 @@ +from _typeshed import Incomplete + +class StackAssociations: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, kind: Incomplete | None = ..., meta_name: Incomplete | None = ...) -> None: ... + @property + def kind(self): ... + @kind.setter + def kind(self, kind) -> None: ... + @property + def meta_name(self): ... + @meta_name.setter + def meta_name(self, meta_name) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/stack_events.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/stack_events.pyi new file mode 100644 index 000000000..f89bbd675 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/stack_events.pyi @@ -0,0 +1,48 @@ +from _typeshed import Incomplete + +class StackEvents: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + event_type: Incomplete | None = ..., + name: Incomplete | None = ..., + description: Incomplete | None = ..., + sources: Incomplete | None = ..., + resources: Incomplete | None = ..., + urls: Incomplete | None = ..., + updated_at: Incomplete | None = ..., + ) -> None: ... + @property + def event_type(self): ... + @event_type.setter + def event_type(self, event_type) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def description(self): ... + @description.setter + def description(self, description) -> None: ... + @property + def sources(self): ... + @sources.setter + def sources(self, sources) -> None: ... + @property + def resources(self): ... + @resources.setter + def resources(self, resources) -> None: ... + @property + def urls(self): ... + @urls.setter + def urls(self, urls) -> None: ... + @property + def updated_at(self): ... + @updated_at.setter + def updated_at(self, updated_at) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/stack_links.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/stack_links.pyi new file mode 100644 index 000000000..972a761d8 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/stack_links.pyi @@ -0,0 +1,11 @@ +from _typeshed import Incomplete + +class StackLinks: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, _self: Incomplete | None = ...) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/stack_resources.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/stack_resources.pyi new file mode 100644 index 000000000..1dd5b27a4 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/stack_resources.pyi @@ -0,0 +1,43 @@ +from _typeshed import Incomplete + +class StackResources: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + api_version: Incomplete | None = ..., + resource_id: Incomplete | None = ..., + kind: Incomplete | None = ..., + template_meta_name: Incomplete | None = ..., + associations: Incomplete | None = ..., + links: Incomplete | None = ..., + ) -> None: ... + @property + def api_version(self): ... + @api_version.setter + def api_version(self, api_version) -> None: ... + @property + def resource_id(self): ... + @resource_id.setter + def resource_id(self, resource_id) -> None: ... + @property + def kind(self): ... + @kind.setter + def kind(self, kind) -> None: ... + @property + def template_meta_name(self): ... + @template_meta_name.setter + def template_meta_name(self, template_meta_name) -> None: ... + @property + def associations(self): ... + @associations.setter + def associations(self, associations) -> None: ... + @property + def links(self): ... + @links.setter + def links(self, links) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/statement.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/statement.pyi new file mode 100644 index 000000000..789212dbc --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/statement.pyi @@ -0,0 +1,10 @@ +from _typeshed import Incomplete + +class Statement: + openapi_types: Incomplete + attribute_map: Incomplete + def __init__(self) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/static_legend.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/static_legend.pyi new file mode 100644 index 000000000..21a19ce91 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/static_legend.pyi @@ -0,0 +1,48 @@ +from _typeshed import Incomplete + +class StaticLegend: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + colorize_rows: Incomplete | None = ..., + height_ratio: Incomplete | None = ..., + show: Incomplete | None = ..., + opacity: Incomplete | None = ..., + orientation_threshold: Incomplete | None = ..., + value_axis: Incomplete | None = ..., + width_ratio: Incomplete | None = ..., + ) -> None: ... + @property + def colorize_rows(self): ... + @colorize_rows.setter + def colorize_rows(self, colorize_rows) -> None: ... + @property + def height_ratio(self): ... + @height_ratio.setter + def height_ratio(self, height_ratio) -> None: ... + @property + def show(self): ... + @show.setter + def show(self, show) -> None: ... + @property + def opacity(self): ... + @opacity.setter + def opacity(self, opacity) -> None: ... + @property + def orientation_threshold(self): ... + @orientation_threshold.setter + def orientation_threshold(self, orientation_threshold) -> None: ... + @property + def value_axis(self): ... + @value_axis.setter + def value_axis(self, value_axis) -> None: ... + @property + def width_ratio(self): ... + @width_ratio.setter + def width_ratio(self, width_ratio) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/status_rule.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/status_rule.pyi new file mode 100644 index 000000000..75a13b513 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/status_rule.pyi @@ -0,0 +1,33 @@ +from _typeshed import Incomplete + +class StatusRule: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + current_level: Incomplete | None = ..., + previous_level: Incomplete | None = ..., + count: Incomplete | None = ..., + period: Incomplete | None = ..., + ) -> None: ... + @property + def current_level(self): ... + @current_level.setter + def current_level(self, current_level) -> None: ... + @property + def previous_level(self): ... + @previous_level.setter + def previous_level(self, previous_level) -> None: ... + @property + def count(self): ... + @count.setter + def count(self, count) -> None: ... + @property + def period(self): ... + @period.setter + def period(self, period) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/string_literal.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/string_literal.pyi new file mode 100644 index 000000000..e261c13af --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/string_literal.pyi @@ -0,0 +1,21 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.property_key import PropertyKey + +class StringLiteral(PropertyKey): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, type: Incomplete | None = ..., value: Incomplete | None = ...) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def value(self): ... + @value.setter + def value(self, value) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/subscription_manifest.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/subscription_manifest.pyi new file mode 100644 index 000000000..1187b9adb --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/subscription_manifest.pyi @@ -0,0 +1,25 @@ +from _typeshed import Incomplete + +class SubscriptionManifest: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, name: Incomplete | None = ..., mode: Incomplete | None = ..., destinations: Incomplete | None = ... + ) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def mode(self): ... + @mode.setter + def mode(self, mode) -> None: ... + @property + def destinations(self): ... + @destinations.setter + def destinations(self, destinations) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/table_view_properties.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/table_view_properties.pyi new file mode 100644 index 000000000..be791e621 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/table_view_properties.pyi @@ -0,0 +1,65 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.view_properties import ViewProperties + +class TableViewProperties(ViewProperties): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + type: Incomplete | None = ..., + queries: Incomplete | None = ..., + colors: Incomplete | None = ..., + shape: Incomplete | None = ..., + note: Incomplete | None = ..., + show_note_when_empty: Incomplete | None = ..., + table_options: Incomplete | None = ..., + field_options: Incomplete | None = ..., + time_format: Incomplete | None = ..., + decimal_places: Incomplete | None = ..., + ) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def queries(self): ... + @queries.setter + def queries(self, queries) -> None: ... + @property + def colors(self): ... + @colors.setter + def colors(self, colors) -> None: ... + @property + def shape(self): ... + @shape.setter + def shape(self, shape) -> None: ... + @property + def note(self): ... + @note.setter + def note(self, note) -> None: ... + @property + def show_note_when_empty(self): ... + @show_note_when_empty.setter + def show_note_when_empty(self, show_note_when_empty) -> None: ... + @property + def table_options(self): ... + @table_options.setter + def table_options(self, table_options) -> None: ... + @property + def field_options(self): ... + @field_options.setter + def field_options(self, field_options) -> None: ... + @property + def time_format(self): ... + @time_format.setter + def time_format(self, time_format) -> None: ... + @property + def decimal_places(self): ... + @decimal_places.setter + def decimal_places(self, decimal_places) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/table_view_properties_table_options.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/table_view_properties_table_options.pyi new file mode 100644 index 000000000..847eb8d3c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/table_view_properties_table_options.pyi @@ -0,0 +1,33 @@ +from _typeshed import Incomplete + +class TableViewPropertiesTableOptions: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + vertical_time_axis: Incomplete | None = ..., + sort_by: Incomplete | None = ..., + wrapping: Incomplete | None = ..., + fix_first_column: Incomplete | None = ..., + ) -> None: ... + @property + def vertical_time_axis(self): ... + @vertical_time_axis.setter + def vertical_time_axis(self, vertical_time_axis) -> None: ... + @property + def sort_by(self): ... + @sort_by.setter + def sort_by(self, sort_by) -> None: ... + @property + def wrapping(self): ... + @wrapping.setter + def wrapping(self, wrapping) -> None: ... + @property + def fix_first_column(self): ... + @fix_first_column.setter + def fix_first_column(self, fix_first_column) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/tag_rule.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/tag_rule.pyi new file mode 100644 index 000000000..dae4d4da6 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/tag_rule.pyi @@ -0,0 +1,25 @@ +from _typeshed import Incomplete + +class TagRule: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, key: Incomplete | None = ..., value: Incomplete | None = ..., operator: Incomplete | None = ... + ) -> None: ... + @property + def key(self): ... + @key.setter + def key(self, key) -> None: ... + @property + def value(self): ... + @value.setter + def value(self, value) -> None: ... + @property + def operator(self): ... + @operator.setter + def operator(self, operator) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/task.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/task.pyi new file mode 100644 index 000000000..19995ac55 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/task.pyi @@ -0,0 +1,113 @@ +from _typeshed import Incomplete + +class Task: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + id: Incomplete | None = ..., + type: Incomplete | None = ..., + org_id: Incomplete | None = ..., + org: Incomplete | None = ..., + name: Incomplete | None = ..., + owner_id: Incomplete | None = ..., + description: Incomplete | None = ..., + status: Incomplete | None = ..., + labels: Incomplete | None = ..., + authorization_id: Incomplete | None = ..., + flux: Incomplete | None = ..., + every: Incomplete | None = ..., + cron: Incomplete | None = ..., + offset: Incomplete | None = ..., + latest_completed: Incomplete | None = ..., + last_run_status: Incomplete | None = ..., + last_run_error: Incomplete | None = ..., + created_at: Incomplete | None = ..., + updated_at: Incomplete | None = ..., + links: Incomplete | None = ..., + ) -> None: ... + @property + def id(self): ... + @id.setter + def id(self, id) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def org_id(self): ... + @org_id.setter + def org_id(self, org_id) -> None: ... + @property + def org(self): ... + @org.setter + def org(self, org) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def owner_id(self): ... + @owner_id.setter + def owner_id(self, owner_id) -> None: ... + @property + def description(self): ... + @description.setter + def description(self, description) -> None: ... + @property + def status(self): ... + @status.setter + def status(self, status) -> None: ... + @property + def labels(self): ... + @labels.setter + def labels(self, labels) -> None: ... + @property + def authorization_id(self): ... + @authorization_id.setter + def authorization_id(self, authorization_id) -> None: ... + @property + def flux(self): ... + @flux.setter + def flux(self, flux) -> None: ... + @property + def every(self): ... + @every.setter + def every(self, every) -> None: ... + @property + def cron(self): ... + @cron.setter + def cron(self, cron) -> None: ... + @property + def offset(self): ... + @offset.setter + def offset(self, offset) -> None: ... + @property + def latest_completed(self): ... + @latest_completed.setter + def latest_completed(self, latest_completed) -> None: ... + @property + def last_run_status(self): ... + @last_run_status.setter + def last_run_status(self, last_run_status) -> None: ... + @property + def last_run_error(self): ... + @last_run_error.setter + def last_run_error(self, last_run_error) -> None: ... + @property + def created_at(self): ... + @created_at.setter + def created_at(self, created_at) -> None: ... + @property + def updated_at(self): ... + @updated_at.setter + def updated_at(self, updated_at) -> None: ... + @property + def links(self): ... + @links.setter + def links(self, links) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/task_create_request.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/task_create_request.pyi new file mode 100644 index 000000000..490574601 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/task_create_request.pyi @@ -0,0 +1,38 @@ +from _typeshed import Incomplete + +class TaskCreateRequest: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + org_id: Incomplete | None = ..., + org: Incomplete | None = ..., + status: Incomplete | None = ..., + flux: Incomplete | None = ..., + description: Incomplete | None = ..., + ) -> None: ... + @property + def org_id(self): ... + @org_id.setter + def org_id(self, org_id) -> None: ... + @property + def org(self): ... + @org.setter + def org(self, org) -> None: ... + @property + def status(self): ... + @status.setter + def status(self, status) -> None: ... + @property + def flux(self): ... + @flux.setter + def flux(self, flux) -> None: ... + @property + def description(self): ... + @description.setter + def description(self, description) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/task_links.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/task_links.pyi new file mode 100644 index 000000000..b9bf306a2 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/task_links.pyi @@ -0,0 +1,39 @@ +from _typeshed import Incomplete + +class TaskLinks: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + _self: Incomplete | None = ..., + owners: Incomplete | None = ..., + members: Incomplete | None = ..., + runs: Incomplete | None = ..., + logs: Incomplete | None = ..., + labels: Incomplete | None = ..., + ) -> None: ... + @property + def owners(self): ... + @owners.setter + def owners(self, owners) -> None: ... + @property + def members(self): ... + @members.setter + def members(self, members) -> None: ... + @property + def runs(self): ... + @runs.setter + def runs(self, runs) -> None: ... + @property + def logs(self): ... + @logs.setter + def logs(self, logs) -> None: ... + @property + def labels(self): ... + @labels.setter + def labels(self, labels) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/task_status_type.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/task_status_type.pyi new file mode 100644 index 000000000..936a3e722 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/task_status_type.pyi @@ -0,0 +1,12 @@ +from _typeshed import Incomplete + +class TaskStatusType: + ACTIVE: str + INACTIVE: str + openapi_types: Incomplete + attribute_map: Incomplete + def __init__(self) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/task_update_request.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/task_update_request.pyi new file mode 100644 index 000000000..7aa0ad524 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/task_update_request.pyi @@ -0,0 +1,48 @@ +from _typeshed import Incomplete + +class TaskUpdateRequest: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + status: Incomplete | None = ..., + flux: Incomplete | None = ..., + name: Incomplete | None = ..., + every: Incomplete | None = ..., + cron: Incomplete | None = ..., + offset: Incomplete | None = ..., + description: Incomplete | None = ..., + ) -> None: ... + @property + def status(self): ... + @status.setter + def status(self, status) -> None: ... + @property + def flux(self): ... + @flux.setter + def flux(self, flux) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def every(self): ... + @every.setter + def every(self, every) -> None: ... + @property + def cron(self): ... + @cron.setter + def cron(self, cron) -> None: ... + @property + def offset(self): ... + @offset.setter + def offset(self, offset) -> None: ... + @property + def description(self): ... + @description.setter + def description(self, description) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/tasks.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/tasks.pyi new file mode 100644 index 000000000..61ca67a03 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/tasks.pyi @@ -0,0 +1,19 @@ +from _typeshed import Incomplete + +class Tasks: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, links: Incomplete | None = ..., tasks: Incomplete | None = ...) -> None: ... + @property + def links(self): ... + @links.setter + def links(self, links) -> None: ... + @property + def tasks(self): ... + @tasks.setter + def tasks(self, tasks) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/telegraf.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/telegraf.pyi new file mode 100644 index 000000000..18db320a7 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/telegraf.pyi @@ -0,0 +1,35 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.telegraf_request import TelegrafRequest + +class Telegraf(TelegrafRequest): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + id: Incomplete | None = ..., + links: Incomplete | None = ..., + labels: Incomplete | None = ..., + name: Incomplete | None = ..., + description: Incomplete | None = ..., + metadata: Incomplete | None = ..., + config: Incomplete | None = ..., + org_id: Incomplete | None = ..., + ) -> None: ... + @property + def id(self): ... + @id.setter + def id(self, id) -> None: ... + @property + def links(self): ... + @links.setter + def links(self, links) -> None: ... + @property + def labels(self): ... + @labels.setter + def labels(self, labels) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/telegraf_plugin.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/telegraf_plugin.pyi new file mode 100644 index 000000000..aee33a0e5 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/telegraf_plugin.pyi @@ -0,0 +1,33 @@ +from _typeshed import Incomplete + +class TelegrafPlugin: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + type: Incomplete | None = ..., + name: Incomplete | None = ..., + description: Incomplete | None = ..., + config: Incomplete | None = ..., + ) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def description(self): ... + @description.setter + def description(self, description) -> None: ... + @property + def config(self): ... + @config.setter + def config(self, config) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/telegraf_plugin_request.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/telegraf_plugin_request.pyi new file mode 100644 index 000000000..346a2f5a2 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/telegraf_plugin_request.pyi @@ -0,0 +1,43 @@ +from _typeshed import Incomplete + +class TelegrafPluginRequest: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + name: Incomplete | None = ..., + description: Incomplete | None = ..., + plugins: Incomplete | None = ..., + metadata: Incomplete | None = ..., + config: Incomplete | None = ..., + org_id: Incomplete | None = ..., + ) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def description(self): ... + @description.setter + def description(self, description) -> None: ... + @property + def plugins(self): ... + @plugins.setter + def plugins(self, plugins) -> None: ... + @property + def metadata(self): ... + @metadata.setter + def metadata(self, metadata) -> None: ... + @property + def config(self): ... + @config.setter + def config(self, config) -> None: ... + @property + def org_id(self): ... + @org_id.setter + def org_id(self, org_id) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/telegraf_plugin_request_plugins.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/telegraf_plugin_request_plugins.pyi new file mode 100644 index 000000000..1566558b6 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/telegraf_plugin_request_plugins.pyi @@ -0,0 +1,38 @@ +from _typeshed import Incomplete + +class TelegrafPluginRequestPlugins: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + type: Incomplete | None = ..., + name: Incomplete | None = ..., + alias: Incomplete | None = ..., + description: Incomplete | None = ..., + config: Incomplete | None = ..., + ) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def alias(self): ... + @alias.setter + def alias(self, alias) -> None: ... + @property + def description(self): ... + @description.setter + def description(self, description) -> None: ... + @property + def config(self): ... + @config.setter + def config(self, config) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/telegraf_plugins.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/telegraf_plugins.pyi new file mode 100644 index 000000000..b000a1d97 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/telegraf_plugins.pyi @@ -0,0 +1,25 @@ +from _typeshed import Incomplete + +class TelegrafPlugins: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, version: Incomplete | None = ..., os: Incomplete | None = ..., plugins: Incomplete | None = ... + ) -> None: ... + @property + def version(self): ... + @version.setter + def version(self, version) -> None: ... + @property + def os(self): ... + @os.setter + def os(self, os) -> None: ... + @property + def plugins(self): ... + @plugins.setter + def plugins(self, plugins) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/telegraf_request.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/telegraf_request.pyi new file mode 100644 index 000000000..20f62efe6 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/telegraf_request.pyi @@ -0,0 +1,38 @@ +from _typeshed import Incomplete + +class TelegrafRequest: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + name: Incomplete | None = ..., + description: Incomplete | None = ..., + metadata: Incomplete | None = ..., + config: Incomplete | None = ..., + org_id: Incomplete | None = ..., + ) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def description(self): ... + @description.setter + def description(self, description) -> None: ... + @property + def metadata(self): ... + @metadata.setter + def metadata(self, metadata) -> None: ... + @property + def config(self): ... + @config.setter + def config(self, config) -> None: ... + @property + def org_id(self): ... + @org_id.setter + def org_id(self, org_id) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/telegraf_request_metadata.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/telegraf_request_metadata.pyi new file mode 100644 index 000000000..684e89852 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/telegraf_request_metadata.pyi @@ -0,0 +1,15 @@ +from _typeshed import Incomplete + +class TelegrafRequestMetadata: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, buckets: Incomplete | None = ...) -> None: ... + @property + def buckets(self): ... + @buckets.setter + def buckets(self, buckets) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/telegrafs.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/telegrafs.pyi new file mode 100644 index 000000000..a53f49e81 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/telegrafs.pyi @@ -0,0 +1,15 @@ +from _typeshed import Incomplete + +class Telegrafs: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, configurations: Incomplete | None = ...) -> None: ... + @property + def configurations(self): ... + @configurations.setter + def configurations(self, configurations) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/telegram_notification_endpoint.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/telegram_notification_endpoint.pyi new file mode 100644 index 000000000..dbd52d14b --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/telegram_notification_endpoint.pyi @@ -0,0 +1,36 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.notification_endpoint_discriminator import NotificationEndpointDiscriminator + +class TelegramNotificationEndpoint(NotificationEndpointDiscriminator): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + token: Incomplete | None = ..., + channel: Incomplete | None = ..., + id: Incomplete | None = ..., + org_id: Incomplete | None = ..., + user_id: Incomplete | None = ..., + created_at: Incomplete | None = ..., + updated_at: Incomplete | None = ..., + description: Incomplete | None = ..., + name: Incomplete | None = ..., + status: str = ..., + labels: Incomplete | None = ..., + links: Incomplete | None = ..., + type: str = ..., + ) -> None: ... + @property + def token(self): ... + @token.setter + def token(self, token) -> None: ... + @property + def channel(self): ... + @channel.setter + def channel(self, channel) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/telegram_notification_rule.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/telegram_notification_rule.pyi new file mode 100644 index 000000000..47fd76dd5 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/telegram_notification_rule.pyi @@ -0,0 +1,42 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.telegram_notification_rule_base import TelegramNotificationRuleBase + +class TelegramNotificationRule(TelegramNotificationRuleBase): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + type: str = ..., + message_template: Incomplete | None = ..., + parse_mode: Incomplete | None = ..., + disable_web_page_preview: Incomplete | None = ..., + latest_completed: Incomplete | None = ..., + last_run_status: Incomplete | None = ..., + last_run_error: Incomplete | None = ..., + id: Incomplete | None = ..., + endpoint_id: Incomplete | None = ..., + org_id: Incomplete | None = ..., + task_id: Incomplete | None = ..., + owner_id: Incomplete | None = ..., + created_at: Incomplete | None = ..., + updated_at: Incomplete | None = ..., + status: Incomplete | None = ..., + name: Incomplete | None = ..., + sleep_until: Incomplete | None = ..., + every: Incomplete | None = ..., + offset: Incomplete | None = ..., + runbook_link: Incomplete | None = ..., + limit_every: Incomplete | None = ..., + limit: Incomplete | None = ..., + tag_rules: Incomplete | None = ..., + description: Incomplete | None = ..., + status_rules: Incomplete | None = ..., + labels: Incomplete | None = ..., + links: Incomplete | None = ..., + ) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/telegram_notification_rule_base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/telegram_notification_rule_base.pyi new file mode 100644 index 000000000..4d3fee3e3 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/telegram_notification_rule_base.pyi @@ -0,0 +1,58 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.notification_rule_discriminator import NotificationRuleDiscriminator + +class TelegramNotificationRuleBase(NotificationRuleDiscriminator): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + type: Incomplete | None = ..., + message_template: Incomplete | None = ..., + parse_mode: Incomplete | None = ..., + disable_web_page_preview: Incomplete | None = ..., + latest_completed: Incomplete | None = ..., + last_run_status: Incomplete | None = ..., + last_run_error: Incomplete | None = ..., + id: Incomplete | None = ..., + endpoint_id: Incomplete | None = ..., + org_id: Incomplete | None = ..., + task_id: Incomplete | None = ..., + owner_id: Incomplete | None = ..., + created_at: Incomplete | None = ..., + updated_at: Incomplete | None = ..., + status: Incomplete | None = ..., + name: Incomplete | None = ..., + sleep_until: Incomplete | None = ..., + every: Incomplete | None = ..., + offset: Incomplete | None = ..., + runbook_link: Incomplete | None = ..., + limit_every: Incomplete | None = ..., + limit: Incomplete | None = ..., + tag_rules: Incomplete | None = ..., + description: Incomplete | None = ..., + status_rules: Incomplete | None = ..., + labels: Incomplete | None = ..., + links: Incomplete | None = ..., + ) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def message_template(self): ... + @message_template.setter + def message_template(self, message_template) -> None: ... + @property + def parse_mode(self): ... + @parse_mode.setter + def parse_mode(self, parse_mode) -> None: ... + @property + def disable_web_page_preview(self): ... + @disable_web_page_preview.setter + def disable_web_page_preview(self, disable_web_page_preview) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_apply.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_apply.pyi new file mode 100644 index 000000000..2b7fbf5fa --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_apply.pyi @@ -0,0 +1,58 @@ +from _typeshed import Incomplete + +class TemplateApply: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + dry_run: Incomplete | None = ..., + org_id: Incomplete | None = ..., + stack_id: Incomplete | None = ..., + template: Incomplete | None = ..., + templates: Incomplete | None = ..., + env_refs: Incomplete | None = ..., + secrets: Incomplete | None = ..., + remotes: Incomplete | None = ..., + actions: Incomplete | None = ..., + ) -> None: ... + @property + def dry_run(self): ... + @dry_run.setter + def dry_run(self, dry_run) -> None: ... + @property + def org_id(self): ... + @org_id.setter + def org_id(self, org_id) -> None: ... + @property + def stack_id(self): ... + @stack_id.setter + def stack_id(self, stack_id) -> None: ... + @property + def template(self): ... + @template.setter + def template(self, template) -> None: ... + @property + def templates(self): ... + @templates.setter + def templates(self, templates) -> None: ... + @property + def env_refs(self): ... + @env_refs.setter + def env_refs(self, env_refs) -> None: ... + @property + def secrets(self): ... + @secrets.setter + def secrets(self, secrets) -> None: ... + @property + def remotes(self): ... + @remotes.setter + def remotes(self, remotes) -> None: ... + @property + def actions(self): ... + @actions.setter + def actions(self, actions) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_apply_remotes.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_apply_remotes.pyi new file mode 100644 index 000000000..636c4a693 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_apply_remotes.pyi @@ -0,0 +1,19 @@ +from _typeshed import Incomplete + +class TemplateApplyRemotes: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, url: Incomplete | None = ..., content_type: Incomplete | None = ...) -> None: ... + @property + def url(self): ... + @url.setter + def url(self, url) -> None: ... + @property + def content_type(self): ... + @content_type.setter + def content_type(self, content_type) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_apply_template.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_apply_template.pyi new file mode 100644 index 000000000..e4f2dfe05 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_apply_template.pyi @@ -0,0 +1,25 @@ +from _typeshed import Incomplete + +class TemplateApplyTemplate: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, content_type: Incomplete | None = ..., sources: Incomplete | None = ..., contents: Incomplete | None = ... + ) -> None: ... + @property + def content_type(self): ... + @content_type.setter + def content_type(self, content_type) -> None: ... + @property + def sources(self): ... + @sources.setter + def sources(self, sources) -> None: ... + @property + def contents(self): ... + @contents.setter + def contents(self, contents) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_chart.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_chart.pyi new file mode 100644 index 000000000..446232300 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_chart.pyi @@ -0,0 +1,38 @@ +from _typeshed import Incomplete + +class TemplateChart: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + x_pos: Incomplete | None = ..., + y_pos: Incomplete | None = ..., + height: Incomplete | None = ..., + width: Incomplete | None = ..., + properties: Incomplete | None = ..., + ) -> None: ... + @property + def x_pos(self): ... + @x_pos.setter + def x_pos(self, x_pos) -> None: ... + @property + def y_pos(self): ... + @y_pos.setter + def y_pos(self, y_pos) -> None: ... + @property + def height(self): ... + @height.setter + def height(self, height) -> None: ... + @property + def width(self): ... + @width.setter + def width(self, width) -> None: ... + @property + def properties(self): ... + @properties.setter + def properties(self, properties) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_export_by_id.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_export_by_id.pyi new file mode 100644 index 000000000..102d5282a --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_export_by_id.pyi @@ -0,0 +1,25 @@ +from _typeshed import Incomplete + +class TemplateExportByID: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, stack_id: Incomplete | None = ..., org_ids: Incomplete | None = ..., resources: Incomplete | None = ... + ) -> None: ... + @property + def stack_id(self): ... + @stack_id.setter + def stack_id(self, stack_id) -> None: ... + @property + def org_ids(self): ... + @org_ids.setter + def org_ids(self, org_ids) -> None: ... + @property + def resources(self): ... + @resources.setter + def resources(self, resources) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_export_by_id_org_ids.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_export_by_id_org_ids.pyi new file mode 100644 index 000000000..c9f3c80a3 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_export_by_id_org_ids.pyi @@ -0,0 +1,19 @@ +from _typeshed import Incomplete + +class TemplateExportByIDOrgIDs: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, org_id: Incomplete | None = ..., resource_filters: Incomplete | None = ...) -> None: ... + @property + def org_id(self): ... + @org_id.setter + def org_id(self, org_id) -> None: ... + @property + def resource_filters(self): ... + @resource_filters.setter + def resource_filters(self, resource_filters) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_export_by_id_resource_filters.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_export_by_id_resource_filters.pyi new file mode 100644 index 000000000..42a6a2c28 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_export_by_id_resource_filters.pyi @@ -0,0 +1,19 @@ +from _typeshed import Incomplete + +class TemplateExportByIDResourceFilters: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, by_label: Incomplete | None = ..., by_resource_kind: Incomplete | None = ...) -> None: ... + @property + def by_label(self): ... + @by_label.setter + def by_label(self, by_label) -> None: ... + @property + def by_resource_kind(self): ... + @by_resource_kind.setter + def by_resource_kind(self, by_resource_kind) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_export_by_id_resources.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_export_by_id_resources.pyi new file mode 100644 index 000000000..6893e928f --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_export_by_id_resources.pyi @@ -0,0 +1,23 @@ +from _typeshed import Incomplete + +class TemplateExportByIDResources: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, id: Incomplete | None = ..., kind: Incomplete | None = ..., name: Incomplete | None = ...) -> None: ... + @property + def id(self): ... + @id.setter + def id(self, id) -> None: ... + @property + def kind(self): ... + @kind.setter + def kind(self, kind) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_export_by_name.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_export_by_name.pyi new file mode 100644 index 000000000..d7a2159b3 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_export_by_name.pyi @@ -0,0 +1,25 @@ +from _typeshed import Incomplete + +class TemplateExportByName: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, stack_id: Incomplete | None = ..., org_ids: Incomplete | None = ..., resources: Incomplete | None = ... + ) -> None: ... + @property + def stack_id(self): ... + @stack_id.setter + def stack_id(self, stack_id) -> None: ... + @property + def org_ids(self): ... + @org_ids.setter + def org_ids(self, org_ids) -> None: ... + @property + def resources(self): ... + @resources.setter + def resources(self, resources) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_export_by_name_resources.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_export_by_name_resources.pyi new file mode 100644 index 000000000..54607b2c9 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_export_by_name_resources.pyi @@ -0,0 +1,19 @@ +from _typeshed import Incomplete + +class TemplateExportByNameResources: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, kind: Incomplete | None = ..., name: Incomplete | None = ...) -> None: ... + @property + def kind(self): ... + @kind.setter + def kind(self, kind) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_kind.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_kind.pyi new file mode 100644 index 000000000..cb375c1c5 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_kind.pyi @@ -0,0 +1,24 @@ +from _typeshed import Incomplete + +class TemplateKind: + BUCKET: str + CHECK: str + CHECKDEADMAN: str + CHECKTHRESHOLD: str + DASHBOARD: str + LABEL: str + NOTIFICATIONENDPOINT: str + NOTIFICATIONENDPOINTHTTP: str + NOTIFICATIONENDPOINTPAGERDUTY: str + NOTIFICATIONENDPOINTSLACK: str + NOTIFICATIONRULE: str + TASK: str + TELEGRAF: str + VARIABLE: str + openapi_types: Incomplete + attribute_map: Incomplete + def __init__(self) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary.pyi new file mode 100644 index 000000000..b47f85365 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary.pyi @@ -0,0 +1,38 @@ +from _typeshed import Incomplete + +class TemplateSummary: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + sources: Incomplete | None = ..., + stack_id: Incomplete | None = ..., + summary: Incomplete | None = ..., + diff: Incomplete | None = ..., + errors: Incomplete | None = ..., + ) -> None: ... + @property + def sources(self): ... + @sources.setter + def sources(self, sources) -> None: ... + @property + def stack_id(self): ... + @stack_id.setter + def stack_id(self, stack_id) -> None: ... + @property + def summary(self): ... + @summary.setter + def summary(self, summary) -> None: ... + @property + def diff(self): ... + @diff.setter + def diff(self, diff) -> None: ... + @property + def errors(self): ... + @errors.setter + def errors(self, errors) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_diff.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_diff.pyi new file mode 100644 index 000000000..e0105bd3a --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_diff.pyi @@ -0,0 +1,63 @@ +from _typeshed import Incomplete + +class TemplateSummaryDiff: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + buckets: Incomplete | None = ..., + checks: Incomplete | None = ..., + dashboards: Incomplete | None = ..., + labels: Incomplete | None = ..., + label_mappings: Incomplete | None = ..., + notification_endpoints: Incomplete | None = ..., + notification_rules: Incomplete | None = ..., + tasks: Incomplete | None = ..., + telegraf_configs: Incomplete | None = ..., + variables: Incomplete | None = ..., + ) -> None: ... + @property + def buckets(self): ... + @buckets.setter + def buckets(self, buckets) -> None: ... + @property + def checks(self): ... + @checks.setter + def checks(self, checks) -> None: ... + @property + def dashboards(self): ... + @dashboards.setter + def dashboards(self, dashboards) -> None: ... + @property + def labels(self): ... + @labels.setter + def labels(self, labels) -> None: ... + @property + def label_mappings(self): ... + @label_mappings.setter + def label_mappings(self, label_mappings) -> None: ... + @property + def notification_endpoints(self): ... + @notification_endpoints.setter + def notification_endpoints(self, notification_endpoints) -> None: ... + @property + def notification_rules(self): ... + @notification_rules.setter + def notification_rules(self, notification_rules) -> None: ... + @property + def tasks(self): ... + @tasks.setter + def tasks(self, tasks) -> None: ... + @property + def telegraf_configs(self): ... + @telegraf_configs.setter + def telegraf_configs(self, telegraf_configs) -> None: ... + @property + def variables(self): ... + @variables.setter + def variables(self, variables) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_diff_buckets.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_diff_buckets.pyi new file mode 100644 index 000000000..e3ce470e8 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_diff_buckets.pyi @@ -0,0 +1,43 @@ +from _typeshed import Incomplete + +class TemplateSummaryDiffBuckets: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + kind: Incomplete | None = ..., + state_status: Incomplete | None = ..., + id: Incomplete | None = ..., + template_meta_name: Incomplete | None = ..., + new: Incomplete | None = ..., + old: Incomplete | None = ..., + ) -> None: ... + @property + def kind(self): ... + @kind.setter + def kind(self, kind) -> None: ... + @property + def state_status(self): ... + @state_status.setter + def state_status(self, state_status) -> None: ... + @property + def id(self): ... + @id.setter + def id(self, id) -> None: ... + @property + def template_meta_name(self): ... + @template_meta_name.setter + def template_meta_name(self, template_meta_name) -> None: ... + @property + def new(self): ... + @new.setter + def new(self, new) -> None: ... + @property + def old(self): ... + @old.setter + def old(self, old) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_diff_buckets_new_old.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_diff_buckets_new_old.pyi new file mode 100644 index 000000000..a03004bf1 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_diff_buckets_new_old.pyi @@ -0,0 +1,25 @@ +from _typeshed import Incomplete + +class TemplateSummaryDiffBucketsNewOld: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, name: Incomplete | None = ..., description: Incomplete | None = ..., retention_rules: Incomplete | None = ... + ) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def description(self): ... + @description.setter + def description(self, description) -> None: ... + @property + def retention_rules(self): ... + @retention_rules.setter + def retention_rules(self, retention_rules) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_diff_checks.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_diff_checks.pyi new file mode 100644 index 000000000..58c772197 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_diff_checks.pyi @@ -0,0 +1,43 @@ +from _typeshed import Incomplete + +class TemplateSummaryDiffChecks: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + kind: Incomplete | None = ..., + state_status: Incomplete | None = ..., + id: Incomplete | None = ..., + template_meta_name: Incomplete | None = ..., + new: Incomplete | None = ..., + old: Incomplete | None = ..., + ) -> None: ... + @property + def kind(self): ... + @kind.setter + def kind(self, kind) -> None: ... + @property + def state_status(self): ... + @state_status.setter + def state_status(self, state_status) -> None: ... + @property + def id(self): ... + @id.setter + def id(self, id) -> None: ... + @property + def template_meta_name(self): ... + @template_meta_name.setter + def template_meta_name(self, template_meta_name) -> None: ... + @property + def new(self): ... + @new.setter + def new(self, new) -> None: ... + @property + def old(self): ... + @old.setter + def old(self, old) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_diff_dashboards.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_diff_dashboards.pyi new file mode 100644 index 000000000..74c8f4ddc --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_diff_dashboards.pyi @@ -0,0 +1,43 @@ +from _typeshed import Incomplete + +class TemplateSummaryDiffDashboards: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + state_status: Incomplete | None = ..., + id: Incomplete | None = ..., + kind: Incomplete | None = ..., + template_meta_name: Incomplete | None = ..., + new: Incomplete | None = ..., + old: Incomplete | None = ..., + ) -> None: ... + @property + def state_status(self): ... + @state_status.setter + def state_status(self, state_status) -> None: ... + @property + def id(self): ... + @id.setter + def id(self, id) -> None: ... + @property + def kind(self): ... + @kind.setter + def kind(self, kind) -> None: ... + @property + def template_meta_name(self): ... + @template_meta_name.setter + def template_meta_name(self, template_meta_name) -> None: ... + @property + def new(self): ... + @new.setter + def new(self, new) -> None: ... + @property + def old(self): ... + @old.setter + def old(self, old) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_diff_dashboards_new_old.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_diff_dashboards_new_old.pyi new file mode 100644 index 000000000..68987fe72 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_diff_dashboards_new_old.pyi @@ -0,0 +1,25 @@ +from _typeshed import Incomplete + +class TemplateSummaryDiffDashboardsNewOld: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, name: Incomplete | None = ..., description: Incomplete | None = ..., charts: Incomplete | None = ... + ) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def description(self): ... + @description.setter + def description(self, description) -> None: ... + @property + def charts(self): ... + @charts.setter + def charts(self, charts) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_diff_label_mappings.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_diff_label_mappings.pyi new file mode 100644 index 000000000..f5daed3b3 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_diff_label_mappings.pyi @@ -0,0 +1,53 @@ +from _typeshed import Incomplete + +class TemplateSummaryDiffLabelMappings: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + status: Incomplete | None = ..., + resource_type: Incomplete | None = ..., + resource_id: Incomplete | None = ..., + resource_template_meta_name: Incomplete | None = ..., + resource_name: Incomplete | None = ..., + label_id: Incomplete | None = ..., + label_template_meta_name: Incomplete | None = ..., + label_name: Incomplete | None = ..., + ) -> None: ... + @property + def status(self): ... + @status.setter + def status(self, status) -> None: ... + @property + def resource_type(self): ... + @resource_type.setter + def resource_type(self, resource_type) -> None: ... + @property + def resource_id(self): ... + @resource_id.setter + def resource_id(self, resource_id) -> None: ... + @property + def resource_template_meta_name(self): ... + @resource_template_meta_name.setter + def resource_template_meta_name(self, resource_template_meta_name) -> None: ... + @property + def resource_name(self): ... + @resource_name.setter + def resource_name(self, resource_name) -> None: ... + @property + def label_id(self): ... + @label_id.setter + def label_id(self, label_id) -> None: ... + @property + def label_template_meta_name(self): ... + @label_template_meta_name.setter + def label_template_meta_name(self, label_template_meta_name) -> None: ... + @property + def label_name(self): ... + @label_name.setter + def label_name(self, label_name) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_diff_labels.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_diff_labels.pyi new file mode 100644 index 000000000..386d4374c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_diff_labels.pyi @@ -0,0 +1,43 @@ +from _typeshed import Incomplete + +class TemplateSummaryDiffLabels: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + state_status: Incomplete | None = ..., + kind: Incomplete | None = ..., + id: Incomplete | None = ..., + template_meta_name: Incomplete | None = ..., + new: Incomplete | None = ..., + old: Incomplete | None = ..., + ) -> None: ... + @property + def state_status(self): ... + @state_status.setter + def state_status(self, state_status) -> None: ... + @property + def kind(self): ... + @kind.setter + def kind(self, kind) -> None: ... + @property + def id(self): ... + @id.setter + def id(self, id) -> None: ... + @property + def template_meta_name(self): ... + @template_meta_name.setter + def template_meta_name(self, template_meta_name) -> None: ... + @property + def new(self): ... + @new.setter + def new(self, new) -> None: ... + @property + def old(self): ... + @old.setter + def old(self, old) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_diff_labels_new_old.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_diff_labels_new_old.pyi new file mode 100644 index 000000000..8bc87e00e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_diff_labels_new_old.pyi @@ -0,0 +1,25 @@ +from _typeshed import Incomplete + +class TemplateSummaryDiffLabelsNewOld: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, name: Incomplete | None = ..., color: Incomplete | None = ..., description: Incomplete | None = ... + ) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def color(self): ... + @color.setter + def color(self, color) -> None: ... + @property + def description(self): ... + @description.setter + def description(self, description) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_diff_notification_endpoints.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_diff_notification_endpoints.pyi new file mode 100644 index 000000000..58ef6786f --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_diff_notification_endpoints.pyi @@ -0,0 +1,43 @@ +from _typeshed import Incomplete + +class TemplateSummaryDiffNotificationEndpoints: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + kind: Incomplete | None = ..., + state_status: Incomplete | None = ..., + id: Incomplete | None = ..., + template_meta_name: Incomplete | None = ..., + new: Incomplete | None = ..., + old: Incomplete | None = ..., + ) -> None: ... + @property + def kind(self): ... + @kind.setter + def kind(self, kind) -> None: ... + @property + def state_status(self): ... + @state_status.setter + def state_status(self, state_status) -> None: ... + @property + def id(self): ... + @id.setter + def id(self, id) -> None: ... + @property + def template_meta_name(self): ... + @template_meta_name.setter + def template_meta_name(self, template_meta_name) -> None: ... + @property + def new(self): ... + @new.setter + def new(self, new) -> None: ... + @property + def old(self): ... + @old.setter + def old(self, old) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_diff_notification_rules.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_diff_notification_rules.pyi new file mode 100644 index 000000000..f5d3b5307 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_diff_notification_rules.pyi @@ -0,0 +1,43 @@ +from _typeshed import Incomplete + +class TemplateSummaryDiffNotificationRules: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + kind: Incomplete | None = ..., + state_status: Incomplete | None = ..., + id: Incomplete | None = ..., + template_meta_name: Incomplete | None = ..., + new: Incomplete | None = ..., + old: Incomplete | None = ..., + ) -> None: ... + @property + def kind(self): ... + @kind.setter + def kind(self, kind) -> None: ... + @property + def state_status(self): ... + @state_status.setter + def state_status(self, state_status) -> None: ... + @property + def id(self): ... + @id.setter + def id(self, id) -> None: ... + @property + def template_meta_name(self): ... + @template_meta_name.setter + def template_meta_name(self, template_meta_name) -> None: ... + @property + def new(self): ... + @new.setter + def new(self, new) -> None: ... + @property + def old(self): ... + @old.setter + def old(self, old) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_diff_notification_rules_new_old.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_diff_notification_rules_new_old.pyi new file mode 100644 index 000000000..e717dd804 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_diff_notification_rules_new_old.pyi @@ -0,0 +1,68 @@ +from _typeshed import Incomplete + +class TemplateSummaryDiffNotificationRulesNewOld: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + name: Incomplete | None = ..., + description: Incomplete | None = ..., + endpoint_name: Incomplete | None = ..., + endpoint_id: Incomplete | None = ..., + endpoint_type: Incomplete | None = ..., + every: Incomplete | None = ..., + offset: Incomplete | None = ..., + message_template: Incomplete | None = ..., + status: Incomplete | None = ..., + status_rules: Incomplete | None = ..., + tag_rules: Incomplete | None = ..., + ) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def description(self): ... + @description.setter + def description(self, description) -> None: ... + @property + def endpoint_name(self): ... + @endpoint_name.setter + def endpoint_name(self, endpoint_name) -> None: ... + @property + def endpoint_id(self): ... + @endpoint_id.setter + def endpoint_id(self, endpoint_id) -> None: ... + @property + def endpoint_type(self): ... + @endpoint_type.setter + def endpoint_type(self, endpoint_type) -> None: ... + @property + def every(self): ... + @every.setter + def every(self, every) -> None: ... + @property + def offset(self): ... + @offset.setter + def offset(self, offset) -> None: ... + @property + def message_template(self): ... + @message_template.setter + def message_template(self, message_template) -> None: ... + @property + def status(self): ... + @status.setter + def status(self, status) -> None: ... + @property + def status_rules(self): ... + @status_rules.setter + def status_rules(self, status_rules) -> None: ... + @property + def tag_rules(self): ... + @tag_rules.setter + def tag_rules(self, tag_rules) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_diff_tasks.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_diff_tasks.pyi new file mode 100644 index 000000000..a012bb4f9 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_diff_tasks.pyi @@ -0,0 +1,43 @@ +from _typeshed import Incomplete + +class TemplateSummaryDiffTasks: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + kind: Incomplete | None = ..., + state_status: Incomplete | None = ..., + id: Incomplete | None = ..., + template_meta_name: Incomplete | None = ..., + new: Incomplete | None = ..., + old: Incomplete | None = ..., + ) -> None: ... + @property + def kind(self): ... + @kind.setter + def kind(self, kind) -> None: ... + @property + def state_status(self): ... + @state_status.setter + def state_status(self, state_status) -> None: ... + @property + def id(self): ... + @id.setter + def id(self, id) -> None: ... + @property + def template_meta_name(self): ... + @template_meta_name.setter + def template_meta_name(self, template_meta_name) -> None: ... + @property + def new(self): ... + @new.setter + def new(self, new) -> None: ... + @property + def old(self): ... + @old.setter + def old(self, old) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_diff_tasks_new_old.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_diff_tasks_new_old.pyi new file mode 100644 index 000000000..ee87c2bd3 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_diff_tasks_new_old.pyi @@ -0,0 +1,48 @@ +from _typeshed import Incomplete + +class TemplateSummaryDiffTasksNewOld: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + name: Incomplete | None = ..., + cron: Incomplete | None = ..., + description: Incomplete | None = ..., + every: Incomplete | None = ..., + offset: Incomplete | None = ..., + query: Incomplete | None = ..., + status: Incomplete | None = ..., + ) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def cron(self): ... + @cron.setter + def cron(self, cron) -> None: ... + @property + def description(self): ... + @description.setter + def description(self, description) -> None: ... + @property + def every(self): ... + @every.setter + def every(self, every) -> None: ... + @property + def offset(self): ... + @offset.setter + def offset(self, offset) -> None: ... + @property + def query(self): ... + @query.setter + def query(self, query) -> None: ... + @property + def status(self): ... + @status.setter + def status(self, status) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_diff_telegraf_configs.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_diff_telegraf_configs.pyi new file mode 100644 index 000000000..82f0309e3 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_diff_telegraf_configs.pyi @@ -0,0 +1,43 @@ +from _typeshed import Incomplete + +class TemplateSummaryDiffTelegrafConfigs: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + kind: Incomplete | None = ..., + state_status: Incomplete | None = ..., + id: Incomplete | None = ..., + template_meta_name: Incomplete | None = ..., + new: Incomplete | None = ..., + old: Incomplete | None = ..., + ) -> None: ... + @property + def kind(self): ... + @kind.setter + def kind(self, kind) -> None: ... + @property + def state_status(self): ... + @state_status.setter + def state_status(self, state_status) -> None: ... + @property + def id(self): ... + @id.setter + def id(self, id) -> None: ... + @property + def template_meta_name(self): ... + @template_meta_name.setter + def template_meta_name(self, template_meta_name) -> None: ... + @property + def new(self): ... + @new.setter + def new(self, new) -> None: ... + @property + def old(self): ... + @old.setter + def old(self, old) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_diff_variables.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_diff_variables.pyi new file mode 100644 index 000000000..f06525fb9 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_diff_variables.pyi @@ -0,0 +1,43 @@ +from _typeshed import Incomplete + +class TemplateSummaryDiffVariables: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + kind: Incomplete | None = ..., + state_status: Incomplete | None = ..., + id: Incomplete | None = ..., + template_meta_name: Incomplete | None = ..., + new: Incomplete | None = ..., + old: Incomplete | None = ..., + ) -> None: ... + @property + def kind(self): ... + @kind.setter + def kind(self, kind) -> None: ... + @property + def state_status(self): ... + @state_status.setter + def state_status(self, state_status) -> None: ... + @property + def id(self): ... + @id.setter + def id(self, id) -> None: ... + @property + def template_meta_name(self): ... + @template_meta_name.setter + def template_meta_name(self, template_meta_name) -> None: ... + @property + def new(self): ... + @new.setter + def new(self, new) -> None: ... + @property + def old(self): ... + @old.setter + def old(self, old) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_diff_variables_new_old.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_diff_variables_new_old.pyi new file mode 100644 index 000000000..bd55b8823 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_diff_variables_new_old.pyi @@ -0,0 +1,25 @@ +from _typeshed import Incomplete + +class TemplateSummaryDiffVariablesNewOld: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, name: Incomplete | None = ..., description: Incomplete | None = ..., args: Incomplete | None = ... + ) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def description(self): ... + @description.setter + def description(self, description) -> None: ... + @property + def args(self): ... + @args.setter + def args(self, args) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_errors.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_errors.pyi new file mode 100644 index 000000000..aba5c8076 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_errors.pyi @@ -0,0 +1,33 @@ +from _typeshed import Incomplete + +class TemplateSummaryErrors: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + kind: Incomplete | None = ..., + reason: Incomplete | None = ..., + fields: Incomplete | None = ..., + indexes: Incomplete | None = ..., + ) -> None: ... + @property + def kind(self): ... + @kind.setter + def kind(self, kind) -> None: ... + @property + def reason(self): ... + @reason.setter + def reason(self, reason) -> None: ... + @property + def fields(self): ... + @fields.setter + def fields(self, fields) -> None: ... + @property + def indexes(self): ... + @indexes.setter + def indexes(self, indexes) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_label.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_label.pyi new file mode 100644 index 000000000..c02353abb --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_label.pyi @@ -0,0 +1,48 @@ +from _typeshed import Incomplete + +class TemplateSummaryLabel: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + id: Incomplete | None = ..., + org_id: Incomplete | None = ..., + kind: Incomplete | None = ..., + template_meta_name: Incomplete | None = ..., + name: Incomplete | None = ..., + properties: Incomplete | None = ..., + env_references: Incomplete | None = ..., + ) -> None: ... + @property + def id(self): ... + @id.setter + def id(self, id) -> None: ... + @property + def org_id(self): ... + @org_id.setter + def org_id(self, org_id) -> None: ... + @property + def kind(self): ... + @kind.setter + def kind(self, kind) -> None: ... + @property + def template_meta_name(self): ... + @template_meta_name.setter + def template_meta_name(self, template_meta_name) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def properties(self): ... + @properties.setter + def properties(self, properties) -> None: ... + @property + def env_references(self): ... + @env_references.setter + def env_references(self, env_references) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_label_properties.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_label_properties.pyi new file mode 100644 index 000000000..bc4de9640 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_label_properties.pyi @@ -0,0 +1,19 @@ +from _typeshed import Incomplete + +class TemplateSummaryLabelProperties: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, color: Incomplete | None = ..., description: Incomplete | None = ...) -> None: ... + @property + def color(self): ... + @color.setter + def color(self, color) -> None: ... + @property + def description(self): ... + @description.setter + def description(self, description) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_summary.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_summary.pyi new file mode 100644 index 000000000..939179cbd --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_summary.pyi @@ -0,0 +1,73 @@ +from _typeshed import Incomplete + +class TemplateSummarySummary: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + buckets: Incomplete | None = ..., + checks: Incomplete | None = ..., + dashboards: Incomplete | None = ..., + labels: Incomplete | None = ..., + label_mappings: Incomplete | None = ..., + missing_env_refs: Incomplete | None = ..., + missing_secrets: Incomplete | None = ..., + notification_endpoints: Incomplete | None = ..., + notification_rules: Incomplete | None = ..., + tasks: Incomplete | None = ..., + telegraf_configs: Incomplete | None = ..., + variables: Incomplete | None = ..., + ) -> None: ... + @property + def buckets(self): ... + @buckets.setter + def buckets(self, buckets) -> None: ... + @property + def checks(self): ... + @checks.setter + def checks(self, checks) -> None: ... + @property + def dashboards(self): ... + @dashboards.setter + def dashboards(self, dashboards) -> None: ... + @property + def labels(self): ... + @labels.setter + def labels(self, labels) -> None: ... + @property + def label_mappings(self): ... + @label_mappings.setter + def label_mappings(self, label_mappings) -> None: ... + @property + def missing_env_refs(self): ... + @missing_env_refs.setter + def missing_env_refs(self, missing_env_refs) -> None: ... + @property + def missing_secrets(self): ... + @missing_secrets.setter + def missing_secrets(self, missing_secrets) -> None: ... + @property + def notification_endpoints(self): ... + @notification_endpoints.setter + def notification_endpoints(self, notification_endpoints) -> None: ... + @property + def notification_rules(self): ... + @notification_rules.setter + def notification_rules(self, notification_rules) -> None: ... + @property + def tasks(self): ... + @tasks.setter + def tasks(self, tasks) -> None: ... + @property + def telegraf_configs(self): ... + @telegraf_configs.setter + def telegraf_configs(self, telegraf_configs) -> None: ... + @property + def variables(self): ... + @variables.setter + def variables(self, variables) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_summary_buckets.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_summary_buckets.pyi new file mode 100644 index 000000000..cc8184b90 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_summary_buckets.pyi @@ -0,0 +1,58 @@ +from _typeshed import Incomplete + +class TemplateSummarySummaryBuckets: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + id: Incomplete | None = ..., + org_id: Incomplete | None = ..., + kind: Incomplete | None = ..., + template_meta_name: Incomplete | None = ..., + name: Incomplete | None = ..., + description: Incomplete | None = ..., + retention_period: Incomplete | None = ..., + label_associations: Incomplete | None = ..., + env_references: Incomplete | None = ..., + ) -> None: ... + @property + def id(self): ... + @id.setter + def id(self, id) -> None: ... + @property + def org_id(self): ... + @org_id.setter + def org_id(self, org_id) -> None: ... + @property + def kind(self): ... + @kind.setter + def kind(self, kind) -> None: ... + @property + def template_meta_name(self): ... + @template_meta_name.setter + def template_meta_name(self, template_meta_name) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def description(self): ... + @description.setter + def description(self, description) -> None: ... + @property + def retention_period(self): ... + @retention_period.setter + def retention_period(self, retention_period) -> None: ... + @property + def label_associations(self): ... + @label_associations.setter + def label_associations(self, label_associations) -> None: ... + @property + def env_references(self): ... + @env_references.setter + def env_references(self, env_references) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_summary_dashboards.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_summary_dashboards.pyi new file mode 100644 index 000000000..3b616f5ad --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_summary_dashboards.pyi @@ -0,0 +1,58 @@ +from _typeshed import Incomplete + +class TemplateSummarySummaryDashboards: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + id: Incomplete | None = ..., + org_id: Incomplete | None = ..., + kind: Incomplete | None = ..., + template_meta_name: Incomplete | None = ..., + name: Incomplete | None = ..., + description: Incomplete | None = ..., + label_associations: Incomplete | None = ..., + charts: Incomplete | None = ..., + env_references: Incomplete | None = ..., + ) -> None: ... + @property + def id(self): ... + @id.setter + def id(self, id) -> None: ... + @property + def org_id(self): ... + @org_id.setter + def org_id(self, org_id) -> None: ... + @property + def kind(self): ... + @kind.setter + def kind(self, kind) -> None: ... + @property + def template_meta_name(self): ... + @template_meta_name.setter + def template_meta_name(self, template_meta_name) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def description(self): ... + @description.setter + def description(self, description) -> None: ... + @property + def label_associations(self): ... + @label_associations.setter + def label_associations(self, label_associations) -> None: ... + @property + def charts(self): ... + @charts.setter + def charts(self, charts) -> None: ... + @property + def env_references(self): ... + @env_references.setter + def env_references(self, env_references) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_summary_label_mappings.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_summary_label_mappings.pyi new file mode 100644 index 000000000..bbc3b3602 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_summary_label_mappings.pyi @@ -0,0 +1,53 @@ +from _typeshed import Incomplete + +class TemplateSummarySummaryLabelMappings: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + status: Incomplete | None = ..., + resource_template_meta_name: Incomplete | None = ..., + resource_name: Incomplete | None = ..., + resource_id: Incomplete | None = ..., + resource_type: Incomplete | None = ..., + label_template_meta_name: Incomplete | None = ..., + label_name: Incomplete | None = ..., + label_id: Incomplete | None = ..., + ) -> None: ... + @property + def status(self): ... + @status.setter + def status(self, status) -> None: ... + @property + def resource_template_meta_name(self): ... + @resource_template_meta_name.setter + def resource_template_meta_name(self, resource_template_meta_name) -> None: ... + @property + def resource_name(self): ... + @resource_name.setter + def resource_name(self, resource_name) -> None: ... + @property + def resource_id(self): ... + @resource_id.setter + def resource_id(self, resource_id) -> None: ... + @property + def resource_type(self): ... + @resource_type.setter + def resource_type(self, resource_type) -> None: ... + @property + def label_template_meta_name(self): ... + @label_template_meta_name.setter + def label_template_meta_name(self, label_template_meta_name) -> None: ... + @property + def label_name(self): ... + @label_name.setter + def label_name(self, label_name) -> None: ... + @property + def label_id(self): ... + @label_id.setter + def label_id(self, label_id) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_summary_notification_rules.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_summary_notification_rules.pyi new file mode 100644 index 000000000..b68a224db --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_summary_notification_rules.pyi @@ -0,0 +1,88 @@ +from _typeshed import Incomplete + +class TemplateSummarySummaryNotificationRules: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + kind: Incomplete | None = ..., + template_meta_name: Incomplete | None = ..., + name: Incomplete | None = ..., + description: Incomplete | None = ..., + endpoint_template_meta_name: Incomplete | None = ..., + endpoint_id: Incomplete | None = ..., + endpoint_type: Incomplete | None = ..., + every: Incomplete | None = ..., + offset: Incomplete | None = ..., + message_template: Incomplete | None = ..., + status: Incomplete | None = ..., + status_rules: Incomplete | None = ..., + tag_rules: Incomplete | None = ..., + label_associations: Incomplete | None = ..., + env_references: Incomplete | None = ..., + ) -> None: ... + @property + def kind(self): ... + @kind.setter + def kind(self, kind) -> None: ... + @property + def template_meta_name(self): ... + @template_meta_name.setter + def template_meta_name(self, template_meta_name) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def description(self): ... + @description.setter + def description(self, description) -> None: ... + @property + def endpoint_template_meta_name(self): ... + @endpoint_template_meta_name.setter + def endpoint_template_meta_name(self, endpoint_template_meta_name) -> None: ... + @property + def endpoint_id(self): ... + @endpoint_id.setter + def endpoint_id(self, endpoint_id) -> None: ... + @property + def endpoint_type(self): ... + @endpoint_type.setter + def endpoint_type(self, endpoint_type) -> None: ... + @property + def every(self): ... + @every.setter + def every(self, every) -> None: ... + @property + def offset(self): ... + @offset.setter + def offset(self, offset) -> None: ... + @property + def message_template(self): ... + @message_template.setter + def message_template(self, message_template) -> None: ... + @property + def status(self): ... + @status.setter + def status(self, status) -> None: ... + @property + def status_rules(self): ... + @status_rules.setter + def status_rules(self, status_rules) -> None: ... + @property + def tag_rules(self): ... + @tag_rules.setter + def tag_rules(self, tag_rules) -> None: ... + @property + def label_associations(self): ... + @label_associations.setter + def label_associations(self, label_associations) -> None: ... + @property + def env_references(self): ... + @env_references.setter + def env_references(self, env_references) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_summary_status_rules.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_summary_status_rules.pyi new file mode 100644 index 000000000..d07be95e4 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_summary_status_rules.pyi @@ -0,0 +1,19 @@ +from _typeshed import Incomplete + +class TemplateSummarySummaryStatusRules: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, current_level: Incomplete | None = ..., previous_level: Incomplete | None = ...) -> None: ... + @property + def current_level(self): ... + @current_level.setter + def current_level(self, current_level) -> None: ... + @property + def previous_level(self): ... + @previous_level.setter + def previous_level(self, previous_level) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_summary_tag_rules.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_summary_tag_rules.pyi new file mode 100644 index 000000000..820c085b1 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_summary_tag_rules.pyi @@ -0,0 +1,25 @@ +from _typeshed import Incomplete + +class TemplateSummarySummaryTagRules: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, key: Incomplete | None = ..., value: Incomplete | None = ..., operator: Incomplete | None = ... + ) -> None: ... + @property + def key(self): ... + @key.setter + def key(self, key) -> None: ... + @property + def value(self): ... + @value.setter + def value(self, value) -> None: ... + @property + def operator(self): ... + @operator.setter + def operator(self, operator) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_summary_tasks.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_summary_tasks.pyi new file mode 100644 index 000000000..a2425cb34 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_summary_tasks.pyi @@ -0,0 +1,68 @@ +from _typeshed import Incomplete + +class TemplateSummarySummaryTasks: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + kind: Incomplete | None = ..., + template_meta_name: Incomplete | None = ..., + id: Incomplete | None = ..., + name: Incomplete | None = ..., + cron: Incomplete | None = ..., + description: Incomplete | None = ..., + every: Incomplete | None = ..., + offset: Incomplete | None = ..., + query: Incomplete | None = ..., + status: Incomplete | None = ..., + env_references: Incomplete | None = ..., + ) -> None: ... + @property + def kind(self): ... + @kind.setter + def kind(self, kind) -> None: ... + @property + def template_meta_name(self): ... + @template_meta_name.setter + def template_meta_name(self, template_meta_name) -> None: ... + @property + def id(self): ... + @id.setter + def id(self, id) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def cron(self): ... + @cron.setter + def cron(self, cron) -> None: ... + @property + def description(self): ... + @description.setter + def description(self, description) -> None: ... + @property + def every(self): ... + @every.setter + def every(self, every) -> None: ... + @property + def offset(self): ... + @offset.setter + def offset(self, offset) -> None: ... + @property + def query(self): ... + @query.setter + def query(self, query) -> None: ... + @property + def status(self): ... + @status.setter + def status(self, status) -> None: ... + @property + def env_references(self): ... + @env_references.setter + def env_references(self, env_references) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_summary_variables.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_summary_variables.pyi new file mode 100644 index 000000000..44133a7a7 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/template_summary_summary_variables.pyi @@ -0,0 +1,58 @@ +from _typeshed import Incomplete + +class TemplateSummarySummaryVariables: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + kind: Incomplete | None = ..., + template_meta_name: Incomplete | None = ..., + id: Incomplete | None = ..., + org_id: Incomplete | None = ..., + name: Incomplete | None = ..., + description: Incomplete | None = ..., + arguments: Incomplete | None = ..., + label_associations: Incomplete | None = ..., + env_references: Incomplete | None = ..., + ) -> None: ... + @property + def kind(self): ... + @kind.setter + def kind(self, kind) -> None: ... + @property + def template_meta_name(self): ... + @template_meta_name.setter + def template_meta_name(self, template_meta_name) -> None: ... + @property + def id(self): ... + @id.setter + def id(self, id) -> None: ... + @property + def org_id(self): ... + @org_id.setter + def org_id(self, org_id) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def description(self): ... + @description.setter + def description(self, description) -> None: ... + @property + def arguments(self): ... + @arguments.setter + def arguments(self, arguments) -> None: ... + @property + def label_associations(self): ... + @label_associations.setter + def label_associations(self, label_associations) -> None: ... + @property + def env_references(self): ... + @env_references.setter + def env_references(self, env_references) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/test_statement.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/test_statement.pyi new file mode 100644 index 000000000..4c93f9487 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/test_statement.pyi @@ -0,0 +1,18 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.statement import Statement + +class TestStatement(Statement): + def __init__(self, type: Incomplete | None = ..., assignment: Incomplete | None = ...): ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def assignment(self): ... + @assignment.setter + def assignment(self, assignment) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/threshold.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/threshold.pyi new file mode 100644 index 000000000..3633be3ce --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/threshold.pyi @@ -0,0 +1,17 @@ +from _typeshed import Incomplete + +class Threshold: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator_value_class_map: Incomplete + discriminator: str + def __init__(self, type: Incomplete | None = ...) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + def get_real_child_model(self, data): ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/threshold_base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/threshold_base.pyi new file mode 100644 index 000000000..e67f3a77e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/threshold_base.pyi @@ -0,0 +1,19 @@ +from _typeshed import Incomplete + +class ThresholdBase: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, level: Incomplete | None = ..., all_values: Incomplete | None = ...) -> None: ... + @property + def level(self): ... + @level.setter + def level(self, level) -> None: ... + @property + def all_values(self): ... + @all_values.setter + def all_values(self, all_values) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/threshold_check.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/threshold_check.pyi new file mode 100644 index 000000000..5ba66f089 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/threshold_check.pyi @@ -0,0 +1,60 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.check_discriminator import CheckDiscriminator + +class ThresholdCheck(CheckDiscriminator): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + type: str = ..., + thresholds: Incomplete | None = ..., + every: Incomplete | None = ..., + offset: Incomplete | None = ..., + tags: Incomplete | None = ..., + status_message_template: Incomplete | None = ..., + id: Incomplete | None = ..., + name: Incomplete | None = ..., + org_id: Incomplete | None = ..., + task_id: Incomplete | None = ..., + owner_id: Incomplete | None = ..., + created_at: Incomplete | None = ..., + updated_at: Incomplete | None = ..., + query: Incomplete | None = ..., + status: Incomplete | None = ..., + description: Incomplete | None = ..., + latest_completed: Incomplete | None = ..., + last_run_status: Incomplete | None = ..., + last_run_error: Incomplete | None = ..., + labels: Incomplete | None = ..., + links: Incomplete | None = ..., + ) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def thresholds(self): ... + @thresholds.setter + def thresholds(self, thresholds) -> None: ... + @property + def every(self): ... + @every.setter + def every(self, every) -> None: ... + @property + def offset(self): ... + @offset.setter + def offset(self, offset) -> None: ... + @property + def tags(self): ... + @tags.setter + def tags(self, tags) -> None: ... + @property + def status_message_template(self): ... + @status_message_template.setter + def status_message_template(self, status_message_template) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/unary_expression.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/unary_expression.pyi new file mode 100644 index 000000000..30d06beb8 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/unary_expression.pyi @@ -0,0 +1,27 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.expression import Expression + +class UnaryExpression(Expression): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, type: Incomplete | None = ..., operator: Incomplete | None = ..., argument: Incomplete | None = ... + ) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def operator(self): ... + @operator.setter + def operator(self, operator) -> None: ... + @property + def argument(self): ... + @argument.setter + def argument(self, argument) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/unsigned_integer_literal.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/unsigned_integer_literal.pyi new file mode 100644 index 000000000..397cb61df --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/unsigned_integer_literal.pyi @@ -0,0 +1,21 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.expression import Expression + +class UnsignedIntegerLiteral(Expression): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, type: Incomplete | None = ..., value: Incomplete | None = ...) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def value(self): ... + @value.setter + def value(self, value) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/user.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/user.pyi new file mode 100644 index 000000000..13b8516d7 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/user.pyi @@ -0,0 +1,29 @@ +from _typeshed import Incomplete + +class User: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, id: Incomplete | None = ..., oauth_id: Incomplete | None = ..., name: Incomplete | None = ..., status: str = ... + ) -> None: ... + @property + def id(self): ... + @id.setter + def id(self, id) -> None: ... + @property + def oauth_id(self): ... + @oauth_id.setter + def oauth_id(self, oauth_id) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def status(self): ... + @status.setter + def status(self, status) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/user_response.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/user_response.pyi new file mode 100644 index 000000000..6b89e1875 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/user_response.pyi @@ -0,0 +1,38 @@ +from _typeshed import Incomplete + +class UserResponse: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + id: Incomplete | None = ..., + oauth_id: Incomplete | None = ..., + name: Incomplete | None = ..., + status: str = ..., + links: Incomplete | None = ..., + ) -> None: ... + @property + def id(self): ... + @id.setter + def id(self, id) -> None: ... + @property + def oauth_id(self): ... + @oauth_id.setter + def oauth_id(self, oauth_id) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def status(self): ... + @status.setter + def status(self, status) -> None: ... + @property + def links(self): ... + @links.setter + def links(self, links) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/user_response_links.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/user_response_links.pyi new file mode 100644 index 000000000..710d020f8 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/user_response_links.pyi @@ -0,0 +1,11 @@ +from _typeshed import Incomplete + +class UserResponseLinks: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, _self: Incomplete | None = ...) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/users.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/users.pyi new file mode 100644 index 000000000..161f35e33 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/users.pyi @@ -0,0 +1,19 @@ +from _typeshed import Incomplete + +class Users: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, links: Incomplete | None = ..., users: Incomplete | None = ...) -> None: ... + @property + def links(self): ... + @links.setter + def links(self, links) -> None: ... + @property + def users(self): ... + @users.setter + def users(self, users) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/variable.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/variable.pyi new file mode 100644 index 000000000..4d8a35528 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/variable.pyi @@ -0,0 +1,63 @@ +from _typeshed import Incomplete + +class Variable: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + links: Incomplete | None = ..., + id: Incomplete | None = ..., + org_id: Incomplete | None = ..., + name: Incomplete | None = ..., + description: Incomplete | None = ..., + selected: Incomplete | None = ..., + labels: Incomplete | None = ..., + arguments: Incomplete | None = ..., + created_at: Incomplete | None = ..., + updated_at: Incomplete | None = ..., + ) -> None: ... + @property + def links(self): ... + @links.setter + def links(self, links) -> None: ... + @property + def id(self): ... + @id.setter + def id(self, id) -> None: ... + @property + def org_id(self): ... + @org_id.setter + def org_id(self, org_id) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def description(self): ... + @description.setter + def description(self, description) -> None: ... + @property + def selected(self): ... + @selected.setter + def selected(self, selected) -> None: ... + @property + def labels(self): ... + @labels.setter + def labels(self, labels) -> None: ... + @property + def arguments(self): ... + @arguments.setter + def arguments(self, arguments) -> None: ... + @property + def created_at(self): ... + @created_at.setter + def created_at(self, created_at) -> None: ... + @property + def updated_at(self): ... + @updated_at.setter + def updated_at(self, updated_at) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/variable_assignment.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/variable_assignment.pyi new file mode 100644 index 000000000..5a767f7a8 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/variable_assignment.pyi @@ -0,0 +1,25 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.statement import Statement + +class VariableAssignment(Statement): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, type: Incomplete | None = ..., id: Incomplete | None = ..., init: Incomplete | None = ...) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def id(self): ... + @id.setter + def id(self, id) -> None: ... + @property + def init(self): ... + @init.setter + def init(self, init) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/variable_links.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/variable_links.pyi new file mode 100644 index 000000000..2ee8bb698 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/variable_links.pyi @@ -0,0 +1,19 @@ +from _typeshed import Incomplete + +class VariableLinks: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, _self: Incomplete | None = ..., org: Incomplete | None = ..., labels: Incomplete | None = ...) -> None: ... + @property + def org(self): ... + @org.setter + def org(self, org) -> None: ... + @property + def labels(self): ... + @labels.setter + def labels(self, labels) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/variable_properties.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/variable_properties.pyi new file mode 100644 index 000000000..4554cacfe --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/variable_properties.pyi @@ -0,0 +1,10 @@ +from _typeshed import Incomplete + +class VariableProperties: + openapi_types: Incomplete + attribute_map: Incomplete + def __init__(self) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/variables.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/variables.pyi new file mode 100644 index 000000000..4dc5281c8 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/variables.pyi @@ -0,0 +1,15 @@ +from _typeshed import Incomplete + +class Variables: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, variables: Incomplete | None = ...) -> None: ... + @property + def variables(self): ... + @variables.setter + def variables(self, variables) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/view.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/view.pyi new file mode 100644 index 000000000..ecaaa8cad --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/view.pyi @@ -0,0 +1,33 @@ +from _typeshed import Incomplete + +class View: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + links: Incomplete | None = ..., + id: Incomplete | None = ..., + name: Incomplete | None = ..., + properties: Incomplete | None = ..., + ) -> None: ... + @property + def links(self): ... + @links.setter + def links(self, links) -> None: ... + @property + def id(self): ... + @id.setter + def id(self, id) -> None: ... + @property + def name(self): ... + @name.setter + def name(self, name) -> None: ... + @property + def properties(self): ... + @properties.setter + def properties(self, properties) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/view_links.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/view_links.pyi new file mode 100644 index 000000000..a290c0e0e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/view_links.pyi @@ -0,0 +1,11 @@ +from _typeshed import Incomplete + +class ViewLinks: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, _self: Incomplete | None = ...) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/view_properties.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/view_properties.pyi new file mode 100644 index 000000000..eef5b89ae --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/view_properties.pyi @@ -0,0 +1,10 @@ +from _typeshed import Incomplete + +class ViewProperties: + openapi_types: Incomplete + attribute_map: Incomplete + def __init__(self) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/views.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/views.pyi new file mode 100644 index 000000000..86603392e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/views.pyi @@ -0,0 +1,19 @@ +from _typeshed import Incomplete + +class Views: + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__(self, links: Incomplete | None = ..., views: Incomplete | None = ...) -> None: ... + @property + def links(self): ... + @links.setter + def links(self, links) -> None: ... + @property + def views(self): ... + @views.setter + def views(self, views) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/write_precision.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/write_precision.pyi new file mode 100644 index 000000000..88f738314 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/write_precision.pyi @@ -0,0 +1,18 @@ +from _typeshed import Incomplete +from typing import Any, ClassVar +from typing_extensions import Final, Literal, TypeAlias + +_WritePrecision: TypeAlias = Literal["ms", "s", "us", "ns"] # noqa: Y047 + +class WritePrecision: + MS: Final = "ms" + S: Final = "s" + US: Final = "us" + NS: Final = "ns" + openapi_types: ClassVar[dict[str, Incomplete]] + attribute_map: ClassVar[dict[str, Incomplete]] + def __init__(self) -> None: ... + def to_dict(self) -> dict[str, Any]: ... + def to_str(self) -> str: ... + def __eq__(self, other: object) -> bool: ... + def __ne__(self, other: object) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/xy_geom.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/xy_geom.pyi new file mode 100644 index 000000000..e4ab5eba1 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/xy_geom.pyi @@ -0,0 +1,17 @@ +from _typeshed import Incomplete + +class XYGeom: + LINE: str + STEP: str + STACKED: str + BAR: str + MONOTONEX: str + STEPBEFORE: str + STEPAFTER: str + openapi_types: Incomplete + attribute_map: Incomplete + def __init__(self) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/xy_view_properties.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/xy_view_properties.pyi new file mode 100644 index 000000000..b1a3e9126 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/domain/xy_view_properties.pyi @@ -0,0 +1,155 @@ +from _typeshed import Incomplete + +from influxdb_client.domain.view_properties import ViewProperties + +class XYViewProperties(ViewProperties): + openapi_types: Incomplete + attribute_map: Incomplete + discriminator: Incomplete + def __init__( + self, + time_format: Incomplete | None = ..., + type: Incomplete | None = ..., + queries: Incomplete | None = ..., + colors: Incomplete | None = ..., + color_mapping: Incomplete | None = ..., + shape: Incomplete | None = ..., + note: Incomplete | None = ..., + show_note_when_empty: Incomplete | None = ..., + axes: Incomplete | None = ..., + static_legend: Incomplete | None = ..., + x_column: Incomplete | None = ..., + generate_x_axis_ticks: Incomplete | None = ..., + x_total_ticks: Incomplete | None = ..., + x_tick_start: Incomplete | None = ..., + x_tick_step: Incomplete | None = ..., + y_column: Incomplete | None = ..., + generate_y_axis_ticks: Incomplete | None = ..., + y_total_ticks: Incomplete | None = ..., + y_tick_start: Incomplete | None = ..., + y_tick_step: Incomplete | None = ..., + shade_below: Incomplete | None = ..., + hover_dimension: Incomplete | None = ..., + position: Incomplete | None = ..., + geom: Incomplete | None = ..., + legend_colorize_rows: Incomplete | None = ..., + legend_hide: Incomplete | None = ..., + legend_opacity: Incomplete | None = ..., + legend_orientation_threshold: Incomplete | None = ..., + ) -> None: ... + @property + def time_format(self): ... + @time_format.setter + def time_format(self, time_format) -> None: ... + @property + def type(self): ... + @type.setter + def type(self, type) -> None: ... + @property + def queries(self): ... + @queries.setter + def queries(self, queries) -> None: ... + @property + def colors(self): ... + @colors.setter + def colors(self, colors) -> None: ... + @property + def color_mapping(self): ... + @color_mapping.setter + def color_mapping(self, color_mapping) -> None: ... + @property + def shape(self): ... + @shape.setter + def shape(self, shape) -> None: ... + @property + def note(self): ... + @note.setter + def note(self, note) -> None: ... + @property + def show_note_when_empty(self): ... + @show_note_when_empty.setter + def show_note_when_empty(self, show_note_when_empty) -> None: ... + @property + def axes(self): ... + @axes.setter + def axes(self, axes) -> None: ... + @property + def static_legend(self): ... + @static_legend.setter + def static_legend(self, static_legend) -> None: ... + @property + def x_column(self): ... + @x_column.setter + def x_column(self, x_column) -> None: ... + @property + def generate_x_axis_ticks(self): ... + @generate_x_axis_ticks.setter + def generate_x_axis_ticks(self, generate_x_axis_ticks) -> None: ... + @property + def x_total_ticks(self): ... + @x_total_ticks.setter + def x_total_ticks(self, x_total_ticks) -> None: ... + @property + def x_tick_start(self): ... + @x_tick_start.setter + def x_tick_start(self, x_tick_start) -> None: ... + @property + def x_tick_step(self): ... + @x_tick_step.setter + def x_tick_step(self, x_tick_step) -> None: ... + @property + def y_column(self): ... + @y_column.setter + def y_column(self, y_column) -> None: ... + @property + def generate_y_axis_ticks(self): ... + @generate_y_axis_ticks.setter + def generate_y_axis_ticks(self, generate_y_axis_ticks) -> None: ... + @property + def y_total_ticks(self): ... + @y_total_ticks.setter + def y_total_ticks(self, y_total_ticks) -> None: ... + @property + def y_tick_start(self): ... + @y_tick_start.setter + def y_tick_start(self, y_tick_start) -> None: ... + @property + def y_tick_step(self): ... + @y_tick_step.setter + def y_tick_step(self, y_tick_step) -> None: ... + @property + def shade_below(self): ... + @shade_below.setter + def shade_below(self, shade_below) -> None: ... + @property + def hover_dimension(self): ... + @hover_dimension.setter + def hover_dimension(self, hover_dimension) -> None: ... + @property + def position(self): ... + @position.setter + def position(self, position) -> None: ... + @property + def geom(self): ... + @geom.setter + def geom(self, geom) -> None: ... + @property + def legend_colorize_rows(self): ... + @legend_colorize_rows.setter + def legend_colorize_rows(self, legend_colorize_rows) -> None: ... + @property + def legend_hide(self): ... + @legend_hide.setter + def legend_hide(self, legend_hide) -> None: ... + @property + def legend_opacity(self): ... + @legend_opacity.setter + def legend_opacity(self, legend_opacity) -> None: ... + @property + def legend_orientation_threshold(self): ... + @legend_orientation_threshold.setter + def legend_orientation_threshold(self, legend_orientation_threshold) -> None: ... + def to_dict(self): ... + def to_str(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/extras.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/extras.pyi new file mode 100644 index 000000000..3cc4ea47d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/extras.pyi @@ -0,0 +1,4 @@ +from typing import Any + +np: Any # numpy module +pd: Any # pandas module diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/rest.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/rest.pyi new file mode 100644 index 000000000..b82f60689 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/rest.pyi @@ -0,0 +1,23 @@ +from _typeshed import Incomplete + +from influxdb_client.client.exceptions import InfluxDBError + +class ApiException(InfluxDBError): + status: Incomplete + reason: Incomplete + body: Incomplete + headers: Incomplete + def __init__( + self, status: Incomplete | None = ..., reason: Incomplete | None = ..., http_resp: Incomplete | None = ... + ) -> None: ... + +class _BaseRESTClient: + logger: Incomplete + @staticmethod + def log_request(method: str, url: str): ... + @staticmethod + def log_response(status: str): ... + @staticmethod + def log_body(body: object, prefix: str): ... + @staticmethod + def log_headers(headers: dict[str, str], prefix: str): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/__init__.pyi new file mode 100644 index 000000000..4285a8aa3 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/__init__.pyi @@ -0,0 +1,41 @@ +from influxdb_client.service.authorizations_service import AuthorizationsService as AuthorizationsService +from influxdb_client.service.backup_service import BackupService as BackupService +from influxdb_client.service.bucket_schemas_service import BucketSchemasService as BucketSchemasService +from influxdb_client.service.buckets_service import BucketsService as BucketsService +from influxdb_client.service.cells_service import CellsService as CellsService +from influxdb_client.service.checks_service import ChecksService as ChecksService +from influxdb_client.service.config_service import ConfigService as ConfigService +from influxdb_client.service.dashboards_service import DashboardsService as DashboardsService +from influxdb_client.service.dbr_ps_service import DBRPsService as DBRPsService +from influxdb_client.service.delete_service import DeleteService as DeleteService +from influxdb_client.service.health_service import HealthService as HealthService +from influxdb_client.service.invokable_scripts_service import InvokableScriptsService as InvokableScriptsService +from influxdb_client.service.labels_service import LabelsService as LabelsService +from influxdb_client.service.legacy_authorizations_service import LegacyAuthorizationsService as LegacyAuthorizationsService +from influxdb_client.service.metrics_service import MetricsService as MetricsService +from influxdb_client.service.notification_endpoints_service import NotificationEndpointsService as NotificationEndpointsService +from influxdb_client.service.notification_rules_service import NotificationRulesService as NotificationRulesService +from influxdb_client.service.organizations_service import OrganizationsService as OrganizationsService +from influxdb_client.service.ping_service import PingService as PingService +from influxdb_client.service.query_service import QueryService as QueryService +from influxdb_client.service.ready_service import ReadyService as ReadyService +from influxdb_client.service.remote_connections_service import RemoteConnectionsService as RemoteConnectionsService +from influxdb_client.service.replications_service import ReplicationsService as ReplicationsService +from influxdb_client.service.resources_service import ResourcesService as ResourcesService +from influxdb_client.service.restore_service import RestoreService as RestoreService +from influxdb_client.service.routes_service import RoutesService as RoutesService +from influxdb_client.service.rules_service import RulesService as RulesService +from influxdb_client.service.scraper_targets_service import ScraperTargetsService as ScraperTargetsService +from influxdb_client.service.secrets_service import SecretsService as SecretsService +from influxdb_client.service.setup_service import SetupService as SetupService +from influxdb_client.service.signin_service import SigninService as SigninService +from influxdb_client.service.signout_service import SignoutService as SignoutService +from influxdb_client.service.sources_service import SourcesService as SourcesService +from influxdb_client.service.tasks_service import TasksService as TasksService +from influxdb_client.service.telegraf_plugins_service import TelegrafPluginsService as TelegrafPluginsService +from influxdb_client.service.telegrafs_service import TelegrafsService as TelegrafsService +from influxdb_client.service.templates_service import TemplatesService as TemplatesService +from influxdb_client.service.users_service import UsersService as UsersService +from influxdb_client.service.variables_service import VariablesService as VariablesService +from influxdb_client.service.views_service import ViewsService as ViewsService +from influxdb_client.service.write_service import WriteService as WriteService diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/_base_service.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/_base_service.pyi new file mode 100644 index 000000000..dc2bed888 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/_base_service.pyi @@ -0,0 +1,8 @@ +from _typeshed import Incomplete + +class _BaseService: + api_client: Incomplete + def __init__(self, api_client: Incomplete | None = ...) -> None: ... + def build_type(self) -> str: ... + async def build_type_async(self) -> str: ... + def response_header(self, response, header_name: str = ...) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/authorizations_service.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/authorizations_service.pyi new file mode 100644 index 000000000..1cb3af2b0 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/authorizations_service.pyi @@ -0,0 +1,21 @@ +from _typeshed import Incomplete + +from influxdb_client.service._base_service import _BaseService + +class AuthorizationsService(_BaseService): + def __init__(self, api_client: Incomplete | None = ...) -> None: ... + def delete_authorizations_id(self, auth_id, **kwargs): ... + def delete_authorizations_id_with_http_info(self, auth_id, **kwargs): ... + async def delete_authorizations_id_async(self, auth_id, **kwargs): ... + def get_authorizations(self, **kwargs): ... + def get_authorizations_with_http_info(self, **kwargs): ... + async def get_authorizations_async(self, **kwargs): ... + def get_authorizations_id(self, auth_id, **kwargs): ... + def get_authorizations_id_with_http_info(self, auth_id, **kwargs): ... + async def get_authorizations_id_async(self, auth_id, **kwargs): ... + def patch_authorizations_id(self, auth_id, authorization_update_request, **kwargs): ... + def patch_authorizations_id_with_http_info(self, auth_id, authorization_update_request, **kwargs): ... + async def patch_authorizations_id_async(self, auth_id, authorization_update_request, **kwargs): ... + def post_authorizations(self, authorization_post_request, **kwargs): ... + def post_authorizations_with_http_info(self, authorization_post_request, **kwargs): ... + async def post_authorizations_async(self, authorization_post_request, **kwargs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/backup_service.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/backup_service.pyi new file mode 100644 index 000000000..96f89ced6 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/backup_service.pyi @@ -0,0 +1,15 @@ +from _typeshed import Incomplete + +from influxdb_client.service._base_service import _BaseService + +class BackupService(_BaseService): + def __init__(self, api_client: Incomplete | None = ...) -> None: ... + def get_backup_kv(self, **kwargs): ... + def get_backup_kv_with_http_info(self, **kwargs): ... + async def get_backup_kv_async(self, **kwargs): ... + def get_backup_metadata(self, **kwargs): ... + def get_backup_metadata_with_http_info(self, **kwargs): ... + async def get_backup_metadata_async(self, **kwargs): ... + def get_backup_shard_id(self, shard_id, **kwargs): ... + def get_backup_shard_id_with_http_info(self, shard_id, **kwargs): ... + async def get_backup_shard_id_async(self, shard_id, **kwargs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/bucket_schemas_service.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/bucket_schemas_service.pyi new file mode 100644 index 000000000..276cf48b5 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/bucket_schemas_service.pyi @@ -0,0 +1,20 @@ +from _typeshed import Incomplete + +from influxdb_client.service._base_service import _BaseService + +class BucketSchemasService(_BaseService): + def __init__(self, api_client: Incomplete | None = ...) -> None: ... + def create_measurement_schema(self, bucket_id, measurement_schema_create_request, **kwargs): ... + def create_measurement_schema_with_http_info(self, bucket_id, measurement_schema_create_request, **kwargs): ... + async def create_measurement_schema_async(self, bucket_id, measurement_schema_create_request, **kwargs): ... + def get_measurement_schema(self, bucket_id, measurement_id, **kwargs): ... + def get_measurement_schema_with_http_info(self, bucket_id, measurement_id, **kwargs): ... + async def get_measurement_schema_async(self, bucket_id, measurement_id, **kwargs): ... + def get_measurement_schemas(self, bucket_id, **kwargs): ... + def get_measurement_schemas_with_http_info(self, bucket_id, **kwargs): ... + async def get_measurement_schemas_async(self, bucket_id, **kwargs): ... + def update_measurement_schema(self, bucket_id, measurement_id, measurement_schema_update_request, **kwargs): ... + def update_measurement_schema_with_http_info( + self, bucket_id, measurement_id, measurement_schema_update_request, **kwargs + ): ... + async def update_measurement_schema_async(self, bucket_id, measurement_id, measurement_schema_update_request, **kwargs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/buckets_service.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/buckets_service.pyi new file mode 100644 index 000000000..9839754c8 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/buckets_service.pyi @@ -0,0 +1,51 @@ +from _typeshed import Incomplete + +from influxdb_client.service._base_service import _BaseService + +class BucketsService(_BaseService): + def __init__(self, api_client: Incomplete | None = ...) -> None: ... + def delete_buckets_id(self, bucket_id, **kwargs): ... + def delete_buckets_id_with_http_info(self, bucket_id, **kwargs): ... + async def delete_buckets_id_async(self, bucket_id, **kwargs): ... + def delete_buckets_id_labels_id(self, bucket_id, label_id, **kwargs): ... + def delete_buckets_id_labels_id_with_http_info(self, bucket_id, label_id, **kwargs): ... + async def delete_buckets_id_labels_id_async(self, bucket_id, label_id, **kwargs): ... + def delete_buckets_id_members_id(self, user_id, bucket_id, **kwargs): ... + def delete_buckets_id_members_id_with_http_info(self, user_id, bucket_id, **kwargs): ... + async def delete_buckets_id_members_id_async(self, user_id, bucket_id, **kwargs): ... + def delete_buckets_id_owners_id(self, user_id, bucket_id, **kwargs): ... + def delete_buckets_id_owners_id_with_http_info(self, user_id, bucket_id, **kwargs): ... + async def delete_buckets_id_owners_id_async(self, user_id, bucket_id, **kwargs): ... + def get_buckets(self, **kwargs): ... + def get_buckets_with_http_info(self, **kwargs): ... + async def get_buckets_async(self, **kwargs): ... + def get_buckets_id(self, bucket_id, **kwargs): ... + def get_buckets_id_with_http_info(self, bucket_id, **kwargs): ... + async def get_buckets_id_async(self, bucket_id, **kwargs): ... + def get_buckets_id_labels(self, bucket_id, **kwargs): ... + def get_buckets_id_labels_with_http_info(self, bucket_id, **kwargs): ... + async def get_buckets_id_labels_async(self, bucket_id, **kwargs): ... + def get_buckets_id_members(self, bucket_id, **kwargs): ... + def get_buckets_id_members_with_http_info(self, bucket_id, **kwargs): ... + async def get_buckets_id_members_async(self, bucket_id, **kwargs): ... + def get_buckets_id_owners(self, bucket_id, **kwargs): ... + def get_buckets_id_owners_with_http_info(self, bucket_id, **kwargs): ... + async def get_buckets_id_owners_async(self, bucket_id, **kwargs): ... + def get_sources_id_buckets(self, source_id, **kwargs): ... + def get_sources_id_buckets_with_http_info(self, source_id, **kwargs): ... + async def get_sources_id_buckets_async(self, source_id, **kwargs): ... + def patch_buckets_id(self, bucket_id, patch_bucket_request, **kwargs): ... + def patch_buckets_id_with_http_info(self, bucket_id, patch_bucket_request, **kwargs): ... + async def patch_buckets_id_async(self, bucket_id, patch_bucket_request, **kwargs): ... + def post_buckets(self, post_bucket_request, **kwargs): ... + def post_buckets_with_http_info(self, post_bucket_request, **kwargs): ... + async def post_buckets_async(self, post_bucket_request, **kwargs): ... + def post_buckets_id_labels(self, bucket_id, label_mapping, **kwargs): ... + def post_buckets_id_labels_with_http_info(self, bucket_id, label_mapping, **kwargs): ... + async def post_buckets_id_labels_async(self, bucket_id, label_mapping, **kwargs): ... + def post_buckets_id_members(self, bucket_id, add_resource_member_request_body, **kwargs): ... + def post_buckets_id_members_with_http_info(self, bucket_id, add_resource_member_request_body, **kwargs): ... + async def post_buckets_id_members_async(self, bucket_id, add_resource_member_request_body, **kwargs): ... + def post_buckets_id_owners(self, bucket_id, add_resource_member_request_body, **kwargs): ... + def post_buckets_id_owners_with_http_info(self, bucket_id, add_resource_member_request_body, **kwargs): ... + async def post_buckets_id_owners_async(self, bucket_id, add_resource_member_request_body, **kwargs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/cells_service.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/cells_service.pyi new file mode 100644 index 000000000..4135ddc01 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/cells_service.pyi @@ -0,0 +1,24 @@ +from _typeshed import Incomplete + +from influxdb_client.service._base_service import _BaseService + +class CellsService(_BaseService): + def __init__(self, api_client: Incomplete | None = ...) -> None: ... + def delete_dashboards_id_cells_id(self, dashboard_id, cell_id, **kwargs): ... + def delete_dashboards_id_cells_id_with_http_info(self, dashboard_id, cell_id, **kwargs): ... + async def delete_dashboards_id_cells_id_async(self, dashboard_id, cell_id, **kwargs): ... + def get_dashboards_id_cells_id_view(self, dashboard_id, cell_id, **kwargs): ... + def get_dashboards_id_cells_id_view_with_http_info(self, dashboard_id, cell_id, **kwargs): ... + async def get_dashboards_id_cells_id_view_async(self, dashboard_id, cell_id, **kwargs): ... + def patch_dashboards_id_cells_id(self, dashboard_id, cell_id, cell_update, **kwargs): ... + def patch_dashboards_id_cells_id_with_http_info(self, dashboard_id, cell_id, cell_update, **kwargs): ... + async def patch_dashboards_id_cells_id_async(self, dashboard_id, cell_id, cell_update, **kwargs): ... + def patch_dashboards_id_cells_id_view(self, dashboard_id, cell_id, view, **kwargs): ... + def patch_dashboards_id_cells_id_view_with_http_info(self, dashboard_id, cell_id, view, **kwargs): ... + async def patch_dashboards_id_cells_id_view_async(self, dashboard_id, cell_id, view, **kwargs): ... + def post_dashboards_id_cells(self, dashboard_id, create_cell, **kwargs): ... + def post_dashboards_id_cells_with_http_info(self, dashboard_id, create_cell, **kwargs): ... + async def post_dashboards_id_cells_async(self, dashboard_id, create_cell, **kwargs): ... + def put_dashboards_id_cells(self, dashboard_id, cell, **kwargs): ... + def put_dashboards_id_cells_with_http_info(self, dashboard_id, cell, **kwargs): ... + async def put_dashboards_id_cells_async(self, dashboard_id, cell, **kwargs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/checks_service.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/checks_service.pyi new file mode 100644 index 000000000..fd840989e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/checks_service.pyi @@ -0,0 +1,36 @@ +from _typeshed import Incomplete + +from influxdb_client.service._base_service import _BaseService + +class ChecksService(_BaseService): + def __init__(self, api_client: Incomplete | None = ...) -> None: ... + def create_check(self, post_check, **kwargs): ... + def create_check_with_http_info(self, post_check, **kwargs): ... + async def create_check_async(self, post_check, **kwargs): ... + def delete_checks_id(self, check_id, **kwargs): ... + def delete_checks_id_with_http_info(self, check_id, **kwargs): ... + async def delete_checks_id_async(self, check_id, **kwargs): ... + def delete_checks_id_labels_id(self, check_id, label_id, **kwargs): ... + def delete_checks_id_labels_id_with_http_info(self, check_id, label_id, **kwargs): ... + async def delete_checks_id_labels_id_async(self, check_id, label_id, **kwargs): ... + def get_checks(self, org_id, **kwargs): ... + def get_checks_with_http_info(self, org_id, **kwargs): ... + async def get_checks_async(self, org_id, **kwargs): ... + def get_checks_id(self, check_id, **kwargs): ... + def get_checks_id_with_http_info(self, check_id, **kwargs): ... + async def get_checks_id_async(self, check_id, **kwargs): ... + def get_checks_id_labels(self, check_id, **kwargs): ... + def get_checks_id_labels_with_http_info(self, check_id, **kwargs): ... + async def get_checks_id_labels_async(self, check_id, **kwargs): ... + def get_checks_id_query(self, check_id, **kwargs): ... + def get_checks_id_query_with_http_info(self, check_id, **kwargs): ... + async def get_checks_id_query_async(self, check_id, **kwargs): ... + def patch_checks_id(self, check_id, check_patch, **kwargs): ... + def patch_checks_id_with_http_info(self, check_id, check_patch, **kwargs): ... + async def patch_checks_id_async(self, check_id, check_patch, **kwargs): ... + def post_checks_id_labels(self, check_id, label_mapping, **kwargs): ... + def post_checks_id_labels_with_http_info(self, check_id, label_mapping, **kwargs): ... + async def post_checks_id_labels_async(self, check_id, label_mapping, **kwargs): ... + def put_checks_id(self, check_id, check, **kwargs): ... + def put_checks_id_with_http_info(self, check_id, check, **kwargs): ... + async def put_checks_id_async(self, check_id, check, **kwargs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/config_service.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/config_service.pyi new file mode 100644 index 000000000..89aca6557 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/config_service.pyi @@ -0,0 +1,9 @@ +from _typeshed import Incomplete + +from influxdb_client.service._base_service import _BaseService + +class ConfigService(_BaseService): + def __init__(self, api_client: Incomplete | None = ...) -> None: ... + def get_config(self, **kwargs): ... + def get_config_with_http_info(self, **kwargs): ... + async def get_config_async(self, **kwargs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/dashboards_service.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/dashboards_service.pyi new file mode 100644 index 000000000..507d94389 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/dashboards_service.pyi @@ -0,0 +1,66 @@ +from _typeshed import Incomplete + +from influxdb_client.service._base_service import _BaseService + +class DashboardsService(_BaseService): + def __init__(self, api_client: Incomplete | None = ...) -> None: ... + def delete_dashboards_id(self, dashboard_id, **kwargs): ... + def delete_dashboards_id_with_http_info(self, dashboard_id, **kwargs): ... + async def delete_dashboards_id_async(self, dashboard_id, **kwargs): ... + def delete_dashboards_id_cells_id(self, dashboard_id, cell_id, **kwargs): ... + def delete_dashboards_id_cells_id_with_http_info(self, dashboard_id, cell_id, **kwargs): ... + async def delete_dashboards_id_cells_id_async(self, dashboard_id, cell_id, **kwargs): ... + def delete_dashboards_id_labels_id(self, dashboard_id, label_id, **kwargs): ... + def delete_dashboards_id_labels_id_with_http_info(self, dashboard_id, label_id, **kwargs): ... + async def delete_dashboards_id_labels_id_async(self, dashboard_id, label_id, **kwargs): ... + def delete_dashboards_id_members_id(self, user_id, dashboard_id, **kwargs): ... + def delete_dashboards_id_members_id_with_http_info(self, user_id, dashboard_id, **kwargs): ... + async def delete_dashboards_id_members_id_async(self, user_id, dashboard_id, **kwargs): ... + def delete_dashboards_id_owners_id(self, user_id, dashboard_id, **kwargs): ... + def delete_dashboards_id_owners_id_with_http_info(self, user_id, dashboard_id, **kwargs): ... + async def delete_dashboards_id_owners_id_async(self, user_id, dashboard_id, **kwargs): ... + def get_dashboards(self, **kwargs): ... + def get_dashboards_with_http_info(self, **kwargs): ... + async def get_dashboards_async(self, **kwargs): ... + def get_dashboards_id(self, dashboard_id, **kwargs): ... + def get_dashboards_id_with_http_info(self, dashboard_id, **kwargs): ... + async def get_dashboards_id_async(self, dashboard_id, **kwargs): ... + def get_dashboards_id_cells_id_view(self, dashboard_id, cell_id, **kwargs): ... + def get_dashboards_id_cells_id_view_with_http_info(self, dashboard_id, cell_id, **kwargs): ... + async def get_dashboards_id_cells_id_view_async(self, dashboard_id, cell_id, **kwargs): ... + def get_dashboards_id_labels(self, dashboard_id, **kwargs): ... + def get_dashboards_id_labels_with_http_info(self, dashboard_id, **kwargs): ... + async def get_dashboards_id_labels_async(self, dashboard_id, **kwargs): ... + def get_dashboards_id_members(self, dashboard_id, **kwargs): ... + def get_dashboards_id_members_with_http_info(self, dashboard_id, **kwargs): ... + async def get_dashboards_id_members_async(self, dashboard_id, **kwargs): ... + def get_dashboards_id_owners(self, dashboard_id, **kwargs): ... + def get_dashboards_id_owners_with_http_info(self, dashboard_id, **kwargs): ... + async def get_dashboards_id_owners_async(self, dashboard_id, **kwargs): ... + def patch_dashboards_id(self, dashboard_id, **kwargs): ... + def patch_dashboards_id_with_http_info(self, dashboard_id, **kwargs): ... + async def patch_dashboards_id_async(self, dashboard_id, **kwargs): ... + def patch_dashboards_id_cells_id(self, dashboard_id, cell_id, cell_update, **kwargs): ... + def patch_dashboards_id_cells_id_with_http_info(self, dashboard_id, cell_id, cell_update, **kwargs): ... + async def patch_dashboards_id_cells_id_async(self, dashboard_id, cell_id, cell_update, **kwargs): ... + def patch_dashboards_id_cells_id_view(self, dashboard_id, cell_id, view, **kwargs): ... + def patch_dashboards_id_cells_id_view_with_http_info(self, dashboard_id, cell_id, view, **kwargs): ... + async def patch_dashboards_id_cells_id_view_async(self, dashboard_id, cell_id, view, **kwargs): ... + def post_dashboards(self, create_dashboard_request, **kwargs): ... + def post_dashboards_with_http_info(self, create_dashboard_request, **kwargs): ... + async def post_dashboards_async(self, create_dashboard_request, **kwargs): ... + def post_dashboards_id_cells(self, dashboard_id, create_cell, **kwargs): ... + def post_dashboards_id_cells_with_http_info(self, dashboard_id, create_cell, **kwargs): ... + async def post_dashboards_id_cells_async(self, dashboard_id, create_cell, **kwargs): ... + def post_dashboards_id_labels(self, dashboard_id, label_mapping, **kwargs): ... + def post_dashboards_id_labels_with_http_info(self, dashboard_id, label_mapping, **kwargs): ... + async def post_dashboards_id_labels_async(self, dashboard_id, label_mapping, **kwargs): ... + def post_dashboards_id_members(self, dashboard_id, add_resource_member_request_body, **kwargs): ... + def post_dashboards_id_members_with_http_info(self, dashboard_id, add_resource_member_request_body, **kwargs): ... + async def post_dashboards_id_members_async(self, dashboard_id, add_resource_member_request_body, **kwargs): ... + def post_dashboards_id_owners(self, dashboard_id, add_resource_member_request_body, **kwargs): ... + def post_dashboards_id_owners_with_http_info(self, dashboard_id, add_resource_member_request_body, **kwargs): ... + async def post_dashboards_id_owners_async(self, dashboard_id, add_resource_member_request_body, **kwargs): ... + def put_dashboards_id_cells(self, dashboard_id, cell, **kwargs): ... + def put_dashboards_id_cells_with_http_info(self, dashboard_id, cell, **kwargs): ... + async def put_dashboards_id_cells_async(self, dashboard_id, cell, **kwargs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/dbr_ps_service.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/dbr_ps_service.pyi new file mode 100644 index 000000000..00b189b6b --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/dbr_ps_service.pyi @@ -0,0 +1,21 @@ +from _typeshed import Incomplete + +from influxdb_client.service._base_service import _BaseService + +class DBRPsService(_BaseService): + def __init__(self, api_client: Incomplete | None = ...) -> None: ... + def delete_dbrpid(self, dbrp_id, **kwargs): ... + def delete_dbrpid_with_http_info(self, dbrp_id, **kwargs): ... + async def delete_dbrpid_async(self, dbrp_id, **kwargs): ... + def get_dbr_ps(self, **kwargs): ... + def get_dbr_ps_with_http_info(self, **kwargs): ... + async def get_dbr_ps_async(self, **kwargs): ... + def get_dbr_ps_id(self, dbrp_id, **kwargs): ... + def get_dbr_ps_id_with_http_info(self, dbrp_id, **kwargs): ... + async def get_dbr_ps_id_async(self, dbrp_id, **kwargs): ... + def patch_dbrpid(self, dbrp_id, dbrp_update, **kwargs): ... + def patch_dbrpid_with_http_info(self, dbrp_id, dbrp_update, **kwargs): ... + async def patch_dbrpid_async(self, dbrp_id, dbrp_update, **kwargs): ... + def post_dbrp(self, dbrp_create, **kwargs): ... + def post_dbrp_with_http_info(self, dbrp_create, **kwargs): ... + async def post_dbrp_async(self, dbrp_create, **kwargs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/delete_service.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/delete_service.pyi new file mode 100644 index 000000000..50407915e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/delete_service.pyi @@ -0,0 +1,9 @@ +from _typeshed import Incomplete + +from influxdb_client.service._base_service import _BaseService + +class DeleteService(_BaseService): + def __init__(self, api_client: Incomplete | None = ...) -> None: ... + def post_delete(self, delete_predicate_request, **kwargs): ... + def post_delete_with_http_info(self, delete_predicate_request, **kwargs): ... + async def post_delete_async(self, delete_predicate_request, **kwargs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/health_service.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/health_service.pyi new file mode 100644 index 000000000..0ade64f9f --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/health_service.pyi @@ -0,0 +1,9 @@ +from _typeshed import Incomplete + +from influxdb_client.service._base_service import _BaseService + +class HealthService(_BaseService): + def __init__(self, api_client: Incomplete | None = ...) -> None: ... + def get_health(self, **kwargs): ... + def get_health_with_http_info(self, **kwargs): ... + async def get_health_async(self, **kwargs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/invokable_scripts_service.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/invokable_scripts_service.pyi new file mode 100644 index 000000000..c5f0e227a --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/invokable_scripts_service.pyi @@ -0,0 +1,24 @@ +from _typeshed import Incomplete + +from influxdb_client.service._base_service import _BaseService + +class InvokableScriptsService(_BaseService): + def __init__(self, api_client: Incomplete | None = ...) -> None: ... + def delete_scripts_id(self, script_id, **kwargs): ... + def delete_scripts_id_with_http_info(self, script_id, **kwargs): ... + async def delete_scripts_id_async(self, script_id, **kwargs): ... + def get_scripts(self, **kwargs): ... + def get_scripts_with_http_info(self, **kwargs): ... + async def get_scripts_async(self, **kwargs): ... + def get_scripts_id(self, script_id, **kwargs): ... + def get_scripts_id_with_http_info(self, script_id, **kwargs): ... + async def get_scripts_id_async(self, script_id, **kwargs): ... + def patch_scripts_id(self, script_id, script_update_request, **kwargs): ... + def patch_scripts_id_with_http_info(self, script_id, script_update_request, **kwargs): ... + async def patch_scripts_id_async(self, script_id, script_update_request, **kwargs): ... + def post_scripts(self, script_create_request, **kwargs): ... + def post_scripts_with_http_info(self, script_create_request, **kwargs): ... + async def post_scripts_async(self, script_create_request, **kwargs): ... + def post_scripts_id_invoke(self, script_id, **kwargs): ... + def post_scripts_id_invoke_with_http_info(self, script_id, **kwargs): ... + async def post_scripts_id_invoke_async(self, script_id, **kwargs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/labels_service.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/labels_service.pyi new file mode 100644 index 000000000..63e974f5d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/labels_service.pyi @@ -0,0 +1,21 @@ +from _typeshed import Incomplete + +from influxdb_client.service._base_service import _BaseService + +class LabelsService(_BaseService): + def __init__(self, api_client: Incomplete | None = ...) -> None: ... + def delete_labels_id(self, label_id, **kwargs): ... + def delete_labels_id_with_http_info(self, label_id, **kwargs): ... + async def delete_labels_id_async(self, label_id, **kwargs): ... + def get_labels(self, **kwargs): ... + def get_labels_with_http_info(self, **kwargs): ... + async def get_labels_async(self, **kwargs): ... + def get_labels_id(self, label_id, **kwargs): ... + def get_labels_id_with_http_info(self, label_id, **kwargs): ... + async def get_labels_id_async(self, label_id, **kwargs): ... + def patch_labels_id(self, label_id, label_update, **kwargs): ... + def patch_labels_id_with_http_info(self, label_id, label_update, **kwargs): ... + async def patch_labels_id_async(self, label_id, label_update, **kwargs): ... + def post_labels(self, label_create_request, **kwargs): ... + def post_labels_with_http_info(self, label_create_request, **kwargs): ... + async def post_labels_async(self, label_create_request, **kwargs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/legacy_authorizations_service.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/legacy_authorizations_service.pyi new file mode 100644 index 000000000..fbec0e374 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/legacy_authorizations_service.pyi @@ -0,0 +1,24 @@ +from _typeshed import Incomplete + +from influxdb_client.service._base_service import _BaseService + +class LegacyAuthorizationsService(_BaseService): + def __init__(self, api_client: Incomplete | None = ...) -> None: ... + def delete_legacy_authorizations_id(self, auth_id, **kwargs): ... + def delete_legacy_authorizations_id_with_http_info(self, auth_id, **kwargs): ... + async def delete_legacy_authorizations_id_async(self, auth_id, **kwargs): ... + def get_legacy_authorizations(self, **kwargs): ... + def get_legacy_authorizations_with_http_info(self, **kwargs): ... + async def get_legacy_authorizations_async(self, **kwargs): ... + def get_legacy_authorizations_id(self, auth_id, **kwargs): ... + def get_legacy_authorizations_id_with_http_info(self, auth_id, **kwargs): ... + async def get_legacy_authorizations_id_async(self, auth_id, **kwargs): ... + def patch_legacy_authorizations_id(self, auth_id, authorization_update_request, **kwargs): ... + def patch_legacy_authorizations_id_with_http_info(self, auth_id, authorization_update_request, **kwargs): ... + async def patch_legacy_authorizations_id_async(self, auth_id, authorization_update_request, **kwargs): ... + def post_legacy_authorizations(self, legacy_authorization_post_request, **kwargs): ... + def post_legacy_authorizations_with_http_info(self, legacy_authorization_post_request, **kwargs): ... + async def post_legacy_authorizations_async(self, legacy_authorization_post_request, **kwargs): ... + def post_legacy_authorizations_id_password(self, auth_id, password_reset_body, **kwargs): ... + def post_legacy_authorizations_id_password_with_http_info(self, auth_id, password_reset_body, **kwargs): ... + async def post_legacy_authorizations_id_password_async(self, auth_id, password_reset_body, **kwargs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/metrics_service.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/metrics_service.pyi new file mode 100644 index 000000000..8194e55c9 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/metrics_service.pyi @@ -0,0 +1,9 @@ +from _typeshed import Incomplete + +from influxdb_client.service._base_service import _BaseService + +class MetricsService(_BaseService): + def __init__(self, api_client: Incomplete | None = ...) -> None: ... + def get_metrics(self, **kwargs): ... + def get_metrics_with_http_info(self, **kwargs): ... + async def get_metrics_async(self, **kwargs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/notification_endpoints_service.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/notification_endpoints_service.pyi new file mode 100644 index 000000000..35286fe1d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/notification_endpoints_service.pyi @@ -0,0 +1,33 @@ +from _typeshed import Incomplete + +from influxdb_client.service._base_service import _BaseService + +class NotificationEndpointsService(_BaseService): + def __init__(self, api_client: Incomplete | None = ...) -> None: ... + def create_notification_endpoint(self, post_notification_endpoint, **kwargs): ... + def create_notification_endpoint_with_http_info(self, post_notification_endpoint, **kwargs): ... + async def create_notification_endpoint_async(self, post_notification_endpoint, **kwargs): ... + def delete_notification_endpoints_id(self, endpoint_id, **kwargs): ... + def delete_notification_endpoints_id_with_http_info(self, endpoint_id, **kwargs): ... + async def delete_notification_endpoints_id_async(self, endpoint_id, **kwargs): ... + def delete_notification_endpoints_id_labels_id(self, endpoint_id, label_id, **kwargs): ... + def delete_notification_endpoints_id_labels_id_with_http_info(self, endpoint_id, label_id, **kwargs): ... + async def delete_notification_endpoints_id_labels_id_async(self, endpoint_id, label_id, **kwargs): ... + def get_notification_endpoints(self, org_id, **kwargs): ... + def get_notification_endpoints_with_http_info(self, org_id, **kwargs): ... + async def get_notification_endpoints_async(self, org_id, **kwargs): ... + def get_notification_endpoints_id(self, endpoint_id, **kwargs): ... + def get_notification_endpoints_id_with_http_info(self, endpoint_id, **kwargs): ... + async def get_notification_endpoints_id_async(self, endpoint_id, **kwargs): ... + def get_notification_endpoints_id_labels(self, endpoint_id, **kwargs): ... + def get_notification_endpoints_id_labels_with_http_info(self, endpoint_id, **kwargs): ... + async def get_notification_endpoints_id_labels_async(self, endpoint_id, **kwargs): ... + def patch_notification_endpoints_id(self, endpoint_id, notification_endpoint_update, **kwargs): ... + def patch_notification_endpoints_id_with_http_info(self, endpoint_id, notification_endpoint_update, **kwargs): ... + async def patch_notification_endpoints_id_async(self, endpoint_id, notification_endpoint_update, **kwargs): ... + def post_notification_endpoint_id_labels(self, endpoint_id, label_mapping, **kwargs): ... + def post_notification_endpoint_id_labels_with_http_info(self, endpoint_id, label_mapping, **kwargs): ... + async def post_notification_endpoint_id_labels_async(self, endpoint_id, label_mapping, **kwargs): ... + def put_notification_endpoints_id(self, endpoint_id, notification_endpoint, **kwargs): ... + def put_notification_endpoints_id_with_http_info(self, endpoint_id, notification_endpoint, **kwargs): ... + async def put_notification_endpoints_id_async(self, endpoint_id, notification_endpoint, **kwargs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/notification_rules_service.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/notification_rules_service.pyi new file mode 100644 index 000000000..2a449e3f4 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/notification_rules_service.pyi @@ -0,0 +1,33 @@ +from _typeshed import Incomplete + +from influxdb_client.service._base_service import _BaseService + +class NotificationRulesService(_BaseService): + def __init__(self, api_client: Incomplete | None = ...) -> None: ... + def create_notification_rule(self, post_notification_rule, **kwargs): ... + def create_notification_rule_with_http_info(self, post_notification_rule, **kwargs): ... + async def create_notification_rule_async(self, post_notification_rule, **kwargs): ... + def delete_notification_rules_id(self, rule_id, **kwargs): ... + def delete_notification_rules_id_with_http_info(self, rule_id, **kwargs): ... + async def delete_notification_rules_id_async(self, rule_id, **kwargs): ... + def delete_notification_rules_id_labels_id(self, rule_id, label_id, **kwargs): ... + def delete_notification_rules_id_labels_id_with_http_info(self, rule_id, label_id, **kwargs): ... + async def delete_notification_rules_id_labels_id_async(self, rule_id, label_id, **kwargs): ... + def get_notification_rules(self, org_id, **kwargs): ... + def get_notification_rules_with_http_info(self, org_id, **kwargs): ... + async def get_notification_rules_async(self, org_id, **kwargs): ... + def get_notification_rules_id(self, rule_id, **kwargs): ... + def get_notification_rules_id_with_http_info(self, rule_id, **kwargs): ... + async def get_notification_rules_id_async(self, rule_id, **kwargs): ... + def get_notification_rules_id_labels(self, rule_id, **kwargs): ... + def get_notification_rules_id_labels_with_http_info(self, rule_id, **kwargs): ... + async def get_notification_rules_id_labels_async(self, rule_id, **kwargs): ... + def patch_notification_rules_id(self, rule_id, notification_rule_update, **kwargs): ... + def patch_notification_rules_id_with_http_info(self, rule_id, notification_rule_update, **kwargs): ... + async def patch_notification_rules_id_async(self, rule_id, notification_rule_update, **kwargs): ... + def post_notification_rule_id_labels(self, rule_id, label_mapping, **kwargs): ... + def post_notification_rule_id_labels_with_http_info(self, rule_id, label_mapping, **kwargs): ... + async def post_notification_rule_id_labels_async(self, rule_id, label_mapping, **kwargs): ... + def put_notification_rules_id(self, rule_id, notification_rule, **kwargs): ... + def put_notification_rules_id_with_http_info(self, rule_id, notification_rule, **kwargs): ... + async def put_notification_rules_id_async(self, rule_id, notification_rule, **kwargs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/organizations_service.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/organizations_service.pyi new file mode 100644 index 000000000..26b75e289 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/organizations_service.pyi @@ -0,0 +1,39 @@ +from _typeshed import Incomplete + +from influxdb_client.service._base_service import _BaseService + +class OrganizationsService(_BaseService): + def __init__(self, api_client: Incomplete | None = ...) -> None: ... + def delete_orgs_id(self, org_id, **kwargs): ... + def delete_orgs_id_with_http_info(self, org_id, **kwargs): ... + async def delete_orgs_id_async(self, org_id, **kwargs): ... + def delete_orgs_id_members_id(self, user_id, org_id, **kwargs): ... + def delete_orgs_id_members_id_with_http_info(self, user_id, org_id, **kwargs): ... + async def delete_orgs_id_members_id_async(self, user_id, org_id, **kwargs): ... + def delete_orgs_id_owners_id(self, user_id, org_id, **kwargs): ... + def delete_orgs_id_owners_id_with_http_info(self, user_id, org_id, **kwargs): ... + async def delete_orgs_id_owners_id_async(self, user_id, org_id, **kwargs): ... + def get_orgs(self, **kwargs): ... + def get_orgs_with_http_info(self, **kwargs): ... + async def get_orgs_async(self, **kwargs): ... + def get_orgs_id(self, org_id, **kwargs): ... + def get_orgs_id_with_http_info(self, org_id, **kwargs): ... + async def get_orgs_id_async(self, org_id, **kwargs): ... + def get_orgs_id_members(self, org_id, **kwargs): ... + def get_orgs_id_members_with_http_info(self, org_id, **kwargs): ... + async def get_orgs_id_members_async(self, org_id, **kwargs): ... + def get_orgs_id_owners(self, org_id, **kwargs): ... + def get_orgs_id_owners_with_http_info(self, org_id, **kwargs): ... + async def get_orgs_id_owners_async(self, org_id, **kwargs): ... + def patch_orgs_id(self, org_id, patch_organization_request, **kwargs): ... + def patch_orgs_id_with_http_info(self, org_id, patch_organization_request, **kwargs): ... + async def patch_orgs_id_async(self, org_id, patch_organization_request, **kwargs): ... + def post_orgs(self, post_organization_request, **kwargs): ... + def post_orgs_with_http_info(self, post_organization_request, **kwargs): ... + async def post_orgs_async(self, post_organization_request, **kwargs): ... + def post_orgs_id_members(self, org_id, add_resource_member_request_body, **kwargs): ... + def post_orgs_id_members_with_http_info(self, org_id, add_resource_member_request_body, **kwargs): ... + async def post_orgs_id_members_async(self, org_id, add_resource_member_request_body, **kwargs): ... + def post_orgs_id_owners(self, org_id, add_resource_member_request_body, **kwargs): ... + def post_orgs_id_owners_with_http_info(self, org_id, add_resource_member_request_body, **kwargs): ... + async def post_orgs_id_owners_async(self, org_id, add_resource_member_request_body, **kwargs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/ping_service.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/ping_service.pyi new file mode 100644 index 000000000..fd1b5bfa8 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/ping_service.pyi @@ -0,0 +1,12 @@ +from _typeshed import Incomplete + +from influxdb_client.service._base_service import _BaseService + +class PingService(_BaseService): + def __init__(self, api_client: Incomplete | None = ...) -> None: ... + def get_ping(self, **kwargs): ... + def get_ping_with_http_info(self, **kwargs): ... + async def get_ping_async(self, **kwargs): ... + def head_ping(self, **kwargs): ... + def head_ping_with_http_info(self, **kwargs): ... + async def head_ping_async(self, **kwargs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/query_service.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/query_service.pyi new file mode 100644 index 000000000..409d0070b --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/query_service.pyi @@ -0,0 +1,21 @@ +from _typeshed import Incomplete + +from influxdb_client.service._base_service import _BaseService + +class QueryService(_BaseService): + def __init__(self, api_client: Incomplete | None = ...) -> None: ... + def get_query_suggestions(self, **kwargs): ... + def get_query_suggestions_with_http_info(self, **kwargs): ... + async def get_query_suggestions_async(self, **kwargs): ... + def get_query_suggestions_name(self, name, **kwargs): ... + def get_query_suggestions_name_with_http_info(self, name, **kwargs): ... + async def get_query_suggestions_name_async(self, name, **kwargs): ... + def post_query(self, **kwargs): ... + def post_query_with_http_info(self, **kwargs): ... + async def post_query_async(self, **kwargs): ... + def post_query_analyze(self, **kwargs): ... + def post_query_analyze_with_http_info(self, **kwargs): ... + async def post_query_analyze_async(self, **kwargs): ... + def post_query_ast(self, **kwargs): ... + def post_query_ast_with_http_info(self, **kwargs): ... + async def post_query_ast_async(self, **kwargs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/ready_service.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/ready_service.pyi new file mode 100644 index 000000000..ff3e13dac --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/ready_service.pyi @@ -0,0 +1,9 @@ +from _typeshed import Incomplete + +from influxdb_client.service._base_service import _BaseService + +class ReadyService(_BaseService): + def __init__(self, api_client: Incomplete | None = ...) -> None: ... + def get_ready(self, **kwargs): ... + def get_ready_with_http_info(self, **kwargs): ... + async def get_ready_async(self, **kwargs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/remote_connections_service.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/remote_connections_service.pyi new file mode 100644 index 000000000..1bfede4c8 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/remote_connections_service.pyi @@ -0,0 +1,21 @@ +from _typeshed import Incomplete + +from influxdb_client.service._base_service import _BaseService + +class RemoteConnectionsService(_BaseService): + def __init__(self, api_client: Incomplete | None = ...) -> None: ... + def delete_remote_connection_by_id(self, remote_id, **kwargs): ... + def delete_remote_connection_by_id_with_http_info(self, remote_id, **kwargs): ... + async def delete_remote_connection_by_id_async(self, remote_id, **kwargs): ... + def get_remote_connection_by_id(self, remote_id, **kwargs): ... + def get_remote_connection_by_id_with_http_info(self, remote_id, **kwargs): ... + async def get_remote_connection_by_id_async(self, remote_id, **kwargs): ... + def get_remote_connections(self, org_id, **kwargs): ... + def get_remote_connections_with_http_info(self, org_id, **kwargs): ... + async def get_remote_connections_async(self, org_id, **kwargs): ... + def patch_remote_connection_by_id(self, remote_id, remote_connection_update_request, **kwargs): ... + def patch_remote_connection_by_id_with_http_info(self, remote_id, remote_connection_update_request, **kwargs): ... + async def patch_remote_connection_by_id_async(self, remote_id, remote_connection_update_request, **kwargs): ... + def post_remote_connection(self, remote_connection_creation_request, **kwargs): ... + def post_remote_connection_with_http_info(self, remote_connection_creation_request, **kwargs): ... + async def post_remote_connection_async(self, remote_connection_creation_request, **kwargs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/replications_service.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/replications_service.pyi new file mode 100644 index 000000000..96e1056f0 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/replications_service.pyi @@ -0,0 +1,24 @@ +from _typeshed import Incomplete + +from influxdb_client.service._base_service import _BaseService + +class ReplicationsService(_BaseService): + def __init__(self, api_client: Incomplete | None = ...) -> None: ... + def delete_replication_by_id(self, replication_id, **kwargs): ... + def delete_replication_by_id_with_http_info(self, replication_id, **kwargs): ... + async def delete_replication_by_id_async(self, replication_id, **kwargs): ... + def get_replication_by_id(self, replication_id, **kwargs): ... + def get_replication_by_id_with_http_info(self, replication_id, **kwargs): ... + async def get_replication_by_id_async(self, replication_id, **kwargs): ... + def get_replications(self, org_id, **kwargs): ... + def get_replications_with_http_info(self, org_id, **kwargs): ... + async def get_replications_async(self, org_id, **kwargs): ... + def patch_replication_by_id(self, replication_id, replication_update_request, **kwargs): ... + def patch_replication_by_id_with_http_info(self, replication_id, replication_update_request, **kwargs): ... + async def patch_replication_by_id_async(self, replication_id, replication_update_request, **kwargs): ... + def post_replication(self, replication_creation_request, **kwargs): ... + def post_replication_with_http_info(self, replication_creation_request, **kwargs): ... + async def post_replication_async(self, replication_creation_request, **kwargs): ... + def post_validate_replication_by_id(self, replication_id, **kwargs): ... + def post_validate_replication_by_id_with_http_info(self, replication_id, **kwargs): ... + async def post_validate_replication_by_id_async(self, replication_id, **kwargs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/resources_service.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/resources_service.pyi new file mode 100644 index 000000000..c5894161d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/resources_service.pyi @@ -0,0 +1,9 @@ +from _typeshed import Incomplete + +from influxdb_client.service._base_service import _BaseService + +class ResourcesService(_BaseService): + def __init__(self, api_client: Incomplete | None = ...) -> None: ... + def get_resources(self, **kwargs): ... + def get_resources_with_http_info(self, **kwargs): ... + async def get_resources_async(self, **kwargs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/restore_service.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/restore_service.pyi new file mode 100644 index 000000000..c826e5a4a --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/restore_service.pyi @@ -0,0 +1,21 @@ +from _typeshed import Incomplete + +from influxdb_client.service._base_service import _BaseService + +class RestoreService(_BaseService): + def __init__(self, api_client: Incomplete | None = ...) -> None: ... + def post_restore_bucket_id(self, bucket_id, body, **kwargs): ... + def post_restore_bucket_id_with_http_info(self, bucket_id, body, **kwargs): ... + async def post_restore_bucket_id_async(self, bucket_id, body, **kwargs): ... + def post_restore_bucket_metadata(self, bucket_metadata_manifest, **kwargs): ... + def post_restore_bucket_metadata_with_http_info(self, bucket_metadata_manifest, **kwargs): ... + async def post_restore_bucket_metadata_async(self, bucket_metadata_manifest, **kwargs): ... + def post_restore_kv(self, body, **kwargs): ... + def post_restore_kv_with_http_info(self, body, **kwargs): ... + async def post_restore_kv_async(self, body, **kwargs): ... + def post_restore_shard_id(self, shard_id, body, **kwargs): ... + def post_restore_shard_id_with_http_info(self, shard_id, body, **kwargs): ... + async def post_restore_shard_id_async(self, shard_id, body, **kwargs): ... + def post_restore_sql(self, body, **kwargs): ... + def post_restore_sql_with_http_info(self, body, **kwargs): ... + async def post_restore_sql_async(self, body, **kwargs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/routes_service.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/routes_service.pyi new file mode 100644 index 000000000..d04bac3ae --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/routes_service.pyi @@ -0,0 +1,9 @@ +from _typeshed import Incomplete + +from influxdb_client.service._base_service import _BaseService + +class RoutesService(_BaseService): + def __init__(self, api_client: Incomplete | None = ...) -> None: ... + def get_routes(self, **kwargs): ... + def get_routes_with_http_info(self, **kwargs): ... + async def get_routes_async(self, **kwargs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/rules_service.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/rules_service.pyi new file mode 100644 index 000000000..e11bec1b4 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/rules_service.pyi @@ -0,0 +1,9 @@ +from _typeshed import Incomplete + +from influxdb_client.service._base_service import _BaseService + +class RulesService(_BaseService): + def __init__(self, api_client: Incomplete | None = ...) -> None: ... + def get_notification_rules_id_query(self, rule_id, **kwargs): ... + def get_notification_rules_id_query_with_http_info(self, rule_id, **kwargs): ... + async def get_notification_rules_id_query_async(self, rule_id, **kwargs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/scraper_targets_service.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/scraper_targets_service.pyi new file mode 100644 index 000000000..20876f187 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/scraper_targets_service.pyi @@ -0,0 +1,48 @@ +from _typeshed import Incomplete + +from influxdb_client.service._base_service import _BaseService + +class ScraperTargetsService(_BaseService): + def __init__(self, api_client: Incomplete | None = ...) -> None: ... + def delete_scrapers_id(self, scraper_target_id, **kwargs): ... + def delete_scrapers_id_with_http_info(self, scraper_target_id, **kwargs): ... + async def delete_scrapers_id_async(self, scraper_target_id, **kwargs): ... + def delete_scrapers_id_labels_id(self, scraper_target_id, label_id, **kwargs): ... + def delete_scrapers_id_labels_id_with_http_info(self, scraper_target_id, label_id, **kwargs): ... + async def delete_scrapers_id_labels_id_async(self, scraper_target_id, label_id, **kwargs): ... + def delete_scrapers_id_members_id(self, user_id, scraper_target_id, **kwargs): ... + def delete_scrapers_id_members_id_with_http_info(self, user_id, scraper_target_id, **kwargs): ... + async def delete_scrapers_id_members_id_async(self, user_id, scraper_target_id, **kwargs): ... + def delete_scrapers_id_owners_id(self, user_id, scraper_target_id, **kwargs): ... + def delete_scrapers_id_owners_id_with_http_info(self, user_id, scraper_target_id, **kwargs): ... + async def delete_scrapers_id_owners_id_async(self, user_id, scraper_target_id, **kwargs): ... + def get_scrapers(self, **kwargs): ... + def get_scrapers_with_http_info(self, **kwargs): ... + async def get_scrapers_async(self, **kwargs): ... + def get_scrapers_id(self, scraper_target_id, **kwargs): ... + def get_scrapers_id_with_http_info(self, scraper_target_id, **kwargs): ... + async def get_scrapers_id_async(self, scraper_target_id, **kwargs): ... + def get_scrapers_id_labels(self, scraper_target_id, **kwargs): ... + def get_scrapers_id_labels_with_http_info(self, scraper_target_id, **kwargs): ... + async def get_scrapers_id_labels_async(self, scraper_target_id, **kwargs): ... + def get_scrapers_id_members(self, scraper_target_id, **kwargs): ... + def get_scrapers_id_members_with_http_info(self, scraper_target_id, **kwargs): ... + async def get_scrapers_id_members_async(self, scraper_target_id, **kwargs): ... + def get_scrapers_id_owners(self, scraper_target_id, **kwargs): ... + def get_scrapers_id_owners_with_http_info(self, scraper_target_id, **kwargs): ... + async def get_scrapers_id_owners_async(self, scraper_target_id, **kwargs): ... + def patch_scrapers_id(self, scraper_target_id, scraper_target_request, **kwargs): ... + def patch_scrapers_id_with_http_info(self, scraper_target_id, scraper_target_request, **kwargs): ... + async def patch_scrapers_id_async(self, scraper_target_id, scraper_target_request, **kwargs): ... + def post_scrapers(self, scraper_target_request, **kwargs): ... + def post_scrapers_with_http_info(self, scraper_target_request, **kwargs): ... + async def post_scrapers_async(self, scraper_target_request, **kwargs): ... + def post_scrapers_id_labels(self, scraper_target_id, label_mapping, **kwargs): ... + def post_scrapers_id_labels_with_http_info(self, scraper_target_id, label_mapping, **kwargs): ... + async def post_scrapers_id_labels_async(self, scraper_target_id, label_mapping, **kwargs): ... + def post_scrapers_id_members(self, scraper_target_id, add_resource_member_request_body, **kwargs): ... + def post_scrapers_id_members_with_http_info(self, scraper_target_id, add_resource_member_request_body, **kwargs): ... + async def post_scrapers_id_members_async(self, scraper_target_id, add_resource_member_request_body, **kwargs): ... + def post_scrapers_id_owners(self, scraper_target_id, add_resource_member_request_body, **kwargs): ... + def post_scrapers_id_owners_with_http_info(self, scraper_target_id, add_resource_member_request_body, **kwargs): ... + async def post_scrapers_id_owners_async(self, scraper_target_id, add_resource_member_request_body, **kwargs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/secrets_service.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/secrets_service.pyi new file mode 100644 index 000000000..8e5e2c02a --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/secrets_service.pyi @@ -0,0 +1,18 @@ +from _typeshed import Incomplete + +from influxdb_client.service._base_service import _BaseService + +class SecretsService(_BaseService): + def __init__(self, api_client: Incomplete | None = ...) -> None: ... + def delete_orgs_id_secrets_id(self, org_id, secret_id, **kwargs): ... + def delete_orgs_id_secrets_id_with_http_info(self, org_id, secret_id, **kwargs): ... + async def delete_orgs_id_secrets_id_async(self, org_id, secret_id, **kwargs): ... + def get_orgs_id_secrets(self, org_id, **kwargs): ... + def get_orgs_id_secrets_with_http_info(self, org_id, **kwargs): ... + async def get_orgs_id_secrets_async(self, org_id, **kwargs): ... + def patch_orgs_id_secrets(self, org_id, request_body, **kwargs): ... + def patch_orgs_id_secrets_with_http_info(self, org_id, request_body, **kwargs): ... + async def patch_orgs_id_secrets_async(self, org_id, request_body, **kwargs): ... + def post_orgs_id_secrets(self, org_id, secret_keys, **kwargs): ... + def post_orgs_id_secrets_with_http_info(self, org_id, secret_keys, **kwargs): ... + async def post_orgs_id_secrets_async(self, org_id, secret_keys, **kwargs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/setup_service.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/setup_service.pyi new file mode 100644 index 000000000..a423d9ea1 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/setup_service.pyi @@ -0,0 +1,12 @@ +from _typeshed import Incomplete + +from influxdb_client.service._base_service import _BaseService + +class SetupService(_BaseService): + def __init__(self, api_client: Incomplete | None = ...) -> None: ... + def get_setup(self, **kwargs): ... + def get_setup_with_http_info(self, **kwargs): ... + async def get_setup_async(self, **kwargs): ... + def post_setup(self, onboarding_request, **kwargs): ... + def post_setup_with_http_info(self, onboarding_request, **kwargs): ... + async def post_setup_async(self, onboarding_request, **kwargs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/signin_service.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/signin_service.pyi new file mode 100644 index 000000000..45c335647 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/signin_service.pyi @@ -0,0 +1,9 @@ +from _typeshed import Incomplete + +from influxdb_client.service._base_service import _BaseService + +class SigninService(_BaseService): + def __init__(self, api_client: Incomplete | None = ...) -> None: ... + def post_signin(self, **kwargs): ... + def post_signin_with_http_info(self, **kwargs): ... + async def post_signin_async(self, **kwargs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/signout_service.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/signout_service.pyi new file mode 100644 index 000000000..99940d205 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/signout_service.pyi @@ -0,0 +1,9 @@ +from _typeshed import Incomplete + +from influxdb_client.service._base_service import _BaseService + +class SignoutService(_BaseService): + def __init__(self, api_client: Incomplete | None = ...) -> None: ... + def post_signout(self, **kwargs): ... + def post_signout_with_http_info(self, **kwargs): ... + async def post_signout_async(self, **kwargs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/sources_service.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/sources_service.pyi new file mode 100644 index 000000000..8ee48a137 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/sources_service.pyi @@ -0,0 +1,27 @@ +from _typeshed import Incomplete + +from influxdb_client.service._base_service import _BaseService + +class SourcesService(_BaseService): + def __init__(self, api_client: Incomplete | None = ...) -> None: ... + def delete_sources_id(self, source_id, **kwargs): ... + def delete_sources_id_with_http_info(self, source_id, **kwargs): ... + async def delete_sources_id_async(self, source_id, **kwargs): ... + def get_sources(self, **kwargs): ... + def get_sources_with_http_info(self, **kwargs): ... + async def get_sources_async(self, **kwargs): ... + def get_sources_id(self, source_id, **kwargs): ... + def get_sources_id_with_http_info(self, source_id, **kwargs): ... + async def get_sources_id_async(self, source_id, **kwargs): ... + def get_sources_id_buckets(self, source_id, **kwargs): ... + def get_sources_id_buckets_with_http_info(self, source_id, **kwargs): ... + async def get_sources_id_buckets_async(self, source_id, **kwargs): ... + def get_sources_id_health(self, source_id, **kwargs): ... + def get_sources_id_health_with_http_info(self, source_id, **kwargs): ... + async def get_sources_id_health_async(self, source_id, **kwargs): ... + def patch_sources_id(self, source_id, source, **kwargs): ... + def patch_sources_id_with_http_info(self, source_id, source, **kwargs): ... + async def patch_sources_id_async(self, source_id, source, **kwargs): ... + def post_sources(self, source, **kwargs): ... + def post_sources_with_http_info(self, source, **kwargs): ... + async def post_sources_async(self, source, **kwargs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/tasks_service.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/tasks_service.pyi new file mode 100644 index 000000000..218df1051 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/tasks_service.pyi @@ -0,0 +1,69 @@ +from _typeshed import Incomplete + +from influxdb_client.service._base_service import _BaseService + +class TasksService(_BaseService): + def __init__(self, api_client: Incomplete | None = ...) -> None: ... + def delete_tasks_id(self, task_id, **kwargs): ... + def delete_tasks_id_with_http_info(self, task_id, **kwargs): ... + async def delete_tasks_id_async(self, task_id, **kwargs): ... + def delete_tasks_id_labels_id(self, task_id, label_id, **kwargs): ... + def delete_tasks_id_labels_id_with_http_info(self, task_id, label_id, **kwargs): ... + async def delete_tasks_id_labels_id_async(self, task_id, label_id, **kwargs): ... + def delete_tasks_id_members_id(self, user_id, task_id, **kwargs): ... + def delete_tasks_id_members_id_with_http_info(self, user_id, task_id, **kwargs): ... + async def delete_tasks_id_members_id_async(self, user_id, task_id, **kwargs): ... + def delete_tasks_id_owners_id(self, user_id, task_id, **kwargs): ... + def delete_tasks_id_owners_id_with_http_info(self, user_id, task_id, **kwargs): ... + async def delete_tasks_id_owners_id_async(self, user_id, task_id, **kwargs): ... + def delete_tasks_id_runs_id(self, task_id, run_id, **kwargs): ... + def delete_tasks_id_runs_id_with_http_info(self, task_id, run_id, **kwargs): ... + async def delete_tasks_id_runs_id_async(self, task_id, run_id, **kwargs): ... + def get_tasks(self, **kwargs): ... + def get_tasks_with_http_info(self, **kwargs): ... + async def get_tasks_async(self, **kwargs): ... + def get_tasks_id(self, task_id, **kwargs): ... + def get_tasks_id_with_http_info(self, task_id, **kwargs): ... + async def get_tasks_id_async(self, task_id, **kwargs): ... + def get_tasks_id_labels(self, task_id, **kwargs): ... + def get_tasks_id_labels_with_http_info(self, task_id, **kwargs): ... + async def get_tasks_id_labels_async(self, task_id, **kwargs): ... + def get_tasks_id_logs(self, task_id, **kwargs): ... + def get_tasks_id_logs_with_http_info(self, task_id, **kwargs): ... + async def get_tasks_id_logs_async(self, task_id, **kwargs): ... + def get_tasks_id_members(self, task_id, **kwargs): ... + def get_tasks_id_members_with_http_info(self, task_id, **kwargs): ... + async def get_tasks_id_members_async(self, task_id, **kwargs): ... + def get_tasks_id_owners(self, task_id, **kwargs): ... + def get_tasks_id_owners_with_http_info(self, task_id, **kwargs): ... + async def get_tasks_id_owners_async(self, task_id, **kwargs): ... + def get_tasks_id_runs(self, task_id, **kwargs): ... + def get_tasks_id_runs_with_http_info(self, task_id, **kwargs): ... + async def get_tasks_id_runs_async(self, task_id, **kwargs): ... + def get_tasks_id_runs_id(self, task_id, run_id, **kwargs): ... + def get_tasks_id_runs_id_with_http_info(self, task_id, run_id, **kwargs): ... + async def get_tasks_id_runs_id_async(self, task_id, run_id, **kwargs): ... + def get_tasks_id_runs_id_logs(self, task_id, run_id, **kwargs): ... + def get_tasks_id_runs_id_logs_with_http_info(self, task_id, run_id, **kwargs): ... + async def get_tasks_id_runs_id_logs_async(self, task_id, run_id, **kwargs): ... + def patch_tasks_id(self, task_id, task_update_request, **kwargs): ... + def patch_tasks_id_with_http_info(self, task_id, task_update_request, **kwargs): ... + async def patch_tasks_id_async(self, task_id, task_update_request, **kwargs): ... + def post_tasks(self, task_create_request, **kwargs): ... + def post_tasks_with_http_info(self, task_create_request, **kwargs): ... + async def post_tasks_async(self, task_create_request, **kwargs): ... + def post_tasks_id_labels(self, task_id, label_mapping, **kwargs): ... + def post_tasks_id_labels_with_http_info(self, task_id, label_mapping, **kwargs): ... + async def post_tasks_id_labels_async(self, task_id, label_mapping, **kwargs): ... + def post_tasks_id_members(self, task_id, add_resource_member_request_body, **kwargs): ... + def post_tasks_id_members_with_http_info(self, task_id, add_resource_member_request_body, **kwargs): ... + async def post_tasks_id_members_async(self, task_id, add_resource_member_request_body, **kwargs): ... + def post_tasks_id_owners(self, task_id, add_resource_member_request_body, **kwargs): ... + def post_tasks_id_owners_with_http_info(self, task_id, add_resource_member_request_body, **kwargs): ... + async def post_tasks_id_owners_async(self, task_id, add_resource_member_request_body, **kwargs): ... + def post_tasks_id_runs(self, task_id, **kwargs): ... + def post_tasks_id_runs_with_http_info(self, task_id, **kwargs): ... + async def post_tasks_id_runs_async(self, task_id, **kwargs): ... + def post_tasks_id_runs_id_retry(self, task_id, run_id, **kwargs): ... + def post_tasks_id_runs_id_retry_with_http_info(self, task_id, run_id, **kwargs): ... + async def post_tasks_id_runs_id_retry_async(self, task_id, run_id, **kwargs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/telegraf_plugins_service.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/telegraf_plugins_service.pyi new file mode 100644 index 000000000..cfa934533 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/telegraf_plugins_service.pyi @@ -0,0 +1,9 @@ +from _typeshed import Incomplete + +from influxdb_client.service._base_service import _BaseService + +class TelegrafPluginsService(_BaseService): + def __init__(self, api_client: Incomplete | None = ...) -> None: ... + def get_telegraf_plugins(self, **kwargs): ... + def get_telegraf_plugins_with_http_info(self, **kwargs): ... + async def get_telegraf_plugins_async(self, **kwargs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/telegrafs_service.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/telegrafs_service.pyi new file mode 100644 index 000000000..18594458d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/telegrafs_service.pyi @@ -0,0 +1,48 @@ +from _typeshed import Incomplete + +from influxdb_client.service._base_service import _BaseService + +class TelegrafsService(_BaseService): + def __init__(self, api_client: Incomplete | None = ...) -> None: ... + def delete_telegrafs_id(self, telegraf_id, **kwargs): ... + def delete_telegrafs_id_with_http_info(self, telegraf_id, **kwargs): ... + async def delete_telegrafs_id_async(self, telegraf_id, **kwargs): ... + def delete_telegrafs_id_labels_id(self, telegraf_id, label_id, **kwargs): ... + def delete_telegrafs_id_labels_id_with_http_info(self, telegraf_id, label_id, **kwargs): ... + async def delete_telegrafs_id_labels_id_async(self, telegraf_id, label_id, **kwargs): ... + def delete_telegrafs_id_members_id(self, user_id, telegraf_id, **kwargs): ... + def delete_telegrafs_id_members_id_with_http_info(self, user_id, telegraf_id, **kwargs): ... + async def delete_telegrafs_id_members_id_async(self, user_id, telegraf_id, **kwargs): ... + def delete_telegrafs_id_owners_id(self, user_id, telegraf_id, **kwargs): ... + def delete_telegrafs_id_owners_id_with_http_info(self, user_id, telegraf_id, **kwargs): ... + async def delete_telegrafs_id_owners_id_async(self, user_id, telegraf_id, **kwargs): ... + def get_telegrafs(self, **kwargs): ... + def get_telegrafs_with_http_info(self, **kwargs): ... + async def get_telegrafs_async(self, **kwargs): ... + def get_telegrafs_id(self, telegraf_id, **kwargs): ... + def get_telegrafs_id_with_http_info(self, telegraf_id, **kwargs): ... + async def get_telegrafs_id_async(self, telegraf_id, **kwargs): ... + def get_telegrafs_id_labels(self, telegraf_id, **kwargs): ... + def get_telegrafs_id_labels_with_http_info(self, telegraf_id, **kwargs): ... + async def get_telegrafs_id_labels_async(self, telegraf_id, **kwargs): ... + def get_telegrafs_id_members(self, telegraf_id, **kwargs): ... + def get_telegrafs_id_members_with_http_info(self, telegraf_id, **kwargs): ... + async def get_telegrafs_id_members_async(self, telegraf_id, **kwargs): ... + def get_telegrafs_id_owners(self, telegraf_id, **kwargs): ... + def get_telegrafs_id_owners_with_http_info(self, telegraf_id, **kwargs): ... + async def get_telegrafs_id_owners_async(self, telegraf_id, **kwargs): ... + def post_telegrafs(self, telegraf_plugin_request, **kwargs): ... + def post_telegrafs_with_http_info(self, telegraf_plugin_request, **kwargs): ... + async def post_telegrafs_async(self, telegraf_plugin_request, **kwargs): ... + def post_telegrafs_id_labels(self, telegraf_id, label_mapping, **kwargs): ... + def post_telegrafs_id_labels_with_http_info(self, telegraf_id, label_mapping, **kwargs): ... + async def post_telegrafs_id_labels_async(self, telegraf_id, label_mapping, **kwargs): ... + def post_telegrafs_id_members(self, telegraf_id, add_resource_member_request_body, **kwargs): ... + def post_telegrafs_id_members_with_http_info(self, telegraf_id, add_resource_member_request_body, **kwargs): ... + async def post_telegrafs_id_members_async(self, telegraf_id, add_resource_member_request_body, **kwargs): ... + def post_telegrafs_id_owners(self, telegraf_id, add_resource_member_request_body, **kwargs): ... + def post_telegrafs_id_owners_with_http_info(self, telegraf_id, add_resource_member_request_body, **kwargs): ... + async def post_telegrafs_id_owners_async(self, telegraf_id, add_resource_member_request_body, **kwargs): ... + def put_telegrafs_id(self, telegraf_id, telegraf_plugin_request, **kwargs): ... + def put_telegrafs_id_with_http_info(self, telegraf_id, telegraf_plugin_request, **kwargs): ... + async def put_telegrafs_id_async(self, telegraf_id, telegraf_plugin_request, **kwargs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/templates_service.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/templates_service.pyi new file mode 100644 index 000000000..199f0fc17 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/templates_service.pyi @@ -0,0 +1,30 @@ +from _typeshed import Incomplete + +from influxdb_client.service._base_service import _BaseService + +class TemplatesService(_BaseService): + def __init__(self, api_client: Incomplete | None = ...) -> None: ... + def apply_template(self, template_apply, **kwargs): ... + def apply_template_with_http_info(self, template_apply, **kwargs): ... + async def apply_template_async(self, template_apply, **kwargs): ... + def create_stack(self, **kwargs): ... + def create_stack_with_http_info(self, **kwargs): ... + async def create_stack_async(self, **kwargs): ... + def delete_stack(self, stack_id, org_id, **kwargs): ... + def delete_stack_with_http_info(self, stack_id, org_id, **kwargs): ... + async def delete_stack_async(self, stack_id, org_id, **kwargs): ... + def export_template(self, **kwargs): ... + def export_template_with_http_info(self, **kwargs): ... + async def export_template_async(self, **kwargs): ... + def list_stacks(self, org_id, **kwargs): ... + def list_stacks_with_http_info(self, org_id, **kwargs): ... + async def list_stacks_async(self, org_id, **kwargs): ... + def read_stack(self, stack_id, **kwargs): ... + def read_stack_with_http_info(self, stack_id, **kwargs): ... + async def read_stack_async(self, stack_id, **kwargs): ... + def uninstall_stack(self, stack_id, **kwargs): ... + def uninstall_stack_with_http_info(self, stack_id, **kwargs): ... + async def uninstall_stack_async(self, stack_id, **kwargs): ... + def update_stack(self, stack_id, **kwargs): ... + def update_stack_with_http_info(self, stack_id, **kwargs): ... + async def update_stack_async(self, stack_id, **kwargs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/users_service.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/users_service.pyi new file mode 100644 index 000000000..b0bbd8818 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/users_service.pyi @@ -0,0 +1,36 @@ +from _typeshed import Incomplete + +from influxdb_client.service._base_service import _BaseService + +class UsersService(_BaseService): + def __init__(self, api_client: Incomplete | None = ...) -> None: ... + def delete_users_id(self, user_id, **kwargs): ... + def delete_users_id_with_http_info(self, user_id, **kwargs): ... + async def delete_users_id_async(self, user_id, **kwargs): ... + def get_flags(self, **kwargs): ... + def get_flags_with_http_info(self, **kwargs): ... + async def get_flags_async(self, **kwargs): ... + def get_me(self, **kwargs): ... + def get_me_with_http_info(self, **kwargs): ... + async def get_me_async(self, **kwargs): ... + def get_users(self, **kwargs): ... + def get_users_with_http_info(self, **kwargs): ... + async def get_users_async(self, **kwargs): ... + def get_users_id(self, user_id, **kwargs): ... + def get_users_id_with_http_info(self, user_id, **kwargs): ... + async def get_users_id_async(self, user_id, **kwargs): ... + def patch_users_id(self, user_id, user, **kwargs): ... + def patch_users_id_with_http_info(self, user_id, user, **kwargs): ... + async def patch_users_id_async(self, user_id, user, **kwargs): ... + def post_users(self, user, **kwargs): ... + def post_users_with_http_info(self, user, **kwargs): ... + async def post_users_async(self, user, **kwargs): ... + def post_users_id_password(self, user_id, password_reset_body, **kwargs): ... + def post_users_id_password_with_http_info(self, user_id, password_reset_body, **kwargs): ... + async def post_users_id_password_async(self, user_id, password_reset_body, **kwargs): ... + def put_me_password(self, password_reset_body, **kwargs): ... + def put_me_password_with_http_info(self, password_reset_body, **kwargs): ... + async def put_me_password_async(self, password_reset_body, **kwargs): ... + def put_users_id_password(self, user_id, password_reset_body, **kwargs): ... + def put_users_id_password_with_http_info(self, user_id, password_reset_body, **kwargs): ... + async def put_users_id_password_async(self, user_id, password_reset_body, **kwargs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/variables_service.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/variables_service.pyi new file mode 100644 index 000000000..4a180192e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/variables_service.pyi @@ -0,0 +1,33 @@ +from _typeshed import Incomplete + +from influxdb_client.service._base_service import _BaseService + +class VariablesService(_BaseService): + def __init__(self, api_client: Incomplete | None = ...) -> None: ... + def delete_variables_id(self, variable_id, **kwargs): ... + def delete_variables_id_with_http_info(self, variable_id, **kwargs): ... + async def delete_variables_id_async(self, variable_id, **kwargs): ... + def delete_variables_id_labels_id(self, variable_id, label_id, **kwargs): ... + def delete_variables_id_labels_id_with_http_info(self, variable_id, label_id, **kwargs): ... + async def delete_variables_id_labels_id_async(self, variable_id, label_id, **kwargs): ... + def get_variables(self, **kwargs): ... + def get_variables_with_http_info(self, **kwargs): ... + async def get_variables_async(self, **kwargs): ... + def get_variables_id(self, variable_id, **kwargs): ... + def get_variables_id_with_http_info(self, variable_id, **kwargs): ... + async def get_variables_id_async(self, variable_id, **kwargs): ... + def get_variables_id_labels(self, variable_id, **kwargs): ... + def get_variables_id_labels_with_http_info(self, variable_id, **kwargs): ... + async def get_variables_id_labels_async(self, variable_id, **kwargs): ... + def patch_variables_id(self, variable_id, variable, **kwargs): ... + def patch_variables_id_with_http_info(self, variable_id, variable, **kwargs): ... + async def patch_variables_id_async(self, variable_id, variable, **kwargs): ... + def post_variables(self, variable, **kwargs): ... + def post_variables_with_http_info(self, variable, **kwargs): ... + async def post_variables_async(self, variable, **kwargs): ... + def post_variables_id_labels(self, variable_id, label_mapping, **kwargs): ... + def post_variables_id_labels_with_http_info(self, variable_id, label_mapping, **kwargs): ... + async def post_variables_id_labels_async(self, variable_id, label_mapping, **kwargs): ... + def put_variables_id(self, variable_id, variable, **kwargs): ... + def put_variables_id_with_http_info(self, variable_id, variable, **kwargs): ... + async def put_variables_id_async(self, variable_id, variable, **kwargs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/views_service.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/views_service.pyi new file mode 100644 index 000000000..127b8e5df --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/views_service.pyi @@ -0,0 +1,12 @@ +from _typeshed import Incomplete + +from influxdb_client.service._base_service import _BaseService + +class ViewsService(_BaseService): + def __init__(self, api_client: Incomplete | None = ...) -> None: ... + def get_dashboards_id_cells_id_view(self, dashboard_id, cell_id, **kwargs): ... + def get_dashboards_id_cells_id_view_with_http_info(self, dashboard_id, cell_id, **kwargs): ... + async def get_dashboards_id_cells_id_view_async(self, dashboard_id, cell_id, **kwargs): ... + def patch_dashboards_id_cells_id_view(self, dashboard_id, cell_id, view, **kwargs): ... + def patch_dashboards_id_cells_id_view_with_http_info(self, dashboard_id, cell_id, view, **kwargs): ... + async def patch_dashboards_id_cells_id_view_async(self, dashboard_id, cell_id, view, **kwargs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/write_service.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/write_service.pyi new file mode 100644 index 000000000..7f1ec2ebb --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/service/write_service.pyi @@ -0,0 +1,9 @@ +from _typeshed import Incomplete + +from influxdb_client.service._base_service import _BaseService + +class WriteService(_BaseService): + def __init__(self, api_client: Incomplete | None = ...) -> None: ... + def post_write(self, org, bucket, body, **kwargs): ... + def post_write_with_http_info(self, org, bucket, body, **kwargs): ... + async def post_write_async(self, org, bucket, body, **kwargs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/version.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/version.pyi new file mode 100644 index 000000000..3acee936d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/version.pyi @@ -0,0 +1 @@ +VERSION: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/invoke/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/invoke/METADATA.toml index ef7966007..d9b8010e5 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/invoke/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/invoke/METADATA.toml @@ -1 +1,4 @@ -version = "1.7.*" +version = "2.0.*" + +[tool.stubtest] +ignore_missing_stub = true diff --git a/packages/pyright-internal/typeshed-fallback/stubs/invoke/invoke/completion/complete.pyi b/packages/pyright-internal/typeshed-fallback/stubs/invoke/invoke/completion/complete.pyi index bca03430b..58661e891 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/invoke/invoke/completion/complete.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/invoke/invoke/completion/complete.pyi @@ -2,8 +2,10 @@ from collections.abc import Iterable, Sequence from typing import NoReturn from ..collection import Collection -from ..parser import ParserContext, ParseResult +from ..parser import Parser, ParserContext, ParseResult -def complete(names: Iterable[str], core: ParseResult, initial_context: ParserContext, collection: Collection) -> NoReturn: ... +def complete( + names: Iterable[str], core: ParseResult, initial_context: ParserContext, collection: Collection, parser: Parser +) -> NoReturn: ... def print_task_names(collection: Collection) -> None: ... def print_completion_script(shell: str, names: Sequence[str]) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/invoke/invoke/config.pyi b/packages/pyright-internal/typeshed-fallback/stubs/invoke/invoke/config.pyi index 2659a6b2f..6e843fdef 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/invoke/invoke/config.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/invoke/invoke/config.pyi @@ -5,17 +5,17 @@ def load_source(name: str, path: str) -> dict[str, Any]: ... class DataProxy: @classmethod def from_data(cls, data, root=..., keypath=...): ... - def __getattr__(self, key): ... - def __setattr__(self, key, value) -> None: ... + def __getattr__(self, key: str): ... + def __setattr__(self, key: str, value) -> None: ... def __iter__(self): ... def __eq__(self, other): ... __hash__: ClassVar[None] # type: ignore[assignment] - def __len__(self): ... + def __len__(self) -> int: ... def __setitem__(self, key, value) -> None: ... def __getitem__(self, key): ... def __contains__(self, key): ... def __delitem__(self, key) -> None: ... - def __delattr__(self, name) -> None: ... + def __delattr__(self, name: str) -> None: ... def clear(self) -> None: ... def pop(self, *args): ... def popitem(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/invoke/invoke/context.pyi b/packages/pyright-internal/typeshed-fallback/stubs/invoke/invoke/context.pyi index b8013b109..40844a34b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/invoke/invoke/context.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/invoke/invoke/context.pyi @@ -1,3 +1,4 @@ +import pathlib from contextlib import AbstractContextManager from .config import Config, DataProxy @@ -13,7 +14,7 @@ class Context(DataProxy): def prefix(self, command: str) -> AbstractContextManager[None]: ... @property def cwd(self) -> str: ... - def cd(self, path: str) -> AbstractContextManager[None]: ... + def cd(self, path: str | pathlib.Path) -> AbstractContextManager[None]: ... class MockContext(Context): def __init__(self, config: Config | None = ..., **kwargs) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/invoke/invoke/executor.pyi b/packages/pyright-internal/typeshed-fallback/stubs/invoke/invoke/executor.pyi index cb79f60c1..fc9b6c147 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/invoke/invoke/executor.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/invoke/invoke/executor.pyi @@ -11,7 +11,7 @@ class Executor: config: Config core: ParseResult | None def __init__(self, collection: Collection, config: Config | None = ..., core: ParseResult | None = ...) -> None: ... - def execute(self, *tasks: str | tuple[str, dict[str, Any]] | ParserContext) -> dict[Task, Any]: ... + def execute(self, *tasks: str | tuple[str, dict[str, Any]] | ParserContext) -> dict[Task[..., Any], Any]: ... def normalize(self, tasks: Iterable[str | tuple[str, dict[str, Any]] | ParserContext]): ... def dedupe(self, calls: Iterable[Call]) -> list[Call]: ... - def expand_calls(self, calls: Iterable[Call | Task]) -> list[Call]: ... + def expand_calls(self, calls: Iterable[Call | Task[..., Any]]) -> list[Call]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/invoke/invoke/runners.pyi b/packages/pyright-internal/typeshed-fallback/stubs/invoke/invoke/runners.pyi index 063b76b21..554f56286 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/invoke/invoke/runners.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/invoke/invoke/runners.pyi @@ -1,4 +1,5 @@ from collections.abc import Iterable, Mapping +from types import TracebackType from typing import Any, TextIO, overload from typing_extensions import Literal, TypeAlias @@ -148,7 +149,6 @@ class Runner: def send_interrupt(self, interrupt) -> None: ... def returncode(self) -> None: ... def stop(self) -> None: ... - def stop_timer(self) -> None: ... def kill(self) -> None: ... @property def timed_out(self): ... @@ -183,7 +183,6 @@ class Result: ) -> None: ... @property def return_code(self) -> int: ... - def __nonzero__(self) -> bool: ... def __bool__(self) -> bool: ... @property def ok(self) -> bool: ... @@ -196,7 +195,9 @@ class Promise(Result): def __init__(self, runner) -> None: ... def join(self): ... def __enter__(self): ... - def __exit__(self, exc_type, exc_value, traceback) -> None: ... + def __exit__( + self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None + ) -> None: ... def normalize_hide(val, out_stream=..., err_stream=...): ... def default_encoding() -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/invoke/invoke/tasks.pyi b/packages/pyright-internal/typeshed-fallback/stubs/invoke/invoke/tasks.pyi index 9e60b0b5f..0240aca9f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/invoke/invoke/tasks.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/invoke/invoke/tasks.pyi @@ -1,17 +1,18 @@ -from _typeshed import Self +from _typeshed import Incomplete from collections.abc import Callable, Iterable -from typing import Any, TypeVar, overload +from typing import Any, Generic, TypeVar, overload +from typing_extensions import ParamSpec, Self from .config import Config from .context import Context from .parser import Argument -_TaskT = TypeVar("_TaskT", bound=Task) +_P = ParamSpec("_P") +_R_co = TypeVar("_R_co", covariant=True) +_TaskT = TypeVar("_TaskT", bound=Task[..., Any]) -NO_DEFAULT: object - -class Task: - body: Callable[..., Any] +class Task(Generic[_P, _R_co]): + body: Callable[_P, _R_co] __doc__: str | None __name__: str __module__: str @@ -23,8 +24,8 @@ class Task: incrementable: Iterable[str] auto_shortflags: bool help: dict[str, str] - pre: Iterable[Task] - post: Iterable[Task] + pre: Iterable[Task[..., Any] | Call] + post: Iterable[Task[..., Any] | Call] times_called: int autoprint: bool def __init__( @@ -37,17 +38,17 @@ class Task: default: bool = ..., auto_shortflags: bool = ..., help: dict[str, str] | None = ..., - pre: Iterable[Task] | None = ..., - post: Iterable[Task] | None = ..., + pre: Iterable[Task[..., Any] | Call] | None = ..., + post: Iterable[Task[..., Any] | Call] | None = ..., autoprint: bool = ..., iterable: Iterable[str] | None = ..., incrementable: Iterable[str] | None = ..., ) -> None: ... @property def name(self): ... - def __eq__(self, other: Task) -> bool: ... # type: ignore[override] + def __eq__(self, other: Task[Incomplete, Incomplete]) -> bool: ... # type: ignore[override] def __hash__(self) -> int: ... - def __call__(self, *args, **kwargs): ... + def __call__(self, *args: _P.args, **kwargs: _P.kwargs) -> _R_co: ... @property def called(self) -> bool: ... def argspec(self, body): ... @@ -55,11 +56,9 @@ class Task: def arg_opts(self, name: str, default: Any, taken_names: Iterable[str]) -> dict[str, Any]: ... def get_arguments(self, ignore_unknown_help: bool | None = ...) -> list[Argument]: ... -@overload -def task(__func: Callable[..., Any]) -> Task: ... @overload def task( - *args: Task, + *args: Task[..., Any] | Call, name: str | None = ..., aliases: tuple[str, ...] = ..., positional: Iterable[str] | None = ..., @@ -67,15 +66,15 @@ def task( default: bool = ..., auto_shortflags: bool = ..., help: dict[str, str] | None = ..., - pre: list[Task] | None = ..., - post: list[Task] | None = ..., + pre: list[Task[..., Any] | Call] | None = ..., + post: list[Task[..., Any] | Call] | None = ..., autoprint: bool = ..., iterable: Iterable[str] | None = ..., incrementable: Iterable[str] | None = ..., -) -> Callable[[Callable[..., Any]], Task]: ... +) -> Callable[[Callable[_P, _R_co]], Task[_P, _R_co]]: ... @overload def task( - *args: Task, + *args: Task[..., Any] | Call, name: str | None = ..., aliases: tuple[str, ...] = ..., positional: Iterable[str] | None = ..., @@ -83,28 +82,34 @@ def task( default: bool = ..., auto_shortflags: bool = ..., help: dict[str, str] | None = ..., - pre: list[Task] | None = ..., - post: list[Task] | None = ..., + pre: list[Task[..., Any] | Call] | None = ..., + post: list[Task[..., Any] | Call] | None = ..., autoprint: bool = ..., iterable: Iterable[str] | None = ..., incrementable: Iterable[str] | None = ..., klass: type[_TaskT], ) -> Callable[[Callable[..., Any]], _TaskT]: ... +@overload +def task(__func: Callable[_P, _R_co]) -> Task[_P, _R_co]: ... class Call: - task: Task + task: Task[..., Any] called_as: str | None args: tuple[Any, ...] kwargs: dict[str, Any] def __init__( - self, task: Task, called_as: str | None = ..., args: tuple[Any, ...] | None = ..., kwargs: dict[str, Any] | None = ... + self, + task: Task[..., Any], + called_as: str | None = ..., + args: tuple[Any, ...] | None = ..., + kwargs: dict[str, Any] | None = ..., ) -> None: ... def __getattr__(self, name: str) -> Any: ... - def __deepcopy__(self: Self, memo: Any) -> Self: ... + def __deepcopy__(self, memo: Any) -> Self: ... def __eq__(self, other: Call) -> bool: ... # type: ignore[override] def make_context(self, config: Config) -> Context: ... def clone_data(self): ... # TODO use overload def clone(self, into: type[Call] | None = ..., with_: dict[str, Any] | None = ...) -> Call: ... -def call(task: Task, *args: Any, **kwargs: Any) -> Call: ... +def call(task: Task[..., Any], *args: Any, **kwargs: Any) -> Call: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/invoke/invoke/util.pyi b/packages/pyright-internal/typeshed-fallback/stubs/invoke/invoke/util.pyi index d010b6030..bfd238204 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/invoke/invoke/util.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/invoke/invoke/util.pyi @@ -15,7 +15,6 @@ def task_name_sort_key(name: str) -> tuple[list[str], str]: ... def cd(where: str) -> AbstractContextManager[None]: ... def has_fileno(stream) -> bool: ... def isatty(stream) -> bool: ... -def encode_output(string: str, encoding: str) -> str: ... def helpline(obj: Callable[..., object]) -> str | None: ... class ExceptionHandlingThread(threading.Thread): diff --git a/packages/pyright-internal/typeshed-fallback/stubs/jmespath/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/jmespath/METADATA.toml index 516f11f6b..f3e83f9c4 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/jmespath/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/jmespath/METADATA.toml @@ -1,4 +1 @@ version = "1.0.*" - -[tool.stubtest] -ignore_missing_stub = false diff --git a/packages/pyright-internal/typeshed-fallback/stubs/jmespath/jmespath/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/jmespath/jmespath/__init__.pyi index 23077fb69..9406a3dcc 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/jmespath/jmespath/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/jmespath/jmespath/__init__.pyi @@ -4,4 +4,4 @@ from jmespath import parser as parser from jmespath.visitor import Options as Options def compile(expression: str) -> parser.ParsedResult: ... -def search(expression: str, data: Any, options: Any | None = ...) -> Any: ... +def search(expression: str, data: Any, options: Options | None = ...) -> Any: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/jmespath/jmespath/exceptions.pyi b/packages/pyright-internal/typeshed-fallback/stubs/jmespath/jmespath/exceptions.pyi index 8bbb095c2..e09d9425a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/jmespath/jmespath/exceptions.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/jmespath/jmespath/exceptions.pyi @@ -1,44 +1,43 @@ +from collections.abc import Sequence from typing import Any class JMESPathError(ValueError): ... class ParseError(JMESPathError): - lex_position: Any - token_value: Any - token_type: Any - msg: Any - expression: Any - def __init__(self, lex_position, token_value, token_type, msg=...) -> None: ... + lex_position: int + token_value: str + token_type: str + msg: str + expression: str | None + def __init__(self, lex_position: int, token_value: str, token_type: str, msg: str = ...) -> None: ... class IncompleteExpressionError(ParseError): - expression: Any - lex_position: Any - token_type: Any - token_value: Any - def set_expression(self, expression) -> None: ... + # When ParseError is used directly, the token always have a non-null value and type + token_value: str | None # type: ignore[assignment] + token_type: str | None # type: ignore[assignment] + expression: str + def set_expression(self, expression: str) -> None: ... class LexerError(ParseError): - lexer_position: Any - lexer_value: Any - message: Any - expression: Any - def __init__(self, lexer_position, lexer_value, message, expression: Any | None = ...) -> None: ... + lexer_position: int + lexer_value: str + message: str + def __init__(self, lexer_position: int, lexer_value: str, message: str, expression: str | None = ...) -> None: ... class ArityError(ParseError): - expected_arity: Any - actual_arity: Any - function_name: Any - expression: Any + expected_arity: int + actual_arity: int + function_name: str def __init__(self, expected, actual, name) -> None: ... class VariadictArityError(ArityError): ... class JMESPathTypeError(JMESPathError): - function_name: Any + function_name: str current_value: Any - actual_type: Any - expected_types: Any - def __init__(self, function_name, current_value, actual_type, expected_types) -> None: ... + actual_type: str + expected_types: Sequence[str] + def __init__(self, function_name: str, current_value: Any, actual_type: str, expected_types: Sequence[str]) -> None: ... class EmptyExpressionError(JMESPathError): def __init__(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/jmespath/jmespath/functions.pyi b/packages/pyright-internal/typeshed-fallback/stubs/jmespath/jmespath/functions.pyi index e1916f99e..836f80e38 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/jmespath/jmespath/functions.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/jmespath/jmespath/functions.pyi @@ -1,4 +1,4 @@ -from collections.abc import Callable +from collections.abc import Callable, Iterable from typing import Any, TypeVar from typing_extensions import NotRequired, TypedDict @@ -16,6 +16,7 @@ def signature(*arguments: _Signature) -> Callable[[_F], _F]: ... class FunctionRegistry(type): def __init__(cls, name, bases, attrs) -> None: ... -class Functions: +class Functions(metaclass=FunctionRegistry): FUNCTION_TABLE: Any - def call_function(self, function_name, resolved_args): ... + # resolved_args and return value are the *args and return of a function called by name + def call_function(self, function_name: str, resolved_args: Iterable[Any]) -> Any: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/jmespath/jmespath/lexer.pyi b/packages/pyright-internal/typeshed-fallback/stubs/jmespath/jmespath/lexer.pyi index 70696ca8c..9e44bf803 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/jmespath/jmespath/lexer.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/jmespath/jmespath/lexer.pyi @@ -1,11 +1,19 @@ -from typing import Any +from collections.abc import Iterator +from typing import ClassVar +from typing_extensions import TypedDict from jmespath.exceptions import EmptyExpressionError as EmptyExpressionError, LexerError as LexerError +class _LexerTokenizeResult(TypedDict): + type: str + value: str + start: int + end: int + class Lexer: - START_IDENTIFIER: Any - VALID_IDENTIFIER: Any - VALID_NUMBER: Any - WHITESPACE: Any - SIMPLE_TOKENS: Any - def tokenize(self, expression) -> None: ... + START_IDENTIFIER: ClassVar[set[str]] + VALID_IDENTIFIER: ClassVar[set[str]] + VALID_NUMBER: ClassVar[set[str]] + WHITESPACE: ClassVar[set[str]] + SIMPLE_TOKENS: ClassVar[dict[str, str]] + def tokenize(self, expression: str) -> Iterator[_LexerTokenizeResult]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/jmespath/jmespath/parser.pyi b/packages/pyright-internal/typeshed-fallback/stubs/jmespath/jmespath/parser.pyi index 4e5499e67..cc75ceeda 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/jmespath/jmespath/parser.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/jmespath/jmespath/parser.pyi @@ -1,15 +1,19 @@ -from typing import Any +from collections.abc import Iterator +from typing import Any, ClassVar + +from jmespath.lexer import _LexerTokenizeResult +from jmespath.visitor import Options, _TreeNode class Parser: - BINDING_POWER: Any - tokenizer: Any + BINDING_POWER: ClassVar[dict[str, int]] + tokenizer: Iterator[_LexerTokenizeResult] | None def __init__(self, lookahead: int = ...) -> None: ... - def parse(self, expression): ... + def parse(self, expression: str) -> ParsedResult: ... @classmethod def purge(cls) -> None: ... class ParsedResult: - expression: Any - parsed: Any - def __init__(self, expression, parsed) -> None: ... - def search(self, value, options: Any | None = ...): ... + expression: str + parsed: _TreeNode + def __init__(self, expression: str, parsed: _TreeNode) -> None: ... + def search(self, value: Any, options: Options | None = ...) -> Any: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/jmespath/jmespath/visitor.pyi b/packages/pyright-internal/typeshed-fallback/stubs/jmespath/jmespath/visitor.pyi index 99e86bc90..4189200fd 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/jmespath/jmespath/visitor.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/jmespath/jmespath/visitor.pyi @@ -1,49 +1,60 @@ -from typing import Any +from collections.abc import Callable, MutableMapping +from typing import Any, ClassVar, NoReturn +from typing_extensions import TypedDict + +from jmespath.functions import Functions class Options: - dict_cls: Any - custom_functions: Any - def __init__(self, dict_cls: Any | None = ..., custom_functions: Any | None = ...) -> None: ... + dict_cls: Callable[[], MutableMapping[Any, Any]] | None + custom_functions: Functions | None + def __init__( + self, dict_cls: Callable[[], MutableMapping[Any, Any]] | None = ..., custom_functions: Functions | None = ... + ) -> None: ... class _Expression: - expression: Any - interpreter: Any - def __init__(self, expression, interpreter) -> None: ... - def visit(self, node, *args, **kwargs): ... + expression: str + interpreter: Visitor + def __init__(self, expression: str, interpreter: Visitor) -> None: ... + def visit(self, node: _TreeNode, *args, **kwargs) -> Any: ... class Visitor: def __init__(self) -> None: ... - def visit(self, node, *args, **kwargs): ... - def default_visit(self, node, *args, **kwargs) -> None: ... + def visit(self, node: _TreeNode, *args, **kwargs) -> Any: ... + def default_visit(self, node: _TreeNode, *args, **kwargs) -> NoReturn: ... + +class _TreeNode(TypedDict): + type: str + value: Any + children: list[_TreeNode] class TreeInterpreter(Visitor): - COMPARATOR_FUNC: Any - MAP_TYPE: Any - def __init__(self, options: Any | None = ...) -> None: ... - def default_visit(self, node, *args, **kwargs) -> None: ... - def visit_subexpression(self, node, value): ... - def visit_field(self, node, value): ... - def visit_comparator(self, node, value): ... - def visit_current(self, node, value): ... - def visit_expref(self, node, value): ... - def visit_function_expression(self, node, value): ... - def visit_filter_projection(self, node, value): ... - def visit_flatten(self, node, value): ... - def visit_identity(self, node, value): ... - def visit_index(self, node, value): ... - def visit_index_expression(self, node, value): ... - def visit_slice(self, node, value): ... - def visit_key_val_pair(self, node, value): ... - def visit_literal(self, node, value): ... - def visit_multi_select_dict(self, node, value): ... - def visit_multi_select_list(self, node, value): ... - def visit_or_expression(self, node, value): ... - def visit_and_expression(self, node, value): ... - def visit_not_expression(self, node, value): ... - def visit_pipe(self, node, value): ... - def visit_projection(self, node, value): ... - def visit_value_projection(self, node, value): ... + COMPARATOR_FUNC: ClassVar[dict[str, Callable[[Any, Any], Any]]] + MAP_TYPE: ClassVar[Callable[[], MutableMapping[Any, Any]]] + def __init__(self, options: Options | None = ...) -> None: ... + def default_visit(self, node: _TreeNode, *args, **kwargs) -> NoReturn: ... + def visit_subexpression(self, node: _TreeNode, value: Any) -> Any: ... + def visit_field(self, node: _TreeNode, value: Any) -> Any: ... + def visit_comparator(self, node: _TreeNode, value: Any) -> Any: ... + def visit_current(self, node: _TreeNode, value: Any) -> Any: ... + def visit_expref(self, node: _TreeNode, value: Any) -> Any: ... + def visit_function_expression(self, node: _TreeNode, value: Any) -> Any: ... + def visit_filter_projection(self, node: _TreeNode, value: Any) -> Any: ... + def visit_flatten(self, node: _TreeNode, value: Any) -> Any: ... + def visit_identity(self, node: _TreeNode, value: Any) -> Any: ... + def visit_index(self, node: _TreeNode, value: Any) -> Any: ... + def visit_index_expression(self, node: _TreeNode, value: Any) -> Any: ... + def visit_slice(self, node: _TreeNode, value: Any) -> Any: ... + def visit_key_val_pair(self, node: _TreeNode, value: Any) -> Any: ... + def visit_literal(self, node: _TreeNode, value: Any) -> Any: ... + def visit_multi_select_dict(self, node: _TreeNode, value: Any) -> Any: ... + def visit_multi_select_list(self, node: _TreeNode, value: Any) -> Any: ... + def visit_or_expression(self, node: _TreeNode, value: Any) -> Any: ... + def visit_and_expression(self, node: _TreeNode, value: Any) -> Any: ... + def visit_not_expression(self, node: _TreeNode, value: Any) -> Any: ... + def visit_pipe(self, node: _TreeNode, value: Any) -> Any: ... + def visit_projection(self, node: _TreeNode, value: Any) -> Any: ... + def visit_value_projection(self, node: _TreeNode, value: Any) -> Any: ... class GraphvizVisitor(Visitor): def __init__(self) -> None: ... - def visit(self, node, *args, **kwargs): ... + def visit(self, node: _TreeNode, *args, **kwargs) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/METADATA.toml index ff1476e1c..d5dbdb975 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/METADATA.toml @@ -1 +1,5 @@ -version = "4.9.*" +version = "4.17.*" + +[tool.stubtest] +ignore_missing_stub = true +extras = ["format"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/_format.pyi b/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/_format.pyi index 377c2b494..9c2b12ef1 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/_format.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/_format.pyi @@ -1,19 +1,20 @@ from collections.abc import Callable, Iterable -from typing import Any, TypeVar, Union +from typing import TypeVar from typing_extensions import TypeAlias -_F = TypeVar("_F", bound=Callable[..., Any]) -_RaisesType: TypeAlias = Union[type[Exception], tuple[type[Exception], ...]] +_FormatCheckCallable: TypeAlias = Callable[[object], bool] +_F = TypeVar("_F", bound=_FormatCheckCallable) +_RaisesType: TypeAlias = type[Exception] | tuple[type[Exception], ...] class FormatChecker: - checkers: dict[str, tuple[Callable[[Any], bool], _RaisesType]] + checkers: dict[str, tuple[_FormatCheckCallable, _RaisesType]] def __init__(self, formats: Iterable[str] | None = ...) -> None: ... def checks(self, format: str, raises: _RaisesType = ...) -> Callable[[_F], _F]: ... @classmethod def cls_checks(cls, format: str, raises: _RaisesType = ...) -> Callable[[_F], _F]: ... - def check(self, instance: Any, format: str) -> None: ... - def conforms(self, instance: Any, format: str) -> bool: ... + def check(self, instance: object, format: str) -> None: ... + def conforms(self, instance: object, format: str) -> bool: ... draft3_format_checker: FormatChecker draft4_format_checker: FormatChecker diff --git a/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/_reflect.pyi b/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/_reflect.pyi deleted file mode 100644 index a19c6f9d8..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/_reflect.pyi +++ /dev/null @@ -1,7 +0,0 @@ -class _NoModuleFound(Exception): ... -class InvalidName(ValueError): ... -class ModuleNotFound(InvalidName): ... -class ObjectNotFound(InvalidName): ... - -def reraise(exception, traceback) -> None: ... -def namedAny(name): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/exceptions.pyi b/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/exceptions.pyi index bec519be9..a61828da1 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/exceptions.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/exceptions.pyi @@ -1,8 +1,8 @@ -from _typeshed import Self, SupportsRichComparison +from _typeshed import Incomplete, SupportsRichComparison from collections import deque from collections.abc import Callable, Container, Iterable, Sequence from typing import Any -from typing_extensions import TypeAlias +from typing_extensions import Self, TypeAlias from jsonschema import _utils, protocols from jsonschema._types import TypeChecker @@ -30,7 +30,7 @@ class _Error(Exception): message: str, validator: _utils.Unset | None | protocols.Validator = ..., path: Sequence[str | int] = ..., - cause: Any | None = ..., + cause: Incomplete | None = ..., context: Sequence[ValidationError] = ..., validator_value=..., instance: Any = ..., @@ -40,7 +40,7 @@ class _Error(Exception): type_checker: _utils.Unset | TypeChecker = ..., ) -> None: ... @classmethod - def create_from(cls: type[Self], other: _Error) -> Self: ... + def create_from(cls, other: _Error) -> Self: ... @property def absolute_path(self) -> Sequence[str | int]: ... @property @@ -70,7 +70,7 @@ class UnknownType(Exception): class FormatError(Exception): message: Any cause: Any - def __init__(self, message, cause: Any | None = ...) -> None: ... + def __init__(self, message, cause: Incomplete | None = ...) -> None: ... class ErrorTree: errors: Any @@ -79,7 +79,7 @@ class ErrorTree: def __getitem__(self, index): ... def __setitem__(self, index, value) -> None: ... def __iter__(self): ... - def __len__(self): ... + def __len__(self) -> int: ... @property def total_errors(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/protocols.pyi b/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/protocols.pyi index 10e03dabf..7a3c6e145 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/protocols.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/protocols.pyi @@ -1,11 +1,14 @@ -from collections.abc import Iterator +from collections.abc import Iterator, Mapping, Sequence from typing import Any, ClassVar, Protocol +from typing_extensions import TypeAlias from jsonschema._format import FormatChecker from jsonschema._types import TypeChecker from jsonschema.exceptions import ValidationError from jsonschema.validators import RefResolver +_JsonParameter: TypeAlias = str | int | float | bool | None | Mapping[str, _JsonParameter] | Sequence[_JsonParameter] + class Validator(Protocol): META_SCHEMA: ClassVar[dict[Any, Any]] VALIDATORS: ClassVar[dict[Any, Any]] @@ -17,8 +20,8 @@ class Validator(Protocol): ) -> None: ... @classmethod def check_schema(cls, schema: dict[Any, Any]) -> None: ... - def is_type(self, instance: Any, type: str) -> bool: ... - def is_valid(self, instance: dict[Any, Any]) -> bool: ... - def iter_errors(self, instance: dict[Any, Any]) -> Iterator[ValidationError]: ... - def validate(self, instance: dict[Any, Any]) -> None: ... + def is_type(self, instance: _JsonParameter, type: str) -> bool: ... + def is_valid(self, instance: _JsonParameter) -> bool: ... + def iter_errors(self, instance: _JsonParameter) -> Iterator[ValidationError]: ... + def validate(self, instance: _JsonParameter) -> None: ... def evolve(self, **kwargs) -> Validator: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/validators.pyi b/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/validators.pyi index 33ddc0bdc..635d8f4e6 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/validators.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/validators.pyi @@ -1,9 +1,18 @@ -from _typeshed import SupportsKeysAndGetItem -from collections.abc import Callable, Generator, Iterable, Mapping +from _typeshed import Incomplete, SupportsKeysAndGetItem +from collections.abc import Callable, Generator, Iterable, Iterator, Mapping +from contextlib import contextmanager from typing import Any, ClassVar from typing_extensions import TypeAlias -from ._utils import URIDict +from ._format import FormatChecker +from ._types import TypeChecker +from ._utils import Unset, URIDict +from .exceptions import ValidationError + +# these type aliases do not exist at runtime, they're only defined here in the stub +_JsonObject: TypeAlias = Mapping[str, Any] +_JsonValue: TypeAlias = _JsonObject | list[Any] | str | int | float | bool | None +_ValidatorCallback: TypeAlias = Callable[[Any, Any, _JsonValue, _JsonObject], Iterator[ValidationError]] _Schema: TypeAlias = Mapping[str, Any] @@ -20,12 +29,12 @@ class _Validator: resolver: Any format_checker: Any evolve: Any - def __init__(self, schema: _Schema, resolver: Any | None = ..., format_checker: Any | None = ...) -> None: ... + def __init__(self, schema: _Schema, resolver: Incomplete | None = ..., format_checker: Incomplete | None = ...) -> None: ... @classmethod - def check_schema(cls, schema: _Schema) -> None: ... + def check_schema(cls, schema: _Schema, format_checker: FormatChecker | Unset = ...) -> None: ... def iter_errors(self, instance, _schema: _Schema | None = ...) -> Generator[Any, None, None]: ... def descend( - self, instance, schema: _Schema, path: Any | None = ..., schema_path: Any | None = ... + self, instance, schema: _Schema, path: Incomplete | None = ..., schema_path: Incomplete | None = ... ) -> Generator[Any, None, None]: ... def validate(self, *args, **kwargs) -> None: ... def is_type(self, instance, type): ... @@ -33,16 +42,20 @@ class _Validator: def validates(version: str) -> Callable[..., Any]: ... def create( - meta_schema, - validators=..., - version: Any | None = ..., - type_checker=..., - format_checker=..., - id_of=..., - applicable_validators=..., + meta_schema: _Schema, + validators: Mapping[str, _ValidatorCallback] | tuple[()] = ..., + version: Incomplete | None = ..., + type_checker: TypeChecker = ..., + format_checker: FormatChecker = ..., + id_of: Callable[[_Schema], str] = ..., + applicable_validators: Callable[[_Schema], Iterable[tuple[str, _ValidatorCallback]]] = ..., ) -> type[_Validator]: ... def extend( - validator, validators=..., version: Any | None = ..., type_checker: Any | None = ..., format_checker: Any | None = ... + validator, + validators=..., + version: Incomplete | None = ..., + type_checker: Incomplete | None = ..., + format_checker: Incomplete | None = ..., ): ... # At runtime these are fields that are assigned the return values of create() calls. @@ -67,8 +80,8 @@ class RefResolver: store: SupportsKeysAndGetItem[str, str] | Iterable[tuple[str, str]] = ..., cache_remote: bool = ..., handlers: SupportsKeysAndGetItem[str, _Handler] | Iterable[tuple[str, _Handler]] = ..., - urljoin_cache: Any | None = ..., - remote_cache: Any | None = ..., + urljoin_cache: Incomplete | None = ..., + remote_cache: Incomplete | None = ..., ) -> None: ... @classmethod def from_schema(cls, schema: _Schema, id_of=..., *args, **kwargs): ... @@ -78,8 +91,10 @@ class RefResolver: def resolution_scope(self): ... @property def base_uri(self): ... - def in_scope(self, scope) -> None: ... - def resolving(self, ref) -> None: ... + @contextmanager + def in_scope(self, scope) -> Generator[None, None, None]: ... + @contextmanager + def resolving(self, ref) -> Generator[Incomplete, None, None]: ... def resolve(self, ref): ... def resolve_from_url(self, url): ... def resolve_fragment(self, document, fragment): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/keyboard/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/keyboard/METADATA.toml new file mode 100644 index 000000000..dd6660878 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/keyboard/METADATA.toml @@ -0,0 +1,8 @@ +version = "0.13.*" + +# [tool.stubtest] +# While the stubs slightly differ on Windows vs Linux. +# It's only by possible mouse buttons and event literal types. +# As well as returning a tuple of int/long from keyboard.mouse.get_position +# The "mouse" module is obsoleted by the "mouse" package. +# platforms = diff --git a/packages/pyright-internal/typeshed-fallback/stubs/keyboard/keyboard/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/keyboard/keyboard/__init__.pyi new file mode 100644 index 000000000..d65c0c508 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/keyboard/keyboard/__init__.pyi @@ -0,0 +1,113 @@ +from collections.abc import Callable, Generator, Iterable, Sequence +from queue import Queue +from threading import Event as _UninterruptibleEvent +from typing_extensions import TypeAlias + +from ._canonical_names import all_modifiers as all_modifiers, sided_modifiers as sided_modifiers +from ._keyboard_event import KEY_DOWN as KEY_DOWN, KEY_UP as KEY_UP, KeyboardEvent as KeyboardEvent + +_Key: TypeAlias = int | str +_ScanCodeList: TypeAlias = list[int] | tuple[int, ...] +_ParseableHotkey: TypeAlias = _Key | list[int | _ScanCodeList] | tuple[int | _ScanCodeList, ...] +_Callback: TypeAlias = Callable[[KeyboardEvent], bool | None] | Callable[[], bool | None] +# mypy doesn't support PEP 646's TypeVarTuple yet: https://github.com/python/mypy/issues/12280 +# _Ts = TypeVarTuple("_Ts") +_Ts: TypeAlias = tuple[object, ...] + +version: str + +class _Event(_UninterruptibleEvent): + def wait(self) -> None: ... # type: ignore[override] # Actual implementation + +def is_modifier(key: _Key | None) -> bool: ... +def key_to_scan_codes(key: _ParseableHotkey, error_if_missing: bool = ...) -> tuple[int, ...]: ... +def parse_hotkey(hotkey: _ParseableHotkey) -> tuple[tuple[tuple[int, ...], ...], ...]: ... +def send(hotkey: _ParseableHotkey, do_press: bool = ..., do_release: bool = ...) -> None: ... + +press_and_release = send + +def press(hotkey: _ParseableHotkey) -> None: ... +def release(hotkey: _ParseableHotkey) -> None: ... + +# is_pressed cannot check multi-step hotkeys, so not using _ParseableHotkey + +def is_pressed(hotkey: _Key | _ScanCodeList) -> bool: ... +def call_later(fn: Callable[..., None], args: _Ts = ..., delay: float = ...) -> None: ... +def hook(callback: _Callback, suppress: bool = ..., on_remove: Callable[[], None] = ...) -> Callable[[], None]: ... +def on_press(callback: _Callback, suppress: bool = ...) -> Callable[[], None]: ... +def on_release(callback: _Callback, suppress: bool = ...) -> Callable[[], None]: ... +def hook_key(key: _ParseableHotkey, callback: _Callback, suppress: bool = ...) -> Callable[[], None]: ... +def on_press_key(key: _ParseableHotkey, callback: _Callback, suppress: bool = ...) -> Callable[[], None]: ... +def on_release_key(key: _ParseableHotkey, callback: _Callback, suppress: bool = ...) -> Callable[[], None]: ... +def unhook(remove: _Callback) -> None: ... + +unhook_key = unhook + +def unhook_all() -> None: ... +def block_key(key: _ParseableHotkey) -> Callable[[], None]: ... + +unblock_key = unhook_key + +def remap_key(src: _ParseableHotkey, dst: _ParseableHotkey) -> Callable[[], None]: ... + +unremap_key = unhook_key + +def parse_hotkey_combinations(hotkey: _ParseableHotkey) -> tuple[tuple[tuple[int, ...], ...], ...]: ... +def add_hotkey( + hotkey: _ParseableHotkey, + callback: Callable[..., bool | None], + args: _Ts = ..., + suppress: bool = ..., + timeout: float = ..., + trigger_on_release: bool = ..., +) -> Callable[[], None]: ... + +register_hotkey = add_hotkey + +def remove_hotkey(hotkey_or_callback: _ParseableHotkey | _Callback) -> None: ... + +unregister_hotkey = remove_hotkey +clear_hotkey = remove_hotkey + +def unhook_all_hotkeys() -> None: ... + +unregister_all_hotkeys = unhook_all_hotkeys +remove_all_hotkeys = unhook_all_hotkeys +clear_all_hotkeys = unhook_all_hotkeys + +def remap_hotkey( + src: _ParseableHotkey, dst: _ParseableHotkey, suppress: bool = ..., trigger_on_release: bool = ... +) -> Callable[[], None]: ... + +unremap_hotkey = remove_hotkey + +def stash_state() -> list[int]: ... +def restore_state(scan_codes: Iterable[int]) -> None: ... +def restore_modifiers(scan_codes: Iterable[int]) -> None: ... +def write(text: str, delay: float = ..., restore_state_after: bool = ..., exact: bool | None = ...) -> None: ... +def wait(hotkey: _ParseableHotkey | None = ..., suppress: bool = ..., trigger_on_release: bool = ...) -> None: ... +def get_hotkey_name(names: Iterable[str] | None = ...) -> str: ... +def read_event(suppress: bool = ...) -> KeyboardEvent: ... +def read_key(suppress: bool = ...) -> _Key: ... +def read_hotkey(suppress: bool = ...) -> str: ... +def get_typed_strings(events: Iterable[KeyboardEvent], allow_backspace: bool = ...) -> Generator[str, None, None]: ... +def start_recording( + recorded_events_queue: Queue[KeyboardEvent] | None = ..., +) -> tuple[Queue[KeyboardEvent], Callable[[], None]]: ... +def stop_recording() -> list[KeyboardEvent]: ... +def record(until: str = ..., suppress: bool = ..., trigger_on_release: bool = ...) -> list[KeyboardEvent]: ... +def play(events: Iterable[KeyboardEvent], speed_factor: float = ...) -> None: ... + +replay = play + +def add_word_listener( + word: str, callback: _Callback, triggers: Sequence[str] = ..., match_suffix: bool = ..., timeout: float = ... +) -> Callable[[], None]: ... +def remove_word_listener(word_or_handler: str | _Callback) -> None: ... +def add_abbreviation( + source_text: str, replacement_text: str, match_suffix: bool = ..., timeout: float = ... +) -> Callable[[], None]: ... + +register_word_listener = add_word_listener +register_abbreviation = add_abbreviation +remove_abbreviation = remove_word_listener diff --git a/packages/pyright-internal/typeshed-fallback/stubs/keyboard/keyboard/_canonical_names.pyi b/packages/pyright-internal/typeshed-fallback/stubs/keyboard/keyboard/_canonical_names.pyi new file mode 100644 index 000000000..8a0c3a007 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/keyboard/keyboard/_canonical_names.pyi @@ -0,0 +1,5 @@ +canonical_names: dict[str, str] +sided_modifiers: set[str] +all_modifiers: set[str] + +def normalize_name(name: str) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/keyboard/keyboard/_generic.pyi b/packages/pyright-internal/typeshed-fallback/stubs/keyboard/keyboard/_generic.pyi new file mode 100644 index 000000000..21f74b9e1 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/keyboard/keyboard/_generic.pyi @@ -0,0 +1,24 @@ +from collections.abc import Callable +from queue import Queue +from threading import Lock, Thread +from typing import ClassVar +from typing_extensions import Literal, TypeAlias + +from ._keyboard_event import KeyboardEvent +from ._mouse_event import _MouseEvent + +_Event: TypeAlias = KeyboardEvent | _MouseEvent + +class GenericListener: + lock: ClassVar[Lock] + handlers: list[Callable[[_Event], bool | None]] + listening: bool + queue: Queue[_Event] + listening_thread: Thread | None + processing_thread: Thread | None + def invoke_handlers(self, event: _Event) -> Literal[1] | None: ... + def start_if_necessary(self) -> None: ... + def pre_process_event(self, event: _Event) -> None: ... + def process(self) -> None: ... + def add_handler(self, handler: Callable[[_Event], bool | None]) -> None: ... + def remove_handler(self, handler: Callable[[_Event], bool | None]) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/keyboard/keyboard/_keyboard_event.pyi b/packages/pyright-internal/typeshed-fallback/stubs/keyboard/keyboard/_keyboard_event.pyi new file mode 100644 index 000000000..9c511fdcc --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/keyboard/keyboard/_keyboard_event.pyi @@ -0,0 +1,28 @@ +from typing_extensions import Literal + +from ._canonical_names import canonical_names as canonical_names, normalize_name as normalize_name + +KEY_DOWN: Literal["down"] +KEY_UP: Literal["up"] + +class KeyboardEvent: + event_type: Literal["down", "up"] | None + scan_code: int + name: str | None + time: float | None + device: str | None + modifiers: tuple[str, ...] | None + is_keypad: bool | None + + def __init__( + self, + event_type: Literal["down", "up"] | None, + scan_code: int, + name: str | None = ..., + time: float | None = ..., + device: str | None = ..., + modifiers: tuple[str, ...] | None = ..., + is_keypad: bool | None = ..., + ) -> None: ... + def to_json(self, ensure_ascii: bool = ...) -> str: ... + def __eq__(self, other: object) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/keyboard/keyboard/_mouse_event.pyi b/packages/pyright-internal/typeshed-fallback/stubs/keyboard/keyboard/_mouse_event.pyi new file mode 100644 index 000000000..479fe4c9d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/keyboard/keyboard/_mouse_event.pyi @@ -0,0 +1,43 @@ +import sys +from typing import NamedTuple +from typing_extensions import Literal, TypeAlias + +_MouseEvent: TypeAlias = ButtonEvent | WheelEvent | MoveEvent # noqa: Y047 # Used outside + +LEFT: Literal["left"] +RIGHT: Literal["right"] +MIDDLE: Literal["middle"] +X: Literal["x"] +X2: Literal["x2"] + +UP: Literal["up"] +DOWN: Literal["down"] +DOUBLE: Literal["double"] +WHEEL: Literal["wheel"] + +VERTICAL: Literal["vertical"] +HORIZONTAL: Literal["horizontal"] + +if sys.platform == "linux" or sys.platform == "win32": + _MouseButton: TypeAlias = Literal["left", "right", "middle", "x", "x2"] +else: + _MouseButton: TypeAlias = Literal["left", "right", "middle"] + +if sys.platform == "win32": + _MouseEventType: TypeAlias = Literal["up", "down", "double", "wheel"] +else: + _MouseEventType: TypeAlias = Literal["up", "down"] + +class ButtonEvent(NamedTuple): + event_type: _MouseEventType + button: _MouseButton + time: float + +class WheelEvent(NamedTuple): + delta: int + time: float + +class MoveEvent(NamedTuple): + x: int + y: int + time: float diff --git a/packages/pyright-internal/typeshed-fallback/stubs/keyboard/keyboard/mouse.pyi b/packages/pyright-internal/typeshed-fallback/stubs/keyboard/keyboard/mouse.pyi new file mode 100644 index 000000000..48a10d234 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/keyboard/keyboard/mouse.pyi @@ -0,0 +1,78 @@ +import sys +from collections.abc import Callable, Iterable +from ctypes import c_long +from typing import SupportsInt, TypeVar +from typing_extensions import Literal, TypeAlias + +from ._generic import GenericListener as _GenericListener +from ._mouse_event import ( + DOUBLE as DOUBLE, + DOWN as DOWN, + LEFT as LEFT, + MIDDLE as MIDDLE, + RIGHT as RIGHT, + UP as UP, + X2 as X2, + ButtonEvent as ButtonEvent, + MoveEvent as MoveEvent, + WheelEvent as WheelEvent, + X as X, + _MouseButton, + _MouseEvent, + _MouseEventType, +) + +# mypy doesn't support PEP 646's TypeVarTuple yet: https://github.com/python/mypy/issues/12280 +# _Ts = TypeVarTuple("_Ts") +_Ts: TypeAlias = tuple[object, ...] +_Callback: TypeAlias = Callable[[_MouseEvent], bool | None] +_C = TypeVar("_C", bound=_Callback) + +class _MouseListener(_GenericListener): + def init(self) -> None: ... + def pre_process_event( # type: ignore[override] # Mouse specific events and return + self, event: _MouseEvent + ) -> Literal[True]: ... + def listen(self) -> None: ... + +def is_pressed(button: _MouseButton = ...) -> bool: ... +def press(button: _MouseButton = ...) -> None: ... +def release(button: _MouseButton = ...) -> None: ... +def click(button: _MouseButton = ...) -> None: ... +def double_click(button: _MouseButton = ...) -> None: ... +def right_click() -> None: ... +def wheel(delta: int = ...) -> None: ... +def move(x: SupportsInt, y: SupportsInt, absolute: bool = ..., duration: float = ...) -> None: ... +def drag(start_x: int, start_y: int, end_x: int, end_y: int, absolute: bool = ..., duration: float = ...) -> None: ... +def on_button( + callback: Callable[..., None], + args: _Ts = ..., + buttons: list[_MouseButton] | tuple[_MouseButton, ...] | _MouseButton = ..., + types: list[_MouseEventType] | tuple[_MouseEventType, ...] | _MouseEventType = ..., +) -> _Callback: ... +def on_click(callback: Callable[..., None], args: _Ts = ...) -> _Callback: ... +def on_double_click(callback: Callable[..., None], args: _Ts = ...) -> _Callback: ... +def on_right_click(callback: Callable[..., None], args: _Ts = ...) -> _Callback: ... +def on_middle_click(callback: Callable[..., None], args: _Ts = ...) -> _Callback: ... +def wait(button: _MouseButton = ..., target_types: tuple[_MouseEventType] = ...) -> None: ... + +if sys.platform == "win32": + def get_position() -> tuple[c_long, c_long]: ... + +else: + def get_position() -> tuple[int, int]: ... + +def hook(callback: _C) -> _C: ... +def unhook(callback: _Callback) -> None: ... +def unhook_all() -> None: ... +def record(button: _MouseButton = ..., target_types: tuple[_MouseEventType] = ...) -> _MouseEvent: ... +def play( + events: Iterable[_MouseEvent], + speed_factor: float = ..., + include_clicks: bool = ..., + include_moves: bool = ..., + include_wheel: bool = ..., +) -> None: ... + +replay = play +hold = press diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/METADATA.toml index 77ff5706c..9159fae4d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/METADATA.toml @@ -1,2 +1,10 @@ version = "2.9.*" -requires = [] # requires types-pyasn1 (not available yet) +requires = ["types-pyasn1"] + +[tool.stubtest] +ignore_missing_stub = true +apt_dependencies = ["libkrb5-dev"] +# No need to install on the CI. Leaving here as information for MacOs/Windows contributors. +# brew_dependencies = ["krb5"] +# choco_dependencies = ["mitkerberos"] +stubtest_requirements = ["gssapi"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/abstract/attrDef.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/abstract/attrDef.pyi index 980262393..609123f43 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/abstract/attrDef.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/abstract/attrDef.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any class AttrDef: @@ -16,18 +17,18 @@ class AttrDef: def __init__( self, name, - key: Any | None = ..., - validate: Any | None = ..., - pre_query: Any | None = ..., - post_query: Any | None = ..., + key: Incomplete | None = ..., + validate: Incomplete | None = ..., + pre_query: Incomplete | None = ..., + post_query: Incomplete | None = ..., default=..., - dereference_dn: Any | None = ..., - description: Any | None = ..., + dereference_dn: Incomplete | None = ..., + description: Incomplete | None = ..., mandatory: bool = ..., - single_value: Any | None = ..., - alias: Any | None = ..., + single_value: Incomplete | None = ..., + alias: Incomplete | None = ..., ) -> None: ... def __eq__(self, other): ... def __lt__(self, other): ... - def __hash__(self): ... - def __setattr__(self, key, value) -> None: ... + def __hash__(self) -> int: ... + def __setattr__(self, key: str, value) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/abstract/attribute.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/abstract/attribute.pyi index d5ed793db..d22ff5d2e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/abstract/attribute.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/abstract/attribute.pyi @@ -10,7 +10,7 @@ class Attribute: cursor: Any other_names: Any def __init__(self, attr_def, entry, cursor) -> None: ... - def __len__(self): ... + def __len__(self) -> int: ... def __iter__(self): ... def __getitem__(self, item): ... def __eq__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/abstract/cursor.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/abstract/cursor.pyi index ee27126af..0787f9d28 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/abstract/cursor.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/abstract/cursor.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any, NamedTuple class Operation(NamedTuple): @@ -19,14 +20,14 @@ class Cursor: connection, object_def, get_operational_attributes: bool = ..., - attributes: Any | None = ..., - controls: Any | None = ..., - auxiliary_class: Any | None = ..., + attributes: Incomplete | None = ..., + controls: Incomplete | None = ..., + auxiliary_class: Incomplete | None = ..., ) -> None: ... def __iter__(self): ... def __getitem__(self, item): ... - def __len__(self): ... - def __bool__(self): ... + def __len__(self) -> int: ... + def __bool__(self) -> bool: ... def match_dn(self, dn): ... def match(self, attributes, value): ... def remove(self, entry) -> None: ... @@ -55,9 +56,9 @@ class Reader(Cursor): components_in_and: bool = ..., sub_tree: bool = ..., get_operational_attributes: bool = ..., - attributes: Any | None = ..., - controls: Any | None = ..., - auxiliary_class: Any | None = ..., + attributes: Incomplete | None = ..., + controls: Incomplete | None = ..., + auxiliary_class: Incomplete | None = ..., ) -> None: ... @property def query(self): ... @@ -71,29 +72,36 @@ class Reader(Cursor): execution_time: Any entries: Any def reset(self) -> None: ... - def search(self, attributes: Any | None = ...): ... - def search_object(self, entry_dn: Any | None = ..., attributes: Any | None = ...): ... - def search_level(self, attributes: Any | None = ...): ... - def search_subtree(self, attributes: Any | None = ...): ... - def search_paged(self, paged_size, paged_criticality: bool = ..., generator: bool = ..., attributes: Any | None = ...): ... + def search(self, attributes: Incomplete | None = ...): ... + def search_object(self, entry_dn: Incomplete | None = ..., attributes: Incomplete | None = ...): ... + def search_level(self, attributes: Incomplete | None = ...): ... + def search_subtree(self, attributes: Incomplete | None = ...): ... + def search_paged( + self, paged_size, paged_criticality: bool = ..., generator: bool = ..., attributes: Incomplete | None = ... + ): ... class Writer(Cursor): entry_class: Any attribute_class: Any entry_initial_status: Any @staticmethod - def from_cursor(cursor, connection: Any | None = ..., object_def: Any | None = ..., custom_validator: Any | None = ...): ... + def from_cursor( + cursor, + connection: Incomplete | None = ..., + object_def: Incomplete | None = ..., + custom_validator: Incomplete | None = ..., + ): ... @staticmethod - def from_response(connection, object_def, response: Any | None = ...): ... + def from_response(connection, object_def, response: Incomplete | None = ...): ... dereference_aliases: Any def __init__( self, connection, object_def, get_operational_attributes: bool = ..., - attributes: Any | None = ..., - controls: Any | None = ..., - auxiliary_class: Any | None = ..., + attributes: Incomplete | None = ..., + controls: Incomplete | None = ..., + auxiliary_class: Incomplete | None = ..., ) -> None: ... execution_time: Any def commit(self, refresh: bool = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/abstract/entry.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/abstract/entry.pyi index b7392e22c..ef5929cc6 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/abstract/entry.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/abstract/entry.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any class EntryState: @@ -20,8 +21,8 @@ class EntryBase: def __init__(self, dn, cursor) -> None: ... def __iter__(self): ... def __contains__(self, item): ... - def __getattr__(self, item): ... - def __setattr__(self, item, value) -> None: ... + def __getattr__(self, item: str): ... + def __setattr__(self, item: str, value) -> None: ... def __getitem__(self, item): ... def __eq__(self, other): ... def __lt__(self, other): ... @@ -49,31 +50,35 @@ class EntryBase: raw: bool = ..., indent: int = ..., sort: bool = ..., - stream: Any | None = ..., + stream: Incomplete | None = ..., checked_attributes: bool = ..., include_empty: bool = ..., ): ... def entry_to_ldif( - self, all_base64: bool = ..., line_separator: Any | None = ..., sort_order: Any | None = ..., stream: Any | None = ... + self, + all_base64: bool = ..., + line_separator: Incomplete | None = ..., + sort_order: Incomplete | None = ..., + stream: Incomplete | None = ..., ): ... class Entry(EntryBase): def entry_writable( self, - object_def: Any | None = ..., - writer_cursor: Any | None = ..., - attributes: Any | None = ..., - custom_validator: Any | None = ..., - auxiliary_class: Any | None = ..., + object_def: Incomplete | None = ..., + writer_cursor: Incomplete | None = ..., + attributes: Incomplete | None = ..., + custom_validator: Incomplete | None = ..., + auxiliary_class: Incomplete | None = ..., ): ... class WritableEntry(EntryBase): def __setitem__(self, key, value) -> None: ... - def __setattr__(self, item, value) -> None: ... - def __getattr__(self, item): ... + def __setattr__(self, item: str, value) -> None: ... + def __getattr__(self, item: str): ... @property def entry_virtual_attributes(self): ... - def entry_commit_changes(self, refresh: bool = ..., controls: Any | None = ..., clear_history: bool = ...): ... + def entry_commit_changes(self, refresh: bool = ..., controls: Incomplete | None = ..., clear_history: bool = ...): ... def entry_discard_changes(self) -> None: ... def entry_delete(self) -> None: ... def entry_refresh(self, tries: int = ..., seconds: int = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/abstract/objectDef.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/abstract/objectDef.pyi index 31931796f..f7a449cf8 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/abstract/objectDef.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/abstract/objectDef.pyi @@ -1,23 +1,23 @@ -from typing import Any +from _typeshed import Incomplete class ObjectDef: def __init__( self, - object_class: Any | None = ..., - schema: Any | None = ..., - custom_validator: Any | None = ..., - auxiliary_class: Any | None = ..., + object_class: Incomplete | None = ..., + schema: Incomplete | None = ..., + custom_validator: Incomplete | None = ..., + auxiliary_class: Incomplete | None = ..., ) -> None: ... def __getitem__(self, item): ... - def __getattr__(self, item): ... - def __setattr__(self, key, value) -> None: ... + def __getattr__(self, item: str): ... + def __setattr__(self, key: str, value) -> None: ... def __iadd__(self, other): ... def __isub__(self, other): ... def __iter__(self): ... - def __len__(self): ... - def __bool__(self): ... + def __len__(self) -> int: ... + def __bool__(self) -> bool: ... def __contains__(self, item): ... def add_from_schema(self, attribute_name, mandatory: bool = ...) -> None: ... - def add_attribute(self, definition: Any | None = ...) -> None: ... + def add_attribute(self, definition: Incomplete | None = ...) -> None: ... def remove_attribute(self, item) -> None: ... def clear_attributes(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/core/connection.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/core/connection.pyi index 503abeebb..0e5b29c7a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/core/connection.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/core/connection.pyi @@ -1,68 +1,69 @@ from _collections_abc import Generator, dict_keys -from _typeshed import Self +from _typeshed import Incomplete, ReadableBuffer from types import TracebackType -from typing import Any -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal, Self, TypeAlias + +from pyasn1.type.base import Asn1Item from .pooling import ServerPool from .server import Server -SASL_AVAILABLE_MECHANISMS: Any -CLIENT_STRATEGIES: Any +SASL_AVAILABLE_MECHANISMS: Incomplete +CLIENT_STRATEGIES: Incomplete _ServerSequence: TypeAlias = ( - set[Server] | list[Server] | tuple[Server, ...] | Generator[Server, None, None] | dict_keys[Server, Any] + set[Server] | list[Server] | tuple[Server, ...] | Generator[Server, None, None] | dict_keys[Server, Incomplete] ) class Connection: - connection_lock: Any + connection_lock: Incomplete last_error: str - strategy_type: Any - user: Any - password: Any - authentication: Any - version: Any - auto_referrals: Any - request: Any - response: Any | None - result: Any + strategy_type: Incomplete + user: Incomplete + password: Incomplete + authentication: Incomplete + version: Incomplete + auto_referrals: Incomplete + request: Incomplete + response: Incomplete | None + result: Incomplete bound: bool listening: bool closed: bool - auto_bind: Any - sasl_mechanism: Any - sasl_credentials: Any - socket: Any + auto_bind: Incomplete + sasl_mechanism: Incomplete + sasl_credentials: Incomplete + socket: Incomplete tls_started: bool sasl_in_progress: bool - read_only: Any - lazy: Any - pool_name: Any + read_only: Incomplete + lazy: Incomplete + pool_name: Incomplete pool_size: int | None - cred_store: Any - pool_lifetime: Any - pool_keepalive: Any + cred_store: Incomplete + pool_lifetime: Incomplete + pool_keepalive: Incomplete starting_tls: bool - check_names: Any - raise_exceptions: Any - auto_range: Any - extend: Any - fast_decoder: Any - receive_timeout: Any - empty_attributes: Any - use_referral_cache: Any - auto_escape: Any - auto_encode: Any - source_address: Any - source_port_list: Any - server_pool: Any | None - server: Any - strategy: Any - send: Any - open: Any - get_response: Any - post_send_single_response: Any - post_send_search: Any + check_names: Incomplete + raise_exceptions: Incomplete + auto_range: Incomplete + extend: Incomplete + fast_decoder: Incomplete + receive_timeout: Incomplete + empty_attributes: Incomplete + use_referral_cache: Incomplete + auto_escape: Incomplete + auto_encode: Incomplete + source_address: Incomplete + source_port_list: Incomplete + server_pool: Incomplete | None + server: Incomplete + strategy: Incomplete + send: Incomplete + open: Incomplete + get_response: Incomplete + post_send_single_response: Incomplete + post_send_search: Incomplete def __init__( self, server: Server | str | _ServerSequence | ServerPool, @@ -72,12 +73,21 @@ class Connection: version: int = ..., authentication: Literal["ANONYMOUS", "SIMPLE", "SASL", "NTLM"] | None = ..., client_strategy: Literal[ - "SYNC", "SAFE_SYNC", "ASYNC", "LDIF", "RESTARTABLE", "REUSABLE", "MOCK_SYNC", "MOCK_ASYNC", "ASYNC_STREAM" + "SYNC", + "SAFE_RESTARTABLE", + "SAFE_SYNC", + "ASYNC", + "LDIF", + "RESTARTABLE", + "REUSABLE", + "MOCK_SYNC", + "MOCK_ASYNC", + "ASYNC_STREAM", ] = ..., auto_referrals: bool = ..., auto_range: bool = ..., sasl_mechanism: str | None = ..., - sasl_credentials: Any | None = ..., + sasl_credentials: Incomplete | None = ..., check_names: bool = ..., collect_usage: bool = ..., read_only: bool = ..., @@ -86,17 +96,17 @@ class Connection: pool_name: str | None = ..., pool_size: int | None = ..., pool_lifetime: int | None = ..., - cred_store: Any | None = ..., + cred_store: Incomplete | None = ..., fast_decoder: bool = ..., - receive_timeout: Any | None = ..., + receive_timeout: Incomplete | None = ..., return_empty_attributes: bool = ..., use_referral_cache: bool = ..., auto_escape: bool = ..., auto_encode: bool = ..., - pool_keepalive: Any | None = ..., + pool_keepalive: Incomplete | None = ..., source_address: str | None = ..., source_port: int | None = ..., - source_port_list: Any | None = ..., + source_port_list: Incomplete | None = ..., ) -> None: ... def repr_with_sensitive_data_stripped(self): ... @property @@ -105,49 +115,55 @@ class Connection: def stream(self, value) -> None: ... @property def usage(self): ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None ) -> Literal[False] | None: ... - def bind(self, read_server_info: bool = ..., controls: Any | None = ...): ... + def bind(self, read_server_info: bool = ..., controls: Incomplete | None = ...): ... def rebind( self, - user: Any | None = ..., - password: Any | None = ..., - authentication: Any | None = ..., - sasl_mechanism: Any | None = ..., - sasl_credentials: Any | None = ..., + user: Incomplete | None = ..., + password: Incomplete | None = ..., + authentication: Incomplete | None = ..., + sasl_mechanism: Incomplete | None = ..., + sasl_credentials: Incomplete | None = ..., read_server_info: bool = ..., - controls: Any | None = ..., + controls: Incomplete | None = ..., ): ... - def unbind(self, controls: Any | None = ...): ... + def unbind(self, controls: Incomplete | None = ...): ... def search( self, search_base: str, search_filter: str, search_scope: Literal["BASE", "LEVEL", "SUBTREE"] = ..., dereference_aliases: Literal["NEVER", "SEARCH", "FINDING_BASE", "ALWAYS"] = ..., - attributes: Any | None = ..., + attributes: Incomplete | None = ..., size_limit: int = ..., time_limit: int = ..., types_only: bool = ..., get_operational_attributes: bool = ..., - controls: Any | None = ..., + controls: Incomplete | None = ..., paged_size: int | None = ..., paged_criticality: bool = ..., paged_cookie: str | bytes | None = ..., auto_escape: bool | None = ..., ): ... - def compare(self, dn, attribute, value, controls: Any | None = ...): ... - def add(self, dn, object_class: Any | None = ..., attributes: Any | None = ..., controls: Any | None = ...): ... - def delete(self, dn, controls: Any | None = ...): ... - def modify(self, dn, changes, controls: Any | None = ...): ... + def compare(self, dn, attribute, value, controls: Incomplete | None = ...): ... + def add( + self, dn, object_class: Incomplete | None = ..., attributes: Incomplete | None = ..., controls: Incomplete | None = ... + ): ... + def delete(self, dn, controls: Incomplete | None = ...): ... + def modify(self, dn, changes, controls: Incomplete | None = ...): ... def modify_dn( - self, dn, relative_dn, delete_old_dn: bool = ..., new_superior: Any | None = ..., controls: Any | None = ... + self, dn, relative_dn, delete_old_dn: bool = ..., new_superior: Incomplete | None = ..., controls: Incomplete | None = ... ): ... - def abandon(self, message_id, controls: Any | None = ...): ... + def abandon(self, message_id, controls: Incomplete | None = ...): ... def extended( - self, request_name, request_value: Any | None = ..., controls: Any | None = ..., no_encode: Any | None = ... + self, + request_name, + request_value: Asn1Item | ReadableBuffer | None = ..., + controls: Incomplete | None = ..., + no_encode: bool | None = ..., ): ... def start_tls(self, read_server_info: bool = ...): ... def do_sasl_bind(self, controls): ... @@ -155,19 +171,19 @@ class Connection: def refresh_server_info(self) -> None: ... def response_to_ldif( self, - search_result: Any | None = ..., + search_result: Incomplete | None = ..., all_base64: bool = ..., - line_separator: Any | None = ..., - sort_order: Any | None = ..., - stream: Any | None = ..., + line_separator: Incomplete | None = ..., + sort_order: Incomplete | None = ..., + stream: Incomplete | None = ..., ): ... def response_to_json( self, raw: bool = ..., - search_result: Any | None = ..., + search_result: Incomplete | None = ..., indent: int = ..., sort: bool = ..., - stream: Any | None = ..., + stream: Incomplete | None = ..., checked_attributes: bool = ..., include_empty: bool = ..., ): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/core/exceptions.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/core/exceptions.pyi index 3958f7cb3..7da6a70af 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/core/exceptions.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/core/exceptions.pyi @@ -1,18 +1,19 @@ import socket -from _typeshed import Self +from _typeshed import Incomplete from typing import Any +from typing_extensions import Self class LDAPException(Exception): ... class LDAPOperationResult(LDAPException): def __new__( - cls: type[Self], - result: Any | None = ..., - description: Any | None = ..., - dn: Any | None = ..., - message: Any | None = ..., - response_type: Any | None = ..., - response: Any | None = ..., + cls, + result: Incomplete | None = ..., + description: Incomplete | None = ..., + dn: Incomplete | None = ..., + message: Incomplete | None = ..., + response_type: Incomplete | None = ..., + response: Incomplete | None = ..., ) -> Self: ... result: Any description: Any @@ -22,12 +23,12 @@ class LDAPOperationResult(LDAPException): response: Any def __init__( self, - result: Any | None = ..., - description: Any | None = ..., - dn: Any | None = ..., - message: Any | None = ..., - response_type: Any | None = ..., - response: Any | None = ..., + result: Incomplete | None = ..., + description: Incomplete | None = ..., + dn: Incomplete | None = ..., + message: Incomplete | None = ..., + response_type: Incomplete | None = ..., + response: Incomplete | None = ..., ) -> None: ... class LDAPOperationsErrorResult(LDAPOperationResult): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/core/pooling.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/core/pooling.pyi index 088c73e1f..e468fa9c4 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/core/pooling.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/core/pooling.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any POOLING_STRATEGIES: Any @@ -20,7 +21,7 @@ class ServerPoolState: def get_server(self): ... def find_active_random_server(self): ... def find_active_server(self, starting): ... - def __len__(self): ... + def __len__(self) -> int: ... class ServerPool: servers: Any @@ -30,9 +31,14 @@ class ServerPool: single: Any strategy: Any def __init__( - self, servers: Any | None = ..., pool_strategy=..., active: bool = ..., exhaust: bool = ..., single_state: bool = ... + self, + servers: Incomplete | None = ..., + pool_strategy=..., + active: bool = ..., + exhaust: bool = ..., + single_state: bool = ..., ) -> None: ... - def __len__(self): ... + def __len__(self) -> int: ... def __getitem__(self, item): ... def __iter__(self): ... def add(self, servers) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/core/server.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/core/server.pyi index 9594d6bdc..870ddbab9 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/core/server.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/core/server.pyi @@ -1,10 +1,7 @@ -import sys +from _typeshed import Incomplete from typing import Any from typing_extensions import Literal -if sys.platform != "win32": - from socket import AF_UNIX as AF_UNIX - unix_socket_available: bool class Server: @@ -27,26 +24,29 @@ class Server: host: str, port: int | None = ..., use_ssl: bool = ..., - allowed_referral_hosts: Any | None = ..., + allowed_referral_hosts: Incomplete | None = ..., get_info: Literal["NO_INFO", "DSA", "SCHEMA", "ALL"] = ..., - tls: Any | None = ..., - formatter: Any | None = ..., - connect_timeout: Any | None = ..., + tls: Incomplete | None = ..., + formatter: Incomplete | None = ..., + connect_timeout: Incomplete | None = ..., mode: Literal["IP_SYSTEM_DEFAULT", "IP_V4_ONLY", "IP_V6_ONLY", "IP_V4_PREFERRED", "IP_V6_PREFERRED"] = ..., - validator: Any | None = ..., + validator: Incomplete | None = ..., ) -> None: ... @property def address_info(self): ... def update_availability(self, address, available) -> None: ... def reset_availability(self) -> None: ... def check_availability( - self, source_address: Any | None = ..., source_port: Any | None = ..., source_port_list: Any | None = ... + self, + source_address: Incomplete | None = ..., + source_port: Incomplete | None = ..., + source_port_list: Incomplete | None = ..., ): ... @staticmethod def next_message_id(): ... def get_info_from_server(self, connection) -> None: ... - def attach_dsa_info(self, dsa_info: Any | None = ...) -> None: ... - def attach_schema_info(self, dsa_schema: Any | None = ...) -> None: ... + def attach_dsa_info(self, dsa_info: Incomplete | None = ...) -> None: ... + def attach_schema_info(self, dsa_schema: Incomplete | None = ...) -> None: ... @property def info(self): ... @property @@ -56,10 +56,10 @@ class Server: host, dsa_info, dsa_schema, - port: Any | None = ..., + port: Incomplete | None = ..., use_ssl: bool = ..., - formatter: Any | None = ..., - validator: Any | None = ..., + formatter: Incomplete | None = ..., + validator: Incomplete | None = ..., ): ... def candidate_addresses(self): ... def has_control(self, control): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/core/tls.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/core/tls.pyi index c776f7f88..240c93b24 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/core/tls.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/core/tls.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any use_ssl_context: bool @@ -17,18 +18,18 @@ class Tls: sni: Any def __init__( self, - local_private_key_file: Any | None = ..., - local_certificate_file: Any | None = ..., + local_private_key_file: Incomplete | None = ..., + local_certificate_file: Incomplete | None = ..., validate=..., - version: Any | None = ..., - ssl_options: Any | None = ..., - ca_certs_file: Any | None = ..., - valid_names: Any | None = ..., - ca_certs_path: Any | None = ..., - ca_certs_data: Any | None = ..., - local_private_key_password: Any | None = ..., - ciphers: Any | None = ..., - sni: Any | None = ..., + version: Incomplete | None = ..., + ssl_options: Incomplete | None = ..., + ca_certs_file: Incomplete | None = ..., + valid_names: Incomplete | None = ..., + ca_certs_path: Incomplete | None = ..., + ca_certs_data: Incomplete | None = ..., + local_private_key_password: Incomplete | None = ..., + ciphers: Incomplete | None = ..., + sni: Incomplete | None = ..., ) -> None: ... def wrap_socket(self, connection, do_handshake: bool = ...) -> None: ... def start_tls(self, connection): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/__init__.pyi index 61ca6f486..e87b55ee9 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/__init__.pyi @@ -1,18 +1,19 @@ +from _typeshed import Incomplete from typing import Any class ExtendedOperationContainer: def __init__(self, connection) -> None: ... class StandardExtendedOperations(ExtendedOperationContainer): - def who_am_i(self, controls: Any | None = ...): ... + def who_am_i(self, controls: Incomplete | None = ...): ... def modify_password( self, - user: Any | None = ..., - old_password: Any | None = ..., - new_password: Any | None = ..., - hash_algorithm: Any | None = ..., - salt: Any | None = ..., - controls: Any | None = ..., + user: Incomplete | None = ..., + old_password: Incomplete | None = ..., + new_password: Incomplete | None = ..., + hash_algorithm: Incomplete | None = ..., + salt: Incomplete | None = ..., + controls: Incomplete | None = ..., ): ... def paged_search( self, @@ -20,12 +21,12 @@ class StandardExtendedOperations(ExtendedOperationContainer): search_filter, search_scope=..., dereference_aliases=..., - attributes: Any | None = ..., + attributes: Incomplete | None = ..., size_limit: int = ..., time_limit: int = ..., types_only: bool = ..., get_operational_attributes: bool = ..., - controls: Any | None = ..., + controls: Incomplete | None = ..., paged_size: int = ..., paged_criticality: bool = ..., generator: bool = ..., @@ -39,7 +40,7 @@ class StandardExtendedOperations(ExtendedOperationContainer): attributes=..., size_limit: int = ..., time_limit: int = ..., - controls: Any | None = ..., + controls: Incomplete | None = ..., changes_only: bool = ..., show_additions: bool = ..., show_deletions: bool = ..., @@ -47,7 +48,7 @@ class StandardExtendedOperations(ExtendedOperationContainer): show_dn_modifications: bool = ..., notifications: bool = ..., streaming: bool = ..., - callback: Any | None = ..., + callback: Incomplete | None = ..., ): ... def funnel_search( self, @@ -58,20 +59,20 @@ class StandardExtendedOperations(ExtendedOperationContainer): attributes=..., size_limit: int = ..., time_limit: int = ..., - controls: Any | None = ..., + controls: Incomplete | None = ..., streaming: bool = ..., - callback: Any | None = ..., + callback: Incomplete | None = ..., ): ... class NovellExtendedOperations(ExtendedOperationContainer): - def get_bind_dn(self, controls: Any | None = ...): ... - def get_universal_password(self, user, controls: Any | None = ...): ... - def set_universal_password(self, user, new_password: Any | None = ..., controls: Any | None = ...): ... - def list_replicas(self, server_dn, controls: Any | None = ...): ... - def partition_entry_count(self, partition_dn, controls: Any | None = ...): ... - def replica_info(self, server_dn, partition_dn, controls: Any | None = ...): ... - def start_transaction(self, controls: Any | None = ...): ... - def end_transaction(self, commit: bool = ..., controls: Any | None = ...): ... + def get_bind_dn(self, controls: Incomplete | None = ...): ... + def get_universal_password(self, user, controls: Incomplete | None = ...): ... + def set_universal_password(self, user, new_password: Incomplete | None = ..., controls: Incomplete | None = ...): ... + def list_replicas(self, server_dn, controls: Incomplete | None = ...): ... + def partition_entry_count(self, partition_dn, controls: Incomplete | None = ...): ... + def replica_info(self, server_dn, partition_dn, controls: Incomplete | None = ...): ... + def start_transaction(self, controls: Incomplete | None = ...): ... + def end_transaction(self, commit: bool = ..., controls: Incomplete | None = ...): ... def add_members_to_groups(self, members, groups, fix: bool = ..., transaction: bool = ...): ... def remove_members_from_groups(self, members, groups, fix: bool = ..., transaction: bool = ...): ... def check_groups_memberships(self, members, groups, fix: bool = ..., transaction: bool = ...): ... @@ -82,7 +83,7 @@ class MicrosoftExtendedOperations(ExtendedOperationContainer): sync_base, sync_filter: str = ..., attributes=..., - cookie: Any | None = ..., + cookie: Incomplete | None = ..., object_security: bool = ..., ancestors_first: bool = ..., public_data_only: bool = ..., @@ -90,12 +91,12 @@ class MicrosoftExtendedOperations(ExtendedOperationContainer): max_length: int = ..., hex_guid: bool = ..., ): ... - def modify_password(self, user, new_password, old_password: Any | None = ..., controls: Any | None = ...): ... + def modify_password(self, user, new_password, old_password: Incomplete | None = ..., controls: Incomplete | None = ...): ... def unlock_account(self, user): ... def add_members_to_groups(self, members, groups, fix: bool = ...): ... def remove_members_from_groups(self, members, groups, fix: bool = ...): ... def persistent_search( - self, search_base: str = ..., search_scope=..., attributes=..., streaming: bool = ..., callback: Any | None = ... + self, search_base: str = ..., search_scope=..., attributes=..., streaming: bool = ..., callback: Incomplete | None = ... ): ... class ExtendedOperationsRoot(ExtendedOperationContainer): diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/microsoft/modifyPassword.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/microsoft/modifyPassword.pyi index 5b3d27a0f..454a1bd7e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/microsoft/modifyPassword.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/microsoft/modifyPassword.pyi @@ -1,3 +1,3 @@ -from typing import Any +from _typeshed import Incomplete -def ad_modify_password(connection, user_dn, new_password, old_password, controls: Any | None = ...): ... +def ad_modify_password(connection, user_dn, new_password, old_password, controls: Incomplete | None = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/microsoft/persistentSearch.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/microsoft/persistentSearch.pyi index 95fca82fc..18c01eb54 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/microsoft/persistentSearch.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/microsoft/persistentSearch.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any class ADPersistentSearch: @@ -11,5 +12,5 @@ class ADPersistentSearch: def __init__(self, connection, search_base, search_scope, attributes, streaming, callback) -> None: ... def start(self) -> None: ... def stop(self, unbind: bool = ...) -> None: ... - def next(self, block: bool = ..., timeout: Any | None = ...): ... - def funnel(self, block: bool = ..., timeout: Any | None = ...) -> None: ... + def next(self, block: bool = ..., timeout: Incomplete | None = ...): ... + def funnel(self, block: bool = ..., timeout: Incomplete | None = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/microsoft/unlockAccount.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/microsoft/unlockAccount.pyi index 842378089..8dd6f01e5 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/microsoft/unlockAccount.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/microsoft/unlockAccount.pyi @@ -1,3 +1,3 @@ -from typing import Any +from _typeshed import Incomplete -def ad_unlock_account(connection, user_dn, controls: Any | None = ...): ... +def ad_unlock_account(connection, user_dn, controls: Incomplete | None = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/endTransaction.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/endTransaction.pyi index f0e8c5896..d0b07c285 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/endTransaction.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/endTransaction.pyi @@ -1,14 +1,15 @@ -from typing import Any +from _typeshed import Incomplete from ...extend.operation import ExtendedOperation +from ...protocol.novell import EndGroupTypeRequestValue, EndGroupTypeResponseValue class EndTransaction(ExtendedOperation): request_name: str response_name: str - request_value: Any - asn1_spec: Any + request_value: EndGroupTypeRequestValue + asn1_spec: EndGroupTypeResponseValue def config(self) -> None: ... - def __init__(self, connection, commit: bool = ..., controls: Any | None = ...) -> None: ... + def __init__(self, connection, commit: bool = ..., controls: Incomplete | None = ...) -> None: ... def populate_result(self) -> None: ... - response_value: Any + response_value: Incomplete def set_response(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/getBindDn.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/getBindDn.pyi index 4c194ce82..3e9e9c40b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/getBindDn.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/getBindDn.pyi @@ -1,11 +1,10 @@ -from typing import Any - from ...extend.operation import ExtendedOperation +from ...protocol.novell import Identity class GetBindDn(ExtendedOperation): request_name: str response_name: str response_attribute: str - asn1_spec: Any + asn1_spec: Identity def config(self) -> None: ... def populate_result(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/listReplicas.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/listReplicas.pyi index 0c7b6e7a8..ec94538a1 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/listReplicas.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/listReplicas.pyi @@ -1,13 +1,15 @@ -from typing import Any +from _typeshed import Incomplete from ...extend.operation import ExtendedOperation +from ...protocol.novell import ReplicaList +from ...protocol.rfc4511 import LDAPDN class ListReplicas(ExtendedOperation): request_name: str response_name: str - request_value: Any - asn1_spec: Any + request_value: LDAPDN + asn1_spec: ReplicaList response_attribute: str def config(self) -> None: ... - def __init__(self, connection, server_dn, controls: Any | None = ...) -> None: ... + def __init__(self, connection, server_dn, controls: Incomplete | None = ...) -> None: ... def populate_result(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/nmasGetUniversalPassword.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/nmasGetUniversalPassword.pyi index 59d0f1ca3..bc467cd51 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/nmasGetUniversalPassword.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/nmasGetUniversalPassword.pyi @@ -1,13 +1,14 @@ -from typing import Any +from _typeshed import Incomplete from ...extend.operation import ExtendedOperation +from ...protocol.novell import NmasGetUniversalPasswordRequestValue, NmasGetUniversalPasswordResponseValue class NmasGetUniversalPassword(ExtendedOperation): request_name: str response_name: str - request_value: Any - asn1_spec: Any + request_value: NmasGetUniversalPasswordRequestValue + asn1_spec: NmasGetUniversalPasswordResponseValue response_attribute: str def config(self) -> None: ... - def __init__(self, connection, user, controls: Any | None = ...) -> None: ... + def __init__(self, connection, user, controls: Incomplete | None = ...) -> None: ... def populate_result(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/nmasSetUniversalPassword.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/nmasSetUniversalPassword.pyi index a35b984ba..de23d84d4 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/nmasSetUniversalPassword.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/nmasSetUniversalPassword.pyi @@ -1,13 +1,14 @@ -from typing import Any +from _typeshed import Incomplete from ...extend.operation import ExtendedOperation +from ...protocol.novell import NmasSetUniversalPasswordRequestValue, NmasSetUniversalPasswordResponseValue class NmasSetUniversalPassword(ExtendedOperation): request_name: str response_name: str - request_value: Any - asn1_spec: Any + request_value: NmasSetUniversalPasswordRequestValue + asn1_spec: NmasSetUniversalPasswordResponseValue response_attribute: str def config(self) -> None: ... - def __init__(self, connection, user, new_password, controls: Any | None = ...) -> None: ... + def __init__(self, connection, user, new_password, controls: Incomplete | None = ...) -> None: ... def populate_result(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/partition_entry_count.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/partition_entry_count.pyi index a9127983a..cd2e1c077 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/partition_entry_count.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/partition_entry_count.pyi @@ -1,12 +1,13 @@ -from typing import Any +from _typeshed import Incomplete +from ...protocol.rfc4511 import LDAPDN from ..operation import ExtendedOperation class PartitionEntryCount(ExtendedOperation): request_name: str response_name: str - request_value: Any + request_value: LDAPDN response_attribute: str def config(self) -> None: ... - def __init__(self, connection, partition_dn, controls: Any | None = ...) -> None: ... + def __init__(self, connection, partition_dn, controls: Incomplete | None = ...) -> None: ... def populate_result(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/replicaInfo.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/replicaInfo.pyi index 6a4358053..a9405d21d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/replicaInfo.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/replicaInfo.pyi @@ -1,12 +1,13 @@ -from typing import Any +from _typeshed import Incomplete +from ...protocol.novell import ReplicaInfoRequestValue from ..operation import ExtendedOperation class ReplicaInfo(ExtendedOperation): request_name: str response_name: str - request_value: Any + request_value: ReplicaInfoRequestValue response_attribute: str def config(self) -> None: ... - def __init__(self, connection, server_dn, partition_dn, controls: Any | None = ...) -> None: ... + def __init__(self, connection, server_dn, partition_dn, controls: Incomplete | None = ...) -> None: ... def populate_result(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/startTransaction.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/startTransaction.pyi index 74dd78c5c..e013b81a2 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/startTransaction.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/startTransaction.pyi @@ -1,14 +1,15 @@ -from typing import Any +from _typeshed import Incomplete from ...extend.operation import ExtendedOperation +from ...protocol.novell import CreateGroupTypeRequestValue, CreateGroupTypeResponseValue class StartTransaction(ExtendedOperation): request_name: str response_name: str - request_value: Any - asn1_spec: Any + request_value: CreateGroupTypeRequestValue + asn1_spec: CreateGroupTypeResponseValue def config(self) -> None: ... - def __init__(self, connection, controls: Any | None = ...) -> None: ... + def __init__(self, connection, controls: Incomplete | None = ...) -> None: ... def populate_result(self) -> None: ... - response_value: Any + response_value: Incomplete def set_response(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/operation.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/operation.pyi index 4b14b4b53..e07b81421 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/operation.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/operation.pyi @@ -1,19 +1,21 @@ -from typing import Any +from _typeshed import Incomplete + +from pyasn1.type.base import Asn1Type class ExtendedOperation: - connection: Any - decoded_response: Any - result: Any - asn1_spec: Any - request_name: Any - response_name: Any - request_value: Any - response_value: Any - response_attribute: Any - controls: Any - def __init__(self, connection, controls: Any | None = ...) -> None: ... + connection: Incomplete + decoded_response: Incomplete | None + result: Incomplete | None + asn1_spec: Asn1Type | None + request_name: Incomplete | None + response_name: Incomplete | None + request_value: Asn1Type | None + response_value: Incomplete | None + response_attribute: Incomplete | None + controls: Incomplete + def __init__(self, connection, controls: Incomplete | None = ...) -> None: ... def send(self): ... def populate_result(self) -> None: ... - def decode_response(self, response: Any | None = ...) -> None: ... + def decode_response(self, response: Incomplete | None = ...) -> None: ... def set_response(self) -> None: ... def config(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/standard/PagedSearch.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/standard/PagedSearch.pyi index 741f7c5b9..bf75db7e9 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/standard/PagedSearch.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/standard/PagedSearch.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete def paged_search_generator( connection, @@ -6,12 +6,12 @@ def paged_search_generator( search_filter, search_scope=..., dereference_aliases=..., - attributes: Any | None = ..., + attributes: Incomplete | None = ..., size_limit: int = ..., time_limit: int = ..., types_only: bool = ..., get_operational_attributes: bool = ..., - controls: Any | None = ..., + controls: Incomplete | None = ..., paged_size: int = ..., paged_criticality: bool = ..., ) -> None: ... @@ -21,12 +21,12 @@ def paged_search_accumulator( search_filter, search_scope=..., dereference_aliases=..., - attributes: Any | None = ..., + attributes: Incomplete | None = ..., size_limit: int = ..., time_limit: int = ..., types_only: bool = ..., get_operational_attributes: bool = ..., - controls: Any | None = ..., + controls: Incomplete | None = ..., paged_size: int = ..., paged_criticality: bool = ..., ): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/standard/PersistentSearch.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/standard/PersistentSearch.pyi index 3af402ec3..bc3c9c087 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/standard/PersistentSearch.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/standard/PersistentSearch.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any class PersistentSearch: @@ -32,5 +33,5 @@ class PersistentSearch: ) -> None: ... def start(self) -> None: ... def stop(self, unbind: bool = ...) -> None: ... - def next(self, block: bool = ..., timeout: Any | None = ...): ... - def funnel(self, block: bool = ..., timeout: Any | None = ...) -> None: ... + def next(self, block: bool = ..., timeout: Incomplete | None = ...): ... + def funnel(self, block: bool = ..., timeout: Incomplete | None = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/standard/modifyPassword.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/standard/modifyPassword.pyi index 5df4b6d1e..37698dcee 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/standard/modifyPassword.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/standard/modifyPassword.pyi @@ -1,21 +1,22 @@ -from typing import Any +from _typeshed import Incomplete from ...extend.operation import ExtendedOperation +from ...protocol.rfc3062 import PasswdModifyRequestValue, PasswdModifyResponseValue class ModifyPassword(ExtendedOperation): request_name: str - request_value: Any - asn1_spec: Any + request_value: PasswdModifyRequestValue + asn1_spec: PasswdModifyResponseValue response_attribute: str def config(self) -> None: ... def __init__( self, connection, - user: Any | None = ..., - old_password: Any | None = ..., - new_password: Any | None = ..., - hash_algorithm: Any | None = ..., - salt: Any | None = ..., - controls: Any | None = ..., + user: Incomplete | None = ..., + old_password: Incomplete | None = ..., + new_password: Incomplete | None = ..., + hash_algorithm: Incomplete | None = ..., + salt: Incomplete | None = ..., + controls: Incomplete | None = ..., ) -> None: ... def populate_result(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/add.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/add.pyi index 59d87bae8..956aa7446 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/add.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/add.pyi @@ -1,7 +1,7 @@ -from typing import Any +from _typeshed import Incomplete def add_operation( - dn, attributes, auto_encode, schema: Any | None = ..., validator: Any | None = ..., check_names: bool = ... + dn, attributes, auto_encode, schema: Incomplete | None = ..., validator: Incomplete | None = ..., check_names: bool = ... ): ... def add_request_to_dict(request): ... def add_response_to_dict(response): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/bind.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/bind.pyi index 5079a87da..d6572b7f1 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/bind.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/bind.pyi @@ -1,12 +1,12 @@ -from typing import Any +from _typeshed import Incomplete def bind_operation( version, authentication, name: str = ..., - password: Any | None = ..., - sasl_mechanism: Any | None = ..., - sasl_credentials: Any | None = ..., + password: Incomplete | None = ..., + sasl_mechanism: Incomplete | None = ..., + sasl_credentials: Incomplete | None = ..., auto_encode: bool = ..., ): ... def bind_request_to_dict(request): ... @@ -14,8 +14,8 @@ def bind_response_operation( result_code, matched_dn: str = ..., diagnostic_message: str = ..., - referral: Any | None = ..., - server_sasl_credentials: Any | None = ..., + referral: Incomplete | None = ..., + server_sasl_credentials: Incomplete | None = ..., ): ... def bind_response_to_dict(response): ... def sicily_bind_response_to_dict(response): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/compare.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/compare.pyi index 4b12d3547..16003f1c7 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/compare.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/compare.pyi @@ -1,7 +1,13 @@ -from typing import Any +from _typeshed import Incomplete def compare_operation( - dn, attribute, value, auto_encode, schema: Any | None = ..., validator: Any | None = ..., check_names: bool = ... + dn, + attribute, + value, + auto_encode, + schema: Incomplete | None = ..., + validator: Incomplete | None = ..., + check_names: bool = ..., ): ... def compare_request_to_dict(request): ... def compare_response_to_dict(response): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/extended.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/extended.pyi index 2cc46be69..470849ed2 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/extended.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/extended.pyi @@ -1,6 +1,12 @@ -from typing import Any +from _typeshed import ReadableBuffer -def extended_operation(request_name, request_value: Any | None = ..., no_encode: Any | None = ...): ... +from pyasn1.type.base import Asn1Item + +from ..protocol.rfc4511 import ExtendedRequest + +def extended_operation( + request_name, request_value: Asn1Item | ReadableBuffer | None = ..., no_encode: bool | None = ... +) -> ExtendedRequest: ... def extended_request_to_dict(request): ... def extended_response_to_dict(response): ... def intermediate_response_to_dict(response): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/modify.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/modify.pyi index 8700499b9..5094e52d8 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/modify.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/modify.pyi @@ -1,9 +1,10 @@ +from _typeshed import Incomplete from typing import Any change_table: Any def modify_operation( - dn, changes, auto_encode, schema: Any | None = ..., validator: Any | None = ..., check_names: bool = ... + dn, changes, auto_encode, schema: Incomplete | None = ..., validator: Incomplete | None = ..., check_names: bool = ... ): ... def modify_request_to_dict(request): ... def modify_response_to_dict(response): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/modifyDn.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/modifyDn.pyi index db754b8fa..acf50577a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/modifyDn.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/modifyDn.pyi @@ -1,5 +1,5 @@ -from typing import Any +from _typeshed import Incomplete -def modify_dn_operation(dn, new_relative_dn, delete_old_rdn: bool = ..., new_superior: Any | None = ...): ... +def modify_dn_operation(dn, new_relative_dn, delete_old_rdn: bool = ..., new_superior: Incomplete | None = ...): ... def modify_dn_request_to_dict(request): ... def modify_dn_response_to_dict(response): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/search.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/search.pyi index a929e13f3..166e31dbd 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/search.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/search.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any ROOT: int @@ -21,7 +22,7 @@ class FilterNode: parent: Any assertion: Any elements: Any - def __init__(self, tag: Any | None = ..., assertion: Any | None = ...) -> None: ... + def __init__(self, tag: Incomplete | None = ..., assertion: Incomplete | None = ...) -> None: ... def __str__(self, pos: int = ...) -> str: ... def __repr__(self, pos: int = ...) -> str: ... def append(self, filter_node): ... @@ -41,8 +42,8 @@ def search_operation( types_only, auto_escape, auto_encode, - schema: Any | None = ..., - validator: Any | None = ..., + schema: Incomplete | None = ..., + validator: Incomplete | None = ..., check_names: bool = ..., ): ... def decode_vals(vals): ... @@ -53,8 +54,10 @@ def decode_raw_vals(vals): ... def decode_raw_vals_fast(vals): ... def raw_attributes_to_dict(attribute_list): ... def raw_attributes_to_dict_fast(attribute_list): ... -def checked_attributes_to_dict(attribute_list, schema: Any | None = ..., custom_formatter: Any | None = ...): ... -def checked_attributes_to_dict_fast(attribute_list, schema: Any | None = ..., custom_formatter: Any | None = ...): ... +def checked_attributes_to_dict(attribute_list, schema: Incomplete | None = ..., custom_formatter: Incomplete | None = ...): ... +def checked_attributes_to_dict_fast( + attribute_list, schema: Incomplete | None = ..., custom_formatter: Incomplete | None = ... +): ... def matching_rule_assertion_to_string(matching_rule_assertion): ... def filter_to_string(filter_object): ... def search_request_to_dict(request): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/convert.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/convert.pyi index 4bf4baf99..f57fce20c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/convert.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/convert.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete def to_str_or_normalized_unicode(val): ... def attribute_to_dict(attribute): ... @@ -17,6 +17,6 @@ def substring_to_dict(substring): ... def prepare_changes_for_request(changes): ... def build_controls_list(controls): ... def validate_assertion_value(schema, name, value, auto_escape, auto_encode, validator, check_names): ... -def validate_attribute_value(schema, name, value, auto_encode, validator: Any | None = ..., check_names: bool = ...): ... +def validate_attribute_value(schema, name, value, auto_encode, validator: Incomplete | None = ..., check_names: bool = ...): ... def prepare_filter_for_sending(raw_string): ... def prepare_for_sending(raw_string): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/microsoft.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/microsoft.pyi index 2200343b2..c2961a7d5 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/microsoft.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/microsoft.pyi @@ -1,25 +1,22 @@ -from typing import Any -from typing_extensions import TypeAlias +from pyasn1.type.namedtype import NamedTypes +from pyasn1.type.tag import TagSet +from pyasn1.type.univ import Sequence -# Enable when pyasn1 gets stubs: -# from pyasn1.type.univ import Sequence -_Sequence: TypeAlias = Any +class SicilyBindResponse(Sequence): + tagSet: TagSet + componentType: NamedTypes -class SicilyBindResponse(_Sequence): - tagSet: Any - componentType: Any +class DirSyncControlRequestValue(Sequence): + componentType: NamedTypes -class DirSyncControlRequestValue(_Sequence): - componentType: Any +class DirSyncControlResponseValue(Sequence): + componentType: NamedTypes -class DirSyncControlResponseValue(_Sequence): - componentType: Any +class SdFlags(Sequence): + componentType: NamedTypes -class SdFlags(_Sequence): - componentType: Any - -class ExtendedDN(_Sequence): - componentType: Any +class ExtendedDN(Sequence): + componentType: NamedTypes def dir_sync_control(criticality, object_security, ancestors_first, public_data_only, incremental_values, max_length, cookie): ... def extended_dn_control(criticality: bool = ..., hex_format: bool = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/novell.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/novell.pyi index 60c5c913a..bfa4a1cdc 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/novell.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/novell.pyi @@ -1,73 +1,67 @@ -from typing import Any -from typing_extensions import TypeAlias - -# Enable when pyasn1 gets stubs: -# from pyasn1.type.univ import Integer, OctetString, Sequence, SequenceOf -_Integer: TypeAlias = Any -_OctetString: TypeAlias = Any -_Sequence: TypeAlias = Any -_SequenceOf: TypeAlias = Any +from pyasn1.type.namedtype import NamedTypes +from pyasn1.type.tag import TagSet +from pyasn1.type.univ import Integer, OctetString, Sequence, SequenceOf NMAS_LDAP_EXT_VERSION: int -class Identity(_OctetString): +class Identity(OctetString): encoding: str -class LDAPDN(_OctetString): - tagSet: Any +class LDAPDN(OctetString): + tagSet: TagSet encoding: str -class Password(_OctetString): - tagSet: Any +class Password(OctetString): + tagSet: TagSet encoding: str -class LDAPOID(_OctetString): - tagSet: Any +class LDAPOID(OctetString): + tagSet: TagSet encoding: str -class GroupCookie(_Integer): - tagSet: Any +class GroupCookie(Integer): + tagSet: TagSet -class NmasVer(_Integer): - tagSet: Any +class NmasVer(Integer): + tagSet: TagSet -class Error(_Integer): - tagSet: Any +class Error(Integer): + tagSet: TagSet -class NmasGetUniversalPasswordRequestValue(_Sequence): - componentType: Any +class NmasGetUniversalPasswordRequestValue(Sequence): + componentType: NamedTypes -class NmasGetUniversalPasswordResponseValue(_Sequence): - componentType: Any +class NmasGetUniversalPasswordResponseValue(Sequence): + componentType: NamedTypes -class NmasSetUniversalPasswordRequestValue(_Sequence): - componentType: Any +class NmasSetUniversalPasswordRequestValue(Sequence): + componentType: NamedTypes -class NmasSetUniversalPasswordResponseValue(_Sequence): - componentType: Any +class NmasSetUniversalPasswordResponseValue(Sequence): + componentType: NamedTypes -class ReplicaList(_SequenceOf): - componentType: Any +class ReplicaList(SequenceOf): + componentType: OctetString # type: ignore[assignment] -class ReplicaInfoRequestValue(_Sequence): - tagSet: Any - componentType: Any +class ReplicaInfoRequestValue(Sequence): + tagSet: TagSet + componentType: NamedTypes -class ReplicaInfoResponseValue(_Sequence): - tagSet: Any - componentType: Any +class ReplicaInfoResponseValue(Sequence): + tagSet: TagSet + componentType: NamedTypes -class CreateGroupTypeRequestValue(_Sequence): - componentType: Any +class CreateGroupTypeRequestValue(Sequence): + componentType: NamedTypes -class CreateGroupTypeResponseValue(_Sequence): - componentType: Any +class CreateGroupTypeResponseValue(Sequence): + componentType: NamedTypes -class EndGroupTypeRequestValue(_Sequence): - componentType: Any +class EndGroupTypeRequestValue(Sequence): + componentType: NamedTypes -class EndGroupTypeResponseValue(_Sequence): - componentType: Any +class EndGroupTypeResponseValue(Sequence): + componentType: NamedTypes -class GroupingControlValue(_Sequence): - componentType: Any +class GroupingControlValue(Sequence): + componentType: NamedTypes diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/persistentSearch.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/persistentSearch.pyi index 3d19c087d..c584d4070 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/persistentSearch.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/persistentSearch.pyi @@ -1,18 +1,14 @@ -from typing import Any -from typing_extensions import TypeAlias +from pyasn1.type.namedtype import NamedTypes +from pyasn1.type.namedval import NamedValues +from pyasn1.type.univ import Enumerated, Sequence -# Enable when pyasn1 gets stubs: -# from pyasn1.type.univ import Enumerated, Sequence -_Enumerated: TypeAlias = Any -_Sequence: TypeAlias = Any +class PersistentSearchControl(Sequence): + componentType: NamedTypes -class PersistentSearchControl(_Sequence): - componentType: Any +class ChangeType(Enumerated): + namedValues: NamedValues -class ChangeType(_Enumerated): - namedValues: Any - -class EntryChangeNotificationControl(_Sequence): - componentType: Any +class EntryChangeNotificationControl(Sequence): + componentType: NamedTypes def persistent_search_control(change_types, changes_only: bool = ..., return_ecs: bool = ..., criticality: bool = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/rfc2696.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/rfc2696.pyi index c131194a6..28159c273 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/rfc2696.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/rfc2696.pyi @@ -1,22 +1,20 @@ -from typing import Any -from typing_extensions import TypeAlias +from _typeshed import Incomplete +from typing_extensions import Final -# Enable when pyasn1 gets stubs: -# from pyasn1.type.univ import Integer, OctetString, Sequence -_Integer: TypeAlias = Any -_OctetString: TypeAlias = Any -_Sequence: TypeAlias = Any +from pyasn1.type.constraint import ConstraintsIntersection, ValueRangeConstraint +from pyasn1.type.namedtype import NamedTypes +from pyasn1.type.univ import Integer, OctetString, Sequence -MAXINT: Any -rangeInt0ToMaxConstraint: Any +MAXINT: Final[Integer] +rangeInt0ToMaxConstraint: ValueRangeConstraint -class Integer0ToMax(_Integer): - subtypeSpec: Any +class Integer0ToMax(Integer): + subtypeSpec: ConstraintsIntersection class Size(Integer0ToMax): ... -class Cookie(_OctetString): ... +class Cookie(OctetString): ... -class RealSearchControlValue(_Sequence): - componentType: Any +class RealSearchControlValue(Sequence): + componentType: NamedTypes -def paged_search_control(criticality: bool = ..., size: int = ..., cookie: Any | None = ...): ... +def paged_search_control(criticality: bool = ..., size: int = ..., cookie: Incomplete | None = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/rfc2849.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/rfc2849.pyi index b589bc57c..4859b42a7 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/rfc2849.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/rfc2849.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any conf_ldif_line_length: Any @@ -6,12 +7,12 @@ def safe_ldif_string(bytes_value): ... def add_controls(controls, all_base64): ... def add_attributes(attributes, all_base64): ... def sort_ldif_lines(lines, sort_order): ... -def search_response_to_ldif(entries, all_base64, sort_order: Any | None = ...): ... -def add_request_to_ldif(entry, all_base64, sort_order: Any | None = ...): ... -def delete_request_to_ldif(entry, all_base64, sort_order: Any | None = ...): ... -def modify_request_to_ldif(entry, all_base64, sort_order: Any | None = ...): ... -def modify_dn_request_to_ldif(entry, all_base64, sort_order: Any | None = ...): ... -def operation_to_ldif(operation_type, entries, all_base64: bool = ..., sort_order: Any | None = ...): ... +def search_response_to_ldif(entries, all_base64, sort_order: Incomplete | None = ...): ... +def add_request_to_ldif(entry, all_base64, sort_order: Incomplete | None = ...): ... +def delete_request_to_ldif(entry, all_base64, sort_order: Incomplete | None = ...): ... +def modify_request_to_ldif(entry, all_base64, sort_order: Incomplete | None = ...): ... +def modify_dn_request_to_ldif(entry, all_base64, sort_order: Incomplete | None = ...): ... +def operation_to_ldif(operation_type, entries, all_base64: bool = ..., sort_order: Incomplete | None = ...): ... def add_ldif_header(ldif_lines): ... def ldif_sort(line, sort_order): ... def decode_persistent_search_control(change): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/rfc3062.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/rfc3062.pyi index 7076147ce..4a97a374a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/rfc3062.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/rfc3062.pyi @@ -1,29 +1,25 @@ -from typing import Any -from typing_extensions import TypeAlias +from pyasn1.type.namedtype import NamedTypes +from pyasn1.type.tag import TagSet +from pyasn1.type.univ import OctetString, Sequence -# Enable when pyasn1 gets stubs: -# from pyasn1.type.univ import OctetString, Sequence -_OctetString: TypeAlias = Any -_Sequence: TypeAlias = Any - -class UserIdentity(_OctetString): - tagSet: Any +class UserIdentity(OctetString): + tagSet: TagSet encoding: str -class OldPasswd(_OctetString): - tagSet: Any +class OldPasswd(OctetString): + tagSet: TagSet encoding: str -class NewPasswd(_OctetString): - tagSet: Any +class NewPasswd(OctetString): + tagSet: TagSet encoding: str -class GenPasswd(_OctetString): - tagSet: Any +class GenPasswd(OctetString): + tagSet: TagSet encoding: str -class PasswdModifyRequestValue(_Sequence): - componentType: Any +class PasswdModifyRequestValue(Sequence): + componentType: NamedTypes -class PasswdModifyResponseValue(_Sequence): - componentType: Any +class PasswdModifyResponseValue(Sequence): + componentType: NamedTypes diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/rfc4511.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/rfc4511.pyi index 070910ae3..7dcd3f58f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/rfc4511.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/rfc4511.pyi @@ -1,32 +1,28 @@ -from typing import Any as _Any - -# Enable when pyasn1 gets stubs: -# from pyasn1.type.univ import Boolean, Choice, Enumerated, Integer, Null, OctetString, Sequence, SequenceOf, SetOf -Boolean = _Any -Choice = _Any -Enumerated = _Any -Integer = _Any -Null = _Any -OctetString = _Any -Sequence = _Any -SequenceOf = _Any -SetOf = _Any - -LDAP_MAX_INT: int -MAXINT: _Any -rangeInt0ToMaxConstraint: _Any -rangeInt1To127Constraint: _Any -size1ToMaxConstraint: _Any -responseValueConstraint: _Any -numericOIDConstraint: _Any -distinguishedNameConstraint: _Any -nameComponentConstraint: _Any -attributeDescriptionConstraint: _Any -uriConstraint: _Any -attributeSelectorConstraint: _Any +# Alias the import to avoid name clash with a class called "Final" +from typing_extensions import Final as _Final + +from pyasn1.type.constraint import ConstraintsIntersection, SingleValueConstraint, ValueRangeConstraint, ValueSizeConstraint +from pyasn1.type.namedtype import NamedTypes +from pyasn1.type.namedval import NamedValues +from pyasn1.type.tag import TagSet +from pyasn1.type.univ import Boolean, Choice, Enumerated, Integer, Null, OctetString, Sequence, SequenceOf, SetOf + +LDAP_MAX_INT: _Final[int] +MAXINT: _Final[Integer] +rangeInt0ToMaxConstraint: ValueRangeConstraint +rangeInt1To127Constraint: ValueRangeConstraint +size1ToMaxConstraint: ValueSizeConstraint +responseValueConstraint: SingleValueConstraint +# Custom constraints. They have yet to be implemented so ldap3 keeps them as None. +numericOIDConstraint: None +distinguishedNameConstraint: None +nameComponentConstraint: None +attributeDescriptionConstraint: None +uriConstraint: None +attributeSelectorConstraint: None class Integer0ToMax(Integer): - subtypeSpec: _Any + subtypeSpec: ConstraintsIntersection class LDAPString(OctetString): encoding: str @@ -44,71 +40,71 @@ class AssertionValue(OctetString): encoding: str class AttributeValueAssertion(Sequence): - componentType: _Any + componentType: NamedTypes class MatchingRuleId(LDAPString): ... class Vals(SetOf): - componentType: _Any + componentType: AttributeValue # type: ignore[assignment] class ValsAtLeast1(SetOf): - componentType: _Any - subtypeSpec: _Any + componentType: AttributeValue # type: ignore[assignment] + subtypeSpec: ConstraintsIntersection class PartialAttribute(Sequence): - componentType: _Any + componentType: NamedTypes class Attribute(Sequence): - componentType: _Any + componentType: NamedTypes class AttributeList(SequenceOf): - componentType: _Any + componentType: Attribute # type: ignore[assignment] class Simple(OctetString): - tagSet: _Any + tagSet: TagSet encoding: str class Credentials(OctetString): encoding: str class SaslCredentials(Sequence): - tagSet: _Any - componentType: _Any + tagSet: TagSet + componentType: NamedTypes class SicilyPackageDiscovery(OctetString): - tagSet: _Any + tagSet: TagSet encoding: str class SicilyNegotiate(OctetString): - tagSet: _Any + tagSet: TagSet encoding: str class SicilyResponse(OctetString): - tagSet: _Any + tagSet: TagSet encoding: str class AuthenticationChoice(Choice): - componentType: _Any + componentType: NamedTypes class Version(Integer): - subtypeSpec: _Any + subtypeSpec: ConstraintsIntersection class ResultCode(Enumerated): - namedValues: _Any - subTypeSpec: _Any + namedValues: NamedValues + subTypeSpec: ConstraintsIntersection class URI(LDAPString): ... class Referral(SequenceOf): - tagSet: _Any - componentType: _Any + tagSet: TagSet + componentType: URI # type: ignore[assignment] class ServerSaslCreds(OctetString): - tagSet: _Any + tagSet: TagSet encoding: str class LDAPResult(Sequence): - componentType: _Any + componentType: NamedTypes class Criticality(Boolean): defaultValue: bool @@ -117,207 +113,209 @@ class ControlValue(OctetString): encoding: str class Control(Sequence): - componentType: _Any + componentType: NamedTypes class Controls(SequenceOf): - tagSet: _Any - componentType: _Any + tagSet: TagSet + componentType: Control # type: ignore[assignment] class Scope(Enumerated): - namedValues: _Any + namedValues: NamedValues class DerefAliases(Enumerated): - namedValues: _Any + namedValues: NamedValues class TypesOnly(Boolean): ... class Selector(LDAPString): ... class AttributeSelection(SequenceOf): - componentType: _Any + componentType: Selector # type: ignore[assignment] class MatchingRule(MatchingRuleId): - tagSet: _Any + tagSet: TagSet class Type(AttributeDescription): - tagSet: _Any + tagSet: TagSet class MatchValue(AssertionValue): - tagSet: _Any + tagSet: TagSet class DnAttributes(Boolean): - tagSet: _Any - defaultValue: _Any + tagSet: TagSet + defaultValue: Boolean class MatchingRuleAssertion(Sequence): - componentType: _Any + componentType: NamedTypes class Initial(AssertionValue): - tagSet: _Any + tagSet: TagSet class Any(AssertionValue): - tagSet: _Any + tagSet: TagSet class Final(AssertionValue): - tagSet: _Any + tagSet: TagSet class Substring(Choice): - componentType: _Any + componentType: NamedTypes class Substrings(SequenceOf): - subtypeSpec: _Any - componentType: _Any + subtypeSpec: ConstraintsIntersection + componentType: Substring # type: ignore[assignment] class SubstringFilter(Sequence): - tagSet: _Any - componentType: _Any + tagSet: TagSet + componentType: NamedTypes class And(SetOf): - tagSet: _Any - subtypeSpec: _Any + tagSet: TagSet + subtypeSpec: ConstraintsIntersection + componentType: Filter # type: ignore[assignment] class Or(SetOf): - tagSet: _Any - subtypeSpec: _Any + tagSet: TagSet + subtypeSpec: ConstraintsIntersection + componentType: Filter # type: ignore[assignment] class Not(Choice): ... class EqualityMatch(AttributeValueAssertion): - tagSet: _Any + tagSet: TagSet class GreaterOrEqual(AttributeValueAssertion): - tagSet: _Any + tagSet: TagSet class LessOrEqual(AttributeValueAssertion): - tagSet: _Any + tagSet: TagSet class Present(AttributeDescription): - tagSet: _Any + tagSet: TagSet class ApproxMatch(AttributeValueAssertion): - tagSet: _Any + tagSet: TagSet class ExtensibleMatch(MatchingRuleAssertion): - tagSet: _Any + tagSet: TagSet class Filter(Choice): - componentType: _Any + componentType: NamedTypes class PartialAttributeList(SequenceOf): - componentType: _Any + componentType: PartialAttribute # type: ignore[assignment] class Operation(Enumerated): - namedValues: _Any + namedValues: NamedValues class Change(Sequence): - componentType: _Any + componentType: NamedTypes class Changes(SequenceOf): - componentType: _Any + componentType: Change # type: ignore[assignment] class DeleteOldRDN(Boolean): ... class NewSuperior(LDAPDN): - tagSet: _Any + tagSet: TagSet class RequestName(LDAPOID): - tagSet: _Any + tagSet: TagSet class RequestValue(OctetString): - tagSet: _Any + tagSet: TagSet encoding: str class ResponseName(LDAPOID): - tagSet: _Any + tagSet: TagSet class ResponseValue(OctetString): - tagSet: _Any + tagSet: TagSet encoding: str class IntermediateResponseName(LDAPOID): - tagSet: _Any + tagSet: TagSet class IntermediateResponseValue(OctetString): - tagSet: _Any + tagSet: TagSet encoding: str class BindRequest(Sequence): - tagSet: _Any - componentType: _Any + tagSet: TagSet + componentType: NamedTypes class BindResponse(Sequence): - tagSet: _Any - componentType: _Any + tagSet: TagSet + componentType: NamedTypes class UnbindRequest(Null): - tagSet: _Any + tagSet: TagSet class SearchRequest(Sequence): - tagSet: _Any - componentType: _Any + tagSet: TagSet + componentType: NamedTypes class SearchResultReference(SequenceOf): - tagSet: _Any - subtypeSpec: _Any - componentType: _Any + tagSet: TagSet + subtypeSpec: ConstraintsIntersection + componentType: URI # type: ignore[assignment] class SearchResultEntry(Sequence): - tagSet: _Any - componentType: _Any + tagSet: TagSet + componentType: NamedTypes class SearchResultDone(LDAPResult): - tagSet: _Any + tagSet: TagSet class ModifyRequest(Sequence): - tagSet: _Any - componentType: _Any + tagSet: TagSet + componentType: NamedTypes class ModifyResponse(LDAPResult): - tagSet: _Any + tagSet: TagSet class AddRequest(Sequence): - tagSet: _Any - componentType: _Any + tagSet: TagSet + componentType: NamedTypes class AddResponse(LDAPResult): - tagSet: _Any + tagSet: TagSet class DelRequest(LDAPDN): - tagSet: _Any + tagSet: TagSet class DelResponse(LDAPResult): - tagSet: _Any + tagSet: TagSet class ModifyDNRequest(Sequence): - tagSet: _Any - componentType: _Any + tagSet: TagSet + componentType: NamedTypes class ModifyDNResponse(LDAPResult): - tagSet: _Any + tagSet: TagSet class CompareRequest(Sequence): - tagSet: _Any - componentType: _Any + tagSet: TagSet + componentType: NamedTypes class CompareResponse(LDAPResult): - tagSet: _Any + tagSet: TagSet class AbandonRequest(MessageID): - tagSet: _Any + tagSet: TagSet class ExtendedRequest(Sequence): - tagSet: _Any - componentType: _Any + tagSet: TagSet + componentType: NamedTypes class ExtendedResponse(Sequence): - tagSet: _Any - componentType: _Any + tagSet: TagSet + componentType: NamedTypes class IntermediateResponse(Sequence): - tagSet: _Any - componentType: _Any + tagSet: TagSet + componentType: NamedTypes class ProtocolOp(Choice): - componentType: _Any + componentType: NamedTypes class LDAPMessage(Sequence): - componentType: _Any + componentType: NamedTypes diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/rfc4512.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/rfc4512.pyi index 816dfeb2d..c47cdfc1b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/rfc4512.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/rfc4512.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any def constant_to_class_kind(value): ... @@ -12,9 +13,9 @@ class BaseServerInfo: raw: Any def __init__(self, raw_attributes) -> None: ... @classmethod - def from_json(cls, json_definition, schema: Any | None = ..., custom_formatter: Any | None = ...): ... + def from_json(cls, json_definition, schema: Incomplete | None = ..., custom_formatter: Incomplete | None = ...): ... @classmethod - def from_file(cls, target, schema: Any | None = ..., custom_formatter: Any | None = ...): ... + def from_file(cls, target, schema: Incomplete | None = ..., custom_formatter: Incomplete | None = ...): ... def to_file(self, target, indent: int = ..., sort: bool = ...) -> None: ... def to_json(self, indent: int = ..., sort: bool = ...): ... @@ -58,13 +59,13 @@ class BaseObjectInfo: raw_definition: Any def __init__( self, - oid: Any | None = ..., - name: Any | None = ..., - description: Any | None = ..., + oid: Incomplete | None = ..., + name: Incomplete | None = ..., + description: Incomplete | None = ..., obsolete: bool = ..., - extensions: Any | None = ..., - experimental: Any | None = ..., - definition: Any | None = ..., + extensions: Incomplete | None = ..., + experimental: Incomplete | None = ..., + definition: Incomplete | None = ..., ) -> None: ... @property def oid_info(self): ... @@ -75,28 +76,28 @@ class MatchingRuleInfo(BaseObjectInfo): syntax: Any def __init__( self, - oid: Any | None = ..., - name: Any | None = ..., - description: Any | None = ..., + oid: Incomplete | None = ..., + name: Incomplete | None = ..., + description: Incomplete | None = ..., obsolete: bool = ..., - syntax: Any | None = ..., - extensions: Any | None = ..., - experimental: Any | None = ..., - definition: Any | None = ..., + syntax: Incomplete | None = ..., + extensions: Incomplete | None = ..., + experimental: Incomplete | None = ..., + definition: Incomplete | None = ..., ) -> None: ... class MatchingRuleUseInfo(BaseObjectInfo): apply_to: Any def __init__( self, - oid: Any | None = ..., - name: Any | None = ..., - description: Any | None = ..., + oid: Incomplete | None = ..., + name: Incomplete | None = ..., + description: Incomplete | None = ..., obsolete: bool = ..., - apply_to: Any | None = ..., - extensions: Any | None = ..., - experimental: Any | None = ..., - definition: Any | None = ..., + apply_to: Incomplete | None = ..., + extensions: Incomplete | None = ..., + experimental: Incomplete | None = ..., + definition: Incomplete | None = ..., ) -> None: ... class ObjectClassInfo(BaseObjectInfo): @@ -106,17 +107,17 @@ class ObjectClassInfo(BaseObjectInfo): may_contain: Any def __init__( self, - oid: Any | None = ..., - name: Any | None = ..., - description: Any | None = ..., + oid: Incomplete | None = ..., + name: Incomplete | None = ..., + description: Incomplete | None = ..., obsolete: bool = ..., - superior: Any | None = ..., - kind: Any | None = ..., - must_contain: Any | None = ..., - may_contain: Any | None = ..., - extensions: Any | None = ..., - experimental: Any | None = ..., - definition: Any | None = ..., + superior: Incomplete | None = ..., + kind: Incomplete | None = ..., + must_contain: Incomplete | None = ..., + may_contain: Incomplete | None = ..., + extensions: Incomplete | None = ..., + experimental: Incomplete | None = ..., + definition: Incomplete | None = ..., ) -> None: ... class AttributeTypeInfo(BaseObjectInfo): @@ -134,33 +135,33 @@ class AttributeTypeInfo(BaseObjectInfo): optional_in: Any def __init__( self, - oid: Any | None = ..., - name: Any | None = ..., - description: Any | None = ..., + oid: Incomplete | None = ..., + name: Incomplete | None = ..., + description: Incomplete | None = ..., obsolete: bool = ..., - superior: Any | None = ..., - equality: Any | None = ..., - ordering: Any | None = ..., - substring: Any | None = ..., - syntax: Any | None = ..., - min_length: Any | None = ..., + superior: Incomplete | None = ..., + equality: Incomplete | None = ..., + ordering: Incomplete | None = ..., + substring: Incomplete | None = ..., + syntax: Incomplete | None = ..., + min_length: Incomplete | None = ..., single_value: bool = ..., collective: bool = ..., no_user_modification: bool = ..., - usage: Any | None = ..., - extensions: Any | None = ..., - experimental: Any | None = ..., - definition: Any | None = ..., + usage: Incomplete | None = ..., + extensions: Incomplete | None = ..., + experimental: Incomplete | None = ..., + definition: Incomplete | None = ..., ) -> None: ... class LdapSyntaxInfo(BaseObjectInfo): def __init__( self, - oid: Any | None = ..., - description: Any | None = ..., - extensions: Any | None = ..., - experimental: Any | None = ..., - definition: Any | None = ..., + oid: Incomplete | None = ..., + description: Incomplete | None = ..., + extensions: Incomplete | None = ..., + experimental: Incomplete | None = ..., + definition: Incomplete | None = ..., ) -> None: ... class DitContentRuleInfo(BaseObjectInfo): @@ -170,17 +171,17 @@ class DitContentRuleInfo(BaseObjectInfo): not_contains: Any def __init__( self, - oid: Any | None = ..., - name: Any | None = ..., - description: Any | None = ..., + oid: Incomplete | None = ..., + name: Incomplete | None = ..., + description: Incomplete | None = ..., obsolete: bool = ..., - auxiliary_classes: Any | None = ..., - must_contain: Any | None = ..., - may_contain: Any | None = ..., - not_contains: Any | None = ..., - extensions: Any | None = ..., - experimental: Any | None = ..., - definition: Any | None = ..., + auxiliary_classes: Incomplete | None = ..., + must_contain: Incomplete | None = ..., + may_contain: Incomplete | None = ..., + not_contains: Incomplete | None = ..., + extensions: Incomplete | None = ..., + experimental: Incomplete | None = ..., + definition: Incomplete | None = ..., ) -> None: ... class DitStructureRuleInfo(BaseObjectInfo): @@ -188,15 +189,15 @@ class DitStructureRuleInfo(BaseObjectInfo): name_form: Any def __init__( self, - oid: Any | None = ..., - name: Any | None = ..., - description: Any | None = ..., + oid: Incomplete | None = ..., + name: Incomplete | None = ..., + description: Incomplete | None = ..., obsolete: bool = ..., - name_form: Any | None = ..., - superior: Any | None = ..., - extensions: Any | None = ..., - experimental: Any | None = ..., - definition: Any | None = ..., + name_form: Incomplete | None = ..., + superior: Incomplete | None = ..., + extensions: Incomplete | None = ..., + experimental: Incomplete | None = ..., + definition: Incomplete | None = ..., ) -> None: ... class NameFormInfo(BaseObjectInfo): @@ -205,14 +206,14 @@ class NameFormInfo(BaseObjectInfo): may_contain: Any def __init__( self, - oid: Any | None = ..., - name: Any | None = ..., - description: Any | None = ..., + oid: Incomplete | None = ..., + name: Incomplete | None = ..., + description: Incomplete | None = ..., obsolete: bool = ..., - object_class: Any | None = ..., - must_contain: Any | None = ..., - may_contain: Any | None = ..., - extensions: Any | None = ..., - experimental: Any | None = ..., - definition: Any | None = ..., + object_class: Incomplete | None = ..., + must_contain: Incomplete | None = ..., + may_contain: Incomplete | None = ..., + extensions: Incomplete | None = ..., + experimental: Incomplete | None = ..., + definition: Incomplete | None = ..., ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/base.pyi index 4c7a07a1a..e324089b3 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/base.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/base.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any unix_socket_available: bool @@ -16,8 +17,8 @@ class BaseStrategy: def __init__(self, ldap_connection) -> None: ... def open(self, reset_usage: bool = ..., read_server_info: bool = ...) -> None: ... def close(self) -> None: ... - def send(self, message_type, request, controls: Any | None = ...): ... - def get_response(self, message_id, timeout: Any | None = ..., get_request: bool = ...): ... + def send(self, message_type, request, controls: Incomplete | None = ...): ... + def get_response(self, message_id, timeout: Incomplete | None = ..., get_request: bool = ...): ... @staticmethod def compute_ldap_message_size(data): ... def decode_response(self, ldap_message): ... @@ -27,7 +28,7 @@ class BaseStrategy: @staticmethod def decode_control_fast(control, from_server: bool = ...): ... @staticmethod - def decode_request(message_type, component, controls: Any | None = ...): ... + def decode_request(message_type, component, controls: Incomplete | None = ...): ... def valid_referral_list(self, referrals): ... def do_next_range_search(self, request, response, attr_name): ... def do_search_on_auto_range(self, request, response): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/ldifProducer.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/ldifProducer.pyi index 7ac55a30b..a6aa78faf 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/ldifProducer.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/ldifProducer.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from .base import BaseStrategy @@ -13,7 +14,7 @@ class LdifProducerStrategy(BaseStrategy): order: Any def __init__(self, ldap_connection) -> None: ... def receiving(self) -> None: ... - def send(self, message_type, request, controls: Any | None = ...): ... + def send(self, message_type, request, controls: Incomplete | None = ...): ... def post_send_single_response(self, message_id): ... def post_send_search(self, message_id) -> None: ... def accumulate_stream(self, fragment) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/mockAsync.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/mockAsync.pyi index 2acd74751..042511bd6 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/mockAsync.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/mockAsync.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from .asynchronous import AsyncStrategy @@ -8,4 +9,4 @@ class MockAsyncStrategy(MockBaseStrategy, AsyncStrategy): def post_send_search(self, payload): ... bound: Any def post_send_single_response(self, payload): ... - def get_response(self, message_id, timeout: Any | None = ..., get_request: bool = ...): ... + def get_response(self, message_id, timeout: Incomplete | None = ..., get_request: bool = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/mockBase.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/mockBase.pyi index c4b0c3483..8daea2cf8 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/mockBase.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/mockBase.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any SEARCH_CONTROLS: Any @@ -12,7 +13,7 @@ class PagedSearchSet: sent: int done: bool def __init__(self, response, size, criticality) -> None: ... - def next(self, size: Any | None = ...): ... + def next(self, size: Incomplete | None = ...): ... class MockBaseStrategy: entries: Any @@ -34,4 +35,4 @@ class MockBaseStrategy: def mock_extended(self, request_message, controls): ... def evaluate_filter_node(self, node, candidates): ... def equal(self, dn, attribute_type, value_to_check): ... - def send(self, message_type, request, controls: Any | None = ...): ... + def send(self, message_type, request, controls: Incomplete | None = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/restartable.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/restartable.pyi index d38804ee0..e0d02e854 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/restartable.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/restartable.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from .sync import SyncStrategy @@ -12,7 +13,7 @@ class RestartableStrategy(SyncStrategy): exception_history: Any def __init__(self, ldap_connection) -> None: ... def open(self, reset_usage: bool = ..., read_server_info: bool = ...) -> None: ... - def send(self, message_type, request, controls: Any | None = ...): ... + def send(self, message_type, request, controls: Incomplete | None = ...): ... def post_send_single_response(self, message_id): ... def post_send_search(self, message_id): ... def get_stream(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/reusable.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/reusable.pyi index 2203fdf72..cd900b1d4 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/reusable.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/reusable.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from threading import Thread from typing import Any @@ -67,8 +68,8 @@ class ReusableStrategy(BaseStrategy): def __init__(self, ldap_connection) -> None: ... def open(self, reset_usage: bool = ..., read_server_info: bool = ...) -> None: ... def terminate(self) -> None: ... - def send(self, message_type, request, controls: Any | None = ...): ... + def send(self, message_type, request, controls: Incomplete | None = ...): ... def validate_bind(self, controls): ... - def get_response(self, counter, timeout: Any | None = ..., get_request: bool = ...): ... + def get_response(self, counter, timeout: Incomplete | None = ..., get_request: bool = ...): ... def post_send_single_response(self, counter): ... def post_send_search(self, counter): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/utils/asn1.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/utils/asn1.pyi index 6af8d2c53..3f4bc7094 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/utils/asn1.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/utils/asn1.pyi @@ -1,37 +1,47 @@ -from typing import Any -from typing_extensions import TypeAlias +from _typeshed import Incomplete, IndexableBuffer, SliceableBuffer, Unused +from collections.abc import Callable, Mapping +from typing import Any, TypeVar, overload +from typing_extensions import Final, TypeAlias -# Enable when pyasn1 gets stubs: -# from pyasn1.codec.ber.encoder import AbstractItemEncoder -_AbstractItemEncoder: TypeAlias = Any +from pyasn1.codec.ber.encoder import AbstractItemEncoder -CLASSES: Any +# Use _typeshed._SupportsGetItemBuffer after PEP 688 +_SupportsGetItemBuffer: TypeAlias = SliceableBuffer | IndexableBuffer +_R = TypeVar("_R") +_B = TypeVar("_B", bound=_SupportsGetItemBuffer) +# The possible return type is a union of all other decode methods, ie: AnyOf[Incomplete | bool] +_AllDecodersReturnType: TypeAlias = Any -class LDAPBooleanEncoder(_AbstractItemEncoder): +CLASSES: Final[dict[tuple[bool, bool], int]] + +class LDAPBooleanEncoder(AbstractItemEncoder): supportIndefLenMode: bool # Requires pyasn1 > 0.3.7 - def encodeValue(self, value, asn1Spec, encodeFun, **options): ... - -customTagMap: Any -customTypeMap: Any + def encodeValue(self, value: bool | int, asn1Spec: Unused, encodeFun: Unused, **options: Unused): ... def compute_ber_size(data): ... def decode_message_fast(message): ... -def decode_sequence(message, start, stop, context_decoders: Any | None = ...): ... -def decode_integer(message, start, stop, context_decoders: Any | None = ...): ... -def decode_octet_string(message, start, stop, context_decoders: Any | None = ...): ... -def decode_boolean(message, start, stop, context_decoders: Any | None = ...): ... -def decode_bind_response(message, start, stop, context_decoders: Any | None = ...): ... -def decode_extended_response(message, start, stop, context_decoders: Any | None = ...): ... -def decode_intermediate_response(message, start, stop, context_decoders: Any | None = ...): ... -def decode_controls(message, start, stop, context_decoders: Any | None = ...): ... +@overload +def decode_sequence(message: _B, start: int, stop: int, context_decoders: Mapping[int, Callable[[_B, int, int], _R]]) -> _R: ... +@overload +def decode_sequence( + message: _SupportsGetItemBuffer, start: int, stop: int, context_decoders: None = ... +) -> _AllDecodersReturnType: ... +def decode_integer(message, start: int, stop: int, context_decoders: Unused = ...): ... +def decode_octet_string(message, start: int, stop: int, context_decoders: Unused = ...): ... +def decode_boolean(message, start: int, stop: int, context_decoders: Unused = ...): ... +def decode_bind_response(message, start: int, stop: int, context_decoders: Unused = ...): ... +def decode_extended_response(message, start: int, stop: int, context_decoders: Unused = ...): ... +def decode_intermediate_response(message, start: int, stop: int, context_decoders: Unused = ...): ... +def decode_controls(message, start: int, stop: int, context_decoders: Unused = ...): ... def ldap_result_to_dict_fast(response): ... def get_byte(x): ... def get_bytes(x): ... -DECODERS: Any -BIND_RESPONSE_CONTEXT: Any -EXTENDED_RESPONSE_CONTEXT: Any -INTERMEDIATE_RESPONSE_CONTEXT: Any -LDAP_MESSAGE_CONTEXT: Any -CONTROLS_CONTEXT: Any +# The possible return type is a union of all other decode methods, ie: AnyOf[Incomplete | bool] +DECODERS: dict[tuple[int, int], Callable[..., _AllDecodersReturnType]] +BIND_RESPONSE_CONTEXT: dict[int, Callable[..., Incomplete]] +EXTENDED_RESPONSE_CONTEXT: dict[int, Callable[..., Incomplete]] +INTERMEDIATE_RESPONSE_CONTEXT: dict[int, Callable[..., Incomplete]] +LDAP_MESSAGE_CONTEXT: dict[int, Callable[..., Incomplete]] +CONTROLS_CONTEXT: dict[int, Callable[..., Incomplete]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/utils/ciDict.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/utils/ciDict.pyi index 2564fc656..154199401 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/utils/ciDict.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/utils/ciDict.pyi @@ -1,17 +1,18 @@ +from _typeshed import Incomplete from collections.abc import MutableMapping -from typing import Any, Generic, TypeVar +from typing import Generic, TypeVar _KT = TypeVar("_KT") _VT = TypeVar("_VT") class CaseInsensitiveDict(MutableMapping[_KT, _VT], Generic[_KT, _VT]): - def __init__(self, other: Any | None = ..., **kwargs) -> None: ... + def __init__(self, other: Incomplete | None = ..., **kwargs) -> None: ... def __contains__(self, item): ... def __delitem__(self, key) -> None: ... def __setitem__(self, key, item) -> None: ... def __getitem__(self, key): ... def __iter__(self): ... - def __len__(self): ... + def __len__(self) -> int: ... def keys(self): ... def values(self): ... def items(self): ... @@ -19,7 +20,7 @@ class CaseInsensitiveDict(MutableMapping[_KT, _VT], Generic[_KT, _VT]): def copy(self): ... class CaseInsensitiveWithAliasDict(CaseInsensitiveDict[_KT, _VT], Generic[_KT, _VT]): - def __init__(self, other: Any | None = ..., **kwargs) -> None: ... + def __init__(self, other: Incomplete | None = ..., **kwargs) -> None: ... def aliases(self): ... def __setitem__(self, key, value) -> None: ... def __delitem__(self, key) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/utils/conv.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/utils/conv.pyi index 280e2085c..4955a853e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/utils/conv.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/utils/conv.pyi @@ -1,9 +1,9 @@ -from typing import Any +from _typeshed import Incomplete def to_unicode(obj: float | bytes | str, encoding: str | None = ..., from_server: bool = ...) -> str: ... def to_raw(obj, encoding: str = ...): ... def escape_filter_chars(text: float | bytes | str, encoding: str | None = ...) -> str: ... -def unescape_filter_chars(text, encoding: Any | None = ...): ... +def unescape_filter_chars(text, encoding: Incomplete | None = ...): ... def escape_bytes(bytes_value: str | bytes) -> str: ... def prepare_for_stream(value): ... def json_encode_b64(obj): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/utils/hashed.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/utils/hashed.pyi index 74734cc63..876932194 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/utils/hashed.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/utils/hashed.pyi @@ -1,6 +1,7 @@ +from _typeshed import Incomplete from typing import Any algorithms_table: Any salted_table: Any -def hashed(algorithm, value, salt: Any | None = ..., raw: bool = ..., encoding: str = ...): ... +def hashed(algorithm, value, salt: Incomplete | None = ..., raw: bool = ..., encoding: str = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/mock/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/mock/METADATA.toml index 3188e8fc2..c98db6304 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/mock/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/mock/METADATA.toml @@ -1 +1 @@ -version = "4.0.*" +version = "5.0.*" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/mock/mock/backports.pyi b/packages/pyright-internal/typeshed-fallback/stubs/mock/mock/backports.pyi new file mode 100644 index 000000000..3984dd881 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/mock/mock/backports.pyi @@ -0,0 +1,11 @@ +import sys + +if sys.version_info >= (3, 8): + from asyncio import iscoroutinefunction as iscoroutinefunction + from unittest import IsolatedAsyncioTestCase as IsolatedAsyncioTestCase +else: + import unittest + + class IsolatedAsyncioTestCase(unittest.TestCase): ... + # It is a typeguard, but its signature is to complex to duplicate. + def iscoroutinefunction(obj: object) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/mock/mock/mock.pyi b/packages/pyright-internal/typeshed-fallback/stubs/mock/mock/mock.pyi index 9c072f588..2723619a3 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/mock/mock/mock.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/mock/mock/mock.pyi @@ -1,10 +1,12 @@ -from _typeshed import Self -from collections.abc import Callable, Mapping, Sequence +from _typeshed import Incomplete +from collections.abc import Callable, Coroutine, Mapping, Sequence +from contextlib import AbstractContextManager from types import TracebackType from typing import Any, Generic, TypeVar, overload -from typing_extensions import Literal +from typing_extensions import Literal, Self _F = TypeVar("_F", bound=Callable[..., Any]) +_AF = TypeVar("_AF", bound=Callable[..., Coroutine[Any, Any, Any]]) _T = TypeVar("_T") _TT = TypeVar("_TT", bound=type[Any]) _R = TypeVar("_R") @@ -26,19 +28,27 @@ __all__ = ( "PropertyMock", "seal", ) -__version__: str -FILTER_DIR: Any +class InvalidSpecError(Exception): ... -sentinel: Any -DEFAULT: Any +FILTER_DIR: bool + +class _SentinelObject: + def __init__(self, name: str) -> None: ... + name: str + +class _Sentinel: + def __getattr__(self, name: str) -> _SentinelObject: ... + +sentinel: _Sentinel +DEFAULT: _SentinelObject class _Call(tuple[Any, ...]): def __new__( - cls: type[Self], + cls, value: Any = ..., - name: Any | None = ..., - parent: Any | None = ..., + name: Incomplete | None = ..., + parent: Incomplete | None = ..., two: bool = ..., from_kall: bool = ..., ) -> Self: ... @@ -46,16 +56,21 @@ class _Call(tuple[Any, ...]): parent: Any from_kall: Any def __init__( - self, value: Any = ..., name: Any | None = ..., parent: Any | None = ..., two: bool = ..., from_kall: bool = ... + self, + value: Any = ..., + name: Incomplete | None = ..., + parent: Incomplete | None = ..., + two: bool = ..., + from_kall: bool = ..., ) -> None: ... def __eq__(self, other: object) -> bool: ... def __ne__(self, __other: object) -> bool: ... def __call__(self, *args: Any, **kwargs: Any) -> _Call: ... def __getattr__(self, attr: str) -> Any: ... @property - def args(self): ... + def args(self) -> tuple[Any, ...]: ... @property - def kwargs(self): ... + def kwargs(self) -> dict[str, Any]: ... def call_list(self) -> _CallList: ... call: _Call @@ -66,16 +81,32 @@ class _CallList(list[_Call]): class Base: def __init__(self, *args: Any, **kwargs: Any) -> None: ... +# We subclass with "Any" because mocks are explicitly designed to stand in for other types, +# something that can't be expressed with our static type system. class NonCallableMock(Base, Any): - def __new__(__cls: type[Self], *args: Any, **kw: Any) -> Self: ... + def __new__( + cls, + spec: list[str] | object | type[object] | None = ..., + wraps: Incomplete | None = ..., + name: str | None = ..., + spec_set: list[str] | object | type[object] | None = ..., + parent: NonCallableMock | None = ..., + _spec_state: Incomplete | None = ..., + _new_name: str = ..., + _new_parent: NonCallableMock | None = ..., + _spec_as_instance: bool = ..., + _eat_self: bool | None = ..., + unsafe: bool = ..., + **kwargs: Any, + ) -> Self: ... def __init__( self, spec: list[str] | object | type[object] | None = ..., - wraps: Any | None = ..., + wraps: Incomplete | None = ..., name: str | None = ..., spec_set: list[str] | object | type[object] | None = ..., parent: NonCallableMock | None = ..., - _spec_state: Any | None = ..., + _spec_state: Incomplete | None = ..., _new_name: str = ..., _new_parent: NonCallableMock | None = ..., _spec_as_instance: bool = ..., @@ -114,16 +145,16 @@ class CallableMixin(Base): side_effect: Any def __init__( self, - spec: Any | None = ..., - side_effect: Any | None = ..., + spec: Incomplete | None = ..., + side_effect: Incomplete | None = ..., return_value: Any = ..., - wraps: Any | None = ..., - name: Any | None = ..., - spec_set: Any | None = ..., - parent: Any | None = ..., - _spec_state: Any | None = ..., + wraps: Incomplete | None = ..., + name: Incomplete | None = ..., + spec_set: Incomplete | None = ..., + parent: Incomplete | None = ..., + _spec_state: Incomplete | None = ..., _new_name: Any = ..., - _new_parent: Any | None = ..., + _new_parent: Incomplete | None = ..., **kwargs: Any, ) -> None: ... def __call__(_mock_self, *args: Any, **kwargs: Any) -> Any: ... @@ -148,17 +179,23 @@ class _patch(Generic[_T]): getter: Callable[[], Any], attribute: str, new: _T, - spec: Any | None, + spec: Incomplete | None, create: bool, - spec_set: Any | None, - autospec: Any | None, - new_callable: Any | None, + spec_set: Incomplete | None, + autospec: Incomplete | None, + new_callable: Incomplete | None, kwargs: Mapping[str, Any], + *, + unsafe: bool = ..., ) -> None: ... def copy(self) -> _patch[_T]: ... def __call__(self, func: Callable[..., _R]) -> Callable[..., _R]: ... def decorate_class(self, klass: _TT) -> _TT: ... def decorate_callable(self, func: _F) -> _F: ... + def decorate_async_callable(self, func: _AF) -> _AF: ... + def decoration_helper( + self, patched: Any, args: tuple[Any, ...], keywargs: dict[str, Any] + ) -> AbstractContextManager[tuple[tuple[Any, ...], dict[str, Any]]]: ... def get_original(self) -> tuple[Any, bool]: ... target: Any temp_original: Any @@ -176,6 +213,8 @@ class _patch_dict: clear: Any def __init__(self, in_dict: Any, values: Any = ..., clear: Any = ..., **kwargs: Any) -> None: ... def __call__(self, f: Any) -> Any: ... + def decorate_callable(self, f: _F) -> _F: ... + def decorate_async_callable(self, f: _AF) -> _AF: ... def decorate_class(self, klass: Any) -> Any: ... def __enter__(self) -> Any: ... def __exit__(self, *args: object) -> Any: ... @@ -190,11 +229,12 @@ class _patcher: self, target: Any, *, - spec: Any | None = ..., + spec: Incomplete | None = ..., create: bool = ..., - spec_set: Any | None = ..., - autospec: Any | None = ..., - new_callable: Any | None = ..., + spec_set: Incomplete | None = ..., + autospec: Incomplete | None = ..., + new_callable: Incomplete | None = ..., + unsafe: bool = ..., **kwargs: Any, ) -> _patch[MagicMock | AsyncMock]: ... # This overload also covers the case, where new==DEFAULT. In this case, the return type is _patch[Any]. @@ -205,11 +245,13 @@ class _patcher: self, target: Any, new: _T, - spec: Any | None = ..., + spec: Incomplete | None = ..., create: bool = ..., - spec_set: Any | None = ..., - autospec: Any | None = ..., - new_callable: Any | None = ..., + spec_set: Incomplete | None = ..., + autospec: Incomplete | None = ..., + new_callable: Incomplete | None = ..., + *, + unsafe: bool = ..., **kwargs: Any, ) -> _patch[_T]: ... @overload @@ -218,11 +260,12 @@ class _patcher: target: Any, attribute: str, *, - spec: Any | None = ..., + spec: Incomplete | None = ..., create: bool = ..., - spec_set: Any | None = ..., - autospec: Any | None = ..., - new_callable: Any | None = ..., + spec_set: Incomplete | None = ..., + autospec: Incomplete | None = ..., + new_callable: Incomplete | None = ..., + unsafe: bool = ..., **kwargs: Any, ) -> _patch[MagicMock | AsyncMock]: ... @overload @@ -231,21 +274,25 @@ class _patcher: target: Any, attribute: str, new: _T, - spec: Any | None = ..., + spec: Incomplete | None = ..., create: bool = ..., - spec_set: Any | None = ..., - autospec: Any | None = ..., - new_callable: Any | None = ..., + spec_set: Incomplete | None = ..., + autospec: Incomplete | None = ..., + new_callable: Incomplete | None = ..., + *, + unsafe: bool = ..., **kwargs: Any, ) -> _patch[_T]: ... def multiple( self, target: Any, - spec: Any | None = ..., + spec: Incomplete | None = ..., create: bool = ..., - spec_set: Any | None = ..., - autospec: Any | None = ..., - new_callable: Any | None = ..., + spec_set: Incomplete | None = ..., + autospec: Incomplete | None = ..., + new_callable: Incomplete | None = ..., + *, + unsafe: bool = ..., **kwargs: _T, ) -> _patch[_T]: ... def stopall(self) -> None: ... @@ -263,29 +310,31 @@ class MagicMock(MagicMixin, Mock): class AsyncMockMixin(Base): def __init__(self, *args: Any, **kwargs: Any) -> None: ... - def assert_awaited(self) -> None: ... - def assert_awaited_once(self) -> None: ... - def assert_awaited_with(self, *args: Any, **kwargs: Any) -> None: ... - def assert_awaited_once_with(self, *args: Any, **kwargs: Any) -> None: ... - def assert_any_await(self, *args: Any, **kwargs: Any) -> None: ... - def assert_has_awaits(self, calls: _CallList, any_order: bool = ...) -> None: ... - def assert_not_awaited(self) -> None: ... + def assert_awaited(_mock_self) -> None: ... + def assert_awaited_once(_mock_self) -> None: ... + def assert_awaited_with(_mock_self, *args: Any, **kwargs: Any) -> None: ... + def assert_awaited_once_with(_mock_self, *args: Any, **kwargs: Any) -> None: ... + def assert_any_await(_mock_self, *args: Any, **kwargs: Any) -> None: ... + def assert_has_awaits(_mock_self, calls: _CallList, any_order: bool = ...) -> None: ... + def assert_not_awaited(_mock_self) -> None: ... def reset_mock(self, *args: Any, **kwargs: Any) -> None: ... await_count: int await_args: _Call | None await_args_list: _CallList + __name__: str + __defaults__: tuple[Any, ...] + __kwdefaults__: dict[str, Any] + __annotations__: dict[str, Any] | None # type: ignore[assignment] -class AsyncMagicMixin(MagicMixin): - def __init__(self, *args: Any, **kw: Any) -> None: ... - +class AsyncMagicMixin(MagicMixin): ... class AsyncMock(AsyncMockMixin, AsyncMagicMixin, Mock): ... class MagicProxy(Base): name: str parent: Any - def __init__(self, name: str, parent) -> None: ... + def __init__(self, name: str, parent: Any) -> None: ... def create_mock(self) -> Any: ... - def __get__(self, obj: Any, _type: Any | None = ...) -> Any: ... + def __get__(self, obj: Any, _type: Incomplete | None = ...) -> Any: ... class _ANY: def __eq__(self, other: object) -> Literal[True]: ... @@ -294,7 +343,14 @@ class _ANY: ANY: Any def create_autospec( - spec: Any, spec_set: Any = ..., instance: Any = ..., _parent: Any | None = ..., _name: Any | None = ..., **kwargs: Any + spec: Any, + spec_set: Any = ..., + instance: Any = ..., + _parent: Incomplete | None = ..., + _name: Incomplete | None = ..., + *, + unsafe: bool = ..., + **kwargs: Any, ) -> Any: ... class _SpecState: @@ -308,16 +364,16 @@ class _SpecState: self, spec: Any, spec_set: Any = ..., - parent: Any | None = ..., - name: Any | None = ..., - ids: Any | None = ..., + parent: Incomplete | None = ..., + name: Incomplete | None = ..., + ids: Incomplete | None = ..., instance: Any = ..., ) -> None: ... -def mock_open(mock: Any | None = ..., read_data: Any = ...) -> Any: ... +def mock_open(mock: Incomplete | None = ..., read_data: Any = ...) -> Any: ... class PropertyMock(Mock): - def __get__(self: Self, obj: _T, obj_type: type[_T] | None = ...) -> Self: ... + def __get__(self, obj: _T, obj_type: type[_T] | None = ...) -> Self: ... def __set__(self, obj: Any, value: Any) -> None: ... def seal(mock: Any) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/mypy-extensions/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/mypy-extensions/METADATA.toml index de6579f75..f3e83f9c4 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/mypy-extensions/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/mypy-extensions/METADATA.toml @@ -1,4 +1 @@ -version = "0.4.*" - -[tool.stubtest] -ignore_missing_stub = false +version = "1.0.*" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/mypy-extensions/mypy_extensions.pyi b/packages/pyright-internal/typeshed-fallback/stubs/mypy-extensions/mypy_extensions.pyi index 85c828e8a..8565793c2 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/mypy-extensions/mypy_extensions.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/mypy-extensions/mypy_extensions.pyi @@ -1,24 +1,35 @@ import abc -from _typeshed import IdentityFunction, Self -from collections.abc import ItemsView, KeysView, Mapping, ValuesView -from typing import Any, Generic, TypeVar, overload +import sys +from _collections_abc import dict_items, dict_keys, dict_values +from _typeshed import IdentityFunction, Unused +from collections.abc import Mapping +from typing import Any, ClassVar, Generic, TypeVar, overload, type_check_only +from typing_extensions import Never, Self _T = TypeVar("_T") _U = TypeVar("_U") # Internal mypy fallback type for all typed dicts (does not exist at runtime) +# N.B. Keep this mostly in sync with typing(_extensions)._TypedDict +@type_check_only class _TypedDict(Mapping[str, object], metaclass=abc.ABCMeta): - def copy(self: Self) -> Self: ... - # Using NoReturn so that only calls using mypy plugin hook that specialize the signature + __total__: ClassVar[bool] + # Unlike typing(_extensions).TypedDict, + # subclasses of mypy_extensions.TypedDict do NOT have the __required_keys__ and __optional_keys__ ClassVars + def copy(self) -> Self: ... + # Using Never so that only calls using mypy plugin hook that specialize the signature # can go through. - def setdefault(self, k: NoReturn, default: object) -> object: ... + def setdefault(self, k: Never, default: object) -> object: ... # Mypy plugin hook for 'pop' expects that 'default' has a type variable type. - def pop(self, k: NoReturn, default: _T = ...) -> object: ... # pyright: ignore[reportInvalidTypeVarUse] - def update(self: Self, __m: Self) -> None: ... - def items(self) -> ItemsView[str, object]: ... - def keys(self) -> KeysView[str]: ... - def values(self) -> ValuesView[object]: ... - def __delitem__(self, k: NoReturn) -> None: ... + def pop(self, k: Never, default: _T = ...) -> object: ... # pyright: ignore[reportInvalidTypeVarUse] + def update(self, __m: Self) -> None: ... + def items(self) -> dict_items[str, object]: ... + def keys(self) -> dict_keys[str, object]: ... + def values(self) -> dict_values[str, object]: ... + def __delitem__(self, k: Never) -> None: ... + if sys.version_info >= (3, 9): + def __or__(self, __other: Self) -> Self: ... + def __ior__(self, __other: Self) -> Self: ... def TypedDict(typename: str, fields: dict[str, type[Any]], total: bool = ...) -> type[dict[str, Any]]: ... @overload @@ -54,6 +65,14 @@ class NoReturn: ... # a class decorator, but mypy does not support type[_T] for abstract # classes until this issue is resolved, https://github.com/python/mypy/issues/4717. def trait(cls: _T) -> _T: ... -def mypyc_attr(*attrs: str, **kwattrs: object) -> IdentityFunction: ... +def mypyc_attr(*attrs: str, **kwattrs: Unused) -> IdentityFunction: ... class FlexibleAlias(Generic[_T, _U]): ... + +# Mypy and mypyc treat these native int types as different from 'int', but this is +# a non-standard extension. For other tools, aliasing these to 'int' allows them +# to mostly do the right thing with these types. +i64 = int +i32 = int +i16 = int +u8 = int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/mysqlclient/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/mysqlclient/METADATA.toml index ec7ff4ca3..acdc22b5d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/mysqlclient/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/mysqlclient/METADATA.toml @@ -1,4 +1 @@ version = "2.1.*" - -[tool.stubtest] -ignore_missing_stub = false diff --git a/packages/pyright-internal/typeshed-fallback/stubs/mysqlclient/MySQLdb/_mysql.pyi b/packages/pyright-internal/typeshed-fallback/stubs/mysqlclient/MySQLdb/_mysql.pyi index 1fba3f13c..b1dded226 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/mysqlclient/MySQLdb/_mysql.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/mysqlclient/MySQLdb/_mysql.pyi @@ -63,8 +63,8 @@ class connection: def thread_id(self, *args, **kwargs) -> Any: ... def use_result(self, *args, **kwargs) -> Any: ... def warning_count(self, *args, **kwargs) -> Any: ... - def __delattr__(self, __name) -> Any: ... - def __setattr__(self, __name, __value) -> Any: ... + def __delattr__(self, __name: str) -> None: ... + def __setattr__(self, __name: str, __value) -> None: ... class result: converter: Any @@ -76,8 +76,8 @@ class result: def field_flags(self, *args, **kwargs) -> Any: ... def num_fields(self, *args, **kwargs) -> Any: ... def num_rows(self, *args, **kwargs) -> Any: ... - def __delattr__(self, __name) -> Any: ... - def __setattr__(self, __name, __value) -> Any: ... + def __delattr__(self, __name: str) -> None: ... + def __setattr__(self, __name: str, __value) -> None: ... def connect(*args, **kwargs) -> Any: ... def debug(*args, **kwargs) -> Any: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/mysqlclient/MySQLdb/connections.pyi b/packages/pyright-internal/typeshed-fallback/stubs/mysqlclient/MySQLdb/connections.pyi index c03fcc594..d1034859a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/mysqlclient/MySQLdb/connections.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/mysqlclient/MySQLdb/connections.pyi @@ -1,6 +1,6 @@ -from _typeshed import Self from types import TracebackType from typing import Any +from typing_extensions import Self from . import _mysql, cursors from ._exceptions import ( @@ -27,7 +27,7 @@ class Connection(_mysql.connection): encoding: str messages: Any def __init__(self, *args, **kwargs) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/mysqlclient/MySQLdb/cursors.pyi b/packages/pyright-internal/typeshed-fallback/stubs/mysqlclient/MySQLdb/cursors.pyi index 3362a3dae..2f1020c35 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/mysqlclient/MySQLdb/cursors.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/mysqlclient/MySQLdb/cursors.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any RE_INSERT_VALUES: Any @@ -28,11 +29,11 @@ class BaseCursor: def __init__(self, connection) -> None: ... def close(self) -> None: ... def __enter__(self): ... - def __exit__(self, *exc_info) -> None: ... + def __exit__(self, *exc_info: object) -> None: ... def nextset(self): ... def setinputsizes(self, *args) -> None: ... def setoutputsizes(self, *args) -> None: ... - def execute(self, query, args: Any | None = ...): ... + def execute(self, query, args: Incomplete | None = ...): ... def executemany(self, query: str, args: list[Any]) -> int: ... def callproc(self, procname, args=...): ... def __iter__(self): ... @@ -40,7 +41,7 @@ class BaseCursor: class CursorStoreResultMixIn: rownumber: Any def fetchone(self): ... - def fetchmany(self, size: Any | None = ...): ... + def fetchmany(self, size: Incomplete | None = ...): ... def fetchall(self): ... def scroll(self, value, mode: str = ...) -> None: ... def __iter__(self): ... @@ -48,7 +49,7 @@ class CursorStoreResultMixIn: class CursorUseResultMixIn: rownumber: Any def fetchone(self): ... - def fetchmany(self, size: Any | None = ...): ... + def fetchmany(self, size: Incomplete | None = ...): ... def fetchall(self): ... def __iter__(self): ... def next(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/mysqlclient/MySQLdb/times.pyi b/packages/pyright-internal/typeshed-fallback/stubs/mysqlclient/MySQLdb/times.pyi index ecca1add5..21a14cfc8 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/mysqlclient/MySQLdb/times.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/mysqlclient/MySQLdb/times.pyi @@ -1,3 +1,4 @@ +from _typeshed import Unused from datetime import date, datetime, time, timedelta from MySQLdb._mysql import string_literal as string_literal @@ -22,5 +23,5 @@ def DateTime_or_None(s: str) -> datetime | None: ... def TimeDelta_or_None(s: str) -> timedelta | None: ... def Time_or_None(s: str) -> time | None: ... def Date_or_None(s: str) -> date | None: ... -def DateTime2literal(d: datetime, c: object) -> str: ... -def DateTimeDelta2literal(d: datetime, c: object) -> str: ... +def DateTime2literal(d: datetime, c: Unused) -> str: ... +def DateTimeDelta2literal(d: datetime, c: Unused) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/netaddr/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/netaddr/METADATA.toml new file mode 100644 index 000000000..29511ee7d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/netaddr/METADATA.toml @@ -0,0 +1 @@ +version = "0.8.*" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/__init__.pyi new file mode 100644 index 000000000..194e6052f --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/__init__.pyi @@ -0,0 +1,75 @@ +from netaddr.contrib.subnet_splitter import SubnetSplitter as SubnetSplitter +from netaddr.core import ( + INET_PTON as INET_PTON, + NOHOST as NOHOST, + ZEROFILL as ZEROFILL, + AddrConversionError as AddrConversionError, + AddrFormatError as AddrFormatError, + N as N, + NotRegisteredError as NotRegisteredError, + P as P, + Z as Z, +) +from netaddr.eui import EUI as EUI, IAB as IAB, OUI as OUI +from netaddr.ip import ( + IPAddress as IPAddress, + IPNetwork as IPNetwork, + IPRange as IPRange, + all_matching_cidrs as all_matching_cidrs, + cidr_abbrev_to_verbose as cidr_abbrev_to_verbose, + cidr_exclude as cidr_exclude, + cidr_merge as cidr_merge, + iprange_to_cidrs as iprange_to_cidrs, + iter_iprange as iter_iprange, + iter_unique_ips as iter_unique_ips, + largest_matching_cidr as largest_matching_cidr, + smallest_matching_cidr as smallest_matching_cidr, + spanning_cidr as spanning_cidr, +) +from netaddr.ip.glob import ( + IPGlob as IPGlob, + cidr_to_glob as cidr_to_glob, + glob_to_cidrs as glob_to_cidrs, + glob_to_iprange as glob_to_iprange, + glob_to_iptuple as glob_to_iptuple, + iprange_to_globs as iprange_to_globs, + valid_glob as valid_glob, +) +from netaddr.ip.nmap import iter_nmap_range as iter_nmap_range, valid_nmap_range as valid_nmap_range +from netaddr.ip.rfc1924 import base85_to_ipv6 as base85_to_ipv6, ipv6_to_base85 as ipv6_to_base85 +from netaddr.ip.sets import IPSet as IPSet +from netaddr.strategy.eui48 import ( + mac_bare as mac_bare, + mac_cisco as mac_cisco, + mac_eui48 as mac_eui48, + mac_pgsql as mac_pgsql, + mac_unix as mac_unix, + mac_unix_expanded as mac_unix_expanded, + valid_str as __eui48_valid_str, +) +from netaddr.strategy.eui64 import ( + eui64_bare as eui64_bare, + eui64_base as eui64_base, + eui64_cisco as eui64_cisco, + eui64_unix as eui64_unix, + eui64_unix_expanded as eui64_unix_expanded, + valid_str as __eui64_valid_str, +) +from netaddr.strategy.ipv4 import valid_str as __ipv4_valid_str +from netaddr.strategy.ipv6 import ( + ipv6_compact as ipv6_compact, + ipv6_full as ipv6_full, + ipv6_verbose as ipv6_verbose, + valid_str as __ipv6_valid_str, +) + +# These are reexported with different names +valid_ipv4 = __ipv4_valid_str +valid_ipv6 = __ipv6_valid_str +valid_mac = __eui48_valid_str +valid_eui64 = __eui64_valid_str + +# Module constants +__version__: str +VERSION: tuple[int, ...] +STATUS: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/cli.pyi b/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/cli.pyi new file mode 100644 index 000000000..3c7c5b202 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/cli.pyi @@ -0,0 +1,3 @@ +from netaddr import * + +def main() -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/compat.pyi b/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/compat.pyi new file mode 100644 index 000000000..fd6128831 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/compat.pyi @@ -0,0 +1,2 @@ +# Python 2 compatibility module +# All members are prefixed with "_", nothing to declare. diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/actions/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/contrib/__init__.pyi similarity index 100% rename from packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/actions/__init__.pyi rename to packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/contrib/__init__.pyi diff --git a/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/contrib/subnet_splitter.pyi b/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/contrib/subnet_splitter.pyi new file mode 100644 index 000000000..2e4200065 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/contrib/subnet_splitter.pyi @@ -0,0 +1,7 @@ +from netaddr.ip import IPNetwork, _IPAddressAddr + +class SubnetSplitter: + def __init__(self, base_cidr: _IPAddressAddr) -> None: ... + def extract_subnet(self, prefix: int, count: int | None = ...) -> list[IPNetwork]: ... + def available_subnets(self) -> list[IPNetwork]: ... + def remove_subnet(self, ip_network: IPNetwork) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/core.pyi b/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/core.pyi new file mode 100644 index 000000000..da4d657f3 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/core.pyi @@ -0,0 +1,38 @@ +from _typeshed import Incomplete, SupportsWrite +from collections.abc import Iterator, Mapping +from typing_extensions import Final + +BIG_ENDIAN_PLATFORM: bool +P: Final = 1 +INET_PTON: Final = 1 +Z: Final = 2 +ZEROFILL: Final = 2 +N: Final = 4 +NOHOST: Final = 4 + +class AddrFormatError(Exception): ... +class AddrConversionError(Exception): ... +class NotRegisteredError(Exception): ... + +def num_bits(int_val: int) -> int: ... + +class Subscriber: + def update(self, data: Incomplete) -> None: ... + +class PrettyPrinter(Subscriber): + fh: SupportsWrite[str] + write_eol: bool + def __init__(self, fh: SupportsWrite[str] = ..., write_eol: bool = ...) -> None: ... + def update(self, data: object) -> None: ... + +class Publisher: + subscribers: list[Subscriber] + def __init__(self) -> None: ... + def attach(self, subscriber: Subscriber) -> None: ... + def detach(self, subscriber: Subscriber) -> None: ... + def notify(self, data: object) -> None: ... + +class DictDotLookup: + def __init__(self, d: Mapping[str, object]) -> None: ... + def __getitem__(self, name: str) -> object: ... + def __iter__(self) -> Iterator[str]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/eui/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/eui/__init__.pyi new file mode 100644 index 000000000..9d2b963e0 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/eui/__init__.pyi @@ -0,0 +1,84 @@ +from typing import ClassVar, SupportsInt, overload +from typing_extensions import Literal, Self, SupportsIndex + +from netaddr.core import DictDotLookup +from netaddr.ip import IPAddress +from netaddr.strategy.eui48 import mac_eui48 +from netaddr.strategy.eui64 import eui64_base + +class BaseIdentifier: + def __init__(self) -> None: ... + def __int__(self) -> int: ... + def __long__(self) -> int: ... + def __oct__(self) -> str: ... + def __hex__(self) -> str: ... + def __index__(self) -> int: ... + +class OUI(BaseIdentifier): + records: list[dict[str, object]] + def __init__(self, oui: str | int) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __ne__(self, other: object) -> bool: ... + @property + def reg_count(self) -> int: ... + def registration(self, index: int = ...) -> DictDotLookup: ... + +class IAB(BaseIdentifier): + IAB_EUI_VALUES: ClassVar[tuple[int, int]] + @classmethod + def split_iab_mac(cls, eui_int: int, strict: bool = ...) -> tuple[int, int]: ... + record: dict[str, object] + def __init__(self, iab: str | int, strict: bool = ...) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __ne__(self, other: object) -> bool: ... + def registration(self) -> DictDotLookup: ... + +class EUI(BaseIdentifier): + def __init__( + self, addr: EUI | int | str, version: int | None = ..., dialect: type[mac_eui48] | type[eui64_base] | None = ... + ) -> None: ... + @property + def value(self) -> int: ... + @value.setter + def value(self, value: str | SupportsInt | SupportsIndex) -> None: ... + @property + def dialect(self) -> type[mac_eui48] | type[eui64_base]: ... + @dialect.setter + def dialect(self, value: type[mac_eui48] | type[eui64_base] | None) -> None: ... + @property + def oui(self) -> OUI: ... + @property + def ei(self) -> str: ... + def is_iab(self) -> bool: ... + @property + def iab(self) -> IAB | None: ... + @property + def version(self) -> Literal[48, 64]: ... + @overload + def __getitem__(self, idx: int) -> int: ... + @overload + def __getitem__(self, idx: slice) -> list[int]: ... + @overload + def __getitem__(self, idx: int | slice) -> int | list[int]: ... + def __setitem__(self, idx: int, value: int) -> None: ... + def __hash__(self) -> int: ... + def __eq__(self, other: object) -> bool: ... + def __ne__(self, other: object) -> bool: ... + def __lt__(self, other: EUI | int | str) -> bool: ... + def __le__(self, other: EUI | int | str) -> bool: ... + def __gt__(self, other: EUI | int | str) -> bool: ... + def __ge__(self, other: EUI | int | str) -> bool: ... + def bits(self, word_sep: str | None = ...) -> str: ... + @property + def packed(self) -> bytes: ... + @property + def words(self) -> tuple[int, ...]: ... + @property + def bin(self) -> str: ... + def eui64(self) -> Self: ... + def modified_eui64(self) -> Self: ... + def ipv6(self, prefix: str | SupportsInt | SupportsIndex) -> IPAddress: ... + def ipv6_link_local(self) -> IPAddress: ... + @property + def info(self) -> DictDotLookup: ... + def format(self, dialect: type[mac_eui48] | type[eui64_base] | None = ...) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/eui/ieee.pyi b/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/eui/ieee.pyi new file mode 100644 index 000000000..9adf6459b --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/eui/ieee.pyi @@ -0,0 +1,33 @@ +import _csv +from _typeshed import FileDescriptorOrPath, StrOrBytesPath +from collections.abc import Iterable +from typing import Any, BinaryIO, TextIO +from typing_extensions import TypeAlias + +from netaddr.core import Publisher, Subscriber + +_INDEX: TypeAlias = dict[int, list[tuple[int, int]]] +OUI_INDEX: _INDEX +IAB_INDEX: _INDEX + +class FileIndexer(Subscriber): + writer: _csv._writer + def __init__(self, index_file: TextIO | FileDescriptorOrPath) -> None: ... + def update(self, data: Iterable[Any]) -> None: ... + +class OUIIndexParser(Publisher): + fh: BinaryIO + def __init__(self, ieee_file: BinaryIO | FileDescriptorOrPath) -> None: ... + def parse(self) -> None: ... + +class IABIndexParser(Publisher): + fh: BinaryIO + def __init__(self, ieee_file: BinaryIO | FileDescriptorOrPath) -> None: ... + def parse(self) -> None: ... + +def create_index_from_registry( + registry_fh: BinaryIO | FileDescriptorOrPath, index_path: StrOrBytesPath, parser: type[OUIIndexParser] | type[IABIndexParser] +) -> None: ... +def create_indices() -> None: ... +def load_index(index: _INDEX, fp: Iterable[bytes]) -> None: ... +def load_indices() -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/fbsocket.pyi b/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/fbsocket.pyi new file mode 100644 index 000000000..e924e7575 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/fbsocket.pyi @@ -0,0 +1,8 @@ +from typing_extensions import Literal + +AF_INET: Literal[2] +AF_INET6: Literal[10] + +def inet_ntoa(packed_ip: bytes) -> str: ... +def inet_ntop(af: int, packed_ip: bytes) -> str: ... +def inet_pton(af: int, ip_string: str) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/ip/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/ip/__init__.pyi new file mode 100644 index 000000000..91651b731 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/ip/__init__.pyi @@ -0,0 +1,174 @@ +from _typeshed import Incomplete, Unused +from abc import abstractmethod +from collections.abc import Iterable, Iterator +from typing import SupportsInt, overload +from typing_extensions import Literal, Self, SupportsIndex, TypeAlias + +from netaddr.core import DictDotLookup +from netaddr.strategy.ipv6 import ipv6_verbose + +class BaseIP: + def __init__(self) -> None: ... + @property + def value(self) -> int | None: ... + @value.setter + def value(self, value: int) -> None: ... + @abstractmethod + def key(self) -> tuple[int, ...]: ... + @abstractmethod + def sort_key(self) -> tuple[int, ...]: ... + def __hash__(self) -> int: ... + def __eq__(self, other: object) -> bool: ... + def __ne__(self, other: object) -> bool: ... + def __lt__(self, other: BaseIP) -> bool: ... + def __le__(self, other: BaseIP) -> bool: ... + def __gt__(self, other: BaseIP) -> bool: ... + def __ge__(self, other: BaseIP) -> bool: ... + def is_unicast(self) -> bool: ... + def is_multicast(self) -> bool: ... + def is_loopback(self) -> bool: ... + def is_private(self) -> bool: ... + def is_link_local(self) -> bool: ... + def is_reserved(self) -> bool: ... + def is_ipv4_mapped(self) -> bool: ... + def is_ipv4_compat(self) -> bool: ... + @property + def info(self) -> DictDotLookup: ... + @property + def version(self) -> Literal[4, 6]: ... + +_IPAddressAddr: TypeAlias = BaseIP | int | str +_IPNetworkAddr: TypeAlias = IPNetwork | IPAddress | tuple[int, int] | str + +class IPAddress(BaseIP): + def __init__(self, addr: _IPAddressAddr, version: Literal[4, 6] | None = ..., flags: int = ...) -> None: ... + def netmask_bits(self) -> int: ... + def is_hostmask(self) -> bool: ... + def is_netmask(self) -> bool: ... + def __iadd__(self, num: int) -> Self: ... + def __isub__(self, num: int) -> Self: ... + def __add__(self, num: int) -> Self: ... + __radd__ = __add__ + def __sub__(self, num: int) -> Self: ... + def __rsub__(self, num: int) -> Self: ... + def key(self) -> tuple[int, ...]: ... + def sort_key(self) -> tuple[int, ...]: ... + def __int__(self) -> int: ... + def __long__(self) -> int: ... + def __oct__(self) -> str: ... + def __hex__(self) -> str: ... + def __index__(self) -> int: ... + def __bytes__(self) -> bytes: ... + def bits(self, word_sep: str | None = ...) -> str: ... + @property + def packed(self) -> bytes: ... + @property + def words(self) -> tuple[int, ...]: ... + @property + def bin(self) -> str: ... + @property + def reverse_dns(self) -> str: ... + def ipv4(self) -> Self: ... + def ipv6(self, ipv4_compatible: bool = ...) -> Self: ... + def format(self, dialect: type[ipv6_verbose] | None = ...) -> str: ... + def __or__(self, other: str | SupportsInt | SupportsIndex) -> Self: ... + def __and__(self, other: str | SupportsInt | SupportsIndex) -> Self: ... + def __xor__(self, other: str | SupportsInt | SupportsIndex) -> Self: ... + def __lshift__(self, numbits: int) -> Self: ... + def __rshift__(self, numbits: int) -> Self: ... + def __bool__(self) -> bool: ... + +class IPListMixin: + def __iter__(self) -> Iterator[IPAddress]: ... + @property + def size(self) -> int: ... + def __len__(self) -> int: ... + @overload + def __getitem__(self, index: SupportsIndex) -> IPAddress: ... + @overload + def __getitem__(self, index: slice) -> Iterator[IPAddress]: ... + @overload + def __getitem__(self, index: SupportsIndex | slice) -> IPAddress | Iterator[IPAddress]: ... + def __contains__(self, other: BaseIP | _IPAddressAddr) -> bool: ... + def __bool__(self) -> Literal[True]: ... + +def parse_ip_network( + module: Incomplete, addr: tuple[int, int] | str, implicit_prefix: bool = ..., flags: int = ... +) -> tuple[int, int]: ... + +class IPNetwork(BaseIP, IPListMixin): + def __init__( + self, addr: _IPNetworkAddr, implicit_prefix: bool = ..., version: Literal[4, 6] | None = ..., flags: int = ... + ) -> None: ... + @property + def prefixlen(self) -> int: ... + @prefixlen.setter + def prefixlen(self, value: int) -> None: ... + @property + def ip(self) -> IPAddress: ... + @property + def network(self) -> IPAddress: ... + @property + def broadcast(self) -> IPAddress | None: ... + @property + def first(self) -> int: ... + @property + def last(self) -> int: ... + @property + def netmask(self) -> IPAddress: ... + @netmask.setter + def netmask(self, value: _IPAddressAddr) -> None: ... + @property + def hostmask(self) -> IPAddress: ... + @property + def cidr(self) -> IPNetwork: ... + def __iadd__(self, num: int) -> Self: ... + def __isub__(self, num: int) -> Self: ... + # runtime overrides __contains__ with incompatible type for "other" + def __contains__(self, other: BaseIP | _IPNetworkAddr) -> bool: ... # type: ignore[override] + def key(self) -> tuple[int, ...]: ... + def sort_key(self) -> tuple[int, ...]: ... + def ipv4(self) -> Self: ... + def ipv6(self, ipv4_compatible: bool = ...) -> Self: ... + def previous(self, step: int = ...) -> Self: ... + def next(self, step: int = ...) -> Self: ... + def supernet(self, prefixlen: int = ...) -> list[IPNetwork]: ... + def subnet(self, prefixlen: int, count: int | None = ..., fmt: Unused = None) -> Iterator[Self]: ... + def iter_hosts(self) -> Iterator[IPAddress]: ... + +class IPRange(BaseIP, IPListMixin): + def __init__(self, start: _IPAddressAddr, end: _IPAddressAddr, flags: int = ...) -> None: ... + def __contains__(self, other: BaseIP | _IPAddressAddr) -> bool: ... + @property + def first(self) -> int: ... + @property + def last(self) -> int: ... + def key(self) -> tuple[int, ...]: ... + def sort_key(self) -> tuple[int, ...]: ... + def cidrs(self) -> list[IPNetwork]: ... + +def iter_unique_ips(*args: IPRange | _IPNetworkAddr) -> Iterator[IPAddress]: ... +def cidr_abbrev_to_verbose(abbrev_cidr: str | SupportsInt | SupportsIndex) -> str: ... +def cidr_merge(ip_addrs: Iterable[IPRange | _IPNetworkAddr]) -> list[IPNetwork]: ... +def cidr_exclude(target: _IPNetworkAddr, exclude: _IPNetworkAddr) -> list[IPNetwork]: ... +def cidr_partition( + target: _IPNetworkAddr, exclude: _IPNetworkAddr +) -> tuple[list[IPNetwork], list[IPNetwork], list[IPNetwork]]: ... +def spanning_cidr(ip_addrs: Iterable[_IPNetworkAddr]) -> IPNetwork: ... +def iter_iprange(start: _IPAddressAddr, end: _IPAddressAddr, step: SupportsInt | SupportsIndex = ...) -> Iterator[IPAddress]: ... +def iprange_to_cidrs(start: _IPNetworkAddr, end: _IPNetworkAddr) -> list[IPNetwork]: ... +def smallest_matching_cidr(ip: _IPAddressAddr, cidrs: Iterable[_IPNetworkAddr]) -> IPNetwork | None: ... +def largest_matching_cidr(ip: _IPAddressAddr, cidrs: Iterable[_IPNetworkAddr]) -> IPNetwork | None: ... +def all_matching_cidrs(ip: _IPAddressAddr, cidrs: Iterable[_IPNetworkAddr]) -> list[IPNetwork]: ... + +IPV4_LOOPBACK: IPNetwork +IPV4_PRIVATE: tuple[IPNetwork | IPRange, ...] +IPV4_LINK_LOCAL: IPNetwork +IPV4_MULTICAST: IPNetwork +IPV4_6TO4: IPNetwork +IPV4_RESERVED: tuple[IPNetwork | IPRange, ...] +IPV6_LOOPBACK: IPAddress +IPV6_PRIVATE: tuple[IPNetwork, ...] +IPV6_LINK_LOCAL: IPNetwork +IPV6_MULTICAST: IPNetwork +IPV6_RESERVED: tuple[IPNetwork, ...] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/ip/glob.pyi b/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/ip/glob.pyi new file mode 100644 index 000000000..34660723c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/ip/glob.pyi @@ -0,0 +1,17 @@ +from typing_extensions import TypeGuard + +from netaddr.ip import IPAddress, IPNetwork, IPRange, _IPAddressAddr, _IPNetworkAddr + +def valid_glob(ipglob: object) -> TypeGuard[str]: ... +def glob_to_iptuple(ipglob: str) -> tuple[IPAddress, IPAddress]: ... +def glob_to_iprange(ipglob: str) -> IPRange: ... +def iprange_to_globs(start: _IPAddressAddr, end: _IPAddressAddr) -> list[str]: ... +def glob_to_cidrs(ipglob: str) -> list[IPNetwork]: ... +def cidr_to_glob(cidr: _IPNetworkAddr) -> str: ... + +class IPGlob(IPRange): + def __init__(self, ipglob: str) -> None: ... + @property + def glob(self) -> str: ... + @glob.setter + def glob(self, value: str) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/ip/iana.pyi b/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/ip/iana.pyi new file mode 100644 index 000000000..ef3657aa9 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/ip/iana.pyi @@ -0,0 +1,52 @@ +from _typeshed import Incomplete, 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 XMLReader + +from netaddr.core import Publisher, Subscriber +from netaddr.ip import IPAddress, IPNetwork, IPRange + +_IanaInfoKey: TypeAlias = IPAddress | IPNetwork | IPRange + +IANA_INFO: dict[str, dict[_IanaInfoKey, dict[str, str]]] + +class SaxRecordParser(handler.ContentHandler): + def __init__(self, callback: Callable[[Mapping[str, object] | None], object] | None = ...) -> None: ... + def startElement(self, name: str, attrs: Mapping[str, object]) -> None: ... + def endElement(self, name: str) -> None: ... + def characters(self, content: str) -> None: ... + +class XMLRecordParser(Publisher): + xmlparser: XMLReader + fh: Incomplete + def __init__(self, fh: Incomplete, **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: ... + # Arbitrary attributes are set in __init__ with `self.__dict__.update(kwargs)` + def __getattr__(self, __name: str) -> Any: ... + +class IPv4Parser(XMLRecordParser): + def process_record(self, rec: Mapping[str, object]) -> dict[str, str]: ... + +class IPv6Parser(XMLRecordParser): + def process_record(self, rec: Mapping[str, object]) -> dict[str, str]: ... + +class IPv6UnicastParser(XMLRecordParser): + def process_record(self, rec: Mapping[str, object]) -> dict[str, str]: ... + +class MulticastParser(XMLRecordParser): + def normalise_addr(self, addr: str) -> str: ... + +class DictUpdater(Subscriber): + dct: MutableMapping[_IanaInfoKey, Incomplete] + topic: str + unique_key: str + def __init__(self, dct: MutableMapping[_IanaInfoKey, Incomplete], topic: str, unique_key: str) -> None: ... + def update(self, data: Incomplete) -> None: ... + +def load_info() -> None: ... +def pprint_info(fh: SupportsWrite[str] | None = ...) -> None: ... +def query(ip_addr: IPAddress) -> dict[str, list[dict[str, str]]]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/ip/nmap.pyi b/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/ip/nmap.pyi new file mode 100644 index 000000000..b63826b5e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/ip/nmap.pyi @@ -0,0 +1,6 @@ +from collections.abc import Iterator + +from netaddr.ip import IPAddress + +def valid_nmap_range(target_spec: str) -> bool: ... +def iter_nmap_range(*nmap_target_spec: str) -> Iterator[IPAddress]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/ip/rfc1924.pyi b/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/ip/rfc1924.pyi new file mode 100644 index 000000000..6a4199bf0 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/ip/rfc1924.pyi @@ -0,0 +1,9 @@ +from netaddr.ip import _IPAddressAddr + +def chr_range(low: str, high: str) -> list[str]: ... + +BASE_85: list[str] +BASE_85_DICT: dict[str, int] + +def ipv6_to_base85(addr: _IPAddressAddr) -> str: ... +def base85_to_ipv6(addr: str) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/ip/sets.pyi b/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/ip/sets.pyi new file mode 100644 index 000000000..ac6e2cb1b --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/ip/sets.pyi @@ -0,0 +1,45 @@ +from collections.abc import Iterable, Iterator +from typing import NoReturn +from typing_extensions import Self, TypeAlias + +from netaddr.ip import IPAddress, IPNetwork, IPRange, _IPNetworkAddr + +_IPIterable: TypeAlias = IPNetwork | IPRange | IPSet | Iterable[_IPNetworkAddr | IPRange | int] + +class IPSet: + def __init__(self, iterable: _IPIterable | None = ..., flags: int = ...) -> None: ... + def compact(self) -> None: ... + def __hash__(self) -> NoReturn: ... + def __contains__(self, ip: _IPNetworkAddr) -> bool: ... + def __bool__(self) -> bool: ... + def __iter__(self) -> Iterator[IPAddress]: ... + def iter_cidrs(self) -> list[IPNetwork]: ... + def add(self, addr: IPRange | _IPNetworkAddr | int, flags: int = ...) -> None: ... + def remove(self, addr: IPRange | _IPNetworkAddr | int, flags: int = ...) -> None: ... + def pop(self) -> IPNetwork: ... + def isdisjoint(self, other: IPSet) -> bool: ... + def copy(self) -> Self: ... + def update(self, iterable: _IPIterable, flags: int = ...) -> None: ... + def clear(self) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __ne__(self, other: object) -> bool: ... + def __lt__(self, other: IPSet) -> bool: ... + def issubset(self, other: IPSet) -> bool: ... + __le__ = issubset + def __gt__(self, other: IPSet) -> bool: ... + def issuperset(self, other: IPSet) -> bool: ... + __ge__ = issuperset + def union(self, other: IPSet) -> Self: ... + __or__ = union + def intersection(self, other: IPSet) -> IPSet: ... + __and__ = intersection + def symmetric_difference(self, other: IPSet) -> IPSet: ... + __xor__ = symmetric_difference + def difference(self, other: IPSet) -> IPSet: ... + __sub__ = difference + def __len__(self) -> int: ... + @property + def size(self) -> int: ... + def iscontiguous(self) -> bool: ... + def iprange(self) -> IPRange | None: ... + def iter_ipranges(self) -> Iterator[IPRange]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/strategy/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/strategy/__init__.pyi new file mode 100644 index 000000000..d2daa0f00 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/strategy/__init__.pyi @@ -0,0 +1,15 @@ +from collections.abc import Iterable, Sequence + +def bytes_to_bits() -> list[str]: ... + +BYTES_TO_BITS: list[str] + +def valid_words(words: Iterable[int], word_size: int, num_words: int) -> bool: ... +def int_to_words(int_val: int, word_size: int, num_words: int) -> tuple[int, ...]: ... +def words_to_int(words: Sequence[int], word_size: int, num_words: int) -> int: ... +def valid_bits(bits: str, width: int, word_sep: str = ...) -> bool: ... +def bits_to_int(bits: str, width: int, word_sep: str = ...) -> int: ... +def int_to_bits(int_val: int, word_size: int, num_words: int, word_sep: str = ...) -> str: ... +def valid_bin(bin_val: str, width: int) -> bool: ... +def int_to_bin(int_val: int, width: int) -> str: ... +def bin_to_int(bin_val: str, width: int) -> int: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/strategy/eui48.pyi b/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/strategy/eui48.pyi new file mode 100644 index 000000000..aa7dcb241 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/strategy/eui48.pyi @@ -0,0 +1,43 @@ +from collections.abc import Iterable, Sequence +from re import Pattern +from typing import ClassVar +from typing_extensions import Literal + +AF_LINK: Literal[48] +width: Literal[48] +family: Literal[48] +family_name: Literal["MAC"] +version: Literal[48] +max_int: int + +class mac_eui48: + word_size: ClassVar[int] + num_words: ClassVar[int] + max_word: ClassVar[int] + word_sep: ClassVar[str] + word_fmt: ClassVar[str] + word_base: ClassVar[int] + +class mac_unix(mac_eui48): ... +class mac_unix_expanded(mac_unix): ... +class mac_cisco(mac_eui48): ... +class mac_bare(mac_eui48): ... +class mac_pgsql(mac_eui48): ... + +DEFAULT_DIALECT: type[mac_eui48] +RE_MAC_FORMATS: list[Pattern[str]] + +def valid_str(addr: str) -> bool: ... +def str_to_int(addr: str) -> int: ... +def int_to_str(int_val: int, dialect: type[mac_eui48] | None = ...) -> str: ... +def int_to_packed(int_val: int) -> bytes: ... +def packed_to_int(packed_int: bytes) -> int: ... +def valid_words(words: Iterable[int], dialect: type[mac_eui48] | None = ...) -> bool: ... +def int_to_words(int_val: int, dialect: type[mac_eui48] | None = ...) -> tuple[int, ...]: ... +def words_to_int(words: Sequence[int], dialect: type[mac_eui48] | None = ...) -> int: ... +def valid_bits(bits: str, dialect: type[mac_eui48] | None = ...) -> bool: ... +def bits_to_int(bits: str, dialect: type[mac_eui48] | None = ...) -> int: ... +def int_to_bits(int_val: int, dialect: type[mac_eui48] | None = ...) -> str: ... +def valid_bin(bin_val: str, dialect: type[mac_eui48] | None = ...) -> bool: ... +def int_to_bin(int_val: int) -> str: ... +def bin_to_int(bin_val: str) -> int: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/strategy/eui64.pyi b/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/strategy/eui64.pyi new file mode 100644 index 000000000..c5e456cc1 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/strategy/eui64.pyi @@ -0,0 +1,42 @@ +from collections.abc import Iterable, Sequence +from re import Pattern +from typing import ClassVar +from typing_extensions import Literal + +AF_EUI64: Literal[64] +width: Literal[64] +family: Literal[64] +family_name: Literal["EUI-64"] +version: Literal[64] +max_int: int + +class eui64_base: + word_size: ClassVar[int] + num_words: ClassVar[int] + max_word: ClassVar[int] + word_sep: ClassVar[str] + word_fmt: ClassVar[str] + word_base: ClassVar[int] + +class eui64_unix(eui64_base): ... +class eui64_unix_expanded(eui64_unix): ... +class eui64_cisco(eui64_base): ... +class eui64_bare(eui64_base): ... + +DEFAULT_EUI64_DIALECT: type[eui64_base] +RE_EUI64_FORMATS: list[Pattern[str]] + +def valid_str(addr: str) -> bool: ... +def str_to_int(addr: str) -> int: ... +def int_to_str(int_val: int, dialect: type[eui64_base] | None = ...) -> str: ... +def int_to_packed(int_val: int) -> bytes: ... +def packed_to_int(packed_int: bytes) -> int: ... +def valid_words(words: Iterable[int], dialect: type[eui64_base] | None = ...) -> bool: ... +def int_to_words(int_val: int, dialect: type[eui64_base] | None = ...) -> tuple[int, ...]: ... +def words_to_int(words: Sequence[int], dialect: type[eui64_base] | None = ...) -> int: ... +def valid_bits(bits: str, dialect: type[eui64_base] | None = ...) -> bool: ... +def bits_to_int(bits: str, dialect: type[eui64_base] | None = ...) -> int: ... +def int_to_bits(int_val: int, dialect: type[eui64_base] | None = ...) -> str: ... +def valid_bin(bin_val: str, dialect: type[eui64_base] | None = ...) -> bool: ... +def int_to_bin(int_val: int) -> str: ... +def bin_to_int(bin_val: str) -> int: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/strategy/ipv4.pyi b/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/strategy/ipv4.pyi new file mode 100644 index 000000000..763a858cb --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/strategy/ipv4.pyi @@ -0,0 +1,39 @@ +from _typeshed import Unused +from collections.abc import Iterable, Sequence +from socket import AddressFamily +from typing_extensions import Literal + +from netaddr.core import INET_PTON as INET_PTON, ZEROFILL as ZEROFILL + +width: Literal[32] +word_size: Literal[8] +word_fmt: Literal["%d"] +word_sep: Literal["."] +family: Literal[AddressFamily.AF_INET] +family_name: Literal["IPv4"] +version: Literal[4] +word_base: Literal[10] +max_int: int +num_words: Literal[4] +max_word: int +prefix_to_netmask: dict[int, int] +netmask_to_prefix: dict[int, int] +prefix_to_hostmask: dict[int, int] +hostmask_to_prefix: dict[int, int] + +def valid_str(addr: str, flags: int = ...) -> bool: ... +def str_to_int(addr: str, flags: int = ...) -> int: ... +def int_to_str(int_val: int, dialect: Unused = None) -> str: ... +def int_to_arpa(int_val: int) -> str: ... +def int_to_packed(int_val: int) -> bytes: ... +def packed_to_int(packed_int: bytes) -> int: ... +def valid_words(words: Iterable[int]) -> bool: ... +def int_to_words(int_val: int) -> tuple[int, ...]: ... +def words_to_int(words: Sequence[int]) -> int: ... +def valid_bits(bits: str) -> bool: ... +def bits_to_int(bits: str) -> int: ... +def int_to_bits(int_val: int, word_sep: str | None = ...) -> str: ... +def valid_bin(bin_val: str) -> bool: ... +def int_to_bin(int_val: int) -> str: ... +def bin_to_int(bin_val: str) -> int: ... +def expand_partial_address(addr: str) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/strategy/ipv6.pyi b/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/strategy/ipv6.pyi new file mode 100644 index 000000000..d96f42efe --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/netaddr/netaddr/strategy/ipv6.pyi @@ -0,0 +1,44 @@ +from collections.abc import Iterable, Sequence +from typing import ClassVar +from typing_extensions import Final, Literal + +from netaddr.fbsocket import AF_INET6 + +OPT_IMPORTS: bool +width: Literal[128] +word_size: Literal[16] +word_sep: Literal[":"] +family: Final = AF_INET6 +family_name: Literal["IPv6"] +version: Literal[6] +word_base: Literal[16] +max_int: int +num_words: Literal[8] +max_word: int +prefix_to_netmask: dict[int, int] +netmask_to_prefix: dict[int, int] +prefix_to_hostmask: dict[int, int] +hostmask_to_prefix: dict[int, int] + +class ipv6_compact: + word_fmt: ClassVar[str] + compact: ClassVar[bool] + +class ipv6_full(ipv6_compact): ... +class ipv6_verbose(ipv6_compact): ... + +def valid_str(addr: str, flags: int = ...) -> bool: ... +def str_to_int(addr: str, flags: int = ...) -> int: ... +def int_to_str(int_val: int, dialect: type[ipv6_compact] | None = ...) -> str: ... +def int_to_arpa(int_val: int) -> str: ... +def int_to_packed(int_val: int) -> bytes: ... +def packed_to_int(packed_int: bytes) -> int: ... +def valid_words(words: Iterable[int]) -> bool: ... +def int_to_words(int_val: int, num_words: int | None = ..., word_size: int | None = ...) -> tuple[int, ...]: ... +def words_to_int(words: Sequence[int]) -> int: ... +def valid_bits(bits: str) -> bool: ... +def bits_to_int(bits: str) -> int: ... +def int_to_bits(int_val: int, word_sep: str | None = ...) -> str: ... +def valid_bin(bin_val: str) -> bool: ... +def int_to_bin(int_val: int) -> str: ... +def bin_to_int(bin_val: str) -> int: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/METADATA.toml index 38c94680a..ab10fefcb 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/METADATA.toml @@ -1 +1,4 @@ version = "3.2.*" + +[tool.stubtest] +ignore_missing_stub = true diff --git a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/common.pyi b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/common.pyi index 622e9e3ea..6dd0f731e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/common.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/common.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any UNICODE_ASCII_CHARACTER_SET: str @@ -34,7 +35,7 @@ class CaseInsensitiveDict(dict[Any, Any]): def __contains__(self, k): ... def __delitem__(self, k) -> None: ... def __getitem__(self, k): ... - def get(self, k, default: Any | None = ...): ... + def get(self, k, default: Incomplete | None = ...): ... def __setitem__(self, k, v) -> None: ... def update(self, *args, **kwargs) -> None: ... @@ -46,8 +47,10 @@ class Request: decoded_body: Any oauth_params: Any validator_log: Any - def __init__(self, uri, http_method: str = ..., body: Any | None = ..., headers: Any | None = ..., encoding: str = ...): ... - def __getattr__(self, name): ... + def __init__( + self, uri, http_method: str = ..., body: Incomplete | None = ..., headers: Incomplete | None = ..., encoding: str = ... + ): ... + def __getattr__(self, name: str): ... @property def uri_query(self): ... @property diff --git a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/__init__.pyi index 9dbdbe00b..3ee040dbc 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/__init__.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any log: Any @@ -37,20 +38,27 @@ class Client: def __init__( self, client_key, - client_secret: Any | None = ..., - resource_owner_key: Any | None = ..., - resource_owner_secret: Any | None = ..., - callback_uri: Any | None = ..., + client_secret: Incomplete | None = ..., + resource_owner_key: Incomplete | None = ..., + resource_owner_secret: Incomplete | None = ..., + callback_uri: Incomplete | None = ..., signature_method=..., signature_type=..., - rsa_key: Any | None = ..., - verifier: Any | None = ..., - realm: Any | None = ..., + rsa_key: Incomplete | None = ..., + verifier: Incomplete | None = ..., + realm: Incomplete | None = ..., encoding: str = ..., - decoding: Any | None = ..., - nonce: Any | None = ..., - timestamp: Any | None = ..., + decoding: Incomplete | None = ..., + nonce: Incomplete | None = ..., + timestamp: Incomplete | None = ..., ): ... def get_oauth_signature(self, request): ... def get_oauth_params(self, request): ... - def sign(self, uri, http_method: str = ..., body: Any | None = ..., headers: Any | None = ..., realm: Any | None = ...): ... + def sign( + self, + uri, + http_method: str = ..., + body: Incomplete | None = ..., + headers: Incomplete | None = ..., + realm: Incomplete | None = ..., + ): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/endpoints/access_token.pyi b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/endpoints/access_token.pyi index d800bdfa8..8cd0094cf 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/endpoints/access_token.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/endpoints/access_token.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from .base import BaseEndpoint as BaseEndpoint @@ -7,6 +8,11 @@ log: Any class AccessTokenEndpoint(BaseEndpoint): def create_access_token(self, request, credentials): ... def create_access_token_response( - self, uri, http_method: str = ..., body: Any | None = ..., headers: Any | None = ..., credentials: Any | None = ... + self, + uri, + http_method: str = ..., + body: Incomplete | None = ..., + headers: Incomplete | None = ..., + credentials: Incomplete | None = ..., ): ... def validate_access_token_request(self, request): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/endpoints/authorization.pyi b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/endpoints/authorization.pyi index ce082c7ff..8e4ec0201 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/endpoints/authorization.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/endpoints/authorization.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete from .base import BaseEndpoint as BaseEndpoint @@ -8,9 +8,11 @@ class AuthorizationEndpoint(BaseEndpoint): self, uri, http_method: str = ..., - body: Any | None = ..., - headers: Any | None = ..., - realms: Any | None = ..., - credentials: Any | None = ..., + body: Incomplete | None = ..., + headers: Incomplete | None = ..., + realms: Incomplete | None = ..., + credentials: Incomplete | None = ..., + ): ... + def get_realms_and_credentials( + self, uri, http_method: str = ..., body: Incomplete | None = ..., headers: Incomplete | None = ... ): ... - def get_realms_and_credentials(self, uri, http_method: str = ..., body: Any | None = ..., headers: Any | None = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/endpoints/base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/endpoints/base.pyi index 08e523158..467b40c90 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/endpoints/base.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/endpoints/base.pyi @@ -1,6 +1,7 @@ +from _typeshed import Incomplete from typing import Any class BaseEndpoint: request_validator: Any token_generator: Any - def __init__(self, request_validator, token_generator: Any | None = ...) -> None: ... + def __init__(self, request_validator, token_generator: Incomplete | None = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/endpoints/request_token.pyi b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/endpoints/request_token.pyi index 6cdaeca37..a383e70e0 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/endpoints/request_token.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/endpoints/request_token.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from .base import BaseEndpoint as BaseEndpoint @@ -7,6 +8,11 @@ log: Any class RequestTokenEndpoint(BaseEndpoint): def create_request_token(self, request, credentials): ... def create_request_token_response( - self, uri, http_method: str = ..., body: Any | None = ..., headers: Any | None = ..., credentials: Any | None = ... + self, + uri, + http_method: str = ..., + body: Incomplete | None = ..., + headers: Incomplete | None = ..., + credentials: Incomplete | None = ..., ): ... def validate_request_token_request(self, request): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/endpoints/resource.pyi b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/endpoints/resource.pyi index 40bf6506b..9d7efb837 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/endpoints/resource.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/endpoints/resource.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from .base import BaseEndpoint as BaseEndpoint @@ -6,5 +7,10 @@ log: Any class ResourceEndpoint(BaseEndpoint): def validate_protected_resource_request( - self, uri, http_method: str = ..., body: Any | None = ..., headers: Any | None = ..., realms: Any | None = ... + self, + uri, + http_method: str = ..., + body: Incomplete | None = ..., + headers: Incomplete | None = ..., + realms: Incomplete | None = ..., ): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/endpoints/signature_only.pyi b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/endpoints/signature_only.pyi index d1959763a..a8b612bc8 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/endpoints/signature_only.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/endpoints/signature_only.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from .base import BaseEndpoint as BaseEndpoint @@ -5,4 +6,4 @@ from .base import BaseEndpoint as BaseEndpoint log: Any class SignatureOnlyEndpoint(BaseEndpoint): - def validate_request(self, uri, http_method: str = ..., body: Any | None = ..., headers: Any | None = ...): ... + def validate_request(self, uri, http_method: str = ..., body: Incomplete | None = ..., headers: Incomplete | None = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/errors.pyi b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/errors.pyi index 342573694..311dbff74 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/errors.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/errors.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any class OAuth1Error(Exception): @@ -6,7 +7,11 @@ class OAuth1Error(Exception): uri: Any status_code: Any def __init__( - self, description: Any | None = ..., uri: Any | None = ..., status_code: int = ..., request: Any | None = ... + self, + description: Incomplete | None = ..., + uri: Incomplete | None = ..., + status_code: int = ..., + request: Incomplete | None = ..., ) -> None: ... def in_uri(self, uri): ... @property diff --git a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/parameters.pyi b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/parameters.pyi index f505bb4b3..82f078da6 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/parameters.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/parameters.pyi @@ -1,5 +1,5 @@ -from typing import Any +from _typeshed import Incomplete -def prepare_headers(oauth_params, headers: Any | None = ..., realm: Any | None = ...): ... +def prepare_headers(oauth_params, headers: Incomplete | None = ..., realm: Incomplete | None = ...): ... def prepare_form_encoded_body(oauth_params, body): ... def prepare_request_uri_query(oauth_params, uri): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/request_validator.pyi b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/request_validator.pyi index 889992b4e..3bb84ae34 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/request_validator.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/request_validator.pyi @@ -1,59 +1,67 @@ -from typing import Any +from ...common import Request class RequestValidator: def __init__(self) -> None: ... @property - def allowed_signature_methods(self): ... + def allowed_signature_methods(self) -> tuple[str, ...]: ... @property - def safe_characters(self): ... + def safe_characters(self) -> set[str]: ... @property - def client_key_length(self): ... + def client_key_length(self) -> tuple[int, int]: ... @property - def request_token_length(self): ... + def request_token_length(self) -> tuple[int, int]: ... @property - def access_token_length(self): ... + def access_token_length(self) -> tuple[int, int]: ... @property - def timestamp_lifetime(self): ... + def timestamp_lifetime(self) -> int: ... @property - def nonce_length(self): ... + def nonce_length(self) -> tuple[int, int]: ... @property - def verifier_length(self): ... + def verifier_length(self) -> tuple[int, int]: ... @property - def realms(self): ... + def realms(self) -> list[str]: ... @property - def enforce_ssl(self): ... - def check_client_key(self, client_key): ... - def check_request_token(self, request_token): ... - def check_access_token(self, request_token): ... - def check_nonce(self, nonce): ... - def check_verifier(self, verifier): ... - def check_realms(self, realms): ... + def enforce_ssl(self) -> bool: ... + def check_client_key(self, client_key: str) -> bool: ... + def check_request_token(self, request_token: str) -> bool: ... + def check_access_token(self, request_token: str) -> bool: ... + def check_nonce(self, nonce: str) -> bool: ... + def check_verifier(self, verifier: str) -> bool: ... + def check_realms(self, realms: list[str]) -> bool: ... @property - def dummy_client(self) -> None: ... + def dummy_client(self) -> str: ... @property - def dummy_request_token(self) -> None: ... + def dummy_request_token(self) -> str: ... @property - def dummy_access_token(self) -> None: ... - def get_client_secret(self, client_key, request) -> None: ... - def get_request_token_secret(self, client_key, token, request) -> None: ... - def get_access_token_secret(self, client_key, token, request) -> None: ... - def get_default_realms(self, client_key, request) -> None: ... - def get_realms(self, token, request) -> None: ... - def get_redirect_uri(self, token, request) -> None: ... - def get_rsa_key(self, client_key, request) -> None: ... - def invalidate_request_token(self, client_key, request_token, request) -> None: ... - def validate_client_key(self, client_key, request) -> None: ... - def validate_request_token(self, client_key, token, request) -> None: ... - def validate_access_token(self, client_key, token, request) -> None: ... + def dummy_access_token(self) -> str: ... + def get_client_secret(self, client_key: str, request: Request) -> str: ... + def get_request_token_secret(self, client_key: str, token: str, request: Request) -> str: ... + def get_access_token_secret(self, client_key: str, token: str, request: Request) -> str: ... + def get_default_realms(self, client_key: str, request: Request) -> list[str]: ... + def get_realms(self, token: str, request: Request) -> list[str]: ... + def get_redirect_uri(self, token: str, request: Request) -> str: ... + def get_rsa_key(self, client_key: str, request: Request) -> str: ... + def invalidate_request_token(self, client_key: str, request_token: str, request: Request) -> None: ... + def validate_client_key(self, client_key: str, request: Request) -> bool: ... + def validate_request_token(self, client_key: str, token: str, request: Request) -> bool: ... + def validate_access_token(self, client_key: str, token: str, request: Request) -> bool: ... def validate_timestamp_and_nonce( - self, client_key, timestamp, nonce, request, request_token: Any | None = ..., access_token: Any | None = ... - ) -> None: ... - def validate_redirect_uri(self, client_key, redirect_uri, request) -> None: ... - def validate_requested_realms(self, client_key, realms, request) -> None: ... - def validate_realms(self, client_key, token, request, uri: Any | None = ..., realms: Any | None = ...) -> None: ... - def validate_verifier(self, client_key, token, verifier, request) -> None: ... - def verify_request_token(self, token, request) -> None: ... - def verify_realms(self, token, realms, request) -> None: ... - def save_access_token(self, token, request) -> None: ... - def save_request_token(self, token, request) -> None: ... - def save_verifier(self, token, verifier, request) -> None: ... + self, + client_key: str, + timestamp, + nonce: str, + request: Request, + request_token: str | None = None, + access_token: str | None = None, + ) -> bool: ... + def validate_redirect_uri(self, client_key: str, redirect_uri, request: Request) -> bool: ... + def validate_requested_realms(self, client_key: str, realms: list[str], request: Request) -> bool: ... + def validate_realms( + self, client_key: str, token: str, request: Request, uri: str | None = None, realms: list[str] | None = None + ) -> bool: ... + def validate_verifier(self, client_key: str, token: str, verifier: str, request: Request) -> bool: ... + def verify_request_token(self, token: str, request: Request) -> bool: ... + def verify_realms(self, token: str, realms: list[str], request: Request) -> bool: ... + def save_access_token(self, token: str, request: Request) -> None: ... + def save_request_token(self, token: str, request: Request) -> None: ... + def save_verifier(self, token: str, verifier, request: Request) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/signature.pyi b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/signature.pyi index bda6f7b0f..1b7c8df8d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/signature.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/signature.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any log: Any @@ -6,17 +7,17 @@ def signature_base_string(http_method: str, base_str_uri: str, normalized_encode def base_string_uri(uri: str, host: str | None = ...) -> str: ... def collect_parameters( uri_query: str = ..., - body: Any | None = ..., - headers: Any | None = ..., + body: Incomplete | None = ..., + headers: Incomplete | None = ..., exclude_oauth_signature: bool = ..., with_realm: bool = ..., ): ... def normalize_parameters(params) -> str: ... def sign_hmac_sha1_with_client(sig_base_str, client): ... -def verify_hmac_sha1(request, client_secret: Any | None = ..., resource_owner_secret: Any | None = ...): ... +def verify_hmac_sha1(request, client_secret: Incomplete | None = ..., resource_owner_secret: Incomplete | None = ...): ... def sign_hmac_sha1(base_string, client_secret, resource_owner_secret): ... def sign_hmac_sha256_with_client(sig_base_str, client): ... -def verify_hmac_sha256(request, client_secret: Any | None = ..., resource_owner_secret: Any | None = ...): ... +def verify_hmac_sha256(request, client_secret: Incomplete | None = ..., resource_owner_secret: Incomplete | None = ...): ... def sign_hmac_sha256(base_string, client_secret, resource_owner_secret): ... def sign_hmac_sha512_with_client(sig_base_str: str, client): ... def verify_hmac_sha512(request, client_secret: str | None = ..., resource_owner_secret: str | None = ...): ... @@ -29,4 +30,4 @@ def sign_rsa_sha512_with_client(sig_base_str: str, client): ... def verify_rsa_sha512(request, rsa_public_key: str): ... def sign_plaintext_with_client(_signature_base_string, client): ... def sign_plaintext(client_secret, resource_owner_secret): ... -def verify_plaintext(request, client_secret: Any | None = ..., resource_owner_secret: Any | None = ...): ... +def verify_plaintext(request, client_secret: Incomplete | None = ..., resource_owner_secret: Incomplete | None = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/clients/backend_application.pyi b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/clients/backend_application.pyi index f3c64ec4a..5c6877c16 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/clients/backend_application.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/clients/backend_application.pyi @@ -1,7 +1,7 @@ -from typing import Any +from _typeshed import Incomplete from .base import Client as Client class BackendApplicationClient(Client): grant_type: str - def prepare_request_body(self, body: str = ..., scope: Any | None = ..., include_client_id: bool = ..., **kwargs): ... # type: ignore[override] + def prepare_request_body(self, body: str = ..., scope: Incomplete | None = ..., include_client_id: bool = ..., **kwargs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/clients/base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/clients/base.pyi index 7ccbc66bf..ff329d440 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/clients/base.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/clients/base.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any AUTH_HEADER: str @@ -29,14 +30,14 @@ class Client: client_id, default_token_placement=..., token_type: str = ..., - access_token: Any | None = ..., - refresh_token: Any | None = ..., - mac_key: Any | None = ..., - mac_algorithm: Any | None = ..., - token: Any | None = ..., - scope: Any | None = ..., - state: Any | None = ..., - redirect_url: Any | None = ..., + access_token: Incomplete | None = ..., + refresh_token: Incomplete | None = ..., + mac_key: Incomplete | None = ..., + mac_algorithm: Incomplete | None = ..., + token: Incomplete | None = ..., + scope: Incomplete | None = ..., + state: Incomplete | None = ..., + redirect_url: Incomplete | None = ..., state_generator=..., code_verifier: str | None = ..., code_challenge: str | None = ..., @@ -52,31 +53,38 @@ class Client: self, uri, http_method: str = ..., - body: Any | None = ..., - headers: Any | None = ..., - token_placement: Any | None = ..., + body: Incomplete | None = ..., + headers: Incomplete | None = ..., + token_placement: Incomplete | None = ..., **kwargs, ): ... def prepare_authorization_request( - self, authorization_url, state: Any | None = ..., redirect_url: Any | None = ..., scope: Any | None = ..., **kwargs + self, + authorization_url, + state: Incomplete | None = ..., + redirect_url: Incomplete | None = ..., + scope: Incomplete | None = ..., + **kwargs, ): ... def prepare_token_request( self, token_url, - authorization_response: Any | None = ..., - redirect_url: Any | None = ..., - state: Any | None = ..., + authorization_response: Incomplete | None = ..., + redirect_url: Incomplete | None = ..., + state: Incomplete | None = ..., body: str = ..., **kwargs, ): ... def prepare_refresh_token_request( - self, token_url, refresh_token: Any | None = ..., body: str = ..., scope: Any | None = ..., **kwargs + self, token_url, refresh_token: Incomplete | None = ..., body: str = ..., scope: Incomplete | None = ..., **kwargs ): ... def prepare_token_revocation_request( - self, revocation_url, token, token_type_hint: str = ..., body: str = ..., callback: Any | None = ..., **kwargs + self, revocation_url, token, token_type_hint: str = ..., body: str = ..., callback: Incomplete | None = ..., **kwargs + ): ... + def parse_request_body_response(self, body, scope: Incomplete | None = ..., **kwargs): ... + def prepare_refresh_body( + self, body: str = ..., refresh_token: Incomplete | None = ..., scope: Incomplete | None = ..., **kwargs ): ... - def parse_request_body_response(self, body, scope: Any | None = ..., **kwargs): ... - def prepare_refresh_body(self, body: str = ..., refresh_token: Any | None = ..., scope: Any | None = ..., **kwargs): ... def create_code_verifier(self, length: int) -> str: ... def create_code_challenge(self, code_verifier: str, code_challenge_method: str | None = ...) -> str: ... def populate_code_attributes(self, response) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/clients/legacy_application.pyi b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/clients/legacy_application.pyi index b7f692737..5cc028c99 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/clients/legacy_application.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/clients/legacy_application.pyi @@ -1,10 +1,10 @@ -from typing import Any +from _typeshed import Incomplete from .base import Client as Client class LegacyApplicationClient(Client): grant_type: str def __init__(self, client_id, **kwargs) -> None: ... - def prepare_request_body( # type: ignore[override] - self, username, password, body: str = ..., scope: Any | None = ..., include_client_id: bool = ..., **kwargs + def prepare_request_body( + self, username, password, body: str = ..., scope: Incomplete | None = ..., include_client_id: bool = ..., **kwargs ): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/clients/mobile_application.pyi b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/clients/mobile_application.pyi index fa9d338b9..283d45cf4 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/clients/mobile_application.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/clients/mobile_application.pyi @@ -1,11 +1,12 @@ +from _typeshed import Incomplete from typing import Any from .base import Client as Client class MobileApplicationClient(Client): response_type: str - def prepare_request_uri( # type: ignore[override] - self, uri, redirect_uri: Any | None = ..., scope: Any | None = ..., state: Any | None = ..., **kwargs + def prepare_request_uri( + self, uri, redirect_uri: Incomplete | None = ..., scope: Incomplete | None = ..., state: Incomplete | None = ..., **kwargs ): ... token: Any - def parse_request_uri_response(self, uri, state: Any | None = ..., scope: Any | None = ...): ... # type: ignore[override] + def parse_request_uri_response(self, uri, state: Incomplete | None = ..., scope: Incomplete | None = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/clients/service_application.pyi b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/clients/service_application.pyi index 9a8d3575d..eba9fe18b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/clients/service_application.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/clients/service_application.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from .base import Client as Client @@ -11,23 +12,23 @@ class ServiceApplicationClient(Client): def __init__( self, client_id, - private_key: Any | None = ..., - subject: Any | None = ..., - issuer: Any | None = ..., - audience: Any | None = ..., + private_key: Incomplete | None = ..., + subject: Incomplete | None = ..., + issuer: Incomplete | None = ..., + audience: Incomplete | None = ..., **kwargs, ) -> None: ... - def prepare_request_body( # type: ignore[override] + def prepare_request_body( self, - private_key: Any | None = ..., - subject: Any | None = ..., - issuer: Any | None = ..., - audience: Any | None = ..., - expires_at: Any | None = ..., - issued_at: Any | None = ..., - extra_claims: Any | None = ..., + private_key: Incomplete | None = ..., + subject: Incomplete | None = ..., + issuer: Incomplete | None = ..., + audience: Incomplete | None = ..., + expires_at: Incomplete | None = ..., + issued_at: Incomplete | None = ..., + extra_claims: Incomplete | None = ..., body: str = ..., - scope: Any | None = ..., + scope: Incomplete | None = ..., include_client_id: bool = ..., **kwargs, ): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/clients/web_application.pyi b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/clients/web_application.pyi index 68bf975ac..c16e9e1ff 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/clients/web_application.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/clients/web_application.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from .base import Client as Client @@ -5,24 +6,24 @@ from .base import Client as Client class WebApplicationClient(Client): grant_type: str code: Any - def __init__(self, client_id, code: Any | None = ..., **kwargs) -> None: ... - def prepare_request_uri( # type: ignore[override] + def __init__(self, client_id, code: Incomplete | None = ..., **kwargs) -> None: ... + def prepare_request_uri( self, uri, - redirect_uri: Any | None = ..., - scope: Any | None = ..., - state: Any | None = ..., + redirect_uri: Incomplete | None = ..., + scope: Incomplete | None = ..., + state: Incomplete | None = ..., code_challenge: str | None = ..., code_challenge_method: str | None = ..., **kwargs, ): ... - def prepare_request_body( # type: ignore[override] + def prepare_request_body( self, - code: Any | None = ..., - redirect_uri: Any | None = ..., + code: Incomplete | None = ..., + redirect_uri: Incomplete | None = ..., body: str = ..., include_client_id: bool = ..., code_verifier: str | None = ..., **kwargs, ): ... - def parse_request_uri_response(self, uri, state: Any | None = ...): ... # type: ignore[override] + def parse_request_uri_response(self, uri, state: Incomplete | None = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/endpoints/authorization.pyi b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/endpoints/authorization.pyi index 17d3e3d58..35d455191 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/endpoints/authorization.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/endpoints/authorization.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from .base import BaseEndpoint as BaseEndpoint @@ -18,9 +19,11 @@ class AuthorizationEndpoint(BaseEndpoint): self, uri, http_method: str = ..., - body: Any | None = ..., - headers: Any | None = ..., - scopes: Any | None = ..., - credentials: Any | None = ..., + body: Incomplete | None = ..., + headers: Incomplete | None = ..., + scopes: Incomplete | None = ..., + credentials: Incomplete | None = ..., + ): ... + def validate_authorization_request( + self, uri, http_method: str = ..., body: Incomplete | None = ..., headers: Incomplete | None = ... ): ... - def validate_authorization_request(self, uri, http_method: str = ..., body: Any | None = ..., headers: Any | None = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/endpoints/introspect.pyi b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/endpoints/introspect.pyi index 291bf6ec4..40a148ab8 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/endpoints/introspect.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/endpoints/introspect.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from .base import BaseEndpoint as BaseEndpoint @@ -9,6 +10,8 @@ class IntrospectEndpoint(BaseEndpoint): valid_request_methods: Any request_validator: Any supported_token_types: Any - def __init__(self, request_validator, supported_token_types: Any | None = ...) -> None: ... - def create_introspect_response(self, uri, http_method: str = ..., body: Any | None = ..., headers: Any | None = ...): ... + def __init__(self, request_validator, supported_token_types: Incomplete | None = ...) -> None: ... + def create_introspect_response( + self, uri, http_method: str = ..., body: Incomplete | None = ..., headers: Incomplete | None = ... + ): ... def validate_introspect_request(self, request) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/endpoints/metadata.pyi b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/endpoints/metadata.pyi index c9ef381b3..0c3176e7f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/endpoints/metadata.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/endpoints/metadata.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from .base import BaseEndpoint as BaseEndpoint @@ -10,7 +11,9 @@ class MetadataEndpoint(BaseEndpoint): initial_claims: Any claims: Any def __init__(self, endpoints, claims=..., raise_errors: bool = ...) -> None: ... - def create_metadata_response(self, uri, http_method: str = ..., body: Any | None = ..., headers: Any | None = ...): ... + def create_metadata_response( + self, uri, http_method: str = ..., body: Incomplete | None = ..., headers: Incomplete | None = ... + ): ... def validate_metadata( self, array, key, is_required: bool = ..., is_list: bool = ..., is_url: bool = ..., is_issuer: bool = ... ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/endpoints/pre_configured.pyi b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/endpoints/pre_configured.pyi index 0f435639f..d33ea10ab 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/endpoints/pre_configured.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/endpoints/pre_configured.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from .authorization import AuthorizationEndpoint as AuthorizationEndpoint @@ -16,9 +17,9 @@ class Server(AuthorizationEndpoint, IntrospectEndpoint, TokenEndpoint, ResourceE def __init__( self, request_validator, - token_expires_in: Any | None = ..., - token_generator: Any | None = ..., - refresh_token_generator: Any | None = ..., + token_expires_in: Incomplete | None = ..., + token_generator: Incomplete | None = ..., + refresh_token_generator: Incomplete | None = ..., *args, **kwargs, ) -> None: ... @@ -30,9 +31,9 @@ class WebApplicationServer(AuthorizationEndpoint, IntrospectEndpoint, TokenEndpo def __init__( self, request_validator, - token_generator: Any | None = ..., - token_expires_in: Any | None = ..., - refresh_token_generator: Any | None = ..., + token_generator: Incomplete | None = ..., + token_expires_in: Incomplete | None = ..., + refresh_token_generator: Incomplete | None = ..., **kwargs, ) -> None: ... @@ -42,9 +43,9 @@ class MobileApplicationServer(AuthorizationEndpoint, IntrospectEndpoint, Resourc def __init__( self, request_validator, - token_generator: Any | None = ..., - token_expires_in: Any | None = ..., - refresh_token_generator: Any | None = ..., + token_generator: Incomplete | None = ..., + token_expires_in: Incomplete | None = ..., + refresh_token_generator: Incomplete | None = ..., **kwargs, ) -> None: ... @@ -55,9 +56,9 @@ class LegacyApplicationServer(TokenEndpoint, IntrospectEndpoint, ResourceEndpoin def __init__( self, request_validator, - token_generator: Any | None = ..., - token_expires_in: Any | None = ..., - refresh_token_generator: Any | None = ..., + token_generator: Incomplete | None = ..., + token_expires_in: Incomplete | None = ..., + refresh_token_generator: Incomplete | None = ..., **kwargs, ) -> None: ... @@ -67,8 +68,8 @@ class BackendApplicationServer(TokenEndpoint, IntrospectEndpoint, ResourceEndpoi def __init__( self, request_validator, - token_generator: Any | None = ..., - token_expires_in: Any | None = ..., - refresh_token_generator: Any | None = ..., + token_generator: Incomplete | None = ..., + token_expires_in: Incomplete | None = ..., + refresh_token_generator: Incomplete | None = ..., **kwargs, ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/endpoints/resource.pyi b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/endpoints/resource.pyi index c44ae9d03..19e06ae76 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/endpoints/resource.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/endpoints/resource.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from .base import BaseEndpoint as BaseEndpoint @@ -13,6 +14,11 @@ class ResourceEndpoint(BaseEndpoint): @property def tokens(self): ... def verify_request( - self, uri, http_method: str = ..., body: Any | None = ..., headers: Any | None = ..., scopes: Any | None = ... + self, + uri, + http_method: str = ..., + body: Incomplete | None = ..., + headers: Incomplete | None = ..., + scopes: Incomplete | None = ..., ): ... def find_token_type(self, request): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/endpoints/revocation.pyi b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/endpoints/revocation.pyi index 137581ae5..d99634346 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/endpoints/revocation.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/endpoints/revocation.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from .base import BaseEndpoint as BaseEndpoint @@ -10,6 +11,8 @@ class RevocationEndpoint(BaseEndpoint): request_validator: Any supported_token_types: Any enable_jsonp: Any - def __init__(self, request_validator, supported_token_types: Any | None = ..., enable_jsonp: bool = ...) -> None: ... - def create_revocation_response(self, uri, http_method: str = ..., body: Any | None = ..., headers: Any | None = ...): ... + def __init__(self, request_validator, supported_token_types: Incomplete | None = ..., enable_jsonp: bool = ...) -> None: ... + def create_revocation_response( + self, uri, http_method: str = ..., body: Incomplete | None = ..., headers: Incomplete | None = ... + ): ... def validate_revocation_request(self, request) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/endpoints/token.pyi b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/endpoints/token.pyi index d67373a63..f1a474e94 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/endpoints/token.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/endpoints/token.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from .base import BaseEndpoint as BaseEndpoint @@ -19,10 +20,10 @@ class TokenEndpoint(BaseEndpoint): self, uri, http_method: str = ..., - body: Any | None = ..., - headers: Any | None = ..., - credentials: Any | None = ..., - grant_type_for_scope: Any | None = ..., - claims: Any | None = ..., + body: Incomplete | None = ..., + headers: Incomplete | None = ..., + credentials: Incomplete | None = ..., + grant_type_for_scope: Incomplete | None = ..., + claims: Incomplete | None = ..., ): ... def validate_token_request(self, request) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/errors.pyi b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/errors.pyi index f45eb1566..1ca35366e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/errors.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/errors.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any class OAuth2Error(Exception): @@ -14,11 +15,11 @@ class OAuth2Error(Exception): grant_type: Any def __init__( self, - description: Any | None = ..., - uri: Any | None = ..., - state: Any | None = ..., - status_code: Any | None = ..., - request: Any | None = ..., + description: Incomplete | None = ..., + uri: Incomplete | None = ..., + state: Incomplete | None = ..., + status_code: Incomplete | None = ..., + request: Incomplete | None = ..., ) -> None: ... def in_uri(self, uri): ... @property @@ -137,4 +138,4 @@ class CustomOAuth2Error(OAuth2Error): error: Any def __init__(self, error, *args, **kwargs) -> None: ... -def raise_from_error(error, params: Any | None = ...) -> None: ... +def raise_from_error(error, params: Incomplete | None = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/grant_types/base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/grant_types/base.pyi index ba8171b01..f44125218 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/grant_types/base.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/grant_types/base.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any log: Any @@ -19,7 +20,7 @@ class GrantTypeBase: default_response_mode: str refresh_token: bool response_types: Any - def __init__(self, request_validator: Any | None = ..., **kwargs) -> None: ... + def __init__(self, request_validator: Incomplete | None = ..., **kwargs) -> None: ... def register_response_type(self, response_type) -> None: ... def register_code_modifier(self, modifier) -> None: ... def register_token_modifier(self, modifier) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/grant_types/refresh_token.pyi b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/grant_types/refresh_token.pyi index 1b590f46f..c1d6c179d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/grant_types/refresh_token.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/grant_types/refresh_token.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from .base import GrantTypeBase as GrantTypeBase @@ -5,6 +6,6 @@ from .base import GrantTypeBase as GrantTypeBase log: Any class RefreshTokenGrant(GrantTypeBase): - def __init__(self, request_validator: Any | None = ..., issue_new_refresh_tokens: bool = ..., **kwargs) -> None: ... + def __init__(self, request_validator: Incomplete | None = ..., issue_new_refresh_tokens: bool = ..., **kwargs) -> None: ... def create_token_response(self, request, token_handler): ... def validate_token_request(self, request) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/parameters.pyi b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/parameters.pyi index ddbec107e..2e9fe1277 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/parameters.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/parameters.pyi @@ -1,12 +1,12 @@ -from typing import Any +from _typeshed import Incomplete def prepare_grant_uri( uri, client_id, response_type, - redirect_uri: Any | None = ..., - scope: Any | None = ..., - state: Any | None = ..., + redirect_uri: Incomplete | None = ..., + scope: Incomplete | None = ..., + state: Incomplete | None = ..., code_challenge: str | None = ..., code_challenge_method: str | None = ..., **kwargs, @@ -15,9 +15,9 @@ def prepare_token_request( grant_type, body: str = ..., include_client_id: bool = ..., code_verifier: str | None = ..., **kwargs ): ... def prepare_token_revocation_request( - url, token, token_type_hint: str = ..., callback: Any | None = ..., body: str = ..., **kwargs + url, token, token_type_hint: str = ..., callback: Incomplete | None = ..., body: str = ..., **kwargs ): ... -def parse_authorization_code_response(uri, state: Any | None = ...): ... -def parse_implicit_response(uri, state: Any | None = ..., scope: Any | None = ...): ... -def parse_token_response(body, scope: Any | None = ...): ... +def parse_authorization_code_response(uri, state: Incomplete | None = ...): ... +def parse_implicit_response(uri, state: Incomplete | None = ..., scope: Incomplete | None = ...): ... +def parse_token_response(body, scope: Incomplete | None = ...): ... def validate_token_parameters(params) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/tokens.pyi b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/tokens.pyi index d4901f5aa..4fded89a5 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/tokens.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/tokens.pyi @@ -1,7 +1,8 @@ +from _typeshed import Incomplete from typing import Any class OAuth2Token(dict[Any, Any]): - def __init__(self, params, old_scope: Any | None = ...) -> None: ... + def __init__(self, params, old_scope: Incomplete | None = ...) -> None: ... @property def scope_changed(self): ... @property @@ -22,16 +23,16 @@ def prepare_mac_header( uri, key, http_method, - nonce: Any | None = ..., - headers: Any | None = ..., - body: Any | None = ..., + nonce: Incomplete | None = ..., + headers: Incomplete | None = ..., + body: Incomplete | None = ..., ext: str = ..., hash_algorithm: str = ..., - issue_time: Any | None = ..., + issue_time: Incomplete | None = ..., draft: int = ..., ): ... def prepare_bearer_uri(token, uri): ... -def prepare_bearer_headers(token, headers: Any | None = ...): ... +def prepare_bearer_headers(token, headers: Incomplete | None = ...): ... def prepare_bearer_body(token, body: str = ...): ... def random_token_generator(request, refresh_token: bool = ...): ... def signed_token_generator(private_pem, **kwargs): ... @@ -49,10 +50,10 @@ class BearerToken(TokenBase): expires_in: Any def __init__( self, - request_validator: Any | None = ..., - token_generator: Any | None = ..., - expires_in: Any | None = ..., - refresh_token_generator: Any | None = ..., + request_validator: Incomplete | None = ..., + token_generator: Incomplete | None = ..., + expires_in: Incomplete | None = ..., + refresh_token_generator: Incomplete | None = ..., ) -> None: ... def create_token(self, request, refresh_token: bool = ..., **kwargs): ... def validate_request(self, request): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/openid/connect/core/endpoints/pre_configured.pyi b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/openid/connect/core/endpoints/pre_configured.pyi index 6d3d4e5ca..c01840dbf 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/openid/connect/core/endpoints/pre_configured.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/openid/connect/core/endpoints/pre_configured.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from oauthlib.oauth2.rfc6749.endpoints import ( @@ -27,9 +28,9 @@ class Server(AuthorizationEndpoint, IntrospectEndpoint, TokenEndpoint, ResourceE def __init__( self, request_validator, - token_expires_in: Any | None = ..., - token_generator: Any | None = ..., - refresh_token_generator: Any | None = ..., + token_expires_in: Incomplete | None = ..., + token_generator: Incomplete | None = ..., + refresh_token_generator: Incomplete | None = ..., *args, **kwargs, ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/openid/connect/core/endpoints/userinfo.pyi b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/openid/connect/core/endpoints/userinfo.pyi index 09a098501..90bda6046 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/openid/connect/core/endpoints/userinfo.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/openid/connect/core/endpoints/userinfo.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from oauthlib.oauth2.rfc6749.endpoints.base import BaseEndpoint as BaseEndpoint @@ -8,5 +9,7 @@ class UserInfoEndpoint(BaseEndpoint): bearer: Any request_validator: Any def __init__(self, request_validator) -> None: ... - def create_userinfo_response(self, uri, http_method: str = ..., body: Any | None = ..., headers: Any | None = ...): ... + def create_userinfo_response( + self, uri, http_method: str = ..., body: Incomplete | None = ..., headers: Incomplete | None = ... + ): ... def validate_userinfo_request(self, request) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/openid/connect/core/exceptions.pyi b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/openid/connect/core/exceptions.pyi index 0a64f1be9..7976462b5 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/openid/connect/core/exceptions.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/openid/connect/core/exceptions.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete from oauthlib.oauth2.rfc6749.errors import FatalClientError as FatalClientError, OAuth2Error as OAuth2Error @@ -50,4 +50,4 @@ class InsufficientScopeError(OAuth2Error): status_code: int description: str -def raise_from_error(error, params: Any | None = ...) -> None: ... +def raise_from_error(error, params: Incomplete | None = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/openid/connect/core/grant_types/authorization_code.pyi b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/openid/connect/core/grant_types/authorization_code.pyi index 5e61d966c..d9f4eb632 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/openid/connect/core/grant_types/authorization_code.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/openid/connect/core/grant_types/authorization_code.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from .base import GrantTypeBase as GrantTypeBase @@ -6,5 +7,5 @@ log: Any class AuthorizationCodeGrant(GrantTypeBase): proxy_target: Any - def __init__(self, request_validator: Any | None = ..., **kwargs) -> None: ... + def __init__(self, request_validator: Incomplete | None = ..., **kwargs) -> None: ... def add_id_token(self, token, token_handler, request): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/openid/connect/core/grant_types/base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/openid/connect/core/grant_types/base.pyi index 5ccdd7e76..8cd663245 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/openid/connect/core/grant_types/base.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/openid/connect/core/grant_types/base.pyi @@ -1,13 +1,14 @@ +from _typeshed import Incomplete from typing import Any log: Any class GrantTypeBase: - def __getattr__(self, attr): ... - def __setattr__(self, attr, value) -> None: ... + def __getattr__(self, attr: str): ... + def __setattr__(self, attr: str, value) -> None: ... def validate_authorization_request(self, request): ... def id_token_hash(self, value, hashfunc=...): ... - def add_id_token(self, token, token_handler, request, nonce: Any | None = ...): ... + def add_id_token(self, token, token_handler, request, nonce: Incomplete | None = ...): ... def openid_authorization_validator(self, request): ... OpenIDConnectBase = GrantTypeBase diff --git a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/openid/connect/core/grant_types/dispatchers.pyi b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/openid/connect/core/grant_types/dispatchers.pyi index 39673c0db..aa541de7f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/openid/connect/core/grant_types/dispatchers.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/openid/connect/core/grant_types/dispatchers.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any log: Any @@ -9,14 +10,14 @@ class Dispatcher: class AuthorizationCodeGrantDispatcher(Dispatcher): default_grant: Any oidc_grant: Any - def __init__(self, default_grant: Any | None = ..., oidc_grant: Any | None = ...) -> None: ... + def __init__(self, default_grant: Incomplete | None = ..., oidc_grant: Incomplete | None = ...) -> None: ... def create_authorization_response(self, request, token_handler): ... def validate_authorization_request(self, request): ... class ImplicitTokenGrantDispatcher(Dispatcher): default_grant: Any oidc_grant: Any - def __init__(self, default_grant: Any | None = ..., oidc_grant: Any | None = ...) -> None: ... + def __init__(self, default_grant: Incomplete | None = ..., oidc_grant: Incomplete | None = ...) -> None: ... def create_authorization_response(self, request, token_handler): ... def validate_authorization_request(self, request): ... @@ -24,5 +25,7 @@ class AuthorizationTokenGrantDispatcher(Dispatcher): default_grant: Any oidc_grant: Any request_validator: Any - def __init__(self, request_validator, default_grant: Any | None = ..., oidc_grant: Any | None = ...) -> None: ... + def __init__( + self, request_validator, default_grant: Incomplete | None = ..., oidc_grant: Incomplete | None = ... + ) -> None: ... def create_token_response(self, request, token_handler): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/openid/connect/core/grant_types/hybrid.pyi b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/openid/connect/core/grant_types/hybrid.pyi index d04ed913c..555f185cd 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/openid/connect/core/grant_types/hybrid.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/openid/connect/core/grant_types/hybrid.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from oauthlib.oauth2.rfc6749.errors import InvalidRequestError as InvalidRequestError @@ -10,6 +11,6 @@ log: Any class HybridGrant(GrantTypeBase): request_validator: Any proxy_target: Any - def __init__(self, request_validator: Any | None = ..., **kwargs) -> None: ... + def __init__(self, request_validator: Incomplete | None = ..., **kwargs) -> None: ... def add_id_token(self, token, token_handler, request): ... def openid_authorization_validator(self, request): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/openid/connect/core/grant_types/implicit.pyi b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/openid/connect/core/grant_types/implicit.pyi index eb3f4a611..b99659c11 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/openid/connect/core/grant_types/implicit.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/openid/connect/core/grant_types/implicit.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from .base import GrantTypeBase as GrantTypeBase @@ -6,6 +7,6 @@ log: Any class ImplicitGrant(GrantTypeBase): proxy_target: Any - def __init__(self, request_validator: Any | None = ..., **kwargs) -> None: ... + def __init__(self, request_validator: Incomplete | None = ..., **kwargs) -> None: ... def add_id_token(self, token, token_handler, request): ... def openid_authorization_validator(self, request): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/openid/connect/core/tokens.pyi b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/openid/connect/core/tokens.pyi index b78dc4c97..efbc471af 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/openid/connect/core/tokens.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/openid/connect/core/tokens.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from oauthlib.oauth2.rfc6749.tokens import TokenBase as TokenBase @@ -9,10 +10,10 @@ class JWTToken(TokenBase): expires_in: Any def __init__( self, - request_validator: Any | None = ..., - token_generator: Any | None = ..., - expires_in: Any | None = ..., - refresh_token_generator: Any | None = ..., + request_validator: Incomplete | None = ..., + token_generator: Incomplete | None = ..., + expires_in: Incomplete | None = ..., + refresh_token_generator: Incomplete | None = ..., ) -> None: ... def create_token(self, request, refresh_token: bool = ...): ... def validate_request(self, request): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/signals.pyi b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/signals.pyi index 90f27eeee..d06f06336 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/signals.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/signals.pyi @@ -1,14 +1,15 @@ +from _typeshed import Incomplete from typing import Any signals_available: bool class Namespace: - def signal(self, name, doc: Any | None = ...): ... + def signal(self, name, doc: Incomplete | None = ...): ... class _FakeSignal: name: Any __doc__: Any - def __init__(self, name, doc: Any | None = ...) -> None: ... + def __init__(self, name, doc: Incomplete | None = ...) -> None: ... send: Any connect: Any disconnect: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/METADATA.toml index 4a8e90c0c..b34a69a3b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/METADATA.toml @@ -1 +1,4 @@ -version = "3.0.*" +version = "3.1.*" + +[tool.stubtest] +ignore_missing_stub = true diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/__init__.pyi index 686516d3f..c252e6d9c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/__init__.pyi @@ -11,3 +11,5 @@ from ._constants import ( __url__ as __url__, __version__ as __version__, ) + +open = load_workbook diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/cell/_writer.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/cell/_writer.pyi index ef2dc335c..ab9092eb2 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/cell/_writer.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/cell/_writer.pyi @@ -1,6 +1,6 @@ -from typing import Any +from _typeshed import Incomplete -def etree_write_cell(xf, worksheet, cell, styled: Any | None = ...) -> None: ... +def etree_write_cell(xf, worksheet, cell, styled: Incomplete | None = ...) -> None: ... def lxml_write_cell(xf, worksheet, cell, styled: bool = ...) -> None: ... write_cell = lxml_write_cell diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/cell/cell.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/cell/cell.pyi index b8a89507b..ce7c7df30 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/cell/cell.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/cell/cell.pyi @@ -1,14 +1,19 @@ -from typing import Any +from _typeshed import Incomplete +from datetime import datetime +from openpyxl.comments.comments import Comment +from openpyxl.styles.cell_style import StyleArray from openpyxl.styles.styleable import StyleableObject +from openpyxl.worksheet.hyperlink import Hyperlink +from openpyxl.worksheet.worksheet import Worksheet __docformat__: str -TIME_TYPES: Any -TIME_FORMATS: Any -STRING_TYPES: Any -KNOWN_TYPES: Any -ILLEGAL_CHARACTERS_RE: Any -ERROR_CODES: Any +TIME_TYPES: Incomplete +TIME_FORMATS: Incomplete +STRING_TYPES: Incomplete +KNOWN_TYPES: Incomplete +ILLEGAL_CHARACTERS_RE: Incomplete +ERROR_CODES: Incomplete TYPE_STRING: str TYPE_FORMULA: str TYPE_NUMERIC: str @@ -17,57 +22,62 @@ TYPE_NULL: str TYPE_INLINE: str TYPE_ERROR: str TYPE_FORMULA_CACHE_STRING: str -VALID_TYPES: Any +VALID_TYPES: Incomplete -def get_type(t, value): ... -def get_time_format(t): ... +def get_type(t: type, value: object) -> str | None: ... +def get_time_format(t: datetime) -> str: ... class Cell(StyleableObject): - row: Any - column: Any + row: int + column: int data_type: str def __init__( - self, worksheet, row: Any | None = ..., column: Any | None = ..., value: Any | None = ..., style_array: Any | None = ... + self, + worksheet: Worksheet, + row: int | None = ..., + column: int | None = ..., + value: str | float | datetime | None = ..., + style_array: StyleArray | None = ..., ) -> None: ... @property - def coordinate(self): ... + def coordinate(self) -> str: ... @property - def col_idx(self): ... + def col_idx(self) -> int: ... @property - def column_letter(self): ... + def column_letter(self) -> str: ... @property - def encoding(self): ... + def encoding(self) -> str: ... @property - def base_date(self): ... - def check_string(self, value): ... - def check_error(self, value): ... + def base_date(self) -> datetime: ... + def check_string(self, value: str): ... + def check_error(self, value: object) -> str: ... @property - def value(self): ... + def value(self) -> str | float | datetime | None: ... @value.setter - def value(self, value) -> None: ... + def value(self, value: str | float | datetime | None) -> None: ... @property - def internal_value(self): ... + def internal_value(self) -> str | float | datetime | None: ... @property - def hyperlink(self): ... + def hyperlink(self) -> Hyperlink | None: ... @hyperlink.setter - def hyperlink(self, val) -> None: ... + def hyperlink(self, val: Hyperlink | str | None) -> None: ... @property - def is_date(self): ... - def offset(self, row: int = ..., column: int = ...): ... + def is_date(self) -> bool: ... + def offset(self, row: int = ..., column: int = ...) -> Cell: ... @property - def comment(self): ... + def comment(self) -> Comment | None: ... @comment.setter - def comment(self, value) -> None: ... + def comment(self, value: Comment | None) -> None: ... class MergedCell(StyleableObject): data_type: str - comment: Any - hyperlink: Any - row: Any - column: Any - def __init__(self, worksheet, row: Any | None = ..., column: Any | None = ...) -> None: ... + comment: Comment | None + hyperlink: Hyperlink | None + row: int + column: int + def __init__(self, worksheet: Worksheet, row: int | None = ..., column: int | None = ...) -> None: ... @property - def coordinate(self): ... - value: Any + def coordinate(self) -> str: ... + value: str | float | int | datetime | None -def WriteOnlyCell(ws: Any | None = ..., value: Any | None = ...): ... +def WriteOnlyCell(ws: Worksheet | None = ..., value: str | float | datetime | None = ...) -> Cell: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/cell/read_only.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/cell/read_only.pyi index 1bd41de80..970043444 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/cell/read_only.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/cell/read_only.pyi @@ -1,10 +1,10 @@ -from typing import Any +from _typeshed import Incomplete class ReadOnlyCell: - parent: Any - row: Any - column: Any - data_type: Any + parent: Incomplete + row: Incomplete + column: Incomplete + data_type: Incomplete def __init__(self, sheet, row, column, value, data_type: str = ..., style_id: int = ...) -> None: ... def __eq__(self, other): ... def __ne__(self, other): ... @@ -39,13 +39,13 @@ class ReadOnlyCell: def value(self, value) -> None: ... class EmptyCell: - value: Any + value: Incomplete is_date: bool - font: Any - border: Any - fill: Any - number_format: Any - alignment: Any + font: Incomplete + border: Incomplete + fill: Incomplete + number_format: Incomplete + alignment: Incomplete data_type: str -EMPTY_CELL: Any +EMPTY_CELL: Incomplete diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/cell/text.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/cell/text.pyi index aa65e8029..92771f02f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/cell/text.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/cell/text.pyi @@ -1,80 +1,82 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable from openpyxl.styles.fonts import Font class PhoneticProperties(Serialisable): tagname: str - fontId: Any - type: Any - alignment: Any - def __init__(self, fontId: Any | None = ..., type: Any | None = ..., alignment: Any | None = ...) -> None: ... + fontId: Incomplete + type: Incomplete + alignment: Incomplete + def __init__( + self, fontId: Incomplete | None = ..., type: Incomplete | None = ..., alignment: Incomplete | None = ... + ) -> None: ... class PhoneticText(Serialisable): tagname: str - sb: Any - eb: Any - t: Any - text: Any - def __init__(self, sb: Any | None = ..., eb: Any | None = ..., t: Any | None = ...) -> None: ... + sb: Incomplete + eb: Incomplete + t: Incomplete + text: Incomplete + def __init__(self, sb: Incomplete | None = ..., eb: Incomplete | None = ..., t: Incomplete | None = ...) -> None: ... class InlineFont(Font): tagname: str - rFont: Any - charset: Any - family: Any - b: Any - i: Any - strike: Any - outline: Any - shadow: Any - condense: Any - extend: Any - color: Any - sz: Any - u: Any - vertAlign: Any - scheme: Any - __elements__: Any + rFont: Incomplete + charset: Incomplete + family: Incomplete + b: Incomplete + i: Incomplete + strike: Incomplete + outline: Incomplete + shadow: Incomplete + condense: Incomplete + extend: Incomplete + color: Incomplete + sz: Incomplete + u: Incomplete + vertAlign: Incomplete + scheme: Incomplete + __elements__: Incomplete def __init__( self, - rFont: Any | None = ..., - charset: Any | None = ..., - family: Any | None = ..., - b: Any | None = ..., - i: Any | None = ..., - strike: Any | None = ..., - outline: Any | None = ..., - shadow: Any | None = ..., - condense: Any | None = ..., - extend: Any | None = ..., - color: Any | None = ..., - sz: Any | None = ..., - u: Any | None = ..., - vertAlign: Any | None = ..., - scheme: Any | None = ..., + rFont: Incomplete | None = ..., + charset: Incomplete | None = ..., + family: Incomplete | None = ..., + b: Incomplete | None = ..., + i: Incomplete | None = ..., + strike: Incomplete | None = ..., + outline: Incomplete | None = ..., + shadow: Incomplete | None = ..., + condense: Incomplete | None = ..., + extend: Incomplete | None = ..., + color: Incomplete | None = ..., + sz: Incomplete | None = ..., + u: Incomplete | None = ..., + vertAlign: Incomplete | None = ..., + scheme: Incomplete | None = ..., ) -> None: ... class RichText(Serialisable): tagname: str - rPr: Any - font: Any - t: Any - text: Any - __elements__: Any - def __init__(self, rPr: Any | None = ..., t: Any | None = ...) -> None: ... + rPr: Incomplete + font: Incomplete + t: Incomplete + text: Incomplete + __elements__: Incomplete + def __init__(self, rPr: Incomplete | None = ..., t: Incomplete | None = ...) -> None: ... class Text(Serialisable): tagname: str - t: Any - plain: Any - r: Any - formatted: Any - rPh: Any - phonetic: Any - phoneticPr: Any - PhoneticProperties: Any - __elements__: Any - def __init__(self, t: Any | None = ..., r=..., rPh=..., phoneticPr: Any | None = ...) -> None: ... + t: Incomplete + plain: Incomplete + r: Incomplete + formatted: Incomplete + rPh: Incomplete + phonetic: Incomplete + phoneticPr: Incomplete + PhoneticProperties: Incomplete + __elements__: Incomplete + def __init__(self, t: Incomplete | None = ..., r=..., rPh=..., phoneticPr: Incomplete | None = ...) -> None: ... @property def content(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/_3d.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/_3d.pyi index 3d2eeb4da..174a349c6 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/_3d.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/_3d.pyi @@ -1,50 +1,58 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class View3D(Serialisable): tagname: str - rotX: Any - x_rotation: Any - hPercent: Any - height_percent: Any - rotY: Any - y_rotation: Any - depthPercent: Any - rAngAx: Any - right_angle_axes: Any - perspective: Any - extLst: Any - __elements__: Any + rotX: Incomplete + x_rotation: Incomplete + hPercent: Incomplete + height_percent: Incomplete + rotY: Incomplete + y_rotation: Incomplete + depthPercent: Incomplete + rAngAx: Incomplete + right_angle_axes: Incomplete + perspective: Incomplete + extLst: Incomplete + __elements__: Incomplete def __init__( self, rotX: int = ..., - hPercent: Any | None = ..., + hPercent: Incomplete | None = ..., rotY: int = ..., - depthPercent: Any | None = ..., + depthPercent: Incomplete | None = ..., rAngAx: bool = ..., - perspective: Any | None = ..., - extLst: Any | None = ..., + perspective: Incomplete | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... class Surface(Serialisable): tagname: str - thickness: Any - spPr: Any - graphicalProperties: Any - pictureOptions: Any - extLst: Any - __elements__: Any + thickness: Incomplete + spPr: Incomplete + graphicalProperties: Incomplete + pictureOptions: Incomplete + extLst: Incomplete + __elements__: Incomplete def __init__( - self, thickness: Any | None = ..., spPr: Any | None = ..., pictureOptions: Any | None = ..., extLst: Any | None = ... + self, + thickness: Incomplete | None = ..., + spPr: Incomplete | None = ..., + pictureOptions: Incomplete | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... class _3DBase(Serialisable): tagname: str - view3D: Any - floor: Any - sideWall: Any - backWall: Any + view3D: Incomplete + floor: Incomplete + sideWall: Incomplete + backWall: Incomplete def __init__( - self, view3D: Any | None = ..., floor: Any | None = ..., sideWall: Any | None = ..., backWall: Any | None = ... + self, + view3D: Incomplete | None = ..., + floor: Incomplete | None = ..., + sideWall: Incomplete | None = ..., + backWall: Incomplete | None = ..., ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/_chart.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/_chart.pyi index ac306aadd..fb9f38804 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/_chart.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/_chart.pyi @@ -1,39 +1,39 @@ +from _typeshed import Incomplete from abc import abstractmethod -from typing import Any from openpyxl.descriptors.serialisable import Serialisable class AxId(Serialisable): # type: ignore[misc] - val: Any + val: Incomplete def __init__(self, val) -> None: ... def PlotArea(): ... class ChartBase(Serialisable): - legend: Any - layout: Any - roundedCorners: Any - axId: Any - visible_cells_only: Any - display_blanks: Any - ser: Any - series: Any - title: Any + legend: Incomplete + layout: Incomplete + roundedCorners: Incomplete + axId: Incomplete + visible_cells_only: Incomplete + display_blanks: Incomplete + ser: Incomplete + series: Incomplete + title: Incomplete anchor: str width: int height: float - style: Any + style: Incomplete mime_type: str - graphical_properties: Any - __elements__: Any - plot_area: Any - pivotSource: Any - pivotFormats: Any + graphical_properties: Incomplete + __elements__: Incomplete + plot_area: Incomplete + pivotSource: Incomplete + pivotFormats: Incomplete idx_base: int def __init__(self, axId=..., **kw) -> None: ... - def __hash__(self): ... + def __hash__(self) -> int: ... def __iadd__(self, other): ... - def to_tree(self, namespace: Any | None = ..., tagname: Any | None = ..., idx: Any | None = ...): ... # type: ignore[override] + def to_tree(self, namespace: Incomplete | None = ..., tagname: Incomplete | None = ..., idx: Incomplete | None = ...): ... # type: ignore[override] def set_categories(self, labels) -> None: ... def add_data(self, data, from_rows: bool = ..., titles_from_data: bool = ...) -> None: ... def append(self, value) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/area_chart.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/area_chart.pyi index 8e70dd76d..dc40da13a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/area_chart.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/area_chart.pyi @@ -1,18 +1,23 @@ +from _typeshed import Incomplete from abc import abstractmethod -from typing import Any from ._chart import ChartBase class _AreaChartBase(ChartBase): - grouping: Any - varyColors: Any - ser: Any - dLbls: Any - dataLabels: Any - dropLines: Any - __elements__: Any + grouping: Incomplete + varyColors: Incomplete + ser: Incomplete + dLbls: Incomplete + dataLabels: Incomplete + dropLines: Incomplete + __elements__: Incomplete def __init__( - self, grouping: str = ..., varyColors: Any | None = ..., ser=..., dLbls: Any | None = ..., dropLines: Any | None = ... + self, + grouping: str = ..., + varyColors: Incomplete | None = ..., + ser=..., + dLbls: Incomplete | None = ..., + dropLines: Incomplete | None = ..., ) -> None: ... @property @abstractmethod @@ -20,27 +25,27 @@ class _AreaChartBase(ChartBase): class AreaChart(_AreaChartBase): tagname: str - grouping: Any - varyColors: Any - ser: Any - dLbls: Any - dropLines: Any - x_axis: Any - y_axis: Any - extLst: Any - __elements__: Any - def __init__(self, axId: Any | None = ..., extLst: Any | None = ..., **kw) -> None: ... + grouping: Incomplete + varyColors: Incomplete + ser: Incomplete + dLbls: Incomplete + dropLines: Incomplete + x_axis: Incomplete + y_axis: Incomplete + extLst: Incomplete + __elements__: Incomplete + def __init__(self, axId: Incomplete | None = ..., extLst: Incomplete | None = ..., **kw) -> None: ... class AreaChart3D(AreaChart): tagname: str - grouping: Any - varyColors: Any - ser: Any - dLbls: Any - dropLines: Any - gapDepth: Any - x_axis: Any - y_axis: Any - z_axis: Any - __elements__: Any - def __init__(self, gapDepth: Any | None = ..., **kw) -> None: ... + grouping: Incomplete + varyColors: Incomplete + ser: Incomplete + dLbls: Incomplete + dropLines: Incomplete + gapDepth: Incomplete + x_axis: Incomplete + y_axis: Incomplete + z_axis: Incomplete + __elements__: Incomplete + def __init__(self, gapDepth: Incomplete | None = ..., **kw) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/axis.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/axis.pyi index ffdbc6a39..2bf227bc9 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/axis.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/axis.pyi @@ -1,70 +1,70 @@ +from _typeshed import Incomplete from abc import abstractmethod -from typing import Any from openpyxl.descriptors.serialisable import Serialisable class ChartLines(Serialisable): tagname: str - spPr: Any - graphicalProperties: Any - def __init__(self, spPr: Any | None = ...) -> None: ... + spPr: Incomplete + graphicalProperties: Incomplete + def __init__(self, spPr: Incomplete | None = ...) -> None: ... class Scaling(Serialisable): tagname: str - logBase: Any - orientation: Any - max: Any - min: Any - extLst: Any - __elements__: Any + logBase: Incomplete + orientation: Incomplete + max: Incomplete + min: Incomplete + extLst: Incomplete + __elements__: Incomplete def __init__( self, - logBase: Any | None = ..., + logBase: Incomplete | None = ..., orientation: str = ..., - max: Any | None = ..., - min: Any | None = ..., - extLst: Any | None = ..., + max: Incomplete | None = ..., + min: Incomplete | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... class _BaseAxis(Serialisable): - axId: Any - scaling: Any - delete: Any - axPos: Any - majorGridlines: Any - minorGridlines: Any - title: Any - numFmt: Any - number_format: Any - majorTickMark: Any - minorTickMark: Any - tickLblPos: Any - spPr: Any - graphicalProperties: Any - txPr: Any - textProperties: Any - crossAx: Any - crosses: Any - crossesAt: Any - __elements__: Any + axId: Incomplete + scaling: Incomplete + delete: Incomplete + axPos: Incomplete + majorGridlines: Incomplete + minorGridlines: Incomplete + title: Incomplete + numFmt: Incomplete + number_format: Incomplete + majorTickMark: Incomplete + minorTickMark: Incomplete + tickLblPos: Incomplete + spPr: Incomplete + graphicalProperties: Incomplete + txPr: Incomplete + textProperties: Incomplete + crossAx: Incomplete + crosses: Incomplete + crossesAt: Incomplete + __elements__: Incomplete def __init__( self, - axId: Any | None = ..., - scaling: Any | None = ..., - delete: Any | None = ..., + axId: Incomplete | None = ..., + scaling: Incomplete | None = ..., + delete: Incomplete | None = ..., axPos: str = ..., - majorGridlines: Any | None = ..., - minorGridlines: Any | None = ..., - title: Any | None = ..., - numFmt: Any | None = ..., - majorTickMark: Any | None = ..., - minorTickMark: Any | None = ..., - tickLblPos: Any | None = ..., - spPr: Any | None = ..., - txPr: Any | None = ..., - crossAx: Any | None = ..., - crosses: Any | None = ..., - crossesAt: Any | None = ..., + majorGridlines: Incomplete | None = ..., + minorGridlines: Incomplete | None = ..., + title: Incomplete | None = ..., + numFmt: Incomplete | None = ..., + majorTickMark: Incomplete | None = ..., + minorTickMark: Incomplete | None = ..., + tickLblPos: Incomplete | None = ..., + spPr: Incomplete | None = ..., + txPr: Incomplete | None = ..., + crossAx: Incomplete | None = ..., + crosses: Incomplete | None = ..., + crossesAt: Incomplete | None = ..., ) -> None: ... @property @abstractmethod @@ -72,60 +72,68 @@ class _BaseAxis(Serialisable): class DisplayUnitsLabel(Serialisable): tagname: str - layout: Any - tx: Any - text: Any - spPr: Any - graphicalProperties: Any - txPr: Any - textPropertes: Any - __elements__: Any + layout: Incomplete + tx: Incomplete + text: Incomplete + spPr: Incomplete + graphicalProperties: Incomplete + txPr: Incomplete + textPropertes: Incomplete + __elements__: Incomplete def __init__( - self, layout: Any | None = ..., tx: Any | None = ..., spPr: Any | None = ..., txPr: Any | None = ... + self, + layout: Incomplete | None = ..., + tx: Incomplete | None = ..., + spPr: Incomplete | None = ..., + txPr: Incomplete | None = ..., ) -> None: ... class DisplayUnitsLabelList(Serialisable): tagname: str - custUnit: Any - builtInUnit: Any - dispUnitsLbl: Any - extLst: Any - __elements__: Any + custUnit: Incomplete + builtInUnit: Incomplete + dispUnitsLbl: Incomplete + extLst: Incomplete + __elements__: Incomplete def __init__( - self, custUnit: Any | None = ..., builtInUnit: Any | None = ..., dispUnitsLbl: Any | None = ..., extLst: Any | None = ... + self, + custUnit: Incomplete | None = ..., + builtInUnit: Incomplete | None = ..., + dispUnitsLbl: Incomplete | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... class NumericAxis(_BaseAxis): tagname: str - axId: Any - scaling: Any - delete: Any - axPos: Any - majorGridlines: Any - minorGridlines: Any - title: Any - numFmt: Any - majorTickMark: Any - minorTickMark: Any - tickLblPos: Any - spPr: Any - txPr: Any - crossAx: Any - crosses: Any - crossesAt: Any - crossBetween: Any - majorUnit: Any - minorUnit: Any - dispUnits: Any - extLst: Any - __elements__: Any + axId: Incomplete + scaling: Incomplete + delete: Incomplete + axPos: Incomplete + majorGridlines: Incomplete + minorGridlines: Incomplete + title: Incomplete + numFmt: Incomplete + majorTickMark: Incomplete + minorTickMark: Incomplete + tickLblPos: Incomplete + spPr: Incomplete + txPr: Incomplete + crossAx: Incomplete + crosses: Incomplete + crossesAt: Incomplete + crossBetween: Incomplete + majorUnit: Incomplete + minorUnit: Incomplete + dispUnits: Incomplete + extLst: Incomplete + __elements__: Incomplete def __init__( self, - crossBetween: Any | None = ..., - majorUnit: Any | None = ..., - minorUnit: Any | None = ..., - dispUnits: Any | None = ..., - extLst: Any | None = ..., + crossBetween: Incomplete | None = ..., + majorUnit: Incomplete | None = ..., + minorUnit: Incomplete | None = ..., + dispUnits: Incomplete | None = ..., + extLst: Incomplete | None = ..., **kw, ) -> None: ... @classmethod @@ -133,102 +141,104 @@ class NumericAxis(_BaseAxis): class TextAxis(_BaseAxis): tagname: str - axId: Any - scaling: Any - delete: Any - axPos: Any - majorGridlines: Any - minorGridlines: Any - title: Any - numFmt: Any - majorTickMark: Any - minorTickMark: Any - tickLblPos: Any - spPr: Any - txPr: Any - crossAx: Any - crosses: Any - crossesAt: Any - auto: Any - lblAlgn: Any - lblOffset: Any - tickLblSkip: Any - tickMarkSkip: Any - noMultiLvlLbl: Any - extLst: Any - __elements__: Any + axId: Incomplete + scaling: Incomplete + delete: Incomplete + axPos: Incomplete + majorGridlines: Incomplete + minorGridlines: Incomplete + title: Incomplete + numFmt: Incomplete + majorTickMark: Incomplete + minorTickMark: Incomplete + tickLblPos: Incomplete + spPr: Incomplete + txPr: Incomplete + crossAx: Incomplete + crosses: Incomplete + crossesAt: Incomplete + auto: Incomplete + lblAlgn: Incomplete + lblOffset: Incomplete + tickLblSkip: Incomplete + tickMarkSkip: Incomplete + noMultiLvlLbl: Incomplete + extLst: Incomplete + __elements__: Incomplete def __init__( self, - auto: Any | None = ..., - lblAlgn: Any | None = ..., + auto: Incomplete | None = ..., + lblAlgn: Incomplete | None = ..., lblOffset: int = ..., - tickLblSkip: Any | None = ..., - tickMarkSkip: Any | None = ..., - noMultiLvlLbl: Any | None = ..., - extLst: Any | None = ..., + tickLblSkip: Incomplete | None = ..., + tickMarkSkip: Incomplete | None = ..., + noMultiLvlLbl: Incomplete | None = ..., + extLst: Incomplete | None = ..., **kw, ) -> None: ... class DateAxis(TextAxis): tagname: str - axId: Any - scaling: Any - delete: Any - axPos: Any - majorGridlines: Any - minorGridlines: Any - title: Any - numFmt: Any - majorTickMark: Any - minorTickMark: Any - tickLblPos: Any - spPr: Any - txPr: Any - crossAx: Any - crosses: Any - crossesAt: Any - auto: Any - lblOffset: Any - baseTimeUnit: Any - majorUnit: Any - majorTimeUnit: Any - minorUnit: Any - minorTimeUnit: Any - extLst: Any - __elements__: Any + axId: Incomplete + scaling: Incomplete + delete: Incomplete + axPos: Incomplete + majorGridlines: Incomplete + minorGridlines: Incomplete + title: Incomplete + numFmt: Incomplete + majorTickMark: Incomplete + minorTickMark: Incomplete + tickLblPos: Incomplete + spPr: Incomplete + txPr: Incomplete + crossAx: Incomplete + crosses: Incomplete + crossesAt: Incomplete + auto: Incomplete + lblOffset: Incomplete + baseTimeUnit: Incomplete + majorUnit: Incomplete + majorTimeUnit: Incomplete + minorUnit: Incomplete + minorTimeUnit: Incomplete + extLst: Incomplete + __elements__: Incomplete def __init__( self, - auto: Any | None = ..., - lblOffset: Any | None = ..., - baseTimeUnit: Any | None = ..., - majorUnit: Any | None = ..., - majorTimeUnit: Any | None = ..., - minorUnit: Any | None = ..., - minorTimeUnit: Any | None = ..., - extLst: Any | None = ..., + auto: Incomplete | None = ..., + lblOffset: Incomplete | None = ..., + baseTimeUnit: Incomplete | None = ..., + majorUnit: Incomplete | None = ..., + majorTimeUnit: Incomplete | None = ..., + minorUnit: Incomplete | None = ..., + minorTimeUnit: Incomplete | None = ..., + extLst: Incomplete | None = ..., **kw, ) -> None: ... class SeriesAxis(_BaseAxis): tagname: str - axId: Any - scaling: Any - delete: Any - axPos: Any - majorGridlines: Any - minorGridlines: Any - title: Any - numFmt: Any - majorTickMark: Any - minorTickMark: Any - tickLblPos: Any - spPr: Any - txPr: Any - crossAx: Any - crosses: Any - crossesAt: Any - tickLblSkip: Any - tickMarkSkip: Any - extLst: Any - __elements__: Any - def __init__(self, tickLblSkip: Any | None = ..., tickMarkSkip: Any | None = ..., extLst: Any | None = ..., **kw) -> None: ... + axId: Incomplete + scaling: Incomplete + delete: Incomplete + axPos: Incomplete + majorGridlines: Incomplete + minorGridlines: Incomplete + title: Incomplete + numFmt: Incomplete + majorTickMark: Incomplete + minorTickMark: Incomplete + tickLblPos: Incomplete + spPr: Incomplete + txPr: Incomplete + crossAx: Incomplete + crosses: Incomplete + crossesAt: Incomplete + tickLblSkip: Incomplete + tickMarkSkip: Incomplete + extLst: Incomplete + __elements__: Incomplete + def __init__( + self, tickLblSkip: Incomplete | None = ..., tickMarkSkip: Incomplete | None = ..., extLst: Incomplete | None = ..., **kw + ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/bar_chart.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/bar_chart.pyi index d48fc86ef..04cc873ce 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/bar_chart.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/bar_chart.pyi @@ -1,20 +1,26 @@ +from _typeshed import Incomplete from abc import abstractmethod -from typing import Any from ._3d import _3DBase from ._chart import ChartBase class _BarChartBase(ChartBase): - barDir: Any - type: Any - grouping: Any - varyColors: Any - ser: Any - dLbls: Any - dataLabels: Any - __elements__: Any + barDir: Incomplete + type: Incomplete + grouping: Incomplete + varyColors: Incomplete + ser: Incomplete + dLbls: Incomplete + dataLabels: Incomplete + __elements__: Incomplete def __init__( - self, barDir: str = ..., grouping: str = ..., varyColors: Any | None = ..., ser=..., dLbls: Any | None = ..., **kw + self, + barDir: str = ..., + grouping: str = ..., + varyColors: Incomplete | None = ..., + ser=..., + dLbls: Incomplete | None = ..., + **kw, ) -> None: ... @property @abstractmethod @@ -22,49 +28,54 @@ class _BarChartBase(ChartBase): class BarChart(_BarChartBase): tagname: str - barDir: Any - grouping: Any - varyColors: Any - ser: Any - dLbls: Any - gapWidth: Any - overlap: Any - serLines: Any - extLst: Any - x_axis: Any - y_axis: Any - __elements__: Any - legend: Any + barDir: Incomplete + grouping: Incomplete + varyColors: Incomplete + ser: Incomplete + dLbls: Incomplete + gapWidth: Incomplete + overlap: Incomplete + serLines: Incomplete + extLst: Incomplete + x_axis: Incomplete + y_axis: Incomplete + __elements__: Incomplete + legend: Incomplete def __init__( - self, gapWidth: int = ..., overlap: Any | None = ..., serLines: Any | None = ..., extLst: Any | None = ..., **kw + self, + gapWidth: int = ..., + overlap: Incomplete | None = ..., + serLines: Incomplete | None = ..., + extLst: Incomplete | None = ..., + **kw, ) -> None: ... class BarChart3D(_BarChartBase, _3DBase): tagname: str - barDir: Any - grouping: Any - varyColors: Any - ser: Any - dLbls: Any - view3D: Any - floor: Any - sideWall: Any - backWall: Any - gapWidth: Any - gapDepth: Any - shape: Any - serLines: Any - extLst: Any - x_axis: Any - y_axis: Any - z_axis: Any - __elements__: Any + barDir: Incomplete + grouping: Incomplete + varyColors: Incomplete + ser: Incomplete + dLbls: Incomplete + view3D: Incomplete + floor: Incomplete + sideWall: Incomplete + backWall: Incomplete + gapWidth: Incomplete + gapDepth: Incomplete + shape: Incomplete + serLines: Incomplete + extLst: Incomplete + x_axis: Incomplete + y_axis: Incomplete + z_axis: Incomplete + __elements__: Incomplete def __init__( self, gapWidth: int = ..., gapDepth: int = ..., - shape: Any | None = ..., - serLines: Any | None = ..., - extLst: Any | None = ..., + shape: Incomplete | None = ..., + serLines: Incomplete | None = ..., + extLst: Incomplete | None = ..., **kw, ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/bubble_chart.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/bubble_chart.pyi index 16b74ead2..aea9771c1 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/bubble_chart.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/bubble_chart.pyi @@ -1,30 +1,30 @@ -from typing import Any +from _typeshed import Incomplete from ._chart import ChartBase class BubbleChart(ChartBase): tagname: str - varyColors: Any - ser: Any - dLbls: Any - dataLabels: Any - bubble3D: Any - bubbleScale: Any - showNegBubbles: Any - sizeRepresents: Any - extLst: Any - x_axis: Any - y_axis: Any - __elements__: Any + varyColors: Incomplete + ser: Incomplete + dLbls: Incomplete + dataLabels: Incomplete + bubble3D: Incomplete + bubbleScale: Incomplete + showNegBubbles: Incomplete + sizeRepresents: Incomplete + extLst: Incomplete + x_axis: Incomplete + y_axis: Incomplete + __elements__: Incomplete def __init__( self, - varyColors: Any | None = ..., + varyColors: Incomplete | None = ..., ser=..., - dLbls: Any | None = ..., - bubble3D: Any | None = ..., - bubbleScale: Any | None = ..., - showNegBubbles: Any | None = ..., - sizeRepresents: Any | None = ..., - extLst: Any | None = ..., + dLbls: Incomplete | None = ..., + bubble3D: Incomplete | None = ..., + bubbleScale: Incomplete | None = ..., + showNegBubbles: Incomplete | None = ..., + sizeRepresents: Incomplete | None = ..., + extLst: Incomplete | None = ..., **kw, ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/chartspace.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/chartspace.pyi index 0d4d44d73..5d0628534 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/chartspace.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/chartspace.pyi @@ -1,97 +1,97 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class ChartContainer(Serialisable): tagname: str - title: Any - autoTitleDeleted: Any - pivotFmts: Any - view3D: Any - floor: Any - sideWall: Any - backWall: Any - plotArea: Any - legend: Any - plotVisOnly: Any - dispBlanksAs: Any - showDLblsOverMax: Any - extLst: Any - __elements__: Any + title: Incomplete + autoTitleDeleted: Incomplete + pivotFmts: Incomplete + view3D: Incomplete + floor: Incomplete + sideWall: Incomplete + backWall: Incomplete + plotArea: Incomplete + legend: Incomplete + plotVisOnly: Incomplete + dispBlanksAs: Incomplete + showDLblsOverMax: Incomplete + extLst: Incomplete + __elements__: Incomplete def __init__( self, - title: Any | None = ..., - autoTitleDeleted: Any | None = ..., + title: Incomplete | None = ..., + autoTitleDeleted: Incomplete | None = ..., pivotFmts=..., - view3D: Any | None = ..., - floor: Any | None = ..., - sideWall: Any | None = ..., - backWall: Any | None = ..., - plotArea: Any | None = ..., - legend: Any | None = ..., + view3D: Incomplete | None = ..., + floor: Incomplete | None = ..., + sideWall: Incomplete | None = ..., + backWall: Incomplete | None = ..., + plotArea: Incomplete | None = ..., + legend: Incomplete | None = ..., plotVisOnly: bool = ..., dispBlanksAs: str = ..., - showDLblsOverMax: Any | None = ..., - extLst: Any | None = ..., + showDLblsOverMax: Incomplete | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... class Protection(Serialisable): tagname: str - chartObject: Any - data: Any - formatting: Any - selection: Any - userInterface: Any - __elements__: Any + chartObject: Incomplete + data: Incomplete + formatting: Incomplete + selection: Incomplete + userInterface: Incomplete + __elements__: Incomplete def __init__( self, - chartObject: Any | None = ..., - data: Any | None = ..., - formatting: Any | None = ..., - selection: Any | None = ..., - userInterface: Any | None = ..., + chartObject: Incomplete | None = ..., + data: Incomplete | None = ..., + formatting: Incomplete | None = ..., + selection: Incomplete | None = ..., + userInterface: Incomplete | None = ..., ) -> None: ... class ExternalData(Serialisable): tagname: str - autoUpdate: Any - id: Any - def __init__(self, autoUpdate: Any | None = ..., id: Any | None = ...) -> None: ... + autoUpdate: Incomplete + id: Incomplete + def __init__(self, autoUpdate: Incomplete | None = ..., id: Incomplete | None = ...) -> None: ... class ChartSpace(Serialisable): tagname: str - date1904: Any - lang: Any - roundedCorners: Any - style: Any - clrMapOvr: Any - pivotSource: Any - protection: Any - chart: Any - spPr: Any - graphicalProperties: Any - txPr: Any - textProperties: Any - externalData: Any - printSettings: Any - userShapes: Any - extLst: Any - __elements__: Any + date1904: Incomplete + lang: Incomplete + roundedCorners: Incomplete + style: Incomplete + clrMapOvr: Incomplete + pivotSource: Incomplete + protection: Incomplete + chart: Incomplete + spPr: Incomplete + graphicalProperties: Incomplete + txPr: Incomplete + textProperties: Incomplete + externalData: Incomplete + printSettings: Incomplete + userShapes: Incomplete + extLst: Incomplete + __elements__: Incomplete def __init__( self, - date1904: Any | None = ..., - lang: Any | None = ..., - roundedCorners: Any | None = ..., - style: Any | None = ..., - clrMapOvr: Any | None = ..., - pivotSource: Any | None = ..., - protection: Any | None = ..., - chart: Any | None = ..., - spPr: Any | None = ..., - txPr: Any | None = ..., - externalData: Any | None = ..., - printSettings: Any | None = ..., - userShapes: Any | None = ..., - extLst: Any | None = ..., + date1904: Incomplete | None = ..., + lang: Incomplete | None = ..., + roundedCorners: Incomplete | None = ..., + style: Incomplete | None = ..., + clrMapOvr: Incomplete | None = ..., + pivotSource: Incomplete | None = ..., + protection: Incomplete | None = ..., + chart: Incomplete | None = ..., + spPr: Incomplete | None = ..., + txPr: Incomplete | None = ..., + externalData: Incomplete | None = ..., + printSettings: Incomplete | None = ..., + userShapes: Incomplete | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... - def to_tree(self, tagname: Any | None = ..., idx: Any | None = ..., namespace: Any | None = ...): ... + def to_tree(self, tagname: Incomplete | None = ..., idx: Incomplete | None = ..., namespace: Incomplete | None = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/data_source.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/data_source.pyi index d927a58bb..b71a03dce 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/data_source.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/data_source.pyi @@ -1,101 +1,109 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.nested import NestedText from openpyxl.descriptors.serialisable import Serialisable class NumFmt(Serialisable): # type: ignore[misc] - formatCode: Any - sourceLinked: Any - def __init__(self, formatCode: Any | None = ..., sourceLinked: bool = ...) -> None: ... + formatCode: Incomplete + sourceLinked: Incomplete + def __init__(self, formatCode: Incomplete | None = ..., sourceLinked: bool = ...) -> None: ... class NumberValueDescriptor(NestedText): allow_none: bool - expected_type: Any + expected_type: Incomplete def __set__(self, instance, value) -> None: ... class NumVal(Serialisable): # type: ignore[misc] - idx: Any - formatCode: Any - v: Any - def __init__(self, idx: Any | None = ..., formatCode: Any | None = ..., v: Any | None = ...) -> None: ... + idx: Incomplete + formatCode: Incomplete + v: Incomplete + def __init__(self, idx: Incomplete | None = ..., formatCode: Incomplete | None = ..., v: Incomplete | None = ...) -> None: ... class NumData(Serialisable): # type: ignore[misc] - formatCode: Any - ptCount: Any - pt: Any - extLst: Any - __elements__: Any - def __init__(self, formatCode: Any | None = ..., ptCount: Any | None = ..., pt=..., extLst: Any | None = ...) -> None: ... + formatCode: Incomplete + ptCount: Incomplete + pt: Incomplete + extLst: Incomplete + __elements__: Incomplete + def __init__( + self, formatCode: Incomplete | None = ..., ptCount: Incomplete | None = ..., pt=..., extLst: Incomplete | None = ... + ) -> None: ... class NumRef(Serialisable): # type: ignore[misc] - f: Any - ref: Any - numCache: Any - extLst: Any - __elements__: Any - def __init__(self, f: Any | None = ..., numCache: Any | None = ..., extLst: Any | None = ...) -> None: ... + f: Incomplete + ref: Incomplete + numCache: Incomplete + extLst: Incomplete + __elements__: Incomplete + def __init__( + self, f: Incomplete | None = ..., numCache: Incomplete | None = ..., extLst: Incomplete | None = ... + ) -> None: ... class StrVal(Serialisable): tagname: str - idx: Any - v: Any - def __init__(self, idx: int = ..., v: Any | None = ...) -> None: ... + idx: Incomplete + v: Incomplete + def __init__(self, idx: int = ..., v: Incomplete | None = ...) -> None: ... class StrData(Serialisable): tagname: str - ptCount: Any - pt: Any - extLst: Any - __elements__: Any - def __init__(self, ptCount: Any | None = ..., pt=..., extLst: Any | None = ...) -> None: ... + ptCount: Incomplete + pt: Incomplete + extLst: Incomplete + __elements__: Incomplete + def __init__(self, ptCount: Incomplete | None = ..., pt=..., extLst: Incomplete | None = ...) -> None: ... class StrRef(Serialisable): tagname: str - f: Any - strCache: Any - extLst: Any - __elements__: Any - def __init__(self, f: Any | None = ..., strCache: Any | None = ..., extLst: Any | None = ...) -> None: ... + f: Incomplete + strCache: Incomplete + extLst: Incomplete + __elements__: Incomplete + def __init__( + self, f: Incomplete | None = ..., strCache: Incomplete | None = ..., extLst: Incomplete | None = ... + ) -> None: ... class NumDataSource(Serialisable): # type: ignore[misc] - numRef: Any - numLit: Any - def __init__(self, numRef: Any | None = ..., numLit: Any | None = ...) -> None: ... + numRef: Incomplete + numLit: Incomplete + def __init__(self, numRef: Incomplete | None = ..., numLit: Incomplete | None = ...) -> None: ... class Level(Serialisable): tagname: str - pt: Any - __elements__: Any + pt: Incomplete + __elements__: Incomplete def __init__(self, pt=...) -> None: ... class MultiLevelStrData(Serialisable): tagname: str - ptCount: Any - lvl: Any - extLst: Any - __elements__: Any - def __init__(self, ptCount: Any | None = ..., lvl=..., extLst: Any | None = ...) -> None: ... + ptCount: Incomplete + lvl: Incomplete + extLst: Incomplete + __elements__: Incomplete + def __init__(self, ptCount: Incomplete | None = ..., lvl=..., extLst: Incomplete | None = ...) -> None: ... class MultiLevelStrRef(Serialisable): tagname: str - f: Any - multiLvlStrCache: Any - extLst: Any - __elements__: Any - def __init__(self, f: Any | None = ..., multiLvlStrCache: Any | None = ..., extLst: Any | None = ...) -> None: ... + f: Incomplete + multiLvlStrCache: Incomplete + extLst: Incomplete + __elements__: Incomplete + def __init__( + self, f: Incomplete | None = ..., multiLvlStrCache: Incomplete | None = ..., extLst: Incomplete | None = ... + ) -> None: ... class AxDataSource(Serialisable): tagname: str - numRef: Any - numLit: Any - strRef: Any - strLit: Any - multiLvlStrRef: Any + numRef: Incomplete + numLit: Incomplete + strRef: Incomplete + strLit: Incomplete + multiLvlStrRef: Incomplete def __init__( self, - numRef: Any | None = ..., - numLit: Any | None = ..., - strRef: Any | None = ..., - strLit: Any | None = ..., - multiLvlStrRef: Any | None = ..., + numRef: Incomplete | None = ..., + numLit: Incomplete | None = ..., + strRef: Incomplete | None = ..., + strLit: Incomplete | None = ..., + multiLvlStrRef: Incomplete | None = ..., ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/descriptors.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/descriptors.pyi index 7b86609d1..4c8407af4 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/descriptors.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/descriptors.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors import Typed from openpyxl.descriptors.nested import NestedMinMax @@ -14,6 +14,6 @@ class NestedOverlap(NestedMinMax): max: int class NumberFormatDescriptor(Typed): - expected_type: Any + expected_type: Incomplete allow_none: bool def __set__(self, instance, value) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/error_bar.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/error_bar.pyi index 211ca6991..102fd176b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/error_bar.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/error_bar.pyi @@ -1,32 +1,32 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class ErrorBars(Serialisable): tagname: str - errDir: Any - direction: Any - errBarType: Any - style: Any - errValType: Any - size: Any - noEndCap: Any - plus: Any - minus: Any - val: Any - spPr: Any - graphicalProperties: Any - extLst: Any - __elements__: Any + errDir: Incomplete + direction: Incomplete + errBarType: Incomplete + style: Incomplete + errValType: Incomplete + size: Incomplete + noEndCap: Incomplete + plus: Incomplete + minus: Incomplete + val: Incomplete + spPr: Incomplete + graphicalProperties: Incomplete + extLst: Incomplete + __elements__: Incomplete def __init__( self, - errDir: Any | None = ..., + errDir: Incomplete | None = ..., errBarType: str = ..., errValType: str = ..., - noEndCap: Any | None = ..., - plus: Any | None = ..., - minus: Any | None = ..., - val: Any | None = ..., - spPr: Any | None = ..., - extLst: Any | None = ..., + noEndCap: Incomplete | None = ..., + plus: Incomplete | None = ..., + minus: Incomplete | None = ..., + val: Incomplete | None = ..., + spPr: Incomplete | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/label.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/label.pyi index e6e58b6a6..b5bb682f5 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/label.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/label.pyi @@ -1,41 +1,41 @@ +from _typeshed import Incomplete from abc import abstractmethod -from typing import Any from openpyxl.descriptors.serialisable import Serialisable as Serialisable class _DataLabelBase(Serialisable): - numFmt: Any - spPr: Any - graphicalProperties: Any - txPr: Any - textProperties: Any - dLblPos: Any - position: Any - showLegendKey: Any - showVal: Any - showCatName: Any - showSerName: Any - showPercent: Any - showBubbleSize: Any - showLeaderLines: Any - separator: Any - extLst: Any - __elements__: Any + numFmt: Incomplete + spPr: Incomplete + graphicalProperties: Incomplete + txPr: Incomplete + textProperties: Incomplete + dLblPos: Incomplete + position: Incomplete + showLegendKey: Incomplete + showVal: Incomplete + showCatName: Incomplete + showSerName: Incomplete + showPercent: Incomplete + showBubbleSize: Incomplete + showLeaderLines: Incomplete + separator: Incomplete + extLst: Incomplete + __elements__: Incomplete def __init__( self, - numFmt: Any | None = ..., - spPr: Any | None = ..., - txPr: Any | None = ..., - dLblPos: Any | None = ..., - showLegendKey: Any | None = ..., - showVal: Any | None = ..., - showCatName: Any | None = ..., - showSerName: Any | None = ..., - showPercent: Any | None = ..., - showBubbleSize: Any | None = ..., - showLeaderLines: Any | None = ..., - separator: Any | None = ..., - extLst: Any | None = ..., + numFmt: Incomplete | None = ..., + spPr: Incomplete | None = ..., + txPr: Incomplete | None = ..., + dLblPos: Incomplete | None = ..., + showLegendKey: Incomplete | None = ..., + showVal: Incomplete | None = ..., + showCatName: Incomplete | None = ..., + showSerName: Incomplete | None = ..., + showPercent: Incomplete | None = ..., + showBubbleSize: Incomplete | None = ..., + showLeaderLines: Incomplete | None = ..., + separator: Incomplete | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... @property @abstractmethod @@ -43,39 +43,39 @@ class _DataLabelBase(Serialisable): class DataLabel(_DataLabelBase): tagname: str - idx: Any - numFmt: Any - spPr: Any - txPr: Any - dLblPos: Any - showLegendKey: Any - showVal: Any - showCatName: Any - showSerName: Any - showPercent: Any - showBubbleSize: Any - showLeaderLines: Any - separator: Any - extLst: Any - __elements__: Any + idx: Incomplete + numFmt: Incomplete + spPr: Incomplete + txPr: Incomplete + dLblPos: Incomplete + showLegendKey: Incomplete + showVal: Incomplete + showCatName: Incomplete + showSerName: Incomplete + showPercent: Incomplete + showBubbleSize: Incomplete + showLeaderLines: Incomplete + separator: Incomplete + extLst: Incomplete + __elements__: Incomplete def __init__(self, idx: int = ..., **kw) -> None: ... class DataLabelList(_DataLabelBase): tagname: str - dLbl: Any - delete: Any - numFmt: Any - spPr: Any - txPr: Any - dLblPos: Any - showLegendKey: Any - showVal: Any - showCatName: Any - showSerName: Any - showPercent: Any - showBubbleSize: Any - showLeaderLines: Any - separator: Any - extLst: Any - __elements__: Any - def __init__(self, dLbl=..., delete: Any | None = ..., **kw) -> None: ... + dLbl: Incomplete + delete: Incomplete + numFmt: Incomplete + spPr: Incomplete + txPr: Incomplete + dLblPos: Incomplete + showLegendKey: Incomplete + showVal: Incomplete + showCatName: Incomplete + showSerName: Incomplete + showPercent: Incomplete + showBubbleSize: Incomplete + showLeaderLines: Incomplete + separator: Incomplete + extLst: Incomplete + __elements__: Incomplete + def __init__(self, dLbl=..., delete: Incomplete | None = ..., **kw) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/layout.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/layout.pyi index c7ef17f84..1bb85f85e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/layout.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/layout.pyi @@ -1,39 +1,39 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class ManualLayout(Serialisable): tagname: str - layoutTarget: Any - xMode: Any - yMode: Any - wMode: Any - hMode: Any - x: Any - y: Any - w: Any - width: Any - h: Any - height: Any - extLst: Any - __elements__: Any + layoutTarget: Incomplete + xMode: Incomplete + yMode: Incomplete + wMode: Incomplete + hMode: Incomplete + x: Incomplete + y: Incomplete + w: Incomplete + width: Incomplete + h: Incomplete + height: Incomplete + extLst: Incomplete + __elements__: Incomplete def __init__( self, - layoutTarget: Any | None = ..., - xMode: Any | None = ..., - yMode: Any | None = ..., + layoutTarget: Incomplete | None = ..., + xMode: Incomplete | None = ..., + yMode: Incomplete | None = ..., wMode: str = ..., hMode: str = ..., - x: Any | None = ..., - y: Any | None = ..., - w: Any | None = ..., - h: Any | None = ..., - extLst: Any | None = ..., + x: Incomplete | None = ..., + y: Incomplete | None = ..., + w: Incomplete | None = ..., + h: Incomplete | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... class Layout(Serialisable): tagname: str - manualLayout: Any - extLst: Any - __elements__: Any - def __init__(self, manualLayout: Any | None = ..., extLst: Any | None = ...) -> None: ... + manualLayout: Incomplete + extLst: Incomplete + __elements__: Incomplete + def __init__(self, manualLayout: Incomplete | None = ..., extLst: Incomplete | None = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/legend.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/legend.pyi index 66bf483c2..42e7543e0 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/legend.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/legend.pyi @@ -1,36 +1,38 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class LegendEntry(Serialisable): tagname: str - idx: Any - delete: Any - txPr: Any - extLst: Any - __elements__: Any - def __init__(self, idx: int = ..., delete: bool = ..., txPr: Any | None = ..., extLst: Any | None = ...) -> None: ... + idx: Incomplete + delete: Incomplete + txPr: Incomplete + extLst: Incomplete + __elements__: Incomplete + def __init__( + self, idx: int = ..., delete: bool = ..., txPr: Incomplete | None = ..., extLst: Incomplete | None = ... + ) -> None: ... class Legend(Serialisable): tagname: str - legendPos: Any - position: Any - legendEntry: Any - layout: Any - overlay: Any - spPr: Any - graphicalProperties: Any - txPr: Any - textProperties: Any - extLst: Any - __elements__: Any + legendPos: Incomplete + position: Incomplete + legendEntry: Incomplete + layout: Incomplete + overlay: Incomplete + spPr: Incomplete + graphicalProperties: Incomplete + txPr: Incomplete + textProperties: Incomplete + extLst: Incomplete + __elements__: Incomplete def __init__( self, legendPos: str = ..., legendEntry=..., - layout: Any | None = ..., - overlay: Any | None = ..., - spPr: Any | None = ..., - txPr: Any | None = ..., - extLst: Any | None = ..., + layout: Incomplete | None = ..., + overlay: Incomplete | None = ..., + spPr: Incomplete | None = ..., + txPr: Incomplete | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/line_chart.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/line_chart.pyi index 9d2b8e844..4df38afdc 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/line_chart.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/line_chart.pyi @@ -1,23 +1,23 @@ +from _typeshed import Incomplete from abc import abstractmethod -from typing import Any from ._chart import ChartBase class _LineChartBase(ChartBase): - grouping: Any - varyColors: Any - ser: Any - dLbls: Any - dataLabels: Any - dropLines: Any - __elements__: Any + grouping: Incomplete + varyColors: Incomplete + ser: Incomplete + dLbls: Incomplete + dataLabels: Incomplete + dropLines: Incomplete + __elements__: Incomplete def __init__( self, grouping: str = ..., - varyColors: Any | None = ..., + varyColors: Incomplete | None = ..., ser=..., - dLbls: Any | None = ..., - dropLines: Any | None = ..., + dLbls: Incomplete | None = ..., + dropLines: Incomplete | None = ..., **kw, ) -> None: ... @property @@ -26,52 +26,52 @@ class _LineChartBase(ChartBase): class LineChart(_LineChartBase): tagname: str - grouping: Any - varyColors: Any - ser: Any - dLbls: Any - dropLines: Any - hiLowLines: Any - upDownBars: Any - marker: Any - smooth: Any - extLst: Any - x_axis: Any - y_axis: Any - __elements__: Any + grouping: Incomplete + varyColors: Incomplete + ser: Incomplete + dLbls: Incomplete + dropLines: Incomplete + hiLowLines: Incomplete + upDownBars: Incomplete + marker: Incomplete + smooth: Incomplete + extLst: Incomplete + x_axis: Incomplete + y_axis: Incomplete + __elements__: Incomplete def __init__( self, - hiLowLines: Any | None = ..., - upDownBars: Any | None = ..., - marker: Any | None = ..., - smooth: Any | None = ..., - extLst: Any | None = ..., + hiLowLines: Incomplete | None = ..., + upDownBars: Incomplete | None = ..., + marker: Incomplete | None = ..., + smooth: Incomplete | None = ..., + extLst: Incomplete | None = ..., **kw, ) -> None: ... class LineChart3D(_LineChartBase): tagname: str - grouping: Any - varyColors: Any - ser: Any - dLbls: Any - dropLines: Any - gapDepth: Any - hiLowLines: Any - upDownBars: Any - marker: Any - smooth: Any - extLst: Any - x_axis: Any - y_axis: Any - z_axis: Any - __elements__: Any + grouping: Incomplete + varyColors: Incomplete + ser: Incomplete + dLbls: Incomplete + dropLines: Incomplete + gapDepth: Incomplete + hiLowLines: Incomplete + upDownBars: Incomplete + marker: Incomplete + smooth: Incomplete + extLst: Incomplete + x_axis: Incomplete + y_axis: Incomplete + z_axis: Incomplete + __elements__: Incomplete def __init__( self, - gapDepth: Any | None = ..., - hiLowLines: Any | None = ..., - upDownBars: Any | None = ..., - marker: Any | None = ..., - smooth: Any | None = ..., + gapDepth: Incomplete | None = ..., + hiLowLines: Incomplete | None = ..., + upDownBars: Incomplete | None = ..., + marker: Incomplete | None = ..., + smooth: Incomplete | None = ..., **kw, ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/marker.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/marker.pyi index 771917440..56825794a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/marker.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/marker.pyi @@ -1,39 +1,43 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class Marker(Serialisable): tagname: str - symbol: Any - size: Any - spPr: Any - graphicalProperties: Any - extLst: Any - __elements__: Any + symbol: Incomplete + size: Incomplete + spPr: Incomplete + graphicalProperties: Incomplete + extLst: Incomplete + __elements__: Incomplete def __init__( - self, symbol: Any | None = ..., size: Any | None = ..., spPr: Any | None = ..., extLst: Any | None = ... + self, + symbol: Incomplete | None = ..., + size: Incomplete | None = ..., + spPr: Incomplete | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... class DataPoint(Serialisable): tagname: str - idx: Any - invertIfNegative: Any - marker: Any - bubble3D: Any - explosion: Any - spPr: Any - graphicalProperties: Any - pictureOptions: Any - extLst: Any - __elements__: Any + idx: Incomplete + invertIfNegative: Incomplete + marker: Incomplete + bubble3D: Incomplete + explosion: Incomplete + spPr: Incomplete + graphicalProperties: Incomplete + pictureOptions: Incomplete + extLst: Incomplete + __elements__: Incomplete def __init__( self, - idx: Any | None = ..., - invertIfNegative: Any | None = ..., - marker: Any | None = ..., - bubble3D: Any | None = ..., - explosion: Any | None = ..., - spPr: Any | None = ..., - pictureOptions: Any | None = ..., - extLst: Any | None = ..., + idx: Incomplete | None = ..., + invertIfNegative: Incomplete | None = ..., + marker: Incomplete | None = ..., + bubble3D: Incomplete | None = ..., + explosion: Incomplete | None = ..., + spPr: Incomplete | None = ..., + pictureOptions: Incomplete | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/picture.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/picture.pyi index 1f0ed1a2b..5ec116071 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/picture.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/picture.pyi @@ -1,20 +1,20 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class PictureOptions(Serialisable): tagname: str - applyToFront: Any - applyToSides: Any - applyToEnd: Any - pictureFormat: Any - pictureStackUnit: Any - __elements__: Any + applyToFront: Incomplete + applyToSides: Incomplete + applyToEnd: Incomplete + pictureFormat: Incomplete + pictureStackUnit: Incomplete + __elements__: Incomplete def __init__( self, - applyToFront: Any | None = ..., - applyToSides: Any | None = ..., - applyToEnd: Any | None = ..., - pictureFormat: Any | None = ..., - pictureStackUnit: Any | None = ..., + applyToFront: Incomplete | None = ..., + applyToSides: Incomplete | None = ..., + applyToEnd: Incomplete | None = ..., + pictureFormat: Incomplete | None = ..., + pictureStackUnit: Incomplete | None = ..., ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/pie_chart.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/pie_chart.pyi index 8b640c775..839e60d26 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/pie_chart.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/pie_chart.pyi @@ -1,81 +1,81 @@ +from _typeshed import Incomplete from abc import abstractmethod -from typing import Any from openpyxl.descriptors.serialisable import Serialisable from ._chart import ChartBase class _PieChartBase(ChartBase): - varyColors: Any - ser: Any - dLbls: Any - dataLabels: Any - __elements__: Any - def __init__(self, varyColors: bool = ..., ser=..., dLbls: Any | None = ...) -> None: ... + varyColors: Incomplete + ser: Incomplete + dLbls: Incomplete + dataLabels: Incomplete + __elements__: Incomplete + def __init__(self, varyColors: bool = ..., ser=..., dLbls: Incomplete | None = ...) -> None: ... @property @abstractmethod def tagname(self) -> str: ... class PieChart(_PieChartBase): tagname: str - varyColors: Any - ser: Any - dLbls: Any - firstSliceAng: Any - extLst: Any - __elements__: Any - def __init__(self, firstSliceAng: int = ..., extLst: Any | None = ..., **kw) -> None: ... + varyColors: Incomplete + ser: Incomplete + dLbls: Incomplete + firstSliceAng: Incomplete + extLst: Incomplete + __elements__: Incomplete + def __init__(self, firstSliceAng: int = ..., extLst: Incomplete | None = ..., **kw) -> None: ... class PieChart3D(_PieChartBase): tagname: str - varyColors: Any - ser: Any - dLbls: Any - extLst: Any - __elements__: Any + varyColors: Incomplete + ser: Incomplete + dLbls: Incomplete + extLst: Incomplete + __elements__: Incomplete class DoughnutChart(_PieChartBase): tagname: str - varyColors: Any - ser: Any - dLbls: Any - firstSliceAng: Any - holeSize: Any - extLst: Any - __elements__: Any - def __init__(self, firstSliceAng: int = ..., holeSize: int = ..., extLst: Any | None = ..., **kw) -> None: ... + varyColors: Incomplete + ser: Incomplete + dLbls: Incomplete + firstSliceAng: Incomplete + holeSize: Incomplete + extLst: Incomplete + __elements__: Incomplete + def __init__(self, firstSliceAng: int = ..., holeSize: int = ..., extLst: Incomplete | None = ..., **kw) -> None: ... class CustomSplit(Serialisable): tagname: str - secondPiePt: Any - __elements__: Any + secondPiePt: Incomplete + __elements__: Incomplete def __init__(self, secondPiePt=...) -> None: ... class ProjectedPieChart(_PieChartBase): tagname: str - varyColors: Any - ser: Any - dLbls: Any - ofPieType: Any - type: Any - gapWidth: Any - splitType: Any - splitPos: Any - custSplit: Any - secondPieSize: Any - serLines: Any - join_lines: Any - extLst: Any - __elements__: Any + varyColors: Incomplete + ser: Incomplete + dLbls: Incomplete + ofPieType: Incomplete + type: Incomplete + gapWidth: Incomplete + splitType: Incomplete + splitPos: Incomplete + custSplit: Incomplete + secondPieSize: Incomplete + serLines: Incomplete + join_lines: Incomplete + extLst: Incomplete + __elements__: Incomplete def __init__( self, ofPieType: str = ..., - gapWidth: Any | None = ..., + gapWidth: Incomplete | None = ..., splitType: str = ..., - splitPos: Any | None = ..., - custSplit: Any | None = ..., + splitPos: Incomplete | None = ..., + custSplit: Incomplete | None = ..., secondPieSize: int = ..., - serLines: Any | None = ..., - extLst: Any | None = ..., + serLines: Incomplete | None = ..., + extLst: Incomplete | None = ..., **kw, ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/pivot.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/pivot.pyi index 6411afd47..e5e86d237 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/pivot.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/pivot.pyi @@ -1,33 +1,35 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class PivotSource(Serialisable): tagname: str - name: Any - fmtId: Any - extLst: Any - __elements__: Any - def __init__(self, name: Any | None = ..., fmtId: Any | None = ..., extLst: Any | None = ...) -> None: ... + name: Incomplete + fmtId: Incomplete + extLst: Incomplete + __elements__: Incomplete + def __init__( + self, name: Incomplete | None = ..., fmtId: Incomplete | None = ..., extLst: Incomplete | None = ... + ) -> None: ... class PivotFormat(Serialisable): tagname: str - idx: Any - spPr: Any - graphicalProperties: Any - txPr: Any - TextBody: Any - marker: Any - dLbl: Any - DataLabel: Any - extLst: Any - __elements__: Any + idx: Incomplete + spPr: Incomplete + graphicalProperties: Incomplete + txPr: Incomplete + TextBody: Incomplete + marker: Incomplete + dLbl: Incomplete + DataLabel: Incomplete + extLst: Incomplete + __elements__: Incomplete def __init__( self, idx: int = ..., - spPr: Any | None = ..., - txPr: Any | None = ..., - marker: Any | None = ..., - dLbl: Any | None = ..., - extLst: Any | None = ..., + spPr: Incomplete | None = ..., + txPr: Incomplete | None = ..., + marker: Incomplete | None = ..., + dLbl: Incomplete | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/plotarea.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/plotarea.pyi index 8fdb37511..2a9f7f31f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/plotarea.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/plotarea.pyi @@ -1,66 +1,66 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class DataTable(Serialisable): tagname: str - showHorzBorder: Any - showVertBorder: Any - showOutline: Any - showKeys: Any - spPr: Any - graphicalProperties: Any - txPr: Any - extLst: Any - __elements__: Any + showHorzBorder: Incomplete + showVertBorder: Incomplete + showOutline: Incomplete + showKeys: Incomplete + spPr: Incomplete + graphicalProperties: Incomplete + txPr: Incomplete + extLst: Incomplete + __elements__: Incomplete def __init__( self, - showHorzBorder: Any | None = ..., - showVertBorder: Any | None = ..., - showOutline: Any | None = ..., - showKeys: Any | None = ..., - spPr: Any | None = ..., - txPr: Any | None = ..., - extLst: Any | None = ..., + showHorzBorder: Incomplete | None = ..., + showVertBorder: Incomplete | None = ..., + showOutline: Incomplete | None = ..., + showKeys: Incomplete | None = ..., + spPr: Incomplete | None = ..., + txPr: Incomplete | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... class PlotArea(Serialisable): tagname: str - layout: Any - dTable: Any - spPr: Any - graphicalProperties: Any - extLst: Any - areaChart: Any - area3DChart: Any - lineChart: Any - line3DChart: Any - stockChart: Any - radarChart: Any - scatterChart: Any - pieChart: Any - pie3DChart: Any - doughnutChart: Any - barChart: Any - bar3DChart: Any - ofPieChart: Any - surfaceChart: Any - surface3DChart: Any - bubbleChart: Any - valAx: Any - catAx: Any - dateAx: Any - serAx: Any - __elements__: Any + layout: Incomplete + dTable: Incomplete + spPr: Incomplete + graphicalProperties: Incomplete + extLst: Incomplete + areaChart: Incomplete + area3DChart: Incomplete + lineChart: Incomplete + line3DChart: Incomplete + stockChart: Incomplete + radarChart: Incomplete + scatterChart: Incomplete + pieChart: Incomplete + pie3DChart: Incomplete + doughnutChart: Incomplete + barChart: Incomplete + bar3DChart: Incomplete + ofPieChart: Incomplete + surfaceChart: Incomplete + surface3DChart: Incomplete + bubbleChart: Incomplete + valAx: Incomplete + catAx: Incomplete + dateAx: Incomplete + serAx: Incomplete + __elements__: Incomplete def __init__( self, - layout: Any | None = ..., - dTable: Any | None = ..., - spPr: Any | None = ..., + layout: Incomplete | None = ..., + dTable: Incomplete | None = ..., + spPr: Incomplete | None = ..., _charts=..., _axes=..., - extLst: Any | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... - def to_tree(self, tagname: Any | None = ..., idx: Any | None = ..., namespace: Any | None = ...): ... + def to_tree(self, tagname: Incomplete | None = ..., idx: Incomplete | None = ..., namespace: Incomplete | None = ...): ... @classmethod def from_tree(cls, node): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/print_settings.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/print_settings.pyi index eb2facd55..3a1effc45 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/print_settings.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/print_settings.pyi @@ -1,27 +1,29 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class PageMargins(Serialisable): tagname: str - l: Any - left: Any - r: Any - right: Any - t: Any - top: Any - b: Any - bottom: Any - header: Any - footer: Any + l: Incomplete + left: Incomplete + r: Incomplete + right: Incomplete + t: Incomplete + top: Incomplete + b: Incomplete + bottom: Incomplete + header: Incomplete + footer: Incomplete def __init__( self, l: float = ..., r: float = ..., t: int = ..., b: int = ..., header: float = ..., footer: float = ... ) -> None: ... class PrintSettings(Serialisable): tagname: str - headerFooter: Any - pageMargins: Any - pageSetup: Any - __elements__: Any - def __init__(self, headerFooter: Any | None = ..., pageMargins: Any | None = ..., pageSetup: Any | None = ...) -> None: ... + headerFooter: Incomplete + pageMargins: Incomplete + pageSetup: Incomplete + __elements__: Incomplete + def __init__( + self, headerFooter: Incomplete | None = ..., pageMargins: Incomplete | None = ..., pageSetup: Incomplete | None = ... + ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/radar_chart.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/radar_chart.pyi index bab169498..21d1ea668 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/radar_chart.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/radar_chart.pyi @@ -1,25 +1,25 @@ -from typing import Any +from _typeshed import Incomplete from ._chart import ChartBase class RadarChart(ChartBase): tagname: str - radarStyle: Any - type: Any - varyColors: Any - ser: Any - dLbls: Any - dataLabels: Any - extLst: Any - x_axis: Any - y_axis: Any - __elements__: Any + radarStyle: Incomplete + type: Incomplete + varyColors: Incomplete + ser: Incomplete + dLbls: Incomplete + dataLabels: Incomplete + extLst: Incomplete + x_axis: Incomplete + y_axis: Incomplete + __elements__: Incomplete def __init__( self, radarStyle: str = ..., - varyColors: Any | None = ..., + varyColors: Incomplete | None = ..., ser=..., - dLbls: Any | None = ..., - extLst: Any | None = ..., + dLbls: Incomplete | None = ..., + extLst: Incomplete | None = ..., **kw, ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/reference.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/reference.pyi index fe2e8b8ea..b27c3d2aa 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/reference.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/reference.pyi @@ -1,34 +1,34 @@ +from _typeshed import Incomplete from collections.abc import Generator -from typing import Any from openpyxl.descriptors import Strict class DummyWorksheet: - title: Any + title: Incomplete def __init__(self, title) -> None: ... class Reference(Strict): - min_row: Any - max_row: Any - min_col: Any - max_col: Any - range_string: Any - worksheet: Any + min_row: Incomplete + max_row: Incomplete + min_col: Incomplete + max_col: Incomplete + range_string: Incomplete + worksheet: Incomplete def __init__( self, - worksheet: Any | None = ..., - min_col: Any | None = ..., - min_row: Any | None = ..., - max_col: Any | None = ..., - max_row: Any | None = ..., - range_string: Any | None = ..., + worksheet: Incomplete | None = ..., + min_col: Incomplete | None = ..., + min_row: Incomplete | None = ..., + max_col: Incomplete | None = ..., + max_row: Incomplete | None = ..., + range_string: Incomplete | None = ..., ) -> None: ... - def __len__(self): ... + def __len__(self) -> int: ... def __eq__(self, other): ... @property - def rows(self) -> Generator[Any, None, None]: ... + def rows(self) -> Generator[Incomplete, None, None]: ... @property - def cols(self) -> Generator[Any, None, None]: ... + def cols(self) -> Generator[Incomplete, None, None]: ... def pop(self): ... @property def sheetname(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/scatter_chart.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/scatter_chart.pyi index 73de332d1..7d2936456 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/scatter_chart.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/scatter_chart.pyi @@ -1,24 +1,24 @@ -from typing import Any +from _typeshed import Incomplete from ._chart import ChartBase as ChartBase class ScatterChart(ChartBase): tagname: str - scatterStyle: Any - varyColors: Any - ser: Any - dLbls: Any - dataLabels: Any - extLst: Any - x_axis: Any - y_axis: Any - __elements__: Any + scatterStyle: Incomplete + varyColors: Incomplete + ser: Incomplete + dLbls: Incomplete + dataLabels: Incomplete + extLst: Incomplete + x_axis: Incomplete + y_axis: Incomplete + __elements__: Incomplete def __init__( self, - scatterStyle: Any | None = ..., - varyColors: Any | None = ..., + scatterStyle: Incomplete | None = ..., + varyColors: Incomplete | None = ..., ser=..., - dLbls: Any | None = ..., - extLst: Any | None = ..., + dLbls: Incomplete | None = ..., + extLst: Incomplete | None = ..., **kw, ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/series.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/series.pyi index 44265dec7..06167b63c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/series.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/series.pyi @@ -1,86 +1,86 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable -attribute_mapping: Any +attribute_mapping: Incomplete class SeriesLabel(Serialisable): tagname: str - strRef: Any - v: Any - value: Any - __elements__: Any - def __init__(self, strRef: Any | None = ..., v: Any | None = ...) -> None: ... + strRef: Incomplete + v: Incomplete + value: Incomplete + __elements__: Incomplete + def __init__(self, strRef: Incomplete | None = ..., v: Incomplete | None = ...) -> None: ... class Series(Serialisable): tagname: str - idx: Any - order: Any - tx: Any - title: Any - spPr: Any - graphicalProperties: Any - pictureOptions: Any - dPt: Any - data_points: Any - dLbls: Any - labels: Any - trendline: Any - errBars: Any - cat: Any - identifiers: Any - val: Any - extLst: Any - invertIfNegative: Any - shape: Any - xVal: Any - yVal: Any - bubbleSize: Any - zVal: Any - bubble3D: Any - marker: Any - smooth: Any - explosion: Any - __elements__: Any + idx: Incomplete + order: Incomplete + tx: Incomplete + title: Incomplete + spPr: Incomplete + graphicalProperties: Incomplete + pictureOptions: Incomplete + dPt: Incomplete + data_points: Incomplete + dLbls: Incomplete + labels: Incomplete + trendline: Incomplete + errBars: Incomplete + cat: Incomplete + identifiers: Incomplete + val: Incomplete + extLst: Incomplete + invertIfNegative: Incomplete + shape: Incomplete + xVal: Incomplete + yVal: Incomplete + bubbleSize: Incomplete + zVal: Incomplete + bubble3D: Incomplete + marker: Incomplete + smooth: Incomplete + explosion: Incomplete + __elements__: Incomplete def __init__( self, idx: int = ..., order: int = ..., - tx: Any | None = ..., - spPr: Any | None = ..., - pictureOptions: Any | None = ..., + tx: Incomplete | None = ..., + spPr: Incomplete | None = ..., + pictureOptions: Incomplete | None = ..., dPt=..., - dLbls: Any | None = ..., - trendline: Any | None = ..., - errBars: Any | None = ..., - cat: Any | None = ..., - val: Any | None = ..., - invertIfNegative: Any | None = ..., - shape: Any | None = ..., - xVal: Any | None = ..., - yVal: Any | None = ..., - bubbleSize: Any | None = ..., - bubble3D: Any | None = ..., - marker: Any | None = ..., - smooth: Any | None = ..., - explosion: Any | None = ..., - extLst: Any | None = ..., + dLbls: Incomplete | None = ..., + trendline: Incomplete | None = ..., + errBars: Incomplete | None = ..., + cat: Incomplete | None = ..., + val: Incomplete | None = ..., + invertIfNegative: Incomplete | None = ..., + shape: Incomplete | None = ..., + xVal: Incomplete | None = ..., + yVal: Incomplete | None = ..., + bubbleSize: Incomplete | None = ..., + bubble3D: Incomplete | None = ..., + marker: Incomplete | None = ..., + smooth: Incomplete | None = ..., + explosion: Incomplete | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... - def to_tree(self, tagname: Any | None = ..., idx: Any | None = ...): ... # type: ignore[override] + def to_tree(self, tagname: Incomplete | None = ..., idx: Incomplete | None = ...): ... # type: ignore[override] class XYSeries(Series): - idx: Any - order: Any - tx: Any - spPr: Any - dPt: Any - dLbls: Any - trendline: Any - errBars: Any - xVal: Any - yVal: Any - invertIfNegative: Any - bubbleSize: Any - bubble3D: Any - marker: Any - smooth: Any + idx: Incomplete + order: Incomplete + tx: Incomplete + spPr: Incomplete + dPt: Incomplete + dLbls: Incomplete + trendline: Incomplete + errBars: Incomplete + xVal: Incomplete + yVal: Incomplete + invertIfNegative: Incomplete + bubbleSize: Incomplete + bubble3D: Incomplete + marker: Incomplete + smooth: Incomplete diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/series_factory.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/series_factory.pyi index 989d0e4ab..53243ea23 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/series_factory.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/series_factory.pyi @@ -1,5 +1,9 @@ -from typing import Any +from _typeshed import Incomplete def SeriesFactory( - values, xvalues: Any | None = ..., zvalues: Any | None = ..., title: Any | None = ..., title_from_data: bool = ... + values, + xvalues: Incomplete | None = ..., + zvalues: Incomplete | None = ..., + title: Incomplete | None = ..., + title_from_data: bool = ..., ): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/shapes.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/shapes.pyi index f78177f78..debb37a7c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/shapes.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/shapes.pyi @@ -1,37 +1,37 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class GraphicalProperties(Serialisable): tagname: str - bwMode: Any - xfrm: Any - transform: Any - custGeom: Any - prstGeom: Any - noFill: Any - solidFill: Any - gradFill: Any - pattFill: Any - ln: Any - line: Any - scene3d: Any - sp3d: Any - shape3D: Any - extLst: Any - __elements__: Any + bwMode: Incomplete + xfrm: Incomplete + transform: Incomplete + custGeom: Incomplete + prstGeom: Incomplete + noFill: Incomplete + solidFill: Incomplete + gradFill: Incomplete + pattFill: Incomplete + ln: Incomplete + line: Incomplete + scene3d: Incomplete + sp3d: Incomplete + shape3D: Incomplete + extLst: Incomplete + __elements__: Incomplete def __init__( self, - bwMode: Any | None = ..., - xfrm: Any | None = ..., - noFill: Any | None = ..., - solidFill: Any | None = ..., - gradFill: Any | None = ..., - pattFill: Any | None = ..., - ln: Any | None = ..., - scene3d: Any | None = ..., - custGeom: Any | None = ..., - prstGeom: Any | None = ..., - sp3d: Any | None = ..., - extLst: Any | None = ..., + bwMode: Incomplete | None = ..., + xfrm: Incomplete | None = ..., + noFill: Incomplete | None = ..., + solidFill: Incomplete | None = ..., + gradFill: Incomplete | None = ..., + pattFill: Incomplete | None = ..., + ln: Incomplete | None = ..., + scene3d: Incomplete | None = ..., + custGeom: Incomplete | None = ..., + prstGeom: Incomplete | None = ..., + sp3d: Incomplete | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/stock_chart.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/stock_chart.pyi index ad5c6a051..41318473c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/stock_chart.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/stock_chart.pyi @@ -1,26 +1,26 @@ -from typing import Any +from _typeshed import Incomplete from ._chart import ChartBase class StockChart(ChartBase): tagname: str - ser: Any - dLbls: Any - dataLabels: Any - dropLines: Any - hiLowLines: Any - upDownBars: Any - extLst: Any - x_axis: Any - y_axis: Any - __elements__: Any + ser: Incomplete + dLbls: Incomplete + dataLabels: Incomplete + dropLines: Incomplete + hiLowLines: Incomplete + upDownBars: Incomplete + extLst: Incomplete + x_axis: Incomplete + y_axis: Incomplete + __elements__: Incomplete def __init__( self, ser=..., - dLbls: Any | None = ..., - dropLines: Any | None = ..., - hiLowLines: Any | None = ..., - upDownBars: Any | None = ..., - extLst: Any | None = ..., + dLbls: Incomplete | None = ..., + dropLines: Incomplete | None = ..., + hiLowLines: Incomplete | None = ..., + upDownBars: Incomplete | None = ..., + extLst: Incomplete | None = ..., **kw, ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/surface_chart.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/surface_chart.pyi index 15d52a855..69734122a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/surface_chart.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/surface_chart.pyi @@ -1,5 +1,5 @@ +from _typeshed import Incomplete from abc import abstractmethod -from typing import Any from openpyxl.descriptors.serialisable import Serialisable @@ -8,45 +8,45 @@ from ._chart import ChartBase class BandFormat(Serialisable): tagname: str - idx: Any - spPr: Any - graphicalProperties: Any - __elements__: Any - def __init__(self, idx: int = ..., spPr: Any | None = ...) -> None: ... + idx: Incomplete + spPr: Incomplete + graphicalProperties: Incomplete + __elements__: Incomplete + def __init__(self, idx: int = ..., spPr: Incomplete | None = ...) -> None: ... class BandFormatList(Serialisable): tagname: str - bandFmt: Any - __elements__: Any + bandFmt: Incomplete + __elements__: Incomplete def __init__(self, bandFmt=...) -> None: ... class _SurfaceChartBase(ChartBase): - wireframe: Any - ser: Any - bandFmts: Any - __elements__: Any - def __init__(self, wireframe: Any | None = ..., ser=..., bandFmts: Any | None = ..., **kw) -> None: ... + wireframe: Incomplete + ser: Incomplete + bandFmts: Incomplete + __elements__: Incomplete + def __init__(self, wireframe: Incomplete | None = ..., ser=..., bandFmts: Incomplete | None = ..., **kw) -> None: ... @property @abstractmethod def tagname(self) -> str: ... class SurfaceChart3D(_SurfaceChartBase, _3DBase): tagname: str - wireframe: Any - ser: Any - bandFmts: Any - extLst: Any - x_axis: Any - y_axis: Any - z_axis: Any - __elements__: Any + wireframe: Incomplete + ser: Incomplete + bandFmts: Incomplete + extLst: Incomplete + x_axis: Incomplete + y_axis: Incomplete + z_axis: Incomplete + __elements__: Incomplete def __init__(self, **kw) -> None: ... class SurfaceChart(SurfaceChart3D): tagname: str - wireframe: Any - ser: Any - bandFmts: Any - extLst: Any - __elements__: Any + wireframe: Incomplete + ser: Incomplete + bandFmts: Incomplete + extLst: Incomplete + __elements__: Incomplete def __init__(self, **kw) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/text.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/text.pyi index 210064ded..c4420217d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/text.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/text.pyi @@ -1,21 +1,23 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class RichText(Serialisable): tagname: str - bodyPr: Any - properties: Any - lstStyle: Any - p: Any - paragraphs: Any - __elements__: Any - def __init__(self, bodyPr: Any | None = ..., lstStyle: Any | None = ..., p: Any | None = ...) -> None: ... + bodyPr: Incomplete + properties: Incomplete + lstStyle: Incomplete + p: Incomplete + paragraphs: Incomplete + __elements__: Incomplete + def __init__( + self, bodyPr: Incomplete | None = ..., lstStyle: Incomplete | None = ..., p: Incomplete | None = ... + ) -> None: ... class Text(Serialisable): tagname: str - strRef: Any - rich: Any - __elements__: Any - def __init__(self, strRef: Any | None = ..., rich: Any | None = ...) -> None: ... - def to_tree(self, tagname: Any | None = ..., idx: Any | None = ..., namespace: Any | None = ...): ... + strRef: Incomplete + rich: Incomplete + __elements__: Incomplete + def __init__(self, strRef: Incomplete | None = ..., rich: Incomplete | None = ...) -> None: ... + def to_tree(self, tagname: Incomplete | None = ..., idx: Incomplete | None = ..., namespace: Incomplete | None = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/title.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/title.pyi index 9b049582c..d12c2900c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/title.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/title.pyi @@ -1,33 +1,33 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors import Typed from openpyxl.descriptors.serialisable import Serialisable class Title(Serialisable): tagname: str - tx: Any - text: Any - layout: Any - overlay: Any - spPr: Any - graphicalProperties: Any - txPr: Any - body: Any - extLst: Any - __elements__: Any + tx: Incomplete + text: Incomplete + layout: Incomplete + overlay: Incomplete + spPr: Incomplete + graphicalProperties: Incomplete + txPr: Incomplete + body: Incomplete + extLst: Incomplete + __elements__: Incomplete def __init__( self, - tx: Any | None = ..., - layout: Any | None = ..., - overlay: Any | None = ..., - spPr: Any | None = ..., - txPr: Any | None = ..., - extLst: Any | None = ..., + tx: Incomplete | None = ..., + layout: Incomplete | None = ..., + overlay: Incomplete | None = ..., + spPr: Incomplete | None = ..., + txPr: Incomplete | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... def title_maker(text): ... class TitleDescriptor(Typed): - expected_type: Any + expected_type: Incomplete allow_none: bool def __set__(self, instance, value) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/trendline.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/trendline.pyi index b313a088e..5e5e21a83 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/trendline.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/trendline.pyi @@ -1,56 +1,56 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class TrendlineLabel(Serialisable): tagname: str - layout: Any - tx: Any - numFmt: Any - spPr: Any - graphicalProperties: Any - txPr: Any - textProperties: Any - extLst: Any - __elements__: Any + layout: Incomplete + tx: Incomplete + numFmt: Incomplete + spPr: Incomplete + graphicalProperties: Incomplete + txPr: Incomplete + textProperties: Incomplete + extLst: Incomplete + __elements__: Incomplete def __init__( self, - layout: Any | None = ..., - tx: Any | None = ..., - numFmt: Any | None = ..., - spPr: Any | None = ..., - txPr: Any | None = ..., - extLst: Any | None = ..., + layout: Incomplete | None = ..., + tx: Incomplete | None = ..., + numFmt: Incomplete | None = ..., + spPr: Incomplete | None = ..., + txPr: Incomplete | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... class Trendline(Serialisable): tagname: str - name: Any - spPr: Any - graphicalProperties: Any - trendlineType: Any - order: Any - period: Any - forward: Any - backward: Any - intercept: Any - dispRSqr: Any - dispEq: Any - trendlineLbl: Any - extLst: Any - __elements__: Any + name: Incomplete + spPr: Incomplete + graphicalProperties: Incomplete + trendlineType: Incomplete + order: Incomplete + period: Incomplete + forward: Incomplete + backward: Incomplete + intercept: Incomplete + dispRSqr: Incomplete + dispEq: Incomplete + trendlineLbl: Incomplete + extLst: Incomplete + __elements__: Incomplete def __init__( self, - name: Any | None = ..., - spPr: Any | None = ..., + name: Incomplete | None = ..., + spPr: Incomplete | None = ..., trendlineType: str = ..., - order: Any | None = ..., - period: Any | None = ..., - forward: Any | None = ..., - backward: Any | None = ..., - intercept: Any | None = ..., - dispRSqr: Any | None = ..., - dispEq: Any | None = ..., - trendlineLbl: Any | None = ..., - extLst: Any | None = ..., + order: Incomplete | None = ..., + period: Incomplete | None = ..., + forward: Incomplete | None = ..., + backward: Incomplete | None = ..., + intercept: Incomplete | None = ..., + dispRSqr: Incomplete | None = ..., + dispEq: Incomplete | None = ..., + trendlineLbl: Incomplete | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/updown_bars.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/updown_bars.pyi index ecf885e3d..89e21c27e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/updown_bars.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/updown_bars.pyi @@ -1,14 +1,18 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class UpDownBars(Serialisable): tagname: str - gapWidth: Any - upBars: Any - downBars: Any - extLst: Any - __elements__: Any + gapWidth: Incomplete + upBars: Incomplete + downBars: Incomplete + extLst: Incomplete + __elements__: Incomplete def __init__( - self, gapWidth: int = ..., upBars: Any | None = ..., downBars: Any | None = ..., extLst: Any | None = ... + self, + gapWidth: int = ..., + upBars: Incomplete | None = ..., + downBars: Incomplete | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chartsheet/chartsheet.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chartsheet/chartsheet.pyi index 547e90735..9423f1cce 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chartsheet/chartsheet.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chartsheet/chartsheet.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable from openpyxl.workbook.child import _WorkbookChild @@ -6,37 +6,37 @@ from openpyxl.workbook.child import _WorkbookChild class Chartsheet(_WorkbookChild, Serialisable): tagname: str mime_type: str - sheetPr: Any - sheetViews: Any - sheetProtection: Any - customSheetViews: Any - pageMargins: Any - pageSetup: Any - drawing: Any - drawingHF: Any - picture: Any - webPublishItems: Any - extLst: Any - sheet_state: Any - headerFooter: Any - HeaderFooter: Any - __elements__: Any - __attrs__: Any + sheetPr: Incomplete + sheetViews: Incomplete + sheetProtection: Incomplete + customSheetViews: Incomplete + pageMargins: Incomplete + pageSetup: Incomplete + drawing: Incomplete + drawingHF: Incomplete + picture: Incomplete + webPublishItems: Incomplete + extLst: Incomplete + sheet_state: Incomplete + headerFooter: Incomplete + HeaderFooter: Incomplete + __elements__: Incomplete + __attrs__: Incomplete def __init__( self, - sheetPr: Any | None = ..., - sheetViews: Any | None = ..., - sheetProtection: Any | None = ..., - customSheetViews: Any | None = ..., - pageMargins: Any | None = ..., - pageSetup: Any | None = ..., - headerFooter: Any | None = ..., - drawing: Any | None = ..., - drawingHF: Any | None = ..., - picture: Any | None = ..., - webPublishItems: Any | None = ..., - extLst: Any | None = ..., - parent: Any | None = ..., + sheetPr: Incomplete | None = ..., + sheetViews: Incomplete | None = ..., + sheetProtection: Incomplete | None = ..., + customSheetViews: Incomplete | None = ..., + pageMargins: Incomplete | None = ..., + pageSetup: Incomplete | None = ..., + headerFooter: Incomplete | None = ..., + drawing: Incomplete | None = ..., + drawingHF: Incomplete | None = ..., + picture: Incomplete | None = ..., + webPublishItems: Incomplete | None = ..., + extLst: Incomplete | None = ..., + parent: Incomplete | None = ..., title: str = ..., sheet_state: str = ..., ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chartsheet/custom.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chartsheet/custom.pyi index 6111d5686..88a26bd8b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chartsheet/custom.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chartsheet/custom.pyi @@ -1,30 +1,30 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class CustomChartsheetView(Serialisable): tagname: str - guid: Any - scale: Any - state: Any - zoomToFit: Any - pageMargins: Any - pageSetup: Any - headerFooter: Any - __elements__: Any + guid: Incomplete + scale: Incomplete + state: Incomplete + zoomToFit: Incomplete + pageMargins: Incomplete + pageSetup: Incomplete + headerFooter: Incomplete + __elements__: Incomplete def __init__( self, - guid: Any | None = ..., - scale: Any | None = ..., + guid: Incomplete | None = ..., + scale: Incomplete | None = ..., state: str = ..., - zoomToFit: Any | None = ..., - pageMargins: Any | None = ..., - pageSetup: Any | None = ..., - headerFooter: Any | None = ..., + zoomToFit: Incomplete | None = ..., + pageMargins: Incomplete | None = ..., + pageSetup: Incomplete | None = ..., + headerFooter: Incomplete | None = ..., ) -> None: ... class CustomChartsheetViews(Serialisable): tagname: str - customSheetView: Any - __elements__: Any - def __init__(self, customSheetView: Any | None = ...) -> None: ... + customSheetView: Incomplete + __elements__: Incomplete + def __init__(self, customSheetView: Incomplete | None = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chartsheet/properties.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chartsheet/properties.pyi index bc9352596..ecfa22fc4 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chartsheet/properties.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chartsheet/properties.pyi @@ -1,11 +1,13 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable as Serialisable class ChartsheetProperties(Serialisable): tagname: str - published: Any - codeName: Any - tabColor: Any - __elements__: Any - def __init__(self, published: Any | None = ..., codeName: Any | None = ..., tabColor: Any | None = ...) -> None: ... + published: Incomplete + codeName: Incomplete + tabColor: Incomplete + __elements__: Incomplete + def __init__( + self, published: Incomplete | None = ..., codeName: Incomplete | None = ..., tabColor: Incomplete | None = ... + ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chartsheet/protection.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chartsheet/protection.pyi index 0a8c3a73a..1565a57d9 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chartsheet/protection.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chartsheet/protection.pyi @@ -1,25 +1,25 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable from openpyxl.worksheet.protection import _Protected class ChartsheetProtection(Serialisable, _Protected): tagname: str - algorithmName: Any - hashValue: Any - saltValue: Any - spinCount: Any - content: Any - objects: Any - __attrs__: Any - password: Any + algorithmName: Incomplete + hashValue: Incomplete + saltValue: Incomplete + spinCount: Incomplete + content: Incomplete + objects: Incomplete + __attrs__: Incomplete + password: Incomplete def __init__( self, - content: Any | None = ..., - objects: Any | None = ..., - hashValue: Any | None = ..., - spinCount: Any | None = ..., - saltValue: Any | None = ..., - algorithmName: Any | None = ..., - password: Any | None = ..., + content: Incomplete | None = ..., + objects: Incomplete | None = ..., + hashValue: Incomplete | None = ..., + spinCount: Incomplete | None = ..., + saltValue: Incomplete | None = ..., + algorithmName: Incomplete | None = ..., + password: Incomplete | None = ..., ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chartsheet/publish.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chartsheet/publish.pyi index a581881fe..deb8575ec 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chartsheet/publish.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chartsheet/publish.pyi @@ -1,32 +1,32 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class WebPublishItem(Serialisable): tagname: str - id: Any - divId: Any - sourceType: Any - sourceRef: Any - sourceObject: Any - destinationFile: Any - title: Any - autoRepublish: Any + id: Incomplete + divId: Incomplete + sourceType: Incomplete + sourceRef: Incomplete + sourceObject: Incomplete + destinationFile: Incomplete + title: Incomplete + autoRepublish: Incomplete def __init__( self, - id: Any | None = ..., - divId: Any | None = ..., - sourceType: Any | None = ..., - sourceRef: Any | None = ..., - sourceObject: Any | None = ..., - destinationFile: Any | None = ..., - title: Any | None = ..., - autoRepublish: Any | None = ..., + id: Incomplete | None = ..., + divId: Incomplete | None = ..., + sourceType: Incomplete | None = ..., + sourceRef: Incomplete | None = ..., + sourceObject: Incomplete | None = ..., + destinationFile: Incomplete | None = ..., + title: Incomplete | None = ..., + autoRepublish: Incomplete | None = ..., ) -> None: ... class WebPublishItems(Serialisable): tagname: str - count: Any - webPublishItem: Any - __elements__: Any - def __init__(self, count: Any | None = ..., webPublishItem: Any | None = ...) -> None: ... + count: Incomplete + webPublishItem: Incomplete + __elements__: Incomplete + def __init__(self, count: Incomplete | None = ..., webPublishItem: Incomplete | None = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chartsheet/relation.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chartsheet/relation.pyi index a5c61a3a8..5c4cf80d6 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chartsheet/relation.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chartsheet/relation.pyi @@ -1,69 +1,69 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class SheetBackgroundPicture(Serialisable): tagname: str - id: Any + id: Incomplete def __init__(self, id) -> None: ... class DrawingHF(Serialisable): - id: Any - lho: Any - leftHeaderOddPages: Any - lhe: Any - leftHeaderEvenPages: Any - lhf: Any - leftHeaderFirstPage: Any - cho: Any - centerHeaderOddPages: Any - che: Any - centerHeaderEvenPages: Any - chf: Any - centerHeaderFirstPage: Any - rho: Any - rightHeaderOddPages: Any - rhe: Any - rightHeaderEvenPages: Any - rhf: Any - rightHeaderFirstPage: Any - lfo: Any - leftFooterOddPages: Any - lfe: Any - leftFooterEvenPages: Any - lff: Any - leftFooterFirstPage: Any - cfo: Any - centerFooterOddPages: Any - cfe: Any - centerFooterEvenPages: Any - cff: Any - centerFooterFirstPage: Any - rfo: Any - rightFooterOddPages: Any - rfe: Any - rightFooterEvenPages: Any - rff: Any - rightFooterFirstPage: Any + id: Incomplete + lho: Incomplete + leftHeaderOddPages: Incomplete + lhe: Incomplete + leftHeaderEvenPages: Incomplete + lhf: Incomplete + leftHeaderFirstPage: Incomplete + cho: Incomplete + centerHeaderOddPages: Incomplete + che: Incomplete + centerHeaderEvenPages: Incomplete + chf: Incomplete + centerHeaderFirstPage: Incomplete + rho: Incomplete + rightHeaderOddPages: Incomplete + rhe: Incomplete + rightHeaderEvenPages: Incomplete + rhf: Incomplete + rightHeaderFirstPage: Incomplete + lfo: Incomplete + leftFooterOddPages: Incomplete + lfe: Incomplete + leftFooterEvenPages: Incomplete + lff: Incomplete + leftFooterFirstPage: Incomplete + cfo: Incomplete + centerFooterOddPages: Incomplete + cfe: Incomplete + centerFooterEvenPages: Incomplete + cff: Incomplete + centerFooterFirstPage: Incomplete + rfo: Incomplete + rightFooterOddPages: Incomplete + rfe: Incomplete + rightFooterEvenPages: Incomplete + rff: Incomplete + rightFooterFirstPage: Incomplete def __init__( self, - id: Any | None = ..., - lho: Any | None = ..., - lhe: Any | None = ..., - lhf: Any | None = ..., - cho: Any | None = ..., - che: Any | None = ..., - chf: Any | None = ..., - rho: Any | None = ..., - rhe: Any | None = ..., - rhf: Any | None = ..., - lfo: Any | None = ..., - lfe: Any | None = ..., - lff: Any | None = ..., - cfo: Any | None = ..., - cfe: Any | None = ..., - cff: Any | None = ..., - rfo: Any | None = ..., - rfe: Any | None = ..., - rff: Any | None = ..., + id: Incomplete | None = ..., + lho: Incomplete | None = ..., + lhe: Incomplete | None = ..., + lhf: Incomplete | None = ..., + cho: Incomplete | None = ..., + che: Incomplete | None = ..., + chf: Incomplete | None = ..., + rho: Incomplete | None = ..., + rhe: Incomplete | None = ..., + rhf: Incomplete | None = ..., + lfo: Incomplete | None = ..., + lfe: Incomplete | None = ..., + lff: Incomplete | None = ..., + cfo: Incomplete | None = ..., + cfe: Incomplete | None = ..., + cff: Incomplete | None = ..., + rfo: Incomplete | None = ..., + rfe: Incomplete | None = ..., + rff: Incomplete | None = ..., ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chartsheet/views.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chartsheet/views.pyi index 9c092e83a..772090b6c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chartsheet/views.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chartsheet/views.pyi @@ -1,27 +1,27 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class ChartsheetView(Serialisable): tagname: str - tabSelected: Any - zoomScale: Any - workbookViewId: Any - zoomToFit: Any - extLst: Any - __elements__: Any + tabSelected: Incomplete + zoomScale: Incomplete + workbookViewId: Incomplete + zoomToFit: Incomplete + extLst: Incomplete + __elements__: Incomplete def __init__( self, - tabSelected: Any | None = ..., - zoomScale: Any | None = ..., + tabSelected: Incomplete | None = ..., + zoomScale: Incomplete | None = ..., workbookViewId: int = ..., - zoomToFit: Any | None = ..., - extLst: Any | None = ..., + zoomToFit: Incomplete | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... class ChartsheetViewList(Serialisable): tagname: str - sheetView: Any - extLst: Any - __elements__: Any - def __init__(self, sheetView: Any | None = ..., extLst: Any | None = ...) -> None: ... + sheetView: Incomplete + extLst: Incomplete + __elements__: Incomplete + def __init__(self, sheetView: Incomplete | None = ..., extLst: Incomplete | None = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/comments/author.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/comments/author.pyi index b3aec7caf..e80cfa914 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/comments/author.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/comments/author.pyi @@ -1,9 +1,9 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class AuthorList(Serialisable): tagname: str - author: Any - authors: Any + author: Incomplete + authors: Incomplete def __init__(self, author=...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/comments/comment_sheet.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/comments/comment_sheet.pyi index e9eafa52b..50dcef57a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/comments/comment_sheet.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/comments/comment_sheet.pyi @@ -1,67 +1,67 @@ +from _typeshed import Incomplete from collections.abc import Generator -from typing import Any from openpyxl.descriptors.serialisable import Serialisable class Properties(Serialisable): - locked: Any - defaultSize: Any - disabled: Any - uiObject: Any - autoFill: Any - autoLine: Any - altText: Any - textHAlign: Any - textVAlign: Any - lockText: Any - justLastX: Any - autoScale: Any - rowHidden: Any - colHidden: Any - __elements__: Any - anchor: Any + locked: Incomplete + defaultSize: Incomplete + disabled: Incomplete + uiObject: Incomplete + autoFill: Incomplete + autoLine: Incomplete + altText: Incomplete + textHAlign: Incomplete + textVAlign: Incomplete + lockText: Incomplete + justLastX: Incomplete + autoScale: Incomplete + rowHidden: Incomplete + colHidden: Incomplete + __elements__: Incomplete + anchor: Incomplete def __init__( self, - locked: Any | None = ..., - defaultSize: Any | None = ..., - _print: Any | None = ..., - disabled: Any | None = ..., - uiObject: Any | None = ..., - autoFill: Any | None = ..., - autoLine: Any | None = ..., - altText: Any | None = ..., - textHAlign: Any | None = ..., - textVAlign: Any | None = ..., - lockText: Any | None = ..., - justLastX: Any | None = ..., - autoScale: Any | None = ..., - rowHidden: Any | None = ..., - colHidden: Any | None = ..., - anchor: Any | None = ..., + locked: Incomplete | None = ..., + defaultSize: Incomplete | None = ..., + _print: Incomplete | None = ..., + disabled: Incomplete | None = ..., + uiObject: Incomplete | None = ..., + autoFill: Incomplete | None = ..., + autoLine: Incomplete | None = ..., + altText: Incomplete | None = ..., + textHAlign: Incomplete | None = ..., + textVAlign: Incomplete | None = ..., + lockText: Incomplete | None = ..., + justLastX: Incomplete | None = ..., + autoScale: Incomplete | None = ..., + rowHidden: Incomplete | None = ..., + colHidden: Incomplete | None = ..., + anchor: Incomplete | None = ..., ) -> None: ... class CommentRecord(Serialisable): tagname: str - ref: Any - authorId: Any - guid: Any - shapeId: Any - text: Any - commentPr: Any - author: Any - __elements__: Any - __attrs__: Any - height: Any - width: Any + ref: Incomplete + authorId: Incomplete + guid: Incomplete + shapeId: Incomplete + text: Incomplete + commentPr: Incomplete + author: Incomplete + __elements__: Incomplete + __attrs__: Incomplete + height: Incomplete + width: Incomplete def __init__( self, ref: str = ..., authorId: int = ..., - guid: Any | None = ..., + guid: Incomplete | None = ..., shapeId: int = ..., - text: Any | None = ..., - commentPr: Any | None = ..., - author: Any | None = ..., + text: Incomplete | None = ..., + commentPr: Incomplete | None = ..., + author: Incomplete | None = ..., height: int = ..., width: int = ..., ) -> None: ... @@ -72,17 +72,19 @@ class CommentRecord(Serialisable): class CommentSheet(Serialisable): tagname: str - authors: Any - commentList: Any - extLst: Any + authors: Incomplete + commentList: Incomplete + extLst: Incomplete mime_type: str - __elements__: Any - def __init__(self, authors: Any | None = ..., commentList: Any | None = ..., extLst: Any | None = ...) -> None: ... + __elements__: Incomplete + def __init__( + self, authors: Incomplete | None = ..., commentList: Incomplete | None = ..., extLst: Incomplete | None = ... + ) -> None: ... def to_tree(self): ... @property - def comments(self) -> Generator[Any, None, None]: ... + def comments(self) -> Generator[Incomplete, None, None]: ... @classmethod def from_comments(cls, comments): ... - def write_shapes(self, vml: Any | None = ...): ... + def write_shapes(self, vml: Incomplete | None = ...): ... @property def path(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/comments/comments.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/comments/comments.pyi index 60ec5e7fd..b751879a2 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/comments/comments.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/comments/comments.pyi @@ -1,10 +1,10 @@ -from typing import Any +from _typeshed import Incomplete class Comment: - content: Any - author: Any - height: Any - width: Any + content: Incomplete + author: Incomplete + height: Incomplete + width: Incomplete def __init__(self, text, author, height: int = ..., width: int = ...) -> None: ... @property def parent(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/comments/shape_writer.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/comments/shape_writer.pyi index db8b9133a..df71fe9d3 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/comments/shape_writer.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/comments/shape_writer.pyi @@ -1,13 +1,13 @@ -from typing import Any +from _typeshed import Incomplete vmlns: str officens: str excelns: str class ShapeWriter: - vml: Any - vml_path: Any - comments: Any + vml: Incomplete + vml_path: Incomplete + comments: Incomplete def __init__(self, comments) -> None: ... def add_comment_shapetype(self, root) -> None: ... def add_comment_shape(self, root, idx, coord, height, width) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/compat/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/compat/__init__.pyi index c2ebdac2e..5c4b7cd1e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/compat/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/compat/__init__.pyi @@ -1,10 +1,10 @@ -from typing import Any +from _typeshed import Incomplete from .numbers import NUMERIC_TYPES as NUMERIC_TYPES from .strings import safe_string as safe_string class DummyCode: ... -string_types: Any +string_types: Incomplete def deprecated(reason): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/compat/numbers.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/compat/numbers.pyi index e0bf07024..2d5d36fc1 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/compat/numbers.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/compat/numbers.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete -NUMERIC_TYPES: Any +NUMERIC_TYPES: Incomplete NUMPY: bool diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/compat/strings.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/compat/strings.pyi index 0ab4f754f..0e3080ebd 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/compat/strings.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/compat/strings.pyi @@ -1,5 +1,5 @@ -from typing import Any +from _typeshed import Incomplete -VER: Any +VER: Incomplete def safe_string(value): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/base.pyi index 2728212bc..c61b95e89 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/base.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/base.pyi @@ -1,15 +1,15 @@ -from typing import Any +from _typeshed import Incomplete class Descriptor: - name: Any - def __init__(self, name: Any | None = ..., **kw) -> None: ... + name: Incomplete + def __init__(self, name: Incomplete | None = ..., **kw) -> None: ... def __set__(self, instance, value) -> None: ... class Typed(Descriptor): - expected_type: Any + expected_type: Incomplete allow_none: bool nested: bool - __doc__: Any + __doc__: Incomplete def __init__(self, *args, **kw) -> None: ... def __set__(self, instance, value) -> None: ... @@ -17,13 +17,13 @@ class Convertible(Typed): def __set__(self, instance, value) -> None: ... class Max(Convertible): - expected_type: Any + expected_type: Incomplete allow_none: bool def __init__(self, **kw) -> None: ... def __set__(self, instance, value) -> None: ... class Min(Convertible): - expected_type: Any + expected_type: Incomplete allow_none: bool def __init__(self, **kw) -> None: ... def __set__(self, instance, value) -> None: ... @@ -31,55 +31,55 @@ class Min(Convertible): class MinMax(Min, Max): ... class Set(Descriptor): - __doc__: Any - def __init__(self, name: Any | None = ..., **kw) -> None: ... + __doc__: Incomplete + def __init__(self, name: Incomplete | None = ..., **kw) -> None: ... def __set__(self, instance, value) -> None: ... class NoneSet(Set): - def __init__(self, name: Any | None = ..., **kw) -> None: ... + def __init__(self, name: Incomplete | None = ..., **kw) -> None: ... def __set__(self, instance, value) -> None: ... class Integer(Convertible): - expected_type: Any + expected_type: Incomplete class Float(Convertible): - expected_type: Any + expected_type: Incomplete class Bool(Convertible): - expected_type: Any + expected_type: Incomplete def __set__(self, instance, value) -> None: ... class String(Typed): - expected_type: Any + expected_type: Incomplete class Text(String, Convertible): ... class ASCII(Typed): - expected_type: Any + expected_type: Incomplete class Tuple(Typed): - expected_type: Any + expected_type: Incomplete class Length(Descriptor): - def __init__(self, name: Any | None = ..., **kw) -> None: ... + def __init__(self, name: Incomplete | None = ..., **kw) -> None: ... def __set__(self, instance, value) -> None: ... class Default(Typed): - def __init__(self, name: Any | None = ..., **kw) -> None: ... + def __init__(self, name: Incomplete | None = ..., **kw) -> None: ... def __call__(self): ... class Alias(Descriptor): - alias: Any + alias: Incomplete def __init__(self, alias) -> None: ... def __set__(self, instance, value) -> None: ... def __get__(self, instance, cls): ... class MatchPattern(Descriptor): allow_none: bool - test_pattern: Any - def __init__(self, name: Any | None = ..., **kw) -> None: ... + test_pattern: Incomplete + def __init__(self, name: Incomplete | None = ..., **kw) -> None: ... def __set__(self, instance, value) -> None: ... class DateTime(Typed): - expected_type: Any + expected_type: Incomplete def __set__(self, instance, value) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/excel.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/excel.pyi index 15bd45f64..1d7c80f63 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/excel.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/excel.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete from . import Integer, MatchPattern, MinMax, String from .serialisable import Serialisable @@ -10,7 +10,7 @@ class UniversalMeasure(MatchPattern): pattern: str class TextPoint(MinMax): - expected_type: Any + expected_type: Incomplete min: int max: int @@ -23,15 +23,15 @@ class Percentage(MinMax): def __set__(self, instance, value) -> None: ... class Extension(Serialisable): - uri: Any - def __init__(self, uri: Any | None = ...) -> None: ... + uri: Incomplete + def __init__(self, uri: Incomplete | None = ...) -> None: ... class ExtensionList(Serialisable): - ext: Any + ext: Incomplete def __init__(self, ext=...) -> None: ... class Relation(String): - namespace: Any + namespace: Incomplete allow_none: bool class Base64Binary(MatchPattern): diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/namespace.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/namespace.pyi index 33f2eacb7..2d64ce84b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/namespace.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/namespace.pyi @@ -1,3 +1,3 @@ -from typing import Any +from _typeshed import Incomplete -def namespaced(obj, tagname, namespace: Any | None = ...): ... +def namespaced(obj, tagname, namespace: Incomplete | None = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/nested.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/nested.pyi index d63cfdb04..f4902e657 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/nested.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/nested.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete from .base import Bool, Convertible, Descriptor, Float, Integer, MinMax, NoneSet, Set, String @@ -7,13 +7,13 @@ class Nested(Descriptor): attribute: str def __set__(self, instance, value) -> None: ... def from_tree(self, node): ... - def to_tree(self, tagname: Any | None = ..., value: Any | None = ..., namespace: Any | None = ...): ... + def to_tree(self, tagname: Incomplete | None = ..., value: Incomplete | None = ..., namespace: Incomplete | None = ...): ... class NestedValue(Nested, Convertible): ... class NestedText(NestedValue): def from_tree(self, node): ... - def to_tree(self, tagname: Any | None = ..., value: Any | None = ..., namespace: Any | None = ...): ... + def to_tree(self, tagname: Incomplete | None = ..., value: Incomplete | None = ..., namespace: Incomplete | None = ...): ... class NestedFloat(NestedValue, Float): ... class NestedInteger(NestedValue, Integer): ... @@ -28,4 +28,4 @@ class NestedMinMax(Nested, MinMax): ... class EmptyTag(Nested, Bool): def from_tree(self, node): ... - def to_tree(self, tagname: Any | None = ..., value: Any | None = ..., namespace: Any | None = ...): ... + def to_tree(self, tagname: Incomplete | None = ..., value: Incomplete | None = ..., namespace: Incomplete | None = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/sequence.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/sequence.pyi index 730fb2063..81259a9df 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/sequence.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/sequence.pyi @@ -1,33 +1,33 @@ +from _typeshed import Incomplete from collections.abc import Generator -from typing import Any from .base import Alias, Descriptor class Sequence(Descriptor): - expected_type: Any - seq_types: Any + expected_type: Incomplete + seq_types: Incomplete idx_base: int unique: bool def __set__(self, instance, seq) -> None: ... - def to_tree(self, tagname, obj, namespace: Any | None = ...) -> Generator[Any, None, None]: ... + def to_tree(self, tagname, obj, namespace: Incomplete | None = ...) -> Generator[Incomplete, None, None]: ... class ValueSequence(Sequence): attribute: str - def to_tree(self, tagname, obj, namespace: Any | None = ...) -> Generator[Any, None, None]: ... + def to_tree(self, tagname, obj, namespace: Incomplete | None = ...) -> Generator[Incomplete, None, None]: ... def from_tree(self, node): ... class NestedSequence(Sequence): count: bool - def to_tree(self, tagname, obj, namespace: Any | None = ...): ... + def to_tree(self, tagname, obj, namespace: Incomplete | None = ...): ... def from_tree(self, node): ... class MultiSequence(Sequence): def __set__(self, instance, seq) -> None: ... - def to_tree(self, tagname, obj, namespace: Any | None = ...) -> Generator[Any, None, None]: ... + def to_tree(self, tagname, obj, namespace: Incomplete | None = ...) -> Generator[Incomplete, None, None]: ... class MultiSequencePart(Alias): - expected_type: Any - store: Any + expected_type: Incomplete + store: Incomplete def __init__(self, expected_type, store) -> None: ... def __set__(self, instance, value) -> None: ... def __get__(self, instance, cls): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/serialisable.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/serialisable.pyi index 4df537886..f309f6a4c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/serialisable.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/serialisable.pyi @@ -1,27 +1,27 @@ -from typing import Any +from _typeshed import Incomplete from . import _Serialiasable -KEYWORDS: Any -seq_types: Any +KEYWORDS: Incomplete +seq_types: Incomplete class Serialisable(_Serialiasable): - __attrs__: Any - __nested__: Any - __elements__: Any - __namespaced__: Any + __attrs__: Incomplete + __nested__: Incomplete + __elements__: Incomplete + __namespaced__: Incomplete idx_base: int @property # TODO: needs overrides in many sub-classes # @abstractmethod def tagname(self) -> str: ... - namespace: Any + namespace: Incomplete @classmethod def from_tree(cls, node): ... - def to_tree(self, tagname: Any | None = ..., idx: Any | None = ..., namespace: Any | None = ...): ... + def to_tree(self, tagname: Incomplete | None = ..., idx: Incomplete | None = ..., namespace: Incomplete | None = ...): ... def __iter__(self): ... def __eq__(self, other): ... def __ne__(self, other): ... - def __hash__(self): ... + def __hash__(self) -> int: ... def __add__(self, other): ... def __copy__(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/colors.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/colors.pyi index 2af9bc6c3..aaf77fd0f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/colors.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/colors.pyi @@ -1,198 +1,198 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors import Typed from openpyxl.descriptors.serialisable import Serialisable -PRESET_COLORS: Any -SCHEME_COLORS: Any +PRESET_COLORS: Incomplete +SCHEME_COLORS: Incomplete class Transform(Serialisable): ... class SystemColor(Serialisable): tagname: str - namespace: Any - tint: Any - shade: Any - comp: Any - inv: Any - gray: Any - alpha: Any - alphaOff: Any - alphaMod: Any - hue: Any - hueOff: Any - hueMod: Any - sat: Any - satOff: Any - satMod: Any - lum: Any - lumOff: Any - lumMod: Any - red: Any - redOff: Any - redMod: Any - green: Any - greenOff: Any - greenMod: Any - blue: Any - blueOff: Any - blueMod: Any - gamma: Any - invGamma: Any - val: Any - lastClr: Any - __elements__: Any + namespace: Incomplete + tint: Incomplete + shade: Incomplete + comp: Incomplete + inv: Incomplete + gray: Incomplete + alpha: Incomplete + alphaOff: Incomplete + alphaMod: Incomplete + hue: Incomplete + hueOff: Incomplete + hueMod: Incomplete + sat: Incomplete + satOff: Incomplete + satMod: Incomplete + lum: Incomplete + lumOff: Incomplete + lumMod: Incomplete + red: Incomplete + redOff: Incomplete + redMod: Incomplete + green: Incomplete + greenOff: Incomplete + greenMod: Incomplete + blue: Incomplete + blueOff: Incomplete + blueMod: Incomplete + gamma: Incomplete + invGamma: Incomplete + val: Incomplete + lastClr: Incomplete + __elements__: Incomplete def __init__( self, val: str = ..., - lastClr: Any | None = ..., - tint: Any | None = ..., - shade: Any | None = ..., - comp: Any | None = ..., - inv: Any | None = ..., - gray: Any | None = ..., - alpha: Any | None = ..., - alphaOff: Any | None = ..., - alphaMod: Any | None = ..., - hue: Any | None = ..., - hueOff: Any | None = ..., - hueMod: Any | None = ..., - sat: Any | None = ..., - satOff: Any | None = ..., - satMod: Any | None = ..., - lum: Any | None = ..., - lumOff: Any | None = ..., - lumMod: Any | None = ..., - red: Any | None = ..., - redOff: Any | None = ..., - redMod: Any | None = ..., - green: Any | None = ..., - greenOff: Any | None = ..., - greenMod: Any | None = ..., - blue: Any | None = ..., - blueOff: Any | None = ..., - blueMod: Any | None = ..., - gamma: Any | None = ..., - invGamma: Any | None = ..., + lastClr: Incomplete | None = ..., + tint: Incomplete | None = ..., + shade: Incomplete | None = ..., + comp: Incomplete | None = ..., + inv: Incomplete | None = ..., + gray: Incomplete | None = ..., + alpha: Incomplete | None = ..., + alphaOff: Incomplete | None = ..., + alphaMod: Incomplete | None = ..., + hue: Incomplete | None = ..., + hueOff: Incomplete | None = ..., + hueMod: Incomplete | None = ..., + sat: Incomplete | None = ..., + satOff: Incomplete | None = ..., + satMod: Incomplete | None = ..., + lum: Incomplete | None = ..., + lumOff: Incomplete | None = ..., + lumMod: Incomplete | None = ..., + red: Incomplete | None = ..., + redOff: Incomplete | None = ..., + redMod: Incomplete | None = ..., + green: Incomplete | None = ..., + greenOff: Incomplete | None = ..., + greenMod: Incomplete | None = ..., + blue: Incomplete | None = ..., + blueOff: Incomplete | None = ..., + blueMod: Incomplete | None = ..., + gamma: Incomplete | None = ..., + invGamma: Incomplete | None = ..., ) -> None: ... class HSLColor(Serialisable): tagname: str - hue: Any - sat: Any - lum: Any - def __init__(self, hue: Any | None = ..., sat: Any | None = ..., lum: Any | None = ...) -> None: ... + hue: Incomplete + sat: Incomplete + lum: Incomplete + def __init__(self, hue: Incomplete | None = ..., sat: Incomplete | None = ..., lum: Incomplete | None = ...) -> None: ... class RGBPercent(Serialisable): tagname: str - r: Any - g: Any - b: Any - def __init__(self, r: Any | None = ..., g: Any | None = ..., b: Any | None = ...) -> None: ... + r: Incomplete + g: Incomplete + b: Incomplete + def __init__(self, r: Incomplete | None = ..., g: Incomplete | None = ..., b: Incomplete | None = ...) -> None: ... class SchemeColor(Serialisable): tagname: str - namespace: Any - tint: Any - shade: Any - comp: Any - inv: Any - gray: Any - alpha: Any - alphaOff: Any - alphaMod: Any - hue: Any - hueOff: Any - hueMod: Any - sat: Any - satOff: Any - satMod: Any - lum: Any - lumOff: Any - lumMod: Any - red: Any - redOff: Any - redMod: Any - green: Any - greenOff: Any - greenMod: Any - blue: Any - blueOff: Any - blueMod: Any - gamma: Any - invGamma: Any - val: Any - __elements__: Any + namespace: Incomplete + tint: Incomplete + shade: Incomplete + comp: Incomplete + inv: Incomplete + gray: Incomplete + alpha: Incomplete + alphaOff: Incomplete + alphaMod: Incomplete + hue: Incomplete + hueOff: Incomplete + hueMod: Incomplete + sat: Incomplete + satOff: Incomplete + satMod: Incomplete + lum: Incomplete + lumOff: Incomplete + lumMod: Incomplete + red: Incomplete + redOff: Incomplete + redMod: Incomplete + green: Incomplete + greenOff: Incomplete + greenMod: Incomplete + blue: Incomplete + blueOff: Incomplete + blueMod: Incomplete + gamma: Incomplete + invGamma: Incomplete + val: Incomplete + __elements__: Incomplete def __init__( self, - tint: Any | None = ..., - shade: Any | None = ..., - comp: Any | None = ..., - inv: Any | None = ..., - gray: Any | None = ..., - alpha: Any | None = ..., - alphaOff: Any | None = ..., - alphaMod: Any | None = ..., - hue: Any | None = ..., - hueOff: Any | None = ..., - hueMod: Any | None = ..., - sat: Any | None = ..., - satOff: Any | None = ..., - satMod: Any | None = ..., - lum: Any | None = ..., - lumOff: Any | None = ..., - lumMod: Any | None = ..., - red: Any | None = ..., - redOff: Any | None = ..., - redMod: Any | None = ..., - green: Any | None = ..., - greenOff: Any | None = ..., - greenMod: Any | None = ..., - blue: Any | None = ..., - blueOff: Any | None = ..., - blueMod: Any | None = ..., - gamma: Any | None = ..., - invGamma: Any | None = ..., - val: Any | None = ..., + tint: Incomplete | None = ..., + shade: Incomplete | None = ..., + comp: Incomplete | None = ..., + inv: Incomplete | None = ..., + gray: Incomplete | None = ..., + alpha: Incomplete | None = ..., + alphaOff: Incomplete | None = ..., + alphaMod: Incomplete | None = ..., + hue: Incomplete | None = ..., + hueOff: Incomplete | None = ..., + hueMod: Incomplete | None = ..., + sat: Incomplete | None = ..., + satOff: Incomplete | None = ..., + satMod: Incomplete | None = ..., + lum: Incomplete | None = ..., + lumOff: Incomplete | None = ..., + lumMod: Incomplete | None = ..., + red: Incomplete | None = ..., + redOff: Incomplete | None = ..., + redMod: Incomplete | None = ..., + green: Incomplete | None = ..., + greenOff: Incomplete | None = ..., + greenMod: Incomplete | None = ..., + blue: Incomplete | None = ..., + blueOff: Incomplete | None = ..., + blueMod: Incomplete | None = ..., + gamma: Incomplete | None = ..., + invGamma: Incomplete | None = ..., + val: Incomplete | None = ..., ) -> None: ... class ColorChoice(Serialisable): tagname: str - namespace: Any - scrgbClr: Any - RGBPercent: Any - srgbClr: Any - RGB: Any - hslClr: Any - sysClr: Any - schemeClr: Any - prstClr: Any - __elements__: Any + namespace: Incomplete + scrgbClr: Incomplete + RGBPercent: Incomplete + srgbClr: Incomplete + RGB: Incomplete + hslClr: Incomplete + sysClr: Incomplete + schemeClr: Incomplete + prstClr: Incomplete + __elements__: Incomplete def __init__( self, - scrgbClr: Any | None = ..., - srgbClr: Any | None = ..., - hslClr: Any | None = ..., - sysClr: Any | None = ..., - schemeClr: Any | None = ..., - prstClr: Any | None = ..., + scrgbClr: Incomplete | None = ..., + srgbClr: Incomplete | None = ..., + hslClr: Incomplete | None = ..., + sysClr: Incomplete | None = ..., + schemeClr: Incomplete | None = ..., + prstClr: Incomplete | None = ..., ) -> None: ... class ColorMapping(Serialisable): tagname: str - bg1: Any - tx1: Any - bg2: Any - tx2: Any - accent1: Any - accent2: Any - accent3: Any - accent4: Any - accent5: Any - accent6: Any - hlink: Any - folHlink: Any - extLst: Any + bg1: Incomplete + tx1: Incomplete + bg2: Incomplete + tx2: Incomplete + accent1: Incomplete + accent2: Incomplete + accent3: Incomplete + accent4: Incomplete + accent5: Incomplete + accent6: Incomplete + hlink: Incomplete + folHlink: Incomplete + extLst: Incomplete def __init__( self, bg1: str = ..., @@ -207,10 +207,10 @@ class ColorMapping(Serialisable): accent6: str = ..., hlink: str = ..., folHlink: str = ..., - extLst: Any | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... class ColorChoiceDescriptor(Typed): - expected_type: Any + expected_type: Incomplete allow_none: bool def __set__(self, instance, value) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/connector.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/connector.pyi index 3b3e8a479..926b416c2 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/connector.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/connector.pyi @@ -1,72 +1,76 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class Connection(Serialisable): - id: Any - idx: Any - def __init__(self, id: Any | None = ..., idx: Any | None = ...) -> None: ... + id: Incomplete + idx: Incomplete + def __init__(self, id: Incomplete | None = ..., idx: Incomplete | None = ...) -> None: ... class ConnectorLocking(Serialisable): - extLst: Any - def __init__(self, extLst: Any | None = ...) -> None: ... + extLst: Incomplete + def __init__(self, extLst: Incomplete | None = ...) -> None: ... class NonVisualConnectorProperties(Serialisable): - cxnSpLocks: Any - stCxn: Any - endCxn: Any - extLst: Any + cxnSpLocks: Incomplete + stCxn: Incomplete + endCxn: Incomplete + extLst: Incomplete def __init__( - self, cxnSpLocks: Any | None = ..., stCxn: Any | None = ..., endCxn: Any | None = ..., extLst: Any | None = ... + self, + cxnSpLocks: Incomplete | None = ..., + stCxn: Incomplete | None = ..., + endCxn: Incomplete | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... class ConnectorNonVisual(Serialisable): - cNvPr: Any - cNvCxnSpPr: Any - __elements__: Any - def __init__(self, cNvPr: Any | None = ..., cNvCxnSpPr: Any | None = ...) -> None: ... + cNvPr: Incomplete + cNvCxnSpPr: Incomplete + __elements__: Incomplete + def __init__(self, cNvPr: Incomplete | None = ..., cNvCxnSpPr: Incomplete | None = ...) -> None: ... class ConnectorShape(Serialisable): tagname: str - nvCxnSpPr: Any - spPr: Any - style: Any - macro: Any - fPublished: Any + nvCxnSpPr: Incomplete + spPr: Incomplete + style: Incomplete + macro: Incomplete + fPublished: Incomplete def __init__( self, - nvCxnSpPr: Any | None = ..., - spPr: Any | None = ..., - style: Any | None = ..., - macro: Any | None = ..., - fPublished: Any | None = ..., + nvCxnSpPr: Incomplete | None = ..., + spPr: Incomplete | None = ..., + style: Incomplete | None = ..., + macro: Incomplete | None = ..., + fPublished: Incomplete | None = ..., ) -> None: ... class ShapeMeta(Serialisable): tagname: str - cNvPr: Any - cNvSpPr: Any - def __init__(self, cNvPr: Any | None = ..., cNvSpPr: Any | None = ...) -> None: ... + cNvPr: Incomplete + cNvSpPr: Incomplete + def __init__(self, cNvPr: Incomplete | None = ..., cNvSpPr: Incomplete | None = ...) -> None: ... class Shape(Serialisable): - macro: Any - textlink: Any - fPublished: Any - fLocksText: Any - nvSpPr: Any - meta: Any - spPr: Any - graphicalProperties: Any - style: Any - txBody: Any + macro: Incomplete + textlink: Incomplete + fPublished: Incomplete + fLocksText: Incomplete + nvSpPr: Incomplete + meta: Incomplete + spPr: Incomplete + graphicalProperties: Incomplete + style: Incomplete + txBody: Incomplete def __init__( self, - macro: Any | None = ..., - textlink: Any | None = ..., - fPublished: Any | None = ..., - fLocksText: Any | None = ..., - nvSpPr: Any | None = ..., - spPr: Any | None = ..., - style: Any | None = ..., - txBody: Any | None = ..., + macro: Incomplete | None = ..., + textlink: Incomplete | None = ..., + fPublished: Incomplete | None = ..., + fLocksText: Incomplete | None = ..., + nvSpPr: Incomplete | None = ..., + spPr: Incomplete | None = ..., + style: Incomplete | None = ..., + txBody: Incomplete | None = ..., ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/drawing.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/drawing.pyi index 10f90e212..0637334da 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/drawing.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/drawing.pyi @@ -1,10 +1,10 @@ -from typing import Any +from _typeshed import Incomplete class Drawing: count: int name: str description: str - coordinates: Any + coordinates: Incomplete left: int top: int resize_proportional: bool @@ -21,7 +21,6 @@ class Drawing: def height(self): ... @height.setter def height(self, h) -> None: ... - def set_dimension(self, w: int = ..., h: int = ...) -> None: ... - def get_emu_dimensions(self): ... + def set_dimension(self, w: int = 0, h: int = 0) -> None: ... @property def anchor(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/effect.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/effect.pyi index d81f96822..58b6e09e7 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/effect.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/effect.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable @@ -6,197 +6,203 @@ from .colors import ColorChoice class TintEffect(Serialisable): tagname: str - hue: Any - amt: Any + hue: Incomplete + amt: Incomplete def __init__(self, hue: int = ..., amt: int = ...) -> None: ... class LuminanceEffect(Serialisable): tagname: str - bright: Any - contrast: Any + bright: Incomplete + contrast: Incomplete def __init__(self, bright: int = ..., contrast: int = ...) -> None: ... class HSLEffect(Serialisable): - hue: Any - sat: Any - lum: Any - def __init__(self, hue: Any | None = ..., sat: Any | None = ..., lum: Any | None = ...) -> None: ... + hue: Incomplete + sat: Incomplete + lum: Incomplete + def __init__(self, hue: Incomplete | None = ..., sat: Incomplete | None = ..., lum: Incomplete | None = ...) -> None: ... class GrayscaleEffect(Serialisable): tagname: str class FillOverlayEffect(Serialisable): - blend: Any - def __init__(self, blend: Any | None = ...) -> None: ... + blend: Incomplete + def __init__(self, blend: Incomplete | None = ...) -> None: ... class DuotoneEffect(Serialisable): ... class ColorReplaceEffect(Serialisable): ... class Color(Serialisable): ... class ColorChangeEffect(Serialisable): - useA: Any - clrFrom: Any - clrTo: Any - def __init__(self, useA: Any | None = ..., clrFrom: Any | None = ..., clrTo: Any | None = ...) -> None: ... + useA: Incomplete + clrFrom: Incomplete + clrTo: Incomplete + def __init__( + self, useA: Incomplete | None = ..., clrFrom: Incomplete | None = ..., clrTo: Incomplete | None = ... + ) -> None: ... class BlurEffect(Serialisable): - rad: Any - grow: Any - def __init__(self, rad: Any | None = ..., grow: Any | None = ...) -> None: ... + rad: Incomplete + grow: Incomplete + def __init__(self, rad: Incomplete | None = ..., grow: Incomplete | None = ...) -> None: ... class BiLevelEffect(Serialisable): - thresh: Any - def __init__(self, thresh: Any | None = ...) -> None: ... + thresh: Incomplete + def __init__(self, thresh: Incomplete | None = ...) -> None: ... class AlphaReplaceEffect(Serialisable): - a: Any - def __init__(self, a: Any | None = ...) -> None: ... + a: Incomplete + def __init__(self, a: Incomplete | None = ...) -> None: ... class AlphaModulateFixedEffect(Serialisable): - amt: Any - def __init__(self, amt: Any | None = ...) -> None: ... + amt: Incomplete + def __init__(self, amt: Incomplete | None = ...) -> None: ... class EffectContainer(Serialisable): - type: Any - name: Any - def __init__(self, type: Any | None = ..., name: Any | None = ...) -> None: ... + type: Incomplete + name: Incomplete + def __init__(self, type: Incomplete | None = ..., name: Incomplete | None = ...) -> None: ... class AlphaModulateEffect(Serialisable): - cont: Any - def __init__(self, cont: Any | None = ...) -> None: ... + cont: Incomplete + def __init__(self, cont: Incomplete | None = ...) -> None: ... class AlphaInverseEffect(Serialisable): ... class AlphaFloorEffect(Serialisable): ... class AlphaCeilingEffect(Serialisable): ... class AlphaBiLevelEffect(Serialisable): - thresh: Any - def __init__(self, thresh: Any | None = ...) -> None: ... + thresh: Incomplete + def __init__(self, thresh: Incomplete | None = ...) -> None: ... class GlowEffect(ColorChoice): - rad: Any - scrgbClr: Any - srgbClr: Any - hslClr: Any - sysClr: Any - schemeClr: Any - prstClr: Any - __elements__: Any - def __init__(self, rad: Any | None = ..., **kw) -> None: ... + rad: Incomplete + scrgbClr: Incomplete + srgbClr: Incomplete + hslClr: Incomplete + sysClr: Incomplete + schemeClr: Incomplete + prstClr: Incomplete + __elements__: Incomplete + def __init__(self, rad: Incomplete | None = ..., **kw) -> None: ... class InnerShadowEffect(ColorChoice): - blurRad: Any - dist: Any - dir: Any - scrgbClr: Any - srgbClr: Any - hslClr: Any - sysClr: Any - schemeClr: Any - prstClr: Any - __elements__: Any - def __init__(self, blurRad: Any | None = ..., dist: Any | None = ..., dir: Any | None = ..., **kw) -> None: ... + blurRad: Incomplete + dist: Incomplete + dir: Incomplete + scrgbClr: Incomplete + srgbClr: Incomplete + hslClr: Incomplete + sysClr: Incomplete + schemeClr: Incomplete + prstClr: Incomplete + __elements__: Incomplete + def __init__( + self, blurRad: Incomplete | None = ..., dist: Incomplete | None = ..., dir: Incomplete | None = ..., **kw + ) -> None: ... class OuterShadow(ColorChoice): tagname: str - blurRad: Any - dist: Any - dir: Any - sx: Any - sy: Any - kx: Any - ky: Any - algn: Any - rotWithShape: Any - scrgbClr: Any - srgbClr: Any - hslClr: Any - sysClr: Any - schemeClr: Any - prstClr: Any - __elements__: Any + blurRad: Incomplete + dist: Incomplete + dir: Incomplete + sx: Incomplete + sy: Incomplete + kx: Incomplete + ky: Incomplete + algn: Incomplete + rotWithShape: Incomplete + scrgbClr: Incomplete + srgbClr: Incomplete + hslClr: Incomplete + sysClr: Incomplete + schemeClr: Incomplete + prstClr: Incomplete + __elements__: Incomplete def __init__( self, - blurRad: Any | None = ..., - dist: Any | None = ..., - dir: Any | None = ..., - sx: Any | None = ..., - sy: Any | None = ..., - kx: Any | None = ..., - ky: Any | None = ..., - algn: Any | None = ..., - rotWithShape: Any | None = ..., + blurRad: Incomplete | None = ..., + dist: Incomplete | None = ..., + dir: Incomplete | None = ..., + sx: Incomplete | None = ..., + sy: Incomplete | None = ..., + kx: Incomplete | None = ..., + ky: Incomplete | None = ..., + algn: Incomplete | None = ..., + rotWithShape: Incomplete | None = ..., **kw, ) -> None: ... class PresetShadowEffect(ColorChoice): - prst: Any - dist: Any - dir: Any - scrgbClr: Any - srgbClr: Any - hslClr: Any - sysClr: Any - schemeClr: Any - prstClr: Any - __elements__: Any - def __init__(self, prst: Any | None = ..., dist: Any | None = ..., dir: Any | None = ..., **kw) -> None: ... + prst: Incomplete + dist: Incomplete + dir: Incomplete + scrgbClr: Incomplete + srgbClr: Incomplete + hslClr: Incomplete + sysClr: Incomplete + schemeClr: Incomplete + prstClr: Incomplete + __elements__: Incomplete + def __init__( + self, prst: Incomplete | None = ..., dist: Incomplete | None = ..., dir: Incomplete | None = ..., **kw + ) -> None: ... class ReflectionEffect(Serialisable): - blurRad: Any - stA: Any - stPos: Any - endA: Any - endPos: Any - dist: Any - dir: Any - fadeDir: Any - sx: Any - sy: Any - kx: Any - ky: Any - algn: Any - rotWithShape: Any + blurRad: Incomplete + stA: Incomplete + stPos: Incomplete + endA: Incomplete + endPos: Incomplete + dist: Incomplete + dir: Incomplete + fadeDir: Incomplete + sx: Incomplete + sy: Incomplete + kx: Incomplete + ky: Incomplete + algn: Incomplete + rotWithShape: Incomplete def __init__( self, - blurRad: Any | None = ..., - stA: Any | None = ..., - stPos: Any | None = ..., - endA: Any | None = ..., - endPos: Any | None = ..., - dist: Any | None = ..., - dir: Any | None = ..., - fadeDir: Any | None = ..., - sx: Any | None = ..., - sy: Any | None = ..., - kx: Any | None = ..., - ky: Any | None = ..., - algn: Any | None = ..., - rotWithShape: Any | None = ..., + blurRad: Incomplete | None = ..., + stA: Incomplete | None = ..., + stPos: Incomplete | None = ..., + endA: Incomplete | None = ..., + endPos: Incomplete | None = ..., + dist: Incomplete | None = ..., + dir: Incomplete | None = ..., + fadeDir: Incomplete | None = ..., + sx: Incomplete | None = ..., + sy: Incomplete | None = ..., + kx: Incomplete | None = ..., + ky: Incomplete | None = ..., + algn: Incomplete | None = ..., + rotWithShape: Incomplete | None = ..., ) -> None: ... class SoftEdgesEffect(Serialisable): - rad: Any - def __init__(self, rad: Any | None = ...) -> None: ... + rad: Incomplete + def __init__(self, rad: Incomplete | None = ...) -> None: ... class EffectList(Serialisable): - blur: Any - fillOverlay: Any - glow: Any - innerShdw: Any - outerShdw: Any - prstShdw: Any - reflection: Any - softEdge: Any - __elements__: Any + blur: Incomplete + fillOverlay: Incomplete + glow: Incomplete + innerShdw: Incomplete + outerShdw: Incomplete + prstShdw: Incomplete + reflection: Incomplete + softEdge: Incomplete + __elements__: Incomplete def __init__( self, - blur: Any | None = ..., - fillOverlay: Any | None = ..., - glow: Any | None = ..., - innerShdw: Any | None = ..., - outerShdw: Any | None = ..., - prstShdw: Any | None = ..., - reflection: Any | None = ..., - softEdge: Any | None = ..., + blur: Incomplete | None = ..., + fillOverlay: Incomplete | None = ..., + glow: Incomplete | None = ..., + innerShdw: Incomplete | None = ..., + outerShdw: Incomplete | None = ..., + prstShdw: Incomplete | None = ..., + reflection: Incomplete | None = ..., + softEdge: Incomplete | None = ..., ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/fill.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/fill.pyi index 6dbc40d67..88b2ce165 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/fill.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/fill.pyi @@ -1,221 +1,223 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class PatternFillProperties(Serialisable): tagname: str - namespace: Any - prst: Any - preset: Any - fgClr: Any - foreground: Any - bgClr: Any - background: Any - __elements__: Any - def __init__(self, prst: Any | None = ..., fgClr: Any | None = ..., bgClr: Any | None = ...) -> None: ... + namespace: Incomplete + prst: Incomplete + preset: Incomplete + fgClr: Incomplete + foreground: Incomplete + bgClr: Incomplete + background: Incomplete + __elements__: Incomplete + def __init__(self, prst: Incomplete | None = ..., fgClr: Incomplete | None = ..., bgClr: Incomplete | None = ...) -> None: ... class RelativeRect(Serialisable): tagname: str - namespace: Any - l: Any - left: Any - t: Any - top: Any - r: Any - right: Any - b: Any - bottom: Any - def __init__(self, l: Any | None = ..., t: Any | None = ..., r: Any | None = ..., b: Any | None = ...) -> None: ... + namespace: Incomplete + l: Incomplete + left: Incomplete + t: Incomplete + top: Incomplete + r: Incomplete + right: Incomplete + b: Incomplete + bottom: Incomplete + def __init__( + self, l: Incomplete | None = ..., t: Incomplete | None = ..., r: Incomplete | None = ..., b: Incomplete | None = ... + ) -> None: ... class StretchInfoProperties(Serialisable): tagname: str - namespace: Any - fillRect: Any + namespace: Incomplete + fillRect: Incomplete def __init__(self, fillRect=...) -> None: ... class GradientStop(Serialisable): tagname: str - namespace: Any - pos: Any - scrgbClr: Any - RGBPercent: Any - srgbClr: Any - RGB: Any - hslClr: Any - sysClr: Any - schemeClr: Any - prstClr: Any - __elements__: Any + namespace: Incomplete + pos: Incomplete + scrgbClr: Incomplete + RGBPercent: Incomplete + srgbClr: Incomplete + RGB: Incomplete + hslClr: Incomplete + sysClr: Incomplete + schemeClr: Incomplete + prstClr: Incomplete + __elements__: Incomplete def __init__( self, - pos: Any | None = ..., - scrgbClr: Any | None = ..., - srgbClr: Any | None = ..., - hslClr: Any | None = ..., - sysClr: Any | None = ..., - schemeClr: Any | None = ..., - prstClr: Any | None = ..., + pos: Incomplete | None = ..., + scrgbClr: Incomplete | None = ..., + srgbClr: Incomplete | None = ..., + hslClr: Incomplete | None = ..., + sysClr: Incomplete | None = ..., + schemeClr: Incomplete | None = ..., + prstClr: Incomplete | None = ..., ) -> None: ... class LinearShadeProperties(Serialisable): tagname: str - namespace: Any - ang: Any - scaled: Any - def __init__(self, ang: Any | None = ..., scaled: Any | None = ...) -> None: ... + namespace: Incomplete + ang: Incomplete + scaled: Incomplete + def __init__(self, ang: Incomplete | None = ..., scaled: Incomplete | None = ...) -> None: ... class PathShadeProperties(Serialisable): tagname: str - namespace: Any - path: Any - fillToRect: Any - def __init__(self, path: Any | None = ..., fillToRect: Any | None = ...) -> None: ... + namespace: Incomplete + path: Incomplete + fillToRect: Incomplete + def __init__(self, path: Incomplete | None = ..., fillToRect: Incomplete | None = ...) -> None: ... class GradientFillProperties(Serialisable): tagname: str - namespace: Any - flip: Any - rotWithShape: Any - gsLst: Any - stop_list: Any - lin: Any - linear: Any - path: Any - tileRect: Any - __elements__: Any + namespace: Incomplete + flip: Incomplete + rotWithShape: Incomplete + gsLst: Incomplete + stop_list: Incomplete + lin: Incomplete + linear: Incomplete + path: Incomplete + tileRect: Incomplete + __elements__: Incomplete def __init__( self, - flip: Any | None = ..., - rotWithShape: Any | None = ..., + flip: Incomplete | None = ..., + rotWithShape: Incomplete | None = ..., gsLst=..., - lin: Any | None = ..., - path: Any | None = ..., - tileRect: Any | None = ..., + lin: Incomplete | None = ..., + path: Incomplete | None = ..., + tileRect: Incomplete | None = ..., ) -> None: ... class SolidColorFillProperties(Serialisable): tagname: str - scrgbClr: Any - RGBPercent: Any - srgbClr: Any - RGB: Any - hslClr: Any - sysClr: Any - schemeClr: Any - prstClr: Any - __elements__: Any + scrgbClr: Incomplete + RGBPercent: Incomplete + srgbClr: Incomplete + RGB: Incomplete + hslClr: Incomplete + sysClr: Incomplete + schemeClr: Incomplete + prstClr: Incomplete + __elements__: Incomplete def __init__( self, - scrgbClr: Any | None = ..., - srgbClr: Any | None = ..., - hslClr: Any | None = ..., - sysClr: Any | None = ..., - schemeClr: Any | None = ..., - prstClr: Any | None = ..., + scrgbClr: Incomplete | None = ..., + srgbClr: Incomplete | None = ..., + hslClr: Incomplete | None = ..., + sysClr: Incomplete | None = ..., + schemeClr: Incomplete | None = ..., + prstClr: Incomplete | None = ..., ) -> None: ... class Blip(Serialisable): tagname: str - namespace: Any - cstate: Any - embed: Any - link: Any - noGrp: Any - noSelect: Any - noRot: Any - noChangeAspect: Any - noMove: Any - noResize: Any - noEditPoints: Any - noAdjustHandles: Any - noChangeArrowheads: Any - noChangeShapeType: Any - extLst: Any - alphaBiLevel: Any - alphaCeiling: Any - alphaFloor: Any - alphaInv: Any - alphaMod: Any - alphaModFix: Any - alphaRepl: Any - biLevel: Any - blur: Any - clrChange: Any - clrRepl: Any - duotone: Any - fillOverlay: Any - grayscl: Any - hsl: Any - lum: Any - tint: Any - __elements__: Any + namespace: Incomplete + cstate: Incomplete + embed: Incomplete + link: Incomplete + noGrp: Incomplete + noSelect: Incomplete + noRot: Incomplete + noChangeAspect: Incomplete + noMove: Incomplete + noResize: Incomplete + noEditPoints: Incomplete + noAdjustHandles: Incomplete + noChangeArrowheads: Incomplete + noChangeShapeType: Incomplete + extLst: Incomplete + alphaBiLevel: Incomplete + alphaCeiling: Incomplete + alphaFloor: Incomplete + alphaInv: Incomplete + alphaMod: Incomplete + alphaModFix: Incomplete + alphaRepl: Incomplete + biLevel: Incomplete + blur: Incomplete + clrChange: Incomplete + clrRepl: Incomplete + duotone: Incomplete + fillOverlay: Incomplete + grayscl: Incomplete + hsl: Incomplete + lum: Incomplete + tint: Incomplete + __elements__: Incomplete def __init__( self, - cstate: Any | None = ..., - embed: Any | None = ..., - link: Any | None = ..., - noGrp: Any | None = ..., - noSelect: Any | None = ..., - noRot: Any | None = ..., - noChangeAspect: Any | None = ..., - noMove: Any | None = ..., - noResize: Any | None = ..., - noEditPoints: Any | None = ..., - noAdjustHandles: Any | None = ..., - noChangeArrowheads: Any | None = ..., - noChangeShapeType: Any | None = ..., - extLst: Any | None = ..., - alphaBiLevel: Any | None = ..., - alphaCeiling: Any | None = ..., - alphaFloor: Any | None = ..., - alphaInv: Any | None = ..., - alphaMod: Any | None = ..., - alphaModFix: Any | None = ..., - alphaRepl: Any | None = ..., - biLevel: Any | None = ..., - blur: Any | None = ..., - clrChange: Any | None = ..., - clrRepl: Any | None = ..., - duotone: Any | None = ..., - fillOverlay: Any | None = ..., - grayscl: Any | None = ..., - hsl: Any | None = ..., - lum: Any | None = ..., - tint: Any | None = ..., + cstate: Incomplete | None = ..., + embed: Incomplete | None = ..., + link: Incomplete | None = ..., + noGrp: Incomplete | None = ..., + noSelect: Incomplete | None = ..., + noRot: Incomplete | None = ..., + noChangeAspect: Incomplete | None = ..., + noMove: Incomplete | None = ..., + noResize: Incomplete | None = ..., + noEditPoints: Incomplete | None = ..., + noAdjustHandles: Incomplete | None = ..., + noChangeArrowheads: Incomplete | None = ..., + noChangeShapeType: Incomplete | None = ..., + extLst: Incomplete | None = ..., + alphaBiLevel: Incomplete | None = ..., + alphaCeiling: Incomplete | None = ..., + alphaFloor: Incomplete | None = ..., + alphaInv: Incomplete | None = ..., + alphaMod: Incomplete | None = ..., + alphaModFix: Incomplete | None = ..., + alphaRepl: Incomplete | None = ..., + biLevel: Incomplete | None = ..., + blur: Incomplete | None = ..., + clrChange: Incomplete | None = ..., + clrRepl: Incomplete | None = ..., + duotone: Incomplete | None = ..., + fillOverlay: Incomplete | None = ..., + grayscl: Incomplete | None = ..., + hsl: Incomplete | None = ..., + lum: Incomplete | None = ..., + tint: Incomplete | None = ..., ) -> None: ... class TileInfoProperties(Serialisable): - tx: Any - ty: Any - sx: Any - sy: Any - flip: Any - algn: Any + tx: Incomplete + ty: Incomplete + sx: Incomplete + sy: Incomplete + flip: Incomplete + algn: Incomplete def __init__( self, - tx: Any | None = ..., - ty: Any | None = ..., - sx: Any | None = ..., - sy: Any | None = ..., - flip: Any | None = ..., - algn: Any | None = ..., + tx: Incomplete | None = ..., + ty: Incomplete | None = ..., + sx: Incomplete | None = ..., + sy: Incomplete | None = ..., + flip: Incomplete | None = ..., + algn: Incomplete | None = ..., ) -> None: ... class BlipFillProperties(Serialisable): tagname: str - dpi: Any - rotWithShape: Any - blip: Any - srcRect: Any - tile: Any - stretch: Any - __elements__: Any + dpi: Incomplete + rotWithShape: Incomplete + blip: Incomplete + srcRect: Incomplete + tile: Incomplete + stretch: Incomplete + __elements__: Incomplete def __init__( self, - dpi: Any | None = ..., - rotWithShape: Any | None = ..., - blip: Any | None = ..., - tile: Any | None = ..., + dpi: Incomplete | None = ..., + rotWithShape: Incomplete | None = ..., + blip: Incomplete | None = ..., + tile: Incomplete | None = ..., stretch=..., - srcRect: Any | None = ..., + srcRect: Incomplete | None = ..., ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/geometry.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/geometry.pyi index 8515b2eda..f5ed079b8 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/geometry.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/geometry.pyi @@ -1,239 +1,259 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class Point2D(Serialisable): tagname: str - namespace: Any - x: Any - y: Any - def __init__(self, x: Any | None = ..., y: Any | None = ...) -> None: ... + namespace: Incomplete + x: Incomplete + y: Incomplete + def __init__(self, x: Incomplete | None = ..., y: Incomplete | None = ...) -> None: ... class PositiveSize2D(Serialisable): tagname: str - namespace: Any - cx: Any - width: Any - cy: Any - height: Any - def __init__(self, cx: Any | None = ..., cy: Any | None = ...) -> None: ... + namespace: Incomplete + cx: Incomplete + width: Incomplete + cy: Incomplete + height: Incomplete + def __init__(self, cx: Incomplete | None = ..., cy: Incomplete | None = ...) -> None: ... class Transform2D(Serialisable): tagname: str - namespace: Any - rot: Any - flipH: Any - flipV: Any - off: Any - ext: Any - chOff: Any - chExt: Any - __elements__: Any + namespace: Incomplete + rot: Incomplete + flipH: Incomplete + flipV: Incomplete + off: Incomplete + ext: Incomplete + chOff: Incomplete + chExt: Incomplete + __elements__: Incomplete def __init__( self, - rot: Any | None = ..., - flipH: Any | None = ..., - flipV: Any | None = ..., - off: Any | None = ..., - ext: Any | None = ..., - chOff: Any | None = ..., - chExt: Any | None = ..., + rot: Incomplete | None = ..., + flipH: Incomplete | None = ..., + flipV: Incomplete | None = ..., + off: Incomplete | None = ..., + ext: Incomplete | None = ..., + chOff: Incomplete | None = ..., + chExt: Incomplete | None = ..., ) -> None: ... class GroupTransform2D(Serialisable): tagname: str - namespace: Any - rot: Any - flipH: Any - flipV: Any - off: Any - ext: Any - chOff: Any - chExt: Any - __elements__: Any + namespace: Incomplete + rot: Incomplete + flipH: Incomplete + flipV: Incomplete + off: Incomplete + ext: Incomplete + chOff: Incomplete + chExt: Incomplete + __elements__: Incomplete def __init__( self, rot: int = ..., - flipH: Any | None = ..., - flipV: Any | None = ..., - off: Any | None = ..., - ext: Any | None = ..., - chOff: Any | None = ..., - chExt: Any | None = ..., + flipH: Incomplete | None = ..., + flipV: Incomplete | None = ..., + off: Incomplete | None = ..., + ext: Incomplete | None = ..., + chOff: Incomplete | None = ..., + chExt: Incomplete | None = ..., ) -> None: ... class SphereCoords(Serialisable): tagname: str - lat: Any - lon: Any - rev: Any - def __init__(self, lat: Any | None = ..., lon: Any | None = ..., rev: Any | None = ...) -> None: ... + lat: Incomplete + lon: Incomplete + rev: Incomplete + def __init__(self, lat: Incomplete | None = ..., lon: Incomplete | None = ..., rev: Incomplete | None = ...) -> None: ... class Camera(Serialisable): tagname: str - prst: Any - fov: Any - zoom: Any - rot: Any - def __init__(self, prst: Any | None = ..., fov: Any | None = ..., zoom: Any | None = ..., rot: Any | None = ...) -> None: ... + prst: Incomplete + fov: Incomplete + zoom: Incomplete + rot: Incomplete + def __init__( + self, + prst: Incomplete | None = ..., + fov: Incomplete | None = ..., + zoom: Incomplete | None = ..., + rot: Incomplete | None = ..., + ) -> None: ... class LightRig(Serialisable): tagname: str - rig: Any - dir: Any - rot: Any - def __init__(self, rig: Any | None = ..., dir: Any | None = ..., rot: Any | None = ...) -> None: ... + rig: Incomplete + dir: Incomplete + rot: Incomplete + def __init__(self, rig: Incomplete | None = ..., dir: Incomplete | None = ..., rot: Incomplete | None = ...) -> None: ... class Vector3D(Serialisable): tagname: str - dx: Any - dy: Any - dz: Any - def __init__(self, dx: Any | None = ..., dy: Any | None = ..., dz: Any | None = ...) -> None: ... + dx: Incomplete + dy: Incomplete + dz: Incomplete + def __init__(self, dx: Incomplete | None = ..., dy: Incomplete | None = ..., dz: Incomplete | None = ...) -> None: ... class Point3D(Serialisable): tagname: str - x: Any - y: Any - z: Any - def __init__(self, x: Any | None = ..., y: Any | None = ..., z: Any | None = ...) -> None: ... + x: Incomplete + y: Incomplete + z: Incomplete + def __init__(self, x: Incomplete | None = ..., y: Incomplete | None = ..., z: Incomplete | None = ...) -> None: ... class Backdrop(Serialisable): - anchor: Any - norm: Any - up: Any - extLst: Any + anchor: Incomplete + norm: Incomplete + up: Incomplete + extLst: Incomplete def __init__( - self, anchor: Any | None = ..., norm: Any | None = ..., up: Any | None = ..., extLst: Any | None = ... + self, + anchor: Incomplete | None = ..., + norm: Incomplete | None = ..., + up: Incomplete | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... class Scene3D(Serialisable): - camera: Any - lightRig: Any - backdrop: Any - extLst: Any + camera: Incomplete + lightRig: Incomplete + backdrop: Incomplete + extLst: Incomplete def __init__( - self, camera: Any | None = ..., lightRig: Any | None = ..., backdrop: Any | None = ..., extLst: Any | None = ... + self, + camera: Incomplete | None = ..., + lightRig: Incomplete | None = ..., + backdrop: Incomplete | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... class Bevel(Serialisable): tagname: str - w: Any - h: Any - prst: Any - def __init__(self, w: Any | None = ..., h: Any | None = ..., prst: Any | None = ...) -> None: ... + w: Incomplete + h: Incomplete + prst: Incomplete + def __init__(self, w: Incomplete | None = ..., h: Incomplete | None = ..., prst: Incomplete | None = ...) -> None: ... class Shape3D(Serialisable): - namespace: Any - z: Any - extrusionH: Any - contourW: Any - prstMaterial: Any - bevelT: Any - bevelB: Any - extrusionClr: Any - contourClr: Any - extLst: Any + namespace: Incomplete + z: Incomplete + extrusionH: Incomplete + contourW: Incomplete + prstMaterial: Incomplete + bevelT: Incomplete + bevelB: Incomplete + extrusionClr: Incomplete + contourClr: Incomplete + extLst: Incomplete def __init__( self, - z: Any | None = ..., - extrusionH: Any | None = ..., - contourW: Any | None = ..., - prstMaterial: Any | None = ..., - bevelT: Any | None = ..., - bevelB: Any | None = ..., - extrusionClr: Any | None = ..., - contourClr: Any | None = ..., - extLst: Any | None = ..., + z: Incomplete | None = ..., + extrusionH: Incomplete | None = ..., + contourW: Incomplete | None = ..., + prstMaterial: Incomplete | None = ..., + bevelT: Incomplete | None = ..., + bevelB: Incomplete | None = ..., + extrusionClr: Incomplete | None = ..., + contourClr: Incomplete | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... class Path2D(Serialisable): - w: Any - h: Any - fill: Any - stroke: Any - extrusionOk: Any + w: Incomplete + h: Incomplete + fill: Incomplete + stroke: Incomplete + extrusionOk: Incomplete def __init__( self, - w: Any | None = ..., - h: Any | None = ..., - fill: Any | None = ..., - stroke: Any | None = ..., - extrusionOk: Any | None = ..., + w: Incomplete | None = ..., + h: Incomplete | None = ..., + fill: Incomplete | None = ..., + stroke: Incomplete | None = ..., + extrusionOk: Incomplete | None = ..., ) -> None: ... class Path2DList(Serialisable): - path: Any - def __init__(self, path: Any | None = ...) -> None: ... + path: Incomplete + def __init__(self, path: Incomplete | None = ...) -> None: ... class GeomRect(Serialisable): - l: Any - t: Any - r: Any - b: Any - def __init__(self, l: Any | None = ..., t: Any | None = ..., r: Any | None = ..., b: Any | None = ...) -> None: ... + l: Incomplete + t: Incomplete + r: Incomplete + b: Incomplete + def __init__( + self, l: Incomplete | None = ..., t: Incomplete | None = ..., r: Incomplete | None = ..., b: Incomplete | None = ... + ) -> None: ... class AdjPoint2D(Serialisable): - x: Any - y: Any - def __init__(self, x: Any | None = ..., y: Any | None = ...) -> None: ... + x: Incomplete + y: Incomplete + def __init__(self, x: Incomplete | None = ..., y: Incomplete | None = ...) -> None: ... class ConnectionSite(Serialisable): - ang: Any - pos: Any - def __init__(self, ang: Any | None = ..., pos: Any | None = ...) -> None: ... + ang: Incomplete + pos: Incomplete + def __init__(self, ang: Incomplete | None = ..., pos: Incomplete | None = ...) -> None: ... class ConnectionSiteList(Serialisable): - cxn: Any - def __init__(self, cxn: Any | None = ...) -> None: ... + cxn: Incomplete + def __init__(self, cxn: Incomplete | None = ...) -> None: ... class AdjustHandleList(Serialisable): ... class GeomGuide(Serialisable): - name: Any - fmla: Any - def __init__(self, name: Any | None = ..., fmla: Any | None = ...) -> None: ... + name: Incomplete + fmla: Incomplete + def __init__(self, name: Incomplete | None = ..., fmla: Incomplete | None = ...) -> None: ... class GeomGuideList(Serialisable): - gd: Any - def __init__(self, gd: Any | None = ...) -> None: ... + gd: Incomplete + def __init__(self, gd: Incomplete | None = ...) -> None: ... class CustomGeometry2D(Serialisable): - avLst: Any - gdLst: Any - ahLst: Any - cxnLst: Any - pathLst: Any - rect: Any + avLst: Incomplete + gdLst: Incomplete + ahLst: Incomplete + cxnLst: Incomplete + pathLst: Incomplete + rect: Incomplete def __init__( self, - avLst: Any | None = ..., - gdLst: Any | None = ..., - ahLst: Any | None = ..., - cxnLst: Any | None = ..., - rect: Any | None = ..., - pathLst: Any | None = ..., + avLst: Incomplete | None = ..., + gdLst: Incomplete | None = ..., + ahLst: Incomplete | None = ..., + cxnLst: Incomplete | None = ..., + rect: Incomplete | None = ..., + pathLst: Incomplete | None = ..., ) -> None: ... class PresetGeometry2D(Serialisable): - namespace: Any - prst: Any - avLst: Any - def __init__(self, prst: Any | None = ..., avLst: Any | None = ...) -> None: ... + namespace: Incomplete + prst: Incomplete + avLst: Incomplete + def __init__(self, prst: Incomplete | None = ..., avLst: Incomplete | None = ...) -> None: ... class FontReference(Serialisable): - idx: Any - def __init__(self, idx: Any | None = ...) -> None: ... + idx: Incomplete + def __init__(self, idx: Incomplete | None = ...) -> None: ... class StyleMatrixReference(Serialisable): - idx: Any - def __init__(self, idx: Any | None = ...) -> None: ... + idx: Incomplete + def __init__(self, idx: Incomplete | None = ...) -> None: ... class ShapeStyle(Serialisable): - lnRef: Any - fillRef: Any - effectRef: Any - fontRef: Any + lnRef: Incomplete + fillRef: Incomplete + effectRef: Incomplete + fontRef: Incomplete def __init__( - self, lnRef: Any | None = ..., fillRef: Any | None = ..., effectRef: Any | None = ..., fontRef: Any | None = ... + self, + lnRef: Incomplete | None = ..., + fillRef: Incomplete | None = ..., + effectRef: Incomplete | None = ..., + fontRef: Incomplete | None = ..., ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/graphic.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/graphic.pyi index 4f75f0676..c30ac13f5 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/graphic.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/graphic.pyi @@ -1,74 +1,76 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class GraphicFrameLocking(Serialisable): - noGrp: Any - noDrilldown: Any - noSelect: Any - noChangeAspect: Any - noMove: Any - noResize: Any - extLst: Any + noGrp: Incomplete + noDrilldown: Incomplete + noSelect: Incomplete + noChangeAspect: Incomplete + noMove: Incomplete + noResize: Incomplete + extLst: Incomplete def __init__( self, - noGrp: Any | None = ..., - noDrilldown: Any | None = ..., - noSelect: Any | None = ..., - noChangeAspect: Any | None = ..., - noMove: Any | None = ..., - noResize: Any | None = ..., - extLst: Any | None = ..., + noGrp: Incomplete | None = ..., + noDrilldown: Incomplete | None = ..., + noSelect: Incomplete | None = ..., + noChangeAspect: Incomplete | None = ..., + noMove: Incomplete | None = ..., + noResize: Incomplete | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... class NonVisualGraphicFrameProperties(Serialisable): tagname: str - graphicFrameLocks: Any - extLst: Any - def __init__(self, graphicFrameLocks: Any | None = ..., extLst: Any | None = ...) -> None: ... + graphicFrameLocks: Incomplete + extLst: Incomplete + def __init__(self, graphicFrameLocks: Incomplete | None = ..., extLst: Incomplete | None = ...) -> None: ... class NonVisualGraphicFrame(Serialisable): tagname: str - cNvPr: Any - cNvGraphicFramePr: Any - __elements__: Any - def __init__(self, cNvPr: Any | None = ..., cNvGraphicFramePr: Any | None = ...) -> None: ... + cNvPr: Incomplete + cNvGraphicFramePr: Incomplete + __elements__: Incomplete + def __init__(self, cNvPr: Incomplete | None = ..., cNvGraphicFramePr: Incomplete | None = ...) -> None: ... class GraphicData(Serialisable): tagname: str - namespace: Any - uri: Any - chart: Any - def __init__(self, uri=..., chart: Any | None = ...) -> None: ... + namespace: Incomplete + uri: Incomplete + chart: Incomplete + def __init__(self, uri=..., chart: Incomplete | None = ...) -> None: ... class GraphicObject(Serialisable): tagname: str - namespace: Any - graphicData: Any - def __init__(self, graphicData: Any | None = ...) -> None: ... + namespace: Incomplete + graphicData: Incomplete + def __init__(self, graphicData: Incomplete | None = ...) -> None: ... class GraphicFrame(Serialisable): tagname: str - nvGraphicFramePr: Any - xfrm: Any - graphic: Any - macro: Any - fPublished: Any - __elements__: Any + nvGraphicFramePr: Incomplete + xfrm: Incomplete + graphic: Incomplete + macro: Incomplete + fPublished: Incomplete + __elements__: Incomplete def __init__( self, - nvGraphicFramePr: Any | None = ..., - xfrm: Any | None = ..., - graphic: Any | None = ..., - macro: Any | None = ..., - fPublished: Any | None = ..., + nvGraphicFramePr: Incomplete | None = ..., + xfrm: Incomplete | None = ..., + graphic: Incomplete | None = ..., + macro: Incomplete | None = ..., + fPublished: Incomplete | None = ..., ) -> None: ... class GroupShape(Serialisable): - nvGrpSpPr: Any - nonVisualProperties: Any - grpSpPr: Any - visualProperties: Any - pic: Any - __elements__: Any - def __init__(self, nvGrpSpPr: Any | None = ..., grpSpPr: Any | None = ..., pic: Any | None = ...) -> None: ... + nvGrpSpPr: Incomplete + nonVisualProperties: Incomplete + grpSpPr: Incomplete + visualProperties: Incomplete + pic: Incomplete + __elements__: Incomplete + def __init__( + self, nvGrpSpPr: Incomplete | None = ..., grpSpPr: Incomplete | None = ..., pic: Incomplete | None = ... + ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/image.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/image.pyi index c1d8009f2..3864d30df 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/image.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/image.pyi @@ -1,9 +1,9 @@ -from typing import Any +from _typeshed import Incomplete class Image: anchor: str - ref: Any - format: Any + ref: Incomplete + format: Incomplete def __init__(self, img) -> None: ... @property def path(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/line.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/line.pyi index dd2c5395c..0c8ac33ac 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/line.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/line.pyi @@ -1,66 +1,66 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class LineEndProperties(Serialisable): tagname: str - namespace: Any - type: Any - w: Any - len: Any - def __init__(self, type: Any | None = ..., w: Any | None = ..., len: Any | None = ...) -> None: ... + namespace: Incomplete + type: Incomplete + w: Incomplete + len: Incomplete + def __init__(self, type: Incomplete | None = ..., w: Incomplete | None = ..., len: Incomplete | None = ...) -> None: ... class DashStop(Serialisable): tagname: str - namespace: Any - d: Any - length: Any - sp: Any - space: Any + namespace: Incomplete + d: Incomplete + length: Incomplete + sp: Incomplete + space: Incomplete def __init__(self, d: int = ..., sp: int = ...) -> None: ... class DashStopList(Serialisable): - ds: Any - def __init__(self, ds: Any | None = ...) -> None: ... + ds: Incomplete + def __init__(self, ds: Incomplete | None = ...) -> None: ... class LineProperties(Serialisable): tagname: str - namespace: Any - w: Any - width: Any - cap: Any - cmpd: Any - algn: Any - noFill: Any - solidFill: Any - gradFill: Any - pattFill: Any - prstDash: Any - dashStyle: Any - custDash: Any - round: Any - bevel: Any - miter: Any - headEnd: Any - tailEnd: Any - extLst: Any - __elements__: Any + namespace: Incomplete + w: Incomplete + width: Incomplete + cap: Incomplete + cmpd: Incomplete + algn: Incomplete + noFill: Incomplete + solidFill: Incomplete + gradFill: Incomplete + pattFill: Incomplete + prstDash: Incomplete + dashStyle: Incomplete + custDash: Incomplete + round: Incomplete + bevel: Incomplete + miter: Incomplete + headEnd: Incomplete + tailEnd: Incomplete + extLst: Incomplete + __elements__: Incomplete def __init__( self, - w: Any | None = ..., - cap: Any | None = ..., - cmpd: Any | None = ..., - algn: Any | None = ..., - noFill: Any | None = ..., - solidFill: Any | None = ..., - gradFill: Any | None = ..., - pattFill: Any | None = ..., - prstDash: Any | None = ..., - custDash: Any | None = ..., - round: Any | None = ..., - bevel: Any | None = ..., - miter: Any | None = ..., - headEnd: Any | None = ..., - tailEnd: Any | None = ..., - extLst: Any | None = ..., + w: Incomplete | None = ..., + cap: Incomplete | None = ..., + cmpd: Incomplete | None = ..., + algn: Incomplete | None = ..., + noFill: Incomplete | None = ..., + solidFill: Incomplete | None = ..., + gradFill: Incomplete | None = ..., + pattFill: Incomplete | None = ..., + prstDash: Incomplete | None = ..., + custDash: Incomplete | None = ..., + round: Incomplete | None = ..., + bevel: Incomplete | None = ..., + miter: Incomplete | None = ..., + headEnd: Incomplete | None = ..., + tailEnd: Incomplete | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/picture.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/picture.pyi index 1ff1db8e8..9f916d778 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/picture.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/picture.pyi @@ -1,70 +1,72 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class PictureLocking(Serialisable): tagname: str - namespace: Any - noCrop: Any - noGrp: Any - noSelect: Any - noRot: Any - noChangeAspect: Any - noMove: Any - noResize: Any - noEditPoints: Any - noAdjustHandles: Any - noChangeArrowheads: Any - noChangeShapeType: Any - extLst: Any - __elements__: Any + namespace: Incomplete + noCrop: Incomplete + noGrp: Incomplete + noSelect: Incomplete + noRot: Incomplete + noChangeAspect: Incomplete + noMove: Incomplete + noResize: Incomplete + noEditPoints: Incomplete + noAdjustHandles: Incomplete + noChangeArrowheads: Incomplete + noChangeShapeType: Incomplete + extLst: Incomplete + __elements__: Incomplete def __init__( self, - noCrop: Any | None = ..., - noGrp: Any | None = ..., - noSelect: Any | None = ..., - noRot: Any | None = ..., - noChangeAspect: Any | None = ..., - noMove: Any | None = ..., - noResize: Any | None = ..., - noEditPoints: Any | None = ..., - noAdjustHandles: Any | None = ..., - noChangeArrowheads: Any | None = ..., - noChangeShapeType: Any | None = ..., - extLst: Any | None = ..., + noCrop: Incomplete | None = ..., + noGrp: Incomplete | None = ..., + noSelect: Incomplete | None = ..., + noRot: Incomplete | None = ..., + noChangeAspect: Incomplete | None = ..., + noMove: Incomplete | None = ..., + noResize: Incomplete | None = ..., + noEditPoints: Incomplete | None = ..., + noAdjustHandles: Incomplete | None = ..., + noChangeArrowheads: Incomplete | None = ..., + noChangeShapeType: Incomplete | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... class NonVisualPictureProperties(Serialisable): tagname: str - preferRelativeResize: Any - picLocks: Any - extLst: Any - __elements__: Any - def __init__(self, preferRelativeResize: Any | None = ..., picLocks: Any | None = ..., extLst: Any | None = ...) -> None: ... + preferRelativeResize: Incomplete + picLocks: Incomplete + extLst: Incomplete + __elements__: Incomplete + def __init__( + self, preferRelativeResize: Incomplete | None = ..., picLocks: Incomplete | None = ..., extLst: Incomplete | None = ... + ) -> None: ... class PictureNonVisual(Serialisable): tagname: str - cNvPr: Any - cNvPicPr: Any - __elements__: Any - def __init__(self, cNvPr: Any | None = ..., cNvPicPr: Any | None = ...) -> None: ... + cNvPr: Incomplete + cNvPicPr: Incomplete + __elements__: Incomplete + def __init__(self, cNvPr: Incomplete | None = ..., cNvPicPr: Incomplete | None = ...) -> None: ... class PictureFrame(Serialisable): tagname: str - macro: Any - fPublished: Any - nvPicPr: Any - blipFill: Any - spPr: Any - graphicalProperties: Any - style: Any - __elements__: Any + macro: Incomplete + fPublished: Incomplete + nvPicPr: Incomplete + blipFill: Incomplete + spPr: Incomplete + graphicalProperties: Incomplete + style: Incomplete + __elements__: Incomplete def __init__( self, - macro: Any | None = ..., - fPublished: Any | None = ..., - nvPicPr: Any | None = ..., - blipFill: Any | None = ..., - spPr: Any | None = ..., - style: Any | None = ..., + macro: Incomplete | None = ..., + fPublished: Incomplete | None = ..., + nvPicPr: Incomplete | None = ..., + blipFill: Incomplete | None = ..., + spPr: Incomplete | None = ..., + style: Incomplete | None = ..., ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/properties.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/properties.pyi index f0782a45b..a7fdff46c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/properties.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/properties.pyi @@ -1,91 +1,97 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class GroupShapeProperties(Serialisable): tagname: str - bwMode: Any - xfrm: Any - scene3d: Any - extLst: Any + bwMode: Incomplete + xfrm: Incomplete + scene3d: Incomplete + extLst: Incomplete def __init__( - self, bwMode: Any | None = ..., xfrm: Any | None = ..., scene3d: Any | None = ..., extLst: Any | None = ... + self, + bwMode: Incomplete | None = ..., + xfrm: Incomplete | None = ..., + scene3d: Incomplete | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... class GroupLocking(Serialisable): tagname: str - namespace: Any - noGrp: Any - noUngrp: Any - noSelect: Any - noRot: Any - noChangeAspect: Any - noMove: Any - noResize: Any - noChangeArrowheads: Any - noEditPoints: Any - noAdjustHandles: Any - noChangeShapeType: Any - extLst: Any - __elements__: Any + namespace: Incomplete + noGrp: Incomplete + noUngrp: Incomplete + noSelect: Incomplete + noRot: Incomplete + noChangeAspect: Incomplete + noMove: Incomplete + noResize: Incomplete + noChangeArrowheads: Incomplete + noEditPoints: Incomplete + noAdjustHandles: Incomplete + noChangeShapeType: Incomplete + extLst: Incomplete + __elements__: Incomplete def __init__( self, - noGrp: Any | None = ..., - noUngrp: Any | None = ..., - noSelect: Any | None = ..., - noRot: Any | None = ..., - noChangeAspect: Any | None = ..., - noChangeArrowheads: Any | None = ..., - noMove: Any | None = ..., - noResize: Any | None = ..., - noEditPoints: Any | None = ..., - noAdjustHandles: Any | None = ..., - noChangeShapeType: Any | None = ..., - extLst: Any | None = ..., + noGrp: Incomplete | None = ..., + noUngrp: Incomplete | None = ..., + noSelect: Incomplete | None = ..., + noRot: Incomplete | None = ..., + noChangeAspect: Incomplete | None = ..., + noChangeArrowheads: Incomplete | None = ..., + noMove: Incomplete | None = ..., + noResize: Incomplete | None = ..., + noEditPoints: Incomplete | None = ..., + noAdjustHandles: Incomplete | None = ..., + noChangeShapeType: Incomplete | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... class NonVisualGroupDrawingShapeProps(Serialisable): tagname: str - grpSpLocks: Any - extLst: Any - __elements__: Any - def __init__(self, grpSpLocks: Any | None = ..., extLst: Any | None = ...) -> None: ... + grpSpLocks: Incomplete + extLst: Incomplete + __elements__: Incomplete + def __init__(self, grpSpLocks: Incomplete | None = ..., extLst: Incomplete | None = ...) -> None: ... class NonVisualDrawingShapeProps(Serialisable): tagname: str - spLocks: Any - txBax: Any - extLst: Any - __elements__: Any - txBox: Any - def __init__(self, spLocks: Any | None = ..., txBox: Any | None = ..., extLst: Any | None = ...) -> None: ... + spLocks: Incomplete + txBax: Incomplete + extLst: Incomplete + __elements__: Incomplete + txBox: Incomplete + def __init__( + self, spLocks: Incomplete | None = ..., txBox: Incomplete | None = ..., extLst: Incomplete | None = ... + ) -> None: ... class NonVisualDrawingProps(Serialisable): tagname: str - id: Any - name: Any - descr: Any - hidden: Any - title: Any - hlinkClick: Any - hlinkHover: Any - extLst: Any - __elements__: Any + id: Incomplete + name: Incomplete + descr: Incomplete + hidden: Incomplete + title: Incomplete + hlinkClick: Incomplete + hlinkHover: Incomplete + extLst: Incomplete + __elements__: Incomplete def __init__( self, - id: Any | None = ..., - name: Any | None = ..., - descr: Any | None = ..., - hidden: Any | None = ..., - title: Any | None = ..., - hlinkClick: Any | None = ..., - hlinkHover: Any | None = ..., - extLst: Any | None = ..., + id: Incomplete | None = ..., + name: Incomplete | None = ..., + descr: Incomplete | None = ..., + hidden: Incomplete | None = ..., + title: Incomplete | None = ..., + hlinkClick: Incomplete | None = ..., + hlinkHover: Incomplete | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... class NonVisualGroupShape(Serialisable): tagname: str - cNvPr: Any - cNvGrpSpPr: Any - __elements__: Any - def __init__(self, cNvPr: Any | None = ..., cNvGrpSpPr: Any | None = ...) -> None: ... + cNvPr: Incomplete + cNvGrpSpPr: Incomplete + __elements__: Incomplete + def __init__(self, cNvPr: Incomplete | None = ..., cNvGrpSpPr: Incomplete | None = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/relation.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/relation.pyi index 69079ce66..05c831ed1 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/relation.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/relation.pyi @@ -1,9 +1,9 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class ChartRelation(Serialisable): tagname: str - namespace: Any - id: Any + namespace: Incomplete + id: Incomplete def __init__(self, id) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/spreadsheet_drawing.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/spreadsheet_drawing.pyi index 1f96318e0..3e1de73b5 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/spreadsheet_drawing.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/spreadsheet_drawing.pyi @@ -1,96 +1,98 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class AnchorClientData(Serialisable): - fLocksWithSheet: Any - fPrintsWithSheet: Any - def __init__(self, fLocksWithSheet: Any | None = ..., fPrintsWithSheet: Any | None = ...) -> None: ... + fLocksWithSheet: Incomplete + fPrintsWithSheet: Incomplete + def __init__(self, fLocksWithSheet: Incomplete | None = ..., fPrintsWithSheet: Incomplete | None = ...) -> None: ... class AnchorMarker(Serialisable): tagname: str - col: Any - colOff: Any - row: Any - rowOff: Any + col: Incomplete + colOff: Incomplete + row: Incomplete + rowOff: Incomplete def __init__(self, col: int = ..., colOff: int = ..., row: int = ..., rowOff: int = ...) -> None: ... class _AnchorBase(Serialisable): - sp: Any - shape: Any - grpSp: Any - groupShape: Any - graphicFrame: Any - cxnSp: Any - connectionShape: Any - pic: Any - contentPart: Any - clientData: Any - __elements__: Any + sp: Incomplete + shape: Incomplete + grpSp: Incomplete + groupShape: Incomplete + graphicFrame: Incomplete + cxnSp: Incomplete + connectionShape: Incomplete + pic: Incomplete + contentPart: Incomplete + clientData: Incomplete + __elements__: Incomplete def __init__( self, - clientData: Any | None = ..., - sp: Any | None = ..., - grpSp: Any | None = ..., - graphicFrame: Any | None = ..., - cxnSp: Any | None = ..., - pic: Any | None = ..., - contentPart: Any | None = ..., + clientData: Incomplete | None = ..., + sp: Incomplete | None = ..., + grpSp: Incomplete | None = ..., + graphicFrame: Incomplete | None = ..., + cxnSp: Incomplete | None = ..., + pic: Incomplete | None = ..., + contentPart: Incomplete | None = ..., ) -> None: ... class AbsoluteAnchor(_AnchorBase): tagname: str - pos: Any - ext: Any - sp: Any - grpSp: Any - graphicFrame: Any - cxnSp: Any - pic: Any - contentPart: Any - clientData: Any - __elements__: Any - def __init__(self, pos: Any | None = ..., ext: Any | None = ..., **kw) -> None: ... + pos: Incomplete + ext: Incomplete + sp: Incomplete + grpSp: Incomplete + graphicFrame: Incomplete + cxnSp: Incomplete + pic: Incomplete + contentPart: Incomplete + clientData: Incomplete + __elements__: Incomplete + def __init__(self, pos: Incomplete | None = ..., ext: Incomplete | None = ..., **kw) -> None: ... class OneCellAnchor(_AnchorBase): tagname: str - ext: Any - sp: Any - grpSp: Any - graphicFrame: Any - cxnSp: Any - pic: Any - contentPart: Any - clientData: Any - __elements__: Any - def __init__(self, _from: Any | None = ..., ext: Any | None = ..., **kw) -> None: ... + ext: Incomplete + sp: Incomplete + grpSp: Incomplete + graphicFrame: Incomplete + cxnSp: Incomplete + pic: Incomplete + contentPart: Incomplete + clientData: Incomplete + __elements__: Incomplete + def __init__(self, _from: Incomplete | None = ..., ext: Incomplete | None = ..., **kw) -> None: ... class TwoCellAnchor(_AnchorBase): tagname: str - editAs: Any - to: Any - sp: Any - grpSp: Any - graphicFrame: Any - cxnSp: Any - pic: Any - contentPart: Any - clientData: Any - __elements__: Any - def __init__(self, editAs: Any | None = ..., _from: Any | None = ..., to: Any | None = ..., **kw) -> None: ... + editAs: Incomplete + to: Incomplete + sp: Incomplete + grpSp: Incomplete + graphicFrame: Incomplete + cxnSp: Incomplete + pic: Incomplete + contentPart: Incomplete + clientData: Incomplete + __elements__: Incomplete + def __init__( + self, editAs: Incomplete | None = ..., _from: Incomplete | None = ..., to: Incomplete | None = ..., **kw + ) -> None: ... class SpreadsheetDrawing(Serialisable): tagname: str mime_type: str PartName: str - twoCellAnchor: Any - oneCellAnchor: Any - absoluteAnchor: Any - __elements__: Any - charts: Any - images: Any + twoCellAnchor: Incomplete + oneCellAnchor: Incomplete + absoluteAnchor: Incomplete + __elements__: Incomplete + charts: Incomplete + images: Incomplete def __init__(self, twoCellAnchor=..., oneCellAnchor=..., absoluteAnchor=...) -> None: ... - def __hash__(self): ... - def __bool__(self): ... + def __hash__(self) -> int: ... + def __bool__(self) -> bool: ... @property def path(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/text.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/text.pyi index 86a7b04a2..8ace87800 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/text.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/text.pyi @@ -1,377 +1,386 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class EmbeddedWAVAudioFile(Serialisable): # type: ignore[misc] - name: Any - def __init__(self, name: Any | None = ...) -> None: ... + name: Incomplete + def __init__(self, name: Incomplete | None = ...) -> None: ... class Hyperlink(Serialisable): tagname: str - namespace: Any - invalidUrl: Any - action: Any - tgtFrame: Any - tooltip: Any - history: Any - highlightClick: Any - endSnd: Any - snd: Any - extLst: Any - id: Any - __elements__: Any + namespace: Incomplete + invalidUrl: Incomplete + action: Incomplete + tgtFrame: Incomplete + tooltip: Incomplete + history: Incomplete + highlightClick: Incomplete + endSnd: Incomplete + snd: Incomplete + extLst: Incomplete + id: Incomplete + __elements__: Incomplete def __init__( self, - invalidUrl: Any | None = ..., - action: Any | None = ..., - tgtFrame: Any | None = ..., - tooltip: Any | None = ..., - history: Any | None = ..., - highlightClick: Any | None = ..., - endSnd: Any | None = ..., - snd: Any | None = ..., - extLst: Any | None = ..., - id: Any | None = ..., + invalidUrl: Incomplete | None = ..., + action: Incomplete | None = ..., + tgtFrame: Incomplete | None = ..., + tooltip: Incomplete | None = ..., + history: Incomplete | None = ..., + highlightClick: Incomplete | None = ..., + endSnd: Incomplete | None = ..., + snd: Incomplete | None = ..., + extLst: Incomplete | None = ..., + id: Incomplete | None = ..., ) -> None: ... class Font(Serialisable): tagname: str - namespace: Any - typeface: Any - panose: Any - pitchFamily: Any - charset: Any + namespace: Incomplete + typeface: Incomplete + panose: Incomplete + pitchFamily: Incomplete + charset: Incomplete def __init__( - self, typeface: Any | None = ..., panose: Any | None = ..., pitchFamily: Any | None = ..., charset: Any | None = ... + self, + typeface: Incomplete | None = ..., + panose: Incomplete | None = ..., + pitchFamily: Incomplete | None = ..., + charset: Incomplete | None = ..., ) -> None: ... class CharacterProperties(Serialisable): tagname: str - namespace: Any - kumimoji: Any - lang: Any - altLang: Any - sz: Any - b: Any - i: Any - u: Any - strike: Any - kern: Any - cap: Any - spc: Any - normalizeH: Any - baseline: Any - noProof: Any - dirty: Any - err: Any - smtClean: Any - smtId: Any - bmk: Any - ln: Any - highlight: Any - latin: Any - ea: Any - cs: Any - sym: Any - hlinkClick: Any - hlinkMouseOver: Any - rtl: Any - extLst: Any - noFill: Any - solidFill: Any - gradFill: Any - blipFill: Any - pattFill: Any - grpFill: Any - effectLst: Any - effectDag: Any - uLnTx: Any - uLn: Any - uFillTx: Any - uFill: Any - __elements__: Any + namespace: Incomplete + kumimoji: Incomplete + lang: Incomplete + altLang: Incomplete + sz: Incomplete + b: Incomplete + i: Incomplete + u: Incomplete + strike: Incomplete + kern: Incomplete + cap: Incomplete + spc: Incomplete + normalizeH: Incomplete + baseline: Incomplete + noProof: Incomplete + dirty: Incomplete + err: Incomplete + smtClean: Incomplete + smtId: Incomplete + bmk: Incomplete + ln: Incomplete + highlight: Incomplete + latin: Incomplete + ea: Incomplete + cs: Incomplete + sym: Incomplete + hlinkClick: Incomplete + hlinkMouseOver: Incomplete + rtl: Incomplete + extLst: Incomplete + noFill: Incomplete + solidFill: Incomplete + gradFill: Incomplete + blipFill: Incomplete + pattFill: Incomplete + grpFill: Incomplete + effectLst: Incomplete + effectDag: Incomplete + uLnTx: Incomplete + uLn: Incomplete + uFillTx: Incomplete + uFill: Incomplete + __elements__: Incomplete def __init__( self, - kumimoji: Any | None = ..., - lang: Any | None = ..., - altLang: Any | None = ..., - sz: Any | None = ..., - b: Any | None = ..., - i: Any | None = ..., - u: Any | None = ..., - strike: Any | None = ..., - kern: Any | None = ..., - cap: Any | None = ..., - spc: Any | None = ..., - normalizeH: Any | None = ..., - baseline: Any | None = ..., - noProof: Any | None = ..., - dirty: Any | None = ..., - err: Any | None = ..., - smtClean: Any | None = ..., - smtId: Any | None = ..., - bmk: Any | None = ..., - ln: Any | None = ..., - highlight: Any | None = ..., - latin: Any | None = ..., - ea: Any | None = ..., - cs: Any | None = ..., - sym: Any | None = ..., - hlinkClick: Any | None = ..., - hlinkMouseOver: Any | None = ..., - rtl: Any | None = ..., - extLst: Any | None = ..., - noFill: Any | None = ..., - solidFill: Any | None = ..., - gradFill: Any | None = ..., - blipFill: Any | None = ..., - pattFill: Any | None = ..., - grpFill: Any | None = ..., - effectLst: Any | None = ..., - effectDag: Any | None = ..., - uLnTx: Any | None = ..., - uLn: Any | None = ..., - uFillTx: Any | None = ..., - uFill: Any | None = ..., + kumimoji: Incomplete | None = ..., + lang: Incomplete | None = ..., + altLang: Incomplete | None = ..., + sz: Incomplete | None = ..., + b: Incomplete | None = ..., + i: Incomplete | None = ..., + u: Incomplete | None = ..., + strike: Incomplete | None = ..., + kern: Incomplete | None = ..., + cap: Incomplete | None = ..., + spc: Incomplete | None = ..., + normalizeH: Incomplete | None = ..., + baseline: Incomplete | None = ..., + noProof: Incomplete | None = ..., + dirty: Incomplete | None = ..., + err: Incomplete | None = ..., + smtClean: Incomplete | None = ..., + smtId: Incomplete | None = ..., + bmk: Incomplete | None = ..., + ln: Incomplete | None = ..., + highlight: Incomplete | None = ..., + latin: Incomplete | None = ..., + ea: Incomplete | None = ..., + cs: Incomplete | None = ..., + sym: Incomplete | None = ..., + hlinkClick: Incomplete | None = ..., + hlinkMouseOver: Incomplete | None = ..., + rtl: Incomplete | None = ..., + extLst: Incomplete | None = ..., + noFill: Incomplete | None = ..., + solidFill: Incomplete | None = ..., + gradFill: Incomplete | None = ..., + blipFill: Incomplete | None = ..., + pattFill: Incomplete | None = ..., + grpFill: Incomplete | None = ..., + effectLst: Incomplete | None = ..., + effectDag: Incomplete | None = ..., + uLnTx: Incomplete | None = ..., + uLn: Incomplete | None = ..., + uFillTx: Incomplete | None = ..., + uFill: Incomplete | None = ..., ) -> None: ... class TabStop(Serialisable): # type: ignore[misc] - pos: Any - algn: Any - def __init__(self, pos: Any | None = ..., algn: Any | None = ...) -> None: ... + pos: Incomplete + algn: Incomplete + def __init__(self, pos: Incomplete | None = ..., algn: Incomplete | None = ...) -> None: ... class TabStopList(Serialisable): # type: ignore[misc] - tab: Any - def __init__(self, tab: Any | None = ...) -> None: ... + tab: Incomplete + def __init__(self, tab: Incomplete | None = ...) -> None: ... class Spacing(Serialisable): - spcPct: Any - spcPts: Any - __elements__: Any - def __init__(self, spcPct: Any | None = ..., spcPts: Any | None = ...) -> None: ... + spcPct: Incomplete + spcPts: Incomplete + __elements__: Incomplete + def __init__(self, spcPct: Incomplete | None = ..., spcPts: Incomplete | None = ...) -> None: ... class AutonumberBullet(Serialisable): - type: Any - startAt: Any - def __init__(self, type: Any | None = ..., startAt: Any | None = ...) -> None: ... + type: Incomplete + startAt: Incomplete + def __init__(self, type: Incomplete | None = ..., startAt: Incomplete | None = ...) -> None: ... class ParagraphProperties(Serialisable): tagname: str - namespace: Any - marL: Any - marR: Any - lvl: Any - indent: Any - algn: Any - defTabSz: Any - rtl: Any - eaLnBrk: Any - fontAlgn: Any - latinLnBrk: Any - hangingPunct: Any - lnSpc: Any - spcBef: Any - spcAft: Any - tabLst: Any - defRPr: Any - extLst: Any - buClrTx: Any - buClr: Any - buSzTx: Any - buSzPct: Any - buSzPts: Any - buFontTx: Any - buFont: Any - buNone: Any - buAutoNum: Any - buChar: Any - buBlip: Any - __elements__: Any + namespace: Incomplete + marL: Incomplete + marR: Incomplete + lvl: Incomplete + indent: Incomplete + algn: Incomplete + defTabSz: Incomplete + rtl: Incomplete + eaLnBrk: Incomplete + fontAlgn: Incomplete + latinLnBrk: Incomplete + hangingPunct: Incomplete + lnSpc: Incomplete + spcBef: Incomplete + spcAft: Incomplete + tabLst: Incomplete + defRPr: Incomplete + extLst: Incomplete + buClrTx: Incomplete + buClr: Incomplete + buSzTx: Incomplete + buSzPct: Incomplete + buSzPts: Incomplete + buFontTx: Incomplete + buFont: Incomplete + buNone: Incomplete + buAutoNum: Incomplete + buChar: Incomplete + buBlip: Incomplete + __elements__: Incomplete def __init__( self, - marL: Any | None = ..., - marR: Any | None = ..., - lvl: Any | None = ..., - indent: Any | None = ..., - algn: Any | None = ..., - defTabSz: Any | None = ..., - rtl: Any | None = ..., - eaLnBrk: Any | None = ..., - fontAlgn: Any | None = ..., - latinLnBrk: Any | None = ..., - hangingPunct: Any | None = ..., - lnSpc: Any | None = ..., - spcBef: Any | None = ..., - spcAft: Any | None = ..., - tabLst: Any | None = ..., - defRPr: Any | None = ..., - extLst: Any | None = ..., - buClrTx: Any | None = ..., - buClr: Any | None = ..., - buSzTx: Any | None = ..., - buSzPct: Any | None = ..., - buSzPts: Any | None = ..., - buFontTx: Any | None = ..., - buFont: Any | None = ..., - buNone: Any | None = ..., - buAutoNum: Any | None = ..., - buChar: Any | None = ..., - buBlip: Any | None = ..., + marL: Incomplete | None = ..., + marR: Incomplete | None = ..., + lvl: Incomplete | None = ..., + indent: Incomplete | None = ..., + algn: Incomplete | None = ..., + defTabSz: Incomplete | None = ..., + rtl: Incomplete | None = ..., + eaLnBrk: Incomplete | None = ..., + fontAlgn: Incomplete | None = ..., + latinLnBrk: Incomplete | None = ..., + hangingPunct: Incomplete | None = ..., + lnSpc: Incomplete | None = ..., + spcBef: Incomplete | None = ..., + spcAft: Incomplete | None = ..., + tabLst: Incomplete | None = ..., + defRPr: Incomplete | None = ..., + extLst: Incomplete | None = ..., + buClrTx: Incomplete | None = ..., + buClr: Incomplete | None = ..., + buSzTx: Incomplete | None = ..., + buSzPct: Incomplete | None = ..., + buSzPts: Incomplete | None = ..., + buFontTx: Incomplete | None = ..., + buFont: Incomplete | None = ..., + buNone: Incomplete | None = ..., + buAutoNum: Incomplete | None = ..., + buChar: Incomplete | None = ..., + buBlip: Incomplete | None = ..., ) -> None: ... class ListStyle(Serialisable): tagname: str - namespace: Any - defPPr: Any - lvl1pPr: Any - lvl2pPr: Any - lvl3pPr: Any - lvl4pPr: Any - lvl5pPr: Any - lvl6pPr: Any - lvl7pPr: Any - lvl8pPr: Any - lvl9pPr: Any - extLst: Any - __elements__: Any + namespace: Incomplete + defPPr: Incomplete + lvl1pPr: Incomplete + lvl2pPr: Incomplete + lvl3pPr: Incomplete + lvl4pPr: Incomplete + lvl5pPr: Incomplete + lvl6pPr: Incomplete + lvl7pPr: Incomplete + lvl8pPr: Incomplete + lvl9pPr: Incomplete + extLst: Incomplete + __elements__: Incomplete def __init__( self, - defPPr: Any | None = ..., - lvl1pPr: Any | None = ..., - lvl2pPr: Any | None = ..., - lvl3pPr: Any | None = ..., - lvl4pPr: Any | None = ..., - lvl5pPr: Any | None = ..., - lvl6pPr: Any | None = ..., - lvl7pPr: Any | None = ..., - lvl8pPr: Any | None = ..., - lvl9pPr: Any | None = ..., - extLst: Any | None = ..., + defPPr: Incomplete | None = ..., + lvl1pPr: Incomplete | None = ..., + lvl2pPr: Incomplete | None = ..., + lvl3pPr: Incomplete | None = ..., + lvl4pPr: Incomplete | None = ..., + lvl5pPr: Incomplete | None = ..., + lvl6pPr: Incomplete | None = ..., + lvl7pPr: Incomplete | None = ..., + lvl8pPr: Incomplete | None = ..., + lvl9pPr: Incomplete | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... class RegularTextRun(Serialisable): tagname: str - namespace: Any - rPr: Any - properties: Any - t: Any - value: Any - __elements__: Any - def __init__(self, rPr: Any | None = ..., t: str = ...) -> None: ... + namespace: Incomplete + rPr: Incomplete + properties: Incomplete + t: Incomplete + value: Incomplete + __elements__: Incomplete + def __init__(self, rPr: Incomplete | None = ..., t: str = ...) -> None: ... class LineBreak(Serialisable): tagname: str - namespace: Any - rPr: Any - __elements__: Any - def __init__(self, rPr: Any | None = ...) -> None: ... + namespace: Incomplete + rPr: Incomplete + __elements__: Incomplete + def __init__(self, rPr: Incomplete | None = ...) -> None: ... class TextField(Serialisable): - id: Any - type: Any - rPr: Any - pPr: Any - t: Any - __elements__: Any + id: Incomplete + type: Incomplete + rPr: Incomplete + pPr: Incomplete + t: Incomplete + __elements__: Incomplete def __init__( - self, id: Any | None = ..., type: Any | None = ..., rPr: Any | None = ..., pPr: Any | None = ..., t: Any | None = ... + self, + id: Incomplete | None = ..., + type: Incomplete | None = ..., + rPr: Incomplete | None = ..., + pPr: Incomplete | None = ..., + t: Incomplete | None = ..., ) -> None: ... class Paragraph(Serialisable): tagname: str - namespace: Any - pPr: Any - properties: Any - endParaRPr: Any - r: Any - text: Any - br: Any - fld: Any - __elements__: Any + namespace: Incomplete + pPr: Incomplete + properties: Incomplete + endParaRPr: Incomplete + r: Incomplete + text: Incomplete + br: Incomplete + fld: Incomplete + __elements__: Incomplete def __init__( self, - pPr: Any | None = ..., - endParaRPr: Any | None = ..., - r: Any | None = ..., - br: Any | None = ..., - fld: Any | None = ..., + pPr: Incomplete | None = ..., + endParaRPr: Incomplete | None = ..., + r: Incomplete | None = ..., + br: Incomplete | None = ..., + fld: Incomplete | None = ..., ) -> None: ... class GeomGuide(Serialisable): - name: Any - fmla: Any - def __init__(self, name: Any | None = ..., fmla: Any | None = ...) -> None: ... + name: Incomplete + fmla: Incomplete + def __init__(self, name: Incomplete | None = ..., fmla: Incomplete | None = ...) -> None: ... class GeomGuideList(Serialisable): - gd: Any - def __init__(self, gd: Any | None = ...) -> None: ... + gd: Incomplete + def __init__(self, gd: Incomplete | None = ...) -> None: ... class PresetTextShape(Serialisable): - prst: Any - avLst: Any - def __init__(self, prst: Any | None = ..., avLst: Any | None = ...) -> None: ... + prst: Incomplete + avLst: Incomplete + def __init__(self, prst: Incomplete | None = ..., avLst: Incomplete | None = ...) -> None: ... class TextNormalAutofit(Serialisable): - fontScale: Any - lnSpcReduction: Any - def __init__(self, fontScale: Any | None = ..., lnSpcReduction: Any | None = ...) -> None: ... + fontScale: Incomplete + lnSpcReduction: Incomplete + def __init__(self, fontScale: Incomplete | None = ..., lnSpcReduction: Incomplete | None = ...) -> None: ... class RichTextProperties(Serialisable): tagname: str - namespace: Any - rot: Any - spcFirstLastPara: Any - vertOverflow: Any - horzOverflow: Any - vert: Any - wrap: Any - lIns: Any - tIns: Any - rIns: Any - bIns: Any - numCol: Any - spcCol: Any - rtlCol: Any - fromWordArt: Any - anchor: Any - anchorCtr: Any - forceAA: Any - upright: Any - compatLnSpc: Any - prstTxWarp: Any - scene3d: Any - extLst: Any - noAutofit: Any - normAutofit: Any - spAutoFit: Any - flatTx: Any - __elements__: Any + namespace: Incomplete + rot: Incomplete + spcFirstLastPara: Incomplete + vertOverflow: Incomplete + horzOverflow: Incomplete + vert: Incomplete + wrap: Incomplete + lIns: Incomplete + tIns: Incomplete + rIns: Incomplete + bIns: Incomplete + numCol: Incomplete + spcCol: Incomplete + rtlCol: Incomplete + fromWordArt: Incomplete + anchor: Incomplete + anchorCtr: Incomplete + forceAA: Incomplete + upright: Incomplete + compatLnSpc: Incomplete + prstTxWarp: Incomplete + scene3d: Incomplete + extLst: Incomplete + noAutofit: Incomplete + normAutofit: Incomplete + spAutoFit: Incomplete + flatTx: Incomplete + __elements__: Incomplete def __init__( self, - rot: Any | None = ..., - spcFirstLastPara: Any | None = ..., - vertOverflow: Any | None = ..., - horzOverflow: Any | None = ..., - vert: Any | None = ..., - wrap: Any | None = ..., - lIns: Any | None = ..., - tIns: Any | None = ..., - rIns: Any | None = ..., - bIns: Any | None = ..., - numCol: Any | None = ..., - spcCol: Any | None = ..., - rtlCol: Any | None = ..., - fromWordArt: Any | None = ..., - anchor: Any | None = ..., - anchorCtr: Any | None = ..., - forceAA: Any | None = ..., - upright: Any | None = ..., - compatLnSpc: Any | None = ..., - prstTxWarp: Any | None = ..., - scene3d: Any | None = ..., - extLst: Any | None = ..., - noAutofit: Any | None = ..., - normAutofit: Any | None = ..., - spAutoFit: Any | None = ..., - flatTx: Any | None = ..., + rot: Incomplete | None = ..., + spcFirstLastPara: Incomplete | None = ..., + vertOverflow: Incomplete | None = ..., + horzOverflow: Incomplete | None = ..., + vert: Incomplete | None = ..., + wrap: Incomplete | None = ..., + lIns: Incomplete | None = ..., + tIns: Incomplete | None = ..., + rIns: Incomplete | None = ..., + bIns: Incomplete | None = ..., + numCol: Incomplete | None = ..., + spcCol: Incomplete | None = ..., + rtlCol: Incomplete | None = ..., + fromWordArt: Incomplete | None = ..., + anchor: Incomplete | None = ..., + anchorCtr: Incomplete | None = ..., + forceAA: Incomplete | None = ..., + upright: Incomplete | None = ..., + compatLnSpc: Incomplete | None = ..., + prstTxWarp: Incomplete | None = ..., + scene3d: Incomplete | None = ..., + extLst: Incomplete | None = ..., + noAutofit: Incomplete | None = ..., + normAutofit: Incomplete | None = ..., + spAutoFit: Incomplete | None = ..., + flatTx: Incomplete | None = ..., ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/xdr.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/xdr.pyi index d54d0cc72..c77a2b7e1 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/xdr.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/xdr.pyi @@ -1,23 +1,23 @@ -from typing import Any +from _typeshed import Incomplete from .geometry import Point2D, PositiveSize2D, Transform2D class XDRPoint2D(Point2D): - namespace: Any - x: Any - y: Any + namespace: Incomplete + x: Incomplete + y: Incomplete class XDRPositiveSize2D(PositiveSize2D): - namespace: Any - cx: Any - cy: Any + namespace: Incomplete + cx: Incomplete + cy: Incomplete class XDRTransform2D(Transform2D): - namespace: Any - rot: Any - flipH: Any - flipV: Any - off: Any - ext: Any - chOff: Any - chExt: Any + namespace: Incomplete + rot: Incomplete + flipH: Incomplete + flipV: Incomplete + off: Incomplete + ext: Incomplete + chOff: Incomplete + chExt: Incomplete diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/formatting/formatting.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/formatting/formatting.pyi index e9328cbb1..e4dfa0bc8 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/formatting/formatting.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/formatting/formatting.pyi @@ -1,25 +1,25 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class ConditionalFormatting(Serialisable): tagname: str - sqref: Any - cells: Any - pivot: Any - cfRule: Any - rules: Any - def __init__(self, sqref=..., pivot: Any | None = ..., cfRule=..., extLst: Any | None = ...) -> None: ... + sqref: Incomplete + cells: Incomplete + pivot: Incomplete + cfRule: Incomplete + rules: Incomplete + def __init__(self, sqref=..., pivot: Incomplete | None = ..., cfRule=..., extLst: Incomplete | None = ...) -> None: ... def __eq__(self, other): ... - def __hash__(self): ... + def __hash__(self) -> int: ... def __contains__(self, coord): ... class ConditionalFormattingList: max_priority: int def __init__(self) -> None: ... def add(self, range_string, cfRule) -> None: ... - def __bool__(self): ... - def __len__(self): ... + def __bool__(self) -> bool: ... + def __len__(self) -> int: ... def __iter__(self): ... def __getitem__(self, key): ... def __delitem__(self, key) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/formatting/rule.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/formatting/rule.pyi index 92b4ea812..5807e1f5f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/formatting/rule.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/formatting/rule.pyi @@ -1,152 +1,154 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors import Float from openpyxl.descriptors.serialisable import Serialisable class ValueDescriptor(Float): - expected_type: Any + expected_type: Incomplete def __set__(self, instance, value) -> None: ... class FormatObject(Serialisable): tagname: str - type: Any - val: Any - gte: Any - extLst: Any - __elements__: Any - def __init__(self, type, val: Any | None = ..., gte: Any | None = ..., extLst: Any | None = ...) -> None: ... + type: Incomplete + val: Incomplete + gte: Incomplete + extLst: Incomplete + __elements__: Incomplete + def __init__( + self, type, val: Incomplete | None = ..., gte: Incomplete | None = ..., extLst: Incomplete | None = ... + ) -> None: ... class RuleType(Serialisable): # type: ignore[misc] - cfvo: Any + cfvo: Incomplete class IconSet(RuleType): tagname: str - iconSet: Any - showValue: Any - percent: Any - reverse: Any - __elements__: Any - cfvo: Any + iconSet: Incomplete + showValue: Incomplete + percent: Incomplete + reverse: Incomplete + __elements__: Incomplete + cfvo: Incomplete def __init__( self, - iconSet: Any | None = ..., - showValue: Any | None = ..., - percent: Any | None = ..., - reverse: Any | None = ..., - cfvo: Any | None = ..., + iconSet: Incomplete | None = ..., + showValue: Incomplete | None = ..., + percent: Incomplete | None = ..., + reverse: Incomplete | None = ..., + cfvo: Incomplete | None = ..., ) -> None: ... class DataBar(RuleType): tagname: str - minLength: Any - maxLength: Any - showValue: Any - color: Any - __elements__: Any - cfvo: Any + minLength: Incomplete + maxLength: Incomplete + showValue: Incomplete + color: Incomplete + __elements__: Incomplete + cfvo: Incomplete def __init__( self, - minLength: Any | None = ..., - maxLength: Any | None = ..., - showValue: Any | None = ..., - cfvo: Any | None = ..., - color: Any | None = ..., + minLength: Incomplete | None = ..., + maxLength: Incomplete | None = ..., + showValue: Incomplete | None = ..., + cfvo: Incomplete | None = ..., + color: Incomplete | None = ..., ) -> None: ... class ColorScale(RuleType): tagname: str - color: Any - __elements__: Any - cfvo: Any - def __init__(self, cfvo: Any | None = ..., color: Any | None = ...) -> None: ... + color: Incomplete + __elements__: Incomplete + cfvo: Incomplete + def __init__(self, cfvo: Incomplete | None = ..., color: Incomplete | None = ...) -> None: ... class Rule(Serialisable): tagname: str - type: Any - dxfId: Any - priority: Any - stopIfTrue: Any - aboveAverage: Any - percent: Any - bottom: Any - operator: Any - text: Any - timePeriod: Any - rank: Any - stdDev: Any - equalAverage: Any - formula: Any - colorScale: Any - dataBar: Any - iconSet: Any - extLst: Any - dxf: Any - __elements__: Any - __attrs__: Any + type: Incomplete + dxfId: Incomplete + priority: Incomplete + stopIfTrue: Incomplete + aboveAverage: Incomplete + percent: Incomplete + bottom: Incomplete + operator: Incomplete + text: Incomplete + timePeriod: Incomplete + rank: Incomplete + stdDev: Incomplete + equalAverage: Incomplete + formula: Incomplete + colorScale: Incomplete + dataBar: Incomplete + iconSet: Incomplete + extLst: Incomplete + dxf: Incomplete + __elements__: Incomplete + __attrs__: Incomplete def __init__( self, type, - dxfId: Any | None = ..., + dxfId: Incomplete | None = ..., priority: int = ..., - stopIfTrue: Any | None = ..., - aboveAverage: Any | None = ..., - percent: Any | None = ..., - bottom: Any | None = ..., - operator: Any | None = ..., - text: Any | None = ..., - timePeriod: Any | None = ..., - rank: Any | None = ..., - stdDev: Any | None = ..., - equalAverage: Any | None = ..., + stopIfTrue: Incomplete | None = ..., + aboveAverage: Incomplete | None = ..., + percent: Incomplete | None = ..., + bottom: Incomplete | None = ..., + operator: Incomplete | None = ..., + text: Incomplete | None = ..., + timePeriod: Incomplete | None = ..., + rank: Incomplete | None = ..., + stdDev: Incomplete | None = ..., + equalAverage: Incomplete | None = ..., formula=..., - colorScale: Any | None = ..., - dataBar: Any | None = ..., - iconSet: Any | None = ..., - extLst: Any | None = ..., - dxf: Any | None = ..., + colorScale: Incomplete | None = ..., + dataBar: Incomplete | None = ..., + iconSet: Incomplete | None = ..., + extLst: Incomplete | None = ..., + dxf: Incomplete | None = ..., ) -> None: ... def ColorScaleRule( - start_type: Any | None = ..., - start_value: Any | None = ..., - start_color: Any | None = ..., - mid_type: Any | None = ..., - mid_value: Any | None = ..., - mid_color: Any | None = ..., - end_type: Any | None = ..., - end_value: Any | None = ..., - end_color: Any | None = ..., + start_type: Incomplete | None = ..., + start_value: Incomplete | None = ..., + start_color: Incomplete | None = ..., + mid_type: Incomplete | None = ..., + mid_value: Incomplete | None = ..., + mid_color: Incomplete | None = ..., + end_type: Incomplete | None = ..., + end_value: Incomplete | None = ..., + end_color: Incomplete | None = ..., ): ... def FormulaRule( - formula: Any | None = ..., - stopIfTrue: Any | None = ..., - font: Any | None = ..., - border: Any | None = ..., - fill: Any | None = ..., + formula: Incomplete | None = ..., + stopIfTrue: Incomplete | None = ..., + font: Incomplete | None = ..., + border: Incomplete | None = ..., + fill: Incomplete | None = ..., ): ... def CellIsRule( - operator: Any | None = ..., - formula: Any | None = ..., - stopIfTrue: Any | None = ..., - font: Any | None = ..., - border: Any | None = ..., - fill: Any | None = ..., + operator: Incomplete | None = ..., + formula: Incomplete | None = ..., + stopIfTrue: Incomplete | None = ..., + font: Incomplete | None = ..., + border: Incomplete | None = ..., + fill: Incomplete | None = ..., ): ... def IconSetRule( - icon_style: Any | None = ..., - type: Any | None = ..., - values: Any | None = ..., - showValue: Any | None = ..., - percent: Any | None = ..., - reverse: Any | None = ..., + icon_style: Incomplete | None = ..., + type: Incomplete | None = ..., + values: Incomplete | None = ..., + showValue: Incomplete | None = ..., + percent: Incomplete | None = ..., + reverse: Incomplete | None = ..., ): ... def DataBarRule( - start_type: Any | None = ..., - start_value: Any | None = ..., - end_type: Any | None = ..., - end_value: Any | None = ..., - color: Any | None = ..., - showValue: Any | None = ..., - minLength: Any | None = ..., - maxLength: Any | None = ..., + start_type: Incomplete | None = ..., + start_value: Incomplete | None = ..., + end_type: Incomplete | None = ..., + end_value: Incomplete | None = ..., + color: Incomplete | None = ..., + showValue: Incomplete | None = ..., + minLength: Incomplete | None = ..., + maxLength: Incomplete | None = ..., ): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/formula/tokenizer.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/formula/tokenizer.pyi index 355e48ee9..16129f95f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/formula/tokenizer.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/formula/tokenizer.pyi @@ -1,18 +1,18 @@ -from typing import Any +from _typeshed import Incomplete class TokenizerError(Exception): ... class Tokenizer: - SN_RE: Any - WSPACE_RE: Any - STRING_REGEXES: Any - ERROR_CODES: Any + SN_RE: Incomplete + WSPACE_RE: Incomplete + STRING_REGEXES: Incomplete + ERROR_CODES: Incomplete TOKEN_ENDERS: str - formula: Any - items: Any - token_stack: Any + formula: Incomplete + items: Incomplete + token_stack: Incomplete offset: int - token: Any + token: Incomplete def __init__(self, formula) -> None: ... def check_scientific_notation(self): ... def assert_empty_token(self, can_follow=...) -> None: ... @@ -30,9 +30,9 @@ class Token: OP_IN: str OP_POST: str WSPACE: str - value: Any - type: Any - subtype: Any + value: Incomplete + type: Incomplete + subtype: Incomplete def __init__(self, value, type_, subtype: str = ...) -> None: ... TEXT: str NUMBER: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/formula/translate.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/formula/translate.pyi index 07297155d..0904e1e64 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/formula/translate.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/formula/translate.pyi @@ -1,14 +1,14 @@ -from typing import Any +from _typeshed import Incomplete class TranslatorError(Exception): ... class Translator: - tokenizer: Any + tokenizer: Incomplete def __init__(self, formula, origin) -> None: ... def get_tokens(self): ... - ROW_RANGE_RE: Any - COL_RANGE_RE: Any - CELL_REF_RE: Any + ROW_RANGE_RE: Incomplete + COL_RANGE_RE: Incomplete + CELL_REF_RE: Incomplete @staticmethod def translate_row(row_str, rdelta): ... @staticmethod @@ -17,4 +17,4 @@ class Translator: def strip_ws_name(range_str): ... @classmethod def translate_range(cls, range_str, rdelta, cdelta): ... - def translate_formula(self, dest: Any | None = ..., row_delta: int = ..., col_delta: int = ...): ... + def translate_formula(self, dest: Incomplete | None = ..., row_delta: int = ..., col_delta: int = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/core.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/core.pyi index 824260ed6..0fb87a72a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/core.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/core.pyi @@ -1,51 +1,51 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors import DateTime from openpyxl.descriptors.nested import NestedText from openpyxl.descriptors.serialisable import Serialisable class NestedDateTime(DateTime, NestedText): - expected_type: Any - def to_tree(self, tagname: Any | None = ..., value: Any | None = ..., namespace: Any | None = ...): ... + expected_type: Incomplete + def to_tree(self, tagname: Incomplete | None = ..., value: Incomplete | None = ..., namespace: Incomplete | None = ...): ... class QualifiedDateTime(NestedDateTime): - def to_tree(self, tagname: Any | None = ..., value: Any | None = ..., namespace: Any | None = ...): ... + def to_tree(self, tagname: Incomplete | None = ..., value: Incomplete | None = ..., namespace: Incomplete | None = ...): ... class DocumentProperties(Serialisable): tagname: str - namespace: Any - category: Any - contentStatus: Any - keywords: Any - lastModifiedBy: Any - lastPrinted: Any - revision: Any - version: Any - last_modified_by: Any - subject: Any - title: Any - creator: Any - description: Any - identifier: Any - language: Any - created: Any - modified: Any - __elements__: Any + namespace: Incomplete + category: Incomplete + contentStatus: Incomplete + keywords: Incomplete + lastModifiedBy: Incomplete + lastPrinted: Incomplete + revision: Incomplete + version: Incomplete + last_modified_by: Incomplete + subject: Incomplete + title: Incomplete + creator: Incomplete + description: Incomplete + identifier: Incomplete + language: Incomplete + created: Incomplete + modified: Incomplete + __elements__: Incomplete def __init__( self, - category: Any | None = ..., - contentStatus: Any | None = ..., - keywords: Any | None = ..., - lastModifiedBy: Any | None = ..., - lastPrinted: Any | None = ..., - revision: Any | None = ..., - version: Any | None = ..., + category: Incomplete | None = ..., + contentStatus: Incomplete | None = ..., + keywords: Incomplete | None = ..., + lastModifiedBy: Incomplete | None = ..., + lastPrinted: Incomplete | None = ..., + revision: Incomplete | None = ..., + version: Incomplete | None = ..., created=..., creator: str = ..., - description: Any | None = ..., - identifier: Any | None = ..., - language: Any | None = ..., + description: Incomplete | None = ..., + identifier: Incomplete | None = ..., + language: Incomplete | None = ..., modified=..., - subject: Any | None = ..., - title: Any | None = ..., + subject: Incomplete | None = ..., + title: Incomplete | None = ..., ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/extended.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/extended.pyi index 72312b02a..644279d1a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/extended.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/extended.pyi @@ -1,79 +1,79 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable def get_version(): ... class DigSigBlob(Serialisable): # type: ignore[misc] - __elements__: Any - __attrs__: Any + __elements__: Incomplete + __attrs__: Incomplete class VectorLpstr(Serialisable): # type: ignore[misc] - __elements__: Any - __attrs__: Any + __elements__: Incomplete + __attrs__: Incomplete class VectorVariant(Serialisable): # type: ignore[misc] - __elements__: Any - __attrs__: Any + __elements__: Incomplete + __attrs__: Incomplete class ExtendedProperties(Serialisable): tagname: str - Template: Any - Manager: Any - Company: Any - Pages: Any - Words: Any - Characters: Any - PresentationFormat: Any - Lines: Any - Paragraphs: Any - Slides: Any - Notes: Any - TotalTime: Any - HiddenSlides: Any - MMClips: Any - ScaleCrop: Any - HeadingPairs: Any - TitlesOfParts: Any - LinksUpToDate: Any - CharactersWithSpaces: Any - SharedDoc: Any - HyperlinkBase: Any - HLinks: Any - HyperlinksChanged: Any - DigSig: Any - Application: Any - AppVersion: Any - DocSecurity: Any - __elements__: Any + Template: Incomplete + Manager: Incomplete + Company: Incomplete + Pages: Incomplete + Words: Incomplete + Characters: Incomplete + PresentationFormat: Incomplete + Lines: Incomplete + Paragraphs: Incomplete + Slides: Incomplete + Notes: Incomplete + TotalTime: Incomplete + HiddenSlides: Incomplete + MMClips: Incomplete + ScaleCrop: Incomplete + HeadingPairs: Incomplete + TitlesOfParts: Incomplete + LinksUpToDate: Incomplete + CharactersWithSpaces: Incomplete + SharedDoc: Incomplete + HyperlinkBase: Incomplete + HLinks: Incomplete + HyperlinksChanged: Incomplete + DigSig: Incomplete + Application: Incomplete + AppVersion: Incomplete + DocSecurity: Incomplete + __elements__: Incomplete def __init__( self, - Template: Any | None = ..., - Manager: Any | None = ..., - Company: Any | None = ..., - Pages: Any | None = ..., - Words: Any | None = ..., - Characters: Any | None = ..., - PresentationFormat: Any | None = ..., - Lines: Any | None = ..., - Paragraphs: Any | None = ..., - Slides: Any | None = ..., - Notes: Any | None = ..., - TotalTime: Any | None = ..., - HiddenSlides: Any | None = ..., - MMClips: Any | None = ..., - ScaleCrop: Any | None = ..., - HeadingPairs: Any | None = ..., - TitlesOfParts: Any | None = ..., - LinksUpToDate: Any | None = ..., - CharactersWithSpaces: Any | None = ..., - SharedDoc: Any | None = ..., - HyperlinkBase: Any | None = ..., - HLinks: Any | None = ..., - HyperlinksChanged: Any | None = ..., - DigSig: Any | None = ..., + Template: Incomplete | None = ..., + Manager: Incomplete | None = ..., + Company: Incomplete | None = ..., + Pages: Incomplete | None = ..., + Words: Incomplete | None = ..., + Characters: Incomplete | None = ..., + PresentationFormat: Incomplete | None = ..., + Lines: Incomplete | None = ..., + Paragraphs: Incomplete | None = ..., + Slides: Incomplete | None = ..., + Notes: Incomplete | None = ..., + TotalTime: Incomplete | None = ..., + HiddenSlides: Incomplete | None = ..., + MMClips: Incomplete | None = ..., + ScaleCrop: Incomplete | None = ..., + HeadingPairs: Incomplete | None = ..., + TitlesOfParts: Incomplete | None = ..., + LinksUpToDate: Incomplete | None = ..., + CharactersWithSpaces: Incomplete | None = ..., + SharedDoc: Incomplete | None = ..., + HyperlinkBase: Incomplete | None = ..., + HLinks: Incomplete | None = ..., + HyperlinksChanged: Incomplete | None = ..., + DigSig: Incomplete | None = ..., Application: str = ..., - AppVersion: Any | None = ..., - DocSecurity: Any | None = ..., + AppVersion: Incomplete | None = ..., + DocSecurity: Incomplete | None = ..., ) -> None: ... def to_tree(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/manifest.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/manifest.pyi index 404d7cae0..78ee86788 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/manifest.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/manifest.pyi @@ -1,31 +1,31 @@ +from _typeshed import Incomplete from collections.abc import Generator -from typing import Any from openpyxl.descriptors.serialisable import Serialisable -mimetypes: Any +mimetypes: Incomplete class FileExtension(Serialisable): tagname: str - Extension: Any - ContentType: Any + Extension: Incomplete + ContentType: Incomplete def __init__(self, Extension, ContentType) -> None: ... class Override(Serialisable): tagname: str - PartName: Any - ContentType: Any + PartName: Incomplete + ContentType: Incomplete def __init__(self, PartName, ContentType) -> None: ... -DEFAULT_TYPES: Any -DEFAULT_OVERRIDE: Any +DEFAULT_TYPES: Incomplete +DEFAULT_OVERRIDE: Incomplete class Manifest(Serialisable): tagname: str - Default: Any - Override: Any + Default: Incomplete + Override: Incomplete path: str - __elements__: Any + __elements__: Incomplete def __init__(self, Default=..., Override=...) -> None: ... @property def filenames(self): ... @@ -34,5 +34,5 @@ class Manifest(Serialisable): def to_tree(self): ... def __contains__(self, content_type): ... def find(self, content_type): ... - def findall(self, content_type) -> Generator[Any, None, None]: ... + def findall(self, content_type) -> Generator[Incomplete, None, None]: ... def append(self, obj) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/relationship.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/relationship.pyi index 437c1e254..c8447aa97 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/relationship.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/relationship.pyi @@ -1,36 +1,36 @@ +from _typeshed import Incomplete from collections.abc import Generator -from typing import Any from openpyxl.descriptors.serialisable import Serialisable class Relationship(Serialisable): tagname: str - Type: Any - Target: Any - target: Any - TargetMode: Any - Id: Any - id: Any + Type: Incomplete + Target: Incomplete + target: Incomplete + TargetMode: Incomplete + Id: Incomplete + id: Incomplete def __init__( self, - Id: Any | None = ..., - Type: Any | None = ..., - type: Any | None = ..., - Target: Any | None = ..., - TargetMode: Any | None = ..., + Id: Incomplete | None = ..., + Type: Incomplete | None = ..., + type: Incomplete | None = ..., + Target: Incomplete | None = ..., + TargetMode: Incomplete | None = ..., ) -> None: ... class RelationshipList(Serialisable): tagname: str - Relationship: Any + Relationship: Incomplete def __init__(self, Relationship=...) -> None: ... def append(self, value) -> None: ... - def __len__(self): ... - def __bool__(self): ... - def find(self, content_type) -> Generator[Any, None, None]: ... + def __len__(self) -> int: ... + def __bool__(self) -> bool: ... + def find(self, content_type) -> Generator[Incomplete, None, None]: ... def __getitem__(self, key): ... def to_tree(self): ... def get_rels_path(path): ... def get_dependents(archive, filename): ... -def get_rel(archive, deps, id: Any | None = ..., cls: Any | None = ...): ... +def get_rel(archive, deps, id: Incomplete | None = ..., cls: Incomplete | None = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/workbook.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/workbook.pyi index d095602b4..a9b7497d7 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/workbook.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/workbook.pyi @@ -1,86 +1,86 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class FileRecoveryProperties(Serialisable): tagname: str - autoRecover: Any - crashSave: Any - dataExtractLoad: Any - repairLoad: Any + autoRecover: Incomplete + crashSave: Incomplete + dataExtractLoad: Incomplete + repairLoad: Incomplete def __init__( self, - autoRecover: Any | None = ..., - crashSave: Any | None = ..., - dataExtractLoad: Any | None = ..., - repairLoad: Any | None = ..., + autoRecover: Incomplete | None = ..., + crashSave: Incomplete | None = ..., + dataExtractLoad: Incomplete | None = ..., + repairLoad: Incomplete | None = ..., ) -> None: ... class ChildSheet(Serialisable): tagname: str - name: Any - sheetId: Any - state: Any - id: Any - def __init__(self, name: Any | None = ..., sheetId: Any | None = ..., state: str = ..., id: Any | None = ...) -> None: ... + name: Incomplete + sheetId: Incomplete + state: Incomplete + id: Incomplete + def __init__( + self, name: Incomplete | None = ..., sheetId: Incomplete | None = ..., state: str = ..., id: Incomplete | None = ... + ) -> None: ... class PivotCache(Serialisable): tagname: str - cacheId: Any - id: Any - def __init__(self, cacheId: Any | None = ..., id: Any | None = ...) -> None: ... + cacheId: Incomplete + id: Incomplete + def __init__(self, cacheId: Incomplete | None = ..., id: Incomplete | None = ...) -> None: ... class WorkbookPackage(Serialisable): tagname: str - conformance: Any - fileVersion: Any - fileSharing: Any - workbookPr: Any - properties: Any - workbookProtection: Any - bookViews: Any - sheets: Any - functionGroups: Any - externalReferences: Any - definedNames: Any - calcPr: Any - oleSize: Any - customWorkbookViews: Any - pivotCaches: Any - smartTagPr: Any - smartTagTypes: Any - webPublishing: Any - fileRecoveryPr: Any - webPublishObjects: Any - extLst: Any - Ignorable: Any - __elements__: Any + conformance: Incomplete + fileVersion: Incomplete + fileSharing: Incomplete + workbookPr: Incomplete + properties: Incomplete + workbookProtection: Incomplete + bookViews: Incomplete + sheets: Incomplete + functionGroups: Incomplete + externalReferences: Incomplete + definedNames: Incomplete + calcPr: Incomplete + oleSize: Incomplete + customWorkbookViews: Incomplete + pivotCaches: Incomplete + smartTagPr: Incomplete + smartTagTypes: Incomplete + webPublishing: Incomplete + fileRecoveryPr: Incomplete + webPublishObjects: Incomplete + extLst: Incomplete + Ignorable: Incomplete + __elements__: Incomplete def __init__( self, - conformance: Any | None = ..., - fileVersion: Any | None = ..., - fileSharing: Any | None = ..., - workbookPr: Any | None = ..., - workbookProtection: Any | None = ..., + conformance: Incomplete | None = ..., + fileVersion: Incomplete | None = ..., + fileSharing: Incomplete | None = ..., + workbookPr: Incomplete | None = ..., + workbookProtection: Incomplete | None = ..., bookViews=..., sheets=..., - functionGroups: Any | None = ..., + functionGroups: Incomplete | None = ..., externalReferences=..., - definedNames: Any | None = ..., - calcPr: Any | None = ..., - oleSize: Any | None = ..., + definedNames: Incomplete | None = ..., + calcPr: Incomplete | None = ..., + oleSize: Incomplete | None = ..., customWorkbookViews=..., pivotCaches=..., - smartTagPr: Any | None = ..., - smartTagTypes: Any | None = ..., - webPublishing: Any | None = ..., - fileRecoveryPr: Any | None = ..., - webPublishObjects: Any | None = ..., - extLst: Any | None = ..., - Ignorable: Any | None = ..., + smartTagPr: Incomplete | None = ..., + smartTagTypes: Incomplete | None = ..., + webPublishing: Incomplete | None = ..., + fileRecoveryPr: Incomplete | None = ..., + webPublishObjects: Incomplete | None = ..., + extLst: Incomplete | None = ..., + Ignorable: Incomplete | None = ..., ) -> None: ... def to_tree(self): ... @property def active(self): ... - @property - def pivot_caches(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/pivot/cache.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/pivot/cache.pyi index 080c29e57..3c4906403 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/pivot/cache.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/pivot/cache.pyi @@ -1,572 +1,585 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class MeasureDimensionMap(Serialisable): tagname: str - measureGroup: Any - dimension: Any - def __init__(self, measureGroup: Any | None = ..., dimension: Any | None = ...) -> None: ... + measureGroup: Incomplete + dimension: Incomplete + def __init__(self, measureGroup: Incomplete | None = ..., dimension: Incomplete | None = ...) -> None: ... class MeasureGroup(Serialisable): tagname: str - name: Any - caption: Any - def __init__(self, name: Any | None = ..., caption: Any | None = ...) -> None: ... + name: Incomplete + caption: Incomplete + def __init__(self, name: Incomplete | None = ..., caption: Incomplete | None = ...) -> None: ... class PivotDimension(Serialisable): tagname: str - measure: Any - name: Any - uniqueName: Any - caption: Any + measure: Incomplete + name: Incomplete + uniqueName: Incomplete + caption: Incomplete def __init__( - self, measure: Any | None = ..., name: Any | None = ..., uniqueName: Any | None = ..., caption: Any | None = ... + self, + measure: Incomplete | None = ..., + name: Incomplete | None = ..., + uniqueName: Incomplete | None = ..., + caption: Incomplete | None = ..., ) -> None: ... class CalculatedMember(Serialisable): tagname: str - name: Any - mdx: Any - memberName: Any - hierarchy: Any - parent: Any - solveOrder: Any - set: Any - extLst: Any - __elements__: Any + name: Incomplete + mdx: Incomplete + memberName: Incomplete + hierarchy: Incomplete + parent: Incomplete + solveOrder: Incomplete + set: Incomplete + extLst: Incomplete + __elements__: Incomplete def __init__( self, - name: Any | None = ..., - mdx: Any | None = ..., - memberName: Any | None = ..., - hierarchy: Any | None = ..., - parent: Any | None = ..., - solveOrder: Any | None = ..., - set: Any | None = ..., - extLst: Any | None = ..., + name: Incomplete | None = ..., + mdx: Incomplete | None = ..., + memberName: Incomplete | None = ..., + hierarchy: Incomplete | None = ..., + parent: Incomplete | None = ..., + solveOrder: Incomplete | None = ..., + set: Incomplete | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... class CalculatedItem(Serialisable): tagname: str - field: Any - formula: Any - pivotArea: Any - extLst: Any - __elements__: Any + field: Incomplete + formula: Incomplete + pivotArea: Incomplete + extLst: Incomplete + __elements__: Incomplete def __init__( - self, field: Any | None = ..., formula: Any | None = ..., pivotArea: Any | None = ..., extLst: Any | None = ... + self, + field: Incomplete | None = ..., + formula: Incomplete | None = ..., + pivotArea: Incomplete | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... class ServerFormat(Serialisable): tagname: str - culture: Any - format: Any - def __init__(self, culture: Any | None = ..., format: Any | None = ...) -> None: ... + culture: Incomplete + format: Incomplete + def __init__(self, culture: Incomplete | None = ..., format: Incomplete | None = ...) -> None: ... class ServerFormatList(Serialisable): tagname: str - serverFormat: Any - __elements__: Any - __attrs__: Any - def __init__(self, count: Any | None = ..., serverFormat: Any | None = ...) -> None: ... + serverFormat: Incomplete + __elements__: Incomplete + __attrs__: Incomplete + def __init__(self, count: Incomplete | None = ..., serverFormat: Incomplete | None = ...) -> None: ... @property def count(self): ... class Query(Serialisable): tagname: str - mdx: Any - tpls: Any - __elements__: Any - def __init__(self, mdx: Any | None = ..., tpls: Any | None = ...) -> None: ... + mdx: Incomplete + tpls: Incomplete + __elements__: Incomplete + def __init__(self, mdx: Incomplete | None = ..., tpls: Incomplete | None = ...) -> None: ... class QueryCache(Serialisable): tagname: str - count: Any - query: Any - __elements__: Any - def __init__(self, count: Any | None = ..., query: Any | None = ...) -> None: ... + count: Incomplete + query: Incomplete + __elements__: Incomplete + def __init__(self, count: Incomplete | None = ..., query: Incomplete | None = ...) -> None: ... class OLAPSet(Serialisable): tagname: str - count: Any - maxRank: Any - setDefinition: Any - sortType: Any - queryFailed: Any - tpls: Any - sortByTuple: Any - __elements__: Any + count: Incomplete + maxRank: Incomplete + setDefinition: Incomplete + sortType: Incomplete + queryFailed: Incomplete + tpls: Incomplete + sortByTuple: Incomplete + __elements__: Incomplete def __init__( self, - count: Any | None = ..., - maxRank: Any | None = ..., - setDefinition: Any | None = ..., - sortType: Any | None = ..., - queryFailed: Any | None = ..., - tpls: Any | None = ..., - sortByTuple: Any | None = ..., + count: Incomplete | None = ..., + maxRank: Incomplete | None = ..., + setDefinition: Incomplete | None = ..., + sortType: Incomplete | None = ..., + queryFailed: Incomplete | None = ..., + tpls: Incomplete | None = ..., + sortByTuple: Incomplete | None = ..., ) -> None: ... class OLAPSets(Serialisable): # type: ignore[misc] - count: Any - set: Any - __elements__: Any - def __init__(self, count: Any | None = ..., set: Any | None = ...) -> None: ... + count: Incomplete + set: Incomplete + __elements__: Incomplete + def __init__(self, count: Incomplete | None = ..., set: Incomplete | None = ...) -> None: ... class PCDSDTCEntries(Serialisable): tagname: str - count: Any - m: Any - n: Any - e: Any - s: Any - __elements__: Any + count: Incomplete + m: Incomplete + n: Incomplete + e: Incomplete + s: Incomplete + __elements__: Incomplete def __init__( - self, count: Any | None = ..., m: Any | None = ..., n: Any | None = ..., e: Any | None = ..., s: Any | None = ... + self, + count: Incomplete | None = ..., + m: Incomplete | None = ..., + n: Incomplete | None = ..., + e: Incomplete | None = ..., + s: Incomplete | None = ..., ) -> None: ... class TupleCache(Serialisable): tagname: str - entries: Any - sets: Any - queryCache: Any - serverFormats: Any - extLst: Any - __elements__: Any + entries: Incomplete + sets: Incomplete + queryCache: Incomplete + serverFormats: Incomplete + extLst: Incomplete + __elements__: Incomplete def __init__( self, - entries: Any | None = ..., - sets: Any | None = ..., - queryCache: Any | None = ..., - serverFormats: Any | None = ..., - extLst: Any | None = ..., + entries: Incomplete | None = ..., + sets: Incomplete | None = ..., + queryCache: Incomplete | None = ..., + serverFormats: Incomplete | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... class PCDKPI(Serialisable): tagname: str - uniqueName: Any - caption: Any - displayFolder: Any - measureGroup: Any - parent: Any - value: Any - goal: Any - status: Any - trend: Any - weight: Any - time: Any + uniqueName: Incomplete + caption: Incomplete + displayFolder: Incomplete + measureGroup: Incomplete + parent: Incomplete + value: Incomplete + goal: Incomplete + status: Incomplete + trend: Incomplete + weight: Incomplete + time: Incomplete def __init__( self, - uniqueName: Any | None = ..., - caption: Any | None = ..., - displayFolder: Any | None = ..., - measureGroup: Any | None = ..., - parent: Any | None = ..., - value: Any | None = ..., - goal: Any | None = ..., - status: Any | None = ..., - trend: Any | None = ..., - weight: Any | None = ..., - time: Any | None = ..., + uniqueName: Incomplete | None = ..., + caption: Incomplete | None = ..., + displayFolder: Incomplete | None = ..., + measureGroup: Incomplete | None = ..., + parent: Incomplete | None = ..., + value: Incomplete | None = ..., + goal: Incomplete | None = ..., + status: Incomplete | None = ..., + trend: Incomplete | None = ..., + weight: Incomplete | None = ..., + time: Incomplete | None = ..., ) -> None: ... class GroupMember(Serialisable): tagname: str - uniqueName: Any - group: Any - def __init__(self, uniqueName: Any | None = ..., group: Any | None = ...) -> None: ... + uniqueName: Incomplete + group: Incomplete + def __init__(self, uniqueName: Incomplete | None = ..., group: Incomplete | None = ...) -> None: ... class GroupMembers(Serialisable): # type: ignore[misc] - count: Any - groupMember: Any - __elements__: Any - def __init__(self, count: Any | None = ..., groupMember: Any | None = ...) -> None: ... + count: Incomplete + groupMember: Incomplete + __elements__: Incomplete + def __init__(self, count: Incomplete | None = ..., groupMember: Incomplete | None = ...) -> None: ... class LevelGroup(Serialisable): tagname: str - name: Any - uniqueName: Any - caption: Any - uniqueParent: Any - id: Any - groupMembers: Any - __elements__: Any + name: Incomplete + uniqueName: Incomplete + caption: Incomplete + uniqueParent: Incomplete + id: Incomplete + groupMembers: Incomplete + __elements__: Incomplete def __init__( self, - name: Any | None = ..., - uniqueName: Any | None = ..., - caption: Any | None = ..., - uniqueParent: Any | None = ..., - id: Any | None = ..., - groupMembers: Any | None = ..., + name: Incomplete | None = ..., + uniqueName: Incomplete | None = ..., + caption: Incomplete | None = ..., + uniqueParent: Incomplete | None = ..., + id: Incomplete | None = ..., + groupMembers: Incomplete | None = ..., ) -> None: ... class Groups(Serialisable): tagname: str - count: Any - group: Any - __elements__: Any - def __init__(self, count: Any | None = ..., group: Any | None = ...) -> None: ... + count: Incomplete + group: Incomplete + __elements__: Incomplete + def __init__(self, count: Incomplete | None = ..., group: Incomplete | None = ...) -> None: ... class GroupLevel(Serialisable): tagname: str - uniqueName: Any - caption: Any - user: Any - customRollUp: Any - groups: Any - extLst: Any - __elements__: Any + uniqueName: Incomplete + caption: Incomplete + user: Incomplete + customRollUp: Incomplete + groups: Incomplete + extLst: Incomplete + __elements__: Incomplete def __init__( self, - uniqueName: Any | None = ..., - caption: Any | None = ..., - user: Any | None = ..., - customRollUp: Any | None = ..., - groups: Any | None = ..., - extLst: Any | None = ..., + uniqueName: Incomplete | None = ..., + caption: Incomplete | None = ..., + user: Incomplete | None = ..., + customRollUp: Incomplete | None = ..., + groups: Incomplete | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... class GroupLevels(Serialisable): # type: ignore[misc] - count: Any - groupLevel: Any - __elements__: Any - def __init__(self, count: Any | None = ..., groupLevel: Any | None = ...) -> None: ... + count: Incomplete + groupLevel: Incomplete + __elements__: Incomplete + def __init__(self, count: Incomplete | None = ..., groupLevel: Incomplete | None = ...) -> None: ... class FieldUsage(Serialisable): tagname: str - x: Any - def __init__(self, x: Any | None = ...) -> None: ... + x: Incomplete + def __init__(self, x: Incomplete | None = ...) -> None: ... class FieldsUsage(Serialisable): # type: ignore[misc] - count: Any - fieldUsage: Any - __elements__: Any - def __init__(self, count: Any | None = ..., fieldUsage: Any | None = ...) -> None: ... + count: Incomplete + fieldUsage: Incomplete + __elements__: Incomplete + def __init__(self, count: Incomplete | None = ..., fieldUsage: Incomplete | None = ...) -> None: ... class CacheHierarchy(Serialisable): tagname: str - uniqueName: Any - caption: Any - measure: Any - set: Any - parentSet: Any - iconSet: Any - attribute: Any - time: Any - keyAttribute: Any - defaultMemberUniqueName: Any - allUniqueName: Any - allCaption: Any - dimensionUniqueName: Any - displayFolder: Any - measureGroup: Any - measures: Any - count: Any - oneField: Any - memberValueDatatype: Any - unbalanced: Any - unbalancedGroup: Any - hidden: Any - fieldsUsage: Any - groupLevels: Any - extLst: Any - __elements__: Any + uniqueName: Incomplete + caption: Incomplete + measure: Incomplete + set: Incomplete + parentSet: Incomplete + iconSet: Incomplete + attribute: Incomplete + time: Incomplete + keyAttribute: Incomplete + defaultMemberUniqueName: Incomplete + allUniqueName: Incomplete + allCaption: Incomplete + dimensionUniqueName: Incomplete + displayFolder: Incomplete + measureGroup: Incomplete + measures: Incomplete + count: Incomplete + oneField: Incomplete + memberValueDatatype: Incomplete + unbalanced: Incomplete + unbalancedGroup: Incomplete + hidden: Incomplete + fieldsUsage: Incomplete + groupLevels: Incomplete + extLst: Incomplete + __elements__: Incomplete def __init__( self, uniqueName: str = ..., - caption: Any | None = ..., - measure: Any | None = ..., - set: Any | None = ..., - parentSet: Any | None = ..., + caption: Incomplete | None = ..., + measure: Incomplete | None = ..., + set: Incomplete | None = ..., + parentSet: Incomplete | None = ..., iconSet: int = ..., - attribute: Any | None = ..., - time: Any | None = ..., - keyAttribute: Any | None = ..., - defaultMemberUniqueName: Any | None = ..., - allUniqueName: Any | None = ..., - allCaption: Any | None = ..., - dimensionUniqueName: Any | None = ..., - displayFolder: Any | None = ..., - measureGroup: Any | None = ..., - measures: Any | None = ..., - count: Any | None = ..., - oneField: Any | None = ..., - memberValueDatatype: Any | None = ..., - unbalanced: Any | None = ..., - unbalancedGroup: Any | None = ..., - hidden: Any | None = ..., - fieldsUsage: Any | None = ..., - groupLevels: Any | None = ..., - extLst: Any | None = ..., + attribute: Incomplete | None = ..., + time: Incomplete | None = ..., + keyAttribute: Incomplete | None = ..., + defaultMemberUniqueName: Incomplete | None = ..., + allUniqueName: Incomplete | None = ..., + allCaption: Incomplete | None = ..., + dimensionUniqueName: Incomplete | None = ..., + displayFolder: Incomplete | None = ..., + measureGroup: Incomplete | None = ..., + measures: Incomplete | None = ..., + count: Incomplete | None = ..., + oneField: Incomplete | None = ..., + memberValueDatatype: Incomplete | None = ..., + unbalanced: Incomplete | None = ..., + unbalancedGroup: Incomplete | None = ..., + hidden: Incomplete | None = ..., + fieldsUsage: Incomplete | None = ..., + groupLevels: Incomplete | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... class GroupItems(Serialisable): tagname: str - m: Any - n: Any - b: Any - e: Any - s: Any - d: Any - __elements__: Any - __attrs__: Any - def __init__(self, count: Any | None = ..., m=..., n=..., b=..., e=..., s=..., d=...) -> None: ... + m: Incomplete + n: Incomplete + b: Incomplete + e: Incomplete + s: Incomplete + d: Incomplete + __elements__: Incomplete + __attrs__: Incomplete + def __init__(self, count: Incomplete | None = ..., m=..., n=..., b=..., e=..., s=..., d=...) -> None: ... @property def count(self): ... class DiscretePr(Serialisable): tagname: str - count: Any - x: Any - __elements__: Any - def __init__(self, count: Any | None = ..., x: Any | None = ...) -> None: ... + count: Incomplete + x: Incomplete + __elements__: Incomplete + def __init__(self, count: Incomplete | None = ..., x: Incomplete | None = ...) -> None: ... class RangePr(Serialisable): tagname: str - autoStart: Any - autoEnd: Any - groupBy: Any - startNum: Any - endNum: Any - startDate: Any - endDate: Any - groupInterval: Any + autoStart: Incomplete + autoEnd: Incomplete + groupBy: Incomplete + startNum: Incomplete + endNum: Incomplete + startDate: Incomplete + endDate: Incomplete + groupInterval: Incomplete def __init__( self, autoStart: bool = ..., autoEnd: bool = ..., groupBy: str = ..., - startNum: Any | None = ..., - endNum: Any | None = ..., - startDate: Any | None = ..., - endDate: Any | None = ..., + startNum: Incomplete | None = ..., + endNum: Incomplete | None = ..., + startDate: Incomplete | None = ..., + endDate: Incomplete | None = ..., groupInterval: int = ..., ) -> None: ... class FieldGroup(Serialisable): tagname: str - par: Any - base: Any - rangePr: Any - discretePr: Any - groupItems: Any - __elements__: Any + par: Incomplete + base: Incomplete + rangePr: Incomplete + discretePr: Incomplete + groupItems: Incomplete + __elements__: Incomplete def __init__( self, - par: Any | None = ..., - base: Any | None = ..., - rangePr: Any | None = ..., - discretePr: Any | None = ..., - groupItems: Any | None = ..., + par: Incomplete | None = ..., + base: Incomplete | None = ..., + rangePr: Incomplete | None = ..., + discretePr: Incomplete | None = ..., + groupItems: Incomplete | None = ..., ) -> None: ... class SharedItems(Serialisable): tagname: str - m: Any - n: Any - b: Any - e: Any - s: Any - d: Any - containsSemiMixedTypes: Any - containsNonDate: Any - containsDate: Any - containsString: Any - containsBlank: Any - containsMixedTypes: Any - containsNumber: Any - containsInteger: Any - minValue: Any - maxValue: Any - minDate: Any - maxDate: Any - longText: Any - __attrs__: Any + m: Incomplete + n: Incomplete + b: Incomplete + e: Incomplete + s: Incomplete + d: Incomplete + containsSemiMixedTypes: Incomplete + containsNonDate: Incomplete + containsDate: Incomplete + containsString: Incomplete + containsBlank: Incomplete + containsMixedTypes: Incomplete + containsNumber: Incomplete + containsInteger: Incomplete + minValue: Incomplete + maxValue: Incomplete + minDate: Incomplete + maxDate: Incomplete + longText: Incomplete + __attrs__: Incomplete def __init__( self, _fields=..., - containsSemiMixedTypes: Any | None = ..., - containsNonDate: Any | None = ..., - containsDate: Any | None = ..., - containsString: Any | None = ..., - containsBlank: Any | None = ..., - containsMixedTypes: Any | None = ..., - containsNumber: Any | None = ..., - containsInteger: Any | None = ..., - minValue: Any | None = ..., - maxValue: Any | None = ..., - minDate: Any | None = ..., - maxDate: Any | None = ..., - count: Any | None = ..., - longText: Any | None = ..., + containsSemiMixedTypes: Incomplete | None = ..., + containsNonDate: Incomplete | None = ..., + containsDate: Incomplete | None = ..., + containsString: Incomplete | None = ..., + containsBlank: Incomplete | None = ..., + containsMixedTypes: Incomplete | None = ..., + containsNumber: Incomplete | None = ..., + containsInteger: Incomplete | None = ..., + minValue: Incomplete | None = ..., + maxValue: Incomplete | None = ..., + minDate: Incomplete | None = ..., + maxDate: Incomplete | None = ..., + count: Incomplete | None = ..., + longText: Incomplete | None = ..., ) -> None: ... @property def count(self): ... class CacheField(Serialisable): tagname: str - sharedItems: Any - fieldGroup: Any - mpMap: Any - extLst: Any - name: Any - caption: Any - propertyName: Any - serverField: Any - uniqueList: Any - numFmtId: Any - formula: Any - sqlType: Any - hierarchy: Any - level: Any - databaseField: Any - mappingCount: Any - memberPropertyField: Any - __elements__: Any + sharedItems: Incomplete + fieldGroup: Incomplete + mpMap: Incomplete + extLst: Incomplete + name: Incomplete + caption: Incomplete + propertyName: Incomplete + serverField: Incomplete + uniqueList: Incomplete + numFmtId: Incomplete + formula: Incomplete + sqlType: Incomplete + hierarchy: Incomplete + level: Incomplete + databaseField: Incomplete + mappingCount: Incomplete + memberPropertyField: Incomplete + __elements__: Incomplete def __init__( self, - sharedItems: Any | None = ..., - fieldGroup: Any | None = ..., - mpMap: Any | None = ..., - extLst: Any | None = ..., - name: Any | None = ..., - caption: Any | None = ..., - propertyName: Any | None = ..., - serverField: Any | None = ..., + sharedItems: Incomplete | None = ..., + fieldGroup: Incomplete | None = ..., + mpMap: Incomplete | None = ..., + extLst: Incomplete | None = ..., + name: Incomplete | None = ..., + caption: Incomplete | None = ..., + propertyName: Incomplete | None = ..., + serverField: Incomplete | None = ..., uniqueList: bool = ..., - numFmtId: Any | None = ..., - formula: Any | None = ..., + numFmtId: Incomplete | None = ..., + formula: Incomplete | None = ..., sqlType: int = ..., hierarchy: int = ..., level: int = ..., databaseField: bool = ..., - mappingCount: Any | None = ..., - memberPropertyField: Any | None = ..., + mappingCount: Incomplete | None = ..., + memberPropertyField: Incomplete | None = ..., ) -> None: ... class RangeSet(Serialisable): tagname: str - i1: Any - i2: Any - i3: Any - i4: Any - ref: Any - name: Any - sheet: Any + i1: Incomplete + i2: Incomplete + i3: Incomplete + i4: Incomplete + ref: Incomplete + name: Incomplete + sheet: Incomplete def __init__( self, - i1: Any | None = ..., - i2: Any | None = ..., - i3: Any | None = ..., - i4: Any | None = ..., - ref: Any | None = ..., - name: Any | None = ..., - sheet: Any | None = ..., + i1: Incomplete | None = ..., + i2: Incomplete | None = ..., + i3: Incomplete | None = ..., + i4: Incomplete | None = ..., + ref: Incomplete | None = ..., + name: Incomplete | None = ..., + sheet: Incomplete | None = ..., ) -> None: ... class PageItem(Serialisable): tagname: str - name: Any - def __init__(self, name: Any | None = ...) -> None: ... + name: Incomplete + def __init__(self, name: Incomplete | None = ...) -> None: ... class Page(Serialisable): tagname: str - pageItem: Any - __elements__: Any - def __init__(self, count: Any | None = ..., pageItem: Any | None = ...) -> None: ... + pageItem: Incomplete + __elements__: Incomplete + def __init__(self, count: Incomplete | None = ..., pageItem: Incomplete | None = ...) -> None: ... @property def count(self): ... class Consolidation(Serialisable): tagname: str - autoPage: Any - pages: Any - rangeSets: Any - __elements__: Any - def __init__(self, autoPage: Any | None = ..., pages=..., rangeSets=...) -> None: ... + autoPage: Incomplete + pages: Incomplete + rangeSets: Incomplete + __elements__: Incomplete + def __init__(self, autoPage: Incomplete | None = ..., pages=..., rangeSets=...) -> None: ... class WorksheetSource(Serialisable): tagname: str - ref: Any - name: Any - sheet: Any - def __init__(self, ref: Any | None = ..., name: Any | None = ..., sheet: Any | None = ...) -> None: ... + ref: Incomplete + name: Incomplete + sheet: Incomplete + def __init__(self, ref: Incomplete | None = ..., name: Incomplete | None = ..., sheet: Incomplete | None = ...) -> None: ... class CacheSource(Serialisable): tagname: str - type: Any - connectionId: Any - worksheetSource: Any - consolidation: Any - extLst: Any - __elements__: Any + type: Incomplete + connectionId: Incomplete + worksheetSource: Incomplete + consolidation: Incomplete + extLst: Incomplete + __elements__: Incomplete def __init__( self, - type: Any | None = ..., - connectionId: Any | None = ..., - worksheetSource: Any | None = ..., - consolidation: Any | None = ..., - extLst: Any | None = ..., + type: Incomplete | None = ..., + connectionId: Incomplete | None = ..., + worksheetSource: Incomplete | None = ..., + consolidation: Incomplete | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... class CacheDefinition(Serialisable): mime_type: str rel_type: str - records: Any - tagname: str - invalid: Any - saveData: Any - refreshOnLoad: Any - optimizeMemory: Any - enableRefresh: Any - refreshedBy: Any - refreshedDate: Any - refreshedDateIso: Any - backgroundQuery: Any - missingItemsLimit: Any - createdVersion: Any - refreshedVersion: Any - minRefreshableVersion: Any - recordCount: Any - upgradeOnRefresh: Any - tupleCache: Any - supportSubquery: Any - supportAdvancedDrill: Any - cacheSource: Any - cacheFields: Any - cacheHierarchies: Any - kpis: Any - calculatedItems: Any - calculatedMembers: Any - dimensions: Any - measureGroups: Any - maps: Any - extLst: Any - id: Any - __elements__: Any + records: Incomplete + tagname: str + invalid: Incomplete + saveData: Incomplete + refreshOnLoad: Incomplete + optimizeMemory: Incomplete + enableRefresh: Incomplete + refreshedBy: Incomplete + refreshedDate: Incomplete + refreshedDateIso: Incomplete + backgroundQuery: Incomplete + missingItemsLimit: Incomplete + createdVersion: Incomplete + refreshedVersion: Incomplete + minRefreshableVersion: Incomplete + recordCount: Incomplete + upgradeOnRefresh: Incomplete + tupleCache: Incomplete + supportSubquery: Incomplete + supportAdvancedDrill: Incomplete + cacheSource: Incomplete + cacheFields: Incomplete + cacheHierarchies: Incomplete + kpis: Incomplete + calculatedItems: Incomplete + calculatedMembers: Incomplete + dimensions: Incomplete + measureGroups: Incomplete + maps: Incomplete + extLst: Incomplete + id: Incomplete + __elements__: Incomplete def __init__( self, - invalid: Any | None = ..., - saveData: Any | None = ..., - refreshOnLoad: Any | None = ..., - optimizeMemory: Any | None = ..., - enableRefresh: Any | None = ..., - refreshedBy: Any | None = ..., - refreshedDate: Any | None = ..., - refreshedDateIso: Any | None = ..., - backgroundQuery: Any | None = ..., - missingItemsLimit: Any | None = ..., - createdVersion: Any | None = ..., - refreshedVersion: Any | None = ..., - minRefreshableVersion: Any | None = ..., - recordCount: Any | None = ..., - upgradeOnRefresh: Any | None = ..., - tupleCache: Any | None = ..., - supportSubquery: Any | None = ..., - supportAdvancedDrill: Any | None = ..., - cacheSource: Any | None = ..., + invalid: Incomplete | None = ..., + saveData: Incomplete | None = ..., + refreshOnLoad: Incomplete | None = ..., + optimizeMemory: Incomplete | None = ..., + enableRefresh: Incomplete | None = ..., + refreshedBy: Incomplete | None = ..., + refreshedDate: Incomplete | None = ..., + refreshedDateIso: Incomplete | None = ..., + backgroundQuery: Incomplete | None = ..., + missingItemsLimit: Incomplete | None = ..., + createdVersion: Incomplete | None = ..., + refreshedVersion: Incomplete | None = ..., + minRefreshableVersion: Incomplete | None = ..., + recordCount: Incomplete | None = ..., + upgradeOnRefresh: Incomplete | None = ..., + tupleCache: Incomplete | None = ..., + supportSubquery: Incomplete | None = ..., + supportAdvancedDrill: Incomplete | None = ..., + cacheSource: Incomplete | None = ..., cacheFields=..., cacheHierarchies=..., kpis=..., @@ -575,8 +588,8 @@ class CacheDefinition(Serialisable): dimensions=..., measureGroups=..., maps=..., - extLst: Any | None = ..., - id: Any | None = ..., + extLst: Incomplete | None = ..., + id: Incomplete | None = ..., ) -> None: ... def to_tree(self): ... @property diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/pivot/fields.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/pivot/fields.pyi index a2e29fce0..b3eb3158a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/pivot/fields.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/pivot/fields.pyi @@ -1,180 +1,192 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class Index(Serialisable): tagname: str - v: Any + v: Incomplete def __init__(self, v: int = ...) -> None: ... class Tuple(Serialisable): # type: ignore[misc] - fld: Any - hier: Any - item: Any - def __init__(self, fld: Any | None = ..., hier: Any | None = ..., item: Any | None = ...) -> None: ... + fld: Incomplete + hier: Incomplete + item: Incomplete + def __init__(self, fld: Incomplete | None = ..., hier: Incomplete | None = ..., item: Incomplete | None = ...) -> None: ... class TupleList(Serialisable): # type: ignore[misc] - c: Any - tpl: Any - __elements__: Any - def __init__(self, c: Any | None = ..., tpl: Any | None = ...) -> None: ... + c: Incomplete + tpl: Incomplete + __elements__: Incomplete + def __init__(self, c: Incomplete | None = ..., tpl: Incomplete | None = ...) -> None: ... class Missing(Serialisable): tagname: str - tpls: Any - x: Any - u: Any - f: Any - c: Any - cp: Any - bc: Any - fc: Any - i: Any - un: Any - st: Any - b: Any - __elements__: Any + tpls: Incomplete + x: Incomplete + u: Incomplete + f: Incomplete + c: Incomplete + cp: Incomplete + bc: Incomplete + fc: Incomplete + i: Incomplete + un: Incomplete + st: Incomplete + b: Incomplete + __elements__: Incomplete def __init__( self, tpls=..., x=..., - u: Any | None = ..., - f: Any | None = ..., - c: Any | None = ..., - cp: Any | None = ..., - _in: Any | None = ..., - bc: Any | None = ..., - fc: Any | None = ..., - i: Any | None = ..., - un: Any | None = ..., - st: Any | None = ..., - b: Any | None = ..., + u: Incomplete | None = ..., + f: Incomplete | None = ..., + c: Incomplete | None = ..., + cp: Incomplete | None = ..., + _in: Incomplete | None = ..., + bc: Incomplete | None = ..., + fc: Incomplete | None = ..., + i: Incomplete | None = ..., + un: Incomplete | None = ..., + st: Incomplete | None = ..., + b: Incomplete | None = ..., ) -> None: ... class Number(Serialisable): tagname: str - tpls: Any - x: Any - v: Any - u: Any - f: Any - c: Any - cp: Any - bc: Any - fc: Any - i: Any - un: Any - st: Any - b: Any - __elements__: Any + tpls: Incomplete + x: Incomplete + v: Incomplete + u: Incomplete + f: Incomplete + c: Incomplete + cp: Incomplete + bc: Incomplete + fc: Incomplete + i: Incomplete + un: Incomplete + st: Incomplete + b: Incomplete + __elements__: Incomplete def __init__( self, tpls=..., x=..., - v: Any | None = ..., - u: Any | None = ..., - f: Any | None = ..., - c: Any | None = ..., - cp: Any | None = ..., - _in: Any | None = ..., - bc: Any | None = ..., - fc: Any | None = ..., - i: Any | None = ..., - un: Any | None = ..., - st: Any | None = ..., - b: Any | None = ..., + v: Incomplete | None = ..., + u: Incomplete | None = ..., + f: Incomplete | None = ..., + c: Incomplete | None = ..., + cp: Incomplete | None = ..., + _in: Incomplete | None = ..., + bc: Incomplete | None = ..., + fc: Incomplete | None = ..., + i: Incomplete | None = ..., + un: Incomplete | None = ..., + st: Incomplete | None = ..., + b: Incomplete | None = ..., ) -> None: ... class Error(Serialisable): tagname: str - tpls: Any - x: Any - v: Any - u: Any - f: Any - c: Any - cp: Any - bc: Any - fc: Any - i: Any - un: Any - st: Any - b: Any - __elements__: Any + tpls: Incomplete + x: Incomplete + v: Incomplete + u: Incomplete + f: Incomplete + c: Incomplete + cp: Incomplete + bc: Incomplete + fc: Incomplete + i: Incomplete + un: Incomplete + st: Incomplete + b: Incomplete + __elements__: Incomplete def __init__( self, - tpls: Any | None = ..., + tpls: Incomplete | None = ..., x=..., - v: Any | None = ..., - u: Any | None = ..., - f: Any | None = ..., - c: Any | None = ..., - cp: Any | None = ..., - _in: Any | None = ..., - bc: Any | None = ..., - fc: Any | None = ..., - i: Any | None = ..., - un: Any | None = ..., - st: Any | None = ..., - b: Any | None = ..., + v: Incomplete | None = ..., + u: Incomplete | None = ..., + f: Incomplete | None = ..., + c: Incomplete | None = ..., + cp: Incomplete | None = ..., + _in: Incomplete | None = ..., + bc: Incomplete | None = ..., + fc: Incomplete | None = ..., + i: Incomplete | None = ..., + un: Incomplete | None = ..., + st: Incomplete | None = ..., + b: Incomplete | None = ..., ) -> None: ... class Boolean(Serialisable): tagname: str - x: Any - v: Any - u: Any - f: Any - c: Any - cp: Any - __elements__: Any + x: Incomplete + v: Incomplete + u: Incomplete + f: Incomplete + c: Incomplete + cp: Incomplete + __elements__: Incomplete def __init__( - self, x=..., v: Any | None = ..., u: Any | None = ..., f: Any | None = ..., c: Any | None = ..., cp: Any | None = ... + self, + x=..., + v: Incomplete | None = ..., + u: Incomplete | None = ..., + f: Incomplete | None = ..., + c: Incomplete | None = ..., + cp: Incomplete | None = ..., ) -> None: ... class Text(Serialisable): tagname: str - tpls: Any - x: Any - v: Any - u: Any - f: Any - c: Any - cp: Any - bc: Any - fc: Any - i: Any - un: Any - st: Any - b: Any - __elements__: Any + tpls: Incomplete + x: Incomplete + v: Incomplete + u: Incomplete + f: Incomplete + c: Incomplete + cp: Incomplete + bc: Incomplete + fc: Incomplete + i: Incomplete + un: Incomplete + st: Incomplete + b: Incomplete + __elements__: Incomplete def __init__( self, tpls=..., x=..., - v: Any | None = ..., - u: Any | None = ..., - f: Any | None = ..., - c: Any | None = ..., - cp: Any | None = ..., - _in: Any | None = ..., - bc: Any | None = ..., - fc: Any | None = ..., - i: Any | None = ..., - un: Any | None = ..., - st: Any | None = ..., - b: Any | None = ..., + v: Incomplete | None = ..., + u: Incomplete | None = ..., + f: Incomplete | None = ..., + c: Incomplete | None = ..., + cp: Incomplete | None = ..., + _in: Incomplete | None = ..., + bc: Incomplete | None = ..., + fc: Incomplete | None = ..., + i: Incomplete | None = ..., + un: Incomplete | None = ..., + st: Incomplete | None = ..., + b: Incomplete | None = ..., ) -> None: ... class DateTimeField(Serialisable): tagname: str - x: Any - v: Any - u: Any - f: Any - c: Any - cp: Any - __elements__: Any + x: Incomplete + v: Incomplete + u: Incomplete + f: Incomplete + c: Incomplete + cp: Incomplete + __elements__: Incomplete def __init__( - self, x=..., v: Any | None = ..., u: Any | None = ..., f: Any | None = ..., c: Any | None = ..., cp: Any | None = ... + self, + x=..., + v: Incomplete | None = ..., + u: Incomplete | None = ..., + f: Incomplete | None = ..., + c: Incomplete | None = ..., + cp: Incomplete | None = ..., ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/pivot/record.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/pivot/record.pyi index a10544cef..3406068bd 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/pivot/record.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/pivot/record.pyi @@ -1,37 +1,37 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class Record(Serialisable): tagname: str - m: Any - n: Any - b: Any - e: Any - s: Any - d: Any - x: Any + m: Incomplete + n: Incomplete + b: Incomplete + e: Incomplete + s: Incomplete + d: Incomplete + x: Incomplete def __init__( self, _fields=..., - m: Any | None = ..., - n: Any | None = ..., - b: Any | None = ..., - e: Any | None = ..., - s: Any | None = ..., - d: Any | None = ..., - x: Any | None = ..., + m: Incomplete | None = ..., + n: Incomplete | None = ..., + b: Incomplete | None = ..., + e: Incomplete | None = ..., + s: Incomplete | None = ..., + d: Incomplete | None = ..., + x: Incomplete | None = ..., ) -> None: ... class RecordList(Serialisable): mime_type: str rel_type: str tagname: str - r: Any - extLst: Any - __elements__: Any - __attrs__: Any - def __init__(self, count: Any | None = ..., r=..., extLst: Any | None = ...) -> None: ... + r: Incomplete + extLst: Incomplete + __elements__: Incomplete + __attrs__: Incomplete + def __init__(self, count: Incomplete | None = ..., r=..., extLst: Incomplete | None = ...) -> None: ... @property def count(self): ... def to_tree(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/pivot/table.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/pivot/table.pyi index 93d313c10..16a7b289b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/pivot/table.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/pivot/table.pyi @@ -1,599 +1,607 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class HierarchyUsage(Serialisable): tagname: str - hierarchyUsage: Any - def __init__(self, hierarchyUsage: Any | None = ...) -> None: ... + hierarchyUsage: Incomplete + def __init__(self, hierarchyUsage: Incomplete | None = ...) -> None: ... class ColHierarchiesUsage(Serialisable): tagname: str - colHierarchyUsage: Any - __elements__: Any - __attrs__: Any - def __init__(self, count: Any | None = ..., colHierarchyUsage=...) -> None: ... + colHierarchyUsage: Incomplete + __elements__: Incomplete + __attrs__: Incomplete + def __init__(self, count: Incomplete | None = ..., colHierarchyUsage=...) -> None: ... @property def count(self): ... class RowHierarchiesUsage(Serialisable): tagname: str - rowHierarchyUsage: Any - __elements__: Any - __attrs__: Any - def __init__(self, count: Any | None = ..., rowHierarchyUsage=...) -> None: ... + rowHierarchyUsage: Incomplete + __elements__: Incomplete + __attrs__: Incomplete + def __init__(self, count: Incomplete | None = ..., rowHierarchyUsage=...) -> None: ... @property def count(self): ... class PivotFilter(Serialisable): tagname: str - fld: Any - mpFld: Any - type: Any - evalOrder: Any - id: Any - iMeasureHier: Any - iMeasureFld: Any - name: Any - description: Any - stringValue1: Any - stringValue2: Any - autoFilter: Any - extLst: Any - __elements__: Any + fld: Incomplete + mpFld: Incomplete + type: Incomplete + evalOrder: Incomplete + id: Incomplete + iMeasureHier: Incomplete + iMeasureFld: Incomplete + name: Incomplete + description: Incomplete + stringValue1: Incomplete + stringValue2: Incomplete + autoFilter: Incomplete + extLst: Incomplete + __elements__: Incomplete def __init__( self, - fld: Any | None = ..., - mpFld: Any | None = ..., - type: Any | None = ..., - evalOrder: Any | None = ..., - id: Any | None = ..., - iMeasureHier: Any | None = ..., - iMeasureFld: Any | None = ..., - name: Any | None = ..., - description: Any | None = ..., - stringValue1: Any | None = ..., - stringValue2: Any | None = ..., - autoFilter: Any | None = ..., - extLst: Any | None = ..., + fld: Incomplete | None = ..., + mpFld: Incomplete | None = ..., + type: Incomplete | None = ..., + evalOrder: Incomplete | None = ..., + id: Incomplete | None = ..., + iMeasureHier: Incomplete | None = ..., + iMeasureFld: Incomplete | None = ..., + name: Incomplete | None = ..., + description: Incomplete | None = ..., + stringValue1: Incomplete | None = ..., + stringValue2: Incomplete | None = ..., + autoFilter: Incomplete | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... class PivotFilters(Serialisable): # type: ignore[misc] - count: Any - filter: Any - __elements__: Any - def __init__(self, count: Any | None = ..., filter: Any | None = ...) -> None: ... + count: Incomplete + filter: Incomplete + __elements__: Incomplete + def __init__(self, count: Incomplete | None = ..., filter: Incomplete | None = ...) -> None: ... class PivotTableStyle(Serialisable): tagname: str - name: Any - showRowHeaders: Any - showColHeaders: Any - showRowStripes: Any - showColStripes: Any - showLastColumn: Any + name: Incomplete + showRowHeaders: Incomplete + showColHeaders: Incomplete + showRowStripes: Incomplete + showColStripes: Incomplete + showLastColumn: Incomplete def __init__( self, - name: Any | None = ..., - showRowHeaders: Any | None = ..., - showColHeaders: Any | None = ..., - showRowStripes: Any | None = ..., - showColStripes: Any | None = ..., - showLastColumn: Any | None = ..., + name: Incomplete | None = ..., + showRowHeaders: Incomplete | None = ..., + showColHeaders: Incomplete | None = ..., + showRowStripes: Incomplete | None = ..., + showColStripes: Incomplete | None = ..., + showLastColumn: Incomplete | None = ..., ) -> None: ... class MemberList(Serialisable): tagname: str - level: Any - member: Any - __elements__: Any - def __init__(self, count: Any | None = ..., level: Any | None = ..., member=...) -> None: ... + level: Incomplete + member: Incomplete + __elements__: Incomplete + def __init__(self, count: Incomplete | None = ..., level: Incomplete | None = ..., member=...) -> None: ... @property def count(self): ... class MemberProperty(Serialisable): tagname: str - name: Any - showCell: Any - showTip: Any - showAsCaption: Any - nameLen: Any - pPos: Any - pLen: Any - level: Any - field: Any + name: Incomplete + showCell: Incomplete + showTip: Incomplete + showAsCaption: Incomplete + nameLen: Incomplete + pPos: Incomplete + pLen: Incomplete + level: Incomplete + field: Incomplete def __init__( self, - name: Any | None = ..., - showCell: Any | None = ..., - showTip: Any | None = ..., - showAsCaption: Any | None = ..., - nameLen: Any | None = ..., - pPos: Any | None = ..., - pLen: Any | None = ..., - level: Any | None = ..., - field: Any | None = ..., + name: Incomplete | None = ..., + showCell: Incomplete | None = ..., + showTip: Incomplete | None = ..., + showAsCaption: Incomplete | None = ..., + nameLen: Incomplete | None = ..., + pPos: Incomplete | None = ..., + pLen: Incomplete | None = ..., + level: Incomplete | None = ..., + field: Incomplete | None = ..., ) -> None: ... class PivotHierarchy(Serialisable): tagname: str - outline: Any - multipleItemSelectionAllowed: Any - subtotalTop: Any - showInFieldList: Any - dragToRow: Any - dragToCol: Any - dragToPage: Any - dragToData: Any - dragOff: Any - includeNewItemsInFilter: Any - caption: Any - mps: Any - members: Any - extLst: Any - __elements__: Any + outline: Incomplete + multipleItemSelectionAllowed: Incomplete + subtotalTop: Incomplete + showInFieldList: Incomplete + dragToRow: Incomplete + dragToCol: Incomplete + dragToPage: Incomplete + dragToData: Incomplete + dragOff: Incomplete + includeNewItemsInFilter: Incomplete + caption: Incomplete + mps: Incomplete + members: Incomplete + extLst: Incomplete + __elements__: Incomplete def __init__( self, - outline: Any | None = ..., - multipleItemSelectionAllowed: Any | None = ..., - subtotalTop: Any | None = ..., - showInFieldList: Any | None = ..., - dragToRow: Any | None = ..., - dragToCol: Any | None = ..., - dragToPage: Any | None = ..., - dragToData: Any | None = ..., - dragOff: Any | None = ..., - includeNewItemsInFilter: Any | None = ..., - caption: Any | None = ..., + outline: Incomplete | None = ..., + multipleItemSelectionAllowed: Incomplete | None = ..., + subtotalTop: Incomplete | None = ..., + showInFieldList: Incomplete | None = ..., + dragToRow: Incomplete | None = ..., + dragToCol: Incomplete | None = ..., + dragToPage: Incomplete | None = ..., + dragToData: Incomplete | None = ..., + dragOff: Incomplete | None = ..., + includeNewItemsInFilter: Incomplete | None = ..., + caption: Incomplete | None = ..., mps=..., - members: Any | None = ..., - extLst: Any | None = ..., + members: Incomplete | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... class Reference(Serialisable): tagname: str - field: Any - selected: Any - byPosition: Any - relative: Any - defaultSubtotal: Any - sumSubtotal: Any - countASubtotal: Any - avgSubtotal: Any - maxSubtotal: Any - minSubtotal: Any - productSubtotal: Any - countSubtotal: Any - stdDevSubtotal: Any - stdDevPSubtotal: Any - varSubtotal: Any - varPSubtotal: Any - x: Any - extLst: Any - __elements__: Any + field: Incomplete + selected: Incomplete + byPosition: Incomplete + relative: Incomplete + defaultSubtotal: Incomplete + sumSubtotal: Incomplete + countASubtotal: Incomplete + avgSubtotal: Incomplete + maxSubtotal: Incomplete + minSubtotal: Incomplete + productSubtotal: Incomplete + countSubtotal: Incomplete + stdDevSubtotal: Incomplete + stdDevPSubtotal: Incomplete + varSubtotal: Incomplete + varPSubtotal: Incomplete + x: Incomplete + extLst: Incomplete + __elements__: Incomplete def __init__( self, - field: Any | None = ..., - count: Any | None = ..., - selected: Any | None = ..., - byPosition: Any | None = ..., - relative: Any | None = ..., - defaultSubtotal: Any | None = ..., - sumSubtotal: Any | None = ..., - countASubtotal: Any | None = ..., - avgSubtotal: Any | None = ..., - maxSubtotal: Any | None = ..., - minSubtotal: Any | None = ..., - productSubtotal: Any | None = ..., - countSubtotal: Any | None = ..., - stdDevSubtotal: Any | None = ..., - stdDevPSubtotal: Any | None = ..., - varSubtotal: Any | None = ..., - varPSubtotal: Any | None = ..., - x: Any | None = ..., - extLst: Any | None = ..., + field: Incomplete | None = ..., + count: Incomplete | None = ..., + selected: Incomplete | None = ..., + byPosition: Incomplete | None = ..., + relative: Incomplete | None = ..., + defaultSubtotal: Incomplete | None = ..., + sumSubtotal: Incomplete | None = ..., + countASubtotal: Incomplete | None = ..., + avgSubtotal: Incomplete | None = ..., + maxSubtotal: Incomplete | None = ..., + minSubtotal: Incomplete | None = ..., + productSubtotal: Incomplete | None = ..., + countSubtotal: Incomplete | None = ..., + stdDevSubtotal: Incomplete | None = ..., + stdDevPSubtotal: Incomplete | None = ..., + varSubtotal: Incomplete | None = ..., + varPSubtotal: Incomplete | None = ..., + x: Incomplete | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... @property def count(self): ... class PivotArea(Serialisable): tagname: str - references: Any - extLst: Any - field: Any - type: Any - dataOnly: Any - labelOnly: Any - grandRow: Any - grandCol: Any - cacheIndex: Any - outline: Any - offset: Any - collapsedLevelsAreSubtotals: Any - axis: Any - fieldPosition: Any - __elements__: Any + references: Incomplete + extLst: Incomplete + field: Incomplete + type: Incomplete + dataOnly: Incomplete + labelOnly: Incomplete + grandRow: Incomplete + grandCol: Incomplete + cacheIndex: Incomplete + outline: Incomplete + offset: Incomplete + collapsedLevelsAreSubtotals: Incomplete + axis: Incomplete + fieldPosition: Incomplete + __elements__: Incomplete def __init__( self, references=..., - extLst: Any | None = ..., - field: Any | None = ..., + extLst: Incomplete | None = ..., + field: Incomplete | None = ..., type: str = ..., dataOnly: bool = ..., - labelOnly: Any | None = ..., - grandRow: Any | None = ..., - grandCol: Any | None = ..., - cacheIndex: Any | None = ..., + labelOnly: Incomplete | None = ..., + grandRow: Incomplete | None = ..., + grandCol: Incomplete | None = ..., + cacheIndex: Incomplete | None = ..., outline: bool = ..., - offset: Any | None = ..., - collapsedLevelsAreSubtotals: Any | None = ..., - axis: Any | None = ..., - fieldPosition: Any | None = ..., + offset: Incomplete | None = ..., + collapsedLevelsAreSubtotals: Incomplete | None = ..., + axis: Incomplete | None = ..., + fieldPosition: Incomplete | None = ..., ) -> None: ... class ChartFormat(Serialisable): tagname: str - chart: Any - format: Any - series: Any - pivotArea: Any - __elements__: Any + chart: Incomplete + format: Incomplete + series: Incomplete + pivotArea: Incomplete + __elements__: Incomplete def __init__( - self, chart: Any | None = ..., format: Any | None = ..., series: Any | None = ..., pivotArea: Any | None = ... + self, + chart: Incomplete | None = ..., + format: Incomplete | None = ..., + series: Incomplete | None = ..., + pivotArea: Incomplete | None = ..., ) -> None: ... class ConditionalFormat(Serialisable): tagname: str - scope: Any - type: Any - priority: Any - pivotAreas: Any - extLst: Any - __elements__: Any + scope: Incomplete + type: Incomplete + priority: Incomplete + pivotAreas: Incomplete + extLst: Incomplete + __elements__: Incomplete def __init__( self, - scope: Any | None = ..., - type: Any | None = ..., - priority: Any | None = ..., + scope: Incomplete | None = ..., + type: Incomplete | None = ..., + priority: Incomplete | None = ..., pivotAreas=..., - extLst: Any | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... class Format(Serialisable): tagname: str - action: Any - dxfId: Any - pivotArea: Any - extLst: Any - __elements__: Any + action: Incomplete + dxfId: Incomplete + pivotArea: Incomplete + extLst: Incomplete + __elements__: Incomplete def __init__( - self, action: str = ..., dxfId: Any | None = ..., pivotArea: Any | None = ..., extLst: Any | None = ... + self, + action: str = ..., + dxfId: Incomplete | None = ..., + pivotArea: Incomplete | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... class DataField(Serialisable): tagname: str - name: Any - fld: Any - subtotal: Any - showDataAs: Any - baseField: Any - baseItem: Any - numFmtId: Any - extLst: Any - __elements__: Any + name: Incomplete + fld: Incomplete + subtotal: Incomplete + showDataAs: Incomplete + baseField: Incomplete + baseItem: Incomplete + numFmtId: Incomplete + extLst: Incomplete + __elements__: Incomplete def __init__( self, - name: Any | None = ..., - fld: Any | None = ..., + name: Incomplete | None = ..., + fld: Incomplete | None = ..., subtotal: str = ..., showDataAs: str = ..., baseField: int = ..., baseItem: int = ..., - numFmtId: Any | None = ..., - extLst: Any | None = ..., + numFmtId: Incomplete | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... class PageField(Serialisable): tagname: str - fld: Any - item: Any - hier: Any - name: Any - cap: Any - extLst: Any - __elements__: Any + fld: Incomplete + item: Incomplete + hier: Incomplete + name: Incomplete + cap: Incomplete + extLst: Incomplete + __elements__: Incomplete def __init__( self, - fld: Any | None = ..., - item: Any | None = ..., - hier: Any | None = ..., - name: Any | None = ..., - cap: Any | None = ..., - extLst: Any | None = ..., + fld: Incomplete | None = ..., + item: Incomplete | None = ..., + hier: Incomplete | None = ..., + name: Incomplete | None = ..., + cap: Incomplete | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... class RowColItem(Serialisable): tagname: str - t: Any - r: Any - i: Any - x: Any - __elements__: Any + t: Incomplete + r: Incomplete + i: Incomplete + x: Incomplete + __elements__: Incomplete def __init__(self, t: str = ..., r: int = ..., i: int = ..., x=...) -> None: ... class RowColField(Serialisable): tagname: str - x: Any - def __init__(self, x: Any | None = ...) -> None: ... + x: Incomplete + def __init__(self, x: Incomplete | None = ...) -> None: ... class AutoSortScope(Serialisable): # type: ignore[misc] - pivotArea: Any - __elements__: Any - def __init__(self, pivotArea: Any | None = ...) -> None: ... + pivotArea: Incomplete + __elements__: Incomplete + def __init__(self, pivotArea: Incomplete | None = ...) -> None: ... class FieldItem(Serialisable): tagname: str - n: Any - t: Any - h: Any - s: Any - sd: Any - f: Any - m: Any - c: Any - x: Any - d: Any - e: Any + n: Incomplete + t: Incomplete + h: Incomplete + s: Incomplete + sd: Incomplete + f: Incomplete + m: Incomplete + c: Incomplete + x: Incomplete + d: Incomplete + e: Incomplete def __init__( self, - n: Any | None = ..., + n: Incomplete | None = ..., t: str = ..., - h: Any | None = ..., - s: Any | None = ..., + h: Incomplete | None = ..., + s: Incomplete | None = ..., sd: bool = ..., - f: Any | None = ..., - m: Any | None = ..., - c: Any | None = ..., - x: Any | None = ..., - d: Any | None = ..., - e: Any | None = ..., + f: Incomplete | None = ..., + m: Incomplete | None = ..., + c: Incomplete | None = ..., + x: Incomplete | None = ..., + d: Incomplete | None = ..., + e: Incomplete | None = ..., ) -> None: ... class PivotField(Serialisable): tagname: str - items: Any - autoSortScope: Any - extLst: Any - name: Any - axis: Any - dataField: Any - subtotalCaption: Any - showDropDowns: Any - hiddenLevel: Any - uniqueMemberProperty: Any - compact: Any - allDrilled: Any - numFmtId: Any - outline: Any - subtotalTop: Any - dragToRow: Any - dragToCol: Any - multipleItemSelectionAllowed: Any - dragToPage: Any - dragToData: Any - dragOff: Any - showAll: Any - insertBlankRow: Any - serverField: Any - insertPageBreak: Any - autoShow: Any - topAutoShow: Any - hideNewItems: Any - measureFilter: Any - includeNewItemsInFilter: Any - itemPageCount: Any - sortType: Any - dataSourceSort: Any - nonAutoSortDefault: Any - rankBy: Any - defaultSubtotal: Any - sumSubtotal: Any - countASubtotal: Any - avgSubtotal: Any - maxSubtotal: Any - minSubtotal: Any - productSubtotal: Any - countSubtotal: Any - stdDevSubtotal: Any - stdDevPSubtotal: Any - varSubtotal: Any - varPSubtotal: Any - showPropCell: Any - showPropTip: Any - showPropAsCaption: Any - defaultAttributeDrillState: Any - __elements__: Any + items: Incomplete + autoSortScope: Incomplete + extLst: Incomplete + name: Incomplete + axis: Incomplete + dataField: Incomplete + subtotalCaption: Incomplete + showDropDowns: Incomplete + hiddenLevel: Incomplete + uniqueMemberProperty: Incomplete + compact: Incomplete + allDrilled: Incomplete + numFmtId: Incomplete + outline: Incomplete + subtotalTop: Incomplete + dragToRow: Incomplete + dragToCol: Incomplete + multipleItemSelectionAllowed: Incomplete + dragToPage: Incomplete + dragToData: Incomplete + dragOff: Incomplete + showAll: Incomplete + insertBlankRow: Incomplete + serverField: Incomplete + insertPageBreak: Incomplete + autoShow: Incomplete + topAutoShow: Incomplete + hideNewItems: Incomplete + measureFilter: Incomplete + includeNewItemsInFilter: Incomplete + itemPageCount: Incomplete + sortType: Incomplete + dataSourceSort: Incomplete + nonAutoSortDefault: Incomplete + rankBy: Incomplete + defaultSubtotal: Incomplete + sumSubtotal: Incomplete + countASubtotal: Incomplete + avgSubtotal: Incomplete + maxSubtotal: Incomplete + minSubtotal: Incomplete + productSubtotal: Incomplete + countSubtotal: Incomplete + stdDevSubtotal: Incomplete + stdDevPSubtotal: Incomplete + varSubtotal: Incomplete + varPSubtotal: Incomplete + showPropCell: Incomplete + showPropTip: Incomplete + showPropAsCaption: Incomplete + defaultAttributeDrillState: Incomplete + __elements__: Incomplete def __init__( self, items=..., - autoSortScope: Any | None = ..., - name: Any | None = ..., - axis: Any | None = ..., - dataField: Any | None = ..., - subtotalCaption: Any | None = ..., + autoSortScope: Incomplete | None = ..., + name: Incomplete | None = ..., + axis: Incomplete | None = ..., + dataField: Incomplete | None = ..., + subtotalCaption: Incomplete | None = ..., showDropDowns: bool = ..., - hiddenLevel: Any | None = ..., - uniqueMemberProperty: Any | None = ..., + hiddenLevel: Incomplete | None = ..., + uniqueMemberProperty: Incomplete | None = ..., compact: bool = ..., - allDrilled: Any | None = ..., - numFmtId: Any | None = ..., + allDrilled: Incomplete | None = ..., + numFmtId: Incomplete | None = ..., outline: bool = ..., subtotalTop: bool = ..., dragToRow: bool = ..., dragToCol: bool = ..., - multipleItemSelectionAllowed: Any | None = ..., + multipleItemSelectionAllowed: Incomplete | None = ..., dragToPage: bool = ..., dragToData: bool = ..., dragOff: bool = ..., showAll: bool = ..., - insertBlankRow: Any | None = ..., - serverField: Any | None = ..., - insertPageBreak: Any | None = ..., - autoShow: Any | None = ..., + insertBlankRow: Incomplete | None = ..., + serverField: Incomplete | None = ..., + insertPageBreak: Incomplete | None = ..., + autoShow: Incomplete | None = ..., topAutoShow: bool = ..., - hideNewItems: Any | None = ..., - measureFilter: Any | None = ..., - includeNewItemsInFilter: Any | None = ..., + hideNewItems: Incomplete | None = ..., + measureFilter: Incomplete | None = ..., + includeNewItemsInFilter: Incomplete | None = ..., itemPageCount: int = ..., sortType: str = ..., - dataSourceSort: Any | None = ..., - nonAutoSortDefault: Any | None = ..., - rankBy: Any | None = ..., + dataSourceSort: Incomplete | None = ..., + nonAutoSortDefault: Incomplete | None = ..., + rankBy: Incomplete | None = ..., defaultSubtotal: bool = ..., - sumSubtotal: Any | None = ..., - countASubtotal: Any | None = ..., - avgSubtotal: Any | None = ..., - maxSubtotal: Any | None = ..., - minSubtotal: Any | None = ..., - productSubtotal: Any | None = ..., - countSubtotal: Any | None = ..., - stdDevSubtotal: Any | None = ..., - stdDevPSubtotal: Any | None = ..., - varSubtotal: Any | None = ..., - varPSubtotal: Any | None = ..., - showPropCell: Any | None = ..., - showPropTip: Any | None = ..., - showPropAsCaption: Any | None = ..., - defaultAttributeDrillState: Any | None = ..., - extLst: Any | None = ..., + sumSubtotal: Incomplete | None = ..., + countASubtotal: Incomplete | None = ..., + avgSubtotal: Incomplete | None = ..., + maxSubtotal: Incomplete | None = ..., + minSubtotal: Incomplete | None = ..., + productSubtotal: Incomplete | None = ..., + countSubtotal: Incomplete | None = ..., + stdDevSubtotal: Incomplete | None = ..., + stdDevPSubtotal: Incomplete | None = ..., + varSubtotal: Incomplete | None = ..., + varPSubtotal: Incomplete | None = ..., + showPropCell: Incomplete | None = ..., + showPropTip: Incomplete | None = ..., + showPropAsCaption: Incomplete | None = ..., + defaultAttributeDrillState: Incomplete | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... class Location(Serialisable): tagname: str - ref: Any - firstHeaderRow: Any - firstDataRow: Any - firstDataCol: Any - rowPageCount: Any - colPageCount: Any + ref: Incomplete + firstHeaderRow: Incomplete + firstDataRow: Incomplete + firstDataCol: Incomplete + rowPageCount: Incomplete + colPageCount: Incomplete def __init__( self, - ref: Any | None = ..., - firstHeaderRow: Any | None = ..., - firstDataRow: Any | None = ..., - firstDataCol: Any | None = ..., - rowPageCount: Any | None = ..., - colPageCount: Any | None = ..., + ref: Incomplete | None = ..., + firstHeaderRow: Incomplete | None = ..., + firstDataRow: Incomplete | None = ..., + firstDataCol: Incomplete | None = ..., + rowPageCount: Incomplete | None = ..., + colPageCount: Incomplete | None = ..., ) -> None: ... class TableDefinition(Serialisable): mime_type: str rel_type: str tagname: str - cache: Any - name: Any - cacheId: Any - dataOnRows: Any - dataPosition: Any - dataCaption: Any - grandTotalCaption: Any - errorCaption: Any - showError: Any - missingCaption: Any - showMissing: Any - pageStyle: Any - pivotTableStyle: Any - vacatedStyle: Any - tag: Any - updatedVersion: Any - minRefreshableVersion: Any - asteriskTotals: Any - showItems: Any - editData: Any - disableFieldList: Any - showCalcMbrs: Any - visualTotals: Any - showMultipleLabel: Any - showDataDropDown: Any - showDrill: Any - printDrill: Any - showMemberPropertyTips: Any - showDataTips: Any - enableWizard: Any - enableDrill: Any - enableFieldProperties: Any - preserveFormatting: Any - useAutoFormatting: Any - pageWrap: Any - pageOverThenDown: Any - subtotalHiddenItems: Any - rowGrandTotals: Any - colGrandTotals: Any - fieldPrintTitles: Any - itemPrintTitles: Any - mergeItem: Any - showDropZones: Any - createdVersion: Any - indent: Any - showEmptyRow: Any - showEmptyCol: Any - showHeaders: Any - compact: Any - outline: Any - outlineData: Any - compactData: Any - published: Any - gridDropZones: Any - immersive: Any - multipleFieldFilters: Any - chartFormat: Any - rowHeaderCaption: Any - colHeaderCaption: Any - fieldListSortAscending: Any - mdxSubqueries: Any - customListSort: Any - autoFormatId: Any - applyNumberFormats: Any - applyBorderFormats: Any - applyFontFormats: Any - applyPatternFormats: Any - applyAlignmentFormats: Any - applyWidthHeightFormats: Any - location: Any - pivotFields: Any - rowFields: Any - rowItems: Any - colFields: Any - colItems: Any - pageFields: Any - dataFields: Any - formats: Any - conditionalFormats: Any - chartFormats: Any - pivotHierarchies: Any - pivotTableStyleInfo: Any - filters: Any - rowHierarchiesUsage: Any - colHierarchiesUsage: Any - extLst: Any - id: Any - __elements__: Any + cache: Incomplete + name: Incomplete + cacheId: Incomplete + dataOnRows: Incomplete + dataPosition: Incomplete + dataCaption: Incomplete + grandTotalCaption: Incomplete + errorCaption: Incomplete + showError: Incomplete + missingCaption: Incomplete + showMissing: Incomplete + pageStyle: Incomplete + pivotTableStyle: Incomplete + vacatedStyle: Incomplete + tag: Incomplete + updatedVersion: Incomplete + minRefreshableVersion: Incomplete + asteriskTotals: Incomplete + showItems: Incomplete + editData: Incomplete + disableFieldList: Incomplete + showCalcMbrs: Incomplete + visualTotals: Incomplete + showMultipleLabel: Incomplete + showDataDropDown: Incomplete + showDrill: Incomplete + printDrill: Incomplete + showMemberPropertyTips: Incomplete + showDataTips: Incomplete + enableWizard: Incomplete + enableDrill: Incomplete + enableFieldProperties: Incomplete + preserveFormatting: Incomplete + useAutoFormatting: Incomplete + pageWrap: Incomplete + pageOverThenDown: Incomplete + subtotalHiddenItems: Incomplete + rowGrandTotals: Incomplete + colGrandTotals: Incomplete + fieldPrintTitles: Incomplete + itemPrintTitles: Incomplete + mergeItem: Incomplete + showDropZones: Incomplete + createdVersion: Incomplete + indent: Incomplete + showEmptyRow: Incomplete + showEmptyCol: Incomplete + showHeaders: Incomplete + compact: Incomplete + outline: Incomplete + outlineData: Incomplete + compactData: Incomplete + published: Incomplete + gridDropZones: Incomplete + immersive: Incomplete + multipleFieldFilters: Incomplete + chartFormat: Incomplete + rowHeaderCaption: Incomplete + colHeaderCaption: Incomplete + fieldListSortAscending: Incomplete + mdxSubqueries: Incomplete + customListSort: Incomplete + autoFormatId: Incomplete + applyNumberFormats: Incomplete + applyBorderFormats: Incomplete + applyFontFormats: Incomplete + applyPatternFormats: Incomplete + applyAlignmentFormats: Incomplete + applyWidthHeightFormats: Incomplete + location: Incomplete + pivotFields: Incomplete + rowFields: Incomplete + rowItems: Incomplete + colFields: Incomplete + colItems: Incomplete + pageFields: Incomplete + dataFields: Incomplete + formats: Incomplete + conditionalFormats: Incomplete + chartFormats: Incomplete + pivotHierarchies: Incomplete + pivotTableStyleInfo: Incomplete + filters: Incomplete + rowHierarchiesUsage: Incomplete + colHierarchiesUsage: Incomplete + extLst: Incomplete + id: Incomplete + __elements__: Incomplete def __init__( self, - name: Any | None = ..., - cacheId: Any | None = ..., + name: Incomplete | None = ..., + cacheId: Incomplete | None = ..., dataOnRows: bool = ..., - dataPosition: Any | None = ..., - dataCaption: Any | None = ..., - grandTotalCaption: Any | None = ..., - errorCaption: Any | None = ..., + dataPosition: Incomplete | None = ..., + dataCaption: Incomplete | None = ..., + grandTotalCaption: Incomplete | None = ..., + errorCaption: Incomplete | None = ..., showError: bool = ..., - missingCaption: Any | None = ..., + missingCaption: Incomplete | None = ..., showMissing: bool = ..., - pageStyle: Any | None = ..., - pivotTableStyle: Any | None = ..., - vacatedStyle: Any | None = ..., - tag: Any | None = ..., + pageStyle: Incomplete | None = ..., + pivotTableStyle: Incomplete | None = ..., + vacatedStyle: Incomplete | None = ..., + tag: Incomplete | None = ..., updatedVersion: int = ..., minRefreshableVersion: int = ..., asteriskTotals: bool = ..., @@ -634,21 +642,21 @@ class TableDefinition(Serialisable): published: bool = ..., gridDropZones: bool = ..., immersive: bool = ..., - multipleFieldFilters: Any | None = ..., + multipleFieldFilters: Incomplete | None = ..., chartFormat: int = ..., - rowHeaderCaption: Any | None = ..., - colHeaderCaption: Any | None = ..., - fieldListSortAscending: Any | None = ..., - mdxSubqueries: Any | None = ..., - customListSort: Any | None = ..., - autoFormatId: Any | None = ..., + rowHeaderCaption: Incomplete | None = ..., + colHeaderCaption: Incomplete | None = ..., + fieldListSortAscending: Incomplete | None = ..., + mdxSubqueries: Incomplete | None = ..., + customListSort: Incomplete | None = ..., + autoFormatId: Incomplete | None = ..., applyNumberFormats: bool = ..., applyBorderFormats: bool = ..., applyFontFormats: bool = ..., applyPatternFormats: bool = ..., applyAlignmentFormats: bool = ..., applyWidthHeightFormats: bool = ..., - location: Any | None = ..., + location: Incomplete | None = ..., pivotFields=..., rowFields=..., rowItems=..., @@ -660,12 +668,12 @@ class TableDefinition(Serialisable): conditionalFormats=..., chartFormats=..., pivotHierarchies=..., - pivotTableStyleInfo: Any | None = ..., + pivotTableStyleInfo: Incomplete | None = ..., filters=..., - rowHierarchiesUsage: Any | None = ..., - colHierarchiesUsage: Any | None = ..., - extLst: Any | None = ..., - id: Any | None = ..., + rowHierarchiesUsage: Incomplete | None = ..., + colHierarchiesUsage: Incomplete | None = ..., + extLst: Incomplete | None = ..., + id: Incomplete | None = ..., ) -> None: ... def to_tree(self): ... @property diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/reader/excel.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/reader/excel.pyi index c70d2e8e4..410ba2223 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/reader/excel.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/reader/excel.pyi @@ -1,26 +1,50 @@ -from typing import Any +from _typeshed import Incomplete, StrPath, SupportsRead +from zipfile import ZipFile -SUPPORTED_FORMATS: Any +from openpyxl.chartsheet.chartsheet import Chartsheet +from openpyxl.packaging.manifest import Manifest +from openpyxl.packaging.relationship import Relationship +from openpyxl.reader.workbook import WorkbookParser +from openpyxl.workbook import Workbook + +SUPPORTED_FORMATS: Incomplete class ExcelReader: - archive: Any - valid_files: Any - read_only: Any - keep_vba: Any - data_only: Any - keep_links: Any - shared_strings: Any - def __init__(self, fn, read_only: bool = ..., keep_vba=..., data_only: bool = ..., keep_links: bool = ...) -> None: ... - package: Any + archive: ZipFile + valid_files: list[str] + read_only: bool + keep_vba: bool + data_only: bool + keep_links: bool + rich_text: bool + shared_strings: list[Incomplete] + package: Manifest # defined after call to read_manifest() + parser: WorkbookParser # defined after call to read_workbook() + wb: Workbook # defined after call to read_workbook() + + def __init__( + self, + fn: SupportsRead[bytes] | str, + read_only: bool = False, + keep_vba: bool = False, + data_only: bool = False, + keep_links: bool = True, + rich_text: bool = False, + ) -> None: ... def read_manifest(self) -> None: ... def read_strings(self) -> None: ... - parser: Any - wb: Any def read_workbook(self) -> None: ... def read_properties(self) -> None: ... def read_theme(self) -> None: ... - def read_chartsheet(self, sheet, rel) -> None: ... + def read_chartsheet(self, sheet: Chartsheet, rel: Relationship) -> None: ... def read_worksheets(self) -> None: ... def read(self) -> None: ... -def load_workbook(filename, read_only: bool = ..., keep_vba=..., data_only: bool = ..., keep_links: bool = ...): ... +def load_workbook( + filename: SupportsRead[bytes] | StrPath, + read_only: bool = False, + keep_vba: bool = False, + data_only: bool = False, + keep_links: bool = True, + rich_text: bool = False, +) -> Workbook: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/reader/workbook.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/reader/workbook.pyi index 4b1bde6f7..1eef773f2 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/reader/workbook.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/reader/workbook.pyi @@ -1,18 +1,20 @@ +from _typeshed import Incomplete from collections.abc import Generator -from typing import Any + +from openpyxl.workbook import Workbook class WorkbookParser: - archive: Any - workbook_part_name: Any - wb: Any - keep_links: Any - sheets: Any + archive: Incomplete + workbook_part_name: Incomplete + wb: Workbook + keep_links: Incomplete + sheets: Incomplete def __init__(self, archive, workbook_part_name, keep_links: bool = ...) -> None: ... @property def rels(self): ... - caches: Any + caches: Incomplete def parse(self) -> None: ... - def find_sheets(self) -> Generator[Any, None, None]: ... + def find_sheets(self) -> Generator[Incomplete, None, None]: ... def assign_names(self) -> None: ... @property def pivot_caches(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/alignment.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/alignment.pyi index adcc6aeef..6914145b6 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/alignment.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/alignment.pyi @@ -1,39 +1,39 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable -horizontal_alignments: Any -vertical_aligments: Any +horizontal_alignments: Incomplete +vertical_aligments: Incomplete class Alignment(Serialisable): tagname: str - __fields__: Any - horizontal: Any - vertical: Any - textRotation: Any - text_rotation: Any - wrapText: Any - wrap_text: Any - shrinkToFit: Any - shrink_to_fit: Any - indent: Any - relativeIndent: Any - justifyLastLine: Any - readingOrder: Any + __fields__: Incomplete + horizontal: Incomplete + vertical: Incomplete + textRotation: Incomplete + text_rotation: Incomplete + wrapText: Incomplete + wrap_text: Incomplete + shrinkToFit: Incomplete + shrink_to_fit: Incomplete + indent: Incomplete + relativeIndent: Incomplete + justifyLastLine: Incomplete + readingOrder: Incomplete def __init__( self, - horizontal: Any | None = ..., - vertical: Any | None = ..., + horizontal: Incomplete | None = ..., + vertical: Incomplete | None = ..., textRotation: int = ..., - wrapText: Any | None = ..., - shrinkToFit: Any | None = ..., + wrapText: Incomplete | None = ..., + shrinkToFit: Incomplete | None = ..., indent: int = ..., relativeIndent: int = ..., - justifyLastLine: Any | None = ..., + justifyLastLine: Incomplete | None = ..., readingOrder: int = ..., - text_rotation: Any | None = ..., - wrap_text: Any | None = ..., - shrink_to_fit: Any | None = ..., - mergeCell: Any | None = ..., + text_rotation: Incomplete | None = ..., + wrap_text: Incomplete | None = ..., + shrink_to_fit: Incomplete | None = ..., + mergeCell: Incomplete | None = ..., ) -> None: ... def __iter__(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/borders.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/borders.pyi index d5d36e30c..257e1c685 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/borders.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/borders.pyi @@ -1,8 +1,8 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable -BORDER_NONE: Any +BORDER_NONE: Incomplete BORDER_DASHDOT: str BORDER_DASHDOTDOT: str BORDER_DASHED: str @@ -18,45 +18,47 @@ BORDER_THICK: str BORDER_THIN: str class Side(Serialisable): # type: ignore[misc] - __fields__: Any - color: Any - style: Any - border_style: Any - def __init__(self, style: Any | None = ..., color: Any | None = ..., border_style: Any | None = ...) -> None: ... + __fields__: Incomplete + color: Incomplete + style: Incomplete + border_style: Incomplete + def __init__( + self, style: Incomplete | None = ..., color: Incomplete | None = ..., border_style: Incomplete | None = ... + ) -> None: ... class Border(Serialisable): tagname: str - __fields__: Any - __elements__: Any - start: Any - end: Any - left: Any - right: Any - top: Any - bottom: Any - diagonal: Any - vertical: Any - horizontal: Any - outline: Any - diagonalUp: Any - diagonalDown: Any - diagonal_direction: Any + __fields__: Incomplete + __elements__: Incomplete + start: Incomplete + end: Incomplete + left: Incomplete + right: Incomplete + top: Incomplete + bottom: Incomplete + diagonal: Incomplete + vertical: Incomplete + horizontal: Incomplete + outline: Incomplete + diagonalUp: Incomplete + diagonalDown: Incomplete + diagonal_direction: Incomplete def __init__( self, - left: Any | None = ..., - right: Any | None = ..., - top: Any | None = ..., - bottom: Any | None = ..., - diagonal: Any | None = ..., - diagonal_direction: Any | None = ..., - vertical: Any | None = ..., - horizontal: Any | None = ..., + left: Incomplete | None = ..., + right: Incomplete | None = ..., + top: Incomplete | None = ..., + bottom: Incomplete | None = ..., + diagonal: Incomplete | None = ..., + diagonal_direction: Incomplete | None = ..., + vertical: Incomplete | None = ..., + horizontal: Incomplete | None = ..., diagonalUp: bool = ..., diagonalDown: bool = ..., outline: bool = ..., - start: Any | None = ..., - end: Any | None = ..., + start: Incomplete | None = ..., + end: Incomplete | None = ..., ) -> None: ... def __iter__(self): ... -DEFAULT_BORDER: Any +DEFAULT_BORDER: Incomplete diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/builtins.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/builtins.pyi index 9253fb770..aabe58d98 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/builtins.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/builtins.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete normal: str comma: str @@ -50,4 +50,4 @@ accent_6_20: str accent_6_40: str accent_6_60: str pandas_highlight: str -styles: Any +styles: Incomplete diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/cell_style.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/cell_style.pyi index b44a750d3..32355ec9d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/cell_style.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/cell_style.pyi @@ -1,69 +1,69 @@ +from _typeshed import Incomplete from array import array -from typing import Any from openpyxl.descriptors.serialisable import Serialisable class ArrayDescriptor: - key: Any + key: Incomplete def __init__(self, key) -> None: ... def __get__(self, instance, cls): ... def __set__(self, instance, value) -> None: ... -class StyleArray(array[Any]): +class StyleArray(array[Incomplete]): tagname: str - fontId: Any - fillId: Any - borderId: Any - numFmtId: Any - protectionId: Any - alignmentId: Any - pivotButton: Any - quotePrefix: Any - xfId: Any + fontId: Incomplete + fillId: Incomplete + borderId: Incomplete + numFmtId: Incomplete + protectionId: Incomplete + alignmentId: Incomplete + pivotButton: Incomplete + quotePrefix: Incomplete + xfId: Incomplete def __new__(cls, args=...): ... - def __hash__(self): ... + def __hash__(self) -> int: ... def __copy__(self): ... def __deepcopy__(self, memo): ... class CellStyle(Serialisable): tagname: str - numFmtId: Any - fontId: Any - fillId: Any - borderId: Any - xfId: Any - quotePrefix: Any - pivotButton: Any - applyNumberFormat: Any - applyFont: Any - applyFill: Any - applyBorder: Any + numFmtId: Incomplete + fontId: Incomplete + fillId: Incomplete + borderId: Incomplete + xfId: Incomplete + quotePrefix: Incomplete + pivotButton: Incomplete + applyNumberFormat: Incomplete + applyFont: Incomplete + applyFill: Incomplete + applyBorder: Incomplete # Overwritten by properties below # applyAlignment: Bool # applyProtection: Bool - alignment: Any - protection: Any - extLst: Any - __elements__: Any - __attrs__: Any + alignment: Incomplete + protection: Incomplete + extLst: Incomplete + __elements__: Incomplete + __attrs__: Incomplete def __init__( self, numFmtId: int = ..., fontId: int = ..., fillId: int = ..., borderId: int = ..., - xfId: Any | None = ..., - quotePrefix: Any | None = ..., - pivotButton: Any | None = ..., - applyNumberFormat: Any | None = ..., - applyFont: Any | None = ..., - applyFill: Any | None = ..., - applyBorder: Any | None = ..., - applyAlignment: Any | None = ..., - applyProtection: Any | None = ..., - alignment: Any | None = ..., - protection: Any | None = ..., - extLst: Any | None = ..., + xfId: Incomplete | None = ..., + quotePrefix: Incomplete | None = ..., + pivotButton: Incomplete | None = ..., + applyNumberFormat: Incomplete | None = ..., + applyFont: Incomplete | None = ..., + applyFill: Incomplete | None = ..., + applyBorder: Incomplete | None = ..., + applyAlignment: Incomplete | None = ..., + applyProtection: Incomplete | None = ..., + alignment: Incomplete | None = ..., + protection: Incomplete | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... def to_array(self): ... @classmethod @@ -75,14 +75,14 @@ class CellStyle(Serialisable): class CellStyleList(Serialisable): tagname: str - __attrs__: Any + __attrs__: Incomplete # Overwritten by property below # count: Integer - xf: Any - alignment: Any - protection: Any - __elements__: Any - def __init__(self, count: Any | None = ..., xf=...) -> None: ... + xf: Incomplete + alignment: Incomplete + protection: Incomplete + __elements__: Incomplete + def __init__(self, count: Incomplete | None = ..., xf=...) -> None: ... @property def count(self): ... def __getitem__(self, idx): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/colors.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/colors.pyi index 3f311d4db..4cb7974e8 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/colors.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/colors.pyi @@ -1,34 +1,34 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors import Typed from openpyxl.descriptors.serialisable import Serialisable -COLOR_INDEX: Any -BLACK: Any -WHITE: Any -BLUE: Any -aRGB_REGEX: Any +COLOR_INDEX: Incomplete +BLACK: Incomplete +WHITE: Incomplete +BLUE: Incomplete +aRGB_REGEX: Incomplete class RGB(Typed): - expected_type: Any + expected_type: Incomplete def __set__(self, instance, value) -> None: ... class Color(Serialisable): tagname: str - rgb: Any - indexed: Any - auto: Any - theme: Any - tint: Any - type: Any + rgb: Incomplete + indexed: Incomplete + auto: Incomplete + theme: Incomplete + tint: Incomplete + type: Incomplete def __init__( self, rgb=..., - indexed: Any | None = ..., - auto: Any | None = ..., - theme: Any | None = ..., + indexed: Incomplete | None = ..., + auto: Incomplete | None = ..., + theme: Incomplete | None = ..., tint: float = ..., - index: Any | None = ..., + index: Incomplete | None = ..., type: str = ..., ) -> None: ... @property @@ -41,20 +41,20 @@ class Color(Serialisable): def __add__(self, other): ... class ColorDescriptor(Typed): - expected_type: Any + expected_type: Incomplete def __set__(self, instance, value) -> None: ... class RgbColor(Serialisable): tagname: str - rgb: Any - def __init__(self, rgb: Any | None = ...) -> None: ... + rgb: Incomplete + def __init__(self, rgb: Incomplete | None = ...) -> None: ... class ColorList(Serialisable): tagname: str - indexedColors: Any - mruColors: Any - __elements__: Any + indexedColors: Incomplete + mruColors: Incomplete + __elements__: Incomplete def __init__(self, indexedColors=..., mruColors=...) -> None: ... - def __bool__(self): ... + def __bool__(self) -> bool: ... @property def index(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/differential.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/differential.pyi index 2c6c9b580..4e0be87bb 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/differential.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/differential.pyi @@ -1,37 +1,37 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class DifferentialStyle(Serialisable): tagname: str - __elements__: Any - font: Any - numFmt: Any - fill: Any - alignment: Any - border: Any - protection: Any - extLst: Any + __elements__: Incomplete + font: Incomplete + numFmt: Incomplete + fill: Incomplete + alignment: Incomplete + border: Incomplete + protection: Incomplete + extLst: Incomplete def __init__( self, - font: Any | None = ..., - numFmt: Any | None = ..., - fill: Any | None = ..., - alignment: Any | None = ..., - border: Any | None = ..., - protection: Any | None = ..., - extLst: Any | None = ..., + font: Incomplete | None = ..., + numFmt: Incomplete | None = ..., + fill: Incomplete | None = ..., + alignment: Incomplete | None = ..., + border: Incomplete | None = ..., + protection: Incomplete | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... class DifferentialStyleList(Serialisable): tagname: str - dxf: Any - styles: Any - __attrs__: Any - def __init__(self, dxf=..., count: Any | None = ...) -> None: ... + dxf: Incomplete + styles: Incomplete + __attrs__: Incomplete + def __init__(self, dxf=..., count: Incomplete | None = ...) -> None: ... def append(self, dxf) -> None: ... def add(self, dxf): ... - def __bool__(self): ... + def __bool__(self) -> bool: ... def __getitem__(self, idx): ... @property def count(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/fills.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/fills.pyi index f3fdda594..8afca1212 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/fills.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/fills.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors import Sequence from openpyxl.descriptors.serialisable import Serialisable @@ -22,7 +22,7 @@ FILL_PATTERN_LIGHTTRELLIS: str FILL_PATTERN_LIGHTUP: str FILL_PATTERN_LIGHTVERTICAL: str FILL_PATTERN_MEDIUMGRAY: str -fills: Any +fills: Incomplete class Fill(Serialisable): tagname: str @@ -31,49 +31,49 @@ class Fill(Serialisable): class PatternFill(Fill): tagname: str - __elements__: Any - patternType: Any - fill_type: Any - fgColor: Any - start_color: Any - bgColor: Any - end_color: Any + __elements__: Incomplete + patternType: Incomplete + fill_type: Incomplete + fgColor: Incomplete + start_color: Incomplete + bgColor: Incomplete + end_color: Incomplete def __init__( self, - patternType: Any | None = ..., + patternType: Incomplete | None = ..., fgColor=..., bgColor=..., - fill_type: Any | None = ..., - start_color: Any | None = ..., - end_color: Any | None = ..., + fill_type: Incomplete | None = ..., + start_color: Incomplete | None = ..., + end_color: Incomplete | None = ..., ) -> None: ... - def to_tree(self, tagname: Any | None = ..., idx: Any | None = ...): ... # type: ignore[override] + def to_tree(self, tagname: Incomplete | None = ..., idx: Incomplete | None = ...): ... # type: ignore[override] -DEFAULT_EMPTY_FILL: Any -DEFAULT_GRAY_FILL: Any +DEFAULT_EMPTY_FILL: Incomplete +DEFAULT_GRAY_FILL: Incomplete class Stop(Serialisable): tagname: str - position: Any - color: Any + position: Incomplete + color: Incomplete def __init__(self, color, position) -> None: ... class StopList(Sequence): - expected_type: Any + expected_type: Incomplete def __set__(self, obj, values) -> None: ... class GradientFill(Fill): tagname: str - type: Any - fill_type: Any - degree: Any - left: Any - right: Any - top: Any - bottom: Any - stop: Any + type: Incomplete + fill_type: Incomplete + degree: Incomplete + left: Incomplete + right: Incomplete + top: Incomplete + bottom: Incomplete + stop: Incomplete def __init__( self, type: str = ..., degree: int = ..., left: int = ..., right: int = ..., top: int = ..., bottom: int = ..., stop=... ) -> None: ... def __iter__(self): ... - def to_tree(self, tagname: Any | None = ..., namespace: Any | None = ..., idx: Any | None = ...): ... # type: ignore[override] + def to_tree(self, tagname: Incomplete | None = ..., namespace: Incomplete | None = ..., idx: Incomplete | None = ...): ... # type: ignore[override] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/fonts.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/fonts.pyi index 9c8bf2998..cb565d647 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/fonts.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/fonts.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable @@ -7,52 +7,52 @@ class Font(Serialisable): UNDERLINE_DOUBLE_ACCOUNTING: str UNDERLINE_SINGLE: str UNDERLINE_SINGLE_ACCOUNTING: str - name: Any - charset: Any - family: Any - sz: Any - size: Any - b: Any - bold: Any - i: Any - italic: Any - strike: Any - strikethrough: Any - outline: Any - shadow: Any - condense: Any - extend: Any - u: Any - underline: Any - vertAlign: Any - color: Any - scheme: Any + name: Incomplete + charset: Incomplete + family: Incomplete + sz: Incomplete + size: Incomplete + b: Incomplete + bold: Incomplete + i: Incomplete + italic: Incomplete + strike: Incomplete + strikethrough: Incomplete + outline: Incomplete + shadow: Incomplete + condense: Incomplete + extend: Incomplete + u: Incomplete + underline: Incomplete + vertAlign: Incomplete + color: Incomplete + scheme: Incomplete tagname: str - __elements__: Any + __elements__: Incomplete def __init__( self, - name: Any | None = ..., - sz: Any | None = ..., - b: Any | None = ..., - i: Any | None = ..., - charset: Any | None = ..., - u: Any | None = ..., - strike: Any | None = ..., - color: Any | None = ..., - scheme: Any | None = ..., - family: Any | None = ..., - size: Any | None = ..., - bold: Any | None = ..., - italic: Any | None = ..., - strikethrough: Any | None = ..., - underline: Any | None = ..., - vertAlign: Any | None = ..., - outline: Any | None = ..., - shadow: Any | None = ..., - condense: Any | None = ..., - extend: Any | None = ..., + name: Incomplete | None = ..., + sz: Incomplete | None = ..., + b: Incomplete | None = ..., + i: Incomplete | None = ..., + charset: Incomplete | None = ..., + u: Incomplete | None = ..., + strike: Incomplete | None = ..., + color: Incomplete | None = ..., + scheme: Incomplete | None = ..., + family: Incomplete | None = ..., + size: Incomplete | None = ..., + bold: Incomplete | None = ..., + italic: Incomplete | None = ..., + strikethrough: Incomplete | None = ..., + underline: Incomplete | None = ..., + vertAlign: Incomplete | None = ..., + outline: Incomplete | None = ..., + shadow: Incomplete | None = ..., + condense: Incomplete | None = ..., + extend: Incomplete | None = ..., ) -> None: ... @classmethod def from_tree(cls, node): ... -DEFAULT_FONT: Any +DEFAULT_FONT: Incomplete diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/named_styles.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/named_styles.pyi index b6d6f06d6..d848629ac 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/named_styles.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/named_styles.pyi @@ -1,19 +1,19 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class NamedStyle(Serialisable): # type: ignore[misc] - font: Any - fill: Any - border: Any - alignment: Any - number_format: Any - protection: Any - builtinId: Any - hidden: Any + font: Incomplete + fill: Incomplete + border: Incomplete + alignment: Incomplete + number_format: Incomplete + protection: Incomplete + builtinId: Incomplete + hidden: Incomplete # Overwritten by property below # xfId: Integer - name: Any + name: Incomplete def __init__( self, name: str = ..., @@ -21,13 +21,13 @@ class NamedStyle(Serialisable): # type: ignore[misc] fill=..., border=..., alignment=..., - number_format: Any | None = ..., + number_format: Incomplete | None = ..., protection=..., - builtinId: Any | None = ..., + builtinId: Incomplete | None = ..., hidden: bool = ..., - xfId: Any | None = ..., + xfId: Incomplete | None = ..., ) -> None: ... - def __setattr__(self, attr, value) -> None: ... + def __setattr__(self, attr: str, value) -> None: ... def __iter__(self): ... @property def xfId(self): ... @@ -36,7 +36,7 @@ class NamedStyle(Serialisable): # type: ignore[misc] def as_xf(self): ... def as_name(self): ... -class NamedStyleList(list[Any]): +class NamedStyleList(list[Incomplete]): @property def names(self): ... def __getitem__(self, key): ... @@ -44,32 +44,32 @@ class NamedStyleList(list[Any]): class _NamedCellStyle(Serialisable): tagname: str - name: Any - xfId: Any - builtinId: Any - iLevel: Any - hidden: Any - customBuiltin: Any - extLst: Any - __elements__: Any + name: Incomplete + xfId: Incomplete + builtinId: Incomplete + iLevel: Incomplete + hidden: Incomplete + customBuiltin: Incomplete + extLst: Incomplete + __elements__: Incomplete def __init__( self, - name: Any | None = ..., - xfId: Any | None = ..., - builtinId: Any | None = ..., - iLevel: Any | None = ..., - hidden: Any | None = ..., - customBuiltin: Any | None = ..., - extLst: Any | None = ..., + name: Incomplete | None = ..., + xfId: Incomplete | None = ..., + builtinId: Incomplete | None = ..., + iLevel: Incomplete | None = ..., + hidden: Incomplete | None = ..., + customBuiltin: Incomplete | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... class _NamedCellStyleList(Serialisable): tagname: str # Overwritten by property below # count: Integer - cellStyle: Any - __attrs__: Any - def __init__(self, count: Any | None = ..., cellStyle=...) -> None: ... + cellStyle: Incomplete + __attrs__: Incomplete + def __init__(self, count: Incomplete | None = ..., cellStyle=...) -> None: ... @property def count(self): ... @property diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/numbers.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/numbers.pyi index 421720d56..2762b586b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/numbers.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/numbers.pyi @@ -1,19 +1,19 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors import String from openpyxl.descriptors.serialisable import Serialisable -BUILTIN_FORMATS: Any +BUILTIN_FORMATS: Incomplete BUILTIN_FORMATS_MAX_SIZE: int -BUILTIN_FORMATS_REVERSE: Any -FORMAT_GENERAL: Any -FORMAT_TEXT: Any -FORMAT_NUMBER: Any -FORMAT_NUMBER_00: Any -FORMAT_NUMBER_COMMA_SEPARATED1: Any +BUILTIN_FORMATS_REVERSE: Incomplete +FORMAT_GENERAL: Incomplete +FORMAT_TEXT: Incomplete +FORMAT_NUMBER: Incomplete +FORMAT_NUMBER_00: Incomplete +FORMAT_NUMBER_COMMA_SEPARATED1: Incomplete FORMAT_NUMBER_COMMA_SEPARATED2: str -FORMAT_PERCENTAGE: Any -FORMAT_PERCENTAGE_00: Any +FORMAT_PERCENTAGE: Incomplete +FORMAT_PERCENTAGE_00: Incomplete FORMAT_DATE_YYYYMMDD2: str FORMAT_DATE_YYMMDD: str FORMAT_DATE_DDMMYY: str @@ -21,18 +21,18 @@ FORMAT_DATE_DMYSLASH: str FORMAT_DATE_DMYMINUS: str FORMAT_DATE_DMMINUS: str FORMAT_DATE_MYMINUS: str -FORMAT_DATE_XLSX14: Any -FORMAT_DATE_XLSX15: Any -FORMAT_DATE_XLSX16: Any -FORMAT_DATE_XLSX17: Any -FORMAT_DATE_XLSX22: Any +FORMAT_DATE_XLSX14: Incomplete +FORMAT_DATE_XLSX15: Incomplete +FORMAT_DATE_XLSX16: Incomplete +FORMAT_DATE_XLSX17: Incomplete +FORMAT_DATE_XLSX22: Incomplete FORMAT_DATE_DATETIME: str -FORMAT_DATE_TIME1: Any -FORMAT_DATE_TIME2: Any -FORMAT_DATE_TIME3: Any -FORMAT_DATE_TIME4: Any -FORMAT_DATE_TIME5: Any -FORMAT_DATE_TIME6: Any +FORMAT_DATE_TIME1: Incomplete +FORMAT_DATE_TIME2: Incomplete +FORMAT_DATE_TIME3: Incomplete +FORMAT_DATE_TIME4: Incomplete +FORMAT_DATE_TIME5: Incomplete +FORMAT_DATE_TIME6: Incomplete FORMAT_DATE_TIME7: str FORMAT_DATE_TIME8: str FORMAT_DATE_TIMEDELTA: str @@ -43,8 +43,8 @@ FORMAT_CURRENCY_EUR_SIMPLE: str COLORS: str LITERAL_GROUP: str LOCALE_GROUP: str -STRIP_RE: Any -TIMEDELTA_RE: Any +STRIP_RE: Incomplete +TIMEDELTA_RE: Incomplete def is_date_format(fmt): ... def is_timedelta_format(fmt): ... @@ -57,17 +57,17 @@ class NumberFormatDescriptor(String): def __set__(self, instance, value) -> None: ... class NumberFormat(Serialisable): # type: ignore[misc] - numFmtId: Any - formatCode: Any - def __init__(self, numFmtId: Any | None = ..., formatCode: Any | None = ...) -> None: ... + numFmtId: Incomplete + formatCode: Incomplete + def __init__(self, numFmtId: Incomplete | None = ..., formatCode: Incomplete | None = ...) -> None: ... class NumberFormatList(Serialisable): # type: ignore[misc] # Overwritten by property below # count: Integer - numFmt: Any - __elements__: Any - __attrs__: Any - def __init__(self, count: Any | None = ..., numFmt=...) -> None: ... + numFmt: Incomplete + __elements__: Incomplete + __attrs__: Incomplete + def __init__(self, count: Incomplete | None = ..., numFmt=...) -> None: ... @property def count(self): ... def __getitem__(self, idx): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/protection.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/protection.pyi index df22903e1..0aae25a3d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/protection.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/protection.pyi @@ -1,9 +1,9 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class Protection(Serialisable): tagname: str - locked: Any - hidden: Any + locked: Incomplete + hidden: Incomplete def __init__(self, locked: bool = ..., hidden: bool = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/proxy.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/proxy.pyi index b8e13b08a..6e9d3d305 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/proxy.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/proxy.pyi @@ -1,7 +1,7 @@ class StyleProxy: def __init__(self, target) -> None: ... - def __getattr__(self, attr): ... - def __setattr__(self, attr, value) -> None: ... + def __getattr__(self, attr: str): ... + def __setattr__(self, attr: str, value) -> None: ... def __copy__(self): ... def __add__(self, other): ... def copy(self, **kw): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/styleable.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/styleable.pyi index 45929c7d8..15e2a4bb0 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/styleable.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/styleable.pyi @@ -1,9 +1,9 @@ -from typing import Any +from _typeshed import Incomplete from warnings import warn as warn class StyleDescriptor: - collection: Any - key: Any + collection: Incomplete + key: Incomplete def __init__(self, collection, key) -> None: ... def __set__(self, instance, value) -> None: ... def __get__(self, instance, cls): ... @@ -21,23 +21,23 @@ class NamedStyleDescriptor: def __get__(self, instance, cls): ... class StyleArrayDescriptor: - key: Any + key: Incomplete def __init__(self, key) -> None: ... def __set__(self, instance, value) -> None: ... def __get__(self, instance, cls): ... class StyleableObject: - font: Any - fill: Any - border: Any - number_format: Any - protection: Any - alignment: Any - style: Any - quotePrefix: Any - pivotButton: Any - parent: Any - def __init__(self, sheet, style_array: Any | None = ...) -> None: ... + font: Incomplete + fill: Incomplete + border: Incomplete + number_format: Incomplete + protection: Incomplete + alignment: Incomplete + style: Incomplete + quotePrefix: Incomplete + pivotButton: Incomplete + parent: Incomplete + def __init__(self, sheet, style_array: Incomplete | None = ...) -> None: ... @property def style_id(self): ... @property diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/stylesheet.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/stylesheet.pyi index c7a44bd2d..3af63a891 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/stylesheet.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/stylesheet.pyi @@ -1,45 +1,45 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class Stylesheet(Serialisable): tagname: str - numFmts: Any - fonts: Any - fills: Any - borders: Any - cellStyleXfs: Any - cellXfs: Any - cellStyles: Any - dxfs: Any - tableStyles: Any - colors: Any - extLst: Any - __elements__: Any - number_formats: Any - cell_styles: Any - alignments: Any - protections: Any - named_styles: Any + numFmts: Incomplete + fonts: Incomplete + fills: Incomplete + borders: Incomplete + cellStyleXfs: Incomplete + cellXfs: Incomplete + cellStyles: Incomplete + dxfs: Incomplete + tableStyles: Incomplete + colors: Incomplete + extLst: Incomplete + __elements__: Incomplete + number_formats: Incomplete + cell_styles: Incomplete + alignments: Incomplete + protections: Incomplete + named_styles: Incomplete def __init__( self, - numFmts: Any | None = ..., + numFmts: Incomplete | None = ..., fonts=..., fills=..., borders=..., - cellStyleXfs: Any | None = ..., - cellXfs: Any | None = ..., - cellStyles: Any | None = ..., + cellStyleXfs: Incomplete | None = ..., + cellXfs: Incomplete | None = ..., + cellStyles: Incomplete | None = ..., dxfs=..., - tableStyles: Any | None = ..., - colors: Any | None = ..., - extLst: Any | None = ..., + tableStyles: Incomplete | None = ..., + colors: Incomplete | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... @classmethod def from_tree(cls, node): ... @property def custom_formats(self): ... - def to_tree(self, tagname: Any | None = ..., idx: Any | None = ..., namespace: Any | None = ...): ... + def to_tree(self, tagname: Incomplete | None = ..., idx: Incomplete | None = ..., namespace: Incomplete | None = ...): ... def apply_stylesheet(archive, wb): ... def write_stylesheet(wb): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/table.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/table.pyi index 329070137..eae5d3850 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/table.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/table.pyi @@ -1,40 +1,40 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class TableStyleElement(Serialisable): tagname: str - type: Any - size: Any - dxfId: Any - def __init__(self, type: Any | None = ..., size: Any | None = ..., dxfId: Any | None = ...) -> None: ... + type: Incomplete + size: Incomplete + dxfId: Incomplete + def __init__(self, type: Incomplete | None = ..., size: Incomplete | None = ..., dxfId: Incomplete | None = ...) -> None: ... class TableStyle(Serialisable): tagname: str - name: Any - pivot: Any - table: Any - count: Any - tableStyleElement: Any - __elements__: Any + name: Incomplete + pivot: Incomplete + table: Incomplete + count: Incomplete + tableStyleElement: Incomplete + __elements__: Incomplete def __init__( self, - name: Any | None = ..., - pivot: Any | None = ..., - table: Any | None = ..., - count: Any | None = ..., + name: Incomplete | None = ..., + pivot: Incomplete | None = ..., + table: Incomplete | None = ..., + count: Incomplete | None = ..., tableStyleElement=..., ) -> None: ... class TableStyleList(Serialisable): tagname: str - defaultTableStyle: Any - defaultPivotStyle: Any - tableStyle: Any - __elements__: Any - __attrs__: Any + defaultTableStyle: Incomplete + defaultPivotStyle: Incomplete + tableStyle: Incomplete + __elements__: Incomplete + __attrs__: Incomplete def __init__( - self, count: Any | None = ..., defaultTableStyle: str = ..., defaultPivotStyle: str = ..., tableStyle=... + self, count: Incomplete | None = ..., defaultTableStyle: str = ..., defaultPivotStyle: str = ..., tableStyle=... ) -> None: ... @property def count(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/bound_dictionary.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/bound_dictionary.pyi index 2edc1a8a4..71292228a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/bound_dictionary.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/bound_dictionary.pyi @@ -1,7 +1,7 @@ +from _typeshed import Incomplete from collections import defaultdict -from typing import Any -class BoundDictionary(defaultdict[Any, Any]): - reference: Any - def __init__(self, reference: Any | None = ..., *args, **kw) -> None: ... +class BoundDictionary(defaultdict[Incomplete, Incomplete]): + reference: Incomplete + def __init__(self, reference: Incomplete | None = ..., *args, **kw) -> None: ... def __getitem__(self, key): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/cell.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/cell.pyi index 6fc91f158..bddf718b7 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/cell.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/cell.pyi @@ -1,25 +1,25 @@ +from _typeshed import Incomplete from collections.abc import Generator -from typing import Any -COORD_RE: Any +COORD_RE: Incomplete COL_RANGE: str ROW_RANGE: str RANGE_EXPR: str -ABSOLUTE_RE: Any +ABSOLUTE_RE: Incomplete SHEET_TITLE: str -SHEETRANGE_RE: Any +SHEETRANGE_RE: Incomplete def get_column_interval(start: str | int, end: str | int) -> list[str]: ... def coordinate_from_string(coord_string: str) -> tuple[str, int]: ... def absolute_coordinate(coord_string: str) -> str: ... -col: Any +col: Incomplete def get_column_letter(idx: int) -> str: ... def column_index_from_string(str_col: str) -> int: ... def range_boundaries(range_string: str) -> tuple[int, int, int, int]: ... -def rows_from_range(range_string) -> Generator[Any, None, None]: ... -def cols_from_range(range_string) -> Generator[Any, None, None]: ... +def rows_from_range(range_string) -> Generator[Incomplete, None, None]: ... +def cols_from_range(range_string) -> Generator[Incomplete, None, None]: ... def coordinate_to_tuple(coordinate: str) -> tuple[int, int]: ... def range_to_tuple(range_string: str) -> tuple[str, tuple[int, int, int, int]]: ... def quote_sheetname(sheetname: str) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/dataframe.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/dataframe.pyi index 1f5dd0c7e..2f2938db5 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/dataframe.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/dataframe.pyi @@ -1,5 +1,5 @@ +from _typeshed import Incomplete from collections.abc import Generator -from typing import Any -def dataframe_to_rows(df, index: bool = ..., header: bool = ...) -> Generator[Any, None, None]: ... -def expand_index(index, header: bool = ...) -> Generator[Any, None, None]: ... +def dataframe_to_rows(df, index: bool = ..., header: bool = ...) -> Generator[Incomplete, None, None]: ... +def expand_index(index, header: bool = ...) -> Generator[Incomplete, None, None]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/datetime.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/datetime.pyi index f407d19df..1fc8bec4b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/datetime.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/datetime.pyi @@ -1,14 +1,14 @@ -from typing import Any +from _typeshed import Incomplete -MAC_EPOCH: Any -WINDOWS_EPOCH: Any +MAC_EPOCH: Incomplete +WINDOWS_EPOCH: Incomplete # The following two constants are defined twice in the implementation. CALENDAR_WINDOWS_1900 = WINDOWS_EPOCH # noqa: F821 CALENDAR_MAC_1904 = MAC_EPOCH # noqa: F821 SECS_PER_DAY: int ISO_FORMAT: str -ISO_REGEX: Any -ISO_DURATION: Any +ISO_REGEX: Incomplete +ISO_DURATION: Incomplete def to_ISO8601(dt): ... def from_ISO8601(formatted_string): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/formulas.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/formulas.pyi index 55742aa9e..8e49ec3ad 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/formulas.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/formulas.pyi @@ -1,3 +1,3 @@ -from typing import Any +from _typeshed import Incomplete -FORMULAE: Any +FORMULAE: Incomplete diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/indexed_list.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/indexed_list.pyi index 43c4516b2..00420455e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/indexed_list.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/indexed_list.pyi @@ -1,8 +1,8 @@ -from typing import Any +from _typeshed import Incomplete -class IndexedList(list[Any]): +class IndexedList(list[Incomplete]): clean: bool - def __init__(self, iterable: Any | None = ...) -> None: ... + def __init__(self, iterable: Incomplete | None = ...) -> None: ... def __contains__(self, value): ... def index(self, value): ... def append(self, value) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/inference.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/inference.pyi index 6eb88af41..b8411c805 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/inference.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/inference.pyi @@ -1,8 +1,8 @@ -from typing import Any +from _typeshed import Incomplete -PERCENT_REGEX: Any -TIME_REGEX: Any -NUMBER_REGEX: Any +PERCENT_REGEX: Incomplete +TIME_REGEX: Incomplete +NUMBER_REGEX: Incomplete def cast_numeric(value): ... def cast_percentage(value): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/units.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/units.pyi index 9f81dd769..dde205065 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/units.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/units.pyi @@ -1,8 +1,8 @@ -from typing import Any +from _typeshed import Incomplete DEFAULT_ROW_HEIGHT: float BASE_COL_WIDTH: int -DEFAULT_COLUMN_WIDTH: Any +DEFAULT_COLUMN_WIDTH: Incomplete DEFAULT_LEFT_MARGIN: float DEFAULT_TOP_MARGIN: float DEFAULT_HEADER: float diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/_writer.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/_writer.pyi index 5b2c00b6d..4789be9fd 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/_writer.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/_writer.pyi @@ -1,11 +1,11 @@ -from typing import Any +from _typeshed import Incomplete def get_active_sheet(wb): ... class WorkbookWriter: - wb: Any - rels: Any - package: Any + wb: Incomplete + rels: Incomplete + package: Incomplete def __init__(self, wb) -> None: ... def write_properties(self) -> None: ... def write_worksheets(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/child.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/child.pyi index 2c924f126..385ac4cd6 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/child.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/child.pyi @@ -1,12 +1,12 @@ -from typing import Any +from _typeshed import Incomplete -INVALID_TITLE_REGEX: Any +INVALID_TITLE_REGEX: Incomplete def avoid_duplicate_name(names, value): ... class _WorkbookChild: - HeaderFooter: Any - def __init__(self, parent: Any | None = ..., title: Any | None = ...) -> None: ... + HeaderFooter: Incomplete + def __init__(self, parent: Incomplete | None = ..., title: Incomplete | None = ...) -> None: ... @property def parent(self): ... @property diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/defined_name.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/defined_name.pyi index f4e2a781a..bc03e3b3f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/defined_name.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/defined_name.pyi @@ -1,73 +1,68 @@ +from _typeshed import Incomplete +from collections import defaultdict from collections.abc import Generator -from typing import Any +from re import Pattern +from openpyxl.descriptors import Sequence from openpyxl.descriptors.serialisable import Serialisable -RESERVED: Any -RESERVED_REGEX: Any -COL_RANGE: str -COL_RANGE_RE: Any -ROW_RANGE: str -ROW_RANGE_RE: Any -TITLES_REGEX: Any +RESERVED: frozenset[str] +RESERVED_REGEX: Pattern[str] class DefinedName(Serialisable): tagname: str - name: Any - comment: Any - customMenu: Any - description: Any - help: Any - statusBar: Any - localSheetId: Any - hidden: Any - function: Any - vbProcedure: Any - xlm: Any - functionGroupId: Any - shortcutKey: Any - publishToServer: Any - workbookParameter: Any - attr_text: Any - value: Any + name: Incomplete + comment: Incomplete + customMenu: Incomplete + description: Incomplete + help: Incomplete + statusBar: Incomplete + localSheetId: Incomplete + hidden: Incomplete + function: Incomplete + vbProcedure: Incomplete + xlm: Incomplete + functionGroupId: Incomplete + shortcutKey: Incomplete + publishToServer: Incomplete + workbookParameter: Incomplete + attr_text: Incomplete + value: Incomplete def __init__( self, - name: Any | None = ..., - comment: Any | None = ..., - customMenu: Any | None = ..., - description: Any | None = ..., - help: Any | None = ..., - statusBar: Any | None = ..., - localSheetId: Any | None = ..., - hidden: Any | None = ..., - function: Any | None = ..., - vbProcedure: Any | None = ..., - xlm: Any | None = ..., - functionGroupId: Any | None = ..., - shortcutKey: Any | None = ..., - publishToServer: Any | None = ..., - workbookParameter: Any | None = ..., - attr_text: Any | None = ..., + name: Incomplete | None = ..., + comment: Incomplete | None = ..., + customMenu: Incomplete | None = ..., + description: Incomplete | None = ..., + help: Incomplete | None = ..., + statusBar: Incomplete | None = ..., + localSheetId: Incomplete | None = ..., + hidden: Incomplete | None = ..., + function: Incomplete | None = ..., + vbProcedure: Incomplete | None = ..., + xlm: Incomplete | None = ..., + functionGroupId: Incomplete | None = ..., + shortcutKey: Incomplete | None = ..., + publishToServer: Incomplete | None = ..., + workbookParameter: Incomplete | None = ..., + attr_text: Incomplete | None = ..., ) -> None: ... @property def type(self): ... @property - def destinations(self) -> Generator[Any, None, None]: ... + def destinations(self) -> Generator[Incomplete, None, None]: ... @property def is_reserved(self): ... @property def is_external(self): ... def __iter__(self): ... +class DefinedNameDict(dict[str, DefinedName]): + def add(self, value: DefinedName) -> None: ... + class DefinedNameList(Serialisable): tagname: str - definedName: Any + definedName: Sequence def __init__(self, definedName=...) -> None: ... - def append(self, defn) -> None: ... - def __len__(self): ... - def __contains__(self, name): ... - def __getitem__(self, name): ... - def get(self, name, scope: Any | None = ...): ... - def __delitem__(self, name) -> None: ... - def delete(self, name, scope: Any | None = ...): ... - def localnames(self, scope): ... + def by_sheet(self) -> defaultdict[int, DefinedNameDict]: ... + def __len__(self) -> int: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/external_link/external.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/external_link/external.pyi index 3e5e7c898..49590a3a3 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/external_link/external.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/external_link/external.pyi @@ -1,63 +1,75 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class ExternalCell(Serialisable): # type: ignore[misc] - r: Any - t: Any - vm: Any - v: Any - def __init__(self, r: Any | None = ..., t: Any | None = ..., vm: Any | None = ..., v: Any | None = ...) -> None: ... + r: Incomplete + t: Incomplete + vm: Incomplete + v: Incomplete + def __init__( + self, r: Incomplete | None = ..., t: Incomplete | None = ..., vm: Incomplete | None = ..., v: Incomplete | None = ... + ) -> None: ... class ExternalRow(Serialisable): # type: ignore[misc] - r: Any - cell: Any - __elements__: Any - def __init__(self, r=..., cell: Any | None = ...) -> None: ... + r: Incomplete + cell: Incomplete + __elements__: Incomplete + def __init__(self, r=..., cell: Incomplete | None = ...) -> None: ... class ExternalSheetData(Serialisable): # type: ignore[misc] - sheetId: Any - refreshError: Any - row: Any - __elements__: Any - def __init__(self, sheetId: Any | None = ..., refreshError: Any | None = ..., row=...) -> None: ... + sheetId: Incomplete + refreshError: Incomplete + row: Incomplete + __elements__: Incomplete + def __init__(self, sheetId: Incomplete | None = ..., refreshError: Incomplete | None = ..., row=...) -> None: ... class ExternalSheetDataSet(Serialisable): # type: ignore[misc] - sheetData: Any - __elements__: Any - def __init__(self, sheetData: Any | None = ...) -> None: ... + sheetData: Incomplete + __elements__: Incomplete + def __init__(self, sheetData: Incomplete | None = ...) -> None: ... class ExternalSheetNames(Serialisable): # type: ignore[misc] - sheetName: Any - __elements__: Any + sheetName: Incomplete + __elements__: Incomplete def __init__(self, sheetName=...) -> None: ... class ExternalDefinedName(Serialisable): tagname: str - name: Any - refersTo: Any - sheetId: Any - def __init__(self, name: Any | None = ..., refersTo: Any | None = ..., sheetId: Any | None = ...) -> None: ... + name: Incomplete + refersTo: Incomplete + sheetId: Incomplete + def __init__( + self, name: Incomplete | None = ..., refersTo: Incomplete | None = ..., sheetId: Incomplete | None = ... + ) -> None: ... class ExternalBook(Serialisable): tagname: str - sheetNames: Any - definedNames: Any - sheetDataSet: Any - id: Any - __elements__: Any + sheetNames: Incomplete + definedNames: Incomplete + sheetDataSet: Incomplete + id: Incomplete + __elements__: Incomplete def __init__( - self, sheetNames: Any | None = ..., definedNames=..., sheetDataSet: Any | None = ..., id: Any | None = ... + self, + sheetNames: Incomplete | None = ..., + definedNames=..., + sheetDataSet: Incomplete | None = ..., + id: Incomplete | None = ..., ) -> None: ... class ExternalLink(Serialisable): tagname: str mime_type: str - externalBook: Any - file_link: Any - __elements__: Any + externalBook: Incomplete + file_link: Incomplete + __elements__: Incomplete def __init__( - self, externalBook: Any | None = ..., ddeLink: Any | None = ..., oleLink: Any | None = ..., extLst: Any | None = ... + self, + externalBook: Incomplete | None = ..., + ddeLink: Incomplete | None = ..., + oleLink: Incomplete | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... def to_tree(self): ... @property diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/external_reference.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/external_reference.pyi index 141dafe11..507b7acd6 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/external_reference.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/external_reference.pyi @@ -1,8 +1,8 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class ExternalReference(Serialisable): tagname: str - id: Any + id: Incomplete def __init__(self, id) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/function_group.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/function_group.pyi index 7ebcf0c2f..861dbf404 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/function_group.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/function_group.pyi @@ -1,15 +1,15 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class FunctionGroup(Serialisable): tagname: str - name: Any - def __init__(self, name: Any | None = ...) -> None: ... + name: Incomplete + def __init__(self, name: Incomplete | None = ...) -> None: ... class FunctionGroupList(Serialisable): tagname: str - builtInGroupCount: Any - functionGroup: Any - __elements__: Any + builtInGroupCount: Incomplete + functionGroup: Incomplete + __elements__: Incomplete def __init__(self, builtInGroupCount: int = ..., functionGroup=...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/properties.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/properties.pyi index 1ada0577d..91cc69fac 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/properties.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/properties.pyi @@ -1,95 +1,95 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class WorkbookProperties(Serialisable): tagname: str - date1904: Any - dateCompatibility: Any - showObjects: Any - showBorderUnselectedTables: Any - filterPrivacy: Any - promptedSolutions: Any - showInkAnnotation: Any - backupFile: Any - saveExternalLinkValues: Any - updateLinks: Any - codeName: Any - hidePivotFieldList: Any - showPivotChartFilter: Any - allowRefreshQuery: Any - publishItems: Any - checkCompatibility: Any - autoCompressPictures: Any - refreshAllConnections: Any - defaultThemeVersion: Any + date1904: Incomplete + dateCompatibility: Incomplete + showObjects: Incomplete + showBorderUnselectedTables: Incomplete + filterPrivacy: Incomplete + promptedSolutions: Incomplete + showInkAnnotation: Incomplete + backupFile: Incomplete + saveExternalLinkValues: Incomplete + updateLinks: Incomplete + codeName: Incomplete + hidePivotFieldList: Incomplete + showPivotChartFilter: Incomplete + allowRefreshQuery: Incomplete + publishItems: Incomplete + checkCompatibility: Incomplete + autoCompressPictures: Incomplete + refreshAllConnections: Incomplete + defaultThemeVersion: Incomplete def __init__( self, - date1904: Any | None = ..., - dateCompatibility: Any | None = ..., - showObjects: Any | None = ..., - showBorderUnselectedTables: Any | None = ..., - filterPrivacy: Any | None = ..., - promptedSolutions: Any | None = ..., - showInkAnnotation: Any | None = ..., - backupFile: Any | None = ..., - saveExternalLinkValues: Any | None = ..., - updateLinks: Any | None = ..., - codeName: Any | None = ..., - hidePivotFieldList: Any | None = ..., - showPivotChartFilter: Any | None = ..., - allowRefreshQuery: Any | None = ..., - publishItems: Any | None = ..., - checkCompatibility: Any | None = ..., - autoCompressPictures: Any | None = ..., - refreshAllConnections: Any | None = ..., - defaultThemeVersion: Any | None = ..., + date1904: Incomplete | None = ..., + dateCompatibility: Incomplete | None = ..., + showObjects: Incomplete | None = ..., + showBorderUnselectedTables: Incomplete | None = ..., + filterPrivacy: Incomplete | None = ..., + promptedSolutions: Incomplete | None = ..., + showInkAnnotation: Incomplete | None = ..., + backupFile: Incomplete | None = ..., + saveExternalLinkValues: Incomplete | None = ..., + updateLinks: Incomplete | None = ..., + codeName: Incomplete | None = ..., + hidePivotFieldList: Incomplete | None = ..., + showPivotChartFilter: Incomplete | None = ..., + allowRefreshQuery: Incomplete | None = ..., + publishItems: Incomplete | None = ..., + checkCompatibility: Incomplete | None = ..., + autoCompressPictures: Incomplete | None = ..., + refreshAllConnections: Incomplete | None = ..., + defaultThemeVersion: Incomplete | None = ..., ) -> None: ... class CalcProperties(Serialisable): tagname: str - calcId: Any - calcMode: Any - fullCalcOnLoad: Any - refMode: Any - iterate: Any - iterateCount: Any - iterateDelta: Any - fullPrecision: Any - calcCompleted: Any - calcOnSave: Any - concurrentCalc: Any - concurrentManualCount: Any - forceFullCalc: Any + calcId: Incomplete + calcMode: Incomplete + fullCalcOnLoad: Incomplete + refMode: Incomplete + iterate: Incomplete + iterateCount: Incomplete + iterateDelta: Incomplete + fullPrecision: Incomplete + calcCompleted: Incomplete + calcOnSave: Incomplete + concurrentCalc: Incomplete + concurrentManualCount: Incomplete + forceFullCalc: Incomplete def __init__( self, calcId: int = ..., - calcMode: Any | None = ..., + calcMode: Incomplete | None = ..., fullCalcOnLoad: bool = ..., - refMode: Any | None = ..., - iterate: Any | None = ..., - iterateCount: Any | None = ..., - iterateDelta: Any | None = ..., - fullPrecision: Any | None = ..., - calcCompleted: Any | None = ..., - calcOnSave: Any | None = ..., - concurrentCalc: Any | None = ..., - concurrentManualCount: Any | None = ..., - forceFullCalc: Any | None = ..., + refMode: Incomplete | None = ..., + iterate: Incomplete | None = ..., + iterateCount: Incomplete | None = ..., + iterateDelta: Incomplete | None = ..., + fullPrecision: Incomplete | None = ..., + calcCompleted: Incomplete | None = ..., + calcOnSave: Incomplete | None = ..., + concurrentCalc: Incomplete | None = ..., + concurrentManualCount: Incomplete | None = ..., + forceFullCalc: Incomplete | None = ..., ) -> None: ... class FileVersion(Serialisable): tagname: str - appName: Any - lastEdited: Any - lowestEdited: Any - rupBuild: Any - codeName: Any + appName: Incomplete + lastEdited: Incomplete + lowestEdited: Incomplete + rupBuild: Incomplete + codeName: Incomplete def __init__( self, - appName: Any | None = ..., - lastEdited: Any | None = ..., - lowestEdited: Any | None = ..., - rupBuild: Any | None = ..., - codeName: Any | None = ..., + appName: Incomplete | None = ..., + lastEdited: Incomplete | None = ..., + lowestEdited: Incomplete | None = ..., + rupBuild: Incomplete | None = ..., + codeName: Incomplete | None = ..., ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/protection.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/protection.pyi index 9d53fd649..44b18bf2b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/protection.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/protection.pyi @@ -1,45 +1,45 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class WorkbookProtection(Serialisable): tagname: str - workbook_password: Any - workbookPasswordCharacterSet: Any - revision_password: Any - revisionsPasswordCharacterSet: Any - lockStructure: Any - lock_structure: Any - lockWindows: Any - lock_windows: Any - lockRevision: Any - lock_revision: Any - revisionsAlgorithmName: Any - revisionsHashValue: Any - revisionsSaltValue: Any - revisionsSpinCount: Any - workbookAlgorithmName: Any - workbookHashValue: Any - workbookSaltValue: Any - workbookSpinCount: Any - __attrs__: Any + workbook_password: Incomplete + workbookPasswordCharacterSet: Incomplete + revision_password: Incomplete + revisionsPasswordCharacterSet: Incomplete + lockStructure: Incomplete + lock_structure: Incomplete + lockWindows: Incomplete + lock_windows: Incomplete + lockRevision: Incomplete + lock_revision: Incomplete + revisionsAlgorithmName: Incomplete + revisionsHashValue: Incomplete + revisionsSaltValue: Incomplete + revisionsSpinCount: Incomplete + workbookAlgorithmName: Incomplete + workbookHashValue: Incomplete + workbookSaltValue: Incomplete + workbookSpinCount: Incomplete + __attrs__: Incomplete def __init__( self, - workbookPassword: Any | None = ..., - workbookPasswordCharacterSet: Any | None = ..., - revisionsPassword: Any | None = ..., - revisionsPasswordCharacterSet: Any | None = ..., - lockStructure: Any | None = ..., - lockWindows: Any | None = ..., - lockRevision: Any | None = ..., - revisionsAlgorithmName: Any | None = ..., - revisionsHashValue: Any | None = ..., - revisionsSaltValue: Any | None = ..., - revisionsSpinCount: Any | None = ..., - workbookAlgorithmName: Any | None = ..., - workbookHashValue: Any | None = ..., - workbookSaltValue: Any | None = ..., - workbookSpinCount: Any | None = ..., + workbookPassword: Incomplete | None = ..., + workbookPasswordCharacterSet: Incomplete | None = ..., + revisionsPassword: Incomplete | None = ..., + revisionsPasswordCharacterSet: Incomplete | None = ..., + lockStructure: Incomplete | None = ..., + lockWindows: Incomplete | None = ..., + lockRevision: Incomplete | None = ..., + revisionsAlgorithmName: Incomplete | None = ..., + revisionsHashValue: Incomplete | None = ..., + revisionsSaltValue: Incomplete | None = ..., + revisionsSpinCount: Incomplete | None = ..., + workbookAlgorithmName: Incomplete | None = ..., + workbookHashValue: Incomplete | None = ..., + workbookSaltValue: Incomplete | None = ..., + workbookSpinCount: Incomplete | None = ..., ) -> None: ... def set_workbook_password(self, value: str = ..., already_hashed: bool = ...) -> None: ... @property @@ -58,20 +58,20 @@ DocumentSecurity = WorkbookProtection class FileSharing(Serialisable): tagname: str - readOnlyRecommended: Any - userName: Any - reservationPassword: Any - algorithmName: Any - hashValue: Any - saltValue: Any - spinCount: Any + readOnlyRecommended: Incomplete + userName: Incomplete + reservationPassword: Incomplete + algorithmName: Incomplete + hashValue: Incomplete + saltValue: Incomplete + spinCount: Incomplete def __init__( self, - readOnlyRecommended: Any | None = ..., - userName: Any | None = ..., - reservationPassword: Any | None = ..., - algorithmName: Any | None = ..., - hashValue: Any | None = ..., - saltValue: Any | None = ..., - spinCount: Any | None = ..., + readOnlyRecommended: Incomplete | None = ..., + userName: Incomplete | None = ..., + reservationPassword: Incomplete | None = ..., + algorithmName: Incomplete | None = ..., + hashValue: Incomplete | None = ..., + saltValue: Incomplete | None = ..., + spinCount: Incomplete | None = ..., ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/smart_tags.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/smart_tags.pyi index a538386fb..d5be770ca 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/smart_tags.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/smart_tags.pyi @@ -1,22 +1,24 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class SmartTag(Serialisable): tagname: str - namespaceUri: Any - name: Any - url: Any - def __init__(self, namespaceUri: Any | None = ..., name: Any | None = ..., url: Any | None = ...) -> None: ... + namespaceUri: Incomplete + name: Incomplete + url: Incomplete + def __init__( + self, namespaceUri: Incomplete | None = ..., name: Incomplete | None = ..., url: Incomplete | None = ... + ) -> None: ... class SmartTagList(Serialisable): tagname: str - smartTagType: Any - __elements__: Any + smartTagType: Incomplete + __elements__: Incomplete def __init__(self, smartTagType=...) -> None: ... class SmartTagProperties(Serialisable): tagname: str - embed: Any - show: Any - def __init__(self, embed: Any | None = ..., show: Any | None = ...) -> None: ... + embed: Incomplete + show: Incomplete + def __init__(self, embed: Incomplete | None = ..., show: Incomplete | None = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/views.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/views.pyi index e22514df3..1a6e8e0b7 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/views.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/views.pyi @@ -1,24 +1,24 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class BookView(Serialisable): tagname: str - visibility: Any - minimized: Any - showHorizontalScroll: Any - showVerticalScroll: Any - showSheetTabs: Any - xWindow: Any - yWindow: Any - windowWidth: Any - windowHeight: Any - tabRatio: Any - firstSheet: Any - activeTab: Any - autoFilterDateGrouping: Any - extLst: Any - __elements__: Any + visibility: Incomplete + minimized: Incomplete + showHorizontalScroll: Incomplete + showVerticalScroll: Incomplete + showSheetTabs: Incomplete + xWindow: Incomplete + yWindow: Incomplete + windowWidth: Incomplete + windowHeight: Incomplete + tabRatio: Incomplete + firstSheet: Incomplete + activeTab: Incomplete + autoFilterDateGrouping: Incomplete + extLst: Incomplete + __elements__: Incomplete def __init__( self, visibility: str = ..., @@ -26,70 +26,70 @@ class BookView(Serialisable): showHorizontalScroll: bool = ..., showVerticalScroll: bool = ..., showSheetTabs: bool = ..., - xWindow: Any | None = ..., - yWindow: Any | None = ..., - windowWidth: Any | None = ..., - windowHeight: Any | None = ..., + xWindow: Incomplete | None = ..., + yWindow: Incomplete | None = ..., + windowWidth: Incomplete | None = ..., + windowHeight: Incomplete | None = ..., tabRatio: int = ..., firstSheet: int = ..., activeTab: int = ..., autoFilterDateGrouping: bool = ..., - extLst: Any | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... class CustomWorkbookView(Serialisable): tagname: str - name: Any - guid: Any - autoUpdate: Any - mergeInterval: Any - changesSavedWin: Any - onlySync: Any - personalView: Any - includePrintSettings: Any - includeHiddenRowCol: Any - maximized: Any - minimized: Any - showHorizontalScroll: Any - showVerticalScroll: Any - showSheetTabs: Any - xWindow: Any - yWindow: Any - windowWidth: Any - windowHeight: Any - tabRatio: Any - activeSheetId: Any - showFormulaBar: Any - showStatusbar: Any - showComments: Any - showObjects: Any - extLst: Any - __elements__: Any + name: Incomplete + guid: Incomplete + autoUpdate: Incomplete + mergeInterval: Incomplete + changesSavedWin: Incomplete + onlySync: Incomplete + personalView: Incomplete + includePrintSettings: Incomplete + includeHiddenRowCol: Incomplete + maximized: Incomplete + minimized: Incomplete + showHorizontalScroll: Incomplete + showVerticalScroll: Incomplete + showSheetTabs: Incomplete + xWindow: Incomplete + yWindow: Incomplete + windowWidth: Incomplete + windowHeight: Incomplete + tabRatio: Incomplete + activeSheetId: Incomplete + showFormulaBar: Incomplete + showStatusbar: Incomplete + showComments: Incomplete + showObjects: Incomplete + extLst: Incomplete + __elements__: Incomplete def __init__( self, - name: Any | None = ..., - guid: Any | None = ..., - autoUpdate: Any | None = ..., - mergeInterval: Any | None = ..., - changesSavedWin: Any | None = ..., - onlySync: Any | None = ..., - personalView: Any | None = ..., - includePrintSettings: Any | None = ..., - includeHiddenRowCol: Any | None = ..., - maximized: Any | None = ..., - minimized: Any | None = ..., - showHorizontalScroll: Any | None = ..., - showVerticalScroll: Any | None = ..., - showSheetTabs: Any | None = ..., - xWindow: Any | None = ..., - yWindow: Any | None = ..., - windowWidth: Any | None = ..., - windowHeight: Any | None = ..., - tabRatio: Any | None = ..., - activeSheetId: Any | None = ..., - showFormulaBar: Any | None = ..., - showStatusbar: Any | None = ..., + name: Incomplete | None = ..., + guid: Incomplete | None = ..., + autoUpdate: Incomplete | None = ..., + mergeInterval: Incomplete | None = ..., + changesSavedWin: Incomplete | None = ..., + onlySync: Incomplete | None = ..., + personalView: Incomplete | None = ..., + includePrintSettings: Incomplete | None = ..., + includeHiddenRowCol: Incomplete | None = ..., + maximized: Incomplete | None = ..., + minimized: Incomplete | None = ..., + showHorizontalScroll: Incomplete | None = ..., + showVerticalScroll: Incomplete | None = ..., + showSheetTabs: Incomplete | None = ..., + xWindow: Incomplete | None = ..., + yWindow: Incomplete | None = ..., + windowWidth: Incomplete | None = ..., + windowHeight: Incomplete | None = ..., + tabRatio: Incomplete | None = ..., + activeSheetId: Incomplete | None = ..., + showFormulaBar: Incomplete | None = ..., + showStatusbar: Incomplete | None = ..., showComments: str = ..., showObjects: str = ..., - extLst: Any | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/web.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/web.pyi index 2aff3d6a6..0f80700aa 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/web.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/web.pyi @@ -1,55 +1,55 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class WebPublishObject(Serialisable): tagname: str - id: Any - divId: Any - sourceObject: Any - destinationFile: Any - title: Any - autoRepublish: Any + id: Incomplete + divId: Incomplete + sourceObject: Incomplete + destinationFile: Incomplete + title: Incomplete + autoRepublish: Incomplete def __init__( self, - id: Any | None = ..., - divId: Any | None = ..., - sourceObject: Any | None = ..., - destinationFile: Any | None = ..., - title: Any | None = ..., - autoRepublish: Any | None = ..., + id: Incomplete | None = ..., + divId: Incomplete | None = ..., + sourceObject: Incomplete | None = ..., + destinationFile: Incomplete | None = ..., + title: Incomplete | None = ..., + autoRepublish: Incomplete | None = ..., ) -> None: ... class WebPublishObjectList(Serialisable): tagname: str # Overwritten by property below # count: Integer - webPublishObject: Any - __elements__: Any - def __init__(self, count: Any | None = ..., webPublishObject=...) -> None: ... + webPublishObject: Incomplete + __elements__: Incomplete + def __init__(self, count: Incomplete | None = ..., webPublishObject=...) -> None: ... @property def count(self): ... class WebPublishing(Serialisable): tagname: str - css: Any - thicket: Any - longFileNames: Any - vml: Any - allowPng: Any - targetScreenSize: Any - dpi: Any - codePage: Any - characterSet: Any + css: Incomplete + thicket: Incomplete + longFileNames: Incomplete + vml: Incomplete + allowPng: Incomplete + targetScreenSize: Incomplete + dpi: Incomplete + codePage: Incomplete + characterSet: Incomplete def __init__( self, - css: Any | None = ..., - thicket: Any | None = ..., - longFileNames: Any | None = ..., - vml: Any | None = ..., - allowPng: Any | None = ..., + css: Incomplete | None = ..., + thicket: Incomplete | None = ..., + longFileNames: Incomplete | None = ..., + vml: Incomplete | None = ..., + allowPng: Incomplete | None = ..., targetScreenSize: str = ..., - dpi: Any | None = ..., - codePage: Any | None = ..., - characterSet: Any | None = ..., + dpi: Incomplete | None = ..., + codePage: Incomplete | None = ..., + characterSet: Incomplete | None = ..., ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/workbook.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/workbook.pyi index 0ce9d9be2..f0b673d72 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/workbook.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/workbook.pyi @@ -1,71 +1,78 @@ -from typing import Any +from _typeshed import Incomplete, StrPath +from collections.abc import Iterator +from datetime import datetime +from typing import IO -INTEGER_TYPES: Any +from openpyxl.chartsheet.chartsheet import Chartsheet +from openpyxl.styles.named_styles import NamedStyle +from openpyxl.workbook.child import _WorkbookChild +from openpyxl.worksheet._write_only import WriteOnlyWorksheet +from openpyxl.worksheet.worksheet import Worksheet + +INTEGER_TYPES: Incomplete class Workbook: template: bool path: str - defined_names: Any - properties: Any - security: Any - shared_strings: Any - loaded_theme: Any - vba_archive: Any + defined_names: Incomplete + properties: Incomplete + security: Incomplete + shared_strings: Incomplete + loaded_theme: Incomplete + vba_archive: Incomplete is_template: bool - code_name: Any + code_name: Incomplete encoding: str - iso_dates: Any - rels: Any - calculation: Any - views: Any + iso_dates: Incomplete + rels: Incomplete + calculation: Incomplete + views: Incomplete def __init__(self, write_only: bool = ..., iso_dates: bool = ...) -> None: ... @property - def epoch(self): ... + def epoch(self) -> datetime: ... @epoch.setter - def epoch(self, value) -> None: ... + def epoch(self, value: datetime) -> None: ... @property - def read_only(self): ... + def read_only(self) -> bool: ... @property - def data_only(self): ... + def data_only(self) -> bool: ... @property - def write_only(self): ... + def write_only(self) -> bool: ... @property - def excel_base_date(self): ... + def excel_base_date(self) -> datetime: ... @property - def active(self): ... + def active(self) -> _WorkbookChild | None: ... @active.setter - def active(self, value) -> None: ... - def create_sheet(self, title: Any | None = ..., index: Any | None = ...): ... - def move_sheet(self, sheet, offset: int = ...) -> None: ... - def remove(self, worksheet) -> None: ... - def remove_sheet(self, worksheet) -> None: ... - def create_chartsheet(self, title: Any | None = ..., index: Any | None = ...): ... - def get_sheet_by_name(self, name): ... - def __contains__(self, key): ... - def index(self, worksheet): ... - def get_index(self, worksheet): ... - def __getitem__(self, key): ... - def __delitem__(self, key) -> None: ... - def __iter__(self): ... - def get_sheet_names(self): ... + def active(self, value: _WorkbookChild | int) -> None: ... + def create_sheet(self, title: str | None = ..., index: int | None = ...): ... + def move_sheet(self, sheet: Worksheet | str, offset: int = ...) -> None: ... + def remove(self, worksheet: Worksheet) -> None: ... + def remove_sheet(self, worksheet: Worksheet) -> None: ... + def create_chartsheet(self, title: str | None = ..., index: int | None = ...) -> Chartsheet: ... + def get_sheet_by_name(self, name: str) -> Worksheet: ... + def __contains__(self, key: str) -> bool: ... + def index(self, worksheet: Worksheet) -> int: ... + def get_index(self, worksheet: Worksheet) -> int: ... + def __getitem__(self, key: str) -> Worksheet: ... + def __delitem__(self, key: str) -> None: ... + def __iter__(self) -> Iterator[Worksheet]: ... + def get_sheet_names(self) -> list[Worksheet]: ... @property - def worksheets(self): ... + def worksheets(self) -> list[Worksheet]: ... @property - def chartsheets(self): ... + def chartsheets(self) -> list[Chartsheet]: ... @property - def sheetnames(self): ... - def create_named_range(self, name, worksheet: Any | None = ..., value: Any | None = ..., scope: Any | None = ...) -> None: ... - def add_named_style(self, style) -> None: ... + def sheetnames(self) -> list[str]: ... + def create_named_range( + self, name: str, worksheet: Worksheet | None = ..., value: str | Incomplete | None = ..., scope: Incomplete | None = ... + ) -> None: ... + def add_named_style(self, style: NamedStyle) -> None: ... @property - def named_styles(self): ... - def get_named_ranges(self): ... - def add_named_range(self, named_range) -> None: ... - def get_named_range(self, name): ... - def remove_named_range(self, named_range) -> None: ... + def named_styles(self) -> list[str]: ... @property - def mime_type(self): ... - def save(self, filename) -> None: ... + def mime_type(self) -> str: ... + def save(self, filename: StrPath | IO[bytes]) -> None: ... @property - def style_names(self): ... - def copy_worksheet(self, from_worksheet): ... + def style_names(self) -> list[str]: ... + def copy_worksheet(self, from_worksheet: Worksheet) -> Worksheet | WriteOnlyWorksheet: ... def close(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/_read_only.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/_read_only.pyi index 256a4bc1e..7be203764 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/_read_only.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/_read_only.pyi @@ -1,18 +1,18 @@ -from typing import Any +from _typeshed import Incomplete def read_dimension(source): ... class ReadOnlyWorksheet: - cell: Any - iter_rows: Any + cell: Incomplete + iter_rows: Incomplete @property def values(self): ... @property def rows(self): ... - __getitem__: Any - __iter__: Any - parent: Any - title: Any + __getitem__: Incomplete + __iter__: Incomplete + parent: Incomplete + title: Incomplete sheet_state: str def __init__(self, parent_workbook, title, worksheet_path, shared_strings) -> None: ... def calculate_dimension(self, force: bool = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/_reader.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/_reader.pyi index a12256d3c..fc1d7028f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/_reader.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/_reader.pyi @@ -1,69 +1,84 @@ -from collections.abc import Generator -from typing import Any +import datetime +from _typeshed import Incomplete +from collections.abc import Container, Generator -CELL_TAG: Any -VALUE_TAG: Any -FORMULA_TAG: Any -MERGE_TAG: Any -INLINE_STRING: Any -COL_TAG: Any -ROW_TAG: Any -CF_TAG: Any -LEGACY_TAG: Any -PROT_TAG: Any -EXT_TAG: Any -HYPERLINK_TAG: Any -TABLE_TAG: Any -PRINT_TAG: Any -MARGINS_TAG: Any -PAGE_TAG: Any -HEADER_TAG: Any -FILTER_TAG: Any -VALIDATION_TAG: Any -PROPERTIES_TAG: Any -VIEWS_TAG: Any -FORMAT_TAG: Any -ROW_BREAK_TAG: Any -COL_BREAK_TAG: Any -SCENARIOS_TAG: Any -DATA_TAG: Any -DIMENSION_TAG: Any -CUSTOM_VIEWS_TAG: Any +from .hyperlink import HyperlinkList +from .pagebreak import ColBreak, RowBreak +from .protection import SheetProtection +from .table import TablePartList + +CELL_TAG: Incomplete +VALUE_TAG: Incomplete +FORMULA_TAG: Incomplete +MERGE_TAG: Incomplete +INLINE_STRING: Incomplete +COL_TAG: Incomplete +ROW_TAG: Incomplete +CF_TAG: Incomplete +LEGACY_TAG: Incomplete +PROT_TAG: Incomplete +EXT_TAG: Incomplete +HYPERLINK_TAG: Incomplete +TABLE_TAG: Incomplete +PRINT_TAG: Incomplete +MARGINS_TAG: Incomplete +PAGE_TAG: Incomplete +HEADER_TAG: Incomplete +FILTER_TAG: Incomplete +VALIDATION_TAG: Incomplete +PROPERTIES_TAG: Incomplete +VIEWS_TAG: Incomplete +FORMAT_TAG: Incomplete +ROW_BREAK_TAG: Incomplete +COL_BREAK_TAG: Incomplete +SCENARIOS_TAG: Incomplete +DATA_TAG: Incomplete +DIMENSION_TAG: Incomplete +CUSTOM_VIEWS_TAG: Incomplete class WorkSheetParser: - min_row: Any - epoch: Any - source: Any - shared_strings: Any - data_only: Any - shared_formulae: Any - array_formulae: Any + min_row: Incomplete | None + min_col: Incomplete | None + epoch: datetime.datetime + source: Incomplete + shared_strings: Incomplete + data_only: bool + shared_formulae: dict[Incomplete, Incomplete] row_counter: int - tables: Any - date_formats: Any - timedelta_formats: Any - row_dimensions: Any - column_dimensions: Any - number_formats: Any + col_counter: int + tables: TablePartList + date_formats: Container[Incomplete] + timedelta_formats: Container[Incomplete] + row_dimensions: dict[Incomplete, Incomplete] + column_dimensions: dict[Incomplete, Incomplete] + number_formats: list[Incomplete] keep_vba: bool - hyperlinks: Any - formatting: Any - legacy_drawing: Any - merged_cells: Any - row_breaks: Any - col_breaks: Any + hyperlinks: HyperlinkList + formatting: list[Incomplete] + legacy_drawing: Incomplete | None + merged_cells: Incomplete | None + row_breaks: RowBreak + col_breaks: ColBreak + rich_text: bool + protection: SheetProtection # initialized after call to parse_sheet_protection() + def __init__( - self, src, shared_strings, data_only: bool = ..., epoch=..., date_formats=..., timedelta_formats=... + self, + src, + shared_strings, + data_only: bool = False, + epoch: datetime.datetime = ..., + date_formats: Container[Incomplete] = ..., + timedelta_formats: Container[Incomplete] = ..., + rich_text: bool = False, ) -> None: ... - def parse(self) -> Generator[Any, None, None]: ... + def parse(self) -> Generator[Incomplete, None, None]: ... def parse_dimensions(self): ... - col_counter: Any def parse_cell(self, element): ... def parse_formula(self, element): ... def parse_column_dimensions(self, col) -> None: ... def parse_row(self, row): ... def parse_formatting(self, element) -> None: ... - protection: Any def parse_sheet_protection(self, element) -> None: ... def parse_extensions(self, element) -> None: ... def parse_legacy(self, element) -> None: ... @@ -72,10 +87,10 @@ class WorkSheetParser: def parse_custom_views(self, element) -> None: ... class WorksheetReader: - ws: Any - parser: Any - tables: Any - def __init__(self, ws, xml_source, shared_strings, data_only) -> None: ... + ws: Incomplete + parser: Incomplete + tables: Incomplete + def __init__(self, ws, xml_source, shared_strings, data_only, rich_text: bool) -> None: ... def bind_cells(self) -> None: ... def bind_formatting(self) -> None: ... def bind_tables(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/_write_only.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/_write_only.pyi index c89ed90e5..d2c5195e6 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/_write_only.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/_write_only.pyi @@ -1,20 +1,20 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.workbook.child import _WorkbookChild class WriteOnlyWorksheet(_WorkbookChild): - mime_type: Any - add_chart: Any - add_image: Any - add_table: Any + mime_type: Incomplete + add_chart: Incomplete + add_image: Incomplete + add_table: Incomplete @property def tables(self): ... @property def print_titles(self): ... - print_title_cols: Any - print_title_rows: Any - freeze_panes: Any - print_area: Any + print_title_cols: Incomplete + print_title_rows: Incomplete + freeze_panes: Incomplete + print_area: Incomplete @property def sheet_view(self): ... def __init__(self, parent, title) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/_writer.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/_writer.pyi index 0c41382c8..f5cc760b2 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/_writer.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/_writer.pyi @@ -1,15 +1,15 @@ +from _typeshed import Incomplete from collections.abc import Generator -from typing import Any -ALL_TEMP_FILES: Any +ALL_TEMP_FILES: Incomplete def create_temporary_file(suffix: str = ...): ... class WorksheetWriter: - ws: Any - out: Any - xf: Any - def __init__(self, ws, out: Any | None = ...) -> None: ... + ws: Incomplete + out: Incomplete + xf: Incomplete + def __init__(self, ws, out: Incomplete | None = ...) -> None: ... def write_properties(self) -> None: ... def write_dimensions(self) -> None: ... def write_format(self) -> None: ... @@ -35,7 +35,7 @@ class WorksheetWriter: def write_drawings(self) -> None: ... def write_legacy(self) -> None: ... def write_tables(self) -> None: ... - def get_stream(self) -> Generator[Any, Any, None]: ... + def get_stream(self) -> Generator[Incomplete, Incomplete, None]: ... def write_tail(self) -> None: ... def write(self) -> None: ... def close(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/cell_range.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/cell_range.pyi index 0074cfd5b..72edc3e29 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/cell_range.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/cell_range.pyi @@ -1,32 +1,32 @@ +from _typeshed import Incomplete from collections.abc import Generator -from typing import Any from openpyxl.descriptors import Strict from openpyxl.descriptors.serialisable import Serialisable class CellRange(Serialisable): # type: ignore[misc] - min_col: Any - min_row: Any - max_col: Any - max_row: Any - title: Any + min_col: Incomplete + min_row: Incomplete + max_col: Incomplete + max_row: Incomplete + title: Incomplete def __init__( self, - range_string: Any | None = ..., - min_col: Any | None = ..., - min_row: Any | None = ..., - max_col: Any | None = ..., - max_row: Any | None = ..., - title: Any | None = ..., + range_string: Incomplete | None = ..., + min_col: Incomplete | None = ..., + min_row: Incomplete | None = ..., + max_col: Incomplete | None = ..., + max_row: Incomplete | None = ..., + title: Incomplete | None = ..., ) -> None: ... @property def bounds(self): ... @property def coord(self): ... @property - def rows(self) -> Generator[Any, None, None]: ... + def rows(self) -> Generator[Incomplete, None, None]: ... @property - def cols(self) -> Generator[Any, None, None]: ... + def cols(self) -> Generator[Incomplete, None, None]: ... @property def cells(self): ... def __copy__(self): ... @@ -34,17 +34,17 @@ class CellRange(Serialisable): # type: ignore[misc] def __ne__(self, other): ... def __eq__(self, other): ... def issubset(self, other): ... - __le__: Any + __le__: Incomplete def __lt__(self, other): ... def issuperset(self, other): ... - __ge__: Any + __ge__: Incomplete def __contains__(self, coord): ... def __gt__(self, other): ... def isdisjoint(self, other): ... def intersection(self, other): ... - __and__: Any + __and__: Incomplete def union(self, other): ... - __or__: Any + __or__: Incomplete def __iter__(self): ... def expand(self, right: int = ..., down: int = ..., left: int = ..., up: int = ...) -> None: ... def shrink(self, right: int = ..., bottom: int = ..., left: int = ..., top: int = ...) -> None: ... @@ -60,14 +60,14 @@ class CellRange(Serialisable): # type: ignore[misc] def right(self): ... class MultiCellRange(Strict): - ranges: Any + ranges: Incomplete def __init__(self, ranges=...) -> None: ... def __contains__(self, coord): ... def add(self, coord) -> None: ... def __iadd__(self, coord): ... def __eq__(self, other): ... def __ne__(self, other): ... - def __bool__(self): ... + def __bool__(self) -> bool: ... def remove(self, coord) -> None: ... def __iter__(self): ... def __copy__(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/cell_watch.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/cell_watch.pyi index bddfaa2c4..35ebbda0f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/cell_watch.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/cell_watch.pyi @@ -1,14 +1,14 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class CellWatch(Serialisable): tagname: str - r: Any - def __init__(self, r: Any | None = ...) -> None: ... + r: Incomplete + def __init__(self, r: Incomplete | None = ...) -> None: ... class CellWatches(Serialisable): tagname: str - cellWatch: Any - __elements__: Any + cellWatch: Incomplete + __elements__: Incomplete def __init__(self, cellWatch=...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/controls.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/controls.pyi index dac0a45f8..f56d3ae3a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/controls.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/controls.pyi @@ -1,28 +1,28 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class ControlProperty(Serialisable): tagname: str - anchor: Any - locked: Any - defaultSize: Any - disabled: Any - recalcAlways: Any - uiObject: Any - autoFill: Any - autoLine: Any - autoPict: Any - macro: Any - altText: Any - linkedCell: Any - listFillRange: Any - cf: Any - id: Any - __elements__: Any + anchor: Incomplete + locked: Incomplete + defaultSize: Incomplete + disabled: Incomplete + recalcAlways: Incomplete + uiObject: Incomplete + autoFill: Incomplete + autoLine: Incomplete + autoPict: Incomplete + macro: Incomplete + altText: Incomplete + linkedCell: Incomplete + listFillRange: Incomplete + cf: Incomplete + id: Incomplete + __elements__: Incomplete def __init__( self, - anchor: Any | None = ..., + anchor: Incomplete | None = ..., locked: bool = ..., defaultSize: bool = ..., _print: bool = ..., @@ -32,24 +32,26 @@ class ControlProperty(Serialisable): autoFill: bool = ..., autoLine: bool = ..., autoPict: bool = ..., - macro: Any | None = ..., - altText: Any | None = ..., - linkedCell: Any | None = ..., - listFillRange: Any | None = ..., + macro: Incomplete | None = ..., + altText: Incomplete | None = ..., + linkedCell: Incomplete | None = ..., + listFillRange: Incomplete | None = ..., cf: str = ..., - id: Any | None = ..., + id: Incomplete | None = ..., ) -> None: ... class Control(Serialisable): tagname: str - controlPr: Any - shapeId: Any - name: Any - __elements__: Any - def __init__(self, controlPr: Any | None = ..., shapeId: Any | None = ..., name: Any | None = ...) -> None: ... + controlPr: Incomplete + shapeId: Incomplete + name: Incomplete + __elements__: Incomplete + def __init__( + self, controlPr: Incomplete | None = ..., shapeId: Incomplete | None = ..., name: Incomplete | None = ... + ) -> None: ... class Controls(Serialisable): tagname: str - control: Any - __elements__: Any + control: Incomplete + __elements__: Incomplete def __init__(self, control=...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/copier.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/copier.pyi index 728ea6309..5e8886fd7 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/copier.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/copier.pyi @@ -1,7 +1,7 @@ -from typing import Any +from _typeshed import Incomplete class WorksheetCopy: - source: Any - target: Any + source: Incomplete + target: Incomplete def __init__(self, source_worksheet, target_worksheet) -> None: ... def copy_worksheet(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/custom.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/custom.pyi index 2e7007cea..ba95ab03b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/custom.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/custom.pyi @@ -1,14 +1,14 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class CustomProperty(Serialisable): tagname: str - name: Any - def __init__(self, name: Any | None = ...) -> None: ... + name: Incomplete + def __init__(self, name: Incomplete | None = ...) -> None: ... class CustomProperties(Serialisable): tagname: str - customPr: Any - __elements__: Any + customPr: Incomplete + __elements__: Incomplete def __init__(self, customPr=...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/datavalidation.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/datavalidation.pyi index 2250abae8..51bc50b7d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/datavalidation.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/datavalidation.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable @@ -7,66 +7,66 @@ def expand_cell_ranges(range_string): ... class DataValidation(Serialisable): tagname: str - sqref: Any - cells: Any - ranges: Any - showErrorMessage: Any - showDropDown: Any - hide_drop_down: Any - showInputMessage: Any - allowBlank: Any - allow_blank: Any - errorTitle: Any - error: Any - promptTitle: Any - prompt: Any - formula1: Any - formula2: Any - type: Any - errorStyle: Any - imeMode: Any - operator: Any - validation_type: Any + sqref: Incomplete + cells: Incomplete + ranges: Incomplete + showErrorMessage: Incomplete + showDropDown: Incomplete + hide_drop_down: Incomplete + showInputMessage: Incomplete + allowBlank: Incomplete + allow_blank: Incomplete + errorTitle: Incomplete + error: Incomplete + promptTitle: Incomplete + prompt: Incomplete + formula1: Incomplete + formula2: Incomplete + type: Incomplete + errorStyle: Incomplete + imeMode: Incomplete + operator: Incomplete + validation_type: Incomplete def __init__( self, - type: Any | None = ..., - formula1: Any | None = ..., - formula2: Any | None = ..., + type: Incomplete | None = ..., + formula1: Incomplete | None = ..., + formula2: Incomplete | None = ..., showErrorMessage: bool = ..., showInputMessage: bool = ..., - showDropDown: Any | None = ..., - allowBlank: Any | None = ..., + showDropDown: Incomplete | None = ..., + allowBlank: Incomplete | None = ..., sqref=..., - promptTitle: Any | None = ..., - errorStyle: Any | None = ..., - error: Any | None = ..., - prompt: Any | None = ..., - errorTitle: Any | None = ..., - imeMode: Any | None = ..., - operator: Any | None = ..., - allow_blank: Any | None = ..., + promptTitle: Incomplete | None = ..., + errorStyle: Incomplete | None = ..., + error: Incomplete | None = ..., + prompt: Incomplete | None = ..., + errorTitle: Incomplete | None = ..., + imeMode: Incomplete | None = ..., + operator: Incomplete | None = ..., + allow_blank: Incomplete | None = ..., ) -> None: ... def add(self, cell) -> None: ... def __contains__(self, cell): ... class DataValidationList(Serialisable): tagname: str - disablePrompts: Any - xWindow: Any - yWindow: Any - dataValidation: Any - __elements__: Any - __attrs__: Any + disablePrompts: Incomplete + xWindow: Incomplete + yWindow: Incomplete + dataValidation: Incomplete + __elements__: Incomplete + __attrs__: Incomplete def __init__( self, - disablePrompts: Any | None = ..., - xWindow: Any | None = ..., - yWindow: Any | None = ..., - count: Any | None = ..., + disablePrompts: Incomplete | None = ..., + xWindow: Incomplete | None = ..., + yWindow: Incomplete | None = ..., + count: Incomplete | None = ..., dataValidation=..., ) -> None: ... @property def count(self): ... - def __len__(self): ... + def __len__(self) -> int: ... def append(self, dv) -> None: ... - def to_tree(self, tagname: Any | None = ...): ... # type: ignore[override] + def to_tree(self, tagname: Incomplete | None = ...): ... # type: ignore[override] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/dimensions.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/dimensions.pyi index 72a8343c7..8193a77bd 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/dimensions.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/dimensions.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors import Strict from openpyxl.descriptors.serialisable import Serialisable @@ -6,45 +6,45 @@ from openpyxl.styles.styleable import StyleableObject from openpyxl.utils.bound_dictionary import BoundDictionary class Dimension(Strict, StyleableObject): - __fields__: Any - index: Any - hidden: Any - outlineLevel: Any - outline_level: Any - collapsed: Any - style: Any + __fields__: Incomplete + index: Incomplete + hidden: Incomplete + outlineLevel: Incomplete + outline_level: Incomplete + collapsed: Incomplete + style: Incomplete def __init__( - self, index, hidden, outlineLevel, collapsed, worksheet, visible: bool = ..., style: Any | None = ... + self, index, hidden, outlineLevel, collapsed, worksheet, visible: bool = ..., style: Incomplete | None = ... ) -> None: ... def __iter__(self): ... def __copy__(self): ... class RowDimension(Dimension): - __fields__: Any - r: Any - s: Any - ht: Any - height: Any - thickBot: Any - thickTop: Any + __fields__: Incomplete + r: Incomplete + s: Incomplete + ht: Incomplete + height: Incomplete + thickBot: Incomplete + thickTop: Incomplete def __init__( self, worksheet, index: int = ..., - ht: Any | None = ..., - customHeight: Any | None = ..., - s: Any | None = ..., - customFormat: Any | None = ..., + ht: Incomplete | None = ..., + customHeight: Incomplete | None = ..., + s: Incomplete | None = ..., + customFormat: Incomplete | None = ..., hidden: bool = ..., outlineLevel: int = ..., - outline_level: Any | None = ..., + outline_level: Incomplete | None = ..., collapsed: bool = ..., - visible: Any | None = ..., - height: Any | None = ..., - r: Any | None = ..., - spans: Any | None = ..., - thickBot: Any | None = ..., - thickTop: Any | None = ..., + visible: Incomplete | None = ..., + height: Incomplete | None = ..., + r: Incomplete | None = ..., + spans: Incomplete | None = ..., + thickBot: Incomplete | None = ..., + thickTop: Incomplete | None = ..., **kw, ) -> None: ... @property @@ -53,14 +53,14 @@ class RowDimension(Dimension): def customHeight(self): ... class ColumnDimension(Dimension): - width: Any - bestFit: Any - auto_size: Any - index: Any - min: Any - max: Any - collapsed: Any - __fields__: Any + width: Incomplete + bestFit: Incomplete + auto_size: Incomplete + index: Incomplete + min: Incomplete + max: Incomplete + collapsed: Incomplete + __fields__: Incomplete def __init__( self, worksheet, @@ -69,14 +69,14 @@ class ColumnDimension(Dimension): bestFit: bool = ..., hidden: bool = ..., outlineLevel: int = ..., - outline_level: Any | None = ..., + outline_level: Incomplete | None = ..., collapsed: bool = ..., - style: Any | None = ..., - min: Any | None = ..., - max: Any | None = ..., + style: Incomplete | None = ..., + min: Incomplete | None = ..., + max: Incomplete | None = ..., customWidth: bool = ..., - visible: Any | None = ..., - auto_size: Any | None = ..., + visible: Incomplete | None = ..., + auto_size: Incomplete | None = ..., ) -> None: ... @property def customWidth(self): ... @@ -84,40 +84,40 @@ class ColumnDimension(Dimension): def to_tree(self): ... class DimensionHolder(BoundDictionary): - worksheet: Any - max_outline: Any - default_factory: Any - def __init__(self, worksheet, reference: str = ..., default_factory: Any | None = ...) -> None: ... - def group(self, start, end: Any | None = ..., outline_level: int = ..., hidden: bool = ...) -> None: ... + worksheet: Incomplete + max_outline: Incomplete + default_factory: Incomplete + def __init__(self, worksheet, reference: str = ..., default_factory: Incomplete | None = ...) -> None: ... + def group(self, start, end: Incomplete | None = ..., outline_level: int = ..., hidden: bool = ...) -> None: ... def to_tree(self): ... class SheetFormatProperties(Serialisable): tagname: str - baseColWidth: Any - defaultColWidth: Any - defaultRowHeight: Any - customHeight: Any - zeroHeight: Any - thickTop: Any - thickBottom: Any - outlineLevelRow: Any - outlineLevelCol: Any + baseColWidth: Incomplete + defaultColWidth: Incomplete + defaultRowHeight: Incomplete + customHeight: Incomplete + zeroHeight: Incomplete + thickTop: Incomplete + thickBottom: Incomplete + outlineLevelRow: Incomplete + outlineLevelCol: Incomplete def __init__( self, baseColWidth: int = ..., - defaultColWidth: Any | None = ..., + defaultColWidth: Incomplete | None = ..., defaultRowHeight: int = ..., - customHeight: Any | None = ..., - zeroHeight: Any | None = ..., - thickTop: Any | None = ..., - thickBottom: Any | None = ..., - outlineLevelRow: Any | None = ..., - outlineLevelCol: Any | None = ..., + customHeight: Incomplete | None = ..., + zeroHeight: Incomplete | None = ..., + thickTop: Incomplete | None = ..., + thickBottom: Incomplete | None = ..., + outlineLevelRow: Incomplete | None = ..., + outlineLevelCol: Incomplete | None = ..., ) -> None: ... class SheetDimension(Serialisable): tagname: str - ref: Any - def __init__(self, ref: Any | None = ...) -> None: ... + ref: Incomplete + def __init__(self, ref: Incomplete | None = ...) -> None: ... @property def boundaries(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/drawing.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/drawing.pyi index 4974b43ff..25de5747c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/drawing.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/drawing.pyi @@ -1,8 +1,8 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class Drawing(Serialisable): tagname: str - id: Any - def __init__(self, id: Any | None = ...) -> None: ... + id: Incomplete + def __init__(self, id: Incomplete | None = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/errors.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/errors.pyi index 0403543ec..0481d7662 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/errors.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/errors.pyi @@ -1,33 +1,33 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class Extension(Serialisable): tagname: str - uri: Any - def __init__(self, uri: Any | None = ...) -> None: ... + uri: Incomplete + def __init__(self, uri: Incomplete | None = ...) -> None: ... class ExtensionList(Serialisable): tagname: str - ext: Any - __elements__: Any + ext: Incomplete + __elements__: Incomplete def __init__(self, ext=...) -> None: ... class IgnoredError(Serialisable): tagname: str - sqref: Any - evalError: Any - twoDigitTextYear: Any - numberStoredAsText: Any - formula: Any - formulaRange: Any - unlockedFormula: Any - emptyCellReference: Any - listDataValidation: Any - calculatedColumn: Any + sqref: Incomplete + evalError: Incomplete + twoDigitTextYear: Incomplete + numberStoredAsText: Incomplete + formula: Incomplete + formulaRange: Incomplete + unlockedFormula: Incomplete + emptyCellReference: Incomplete + listDataValidation: Incomplete + calculatedColumn: Incomplete def __init__( self, - sqref: Any | None = ..., + sqref: Incomplete | None = ..., evalError: bool = ..., twoDigitTextYear: bool = ..., numberStoredAsText: bool = ..., @@ -41,7 +41,7 @@ class IgnoredError(Serialisable): class IgnoredErrors(Serialisable): tagname: str - ignoredError: Any - extLst: Any - __elements__: Any - def __init__(self, ignoredError=..., extLst: Any | None = ...) -> None: ... + ignoredError: Incomplete + extLst: Incomplete + __elements__: Incomplete + def __init__(self, ignoredError=..., extLst: Incomplete | None = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/filters.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/filters.pyi index 77a45c178..7526971d4 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/filters.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/filters.pyi @@ -1,166 +1,172 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class SortCondition(Serialisable): tagname: str - descending: Any - sortBy: Any - ref: Any - customList: Any - dxfId: Any - iconSet: Any - iconId: Any + descending: Incomplete + sortBy: Incomplete + ref: Incomplete + customList: Incomplete + dxfId: Incomplete + iconSet: Incomplete + iconId: Incomplete def __init__( self, - ref: Any | None = ..., - descending: Any | None = ..., - sortBy: Any | None = ..., - customList: Any | None = ..., - dxfId: Any | None = ..., - iconSet: Any | None = ..., - iconId: Any | None = ..., + ref: Incomplete | None = ..., + descending: Incomplete | None = ..., + sortBy: Incomplete | None = ..., + customList: Incomplete | None = ..., + dxfId: Incomplete | None = ..., + iconSet: Incomplete | None = ..., + iconId: Incomplete | None = ..., ) -> None: ... class SortState(Serialisable): tagname: str - columnSort: Any - caseSensitive: Any - sortMethod: Any - ref: Any - sortCondition: Any - extLst: Any - __elements__: Any + columnSort: Incomplete + caseSensitive: Incomplete + sortMethod: Incomplete + ref: Incomplete + sortCondition: Incomplete + extLst: Incomplete + __elements__: Incomplete def __init__( self, - columnSort: Any | None = ..., - caseSensitive: Any | None = ..., - sortMethod: Any | None = ..., - ref: Any | None = ..., + columnSort: Incomplete | None = ..., + caseSensitive: Incomplete | None = ..., + sortMethod: Incomplete | None = ..., + ref: Incomplete | None = ..., sortCondition=..., - extLst: Any | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... - def __bool__(self): ... + def __bool__(self) -> bool: ... class IconFilter(Serialisable): tagname: str - iconSet: Any - iconId: Any - def __init__(self, iconSet: Any | None = ..., iconId: Any | None = ...) -> None: ... + iconSet: Incomplete + iconId: Incomplete + def __init__(self, iconSet: Incomplete | None = ..., iconId: Incomplete | None = ...) -> None: ... class ColorFilter(Serialisable): tagname: str - dxfId: Any - cellColor: Any - def __init__(self, dxfId: Any | None = ..., cellColor: Any | None = ...) -> None: ... + dxfId: Incomplete + cellColor: Incomplete + def __init__(self, dxfId: Incomplete | None = ..., cellColor: Incomplete | None = ...) -> None: ... class DynamicFilter(Serialisable): tagname: str - type: Any - val: Any - valIso: Any - maxVal: Any - maxValIso: Any + type: Incomplete + val: Incomplete + valIso: Incomplete + maxVal: Incomplete + maxValIso: Incomplete def __init__( self, - type: Any | None = ..., - val: Any | None = ..., - valIso: Any | None = ..., - maxVal: Any | None = ..., - maxValIso: Any | None = ..., + type: Incomplete | None = ..., + val: Incomplete | None = ..., + valIso: Incomplete | None = ..., + maxVal: Incomplete | None = ..., + maxValIso: Incomplete | None = ..., ) -> None: ... class CustomFilter(Serialisable): tagname: str - operator: Any - val: Any - def __init__(self, operator: Any | None = ..., val: Any | None = ...) -> None: ... + operator: Incomplete + val: Incomplete + def __init__(self, operator: Incomplete | None = ..., val: Incomplete | None = ...) -> None: ... class CustomFilters(Serialisable): tagname: str - customFilter: Any - __elements__: Any - def __init__(self, _and: Any | None = ..., customFilter=...) -> None: ... + customFilter: Incomplete + __elements__: Incomplete + def __init__(self, _and: Incomplete | None = ..., customFilter=...) -> None: ... class Top10(Serialisable): tagname: str - top: Any - percent: Any - val: Any - filterVal: Any + top: Incomplete + percent: Incomplete + val: Incomplete + filterVal: Incomplete def __init__( - self, top: Any | None = ..., percent: Any | None = ..., val: Any | None = ..., filterVal: Any | None = ... + self, + top: Incomplete | None = ..., + percent: Incomplete | None = ..., + val: Incomplete | None = ..., + filterVal: Incomplete | None = ..., ) -> None: ... class DateGroupItem(Serialisable): tagname: str - year: Any - month: Any - day: Any - hour: Any - minute: Any - second: Any - dateTimeGrouping: Any + year: Incomplete + month: Incomplete + day: Incomplete + hour: Incomplete + minute: Incomplete + second: Incomplete + dateTimeGrouping: Incomplete def __init__( self, - year: Any | None = ..., - month: Any | None = ..., - day: Any | None = ..., - hour: Any | None = ..., - minute: Any | None = ..., - second: Any | None = ..., - dateTimeGrouping: Any | None = ..., + year: Incomplete | None = ..., + month: Incomplete | None = ..., + day: Incomplete | None = ..., + hour: Incomplete | None = ..., + minute: Incomplete | None = ..., + second: Incomplete | None = ..., + dateTimeGrouping: Incomplete | None = ..., ) -> None: ... class Filters(Serialisable): tagname: str - blank: Any - calendarType: Any - filter: Any - dateGroupItem: Any - __elements__: Any - def __init__(self, blank: Any | None = ..., calendarType: Any | None = ..., filter=..., dateGroupItem=...) -> None: ... + blank: Incomplete + calendarType: Incomplete + filter: Incomplete + dateGroupItem: Incomplete + __elements__: Incomplete + def __init__( + self, blank: Incomplete | None = ..., calendarType: Incomplete | None = ..., filter=..., dateGroupItem=... + ) -> None: ... class FilterColumn(Serialisable): tagname: str - colId: Any - col_id: Any - hiddenButton: Any - showButton: Any - filters: Any - top10: Any - customFilters: Any - dynamicFilter: Any - colorFilter: Any - iconFilter: Any - extLst: Any - __elements__: Any + colId: Incomplete + col_id: Incomplete + hiddenButton: Incomplete + showButton: Incomplete + filters: Incomplete + top10: Incomplete + customFilters: Incomplete + dynamicFilter: Incomplete + colorFilter: Incomplete + iconFilter: Incomplete + extLst: Incomplete + __elements__: Incomplete def __init__( self, - colId: Any | None = ..., - hiddenButton: Any | None = ..., - showButton: Any | None = ..., - filters: Any | None = ..., - top10: Any | None = ..., - customFilters: Any | None = ..., - dynamicFilter: Any | None = ..., - colorFilter: Any | None = ..., - iconFilter: Any | None = ..., - extLst: Any | None = ..., - blank: Any | None = ..., - vals: Any | None = ..., + colId: Incomplete | None = ..., + hiddenButton: Incomplete | None = ..., + showButton: Incomplete | None = ..., + filters: Incomplete | None = ..., + top10: Incomplete | None = ..., + customFilters: Incomplete | None = ..., + dynamicFilter: Incomplete | None = ..., + colorFilter: Incomplete | None = ..., + iconFilter: Incomplete | None = ..., + extLst: Incomplete | None = ..., + blank: Incomplete | None = ..., + vals: Incomplete | None = ..., ) -> None: ... class AutoFilter(Serialisable): tagname: str - ref: Any - filterColumn: Any - sortState: Any - extLst: Any - __elements__: Any + ref: Incomplete + filterColumn: Incomplete + sortState: Incomplete + extLst: Incomplete + __elements__: Incomplete def __init__( - self, ref: Any | None = ..., filterColumn=..., sortState: Any | None = ..., extLst: Any | None = ... + self, ref: Incomplete | None = ..., filterColumn=..., sortState: Incomplete | None = ..., extLst: Incomplete | None = ... ) -> None: ... - def __bool__(self): ... + def __bool__(self) -> bool: ... def add_filter_column(self, col_id, vals, blank: bool = ...) -> None: ... def add_sort_condition(self, ref, descending: bool = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/formula.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/formula.pyi new file mode 100644 index 000000000..78b762cf5 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/formula.pyi @@ -0,0 +1,37 @@ +from _typeshed import Incomplete +from collections.abc import Iterator +from typing import ClassVar + +class DataTableFormula: + t: ClassVar[str] + + ref: Incomplete + ca: bool + dt2D: bool + dtr: bool + r1: Incomplete | None + r2: Incomplete | None + del1: bool + del2: bool + + def __init__( + self, + ref, + ca: bool = False, + dt2D: bool = False, + dtr: bool = False, + r1: Incomplete | None = None, + r2: Incomplete | None = None, + del1: bool = False, + del2: bool = False, + **kw, + ) -> None: ... + def __iter__(self) -> Iterator[tuple[str, str]]: ... + +class ArrayFormula: + t: ClassVar[str] + ref: Incomplete + text: Incomplete | None + + def __init__(self, ref, text: Incomplete | None = None) -> None: ... + def __iter__(self) -> Iterator[tuple[str, str]]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/header_footer.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/header_footer.pyi index 3f09bbdf8..3c4767707 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/header_footer.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/header_footer.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors import Strict from openpyxl.descriptors.serialisable import Serialisable @@ -6,56 +6,62 @@ from openpyxl.descriptors.serialisable import Serialisable FONT_PATTERN: str COLOR_PATTERN: str SIZE_REGEX: str -FORMAT_REGEX: Any +FORMAT_REGEX: Incomplete class _HeaderFooterPart(Strict): - text: Any - font: Any - size: Any + text: Incomplete + font: Incomplete + size: Incomplete RGB: str - color: Any + color: Incomplete def __init__( - self, text: Any | None = ..., font: Any | None = ..., size: Any | None = ..., color: Any | None = ... + self, + text: Incomplete | None = ..., + font: Incomplete | None = ..., + size: Incomplete | None = ..., + color: Incomplete | None = ..., ) -> None: ... - def __bool__(self): ... + def __bool__(self) -> bool: ... @classmethod def from_str(cls, text): ... class HeaderFooterItem(Strict): - left: Any - center: Any - centre: Any - right: Any - def __init__(self, left: Any | None = ..., right: Any | None = ..., center: Any | None = ...) -> None: ... - def __bool__(self): ... + left: Incomplete + center: Incomplete + centre: Incomplete + right: Incomplete + def __init__( + self, left: Incomplete | None = ..., right: Incomplete | None = ..., center: Incomplete | None = ... + ) -> None: ... + def __bool__(self) -> bool: ... def to_tree(self, tagname): ... @classmethod def from_tree(cls, node): ... class HeaderFooter(Serialisable): tagname: str - differentOddEven: Any - differentFirst: Any - scaleWithDoc: Any - alignWithMargins: Any - oddHeader: Any - oddFooter: Any - evenHeader: Any - evenFooter: Any - firstHeader: Any - firstFooter: Any - __elements__: Any + differentOddEven: Incomplete + differentFirst: Incomplete + scaleWithDoc: Incomplete + alignWithMargins: Incomplete + oddHeader: Incomplete + oddFooter: Incomplete + evenHeader: Incomplete + evenFooter: Incomplete + firstHeader: Incomplete + firstFooter: Incomplete + __elements__: Incomplete def __init__( self, - differentOddEven: Any | None = ..., - differentFirst: Any | None = ..., - scaleWithDoc: Any | None = ..., - alignWithMargins: Any | None = ..., - oddHeader: Any | None = ..., - oddFooter: Any | None = ..., - evenHeader: Any | None = ..., - evenFooter: Any | None = ..., - firstHeader: Any | None = ..., - firstFooter: Any | None = ..., + differentOddEven: Incomplete | None = ..., + differentFirst: Incomplete | None = ..., + scaleWithDoc: Incomplete | None = ..., + alignWithMargins: Incomplete | None = ..., + oddHeader: Incomplete | None = ..., + oddFooter: Incomplete | None = ..., + evenHeader: Incomplete | None = ..., + evenFooter: Incomplete | None = ..., + firstHeader: Incomplete | None = ..., + firstFooter: Incomplete | None = ..., ) -> None: ... - def __bool__(self): ... + def __bool__(self) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/hyperlink.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/hyperlink.pyi index 3ec7b5b05..ebf821ad1 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/hyperlink.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/hyperlink.pyi @@ -1,30 +1,30 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class Hyperlink(Serialisable): tagname: str - ref: Any - location: Any - tooltip: Any - display: Any - id: Any - target: Any - __attrs__: Any + ref: Incomplete + location: Incomplete + tooltip: Incomplete + display: Incomplete + id: Incomplete + target: Incomplete + __attrs__: Incomplete def __init__( self, - ref: Any | None = ..., - location: Any | None = ..., - tooltip: Any | None = ..., - display: Any | None = ..., - id: Any | None = ..., - target: Any | None = ..., + ref: Incomplete | None = ..., + location: Incomplete | None = ..., + tooltip: Incomplete | None = ..., + display: Incomplete | None = ..., + id: Incomplete | None = ..., + target: Incomplete | None = ..., ) -> None: ... class HyperlinkList(Serialisable): tagname: str - hyperlink: Any + hyperlink: Incomplete def __init__(self, hyperlink=...) -> None: ... - def __bool__(self): ... - def __len__(self): ... + def __bool__(self) -> bool: ... + def __len__(self) -> int: ... def append(self, value) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/merge.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/merge.pyi index ed70a5e75..2c7ca0a0b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/merge.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/merge.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable @@ -8,24 +8,24 @@ class MergeCell(CellRange): tagname: str @property def ref(self): ... - __attrs__: Any - def __init__(self, ref: Any | None = ...) -> None: ... + __attrs__: Incomplete + def __init__(self, ref: Incomplete | None = ...) -> None: ... def __copy__(self): ... class MergeCells(Serialisable): tagname: str # Overwritten by property below # count: Integer - mergeCell: Any - __elements__: Any - __attrs__: Any - def __init__(self, count: Any | None = ..., mergeCell=...) -> None: ... + mergeCell: Incomplete + __elements__: Incomplete + __attrs__: Incomplete + def __init__(self, count: Incomplete | None = ..., mergeCell=...) -> None: ... @property def count(self): ... class MergedCellRange(CellRange): - ws: Any - start_cell: Any + ws: Incomplete + start_cell: Incomplete def __init__(self, worksheet, coord) -> None: ... def format(self) -> None: ... def __contains__(self, coord): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/ole.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/ole.pyi index 04270d802..ce36b5172 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/ole.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/ole.pyi @@ -1,39 +1,39 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class ObjectAnchor(Serialisable): tagname: str - to: Any - moveWithCells: Any - sizeWithCells: Any - z_order: Any + to: Incomplete + moveWithCells: Incomplete + sizeWithCells: Incomplete + z_order: Incomplete def __init__( self, - _from: Any | None = ..., - to: Any | None = ..., + _from: Incomplete | None = ..., + to: Incomplete | None = ..., moveWithCells: bool = ..., sizeWithCells: bool = ..., - z_order: Any | None = ..., + z_order: Incomplete | None = ..., ) -> None: ... class ObjectPr(Serialisable): tagname: str - anchor: Any - locked: Any - defaultSize: Any - disabled: Any - uiObject: Any - autoFill: Any - autoLine: Any - autoPict: Any - macro: Any - altText: Any - dde: Any - __elements__: Any + anchor: Incomplete + locked: Incomplete + defaultSize: Incomplete + disabled: Incomplete + uiObject: Incomplete + autoFill: Incomplete + autoLine: Incomplete + autoPict: Incomplete + macro: Incomplete + altText: Incomplete + dde: Incomplete + __elements__: Incomplete def __init__( self, - anchor: Any | None = ..., + anchor: Incomplete | None = ..., locked: bool = ..., defaultSize: bool = ..., _print: bool = ..., @@ -42,34 +42,34 @@ class ObjectPr(Serialisable): autoFill: bool = ..., autoLine: bool = ..., autoPict: bool = ..., - macro: Any | None = ..., - altText: Any | None = ..., + macro: Incomplete | None = ..., + altText: Incomplete | None = ..., dde: bool = ..., ) -> None: ... class OleObject(Serialisable): tagname: str - objectPr: Any - progId: Any - dvAspect: Any - link: Any - oleUpdate: Any - autoLoad: Any - shapeId: Any - __elements__: Any + objectPr: Incomplete + progId: Incomplete + dvAspect: Incomplete + link: Incomplete + oleUpdate: Incomplete + autoLoad: Incomplete + shapeId: Incomplete + __elements__: Incomplete def __init__( self, - objectPr: Any | None = ..., - progId: Any | None = ..., + objectPr: Incomplete | None = ..., + progId: Incomplete | None = ..., dvAspect: str = ..., - link: Any | None = ..., - oleUpdate: Any | None = ..., + link: Incomplete | None = ..., + oleUpdate: Incomplete | None = ..., autoLoad: bool = ..., - shapeId: Any | None = ..., + shapeId: Incomplete | None = ..., ) -> None: ... class OleObjects(Serialisable): tagname: str - oleObject: Any - __elements__: Any + oleObject: Incomplete + __elements__: Incomplete def __init__(self, oleObject=...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/page.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/page.pyi index 19b0f0a95..c81b5f284 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/page.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/page.pyi @@ -1,52 +1,52 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class PrintPageSetup(Serialisable): tagname: str - orientation: Any - paperSize: Any - scale: Any - fitToHeight: Any - fitToWidth: Any - firstPageNumber: Any - useFirstPageNumber: Any - paperHeight: Any - paperWidth: Any - pageOrder: Any - usePrinterDefaults: Any - blackAndWhite: Any - draft: Any - cellComments: Any - errors: Any - horizontalDpi: Any - verticalDpi: Any - copies: Any - id: Any + orientation: Incomplete + paperSize: Incomplete + scale: Incomplete + fitToHeight: Incomplete + fitToWidth: Incomplete + firstPageNumber: Incomplete + useFirstPageNumber: Incomplete + paperHeight: Incomplete + paperWidth: Incomplete + pageOrder: Incomplete + usePrinterDefaults: Incomplete + blackAndWhite: Incomplete + draft: Incomplete + cellComments: Incomplete + errors: Incomplete + horizontalDpi: Incomplete + verticalDpi: Incomplete + copies: Incomplete + id: Incomplete def __init__( self, - worksheet: Any | None = ..., - orientation: Any | None = ..., - paperSize: Any | None = ..., - scale: Any | None = ..., - fitToHeight: Any | None = ..., - fitToWidth: Any | None = ..., - firstPageNumber: Any | None = ..., - useFirstPageNumber: Any | None = ..., - paperHeight: Any | None = ..., - paperWidth: Any | None = ..., - pageOrder: Any | None = ..., - usePrinterDefaults: Any | None = ..., - blackAndWhite: Any | None = ..., - draft: Any | None = ..., - cellComments: Any | None = ..., - errors: Any | None = ..., - horizontalDpi: Any | None = ..., - verticalDpi: Any | None = ..., - copies: Any | None = ..., - id: Any | None = ..., + worksheet: Incomplete | None = ..., + orientation: Incomplete | None = ..., + paperSize: Incomplete | None = ..., + scale: Incomplete | None = ..., + fitToHeight: Incomplete | None = ..., + fitToWidth: Incomplete | None = ..., + firstPageNumber: Incomplete | None = ..., + useFirstPageNumber: Incomplete | None = ..., + paperHeight: Incomplete | None = ..., + paperWidth: Incomplete | None = ..., + pageOrder: Incomplete | None = ..., + usePrinterDefaults: Incomplete | None = ..., + blackAndWhite: Incomplete | None = ..., + draft: Incomplete | None = ..., + cellComments: Incomplete | None = ..., + errors: Incomplete | None = ..., + horizontalDpi: Incomplete | None = ..., + verticalDpi: Incomplete | None = ..., + copies: Incomplete | None = ..., + id: Incomplete | None = ..., ) -> None: ... - def __bool__(self): ... + def __bool__(self) -> bool: ... @property def sheet_properties(self): ... @property @@ -62,29 +62,29 @@ class PrintPageSetup(Serialisable): class PrintOptions(Serialisable): tagname: str - horizontalCentered: Any - verticalCentered: Any - headings: Any - gridLines: Any - gridLinesSet: Any + horizontalCentered: Incomplete + verticalCentered: Incomplete + headings: Incomplete + gridLines: Incomplete + gridLinesSet: Incomplete def __init__( self, - horizontalCentered: Any | None = ..., - verticalCentered: Any | None = ..., - headings: Any | None = ..., - gridLines: Any | None = ..., - gridLinesSet: Any | None = ..., + horizontalCentered: Incomplete | None = ..., + verticalCentered: Incomplete | None = ..., + headings: Incomplete | None = ..., + gridLines: Incomplete | None = ..., + gridLinesSet: Incomplete | None = ..., ) -> None: ... - def __bool__(self): ... + def __bool__(self) -> bool: ... class PageMargins(Serialisable): tagname: str - left: Any - right: Any - top: Any - bottom: Any - header: Any - footer: Any + left: Incomplete + right: Incomplete + top: Incomplete + bottom: Incomplete + header: Incomplete + footer: Incomplete def __init__( self, left: float = ..., right: float = ..., top: int = ..., bottom: int = ..., header: float = ..., footer: float = ... ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/pagebreak.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/pagebreak.pyi index 4fdcaa279..c1e6420ff 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/pagebreak.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/pagebreak.pyi @@ -1,32 +1,32 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class Break(Serialisable): tagname: str - id: Any - min: Any - max: Any - man: Any - pt: Any - def __init__(self, id: int = ..., min: int = ..., max: int = ..., man: bool = ..., pt: Any | None = ...) -> None: ... + id: Incomplete + min: Incomplete + max: Incomplete + man: Incomplete + pt: Incomplete + def __init__(self, id: int = ..., min: int = ..., max: int = ..., man: bool = ..., pt: Incomplete | None = ...) -> None: ... class RowBreak(Serialisable): tagname: str # Overwritten by properties below # count: Integer # manualBreakCount: Integer - brk: Any - __elements__: Any - __attrs__: Any - def __init__(self, count: Any | None = ..., manualBreakCount: Any | None = ..., brk=...) -> None: ... - def __bool__(self): ... - def __len__(self): ... + brk: Incomplete + __elements__: Incomplete + __attrs__: Incomplete + def __init__(self, count: Incomplete | None = ..., manualBreakCount: Incomplete | None = ..., brk=...) -> None: ... + def __bool__(self) -> bool: ... + def __len__(self) -> int: ... @property def count(self): ... @property def manualBreakCount(self): ... - def append(self, brk: Any | None = ...) -> None: ... + def append(self, brk: Incomplete | None = ...) -> None: ... PageBreak = RowBreak @@ -36,5 +36,5 @@ class ColBreak(RowBreak): def count(self): ... @property def manualBreakCount(self): ... - brk: Any - __attrs__: Any + brk: Incomplete + __attrs__: Incomplete diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/properties.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/properties.pyi index 1b9f0a50a..37cbdac17 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/properties.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/properties.pyi @@ -1,54 +1,54 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class Outline(Serialisable): tagname: str - applyStyles: Any - summaryBelow: Any - summaryRight: Any - showOutlineSymbols: Any + applyStyles: Incomplete + summaryBelow: Incomplete + summaryRight: Incomplete + showOutlineSymbols: Incomplete def __init__( self, - applyStyles: Any | None = ..., - summaryBelow: Any | None = ..., - summaryRight: Any | None = ..., - showOutlineSymbols: Any | None = ..., + applyStyles: Incomplete | None = ..., + summaryBelow: Incomplete | None = ..., + summaryRight: Incomplete | None = ..., + showOutlineSymbols: Incomplete | None = ..., ) -> None: ... class PageSetupProperties(Serialisable): tagname: str - autoPageBreaks: Any - fitToPage: Any - def __init__(self, autoPageBreaks: Any | None = ..., fitToPage: Any | None = ...) -> None: ... + autoPageBreaks: Incomplete + fitToPage: Incomplete + def __init__(self, autoPageBreaks: Incomplete | None = ..., fitToPage: Incomplete | None = ...) -> None: ... class WorksheetProperties(Serialisable): tagname: str - codeName: Any - enableFormatConditionsCalculation: Any - filterMode: Any - published: Any - syncHorizontal: Any - syncRef: Any - syncVertical: Any - transitionEvaluation: Any - transitionEntry: Any - tabColor: Any - outlinePr: Any - pageSetUpPr: Any - __elements__: Any + codeName: Incomplete + enableFormatConditionsCalculation: Incomplete + filterMode: Incomplete + published: Incomplete + syncHorizontal: Incomplete + syncRef: Incomplete + syncVertical: Incomplete + transitionEvaluation: Incomplete + transitionEntry: Incomplete + tabColor: Incomplete + outlinePr: Incomplete + pageSetUpPr: Incomplete + __elements__: Incomplete def __init__( self, - codeName: Any | None = ..., - enableFormatConditionsCalculation: Any | None = ..., - filterMode: Any | None = ..., - published: Any | None = ..., - syncHorizontal: Any | None = ..., - syncRef: Any | None = ..., - syncVertical: Any | None = ..., - transitionEvaluation: Any | None = ..., - transitionEntry: Any | None = ..., - tabColor: Any | None = ..., - outlinePr: Any | None = ..., - pageSetUpPr: Any | None = ..., + codeName: Incomplete | None = ..., + enableFormatConditionsCalculation: Incomplete | None = ..., + filterMode: Incomplete | None = ..., + published: Incomplete | None = ..., + syncHorizontal: Incomplete | None = ..., + syncRef: Incomplete | None = ..., + syncVertical: Incomplete | None = ..., + transitionEvaluation: Incomplete | None = ..., + transitionEntry: Incomplete | None = ..., + tabColor: Incomplete | None = ..., + outlinePr: Incomplete | None = ..., + pageSetUpPr: Incomplete | None = ..., ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/protection.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/protection.pyi index e1646297f..8bd46afc4 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/protection.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/protection.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable @@ -11,29 +11,29 @@ class _Protected: class SheetProtection(Serialisable, _Protected): tagname: str - sheet: Any - enabled: Any - objects: Any - scenarios: Any - formatCells: Any - formatColumns: Any - formatRows: Any - insertColumns: Any - insertRows: Any - insertHyperlinks: Any - deleteColumns: Any - deleteRows: Any - selectLockedCells: Any - selectUnlockedCells: Any - sort: Any - autoFilter: Any - pivotTables: Any - saltValue: Any - spinCount: Any - algorithmName: Any - hashValue: Any - __attrs__: Any - password: Any + sheet: Incomplete + enabled: Incomplete + objects: Incomplete + scenarios: Incomplete + formatCells: Incomplete + formatColumns: Incomplete + formatRows: Incomplete + insertColumns: Incomplete + insertRows: Incomplete + insertHyperlinks: Incomplete + deleteColumns: Incomplete + deleteRows: Incomplete + selectLockedCells: Incomplete + selectUnlockedCells: Incomplete + sort: Incomplete + autoFilter: Incomplete + pivotTables: Incomplete + saltValue: Incomplete + spinCount: Incomplete + algorithmName: Incomplete + hashValue: Incomplete + __attrs__: Incomplete + password: Incomplete def __init__( self, sheet: bool = ..., @@ -52,13 +52,13 @@ class SheetProtection(Serialisable, _Protected): sort: bool = ..., autoFilter: bool = ..., pivotTables: bool = ..., - password: Any | None = ..., - algorithmName: Any | None = ..., - saltValue: Any | None = ..., - spinCount: Any | None = ..., - hashValue: Any | None = ..., + password: Incomplete | None = ..., + algorithmName: Incomplete | None = ..., + saltValue: Incomplete | None = ..., + spinCount: Incomplete | None = ..., + hashValue: Incomplete | None = ..., ) -> None: ... def set_password(self, value: str = ..., already_hashed: bool = ...) -> None: ... def enable(self) -> None: ... def disable(self) -> None: ... - def __bool__(self): ... + def __bool__(self) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/related.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/related.pyi index c0926c68c..89252ae67 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/related.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/related.pyi @@ -1,8 +1,8 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class Related(Serialisable): # type: ignore[misc] - id: Any - def __init__(self, id: Any | None = ...) -> None: ... - def to_tree(self, tagname, idx: Any | None = ...): ... # type: ignore[override] + id: Incomplete + def __init__(self, id: Incomplete | None = ...) -> None: ... + def to_tree(self, tagname, idx: Incomplete | None = ...): ... # type: ignore[override] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/scenario.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/scenario.pyi index 83286c1a3..2d287b95d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/scenario.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/scenario.pyi @@ -1,48 +1,55 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class InputCells(Serialisable): tagname: str - r: Any - deleted: Any - undone: Any - val: Any - numFmtId: Any + r: Incomplete + deleted: Incomplete + undone: Incomplete + val: Incomplete + numFmtId: Incomplete def __init__( - self, r: Any | None = ..., deleted: bool = ..., undone: bool = ..., val: Any | None = ..., numFmtId: Any | None = ... + self, + r: Incomplete | None = ..., + deleted: bool = ..., + undone: bool = ..., + val: Incomplete | None = ..., + numFmtId: Incomplete | None = ..., ) -> None: ... class Scenario(Serialisable): tagname: str - inputCells: Any - name: Any - locked: Any - hidden: Any - user: Any - comment: Any - __elements__: Any - __attrs__: Any + inputCells: Incomplete + name: Incomplete + locked: Incomplete + hidden: Incomplete + user: Incomplete + comment: Incomplete + __elements__: Incomplete + __attrs__: Incomplete def __init__( self, inputCells=..., - name: Any | None = ..., + name: Incomplete | None = ..., locked: bool = ..., hidden: bool = ..., - count: Any | None = ..., - user: Any | None = ..., - comment: Any | None = ..., + count: Incomplete | None = ..., + user: Incomplete | None = ..., + comment: Incomplete | None = ..., ) -> None: ... @property def count(self): ... class ScenarioList(Serialisable): tagname: str - scenario: Any - current: Any - show: Any - sqref: Any - __elements__: Any - def __init__(self, scenario=..., current: Any | None = ..., show: Any | None = ..., sqref: Any | None = ...) -> None: ... + scenario: Incomplete + current: Incomplete + show: Incomplete + sqref: Incomplete + __elements__: Incomplete + def __init__( + self, scenario=..., current: Incomplete | None = ..., show: Incomplete | None = ..., sqref: Incomplete | None = ... + ) -> None: ... def append(self, scenario) -> None: ... - def __bool__(self): ... + def __bool__(self) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/smart_tag.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/smart_tag.pyi index 386ff51c2..682d77911 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/smart_tag.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/smart_tag.pyi @@ -1,31 +1,31 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class CellSmartTagPr(Serialisable): tagname: str - key: Any - val: Any - def __init__(self, key: Any | None = ..., val: Any | None = ...) -> None: ... + key: Incomplete + val: Incomplete + def __init__(self, key: Incomplete | None = ..., val: Incomplete | None = ...) -> None: ... class CellSmartTag(Serialisable): tagname: str - cellSmartTagPr: Any - type: Any - deleted: Any - xmlBased: Any - __elements__: Any - def __init__(self, cellSmartTagPr=..., type: Any | None = ..., deleted: bool = ..., xmlBased: bool = ...) -> None: ... + cellSmartTagPr: Incomplete + type: Incomplete + deleted: Incomplete + xmlBased: Incomplete + __elements__: Incomplete + def __init__(self, cellSmartTagPr=..., type: Incomplete | None = ..., deleted: bool = ..., xmlBased: bool = ...) -> None: ... class CellSmartTags(Serialisable): tagname: str - cellSmartTag: Any - r: Any - __elements__: Any - def __init__(self, cellSmartTag=..., r: Any | None = ...) -> None: ... + cellSmartTag: Incomplete + r: Incomplete + __elements__: Incomplete + def __init__(self, cellSmartTag=..., r: Incomplete | None = ...) -> None: ... class SmartTags(Serialisable): tagname: str - cellSmartTags: Any - __elements__: Any + cellSmartTags: Incomplete + __elements__: Incomplete def __init__(self, cellSmartTags=...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/table.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/table.pyi index ce808f18a..c5eca03e8 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/table.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/table.pyi @@ -1,88 +1,88 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors import String from openpyxl.descriptors.serialisable import Serialisable -TABLESTYLES: Any -PIVOTSTYLES: Any +TABLESTYLES: Incomplete +PIVOTSTYLES: Incomplete class TableStyleInfo(Serialisable): tagname: str - name: Any - showFirstColumn: Any - showLastColumn: Any - showRowStripes: Any - showColumnStripes: Any + name: Incomplete + showFirstColumn: Incomplete + showLastColumn: Incomplete + showRowStripes: Incomplete + showColumnStripes: Incomplete def __init__( self, - name: Any | None = ..., - showFirstColumn: Any | None = ..., - showLastColumn: Any | None = ..., - showRowStripes: Any | None = ..., - showColumnStripes: Any | None = ..., + name: Incomplete | None = ..., + showFirstColumn: Incomplete | None = ..., + showLastColumn: Incomplete | None = ..., + showRowStripes: Incomplete | None = ..., + showColumnStripes: Incomplete | None = ..., ) -> None: ... class XMLColumnProps(Serialisable): tagname: str - mapId: Any - xpath: Any - denormalized: Any - xmlDataType: Any - extLst: Any - __elements__: Any + mapId: Incomplete + xpath: Incomplete + denormalized: Incomplete + xmlDataType: Incomplete + extLst: Incomplete + __elements__: Incomplete def __init__( self, - mapId: Any | None = ..., - xpath: Any | None = ..., - denormalized: Any | None = ..., - xmlDataType: Any | None = ..., - extLst: Any | None = ..., + mapId: Incomplete | None = ..., + xpath: Incomplete | None = ..., + denormalized: Incomplete | None = ..., + xmlDataType: Incomplete | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... class TableFormula(Serialisable): tagname: str - array: Any - attr_text: Any - text: Any - def __init__(self, array: Any | None = ..., attr_text: Any | None = ...) -> None: ... + array: Incomplete + attr_text: Incomplete + text: Incomplete + def __init__(self, array: Incomplete | None = ..., attr_text: Incomplete | None = ...) -> None: ... class TableColumn(Serialisable): tagname: str - id: Any - uniqueName: Any - name: Any - totalsRowFunction: Any - totalsRowLabel: Any - queryTableFieldId: Any - headerRowDxfId: Any - dataDxfId: Any - totalsRowDxfId: Any - headerRowCellStyle: Any - dataCellStyle: Any - totalsRowCellStyle: Any - calculatedColumnFormula: Any - totalsRowFormula: Any - xmlColumnPr: Any - extLst: Any - __elements__: Any + id: Incomplete + uniqueName: Incomplete + name: Incomplete + totalsRowFunction: Incomplete + totalsRowLabel: Incomplete + queryTableFieldId: Incomplete + headerRowDxfId: Incomplete + dataDxfId: Incomplete + totalsRowDxfId: Incomplete + headerRowCellStyle: Incomplete + dataCellStyle: Incomplete + totalsRowCellStyle: Incomplete + calculatedColumnFormula: Incomplete + totalsRowFormula: Incomplete + xmlColumnPr: Incomplete + extLst: Incomplete + __elements__: Incomplete def __init__( self, - id: Any | None = ..., - uniqueName: Any | None = ..., - name: Any | None = ..., - totalsRowFunction: Any | None = ..., - totalsRowLabel: Any | None = ..., - queryTableFieldId: Any | None = ..., - headerRowDxfId: Any | None = ..., - dataDxfId: Any | None = ..., - totalsRowDxfId: Any | None = ..., - headerRowCellStyle: Any | None = ..., - dataCellStyle: Any | None = ..., - totalsRowCellStyle: Any | None = ..., - calculatedColumnFormula: Any | None = ..., - totalsRowFormula: Any | None = ..., - xmlColumnPr: Any | None = ..., - extLst: Any | None = ..., + id: Incomplete | None = ..., + uniqueName: Incomplete | None = ..., + name: Incomplete | None = ..., + totalsRowFunction: Incomplete | None = ..., + totalsRowLabel: Incomplete | None = ..., + queryTableFieldId: Incomplete | None = ..., + headerRowDxfId: Incomplete | None = ..., + dataDxfId: Incomplete | None = ..., + totalsRowDxfId: Incomplete | None = ..., + headerRowCellStyle: Incomplete | None = ..., + dataCellStyle: Incomplete | None = ..., + totalsRowCellStyle: Incomplete | None = ..., + calculatedColumnFormula: Incomplete | None = ..., + totalsRowFormula: Incomplete | None = ..., + xmlColumnPr: Incomplete | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... def __iter__(self): ... @classmethod @@ -94,63 +94,63 @@ class TableNameDescriptor(String): class Table(Serialisable): mime_type: str tagname: str - id: Any - name: Any - displayName: Any - comment: Any - ref: Any - tableType: Any - headerRowCount: Any - insertRow: Any - insertRowShift: Any - totalsRowCount: Any - totalsRowShown: Any - published: Any - headerRowDxfId: Any - dataDxfId: Any - totalsRowDxfId: Any - headerRowBorderDxfId: Any - tableBorderDxfId: Any - totalsRowBorderDxfId: Any - headerRowCellStyle: Any - dataCellStyle: Any - totalsRowCellStyle: Any - connectionId: Any - autoFilter: Any - sortState: Any - tableColumns: Any - tableStyleInfo: Any - extLst: Any - __elements__: Any + id: Incomplete + name: Incomplete + displayName: Incomplete + comment: Incomplete + ref: Incomplete + tableType: Incomplete + headerRowCount: Incomplete + insertRow: Incomplete + insertRowShift: Incomplete + totalsRowCount: Incomplete + totalsRowShown: Incomplete + published: Incomplete + headerRowDxfId: Incomplete + dataDxfId: Incomplete + totalsRowDxfId: Incomplete + headerRowBorderDxfId: Incomplete + tableBorderDxfId: Incomplete + totalsRowBorderDxfId: Incomplete + headerRowCellStyle: Incomplete + dataCellStyle: Incomplete + totalsRowCellStyle: Incomplete + connectionId: Incomplete + autoFilter: Incomplete + sortState: Incomplete + tableColumns: Incomplete + tableStyleInfo: Incomplete + extLst: Incomplete + __elements__: Incomplete def __init__( self, id: int = ..., - displayName: Any | None = ..., - ref: Any | None = ..., - name: Any | None = ..., - comment: Any | None = ..., - tableType: Any | None = ..., + displayName: Incomplete | None = ..., + ref: Incomplete | None = ..., + name: Incomplete | None = ..., + comment: Incomplete | None = ..., + tableType: Incomplete | None = ..., headerRowCount: int = ..., - insertRow: Any | None = ..., - insertRowShift: Any | None = ..., - totalsRowCount: Any | None = ..., - totalsRowShown: Any | None = ..., - published: Any | None = ..., - headerRowDxfId: Any | None = ..., - dataDxfId: Any | None = ..., - totalsRowDxfId: Any | None = ..., - headerRowBorderDxfId: Any | None = ..., - tableBorderDxfId: Any | None = ..., - totalsRowBorderDxfId: Any | None = ..., - headerRowCellStyle: Any | None = ..., - dataCellStyle: Any | None = ..., - totalsRowCellStyle: Any | None = ..., - connectionId: Any | None = ..., - autoFilter: Any | None = ..., - sortState: Any | None = ..., + insertRow: Incomplete | None = ..., + insertRowShift: Incomplete | None = ..., + totalsRowCount: Incomplete | None = ..., + totalsRowShown: Incomplete | None = ..., + published: Incomplete | None = ..., + headerRowDxfId: Incomplete | None = ..., + dataDxfId: Incomplete | None = ..., + totalsRowDxfId: Incomplete | None = ..., + headerRowBorderDxfId: Incomplete | None = ..., + tableBorderDxfId: Incomplete | None = ..., + totalsRowBorderDxfId: Incomplete | None = ..., + headerRowCellStyle: Incomplete | None = ..., + dataCellStyle: Incomplete | None = ..., + totalsRowCellStyle: Incomplete | None = ..., + connectionId: Incomplete | None = ..., + autoFilter: Incomplete | None = ..., + sortState: Incomplete | None = ..., tableColumns=..., - tableStyleInfo: Any | None = ..., - extLst: Any | None = ..., + tableStyleInfo: Incomplete | None = ..., + extLst: Incomplete | None = ..., ) -> None: ... def to_tree(self): ... @property @@ -162,16 +162,16 @@ class TablePartList(Serialisable): tagname: str # Overwritten by property below # count: Integer - tablePart: Any - __elements__: Any - __attrs__: Any - def __init__(self, count: Any | None = ..., tablePart=...) -> None: ... + tablePart: Incomplete + __elements__: Incomplete + __attrs__: Incomplete + def __init__(self, count: Incomplete | None = ..., tablePart=...) -> None: ... def append(self, part) -> None: ... @property def count(self): ... - def __bool__(self): ... + def __bool__(self) -> bool: ... -class TableList(dict[Any, Any]): +class TableList(dict[Incomplete, Incomplete]): def add(self, table) -> None: ... - def get(self, name: Any | None = ..., table_range: Any | None = ...): ... + def get(self, name: Incomplete | None = ..., table_range: Incomplete | None = ...): ... def items(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/views.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/views.pyi index a4234e431..0abd81b98 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/views.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/views.pyi @@ -1,84 +1,84 @@ -from typing import Any +from _typeshed import Incomplete from openpyxl.descriptors.serialisable import Serialisable class Pane(Serialisable): # type: ignore[misc] - xSplit: Any - ySplit: Any - topLeftCell: Any - activePane: Any - state: Any + xSplit: Incomplete + ySplit: Incomplete + topLeftCell: Incomplete + activePane: Incomplete + state: Incomplete def __init__( self, - xSplit: Any | None = ..., - ySplit: Any | None = ..., - topLeftCell: Any | None = ..., + xSplit: Incomplete | None = ..., + ySplit: Incomplete | None = ..., + topLeftCell: Incomplete | None = ..., activePane: str = ..., state: str = ..., ) -> None: ... class Selection(Serialisable): # type: ignore[misc] - pane: Any - activeCell: Any - activeCellId: Any - sqref: Any + pane: Incomplete + activeCell: Incomplete + activeCellId: Incomplete + sqref: Incomplete def __init__( - self, pane: Any | None = ..., activeCell: str = ..., activeCellId: Any | None = ..., sqref: str = ... + self, pane: Incomplete | None = ..., activeCell: str = ..., activeCellId: Incomplete | None = ..., sqref: str = ... ) -> None: ... class SheetView(Serialisable): tagname: str - windowProtection: Any - showFormulas: Any - showGridLines: Any - showRowColHeaders: Any - showZeros: Any - rightToLeft: Any - tabSelected: Any - showRuler: Any - showOutlineSymbols: Any - defaultGridColor: Any - showWhiteSpace: Any - view: Any - topLeftCell: Any - colorId: Any - zoomScale: Any - zoomScaleNormal: Any - zoomScaleSheetLayoutView: Any - zoomScalePageLayoutView: Any - zoomToFit: Any - workbookViewId: Any - selection: Any - pane: Any + windowProtection: Incomplete + showFormulas: Incomplete + showGridLines: Incomplete + showRowColHeaders: Incomplete + showZeros: Incomplete + rightToLeft: Incomplete + tabSelected: Incomplete + showRuler: Incomplete + showOutlineSymbols: Incomplete + defaultGridColor: Incomplete + showWhiteSpace: Incomplete + view: Incomplete + topLeftCell: Incomplete + colorId: Incomplete + zoomScale: Incomplete + zoomScaleNormal: Incomplete + zoomScaleSheetLayoutView: Incomplete + zoomScalePageLayoutView: Incomplete + zoomToFit: Incomplete + workbookViewId: Incomplete + selection: Incomplete + pane: Incomplete def __init__( self, - windowProtection: Any | None = ..., - showFormulas: Any | None = ..., - showGridLines: Any | None = ..., - showRowColHeaders: Any | None = ..., - showZeros: Any | None = ..., - rightToLeft: Any | None = ..., - tabSelected: Any | None = ..., - showRuler: Any | None = ..., - showOutlineSymbols: Any | None = ..., - defaultGridColor: Any | None = ..., - showWhiteSpace: Any | None = ..., - view: Any | None = ..., - topLeftCell: Any | None = ..., - colorId: Any | None = ..., - zoomScale: Any | None = ..., - zoomScaleNormal: Any | None = ..., - zoomScaleSheetLayoutView: Any | None = ..., - zoomScalePageLayoutView: Any | None = ..., - zoomToFit: Any | None = ..., + windowProtection: Incomplete | None = ..., + showFormulas: Incomplete | None = ..., + showGridLines: Incomplete | None = ..., + showRowColHeaders: Incomplete | None = ..., + showZeros: Incomplete | None = ..., + rightToLeft: Incomplete | None = ..., + tabSelected: Incomplete | None = ..., + showRuler: Incomplete | None = ..., + showOutlineSymbols: Incomplete | None = ..., + defaultGridColor: Incomplete | None = ..., + showWhiteSpace: Incomplete | None = ..., + view: Incomplete | None = ..., + topLeftCell: Incomplete | None = ..., + colorId: Incomplete | None = ..., + zoomScale: Incomplete | None = ..., + zoomScaleNormal: Incomplete | None = ..., + zoomScaleSheetLayoutView: Incomplete | None = ..., + zoomScalePageLayoutView: Incomplete | None = ..., + zoomToFit: Incomplete | None = ..., workbookViewId: int = ..., - selection: Any | None = ..., - pane: Any | None = ..., + selection: Incomplete | None = ..., + pane: Incomplete | None = ..., ) -> None: ... class SheetViewList(Serialisable): tagname: str - sheetView: Any - extLst: Any - __elements__: Any - def __init__(self, sheetView: Any | None = ..., extLst: Any | None = ...) -> None: ... + sheetView: Incomplete + extLst: Incomplete + __elements__: Incomplete + def __init__(self, sheetView: Incomplete | None = ..., extLst: Incomplete | None = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/worksheet.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/worksheet.pyi index 615fd2ad3..f3402b772 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/worksheet.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/worksheet.pyi @@ -1,7 +1,16 @@ -from collections.abc import Generator -from typing import Any +from _typeshed import Incomplete +from collections.abc import Generator, Iterable, Iterator +from datetime import datetime +from typing import overload +from typing_extensions import Literal +from openpyxl.cell.cell import Cell from openpyxl.workbook.child import _WorkbookChild +from openpyxl.workbook.workbook import Workbook +from openpyxl.worksheet.cell_range import CellRange +from openpyxl.worksheet.datavalidation import DataValidation +from openpyxl.worksheet.table import Table, TableList +from openpyxl.worksheet.views import SheetView class Worksheet(_WorkbookChild): mime_type: str @@ -24,106 +33,162 @@ class Worksheet(_WorkbookChild): PAPERSIZE_A5: str ORIENTATION_PORTRAIT: str ORIENTATION_LANDSCAPE: str - def __init__(self, parent, title: Any | None = ...) -> None: ... + def __init__(self, parent: Workbook, title: str | None = ...) -> None: ... @property - def sheet_view(self): ... + def sheet_view(self) -> SheetView: ... @property - def selected_cell(self): ... + def selected_cell(self) -> Cell: ... @property - def active_cell(self): ... + def active_cell(self) -> Cell: ... @property - def page_breaks(self): ... + def array_formulae(self) -> dict[Incomplete, Incomplete]: ... @property - def show_gridlines(self): ... + def show_gridlines(self) -> bool: ... @property - def show_summary_below(self): ... - @property - def show_summary_right(self): ... - @property - def freeze_panes(self): ... + def freeze_panes(self) -> str | None: ... @freeze_panes.setter - def freeze_panes(self, topLeftCell: Any | None = ...) -> None: ... - def cell(self, row, column, value: Any | None = ...): ... - def __getitem__(self, key): ... - def __setitem__(self, key, value) -> None: ... - def __iter__(self): ... - def __delitem__(self, key) -> None: ... + def freeze_panes(self, topLeftCell: Incomplete | None = ...) -> None: ... + def cell(self, row: int, column: int, value: str | None = ...) -> Cell: ... + def __getitem__(self, key: str | int | slice) -> Cell | tuple[Cell, ...]: ... + def __setitem__(self, key: str, value: str) -> None: ... + def __iter__(self) -> Iterator[Cell]: ... + def __delitem__(self, key: str) -> None: ... @property - def min_row(self): ... + def min_row(self) -> int: ... @property - def max_row(self): ... + def max_row(self) -> int: ... @property - def min_column(self): ... + def min_column(self) -> int: ... @property - def max_column(self): ... - def calculate_dimension(self): ... + def max_column(self) -> int: ... + def calculate_dimension(self) -> str: ... @property - def dimensions(self): ... + def dimensions(self) -> str: ... + @overload + def iter_rows( + self, min_row: int | None, max_row: int | None, min_col: int | None, max_col: int | None, values_only: Literal[True] + ) -> Generator[tuple[str | float | datetime | None, ...], None, None]: ... + @overload def iter_rows( self, - min_row: Any | None = ..., - max_row: Any | None = ..., - min_col: Any | None = ..., - max_col: Any | None = ..., - values_only: bool = ..., - ): ... - @property - def rows(self): ... - @property - def values(self) -> Generator[Any, None, None]: ... + min_row: int | None = None, + max_row: int | None = None, + min_col: int | None = None, + max_col: int | None = None, + *, + values_only: Literal[True], + ) -> Generator[tuple[str | float | datetime | None, ...], None, None]: ... + @overload + def iter_rows( + self, + min_row: int | None = ..., + max_row: int | None = ..., + min_col: int | None = ..., + max_col: int | None = ..., + values_only: Literal[False] = False, + ) -> Generator[tuple[Cell, ...], None, None]: ... + @overload + def iter_rows( + self, min_row: int | None, max_row: int | None, min_col: int | None, max_col: int | None, values_only: bool + ) -> Generator[tuple[Cell | str | float | datetime | None, ...], None, None]: ... + @overload + def iter_rows( + self, + min_row: int | None = None, + max_row: int | None = None, + min_col: int | None = None, + max_col: int | None = None, + *, + values_only: bool, + ) -> Generator[tuple[Cell | str | float | datetime | None, ...], None, None]: ... + @property + def rows(self) -> Generator[Cell, None, None]: ... + @property + def values(self) -> Generator[str | float | datetime | None, None, None]: ... + @overload + def iter_cols( + self, min_col: int | None, max_col: int | None, min_row: int | None, max_row: int | None, values_only: Literal[True] + ) -> Generator[tuple[str | float | datetime | None, ...], None, None]: ... + @overload def iter_cols( self, - min_col: Any | None = ..., - max_col: Any | None = ..., - min_row: Any | None = ..., - max_row: Any | None = ..., - values_only: bool = ..., - ): ... - @property - def columns(self): ... - def set_printer_settings(self, paper_size, orientation) -> None: ... - def add_data_validation(self, data_validation) -> None: ... - def add_chart(self, chart, anchor: Any | None = ...) -> None: ... - def add_image(self, img, anchor: Any | None = ...) -> None: ... - def add_table(self, table) -> None: ... - @property - def tables(self): ... + min_col: int | None = None, + max_col: int | None = None, + min_row: int | None = None, + max_row: int | None = None, + *, + values_only: Literal[True], + ) -> Generator[tuple[str | float | datetime | None, ...], None, None]: ... + @overload + def iter_cols( + self, + min_col: int | None = ..., + max_col: int | None = ..., + min_row: int | None = ..., + max_row: int | None = ..., + values_only: Literal[False] = False, + ) -> Generator[tuple[Cell, ...], None, None]: ... + @overload + def iter_cols( + self, min_col: int | None, max_col: int | None, min_row: int | None, max_row: int | None, values_only: bool + ) -> Generator[tuple[Cell | str | float | datetime | None, ...], None, None]: ... + @overload + def iter_cols( + self, + min_col: int | None = None, + max_col: int | None = None, + min_row: int | None = None, + max_row: int | None = None, + *, + values_only: bool, + ) -> Generator[tuple[Cell | str | float | datetime | None, ...], None, None]: ... + @property + def columns(self) -> Generator[Cell, None, None]: ... + def set_printer_settings( + self, paper_size: int | None, orientation: None | Literal["default", "portrait", "landscape"] + ) -> None: ... + def add_data_validation(self, data_validation: DataValidation) -> None: ... + def add_chart(self, chart, anchor: Incomplete | None = ...) -> None: ... + def add_image(self, img, anchor: Incomplete | None = ...) -> None: ... + def add_table(self, table: Table) -> None: ... + @property + def tables(self) -> TableList: ... def add_pivot(self, pivot) -> None: ... def merge_cells( self, - range_string: Any | None = ..., - start_row: Any | None = ..., - start_column: Any | None = ..., - end_row: Any | None = ..., - end_column: Any | None = ..., + range_string: str | None = ..., + start_row: int | None = ..., + start_column: int | None = ..., + end_row: int | None = ..., + end_column: int | None = ..., ) -> None: ... @property - def merged_cell_ranges(self): ... + def merged_cell_ranges(self) -> list[CellRange]: ... def unmerge_cells( self, - range_string: Any | None = ..., - start_row: Any | None = ..., - start_column: Any | None = ..., - end_row: Any | None = ..., - end_column: Any | None = ..., + range_string: str | None = ..., + start_row: int | None = ..., + start_column: int | None = ..., + end_row: int | None = ..., + end_column: int | None = ..., ) -> None: ... - def append(self, iterable) -> None: ... - def insert_rows(self, idx, amount: int = ...) -> None: ... - def insert_cols(self, idx, amount: int = ...) -> None: ... - def delete_rows(self, idx, amount: int = ...) -> None: ... - def delete_cols(self, idx, amount: int = ...) -> None: ... - def move_range(self, cell_range, rows: int = ..., cols: int = ..., translate: bool = ...) -> None: ... - @property - def print_title_rows(self): ... + def append(self, iterable: Iterable[Incomplete]) -> None: ... + def insert_rows(self, idx: int, amount: int = ...) -> None: ... + def insert_cols(self, idx: int, amount: int = ...) -> None: ... + def delete_rows(self, idx: int, amount: int = ...) -> None: ... + def delete_cols(self, idx: int, amount: int = ...) -> None: ... + def move_range(self, cell_range: CellRange | str, rows: int = ..., cols: int = ..., translate: bool = ...) -> None: ... + @property + def print_title_rows(self) -> str | None: ... @print_title_rows.setter - def print_title_rows(self, rows) -> None: ... + def print_title_rows(self, rows: str | None) -> None: ... @property - def print_title_cols(self): ... + def print_title_cols(self) -> str | None: ... @print_title_cols.setter - def print_title_cols(self, cols) -> None: ... + def print_title_cols(self, cols: str | None) -> None: ... @property - def print_titles(self): ... + def print_titles(self) -> str | None: ... @property - def print_area(self): ... + def print_area(self) -> list[str]: ... @print_area.setter - def print_area(self, value) -> None: ... + def print_area(self, value: str | Iterable[str]) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/writer/excel.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/writer/excel.pyi index 57e9d2ac1..624a3c4c0 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/writer/excel.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/writer/excel.pyi @@ -1,13 +1,12 @@ -from typing import Any +from _typeshed import Incomplete class ExcelWriter: - workbook: Any - manifest: Any - vba_modified: Any + workbook: Incomplete + manifest: Incomplete + vba_modified: Incomplete def __init__(self, workbook, archive) -> None: ... def write_data(self) -> None: ... def write_worksheet(self, ws) -> None: ... def save(self) -> None: ... def save_workbook(workbook, filename): ... -def save_virtual_workbook(workbook): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/xml/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/xml/__init__.pyi index c074aaf44..9c4670087 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/xml/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/xml/__init__.pyi @@ -1,11 +1,11 @@ -from typing import Any +from _typeshed import Incomplete def lxml_available(): ... def lxml_env_set(): ... -LXML: Any +LXML: Incomplete def defusedxml_available(): ... def defusedxml_env_set(): ... -DEFUSEDXML: Any +DEFUSEDXML: Incomplete diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/xml/constants.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/xml/constants.pyi index 9380e8668..63217f413 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/xml/constants.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/xml/constants.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete MIN_ROW: int MIN_COLUMN: int @@ -7,42 +7,42 @@ MAX_ROW: int PACKAGE_PROPS: str PACKAGE_XL: str PACKAGE_RELS: str -PACKAGE_THEME: Any -PACKAGE_WORKSHEETS: Any -PACKAGE_CHARTSHEETS: Any -PACKAGE_DRAWINGS: Any -PACKAGE_CHARTS: Any -PACKAGE_IMAGES: Any -PACKAGE_WORKSHEET_RELS: Any -PACKAGE_CHARTSHEETS_RELS: Any -PACKAGE_PIVOT_TABLE: Any -PACKAGE_PIVOT_CACHE: Any +PACKAGE_THEME: Incomplete +PACKAGE_WORKSHEETS: Incomplete +PACKAGE_CHARTSHEETS: Incomplete +PACKAGE_DRAWINGS: Incomplete +PACKAGE_CHARTS: Incomplete +PACKAGE_IMAGES: Incomplete +PACKAGE_WORKSHEET_RELS: Incomplete +PACKAGE_CHARTSHEETS_RELS: Incomplete +PACKAGE_PIVOT_TABLE: Incomplete +PACKAGE_PIVOT_CACHE: Incomplete ARC_CONTENT_TYPES: str -ARC_ROOT_RELS: Any -ARC_WORKBOOK_RELS: Any -ARC_CORE: Any -ARC_APP: Any -ARC_WORKBOOK: Any -ARC_STYLE: Any -ARC_THEME: Any -ARC_SHARED_STRINGS: Any +ARC_ROOT_RELS: Incomplete +ARC_WORKBOOK_RELS: Incomplete +ARC_CORE: Incomplete +ARC_APP: Incomplete +ARC_WORKBOOK: Incomplete +ARC_STYLE: Incomplete +ARC_THEME: Incomplete +ARC_SHARED_STRINGS: Incomplete ARC_CUSTOM_UI: str XML_NS: str DCORE_NS: str DCTERMS_NS: str DCTERMS_PREFIX: str DOC_NS: str -REL_NS: Any -COMMENTS_NS: Any -IMAGE_NS: Any -VML_NS: Any -VTYPES_NS: Any -XPROPS_NS: Any -EXTERNAL_LINK_NS: Any +REL_NS: Incomplete +COMMENTS_NS: Incomplete +IMAGE_NS: Incomplete +VML_NS: Incomplete +VTYPES_NS: Incomplete +XPROPS_NS: Incomplete +EXTERNAL_LINK_NS: Incomplete PKG_NS: str -PKG_REL_NS: Any -COREPROPS_NS: Any -CONTYPES_NS: Any +PKG_REL_NS: Incomplete +COREPROPS_NS: Incomplete +CONTYPES_NS: Incomplete XSI_NS: str SHEET_MAIN_NS: str CHART_NS: str @@ -50,25 +50,25 @@ DRAWING_NS: str SHEET_DRAWING_NS: str CHART_DRAWING_NS: str CUSTOMUI_NS: str -NAMESPACES: Any +NAMESPACES: Incomplete WORKBOOK_MACRO: str WORKBOOK: str SPREADSHEET: str -SHARED_STRINGS: Any -EXTERNAL_LINK: Any -WORKSHEET_TYPE: Any -COMMENTS_TYPE: Any -STYLES_TYPE: Any -CHARTSHEET_TYPE: Any +SHARED_STRINGS: Incomplete +EXTERNAL_LINK: Incomplete +WORKSHEET_TYPE: Incomplete +COMMENTS_TYPE: Incomplete +STYLES_TYPE: Incomplete +CHARTSHEET_TYPE: Incomplete DRAWING_TYPE: str CHART_TYPE: str CHARTSHAPE_TYPE: str THEME_TYPE: str -XLTM: Any -XLSM: Any -XLTX: Any -XLSX: Any -EXT_TYPES: Any +XLTM: Incomplete +XLSM: Incomplete +XLTX: Incomplete +XLSX: Incomplete +EXT_TYPES: Incomplete CTRL: str ACTIVEX: str VBA: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/xml/functions.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/xml/functions.pyi index 9c34b837c..2a6bab568 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/xml/functions.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/xml/functions.pyi @@ -1,6 +1,6 @@ -from typing import Any +from _typeshed import Incomplete -NS_REGEX: Any +NS_REGEX: Incomplete def localname(node): ... def whitespace(node) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/opentracing/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/opentracing/METADATA.toml index bcb78f17f..d00ec0514 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/opentracing/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/opentracing/METADATA.toml @@ -1 +1,4 @@ version = "2.4.*" + +[tool.stubtest] +ignore_missing_stub = true diff --git a/packages/pyright-internal/typeshed-fallback/stubs/opentracing/opentracing/mocktracer/context.pyi b/packages/pyright-internal/typeshed-fallback/stubs/opentracing/opentracing/mocktracer/context.pyi index ef8ed9214..3264dd824 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/opentracing/opentracing/mocktracer/context.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/opentracing/opentracing/mocktracer/context.pyi @@ -1,4 +1,4 @@ -from _typeshed import Self +from typing_extensions import Self import opentracing @@ -8,4 +8,4 @@ class SpanContext(opentracing.SpanContext): def __init__(self, trace_id: int | None = ..., span_id: int | None = ..., baggage: dict[str, str] | None = ...) -> None: ... @property def baggage(self) -> dict[str, str]: ... - def with_baggage_item(self: Self, key: str, value: str) -> Self: ... + def with_baggage_item(self, key: str, value: str) -> Self: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/opentracing/opentracing/mocktracer/span.pyi b/packages/pyright-internal/typeshed-fallback/stubs/opentracing/opentracing/mocktracer/span.pyi index a54b4d636..9d310d5bf 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/opentracing/opentracing/mocktracer/span.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/opentracing/opentracing/mocktracer/span.pyi @@ -1,5 +1,5 @@ -from _typeshed import Self from typing import Any +from typing_extensions import Self from ..span import Span from ..tracer import Tracer @@ -27,10 +27,10 @@ class MockSpan(Span): def tracer(self) -> MockTracer: ... @property def context(self) -> SpanContext: ... - def set_operation_name(self: Self, operation_name: str) -> Self: ... - def set_tag(self: Self, key: str, value: str | bool | float) -> Self: ... - def log_kv(self: Self, key_values: dict[str, Any], timestamp: float | None = ...) -> Self: ... - def set_baggage_item(self: Self, key: str, value: str) -> Self: ... + def set_operation_name(self, operation_name: str) -> Self: ... + def set_tag(self, key: str, value: str | bool | float) -> Self: ... + def log_kv(self, key_values: dict[str, Any], timestamp: float | None = ...) -> Self: ... + def set_baggage_item(self, key: str, value: str) -> Self: ... class LogData: key_values: dict[str, Any] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/opentracing/opentracing/scope.pyi b/packages/pyright-internal/typeshed-fallback/stubs/opentracing/opentracing/scope.pyi index d3ed839fe..e312df143 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/opentracing/opentracing/scope.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/opentracing/opentracing/scope.pyi @@ -1,5 +1,5 @@ -from _typeshed import Self from types import TracebackType +from typing_extensions import Self from .scope_manager import ScopeManager from .span import Span @@ -11,7 +11,7 @@ class Scope: @property def manager(self) -> ScopeManager: ... def close(self) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/opentracing/opentracing/span.pyi b/packages/pyright-internal/typeshed-fallback/stubs/opentracing/opentracing/span.pyi index d4ccb201d..74a6dc5d2 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/opentracing/opentracing/span.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/opentracing/opentracing/span.pyi @@ -1,6 +1,7 @@ -from _typeshed import Self +from _typeshed import Incomplete from types import TracebackType from typing import Any +from typing_extensions import Self from .tracer import Tracer @@ -15,15 +16,15 @@ class Span: def context(self) -> SpanContext: ... @property def tracer(self) -> Tracer: ... - def set_operation_name(self: Self, operation_name: str) -> Self: ... + def set_operation_name(self, operation_name: str) -> Self: ... def finish(self, finish_time: float | None = ...) -> None: ... - def set_tag(self: Self, key: str, value: str | bool | float) -> Self: ... - def log_kv(self: Self, key_values: dict[str, Any], timestamp: float | None = ...) -> Self: ... - def set_baggage_item(self: Self, key: str, value: str) -> Self: ... + def set_tag(self, key: str, value: str | bool | float) -> Self: ... + def log_kv(self, key_values: dict[str, Any], timestamp: float | None = ...) -> Self: ... + def set_baggage_item(self, key: str, value: str) -> Self: ... def get_baggage_item(self, key: str) -> str | None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None ) -> None: ... - def log_event(self: Self, event: Any, payload: Any | None = ...) -> Self: ... - def log(self: Self, **kwargs: Any) -> Self: ... + def log_event(self, event: Any, payload: Incomplete | None = ...) -> Self: ... + def log(self, **kwargs: Any) -> Self: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/paho-mqtt/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/paho-mqtt/METADATA.toml new file mode 100644 index 000000000..6cf9fae44 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/paho-mqtt/METADATA.toml @@ -0,0 +1 @@ +version = "1.6.*" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/html5/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/paho-mqtt/paho/__init__.pyi similarity index 100% rename from packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/html5/__init__.pyi rename to packages/pyright-internal/typeshed-fallback/stubs/paho-mqtt/paho/__init__.pyi diff --git a/packages/pyright-internal/typeshed-fallback/stubs/paho-mqtt/paho/mqtt/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/paho-mqtt/paho/mqtt/__init__.pyi new file mode 100644 index 000000000..ce4f3fba0 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/paho-mqtt/paho/mqtt/__init__.pyi @@ -0,0 +1 @@ +class MQTTException(Exception): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/paho-mqtt/paho/mqtt/client.pyi b/packages/pyright-internal/typeshed-fallback/stubs/paho-mqtt/paho/mqtt/client.pyi new file mode 100644 index 000000000..2cbe23800 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/paho-mqtt/paho/mqtt/client.pyi @@ -0,0 +1,321 @@ +import logging +import socket as _socket +import ssl as _ssl +import time +import types +from _typeshed import Incomplete, Unused +from collections.abc import Callable +from typing import Any, TypeVar +from typing_extensions import TypeAlias + +from .matcher import MQTTMatcher as MQTTMatcher +from .properties import Properties as Properties +from .reasoncodes import ReasonCodes as ReasonCodes +from .subscribeoptions import SubscribeOptions as SubscribeOptions + +ssl: types.ModuleType | None +socks: types.ModuleType | None +time_func = time.monotonic +HAVE_DNS: bool +EAGAIN: int | Incomplete +MQTTv31: int +MQTTv311: int +MQTTv5: int +unicode = str +basestring = str +CONNECT: int +CONNACK: int +PUBLISH: int +PUBACK: int +PUBREC: int +PUBREL: int +PUBCOMP: int +SUBSCRIBE: int +SUBACK: int +UNSUBSCRIBE: int +UNSUBACK: int +PINGREQ: int +PINGRESP: int +DISCONNECT: int +AUTH: int +MQTT_LOG_INFO: int +MQTT_LOG_NOTICE: int +MQTT_LOG_WARNING: int +MQTT_LOG_ERR: int +MQTT_LOG_DEBUG: int +LOGGING_LEVEL: dict[int, int] +CONNACK_ACCEPTED: int +CONNACK_REFUSED_PROTOCOL_VERSION: int +CONNACK_REFUSED_IDENTIFIER_REJECTED: int +CONNACK_REFUSED_SERVER_UNAVAILABLE: int +CONNACK_REFUSED_BAD_USERNAME_PASSWORD: int +CONNACK_REFUSED_NOT_AUTHORIZED: int +mqtt_cs_new: int +mqtt_cs_connected: int +mqtt_cs_disconnecting: int +mqtt_cs_connect_async: int +mqtt_ms_invalid: int +mqtt_ms_publish: int +mqtt_ms_wait_for_puback: int +mqtt_ms_wait_for_pubrec: int +mqtt_ms_resend_pubrel: int +mqtt_ms_wait_for_pubrel: int +mqtt_ms_resend_pubcomp: int +mqtt_ms_wait_for_pubcomp: int +mqtt_ms_send_pubrec: int +mqtt_ms_queued: int +MQTT_ERR_AGAIN: int +MQTT_ERR_SUCCESS: int +MQTT_ERR_NOMEM: int +MQTT_ERR_PROTOCOL: int +MQTT_ERR_INVAL: int +MQTT_ERR_NO_CONN: int +MQTT_ERR_CONN_REFUSED: int +MQTT_ERR_NOT_FOUND: int +MQTT_ERR_CONN_LOST: int +MQTT_ERR_TLS: int +MQTT_ERR_PAYLOAD_SIZE: int +MQTT_ERR_NOT_SUPPORTED: int +MQTT_ERR_AUTH: int +MQTT_ERR_ACL_DENIED: int +MQTT_ERR_UNKNOWN: int +MQTT_ERR_ERRNO: int +MQTT_ERR_QUEUE_SIZE: int +MQTT_ERR_KEEPALIVE: int +MQTT_CLIENT: int +MQTT_BRIDGE: int +MQTT_CLEAN_START_FIRST_ONLY: int +sockpair_data: bytes +_UserData: TypeAlias = Any +_Socket: TypeAlias = _socket.socket | _ssl.SSLSocket | Incomplete +_Payload: TypeAlias = str | bytes | bytearray | float +_ExtraHeader: TypeAlias = dict[str, str] | Callable[[dict[str, str]], dict[str, str]] +_OnLog: TypeAlias = Callable[[Client, _UserData, int, str], object] +_OnConnect: TypeAlias = Callable[[Client, _UserData, dict[str, int], int], object] +_OnConnectV5: TypeAlias = Callable[[Client, _UserData, dict[str, int], ReasonCodes, Properties | None], object] +_TOnConnect = TypeVar("_TOnConnect", _OnConnect, _OnConnectV5) +_OnConnectFail: TypeAlias = Callable[[Client, _UserData], object] +_OnSubscribe: TypeAlias = Callable[[Client, _UserData, int, tuple[int]], object] +_OnSubscribeV5: TypeAlias = Callable[[Client, _UserData, int, list[ReasonCodes], Properties], object] +_TOnSubscribe = TypeVar("_TOnSubscribe", _OnSubscribe, _OnSubscribeV5) +_OnMessage: TypeAlias = Callable[[Client, _UserData, MQTTMessage], object] +_OnPublish: TypeAlias = Callable[[Client, _UserData, int], object] +_OnUnsubscribe: TypeAlias = Callable[[Client, _UserData, int], object] +_OnUnsubscribeV5: TypeAlias = Callable[[Client, _UserData, int, Properties, list[ReasonCodes] | ReasonCodes], object] +_TOnUnsubscribe = TypeVar("_TOnUnsubscribe", _OnUnsubscribe, _OnUnsubscribeV5) +_OnDisconnect: TypeAlias = Callable[[Client, _UserData, int], object] +_OnDisconnectV5: TypeAlias = Callable[[Client, _UserData, ReasonCodes | None, Properties | None], object] +_TOnDisconnect = TypeVar("_TOnDisconnect", _OnDisconnect, _OnDisconnectV5) +_OnSocket: TypeAlias = Callable[[Client, _UserData, _Socket | WebsocketWrapper | None], object] + +class WebsocketConnectionError(ValueError): ... + +def error_string(mqtt_errno: int) -> str: ... +def connack_string(connack_code: int) -> str: ... +def base62(num: int, base: str = ..., padding: int = ...) -> str: ... +def topic_matches_sub(sub: str, topic: str) -> bool: ... + +class MQTTMessageInfo: + mid: int + rc: int + def __init__(self, mid: int) -> None: ... + def __iter__(self) -> MQTTMessageInfo: ... + def __next__(self) -> int: ... + def next(self) -> int: ... + def __getitem__(self, index: int) -> int: ... + def wait_for_publish(self, timeout: float | None = ...) -> None: ... + def is_published(self) -> bool: ... + +class MQTTMessage: + timestamp: int + state: int + dup: bool + mid: int + payload: bytes | bytearray + qos: int + retain: bool + info: MQTTMessageInfo + properties: Properties | None + def __init__(self, mid: int = ..., topic: bytes | bytearray = ...) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __ne__(self, other: object) -> bool: ... + @property + def topic(self) -> str: ... + @topic.setter + def topic(self, value: bytes | bytearray) -> None: ... + +class Client: + suppress_exceptions: bool + def __init__( + self, + client_id: str | None = ..., + clean_session: bool | None = ..., + userdata: _UserData | None = ..., + protocol: int = ..., + transport: str = ..., + reconnect_on_failure: bool = ..., + ) -> None: ... + def __del__(self) -> None: ... + def reinitialise(self, client_id: str = ..., clean_session: bool = ..., userdata: _UserData | None = ...) -> None: ... + def ws_set_options(self, path: str = ..., headers: _ExtraHeader | None = ...) -> None: ... + def tls_set_context(self, context: _ssl.SSLContext | None = ...) -> None: ... + def tls_set( + self, + ca_certs: str | None = ..., + certfile: str | None = ..., + keyfile: str | None = ..., + cert_reqs: _ssl.VerifyMode | None = ..., + tls_version: _ssl._SSLMethod | None = ..., + ciphers: str | None = ..., + keyfile_password: _ssl._PasswordType | None = ..., + ) -> None: ... + def tls_insecure_set(self, value: bool) -> None: ... + def proxy_set(self, **proxy_args: Any) -> None: ... + def enable_logger(self, logger: logging.Logger | None = ...) -> None: ... + def disable_logger(self) -> None: ... + def connect( + self, + host: str, + port: int = ..., + keepalive: int = ..., + bind_address: str = ..., + bind_port: int = ..., + clean_start: int = ..., + properties: Properties | None = ..., + ) -> int: ... + def connect_srv( + self, + domain: str | None = ..., + keepalive: int = ..., + bind_address: str = ..., + clean_start: int = ..., + properties: Properties | None = ..., + ) -> int: ... + def connect_async( + self, + host: str, + port: int = ..., + keepalive: int = ..., + bind_address: str = ..., + bind_port: int = ..., + clean_start: int = ..., + properties: Properties | None = ..., + ) -> None: ... + def reconnect_delay_set(self, min_delay: int = ..., max_delay: int = ...) -> None: ... + def reconnect(self) -> int: ... + def loop(self, timeout: float = ..., max_packets: int = ...) -> int: ... + def publish( + self, topic: str, payload: _Payload | None = ..., qos: int = ..., retain: bool = ..., properties: Properties | None = ... + ) -> MQTTMessageInfo: ... + def username_pw_set(self, username: str, password: str | bytes | bytearray | None = ...) -> None: ... + def enable_bridge_mode(self) -> None: ... + def is_connected(self) -> bool: ... + def disconnect(self, reasoncode: ReasonCodes | None = ..., properties: Properties | None = ...) -> int: ... + def subscribe( + self, + topic: str | tuple[str, SubscribeOptions] | list[tuple[str, SubscribeOptions]] | list[tuple[str, int]], + qos: int = ..., + options: SubscribeOptions | None = ..., + properties: Properties | None = ..., + ) -> tuple[int, int]: ... + def unsubscribe(self, topic: str | list[str], properties: Properties | None = ...) -> tuple[int, int]: ... + def loop_read(self, max_packets: int = ...) -> int: ... + def loop_write(self, max_packets: int = ...) -> int: ... + def want_write(self) -> bool: ... + def loop_misc(self) -> int: ... + def max_inflight_messages_set(self, inflight: int) -> None: ... + def max_queued_messages_set(self, queue_size: int) -> Client: ... + def message_retry_set(self, retry: Unused) -> None: ... + def user_data_set(self, userdata: _UserData) -> None: ... + def will_set( + self, topic: str, payload: _Payload | None = ..., qos: int = ..., retain: bool = ..., properties: Properties | None = ... + ) -> None: ... + def will_clear(self) -> None: ... + def socket(self) -> _Socket | WebsocketWrapper: ... + def loop_forever(self, timeout: float = ..., max_packets: int = ..., retry_first_connection: bool = ...) -> int: ... + def loop_start(self) -> int | None: ... + def loop_stop(self, force: bool = ...) -> int | None: ... + @property + def on_log(self) -> _OnLog | None: ... + @on_log.setter + def on_log(self, func: _OnLog | None) -> None: ... + def log_callback(self) -> Callable[[_OnLog], _OnLog]: ... + @property + def on_connect(self) -> _OnConnect | _OnConnectV5 | None: ... + @on_connect.setter + def on_connect(self, func: _OnConnect | _OnConnectV5 | None) -> None: ... + def connect_callback(self) -> Callable[[_TOnConnect], _TOnConnect]: ... + @property + def on_connect_fail(self) -> _OnConnectFail | None: ... + @on_connect_fail.setter + def on_connect_fail(self, func: _OnConnectFail | None) -> None: ... + def connect_fail_callback(self) -> Callable[[_OnConnectFail], _OnConnectFail]: ... + @property + def on_subscribe(self) -> _OnSubscribe | _OnSubscribeV5 | None: ... + @on_subscribe.setter + def on_subscribe(self, func: _OnSubscribe | _OnSubscribeV5 | None) -> None: ... + def subscribe_callback(self) -> Callable[[_TOnSubscribe], _TOnSubscribe]: ... + @property + def on_message(self) -> _OnMessage | None: ... + @on_message.setter + def on_message(self, func: _OnMessage | None) -> None: ... + def message_callback(self) -> Callable[[_OnMessage], _OnMessage]: ... + @property + def on_publish(self) -> _OnPublish | None: ... + @on_publish.setter + def on_publish(self, func: _OnPublish | None) -> None: ... + def publish_callback(self) -> Callable[[_OnPublish], _OnPublish]: ... + @property + def on_unsubscribe(self) -> _OnUnsubscribe | _OnUnsubscribeV5 | None: ... + @on_unsubscribe.setter + def on_unsubscribe(self, func: _OnUnsubscribe | _OnUnsubscribeV5 | None) -> None: ... + def unsubscribe_callback(self) -> Callable[[_TOnUnsubscribe], _TOnUnsubscribe]: ... + @property + def on_disconnect(self) -> _OnDisconnect | _OnDisconnectV5 | None: ... + @on_disconnect.setter + def on_disconnect(self, func: _OnDisconnect | _OnDisconnectV5 | None) -> None: ... + def disconnect_callback(self) -> Callable[[_TOnDisconnect], _TOnDisconnect]: ... + @property + def on_socket_open(self) -> _OnSocket | None: ... + @on_socket_open.setter + def on_socket_open(self, func: _OnSocket | None) -> None: ... + def socket_open_callback(self) -> Callable[[_OnSocket], _OnSocket]: ... + @property + def on_socket_close(self) -> _OnSocket | None: ... + @on_socket_close.setter + def on_socket_close(self, func: _OnSocket | None) -> None: ... + def socket_close_callback(self) -> Callable[[_OnSocket], _OnSocket]: ... + @property + def on_socket_register_write(self) -> _OnSocket | None: ... + @on_socket_register_write.setter + def on_socket_register_write(self, func: _OnSocket | None) -> None: ... + def socket_register_write_callback(self) -> Callable[[_OnSocket], _OnSocket]: ... + @property + def on_socket_unregister_write(self) -> _OnSocket | None: ... + @on_socket_unregister_write.setter + def on_socket_unregister_write(self, func: _OnSocket | None) -> None: ... + def socket_unregister_write_callback(self) -> Callable[[_OnSocket], _OnSocket]: ... + def message_callback_add(self, sub: str, callback: _OnMessage) -> None: ... + def topic_callback(self, sub: str) -> Callable[[_OnMessage], _OnMessage]: ... + def message_callback_remove(self, sub: str) -> None: ... + +class WebsocketWrapper: + OPCODE_CONTINUATION: int + OPCODE_TEXT: int + OPCODE_BINARY: int + OPCODE_CONNCLOSE: int + OPCODE_PING: int + OPCODE_PONG: int + connected: bool + def __init__( + self, socket: _Socket, host: str, port: int, is_ssl: bool, path: str, extra_headers: _ExtraHeader | None + ) -> None: ... + def __del__(self) -> None: ... + def recv(self, length: int) -> bytes | bytearray | None: ... + def read(self, length: int) -> bytes | bytearray | None: ... + def send(self, data: bytes | bytearray) -> int: ... + def write(self, data: bytes | bytearray) -> int: ... + def close(self) -> None: ... + def fileno(self) -> int: ... + def pending(self) -> int: ... + def setblocking(self, flag: bool) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/paho-mqtt/paho/mqtt/matcher.pyi b/packages/pyright-internal/typeshed-fallback/stubs/paho-mqtt/paho/mqtt/matcher.pyi new file mode 100644 index 000000000..549ac1b36 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/paho-mqtt/paho/mqtt/matcher.pyi @@ -0,0 +1,11 @@ +from collections.abc import Generator +from typing import Any + +class MQTTMatcher: + class Node: ... + + def __init__(self) -> None: ... + def __setitem__(self, key: str, value: Any) -> None: ... + def __getitem__(self, key: str) -> Any: ... + def __delitem__(self, key: str) -> None: ... + def iter_match(self, topic: str) -> Generator[Any, None, None]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/paho-mqtt/paho/mqtt/packettypes.pyi b/packages/pyright-internal/typeshed-fallback/stubs/paho-mqtt/paho/mqtt/packettypes.pyi new file mode 100644 index 000000000..2fe5644e5 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/paho-mqtt/paho/mqtt/packettypes.pyi @@ -0,0 +1,19 @@ +class PacketTypes: + indexes: range + CONNECT: int + CONNACK: int + PUBLISH: int + PUBACK: int + PUBREC: int + PUBREL: int + PUBCOMP: int + SUBSCRIBE: int + SUBACK: int + UNSUBSCRIBE: int + UNSUBACK: int + PINGREQ: int + PINGRESP: int + DISCONNECT: int + AUTH: int + WILLMESSAGE: int + Names: list[str] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/paho-mqtt/paho/mqtt/properties.pyi b/packages/pyright-internal/typeshed-fallback/stubs/paho-mqtt/paho/mqtt/properties.pyi new file mode 100644 index 000000000..174a6a0e5 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/paho-mqtt/paho/mqtt/properties.pyi @@ -0,0 +1,38 @@ +from typing import Any + +from . import MQTTException as MQTTException + +class MalformedPacket(MQTTException): ... + +def writeInt16(length: int) -> bytearray: ... +def readInt16(buf: bytes) -> int: ... +def writeInt32(length: int) -> bytearray: ... +def readInt32(buf: bytes) -> int: ... +def writeUTF(data: str | bytes) -> bytearray: ... +def readUTF(buffer: bytes, maxlen: int) -> tuple[str, int]: ... +def writeBytes(buffer: bytes) -> bytearray: ... +def readBytes(buffer: bytes) -> tuple[bytes, int]: ... + +class VariableByteIntegers: + @staticmethod + def encode(x: int) -> bytes: ... + @staticmethod + def decode(buffer: bytes) -> tuple[int, int]: ... + +class Properties: + packetType: int + types: list[str] + names: dict[str, int] + properties: dict[int, tuple[int, list[int]]] + def __init__(self, packetType: int) -> None: ... + def allowsMultiple(self, compressedName: str) -> bool: ... + def getIdentFromName(self, compressedName: str) -> int: ... + def __setattr__(self, name: str, value: Any) -> None: ... + def json(self) -> dict[str, Any]: ... + def isEmpty(self) -> bool: ... + def clear(self) -> None: ... + def writeProperty(self, identifier: int, type: int, value: Any) -> bytes: ... + def pack(self) -> bytes: ... + def readProperty(self, buffer: bytes, type: int, propslen: int) -> Any: ... + def getNameFromIdent(self, identifier: int) -> str | None: ... + def unpack(self, buffer: bytes) -> tuple[Properties, int]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/paho-mqtt/paho/mqtt/publish.pyi b/packages/pyright-internal/typeshed-fallback/stubs/paho-mqtt/paho/mqtt/publish.pyi new file mode 100644 index 000000000..af1402336 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/paho-mqtt/paho/mqtt/publish.pyi @@ -0,0 +1,62 @@ +import ssl +from collections.abc import Iterable +from typing_extensions import NotRequired, TypeAlias, TypedDict + +_Payload: TypeAlias = str | bytes | bytearray | float + +class _Msg(TypedDict): + topic: str + payload: NotRequired[_Payload | None] + qos: NotRequired[int] + retain: NotRequired[int] + +class _Auth(TypedDict): + username: str + password: NotRequired[str] + +class _TLS(TypedDict): + ca_certs: str + certfile: NotRequired[str] + keyfile: NotRequired[str] + tls_version: NotRequired[ssl._SSLMethod] + ciphers: NotRequired[str] + insecure: NotRequired[str] + cert_reqs: NotRequired[ssl.VerifyMode] + keyfile_password: NotRequired[ssl._PasswordType] + +class _Proxy(TypedDict): + proxy_type: int + proxy_addr: str + proxy_rdns: NotRequired[bool] + proxy_username: NotRequired[str] + proxy_passwor: NotRequired[str] + +def multiple( + msgs: Iterable[_Msg], + hostname: str = ..., + port: int = ..., + client_id: str = ..., + keepalive: int = ..., + will: _Msg | None = ..., + auth: _Auth | None = ..., + tls: _TLS | None = ..., + protocol: int = ..., + transport: str = ..., + proxy_args: _Proxy | None = ..., +) -> None: ... +def single( + topic: str, + payload: _Payload | None = ..., + qos: int | None = ..., + retain: bool | None = ..., + hostname: str = ..., + port: int = ..., + client_id: str = ..., + keepalive: int = ..., + will: _Msg | None = ..., + auth: _Auth | None = ..., + tls: _TLS | None = ..., + protocol: int = ..., + transport: str = ..., + proxy_args: _Proxy | None = ..., +) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/paho-mqtt/paho/mqtt/reasoncodes.pyi b/packages/pyright-internal/typeshed-fallback/stubs/paho-mqtt/paho/mqtt/reasoncodes.pyi new file mode 100644 index 000000000..3a3b20f5b --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/paho-mqtt/paho/mqtt/reasoncodes.pyi @@ -0,0 +1,13 @@ +class ReasonCodes: + packetType: int + names: dict[int, dict[str, list[int]]] + value: int + def __init__(self, packetType: int, aName: str = ..., identifier: int = ...) -> None: ... + def __getName__(self, packetType: int, identifier: int) -> str: ... + def getId(self, name: str) -> int: ... + def set(self, name: str) -> None: ... + def unpack(self, buffer: bytearray) -> int: ... + def getName(self) -> str: ... + def __eq__(self, other: object) -> bool: ... + def json(self) -> str: ... + def pack(self) -> bytearray: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/paho-mqtt/paho/mqtt/subscribe.pyi b/packages/pyright-internal/typeshed-fallback/stubs/paho-mqtt/paho/mqtt/subscribe.pyi new file mode 100644 index 000000000..a9a7e0058 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/paho-mqtt/paho/mqtt/subscribe.pyi @@ -0,0 +1,39 @@ +from collections.abc import Callable + +from .client import Client, MQTTMessage, _UserData +from .publish import _TLS, _Auth, _Msg, _Proxy + +def callback( + callback: Callable[[Client, _UserData, MQTTMessage], None], + topics: list[str], + qos: int = ..., + userdata: _UserData | None = ..., + hostname: str = ..., + port: int = ..., + client_id: str = ..., + keepalive: int = ..., + will: _Msg | None = ..., + auth: _Auth | None = ..., + tls: _TLS | None = ..., + protocol: int = ..., + transport: str = ..., + clean_session: bool = ..., + proxy_args: _Proxy | None = ..., +) -> None: ... +def simple( + topics: str | list[str], + qos: int = ..., + msg_count: int = ..., + retained: bool = ..., + hostname: str = ..., + port: int = ..., + client_id: str = ..., + keepalive: int = ..., + will: _Msg | None = ..., + auth: _Auth | None = ..., + tls: _TLS | None = ..., + protocol: int = ..., + transport: str = ..., + clean_session: bool = ..., + proxy_args: _Proxy | None = ..., +) -> list[MQTTMessage] | MQTTMessage: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/paho-mqtt/paho/mqtt/subscribeoptions.pyi b/packages/pyright-internal/typeshed-fallback/stubs/paho-mqtt/paho/mqtt/subscribeoptions.pyi new file mode 100644 index 000000000..4d9c58501 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/paho-mqtt/paho/mqtt/subscribeoptions.pyi @@ -0,0 +1,25 @@ +from typing import Any +from typing_extensions import TypedDict + +from . import MQTTException as MQTTException + +class _SubscribeOptionsJson(TypedDict): + QoS: int + noLocal: bool + retainAsPublished: bool + retainHandling: int + +class SubscribeOptions: + RETAIN_SEND_ON_SUBSCRIBE: int + RETAIN_SEND_IF_NEW_SUB: int + RETAIN_DO_NOT_SEND: int + names: list[str] + Qos: int + noLocal: bool + retainAsPublished: bool + retainHandling: int + def __init__(self, qos: int = ..., noLocal: bool = ..., retainAsPublished: bool = ..., retainHandling: int = ...) -> None: ... + def __setattr__(self, name: str, value: Any) -> None: ... + def pack(self) -> bytes: ... + def unpack(self, buffer: bytes | bytearray) -> int: ... + def json(self) -> _SubscribeOptionsJson: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/paramiko/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/paramiko/METADATA.toml index 932f3f6a8..3fdfdc78d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/paramiko/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/paramiko/METADATA.toml @@ -1,2 +1,8 @@ -version = "2.11.*" -requires = ["types-cryptography"] +version = "3.0.*" +# Requires a version of cryptography where cryptography.hazmat.primitives.ciphers.Cipher is generic +requires = ["cryptography>=37.0.0"] + +[tool.stubtest] +ignore_missing_stub = true +# linux and darwin are equivalent +platforms = ["linux", "win32"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/__init__.pyi index f3e67d07f..6d9c20fbb 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/__init__.pyi @@ -8,7 +8,7 @@ from paramiko.client import ( WarningPolicy as WarningPolicy, ) from paramiko.common import io_sleep as io_sleep -from paramiko.config import SSHConfig as SSHConfig +from paramiko.config import SSHConfig as SSHConfig, SSHConfigDict as SSHConfigDict from paramiko.dsskey import DSSKey as DSSKey from paramiko.ecdsakey import ECDSAKey as ECDSAKey from paramiko.ed25519key import Ed25519Key as Ed25519Key @@ -31,11 +31,16 @@ from paramiko.ssh_exception import ( BadAuthenticationType as BadAuthenticationType, BadHostKeyException as BadHostKeyException, ChannelException as ChannelException, + ConfigParseError as ConfigParseError, + CouldNotCanonicalize as CouldNotCanonicalize, PasswordRequiredException as PasswordRequiredException, ProxyCommandFailure as ProxyCommandFailure, SSHException as SSHException, ) from paramiko.transport import SecurityOptions as SecurityOptions, Transport as Transport +__author__: str +__license__: str + # Names in __all__ with no definition: # util diff --git a/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/_version.pyi b/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/_version.pyi index 1f2297095..8faa8a2d7 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/_version.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/_version.pyi @@ -1 +1,2 @@ __version_info__: tuple[int, int, int] +__version__: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/_winapi.pyi b/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/_winapi.pyi index 7bf555876..2943652ef 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/_winapi.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/_winapi.pyi @@ -1,9 +1,10 @@ import builtins import ctypes import sys -from _typeshed import Self +from _typeshed import Incomplete from types import TracebackType from typing import Any +from typing_extensions import Self if sys.platform == "win32": def format_system_message(errno: int) -> str | None: ... @@ -33,8 +34,8 @@ if sys.platform == "win32": pos: int filemap: Any = ... view: Any = ... - def __init__(self, name: str, length: int, security_attributes: Any | None = ...) -> None: ... - def __enter__(self: Self) -> Self: ... + def __init__(self, name: str, length: int, security_attributes: Incomplete | None = ...) -> None: ... + def __enter__(self) -> Self: ... def seek(self, pos: int) -> None: ... def write(self, msg: bytes) -> None: ... def read(self, n: int) -> bytes: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/buffered_pipe.pyi b/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/buffered_pipe.pyi index 7a6760279..c31584e50 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/buffered_pipe.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/buffered_pipe.pyi @@ -1,7 +1,7 @@ from threading import Event from typing import AnyStr, Generic -class PipeTimeout(IOError): ... +class PipeTimeout(OSError): ... class BufferedPipe(Generic[AnyStr]): def __init__(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/client.pyi b/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/client.pyi index 103c50b7c..e8adb90f9 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/client.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/client.pyi @@ -1,5 +1,5 @@ from collections.abc import Iterable, Mapping -from typing import NoReturn +from typing import NoReturn, Protocol from paramiko.channel import Channel, ChannelFile, ChannelStderrFile, ChannelStdinFile from paramiko.hostkeys import HostKeys @@ -10,6 +10,11 @@ from paramiko.util import ClosingContextManager from .transport import _SocketLike +class _TransportFactory(Protocol): + def __call__( + self, __sock: _SocketLike, *, gss_kex: bool, gss_deleg_creds: bool, disabled_algorithms: dict[str, Iterable[str]] | None + ) -> Transport: ... + class SSHClient(ClosingContextManager): def __init__(self) -> None: ... def load_system_host_keys(self, filename: str | None = ...) -> None: ... @@ -40,6 +45,7 @@ class SSHClient(ClosingContextManager): gss_trust_dns: bool = ..., passphrase: str | None = ..., disabled_algorithms: dict[str, Iterable[str]] | None = ..., + transport_factory: _TransportFactory | None = ..., ) -> None: ... def close(self) -> None: ... def exec_command( diff --git a/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/common.pyi b/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/common.pyi index 3900ce064..c895dfd31 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/common.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/common.pyi @@ -1,5 +1,6 @@ -from typing import Protocol -from typing_extensions import TypeAlias +def byte_ord(c: int | str) -> int: ... +def byte_chr(c: int) -> bytes: ... +def byte_mask(c: int, mask: int) -> bytes: ... MSG_DISCONNECT: int MSG_IGNORE: int @@ -101,14 +102,6 @@ linefeed_byte: bytes crlf: bytes cr_byte_value: int linefeed_byte_value: int - -class _SupportsAsBytes(Protocol): - def asbytes(self) -> bytes: ... - -_LikeBytes: TypeAlias = bytes | str | _SupportsAsBytes - -def asbytes(s: _LikeBytes) -> bytes: ... - xffffffff: int x80000000: int o666: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/config.pyi b/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/config.pyi index 3e100ed56..a7c30feaf 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/config.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/config.pyi @@ -1,7 +1,7 @@ -from _typeshed import Self from collections.abc import Iterable from re import Pattern -from typing import IO, Any +from typing import IO +from typing_extensions import Self from paramiko.ssh_exception import ConfigParseError as ConfigParseError, CouldNotCanonicalize as CouldNotCanonicalize @@ -12,11 +12,11 @@ class SSHConfig: TOKENS_BY_CONFIG_KEY: dict[str, list[str]] def __init__(self) -> None: ... @classmethod - def from_text(cls: type[Self], text: str) -> Self: ... + def from_text(cls, text: str) -> Self: ... @classmethod - def from_path(cls: type[Self], path: str) -> Self: ... + def from_path(cls, path: str) -> Self: ... @classmethod - def from_file(cls: type[Self], flo: IO[str]) -> Self: ... + def from_file(cls, flo: IO[str]) -> Self: ... def parse(self, file_obj: IO[str]) -> None: ... def lookup(self, hostname: str) -> SSHConfigDict: ... def canonicalize(self, hostname: str, options: SSHConfigDict, domains: Iterable[str]) -> str: ... @@ -29,6 +29,5 @@ class LazyFqdn: def __init__(self, config: SSHConfigDict, host: str | None = ...) -> None: ... class SSHConfigDict(dict[str, str]): - def __init__(self, *args: Any, **kwargs: Any) -> None: ... def as_bool(self, key: str) -> bool: ... def as_int(self, key: str) -> int: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/hostkeys.pyi b/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/hostkeys.pyi index 96d9d4816..c48011a59 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/hostkeys.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/hostkeys.pyi @@ -1,5 +1,5 @@ -from _typeshed import Self from collections.abc import Iterator, Mapping, MutableMapping +from typing_extensions import Self from paramiko.pkey import PKey @@ -42,5 +42,5 @@ class HostKeyEntry: key: PKey def __init__(self, hostnames: list[str] | None = ..., key: PKey | None = ...) -> None: ... @classmethod - def from_line(cls: type[Self], line: str, lineno: int | None = ...) -> Self | None: ... + def from_line(cls, line: str, lineno: int | None = ...) -> Self | None: ... def to_line(self) -> str | None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/message.pyi b/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/message.pyi index 0a69bb806..7314f1e0c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/message.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/message.pyi @@ -1,14 +1,19 @@ from collections.abc import Iterable from io import BytesIO -from typing import Any +from typing import Any, Protocol +from typing_extensions import TypeAlias -from .common import _LikeBytes +class _SupportsAsBytes(Protocol): + def asbytes(self) -> bytes: ... + +_LikeBytes: TypeAlias = bytes | str | _SupportsAsBytes class Message: big_int: int packet: BytesIO seqno: int # only when packet.Packetizer.read_message() is used def __init__(self, content: bytes | None = ...) -> None: ... + def __bytes__(self) -> bytes: ... def asbytes(self) -> bytes: ... def rewind(self) -> None: ... def get_remainder(self) -> bytes: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/packet.pyi b/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/packet.pyi index f7e62d853..815eaed86 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/packet.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/packet.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from collections.abc import Callable from hashlib import _Hash from logging import Logger @@ -25,7 +26,7 @@ class Packetizer: def set_log(self, log: Logger) -> None: ... def set_outbound_cipher( self, - block_engine: Cipher, + block_engine: Cipher[Incomplete], block_size: int, mac_engine: _Hash, mac_size: int, @@ -34,7 +35,7 @@ class Packetizer: etm: bool = ..., ) -> None: ... def set_inbound_cipher( - self, block_engine: Cipher, block_size: int, mac_engine: _Hash, mac_size: int, mac_key: bytes, etm: bool = ... + self, block_engine: Cipher[Incomplete], block_size: int, mac_engine: _Hash, mac_size: int, mac_key: bytes, etm: bool = ... ) -> None: ... def set_outbound_compressor(self, compressor: ZlibCompressor) -> None: ... def set_inbound_compressor(self, compressor: ZlibDecompressor) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/pkey.pyi b/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/pkey.pyi index 6dd72d5ff..9daefd876 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/pkey.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/pkey.pyi @@ -1,6 +1,6 @@ -from _typeshed import Self from re import Pattern from typing import IO +from typing_extensions import Self from paramiko.message import Message @@ -14,7 +14,7 @@ class PKey: END_TAG: Pattern[str] def __init__(self, msg: Message | None = ..., data: str | None = ...) -> None: ... def asbytes(self) -> bytes: ... - def __cmp__(self, other: object) -> int: ... + def __bytes__(self) -> bytes: ... def __eq__(self, other: object) -> bool: ... def get_name(self) -> str: ... def get_bits(self) -> int: ... @@ -24,9 +24,9 @@ class PKey: def sign_ssh_data(self, data: bytes, algorithm: str | None = ...) -> Message: ... def verify_ssh_sig(self, data: bytes, msg: Message) -> bool: ... @classmethod - def from_private_key_file(cls: type[Self], filename: str, password: str | None = ...) -> Self: ... + def from_private_key_file(cls, filename: str, password: str | None = ...) -> Self: ... @classmethod - def from_private_key(cls: type[Self], file_obj: IO[str], password: str | None = ...) -> Self: ... + def from_private_key(cls, file_obj: IO[str], password: str | None = ...) -> Self: ... def write_private_key_file(self, filename: str, password: str | None = ...) -> None: ... def write_private_key(self, file_obj: IO[str], password: str | None = ...) -> None: ... def load_certificate(self, value: Message | str) -> None: ... @@ -37,10 +37,10 @@ class PublicBlob: comment: str def __init__(self, type_: str, blob: bytes, comment: str | None = ...) -> None: ... @classmethod - def from_file(cls: type[Self], filename: str) -> Self: ... + def from_file(cls, filename: str) -> Self: ... @classmethod - def from_string(cls: type[Self], string: str) -> Self: ... + def from_string(cls, string: str) -> Self: ... @classmethod - def from_message(cls: type[Self], message: Message) -> Self: ... + def from_message(cls, message: Message) -> Self: ... def __eq__(self, other: object) -> bool: ... def __ne__(self, other: object) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/py3compat.pyi b/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/py3compat.pyi deleted file mode 100644 index 9f64106ab..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/py3compat.pyi +++ /dev/null @@ -1,31 +0,0 @@ -import builtins as builtins -from collections.abc import Iterable, Sequence -from io import BytesIO as BytesIO, StringIO as StringIO -from typing import Any, TypeVar - -_T = TypeVar("_T") - -PY2: bool - -string_types: type[Any] | Sequence[type[Any]] -text_type: type[Any] | Sequence[type[Any]] -bytes_types: type[Any] | Sequence[type[Any]] -integer_types: type[Any] | Sequence[type[Any]] -long = int - -def input(prompt: Any) -> str: ... -def decodebytes(s: bytes) -> bytes: ... -def encodebytes(s: bytes) -> bytes: ... - -bytes = builtins.bytes - -def byte_ord(c: int | str) -> int: ... -def byte_chr(c: int) -> bytes: ... -def byte_mask(c: int, mask: int) -> bytes: ... -def b(s: bytes | str, encoding: str = ...) -> bytes: ... -def u(s: bytes | str, encoding: str = ...) -> str: ... -def b2s(s: bytes | str) -> str: ... -def is_callable(c: Any) -> bool: ... -def next(c: Iterable[_T]) -> _T: ... - -MAXSIZE: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/sftp_attr.pyi b/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/sftp_attr.pyi index 3a397ff71..b97f99df6 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/sftp_attr.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/sftp_attr.pyi @@ -1,5 +1,5 @@ -from _typeshed import Self from os import stat_result +from typing_extensions import Self class SFTPAttributes: FLAG_SIZE: int @@ -18,5 +18,5 @@ class SFTPAttributes: attr: dict[str, str] def __init__(self) -> None: ... @classmethod - def from_stat(cls: type[Self], obj: stat_result, filename: str | None = ...) -> Self: ... + def from_stat(cls, obj: stat_result, filename: str | None = ...) -> Self: ... def asbytes(self) -> bytes: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/sftp_client.pyi b/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/sftp_client.pyi index ebaa92cb7..54d543b39 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/sftp_client.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/sftp_client.pyi @@ -1,8 +1,7 @@ -from _typeshed import Self from collections.abc import Callable, Iterator from logging import Logger from typing import IO -from typing_extensions import TypeAlias +from typing_extensions import Self, TypeAlias from paramiko.channel import Channel from paramiko.sftp import BaseSFTP @@ -22,9 +21,7 @@ class SFTPClient(BaseSFTP, ClosingContextManager): logger: Logger def __init__(self, sock: Channel) -> None: ... @classmethod - def from_transport( - cls: type[Self], t: Transport, window_size: int | None = ..., max_packet_size: int | None = ... - ) -> Self | None: ... + def from_transport(cls, t: Transport, window_size: int | None = ..., max_packet_size: int | None = ...) -> Self | None: ... def close(self) -> None: ... def get_channel(self) -> Channel | None: ... def listdir(self, path: str = ...) -> list[str]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/util.pyi b/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/util.pyi index 3abe7d399..7f94a074f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/util.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/util.pyi @@ -1,9 +1,8 @@ -from _typeshed import Self -from collections.abc import Callable from hashlib import _Hash from logging import Logger, LogRecord from types import TracebackType -from typing import IO, AnyStr, Protocol, TypeVar +from typing import IO, AnyStr, Protocol +from typing_extensions import Self from paramiko.config import SSHConfig, SSHConfigDict from paramiko.hostkeys import HostKeys @@ -11,13 +10,7 @@ from paramiko.hostkeys import HostKeys class SupportsClose(Protocol): def close(self) -> None: ... -_T = TypeVar("_T") - def inflate_long(s: bytes, always_positive: bool = ...) -> int: ... - -deflate_zero: int -deflate_ff: int - def deflate_long(n: int, add_sign_padding: bool = ...) -> bytes: ... def format_binary(data: bytes, prefix: str = ...) -> list[str]: ... def format_binary_line(data: bytes) -> str: ... @@ -36,13 +29,18 @@ class PFilter: def filter(self, record: LogRecord) -> bool: ... def get_logger(name: str) -> Logger: ... -def retry_on_signal(function: Callable[[], _T]) -> _T: ... def constant_time_bytes_eq(a: AnyStr, b: AnyStr) -> bool: ... class ClosingContextManager: - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, type: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None ) -> None: ... def clamp_value(minimum: int, val: int, maximum: int) -> int: ... + +# This function attempts to convert objects to bytes, +# *but* just returns the object unchanged if that was unsuccessful! +def asbytes(s: object) -> object: ... +def b(s: str | bytes, encoding: str = "utf8") -> bytes: ... +def u(s: str | bytes, encoding: str = "utf8") -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/win_openssh.pyi b/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/win_openssh.pyi new file mode 100644 index 000000000..bc74d4c21 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/win_openssh.pyi @@ -0,0 +1,12 @@ +import sys + +if sys.platform == "win32": + PIPE_NAME: str + + def can_talk_to_agent() -> bool: ... + + class OpenSSHAgentConnection: + def __init__(self) -> None: ... + def send(self, data: bytes) -> int: ... + def recv(self, n: int) -> bytes: ... + def close(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/win_pageant.pyi b/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/win_pageant.pyi index 6bca6a3af..9c8dba685 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/win_pageant.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/win_pageant.pyi @@ -1,14 +1,17 @@ import ctypes import sys +from typing_extensions import Literal, TypeAlias if sys.platform == "win32": win32con_WM_COPYDATA: int - def can_talk_to_agent(): ... + def can_talk_to_agent() -> bool: ... + + ULONG_PTR: TypeAlias = ctypes.c_uint64 | ctypes.c_uint32 class COPYDATASTRUCT(ctypes.Structure): ... class PageantConnection: def __init__(self) -> None: ... def send(self, data: bytes) -> None: ... - def recv(self, n: int) -> bytes: ... + def recv(self, n: int) -> Literal[""] | bytes: ... def close(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/parsimonious/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/parsimonious/METADATA.toml index 51e869b47..5c7ed21e8 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/parsimonious/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/parsimonious/METADATA.toml @@ -1 +1 @@ -version = "0.9.*" +version = "0.10.*" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/parsimonious/parsimonious/exceptions.pyi b/packages/pyright-internal/typeshed-fallback/stubs/parsimonious/parsimonious/exceptions.pyi index 243b0a458..9401ce5f8 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/parsimonious/parsimonious/exceptions.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/parsimonious/parsimonious/exceptions.pyi @@ -11,6 +11,7 @@ class ParseError(StrAndRepr, Exception): def line(self) -> int: ... def column(self) -> int: ... +class LeftRecursionError(ParseError): ... class IncompleteParseError(ParseError): ... class VisitationError(Exception): diff --git a/packages/pyright-internal/typeshed-fallback/stubs/parsimonious/parsimonious/expressions.pyi b/packages/pyright-internal/typeshed-fallback/stubs/parsimonious/parsimonious/expressions.pyi index a6dbc314b..eef538916 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/parsimonious/parsimonious/expressions.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/parsimonious/parsimonious/expressions.pyi @@ -1,28 +1,30 @@ import collections.abc from collections.abc import Callable, Mapping from re import Pattern -from typing import Any, Union -from typing_extensions import TypeAlias +from typing import Any +from typing_extensions import Self, TypeAlias from parsimonious.exceptions import ParseError from parsimonious.grammar import Grammar from parsimonious.nodes import Node from parsimonious.utils import StrAndRepr -MARKER: Any - -_CALLABLE_RETURN_TYPE: TypeAlias = Union[int, tuple[int, list[Node]], Node, None] +_CALLABLE_RETURN_TYPE: TypeAlias = int | tuple[int, list[Node]] | Node | None _CALLABLE_TYPE: TypeAlias = ( Callable[[str, int], _CALLABLE_RETURN_TYPE] | Callable[[str, int, Mapping[tuple[int, int], Node], ParseError, Grammar], _CALLABLE_RETURN_TYPE] ) +def is_callable(value: object) -> bool: ... def expression(callable: _CALLABLE_TYPE, rule_name: str, grammar: Grammar) -> Expression: ... +IN_PROGRESS: object + class Expression(StrAndRepr): name: str identity_tuple: tuple[str] def __init__(self, name: str = ...) -> None: ... + def resolve_refs(self, rule_map: Mapping[str, Expression]) -> Self: ... def parse(self, text: str, pos: int = ...) -> Node: ... def match(self, text: str, pos: int = ...) -> Node: ... def match_core(self, text: str, pos: int, cache: Mapping[tuple[int, int], Node], error: ParseError) -> Node: ... @@ -57,11 +59,18 @@ class Compound(Expression): class Sequence(Compound): ... class OneOf(Compound): ... -class Lookahead(Compound): ... -class Not(Compound): ... -class Optional(Compound): ... -class ZeroOrMore(Compound): ... -class OneOrMore(Compound): +class Lookahead(Compound): + negativity: bool + def __init__(self, member: Expression, *, negative: bool = ..., **kwargs: Any) -> None: ... + +def Not(term: Expression) -> Lookahead: ... + +class Quantifier(Compound): min: int - def __init__(self, member: Expression, name: str = ..., min: int = ...) -> None: ... + max: float + def __init__(self, member: Expression, *, min: int = ..., max: float = ..., name: str = ..., **kwargs: Any) -> None: ... + +def ZeroOrMore(member: Expression, name: str = ...) -> Quantifier: ... +def OneOrMore(member: Expression, name: str = ..., min: int = ...) -> Quantifier: ... +def Optional(member: Expression, name: str = ...) -> Quantifier: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/parsimonious/parsimonious/grammar.pyi b/packages/pyright-internal/typeshed-fallback/stubs/parsimonious/parsimonious/grammar.pyi index a302df492..84855da64 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/parsimonious/parsimonious/grammar.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/parsimonious/parsimonious/grammar.pyi @@ -1,13 +1,14 @@ import collections.abc +from _typeshed import Incomplete from collections import OrderedDict from collections.abc import Callable, Mapping from typing import Any, NoReturn -from parsimonious.expressions import _CALLABLE_TYPE, Expression, Literal, Lookahead, Not, OneOf, Regex, Sequence, TokenMatcher +from parsimonious.expressions import _CALLABLE_TYPE, Expression, Literal, Lookahead, OneOf, Regex, Sequence, TokenMatcher from parsimonious.nodes import Node, NodeVisitor class Grammar(OrderedDict[str, Expression]): - default_rule: Expression | Any + default_rule: Expression | Incomplete def __init__(self, rules: str = ..., **more_rules: Expression | _CALLABLE_TYPE) -> None: ... def default(self, rule_name: str) -> Grammar: ... def parse(self, text: str, pos: int = ...) -> Node: ... @@ -20,32 +21,33 @@ rule_syntax: str class LazyReference(str): name: str + def resolve_refs(self, rule_map: Mapping[str, Expression | LazyReference]) -> Expression: ... -class RuleVisitor(NodeVisitor): +class RuleVisitor(NodeVisitor[tuple[OrderedDict[str, Expression], Expression | None]]): quantifier_classes: dict[str, type[Expression]] visit_expression: Callable[[RuleVisitor, Node, collections.abc.Sequence[Any]], Any] visit_term: Callable[[RuleVisitor, Node, collections.abc.Sequence[Any]], Any] visit_atom: Callable[[RuleVisitor, Node, collections.abc.Sequence[Any]], Any] custom_rules: dict[str, Expression] def __init__(self, custom_rules: Mapping[str, Expression] | None = ...) -> None: ... - def visit_rules( - self, node: Node, rules_list: collections.abc.Sequence[Any] - ) -> tuple[OrderedDict[str, Expression], Expression | None]: ... + def visit_parenthesized(self, node: Node, parenthesized: collections.abc.Sequence[Any]) -> Expression: ... + def visit_quantifier(self, node: Node, quantifier: collections.abc.Sequence[Any]) -> Node: ... + def visit_quantified(self, node: Node, quantified: collections.abc.Sequence[Any]) -> Expression: ... + def visit_lookahead_term(self, node: Node, lookahead_term: collections.abc.Sequence[Any]) -> Lookahead: ... + def visit_not_term(self, node: Node, not_term: collections.abc.Sequence[Any]) -> Lookahead: ... def visit_rule(self, node: Node, rule: collections.abc.Sequence[Any]) -> Expression: ... - def visit_label(self, node: Node, label: collections.abc.Sequence[Any]) -> str: ... + def visit_sequence(self, node: Node, sequence: collections.abc.Sequence[Any]) -> Sequence: ... def visit_ored(self, node: Node, ored: collections.abc.Sequence[Any]) -> OneOf: ... def visit_or_term(self, node: Node, or_term: collections.abc.Sequence[Any]) -> Expression: ... - def visit_sequence(self, node: Node, sequence: collections.abc.Sequence[Any]) -> Sequence: ... - def visit_not_term(self, node: Node, not_term: collections.abc.Sequence[Any]) -> Not: ... - def visit_lookahead_term(self, node: Node, lookahead_term: collections.abc.Sequence[Any]) -> Lookahead: ... - def visit_quantified(self, node: Node, quantified: collections.abc.Sequence[Any]) -> Expression: ... - def visit_quantifier(self, node: Node, quantifier: collections.abc.Sequence[Any]) -> Node: ... + def visit_label(self, node: Node, label: collections.abc.Sequence[Any]) -> str: ... def visit_reference(self, node: Node, reference: collections.abc.Sequence[Any]) -> LazyReference: ... - def visit_literal(self, node: Node, literal: collections.abc.Sequence[Any]) -> Literal: ... - def visit_spaceless_literal(self, spaceless_literal: Node, visited_children: collections.abc.Sequence[Any]) -> Literal: ... def visit_regex(self, node: Node, regex: collections.abc.Sequence[Any]) -> Regex: ... - def visit_parenthesized(self, node: Node, parenthesized: collections.abc.Sequence[Any]) -> Expression: ... + def visit_spaceless_literal(self, spaceless_literal: Node, visited_children: collections.abc.Sequence[Any]) -> Literal: ... + def visit_literal(self, node: Node, literal: collections.abc.Sequence[Any]) -> Literal: ... def generic_visit(self, node: Node, visited_children: collections.abc.Sequence[Any]) -> collections.abc.Sequence[Any] | Node: ... # type: ignore[override] + def visit_rules( + self, node: Node, rules_list: collections.abc.Sequence[Any] + ) -> tuple[OrderedDict[str, Expression], Expression | None]: ... class TokenRuleVisitor(RuleVisitor): def visit_spaceless_literal( diff --git a/packages/pyright-internal/typeshed-fallback/stubs/parsimonious/parsimonious/nodes.pyi b/packages/pyright-internal/typeshed-fallback/stubs/parsimonious/parsimonious/nodes.pyi index 15cfb6b64..309a28cb1 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/parsimonious/parsimonious/nodes.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/parsimonious/parsimonious/nodes.pyi @@ -1,6 +1,7 @@ +from _typeshed import Incomplete from collections.abc import Callable, Iterator, Sequence from re import Match -from typing import Any, NoReturn, TypeVar +from typing import Any, Generic, TypeVar from parsimonious.exceptions import VisitationError as VisitationError from parsimonious.expressions import Expression @@ -19,20 +20,24 @@ class Node: @property def text(self) -> str: ... def prettily(self, error: Node | None = ...) -> str: ... + def __repr__(self, top_level: bool = ...) -> str: ... class RegexNode(Node): match: Match[str] class RuleDecoratorMeta(type): ... -class NodeVisitor(metaclass=RuleDecoratorMeta): - grammar: Grammar | Any - unwrapped_exceptions: tuple[type[Exception], ...] - def visit(self, node: Node) -> Any: ... - def generic_visit(self, node: Node, visited_children: Sequence[Any]) -> NoReturn: ... - def parse(self, text: str, pos: int = ...) -> Node: ... - def match(self, text: str, pos: int = ...) -> Node: ... - def lift_child(self, node: Node, children: Sequence[Any]) -> Any: ... +_VisitResultT = TypeVar("_VisitResultT") +_ChildT = TypeVar("_ChildT") + +class NodeVisitor(Generic[_VisitResultT], metaclass=RuleDecoratorMeta): + grammar: Grammar | Incomplete + unwrapped_exceptions: tuple[type[BaseException], ...] + def visit(self, node: Node) -> _VisitResultT: ... + def generic_visit(self, node: Node, visited_children: Sequence[Any]) -> Incomplete: ... + def parse(self, text: str, pos: int = ...) -> _VisitResultT: ... + def match(self, text: str, pos: int = ...) -> _VisitResultT: ... + def lift_child(self, node: Node, children: Sequence[_ChildT]) -> _ChildT: ... _CallableT = TypeVar("_CallableT", bound=Callable[..., Any]) diff --git a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/apache.pyi b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/apache.pyi index ce97a3981..fcb0a458e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/apache.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/apache.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any class _CommonFile: @@ -10,7 +11,7 @@ class _CommonFile: def from_path(cls, path, **kwds): ... def __init__( self, - path: Any | None = ..., + path: Incomplete | None = ..., new: bool = ..., autoload: bool = ..., autosave: bool = ..., @@ -24,14 +25,14 @@ class _CommonFile: @property def mtime(self): ... def load_if_changed(self): ... - def load(self, path: Any | None = ..., force: bool = ...): ... + def load(self, path: Incomplete | None = ..., force: bool = ...): ... def load_string(self, data) -> None: ... - def save(self, path: Any | None = ...) -> None: ... + def save(self, path: Incomplete | None = ...) -> None: ... def to_string(self): ... class HtpasswdFile(_CommonFile): context: Any - def __init__(self, path: Any | None = ..., default_scheme: Any | None = ..., context=..., **kwds) -> None: ... + def __init__(self, path: Incomplete | None = ..., default_scheme: Incomplete | None = ..., context=..., **kwds) -> None: ... def users(self): ... def set_password(self, user, password): ... def update(self, user, password): ... @@ -44,15 +45,15 @@ class HtpasswdFile(_CommonFile): class HtdigestFile(_CommonFile): default_realm: Any - def __init__(self, path: Any | None = ..., default_realm: Any | None = ..., **kwds) -> None: ... + def __init__(self, path: Incomplete | None = ..., default_realm: Incomplete | None = ..., **kwds) -> None: ... def realms(self): ... - def users(self, realm: Any | None = ...): ... - def set_password(self, user, realm: Any | None = ..., password=...): ... + def users(self, realm: Incomplete | None = ...): ... + def set_password(self, user, realm: Incomplete | None = ..., password=...): ... def update(self, user, realm, password): ... - def get_hash(self, user, realm: Any | None = ...): ... - def set_hash(self, user, realm: Any | None = ..., hash=...): ... + def get_hash(self, user, realm: Incomplete | None = ...): ... + def set_hash(self, user, realm: Incomplete | None = ..., hash=...): ... def find(self, user, realm): ... - def delete(self, user, realm: Any | None = ...): ... + def delete(self, user, realm: Incomplete | None = ...): ... def delete_realm(self, realm): ... - def check_password(self, user, realm: Any | None = ..., password=...): ... + def check_password(self, user, realm: Incomplete | None = ..., password=...): ... def verify(self, user, realm, password): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/context.pyi b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/context.pyi index 2a394d141..f2c511a36 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/context.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/context.pyi @@ -1,5 +1,6 @@ -from _typeshed import Self, StrOrBytesPath, SupportsItems +from _typeshed import Incomplete, StrOrBytesPath, SupportsItems from typing import Any +from typing_extensions import Self class CryptPolicy: @classmethod @@ -15,24 +16,24 @@ class CryptPolicy: def has_schemes(self): ... def iter_handlers(self): ... def schemes(self, resolve: bool = ...): ... - def get_handler(self, name: Any | None = ..., category: Any | None = ..., required: bool = ...): ... - def get_min_verify_time(self, category: Any | None = ...): ... - def get_options(self, name, category: Any | None = ...): ... - def handler_is_deprecated(self, name, category: Any | None = ...): ... + def get_handler(self, name: Incomplete | None = ..., category: Incomplete | None = ..., required: bool = ...): ... + def get_min_verify_time(self, category: Incomplete | None = ...): ... + def get_options(self, name, category: Incomplete | None = ...): ... + def handler_is_deprecated(self, name, category: Incomplete | None = ...): ... def iter_config(self, ini: bool = ..., resolve: bool = ...): ... def to_dict(self, resolve: bool = ...): ... def to_file(self, stream, section: str = ...) -> None: ... - def to_string(self, section: str = ..., encoding: Any | None = ...): ... + def to_string(self, section: str = ..., encoding: Incomplete | None = ...): ... class CryptContext: @classmethod - def from_string(cls: type[Self], source: str | bytes, section: str = ..., encoding: str = ...) -> Self: ... + def from_string(cls, source: str | bytes, section: str = ..., encoding: str = ...) -> Self: ... @classmethod - def from_path(cls: type[Self], path: StrOrBytesPath, section: str = ..., encoding: str = ...) -> Self: ... + def from_path(cls, path: StrOrBytesPath, section: str = ..., encoding: str = ...) -> Self: ... def copy(self, **kwds: Any) -> CryptContext: ... def using(self, **kwds: Any) -> CryptContext: ... def replace(self, **kwds): ... - def __init__(self, schemes: Any | None = ..., policy=..., _autoload: bool = ..., **kwds) -> None: ... + def __init__(self, schemes: Incomplete | None = ..., policy=..., _autoload: bool = ..., **kwds) -> None: ... policy: CryptPolicy def load_path(self, path: StrOrBytesPath, update: bool = ..., section: str = ..., encoding: str = ...) -> None: ... def load( @@ -43,9 +44,9 @@ class CryptContext: encoding: str = ..., ) -> None: ... def update(self, *args: Any, **kwds: Any) -> None: ... - def schemes(self, resolve: bool = ..., category: Any | None = ..., unconfigured: bool = ...): ... - def default_scheme(self, category: Any | None = ..., resolve: bool = ..., unconfigured: bool = ...): ... - def handler(self, scheme: Any | None = ..., category: Any | None = ..., unconfigured: bool = ...): ... + def schemes(self, resolve: bool = ..., category: Incomplete | None = ..., unconfigured: bool = ...): ... + def default_scheme(self, category: Incomplete | None = ..., resolve: bool = ..., unconfigured: bool = ...): ... + def handler(self, scheme: Incomplete | None = ..., category: Incomplete | None = ..., unconfigured: bool = ...): ... @property def context_kwds(self): ... def to_dict(self, resolve: bool = ...) -> dict[str, Any]: ... @@ -60,17 +61,19 @@ class CryptContext: def needs_update( self, hash: str | bytes, scheme: str | None = ..., category: str | None = ..., secret: str | bytes | None = ... ) -> bool: ... - def hash_needs_update(self, hash, scheme: Any | None = ..., category: Any | None = ...): ... - def genconfig(self, scheme: Any | None = ..., category: Any | None = ..., **settings): ... - def genhash(self, secret, config, scheme: Any | None = ..., category: Any | None = ..., **kwds): ... - def identify(self, hash, category: Any | None = ..., resolve: bool = ..., required: bool = ..., unconfigured: bool = ...): ... + def hash_needs_update(self, hash, scheme: Incomplete | None = ..., category: Incomplete | None = ...): ... + def genconfig(self, scheme: Incomplete | None = ..., category: Incomplete | None = ..., **settings): ... + def genhash(self, secret, config, scheme: Incomplete | None = ..., category: Incomplete | None = ..., **kwds): ... + def identify( + self, hash, category: Incomplete | None = ..., resolve: bool = ..., required: bool = ..., unconfigured: bool = ... + ): ... def hash(self, secret: str | bytes, scheme: str | None = ..., category: str | None = ..., **kwds: Any) -> str: ... def encrypt(self, *args, **kwds): ... def verify( - self, secret: str | bytes, hash: str | bytes, scheme: str | None = ..., category: str | None = ..., **kwds: Any + self, secret: str | bytes, hash: str | bytes | None, scheme: str | None = ..., category: str | None = ..., **kwds: Any ) -> bool: ... def verify_and_update( - self, secret: str | bytes, hash: str | bytes, scheme: str | None = ..., category: str | None = ..., **kwds: Any + self, secret: str | bytes, hash: str | bytes | None, scheme: str | None = ..., category: str | None = ..., **kwds: Any ) -> tuple[bool, str | None]: ... def dummy_verify(self, elapsed: int = ...): ... def is_enabled(self, hash: str | bytes) -> bool: ... @@ -78,5 +81,5 @@ class CryptContext: def enable(self, hash: str | bytes) -> str: ... class LazyCryptContext(CryptContext): - def __init__(self, schemes: Any | None = ..., **kwds) -> None: ... + def __init__(self, schemes: Incomplete | None = ..., **kwds) -> None: ... def __getattribute__(self, attr: str) -> Any: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/crypto/_md4.pyi b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/crypto/_md4.pyi index 781fe3f65..0a21a688f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/crypto/_md4.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/crypto/_md4.pyi @@ -1,11 +1,11 @@ -from typing import Any +from _typeshed import Incomplete class md4: name: str digest_size: int digestsize: int block_size: int - def __init__(self, content: Any | None = ...) -> None: ... + def __init__(self, content: Incomplete | None = ...) -> None: ... def update(self, content) -> None: ... def copy(self): ... def digest(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/crypto/digest.pyi b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/crypto/digest.pyi index 5cbf48996..fcc8070d1 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/crypto/digest.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/crypto/digest.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from passlib.utils import SequenceMixin @@ -23,5 +24,5 @@ class HashInfo(SequenceMixin): def supported_by_hashlib_pbkdf2(self): ... def compile_hmac(digest, key, multipart: bool = ...): ... -def pbkdf1(digest, secret, salt, rounds, keylen: Any | None = ...): ... -def pbkdf2_hmac(digest, secret, salt, rounds, keylen: Any | None = ...): ... +def pbkdf1(digest, secret, salt, rounds, keylen: Incomplete | None = ...): ... +def pbkdf2_hmac(digest, secret, salt, rounds, keylen: Incomplete | None = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/exc.pyi b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/exc.pyi index 7c9f1c4dd..d7664ec1e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/exc.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/exc.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any class UnknownBackendError(ValueError): @@ -11,15 +12,15 @@ class PasswordValueError(ValueError): ... class PasswordSizeError(PasswordValueError): max_size: Any - def __init__(self, max_size, msg: Any | None = ...) -> None: ... + def __init__(self, max_size, msg: Incomplete | None = ...) -> None: ... class PasswordTruncateError(PasswordSizeError): - def __init__(self, cls, msg: Any | None = ...) -> None: ... + def __init__(self, cls, msg: Incomplete | None = ...) -> None: ... class PasslibSecurityError(RuntimeError): ... class TokenError(ValueError): - def __init__(self, msg: Any | None = ..., *args, **kwds) -> None: ... + def __init__(self, msg: Incomplete | None = ..., *args, **kwds) -> None: ... class MalformedTokenError(TokenError): ... class InvalidTokenError(TokenError): ... @@ -31,7 +32,7 @@ class UsedTokenError(TokenError): class UnknownHashError(ValueError): value: Any message: Any - def __init__(self, message: Any | None = ..., value: Any | None = ...) -> None: ... + def __init__(self, message: Incomplete | None = ..., value: Incomplete | None = ...) -> None: ... class PasslibWarning(UserWarning): ... class PasslibConfigWarning(PasslibWarning): ... @@ -42,11 +43,11 @@ class PasslibSecurityWarning(PasslibWarning): ... def type_name(value): ... def ExpectedTypeError(value, expected, param): ... def ExpectedStringError(value, param): ... -def MissingDigestError(handler: Any | None = ...): ... -def NullPasswordError(handler: Any | None = ...): ... -def InvalidHashError(handler: Any | None = ...): ... -def MalformedHashError(handler: Any | None = ..., reason: Any | None = ...): ... -def ZeroPaddedRoundsError(handler: Any | None = ...): ... +def MissingDigestError(handler: Incomplete | None = ...): ... +def NullPasswordError(handler: Incomplete | None = ...): ... +def InvalidHashError(handler: Incomplete | None = ...): ... +def MalformedHashError(handler: Incomplete | None = ..., reason: Incomplete | None = ...): ... +def ZeroPaddedRoundsError(handler: Incomplete | None = ...): ... def ChecksumSizeError(handler, raw: bool = ...): ... ENABLE_DEBUG_ONLY_REPR: bool diff --git a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/ext/django/utils.pyi b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/ext/django/utils.pyi index 20c629de6..e032611a9 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/ext/django/utils.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/ext/django/utils.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any __all__ = ["DJANGO_VERSION", "MIN_DJANGO_VERSION", "get_preset_config", "quirks"] @@ -14,7 +15,7 @@ def get_preset_config(name): ... class DjangoTranslator: context: Any - def __init__(self, context: Any | None = ..., **kwds) -> None: ... + def __init__(self, context: Incomplete | None = ..., **kwds) -> None: ... def reset_hashers(self) -> None: ... def passlib_to_django_name(self, passlib_name): ... def passlib_to_django(self, passlib_hasher, cached: bool = ...): ... @@ -28,13 +29,13 @@ class DjangoContextAdapter(DjangoTranslator): enabled: bool patched: bool log: Any - def __init__(self, context: Any | None = ..., get_user_category: Any | None = ..., **kwds) -> None: ... + def __init__(self, context: Incomplete | None = ..., get_user_category: Incomplete | None = ..., **kwds) -> None: ... def reset_hashers(self) -> None: ... def get_hashers(self): ... def get_hasher(self, algorithm: str = ...): ... def identify_hasher(self, encoded): ... - def make_password(self, password, salt: Any | None = ..., hasher: str = ...): ... - def check_password(self, password, encoded, setter: Any | None = ..., preferred: str = ...): ... + def make_password(self, password, salt: Incomplete | None = ..., hasher: str = ...): ... + def check_password(self, password, encoded, setter: Incomplete | None = ..., preferred: str = ...): ... def user_check_password(self, user, password): ... def user_set_password(self, user, password) -> None: ... def get_user_category(self, user): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/handlers/argon2.pyi b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/handlers/argon2.pyi index 69f7dd96c..5624b27d5 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/handlers/argon2.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/handlers/argon2.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any, ClassVar import passlib.utils.handlers as uh @@ -38,14 +39,14 @@ class _Argon2Common( # type: ignore[misc] @classmethod def using( # type: ignore[override] cls, - type: Any | None = ..., - memory_cost: Any | None = ..., - salt_len: Any | None = ..., - time_cost: Any | None = ..., - digest_size: Any | None = ..., - checksum_size: Any | None = ..., - hash_len: Any | None = ..., - max_threads: Any | None = ..., + type: Incomplete | None = ..., + memory_cost: Incomplete | None = ..., + salt_len: Incomplete | None = ..., + time_cost: Incomplete | None = ..., + digest_size: Incomplete | None = ..., + checksum_size: Incomplete | None = ..., + hash_len: Incomplete | None = ..., + max_threads: Incomplete | None = ..., **kwds, ): ... @classmethod @@ -54,11 +55,11 @@ class _Argon2Common( # type: ignore[misc] def from_string(cls, hash): ... def __init__( self, - type: Any | None = ..., + type: Incomplete | None = ..., type_d: bool = ..., - version: Any | None = ..., - memory_cost: Any | None = ..., - data: Any | None = ..., + version: Incomplete | None = ..., + memory_cost: Incomplete | None = ..., + data: Incomplete | None = ..., **kwds, ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/handlers/bcrypt.pyi b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/handlers/bcrypt.pyi index 1823586f1..426f1472d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/handlers/bcrypt.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/handlers/bcrypt.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any, ClassVar import passlib.utils.handlers as uh @@ -45,10 +46,10 @@ class bcrypt_sha256(_wrapped_bcrypt): default_ident: ClassVar[str] version: ClassVar[int] @classmethod - def using(cls, version: Any | None = ..., **kwds): ... # type: ignore[override] + def using(cls, version: Incomplete | None = ..., **kwds): ... # type: ignore[override] prefix: Any @classmethod def identify(cls, hash): ... @classmethod def from_string(cls, hash): ... - def __init__(self, version: Any | None = ..., **kwds) -> None: ... + def __init__(self, version: Incomplete | None = ..., **kwds) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/handlers/digests.pyi b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/handlers/digests.pyi index a0c9f7e23..c97bdb47e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/handlers/digests.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/handlers/digests.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any, ClassVar import passlib.utils.handlers as uh @@ -6,7 +7,7 @@ class HexDigestHash(uh.StaticHandler): checksum_chars: ClassVar[str] supported: ClassVar[bool] -def create_hex_hash(digest, module=..., django_name: Any | None = ..., required: bool = ...): ... +def create_hex_hash(digest, module=..., django_name: Incomplete | None = ..., required: bool = ...): ... hex_md4: Any hex_md5: Any @@ -17,8 +18,10 @@ hex_sha512: Any class htdigest(uh.MinimalHandler): name: ClassVar[str] default_encoding: ClassVar[str] + setting_kwds: ClassVar[tuple[str, ...]] + context_kwds: ClassVar[tuple[str, ...]] @classmethod - def hash(cls, secret, user, realm, encoding: Any | None = ...): ... # type: ignore[override] + def hash(cls, secret, user, realm, encoding: Incomplete | None = ...): ... # type: ignore[override] @classmethod def verify(cls, secret, hash, user, realm, encoding: str = ...): ... # type: ignore[override] @classmethod @@ -26,4 +29,4 @@ class htdigest(uh.MinimalHandler): @classmethod def genconfig(cls): ... @classmethod - def genhash(cls, secret, config, user, realm, encoding: Any | None = ...): ... # type: ignore[override] + def genhash(cls, secret, config, user, realm, encoding: Incomplete | None = ...): ... # type: ignore[override] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/handlers/misc.pyi b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/handlers/misc.pyi index 4e153913b..3c68095bc 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/handlers/misc.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/handlers/misc.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any, ClassVar import passlib.utils.handlers as uh @@ -15,8 +16,10 @@ class unix_fallback(DisabledHash, uh.StaticHandler): class unix_disabled(DisabledHash, uh.MinimalHandler): name: ClassVar[str] default_marker: ClassVar[str] + setting_kwds: ClassVar[tuple[str, ...]] + context_kwds: ClassVar[tuple[str, ...]] @classmethod - def using(cls, marker: Any | None = ..., **kwds): ... # type: ignore[override] + def using(cls, marker: Incomplete | None = ..., **kwds): ... # type: ignore[override] @classmethod def identify(cls, hash: str | bytes) -> bool: ... @classmethod @@ -24,7 +27,7 @@ class unix_disabled(DisabledHash, uh.MinimalHandler): @classmethod def hash(cls, secret: str | bytes, **kwds) -> str: ... @classmethod - def genhash(cls, secret: str | bytes, config, marker: Any | None = ...): ... # type: ignore[override] + def genhash(cls, secret: str | bytes, config, marker: Incomplete | None = ...): ... # type: ignore[override] @classmethod def disable(cls, hash: str | bytes | None = ...) -> str: ... @classmethod @@ -33,10 +36,12 @@ class unix_disabled(DisabledHash, uh.MinimalHandler): class plaintext(uh.MinimalHandler): name: ClassVar[str] default_encoding: ClassVar[str] + setting_kwds: ClassVar[tuple[str, ...]] + context_kwds: ClassVar[tuple[str, ...]] @classmethod def identify(cls, hash: str | bytes): ... @classmethod - def hash(cls, secret: str | bytes, encoding: Any | None = ...): ... # type: ignore[override] + def hash(cls, secret: str | bytes, encoding: Incomplete | None = ...): ... # type: ignore[override] @classmethod def verify(cls, secret: str | bytes, hash: str | bytes, encoding: str | None = ...): ... # type: ignore[override] @classmethod diff --git a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/handlers/pbkdf2.pyi b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/handlers/pbkdf2.pyi index c28854b56..280849de8 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/handlers/pbkdf2.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/handlers/pbkdf2.pyi @@ -1,5 +1,5 @@ -from _typeshed import Self from typing import ClassVar +from typing_extensions import Self import passlib.utils.handlers as uh from passlib.utils.handlers import PrefixWrapper @@ -13,7 +13,7 @@ class Pbkdf2DigestHandler(uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.Gen max_rounds: ClassVar[int] rounds_cost: ClassVar[str] @classmethod - def from_string(cls: type[Self], hash: str | bytes) -> Self: ... # type: ignore[override] + def from_string(cls, hash: str | bytes) -> Self: ... # type: ignore[override] # dynamically created by create_pbkdf2_hash() class pbkdf2_sha1(Pbkdf2DigestHandler): diff --git a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/handlers/phpass.pyi b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/handlers/phpass.pyi index 93a24edb7..02419bdc8 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/handlers/phpass.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/handlers/phpass.pyi @@ -1,5 +1,5 @@ -from _typeshed import Self from typing import ClassVar +from typing_extensions import Self import passlib.utils.handlers as uh @@ -17,4 +17,4 @@ class phpass(uh.HasManyIdents, uh.HasRounds, uh.HasSalt, uh.GenericHandler): # ident_values: ClassVar[tuple[str, ...]] ident_aliases: ClassVar[dict[str, str]] @classmethod - def from_string(cls: type[Self], hash: str | bytes) -> Self: ... # type: ignore[override] + def from_string(cls, hash: str | bytes) -> Self: ... # type: ignore[override] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/handlers/scram.pyi b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/handlers/scram.pyi index b55391472..80e4586c5 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/handlers/scram.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/handlers/scram.pyi @@ -1,4 +1,5 @@ -from typing import Any, ClassVar +from _typeshed import Incomplete +from typing import ClassVar import passlib.utils.handlers as uh @@ -12,7 +13,7 @@ class scram(uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler): max_rounds: ClassVar[int] rounds_cost: ClassVar[str] default_algs: ClassVar[list[str]] - algs: Any | None + algs: Incomplete | None @classmethod def extract_digest_info(cls, hash, alg): ... @classmethod @@ -22,7 +23,7 @@ class scram(uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler): @classmethod def from_string(cls, hash): ... @classmethod - def using(cls, default_algs: Any | None = ..., algs: Any | None = ..., **kwds): ... # type: ignore[override] - def __init__(self, algs: Any | None = ..., **kwds) -> None: ... + def using(cls, default_algs: Incomplete | None = ..., algs: Incomplete | None = ..., **kwds): ... # type: ignore[override] + def __init__(self, algs: Incomplete | None = ..., **kwds) -> None: ... @classmethod def verify(cls, secret, hash, full: bool = ...): ... # type: ignore[override] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/handlers/scrypt.pyi b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/handlers/scrypt.pyi index 80b01560e..1f8ffda19 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/handlers/scrypt.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/handlers/scrypt.pyi @@ -1,4 +1,5 @@ -from typing import Any, ClassVar +from _typeshed import Incomplete +from typing import ClassVar import passlib.utils.handlers as uh @@ -17,13 +18,13 @@ class scrypt(uh.ParallelismMixin, uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum parallelism: int block_size: int @classmethod - def using(cls, block_size: Any | None = ..., **kwds): ... # type: ignore[override] + def using(cls, block_size: Incomplete | None = ..., **kwds): ... # type: ignore[override] @classmethod def from_string(cls, hash): ... @classmethod def parse(cls, hash): ... def to_string(self): ... - def __init__(self, block_size: Any | None = ..., **kwds) -> None: ... + def __init__(self, block_size: Incomplete | None = ..., **kwds) -> None: ... @classmethod def get_backend(cls): ... @classmethod diff --git a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/handlers/sha1_crypt.pyi b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/handlers/sha1_crypt.pyi index 601f616bf..14ea298da 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/handlers/sha1_crypt.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/handlers/sha1_crypt.pyi @@ -1,5 +1,5 @@ -from _typeshed import Self from typing import Any, ClassVar +from typing_extensions import Self import passlib.utils.handlers as uh @@ -18,6 +18,6 @@ class sha1_crypt(uh.HasManyBackends, uh.HasRounds, uh.HasSalt, uh.GenericHandler max_rounds: ClassVar[int] rounds_cost: ClassVar[str] @classmethod - def from_string(cls: type[Self], hash: str | bytes) -> Self: ... # type: ignore[override] + def from_string(cls, hash: str | bytes) -> Self: ... # type: ignore[override] def to_string(self, config: bool = ...) -> str: ... backends: ClassVar[tuple[str, ...]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/handlers/sha2_crypt.pyi b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/handlers/sha2_crypt.pyi index 849d7f677..82ba37af2 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/handlers/sha2_crypt.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/handlers/sha2_crypt.pyi @@ -1,5 +1,5 @@ -from _typeshed import Self from typing import ClassVar +from typing_extensions import Self import passlib.utils.handlers as uh @@ -13,7 +13,7 @@ class _SHA2_Common(uh.HasManyBackends, uh.HasRounds, uh.HasSalt, uh.GenericHandl implicit_rounds: bool def __init__(self, implicit_rounds: bool | None = ..., **kwds) -> None: ... @classmethod - def from_string(cls: type[Self], hash: str | bytes) -> Self: ... # type: ignore[override] + def from_string(cls, hash: str | bytes) -> Self: ... # type: ignore[override] backends: ClassVar[tuple[str, ...]] class sha256_crypt(_SHA2_Common): diff --git a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/handlers/sun_md5_crypt.pyi b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/handlers/sun_md5_crypt.pyi index 9436095c3..43cb4a06c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/handlers/sun_md5_crypt.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/handlers/sun_md5_crypt.pyi @@ -1,5 +1,5 @@ -from _typeshed import Self from typing import ClassVar +from typing_extensions import Self import passlib.utils.handlers as uh @@ -20,5 +20,5 @@ class sun_md5_crypt(uh.HasRounds, uh.HasSalt, uh.GenericHandler): # type: ignor @classmethod def identify(cls, hash): ... @classmethod - def from_string(cls: type[Self], hash: str | bytes) -> Self: ... # type: ignore[override] + def from_string(cls, hash: str | bytes) -> Self: ... # type: ignore[override] def to_string(self, _withchk: bool = ...) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/handlers/windows.pyi b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/handlers/windows.pyi index 05db84f30..cc5d6a642 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/handlers/windows.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/handlers/windows.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any, ClassVar import passlib.utils.handlers as uh @@ -8,7 +9,7 @@ class lmhash(uh.TruncateMixin, uh.HasEncodingContext, uh.StaticHandler): checksum_size: ClassVar[int] truncate_size: ClassVar[int] @classmethod - def raw(cls, secret, encoding: Any | None = ...): ... + def raw(cls, secret, encoding: Incomplete | None = ...): ... class nthash(uh.StaticHandler): name: ClassVar[str] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/hosts.pyi b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/hosts.pyi index 6c4040d1c..732e02106 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/hosts.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/hosts.pyi @@ -1,8 +1,11 @@ from typing import Any +from passlib.context import CryptContext + linux_context: Any linux2_context: Any freebsd_context: Any openbsd_context: Any netbsd_context: Any -host_context: Any +# Only exists if crypt is present +host_context: CryptContext diff --git a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/ifc.pyi b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/ifc.pyi index 7f477cfee..aec4570c8 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/ifc.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/ifc.pyi @@ -1,7 +1,6 @@ -from _typeshed import Self from abc import ABCMeta, abstractmethod from typing import Any, ClassVar -from typing_extensions import Literal +from typing_extensions import Literal, Self class PasswordHash(metaclass=ABCMeta): is_disabled: ClassVar[bool] @@ -18,7 +17,7 @@ class PasswordHash(metaclass=ABCMeta): def verify(cls, secret: str | bytes, hash: str | bytes, **context_kwds): ... @classmethod @abstractmethod - def using(cls: type[Self], relaxed: bool = ..., **kwds: Any) -> type[Self]: ... + def using(cls, relaxed: bool = ..., **kwds: Any) -> type[Self]: ... @classmethod def needs_update(cls, hash: str, secret: str | bytes | None = ...) -> bool: ... @classmethod diff --git a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/pwd.pyi b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/pwd.pyi index 618a80eee..42e01ae66 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/pwd.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/pwd.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from abc import abstractmethod from collections.abc import MutableMapping from typing import Any @@ -9,13 +10,15 @@ class SequenceGenerator: @property @abstractmethod def symbol_count(self) -> int: ... - def __init__(self, entropy: Any | None = ..., length: Any | None = ..., rng: Any | None = ..., **kwds) -> None: ... + def __init__( + self, entropy: Incomplete | None = ..., length: Incomplete | None = ..., rng: Incomplete | None = ..., **kwds + ) -> None: ... @property def entropy_per_symbol(self) -> float: ... @property def entropy(self) -> float: ... def __next__(self) -> None: ... - def __call__(self, returns: Any | None = ...): ... + def __call__(self, returns: Incomplete | None = ...): ... def __iter__(self): ... default_charsets: Any @@ -23,12 +26,12 @@ default_charsets: Any class WordGenerator(SequenceGenerator): charset: str chars: Any - def __init__(self, chars: Any | None = ..., charset: Any | None = ..., **kwds) -> None: ... + def __init__(self, chars: Incomplete | None = ..., charset: Incomplete | None = ..., **kwds) -> None: ... @property def symbol_count(self): ... def __next__(self): ... -def genword(entropy: Any | None = ..., length: Any | None = ..., returns: Any | None = ..., **kwds): ... +def genword(entropy: Incomplete | None = ..., length: Incomplete | None = ..., returns: Incomplete | None = ..., **kwds): ... class WordsetDict(MutableMapping[Any, Any]): paths: Any @@ -38,7 +41,7 @@ class WordsetDict(MutableMapping[Any, Any]): def __setitem__(self, key, value) -> None: ... def __delitem__(self, key) -> None: ... def __iter__(self): ... - def __len__(self): ... + def __len__(self) -> int: ... def __contains__(self, key): ... default_wordsets: Any @@ -47,9 +50,11 @@ class PhraseGenerator(SequenceGenerator): wordset: str words: Any sep: str - def __init__(self, wordset: Any | None = ..., words: Any | None = ..., sep: Any | None = ..., **kwds) -> None: ... + def __init__( + self, wordset: Incomplete | None = ..., words: Incomplete | None = ..., sep: Incomplete | None = ..., **kwds + ) -> None: ... @property def symbol_count(self): ... def __next__(self): ... -def genphrase(entropy: Any | None = ..., length: Any | None = ..., returns: Any | None = ..., **kwds): ... +def genphrase(entropy: Incomplete | None = ..., length: Incomplete | None = ..., returns: Incomplete | None = ..., **kwds): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/registry.pyi b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/registry.pyi index 18341cf92..abfb25ef9 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/registry.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/registry.pyi @@ -1,13 +1,14 @@ +from _typeshed import Incomplete from typing import Any class _PasslibRegistryProxy: __name__: str __package__: Any - def __getattr__(self, attr): ... - def __setattr__(self, attr, value) -> None: ... + def __getattr__(self, attr: str): ... + def __setattr__(self, attr: str, value) -> None: ... def __dir__(self): ... def register_crypt_handler_path(name, path) -> None: ... -def register_crypt_handler(handler, force: bool = ..., _attr: Any | None = ...) -> None: ... +def register_crypt_handler(handler, force: bool = ..., _attr: Incomplete | None = ...) -> None: ... def get_crypt_handler(name, default=...): ... def list_crypt_handlers(loaded_only: bool = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/totp.pyi b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/totp.pyi index 0f9160282..7e5d23b67 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/totp.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/totp.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from passlib.exc import ( @@ -14,10 +15,10 @@ class AppWallet: default_tag: Any def __init__( self, - secrets: Any | None = ..., - default_tag: Any | None = ..., - encrypt_cost: Any | None = ..., - secrets_path: Any | None = ..., + secrets: Incomplete | None = ..., + default_tag: Incomplete | None = ..., + encrypt_cost: Incomplete | None = ..., + secrets_path: Incomplete | None = ..., ) -> None: ... @property def has_secrets(self): ... @@ -39,27 +40,27 @@ class TOTP: @classmethod def using( cls, - digits: Any | None = ..., - alg: Any | None = ..., - period: Any | None = ..., - issuer: Any | None = ..., - wallet: Any | None = ..., - now: Any | None = ..., + digits: Incomplete | None = ..., + alg: Incomplete | None = ..., + period: Incomplete | None = ..., + issuer: Incomplete | None = ..., + wallet: Incomplete | None = ..., + now: Incomplete | None = ..., **kwds, ): ... @classmethod def new(cls, **kwds): ... def __init__( self, - key: Any | None = ..., + key: Incomplete | None = ..., format: str = ..., new: bool = ..., - digits: Any | None = ..., - alg: Any | None = ..., - size: Any | None = ..., - period: Any | None = ..., - label: Any | None = ..., - issuer: Any | None = ..., + digits: Incomplete | None = ..., + alg: Incomplete | None = ..., + size: Incomplete | None = ..., + period: Incomplete | None = ..., + label: Incomplete | None = ..., + issuer: Incomplete | None = ..., changed: bool = ..., **kwds, ) -> None: ... @@ -79,21 +80,23 @@ class TOTP: @classmethod def normalize_time(cls, time): ... def normalize_token(self_or_cls, token): ... - def generate(self, time: Any | None = ...): ... + def generate(self, time: Incomplete | None = ...): ... @classmethod def verify(cls, token, source, **kwds): ... - def match(self, token, time: Any | None = ..., window: int = ..., skew: int = ..., last_counter: Any | None = ...): ... + def match( + self, token, time: Incomplete | None = ..., window: int = ..., skew: int = ..., last_counter: Incomplete | None = ... + ): ... @classmethod def from_source(cls, source): ... @classmethod def from_uri(cls, uri): ... - def to_uri(self, label: Any | None = ..., issuer: Any | None = ...): ... + def to_uri(self, label: Incomplete | None = ..., issuer: Incomplete | None = ...): ... @classmethod def from_json(cls, source): ... - def to_json(self, encrypt: Any | None = ...): ... + def to_json(self, encrypt: Incomplete | None = ...): ... @classmethod def from_dict(cls, source): ... - def to_dict(self, encrypt: Any | None = ...): ... + def to_dict(self, encrypt: Incomplete | None = ...): ... class TotpToken(SequenceMixin): totp: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/utils/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/utils/__init__.pyi index e3905e52a..5e8fd2181 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/utils/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/utils/__init__.pyi @@ -1,4 +1,5 @@ import timeit +from _typeshed import Incomplete from collections.abc import Generator from hmac import compare_digest from typing import Any @@ -40,7 +41,7 @@ rounds_cost_values: Any class SequenceMixin: def __getitem__(self, idx): ... def __iter__(self): ... - def __len__(self): ... + def __len__(self) -> int: ... def __eq__(self, other): ... def __ne__(self, other): ... @@ -52,7 +53,7 @@ def render_bytes(source, *args): ... def xor_bytes(left, right): ... def is_same_codec(left, right): ... def is_ascii_safe(source): ... -def to_bytes(source, encoding: str = ..., param: str = ..., source_encoding: Any | None = ...): ... +def to_bytes(source, encoding: str = ..., param: str = ..., source_encoding: Incomplete | None = ...): ... def to_unicode(source, encoding: str = ..., param: str = ...): ... def to_native_str(source, encoding: str = ..., param: str = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/utils/binary.pyi b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/utils/binary.pyi index a60666091..82928d5c3 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/utils/binary.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/utils/binary.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any BASE64_CHARS: Any @@ -10,7 +11,7 @@ UPPER_HEX_CHARS: Any LOWER_HEX_CHARS: Any ALL_BYTE_VALUES: Any -def compile_byte_translation(mapping, source: Any | None = ...): ... +def compile_byte_translation(mapping, source: Incomplete | None = ...): ... def b64s_encode(data): ... def b64s_decode(data): ... def ab64_encode(data): ... @@ -43,7 +44,7 @@ class Base64Engine: class LazyBase64Engine(Base64Engine): def __init__(self, *args, **kwds) -> None: ... - def __getattribute__(self, attr): ... + def __getattribute__(self, attr: str): ... h64: Any h64big: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/utils/compat/_ordered_dict.pyi b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/utils/compat/_ordered_dict.pyi index ca867ec22..7fafb44f3 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/utils/compat/_ordered_dict.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/utils/compat/_ordered_dict.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from collections.abc import Generator from typing import Any @@ -17,10 +18,10 @@ class OrderedDict(dict[Any, Any]): def iteritems(self) -> Generator[Any, None, None]: ... def update(*args, **kwds) -> None: ... # type: ignore[override] def pop(self, key, default=...): ... - def setdefault(self, key, default: Any | None = ...): ... + def setdefault(self, key, default: Incomplete | None = ...): ... def __reduce__(self): ... def copy(self): ... @classmethod - def fromkeys(cls, iterable, value: Any | None = ...): ... + def fromkeys(cls, iterable, value: Incomplete | None = ...): ... def __eq__(self, other): ... def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/utils/decor.pyi b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/utils/decor.pyi index c5f57627c..4c7eda386 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/utils/decor.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/utils/decor.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any class classproperty: @@ -21,21 +22,21 @@ class memoized_property: def __init__(self, func) -> None: ... def __get__(self, obj, cls): ... def clear_cache(self, obj) -> None: ... - def peek_cache(self, obj, default: Any | None = ...): ... + def peek_cache(self, obj, default: Incomplete | None = ...): ... def deprecated_function( - msg: Any | None = ..., - deprecated: Any | None = ..., - removed: Any | None = ..., + msg: Incomplete | None = ..., + deprecated: Incomplete | None = ..., + removed: Incomplete | None = ..., updoc: bool = ..., - replacement: Any | None = ..., + replacement: Incomplete | None = ..., _is_method: bool = ..., - func_module: Any | None = ..., + func_module: Incomplete | None = ..., ): ... def deprecated_method( - msg: Any | None = ..., - deprecated: Any | None = ..., - removed: Any | None = ..., + msg: Incomplete | None = ..., + deprecated: Incomplete | None = ..., + removed: Incomplete | None = ..., updoc: bool = ..., - replacement: Any | None = ..., + replacement: Incomplete | None = ..., ): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/utils/handlers.pyi b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/utils/handlers.pyi index 8314b2b28..89ede12fd 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/utils/handlers.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/utils/handlers.pyi @@ -1,6 +1,7 @@ import abc -from _typeshed import Self +from _typeshed import Incomplete from typing import Any, ClassVar +from typing_extensions import Self from passlib.ifc import PasswordHash from passlib.utils.binary import BASE64_CHARS, HASH64_CHARS, LOWER_HEX_CHARS, PADDED_BASE64_CHARS, UPPER_HEX_CHARS @@ -11,20 +12,22 @@ PADDED_B64_CHARS = PADDED_BASE64_CHARS UC_HEX_CHARS = UPPER_HEX_CHARS LC_HEX_CHARS = LOWER_HEX_CHARS -def parse_mc2(hash, prefix, sep=..., handler: Any | None = ...): ... -def parse_mc3(hash, prefix, sep=..., rounds_base: int = ..., default_rounds: Any | None = ..., handler: Any | None = ...): ... +def parse_mc2(hash, prefix, sep=..., handler: Incomplete | None = ...): ... +def parse_mc3( + hash, prefix, sep=..., rounds_base: int = ..., default_rounds: Incomplete | None = ..., handler: Incomplete | None = ... +): ... def render_mc2(ident, salt, checksum, sep=...): ... def render_mc3(ident, rounds, salt, checksum, sep=..., rounds_base: int = ...): ... class MinimalHandler(PasswordHash, metaclass=abc.ABCMeta): @classmethod - def using(cls: Self, relaxed: bool = ...) -> type[Self]: ... # type: ignore[override] + def using(cls, relaxed: bool = ...) -> type[Self]: ... # type: ignore[override] class TruncateMixin(MinimalHandler, metaclass=abc.ABCMeta): truncate_error: ClassVar[bool] truncate_verify_reject: ClassVar[bool] @classmethod - def using(cls: type[Self], truncate_error: object = ..., *, relaxed: bool = ...) -> type[Self]: ... # type: ignore[override] + def using(cls, truncate_error: object = ..., *, relaxed: bool = ...) -> type[Self]: ... # type: ignore[override] class GenericHandler(MinimalHandler): setting_kwds: ClassVar[tuple[str, ...]] @@ -38,7 +41,7 @@ class GenericHandler(MinimalHandler): @classmethod def identify(cls, hash: str | bytes) -> bool: ... @classmethod - def from_string(cls: type[Self], hash: str | bytes, **context: Any) -> Self: ... + def from_string(cls, hash: str | bytes, **context: Any) -> Self: ... def to_string(self) -> str: ... @classmethod def hash(cls, secret: str | bytes, **kwds: Any) -> str: ... @@ -64,14 +67,14 @@ class HasEncodingContext(GenericHandler): def __init__(self, encoding: str | None = ..., **kwds) -> None: ... class HasUserContext(GenericHandler): - user: Any | None - def __init__(self, user: Any | None = ..., **kwds) -> None: ... + user: Incomplete | None + def __init__(self, user: Incomplete | None = ..., **kwds) -> None: ... @classmethod - def hash(cls, secret, user: Any | None = ..., **context): ... + def hash(cls, secret, user: Incomplete | None = ..., **context): ... @classmethod - def verify(cls, secret, hash, user: Any | None = ..., **context): ... + def verify(cls, secret, hash, user: Incomplete | None = ..., **context): ... @classmethod - def genhash(cls, secret, config, user: Any | None = ..., **context): ... + def genhash(cls, secret, config, user: Incomplete | None = ..., **context): ... class HasRawChecksum(GenericHandler): ... @@ -81,8 +84,8 @@ class HasManyIdents(GenericHandler): ident_aliases: ClassVar[dict[str, str] | None] ident: str # type: ignore[misc] @classmethod - def using(cls, default_ident: Any | None = ..., ident: Any | None = ..., **kwds): ... # type: ignore[override] - def __init__(self, ident: Any | None = ..., **kwds) -> None: ... + def using(cls, default_ident: Incomplete | None = ..., ident: Incomplete | None = ..., **kwds): ... # type: ignore[override] + def __init__(self, ident: Incomplete | None = ..., **kwds) -> None: ... class HasSalt(GenericHandler): min_salt_size: ClassVar[int] @@ -108,29 +111,29 @@ class HasRounds(GenericHandler): min_desired_rounds: ClassVar[int | None] max_desired_rounds: ClassVar[int | None] default_rounds: ClassVar[int | None] - vary_rounds: ClassVar[Any | None] + vary_rounds: ClassVar[Incomplete | None] rounds: int @classmethod def using( # type: ignore[override] cls, - min_desired_rounds: Any | None = ..., - max_desired_rounds: Any | None = ..., - default_rounds: Any | None = ..., - vary_rounds: Any | None = ..., - min_rounds: Any | None = ..., - max_rounds: Any | None = ..., - rounds: Any | None = ..., + min_desired_rounds: Incomplete | None = ..., + max_desired_rounds: Incomplete | None = ..., + default_rounds: Incomplete | None = ..., + vary_rounds: Incomplete | None = ..., + min_rounds: Incomplete | None = ..., + max_rounds: Incomplete | None = ..., + rounds: Incomplete | None = ..., **kwds, ): ... - def __init__(self, rounds: Any | None = ..., **kwds) -> None: ... + def __init__(self, rounds: Incomplete | None = ..., **kwds) -> None: ... @classmethod - def bitsize(cls, rounds: Any | None = ..., vary_rounds: float = ..., **kwds): ... + def bitsize(cls, rounds: Incomplete | None = ..., vary_rounds: float = ..., **kwds): ... class ParallelismMixin(GenericHandler): parallelism: int @classmethod - def using(cls, parallelism: Any | None = ..., **kwds): ... # type: ignore[override] - def __init__(self, parallelism: Any | None = ..., **kwds) -> None: ... + def using(cls, parallelism: Incomplete | None = ..., **kwds): ... # type: ignore[override] + def __init__(self, parallelism: Incomplete | None = ..., **kwds) -> None: ... class BackendMixin(PasswordHash, metaclass=abc.ABCMeta): backends: ClassVar[tuple[str, ...] | None] @@ -150,7 +153,14 @@ class PrefixWrapper: orig_prefix: Any __doc__: Any def __init__( - self, name, wrapped, prefix=..., orig_prefix=..., lazy: bool = ..., doc: Any | None = ..., ident: Any | None = ... + self, + name, + wrapped, + prefix=..., + orig_prefix=..., + lazy: bool = ..., + doc: Incomplete | None = ..., + ident: Incomplete | None = ..., ) -> None: ... @property def wrapped(self): ... @@ -159,8 +169,8 @@ class PrefixWrapper: @property def ident_values(self): ... def __dir__(self): ... - def __getattr__(self, attr): ... - def __setattr__(self, attr, value): ... + def __getattr__(self, attr: str): ... + def __setattr__(self, attr: str, value) -> None: ... def using(self, **kwds): ... def needs_update(self, hash, **kwds): ... def identify(self, hash): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/utils/pbkdf2.pyi b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/utils/pbkdf2.pyi index bfc9f2f2d..2b192ec29 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/utils/pbkdf2.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/passlib/passlib/utils/pbkdf2.pyi @@ -1,7 +1,7 @@ -from typing import Any +from _typeshed import Incomplete from passlib.crypto.digest import norm_hash_name as norm_hash_name def get_prf(name): ... -def pbkdf1(secret, salt, rounds, keylen: Any | None = ..., hash: str = ...): ... -def pbkdf2(secret, salt, rounds, keylen: Any | None = ..., prf: str = ...): ... +def pbkdf1(secret, salt, rounds, keylen: Incomplete | None = ..., hash: str = ...): ... +def pbkdf2(secret, salt, rounds, keylen: Incomplete | None = ..., prf: str = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/passpy/passpy/util.pyi b/packages/pyright-internal/typeshed-fallback/stubs/passpy/passpy/util.pyi index e76e8abca..4c10cdeaa 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/passpy/passpy/util.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/passpy/passpy/util.pyi @@ -1 +1,13 @@ +from collections.abc import Callable +from typing import Any, TypeVar + +_C = TypeVar("_C", bound=Callable[..., Any]) + +# Technically, the first argument of `_C` must be `Store`, +# but for now we leave it simple: +def initialised(func: _C) -> _C: ... +def trap(path_index: str | int) -> Callable[[_C], _C]: ... def gen_password(length: int, symbols: bool = ...) -> str: ... +def copy_move( + src: str, dst: str, force: bool = ..., move: bool = ..., interactive: bool = ..., verbose: bool = ... +) -> str | None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/peewee/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/peewee/METADATA.toml new file mode 100644 index 000000000..c1f03f2c7 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/peewee/METADATA.toml @@ -0,0 +1 @@ +version = "3.16.*" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/peewee/peewee.pyi b/packages/pyright-internal/typeshed-fallback/stubs/peewee/peewee.pyi new file mode 100644 index 000000000..0cae84ca8 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/peewee/peewee.pyi @@ -0,0 +1,1799 @@ +import itertools +import logging +import threading +from _typeshed import Incomplete, SupportsKeysAndGetItem +from collections.abc import Generator, Iterable +from types import TracebackType +from typing import ClassVar, NamedTuple, TypeVar +from typing_extensions import Self + +class NullHandler(logging.Handler): + def emit(self, record) -> None: ... + +text_type = str +bytes_type = bytes +buffer_type = memoryview +basestring = str +long = int +izip_longest = itertools.zip_longest + +_VT = TypeVar("_VT") + +class attrdict(dict[str, _VT]): + def __getattr__(self, attr: str) -> _VT: ... + def __setattr__(self, attr: str, value: _VT) -> None: ... + # calls dict.update() + def __iadd__(self, rhs: SupportsKeysAndGetItem[str, _VT] | Iterable[tuple[str, _VT]]) -> Self: ... + def __add__(self, rhs: SupportsKeysAndGetItem[str, _VT] | Iterable[tuple[str, _VT]]) -> attrdict[_VT]: ... + +OP: Incomplete +DJANGO_MAP: Incomplete +JOIN: Incomplete +PREFETCH_TYPE: attrdict[int] + +def chunked(it, n) -> Generator[Incomplete, None, None]: ... + +class _callable_context_manager: + def __call__(self, fn): ... + +class Proxy: + def __init__(self) -> None: ... + obj: Incomplete + def initialize(self, obj) -> None: ... + def attach_callback(self, callback): ... + def passthrough(method): ... + __enter__: Incomplete + __exit__: Incomplete + def __getattr__(self, attr: str): ... + def __setattr__(self, attr: str, value) -> None: ... + +class DatabaseProxy(Proxy): + def connection_context(self): ... + def atomic(self, *args, **kwargs): ... + def manual_commit(self): ... + def transaction(self, *args, **kwargs): ... + def savepoint(self): ... + @property + def Model(self) -> type[Model]: ... + +class ModelDescriptor: ... + +class AliasManager: + def __init__(self) -> None: ... + @property + def mapping(self): ... + def add(self, source): ... + def get(self, source, any_depth: bool = ...): ... + def __getitem__(self, source): ... + def __setitem__(self, source, alias) -> None: ... + def push(self) -> None: ... + def pop(self) -> None: ... + +class State: + def __new__(cls, scope=..., parentheses: bool = ..., **kwargs): ... + def __call__(self, scope: Incomplete | None = ..., parentheses: Incomplete | None = ..., **kwargs): ... + def __getattr__(self, attr_name: str): ... + +class Context: + stack: Incomplete + alias_manager: Incomplete + state: Incomplete + def __init__(self, **settings) -> None: ... + def as_new(self): ... + def column_sort_key(self, item): ... + @property + def scope(self): ... + @property + def parentheses(self): ... + @property + def subquery(self): ... + def __call__(self, **overrides): ... + scope_normal: Incomplete + scope_source: Incomplete + scope_values: Incomplete + scope_cte: Incomplete + scope_column: Incomplete + def __enter__(self): ... + def __exit__( + self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None + ) -> None: ... + def push_alias(self) -> Generator[None, None, None]: ... + def sql(self, obj): ... + def literal(self, keyword): ... + def value(self, value, converter: Incomplete | None = ..., add_param: bool = ...): ... + def __sql__(self, ctx): ... + def parse(self, node): ... + def query(self): ... + +class Node: + def clone(self): ... + def __sql__(self, ctx) -> None: ... + @staticmethod + def copy(method): ... + def coerce(self, _coerce: bool = ...): ... + def is_alias(self): ... + def unwrap(self): ... + +class ColumnFactory: + node: Incomplete + def __init__(self, node) -> None: ... + def __getattr__(self, attr: str): ... + +class _DynamicColumn: + def __get__(self, instance, instance_type: Incomplete | None = ...): ... + +class _ExplicitColumn: + def __get__(self, instance, instance_type: Incomplete | None = ...): ... + +class Source(Node): + c: Incomplete + def __init__(self, alias: Incomplete | None = ...) -> None: ... + def alias(self, name) -> None: ... + def select(self, *columns): ... + def join(self, dest, join_type=..., on: Incomplete | None = ...): ... + def left_outer_join(self, dest, on: Incomplete | None = ...): ... + def cte(self, name, recursive: bool = ..., columns: Incomplete | None = ..., materialized: Incomplete | None = ...): ... + def get_sort_key(self, ctx): ... + def apply_alias(self, ctx): ... + def apply_column(self, ctx): ... + +class _HashableSource: + def __init__(self, *args, **kwargs) -> None: ... + def alias(self, name) -> None: ... + def __hash__(self) -> int: ... + def __eq__(self, other): ... + def __ne__(self, other): ... + __lt__: Incomplete + __le__: Incomplete + __gt__: Incomplete + __ge__: Incomplete + +class BaseTable(Source): + __and__: Incomplete + __add__: Incomplete + __sub__: Incomplete + __or__: Incomplete + __mul__: Incomplete + __rand__: Incomplete + __radd__: Incomplete + __rsub__: Incomplete + __ror__: Incomplete + __rmul__: Incomplete + +class _BoundTableContext(_callable_context_manager): + table: Incomplete + database: Incomplete + def __init__(self, table, database) -> None: ... + def __enter__(self): ... + def __exit__( + self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None + ) -> None: ... + +class Table(_HashableSource, BaseTable): + __name__: Incomplete + c: Incomplete + primary_key: Incomplete + def __init__( + self, + name, + columns: Incomplete | None = ..., + primary_key: Incomplete | None = ..., + schema: Incomplete | None = ..., + alias: Incomplete | None = ..., + _model: Incomplete | None = ..., + _database: Incomplete | None = ..., + ) -> None: ... + def clone(self): ... + def bind(self, database: Incomplete | None = ...): ... + def bind_ctx(self, database: Incomplete | None = ...): ... + def select(self, *columns): ... + def insert(self, insert: Incomplete | None = ..., columns: Incomplete | None = ..., **kwargs): ... + def replace(self, insert: Incomplete | None = ..., columns: Incomplete | None = ..., **kwargs): ... + def update(self, update: Incomplete | None = ..., **kwargs): ... + def delete(self): ... + def __sql__(self, ctx): ... + +class Join(BaseTable): + lhs: Incomplete + rhs: Incomplete + join_type: Incomplete + def __init__(self, lhs, rhs, join_type=..., on: Incomplete | None = ..., alias: Incomplete | None = ...) -> None: ... + def on(self, predicate): ... + def __sql__(self, ctx): ... + +class ValuesList(_HashableSource, BaseTable): + def __init__(self, values, columns: Incomplete | None = ..., alias: Incomplete | None = ...) -> None: ... + def columns(self, *names) -> None: ... + def __sql__(self, ctx): ... + +class CTE(_HashableSource, Source): + def __init__( + self, name, query, recursive: bool = ..., columns: Incomplete | None = ..., materialized: Incomplete | None = ... + ) -> None: ... + def select_from(self, *columns): ... + def union_all(self, rhs): ... + __add__: Incomplete + def union(self, rhs): ... + __or__: Incomplete + def __sql__(self, ctx): ... + +class ColumnBase(Node): + def converter(self, converter: Incomplete | None = ...) -> None: ... + def alias(self, alias): ... + def unalias(self): ... + def bind_to(self, dest): ... + def cast(self, as_type): ... + def asc(self, collation: Incomplete | None = ..., nulls: Incomplete | None = ...): ... + __pos__: Incomplete + def desc(self, collation: Incomplete | None = ..., nulls: Incomplete | None = ...): ... + __neg__: Incomplete + def __invert__(self): ... + __and__: Incomplete + __or__: Incomplete + __add__: Incomplete + __sub__: Incomplete + __mul__: Incomplete + __div__: Incomplete + __truediv__: Incomplete + __xor__: Incomplete + __radd__: Incomplete + __rsub__: Incomplete + __rmul__: Incomplete + __rdiv__: Incomplete + __rtruediv__: Incomplete + __rand__: Incomplete + __ror__: Incomplete + __rxor__: Incomplete + def __eq__(self, rhs): ... + def __ne__(self, rhs): ... + __lt__: Incomplete + __le__: Incomplete + __gt__: Incomplete + __ge__: Incomplete + __lshift__: Incomplete + __rshift__: Incomplete + __mod__: Incomplete + __pow__: Incomplete + like: Incomplete + ilike: Incomplete + bin_and: Incomplete + bin_or: Incomplete + in_: Incomplete + not_in: Incomplete + def is_null(self, is_null: bool = ...): ... + def contains(self, rhs): ... + def startswith(self, rhs): ... + def endswith(self, rhs): ... + def between(self, lo, hi): ... + def concat(self, rhs): ... + def regexp(self, rhs): ... + def iregexp(self, rhs): ... + def __getitem__(self, item): ... + __iter__: Incomplete + def distinct(self): ... + def collate(self, collation): ... + def get_sort_key(self, ctx): ... + +class Column(ColumnBase): + source: Incomplete + name: Incomplete + def __init__(self, source, name) -> None: ... + def get_sort_key(self, ctx): ... + def __hash__(self) -> int: ... + def __sql__(self, ctx): ... + +class WrappedNode(ColumnBase): + node: Incomplete + def __init__(self, node) -> None: ... + def is_alias(self): ... + def unwrap(self): ... + +class EntityFactory: + node: Incomplete + def __init__(self, node) -> None: ... + def __getattr__(self, attr: str): ... + +class _DynamicEntity: + def __get__(self, instance, instance_type: Incomplete | None = ...): ... + +class Alias(WrappedNode): + c: Incomplete + def __init__(self, node, alias) -> None: ... + def __hash__(self) -> int: ... + @property + def name(self): ... + @name.setter + def name(self, value) -> None: ... + def alias(self, alias: Incomplete | None = ...): ... + def unalias(self): ... + def is_alias(self): ... + def __sql__(self, ctx): ... + +class BindTo(WrappedNode): + dest: Incomplete + def __init__(self, node, dest) -> None: ... + def __sql__(self, ctx): ... + +class Negated(WrappedNode): + def __invert__(self): ... + def __sql__(self, ctx): ... + +class BitwiseMixin: + def __and__(self, other): ... + def __or__(self, other): ... + def __sub__(self, other): ... + def __invert__(self): ... + +class BitwiseNegated(BitwiseMixin, WrappedNode): + def __invert__(self): ... + def __sql__(self, ctx): ... + +class Value(ColumnBase): + value: Incomplete + converter: Incomplete + multi: Incomplete + values: Incomplete + def __init__(self, value, converter: Incomplete | None = ..., unpack: bool = ...) -> None: ... + def __sql__(self, ctx): ... + +class ValueLiterals(WrappedNode): + def __sql__(self, ctx): ... + +def AsIs(value): ... + +class Cast(WrappedNode): + def __init__(self, node, cast) -> None: ... + def __sql__(self, ctx): ... + +class Ordering(WrappedNode): + direction: Incomplete + collation: Incomplete + nulls: Incomplete + def __init__(self, node, direction, collation: Incomplete | None = ..., nulls: Incomplete | None = ...) -> None: ... + def collate(self, collation: Incomplete | None = ...): ... + def __sql__(self, ctx): ... + +class Expression(ColumnBase): + lhs: Incomplete + op: Incomplete + rhs: Incomplete + flat: Incomplete + def __init__(self, lhs, op, rhs, flat: bool = ...) -> None: ... + def __sql__(self, ctx): ... + +class StringExpression(Expression): + def __add__(self, rhs): ... + def __radd__(self, lhs): ... + +class Entity(ColumnBase): + def __init__(self, *path) -> None: ... + def __getattr__(self, attr: str): ... + def get_sort_key(self, ctx): ... + def __hash__(self) -> int: ... + def __sql__(self, ctx): ... + +class SQL(ColumnBase): + sql: Incomplete + params: Incomplete + def __init__(self, sql, params: Incomplete | None = ...) -> None: ... + def __sql__(self, ctx): ... + +def Check(constraint, name: Incomplete | None = ...): ... + +class Function(ColumnBase): + no_coerce_functions: ClassVar[set[str]] + name: Incomplete + arguments: Incomplete + def __init__(self, name, arguments, coerce: bool = ..., python_value: Incomplete | None = ...) -> None: ... + def __getattr__(self, attr: str): ... + def filter(self, where: Incomplete | None = ...) -> None: ... + def order_by(self, *ordering) -> None: ... + def python_value(self, func: Incomplete | None = ...) -> None: ... + def over( + self, + partition_by: Incomplete | None = ..., + order_by: Incomplete | None = ..., + start: Incomplete | None = ..., + end: Incomplete | None = ..., + frame_type: Incomplete | None = ..., + window: Incomplete | None = ..., + exclude: Incomplete | None = ..., + ): ... + def __sql__(self, ctx): ... + +fn: Incomplete + +class Window(Node): + CURRENT_ROW: Incomplete + GROUP: Incomplete + TIES: Incomplete + NO_OTHERS: Incomplete + GROUPS: str + RANGE: str + ROWS: str + partition_by: Incomplete + order_by: Incomplete + start: Incomplete + end: Incomplete + frame_type: Incomplete + def __init__( + self, + partition_by: Incomplete | None = ..., + order_by: Incomplete | None = ..., + start: Incomplete | None = ..., + end: Incomplete | None = ..., + frame_type: Incomplete | None = ..., + extends: Incomplete | None = ..., + exclude: Incomplete | None = ..., + alias: Incomplete | None = ..., + _inline: bool = ..., + ) -> None: ... + def alias(self, alias: Incomplete | None = ...): ... + def as_range(self) -> None: ... + def as_rows(self) -> None: ... + def as_groups(self) -> None: ... + def extends(self, window: Incomplete | None = ...) -> None: ... + def exclude(self, frame_exclusion: Incomplete | None = ...) -> None: ... + @staticmethod + def following(value: Incomplete | None = ...): ... + @staticmethod + def preceding(value: Incomplete | None = ...): ... + def __sql__(self, ctx): ... + +class WindowAlias(Node): + window: Incomplete + def __init__(self, window) -> None: ... + def alias(self, window_alias): ... + def __sql__(self, ctx): ... + +class ForUpdate(Node): + def __init__(self, expr, of: Incomplete | None = ..., nowait: Incomplete | None = ...) -> None: ... + def __sql__(self, ctx): ... + +def Case(predicate, expression_tuples, default: Incomplete | None = ...): ... + +class NodeList(ColumnBase): + nodes: Incomplete + glue: Incomplete + parens: Incomplete + def __init__(self, nodes, glue: str = ..., parens: bool = ...) -> None: ... + def __sql__(self, ctx): ... + +class _Namespace(Node): + def __init__(self, name) -> None: ... + def __getattr__(self, attr: str): ... + __getitem__: Incomplete + +class NamespaceAttribute(ColumnBase): + def __init__(self, namespace, attribute) -> None: ... + def __sql__(self, ctx): ... + +EXCLUDED: Incomplete + +class DQ(ColumnBase): + query: Incomplete + def __init__(self, **query) -> None: ... + def __invert__(self) -> None: ... + def clone(self): ... + +Tuple: Incomplete + +class QualifiedNames(WrappedNode): + def __sql__(self, ctx): ... + +class OnConflict(Node): + def __init__( + self, + action: Incomplete | None = ..., + update: Incomplete | None = ..., + preserve: Incomplete | None = ..., + where: Incomplete | None = ..., + conflict_target: Incomplete | None = ..., + conflict_where: Incomplete | None = ..., + conflict_constraint: Incomplete | None = ..., + ) -> None: ... + def get_conflict_statement(self, ctx, query): ... + def get_conflict_update(self, ctx, query): ... + def preserve(self, *columns) -> None: ... + def update(self, _data: Incomplete | None = ..., **kwargs) -> None: ... + def where(self, *expressions) -> None: ... + def conflict_target(self, *constraints) -> None: ... + def conflict_where(self, *expressions) -> None: ... + def conflict_constraint(self, constraint) -> None: ... + +class BaseQuery(Node): + default_row_type: Incomplete + def __init__(self, _database: Incomplete | None = ..., **kwargs) -> None: ... + def bind(self, database: Incomplete | None = ...): ... + def clone(self): ... + def dicts(self, as_dict: bool = ...): ... + def tuples(self, as_tuple: bool = ...): ... + def namedtuples(self, as_namedtuple: bool = ...): ... + def objects(self, constructor: Incomplete | None = ...): ... + def __sql__(self, ctx) -> None: ... + def sql(self): ... + def execute(self, database): ... + def iterator(self, database: Incomplete | None = ...): ... + def __iter__(self): ... + def __getitem__(self, value): ... + def __len__(self) -> int: ... + +class RawQuery(BaseQuery): + def __init__(self, sql: Incomplete | None = ..., params: Incomplete | None = ..., **kwargs) -> None: ... + def __sql__(self, ctx): ... + +class Query(BaseQuery): + def __init__( + self, + where: Incomplete | None = ..., + order_by: Incomplete | None = ..., + limit: Incomplete | None = ..., + offset: Incomplete | None = ..., + **kwargs, + ) -> None: ... + def with_cte(self, *cte_list) -> None: ... + def where(self, *expressions) -> None: ... + def orwhere(self, *expressions) -> None: ... + def order_by(self, *values) -> None: ... + def order_by_extend(self, *values) -> None: ... + def limit(self, value: Incomplete | None = ...) -> None: ... + def offset(self, value: Incomplete | None = ...) -> None: ... + def paginate(self, page, paginate_by: int = ...) -> None: ... + def __sql__(self, ctx): ... + +class SelectQuery(Query): + union_all: Incomplete + __add__: Incomplete + union: Incomplete + __or__: Incomplete + intersect: Incomplete + __and__: Incomplete + except_: Incomplete + __sub__: Incomplete + __radd__: Incomplete + __ror__: Incomplete + __rand__: Incomplete + __rsub__: Incomplete + def select_from(self, *columns): ... + +class SelectBase(_HashableSource, Source, SelectQuery): + def peek(self, database, n: int = ...): ... + def first(self, database, n: int = ...): ... + def scalar(self, database, as_tuple: bool = ..., as_dict: bool = ...): ... + def scalars(self, database) -> Generator[Incomplete, None, None]: ... + def count(self, database, clear_limit: bool = ...): ... + def exists(self, database): ... + def get(self, database): ... + +class CompoundSelectQuery(SelectBase): + lhs: Incomplete + op: Incomplete + rhs: Incomplete + def __init__(self, lhs, op, rhs) -> None: ... + def exists(self, database): ... + def __sql__(self, ctx): ... + +class Select(SelectBase): + def __init__( + self, + from_list: Incomplete | None = ..., + columns: Incomplete | None = ..., + group_by: Incomplete | None = ..., + having: Incomplete | None = ..., + distinct: Incomplete | None = ..., + windows: Incomplete | None = ..., + for_update: Incomplete | None = ..., + for_update_of: Incomplete | None = ..., + nowait: Incomplete | None = ..., + lateral: Incomplete | None = ..., + **kwargs, + ) -> None: ... + def clone(self): ... + def columns(self, *columns, **kwargs) -> None: ... + select: Incomplete + def select_extend(self, *columns) -> None: ... + @property + def selected_columns(self): ... + @selected_columns.setter + def selected_columns(self, value) -> None: ... + def from_(self, *sources) -> None: ... + def join(self, dest, join_type=..., on: Incomplete | None = ...) -> None: ... + def left_outer_join(self, dest, on: Incomplete | None = ...): ... + def group_by(self, *columns) -> None: ... + def group_by_extend(self, *values): ... + def having(self, *expressions) -> None: ... + def distinct(self, *columns) -> None: ... + def window(self, *windows) -> None: ... + def for_update(self, for_update: bool = ..., of: Incomplete | None = ..., nowait: Incomplete | None = ...) -> None: ... + def lateral(self, lateral: bool = ...) -> None: ... + def __sql_selection__(self, ctx, is_subquery: bool = ...): ... + def __sql__(self, ctx): ... + +class _WriteQuery(Query): + table: Incomplete + def __init__(self, table, returning: Incomplete | None = ..., **kwargs) -> None: ... + def cte(self, name, recursive: bool = ..., columns: Incomplete | None = ..., materialized: Incomplete | None = ...): ... + def returning(self, *returning) -> None: ... + def apply_returning(self, ctx): ... + def execute_returning(self, database): ... + def handle_result(self, database, cursor): ... + def __sql__(self, ctx): ... + +class Update(_WriteQuery): + def __init__(self, table, update: Incomplete | None = ..., **kwargs) -> None: ... + def from_(self, *sources) -> None: ... + def __sql__(self, ctx): ... + +class Insert(_WriteQuery): + SIMPLE: int + QUERY: int + MULTI: int + + class DefaultValuesException(Exception): ... + + def __init__( + self, + table, + insert: Incomplete | None = ..., + columns: Incomplete | None = ..., + on_conflict: Incomplete | None = ..., + **kwargs, + ) -> None: ... + def where(self, *expressions) -> None: ... + def as_rowcount(self, _as_rowcount: bool = ...) -> None: ... + def on_conflict_ignore(self, ignore: bool = ...) -> None: ... + def on_conflict_replace(self, replace: bool = ...) -> None: ... + def on_conflict(self, *args, **kwargs) -> None: ... + def get_default_data(self): ... + def get_default_columns(self): ... + def __sql__(self, ctx): ... + def handle_result(self, database, cursor): ... + +class Delete(_WriteQuery): + def __sql__(self, ctx): ... + +class Index(Node): + def __init__( + self, + name, + table, + expressions, + unique: bool = ..., + safe: bool = ..., + where: Incomplete | None = ..., + using: Incomplete | None = ..., + ) -> None: ... + def safe(self, _safe: bool = ...) -> None: ... + def where(self, *expressions) -> None: ... + def using(self, _using: Incomplete | None = ...) -> None: ... + def __sql__(self, ctx): ... + +class ModelIndex(Index): + def __init__( + self, + model, + fields, + unique: bool = ..., + safe: bool = ..., + where: Incomplete | None = ..., + using: Incomplete | None = ..., + name: Incomplete | None = ..., + ) -> None: ... + +class PeeweeException(Exception): + def __init__(self, *args) -> None: ... + +class ImproperlyConfigured(PeeweeException): ... +class DatabaseError(PeeweeException): ... +class DataError(DatabaseError): ... +class IntegrityError(DatabaseError): ... +class InterfaceError(PeeweeException): ... +class InternalError(DatabaseError): ... +class NotSupportedError(DatabaseError): ... +class OperationalError(DatabaseError): ... +class ProgrammingError(DatabaseError): ... + +class ExceptionWrapper: + exceptions: Incomplete + def __init__(self, exceptions) -> None: ... + def __enter__(self) -> None: ... + def __exit__( + self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None + ) -> None: ... + +class IndexMetadata(NamedTuple): + name: Incomplete + sql: Incomplete + columns: Incomplete + unique: Incomplete + table: Incomplete + +class ColumnMetadata(NamedTuple): + name: Incomplete + data_type: Incomplete + null: Incomplete + primary_key: Incomplete + table: Incomplete + default: Incomplete + +class ForeignKeyMetadata(NamedTuple): + column: Incomplete + dest_table: Incomplete + dest_column: Incomplete + table: Incomplete + +class ViewMetadata(NamedTuple): + name: Incomplete + sql: Incomplete + +class _ConnectionState: + def __init__(self, **kwargs) -> None: ... + closed: bool + conn: Incomplete + ctx: Incomplete + transactions: Incomplete + def reset(self) -> None: ... + def set_connection(self, conn) -> None: ... + +class _ConnectionLocal(_ConnectionState, threading.local): ... + +class _NoopLock: + def __enter__(self): ... + def __exit__( + self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None + ) -> None: ... + +class ConnectionContext(_callable_context_manager): + db: Incomplete + def __init__(self, db) -> None: ... + def __enter__(self) -> None: ... + def __exit__( + self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None + ) -> None: ... + +class Database(_callable_context_manager): + context_class: Incomplete + field_types: Incomplete + operations: Incomplete + param: str + quote: str + server_version: Incomplete + commit_select: bool + compound_select_parentheses: Incomplete + for_update: bool + index_schema_prefix: bool + index_using_precedes_table: bool + limit_max: Incomplete + nulls_ordering: bool + returning_clause: bool + safe_create_index: bool + safe_drop_index: bool + sequences: bool + truncate_table: bool + autoconnect: Incomplete + thread_safe: Incomplete + connect_params: Incomplete + def __init__( + self, + database, + thread_safe: bool = ..., + autorollback: bool = ..., + field_types: Incomplete | None = ..., + operations: Incomplete | None = ..., + autocommit: Incomplete | None = ..., + autoconnect: bool = ..., + **kwargs, + ) -> None: ... + database: Incomplete + deferred: Incomplete + def init(self, database, **kwargs) -> None: ... + def __enter__(self): ... + def __exit__( + self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None + ) -> None: ... + def connection_context(self): ... + def connect(self, reuse_if_open: bool = ...): ... + def close(self): ... + def is_closed(self): ... + def is_connection_usable(self): ... + def connection(self): ... + def cursor(self, commit: Incomplete | None = None, named_cursor: Incomplete | None = None): ... + def execute_sql(self, sql, params: Incomplete | None = ..., commit=...): ... + def execute(self, query, commit=..., **context_options): ... + def get_context_options(self): ... + def get_sql_context(self, **context_options): ... + def conflict_statement(self, on_conflict, query) -> None: ... + def conflict_update(self, on_conflict, query) -> None: ... + def last_insert_id(self, cursor, query_type: Incomplete | None = ...): ... + def rows_affected(self, cursor): ... + def default_values_insert(self, ctx): ... + def session_start(self): ... + def session_commit(self): ... + def session_rollback(self): ... + def in_transaction(self): ... + def push_transaction(self, transaction) -> None: ... + def pop_transaction(self): ... + def transaction_depth(self): ... + def top_transaction(self): ... + def atomic(self, *args, **kwargs): ... + def manual_commit(self): ... + def transaction(self, *args, **kwargs): ... + def savepoint(self): ... + def begin(self) -> None: ... + def commit(self): ... + def rollback(self): ... + def batch_commit(self, it, n) -> Generator[Incomplete, None, None]: ... + def table_exists(self, table_name, schema: Incomplete | None = ...): ... + def get_tables(self, schema: Incomplete | None = ...) -> None: ... + def get_indexes(self, table, schema: Incomplete | None = ...) -> None: ... + def get_columns(self, table, schema: Incomplete | None = ...) -> None: ... + def get_primary_keys(self, table, schema: Incomplete | None = ...) -> None: ... + def get_foreign_keys(self, table, schema: Incomplete | None = ...) -> None: ... + def sequence_exists(self, seq) -> None: ... + def create_tables(self, models, **options) -> None: ... + def drop_tables(self, models, **kwargs) -> None: ... + def extract_date(self, date_part, date_field) -> None: ... + def truncate_date(self, date_part, date_field) -> None: ... + def to_timestamp(self, date_field) -> None: ... + def from_timestamp(self, date_field) -> None: ... + def random(self): ... + def bind(self, models, bind_refs: bool = ..., bind_backrefs: bool = ...) -> None: ... + def bind_ctx(self, models, bind_refs: bool = ..., bind_backrefs: bool = ...): ... + def get_noop_select(self, ctx): ... + @property + def Model(self) -> type[Model]: ... + +class SqliteDatabase(Database): + field_types: Incomplete + operations: Incomplete + index_schema_prefix: bool + limit_max: int + server_version: Incomplete + truncate_table: bool + nulls_ordering: Incomplete + def __init__(self, database, *args, **kwargs) -> None: ... + returning_clause: Incomplete + def init( + self, database, pragmas: Incomplete | None = ..., timeout: int = ..., returning_clause: Incomplete | None = ..., **kwargs + ) -> None: ... + def pragma(self, key, value=..., permanent: bool = ..., schema: Incomplete | None = ...): ... + cache_size: Incomplete + foreign_keys: Incomplete + journal_mode: Incomplete + journal_size_limit: Incomplete + mmap_size: Incomplete + page_size: Incomplete + read_uncommitted: Incomplete + synchronous: Incomplete + wal_autocheckpoint: Incomplete + application_id: Incomplete + user_version: Incomplete + data_version: Incomplete + @property + def timeout(self): ... + @timeout.setter + def timeout(self, seconds) -> None: ... + def register_aggregate(self, klass, name: Incomplete | None = ..., num_params: int = ...) -> None: ... + def aggregate(self, name: Incomplete | None = ..., num_params: int = ...): ... + def register_collation(self, fn, name: Incomplete | None = ...): ... + def collation(self, name: Incomplete | None = ...): ... + def register_function(self, fn, name: Incomplete | None = ..., num_params: int = ...) -> None: ... + def func(self, name: Incomplete | None = ..., num_params: int = ...): ... + def register_window_function(self, klass, name: Incomplete | None = ..., num_params: int = ...) -> None: ... + def window_function(self, name: Incomplete | None = ..., num_params: int = ...): ... + def register_table_function(self, klass, name: Incomplete | None = ...) -> None: ... + def table_function(self, name: Incomplete | None = ...): ... + def unregister_aggregate(self, name) -> None: ... + def unregister_collation(self, name) -> None: ... + def unregister_function(self, name) -> None: ... + def unregister_window_function(self, name) -> None: ... + def unregister_table_function(self, name): ... + def load_extension(self, extension) -> None: ... + def unload_extension(self, extension) -> None: ... + def attach(self, filename, name): ... + def detach(self, name): ... + def last_insert_id(self, cursor, query_type: Incomplete | None = ...): ... + def rows_affected(self, cursor): ... + def begin(self, lock_type: Incomplete | None = ...) -> None: ... + def get_tables(self, schema: Incomplete | None = ...): ... + def get_views(self, schema: Incomplete | None = ...): ... + def get_indexes(self, table, schema: Incomplete | None = ...): ... + def get_columns(self, table, schema: Incomplete | None = ...): ... + def get_primary_keys(self, table, schema: Incomplete | None = ...): ... + def get_foreign_keys(self, table, schema: Incomplete | None = ...): ... + def get_binary_type(self): ... + def conflict_statement(self, on_conflict, query): ... + def conflict_update(self, oc, query): ... + def extract_date(self, date_part, date_field): ... + def truncate_date(self, date_part, date_field): ... + def to_timestamp(self, date_field): ... + def from_timestamp(self, date_field): ... + +class PostgresqlDatabase(Database): + field_types: Incomplete + operations: Incomplete + param: str + commit_select: bool + compound_select_parentheses: Incomplete + for_update: bool + nulls_ordering: bool + returning_clause: bool + safe_create_index: bool + sequences: bool + def init( + self, + database, + register_unicode: bool = ..., + encoding: Incomplete | None = ..., + isolation_level: Incomplete | None = ..., + **kwargs, + ) -> None: ... + def is_connection_usable(self): ... + def last_insert_id(self, cursor, query_type: Incomplete | None = ...): ... + def rows_affected(self, cursor): ... + def get_tables(self, schema: Incomplete | None = ...): ... + def get_views(self, schema: Incomplete | None = ...): ... + def get_indexes(self, table, schema: Incomplete | None = ...): ... + def get_columns(self, table, schema: Incomplete | None = ...): ... + def get_primary_keys(self, table, schema: Incomplete | None = ...): ... + def get_foreign_keys(self, table, schema: Incomplete | None = ...): ... + def sequence_exists(self, sequence): ... + def get_binary_type(self): ... + def conflict_statement(self, on_conflict, query) -> None: ... + def conflict_update(self, oc, query): ... + def extract_date(self, date_part, date_field): ... + def truncate_date(self, date_part, date_field): ... + def to_timestamp(self, date_field): ... + def from_timestamp(self, date_field): ... + def get_noop_select(self, ctx): ... + def set_time_zone(self, timezone) -> None: ... + +class MySQLDatabase(Database): + field_types: Incomplete + operations: Incomplete + param: str + quote: str + commit_select: bool + compound_select_parentheses: Incomplete + for_update: bool + index_using_precedes_table: bool + limit_max: Incomplete + safe_create_index: bool + safe_drop_index: bool + sql_mode: str + def init(self, database, **kwargs) -> None: ... + def is_connection_usable(self): ... + def default_values_insert(self, ctx): ... + def get_tables(self, schema: Incomplete | None = ...): ... + def get_views(self, schema: Incomplete | None = ...): ... + def get_indexes(self, table, schema: Incomplete | None = ...): ... + def get_columns(self, table, schema: Incomplete | None = ...): ... + def get_primary_keys(self, table, schema: Incomplete | None = ...): ... + def get_foreign_keys(self, table, schema: Incomplete | None = ...): ... + def get_binary_type(self): ... + def conflict_statement(self, on_conflict, query): ... + def conflict_update(self, on_conflict, query): ... + def extract_date(self, date_part, date_field): ... + def truncate_date(self, date_part, date_field): ... + def to_timestamp(self, date_field): ... + def from_timestamp(self, date_field): ... + def random(self): ... + def get_noop_select(self, ctx): ... + +class _manual(_callable_context_manager): + db: Incomplete + def __init__(self, db) -> None: ... + def __enter__(self) -> None: ... + def __exit__( + self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None + ) -> None: ... + +class _atomic(_callable_context_manager): + db: Incomplete + def __init__(self, db, *args, **kwargs) -> None: ... + def __enter__(self): ... + def __exit__(self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None): ... + +class _transaction(_callable_context_manager): + db: Incomplete + def __init__(self, db, *args, **kwargs) -> None: ... + def commit(self, begin: bool = ...) -> None: ... + def rollback(self, begin: bool = ...) -> None: ... + def __enter__(self): ... + def __exit__( + self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None + ) -> None: ... + +class _savepoint(_callable_context_manager): + db: Incomplete + sid: Incomplete + quoted_sid: Incomplete + def __init__(self, db, sid: Incomplete | None = ...) -> None: ... + def commit(self, begin: bool = ...) -> None: ... + def rollback(self) -> None: ... + def __enter__(self): ... + def __exit__( + self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None + ) -> None: ... + +class CursorWrapper: + cursor: Incomplete + count: int + index: int + initialized: bool + populated: bool + row_cache: Incomplete + def __init__(self, cursor) -> None: ... + def __iter__(self): ... + def __getitem__(self, item): ... + def __len__(self) -> int: ... + def initialize(self) -> None: ... + def iterate(self, cache: bool = ...): ... + def process_row(self, row): ... + def iterator(self) -> Generator[Incomplete, None, None]: ... + def fill_cache(self, n: int = ...) -> None: ... + +class DictCursorWrapper(CursorWrapper): + initialize: Incomplete + process_row: Incomplete + +class NamedTupleCursorWrapper(CursorWrapper): + tuple_class: Incomplete + def initialize(self) -> None: ... + def process_row(self, row): ... + +class ObjectCursorWrapper(DictCursorWrapper): + constructor: Incomplete + def __init__(self, cursor, constructor) -> None: ... + def process_row(self, row): ... + +class ResultIterator: + cursor_wrapper: Incomplete + index: int + def __init__(self, cursor_wrapper) -> None: ... + def __iter__(self): ... + def next(self): ... + __next__: Incomplete + +class FieldAccessor: + model: Incomplete + field: Incomplete + name: Incomplete + def __init__(self, model, field, name) -> None: ... + def __get__(self, instance, instance_type: Incomplete | None = ...): ... + def __set__(self, instance, value) -> None: ... + +class ForeignKeyAccessor(FieldAccessor): + rel_model: Incomplete + def __init__(self, model, field, name) -> None: ... + def get_rel_instance(self, instance): ... + def __get__(self, instance, instance_type: Incomplete | None = ...): ... + def __set__(self, instance, obj) -> None: ... + +class BackrefAccessor: + field: Incomplete + model: Incomplete + rel_model: Incomplete + def __init__(self, field) -> None: ... + def __get__(self, instance, instance_type: Incomplete | None = ...): ... + +class ObjectIdAccessor: + field: Incomplete + def __init__(self, field) -> None: ... + def __get__(self, instance, instance_type: Incomplete | None = ...): ... + def __set__(self, instance, value) -> None: ... + +class Field(ColumnBase): + accessor_class: Incomplete + auto_increment: bool + default_index_type: Incomplete + field_type: str + unpack: bool + null: Incomplete + index: Incomplete + unique: Incomplete + column_name: Incomplete + default: Incomplete + primary_key: Incomplete + constraints: Incomplete + sequence: Incomplete + collation: Incomplete + unindexed: Incomplete + choices: Incomplete + help_text: Incomplete + verbose_name: Incomplete + index_type: Incomplete + def __init__( + self, + null: bool = ..., + index: bool = ..., + unique: bool = ..., + column_name: Incomplete | None = ..., + default: Incomplete | None = ..., + primary_key: bool = ..., + constraints: Incomplete | None = ..., + sequence: Incomplete | None = ..., + collation: Incomplete | None = ..., + unindexed: bool = ..., + choices: Incomplete | None = ..., + help_text: Incomplete | None = ..., + verbose_name: Incomplete | None = ..., + index_type: Incomplete | None = ..., + db_column: Incomplete | None = ..., + _hidden: bool = ..., + ) -> None: ... + def __hash__(self) -> int: ... + model: Incomplete + name: Incomplete + def bind(self, model, name, set_attribute: bool = ...) -> None: ... + @property + def column(self): ... + def adapt(self, value): ... + def db_value(self, value): ... + def python_value(self, value): ... + def to_value(self, value): ... + def get_sort_key(self, ctx): ... + def __sql__(self, ctx): ... + def get_modifiers(self) -> None: ... + def ddl_datatype(self, ctx): ... + def ddl(self, ctx): ... + +class AnyField(Field): + field_type: str + +class IntegerField(Field): + field_type: str + def adapt(self, value): ... + +class BigIntegerField(IntegerField): + field_type: str + +class SmallIntegerField(IntegerField): + field_type: str + +class AutoField(IntegerField): + auto_increment: bool + field_type: str + def __init__(self, *args, **kwargs) -> None: ... + +class BigAutoField(AutoField): + field_type: str + +class IdentityField(AutoField): + field_type: str + def __init__(self, generate_always: bool = ..., **kwargs) -> None: ... + +class PrimaryKeyField(AutoField): + def __init__(self, *args, **kwargs) -> None: ... + +class FloatField(Field): + field_type: str + def adapt(self, value): ... + +class DoubleField(FloatField): + field_type: str + +class DecimalField(Field): + field_type: str + max_digits: Incomplete + decimal_places: Incomplete + auto_round: Incomplete + rounding: Incomplete + def __init__( + self, + max_digits: int = ..., + decimal_places: int = ..., + auto_round: bool = ..., + rounding: Incomplete | None = ..., + *args, + **kwargs, + ) -> None: ... + def get_modifiers(self): ... + def db_value(self, value): ... + def python_value(self, value): ... + +class _StringField(Field): + def adapt(self, value): ... + def __add__(self, other): ... + def __radd__(self, other): ... + +class CharField(_StringField): + field_type: str + max_length: Incomplete + def __init__(self, max_length: int = ..., *args, **kwargs) -> None: ... + def get_modifiers(self): ... + +class FixedCharField(CharField): + field_type: str + def python_value(self, value): ... + +class TextField(_StringField): + field_type: str + +class BlobField(Field): + field_type: str + def bind(self, model, name, set_attribute: bool = ...): ... + def db_value(self, value): ... + +class BitField(BitwiseMixin, BigIntegerField): + def __init__(self, *args, **kwargs) -> None: ... + def flag(self, value: Incomplete | None = ...): ... + +class BigBitFieldData: + instance: Incomplete + name: Incomplete + def __init__(self, instance, name) -> None: ... + def set_bit(self, idx) -> None: ... + def clear_bit(self, idx) -> None: ... + def toggle_bit(self, idx): ... + def is_set(self, idx): ... + +class BigBitFieldAccessor(FieldAccessor): + def __get__(self, instance, instance_type: Incomplete | None = ...): ... + def __set__(self, instance, value) -> None: ... + +class BigBitField(BlobField): + accessor_class: Incomplete + def __init__(self, *args, **kwargs) -> None: ... + def db_value(self, value): ... + +class UUIDField(Field): + field_type: str + def db_value(self, value): ... + def python_value(self, value): ... + +class BinaryUUIDField(BlobField): + field_type: str + def db_value(self, value): ... + def python_value(self, value): ... + +class _BaseFormattedField(Field): + formats: Incomplete + def __init__(self, formats: Incomplete | None = ..., *args, **kwargs) -> None: ... + +class DateTimeField(_BaseFormattedField): + field_type: str + formats: Incomplete + def adapt(self, value): ... + def to_timestamp(self): ... + def truncate(self, part): ... + year: Incomplete + month: Incomplete + day: Incomplete + hour: Incomplete + minute: Incomplete + second: Incomplete + +class DateField(_BaseFormattedField): + field_type: str + formats: Incomplete + def adapt(self, value): ... + def to_timestamp(self): ... + def truncate(self, part): ... + year: Incomplete + month: Incomplete + day: Incomplete + +class TimeField(_BaseFormattedField): + field_type: str + formats: Incomplete + def adapt(self, value): ... + hour: Incomplete + minute: Incomplete + second: Incomplete + +class TimestampField(BigIntegerField): + valid_resolutions: Incomplete + resolution: Incomplete + ticks_to_microsecond: Incomplete + utc: Incomplete + def __init__(self, *args, **kwargs) -> None: ... + def local_to_utc(self, dt): ... + def utc_to_local(self, dt): ... + def get_timestamp(self, value): ... + def db_value(self, value): ... + def python_value(self, value): ... + def from_timestamp(self): ... + year: Incomplete + month: Incomplete + day: Incomplete + hour: Incomplete + minute: Incomplete + second: Incomplete + +class IPField(BigIntegerField): + def db_value(self, val): ... + def python_value(self, val): ... + +class BooleanField(Field): + field_type: str + adapt: Incomplete + +class BareField(Field): + adapt: Incomplete + def __init__(self, adapt: Incomplete | None = ..., *args, **kwargs) -> None: ... + def ddl_datatype(self, ctx) -> None: ... + +class ForeignKeyField(Field): + accessor_class: Incomplete + backref_accessor_class: Incomplete + rel_model: Incomplete + rel_field: Incomplete + declared_backref: Incomplete + backref: Incomplete + on_delete: Incomplete + on_update: Incomplete + deferrable: Incomplete + deferred: Incomplete + object_id_name: Incomplete + lazy_load: Incomplete + constraint_name: Incomplete + def __init__( + self, + model, + field: Incomplete | None = ..., + backref: Incomplete | None = ..., + on_delete: Incomplete | None = ..., + on_update: Incomplete | None = ..., + deferrable: Incomplete | None = ..., + _deferred: Incomplete | None = ..., + rel_model: Incomplete | None = ..., + to_field: Incomplete | None = ..., + object_id_name: Incomplete | None = ..., + lazy_load: bool = ..., + constraint_name: Incomplete | None = ..., + related_name: Incomplete | None = ..., + *args, + **kwargs, + ) -> None: ... + @property + def field_type(self): ... + def get_modifiers(self): ... + def adapt(self, value): ... + def db_value(self, value): ... + def python_value(self, value): ... + column_name: Incomplete + safe_name: Incomplete + def bind(self, model, name, set_attribute: bool = ...) -> None: ... + def foreign_key_constraint(self): ... + def __getattr__(self, attr: str): ... + +class DeferredForeignKey(Field): + field_kwargs: Incomplete + rel_model_name: Incomplete + def __init__(self, rel_model_name, **kwargs) -> None: ... + __hash__: Incomplete + def __deepcopy__(self, memo: Incomplete | None = ...): ... + def set_model(self, rel_model) -> None: ... + @staticmethod + def resolve(model_cls) -> None: ... + +class DeferredThroughModel: + def __init__(self) -> None: ... + def set_field(self, model, field, name) -> None: ... + def set_model(self, through_model) -> None: ... + +class MetaField(Field): + column_name: Incomplete + default: Incomplete + model: Incomplete + name: Incomplete + primary_key: bool + +class ManyToManyFieldAccessor(FieldAccessor): + model: Incomplete + rel_model: Incomplete + through_model: Incomplete + src_fk: Incomplete + dest_fk: Incomplete + def __init__(self, model, field, name) -> None: ... + def __get__(self, instance, instance_type: Incomplete | None = ..., force_query: bool = ...): ... + def __set__(self, instance, value) -> None: ... + +class ManyToManyField(MetaField): + accessor_class: Incomplete + rel_model: Incomplete + backref: Incomplete + def __init__( + self, + model, + backref: Incomplete | None = ..., + through_model: Incomplete | None = ..., + on_delete: Incomplete | None = ..., + on_update: Incomplete | None = ..., + _is_backref: bool = ..., + ) -> None: ... + def bind(self, model, name, set_attribute: bool = ...) -> None: ... + def get_models(self): ... + @property + def through_model(self): ... + @through_model.setter + def through_model(self, value) -> None: ... + def get_through_model(self): ... + +class VirtualField(MetaField): + field_class: Incomplete + field_instance: Incomplete + def __init__(self, field_class: Incomplete | None = ..., *args, **kwargs) -> None: ... + def db_value(self, value): ... + def python_value(self, value): ... + model: Incomplete + column_name: Incomplete + def bind(self, model, name, set_attribute: bool = ...) -> None: ... + +class CompositeKey(MetaField): + sequence: Incomplete + field_names: Incomplete + def __init__(self, *field_names) -> None: ... + @property + def safe_field_names(self): ... + def __get__(self, instance, instance_type: Incomplete | None = ...): ... + def __set__(self, instance, value) -> None: ... + def __eq__(self, other): ... + def __ne__(self, other): ... + def __hash__(self) -> int: ... + def __sql__(self, ctx): ... + model: Incomplete + column_name: Incomplete + def bind(self, model, name, set_attribute: bool = ...) -> None: ... + +class _SortedFieldList: + def __init__(self) -> None: ... + def __getitem__(self, i): ... + def __iter__(self): ... + def __contains__(self, item): ... + def index(self, field): ... + def insert(self, item) -> None: ... + def remove(self, item) -> None: ... + +class SchemaManager: + model: Incomplete + context_options: Incomplete + def __init__(self, model, database: Incomplete | None = ..., **context_options) -> None: ... + @property + def database(self): ... + @database.setter + def database(self, value) -> None: ... + def create_table(self, safe: bool = ..., **options) -> None: ... + def create_table_as(self, table_name, query, safe: bool = ..., **meta) -> None: ... + def drop_table(self, safe: bool = ..., **options) -> None: ... + def truncate_table(self, restart_identity: bool = ..., cascade: bool = ...) -> None: ... + def create_indexes(self, safe: bool = ...) -> None: ... + def drop_indexes(self, safe: bool = ...) -> None: ... + def create_sequence(self, field) -> None: ... + def drop_sequence(self, field) -> None: ... + def create_foreign_key(self, field) -> None: ... + def create_sequences(self) -> None: ... + def create_all(self, safe: bool = ..., **table_options) -> None: ... + def drop_sequences(self) -> None: ... + def drop_all(self, safe: bool = ..., drop_sequences: bool = ..., **options) -> None: ... + +class Metadata: + model: Incomplete + database: Incomplete + fields: Incomplete + columns: Incomplete + combined: Incomplete + sorted_fields: Incomplete + sorted_field_names: Incomplete + defaults: Incomplete + name: Incomplete + table_function: Incomplete + legacy_table_names: Incomplete + table_name: Incomplete + indexes: Incomplete + constraints: Incomplete + primary_key: Incomplete + composite_key: Incomplete + only_save_dirty: Incomplete + depends_on: Incomplete + table_settings: Incomplete + without_rowid: Incomplete + strict_tables: Incomplete + temporary: Incomplete + refs: Incomplete + backrefs: Incomplete + model_refs: Incomplete + model_backrefs: Incomplete + manytomany: Incomplete + options: Incomplete + def __init__( + self, + model, + database: Incomplete | None = ..., + table_name: Incomplete | None = ..., + indexes: Incomplete | None = ..., + primary_key: Incomplete | None = ..., + constraints: Incomplete | None = ..., + schema: Incomplete | None = ..., + only_save_dirty: bool = ..., + depends_on: Incomplete | None = ..., + options: Incomplete | None = ..., + db_table: Incomplete | None = ..., + table_function: Incomplete | None = ..., + table_settings: Incomplete | None = ..., + without_rowid: bool = ..., + temporary: bool = ..., + strict_tables: Incomplete | None = ..., + legacy_table_names: bool = ..., + **kwargs, + ) -> None: ... + def make_table_name(self): ... + def model_graph(self, refs: bool = ..., backrefs: bool = ..., depth_first: bool = ...): ... + def add_ref(self, field) -> None: ... + def remove_ref(self, field) -> None: ... + def add_manytomany(self, field) -> None: ... + def remove_manytomany(self, field) -> None: ... + @property + def table(self): ... + @table.deleter + def table(self) -> None: ... + @property + def schema(self): ... + @schema.setter + def schema(self, value) -> None: ... + @property + def entity(self): ... + def get_rel_for_model(self, model): ... + def add_field(self, field_name, field, set_attribute: bool = ...) -> None: ... + def remove_field(self, field_name) -> None: ... + auto_increment: Incomplete + def set_primary_key(self, name, field) -> None: ... + def get_primary_keys(self): ... + def get_default_dict(self): ... + def fields_to_index(self): ... + def set_database(self, database) -> None: ... + def set_table_name(self, table_name) -> None: ... + +class SubclassAwareMetadata(Metadata): + models: Incomplete + def __init__(self, model, *args, **kwargs) -> None: ... + def map_models(self, fn) -> None: ... + +class DoesNotExist(Exception): ... + +class ModelBase(type): + inheritable: Incomplete + def __new__(cls, name, bases, attrs): ... + def __iter__(self): ... + def __getitem__(self, key): ... + def __setitem__(self, key, value) -> None: ... + def __delitem__(self, key) -> None: ... + def __contains__(self, key): ... + def __len__(self) -> int: ... + def __bool__(self) -> bool: ... + def __nonzero__(self) -> bool: ... + def __sql__(self, ctx): ... + +class _BoundModelsContext(_callable_context_manager): + models: Incomplete + database: Incomplete + bind_refs: Incomplete + bind_backrefs: Incomplete + def __init__(self, models, database, bind_refs, bind_backrefs) -> None: ... + def __enter__(self): ... + def __exit__( + self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None + ) -> None: ... + +class Model(metaclass=ModelBase): + __data__: Incomplete + __rel__: Incomplete + def __init__(self, *args, **kwargs) -> None: ... + @classmethod + def validate_model(cls) -> None: ... + @classmethod + def alias(cls, alias: Incomplete | None = ...): ... + @classmethod + def select(cls, *fields): ... + @classmethod + def update(cls, __data: Incomplete | None = ..., **update): ... + @classmethod + def insert(cls, __data: Incomplete | None = ..., **insert): ... + @classmethod + def insert_many(cls, rows, fields: Incomplete | None = ...): ... + @classmethod + def insert_from(cls, query, fields): ... + @classmethod + def replace(cls, __data: Incomplete | None = ..., **insert): ... + @classmethod + def replace_many(cls, rows, fields: Incomplete | None = ...): ... + @classmethod + def raw(cls, sql, *params): ... + @classmethod + def delete(cls): ... + @classmethod + def create(cls, **query): ... + @classmethod + def bulk_create(cls, model_list, batch_size: Incomplete | None = ...) -> None: ... + @classmethod + def bulk_update(cls, model_list, fields, batch_size: Incomplete | None = ...): ... + @classmethod + def noop(cls): ... + @classmethod + def get(cls, *query, **filters): ... + @classmethod + def get_or_none(cls, *query, **filters): ... + @classmethod + def get_by_id(cls, pk): ... + @classmethod + def set_by_id(cls, key, value): ... + @classmethod + def delete_by_id(cls, pk): ... + @classmethod + def get_or_create(cls, **kwargs): ... + @classmethod + def filter(cls, *dq_nodes, **filters): ... + def get_id(self): ... + def save(self, force_insert: bool = ..., only: Incomplete | None = ...): ... + def is_dirty(self): ... + @property + def dirty_fields(self): ... + def dependencies(self, search_nullable: bool = ...) -> Generator[Incomplete, None, None]: ... + def delete_instance(self, recursive: bool = ..., delete_nullable: bool = ...): ... + def __hash__(self) -> int: ... + def __eq__(self, other): ... + def __ne__(self, other): ... + def __sql__(self, ctx): ... + @classmethod + def bind(cls, database, bind_refs: bool = ..., bind_backrefs: bool = ..., _exclude: Incomplete | None = ...): ... + @classmethod + def bind_ctx(cls, database, bind_refs: bool = ..., bind_backrefs: bool = ...): ... + @classmethod + def table_exists(cls): ... + @classmethod + def create_table(cls, safe: bool = ..., **options) -> None: ... + @classmethod + def drop_table(cls, safe: bool = ..., drop_sequences: bool = ..., **options) -> None: ... + @classmethod + def truncate_table(cls, **options) -> None: ... + @classmethod + def index(cls, *fields, **kwargs): ... + @classmethod + def add_index(cls, *fields, **kwargs) -> None: ... + +class ModelAlias(Node): + def __init__(self, model, alias: Incomplete | None = ...) -> None: ... + def __getattr__(self, attr: str): ... + def __setattr__(self, attr: str, value) -> None: ... + def get_field_aliases(self): ... + def select(self, *selection): ... + def __call__(self, **kwargs): ... + def __sql__(self, ctx): ... + +class FieldAlias(Field): + source: Incomplete + model: Incomplete + field: Incomplete + def __init__(self, source, field) -> None: ... + @classmethod + def create(cls, source, field): ... + def clone(self): ... + def adapt(self, value): ... + def python_value(self, value): ... + def db_value(self, value): ... + def __getattr__(self, attr: str): ... + def __sql__(self, ctx): ... + +class _ModelQueryHelper: + default_row_type: Incomplete + def __init__(self, *args, **kwargs) -> None: ... + def objects(self, constructor: Incomplete | None = ...) -> None: ... + +class ModelRaw(_ModelQueryHelper, RawQuery): + model: Incomplete + def __init__(self, model, sql, params, **kwargs) -> None: ... + def get(self): ... + +class BaseModelSelect(_ModelQueryHelper): + def union_all(self, rhs): ... + __add__: Incomplete + def union(self, rhs): ... + __or__: Incomplete + def intersect(self, rhs): ... + __and__: Incomplete + def except_(self, rhs): ... + __sub__: Incomplete + def __iter__(self): ... + def prefetch(self, *subqueries): ... + def get(self, database: Incomplete | None = ...): ... + def get_or_none(self, database: Incomplete | None = ...): ... + def group_by(self, *columns) -> None: ... + +class ModelCompoundSelectQuery(BaseModelSelect, CompoundSelectQuery): + model: Incomplete + def __init__(self, model, *args, **kwargs) -> None: ... + +class ModelSelect(BaseModelSelect, Select): + model: Incomplete + def __init__(self, model, fields_or_models, is_default: bool = ...) -> None: ... + def clone(self): ... + def select(self, *fields_or_models): ... + def select_extend(self, *columns): ... + def switch(self, ctx: Incomplete | None = ...): ... + def join( + self, dest, join_type=..., on: Incomplete | None = ..., src: Incomplete | None = ..., attr: Incomplete | None = ... + ) -> None: ... + def left_outer_join(self, dest, on: Incomplete | None = ..., src: Incomplete | None = ..., attr: Incomplete | None = ...): ... + def join_from(self, src, dest, join_type=..., on: Incomplete | None = ..., attr: Incomplete | None = ...): ... + def ensure_join(self, lm, rm, on: Incomplete | None = ..., **join_kwargs): ... + def convert_dict_to_node(self, qdict): ... + def filter(self, *args, **kwargs): ... + def create_table(self, name, safe: bool = ..., **meta): ... + def __sql_selection__(self, ctx, is_subquery: bool = ...): ... + +class NoopModelSelect(ModelSelect): + def __sql__(self, ctx): ... + +class _ModelWriteQueryHelper(_ModelQueryHelper): + model: Incomplete + def __init__(self, model, *args, **kwargs) -> None: ... + def returning(self, *returning): ... + +class ModelUpdate(_ModelWriteQueryHelper, Update): ... + +class ModelInsert(_ModelWriteQueryHelper, Insert): + default_row_type: Incomplete + def __init__(self, *args, **kwargs) -> None: ... + def returning(self, *returning): ... + def get_default_data(self): ... + def get_default_columns(self): ... + +class ModelDelete(_ModelWriteQueryHelper, Delete): ... + +class ManyToManyQuery(ModelSelect): + def __init__(self, instance, accessor, rel, *args, **kwargs) -> None: ... + def add(self, value, clear_existing: bool = ...) -> None: ... + def remove(self, value): ... + def clear(self): ... + +class BaseModelCursorWrapper(DictCursorWrapper): + model: Incomplete + select: Incomplete + def __init__(self, cursor, model, columns) -> None: ... + initialize: Incomplete + def process_row(self, row) -> None: ... + +class ModelDictCursorWrapper(BaseModelCursorWrapper): + def process_row(self, row): ... + +class ModelTupleCursorWrapper(ModelDictCursorWrapper): + constructor: Incomplete + def process_row(self, row): ... + +class ModelNamedTupleCursorWrapper(ModelTupleCursorWrapper): + tuple_class: Incomplete + constructor: Incomplete + def initialize(self): ... + +class ModelObjectCursorWrapper(ModelDictCursorWrapper): + constructor: Incomplete + is_model: Incomplete + def __init__(self, cursor, model, select, constructor) -> None: ... + def process_row(self, row): ... + +class ModelCursorWrapper(BaseModelCursorWrapper): + from_list: Incomplete + joins: Incomplete + def __init__(self, cursor, model, select, from_list, joins) -> None: ... + key_to_constructor: Incomplete + src_is_dest: Incomplete + src_to_dest: Incomplete + column_keys: Incomplete + def initialize(self) -> None: ... + def process_row(self, row): ... + +class PrefetchQuery: + def __new__( + cls, + query, + fields: Incomplete | None = ..., + is_backref: Incomplete | None = ..., + rel_models: Incomplete | None = ..., + field_to_name: Incomplete | None = ..., + model: Incomplete | None = ..., + ): ... + def populate_instance(self, instance, id_map) -> None: ... + def store_instance(self, instance, id_map) -> None: ... + +def prefetch(sq, *subqueries): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pep8-naming/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/pep8-naming/METADATA.toml index 9f7bb49c0..04ddbe7b0 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pep8-naming/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/pep8-naming/METADATA.toml @@ -1 +1,4 @@ version = "0.13.*" + +[tool.stubtest] +ignore_missing_stub = true diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pep8-naming/pep8ext_naming.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pep8-naming/pep8ext_naming.pyi index 20c711918..d15907134 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pep8-naming/pep8ext_naming.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pep8-naming/pep8ext_naming.pyi @@ -1,6 +1,7 @@ import ast +from _typeshed import Incomplete from argparse import Namespace -from collections.abc import Generator +from collections.abc import Generator, Iterable from typing import Any __version__: str @@ -23,6 +24,8 @@ class NamingChecker: @classmethod def parse_options(cls, option: Namespace) -> None: ... def run(self) -> Generator[tuple[int, int, str, type[Any]], None, None]: ... - def __getattr__(self, name: str) -> Any: ... # incomplete (other attributes are normally not accessed) + def tag_class_functions(self, cls_node: ast.ClassDef) -> None: ... + def set_function_nodes_types(self, nodes: Iterable[ast.AST], ismetaclass: bool, late_decoration: dict[str, str]) -> None: ... + def __getattr__(self, name: str) -> Incomplete: ... # incomplete (other attributes are normally not accessed) -def __getattr__(name: str) -> Any: ... # incomplete (other attributes are normally not accessed) +def __getattr__(name: str) -> Incomplete: ... # incomplete (other attributes are normally not accessed) diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pika/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/pika/METADATA.toml new file mode 100644 index 000000000..d1d388dbd --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pika/METADATA.toml @@ -0,0 +1,9 @@ +version = "1.3.*" +stub_distribution = "types-pika-ts" # https://github.com/python/typeshed/issues/9246 +extra_description = """\ +The `types-pika` package contains alternate, more complete type stubs, that \ +are maintained outside of typeshed.\ +""" + +[tool.stubtest] +stubtest_requirements = ["gevent", "tornado", "twisted"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/__init__.pyi new file mode 100644 index 000000000..de731d9a6 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/__init__.pyi @@ -0,0 +1,11 @@ +from pika import adapters as adapters +from pika.adapters import ( + BaseConnection as BaseConnection, + BlockingConnection as BlockingConnection, + SelectConnection as SelectConnection, +) +from pika.adapters.utils.connection_workflow import AMQPConnectionWorkflow as AMQPConnectionWorkflow +from pika.connection import ConnectionParameters as ConnectionParameters, SSLOptions as SSLOptions, URLParameters as URLParameters +from pika.credentials import PlainCredentials as PlainCredentials +from pika.delivery_mode import DeliveryMode as DeliveryMode +from pika.spec import BasicProperties as BasicProperties diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/adapters/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/adapters/__init__.pyi new file mode 100644 index 000000000..218d5aae5 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/adapters/__init__.pyi @@ -0,0 +1,3 @@ +from pika.adapters.base_connection import BaseConnection as BaseConnection +from pika.adapters.blocking_connection import BlockingConnection as BlockingConnection +from pika.adapters.select_connection import IOLoop as IOLoop, SelectConnection as SelectConnection diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/adapters/asyncio_connection.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/adapters/asyncio_connection.pyi new file mode 100644 index 000000000..621eb6fa2 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/adapters/asyncio_connection.pyi @@ -0,0 +1,53 @@ +from _typeshed import Incomplete +from asyncio import AbstractEventLoop +from collections.abc import Callable +from logging import Logger +from typing_extensions import Self + +from ..connection import Parameters +from .base_connection import BaseConnection +from .utils import io_services_utils, nbio_interface + +LOGGER: Logger + +class AsyncioConnection(BaseConnection): + def __init__( + self, + parameters: Parameters | None = ..., + on_open_callback: Callable[[Self], object] | None = ..., + on_open_error_callback: Callable[[Self, BaseException], object] | None = ..., + on_close_callback: Callable[[Self, BaseException], object] | None = ..., + custom_ioloop: AbstractEventLoop | None = ..., + internal_connection_workflow: bool = ..., + ) -> None: ... + @classmethod + def create_connection( + cls, connection_configs, on_done, custom_ioloop: AbstractEventLoop | None = ..., workflow: Incomplete | None = ... + ): ... + +class _AsyncioIOServicesAdapter( + io_services_utils.SocketConnectionMixin, + io_services_utils.StreamingConnectionMixin, + nbio_interface.AbstractIOServices, + nbio_interface.AbstractFileDescriptorServices, +): + def __init__(self, loop: Incomplete | None = ...) -> None: ... + def get_native_ioloop(self): ... + def close(self) -> None: ... + def run(self) -> None: ... + def stop(self) -> None: ... + def add_callback_threadsafe(self, callback) -> None: ... + def call_later(self, delay, callback): ... + def getaddrinfo(self, host, port, on_done, family: int = ..., socktype: int = ..., proto: int = ..., flags: int = ...): ... + def set_reader(self, fd, on_readable) -> None: ... + def remove_reader(self, fd): ... + def set_writer(self, fd, on_writable) -> None: ... + def remove_writer(self, fd): ... + +class _TimerHandle(nbio_interface.AbstractTimerReference): + def __init__(self, handle) -> None: ... + def cancel(self) -> None: ... + +class _AsyncioIOReference(nbio_interface.AbstractIOReference): + def __init__(self, future, on_done) -> None: ... + def cancel(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/adapters/base_connection.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/adapters/base_connection.pyi new file mode 100644 index 000000000..db129fa75 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/adapters/base_connection.pyi @@ -0,0 +1,36 @@ +import abc +from _typeshed import Incomplete +from collections.abc import Callable +from typing_extensions import Self + +from ..adapters.utils import nbio_interface +from ..connection import Connection + +LOGGER: Incomplete + +class BaseConnection(Connection, metaclass=abc.ABCMeta): + def __init__( + self, + parameters, + on_open_callback: Callable[[Self], object] | None, + on_open_error_callback: Callable[[Self, BaseException], object] | None, + on_close_callback: Callable[[Self, BaseException], object] | None, + nbio, + internal_connection_workflow: bool, + ) -> None: ... + @classmethod + @abc.abstractmethod + def create_connection( + cls, connection_configs, on_done, custom_ioloop: Incomplete | None = ..., workflow: Incomplete | None = ... + ): ... + @property + def ioloop(self): ... + +class _StreamingProtocolShim(nbio_interface.AbstractStreamProtocol): + connection_made: Incomplete + connection_lost: Incomplete + eof_received: Incomplete + data_received: Incomplete + conn: Incomplete + def __init__(self, conn) -> None: ... + def __getattr__(self, attr: str): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/adapters/blocking_connection.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/adapters/blocking_connection.pyi new file mode 100644 index 000000000..613c7ecde --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/adapters/blocking_connection.pyi @@ -0,0 +1,251 @@ +from _typeshed import Incomplete, Unused +from collections.abc import Generator, Sequence +from types import TracebackType +from typing import NamedTuple +from typing_extensions import Self + +from ..connection import Parameters +from ..data import _ArgumentMapping +from ..exchange_type import ExchangeType +from ..spec import BasicProperties + +LOGGER: Incomplete + +class _CallbackResult: + def __init__(self, value_class: Incomplete | None = ...) -> None: ... + def reset(self) -> None: ... + def __bool__(self) -> bool: ... + __nonzero__: Incomplete + def __enter__(self): ... + def __exit__(self, *args: Unused, **kwargs: Unused) -> None: ... + def is_ready(self): ... + @property + def ready(self): ... + def signal_once(self, *_args, **_kwargs) -> None: ... + def set_value_once(self, *args, **kwargs) -> None: ... + def append_element(self, *args, **kwargs) -> None: ... + @property + def value(self): ... + @property + def elements(self): ... + +class _IoloopTimerContext: + def __init__(self, duration, connection) -> None: ... + def __enter__(self): ... + def __exit__(self, *_args: Unused, **_kwargs: Unused) -> None: ... + def is_ready(self): ... + +class _TimerEvt: + timer_id: Incomplete + def __init__(self, callback) -> None: ... + def dispatch(self) -> None: ... + +class _ConnectionBlockedUnblockedEvtBase: + def __init__(self, callback, method_frame) -> None: ... + def dispatch(self) -> None: ... + +class _ConnectionBlockedEvt(_ConnectionBlockedUnblockedEvtBase): ... +class _ConnectionUnblockedEvt(_ConnectionBlockedUnblockedEvtBase): ... + +class BlockingConnection: + class _OnClosedArgs(NamedTuple): + connection: Incomplete + error: Incomplete + + class _OnChannelOpenedArgs(NamedTuple): + channel: Incomplete + def __init__( + self, parameters: Parameters | Sequence[Parameters] | None = ..., _impl_class: Incomplete | None = ... + ) -> None: ... + def __enter__(self) -> Self: ... + def __exit__( + self, exc_type: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None + ) -> None: ... + def add_on_connection_blocked_callback(self, callback) -> None: ... + def add_on_connection_unblocked_callback(self, callback) -> None: ... + def call_later(self, delay, callback): ... + def add_callback_threadsafe(self, callback) -> None: ... + def remove_timeout(self, timeout_id) -> None: ... + def update_secret(self, new_secret, reason) -> None: ... + def close(self, reply_code: int = ..., reply_text: str = ...) -> None: ... + def process_data_events(self, time_limit: int = ...): ... + def sleep(self, duration: float) -> None: ... + def channel(self, channel_number: int | None = ...) -> BlockingChannel: ... + @property + def is_closed(self) -> bool: ... + @property + def is_open(self) -> bool: ... + @property + def basic_nack_supported(self) -> bool: ... + @property + def consumer_cancel_notify_supported(self) -> bool: ... + @property + def exchange_exchange_bindings_supported(self) -> bool: ... + @property + def publisher_confirms_supported(self) -> bool: ... + basic_nack = basic_nack_supported + consumer_cancel_notify = consumer_cancel_notify_supported + exchange_exchange_bindings = exchange_exchange_bindings_supported + publisher_confirms = publisher_confirms_supported + +class _ChannelPendingEvt: ... + +class _ConsumerDeliveryEvt(_ChannelPendingEvt): + method: Incomplete + properties: Incomplete + body: Incomplete + def __init__(self, method, properties, body) -> None: ... + +class _ConsumerCancellationEvt(_ChannelPendingEvt): + method_frame: Incomplete + def __init__(self, method_frame) -> None: ... + @property + def method(self): ... + +class _ReturnedMessageEvt(_ChannelPendingEvt): + callback: Incomplete + channel: Incomplete + method: Incomplete + properties: Incomplete + body: Incomplete + def __init__(self, callback, channel, method, properties, body) -> None: ... + def dispatch(self) -> None: ... + +class ReturnedMessage: + method: Incomplete + properties: Incomplete + body: Incomplete + def __init__(self, method, properties, body) -> None: ... + +class _ConsumerInfo: + SETTING_UP: int + ACTIVE: int + TEARING_DOWN: int + CANCELLED_BY_BROKER: int + consumer_tag: Incomplete + auto_ack: Incomplete + on_message_callback: Incomplete + alternate_event_sink: Incomplete + state: Incomplete + def __init__( + self, consumer_tag, auto_ack, on_message_callback: Incomplete | None = ..., alternate_event_sink: Incomplete | None = ... + ) -> None: ... + @property + def setting_up(self): ... + @property + def active(self): ... + @property + def tearing_down(self): ... + @property + def cancelled_by_broker(self): ... + +class _QueueConsumerGeneratorInfo: + params: Incomplete + consumer_tag: Incomplete + pending_events: Incomplete + def __init__(self, params, consumer_tag) -> None: ... + +class BlockingChannel: + class _RxMessageArgs(NamedTuple): + channel: Incomplete + method: Incomplete + properties: Incomplete + body: Incomplete + + class _MethodFrameCallbackResultArgs(NamedTuple): + method_frame: Incomplete + + class _OnMessageConfirmationReportArgs(NamedTuple): + method_frame: Incomplete + + class _FlowOkCallbackResultArgs(NamedTuple): + active: Incomplete + def __init__(self, channel_impl, connection) -> None: ... + def __int__(self) -> int: ... + def __enter__(self): ... + def __exit__( + self, exc_type: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None + ) -> None: ... + @property + def channel_number(self): ... + @property + def connection(self): ... + @property + def is_closed(self): ... + @property + def is_open(self): ... + @property + def consumer_tags(self): ... + def close(self, reply_code: int = ..., reply_text: str = ...): ... + def flow(self, active): ... + def add_on_cancel_callback(self, callback) -> None: ... + def add_on_return_callback(self, callback): ... + def basic_consume( + self, + queue, + on_message_callback, + auto_ack: bool = ..., + exclusive: bool = ..., + consumer_tag: Incomplete | None = ..., + arguments: Incomplete | None = ..., + ): ... + def basic_cancel(self, consumer_tag): ... + def start_consuming(self) -> None: ... + def stop_consuming(self, consumer_tag: Incomplete | None = ...) -> None: ... + def consume( + self, + queue, + auto_ack: bool = ..., + exclusive: bool = ..., + arguments: Incomplete | None = ..., + inactivity_timeout: Incomplete | None = ..., + ) -> Generator[Incomplete, None, None]: ... + def get_waiting_message_count(self): ... + def cancel(self): ... + def basic_ack(self, delivery_tag: int = ..., multiple: bool = ...) -> None: ... + def basic_nack(self, delivery_tag: int = ..., multiple: bool = ..., requeue: bool = ...) -> None: ... + def basic_get(self, queue, auto_ack: bool = ...): ... + def basic_publish( + self, exchange: str, routing_key: str, body: str | bytes, properties: BasicProperties | None = ..., mandatory: bool = ... + ) -> None: ... + def basic_qos(self, prefetch_size: int = ..., prefetch_count: int = ..., global_qos: bool = ...) -> None: ... + def basic_recover(self, requeue: bool = ...) -> None: ... + def basic_reject(self, delivery_tag: int = ..., requeue: bool = ...) -> None: ... + def confirm_delivery(self) -> None: ... + def exchange_declare( + self, + exchange: str, + exchange_type: ExchangeType | str = ..., + passive: bool = ..., + durable: bool = ..., + auto_delete: bool = ..., + internal: bool = ..., + arguments: _ArgumentMapping | None = ..., + ): ... + def exchange_delete(self, exchange: str | None = ..., if_unused: bool = ...): ... + def exchange_bind(self, destination, source, routing_key: str = ..., arguments: Incomplete | None = ...): ... + def exchange_unbind( + self, + destination: Incomplete | None = ..., + source: Incomplete | None = ..., + routing_key: str = ..., + arguments: Incomplete | None = ..., + ): ... + def queue_declare( + self, + queue, + passive: bool = ..., + durable: bool = ..., + exclusive: bool = ..., + auto_delete: bool = ..., + arguments: Incomplete | None = ..., + ): ... + def queue_delete(self, queue, if_unused: bool = ..., if_empty: bool = ...): ... + def queue_purge(self, queue): ... + def queue_bind(self, queue, exchange, routing_key: Incomplete | None = ..., arguments: Incomplete | None = ...): ... + def queue_unbind( + self, queue, exchange: Incomplete | None = ..., routing_key: Incomplete | None = ..., arguments: Incomplete | None = ... + ): ... + def tx_select(self): ... + def tx_commit(self): ... + def tx_rollback(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/adapters/gevent_connection.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/adapters/gevent_connection.pyi new file mode 100644 index 000000000..932bc328f --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/adapters/gevent_connection.pyi @@ -0,0 +1,56 @@ +from _typeshed import Incomplete + +from pika.adapters.base_connection import BaseConnection +from pika.adapters.utils.nbio_interface import AbstractIOReference +from pika.adapters.utils.selector_ioloop_adapter import AbstractSelectorIOLoop, SelectorIOServicesAdapter + +LOGGER: Incomplete + +class GeventConnection(BaseConnection): + def __init__( + self, + parameters: Incomplete | None = ..., + on_open_callback: Incomplete | None = ..., + on_open_error_callback: Incomplete | None = ..., + on_close_callback: Incomplete | None = ..., + custom_ioloop: Incomplete | None = ..., + internal_connection_workflow: bool = ..., + ) -> None: ... + @classmethod + def create_connection( + cls, connection_configs, on_done, custom_ioloop: Incomplete | None = ..., workflow: Incomplete | None = ... + ): ... + +class _TSafeCallbackQueue: + def __init__(self) -> None: ... + @property + def fd(self): ... + def add_callback_threadsafe(self, callback) -> None: ... + def run_next_callback(self) -> None: ... + +class _GeventSelectorIOLoop(AbstractSelectorIOLoop): + READ: int + WRITE: int + ERROR: int + def __init__(self, gevent_hub: Incomplete | None = ...) -> None: ... + def close(self) -> None: ... + def start(self) -> None: ... + def stop(self) -> None: ... + def add_callback(self, callback) -> None: ... + def call_later(self, delay, callback): ... + def remove_timeout(self, timeout_handle) -> None: ... + def add_handler(self, fd, handler, events) -> None: ... + def update_handler(self, fd, events) -> None: ... + def remove_handler(self, fd) -> None: ... + +class _GeventSelectorIOServicesAdapter(SelectorIOServicesAdapter): + def getaddrinfo(self, host, port, on_done, family: int = ..., socktype: int = ..., proto: int = ..., flags: int = ...): ... + +class _GeventIOLoopIOHandle(AbstractIOReference): + def __init__(self, subject) -> None: ... + def cancel(self): ... + +class _GeventAddressResolver: + def __init__(self, native_loop, host, port, family, socktype, proto, flags, on_done) -> None: ... + def start(self) -> None: ... + def cancel(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/adapters/select_connection.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/adapters/select_connection.pyi new file mode 100644 index 000000000..1a094f50f --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/adapters/select_connection.pyi @@ -0,0 +1,99 @@ +import abc +from _typeshed import Incomplete + +import pika.compat +from pika.adapters.base_connection import BaseConnection +from pika.adapters.utils.selector_ioloop_adapter import AbstractSelectorIOLoop + +LOGGER: Incomplete +SELECT_TYPE: Incomplete + +class SelectConnection(BaseConnection): + def __init__( + self, + parameters: Incomplete | None = ..., + on_open_callback: Incomplete | None = ..., + on_open_error_callback: Incomplete | None = ..., + on_close_callback: Incomplete | None = ..., + custom_ioloop: Incomplete | None = ..., + internal_connection_workflow: bool = ..., + ) -> None: ... + @classmethod + def create_connection( + cls, connection_configs, on_done, custom_ioloop: Incomplete | None = ..., workflow: Incomplete | None = ... + ): ... + +class _Timeout: + deadline: Incomplete + callback: Incomplete + def __init__(self, deadline, callback) -> None: ... + def __eq__(self, other): ... + def __ne__(self, other): ... + def __lt__(self, other): ... + def __gt__(self, other): ... + def __le__(self, other): ... + def __ge__(self, other): ... + +class _Timer: + def __init__(self) -> None: ... + def close(self) -> None: ... + def call_later(self, delay, callback): ... + def remove_timeout(self, timeout) -> None: ... + def get_remaining_interval(self): ... + def process_timeouts(self) -> None: ... + +class PollEvents: + READ: Incomplete + WRITE: Incomplete + ERROR: Incomplete + +class IOLoop(AbstractSelectorIOLoop): + READ: Incomplete + WRITE: Incomplete + ERROR: Incomplete + def __init__(self) -> None: ... + def close(self) -> None: ... + def call_later(self, delay, callback): ... + def remove_timeout(self, timeout_handle) -> None: ... + def add_callback_threadsafe(self, callback) -> None: ... + add_callback: Incomplete + def process_timeouts(self) -> None: ... + def add_handler(self, fd, handler, events) -> None: ... + def update_handler(self, fd, events) -> None: ... + def remove_handler(self, fd) -> None: ... + def start(self) -> None: ... + def stop(self) -> None: ... + def activate_poller(self) -> None: ... + def deactivate_poller(self) -> None: ... + def poll(self) -> None: ... + +class _PollerBase(pika.compat.AbstractBase, metaclass=abc.ABCMeta): + POLL_TIMEOUT_MULT: int + def __init__(self, get_wait_seconds, process_timeouts) -> None: ... + def close(self) -> None: ... + def wake_threadsafe(self) -> None: ... + def add_handler(self, fileno, handler, events) -> None: ... + def update_handler(self, fileno, events) -> None: ... + def remove_handler(self, fileno) -> None: ... + def activate_poller(self) -> None: ... + def deactivate_poller(self) -> None: ... + def start(self) -> None: ... + def stop(self) -> None: ... + @abc.abstractmethod + def poll(self): ... + +class SelectPoller(_PollerBase): + POLL_TIMEOUT_MULT: int + def poll(self) -> None: ... + +class KQueuePoller(_PollerBase): + def __init__(self, get_wait_seconds, process_timeouts) -> None: ... + def poll(self) -> None: ... + +class PollPoller(_PollerBase): + POLL_TIMEOUT_MULT: int + def __init__(self, get_wait_seconds, process_timeouts) -> None: ... + def poll(self) -> None: ... + +class EPollPoller(PollPoller): + POLL_TIMEOUT_MULT: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/adapters/tornado_connection.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/adapters/tornado_connection.pyi new file mode 100644 index 000000000..0e46bdf3a --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/adapters/tornado_connection.pyi @@ -0,0 +1,20 @@ +from _typeshed import Incomplete + +from pika.adapters import base_connection + +LOGGER: Incomplete + +class TornadoConnection(base_connection.BaseConnection): + def __init__( + self, + parameters: Incomplete | None = ..., + on_open_callback: Incomplete | None = ..., + on_open_error_callback: Incomplete | None = ..., + on_close_callback: Incomplete | None = ..., + custom_ioloop: Incomplete | None = ..., + internal_connection_workflow: bool = ..., + ) -> None: ... + @classmethod + def create_connection( + cls, connection_configs, on_done, custom_ioloop: Incomplete | None = ..., workflow: Incomplete | None = ... + ): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/adapters/twisted_connection.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/adapters/twisted_connection.pyi new file mode 100644 index 000000000..aea7a297f --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/adapters/twisted_connection.pyi @@ -0,0 +1,127 @@ +from _typeshed import Incomplete +from typing import Any, NamedTuple +from typing_extensions import TypeAlias + +import pika.connection +from pika.adapters.utils import nbio_interface + +_DeferredQueue: TypeAlias = Any # TODO: twisted.internet.defer.DeferredQueue +_Protocol: TypeAlias = Any # TODO: twisted.internet.protocol.Protocol + +LOGGER: Incomplete + +class ClosableDeferredQueue(_DeferredQueue): + closed: Incomplete + def __init__(self, size: Incomplete | None = ..., backlog: Incomplete | None = ...) -> None: ... + def put(self, obj): ... + def get(self): ... + pending: Incomplete + def close(self, reason) -> None: ... + +class ReceivedMessage(NamedTuple): + channel: Incomplete + method: Incomplete + properties: Incomplete + body: Incomplete + +class TwistedChannel: + on_closed: Incomplete + def __init__(self, channel) -> None: ... + @property + def channel_number(self): ... + @property + def connection(self): ... + @property + def is_closed(self): ... + @property + def is_closing(self): ... + @property + def is_open(self): ... + @property + def flow_active(self): ... + @property + def consumer_tags(self): ... + def callback_deferred(self, deferred, replies) -> None: ... + def add_on_return_callback(self, callback): ... + def basic_ack(self, delivery_tag: int = ..., multiple: bool = ...): ... + def basic_cancel(self, consumer_tag: str = ...): ... + def basic_consume( + self, + queue, + auto_ack: bool = ..., + exclusive: bool = ..., + consumer_tag: Incomplete | None = ..., + arguments: Incomplete | None = ..., + ): ... + def basic_get(self, queue, auto_ack: bool = ...): ... + def basic_nack(self, delivery_tag: Incomplete | None = ..., multiple: bool = ..., requeue: bool = ...): ... + def basic_publish(self, exchange, routing_key, body, properties: Incomplete | None = ..., mandatory: bool = ...): ... + def basic_qos(self, prefetch_size: int = ..., prefetch_count: int = ..., global_qos: bool = ...): ... + def basic_reject(self, delivery_tag, requeue: bool = ...): ... + def basic_recover(self, requeue: bool = ...): ... + def close(self, reply_code: int = ..., reply_text: str = ...): ... + def confirm_delivery(self): ... + def exchange_bind(self, destination, source, routing_key: str = ..., arguments: Incomplete | None = ...): ... + def exchange_declare( + self, + exchange, + exchange_type=..., + passive: bool = ..., + durable: bool = ..., + auto_delete: bool = ..., + internal: bool = ..., + arguments: Incomplete | None = ..., + ): ... + def exchange_delete(self, exchange: Incomplete | None = ..., if_unused: bool = ...): ... + def exchange_unbind( + self, + destination: Incomplete | None = ..., + source: Incomplete | None = ..., + routing_key: str = ..., + arguments: Incomplete | None = ..., + ): ... + def flow(self, active): ... + def open(self): ... + def queue_bind(self, queue, exchange, routing_key: Incomplete | None = ..., arguments: Incomplete | None = ...): ... + def queue_declare( + self, + queue, + passive: bool = ..., + durable: bool = ..., + exclusive: bool = ..., + auto_delete: bool = ..., + arguments: Incomplete | None = ..., + ): ... + def queue_delete(self, queue, if_unused: bool = ..., if_empty: bool = ...): ... + def queue_purge(self, queue): ... + def queue_unbind( + self, queue, exchange: Incomplete | None = ..., routing_key: Incomplete | None = ..., arguments: Incomplete | None = ... + ): ... + def tx_commit(self): ... + def tx_rollback(self): ... + def tx_select(self): ... + +class _TwistedConnectionAdapter(pika.connection.Connection): + def __init__(self, parameters, on_open_callback, on_open_error_callback, on_close_callback, custom_reactor) -> None: ... + def connection_made(self, transport) -> None: ... + def connection_lost(self, error) -> None: ... + def data_received(self, data) -> None: ... + +class TwistedProtocolConnection(_Protocol): + ready: Incomplete + closed: Incomplete + def __init__(self, parameters: Incomplete | None = ..., custom_reactor: Incomplete | None = ...) -> None: ... + def channel(self, channel_number: Incomplete | None = ...): ... + @property + def is_open(self): ... + @property + def is_closed(self): ... + def close(self, reply_code: int = ..., reply_text: str = ...): ... + def dataReceived(self, data) -> None: ... + def connectionLost(self, reason=...) -> None: ... + def makeConnection(self, transport) -> None: ... + def connectionReady(self): ... + +class _TimerHandle(nbio_interface.AbstractTimerReference): + def __init__(self, handle) -> None: ... + def cancel(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/edge/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/adapters/utils/__init__.pyi similarity index 100% rename from packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/edge/__init__.pyi rename to packages/pyright-internal/typeshed-fallback/stubs/pika/pika/adapters/utils/__init__.pyi diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/adapters/utils/connection_workflow.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/adapters/utils/connection_workflow.pyi new file mode 100644 index 000000000..e68104c88 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/adapters/utils/connection_workflow.pyi @@ -0,0 +1,37 @@ +from _typeshed import Incomplete + +import pika.compat + +class AMQPConnectorException(Exception): ... +class AMQPConnectorStackTimeout(AMQPConnectorException): ... +class AMQPConnectorAborted(AMQPConnectorException): ... +class AMQPConnectorWrongState(AMQPConnectorException): ... + +class AMQPConnectorPhaseErrorBase(AMQPConnectorException): + exception: Incomplete + def __init__(self, exception, *args) -> None: ... + +class AMQPConnectorSocketConnectError(AMQPConnectorPhaseErrorBase): ... +class AMQPConnectorTransportSetupError(AMQPConnectorPhaseErrorBase): ... +class AMQPConnectorAMQPHandshakeError(AMQPConnectorPhaseErrorBase): ... +class AMQPConnectionWorkflowAborted(AMQPConnectorException): ... +class AMQPConnectionWorkflowWrongState(AMQPConnectorException): ... + +class AMQPConnectionWorkflowFailed(AMQPConnectorException): + exceptions: Incomplete + def __init__(self, exceptions, *args) -> None: ... + +class AMQPConnector: + def __init__(self, conn_factory, nbio) -> None: ... + def start(self, addr_record, conn_params, on_done) -> None: ... + def abort(self) -> None: ... + +class AbstractAMQPConnectionWorkflow(pika.compat.AbstractBase): + def start(self, connection_configs, connector_factory, native_loop, on_done) -> None: ... + def abort(self) -> None: ... + +class AMQPConnectionWorkflow(AbstractAMQPConnectionWorkflow): + def __init__(self, _until_first_amqp_attempt: bool = ...) -> None: ... + def set_io_services(self, nbio) -> None: ... + def start(self, connection_configs, connector_factory, native_loop, on_done) -> None: ... + def abort(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/adapters/utils/io_services_utils.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/adapters/utils/io_services_utils.pyi new file mode 100644 index 000000000..81f8ddc63 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/adapters/utils/io_services_utils.pyi @@ -0,0 +1,46 @@ +import abc +from _typeshed import Incomplete + +from pika.adapters.utils.nbio_interface import AbstractIOReference, AbstractStreamTransport + +def check_callback_arg(callback, name) -> None: ... +def check_fd_arg(fd) -> None: ... + +class SocketConnectionMixin: + def connect_socket(self, sock, resolved_addr, on_done): ... + +class StreamingConnectionMixin: + def create_streaming_connection( + self, protocol_factory, sock, on_done, ssl_context: Incomplete | None = ..., server_hostname: Incomplete | None = ... + ): ... + +class _AsyncServiceAsyncHandle(AbstractIOReference): + def __init__(self, subject) -> None: ... + def cancel(self): ... + +class _AsyncSocketConnector: + def __init__(self, nbio, sock, resolved_addr, on_done) -> None: ... + def start(self): ... + def cancel(self): ... + +class _AsyncStreamConnector: + def __init__(self, nbio, protocol_factory, sock, ssl_context, server_hostname, on_done) -> None: ... + def start(self): ... + def cancel(self): ... + +class _AsyncTransportBase(AbstractStreamTransport, metaclass=abc.ABCMeta): + class RxEndOfFile(OSError): + def __init__(self) -> None: ... + + def __init__(self, sock, protocol, nbio) -> None: ... + def abort(self) -> None: ... + def get_protocol(self): ... + def get_write_buffer_size(self): ... + +class _AsyncPlaintextTransport(_AsyncTransportBase): + def __init__(self, sock, protocol, nbio) -> None: ... + def write(self, data) -> None: ... + +class _AsyncSSLTransport(_AsyncTransportBase): + def __init__(self, sock, protocol, nbio) -> None: ... + def write(self, data) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/adapters/utils/nbio_interface.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/adapters/utils/nbio_interface.pyi new file mode 100644 index 000000000..450da2c50 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/adapters/utils/nbio_interface.pyi @@ -0,0 +1,64 @@ +import abc +from _typeshed import Incomplete + +import pika.compat + +class AbstractIOServices(pika.compat.AbstractBase, metaclass=abc.ABCMeta): + @abc.abstractmethod + def get_native_ioloop(self): ... + @abc.abstractmethod + def close(self): ... + @abc.abstractmethod + def run(self): ... + @abc.abstractmethod + def stop(self): ... + @abc.abstractmethod + def add_callback_threadsafe(self, callback): ... + @abc.abstractmethod + def call_later(self, delay, callback): ... + @abc.abstractmethod + def getaddrinfo(self, host, port, on_done, family: int = ..., socktype: int = ..., proto: int = ..., flags: int = ...): ... + @abc.abstractmethod + def connect_socket(self, sock, resolved_addr, on_done): ... + @abc.abstractmethod + def create_streaming_connection( + self, protocol_factory, sock, on_done, ssl_context: Incomplete | None = ..., server_hostname: Incomplete | None = ... + ): ... + +class AbstractFileDescriptorServices(pika.compat.AbstractBase, metaclass=abc.ABCMeta): + @abc.abstractmethod + def set_reader(self, fd, on_readable): ... + @abc.abstractmethod + def remove_reader(self, fd): ... + @abc.abstractmethod + def set_writer(self, fd, on_writable): ... + @abc.abstractmethod + def remove_writer(self, fd): ... + +class AbstractTimerReference(pika.compat.AbstractBase, metaclass=abc.ABCMeta): + @abc.abstractmethod + def cancel(self): ... + +class AbstractIOReference(pika.compat.AbstractBase, metaclass=abc.ABCMeta): + @abc.abstractmethod + def cancel(self): ... + +class AbstractStreamProtocol(pika.compat.AbstractBase, metaclass=abc.ABCMeta): + @abc.abstractmethod + def connection_made(self, transport): ... + @abc.abstractmethod + def connection_lost(self, error): ... + @abc.abstractmethod + def eof_received(self): ... + @abc.abstractmethod + def data_received(self, data): ... + +class AbstractStreamTransport(pika.compat.AbstractBase, metaclass=abc.ABCMeta): + @abc.abstractmethod + def abort(self): ... + @abc.abstractmethod + def get_protocol(self): ... + @abc.abstractmethod + def write(self, data): ... + @abc.abstractmethod + def get_write_buffer_size(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/adapters/utils/selector_ioloop_adapter.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/adapters/utils/selector_ioloop_adapter.pyi new file mode 100644 index 000000000..3358c4df6 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/adapters/utils/selector_ioloop_adapter.pyi @@ -0,0 +1,76 @@ +import abc +from _typeshed import Incomplete + +from pika.adapters.utils import io_services_utils, nbio_interface + +LOGGER: Incomplete + +class AbstractSelectorIOLoop(metaclass=abc.ABCMeta): + @property + @abc.abstractmethod + def READ(self): ... + @property + @abc.abstractmethod + def WRITE(self): ... + @property + @abc.abstractmethod + def ERROR(self): ... + @abc.abstractmethod + def close(self): ... + @abc.abstractmethod + def start(self): ... + @abc.abstractmethod + def stop(self): ... + @abc.abstractmethod + def call_later(self, delay, callback): ... + @abc.abstractmethod + def remove_timeout(self, timeout_handle): ... + @abc.abstractmethod + def add_callback(self, callback): ... + @abc.abstractmethod + def add_handler(self, fd, handler, events): ... + @abc.abstractmethod + def update_handler(self, fd, events): ... + @abc.abstractmethod + def remove_handler(self, fd): ... + +class SelectorIOServicesAdapter( + io_services_utils.SocketConnectionMixin, + io_services_utils.StreamingConnectionMixin, + nbio_interface.AbstractIOServices, + nbio_interface.AbstractFileDescriptorServices, +): + def __init__(self, native_loop) -> None: ... + def get_native_ioloop(self): ... + def close(self) -> None: ... + def run(self) -> None: ... + def stop(self) -> None: ... + def add_callback_threadsafe(self, callback) -> None: ... + def call_later(self, delay, callback): ... + def getaddrinfo(self, host, port, on_done, family: int = ..., socktype: int = ..., proto: int = ..., flags: int = ...): ... + def set_reader(self, fd, on_readable) -> None: ... + def remove_reader(self, fd): ... + def set_writer(self, fd, on_writable) -> None: ... + def remove_writer(self, fd): ... + +class _FileDescriptorCallbacks: + reader: Incomplete + writer: Incomplete + def __init__(self, reader: Incomplete | None = ..., writer: Incomplete | None = ...) -> None: ... + +class _TimerHandle(nbio_interface.AbstractTimerReference): + def __init__(self, handle, loop) -> None: ... + def cancel(self) -> None: ... + +class _SelectorIOLoopIOHandle(nbio_interface.AbstractIOReference): + def __init__(self, subject) -> None: ... + def cancel(self): ... + +class _AddressResolver: + NOT_STARTED: int + ACTIVE: int + CANCELED: int + COMPLETED: int + def __init__(self, native_loop, host, port, family, socktype, proto, flags, on_done) -> None: ... + def start(self): ... + def cancel(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/amqp_object.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/amqp_object.pyi new file mode 100644 index 000000000..7236b7a08 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/amqp_object.pyi @@ -0,0 +1,18 @@ +from typing import ClassVar + +class AMQPObject: + NAME: ClassVar[str] + INDEX: ClassVar[int | None] + def __eq__(self, other: AMQPObject | None) -> bool: ... # type: ignore[override] + +class Class(AMQPObject): ... + +class Method(AMQPObject): + # This is a class attribute in the implementation, but subclasses use @property, + # so it's more convenient to use that here as well. + @property + def synchronous(self) -> bool: ... + def get_properties(self) -> Properties: ... + def get_body(self) -> str: ... + +class Properties(AMQPObject): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/callback.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/callback.pyi new file mode 100644 index 000000000..593ad4b27 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/callback.pyi @@ -0,0 +1,31 @@ +from _typeshed import Incomplete + +LOGGER: Incomplete + +def name_or_value(value): ... +def sanitize_prefix(function): ... +def check_for_prefix_and_key(function): ... + +class CallbackManager: + CALLS: str + ARGUMENTS: str + DUPLICATE_WARNING: str + CALLBACK: str + ONE_SHOT: str + ONLY_CALLER: str + def __init__(self) -> None: ... + def add( + self, + prefix, + key, + callback, + one_shot: bool = ..., + only_caller: Incomplete | None = ..., + arguments: Incomplete | None = ..., + ): ... + def clear(self) -> None: ... + def cleanup(self, prefix): ... + def pending(self, prefix, key): ... + def process(self, prefix, key, caller, *args, **keywords): ... + def remove(self, prefix, key, callback_value: Incomplete | None = ..., arguments: Incomplete | None = ...): ... + def remove_all(self, prefix, key) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/channel.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/channel.pyi new file mode 100644 index 000000000..3f28e847c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/channel.pyi @@ -0,0 +1,156 @@ +from _typeshed import Incomplete +from collections.abc import Callable +from logging import Logger +from typing import Any +from typing_extensions import Final, Self + +from .callback import CallbackManager +from .connection import Connection +from .data import _ArgumentMapping +from .exchange_type import ExchangeType +from .frame import Body, Header, Method +from .spec import Basic, BasicProperties, Confirm, Exchange, Queue, Tx + +LOGGER: Logger +MAX_CHANNELS: Final[int] + +class Channel: + CLOSED: Final = 0 + OPENING: Final = 1 + OPEN: Final = 2 + CLOSING: Final = 3 + + channel_number: int + callbacks: CallbackManager + connection: Connection + flow_active: bool + + def __init__(self, connection: Connection, channel_number: int, on_open_callback: Callable[[Self], object]) -> None: ... + def __int__(self) -> int: ... + def add_callback(self, callback, replies, one_shot: bool = ...) -> None: ... + def add_on_cancel_callback(self, callback) -> None: ... + def add_on_close_callback(self, callback) -> None: ... + def add_on_flow_callback(self, callback) -> None: ... + def add_on_return_callback(self, callback) -> None: ... + def basic_ack(self, delivery_tag: int = ..., multiple: bool = ...) -> None: ... + def basic_cancel( + self, consumer_tag: str = ..., callback: Callable[[Method[Basic.CancelOk]], object] | None = ... + ) -> None: ... + def basic_consume( + self, + queue: str, + on_message_callback: Callable[[Channel, Basic.Deliver, BasicProperties, bytes], object], + auto_ack: bool = ..., + exclusive: bool = ..., + consumer_tag: str | None = ..., + arguments: _ArgumentMapping | None = ..., + callback: Callable[[Method[Basic.ConsumeOk]], object] | None = ..., + ) -> str: ... + def basic_get( + self, queue: str, callback: Callable[[Channel, Basic.GetOk, BasicProperties, bytes], object], auto_ack: bool = ... + ) -> None: ... + def basic_nack(self, delivery_tag: int = ..., multiple: bool = ..., requeue: bool = ...) -> None: ... + def basic_publish( + self, exchange: str, routing_key: str, body: str | bytes, properties: BasicProperties | None = ..., mandatory: bool = ... + ) -> None: ... + def basic_qos( + self, + prefetch_size: int = ..., + prefetch_count: int = ..., + global_qos: bool = ..., + callback: Callable[[Method[Basic.QosOk]], object] | None = ..., + ) -> None: ... + def basic_reject(self, delivery_tag: int = ..., requeue: bool = ...) -> None: ... + def basic_recover(self, requeue: bool = ..., callback: Callable[[Method[Basic.RecoverOk]], object] | None = ...) -> None: ... + def close(self, reply_code: int = ..., reply_text: str = ...) -> None: ... + def confirm_delivery( + self, + ack_nack_callback: Callable[[Method[Basic.Ack | Basic.Nack]], object], + callback: Callable[[Method[Confirm.SelectOk]], object] | None = ..., + ) -> None: ... + @property + def consumer_tags(self) -> list[str]: ... + def exchange_bind( + self, + destination: str, + source: str, + routing_key: str = ..., + arguments: _ArgumentMapping | None = ..., + callback: Callable[[Method[Exchange.BindOk]], object] | None = ..., + ) -> None: ... + def exchange_declare( + self, + exchange: str, + exchange_type: ExchangeType | str = ..., + passive: bool = ..., + durable: bool = ..., + auto_delete: bool = ..., + internal: bool = ..., + arguments: _ArgumentMapping | None = ..., + callback: Callable[[Method[Exchange.DeclareOk]], object] | None = ..., + ) -> None: ... + def exchange_delete( + self, + exchange: str | None = ..., + if_unused: bool = ..., + callback: Callable[[Method[Exchange.DeleteOk]], object] | None = ..., + ) -> None: ... + def exchange_unbind( + self, + destination: str | None = ..., + source: str | None = ..., + routing_key: str = ..., + arguments: _ArgumentMapping | None = ..., + callback: Callable[[Method[Exchange.UnbindOk]], object] | None = ..., + ) -> None: ... + def flow(self, active: bool, callback: Callable[[bool], object] | None = ...) -> None: ... + @property + def is_closed(self) -> bool: ... + @property + def is_closing(self) -> bool: ... + @property + def is_open(self) -> bool: ... + @property + def is_opening(self) -> bool: ... + def open(self) -> None: ... + def queue_bind( + self, + queue: str, + exchange: str, + routing_key: str | None = ..., + arguments: _ArgumentMapping | None = ..., + callback: Callable[[Method[Queue.BindOk]], object] | None = ..., + ) -> None: ... + def queue_declare( + self, + queue: str, + passive: bool = ..., + durable: bool = ..., + exclusive: bool = ..., + auto_delete: bool = ..., + arguments: _ArgumentMapping | None = ..., + callback: Callable[[Method[Queue.DeclareOk]], object] | None = ..., + ) -> None: ... + def queue_delete( + self, + queue: str, + if_unused: bool = ..., + if_empty: bool = ..., + callback: Callable[[Method[Queue.DeleteOk]], object] | None = ..., + ) -> None: ... + def queue_purge(self, queue: str, callback: Callable[[Method[Queue.PurgeOk]], object] | None = ...) -> None: ... + def queue_unbind( + self, + queue: str, + exchange: str | None = ..., + routing_key: str | None = ..., + arguments: _ArgumentMapping | None = ..., + callback: Callable[[Method[Queue.UnbindOk]], object] | None = ..., + ): ... + def tx_commit(self, callback: Callable[[Method[Tx.CommitOk]], object] | None = ...) -> None: ... + def tx_rollback(self, callback: Callable[[Method[Tx.RollbackOk]], object] | None = ...) -> None: ... + def tx_select(self, callback: Callable[[Method[Tx.SelectOk]], object] | None = ...) -> None: ... + +class ContentFrameAssembler: + def __init__(self) -> None: ... + def process(self, frame_value: Method[Any] | Header | Body) -> tuple[Incomplete, Incomplete, bytes] | None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/compat.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/compat.pyi new file mode 100644 index 000000000..de6dd8e9d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/compat.pyi @@ -0,0 +1,49 @@ +from abc import ABCMeta +from collections.abc import ItemsView, Mapping, ValuesView +from io import StringIO as StringIO +from re import Pattern +from typing import Any, TypeVar +from typing_extensions import Final, Literal, SupportsIndex, TypeGuard +from urllib.parse import parse_qs, quote, unquote, urlencode as urlencode, urlparse as urlparse + +_KT = TypeVar("_KT") +_VT_co = TypeVar("_VT_co", covariant=True) + +url_quote = quote +url_unquote = unquote +url_parse_qs = parse_qs + +PY2: Final[Literal[False]] +PY3: Final[Literal[True]] +RE_NUM: Final[Pattern[str]] +ON_LINUX: Final[bool] +ON_OSX: Final[bool] +ON_WINDOWS: Final[bool] + +class AbstractBase(metaclass=ABCMeta): ... + +SOCKET_ERROR = OSError +SOL_TCP: Final[int] +basestring: Final[tuple[type[str]]] +str_or_bytes: Final[tuple[type[str], type[bytes]]] +xrange = range +unicode_type = str + +def time_now() -> float: ... +def dictkeys(dct: Mapping[_KT, Any]) -> list[_KT]: ... +def dictvalues(dct: Mapping[Any, _VT_co]) -> list[_VT_co]: ... +def dict_iteritems(dct: Mapping[_KT, _VT_co]) -> ItemsView[_KT, _VT_co]: ... +def dict_itervalues(dct: Mapping[Any, _VT_co]) -> ValuesView[_VT_co]: ... +def byte(*args: SupportsIndex) -> bytes: ... + +class long(int): ... + +def canonical_str(value: object) -> str: ... +def is_integer(value: object) -> TypeGuard[int]: ... +def as_bytes(value: str | bytes) -> bytes: ... +def to_digit(value: str) -> int: ... +def get_linux_version(release_str: str) -> tuple[int, int, int]: ... + +HAVE_SIGNAL: Final[bool] +EINTR_IS_EXPOSED: Final[Literal[False]] +LINUX_VERSION: tuple[int, int, int] | None diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/connection.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/connection.pyi new file mode 100644 index 000000000..21024b427 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/connection.pyi @@ -0,0 +1,187 @@ +import abc +from _typeshed import Incomplete +from collections.abc import Callable +from logging import Logger +from typing_extensions import Final, Self + +from .callback import CallbackManager +from .channel import Channel +from .compat import AbstractBase +from .credentials import _Credentials +from .frame import Method +from .spec import Connection as SpecConnection + +PRODUCT: str +LOGGER: Logger + +class Parameters: + DEFAULT_USERNAME: str + DEFAULT_PASSWORD: str + DEFAULT_BLOCKED_CONNECTION_TIMEOUT: Incomplete + DEFAULT_CHANNEL_MAX: Incomplete + DEFAULT_CLIENT_PROPERTIES: Incomplete + DEFAULT_CREDENTIALS: Incomplete + DEFAULT_CONNECTION_ATTEMPTS: int + DEFAULT_FRAME_MAX: Incomplete + DEFAULT_HEARTBEAT_TIMEOUT: Incomplete + DEFAULT_HOST: str + DEFAULT_LOCALE: str + DEFAULT_PORT: int + DEFAULT_RETRY_DELAY: float + DEFAULT_SOCKET_TIMEOUT: float + DEFAULT_STACK_TIMEOUT: float + DEFAULT_SSL: bool + DEFAULT_SSL_OPTIONS: Incomplete + DEFAULT_SSL_PORT: int + DEFAULT_VIRTUAL_HOST: str + DEFAULT_TCP_OPTIONS: Incomplete + def __init__(self) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __ne__(self, other: object) -> bool: ... + @property + def blocked_connection_timeout(self) -> float | None: ... + @blocked_connection_timeout.setter + def blocked_connection_timeout(self, value: float | None) -> None: ... + @property + def channel_max(self) -> int: ... + @channel_max.setter + def channel_max(self, value: int) -> None: ... + @property + def client_properties(self) -> dict[Incomplete, Incomplete] | None: ... + @client_properties.setter + def client_properties(self, value: dict[Incomplete, Incomplete] | None) -> None: ... + @property + def connection_attempts(self) -> int: ... + @connection_attempts.setter + def connection_attempts(self, value: int) -> None: ... + @property + def credentials(self) -> _Credentials: ... + @credentials.setter + def credentials(self, value: _Credentials) -> None: ... + @property + def frame_max(self) -> int: ... + @frame_max.setter + def frame_max(self, value: int) -> None: ... + @property + def heartbeat(self) -> int | Callable[[Connection, int], int] | None: ... + @heartbeat.setter + def heartbeat(self, value: int | Callable[[Connection, int], int] | None) -> None: ... + @property + def host(self) -> str: ... + @host.setter + def host(self, value: str) -> None: ... + @property + def locale(self) -> str: ... + @locale.setter + def locale(self, value: str) -> None: ... + @property + def port(self) -> int: ... + @port.setter + def port(self, value: int | str) -> None: ... + @property + def retry_delay(self) -> int | float: ... + @retry_delay.setter + def retry_delay(self, value: float) -> None: ... + @property + def socket_timeout(self) -> float | None: ... + @socket_timeout.setter + def socket_timeout(self, value: float | None) -> None: ... + @property + def stack_timeout(self) -> float | None: ... + @stack_timeout.setter + def stack_timeout(self, value: float | None) -> None: ... + @property + def ssl_options(self) -> SSLOptions | None: ... + @ssl_options.setter + def ssl_options(self, value: SSLOptions | None) -> None: ... + @property + def virtual_host(self) -> str: ... + @virtual_host.setter + def virtual_host(self, value: str) -> None: ... + @property + def tcp_options(self) -> dict[Incomplete, Incomplete] | None: ... + @tcp_options.setter + def tcp_options(self, value: dict[Incomplete, Incomplete] | None) -> None: ... + +class ConnectionParameters(Parameters): + def __init__( + self, + host: str = ..., + port: int | str = ..., + virtual_host: str = ..., + credentials: _Credentials = ..., + channel_max: int = ..., + frame_max: int = ..., + heartbeat: int | Callable[[Connection, int], int] | None = ..., + ssl_options: SSLOptions | None = ..., + connection_attempts: int = ..., + retry_delay: float = ..., + socket_timeout: float | None = ..., + stack_timeout: float | None = ..., + locale: str = ..., + blocked_connection_timeout: float | None = ..., + client_properties: dict[Incomplete, Incomplete] | None = ..., + tcp_options: dict[Incomplete, Incomplete] | None = ..., + ) -> None: ... + +class URLParameters(Parameters): + def __init__(self, url: str) -> None: ... + +class SSLOptions: + context: Incomplete + server_hostname: Incomplete + def __init__(self, context, server_hostname: Incomplete | None = ...) -> None: ... + +class Connection(AbstractBase, metaclass=abc.ABCMeta): + ON_CONNECTION_CLOSED: Final[str] + ON_CONNECTION_ERROR: Final[str] + ON_CONNECTION_OPEN_OK: Final[str] + CONNECTION_CLOSED: Final[int] + CONNECTION_INIT: Final[int] + CONNECTION_PROTOCOL: Final[int] + CONNECTION_START: Final[int] + CONNECTION_TUNE: Final[int] + CONNECTION_OPEN: Final[int] + CONNECTION_CLOSING: Final[int] + connection_state: int # one of the constants above + params: Parameters + callbacks: CallbackManager + server_capabilities: Incomplete + server_properties: Incomplete + known_hosts: Incomplete + def __init__( + self, + parameters: Parameters | None = ..., + on_open_callback: Callable[[Self], object] | None = ..., + on_open_error_callback: Callable[[Self, BaseException], object] | None = ..., + on_close_callback: Callable[[Self, BaseException], object] | None = ..., + internal_connection_workflow: bool = ..., + ) -> None: ... + def add_on_close_callback(self, callback: Callable[[Self, BaseException], object]) -> None: ... + def add_on_connection_blocked_callback(self, callback: Callable[[Self, Method[SpecConnection.Blocked]], object]) -> None: ... + def add_on_connection_unblocked_callback( + self, callback: Callable[[Self, Method[SpecConnection.Unblocked]], object] + ) -> None: ... + def add_on_open_callback(self, callback: Callable[[Self], object]) -> None: ... + def add_on_open_error_callback( + self, callback: Callable[[Self, BaseException], object], remove_default: bool = ... + ) -> None: ... + def channel( + self, channel_number: int | None = ..., on_open_callback: Callable[[Channel], object] | None = ... + ) -> Channel: ... + def update_secret(self, new_secret, reason, callback: Incomplete | None = ...) -> None: ... + def close(self, reply_code: int = ..., reply_text: str = ...) -> None: ... + @property + def is_closed(self) -> bool: ... + @property + def is_closing(self) -> bool: ... + @property + def is_open(self) -> bool: ... + @property + def basic_nack(self) -> bool: ... + @property + def consumer_cancel_notify(self) -> bool: ... + @property + def exchange_exchange_bindings(self) -> bool: ... + @property + def publisher_confirms(self) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/credentials.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/credentials.pyi new file mode 100644 index 000000000..b813f7c99 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/credentials.pyi @@ -0,0 +1,33 @@ +from _typeshed import Incomplete +from logging import Logger +from typing import ClassVar +from typing_extensions import TypeAlias + +from .spec import Connection + +# TODO: This could be turned into a protocol. +_Credentials: TypeAlias = Incomplete # noqa: Y047 + +LOGGER: Logger + +class PlainCredentials: + TYPE: ClassVar[str] + username: str + password: str + erase_on_connect: bool + def __init__(self, username: str, password: str, erase_on_connect: bool = ...) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __ne__(self, other: object) -> bool: ... + def response_for(self, start: Connection.Start) -> tuple[str | None, bytes | None]: ... + def erase_credentials(self) -> None: ... + +class ExternalCredentials: + TYPE: ClassVar[str] + erase_on_connect: bool + def __init__(self) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __ne__(self, other: object) -> bool: ... + def response_for(self, start: Connection.Start) -> tuple[str | None, bytes | None]: ... + def erase_credentials(self) -> None: ... + +VALID_TYPES: Incomplete diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/data.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/data.pyi new file mode 100644 index 000000000..c32cde389 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/data.pyi @@ -0,0 +1,14 @@ +from collections.abc import Mapping +from datetime import datetime +from decimal import Decimal +from typing_extensions import TypeAlias + +_Value: TypeAlias = str | bytes | bool | int | Decimal | datetime | _ArgumentMapping | list[_Value] | None +_ArgumentMapping: TypeAlias = Mapping[str, _Value] + +def encode_short_string(pieces: list[bytes], value: str | bytes) -> int: ... +def decode_short_string(encoded: bytes, offset: int) -> tuple[str, int]: ... +def encode_table(pieces: list[bytes], table: _ArgumentMapping) -> int: ... +def encode_value(pieces: list[bytes], value: _Value) -> int: ... +def decode_table(encoded: bytes, offset: int) -> tuple[dict[str, _Value], int]: ... +def decode_value(encoded: bytes, offset: int) -> tuple[_Value, int]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/delivery_mode.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/delivery_mode.pyi new file mode 100644 index 000000000..8395e4129 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/delivery_mode.pyi @@ -0,0 +1,5 @@ +from enum import Enum + +class DeliveryMode(Enum): + Transient: int + Persistent: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/diagnostic_utils.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/diagnostic_utils.pyi new file mode 100644 index 000000000..7c8d2279e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/diagnostic_utils.pyi @@ -0,0 +1 @@ +def create_log_exception_decorator(logger): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/exceptions.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/exceptions.pyi new file mode 100644 index 000000000..23bf3a0f4 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/exceptions.pyi @@ -0,0 +1,60 @@ +from _typeshed import Incomplete + +class AMQPError(Exception): ... +class AMQPConnectionError(AMQPError): ... +class ConnectionOpenAborted(AMQPConnectionError): ... +class StreamLostError(AMQPConnectionError): ... +class IncompatibleProtocolError(AMQPConnectionError): ... +class AuthenticationError(AMQPConnectionError): ... +class ProbableAuthenticationError(AMQPConnectionError): ... +class ProbableAccessDeniedError(AMQPConnectionError): ... +class NoFreeChannels(AMQPConnectionError): ... +class ConnectionWrongStateError(AMQPConnectionError): ... + +class ConnectionClosed(AMQPConnectionError): + def __init__(self, reply_code, reply_text) -> None: ... + @property + def reply_code(self): ... + @property + def reply_text(self): ... + +class ConnectionClosedByBroker(ConnectionClosed): ... +class ConnectionClosedByClient(ConnectionClosed): ... +class ConnectionBlockedTimeout(AMQPConnectionError): ... +class AMQPHeartbeatTimeout(AMQPConnectionError): ... +class AMQPChannelError(AMQPError): ... +class ChannelWrongStateError(AMQPChannelError): ... + +class ChannelClosed(AMQPChannelError): + def __init__(self, reply_code, reply_text) -> None: ... + @property + def reply_code(self): ... + @property + def reply_text(self): ... + +class ChannelClosedByBroker(ChannelClosed): ... +class ChannelClosedByClient(ChannelClosed): ... +class DuplicateConsumerTag(AMQPChannelError): ... +class ConsumerCancelled(AMQPChannelError): ... + +class UnroutableError(AMQPChannelError): + messages: Incomplete + def __init__(self, messages) -> None: ... + +class NackError(AMQPChannelError): + messages: Incomplete + def __init__(self, messages) -> None: ... + +class InvalidChannelNumber(AMQPError): ... +class ProtocolSyntaxError(AMQPError): ... +class UnexpectedFrameError(ProtocolSyntaxError): ... +class ProtocolVersionMismatch(ProtocolSyntaxError): ... +class BodyTooLongError(ProtocolSyntaxError): ... +class InvalidFrameError(ProtocolSyntaxError): ... +class InvalidFieldTypeException(ProtocolSyntaxError): ... +class UnsupportedAMQPFieldException(ProtocolSyntaxError): ... +class MethodNotImplemented(AMQPError): ... +class ChannelError(Exception): ... +class ReentrancyError(Exception): ... +class ShortStringTooLong(AMQPError): ... +class DuplicateGetOkCallback(ChannelError): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/exchange_type.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/exchange_type.pyi new file mode 100644 index 000000000..73cbf3686 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/exchange_type.pyi @@ -0,0 +1,7 @@ +from enum import Enum + +class ExchangeType(Enum): + direct: str + fanout: str + headers: str + topic: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/frame.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/frame.pyi new file mode 100644 index 000000000..e448dc8e0 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/frame.pyi @@ -0,0 +1,47 @@ +from abc import abstractmethod +from logging import Logger +from typing import Generic, TypeVar + +from .amqp_object import AMQPObject, Method as AMQPMethod +from .spec import BasicProperties + +_M = TypeVar("_M", bound=AMQPMethod) + +LOGGER: Logger + +class Frame(AMQPObject): + frame_type: int + channel_number: int + def __init__(self, frame_type: int, channel_number: int) -> None: ... + @abstractmethod + def marshal(self) -> bytes: ... + +class Method(Frame, Generic[_M]): + method: _M + def __init__(self, channel_number: int, method: _M) -> None: ... + def marshal(self) -> bytes: ... + +class Header(Frame): + body_size: int + properties: BasicProperties + def __init__(self, channel_number: int, body_size: int, props: BasicProperties) -> None: ... + def marshal(self) -> bytes: ... + +class Body(Frame): + fragment: bytes + def __init__(self, channel_number: int, fragment: bytes) -> None: ... + def marshal(self) -> bytes: ... + +class Heartbeat(Frame): + def __init__(self) -> None: ... + def marshal(self) -> bytes: ... + +class ProtocolHeader(AMQPObject): + frame_type: int + major: int + minor: int + revision: int + def __init__(self, major: int | None = ..., minor: int | None = ..., revision: int | None = ...) -> None: ... + def marshal(self) -> bytes: ... + +def decode_frame(data_in: bytes) -> tuple[int, Frame | None]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/heartbeat.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/heartbeat.pyi new file mode 100644 index 000000000..7d1d73097 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/heartbeat.pyi @@ -0,0 +1,12 @@ +from _typeshed import Incomplete + +LOGGER: Incomplete + +class HeartbeatChecker: + def __init__(self, connection, timeout) -> None: ... + @property + def bytes_received_on_connection(self): ... + @property + def connection_is_idle(self): ... + def received(self) -> None: ... + def stop(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/spec.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/spec.pyi new file mode 100644 index 000000000..c213867c0 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/spec.pyi @@ -0,0 +1,920 @@ +from _typeshed import Incomplete +from typing import ClassVar +from typing_extensions import Literal, Self, TypeAlias + +from .amqp_object import Class, Method, Properties + +# Ouch. Since str = bytes at runtime, we need a type alias for "str". +_str: TypeAlias = str # noqa: Y042 +str = bytes + +PROTOCOL_VERSION: Incomplete +PORT: int +ACCESS_REFUSED: int +CHANNEL_ERROR: int +COMMAND_INVALID: int +CONNECTION_FORCED: int +CONTENT_TOO_LARGE: int +FRAME_BODY: int +FRAME_END: int +FRAME_END_SIZE: int +FRAME_ERROR: int +FRAME_HEADER: int +FRAME_HEADER_SIZE: int +FRAME_HEARTBEAT: int +FRAME_MAX_SIZE: int +FRAME_METHOD: int +FRAME_MIN_SIZE: int +INTERNAL_ERROR: int +INVALID_PATH: int +NOT_ALLOWED: int +NOT_FOUND: int +NOT_IMPLEMENTED: int +NO_CONSUMERS: int +NO_ROUTE: int +PERSISTENT_DELIVERY_MODE: int +PRECONDITION_FAILED: int +REPLY_SUCCESS: int +RESOURCE_ERROR: int +RESOURCE_LOCKED: int +SYNTAX_ERROR: int +TRANSIENT_DELIVERY_MODE: int +UNEXPECTED_FRAME: int + +class Connection(Class): + INDEX: ClassVar[int] + + class Start(Method): + INDEX: ClassVar[int] + version_major: Incomplete + version_minor: Incomplete + server_properties: Incomplete + mechanisms: Incomplete + locales: Incomplete + def __init__( + self, + version_major: int = ..., + version_minor: int = ..., + server_properties: Incomplete | None = ..., + mechanisms: _str = ..., + locales: _str = ..., + ) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + + class StartOk(Method): + INDEX: ClassVar[int] + client_properties: Incomplete + mechanism: Incomplete + response: Incomplete + locale: Incomplete + def __init__( + self, + client_properties: Incomplete | None = ..., + mechanism: _str = ..., + response: Incomplete | None = ..., + locale: _str = ..., + ) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + + class Secure(Method): + INDEX: ClassVar[int] + challenge: Incomplete + def __init__(self, challenge: Incomplete | None = ...) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + + class SecureOk(Method): + INDEX: ClassVar[int] + response: Incomplete + def __init__(self, response: Incomplete | None = ...) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + + class Tune(Method): + INDEX: ClassVar[int] + channel_max: Incomplete + frame_max: Incomplete + heartbeat: Incomplete + def __init__(self, channel_max: int = ..., frame_max: int = ..., heartbeat: int = ...) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + + class TuneOk(Method): + INDEX: ClassVar[int] + channel_max: Incomplete + frame_max: Incomplete + heartbeat: Incomplete + def __init__(self, channel_max: int = ..., frame_max: int = ..., heartbeat: int = ...) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + + class Open(Method): + INDEX: ClassVar[int] + virtual_host: Incomplete + capabilities: Incomplete + insist: Incomplete + def __init__(self, virtual_host: _str = ..., capabilities: _str = ..., insist: bool = ...) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + + class OpenOk(Method): + INDEX: ClassVar[int] + known_hosts: Incomplete + def __init__(self, known_hosts: _str = ...) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + + class Close(Method): + INDEX: ClassVar[int] + reply_code: Incomplete + reply_text: Incomplete + class_id: Incomplete + method_id: Incomplete + def __init__( + self, + reply_code: Incomplete | None = ..., + reply_text: _str = ..., + class_id: Incomplete | None = ..., + method_id: Incomplete | None = ..., + ) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + + class CloseOk(Method): + INDEX: ClassVar[int] + def __init__(self) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + + class Blocked(Method): + INDEX: ClassVar[int] + reason: Incomplete + def __init__(self, reason: _str = ...) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + + class Unblocked(Method): + INDEX: ClassVar[int] + def __init__(self) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + + class UpdateSecret(Method): + INDEX: ClassVar[int] + new_secret: Incomplete + reason: Incomplete + def __init__(self, new_secret, reason) -> None: ... + @property + def synchronous(self): ... + mechanisms: Incomplete + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + + class UpdateSecretOk(Method): + INDEX: ClassVar[int] + def __init__(self) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + +class Channel(Class): + INDEX: ClassVar[int] + + class Open(Method): + INDEX: ClassVar[int] + out_of_band: Incomplete + def __init__(self, out_of_band: _str = ...) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + + class OpenOk(Method): + INDEX: ClassVar[int] + channel_id: Incomplete + def __init__(self, channel_id: _str = ...) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + + class Flow(Method): + INDEX: ClassVar[int] + active: Incomplete + def __init__(self, active: Incomplete | None = ...) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + + class FlowOk(Method): + INDEX: ClassVar[int] + active: Incomplete + def __init__(self, active: Incomplete | None = ...) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + + class Close(Method): + INDEX: ClassVar[int] + reply_code: Incomplete + reply_text: Incomplete + class_id: Incomplete + method_id: Incomplete + def __init__( + self, + reply_code: Incomplete | None = ..., + reply_text: _str = ..., + class_id: Incomplete | None = ..., + method_id: Incomplete | None = ..., + ) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + + class CloseOk(Method): + INDEX: ClassVar[int] + def __init__(self) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + +class Access(Class): + INDEX: ClassVar[int] + + class Request(Method): + INDEX: ClassVar[int] + realm: Incomplete + exclusive: Incomplete + passive: Incomplete + active: Incomplete + write: Incomplete + read: Incomplete + def __init__( + self, + realm: _str = ..., + exclusive: bool = ..., + passive: bool = ..., + active: bool = ..., + write: bool = ..., + read: bool = ..., + ) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + + class RequestOk(Method): + INDEX: ClassVar[int] + ticket: Incomplete + def __init__(self, ticket: int = ...) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + +class Exchange(Class): + INDEX: ClassVar[int] + + class Declare(Method): + INDEX: ClassVar[int] + ticket: Incomplete + exchange: Incomplete + type: Incomplete + passive: Incomplete + durable: Incomplete + auto_delete: Incomplete + internal: Incomplete + nowait: Incomplete + arguments: Incomplete + def __init__( + self, + ticket: int = ..., + exchange: Incomplete | None = ..., + type=..., + passive: bool = ..., + durable: bool = ..., + auto_delete: bool = ..., + internal: bool = ..., + nowait: bool = ..., + arguments: Incomplete | None = ..., + ) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + + class DeclareOk(Method): + INDEX: ClassVar[int] + def __init__(self) -> None: ... + @property + def synchronous(self) -> Literal[False]: ... + def decode(self, encoded: bytes, offset: int = ...) -> Self: ... + def encode(self) -> list[bytes]: ... + + class Delete(Method): + INDEX: ClassVar[int] + ticket: Incomplete + exchange: Incomplete + if_unused: Incomplete + nowait: Incomplete + def __init__( + self, ticket: int = ..., exchange: Incomplete | None = ..., if_unused: bool = ..., nowait: bool = ... + ) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + + class DeleteOk(Method): + INDEX: ClassVar[int] + def __init__(self) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + + class Bind(Method): + INDEX: ClassVar[int] + ticket: int + destination: Incomplete | None + source: Incomplete | None + routing_key: _str + nowait: bool + arguments: Incomplete | None + def __init__( + self, + ticket: int = ..., + destination: Incomplete | None = ..., + source: Incomplete | None = ..., + routing_key: _str = ..., + nowait: bool = ..., + arguments: Incomplete | None = ..., + ) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + + class BindOk(Method): + INDEX: ClassVar[int] + def __init__(self) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + + class Unbind(Method): + INDEX: ClassVar[int] + ticket: Incomplete + destination: Incomplete + source: Incomplete + routing_key: Incomplete + nowait: Incomplete + arguments: Incomplete + def __init__( + self, + ticket: int = ..., + destination: Incomplete | None = ..., + source: Incomplete | None = ..., + routing_key: _str = ..., + nowait: bool = ..., + arguments: Incomplete | None = ..., + ) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + + class UnbindOk(Method): + INDEX: ClassVar[int] + def __init__(self) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + +class Queue(Class): + INDEX: ClassVar[int] + + class Declare(Method): + INDEX: ClassVar[int] + ticket: Incomplete + queue: Incomplete + passive: Incomplete + durable: Incomplete + exclusive: Incomplete + auto_delete: Incomplete + nowait: Incomplete + arguments: Incomplete + def __init__( + self, + ticket: int = ..., + queue: _str = ..., + passive: bool = ..., + durable: bool = ..., + exclusive: bool = ..., + auto_delete: bool = ..., + nowait: bool = ..., + arguments: Incomplete | None = ..., + ) -> None: ... + @property + def synchronous(self) -> Literal[True]: ... + def decode(self, encoded: bytes, offset: int = ...) -> Self: ... + def encode(self) -> list[bytes]: ... + + class DeclareOk(Method): + INDEX: ClassVar[int] + queue: _str + message_count: int + consumer_count: int + def __init__(self, queue: _str, message_count: int, consumer_count: int) -> None: ... + @property + def synchronous(self) -> Literal[False]: ... + def decode(self, encoded: bytes, offset: int = ...) -> Self: ... + def encode(self) -> list[bytes]: ... + + class Bind(Method): + INDEX: ClassVar[int] + ticket: Incomplete + queue: Incomplete + exchange: Incomplete + routing_key: Incomplete + nowait: Incomplete + arguments: Incomplete + def __init__( + self, + ticket: int = ..., + queue: _str = ..., + exchange: Incomplete | None = ..., + routing_key: _str = ..., + nowait: bool = ..., + arguments: Incomplete | None = ..., + ) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + + class BindOk(Method): + INDEX: ClassVar[int] + def __init__(self) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + + class Purge(Method): + INDEX: ClassVar[int] + ticket: Incomplete + queue: Incomplete + nowait: Incomplete + def __init__(self, ticket: int = ..., queue: _str = ..., nowait: bool = ...) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + + class PurgeOk(Method): + INDEX: ClassVar[int] + message_count: Incomplete + def __init__(self, message_count: Incomplete | None = ...) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + + class Delete(Method): + INDEX: ClassVar[int] + ticket: Incomplete + queue: Incomplete + if_unused: Incomplete + if_empty: Incomplete + nowait: Incomplete + def __init__( + self, ticket: int = ..., queue: _str = ..., if_unused: bool = ..., if_empty: bool = ..., nowait: bool = ... + ) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + + class DeleteOk(Method): + INDEX: ClassVar[int] + message_count: Incomplete + def __init__(self, message_count: Incomplete | None = ...) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + + class Unbind(Method): + INDEX: ClassVar[int] + ticket: Incomplete + queue: Incomplete + exchange: Incomplete + routing_key: Incomplete + arguments: Incomplete + def __init__( + self, + ticket: int = ..., + queue: _str = ..., + exchange: Incomplete | None = ..., + routing_key: _str = ..., + arguments: Incomplete | None = ..., + ) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + + class UnbindOk(Method): + INDEX: ClassVar[int] + def __init__(self) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + +class Basic(Class): + INDEX: ClassVar[int] + + class Qos(Method): + INDEX: ClassVar[int] + prefetch_size: Incomplete + prefetch_count: Incomplete + global_qos: Incomplete + def __init__(self, prefetch_size: int = ..., prefetch_count: int = ..., global_qos: bool = ...) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + + class QosOk(Method): + INDEX: ClassVar[int] + def __init__(self) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + + class Consume(Method): + INDEX: ClassVar[int] + ticket: Incomplete + queue: Incomplete + consumer_tag: Incomplete + no_local: Incomplete + no_ack: Incomplete + exclusive: Incomplete + nowait: Incomplete + arguments: Incomplete + def __init__( + self, + ticket: int = ..., + queue: _str = ..., + consumer_tag: _str = ..., + no_local: bool = ..., + no_ack: bool = ..., + exclusive: bool = ..., + nowait: bool = ..., + arguments: Incomplete | None = ..., + ) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + + class ConsumeOk(Method): + INDEX: ClassVar[int] + consumer_tag: Incomplete + def __init__(self, consumer_tag: Incomplete | None = ...) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + + class Cancel(Method): + INDEX: ClassVar[int] + consumer_tag: Incomplete + nowait: Incomplete + def __init__(self, consumer_tag: Incomplete | None = ..., nowait: bool = ...) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + + class CancelOk(Method): + INDEX: ClassVar[int] + consumer_tag: Incomplete + def __init__(self, consumer_tag: Incomplete | None = ...) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + + class Publish(Method): + INDEX: ClassVar[int] + ticket: Incomplete + exchange: Incomplete + routing_key: Incomplete + mandatory: Incomplete + immediate: Incomplete + def __init__( + self, ticket: int = ..., exchange: _str = ..., routing_key: _str = ..., mandatory: bool = ..., immediate: bool = ... + ) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + + class Return(Method): + INDEX: ClassVar[int] + reply_code: Incomplete + reply_text: Incomplete + exchange: Incomplete + routing_key: Incomplete + def __init__( + self, + reply_code: Incomplete | None = ..., + reply_text: _str = ..., + exchange: Incomplete | None = ..., + routing_key: Incomplete | None = ..., + ) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + + class Deliver(Method): + INDEX: ClassVar[int] + consumer_tag: Incomplete + delivery_tag: Incomplete + redelivered: Incomplete + exchange: Incomplete + routing_key: Incomplete + def __init__( + self, + consumer_tag: Incomplete | None = ..., + delivery_tag: Incomplete | None = ..., + redelivered: bool = ..., + exchange: Incomplete | None = ..., + routing_key: Incomplete | None = ..., + ) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + + class Get(Method): + INDEX: ClassVar[int] + ticket: Incomplete + queue: Incomplete + no_ack: Incomplete + def __init__(self, ticket: int = ..., queue: _str = ..., no_ack: bool = ...) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + + class GetOk(Method): + INDEX: ClassVar[int] + delivery_tag: Incomplete + redelivered: Incomplete + exchange: Incomplete + routing_key: Incomplete + message_count: Incomplete + def __init__( + self, + delivery_tag: Incomplete | None = ..., + redelivered: bool = ..., + exchange: Incomplete | None = ..., + routing_key: Incomplete | None = ..., + message_count: Incomplete | None = ..., + ) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + + class GetEmpty(Method): + INDEX: ClassVar[int] + cluster_id: Incomplete + def __init__(self, cluster_id: _str = ...) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + + class Ack(Method): + INDEX: ClassVar[int] + delivery_tag: Incomplete + multiple: Incomplete + def __init__(self, delivery_tag: int = ..., multiple: bool = ...) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + + class Reject(Method): + INDEX: ClassVar[int] + delivery_tag: Incomplete + requeue: Incomplete + def __init__(self, delivery_tag: Incomplete | None = ..., requeue: bool = ...) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + + class RecoverAsync(Method): + INDEX: ClassVar[int] + requeue: Incomplete + def __init__(self, requeue: bool = ...) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + + class Recover(Method): + INDEX: ClassVar[int] + requeue: Incomplete + def __init__(self, requeue: bool = ...) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + + class RecoverOk(Method): + INDEX: ClassVar[int] + def __init__(self) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + + class Nack(Method): + INDEX: ClassVar[int] + delivery_tag: Incomplete + multiple: Incomplete + requeue: Incomplete + def __init__(self, delivery_tag: int = ..., multiple: bool = ..., requeue: bool = ...) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + +class Tx(Class): + INDEX: ClassVar[int] + + class Select(Method): + INDEX: ClassVar[int] + def __init__(self) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + + class SelectOk(Method): + INDEX: ClassVar[int] + def __init__(self) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + + class Commit(Method): + INDEX: ClassVar[int] + def __init__(self) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + + class CommitOk(Method): + INDEX: ClassVar[int] + def __init__(self) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + + class Rollback(Method): + INDEX: ClassVar[int] + def __init__(self) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + + class RollbackOk(Method): + INDEX: ClassVar[int] + def __init__(self) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + +class Confirm(Class): + INDEX: ClassVar[int] + + class Select(Method): + INDEX: ClassVar[int] + nowait: Incomplete + def __init__(self, nowait: bool = ...) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + + class SelectOk(Method): + INDEX: ClassVar[int] + def __init__(self) -> None: ... + @property + def synchronous(self): ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + +class BasicProperties(Properties): + CLASS: Incomplete + INDEX: ClassVar[int] + FLAG_CONTENT_TYPE: Incomplete + FLAG_CONTENT_ENCODING: Incomplete + FLAG_HEADERS: Incomplete + FLAG_DELIVERY_MODE: Incomplete + FLAG_PRIORITY: Incomplete + FLAG_CORRELATION_ID: Incomplete + FLAG_REPLY_TO: Incomplete + FLAG_EXPIRATION: Incomplete + FLAG_MESSAGE_ID: Incomplete + FLAG_TIMESTAMP: Incomplete + FLAG_TYPE: Incomplete + FLAG_USER_ID: Incomplete + FLAG_APP_ID: Incomplete + FLAG_CLUSTER_ID: Incomplete + content_type: Incomplete + content_encoding: Incomplete + headers: Incomplete + delivery_mode: Incomplete + priority: Incomplete + correlation_id: Incomplete + reply_to: Incomplete + expiration: Incomplete + message_id: Incomplete + timestamp: Incomplete + type: Incomplete + user_id: Incomplete + app_id: Incomplete + cluster_id: Incomplete + def __init__( + self, + content_type: Incomplete | None = ..., + content_encoding: Incomplete | None = ..., + headers: Incomplete | None = ..., + delivery_mode: Incomplete | None = ..., + priority: Incomplete | None = ..., + correlation_id: Incomplete | None = ..., + reply_to: Incomplete | None = ..., + expiration: Incomplete | None = ..., + message_id: Incomplete | None = ..., + timestamp: Incomplete | None = ..., + type: Incomplete | None = ..., + user_id: Incomplete | None = ..., + app_id: Incomplete | None = ..., + cluster_id: Incomplete | None = ..., + ) -> None: ... + def decode(self, encoded, offset: int = ...): ... + def encode(self): ... + +methods: Incomplete +props: Incomplete + +def has_content(methodNumber): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/tcp_socket_opts.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/tcp_socket_opts.pyi new file mode 100644 index 000000000..81837440a --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/tcp_socket_opts.pyi @@ -0,0 +1,6 @@ +from _typeshed import Incomplete + +LOGGER: Incomplete + +def socket_requires_keepalive(tcp_options): ... +def set_sock_opts(tcp_options, sock) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/validators.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/validators.pyi new file mode 100644 index 000000000..52ea03623 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/validators.pyi @@ -0,0 +1,4 @@ +def require_string(value, value_name) -> None: ... +def require_callback(callback, callback_name: str = ...) -> None: ... +def rpc_completion_callback(callback): ... +def zero_or_greater(name, value) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/playsound/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/playsound/METADATA.toml index 47610a97c..3ea18392d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/playsound/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/playsound/METADATA.toml @@ -1,4 +1 @@ version = "1.3.*" - -[tool.stubtest] -ignore_missing_stub = false diff --git a/packages/pyright-internal/typeshed-fallback/stubs/playsound/playsound.pyi b/packages/pyright-internal/typeshed-fallback/stubs/playsound/playsound.pyi index cd6c1aad1..b70f7902c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/playsound/playsound.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/playsound/playsound.pyi @@ -1,5 +1,8 @@ +import logging import pathlib +logger: logging.Logger + class PlaysoundException(Exception): ... def playsound(sound: str | pathlib.Path, block: bool = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/polib/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/polib/METADATA.toml index c9f594bd7..249b0a7c0 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/polib/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/polib/METADATA.toml @@ -1 +1 @@ -version = "1.1.*" +version = "1.2.*" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/polib/polib.pyi b/packages/pyright-internal/typeshed-fallback/stubs/polib/polib.pyi index 034db5849..03a0338b4 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/polib/polib.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/polib/polib.pyi @@ -1,4 +1,3 @@ -import textwrap from collections.abc import Callable from typing import IO, Any, Generic, TypeVar, overload from typing_extensions import SupportsIndex @@ -39,7 +38,7 @@ class _BaseFile(list[_TB]): def append(self, entry: _TB) -> None: ... def insert(self, index: SupportsIndex, entry: _TB) -> None: ... def metadata_as_entry(self) -> POEntry: ... - def save(self, fpath: str | None = ..., repr_method: str = ...) -> None: ... + def save(self, fpath: str | None = ..., repr_method: str = ..., newline: str | None = ...) -> None: ... def find(self, st: str, by: str = ..., include_obsolete_entries: bool = ..., msgctxt: bool = ...) -> _TB | None: ... def ordered_metadata(self) -> list[tuple[str, str]]: ... def to_binary(self) -> bytes: ... @@ -79,6 +78,8 @@ class _BaseEntry: def __init__(self, *args: Any, **kwargs: Any) -> None: ... def __unicode__(self, wrapwidth: int = ...) -> str: ... def __eq__(self, other: object) -> bool: ... + @property + def msgid_with_context(self) -> str: ... class POEntry(_BaseEntry): comment: str @@ -152,7 +153,3 @@ class _MOFileParser(Generic[_TM]): def __init__(self, mofile: str, *args: Any, **kwargs: Any) -> None: ... def __del__(self) -> None: ... def parse(self) -> _TM: ... - -class TextWrapper(textwrap.TextWrapper): - drop_whitespace: bool - def __init__(self, *args: Any, **kwargs: Any) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/prettytable/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/prettytable/METADATA.toml index c7cec0fc8..a2c3acdba 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/prettytable/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/prettytable/METADATA.toml @@ -1,4 +1,2 @@ -version = "3.3.*" - -[tool.stubtest] -ignore_missing_stub = false +version = "3.4.*" +obsolete_since = "3.5.0" # Released on 2022-10-28 diff --git a/packages/pyright-internal/typeshed-fallback/stubs/prettytable/prettytable/colortable.pyi b/packages/pyright-internal/typeshed-fallback/stubs/prettytable/prettytable/colortable.pyi index 1cb3fc8bb..39a60f592 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/prettytable/prettytable/colortable.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/prettytable/prettytable/colortable.pyi @@ -27,7 +27,7 @@ class Theme: junction_color: str = ..., ) -> None: ... # The following method is broken in upstream code. - def format_code(s: str) -> str: ... # type: ignore[misc] + def format_code(s: str) -> str: ... # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues] class Themes: DEFAULT: ClassVar[Theme] @@ -40,4 +40,4 @@ class ColorTable(PrettyTable): @theme.setter def theme(self, value: Theme): ... def update_theme(self) -> None: ... - def get_string(self, **kwargs): ... + def get_string(self, **kwargs) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/prettytable/prettytable/prettytable.pyi b/packages/pyright-internal/typeshed-fallback/stubs/prettytable/prettytable/prettytable.pyi index 5c2e67cee..1c1482501 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/prettytable/prettytable/prettytable.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/prettytable/prettytable/prettytable.pyi @@ -18,8 +18,8 @@ BASE_ALIGN_VALUE: str class PrettyTable: encoding: Any - def __init__(self, field_names: Any | None = ..., **kwargs): ... - def __getattr__(self, name): ... + def __init__(self, field_names: Incomplete | None = ..., **kwargs): ... + def __getattr__(self, name: str): ... def __getitem__(self, index): ... @property def field_names(self): ... @@ -210,13 +210,13 @@ class PrettyTable: def clear_rows(self) -> None: ... def clear(self) -> None: ... def copy(self): ... - def get_string(self, **kwargs): ... - def paginate(self, page_length: int = ..., **kwargs): ... - def get_csv_string(self, **kwargs): ... - def get_json_string(self, **kwargs): ... - def get_html_string(self, **kwargs): ... + def get_string(self, **kwargs) -> str: ... + def paginate(self, page_length: int = ..., line_break: str = ..., **kwargs): ... + def get_csv_string(self, **kwargs) -> str: ... + def get_json_string(self, **kwargs) -> str: ... + def get_html_string(self, **kwargs) -> str: ... -def from_csv(fp, field_names: Any | None = ..., **kwargs): ... +def from_csv(fp, field_names: Incomplete | None = ..., **kwargs): ... def from_db_cursor(cursor, **kwargs): ... def from_json(json_string, **kwargs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/METADATA.toml index 5004c7555..39cd1ce95 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/METADATA.toml @@ -1,2 +1,5 @@ -version = "3.19.*" -extra_description = "Generated with aid from mypy-protobuf v3.2.0" +version = "4.22.*" +extra_description = "Generated with aid from mypy-protobuf v3.4.0" + +[tool.stubtest] +ignore_missing_stub = true diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/any_pb2.pyi b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/any_pb2.pyi index 8027f052d..398a9abad 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/any_pb2.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/any_pb2.pyi @@ -1,16 +1,50 @@ """ @generated by mypy-protobuf. Do not edit manually! isort:skip_file +Protocol Buffers - Google's data interchange format +Copyright 2008 Google Inc. All rights reserved. +https://developers.google.com/protocol-buffers/ + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ import builtins import google.protobuf.descriptor import google.protobuf.internal.well_known_types import google.protobuf.message -import typing -import typing_extensions +import sys + +if sys.version_info >= (3, 8): + import typing as typing_extensions +else: + import typing_extensions DESCRIPTOR: google.protobuf.descriptor.FileDescriptor +@typing_extensions.final class Any(google.protobuf.message.Message, google.protobuf.internal.well_known_types.Any): """`Any` contains an arbitrary serialized protocol buffer message along with a URL that describes the type of the serialized message. @@ -37,7 +71,7 @@ class Any(google.protobuf.message.Message, google.protobuf.internal.well_known_t foo = any.unpack(Foo.class); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -47,7 +81,7 @@ class Any(google.protobuf.message.Message, google.protobuf.internal.well_known_t any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -68,7 +102,7 @@ class Any(google.protobuf.message.Message, google.protobuf.internal.well_known_t JSON - ==== + The JSON representation of an `Any` value uses the regular representation of the deserialized, embedded message, with an additional field `@type` which contains the type URL. Example: @@ -95,10 +129,12 @@ class Any(google.protobuf.message.Message, google.protobuf.internal.well_known_t "value": "1.212s" } """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + TYPE_URL_FIELD_NUMBER: builtins.int VALUE_FIELD_NUMBER: builtins.int - type_url: typing.Text + type_url: builtins.str """A URL/resource name that uniquely identifies the type of the serialized protocol buffer message. This string must contain at least one "/" character. The last segment of the URL's path must represent @@ -127,14 +163,14 @@ class Any(google.protobuf.message.Message, google.protobuf.internal.well_known_t Schemes other than `http`, `https` (or the empty scheme) might be used with implementation specific semantics. """ - value: builtins.bytes """Must be a valid serialized protocol buffer of the above specified type.""" - - def __init__(self, + def __init__( + self, *, - type_url: typing.Optional[typing.Text] = ..., - value: typing.Optional[builtins.bytes] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["type_url",b"type_url","value",b"value"]) -> None: ... + type_url: builtins.str | None = ..., + value: builtins.bytes | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["type_url", b"type_url", "value", b"value"]) -> None: ... + global___Any = Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/api_pb2.pyi b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/api_pb2.pyi index d2d0ca52f..4cedb0da9 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/api_pb2.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/api_pb2.pyi @@ -1,18 +1,53 @@ """ @generated by mypy-protobuf. Do not edit manually! isort:skip_file +Protocol Buffers - Google's data interchange format +Copyright 2008 Google Inc. All rights reserved. +https://developers.google.com/protocol-buffers/ + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ import builtins +import collections.abc import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message import google.protobuf.source_context_pb2 import google.protobuf.type_pb2 -import typing -import typing_extensions +import sys + +if sys.version_info >= (3, 8): + import typing as typing_extensions +else: + import typing_extensions DESCRIPTOR: google.protobuf.descriptor.FileDescriptor +@typing_extensions.final class Api(google.protobuf.message.Message): """Api is a light-weight descriptor for an API Interface. @@ -24,7 +59,9 @@ class Api(google.protobuf.message.Message): this message itself. See https://cloud.google.com/apis/design/glossary for detailed terminology. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int METHODS_FIELD_NUMBER: builtins.int OPTIONS_FIELD_NUMBER: builtins.int @@ -32,20 +69,17 @@ class Api(google.protobuf.message.Message): SOURCE_CONTEXT_FIELD_NUMBER: builtins.int MIXINS_FIELD_NUMBER: builtins.int SYNTAX_FIELD_NUMBER: builtins.int - name: typing.Text + name: builtins.str """The fully qualified name of this interface, including package name followed by the interface's simple name. """ - @property def methods(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Method]: """The methods of this interface, in unspecified order.""" - pass @property def options(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[google.protobuf.type_pb2.Option]: """Any metadata attached to the interface.""" - pass - version: typing.Text + version: builtins.str """A version string for this interface. If specified, must have the form `major-version.minor-version`, as in `1.10`. If the minor version is omitted, it defaults to zero. If the entire version field is empty, the @@ -66,37 +100,38 @@ class Api(google.protobuf.message.Message): be omitted. Zero major versions must only be used for experimental, non-GA interfaces. """ - @property def source_context(self) -> google.protobuf.source_context_pb2.SourceContext: """Source context for the protocol buffer service represented by this message. """ - pass @property def mixins(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Mixin]: """Included interfaces. See [Mixin][].""" - pass syntax: google.protobuf.type_pb2.Syntax.ValueType """The source syntax of the service.""" - - def __init__(self, + def __init__( + self, *, - name: typing.Optional[typing.Text] = ..., - methods: typing.Optional[typing.Iterable[global___Method]] = ..., - options: typing.Optional[typing.Iterable[google.protobuf.type_pb2.Option]] = ..., - version: typing.Optional[typing.Text] = ..., - source_context: typing.Optional[google.protobuf.source_context_pb2.SourceContext] = ..., - mixins: typing.Optional[typing.Iterable[global___Mixin]] = ..., - syntax: typing.Optional[google.protobuf.type_pb2.Syntax.ValueType] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["source_context",b"source_context"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["methods",b"methods","mixins",b"mixins","name",b"name","options",b"options","source_context",b"source_context","syntax",b"syntax","version",b"version"]) -> None: ... + name: builtins.str | None = ..., + methods: collections.abc.Iterable[global___Method] | None = ..., + options: collections.abc.Iterable[google.protobuf.type_pb2.Option] | None = ..., + version: builtins.str | None = ..., + source_context: google.protobuf.source_context_pb2.SourceContext | None = ..., + mixins: collections.abc.Iterable[global___Mixin] | None = ..., + syntax: google.protobuf.type_pb2.Syntax.ValueType | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["source_context", b"source_context"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["methods", b"methods", "mixins", b"mixins", "name", b"name", "options", b"options", "source_context", b"source_context", "syntax", b"syntax", "version", b"version"]) -> None: ... + global___Api = Api +@typing_extensions.final class Method(google.protobuf.message.Message): """Method represents a method of an API interface.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int REQUEST_TYPE_URL_FIELD_NUMBER: builtins.int REQUEST_STREAMING_FIELD_NUMBER: builtins.int @@ -104,41 +139,37 @@ class Method(google.protobuf.message.Message): RESPONSE_STREAMING_FIELD_NUMBER: builtins.int OPTIONS_FIELD_NUMBER: builtins.int SYNTAX_FIELD_NUMBER: builtins.int - name: typing.Text + name: builtins.str """The simple name of this method.""" - - request_type_url: typing.Text + request_type_url: builtins.str """A URL of the input message type.""" - request_streaming: builtins.bool """If true, the request is streamed.""" - - response_type_url: typing.Text + response_type_url: builtins.str """The URL of the output message type.""" - response_streaming: builtins.bool """If true, the response is streamed.""" - @property def options(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[google.protobuf.type_pb2.Option]: """Any metadata attached to the method.""" - pass syntax: google.protobuf.type_pb2.Syntax.ValueType """The source syntax of this method.""" - - def __init__(self, + def __init__( + self, *, - name: typing.Optional[typing.Text] = ..., - request_type_url: typing.Optional[typing.Text] = ..., - request_streaming: typing.Optional[builtins.bool] = ..., - response_type_url: typing.Optional[typing.Text] = ..., - response_streaming: typing.Optional[builtins.bool] = ..., - options: typing.Optional[typing.Iterable[google.protobuf.type_pb2.Option]] = ..., - syntax: typing.Optional[google.protobuf.type_pb2.Syntax.ValueType] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["name",b"name","options",b"options","request_streaming",b"request_streaming","request_type_url",b"request_type_url","response_streaming",b"response_streaming","response_type_url",b"response_type_url","syntax",b"syntax"]) -> None: ... + name: builtins.str | None = ..., + request_type_url: builtins.str | None = ..., + request_streaming: builtins.bool | None = ..., + response_type_url: builtins.str | None = ..., + response_streaming: builtins.bool | None = ..., + options: collections.abc.Iterable[google.protobuf.type_pb2.Option] | None = ..., + syntax: google.protobuf.type_pb2.Syntax.ValueType | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["name", b"name", "options", b"options", "request_streaming", b"request_streaming", "request_type_url", b"request_type_url", "response_streaming", b"response_streaming", "response_type_url", b"response_type_url", "syntax", b"syntax"]) -> None: ... + global___Method = Method +@typing_extensions.final class Mixin(google.protobuf.message.Message): """Declares an API Interface to be included in this interface. The including interface must redeclare all the methods from the included interface, but @@ -219,21 +250,23 @@ class Mixin(google.protobuf.message.Message): ... } """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int ROOT_FIELD_NUMBER: builtins.int - name: typing.Text + name: builtins.str """The fully qualified name of the interface which is included.""" - - root: typing.Text + root: builtins.str """If non-empty specifies a path under which inherited HTTP paths are rooted. """ - - def __init__(self, + def __init__( + self, *, - name: typing.Optional[typing.Text] = ..., - root: typing.Optional[typing.Text] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["name",b"name","root",b"root"]) -> None: ... + name: builtins.str | None = ..., + root: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["name", b"name", "root", b"root"]) -> None: ... + global___Mixin = Mixin diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/compiler/plugin_pb2.pyi b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/compiler/plugin_pb2.pyi index 543116729..2c54ee220 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/compiler/plugin_pb2.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/compiler/plugin_pb2.pyi @@ -1,21 +1,45 @@ """ @generated by mypy-protobuf. Do not edit manually! isort:skip_file +Author: kenton@google.com (Kenton Varda) + +WARNING: The plugin interface is currently EXPERIMENTAL and is subject to + change. + +protoc (aka the Protocol Compiler) can be extended via plugins. A plugin is +just a program that reads a CodeGeneratorRequest from stdin and writes a +CodeGeneratorResponse to stdout. + +Plugins written using C++ can use google/protobuf/compiler/plugin.h instead +of dealing with the raw protocol defined here. + +A plugin executable needs only to be placed somewhere in the path. The +plugin should be named "protoc-gen-$NAME", and will then be used when the +flag "--${NAME}_out" is passed to protoc. """ import builtins +import collections.abc import google.protobuf.descriptor import google.protobuf.descriptor_pb2 import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message +import sys import typing -import typing_extensions + +if sys.version_info >= (3, 10): + import typing as typing_extensions +else: + import typing_extensions DESCRIPTOR: google.protobuf.descriptor.FileDescriptor +@typing_extensions.final class Version(google.protobuf.message.Message): """The version number of protocol compiler.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + MAJOR_FIELD_NUMBER: builtins.int MINOR_FIELD_NUMBER: builtins.int PATCH_FIELD_NUMBER: builtins.int @@ -23,39 +47,41 @@ class Version(google.protobuf.message.Message): major: builtins.int minor: builtins.int patch: builtins.int - suffix: typing.Text + suffix: builtins.str """A suffix for alpha, beta or rc release, e.g., "alpha-1", "rc2". It should be empty for mainline stable releases. """ - - def __init__(self, + def __init__( + self, *, - major: typing.Optional[builtins.int] = ..., - minor: typing.Optional[builtins.int] = ..., - patch: typing.Optional[builtins.int] = ..., - suffix: typing.Optional[typing.Text] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["major",b"major","minor",b"minor","patch",b"patch","suffix",b"suffix"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["major",b"major","minor",b"minor","patch",b"patch","suffix",b"suffix"]) -> None: ... + major: builtins.int | None = ..., + minor: builtins.int | None = ..., + patch: builtins.int | None = ..., + suffix: builtins.str | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["major", b"major", "minor", b"minor", "patch", b"patch", "suffix", b"suffix"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["major", b"major", "minor", b"minor", "patch", b"patch", "suffix", b"suffix"]) -> None: ... + global___Version = Version +@typing_extensions.final class CodeGeneratorRequest(google.protobuf.message.Message): """An encoded CodeGeneratorRequest is written to the plugin's stdin.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + FILE_TO_GENERATE_FIELD_NUMBER: builtins.int PARAMETER_FIELD_NUMBER: builtins.int PROTO_FILE_FIELD_NUMBER: builtins.int COMPILER_VERSION_FIELD_NUMBER: builtins.int @property - def file_to_generate(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[typing.Text]: + def file_to_generate(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: """The .proto files that were explicitly listed on the command-line. The code generator should generate code only for these files. Each file's descriptor will be included in proto_file, below. """ - pass - parameter: typing.Text + parameter: builtins.str """The generator parameter passed on the command-line.""" - @property def proto_file(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[google.protobuf.descriptor_pb2.FileDescriptorProto]: """FileDescriptorProtos for all files in files_to_generate and everything @@ -73,47 +99,54 @@ class CodeGeneratorRequest(google.protobuf.message.Message): Type names of fields and extensions in the FileDescriptorProto are always fully qualified. """ - pass @property def compiler_version(self) -> global___Version: """The version number of protocol compiler.""" - pass - def __init__(self, + def __init__( + self, *, - file_to_generate: typing.Optional[typing.Iterable[typing.Text]] = ..., - parameter: typing.Optional[typing.Text] = ..., - proto_file: typing.Optional[typing.Iterable[google.protobuf.descriptor_pb2.FileDescriptorProto]] = ..., - compiler_version: typing.Optional[global___Version] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["compiler_version",b"compiler_version","parameter",b"parameter"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["compiler_version",b"compiler_version","file_to_generate",b"file_to_generate","parameter",b"parameter","proto_file",b"proto_file"]) -> None: ... + file_to_generate: collections.abc.Iterable[builtins.str] | None = ..., + parameter: builtins.str | None = ..., + proto_file: collections.abc.Iterable[google.protobuf.descriptor_pb2.FileDescriptorProto] | None = ..., + compiler_version: global___Version | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["compiler_version", b"compiler_version", "parameter", b"parameter"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["compiler_version", b"compiler_version", "file_to_generate", b"file_to_generate", "parameter", b"parameter", "proto_file", b"proto_file"]) -> None: ... + global___CodeGeneratorRequest = CodeGeneratorRequest +@typing_extensions.final class CodeGeneratorResponse(google.protobuf.message.Message): """The plugin writes an encoded CodeGeneratorResponse to stdout.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + class _Feature: - ValueType = typing.NewType('ValueType', builtins.int) + ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType - class _FeatureEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[CodeGeneratorResponse._Feature.ValueType], builtins.type): + + class _FeatureEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[CodeGeneratorResponse._Feature.ValueType], builtins.type): # noqa: F821 DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor FEATURE_NONE: CodeGeneratorResponse._Feature.ValueType # 0 FEATURE_PROTO3_OPTIONAL: CodeGeneratorResponse._Feature.ValueType # 1 + class Feature(_Feature, metaclass=_FeatureEnumTypeWrapper): """Sync with code_generator.h.""" - pass FEATURE_NONE: CodeGeneratorResponse.Feature.ValueType # 0 FEATURE_PROTO3_OPTIONAL: CodeGeneratorResponse.Feature.ValueType # 1 + @typing_extensions.final class File(google.protobuf.message.Message): """Represents a single generated file.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int INSERTION_POINT_FIELD_NUMBER: builtins.int CONTENT_FIELD_NUMBER: builtins.int GENERATED_CODE_INFO_FIELD_NUMBER: builtins.int - name: typing.Text + name: builtins.str """The file name, relative to the output directory. The name must not contain "." or ".." components and must be relative, not be absolute (so, the file cannot lie outside the output directory). "/" must be used as @@ -126,8 +159,7 @@ class CodeGeneratorResponse(google.protobuf.message.Message): this writing protoc does not optimize for this -- it will read the entire CodeGeneratorResponse before writing files to disk. """ - - insertion_point: typing.Text + insertion_point: builtins.str """If non-empty, indicates that the named file should already exist, and the content here is to be inserted into that file at a defined insertion point. This feature allows a code generator to extend the output @@ -166,31 +198,29 @@ class CodeGeneratorResponse(google.protobuf.message.Message): If |insertion_point| is present, |name| must also be present. """ - - content: typing.Text + content: builtins.str """The file contents.""" - @property def generated_code_info(self) -> google.protobuf.descriptor_pb2.GeneratedCodeInfo: """Information describing the file content being inserted. If an insertion point is used, this information will be appropriately offset and inserted into the code generation metadata for the generated files. """ - pass - def __init__(self, + def __init__( + self, *, - name: typing.Optional[typing.Text] = ..., - insertion_point: typing.Optional[typing.Text] = ..., - content: typing.Optional[typing.Text] = ..., - generated_code_info: typing.Optional[google.protobuf.descriptor_pb2.GeneratedCodeInfo] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["content",b"content","generated_code_info",b"generated_code_info","insertion_point",b"insertion_point","name",b"name"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["content",b"content","generated_code_info",b"generated_code_info","insertion_point",b"insertion_point","name",b"name"]) -> None: ... + name: builtins.str | None = ..., + insertion_point: builtins.str | None = ..., + content: builtins.str | None = ..., + generated_code_info: google.protobuf.descriptor_pb2.GeneratedCodeInfo | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["content", b"content", "generated_code_info", b"generated_code_info", "insertion_point", b"insertion_point", "name", b"name"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["content", b"content", "generated_code_info", b"generated_code_info", "insertion_point", b"insertion_point", "name", b"name"]) -> None: ... ERROR_FIELD_NUMBER: builtins.int SUPPORTED_FEATURES_FIELD_NUMBER: builtins.int FILE_FIELD_NUMBER: builtins.int - error: typing.Text + error: builtins.str """Error message. If non-empty, code generation failed. The plugin process should exit with status code zero even if it reports an error in this way. @@ -200,20 +230,20 @@ class CodeGeneratorResponse(google.protobuf.message.Message): unparseable -- should be reported by writing a message to stderr and exiting with a non-zero status code. """ - supported_features: builtins.int """A bitmask of supported features that the code generator supports. This is a bitwise "or" of values from the Feature enum. """ - @property def file(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___CodeGeneratorResponse.File]: ... - def __init__(self, + def __init__( + self, *, - error: typing.Optional[typing.Text] = ..., - supported_features: typing.Optional[builtins.int] = ..., - file: typing.Optional[typing.Iterable[global___CodeGeneratorResponse.File]] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["error",b"error","supported_features",b"supported_features"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["error",b"error","file",b"file","supported_features",b"supported_features"]) -> None: ... + error: builtins.str | None = ..., + supported_features: builtins.int | None = ..., + file: collections.abc.Iterable[global___CodeGeneratorResponse.File] | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["error", b"error", "supported_features", b"supported_features"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["error", b"error", "file", b"file", "supported_features", b"supported_features"]) -> None: ... + global___CodeGeneratorResponse = CodeGeneratorResponse diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/descriptor.pyi b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/descriptor.pyi index 904f74c01..2b4f36e35 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/descriptor.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/descriptor.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from .descriptor_pb2 import ( @@ -16,7 +17,7 @@ class Error(Exception): ... class TypeTransformationError(Error): ... class DescriptorMetaclass(type): - def __instancecheck__(self, obj): ... + def __instancecheck__(self, obj: Any) -> bool: ... _internal_create_key: object @@ -60,6 +61,27 @@ class Descriptor(_NestedDescriptorBase): oneofs: Any oneofs_by_name: Any syntax: Any + def __init__( + self, + name: str, + full_name: str, + filename: Any, + containing_type: Descriptor | None, + fields: list[FieldDescriptor], + nested_types: list[FieldDescriptor], + enum_types: list[EnumDescriptor], + extensions: list[FieldDescriptor], + options: Incomplete | None = ..., + serialized_options: Incomplete | None = ..., + is_extendable: bool | None = ..., + extension_ranges: Incomplete | None = ..., + oneofs: list[OneofDescriptor] | None = ..., + file: FileDescriptor | None = ..., + serialized_start: Incomplete | None = ..., + serialized_end: Incomplete | None = ..., + syntax: str | None = ..., + create_key: Incomplete | None = ..., + ): ... def EnumValueName(self, enum, value): ... def CopyToProto(self, proto): ... def GetOptions(self) -> MessageOptions: ... @@ -227,6 +249,19 @@ class ServiceDescriptor(_NestedDescriptorBase): index: Any methods: Any methods_by_name: Any + def __init__( + self, + name: str, + full_name: str, + index: int, + methods: list[MethodDescriptor], + options: ServiceOptions | None = ..., + serialized_options: Incomplete | None = ..., + file: FileDescriptor | None = ..., + serialized_start: Incomplete | None = ..., + serialized_end: Incomplete | None = ..., + create_key: Incomplete | None = ..., + ): ... def FindMethodByName(self, name): ... def CopyToProto(self, proto): ... def GetOptions(self) -> ServiceOptions: ... @@ -240,6 +275,8 @@ class MethodDescriptor(DescriptorBase): containing_service, input_type, output_type, + client_streaming=..., + server_streaming=..., options=..., serialized_options=..., create_key=..., @@ -250,6 +287,8 @@ class MethodDescriptor(DescriptorBase): containing_service: Any input_type: Any output_type: Any + client_streaming: bool + server_streaming: bool def __init__( self, name, @@ -258,6 +297,8 @@ class MethodDescriptor(DescriptorBase): containing_service, input_type, output_type, + client_streaming=..., + server_streaming=..., options=..., serialized_options=..., create_key=..., diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/descriptor_pb2.pyi b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/descriptor_pb2.pyi index a3e816b9e..e37479b5c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/descriptor_pb2.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/descriptor_pb2.pyi @@ -1,35 +1,56 @@ """ @generated by mypy-protobuf. Do not edit manually! isort:skip_file +Author: kenton@google.com (Kenton Varda) + Based on original Protocol Buffers design by + Sanjay Ghemawat, Jeff Dean, and others. + +The messages in this file describe the definitions found in .proto files. +A valid .proto file can be translated directly to a FileDescriptorProto +without any other information (e.g. without reading its imports). """ import builtins +import collections.abc import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message +import sys import typing -import typing_extensions + +if sys.version_info >= (3, 10): + import typing as typing_extensions +else: + import typing_extensions DESCRIPTOR: google.protobuf.descriptor.FileDescriptor +@typing_extensions.final class FileDescriptorSet(google.protobuf.message.Message): """The protocol compiler can output a FileDescriptorSet containing the .proto files it parses. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + FILE_FIELD_NUMBER: builtins.int @property def file(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___FileDescriptorProto]: ... - def __init__(self, + def __init__( + self, *, - file: typing.Optional[typing.Iterable[global___FileDescriptorProto]] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["file",b"file"]) -> None: ... + file: collections.abc.Iterable[global___FileDescriptorProto] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["file", b"file"]) -> None: ... + global___FileDescriptorSet = FileDescriptorSet +@typing_extensions.final class FileDescriptorProto(google.protobuf.message.Message): """Describes a complete .proto file.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int PACKAGE_FIELD_NUMBER: builtins.int DEPENDENCY_FIELD_NUMBER: builtins.int @@ -42,30 +63,24 @@ class FileDescriptorProto(google.protobuf.message.Message): OPTIONS_FIELD_NUMBER: builtins.int SOURCE_CODE_INFO_FIELD_NUMBER: builtins.int SYNTAX_FIELD_NUMBER: builtins.int - name: typing.Text + name: builtins.str """file name, relative to root of source tree""" - - package: typing.Text + package: builtins.str """e.g. "foo", "foo.bar", etc.""" - @property - def dependency(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[typing.Text]: + def dependency(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: """Names of files imported by this file.""" - pass @property def public_dependency(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.int]: """Indexes of the public imported files in the dependency list above.""" - pass @property def weak_dependency(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.int]: """Indexes of the weak imported files in the dependency list. For Google-internal migration only. Do not use. """ - pass @property def message_type(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___DescriptorProto]: """All top-level definitions in this file.""" - pass @property def enum_type(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___EnumDescriptorProto]: ... @property @@ -81,77 +96,83 @@ class FileDescriptorProto(google.protobuf.message.Message): functionality of the descriptors -- the information is needed only by development tools. """ - pass - syntax: typing.Text + syntax: builtins.str """The syntax of the proto file. The supported values are "proto2" and "proto3". """ - - def __init__(self, + def __init__( + self, *, - name: typing.Optional[typing.Text] = ..., - package: typing.Optional[typing.Text] = ..., - dependency: typing.Optional[typing.Iterable[typing.Text]] = ..., - public_dependency: typing.Optional[typing.Iterable[builtins.int]] = ..., - weak_dependency: typing.Optional[typing.Iterable[builtins.int]] = ..., - message_type: typing.Optional[typing.Iterable[global___DescriptorProto]] = ..., - enum_type: typing.Optional[typing.Iterable[global___EnumDescriptorProto]] = ..., - service: typing.Optional[typing.Iterable[global___ServiceDescriptorProto]] = ..., - extension: typing.Optional[typing.Iterable[global___FieldDescriptorProto]] = ..., - options: typing.Optional[global___FileOptions] = ..., - source_code_info: typing.Optional[global___SourceCodeInfo] = ..., - syntax: typing.Optional[typing.Text] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["name",b"name","options",b"options","package",b"package","source_code_info",b"source_code_info","syntax",b"syntax"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["dependency",b"dependency","enum_type",b"enum_type","extension",b"extension","message_type",b"message_type","name",b"name","options",b"options","package",b"package","public_dependency",b"public_dependency","service",b"service","source_code_info",b"source_code_info","syntax",b"syntax","weak_dependency",b"weak_dependency"]) -> None: ... + name: builtins.str | None = ..., + package: builtins.str | None = ..., + dependency: collections.abc.Iterable[builtins.str] | None = ..., + public_dependency: collections.abc.Iterable[builtins.int] | None = ..., + weak_dependency: collections.abc.Iterable[builtins.int] | None = ..., + message_type: collections.abc.Iterable[global___DescriptorProto] | None = ..., + enum_type: collections.abc.Iterable[global___EnumDescriptorProto] | None = ..., + service: collections.abc.Iterable[global___ServiceDescriptorProto] | None = ..., + extension: collections.abc.Iterable[global___FieldDescriptorProto] | None = ..., + options: global___FileOptions | None = ..., + source_code_info: global___SourceCodeInfo | None = ..., + syntax: builtins.str | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["name", b"name", "options", b"options", "package", b"package", "source_code_info", b"source_code_info", "syntax", b"syntax"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["dependency", b"dependency", "enum_type", b"enum_type", "extension", b"extension", "message_type", b"message_type", "name", b"name", "options", b"options", "package", b"package", "public_dependency", b"public_dependency", "service", b"service", "source_code_info", b"source_code_info", "syntax", b"syntax", "weak_dependency", b"weak_dependency"]) -> None: ... + global___FileDescriptorProto = FileDescriptorProto +@typing_extensions.final class DescriptorProto(google.protobuf.message.Message): """Describes a message type.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + @typing_extensions.final class ExtensionRange(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + START_FIELD_NUMBER: builtins.int END_FIELD_NUMBER: builtins.int OPTIONS_FIELD_NUMBER: builtins.int start: builtins.int """Inclusive.""" - end: builtins.int """Exclusive.""" - @property def options(self) -> global___ExtensionRangeOptions: ... - def __init__(self, + def __init__( + self, *, - start: typing.Optional[builtins.int] = ..., - end: typing.Optional[builtins.int] = ..., - options: typing.Optional[global___ExtensionRangeOptions] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["end",b"end","options",b"options","start",b"start"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["end",b"end","options",b"options","start",b"start"]) -> None: ... + start: builtins.int | None = ..., + end: builtins.int | None = ..., + options: global___ExtensionRangeOptions | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["end", b"end", "options", b"options", "start", b"start"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["end", b"end", "options", b"options", "start", b"start"]) -> None: ... + @typing_extensions.final class ReservedRange(google.protobuf.message.Message): """Range of reserved tag numbers. Reserved tag numbers may not be used by fields or extension ranges in the same message. Reserved ranges may not overlap. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + START_FIELD_NUMBER: builtins.int END_FIELD_NUMBER: builtins.int start: builtins.int """Inclusive.""" - end: builtins.int """Exclusive.""" - - def __init__(self, + def __init__( + self, *, - start: typing.Optional[builtins.int] = ..., - end: typing.Optional[builtins.int] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["end",b"end","start",b"start"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["end",b"end","start",b"start"]) -> None: ... + start: builtins.int | None = ..., + end: builtins.int | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["end", b"end", "start", b"start"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["end", b"end", "start", b"start"]) -> None: ... NAME_FIELD_NUMBER: builtins.int FIELD_FIELD_NUMBER: builtins.int @@ -163,7 +184,7 @@ class DescriptorProto(google.protobuf.message.Message): OPTIONS_FIELD_NUMBER: builtins.int RESERVED_RANGE_FIELD_NUMBER: builtins.int RESERVED_NAME_FIELD_NUMBER: builtins.int - name: typing.Text + name: builtins.str @property def field(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___FieldDescriptorProto]: ... @property @@ -181,67 +202,72 @@ class DescriptorProto(google.protobuf.message.Message): @property def reserved_range(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___DescriptorProto.ReservedRange]: ... @property - def reserved_name(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[typing.Text]: + def reserved_name(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: """Reserved field names, which may not be used by fields in the same message. A given name may only be reserved once. """ - pass - def __init__(self, + def __init__( + self, *, - name: typing.Optional[typing.Text] = ..., - field: typing.Optional[typing.Iterable[global___FieldDescriptorProto]] = ..., - extension: typing.Optional[typing.Iterable[global___FieldDescriptorProto]] = ..., - nested_type: typing.Optional[typing.Iterable[global___DescriptorProto]] = ..., - enum_type: typing.Optional[typing.Iterable[global___EnumDescriptorProto]] = ..., - extension_range: typing.Optional[typing.Iterable[global___DescriptorProto.ExtensionRange]] = ..., - oneof_decl: typing.Optional[typing.Iterable[global___OneofDescriptorProto]] = ..., - options: typing.Optional[global___MessageOptions] = ..., - reserved_range: typing.Optional[typing.Iterable[global___DescriptorProto.ReservedRange]] = ..., - reserved_name: typing.Optional[typing.Iterable[typing.Text]] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["name",b"name","options",b"options"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["enum_type",b"enum_type","extension",b"extension","extension_range",b"extension_range","field",b"field","name",b"name","nested_type",b"nested_type","oneof_decl",b"oneof_decl","options",b"options","reserved_name",b"reserved_name","reserved_range",b"reserved_range"]) -> None: ... + name: builtins.str | None = ..., + field: collections.abc.Iterable[global___FieldDescriptorProto] | None = ..., + extension: collections.abc.Iterable[global___FieldDescriptorProto] | None = ..., + nested_type: collections.abc.Iterable[global___DescriptorProto] | None = ..., + enum_type: collections.abc.Iterable[global___EnumDescriptorProto] | None = ..., + extension_range: collections.abc.Iterable[global___DescriptorProto.ExtensionRange] | None = ..., + oneof_decl: collections.abc.Iterable[global___OneofDescriptorProto] | None = ..., + options: global___MessageOptions | None = ..., + reserved_range: collections.abc.Iterable[global___DescriptorProto.ReservedRange] | None = ..., + reserved_name: collections.abc.Iterable[builtins.str] | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["name", b"name", "options", b"options"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["enum_type", b"enum_type", "extension", b"extension", "extension_range", b"extension_range", "field", b"field", "name", b"name", "nested_type", b"nested_type", "oneof_decl", b"oneof_decl", "options", b"options", "reserved_name", b"reserved_name", "reserved_range", b"reserved_range"]) -> None: ... + global___DescriptorProto = DescriptorProto +@typing_extensions.final class ExtensionRangeOptions(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + UNINTERPRETED_OPTION_FIELD_NUMBER: builtins.int @property def uninterpreted_option(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___UninterpretedOption]: """The parser stores options it doesn't recognize here. See above.""" - pass - def __init__(self, + def __init__( + self, *, - uninterpreted_option: typing.Optional[typing.Iterable[global___UninterpretedOption]] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["uninterpreted_option",b"uninterpreted_option"]) -> None: ... + uninterpreted_option: collections.abc.Iterable[global___UninterpretedOption] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["uninterpreted_option", b"uninterpreted_option"]) -> None: ... + global___ExtensionRangeOptions = ExtensionRangeOptions +@typing_extensions.final class FieldDescriptorProto(google.protobuf.message.Message): """Describes a field within a message.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + class _Type: - ValueType = typing.NewType('ValueType', builtins.int) + ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType - class _TypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[FieldDescriptorProto._Type.ValueType], builtins.type): + + class _TypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[FieldDescriptorProto._Type.ValueType], builtins.type): # noqa: F821 DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor TYPE_DOUBLE: FieldDescriptorProto._Type.ValueType # 1 """0 is reserved for errors. Order is weird for historical reasons. """ - TYPE_FLOAT: FieldDescriptorProto._Type.ValueType # 2 TYPE_INT64: FieldDescriptorProto._Type.ValueType # 3 """Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if negative values are likely. """ - TYPE_UINT64: FieldDescriptorProto._Type.ValueType # 4 TYPE_INT32: FieldDescriptorProto._Type.ValueType # 5 """Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if negative values are likely. """ - TYPE_FIXED64: FieldDescriptorProto._Type.ValueType # 6 TYPE_FIXED32: FieldDescriptorProto._Type.ValueType # 7 TYPE_BOOL: FieldDescriptorProto._Type.ValueType # 8 @@ -252,43 +278,34 @@ class FieldDescriptorProto(google.protobuf.message.Message): implementations should still be able to parse the group wire format and treat group fields as unknown fields. """ - TYPE_MESSAGE: FieldDescriptorProto._Type.ValueType # 11 """Length-delimited aggregate.""" - TYPE_BYTES: FieldDescriptorProto._Type.ValueType # 12 """New in version 2.""" - TYPE_UINT32: FieldDescriptorProto._Type.ValueType # 13 TYPE_ENUM: FieldDescriptorProto._Type.ValueType # 14 TYPE_SFIXED32: FieldDescriptorProto._Type.ValueType # 15 TYPE_SFIXED64: FieldDescriptorProto._Type.ValueType # 16 TYPE_SINT32: FieldDescriptorProto._Type.ValueType # 17 """Uses ZigZag encoding.""" - TYPE_SINT64: FieldDescriptorProto._Type.ValueType # 18 """Uses ZigZag encoding.""" - class Type(_Type, metaclass=_TypeEnumTypeWrapper): - pass - + class Type(_Type, metaclass=_TypeEnumTypeWrapper): ... TYPE_DOUBLE: FieldDescriptorProto.Type.ValueType # 1 """0 is reserved for errors. Order is weird for historical reasons. """ - TYPE_FLOAT: FieldDescriptorProto.Type.ValueType # 2 TYPE_INT64: FieldDescriptorProto.Type.ValueType # 3 """Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if negative values are likely. """ - TYPE_UINT64: FieldDescriptorProto.Type.ValueType # 4 TYPE_INT32: FieldDescriptorProto.Type.ValueType # 5 """Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if negative values are likely. """ - TYPE_FIXED64: FieldDescriptorProto.Type.ValueType # 6 TYPE_FIXED32: FieldDescriptorProto.Type.ValueType # 7 TYPE_BOOL: FieldDescriptorProto.Type.ValueType # 8 @@ -299,40 +316,33 @@ class FieldDescriptorProto(google.protobuf.message.Message): implementations should still be able to parse the group wire format and treat group fields as unknown fields. """ - TYPE_MESSAGE: FieldDescriptorProto.Type.ValueType # 11 """Length-delimited aggregate.""" - TYPE_BYTES: FieldDescriptorProto.Type.ValueType # 12 """New in version 2.""" - TYPE_UINT32: FieldDescriptorProto.Type.ValueType # 13 TYPE_ENUM: FieldDescriptorProto.Type.ValueType # 14 TYPE_SFIXED32: FieldDescriptorProto.Type.ValueType # 15 TYPE_SFIXED64: FieldDescriptorProto.Type.ValueType # 16 TYPE_SINT32: FieldDescriptorProto.Type.ValueType # 17 """Uses ZigZag encoding.""" - TYPE_SINT64: FieldDescriptorProto.Type.ValueType # 18 """Uses ZigZag encoding.""" - class _Label: - ValueType = typing.NewType('ValueType', builtins.int) + ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType - class _LabelEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[FieldDescriptorProto._Label.ValueType], builtins.type): + + class _LabelEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[FieldDescriptorProto._Label.ValueType], builtins.type): # noqa: F821 DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor LABEL_OPTIONAL: FieldDescriptorProto._Label.ValueType # 1 """0 is reserved for errors""" - LABEL_REQUIRED: FieldDescriptorProto._Label.ValueType # 2 LABEL_REPEATED: FieldDescriptorProto._Label.ValueType # 3 - class Label(_Label, metaclass=_LabelEnumTypeWrapper): - pass + class Label(_Label, metaclass=_LabelEnumTypeWrapper): ... LABEL_OPTIONAL: FieldDescriptorProto.Label.ValueType # 1 """0 is reserved for errors""" - LABEL_REQUIRED: FieldDescriptorProto.Label.ValueType # 2 LABEL_REPEATED: FieldDescriptorProto.Label.ValueType # 3 @@ -347,47 +357,40 @@ class FieldDescriptorProto(google.protobuf.message.Message): JSON_NAME_FIELD_NUMBER: builtins.int OPTIONS_FIELD_NUMBER: builtins.int PROTO3_OPTIONAL_FIELD_NUMBER: builtins.int - name: typing.Text + name: builtins.str number: builtins.int label: global___FieldDescriptorProto.Label.ValueType type: global___FieldDescriptorProto.Type.ValueType """If type_name is set, this need not be set. If both this and type_name are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. """ - - type_name: typing.Text + type_name: builtins.str """For message and enum types, this is the name of the type. If the name starts with a '.', it is fully-qualified. Otherwise, C++-like scoping rules are used to find the type (i.e. first the nested types within this message are searched, then within the parent, on up to the root namespace). """ - - extendee: typing.Text + extendee: builtins.str """For extensions, this is the name of the type being extended. It is resolved in the same manner as type_name. """ - - default_value: typing.Text + default_value: builtins.str """For numeric types, contains the original text representation of the value. For booleans, "true" or "false". For strings, contains the default text contents (not escaped in any way). For bytes, contains the C escaped value. All bytes >= 128 are escaped. - TODO(kenton): Base-64 encode? """ - oneof_index: builtins.int """If set, gives the index of a oneof in the containing type's oneof_decl list. This field is a member of that oneof. """ - - json_name: typing.Text + json_name: builtins.str """JSON name of this field. The value is set by protocol compiler. If the user has set a "json_name" option on this field, that option's value will be used. Otherwise, it's deduced from the field's name by converting it to camelCase. """ - @property def options(self) -> global___FieldOptions: ... proto3_optional: builtins.bool @@ -413,45 +416,55 @@ class FieldDescriptorProto(google.protobuf.message.Message): Proto2 optional fields do not set this flag, because they already indicate optional with `LABEL_OPTIONAL`. """ - - def __init__(self, + def __init__( + self, *, - name: typing.Optional[typing.Text] = ..., - number: typing.Optional[builtins.int] = ..., - label: typing.Optional[global___FieldDescriptorProto.Label.ValueType] = ..., - type: typing.Optional[global___FieldDescriptorProto.Type.ValueType] = ..., - type_name: typing.Optional[typing.Text] = ..., - extendee: typing.Optional[typing.Text] = ..., - default_value: typing.Optional[typing.Text] = ..., - oneof_index: typing.Optional[builtins.int] = ..., - json_name: typing.Optional[typing.Text] = ..., - options: typing.Optional[global___FieldOptions] = ..., - proto3_optional: typing.Optional[builtins.bool] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["default_value",b"default_value","extendee",b"extendee","json_name",b"json_name","label",b"label","name",b"name","number",b"number","oneof_index",b"oneof_index","options",b"options","proto3_optional",b"proto3_optional","type",b"type","type_name",b"type_name"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["default_value",b"default_value","extendee",b"extendee","json_name",b"json_name","label",b"label","name",b"name","number",b"number","oneof_index",b"oneof_index","options",b"options","proto3_optional",b"proto3_optional","type",b"type","type_name",b"type_name"]) -> None: ... + name: builtins.str | None = ..., + number: builtins.int | None = ..., + label: global___FieldDescriptorProto.Label.ValueType | None = ..., + type: global___FieldDescriptorProto.Type.ValueType | None = ..., + type_name: builtins.str | None = ..., + extendee: builtins.str | None = ..., + default_value: builtins.str | None = ..., + oneof_index: builtins.int | None = ..., + json_name: builtins.str | None = ..., + options: global___FieldOptions | None = ..., + proto3_optional: builtins.bool | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["default_value", b"default_value", "extendee", b"extendee", "json_name", b"json_name", "label", b"label", "name", b"name", "number", b"number", "oneof_index", b"oneof_index", "options", b"options", "proto3_optional", b"proto3_optional", "type", b"type", "type_name", b"type_name"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["default_value", b"default_value", "extendee", b"extendee", "json_name", b"json_name", "label", b"label", "name", b"name", "number", b"number", "oneof_index", b"oneof_index", "options", b"options", "proto3_optional", b"proto3_optional", "type", b"type", "type_name", b"type_name"]) -> None: ... + global___FieldDescriptorProto = FieldDescriptorProto +@typing_extensions.final class OneofDescriptorProto(google.protobuf.message.Message): """Describes a oneof.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int OPTIONS_FIELD_NUMBER: builtins.int - name: typing.Text + name: builtins.str @property def options(self) -> global___OneofOptions: ... - def __init__(self, + def __init__( + self, *, - name: typing.Optional[typing.Text] = ..., - options: typing.Optional[global___OneofOptions] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["name",b"name","options",b"options"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["name",b"name","options",b"options"]) -> None: ... + name: builtins.str | None = ..., + options: global___OneofOptions | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["name", b"name", "options", b"options"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["name", b"name", "options", b"options"]) -> None: ... + global___OneofDescriptorProto = OneofDescriptorProto +@typing_extensions.final class EnumDescriptorProto(google.protobuf.message.Message): """Describes an enum type.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + @typing_extensions.final class EnumReservedRange(google.protobuf.message.Message): """Range of reserved numeric values. Reserved values may not be used by entries in the same enum. Reserved ranges may not overlap. @@ -460,29 +473,30 @@ class EnumDescriptorProto(google.protobuf.message.Message): is inclusive such that it can appropriately represent the entire int32 domain. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + START_FIELD_NUMBER: builtins.int END_FIELD_NUMBER: builtins.int start: builtins.int """Inclusive.""" - end: builtins.int """Inclusive.""" - - def __init__(self, + def __init__( + self, *, - start: typing.Optional[builtins.int] = ..., - end: typing.Optional[builtins.int] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["end",b"end","start",b"start"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["end",b"end","start",b"start"]) -> None: ... + start: builtins.int | None = ..., + end: builtins.int | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["end", b"end", "start", b"start"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["end", b"end", "start", b"start"]) -> None: ... NAME_FIELD_NUMBER: builtins.int VALUE_FIELD_NUMBER: builtins.int OPTIONS_FIELD_NUMBER: builtins.int RESERVED_RANGE_FIELD_NUMBER: builtins.int RESERVED_NAME_FIELD_NUMBER: builtins.int - name: typing.Text + name: builtins.str @property def value(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___EnumValueDescriptorProto]: ... @property @@ -493,108 +507,118 @@ class EnumDescriptorProto(google.protobuf.message.Message): by enum values in the same enum declaration. Reserved ranges may not overlap. """ - pass @property - def reserved_name(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[typing.Text]: + def reserved_name(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: """Reserved enum value names, which may not be reused. A given name may only be reserved once. """ - pass - def __init__(self, + def __init__( + self, *, - name: typing.Optional[typing.Text] = ..., - value: typing.Optional[typing.Iterable[global___EnumValueDescriptorProto]] = ..., - options: typing.Optional[global___EnumOptions] = ..., - reserved_range: typing.Optional[typing.Iterable[global___EnumDescriptorProto.EnumReservedRange]] = ..., - reserved_name: typing.Optional[typing.Iterable[typing.Text]] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["name",b"name","options",b"options"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["name",b"name","options",b"options","reserved_name",b"reserved_name","reserved_range",b"reserved_range","value",b"value"]) -> None: ... + name: builtins.str | None = ..., + value: collections.abc.Iterable[global___EnumValueDescriptorProto] | None = ..., + options: global___EnumOptions | None = ..., + reserved_range: collections.abc.Iterable[global___EnumDescriptorProto.EnumReservedRange] | None = ..., + reserved_name: collections.abc.Iterable[builtins.str] | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["name", b"name", "options", b"options"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["name", b"name", "options", b"options", "reserved_name", b"reserved_name", "reserved_range", b"reserved_range", "value", b"value"]) -> None: ... + global___EnumDescriptorProto = EnumDescriptorProto +@typing_extensions.final class EnumValueDescriptorProto(google.protobuf.message.Message): """Describes a value within an enum.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int NUMBER_FIELD_NUMBER: builtins.int OPTIONS_FIELD_NUMBER: builtins.int - name: typing.Text + name: builtins.str number: builtins.int @property def options(self) -> global___EnumValueOptions: ... - def __init__(self, + def __init__( + self, *, - name: typing.Optional[typing.Text] = ..., - number: typing.Optional[builtins.int] = ..., - options: typing.Optional[global___EnumValueOptions] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["name",b"name","number",b"number","options",b"options"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["name",b"name","number",b"number","options",b"options"]) -> None: ... + name: builtins.str | None = ..., + number: builtins.int | None = ..., + options: global___EnumValueOptions | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["name", b"name", "number", b"number", "options", b"options"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["name", b"name", "number", b"number", "options", b"options"]) -> None: ... + global___EnumValueDescriptorProto = EnumValueDescriptorProto +@typing_extensions.final class ServiceDescriptorProto(google.protobuf.message.Message): """Describes a service.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int METHOD_FIELD_NUMBER: builtins.int OPTIONS_FIELD_NUMBER: builtins.int - name: typing.Text + name: builtins.str @property def method(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___MethodDescriptorProto]: ... @property def options(self) -> global___ServiceOptions: ... - def __init__(self, + def __init__( + self, *, - name: typing.Optional[typing.Text] = ..., - method: typing.Optional[typing.Iterable[global___MethodDescriptorProto]] = ..., - options: typing.Optional[global___ServiceOptions] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["name",b"name","options",b"options"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["method",b"method","name",b"name","options",b"options"]) -> None: ... + name: builtins.str | None = ..., + method: collections.abc.Iterable[global___MethodDescriptorProto] | None = ..., + options: global___ServiceOptions | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["name", b"name", "options", b"options"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["method", b"method", "name", b"name", "options", b"options"]) -> None: ... + global___ServiceDescriptorProto = ServiceDescriptorProto +@typing_extensions.final class MethodDescriptorProto(google.protobuf.message.Message): """Describes a method of a service.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int INPUT_TYPE_FIELD_NUMBER: builtins.int OUTPUT_TYPE_FIELD_NUMBER: builtins.int OPTIONS_FIELD_NUMBER: builtins.int CLIENT_STREAMING_FIELD_NUMBER: builtins.int SERVER_STREAMING_FIELD_NUMBER: builtins.int - name: typing.Text - input_type: typing.Text + name: builtins.str + input_type: builtins.str """Input and output type names. These are resolved in the same way as FieldDescriptorProto.type_name, but must refer to a message type. """ - - output_type: typing.Text + output_type: builtins.str @property def options(self) -> global___MethodOptions: ... client_streaming: builtins.bool """Identifies if client streams multiple client messages""" - server_streaming: builtins.bool """Identifies if server streams multiple server messages""" - - def __init__(self, + def __init__( + self, *, - name: typing.Optional[typing.Text] = ..., - input_type: typing.Optional[typing.Text] = ..., - output_type: typing.Optional[typing.Text] = ..., - options: typing.Optional[global___MethodOptions] = ..., - client_streaming: typing.Optional[builtins.bool] = ..., - server_streaming: typing.Optional[builtins.bool] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["client_streaming",b"client_streaming","input_type",b"input_type","name",b"name","options",b"options","output_type",b"output_type","server_streaming",b"server_streaming"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["client_streaming",b"client_streaming","input_type",b"input_type","name",b"name","options",b"options","output_type",b"output_type","server_streaming",b"server_streaming"]) -> None: ... + name: builtins.str | None = ..., + input_type: builtins.str | None = ..., + output_type: builtins.str | None = ..., + options: global___MethodOptions | None = ..., + client_streaming: builtins.bool | None = ..., + server_streaming: builtins.bool | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["client_streaming", b"client_streaming", "input_type", b"input_type", "name", b"name", "options", b"options", "output_type", b"output_type", "server_streaming", b"server_streaming"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["client_streaming", b"client_streaming", "input_type", b"input_type", "name", b"name", "options", b"options", "output_type", b"output_type", "server_streaming", b"server_streaming"]) -> None: ... + global___MethodDescriptorProto = MethodDescriptorProto +@typing_extensions.final class FileOptions(google.protobuf.message.Message): - """=================================================================== - Options - - Each of the definitions above may have "options" attached. These are + """Each of the definitions above may have "options" attached. These are just annotations which may cause code to be generated slightly differently or may contain hints for code that manipulates protocol messages. @@ -622,41 +646,37 @@ class FileOptions(google.protobuf.message.Message): https://developers.google.com/protocol-buffers/docs/proto#options If this turns out to be popular, a web service will be set up to automatically assign option numbers. - """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + class _OptimizeMode: - ValueType = typing.NewType('ValueType', builtins.int) + ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType - class _OptimizeModeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[FileOptions._OptimizeMode.ValueType], builtins.type): + + class _OptimizeModeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[FileOptions._OptimizeMode.ValueType], builtins.type): # noqa: F821 DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor SPEED: FileOptions._OptimizeMode.ValueType # 1 """Generate complete code for parsing, serialization,""" - CODE_SIZE: FileOptions._OptimizeMode.ValueType # 2 """etc. Use ReflectionOps to implement these methods. """ - LITE_RUNTIME: FileOptions._OptimizeMode.ValueType # 3 """Generate code using MessageLite and the lite runtime.""" class OptimizeMode(_OptimizeMode, metaclass=_OptimizeModeEnumTypeWrapper): """Generated classes can be optimized for speed or code size.""" - pass SPEED: FileOptions.OptimizeMode.ValueType # 1 """Generate complete code for parsing, serialization,""" - CODE_SIZE: FileOptions.OptimizeMode.ValueType # 2 """etc. Use ReflectionOps to implement these methods. """ - LITE_RUNTIME: FileOptions.OptimizeMode.ValueType # 3 """Generate code using MessageLite and the lite runtime.""" - JAVA_PACKAGE_FIELD_NUMBER: builtins.int JAVA_OUTER_CLASSNAME_FIELD_NUMBER: builtins.int JAVA_MULTIPLE_FILES_FIELD_NUMBER: builtins.int @@ -678,21 +698,19 @@ class FileOptions(google.protobuf.message.Message): PHP_METADATA_NAMESPACE_FIELD_NUMBER: builtins.int RUBY_PACKAGE_FIELD_NUMBER: builtins.int UNINTERPRETED_OPTION_FIELD_NUMBER: builtins.int - java_package: typing.Text + java_package: builtins.str """Sets the Java package where classes generated from this .proto will be placed. By default, the proto package is used, but this is often inappropriate because proto packages do not normally start with backwards domain names. """ - - java_outer_classname: typing.Text + java_outer_classname: builtins.str """Controls the name of the wrapper Java class generated for the .proto file. That class will always contain the .proto file's getDescriptor() method as well as any top-level extensions defined in the .proto file. If java_multiple_files is disabled, then all the other classes from the .proto file will be nested inside the single wrapper outer class. """ - java_multiple_files: builtins.bool """If enabled, then the Java code generator will generate a separate .java file for each top-level message, enum, and service defined in the .proto @@ -701,10 +719,8 @@ class FileOptions(google.protobuf.message.Message): generated to contain the file's getDescriptor() method as well as any top-level extensions defined in the file. """ - java_generate_equals_and_hash: builtins.bool """This option does nothing.""" - java_string_check_utf8: builtins.bool """If set true, then the Java2 code generator will generate code that throws an exception whenever an attempt is made to assign a non-UTF-8 @@ -713,16 +729,14 @@ class FileOptions(google.protobuf.message.Message): However, an extension field still accepts non-UTF-8 byte sequences. This option has no effect on when used with the lite runtime. """ - optimize_for: global___FileOptions.OptimizeMode.ValueType - go_package: typing.Text + go_package: builtins.str """Sets the Go package where structs generated from this .proto will be placed. If omitted, the Go package will be derived from the following: - The basename of the package import path, if provided. - Otherwise, the package statement in the .proto file, if present. - Otherwise, the basename of the .proto file, without extension. """ - cc_generic_services: builtins.bool """Should generic services be generated in each language? "Generic" services are not specific to any particular RPC system. They are generated by the @@ -735,7 +749,6 @@ class FileOptions(google.protobuf.message.Message): these default to false. Old code which depends on generic services should explicitly set them to true. """ - java_generic_services: builtins.bool py_generic_services: builtins.bool php_generic_services: builtins.bool @@ -745,86 +758,80 @@ class FileOptions(google.protobuf.message.Message): for everything in the file, or it will be completely ignored; in the very least, this is a formalization for deprecating files. """ - cc_enable_arenas: builtins.bool """Enables the use of arenas for the proto messages in this file. This applies only to generated classes for C++. """ - - objc_class_prefix: typing.Text + objc_class_prefix: builtins.str """Sets the objective c class prefix which is prepended to all objective c generated classes from this .proto. There is no default. """ - - csharp_namespace: typing.Text + csharp_namespace: builtins.str """Namespace for generated classes; defaults to the package.""" - - swift_prefix: typing.Text + swift_prefix: builtins.str """By default Swift generators will take the proto package and CamelCase it replacing '.' with underscore and use that to prefix the types/symbols defined. When this options is provided, they will use this value instead to prefix the types/symbols defined. """ - - php_class_prefix: typing.Text + php_class_prefix: builtins.str """Sets the php class prefix which is prepended to all php generated classes from this .proto. Default is empty. """ - - php_namespace: typing.Text + php_namespace: builtins.str """Use this option to change the namespace of php generated classes. Default is empty. When this option is empty, the package name will be used for determining the namespace. """ - - php_metadata_namespace: typing.Text + php_metadata_namespace: builtins.str """Use this option to change the namespace of php generated metadata classes. Default is empty. When this option is empty, the proto file name will be used for determining the namespace. """ - - ruby_package: typing.Text + ruby_package: builtins.str """Use this option to change the package of ruby generated classes. Default is empty. When this option is not set, the package name will be used for determining the ruby package. """ - @property def uninterpreted_option(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___UninterpretedOption]: """The parser stores options it doesn't recognize here. See the documentation for the "Options" section above. """ - pass - def __init__(self, + def __init__( + self, *, - java_package: typing.Optional[typing.Text] = ..., - java_outer_classname: typing.Optional[typing.Text] = ..., - java_multiple_files: typing.Optional[builtins.bool] = ..., - java_generate_equals_and_hash: typing.Optional[builtins.bool] = ..., - java_string_check_utf8: typing.Optional[builtins.bool] = ..., - optimize_for: typing.Optional[global___FileOptions.OptimizeMode.ValueType] = ..., - go_package: typing.Optional[typing.Text] = ..., - cc_generic_services: typing.Optional[builtins.bool] = ..., - java_generic_services: typing.Optional[builtins.bool] = ..., - py_generic_services: typing.Optional[builtins.bool] = ..., - php_generic_services: typing.Optional[builtins.bool] = ..., - deprecated: typing.Optional[builtins.bool] = ..., - cc_enable_arenas: typing.Optional[builtins.bool] = ..., - objc_class_prefix: typing.Optional[typing.Text] = ..., - csharp_namespace: typing.Optional[typing.Text] = ..., - swift_prefix: typing.Optional[typing.Text] = ..., - php_class_prefix: typing.Optional[typing.Text] = ..., - php_namespace: typing.Optional[typing.Text] = ..., - php_metadata_namespace: typing.Optional[typing.Text] = ..., - ruby_package: typing.Optional[typing.Text] = ..., - uninterpreted_option: typing.Optional[typing.Iterable[global___UninterpretedOption]] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["cc_enable_arenas",b"cc_enable_arenas","cc_generic_services",b"cc_generic_services","csharp_namespace",b"csharp_namespace","deprecated",b"deprecated","go_package",b"go_package","java_generate_equals_and_hash",b"java_generate_equals_and_hash","java_generic_services",b"java_generic_services","java_multiple_files",b"java_multiple_files","java_outer_classname",b"java_outer_classname","java_package",b"java_package","java_string_check_utf8",b"java_string_check_utf8","objc_class_prefix",b"objc_class_prefix","optimize_for",b"optimize_for","php_class_prefix",b"php_class_prefix","php_generic_services",b"php_generic_services","php_metadata_namespace",b"php_metadata_namespace","php_namespace",b"php_namespace","py_generic_services",b"py_generic_services","ruby_package",b"ruby_package","swift_prefix",b"swift_prefix"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["cc_enable_arenas",b"cc_enable_arenas","cc_generic_services",b"cc_generic_services","csharp_namespace",b"csharp_namespace","deprecated",b"deprecated","go_package",b"go_package","java_generate_equals_and_hash",b"java_generate_equals_and_hash","java_generic_services",b"java_generic_services","java_multiple_files",b"java_multiple_files","java_outer_classname",b"java_outer_classname","java_package",b"java_package","java_string_check_utf8",b"java_string_check_utf8","objc_class_prefix",b"objc_class_prefix","optimize_for",b"optimize_for","php_class_prefix",b"php_class_prefix","php_generic_services",b"php_generic_services","php_metadata_namespace",b"php_metadata_namespace","php_namespace",b"php_namespace","py_generic_services",b"py_generic_services","ruby_package",b"ruby_package","swift_prefix",b"swift_prefix","uninterpreted_option",b"uninterpreted_option"]) -> None: ... + java_package: builtins.str | None = ..., + java_outer_classname: builtins.str | None = ..., + java_multiple_files: builtins.bool | None = ..., + java_generate_equals_and_hash: builtins.bool | None = ..., + java_string_check_utf8: builtins.bool | None = ..., + optimize_for: global___FileOptions.OptimizeMode.ValueType | None = ..., + go_package: builtins.str | None = ..., + cc_generic_services: builtins.bool | None = ..., + java_generic_services: builtins.bool | None = ..., + py_generic_services: builtins.bool | None = ..., + php_generic_services: builtins.bool | None = ..., + deprecated: builtins.bool | None = ..., + cc_enable_arenas: builtins.bool | None = ..., + objc_class_prefix: builtins.str | None = ..., + csharp_namespace: builtins.str | None = ..., + swift_prefix: builtins.str | None = ..., + php_class_prefix: builtins.str | None = ..., + php_namespace: builtins.str | None = ..., + php_metadata_namespace: builtins.str | None = ..., + ruby_package: builtins.str | None = ..., + uninterpreted_option: collections.abc.Iterable[global___UninterpretedOption] | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["cc_enable_arenas", b"cc_enable_arenas", "cc_generic_services", b"cc_generic_services", "csharp_namespace", b"csharp_namespace", "deprecated", b"deprecated", "go_package", b"go_package", "java_generate_equals_and_hash", b"java_generate_equals_and_hash", "java_generic_services", b"java_generic_services", "java_multiple_files", b"java_multiple_files", "java_outer_classname", b"java_outer_classname", "java_package", b"java_package", "java_string_check_utf8", b"java_string_check_utf8", "objc_class_prefix", b"objc_class_prefix", "optimize_for", b"optimize_for", "php_class_prefix", b"php_class_prefix", "php_generic_services", b"php_generic_services", "php_metadata_namespace", b"php_metadata_namespace", "php_namespace", b"php_namespace", "py_generic_services", b"py_generic_services", "ruby_package", b"ruby_package", "swift_prefix", b"swift_prefix"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["cc_enable_arenas", b"cc_enable_arenas", "cc_generic_services", b"cc_generic_services", "csharp_namespace", b"csharp_namespace", "deprecated", b"deprecated", "go_package", b"go_package", "java_generate_equals_and_hash", b"java_generate_equals_and_hash", "java_generic_services", b"java_generic_services", "java_multiple_files", b"java_multiple_files", "java_outer_classname", b"java_outer_classname", "java_package", b"java_package", "java_string_check_utf8", b"java_string_check_utf8", "objc_class_prefix", b"objc_class_prefix", "optimize_for", b"optimize_for", "php_class_prefix", b"php_class_prefix", "php_generic_services", b"php_generic_services", "php_metadata_namespace", b"php_metadata_namespace", "php_namespace", b"php_namespace", "py_generic_services", b"py_generic_services", "ruby_package", b"ruby_package", "swift_prefix", b"swift_prefix", "uninterpreted_option", b"uninterpreted_option"]) -> None: ... + global___FileOptions = FileOptions +@typing_extensions.final class MessageOptions(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + MESSAGE_SET_WIRE_FORMAT_FIELD_NUMBER: builtins.int NO_STANDARD_DESCRIPTOR_ACCESSOR_FIELD_NUMBER: builtins.int DEPRECATED_FIELD_NUMBER: builtins.int @@ -850,20 +857,17 @@ class MessageOptions(google.protobuf.message.Message): Because this is an option, the above two restrictions are not enforced by the protocol compiler. """ - no_standard_descriptor_accessor: builtins.bool """Disables the generation of the standard "descriptor()" accessor, which can conflict with a field of the same name. This is meant to make migration from proto1 easier; new code should avoid fields named "descriptor". """ - deprecated: builtins.bool """Is this message deprecated? Depending on the target platform, this can emit Deprecated annotations for the message, or it will be completely ignored; in the very least, this is a formalization for deprecating messages. """ - map_entry: builtins.bool """Whether the message is an automatically generated map entry type for the maps field. @@ -887,75 +891,70 @@ class MessageOptions(google.protobuf.message.Message): instead. The option should only be implicitly set by the proto compiler parser. """ - @property def uninterpreted_option(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___UninterpretedOption]: """The parser stores options it doesn't recognize here. See above.""" - pass - def __init__(self, + def __init__( + self, *, - message_set_wire_format: typing.Optional[builtins.bool] = ..., - no_standard_descriptor_accessor: typing.Optional[builtins.bool] = ..., - deprecated: typing.Optional[builtins.bool] = ..., - map_entry: typing.Optional[builtins.bool] = ..., - uninterpreted_option: typing.Optional[typing.Iterable[global___UninterpretedOption]] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["deprecated",b"deprecated","map_entry",b"map_entry","message_set_wire_format",b"message_set_wire_format","no_standard_descriptor_accessor",b"no_standard_descriptor_accessor"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["deprecated",b"deprecated","map_entry",b"map_entry","message_set_wire_format",b"message_set_wire_format","no_standard_descriptor_accessor",b"no_standard_descriptor_accessor","uninterpreted_option",b"uninterpreted_option"]) -> None: ... + message_set_wire_format: builtins.bool | None = ..., + no_standard_descriptor_accessor: builtins.bool | None = ..., + deprecated: builtins.bool | None = ..., + map_entry: builtins.bool | None = ..., + uninterpreted_option: collections.abc.Iterable[global___UninterpretedOption] | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["deprecated", b"deprecated", "map_entry", b"map_entry", "message_set_wire_format", b"message_set_wire_format", "no_standard_descriptor_accessor", b"no_standard_descriptor_accessor"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["deprecated", b"deprecated", "map_entry", b"map_entry", "message_set_wire_format", b"message_set_wire_format", "no_standard_descriptor_accessor", b"no_standard_descriptor_accessor", "uninterpreted_option", b"uninterpreted_option"]) -> None: ... + global___MessageOptions = MessageOptions +@typing_extensions.final class FieldOptions(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + class _CType: - ValueType = typing.NewType('ValueType', builtins.int) + ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType - class _CTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[FieldOptions._CType.ValueType], builtins.type): + + class _CTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[FieldOptions._CType.ValueType], builtins.type): # noqa: F821 DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor STRING: FieldOptions._CType.ValueType # 0 """Default mode.""" - CORD: FieldOptions._CType.ValueType # 1 STRING_PIECE: FieldOptions._CType.ValueType # 2 - class CType(_CType, metaclass=_CTypeEnumTypeWrapper): - pass + class CType(_CType, metaclass=_CTypeEnumTypeWrapper): ... STRING: FieldOptions.CType.ValueType # 0 """Default mode.""" - CORD: FieldOptions.CType.ValueType # 1 STRING_PIECE: FieldOptions.CType.ValueType # 2 class _JSType: - ValueType = typing.NewType('ValueType', builtins.int) + ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType - class _JSTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[FieldOptions._JSType.ValueType], builtins.type): + + class _JSTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[FieldOptions._JSType.ValueType], builtins.type): # noqa: F821 DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor JS_NORMAL: FieldOptions._JSType.ValueType # 0 """Use the default type.""" - JS_STRING: FieldOptions._JSType.ValueType # 1 """Use JavaScript strings.""" - JS_NUMBER: FieldOptions._JSType.ValueType # 2 """Use JavaScript numbers.""" - class JSType(_JSType, metaclass=_JSTypeEnumTypeWrapper): - pass - + class JSType(_JSType, metaclass=_JSTypeEnumTypeWrapper): ... JS_NORMAL: FieldOptions.JSType.ValueType # 0 """Use the default type.""" - JS_STRING: FieldOptions.JSType.ValueType # 1 """Use JavaScript strings.""" - JS_NUMBER: FieldOptions.JSType.ValueType # 2 """Use JavaScript numbers.""" - CTYPE_FIELD_NUMBER: builtins.int PACKED_FIELD_NUMBER: builtins.int JSTYPE_FIELD_NUMBER: builtins.int LAZY_FIELD_NUMBER: builtins.int + UNVERIFIED_LAZY_FIELD_NUMBER: builtins.int DEPRECATED_FIELD_NUMBER: builtins.int WEAK_FIELD_NUMBER: builtins.int UNINTERPRETED_OPTION_FIELD_NUMBER: builtins.int @@ -965,7 +964,6 @@ class FieldOptions(google.protobuf.message.Message): options below. This option is not yet implemented in the open source release -- sorry, we'll try to include it in a future version! """ - packed: builtins.bool """The packed option can be enabled for repeated primitive fields to enable a more efficient representation on the wire. Rather than repeatedly @@ -973,7 +971,6 @@ class FieldOptions(google.protobuf.message.Message): a single length-delimited blob. In proto3, only explicit setting it to false will avoid using packed encoding. """ - jstype: global___FieldOptions.JSType.ValueType """The jstype option determines the JavaScript type used for values of the field. The option is permitted only for 64 bit integral and fixed types @@ -987,7 +984,6 @@ class FieldOptions(google.protobuf.message.Message): This option is an enum to permit additional types to be added, e.g. goog.math.Integer. """ - lazy: builtins.bool """Should this field be parsed lazily? Lazy applies only to message-type fields. It means that when the outer message is initially parsed, the @@ -1017,52 +1013,67 @@ class FieldOptions(google.protobuf.message.Message): implementation must either *always* check its required fields, or *never* check its required fields, regardless of whether or not the message has been parsed. - """ + As of 2021, lazy does no correctness checks on the byte stream during + parsing. This may lead to crashes if and when an invalid byte stream is + finally parsed upon access. + + TODO(b/211906113): Enable validation on lazy fields. + """ + unverified_lazy: builtins.bool + """unverified_lazy does no correctness checks on the byte stream. This should + only be used where lazy with verification is prohibitive for performance + reasons. + """ deprecated: builtins.bool """Is this field deprecated? Depending on the target platform, this can emit Deprecated annotations for accessors, or it will be completely ignored; in the very least, this is a formalization for deprecating fields. """ - weak: builtins.bool """For Google-internal migration only. Do not use.""" - @property def uninterpreted_option(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___UninterpretedOption]: """The parser stores options it doesn't recognize here. See above.""" - pass - def __init__(self, + def __init__( + self, *, - ctype: typing.Optional[global___FieldOptions.CType.ValueType] = ..., - packed: typing.Optional[builtins.bool] = ..., - jstype: typing.Optional[global___FieldOptions.JSType.ValueType] = ..., - lazy: typing.Optional[builtins.bool] = ..., - deprecated: typing.Optional[builtins.bool] = ..., - weak: typing.Optional[builtins.bool] = ..., - uninterpreted_option: typing.Optional[typing.Iterable[global___UninterpretedOption]] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["ctype",b"ctype","deprecated",b"deprecated","jstype",b"jstype","lazy",b"lazy","packed",b"packed","weak",b"weak"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["ctype",b"ctype","deprecated",b"deprecated","jstype",b"jstype","lazy",b"lazy","packed",b"packed","uninterpreted_option",b"uninterpreted_option","weak",b"weak"]) -> None: ... + ctype: global___FieldOptions.CType.ValueType | None = ..., + packed: builtins.bool | None = ..., + jstype: global___FieldOptions.JSType.ValueType | None = ..., + lazy: builtins.bool | None = ..., + unverified_lazy: builtins.bool | None = ..., + deprecated: builtins.bool | None = ..., + weak: builtins.bool | None = ..., + uninterpreted_option: collections.abc.Iterable[global___UninterpretedOption] | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["ctype", b"ctype", "deprecated", b"deprecated", "jstype", b"jstype", "lazy", b"lazy", "packed", b"packed", "unverified_lazy", b"unverified_lazy", "weak", b"weak"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["ctype", b"ctype", "deprecated", b"deprecated", "jstype", b"jstype", "lazy", b"lazy", "packed", b"packed", "uninterpreted_option", b"uninterpreted_option", "unverified_lazy", b"unverified_lazy", "weak", b"weak"]) -> None: ... + global___FieldOptions = FieldOptions +@typing_extensions.final class OneofOptions(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + UNINTERPRETED_OPTION_FIELD_NUMBER: builtins.int @property def uninterpreted_option(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___UninterpretedOption]: """The parser stores options it doesn't recognize here. See above.""" - pass - def __init__(self, + def __init__( + self, *, - uninterpreted_option: typing.Optional[typing.Iterable[global___UninterpretedOption]] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["uninterpreted_option",b"uninterpreted_option"]) -> None: ... + uninterpreted_option: collections.abc.Iterable[global___UninterpretedOption] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["uninterpreted_option", b"uninterpreted_option"]) -> None: ... + global___OneofOptions = OneofOptions +@typing_extensions.final class EnumOptions(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + ALLOW_ALIAS_FIELD_NUMBER: builtins.int DEPRECATED_FIELD_NUMBER: builtins.int UNINTERPRETED_OPTION_FIELD_NUMBER: builtins.int @@ -1070,30 +1081,31 @@ class EnumOptions(google.protobuf.message.Message): """Set this option to true to allow mapping different tag names to the same value. """ - deprecated: builtins.bool """Is this enum deprecated? Depending on the target platform, this can emit Deprecated annotations for the enum, or it will be completely ignored; in the very least, this is a formalization for deprecating enums. """ - @property def uninterpreted_option(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___UninterpretedOption]: """The parser stores options it doesn't recognize here. See above.""" - pass - def __init__(self, + def __init__( + self, *, - allow_alias: typing.Optional[builtins.bool] = ..., - deprecated: typing.Optional[builtins.bool] = ..., - uninterpreted_option: typing.Optional[typing.Iterable[global___UninterpretedOption]] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["allow_alias",b"allow_alias","deprecated",b"deprecated"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["allow_alias",b"allow_alias","deprecated",b"deprecated","uninterpreted_option",b"uninterpreted_option"]) -> None: ... + allow_alias: builtins.bool | None = ..., + deprecated: builtins.bool | None = ..., + uninterpreted_option: collections.abc.Iterable[global___UninterpretedOption] | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["allow_alias", b"allow_alias", "deprecated", b"deprecated"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["allow_alias", b"allow_alias", "deprecated", b"deprecated", "uninterpreted_option", b"uninterpreted_option"]) -> None: ... + global___EnumOptions = EnumOptions +@typing_extensions.final class EnumValueOptions(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + DEPRECATED_FIELD_NUMBER: builtins.int UNINTERPRETED_OPTION_FIELD_NUMBER: builtins.int deprecated: builtins.bool @@ -1102,22 +1114,24 @@ class EnumValueOptions(google.protobuf.message.Message): for the enum value, or it will be completely ignored; in the very least, this is a formalization for deprecating enum values. """ - @property def uninterpreted_option(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___UninterpretedOption]: """The parser stores options it doesn't recognize here. See above.""" - pass - def __init__(self, + def __init__( + self, *, - deprecated: typing.Optional[builtins.bool] = ..., - uninterpreted_option: typing.Optional[typing.Iterable[global___UninterpretedOption]] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["deprecated",b"deprecated"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["deprecated",b"deprecated","uninterpreted_option",b"uninterpreted_option"]) -> None: ... + deprecated: builtins.bool | None = ..., + uninterpreted_option: collections.abc.Iterable[global___UninterpretedOption] | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["deprecated", b"deprecated"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["deprecated", b"deprecated", "uninterpreted_option", b"uninterpreted_option"]) -> None: ... + global___EnumValueOptions = EnumValueOptions +@typing_extensions.final class ServiceOptions(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + DEPRECATED_FIELD_NUMBER: builtins.int UNINTERPRETED_OPTION_FIELD_NUMBER: builtins.int deprecated: builtins.bool @@ -1131,31 +1145,33 @@ class ServiceOptions(google.protobuf.message.Message): for the service, or it will be completely ignored; in the very least, this is a formalization for deprecating services. """ - @property def uninterpreted_option(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___UninterpretedOption]: """The parser stores options it doesn't recognize here. See above.""" - pass - def __init__(self, + def __init__( + self, *, - deprecated: typing.Optional[builtins.bool] = ..., - uninterpreted_option: typing.Optional[typing.Iterable[global___UninterpretedOption]] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["deprecated",b"deprecated"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["deprecated",b"deprecated","uninterpreted_option",b"uninterpreted_option"]) -> None: ... + deprecated: builtins.bool | None = ..., + uninterpreted_option: collections.abc.Iterable[global___UninterpretedOption] | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["deprecated", b"deprecated"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["deprecated", b"deprecated", "uninterpreted_option", b"uninterpreted_option"]) -> None: ... + global___ServiceOptions = ServiceOptions +@typing_extensions.final class MethodOptions(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + class _IdempotencyLevel: - ValueType = typing.NewType('ValueType', builtins.int) + ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType - class _IdempotencyLevelEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[MethodOptions._IdempotencyLevel.ValueType], builtins.type): + + class _IdempotencyLevelEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[MethodOptions._IdempotencyLevel.ValueType], builtins.type): # noqa: F821 DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor IDEMPOTENCY_UNKNOWN: MethodOptions._IdempotencyLevel.ValueType # 0 NO_SIDE_EFFECTS: MethodOptions._IdempotencyLevel.ValueType # 1 """implies idempotent""" - IDEMPOTENT: MethodOptions._IdempotencyLevel.ValueType # 2 """idempotent, but may have side effects""" @@ -1164,16 +1180,13 @@ class MethodOptions(google.protobuf.message.Message): or neither? HTTP based RPC implementation may choose GET verb for safe methods, and PUT verb for idempotent methods instead of the default POST. """ - pass IDEMPOTENCY_UNKNOWN: MethodOptions.IdempotencyLevel.ValueType # 0 NO_SIDE_EFFECTS: MethodOptions.IdempotencyLevel.ValueType # 1 """implies idempotent""" - IDEMPOTENT: MethodOptions.IdempotencyLevel.ValueType # 2 """idempotent, but may have side effects""" - DEPRECATED_FIELD_NUMBER: builtins.int IDEMPOTENCY_LEVEL_FIELD_NUMBER: builtins.int UNINTERPRETED_OPTION_FIELD_NUMBER: builtins.int @@ -1188,22 +1201,23 @@ class MethodOptions(google.protobuf.message.Message): for the method, or it will be completely ignored; in the very least, this is a formalization for deprecating methods. """ - idempotency_level: global___MethodOptions.IdempotencyLevel.ValueType @property def uninterpreted_option(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___UninterpretedOption]: """The parser stores options it doesn't recognize here. See above.""" - pass - def __init__(self, + def __init__( + self, *, - deprecated: typing.Optional[builtins.bool] = ..., - idempotency_level: typing.Optional[global___MethodOptions.IdempotencyLevel.ValueType] = ..., - uninterpreted_option: typing.Optional[typing.Iterable[global___UninterpretedOption]] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["deprecated",b"deprecated","idempotency_level",b"idempotency_level"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["deprecated",b"deprecated","idempotency_level",b"idempotency_level","uninterpreted_option",b"uninterpreted_option"]) -> None: ... + deprecated: builtins.bool | None = ..., + idempotency_level: global___MethodOptions.IdempotencyLevel.ValueType | None = ..., + uninterpreted_option: collections.abc.Iterable[global___UninterpretedOption] | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["deprecated", b"deprecated", "idempotency_level", b"idempotency_level"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["deprecated", b"deprecated", "idempotency_level", b"idempotency_level", "uninterpreted_option", b"uninterpreted_option"]) -> None: ... + global___MethodOptions = MethodOptions +@typing_extensions.final class UninterpretedOption(google.protobuf.message.Message): """A message representing a option the parser does not recognize. This only appears in options protos created by the compiler::Parser class. @@ -1212,26 +1226,32 @@ class UninterpretedOption(google.protobuf.message.Message): or produced by Descriptor::CopyTo()) will never have UninterpretedOptions in them. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + @typing_extensions.final class NamePart(google.protobuf.message.Message): """The name of the uninterpreted option. Each string represents a segment in a dot-separated name. is_extension is true iff a segment represents an extension (denoted with parentheses in options specs in .proto files). - E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents - "foo.(bar.baz).qux". + E.g.,{ ["foo", false], ["bar.baz", true], ["moo", false] } represents + "foo.(bar.baz).moo". """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_PART_FIELD_NUMBER: builtins.int IS_EXTENSION_FIELD_NUMBER: builtins.int - name_part: typing.Text + name_part: builtins.str is_extension: builtins.bool - def __init__(self, + def __init__( + self, *, - name_part: typing.Optional[typing.Text] = ..., - is_extension: typing.Optional[builtins.bool] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["is_extension",b"is_extension","name_part",b"name_part"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["is_extension",b"is_extension","name_part",b"name_part"]) -> None: ... + name_part: builtins.str | None = ..., + is_extension: builtins.bool | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["is_extension", b"is_extension", "name_part", b"name_part"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["is_extension", b"is_extension", "name_part", b"name_part"]) -> None: ... NAME_FIELD_NUMBER: builtins.int IDENTIFIER_VALUE_FIELD_NUMBER: builtins.int @@ -1242,30 +1262,32 @@ class UninterpretedOption(google.protobuf.message.Message): AGGREGATE_VALUE_FIELD_NUMBER: builtins.int @property def name(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___UninterpretedOption.NamePart]: ... - identifier_value: typing.Text + identifier_value: builtins.str """The value of the uninterpreted option, in whatever type the tokenizer identified it as during parsing. Exactly one of these should be set. """ - positive_int_value: builtins.int negative_int_value: builtins.int double_value: builtins.float string_value: builtins.bytes - aggregate_value: typing.Text - def __init__(self, + aggregate_value: builtins.str + def __init__( + self, *, - name: typing.Optional[typing.Iterable[global___UninterpretedOption.NamePart]] = ..., - identifier_value: typing.Optional[typing.Text] = ..., - positive_int_value: typing.Optional[builtins.int] = ..., - negative_int_value: typing.Optional[builtins.int] = ..., - double_value: typing.Optional[builtins.float] = ..., - string_value: typing.Optional[builtins.bytes] = ..., - aggregate_value: typing.Optional[typing.Text] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["aggregate_value",b"aggregate_value","double_value",b"double_value","identifier_value",b"identifier_value","negative_int_value",b"negative_int_value","positive_int_value",b"positive_int_value","string_value",b"string_value"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["aggregate_value",b"aggregate_value","double_value",b"double_value","identifier_value",b"identifier_value","name",b"name","negative_int_value",b"negative_int_value","positive_int_value",b"positive_int_value","string_value",b"string_value"]) -> None: ... + name: collections.abc.Iterable[global___UninterpretedOption.NamePart] | None = ..., + identifier_value: builtins.str | None = ..., + positive_int_value: builtins.int | None = ..., + negative_int_value: builtins.int | None = ..., + double_value: builtins.float | None = ..., + string_value: builtins.bytes | None = ..., + aggregate_value: builtins.str | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["aggregate_value", b"aggregate_value", "double_value", b"double_value", "identifier_value", b"identifier_value", "negative_int_value", b"negative_int_value", "positive_int_value", b"positive_int_value", "string_value", b"string_value"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["aggregate_value", b"aggregate_value", "double_value", b"double_value", "identifier_value", b"identifier_value", "name", b"name", "negative_int_value", b"negative_int_value", "positive_int_value", b"positive_int_value", "string_value", b"string_value"]) -> None: ... + global___UninterpretedOption = UninterpretedOption +@typing_extensions.final class SourceCodeInfo(google.protobuf.message.Message): """=================================================================== Optional source code info @@ -1273,9 +1295,13 @@ class SourceCodeInfo(google.protobuf.message.Message): Encapsulates information about the original source file from which a FileDescriptorProto was generated. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + @typing_extensions.final class Location(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + PATH_FIELD_NUMBER: builtins.int SPAN_FIELD_NUMBER: builtins.int LEADING_COMMENTS_FIELD_NUMBER: builtins.int @@ -1287,8 +1313,8 @@ class SourceCodeInfo(google.protobuf.message.Message): location. Each element is a field number or an index. They form a path from - the root FileDescriptorProto to the place where the definition. For - example, this path: + the root FileDescriptorProto to the place where the definition occurs. + For example, this path: [ 4, 3, 2, 7, 1 ] refers to: file.message_type(3) // 4, 3 @@ -1307,7 +1333,6 @@ class SourceCodeInfo(google.protobuf.message.Message): this path refers to the whole field declaration (from the beginning of the label to the terminating semicolon). """ - pass @property def span(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.int]: """Always has exactly three or four elements: start line, start column, @@ -1316,8 +1341,7 @@ class SourceCodeInfo(google.protobuf.message.Message): and column numbers are zero-based -- typically you will want to add 1 to each before displaying to a user. """ - pass - leading_comments: typing.Text + leading_comments: builtins.str """If this SourceCodeInfo represents a complete declaration, these are any comments appearing before and after the declaration which appear to be attached to the declaration. @@ -1345,13 +1369,13 @@ class SourceCodeInfo(google.protobuf.message.Message): // Comment attached to baz. // Another line attached to baz. - // Comment attached to qux. + // Comment attached to moo. // - // Another line attached to qux. - optional double qux = 4; + // Another line attached to moo. + optional double moo = 4; // Detached comment for corge. This is not leading or trailing comments - // to qux or corge because there are blank lines separating it from + // to moo or corge because there are blank lines separating it from // both. // Detached comment for corge paragraph 2. @@ -1366,20 +1390,20 @@ class SourceCodeInfo(google.protobuf.message.Message): // ignored detached comments. """ - - trailing_comments: typing.Text + trailing_comments: builtins.str @property - def leading_detached_comments(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[typing.Text]: ... - def __init__(self, + def leading_detached_comments(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: ... + def __init__( + self, *, - path: typing.Optional[typing.Iterable[builtins.int]] = ..., - span: typing.Optional[typing.Iterable[builtins.int]] = ..., - leading_comments: typing.Optional[typing.Text] = ..., - trailing_comments: typing.Optional[typing.Text] = ..., - leading_detached_comments: typing.Optional[typing.Iterable[typing.Text]] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["leading_comments",b"leading_comments","trailing_comments",b"trailing_comments"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["leading_comments",b"leading_comments","leading_detached_comments",b"leading_detached_comments","path",b"path","span",b"span","trailing_comments",b"trailing_comments"]) -> None: ... + path: collections.abc.Iterable[builtins.int] | None = ..., + span: collections.abc.Iterable[builtins.int] | None = ..., + leading_comments: builtins.str | None = ..., + trailing_comments: builtins.str | None = ..., + leading_detached_comments: collections.abc.Iterable[builtins.str] | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["leading_comments", b"leading_comments", "trailing_comments", b"trailing_comments"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["leading_comments", b"leading_comments", "leading_detached_comments", b"leading_detached_comments", "path", b"path", "span", b"span", "trailing_comments", b"trailing_comments"]) -> None: ... LOCATION_FIELD_NUMBER: builtins.int @property @@ -1428,22 +1452,28 @@ class SourceCodeInfo(google.protobuf.message.Message): ignore those that it doesn't understand, as more types of locations could be recorded in the future. """ - pass - def __init__(self, + def __init__( + self, *, - location: typing.Optional[typing.Iterable[global___SourceCodeInfo.Location]] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["location",b"location"]) -> None: ... + location: collections.abc.Iterable[global___SourceCodeInfo.Location] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["location", b"location"]) -> None: ... + global___SourceCodeInfo = SourceCodeInfo +@typing_extensions.final class GeneratedCodeInfo(google.protobuf.message.Message): """Describes the relationship between generated code and its original source file. A GeneratedCodeInfo message is associated with only one generated source file, but may contain references to different source .proto files. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + @typing_extensions.final class Annotation(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + PATH_FIELD_NUMBER: builtins.int SOURCE_FILE_FIELD_NUMBER: builtins.int BEGIN_FIELD_NUMBER: builtins.int @@ -1453,30 +1483,27 @@ class GeneratedCodeInfo(google.protobuf.message.Message): """Identifies the element in the original source .proto file. This field is formatted the same as SourceCodeInfo.Location.path. """ - pass - source_file: typing.Text + source_file: builtins.str """Identifies the filesystem path to the original source .proto.""" - begin: builtins.int """Identifies the starting offset in bytes in the generated code that relates to the identified object. """ - end: builtins.int """Identifies the ending offset in bytes in the generated code that relates to the identified offset. The end offset should be one past the last relevant byte (so the length of the text = end - begin). """ - - def __init__(self, + def __init__( + self, *, - path: typing.Optional[typing.Iterable[builtins.int]] = ..., - source_file: typing.Optional[typing.Text] = ..., - begin: typing.Optional[builtins.int] = ..., - end: typing.Optional[builtins.int] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["begin",b"begin","end",b"end","source_file",b"source_file"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["begin",b"begin","end",b"end","path",b"path","source_file",b"source_file"]) -> None: ... + path: collections.abc.Iterable[builtins.int] | None = ..., + source_file: builtins.str | None = ..., + begin: builtins.int | None = ..., + end: builtins.int | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["begin", b"begin", "end", b"end", "source_file", b"source_file"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["begin", b"begin", "end", b"end", "path", b"path", "source_file", b"source_file"]) -> None: ... ANNOTATION_FIELD_NUMBER: builtins.int @property @@ -1484,10 +1511,11 @@ class GeneratedCodeInfo(google.protobuf.message.Message): """An Annotation connects some span of text in generated code to an element of its generating .proto file. """ - pass - def __init__(self, + def __init__( + self, *, - annotation: typing.Optional[typing.Iterable[global___GeneratedCodeInfo.Annotation]] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["annotation",b"annotation"]) -> None: ... + annotation: collections.abc.Iterable[global___GeneratedCodeInfo.Annotation] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["annotation", b"annotation"]) -> None: ... + global___GeneratedCodeInfo = GeneratedCodeInfo diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/descriptor_pool.pyi b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/descriptor_pool.pyi index f1ecee776..25939e479 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/descriptor_pool.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/descriptor_pool.pyi @@ -1,8 +1,10 @@ -from typing import Any +from _typeshed import Incomplete class DescriptorPool: - def __new__(cls, descriptor_db: Any | None = ...): ... - def __init__(self, descriptor_db: Any | None = ...) -> None: ... + def __new__(cls, descriptor_db: Incomplete | None = ...): ... + def __init__( # pyright: ignore[reportInconsistentConstructor] + self, descriptor_db: Incomplete | None = ..., use_deprecated_legacy_json_field_conflicts: bool = ... + ) -> None: ... def Add(self, file_desc_proto): ... def AddSerializedFile(self, serialized_file_desc_proto): ... def AddDescriptor(self, desc): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/duration_pb2.pyi b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/duration_pb2.pyi index 07e905033..d8f7931a7 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/duration_pb2.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/duration_pb2.pyi @@ -1,16 +1,50 @@ """ @generated by mypy-protobuf. Do not edit manually! isort:skip_file +Protocol Buffers - Google's data interchange format +Copyright 2008 Google Inc. All rights reserved. +https://developers.google.com/protocol-buffers/ + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ import builtins import google.protobuf.descriptor import google.protobuf.internal.well_known_types import google.protobuf.message -import typing -import typing_extensions +import sys + +if sys.version_info >= (3, 8): + import typing as typing_extensions +else: + import typing_extensions DESCRIPTOR: google.protobuf.descriptor.FileDescriptor +@typing_extensions.final class Duration(google.protobuf.message.Message, google.protobuf.internal.well_known_types.Duration): """A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond @@ -71,7 +105,9 @@ class Duration(google.protobuf.message.Message, google.protobuf.internal.well_kn be expressed in JSON format as "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON format as "3.000001s". """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + SECONDS_FIELD_NUMBER: builtins.int NANOS_FIELD_NUMBER: builtins.int seconds: builtins.int @@ -79,7 +115,6 @@ class Duration(google.protobuf.message.Message, google.protobuf.internal.well_kn to +315,576,000,000 inclusive. Note: these bounds are computed from: 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years """ - nanos: builtins.int """Signed fractions of a second at nanosecond resolution of the span of time. Durations less than one second are represented with a 0 @@ -88,11 +123,12 @@ class Duration(google.protobuf.message.Message, google.protobuf.internal.well_kn of the same sign as the `seconds` field. Must be from -999,999,999 to +999,999,999 inclusive. """ - - def __init__(self, + def __init__( + self, *, - seconds: typing.Optional[builtins.int] = ..., - nanos: typing.Optional[builtins.int] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["nanos",b"nanos","seconds",b"seconds"]) -> None: ... + seconds: builtins.int | None = ..., + nanos: builtins.int | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["nanos", b"nanos", "seconds", b"seconds"]) -> None: ... + global___Duration = Duration diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/empty_pb2.pyi b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/empty_pb2.pyi index 6615bb960..22ef26b7d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/empty_pb2.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/empty_pb2.pyi @@ -1,12 +1,48 @@ """ @generated by mypy-protobuf. Do not edit manually! isort:skip_file +Protocol Buffers - Google's data interchange format +Copyright 2008 Google Inc. All rights reserved. +https://developers.google.com/protocol-buffers/ + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ import google.protobuf.descriptor import google.protobuf.message +import sys + +if sys.version_info >= (3, 8): + import typing as typing_extensions +else: + import typing_extensions DESCRIPTOR: google.protobuf.descriptor.FileDescriptor +@typing_extensions.final class Empty(google.protobuf.message.Message): """A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request @@ -15,10 +51,12 @@ class Empty(google.protobuf.message.Message): service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } - - The JSON representation for `Empty` is empty JSON object `{}`. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor - def __init__(self, - ) -> None: ... + + def __init__( + self, + ) -> None: ... + global___Empty = Empty diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/field_mask_pb2.pyi b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/field_mask_pb2.pyi index c14cfe6ab..1721c1bc6 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/field_mask_pb2.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/field_mask_pb2.pyi @@ -1,17 +1,52 @@ """ @generated by mypy-protobuf. Do not edit manually! isort:skip_file +Protocol Buffers - Google's data interchange format +Copyright 2008 Google Inc. All rights reserved. +https://developers.google.com/protocol-buffers/ + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ import builtins +import collections.abc import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.well_known_types import google.protobuf.message -import typing -import typing_extensions +import sys + +if sys.version_info >= (3, 8): + import typing as typing_extensions +else: + import typing_extensions DESCRIPTOR: google.protobuf.descriptor.FileDescriptor +@typing_extensions.final class FieldMask(google.protobuf.message.Message, google.protobuf.internal.well_known_types.FieldMask): """`FieldMask` represents a set of symbolic field paths, for example: @@ -213,15 +248,18 @@ class FieldMask(google.protobuf.message.Message, google.protobuf.internal.well_k request should verify the included field paths, and return an `INVALID_ARGUMENT` error if any path is unmappable. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + PATHS_FIELD_NUMBER: builtins.int @property - def paths(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[typing.Text]: + def paths(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: """The set of field mask paths.""" - pass - def __init__(self, + def __init__( + self, *, - paths: typing.Optional[typing.Iterable[typing.Text]] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["paths",b"paths"]) -> None: ... + paths: collections.abc.Iterable[builtins.str] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["paths", b"paths"]) -> None: ... + global___FieldMask = FieldMask diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/containers.pyi b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/containers.pyi index 72184e3bc..80da52a6b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/containers.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/containers.pyi @@ -10,7 +10,7 @@ from google.protobuf.message import Message _T = TypeVar("_T") _K = TypeVar("_K", bound=bool | int | str) -_ScalarV = TypeVar("_ScalarV", bound=bool | float | str | bytes) +_ScalarV = TypeVar("_ScalarV", bound=bool | int | float | str | bytes) _MessageV = TypeVar("_MessageV", bound=Message) _M = TypeVar("_M") @@ -37,10 +37,7 @@ class RepeatedScalarFieldContainer(BaseContainer[_ScalarV]): def __setitem__(self, key: int, value: _ScalarV) -> None: ... @overload def __setitem__(self, key: slice, value: Iterable[_ScalarV]) -> None: ... - def __getslice__(self, start: int, stop: int) -> list[_ScalarV]: ... - def __setslice__(self, start: int, stop: int, values: Iterable[_ScalarV]) -> None: ... def __delitem__(self, key: int | slice) -> None: ... - def __delslice__(self, start: int, stop: int) -> None: ... def __eq__(self, other: object) -> bool: ... class RepeatedCompositeFieldContainer(BaseContainer[_MessageV]): @@ -52,9 +49,7 @@ class RepeatedCompositeFieldContainer(BaseContainer[_MessageV]): def MergeFrom(self: _M, other: _M) -> None: ... def remove(self, elem: _MessageV) -> None: ... def pop(self, key: int = ...) -> _MessageV: ... - def __getslice__(self, start: int, stop: int) -> list[_MessageV]: ... def __delitem__(self, key: int | slice) -> None: ... - def __delslice__(self, start: int, stop: int) -> None: ... def __eq__(self, other: object) -> bool: ... class ScalarMap(MutableMapping[_K, _ScalarV]): diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/well_known_types.pyi b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/well_known_types.pyi index 1f00ecf29..f0e17309d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/well_known_types.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/well_known_types.pyi @@ -1,13 +1,18 @@ -from datetime import datetime, timedelta +from _typeshed import Incomplete, SupportsItems +from collections.abc import Iterable, Iterator, KeysView, Mapping, Sequence +from datetime import datetime, timedelta, tzinfo from typing import Any as tAny +from typing_extensions import TypeAlias + +from google.protobuf import struct_pb2 class Any: type_url: tAny = ... value: tAny = ... - def Pack(self, msg: tAny, type_url_prefix: str = ..., deterministic: tAny | None = ...) -> None: ... - def Unpack(self, msg: tAny): ... - def TypeName(self): ... - def Is(self, descriptor: tAny): ... + def Pack(self, msg: tAny, type_url_prefix: str = ..., deterministic: Incomplete | None = ...) -> None: ... + def Unpack(self, msg: tAny) -> bool: ... + def TypeName(self) -> str: ... + def Is(self, descriptor: tAny) -> bool: ... class Timestamp: def ToJsonString(self) -> str: ... @@ -23,7 +28,7 @@ class Timestamp: def FromMicroseconds(self, micros: int) -> None: ... def FromMilliseconds(self, millis: int) -> None: ... def FromSeconds(self, seconds: int) -> None: ... - def ToDatetime(self) -> datetime: ... + def ToDatetime(self, tzinfo: tzinfo | None = ...) -> datetime: ... def FromDatetime(self, dt: datetime) -> None: ... class Duration: @@ -55,7 +60,7 @@ class FieldMask: ) -> None: ... class _FieldMaskTree: - def __init__(self, field_mask: tAny | None = ...) -> None: ... + def __init__(self, field_mask: Incomplete | None = ...) -> None: ... def MergeFromFieldMask(self, field_mask: tAny) -> None: ... def AddPath(self, path: tAny): ... def ToFieldMask(self, field_mask: tAny) -> None: ... @@ -63,29 +68,34 @@ class _FieldMaskTree: def AddLeafNodes(self, prefix: tAny, node: tAny) -> None: ... def MergeMessage(self, source: tAny, destination: tAny, replace_message: tAny, replace_repeated: tAny) -> None: ... +_StructValue: TypeAlias = struct_pb2.Struct | struct_pb2.ListValue | str | float | bool | None +_StructValueArg: TypeAlias = _StructValue | Mapping[str, _StructValueArg] | Sequence[_StructValueArg] + class Struct: - def __getitem__(self, key: tAny): ... - def __contains__(self, item: tAny): ... - def __setitem__(self, key: tAny, value: tAny) -> None: ... - def __delitem__(self, key: tAny) -> None: ... - def __len__(self): ... - def __iter__(self): ... - def keys(self): ... - def values(self): ... - def items(self): ... - def get_or_create_list(self, key: tAny): ... - def get_or_create_struct(self, key: tAny): ... - def update(self, dictionary: tAny) -> None: ... + def __getitem__(self, key: str) -> _StructValue: ... + def __contains__(self, item: object) -> bool: ... + def __setitem__(self, key: str, value: _StructValueArg) -> None: ... + def __delitem__(self, key: str) -> None: ... + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[str]: ... + def keys(self) -> KeysView[str]: ... + def values(self) -> list[_StructValue]: ... + def items(self) -> list[tuple[str, _StructValue]]: ... + def get_or_create_list(self, key: str) -> struct_pb2.ListValue: ... + def get_or_create_struct(self, key: str) -> struct_pb2.Struct: ... + def update(self, dictionary: SupportsItems[str, _StructValueArg]) -> None: ... class ListValue: - def __len__(self): ... - def append(self, value: tAny) -> None: ... - def extend(self, elem_seq: tAny) -> None: ... - def __getitem__(self, index: tAny): ... - def __setitem__(self, index: tAny, value: tAny) -> None: ... - def __delitem__(self, key: tAny) -> None: ... - def items(self) -> None: ... - def add_struct(self): ... - def add_list(self): ... + def __len__(self) -> int: ... + def append(self, value: _StructValue) -> None: ... + def extend(self, elem_seq: Iterable[_StructValue]) -> None: ... + def __getitem__(self, index: int) -> _StructValue: ... + def __setitem__(self, index: int, value: _StructValueArg) -> None: ... + def __delitem__(self, key: int) -> None: ... + # Doesn't actually exist at runtime; needed so type checkers understand the class is iterable + def __iter__(self) -> Iterator[_StructValue]: ... + def items(self) -> Iterator[_StructValue]: ... + def add_struct(self) -> struct_pb2.Struct: ... + def add_list(self) -> struct_pb2.ListValue: ... WKTBASES: dict[str, type[tAny]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/json_format.pyi b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/json_format.pyi index da313df70..62ad1bad2 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/json_format.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/json_format.pyi @@ -13,11 +13,12 @@ def MessageToJson( message: Message, including_default_value_fields: bool = ..., preserving_proto_field_name: bool = ..., - indent: int = ..., + indent: int | None = ..., sort_keys: bool = ..., use_integers_for_enums: bool = ..., descriptor_pool: DescriptorPool | None = ..., float_precision: int | None = ..., + ensure_ascii: bool = ..., ) -> str: ... def MessageToDict( message: Message, @@ -28,8 +29,16 @@ def MessageToDict( float_precision: int | None = ..., ) -> dict[str, Any]: ... def Parse( - text: bytes | str, message: _MessageT, ignore_unknown_fields: bool = ..., descriptor_pool: DescriptorPool | None = ... + text: bytes | str, + message: _MessageT, + ignore_unknown_fields: bool = ..., + descriptor_pool: DescriptorPool | None = ..., + max_recursion_depth: int = ..., ) -> _MessageT: ... def ParseDict( - js_dict: Any, message: _MessageT, ignore_unknown_fields: bool = ..., descriptor_pool: DescriptorPool | None = ... + js_dict: Any, + message: _MessageT, + ignore_unknown_fields: bool = ..., + descriptor_pool: DescriptorPool | None = ..., + max_recursion_depth: int = ..., ) -> _MessageT: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/message.pyi b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/message.pyi index 8a90d7c96..64448454f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/message.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/message.pyi @@ -1,6 +1,6 @@ -from _typeshed import Self from collections.abc import Sequence from typing import Any, TypeVar +from typing_extensions import Self from .descriptor import Descriptor, FieldDescriptor from .internal.extension_dict import _ExtensionDict, _ExtensionFieldDescriptor @@ -13,11 +13,11 @@ _M = TypeVar("_M", bound=Message) # message type (of self) class Message: DESCRIPTOR: Descriptor - def __deepcopy__(self: Self, memo: Any = ...) -> Self: ... + def __deepcopy__(self, memo: Any = ...) -> Self: ... def __eq__(self, other_msg): ... def __ne__(self, other_msg): ... - def MergeFrom(self: Self, other_msg: Self) -> None: ... - def CopyFrom(self: Self, other_msg: Self) -> None: ... + def MergeFrom(self, other_msg: Self) -> None: ... + def CopyFrom(self, other_msg: Self) -> None: ... def Clear(self) -> None: ... def SetInParent(self) -> None: ... def IsInitialized(self) -> bool: ... @@ -27,14 +27,14 @@ class Message: def SerializePartialToString(self, deterministic: bool = ...) -> bytes: ... def ListFields(self) -> Sequence[tuple[FieldDescriptor, Any]]: ... # The TypeVar must be bound to `Message` or we get mypy errors, so we cannot use `Self` for `HasExtension` & `ClearExtension` - def HasExtension(self: _M, extension_handle: _ExtensionFieldDescriptor[_M, Any]) -> bool: ... - def ClearExtension(self: _M, extension_handle: _ExtensionFieldDescriptor[_M, Any]) -> None: ... + def HasExtension(self: _M, field_descriptor: _ExtensionFieldDescriptor[_M, Any]) -> bool: ... + def ClearExtension(self: _M, field_descriptor: _ExtensionFieldDescriptor[_M, Any]) -> None: ... # The TypeVar must be bound to `Message` or we get mypy errors, so we cannot use `Self` for `Extensions` @property def Extensions(self: _M) -> _ExtensionDict[_M]: ... def ByteSize(self) -> int: ... @classmethod - def FromString(cls: type[Self], s: bytes) -> Self: ... + def FromString(cls, s: bytes) -> Self: ... # Intentionally left out typing on these three methods, because they are # stringly typed and it is not useful to call them on a Message directly. # We prefer more specific typing on individual subclasses of Message diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/message_factory.pyi b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/message_factory.pyi index 5493ea889..4368ce132 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/message_factory.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/message_factory.pyi @@ -12,4 +12,4 @@ class MessageFactory: def GetPrototype(self, descriptor: Descriptor) -> type[Message]: ... def GetMessages(self, files: Iterable[str]) -> dict[str, type[Message]]: ... -def GetMessages(file_protos: Iterable[FileDescriptorProto]) -> dict[str, type[Message]]: ... +def GetMessages(file_protos: Iterable[FileDescriptorProto], pool: DescriptorPool | None = ...) -> dict[str, type[Message]]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/reflection.pyi b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/reflection.pyi index 3ca50552a..4bfbd2f4c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/reflection.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/reflection.pyi @@ -1,6 +1,6 @@ class GeneratedProtocolMessageType(type): def __new__(cls, name, bases, dictionary): ... - def __init__(self, name, bases, dictionary) -> None: ... + def __init__(__self, name, bases, dictionary) -> None: ... def ParseMessage(descriptor, byte_str): ... def MakeClass(descriptor): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/source_context_pb2.pyi b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/source_context_pb2.pyi index d2f3e8db9..cb4fb572e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/source_context_pb2.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/source_context_pb2.pyi @@ -1,29 +1,66 @@ """ @generated by mypy-protobuf. Do not edit manually! isort:skip_file +Protocol Buffers - Google's data interchange format +Copyright 2008 Google Inc. All rights reserved. +https://developers.google.com/protocol-buffers/ + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ import builtins import google.protobuf.descriptor import google.protobuf.message -import typing -import typing_extensions +import sys + +if sys.version_info >= (3, 8): + import typing as typing_extensions +else: + import typing_extensions DESCRIPTOR: google.protobuf.descriptor.FileDescriptor +@typing_extensions.final class SourceContext(google.protobuf.message.Message): """`SourceContext` represents information about the source of a protobuf element, like the file in which it is defined. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + FILE_NAME_FIELD_NUMBER: builtins.int - file_name: typing.Text + file_name: builtins.str """The path-qualified name of the .proto file that contained the associated protobuf element. For example: `"google/protobuf/source_context.proto"`. """ - - def __init__(self, + def __init__( + self, *, - file_name: typing.Optional[typing.Text] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["file_name",b"file_name"]) -> None: ... + file_name: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["file_name", b"file_name"]) -> None: ... + global___SourceContext = SourceContext diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/struct_pb2.pyi b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/struct_pb2.pyi index e1377c074..bf2771ec0 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/struct_pb2.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/struct_pb2.pyi @@ -1,21 +1,57 @@ """ @generated by mypy-protobuf. Do not edit manually! isort:skip_file +Protocol Buffers - Google's data interchange format +Copyright 2008 Google Inc. All rights reserved. +https://developers.google.com/protocol-buffers/ + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ import builtins +import collections.abc import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.internal.well_known_types import google.protobuf.message +import sys import typing -import typing_extensions + +if sys.version_info >= (3, 10): + import typing as typing_extensions +else: + import typing_extensions DESCRIPTOR: google.protobuf.descriptor.FileDescriptor class _NullValue: - ValueType = typing.NewType('ValueType', builtins.int) + ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType + class _NullValueEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_NullValue.ValueType], builtins.type): DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor NULL_VALUE: _NullValue.ValueType # 0 @@ -27,14 +63,12 @@ class NullValue(_NullValue, metaclass=_NullValueEnumTypeWrapper): The JSON representation for `NullValue` is JSON `null`. """ - pass NULL_VALUE: NullValue.ValueType # 0 """Null value.""" - global___NullValue = NullValue - +@typing_extensions.final class Struct(google.protobuf.message.Message, google.protobuf.internal.well_known_types.Struct): """`Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` @@ -45,34 +79,41 @@ class Struct(google.protobuf.message.Message, google.protobuf.internal.well_know The JSON representation for `Struct` is JSON object. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + @typing_extensions.final class FieldsEntry(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + KEY_FIELD_NUMBER: builtins.int VALUE_FIELD_NUMBER: builtins.int - key: typing.Text + key: builtins.str @property def value(self) -> global___Value: ... - def __init__(self, + def __init__( + self, *, - key: typing.Optional[typing.Text] = ..., - value: typing.Optional[global___Value] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["value",b"value"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["key",b"key","value",b"value"]) -> None: ... + key: builtins.str | None = ..., + value: global___Value | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["value", b"value"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["key", b"key", "value", b"value"]) -> None: ... FIELDS_FIELD_NUMBER: builtins.int @property - def fields(self) -> google.protobuf.internal.containers.MessageMap[typing.Text, global___Value]: + def fields(self) -> google.protobuf.internal.containers.MessageMap[builtins.str, global___Value]: """Unordered map of dynamically typed values.""" - pass - def __init__(self, + def __init__( + self, *, - fields: typing.Optional[typing.Mapping[typing.Text, global___Value]] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["fields",b"fields"]) -> None: ... + fields: collections.abc.Mapping[builtins.str, global___Value] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["fields", b"fields"]) -> None: ... + global___Struct = Struct +@typing_extensions.final class Value(google.protobuf.message.Message): """`Value` represents a dynamically typed value which can be either null, a number, a string, a boolean, a recursive struct value, or a @@ -81,7 +122,9 @@ class Value(google.protobuf.message.Message): The JSON representation for `Value` is JSON value. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NULL_VALUE_FIELD_NUMBER: builtins.int NUMBER_VALUE_FIELD_NUMBER: builtins.int STRING_VALUE_FIELD_NUMBER: builtins.int @@ -90,52 +133,52 @@ class Value(google.protobuf.message.Message): LIST_VALUE_FIELD_NUMBER: builtins.int null_value: global___NullValue.ValueType """Represents a null value.""" - number_value: builtins.float """Represents a double value.""" - - string_value: typing.Text + string_value: builtins.str """Represents a string value.""" - bool_value: builtins.bool """Represents a boolean value.""" - @property def struct_value(self) -> global___Struct: """Represents a structured value.""" - pass @property def list_value(self) -> global___ListValue: """Represents a repeated `Value`.""" - pass - def __init__(self, + def __init__( + self, *, - null_value: typing.Optional[global___NullValue.ValueType] = ..., - number_value: typing.Optional[builtins.float] = ..., - string_value: typing.Optional[typing.Text] = ..., - bool_value: typing.Optional[builtins.bool] = ..., - struct_value: typing.Optional[global___Struct] = ..., - list_value: typing.Optional[global___ListValue] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["bool_value",b"bool_value","kind",b"kind","list_value",b"list_value","null_value",b"null_value","number_value",b"number_value","string_value",b"string_value","struct_value",b"struct_value"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["bool_value",b"bool_value","kind",b"kind","list_value",b"list_value","null_value",b"null_value","number_value",b"number_value","string_value",b"string_value","struct_value",b"struct_value"]) -> None: ... - def WhichOneof(self, oneof_group: typing_extensions.Literal["kind",b"kind"]) -> typing.Optional[typing_extensions.Literal["null_value","number_value","string_value","bool_value","struct_value","list_value"]]: ... + null_value: global___NullValue.ValueType | None = ..., + number_value: builtins.float | None = ..., + string_value: builtins.str | None = ..., + bool_value: builtins.bool | None = ..., + struct_value: global___Struct | None = ..., + list_value: global___ListValue | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["bool_value", b"bool_value", "kind", b"kind", "list_value", b"list_value", "null_value", b"null_value", "number_value", b"number_value", "string_value", b"string_value", "struct_value", b"struct_value"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["bool_value", b"bool_value", "kind", b"kind", "list_value", b"list_value", "null_value", b"null_value", "number_value", b"number_value", "string_value", b"string_value", "struct_value", b"struct_value"]) -> None: ... + def WhichOneof(self, oneof_group: typing_extensions.Literal["kind", b"kind"]) -> typing_extensions.Literal["null_value", "number_value", "string_value", "bool_value", "struct_value", "list_value"] | None: ... + global___Value = Value +@typing_extensions.final class ListValue(google.protobuf.message.Message, google.protobuf.internal.well_known_types.ListValue): """`ListValue` is a wrapper around a repeated field of values. The JSON representation for `ListValue` is JSON array. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + VALUES_FIELD_NUMBER: builtins.int @property def values(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Value]: """Repeated field of dynamically typed values.""" - pass - def __init__(self, + def __init__( + self, *, - values: typing.Optional[typing.Iterable[global___Value]] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["values",b"values"]) -> None: ... + values: collections.abc.Iterable[global___Value] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["values", b"values"]) -> None: ... + global___ListValue = ListValue diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/symbol_database.pyi b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/symbol_database.pyi index 828138d66..c595d9c52 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/symbol_database.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/symbol_database.pyi @@ -13,4 +13,4 @@ class SymbolDatabase(MessageFactory): def GetSymbol(self, symbol: str) -> type[Message]: ... def GetMessages(self, files: Iterable[str]) -> dict[str, type[Message]]: ... -def Default(): ... +def Default() -> SymbolDatabase: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/timestamp_pb2.pyi b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/timestamp_pb2.pyi index e3c8d9b5d..b8f5b636e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/timestamp_pb2.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/timestamp_pb2.pyi @@ -1,16 +1,50 @@ """ @generated by mypy-protobuf. Do not edit manually! isort:skip_file +Protocol Buffers - Google's data interchange format +Copyright 2008 Google Inc. All rights reserved. +https://developers.google.com/protocol-buffers/ + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ import builtins import google.protobuf.descriptor import google.protobuf.internal.well_known_types import google.protobuf.message -import typing -import typing_extensions +import sys + +if sys.version_info >= (3, 8): + import typing as typing_extensions +else: + import typing_extensions DESCRIPTOR: google.protobuf.descriptor.FileDescriptor +@typing_extensions.final class Timestamp(google.protobuf.message.Message, google.protobuf.internal.well_known_types.Timestamp): """A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at @@ -104,7 +138,9 @@ class Timestamp(google.protobuf.message.Message, google.protobuf.internal.well_k http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D ) to obtain a formatter capable of generating timestamps in this format. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + SECONDS_FIELD_NUMBER: builtins.int NANOS_FIELD_NUMBER: builtins.int seconds: builtins.int @@ -112,18 +148,18 @@ class Timestamp(google.protobuf.message.Message, google.protobuf.internal.well_k 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive. """ - nanos: builtins.int """Non-negative fractions of a second at nanosecond resolution. Negative second values with fractions must still have non-negative nanos values that count forward in time. Must be from 0 to 999,999,999 inclusive. """ - - def __init__(self, + def __init__( + self, *, - seconds: typing.Optional[builtins.int] = ..., - nanos: typing.Optional[builtins.int] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["nanos",b"nanos","seconds",b"seconds"]) -> None: ... + seconds: builtins.int | None = ..., + nanos: builtins.int | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["nanos", b"nanos", "seconds", b"seconds"]) -> None: ... + global___Timestamp = Timestamp diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/type_pb2.pyi b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/type_pb2.pyi index 7cc9f8c2d..5071cdf65 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/type_pb2.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/type_pb2.pyi @@ -1,248 +1,237 @@ """ @generated by mypy-protobuf. Do not edit manually! isort:skip_file +Protocol Buffers - Google's data interchange format +Copyright 2008 Google Inc. All rights reserved. +https://developers.google.com/protocol-buffers/ + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ import builtins +import collections.abc import google.protobuf.any_pb2 import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message import google.protobuf.source_context_pb2 +import sys import typing -import typing_extensions + +if sys.version_info >= (3, 10): + import typing as typing_extensions +else: + import typing_extensions DESCRIPTOR: google.protobuf.descriptor.FileDescriptor class _Syntax: - ValueType = typing.NewType('ValueType', builtins.int) + ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType + class _SyntaxEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_Syntax.ValueType], builtins.type): DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor SYNTAX_PROTO2: _Syntax.ValueType # 0 """Syntax `proto2`.""" - SYNTAX_PROTO3: _Syntax.ValueType # 1 """Syntax `proto3`.""" class Syntax(_Syntax, metaclass=_SyntaxEnumTypeWrapper): """The syntax in which a protocol buffer element is defined.""" - pass SYNTAX_PROTO2: Syntax.ValueType # 0 """Syntax `proto2`.""" - SYNTAX_PROTO3: Syntax.ValueType # 1 """Syntax `proto3`.""" - global___Syntax = Syntax - +@typing_extensions.final class Type(google.protobuf.message.Message): """A protocol buffer message type.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int FIELDS_FIELD_NUMBER: builtins.int ONEOFS_FIELD_NUMBER: builtins.int OPTIONS_FIELD_NUMBER: builtins.int SOURCE_CONTEXT_FIELD_NUMBER: builtins.int SYNTAX_FIELD_NUMBER: builtins.int - name: typing.Text + name: builtins.str """The fully qualified message name.""" - @property def fields(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Field]: """The list of fields.""" - pass @property - def oneofs(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[typing.Text]: + def oneofs(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: """The list of types appearing in `oneof` definitions in this type.""" - pass @property def options(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Option]: """The protocol buffer options.""" - pass @property def source_context(self) -> google.protobuf.source_context_pb2.SourceContext: """The source context.""" - pass syntax: global___Syntax.ValueType """The source syntax.""" - - def __init__(self, + def __init__( + self, *, - name: typing.Optional[typing.Text] = ..., - fields: typing.Optional[typing.Iterable[global___Field]] = ..., - oneofs: typing.Optional[typing.Iterable[typing.Text]] = ..., - options: typing.Optional[typing.Iterable[global___Option]] = ..., - source_context: typing.Optional[google.protobuf.source_context_pb2.SourceContext] = ..., - syntax: typing.Optional[global___Syntax.ValueType] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["source_context",b"source_context"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["fields",b"fields","name",b"name","oneofs",b"oneofs","options",b"options","source_context",b"source_context","syntax",b"syntax"]) -> None: ... + name: builtins.str | None = ..., + fields: collections.abc.Iterable[global___Field] | None = ..., + oneofs: collections.abc.Iterable[builtins.str] | None = ..., + options: collections.abc.Iterable[global___Option] | None = ..., + source_context: google.protobuf.source_context_pb2.SourceContext | None = ..., + syntax: global___Syntax.ValueType | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["source_context", b"source_context"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["fields", b"fields", "name", b"name", "oneofs", b"oneofs", "options", b"options", "source_context", b"source_context", "syntax", b"syntax"]) -> None: ... + global___Type = Type +@typing_extensions.final class Field(google.protobuf.message.Message): """A single field of a message type.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + class _Kind: - ValueType = typing.NewType('ValueType', builtins.int) + ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType - class _KindEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[Field._Kind.ValueType], builtins.type): + + class _KindEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[Field._Kind.ValueType], builtins.type): # noqa: F821 DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor TYPE_UNKNOWN: Field._Kind.ValueType # 0 """Field type unknown.""" - TYPE_DOUBLE: Field._Kind.ValueType # 1 """Field type double.""" - TYPE_FLOAT: Field._Kind.ValueType # 2 """Field type float.""" - TYPE_INT64: Field._Kind.ValueType # 3 """Field type int64.""" - TYPE_UINT64: Field._Kind.ValueType # 4 """Field type uint64.""" - TYPE_INT32: Field._Kind.ValueType # 5 """Field type int32.""" - TYPE_FIXED64: Field._Kind.ValueType # 6 """Field type fixed64.""" - TYPE_FIXED32: Field._Kind.ValueType # 7 """Field type fixed32.""" - TYPE_BOOL: Field._Kind.ValueType # 8 """Field type bool.""" - TYPE_STRING: Field._Kind.ValueType # 9 """Field type string.""" - TYPE_GROUP: Field._Kind.ValueType # 10 """Field type group. Proto2 syntax only, and deprecated.""" - TYPE_MESSAGE: Field._Kind.ValueType # 11 """Field type message.""" - TYPE_BYTES: Field._Kind.ValueType # 12 """Field type bytes.""" - TYPE_UINT32: Field._Kind.ValueType # 13 """Field type uint32.""" - TYPE_ENUM: Field._Kind.ValueType # 14 """Field type enum.""" - TYPE_SFIXED32: Field._Kind.ValueType # 15 """Field type sfixed32.""" - TYPE_SFIXED64: Field._Kind.ValueType # 16 """Field type sfixed64.""" - TYPE_SINT32: Field._Kind.ValueType # 17 """Field type sint32.""" - TYPE_SINT64: Field._Kind.ValueType # 18 """Field type sint64.""" class Kind(_Kind, metaclass=_KindEnumTypeWrapper): """Basic field types.""" - pass TYPE_UNKNOWN: Field.Kind.ValueType # 0 """Field type unknown.""" - TYPE_DOUBLE: Field.Kind.ValueType # 1 """Field type double.""" - TYPE_FLOAT: Field.Kind.ValueType # 2 """Field type float.""" - TYPE_INT64: Field.Kind.ValueType # 3 """Field type int64.""" - TYPE_UINT64: Field.Kind.ValueType # 4 """Field type uint64.""" - TYPE_INT32: Field.Kind.ValueType # 5 """Field type int32.""" - TYPE_FIXED64: Field.Kind.ValueType # 6 """Field type fixed64.""" - TYPE_FIXED32: Field.Kind.ValueType # 7 """Field type fixed32.""" - TYPE_BOOL: Field.Kind.ValueType # 8 """Field type bool.""" - TYPE_STRING: Field.Kind.ValueType # 9 """Field type string.""" - TYPE_GROUP: Field.Kind.ValueType # 10 """Field type group. Proto2 syntax only, and deprecated.""" - TYPE_MESSAGE: Field.Kind.ValueType # 11 """Field type message.""" - TYPE_BYTES: Field.Kind.ValueType # 12 """Field type bytes.""" - TYPE_UINT32: Field.Kind.ValueType # 13 """Field type uint32.""" - TYPE_ENUM: Field.Kind.ValueType # 14 """Field type enum.""" - TYPE_SFIXED32: Field.Kind.ValueType # 15 """Field type sfixed32.""" - TYPE_SFIXED64: Field.Kind.ValueType # 16 """Field type sfixed64.""" - TYPE_SINT32: Field.Kind.ValueType # 17 """Field type sint32.""" - TYPE_SINT64: Field.Kind.ValueType # 18 """Field type sint64.""" - class _Cardinality: - ValueType = typing.NewType('ValueType', builtins.int) + ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType - class _CardinalityEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[Field._Cardinality.ValueType], builtins.type): + + class _CardinalityEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[Field._Cardinality.ValueType], builtins.type): # noqa: F821 DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor CARDINALITY_UNKNOWN: Field._Cardinality.ValueType # 0 """For fields with unknown cardinality.""" - CARDINALITY_OPTIONAL: Field._Cardinality.ValueType # 1 """For optional fields.""" - CARDINALITY_REQUIRED: Field._Cardinality.ValueType # 2 """For required fields. Proto2 syntax only.""" - CARDINALITY_REPEATED: Field._Cardinality.ValueType # 3 """For repeated fields.""" class Cardinality(_Cardinality, metaclass=_CardinalityEnumTypeWrapper): """Whether a field is optional, required, or repeated.""" - pass CARDINALITY_UNKNOWN: Field.Cardinality.ValueType # 0 """For fields with unknown cardinality.""" - CARDINALITY_OPTIONAL: Field.Cardinality.ValueType # 1 """For optional fields.""" - CARDINALITY_REQUIRED: Field.Cardinality.ValueType # 2 """For required fields. Proto2 syntax only.""" - CARDINALITY_REPEATED: Field.Cardinality.ValueType # 3 """For repeated fields.""" - KIND_FIELD_NUMBER: builtins.int CARDINALITY_FIELD_NUMBER: builtins.int NUMBER_FIELD_NUMBER: builtins.int @@ -255,132 +244,128 @@ class Field(google.protobuf.message.Message): DEFAULT_VALUE_FIELD_NUMBER: builtins.int kind: global___Field.Kind.ValueType """The field type.""" - cardinality: global___Field.Cardinality.ValueType """The field cardinality.""" - number: builtins.int """The field number.""" - - name: typing.Text + name: builtins.str """The field name.""" - - type_url: typing.Text + type_url: builtins.str """The field type URL, without the scheme, for message or enumeration types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. """ - oneof_index: builtins.int """The index of the field type in `Type.oneofs`, for message or enumeration types. The first type has index 1; zero means the type is not in the list. """ - packed: builtins.bool """Whether to use alternative packed wire representation.""" - @property def options(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Option]: """The protocol buffer options.""" - pass - json_name: typing.Text + json_name: builtins.str """The field JSON name.""" - - default_value: typing.Text + default_value: builtins.str """The string value of the default value of this field. Proto2 syntax only.""" - - def __init__(self, + def __init__( + self, *, - kind: typing.Optional[global___Field.Kind.ValueType] = ..., - cardinality: typing.Optional[global___Field.Cardinality.ValueType] = ..., - number: typing.Optional[builtins.int] = ..., - name: typing.Optional[typing.Text] = ..., - type_url: typing.Optional[typing.Text] = ..., - oneof_index: typing.Optional[builtins.int] = ..., - packed: typing.Optional[builtins.bool] = ..., - options: typing.Optional[typing.Iterable[global___Option]] = ..., - json_name: typing.Optional[typing.Text] = ..., - default_value: typing.Optional[typing.Text] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["cardinality",b"cardinality","default_value",b"default_value","json_name",b"json_name","kind",b"kind","name",b"name","number",b"number","oneof_index",b"oneof_index","options",b"options","packed",b"packed","type_url",b"type_url"]) -> None: ... + kind: global___Field.Kind.ValueType | None = ..., + cardinality: global___Field.Cardinality.ValueType | None = ..., + number: builtins.int | None = ..., + name: builtins.str | None = ..., + type_url: builtins.str | None = ..., + oneof_index: builtins.int | None = ..., + packed: builtins.bool | None = ..., + options: collections.abc.Iterable[global___Option] | None = ..., + json_name: builtins.str | None = ..., + default_value: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["cardinality", b"cardinality", "default_value", b"default_value", "json_name", b"json_name", "kind", b"kind", "name", b"name", "number", b"number", "oneof_index", b"oneof_index", "options", b"options", "packed", b"packed", "type_url", b"type_url"]) -> None: ... + global___Field = Field +@typing_extensions.final class Enum(google.protobuf.message.Message): """Enum type definition.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int ENUMVALUE_FIELD_NUMBER: builtins.int OPTIONS_FIELD_NUMBER: builtins.int SOURCE_CONTEXT_FIELD_NUMBER: builtins.int SYNTAX_FIELD_NUMBER: builtins.int - name: typing.Text + name: builtins.str """Enum type name.""" - @property def enumvalue(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___EnumValue]: """Enum value definitions.""" - pass @property def options(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Option]: """Protocol buffer options.""" - pass @property def source_context(self) -> google.protobuf.source_context_pb2.SourceContext: """The source context.""" - pass syntax: global___Syntax.ValueType """The source syntax.""" - - def __init__(self, + def __init__( + self, *, - name: typing.Optional[typing.Text] = ..., - enumvalue: typing.Optional[typing.Iterable[global___EnumValue]] = ..., - options: typing.Optional[typing.Iterable[global___Option]] = ..., - source_context: typing.Optional[google.protobuf.source_context_pb2.SourceContext] = ..., - syntax: typing.Optional[global___Syntax.ValueType] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["source_context",b"source_context"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["enumvalue",b"enumvalue","name",b"name","options",b"options","source_context",b"source_context","syntax",b"syntax"]) -> None: ... + name: builtins.str | None = ..., + enumvalue: collections.abc.Iterable[global___EnumValue] | None = ..., + options: collections.abc.Iterable[global___Option] | None = ..., + source_context: google.protobuf.source_context_pb2.SourceContext | None = ..., + syntax: global___Syntax.ValueType | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["source_context", b"source_context"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["enumvalue", b"enumvalue", "name", b"name", "options", b"options", "source_context", b"source_context", "syntax", b"syntax"]) -> None: ... + global___Enum = Enum +@typing_extensions.final class EnumValue(google.protobuf.message.Message): """Enum value definition.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int NUMBER_FIELD_NUMBER: builtins.int OPTIONS_FIELD_NUMBER: builtins.int - name: typing.Text + name: builtins.str """Enum value name.""" - number: builtins.int """Enum value number.""" - @property def options(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Option]: """Protocol buffer options.""" - pass - def __init__(self, + def __init__( + self, *, - name: typing.Optional[typing.Text] = ..., - number: typing.Optional[builtins.int] = ..., - options: typing.Optional[typing.Iterable[global___Option]] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["name",b"name","number",b"number","options",b"options"]) -> None: ... + name: builtins.str | None = ..., + number: builtins.int | None = ..., + options: collections.abc.Iterable[global___Option] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["name", b"name", "number", b"number", "options", b"options"]) -> None: ... + global___EnumValue = EnumValue +@typing_extensions.final class Option(google.protobuf.message.Message): """A protocol buffer option, which can be attached to a message, field, enumeration, etc. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int VALUE_FIELD_NUMBER: builtins.int - name: typing.Text + name: builtins.str """The option's name. For protobuf built-in options (options defined in descriptor.proto), this is the short name. For example, `"map_entry"`. For custom options, it should be the fully-qualified name. For example, `"google.api.http"`. """ - @property def value(self) -> google.protobuf.any_pb2.Any: """The option's value packed in an Any message. If the value is a primitive, @@ -388,12 +373,13 @@ class Option(google.protobuf.message.Message): should be used. If the value is an enum, it should be stored as an int32 value using the google.protobuf.Int32Value type. """ - pass - def __init__(self, + def __init__( + self, *, - name: typing.Optional[typing.Text] = ..., - value: typing.Optional[google.protobuf.any_pb2.Any] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["value",b"value"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["name",b"name","value",b"value"]) -> None: ... + name: builtins.str | None = ..., + value: google.protobuf.any_pb2.Any | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["value", b"value"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["name", b"name", "value", b"value"]) -> None: ... + global___Option = Option diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/wrappers_pb2.pyi b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/wrappers_pb2.pyi index 5bb133eae..201b9258a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/wrappers_pb2.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/wrappers_pb2.pyi @@ -1,164 +1,213 @@ """ @generated by mypy-protobuf. Do not edit manually! isort:skip_file +Wrappers for primitive (non-message) types. These types are useful +for embedding primitives in the `google.protobuf.Any` type and for places +where we need to distinguish between the absence of a primitive +typed field and its default value. + +These wrappers have no meaningful use within repeated fields as they lack +the ability to detect presence on individual elements. +These wrappers have no meaningful use within a map or a oneof since +individual entries of a map or fields of a oneof can already detect presence. """ import builtins import google.protobuf.descriptor import google.protobuf.message -import typing -import typing_extensions +import sys + +if sys.version_info >= (3, 8): + import typing as typing_extensions +else: + import typing_extensions DESCRIPTOR: google.protobuf.descriptor.FileDescriptor +@typing_extensions.final class DoubleValue(google.protobuf.message.Message): """Wrapper message for `double`. The JSON representation for `DoubleValue` is JSON number. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + VALUE_FIELD_NUMBER: builtins.int value: builtins.float """The double value.""" - - def __init__(self, + def __init__( + self, *, - value: typing.Optional[builtins.float] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["value",b"value"]) -> None: ... + value: builtins.float | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["value", b"value"]) -> None: ... + global___DoubleValue = DoubleValue +@typing_extensions.final class FloatValue(google.protobuf.message.Message): """Wrapper message for `float`. The JSON representation for `FloatValue` is JSON number. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + VALUE_FIELD_NUMBER: builtins.int value: builtins.float """The float value.""" - - def __init__(self, + def __init__( + self, *, - value: typing.Optional[builtins.float] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["value",b"value"]) -> None: ... + value: builtins.float | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["value", b"value"]) -> None: ... + global___FloatValue = FloatValue +@typing_extensions.final class Int64Value(google.protobuf.message.Message): """Wrapper message for `int64`. The JSON representation for `Int64Value` is JSON string. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + VALUE_FIELD_NUMBER: builtins.int value: builtins.int """The int64 value.""" - - def __init__(self, + def __init__( + self, *, - value: typing.Optional[builtins.int] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["value",b"value"]) -> None: ... + value: builtins.int | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["value", b"value"]) -> None: ... + global___Int64Value = Int64Value +@typing_extensions.final class UInt64Value(google.protobuf.message.Message): """Wrapper message for `uint64`. The JSON representation for `UInt64Value` is JSON string. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + VALUE_FIELD_NUMBER: builtins.int value: builtins.int """The uint64 value.""" - - def __init__(self, + def __init__( + self, *, - value: typing.Optional[builtins.int] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["value",b"value"]) -> None: ... + value: builtins.int | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["value", b"value"]) -> None: ... + global___UInt64Value = UInt64Value +@typing_extensions.final class Int32Value(google.protobuf.message.Message): """Wrapper message for `int32`. The JSON representation for `Int32Value` is JSON number. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + VALUE_FIELD_NUMBER: builtins.int value: builtins.int """The int32 value.""" - - def __init__(self, + def __init__( + self, *, - value: typing.Optional[builtins.int] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["value",b"value"]) -> None: ... + value: builtins.int | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["value", b"value"]) -> None: ... + global___Int32Value = Int32Value +@typing_extensions.final class UInt32Value(google.protobuf.message.Message): """Wrapper message for `uint32`. The JSON representation for `UInt32Value` is JSON number. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + VALUE_FIELD_NUMBER: builtins.int value: builtins.int """The uint32 value.""" - - def __init__(self, + def __init__( + self, *, - value: typing.Optional[builtins.int] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["value",b"value"]) -> None: ... + value: builtins.int | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["value", b"value"]) -> None: ... + global___UInt32Value = UInt32Value +@typing_extensions.final class BoolValue(google.protobuf.message.Message): """Wrapper message for `bool`. The JSON representation for `BoolValue` is JSON `true` and `false`. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + VALUE_FIELD_NUMBER: builtins.int value: builtins.bool """The bool value.""" - - def __init__(self, + def __init__( + self, *, - value: typing.Optional[builtins.bool] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["value",b"value"]) -> None: ... + value: builtins.bool | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["value", b"value"]) -> None: ... + global___BoolValue = BoolValue +@typing_extensions.final class StringValue(google.protobuf.message.Message): """Wrapper message for `string`. The JSON representation for `StringValue` is JSON string. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + VALUE_FIELD_NUMBER: builtins.int - value: typing.Text + value: builtins.str """The string value.""" - - def __init__(self, + def __init__( + self, *, - value: typing.Optional[typing.Text] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["value",b"value"]) -> None: ... + value: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["value", b"value"]) -> None: ... + global___StringValue = StringValue +@typing_extensions.final class BytesValue(google.protobuf.message.Message): """Wrapper message for `bytes`. The JSON representation for `BytesValue` is JSON string. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + VALUE_FIELD_NUMBER: builtins.int value: builtins.bytes """The bytes value.""" - - def __init__(self, + def __init__( + self, *, - value: typing.Optional[builtins.bytes] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["value",b"value"]) -> None: ... + value: builtins.bytes | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["value", b"value"]) -> None: ... + global___BytesValue = BytesValue diff --git a/packages/pyright-internal/typeshed-fallback/stubs/psutil/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/psutil/METADATA.toml index 96a1afa55..8d29ce528 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/psutil/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/psutil/METADATA.toml @@ -1 +1,4 @@ version = "5.9.*" + +[tool.stubtest] +platforms = ["darwin", "linux", "win32"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/__init__.pyi index 2330710a2..e4a72834c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/__init__.pyi @@ -1,11 +1,11 @@ import sys -from _typeshed import Self +from _typeshed import Incomplete from collections.abc import Callable, Iterable, Iterator from contextlib import AbstractContextManager -from typing import Any -from typing_extensions import Literal, TypeAlias +from typing import Any, overload +from typing_extensions import Literal, Self, TypeAlias -from ._common import ( +from psutil._common import ( AIX as AIX, BSD as BSD, CONN_CLOSE as CONN_CLOSE, @@ -59,7 +59,6 @@ from ._common import ( popenfile, pthread, puids, - sbattery, sconn, scpufreq, scpustats, @@ -82,6 +81,26 @@ if sys.platform == "linux": IOPRIO_CLASS_NONE as IOPRIO_CLASS_NONE, IOPRIO_CLASS_RT as IOPRIO_CLASS_RT, ) + def sensors_temperatures(fahrenheit: bool = ...) -> dict[str, list[shwtemp]]: ... + def sensors_fans() -> dict[str, list[sfan]]: ... + PROCFS_PATH: str + 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 if sys.platform == "win32": from ._psutil_windows import ( ABOVE_NORMAL_PRIORITY_CLASS as ABOVE_NORMAL_PRIORITY_CLASS, @@ -102,18 +121,18 @@ if sys.platform == "win32": ) if sys.platform == "linux": - from ._pslinux import pfullmem, pmem, svmem + from ._pslinux import pfullmem, pmem, sensors_battery as sensors_battery, svmem elif sys.platform == "darwin": - from ._psosx import pfullmem, pmem, svmem + from ._psosx import pfullmem, pmem, sensors_battery as sensors_battery, svmem elif sys.platform == "win32": - from ._pswindows import pfullmem, pmem, svmem + from ._pswindows import pfullmem, pmem, sensors_battery as sensors_battery, svmem else: class pmem(Any): ... class pfullmem(Any): ... class svmem(Any): ... -if sys.platform == "linux": - PROCFS_PATH: str + def sensors_battery(): ... + AF_LINK: int version_info: tuple[int, int, int] __version__: str @@ -145,7 +164,7 @@ class Process: def pid(self) -> int: ... def oneshot(self) -> AbstractContextManager[None]: ... def as_dict( - self, attrs: list[str] | tuple[str, ...] | set[str] | frozenset[str] | None = ..., ad_value: Any | None = ... + self, attrs: list[str] | tuple[str, ...] | set[str] | frozenset[str] | None = ..., ad_value: Incomplete | None = ... ) -> dict[str, Any]: ... def parent(self) -> Process: ... def parents(self) -> list[Process]: ... @@ -167,11 +186,10 @@ class Process: if sys.platform != "darwin": def io_counters(self): ... def ionice(self, ioclass: int | None = ..., value: int | None = ...) -> pionice: ... - if sys.platform == "linux": - def rlimit(self, resource: int, limits: tuple[int, int] | None = ...) -> tuple[int, int]: ... - if sys.platform != "darwin": def cpu_affinity(self, cpus: list[int] | None = ...) -> list[int] | None: ... + def memory_maps(self, grouped: bool = ...): ... if sys.platform == "linux": + def rlimit(self, resource: int, limits: tuple[int, int] | None = ...) -> tuple[int, int]: ... def cpu_num(self) -> int: ... def environ(self) -> dict[str, str]: ... @@ -188,9 +206,6 @@ class Process: def memory_info_ex(self) -> pmem: ... def memory_full_info(self) -> pfullmem: ... def memory_percent(self, memtype: str = ...) -> float: ... - if sys.platform != "darwin": - def memory_maps(self, grouped: bool = ...): ... - def open_files(self) -> list[popenfile]: ... def connections(self, kind: str = ...) -> list[pconn]: ... def send_signal(self, sig: int) -> None: ... @@ -202,14 +217,14 @@ class Process: class Popen(Process): def __init__(self, *args, **kwargs) -> None: ... - def __enter__(self: Self) -> Self: ... - def __exit__(self, *args, **kwargs) -> None: ... + def __enter__(self) -> Self: ... + def __exit__(self, *args: object, **kwargs: object) -> None: ... def __getattribute__(self, name: str) -> Any: ... def pids() -> list[int]: ... def pid_exists(pid: int) -> bool: ... def process_iter( - attrs: list[str] | tuple[str, ...] | set[str] | frozenset[str] | None = ..., ad_value: Any | None = ... + attrs: list[str] | tuple[str, ...] | set[str] | frozenset[str] | None = ..., ad_value: Incomplete | None = ... ) -> Iterator[Process]: ... def wait_procs( procs: Iterable[Process], timeout: float | None = ..., callback: Callable[[Process], object] | None = ... @@ -225,36 +240,16 @@ def virtual_memory() -> svmem: ... def swap_memory() -> sswap: ... def disk_usage(path: str) -> sdiskusage: ... def disk_partitions(all: bool = ...) -> list[sdiskpart]: ... -def disk_io_counters(perdisk: bool = ..., nowrap: bool = ...) -> sdiskio: ... -def net_io_counters(pernic: bool = ..., nowrap: bool = ...) -> snetio: ... +@overload +def disk_io_counters(perdisk: Literal[False] = ..., nowrap: bool = ...) -> sdiskio | None: ... +@overload +def disk_io_counters(perdisk: Literal[True], nowrap: bool = ...) -> dict[str, sdiskio]: ... +@overload +def net_io_counters(pernic: Literal[False] = ..., nowrap: bool = ...) -> snetio: ... +@overload +def net_io_counters(pernic: Literal[True], nowrap: bool = ...) -> dict[str, snetio]: ... def net_connections(kind: str = ...) -> list[sconn]: ... def net_if_addrs() -> dict[str, list[snicaddr]]: ... def net_if_stats() -> dict[str, snicstats]: ... - -if sys.platform == "linux": - def sensors_temperatures(fahrenheit: bool = ...) -> dict[str, list[shwtemp]]: ... - def sensors_fans() -> dict[str, list[sfan]]: ... - -if sys.platform != "win32": - def sensors_battery() -> sbattery | None: ... - def boot_time() -> float: ... def users() -> list[suser]: ... - -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_SIGPENDING: int - RLIMIT_STACK: int - RLIM_INFINITY: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_common.pyi b/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_common.pyi index aed998d38..3dc0db3c7 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_common.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_common.pyi @@ -1,7 +1,7 @@ import enum -from _typeshed import StrOrBytesPath, SupportsWrite +from _typeshed import Incomplete, StrOrBytesPath, SupportsWrite from collections.abc import Callable -from socket import AddressFamily, SocketKind +from socket import AF_INET6 as AF_INET6, AddressFamily, SocketKind from typing import Any, NamedTuple, TypeVar, overload from typing_extensions import Literal @@ -117,7 +117,7 @@ class sconn(NamedTuple): laddr: addr | tuple[()] raddr: addr | tuple[()] status: str - pid: int + pid: int | None class snicaddr(NamedTuple): family: AddressFamily @@ -131,6 +131,7 @@ class snicstats(NamedTuple): duplex: int speed: int mtu: int + flags: str class scpustats(NamedTuple): ctx_switches: int @@ -221,7 +222,7 @@ class NoSuchProcess(Error): pid: Any name: Any msg: Any - def __init__(self, pid, name: Any | None = ..., msg: Any | None = ...) -> None: ... + def __init__(self, pid, name: Incomplete | None = ..., msg: Incomplete | None = ...) -> None: ... class ZombieProcess(NoSuchProcess): __module__: str @@ -229,21 +230,23 @@ class ZombieProcess(NoSuchProcess): ppid: Any name: Any msg: Any - def __init__(self, pid, name: Any | None = ..., ppid: Any | None = ..., msg: Any | None = ...) -> None: ... + def __init__( + self, pid, name: Incomplete | None = ..., ppid: Incomplete | None = ..., msg: Incomplete | None = ... + ) -> None: ... class AccessDenied(Error): __module__: str pid: Any name: Any msg: Any - def __init__(self, pid: Any | None = ..., name: Any | None = ..., msg: Any | None = ...) -> None: ... + def __init__(self, pid: Incomplete | None = ..., name: Incomplete | None = ..., msg: Incomplete | None = ...) -> None: ... class TimeoutExpired(Error): __module__: str seconds: Any pid: Any name: Any - def __init__(self, seconds, pid: Any | None = ..., name: Any | None = ...) -> None: ... + def __init__(self, seconds, pid: Incomplete | None = ..., name: Incomplete | None = ...) -> None: ... _Func = TypeVar("_Func", bound=Callable[..., Any]) @@ -269,10 +272,14 @@ class _WrapNumbers: reminder_keys: Any def __init__(self) -> None: ... def run(self, input_dict, name): ... - def cache_clear(self, name: Any | None = ...) -> None: ... + def cache_clear(self, name: Incomplete | None = ...) -> None: ... def cache_info(self): ... 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 bytes2human(n: int, format: str = ...) -> str: ... def get_procfs_path() -> str: ... def term_supports_colors(file: SupportsWrite[str] = ...) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_compat.pyi b/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_compat.pyi index 4031e23fd..410a291fb 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_compat.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_compat.pyi @@ -5,4 +5,22 @@ from builtins import ( InterruptedError as InterruptedError, PermissionError as PermissionError, ProcessLookupError as ProcessLookupError, + range as range, + super as super, ) +from contextlib import redirect_stderr as redirect_stderr +from functools import lru_cache as lru_cache +from shutil import get_terminal_size as get_terminal_size, which as which +from subprocess import TimeoutExpired +from typing_extensions import Literal + +PY3: Literal[True] +long = int +xrange = range +unicode = str +basestring = str + +def u(s): ... +def b(s): ... + +SubprocessTimeoutExpired = TimeoutExpired diff --git a/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_psaix.pyi b/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_psaix.pyi new file mode 100644 index 000000000..4b0dabdbe --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_psaix.pyi @@ -0,0 +1,104 @@ +from _typeshed import Incomplete +from typing import NamedTuple + +from psutil._common import ( + NIC_DUPLEX_FULL as NIC_DUPLEX_FULL, + NIC_DUPLEX_HALF as NIC_DUPLEX_HALF, + NIC_DUPLEX_UNKNOWN as NIC_DUPLEX_UNKNOWN, + AccessDenied as AccessDenied, + NoSuchProcess as NoSuchProcess, + ZombieProcess as ZombieProcess, + conn_to_ntuple as conn_to_ntuple, + get_procfs_path as get_procfs_path, + memoize_when_activated as memoize_when_activated, + usage_percent as usage_percent, +) +from psutil._compat import ( + PY3 as PY3, + FileNotFoundError as FileNotFoundError, + PermissionError as PermissionError, + ProcessLookupError as ProcessLookupError, +) + +__extra__all__: Incomplete +HAS_THREADS: Incomplete +HAS_NET_IO_COUNTERS: Incomplete +HAS_PROC_IO_COUNTERS: Incomplete +PAGE_SIZE: Incomplete +AF_LINK: Incomplete +PROC_STATUSES: Incomplete +TCP_STATUSES: Incomplete +proc_info_map: Incomplete + +class pmem(NamedTuple): + rss: Incomplete + vms: Incomplete + +pfullmem = pmem + +class scputimes(NamedTuple): + user: Incomplete + system: Incomplete + idle: Incomplete + iowait: Incomplete + +class svmem(NamedTuple): + total: Incomplete + available: Incomplete + percent: Incomplete + used: Incomplete + free: Incomplete + +def virtual_memory(): ... +def swap_memory(): ... +def cpu_times(): ... +def per_cpu_times(): ... +def cpu_count_logical(): ... +def cpu_count_cores(): ... +def cpu_stats(): ... + +disk_io_counters: Incomplete +disk_usage: Incomplete + +def disk_partitions(all: bool = ...): ... + +net_if_addrs: Incomplete +net_io_counters: Incomplete + +def net_connections(kind, _pid: int = ...): ... +def net_if_stats(): ... +def boot_time(): ... +def users(): ... +def pids(): ... +def pid_exists(pid): ... +def wrap_exceptions(fun): ... + +class Process: + pid: Incomplete + 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 create_time(self): ... + def num_threads(self): ... + def threads(self): ... + def connections(self, kind: str = ...): ... + def nice_get(self): ... + def nice_set(self, value): ... + def ppid(self): ... + def uids(self): ... + def gids(self): ... + def cpu_times(self): ... + def terminal(self): ... + def cwd(self): ... + def memory_info(self): ... + memory_full_info: Incomplete + def status(self): ... + def open_files(self): ... + def num_fds(self): ... + def num_ctx_switches(self): ... + def wait(self, timeout: Incomplete | None = ...): ... + def io_counters(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_psbsd.pyi b/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_psbsd.pyi index a9f87ff0c..ef3a03851 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_psbsd.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_psbsd.pyi @@ -1,7 +1,8 @@ +from _typeshed import Incomplete from contextlib import AbstractContextManager from typing import Any, NamedTuple -from ._common import ( +from psutil._common import ( FREEBSD as FREEBSD, NETBSD as NETBSD, OPENBSD as OPENBSD, @@ -26,17 +27,17 @@ HAS_PROC_NUM_FDS: Any kinfo_proc_map: Any class svmem(NamedTuple): - total: Any - available: Any - percent: Any - used: Any - free: Any - active: Any - inactive: Any - buffers: Any - cached: Any - shared: Any - wired: Any + total: int + available: int + percent: float + used: int + free: int + active: int + inactive: int + buffers: int + cached: int + shared: int + wired: int class scputimes(NamedTuple): user: Any @@ -135,7 +136,7 @@ class Process: def num_ctx_switches(self): ... def threads(self): ... def connections(self, kind: str = ...): ... - def wait(self, timeout: Any | None = ...): ... + def wait(self, timeout: Incomplete | None = ...): ... def nice_get(self): ... def nice_set(self, value): ... def status(self): ... @@ -162,4 +163,4 @@ class Process: def cpu_affinity_get(self): ... def cpu_affinity_set(self, cpus) -> None: ... def memory_maps(self): ... - def rlimit(self, resource, limits: Any | None = ...): ... + def rlimit(self, resource, limits: Incomplete | None = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_pslinux.pyi b/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_pslinux.pyi index e68bf0205..b6502d083 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_pslinux.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_pslinux.pyi @@ -1,7 +1,8 @@ import enum +from _typeshed import Incomplete from typing import Any, NamedTuple -from ._common import ( +from psutil._common import ( NIC_DUPLEX_FULL as NIC_DUPLEX_FULL, NIC_DUPLEX_HALF as NIC_DUPLEX_HALF, NIC_DUPLEX_UNKNOWN as NIC_DUPLEX_UNKNOWN, @@ -14,9 +15,12 @@ from ._common import ( supports_ipv6 as supports_ipv6, usage_percent as usage_percent, ) +from psutil._compat import PY3 as PY3 __extra__all__: Any 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 @@ -41,17 +45,17 @@ PROC_STATUSES: Any TCP_STATUSES: Any class svmem(NamedTuple): - total: Any - available: Any - percent: Any - used: Any - free: Any - active: Any - inactive: Any - buffers: Any - cached: Any - shared: Any - slab: Any + total: int + available: int + percent: float + used: int + free: int + active: int + inactive: int + buffers: int + cached: int + shared: int + slab: int class sdiskio(NamedTuple): read_count: Any @@ -80,7 +84,17 @@ class pmem(NamedTuple): data: Any dirty: Any -pfullmem: Any +class pfullmem(NamedTuple): + rss: Incomplete + vms: Incomplete + shared: Incomplete + text: Incomplete + lib: Incomplete + data: Incomplete + dirty: Incomplete + uss: Incomplete + pss: Incomplete + swap: Incomplete class pmmap_grouped(NamedTuple): path: Any @@ -142,10 +156,10 @@ class Connections: @staticmethod def decode_address(addr, family): ... @staticmethod - def process_inet(file, family, type_, inodes, filter_pid: Any | None = ...) -> None: ... + def process_inet(file, family, type_, inodes, filter_pid: Incomplete | None = ...) -> None: ... @staticmethod - def process_unix(file, family, inodes, filter_pid: Any | None = ...) -> None: ... - def retrieve(self, kind, pid: Any | None = ...): ... + def process_unix(file, family, inodes, filter_pid: Incomplete | None = ...) -> None: ... + def retrieve(self, kind, pid: Incomplete | None = ...): ... def net_connections(kind: str = ...): ... def net_io_counters(): ... @@ -154,6 +168,16 @@ def net_if_stats(): ... disk_usage: Any def disk_io_counters(perdisk: bool = ...): ... + +class RootFsDeviceFinder: + major: Incomplete + minor: Incomplete + def __init__(self) -> None: ... + def ask_proc_partitions(self): ... + def ask_sys_dev_block(self): ... + def ask_sys_class_block(self): ... + def find(self): ... + def disk_partitions(all: bool = ...): ... def sensors_temperatures(): ... def sensors_fans(): ... @@ -178,7 +202,7 @@ class Process: def io_counters(self): ... def cpu_times(self): ... def cpu_num(self): ... - def wait(self, timeout: Any | None = ...): ... + def wait(self, timeout: Incomplete | None = ...): ... def create_time(self): ... def memory_info(self): ... def memory_full_info(self): ... @@ -193,7 +217,7 @@ class Process: def cpu_affinity_set(self, cpus) -> None: ... def ionice_get(self): ... def ionice_set(self, ioclass, value): ... - def rlimit(self, resource_, limits: Any | None = ...): ... + def rlimit(self, resource_, limits: Incomplete | None = ...): ... def status(self): ... def open_files(self): ... def connections(self, kind: str = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_psosx.pyi b/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_psosx.pyi index 9affcc5cf..895d66f79 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_psosx.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_psosx.pyi @@ -1,6 +1,7 @@ +from _typeshed import Incomplete from typing import Any, NamedTuple -from ._common import ( +from psutil._common import ( AccessDenied as AccessDenied, NoSuchProcess as NoSuchProcess, ZombieProcess as ZombieProcess, @@ -26,14 +27,14 @@ class scputimes(NamedTuple): idle: Any class svmem(NamedTuple): - total: Any - available: Any - percent: Any - used: Any - free: Any - active: Any - inactive: Any - wired: Any + total: int + available: int + percent: float + used: int + free: int + active: int + inactive: int + wired: int class pmem(NamedTuple): rss: Any @@ -41,7 +42,12 @@ class pmem(NamedTuple): pfaults: Any pageins: Any -pfullmem: Any +class pfullmem(NamedTuple): + rss: Incomplete + vms: Incomplete + pfaults: Incomplete + pageins: Incomplete + uss: Incomplete def virtual_memory() -> svmem: ... def swap_memory(): ... @@ -95,7 +101,7 @@ class Process: def open_files(self): ... def connections(self, kind: str = ...): ... def num_fds(self): ... - def wait(self, timeout: Any | None = ...): ... + def wait(self, timeout: Incomplete | None = ...): ... def nice_get(self): ... def nice_set(self, value): ... def status(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_psposix.pyi b/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_psposix.pyi index 8b754aff0..972008dd1 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_psposix.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_psposix.pyi @@ -1,8 +1,15 @@ -from typing import Any +from _typeshed import Incomplete def pid_exists(pid): ... def wait_pid( - pid, timeout: Any | None = ..., proc_name: Any | None = ..., _waitpid=..., _timer=..., _min=..., _sleep=..., _pid_exists=... + pid, + timeout: Incomplete | None = ..., + proc_name: Incomplete | None = ..., + _waitpid=..., + _timer=..., + _min=..., + _sleep=..., + _pid_exists=..., ): ... def disk_usage(path): ... def get_terminal_map(): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_pssunos.pyi b/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_pssunos.pyi new file mode 100644 index 000000000..22767c5f2 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_pssunos.pyi @@ -0,0 +1,135 @@ +from _typeshed import Incomplete +from typing import NamedTuple + +from psutil._common import ( + AF_INET6 as AF_INET6, + AccessDenied as AccessDenied, + NoSuchProcess as NoSuchProcess, + ZombieProcess as ZombieProcess, + debug as debug, + get_procfs_path as get_procfs_path, + isfile_strict as isfile_strict, + memoize_when_activated as memoize_when_activated, + sockfam_to_enum as sockfam_to_enum, + socktype_to_enum as socktype_to_enum, + usage_percent as usage_percent, +) +from psutil._compat import ( + PY3 as PY3, + FileNotFoundError as FileNotFoundError, + PermissionError as PermissionError, + ProcessLookupError as ProcessLookupError, + b as b, +) + +__extra__all__: Incomplete +PAGE_SIZE: Incomplete +AF_LINK: Incomplete +IS_64_BIT: Incomplete +CONN_IDLE: str +CONN_BOUND: str +PROC_STATUSES: Incomplete +TCP_STATUSES: Incomplete +proc_info_map: Incomplete + +class scputimes(NamedTuple): + user: Incomplete + system: Incomplete + idle: Incomplete + iowait: Incomplete + +class pcputimes(NamedTuple): + user: Incomplete + system: Incomplete + children_user: Incomplete + children_system: Incomplete + +class svmem(NamedTuple): + total: Incomplete + available: Incomplete + percent: Incomplete + used: Incomplete + free: Incomplete + +class pmem(NamedTuple): + rss: Incomplete + vms: Incomplete + +pfullmem = pmem + +class pmmap_grouped(NamedTuple): + path: Incomplete + rss: Incomplete + anonymous: Incomplete + locked: Incomplete + +pmmap_ext: Incomplete + +def virtual_memory(): ... +def swap_memory(): ... +def cpu_times(): ... +def per_cpu_times(): ... +def cpu_count_logical(): ... +def cpu_count_cores(): ... +def cpu_stats(): ... + +disk_io_counters: Incomplete +disk_usage: Incomplete + +def disk_partitions(all: bool = ...): ... + +net_io_counters: Incomplete +net_if_addrs: Incomplete + +def net_connections(kind, _pid: int = ...): ... +def net_if_stats(): ... +def boot_time(): ... +def users(): ... +def pids(): ... +def pid_exists(pid): ... +def wrap_exceptions(fun): ... + +class Process: + pid: Incomplete + 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 create_time(self): ... + def num_threads(self): ... + def nice_get(self): ... + def nice_set(self, value): ... + def ppid(self): ... + def uids(self): ... + def gids(self): ... + def cpu_times(self): ... + def cpu_num(self): ... + def terminal(self): ... + def cwd(self): ... + def memory_info(self): ... + memory_full_info: Incomplete + def status(self): ... + def threads(self): ... + def open_files(self): ... + def connections(self, kind: str = ...): ... + + class nt_mmap_grouped(NamedTuple): + path: Incomplete + rss: Incomplete + anon: Incomplete + locked: Incomplete + + class nt_mmap_ext(NamedTuple): + addr: Incomplete + perms: Incomplete + path: Incomplete + rss: Incomplete + anon: Incomplete + locked: Incomplete + def memory_maps(self): ... + def num_fds(self): ... + def num_ctx_switches(self): ... + def wait(self, timeout: Incomplete | None = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_psutil_linux.pyi b/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_psutil_linux.pyi index 4902db44a..d204ef7ae 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_psutil_linux.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_psutil_linux.pyi @@ -12,4 +12,5 @@ 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: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_psutil_osx.pyi b/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_psutil_osx.pyi new file mode 100644 index 000000000..2578efca4 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_psutil_osx.pyi @@ -0,0 +1,52 @@ +from typing import Any + +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 + +class ZombieProcessError(Exception): ... + +def boot_time(*args, **kwargs) -> Any: ... +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_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: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_psutil_posix.pyi b/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_psutil_posix.pyi index 91e2302ec..2a58ee9a4 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_psutil_posix.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_psutil_posix.pyi @@ -15,6 +15,7 @@ if sys.platform == "linux": RLIMIT_NPROC: int RLIMIT_RSS: int RLIMIT_RTPRIO: int + RLIMIT_RTTIME: int RLIMIT_SIGPENDING: int RLIMIT_STACK: int RLIM_INFINITY: int @@ -22,10 +23,12 @@ if sys.platform == "linux": 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: ... if sys.platform == "darwin": + AF_LINK: int def net_if_duplex_speed(*args, **kwargs): ... def setpriority(*args, **kwargs) -> Any: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_psutil_windows.pyi b/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_psutil_windows.pyi index 964e6fa3f..def198673 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_psutil_windows.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_psutil_windows.pyi @@ -1,3 +1,90 @@ -from typing import Any +ABOVE_NORMAL_PRIORITY_CLASS: int +BELOW_NORMAL_PRIORITY_CLASS: int +ERROR_ACCESS_DENIED: int +ERROR_INVALID_NAME: int +ERROR_PRIVILEGE_NOT_HELD: int +ERROR_SERVICE_DOES_NOT_EXIST: int +HIGH_PRIORITY_CLASS: int +IDLE_PRIORITY_CLASS: int +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: int +PSUTIL_CONN_NONE: int +REALTIME_PRIORITY_CLASS: int +WINDOWS_10: int +WINDOWS_7: int +WINDOWS_8: int +WINDOWS_8_1: int +WINDOWS_VISTA: int +WINVER: int +version: int -def __getattr__(name: str) -> Any: ... # incomplete +class TimeoutAbandoned(Exception): ... +class TimeoutExpired(Exception): ... + +def QueryDosDevice(*args, **kwargs): ... # incomplete +def boot_time(*args, **kwargs): ... # incomplete +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 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 diff --git a/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_pswindows.pyi b/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_pswindows.pyi index 15625c7ff..8dd501d99 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_pswindows.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_pswindows.pyi @@ -1,7 +1,9 @@ import enum +from _typeshed import Incomplete +from collections.abc import Iterable from typing import Any, NamedTuple -from ._common import ( +from psutil._common import ( ENCODING as ENCODING, ENCODING_ERRS as ENCODING_ERRS, AccessDenied as AccessDenied, @@ -15,7 +17,8 @@ from ._common import ( parse_environ_block as parse_environ_block, usage_percent as usage_percent, ) -from ._psutil_windows import ( +from psutil._compat import PY3 as PY3 +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, @@ -24,7 +27,6 @@ from ._psutil_windows import ( REALTIME_PRIORITY_CLASS as REALTIME_PRIORITY_CLASS, ) -msg: str __extra__all__: Any CONN_DELETE_TCB: str ERROR_PARTIAL_COPY: int @@ -62,11 +64,11 @@ class scputimes(NamedTuple): dpc: Any class svmem(NamedTuple): - total: Any - available: Any - percent: Any - used: Any - free: Any + total: int + available: int + percent: float + used: int + free: int class pmem(NamedTuple): rss: Any @@ -82,7 +84,20 @@ class pmem(NamedTuple): peak_pagefile: Any private: Any -pfullmem: Any +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 class pmmap_grouped(NamedTuple): path: Any @@ -122,7 +137,7 @@ def net_if_addrs(): ... def sensors_battery(): ... def boot_time(): ... def users(): ... -def win_service_iter() -> None: ... +def win_service_iter() -> Iterable[WindowsService]: ... def win_service_get(name): ... class WindowsService: @@ -144,7 +159,7 @@ pid_exists: Any ppid_map: Any def is_permission_err(exc): ... -def convert_oserror(exc, pid: Any | None = ..., name: Any | None = ...): ... +def convert_oserror(exc, pid: Incomplete | None = ..., name: Incomplete | None = ...): ... def wrap_exceptions(fun): ... def retry_error_partial_copy(fun): ... @@ -163,7 +178,7 @@ class Process: def memory_maps(self) -> None: ... def kill(self): ... def send_signal(self, sig) -> None: ... - def wait(self, timeout: Any | None = ...): ... + def wait(self, timeout: Incomplete | None = ...): ... def username(self): ... def create_time(self): ... def num_threads(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/psycopg2/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/psycopg2/METADATA.toml index 0009f38f0..2a3162d1d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/psycopg2/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/psycopg2/METADATA.toml @@ -1 +1,4 @@ -version = "2.9.*" \ No newline at end of file +version = "2.9.*" + +[tool.stubtest] +ignore_missing_stub = true diff --git a/packages/pyright-internal/typeshed-fallback/stubs/psycopg2/psycopg2/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/psycopg2/psycopg2/__init__.pyi index d1165cd2d..5c0277751 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/psycopg2/psycopg2/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/psycopg2/psycopg2/__init__.pyi @@ -1,4 +1,5 @@ -from typing import Any +from collections.abc import Callable +from typing import Any, TypeVar, overload # connection and cursor not available at runtime from psycopg2._psycopg import ( @@ -32,6 +33,18 @@ from psycopg2._psycopg import ( threadsafety as threadsafety, ) +_T_conn = TypeVar("_T_conn", bound=connection) + +@overload +def connect(dsn: str, connection_factory: Callable[..., _T_conn], cursor_factory: None = ..., **kwargs: Any) -> _T_conn: ... +@overload +def connect( + dsn: str | None = ..., *, connection_factory: Callable[..., _T_conn], cursor_factory: None = ..., **kwargs: Any +) -> _T_conn: ... +@overload def connect( - dsn: Any | None = ..., connection_factory: Any | None = ..., cursor_factory: Any | None = ..., **kwargs + dsn: str | None = ..., + connection_factory: Callable[..., connection] | None = ..., + cursor_factory: Callable[..., cursor] | None = ..., + **kwargs: Any, ) -> connection: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/psycopg2/psycopg2/_ipaddress.pyi b/packages/pyright-internal/typeshed-fallback/stubs/psycopg2/psycopg2/_ipaddress.pyi index c3476617f..0b0cf5a82 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/psycopg2/psycopg2/_ipaddress.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/psycopg2/psycopg2/_ipaddress.pyi @@ -1,8 +1,9 @@ +from _typeshed import Incomplete from typing import Any ipaddress: Any -def register_ipaddress(conn_or_curs: Any | None = ...) -> None: ... -def cast_interface(s, cur: Any | None = ...): ... -def cast_network(s, cur: Any | None = ...): ... +def register_ipaddress(conn_or_curs: Incomplete | None = ...) -> None: ... +def cast_interface(s, cur: Incomplete | None = ...): ... +def cast_network(s, cur: Incomplete | None = ...): ... def adapt_ipaddress(obj): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/psycopg2/psycopg2/_json.pyi b/packages/pyright-internal/typeshed-fallback/stubs/psycopg2/psycopg2/_json.pyi index e7e8619c6..785bbc43c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/psycopg2/psycopg2/_json.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/psycopg2/psycopg2/_json.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any JSON_OID: int @@ -7,19 +8,19 @@ JSONBARRAY_OID: int class Json: adapted: Any - def __init__(self, adapted, dumps: Any | None = ...) -> None: ... + def __init__(self, adapted, dumps: Incomplete | None = ...) -> None: ... def __conform__(self, proto): ... def dumps(self, obj): ... def prepare(self, conn) -> None: ... def getquoted(self): ... def register_json( - conn_or_curs: Any | None = ..., + conn_or_curs: Incomplete | None = ..., globally: bool = ..., - loads: Any | None = ..., - oid: Any | None = ..., - array_oid: Any | None = ..., + loads: Incomplete | None = ..., + oid: Incomplete | None = ..., + array_oid: Incomplete | None = ..., name: str = ..., ): ... -def register_default_json(conn_or_curs: Any | None = ..., globally: bool = ..., loads: Any | None = ...): ... -def register_default_jsonb(conn_or_curs: Any | None = ..., globally: bool = ..., loads: Any | None = ...): ... +def register_default_json(conn_or_curs: Incomplete | None = ..., globally: bool = ..., loads: Incomplete | None = ...): ... +def register_default_jsonb(conn_or_curs: Incomplete | None = ..., globally: bool = ..., loads: Incomplete | None = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/psycopg2/psycopg2/_psycopg.pyi b/packages/pyright-internal/typeshed-fallback/stubs/psycopg2/psycopg2/_psycopg.pyi index 45d62c52d..a6362acbd 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/psycopg2/psycopg2/_psycopg.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/psycopg2/psycopg2/_psycopg.pyi @@ -1,8 +1,7 @@ -from _typeshed import Self from collections.abc import Callable, Iterable, Mapping, Sequence from types import TracebackType from typing import Any, TypeVar, overload -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal, Self, TypeAlias import psycopg2 import psycopg2.extensions @@ -98,18 +97,18 @@ class cursor: def execute(self, query: str | bytes | Composable, vars: _Vars = ...) -> None: ... def executemany(self, query: str | bytes | Composable, vars_list: Iterable[_Vars]) -> None: ... def fetchall(self) -> list[tuple[Any, ...]]: ... - def fetchmany(self, size=...) -> list[tuple[Any, ...]]: ... + def fetchmany(self, size: int | None = ...) -> list[tuple[Any, ...]]: ... def fetchone(self) -> tuple[Any, ...] | None: ... def mogrify(self, *args, **kwargs): ... def nextset(self): ... def scroll(self, value, mode=...): ... def setinputsizes(self, sizes): ... def setoutputsize(self, size, column=...): ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, type: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None ) -> None: ... - def __iter__(self: Self) -> Self: ... + def __iter__(self) -> Self: ... def __next__(self) -> tuple[Any, ...]: ... _Cursor: TypeAlias = cursor @@ -151,7 +150,7 @@ class Column: def __getstate__(self): ... def __gt__(self, __other): ... def __le__(self, __other): ... - def __len__(self): ... + def __len__(self) -> int: ... def __lt__(self, __other): ... def __ne__(self, __other): ... def __setstate__(self, state): ... @@ -295,9 +294,9 @@ class Notify: def __ge__(self, __other): ... def __getitem__(self, __index): ... def __gt__(self, __other): ... - def __hash__(self): ... + def __hash__(self) -> int: ... def __le__(self, __other): ... - def __len__(self): ... + def __len__(self) -> int: ... def __lt__(self, __other): ... def __ne__(self, __other): ... @@ -355,7 +354,7 @@ class Xid: def __init__(self, *args, **kwargs) -> None: ... def from_string(self, *args, **kwargs): ... def __getitem__(self, __index): ... - def __len__(self): ... + def __len__(self) -> int: ... _T_cur = TypeVar("_T_cur", bound=cursor) @@ -462,8 +461,8 @@ class connection: def tpc_recover(self) -> list[Xid]: ... def tpc_rollback(self, __xid: str | bytes | Xid = ...) -> None: ... def xid(self, format_id, gtrid, bqual) -> Xid: ... - def __enter__(self: Self) -> Self: ... - def __exit__(self, __type: object, __name: object, __tb: object) -> None: ... + def __enter__(self) -> Self: ... + def __exit__(self, __type: type[BaseException] | None, __name: BaseException | None, __tb: TracebackType | None) -> None: ... class lobject: closed: Any @@ -496,7 +495,7 @@ def get_wait_callback(*args, **kwargs): ... def libpq_version(*args, **kwargs): ... def new_array_type(oids, name, baseobj): ... def new_type(oids, name, castobj): ... -def parse_dsn(*args, **kwargs): ... +def parse_dsn(dsn: str | bytes) -> dict[str, Any]: ... def quote_ident(*args, **kwargs): ... def register_type(*args, **kwargs): ... def set_wait_callback(_none): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/psycopg2/psycopg2/_range.pyi b/packages/pyright-internal/typeshed-fallback/stubs/psycopg2/psycopg2/_range.pyi index fa60fd1bc..eed81ccb3 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/psycopg2/psycopg2/_range.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/psycopg2/psycopg2/_range.pyi @@ -1,7 +1,10 @@ +from _typeshed import Incomplete from typing import Any class Range: - def __init__(self, lower: Any | None = ..., upper: Any | None = ..., bounds: str = ..., empty: bool = ...) -> None: ... + def __init__( + self, lower: Incomplete | None = ..., upper: Incomplete | None = ..., bounds: str = ..., empty: bool = ... + ) -> None: ... @property def lower(self): ... @property @@ -17,11 +20,10 @@ class Range: @property def upper_inc(self): ... def __contains__(self, x): ... - def __bool__(self): ... - def __nonzero__(self): ... + def __bool__(self) -> bool: ... def __eq__(self, other): ... def __ne__(self, other): ... - def __hash__(self): ... + def __hash__(self) -> int: ... def __lt__(self, other): ... def __le__(self, other): ... def __gt__(self, other): ... @@ -41,8 +43,8 @@ class RangeCaster: subtype_oid: Any typecaster: Any array_typecaster: Any - def __init__(self, pgrange, pyrange, oid, subtype_oid, array_oid: Any | None = ...) -> None: ... - def parse(self, s, cur: Any | None = ...): ... + def __init__(self, pgrange, pyrange, oid, subtype_oid, array_oid: Incomplete | None = ...) -> None: ... + def parse(self, s, cur: Incomplete | None = ...): ... class NumericRange(Range): ... class DateRange(Range): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/psycopg2/psycopg2/extensions.pyi b/packages/pyright-internal/typeshed-fallback/stubs/psycopg2/psycopg2/extensions.pyi index 634f07d27..2dcac8227 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/psycopg2/psycopg2/extensions.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/psycopg2/psycopg2/extensions.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from psycopg2._psycopg import ( @@ -106,7 +107,7 @@ class NoneAdapter: def __init__(self, obj) -> None: ... def getquoted(self, _null: bytes = ...): ... -def make_dsn(dsn: Any | None = ..., **kwargs): ... +def make_dsn(dsn: Incomplete | None = ..., **kwargs): ... JSON: Any JSONARRAY: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/psycopg2/psycopg2/extras.pyi b/packages/pyright-internal/typeshed-fallback/stubs/psycopg2/psycopg2/extras.pyi index fdd7cf429..7bce57e8b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/psycopg2/psycopg2/extras.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/psycopg2/psycopg2/extras.pyi @@ -1,5 +1,7 @@ +from _typeshed import Incomplete from collections import OrderedDict -from typing import Any +from collections.abc import Callable +from typing import Any, NamedTuple, TypeVar, overload from psycopg2._ipaddress import register_ipaddress as register_ipaddress from psycopg2._json import ( @@ -28,22 +30,37 @@ from psycopg2._range import ( from .extensions import connection as _connection, cursor as _cursor, quote_ident as quote_ident +_T_cur = TypeVar("_T_cur", bound=_cursor) + class DictCursorBase(_cursor): - row_factory: Any def __init__(self, *args, **kwargs) -> None: ... - def fetchone(self): ... - def fetchmany(self, size: Any | None = ...): ... - def fetchall(self): ... - def __iter__(self): ... class DictConnection(_connection): - def cursor(self, *args, **kwargs): ... + @overload + def cursor(self, name: str | bytes | None = ..., *, withhold: bool = ..., scrollable: bool | None = ...) -> DictCursor: ... + @overload + def cursor( + self, + name: str | bytes | None = ..., + *, + cursor_factory: Callable[..., _T_cur], + withhold: bool = ..., + scrollable: bool | None = ..., + ) -> _T_cur: ... + @overload + def cursor( + self, name: str | bytes | None, cursor_factory: Callable[..., _T_cur], withhold: bool = ..., scrollable: bool | None = ... + ) -> _T_cur: ... class DictCursor(DictCursorBase): def __init__(self, *args, **kwargs) -> None: ... index: Any - def execute(self, query, vars: Any | None = ...): ... - def callproc(self, procname, vars: Any | None = ...): ... + def execute(self, query, vars: Incomplete | None = ...): ... + def callproc(self, procname, vars: Incomplete | None = ...): ... + def fetchone(self) -> DictRow | None: ... # type: ignore[override] + def fetchmany(self, size: int | None = ...) -> list[DictRow]: ... # type: ignore[override] + def fetchall(self) -> list[DictRow]: ... # type: ignore[override] + def __next__(self) -> DictRow: ... # type: ignore[override] class DictRow(list[Any]): def __init__(self, cursor) -> None: ... @@ -52,37 +69,73 @@ class DictRow(list[Any]): def items(self): ... def keys(self): ... def values(self): ... - def get(self, x, default: Any | None = ...): ... + def get(self, x, default: Incomplete | None = ...): ... def copy(self): ... def __contains__(self, x): ... def __reduce__(self): ... class RealDictConnection(_connection): - def cursor(self, *args, **kwargs): ... + @overload + def cursor( + self, name: str | bytes | None = ..., *, withhold: bool = ..., scrollable: bool | None = ... + ) -> RealDictCursor: ... + @overload + def cursor( + self, + name: str | bytes | None = ..., + *, + cursor_factory: Callable[..., _T_cur], + withhold: bool = ..., + scrollable: bool | None = ..., + ) -> _T_cur: ... + @overload + def cursor( + self, name: str | bytes | None, cursor_factory: Callable[..., _T_cur], withhold: bool = ..., scrollable: bool | None = ... + ) -> _T_cur: ... class RealDictCursor(DictCursorBase): def __init__(self, *args, **kwargs) -> None: ... column_mapping: Any - def execute(self, query, vars: Any | None = ...): ... - def callproc(self, procname, vars: Any | None = ...): ... + def execute(self, query, vars: Incomplete | None = ...): ... + def callproc(self, procname, vars: Incomplete | None = ...): ... + def fetchone(self) -> RealDictRow | None: ... # type: ignore[override] + def fetchmany(self, size: int | None = ...) -> list[RealDictRow]: ... # type: ignore[override] + def fetchall(self) -> list[RealDictRow]: ... # type: ignore[override] + def __next__(self) -> RealDictRow: ... # type: ignore[override] class RealDictRow(OrderedDict[Any, Any]): def __init__(self, *args, **kwargs) -> None: ... def __setitem__(self, key, value) -> None: ... class NamedTupleConnection(_connection): - def cursor(self, *args, **kwargs): ... + @overload + def cursor( + self, name: str | bytes | None = ..., *, withhold: bool = ..., scrollable: bool | None = ... + ) -> NamedTupleCursor: ... + @overload + def cursor( + self, + name: str | bytes | None = ..., + *, + cursor_factory: Callable[..., _T_cur], + withhold: bool = ..., + scrollable: bool | None = ..., + ) -> _T_cur: ... + @overload + def cursor( + self, name: str | bytes | None, cursor_factory: Callable[..., _T_cur], withhold: bool = ..., scrollable: bool | None = ... + ) -> _T_cur: ... class NamedTupleCursor(_cursor): Record: Any MAX_CACHE: int - def execute(self, query, vars: Any | None = ...): ... + def execute(self, query, vars: Incomplete | None = ...): ... def executemany(self, query, vars): ... - def callproc(self, procname, vars: Any | None = ...): ... - def fetchone(self): ... - def fetchmany(self, size: Any | None = ...): ... - def fetchall(self): ... - def __iter__(self): ... + def callproc(self, procname, vars: Incomplete | None = ...): ... + def fetchone(self) -> NamedTuple | None: ... + def fetchmany(self, size: int | None = ...) -> list[NamedTuple]: ... # type: ignore[override] + def fetchall(self) -> list[NamedTuple]: ... # type: ignore[override] + def __next__(self) -> NamedTuple: ... class LoggingConnection(_connection): log: Any @@ -91,8 +144,8 @@ class LoggingConnection(_connection): def cursor(self, *args, **kwargs): ... class LoggingCursor(_cursor): - def execute(self, query, vars: Any | None = ...): ... - def callproc(self, procname, vars: Any | None = ...): ... + def execute(self, query, vars: Incomplete | None = ...): ... + def callproc(self, procname, vars: Incomplete | None = ...): ... class MinTimeLoggingConnection(LoggingConnection): def initialize(self, logobj, mintime: int = ...) -> None: ... @@ -101,8 +154,8 @@ class MinTimeLoggingConnection(LoggingConnection): class MinTimeLoggingCursor(LoggingCursor): timestamp: Any - def execute(self, query, vars: Any | None = ...): ... - def callproc(self, procname, vars: Any | None = ...): ... + def execute(self, query, vars: Incomplete | None = ...): ... + def callproc(self, procname, vars: Incomplete | None = ...): ... class LogicalReplicationConnection(_replicationConnection): def __init__(self, *args, **kwargs) -> None: ... @@ -113,15 +166,17 @@ class PhysicalReplicationConnection(_replicationConnection): class StopReplication(Exception): ... class ReplicationCursor(_replicationCursor): - def create_replication_slot(self, slot_name, slot_type: Any | None = ..., output_plugin: Any | None = ...) -> None: ... + def create_replication_slot( + self, slot_name, slot_type: Incomplete | None = ..., output_plugin: Incomplete | None = ... + ) -> None: ... def drop_replication_slot(self, slot_name) -> None: ... def start_replication( self, - slot_name: Any | None = ..., - slot_type: Any | None = ..., + slot_name: Incomplete | None = ..., + slot_type: Incomplete | None = ..., start_lsn: int = ..., timeline: int = ..., - options: Any | None = ..., + options: Incomplete | None = ..., decode: bool = ..., status_interval: int = ..., ) -> None: ... @@ -132,7 +187,7 @@ class UUID_adapter: def __conform__(self, proto): ... def getquoted(self): ... -def register_uuid(oids: Any | None = ..., conn_or_curs: Any | None = ...): ... +def register_uuid(oids: Incomplete | None = ..., conn_or_curs: Incomplete | None = ...): ... class Inet: addr: Any @@ -141,7 +196,7 @@ class Inet: def getquoted(self): ... def __conform__(self, proto): ... -def register_inet(oid: Any | None = ..., conn_or_curs: Any | None = ...): ... +def register_inet(oid: Incomplete | None = ..., conn_or_curs: Incomplete | None = ...): ... def wait_select(conn) -> None: ... class HstoreAdapter: @@ -158,7 +213,7 @@ class HstoreAdapter: def get_oids(cls, conn_or_curs): ... def register_hstore( - conn_or_curs, globally: bool = ..., unicode: bool = ..., oid: Any | None = ..., array_oid: Any | None = ... + conn_or_curs, globally: bool = ..., unicode: bool = ..., oid: Incomplete | None = ..., array_oid: Incomplete | None = ... ) -> None: ... class CompositeCaster: @@ -170,12 +225,12 @@ class CompositeCaster: atttypes: Any typecaster: Any array_typecaster: Any - def __init__(self, name, oid, attrs, array_oid: Any | None = ..., schema: Any | None = ...) -> None: ... + def __init__(self, name, oid, attrs, array_oid: Incomplete | None = ..., schema: Incomplete | None = ...) -> None: ... def parse(self, s, curs): ... def make(self, values): ... @classmethod def tokenize(cls, s): ... -def register_composite(name, conn_or_curs, globally: bool = ..., factory: Any | None = ...): ... +def register_composite(name, conn_or_curs, globally: bool = ..., factory: Incomplete | None = ...): ... def execute_batch(cur, sql, argslist, page_size: int = ...) -> None: ... -def execute_values(cur, sql, argslist, template: Any | None = ..., page_size: int = ..., fetch: bool = ...): ... +def execute_values(cur, sql, argslist, template: Incomplete | None = ..., page_size: int = ..., fetch: bool = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/psycopg2/psycopg2/pool.pyi b/packages/pyright-internal/typeshed-fallback/stubs/psycopg2/psycopg2/pool.pyi index 6bcf1b6d9..94c7b1c56 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/psycopg2/psycopg2/pool.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/psycopg2/psycopg2/pool.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any import psycopg2 @@ -11,8 +12,8 @@ class AbstractConnectionPool: def __init__(self, minconn, maxconn, *args, **kwargs) -> None: ... # getconn, putconn and closeall are officially documented as methods of the # abstract base class, but in reality, they only exist on the children classes - def getconn(self, key: Any | None = ...): ... - def putconn(self, conn: Any, key: Any | None = ..., close: bool = ...) -> None: ... + def getconn(self, key: Incomplete | None = ...): ... + def putconn(self, conn: Any, key: Incomplete | None = ..., close: bool = ...) -> None: ... def closeall(self) -> None: ... class SimpleConnectionPool(AbstractConnectionPool): ... @@ -20,4 +21,4 @@ class SimpleConnectionPool(AbstractConnectionPool): ... class ThreadedConnectionPool(AbstractConnectionPool): # This subclass has a default value for conn which doesn't exist # in the SimpleConnectionPool class, nor in the documentation - def putconn(self, conn: Any | None = ..., key: Any | None = ..., close: bool = ...) -> None: ... + def putconn(self, conn: Incomplete | None = ..., key: Incomplete | None = ..., close: bool = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/psycopg2/psycopg2/sql.pyi b/packages/pyright-internal/typeshed-fallback/stubs/psycopg2/psycopg2/sql.pyi index 17cada92a..31f1ec25a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/psycopg2/psycopg2/sql.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/psycopg2/psycopg2/sql.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from collections.abc import Iterator from typing import Any @@ -40,7 +41,7 @@ class Literal(Composable): def as_string(self, context) -> str: ... class Placeholder(Composable): - def __init__(self, name: Any | None = ...) -> None: ... + def __init__(self, name: Incomplete | None = ...) -> None: ... @property def name(self) -> str | None: ... def as_string(self, context) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/psycopg2/psycopg2/tz.pyi b/packages/pyright-internal/typeshed-fallback/stubs/psycopg2/psycopg2/tz.pyi index 613e41132..f7e658dfc 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/psycopg2/psycopg2/tz.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/psycopg2/psycopg2/tz.pyi @@ -1,11 +1,12 @@ import datetime +from _typeshed import Incomplete from typing import Any ZERO: Any class FixedOffsetTimezone(datetime.tzinfo): - def __init__(self, offset: Any | None = ..., name: Any | None = ...) -> None: ... - def __new__(cls, offset: Any | None = ..., name: Any | None = ...): ... + def __init__(self, offset: Incomplete | None = ..., name: Incomplete | None = ...) -> None: ... + def __new__(cls, offset: Incomplete | None = ..., name: Incomplete | None = ...): ... def __eq__(self, other): ... def __ne__(self, other): ... def __getinitargs__(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyOpenSSL/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/pyOpenSSL/METADATA.toml index 8e97d6cc0..f1c9279f4 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pyOpenSSL/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyOpenSSL/METADATA.toml @@ -1,2 +1,6 @@ -version = "22.0.*" -requires = ["types-cryptography"] +version = "23.0.*" +# Requires a version of cryptography with a `py.typed` file +requires = ["cryptography>=35.0.0"] + +[tool.stubtest] +ignore_missing_stub = true diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyOpenSSL/OpenSSL/SSL.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyOpenSSL/OpenSSL/SSL.pyi index 9881f9115..7754145a7 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pyOpenSSL/OpenSSL/SSL.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyOpenSSL/OpenSSL/SSL.pyi @@ -1,9 +1,9 @@ import socket +from _socket import _Address, _RetAddress from _typeshed import Incomplete, ReadableBuffer from collections.abc import Callable, MutableSequence, Sequence from typing import Any, TypeVar -from _socket import _Address, _RetAddress from OpenSSL.crypto import X509, PKey, X509Name OPENSSL_VERSION_NUMBER: int @@ -16,8 +16,6 @@ SSLEAY_BUILT_ON: int SENT_SHUTDOWN: int RECEIVED_SHUTDOWN: int -SSLv2_METHOD: int -SSLv3_METHOD: int SSLv23_METHOD: int TLSv1_METHOD: int TLSv1_1_METHOD: int @@ -179,7 +177,7 @@ class Connection: _T = TypeVar("_T") class Context: - def __getattr__(self, name: str) -> Any: ... # incomplete + def __getattr__(self, name: str) -> Incomplete: ... def __init__(self, method: int) -> None: ... def load_verify_locations(self, cafile: str | None, capath: str | None = ...) -> None: ... def set_options(self, options: int) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyOpenSSL/OpenSSL/crypto.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyOpenSSL/OpenSSL/crypto.pyi index e8452ec75..8d02de69b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pyOpenSSL/OpenSSL/crypto.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyOpenSSL/OpenSSL/crypto.pyi @@ -1,4 +1,4 @@ -from _typeshed import StrOrBytesPath +from _typeshed import Incomplete, StrOrBytesPath from collections.abc import Callable, Iterable, Sequence from datetime import datetime from typing import Any @@ -18,7 +18,7 @@ TYPE_RSA: int TYPE_DSA: int class _EllipticCurve: - def __init__(self, lib: Any | None, nid: int, name: str) -> None: ... + def __init__(self, lib: Incomplete | None, nid: int, name: str) -> None: ... class Error(Exception): ... @@ -143,8 +143,9 @@ class X509StoreContext: def verify_certificate(self) -> None: ... class X509StoreContextError(Exception): + errors: list[Any] certificate: X509 - def __init__(self, message: str | bytes, certificate: X509) -> None: ... + def __init__(self, message: str, errors: list[Any], certificate: X509) -> None: ... class X509StoreFlags: CRL_CHECK: int @@ -158,6 +159,7 @@ class X509StoreFlags: NOTIFY_POLICY: int CHECK_SS_SIGNATURE: int CB_ISSUER_CHECK: int + PARTIAL_CHAIN: int class PKCS7: def get_type_name(self) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyRFC3339/pyrfc3339/utils.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyRFC3339/pyrfc3339/utils.pyi index 54588acf7..492d3c221 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pyRFC3339/pyrfc3339/utils.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyRFC3339/pyrfc3339/utils.pyi @@ -1,10 +1,13 @@ from datetime import datetime, timedelta, tzinfo +from typing import Any +from typing_extensions import Self class FixedOffset(tzinfo): def __init__(self, hours: float, minutes: float) -> None: ... def dst(self, dt: datetime | None) -> timedelta: ... def utcoffset(self, dt: datetime | None) -> timedelta: ... def tzname(self, dt: datetime | None) -> str: ... + def __deepcopy__(self, memo: dict[int, Any]) -> Self: ... def timedelta_seconds(td: timedelta) -> int: ... def timezone(utcoffset: float) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/METADATA.toml new file mode 100644 index 000000000..582104d3a --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/METADATA.toml @@ -0,0 +1 @@ +version = "0.4.*" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/firefox/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/__init__.pyi similarity index 100% rename from packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/firefox/__init__.pyi rename to packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/__init__.pyi diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/ie/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/codec/__init__.pyi similarity index 100% rename from packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/ie/__init__.pyi rename to packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/codec/__init__.pyi diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/opera/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/codec/ber/__init__.pyi similarity index 100% rename from packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/opera/__init__.pyi rename to packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/codec/ber/__init__.pyi diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/codec/ber/decoder.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/codec/ber/decoder.pyi new file mode 100644 index 000000000..a2544e0c2 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/codec/ber/decoder.pyi @@ -0,0 +1,334 @@ +from _typeshed import Incomplete, Unused +from abc import ABCMeta, abstractmethod +from collections.abc import Callable + +from pyasn1.type import base, char, univ, useful +from pyasn1.type.base import Asn1Type +from pyasn1.type.tag import TagSet + +class AbstractDecoder: + protoComponent: Asn1Type | None + @abstractmethod + def valueDecoder( + self, + substrate, + asn1Spec, + tagSet: TagSet | None = ..., + length: int | None = ..., + state: Incomplete | None = ..., + decodeFun: Callable[..., Incomplete] | None = ..., + substrateFun: Callable[..., Incomplete] | None = ..., + **options, + ) -> None: ... + # Abstract, but implementation is optional + def indefLenValueDecoder( + self, + substrate, + asn1Spec, + tagSet: TagSet | None = ..., + length: int | None = ..., + state: Incomplete | None = ..., + decodeFun: Callable[..., Incomplete] | None = ..., + substrateFun: Callable[..., Incomplete] | None = ..., + **options, + ) -> None: ... + +class AbstractSimpleDecoder(AbstractDecoder, metaclass=ABCMeta): + @staticmethod + def substrateCollector(asn1Object, substrate, length): ... + +class ExplicitTagDecoder(AbstractSimpleDecoder): + protoComponent: univ.Any + def valueDecoder( + self, + substrate, + asn1Spec, + tagSet: TagSet | None = ..., + length: int | None = ..., + state: Unused = ..., + decodeFun: Callable[..., Incomplete] | None = ..., + substrateFun: Callable[..., Incomplete] | None = ..., + **options, + ): ... + def indefLenValueDecoder( + self, + substrate, + asn1Spec, + tagSet: TagSet | None = ..., + length: int | None = ..., + state: Unused = ..., + decodeFun: Callable[..., Incomplete] | None = ..., + substrateFun: Callable[..., Incomplete] | None = ..., + **options, + ): ... + +class IntegerDecoder(AbstractSimpleDecoder): + protoComponent: univ.Integer + def valueDecoder( + self, + substrate, + asn1Spec, + tagSet: TagSet | None = ..., + length: int | None = ..., + state: Unused = ..., + decodeFun: Unused = ..., + substrateFun: Unused = ..., + **options, + ): ... + +class BooleanDecoder(IntegerDecoder): + protoComponent: univ.Boolean + +class BitStringDecoder(AbstractSimpleDecoder): + protoComponent: univ.BitString + supportConstructedForm: bool + def valueDecoder( + self, + substrate, + asn1Spec, + tagSet: TagSet | None = ..., + length: int | None = ..., + state: Unused = ..., + decodeFun: Callable[..., Incomplete] | None = ..., + substrateFun: Callable[..., Incomplete] | None = ..., + **options, + ): ... + def indefLenValueDecoder( + self, + substrate, + asn1Spec, + tagSet: TagSet | None = ..., + length: int | None = ..., + state: Unused = ..., + decodeFun: Callable[..., Incomplete] | None = ..., + substrateFun: Callable[..., Incomplete] | None = ..., + **options, + ): ... + +class OctetStringDecoder(AbstractSimpleDecoder): + protoComponent: univ.OctetString + supportConstructedForm: bool + def valueDecoder( + self, + substrate, + asn1Spec, + tagSet: TagSet | None = ..., + length: int | None = ..., + state: Unused = ..., + decodeFun: Callable[..., Incomplete] | None = ..., + substrateFun: Callable[..., Incomplete] | None = ..., + **options, + ): ... + def indefLenValueDecoder( + self, + substrate, + asn1Spec, + tagSet: TagSet | None = ..., + length: int | None = ..., + state: Unused = ..., + decodeFun: Callable[..., Incomplete] | None = ..., + substrateFun: Callable[..., Incomplete] | None = ..., + **options, + ): ... + +class NullDecoder(AbstractSimpleDecoder): + protoComponent: univ.Null + def valueDecoder( + self, + substrate, + asn1Spec, + tagSet: TagSet | None = ..., + length: int | None = ..., + state: Unused = ..., + decodeFun: Unused = ..., + substrateFun: Unused = ..., + **options, + ): ... + +class ObjectIdentifierDecoder(AbstractSimpleDecoder): + protoComponent: univ.ObjectIdentifier + def valueDecoder( + self, + substrate, + asn1Spec, + tagSet: TagSet | None = ..., + length: int | None = ..., + state: Unused = ..., + decodeFun: Unused = ..., + substrateFun: Unused = ..., + **options, + ): ... + +class RealDecoder(AbstractSimpleDecoder): + protoComponent: univ.Real + def valueDecoder( + self, + substrate, + asn1Spec, + tagSet: TagSet | None = ..., + length: int | None = ..., + state: Unused = ..., + decodeFun: Unused = ..., + substrateFun: Unused = ..., + **options, + ): ... + +class AbstractConstructedDecoder(AbstractDecoder, metaclass=ABCMeta): + protoComponent: base.ConstructedAsn1Type | None + +class UniversalConstructedTypeDecoder(AbstractConstructedDecoder): + protoRecordComponent: univ.SequenceAndSetBase | None + protoSequenceComponent: univ.SequenceOfAndSetOfBase | None + def valueDecoder( + self, + substrate, + asn1Spec, + tagSet: TagSet | None = ..., + length: int | None = ..., + state: Unused = ..., + decodeFun: Callable[..., Incomplete] | None = ..., + substrateFun: Callable[..., Incomplete] | None = ..., + **options, + ): ... + def indefLenValueDecoder( + self, + substrate, + asn1Spec, + tagSet: TagSet | None = ..., + length: int | None = ..., + state: Unused = ..., + decodeFun: Callable[..., Incomplete] | None = ..., + substrateFun: Callable[..., Incomplete] | None = ..., + **options, + ): ... + +class SequenceOrSequenceOfDecoder(UniversalConstructedTypeDecoder): + protoRecordComponent: univ.Sequence + protoSequenceComponent: univ.SequenceOf + +class SequenceDecoder(SequenceOrSequenceOfDecoder): + protoComponent: univ.Sequence + +class SequenceOfDecoder(SequenceOrSequenceOfDecoder): + protoComponent: univ.SequenceOf + +class SetOrSetOfDecoder(UniversalConstructedTypeDecoder): + protoRecordComponent: univ.Set + protoSequenceComponent: univ.SetOf + +class SetDecoder(SetOrSetOfDecoder): + protoComponent: univ.Set + +class SetOfDecoder(SetOrSetOfDecoder): + protoComponent: univ.SetOf + +class ChoiceDecoder(AbstractConstructedDecoder): + protoComponent: univ.Choice + def valueDecoder( + self, + substrate, + asn1Spec, + tagSet: TagSet | None = ..., + length: int | None = ..., + state: Incomplete | None = ..., + decodeFun: Callable[..., Incomplete] | None = ..., + substrateFun: Callable[..., Incomplete] | None = ..., + **options, + ): ... + def indefLenValueDecoder( + self, + substrate, + asn1Spec, + tagSet: TagSet | None = ..., + length: int | None = ..., + state: Incomplete | None = ..., + decodeFun: Callable[..., Incomplete] | None = ..., + substrateFun: Callable[..., Incomplete] | None = ..., + **options, + ): ... + +class AnyDecoder(AbstractSimpleDecoder): + protoComponent: univ.Any + def valueDecoder( + self, + substrate, + asn1Spec, + tagSet: TagSet | None = ..., + length: int | None = ..., + state: Unused = ..., + decodeFun: Unused = ..., + substrateFun: Callable[..., Incomplete] | None = ..., + **options, + ): ... + def indefLenValueDecoder( + self, + substrate, + asn1Spec, + tagSet: TagSet | None = ..., + length: int | None = ..., + state: Unused = ..., + decodeFun: Callable[..., Incomplete] | None = ..., + substrateFun: Callable[..., Incomplete] | None = ..., + **options, + ): ... + +class UTF8StringDecoder(OctetStringDecoder): + protoComponent: char.UTF8String + +class NumericStringDecoder(OctetStringDecoder): + protoComponent: char.NumericString + +class PrintableStringDecoder(OctetStringDecoder): + protoComponent: char.PrintableString + +class TeletexStringDecoder(OctetStringDecoder): + protoComponent: char.TeletexString + +class VideotexStringDecoder(OctetStringDecoder): + protoComponent: char.VideotexString + +class IA5StringDecoder(OctetStringDecoder): + protoComponent: char.IA5String + +class GraphicStringDecoder(OctetStringDecoder): + protoComponent: char.GraphicString + +class VisibleStringDecoder(OctetStringDecoder): + protoComponent: char.VisibleString + +class GeneralStringDecoder(OctetStringDecoder): + protoComponent: char.GeneralString + +class UniversalStringDecoder(OctetStringDecoder): + protoComponent: char.UniversalString + +class BMPStringDecoder(OctetStringDecoder): + protoComponent: char.BMPString + +class ObjectDescriptorDecoder(OctetStringDecoder): + protoComponent: useful.ObjectDescriptor + +class GeneralizedTimeDecoder(OctetStringDecoder): + protoComponent: useful.GeneralizedTime + +class UTCTimeDecoder(OctetStringDecoder): + protoComponent: useful.UTCTime + +class Decoder: + defaultErrorState: int + defaultRawDecoder: AnyDecoder + supportIndefLength: bool + def __init__(self, tagMap, typeMap=...) -> None: ... + def __call__( + self, + substrate, + asn1Spec: Asn1Type | None = ..., + tagSet: TagSet | None = ..., + length: int | None = ..., + state=..., + decodeFun: Unused = ..., + substrateFun: Callable[..., Incomplete] | None = ..., + **options, + ): ... + +decode: Decoder diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/codec/ber/encoder.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/codec/ber/encoder.pyi new file mode 100644 index 000000000..28156078c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/codec/ber/encoder.pyi @@ -0,0 +1,67 @@ +from _typeshed import Incomplete +from abc import abstractmethod + +from pyasn1.type.base import Asn1Type + +class AbstractItemEncoder: + supportIndefLenMode: bool + eooIntegerSubstrate: tuple[int, int] + eooOctetsSubstrate: bytes + def encodeTag(self, singleTag, isConstructed): ... + def encodeLength(self, length, defMode): ... + @abstractmethod + def encodeValue(self, value, asn1Spec, encodeFun, **options) -> None: ... + def encode(self, value, asn1Spec: Asn1Type | None = ..., encodeFun: Incomplete | None = ..., **options): ... + +class EndOfOctetsEncoder(AbstractItemEncoder): + def encodeValue(self, value, asn1Spec, encodeFun, **options): ... + +class BooleanEncoder(AbstractItemEncoder): + supportIndefLenMode: bool + def encodeValue(self, value, asn1Spec, encodeFun, **options): ... + +class IntegerEncoder(AbstractItemEncoder): + supportIndefLenMode: bool + supportCompactZero: bool + def encodeValue(self, value, asn1Spec, encodeFun, **options): ... + +class BitStringEncoder(AbstractItemEncoder): + def encodeValue(self, value, asn1Spec, encodeFun, **options): ... + +class OctetStringEncoder(AbstractItemEncoder): + def encodeValue(self, value, asn1Spec, encodeFun, **options): ... + +class NullEncoder(AbstractItemEncoder): + supportIndefLenMode: bool + def encodeValue(self, value, asn1Spec, encodeFun, **options): ... + +class ObjectIdentifierEncoder(AbstractItemEncoder): + supportIndefLenMode: bool + def encodeValue(self, value, asn1Spec, encodeFun, **options): ... + +class RealEncoder(AbstractItemEncoder): + # Mistake in the module, should be False, but is 0 at runtime + supportIndefLenMode: int # type: ignore[assignment] + binEncBase: int + def encodeValue(self, value, asn1Spec, encodeFun, **options): ... + +class SequenceEncoder(AbstractItemEncoder): + omitEmptyOptionals: bool + def encodeValue(self, value, asn1Spec, encodeFun, **options): ... + +class SequenceOfEncoder(AbstractItemEncoder): + def encodeValue(self, value, asn1Spec, encodeFun, **options): ... + +class ChoiceEncoder(AbstractItemEncoder): + def encodeValue(self, value, asn1Spec, encodeFun, **options): ... + +class AnyEncoder(OctetStringEncoder): + def encodeValue(self, value, asn1Spec, encodeFun, **options): ... + +class Encoder: + fixedDefLengthMode: bool | None + fixedChunkSize: int | None + def __init__(self, tagMap, typeMap=...) -> None: ... + def __call__(self, value, asn1Spec: Asn1Type | None = ..., **options): ... + +encode: Encoder diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/codec/ber/eoo.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/codec/ber/eoo.pyi new file mode 100644 index 000000000..b34fb621f --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/codec/ber/eoo.pyi @@ -0,0 +1,9 @@ +from pyasn1.type import base +from pyasn1.type.tag import TagSet + +class EndOfOctets(base.SimpleAsn1Type): + defaultValue: int + tagSet: TagSet + def __new__(cls, *args, **kwargs): ... + +endOfOctets: EndOfOctets diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/phantomjs/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/codec/cer/__init__.pyi similarity index 100% rename from packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/phantomjs/__init__.pyi rename to packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/codec/cer/__init__.pyi diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/codec/cer/decoder.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/codec/cer/decoder.pyi new file mode 100644 index 000000000..22f51cdc0 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/codec/cer/decoder.pyi @@ -0,0 +1,27 @@ +from _typeshed import Unused + +from pyasn1.codec.ber import decoder +from pyasn1.type import univ +from pyasn1.type.tag import TagSet + +class BooleanDecoder(decoder.AbstractSimpleDecoder): + protoComponent: univ.Boolean + def valueDecoder( + self, + substrate, + asn1Spec, + tagSet: TagSet | None = ..., + length: int | None = ..., + state: Unused = ..., + decodeFun: Unused = ..., + substrateFun: Unused = ..., + **options, + ): ... + +BitStringDecoder = decoder.BitStringDecoder +OctetStringDecoder = decoder.OctetStringDecoder +RealDecoder = decoder.RealDecoder + +class Decoder(decoder.Decoder): ... + +decode: Decoder diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/codec/cer/encoder.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/codec/cer/encoder.pyi new file mode 100644 index 000000000..3b01db7d4 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/codec/cer/encoder.pyi @@ -0,0 +1,40 @@ +from typing import ClassVar + +from pyasn1.codec.ber import encoder + +class BooleanEncoder(encoder.IntegerEncoder): + def encodeValue(self, value, asn1Spec, encodeFun, **options): ... + +class RealEncoder(encoder.RealEncoder): ... + +class TimeEncoderMixIn: + Z_CHAR: ClassVar[int] + PLUS_CHAR: ClassVar[int] + MINUS_CHAR: ClassVar[int] + COMMA_CHAR: ClassVar[int] + DOT_CHAR: ClassVar[int] + ZERO_CHAR: ClassVar[int] + MIN_LENGTH: ClassVar[int] + MAX_LENGTH: ClassVar[int] + def encodeValue(self, value, asn1Spec, encodeFun, **options): ... + +class GeneralizedTimeEncoder(TimeEncoderMixIn, encoder.OctetStringEncoder): ... +class UTCTimeEncoder(TimeEncoderMixIn, encoder.OctetStringEncoder): ... + +class SetOfEncoder(encoder.SequenceOfEncoder): + def encodeValue(self, value, asn1Spec, encodeFun, **options): ... + +class SequenceOfEncoder(encoder.SequenceOfEncoder): + def encodeValue(self, value, asn1Spec, encodeFun, **options): ... + +class SetEncoder(encoder.SequenceEncoder): + def encodeValue(self, value, asn1Spec, encodeFun, **options): ... + +class SequenceEncoder(encoder.SequenceEncoder): + omitEmptyOptionals: bool + +class Encoder(encoder.Encoder): + fixedDefLengthMode: bool + fixedChunkSize: int + +encode: Encoder diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/remote/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/codec/der/__init__.pyi similarity index 100% rename from packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/remote/__init__.pyi rename to packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/codec/der/__init__.pyi diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/codec/der/decoder.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/codec/der/decoder.pyi new file mode 100644 index 000000000..68aeb5993 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/codec/der/decoder.pyi @@ -0,0 +1,12 @@ +from pyasn1.codec.cer import decoder + +class BitStringDecoder(decoder.BitStringDecoder): + supportConstructedForm: bool + +class OctetStringDecoder(decoder.OctetStringDecoder): + supportConstructedForm: bool + +class Decoder(decoder.Decoder): + supportIndefLength: bool + +decode: Decoder diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/codec/der/encoder.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/codec/der/encoder.pyi new file mode 100644 index 000000000..55c024e6c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/codec/der/encoder.pyi @@ -0,0 +1,9 @@ +from pyasn1.codec.cer import encoder + +class SetEncoder(encoder.SetEncoder): ... + +class Encoder(encoder.Encoder): + fixedDefLengthMode: bool + fixedChunkSize: int + +encode: Encoder diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/safari/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/codec/native/__init__.pyi similarity index 100% rename from packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/safari/__init__.pyi rename to packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/codec/native/__init__.pyi diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/codec/native/decoder.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/codec/native/decoder.pyi new file mode 100644 index 000000000..09d7b4eb0 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/codec/native/decoder.pyi @@ -0,0 +1,23 @@ +from _typeshed import Incomplete, Unused +from collections.abc import Callable + +class AbstractScalarDecoder: + def __call__(self, pyObject, asn1Spec, decodeFun: Unused = ..., **options): ... + +class BitStringDecoder(AbstractScalarDecoder): + def __call__(self, pyObject, asn1Spec, decodeFun: Unused = ..., **options): ... + +class SequenceOrSetDecoder: + def __call__(self, pyObject, asn1Spec, decodeFun: Callable[..., Incomplete] | None = ..., **options): ... + +class SequenceOfOrSetOfDecoder: + def __call__(self, pyObject, asn1Spec, decodeFun: Callable[..., Incomplete] | None = ..., **options): ... + +class ChoiceDecoder: + def __call__(self, pyObject, asn1Spec, decodeFun: Callable[..., Incomplete] | None = ..., **options): ... + +class Decoder: + def __init__(self, tagMap, typeMap) -> None: ... + def __call__(self, pyObject, asn1Spec, **options): ... + +decode: Decoder diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/codec/native/encoder.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/codec/native/encoder.pyi new file mode 100644 index 000000000..ec0cb54cf --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/codec/native/encoder.pyi @@ -0,0 +1,51 @@ +from abc import abstractmethod +from collections import OrderedDict + +class AbstractItemEncoder: + @abstractmethod + def encode(self, value, encodeFun, **options) -> None: ... + +class BooleanEncoder(AbstractItemEncoder): + def encode(self, value, encodeFun, **options): ... + +class IntegerEncoder(AbstractItemEncoder): + def encode(self, value, encodeFun, **options): ... + +class BitStringEncoder(AbstractItemEncoder): + def encode(self, value, encodeFun, **options): ... + +class OctetStringEncoder(AbstractItemEncoder): + def encode(self, value, encodeFun, **options): ... + +class TextStringEncoder(AbstractItemEncoder): + def encode(self, value, encodeFun, **options): ... + +class NullEncoder(AbstractItemEncoder): + def encode(self, value, encodeFun, **options) -> None: ... + +class ObjectIdentifierEncoder(AbstractItemEncoder): + def encode(self, value, encodeFun, **options): ... + +class RealEncoder(AbstractItemEncoder): + def encode(self, value, encodeFun, **options): ... + +class SetEncoder(AbstractItemEncoder): + protoDict = dict + def encode(self, value, encodeFun, **options): ... + +class SequenceEncoder(SetEncoder): + protoDict = OrderedDict + +class SequenceOfEncoder(AbstractItemEncoder): + def encode(self, value, encodeFun, **options): ... + +class ChoiceEncoder(SequenceEncoder): ... + +class AnyEncoder(AbstractItemEncoder): + def encode(self, value, encodeFun, **options): ... + +class Encoder: + def __init__(self, tagMap, typeMap=...) -> None: ... + def __call__(self, value, **options): ... + +encode: Encoder diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/support/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/compat/__init__.pyi similarity index 100% rename from packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/support/__init__.pyi rename to packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/compat/__init__.pyi diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/compat/binary.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/compat/binary.pyi new file mode 100644 index 000000000..d034c5045 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/compat/binary.pyi @@ -0,0 +1 @@ +from builtins import bin as bin diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/compat/calling.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/compat/calling.pyi new file mode 100644 index 000000000..9b1d682f3 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/compat/calling.pyi @@ -0,0 +1 @@ +from builtins import callable as callable diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/compat/dateandtime.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/compat/dateandtime.pyi new file mode 100644 index 000000000..739dbe57c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/compat/dateandtime.pyi @@ -0,0 +1,3 @@ +from datetime import datetime + +strptime = datetime.strptime diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/compat/integer.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/compat/integer.pyi new file mode 100644 index 000000000..b7cafe633 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/compat/integer.pyi @@ -0,0 +1,8 @@ +from typing_extensions import Literal + +implementation: str +null: Literal[b""] + +def from_bytes(octets, signed: bool = ...): ... +def to_bytes(value, signed: bool = ..., length: int = ...): ... +def bitLength(number): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/compat/octets.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/compat/octets.pyi new file mode 100644 index 000000000..a5ad961dd --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/compat/octets.pyi @@ -0,0 +1,19 @@ +from typing import TypeVar +from typing_extensions import Literal + +_T = TypeVar("_T") + +ints2octs = bytes + +def int2oct(x) -> bytes: ... + +null: Literal[b""] + +def oct2int(x: _T) -> _T: ... +def octs2ints(x: _T) -> _T: ... +def str2octs(x: str) -> bytes: ... +def octs2str(x: bytes) -> str: ... +def isOctetsType(s: object) -> bool: ... +def isStringType(s: object) -> bool: ... + +ensureString = bytes diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/compat/string.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/compat/string.pyi new file mode 100644 index 000000000..c88881c11 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/compat/string.pyi @@ -0,0 +1,2 @@ +# Same as string.partition(sep) +def partition(string: str, sep: str) -> tuple[str, str, str]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/debug.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/debug.pyi new file mode 100644 index 000000000..55480cdd5 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/debug.pyi @@ -0,0 +1,28 @@ +import logging +from typing import TextIO + +class Printer: + def __init__( + self, + logger: logging.Logger | None = ..., + handler: logging.StreamHandler[TextIO] | None = ..., + formatter: logging.Formatter | None = ..., + ) -> None: ... + def __call__(self, msg) -> None: ... + +NullHandler = logging.NullHandler + +class Debug: + defaultPrinter: Printer + def __init__(self, *flags, **options) -> None: ... + def __call__(self, msg) -> None: ... + def __and__(self, flag): ... + def __rand__(self, flag): ... + +def setLogger(userLogger) -> None: ... +def hexdump(octets): ... + +class Scope: + def __init__(self) -> None: ... + def push(self, token) -> None: ... + def pop(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/error.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/error.pyi new file mode 100644 index 000000000..97eb7898d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/error.pyi @@ -0,0 +1,9 @@ +class PyAsn1Error(Exception): ... +class ValueConstraintError(PyAsn1Error): ... +class SubstrateUnderrunError(PyAsn1Error): ... + +class PyAsn1UnicodeError(PyAsn1Error, UnicodeError): + def __init__(self, message, unicode_error: UnicodeError | None = ...) -> None: ... + +class PyAsn1UnicodeDecodeError(PyAsn1UnicodeError, UnicodeDecodeError): ... +class PyAsn1UnicodeEncodeError(PyAsn1UnicodeError, UnicodeEncodeError): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/webkitgtk/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/type/__init__.pyi similarity index 100% rename from packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/webkitgtk/__init__.pyi rename to packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/type/__init__.pyi diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/type/base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/type/base.pyi new file mode 100644 index 000000000..b1b5e17f5 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/type/base.pyi @@ -0,0 +1,149 @@ +from _typeshed import Incomplete, Unused +from typing import NoReturn, type_check_only +from typing_extensions import final + +from pyasn1.type import constraint, namedtype +from pyasn1.type.tag import TagSet + +class Asn1Item: + @classmethod + def getTypeId(cls, increment: int = ...): ... + +class Asn1Type(Asn1Item): + tagSet: TagSet + subtypeSpec: constraint.ConstraintsIntersection + typeId: int | None + def __init__(self, **kwargs) -> None: ... + def __setattr__(self, name, value) -> None: ... + @property + def readOnly(self): ... + @property + def effectiveTagSet(self): ... + @property + def tagMap(self): ... + def isSameTypeWith(self, other, matchTags: bool = ..., matchConstraints: bool = ...): ... + def isSuperTypeOf(self, other, matchTags: bool = ..., matchConstraints: bool = ...): ... + @staticmethod + def isNoValue(*values): ... + def prettyPrint(self, scope: int = ...) -> None: ... + def getTagSet(self): ... + def getEffectiveTagSet(self): ... + def getTagMap(self): ... + def getSubtypeSpec(self): ... + def hasValue(self): ... + +Asn1ItemBase = Asn1Type + +@final +class NoValue: + skipMethods: set[str] + def __new__(cls): ... + def __getattr__(self, attr) -> None: ... + # def __new__..getPlug..plug + @type_check_only + def plug(self, *args: Unused, **kw: Unused) -> NoReturn: ... + # Magic methods assigned dynamically, priority from right to left: plug < str < int < list < dict + __abs__ = int.__abs__ + __add__ = list.__add__ + __and__ = int.__and__ + __bool__ = int.__bool__ + __ceil__ = int.__ceil__ + __class_getitem__ = plug + __contains__ = dict.__contains__ + __delitem__ = dict.__delitem__ + __dir__ = plug + __divmod__ = int.__divmod__ + __float__ = int.__float__ + __floor__ = int.__floor__ + __floordiv__ = int.__floordiv__ + __ge__ = list.__ge__ + __getitem__ = dict.__getitem__ + __gt__ = list.__gt__ + __iadd__ = list.__iadd__ + __imul__ = list.__imul__ + __index__ = int.__index__ + # self instead of cls + __init_subclass__ = plug # pyright: ignore[reportGeneralTypeIssues] + __int__ = int.__int__ + __invert__ = int.__invert__ + __ior__ = plug + __iter__ = dict.__iter__ + __le__ = list.__le__ + __len__ = dict.__len__ + __lshift__ = int.__lshift__ + __lt__ = list.__lt__ + __mod__ = int.__mod__ + __mul__ = list.__mul__ + __neg__ = int.__neg__ + __or__ = int.__or__ + __pos__ = int.__pos__ + __pow__ = int.__pow__ + __radd__ = int.__radd__ + __rand__ = int.__rand__ + __rdivmod__ = int.__rdivmod__ + __reversed__ = list.__reversed__ + __rfloordiv__ = int.__rfloordiv__ + __rlshift__ = int.__rlshift__ + __rmod__ = int.__rmod__ + __rmul__ = list.__rmul__ + __ror__ = int.__ror__ + __round__ = int.__round__ + __rpow__ = int.__rpow__ + __rrshift__ = int.__rrshift__ + __rshift__ = int.__rshift__ + __rsub__ = int.__rsub__ + __rtruediv__ = int.__rtruediv__ + __rxor__ = int.__rxor__ + __setitem__ = list.__setitem__ + __str__ = plug + __sub__ = int.__sub__ + __truediv__ = int.__truediv__ + __trunc__ = int.__trunc__ + __xor__ = int.__xor__ + +class SimpleAsn1Type(Asn1Type): + defaultValue: Incomplete | NoValue + def __init__(self, value=..., **kwargs) -> None: ... + def __eq__(self, other): ... + def __ne__(self, other): ... + def __lt__(self, other): ... + def __le__(self, other): ... + def __gt__(self, other): ... + def __ge__(self, other): ... + def __bool__(self) -> bool: ... + def __hash__(self): ... + @property + def isValue(self): ... + def clone(self, value=..., **kwargs): ... + def subtype(self, value=..., **kwargs): ... + def prettyIn(self, value): ... + def prettyOut(self, value): ... + def prettyPrint(self, scope: int = ...): ... + def prettyPrintType(self, scope: int = ...): ... + +AbstractSimpleAsn1Item = SimpleAsn1Type + +class ConstructedAsn1Type(Asn1Type): + strictConstraints: bool + componentType: namedtype.NamedTypes | None + sizeSpec: constraint.ConstraintsIntersection + def __init__(self, **kwargs) -> None: ... + def __eq__(self, other): ... + def __ne__(self, other): ... + def __lt__(self, other): ... + def __le__(self, other): ... + def __gt__(self, other): ... + def __ge__(self, other): ... + def __bool__(self) -> bool: ... + @property + def components(self) -> None: ... + def clone(self, **kwargs): ... + def subtype(self, **kwargs): ... + def getComponentByPosition(self, idx) -> None: ... + def setComponentByPosition(self, idx, value, verifyConstraints: bool = ...) -> None: ... + def setComponents(self, *args, **kwargs): ... + def setDefaultComponents(self) -> None: ... + def getComponentType(self): ... + def verifySizeSpec(self) -> None: ... + +AbstractConstructedAsn1Item = ConstructedAsn1Type diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/type/char.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/type/char.pyi new file mode 100644 index 000000000..b61ce2aa8 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/type/char.pyi @@ -0,0 +1,72 @@ +from pyasn1.type import univ +from pyasn1.type.tag import TagSet + +class AbstractCharacterString(univ.OctetString): + def __bytes__(self) -> bytes: ... + def prettyIn(self, value): ... + def asOctets(self, padding: bool = ...): ... + def asNumbers(self, padding: bool = ...): ... + def prettyOut(self, value): ... + def prettyPrint(self, scope: int = ...): ... + def __reversed__(self): ... + +class NumericString(AbstractCharacterString): + tagSet: TagSet + encoding: str + typeId: int + +class PrintableString(AbstractCharacterString): + tagSet: TagSet + encoding: str + typeId: int + +class TeletexString(AbstractCharacterString): + tagSet: TagSet + encoding: str + typeId: int + +class T61String(TeletexString): + typeId: int + +class VideotexString(AbstractCharacterString): + tagSet: TagSet + encoding: str + typeId: int + +class IA5String(AbstractCharacterString): + tagSet: TagSet + encoding: str + typeId: int + +class GraphicString(AbstractCharacterString): + tagSet: TagSet + encoding: str + typeId: int + +class VisibleString(AbstractCharacterString): + tagSet: TagSet + encoding: str + typeId: int + +class ISO646String(VisibleString): + typeId: int + +class GeneralString(AbstractCharacterString): + tagSet: TagSet + encoding: str + typeId: int + +class UniversalString(AbstractCharacterString): + tagSet: TagSet + encoding: str + typeId: int + +class BMPString(AbstractCharacterString): + tagSet: TagSet + encoding: str + typeId: int + +class UTF8String(AbstractCharacterString): + tagSet: TagSet + encoding: str + typeId: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/type/constraint.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/type/constraint.pyi new file mode 100644 index 000000000..313ab6f93 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/type/constraint.pyi @@ -0,0 +1,40 @@ +class AbstractConstraint: + def __init__(self, *values) -> None: ... + def __call__(self, value, idx: int | None = ...) -> None: ... + def __eq__(self, other): ... + def __ne__(self, other): ... + def __lt__(self, other): ... + def __le__(self, other): ... + def __gt__(self, other): ... + def __ge__(self, other): ... + def __bool__(self) -> bool: ... + def __hash__(self): ... + def getValueMap(self): ... + def isSuperTypeOf(self, otherConstraint): ... + def isSubTypeOf(self, otherConstraint): ... + +class SingleValueConstraint(AbstractConstraint): + def __contains__(self, item) -> bool: ... + def __iter__(self): ... + def __add__(self, constraint): ... + def __sub__(self, constraint): ... + +class ContainedSubtypeConstraint(AbstractConstraint): ... +class ValueRangeConstraint(AbstractConstraint): ... +class ValueSizeConstraint(ValueRangeConstraint): ... +class PermittedAlphabetConstraint(SingleValueConstraint): ... +class ComponentPresentConstraint(AbstractConstraint): ... +class ComponentAbsentConstraint(AbstractConstraint): ... +class WithComponentsConstraint(AbstractConstraint): ... +class InnerTypeConstraint(AbstractConstraint): ... +class ConstraintsExclusion(AbstractConstraint): ... + +class AbstractConstraintSet(AbstractConstraint): + def __getitem__(self, idx): ... + def __iter__(self): ... + def __add__(self, value): ... + def __radd__(self, value): ... + def __len__(self) -> int: ... + +class ConstraintsIntersection(AbstractConstraintSet): ... +class ConstraintsUnion(AbstractConstraintSet): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/type/error.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/type/error.pyi new file mode 100644 index 000000000..b25622059 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/type/error.pyi @@ -0,0 +1,3 @@ +from pyasn1.error import PyAsn1Error + +class ValueConstraintError(PyAsn1Error): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/type/namedtype.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/type/namedtype.pyi new file mode 100644 index 000000000..a70704160 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/type/namedtype.pyi @@ -0,0 +1,71 @@ +class NamedType: + isOptional: bool + isDefaulted: bool + def __init__(self, name, asn1Object, openType: type | None = ...) -> None: ... + def __eq__(self, other): ... + def __ne__(self, other): ... + def __lt__(self, other): ... + def __le__(self, other): ... + def __gt__(self, other): ... + def __ge__(self, other): ... + def __hash__(self): ... + def __getitem__(self, idx): ... + def __iter__(self): ... + @property + def name(self): ... + @property + def asn1Object(self): ... + @property + def openType(self): ... + def getName(self): ... + def getType(self): ... + +class OptionalNamedType(NamedType): + isOptional: bool + +class DefaultedNamedType(NamedType): + isDefaulted: bool + +class NamedTypes: + def __init__(self, *namedTypes, **kwargs) -> None: ... + def __eq__(self, other): ... + def __ne__(self, other): ... + def __lt__(self, other): ... + def __le__(self, other): ... + def __gt__(self, other): ... + def __ge__(self, other): ... + def __hash__(self): ... + def __getitem__(self, idx): ... + def __contains__(self, key) -> bool: ... + def __iter__(self): ... + def __bool__(self) -> bool: ... + def __len__(self) -> int: ... + def values(self): ... + def keys(self): ... + def items(self): ... + def clone(self): ... + + class PostponedError: + def __init__(self, errorMsg) -> None: ... + def __getitem__(self, item) -> None: ... + + def getTypeByPosition(self, idx): ... + def getPositionByType(self, tagSet): ... + def getNameByPosition(self, idx): ... + def getPositionByName(self, name): ... + def getTagMapNearPosition(self, idx): ... + def getPositionNearType(self, tagSet, idx): ... + @property + def minTagSet(self): ... + @property + def tagMap(self): ... + @property + def tagMapUnique(self): ... + @property + def hasOptionalOrDefault(self): ... + @property + def hasOpenTypes(self): ... + @property + def namedTypes(self): ... + @property + def requiredComponents(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/type/namedval.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/type/namedval.pyi new file mode 100644 index 000000000..348fb9174 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/type/namedval.pyi @@ -0,0 +1,24 @@ +from _typeshed import Incomplete +from collections.abc import Generator + +class NamedValues: + def __init__(self, *args, **kwargs) -> None: ... + def __eq__(self, other): ... + def __ne__(self, other): ... + def __lt__(self, other): ... + def __le__(self, other): ... + def __gt__(self, other): ... + def __ge__(self, other): ... + def __hash__(self): ... + def __getitem__(self, key): ... + def __len__(self) -> int: ... + def __contains__(self, key) -> bool: ... + def __iter__(self): ... + def values(self): ... + def keys(self): ... + def items(self) -> Generator[Incomplete, None, None]: ... + def __add__(self, namedValues): ... + def clone(self, *args, **kwargs): ... + def getName(self, value): ... + def getValue(self, name): ... + def getValues(self, *names): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/type/opentype.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/type/opentype.pyi new file mode 100644 index 000000000..e11aeac49 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/type/opentype.pyi @@ -0,0 +1,15 @@ +from _typeshed import Incomplete +from collections.abc import Mapping + +from pyasn1.type.base import Asn1Type + +class OpenType: + def __init__(self, name, typeMap: Mapping[Incomplete, Asn1Type] | None = ...) -> None: ... + @property + def name(self): ... + def values(self): ... + def keys(self): ... + def items(self): ... + def __contains__(self, key) -> bool: ... + def __getitem__(self, key): ... + def __iter__(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/type/tag.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/type/tag.pyi new file mode 100644 index 000000000..8c484dd60 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/type/tag.pyi @@ -0,0 +1,51 @@ +tagClassUniversal: int +tagClassApplication: int +tagClassContext: int +tagClassPrivate: int +tagFormatSimple: int +tagFormatConstructed: int +tagCategoryImplicit: int +tagCategoryExplicit: int +tagCategoryUntagged: int + +class Tag: + def __init__(self, tagClass, tagFormat, tagId) -> None: ... + def __eq__(self, other): ... + def __ne__(self, other): ... + def __lt__(self, other): ... + def __le__(self, other): ... + def __gt__(self, other): ... + def __ge__(self, other): ... + def __hash__(self): ... + def __getitem__(self, idx): ... + def __iter__(self): ... + def __and__(self, otherTag): ... + def __or__(self, otherTag): ... + @property + def tagClass(self): ... + @property + def tagFormat(self): ... + @property + def tagId(self): ... + +class TagSet: + def __init__(self, baseTag=..., *superTags) -> None: ... + def __add__(self, superTag): ... + def __radd__(self, superTag): ... + def __getitem__(self, i): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + def __lt__(self, other): ... + def __le__(self, other): ... + def __gt__(self, other): ... + def __ge__(self, other): ... + def __hash__(self): ... + def __len__(self) -> int: ... + @property + def baseTag(self): ... + @property + def superTags(self): ... + def tagExplicitly(self, superTag): ... + def tagImplicitly(self, superTag): ... + def isSuperTagSetOf(self, tagSet): ... + def getBaseTag(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/type/tagmap.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/type/tagmap.pyi new file mode 100644 index 000000000..196234b75 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/type/tagmap.pyi @@ -0,0 +1,23 @@ +from collections.abc import Container, Mapping + +from pyasn1.type.base import Asn1Type + +class TagMap: + def __init__( + self, + presentTypes: Mapping[TagMap, Asn1Type] | None = ..., + skipTypes: Container[TagMap] | None = ..., + defaultType: Asn1Type | None = ..., + ) -> None: ... + def __contains__(self, tagSet) -> bool: ... + def __getitem__(self, tagSet): ... + def __iter__(self): ... + @property + def presentTypes(self): ... + @property + def skipTypes(self): ... + @property + def defaultType(self): ... + def getPosMap(self): ... + def getNegMap(self): ... + def getDef(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/type/univ.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/type/univ.pyi new file mode 100644 index 000000000..7ac15848a --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/type/univ.pyi @@ -0,0 +1,382 @@ +from _typeshed import Incomplete, ReadableBuffer, SupportsRichComparison, SupportsTrunc +from collections.abc import Callable, Generator +from typing import SupportsInt +from typing_extensions import Self, SupportsIndex, TypeAlias + +from pyasn1.type import base, constraint, namedtype, namedval +from pyasn1.type.tag import TagSet + +_SizedIntegerable: TypeAlias = ReadableBuffer | str | SupportsInt | SupportsIndex | SupportsTrunc + +NoValue = base.NoValue +noValue: NoValue + +class Integer(base.SimpleAsn1Type): + tagSet: TagSet + subtypeSpec: constraint.ConstraintsIntersection + namedValues: namedval.NamedValues + typeId: int + def __init__(self, value=..., **kwargs) -> None: ... + def __and__(self, value): ... + def __rand__(self, value): ... + def __or__(self, value): ... + def __ror__(self, value): ... + def __xor__(self, value): ... + def __rxor__(self, value): ... + def __lshift__(self, value): ... + def __rshift__(self, value): ... + def __add__(self, value): ... + def __radd__(self, value): ... + def __sub__(self, value): ... + def __rsub__(self, value): ... + def __mul__(self, value): ... + def __rmul__(self, value): ... + def __mod__(self, value): ... + def __rmod__(self, value): ... + # Accepts everything builtins.pow does + def __pow__(self, value: complex, modulo: int | None = ...) -> Self: ... + def __rpow__(self, value): ... + def __floordiv__(self, value): ... + def __rfloordiv__(self, value): ... + def __truediv__(self, value): ... + def __rtruediv__(self, value): ... + def __divmod__(self, value): ... + def __rdivmod__(self, value): ... + __hash__ = base.SimpleAsn1Type.__hash__ + def __int__(self) -> int: ... + def __float__(self) -> float: ... + def __abs__(self): ... + def __index__(self) -> int: ... + def __pos__(self): ... + def __neg__(self): ... + def __invert__(self): ... + def __round__(self, n: int = ...): ... + def __floor__(self): ... + def __ceil__(self): ... + def __trunc__(self): ... + def __lt__(self, value): ... + def __le__(self, value): ... + def __eq__(self, value): ... + def __ne__(self, value): ... + def __gt__(self, value): ... + def __ge__(self, value): ... + def prettyIn(self, value): ... + def prettyOut(self, value): ... + def getNamedValues(self): ... + +class Boolean(Integer): + tagSet: TagSet + subtypeSpec: constraint.ConstraintsIntersection + namedValues: namedval.NamedValues + typeId: int + +SizedIntegerBase = int + +class SizedInteger(SizedIntegerBase): + bitLength: int | None + leadingZeroBits: int | None + def setBitLength(self, bitLength): ... + def __len__(self) -> int: ... + +class BitString(base.SimpleAsn1Type): + tagSet: TagSet + subtypeSpec: constraint.ConstraintsIntersection + namedValues: namedval.NamedValues + typeId: int + defaultBinValue: str | base.NoValue + defaultHexValue: str | base.NoValue + def __init__(self, value=..., **kwargs) -> None: ... + def __eq__(self, other): ... + def __ne__(self, other): ... + def __lt__(self, other): ... + def __le__(self, other): ... + def __gt__(self, other): ... + def __ge__(self, other): ... + def __len__(self) -> int: ... + def __getitem__(self, i): ... + def __iter__(self): ... + def __reversed__(self): ... + def __add__(self, value): ... + def __radd__(self, value): ... + def __mul__(self, value): ... + def __rmul__(self, value): ... + def __lshift__(self, count): ... + def __rshift__(self, count): ... + def __int__(self) -> int: ... + def __float__(self) -> float: ... + def asNumbers(self): ... + def asOctets(self): ... + def asInteger(self): ... + def asBinary(self): ... + @classmethod + def fromHexString(cls, value, internalFormat: bool = ..., prepend: _SizedIntegerable | None = ...): ... + @classmethod + def fromBinaryString(cls, value, internalFormat: bool = ..., prepend: _SizedIntegerable | None = ...): ... + @classmethod + def fromOctetString(cls, value, internalFormat: bool = ..., prepend: _SizedIntegerable | None = ..., padding: int = ...): ... + def prettyIn(self, value): ... + +class OctetString(base.SimpleAsn1Type): + tagSet: TagSet + subtypeSpec: constraint.ConstraintsIntersection + typeId: int + defaultBinValue: str | base.NoValue + defaultHexValue: str | base.NoValue + encoding: str + def __init__(self, value=..., **kwargs) -> None: ... + def prettyIn(self, value): ... + def __bytes__(self) -> bytes: ... + def asOctets(self): ... + def asNumbers(self): ... + def prettyOut(self, value): ... + def prettyPrint(self, scope: int = ...): ... + @staticmethod + def fromBinaryString(value): ... + @staticmethod + def fromHexString(value): ... + def __len__(self) -> int: ... + def __getitem__(self, i): ... + def __iter__(self): ... + def __contains__(self, value) -> bool: ... + def __add__(self, value): ... + def __radd__(self, value): ... + def __mul__(self, value): ... + def __rmul__(self, value): ... + def __int__(self) -> int: ... + def __float__(self) -> float: ... + def __reversed__(self): ... + +class Null(OctetString): + tagSet: TagSet + subtypeSpec: constraint.ConstraintsIntersection + typeId: int + def prettyIn(self, value): ... + +class ObjectIdentifier(base.SimpleAsn1Type): + tagSet: TagSet + subtypeSpec: constraint.ConstraintsIntersection + typeId: int + def __add__(self, other): ... + def __radd__(self, other): ... + def asTuple(self): ... + def __len__(self) -> int: ... + def __getitem__(self, i): ... + def __iter__(self): ... + def __contains__(self, value) -> bool: ... + def index(self, suboid): ... + def isPrefixOf(self, other): ... + def prettyIn(self, value): ... + def prettyOut(self, value): ... + +class Real(base.SimpleAsn1Type): + binEncBase: int | None + tagSet: TagSet + subtypeSpec: constraint.ConstraintsIntersection + typeId: int + def prettyIn(self, value): ... + def prettyPrint(self, scope: int = ...): ... + @property + def isPlusInf(self): ... + @property + def isMinusInf(self): ... + @property + def isInf(self): ... + def __add__(self, value): ... + def __radd__(self, value): ... + def __mul__(self, value): ... + def __rmul__(self, value): ... + def __sub__(self, value): ... + def __rsub__(self, value): ... + def __mod__(self, value): ... + def __rmod__(self, value): ... + # Accepts everything builtins.pow with a float base does + def __pow__(self, value: complex, modulo: int | None = ...) -> Self: ... + def __rpow__(self, value): ... + def __truediv__(self, value): ... + def __rtruediv__(self, value): ... + def __divmod__(self, value): ... + def __rdivmod__(self, value): ... + def __int__(self) -> int: ... + def __float__(self) -> float: ... + def __abs__(self): ... + def __pos__(self): ... + def __neg__(self): ... + def __round__(self, n: int = ...): ... + def __floor__(self): ... + def __ceil__(self): ... + def __trunc__(self): ... + def __lt__(self, value): ... + def __le__(self, value): ... + def __eq__(self, value): ... + def __ne__(self, value): ... + def __gt__(self, value): ... + def __ge__(self, value): ... + def __bool__(self) -> bool: ... + __hash__ = base.SimpleAsn1Type.__hash__ + def __getitem__(self, idx): ... + def isPlusInfinity(self): ... + def isMinusInfinity(self): ... + def isInfinity(self): ... + +class Enumerated(Integer): + tagSet: TagSet + subtypeSpec: constraint.ConstraintsIntersection + typeId: int + namedValues: namedval.NamedValues + +class SequenceOfAndSetOfBase(base.ConstructedAsn1Type): + componentType: namedtype.NamedTypes | None + tagSet: TagSet + subtypeSpec: constraint.ConstraintsIntersection + def __init__( + self, + *args, + componentType: namedtype.NamedTypes | None = ..., + tagSet: TagSet = ..., + subtypeSpec: constraint.ConstraintsIntersection = ..., + ) -> None: ... + def __getitem__(self, idx): ... + def __setitem__(self, idx, value) -> None: ... + def append(self, value) -> None: ... + def count(self, value): ... + def extend(self, values) -> None: ... + def index(self, value, start: int = ..., stop: int | None = ...): ... + def reverse(self) -> None: ... + def sort(self, key: Callable[[Incomplete], SupportsRichComparison] | None = ..., reverse: bool = ...) -> None: ... + def __len__(self) -> int: ... + def __iter__(self): ... + def getComponentByPosition(self, idx, default=..., instantiate: bool = ...): ... + def setComponentByPosition( + self, idx, value=..., verifyConstraints: bool = ..., matchTags: bool = ..., matchConstraints: bool = ... + ): ... + @property + def componentTagMap(self): ... + @property + def components(self): ... + def clear(self): ... + def reset(self): ... + def prettyPrint(self, scope: int = ...): ... + def prettyPrintType(self, scope: int = ...): ... + @property + def isValue(self): ... + @property + def isInconsistent(self): ... + +class SequenceOf(SequenceOfAndSetOfBase): + typeId: int + +class SetOf(SequenceOfAndSetOfBase): + typeId: int + +class SequenceAndSetBase(base.ConstructedAsn1Type): + componentType: namedtype.NamedTypes + + class DynamicNames: + def __init__(self) -> None: ... + def __len__(self) -> int: ... + def __contains__(self, item) -> bool: ... + def __iter__(self): ... + def __getitem__(self, item): ... + def getNameByPosition(self, idx): ... + def getPositionByName(self, name): ... + def addField(self, idx) -> None: ... + + def __init__(self, **kwargs) -> None: ... + def __getitem__(self, idx): ... + def __setitem__(self, idx, value) -> None: ... + def __contains__(self, key) -> bool: ... + def __len__(self) -> int: ... + def __iter__(self): ... + def values(self) -> Generator[Incomplete, None, None]: ... + def keys(self): ... + def items(self) -> Generator[Incomplete, None, None]: ... + def update(self, *iterValue, **mappingValue) -> None: ... + def clear(self): ... + def reset(self): ... + @property + def components(self): ... + def getComponentByName(self, name, default=..., instantiate: bool = ...): ... + def setComponentByName( + self, name, value=..., verifyConstraints: bool = ..., matchTags: bool = ..., matchConstraints: bool = ... + ): ... + def getComponentByPosition(self, idx, default=..., instantiate: bool = ...): ... + def setComponentByPosition( + self, idx, value=..., verifyConstraints: bool = ..., matchTags: bool = ..., matchConstraints: bool = ... + ): ... + @property + def isValue(self): ... + @property + def isInconsistent(self): ... + def prettyPrint(self, scope: int = ...): ... + def prettyPrintType(self, scope: int = ...): ... + def setDefaultComponents(self): ... + def getComponentType(self): ... + def getNameByPosition(self, idx): ... + +class Sequence(SequenceAndSetBase): + tagSet: TagSet + subtypeSpec: constraint.ConstraintsIntersection + componentType: namedtype.NamedTypes + typeId: int + def getComponentTagMapNearPosition(self, idx): ... + def getComponentPositionNearType(self, tagSet, idx): ... + +class Set(SequenceAndSetBase): + tagSet: TagSet + componentType: namedtype.NamedTypes + subtypeSpec: constraint.ConstraintsIntersection + typeId: int + def getComponent(self, innerFlag: bool = ...): ... + def getComponentByType(self, tagSet, default=..., instantiate: bool = ..., innerFlag: bool = ...): ... + def setComponentByType( + self, + tagSet, + value=..., + verifyConstraints: bool = ..., + matchTags: bool = ..., + matchConstraints: bool = ..., + innerFlag: bool = ..., + ): ... + @property + def componentTagMap(self): ... + +class Choice(Set): + tagSet: TagSet + componentType: namedtype.NamedTypes + subtypeSpec: constraint.ConstraintsIntersection + typeId: int + def __eq__(self, other): ... + def __ne__(self, other): ... + def __lt__(self, other): ... + def __le__(self, other): ... + def __gt__(self, other): ... + def __ge__(self, other): ... + def __bool__(self) -> bool: ... + def __len__(self) -> int: ... + def __contains__(self, key) -> bool: ... + def __iter__(self): ... + def values(self) -> Generator[Incomplete, None, None]: ... + def keys(self) -> Generator[Incomplete, None, None]: ... + def items(self) -> Generator[Incomplete, None, None]: ... + def checkConsistency(self) -> None: ... + def getComponentByPosition(self, idx, default=..., instantiate: bool = ...): ... + def setComponentByPosition( + self, idx, value=..., verifyConstraints: bool = ..., matchTags: bool = ..., matchConstraints: bool = ... + ): ... + @property + def effectiveTagSet(self): ... + @property + def tagMap(self): ... + def getComponent(self, innerFlag: bool = ...): ... + def getName(self, innerFlag: bool = ...): ... + @property + def isValue(self): ... + def clear(self): ... + def getMinTagSet(self): ... + +class Any(OctetString): + tagSet: TagSet + subtypeSpec: constraint.ConstraintsIntersection + typeId: int + @property + def tagMap(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/type/useful.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/type/useful.pyi new file mode 100644 index 000000000..33f13a33a --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/type/useful.pyi @@ -0,0 +1,28 @@ +import datetime + +from pyasn1.type import char +from pyasn1.type.tag import TagSet + +class ObjectDescriptor(char.GraphicString): + tagSet: TagSet + typeId: int + +class TimeMixIn: + class FixedOffset(datetime.tzinfo): + def __init__(self, offset: int = ..., name: str = ...) -> None: ... + def utcoffset(self, dt): ... + def tzname(self, dt): ... + def dst(self, dt): ... + UTC: FixedOffset + @property + def asDateTime(self): ... + @classmethod + def fromDateTime(cls, dt): ... + +class GeneralizedTime(char.VisibleString, TimeMixIn): + tagSet: TagSet + typeId: int + +class UTCTime(char.VisibleString, TimeMixIn): + tagSet: TagSet + typeId: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyaudio/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/pyaudio/METADATA.toml index a259ccae9..477c39829 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pyaudio/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyaudio/METADATA.toml @@ -1,4 +1,7 @@ version = "0.2.*" [tool.stubtest] +# linux and win32 are equivalent +platforms = ["darwin", "linux"] apt_dependencies = ["portaudio19-dev"] +brew_dependencies = ["portaudio"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyaudio/pyaudio.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyaudio/pyaudio.pyi index d773029df..b7a57cee4 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pyaudio/pyaudio.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyaudio/pyaudio.pyi @@ -1,6 +1,10 @@ +import sys from collections.abc import Callable, Mapping, Sequence +from typing import ClassVar from typing_extensions import Final, TypeAlias +__docformat__: str + paFloat32: Final[int] paInt32: Final[int] paInt24: Final[int] @@ -64,12 +68,33 @@ paOutputUnderflow: Final[int] paOutputOverflow: Final[int] paPrimingOutput: Final[int] -paMacCoreStreamInfo: PaMacCoreStreamInfo +paFramesPerBufferUnspecified: Final[int] + +if sys.platform == "darwin": + class PaMacCoreStreamInfo: + paMacCoreChangeDeviceParameters: Final[int] + paMacCoreFailIfConversionRequired: Final[int] + paMacCoreConversionQualityMin: Final[int] + paMacCoreConversionQualityMedium: Final[int] + paMacCoreConversionQualityLow: Final[int] + paMacCoreConversionQualityHigh: Final[int] + paMacCoreConversionQualityMax: Final[int] + paMacCorePlayNice: Final[int] + paMacCorePro: Final[int] + paMacCoreMinimizeCPUButPlayNice: Final[int] + paMacCoreMinimizeCPU: Final[int] + def __init__(self, flags: int | None = ..., channel_map: _ChannelMap | None = ...) -> None: ... + def get_flags(self) -> int: ... + def get_channel_map(self) -> _ChannelMap | None: ... + + _PaMacCoreStreamInfo: TypeAlias = PaMacCoreStreamInfo +else: + _PaMacCoreStreamInfo: TypeAlias = None # Auxiliary types _ChannelMap: TypeAlias = Sequence[int] _PaHostApiInfo: TypeAlias = Mapping[str, str | int] -_PaDeviceInfo: TypeAlias = Mapping[str, str | float] +_PaDeviceInfo: TypeAlias = Mapping[str, str | int | float] _StreamCallback: TypeAlias = Callable[[bytes | None, int, Mapping[str, float], int], tuple[bytes | None, int]] def get_format_from_width(width: int, unsigned: bool = ...) -> int: ... @@ -90,8 +115,8 @@ class Stream: output_device_index: int | None = ..., frames_per_buffer: int = ..., start: bool = ..., - input_host_api_specific_stream_info: PaMacCoreStreamInfo | None = ..., - output_host_api_specific_stream_info: PaMacCoreStreamInfo | None = ..., + input_host_api_specific_stream_info: _PaMacCoreStreamInfo | None = ..., + output_host_api_specific_stream_info: _PaMacCoreStreamInfo | None = ..., stream_callback: _StreamCallback | None = ..., ) -> None: ... def close(self) -> None: ... @@ -108,9 +133,13 @@ class Stream: def stop_stream(self) -> None: ... def write(self, frames: bytes, num_frames: int | None = ..., exception_on_underflow: bool = ...) -> None: ... +# Use an alias to workaround pyright complaints about recursive definitions in the PyAudio class +_Stream = Stream + class PyAudio: + Stream: ClassVar[type[_Stream]] def __init__(self) -> None: ... - def close(self, stream: Stream) -> None: ... + def close(self, stream: _Stream) -> None: ... def get_default_host_api_info(self) -> _PaHostApiInfo: ... def get_default_input_device_info(self) -> _PaDeviceInfo: ... def get_default_output_device_info(self) -> _PaDeviceInfo: ... @@ -143,24 +172,8 @@ class PyAudio: output_device_index: int | None = ..., frames_per_buffer: int = ..., start: bool = ..., - input_host_api_specific_stream_info: PaMacCoreStreamInfo | None = ..., - output_host_api_specific_stream_info: PaMacCoreStreamInfo | None = ..., + input_host_api_specific_stream_info: _PaMacCoreStreamInfo | None = ..., + output_host_api_specific_stream_info: _PaMacCoreStreamInfo | None = ..., stream_callback: _StreamCallback | None = ..., - ) -> Stream: ... + ) -> _Stream: ... def terminate(self) -> None: ... - -class PaMacCoreStreamInfo: - paMacCoreChangeDeviceParameters: Final[int] = ... - paMacCoreFailIfConversionRequired: Final[int] = ... - paMacCoreConversionQualityMin: Final[int] = ... - paMacCoreConversionQualityMedium: Final[int] = ... - paMacCoreConversionQualityLow: Final[int] = ... - paMacCoreConversionQualityHigh: Final[int] = ... - paMacCoreConversionQualityMax: Final[int] = ... - paMacCorePlayNice: Final[int] = ... - paMacCorePro: Final[int] = ... - paMacCoreMinimizeCPUButPlayNice: Final[int] = ... - paMacCoreMinimizeCPU: Final[int] = ... - def __init__(self, flags: int | None = ..., channel_map: _ChannelMap | None = ...) -> None: ... - def get_flags(self) -> int: ... - def get_channel_map(self) -> _ChannelMap | None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pycocotools/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/pycocotools/METADATA.toml new file mode 100644 index 000000000..58bc38349 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pycocotools/METADATA.toml @@ -0,0 +1 @@ +version = "2.0.*" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pycocotools/pycocotools/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pycocotools/pycocotools/__init__.pyi new file mode 100644 index 000000000..f8b7a404e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pycocotools/pycocotools/__init__.pyi @@ -0,0 +1,6 @@ +from typing_extensions import TypedDict + +# Unused in this module, but imported in multiple submodules. +class _EncodedRLE(TypedDict): # noqa: Y049 + size: list[int] + counts: str | bytes diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pycocotools/pycocotools/coco.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pycocotools/pycocotools/coco.pyi new file mode 100644 index 000000000..1cb93c63f --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pycocotools/pycocotools/coco.pyi @@ -0,0 +1,94 @@ +from _typeshed import Incomplete +from collections.abc import Collection, Sequence +from pathlib import Path +from typing import Generic, TypeVar, overload +from typing_extensions import Literal, TypeAlias, TypedDict + +from . import _EncodedRLE + +# TODO: Use numpy types when #5768 is resolved. +# import numpy as np +# import numpy.typing as npt + +PYTHON_VERSION: Incomplete +_NDArray: TypeAlias = Incomplete + +class _Image(TypedDict): + id: int + width: int + height: int + file_name: str + +_TPolygonSegmentation: TypeAlias = list[list[float]] + +class _RLE(TypedDict): + size: list[int] + counts: list[int] + +class _Annotation(TypedDict): + id: int + image_id: int + category_id: int + segmentation: _TPolygonSegmentation | _RLE | _EncodedRLE + area: float + bbox: list[float] + iscrowd: int + +_TSeg = TypeVar("_TSeg", _TPolygonSegmentation, _RLE, _EncodedRLE) + +class _AnnotationG(TypedDict, Generic[_TSeg]): + id: int + image_id: int + category_id: int + segmentation: _TSeg + area: float + bbox: list[float] + iscrowd: int + +class _Category(TypedDict): + id: int + name: str + supercategory: str + +class _Dataset(TypedDict): + images: list[_Image] + annotations: list[_Annotation] + categories: list[_Category] + +class COCO: + anns: dict[int, _Annotation] + dataset: _Dataset + cats: dict[int, _Category] + imgs: dict[int, _Image] + imgToAnns: dict[int, list[_Annotation]] + catToImgs: dict[int, list[int]] + def __init__(self, annotation_file: str | Path | None = ...) -> None: ... + def createIndex(self) -> None: ... + def info(self) -> None: ... + def getAnnIds( + self, + imgIds: Collection[int] | int = ..., + catIds: Collection[int] | int = ..., + areaRng: Sequence[float] = ..., + iscrowd: bool | None = ..., + ) -> list[int]: ... + def getCatIds( + self, catNms: Collection[str] | str = ..., supNms: Collection[str] | str = ..., catIds: Collection[int] | int = ... + ) -> list[int]: ... + def getImgIds(self, imgIds: Collection[int] | int = ..., catIds: list[int] | int = ...) -> list[int]: ... + def loadAnns(self, ids: Collection[int] | int = ...) -> list[_Annotation]: ... + def loadCats(self, ids: Collection[int] | int = ...) -> list[_Category]: ... + def loadImgs(self, ids: Collection[int] | int = ...) -> list[_Image]: ... + def showAnns(self, anns: Sequence[_Annotation], draw_bbox: bool = ...) -> None: ... + def loadRes(self, resFile: str) -> COCO: ... + def download(self, tarDir: str | None = ..., imgIds: Collection[int] = ...) -> Literal[-1] | None: ... + def loadNumpyAnnotations(self, data: _NDArray) -> list[_Annotation]: ... + # def loadNumpyAnnotations(self, data: npt.NDArray[np.float64]) -> list[_Annotation]: ... + @overload + def annToRLE(self, ann: _AnnotationG[_RLE]) -> _RLE: ... + @overload + def annToRLE(self, ann: _AnnotationG[_EncodedRLE]) -> _EncodedRLE: ... + @overload + def annToRLE(self, ann: _AnnotationG[_TPolygonSegmentation]) -> _EncodedRLE: ... + def annToMask(self, ann: _Annotation) -> _NDArray: ... + # def annToMask(self, ann: _Annotation) -> npt.NDArray[np.uint8]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pycocotools/pycocotools/cocoeval.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pycocotools/pycocotools/cocoeval.pyi new file mode 100644 index 000000000..1fd74e517 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pycocotools/pycocotools/cocoeval.pyi @@ -0,0 +1,76 @@ +from _typeshed import Incomplete +from typing_extensions import Literal, TypeAlias, TypedDict + +from .coco import COCO + +# TODO: Use numpy types when #5768 is resolved. +# import numpy as np +# import numpy.typing as npt + +_NDArray: TypeAlias = Incomplete +_TIOU: TypeAlias = Literal["segm", "bbox", "keypoints"] + +class _ImageEvaluationResult(TypedDict): + image_id: int + category_id: int + aRng: list[int] + maxDet: int + dtIds: list[int] + gtIds: list[int] + dtMatches: _NDArray + # dtMatches: npt.NDArray[np.float64] + gtMatches: _NDArray + # gtMatches: npt.NDArray[np.float64] + dtScores: list[float] + gtIgnore: _NDArray + # gtIgnore: npt.NDArray[np.float64] + dtIgnore: _NDArray + # dtIgnore: npt.NDArray[np.float64] + +class _EvaluationResult(TypedDict): + params: Params + counts: list[int] + date: str + # precision: npt.NDArray[np.float64] + precision: _NDArray + # recall: npt.NDArray[np.float64] + recall: _NDArray + # scores: npt.NDArray[np.float64] + scores: _NDArray + +class COCOeval: + cocoGt: COCO + cocoDt: COCO + evalImgs: list[_ImageEvaluationResult] + eval: _EvaluationResult + params: Params + stats: _NDArray + # stats: npt.NDArray[np.float64] + ious: dict[tuple[int, int], list[float]] + def __init__(self, cocoGt: COCO | None = ..., cocoDt: COCO | None = ..., iouType: _TIOU = ...) -> None: ... + def evaluate(self) -> None: ... + def computeIoU(self, imgId: int, catId: int) -> list[float]: ... + def computeOks(self, imgId: int, catId: int) -> _NDArray: ... + # def computeOks(self, imgId: int, catId: int) -> npt.NDArray[np.float64]: ... + def evaluateImg(self, imgId: int, catId: int, aRng: list[int], maxDet: int) -> _ImageEvaluationResult: ... + def accumulate(self, p: Params | None = ...) -> None: ... + def summarize(self) -> None: ... + +class Params: + imgIds: list[int] + catIds: list[int] + iouThrs: _NDArray + # iouThrs: npt.NDArray[np.float64] + recThrs: _NDArray + # recThrs: npt.NDArray[np.float64] + maxDets: list[int] + areaRng: list[list[float]] + areaRngLbl: list[str] + useCats: int + kpt_oks_sigmas: _NDArray + # kpt_oks_sigmas: npt.NDArray[np.float64] + iouType: _TIOU + useSegm: int | None + def __init__(self, iouType: _TIOU = ...) -> None: ... + def setDetParams(self) -> None: ... + def setKpParams(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pycocotools/pycocotools/mask.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pycocotools/pycocotools/mask.pyi new file mode 100644 index 000000000..07d30d662 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pycocotools/pycocotools/mask.pyi @@ -0,0 +1,31 @@ +from _typeshed import Incomplete +from typing import Any, overload +from typing_extensions import TypeAlias + +from . import _EncodedRLE + +# TODO: Use numpy types when #5768 is resolved. +# import numpy as np +# import numpy.typing as npt + +_NPUInt32: TypeAlias = Incomplete # np.uint32 +_NDArrayUInt8: TypeAlias = Incomplete # npt.NDArray[np.uint8] +_NDArrayUInt32: TypeAlias = Incomplete # npt.NDArray[np.uint32] +_NDArrayFloat64: TypeAlias = Incomplete # npt.NDArray[np.float64] + +def iou( + dt: _NDArrayUInt32 | list[float] | list[_EncodedRLE], + gt: _NDArrayUInt32 | list[float] | list[_EncodedRLE], + pyiscrowd: list[int] | _NDArrayUInt8, +) -> list[Any] | _NDArrayFloat64: ... +def merge(rleObjs: list[_EncodedRLE], intersect: int = ...) -> _EncodedRLE: ... + +# ignore an "overlapping overloads" error due to _NDArrayInt32 being an alias for `Incomplete` for now +@overload +def frPyObjects(pyobj: _NDArrayUInt32 | list[list[int]] | list[_EncodedRLE], h: int, w: int) -> list[_EncodedRLE]: ... # type: ignore[misc] +@overload +def frPyObjects(pyobj: list[int] | _EncodedRLE, h: int, w: int) -> _EncodedRLE: ... +def encode(bimask: _NDArrayUInt8) -> _EncodedRLE: ... +def decode(rleObjs: _EncodedRLE) -> _NDArrayUInt8: ... +def area(rleObjs: _EncodedRLE) -> _NPUInt32: ... +def toBbox(rleObjs: _EncodedRLE) -> _NDArrayFloat64: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pycurl/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/pycurl/METADATA.toml index 575cf2229..454b5b899 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pycurl/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/pycurl/METADATA.toml @@ -1,4 +1,15 @@ -version = "7.45.*" +version = "7.45.2" [tool.stubtest] +# Install on Windows requires building PycURL from source +# +# Install on MacOS is too complicated for the CI and does not work with stubtest: +# % brew install openssl +# % export LDFLAGS="-L/usr/local/opt/openssl@3/lib" +# % export CPPFLAGS="-I/usr/local/opt/openssl@3/include" +# % pip install --compile --install-option="--with-openssl" pycurl +# TODO: Test on Windows and/or MacOS once wheels are available. +platforms = ["linux"] apt_dependencies = ["libcurl4-openssl-dev"] +# No need to install on the CI. Leaving here as information for MacOS contributors. +# brew_dependencies = ["openssl"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pycurl/pycurl.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pycurl/pycurl.pyi index 2815eb991..2a531b2b6 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pycurl/pycurl.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pycurl/pycurl.pyi @@ -1,55 +1,60 @@ -from typing import Any -from typing_extensions import final +import sys +from _typeshed import Incomplete +from typing_extensions import Self, final -GLOBAL_ACK_EINTR: int -GLOBAL_ALL: int -GLOBAL_DEFAULT: int -GLOBAL_NOTHING: int -GLOBAL_SSL: int -GLOBAL_WIN32: int +version: str def global_init(option: int) -> None: ... def global_cleanup() -> None: ... - -version: str - -def version_info() -> tuple[int, str, int, str, int, str, int, str, tuple[str, ...], Any, int, Any]: ... +def version_info() -> ( + tuple[int, str, int, str, int, str, int, str, tuple[str, ...], Incomplete | None, int, Incomplete | None] +): ... class error(Exception): ... @final class Curl: + USERPWD: int def close(self) -> None: ... - def setopt(self, option: int, value: Any) -> None: ... + def setopt(self, option: int, value: Incomplete) -> None: ... def setopt_string(self, option: int, value: str) -> None: ... def perform(self) -> None: ... def perform_rb(self) -> bytes: ... def perform_rs(self) -> str: ... - def getinfo(self, info: Any) -> Any: ... - def getinfo_raw(self, info: Any) -> Any: ... + def getinfo(self, info: Incomplete) -> Incomplete: ... + def getinfo_raw(self, info: Incomplete) -> Incomplete: ... def reset(self) -> None: ... - def unsetopt(self, option: int) -> Any: ... - def pause(self, bitmask: Any) -> Any: ... + def unsetopt(self, option: int) -> Incomplete: ... + def pause(self, bitmask: Incomplete) -> Incomplete: ... def errstr(self) -> str: ... - # TODO(MichalPokorny): wat? - USERPWD: int + def duphandle(self) -> Self: ... + def errstr_raw(self) -> bytes: ... + def set_ca_certs(self, __value: bytes | str) -> None: ... @final class CurlMulti: def close(self) -> None: ... def add_handle(self, obj: Curl) -> None: ... def remove_handle(self, obj: Curl) -> None: ... - def setopt(self, option: int, value: Any) -> None: ... - def perform(self) -> tuple[Any, int]: ... - def fdset(self) -> tuple[list[Any], list[Any], list[Any]]: ... + def setopt(self, option: int, value: Incomplete) -> None: ... + def perform(self) -> tuple[Incomplete, int]: ... + def fdset(self) -> tuple[list[Incomplete], list[Incomplete], list[Incomplete]]: ... def select(self, timeout: float = ...) -> int: ... - def info_read(self, max_objects: int = ...) -> tuple[int, list[Any], list[Any]]: ... + def info_read(self, max_objects: int = ...) -> tuple[int, list[Incomplete], list[Incomplete]]: ... def socket_action(self, sockfd: int, ev_bitmask: int) -> tuple[int, int]: ... + def assign(self, __sockfd: int, __socket: Incomplete) -> Incomplete: ... + def socket_all(self) -> tuple[int, int]: ... + def timeout(self) -> int: ... @final class CurlShare: def close(self) -> None: ... - def setopt(self, option: int, value: Any) -> Any: ... + def setopt(self, option: int, value: Incomplete) -> Incomplete: ... + +if sys.platform != "darwin": + CURL_VERSION_HTTP3: int + MAXAGE_CONN: int + M_MAX_CONCURRENT_STREAMS: int ACCEPTTIMEOUT_MS: int ACCEPT_ENCODING: int @@ -86,9 +91,20 @@ CSELECT_OUT: int CURL_HTTP_VERSION_1_0: int CURL_HTTP_VERSION_1_1: int CURL_HTTP_VERSION_2: int +CURL_HTTP_VERSION_2TLS: int CURL_HTTP_VERSION_2_0: int +CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE: int +CURL_HTTP_VERSION_3: int CURL_HTTP_VERSION_LAST: int CURL_HTTP_VERSION_NONE: int +CURL_VERSION_ALTSVC: int +CURL_VERSION_BROTLI: int +CURL_VERSION_GSASL: int +CURL_VERSION_HSTS: int +CURL_VERSION_HTTPS_PROXY: int +CURL_VERSION_MULTI_SSL: int +CURL_VERSION_UNICODE: int +CURL_VERSION_ZSTD: int CUSTOMREQUEST: int DEBUGFUNCTION: int DEFAULT_PROTOCOL: int @@ -96,6 +112,7 @@ DIRLISTONLY: int DNS_CACHE_TIMEOUT: int DNS_SERVERS: int DNS_USE_GLOBAL_CACHE: int +DOH_URL: int EFFECTIVE_URL: int EGDSOCKET: int ENCODING: int @@ -138,16 +155,24 @@ FTP_SSL_CCC: int FTP_USE_EPRT: int FTP_USE_EPSV: int FTP_USE_PRET: int +GLOBAL_ACK_EINTR: int +GLOBAL_ALL: int +GLOBAL_DEFAULT: int +GLOBAL_NOTHING: int +GLOBAL_SSL: int +GLOBAL_WIN32: int GSSAPI_DELEGATION: int GSSAPI_DELEGATION_FLAG: int GSSAPI_DELEGATION_NONE: int GSSAPI_DELEGATION_POLICY_FLAG: int +HAPROXYPROTOCOL: int HEADER: int HEADERFUNCTION: int HEADEROPT: int HEADER_SEPARATE: int HEADER_SIZE: int HEADER_UNIFIED: int +HTTP09_ALLOWED: int HTTP200ALIASES: int HTTPAUTH: int HTTPAUTH_ANY: int @@ -221,8 +246,10 @@ LOCALPORT: int LOCALPORTRANGE: int LOCAL_IP: int LOCAL_PORT: int +LOCK_DATA_CONNECT: int LOCK_DATA_COOKIE: int LOCK_DATA_DNS: int +LOCK_DATA_PSL: int LOCK_DATA_SSL_SESSION: int LOGIN_OPTIONS: int LOW_SPEED_LIMIT: int @@ -233,6 +260,7 @@ MAIL_RCPT: int MAXCONNECTS: int MAXFILESIZE: int MAXFILESIZE_LARGE: int +MAXLIFETIME_CONN: int MAXREDIRS: int MAX_RECV_SPEED_LARGE: int MAX_SEND_SPEED_LARGE: int @@ -279,6 +307,7 @@ PAUSE_RECV: int PAUSE_SEND: int PINNEDPUBLICKEY: int PIPEWAIT: int +PIPE_HTTP1: int PIPE_MULTIPLEX: int PIPE_NOTHING: int POLL_IN: int @@ -354,6 +383,7 @@ PROXY_SSLKEY: int PROXY_SSLKEYTYPE: int PROXY_SSL_VERIFYHOST: int PROXY_SSL_VERIFYPEER: int +PROXY_TLS13_CIPHERS: int PROXY_TRANSFER_MODE: int PUT: int QUOTE: int @@ -439,13 +469,18 @@ SSLOPT_ALLOW_BEAST: int SSLOPT_NO_REVOKE: int SSLVERSION: int SSLVERSION_DEFAULT: int +SSLVERSION_MAX_DEFAULT: int +SSLVERSION_MAX_TLSv1_0: int +SSLVERSION_MAX_TLSv1_1: int +SSLVERSION_MAX_TLSv1_2: int +SSLVERSION_MAX_TLSv1_3: int SSLVERSION_SSLv2: int SSLVERSION_SSLv3: int SSLVERSION_TLSv1: int SSLVERSION_TLSv1_0: int SSLVERSION_TLSv1_1: int SSLVERSION_TLSv1_2: int -SSLVERSION_MAX_DEFAULT: int +SSLVERSION_TLSv1_3: int SSL_CIPHER_LIST: int SSL_ENABLE_ALPN: int SSL_ENABLE_NPN: int @@ -474,6 +509,7 @@ TIMECONDITION_NONE: int TIMEOUT: int TIMEOUT_MS: int TIMEVALUE: int +TLS13_CIPHERS: int TLSAUTH_PASSWORD: int TLSAUTH_TYPE: int TLSAUTH_USERNAME: int @@ -483,6 +519,7 @@ TRANSFER_ENCODING: int UNIX_SOCKET_PATH: int UNRESTRICTED_AUTH: int UPLOAD: int +UPLOAD_BUFFERSIZE: int URL: int USERAGENT: int USERNAME: int @@ -497,7 +534,6 @@ VERSION_ASYNCHDNS: int VERSION_CONV: int VERSION_CURLDEBUG: int VERSION_DEBUG: int -VERSION_FIRST: int VERSION_GSSAPI: int VERSION_GSSNEGOTIATE: int VERSION_HTTP2: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyfarmhash/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/pyfarmhash/METADATA.toml index 67a2d5dde..d25c8f7d6 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pyfarmhash/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyfarmhash/METADATA.toml @@ -1,4 +1 @@ version = "0.3.*" - -[tool.stubtest] -ignore_missing_stub = false diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyflakes/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/pyflakes/METADATA.toml index 43ea0392c..7f11ff387 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pyflakes/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyflakes/METADATA.toml @@ -1 +1,4 @@ -version = "2.5.*" +version = "3.0.*" + +[tool.stubtest] +ignore_missing_stub = true diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyflakes/pyflakes/checker.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyflakes/pyflakes/checker.pyi index 4ed32421d..63a656387 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pyflakes/pyflakes/checker.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyflakes/pyflakes/checker.pyi @@ -2,7 +2,6 @@ import ast import sys from collections.abc import Callable, Iterable, Iterator from re import Pattern -from tokenize import TokenInfo from typing import Any, ClassVar, TypeVar, overload from typing_extensions import Literal, ParamSpec, TypeAlias @@ -19,10 +18,6 @@ PYPY: bool def getAlternatives(n: ast.If | ast.Try) -> list[ast.AST]: ... FOR_TYPES: tuple[type[ast.For], type[ast.AsyncFor]] -TYPE_COMMENT_RE: Pattern[str] -ASCII_NON_ALNUM: str -TYPE_IGNORE_RE: Pattern[str] -TYPE_FUNC_RE: Pattern[str] MAPPING_KEY_RE: Pattern[str] CONVERSION_FLAG_RE: Pattern[str] WIDTH_RE: Pattern[str] @@ -122,17 +117,13 @@ class FunctionScope(Scope): returnValue: Any isGenerator: bool def __init__(self) -> None: ... - def unusedAssignments(self) -> Iterator[tuple[str, Binding]]: ... + def unused_assignments(self) -> Iterator[tuple[str, Binding]]: ... + def unused_annotations(self) -> Iterator[tuple[str, Annotation]]: ... class GeneratorScope(Scope): ... class ModuleScope(Scope): ... class DoctestScope(ModuleScope): ... -class DummyNode: - lineno: int - col_offset: int - def __init__(self, lineno: int, col_offset: int) -> None: ... - class DetectClassScopedMagic: names: list[str] @@ -149,7 +140,6 @@ class AnnotationState: def in_annotation(func: _F) -> _F: ... def in_string_annotation(func: _F) -> _F: ... -def make_tokens(code: str | bytes) -> tuple[TokenInfo, ...]: ... if sys.version_info >= (3, 8): _NamedExpr: TypeAlias = ast.NamedExpr @@ -222,7 +212,7 @@ class Checker: def differentForks(self, lnode: ast.AST, rnode: ast.AST) -> bool: ... def addBinding(self, node: ast.AST, value: Binding) -> None: ... def getNodeHandler(self, node_class: type[ast.AST]): ... - def handleNodeLoad(self, node: ast.AST) -> None: ... + def handleNodeLoad(self, node: ast.AST, parent: ast.AST) -> None: ... def handleNodeStore(self, node: ast.AST) -> None: ... def handleNodeDelete(self, node: ast.AST) -> None: ... def handleChildren(self, tree: ast.AST, omit: _OmitType = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyflakes/pyflakes/messages.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyflakes/pyflakes/messages.pyi index e4d6ebabb..9cad06981 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pyflakes/pyflakes/messages.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyflakes/pyflakes/messages.pyi @@ -75,6 +75,10 @@ class UnusedVariable(Message): message_args: tuple[Any] def __init__(self, filename, loc: ast.AST, names) -> None: ... +class UnusedAnnotation(Message): + message_args: tuple[Any] + def __init__(self, filename, loc: ast.AST, names) -> None: ... + class ReturnOutsideFunction(Message): ... class YieldOutsideFunction(Message): ... class ContinueOutsideLoop(Message): ... @@ -90,10 +94,6 @@ class ForwardAnnotationSyntaxError(Message): message_args: tuple[Any] def __init__(self, filename, loc: ast.AST, annotation) -> None: ... -class CommentAnnotationSyntaxError(Message): - message_args: tuple[Any] - def __init__(self, filename, loc: ast.AST, annotation) -> None: ... - class RaiseNotImplemented(Message): ... class InvalidPrintSyntax(Message): ... class IsLiteral(Message): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/METADATA.toml new file mode 100644 index 000000000..8159c1eba --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/METADATA.toml @@ -0,0 +1,2 @@ +version = "5.9.*" +requires = ["types-setuptools"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/__init__.pyi new file mode 100644 index 000000000..fc98d648b --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/__init__.pyi @@ -0,0 +1,11 @@ +from typing_extensions import Final, LiteralString + +from PyInstaller import compat as compat + +__all__ = ("HOMEPATH", "PLATFORM", "__version__", "DEFAULT_DISTPATH", "DEFAULT_SPECPATH", "DEFAULT_WORKPATH") +__version__: Final[str] +HOMEPATH: Final[str] +DEFAULT_SPECPATH: Final[str] +DEFAULT_DISTPATH: Final[str] +DEFAULT_WORKPATH: Final[str] +PLATFORM: Final[LiteralString] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/__main__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/__main__.pyi new file mode 100644 index 000000000..971aa66a7 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/__main__.pyi @@ -0,0 +1,14 @@ +# https://pyinstaller.org/en/stable/usage.html#running-pyinstaller-from-python-code +import logging +from _typeshed import SupportsKeysAndGetItem +from collections.abc import Iterable +from typing_extensions import TypeAlias + +# Used to update PyInstaller.config.CONF +_PyIConfig: TypeAlias = ( + SupportsKeysAndGetItem[str, bool | str | list[str] | None] | Iterable[tuple[str, bool | str | list[str] | None]] +) + +logger: logging.Logger + +def run(pyi_args: Iterable[str] | None = None, pyi_config: _PyIConfig | None = None) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/building/__init__.pyi similarity index 100% rename from packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/__init__.pyi rename to packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/building/__init__.pyi diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/building/build_main.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/building/build_main.pyi new file mode 100644 index 000000000..ccde42bc0 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/building/build_main.pyi @@ -0,0 +1,29 @@ +# Referenced in: https://pyinstaller.org/en/stable/hooks.html?highlight=get_hook_config#PyInstaller.utils.hooks.get_hook_config +# Not to be imported during runtime, but is the type reference for hooks and analysis configuration + +from _typeshed import Incomplete, StrPath +from collections.abc import Iterable +from typing import Any + +from PyInstaller.building.datastruct import Target + +class Analysis(Target): + # https://pyinstaller.org/en/stable/hooks-config.html#hook-configuration-options + hooksconfig: dict[str, dict[str, object]] + def __init__( + self, + scripts: Iterable[StrPath], + pathex: Incomplete | None = None, + binaries: Incomplete | None = None, + datas: Incomplete | None = None, + hiddenimports: Incomplete | None = None, + hookspath: Incomplete | None = None, + hooksconfig: dict[str, dict[str, Any]] | None = None, + excludes: Incomplete | None = None, + runtime_hooks: Incomplete | None = None, + cipher: Incomplete | None = None, + win_no_prefer_redirects: bool = False, + win_private_assemblies: bool = False, + noarchive: bool = False, + module_collection_mode: Incomplete | None = None, + ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/building/datastruct.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/building/datastruct.pyi new file mode 100644 index 000000000..e225e60ba --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/building/datastruct.pyi @@ -0,0 +1,34 @@ +# https://pyinstaller.org/en/stable/advanced-topics.html#the-toc-and-tree-classes +from collections.abc import Iterable, Sequence +from typing import ClassVar +from typing_extensions import Literal, LiteralString, SupportsIndex, TypeAlias + +_TypeCode: TypeAlias = Literal["DATA", "BINARY", "EXTENSION", "OPTION"] +_TOCTuple: TypeAlias = tuple[str, str | None, _TypeCode | None] + +class TOC(list[_TOCTuple]): + filenames: set[str] + def __init__(self, initlist: Iterable[_TOCTuple] | None = None) -> None: ... + def append(self, entry: _TOCTuple) -> None: ... + def insert(self, pos: SupportsIndex, entry: _TOCTuple) -> None: ... + def extend(self, other: Iterable[_TOCTuple]) -> None: ... + +class Target: + invcnum: ClassVar[int] + tocfilename: LiteralString + tocbasename: LiteralString + dependencies: TOC + +class Tree(Target, TOC): + root: str | None + prefix: str | None + excludes: Sequence[str] + typecode: _TypeCode + def __init__( + self, + root: str | None = None, + prefix: str | None = None, + excludes: Sequence[str] | None = None, + typecode: _TypeCode = "DATA", + ) -> None: ... + def assemble(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/compat.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/compat.pyi new file mode 100644 index 000000000..664a9b2df --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/compat.pyi @@ -0,0 +1,81 @@ +# https://pyinstaller.org/en/stable/hooks.html#module-PyInstaller.compat +from _typeshed import FileDescriptorOrPath, GenericPath +from collections.abc import Iterable +from types import ModuleType +from typing import AnyStr, overload +from typing_extensions import Final, Literal + +strict_collect_mode: bool +is_64bits: Final[bool] +is_py35: Final = True +is_py36: Final = True +is_py37: Final[bool] +is_py38: Final[bool] +is_py39: Final[bool] +is_py310: Final[bool] +is_py311: Final[bool] +is_win: Final[bool] +is_win_10: Final[bool] +is_win_wine: Final[bool] +is_cygwin: Final[bool] +is_darwin: Final[bool] +is_linux: Final[bool] +is_solar: Final[bool] +is_aix: Final[bool] +is_freebsd: Final[bool] +is_openbsd: Final[bool] +is_hpux: Final[bool] +is_unix: Final[bool] +is_musl: Final[bool] +is_macos_11_compat: Final[bool] +is_macos_11_native: Final[bool] +is_macos_11: Final[bool] +PYDYLIB_NAMES: Final[set[str]] +base_prefix: Final[str] +is_venv: Final[bool] +is_virtualenv: Final[bool] +is_conda: Final[bool] +is_pure_conda: Final[bool] +python_executable: Final[str] +is_ms_app_store: Final[bool] +BYTECODE_MAGIC: Final[bytes] +EXTENSION_SUFFIXES: Final[list[str]] +ALL_SUFFIXES: Final[list[str]] + +architecture: Final[Literal["64bit", "n32bit", "32bit"]] +system: Final[Literal["Cygwin", "Linux", "Darwin", "Java", "Windows"]] +machine: Final[Literal["sw_64", "loongarch64", "arm", "intel", "ppc", "mips", "riscv", "s390x", "unknown", None]] + +def is_wine_dll(filename: FileDescriptorOrPath) -> bool: ... +@overload +def getenv(name: str, default: str) -> str: ... +@overload +def getenv(name: str, default: None = None) -> str | None: ... +def setenv(name: str, value: str) -> None: ... +def unsetenv(name: str) -> None: ... +def exec_command( + *cmdargs: str, encoding: str | None = None, raise_enoent: bool | None = None, **kwargs: int | bool | Iterable[int] | None +) -> str: ... +def exec_command_rc(*cmdargs: str, **kwargs: float | bool | Iterable[int] | None) -> int: ... +def exec_command_stdout( + *command_args: str, encoding: str | None = None, **kwargs: float | str | bytes | bool | Iterable[int] | None +) -> str: ... +def exec_command_all( + *cmdargs: str, encoding: str | None = None, **kwargs: int | bool | Iterable[int] | None +) -> tuple[int, str, str]: ... +def exec_python(*args: str, **kwargs: str | None) -> str: ... +def exec_python_rc(*args: str, **kwargs: str | None) -> int: ... +def expand_path(path: GenericPath[AnyStr]) -> AnyStr: ... +def getsitepackages(prefixes: Iterable[str] | None = None) -> list[str]: ... +def importlib_load_source(name: str, pathname: str) -> ModuleType: ... + +PY3_BASE_MODULES: Final[set[str]] +PURE_PYTHON_MODULE_TYPES: Final[set[str]] +SPECIAL_MODULE_TYPES: Final[set[str]] +BINARY_MODULE_TYPES: Final[set[str]] +VALID_MODULE_TYPES: Final[set[str]] +BAD_MODULE_TYPES: Final[set[str]] +ALL_MODULE_TYPES: Final[set[str]] +MODULE_TYPES_TO_TOC_DICT: Final[dict[str, str]] + +def check_requirements() -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/depend/__init__.pyi similarity index 100% rename from packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/__init__.pyi rename to packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/depend/__init__.pyi diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/depend/analysis.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/depend/analysis.pyi new file mode 100644 index 000000000..84a0ec466 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/depend/analysis.pyi @@ -0,0 +1,27 @@ +# https://pyinstaller.org/en/stable/hooks.html#the-pre-safe-import-module-psim-api-method + +# The documentation explicitly mentions that "Normally you do not need to know about the module-graph." +# However, some PyiModuleGraph typed class attributes are still documented as existing in imphookapi. +from _typeshed import Incomplete, StrPath, SupportsKeysAndGetItem +from collections.abc import Iterable +from typing_extensions import TypeAlias + +from PyInstaller.lib.modulegraph.modulegraph import Alias, Node + +_LazyNode: TypeAlias = Iterable[Node] | Iterable[str] | Alias | None +# from altgraph.Graph import Graph +_Graph: TypeAlias = Incomplete + +class PyiModuleGraph: # incomplete + def __init__( + self, + pyi_homepath: str, + user_hook_dirs: Iterable[StrPath] = ..., + excludes: Iterable[str] = ..., + *, + path: Iterable[str] | None = None, + replace_paths: Iterable[tuple[StrPath, StrPath]] = ..., + implies: SupportsKeysAndGetItem[str, _LazyNode] | Iterable[tuple[str, _LazyNode]] = ..., + graph: _Graph | None = None, + debug: bool = False, + ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/depend/imphookapi.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/depend/imphookapi.pyi new file mode 100644 index 000000000..a5fddf4bd --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/depend/imphookapi.pyi @@ -0,0 +1,70 @@ +# https://pyinstaller.org/en/stable/hooks-config.html#adding-an-option-to-the-hook `hook_api` is a PostGraphAPI +# Nothing in this module is meant to be initialized externally. +# Instances are exposed through hooks during build. + +from _typeshed import StrOrBytesPath +from collections.abc import Generator, Iterable +from types import CodeType +from typing_extensions import Literal + +from PyInstaller.building.build_main import Analysis +from PyInstaller.building.datastruct import TOC +from PyInstaller.depend.analysis import PyiModuleGraph +from PyInstaller.lib.modulegraph.modulegraph import Package + +# https://pyinstaller.org/en/stable/hooks.html#the-pre-safe-import-module-psim-api-method +class PreSafeImportModuleAPI: + module_basename: str + module_name: str + def __init__( + self, module_graph: PyiModuleGraph, module_basename: str, module_name: str, parent_package: Package | None + ) -> None: ... + @property + def module_graph(self) -> PyiModuleGraph: ... + @property + def parent_package(self) -> Package | None: ... + def add_runtime_module(self, module_name: str) -> None: ... + def add_runtime_package(self, package_name: str) -> None: ... + def add_alias_module(self, real_module_name: str, alias_module_name: str) -> None: ... + def append_package_path(self, directory: str) -> None: ... + +# https://pyinstaller.org/en/stable/hooks.html#the-pre-find-module-path-pfmp-api-method +class PreFindModulePathAPI: + search_dirs: Iterable[StrOrBytesPath] + def __init__(self, module_graph: PyiModuleGraph, module_name: str, search_dirs: Iterable[StrOrBytesPath]) -> None: ... + @property + def module_graph(self) -> PyiModuleGraph: ... + @property + def module_name(self) -> str: ... + +# https://pyinstaller.org/en/stable/hooks.html#the-hook-hook-api-function +class PostGraphAPI: + module_graph: PyiModuleGraph + module: Package + def __init__(self, module_name: str, module_graph: PyiModuleGraph, analysis: Analysis) -> None: ... + @property + def __file__(self) -> str: ... + @property + def __path__(self) -> tuple[str, ...] | None: ... + @property + def __name__(self) -> str: ... + # Compiled code. See stdlib.builtins.compile + @property + def co(self) -> CodeType: ... + @property + def analysis(self) -> Analysis: ... + @property + def name(self) -> str: ... + @property + def graph(self) -> PyiModuleGraph: ... + @property + def node(self) -> Package: ... + @property + def imports(self) -> Generator[Package, None, None]: ... + def add_imports(self, *module_names: str) -> None: ... + def del_imports(self, *module_names: str) -> None: ... + def add_binaries(self, list_of_tuples: TOC | Iterable[tuple[StrOrBytesPath, StrOrBytesPath]]) -> None: ... + def add_datas(self, list_of_tuples: TOC | Iterable[tuple[StrOrBytesPath, StrOrBytesPath]]) -> None: ... + def set_module_collection_mode( + self, name: str | None, mode: Literal["pyz", "pyc", "py", "pyz+py", "py+pyz", None] + ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/isolated/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/isolated/__init__.pyi new file mode 100644 index 000000000..6f084bfc4 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/isolated/__init__.pyi @@ -0,0 +1,2 @@ +# https://pyinstaller.org/en/stable/hooks.html#module-PyInstaller.isolated +from PyInstaller.isolated._parent import Python as Python, call as call, decorate as decorate diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/isolated/_parent.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/isolated/_parent.pyi new file mode 100644 index 000000000..2f0b295d7 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/isolated/_parent.pyi @@ -0,0 +1,19 @@ +from collections.abc import Callable +from types import TracebackType +from typing import TypeVar +from typing_extensions import ParamSpec, Self + +_AC = TypeVar("_AC", bound=Callable[..., object]) +_R = TypeVar("_R") +_P = ParamSpec("_P") + +class Python: + def __init__(self, strict_mode: bool | None = None) -> None: ... + def __enter__(self) -> Self: ... + def __exit__( + self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None + ) -> None: ... + def call(self, function: Callable[_P, _R], *args: _P.args, **kwargs: _P.kwargs) -> _R: ... + +def call(function: Callable[_P, _R], *args: _P.args, **kwargs: _P.kwargs) -> _R: ... +def decorate(function: _AC) -> _AC: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/lib/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/lib/__init__.pyi new file mode 100644 index 000000000..e69de29bb diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/lib/modulegraph/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/lib/modulegraph/__init__.pyi new file mode 100644 index 000000000..e69de29bb diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/lib/modulegraph/modulegraph.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/lib/modulegraph/modulegraph.pyi new file mode 100644 index 000000000..ae19c98e1 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/lib/modulegraph/modulegraph.pyi @@ -0,0 +1,45 @@ +# Partial typing of the vendored modulegraph package. +# We reference the vendored package rather than depending on the original untyped module. +# Anything not referenced in the PyInstaller stubs doesn't need to be added here. + +from types import CodeType +from typing import Protocol + +class _SupportsGraphident(Protocol): + graphident: str + +# code, filename and packagepath are always initialized to None. But they can be given a value later. +class Node: + # Compiled code. See stdlib.builtins.compile + code: CodeType | None + filename: str | None + graphident: str + identifier: str + packagepath: str | None + def __init__(self, identifier: str) -> None: ... + def is_global_attr(self, attr_name: str) -> bool: ... + def is_submodule(self, submodule_basename: str) -> bool: ... + def add_global_attr(self, attr_name: str) -> None: ... + def add_global_attrs_from_module(self, target_module: Node) -> None: ... + def add_submodule(self, submodule_basename: str, submodule_node: Node) -> None: ... + def get_submodule(self, submodule_basename: str) -> Node: ... + def get_submodule_or_none(self, submodule_basename: str) -> Node | None: ... + def remove_global_attr_if_found(self, attr_name: str) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __ne__(self, other: object) -> bool: ... + def __lt__(self, other: _SupportsGraphident) -> bool: ... + def __le__(self, other: _SupportsGraphident) -> bool: ... + def __gt__(self, other: _SupportsGraphident) -> bool: ... + def __ge__(self, other: _SupportsGraphident) -> bool: ... + def infoTuple(self) -> tuple[str]: ... + +class Alias(str): ... + +class BaseModule(Node): + filename: str + packagepath: str + def __init__(self, name: str, filename: str | None = None, path: str | None = None) -> None: ... + # Returns a tuple of length 0, 1, 2, or 3 + def infoTuple(self) -> tuple[str, ...]: ... # type: ignore[override] + +class Package(BaseModule): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/utils/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/utils/__init__.pyi new file mode 100644 index 000000000..e69de29bb diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/utils/hooks/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/utils/hooks/__init__.pyi new file mode 100644 index 000000000..b2ee86387 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/utils/hooks/__init__.pyi @@ -0,0 +1,82 @@ +# https://pyinstaller.org/en/stable/hooks.html + +import logging +from _typeshed import StrOrBytesPath, StrPath +from collections.abc import Callable, Iterable +from typing import Any +from typing_extensions import Final, Literal + +import pkg_resources +from PyInstaller import HOMEPATH as HOMEPATH +from PyInstaller.depend.imphookapi import PostGraphAPI +from PyInstaller.utils.hooks import conda +from PyInstaller.utils.hooks.win32 import get_pywin32_module_file_attribute as get_pywin32_module_file_attribute + +conda_support = conda + +logger: logging.Logger +PY_IGNORE_EXTENSIONS: Final[set[str]] +hook_variables: dict[str, str] + +def exec_statement(statement: str) -> str | int: ... +def exec_statement_rc(statement: str) -> str | int: ... +def eval_statement(statement: str) -> Any | Literal[""]: ... +def get_pyextension_imports(module_name: str) -> list[str]: ... +def get_homebrew_path(formula: str = "") -> str | None: ... +def remove_prefix(string: str, prefix: str) -> str: ... +def remove_suffix(string: str, suffix: str) -> str: ... +def remove_file_extension(filename: str) -> str: ... +def can_import_module(module_name: str) -> bool: ... +def get_module_attribute(module_name: str, attr_name: str) -> Any: ... +def get_module_file_attribute(package: str) -> str | None: ... +def is_module_satisfies( + requirements: Iterable[str] | pkg_resources.Requirement, + version: str | pkg_resources.Distribution | None = None, + version_attr: str = "__version__", +) -> bool: ... +def is_package(module_name: str) -> bool: ... +def get_all_package_paths(package: str) -> list[str]: ... +def package_base_path(package_path: str, package: str) -> str: ... +def get_package_paths(package: str) -> tuple[str, str]: ... +def collect_submodules( + package: str, filter: Callable[[str], bool] = ..., on_error: Literal["ignore", "warn once", "warn", "raise"] = "warn once" +) -> list[str]: ... +def is_module_or_submodule(name: str, mod_or_submod: str) -> bool: ... + +PY_DYLIB_PATTERNS: Final[list[str]] + +def collect_dynamic_libs(package: str, destdir: object = None, search_patterns: Iterable[str] = ...) -> list[tuple[str, str]]: ... +def collect_data_files( + package: str, + include_py_files: bool = False, + subdir: StrPath | None = None, + excludes: Iterable[str] | None = None, + includes: Iterable[str] | None = None, +) -> list[tuple[str, str]]: ... +def collect_system_data_files( + path: str, destdir: StrPath | None = None, include_py_files: bool = False +) -> list[tuple[str, str]]: ... +def copy_metadata(package_name: str, recursive: bool = False) -> list[tuple[str, str]]: ... +def get_installer(module: str) -> str | None: ... +def requirements_for_package(package_name: str) -> list[str]: ... +def collect_all( + package_name: str, + include_py_files: bool = True, + filter_submodules: Callable[[str], bool] | None = None, + exclude_datas: Iterable[str] | None = None, + include_datas: Iterable[str] | None = None, + on_error: Literal["ignore", "warn once", "warn", "raise"] = "warn once", +) -> tuple[list[tuple[str, str]], list[tuple[str, str]], list[str]]: ... +def collect_entry_point(name: str) -> tuple[tuple[str, str], list[str]]: ... +def get_hook_config(hook_api: PostGraphAPI, module_name: str, key: str) -> None: ... +def include_or_exclude_file( + filename: StrOrBytesPath, + include_list: Iterable[StrOrBytesPath] | None = None, + exclude_list: Iterable[StrOrBytesPath] | None = None, +) -> bool: ... +def collect_delvewheel_libs_directory( + package_name: str, + libdir_name: StrPath | None = None, + datas: list[tuple[str, str]] | None = None, + binaries: list[tuple[str, str]] | None = None, +) -> tuple[list[tuple[str, str]], list[tuple[str, str]]]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/utils/hooks/conda.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/utils/hooks/conda.pyi new file mode 100644 index 000000000..fe80e7a37 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/utils/hooks/conda.pyi @@ -0,0 +1,56 @@ +# https://pyinstaller.org/en/stable/hooks.html?highlight=conda_support#module-PyInstaller.utils.hooks.conda + +import sys +from _typeshed import StrOrBytesPath +from collections.abc import Iterable +from pathlib import Path, PurePosixPath +from typing_extensions import Final, TypedDict + +if sys.version_info >= (3, 8): + from importlib.metadata import PackagePath as _PackagePath +else: + # Same as importlib_metadata.PackagePath + class _PackagePath(PurePosixPath): + def read_text(self, encoding: str = "utf-8") -> str: ... + def read_binary(self) -> str: ... + def locate(self) -> Path: ... + +CONDA_ROOT: Final[Path] +CONDA_META_DIR: Final[Path] +PYTHONPATH_PREFIXES: Final[list[Path]] + +class _RawDict(TypedDict): + name: str + version: str + files: list[StrOrBytesPath] + depends: list[str] + +class Distribution: + raw: _RawDict + name: str + version: str + files: list[PackagePath] + dependencies: list[str] + packages: list[str] + def __init__(self, json_path: str) -> None: ... + @classmethod + def from_name(cls, name: str) -> Distribution: ... + @classmethod + def from_package_name(cls, name: str) -> Distribution: ... + +# distribution and package_distribution are meant to be used and are not internal helpers +distribution = Distribution.from_name +package_distribution = Distribution.from_package_name + +class PackagePath(_PackagePath): + def locate(self) -> Path: ... + +def walk_dependency_tree(initial: str, excludes: Iterable[str] | None = None) -> dict[str, Distribution]: ... +def requires(name: str, strip_versions: bool = False) -> list[str]: ... +def files(name: str, dependencies: bool = False, excludes: Iterable[str] | None = None) -> list[PackagePath]: ... +def collect_dynamic_libs( + name: str, dest: str = ".", dependencies: bool = True, excludes: Iterable[str] | None = None +) -> list[tuple[str, str]]: ... + +distributions: dict[str, Distribution] +distributions_by_package: dict[str | None, Distribution] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/utils/hooks/win32.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/utils/hooks/win32.pyi new file mode 100644 index 000000000..ac5efe75a --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/utils/hooks/win32.pyi @@ -0,0 +1 @@ +def get_pywin32_module_file_attribute(module_name: str) -> str | None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/pyi_splash/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/pyi_splash/__init__.pyi new file mode 100644 index 000000000..18a31687e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/pyi_splash/__init__.pyi @@ -0,0 +1,12 @@ +# Referenced in: https://pyinstaller.org/en/stable/advanced-topics.html#module-pyi_splash +# Source: https://github.com/pyinstaller/pyinstaller/blob/develop/PyInstaller/fake-modules/pyi_splash.py +from typing_extensions import Final + +__all__ = ["CLOSE_CONNECTION", "FLUSH_CHARACTER", "is_alive", "close", "update_text"] + +def is_alive() -> bool: ... +def update_text(msg: str) -> None: ... +def close() -> None: ... + +CLOSE_CONNECTION: Final = b"\x04" +FLUSH_CHARACTER: Final = b"\x0D" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pynput/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/pynput/METADATA.toml index e64b5bd85..c1e49ec2b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pynput/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/pynput/METADATA.toml @@ -1,4 +1,4 @@ version = "1.7.*" [tool.stubtest] -skip = true # A display server (e.g. X11) is required to import pynput +platforms = ["darwin", "linux", "win32"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pynput/pynput/_util.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pynput/pynput/_util.pyi index 4202bcb54..87788dd6d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pynput/pynput/_util.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pynput/pynput/_util.pyi @@ -1,11 +1,10 @@ import sys import threading -from _typeshed import Self from collections.abc import Callable from queue import Queue from types import ModuleType, TracebackType from typing import Any, ClassVar, Generic, TypeVar -from typing_extensions import ParamSpec, TypedDict +from typing_extensions import ParamSpec, Self, TypedDict _T = TypeVar("_T") _AbstractListener_T = TypeVar("_AbstractListener_T", bound=AbstractListener) @@ -37,7 +36,7 @@ class AbstractListener(threading.Thread): @property def running(self) -> bool: ... def stop(self) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None ) -> None: ... @@ -60,11 +59,11 @@ class Events(Generic[_T, _AbstractListener_T]): _listener: _AbstractListener_T # undocumented start: Callable[[], None] def __init__(self, *args: Any, **kwargs: Any) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None ) -> None: ... - def __iter__(self: Self) -> Self: ... + def __iter__(self) -> Self: ... def __next__(self) -> _T: ... def get(self, timeout: float | None = ...) -> _T | None: ... def _event_mapper(self, event: Callable[_P, object]) -> Callable[_P, None]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pynput/pynput/keyboard/_base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pynput/pynput/keyboard/_base.pyi index 6c10ba3ce..a67c0d0ec 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pynput/pynput/keyboard/_base.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pynput/pynput/keyboard/_base.pyi @@ -1,8 +1,9 @@ import contextlib import enum -from _typeshed import Self +import sys from collections.abc import Callable, Iterable, Iterator from typing import Any, ClassVar +from typing_extensions import Self from pynput._util import AbstractListener @@ -15,13 +16,13 @@ class KeyCode: def __init__(self, vk: str | None = ..., char: str | None = ..., is_dead: bool = ..., **kwargs: str) -> None: ... def __eq__(self, other: object) -> bool: ... def __hash__(self) -> int: ... - def join(self: Self, key: Self) -> Self: ... + def join(self, key: Self) -> Self: ... @classmethod - def from_vk(cls: type[Self], vk: int, **kwargs: Any) -> Self: ... + def from_vk(cls, vk: int, **kwargs: Any) -> Self: ... @classmethod - def from_char(cls: type[Self], char: str, **kwargs: Any) -> Self: ... + def from_char(cls, char: str, **kwargs: Any) -> Self: ... @classmethod - def from_dead(cls: type[Self], char: str, **kwargs: Any) -> Self: ... + def from_dead(cls, char: str, **kwargs: Any) -> Self: ... class Key(enum.Enum): alt: int @@ -61,6 +62,11 @@ class Key(enum.Enum): f18: int f19: int f20: int + if sys.platform == "win32": + f21: int + f22: int + f23: int + f24: int home: int left: int page_down: int @@ -86,8 +92,12 @@ class Key(enum.Enum): scroll_lock: int class Controller: - _KeyCode: ClassVar[KeyCode] # undocumented - _Key: ClassVar[Key] # undocumented + _KeyCode: ClassVar[type[KeyCode]] # undocumented + _Key: ClassVar[type[Key]] # undocumented + + if sys.platform == "linux": + CTRL_MASK: ClassVar[int] + SHIFT_MASK: ClassVar[int] class InvalidKeyException(Exception): ... class InvalidCharacterException(Exception): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pynput/pynput/mouse/_base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pynput/pynput/mouse/_base.pyi index 181dea5a0..409da415d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pynput/pynput/mouse/_base.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pynput/pynput/mouse/_base.pyi @@ -1,8 +1,9 @@ import enum -from _typeshed import Self +import sys from collections.abc import Callable from types import TracebackType from typing import Any +from typing_extensions import Self from pynput._util import AbstractListener @@ -11,6 +12,37 @@ class Button(enum.Enum): left: int middle: int right: int + if sys.platform == "linux": + button8: int + button9: int + button10: int + button11: int + button12: int + button13: int + button14: int + button15: int + button16: int + button17: int + button18: int + button19: int + button20: int + button21: int + button22: int + button23: int + button24: int + button25: int + button26: int + button27: int + button28: int + button29: int + button30: int + scroll_down: int + scroll_left: int + scroll_right: int + scroll_up: int + if sys.platform == "win32": + x1: int + x2: int class Controller: def __init__(self) -> None: ... @@ -23,12 +55,35 @@ class Controller: def release(self, button: Button) -> None: ... def move(self, dx: int, dy: int) -> None: ... def click(self, button: Button, count: int = ...) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None ) -> None: ... class Listener(AbstractListener): + if sys.platform == "win32": + WM_LBUTTONDOWN: int + WM_LBUTTONUP: int + WM_MBUTTONDOWN: int + WM_MBUTTONUP: int + WM_MOUSEMOVE: int + WM_MOUSEWHEEL: int + WM_MOUSEHWHEEL: int + WM_RBUTTONDOWN: int + WM_RBUTTONUP: int + WM_XBUTTONDOWN: int + WM_XBUTTONUP: int + + MK_XBUTTON1: int + MK_XBUTTON2: int + + XBUTTON1: int + XBUTTON2: int + + CLICK_BUTTONS: dict[int, tuple[Button, bool]] + X_BUTTONS: dict[int, dict[int, tuple[Button, bool]]] + SCROLL_BUTTONS: dict[int, tuple[int, int]] + def __init__( self, on_move: Callable[[int, int], bool | None] | None = ..., diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyserial/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/METADATA.toml new file mode 100644 index 000000000..1e5d0af9f --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/METADATA.toml @@ -0,0 +1,5 @@ +version = "3.5.*" + +[tool.stubtest] +platforms = ["darwin", "linux", "win32"] +extras = ["cp2110"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/__init__.pyi new file mode 100644 index 000000000..7677f130e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/__init__.pyi @@ -0,0 +1,30 @@ +import sys + +from serial.serialutil import * + +if sys.platform == "win32": + from serial.serialwin32 import Serial as Serial +else: + from serial.serialposix import PosixPollSerial as PosixPollSerial, Serial as Serial, VTIMESerial as VTIMESerial +# TODO: java? cli? These platforms raise flake8-pyi Y008. Should they be included with a noqa? + +__version__: str +VERSION: str +protocol_handler_packages: list[str] + +def serial_for_url( + url: str | None, + baudrate: int = ..., + bytesize: int = ..., + parity: str = ..., + stopbits: float = ..., + timeout: float | None = ..., + xonxoff: bool = ..., + rtscts: bool = ..., + write_timeout: float | None = ..., + dsrdtr: bool = ..., + inter_byte_timeout: float | None = ..., + exclusive: float | None = ..., + *, + do_not_open: bool = ..., +) -> Serial: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/__main__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/__main__.pyi new file mode 100644 index 000000000..195cbe714 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/__main__.pyi @@ -0,0 +1 @@ +from serial.tools import miniterm as miniterm diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/rfc2217.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/rfc2217.pyi new file mode 100644 index 000000000..059009324 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/rfc2217.pyi @@ -0,0 +1,187 @@ +import logging +from _typeshed import ReadableBuffer +from collections.abc import Callable, Generator +from typing import Any + +from serial.serialutil import SerialBase + +LOGGER_LEVELS: dict[str, int] +SE: bytes +NOP: bytes +DM: bytes +BRK: bytes +IP: bytes +AO: bytes +AYT: bytes +EC: bytes +EL: bytes +GA: bytes +SB: bytes +WILL: bytes +WONT: bytes +DO: bytes +DONT: bytes +IAC: bytes +IAC_DOUBLED: bytes +BINARY: bytes +ECHO: bytes +SGA: bytes +COM_PORT_OPTION: bytes +SET_BAUDRATE: bytes +SET_DATASIZE: bytes +SET_PARITY: bytes +SET_STOPSIZE: bytes +SET_CONTROL: bytes +NOTIFY_LINESTATE: bytes +NOTIFY_MODEMSTATE: bytes +FLOWCONTROL_SUSPEND: bytes +FLOWCONTROL_RESUME: bytes +SET_LINESTATE_MASK: bytes +SET_MODEMSTATE_MASK: bytes +PURGE_DATA: bytes +SERVER_SET_BAUDRATE: bytes +SERVER_SET_DATASIZE: bytes +SERVER_SET_PARITY: bytes +SERVER_SET_STOPSIZE: bytes +SERVER_SET_CONTROL: bytes +SERVER_NOTIFY_LINESTATE: bytes +SERVER_NOTIFY_MODEMSTATE: bytes +SERVER_FLOWCONTROL_SUSPEND: bytes +SERVER_FLOWCONTROL_RESUME: bytes +SERVER_SET_LINESTATE_MASK: bytes +SERVER_SET_MODEMSTATE_MASK: bytes +SERVER_PURGE_DATA: bytes +RFC2217_ANSWER_MAP: dict[bytes, bytes] +SET_CONTROL_REQ_FLOW_SETTING: bytes +SET_CONTROL_USE_NO_FLOW_CONTROL: bytes +SET_CONTROL_USE_SW_FLOW_CONTROL: bytes +SET_CONTROL_USE_HW_FLOW_CONTROL: bytes +SET_CONTROL_REQ_BREAK_STATE: bytes +SET_CONTROL_BREAK_ON: bytes +SET_CONTROL_BREAK_OFF: bytes +SET_CONTROL_REQ_DTR: bytes +SET_CONTROL_DTR_ON: bytes +SET_CONTROL_DTR_OFF: bytes +SET_CONTROL_REQ_RTS: bytes +SET_CONTROL_RTS_ON: bytes +SET_CONTROL_RTS_OFF: bytes +SET_CONTROL_REQ_FLOW_SETTING_IN: bytes +SET_CONTROL_USE_NO_FLOW_CONTROL_IN: bytes +SET_CONTROL_USE_SW_FLOW_CONTOL_IN: bytes +SET_CONTROL_USE_HW_FLOW_CONTOL_IN: bytes +SET_CONTROL_USE_DCD_FLOW_CONTROL: bytes +SET_CONTROL_USE_DTR_FLOW_CONTROL: bytes +SET_CONTROL_USE_DSR_FLOW_CONTROL: bytes +LINESTATE_MASK_TIMEOUT: int +LINESTATE_MASK_SHIFTREG_EMPTY: int +LINESTATE_MASK_TRANSREG_EMPTY: int +LINESTATE_MASK_BREAK_DETECT: int +LINESTATE_MASK_FRAMING_ERROR: int +LINESTATE_MASK_PARTIY_ERROR: int +LINESTATE_MASK_OVERRUN_ERROR: int +LINESTATE_MASK_DATA_READY: int +MODEMSTATE_MASK_CD: int +MODEMSTATE_MASK_RI: int +MODEMSTATE_MASK_DSR: int +MODEMSTATE_MASK_CTS: int +MODEMSTATE_MASK_CD_CHANGE: int +MODEMSTATE_MASK_RI_CHANGE: int +MODEMSTATE_MASK_DSR_CHANGE: int +MODEMSTATE_MASK_CTS_CHANGE: int +PURGE_RECEIVE_BUFFER: bytes +PURGE_TRANSMIT_BUFFER: bytes +PURGE_BOTH_BUFFERS: bytes +RFC2217_PARITY_MAP: dict[str, int] +RFC2217_REVERSE_PARITY_MAP: dict[int, str] +RFC2217_STOPBIT_MAP: dict[int | float, int] +RFC2217_REVERSE_STOPBIT_MAP: dict[int, int | float] +M_NORMAL: int +M_IAC_SEEN: int +M_NEGOTIATE: int +REQUESTED: str +ACTIVE: str +INACTIVE: str +REALLY_INACTIVE: str + +class TelnetOption: + connection: Serial + name: str + option: bytes + send_yes: bytes + send_no: bytes + ack_yes: bytes + ack_no: bytes + state: str + active: bool + activation_callback: Callable[[], Any] + + def __init__( + self, + connection: Serial, + name: str, + option: bytes, + send_yes: bytes, + send_no: bytes, + ack_yes: bytes, + ack_no: bytes, + initial_state: str, + activation_callback: Callable[[], Any] | None = ..., + ) -> None: ... + def process_incoming(self, command: bytes) -> None: ... + +class TelnetSubnegotiation: + connection: Serial + name: str + option: bytes + value: bytes | None + ack_option: bytes + state: str + def __init__(self, connection: Serial, name: str, option: bytes, ack_option: bytes | None = ...) -> None: ... + def set(self, value: bytes) -> None: ... + def is_ready(self) -> bool: ... + @property + def active(self) -> bool: ... + def wait(self, timeout: float = ...) -> None: ... + def check_answer(self, suboption: bytes) -> None: ... + +class Serial(SerialBase): + logger: logging.Logger | None + def open(self) -> None: ... + def from_url(self, url: str) -> tuple[str, int]: ... + @property + def in_waiting(self) -> int: ... + def read(self, size: int = 1) -> bytes: ... + def write(self, __b: ReadableBuffer) -> int | None: ... + def reset_input_buffer(self) -> None: ... + def reset_output_buffer(self) -> None: ... + @property + def cts(self) -> bool: ... + @property + def dsr(self) -> bool: ... + @property + def ri(self) -> bool: ... + @property + def cd(self) -> bool: ... + def telnet_send_option(self, action: bytes, option: bytes) -> None: ... + def rfc2217_send_subnegotiation(self, option: bytes, value: bytes = ...) -> None: ... + def rfc2217_send_purge(self, value: bytes) -> None: ... + def rfc2217_set_control(self, value: bytes) -> None: ... + def rfc2217_flow_server_ready(self) -> None: ... + def get_modem_state(self) -> int: ... + +class PortManager: + serial: Serial + connection: Serial + logger: logging.Logger | None + mode: int + suboption: bytes | None + telnet_command: bytes | None + modemstate_mask: int + last_modemstate: int | None + linstate_mask: int + def __init__(self, serial_port: Serial, connection: Serial, logger: logging.Logger | None = ...) -> None: ... + def telnet_send_option(self, action: bytes, option: bytes) -> None: ... + def rfc2217_send_subnegotiation(self, option: bytes, value: bytes = ...) -> None: ... + def check_modem_lines(self, force_notification: bool = ...) -> None: ... + def escape(self, data: bytes) -> Generator[bytes, None, None]: ... + def filter(self, data: bytes) -> Generator[bytes, None, None]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/rs485.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/rs485.pyi new file mode 100644 index 000000000..55d754440 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/rs485.pyi @@ -0,0 +1,18 @@ +import serial + +class RS485Settings: + rts_level_for_tx: bool + rts_level_for_rx: bool + loopback: bool + delay_before_tx: float | None + delay_before_rx: float | None + def __init__( + self, + rts_level_for_tx: bool = ..., + rts_level_for_rx: bool = ..., + loopback: bool = ..., + delay_before_tx: float | None = ..., + delay_before_rx: float | None = ..., + ) -> None: ... + +class RS485(serial.Serial): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/serialcli.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/serialcli.pyi new file mode 100644 index 000000000..51755168a --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/serialcli.pyi @@ -0,0 +1,25 @@ +from _typeshed import ReadableBuffer +from typing import Any + +from serial.serialutil import * + +sab: Any # IronPython object + +def as_byte_array(string: bytes) -> Any: ... # IronPython object + +class Serial(SerialBase): + def open(self) -> None: ... + @property + def in_waiting(self) -> int: ... + def read(self, size: int = 1) -> bytes: ... + def write(self, __b: ReadableBuffer) -> int | None: ... + def reset_input_buffer(self) -> None: ... + def reset_output_buffer(self) -> None: ... + @property + def cts(self) -> bool: ... + @property + def dsr(self) -> bool: ... + @property + def ri(self) -> bool: ... + @property + def cd(self) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/serialjava.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/serialjava.pyi new file mode 100644 index 000000000..b250e75cb --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/serialjava.pyi @@ -0,0 +1,30 @@ +from _typeshed import ReadableBuffer +from collections.abc import Iterable +from typing import Any + +from serial.serialutil import * + +def my_import(name: str) -> Any: ... # Java object +def detect_java_comm(names: Iterable[str]) -> Any: ... # Java object + +comm: Any # Java object + +def device(portnumber: int) -> str: ... + +class Serial(SerialBase): + sPort: Any # Java object + def open(self) -> None: ... + @property + def in_waiting(self) -> int: ... + def read(self, size: int = 1) -> bytes: ... + def write(self, __b: ReadableBuffer) -> int | None: ... + def reset_input_buffer(self) -> None: ... + def reset_output_buffer(self) -> None: ... + @property + def cts(self) -> bool: ... + @property + def dsr(self) -> bool: ... + @property + def ri(self) -> bool: ... + @property + def cd(self) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/serialposix.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/serialposix.pyi new file mode 100644 index 000000000..4869f4ec9 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/serialposix.pyi @@ -0,0 +1,93 @@ +import sys +from _typeshed import ReadableBuffer +from typing_extensions import Never + +from serial.serialutil import SerialBase + +class PlatformSpecificBase: + BAUDRATE_CONSTANTS: dict[int, int] + def set_low_latency_mode(self, low_latency_settings: bool) -> None: ... + +CMSPAR: int +if sys.platform == "linux": + TCGETS2: int + TCSETS2: int + BOTHER: int + TIOCGRS485: int + TIOCSRS485: int + SER_RS485_ENABLED: int + SER_RS485_RTS_ON_SEND: int + SER_RS485_RTS_AFTER_SEND: int + SER_RS485_RX_DURING_TX: int + + class PlatformSpecific(PlatformSpecificBase): ... + +elif sys.platform == "cygwin": + class PlatformSpecific(PlatformSpecificBase): ... + +elif sys.platform == "darwin": + IOSSIOSPEED: int + + class PlatformSpecific(PlatformSpecificBase): + osx_version: list[str] + TIOCSBRK: int + TIOCCBRK: int + +else: + class PlatformSpecific(PlatformSpecificBase): ... + +TIOCMGET: int +TIOCMBIS: int +TIOCMBIC: int +TIOCMSET: int +TIOCM_DTR: int +TIOCM_RTS: int +TIOCM_CTS: int +TIOCM_CAR: int +TIOCM_RNG: int +TIOCM_DSR: int +TIOCM_CD: int +TIOCM_RI: int +TIOCINQ: int +TIOCOUTQ: int +TIOCM_zero_str: bytes +TIOCM_RTS_str: bytes +TIOCM_DTR_str: bytes +TIOCSBRK: int +TIOCCBRK: int + +class Serial(SerialBase, PlatformSpecific): + fd: int | None + pipe_abort_read_w: int | None + pipe_abort_read_r: int | None + pipe_abort_write_w: int | None + pipe_abort_write_r: int | None + def open(self) -> None: ... + @property + def in_waiting(self) -> int: ... + def read(self, size: int = 1) -> bytes: ... + def cancel_read(self) -> None: ... + def cancel_write(self) -> None: ... + def write(self, __b: ReadableBuffer) -> int | None: ... + def reset_input_buffer(self) -> None: ... + def reset_output_buffer(self) -> None: ... + def send_break(self, duration: float = ...) -> None: ... + @property + def cts(self) -> bool: ... + @property + def dsr(self) -> bool: ... + @property + def ri(self) -> bool: ... + @property + def cd(self) -> bool: ... + @property + def out_waiting(self) -> int: ... + def set_input_flow_control(self, enable: bool = ...) -> None: ... + def set_output_flow_control(self, enable: bool = ...) -> None: ... + def nonblocking(self) -> None: ... + +class PosixPollSerial(Serial): ... + +class VTIMESerial(Serial): + @property + def cancel_read(self) -> Never: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/serialutil.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/serialutil.pyi new file mode 100644 index 000000000..6f01687db --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/serialutil.pyi @@ -0,0 +1,153 @@ +import io +from _typeshed import ReadableBuffer, WriteableBuffer +from abc import abstractmethod +from collections.abc import Callable, Generator +from typing import Any +from typing_extensions import Final + +from serial.rs485 import RS485Settings + +XON: Final = b"\x11" +XOFF: Final = b"\x13" +CR: Final = b"\r" +LF: Final = b"\n" +PARITY_NONE: Final = "N" +PARITY_EVEN: Final = "E" +PARITY_ODD: Final = "O" +PARITY_MARK: Final = "M" +PARITY_SPACE: Final = "S" +STOPBITS_ONE: Final = 1 +STOPBITS_ONE_POINT_FIVE: float +STOPBITS_TWO: Final = 2 +FIVEBITS: Final = 5 +SIXBITS: Final = 6 +SEVENBITS: Final = 7 +EIGHTBITS: Final = 8 +PARITY_NAMES: dict[str, str] + +class SerialException(OSError): ... +class SerialTimeoutException(SerialException): ... + +class PortNotOpenError(SerialException): + def __init__(self) -> None: ... + +class Timeout: + TIME: Callable[[], float] + is_infinite: bool + is_non_blocking: bool + duration: float + target_time: float + def __init__(self, duration: float) -> None: ... + def expired(self) -> bool: ... + def time_left(self) -> float: ... + def restart(self, duration: float) -> None: ... + +class SerialBase(io.RawIOBase): + BAUDRATES: tuple[int, ...] + BYTESIZES: tuple[int, ...] + PARITIES: tuple[str, ...] + STOPBITS: tuple[int, float, int] + is_open: bool + portstr: str | None + name: str | None + def __init__( + self, + port: str | None = ..., + baudrate: int = ..., + bytesize: int = ..., + parity: str = ..., + stopbits: float = ..., + timeout: float | None = ..., + xonxoff: bool = ..., + rtscts: bool = ..., + write_timeout: float | None = ..., + dsrdtr: bool = ..., + inter_byte_timeout: float | None = ..., + exclusive: float | None = ..., + ) -> None: ... + + # Return type: + # ------------ + # `io.RawIOBase`, the super class, declares the return type of read as `-> bytes | None`. + # `SerialBase` does not define `read` at runtime but REQUIRES subclasses to implement it and + # require it to return `bytes`. + # Abstract: + # --------- + # `io.RawIOBase` implements `read` in terms of `readinto`. `SerialBase` implements `readinto` + # in terms of `read`. If subclasses do not implement `read`, any call to `read` or `read_into` + # will fail at runtime with a `RecursionError`. + @abstractmethod + def read(self, __size: int = -1) -> bytes: ... + @abstractmethod + def write(self, __b: ReadableBuffer) -> int | None: ... + @property + def port(self) -> str | None: ... + @port.setter + def port(self, port: str | None) -> None: ... + @property + def baudrate(self) -> int: ... + @baudrate.setter + def baudrate(self, baudrate: int) -> None: ... + @property + def bytesize(self) -> int: ... + @bytesize.setter + def bytesize(self, bytesize: int) -> None: ... + @property + def exclusive(self) -> bool | None: ... + @exclusive.setter + def exclusive(self, exclusive: bool | None) -> None: ... + @property + def parity(self) -> str: ... + @parity.setter + def parity(self, parity: str) -> None: ... + @property + def stopbits(self) -> float: ... + @stopbits.setter + def stopbits(self, stopbits: float) -> None: ... + @property + def timeout(self) -> float | None: ... + @timeout.setter + def timeout(self, timeout: float | None) -> None: ... + @property + def write_timeout(self) -> float | None: ... + @write_timeout.setter + def write_timeout(self, timeout: float | None) -> None: ... + @property + def inter_byte_timeout(self) -> float | None: ... + @inter_byte_timeout.setter + def inter_byte_timeout(self, ic_timeout: float | None) -> None: ... + @property + def xonxoff(self) -> bool: ... + @xonxoff.setter + def xonxoff(self, xonxoff: bool) -> None: ... + @property + def rtscts(self) -> bool: ... + @rtscts.setter + def rtscts(self, rtscts: bool) -> None: ... + @property + def dsrdtr(self) -> bool: ... + @dsrdtr.setter + def dsrdtr(self, dsrdtr: bool | None = ...) -> None: ... + @property + def rts(self) -> bool: ... + @rts.setter + def rts(self, value: bool) -> None: ... + @property + def dtr(self) -> bool: ... + @dtr.setter + def dtr(self, value: bool) -> None: ... + @property + def break_condition(self) -> bool: ... + @break_condition.setter + def break_condition(self, value: bool) -> None: ... + @property + def rs485_mode(self) -> RS485Settings | None: ... + @rs485_mode.setter + def rs485_mode(self, rs485_settings: RS485Settings | None) -> None: ... + def get_settings(self) -> dict[str, Any]: ... + def apply_settings(self, d: dict[str, Any]) -> None: ... + def readinto(self, __buffer: WriteableBuffer) -> int: ... # returns int unlike `io.RawIOBase` + def send_break(self, duration: float = ...) -> None: ... + def read_all(self) -> bytes | None: ... + def read_until(self, expected: bytes = ..., size: int | None = ...) -> bytes: ... + def iread_until(self, expected: bytes = ..., size: int | None = ...) -> Generator[bytes, None, None]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/serialwin32.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/serialwin32.pyi new file mode 100644 index 000000000..d44693d37 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/serialwin32.pyi @@ -0,0 +1,26 @@ +from _typeshed import ReadableBuffer + +from serial.serialutil import SerialBase + +class Serial(SerialBase): + def open(self) -> None: ... + @property + def in_waiting(self) -> int: ... + def read(self, size: int = 1) -> bytes: ... + def write(self, __b: ReadableBuffer) -> int | None: ... + def reset_input_buffer(self) -> None: ... + def reset_output_buffer(self) -> None: ... + @property + def cts(self) -> bool: ... + @property + def dsr(self) -> bool: ... + @property + def ri(self) -> bool: ... + @property + def cd(self) -> bool: ... + def set_buffer_size(self, rx_size: int = ..., tx_size: int | None = ...) -> None: ... + def set_output_flow_control(self, enable: bool = ...) -> None: ... + @property + def out_waiting(self) -> int: ... + def cancel_read(self) -> None: ... + def cancel_write(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/threaded/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/threaded/__init__.pyi new file mode 100644 index 000000000..73756a555 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/threaded/__init__.pyi @@ -0,0 +1,48 @@ +import threading +from _typeshed import ReadableBuffer +from collections.abc import Callable +from types import TracebackType +from typing_extensions import Self + +from serial import Serial + +class Protocol: + def connection_made(self, transport: ReaderThread) -> None: ... + def data_received(self, data: bytes) -> None: ... + def connection_lost(self, exc: BaseException | None) -> None: ... + +class Packetizer(Protocol): + TERMINATOR: bytes + buffer: bytearray + transport: ReaderThread | None + def handle_packet(self, packet: bytes) -> None: ... + +class FramedPacket(Protocol): + START: bytes + STOP: bytes + packet: bytearray + in_packet: bool + transport: ReaderThread | None + def handle_packet(self, packet: bytes) -> None: ... + def handle_out_of_packet_data(self, data: bytes) -> None: ... + +class LineReader(Packetizer): + ENCODING: str + UNICODE_HANDLING: str + def handle_line(self, line: str) -> None: ... + def write_line(self, text: str) -> None: ... + +class ReaderThread(threading.Thread): + serial: Serial + protocol_factory: Callable[[], Protocol] + alive: bool + protocol: Protocol + def __init__(self, serial_instance: Serial, protocol_factory: Callable[[], Protocol]) -> None: ... + def stop(self) -> None: ... + def write(self, data: ReadableBuffer) -> int: ... + def close(self) -> None: ... + def connect(self) -> tuple[Self, Protocol]: ... + def __enter__(self) -> Protocol: ... + def __exit__( + self, __exc_type: type[BaseException] | None, __exc_val: BaseException | None, __exc_tb: TracebackType | None + ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/tools/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/tools/__init__.pyi new file mode 100644 index 000000000..e69de29bb diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/tools/hexlify_codec.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/tools/hexlify_codec.pyi new file mode 100644 index 000000000..252a6a5d4 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/tools/hexlify_codec.pyi @@ -0,0 +1,23 @@ +import codecs +from _typeshed import ReadableBuffer + +HEXDIGITS: str + +def hex_encode(data: str, errors: str = ...) -> tuple[bytes, int]: ... +def hex_decode(data: bytes, errors: str = ...) -> tuple[str, int]: ... + +class Codec(codecs.Codec): + def encode(self, data: str, errors: str = ...) -> tuple[bytes, int]: ... + def decode(self, data: bytes, errors: str = ...) -> tuple[str, int]: ... + +class IncrementalEncoder(codecs.IncrementalEncoder): + state: int + def encode(self, data: str, final: bool = ...) -> bytes: ... + +class IncrementalDecoder(codecs.IncrementalDecoder): + def decode(self, data: ReadableBuffer, final: bool = ...) -> str: ... + +class StreamWriter(Codec, codecs.StreamWriter): ... +class StreamReader(Codec, codecs.StreamReader): ... + +def getregentry() -> codecs.CodecInfo: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/tools/list_ports.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/tools/list_ports.pyi new file mode 100644 index 000000000..0266c39a2 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/tools/list_ports.pyi @@ -0,0 +1,11 @@ +import re +import sys +from collections.abc import Generator + +if sys.platform == "win32": + from serial.tools.list_ports_windows import comports as comports +else: + from serial.tools.list_ports_posix import comports as comports + +def grep(regexp: str | re.Pattern[str], include_links: bool = ...) -> Generator[tuple[str, str, str], None, None]: ... +def main() -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/tools/list_ports_common.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/tools/list_ports_common.pyi new file mode 100644 index 000000000..ee607525d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/tools/list_ports_common.pyi @@ -0,0 +1,33 @@ +from collections.abc import Collection +from typing import Any + +def numsplit(text: str) -> list[str | int]: ... + +class ListPortInfo: + device: str + name: str + description: str + hwid: str + # USB specific data: the vid and pid attributes below are specific to USB devices only and + # should be marked as Optional. Since the majority of the serial devices nowadays are USB + # devices, typing them as Optional will be unnecessarily annoying. We type them with as + # `int | Any` so that obvious typing errors like ListPortInfo.pid + "str" are flagged. + # As desired, this will cause a false negative if the value is ever None, but may also cause + # other false negatives from the Any proliferating. The other USB attributes are correctly + # typed as Optional because they may be `None` even for USB devices + # Original discussion at https://github.com/python/typeshed/pull/9347#issuecomment-1358245865. + vid: int | Any + pid: int | Any + serial_number: str | None + location: str | None + manufacturer: str | None + product: str | None + interface: str | None + def __init__(self, device: str, skip_link_detection: bool = ...) -> None: ... + def usb_description(self) -> str: ... + def usb_info(self) -> str: ... + def apply_usb_info(self) -> None: ... + def __lt__(self, other: ListPortInfo) -> bool: ... + def __getitem__(self, index: int) -> str: ... + +def list_links(devices: Collection[str]) -> list[str]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/tools/list_ports_linux.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/tools/list_ports_linux.pyi new file mode 100644 index 000000000..256f46ea0 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/tools/list_ports_linux.pyi @@ -0,0 +1,11 @@ +from serial.tools.list_ports_common import ListPortInfo + +class SysFS(ListPortInfo): + usb_device_path: str | None + device_path: str | None + subsystem: str | None + usb_interface_path: str | None + def __init__(self, device: str) -> None: ... + def read_line(self, *args: str) -> str | None: ... + +def comports(include_links: bool = ...) -> list[SysFS]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/tools/list_ports_osx.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/tools/list_ports_osx.pyi new file mode 100644 index 000000000..eb193d82e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/tools/list_ports_osx.pyi @@ -0,0 +1,36 @@ +import ctypes +import sys + +from serial.tools.list_ports_common import ListPortInfo + +if sys.platform == "darwin": + iokit: ctypes.CDLL + cf: ctypes.CDLL + kIOMasterPortDefault: int + kCFAllocatorDefault: ctypes.c_void_p + kCFStringEncodingMacRoman: int + kCFStringEncodingUTF8: int + kUSBVendorString: str + kUSBSerialNumberString: str + io_name_size: int + KERN_SUCCESS: int + kern_return_t = ctypes.c_int + kCFNumberSInt8Type: int + kCFNumberSInt16Type: int + kCFNumberSInt32Type: int + kCFNumberSInt64Type: int + + def get_string_property(device_type: ctypes._CData, property: str) -> str | None: ... + def get_int_property(device_type: ctypes._CData, property: str, cf_number_type: int) -> int | None: ... + def IORegistryEntryGetName(device: ctypes._CData) -> str | None: ... + def IOObjectGetClass(device: ctypes._CData) -> bytes: ... + def GetParentDeviceByType(device: ctypes._CData, parent_type: str) -> ctypes._CData | None: ... + def GetIOServicesByType(service_type: str) -> list[ctypes._CData]: ... + def location_to_string(locationID: int) -> str: ... + + # `SuitableSerialInterface` has required attributes `id: int` and `name: str` but they are not defined on the class + class SuitableSerialInterface: ... + + def scan_interfaces() -> list[SuitableSerialInterface]: ... + def search_for_locationID_in_interfaces(serial_interfaces: list[SuitableSerialInterface], locationID: int) -> str | None: ... + def comports(include_links: bool = ...) -> list[ListPortInfo]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/tools/list_ports_posix.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/tools/list_ports_posix.pyi new file mode 100644 index 000000000..969dfd42e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/tools/list_ports_posix.pyi @@ -0,0 +1,11 @@ +import sys + +from serial.tools.list_ports_common import ListPortInfo + +if sys.platform != "win32": + if sys.platform == "linux": + from serial.tools.list_ports_linux import comports as comports + elif sys.platform == "darwin": + from serial.tools.list_ports_osx import comports as comports + else: + def comports(include_links: bool = ...) -> list[ListPortInfo]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/tools/list_ports_windows.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/tools/list_ports_windows.pyi new file mode 100644 index 000000000..ce51d57b8 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/tools/list_ports_windows.pyi @@ -0,0 +1,76 @@ +import ctypes +import sys +from collections.abc import Generator +from ctypes.wintypes import DWORD + +from serial.tools.list_ports_common import ListPortInfo + +if sys.platform == "win32": + + def ValidHandle( + value: type[ctypes._CData] | None, func: ctypes._FuncPointer, arguments: tuple[ctypes._CData, ...] + ) -> ctypes._CData: ... + + NULL: int + HDEVINFO = ctypes.c_void_p + LPCTSTR = ctypes.c_wchar_p + PCTSTR = ctypes.c_wchar_p + PTSTR = ctypes.c_wchar_p + LPDWORD: ctypes._Pointer[DWORD] + PDWORD: ctypes._Pointer[DWORD] + LPBYTE = ctypes.c_void_p + PBYTE = ctypes.c_void_p + ACCESS_MASK = DWORD + REGSAM = ACCESS_MASK + + class GUID(ctypes.Structure): + Data1: ctypes._CField + Data2: ctypes._CField + Data3: ctypes._CField + Data4: ctypes._CField + + class SP_DEVINFO_DATA(ctypes.Structure): + cbSize: ctypes._CField + ClassGuid: ctypes._CField + DevInst: ctypes._CField + Reserved: ctypes._CField + PSP_DEVINFO_DATA: type[ctypes._Pointer[SP_DEVINFO_DATA]] + PSP_DEVICE_INTERFACE_DETAIL_DATA = ctypes.c_void_p + setupapi: ctypes.WinDLL + SetupDiDestroyDeviceInfoList: ctypes._NamedFuncPointer + SetupDiClassGuidsFromName: ctypes._NamedFuncPointer + SetupDiEnumDeviceInfo: ctypes._NamedFuncPointer + SetupDiGetClassDevs: ctypes._NamedFuncPointer + SetupDiGetDeviceRegistryProperty: ctypes._NamedFuncPointer + SetupDiGetDeviceInstanceId: ctypes._NamedFuncPointer + SetupDiOpenDevRegKey: ctypes._NamedFuncPointer + advapi32: ctypes.WinDLL + RegCloseKey: ctypes._NamedFuncPointer + RegQueryValueEx: ctypes._NamedFuncPointer + cfgmgr32: ctypes.WinDLL + CM_Get_Parent: ctypes._NamedFuncPointer + CM_Get_Device_IDW: ctypes._NamedFuncPointer + CM_MapCrToWin32Err: ctypes._NamedFuncPointer + DIGCF_PRESENT: int + DIGCF_DEVICEINTERFACE: int + INVALID_HANDLE_VALUE: int + ERROR_INSUFFICIENT_BUFFER: int + ERROR_NOT_FOUND: int + SPDRP_HARDWAREID: int + SPDRP_FRIENDLYNAME: int + SPDRP_LOCATION_PATHS: int + SPDRP_MFG: int + DICS_FLAG_GLOBAL: int + DIREG_DEV: int + KEY_READ: int + MAX_USB_DEVICE_TREE_TRAVERSAL_DEPTH: int + + def get_parent_serial_number( + child_devinst: ctypes._CData, + child_vid: int | None, + child_pid: int | None, + depth: int = ..., + last_serial_number: str | None = ..., + ) -> str: ... + def iterate_comports() -> Generator[ListPortInfo, None, None]: ... + def comports(include_links: bool = ...) -> list[ListPortInfo]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/tools/miniterm.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/tools/miniterm.pyi new file mode 100644 index 000000000..26b059f9b --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/tools/miniterm.pyi @@ -0,0 +1,112 @@ +import codecs +import sys +import threading +from _typeshed import Unused +from collections.abc import Iterable +from typing import Any, BinaryIO, TextIO +from typing_extensions import Self + +from serial import Serial + +def key_description(character: str) -> str: ... + +class ConsoleBase: + byte_output: BinaryIO + output: codecs.StreamWriter | TextIO + def __init__(self) -> None: ... + def setup(self) -> None: ... + def cleanup(self) -> None: ... + def getkey(self) -> None: ... + def write_bytes(self, byte_string: bytes) -> None: ... + def write(self, text: str) -> None: ... + def cancel(self) -> None: ... + def __enter__(self) -> Self: ... + def __exit__(self, *args: Unused, **kwargs: Unused) -> None: ... + +if sys.platform == "win32": + class Out: + fd: int + def __init__(self, fd: int) -> None: ... + def flush(self) -> None: ... + def write(self, s: bytes) -> None: ... + + class Console(ConsoleBase): + fncodes: dict[str, str] + navcodes: dict[str, str] + +else: + class Console(ConsoleBase): + fd: int + old: list[Any] # return type of termios.tcgetattr() + enc_stdin: TextIO + +class Transform: + def rx(self, text: str) -> str: ... + def tx(self, text: str) -> str: ... + def echo(self, text: str) -> str: ... + +class CRLF(Transform): ... +class CR(Transform): ... +class LF(Transform): ... + +class NoTerminal(Transform): + REPLACEMENT_MAP: dict[int, int] + +class NoControls(NoTerminal): + REPLACEMENT_MAP: dict[int, int] + +class Printable(Transform): ... + +class Colorize(Transform): + input_color: str + echo_color: str + +class DebugIO(Transform): ... + +EOL_TRANSFORMATIONS: dict[str, type[Transform]] +TRANSFORMATIONS: dict[str, type[Transform]] + +def ask_for_port() -> str: ... + +class Miniterm: + console: Console + serial: Serial + echo: bool + raw: bool + input_encoding: str + output_encoding: str + eol: str + filters: Iterable[str] + exit_character: str + menu_character: str + alive: bool | None + receiver_thread: threading.Thread | None + rx_decoder: codecs.IncrementalDecoder | None + tx_decoder: codecs.IncrementalDecoder | None + tx_encoder: codecs.IncrementalEncoder | None + def __init__(self, serial_instance: Serial, echo: bool = ..., eol: str = ..., filters: Iterable[str] = ...) -> None: ... + transmitter_thread: threading.Thread + def start(self) -> None: ... + def stop(self) -> None: ... + def join(self, transmit_only: bool = ...) -> None: ... + def close(self) -> None: ... + tx_transformations: list[Transform] + rx_transformations: list[Transform] + def update_transformations(self) -> None: ... + def set_rx_encoding(self, encoding: str, errors: str = ...) -> None: ... + def set_tx_encoding(self, encoding: str, errors: str = ...) -> None: ... + def dump_port_settings(self) -> None: ... + def reader(self) -> None: ... + def writer(self) -> None: ... + def handle_menu_key(self, c: str) -> None: ... + def upload_file(self) -> None: ... + def change_filter(self) -> None: ... + def change_encoding(self) -> None: ... + def change_baudrate(self) -> None: ... + def change_port(self) -> None: ... + def suspend_port(self) -> None: ... + def get_help_text(self) -> str: ... + +def main( + default_port: str | None = ..., default_baudrate: int = ..., default_rts: int | None = ..., default_dtr: int | None = ... +) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/urlhandler/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/urlhandler/__init__.pyi new file mode 100644 index 000000000..e69de29bb diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/urlhandler/protocol_alt.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/urlhandler/protocol_alt.pyi new file mode 100644 index 000000000..9711af93c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/urlhandler/protocol_alt.pyi @@ -0,0 +1,3 @@ +from serial import Serial + +def serial_class_for_url(url: str) -> tuple[str, Serial]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/urlhandler/protocol_cp2110.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/urlhandler/protocol_cp2110.pyi new file mode 100644 index 000000000..38552f2ae --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/urlhandler/protocol_cp2110.pyi @@ -0,0 +1,13 @@ +from _typeshed import ReadableBuffer + +from serial.serialutil import SerialBase + +class Serial(SerialBase): + def open(self) -> None: ... + def from_url(self, url: str) -> bytes: ... + @property + def in_waiting(self) -> int: ... + def reset_input_buffer(self) -> None: ... + def reset_output_buffer(self) -> None: ... + def read(self, size: int = 1) -> bytes: ... + def write(self, __b: ReadableBuffer) -> int | None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/urlhandler/protocol_hwgrep.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/urlhandler/protocol_hwgrep.pyi new file mode 100644 index 000000000..93dc1402a --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/urlhandler/protocol_hwgrep.pyi @@ -0,0 +1,4 @@ +import serial + +class Serial(serial.Serial): + def from_url(self, url: str) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/urlhandler/protocol_loop.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/urlhandler/protocol_loop.pyi new file mode 100644 index 000000000..b85c016c0 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/urlhandler/protocol_loop.pyi @@ -0,0 +1,32 @@ +import logging +import queue +from _typeshed import ReadableBuffer + +from serial.serialutil import SerialBase + +LOGGER_LEVELS: dict[str, int] + +class Serial(SerialBase): + buffer_size: int + queue: queue.Queue[bytes | None] | None + logger: logging.Logger | None + def open(self) -> None: ... + def from_url(self, url: str) -> None: ... + @property + def in_waiting(self) -> int: ... + def read(self, size: int = 1) -> bytes: ... + def cancel_read(self) -> None: ... + def cancel_write(self) -> None: ... + def write(self, __b: ReadableBuffer) -> int | None: ... + def reset_input_buffer(self) -> None: ... + def reset_output_buffer(self) -> None: ... + @property + def out_waiting(self) -> int: ... + @property + def cts(self) -> bool: ... + @property + def dsr(self) -> bool: ... + @property + def ri(self) -> bool: ... + @property + def cd(self) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/urlhandler/protocol_rfc2217.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/urlhandler/protocol_rfc2217.pyi new file mode 100644 index 000000000..82903b514 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/urlhandler/protocol_rfc2217.pyi @@ -0,0 +1 @@ +from serial.rfc2217 import Serial as Serial diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/urlhandler/protocol_socket.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/urlhandler/protocol_socket.pyi new file mode 100644 index 000000000..bf3572d62 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/urlhandler/protocol_socket.pyi @@ -0,0 +1,26 @@ +import logging +from _typeshed import ReadableBuffer + +from serial.serialutil import SerialBase + +LOGGER_LEVELS: dict[str, int] +POLL_TIMEOUT: float + +class Serial(SerialBase): + logger: logging.Logger | None + def open(self) -> None: ... + def from_url(self, url: str) -> tuple[str, int]: ... + @property + def in_waiting(self) -> int: ... + def read(self, size: int = 1) -> bytes: ... + def write(self, __b: ReadableBuffer) -> int | None: ... + def reset_input_buffer(self) -> None: ... + def reset_output_buffer(self) -> None: ... + @property + def cts(self) -> bool: ... + @property + def dsr(self) -> bool: ... + @property + def ri(self) -> bool: ... + @property + def cd(self) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/urlhandler/protocol_spy.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/urlhandler/protocol_spy.pyi new file mode 100644 index 000000000..7535be493 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/urlhandler/protocol_spy.pyi @@ -0,0 +1,34 @@ +from collections.abc import Generator +from typing import TextIO + +import serial + +def sixteen(data: bytes) -> Generator[tuple[str, str] | tuple[None, None], None, None]: ... +def hexdump(data: bytes) -> Generator[tuple[int, str], None, None]: ... + +class _Formatter: + def rx(self, data: bytes) -> None: ... + def tx(self, data: bytes) -> None: ... + def control(self, name: str, value: str) -> None: ... + +class FormatRaw(_Formatter): + output: TextIO + color: bool + rx_color: str + tx_color: str + def __init__(self, output: TextIO, color: bool) -> None: ... + +class FormatHexdump(_Formatter): + start_time: float + output: TextIO + color: bool + rx_color: str + tx_color: str + control_color: str + def __init__(self, output: TextIO, color: bool) -> None: ... + def write_line(self, timestamp: float, label: str, value: str, value2: str = ...) -> None: ... + +class Serial(serial.Serial): + formatter: FormatRaw | FormatHexdump | None + show_all: bool + def from_url(self, url: str) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/win32.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/win32.pyi new file mode 100644 index 000000000..fdcc3081e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/win32.pyi @@ -0,0 +1,161 @@ +import sys +from ctypes import Structure, Union, _CField, _NamedFuncPointer, _Pointer, c_int64, c_ulong, c_void_p +from ctypes.wintypes import DWORD +from typing_extensions import TypeAlias + +if sys.platform == "win32": + def is_64bit() -> bool: ... + + ULONG_PTR: type[c_int64 | c_ulong] + + class _SECURITY_ATTRIBUTES(Structure): + nLength: _CField + lpSecurityDescriptor: _CField + bInheritHandle: _CField + LPSECURITY_ATTRIBUTES: type[_Pointer[_SECURITY_ATTRIBUTES]] + CreateEvent: _NamedFuncPointer + CreateFile: _NamedFuncPointer + # The following are included in __all__ but their existence is not guaranteed as + # they are defined in a try/except block. Their aliases above are always defined. + CreateEventW: _NamedFuncPointer + CreateFileW: _NamedFuncPointer + + class _OVERLAPPED(Structure): + Internal: _CField + InternalHigh: _CField + Offset: _CField + OffsetHigh: _CField + Pointer: _CField + hEvent: _CField + OVERLAPPED: TypeAlias = _OVERLAPPED + + class _COMSTAT(Structure): + fCtsHold: _CField + fDsrHold: _CField + fRlsdHold: _CField + fXoffHold: _CField + fXoffSent: _CField + fEof: _CField + fTxim: _CField + fReserved: _CField + cbInQue: _CField + cbOutQue: _CField + COMSTAT: TypeAlias = _COMSTAT + + class _DCB(Structure): + DCBlength: _CField + BaudRate: _CField + fBinary: _CField + fParity: _CField + fOutxCtsFlow: _CField + fOutxDsrFlow: _CField + fDtrControl: _CField + fDsrSensitivity: _CField + fTXContinueOnXoff: _CField + fOutX: _CField + fInX: _CField + fErrorChar: _CField + fNull: _CField + fRtsControl: _CField + fAbortOnError: _CField + fDummy2: _CField + wReserved: _CField + XonLim: _CField + XoffLim: _CField + ByteSize: _CField + Parity: _CField + StopBits: _CField + XonChar: _CField + XoffChar: _CField + ErrorChar: _CField + EofChar: _CField + EvtChar: _CField + wReserved1: _CField + DCB: TypeAlias = _DCB + + class _COMMTIMEOUTS(Structure): + ReadIntervalTimeout: _CField + ReadTotalTimeoutMultiplier: _CField + ReadTotalTimeoutConstant: _CField + WriteTotalTimeoutMultiplier: _CField + WriteTotalTimeoutConstant: _CField + COMMTIMEOUTS: TypeAlias = _COMMTIMEOUTS + + GetLastError: _NamedFuncPointer + LPOVERLAPPED: type[_Pointer[_OVERLAPPED]] + LPDWORD: type[_Pointer[DWORD]] + GetOverlappedResult: _NamedFuncPointer + ResetEvent: _NamedFuncPointer + LPCVOID = c_void_p + WriteFile: _NamedFuncPointer + LPVOID = c_void_p + ReadFile: _NamedFuncPointer + CloseHandle: _NamedFuncPointer + ClearCommBreak: _NamedFuncPointer + LPCOMSTAT: type[_Pointer[_COMSTAT]] + ClearCommError: _NamedFuncPointer + SetupComm: _NamedFuncPointer + EscapeCommFunction: _NamedFuncPointer + GetCommModemStatus: _NamedFuncPointer + LPDCB: type[_Pointer[_DCB]] + GetCommState: _NamedFuncPointer + LPCOMMTIMEOUTS: type[_Pointer[_COMMTIMEOUTS]] + GetCommTimeouts: _NamedFuncPointer + PurgeComm: _NamedFuncPointer + SetCommBreak: _NamedFuncPointer + SetCommMask: _NamedFuncPointer + SetCommState: _NamedFuncPointer + SetCommTimeouts: _NamedFuncPointer + WaitForSingleObject: _NamedFuncPointer + WaitCommEvent: _NamedFuncPointer + CancelIoEx: _NamedFuncPointer + + ONESTOPBIT: int + TWOSTOPBITS: int + NOPARITY: int + ODDPARITY: int + EVENPARITY: int + RTS_CONTROL_HANDSHAKE: int + RTS_CONTROL_ENABLE: int + DTR_CONTROL_HANDSHAKE: int + DTR_CONTROL_ENABLE: int + MS_DSR_ON: int + EV_RING: int + EV_PERR: int + EV_ERR: int + SETXOFF: int + EV_RXCHAR: int + GENERIC_WRITE: int + PURGE_TXCLEAR: int + FILE_FLAG_OVERLAPPED: int + EV_DSR: int + MAXDWORD: int + EV_RLSD: int + ERROR_IO_PENDING: int + MS_CTS_ON: int + EV_EVENT1: int + EV_RX80FULL: int + PURGE_RXABORT: int + FILE_ATTRIBUTE_NORMAL: int + PURGE_TXABORT: int + SETXON: int + OPEN_EXISTING: int + MS_RING_ON: int + EV_TXEMPTY: int + EV_RXFLAG: int + MS_RLSD_ON: int + GENERIC_READ: int + EV_EVENT2: int + EV_CTS: int + EV_BREAK: int + PURGE_RXCLEAR: int + + class N11_OVERLAPPED4DOLLAR_48E(Union): + Offset: _CField + OffsetHigh: _CField + Pointer: _CField + + class N11_OVERLAPPED4DOLLAR_484DOLLAR_49E(Structure): + Offset: _CField + OffsetHigh: _CField + PVOID: TypeAlias = c_void_p diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pysftp/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/pysftp/METADATA.toml index 383daa2c7..26d6d1cac 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pysftp/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/pysftp/METADATA.toml @@ -1,5 +1,2 @@ version = "0.2.*" requires = ["types-paramiko"] - -[tool.stubtest] -ignore_missing_stub = false diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pysftp/pysftp/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pysftp/pysftp/__init__.pyi index 89d52ead3..6e42892a6 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pysftp/pysftp/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pysftp/pysftp/__init__.pyi @@ -1,10 +1,9 @@ -from _typeshed import Self from collections.abc import Callable, Sequence from contextlib import AbstractContextManager from stat import S_IMODE as S_IMODE from types import TracebackType from typing import IO -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal, Self, TypeAlias import paramiko from paramiko import AuthenticationException as AuthenticationException @@ -123,7 +122,7 @@ class Connection: @property def remote_server_key(self) -> paramiko.PKey: ... def __del__(self) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, etype: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pytest-lazy-fixture/pytest_lazyfixture.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pytest-lazy-fixture/pytest_lazyfixture.pyi index bcbf329c0..85a357e8a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pytest-lazy-fixture/pytest_lazyfixture.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pytest-lazy-fixture/pytest_lazyfixture.pyi @@ -1,5 +1,6 @@ from collections.abc import Iterable from typing import Any, overload +from typing_extensions import TypeGuard class LazyFixture: name: str @@ -10,6 +11,4 @@ class LazyFixture: def lazy_fixture(names: str) -> LazyFixture: ... @overload def lazy_fixture(names: Iterable[str]) -> list[LazyFixture] | Any: ... -def is_lazy_fixture(val: Any) -> bool: ... -def pytest_configure() -> None: ... -def __getattr__(name: str) -> Any: ... # incomplete +def is_lazy_fixture(val: object) -> TypeGuard[LazyFixture]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-crontab/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/python-crontab/METADATA.toml new file mode 100644 index 000000000..5952f2b17 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-crontab/METADATA.toml @@ -0,0 +1 @@ +version = "2.7.*" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-crontab/cronlog.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-crontab/cronlog.pyi new file mode 100644 index 000000000..f21d45161 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-crontab/cronlog.pyi @@ -0,0 +1,33 @@ +from _typeshed import StrOrBytesPath +from codecs import StreamReaderWriter +from collections.abc import Generator, Iterator +from types import TracebackType +from typing_extensions import Self + +MATCHER: str + +class LogReader: + filename: StrOrBytesPath + mass: int + size: int + read: int + pipe: StreamReaderWriter | None + def __init__(self, filename: StrOrBytesPath, mass: int = ...) -> None: ... + def __enter__(self) -> Self: ... + def __exit__( + self, error_type: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None + ) -> None: ... + def __iter__(self) -> Iterator[str]: ... + def readlines(self, until: int = ...) -> Generator[tuple[int, str], None, None]: ... + +class CronLog(LogReader): + user: str | None + def __init__(self, filename: StrOrBytesPath = ..., user: str | None = ...) -> None: ... + def for_program(self, command: str) -> ProgramLog: ... + def __iter__(self) -> dict[str, str | None]: ... # type: ignore[override] + +class ProgramLog: + log: CronLog + command: str + def __init__(self, log: CronLog, command: str) -> None: ... + def __iter__(self) -> dict[str, str | None]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-crontab/crontab.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-crontab/crontab.pyi new file mode 100644 index 000000000..7dbeb53eb --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-crontab/crontab.pyi @@ -0,0 +1,261 @@ +import re +import subprocess +from _typeshed import Incomplete, Unused +from builtins import range as _range +from collections import OrderedDict +from collections.abc import Callable, Generator, Iterable, Iterator +from datetime import datetime +from logging import Logger +from types import TracebackType +from typing import Any +from typing_extensions import Self, SupportsIndex, TypeAlias + +from cronlog import CronLog + +_User: TypeAlias = str | bool | None + +__pkgname__: str +ITEMREX: re.Pattern[str] +SPECREX: re.Pattern[str] +DEVNULL: str +WEEK_ENUM: list[str] +MONTH_ENUM: list[str | None] +SPECIALS: dict[str, str] +SPECIAL_IGNORE: list[str] +S_INFO: list[dict[str, Any]] +WINOS: bool +POSIX: bool +SYSTEMV: bool +ZERO_PAD: bool +LOG: Logger +CRON_COMMAND: str +SHELL: str +current_user: Callable[[], str | None] + +def open_pipe(cmd: str, *args: str, **flags: str) -> subprocess.Popen[Any]: ... + +class CronTab: + lines: list[str | CronItem] | None + crons: list[CronItem] | None + filen: str | None + cron_command: str + env: OrderedVariableList | None + root: bool + intab: str | None + tabfile: str | None + def __init__( + self, user: _User = ..., tab: str | None = ..., tabfile: str | None = ..., log: CronLog | str | None = ... + ) -> None: ... + def __enter__(self) -> Self: ... + def __exit__( + self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None + ) -> None: ... + @property + def log(self) -> CronLog: ... + @property + def user(self) -> _User: ... + @property + def user_opt(self) -> dict[str, str]: ... + def read(self, filename: str | None = ...) -> None: ... + def append( + self, + item: CronItem, + line: str = ..., + read: bool = ..., + before: str | re.Pattern[str] | list[CronItem] | tuple[CronItem, ...] | Generator[CronItem, Any, Any] | None = ..., + ) -> None: ... + def write(self, filename: str | None = ..., user: _User = ..., errors: bool = ...) -> None: ... + def write_to_user(self, user: bool | str = ...) -> None: ... + # Usually `kwargs` are just `now: datetime | None`, but technically this can + # work for `CronItem` subclasses, which might define other kwargs. + def run_pending(self, **kwargs: Any) -> Iterator[str]: ... + # There are two known kwargs and others are unused: + def run_scheduler(self, timeout: int = ..., *, warp: object = ..., cadence: int = ..., **kwargs: Unused) -> Iterator[str]: ... + def render(self, errors: bool = ..., specials: bool | None = ...) -> str: ... + def new( + self, + command: str = ..., + comment: str = ..., + user: str | None = ..., + pre_comment: bool = ..., + before: str | re.Pattern[str] | list[CronItem] | tuple[CronItem, ...] | Generator[CronItem, Any, Any] | None = ..., + ) -> CronItem: ... + def find_command(self, command: str | re.Pattern[str]) -> Iterator[CronItem]: ... + def find_comment(self, comment: str | re.Pattern[str]) -> Iterator[CronItem]: ... + def find_time(self, *args: Any) -> Iterator[CronItem]: ... + @property + def commands(self) -> Iterator[str]: ... + @property + def comments(self) -> Iterator[str]: ... + # You cannot actually pass `*args`, it will raise an exception, + # also known kwargs are added: + def remove_all( + self, *, command: str | re.Pattern[str] = ..., comment: str | re.Pattern[str] = ..., time: Any = ..., **kwargs: object + ) -> int: ... + def remove(self, *items: CronItem | Iterable[CronItem]) -> int: ... + def __iter__(self) -> Iterator[CronItem]: ... + def __getitem__(self, i: SupportsIndex) -> CronItem: ... + def __len__(self) -> int: ... + +class CronItem: + cron: CronTab | None + user: _User + valid: bool + enabled: bool + special: bool + comment: str + command: str | None + last_run: datetime | None + env: OrderedVariableList + pre_comment: bool + marker: str | None + stdin: str | None + slices: CronSlices + def __init__(self, command: str = ..., comment: str = ..., user: _User = ..., pre_comment: bool = ...) -> None: ... + 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 delete(self) -> None: ... + def set_command(self, cmd: str, parse_stdin: bool = ...) -> None: ... + def set_comment(self, cmt: str, pre_comment: bool = ...) -> None: ... + def parse(self, line: str) -> None: ... + def enable(self, enabled: bool = ...) -> bool: ... + def is_enabled(self) -> bool: ... + def is_valid(self) -> bool: ... + def render(self, specials: bool = ...) -> str: ... + def every_reboot(self) -> None: ... + def every(self, unit: int = ...) -> Every: ... + def setall(self, *args: Any) -> None: ... + def clear(self) -> None: ... + def frequency(self, year: int | None = ...) -> int: ... + def frequency_per_year(self, year: int | None = ...) -> int: ... + def frequency_per_day(self) -> int: ... + def frequency_per_hour(self) -> int: ... + def run_pending(self, now: datetime | None = ...) -> int | str: ... + def run(self) -> str: ... + # TODO: use types from `croniter` module here: + def schedule(self, date_from: datetime | None = ...) -> Incomplete: ... + # TODO: use types from `cron_descriptor` here: + def description(self, **kw: Incomplete) -> Incomplete: ... + @property + def log(self) -> CronLog: ... + @property + def minute(self) -> int | str: ... + @property + def minutes(self) -> int | str: ... + @property + def hour(self) -> int | str: ... + @property + def hours(self) -> int | str: ... + @property + def day(self) -> int | str: ... + @property + def dom(self) -> int | str: ... + @property + def month(self) -> int | str: ... + @property + def months(self) -> int | str: ... + @property + def dow(self) -> int | str: ... + def __len__(self) -> int: ... + def __getitem__(self, key: int | str) -> int | str: ... + def __lt__(self, value: object) -> bool: ... + def __gt__(self, value: object) -> bool: ... + +class Every: + slices: CronSlices + unit: int + # TODO: add generated attributes + def __init__(self, item: CronSlices, units: int) -> None: ... + def set_attr(self, target: int) -> Callable[[], None]: ... + def year(self) -> None: ... + +class CronSlices(list[CronSlice]): + special: bool | None + def __init__(self, *args: Any) -> None: ... + def is_self_valid(self, *args: Any) -> bool: ... + @classmethod + def is_valid(cls, *args: Any) -> bool: ... + def setall(self, *slices: str) -> None: ... + def clean_render(self) -> str: ... + def render(self, specials: bool = ...) -> str: ... + def clear(self) -> None: ... + def frequency(self, year: int | None = ...) -> int: ... + def frequency_per_year(self, year: int | None = ...) -> int: ... + def frequency_per_day(self) -> int: ... + def frequency_per_hour(self) -> int: ... + def __eq__(self, arg: object) -> bool: ... + +class SundayError(KeyError): ... + +class Also: + obj: CronSlice + def __init__(self, obj: CronSlice) -> None: ... + # These method actually use `*args`, but pass them to `CronSlice` methods, + # this is why they are typed as `Any`. + def every(self, *a: Any) -> _Part: ... + def on(self, *a: Any) -> list[_Part]: ... + def during(self, *a: Any) -> _Part: ... + +_Part: TypeAlias = int | CronValue | CronRange + +class CronSlice: + min: int | None + max: int | None + name: str | None + enum: list[str | None] | None + parts: list[_Part] + def __init__(self, info: int | dict[str, Any], value: str | None = ...) -> None: ... + def __hash__(self) -> int: ... + def parse(self, value: str | None) -> None: ... + def render(self, resolve: bool = ..., specials: bool = ...) -> str: ... + def __eq__(self, arg: object) -> bool: ... + def every(self, n_value: int, also: bool = ...) -> _Part: ... + # The only known kwarg, others are unused, + # `*args`` are passed to `parse_value`, so they are `Any` + def on(self, *n_value: Any, also: bool = ...) -> list[_Part]: ... + def during(self, vfrom: int | str, vto: int | str, also: bool = ...) -> _Part: ... + @property + def also(self) -> Also: ... + def clear(self) -> None: ... + def get_range(self, *vrange: int | str | CronValue) -> list[int | CronRange]: ... + def __iter__(self) -> Iterator[int]: ... + def __len__(self) -> int: ... + def parse_value(self, val: str, sunday: int | None = ...) -> int | CronValue: ... + +def get_cronvalue(value: int, enums: list[str]) -> int | CronValue: ... + +class CronValue: + text: str + value: int + def __init__(self, value: str, enums: list[str]) -> None: ... + def __lt__(self, value: object) -> bool: ... + def __int__(self) -> int: ... + +class CronRange: + dangling: int | None + slice: str + cron: CronTab | None + seq: int + def __init__(self, vslice: str, *vrange: int | str | CronValue) -> None: ... + # Are not set in `__init__`: + vfrom: int | CronValue + vto: int | CronValue + def parse(self, value: str) -> None: ... + def all(self) -> None: ... + def render(self, resolve: bool = ...) -> str: ... + def range(self) -> _range: ... + def every(self, value: int | str) -> None: ... + def __lt__(self, value: object) -> bool: ... + def __gt__(self, value: object) -> bool: ... + def __int__(self) -> int: ... + +# TODO: make generic +class OrderedVariableList(OrderedDict[Incomplete, Incomplete]): + job: Incomplete + def __init__(self, *args: Any, **kw: Any) -> None: ... + @property + def previous(self) -> Incomplete: ... + def all(self) -> Self: ... + def __getitem__(self, key: Incomplete) -> Incomplete: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-crontab/crontabs.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-crontab/crontabs.pyi new file mode 100644 index 000000000..85fd062db --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-crontab/crontabs.pyi @@ -0,0 +1,24 @@ +from typing import Any + +from crontab import CronTab + +class UserSpool(list[CronTab]): + def __init__(self, loc: str, tabs: CronTabs | None = ...) -> None: ... + def listdir(self, loc: str) -> list[str]: ... + def get_owner(self, path: str) -> str: ... + def generate(self, loc: str, username: str) -> CronTab: ... + +class SystemTab(list[CronTab]): + def __init__(self, loc: str, tabs: CronTabs | None = ...) -> None: ... + +class AnaCronTab(list[CronTab]): + def __init__(self, loc: str, tabs: CronTabs | None = ...) -> None: ... + def add(self, loc: str, item: str, anajob: CronTab) -> CronTab: ... + +KNOWN_LOCATIONS: list[tuple[UserSpool | SystemTab | AnaCronTab, str]] + +class CronTabs(list[UserSpool | SystemTab | AnaCronTab]): + def __init__(self) -> None: ... + def add(self, cls: type[UserSpool | SystemTab | AnaCronTab], *args: Any) -> None: ... + @property + def all(self) -> CronTab: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-datemath/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/python-datemath/METADATA.toml new file mode 100644 index 000000000..8b3cb47b1 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-datemath/METADATA.toml @@ -0,0 +1,6 @@ +version = "1.5.*" +# Requires a version of arrow with a `py.typed` file +requires = ["arrow>=1.0.1"] + +[tool.stubtest] +ignore_missing_stub = true diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-datemath/datemath/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-datemath/datemath/__init__.pyi new file mode 100644 index 000000000..ecb00250a --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-datemath/datemath/__init__.pyi @@ -0,0 +1,12 @@ +from datetime import datetime + +import arrow + +from .helpers import DateMathException as DateMathException, parse as parse + +def dm( + expr: str, *, now: arrow.Arrow | None = ..., tz: str = ..., type: str | None = ..., roundDown: bool = ... +) -> arrow.Arrow: ... +def datemath( + expr: str, *, now: arrow.Arrow | None = ..., tz: str = ..., type: str | None = ..., roundDown: bool = ... +) -> datetime: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-datemath/datemath/helpers.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-datemath/datemath/helpers.pyi new file mode 100644 index 000000000..52402ea63 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-datemath/datemath/helpers.pyi @@ -0,0 +1,10 @@ +from _typeshed import Incomplete + +import arrow + +class DateMathException(Exception): ... + +def parse( + expression: str, now: arrow.Arrow | None = ..., tz: str = ..., type: str | None = ..., roundDown: bool = ... +) -> arrow.Arrow: ... +def __getattr__(name: str) -> Incomplete: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/METADATA.toml index fa0e835cb..2b4746def 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/METADATA.toml @@ -1 +1,4 @@ version = "2.8.*" + +[tool.stubtest] +ignore_missing_stub = true diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/_common.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/_common.pyi index 081bebecd..dd7eff9b6 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/_common.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/_common.pyi @@ -1,8 +1,8 @@ -from _typeshed import Self +from typing_extensions import Self class weekday: def __init__(self, weekday: int, n: int | None = ...) -> None: ... - def __call__(self: Self, n: int) -> Self: ... + def __call__(self, n: int) -> Self: ... def __eq__(self, other: object) -> bool: ... def __hash__(self) -> int: ... weekday: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/parser/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/parser/__init__.pyi index 58b24e398..96fd22474 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/parser/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/parser/__init__.pyi @@ -1,4 +1,4 @@ -from collections.abc import Mapping +from collections.abc import Callable, Mapping from datetime import datetime, tzinfo from typing import IO, Any from typing_extensions import TypeAlias @@ -6,6 +6,8 @@ from typing_extensions import TypeAlias from .isoparser import isoparse as isoparse, isoparser as isoparser _FileOrStr: TypeAlias = bytes | str | IO[str] | IO[Any] +_TzData: TypeAlias = tzinfo | int | str | None +_TzInfo: TypeAlias = Mapping[str, _TzData] | Callable[[str, int], _TzData] class parserinfo: JUMP: list[str] @@ -35,13 +37,28 @@ class parser: timestr: _FileOrStr, default: datetime | None = ..., ignoretz: bool = ..., - tzinfos: Mapping[str, tzinfo] | None = ..., - **kwargs: Any, + tzinfos: _TzInfo | None = ..., + *, + dayfirst: bool | None = ..., + yearfirst: bool | None = ..., + fuzzy: bool = ..., + fuzzy_with_tokens: bool = ..., ) -> datetime: ... DEFAULTPARSER: parser -def parse(timestr: _FileOrStr, parserinfo: parserinfo | None = ..., **kwargs: Any) -> datetime: ... +def parse( + timestr: _FileOrStr, + parserinfo: parserinfo | None = ..., + *, + dayfirst: bool | None = ..., + yearfirst: bool | None = ..., + ignoretz: bool = ..., + fuzzy: bool = ..., + fuzzy_with_tokens: bool = ..., + default: datetime | None = ..., + tzinfos: _TzInfo | None = ..., +) -> datetime: ... class _tzparser: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/relativedelta.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/relativedelta.pyi index 20f7c6833..4d300afac 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/relativedelta.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/relativedelta.pyi @@ -1,12 +1,10 @@ -from _typeshed import Self from datetime import date, datetime, timedelta from typing import SupportsFloat, TypeVar, overload -from typing_extensions import TypeAlias +from typing_extensions import Self, TypeAlias -from ._common import weekday +# See #9817 for why we reexport this here +from ._common import weekday as weekday -# We need the extra "Self" TypeVar to avoid overlapping __add__/__radd__ complaints from mypy -_SelfT = TypeVar("_SelfT", bound=relativedelta) _DateT = TypeVar("_DateT", date, datetime) # Work around attribute and type having the same name. _Weekday: TypeAlias = weekday @@ -64,36 +62,36 @@ class relativedelta: def weeks(self) -> int: ... @weeks.setter def weeks(self, value: int) -> None: ... - def normalized(self: Self) -> Self: ... + def normalized(self) -> Self: ... # TODO: use Union when mypy will handle it properly in overloaded operator # methods (#2129, #1442, #1264 in mypy) @overload - def __add__(self: _SelfT, other: relativedelta) -> _SelfT: ... # noqa: Y019 + def __add__(self, other: relativedelta) -> Self: ... @overload - def __add__(self: _SelfT, other: timedelta) -> _SelfT: ... # noqa: Y019 + def __add__(self, other: timedelta) -> Self: ... @overload def __add__(self, other: _DateT) -> _DateT: ... @overload - def __radd__(self: _SelfT, other: relativedelta) -> _SelfT: ... # noqa: Y019 + def __radd__(self, other: relativedelta) -> Self: ... @overload - def __radd__(self: _SelfT, other: timedelta) -> _SelfT: ... # noqa: Y019 + def __radd__(self, other: timedelta) -> Self: ... @overload def __radd__(self, other: _DateT) -> _DateT: ... @overload - def __rsub__(self: Self, other: relativedelta) -> Self: ... + def __rsub__(self, other: relativedelta) -> Self: ... @overload - def __rsub__(self: Self, other: timedelta) -> Self: ... + def __rsub__(self, other: timedelta) -> Self: ... @overload def __rsub__(self, other: _DateT) -> _DateT: ... - def __sub__(self: Self, other: relativedelta) -> Self: ... - def __neg__(self: Self) -> Self: ... + def __sub__(self, other: relativedelta) -> Self: ... + def __neg__(self) -> Self: ... def __bool__(self) -> bool: ... def __nonzero__(self) -> bool: ... - def __mul__(self: Self, other: SupportsFloat) -> Self: ... - def __rmul__(self: Self, other: SupportsFloat) -> Self: ... + def __mul__(self, other: SupportsFloat) -> Self: ... + def __rmul__(self, other: SupportsFloat) -> Self: ... def __eq__(self, other: object) -> bool: ... def __ne__(self, other: object) -> bool: ... - def __div__(self: Self, other: SupportsFloat) -> Self: ... - def __truediv__(self: Self, other: SupportsFloat) -> Self: ... - def __abs__(self: Self) -> Self: ... + def __div__(self, other: SupportsFloat) -> Self: ... + def __truediv__(self, other: SupportsFloat) -> Self: ... + def __abs__(self) -> Self: ... def __hash__(self) -> int: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/rrule.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/rrule.pyi index 7acf76454..60b84d63c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/rrule.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/rrule.pyi @@ -1,5 +1,6 @@ import datetime -from collections.abc import Iterable +from _typeshed import Incomplete +from collections.abc import Iterable, Iterator from typing import Any from typing_extensions import TypeAlias @@ -26,13 +27,13 @@ SU: weekday class rrulebase: def __init__(self, cache: bool = ...) -> None: ... - def __iter__(self): ... + def __iter__(self) -> Iterator[datetime.datetime]: ... def __getitem__(self, item): ... def __contains__(self, item): ... def count(self): ... def before(self, dt, inc: bool = ...): ... def after(self, dt, inc: bool = ...): ... - def xafter(self, dt, count: Any | None = ..., inc: bool = ...): ... + def xafter(self, dt, count: Incomplete | None = ..., inc: bool = ...): ... def between(self, after, before, inc: bool = ..., count: int = ...): ... class rrule(rrulebase): diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/tz/_common.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/tz/_common.pyi index 38a98601f..c9e6ba5dd 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/tz/_common.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/tz/_common.pyi @@ -1,3 +1,4 @@ +import abc from datetime import datetime, timedelta, tzinfo from typing import ClassVar @@ -8,7 +9,10 @@ class _DatetimeWithFold(datetime): @property def fold(self): ... -class _tzinfo(tzinfo): +# Doesn't actually have ABCMeta as the metaclass at runtime, +# but mypy complains if we don't have it in the stub. +# See discussion in #8908 +class _tzinfo(tzinfo, metaclass=abc.ABCMeta): def is_ambiguous(self, dt: datetime) -> bool: ... def fromutc(self, dt: datetime) -> datetime: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/tz/tz.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/tz/tz.pyi index dfafcdda0..a84425283 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/tz/tz.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/tz/tz.pyi @@ -1,5 +1,6 @@ import datetime -from typing import Any, ClassVar, Protocol, TypeVar +from _typeshed import Incomplete +from typing import ClassVar, Protocol, TypeVar from typing_extensions import Literal from ..relativedelta import relativedelta @@ -99,7 +100,7 @@ class _ICalReader(Protocol): class tzical: def __init__(self, fileobj: str | _ICalReader) -> None: ... def keys(self): ... - def get(self, tzid: Any | None = ...): ... + def get(self, tzid: Incomplete | None = ...): ... TZFILES: list[str] TZPATHS: list[str] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/zoneinfo/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/zoneinfo/__init__.pyi new file mode 100644 index 000000000..59c12273f --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/zoneinfo/__init__.pyi @@ -0,0 +1,17 @@ +from _typeshed import Incomplete +from typing import IO +from typing_extensions import TypeAlias + +__all__ = ["get_zonefile_instance", "gettz", "gettz_db_metadata"] + +_MetadataType: TypeAlias = dict[str, Incomplete] + +class ZoneInfoFile: + zones: dict[Incomplete, Incomplete] + metadata: _MetadataType | None + def __init__(self, zonefile_stream: IO[bytes] | None = ...) -> None: ... + def get(self, name, default: Incomplete | None = ...): ... + +def get_zonefile_instance(new_instance: bool = ...) -> ZoneInfoFile: ... +def gettz(name): ... +def gettz_db_metadata() -> _MetadataType: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/zoneinfo/rebuild.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/zoneinfo/rebuild.pyi new file mode 100644 index 000000000..67668644e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/zoneinfo/rebuild.pyi @@ -0,0 +1,11 @@ +from _typeshed import Incomplete, StrOrBytesPath +from collections.abc import Sequence +from tarfile import TarInfo + +def rebuild( + filename: StrOrBytesPath, + tag: Incomplete | None = ..., + format: str = ..., + zonegroups: Sequence[str | TarInfo] = ..., + metadata: Incomplete | None = ..., +) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-gflags/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/python-gflags/METADATA.toml index 47a34df73..84307529a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/python-gflags/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-gflags/METADATA.toml @@ -1,4 +1 @@ version = "3.1.*" - -[tool.stubtest] -ignore_missing_stub = false diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-gflags/gflags.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-gflags/gflags.pyi index 4205483c4..84da38655 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/python-gflags/gflags.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-gflags/gflags.pyi @@ -35,7 +35,6 @@ def doc_to_help(doc: str) -> str: ... DocToHelp = doc_to_help class FlagValues: - def __init__(self) -> None: ... def UseGnuGetOpt(self, use_gnu_getopt: bool = ...) -> None: ... def is_gnu_getopt(self) -> bool: ... IsGnuGetOpt = is_gnu_getopt diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-jose/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/python-jose/METADATA.toml index ade9241b2..5cc80a931 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/python-jose/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-jose/METADATA.toml @@ -1,5 +1,2 @@ version = "3.3.*" -requires = [] # excluding pyasn1, pyrsa, cryptography until typing is available - -[tool.stubtest] -ignore_missing_stub = false +requires = ["types-pyasn1"] # excluding pyrsa, cryptography until typing is available diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-jose/jose/backends/_asn1.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-jose/jose/backends/_asn1.pyi index 0c01c0858..b4fce464c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/python-jose/jose/backends/_asn1.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-jose/jose/backends/_asn1.pyi @@ -1,22 +1,17 @@ -from typing import Any -from typing_extensions import TypeAlias - -# Enable when pyasn1 gets stubs: -# from pyasn1.type import univ -_Sequence: TypeAlias = Any +from pyasn1.type import namedtype, univ RSA_ENCRYPTION_ASN1_OID: str -class RsaAlgorithmIdentifier(_Sequence): - componentType: Any +class RsaAlgorithmIdentifier(univ.Sequence): + componentType: namedtype.NamedTypes -class PKCS8PrivateKey(_Sequence): - componentType: Any +class PKCS8PrivateKey(univ.Sequence): + componentType: namedtype.NamedTypes -class PublicKeyInfo(_Sequence): - componentType: Any +class PublicKeyInfo(univ.Sequence): + componentType: namedtype.NamedTypes -def rsa_private_key_pkcs8_to_pkcs1(pkcs8_key): ... -def rsa_private_key_pkcs1_to_pkcs8(pkcs1_key): ... -def rsa_public_key_pkcs1_to_pkcs8(pkcs1_key): ... -def rsa_public_key_pkcs8_to_pkcs1(pkcs8_key): ... +def rsa_private_key_pkcs8_to_pkcs1(pkcs8_key) -> bytes: ... +def rsa_private_key_pkcs1_to_pkcs8(pkcs1_key) -> bytes: ... +def rsa_public_key_pkcs1_to_pkcs8(pkcs1_key) -> bytes: ... +def rsa_public_key_pkcs8_to_pkcs1(pkcs8_key) -> bytes: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-jose/jose/backends/base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-jose/jose/backends/base.pyi index ea7f34f5b..26313de27 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/python-jose/jose/backends/base.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-jose/jose/backends/base.pyi @@ -1,5 +1,5 @@ -from _typeshed import Self from typing import Any +from typing_extensions import Self class Key: # Enable when we can use stubs from installed dependencies, @@ -8,7 +8,7 @@ class Key: def __init__(self, key, algorithm) -> None: ... def sign(self, msg: bytes) -> bytes: ... def verify(self, msg: bytes, sig: bytes) -> bool: ... - def public_key(self: Self) -> Self: ... + def public_key(self) -> Self: ... def to_pem(self) -> bytes: ... def to_dict(self) -> dict[str, Any]: ... def encrypt(self, plain_text: str | bytes, aad: bytes | None = ...) -> tuple[bytes, bytes, bytes | None]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-jose/jose/backends/cryptography_backend.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-jose/jose/backends/cryptography_backend.pyi index 4454988e3..d910e72d0 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/python-jose/jose/backends/cryptography_backend.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-jose/jose/backends/cryptography_backend.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from .base import Key @@ -52,8 +53,8 @@ class CryptographyAESKey(Key): MODES: Any def __init__(self, key, algorithm) -> None: ... def to_dict(self): ... - def encrypt(self, plain_text, aad: Any | None = ...): ... - def decrypt(self, cipher_text, iv: Any | None = ..., aad: Any | None = ..., tag: Any | None = ...): ... + def encrypt(self, plain_text, aad: Incomplete | None = ...): ... + def decrypt(self, cipher_text, iv: Incomplete | None = ..., aad: Incomplete | None = ..., tag: Incomplete | None = ...): ... def wrap_key(self, key_data): ... def unwrap_key(self, wrapped_key): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-jose/jose/backends/ecdsa_backend.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-jose/jose/backends/ecdsa_backend.pyi index 9a78fb36b..fea488c78 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/python-jose/jose/backends/ecdsa_backend.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-jose/jose/backends/ecdsa_backend.pyi @@ -1,7 +1,7 @@ -from _typeshed import Self from collections.abc import Callable from hashlib import _Hash from typing import Any +from typing_extensions import Self from .base import Key @@ -20,6 +20,6 @@ class ECDSAECKey(Key): def sign(self, msg): ... def verify(self, msg, sig): ... def is_public(self) -> bool: ... - def public_key(self: Self) -> Self: ... + def public_key(self) -> Self: ... def to_pem(self): ... def to_dict(self) -> dict[str, Any]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-jose/jose/backends/rsa_backend.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-jose/jose/backends/rsa_backend.pyi index cb0442287..39e9b1715 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/python-jose/jose/backends/rsa_backend.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-jose/jose/backends/rsa_backend.pyi @@ -1,5 +1,5 @@ -from _typeshed import Self from typing import Any +from typing_extensions import Self from .base import Key @@ -20,7 +20,7 @@ class RSAKey(Key): def sign(self, msg: bytes) -> bytes: ... def verify(self, msg: bytes, sig: bytes) -> bool: ... def is_public(self) -> bool: ... - def public_key(self: Self) -> Self: ... + def public_key(self) -> Self: ... def to_pem(self, pem_format: str = ...) -> bytes: ... def to_dict(self) -> dict[str, Any]: ... def wrap_key(self, key_data: bytes) -> bytes: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-jose/jose/jws.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-jose/jose/jws.pyi index c8783f9e4..0898a14e1 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/python-jose/jose/jws.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-jose/jose/jws.pyi @@ -19,6 +19,6 @@ def verify( algorithms: str | Container[str] | None, verify: bool = ..., ) -> bytes: ... -def get_unverified_header(token: str) -> dict[str, Any]: ... -def get_unverified_headers(token: str) -> dict[str, Any]: ... -def get_unverified_claims(token: str) -> str: ... +def get_unverified_header(token: str | bytes) -> dict[str, Any]: ... +def get_unverified_headers(token: str | bytes) -> dict[str, Any]: ... +def get_unverified_claims(token: str | bytes) -> bytes: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-jose/jose/jwt.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-jose/jose/jwt.pyi index 3c957710e..4a297cb11 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/python-jose/jose/jwt.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-jose/jose/jwt.pyi @@ -21,6 +21,6 @@ def decode( subject: str | None = ..., access_token: str | None = ..., ) -> dict[str, Any]: ... -def get_unverified_header(token: str) -> dict[str, Any]: ... -def get_unverified_headers(token: str) -> dict[str, Any]: ... -def get_unverified_claims(token: str) -> dict[str, Any]: ... +def get_unverified_header(token: str | bytes) -> dict[str, Any]: ... +def get_unverified_headers(token: str | bytes) -> dict[str, Any]: ... +def get_unverified_claims(token: str | bytes) -> dict[str, Any]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-nmap/nmap/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-nmap/nmap/__init__.pyi index d495f0489..d2e6aef65 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/python-nmap/nmap/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-nmap/nmap/__init__.pyi @@ -1 +1,2 @@ from .nmap import * +from .nmap import __author__ as __author__, __last_modification__ as __last_modification__, __version__ as __version__ diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-nmap/nmap/nmap.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-nmap/nmap/nmap.pyi index 4b7aa0591..ae8e48ba9 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/python-nmap/nmap/nmap.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-nmap/nmap/nmap.pyi @@ -49,6 +49,8 @@ class _ResultHostPort(TypedDict): version: str __last_modification__: str +__author__: str +__version__: str class PortScanner: def __init__(self, nmap_search_path: Iterable[str] = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-slugify/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/python-slugify/METADATA.toml index b18b5e43e..629f910b2 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/python-slugify/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-slugify/METADATA.toml @@ -1 +1 @@ -version = "6.1.*" +version = "8.0.*" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-slugify/slugify/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-slugify/slugify/__init__.pyi index 1a7847377..2d77c5af9 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/python-slugify/slugify/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-slugify/slugify/__init__.pyi @@ -1,2 +1,12 @@ +from .__version__ import ( + __author__ as __author__, + __author_email__ as __author_email__, + __copyright__ as __copyright__, + __description__ as __description__, + __license__ as __license__, + __title__ as __title__, + __url__ as __url__, + __version__ as __version__, +) from .slugify import * from .special import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-slugify/slugify/__version__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-slugify/slugify/__version__.pyi new file mode 100644 index 000000000..ed1591f36 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-slugify/slugify/__version__.pyi @@ -0,0 +1,8 @@ +__title__: str +__author__: str +__author_email__: str +__description__: str +__url__: str +__license__: str +__copyright__: str +__version__: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/METADATA.toml new file mode 100644 index 000000000..86e974f53 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/METADATA.toml @@ -0,0 +1,2 @@ +version = "0.33.*" +requires = ["types-Pillow"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/X.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/X.pyi new file mode 100644 index 000000000..30261ec97 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/X.pyi @@ -0,0 +1,345 @@ +NONE: int +ParentRelative: int +CopyFromParent: int +PointerWindow: int +InputFocus: int +PointerRoot: int +AnyPropertyType: int +AnyKey: int +AnyButton: int +AllTemporary: int +CurrentTime: int +NoSymbol: int +NoEventMask: int +KeyPressMask: int +KeyReleaseMask: int +ButtonPressMask: int +ButtonReleaseMask: int +EnterWindowMask: int +LeaveWindowMask: int +PointerMotionMask: int +PointerMotionHintMask: int +Button1MotionMask: int +Button2MotionMask: int +Button3MotionMask: int +Button4MotionMask: int +Button5MotionMask: int +ButtonMotionMask: int +KeymapStateMask: int +ExposureMask: int +VisibilityChangeMask: int +StructureNotifyMask: int +ResizeRedirectMask: int +SubstructureNotifyMask: int +SubstructureRedirectMask: int +FocusChangeMask: int +PropertyChangeMask: int +ColormapChangeMask: int +OwnerGrabButtonMask: int +KeyPress: int +KeyRelease: int +ButtonPress: int +ButtonRelease: int +MotionNotify: int +EnterNotify: int +LeaveNotify: int +FocusIn: int +FocusOut: int +KeymapNotify: int +Expose: int +GraphicsExpose: int +NoExpose: int +VisibilityNotify: int +CreateNotify: int +DestroyNotify: int +UnmapNotify: int +MapNotify: int +MapRequest: int +ReparentNotify: int +ConfigureNotify: int +ConfigureRequest: int +GravityNotify: int +ResizeRequest: int +CirculateNotify: int +CirculateRequest: int +PropertyNotify: int +SelectionClear: int +SelectionRequest: int +SelectionNotify: int +ColormapNotify: int +ClientMessage: int +MappingNotify: int +LASTEvent: int +ShiftMask: int +LockMask: int +ControlMask: int +Mod1Mask: int +Mod2Mask: int +Mod3Mask: int +Mod4Mask: int +Mod5Mask: int +ShiftMapIndex: int +LockMapIndex: int +ControlMapIndex: int +Mod1MapIndex: int +Mod2MapIndex: int +Mod3MapIndex: int +Mod4MapIndex: int +Mod5MapIndex: int +Button1Mask: int +Button2Mask: int +Button3Mask: int +Button4Mask: int +Button5Mask: int +AnyModifier: int +Button1: int +Button2: int +Button3: int +Button4: int +Button5: int +NotifyNormal: int +NotifyGrab: int +NotifyUngrab: int +NotifyWhileGrabbed: int +NotifyHint: int +NotifyAncestor: int +NotifyVirtual: int +NotifyInferior: int +NotifyNonlinear: int +NotifyNonlinearVirtual: int +NotifyPointer: int +NotifyPointerRoot: int +NotifyDetailNone: int +VisibilityUnobscured: int +VisibilityPartiallyObscured: int +VisibilityFullyObscured: int +PlaceOnTop: int +PlaceOnBottom: int +FamilyInternet: int +FamilyDECnet: int +FamilyChaos: int +FamilyServerInterpreted: int +FamilyInternetV6: int +PropertyNewValue: int +PropertyDelete: int +ColormapUninstalled: int +ColormapInstalled: int +GrabModeSync: int +GrabModeAsync: int +GrabSuccess: int +AlreadyGrabbed: int +GrabInvalidTime: int +GrabNotViewable: int +GrabFrozen: int +AsyncPointer: int +SyncPointer: int +ReplayPointer: int +AsyncKeyboard: int +SyncKeyboard: int +ReplayKeyboard: int +AsyncBoth: int +SyncBoth: int +RevertToNone: int +RevertToPointerRoot: int +RevertToParent: int +Success: int +BadRequest: int +BadValue: int +BadWindow: int +BadPixmap: int +BadAtom: int +BadCursor: int +BadFont: int +BadMatch: int +BadDrawable: int +BadAccess: int +BadAlloc: int +BadColor: int +BadGC: int +BadIDChoice: int +BadName: int +BadLength: int +BadImplementation: int +FirstExtensionError: int +LastExtensionError: int +InputOutput: int +InputOnly: int +CWBackPixmap: int +CWBackPixel: int +CWBorderPixmap: int +CWBorderPixel: int +CWBitGravity: int +CWWinGravity: int +CWBackingStore: int +CWBackingPlanes: int +CWBackingPixel: int +CWOverrideRedirect: int +CWSaveUnder: int +CWEventMask: int +CWDontPropagate: int +CWColormap: int +CWCursor: int +CWX: int +CWY: int +CWWidth: int +CWHeight: int +CWBorderWidth: int +CWSibling: int +CWStackMode: int +ForgetGravity: int +NorthWestGravity: int +NorthGravity: int +NorthEastGravity: int +WestGravity: int +CenterGravity: int +EastGravity: int +SouthWestGravity: int +SouthGravity: int +SouthEastGravity: int +StaticGravity: int +UnmapGravity: int +NotUseful: int +WhenMapped: int +Always: int +IsUnmapped: int +IsUnviewable: int +IsViewable: int +SetModeInsert: int +SetModeDelete: int +DestroyAll: int +RetainPermanent: int +RetainTemporary: int +Above: int +Below: int +TopIf: int +BottomIf: int +Opposite: int +RaiseLowest: int +LowerHighest: int +PropModeReplace: int +PropModePrepend: int +PropModeAppend: int +GXclear: int +GXand: int +GXandReverse: int +GXcopy: int +GXandInverted: int +GXnoop: int +GXxor: int +GXor: int +GXnor: int +GXequiv: int +GXinvert: int +GXorReverse: int +GXcopyInverted: int +GXorInverted: int +GXnand: int +GXset: int +LineSolid: int +LineOnOffDash: int +LineDoubleDash: int +CapNotLast: int +CapButt: int +CapRound: int +CapProjecting: int +JoinMiter: int +JoinRound: int +JoinBevel: int +FillSolid: int +FillTiled: int +FillStippled: int +FillOpaqueStippled: int +EvenOddRule: int +WindingRule: int +ClipByChildren: int +IncludeInferiors: int +Unsorted: int +YSorted: int +YXSorted: int +YXBanded: int +CoordModeOrigin: int +CoordModePrevious: int +Complex: int +Nonconvex: int +Convex: int +ArcChord: int +ArcPieSlice: int +GCFunction: int +GCPlaneMask: int +GCForeground: int +GCBackground: int +GCLineWidth: int +GCLineStyle: int +GCCapStyle: int +GCJoinStyle: int +GCFillStyle: int +GCFillRule: int +GCTile: int +GCStipple: int +GCTileStipXOrigin: int +GCTileStipYOrigin: int +GCFont: int +GCSubwindowMode: int +GCGraphicsExposures: int +GCClipXOrigin: int +GCClipYOrigin: int +GCClipMask: int +GCDashOffset: int +GCDashList: int +GCArcMode: int +GCLastBit: int +FontLeftToRight: int +FontRightToLeft: int +FontChange: int +XYBitmap: int +XYPixmap: int +ZPixmap: int +AllocNone: int +AllocAll: int +DoRed: int +DoGreen: int +DoBlue: int +CursorShape: int +TileShape: int +StippleShape: int +AutoRepeatModeOff: int +AutoRepeatModeOn: int +AutoRepeatModeDefault: int +LedModeOff: int +LedModeOn: int +KBKeyClickPercent: int +KBBellPercent: int +KBBellPitch: int +KBBellDuration: int +KBLed: int +KBLedMode: int +KBKey: int +KBAutoRepeatMode: int +MappingSuccess: int +MappingBusy: int +MappingFailed: int +MappingModifier: int +MappingKeyboard: int +MappingPointer: int +DontPreferBlanking: int +PreferBlanking: int +DefaultBlanking: int +DisableScreenSaver: int +DisableScreenInterval: int +DontAllowExposures: int +AllowExposures: int +DefaultExposures: int +ScreenSaverReset: int +ScreenSaverActive: int +HostInsert: int +HostDelete: int +EnableAccess: int +DisableAccess: int +StaticGray: int +GrayScale: int +StaticColor: int +PseudoColor: int +TrueColor: int +DirectColor: int +LSBFirst: int +MSBFirst: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/XK.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/XK.pyi new file mode 100644 index 000000000..01ad54818 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/XK.pyi @@ -0,0 +1,7 @@ +from Xlib.keysymdef.latin1 import * +from Xlib.keysymdef.miscellany import * +from Xlib.X import NoSymbol as NoSymbol + +def string_to_keysym(keysym: str) -> int: ... +def load_keysym_group(group: str) -> None: ... +def keysym_to_string(keysym: int) -> str | None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/Xatom.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/Xatom.pyi new file mode 100644 index 000000000..e0c1e0a9e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/Xatom.pyi @@ -0,0 +1,69 @@ +PRIMARY: int +SECONDARY: int +ARC: int +ATOM: int +BITMAP: int +CARDINAL: int +COLORMAP: int +CURSOR: int +CUT_BUFFER0: int +CUT_BUFFER1: int +CUT_BUFFER2: int +CUT_BUFFER3: int +CUT_BUFFER4: int +CUT_BUFFER5: int +CUT_BUFFER6: int +CUT_BUFFER7: int +DRAWABLE: int +FONT: int +INTEGER: int +PIXMAP: int +POINT: int +RECTANGLE: int +RESOURCE_MANAGER: int +RGB_COLOR_MAP: int +RGB_BEST_MAP: int +RGB_BLUE_MAP: int +RGB_DEFAULT_MAP: int +RGB_GRAY_MAP: int +RGB_GREEN_MAP: int +RGB_RED_MAP: int +STRING: int +VISUALID: int +WINDOW: int +WM_COMMAND: int +WM_HINTS: int +WM_CLIENT_MACHINE: int +WM_ICON_NAME: int +WM_ICON_SIZE: int +WM_NAME: int +WM_NORMAL_HINTS: int +WM_SIZE_HINTS: int +WM_ZOOM_HINTS: int +MIN_SPACE: int +NORM_SPACE: int +MAX_SPACE: int +END_SPACE: int +SUPERSCRIPT_X: int +SUPERSCRIPT_Y: int +SUBSCRIPT_X: int +SUBSCRIPT_Y: int +UNDERLINE_POSITION: int +UNDERLINE_THICKNESS: int +STRIKEOUT_ASCENT: int +STRIKEOUT_DESCENT: int +ITALIC_ANGLE: int +X_HEIGHT: int +QUAD_WIDTH: int +WEIGHT: int +POINT_SIZE: int +RESOLUTION: int +COPYRIGHT: int +NOTICE: int +FONT_NAME: int +FAMILY_NAME: int +FULL_NAME: int +CAP_HEIGHT: int +WM_CLASS: int +WM_TRANSIENT_FOR: int +LAST_PREDEFINED: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/Xcursorfont.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/Xcursorfont.pyi new file mode 100644 index 000000000..431164885 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/Xcursorfont.pyi @@ -0,0 +1,78 @@ +num_glyphs: int +X_cursor: int +arrow: int +based_arrow_down: int +based_arrow_up: int +boat: int +bogosity: int +bottom_left_corner: int +bottom_right_corner: int +bottom_side: int +bottom_tee: int +box_spiral: int +center_ptr: int +circle: int +clock: int +coffee_mug: int +cross: int +cross_reverse: int +crosshair: int +diamond_cross: int +dot: int +dotbox: int +double_arrow: int +draft_large: int +draft_small: int +draped_box: int +exchange: int +fleur: int +gobbler: int +gumby: int +hand1: int +hand2: int +heart: int +icon: int +iron_cross: int +left_ptr: int +left_side: int +left_tee: int +leftbutton: int +ll_angle: int +lr_angle: int +man: int +middlebutton: int +mouse: int +pencil: int +pirate: int +plus: int +question_arrow: int +right_ptr: int +right_side: int +right_tee: int +rightbutton: int +rtl_logo: int +sailboat: int +sb_down_arrow: int +sb_h_double_arrow: int +sb_left_arrow: int +sb_right_arrow: int +sb_up_arrow: int +sb_v_double_arrow: int +shuttle: int +sizing: int +spider: int +spraycan: int +star: int +target: int +tcross: int +top_left_arrow: int +top_left_corner: int +top_right_corner: int +top_side: int +top_tee: int +trek: int +ul_angle: int +umbrella: int +ur_angle: int +watch: int +xterm: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/Xutil.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/Xutil.pyi new file mode 100644 index 000000000..e30c44b13 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/Xutil.pyi @@ -0,0 +1,57 @@ +NoValue: int +XValue: int +YValue: int +WidthValue: int +HeightValue: int +AllValues: int +XNegative: int +YNegative: int +USPosition: int +USSize: int +PPosition: int +PSize: int +PMinSize: int +PMaxSize: int +PResizeInc: int +PAspect: int +PBaseSize: int +PWinGravity: int +PAllHints: int +InputHint: int +StateHint: int +IconPixmapHint: int +IconWindowHint: int +IconPositionHint: int +IconMaskHint: int +WindowGroupHint: int +MessageHint: int +UrgencyHint: int +AllHints: int +WithdrawnState: int +NormalState: int +IconicState: int +DontCareState: int +ZoomState: int +InactiveState: int +RectangleOut: int +RectangleIn: int +RectanglePart: int +VisualNoMask: int +VisualIDMask: int +VisualScreenMask: int +VisualDepthMask: int +VisualClassMask: int +VisualRedMaskMask: int +VisualGreenMaskMask: int +VisualBlueMaskMask: int +VisualColormapSizeMask: int +VisualBitsPerRGBMask: int +VisualAllMask: int +ReleaseByFreeingColormap: int +BitmapSuccess: int +BitmapOpenFailed: int +BitmapFileInvalid: int +BitmapNoMemory: int +XCSUCCESS: int +XCNOMEM: int +XCNOENT: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/__init__.pyi new file mode 100644 index 000000000..988134c01 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/__init__.pyi @@ -0,0 +1,14 @@ +from Xlib import ( + XK as XK, + X as X, + Xatom as Xatom, + Xcursorfont as Xcursorfont, + Xutil as Xutil, + display as display, + error as error, + rdb as rdb, +) + +__all__ = ["X", "XK", "Xatom", "Xcursorfont", "Xutil", "display", "error", "rdb"] + +# Shared types throughout the stub diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/_typing.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/_typing.pyi new file mode 100644 index 000000000..ff7016194 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/_typing.pyi @@ -0,0 +1,10 @@ +from collections.abc import Callable +from typing import TypeVar +from typing_extensions import TypeAlias + +from Xlib.error import XError +from Xlib.protocol.rq import Request + +_T = TypeVar("_T") +ErrorHandler: TypeAlias = Callable[[XError, Request | None], _T] +Unused: TypeAlias = object diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/display.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/display.pyi new file mode 100644 index 000000000..b307a68e5 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/display.pyi @@ -0,0 +1,162 @@ +from collections.abc import Callable, Iterable, Sequence +from re import Pattern +from types import FunctionType, MethodType +from typing import Any, overload +from typing_extensions import Literal, TypeAlias, TypedDict + +from Xlib import error +from Xlib._typing import ErrorHandler +from Xlib.protocol import display, request, rq +from Xlib.xobject import colormap, cursor, drawable, fontable, resource + +_ResourceBaseClass: TypeAlias = ( + resource.Resource + | drawable.Drawable + | drawable.Window + | drawable.Pixmap + | fontable.Fontable + | fontable.Font + | fontable.GC + | colormap.Colormap + | cursor.Cursor +) + +# Is the type of the `_resource_baseclasses` variable, defined in this file at runtime +class _ResourceBaseClassesType(TypedDict): # noqa: Y049 + resource: type[resource.Resource] + drawable: type[drawable.Drawable] + window: type[drawable.Window] + pixmap: type[drawable.Pixmap] + fontable: type[fontable.Fontable] + font: type[fontable.Font] + gc: type[fontable.GC] + colormap: type[colormap.Colormap] + cursor: type[cursor.Cursor] + +class _BaseDisplay(display.Display): + def __init__(self, display: str | None = ...) -> None: ... + def get_atom(self, atomname: str, only_if_exists: bool = ...) -> int: ... + +class Display: + display: _BaseDisplay + keysym_translations: dict[int, str] + extensions: list[str] + class_extension_dicts: dict[str, dict[str, FunctionType]] + display_extension_methods: dict[str, Callable[..., Any]] + extension_event: rq.DictWrapper + def __init__(self, display: str | None = ...) -> None: ... + def get_display_name(self) -> str: ... + def fileno(self) -> int: ... + def close(self) -> None: ... + def set_error_handler(self, handler: ErrorHandler[object] | None) -> None: ... + def flush(self) -> None: ... + def sync(self) -> None: ... + def next_event(self) -> rq.Event: ... + def pending_events(self) -> int: ... + def has_extension(self, extension: str) -> bool: ... + @overload + def create_resource_object(self, type: Literal["resource"], id: int) -> resource.Resource: ... + @overload + def create_resource_object(self, type: Literal["drawable"], id: int) -> drawable.Drawable: ... + @overload + def create_resource_object(self, type: Literal["window"], id: int) -> drawable.Window: ... + @overload + def create_resource_object(self, type: Literal["pixmap"], id: int) -> drawable.Pixmap: ... + @overload + def create_resource_object(self, type: Literal["fontable"], id: int) -> fontable.Fontable: ... + @overload + def create_resource_object(self, type: Literal["font"], id: int) -> fontable.Font: ... + @overload + def create_resource_object(self, type: Literal["gc"], id: int) -> fontable.GC: ... + @overload + def create_resource_object(self, type: Literal["colormap"], id: int) -> colormap.Colormap: ... + @overload + def create_resource_object(self, type: Literal["cursor"], id: int) -> cursor.Cursor: ... + @overload + def create_resource_object(self, type: str, id: int) -> resource.Resource: ... + def __getattr__(self, attr: str) -> MethodType: ... + def screen(self, sno: int | None = ...) -> rq.Struct: ... + def screen_count(self) -> int: ... + def get_default_screen(self) -> int: ... + def extension_add_method(self, object: str, name: str, function: Callable[..., Any]) -> None: ... + def extension_add_event(self, code: int, evt: type, name: str | None = ...) -> None: ... + def extension_add_subevent(self, code: int, subcode: int | None, evt: type[rq.Event], name: str | None = ...) -> None: ... + def extension_add_error(self, code: int, err: type[error.XError]) -> None: ... + def keycode_to_keysym(self, keycode: int, index: int) -> int: ... + def keysym_to_keycode(self, keysym: int) -> int: ... + def keysym_to_keycodes(self, keysym: int) -> Iterable[tuple[int, int]]: ... + def refresh_keyboard_mapping(self, evt: rq.Event) -> None: ... + def lookup_string(self, keysym: int) -> str | None: ... + def rebind_string(self, keysym: int, newstring: str | None) -> None: ... + def intern_atom(self, name: str, only_if_exists: bool = ...) -> int: ... + def get_atom(self, atom: str, only_if_exists: bool = ...) -> int: ... + def get_atom_name(self, atom: int) -> str: ... + def get_selection_owner(self, selection: int) -> int: ... + def send_event( + self, + destination: int, + event: rq.Event, + event_mask: int = ..., + propagate: bool = ..., + onerror: ErrorHandler[object] | None = ..., + ) -> None: ... + def ungrab_pointer(self, time: int, onerror: ErrorHandler[object] | None = ...) -> None: ... + def change_active_pointer_grab( + self, event_mask: int, cursor: cursor.Cursor, time: int, onerror: ErrorHandler[object] | None = ... + ) -> None: ... + def ungrab_keyboard(self, time: int, onerror: ErrorHandler[object] | None = ...) -> None: ... + def allow_events(self, mode: int, time: int, onerror: ErrorHandler[object] | None = ...) -> None: ... + def grab_server(self, onerror: ErrorHandler[object] | None = ...) -> None: ... + def ungrab_server(self, onerror: ErrorHandler[object] | None = ...) -> None: ... + def warp_pointer( + self, + x: int, + y: int, + src_window: int = ..., + src_x: int = ..., + src_y: int = ..., + src_width: int = ..., + src_height: int = ..., + onerror: ErrorHandler[object] | None = ..., + ) -> None: ... + def set_input_focus(self, focus: int, revert_to: int, time: int, onerror: ErrorHandler[object] | None = ...) -> None: ... + def get_input_focus(self) -> request.GetInputFocus: ... + def query_keymap(self) -> bytes: ... # TODO: Validate if this is correct + def open_font(self, name: str) -> _ResourceBaseClass | None: ... + def list_fonts(self, pattern: Pattern[str] | str, max_names: int) -> list[str]: ... + def list_fonts_with_info(self, pattern: Pattern[str] | str, max_names: int) -> request.ListFontsWithInfo: ... + def set_font_path(self, path: Sequence[str], onerror: ErrorHandler[object] | None = ...) -> None: ... + def get_font_path(self) -> list[str]: ... + def query_extension(self, name: str) -> request.QueryExtension | None: ... + def list_extensions(self) -> list[str]: ... + def change_keyboard_mapping( + self, first_keycode: int, keysyms: Sequence[Sequence[int]], onerror: ErrorHandler[object] | None = ... + ) -> None: ... + def get_keyboard_mapping(self, first_keycode: int, count: int) -> list[tuple[int, ...]]: ... + def change_keyboard_control(self, onerror: ErrorHandler[object] | None = ..., **keys: object) -> None: ... + def get_keyboard_control(self) -> request.GetKeyboardControl: ... + def bell(self, percent: int = ..., onerror: ErrorHandler[object] | None = ...) -> None: ... + def change_pointer_control( + self, accel: tuple[int, int] | None = ..., threshold: int | None = ..., onerror: ErrorHandler[object] | None = ... + ) -> None: ... + def get_pointer_control(self) -> request.GetPointerControl: ... + def set_screen_saver( + self, timeout: int, interval: int, prefer_blank: int, allow_exposures: int, onerror: ErrorHandler[object] | None = ... + ) -> None: ... + def get_screen_saver(self) -> request.GetScreenSaver: ... + def change_hosts( + self, + mode: int, + host_family: int, + host: Sequence[int] | Sequence[bytes], # TODO: validate + onerror: ErrorHandler[object] | None = ..., + ) -> None: ... + def list_hosts(self) -> request.ListHosts: ... + def set_access_control(self, mode: int, onerror: ErrorHandler[object] | None = ...) -> None: ... + def set_close_down_mode(self, mode: int, onerror: ErrorHandler[object] | None = ...) -> None: ... + def force_screen_saver(self, mode: int, onerror: ErrorHandler[object] | None = ...) -> None: ... + def set_pointer_mapping(self, map: Sequence[int]) -> int: ... + def get_pointer_mapping(self) -> list[int]: ... + def set_modifier_mapping(self, keycodes: rq._ModifierMappingList8Elements) -> int: ... + def get_modifier_mapping(self) -> Sequence[Sequence[int]]: ... + def no_operation(self, onerror: ErrorHandler[object] | None = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/error.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/error.pyi new file mode 100644 index 000000000..aa846f837 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/error.pyi @@ -0,0 +1,57 @@ +from _typeshed import SliceableBuffer +from typing_extensions import Literal + +from Xlib.protocol import display, rq + +class DisplayError(Exception): + display: object + def __init__(self, display: object) -> None: ... + +class DisplayNameError(DisplayError): ... + +class DisplayConnectionError(DisplayError): + display: object + msg: object + def __init__(self, display: object, msg: object) -> None: ... + +class ConnectionClosedError(Exception): + whom: object + def __init__(self, whom: object) -> None: ... + +class XauthError(Exception): ... +class XNoAuthError(Exception): ... +class ResourceIDError(Exception): ... + +class XError(rq.GetAttrData, Exception): + def __init__(self, display: display.Display, data: SliceableBuffer) -> None: ... + +class XResourceError(XError): ... +class BadRequest(XError): ... +class BadValue(XError): ... +class BadWindow(XResourceError): ... +class BadPixmap(XResourceError): ... +class BadAtom(XError): ... +class BadCursor(XResourceError): ... +class BadFont(XResourceError): ... +class BadMatch(XError): ... +class BadDrawable(XResourceError): ... +class BadAccess(XError): ... +class BadAlloc(XError): ... +class BadColor(XResourceError): ... +class BadGC(XResourceError): ... +class BadIDChoice(XResourceError): ... +class BadName(XError): ... +class BadLength(XError): ... +class BadImplementation(XError): ... + +xerror_class: dict[int, type[XError]] + +class CatchError: + error_types: tuple[type[XError], ...] + error: XError | None + request: rq.Request | None + def __init__(self, *errors: type[XError]) -> None: ... + def __call__(self, error: XError, request: rq.Request | None) -> Literal[0, 1]: ... + def get_error(self) -> XError | None: ... + def get_request(self) -> rq.Request | None: ... + def reset(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/ext/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/ext/__init__.pyi new file mode 100644 index 000000000..17afcdcac --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/ext/__init__.pyi @@ -0,0 +1,35 @@ +from Xlib.ext import ( + composite as composite, + damage as damage, + dpms as dpms, + ge as ge, + nvcontrol as nvcontrol, + randr as randr, + record as record, + res as res, + screensaver as screensaver, + security as security, + shape as shape, + xfixes as xfixes, + xinerama as xinerama, + xinput as xinput, + xtest as xtest, +) + +__all__ = [ + "ge", + "xtest", + "shape", + "xinerama", + "record", + "composite", + "randr", + "xfixes", + "security", + "xinput", + "nvcontrol", + "damage", + "dpms", + "res", + "screensaver", +] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/ext/composite.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/ext/composite.pyi new file mode 100644 index 000000000..f974c1365 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/ext/composite.pyi @@ -0,0 +1,47 @@ +from collections.abc import Callable +from typing import Any +from typing_extensions import TypeAlias + +from Xlib._typing import ErrorHandler, Unused +from Xlib.display import Display +from Xlib.protocol import rq +from Xlib.xobject import drawable, resource + +_Update: TypeAlias = Callable[[rq.DictWrapper | dict[str, Any]], object] + +extname: str +RedirectAutomatic: int +RedirectManual: int + +class QueryVersion(rq.ReplyRequest): ... + +def query_version(self: Display | resource.Resource) -> QueryVersion: ... + +class RedirectWindow(rq.Request): ... + +def redirect_window(self: drawable.Window, update: _Update, onerror: ErrorHandler[object] | None = ...) -> None: ... + +class RedirectSubwindows(rq.Request): ... + +def redirect_subwindows(self: drawable.Window, update: _Update, onerror: ErrorHandler[object] | None = ...) -> None: ... + +class UnredirectWindow(rq.Request): ... + +def unredirect_window(self: drawable.Window, update: _Update, onerror: ErrorHandler[object] | None = ...) -> None: ... + +class UnredirectSubindows(rq.Request): ... + +def unredirect_subwindows(self: drawable.Window, update: _Update, onerror: ErrorHandler[object] | None = ...) -> None: ... + +class CreateRegionFromBorderClip(rq.Request): ... + +def create_region_from_border_clip(self: drawable.Window, onerror: ErrorHandler[object] | None = ...) -> int: ... + +class NameWindowPixmap(rq.Request): ... + +def name_window_pixmap(self: Display | resource.Resource, onerror: ErrorHandler[object] | None = ...) -> drawable.Pixmap: ... + +class GetOverlayWindow(rq.ReplyRequest): ... + +def get_overlay_window(self: Display) -> GetOverlayWindow: ... +def init(disp: Display, info: Unused) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/ext/damage.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/ext/damage.pyi new file mode 100644 index 000000000..35d8b7199 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/ext/damage.pyi @@ -0,0 +1,41 @@ +from Xlib.display import Display +from Xlib.error import XError +from Xlib.protocol import request, rq +from Xlib.xobject import resource + +extname: str +DamageNotifyCode: int +BadDamageCode: int + +class BadDamageError(XError): ... + +DamageReportRawRectangles: int +DamageReportDeltaRectangles: int +DamageReportBoundingBox: int +DamageReportNonEmpty: int +DamageReportLevel: tuple[int, int, int, int] +DAMAGE = rq.Card32 + +class QueryVersion(rq.ReplyRequest): ... + +def query_version(self: Display | resource.Resource) -> QueryVersion: ... + +class DamageCreate(rq.Request): ... + +def damage_create(self: Display | resource.Resource, level: int) -> int: ... + +class DamageDestroy(rq.Request): ... + +def damage_destroy(self: Display | resource.Resource, damage: int) -> None: ... + +class DamageSubtract(rq.Request): ... + +def damage_subtract(self: Display | resource.Resource, damage: int, repair: int = ..., parts: int = ...) -> None: ... + +class DamageAdd(rq.Request): ... + +def damage_add(self: Display | resource.Resource, repair: int, parts: int) -> None: ... + +class DamageNotify(rq.Event): ... + +def init(disp: Display, info: request.QueryExtension) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/ext/dpms.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/ext/dpms.pyi new file mode 100644 index 000000000..35c6b9208 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/ext/dpms.pyi @@ -0,0 +1,46 @@ +from Xlib._typing import Unused +from Xlib.display import Display +from Xlib.protocol import rq +from Xlib.xobject import resource + +extname: str +DPMSModeOn: int +DPMSModeStandby: int +DPMSModeSuspend: int +DPMSModeOff: int +DPMSPowerLevel: tuple[int, int, int, int] + +class DPMSGetVersion(rq.ReplyRequest): ... + +def get_version(self: Display | resource.Resource) -> DPMSGetVersion: ... + +class DPMSCapable(rq.ReplyRequest): ... + +def capable(self: Display | resource.Resource) -> DPMSCapable: ... + +class DPMSGetTimeouts(rq.ReplyRequest): ... + +def get_timeouts(self: Display | resource.Resource) -> DPMSGetTimeouts: ... + +class DPMSSetTimeouts(rq.Request): ... + +def set_timeouts( + self: Display | resource.Resource, standby_timeout: int, suspend_timeout: int, off_timeout: int +) -> DPMSSetTimeouts: ... + +class DPMSEnable(rq.Request): ... + +def enable(self: Display | resource.Resource) -> DPMSEnable: ... + +class DPMSDisable(rq.Request): ... + +def disable(self: Display | resource.Resource) -> DPMSDisable: ... + +class DPMSForceLevel(rq.Request): ... + +def force_level(self: Display | resource.Resource, power_level: int) -> DPMSForceLevel: ... + +class DPMSInfo(rq.ReplyRequest): ... + +def info(self: Display | resource.Resource) -> DPMSInfo: ... +def init(disp: Display, _info: Unused) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/ext/ge.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/ext/ge.pyi new file mode 100644 index 000000000..790c0a854 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/ext/ge.pyi @@ -0,0 +1,16 @@ +from Xlib._typing import Unused +from Xlib.display import Display +from Xlib.protocol import rq +from Xlib.xobject import resource + +extname: str +GenericEventCode: int + +class GEQueryVersion(rq.ReplyRequest): ... + +def query_version(self: Display | resource.Resource) -> GEQueryVersion: ... + +class GenericEvent(rq.Event): ... + +def add_event_data(self: Display | resource.Resource, extension: int, evtype: int, estruct: int) -> None: ... +def init(disp: Display, info: Unused) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/ext/nvcontrol.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/ext/nvcontrol.pyi new file mode 100644 index 000000000..edae4e22a --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/ext/nvcontrol.pyi @@ -0,0 +1,1063 @@ +from Xlib._typing import Unused +from Xlib.display import Display +from Xlib.protocol import rq +from Xlib.xobject import resource + +extname: str + +def query_target_count(self: Display | resource.Resource, target: Target) -> int: ... +def query_int_attribute(self: Display | resource.Resource, target: Target, display_mask: int, attr: int) -> int | None: ... +def set_int_attribute(self: Display | resource.Resource, target: Target, display_mask: int, attr: int, value: int) -> bool: ... +def query_string_attribute(self: Display | resource.Resource, target: Target, display_mask: int, attr: int) -> str | None: ... +def query_valid_attr_values( + self: Display | resource.Resource, target: Target, display_mask: int, attr: int +) -> tuple[int, int] | None: ... +def query_binary_data(self: Display | resource.Resource, target: Target, display_mask: int, attr: int) -> bytes | None: ... +def get_coolers_used_by_gpu(self: Display | resource.Resource, target: Target) -> list[int] | None: ... +def get_gpu_count(self: Display | resource.Resource) -> int: ... +def get_name(self: Display | resource.Resource, target: Target) -> str | None: ... +def get_driver_version(self: Display | resource.Resource, target: Target) -> str | None: ... +def get_vbios_version(self: Display | resource.Resource, target: Target) -> str | None: ... +def get_gpu_uuid(self: Display | resource.Resource, target: Target) -> str | None: ... +def get_utilization_rates(self: Display | resource.Resource, target: Target) -> dict[str, str | int]: ... +def get_performance_modes(self: Display | resource.Resource, target: Target) -> list[dict[str, str | int]]: ... +def get_clock_info(self: Display | resource.Resource, target: Target) -> dict[str, str | int]: ... +def get_vram(self: Display | resource.Resource, target: Target) -> int | None: ... +def get_irq(self: Display | resource.Resource, target: Target) -> int | None: ... +def supports_framelock(self: Display | resource.Resource, target: Target) -> int | None: ... +def gvo_supported(self: Display | resource.Resource, screen: Target) -> int | None: ... +def get_core_temp(self: Display | resource.Resource, target: Target) -> int | None: ... +def get_core_threshold(self: Display | resource.Resource, target: Target) -> int | None: ... +def get_default_core_threshold(self: Display | resource.Resource, target: Target) -> int | None: ... +def get_max_core_threshold(self: Display | resource.Resource, target: Target) -> int | None: ... +def get_ambient_temp(self: Display | resource.Resource, target: Target) -> int | None: ... +def get_cuda_cores(self: Display | resource.Resource, target: Target) -> int | None: ... +def get_memory_bus_width(self: Display | resource.Resource, target: Target) -> int | None: ... +def get_total_dedicated_gpu_memory(self: Display | resource.Resource, target: Target) -> int | None: ... +def get_used_dedicated_gpu_memory(self: Display | resource.Resource, target: Target) -> int | None: ... +def get_curr_pcie_link_width(self: Display | resource.Resource, target: Target) -> int | None: ... +def get_max_pcie_link_width(self: Display | resource.Resource, target: Target) -> int | None: ... +def get_curr_pcie_link_generation(self: Display | resource.Resource, target: Target) -> int | None: ... +def get_encoder_utilization(self: Display | resource.Resource, target: Target) -> int | None: ... +def get_decoder_utilization(self: Display | resource.Resource, target: Target) -> int | None: ... +def get_current_performance_level(self: Display | resource.Resource, target: Target) -> int | None: ... +def get_gpu_nvclock_offset(self: Display | resource.Resource, target: Target, perf_level: int) -> int | None: ... +def set_gpu_nvclock_offset(self: Display | resource.Resource, target: Target, perf_level: int, offset: int) -> bool: ... +def set_gpu_nvclock_offset_all_levels(self: Display | resource.Resource, target: Target, offset: int) -> bool: ... +def get_gpu_nvclock_offset_range( + self: Display | resource.Resource, target: Target, perf_level: int +) -> tuple[int, int] | None: ... +def get_mem_transfer_rate_offset(self: Display | resource.Resource, target: Target, perf_level: int) -> int | None: ... +def set_mem_transfer_rate_offset(self: Display | resource.Resource, target: Target, perf_level: int, offset: int) -> bool: ... +def set_mem_transfer_rate_offset_all_levels(self: Display | resource.Resource, target: Target, offset: int) -> bool: ... +def get_mem_transfer_rate_offset_range( + self: Display | resource.Resource, target: Target, perf_level: int +) -> tuple[int, int] | None: ... +def get_cooler_manual_control_enabled(self: Display | resource.Resource, target: Target) -> int | None: ... +def set_cooler_manual_control_enabled(self: Display | resource.Resource, target: Target, enabled: bool) -> bool: ... +def get_fan_duty(self: Display | resource.Resource, target: Target) -> int | None: ... +def set_fan_duty(self: Display | resource.Resource, cooler: Target, speed: int) -> bool: ... +def get_fan_rpm(self: Display | resource.Resource, target: Target) -> int | None: ... +def get_max_displays(self: Display | resource.Resource, target: Target) -> int | None: ... +def init(disp: Display, info: Unused) -> None: ... + +NV_CTRL_FLATPANEL_SCALING: int +NV_CTRL_FLATPANEL_SCALING_DEFAULT: int +NV_CTRL_FLATPANEL_SCALING_NATIVE: int +NV_CTRL_FLATPANEL_SCALING_SCALED: int +NV_CTRL_FLATPANEL_SCALING_CENTERED: int +NV_CTRL_FLATPANEL_SCALING_ASPECT_SCALED: int +NV_CTRL_FLATPANEL_DITHERING: int +NV_CTRL_FLATPANEL_DITHERING_DEFAULT: int +NV_CTRL_FLATPANEL_DITHERING_ENABLED: int +NV_CTRL_FLATPANEL_DITHERING_DISABLED: int +NV_CTRL_DITHERING: int +NV_CTRL_DITHERING_AUTO: int +NV_CTRL_DITHERING_ENABLED: int +NV_CTRL_DITHERING_DISABLED: int +NV_CTRL_DIGITAL_VIBRANCE: int +NV_CTRL_BUS_TYPE: int +NV_CTRL_BUS_TYPE_AGP: int +NV_CTRL_BUS_TYPE_PCI: int +NV_CTRL_BUS_TYPE_PCI_EXPRESS: int +NV_CTRL_BUS_TYPE_INTEGRATED: int +NV_CTRL_TOTAL_GPU_MEMORY: int +NV_CTRL_VIDEO_RAM: int +NV_CTRL_IRQ: int +NV_CTRL_OPERATING_SYSTEM: int +NV_CTRL_OPERATING_SYSTEM_LINUX: int +NV_CTRL_OPERATING_SYSTEM_FREEBSD: int +NV_CTRL_OPERATING_SYSTEM_SUNOS: int +NV_CTRL_SYNC_TO_VBLANK: int +NV_CTRL_SYNC_TO_VBLANK_OFF: int +NV_CTRL_SYNC_TO_VBLANK_ON: int +NV_CTRL_LOG_ANISO: int +NV_CTRL_FSAA_MODE: int +NV_CTRL_FSAA_MODE_NONE: int +NV_CTRL_FSAA_MODE_2x: int +NV_CTRL_FSAA_MODE_2x_5t: int +NV_CTRL_FSAA_MODE_15x15: int +NV_CTRL_FSAA_MODE_2x2: int +NV_CTRL_FSAA_MODE_4x: int +NV_CTRL_FSAA_MODE_4x_9t: int +NV_CTRL_FSAA_MODE_8x: int +NV_CTRL_FSAA_MODE_16x: int +NV_CTRL_FSAA_MODE_8xS: int +NV_CTRL_FSAA_MODE_8xQ: int +NV_CTRL_FSAA_MODE_16xS: int +NV_CTRL_FSAA_MODE_16xQ: int +NV_CTRL_FSAA_MODE_32xS: int +NV_CTRL_FSAA_MODE_32x: int +NV_CTRL_FSAA_MODE_64xS: int +NV_CTRL_FSAA_MODE_MAX: int +NV_CTRL_UBB: int +NV_CTRL_UBB_OFF: int +NV_CTRL_UBB_ON: int +NV_CTRL_OVERLAY: int +NV_CTRL_OVERLAY_OFF: int +NV_CTRL_OVERLAY_ON: int +NV_CTRL_STEREO: int +NV_CTRL_STEREO_OFF: int +NV_CTRL_STEREO_DDC: int +NV_CTRL_STEREO_BLUELINE: int +NV_CTRL_STEREO_DIN: int +NV_CTRL_STEREO_PASSIVE_EYE_PER_DPY: int +NV_CTRL_STEREO_VERTICAL_INTERLACED: int +NV_CTRL_STEREO_COLOR_INTERLACED: int +NV_CTRL_STEREO_HORIZONTAL_INTERLACED: int +NV_CTRL_STEREO_CHECKERBOARD_PATTERN: int +NV_CTRL_STEREO_INVERSE_CHECKERBOARD_PATTERN: int +NV_CTRL_STEREO_3D_VISION: int +NV_CTRL_STEREO_3D_VISION_PRO: int +NV_CTRL_STEREO_HDMI_3D: int +NV_CTRL_STEREO_TRIDELITY_SL: int +NV_CTRL_STEREO_INBAND_STEREO_SIGNALING: int +NV_CTRL_STEREO_MAX: int +NV_CTRL_EMULATE: int +NV_CTRL_EMULATE_NONE: int +NV_CTRL_TWINVIEW: int +NV_CTRL_TWINVIEW_NOT_ENABLED: int +NV_CTRL_TWINVIEW_ENABLED: int +NV_CTRL_CONNECTED_DISPLAYS: int +NV_CTRL_ENABLED_DISPLAYS: int +NV_CTRL_FRAMELOCK: int +NV_CTRL_FRAMELOCK_NOT_SUPPORTED: int +NV_CTRL_FRAMELOCK_SUPPORTED: int +NV_CTRL_FRAMELOCK_MASTER: int +NV_CTRL_FRAMELOCK_MASTER_FALSE: int +NV_CTRL_FRAMELOCK_MASTER_TRUE: int +NV_CTRL_FRAMELOCK_POLARITY: int +NV_CTRL_FRAMELOCK_POLARITY_RISING_EDGE: int +NV_CTRL_FRAMELOCK_POLARITY_FALLING_EDGE: int +NV_CTRL_FRAMELOCK_POLARITY_BOTH_EDGES: int +NV_CTRL_FRAMELOCK_SYNC_DELAY: int +NV_CTRL_FRAMELOCK_SYNC_DELAY_MAX: int +NV_CTRL_FRAMELOCK_SYNC_DELAY_FACTOR: float +NV_CTRL_FRAMELOCK_SYNC_INTERVAL: int +NV_CTRL_FRAMELOCK_PORT0_STATUS: int +NV_CTRL_FRAMELOCK_PORT0_STATUS_INPUT: int +NV_CTRL_FRAMELOCK_PORT0_STATUS_OUTPUT: int +NV_CTRL_FRAMELOCK_PORT1_STATUS: int +NV_CTRL_FRAMELOCK_PORT1_STATUS_INPUT: int +NV_CTRL_FRAMELOCK_PORT1_STATUS_OUTPUT: int +NV_CTRL_FRAMELOCK_HOUSE_STATUS: int +NV_CTRL_FRAMELOCK_HOUSE_STATUS_NOT_DETECTED: int +NV_CTRL_FRAMELOCK_HOUSE_STATUS_DETECTED: int +NV_CTRL_FRAMELOCK_SYNC: int +NV_CTRL_FRAMELOCK_SYNC_DISABLE: int +NV_CTRL_FRAMELOCK_SYNC_ENABLE: int +NV_CTRL_FRAMELOCK_SYNC_READY: int +NV_CTRL_FRAMELOCK_SYNC_READY_FALSE: int +NV_CTRL_FRAMELOCK_SYNC_READY_TRUE: int +NV_CTRL_FRAMELOCK_STEREO_SYNC: int +NV_CTRL_FRAMELOCK_STEREO_SYNC_FALSE: int +NV_CTRL_FRAMELOCK_STEREO_SYNC_TRUE: int +NV_CTRL_FRAMELOCK_TEST_SIGNAL: int +NV_CTRL_FRAMELOCK_TEST_SIGNAL_DISABLE: int +NV_CTRL_FRAMELOCK_TEST_SIGNAL_ENABLE: int +NV_CTRL_FRAMELOCK_ETHERNET_DETECTED: int +NV_CTRL_FRAMELOCK_ETHERNET_DETECTED_NONE: int +NV_CTRL_FRAMELOCK_ETHERNET_DETECTED_PORT0: int +NV_CTRL_FRAMELOCK_ETHERNET_DETECTED_PORT1: int +NV_CTRL_FRAMELOCK_VIDEO_MODE: int +NV_CTRL_FRAMELOCK_VIDEO_MODE_NONE: int +NV_CTRL_FRAMELOCK_VIDEO_MODE_TTL: int +NV_CTRL_FRAMELOCK_VIDEO_MODE_NTSCPALSECAM: int +NV_CTRL_FRAMELOCK_VIDEO_MODE_HDTV: int +NV_CTRL_FRAMELOCK_VIDEO_MODE_COMPOSITE_AUTO: int +NV_CTRL_FRAMELOCK_VIDEO_MODE_COMPOSITE_BI_LEVEL: int +NV_CTRL_FRAMELOCK_VIDEO_MODE_COMPOSITE_TRI_LEVEL: int +NV_CTRL_FRAMELOCK_SYNC_RATE: int +NV_CTRL_FORCE_GENERIC_CPU: int +NV_CTRL_FORCE_GENERIC_CPU_DISABLE: int +NV_CTRL_FORCE_GENERIC_CPU_ENABLE: int +NV_CTRL_OPENGL_AA_LINE_GAMMA: int +NV_CTRL_OPENGL_AA_LINE_GAMMA_DISABLE: int +NV_CTRL_OPENGL_AA_LINE_GAMMA_ENABLE: int +NV_CTRL_FRAMELOCK_TIMING: int +NV_CTRL_FRAMELOCK_TIMING_FALSE: int +NV_CTRL_FRAMELOCK_TIMING_TRUE: int +NV_CTRL_FLIPPING_ALLOWED: int +NV_CTRL_FLIPPING_ALLOWED_FALSE: int +NV_CTRL_FLIPPING_ALLOWED_TRUE: int +NV_CTRL_ARCHITECTURE: int +NV_CTRL_ARCHITECTURE_X86: int +NV_CTRL_ARCHITECTURE_X86_64: int +NV_CTRL_ARCHITECTURE_IA64: int +NV_CTRL_ARCHITECTURE_ARM: int +NV_CTRL_ARCHITECTURE_AARCH64: int +NV_CTRL_ARCHITECTURE_PPC64LE: int +NV_CTRL_TEXTURE_CLAMPING: int +NV_CTRL_TEXTURE_CLAMPING_EDGE: int +NV_CTRL_TEXTURE_CLAMPING_SPEC: int +NV_CTRL_CURSOR_SHADOW: int +NV_CTRL_CURSOR_SHADOW_DISABLE: int +NV_CTRL_CURSOR_SHADOW_ENABLE: int +NV_CTRL_CURSOR_SHADOW_ALPHA: int +NV_CTRL_CURSOR_SHADOW_RED: int +NV_CTRL_CURSOR_SHADOW_GREEN: int +NV_CTRL_CURSOR_SHADOW_BLUE: int +NV_CTRL_CURSOR_SHADOW_X_OFFSET: int +NV_CTRL_CURSOR_SHADOW_Y_OFFSET: int +NV_CTRL_FSAA_APPLICATION_CONTROLLED: int +NV_CTRL_FSAA_APPLICATION_CONTROLLED_ENABLED: int +NV_CTRL_FSAA_APPLICATION_CONTROLLED_DISABLED: int +NV_CTRL_LOG_ANISO_APPLICATION_CONTROLLED: int +NV_CTRL_LOG_ANISO_APPLICATION_CONTROLLED_ENABLED: int +NV_CTRL_LOG_ANISO_APPLICATION_CONTROLLED_DISABLED: int +NV_CTRL_IMAGE_SHARPENING: int +NV_CTRL_TV_OVERSCAN: int +NV_CTRL_TV_FLICKER_FILTER: int +NV_CTRL_TV_BRIGHTNESS: int +NV_CTRL_TV_HUE: int +NV_CTRL_TV_CONTRAST: int +NV_CTRL_TV_SATURATION: int +NV_CTRL_TV_RESET_SETTINGS: int +NV_CTRL_GPU_CORE_TEMPERATURE: int +NV_CTRL_GPU_CORE_THRESHOLD: int +NV_CTRL_GPU_DEFAULT_CORE_THRESHOLD: int +NV_CTRL_GPU_MAX_CORE_THRESHOLD: int +NV_CTRL_AMBIENT_TEMPERATURE: int +NV_CTRL_PBUFFER_SCANOUT_SUPPORTED: int +NV_CTRL_PBUFFER_SCANOUT_FALSE: int +NV_CTRL_PBUFFER_SCANOUT_TRUE: int +NV_CTRL_PBUFFER_SCANOUT_XID: int +NV_CTRL_GVO_SUPPORTED: int +NV_CTRL_GVO_SUPPORTED_FALSE: int +NV_CTRL_GVO_SUPPORTED_TRUE: int +NV_CTRL_GVO_SYNC_MODE: int +NV_CTRL_GVO_SYNC_MODE_FREE_RUNNING: int +NV_CTRL_GVO_SYNC_MODE_GENLOCK: int +NV_CTRL_GVO_SYNC_MODE_FRAMELOCK: int +NV_CTRL_GVO_SYNC_SOURCE: int +NV_CTRL_GVO_SYNC_SOURCE_COMPOSITE: int +NV_CTRL_GVO_SYNC_SOURCE_SDI: int +NV_CTRL_GVIO_REQUESTED_VIDEO_FORMAT: int +NV_CTRL_GVIO_VIDEO_FORMAT_NONE: int +NV_CTRL_GVIO_VIDEO_FORMAT_487I_59_94_SMPTE259_NTSC: int +NV_CTRL_GVIO_VIDEO_FORMAT_576I_50_00_SMPTE259_PAL: int +NV_CTRL_GVIO_VIDEO_FORMAT_720P_59_94_SMPTE296: int +NV_CTRL_GVIO_VIDEO_FORMAT_720P_60_00_SMPTE296: int +NV_CTRL_GVIO_VIDEO_FORMAT_1035I_59_94_SMPTE260: int +NV_CTRL_GVIO_VIDEO_FORMAT_1035I_60_00_SMPTE260: int +NV_CTRL_GVIO_VIDEO_FORMAT_1080I_50_00_SMPTE295: int +NV_CTRL_GVIO_VIDEO_FORMAT_1080I_50_00_SMPTE274: int +NV_CTRL_GVIO_VIDEO_FORMAT_1080I_59_94_SMPTE274: int +NV_CTRL_GVIO_VIDEO_FORMAT_1080I_60_00_SMPTE274: int +NV_CTRL_GVIO_VIDEO_FORMAT_1080P_23_976_SMPTE274: int +NV_CTRL_GVIO_VIDEO_FORMAT_1080P_24_00_SMPTE274: int +NV_CTRL_GVIO_VIDEO_FORMAT_1080P_25_00_SMPTE274: int +NV_CTRL_GVIO_VIDEO_FORMAT_1080P_29_97_SMPTE274: int +NV_CTRL_GVIO_VIDEO_FORMAT_1080P_30_00_SMPTE274: int +NV_CTRL_GVIO_VIDEO_FORMAT_720P_50_00_SMPTE296: int +NV_CTRL_GVIO_VIDEO_FORMAT_1080I_48_00_SMPTE274: int +NV_CTRL_GVIO_VIDEO_FORMAT_1080I_47_96_SMPTE274: int +NV_CTRL_GVIO_VIDEO_FORMAT_720P_30_00_SMPTE296: int +NV_CTRL_GVIO_VIDEO_FORMAT_720P_29_97_SMPTE296: int +NV_CTRL_GVIO_VIDEO_FORMAT_720P_25_00_SMPTE296: int +NV_CTRL_GVIO_VIDEO_FORMAT_720P_24_00_SMPTE296: int +NV_CTRL_GVIO_VIDEO_FORMAT_720P_23_98_SMPTE296: int +NV_CTRL_GVIO_VIDEO_FORMAT_1080PSF_25_00_SMPTE274: int +NV_CTRL_GVIO_VIDEO_FORMAT_1080PSF_29_97_SMPTE274: int +NV_CTRL_GVIO_VIDEO_FORMAT_1080PSF_30_00_SMPTE274: int +NV_CTRL_GVIO_VIDEO_FORMAT_1080PSF_24_00_SMPTE274: int +NV_CTRL_GVIO_VIDEO_FORMAT_1080PSF_23_98_SMPTE274: int +NV_CTRL_GVIO_VIDEO_FORMAT_2048P_30_00_SMPTE372: int +NV_CTRL_GVIO_VIDEO_FORMAT_2048P_29_97_SMPTE372: int +NV_CTRL_GVIO_VIDEO_FORMAT_2048I_60_00_SMPTE372: int +NV_CTRL_GVIO_VIDEO_FORMAT_2048I_59_94_SMPTE372: int +NV_CTRL_GVIO_VIDEO_FORMAT_2048P_25_00_SMPTE372: int +NV_CTRL_GVIO_VIDEO_FORMAT_2048I_50_00_SMPTE372: int +NV_CTRL_GVIO_VIDEO_FORMAT_2048P_24_00_SMPTE372: int +NV_CTRL_GVIO_VIDEO_FORMAT_2048P_23_98_SMPTE372: int +NV_CTRL_GVIO_VIDEO_FORMAT_2048I_48_00_SMPTE372: int +NV_CTRL_GVIO_VIDEO_FORMAT_2048I_47_96_SMPTE372: int +NV_CTRL_GVIO_VIDEO_FORMAT_1080P_50_00_3G_LEVEL_A_SMPTE274: int +NV_CTRL_GVIO_VIDEO_FORMAT_1080P_59_94_3G_LEVEL_A_SMPTE274: int +NV_CTRL_GVIO_VIDEO_FORMAT_1080P_60_00_3G_LEVEL_A_SMPTE274: int +NV_CTRL_GVIO_VIDEO_FORMAT_1080P_60_00_3G_LEVEL_B_SMPTE274: int +NV_CTRL_GVIO_VIDEO_FORMAT_1080I_60_00_3G_LEVEL_B_SMPTE274: int +NV_CTRL_GVIO_VIDEO_FORMAT_2048I_60_00_3G_LEVEL_B_SMPTE372: int +NV_CTRL_GVIO_VIDEO_FORMAT_1080P_50_00_3G_LEVEL_B_SMPTE274: int +NV_CTRL_GVIO_VIDEO_FORMAT_1080I_50_00_3G_LEVEL_B_SMPTE274: int +NV_CTRL_GVIO_VIDEO_FORMAT_2048I_50_00_3G_LEVEL_B_SMPTE372: int +NV_CTRL_GVIO_VIDEO_FORMAT_1080P_30_00_3G_LEVEL_B_SMPTE274: int +NV_CTRL_GVIO_VIDEO_FORMAT_2048P_30_00_3G_LEVEL_B_SMPTE372: int +NV_CTRL_GVIO_VIDEO_FORMAT_1080P_25_00_3G_LEVEL_B_SMPTE274: int +NV_CTRL_GVIO_VIDEO_FORMAT_2048P_25_00_3G_LEVEL_B_SMPTE372: int +NV_CTRL_GVIO_VIDEO_FORMAT_1080P_24_00_3G_LEVEL_B_SMPTE274: int +NV_CTRL_GVIO_VIDEO_FORMAT_2048P_24_00_3G_LEVEL_B_SMPTE372: int +NV_CTRL_GVIO_VIDEO_FORMAT_1080I_48_00_3G_LEVEL_B_SMPTE274: int +NV_CTRL_GVIO_VIDEO_FORMAT_2048I_48_00_3G_LEVEL_B_SMPTE372: int +NV_CTRL_GVIO_VIDEO_FORMAT_1080P_59_94_3G_LEVEL_B_SMPTE274: int +NV_CTRL_GVIO_VIDEO_FORMAT_1080I_59_94_3G_LEVEL_B_SMPTE274: int +NV_CTRL_GVIO_VIDEO_FORMAT_2048I_59_94_3G_LEVEL_B_SMPTE372: int +NV_CTRL_GVIO_VIDEO_FORMAT_1080P_29_97_3G_LEVEL_B_SMPTE274: int +NV_CTRL_GVIO_VIDEO_FORMAT_2048P_29_97_3G_LEVEL_B_SMPTE372: int +NV_CTRL_GVIO_VIDEO_FORMAT_1080P_23_98_3G_LEVEL_B_SMPTE274: int +NV_CTRL_GVIO_VIDEO_FORMAT_2048P_23_98_3G_LEVEL_B_SMPTE372: int +NV_CTRL_GVIO_VIDEO_FORMAT_1080I_47_96_3G_LEVEL_B_SMPTE274: int +NV_CTRL_GVIO_VIDEO_FORMAT_2048I_47_96_3G_LEVEL_B_SMPTE372: int +NV_CTRL_GVO_OUTPUT_VIDEO_FORMAT: int +NV_CTRL_GVO_VIDEO_FORMAT_NONE: int +NV_CTRL_GVO_VIDEO_FORMAT_487I_59_94_SMPTE259_NTSC: int +NV_CTRL_GVO_VIDEO_FORMAT_576I_50_00_SMPTE259_PAL: int +NV_CTRL_GVO_VIDEO_FORMAT_720P_59_94_SMPTE296: int +NV_CTRL_GVO_VIDEO_FORMAT_720P_60_00_SMPTE296: int +NV_CTRL_GVO_VIDEO_FORMAT_1035I_59_94_SMPTE260: int +NV_CTRL_GVO_VIDEO_FORMAT_1035I_60_00_SMPTE260: int +NV_CTRL_GVO_VIDEO_FORMAT_1080I_50_00_SMPTE295: int +NV_CTRL_GVO_VIDEO_FORMAT_1080I_50_00_SMPTE274: int +NV_CTRL_GVO_VIDEO_FORMAT_1080I_59_94_SMPTE274: int +NV_CTRL_GVO_VIDEO_FORMAT_1080I_60_00_SMPTE274: int +NV_CTRL_GVO_VIDEO_FORMAT_1080P_23_976_SMPTE274: int +NV_CTRL_GVO_VIDEO_FORMAT_1080P_24_00_SMPTE274: int +NV_CTRL_GVO_VIDEO_FORMAT_1080P_25_00_SMPTE274: int +NV_CTRL_GVO_VIDEO_FORMAT_1080P_29_97_SMPTE274: int +NV_CTRL_GVO_VIDEO_FORMAT_1080P_30_00_SMPTE274: int +NV_CTRL_GVO_VIDEO_FORMAT_720P_50_00_SMPTE296: int +NV_CTRL_GVO_VIDEO_FORMAT_1080I_48_00_SMPTE274: int +NV_CTRL_GVO_VIDEO_FORMAT_1080I_47_96_SMPTE274: int +NV_CTRL_GVO_VIDEO_FORMAT_720P_30_00_SMPTE296: int +NV_CTRL_GVO_VIDEO_FORMAT_720P_29_97_SMPTE296: int +NV_CTRL_GVO_VIDEO_FORMAT_720P_25_00_SMPTE296: int +NV_CTRL_GVO_VIDEO_FORMAT_720P_24_00_SMPTE296: int +NV_CTRL_GVO_VIDEO_FORMAT_720P_23_98_SMPTE296: int +NV_CTRL_GVO_VIDEO_FORMAT_1080PSF_25_00_SMPTE274: int +NV_CTRL_GVO_VIDEO_FORMAT_1080PSF_29_97_SMPTE274: int +NV_CTRL_GVO_VIDEO_FORMAT_1080PSF_30_00_SMPTE274: int +NV_CTRL_GVO_VIDEO_FORMAT_1080PSF_24_00_SMPTE274: int +NV_CTRL_GVO_VIDEO_FORMAT_1080PSF_23_98_SMPTE274: int +NV_CTRL_GVO_VIDEO_FORMAT_2048P_30_00_SMPTE372: int +NV_CTRL_GVO_VIDEO_FORMAT_2048P_29_97_SMPTE372: int +NV_CTRL_GVO_VIDEO_FORMAT_2048I_60_00_SMPTE372: int +NV_CTRL_GVO_VIDEO_FORMAT_2048I_59_94_SMPTE372: int +NV_CTRL_GVO_VIDEO_FORMAT_2048P_25_00_SMPTE372: int +NV_CTRL_GVO_VIDEO_FORMAT_2048I_50_00_SMPTE372: int +NV_CTRL_GVO_VIDEO_FORMAT_2048P_24_00_SMPTE372: int +NV_CTRL_GVO_VIDEO_FORMAT_2048P_23_98_SMPTE372: int +NV_CTRL_GVO_VIDEO_FORMAT_2048I_48_00_SMPTE372: int +NV_CTRL_GVO_VIDEO_FORMAT_2048I_47_96_SMPTE372: int +NV_CTRL_GVIO_DETECTED_VIDEO_FORMAT: int +NV_CTRL_GVO_INPUT_VIDEO_FORMAT: int +NV_CTRL_GVO_DATA_FORMAT: int +NV_CTRL_GVO_DATA_FORMAT_R8G8B8_TO_YCRCB444: int +NV_CTRL_GVO_DATA_FORMAT_R8G8B8A8_TO_YCRCBA4444: int +NV_CTRL_GVO_DATA_FORMAT_R8G8B8Z10_TO_YCRCBZ4444: int +NV_CTRL_GVO_DATA_FORMAT_R8G8B8_TO_YCRCB422: int +NV_CTRL_GVO_DATA_FORMAT_R8G8B8A8_TO_YCRCBA4224: int +NV_CTRL_GVO_DATA_FORMAT_R8G8B8Z10_TO_YCRCBZ4224: int +NV_CTRL_GVO_DATA_FORMAT_R8G8B8_TO_RGB444: int +NV_CTRL_GVO_DATA_FORMAT_X8X8X8_444_PASSTHRU: int +NV_CTRL_GVO_DATA_FORMAT_R8G8B8A8_TO_RGBA4444: int +NV_CTRL_GVO_DATA_FORMAT_X8X8X8A8_4444_PASSTHRU: int +NV_CTRL_GVO_DATA_FORMAT_R8G8B8Z10_TO_RGBZ4444: int +NV_CTRL_GVO_DATA_FORMAT_X8X8X8Z8_4444_PASSTHRU: int +NV_CTRL_GVO_DATA_FORMAT_Y10CR10CB10_TO_YCRCB444: int +NV_CTRL_GVO_DATA_FORMAT_X10X10X10_444_PASSTHRU: int +NV_CTRL_GVO_DATA_FORMAT_Y10CR8CB8_TO_YCRCB444: int +NV_CTRL_GVO_DATA_FORMAT_X10X8X8_444_PASSTHRU: int +NV_CTRL_GVO_DATA_FORMAT_Y10CR8CB8A10_TO_YCRCBA4444: int +NV_CTRL_GVO_DATA_FORMAT_X10X8X8A10_4444_PASSTHRU: int +NV_CTRL_GVO_DATA_FORMAT_Y10CR8CB8Z10_TO_YCRCBZ4444: int +NV_CTRL_GVO_DATA_FORMAT_X10X8X8Z10_4444_PASSTHRU: int +NV_CTRL_GVO_DATA_FORMAT_DUAL_R8G8B8_TO_DUAL_YCRCB422: int +NV_CTRL_GVO_DATA_FORMAT_DUAL_Y8CR8CB8_TO_DUAL_YCRCB422: int +NV_CTRL_GVO_DATA_FORMAT_DUAL_X8X8X8_TO_DUAL_422_PASSTHRU: int +NV_CTRL_GVO_DATA_FORMAT_R10G10B10_TO_YCRCB422: int +NV_CTRL_GVO_DATA_FORMAT_R10G10B10_TO_YCRCB444: int +NV_CTRL_GVO_DATA_FORMAT_Y12CR12CB12_TO_YCRCB444: int +NV_CTRL_GVO_DATA_FORMAT_X12X12X12_444_PASSTHRU: int +NV_CTRL_GVO_DATA_FORMAT_R12G12B12_TO_YCRCB444: int +NV_CTRL_GVO_DATA_FORMAT_X8X8X8_422_PASSTHRU: int +NV_CTRL_GVO_DATA_FORMAT_X8X8X8A8_4224_PASSTHRU: int +NV_CTRL_GVO_DATA_FORMAT_X8X8X8Z8_4224_PASSTHRU: int +NV_CTRL_GVO_DATA_FORMAT_X10X10X10_422_PASSTHRU: int +NV_CTRL_GVO_DATA_FORMAT_X10X8X8_422_PASSTHRU: int +NV_CTRL_GVO_DATA_FORMAT_X10X8X8A10_4224_PASSTHRU: int +NV_CTRL_GVO_DATA_FORMAT_X10X8X8Z10_4224_PASSTHRU: int +NV_CTRL_GVO_DATA_FORMAT_X12X12X12_422_PASSTHRU: int +NV_CTRL_GVO_DATA_FORMAT_R12G12B12_TO_YCRCB422: int +NV_CTRL_GVO_DISPLAY_X_SCREEN: int +NV_CTRL_GVO_DISPLAY_X_SCREEN_ENABLE: int +NV_CTRL_GVO_DISPLAY_X_SCREEN_DISABLE: int +NV_CTRL_GVO_COMPOSITE_SYNC_INPUT_DETECTED: int +NV_CTRL_GVO_COMPOSITE_SYNC_INPUT_DETECTED_FALSE: int +NV_CTRL_GVO_COMPOSITE_SYNC_INPUT_DETECTED_TRUE: int +NV_CTRL_GVO_COMPOSITE_SYNC_INPUT_DETECT_MODE: int +NV_CTRL_GVO_COMPOSITE_SYNC_INPUT_DETECT_MODE_AUTO: int +NV_CTRL_GVO_COMPOSITE_SYNC_INPUT_DETECT_MODE_BI_LEVEL: int +NV_CTRL_GVO_COMPOSITE_SYNC_INPUT_DETECT_MODE_TRI_LEVEL: int +NV_CTRL_GVO_SDI_SYNC_INPUT_DETECTED: int +NV_CTRL_GVO_SDI_SYNC_INPUT_DETECTED_NONE: int +NV_CTRL_GVO_SDI_SYNC_INPUT_DETECTED_HD: int +NV_CTRL_GVO_SDI_SYNC_INPUT_DETECTED_SD: int +NV_CTRL_GVO_VIDEO_OUTPUTS: int +NV_CTRL_GVO_VIDEO_OUTPUTS_NONE: int +NV_CTRL_GVO_VIDEO_OUTPUTS_VIDEO1: int +NV_CTRL_GVO_VIDEO_OUTPUTS_VIDEO2: int +NV_CTRL_GVO_VIDEO_OUTPUTS_VIDEO_BOTH: int +NV_CTRL_GVO_FIRMWARE_VERSION: int +NV_CTRL_GVO_SYNC_DELAY_PIXELS: int +NV_CTRL_GVO_SYNC_DELAY_LINES: int +NV_CTRL_GVO_INPUT_VIDEO_FORMAT_REACQUIRE: int +NV_CTRL_GVO_INPUT_VIDEO_FORMAT_REACQUIRE_FALSE: int +NV_CTRL_GVO_INPUT_VIDEO_FORMAT_REACQUIRE_TRUE: int +NV_CTRL_GVO_GLX_LOCKED: int +NV_CTRL_GVO_GLX_LOCKED_FALSE: int +NV_CTRL_GVO_GLX_LOCKED_TRUE: int +NV_CTRL_GVIO_VIDEO_FORMAT_WIDTH: int +NV_CTRL_GVIO_VIDEO_FORMAT_HEIGHT: int +NV_CTRL_GVIO_VIDEO_FORMAT_REFRESH_RATE: int +NV_CTRL_GVO_VIDEO_FORMAT_WIDTH: int +NV_CTRL_GVO_VIDEO_FORMAT_HEIGHT: int +NV_CTRL_GVO_VIDEO_FORMAT_REFRESH_RATE: int +NV_CTRL_GVO_X_SCREEN_PAN_X: int +NV_CTRL_GVO_X_SCREEN_PAN_Y: int +NV_CTRL_GPU_OVERCLOCKING_STATE: int +NV_CTRL_GPU_OVERCLOCKING_STATE_NONE: int +NV_CTRL_GPU_OVERCLOCKING_STATE_MANUAL: int +NV_CTRL_GPU_2D_CLOCK_FREQS: int +NV_CTRL_GPU_3D_CLOCK_FREQS: int +NV_CTRL_GPU_DEFAULT_2D_CLOCK_FREQS: int +NV_CTRL_GPU_DEFAULT_3D_CLOCK_FREQS: int +NV_CTRL_GPU_CURRENT_CLOCK_FREQS: int +NV_CTRL_GPU_OPTIMAL_CLOCK_FREQS: int +NV_CTRL_GPU_OPTIMAL_CLOCK_FREQS_INVALID: int +NV_CTRL_GPU_OPTIMAL_CLOCK_FREQS_DETECTION: int +NV_CTRL_GPU_OPTIMAL_CLOCK_FREQS_DETECTION_START: int +NV_CTRL_GPU_OPTIMAL_CLOCK_FREQS_DETECTION_CANCEL: int +NV_CTRL_GPU_OPTIMAL_CLOCK_FREQS_DETECTION_STATE: int +NV_CTRL_GPU_OPTIMAL_CLOCK_FREQS_DETECTION_STATE_IDLE: int +NV_CTRL_GPU_OPTIMAL_CLOCK_FREQS_DETECTION_STATE_BUSY: int +NV_CTRL_FLATPANEL_CHIP_LOCATION: int +NV_CTRL_FLATPANEL_CHIP_LOCATION_INTERNAL: int +NV_CTRL_FLATPANEL_CHIP_LOCATION_EXTERNAL: int +NV_CTRL_FLATPANEL_LINK: int +NV_CTRL_FLATPANEL_LINK_SINGLE: int +NV_CTRL_FLATPANEL_LINK_DUAL: int +NV_CTRL_FLATPANEL_LINK_QUAD: int +NV_CTRL_FLATPANEL_SIGNAL: int +NV_CTRL_FLATPANEL_SIGNAL_LVDS: int +NV_CTRL_FLATPANEL_SIGNAL_TMDS: int +NV_CTRL_FLATPANEL_SIGNAL_DISPLAYPORT: int +NV_CTRL_USE_HOUSE_SYNC: int +NV_CTRL_USE_HOUSE_SYNC_DISABLED: int +NV_CTRL_USE_HOUSE_SYNC_INPUT: int +NV_CTRL_USE_HOUSE_SYNC_OUTPUT: int +NV_CTRL_USE_HOUSE_SYNC_FALSE: int +NV_CTRL_USE_HOUSE_SYNC_TRUE: int +NV_CTRL_EDID_AVAILABLE: int +NV_CTRL_EDID_AVAILABLE_FALSE: int +NV_CTRL_EDID_AVAILABLE_TRUE: int +NV_CTRL_FORCE_STEREO: int +NV_CTRL_FORCE_STEREO_FALSE: int +NV_CTRL_FORCE_STEREO_TRUE: int +NV_CTRL_IMAGE_SETTINGS: int +NV_CTRL_IMAGE_SETTINGS_HIGH_QUALITY: int +NV_CTRL_IMAGE_SETTINGS_QUALITY: int +NV_CTRL_IMAGE_SETTINGS_PERFORMANCE: int +NV_CTRL_IMAGE_SETTINGS_HIGH_PERFORMANCE: int +NV_CTRL_XINERAMA: int +NV_CTRL_XINERAMA_OFF: int +NV_CTRL_XINERAMA_ON: int +NV_CTRL_XINERAMA_STEREO: int +NV_CTRL_XINERAMA_STEREO_FALSE: int +NV_CTRL_XINERAMA_STEREO_TRUE: int +NV_CTRL_BUS_RATE: int +NV_CTRL_GPU_PCIE_MAX_LINK_WIDTH: int +NV_CTRL_SHOW_SLI_VISUAL_INDICATOR: int +NV_CTRL_SHOW_SLI_VISUAL_INDICATOR_FALSE: int +NV_CTRL_SHOW_SLI_VISUAL_INDICATOR_TRUE: int +NV_CTRL_SHOW_SLI_HUD: int +NV_CTRL_SHOW_SLI_HUD_FALSE: int +NV_CTRL_SHOW_SLI_HUD_TRUE: int +NV_CTRL_XV_SYNC_TO_DISPLAY: int +NV_CTRL_GVIO_REQUESTED_VIDEO_FORMAT2: int +NV_CTRL_GVO_OUTPUT_VIDEO_FORMAT2: int +NV_CTRL_GVO_OVERRIDE_HW_CSC: int +NV_CTRL_GVO_OVERRIDE_HW_CSC_FALSE: int +NV_CTRL_GVO_OVERRIDE_HW_CSC_TRUE: int +NV_CTRL_GVO_CAPABILITIES: int +NV_CTRL_GVO_CAPABILITIES_APPLY_CSC_IMMEDIATELY: int +NV_CTRL_GVO_CAPABILITIES_APPLY_CSC_TO_X_SCREEN: int +NV_CTRL_GVO_CAPABILITIES_COMPOSITE_TERMINATION: int +NV_CTRL_GVO_CAPABILITIES_SHARED_SYNC_BNC: int +NV_CTRL_GVO_CAPABILITIES_MULTIRATE_SYNC: int +NV_CTRL_GVO_CAPABILITIES_ADVANCE_SYNC_SKEW: int +NV_CTRL_GVO_COMPOSITE_TERMINATION: int +NV_CTRL_GVO_COMPOSITE_TERMINATION_ENABLE: int +NV_CTRL_GVO_COMPOSITE_TERMINATION_DISABLE: int +NV_CTRL_ASSOCIATED_DISPLAY_DEVICES: int +NV_CTRL_FRAMELOCK_SLAVES: int +NV_CTRL_FRAMELOCK_MASTERABLE: int +NV_CTRL_PROBE_DISPLAYS: int +NV_CTRL_REFRESH_RATE: int +NV_CTRL_GVO_FLIP_QUEUE_SIZE: int +NV_CTRL_CURRENT_SCANLINE: int +NV_CTRL_INITIAL_PIXMAP_PLACEMENT: int +NV_CTRL_INITIAL_PIXMAP_PLACEMENT_FORCE_SYSMEM: int +NV_CTRL_INITIAL_PIXMAP_PLACEMENT_SYSMEM: int +NV_CTRL_INITIAL_PIXMAP_PLACEMENT_VIDMEM: int +NV_CTRL_INITIAL_PIXMAP_PLACEMENT_RESERVED: int +NV_CTRL_INITIAL_PIXMAP_PLACEMENT_GPU_SYSMEM: int +NV_CTRL_PCI_BUS: int +NV_CTRL_PCI_DEVICE: int +NV_CTRL_PCI_FUNCTION: int +NV_CTRL_FRAMELOCK_FPGA_REVISION: int +NV_CTRL_MAX_SCREEN_WIDTH: int +NV_CTRL_MAX_SCREEN_HEIGHT: int +NV_CTRL_MAX_DISPLAYS: int +NV_CTRL_DYNAMIC_TWINVIEW: int +NV_CTRL_MULTIGPU_DISPLAY_OWNER: int +NV_CTRL_GPU_SCALING: int +NV_CTRL_GPU_SCALING_TARGET_INVALID: int +NV_CTRL_GPU_SCALING_TARGET_FLATPANEL_BEST_FIT: int +NV_CTRL_GPU_SCALING_TARGET_FLATPANEL_NATIVE: int +NV_CTRL_GPU_SCALING_METHOD_INVALID: int +NV_CTRL_GPU_SCALING_METHOD_STRETCHED: int +NV_CTRL_GPU_SCALING_METHOD_CENTERED: int +NV_CTRL_GPU_SCALING_METHOD_ASPECT_SCALED: int +NV_CTRL_FRONTEND_RESOLUTION: int +NV_CTRL_BACKEND_RESOLUTION: int +NV_CTRL_FLATPANEL_NATIVE_RESOLUTION: int +NV_CTRL_FLATPANEL_BEST_FIT_RESOLUTION: int +NV_CTRL_GPU_SCALING_ACTIVE: int +NV_CTRL_DFP_SCALING_ACTIVE: int +NV_CTRL_FSAA_APPLICATION_ENHANCED: int +NV_CTRL_FSAA_APPLICATION_ENHANCED_ENABLED: int +NV_CTRL_FSAA_APPLICATION_ENHANCED_DISABLED: int +NV_CTRL_FRAMELOCK_SYNC_RATE_4: int +NV_CTRL_GVO_LOCK_OWNER: int +NV_CTRL_GVO_LOCK_OWNER_NONE: int +NV_CTRL_GVO_LOCK_OWNER_GLX: int +NV_CTRL_GVO_LOCK_OWNER_CLONE: int +NV_CTRL_GVO_LOCK_OWNER_X_SCREEN: int +NV_CTRL_HWOVERLAY: int +NV_CTRL_HWOVERLAY_FALSE: int +NV_CTRL_HWOVERLAY_TRUE: int +NV_CTRL_NUM_GPU_ERRORS_RECOVERED: int +NV_CTRL_REFRESH_RATE_3: int +NV_CTRL_ONDEMAND_VBLANK_INTERRUPTS: int +NV_CTRL_ONDEMAND_VBLANK_INTERRUPTS_OFF: int +NV_CTRL_ONDEMAND_VBLANK_INTERRUPTS_ON: int +NV_CTRL_GPU_POWER_SOURCE: int +NV_CTRL_GPU_POWER_SOURCE_AC: int +NV_CTRL_GPU_POWER_SOURCE_BATTERY: int +NV_CTRL_GPU_CURRENT_PERFORMANCE_MODE: int +NV_CTRL_GPU_CURRENT_PERFORMANCE_MODE_DESKTOP: int +NV_CTRL_GPU_CURRENT_PERFORMANCE_MODE_MAXPERF: int +NV_CTRL_GLYPH_CACHE: int +NV_CTRL_GLYPH_CACHE_DISABLED: int +NV_CTRL_GLYPH_CACHE_ENABLED: int +NV_CTRL_GPU_CURRENT_PERFORMANCE_LEVEL: int +NV_CTRL_GPU_ADAPTIVE_CLOCK_STATE: int +NV_CTRL_GPU_ADAPTIVE_CLOCK_STATE_DISABLED: int +NV_CTRL_GPU_ADAPTIVE_CLOCK_STATE_ENABLED: int +NV_CTRL_GVO_OUTPUT_VIDEO_LOCKED: int +NV_CTRL_GVO_OUTPUT_VIDEO_LOCKED_FALSE: int +NV_CTRL_GVO_OUTPUT_VIDEO_LOCKED_TRUE: int +NV_CTRL_GVO_SYNC_LOCK_STATUS: int +NV_CTRL_GVO_SYNC_LOCK_STATUS_UNLOCKED: int +NV_CTRL_GVO_SYNC_LOCK_STATUS_LOCKED: int +NV_CTRL_GVO_ANC_TIME_CODE_GENERATION: int +NV_CTRL_GVO_ANC_TIME_CODE_GENERATION_DISABLE: int +NV_CTRL_GVO_ANC_TIME_CODE_GENERATION_ENABLE: int +NV_CTRL_GVO_COMPOSITE: int +NV_CTRL_GVO_COMPOSITE_DISABLE: int +NV_CTRL_GVO_COMPOSITE_ENABLE: int +NV_CTRL_GVO_COMPOSITE_ALPHA_KEY: int +NV_CTRL_GVO_COMPOSITE_ALPHA_KEY_DISABLE: int +NV_CTRL_GVO_COMPOSITE_ALPHA_KEY_ENABLE: int +NV_CTRL_GVO_COMPOSITE_LUMA_KEY_RANGE: int +NV_CTRL_GVO_COMPOSITE_CR_KEY_RANGE: int +NV_CTRL_GVO_COMPOSITE_CB_KEY_RANGE: int +NV_CTRL_GVO_COMPOSITE_NUM_KEY_RANGES: int +NV_CTRL_SWITCH_TO_DISPLAYS: int +NV_CTRL_NOTEBOOK_DISPLAY_CHANGE_LID_EVENT: int +NV_CTRL_NOTEBOOK_INTERNAL_LCD: int +NV_CTRL_DEPTH_30_ALLOWED: int +NV_CTRL_MODE_SET_EVENT: int +NV_CTRL_OPENGL_AA_LINE_GAMMA_VALUE: int +NV_CTRL_VCSC_HIGH_PERF_MODE: int +NV_CTRL_VCSC_HIGH_PERF_MODE_DISABLE: int +NV_CTRL_VCSC_HIGH_PERF_MODE_ENABLE: int +NV_CTRL_DISPLAYPORT_LINK_RATE: int +NV_CTRL_DISPLAYPORT_LINK_RATE_DISABLED: int +NV_CTRL_DISPLAYPORT_LINK_RATE_1_62GBPS: int +NV_CTRL_DISPLAYPORT_LINK_RATE_2_70GBPS: int +NV_CTRL_STEREO_EYES_EXCHANGE: int +NV_CTRL_STEREO_EYES_EXCHANGE_OFF: int +NV_CTRL_STEREO_EYES_EXCHANGE_ON: int +NV_CTRL_NO_SCANOUT: int +NV_CTRL_NO_SCANOUT_DISABLED: int +NV_CTRL_NO_SCANOUT_ENABLED: int +NV_CTRL_GVO_CSC_CHANGED_EVENT: int +NV_CTRL_FRAMELOCK_SLAVEABLE: int +NV_CTRL_GVO_SYNC_TO_DISPLAY: int +NV_CTRL_GVO_SYNC_TO_DISPLAY_DISABLE: int +NV_CTRL_GVO_SYNC_TO_DISPLAY_ENABLE: int +NV_CTRL_X_SERVER_UNIQUE_ID: int +NV_CTRL_PIXMAP_CACHE: int +NV_CTRL_PIXMAP_CACHE_DISABLE: int +NV_CTRL_PIXMAP_CACHE_ENABLE: int +NV_CTRL_PIXMAP_CACHE_ROUNDING_SIZE_KB: int +NV_CTRL_IS_GVO_DISPLAY: int +NV_CTRL_IS_GVO_DISPLAY_FALSE: int +NV_CTRL_IS_GVO_DISPLAY_TRUE: int +NV_CTRL_PCI_ID: int +NV_CTRL_GVO_FULL_RANGE_COLOR: int +NV_CTRL_GVO_FULL_RANGE_COLOR_DISABLED: int +NV_CTRL_GVO_FULL_RANGE_COLOR_ENABLED: int +NV_CTRL_SLI_MOSAIC_MODE_AVAILABLE: int +NV_CTRL_SLI_MOSAIC_MODE_AVAILABLE_FALSE: int +NV_CTRL_SLI_MOSAIC_MODE_AVAILABLE_TRUE: int +NV_CTRL_GVO_ENABLE_RGB_DATA: int +NV_CTRL_GVO_ENABLE_RGB_DATA_DISABLE: int +NV_CTRL_GVO_ENABLE_RGB_DATA_ENABLE: int +NV_CTRL_IMAGE_SHARPENING_DEFAULT: int +NV_CTRL_PCI_DOMAIN: int +NV_CTRL_GVI_NUM_JACKS: int +NV_CTRL_GVI_MAX_LINKS_PER_STREAM: int +NV_CTRL_GVI_DETECTED_CHANNEL_BITS_PER_COMPONENT: int +NV_CTRL_GVI_BITS_PER_COMPONENT_UNKNOWN: int +NV_CTRL_GVI_BITS_PER_COMPONENT_8: int +NV_CTRL_GVI_BITS_PER_COMPONENT_10: int +NV_CTRL_GVI_BITS_PER_COMPONENT_12: int +NV_CTRL_GVI_REQUESTED_STREAM_BITS_PER_COMPONENT: int +NV_CTRL_GVI_DETECTED_CHANNEL_COMPONENT_SAMPLING: int +NV_CTRL_GVI_COMPONENT_SAMPLING_UNKNOWN: int +NV_CTRL_GVI_COMPONENT_SAMPLING_4444: int +NV_CTRL_GVI_COMPONENT_SAMPLING_4224: int +NV_CTRL_GVI_COMPONENT_SAMPLING_444: int +NV_CTRL_GVI_COMPONENT_SAMPLING_422: int +NV_CTRL_GVI_COMPONENT_SAMPLING_420: int +NV_CTRL_GVI_REQUESTED_STREAM_COMPONENT_SAMPLING: int +NV_CTRL_GVI_REQUESTED_STREAM_CHROMA_EXPAND: int +NV_CTRL_GVI_CHROMA_EXPAND_FALSE: int +NV_CTRL_GVI_CHROMA_EXPAND_TRUE: int +NV_CTRL_GVI_DETECTED_CHANNEL_COLOR_SPACE: int +NV_CTRL_GVI_COLOR_SPACE_UNKNOWN: int +NV_CTRL_GVI_COLOR_SPACE_GBR: int +NV_CTRL_GVI_COLOR_SPACE_GBRA: int +NV_CTRL_GVI_COLOR_SPACE_GBRD: int +NV_CTRL_GVI_COLOR_SPACE_YCBCR: int +NV_CTRL_GVI_COLOR_SPACE_YCBCRA: int +NV_CTRL_GVI_COLOR_SPACE_YCBCRD: int +NV_CTRL_GVI_DETECTED_CHANNEL_LINK_ID: int +NV_CTRL_GVI_LINK_ID_UNKNOWN: int +NV_CTRL_GVI_DETECTED_CHANNEL_SMPTE352_IDENTIFIER: int +NV_CTRL_GVI_GLOBAL_IDENTIFIER: int +NV_CTRL_FRAMELOCK_SYNC_DELAY_RESOLUTION: int +NV_CTRL_GPU_COOLER_MANUAL_CONTROL: int +NV_CTRL_GPU_COOLER_MANUAL_CONTROL_FALSE: int +NV_CTRL_GPU_COOLER_MANUAL_CONTROL_TRUE: int +NV_CTRL_THERMAL_COOLER_LEVEL: int +NV_CTRL_THERMAL_COOLER_LEVEL_SET_DEFAULT: int +NV_CTRL_THERMAL_COOLER_CONTROL_TYPE: int +NV_CTRL_THERMAL_COOLER_CONTROL_TYPE_NONE: int +NV_CTRL_THERMAL_COOLER_CONTROL_TYPE_TOGGLE: int +NV_CTRL_THERMAL_COOLER_CONTROL_TYPE_VARIABLE: int +NV_CTRL_THERMAL_COOLER_TARGET: int +NV_CTRL_THERMAL_COOLER_TARGET_NONE: int +NV_CTRL_THERMAL_COOLER_TARGET_GPU: int +NV_CTRL_THERMAL_COOLER_TARGET_MEMORY: int +NV_CTRL_THERMAL_COOLER_TARGET_POWER_SUPPLY: int +NV_CTRL_THERMAL_COOLER_TARGET_GPU_RELATED: int +NV_CTRL_GPU_ECC_SUPPORTED: int +NV_CTRL_GPU_ECC_SUPPORTED_FALSE: int +NV_CTRL_GPU_ECC_SUPPORTED_TRUE: int +NV_CTRL_GPU_ECC_STATUS: int +NV_CTRL_GPU_ECC_STATUS_DISABLED: int +NV_CTRL_GPU_ECC_STATUS_ENABLED: int +NV_CTRL_GPU_ECC_CONFIGURATION_SUPPORTED: int +NV_CTRL_GPU_ECC_CONFIGURATION_SUPPORTED_FALSE: int +NV_CTRL_GPU_ECC_CONFIGURATION_SUPPORTED_TRUE: int +NV_CTRL_GPU_ECC_CONFIGURATION: int +NV_CTRL_GPU_ECC_CONFIGURATION_DISABLED: int +NV_CTRL_GPU_ECC_CONFIGURATION_ENABLED: int +NV_CTRL_GPU_ECC_DEFAULT_CONFIGURATION: int +NV_CTRL_GPU_ECC_DEFAULT_CONFIGURATION_DISABLED: int +NV_CTRL_GPU_ECC_DEFAULT_CONFIGURATION_ENABLED: int +NV_CTRL_GPU_ECC_SINGLE_BIT_ERRORS: int +NV_CTRL_GPU_ECC_DOUBLE_BIT_ERRORS: int +NV_CTRL_GPU_ECC_AGGREGATE_SINGLE_BIT_ERRORS: int +NV_CTRL_GPU_ECC_AGGREGATE_DOUBLE_BIT_ERRORS: int +NV_CTRL_GPU_ECC_RESET_ERROR_STATUS: int +NV_CTRL_GPU_ECC_RESET_ERROR_STATUS_VOLATILE: int +NV_CTRL_GPU_ECC_RESET_ERROR_STATUS_AGGREGATE: int +NV_CTRL_GPU_POWER_MIZER_MODE: int +NV_CTRL_GPU_POWER_MIZER_MODE_ADAPTIVE: int +NV_CTRL_GPU_POWER_MIZER_MODE_PREFER_MAXIMUM_PERFORMANCE: int +NV_CTRL_GPU_POWER_MIZER_MODE_AUTO: int +NV_CTRL_GPU_POWER_MIZER_MODE_PREFER_CONSISTENT_PERFORMANCE: int +NV_CTRL_GVI_SYNC_OUTPUT_FORMAT: int +NV_CTRL_GVI_MAX_CHANNELS_PER_JACK: int +NV_CTRL_GVI_MAX_STREAMS: int +NV_CTRL_GVI_NUM_CAPTURE_SURFACES: int +NV_CTRL_OVERSCAN_COMPENSATION: int +NV_CTRL_GPU_PCIE_GENERATION: int +NV_CTRL_GPU_PCIE_GENERATION1: int +NV_CTRL_GPU_PCIE_GENERATION2: int +NV_CTRL_GPU_PCIE_GENERATION3: int +NV_CTRL_GVI_BOUND_GPU: int +NV_CTRL_GVIO_REQUESTED_VIDEO_FORMAT3: int +NV_CTRL_ACCELERATE_TRAPEZOIDS: int +NV_CTRL_ACCELERATE_TRAPEZOIDS_DISABLE: int +NV_CTRL_ACCELERATE_TRAPEZOIDS_ENABLE: int +NV_CTRL_GPU_CORES: int +NV_CTRL_GPU_MEMORY_BUS_WIDTH: int +NV_CTRL_GVI_TEST_MODE: int +NV_CTRL_GVI_TEST_MODE_DISABLE: int +NV_CTRL_GVI_TEST_MODE_ENABLE: int +NV_CTRL_COLOR_SPACE: int +NV_CTRL_COLOR_SPACE_RGB: int +NV_CTRL_COLOR_SPACE_YCbCr422: int +NV_CTRL_COLOR_SPACE_YCbCr444: int +NV_CTRL_COLOR_RANGE: int +NV_CTRL_COLOR_RANGE_FULL: int +NV_CTRL_COLOR_RANGE_LIMITED: int +NV_CTRL_GPU_SCALING_DEFAULT_TARGET: int +NV_CTRL_GPU_SCALING_DEFAULT_METHOD: int +NV_CTRL_DITHERING_MODE: int +NV_CTRL_DITHERING_MODE_AUTO: int +NV_CTRL_DITHERING_MODE_DYNAMIC_2X2: int +NV_CTRL_DITHERING_MODE_STATIC_2X2: int +NV_CTRL_DITHERING_MODE_TEMPORAL: int +NV_CTRL_CURRENT_DITHERING: int +NV_CTRL_CURRENT_DITHERING_DISABLED: int +NV_CTRL_CURRENT_DITHERING_ENABLED: int +NV_CTRL_CURRENT_DITHERING_MODE: int +NV_CTRL_CURRENT_DITHERING_MODE_NONE: int +NV_CTRL_CURRENT_DITHERING_MODE_DYNAMIC_2X2: int +NV_CTRL_CURRENT_DITHERING_MODE_STATIC_2X2: int +NV_CTRL_CURRENT_DITHERING_MODE_TEMPORAL: int +NV_CTRL_THERMAL_SENSOR_READING: int +NV_CTRL_THERMAL_SENSOR_PROVIDER: int +NV_CTRL_THERMAL_SENSOR_PROVIDER_NONE: int +NV_CTRL_THERMAL_SENSOR_PROVIDER_GPU_INTERNAL: int +NV_CTRL_THERMAL_SENSOR_PROVIDER_ADM1032: int +NV_CTRL_THERMAL_SENSOR_PROVIDER_ADT7461: int +NV_CTRL_THERMAL_SENSOR_PROVIDER_MAX6649: int +NV_CTRL_THERMAL_SENSOR_PROVIDER_MAX1617: int +NV_CTRL_THERMAL_SENSOR_PROVIDER_LM99: int +NV_CTRL_THERMAL_SENSOR_PROVIDER_LM89: int +NV_CTRL_THERMAL_SENSOR_PROVIDER_LM64: int +NV_CTRL_THERMAL_SENSOR_PROVIDER_G781: int +NV_CTRL_THERMAL_SENSOR_PROVIDER_ADT7473: int +NV_CTRL_THERMAL_SENSOR_PROVIDER_SBMAX6649: int +NV_CTRL_THERMAL_SENSOR_PROVIDER_VBIOSEVT: int +NV_CTRL_THERMAL_SENSOR_PROVIDER_OS: int +NV_CTRL_THERMAL_SENSOR_PROVIDER_UNKNOWN: int +NV_CTRL_THERMAL_SENSOR_TARGET: int +NV_CTRL_THERMAL_SENSOR_TARGET_NONE: int +NV_CTRL_THERMAL_SENSOR_TARGET_GPU: int +NV_CTRL_THERMAL_SENSOR_TARGET_MEMORY: int +NV_CTRL_THERMAL_SENSOR_TARGET_POWER_SUPPLY: int +NV_CTRL_THERMAL_SENSOR_TARGET_BOARD: int +NV_CTRL_THERMAL_SENSOR_TARGET_UNKNOWN: int +NV_CTRL_SHOW_MULTIGPU_VISUAL_INDICATOR: int +NV_CTRL_SHOW_MULTIGPU_VISUAL_INDICATOR_FALSE: int +NV_CTRL_SHOW_MULTIGPU_VISUAL_INDICATOR_TRUE: int +NV_CTRL_GPU_CURRENT_PROCESSOR_CLOCK_FREQS: int +NV_CTRL_GVIO_VIDEO_FORMAT_FLAGS: int +NV_CTRL_GVIO_VIDEO_FORMAT_FLAGS_NONE: int +NV_CTRL_GVIO_VIDEO_FORMAT_FLAGS_INTERLACED: int +NV_CTRL_GVIO_VIDEO_FORMAT_FLAGS_PROGRESSIVE: int +NV_CTRL_GVIO_VIDEO_FORMAT_FLAGS_PSF: int +NV_CTRL_GVIO_VIDEO_FORMAT_FLAGS_3G_LEVEL_A: int +NV_CTRL_GVIO_VIDEO_FORMAT_FLAGS_3G_LEVEL_B: int +NV_CTRL_GVIO_VIDEO_FORMAT_FLAGS_3G: int +NV_CTRL_GVIO_VIDEO_FORMAT_FLAGS_3G_1080P_NO_12BPC: int +NV_CTRL_GPU_PCIE_MAX_LINK_SPEED: int +NV_CTRL_3D_VISION_PRO_RESET_TRANSCEIVER_TO_FACTORY_SETTINGS: int +NV_CTRL_3D_VISION_PRO_TRANSCEIVER_CHANNEL: int +NV_CTRL_3D_VISION_PRO_TRANSCEIVER_MODE: int +NV_CTRL_3D_VISION_PRO_TRANSCEIVER_MODE_INVALID: int +NV_CTRL_3D_VISION_PRO_TRANSCEIVER_MODE_LOW_RANGE: int +NV_CTRL_3D_VISION_PRO_TRANSCEIVER_MODE_MEDIUM_RANGE: int +NV_CTRL_3D_VISION_PRO_TRANSCEIVER_MODE_HIGH_RANGE: int +NV_CTRL_3D_VISION_PRO_TRANSCEIVER_MODE_COUNT: int +NV_CTRL_SYNCHRONOUS_PALETTE_UPDATES: int +NV_CTRL_SYNCHRONOUS_PALETTE_UPDATES_DISABLE: int +NV_CTRL_SYNCHRONOUS_PALETTE_UPDATES_ENABLE: int +NV_CTRL_DITHERING_DEPTH: int +NV_CTRL_DITHERING_DEPTH_AUTO: int +NV_CTRL_DITHERING_DEPTH_6_BITS: int +NV_CTRL_DITHERING_DEPTH_8_BITS: int +NV_CTRL_CURRENT_DITHERING_DEPTH: int +NV_CTRL_CURRENT_DITHERING_DEPTH_NONE: int +NV_CTRL_CURRENT_DITHERING_DEPTH_6_BITS: int +NV_CTRL_CURRENT_DITHERING_DEPTH_8_BITS: int +NV_CTRL_3D_VISION_PRO_TRANSCEIVER_CHANNEL_FREQUENCY: int +NV_CTRL_3D_VISION_PRO_TRANSCEIVER_CHANNEL_QUALITY: int +NV_CTRL_3D_VISION_PRO_TRANSCEIVER_CHANNEL_COUNT: int +NV_CTRL_3D_VISION_PRO_PAIR_GLASSES: int +NV_CTRL_3D_VISION_PRO_PAIR_GLASSES_STOP: int +NV_CTRL_3D_VISION_PRO_PAIR_GLASSES_BEACON: int +NV_CTRL_3D_VISION_PRO_UNPAIR_GLASSES: int +NV_CTRL_3D_VISION_PRO_DISCOVER_GLASSES: int +NV_CTRL_3D_VISION_PRO_IDENTIFY_GLASSES: int +NV_CTRL_3D_VISION_PRO_GLASSES_SYNC_CYCLE: int +NV_CTRL_3D_VISION_PRO_GLASSES_MISSED_SYNC_CYCLES: int +NV_CTRL_3D_VISION_PRO_GLASSES_BATTERY_LEVEL: int +NV_CTRL_GVO_ANC_PARITY_COMPUTATION: int +NV_CTRL_GVO_ANC_PARITY_COMPUTATION_AUTO: int +NV_CTRL_GVO_ANC_PARITY_COMPUTATION_ON: int +NV_CTRL_GVO_ANC_PARITY_COMPUTATION_OFF: int +NV_CTRL_3D_VISION_PRO_GLASSES_PAIR_EVENT: int +NV_CTRL_3D_VISION_PRO_GLASSES_UNPAIR_EVENT: int +NV_CTRL_GPU_PCIE_CURRENT_LINK_WIDTH: int +NV_CTRL_GPU_PCIE_CURRENT_LINK_SPEED: int +NV_CTRL_GVO_AUDIO_BLANKING: int +NV_CTRL_GVO_AUDIO_BLANKING_DISABLE: int +NV_CTRL_GVO_AUDIO_BLANKING_ENABLE: int +NV_CTRL_CURRENT_METAMODE_ID: int +NV_CTRL_DISPLAY_ENABLED: int +NV_CTRL_DISPLAY_ENABLED_TRUE: int +NV_CTRL_DISPLAY_ENABLED_FALSE: int +NV_CTRL_FRAMELOCK_INCOMING_HOUSE_SYNC_RATE: int +NV_CTRL_FXAA: int +NV_CTRL_FXAA_DISABLE: int +NV_CTRL_FXAA_ENABLE: int +NV_CTRL_DISPLAY_RANDR_OUTPUT_ID: int +NV_CTRL_FRAMELOCK_DISPLAY_CONFIG: int +NV_CTRL_FRAMELOCK_DISPLAY_CONFIG_DISABLED: int +NV_CTRL_FRAMELOCK_DISPLAY_CONFIG_CLIENT: int +NV_CTRL_FRAMELOCK_DISPLAY_CONFIG_SERVER: int +NV_CTRL_TOTAL_DEDICATED_GPU_MEMORY: int +NV_CTRL_USED_DEDICATED_GPU_MEMORY: int +NV_CTRL_GPU_DOUBLE_PRECISION_BOOST_IMMEDIATE: int +NV_CTRL_GPU_DOUBLE_PRECISION_BOOST_IMMEDIATE_DISABLED: int +NV_CTRL_GPU_DOUBLE_PRECISION_BOOST_IMMEDIATE_ENABLED: int +NV_CTRL_GPU_DOUBLE_PRECISION_BOOST_REBOOT: int +NV_CTRL_GPU_DOUBLE_PRECISION_BOOST_REBOOT_DISABLED: int +NV_CTRL_GPU_DOUBLE_PRECISION_BOOST_REBOOT_ENALED: int +NV_CTRL_DPY_HDMI_3D: int +NV_CTRL_DPY_HDMI_3D_DISABLED: int +NV_CTRL_DPY_HDMI_3D_ENABLED: int +NV_CTRL_BASE_MOSAIC: int +NV_CTRL_BASE_MOSAIC_DISABLED: int +NV_CTRL_BASE_MOSAIC_FULL: int +NV_CTRL_BASE_MOSAIC_LIMITED: int +NV_CTRL_MULTIGPU_MASTER_POSSIBLE: int +NV_CTRL_MULTIGPU_MASTER_POSSIBLE_FALSE: int +NV_CTRL_MULTIGPU_MASTER_POSSIBLE_TRUE: int +NV_CTRL_GPU_POWER_MIZER_DEFAULT_MODE: int +NV_CTRL_XV_SYNC_TO_DISPLAY_ID: int +NV_CTRL_XV_SYNC_TO_DISPLAY_ID_AUTO: int +NV_CTRL_BACKLIGHT_BRIGHTNESS: int +NV_CTRL_GPU_LOGO_BRIGHTNESS: int +NV_CTRL_GPU_SLI_LOGO_BRIGHTNESS: int +NV_CTRL_THERMAL_COOLER_SPEED: int +NV_CTRL_PALETTE_UPDATE_EVENT: int +NV_CTRL_VIDEO_ENCODER_UTILIZATION: int +NV_CTRL_GSYNC_ALLOWED: int +NV_CTRL_GSYNC_ALLOWED_FALSE: int +NV_CTRL_GSYNC_ALLOWED_TRUE: int +NV_CTRL_GPU_NVCLOCK_OFFSET: int +NV_CTRL_GPU_MEM_TRANSFER_RATE_OFFSET: int +NV_CTRL_VIDEO_DECODER_UTILIZATION: int +NV_CTRL_GPU_OVER_VOLTAGE_OFFSET: int +NV_CTRL_GPU_CURRENT_CORE_VOLTAGE: int +NV_CTRL_CURRENT_COLOR_SPACE: int +NV_CTRL_CURRENT_COLOR_SPACE_RGB: int +NV_CTRL_CURRENT_COLOR_SPACE_YCbCr422: int +NV_CTRL_CURRENT_COLOR_SPACE_YCbCr444: int +NV_CTRL_CURRENT_COLOR_SPACE_YCbCr420: int +NV_CTRL_CURRENT_COLOR_RANGE: int +NV_CTRL_CURRENT_COLOR_RANGE_FULL: int +NV_CTRL_CURRENT_COLOR_RANGE_LIMITED: int +NV_CTRL_SHOW_GSYNC_VISUAL_INDICATOR: int +NV_CTRL_SHOW_GSYNC_VISUAL_INDICATOR_FALSE: int +NV_CTRL_SHOW_GSYNC_VISUAL_INDICATOR_TRUE: int +NV_CTRL_THERMAL_COOLER_CURRENT_LEVEL: int +NV_CTRL_STEREO_SWAP_MODE: int +NV_CTRL_STEREO_SWAP_MODE_APPLICATION_CONTROL: int +NV_CTRL_STEREO_SWAP_MODE_PER_EYE: int +NV_CTRL_STEREO_SWAP_MODE_PER_EYE_PAIR: int +NV_CTRL_CURRENT_XV_SYNC_TO_DISPLAY_ID: int +NV_CTRL_GPU_FRAMELOCK_FIRMWARE_UNSUPPORTED: int +NV_CTRL_GPU_FRAMELOCK_FIRMWARE_UNSUPPORTED_FALSE: int +NV_CTRL_GPU_FRAMELOCK_FIRMWARE_UNSUPPORTED_TRUE: int +NV_CTRL_DISPLAYPORT_CONNECTOR_TYPE: int +NV_CTRL_DISPLAYPORT_CONNECTOR_TYPE_UNKNOWN: int +NV_CTRL_DISPLAYPORT_CONNECTOR_TYPE_DISPLAYPORT: int +NV_CTRL_DISPLAYPORT_CONNECTOR_TYPE_HDMI: int +NV_CTRL_DISPLAYPORT_CONNECTOR_TYPE_DVI: int +NV_CTRL_DISPLAYPORT_CONNECTOR_TYPE_VGA: int +NV_CTRL_DISPLAYPORT_IS_MULTISTREAM: int +NV_CTRL_DISPLAYPORT_SINK_IS_AUDIO_CAPABLE: int +NV_CTRL_GPU_NVCLOCK_OFFSET_ALL_PERFORMANCE_LEVELS: int +NV_CTRL_GPU_MEM_TRANSFER_RATE_OFFSET_ALL_PERFORMANCE_LEVELS: int +NV_CTRL_FRAMELOCK_FIRMWARE_VERSION: int +NV_CTRL_FRAMELOCK_FIRMWARE_MINOR_VERSION: int +NV_CTRL_SHOW_GRAPHICS_VISUAL_INDICATOR: int +NV_CTRL_SHOW_GRAPHICS_VISUAL_INDICATOR_FALSE: int +NV_CTRL_SHOW_GRAPHICS_VISUAL_INDICATOR_TRUE: int +NV_CTRL_LAST_ATTRIBUTE: int +NV_CTRL_STRING_PRODUCT_NAME: int +NV_CTRL_STRING_VBIOS_VERSION: int +NV_CTRL_STRING_NVIDIA_DRIVER_VERSION: int +NV_CTRL_STRING_DISPLAY_DEVICE_NAME: int +NV_CTRL_STRING_TV_ENCODER_NAME: int +NV_CTRL_STRING_GVIO_FIRMWARE_VERSION: int +NV_CTRL_STRING_GVO_FIRMWARE_VERSION: int +NV_CTRL_STRING_CURRENT_MODELINE: int +NV_CTRL_STRING_ADD_MODELINE: int +NV_CTRL_STRING_DELETE_MODELINE: int +NV_CTRL_STRING_CURRENT_METAMODE: int +NV_CTRL_STRING_CURRENT_METAMODE_VERSION_1: int +NV_CTRL_STRING_ADD_METAMODE: int +NV_CTRL_STRING_DELETE_METAMODE: int +NV_CTRL_STRING_VCSC_PRODUCT_NAME: int +NV_CTRL_STRING_VCSC_PRODUCT_ID: int +NV_CTRL_STRING_VCSC_SERIAL_NUMBER: int +NV_CTRL_STRING_VCSC_BUILD_DATE: int +NV_CTRL_STRING_VCSC_FIRMWARE_VERSION: int +NV_CTRL_STRING_VCSC_FIRMWARE_REVISION: int +NV_CTRL_STRING_VCSC_HARDWARE_VERSION: int +NV_CTRL_STRING_VCSC_HARDWARE_REVISION: int +NV_CTRL_STRING_MOVE_METAMODE: int +NV_CTRL_STRING_VALID_HORIZ_SYNC_RANGES: int +NV_CTRL_STRING_VALID_VERT_REFRESH_RANGES: int +NV_CTRL_STRING_SCREEN_RECTANGLE: int +NV_CTRL_STRING_XINERAMA_SCREEN_INFO: int +NV_CTRL_STRING_NVIDIA_XINERAMA_INFO_ORDER: int +NV_CTRL_STRING_TWINVIEW_XINERAMA_INFO_ORDER: int +NV_CTRL_STRING_SLI_MODE: int +NV_CTRL_STRING_PERFORMANCE_MODES: int +NV_CTRL_STRING_VCSC_FAN_STATUS: int +NV_CTRL_STRING_VCSC_TEMPERATURES: int +NV_CTRL_STRING_VCSC_PSU_INFO: int +NV_CTRL_STRING_GVIO_VIDEO_FORMAT_NAME: int +NV_CTRL_STRING_GVO_VIDEO_FORMAT_NAME: int +NV_CTRL_STRING_GPU_CURRENT_CLOCK_FREQS: int +NV_CTRL_STRING_3D_VISION_PRO_TRANSCEIVER_HARDWARE_REVISION: int +NV_CTRL_STRING_3D_VISION_PRO_TRANSCEIVER_FIRMWARE_VERSION_A: int +NV_CTRL_STRING_3D_VISION_PRO_TRANSCEIVER_FIRMWARE_DATE_A: int +NV_CTRL_STRING_3D_VISION_PRO_TRANSCEIVER_FIRMWARE_VERSION_B: int +NV_CTRL_STRING_3D_VISION_PRO_TRANSCEIVER_FIRMWARE_DATE_B: int +NV_CTRL_STRING_3D_VISION_PRO_TRANSCEIVER_ADDRESS: int +NV_CTRL_STRING_3D_VISION_PRO_GLASSES_FIRMWARE_VERSION_A: int +NV_CTRL_STRING_3D_VISION_PRO_GLASSES_FIRMWARE_DATE_A: int +NV_CTRL_STRING_3D_VISION_PRO_GLASSES_ADDRESS: int +NV_CTRL_STRING_3D_VISION_PRO_GLASSES_NAME: int +NV_CTRL_STRING_CURRENT_METAMODE_VERSION_2: int +NV_CTRL_STRING_DISPLAY_NAME_TYPE_BASENAME: int +NV_CTRL_STRING_DISPLAY_NAME_TYPE_ID: int +NV_CTRL_STRING_DISPLAY_NAME_DP_GUID: int +NV_CTRL_STRING_DISPLAY_NAME_EDID_HASH: int +NV_CTRL_STRING_DISPLAY_NAME_TARGET_INDEX: int +NV_CTRL_STRING_DISPLAY_NAME_RANDR: int +NV_CTRL_STRING_GPU_UUID: int +NV_CTRL_STRING_GPU_UTILIZATION: int +NV_CTRL_STRING_MULTIGPU_MODE: int +NV_CTRL_STRING_PRIME_OUTPUTS_DATA: int +NV_CTRL_STRING_LAST_ATTRIBUTE: int +NV_CTRL_BINARY_DATA_EDID: int +NV_CTRL_BINARY_DATA_MODELINES: int +NV_CTRL_BINARY_DATA_METAMODES: int +NV_CTRL_BINARY_DATA_METAMODES_VERSION_1: int +NV_CTRL_BINARY_DATA_XSCREENS_USING_GPU: int +NV_CTRL_BINARY_DATA_GPUS_USED_BY_XSCREEN: int +NV_CTRL_BINARY_DATA_GPUS_USING_FRAMELOCK: int +NV_CTRL_BINARY_DATA_DISPLAY_VIEWPORT: int +NV_CTRL_BINARY_DATA_FRAMELOCKS_USED_BY_GPU: int +NV_CTRL_BINARY_DATA_GPUS_USING_VCSC: int +NV_CTRL_BINARY_DATA_VCSCS_USED_BY_GPU: int +NV_CTRL_BINARY_DATA_COOLERS_USED_BY_GPU: int +NV_CTRL_BINARY_DATA_GPUS_USED_BY_LOGICAL_XSCREEN: int +NV_CTRL_BINARY_DATA_THERMAL_SENSORS_USED_BY_GPU: int +NV_CTRL_BINARY_DATA_GLASSES_PAIRED_TO_3D_VISION_PRO_TRANSCEIVER: int +NV_CTRL_BINARY_DATA_DISPLAY_TARGETS: int +NV_CTRL_BINARY_DATA_DISPLAYS_CONNECTED_TO_GPU: int +NV_CTRL_BINARY_DATA_METAMODES_VERSION_2: int +NV_CTRL_BINARY_DATA_DISPLAYS_ENABLED_ON_XSCREEN: int +NV_CTRL_BINARY_DATA_DISPLAYS_ASSIGNED_TO_XSCREEN: int +NV_CTRL_BINARY_DATA_GPU_FLAGS: int +NV_CTRL_BINARY_DATA_GPU_FLAGS_STEREO_DISPLAY_TRANSFORM_EXCLUSIVE: int +NV_CTRL_BINARY_DATA_GPU_FLAGS_OVERLAY_DISPLAY_TRANSFORM_EXCLUSIVE: int +NV_CTRL_BINARY_DATA_GPU_FLAGS_DEPTH_8_DISPLAY_TRANSFORM_EXCLUSIVE: int +NV_CTRL_BINARY_DATA_DISPLAYS_ON_GPU: int +NV_CTRL_BINARY_DATA_LAST_ATTRIBUTE: int +NV_CTRL_STRING_OPERATION_ADD_METAMODE: int +NV_CTRL_STRING_OPERATION_GTF_MODELINE: int +NV_CTRL_STRING_OPERATION_CVT_MODELINE: int +NV_CTRL_STRING_OPERATION_BUILD_MODEPOOL: int +NV_CTRL_STRING_OPERATION_GVI_CONFIGURE_STREAMS: int +NV_CTRL_STRING_OPERATION_PARSE_METAMODE: int +NV_CTRL_STRING_OPERATION_LAST_ATTRIBUTE: int +X_nvCtrlQueryExtension: int +X_nvCtrlQueryAttribute: int +X_nvCtrlQueryStringAttribute: int +X_nvCtrlQueryValidAttributeValues: int +X_nvCtrlSetStringAttribute: int +X_nvCtrlSetAttributeAndGetStatus: int +X_nvCtrlQueryBinaryData: int +X_nvCtrlQueryTargetCount: int +X_nvCtrlStringOperation: int +ATTRIBUTE_TYPE_UNKNOWN: int +ATTRIBUTE_TYPE_INTEGER: int +ATTRIBUTE_TYPE_BITMASK: int +ATTRIBUTE_TYPE_BOOL: int +ATTRIBUTE_TYPE_RANGE: int +ATTRIBUTE_TYPE_INT_BITS: int +ATTRIBUTE_TYPE_READ: int +ATTRIBUTE_TYPE_WRITE: int +ATTRIBUTE_TYPE_DISPLAY: int +ATTRIBUTE_TYPE_GPU: int +ATTRIBUTE_TYPE_FRAMELOCK: int +ATTRIBUTE_TYPE_X_SCREEN: int +ATTRIBUTE_TYPE_XINERAMA: int +ATTRIBUTE_TYPE_VCSC: int +NV_CTRL_TARGET_TYPE_X_SCREEN: int +NV_CTRL_TARGET_TYPE_GPU: int +NV_CTRL_TARGET_TYPE_FRAMELOCK: int +NV_CTRL_TARGET_TYPE_VCSC: int +NV_CTRL_TARGET_TYPE_GVI: int +NV_CTRL_TARGET_TYPE_COOLER: int +NV_CTRL_TARGET_TYPE_THERMAL_SENSOR: int +NV_CTRL_TARGET_TYPE_3D_VISION_PRO_TRANSCEIVER: int +NV_CTRL_TARGET_TYPE_DISPLAY: int + +class Target: + def id(self) -> int: ... + def type(self) -> int: ... + +class Gpu(Target): + def __init__(self, ngpu: int = ...) -> None: ... + +class Screen(Target): + def __init__(self, nscr: int = ...) -> None: ... + +class Cooler(Target): + def __init__(self, nfan: int = ...) -> None: ... + +class NVCtrlQueryTargetCountReplyRequest(rq.ReplyRequest): ... +class NVCtrlQueryAttributeReplyRequest(rq.ReplyRequest): ... +class NVCtrlSetAttributeAndGetStatusReplyRequest(rq.ReplyRequest): ... +class NVCtrlQueryStringAttributeReplyRequest(rq.ReplyRequest): ... +class NVCtrlQueryValidAttributeValuesReplyRequest(rq.ReplyRequest): ... +class NVCtrlQueryBinaryDataReplyRequest(rq.ReplyRequest): ... +class NVCtrlQueryListCard32ReplyRequest(rq.ReplyRequest): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/ext/randr.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/ext/randr.pyi new file mode 100644 index 000000000..f9188ddf5 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/ext/randr.pyi @@ -0,0 +1,261 @@ +from collections.abc import Sequence +from typing_extensions import TypeAlias + +from Xlib.display import Display +from Xlib.protocol import request, rq +from Xlib.xobject import drawable, resource + +_RandRModeInfo13IntSequence: TypeAlias = Sequence[int] + +extname: str +RRScreenChangeNotify: int +RRNotify: int +RRNotify_CrtcChange: int +RRNotify_OutputChange: int +RRNotify_OutputProperty: int +RRScreenChangeNotifyMask: int +RRCrtcChangeNotifyMask: int +RROutputChangeNotifyMask: int +RROutputPropertyNotifyMask: int +SetConfigSuccess: int +SetConfigInvalidConfigTime: int +SetConfigInvalidTime: int +SetConfigFailed: int +Rotate_0: int +Rotate_90: int +Rotate_180: int +Rotate_270: int +Reflect_X: int +Reflect_Y: int +HSyncPositive: int +HSyncNegative: int +VSyncPositive: int +VSyncNegative: int +Interlace: int +DoubleScan: int +CSync: int +CSyncPositive: int +CSyncNegative: int +HSkewPresent: int +BCast: int +PixelMultiplex: int +DoubleClock: int +ClockDivideBy2: int +Connected: int +Disconnected: int +UnknownConnection: int +PROPERTY_RANDR_EDID: str +PROPERTY_SIGNAL_FORMAT: str +PROPERTY_SIGNAL_PROPERTIES: str +PROPERTY_CONNECTOR_TYPE: str +PROPERTY_CONNECTOR_NUMBER: str +PROPERTY_COMPATIBILITY_LIST: str +PROPERTY_CLONE_LIST: str +SubPixelUnknown: int +SubPixelHorizontalRGB: int +SubPixelHorizontalBGR: int +SubPixelVerticalRGB: int +SubPixelVerticalBGR: int +SubPixelNone: int +BadRROutput: int +BadRRCrtc: int +BadRRMode: int + +class BadRROutputError(Exception): ... +class BadRRCrtcError(Exception): ... +class BadRRModeError(Exception): ... + +RandR_ScreenSizes: rq.Struct +RandR_ModeInfo: rq.Struct +RandR_Rates: rq.Struct +Render_Transform: rq.Struct +MonitorInfo: rq.Struct + +class QueryVersion(rq.ReplyRequest): ... + +def query_version(self: Display | resource.Resource) -> QueryVersion: ... + +class _1_0SetScreenConfig(rq.ReplyRequest): ... +class SetScreenConfig(rq.ReplyRequest): ... + +def set_screen_config( + self: drawable.Drawable, size_id: int, rotation: int, config_timestamp: int, rate: int = ..., timestamp: int = ... +) -> SetScreenConfig: ... + +class SelectInput(rq.Request): ... + +def select_input(self: drawable.Window, mask: int) -> SelectInput: ... + +class GetScreenInfo(rq.ReplyRequest): ... + +def get_screen_info(self: drawable.Window) -> GetScreenInfo: ... + +class GetScreenSizeRange(rq.ReplyRequest): ... + +def get_screen_size_range(self: drawable.Window) -> GetScreenSizeRange: ... + +class SetScreenSize(rq.Request): ... + +def set_screen_size( + self: drawable.Window, + width: int, + height: int, + width_in_millimeters: int | None = ..., + height_in_millimeters: int | None = ..., +) -> SetScreenSize: ... + +class GetScreenResources(rq.ReplyRequest): ... + +def get_screen_resources(self: drawable.Window) -> GetScreenResources: ... + +class GetOutputInfo(rq.ReplyRequest): ... + +def get_output_info(self: Display | resource.Resource, output: int, config_timestamp: int) -> GetOutputInfo: ... + +class ListOutputProperties(rq.ReplyRequest): ... + +def list_output_properties(self: Display | resource.Resource, output: int) -> ListOutputProperties: ... + +class QueryOutputProperty(rq.ReplyRequest): ... + +def query_output_property(self: Display | resource.Resource, output: int, property: int) -> QueryOutputProperty: ... + +class ConfigureOutputProperty(rq.Request): ... + +def configure_output_property(self: Display | resource.Resource, output: int, property: int) -> ConfigureOutputProperty: ... + +class ChangeOutputProperty(rq.Request): ... + +def change_output_property( + self: Display | resource.Resource, output: int, property: int, type: int, mode: int, value: Sequence[float] | Sequence[str] +) -> ChangeOutputProperty: ... + +class DeleteOutputProperty(rq.Request): ... + +def delete_output_property(self: Display | resource.Resource, output: int, property: int) -> DeleteOutputProperty: ... + +class GetOutputProperty(rq.ReplyRequest): ... + +def get_output_property( + self: Display | resource.Resource, + output: int, + property: int, + type: int, + long_offset: int, + long_length: int, + delete: bool = ..., + pending: bool = ..., +) -> GetOutputProperty: ... + +class CreateMode(rq.ReplyRequest): ... + +def create_mode(self: drawable.Window, mode: _RandRModeInfo13IntSequence, name: str) -> CreateMode: ... + +class DestroyMode(rq.Request): ... + +def destroy_mode(self: Display | resource.Resource, mode: int) -> DestroyMode: ... + +class AddOutputMode(rq.Request): ... + +def add_output_mode(self: Display | resource.Resource, output: int, mode: int) -> AddOutputMode: ... + +class DeleteOutputMode(rq.Request): ... + +def delete_output_mode(self: Display | resource.Resource, output: int, mode: int) -> DeleteOutputMode: ... + +class GetCrtcInfo(rq.ReplyRequest): ... + +def get_crtc_info(self: Display | resource.Resource, crtc: int, config_timestamp: int) -> GetCrtcInfo: ... + +class SetCrtcConfig(rq.ReplyRequest): ... + +def set_crtc_config( + self: Display | resource.Resource, + crtc: int, + config_timestamp: int, + x: int, + y: int, + mode: int, + rotation: int, + outputs: Sequence[int], + timestamp: int = ..., +) -> SetCrtcConfig: ... + +class GetCrtcGammaSize(rq.ReplyRequest): ... + +def get_crtc_gamma_size(self: Display | resource.Resource, crtc: int) -> GetCrtcGammaSize: ... + +class GetCrtcGamma(rq.ReplyRequest): ... + +def get_crtc_gamma(self: Display | resource.Resource, crtc: int) -> GetCrtcGamma: ... + +class SetCrtcGamma(rq.Request): ... + +def set_crtc_gamma( + self: Display | resource.Resource, crtc: int, size: int, red: Sequence[int], green: Sequence[int], blue: Sequence[int] +) -> SetCrtcGamma: ... + +class GetScreenResourcesCurrent(rq.ReplyRequest): ... + +def get_screen_resources_current(self: drawable.Window) -> GetScreenResourcesCurrent: ... + +class SetCrtcTransform(rq.Request): ... + +def set_crtc_transform(self: Display | resource.Resource, crtc: int, n_bytes_filter: Sequence[int]) -> SetCrtcTransform: ... + +class GetCrtcTransform(rq.ReplyRequest): ... + +def get_crtc_transform(self: Display | resource.Resource, crtc: int) -> GetCrtcTransform: ... + +class GetPanning(rq.ReplyRequest): ... + +def get_panning(self: Display | resource.Resource, crtc: int) -> GetPanning: ... + +class SetPanning(rq.ReplyRequest): ... + +def set_panning( + self: Display | resource.Resource, + crtc: int, + left: int, + top: int, + width: int, + height: int, + track_left: int, + track_top: int, + track_width: int, + track_height: int, + border_left: int, + border_top: int, + border_width: int, + border_height: int, + timestamp: int = ..., +) -> SetPanning: ... + +class SetOutputPrimary(rq.Request): ... + +def set_output_primary(self: drawable.Window, output: int) -> SetOutputPrimary: ... + +class GetOutputPrimary(rq.ReplyRequest): ... + +def get_output_primary(self: drawable.Window) -> GetOutputPrimary: ... + +class GetMonitors(rq.ReplyRequest): ... + +def get_monitors(self: drawable.Window, is_active: bool = ...) -> GetMonitors: ... + +class SetMonitor(rq.Request): ... + +def set_monitor( + self: drawable.Window, monitor_info: tuple[int, bool, bool, Sequence[int], int, int, int, int, int] +) -> SetMonitor: ... + +class DeleteMonitor(rq.Request): ... + +def delete_monitor(self: Display | resource.Resource, name: str) -> DeleteMonitor: ... + +class ScreenChangeNotify(rq.Event): ... +class CrtcChangeNotify(rq.Event): ... +class OutputChangeNotify(rq.Event): ... +class OutputPropertyNotify(rq.Event): ... + +def init(disp: Display, info: request.QueryExtension) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/ext/record.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/ext/record.pyi new file mode 100644 index 000000000..bfbb971f4 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/ext/record.pyi @@ -0,0 +1,113 @@ +from collections.abc import Callable, Sequence, Sized +from typing import Any, TypeVar +from typing_extensions import Literal + +from Xlib._typing import Unused +from Xlib.display import Display +from Xlib.protocol import display, rq +from Xlib.xobject import resource + +_T = TypeVar("_T") +_S = TypeVar("_S", bound=Sized) + +extname: str +FromServerTime: int +FromClientTime: int +FromClientSequence: int +CurrentClients: int +FutureClients: int +AllClients: int +FromServer: int +FromClient: int +ClientStarted: int +ClientDied: int +StartOfData: int +EndOfData: int +Record_Range8: rq.Struct +Record_Range16: rq.Struct +Record_ExtRange: rq.Struct +Record_Range: rq.Struct +Record_ClientInfo: rq.Struct + +class RawField(rq.ValueField): + structcode: None + def pack_value(self, val: _S) -> tuple[_S, int, None]: ... # type: ignore[override] + def parse_binary_value(self, data: _T, display: Unused, length: Unused, format: Unused) -> tuple[_T, Literal[""]]: ... # type: ignore[override] # See: https://github.com/python-xlib/python-xlib/pull/249 + +class GetVersion(rq.ReplyRequest): ... + +def get_version(self: Display | resource.Resource, major: int, minor: int) -> GetVersion: ... + +class CreateContext(rq.Request): ... + +def create_context( + self: Display | resource.Resource, + datum_flags: int, + clients: Sequence[int], + ranges: Sequence[ + tuple[ + tuple[int, int], + tuple[int, int], + tuple[int, int], + tuple[int, int], + tuple[int, int], + tuple[int, int], + tuple[int, int], + bool, + bool, + ] + ], +) -> int: ... + +class RegisterClients(rq.Request): ... + +def register_clients( + self: Display | resource.Resource, + context: int, + element_header: int, + clients: int, + ranges: Sequence[ + tuple[ + tuple[int, int], + tuple[int, int], + tuple[int, int], + tuple[int, int], + tuple[int, int], + tuple[int, int], + tuple[int, int], + bool, + bool, + ] + ], +) -> None: ... + +class UnregisterClients(rq.Request): ... + +def unregister_clients(self: Display | resource.Resource, context: int, clients: Sequence[int]) -> None: ... + +class GetContext(rq.ReplyRequest): ... + +def get_context(self: Display | resource.Resource, context: int) -> GetContext: ... + +class EnableContext(rq.ReplyRequest): + def __init__( + self, + callback: Callable[[rq.DictWrapper | dict[str, Any]], Any], + display: display.Display, + defer: bool = ..., + *args: object | bool, + **keys: object | bool, + ) -> None: ... + +def enable_context( + self: Display | resource.Resource, context: int, callback: Callable[[rq.DictWrapper | dict[str, Any]], Any] +) -> None: ... + +class DisableContext(rq.Request): ... + +def disable_context(self: Display | resource.Resource, context: int) -> None: ... + +class FreeContext(rq.Request): ... + +def free_context(self: Display | resource.Resource, context: int) -> None: ... +def init(disp: Display, info: Unused) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/ext/res.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/ext/res.pyi new file mode 100644 index 000000000..48ecc7c9f --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/ext/res.pyi @@ -0,0 +1,61 @@ +from collections.abc import Sequence + +from Xlib._typing import Unused +from Xlib.display import Display +from Xlib.protocol import rq +from Xlib.xobject import resource + +RES_MAJOR_VERSION: int +RES_MINOR_VERSION: int +extname: str +ResQueryVersion: int +ResQueryClients: int +ResQueryClientResources: int +ResQueryClientPixmapBytes: int +ResQueryClientIds: int +ResQueryResourceBytes: int + +class QueryVersion(rq.ReplyRequest): ... + +def query_version(self: Display | resource.Resource, client_major: int = ..., client_minor: int = ...) -> QueryVersion: ... + +Client: rq.Struct + +class QueryClients(rq.ReplyRequest): ... + +def query_clients(self: Display | resource.Resource) -> QueryClients: ... + +Type: rq.Struct + +class QueryClientResources(rq.ReplyRequest): ... + +def query_client_resources(self: Display | resource.Resource, client: int) -> QueryClientResources: ... + +class QueryClientPixmapBytes(rq.ReplyRequest): ... + +def query_client_pixmap_bytes(self: Display | resource.Resource, client: int) -> QueryClientPixmapBytes: ... + +class SizeOf(rq.LengthOf): + item_size: int + def __init__(self, name: str | list[str] | tuple[str, ...], size: int, item_size: int) -> None: ... + def parse_value(self, length: int, display: Unused) -> int: ... # type: ignore[override] + +ClientXIDMask: int +LocalClientPIDMask: int +ClientIdSpec: rq.Struct +ClientIdValue: rq.Struct + +class QueryClientIds(rq.ReplyRequest): ... + +def query_client_ids(self: Display | resource.Resource, specs: Sequence[tuple[int, int]]) -> QueryClientIds: ... + +ResourceIdSpec: rq.Struct +ResourceSizeSpec: rq.Struct +ResourceSizeValue: rq.Struct + +class QueryResourceBytes(rq.ReplyRequest): ... + +def query_resource_bytes( + self: Display | resource.Resource, client: int, specs: Sequence[tuple[int, int]] +) -> QueryResourceBytes: ... +def init(disp: Display, info: Unused) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/ext/screensaver.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/ext/screensaver.pyi new file mode 100644 index 000000000..9ccf5cbc7 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/ext/screensaver.pyi @@ -0,0 +1,50 @@ +from Xlib._typing import ErrorHandler +from Xlib.display import Display +from Xlib.protocol import request, rq +from Xlib.xobject import drawable + +extname: str +NotifyMask: int +CycleMask: int +StateOff: int +StateOn: int +StateCycle: int +KindBlanked: int +KindInternal: int +KindExternal: int + +class QueryVersion(rq.ReplyRequest): ... + +def query_version(self: drawable.Drawable) -> QueryVersion: ... + +class QueryInfo(rq.ReplyRequest): ... + +def query_info(self: drawable.Drawable) -> QueryInfo: ... + +class SelectInput(rq.Request): ... + +def select_input(self: drawable.Drawable, mask: int) -> SelectInput: ... + +class SetAttributes(rq.Request): ... + +def set_attributes( + self: drawable.Drawable, + x: int, + y: int, + width: int, + height: int, + border_width: int, + window_class: int = ..., + depth: int = ..., + visual: int = ..., + onerror: ErrorHandler[object] | None = ..., + **keys: object, +) -> SetAttributes: ... + +class UnsetAttributes(rq.Request): ... + +def unset_attributes(self: drawable.Drawable, onerror: ErrorHandler[object] | None = ...) -> UnsetAttributes: ... + +class Notify(rq.Event): ... + +def init(disp: Display, info: request.QueryExtension) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/ext/security.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/ext/security.pyi new file mode 100644 index 000000000..93fd4b0bd --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/ext/security.pyi @@ -0,0 +1,31 @@ +from Xlib._typing import Unused +from Xlib.display import Display +from Xlib.protocol import rq +from Xlib.xobject import resource + +extname: str +SecurityClientTrusted: int +SecurityClientUntrusted: int +SecurityAuthorizationRevokedMask: int +AUTHID = rq.Card32 + +class QueryVersion(rq.ReplyRequest): ... + +def query_version(self: Display | resource.Resource) -> QueryVersion: ... + +class SecurityGenerateAuthorization(rq.ReplyRequest): ... + +def generate_authorization( + self: Display | resource.Resource, + auth_proto: str, + auth_data: bytes | bytearray = ..., + timeout: int | None = ..., + trust_level: int | None = ..., + group: int | None = ..., + event_mask: int | None = ..., +) -> SecurityGenerateAuthorization: ... + +class SecurityRevokeAuthorization(rq.Request): ... + +def revoke_authorization(self: Display | resource.Resource, authid: int) -> SecurityRevokeAuthorization: ... +def init(disp: Display, info: Unused) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/ext/shape.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/ext/shape.pyi new file mode 100644 index 000000000..67d0ed774 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/ext/shape.pyi @@ -0,0 +1,61 @@ +from collections.abc import Sequence + +from Xlib.display import Display +from Xlib.protocol import request, rq +from Xlib.protocol.structs import _Rectangle4IntSequence +from Xlib.xobject import drawable, resource + +extname: str +OP = rq.Card8 + +class SO: + Set: int + Union: int + Intersect: int + Subtract: int + Invert: int + +class SK: + Bounding: int + Clip: int + Input: int + +class KIND(rq.Set): + def __init__(self, name: str) -> None: ... + +class NotifyEventData(rq.Event): ... +class QueryVersion(rq.ReplyRequest): ... +class Rectangles(rq.Request): ... +class Mask(rq.Request): ... +class Combine(rq.Request): ... +class Offset(rq.Request): ... +class QueryExtents(rq.ReplyRequest): ... +class SelectInput(rq.Request): ... +class InputSelected(rq.ReplyRequest): ... +class GetRectangles(rq.ReplyRequest): ... + +class Event: + Notify: int + +def combine( + self: drawable.Window, operation: int, destination_kind: int, source_kind: int, x_offset: int, y_offset: int +) -> None: ... +def get_rectangles(self: drawable.Window, source_kind: int) -> GetRectangles: ... +def input_selected(self: drawable.Window) -> InputSelected: ... +def mask( + self: drawable.Window, operation: int, destination_kind: int, x_offset: int, y_offset: int, source_bitmap: int +) -> None: ... +def offset(self: drawable.Window, destination_kind: int, x_offset: int, y_offset: int) -> None: ... +def query_extents(self: drawable.Window) -> QueryExtents: ... +def query_version(self: Display | resource.Resource) -> QueryVersion: ... +def rectangles( + self: drawable.Window, + operation: int, + destination_kind: int, + ordering: int, + x_offset: int, + y_offset: int, + rectangles: Sequence[_Rectangle4IntSequence], +) -> None: ... +def select_input(self: drawable.Window, enable: int) -> None: ... +def init(disp: Display, info: request.QueryExtension) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/ext/xfixes.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/ext/xfixes.pyi new file mode 100644 index 000000000..98509f7f2 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/ext/xfixes.pyi @@ -0,0 +1,48 @@ +from Xlib._typing import Unused +from Xlib.display import Display +from Xlib.protocol import request, rq +from Xlib.xobject import drawable, resource + +extname: str +XFixesSelectionNotify: int +XFixesCursorNotify: int +XFixesSetSelectionOwnerNotifyMask: int +XFixesSelectionWindowDestroyNotifyMask: int +XFixesSelectionClientCloseNotifyMask: int +XFixesDisplayCursorNotifyMask: int +XFixesSetSelectionOwnerNotify: int +XFixesSelectionWindowDestroyNotify: int +XFixesSelectionClientCloseNotify: int +XFixesDisplayCursorNotify: int + +class QueryVersion(rq.ReplyRequest): ... + +def query_version(self: Display | resource.Resource) -> QueryVersion: ... + +class HideCursor(rq.Request): ... + +def hide_cursor(self: drawable.Window) -> None: ... + +class ShowCursor(rq.Request): ... + +def show_cursor(self: drawable.Window) -> None: ... + +class SelectSelectionInput(rq.Request): ... + +def select_selection_input(self: Display | resource.Resource, window: int, selection: int, mask: int) -> SelectSelectionInput: ... + +class SelectionNotify(rq.Event): ... +class SetSelectionOwnerNotify(SelectionNotify): ... +class SelectionWindowDestroyNotify(SelectionNotify): ... +class SelectionClientCloseNotify(SelectionNotify): ... +class SelectCursorInput(rq.Request): ... + +def select_cursor_input(self: Display | resource.Resource, window: int, mask: int) -> SelectCursorInput: ... + +class GetCursorImage(rq.ReplyRequest): ... + +def get_cursor_image(self: Display | resource.Resource, window: Unused) -> GetCursorImage: ... + +class DisplayCursorNotify(rq.Event): ... + +def init(disp: Display, info: request.QueryExtension) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/ext/xinerama.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/ext/xinerama.pyi new file mode 100644 index 000000000..004f7cdf3 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/ext/xinerama.pyi @@ -0,0 +1,35 @@ +from Xlib._typing import Unused +from Xlib.display import Display +from Xlib.protocol import rq +from Xlib.xobject import drawable, resource + +extname: str + +class QueryVersion(rq.ReplyRequest): ... + +def query_version(self: Display | resource.Resource) -> QueryVersion: ... + +class GetState(rq.ReplyRequest): ... + +def get_state(self: drawable.Window) -> GetState: ... + +class GetScreenCount(rq.ReplyRequest): ... + +def get_screen_count(self: drawable.Window) -> GetScreenCount: ... + +class GetScreenSize(rq.ReplyRequest): ... + +def get_screen_size(self: drawable.Window, screen_no: int) -> GetScreenSize: ... + +class IsActive(rq.ReplyRequest): ... + +def is_active(self: Display | resource.Resource) -> int: ... + +class QueryScreens(rq.ReplyRequest): ... + +def query_screens(self: Display | resource.Resource) -> QueryScreens: ... + +class GetInfo(rq.ReplyRequest): ... + +def get_info(self: Display | resource.Resource, visual: int) -> None: ... +def init(disp: Display, info: Unused) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/ext/xinput.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/ext/xinput.pyi new file mode 100644 index 000000000..ef3a5486f --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/ext/xinput.pyi @@ -0,0 +1,252 @@ +from _typeshed import ReadableBuffer, SliceableBuffer +from collections.abc import Iterable, Sequence +from typing import SupportsFloat, TypeVar +from typing_extensions import SupportsIndex, TypeAlias + +from Xlib._typing import Unused +from Xlib.display import Display +from Xlib.protocol import display, request, rq +from Xlib.xobject import drawable, resource + +_T = TypeVar("_T") +_Floatable: TypeAlias = SupportsFloat | SupportsIndex | str | ReadableBuffer + +extname: str +PropertyDeleted: int +PropertyCreated: int +PropertyModified: int +NotifyNormal: int +NotifyGrab: int +NotifyUngrab: int +NotifyWhileGrabbed: int +NotifyPassiveGrab: int +NotifyPassiveUngrab: int +NotifyAncestor: int +NotifyVirtual: int +NotifyInferior: int +NotifyNonlinear: int +NotifyNonlinearVirtual: int +NotifyPointer: int +NotifyPointerRoot: int +NotifyDetailNone: int +GrabtypeButton: int +GrabtypeKeycode: int +GrabtypeEnter: int +GrabtypeFocusIn: int +GrabtypeTouchBegin: int +AnyModifier: int +AnyButton: int +AnyKeycode: int +AsyncDevice: int +SyncDevice: int +ReplayDevice: int +AsyncPairedDevice: int +AsyncPair: int +SyncPair: int +SlaveSwitch: int +DeviceChange: int +MasterAdded: int +MasterRemoved: int +SlaveAdded: int +SlaveRemoved: int +SlaveAttached: int +SlaveDetached: int +DeviceEnabled: int +DeviceDisabled: int +AddMaster: int +RemoveMaster: int +AttachSlave: int +DetachSlave: int +AttachToMaster: int +Floating: int +ModeRelative: int +ModeAbsolute: int +MasterPointer: int +MasterKeyboard: int +SlavePointer: int +SlaveKeyboard: int +FloatingSlave: int +KeyClass: int +ButtonClass: int +ValuatorClass: int +ScrollClass: int +TouchClass: int +KeyRepeat: int +AllDevices: int +AllMasterDevices: int +DeviceChanged: int +KeyPress: int +KeyRelease: int +ButtonPress: int +ButtonRelease: int +Motion: int +Enter: int +Leave: int +FocusIn: int +FocusOut: int +HierarchyChanged: int +PropertyEvent: int +RawKeyPress: int +RawKeyRelease: int +RawButtonPress: int +RawButtonRelease: int +RawMotion: int +DeviceChangedMask: int +KeyPressMask: int +KeyReleaseMask: int +ButtonPressMask: int +ButtonReleaseMask: int +MotionMask: int +EnterMask: int +LeaveMask: int +FocusInMask: int +FocusOutMask: int +HierarchyChangedMask: int +PropertyEventMask: int +RawKeyPressMask: int +RawKeyReleaseMask: int +RawButtonPressMask: int +RawButtonReleaseMask: int +RawMotionMask: int +GrabModeSync: int +GrabModeAsync: int +GrabModeTouch: int +DEVICEID = rq.Card16 +DEVICE = rq.Card16 +DEVICEUSE = rq.Card8 +PROPERTY_TYPE_FLOAT: str + +# ignore[override] because of Liskov substitution principle violations +class FP1616(rq.Int32): + def check_value(self, value: float) -> int: ... # type: ignore[override] + def parse_value(self, value: _Floatable, display: Unused) -> float: ... # type: ignore[override] + +class FP3232(rq.ValueField): + structcode: str + def check_value(self, value: _T) -> _T: ... # type: ignore[override] + def parse_value(self, value: tuple[_Floatable, _Floatable], display: Unused) -> float: ... # type: ignore[override] + +class XIQueryVersion(rq.ReplyRequest): ... + +def query_version(self: Display | resource.Resource) -> XIQueryVersion: ... + +class Mask(rq.List): + def __init__(self, name: str) -> None: ... + def pack_value(self, val: int | Iterable[int]) -> tuple[bytes, int, None]: ... # type: ignore[override] + +EventMask: rq.Struct + +class XISelectEvents(rq.Request): ... + +def select_events(self: drawable.Window, event_masks: Sequence[tuple[int, Sequence[int]]]) -> XISelectEvents: ... + +AnyInfo: rq.Struct + +class ButtonMask: + def __init__(self, value: int, length: int) -> None: ... + def __getitem__(self, key: int) -> int: ... + def __len__(self) -> int: ... + +class ButtonState(rq.ValueField): + structcode: None + def __init__(self, name: str) -> None: ... + def parse_binary_value( # type: ignore[override] # length: None will error. See: https://github.com/python-xlib/python-xlib/pull/248 + self, data: SliceableBuffer, display: Unused, length: int, fmt: Unused + ) -> tuple[ButtonMask, SliceableBuffer]: ... + +ButtonInfo: rq.Struct +KeyInfo: rq.Struct +ValuatorInfo: rq.Struct +ScrollInfo: rq.Struct +TouchInfo: rq.Struct +INFO_CLASSES: dict[int, rq.Struct] + +class ClassInfoClass: + structcode: None + def parse_binary(self, data: SliceableBuffer, display: display.Display | None) -> tuple[rq.DictWrapper, SliceableBuffer]: ... + +ClassInfo: ClassInfoClass +DeviceInfo: rq.Struct + +class XIQueryDevice(rq.ReplyRequest): ... + +def query_device(self: Display | resource.Resource, deviceid: int) -> XIQueryDevice: ... + +class XIListProperties(rq.ReplyRequest): ... + +def list_device_properties(self: Display | resource.Resource, deviceid: int) -> XIListProperties: ... + +class XIGetProperty(rq.ReplyRequest): ... + +def get_device_property( + self: Display | resource.Resource, deviceid: int, property: int, type: int, offset: int, length: int, delete: int = ... +) -> XIGetProperty: ... + +class XIChangeProperty(rq.Request): ... + +def change_device_property( + self: Display | resource.Resource, deviceid: int, property: int, type: int, mode: int, value: Sequence[float] | Sequence[str] +) -> XIChangeProperty: ... + +class XIDeleteProperty(rq.Request): ... + +def delete_device_property(self: Display | resource.Resource, deviceid: int, property: int) -> XIDeleteProperty: ... + +class XIGrabDevice(rq.ReplyRequest): ... + +def grab_device( + self: drawable.Window, + deviceid: int, + time: int, + grab_mode: int, + paired_device_mode: int, + owner_events: bool, + event_mask: Sequence[int], +) -> XIGrabDevice: ... + +class XIUngrabDevice(rq.Request): ... + +def ungrab_device(self: Display | resource.Resource, deviceid: int, time: int) -> XIUngrabDevice: ... + +class XIPassiveGrabDevice(rq.ReplyRequest): ... + +def passive_grab_device( + self: drawable.Window, + deviceid: int, + time: int, + detail: int, + grab_type: int, + grab_mode: int, + paired_device_mode: int, + owner_events: bool, + event_mask: Sequence[int], + modifiers: Sequence[int], +) -> XIPassiveGrabDevice: ... +def grab_keycode( + self: drawable.Window, + deviceid: int, + time: int, + keycode: int, + grab_mode: int, + paired_device_mode: int, + owner_events: bool, + event_mask: Sequence[int], + modifiers: Sequence[int], +) -> XIPassiveGrabDevice: ... + +class XIPassiveUngrabDevice(rq.Request): ... + +def passive_ungrab_device( + self: drawable.Window, deviceid: int, detail: int, grab_type: int, modifiers: Sequence[int] +) -> XIPassiveUngrabDevice: ... +def ungrab_keycode(self: drawable.Window, deviceid: int, keycode: int, modifiers: Sequence[int]) -> XIPassiveUngrabDevice: ... + +HierarchyInfo: rq.Struct +HierarchyEventData: rq.Struct +ModifierInfo: rq.Struct +GroupInfo: rq.Struct +DeviceEventData: rq.Struct +DeviceChangedEventData: rq.Struct +PropertyEventData: rq.Struct + +def init(disp: Display, info: request.QueryExtension) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/ext/xtest.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/ext/xtest.pyi new file mode 100644 index 000000000..d2505b771 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/ext/xtest.pyi @@ -0,0 +1,32 @@ +from Xlib._typing import Unused +from Xlib.display import Display +from Xlib.protocol import rq +from Xlib.xobject import resource + +extname: str +CurrentCursor: int + +class GetVersion(rq.ReplyRequest): ... + +def get_version(self: Display | resource.Resource, major: int, minor: int) -> GetVersion: ... + +class CompareCursor(rq.ReplyRequest): ... + +def compare_cursor(self: Display | resource.Resource, cursor: int) -> int: ... + +class FakeInput(rq.Request): ... + +def fake_input( + self: Display | resource.Resource, + event_type: int, + detail: int = ..., + time: int = ..., + root: int = ..., + x: int = ..., + y: int = ..., +) -> None: ... + +class GrabControl(rq.Request): ... + +def grab_control(self: Display | resource.Resource, impervious: bool) -> None: ... +def init(disp: Display, info: Unused) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/__init__.pyi new file mode 100644 index 000000000..ca535d0ea --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/__init__.pyi @@ -0,0 +1,43 @@ +from Xlib.keysymdef import ( + apl as apl, + arabic as arabic, + cyrillic as cyrillic, + greek as greek, + hebrew as hebrew, + katakana as katakana, + korean as korean, + latin1 as latin1, + latin2 as latin2, + latin3 as latin3, + latin4 as latin4, + miscellany as miscellany, + publishing as publishing, + special as special, + technical as technical, + thai as thai, + xf86 as xf86, + xk3270 as xk3270, + xkb as xkb, +) + +__all__ = [ + "apl", + "arabic", + "cyrillic", + "greek", + "hebrew", + "katakana", + "korean", + "latin1", + "latin2", + "latin3", + "latin4", + "miscellany", + "publishing", + "special", + "technical", + "thai", + "xf86", + "xk3270", + "xkb", +] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/apl.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/apl.pyi new file mode 100644 index 000000000..a4404d76d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/apl.pyi @@ -0,0 +1,19 @@ +XK_leftcaret: int +XK_rightcaret: int +XK_downcaret: int +XK_upcaret: int +XK_overbar: int +XK_downtack: int +XK_upshoe: int +XK_downstile: int +XK_underbar: int +XK_jot: int +XK_quad: int +XK_uptack: int +XK_circle: int +XK_upstile: int +XK_downshoe: int +XK_rightshoe: int +XK_leftshoe: int +XK_lefttack: int +XK_righttack: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/arabic.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/arabic.pyi new file mode 100644 index 000000000..ab9a7b0fc --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/arabic.pyi @@ -0,0 +1,50 @@ +XK_Arabic_comma: int +XK_Arabic_semicolon: int +XK_Arabic_question_mark: int +XK_Arabic_hamza: int +XK_Arabic_maddaonalef: int +XK_Arabic_hamzaonalef: int +XK_Arabic_hamzaonwaw: int +XK_Arabic_hamzaunderalef: int +XK_Arabic_hamzaonyeh: int +XK_Arabic_alef: int +XK_Arabic_beh: int +XK_Arabic_tehmarbuta: int +XK_Arabic_teh: int +XK_Arabic_theh: int +XK_Arabic_jeem: int +XK_Arabic_hah: int +XK_Arabic_khah: int +XK_Arabic_dal: int +XK_Arabic_thal: int +XK_Arabic_ra: int +XK_Arabic_zain: int +XK_Arabic_seen: int +XK_Arabic_sheen: int +XK_Arabic_sad: int +XK_Arabic_dad: int +XK_Arabic_tah: int +XK_Arabic_zah: int +XK_Arabic_ain: int +XK_Arabic_ghain: int +XK_Arabic_tatweel: int +XK_Arabic_feh: int +XK_Arabic_qaf: int +XK_Arabic_kaf: int +XK_Arabic_lam: int +XK_Arabic_meem: int +XK_Arabic_noon: int +XK_Arabic_ha: int +XK_Arabic_heh: int +XK_Arabic_waw: int +XK_Arabic_alefmaksura: int +XK_Arabic_yeh: int +XK_Arabic_fathatan: int +XK_Arabic_dammatan: int +XK_Arabic_kasratan: int +XK_Arabic_fatha: int +XK_Arabic_damma: int +XK_Arabic_kasra: int +XK_Arabic_shadda: int +XK_Arabic_sukun: int +XK_Arabic_switch: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/cyrillic.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/cyrillic.pyi new file mode 100644 index 000000000..a4accc99c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/cyrillic.pyi @@ -0,0 +1,107 @@ +XK_Serbian_dje: int +XK_Macedonia_gje: int +XK_Cyrillic_io: int +XK_Ukrainian_ie: int +XK_Ukranian_je: int +XK_Macedonia_dse: int +XK_Ukrainian_i: int +XK_Ukranian_i: int +XK_Ukrainian_yi: int +XK_Ukranian_yi: int +XK_Cyrillic_je: int +XK_Serbian_je: int +XK_Cyrillic_lje: int +XK_Serbian_lje: int +XK_Cyrillic_nje: int +XK_Serbian_nje: int +XK_Serbian_tshe: int +XK_Macedonia_kje: int +XK_Byelorussian_shortu: int +XK_Cyrillic_dzhe: int +XK_Serbian_dze: int +XK_numerosign: int +XK_Serbian_DJE: int +XK_Macedonia_GJE: int +XK_Cyrillic_IO: int +XK_Ukrainian_IE: int +XK_Ukranian_JE: int +XK_Macedonia_DSE: int +XK_Ukrainian_I: int +XK_Ukranian_I: int +XK_Ukrainian_YI: int +XK_Ukranian_YI: int +XK_Cyrillic_JE: int +XK_Serbian_JE: int +XK_Cyrillic_LJE: int +XK_Serbian_LJE: int +XK_Cyrillic_NJE: int +XK_Serbian_NJE: int +XK_Serbian_TSHE: int +XK_Macedonia_KJE: int +XK_Byelorussian_SHORTU: int +XK_Cyrillic_DZHE: int +XK_Serbian_DZE: int +XK_Cyrillic_yu: int +XK_Cyrillic_a: int +XK_Cyrillic_be: int +XK_Cyrillic_tse: int +XK_Cyrillic_de: int +XK_Cyrillic_ie: int +XK_Cyrillic_ef: int +XK_Cyrillic_ghe: int +XK_Cyrillic_ha: int +XK_Cyrillic_i: int +XK_Cyrillic_shorti: int +XK_Cyrillic_ka: int +XK_Cyrillic_el: int +XK_Cyrillic_em: int +XK_Cyrillic_en: int +XK_Cyrillic_o: int +XK_Cyrillic_pe: int +XK_Cyrillic_ya: int +XK_Cyrillic_er: int +XK_Cyrillic_es: int +XK_Cyrillic_te: int +XK_Cyrillic_u: int +XK_Cyrillic_zhe: int +XK_Cyrillic_ve: int +XK_Cyrillic_softsign: int +XK_Cyrillic_yeru: int +XK_Cyrillic_ze: int +XK_Cyrillic_sha: int +XK_Cyrillic_e: int +XK_Cyrillic_shcha: int +XK_Cyrillic_che: int +XK_Cyrillic_hardsign: int +XK_Cyrillic_YU: int +XK_Cyrillic_A: int +XK_Cyrillic_BE: int +XK_Cyrillic_TSE: int +XK_Cyrillic_DE: int +XK_Cyrillic_IE: int +XK_Cyrillic_EF: int +XK_Cyrillic_GHE: int +XK_Cyrillic_HA: int +XK_Cyrillic_I: int +XK_Cyrillic_SHORTI: int +XK_Cyrillic_KA: int +XK_Cyrillic_EL: int +XK_Cyrillic_EM: int +XK_Cyrillic_EN: int +XK_Cyrillic_O: int +XK_Cyrillic_PE: int +XK_Cyrillic_YA: int +XK_Cyrillic_ER: int +XK_Cyrillic_ES: int +XK_Cyrillic_TE: int +XK_Cyrillic_U: int +XK_Cyrillic_ZHE: int +XK_Cyrillic_VE: int +XK_Cyrillic_SOFTSIGN: int +XK_Cyrillic_YERU: int +XK_Cyrillic_ZE: int +XK_Cyrillic_SHA: int +XK_Cyrillic_E: int +XK_Cyrillic_SHCHA: int +XK_Cyrillic_CHE: int +XK_Cyrillic_HARDSIGN: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/greek.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/greek.pyi new file mode 100644 index 000000000..7460ea2e6 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/greek.pyi @@ -0,0 +1,74 @@ +XK_Greek_ALPHAaccent: int +XK_Greek_EPSILONaccent: int +XK_Greek_ETAaccent: int +XK_Greek_IOTAaccent: int +XK_Greek_IOTAdiaeresis: int +XK_Greek_OMICRONaccent: int +XK_Greek_UPSILONaccent: int +XK_Greek_UPSILONdieresis: int +XK_Greek_OMEGAaccent: int +XK_Greek_accentdieresis: int +XK_Greek_horizbar: int +XK_Greek_alphaaccent: int +XK_Greek_epsilonaccent: int +XK_Greek_etaaccent: int +XK_Greek_iotaaccent: int +XK_Greek_iotadieresis: int +XK_Greek_iotaaccentdieresis: int +XK_Greek_omicronaccent: int +XK_Greek_upsilonaccent: int +XK_Greek_upsilondieresis: int +XK_Greek_upsilonaccentdieresis: int +XK_Greek_omegaaccent: int +XK_Greek_ALPHA: int +XK_Greek_BETA: int +XK_Greek_GAMMA: int +XK_Greek_DELTA: int +XK_Greek_EPSILON: int +XK_Greek_ZETA: int +XK_Greek_ETA: int +XK_Greek_THETA: int +XK_Greek_IOTA: int +XK_Greek_KAPPA: int +XK_Greek_LAMDA: int +XK_Greek_LAMBDA: int +XK_Greek_MU: int +XK_Greek_NU: int +XK_Greek_XI: int +XK_Greek_OMICRON: int +XK_Greek_PI: int +XK_Greek_RHO: int +XK_Greek_SIGMA: int +XK_Greek_TAU: int +XK_Greek_UPSILON: int +XK_Greek_PHI: int +XK_Greek_CHI: int +XK_Greek_PSI: int +XK_Greek_OMEGA: int +XK_Greek_alpha: int +XK_Greek_beta: int +XK_Greek_gamma: int +XK_Greek_delta: int +XK_Greek_epsilon: int +XK_Greek_zeta: int +XK_Greek_eta: int +XK_Greek_theta: int +XK_Greek_iota: int +XK_Greek_kappa: int +XK_Greek_lamda: int +XK_Greek_lambda: int +XK_Greek_mu: int +XK_Greek_nu: int +XK_Greek_xi: int +XK_Greek_omicron: int +XK_Greek_pi: int +XK_Greek_rho: int +XK_Greek_sigma: int +XK_Greek_finalsmallsigma: int +XK_Greek_tau: int +XK_Greek_upsilon: int +XK_Greek_phi: int +XK_Greek_chi: int +XK_Greek_psi: int +XK_Greek_omega: int +XK_Greek_switch: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/hebrew.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/hebrew.pyi new file mode 100644 index 000000000..5ad28bf8f --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/hebrew.pyi @@ -0,0 +1,40 @@ +XK_hebrew_doublelowline: int +XK_hebrew_aleph: int +XK_hebrew_bet: int +XK_hebrew_beth: int +XK_hebrew_gimel: int +XK_hebrew_gimmel: int +XK_hebrew_dalet: int +XK_hebrew_daleth: int +XK_hebrew_he: int +XK_hebrew_waw: int +XK_hebrew_zain: int +XK_hebrew_zayin: int +XK_hebrew_chet: int +XK_hebrew_het: int +XK_hebrew_tet: int +XK_hebrew_teth: int +XK_hebrew_yod: int +XK_hebrew_finalkaph: int +XK_hebrew_kaph: int +XK_hebrew_lamed: int +XK_hebrew_finalmem: int +XK_hebrew_mem: int +XK_hebrew_finalnun: int +XK_hebrew_nun: int +XK_hebrew_samech: int +XK_hebrew_samekh: int +XK_hebrew_ayin: int +XK_hebrew_finalpe: int +XK_hebrew_pe: int +XK_hebrew_finalzade: int +XK_hebrew_finalzadi: int +XK_hebrew_zade: int +XK_hebrew_zadi: int +XK_hebrew_qoph: int +XK_hebrew_kuf: int +XK_hebrew_resh: int +XK_hebrew_shin: int +XK_hebrew_taw: int +XK_hebrew_taf: int +XK_Hebrew_switch: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/katakana.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/katakana.pyi new file mode 100644 index 000000000..2480a14c3 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/katakana.pyi @@ -0,0 +1,70 @@ +XK_overline: int +XK_kana_fullstop: int +XK_kana_openingbracket: int +XK_kana_closingbracket: int +XK_kana_comma: int +XK_kana_conjunctive: int +XK_kana_middledot: int +XK_kana_WO: int +XK_kana_a: int +XK_kana_i: int +XK_kana_u: int +XK_kana_e: int +XK_kana_o: int +XK_kana_ya: int +XK_kana_yu: int +XK_kana_yo: int +XK_kana_tsu: int +XK_kana_tu: int +XK_prolongedsound: int +XK_kana_A: int +XK_kana_I: int +XK_kana_U: int +XK_kana_E: int +XK_kana_O: int +XK_kana_KA: int +XK_kana_KI: int +XK_kana_KU: int +XK_kana_KE: int +XK_kana_KO: int +XK_kana_SA: int +XK_kana_SHI: int +XK_kana_SU: int +XK_kana_SE: int +XK_kana_SO: int +XK_kana_TA: int +XK_kana_CHI: int +XK_kana_TI: int +XK_kana_TSU: int +XK_kana_TU: int +XK_kana_TE: int +XK_kana_TO: int +XK_kana_NA: int +XK_kana_NI: int +XK_kana_NU: int +XK_kana_NE: int +XK_kana_NO: int +XK_kana_HA: int +XK_kana_HI: int +XK_kana_FU: int +XK_kana_HU: int +XK_kana_HE: int +XK_kana_HO: int +XK_kana_MA: int +XK_kana_MI: int +XK_kana_MU: int +XK_kana_ME: int +XK_kana_MO: int +XK_kana_YA: int +XK_kana_YU: int +XK_kana_YO: int +XK_kana_RA: int +XK_kana_RI: int +XK_kana_RU: int +XK_kana_RE: int +XK_kana_RO: int +XK_kana_WA: int +XK_kana_N: int +XK_voicedsound: int +XK_semivoicedsound: int +XK_kana_switch: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/korean.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/korean.pyi new file mode 100644 index 000000000..c3bb31279 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/korean.pyi @@ -0,0 +1,107 @@ +XK_Hangul: int +XK_Hangul_Start: int +XK_Hangul_End: int +XK_Hangul_Hanja: int +XK_Hangul_Jamo: int +XK_Hangul_Romaja: int +XK_Hangul_Codeinput: int +XK_Hangul_Jeonja: int +XK_Hangul_Banja: int +XK_Hangul_PreHanja: int +XK_Hangul_PostHanja: int +XK_Hangul_SingleCandidate: int +XK_Hangul_MultipleCandidate: int +XK_Hangul_PreviousCandidate: int +XK_Hangul_Special: int +XK_Hangul_switch: int +XK_Hangul_Kiyeog: int +XK_Hangul_SsangKiyeog: int +XK_Hangul_KiyeogSios: int +XK_Hangul_Nieun: int +XK_Hangul_NieunJieuj: int +XK_Hangul_NieunHieuh: int +XK_Hangul_Dikeud: int +XK_Hangul_SsangDikeud: int +XK_Hangul_Rieul: int +XK_Hangul_RieulKiyeog: int +XK_Hangul_RieulMieum: int +XK_Hangul_RieulPieub: int +XK_Hangul_RieulSios: int +XK_Hangul_RieulTieut: int +XK_Hangul_RieulPhieuf: int +XK_Hangul_RieulHieuh: int +XK_Hangul_Mieum: int +XK_Hangul_Pieub: int +XK_Hangul_SsangPieub: int +XK_Hangul_PieubSios: int +XK_Hangul_Sios: int +XK_Hangul_SsangSios: int +XK_Hangul_Ieung: int +XK_Hangul_Jieuj: int +XK_Hangul_SsangJieuj: int +XK_Hangul_Cieuc: int +XK_Hangul_Khieuq: int +XK_Hangul_Tieut: int +XK_Hangul_Phieuf: int +XK_Hangul_Hieuh: int +XK_Hangul_A: int +XK_Hangul_AE: int +XK_Hangul_YA: int +XK_Hangul_YAE: int +XK_Hangul_EO: int +XK_Hangul_E: int +XK_Hangul_YEO: int +XK_Hangul_YE: int +XK_Hangul_O: int +XK_Hangul_WA: int +XK_Hangul_WAE: int +XK_Hangul_OE: int +XK_Hangul_YO: int +XK_Hangul_U: int +XK_Hangul_WEO: int +XK_Hangul_WE: int +XK_Hangul_WI: int +XK_Hangul_YU: int +XK_Hangul_EU: int +XK_Hangul_YI: int +XK_Hangul_I: int +XK_Hangul_J_Kiyeog: int +XK_Hangul_J_SsangKiyeog: int +XK_Hangul_J_KiyeogSios: int +XK_Hangul_J_Nieun: int +XK_Hangul_J_NieunJieuj: int +XK_Hangul_J_NieunHieuh: int +XK_Hangul_J_Dikeud: int +XK_Hangul_J_Rieul: int +XK_Hangul_J_RieulKiyeog: int +XK_Hangul_J_RieulMieum: int +XK_Hangul_J_RieulPieub: int +XK_Hangul_J_RieulSios: int +XK_Hangul_J_RieulTieut: int +XK_Hangul_J_RieulPhieuf: int +XK_Hangul_J_RieulHieuh: int +XK_Hangul_J_Mieum: int +XK_Hangul_J_Pieub: int +XK_Hangul_J_PieubSios: int +XK_Hangul_J_Sios: int +XK_Hangul_J_SsangSios: int +XK_Hangul_J_Ieung: int +XK_Hangul_J_Jieuj: int +XK_Hangul_J_Cieuc: int +XK_Hangul_J_Khieuq: int +XK_Hangul_J_Tieut: int +XK_Hangul_J_Phieuf: int +XK_Hangul_J_Hieuh: int +XK_Hangul_RieulYeorinHieuh: int +XK_Hangul_SunkyeongeumMieum: int +XK_Hangul_SunkyeongeumPieub: int +XK_Hangul_PanSios: int +XK_Hangul_KkogjiDalrinIeung: int +XK_Hangul_SunkyeongeumPhieuf: int +XK_Hangul_YeorinHieuh: int +XK_Hangul_AraeA: int +XK_Hangul_AraeAE: int +XK_Hangul_J_PanSios: int +XK_Hangul_J_KkogjiDalrinIeung: int +XK_Hangul_J_YeorinHieuh: int +XK_Korean_Won: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/latin1.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/latin1.pyi new file mode 100644 index 000000000..6a80d5913 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/latin1.pyi @@ -0,0 +1,195 @@ +XK_space: int +XK_exclam: int +XK_quotedbl: int +XK_numbersign: int +XK_dollar: int +XK_percent: int +XK_ampersand: int +XK_apostrophe: int +XK_quoteright: int +XK_parenleft: int +XK_parenright: int +XK_asterisk: int +XK_plus: int +XK_comma: int +XK_minus: int +XK_period: int +XK_slash: int +XK_0: int +XK_1: int +XK_2: int +XK_3: int +XK_4: int +XK_5: int +XK_6: int +XK_7: int +XK_8: int +XK_9: int +XK_colon: int +XK_semicolon: int +XK_less: int +XK_equal: int +XK_greater: int +XK_question: int +XK_at: int +XK_A: int +XK_B: int +XK_C: int +XK_D: int +XK_E: int +XK_F: int +XK_G: int +XK_H: int +XK_I: int +XK_J: int +XK_K: int +XK_L: int +XK_M: int +XK_N: int +XK_O: int +XK_P: int +XK_Q: int +XK_R: int +XK_S: int +XK_T: int +XK_U: int +XK_V: int +XK_W: int +XK_X: int +XK_Y: int +XK_Z: int +XK_bracketleft: int +XK_backslash: int +XK_bracketright: int +XK_asciicircum: int +XK_underscore: int +XK_grave: int +XK_quoteleft: int +XK_a: int +XK_b: int +XK_c: int +XK_d: int +XK_e: int +XK_f: int +XK_g: int +XK_h: int +XK_i: int +XK_j: int +XK_k: int +XK_l: int +XK_m: int +XK_n: int +XK_o: int +XK_p: int +XK_q: int +XK_r: int +XK_s: int +XK_t: int +XK_u: int +XK_v: int +XK_w: int +XK_x: int +XK_y: int +XK_z: int +XK_braceleft: int +XK_bar: int +XK_braceright: int +XK_asciitilde: int +XK_nobreakspace: int +XK_exclamdown: int +XK_cent: int +XK_sterling: int +XK_currency: int +XK_yen: int +XK_brokenbar: int +XK_section: int +XK_diaeresis: int +XK_copyright: int +XK_ordfeminine: int +XK_guillemotleft: int +XK_notsign: int +XK_hyphen: int +XK_registered: int +XK_macron: int +XK_degree: int +XK_plusminus: int +XK_twosuperior: int +XK_threesuperior: int +XK_acute: int +XK_mu: int +XK_paragraph: int +XK_periodcentered: int +XK_cedilla: int +XK_onesuperior: int +XK_masculine: int +XK_guillemotright: int +XK_onequarter: int +XK_onehalf: int +XK_threequarters: int +XK_questiondown: int +XK_Agrave: int +XK_Aacute: int +XK_Acircumflex: int +XK_Atilde: int +XK_Adiaeresis: int +XK_Aring: int +XK_AE: int +XK_Ccedilla: int +XK_Egrave: int +XK_Eacute: int +XK_Ecircumflex: int +XK_Ediaeresis: int +XK_Igrave: int +XK_Iacute: int +XK_Icircumflex: int +XK_Idiaeresis: int +XK_ETH: int +XK_Eth: int +XK_Ntilde: int +XK_Ograve: int +XK_Oacute: int +XK_Ocircumflex: int +XK_Otilde: int +XK_Odiaeresis: int +XK_multiply: int +XK_Ooblique: int +XK_Ugrave: int +XK_Uacute: int +XK_Ucircumflex: int +XK_Udiaeresis: int +XK_Yacute: int +XK_THORN: int +XK_Thorn: int +XK_ssharp: int +XK_agrave: int +XK_aacute: int +XK_acircumflex: int +XK_atilde: int +XK_adiaeresis: int +XK_aring: int +XK_ae: int +XK_ccedilla: int +XK_egrave: int +XK_eacute: int +XK_ecircumflex: int +XK_ediaeresis: int +XK_igrave: int +XK_iacute: int +XK_icircumflex: int +XK_idiaeresis: int +XK_eth: int +XK_ntilde: int +XK_ograve: int +XK_oacute: int +XK_ocircumflex: int +XK_otilde: int +XK_odiaeresis: int +XK_division: int +XK_oslash: int +XK_ugrave: int +XK_uacute: int +XK_ucircumflex: int +XK_udiaeresis: int +XK_yacute: int +XK_thorn: int +XK_ydiaeresis: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/latin2.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/latin2.pyi new file mode 100644 index 000000000..308f7277d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/latin2.pyi @@ -0,0 +1,57 @@ +XK_Aogonek: int +XK_breve: int +XK_Lstroke: int +XK_Lcaron: int +XK_Sacute: int +XK_Scaron: int +XK_Scedilla: int +XK_Tcaron: int +XK_Zacute: int +XK_Zcaron: int +XK_Zabovedot: int +XK_aogonek: int +XK_ogonek: int +XK_lstroke: int +XK_lcaron: int +XK_sacute: int +XK_caron: int +XK_scaron: int +XK_scedilla: int +XK_tcaron: int +XK_zacute: int +XK_doubleacute: int +XK_zcaron: int +XK_zabovedot: int +XK_Racute: int +XK_Abreve: int +XK_Lacute: int +XK_Cacute: int +XK_Ccaron: int +XK_Eogonek: int +XK_Ecaron: int +XK_Dcaron: int +XK_Dstroke: int +XK_Nacute: int +XK_Ncaron: int +XK_Odoubleacute: int +XK_Rcaron: int +XK_Uring: int +XK_Udoubleacute: int +XK_Tcedilla: int +XK_racute: int +XK_abreve: int +XK_lacute: int +XK_cacute: int +XK_ccaron: int +XK_eogonek: int +XK_ecaron: int +XK_dcaron: int +XK_dstroke: int +XK_nacute: int +XK_ncaron: int +XK_odoubleacute: int +XK_udoubleacute: int +XK_rcaron: int +XK_uring: int +XK_tcedilla: int +XK_abovedot: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/latin3.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/latin3.pyi new file mode 100644 index 000000000..dd8030813 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/latin3.pyi @@ -0,0 +1,22 @@ +XK_Hstroke: int +XK_Hcircumflex: int +XK_Iabovedot: int +XK_Gbreve: int +XK_Jcircumflex: int +XK_hstroke: int +XK_hcircumflex: int +XK_idotless: int +XK_gbreve: int +XK_jcircumflex: int +XK_Cabovedot: int +XK_Ccircumflex: int +XK_Gabovedot: int +XK_Gcircumflex: int +XK_Ubreve: int +XK_Scircumflex: int +XK_cabovedot: int +XK_ccircumflex: int +XK_gabovedot: int +XK_gcircumflex: int +XK_ubreve: int +XK_scircumflex: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/latin4.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/latin4.pyi new file mode 100644 index 000000000..278d7cc91 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/latin4.pyi @@ -0,0 +1,36 @@ +XK_kra: int +XK_kappa: int +XK_Rcedilla: int +XK_Itilde: int +XK_Lcedilla: int +XK_Emacron: int +XK_Gcedilla: int +XK_Tslash: int +XK_rcedilla: int +XK_itilde: int +XK_lcedilla: int +XK_emacron: int +XK_gcedilla: int +XK_tslash: int +XK_ENG: int +XK_eng: int +XK_Amacron: int +XK_Iogonek: int +XK_Eabovedot: int +XK_Imacron: int +XK_Ncedilla: int +XK_Omacron: int +XK_Kcedilla: int +XK_Uogonek: int +XK_Utilde: int +XK_Umacron: int +XK_amacron: int +XK_iogonek: int +XK_eabovedot: int +XK_imacron: int +XK_ncedilla: int +XK_omacron: int +XK_kcedilla: int +XK_uogonek: int +XK_utilde: int +XK_umacron: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/miscellany.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/miscellany.pyi new file mode 100644 index 000000000..ecf77b848 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/miscellany.pyi @@ -0,0 +1,169 @@ +XK_BackSpace: int +XK_Tab: int +XK_Linefeed: int +XK_Clear: int +XK_Return: int +XK_Pause: int +XK_Scroll_Lock: int +XK_Sys_Req: int +XK_Escape: int +XK_Delete: int +XK_Multi_key: int +XK_SingleCandidate: int +XK_MultipleCandidate: int +XK_PreviousCandidate: int +XK_Kanji: int +XK_Muhenkan: int +XK_Henkan_Mode: int +XK_Henkan: int +XK_Romaji: int +XK_Hiragana: int +XK_Katakana: int +XK_Hiragana_Katakana: int +XK_Zenkaku: int +XK_Hankaku: int +XK_Zenkaku_Hankaku: int +XK_Touroku: int +XK_Massyo: int +XK_Kana_Lock: int +XK_Kana_Shift: int +XK_Eisu_Shift: int +XK_Eisu_toggle: int +XK_Zen_Koho: int +XK_Mae_Koho: int +XK_Home: int +XK_Left: int +XK_Up: int +XK_Right: int +XK_Down: int +XK_Prior: int +XK_Page_Up: int +XK_Next: int +XK_Page_Down: int +XK_End: int +XK_Begin: int +XK_Select: int +XK_Print: int +XK_Execute: int +XK_Insert: int +XK_Undo: int +XK_Redo: int +XK_Menu: int +XK_Find: int +XK_Cancel: int +XK_Help: int +XK_Break: int +XK_Mode_switch: int +XK_script_switch: int +XK_Num_Lock: int +XK_KP_Space: int +XK_KP_Tab: int +XK_KP_Enter: int +XK_KP_F1: int +XK_KP_F2: int +XK_KP_F3: int +XK_KP_F4: int +XK_KP_Home: int +XK_KP_Left: int +XK_KP_Up: int +XK_KP_Right: int +XK_KP_Down: int +XK_KP_Prior: int +XK_KP_Page_Up: int +XK_KP_Next: int +XK_KP_Page_Down: int +XK_KP_End: int +XK_KP_Begin: int +XK_KP_Insert: int +XK_KP_Delete: int +XK_KP_Equal: int +XK_KP_Multiply: int +XK_KP_Add: int +XK_KP_Separator: int +XK_KP_Subtract: int +XK_KP_Decimal: int +XK_KP_Divide: int +XK_KP_0: int +XK_KP_1: int +XK_KP_2: int +XK_KP_3: int +XK_KP_4: int +XK_KP_5: int +XK_KP_6: int +XK_KP_7: int +XK_KP_8: int +XK_KP_9: int +XK_F1: int +XK_F2: int +XK_F3: int +XK_F4: int +XK_F5: int +XK_F6: int +XK_F7: int +XK_F8: int +XK_F9: int +XK_F10: int +XK_F11: int +XK_L1: int +XK_F12: int +XK_L2: int +XK_F13: int +XK_L3: int +XK_F14: int +XK_L4: int +XK_F15: int +XK_L5: int +XK_F16: int +XK_L6: int +XK_F17: int +XK_L7: int +XK_F18: int +XK_L8: int +XK_F19: int +XK_L9: int +XK_F20: int +XK_L10: int +XK_F21: int +XK_R1: int +XK_F22: int +XK_R2: int +XK_F23: int +XK_R3: int +XK_F24: int +XK_R4: int +XK_F25: int +XK_R5: int +XK_F26: int +XK_R6: int +XK_F27: int +XK_R7: int +XK_F28: int +XK_R8: int +XK_F29: int +XK_R9: int +XK_F30: int +XK_R10: int +XK_F31: int +XK_R11: int +XK_F32: int +XK_R12: int +XK_F33: int +XK_R13: int +XK_F34: int +XK_R14: int +XK_F35: int +XK_R15: int +XK_Shift_L: int +XK_Shift_R: int +XK_Control_L: int +XK_Control_R: int +XK_Caps_Lock: int +XK_Shift_Lock: int +XK_Meta_L: int +XK_Meta_R: int +XK_Alt_L: int +XK_Alt_R: int +XK_Super_L: int +XK_Super_R: int +XK_Hyper_L: int +XK_Hyper_R: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/publishing.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/publishing.pyi new file mode 100644 index 000000000..50c1f0207 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/publishing.pyi @@ -0,0 +1,83 @@ +XK_emspace: int +XK_enspace: int +XK_em3space: int +XK_em4space: int +XK_digitspace: int +XK_punctspace: int +XK_thinspace: int +XK_hairspace: int +XK_emdash: int +XK_endash: int +XK_signifblank: int +XK_ellipsis: int +XK_doubbaselinedot: int +XK_onethird: int +XK_twothirds: int +XK_onefifth: int +XK_twofifths: int +XK_threefifths: int +XK_fourfifths: int +XK_onesixth: int +XK_fivesixths: int +XK_careof: int +XK_figdash: int +XK_leftanglebracket: int +XK_decimalpoint: int +XK_rightanglebracket: int +XK_marker: int +XK_oneeighth: int +XK_threeeighths: int +XK_fiveeighths: int +XK_seveneighths: int +XK_trademark: int +XK_signaturemark: int +XK_trademarkincircle: int +XK_leftopentriangle: int +XK_rightopentriangle: int +XK_emopencircle: int +XK_emopenrectangle: int +XK_leftsinglequotemark: int +XK_rightsinglequotemark: int +XK_leftdoublequotemark: int +XK_rightdoublequotemark: int +XK_prescription: int +XK_minutes: int +XK_seconds: int +XK_latincross: int +XK_hexagram: int +XK_filledrectbullet: int +XK_filledlefttribullet: int +XK_filledrighttribullet: int +XK_emfilledcircle: int +XK_emfilledrect: int +XK_enopencircbullet: int +XK_enopensquarebullet: int +XK_openrectbullet: int +XK_opentribulletup: int +XK_opentribulletdown: int +XK_openstar: int +XK_enfilledcircbullet: int +XK_enfilledsqbullet: int +XK_filledtribulletup: int +XK_filledtribulletdown: int +XK_leftpointer: int +XK_rightpointer: int +XK_club: int +XK_diamond: int +XK_heart: int +XK_maltesecross: int +XK_dagger: int +XK_doubledagger: int +XK_checkmark: int +XK_ballotcross: int +XK_musicalsharp: int +XK_musicalflat: int +XK_malesymbol: int +XK_femalesymbol: int +XK_telephone: int +XK_telephonerecorder: int +XK_phonographcopyright: int +XK_caret: int +XK_singlelowquotemark: int +XK_doublelowquotemark: int +XK_cursor: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/special.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/special.pyi new file mode 100644 index 000000000..6376279ea --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/special.pyi @@ -0,0 +1,24 @@ +XK_blank: int +XK_soliddiamond: int +XK_checkerboard: int +XK_ht: int +XK_ff: int +XK_cr: int +XK_lf: int +XK_nl: int +XK_vt: int +XK_lowrightcorner: int +XK_uprightcorner: int +XK_upleftcorner: int +XK_lowleftcorner: int +XK_crossinglines: int +XK_horizlinescan1: int +XK_horizlinescan3: int +XK_horizlinescan5: int +XK_horizlinescan7: int +XK_horizlinescan9: int +XK_leftt: int +XK_rightt: int +XK_bott: int +XK_topt: int +XK_vertbar: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/technical.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/technical.pyi new file mode 100644 index 000000000..6b60c278c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/technical.pyi @@ -0,0 +1,49 @@ +XK_leftradical: int +XK_topleftradical: int +XK_horizconnector: int +XK_topintegral: int +XK_botintegral: int +XK_vertconnector: int +XK_topleftsqbracket: int +XK_botleftsqbracket: int +XK_toprightsqbracket: int +XK_botrightsqbracket: int +XK_topleftparens: int +XK_botleftparens: int +XK_toprightparens: int +XK_botrightparens: int +XK_leftmiddlecurlybrace: int +XK_rightmiddlecurlybrace: int +XK_topleftsummation: int +XK_botleftsummation: int +XK_topvertsummationconnector: int +XK_botvertsummationconnector: int +XK_toprightsummation: int +XK_botrightsummation: int +XK_rightmiddlesummation: int +XK_lessthanequal: int +XK_notequal: int +XK_greaterthanequal: int +XK_integral: int +XK_therefore: int +XK_variation: int +XK_infinity: int +XK_nabla: int +XK_approximate: int +XK_similarequal: int +XK_ifonlyif: int +XK_implies: int +XK_identical: int +XK_radical: int +XK_includedin: int +XK_includes: int +XK_intersection: int +XK_union: int +XK_logicaland: int +XK_logicalor: int +XK_partialderivative: int +XK_function: int +XK_leftarrow: int +XK_uparrow: int +XK_rightarrow: int +XK_downarrow: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/thai.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/thai.pyi new file mode 100644 index 000000000..71f2c9106 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/thai.pyi @@ -0,0 +1,84 @@ +XK_Thai_kokai: int +XK_Thai_khokhai: int +XK_Thai_khokhuat: int +XK_Thai_khokhwai: int +XK_Thai_khokhon: int +XK_Thai_khorakhang: int +XK_Thai_ngongu: int +XK_Thai_chochan: int +XK_Thai_choching: int +XK_Thai_chochang: int +XK_Thai_soso: int +XK_Thai_chochoe: int +XK_Thai_yoying: int +XK_Thai_dochada: int +XK_Thai_topatak: int +XK_Thai_thothan: int +XK_Thai_thonangmontho: int +XK_Thai_thophuthao: int +XK_Thai_nonen: int +XK_Thai_dodek: int +XK_Thai_totao: int +XK_Thai_thothung: int +XK_Thai_thothahan: int +XK_Thai_thothong: int +XK_Thai_nonu: int +XK_Thai_bobaimai: int +XK_Thai_popla: int +XK_Thai_phophung: int +XK_Thai_fofa: int +XK_Thai_phophan: int +XK_Thai_fofan: int +XK_Thai_phosamphao: int +XK_Thai_moma: int +XK_Thai_yoyak: int +XK_Thai_rorua: int +XK_Thai_ru: int +XK_Thai_loling: int +XK_Thai_lu: int +XK_Thai_wowaen: int +XK_Thai_sosala: int +XK_Thai_sorusi: int +XK_Thai_sosua: int +XK_Thai_hohip: int +XK_Thai_lochula: int +XK_Thai_oang: int +XK_Thai_honokhuk: int +XK_Thai_paiyannoi: int +XK_Thai_saraa: int +XK_Thai_maihanakat: int +XK_Thai_saraaa: int +XK_Thai_saraam: int +XK_Thai_sarai: int +XK_Thai_saraii: int +XK_Thai_saraue: int +XK_Thai_sarauee: int +XK_Thai_sarau: int +XK_Thai_sarauu: int +XK_Thai_phinthu: int +XK_Thai_maihanakat_maitho: int +XK_Thai_baht: int +XK_Thai_sarae: int +XK_Thai_saraae: int +XK_Thai_sarao: int +XK_Thai_saraaimaimuan: int +XK_Thai_saraaimaimalai: int +XK_Thai_lakkhangyao: int +XK_Thai_maiyamok: int +XK_Thai_maitaikhu: int +XK_Thai_maiek: int +XK_Thai_maitho: int +XK_Thai_maitri: int +XK_Thai_maichattawa: int +XK_Thai_thanthakhat: int +XK_Thai_nikhahit: int +XK_Thai_leksun: int +XK_Thai_leknung: int +XK_Thai_leksong: int +XK_Thai_leksam: int +XK_Thai_leksi: int +XK_Thai_lekha: int +XK_Thai_lekhok: int +XK_Thai_lekchet: int +XK_Thai_lekpaet: int +XK_Thai_lekkao: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/xf86.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/xf86.pyi new file mode 100644 index 000000000..73b36fc72 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/xf86.pyi @@ -0,0 +1,184 @@ +XK_XF86_ModeLock: int +XK_XF86_MonBrightnessUp: int +XK_XF86_MonBrightnessDown: int +XK_XF86_KbdLightOnOff: int +XK_XF86_KbdBrightnessUp: int +XK_XF86_KbdBrightnessDown: int +XK_XF86_MonBrightnessCycle: int +XK_XF86_Standby: int +XK_XF86_AudioLowerVolume: int +XK_XF86_AudioMute: int +XK_XF86_AudioRaiseVolume: int +XK_XF86_AudioPlay: int +XK_XF86_AudioStop: int +XK_XF86_AudioPrev: int +XK_XF86_AudioNext: int +XK_XF86_HomePage: int +XK_XF86_Mail: int +XK_XF86_Start: int +XK_XF86_Search: int +XK_XF86_AudioRecord: int +XK_XF86_Calculator: int +XK_XF86_Memo: int +XK_XF86_ToDoList: int +XK_XF86_Calendar: int +XK_XF86_PowerDown: int +XK_XF86_ContrastAdjust: int +XK_XF86_RockerUp: int +XK_XF86_RockerDown: int +XK_XF86_RockerEnter: int +XK_XF86_Back: int +XK_XF86_Forward: int +XK_XF86_Stop: int +XK_XF86_Refresh: int +XK_XF86_PowerOff: int +XK_XF86_WakeUp: int +XK_XF86_Eject: int +XK_XF86_ScreenSaver: int +XK_XF86_WWW: int +XK_XF86_Sleep: int +XK_XF86_Favorites: int +XK_XF86_AudioPause: int +XK_XF86_AudioMedia: int +XK_XF86_MyComputer: int +XK_XF86_VendorHome: int +XK_XF86_LightBulb: int +XK_XF86_Shop: int +XK_XF86_History: int +XK_XF86_OpenURL: int +XK_XF86_AddFavorite: int +XK_XF86_HotLinks: int +XK_XF86_BrightnessAdjust: int +XK_XF86_Finance: int +XK_XF86_Community: int +XK_XF86_AudioRewind: int +XK_XF86_XF86BackForward: int +XK_XF86_Launch0: int +XK_XF86_Launch1: int +XK_XF86_Launch2: int +XK_XF86_Launch3: int +XK_XF86_Launch4: int +XK_XF86_Launch5: int +XK_XF86_Launch6: int +XK_XF86_Launch7: int +XK_XF86_Launch8: int +XK_XF86_Launch9: int +XK_XF86_LaunchA: int +XK_XF86_LaunchB: int +XK_XF86_LaunchC: int +XK_XF86_LaunchD: int +XK_XF86_LaunchE: int +XK_XF86_LaunchF: int +XK_XF86_ApplicationLeft: int +XK_XF86_ApplicationRight: int +XK_XF86_Book: int +XK_XF86_CD: int +XK_XF86_Calculater: int +XK_XF86_Clear: int +XK_XF86_Close: int +XK_XF86_Copy: int +XK_XF86_Cut: int +XK_XF86_Display: int +XK_XF86_DOS: int +XK_XF86_Documents: int +XK_XF86_Excel: int +XK_XF86_Explorer: int +XK_XF86_Game: int +XK_XF86_Go: int +XK_XF86_iTouch: int +XK_XF86_LogOff: int +XK_XF86_Market: int +XK_XF86_Meeting: int +XK_XF86_MenuKB: int +XK_XF86_MenuPB: int +XK_XF86_MySites: int +XK_XF86_New: int +XK_XF86_News: int +XK_XF86_OfficeHome: int +XK_XF86_Open: int +XK_XF86_Option: int +XK_XF86_Paste: int +XK_XF86_Phone: int +XK_XF86_Q: int +XK_XF86_Reply: int +XK_XF86_Reload: int +XK_XF86_RotateWindows: int +XK_XF86_RotationPB: int +XK_XF86_RotationKB: int +XK_XF86_Save: int +XK_XF86_ScrollUp: int +XK_XF86_ScrollDown: int +XK_XF86_ScrollClick: int +XK_XF86_Send: int +XK_XF86_Spell: int +XK_XF86_SplitScreen: int +XK_XF86_Support: int +XK_XF86_TaskPane: int +XK_XF86_Terminal: int +XK_XF86_Tools: int +XK_XF86_Travel: int +XK_XF86_UserPB: int +XK_XF86_User1KB: int +XK_XF86_User2KB: int +XK_XF86_Video: int +XK_XF86_WheelButton: int +XK_XF86_Word: int +XK_XF86_Xfer: int +XK_XF86_ZoomIn: int +XK_XF86_ZoomOut: int +XK_XF86_Away: int +XK_XF86_Messenger: int +XK_XF86_WebCam: int +XK_XF86_MailForward: int +XK_XF86_Pictures: int +XK_XF86_Music: int +XK_XF86_Battery: int +XK_XF86_Bluetooth: int +XK_XF86_WLAN: int +XK_XF86_UWB: int +XK_XF86_AudioForward: int +XK_XF86_AudioRepeat: int +XK_XF86_AudioRandomPlay: int +XK_XF86_Subtitle: int +XK_XF86_AudioCycleTrack: int +XK_XF86_CycleAngle: int +XK_XF86_FrameBack: int +XK_XF86_FrameForward: int +XK_XF86_Time: int +XK_XF86_Select: int +XK_XF86_View: int +XK_XF86_TopMenu: int +XK_XF86_Red: int +XK_XF86_Green: int +XK_XF86_Yellow: int +XK_XF86_Blue: int +XK_XF86_Suspend: int +XK_XF86_Hibernate: int +XK_XF86_TouchpadToggle: int +XK_XF86_TouchpadOn: int +XK_XF86_TouchpadOff: int +XK_XF86_AudioMicMute: int +XK_XF86_Keyboard: int +XK_XF86_WWAN: int +XK_XF86_RFKill: int +XK_XF86_AudioPreset: int +XK_XF86_RotationLockToggle: int +XK_XF86_FullScreen: int +XK_XF86_Switch_VT_1: int +XK_XF86_Switch_VT_2: int +XK_XF86_Switch_VT_3: int +XK_XF86_Switch_VT_4: int +XK_XF86_Switch_VT_5: int +XK_XF86_Switch_VT_6: int +XK_XF86_Switch_VT_7: int +XK_XF86_Switch_VT_8: int +XK_XF86_Switch_VT_9: int +XK_XF86_Switch_VT_10: int +XK_XF86_Switch_VT_11: int +XK_XF86_Switch_VT_12: int +XK_XF86_Ungrab: int +XK_XF86_ClearGrab: int +XK_XF86_Next_VMode: int +XK_XF86_Prev_VMode: int +XK_XF86_LogWindowTree: int +XK_XF86_LogGrabInfo: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/xk3270.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/xk3270.pyi new file mode 100644 index 000000000..5fe41b94c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/xk3270.pyi @@ -0,0 +1,30 @@ +XK_3270_Duplicate: int +XK_3270_FieldMark: int +XK_3270_Right2: int +XK_3270_Left2: int +XK_3270_BackTab: int +XK_3270_EraseEOF: int +XK_3270_EraseInput: int +XK_3270_Reset: int +XK_3270_Quit: int +XK_3270_PA1: int +XK_3270_PA2: int +XK_3270_PA3: int +XK_3270_Test: int +XK_3270_Attn: int +XK_3270_CursorBlink: int +XK_3270_AltCursor: int +XK_3270_KeyClick: int +XK_3270_Jump: int +XK_3270_Ident: int +XK_3270_Rule: int +XK_3270_Copy: int +XK_3270_Play: int +XK_3270_Setup: int +XK_3270_Record: int +XK_3270_ChangeScreen: int +XK_3270_DeleteWord: int +XK_3270_ExSelect: int +XK_3270_CursorSelect: int +XK_3270_PrintScreen: int +XK_3270_Enter: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/xkb.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/xkb.pyi new file mode 100644 index 000000000..dbfa43c9d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/keysymdef/xkb.pyi @@ -0,0 +1,100 @@ +XK_ISO_Lock: int +XK_ISO_Level2_Latch: int +XK_ISO_Level3_Shift: int +XK_ISO_Level3_Latch: int +XK_ISO_Level3_Lock: int +XK_ISO_Group_Shift: int +XK_ISO_Group_Latch: int +XK_ISO_Group_Lock: int +XK_ISO_Next_Group: int +XK_ISO_Next_Group_Lock: int +XK_ISO_Prev_Group: int +XK_ISO_Prev_Group_Lock: int +XK_ISO_First_Group: int +XK_ISO_First_Group_Lock: int +XK_ISO_Last_Group: int +XK_ISO_Last_Group_Lock: int +XK_ISO_Left_Tab: int +XK_ISO_Move_Line_Up: int +XK_ISO_Move_Line_Down: int +XK_ISO_Partial_Line_Up: int +XK_ISO_Partial_Line_Down: int +XK_ISO_Partial_Space_Left: int +XK_ISO_Partial_Space_Right: int +XK_ISO_Set_Margin_Left: int +XK_ISO_Set_Margin_Right: int +XK_ISO_Release_Margin_Left: int +XK_ISO_Release_Margin_Right: int +XK_ISO_Release_Both_Margins: int +XK_ISO_Fast_Cursor_Left: int +XK_ISO_Fast_Cursor_Right: int +XK_ISO_Fast_Cursor_Up: int +XK_ISO_Fast_Cursor_Down: int +XK_ISO_Continuous_Underline: int +XK_ISO_Discontinuous_Underline: int +XK_ISO_Emphasize: int +XK_ISO_Center_Object: int +XK_ISO_Enter: int +XK_dead_grave: int +XK_dead_acute: int +XK_dead_circumflex: int +XK_dead_tilde: int +XK_dead_macron: int +XK_dead_breve: int +XK_dead_abovedot: int +XK_dead_diaeresis: int +XK_dead_abovering: int +XK_dead_doubleacute: int +XK_dead_caron: int +XK_dead_cedilla: int +XK_dead_ogonek: int +XK_dead_iota: int +XK_dead_voiced_sound: int +XK_dead_semivoiced_sound: int +XK_dead_belowdot: int +XK_First_Virtual_Screen: int +XK_Prev_Virtual_Screen: int +XK_Next_Virtual_Screen: int +XK_Last_Virtual_Screen: int +XK_Terminate_Server: int +XK_AccessX_Enable: int +XK_AccessX_Feedback_Enable: int +XK_RepeatKeys_Enable: int +XK_SlowKeys_Enable: int +XK_BounceKeys_Enable: int +XK_StickyKeys_Enable: int +XK_MouseKeys_Enable: int +XK_MouseKeys_Accel_Enable: int +XK_Overlay1_Enable: int +XK_Overlay2_Enable: int +XK_AudibleBell_Enable: int +XK_Pointer_Left: int +XK_Pointer_Right: int +XK_Pointer_Up: int +XK_Pointer_Down: int +XK_Pointer_UpLeft: int +XK_Pointer_UpRight: int +XK_Pointer_DownLeft: int +XK_Pointer_DownRight: int +XK_Pointer_Button_Dflt: int +XK_Pointer_Button1: int +XK_Pointer_Button2: int +XK_Pointer_Button3: int +XK_Pointer_Button4: int +XK_Pointer_Button5: int +XK_Pointer_DblClick_Dflt: int +XK_Pointer_DblClick1: int +XK_Pointer_DblClick2: int +XK_Pointer_DblClick3: int +XK_Pointer_DblClick4: int +XK_Pointer_DblClick5: int +XK_Pointer_Drag_Dflt: int +XK_Pointer_Drag1: int +XK_Pointer_Drag2: int +XK_Pointer_Drag3: int +XK_Pointer_Drag4: int +XK_Pointer_Drag5: int +XK_Pointer_EnableKeys: int +XK_Pointer_Accelerate: int +XK_Pointer_DfltBtnNext: int +XK_Pointer_DfltBtnPrev: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/protocol/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/protocol/__init__.pyi new file mode 100644 index 000000000..1252a6dc5 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/protocol/__init__.pyi @@ -0,0 +1,3 @@ +from Xlib.protocol import display as display, event as event, request as request, rq as rq, structs as structs + +__all__ = ["display", "event", "request", "rq", "structs"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/protocol/display.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/protocol/display.pyi new file mode 100644 index 000000000..e125e9662 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/protocol/display.pyi @@ -0,0 +1,118 @@ +from _typeshed import _BufferWithLen +from socket import socket +from typing import TypeVar, overload +from typing_extensions import Literal + +from Xlib import error +from Xlib._typing import ErrorHandler +from Xlib.display import _ResourceBaseClass, _ResourceBaseClassesType +from Xlib.protocol import rq +from Xlib.support import lock +from Xlib.xobject import colormap, cursor, drawable, fontable, resource + +_T = TypeVar("_T") + +class bytesview: + view: memoryview + @overload + def __init__(self, data: bytes | bytesview, offset: int, size: int) -> None: ... + @overload + def __init__(self, data: _BufferWithLen, offset: int = ..., size: int | None = ...) -> None: ... + @overload + def __getitem__(self, key: slice) -> bytes: ... + @overload + def __getitem__(self, key: int) -> int: ... + def __len__(self) -> int: ... + +class Display: + extension_major_opcodes: dict[str, int] + error_classes: dict[int, type[error.XError]] + event_classes: dict[int, type[rq.Event] | dict[int, type[rq.Event]]] + resource_classes: _ResourceBaseClassesType | None + display_name: str + default_screen: int + socket: socket + socket_error_lock: lock._DummyLock + socket_error: Exception | None + event_queue_read_lock: lock._DummyLock + event_queue_write_lock: lock._DummyLock + event_queue: list[rq.Event] + request_queue_lock: lock._DummyLock + request_serial: int + request_queue: list[tuple[rq.Request | rq.ReplyRequest | ConnectionSetupRequest, int]] + send_recv_lock: lock._DummyLock + send_active: int + recv_active: int + event_waiting: int + event_wait_lock: lock._DummyLock + request_waiting: int + request_wait_lock: lock._DummyLock + recv_buffer_size: int + sent_requests: list[rq.Request | rq.ReplyRequest | ConnectionSetupRequest] + recv_packet_len: int + data_send: bytes + data_recv: bytes + data_sent_bytes: int + resource_id_lock: lock._DummyLock + resource_ids: dict[int, None] + last_resource_id: int + error_handler: ErrorHandler[object] | None + big_endian: bool + info: ConnectionSetupRequest + def __init__(self, display: str | None = ...) -> None: ... + def get_display_name(self) -> str: ... + def get_default_screen(self) -> int: ... + def fileno(self) -> int: ... + def next_event(self) -> rq.Event: ... + def pending_events(self) -> int: ... + def flush(self) -> None: ... + def close(self) -> None: ... + def set_error_handler(self, handler: ErrorHandler[object] | None) -> None: ... + def allocate_resource_id(self) -> int: ... + def free_resource_id(self, rid: int) -> None: ... + @overload + def get_resource_class(self, class_name: Literal["resource"], default: object = ...) -> type[resource.Resource]: ... + @overload + def get_resource_class(self, class_name: Literal["drawable"], default: object = ...) -> type[drawable.Drawable]: ... + @overload + def get_resource_class(self, class_name: Literal["window"], default: object = ...) -> type[drawable.Window]: ... + @overload + def get_resource_class(self, class_name: Literal["pixmap"], default: object = ...) -> type[drawable.Pixmap]: ... + @overload + def get_resource_class(self, class_name: Literal["fontable"], default: object = ...) -> type[fontable.Fontable]: ... + @overload + def get_resource_class(self, class_name: Literal["font"], default: object = ...) -> type[fontable.Font]: ... + @overload + def get_resource_class(self, class_name: Literal["gc"], default: object = ...) -> type[fontable.GC]: ... + @overload + def get_resource_class(self, class_name: Literal["colormap"], default: object = ...) -> type[colormap.Colormap]: ... + @overload + def get_resource_class(self, class_name: Literal["cursor"], default: object) -> type[cursor.Cursor]: ... + @overload + def get_resource_class(self, class_name: str, default: _T) -> type[_ResourceBaseClass] | _T: ... + @overload + def get_resource_class(self, class_name: str, default: None = ...) -> type[_ResourceBaseClass] | None: ... + def set_extension_major(self, extname: str, major: int) -> None: ... + def get_extension_major(self, extname: str) -> int: ... + def add_extension_event(self, code: int, evt: type[rq.Event], subcode: int | None = ...) -> None: ... + def add_extension_error(self, code: int, err: type[error.XError]) -> None: ... + def check_for_error(self) -> None: ... + def send_request(self, request: rq.Request | rq.ReplyRequest | ConnectionSetupRequest, wait_for_response: bool) -> None: ... + def close_internal(self, whom: object) -> None: ... + def send_and_recv(self, flush: bool = ..., event: bool = ..., request: int | None = ..., recv: bool = ...) -> None: ... + def parse_response(self, request: int) -> bool: ... + def parse_error_response(self, request: int) -> bool: ... + def default_error_handler(self, err: object) -> None: ... + def parse_request_response(self, request: int) -> bool: ... + def parse_event_response(self, etype: int) -> None: ... + def get_waiting_request(self, sno: int) -> rq.ReplyRequest | ConnectionSetupRequest | None: ... + def get_waiting_replyrequest(self) -> rq.ReplyRequest | ConnectionSetupRequest: ... + def parse_connection_setup(self) -> bool: ... + +PixmapFormat: rq.Struct +VisualType: rq.Struct +Depth: rq.Struct +Screen: rq.Struct + +class ConnectionSetupRequest(rq.GetAttrData): + def __init__(self, display: Display, *args: object, **keys: object) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/protocol/event.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/protocol/event.pyi new file mode 100644 index 000000000..cfb825449 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/protocol/event.pyi @@ -0,0 +1,80 @@ +from typing_extensions import TypeAlias + +from Xlib.protocol import rq + +class AnyEvent(rq.Event): ... +class KeyButtonPointer(rq.Event): ... +class KeyPress(KeyButtonPointer): ... +class KeyRelease(KeyButtonPointer): ... +class ButtonPress(KeyButtonPointer): ... +class ButtonRelease(KeyButtonPointer): ... +class MotionNotify(KeyButtonPointer): ... +class EnterLeave(rq.Event): ... +class EnterNotify(EnterLeave): ... +class LeaveNotify(EnterLeave): ... +class Focus(rq.Event): ... +class FocusIn(Focus): ... +class FocusOut(Focus): ... +class Expose(rq.Event): ... +class GraphicsExpose(rq.Event): ... +class NoExpose(rq.Event): ... +class VisibilityNotify(rq.Event): ... +class CreateNotify(rq.Event): ... +class DestroyNotify(rq.Event): ... +class UnmapNotify(rq.Event): ... +class MapNotify(rq.Event): ... +class MapRequest(rq.Event): ... +class ReparentNotify(rq.Event): ... +class ConfigureNotify(rq.Event): ... +class ConfigureRequest(rq.Event): ... +class GravityNotify(rq.Event): ... +class ResizeRequest(rq.Event): ... +class Circulate(rq.Event): ... +class CirculateNotify(Circulate): ... +class CirculateRequest(Circulate): ... +class PropertyNotify(rq.Event): ... +class SelectionClear(rq.Event): ... +class SelectionRequest(rq.Event): ... +class SelectionNotify(rq.Event): ... +class ColormapNotify(rq.Event): ... +class MappingNotify(rq.Event): ... +class ClientMessage(rq.Event): ... +class KeymapNotify(rq.Event): ... + +_EventClass: TypeAlias = dict[ + int, + type[KeyPress] + | type[KeyRelease] + | type[ButtonPress] + | type[ButtonRelease] + | type[MotionNotify] + | type[EnterNotify] + | type[LeaveNotify] + | type[FocusIn] + | type[FocusOut] + | type[KeymapNotify] + | type[Expose] + | type[GraphicsExpose] + | type[NoExpose] + | type[VisibilityNotify] + | type[CreateNotify] + | type[DestroyNotify] + | type[UnmapNotify] + | type[MapNotify] + | type[MapRequest] + | type[ReparentNotify] + | type[ConfigureNotify] + | type[ConfigureRequest] + | type[GravityNotify] + | type[ResizeRequest] + | type[CirculateNotify] + | type[CirculateRequest] + | type[PropertyNotify] + | type[SelectionClear] + | type[SelectionRequest] + | type[SelectionNotify] + | type[ColormapNotify] + | type[ClientMessage] + | type[MappingNotify], +] +event_class: _EventClass diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/protocol/request.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/protocol/request.pyi new file mode 100644 index 000000000..a336f5c90 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/protocol/request.pyi @@ -0,0 +1,133 @@ +from typing import NoReturn + +from Xlib import display +from Xlib.protocol import rq + +class CreateWindow(rq.Request): ... +class ChangeWindowAttributes(rq.Request): ... +class GetWindowAttributes(rq.ReplyRequest): ... +class DestroyWindow(rq.Request): ... +class DestroySubWindows(rq.Request): ... +class ChangeSaveSet(rq.Request): ... +class ReparentWindow(rq.Request): ... +class MapWindow(rq.Request): ... +class MapSubwindows(rq.Request): ... +class UnmapWindow(rq.Request): ... +class UnmapSubwindows(rq.Request): ... +class ConfigureWindow(rq.Request): ... +class CirculateWindow(rq.Request): ... +class GetGeometry(rq.ReplyRequest): ... +class QueryTree(rq.ReplyRequest): ... +class InternAtom(rq.ReplyRequest): ... +class GetAtomName(rq.ReplyRequest): ... +class ChangeProperty(rq.Request): ... +class DeleteProperty(rq.Request): ... +class GetProperty(rq.ReplyRequest): ... +class ListProperties(rq.ReplyRequest): ... +class SetSelectionOwner(rq.Request): ... +class GetSelectionOwner(rq.ReplyRequest): ... +class ConvertSelection(rq.Request): ... +class SendEvent(rq.Request): ... +class GrabPointer(rq.ReplyRequest): ... +class UngrabPointer(rq.Request): ... +class GrabButton(rq.Request): ... +class UngrabButton(rq.Request): ... +class ChangeActivePointerGrab(rq.Request): ... +class GrabKeyboard(rq.ReplyRequest): ... +class UngrabKeyboard(rq.Request): ... +class GrabKey(rq.Request): ... +class UngrabKey(rq.Request): ... +class AllowEvents(rq.Request): ... +class GrabServer(rq.Request): ... +class UngrabServer(rq.Request): ... +class QueryPointer(rq.ReplyRequest): ... +class GetMotionEvents(rq.ReplyRequest): ... +class TranslateCoords(rq.ReplyRequest): ... +class WarpPointer(rq.Request): ... +class SetInputFocus(rq.Request): ... +class GetInputFocus(rq.ReplyRequest): ... +class QueryKeymap(rq.ReplyRequest): ... +class OpenFont(rq.Request): ... +class CloseFont(rq.Request): ... +class QueryFont(rq.ReplyRequest): ... +class QueryTextExtents(rq.ReplyRequest): ... +class ListFonts(rq.ReplyRequest): ... + +class ListFontsWithInfo(rq.ReplyRequest): + def __init__(self, display: display.Display, defer: bool = ..., *args: object, **keys: object) -> None: ... + def __getattr__(self, attr: object) -> NoReturn: ... + def __getitem__(self, item: str) -> object: ... + def __len__(self) -> int: ... + +class SetFontPath(rq.Request): ... +class GetFontPath(rq.ReplyRequest): ... +class CreatePixmap(rq.Request): ... +class FreePixmap(rq.Request): ... +class CreateGC(rq.Request): ... +class ChangeGC(rq.Request): ... +class CopyGC(rq.Request): ... +class SetDashes(rq.Request): ... +class SetClipRectangles(rq.Request): ... +class FreeGC(rq.Request): ... +class ClearArea(rq.Request): ... +class CopyArea(rq.Request): ... +class CopyPlane(rq.Request): ... +class PolyPoint(rq.Request): ... +class PolyLine(rq.Request): ... +class PolySegment(rq.Request): ... +class PolyRectangle(rq.Request): ... +class PolyArc(rq.Request): ... +class FillPoly(rq.Request): ... +class PolyFillRectangle(rq.Request): ... +class PolyFillArc(rq.Request): ... +class PutImage(rq.Request): ... +class GetImage(rq.ReplyRequest): ... +class PolyText8(rq.Request): ... +class PolyText16(rq.Request): ... +class ImageText8(rq.Request): ... +class ImageText16(rq.Request): ... +class CreateColormap(rq.Request): ... +class FreeColormap(rq.Request): ... +class CopyColormapAndFree(rq.Request): ... +class InstallColormap(rq.Request): ... +class UninstallColormap(rq.Request): ... +class ListInstalledColormaps(rq.ReplyRequest): ... +class AllocColor(rq.ReplyRequest): ... +class AllocNamedColor(rq.ReplyRequest): ... +class AllocColorCells(rq.ReplyRequest): ... +class AllocColorPlanes(rq.ReplyRequest): ... +class FreeColors(rq.Request): ... +class StoreColors(rq.Request): ... +class StoreNamedColor(rq.Request): ... +class QueryColors(rq.ReplyRequest): ... +class LookupColor(rq.ReplyRequest): ... +class CreateCursor(rq.Request): ... +class CreateGlyphCursor(rq.Request): ... +class FreeCursor(rq.Request): ... +class RecolorCursor(rq.Request): ... +class QueryBestSize(rq.ReplyRequest): ... +class QueryExtension(rq.ReplyRequest): ... +class ListExtensions(rq.ReplyRequest): ... +class ChangeKeyboardMapping(rq.Request): ... +class GetKeyboardMapping(rq.ReplyRequest): ... +class ChangeKeyboardControl(rq.Request): ... +class GetKeyboardControl(rq.ReplyRequest): ... +class Bell(rq.Request): ... +class ChangePointerControl(rq.Request): ... +class GetPointerControl(rq.ReplyRequest): ... +class SetScreenSaver(rq.Request): ... +class GetScreenSaver(rq.ReplyRequest): ... +class ChangeHosts(rq.Request): ... +class ListHosts(rq.ReplyRequest): ... +class SetAccessControl(rq.Request): ... +class SetCloseDownMode(rq.Request): ... +class KillClient(rq.Request): ... +class RotateProperties(rq.Request): ... +class ForceScreenSaver(rq.Request): ... +class SetPointerMapping(rq.ReplyRequest): ... +class GetPointerMapping(rq.ReplyRequest): ... +class SetModifierMapping(rq.ReplyRequest): ... +class GetModifierMapping(rq.ReplyRequest): ... +class NoOperation(rq.Request): ... + +major_codes: dict[int, type[rq.Request]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/protocol/rq.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/protocol/rq.pyi new file mode 100644 index 000000000..8b5b8ac8c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/protocol/rq.pyi @@ -0,0 +1,402 @@ +from _typeshed import ReadableBuffer, SliceableBuffer, SupportsTrunc +from array import array + +# Avoid name collision with List.type +from builtins import type as Type +from collections.abc import Callable, Iterable, Sequence +from typing import Any, SupportsInt, TypeVar, overload, type_check_only +from typing_extensions import Literal, LiteralString, SupportsIndex, TypeAlias + +from Xlib._typing import ErrorHandler, Unused +from Xlib.display import _ResourceBaseClass +from Xlib.error import XError +from Xlib.ext.xinput import ClassInfoClass +from Xlib.protocol import display + +_T = TypeVar("_T") +_IntNew: TypeAlias = str | ReadableBuffer | SupportsInt | SupportsIndex | SupportsTrunc +_ModifierMappingList8Elements: TypeAlias = Sequence[Sequence[int]] + +# Workaround for pytype crash. Should be Xlib.display._BaseDisplay +@type_check_only +class _BaseDisplay(display.Display): + def __init__(self, display: str | None = ...) -> None: ... + def get_atom(self, atomname: str, only_if_exists: bool = ...) -> int: ... + +def decode_string(bs: bytes | bytearray) -> str: ... +def encode_array(a: array[Any] | memoryview) -> str: ... + +class BadDataError(Exception): ... + +signed_codes: dict[int, str] +unsigned_codes: dict[int, str] +array_unsigned_codes: dict[int, LiteralString] +struct_to_array_codes: dict[str, LiteralString] +size: int + +class Field: + name: str + default: int | None + pack_value: Callable[[Any], tuple[Any, int | None, int | None]] | None + structcode: str | None + structvalues: int + check_value: Callable[[Any], Any] | None + parse_value: Callable[[Any, Any], Any] | None + keyword_args: int + + def parse_binary_value( + self, data: SliceableBuffer, display: display.Display | None, length: int | None, format: int + ) -> tuple[Any, SliceableBuffer]: ... + +class Pad(Field): + size: int + value: bytes + structcode: str + def __init__(self, size: int) -> None: ... + +class ConstantField(Field): + value: int + def __init__(self, value: int) -> None: ... + +class Opcode(ConstantField): + structcode: str + +class ReplyCode(ConstantField): + structcode: str + value: int + def __init__(self) -> None: ... + +class LengthField(Field): + structcode: str + other_fields: list[str] | tuple[str, ...] | None + def calc_length(self, length: int) -> int: ... + +class TotalLengthField(LengthField): ... +class RequestLength(TotalLengthField): ... +class ReplyLength(TotalLengthField): ... + +class LengthOf(LengthField): + other_fields: list[str] | tuple[str, ...] | None + def __init__(self, name: str | list[str] | tuple[str, ...], size: int) -> None: ... + +class OddLength(LengthField): + def __init__(self, name: str) -> None: ... + def parse_value(self, value: int, display: Unused) -> Literal["even", "odd"]: ... # type: ignore[override] + +class FormatField(Field): + structcode: str + def __init__(self, name: str, size: int) -> None: ... + +Format = FormatField + +class ValueField(Field): + def __init__(self, name: str, default: int | None = ...) -> None: ... + +class Int8(ValueField): + structcode: str + +class Int16(ValueField): + structcode: str + +class Int32(ValueField): + structcode: str + +class Card8(ValueField): + structcode: str + +class Card16(ValueField): + structcode: str + +class Card32(ValueField): + structcode: str + +class Resource(Card32): + cast_function: str + class_name: str + codes: tuple[int, ...] + def __init__(self, name: str, codes: tuple[int, ...] = ..., default: int | None = ...) -> None: ... + @overload # type: ignore[override] + def check_value(self, value: Callable[[], _T]) -> _T: ... + @overload + def check_value(self, value: _T) -> _T: ... + def parse_value(self, value: int, display: _BaseDisplay) -> int: ... # type: ignore[override] # display: None will error. See: https://github.com/python-xlib/python-xlib/pull/248 + +class Window(Resource): + cast_function: str + class_name: str + +class Pixmap(Resource): + cast_function: str + class_name: str + +class Drawable(Resource): + cast_function: str + class_name: str + +class Fontable(Resource): + cast_function: str + class_name: str + +class Font(Resource): + cast_function: str + class_name: str + +class GC(Resource): + cast_function: str + class_name: str + +class Colormap(Resource): + cast_function: str + class_name: str + +class Cursor(Resource): + cast_function: str + class_name: str + +class Bool(ValueField): + structcode: str + def check_value(self, value: object) -> bool: ... # type: ignore[override] + +class Set(ValueField): + structcode: str + values: Sequence[object] + def __init__(self, name: str, size: int, values: Sequence[object], default: int | None = ...) -> None: ... + def check_value(self, val: _T) -> _T: ... # type: ignore[override] + +class Gravity(Set): + def __init__(self, name: str) -> None: ... + +class FixedBinary(ValueField): + structcode: str + def __init__(self, name: str, size: int) -> None: ... + +class Binary(ValueField): + structcode: None + pad: int + def __init__(self, name: str, pad: int = ...) -> None: ... + def pack_value( # type: ignore[override] # Override Callable + self, val: bytes | bytearray + ) -> tuple[bytes | bytearray, int, None]: ... + @overload # type: ignore[override] # Overload for specific values + def parse_binary_value(self, data: _T, display: Unused, length: None, format: Unused) -> tuple[_T, Literal[b""]]: ... + @overload + def parse_binary_value( + self, data: SliceableBuffer, display: Unused, length: int, format: Unused + ) -> tuple[SliceableBuffer, SliceableBuffer]: ... + +class String8(ValueField): + structcode: None + pad: int + def __init__(self, name: str, pad: int = ...) -> None: ... + def pack_value(self, val: bytes | str) -> tuple[bytes, int, None]: ... # type: ignore[override] # Override Callable + @overload # type: ignore[override] # Overload for specific values + def parse_binary_value( + self, data: bytes | bytearray, display: Unused, length: None, format: Unused + ) -> tuple[str, Literal[b""]]: ... + @overload + def parse_binary_value( + self, data: SliceableBuffer, display: Unused, length: int, format: Unused + ) -> tuple[str, SliceableBuffer]: ... + +class String16(ValueField): + structcode: None + pad: int + def __init__(self, name: str, pad: int = ...) -> None: ... + def pack_value(self, val: Sequence[object]) -> tuple[bytes, int, None]: ... # type: ignore[override] # Override Callable + def parse_binary_value( # type: ignore[override] # length: None will error. See: https://github.com/python-xlib/python-xlib/pull/248 + self, data: SliceableBuffer, display: Unused, length: int | Literal["odd", "even"], format: Unused + ) -> tuple[tuple[Any, ...], SliceableBuffer]: ... + +class List(ValueField): + structcode: None + type: Struct | ScalarObj | ResourceObj | ClassInfoClass | type[ValueField] + pad: int + def __init__( + self, name: str, type: Struct | ScalarObj | ResourceObj | ClassInfoClass | Type[ValueField], pad: int = ... + ) -> None: ... + def parse_binary_value( + self, data: SliceableBuffer, display: display.Display | None, length: SupportsIndex | None, format: Unused + ) -> tuple[list[DictWrapper | None], SliceableBuffer]: ... + def pack_value( # type: ignore[override] # Override Callable + self, val: Sequence[object] | dict[str, Any] + ) -> tuple[bytes, int, None]: ... + +class FixedList(List): + size: int + def __init__(self, name: str, size: int, type: Struct | ScalarObj, pad: int = ...) -> None: ... + def parse_binary_value( + self, data: SliceableBuffer, display: display.Display | None, length: Unused, format: Unused + ) -> tuple[list[DictWrapper | None], SliceableBuffer]: ... + +class Object(ValueField): + type: Struct + structcode: str | None + def __init__(self, name: str, type: Struct, default: int | None = ...) -> None: ... + def parse_binary_value( + self, data: SliceableBuffer, display: display.Display | None, length: Unused, format: Unused + ) -> tuple[DictWrapper, SliceableBuffer]: ... + def parse_value(self, val: SliceableBuffer, display: display.Display | None) -> DictWrapper: ... # type: ignore[override] + def pack_value( # type: ignore[override] # Override Callable + self, val: tuple[object, ...] | dict[str, Any] | DictWrapper + ) -> bytes: ... + def check_value(self, val: tuple[_T, ...] | dict[str, _T] | DictWrapper) -> list[_T]: ... # type: ignore[override] + +class PropertyData(ValueField): + structcode: None + def parse_binary_value( + self, data: SliceableBuffer, display: Unused, length: _IntNew | None, format: int + ) -> tuple[tuple[int, SliceableBuffer] | None, SliceableBuffer]: ... + def pack_value( # type: ignore[override] # Override Callable + self, value: tuple[int, Sequence[float] | Sequence[str]] + ) -> tuple[bytes, int, Literal[8, 16, 32]]: ... + +class FixedPropertyData(PropertyData): + size: int + def __init__(self, name: str, size: int) -> None: ... + +class ValueList(Field): + structcode: None + keyword_args: int + default: str # type: ignore[assignment] # Actually different from base class + maskcode: bytes + maskcodelen: int + fields: list[tuple[Field, int]] + def __init__(self, name: str, mask: int, pad: int, *fields: Field) -> None: ... + def pack_value( # type: ignore[override] # Override Callable + self, arg: str | dict[str, Any], keys: dict[str, Any] + ) -> tuple[bytes, None, None]: ... + def parse_binary_value( + self, data: SliceableBuffer, display: display.Display | None, length: Unused, format: Unused + ) -> tuple[DictWrapper, SliceableBuffer]: ... + +class KeyboardMapping(ValueField): + structcode: None + def parse_binary_value( + self, data: SliceableBuffer, display: Unused, length: int | None, format: int + ) -> tuple[list[int], SliceableBuffer]: ... + def pack_value( # type: ignore[override] # Override Callable + self, value: Sequence[Sequence[object]] + ) -> tuple[bytes, int, int]: ... + +class ModifierMapping(ValueField): + structcode: None + def parse_binary_value( + self, data: SliceableBuffer, display: Unused, length: Unused, format: int + ) -> tuple[list[array[int]], SliceableBuffer]: ... + def pack_value( # type: ignore[override] # Override Callable + self, value: _ModifierMappingList8Elements + ) -> tuple[bytes, int, int]: ... + +class EventField(ValueField): + structcode: None + def pack_value(self, value: Event) -> tuple[SliceableBuffer, None, None]: ... # type: ignore[override] # Override Callable + def parse_binary_value( # type: ignore[override] + self, data: SliceableBuffer, display: display.Display, length: Unused, format: Unused + ) -> tuple[Event, SliceableBuffer]: ... + +class ScalarObj: + structcode: str + structvalues: int + parse_value: None + check_value: None + def __init__(self, code: str) -> None: ... + +Card8Obj: ScalarObj +Card16Obj: ScalarObj +Card32Obj: ScalarObj + +class ResourceObj: + structcode: str + structvalues: int + class_name: str + check_value: None + def __init__(self, class_name: str) -> None: ... + def parse_value(self, value: int, display: _BaseDisplay) -> int | _ResourceBaseClass: ... + +WindowObj: ResourceObj +ColormapObj: ResourceObj + +class StrClass: + structcode: None + def pack_value(self, val: str) -> bytes: ... + def parse_binary(self, data: bytes | bytearray, display: Unused) -> tuple[str, bytes | bytearray]: ... + +Str: StrClass + +class Struct: + name: str + check_value: Callable[[Any], Any] | None + keyword_args: bool + fields: tuple[Field] + static_codes: str + static_values: int + static_fields: list[Field] + static_size: int + var_fields: list[Field] + structcode: str | None + structvalues: int + def __init__(self, *fields: Field) -> None: ... + def to_binary(self, *varargs: object, **keys: object) -> bytes: ... + def pack_value(self, value: tuple[object, ...] | dict[str, Any] | DictWrapper) -> bytes: ... + @overload + def parse_value(self, val: SliceableBuffer, display: display.Display | None, rawdict: Literal[True]) -> dict[str, Any]: ... + @overload + def parse_value( + self, val: SliceableBuffer, display: display.Display | None, rawdict: Literal[False] = ... + ) -> DictWrapper: ... + @overload + def parse_binary( + self, data: SliceableBuffer, display: display.Display | None, rawdict: Literal[True] + ) -> tuple[dict[str, Any], SliceableBuffer]: ... + @overload + def parse_binary( + self, data: SliceableBuffer, display: display.Display | None, rawdict: Literal[False] = ... + ) -> tuple[DictWrapper, SliceableBuffer]: ... + # Structs generate their attributes + # TODO: Create a specific type-only class for all instances of `Struct` + @type_check_only + def __getattr__(self, __name: str) -> Any: ... + +class TextElements8(ValueField): + string_textitem: Struct + def pack_value( # type: ignore[override] # Override Callable + self, value: Iterable[Field | str | bytes | tuple[Sequence[object], ...] | dict[str, Sequence[object]] | DictWrapper] + ) -> tuple[bytes, None, None]: ... + def parse_binary_value( # type: ignore[override] # See: https://github.com/python-xlib/python-xlib/pull/249 + self, data: SliceableBuffer, display: display.Display | None, length: Unused, format: Unused + ) -> tuple[list[DictWrapper], Literal[""]]: ... + +class TextElements16(TextElements8): + string_textitem: Struct + +class GetAttrData: + # GetAttrData classes get their attributes dynamically + # TODO: Complete all classes inheriting from GetAttrData + def __getattr__(self, attr: str) -> Any: ... + @type_check_only + def __setattr__(self, __name: str, __value: Any) -> None: ... + +class DictWrapper(GetAttrData): + def __init__(self, dict: dict[str, Any]) -> None: ... + def __getitem__(self, key: str) -> object: ... + def __setitem__(self, key: str, value: object) -> None: ... + def __delitem__(self, key: str) -> None: ... + def __setattr__(self, key: str, value: object) -> None: ... + +class Request: + def __init__( + self, display: _BaseDisplay, onerror: ErrorHandler[object] | None = ..., *args: object, **keys: object + ) -> None: ... + +class ReplyRequest(GetAttrData): + def __init__(self, display: display.Display, defer: int = ..., *args: object, **keys: object) -> None: ... + def reply(self) -> None: ... + +class Event(GetAttrData): + def __init__( + self, binarydata: SliceableBuffer | None = ..., display: display.Display | None = ..., **keys: object + ) -> None: ... + +def call_error_handler( + handler: Callable[[XError, Request | None], _T], error: XError, request: Request | None +) -> _T | Literal[0]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/protocol/structs.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/protocol/structs.pyi new file mode 100644 index 000000000..60e004c47 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/protocol/structs.pyi @@ -0,0 +1,26 @@ +from collections.abc import Iterable, Sequence +from typing_extensions import TypeAlias + +from Xlib.protocol import rq + +# Aliases used in other modules +_RGB3IntIterable: TypeAlias = Iterable[int] # noqa: Y047 +_Rectangle4IntSequence: TypeAlias = Sequence[int] # noqa: Y047 +_Segment4IntSequence: TypeAlias = Sequence[int] # noqa: Y047 +_Arc6IntSequence: TypeAlias = Sequence[int] # noqa: Y047 + +# TODO: Complete all classes using WindowValues and GCValues +# Currently *object is used to represent the ValueList instead of the possible attribute types +def WindowValues(arg: str) -> rq.ValueList: ... +def GCValues(arg: str) -> rq.ValueList: ... + +TimeCoord: rq.Struct +Host: rq.Struct +CharInfo: rq.Struct +FontProp: rq.Struct +ColorItem: rq.Struct +RGB: rq.Struct +Point: rq.Struct +Segment: rq.Struct +Rectangle: rq.Struct +Arc: rq.Struct diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/rdb.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/rdb.pyi new file mode 100644 index 000000000..4fb7a6662 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/rdb.pyi @@ -0,0 +1,97 @@ +from _typeshed import SupportsDunderGT, SupportsDunderLT, SupportsRead +from collections.abc import Iterable, Mapping, Sequence +from re import Pattern +from typing import Any, Protocol, TypeVar, overload +from typing_extensions import TypeAlias + +from Xlib.display import Display +from Xlib.support.lock import _DummyLock + +_T = TypeVar("_T") +_T_contra = TypeVar("_T_contra", contravariant=True) + +_DB: TypeAlias = dict[str, tuple[_DB, ...]] +# A recursive type can be a bit annoying due to dict invariance, +# so this is a slightly less precise version of the _DB alias for parameter annotations +_DB_Param: TypeAlias = dict[str, Any] + +class _SupportsComparisons(SupportsDunderLT[_T_contra], SupportsDunderGT[_T_contra], Protocol[_T_contra]): ... + +comment_re: Pattern[str] +resource_spec_re: Pattern[str] +value_escape_re: Pattern[str] +resource_parts_re: Pattern[str] +NAME_MATCH: int +CLASS_MATCH: int +WILD_MATCH: int +MATCH_SKIP: int + +class OptionError(Exception): ... + +class ResourceDB: + db: _DB + lock: _DummyLock + def __init__( + self, + file: bytes | SupportsRead[str] | None = ..., + string: str | None = ..., + resources: Iterable[tuple[str, object]] | None = ..., + ) -> None: ... + def insert_file(self, file: bytes | SupportsRead[str]) -> None: ... + def insert_string(self, data: str) -> None: ... + def insert_resources(self, resources: Iterable[tuple[str, object]]) -> None: ... + def insert(self, resource: str, value: object) -> None: ... + def __getitem__(self, keys_tuple: tuple[str, str]) -> Any: ... + @overload + def get(self, res: str, cls: str, default: None = ...) -> Any: ... + @overload + def get(self, res: str, cls: str, default: _T) -> _T: ... + def update(self, db: ResourceDB) -> None: ... + def output(self) -> str: ... + def getopt(self, name: str, argv: Sequence[str], opts: Mapping[str, Option]) -> Sequence[str]: ... + +def bin_insert(list: list[_SupportsComparisons[_T]], element: _SupportsComparisons[_T]) -> None: ... +def update_db(dest: _DB_Param, src: _DB_Param) -> None: ... +def copy_group(group: tuple[_DB_Param, ...]) -> tuple[_DB, ...]: ... +def copy_db(db: _DB_Param) -> _DB: ... +def output_db(prefix: str, db: _DB_Param) -> str: ... +def output_escape(value: object) -> str: ... + +class Option: + def parse(self, name: str, db: ResourceDB, args: Sequence[_T]) -> Sequence[_T]: ... + +class NoArg(Option): + specifier: str + value: object + def __init__(self, specifier: str, value: object) -> None: ... + +class IsArg(Option): + specifier: str + def __init__(self, specifier: str) -> None: ... + +class SepArg(Option): + specifier: str + def __init__(self, specifier: str) -> None: ... + +class ResArgClass(Option): + def parse(self, name: str, db: ResourceDB, args: Sequence[str]) -> Sequence[str]: ... # type: ignore[override] + +ResArg: ResArgClass + +class SkipArgClass(Option): ... + +SkipArg: SkipArgClass + +class SkipLineClass(Option): ... + +SkipLine: SkipLineClass + +class SkipNArgs(Option): + count: int + def __init__(self, count: int) -> None: ... + +def get_display_opts( + options: Mapping[str, Option], argv: Sequence[str] = ... +) -> tuple[Display, str, ResourceDB, Sequence[str]]: ... + +stdopts: dict[str, SepArg | NoArg | ResArgClass] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/support/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/support/__init__.pyi new file mode 100644 index 000000000..63adc8192 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/support/__init__.pyi @@ -0,0 +1,3 @@ +from Xlib.support import connect as connect, lock as lock + +__all__ = ["lock", "connect"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/support/connect.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/support/connect.pyi new file mode 100644 index 000000000..53552b31c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/support/connect.pyi @@ -0,0 +1,4 @@ +# Ignore OpenVMS in typeshed +from Xlib.support.unix_connect import get_auth as get_auth, get_display as get_display, get_socket as get_socket + +platform: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/support/lock.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/support/lock.pyi new file mode 100644 index 000000000..236e96e50 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/support/lock.pyi @@ -0,0 +1,8 @@ +from collections.abc import Callable + +class _DummyLock: + acquire: Callable[..., None] + release: Callable[..., None] + locked: Callable[..., None] + +def allocate_lock() -> _DummyLock: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/support/unix_connect.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/support/unix_connect.pyi new file mode 100644 index 000000000..4c2af3b6d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/support/unix_connect.pyi @@ -0,0 +1,25 @@ +import sys +from _socket import _Address +from platform import uname_result +from re import Pattern +from socket import socket +from typing_extensions import Literal, TypeAlias + +from Xlib._typing import Unused + +if sys.platform == "darwin": + SUPPORTED_PROTOCOLS: tuple[None, Literal["tcp"], Literal["unix"], Literal["darwin"]] + _Protocol: TypeAlias = Literal[None, "tcp", "unix", "darwin"] + DARWIN_DISPLAY_RE: Pattern[str] +else: + SUPPORTED_PROTOCOLS: tuple[None, Literal["tcp"], Literal["unix"]] + _Protocol: TypeAlias = Literal[None, "tcp", "unix"] +uname: uname_result +DISPLAY_RE: Pattern[str] + +def get_display(display: str | None) -> tuple[str, str | None, str | None, int, int]: ... +def get_socket(dname: _Address, protocol: _Protocol, host: _Address | None, dno: int) -> socket: ... +def new_get_auth(sock: socket, dname: Unused, protocol: _Protocol, host: Unused, dno: int) -> tuple[bytes, bytes]: ... +def old_get_auth(sock: Unused, dname: _Address, host: Unused, dno: Unused) -> tuple[str | Literal[b""], bytes]: ... + +get_auth = new_get_auth diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/support/vms_connect.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/support/vms_connect.pyi new file mode 100644 index 000000000..3bbbd7668 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/support/vms_connect.pyi @@ -0,0 +1,11 @@ +from _socket import _Address +from re import Pattern +from socket import socket + +from Xlib._typing import Unused + +display_re: Pattern[str] + +def get_display(display: str | None) -> tuple[str, None, str, int, int]: ... +def get_socket(dname: _Address, protocol: Unused, host: _Address, dno: int) -> socket: ... +def get_auth(sock: Unused, dname: Unused, host: Unused, dno: Unused) -> tuple[str, str]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/threaded.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/threaded.pyi new file mode 100644 index 000000000..c7314799e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/threaded.pyi @@ -0,0 +1,4 @@ +# This isn't just a re-export from from Xlib.support import lock +# Importing from this module will cause the lock.allocate_lock function to +# return a basic Python lock, instead of the default dummy lock +from Xlib.support import lock as lock diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/xauth.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/xauth.pyi new file mode 100644 index 000000000..d0dd09704 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/xauth.pyi @@ -0,0 +1,17 @@ +from _typeshed import FileDescriptorOrPath + +FamilyInternet: int +FamilyDECnet: int +FamilyChaos: int +FamilyServerInterpreted: int +FamilyInternetV6: int +FamilyLocal: int + +class Xauthority: + entries: list[tuple[bytes, bytes, bytes, bytes, bytes]] + def __init__(self, filename: FileDescriptorOrPath | None = ...) -> None: ... + def __len__(self) -> int: ... + def __getitem__(self, i: int) -> tuple[bytes, bytes, bytes, bytes, bytes]: ... + def get_best_auth( + self, family: bytes, address: bytes, dispno: bytes, types: tuple[bytes, ...] = ... + ) -> tuple[bytes, bytes]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/xobject/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/xobject/__init__.pyi new file mode 100644 index 000000000..5d06a9d37 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/xobject/__init__.pyi @@ -0,0 +1,10 @@ +from Xlib.xobject import ( + colormap as colormap, + cursor as cursor, + drawable as drawable, + fontable as fontable, + icccm as icccm, + resource as resource, +) + +__all__ = ["colormap", "cursor", "drawable", "fontable", "icccm", "resource"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/xobject/colormap.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/xobject/colormap.pyi new file mode 100644 index 000000000..a3ebc9346 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/xobject/colormap.pyi @@ -0,0 +1,24 @@ +from collections.abc import Sequence +from re import Pattern + +from Xlib._typing import ErrorHandler +from Xlib.protocol import request, rq +from Xlib.xobject import resource + +rgb_res: list[Pattern[str]] + +class Colormap(resource.Resource): + __colormap__ = resource.Resource.__resource__ + def free(self, onerror: ErrorHandler[object] | None = ...) -> None: ... + def copy_colormap_and_free(self, scr_cmap: int) -> Colormap: ... + def install_colormap(self, onerror: ErrorHandler[object] | None = ...) -> None: ... + def uninstall_colormap(self, onerror: ErrorHandler[object] | None = ...) -> None: ... + def alloc_color(self, red: int, green: int, blue: int) -> request.AllocColor: ... + def alloc_named_color(self, name: str) -> request.AllocColor | request.AllocNamedColor | None: ... + def alloc_color_cells(self, contiguous: bool, colors: int, planes: int) -> request.AllocColorCells: ... + def alloc_color_planes(self, contiguous: bool, colors: int, red: int, green: int, blue: int) -> request.AllocColorPlanes: ... + def free_colors(self, pixels: Sequence[int], plane_mask: int, onerror: ErrorHandler[object] | None = ...) -> None: ... + def store_colors(self, items: dict[str, int], onerror: ErrorHandler[object] | None = ...) -> None: ... + def store_named_color(self, name: str, pixel: int, flags: int, onerror: ErrorHandler[object] | None = ...) -> None: ... + def query_colors(self, pixels: Sequence[int]) -> rq.Struct: ... + def lookup_color(self, name: str) -> request.LookupColor: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/xobject/cursor.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/xobject/cursor.pyi new file mode 100644 index 000000000..aeb773dc6 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/xobject/cursor.pyi @@ -0,0 +1,10 @@ +from Xlib._typing import ErrorHandler +from Xlib.protocol.structs import _RGB3IntIterable +from Xlib.xobject import resource + +class Cursor(resource.Resource): + __cursor__ = resource.Resource.__resource__ + def free(self, onerror: ErrorHandler[object] | None = ...) -> None: ... + def recolor( + self, foreground: _RGB3IntIterable, background: _RGB3IntIterable, onerror: ErrorHandler[object] | None = ... + ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/xobject/drawable.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/xobject/drawable.pyi new file mode 100644 index 000000000..da6615aab --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/xobject/drawable.pyi @@ -0,0 +1,263 @@ +from collections.abc import Iterable, Sequence +from typing import Any + +from PIL import Image +from Xlib._typing import ErrorHandler +from Xlib.protocol import request, rq +from Xlib.protocol.structs import _Arc6IntSequence, _Rectangle4IntSequence, _RGB3IntIterable, _Segment4IntSequence +from Xlib.xobject import colormap, cursor, fontable, resource + +class Drawable(resource.Resource): + __drawable__ = resource.Resource.__resource__ + def get_geometry(self) -> request.GetGeometry: ... + def create_pixmap(self, width: int, height: int, depth: int) -> Pixmap: ... + def create_gc(self, **keys: object) -> fontable.GC: ... + def copy_area( + self, + gc: int, + src_drawable: int, + src_x: int, + src_y: int, + width: int, + height: int, + dst_x: int, + dst_y: int, + onerror: ErrorHandler[object] | None = ..., + ) -> None: ... + def copy_plane( + self, + gc: int, + src_drawable: int, + src_x: int, + src_y: int, + width: int, + height: int, + dst_x: int, + dst_y: int, + bit_plane: int, + onerror: ErrorHandler[object] | None = ..., + ) -> None: ... + def poly_point( + self, gc: int, coord_mode: int, points: Sequence[tuple[int, int]], onerror: ErrorHandler[object] | None = ... + ) -> None: ... + def point(self, gc: int, x: int, y: int, onerror: ErrorHandler[object] | None = ...) -> None: ... + def poly_line( + self, gc: int, coord_mode: int, points: Sequence[tuple[int, int]], onerror: ErrorHandler[object] | None = ... + ) -> None: ... + def line(self, gc: int, x1: int, y1: int, x2: int, y2: int, onerror: ErrorHandler[object] | None = ...) -> None: ... + def poly_segment( + self, gc: int, segments: Sequence[_Segment4IntSequence], onerror: ErrorHandler[object] | None = ... + ) -> None: ... + def poly_rectangle( + self, gc: int, rectangles: Sequence[_Rectangle4IntSequence], onerror: ErrorHandler[object] | None = ... + ) -> None: ... + def rectangle(self, gc: int, x: int, y: int, width: int, height: int, onerror: ErrorHandler[object] | None = ...) -> None: ... + def poly_arc(self, gc: int, arcs: Sequence[_Arc6IntSequence], onerror: ErrorHandler[object] | None = ...) -> None: ... + def arc( + self, + gc: int, + x: int, + y: int, + width: int, + height: int, + angle1: int, + angle2: int, + onerror: ErrorHandler[object] | None = ..., + ) -> None: ... + def fill_poly( + self, gc: int, shape: int, coord_mode: int, points: Sequence[tuple[int, int]], onerror: ErrorHandler[object] | None = ... + ) -> None: ... + def poly_fill_rectangle( + self, gc: int, rectangles: Sequence[_Rectangle4IntSequence], onerror: ErrorHandler[object] | None = ... + ) -> None: ... + def fill_rectangle( + self, gc: int, x: int, y: int, width: int, height: int, onerror: ErrorHandler[object] | None = ... + ) -> None: ... + def poly_fill_arc(self, gc: int, arcs: Sequence[_Arc6IntSequence], onerror: ErrorHandler[object] | None = ...) -> None: ... + def fill_arc( + self, + gc: int, + x: int, + y: int, + width: int, + height: int, + angle1: int, + angle2: int, + onerror: ErrorHandler[object] | None = ..., + ) -> None: ... + def put_image( + self, + gc: int, + x: int, + y: int, + width: int, + height: int, + format: int, + depth: int, + left_pad: int, + data: bytes | bytearray, + onerror: ErrorHandler[object] | None = ..., + ) -> None: ... + def put_pil_image(self, gc: int, x: int, y: int, image: Image.Image, onerror: ErrorHandler[object] | None = ...) -> None: ... + def get_image(self, x: int, y: int, width: int, height: int, format: int, plane_mask: int) -> request.GetImage: ... + def draw_text( + self, gc: int, x: int, y: int, text: dict[str, str | int], onerror: ErrorHandler[object] | None = ... + ) -> None: ... + def poly_text( + self, gc: int, x: int, y: int, items: Sequence[dict[str, str | int]], onerror: ErrorHandler[object] | None = ... + ) -> None: ... + def poly_text_16( + self, gc: int, x: int, y: int, items: Sequence[dict[str, str | int]], onerror: ErrorHandler[object] | None = ... + ) -> None: ... + def image_text(self, gc: int, x: int, y: int, string: str, onerror: ErrorHandler[object] | None = ...) -> None: ... + def image_text_16(self, gc: int, x: int, y: int, string: str, onerror: ErrorHandler[object] | None = ...) -> None: ... + def query_best_size(self, item_class: int, width: int, height: int) -> request.QueryBestSize: ... + +class Window(Drawable): + __window__ = resource.Resource.__resource__ + def create_window( + self, + x: int, + y: int, + width: int, + height: int, + border_width: int, + depth: int, + window_class: int = ..., + visual: int = ..., + onerror: ErrorHandler[object] | None = ..., + **keys: object, + ) -> Window: ... + def change_attributes(self, onerror: ErrorHandler[object] | None = ..., **keys: object) -> None: ... + def get_attributes(self) -> request.GetWindowAttributes: ... + def destroy(self, onerror: ErrorHandler[object] | None = ...) -> None: ... + def destroy_sub_windows(self, onerror: ErrorHandler[object] | None = ...) -> None: ... + def change_save_set(self, mode: int, onerror: ErrorHandler[object] | None = ...) -> None: ... + def reparent(self, parent: int, x: int, y: int, onerror: ErrorHandler[object] | None = ...) -> None: ... + def map(self, onerror: ErrorHandler[object] | None = ...) -> None: ... + def map_sub_windows(self, onerror: ErrorHandler[object] | None = ...) -> None: ... + def unmap(self, onerror: ErrorHandler[object] | None = ...) -> None: ... + def unmap_sub_windows(self, onerror: ErrorHandler[object] | None = ...) -> None: ... + def configure(self, onerror: ErrorHandler[object] | None = ..., **keys: object) -> None: ... + def circulate(self, direction: int, onerror: ErrorHandler[object] | None = ...) -> None: ... + def raise_window(self, onerror: ErrorHandler[object] | None = ...) -> None: ... + def query_tree(self) -> request.QueryTree: ... + def change_property( + self, + property: int, + property_type: int, + format: int, + data: Sequence[float] | Sequence[str], + mode: int = ..., + onerror: ErrorHandler[object] | None = ..., + ) -> None: ... + def change_text_property( + self, property: int, property_type: int, data: bytes | str, mode: int = ..., onerror: ErrorHandler[object] | None = ... + ) -> None: ... + def delete_property(self, property: int, onerror: ErrorHandler[object] | None = ...) -> None: ... + def get_property( + self, property: int, property_type: int, offset: int, length: int, delete: bool = ... + ) -> request.GetProperty | None: ... + def get_full_property(self, property: int, property_type: int, sizehint: int = ...) -> request.GetProperty | None: ... + def get_full_text_property(self, property: int, property_type: int = ..., sizehint: int = ...) -> str | None: ... + def list_properties(self) -> list[int]: ... + def set_selection_owner(self, selection: int, time: int, onerror: ErrorHandler[object] | None = ...) -> None: ... + def convert_selection( + self, selection: int, target: int, property: int, time: int, onerror: ErrorHandler[object] | None = ... + ) -> None: ... + def send_event( + self, event: rq.Event, event_mask: int = ..., propagate: bool = ..., onerror: ErrorHandler[object] | None = ... + ) -> None: ... + def grab_pointer( + self, owner_events: bool, event_mask: int, pointer_mode: int, keyboard_mode: int, confine_to: int, cursor: int, time: int + ) -> int: ... + def grab_button( + self, + button: int, + modifiers: int, + owner_events: bool, + event_mask: int, + pointer_mode: int, + keyboard_mode: int, + confine_to: int, + cursor: int, + onerror: ErrorHandler[object] | None = ..., + ) -> None: ... + def ungrab_button(self, button: int, modifiers: int, onerror: ErrorHandler[object] | None = ...) -> None: ... + def grab_keyboard(self, owner_events: bool, pointer_mode: int, keyboard_mode: int, time: int) -> int: ... + def grab_key( + self, + key: int, + modifiers: int, + owner_events: bool, + pointer_mode: int, + keyboard_mode: int, + onerror: ErrorHandler[object] | None = ..., + ) -> None: ... + def ungrab_key(self, key: int, modifiers: int, onerror: ErrorHandler[object] | None = ...) -> None: ... + def query_pointer(self) -> request.QueryPointer: ... + def get_motion_events(self, start: int, stop: int) -> rq.Struct: ... + def translate_coords(self, src_window: int, src_x: int, src_y: int) -> request.TranslateCoords: ... + def warp_pointer( + self, + x: int, + y: int, + src_window: int = ..., + src_x: int = ..., + src_y: int = ..., + src_width: int = ..., + src_height: int = ..., + onerror: ErrorHandler[object] | None = ..., + ) -> None: ... + def set_input_focus(self, revert_to: int, time: int, onerror: ErrorHandler[object] | None = ...) -> None: ... + def clear_area( + self, + x: int = ..., + y: int = ..., + width: int = ..., + height: int = ..., + exposures: bool = ..., + onerror: ErrorHandler[object] | None = ..., + ) -> None: ... + def create_colormap(self, visual: int, alloc: int) -> colormap.Colormap: ... + def list_installed_colormaps(self) -> list[colormap.Colormap]: ... + def rotate_properties(self, properties: Sequence[int], delta: int, onerror: ErrorHandler[object] | None = ...) -> None: ... + def set_wm_name(self, name: bytes | str, onerror: ErrorHandler[object] | None = ...) -> None: ... + def get_wm_name(self) -> str | None: ... + def set_wm_icon_name(self, name: bytes | str, onerror: ErrorHandler[object] | None = ...) -> None: ... + def get_wm_icon_name(self) -> str | None: ... + def set_wm_class(self, inst: str, cls: str, onerror: ErrorHandler[object] | None = ...) -> None: ... + def get_wm_class(self) -> tuple[str, str] | None: ... + def set_wm_transient_for(self, window: Window, onerror: ErrorHandler[object] | None = ...) -> None: ... + def get_wm_transient_for(self) -> Window | None: ... + def set_wm_protocols(self, protocols: Iterable[int], onerror: ErrorHandler[object] | None = ...) -> None: ... + def get_wm_protocols(self) -> list[int]: ... + def set_wm_colormap_windows(self, windows: Iterable[Window], onerror: ErrorHandler[object] | None = ...) -> None: ... + def get_wm_colormap_windows(self) -> Iterable[Window]: ... + def set_wm_client_machine(self, name: bytes | str, onerror: ErrorHandler[object] | None = ...) -> None: ... + def get_wm_client_machine(self) -> str | None: ... + def set_wm_normal_hints( + self, hints: rq.DictWrapper | dict[str, Any] = ..., onerror: ErrorHandler[object] | None = ..., **keys: object + ) -> None: ... + def get_wm_normal_hints(self) -> rq.DictWrapper | None: ... + def set_wm_hints( + self, hints: rq.DictWrapper | dict[str, Any] = ..., onerror: ErrorHandler[object] | None = ..., **keys: object + ) -> None: ... + def get_wm_hints(self) -> rq.DictWrapper | None: ... + def set_wm_state( + self, hints: rq.DictWrapper | dict[str, Any] = ..., onerror: ErrorHandler[object] | None = ..., **keys: object + ) -> None: ... + def get_wm_state(self) -> rq.DictWrapper | None: ... + def set_wm_icon_size( + self, hints: rq.DictWrapper | dict[str, Any] = ..., onerror: ErrorHandler[object] | None = ..., **keys: object + ) -> None: ... + def get_wm_icon_size(self) -> rq.DictWrapper | None: ... + +class Pixmap(Drawable): + __pixmap__ = resource.Resource.__resource__ + def free(self, onerror: ErrorHandler[object] | None = ...) -> None: ... + def create_cursor( + self, mask: int, foreground: _RGB3IntIterable, background: _RGB3IntIterable, x: int, y: int + ) -> cursor.Cursor: ... + +def roundup(value: int, unit: int) -> int: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/xobject/fontable.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/xobject/fontable.pyi new file mode 100644 index 000000000..614c19deb --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/xobject/fontable.pyi @@ -0,0 +1,33 @@ +from collections.abc import Sequence + +from Xlib._typing import ErrorHandler +from Xlib.protocol import request +from Xlib.protocol.structs import _RGB3IntIterable +from Xlib.xobject import cursor, resource + +class Fontable(resource.Resource): + __fontable__ = resource.Resource.__resource__ + def query(self) -> request.QueryFont: ... + def query_text_extents(self, string: str) -> request.QueryTextExtents: ... + +class GC(Fontable): + __gc__ = resource.Resource.__resource__ + def change(self, onerror: ErrorHandler[object] | None = ..., **keys: object) -> None: ... + def copy(self, src_gc: int, mask: int, onerror: ErrorHandler[object] | None = ...) -> None: ... + def set_dashes(self, offset: int, dashes: Sequence[int], onerror: ErrorHandler[object] | None = ...) -> None: ... + def set_clip_rectangles( + self, + x_origin: int, + y_origin: int, + rectangles: Sequence[dict[str, int]], + ordering: int, + onerror: ErrorHandler[object] | None = ..., + ) -> None: ... + def free(self, onerror: ErrorHandler[object] | None = ...) -> None: ... + +class Font(Fontable): + __font__ = resource.Resource.__resource__ + def close(self, onerror: ErrorHandler[object] | None = ...) -> None: ... + def create_glyph_cursor( + self, mask: Font, source_char: int, mask_char: int, foreground: _RGB3IntIterable, background: _RGB3IntIterable + ) -> cursor.Cursor: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/xobject/icccm.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/xobject/icccm.pyi new file mode 100644 index 000000000..8f64f1b06 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/xobject/icccm.pyi @@ -0,0 +1,7 @@ +from Xlib.protocol import rq + +Aspect: rq.Struct +WMNormalHints: rq.Struct +WMHints: rq.Struct +WMState: rq.Struct +WMIconSize: rq.Struct diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/xobject/resource.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/xobject/resource.pyi new file mode 100644 index 000000000..81577e09e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/Xlib/xobject/resource.pyi @@ -0,0 +1,10 @@ +from Xlib._typing import ErrorHandler +from Xlib.display import _BaseDisplay + +class Resource: + display: _BaseDisplay + id: int + owner: int + def __init__(self, display: _BaseDisplay, rid: int, owner: int = ...) -> None: ... + def __resource__(self) -> int: ... + def kill_client(self, onerror: ErrorHandler[object] | None = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pytz/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/pytz/METADATA.toml index 4ff93fc0a..788504078 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pytz/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/pytz/METADATA.toml @@ -1,4 +1 @@ -version = "2022.1" - -[tool.stubtest] -ignore_missing_stub = false +version = "2022.7.1" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pytz/pytz/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pytz/pytz/__init__.pyi index 6a2f148a6..e6b4d99a1 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pytz/pytz/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pytz/pytz/__init__.pyi @@ -1,4 +1,5 @@ import datetime +from _typeshed import Unused from collections.abc import Mapping from typing import ClassVar @@ -26,9 +27,9 @@ def timezone(zone: str) -> _UTCclass | StaticTzInfo | DstTzInfo: ... class _FixedOffset(datetime.tzinfo): zone: ClassVar[None] def __init__(self, minutes: int) -> None: ... - def utcoffset(self, dt: object) -> datetime.timedelta | None: ... - def dst(self, dt: object) -> datetime.timedelta: ... - def tzname(self, dt: object) -> None: ... + def utcoffset(self, dt: Unused) -> datetime.timedelta | None: ... + def dst(self, dt: Unused) -> datetime.timedelta: ... + def tzname(self, dt: Unused) -> None: ... def localize(self, dt: datetime.datetime, is_dst: bool = ...) -> datetime.datetime: ... def normalize(self, dt: datetime.datetime, is_dst: bool = ...) -> datetime.datetime: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pytz/pytz/lazy.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pytz/pytz/lazy.pyi index 77ba8b6b5..84a7d2e22 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pytz/pytz/lazy.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pytz/pytz/lazy.pyi @@ -1,16 +1,17 @@ from _typeshed import Incomplete -from collections.abc import Mapping as DictMixin +from collections.abc import Iterator, Mapping as DictMixin -class LazyDict(DictMixin[Incomplete, Incomplete]): - data: Incomplete - def __getitem__(self, key): ... - def __contains__(self, key): ... - def __iter__(self): ... - def __len__(self): ... - def keys(self): ... +class LazyDict(DictMixin[str, Incomplete]): + data: dict[str, Incomplete] | None + def __getitem__(self, key: str) -> Incomplete: ... + def __contains__(self, key: object) -> bool: ... + def __iter__(self) -> Iterator[str]: ... + def __len__(self) -> int: ... class LazyList(list[Incomplete]): - def __new__(cls, fill_iter: Incomplete | None = ...): ... + # does not return `Self` type: + def __new__(cls, fill_iter: Incomplete | None = ...) -> LazyList: ... # noqa: Y034 class LazySet(set[Incomplete]): - def __new__(cls, fill_iter: Incomplete | None = ...): ... + # does not return `Self` type: + def __new__(cls, fill_iter: Incomplete | None = ...) -> LazySet: ... # noqa: Y034 diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pytz/pytz/reference.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pytz/pytz/reference.pyi index b3a5d4db0..cf9ceeebb 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pytz/pytz/reference.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pytz/pytz/reference.pyi @@ -1,32 +1,36 @@ import datetime -from _typeshed import Incomplete -from datetime import tzinfo from pytz import UTC as UTC -class FixedOffset(tzinfo): - def __init__(self, offset, name) -> None: ... - def utcoffset(self, dt): ... - def tzname(self, dt): ... - def dst(self, dt): ... +class FixedOffset(datetime.tzinfo): + def __init__(self, offset: float, name: str) -> None: ... + def utcoffset(self, dt: datetime.datetime | None) -> datetime.timedelta: ... + def tzname(self, dt: datetime.datetime | None) -> str: ... + def dst(self, dt: datetime.datetime | None) -> datetime.timedelta: ... STDOFFSET: datetime.timedelta DSTOFFSET: datetime.timedelta -class LocalTimezone(tzinfo): - def utcoffset(self, dt): ... - def dst(self, dt): ... - def tzname(self, dt): ... - -class USTimeZone(tzinfo): - stdoffset: Incomplete - reprname: Incomplete - stdname: Incomplete - dstname: Incomplete - def __init__(self, hours, reprname, stdname, dstname) -> None: ... - def tzname(self, dt): ... - def utcoffset(self, dt): ... - def dst(self, dt): ... +class LocalTimezone(datetime.tzinfo): + def utcoffset(self, dt: datetime.datetime) -> datetime.timedelta: ... # type: ignore[override] + def dst(self, dt: datetime.datetime) -> datetime.timedelta: ... # type: ignore[override] + def tzname(self, dt: datetime.datetime) -> str: ... # type: ignore[override] + +Local: LocalTimezone +DSTSTART: datetime.datetime +DSTEND: datetime.datetime + +def first_sunday_on_or_after(dt: datetime.datetime) -> datetime.datetime: ... + +class USTimeZone(datetime.tzinfo): + stdoffset: datetime.timedelta + reprname: str + stdname: str + dstname: str + def __init__(self, hours: float, reprname: str, stdname: str, dstname: str) -> None: ... + def tzname(self, dt: datetime.datetime | None) -> str: ... + def utcoffset(self, dt: datetime.datetime | None) -> datetime.timedelta: ... + def dst(self, dt: datetime.datetime | None) -> datetime.timedelta: ... Eastern: USTimeZone Central: USTimeZone diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pytz/pytz/tzfile.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pytz/pytz/tzfile.pyi index 5539e590e..db28b7573 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pytz/pytz/tzfile.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pytz/pytz/tzfile.pyi @@ -1 +1,5 @@ -def build_tzinfo(zone, fp): ... +from typing import IO + +from pytz.tzinfo import DstTzInfo + +def build_tzinfo(zone: str, fp: IO[bytes]) -> DstTzInfo: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyvmomi/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/pyvmomi/METADATA.toml index 8c3fa4d21..035acd27d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pyvmomi/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyvmomi/METADATA.toml @@ -1 +1,4 @@ -version = "7.0.*" +version = "8.0.*" + +[tool.stubtest] +ignore_missing_stub = true diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyvmomi/pyVmomi/vim/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyvmomi/pyVmomi/vim/__init__.pyi index c8c47e1a0..4a243eb06 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pyvmomi/pyVmomi/vim/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyvmomi/pyVmomi/vim/__init__.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from datetime import datetime from enum import Enum from typing import Any @@ -7,7 +8,7 @@ from .event import EventManager from .option import OptionManager from .view import ViewManager -def __getattr__(name: str) -> Any: ... # incomplete +def __getattr__(name: str) -> Incomplete: ... class ManagedObject: ... @@ -15,7 +16,7 @@ class ManagedEntity(ManagedObject): _moId: str obj: None name: str - def __getattr__(self, name: str) -> Any: ... # incomplete + def __getattr__(self, name: str) -> Incomplete: ... class ServiceInstanceContent: setting: OptionManager @@ -24,25 +25,25 @@ class ServiceInstanceContent: viewManager: ViewManager perfManager: PerformanceManager eventManager: EventManager - def __getattr__(self, name: str) -> Any: ... # incomplete + def __getattr__(self, name: str) -> Incomplete: ... class ServiceInstance: content: ServiceInstanceContent def CurrentTime(self) -> datetime: ... - def __getattr__(self, name: str) -> Any: ... # incomplete + def __getattr__(self, name: str) -> Incomplete: ... class PerformanceManager: class MetricId: counterId: int instance: str - def __init__(self, counterId: int, instance: str): ... + def __init__(self, counterId: int, instance: str) -> None: ... class PerfCounterInfo: key: int groupInfo: Any nameInfo: Any rollupType: Any - def __getattr__(self, name: str) -> Any: ... # incomplete + def __getattr__(self, name: str) -> Incomplete: ... class QuerySpec: entity: ManagedEntity @@ -50,13 +51,13 @@ class PerformanceManager: intervalId: int maxSample: int startTime: datetime - def __getattr__(self, name: str) -> Any: ... # incomplete + def __getattr__(self, name: str) -> Incomplete: ... class EntityMetricBase: entity: ManagedEntity def QueryPerfCounterByLevel(self, collection_level: int) -> list[PerformanceManager.PerfCounterInfo]: ... def QueryPerf(self, querySpec: list[PerformanceManager.QuerySpec]) -> list[PerformanceManager.EntityMetricBase]: ... - def __getattr__(self, name: str) -> Any: ... # incomplete + def __getattr__(self, name: str) -> Incomplete: ... class ClusterComputeResource(ManagedEntity): ... class ComputeResource(ManagedEntity): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyvmomi/pyVmomi/vim/event.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyvmomi/pyVmomi/vim/event.pyi index 26f3e067d..92bb9396a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pyvmomi/pyVmomi/vim/event.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyvmomi/pyVmomi/vim/event.pyi @@ -8,7 +8,7 @@ class Event: class EventFilterSpec: class ByTime: - def __init__(self, beginTime: datetime): ... + def __init__(self, beginTime: datetime) -> None: ... time: EventFilterSpec.ByTime class EventManager: diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyvmomi/pyVmomi/vmodl/query.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyvmomi/pyVmomi/vmodl/query.pyi index a08179837..d9c464c58 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pyvmomi/pyVmomi/vmodl/query.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyvmomi/pyVmomi/vmodl/query.pyi @@ -13,7 +13,9 @@ class PropertyCollector: pathSet: list[str] class TraversalSpec: - def __init__(self, *, path: str = ..., skip: bool = ..., type: type[ContainerView] = ..., **kwargs) -> None: ... + def __init__( + self, *, path: str = ..., skip: bool = ..., type: type[ContainerView] = ..., **kwargs: Incomplete + ) -> None: ... path: str skip: bool type: type[ContainerView] @@ -37,14 +39,14 @@ class PropertyCollector: *, propSet: list[PropertyCollector.PropertySpec] = ..., objectSet: list[PropertyCollector.ObjectSpec] = ..., - **kwargs, + **kwargs: Incomplete, ) -> None: ... propSet: list[PropertyCollector.PropertySpec] objectSet: list[PropertyCollector.ObjectSpec] def __getattr__(self, name: str) -> Incomplete: ... class ObjectContent: - def __init__(self, *, obj: ManagedEntity = ..., propSet: list[DynamicProperty] = ..., **kwargs) -> None: ... + def __init__(self, *, obj: ManagedEntity = ..., propSet: list[DynamicProperty] = ..., **kwargs: Incomplete) -> None: ... obj: ManagedEntity propSet: list[DynamicProperty] def __getattr__(self, name: str) -> Incomplete: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/METADATA.toml new file mode 100644 index 000000000..0e4489b4d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/METADATA.toml @@ -0,0 +1,4 @@ +version = "305.*" + +[tool.stubtest] +platforms = ["win32"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/_win32typing.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/_win32typing.pyi new file mode 100644 index 000000000..9d730bbd4 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/_win32typing.pyi @@ -0,0 +1,6069 @@ +# Not available at runtime. Contains type definitions that are otherwise not exposed and not part of a specific module. +from _typeshed import Incomplete +from collections.abc import Iterable +from typing import overload +from typing_extensions import Literal, Self, final + +class ArgNotFound: ... +class PyOleEmpty: ... +class PyOleMissing: ... +class PyOleNothing: ... + +class PyDSCAPSType: + @property + def dwFlags(self): ... + @property + def dwFreeHw3DAllBuffers(self): ... + @property + def dwFreeHw3DStaticBuffers(self): ... + @property + def dwFreeHw3DStreamingBuffers(self): ... + @property + def dwFreeHwMemBytes(self): ... + @property + def dwFreeHwMixingAllBuffers(self): ... + @property + def dwFreeHwMixingStaticBuffers(self): ... + @property + def dwFreeHwMixingStreamingBuffers(self): ... + @property + def dwMaxContigFreeHwMemBytes(self): ... + @property + def dwMaxHw3DAllBuffers(self): ... + @property + def dwMaxHw3DStaticBuffers(self): ... + @property + def dwMaxHw3DStreamingBuffers(self): ... + @property + def dwMaxHwMixingAllBuffers(self): ... + @property + def dwMaxHwMixingStaticBuffers(self): ... + @property + def dwMaxHwMixingStreamingBuffers(self): ... + @property + def dwMaxSecondarySampleRate(self): ... + @property + def dwMinSecondarySampleRate(self): ... + @property + def dwPlayCpuOverheadSwBuffers(self): ... + @property + def dwPrimaryBuffers(self): ... + @property + def dwTotalHwMemBytes(self): ... + @property + def dwUnlockTransferRateHwBuffers(self): ... + +class PyDSCBCAPSType: + @property + def dwBufferBytes(self): ... + @property + def dwFlags(self): ... + +class PyDSCCAPSType: + @property + def dwChannels(self): ... + @property + def dwFlags(self): ... + @property + def dwFormats(self): ... + +@final +class PyNCB: + @property + def Bufflen(self): ... + @property + def Callname(self): ... + @property + def Cmd_cplt(self): ... + @property + def Command(self): ... + @property + def Event(self): ... + @property + def Lana_num(self): ... + @property + def Lsn(self): ... + @property + def Name(self): ... + @property + def Num(self): ... + @property + def Post(self): ... + def Reset(self, *args, **kwargs): ... # incomplete + @property + def Retcode(self): ... + @property + def Rto(self): ... + @property + def Sto(self): ... + +class COMMTIMEOUTS: ... +class CopyProgressRoutine: ... + +class DOCINFO: + @property + def DocName(self) -> str: ... + @property + def Output(self) -> str: ... + @property + def DataType(self) -> str: ... + @property + def Type(self): ... + +class ExportCallback: ... + +class FORM_INFO_1: + @property + def Flags(self): ... + @property + def Name(self) -> str: ... + @property + def Size(self): ... + @property + def ImageableArea(self): ... + +class ImportCallback: ... +class LARGE_INTEGER: ... + +class NCB: + @property + def Command(self): ... + @property + def Retcode(self): ... + @property + def Lsn(self): ... + @property + def Num(self): ... + @property + def Bufflen(self): ... + @property + def Callname(self) -> str: ... + @property + def Name(self) -> str: ... + @property + def Rto(self) -> str: ... + @property + def Sto(self) -> str: ... + @property + def Lana_num(self): ... + @property + def Cmd_cplt(self): ... + @property + def Event(self): ... + @property + def Post(self): ... + +class PRINTER_DEFAULTS: + @property + def pDatatype(self) -> str: ... + @property + def pDevMode(self) -> PyDEVMODE: ... + @property + def DesiredAccess(self): ... + +class PyACL: + def Initialize(self) -> None: ... + def IsValid(self) -> bool: ... + @overload + def AddAccessAllowedAce(self, __access: int, __sid: PySID) -> None: ... + @overload + def AddAccessAllowedAce(self, __revision: int, __access: int, __sid: PySID) -> None: ... + def AddAccessAllowedAceEx(self, __revision: int, __aceflags: int, __access: int, __sid: PySID) -> None: ... + def AddAccessAllowedObjectAce( + self, AceRevision, AceFlags, AccessMask, ObjectTypeGuid: PyIID, InheritedObjectTypeGuid: PyIID, sid: PySID + ) -> None: ... + def AddAccessDeniedAce(self, __revision: int, __access: int, __sid: PySID, __access1: int, __sid1: PySID) -> None: ... + def AddAccessDeniedAceEx(self, __revision: int, __aceflags: int, __access: int, __sid: PySID) -> None: ... + def AddMandatoryAce(self, AceRevision, AceFlags, MandatoryPolicy, LabelSid: PySID) -> None: ... + def AddAuditAccessAce(self, dwAceRevision, dwAccessMask, sid: PySID, bAuditSuccess, bAuditFailure) -> None: ... + def AddAuditAccessAceEx(self, dwAceRevision, AceFlags, dwAccessMask, sid: PySID, bAuditSuccess, bAuditFailure) -> None: ... + def AddAuditAccessObjectAce( + self, + dwAceRevision, + AceFlags, + dwAccessMask, + ObjectTypeGuid: PyIID, + InheritedObjectTypeGuid: PyIID, + sid: PySID, + bAuditSuccess, + bAuditFailure, + ) -> None: ... + def GetAclSize(self): ... + def GetAclRevision(self): ... + def GetAceCount(self) -> int: ... + def GetAce(self, __index: int) -> tuple[tuple[int, int], int, PySID]: ... + def DeleteAce(self, __index: int) -> None: ... + def GetEffectiveRightsFromAcl(self, __trustee: PyTRUSTEE | dict[str, int | PySID]) -> int: ... + def GetAuditedPermissionsFromAcl(self, trustee: PyTRUSTEE) -> tuple[Incomplete, Incomplete]: ... + def SetEntriesInAcl(self, __obexpl_list: tuple[dict[str, int | dict[str, int | PySID]], ...]) -> PyACL: ... + def GetExplicitEntriesFromAcl(self) -> tuple[dict[str, int | dict[str, int | PySID]]] | None: ... + +class PyBITMAP: + @property + def bmType(self) -> int: ... + @property + def bmWidth(self) -> int: ... + @property + def bmHeight(self) -> int: ... + @property + def bmWidthBytes(self) -> int: ... + @property + def bmPlanes(self) -> int: ... + +class PyBLENDFUNCTION: ... +class PyCEHANDLE: ... + +class PyCERTSTORE: + @property + def HCERTSTORE(self): ... + # Flags argument is deprecated. + # The underlying function is now always called with `CERT_CLOSE_STORE_CHECK_FLAG`, + # and support for this param will be dropped at some point in the future. + def CertCloseStore(self, Flags: int = ...) -> None: ... + def CertControlStore(self, Flags, CtrlType, CtrlPara: int) -> None: ... + def CertEnumCertificatesInStore(self) -> list[PyCERT_CONTEXT]: ... + def CertEnumCTLsInStore(self) -> list[PyCTL_CONTEXT]: ... + def CertSaveStore(self, MsgAndCertEncodingType, SaveAs, SaveTo, SaveToPara: str | int, Flags=...) -> None: ... + def CertAddEncodedCertificateToStore(self, CertEncodingType, CertEncoded, AddDisposition) -> PyCERT_CONTEXT: ... + def CertAddCertificateContextToStore(self, CertContext: PyCERT_CONTEXT, AddDisposition) -> PyCERT_CONTEXT: ... + def CertAddCertificateLinkToStore(self, CertContext: PyCERT_CONTEXT, AddDisposition) -> PyCERT_CONTEXT: ... + def CertAddCTLContextToStore(self, CtlContext: PyCTL_CONTEXT, AddDisposition) -> PyCTL_CONTEXT: ... + def CertAddCTLLinkToStore(self, CtlContext: PyCTL_CONTEXT, AddDisposition) -> PyCTL_CONTEXT: ... + def CertAddStoreToCollection(self, SiblingStore: PyCERTSTORE, UpdateFlag: int = ..., Priority: int = ...) -> None: ... + def CertRemoveStoreFromCollection(self, SiblingStore: PyCERTSTORE) -> None: ... + def PFXExportCertStoreEx(self, Flags, Password: Incomplete | None = ...): ... + +class PyCERT_ALT_NAME_ENTRY: ... +class PyCERT_ALT_NAME_INFO: ... + +class PyCERT_AUTHORITY_KEY_ID_INFO: + @property + def KeyId(self): ... + @property + def CertIssuer(self): ... + @property + def CertSerialNumber(self): ... + +class PyCERT_BASIC_CONSTRAINTS2_INFO: + @property + def fCA(self): ... + @property + def fPathLenConstraint(self): ... + @property + def PathLenConstraint(self): ... + +class PyCERT_BASIC_CONSTRAINTS_INFO: + @property + def SubjectType(self) -> PyCRYPT_BIT_BLOB: ... + @property + def fPathLenConstraint(self): ... + @property + def PathLenConstraint(self): ... + @property + def SubtreesConstraint(self): ... + +class PyCERT_CONTEXT: + @property + def HANDLE(self): ... + @property + def CertStore(self) -> PyCERTSTORE: ... + @property + def CertEncoded(self): ... + @property + def CertEncodingType(self): ... + @property + def Version(self): ... + @property + def Subject(self) -> str: ... + @property + def Issuer(self) -> str: ... + @property + def NotBefore(self) -> PyTime: ... + @property + def NotAfter(self) -> PyTime: ... + @property + def SignatureAlgorithm(self): ... + @property + def Extension(self) -> tuple[PyCERT_EXTENSION, ...]: ... + @property + def SubjectPublicKeyInfo(self) -> PyCERT_PUBLIC_KEY_INFO: ... + @property + def SerialNumber(self): ... + def CertFreeCertificateContext(self) -> None: ... + def CertEnumCertificateContextProperties(self) -> list[Incomplete]: ... + def CryptAcquireCertificatePrivateKey(self, Flags: int = ...) -> tuple[Incomplete, PyCRYPTPROV]: ... + def CertGetIntendedKeyUsage(self): ... + def CertGetEnhancedKeyUsage(self, Flags: int = ...): ... + def CertSerializeCertificateStoreElement(self, Flags: int = ...) -> str: ... + def CertVerifySubjectCertificateContext(self, Issuer: PyCERT_CONTEXT, Flags): ... + def CertDeleteCertificateFromStore(self) -> None: ... + def CertGetCertificateContextProperty(self, PropId): ... + def CertSetCertificateContextProperty(self, PropId, Data, Flags: int = ...) -> None: ... + +class PyCERT_EXTENSION: + @property + def ObjId(self): ... + @property + def Critical(self): ... + @property + def Value(self): ... + +class PyCERT_KEY_ATTRIBUTES_INFO: + @property + def KeyId(self): ... + @property + def IntendedKeyUsage(self) -> PyCRYPT_BIT_BLOB: ... + @property + def PrivateKeyUsagePeriod(self): ... + +class PyCERT_NAME_INFO: ... +class PyCERT_NAME_VALUE: ... +class PyCERT_OTHER_NAME: ... + +class PyCERT_POLICY_INFO: + @property + def PolicyIdentifier(self): ... + @property + def PolicyQualifier(self): ... + +class PyCERT_PUBLIC_KEY_INFO: + @property + def Algorithm(self) -> PyCRYPT_ALGORITHM_IDENTIFIER: ... + @property + def PublicKey(self) -> PyCRYPT_BIT_BLOB: ... + +class PyCOMSTAT: + @property + def cbInQue(self) -> int: ... + @property + def cbOutQue(self) -> int: ... + @property + def fCtsHold(self) -> int: ... + @property + def fDsrHold(self) -> int: ... + @property + def fRlsdHold(self) -> int: ... + @property + def fXoffHold(self) -> int: ... + @property + def fXoffSent(self) -> int: ... + @property + def fEof(self) -> int: ... + @property + def fTxim(self) -> int: ... + @property + def fReserved(self) -> int: ... + +@final +class PyCOORD: + @property + def X(self): ... + @property + def Y(self): ... + +class PyCREDENTIAL: + @property + def Flags(self): ... + @property + def Type(self): ... + @property + def TargetName(self) -> str: ... + @property + def Comment(self) -> str: ... + @property + def LastWritten(self) -> PyTime: ... + @property + def CredentialBlob(self) -> str: ... + @property + def Persist(self): ... + @property + def Attributes(self): ... + @property + def TargetAlias(self) -> str: ... + @property + def UserName(self) -> str: ... + +class PyCREDENTIAL_ATTRIBUTE: + @property + def Keyword(self) -> str: ... + @property + def Flags(self): ... + @property + def Value(self): ... + +class PyCREDENTIAL_TARGET_INFORMATION: + @property + def TargetName(self) -> str: ... + @property + def NetbiosServerName(self) -> str: ... + @property + def DnsServerName(self) -> str: ... + @property + def NetbiosDomainName(self) -> str: ... + @property + def DnsDomainName(self) -> str: ... + @property + def DnsTreeName(self) -> str: ... + @property + def PackageName(self) -> str: ... + @property + def Flags(self): ... + @property + def CredTypes(self) -> tuple[Incomplete, ...]: ... + +class PyCREDUI_INFO: + @property + def Parent(self) -> int: ... + @property + def MessageText(self) -> str: ... + @property + def CaptionText(self) -> str: ... + @property + def Banner(self) -> int: ... + +class PyCRYPTHASH: + def CryptDestroyHash(self) -> None: ... + def CryptDuplicateHash(self, Flags: int = ...) -> PyCRYPTHASH: ... + def CryptHashData(self, Data: str, Flags: int = ...) -> None: ... + def CryptHashSessionKey(self, Key: PyCRYPTKEY, Flags: int = ...) -> None: ... + def CryptSignHash(self, KeySpec, Flags: int = ...) -> str: ... + def CryptVerifySignature(self, Signature: str, PubKey: PyCRYPTKEY, Flags: int = ...) -> None: ... + def CryptGetHashParam(self, Param, Flags: int = ...): ... + +class PyCRYPTKEY: + @property + def HCRYPTPROV(self): ... + @property + def HCRYPTKEY(self): ... + def CryptDestroyKey(self) -> None: ... + def CryptExportKey(self, ExpKey: PyCRYPTKEY, BlobType, Flags: int = ...): ... + def CryptGetKeyParam(self, Param, Flags: int = ...): ... + def CryptDuplicateKey(self, Reserved: int = ..., Flags: int = ...) -> PyCRYPTKEY: ... + def CryptEncrypt(self, Final, Data, Hash: PyCRYPTHASH | None = ..., Flags: int = ...): ... + def CryptDecrypt(self, Final, Data, Hash: PyCRYPTHASH | None = ..., Flags: int = ...): ... + +class PyCRYPTMSG: + @property + def HCRYPTMSG(self): ... + def CryptMsgClose(self) -> None: ... + +class PyCRYPTPROTECT_PROMPTSTRUCT: ... + +class PyCRYPTPROV: + def CryptReleaseContext(self, Flags: int = ...) -> None: ... + def CryptGenKey(self, Algid, Flags, KeyLen: int = ...) -> PyCRYPTKEY: ... + def CryptGetProvParam(self, Param, Flags: int = ...) -> None: ... + def CryptGetUserKey(self, KeySpec) -> PyCRYPTKEY: ... + def CryptGenRandom(self, Len, SeedData: str | None = ...) -> str: ... + def CryptCreateHash(self, Algid, Key: PyCRYPTKEY | None = ..., Flags: int = ...) -> PyCRYPTHASH: ... + def CryptImportKey(self, Data, PubKey: PyCRYPTKEY | None = ..., Flags: int = ...) -> PyCRYPTKEY: ... + def CryptExportPublicKeyInfo(self, KeySpec, CertEncodingType) -> PyCERT_PUBLIC_KEY_INFO: ... + def CryptImportPublicKeyInfo(self, Info, CertEncodingType) -> PyCRYPTKEY: ... + +class PyCRYPT_ALGORITHM_IDENTIFIER: + @property + def ObjId(self): ... + @property + def Parameters(self): ... + +class PyCRYPT_ATTRIBUTE: + @property + def ObjId(self): ... + @property + def Value(self) -> tuple[Incomplete, ...]: ... + +class PyCRYPT_BIT_BLOB: + @property + def Data(self): ... + @property + def UnusedBits(self): ... + +class PyCRYPT_DECRYPT_MESSAGE_PARA: + @property + def CertStores(self) -> tuple[Incomplete, ...]: ... + @property + def MsgAndCertEncodingType(self): ... + @property + def Flags(self): ... + +class PyCRYPT_ENCRYPT_MESSAGE_PARA: + @property + def ContentEncryptionAlgorithm(self) -> PyCRYPT_ALGORITHM_IDENTIFIER: ... + @property + def CryptProv(self) -> PyCRYPTPROV: ... + @property + def EncryptionAuxInfo(self): ... + @property + def Flags(self): ... + @property + def InnerContentType(self): ... + @property + def MsgEncodingType(self): ... + +class PyCRYPT_SIGN_MESSAGE_PARA: + @property + def SigningCert(self) -> PyCERT_CONTEXT: ... + @property + def HashAlgorithm(self) -> PyCRYPT_ALGORITHM_IDENTIFIER: ... + @property + def HashAuxInfo(self): ... + @property + def MsgCert(self) -> tuple[PyCERT_CONTEXT, ...]: ... + @property + def MsgCrl(self) -> tuple[Incomplete, ...]: ... + @property + def AuthAttr(self) -> tuple[PyCRYPT_ATTRIBUTE, ...]: ... + @property + def UnauthAttr(self) -> tuple[PyCRYPT_ATTRIBUTE, ...]: ... + @property + def Flags(self): ... + @property + def InnerContentType(self): ... + @property + def MsgEncodingType(self): ... + +class PyCRYPT_VERIFY_MESSAGE_PARA: + @property + def MsgAndCertEncodingType(self): ... + @property + def CryptProv(self) -> PyCRYPTPROV: ... + @property + def PyGetSignerCertificate(self): ... + @property + def GetArg(self): ... + +class PyCTL_CONTEXT: + @property + def HCTL_CONTEXT(self): ... + def CertFreeCTLContext(self) -> None: ... + def CertEnumCTLContextProperties(self) -> tuple[Incomplete, ...]: ... + def CertEnumSubjectInSortedCTL(self) -> tuple[tuple[Incomplete, Incomplete], ...]: ... + def CertDeleteCTLFromStore(self) -> None: ... + def CertSerializeCTLStoreElement(self, Flags: int = ...) -> str: ... + +class PyCTL_USAGE: ... + +@final +class PyConsoleScreenBuffer: + def SetConsoleActiveScreenBuffer(self) -> None: ... + def GetConsoleCursorInfo(self) -> tuple[Incomplete, Incomplete]: ... + def SetConsoleCursorInfo(self, Size, Visible) -> None: ... + def GetConsoleMode(self): ... + def SetConsoleMode(self, Mode) -> None: ... + def ReadConsole(self, NumberOfCharsToRead): ... + def WriteConsole(self, Buffer): ... + def FlushConsoleInputBuffer(self) -> None: ... + def SetConsoleTextAttribute(self, __Attributes: int) -> None: ... + def SetConsoleCursorPosition(self, CursorPosition: PyCOORD) -> None: ... + def SetConsoleScreenBufferSize(self, Size: PyCOORD) -> None: ... + def SetConsoleWindowInfo(self, Absolute, ConsoleWindow: PySMALL_RECT) -> None: ... + def GetConsoleScreenBufferInfo(self): ... + def GetLargestConsoleWindowSize(self) -> PyCOORD: ... + def FillConsoleOutputAttribute(self, Attribute, Length, WriteCoord: PyCOORD): ... + def FillConsoleOutputCharacter(self, Character, Length, WriteCoord: PyCOORD): ... + def ReadConsoleOutputCharacter(self, Length, ReadCoord: PyCOORD) -> str: ... + def ReadConsoleOutputAttribute(self, Length, ReadCoord: PyCOORD) -> tuple[Incomplete, ...]: ... + def WriteConsoleOutputCharacter(self, Characters, WriteCoord: PyCOORD): ... + def WriteConsoleOutputAttribute(self, Attributes: tuple[Incomplete, ...], WriteCoord: PyCOORD): ... + def ScrollConsoleScreenBuffer( + self, ScrollRectangle: PySMALL_RECT, ClipRectangle: PySMALL_RECT, DestinationOrigin: PyCOORD, FillCharacter, FillAttribute + ) -> None: ... + def GetCurrentConsoleFont(self, MaximumWindow: bool = ...) -> tuple[Incomplete, PyCOORD]: ... + def GetConsoleFontSize(self, Font) -> PyCOORD: ... + def SetConsoleFont(self, Font) -> None: ... + def SetStdHandle(self, StdHandle) -> None: ... + def SetConsoleDisplayMode(self, Flags, NewScreenBufferDimensions: PyCOORD) -> None: ... + def WriteConsoleInput(self, __Buffer: Iterable[PyINPUT_RECORD]): ... + def ReadConsoleInput(self, Length) -> tuple[PyINPUT_RECORD, ...]: ... + def PeekConsoleInput(self, Length) -> tuple[PyINPUT_RECORD, ...]: ... + def GetNumberOfConsoleInputEvents(self): ... + def Close(self, *args, **kwargs): ... # incomplete + def Detach(self, *args, **kwargs): ... # incomplete + +class PyCredHandle: + def Detach(self): ... + def FreeCredentialsHandle(self) -> None: ... + def QueryCredentialsAttributes(self, Attribute) -> None: ... + +class PyCtxtHandle: + def Detach(self): ... + def CompleteAuthToken(self, Token: PySecBufferDesc) -> None: ... + def QueryContextAttributes(self, Attribute) -> None: ... + def DeleteSecurityContext(self) -> None: ... + def QuerySecurityContextToken(self): ... + def MakeSignature(self, fqop, Message: PySecBufferDesc, MessageSeqNo) -> None: ... + def VerifySignature(self, Message: PySecBufferDesc, MessageSeqNo) -> None: ... + def EncryptMessage(self, fqop, Message: PySecBufferDesc, MessageSeqNo) -> None: ... + def DecryptMessage(self, Message: PySecBufferDesc, MessageSeqNo) -> None: ... + def ImpersonateSecurityContext(self) -> None: ... + def RevertSecurityContext(self) -> None: ... + +class PyDCB: + @property + def BaudRate(self) -> int: ... + @property + def wReserved(self) -> int: ... + @property + def XonLim(self) -> int: ... + @property + def XoffLim(self) -> int: ... + @property + def ByteSize(self) -> int: ... + @property + def Parity(self) -> int: ... + @property + def StopBits(self) -> int: ... + @property + def XonChar(self) -> str: ... + @property + def XoffChar(self) -> str: ... + @property + def ErrorChar(self) -> str: ... + @property + def EofChar(self) -> str: ... + @property + def EvtChar(self) -> str: ... + @property + def wReserved1(self) -> int: ... + @property + def fBinary(self) -> int: ... + @property + def fParity(self) -> int: ... + @property + def fOutxCtsFlow(self) -> int: ... + @property + def fOutxDsrFlow(self) -> int: ... + @property + def fDtrControl(self) -> int: ... + @property + def fDsrSensitivity(self) -> int: ... + @property + def fTXContinueOnXoff(self) -> int: ... + @property + def fOutX(self) -> int: ... + @property + def fInX(self) -> int: ... + @property + def fErrorChar(self) -> int: ... + @property + def fNull(self) -> int: ... + @property + def fRtsControl(self) -> int: ... + @property + def fAbortOnError(self) -> int: ... + @property + def fDummy2(self) -> int: ... + +class PyDEVMODE: + @property + def SpecVersion(self) -> int: ... + @property + def DriverVersion(self) -> int: ... + @property + def Size(self) -> int: ... + @property + def DriverExtra(self) -> int: ... + @property + def Fields(self) -> int: ... + @property + def Orientation(self) -> int: ... + @property + def PaperSize(self) -> int: ... + @property + def PaperLength(self) -> int: ... + @property + def PaperWidth(self) -> int: ... + @property + def Position_x(self) -> int: ... + @property + def Position_y(self) -> int: ... + @property + def DisplayOrientation(self) -> int: ... + @property + def DisplayFixedOutput(self) -> int: ... + @property + def Scale(self) -> int: ... + @property + def Copies(self) -> int: ... + @property + def DefaultSource(self) -> int: ... + @property + def PrintQuality(self) -> int: ... + @property + def Color(self) -> int: ... + @property + def Duplex(self) -> int: ... + @property + def YResolution(self) -> int: ... + @property + def TTOption(self) -> int: ... + @property + def Collate(self) -> int: ... + @property + def LogPixels(self) -> int: ... + @property + def BitsPerPel(self) -> int: ... + @property + def PelsWidth(self) -> int: ... + @property + def PelsHeight(self) -> int: ... + @property + def DisplayFlags(self) -> int: ... + @property + def DisplayFrequency(self) -> int: ... + @property + def ICMMethod(self) -> int: ... + @property + def ICMIntent(self) -> int: ... + @property + def MediaType(self) -> int: ... + @property + def DitherType(self) -> int: ... + @property + def Reserved1(self) -> int: ... + @property + def Reserved2(self) -> int: ... + @property + def Nup(self) -> int: ... + @property + def PanningWidth(self) -> int: ... + @property + def PanningHeight(self) -> int: ... + @property + def DeviceName(self) -> str: ... + @property + def FormName(self) -> str: ... + @property + def DriverData(self) -> Incomplete | None: ... + def Clear(self) -> None: ... + +class PyDEVMODEW: + @property + def SpecVersion(self) -> int: ... + @property + def DriverVersion(self) -> int: ... + @property + def Size(self) -> int: ... + @property + def DriverExtra(self) -> int: ... + @property + def Fields(self) -> int: ... + @property + def Orientation(self) -> int: ... + @property + def PaperSize(self) -> int: ... + @property + def PaperLength(self) -> int: ... + @property + def PaperWidth(self) -> int: ... + @property + def Position_x(self) -> int: ... + @property + def Position_y(self) -> int: ... + @property + def DisplayOrientation(self) -> int: ... + @property + def DisplayFixedOutput(self) -> int: ... + @property + def Scale(self) -> int: ... + @property + def Copies(self) -> int: ... + @property + def DefaultSource(self) -> int: ... + @property + def PrintQuality(self) -> int: ... + @property + def Color(self) -> int: ... + @property + def Duplex(self) -> int: ... + @property + def YResolution(self) -> int: ... + @property + def TTOption(self) -> int: ... + @property + def Collate(self) -> int: ... + @property + def LogPixels(self) -> int: ... + @property + def BitsPerPel(self) -> int: ... + @property + def PelsWidth(self) -> int: ... + @property + def PelsHeight(self) -> int: ... + @property + def DisplayFlags(self) -> int: ... + @property + def DisplayFrequency(self) -> int: ... + @property + def ICMMethod(self) -> int: ... + @property + def ICMIntent(self) -> int: ... + @property + def MediaType(self) -> int: ... + @property + def DitherType(self) -> int: ... + @property + def Reserved1(self) -> int: ... + @property + def Reserved2(self) -> int: ... + @property + def Nup(self) -> int: ... + @property + def PanningWidth(self) -> int: ... + @property + def PanningHeight(self) -> int: ... + @property + def DeviceName(self) -> str: ... + @property + def FormName(self) -> str: ... + @property + def DriverData(self) -> Incomplete | None: ... + +class PyDISPLAY_DEVICE: + @property + def Size(self) -> int: ... + @property + def DeviceName(self) -> str: ... + @property + def DeviceString(self) -> str: ... + @property + def StateFlags(self) -> int: ... + @property + def DeviceID(self) -> str: ... + @property + def DeviceKey(self) -> str: ... + def Clear(self) -> None: ... + +class PyDLGITEMTEMPLATE: ... +class PyDLGTEMPLATE: ... +class PyDS_HANDLE: ... +class PyDS_NAME_RESULT_ITEM: ... + +class PyDateTime: + def Format(self): ... + +class PyDialogTemplate: ... +class PyEVTLOG_HANDLE: ... +class PyEVT_HANDLE: ... +class PyEVT_RPC_LOGIN: ... + +class PyEventLogRecord: + @property + def Reserved(self) -> int: ... + @property + def RecordNumber(self) -> int: ... + @property + def TimeGenerated(self) -> PyTime: ... + @property + def TimeWritten(self) -> PyTime: ... + @property + def EventID(self) -> int: ... + @property + def EventType(self) -> int: ... + @property + def EventCategory(self) -> int: ... + @property + def ReservedFlags(self) -> int: ... + @property + def ClosingRecordNumber(self) -> int: ... + @property + def SourceName(self) -> str: ... + @property + def StringInserts(self) -> tuple[str, ...]: ... + @property + def Sid(self) -> PySID | None: ... + @property + def Data(self) -> str: ... + @property + def ComputerName(self) -> str: ... + +class PyGROUP_INFO_0: + @property + def name(self) -> str: ... + +class PyGROUP_INFO_1: + @property + def name(self) -> str: ... + @property + def comment(self) -> str: ... + +class PyGROUP_INFO_1002: + @property + def comment(self) -> str: ... + +class PyGROUP_INFO_1005: + @property + def attributes(self): ... + +class PyGROUP_INFO_2: + @property + def name(self) -> str: ... + @property + def comment(self) -> str: ... + @property + def group_id(self): ... + @property + def attributes(self): ... + +class PyGROUP_USERS_INFO_0: + @property + def name(self) -> str: ... + +class PyGROUP_USERS_INFO_1: + @property + def name(self) -> str: ... + @property + def attributes(self): ... + +class PyGdiHANDLE: ... +class PyGetSignerCertificate: ... + +class PyHANDLE: + @property + def handle(self) -> int: ... + def Close(self) -> None: ... + def close(self) -> None: ... + def Detach(self) -> Self: ... + +@final +class PyHDESK: + def SetThreadDesktop(self) -> None: ... + def EnumDesktopWindows(self) -> tuple[int, ...]: ... + def SwitchDesktop(self) -> None: ... + def CloseDesktop(self) -> None: ... + def Detach(self, *args, **kwargs): ... # incomplete + +class PyHDEVNOTIFY: ... + +class PyHHNTRACK: + @property + def action(self): ... + @property + def hdr(self): ... + @property + def curUrl(self) -> str: ... + @property + def winType(self): ... + +class PyHHN_NOTIFY: + @property + def hdr(self): ... + @property + def url(self) -> str: ... + +class PyHH_AKLINK: + @property + def indexOnFail(self): ... + @property + def keywords(self) -> str: ... + @property + def url(self) -> str: ... + @property + def msgText(self) -> str: ... + @property + def msgTitle(self) -> str: ... + @property + def window(self) -> str: ... + +class PyHH_FTS_QUERY: + @property + def uniCodeStrings(self): ... + @property + def proximity(self): ... + @property + def stemmedSearch(self): ... + @property + def titleOnly(self): ... + @property + def execute(self): ... + @property + def searchQuery(self) -> str: ... + +class PyHH_POPUP: + @property + def hinst(self): ... + @property + def idString(self): ... + @property + def clrForeground(self): ... + @property + def clrBackground(self): ... + @property + def text(self) -> str: ... + @property + def font(self) -> str: ... + @property + def pt(self): ... + @property + def margins(self): ... + +class PyHH_WINTYPE: + @property + def uniCodeStrings(self): ... + @property + def validMembers(self): ... + @property + def winProperties(self): ... + @property + def styles(self): ... + @property + def exStyles(self): ... + @property + def showState(self): ... + @property + def hwndHelp(self): ... + @property + def hwndCaller(self): ... + @property + def hwndToolBar(self): ... + @property + def hwndNavigation(self): ... + @property + def hwndHTML(self): ... + @property + def navWidth(self): ... + @property + def toolBarFlags(self): ... + @property + def notExpanded(self): ... + @property + def curNavType(self): ... + @property + def idNotify(self): ... + @property + def typeName(self) -> str: ... + @property + def caption(self) -> str: ... + @property + def windowPos(self): ... + @property + def HTMLPos(self): ... + @property + def toc(self) -> str: ... + @property + def index(self) -> str: ... + @property + def file(self) -> str: ... + @property + def home(self) -> str: ... + @property + def jump1(self) -> str: ... + @property + def jump2(self) -> str: ... + @property + def urlJump1(self) -> str: ... + @property + def urlJump2(self) -> str: ... + +class PyHINTERNET: ... + +class PyHKEY: + def Close(self): ... + +class PyHTHEME: ... + +@final +class PyHWINSTA: + def EnumDesktops(self) -> tuple[Incomplete, ...]: ... + def SetProcessWindowStation(self) -> None: ... + def CloseWindowStation(self) -> None: ... + def Detach(self, *args, **kwargs): ... # incomplete + +class PyICONINFO: ... + +@final +class PyIID: ... + +@final +class PyINPUT_RECORD: + EventType: int + KeyDown: int | bool + RepeatCount: int + VirtualKeyCode: int + VirtualScanCode: Incomplete + Char: str + ControlKeyState: int + ButtonState: int + EventFlags: int + MousePosition: PyCOORD + Size: PyCOORD + SetFocus: Incomplete + CommandId: Incomplete + +class PyLOCALGROUP_INFO_0: + @property + def name(self) -> str: ... + +class PyLOCALGROUP_INFO_1: + @property + def name(self) -> str: ... + @property + def comment(self) -> str: ... + +class PyLOCALGROUP_INFO_1002: + @property + def comment(self) -> str: ... + +class PyLOCALGROUP_MEMBERS_INFO_0: + @property + def sid(self) -> PySID: ... + +class PyLOCALGROUP_MEMBERS_INFO_1: + @property + def sid(self) -> PySID: ... + @property + def sidusage(self): ... + @property + def name(self) -> str: ... + +class PyLOCALGROUP_MEMBERS_INFO_2: + @property + def sid(self) -> PySID: ... + @property + def sidusage(self): ... + @property + def domainandname(self) -> str: ... + +class PyLOCALGROUP_MEMBERS_INFO_3: + @property + def domainandname(self) -> str: ... + +class PyLOGBRUSH: + @property + def Style(self): ... + @property + def Color(self): ... + @property + def Hatch(self) -> int: ... + +class PyLOGFONT: + @property + def lfHeight(self) -> int: ... + @property + def lfWidth(self) -> int: ... + @property + def lfEscapement(self) -> int: ... + @property + def lfOrientation(self) -> int: ... + @property + def lfWeight(self) -> int: ... + @property + def lfItalic(self) -> int: ... + @property + def lfUnderline(self) -> int: ... + @property + def lfStrikeOut(self) -> int: ... + @property + def lfCharSet(self) -> int: ... + @property + def lfOutPrecision(self) -> int: ... + @property + def lfClipPrecision(self) -> int: ... + @property + def lfQuality(self) -> int: ... + @property + def lfPitchAndFamily(self) -> int: ... + @property + def lfFaceName(self) -> str: ... + +class PyLSA_HANDLE: ... +class PyLUID_AND_ATTRIBUTES: ... +class PyLsaLogon_HANDLE: ... +class PyMSG: ... + +@final +class PyNETRESOURCE: + @property + def dwScope(self) -> int: ... + @property + def dwType(self) -> int: ... + @property + def dwDisplayType(self) -> int: ... + @property + def dwUsage(self) -> int: ... + @property + def lpComment(self): ... + @property + def lpLocalName(self): ... + @property + def lpProvider(self): ... + @property + def lpRemoteName(self): ... + +class PyNET_VALIDATE_AUTHENTICATION_INPUT_ARG: ... +class PyNET_VALIDATE_PASSWORD_CHANGE_INPUT_ARG: ... +class PyNET_VALIDATE_PERSISTED_FIELDS: ... + +class PyNMHDR: + @property + def hwndFrom(self): ... + @property + def idFrom(self): ... + @property + def code(self): ... + +class PyNOTIFYICONDATA: ... + +class PyOVERLAPPED: + Offset: int + OffsetHigh: int + object: object + dword: int + hEvent: int + Internal: int + InternalHigh: int + +class PyOVERLAPPEDReadBuffer: ... + +class PyPERF_COUNTER_DEFINITION: + @property + def DefaultScale(self) -> int: ... + @property + def DetailLevel(self) -> int: ... + @property + def CounterType(self) -> int: ... + @property + def CounterNameTitleIndex(self) -> int: ... + @property + def CounterHelpTitleIndex(self) -> int: ... + def Increment(self) -> None: ... + def Decrement(self) -> None: ... + def Set(self) -> None: ... + def Get(self) -> None: ... + +class PyPERF_OBJECT_TYPE: + @property + def ObjectNameTitleIndex(self) -> int: ... + @property + def ObjectHelpTitleIndex(self) -> int: ... + @property + def DefaultCounterIndex(self) -> int: ... + def Close(self) -> None: ... + +class PyPOINT: ... + +class PyPROFILEINFO: + @property + def UserName(self) -> str: ... + @property + def Flags(self): ... + @property + def ProfilePath(self) -> str: ... + @property + def DefaultPath(self) -> str: ... + @property + def ServerName(self) -> str: ... + @property + def PolicyPath(self) -> str: ... + @property + def Profile(self) -> PyHKEY: ... + +class PyPerfMonManager: + def Close(self) -> None: ... + +class PyPrinterHANDLE: ... +class PyRECT: ... +class PyResourceId: ... +class PySCROLLINFO: ... +class PySC_HANDLE: ... + +class PySECURITY_ATTRIBUTES: + bInheritHandle: int + SECURITY_DESCRIPTOR: PySECURITY_DESCRIPTOR + +class PySECURITY_DESCRIPTOR: + def Initialize(self) -> None: ... + def GetSecurityDescriptorOwner(self) -> PySID: ... + def GetSecurityDescriptorDacl(self) -> PyACL: ... + def GetSecurityDescriptorSacl(self) -> PyACL: ... + def GetSecurityDescriptorControl(self) -> tuple[Incomplete, Incomplete]: ... + def SetSecurityDescriptorOwner(self, __sid: PySID, __bOwnerDefaulted: int | bool) -> None: ... + def SetSecurityDescriptorGroup(self, sid: PySID, bOwnerDefaulted): ... + def SetSecurityDescriptorDacl(self, __bSaclPresent: int | bool, __SACL: PyACL, __bSaclDefaulted: int | bool) -> None: ... + def SetSecurityDescriptorSacl(self, bSaclPresent, SACL: PyACL, bSaclDefaulted) -> None: ... + def SetSecurityDescriptorControl(self, ControlBitsOfInterest, ControlBitsToSet) -> None: ... + def IsValid(self) -> bool: ... + def GetLength(self) -> None: ... + def IsSelfRelative(self) -> bool: ... + +class PySERVER_INFO_100: + @property + def platform_id(self): ... + @property + def name(self) -> str: ... + +class PySERVER_INFO_101: + @property + def platform_id(self): ... + @property + def name(self) -> str: ... + @property + def version_major(self): ... + @property + def version_minor(self): ... + @property + def type(self): ... + @property + def comment(self) -> str: ... + +class PySERVER_INFO_102: + @property + def platform_id(self): ... + @property + def name(self) -> str: ... + @property + def version_major(self): ... + @property + def version_minor(self): ... + @property + def type(self): ... + @property + def comment(self) -> str: ... + @property + def users(self): ... + @property + def disc(self): ... + @property + def hidden(self): ... + @property + def announce(self): ... + @property + def anndelta(self): ... + @property + def userpath(self) -> str: ... + +class PySERVER_INFO_402: + @property + def ulist_mtime(self): ... + @property + def glist_mtime(self): ... + @property + def alist_mtime(self): ... + @property + def security(self): ... + @property + def numadmin(self): ... + @property + def lanmask(self): ... + @property + def guestacct(self) -> str: ... + @property + def chdevs(self): ... + @property + def chdevq(self): ... + @property + def chdevjobs(self): ... + @property + def connections(self): ... + @property + def shares(self): ... + @property + def openfiles(self): ... + @property + def sessopens(self): ... + @property + def sessvcs(self): ... + @property + def sessreqs(self): ... + @property + def opensearch(self): ... + @property + def activelocks(self): ... + @property + def numreqbuf(self): ... + @property + def sizreqbuf(self): ... + @property + def numbigbuf(self): ... + @property + def numfiletasks(self): ... + @property + def alertsched(self): ... + @property + def erroralert(self): ... + @property + def logonalert(self): ... + @property + def accessalert(self): ... + @property + def diskalert(self): ... + @property + def netioalert(self): ... + @property + def maxauditsz(self): ... + @property + def srvheuristics(self) -> str: ... + +class PySERVER_INFO_403: + @property + def ulist_mtime(self): ... + @property + def glist_mtime(self): ... + @property + def alist_mtime(self): ... + @property + def security(self): ... + @property + def numadmin(self): ... + @property + def lanmask(self): ... + @property + def guestacct(self) -> str: ... + @property + def chdevs(self): ... + @property + def chdevq(self): ... + @property + def chdevjobs(self): ... + @property + def connections(self): ... + @property + def shares(self): ... + @property + def openfiles(self): ... + @property + def sessopens(self): ... + @property + def sessvcs(self): ... + @property + def sessreqs(self): ... + @property + def opensearch(self): ... + @property + def activelocks(self): ... + @property + def numreqbuf(self): ... + @property + def sizreqbuf(self): ... + @property + def numbigbuf(self): ... + @property + def numfiletasks(self): ... + @property + def alertsched(self): ... + @property + def erroralert(self): ... + @property + def logonalert(self): ... + @property + def accessalert(self): ... + @property + def diskalert(self): ... + @property + def netioalert(self): ... + @property + def maxauditsz(self): ... + @property + def srvheuristics(self) -> str: ... + @property + def auditedevents(self): ... + @property + def autoprofile(self): ... + @property + def autopath(self) -> str: ... + +class PySERVER_INFO_502: + @property + def sessopens(self): ... + @property + def sessvcs(self): ... + @property + def opensearch(self): ... + @property + def sizreqbuf(self): ... + @property + def initworkitems(self): ... + @property + def maxworkitems(self): ... + @property + def rawworkitems(self): ... + @property + def irpstacksize(self): ... + @property + def maxrawbuflen(self): ... + @property + def sessusers(self): ... + @property + def sessconns(self): ... + @property + def maxpagedmemoryusage(self): ... + @property + def maxnonpagedmemoryusage(self): ... + @property + def enableforcedlogoff(self): ... + @property + def timesource(self): ... + @property + def acceptdownlevelapis(self): ... + @property + def lmannounce(self): ... + +class PySERVER_INFO_503: + @property + def sessopens(self): ... + @property + def sessvcs(self): ... + @property + def opensearch(self): ... + @property + def sizreqbuf(self): ... + @property + def initworkitems(self): ... + @property + def maxworkitems(self): ... + @property + def rawworkitems(self): ... + @property + def irpstacksize(self): ... + @property + def maxrawbuflen(self): ... + @property + def sessusers(self): ... + @property + def sessconns(self): ... + @property + def maxpagedmemoryusage(self): ... + @property + def maxnonpagedmemoryusage(self): ... + @property + def enableforcedlogoff(self): ... + @property + def timesource(self): ... + @property + def acceptdownlevelapis(self): ... + @property + def lmannounce(self): ... + @property + def domain(self) -> str: ... + @property + def maxkeepsearch(self): ... + @property + def scavtimeout(self): ... + @property + def minrcvqueue(self): ... + @property + def minfreeworkitems(self): ... + @property + def xactmemsize(self): ... + @property + def threadpriority(self): ... + @property + def maxmpxct(self): ... + @property + def oplockbreakwait(self): ... + @property + def oplockbreakresponsewait(self): ... + @property + def enableoplocks(self): ... + @property + def enablefcbopens(self): ... + @property + def enableraw(self): ... + @property + def enablesharednetdrives(self): ... + @property + def minfreeconnections(self): ... + @property + def maxfreeconnections(self): ... + +class PySHARE_INFO_0: + @property + def netname(self) -> str: ... + +class PySHARE_INFO_1: + @property + def netname(self) -> str: ... + @property + def type(self): ... + @property + def remark(self) -> str: ... + +class PySHARE_INFO_2: + @property + def netname(self) -> str: ... + @property + def type(self): ... + @property + def remark(self) -> str: ... + @property + def permissions(self): ... + @property + def max_uses(self): ... + @property + def current_uses(self): ... + @property + def path(self) -> str: ... + @property + def passwd(self) -> str: ... + +class PySHARE_INFO_501: + @property + def netname(self) -> str: ... + @property + def type(self): ... + @property + def remark(self) -> str: ... + @property + def flags(self): ... + +class PySHARE_INFO_502: + @property + def netname(self) -> str: ... + @property + def type(self): ... + @property + def remark(self) -> str: ... + @property + def permissions(self): ... + @property + def max_uses(self): ... + @property + def current_uses(self): ... + @property + def path(self) -> str: ... + @property + def passwd(self) -> str: ... + @property + def reserved(self): ... + @property + def security_descriptor(self) -> PySECURITY_DESCRIPTOR: ... + +class PySID: + def Initialize(self, idAuthority, numSubauthorities) -> None: ... + def IsValid(self) -> bool: ... + def SetSubAuthority(self, index, val) -> None: ... + def GetLength(self): ... + def GetSubAuthorityCount(self): ... + def GetSubAuthority(self): ... + def GetSidIdentifierAuthority(self) -> tuple[Incomplete, Incomplete, Incomplete, Incomplete, Incomplete, Incomplete]: ... + +class PySID_AND_ATTRIBUTES: ... +class PySIZE: ... + +@final +class PySMALL_RECT: + @property + def Left(self): ... + @property + def Top(self): ... + @property + def Right(self): ... + @property + def Bottom(self): ... + +class PySTARTUPINFO: + dwX: int + dwY: int + dwXSize: int + dwYSize: int + dwXCountChars: int + dwYCountChars: int + dwFillAttribute: int + dwFlags: int + wShowWindow: int + hStdInput: int + hStdOutput: int + hStdError: int + lpDesktop: str + lpTitle: str + +class PySecBuffer: + @property + def BufferType(self): ... + @property + def Buffer(self) -> str: ... + @property + def BufferSize(self): ... + @property + def MaxBufferSize(self): ... + def Clear(self) -> None: ... + +class PySecBufferDesc: + Version: Incomplete + Buffer: Incomplete + def append(self, buffer) -> None: ... + +class PyTOKEN_GROUPS: ... +class PyTOKEN_PRIVILEGES: ... + +class PyTRIVERTEX: + @property + def x(self): ... + @property + def y(self): ... + @property + def Red(self): ... + @property + def Green(self): ... + @property + def Blue(self): ... + @property + def Alpha(self): ... + +# Properties Multiple* are ignored +class PyTRUSTEE: + @property + def TrusteeForm(self) -> int: ... + @property + def TrusteeType(self) -> int: ... + @property + def Identifier(self) -> PySID: ... + @property + def MultipleTrustee(self) -> None: ... + @property + def MultipleTrusteeOperation(self) -> Literal[0]: ... + +class PyTS_HANDLE: ... + +class PyTime: + @property + def year(self): ... + @property + def month(self): ... + @property + def weekday(self): ... + @property + def day(self): ... + @property + def hour(self): ... + @property + def minute(self): ... + @property + def second(self): ... + @property + def msec(self): ... + def Format(self, _format: str) -> str: ... + +class PyUSER_INFO_0: + @property + def name(self) -> str: ... + +class PyUSER_INFO_1: + @property + def name(self) -> str: ... + @property + def password(self) -> str: ... + @property + def password_age(self): ... + @property + def priv(self): ... + @property + def home_dir(self) -> str: ... + @property + def comment(self) -> str: ... + @property + def flags(self): ... + @property + def script_path(self) -> str: ... + +class PyUSER_INFO_10: + @property + def name(self) -> str: ... + @property + def comment(self) -> str: ... + @property + def usr_comment(self) -> str: ... + @property + def full_name(self) -> str: ... + +class PyUSER_INFO_1003: + @property + def password(self) -> str: ... + +class PyUSER_INFO_1005: + @property + def priv(self): ... + +class PyUSER_INFO_1006: + @property + def home_dir(self) -> str: ... + +class PyUSER_INFO_1007: + @property + def comment(self) -> str: ... + +class PyUSER_INFO_1008: + @property + def flags(self): ... + +class PyUSER_INFO_1009: + @property + def script_path(self) -> str: ... + +class PyUSER_INFO_1010: + @property + def auth_flags(self): ... + +class PyUSER_INFO_1011: + @property + def full_name(self) -> str: ... + +class PyUSER_INFO_11: + @property + def name(self) -> str: ... + @property + def comment(self) -> str: ... + @property + def usr_comment(self) -> str: ... + @property + def full_name(self) -> str: ... + @property + def priv(self): ... + @property + def auth_flags(self): ... + @property + def password_age(self): ... + @property + def home_dir(self) -> str: ... + @property + def parms(self) -> str: ... + @property + def last_logon(self): ... + @property + def last_logoff(self): ... + @property + def bad_pw_count(self): ... + @property + def num_logons(self): ... + @property + def logon_server(self) -> str: ... + @property + def country_code(self): ... + @property + def workstations(self) -> str: ... + @property + def max_storage(self): ... + @property + def units_per_week(self): ... + @property + def logon_hours(self) -> str: ... + @property + def code_page(self): ... + +class PyUSER_INFO_2: + @property + def name(self) -> str: ... + @property + def password(self) -> str: ... + @property + def password_age(self): ... + @property + def priv(self): ... + @property + def home_dir(self) -> str: ... + @property + def comment(self) -> str: ... + @property + def flags(self): ... + @property + def script_path(self) -> str: ... + @property + def auth_flags(self): ... + @property + def full_name(self) -> str: ... + @property + def usr_comment(self) -> str: ... + @property + def parms(self) -> str: ... + @property + def workstations(self) -> str: ... + @property + def last_logon(self): ... + @property + def last_logoff(self): ... + @property + def acct_expires(self): ... + @property + def max_storage(self): ... + @property + def units_per_week(self): ... + @property + def logon_hours(self) -> str: ... + @property + def bad_pw_count(self): ... + @property + def num_logons(self): ... + @property + def logon_server(self) -> str: ... + @property + def country_code(self): ... + @property + def code_page(self): ... + +class PyUSER_INFO_20: + @property + def name(self) -> str: ... + @property + def full_name(self) -> str: ... + @property + def comment(self) -> str: ... + @property + def flags(self): ... + @property + def user_id(self): ... + +class PyUSER_INFO_3: + @property + def name(self) -> str: ... + @property + def password(self) -> str: ... + @property + def password_age(self): ... + @property + def priv(self): ... + @property + def home_dir(self) -> str: ... + @property + def comment(self) -> str: ... + @property + def flags(self): ... + @property + def script_path(self) -> str: ... + @property + def auth_flags(self): ... + @property + def full_name(self) -> str: ... + @property + def usr_comment(self) -> str: ... + @property + def parms(self) -> str: ... + @property + def workstations(self) -> str: ... + @property + def last_logon(self): ... + @property + def last_logoff(self): ... + @property + def acct_expires(self): ... + @property + def max_storage(self): ... + @property + def units_per_week(self): ... + @property + def logon_hours(self) -> str: ... + @property + def bad_pw_count(self): ... + @property + def num_logons(self): ... + @property + def logon_server(self) -> str: ... + @property + def country_code(self): ... + @property + def code_page(self): ... + @property + def user_id(self): ... + @property + def primary_group_id(self): ... + @property + def profile(self) -> str: ... + @property + def home_dir_drive(self) -> str: ... + @property + def password_expired(self): ... + +class PyUSER_INFO_4: + @property + def name(self) -> str: ... + @property + def password(self) -> str: ... + @property + def password_age(self): ... + @property + def priv(self): ... + @property + def home_dir(self) -> str: ... + @property + def comment(self) -> str: ... + @property + def flags(self): ... + @property + def script_path(self) -> str: ... + @property + def auth_flags(self): ... + @property + def full_name(self) -> str: ... + @property + def usr_comment(self) -> str: ... + @property + def parms(self) -> str: ... + @property + def workstations(self) -> str: ... + @property + def last_logon(self): ... + @property + def last_logoff(self): ... + @property + def acct_expires(self): ... + @property + def max_storage(self): ... + @property + def units_per_week(self): ... + @property + def logon_hours(self) -> str: ... + @property + def bad_pw_count(self): ... + @property + def num_logons(self): ... + @property + def logon_server(self) -> str: ... + @property + def country_code(self): ... + @property + def code_page(self): ... + @property + def user_sid(self) -> PySID: ... + @property + def primary_group_id(self): ... + @property + def profile(self) -> str: ... + @property + def home_dir_drive(self) -> str: ... + @property + def password_expired(self): ... + +class PyUSER_MODALS_INFO_0: + @property + def min_passwd_len(self): ... + @property + def max_passwd_age(self): ... + @property + def min_passwd_age(self): ... + @property + def force_logoff(self): ... + @property + def password_hist_len(self): ... + +class PyUSER_MODALS_INFO_1: + @property + def role(self): ... + @property + def primary(self) -> str: ... + +class PyUSER_MODALS_INFO_2: + @property + def domain_name(self) -> str: ... + @property + def domain_id(self) -> PySID: ... + +class PyUSER_MODALS_INFO_3: + @property + def lockout_duration(self): ... + @property + def lockout_observation_window(self): ... + @property + def usrmod3_lockout_threshold(self): ... + +class PyUSE_INFO_0: + @property + def local(self) -> str: ... + @property + def remote(self) -> str: ... + +class PyUSE_INFO_1: + @property + def local(self) -> str: ... + @property + def remote(self) -> str: ... + @property + def password(self) -> str: ... + @property + def status(self): ... + @property + def asg_type(self): ... + @property + def refcount(self): ... + @property + def usecount(self): ... + +class PyUSE_INFO_2: + @property + def local(self) -> str: ... + @property + def remote(self) -> str: ... + @property + def password(self) -> str: ... + @property + def status(self): ... + @property + def asg_type(self): ... + @property + def refcount(self): ... + @property + def usecount(self): ... + @property + def username(self) -> str: ... + @property + def domainname(self) -> str: ... + +class PyUSE_INFO_3: + @property + def local(self) -> str: ... + @property + def remote(self) -> str: ... + @property + def password(self) -> str: ... + @property + def status(self): ... + @property + def asg_type(self): ... + @property + def refcount(self): ... + @property + def usecount(self): ... + @property + def username(self) -> str: ... + @property + def domainname(self) -> str: ... + @property + def flags(self): ... + +class PyUnicode: ... +class PyUrlCacheHANDLE: ... + +class PyWAVEFORMATEX: + @property + def wFormatTag(self) -> int: ... + @property + def nChannels(self) -> int: ... + @property + def nSamplesPerSec(self) -> int: ... + @property + def nAvgBytesPerSec(self) -> int: ... + @property + def nBlockAlign(self) -> int: ... + @property + def wBitsPerSample(self) -> int: ... + +class PyWINHTTP_AUTOPROXY_OPTIONS: ... +class PyWINHTTP_PROXY_INFO: ... + +class PyWKSTA_INFO_100: + @property + def platform_id(self): ... + @property + def computername(self) -> str: ... + @property + def langroup(self) -> str: ... + @property + def ver_major(self): ... + @property + def ver_minor(self): ... + +class PyWKSTA_INFO_101: + @property + def platform_id(self): ... + @property + def computername(self) -> str: ... + @property + def langroup(self) -> str: ... + @property + def ver_major(self): ... + @property + def ver_minor(self): ... + @property + def lanroot(self) -> str: ... + +class PyWKSTA_INFO_102: + @property + def platform_id(self): ... + @property + def computername(self) -> str: ... + @property + def langroup(self) -> str: ... + @property + def ver_major(self): ... + @property + def ver_minor(self): ... + @property + def lanroot(self) -> str: ... + @property + def logged_on_users(self): ... + +class PyWKSTA_INFO_302: + @property + def char_wait(self): ... + @property + def collection_time(self): ... + @property + def maximum_collection_count(self): ... + @property + def keep_conn(self): ... + @property + def keep_search(self): ... + @property + def max_cmds(self): ... + @property + def num_work_buf(self): ... + @property + def siz_work_buf(self): ... + @property + def max_wrk_cache(self): ... + @property + def siz_error(self): ... + @property + def num_alerts(self): ... + @property + def num_services(self): ... + @property + def errlog_sz(self): ... + @property + def print_buf_time(self): ... + @property + def num_char_buf(self): ... + @property + def siz_char_buf(self): ... + @property + def wrk_heuristics(self) -> str: ... + @property + def mailslots(self): ... + @property + def num_dgram_buf(self): ... + +class PyWKSTA_INFO_402: + @property + def char_wait(self): ... + @property + def collection_time(self): ... + @property + def maximum_collection_count(self) -> str: ... + @property + def keep_conn(self): ... + @property + def keep_search(self): ... + @property + def max_cmds(self): ... + @property + def num_work_buf(self): ... + @property + def siz_work_buf(self): ... + @property + def max_wrk_cache(self): ... + @property + def sess_timeout(self): ... + @property + def siz_error(self): ... + @property + def num_alerts(self): ... + @property + def num_services(self): ... + @property + def errlog_sz(self): ... + @property + def print_buf_time(self): ... + @property + def num_char_buf(self): ... + @property + def siz_char_buf(self): ... + @property + def mailslots(self): ... + @property + def num_dgram_buf(self): ... + @property + def max_threads(self): ... + +class PyWKSTA_INFO_502: + @property + def char_wait(self): ... + @property + def collection_time(self): ... + @property + def maximum_collection_count(self): ... + @property + def keep_conn(self): ... + @property + def max_cmds(self): ... + @property + def max_wrk_cache(self): ... + @property + def siz_char_buf(self): ... + @property + def lock_quota(self): ... + @property + def lock_increment(self): ... + @property + def lock_maximum(self): ... + @property + def pipe_increment(self): ... + @property + def pipe_maximum(self): ... + @property + def cache_file_timeout(self): ... + @property + def dormant_file_limit(self): ... + @property + def read_ahead_throughput(self): ... + @property + def num_mailslot_buffers(self): ... + @property + def num_srv_announce_buffers(self): ... + @property + def max_illegal_datagram_events(self): ... + @property + def illegal_datagram_event_reset_frequency(self): ... + @property + def log_election_packets(self): ... + @property + def use_opportunistic_locking(self): ... + @property + def use_unlock_behind(self): ... + @property + def use_close_behind(self): ... + @property + def buf_named_pipes(self): ... + @property + def use_lock_read_unlock(self): ... + @property + def utilize_nt_caching(self): ... + @property + def use_raw_read(self): ... + @property + def use_raw_write(self): ... + @property + def use_write_raw_data(self): ... + @property + def use_encryption(self): ... + @property + def buf_files_deny_write(self): ... + @property + def buf_read_only_files(self): ... + @property + def force_core_create_mode(self): ... + @property + def use_512_byte_max_transfer(self): ... + +class PyWKSTA_TRANSPORT_INFO_0: + @property + def quality_of_service(self): ... + @property + def number_of_vcs(self): ... + @property + def transport_name(self) -> str: ... + @property + def transport_address(self) -> str: ... + @property + def wan_ish(self): ... + +class PyWKSTA_USER_INFO_0: + @property + def username(self) -> str: ... + +class PyWKSTA_USER_INFO_1: + @property + def username(self) -> str: ... + @property + def logon_domain(self) -> str: ... + @property + def oth_domains(self) -> str: ... + @property + def logon_server(self) -> str: ... + +class PyWNDCLASS: + @property + def style(self) -> int: ... + @property + def cbWndExtra(self) -> int: ... + @property + def hInstance(self) -> int: ... + @property + def hIcon(self) -> int: ... + @property + def hCursor(self) -> int: ... + @property + def hbrBackground(self) -> int: ... + @property + def lpszMenuName(self) -> str: ... + @property + def lpszClassName(self) -> str: ... + @property + def lpfnWndProc(self): ... + def SetDialogProc(self) -> None: ... + +class PyXFORM: + @property + def M11(self) -> float: ... + @property + def M12(self) -> float: ... + @property + def M21(self) -> float: ... + @property + def M22(self) -> float: ... + @property + def Dx(self) -> float: ... + @property + def Dy(self) -> float: ... + +class Pymmapfile: + def close(self) -> None: ... + def find(self, needle, start): ... + def flush(self, offset: int = ..., size: int = ...) -> None: ... + def move(self, dest, src, count) -> None: ... + def read(self, num_bytes): ... + def read_byte(self): ... + def read_line(self): ... + def resize(self, MaximumSize, FileOffset: int = ..., NumberOfBytesToMap: int = ...) -> None: ... + def seek(self, dist, how: int = ...) -> None: ... + def size(self): ... + def tell(self): ... + def write(self, data) -> None: ... + def write_byte(self, char) -> None: ... + +class RASDIALEXTENSIONS: + @property + def dwfOptions(self) -> int: ... + @property + def hwndParent(self) -> int: ... + @property + def reserved(self) -> int: ... + @property + def reserved1(self) -> int: ... + @property + def RasEapInfo(self): ... + +class RASDIALPARAMS: ... + +class SC_ACTION: + @property + def Type(self): ... + @property + def Delay(self): ... + +class SERVICE_FAILURE_ACTIONS: + @property + def ResetPeriod(self): ... + @property + def RebootMsg(self) -> str: ... + @property + def Command(self) -> str: ... + @property + def Actions(self): ... + +class SERVICE_STATUS: + def __getitem__(self, __i: int) -> int: ... + +class TRACKMOUSEEVENT: ... +class ULARGE_INTEGER: ... +class WIN32_FIND_DATA: ... +class com_error: ... + +class connection: + def setautocommit(self, c) -> None: ... + def commit(self) -> None: ... + def rollback(self) -> None: ... + def cursor(self) -> None: ... + def close(self) -> None: ... + +class cursor: + def close(self) -> None: ... + def execute(self, sql: str, arg): ... + def fetchone(self): ... + def fetchmany(self) -> list[Incomplete]: ... + def fetchall(self) -> list[Incomplete]: ... + def setinputsizes(self) -> None: ... + def setoutputsize(self) -> None: ... + +class error(Exception): ... + +class COMPONENT: + @property + def ID(self): ... + @property + def ComponentType(self): ... + @property + def Checked(self): ... + @property + def fDirty(self): ... + @property + def NoScroll(self): ... + @property + def Pos(self): ... + @property + def FriendlyName(self): ... + @property + def Source(self): ... + @property + def SubscribedURL(self): ... + @property + def CurItemState(self): ... + @property + def Original(self): ... + @property + def Restored(self): ... + @property + def Size(self): ... + +class COMPONENTSOPT: + @property + def EnableComponents(self): ... + @property + def ActiveDesktop(self): ... + @property + def Size(self): ... + +class COMPPOS: + @property + def Left(self): ... + @property + def Top(self): ... + @property + def Width(self): ... + @property + def Height(self): ... + @property + def Index(self): ... + @property + def CanResize(self): ... + @property + def CanResizeX(self): ... + @property + def CanResizeY(self): ... + @property + def PreferredLeftPercent(self): ... + @property + def PreferredTopPercent(self): ... + @property + def Size(self): ... + +class COMPSTATEINFO: + @property + def Left(self): ... + @property + def Top(self): ... + @property + def Width(self): ... + @property + def Height(self): ... + @property + def dwItemState(self): ... + @property + def Size(self): ... + +class DEFCONTENTMENU: ... +class ELEMDESC: ... + +class EXP_DARWIN_LINK: + @property + def Signature(self): ... + @property + def DarwinID(self): ... + @property + def wDarwinID(self): ... + @property + def Size(self): ... + +class EXP_SPECIAL_FOLDER: + @property + def Signature(self): ... + @property + def idSpecialFolder(self): ... + @property + def Offset(self): ... + @property + def Size(self): ... + +class EXP_SZ_LINK: + @property + def Signature(self): ... + @property + def Target(self): ... + @property + def wTarget(self): ... + @property + def Size(self): ... + +class FUNCDESC: + @property + def memid(self) -> int: ... + @property + def scodeArray(self) -> tuple[Incomplete, ...]: ... + @property + def args(self) -> tuple[ELEMDESC, ...]: ... + @property + def funckind(self): ... + @property + def invkind(self): ... + @property + def callconv(self): ... + @property + def cParamsOpt(self): ... + @property + def oVft(self): ... + @property + def rettype(self) -> ELEMDESC: ... + @property + def wFuncFlags(self): ... + +class IDLDESC: ... +class MAPIINIT_0: ... + +class NT_CONSOLE_PROPS: + @property + def Signature(self): ... + @property + def FillAttribute(self): ... + @property + def PopupFillAttribute(self): ... + @property + def ScreenBufferSize(self) -> tuple[Incomplete, Incomplete]: ... + @property + def WindowSize(self) -> tuple[Incomplete, Incomplete]: ... + @property + def WindowOrigin(self) -> tuple[Incomplete, Incomplete]: ... + @property + def nFont(self): ... + @property + def InputBufferSize(self): ... + @property + def FontSize(self) -> tuple[Incomplete, Incomplete]: ... + @property + def FontFamily(self): ... + @property + def FontWeight(self): ... + @property + def FaceName(self): ... + @property + def CursorSize(self): ... + @property + def FullScreen(self): ... + @property + def QuickEdit(self): ... + @property + def InsertMode(self): ... + @property + def AutoPosition(self): ... + @property + def HistoryBufferSize(self): ... + @property + def NumberOfHistoryBuffers(self): ... + @property + def HistoryNoDup(self): ... + @property + def ColorTable(self): ... + @property + def Size(self): ... + +class NT_FE_CONSOLE_PROPS: + @property + def Signature(self): ... + @property + def CodePage(self): ... + @property + def Size(self): ... + +class PROPSPEC: ... +class PyADSVALUE: ... + +class PyADS_ATTR_INFO: + @property + def AttrName(self): ... + @property + def ControlCode(self) -> int: ... + @property + def ADsType(self) -> int: ... + @property + def Values(self) -> list[Incomplete]: ... + +class PyADS_OBJECT_INFO: + @property + def RDN(self): ... + @property + def ObjectDN(self): ... + @property + def ParentDN(self): ... + @property + def ClassName(self): ... + +class PyADS_SEARCHPREF_INFO: ... + +class PyBIND_OPTS: + @property + def Flags(self): ... + @property + def Mode(self): ... + @property + def TickCountDeadline(self): ... + @property + def cbStruct(self): ... + +class PyCMINVOKECOMMANDINFO: ... + +class PyDSBCAPS: + @property + def dwFlags(self) -> int: ... + @property + def dwUnlockTransferRate(self) -> int: ... + @property + def dwBufferBytes(self): ... + @property + def dwPlayCpuOverhead(self): ... + +class PyDSBUFFERDESC: + @property + def dwFlags(self) -> int: ... + @property + def dwBufferBytes(self) -> int: ... + @property + def lpwfxFormat(self): ... + +class PyDSCAPS: + @property + def dwFlags(self) -> int: ... + @property + def dwMinSecondarySampleRate(self) -> int: ... + @property + def dwMaxSecondarySampleRate(self) -> int: ... + @property + def dwPrimaryBuffers(self) -> int: ... + @property + def dwMaxHwMixingAllBuffers(self) -> int: ... + @property + def dwMaxHwMixingStaticBuffers(self) -> int: ... + @property + def dwMaxHwMixingStreamingBuffers(self) -> int: ... + @property + def dwFreeHwMixingAllBuffers(self) -> int: ... + @property + def dwFreeHwMixingStaticBuffers(self) -> int: ... + @property + def dwFreeHwMixingStreamingBuffers(self) -> int: ... + @property + def dwMaxHw3DAllBuffers(self) -> int: ... + @property + def dwMaxHw3DStaticBuffers(self) -> int: ... + @property + def dwMaxHw3DStreamingBuffers(self) -> int: ... + @property + def dwFreeHw3DAllBuffers(self) -> int: ... + @property + def dwFreeHw3DStaticBuffers(self) -> int: ... + @property + def dwFreeHw3DStreamingBuffers(self) -> int: ... + @property + def dwTotalHwMemBytes(self) -> int: ... + @property + def dwFreeHwMemBytes(self) -> int: ... + @property + def dwMaxContigFreeHwMemBytes(self) -> int: ... + @property + def dwUnlockTransferRateHwBuffers(self) -> int: ... + @property + def dwPlayCpuOverheadSwBuffers(self) -> int: ... + +class PyDSCBCAPS: + @property + def dwFlags(self) -> int: ... + @property + def dwBufferBytes(self) -> int: ... + +class PyDSCBUFFERDESC: + @property + def dwFlags(self) -> int: ... + @property + def dwBufferBytes(self) -> int: ... + @property + def lpwfxFormat(self): ... + +class PyDSCCAPS: + @property + def dwFlags(self) -> int: ... + @property + def dwFormats(self) -> int: ... + @property + def dwChannels(self) -> int: ... + +class PyDSOP_FILTER_FLAGS: + @property + def uplevel(self) -> PyDSOP_UPLEVEL_FILTER_FLAGS: ... + @property + def downlevel(self): ... + +class PyDSOP_SCOPE_INIT_INFO: + @property + def type(self): ... + @property + def scope(self): ... + @property + def hr(self): ... + @property + def dcName(self) -> str: ... + @property + def filterFlags(self) -> PyDSOP_FILTER_FLAGS: ... + +class PyDSOP_SCOPE_INIT_INFOs: + def __new__(cls, size): ... + +class PyDSOP_UPLEVEL_FILTER_FLAGS: + @property + def bothModes(self): ... + @property + def mixedModeOnly(self): ... + @property + def nativeModeOnly(self): ... + +class PyFORMATETC: ... + +class PyGFileOperationProgressSink: + def StartOperations(self) -> None: ... + def FinishOperations(self, Result) -> None: ... + def PreRenameItem(self, Flags, Item: PyIShellItem, NewName) -> None: ... + def PostRenameItem(self, Flags, Item: PyIShellItem, NewName, hrRename, NewlyCreated: PyIShellItem) -> None: ... + def PreMoveItem(self, Flags, Item: PyIShellItem, DestinationFolder: PyIShellItem, NewName) -> None: ... + def PostMoveItem( + self, Flags, Item: PyIShellItem, DestinationFolder: PyIShellItem, NewName, hrMove, NewlyCreated: PyIShellItem + ) -> None: ... + def PreCopyItem(self, Flags, Item: PyIShellItem, DestinationFolder: PyIShellItem, NewName) -> None: ... + def PostCopyItem( + self, Flags, Item: PyIShellItem, DestinationFolder: PyIShellItem, NewName, hrCopy, NewlyCreated: PyIShellItem + ) -> None: ... + def PreDeleteItem(self, Flags, Item: PyIShellItem) -> None: ... + def PostDeleteItem(self, Flags, Item: PyIShellItem, hrDelete, NewlyCreated: PyIShellItem) -> None: ... + def PreNewItem(self, Flags, DestinationFolder: PyIShellItem, NewName) -> None: ... + def PostNewItem( + self, Flags, DestinationFolder: PyIShellItem, NewName, TemplateName, FileAttributes, hrNew, NewItem: PyIShellItem + ) -> None: ... + def UpdateProgress(self, WorkTotal, WorkSoFar) -> None: ... + def ResetTimer(self) -> None: ... + def PauseTimer(self) -> None: ... + def ResumeTimer(self) -> None: ... + +class PyGSecurityInformation: + def GetObjectInformation(self) -> SI_OBJECT_INFO: ... + def GetSecurity(self, RequestedInformation, Default) -> PySECURITY_DESCRIPTOR: ... + def SetSecurity(self, SecurityInformation, SecurityDescriptor: PySECURITY_DESCRIPTOR) -> None: ... + def GetAccessRights(self, ObjectType: PyIID, Flags) -> tuple[SI_ACCESS, Incomplete]: ... + def MapGeneric(self, ObjectType: PyIID, AceFlags, Mask): ... + def GetInheritTypes(self) -> tuple[SI_INHERIT_TYPE, ...]: ... + def PropertySheetPageCallback(self, hwnd: int, Msg, Page) -> None: ... + +class PyIADesktopP2: + def UpdateAllDesktopSubscriptions(self) -> None: ... + +class PyIADs: + @property + def ADsPath(self) -> str: ... + @property + def AdsPath(self) -> str: ... + @property + def Class(self) -> str: ... + @property + def GUID(self) -> str: ... + @property + def Name(self) -> str: ... + @property + def Parent(self) -> str: ... + @property + def Schema(self) -> str: ... + def GetInfo(self) -> None: ... + def SetInfo(self) -> None: ... + def Get(self, prop: str): ... + def Put(self, _property: str, val) -> None: ... + def get(self, prop: str): ... + def put(self, _property: str, val) -> None: ... + +class PyIADsContainer: + def GetObject(self, _class: str, relativeName: str) -> PyIDispatch: ... + def get_Count(self): ... + def get_Filter(self): ... + def put_Filter(self, val) -> None: ... + def get_Hints(self): ... + def put_Hints(self, val) -> None: ... + +class PyIADsUser: + def get_AccountDisabled(self): ... + def put_AccountDisabled(self, val) -> None: ... + def get_AccountExpirationDate(self): ... + def put_AccountExpirationDate(self, val: PyTime) -> None: ... + def get_BadLoginAddress(self): ... + def get_BadLoginCount(self): ... + def get_Department(self): ... + def put_Department(self, val) -> None: ... + def get_Description(self): ... + def put_Description(self, val) -> None: ... + def get_Division(self): ... + def put_Division(self, val) -> None: ... + def get_EmailAddress(self): ... + def put_EmailAddress(self, val) -> None: ... + def get_EmployeeID(self): ... + def put_EmployeeID(self, val) -> None: ... + def get_FirstName(self): ... + def put_FirstName(self, val) -> None: ... + def get_FullName(self): ... + def put_FullName(self, val) -> None: ... + def get_HomeDirectory(self): ... + def put_HomeDirectory(self, val) -> None: ... + def get_HomePage(self): ... + def put_HomePage(self, val) -> None: ... + def get_LoginScript(self): ... + def put_LoginScript(self, val) -> None: ... + def SetPassword(self, val) -> None: ... + def ChangePassword(self, oldval, newval) -> None: ... + +class PyIActiveDesktop: + def ApplyChanges(self, Flags) -> None: ... + def GetWallpaper(self, cchWallpaper, Reserved: int = ...): ... + def SetWallpaper(self, Wallpaper, Reserved: int = ...) -> None: ... + def GetWallpaperOptions(self, Reserved: int = ...): ... + def SetWallpaperOptions(self, Style, Reserved: int = ...) -> None: ... + def GetPattern(self, cchPattern: int = ..., Reserved: int = ...) -> None: ... + def SetPattern(self, Pattern, Reserved: int = ...) -> None: ... + def GetDesktopItemOptions(self): ... + def SetDesktopItemOptions(self, comp, Reserved: int = ...) -> None: ... + def AddDesktopItem(self, comp, Reserved: int = ...) -> None: ... + def AddDesktopItemWithUI(self, hwnd: int, comp, Flags) -> None: ... + def ModifyDesktopItem(self, comp, Flags) -> None: ... + def RemoveDesktopItem(self, comp, Reserved: int = ...) -> None: ... + def GetDesktopItemCount(self) -> None: ... + def GetDesktopItem(self, Component, Reserved: int = ...): ... + def GetDesktopItemByID(self, ID, reserved: int = ...): ... + def GenerateDesktopItemHtml(self, FileName, comp, Reserved: int = ...) -> None: ... + def AddUrl(self, hwnd: int, Source, comp, Flags) -> None: ... + def GetDesktopItemBySource(self, Source, Reserved: int = ...): ... + +class PyIActiveDesktopP: + def SetSafeMode(self, Flags) -> None: ... + +class PyIActiveScriptDebug: + def GetScriptTextAttributes(self, pstrCode: str, pstrDelimiter: str, dwFlags) -> tuple[Incomplete, ...]: ... + def GetScriptletTextAttributes(self, pstrCode: str, pstrDelimiter: str, dwFlags) -> None: ... + def EnumCodeContextsOfPosition(self, dwSourceContext, uCharacterOffset, uNumChars) -> None: ... + +class PyIActiveScriptError: + def GetExceptionInfo(self) -> None: ... + def GetSourcePosition(self) -> None: ... + def GetSourceLineText(self) -> None: ... + +class PyIActiveScriptErrorDebug: + def GetDocumentContext(self) -> None: ... + def GetStackFrame(self) -> None: ... + +class PyIActiveScriptParseProcedure: + def ParseProcedureText( + self, + pstrCode, + pstrFormalParams, + pstrProcedureName, + pstrItemName, + punkContext: PyIUnknown, + pstrDelimiter, + dwSourceContextCookie, + ulStartingLineNumber, + dwFlags, + ) -> None: ... + +class PyIActiveScriptSite: + def GetLCID(self): ... + def GetItemInfo(self): ... + def GetDocVersionString(self): ... + def OnStateChange(self): ... + def OnEnterScript(self): ... + def OnLeaveScript(self): ... + def OnScriptError(self): ... + def OnScriptTerminate(self): ... + +class PyIActiveScriptSiteDebug: + def GetDocumentContextFromPosition(self, dwSourceContext, uCharacterOffset, uNumChars) -> None: ... + def GetApplication(self) -> None: ... + def GetRootApplicationNode(self) -> None: ... + def OnScriptErrorDebug(self) -> tuple[Incomplete, Incomplete]: ... + +class PyIAddrBook: + def ResolveName(self, uiParm, flags, entryTitle: str, ADRlist) -> None: ... + def OpenEntry(self, entryId: str, iid: PyIID, flags): ... + def CompareEntryIDs(self, entryId: str, entryId1: str, flags: int = ...): ... + +class PyIApplicationDebugger: + def QueryAlive(self) -> None: ... + def CreateInstanceAtDebugger(self, rclsid: PyIID, pUnkOuter: PyIUnknown, dwClsContext, riid: PyIID) -> None: ... + def onDebugOutput(self, pstr) -> None: ... + def onHandleBreakPoint(self, prpt: PyIRemoteDebugApplicationThread, br, pError) -> None: ... + def onClose(self) -> None: ... + def onDebuggerEvent(self, guid: PyIID, uUnknown: PyIUnknown) -> None: ... + +class PyIApplicationDestinations: + def SetAppID(self, AppID) -> None: ... + def RemoveDestination(self, punk: PyIUnknown) -> None: ... + def RemoveAllDestinations(self) -> None: ... + +class PyIApplicationDocumentlists: + def SetAppID(self, AppID) -> None: ... + def Getlist(self, listType, riid: PyIID, ItemsDesired: int = ...) -> PyIEnumObjects: ... + +class PyIAsyncOperation: + def SetAsyncMode(self, fDoOpAsync) -> None: ... + def GetAsyncMode(self): ... + def StartOperation(self, pbcReserved: PyIBindCtx) -> None: ... + def InOperation(self) -> None: ... + def EndOperation(self, hResult, pbcReserved: PyIBindCtx, dwEffects) -> None: ... + +class PyIAttach: + def GetLastError(self, hr, flags): ... + +class PyIBindCtx: + def GetRunningObjectTable(self) -> PyIRunningObjectTable: ... + def GetBindOptions(self) -> PyBIND_OPTS: ... + def SetBindOptions(self, bindopts) -> None: ... + def RegisterObjectParam(self, Key: str, punk: PyIUnknown) -> None: ... + def RevokeObjectParam(self, Key: str) -> None: ... + def GetObjectParam(self, Key: str) -> PyIUnknown: ... + def EnumObjectParam(self) -> PyIEnumString: ... + +class PyIBrowserFrameOptions: + def GetFrameOptions(self, dwMask) -> None: ... + +class PyICancelMethodCalls: + def Cancel(self, Seconds) -> None: ... + def TestCancel(self): ... + +class PyICatInformation: + def EnumCategories(self, lcid: int = ...) -> PyIEnumCATEGORYINFO: ... + def GetCategoryDesc(self, lcid: int = ...) -> str: ... + def EnumClassesOfCategories( + self, listIIdImplemented: list[PyIID] | None = ..., listIIdRequired: Incomplete | None = ... + ) -> PyIEnumGUID: ... + +class PyICatRegister: + def RegisterCategories(self, arg: list[tuple[PyIID, Incomplete, str]]) -> None: ... + def UnRegisterCategories(self, arg: list[PyIID]) -> None: ... + def RegisterClassImplCategories(self, clsid: PyIID, arg: list[PyIID]) -> None: ... + def UnRegisterClassImplCategories(self, clsid: PyIID, arg: list[PyIID]) -> None: ... + def RegisterClassReqCategories(self, clsid: PyIID, arg: list[PyIID]) -> None: ... + def UnRegisterClassReqCategories(self, clsid: PyIID, arg: list[PyIID]) -> None: ... + +class PyICategoryProvider: + def CanCategorizeOnSCID(self, pscid) -> None: ... + def GetDefaultCategory(self) -> None: ... + def GetCategoryForSCID(self, pscid) -> None: ... + def EnumCategories(self) -> None: ... + def GetCategoryName(self, guid: PyIID) -> None: ... + def CreateCategory(self, guid: PyIID, riid: PyIID) -> None: ... + +class PyIClassFactory: + def CreateInstance(self, outerUnknown: PyIUnknown, iid: PyIID) -> PyIUnknown: ... + def LockServer(self, bInc) -> None: ... + +class PyIClientSecurity: + def QueryBlanket(self, Proxy: PyIUnknown): ... + def SetBlanket( + self, Proxy: PyIUnknown, AuthnSvc, AuthzSvc, ServerPrincipalName: str, AuthnLevel, ImpLevel, AuthInfo, Capabilities + ) -> None: ... + def CopyProxy(self, Proxy: PyIUnknown) -> PyIUnknown: ... + +class PyIColumnProvider: + def Initialize(self, psci) -> None: ... + def GetColumnInfo(self, dwIndex) -> None: ... + def GetItemData(self, pscid, pscd) -> None: ... + +class PyIConnectionPoint: + def GetConnectionInterface(self) -> PyIID: ... + def GetConnectionPointContainer(self) -> PyIConnectionPointContainer: ... + def Advise(self, unk: PyIUnknown): ... + def Unadvise(self, cookie) -> None: ... + def EnumConnections(self) -> PyIEnumConnections: ... + +class PyIConnectionPointContainer: + def EnumConnectionPoints(self) -> PyIEnumConnectionPoints: ... + def FindConnectionPoint(self, iid: PyIID) -> PyIConnectionPoint: ... + +class PyIContext: + def SetProperty(self, rpolicyId: PyIID, flags, pUnk: PyIUnknown) -> None: ... + def RemoveProperty(self, rPolicyId: PyIID) -> None: ... + def GetProperty(self, rGuid: PyIID) -> tuple[Incomplete, PyIUnknown]: ... + def EnumContextProps(self) -> PyIEnumContextProps: ... + +class PyIContextMenu: + def QueryContextMenu(self, hmenu: int, indexMenu, idCmdFirst, idCmdLast, uFlags): ... + def InvokeCommand(self, pici: PyCMINVOKECOMMANDINFO) -> None: ... + def GetCommandString(self, idCmd, uType, cchMax: int = ...): ... + +class PyICopyHookA: + def CopyCallback(self, hwnd: int, wFunc, wFlags, srcFile: str, srcAttribs, destFile: str, destAttribs) -> None: ... + +class PyICopyHookW: + def CopyCallback(self, hwnd: int, wFunc, wFlags, srcFile: str, srcAttribs, destFile: str, destAttribs) -> None: ... + +class PyICreateTypeInfo: + def SetGuid(self, guid: PyIID) -> None: ... + def SetTypeFlags(self, uTypeFlags) -> None: ... + def SetDocString(self, pStrDoc) -> None: ... + def SetHelpContext(self, dwHelpContext) -> None: ... + def SetVersion(self, wMajorVerNum, wMinorVerNum) -> None: ... + def AddRefTypeInfo(self, pTInfo: PyITypeInfo) -> None: ... + def AddFuncDesc(self, index) -> None: ... + def AddImplType(self, index, hRefType) -> None: ... + def SetImplTypeFlags(self, index, implTypeFlags) -> None: ... + def SetAlignment(self, cbAlignment) -> None: ... + def SetSchema(self, pStrSchema) -> None: ... + def AddVarDesc(self, index) -> None: ... + def SetFuncAndParamNames(self, index, rgszNames: tuple[Incomplete, ...]) -> None: ... + def SetVarName(self, index, szName) -> None: ... + def SetTypeDescAlias(self) -> None: ... + def DefineFuncAsDllEntry(self, index, szDllName, szProcName) -> None: ... + def SetFuncDocString(self, index, szDocString) -> None: ... + def SetVarDocString(self, index, szDocString) -> None: ... + def SetFuncHelpContext(self, index, dwHelpContext) -> None: ... + def SetVarHelpContext(self, index, dwHelpContext) -> None: ... + def SetMops(self, index, bstrMops) -> None: ... + def LayOut(self) -> None: ... + +class PyICreateTypeLib: + def CreateTypeInfo(self, szName) -> None: ... + def SetName(self, szName) -> None: ... + def SetVersion(self, wMajorVerNum, wMinorVerNum) -> None: ... + def SetGuid(self, guid: PyIID) -> None: ... + def SetDocString(self, szDoc) -> None: ... + def SetHelpFileName(self, szHelpFileName) -> None: ... + def SetHelpContext(self, dwHelpContext) -> None: ... + def SetLcid(self) -> None: ... + def SetLibFlags(self, uLibFlags) -> None: ... + def SaveAllChanges(self) -> None: ... + +class PyICreateTypeLib2: + def CreateTypeInfo(self, szName) -> None: ... + def SetName(self, szName) -> None: ... + def SetVersion(self, wMajorVerNum, wMinorVerNum) -> None: ... + def SetGuid(self, guid: PyIID) -> None: ... + def SetDocString(self, szDoc) -> None: ... + def SetHelpFileName(self, szHelpFileName) -> None: ... + def SetHelpContext(self, dwHelpContext) -> None: ... + def SetLcid(self) -> None: ... + def SetLibFlags(self, uLibFlags) -> None: ... + def SaveAllChanges(self) -> None: ... + +class PyICurrentItem: ... + +class PyICustomDestinationlist: + def SetAppID(self, AppID) -> None: ... + def Beginlist(self, riid: PyIID) -> tuple[Incomplete, PyIObjectArray]: ... + def AppendCategory(self, Category, Items: PyIObjectArray) -> None: ... + def AppendKnownCategory(self, Category) -> None: ... + def AddUserTasks(self, Items: PyIObjectArray) -> None: ... + def Commitlist(self) -> None: ... + def GetRemovedDestinations(self, riid: PyIID) -> PyIObjectArray: ... + def Deletelist(self, AppID: Incomplete | None = ...) -> None: ... + def Abortlist(self) -> None: ... + +class PyIDL: ... + +class PyIDataObject: + def GetData(self, pformatetcIn: PyFORMATETC) -> PySTGMEDIUM: ... + def GetDataHere(self, pformatetcIn: PyFORMATETC) -> PySTGMEDIUM: ... + def QueryGetData(self, pformatetc: PyFORMATETC) -> None: ... + def GetCanonicalFormatEtc(self, pformatectIn: PyFORMATETC) -> PyFORMATETC: ... + def SetData(self, pformatetc: PyFORMATETC, pmedium: PySTGMEDIUM, fRelease) -> None: ... + def EnumFormatEtc(self, dwDirection) -> PyIEnumFORMATETC: ... + def DAdvise(self, pformatetc: PyFORMATETC, advf, pAdvSink): ... + def DUnadvise(self, dwConnection) -> None: ... + def EnumDAdvise(self): ... + +class PyIDebugApplication: + def SetName(self, pstrName) -> None: ... + def StepOutComplete(self) -> None: ... + def DebugOutput(self, pstr) -> None: ... + def StartDebugSession(self) -> None: ... + def HandleBreakPoint(self, br): ... + def Close(self) -> None: ... + def GetBreakFlags(self): ... + def GetCurrentThread(self) -> PyIDebugApplicationThread: ... + def CreateAsyncDebugOperation(self, psdo: PyIDebugSyncOperation) -> None: ... + def AddStackFrameSniffer(self, pdsfs: PyIDebugStackFrameSniffer): ... + def RemoveStackFrameSniffer(self, dwCookie) -> None: ... + def QueryCurrentThreadIsDebuggerThread(self) -> None: ... + def SynchronousCallInDebuggerThread(self, pptc, dwParam1, dwParam2, dwParam3) -> None: ... + def CreateApplicationNode(self) -> PyIDebugApplicationNode: ... + def FireDebuggerEvent(self, guid, unknown: PyIUnknown) -> None: ... + def HandleRuntimeError(self, pErrorDebug: PyIActiveScriptErrorDebug, pScriptSite: PyIActiveScriptSite) -> None: ... + def FCanJitDebug(self) -> None: ... + def FIsAutoJitDebugEnabled(self) -> None: ... + def AddGlobalExpressionContextProvider(self, pdsfs: PyIProvideExpressionContexts) -> None: ... + def RemoveGlobalExpressionContextProvider(self, dwCookie) -> None: ... + +class PyIDebugApplicationNode: + def EnumChildren(self) -> None: ... + def GetParent(self) -> PyIDebugApplicationNode: ... + def SetDocumentProvider(self, pddp: PyIDebugDocumentProvider) -> None: ... + def Close(self) -> None: ... + def Attach(self, pdanParent: PyIDebugApplicationNode) -> None: ... + def Detach(self) -> None: ... + +class PyIDebugApplicationNodeEvents: + def onAddChild(self, prddpChild: PyIDebugApplicationNode) -> None: ... + def onRemoveChild(self, prddpChild: PyIDebugApplicationNode) -> None: ... + def onDetach(self) -> None: ... + def onAttach(self, prddpParent: PyIDebugApplicationNode) -> None: ... + +class PyIDebugApplicationThread: + def SynchronousCallIntoThread(self, pstcb, dwParam1, dwParam2, dwParam3) -> None: ... + def QueryIsCurrentThread(self) -> None: ... + def QueryIsDebuggerThread(self) -> None: ... + +class PyIDebugCodeContext: + def GetDocumentContext(self) -> None: ... + def SetBreakPoint(self, bps) -> None: ... + +class PyIDebugDocument: ... + +class PyIDebugDocumentContext: + def GetDocument(self) -> None: ... + def EnumCodeContexts(self) -> None: ... + +class PyIDebugDocumentHelper: + def Init(self, pda: PyIDebugApplication, pszShortName, pszLongName, docAttr) -> None: ... + def Attach(self, pddhParent: PyIDebugDocumentHelper) -> None: ... + def Detach(self) -> None: ... + def AddUnicodeText(self, pszText) -> None: ... + def AddDBCSText(self) -> None: ... + def SetDebugDocumentHost(self, pddh: PyIDebugDocumentHost) -> None: ... + def AddDeferredText(self, cChars, dwTextStartCookie) -> None: ... + def DefineScriptBlock(self, ulCharOffset, cChars, pas, fScriptlet) -> None: ... + def SetDefaultTextAttr(self, staTextAttr) -> None: ... + def SetTextAttributes(self, ulCharOffset, obAttr) -> None: ... + def SetLongName(self, pszLongName) -> None: ... + def SetShortName(self, pszShortName) -> None: ... + def SetDocumentAttr(self, pszAttributes) -> None: ... + def GetDebugApplicationNode(self) -> None: ... + def GetScriptBlockInfo(self, dwSourceContext) -> None: ... + def CreateDebugDocumentContext(self, iCharPos, cChars) -> None: ... + def BringDocumentToTop(self) -> None: ... + def BringDocumentContextToTop(self, pddc: PyIDebugDocumentContext) -> None: ... + +class PyIDebugDocumentHost: + def GetDeferredText(self, dwTextStartCookie, cMaxChars) -> None: ... + def GetScriptTextAttributes(self, pstrCode, pstrDelimiter, dwFlags) -> None: ... + def OnCreateDocumentContext(self) -> None: ... + def GetPathName(self) -> None: ... + def GetFileName(self) -> None: ... + def NotifyChanged(self) -> None: ... + +class PyIDebugDocumentInfo: + def GetName(self) -> None: ... + def GetDocumentClassId(self) -> PyIID: ... + +class PyIDebugDocumentProvider: + def GetDocument(self) -> PyIDebugDocument: ... + +class PyIDebugDocumentText: + def GetDocumentAttributes(self) -> None: ... + def GetSize(self) -> None: ... + def GetPositionOfLine(self, cLineNumber) -> None: ... + def GetLineOfPosition(self, cCharacterPosition) -> None: ... + def GetText(self, cCharacterPosition, cMaxChars, bWantAttr: int = ...) -> None: ... + def GetPositionOfContext(self, psc: PyIDebugDocumentContext) -> None: ... + def GetContextOfPosition(self, cCharacterPosition, cNumChars) -> None: ... + +class PyIDebugDocumentTextAuthor: + def InsertText(self, cCharacterPosition, cNumToInsert, pcharText) -> None: ... + def RemoveText(self, cCharacterPosition, cNumToRemove) -> None: ... + def ReplaceText(self, cCharacterPosition, cNumToReplace, pcharText) -> None: ... + +class PyIDebugDocumentTextEvents: + def onDestroy(self) -> None: ... + def onInsertText(self, cCharacterPosition, cNumToInsert) -> None: ... + def onRemoveText(self, cCharacterPosition, cNumToRemove) -> None: ... + def onReplaceText(self, cCharacterPosition, cNumToReplace) -> None: ... + def onUpdateTextAttributes(self, cCharacterPosition, cNumToUpdate) -> None: ... + def onUpdateDocumentAttributes(self, textdocattr) -> None: ... + +class PyIDebugDocumentTextExternalAuthor: + def GetPathName(self) -> None: ... + def GetFileName(self) -> None: ... + def NotifyChanged(self) -> None: ... + +class PyIDebugExpression: + def Start(self, pdecb: PyIDebugExpressionCallBack) -> None: ... + def Abort(self) -> None: ... + def QueryIsComplete(self) -> None: ... + def GetResultAsString(self) -> None: ... + def GetResultAsDebugProperties(self) -> None: ... + +class PyIDebugExpressionCallBack: + def onComplete(self) -> None: ... + +class PyIDebugExpressionContext: + def ParseLanguageText(self, pstrCode, nRadix, pstrDelimiter, dwFlags) -> None: ... + def GetLanguageInfo(self) -> None: ... + +class PyIDebugProperty: + def GetPropertyInfo(self, dwFieldSpec, nRadix) -> None: ... + def GetExtendedInfo(self) -> None: ... + def SetValueAsString(self, pszValue, nRadix) -> None: ... + def EnumMembers(self, dwFieldSpec, nRadix, refiid: PyIID) -> None: ... + def GetParent(self) -> None: ... + +class PyIDebugSessionProvider: + def StartDebugSession(self, pda: PyIRemoteDebugApplication) -> None: ... + +class PyIDebugStackFrame: + def GetCodeContext(self) -> None: ... + def GetDescriptionString(self, fLong): ... + def GetLanguageString(self, fLong): ... + def GetThread(self) -> PyIDebugApplicationThread: ... + +class PyIDebugStackFrameSniffer: + def EnumStackFrames(self) -> None: ... + +class PyIDebugStackFrameSnifferEx: + def EnumStackFramesEx(self) -> None: ... + +class PyIDebugSyncOperation: + def GetTargetThread(self) -> None: ... + def Execute(self) -> None: ... + def InProgressAbort(self) -> None: ... + +class PyIDefaultExtractIconInit: + def SetFlags(self, uFlags) -> None: ... + def SetKey(self, hkey: PyHKEY) -> None: ... + def SetNormalIcon(self, pszFile, iIcon) -> None: ... + def SetOpenIcon(self, pszFile, iIcon) -> None: ... + def SetShortcutIcon(self, pszFile, iIcon) -> None: ... + def SetDefaultIcon(self, pszFile, iIcon) -> None: ... + +class PyIDirectSound: + def Initialize(self, guid: PyIID) -> None: ... + def SetCooperativeLevel(self, hwnd: int, level) -> None: ... + def CreateSoundBuffer(self, lpDSCBufferDesc: PyDSCBUFFERDESC, unk: Incomplete | None = ...) -> None: ... + def GetCaps(self) -> None: ... + def Compact(self) -> None: ... + +class PyIDirectSoundBuffer: + def Initialize(self) -> None: ... + def GetStatus(self) -> None: ... + def GetCaps(self) -> None: ... + def Restore(self) -> None: ... + def GetCurrentPosition(self) -> None: ... + def Play(self) -> None: ... + def SetCurrentPosition(self) -> None: ... + def Stop(self) -> None: ... + def GetFrequency(self) -> None: ... + def GetPan(self) -> None: ... + def GetVolume(self) -> None: ... + def SetFrequency(self) -> None: ... + def SetPan(self) -> None: ... + def SetVolume(self) -> None: ... + +class PyIDirectSoundCapture: + def Initialize(self) -> None: ... + def GetCaps(self) -> None: ... + +class PyIDirectSoundCaptureBuffer: + def Initialize(self) -> None: ... + def GetStatus(self) -> None: ... + def GetCurrentPosition(self) -> None: ... + def Stop(self) -> None: ... + +class PyIDirectSoundNotify: ... + +class PyIDirectoryObject: + def GetObjectInformation(self) -> PyADS_OBJECT_INFO: ... + def GetObjectAttributes(self, names: tuple[str, ...]) -> tuple[PyADS_ATTR_INFO, ...]: ... + def SetObjectAttributes(self, attrs: tuple[PyADS_ATTR_INFO, ...]): ... + def CreateDSObject(self, rdn: str, attrs: tuple[PyADS_ATTR_INFO, ...]) -> PyIDispatch: ... + def DeleteDSObject(self, rdn: str) -> None: ... + +class PyIDirectorySearch: + def SetSearchPreference(self, prefs) -> tuple[Incomplete, Incomplete, Incomplete]: ... + def ExecuteSearch(self, _filter: str, attrNames: list[str]): ... + def GetNextRow(self, handle): ... + def GetFirstRow(self, handle): ... + def GetPreviousRow(self, handle): ... + def CloseSearchHandle(self, handle) -> None: ... + def AdandonSearch(self, handle) -> None: ... + def GetColumn(self, handle, name: str) -> tuple[Incomplete, Incomplete, Incomplete]: ... + def GetNextColumnName(self) -> None: ... + +@final +class PyIDispatch: + def Invoke(self, dispid, lcid, flags, bResultWanted, arg: tuple[Incomplete, ...]): ... + def InvokeTypes( + self, dispid, lcid, wFlags, resultTypeDesc, typeDescs: tuple[Incomplete, ...], args: tuple[Incomplete, ...] + ): ... + def GetIDsOfNames(self, name: str, arg) -> tuple[Incomplete, Incomplete]: ... + def GetTypeInfo(self, locale, index: int = ...) -> PyITypeInfo: ... + def GetTypeInfoCount(self): ... + +class PyIDispatchEx: + def GetDispID(self, name: str, fdex): ... + def InvokeEx( + self, + dispid, + lcid, + flags, + args: list[Incomplete], + types: list[Incomplete] | None = ..., + returnDesc: int = ..., + serviceProvider: PyIServiceProvider | None = ..., + ): ... + def DeleteMemberByName(self, name: str, fdex) -> None: ... + def DeleteMemberByDispID(self, dispid) -> None: ... + def GetMemberProperties(self, dispid, fdex): ... + def GetMemberName(self, dispid): ... + def GetNextDispID(self, fdex, dispid): ... + +class PyIDisplayItem: ... + +class PyIDocHostUIHandler: + def ShowContextMenu( + self, dwID, pt: tuple[Incomplete, Incomplete], pcmdtReserved: PyIUnknown, pdispReserved: PyIDispatch + ) -> None: ... + def GetHostInfo(self) -> None: ... + def ShowUI( + self, + dwID, + pActiveObject: PyIOleInPlaceActiveObject, + pCommandTarget: PyIOleCommandTarget, + pFrame: PyIOleInPlaceFrame, + pDoc: PyIOleInPlaceUIWindow, + ) -> None: ... + def HideUI(self) -> None: ... + def UpdateUI(self) -> None: ... + def EnableModeless(self, fEnable) -> None: ... + def OnDocWindowActivate(self, fActivate) -> None: ... + def OnFrameWindowActivate(self, fActivate) -> None: ... + def ResizeBorder( + self, prcBorder: tuple[Incomplete, Incomplete, Incomplete, Incomplete], pUIWindow: PyIOleInPlaceUIWindow, fRameWindow + ) -> None: ... + def TranslateAccelerator(self, lpMsg, pguidCmdGroup: PyIID, nCmdID) -> None: ... + def GetOptionKeyPath(self, dw) -> None: ... + def GetDropTarget(self, pDropTarget: PyIDropTarget) -> None: ... + def GetExternal(self) -> None: ... + def TranslateUrl(self, dwTranslate, pchURLIn) -> None: ... + def FilterDataObject(self, pDO: PyIDataObject) -> None: ... + +class PyIDropSource: + def QueryContinueDrag(self, fEscapePressed, grfKeyState) -> None: ... + def GiveFeedback(self, dwEffect) -> None: ... + +class PyIDropTarget: + def DragEnter(self, pDataObj: PyIDataObject, grfKeyState, pt: tuple[Incomplete, Incomplete], pdwEffect): ... + def DragOver(self, grfKeyState, pt: tuple[Incomplete, Incomplete], pdwEffect): ... + def DragLeave(self) -> None: ... + def Drop(self, pDataObj: PyIDataObject, grfKeyState, pt: tuple[Incomplete, Incomplete], dwEffect): ... + +class PyIDropTargetHelper: + def DragEnter(self, hwnd: int, pDataObj: PyIDataObject, pt: tuple[Incomplete, Incomplete], dwEffect) -> None: ... + def DragOver(self, hwnd: int, pt: tuple[Incomplete, Incomplete], pdwEffect) -> None: ... + def DragLeave(self) -> None: ... + def Drop(self, pDataObj: PyIDataObject, pt: tuple[Incomplete, Incomplete], dwEffect) -> None: ... + +class PyIDsObjectPicker: + def Initialize( + self, targetComputer: str, scopeInfos: PyDSOP_SCOPE_INIT_INFOs, options: int = ..., attrNames: list[str] | None = ... + ) -> None: ... + def InvokeDialog(self, hwnd: int) -> PyIDataObject: ... + +class PyIEmptyVolumeCache: ... +class PyIEmptyVolumeCache2: ... + +class PyIEmptyVolumeCacheCallBack: + def ScanProgress(self, dwlSpaceUsed, dwFlags, pcwszStatus) -> None: ... + def PurgeProgress(self, dwlSpaceFreed, spaceFreed, spaceToFree, flags, status) -> None: ... + +class PyIEnumCATEGORYINFO: + def Next(self, num: int = ...) -> tuple[tuple[PyIID, Incomplete, str], ...]: ... + def Skip(self, num) -> None: ... + def Reset(self) -> None: ... + def Clone(self) -> PyIEnumCATEGORYINFO: ... + +class PyIEnumConnectionPoints: + def Next(self, num: int = ...) -> tuple[PyIConnectionPoint, ...]: ... + def Skip(self) -> None: ... + def Reset(self) -> None: ... + def Clone(self) -> PyIEnumConnectionPoints: ... + +class PyIEnumConnections: + def Next(self, num: int = ...): ... + def Skip(self) -> None: ... + def Reset(self) -> None: ... + def Clone(self) -> PyIEnumConnections: ... + +class PyIEnumContextProps: + def Next(self, num: int = ...) -> tuple[tuple[PyIID, Incomplete, PyIUnknown], ...]: ... + def Skip(self) -> None: ... + def Reset(self) -> None: ... + def Clone(self) -> PyIEnumContextProps: ... + +class PyIEnumDebugApplicationNodes: + def Next(self, num: int = ...): ... + def Skip(self) -> None: ... + def Reset(self) -> None: ... + def Clone(self) -> PyIEnumDebugApplicationNodes: ... + +class PyIEnumDebugCodeContexts: + def Next(self, num: int = ...): ... + def Skip(self) -> None: ... + def Reset(self) -> None: ... + def Clone(self) -> PyIEnumDebugCodeContexts: ... + +class PyIEnumDebugExpressionContexts: + def Next(self, num: int = ...): ... + def Skip(self) -> None: ... + def Reset(self) -> None: ... + def Clone(self) -> PyIEnumDebugExpressionContexts: ... + +class PyIEnumDebugPropertyInfo: + def Next(self, num: int = ...): ... + def Skip(self) -> None: ... + def Reset(self) -> None: ... + def Clone(self) -> PyIEnumDebugPropertyInfo: ... + def GetCount(self): ... + +class PyIEnumDebugStackFrames: + def Next(self, num: int = ...): ... + def Skip(self) -> None: ... + def Reset(self) -> None: ... + def Clone(self) -> PyIEnumDebugStackFrames: ... + +class PyIEnumExplorerCommand: + def Next(self, num: int = ...): ... + def Skip(self) -> None: ... + def Reset(self) -> None: ... + def Clone(self) -> PyIEnumExplorerCommand: ... + +class PyIEnumFORMATETC: + def Next(self, num: int = ...): ... + def Skip(self) -> None: ... + def Reset(self) -> None: ... + def Clone(self) -> PyIEnumFORMATETC: ... + +class PyIEnumGUID: + def Next(self, num: int = ...) -> tuple[PyIID, ...]: ... + def Skip(self, num) -> None: ... + def Reset(self) -> None: ... + def Clone(self) -> PyIEnumGUID: ... + +class PyIEnumIDlist: + def Next(self, num: int = ...): ... + def Skip(self) -> None: ... + def Reset(self) -> None: ... + def Clone(self) -> PyIEnumIDlist: ... + +class PyIEnumMoniker: + def Next(self, num: int = ...) -> PyIMoniker: ... + def Skip(self, num) -> None: ... + def Reset(self) -> None: ... + def Clone(self) -> PyIEnumMoniker: ... + +class PyIEnumObjects: + def Next(self, riid: PyIID, num: int = ...) -> tuple[PyIUnknown, ...]: ... + def Skip(self) -> None: ... + def Reset(self) -> None: ... + def Clone(self) -> PyIEnumObjects: ... + +class PyIEnumRemoteDebugApplicationThreads: + def Next(self, num: int = ...): ... + def Skip(self) -> None: ... + def Reset(self) -> None: ... + def Clone(self) -> PyIEnumRemoteDebugApplicationThreads: ... + +class PyIEnumRemoteDebugApplications: + def Next(self, num: int = ...): ... + def Skip(self) -> None: ... + def Reset(self) -> None: ... + def Clone(self) -> PyIEnumRemoteDebugApplications: ... + +class PyIEnumResources: + def Next(self, num: int = ...): ... + def Skip(self) -> None: ... + def Reset(self) -> None: ... + def Clone(self) -> PyIEnumResources: ... + +class PyIEnumSTATPROPSETSTG: + def Next(self, num: int = ...): ... + def Skip(self) -> None: ... + def Reset(self) -> None: ... + def Clone(self) -> PyIEnumSTATPROPSETSTG: ... + +class PyIEnumSTATPROPSTG: + def Next(self, num: int = ...): ... + def Skip(self) -> None: ... + def Reset(self) -> None: ... + def Clone(self) -> PyIEnumSTATPROPSTG: ... + +class PyIEnumSTATSTG: + def Next(self, num: int = ...) -> tuple[STATSTG, ...]: ... + def Skip(self) -> None: ... + def Reset(self) -> None: ... + def Clone(self) -> PyIEnumSTATSTG: ... + +class PyIEnumShellItems: + def Next(self, num: int = ...) -> tuple[PyIShellItem, ...]: ... + def Skip(self) -> None: ... + def Reset(self) -> None: ... + def Clone(self) -> PyIEnumShellItems: ... + +class PyIEnumString: + def Next(self, num: int = ...) -> tuple[str, ...]: ... + def Skip(self) -> None: ... + def Reset(self) -> None: ... + def Clone(self) -> PyIEnumString: ... + +class PyIErrorLog: + def AddError(self, propName: str, excepInfo: Incomplete | None = ...) -> None: ... + +class PyIExplorerBrowser: + def Initialize(self, hwndParent, prc: PyRECT, pfs) -> None: ... + def Destroy(self) -> None: ... + def SetRect(self, hdwp, rcBrowser: PyRECT) -> int: ... + def SetPropertyBag(self, PropertyBag) -> None: ... + def SetEmptyText(self, EmptyText) -> None: ... + def SetFolderSettings(self, pfs) -> None: ... + def Advise(self, psbe: PyIExplorerBrowserEvents): ... + def Unadvise(self, dwCookie) -> None: ... + def SetOptions(self, dwFlag) -> None: ... + def GetOptions(self): ... + def BrowseToIDlist(self, pidl, uFlags) -> None: ... + def BrowseToObject(self, punk: PyIUnknown, uFlags) -> None: ... + def FillFromObject(self, punk: PyIUnknown, dwFlags) -> None: ... + def RemoveAll(self) -> None: ... + def GetCurrentView(self, riid: PyIID) -> PyIUnknown: ... + +class PyIExplorerBrowserEvents: + def OnNavigationPending(self, pidlFolder) -> None: ... + def OnViewCreated(self, psv: PyIShellView) -> None: ... + def OnNavigationComplete(self, pidlFolder) -> None: ... + def OnNavigationFailed(self, pidlFolder) -> None: ... + +class PyIExplorerCommand: + def GetTitle(self, psiItemArray: PyIShellItemArray): ... + def GetIcon(self, psiItemArray: PyIShellItemArray): ... + def GetToolTip(self, psiItemArray: PyIShellItemArray): ... + def GetCanonicalName(self) -> PyIID: ... + def GetState(self, psiItemArray: PyIShellItemArray, fOkToBeSlow): ... + def Invoke(self, psiItemArray: PyIShellItemArray, pbc: PyIBindCtx) -> None: ... + def GetFlags(self): ... + def EnumSubCommands(self) -> PyIEnumExplorerCommand: ... + +class PyIExplorerCommandProvider: ... +class PyIExplorerPaneVisibility: ... + +class PyIExternalConnection: + def AddConnection(self, extconn, reserved: int = ...): ... + def ReleaseConnection(self, extconn, reserved, fLastReleaseCloses): ... + +class PyIExtractIcon: + def Extract(self, pszFile, nIconIndex, nIconSize) -> None: ... + def GetIconLocation(self, uFlags, cchMax) -> None: ... + +class PyIExtractIconW: + def Extract(self, pszFile, nIconIndex, nIconSize) -> None: ... + def GetIconLocation(self, uFlags, cchMax) -> None: ... + +class PyIExtractImage: + def GetLocation(self, dwPriority, size: tuple[Incomplete, Incomplete], dwRecClrDepth, pdwFlags) -> None: ... + def Extract(self) -> None: ... + +class PyIFileOperation: + def Advise(self, Sink: PyGFileOperationProgressSink): ... + def Unadvise(self, Cookie) -> None: ... + def SetOperationFlags(self, OperationFlags) -> None: ... + def SetProgressMessage(self, Message) -> None: ... + def SetProgressDialog(self, popd) -> None: ... + def SetProperties(self, proparray: PyIPropertyChangeArray) -> None: ... + def SetOwnerWindow(self, Owner: int) -> None: ... + def ApplyPropertiesToItem(self, Item: PyIShellItem) -> None: ... + def ApplyPropertiesToItems(self, Items: PyIUnknown) -> None: ... + def RenameItem(self, Item: PyIShellItem, NewName, Sink: PyGFileOperationProgressSink | None = ...) -> None: ... + def RenameItems(self, pUnkItems: PyIUnknown, NewName) -> None: ... + def MoveItem( + self, + Item: PyIShellItem, + DestinationFolder: PyIShellItem, + pszNewName: Incomplete | None = ..., + Sink: PyGFileOperationProgressSink | None = ..., + ) -> None: ... + def MoveItems(self, Items: PyIUnknown, DestinationFolder: PyIShellItem) -> None: ... + def CopyItem( + self, + Item: PyIShellItem, + DestinationFolder: PyIShellItem, + CopyName: Incomplete | None = ..., + Sink: PyGFileOperationProgressSink | None = ..., + ) -> None: ... + def CopyItems(self, Items: PyIUnknown, DestinationFolder: PyIShellItem) -> None: ... + def DeleteItem(self, Item: PyIShellItem, Sink: PyGFileOperationProgressSink | None = ...) -> None: ... + def DeleteItems(self, Items: PyIUnknown) -> None: ... + def NewItem( + self, + DestinationFolder: PyIShellItem, + FileAttributes, + Name, + TemplateName: Incomplete | None = ..., + Sink: PyGFileOperationProgressSink | None = ..., + ) -> None: ... + def PerformOperations(self) -> None: ... + def GetAnyOperationsAborted(self): ... + +class PyIIdentityName: ... + +class PyIInitializeWithFile: + def Initialize(self, FilePath, Mode) -> None: ... + +class PyIInitializeWithStream: + def Initialize(self, Stream: PyIStream, Mode) -> None: ... + +class PyIInputObject: + def TranslateAccelerator(self, pmsg) -> None: ... + def UIActivate(self, uState) -> None: ... + def HasFocusIO(self) -> None: ... + +class PyIInternetBindInfo: + def GetBindInfo(self) -> None: ... + def GetBindString(self) -> None: ... + +class PyIInternetPriority: + def SetPriority(self, nPriority) -> None: ... + def GetPriority(self) -> None: ... + +class PyIInternetProtocol: + def Read(self, cb) -> None: ... + def Seek(self, dlibMove: LARGE_INTEGER, dwOrigin) -> None: ... + def LockRequest(self, dwOptions) -> None: ... + def UnlockRequest(self) -> None: ... + +class PyIInternetProtocolInfo: + def ParseUrl(self, pwzUrl, ParseAction, dwParseFlags, cchResult, dwReserved) -> None: ... + def CombineUrl(self, pwzBaseUrl, pwzRelativeUrl, dwCombineFlags, cchResult, dwReserved) -> None: ... + def CompareUrl(self, pwzUrl1, pwzUrl2, dwCompareFlags) -> None: ... + def QueryInfo(self, pwzUrl, OueryOption, dwQueryFlags, cbBuffer, dwReserved): ... + +class PyIInternetProtocolRoot: + def Start(self, szUrl, pOIProtSink: PyIInternetProtocolSink, pOIBindInfo: PyIInternetBindInfo, grfPI, dwReserved) -> None: ... + def Continue(self) -> None: ... + def Abort(self, hrReason, dwOptions) -> None: ... + def Terminate(self, dwOptions) -> None: ... + def Suspend(self) -> None: ... + def Resume(self) -> None: ... + +class PyIInternetProtocolSink: + def Switch(self) -> None: ... + def ReportProgress(self, ulStatusCode, szStatusText) -> None: ... + def ReportData(self, grfBSCF, ulProgress, ulProgressMax) -> None: ... + def ReportResult(self, hrResult, dwError, szResult) -> None: ... + +class PyIInternetSecurityManager: + def SetSecuritySite(self, pSite) -> None: ... + def GetSecuritySite(self) -> None: ... + def MapUrlToZone(self, pwszUrl, dwFlags) -> None: ... + def GetSecurityId(self, pwszUrl, pcbSecurityId) -> None: ... + def ProcessUrlAction(self, pwszUrl, dwAction, context, dwFlags) -> None: ... + def SetZoneMapping(self, dwZone, lpszPattern, dwFlags) -> None: ... + def GetZoneMappings(self, dwZone, dwFlags) -> None: ... + +class PyIKnownFolder: + def GetId(self) -> PyIID: ... + def GetCategory(self): ... + def GetShellItem(self, riid: PyIID, Flags: int = ...) -> PyIShellItem: ... + def GetPath(self, Flags: int = ...): ... + def SetPath(self, Flags, Path) -> None: ... + def GetIDlist(self, Flags) -> PyIDL: ... + def GetFolderType(self) -> PyIID: ... + def GetRedirectionCapabilities(self): ... + def GetFolderDefinition(self): ... + +class PyIKnownFolderManager: + def FolderIdFromCsidl(self, Csidl) -> PyIID: ... + def FolderIdToCsidl(self, _id: PyIID): ... + def GetFolderIds(self) -> tuple[PyIID, ...]: ... + def GetFolder(self, _id: PyIID) -> PyIKnownFolder: ... + def GetFolderByName(self, Name) -> PyIKnownFolder: ... + def RegisterFolder(self, _id: PyIID, Definition) -> None: ... + def UnregisterFolder(self, _id: PyIID) -> None: ... + def FindFolderFromPath(self, Path, Mode) -> PyIKnownFolder: ... + def FindFolderFromIDlist(self, pidl: PyIDL) -> PyIKnownFolder: ... + def Redirect(self, _id: PyIID, hwnd: int, flags, TargetPath, Exclusion: tuple[PyIID, ...]) -> None: ... + +class PyILockBytes: + def ReadAt(self, ulOffset: ULARGE_INTEGER, cb) -> str: ... + def WriteAt(self, ulOffset: ULARGE_INTEGER, data: str): ... + def Flush(self) -> None: ... + def SetSize(self, cb: ULARGE_INTEGER) -> None: ... + def LockRegion(self, libOffset: ULARGE_INTEGER, cb: ULARGE_INTEGER, dwLockType) -> None: ... + def UnlockRegion(self, libOffset: ULARGE_INTEGER, cb: ULARGE_INTEGER, dwLockType) -> None: ... + def Stat(self, grfStatFlag) -> STATSTG: ... + +class PyIMAPIContainer: + def OpenEntry(self, entryId: str, iid: PyIID, flags): ... + def GetContentsTable(self, flags) -> PyIMAPITable: ... + def GetHierarchyTable(self, flags) -> PyIMAPITable: ... + +class PyIMAPIFolder: + def GetLastError(self, hr, flags): ... + def CreateFolder( + self, folderType, folderName: str, folderComment: str | None = ..., iid: PyIID | None = ..., flags=... + ) -> PyIMAPIFolder: ... + def CreateMessage(self, iid: PyIID, flags) -> PyIMessage: ... + def CopyMessages(self, msgs: PySBinaryArray, iid: PyIID, folder: PyIMAPIFolder, ulUIParam, progress, flags): ... + def DeleteFolder(self, entryId: str, uiParam, progress) -> None: ... + def DeleteMessages(self, msgs: PySBinaryArray, uiParam, progress, flags): ... + def EmptyFolder(self, uiParam, progress, flags): ... + def SetReadFlags(self, msgs: PySBinaryArray, uiParam, progress, flag) -> None: ... + +class PyIMAPIProp: + def GetProps(self, proplist: PySPropTagArray, flags: int = ...) -> tuple[Incomplete, Incomplete, Incomplete]: ... + def DeleteProps(self, proplist: PySPropTagArray, wantProblems: bool = ...) -> tuple[Incomplete, Incomplete, Incomplete]: ... + def SetProps( + self, proplist: tuple[Incomplete, Incomplete], wantProblems: bool = ... + ) -> tuple[Incomplete, Incomplete, Incomplete]: ... + def CopyTo( + self, + IIDExcludelist: tuple[Incomplete, Incomplete], + propTags: PySPropTagArray, + uiParam, + progress, + resultIID: PyIID, + dest: PyIMAPIProp, + flags, + wantProblems: bool = ..., + ) -> tuple[Incomplete, Incomplete, Incomplete]: ... + def CopyProps( + self, propTags: PySPropTagArray, uiParam, progress, resultIID: PyIID, dest: PyIMAPIProp, flags, wantProblems: bool = ... + ) -> tuple[Incomplete, Incomplete, Incomplete]: ... + def OpenProperty(self, propTag, iid: PyIID, interfaceOptions, flags) -> PyIUnknown: ... + def GetIDsFromNames(self, nameIds: PyMAPINAMEIDArray, flags: int = ...) -> PySPropTagArray: ... + def GetNamesFromIDs( + self, propTags: PySPropTagArray, propSetGuid: PyIID | None = ..., flags=... + ) -> tuple[Incomplete, PySPropTagArray, PyMAPINAMEIDArray]: ... + def GetLastError(self, hr, flags): ... + def SaveChanges(self, flags) -> None: ... + def GetProplist(self, flags) -> PySPropTagArray: ... + +class PyIMAPISession: + def OpenEntry(self, entryId: str, iid: PyIID, flags): ... + def OpenMsgStore(self, uiParam, entryId: str, iid: PyIID, flags) -> PyIUnknown: ... + def QueryIdentity(self) -> str: ... + def Advise(self, entryId: str, mask, sink): ... + def Unadvise(self, connection) -> None: ... + def CompareEntryIDs(self, entryId: str, entryId1: str, flags: int = ...): ... + def GetLastError(self, hr, flags): ... + def GetMsgStoresTable(self, flags) -> PyIMAPITable: ... + def GetStatusTable(self, flags) -> PyIMAPITable: ... + def Logoff(self, uiParm, flags, reserved) -> None: ... + def OpenAddressBook(self, uiParm, iid: PyIID, flags) -> PyIAddrBook: ... + def OpenProfileSection(self, iidSection: PyIID, iid: PyIID, flags): ... + def AdminServices(self, flags: int = ...) -> PyIMsgServiceAdmin: ... + +class PyIMAPIStatus: + def ChangePassword(self, oldPassword, newPassword, ulFlags) -> None: ... + def SettingsDialog(self, ulUIParam, ulFlags) -> None: ... + def ValidateState(self, ulUIParam, ulFlags) -> None: ... + def FlushQueues(self, ulUIParam, transport: str, ulFlags) -> None: ... + +class PyIMAPITable: + def GetLastError(self, hr, flags): ... + def Advise(self, eventMask, adviseSink): ... + def SeekRow(self, bookmark, rowCount): ... + def SeekRowApprox(self, numerator, denominator) -> None: ... + def GetRowCount(self, flags): ... + def QueryRows(self, rowCount, flags): ... + def SetColumns(self, propTags, flags) -> None: ... + def GetStatus(self) -> None: ... + def QueryPosition(self) -> None: ... + def QueryColumns(self, flags): ... + def Abort(self) -> None: ... + def FreeBookmark(self, bookmark) -> None: ... + def CreateBookmark(self): ... + def Restrict(self, restriction: PySRestriction, flags) -> None: ... + def FindRow(self, restriction: PySRestriction, bookmarkOrigin, flags) -> None: ... + def SortTable(self, sortOrderSet: PySSortOrderSet, flags) -> None: ... + def Unadvise(self, handle) -> None: ... + +class PyIMachineDebugManager: + def AddApplication(self, pda: PyIRemoteDebugApplication) -> None: ... + def RemoveApplication(self, dwAppCookie) -> None: ... + def EnumApplications(self) -> None: ... + +class PyIMachineDebugManagerEvents: + def onAddApplication(self, pda: PyIRemoteDebugApplication, dwAppCookie) -> None: ... + def onRemoveApplication(self, pda: PyIRemoteDebugApplication, dwAppCookie) -> None: ... + +class PyIMessage: + def SetReadFlag(self, flag) -> None: ... + def GetAttachmentTable(self, flags) -> PyIMAPITable: ... + def OpenAttach(self, attachmentNum, interface: PyIID, flags) -> PyIAttach: ... + def CreateAttach(self, interface: PyIID, flags) -> tuple[Incomplete, PyIAttach]: ... + def DeleteAttach(self, attachmentNum, ulUIParam, interface, flags) -> None: ... + def ModifyRecipients(self, flags, mods) -> None: ... + def GetRecipientTable(self, flags) -> PyIMAPITable: ... + def SubmitMessage(self, flags) -> None: ... + +class PyIMoniker: + def BindToObject(self, bindCtx: PyIBindCtx, moniker: PyIMoniker, iidResult) -> PyIUnknown: ... + def BindToStorage(self, bindCtx: PyIBindCtx, moniker: PyIMoniker, iidResult) -> PyIUnknown: ... + def GetDisplayName(self, bindCtx: PyIBindCtx, moniker: PyIMoniker) -> str: ... + def ComposeWith(self, mkRight: PyIMoniker, fOnlyIfNotGeneric) -> PyIMoniker: ... + def Enum(self, fForward: bool = ...) -> PyIEnumMoniker: ... + def IsEqual(self, other: PyIMoniker) -> bool: ... + def IsSystemMoniker(self) -> bool: ... + def Hash(self): ... + +class PyIMsgServiceAdmin: + def GetLastError(self, hr, flags): ... + def CreateMsgService(self, serviceName: str, displayName: str, flags, uiParam: int = ...) -> None: ... + def ConfigureMsgService(self, iid: PyIID, ulUIParam, ulFlags, arg: list[Incomplete]) -> None: ... + def GetMsgServiceTable(self, flags) -> PyIMAPITable: ... + def GetProviderTable(self, flags) -> PyIMAPITable: ... + def DeleteMsgService(self, uuid: PyIID) -> None: ... + def RenameMsgService(self, uuid: PyIID, flags, newName: str) -> None: ... + def OpenProfileSection(self, uuid: PyIID, iid: PyIID, flags): ... + def AdminProviders(self, uuid: PyIID, flags): ... + +class PyIMsgStore: + def OpenEntry(self, entryId: str, iid: PyIID, flags): ... + def GetReceiveFolder(self, messageClass: str | None = ..., flags: int = ...) -> tuple[PyIID, str]: ... + def GetReceiveFolderTable(self, flags) -> PyIMAPITable: ... + def CompareEntryIDs(self, entryId: str, entryId1: str, flags: int = ...): ... + def GetLastError(self, hr, flags): ... + def AbortSubmit(self, entryId: str, flags: int = ...): ... + def Advise(self, entryId: str, eventMask, adviseSink) -> None: ... + def Unadvise(self, connection) -> None: ... + +class PyINameSpaceTreeControl: + def Initialize(self, hwndParent, prc: tuple[Incomplete, Incomplete, Incomplete, Incomplete], nsctsFlags) -> None: ... + def TreeAdvise(self, punk: PyIUnknown) -> None: ... + def TreeUnadvise(self, dwCookie) -> None: ... + def AppendRoot(self, psiRoot: PyIShellItem, grfEnumFlags, grfRootStyle, pif) -> None: ... + def InsertRoot(self, iIndex, psiRoot: PyIShellItem, grfEnumFlags, grfRootStyle, pif) -> None: ... + def RemoveRoot(self, psiRoot: PyIShellItem) -> None: ... + def RemoveAllRoots(self) -> None: ... + def GetRootItems(self) -> None: ... + def SetItemState(self, psi: PyIShellItem, nstcisMask, nstcisFlags) -> None: ... + def GetItemState(self, psi: PyIShellItem, nstcisMask) -> None: ... + def GetSelectedItems(self) -> None: ... + def GetItemCustomState(self, psi: PyIShellItem) -> None: ... + def SetItemCustomState(self, psi: PyIShellItem, iStateNumber) -> None: ... + def EnsureItemVisible(self, psi: PyIShellItem) -> None: ... + def SetTheme(self, pszTheme) -> None: ... + def GetNextItem(self, psi: PyIShellItem, nstcgi) -> None: ... + def HitTest(self, pt: tuple[Incomplete, Incomplete]) -> None: ... + def GetItemRect(self) -> None: ... + def CollapseAll(self) -> None: ... + +class PyINamedPropertyStore: + def GetNamedValue(self, Name) -> PyPROPVARIANT: ... + def SetNamedValue(self, propvar) -> None: ... + def GetNameCount(self): ... + def GetNameAt(self, Index): ... + +class PyIObjectArray: + def GetCount(self): ... + def GetAt(self, Index, riid: PyIID) -> PyIUnknown: ... + +class PyIObjectCollection: + def AddObject(self, punk: PyIUnknown) -> None: ... + def AddFromArray(self, Source: PyIObjectArray) -> None: ... + def RemoveObjectAt(self, Index) -> None: ... + def Clear(self) -> None: ... + +class PyIObjectWithPropertyKey: + def SetPropertyKey(self, key: PyPROPERTYKEY) -> None: ... + def GetPropertyKey(self) -> PyPROPERTYKEY: ... + +class PyIObjectWithSite: + def SetSite(self, pUnkSite) -> None: ... + def GetSite(self, riid: PyIID) -> None: ... + +class PyIOleClientSite: + def SaveObject(self) -> None: ... + def GetMoniker(self, dwAssign, dwWhichMoniker) -> None: ... + def GetContainer(self) -> None: ... + def ShowObject(self) -> None: ... + def OnShowWindow(self, fShow) -> None: ... + def RequestNewObjectLayout(self) -> None: ... + +class PyIOleCommandTarget: + def QueryStatus(self) -> None: ... + def Exec(self) -> None: ... + +class PyIOleControl: + def GetControlInfo(self) -> None: ... + def OnMnemonic(self, msg) -> None: ... + def OnAmbientPropertyChange(self, dispID) -> None: ... + def FreezeEvents(self, bFreeze) -> None: ... + +class PyIOleControlSite: + def OnControlInfoChanged(self) -> None: ... + def LockInPlaceActive(self, fLock) -> None: ... + def GetExtendedControl(self) -> None: ... + def TransformCoords( + self, PtlHimetric: tuple[Incomplete, Incomplete], pPtfContainer: tuple[float, float], dwFlags + ) -> None: ... + def TranslateAccelerator(self, pMsg: PyMSG, grfModifiers) -> None: ... + def OnFocus(self, fGotFocus) -> None: ... + def ShowPropertyFrame(self) -> None: ... + +class PyIOleInPlaceActiveObject: + def TranslateAccelerator(self, lpmsg: PyMSG) -> None: ... + def OnFrameWindowActivate(self, fActivate) -> None: ... + def OnDocWindowActivate(self, fActivate) -> None: ... + def ResizeBorder( + self, rcBorder: tuple[Incomplete, Incomplete, Incomplete, Incomplete], pUIWindow: PyIOleInPlaceUIWindow, fFrameWindow + ) -> None: ... + def EnableModeless(self, fEnable) -> None: ... + +class PyIOleInPlaceFrame: + def InsertMenus(self, hmenuShared, menuWidths: PyOLEMENUGROUPWIDTHS) -> None: ... + def SetMenu(self, hmenuShared, holemenu, hwndActiveObject) -> None: ... + def RemoveMenus(self, hmenuShared) -> None: ... + def SetStatusText(self, pszStatusText) -> None: ... + def EnableModeless(self, fEnable) -> None: ... + def TranslateAccelerator(self, lpmsg: PyMSG, wID) -> None: ... + +class PyIOleInPlaceObject: + def InPlaceDeactivate(self) -> None: ... + def UIDeactivate(self) -> None: ... + def SetObjectRects(self) -> None: ... + def ReactivateAndUndo(self) -> None: ... + +class PyIOleInPlaceSite: + def CanInPlaceActivate(self) -> None: ... + def OnInPlaceActivate(self) -> None: ... + def OnUIActivate(self) -> None: ... + def GetWindowContext(self) -> None: ... + def Scroll(self) -> None: ... + def OnUIDeactivate(self, fUndoable) -> None: ... + def OnInPlaceDeactivate(self) -> None: ... + def DiscardUndoState(self) -> None: ... + def DeactivateAndUndo(self) -> None: ... + def OnPosRectChange(self) -> None: ... + +class PyIOleInPlaceSiteEx: + def OnInPlaceActivateEx(self, dwFlags) -> None: ... + def OnInPlaceDeactivateEx(self, fNoRedraw) -> None: ... + def RequestUIActivate(self) -> None: ... + +class PyIOleInPlaceSiteWindowless: + def CanWindowlessActivate(self) -> None: ... + def GetCapture(self) -> None: ... + def SetCapture(self, fCapture) -> None: ... + def GetFocus(self) -> None: ... + def SetFocus(self, fFocus) -> None: ... + def GetDC(self, grfFlags, rect: tuple[Incomplete, Incomplete, Incomplete, Incomplete]) -> None: ... + def ReleaseDC(self, hDC) -> None: ... + def InvalidateRect(self, rect: tuple[Incomplete, Incomplete, Incomplete, Incomplete], fErase) -> None: ... + def InvalidateRgn(self, hRgn, fErase) -> None: ... + def ScrollRect(self, dx, dy) -> None: ... + def AdjustRect(self) -> None: ... + def OnDefWindowMessage(self, msg, wParam, lParam) -> None: ... + +class PyIOleInPlaceUIWindow: + def GetBorder(self) -> None: ... + def RequestBorderSpace(self, borderwidths: tuple[Incomplete, Incomplete, Incomplete, Incomplete]) -> None: ... + def SetBorderSpace(self, borderwidths: tuple[Incomplete, Incomplete, Incomplete, Incomplete]) -> None: ... + def SetActiveObject(self, pActiveObject: PyIOleInPlaceActiveObject, pszObjName) -> None: ... + +class PyIOleObject: + def SetClientSite(self, pClientSite: PyIOleClientSite) -> None: ... + def GetClientSite(self) -> None: ... + def SetHostNames(self, szContainerApp, szContainerObj) -> None: ... + def Close(self, dwSaveOption) -> None: ... + def SetMoniker(self, dwWhichMoniker, pmk: PyIMoniker) -> None: ... + def GetMoniker(self, dwAssign, dwWhichMoniker) -> None: ... + def InitFromData(self, pDataObject: PyIDataObject, fCreation, dwReserved) -> None: ... + def GetClipboardData(self, dwReserved) -> None: ... + def DoVerb( + self, + iVerb, + msg: PyMSG, + pActiveSite: PyIOleClientSite, + lindex, + hwndParent, + rect: tuple[Incomplete, Incomplete, Incomplete, Incomplete], + ) -> None: ... + def EnumVerbs(self) -> None: ... + def Update(self) -> None: ... + def IsUpToDate(self) -> bool: ... + def GetUserClassID(self) -> None: ... + def GetUserType(self, dwFormOfType) -> None: ... + def SetExtent(self, dwDrawAspect, size: tuple[Incomplete, Incomplete]) -> None: ... + def GetExtent(self, dwDrawAspect, size: tuple[Incomplete, Incomplete]) -> None: ... + def Advise(self, pAdvSink) -> None: ... + def Unadvise(self, dwConnection) -> None: ... + def EnumAdvise(self) -> None: ... + def GetMiscStatus(self, dwAspect) -> None: ... + def SetColorScheme(self) -> None: ... + +class PyIOleWindow: + def GetWindow(self) -> None: ... + def ContextSensitiveHelp(self, fEnterMode) -> None: ... + +class PyIPersist: + def GetClassID(self) -> PyIID: ... + +class PyIPersistFile: + def IsDirty(self) -> bool: ... + def Load(self, FileName, Mode) -> None: ... + def Save(self, FileName, fRemember) -> None: ... + def SaveCompleted(self, FileName) -> None: ... + def GetCurFile(self): ... + +class PyIPersistFolder: + def Initialize(self, pidl: PyIDL) -> None: ... + +class PyIPersistFolder2: + def GetCurFolder(self) -> None: ... + +class PyIPersistPropertyBag: + def InitNew(self) -> None: ... + def Load(self, bag: PyIPropertyBag, log: PyIErrorLog | None = ...) -> None: ... + def Save(self, bag: PyIPropertyBag, clearDirty, saveProperties) -> None: ... + +class PyIPersistSerializedPropStorage: + def SetFlags(self, flags) -> None: ... + def SetPropertyStorage(self, ps) -> None: ... + def GetPropertyStorage(self): ... + +class PyIPersistStorage: + def IsDirty(self) -> bool: ... + def InitNew(self, PyIStorage: PyIStorage) -> None: ... + def Load(self, storage: PyIStorage) -> None: ... + def Save(self, PyIStorage: PyIStorage, _int) -> None: ... + def SaveCompleted(self, PyIStorage: PyIStorage) -> None: ... + def HandsOffStorage(self) -> None: ... + +class PyIPersistStream: + def IsDirty(self) -> bool: ... + def Load(self, stream: PyIStream) -> None: ... + def Save(self, stream: PyIStream, bClearDirty) -> None: ... + def GetSizeMax(self) -> ULARGE_INTEGER: ... + +class PyIPersistStreamInit: + def InitNew(self) -> None: ... + +class PyIProcessDebugManager: + def CreateApplication(self) -> None: ... + def GetDefaultApplication(self) -> None: ... + def AddApplication(self, pda: PyIDebugApplication) -> None: ... + def RemoveApplication(self, dwAppCookie) -> None: ... + def CreateDebugDocumentHelper(self, unkOuter) -> None: ... + +class PyIProfAdmin: + def GetLastError(self, hr, flags): ... + def CreateProfile(self, oldProfileName: str, Password: str, uiParam: int = ..., flags: int = ...) -> None: ... + def DeleteProfile(self, oldProfileName: str, flags: int = ...) -> None: ... + def CopyProfile(self, oldProfileName: str, Password: str, newProfileName: str, uiParam: int = ..., flags=...) -> None: ... + def RenameProfile(self, oldProfileName: str, Password: str, newProfileName: str, uiParam: int = ..., flags=...) -> None: ... + def SetDefaultProfile(self, profileName: str, flags: int = ...) -> None: ... + def AdminServices(self, profileName: str, Password: str | None = ..., uiParam: int = ..., flags=...) -> PyIProfAdmin: ... + +class PyIPropertyBag: + def Read(self, propName, propType, errorLog: PyIErrorLog | None = ...): ... + def Write(self, propName, value) -> None: ... + +class PyIPropertyChange: + def ApplyToPropVariant(self, OrigVal: PyPROPVARIANT) -> PyPROPVARIANT: ... + +class PyIPropertyChangeArray: + def GetCount(self): ... + def GetAt(self, Index, riid: PyIID) -> PyIPropertyChange: ... + def InsertAt(self, Index, PropChange: PyIPropertyChange) -> None: ... + def Append(self, PropChange: PyIPropertyChange) -> None: ... + def AppendOrReplace(self, PropChange: PyIPropertyChange) -> None: ... + def RemoveAt(self, Index) -> None: ... + def IsKeyInArray(self, key: PyPROPERTYKEY) -> bool: ... + +class PyIPropertyDescription: + def GetPropertyKey(self) -> PyPROPERTYKEY: ... + def GetCanonicalName(self): ... + def GetPropertyType(self): ... + def GetDisplayName(self): ... + def GetEditInvitation(self): ... + def GetTypeFlags(self, mask): ... + def GetViewFlags(self): ... + def GetDefaultColumnWidth(self): ... + def GetDisplayType(self): ... + def GetColumnState(self): ... + def GetGroupingRange(self): ... + def GetRelativeDescriptionType(self): ... + def GetRelativeDescription(self, var1: PyPROPVARIANT, var2: PyPROPVARIANT) -> tuple[Incomplete, Incomplete]: ... + def GetSortDescription(self): ... + def GetSortDescriptionLabel(self, Descending): ... + def GetAggregationType(self): ... + def GetConditionType(self) -> tuple[Incomplete, Incomplete]: ... + def GetEnumTypelist(self, riid: PyIID) -> PyIPropertyEnumTypelist: ... + def CoerceToCanonicalValue(self, Value: PyPROPVARIANT): ... + def FormatForDisplay(self, Value: PyPROPVARIANT, Flags): ... + def IsValueCanonical(self, Value) -> bool: ... + +class PyIPropertyDescriptionAliasInfo: + def GetSortByAlias(self, riid: PyIID) -> PyIPropertyDescription: ... + def GetAdditionalSortByAliases(self, riid: PyIID) -> PyIPropertyDescriptionlist: ... + +class PyIPropertyDescriptionlist: + def GetCount(self): ... + def GetAt(self, Elem, riid: PyIID) -> PyIPropertyDescription: ... + +class PyIPropertyDescriptionSearchInfo: + def GetSearchInfoFlags(self): ... + def GetColumnIndexType(self): ... + def GetProjectionString(self): ... + def GetMaxSize(self): ... + +class PyIPropertyEnumType: + def GetEnumType(self): ... + def GetValue(self) -> PyPROPVARIANT: ... + def GetRangeMinValue(self) -> PyPROPVARIANT: ... + def GetRangeSetValue(self) -> PyPROPVARIANT: ... + def GetDisplayText(self) -> None: ... + +class PyIPropertyEnumTypelist: + def GetCount(self): ... + def GetAt(self, itype, riid: PyIID) -> PyIPropertyEnumType: ... + def FindMatchingIndex(self, Cmp: PyPROPVARIANT): ... + +class PyIPropertySetStorage: + def Create(self, fmtid: PyIID, clsid: PyIID, Flags, Mode) -> PyIPropertyStorage: ... + def Open(self, fmtid: PyIID, Mode) -> PyIPropertyStorage: ... + def Delete(self, fmtid: PyIID) -> None: ... + def Enum(self) -> PyIEnumSTATPROPSETSTG: ... + +class PyIPropertyStorage: + def ReadMultiple(self, props: tuple[PROPSPEC, ...]) -> tuple[Incomplete, ...]: ... + def WriteMultiple(self, props: tuple[PROPSPEC, ...], values: tuple[Incomplete, ...], propidNameFirst: int = ...) -> None: ... + def DeleteMultiple(self, props: tuple[PROPSPEC, ...]) -> None: ... + def ReadPropertyNames(self, props: tuple[Incomplete, ...]) -> tuple[Incomplete, ...]: ... + def WritePropertyNames(self, props: tuple[Incomplete, ...], names: tuple[str, ...]) -> None: ... + def DeletePropertyNames(self, props: tuple[Incomplete, ...]) -> None: ... + def Commit(self, CommitFlags) -> None: ... + def Revert(self) -> None: ... + def Enum(self) -> PyIEnumSTATPROPSTG: ... + def SetTimes(self, ctime: PyTime, atime: PyTime, mtime: PyTime) -> None: ... + def SetClass(self, clsid: PyIID) -> None: ... + def Stat(self): ... + +class PyIPropertyStore: + def GetCount(self): ... + def GetAt(self, iProp) -> PyPROPERTYKEY: ... + def GetValue(self, Key: PyPROPERTYKEY) -> PyPROPVARIANT: ... + def SetValue(self, Key: PyPROPERTYKEY, Value: PyPROPVARIANT) -> None: ... + def Commit(self) -> None: ... + +class PyIPropertyStoreCache: + def GetState(self, key: PyPROPERTYKEY): ... + def GetValueAndState(self, key: PyPROPERTYKEY) -> tuple[PyPROPVARIANT, Incomplete]: ... + def SetState(self, key: PyPROPERTYKEY, state) -> None: ... + def SetValueAndState(self, key: PyPROPERTYKEY, value: PyPROPVARIANT, state) -> None: ... + +class PyIPropertyStoreCapabilities: + def IsPropertyWritable(self, key: PyPROPERTYKEY) -> bool: ... + +class PyIPropertySystem: + def GetPropertyDescription(self, Key: PyPROPERTYKEY, riid: PyIID) -> PyIPropertyDescription: ... + def GetPropertyDescriptionByName(self, CanonicalName, riid: PyIID) -> PyIPropertyDescription: ... + def GetPropertyDescriptionlistFromString(self, Proplist, riid: PyIID) -> PyIPropertyDescriptionlist: ... + def EnumeratePropertyDescriptions(self, Filter, riid: PyIID) -> PyIPropertyDescriptionlist: ... + def FormatForDisplay(self, Key: PyPROPERTYKEY, Value: PyPROPVARIANT, Flags): ... + def RegisterPropertySchema(self, Path) -> None: ... + def UnregisterPropertySchema(self, Path) -> None: ... + def RefreshPropertySchema(self) -> None: ... + +class PyIProvideClassInfo: + def GetClassInfo(self) -> PyITypeInfo: ... + +class PyIProvideClassInfo2: + def GetGUID(self, flags) -> PyIID: ... + +class PyIProvideExpressionContexts: + def EnumExpressionContexts(self) -> None: ... + +class PyIProvideTaskPage: + def GetPage(self, tpType, PersistChanges) -> None: ... + +class PyIQueryAssociations: + def Init(self, flags, assoc: str, hkeyProgId: PyHKEY | None = ..., hwnd: int | None = ...) -> None: ... + def GetKey(self, flags, assocKey, arg: str): ... + def GetString(self, flags, assocStr, arg: str): ... + +class PyIRelatedItem: + def GetItemIDlist(self) -> PyIDL: ... + def GetItem(self) -> PyIShellItem: ... + +class PyIRemoteDebugApplication: + def ResumeFromBreakPoint(self, prptFocus: PyIRemoteDebugApplicationThread, bra, era) -> None: ... + def CauseBreak(self) -> None: ... + def ConnectDebugger(self, pad: PyIApplicationDebugger) -> None: ... + def DisconnectDebugger(self) -> None: ... + def GetDebugger(self) -> PyIApplicationDebugger: ... + def CreateInstanceAtApplication(self, rclsid: PyIID, pUnkOuter: PyIUnknown, dwClsContext, riid: PyIID) -> PyIUnknown: ... + def QueryAlive(self) -> None: ... + def EnumThreads(self) -> PyIEnumRemoteDebugApplicationThreads: ... + def GetName(self) -> None: ... + def GetRootNode(self) -> PyIDebugApplicationNode: ... + def EnumGlobalExpressionContexts(self): ... + +class PyIRemoteDebugApplicationEvents: + def OnConnectDebugger(self, pad: PyIApplicationDebugger) -> None: ... + def OnDisconnectDebugger(self) -> None: ... + def OnSetName(self, pstrName) -> None: ... + def OnDebugOutput(self, pstr) -> None: ... + def OnClose(self) -> None: ... + def OnEnterBreakPoint(self, prdat: PyIRemoteDebugApplicationThread) -> None: ... + def OnLeaveBreakPoint(self, prdat: PyIRemoteDebugApplicationThread) -> None: ... + def OnCreateThread(self, prdat: PyIRemoteDebugApplicationThread) -> None: ... + def OnDestroyThread(self, prdat: PyIRemoteDebugApplicationThread) -> None: ... + def OnBreakFlagChange(self, abf, prdatSteppingThread: PyIRemoteDebugApplicationThread) -> None: ... + +class PyIRemoteDebugApplicationThread: + def GetSystemThreadId(self) -> None: ... + def GetApplication(self) -> None: ... + def EnumStackFrames(self) -> None: ... + def GetDescription(self) -> None: ... + def SetNextStatement(self, pStackFrame: PyIDebugStackFrame, pCodeContext: PyIDebugCodeContext) -> None: ... + def GetState(self) -> None: ... + def Suspend(self) -> None: ... + def Resume(self) -> None: ... + def GetSuspendCount(self) -> None: ... + +class PyIRunningObjectTable: + def Register(self): ... + def Revoke(self): ... + def IsRunning(self, objectName: PyIMoniker) -> bool: ... + def GetObject(self, objectName: PyIMoniker) -> PyIUnknown: ... + def EnumRunning(self) -> PyIEnumMoniker: ... + +class PyIScheduledWorkItem: + def CreateTrigger(self) -> tuple[Incomplete, PyITaskTrigger]: ... + def DeleteTrigger(self, Trigger) -> None: ... + def GetTriggerCount(self): ... + def GetTrigger(self, iTrigger) -> PyITaskTrigger: ... + def GetTriggerString(self): ... + def GetRunTimes(self, Count, Begin: PyTime, End: PyTime) -> tuple[PyTime, Incomplete, Incomplete, Incomplete]: ... + def GetNextRunTime(self) -> PyTime: ... + def SetIdleWait(self, wIdleMinutes, wDeadlineMinutes) -> None: ... + def GetIdleWait(self) -> tuple[Incomplete, Incomplete]: ... + def Run(self) -> None: ... + def Terminate(self) -> None: ... + def EditWorkItem(self, hParent: int, dwReserved) -> None: ... + def GetMostRecentRunTime(self) -> PyTime: ... + def GetStatus(self): ... + def GetExitCode(self) -> tuple[Incomplete, Incomplete]: ... + def SetComment(self, Comment) -> None: ... + def GetComment(self) -> str: ... + def SetCreator(self, Creator) -> None: ... + def GetCreator(self) -> None: ... + def SetWorkItemData(self, Data: str) -> None: ... + def GetWorkItemData(self) -> str: ... + def SetErrorRetryCount(self, wRetryCount) -> None: ... + def GetErrorRetryCount(self) -> None: ... + def SetErrorRetryInterval(self, RetryInterval) -> None: ... + def GetErrorRetryInterval(self) -> None: ... + def SetFlags(self, dwFlags) -> None: ... + def GetFlags(self): ... + def SetAccountInformation(self, AccountName, Password) -> None: ... + def GetAccountInformation(self): ... + +class PyIServerSecurity: + def QueryBlanket(self, Capabilities: int = ...): ... + def ImpersonateClient(self) -> None: ... + def RevertToSelf(self) -> None: ... + def IsImpersonating(self) -> bool: ... + +class PyIServiceProvider: + def QueryService(self, clsid: PyIID, iid: PyIID) -> PyIUnknown: ... + +class PyIShellBrowser: + def InsertMenusSB(self, hmenuShared: int, lpMenuWidths: PyOLEMENUGROUPWIDTHS) -> PyOLEMENUGROUPWIDTHS: ... + def SetMenuSB(self, hmenuShared: int, holemenuRes: int, hwndActiveObject: int) -> None: ... + def RemoveMenusSB(self, hmenuShared: int) -> None: ... + def SetStatusTextSB(self, pszStatusText) -> None: ... + def EnableModelessSB(self, fEnable) -> None: ... + def TranslateAcceleratorSB(self, pmsg: PyMSG, wID) -> None: ... + def BrowseObject(self, pidl: PyIDL, wFlags) -> None: ... + def GetViewStateStream(self, grfMode) -> PyIStream: ... + def GetControlWindow(self, _id) -> None: ... + def SendControlMsg(self, _id, uMsg, wParam, lParam): ... + def QueryActiveShellView(self) -> PyIShellView: ... + def OnViewWindowActive(self, pshv: PyIShellView) -> None: ... + def SetToolbarItems(self, lpButtons, uFlags) -> None: ... + +class PyIShellExtInit: + def Initialize(self, pFolder: PyIDL, pDataObject: PyIDataObject, hkey: int) -> None: ... + +class PyIShellFolder: + def ParseDisplayName(self, hwndOwner: int, pbc: PyIBindCtx, DisplayName, Attributes: int = ...): ... + def EnumObjects(self, grfFlags, hwndOwner: int | None = ...) -> PyIEnumIDlist: ... + def BindToObject(self, pidl: PyIDL, pbc: PyIBindCtx, riid: PyIID) -> PyIShellFolder: ... + def BindToStorage(self, pidl: PyIDL, pbc: PyIBindCtx, riid: PyIID): ... + def CompareIDs(self, lparam, pidl1: PyIDL, pidl2: PyIDL): ... + def CreateViewObject(self, hwndOwner, riid: PyIID) -> PyIShellView: ... + def GetAttributesOf(self, pidl: tuple[PyIDL, ...], rgfInOut): ... + def GetUIObjectOf( + self, hwndOwner: int, pidl: tuple[PyIDL, ...], riid: PyIID, iidout: PyIID, Reserved=... + ) -> tuple[Incomplete, PyIUnknown]: ... + def GetDisplayNameOf(self, pidl: PyIDL, uFlags): ... + def SetNameOf(self, hwndOwner, pidl: PyIDL, Name, Flags) -> PyIDL: ... + +class PyIShellFolder2: + def GetDefaultSearchGUID(self, pguid: PyIID) -> PyIID: ... + def EnumSearches(self): ... + def GetDefaultColumn(self) -> tuple[Incomplete, Incomplete]: ... + def GetDefaultColumnState(self, iColumn): ... + def GetDetailsEx(self, pidl: PyIDL, pscid): ... + def GetDetailsOf(self, pidl: PyIDL, iColumn) -> tuple[Incomplete, Incomplete, Incomplete]: ... + def MapColumnToSCID(self, Column): ... + +class PyIShellIcon: + def GetIconOf(self, pidl: PyIDL) -> None: ... + +class PyIShellIconOverlay: + def GetOverlayIndex(self, pidl: PyIDL) -> None: ... + def GetOverlayIconIndex(self, pidl: PyIDL) -> None: ... + +class PyIShellIconOverlayIdentifier: + def IsMemberOf(self, path: str, attrib) -> bool: ... + def GetOverlayInfo(self) -> tuple[str, Incomplete, Incomplete]: ... + def GetPriority(self): ... + +class PyIShellIconOverlayManager: + def GetFileOverlayInfo(self, path, attrib, flags): ... + def GetReservedOverlayInfo(self, path, attrib, flags, ireservedID) -> None: ... + def RefreshOverlayImages(self, flags) -> None: ... + def LoadNonloadedOverlayIdentifiers(self) -> None: ... + def OverlayIndexFromImageIndex(self, iImage, fAdd) -> None: ... + +class PyIShellItem: + def BindToHandler(self, pbc: PyIBindCtx, bhid: PyIID, riid: PyIID): ... + def GetParent(self) -> PyIShellItem: ... + def GetDisplayName(self, sigdnName): ... + def GetAttributes(self, Mask): ... + def Compare(self, psi: PyIShellItem, hint): ... + +class PyIShellItem2: + def GetPropertyStore(self, Flags, riid: PyIID) -> PyIPropertyStore: ... + def GetPropertyStoreForKeys(self, Keys: tuple[Incomplete, ...], Flags, riid: PyIID) -> PyIPropertyStore: ... + def GetPropertyStoreWithCreateObject(self, Flags, CreateObject: PyIUnknown, riid: PyIID) -> PyIPropertyStore: ... + def GetPropertyDescriptionlist(self, Type: PyPROPERTYKEY, riid: PyIID) -> PyIPropertyDescriptionlist: ... + def Update(self, BindCtx: Incomplete | None = ...) -> None: ... + def GetProperty(self, key: PyPROPERTYKEY): ... + def GetCLSID(self, key: PyPROPERTYKEY) -> PyIID: ... + def GetFileTime(self, key: PyPROPERTYKEY) -> PyTime: ... + def GetInt32(self, key: PyPROPERTYKEY): ... + def GetString(self, key: PyPROPERTYKEY): ... + def GetUInt32(self, key: PyPROPERTYKEY): ... + def GetUInt64(self, key: PyPROPERTYKEY): ... + def GetBool(self, key: PyPROPERTYKEY): ... + +class PyIShellItemArray: + def BindToHandler(self, pbc: PyIBindCtx, rbhid: PyIID, riid: PyIID): ... + def GetPropertyStore(self, flags, riid: PyIID) -> PyIPropertyStore: ... + def GetPropertyDescriptionlist(self, Type: PyPROPERTYKEY, riid: PyIID) -> PyIPropertyDescriptionlist: ... + def GetAttributes(self, AttribFlags, Mask): ... + def GetCount(self): ... + def GetItemAt(self, dwIndex) -> PyIShellItem: ... + def EnumItems(self) -> PyIEnumShellItems: ... + +class PyIShellItemResources: + def GetAttributes(self) -> None: ... + def GetSize(self): ... + def GetTimes(self) -> None: ... + def SetTimes(self, pftCreation: PyTime, pftWrite: PyTime, pftAccess: PyTime) -> None: ... + def GetResourceDescription(self, pcsir: PySHELL_ITEM_RESOURCE) -> None: ... + def EnumResources(self) -> PyIEnumResources: ... + def SupportsResource(self, pcsir: PySHELL_ITEM_RESOURCE): ... + def OpenResource(self, pcsir: PySHELL_ITEM_RESOURCE, riid: PyIID) -> PyIUnknown: ... + def CreateResource(self, sir: PySHELL_ITEM_RESOURCE, riid: PyIID): ... + def MarkForDelete(self) -> None: ... + +class PyIShellLibrary: + def LoadLibraryFromItem(self, Library: PyIShellItem, Mode) -> None: ... + def LoadLibraryFromKnownFolder(self, Library: PyIID, Mode) -> None: ... + def AddFolder(self, Location: PyIShellItem) -> None: ... + def RemoveFolder(self, Location: PyIShellItem) -> None: ... + def GetFolders(self, Filter, riid: PyIID) -> PyIShellItemArray: ... + def ResolveFolder(self, FolderToResolve: PyIShellItem, Timeout, riid: PyIID) -> PyIShellItem: ... + def GetDefaultSaveFolder(self, Type, riid: PyIID) -> PyIShellItem: ... + def SetDefaultSaveFolder(self, Type, SaveFolder: PyIShellItem) -> None: ... + def GetOptions(self): ... + def SetOptions(self, Mask, Options) -> None: ... + def GetFolderType(self) -> PyIID: ... + def SetFolderType(self, Type: PyIID) -> None: ... + def GetIcon(self): ... + def SetIcon(self, Icon) -> None: ... + def Commit(self) -> None: ... + def Save(self, FolderToSaveIn: PyIShellItem, LibraryName, Flags) -> PyIShellItem: ... + def SaveInKnownFolder(self, FolderToSaveIn: PyIID, LibraryName, Flags) -> PyIShellItem: ... + +class PyIShellLink: + def GetPath(self, fFlags, cchMaxPath) -> tuple[Incomplete, WIN32_FIND_DATA]: ... + def GetIDlist(self) -> PyIDL: ... + def SetIDlist(self, pidl: PyIDL) -> None: ... + def GetDescription(self, cchMaxName: int = ...): ... + def SetDescription(self, Name) -> None: ... + def GetWorkingDirectory(self, cchMaxName: int = ...): ... + def SetWorkingDirectory(self, Dir) -> None: ... + def GetArguments(self, cchMaxName: int = ...): ... + def SetArguments(self, args) -> None: ... + def GetHotkey(self): ... + def SetHotkey(self, wHotkey) -> None: ... + def GetShowCmd(self): ... + def SetShowCmd(self, iShowCmd) -> None: ... + def GetIconLocation(self, cchMaxPath): ... + def SetIconLocation(self, iconPath: str, iIcon) -> None: ... + def SetRelativePath(self, relPath: str, reserved: int = ...) -> None: ... + def Resolve(self, hwnd: int, fFlags) -> None: ... + def SetPath(self, path: str) -> None: ... + +class PyIShellLinkDatalist: + def AddDataBlock(self, DataBlock) -> None: ... + def CopyDataBlock(self, Sig): ... + def GetFlags(self): ... + def RemoveDataBlock(self, Sig) -> None: ... + def SetFlags(self, Flags) -> None: ... + +class PyIShellView: + def TranslateAccelerator(self, pmsg): ... + def EnableModeless(self, fEnable) -> None: ... + def UIActivate(self, uState) -> None: ... + def Refresh(self) -> None: ... + def CreateViewWindow( + self, + psvPrevious: PyIShellView, + pfs: tuple[Incomplete, Incomplete], + psb: PyIShellBrowser, + prcView: tuple[Incomplete, Incomplete, Incomplete, Incomplete], + ): ... + def DestroyViewWindow(self) -> None: ... + def GetCurrentInfo(self): ... + def SaveViewState(self) -> None: ... + def SelectItem(self, pidlItem: PyIDL, uFlags) -> None: ... + def GetItemObject(self, uItem, riid: PyIID) -> PyIUnknown: ... + +class PyISpecifyPropertyPages: + def GetPages(self) -> None: ... + +class PyIStorage: + def CreateStream(self, Name, Mode, reserved1: int = ..., reserved2: int = ...) -> PyIStream: ... + def OpenStream(self, Name, reserved1, Mode, reserved2: int = ...) -> PyIStream: ... + def CreateStorage(self, Name, Mode, StgFmt, reserved2: int = ...) -> PyIStorage: ... + def OpenStorage(self, Name, Priority: PyIStorage, Mode, snbExclude, reserved=...) -> PyIStorage: ... + def CopyTo(self, rgiidExclude: tuple[Incomplete, Incomplete], snbExclude, stgDest: PyIStorage) -> None: ... + def MoveElementTo(self, Name, stgDest: PyIStorage, NewName, Flags) -> None: ... + def Commit(self, grfCommitFlags) -> None: ... + def Revert(self) -> None: ... + def EnumElements(self, reserved1: int = ..., reserved2: Incomplete | None = ..., reserved3: int = ...) -> PyIEnumSTATSTG: ... + def DestroyElement(self, name: str) -> None: ... + def RenameElement(self, OldName, NewName) -> None: ... + def SetElementTimes(self, name, ctime: PyTime, atime: PyTime, mtime: PyTime) -> None: ... + def SetClass(self, clsid: PyIID) -> None: ... + def SetStateBits(self, grfStateBits, grfMask) -> None: ... + def Stat(self, grfStatFlag) -> STATSTG: ... + +class PyIStream: + def Read(self, numBytes) -> str: ... + def read(self, numBytes) -> str: ... + def Write(self, data: str) -> None: ... + def write(self, data: str) -> None: ... + def Seek(self, offset, origin) -> ULARGE_INTEGER: ... + def SetSize(self, newSize: ULARGE_INTEGER) -> None: ... + def CopyTo(self, stream: PyIStream, cb: ULARGE_INTEGER) -> ULARGE_INTEGER: ... + def Commit(self, flags) -> None: ... + def Revert(self) -> None: ... + def LockRegion(self, offset: ULARGE_INTEGER, cb: ULARGE_INTEGER, lockType) -> None: ... + def UnLockRegion(self, offset: ULARGE_INTEGER, cb: ULARGE_INTEGER, lockType) -> None: ... + def Clone(self) -> PyIStream: ... + def Stat(self, grfStatFlag: int = ...) -> STATSTG: ... + +class PyITask: + def SetApplicationName(self, ApplicationName) -> None: ... + def GetApplicationName(self): ... + def SetParameters(self, Parameters) -> None: ... + def GetParameters(self): ... + def SetWorkingDirectory(self, WorkingDirectory) -> None: ... + def GetWorkingDirectory(self): ... + def SetPriority(self, Priority) -> None: ... + def GetPriority(self): ... + def SetTaskFlags(self, dwFlags) -> None: ... + def GetTaskFlags(self): ... + def SetMaxRunTime(self, MaxRunTimeMS) -> None: ... + def GetMaxRunTime(self): ... + +class PyITaskScheduler: + def SetTargetComputer(self, Computer) -> None: ... + def GetTargetComputer(self): ... + def Enum(self) -> tuple[str, ...]: ... + def Activate(self, Name, riid: PyIID) -> PyITask: ... + def Delete(self, TaskName) -> None: ... + def NewWorkItem(self, TaskName, rclsid: PyIID, riid: PyIID) -> PyITask: ... + def AddWorkItem(self, TaskName, WorkItem: PyITask) -> None: ... + def IsOfType(self, Name, riid: PyIID) -> bool: ... + +class PyITaskTrigger: + def SetTrigger(self, Trigger: PyTASK_TRIGGER) -> None: ... + def GetTrigger(self) -> PyTASK_TRIGGER: ... + def GetTriggerString(self) -> str: ... + +class PyITaskbarlist: + def HrInit(self) -> None: ... + def AddTab(self, hwnd: int) -> None: ... + def DeleteTab(self, hwnd: int) -> None: ... + def ActivateTab(self, hwnd: int) -> None: ... + def SetActiveAlt(self, hwnd: int) -> None: ... + +class PyITransferAdviseSink: + def UpdateProgress(self, SizeCurrent, SizeTotal, FilesCurrent, FilesTotal, FoldersCurrent, FoldersTotal) -> None: ... + def UpdateTransferState(self, State) -> None: ... + def ConfirmOverwrite(self, Source: PyIShellItem, DestParent: PyIShellItem, Name): ... + def ConfirmEncryptionLoss(self, Source: PyIShellItem): ... + def FileFailure(self, Item: PyIShellItem, ItemName, Error) -> tuple[Incomplete, Incomplete]: ... + def SubStreamFailure(self, Item: PyIShellItem, StreamName, Error): ... + def PropertyFailure(self, Item: PyIShellItem, key: PyPROPERTYKEY, Error): ... + +class PyITransferDestination: + def Advise(self, Sink: PyITransferAdviseSink): ... + def Unadvise(self, Cookie) -> None: ... + def CreateItem( + self, Name, Attributes, Size, Flags, riidItem: PyIID, riidResources: PyIID + ) -> tuple[Incomplete, Incomplete, Incomplete]: ... + +class PyITransferMediumItem: ... + +class PyITransferSource: + def Advise(self, Sink: PyITransferAdviseSink): ... + def Unadvise(self, Cookie) -> None: ... + def SetProperties(self, proparray: PyIPropertyChangeArray) -> None: ... + def OpenItem(self, Item: PyIShellItem, flags, riid: PyIID) -> tuple[Incomplete, PyIShellItemResources]: ... + def MoveItem(self, Item: PyIShellItem, ParentDst: PyIShellItem, NameDst, flags) -> tuple[Incomplete, PyIShellItem]: ... + def RecycleItem(self, Source: PyIShellItem, ParentDest: PyIShellItem, flags) -> tuple[Incomplete, PyIShellItem]: ... + def RemoveItem(self, Source: PyIShellItem, flags): ... + def RenameItem(self, Source: PyIShellItem, NewName, flags) -> tuple[Incomplete, PyIShellItem]: ... + def LinkItem(self, Source: PyIShellItem, ParentDest: PyIShellItem, NewName, flags) -> tuple[Incomplete, PyIShellItem]: ... + def ApplyPropertiesToItem(self, Source: PyIShellItem) -> PyIShellItem: ... + def GetDefaultDestinationName(self, Source: PyIShellItem, ParentDest: PyIShellItem): ... + def EnterFolder(self, ChildFolderDest: PyIShellItem): ... + def LeaveFolder(self, ChildFolderDest: PyIShellItem): ... + +class PyITypeComp: + def Bind(self, szName: str, wflags: int = ...): ... + def BindType(self, szName: str): ... + +class PyITypeInfo: + def GetContainingTypeLib(self) -> tuple[PyITypeLib, Incomplete]: ... + def GetDocumentation(self, memberId) -> tuple[Incomplete, Incomplete, Incomplete, Incomplete]: ... + def GetFuncDesc(self, memberId) -> FUNCDESC: ... + def GetImplTypeFlags(self, index): ... + def GetIDsOfNames(self): ... + def GetNames(self, memberId): ... + def GetTypeAttr(self) -> TYPEATTR: ... + def GetRefTypeInfo(self, hRefType) -> PyITypeInfo: ... + def GetRefTypeOfImplType(self, hRefType): ... + def GetVarDesc(self, memberId) -> VARDESC: ... + def GetTypeComp(self) -> PyITypeComp: ... + +class PyITypeLib: + def GetDocumentation(self, index): ... + def GetLibAttr(self) -> TLIBATTR: ... + def GetTypeComp(self) -> PyITypeComp: ... + def GetTypeInfo(self, index) -> PyITypeInfo: ... + def GetTypeInfoCount(self): ... + def GetTypeInfoOfGuid(self, iid: PyIID) -> PyITypeInfo: ... + def GetTypeInfoType(self, index): ... + +class PyIUniformResourceLocator: + def GetURL(self): ... + def SetURL(self, URL, InFlags: int = ...) -> None: ... + def InvokeCommand(self, Verb, Flags: int = ..., hwndParent: int = ...): ... + +@final +class PyIUnknown: + def QueryInterface(self, iid, useIID: Incomplete | None = ...) -> PyIUnknown: ... + +class PyIViewObject: + def Draw( + self, + dwDrawAspect, + lindex, + aspectFlags, + hdcTargetDev, + hdcDraw, + arg: tuple[Incomplete, Incomplete, Incomplete, Incomplete], + arg1: tuple[Incomplete, Incomplete, Incomplete, Incomplete], + funcContinue, + obContinue, + ) -> None: ... + def GetColorSet(self, dwDrawAspect, lindex, aspectFlags, hicTargetDev) -> None: ... + def Freeze(self, dwDrawAspect, lindex, aspectFlags) -> None: ... + def Unfreeze(self, dwFreeze) -> None: ... + def SetAdvise(self, aspects, advf, pAdvSink) -> None: ... + def GetAdvise(self) -> None: ... + +class PyIViewObject2: + def GetExtent(self, dwDrawAspect, lindex, targetDevice) -> None: ... + +class PyMAPINAMEIDArray: ... +class PyOLEMENUGROUPWIDTHS: ... +class PyPROPERTYKEY: ... + +@final +class PyPROPVARIANT: + @property + def vt(self): ... + def GetValue(self): ... + def ToString(self): ... + def ChangeType(self, Type, Flags: int = ...) -> PyPROPVARIANT: ... + +class PySAndRestriction: ... +class PySBinaryArray: ... +class PySBitMaskRestriction: ... +class PySContentRestriction: ... +class PySExistRestriction: ... +class PySHELL_ITEM_RESOURCE: ... +class PySNotRestriction: ... +class PySOrRestriction: ... +class PySPropTagArray: ... +class PySPropValue: ... +class PySPropValueArray: ... +class PySPropertyRestriction: ... +class PySRestriction: ... +class PySRow: ... +class PySRowSet: ... +class PySSortOrderItem: ... +class PySSortOrderSet: ... + +class PySTGMEDIUM: + @property + def tymed(self): ... + @property + def data(self): ... + @property + def data_handle(self): ... + def set(self, tymed, data) -> None: ... + +class PyTASK_TRIGGER: ... +class RTF_WCSINFO: ... +class SHFILEINFO: ... +class SHFILEOPSTRUCT: ... +class SI_ACCESS: ... +class SI_INHERIT_TYPE: ... +class SI_OBJECT_INFO: ... +class STATSTG: ... +class TLIBATTR: ... + +class TYPEATTR: + @property + def iid(self) -> PyIID: ... + @property + def lcid(self): ... + @property + def memidConstructor(self): ... + @property + def memidDestructor(self): ... + @property + def cbSizeInstance(self): ... + @property + def typekind(self): ... + @property + def cFuncs(self): ... + @property + def cVars(self): ... + @property + def cImplTypes(self): ... + @property + def cbSizeVft(self): ... + @property + def cbAlignment(self): ... + @property + def wTypeFlags(self): ... + @property + def wMajorVerNum(self): ... + @property + def wMinorVerNum(self): ... + @property + def tdescAlias(self) -> TYPEDESC: ... + @property + def idldeskType(self) -> IDLDESC: ... + +class TYPEDESC: ... + +class VARDESC: + @property + def memid(self): ... + @property + def value(self): ... + @property + def elemdescVar(self) -> ELEMDESC: ... + @property + def varFlags(self): ... + @property + def varkind(self): ... + +class CHARFORMAT: ... +class CREATESTRUCT: ... +class LV_COLUMN: ... +class LV_ITEM: ... +class PARAFORMAT: ... +class PyAssocCObject: ... + +class PyAssocObject: + def AttachObject(self) -> None: ... + def GetAttachedObject(self): ... + +class PyCBitmap: + def CreateCompatibleBitmap(self, dc: PyCDC, width, height) -> None: ... + def GetSize(self) -> tuple[Incomplete, Incomplete]: ... + def GetHandle(self) -> PyGdiHANDLE: ... + def LoadBitmap(self, idRes, obDLL: PyDLL | None = ...) -> None: ... + def LoadBitmapFile(self, fileObject) -> None: ... + def LoadPPMFile(self, fileObject, cols, rows) -> None: ... + def Paint( + self, + dcObject: PyCDC, + arg: tuple[Incomplete, Incomplete, Incomplete, Incomplete], + arg1: tuple[Incomplete, Incomplete, Incomplete, Incomplete], + ) -> None: ... + def GetInfo(self): ... + def GetBitmapBits(self, asString: int = ...) -> str: ... + def SaveBitmapFile(self, dcObject: PyCDC, Filename: str): ... + +class PyCBrush: + def CreateSolidBrush(self) -> None: ... + def GetSafeHandle(self): ... + +class PyCButton: + def CreateWindow( + self, caption: str, style, rect: tuple[Incomplete, Incomplete, Incomplete, Incomplete], parent: PyCWnd, _id + ) -> None: ... + def GetBitmap(self): ... + def SetBitmap(self, hBitmap: int = ...): ... + def GetCheck(self): ... + def SetCheck(self, idCheck) -> None: ... + def GetState(self): ... + def SetState(self, bHighlight): ... + def GetButtonStyle(self): ... + def SetButtonStyle(self, style, bRedraw: int = ...): ... + +class PyCCmdTarget: + def BeginWaitCursor(self) -> None: ... + def EndWaitCursor(self) -> None: ... + def HookCommand(self, obHandler, _id): ... + def HookCommandUpdate(self, obHandler, _id): ... + def HookOleEvent(self): ... + def HookNotify(self, obHandler, _id): ... + def RestoreWaitCursor(self) -> None: ... + +class PyCCmdUI: + @property + def m_nIndex(self): ... + @property + def m_nID(self): ... + @property + def m_pMenu(self) -> PyCMenu: ... + @property + def m_pSubMenu(self) -> PyCMenu: ... + def Enable(self, bEnable: int = ...) -> None: ... + def SetCheck(self, state: int = ...) -> None: ... + def SetRadio(self, bOn: int = ...) -> None: ... + def SetText(self, text: str) -> None: ... + def ContinueRouting(self) -> None: ... + +class PyCColorDialog: + def GetColor(self): ... + def DoModal(self): ... + def GetSavedCustomColors(self): ... + def SetCurrentColor(self, color) -> None: ... + def SetCustomColors(self) -> None: ... + def GetCustomColors(self) -> tuple[Incomplete, ...]: ... + +class PyCComboBox: + def AddString(self, _object): ... + def DeleteString(self, pos): ... + def Dir(self, attr, wild: str): ... + def GetCount(self): ... + def GetCurSel(self): ... + def GetEditSel(self): ... + def GetExtendedUI(self): ... + def GetItemData(self, item): ... + def GetItemValue(self, item): ... + def GetLBText(self, index) -> str: ... + def GetLBTextLen(self, index): ... + def InsertString(self, pos, _object): ... + def LimitText(self, _max): ... + def ResetContent(self) -> None: ... + def SelectString(self, after, string: str) -> None: ... + def SetCurSel(self, index) -> None: ... + def SetEditSel(self, start, end) -> None: ... + def SetExtendedUI(self, bExtended: int = ...) -> None: ... + def SetItemData(self, item, Data): ... + def SetItemValue(self, item, data): ... + def ShowDropDown(self, bShowIt: int = ...) -> None: ... + +class PyCCommonDialog: ... +class PyCControl: ... + +class PyCControlBar: + @property + def dockSite(self) -> PyCFrameWnd: ... + @property + def dockBar(self) -> PyCWnd: ... + @property + def dockContext(self) -> PyCDockContext: ... + @property + def dwStyle(self): ... + @property + def dwDockStyle(self): ... + def CalcDynamicLayout(self, length, dwMode): ... + def CalcFixedLayout(self, bStretch, bHorz): ... + def EnableDocking(self, style) -> None: ... + def EraseNonClient(self) -> None: ... + def GetBarStyle(self): ... + def GetCount(self): ... + def GetDockingFrame(self) -> PyCFrameWnd: ... + def IsFloating(self) -> bool: ... + def SetBarStyle(self, style) -> None: ... + def ShowWindow(self): ... + +class PyCCtrlView: + def OnCommand(self, wparam, lparam) -> None: ... + +class PyCDC: + def AbortDoc(self) -> None: ... + def Arc( + self, + rect: tuple[Incomplete, Incomplete, Incomplete, Incomplete], + pointStart: tuple[Incomplete, Incomplete], + pointEnd: tuple[Incomplete, Incomplete], + ) -> None: ... + def BeginPath(self) -> None: ... + def BitBlt( + self, + destPos: tuple[Incomplete, Incomplete], + size: tuple[Incomplete, Incomplete], + dc: PyCDC, + srcPos: tuple[Incomplete, Incomplete], + rop, + ) -> None: ... + def Chord( + self, + rect: tuple[Incomplete, Incomplete, Incomplete, Incomplete], + pointStart: tuple[Incomplete, Incomplete], + pointEnd: tuple[Incomplete, Incomplete], + ) -> None: ... + def CreateCompatibleDC(self, dcFrom: PyCDC | None = ...) -> PyCDC: ... + def CreatePrinterDC(self, printerName: str | None = ...) -> None: ... + def DeleteDC(self) -> None: ... + def DPtoLP(self, point: tuple[Incomplete, Incomplete], x, y) -> tuple[Incomplete, Incomplete]: ... + def Draw3dRect(self, rect: tuple[Incomplete, Incomplete, Incomplete, Incomplete], colorTopLeft, colorBotRight) -> None: ... + def DrawFocusRect(self, rect: tuple[Incomplete, Incomplete, Incomplete, Incomplete]) -> None: ... + def DrawFrameControl(self, rect: tuple[Incomplete, Incomplete, Incomplete, Incomplete], typ, state) -> None: ... + def DrawIcon(self, point: tuple[Incomplete, Incomplete], hIcon: int) -> None: ... + def DrawText( + self, s: str, _tuple: tuple[Incomplete, Incomplete, Incomplete, Incomplete], _format + ) -> tuple[Incomplete, Incomplete, Incomplete]: ... + def Ellipse(self, rect: tuple[Incomplete, Incomplete, Incomplete, Incomplete]) -> None: ... + def EndDoc(self) -> None: ... + def EndPage(self) -> None: ... + def EndPath(self) -> None: ... + def ExtTextOut( + self, + _int, + _int1, + _int2, + rect: tuple[Incomplete, Incomplete, Incomplete, Incomplete], + string, + _tuple: tuple[tuple[Incomplete, Incomplete], ...], + ) -> None: ... + def FillPath(self) -> None: ... + def FillRect(self, rect: tuple[Incomplete, Incomplete, Incomplete, Incomplete], brush: PyCBrush) -> None: ... + def FillSolidRect(self, rect: tuple[Incomplete, Incomplete, Incomplete, Incomplete], color) -> None: ... + def FrameRect(self, rect: tuple[Incomplete, Incomplete, Incomplete, Incomplete], brush: PyCBrush) -> None: ... + def GetBrushOrg(self) -> tuple[Incomplete, Incomplete]: ... + def GetClipBox(self) -> tuple[Incomplete, Incomplete, Incomplete, Incomplete]: ... + def GetCurrentPosition(self) -> tuple[Incomplete, Incomplete]: ... + def GetDeviceCaps(self, index): ... + def GetHandleAttrib(self): ... + def GetHandleOutput(self): ... + def GetMapMode(self): ... + def GetNearestColor(self, color): ... + def GetPixel(self, x, y) -> None: ... + def GetSafeHdc(self): ... + def GetTextExtent(self, text: str) -> tuple[Incomplete, Incomplete]: ... + def GetTextExtentPoint(self, text: str) -> tuple[Incomplete, Incomplete]: ... + def GetTextFace(self) -> str: ... + def GetTextMetrics(self): ... + def GetViewportExt(self) -> tuple[Incomplete, Incomplete]: ... + def GetViewportOrg(self) -> tuple[Incomplete, Incomplete]: ... + def GetWindowExt(self) -> tuple[Incomplete, Incomplete]: ... + def GetWindowOrg(self) -> tuple[Incomplete, Incomplete]: ... + def IntersectClipRect(self, rect: tuple[Incomplete, Incomplete, Incomplete, Incomplete]) -> None: ... + def IsPrinting(self) -> bool: ... + def LineTo(self, point: tuple[Incomplete, Incomplete], x, y) -> None: ... + def LPtoDP(self, point: tuple[Incomplete, Incomplete], x, y) -> tuple[Incomplete, Incomplete]: ... + def MoveTo(self, point: tuple[Incomplete, Incomplete], x, y) -> tuple[Incomplete, Incomplete]: ... + def OffsetWindowOrg(self, arg: tuple[Incomplete, Incomplete]) -> tuple[Incomplete, Incomplete]: ... + def OffsetViewportOrg(self, arg: tuple[Incomplete, Incomplete]) -> tuple[Incomplete, Incomplete]: ... + def PatBlt(self, destPos: tuple[Incomplete, Incomplete], size: tuple[Incomplete, Incomplete], rop) -> None: ... + def Pie(self, x1, y1, x2, y2, x3, y3, x4, y4) -> None: ... + def PolyBezier(self) -> None: ... + def Polygon(self) -> None: ... + def Polyline(self, points: list[tuple[Incomplete, Incomplete]]) -> None: ... + def RealizePalette(self): ... + def Rectangle(self): ... + def RectVisible(self, rect: tuple[Incomplete, Incomplete, Incomplete, Incomplete]): ... + def RestoreDC(self, saved) -> None: ... + def SaveDC(self): ... + def ScaleWindowExt(self) -> tuple[Incomplete, Incomplete]: ... + def ScaleViewportExt(self) -> tuple[Incomplete, Incomplete]: ... + def SelectClipRgn(self): ... + def SelectObject(self, ob): ... + def SetBkColor(self, color): ... + def SetBkMode(self, mode): ... + def SetBrushOrg(self, point: tuple[Incomplete, Incomplete]) -> tuple[Incomplete, Incomplete]: ... + def SetGraphicsMode(self, mode): ... + def SetMapMode(self, newMode): ... + def SetPixel(self, x, y, color) -> None: ... + def SetPolyFillMode(self, point: tuple[Incomplete, Incomplete]): ... + def SetROP2(self, mode): ... + def SetTextAlign(self, newFlags): ... + def SetTextColor(self, color): ... + def SetWindowExt(self, size: tuple[Incomplete, Incomplete]) -> tuple[Incomplete, Incomplete]: ... + def SetWindowOrg(self, arg: tuple[Incomplete, Incomplete]) -> tuple[Incomplete, Incomplete]: ... + def SetViewportExt(self, size: tuple[Incomplete, Incomplete]) -> tuple[Incomplete, Incomplete]: ... + def SetViewportOrg(self, arg: tuple[Incomplete, Incomplete]) -> tuple[Incomplete, Incomplete]: ... + def SetWorldTransform(self): ... + def StartDoc(self, docName: str, outputFile: str) -> None: ... + def StartPage(self) -> None: ... + def StretchBlt( + self, + destPos: tuple[Incomplete, Incomplete], + size: tuple[Incomplete, Incomplete], + dc: PyCDC, + srcPos: tuple[Incomplete, Incomplete], + size1: tuple[Incomplete, Incomplete], + rop, + ) -> None: ... + def StrokeAndFillPath(self) -> None: ... + def StrokePath(self) -> None: ... + def TextOut(self, _int, _int1, string) -> None: ... + +class PyCDialog: + def CreateWindow(self, obParent: PyCWnd | None = ...) -> None: ... + def DoModal(self): ... + def EndDialog(self, result) -> None: ... + def GotoDlgCtrl(self, control: PyCWnd) -> None: ... + def MapDialogRect( + self, rect: tuple[Incomplete, Incomplete, Incomplete, Incomplete] + ) -> tuple[Incomplete, Incomplete, Incomplete, Incomplete]: ... + def OnCancel(self) -> None: ... + def OnOK(self) -> None: ... + def OnInitDialog(self): ... + +class PyCDialogBar: + def CreateWindow(self, parent: PyCWnd, template: PyResourceId, style, _id) -> None: ... + +class PyCDocTemplate: + def DoCreateDoc(self, fileName: str | None = ...) -> PyCDocument: ... + def FindOpenDocument(self, fileName: str) -> PyCDocument: ... + def GetDocString(self, docIndex) -> str: ... + def GetDocumentlist(self): ... + def GetResourceID(self) -> None: ... + def GetSharedMenu(self) -> PyCMenu: ... + def InitialUpdateFrame( + self, frame: PyCFrameWnd | None = ..., doc: PyCDocument | None = ..., bMakeVisible: int = ... + ) -> None: ... + def SetContainerInfo(self, _id) -> None: ... + def SetDocStrings(self, docStrings: str) -> None: ... + def OpenDocumentFile(self, filename: str, bMakeVisible: int = ...) -> None: ... + +class PyCDockContext: + @property + def ptLast(self) -> tuple[Incomplete, Incomplete]: ... + @property + def rectLast(self) -> tuple[Incomplete, Incomplete, Incomplete, Incomplete]: ... + @property + def sizeLast(self) -> tuple[Incomplete, Incomplete]: ... + @property + def bDitherLast(self): ... + @property + def rectDragHorz(self) -> tuple[Incomplete, Incomplete, Incomplete, Incomplete]: ... + @property + def rectDragVert(self) -> tuple[Incomplete, Incomplete, Incomplete, Incomplete]: ... + @property + def rectFrameDragHorz(self) -> tuple[Incomplete, Incomplete, Incomplete, Incomplete]: ... + @property + def rectFrameDragVert(self) -> tuple[Incomplete, Incomplete, Incomplete, Incomplete]: ... + @property + def dwDockStyle(self): ... + @property + def dwOverDockStyle(self): ... + @property + def dwStyle(self): ... + @property + def bFlip(self): ... + @property + def bForceFrame(self): ... + @property + def bDragging(self): ... + @property + def nHitTest(self): ... + @property + def uMRUDockID(self): ... + @property + def rectMRUDockPos(self) -> tuple[Incomplete, Incomplete, Incomplete, Incomplete]: ... + @property + def dwMRUFloatStyle(self): ... + @property + def ptMRUFloatPos(self) -> tuple[Incomplete, Incomplete]: ... + def EndDrag(self): ... + def StartDrag(self, pt: tuple[Incomplete, Incomplete]): ... + def EndResize(self): ... + def StartResize(self, hittest, pt: tuple[Incomplete, Incomplete]): ... + def ToggleDocking(self): ... + +class PyCDocument: + def DeleteContents(self) -> None: ... + def DoSave(self, fileName: str, bReplace: int = ...) -> None: ... + def DoFileSave(self) -> None: ... + def GetDocTemplate(self) -> PyCDocTemplate: ... + def GetAllViews(self) -> list[Incomplete]: ... + def GetFirstView(self) -> PyCView: ... + def GetPathName(self) -> str: ... + def GetTitle(self) -> str: ... + def IsModified(self) -> bool: ... + def OnChangedViewlist(self) -> None: ... + def OnCloseDocument(self) -> None: ... + def OnNewDocument(self) -> None: ... + def OnOpenDocument(self, pathName: str) -> None: ... + def OnSaveDocument(self, pathName: str) -> None: ... + def SetModifiedFlag(self, bModified: int = ...) -> None: ... + def SaveModified(self): ... + def SetPathName(self, path: str) -> None: ... + def SetTitle(self, title: str) -> None: ... + def UpdateAllViews(self, sender: PyCView, hint: Incomplete | None = ...) -> None: ... + +class PyCEdit: + def CreateWindow(self, style, rect: tuple[Incomplete, Incomplete, Incomplete, Incomplete], parent: PyCWnd, _id) -> None: ... + def Clear(self): ... + def Copy(self) -> None: ... + def Cut(self) -> None: ... + def FmtLines(self, bAddEOL): ... + def GetFirstVisibleLine(self): ... + def GetSel(self) -> tuple[Incomplete, Incomplete]: ... + def GetLine(self, lineNo): ... + def GetLineCount(self): ... + def LimitText(self, nChars: int = ...) -> None: ... + def LineFromChar(self, charNo: int = ...): ... + def LineIndex(self, lineNo: int = ...): ... + def LineScroll(self, nLines, nChars: int = ...): ... + def Paste(self) -> None: ... + def ReplaceSel(self, text: str) -> None: ... + def SetReadOnly(self, bReadOnly: int = ...) -> None: ... + def SetSel(self, start, end, arg, bNoScroll1, bNoScroll: int = ...) -> None: ... + +class PyCEditView: + def IsModified(self) -> bool: ... + def LoadFile(self, fileName: str) -> None: ... + def SetModifiedFlag(self, bModified: int = ...) -> None: ... + def GetEditCtrl(self): ... + def PreCreateWindow(self, createStruct): ... + def SaveFile(self, fileName: str) -> None: ... + def OnCommand(self, wparam, lparam) -> None: ... + +class PyCFileDialog: + def GetPathName(self) -> str: ... + def GetFileName(self) -> str: ... + def GetFileExt(self) -> str: ... + def GetFileTitle(self) -> str: ... + def GetPathNames(self) -> str: ... + def GetReadOnlyPref(self): ... + def SetOFNTitle(self, title: str) -> None: ... + def SetOFNInitialDir(self, title: str) -> None: ... + +class PyCFont: + def GetSafeHandle(self): ... + +class PyCFontDialog: + def DoModal(self): ... + def GetCurrentFont(self): ... + def GetCharFormat(self): ... + def GetColor(self): ... + def GetFaceName(self) -> str: ... + def GetStyleName(self) -> str: ... + def GetSize(self): ... + def GetWeight(self): ... + def IsStrikeOut(self) -> bool: ... + def IsUnderline(self) -> bool: ... + def IsBold(self) -> bool: ... + def IsItalic(self) -> bool: ... + +class PyCFormView: + def OnCommand(self, wparam, lparam) -> None: ... + +class PyCFrameWnd: + def BeginModalState(self) -> None: ... + def CreateWindow( + self, + wndClass: str, + title: str, + style, + PyCWnd, + menuId, + styleEx, + rect: tuple[Incomplete, Incomplete, Incomplete, Incomplete] | None = ..., + createContext: Incomplete | None = ..., + ): ... + def EndModalState(self) -> None: ... + def DockControlBar( + self, controlBar: PyCControlBar, arg: tuple[Incomplete, Incomplete, Incomplete, Incomplete], dockBarId: int = ... + ) -> None: ... + def EnableDocking(self, style) -> None: ... + def FloatControlBar(self, controlBar: PyCControlBar, arg: tuple[Incomplete, Incomplete], style) -> None: ... + def GetActiveDocument(self) -> PyCDocument: ... + def GetControlBar(self, _id) -> PyCControlBar: ... + def GetMessageString(self, _id) -> str: ... + def GetMessageBar(self) -> PyCWnd: ... + def IsTracking(self) -> bool: ... + def InModalState(self): ... + def LoadAccelTable(self, _id: PyResourceId) -> None: ... + def LoadFrame( + self, idResource, style: int = ..., wndParent: PyCWnd | None = ..., context: Incomplete | None = ... + ) -> None: ... + def LoadBarState(self, profileName: str) -> None: ... + def PreCreateWindow(self, createStruct): ... + def SaveBarState(self, profileName: str) -> None: ... + def ShowControlBar(self, controlBar: PyCControlBar, bShow, bDelay) -> None: ... + def RecalcLayout(self, bNotify: int = ...) -> None: ... + def GetActiveView(self) -> PyCView: ... + def OnBarCheck(self, _id): ... + def OnUpdateControlBarMenu(self, cmdUI: PyCCmdUI): ... + def SetActiveView(self, view: PyCView, bNotify: int = ...) -> None: ... + +class PyCGdiObject: ... + +class PyCImagelist: + def Add(self, arg: tuple[Incomplete, Incomplete], bitmap, color, hIcon): ... + def Destroy(self) -> None: ... + def DeleteImagelist(self) -> None: ... + def GetBkColor(self): ... + def GetSafeHandle(self): ... + def GetImageCount(self): ... + def GetImageInfo(self, index): ... + def SetBkColor(self, color) -> None: ... + +class PyClistBox: + def AddString(self, _object): ... + def DeleteString(self, pos): ... + def Dir(self, attr, wild: str): ... + def GetCaretIndex(self): ... + def GetCount(self): ... + def GetCurSel(self): ... + def GetItemData(self, item): ... + def GetItemValue(self, item): ... + def GetSel(self, index): ... + def GetSelCount(self): ... + def GetSelItems(self): ... + def GetSelTextItems(self): ... + def GetTopIndex(self): ... + def GetText(self, index) -> str: ... + def GetTextLen(self, index): ... + def InsertString(self, pos, _object): ... + def ResetContent(self) -> None: ... + def SetCaretIndex(self, index, bScroll: int = ...) -> None: ... + def SelectString(self, after, string: str) -> None: ... + def SelItemRange(self, bSel, start, end) -> None: ... + def SetCurSel(self, index) -> None: ... + def SetItemData(self, item, Data): ... + def SetItemValue(self, item, data): ... + def SetSel(self, index, bSel: int = ...) -> None: ... + def SetTabStops(self, eachTabStop, tabStops) -> None: ... + def SetTopIndex(self, index) -> None: ... + +class PyClistCtrl: + def Arrange(self, code) -> None: ... + def CreateWindow(self, style, rect: tuple[Incomplete, Incomplete, Incomplete, Incomplete], PyCWnd, _id) -> None: ... + def DeleteAllItems(self) -> None: ... + def DeleteItem(self, item) -> None: ... + def GetTextColor(self): ... + def SetTextColor(self, color) -> None: ... + def GetBkColor(self): ... + def SetBkColor(self, color) -> None: ... + def GetItem(self, item, sub) -> LV_ITEM: ... + def GetItemCount(self): ... + def GetItemRect(self, item, bTextOnly) -> tuple[Incomplete, Incomplete, Incomplete, Incomplete]: ... + def GetEditControl(self) -> PyCEdit: ... + def EditLabel(self, item) -> PyCEdit: ... + def EnsureVisible(self, item, bPartialOK): ... + def CreateDragImage(self, item) -> tuple[PyCImagelist, Incomplete, Incomplete]: ... + def GetImagelist(self, nImagelist) -> PyCImagelist: ... + def GetNextItem(self, item, flags): ... + def InsertColumn(self, colNo, item: LV_COLUMN): ... + def InsertItem(self, item: LV_ITEM, item1, text, image, item2, text1): ... + def SetImagelist(self, imagelist: PyCImagelist, imageType): ... + def GetColumn(self, column) -> LV_COLUMN: ... + def GetTextBkColor(self): ... + def SetTextBkColor(self, color) -> None: ... + def GetTopIndex(self): ... + def GetCountPerPage(self): ... + def GetSelectedCount(self): ... + def SetItem(self, item: LV_ITEM): ... + def SetItemState(self, item, state, mask): ... + def GetItemState(self, item, mask): ... + def SetItemData(self, item, Data): ... + def GetItemData(self, item): ... + def SetItemCount(self, count) -> None: ... + def SetItemText(self, item, sub, text: str): ... + def GetItemText(self, item, sub): ... + def RedrawItems(self, first, first1): ... + def Update(self, item) -> None: ... + def SetColumn(self, colNo, item: LV_COLUMN): ... + def DeleteColumn(self, first): ... + def GetColumnWidth(self, first): ... + def SetColumnWidth(self, first, first1): ... + def GetStringWidth(self, first): ... + def HitTest(self, arg) -> tuple[Incomplete, Incomplete, Incomplete]: ... + def GetItemPosition(self, item) -> tuple[Incomplete, Incomplete]: ... + +class PyClistView: + def PreCreateWindow(self, createStruct): ... + def GetlistCtrl(self) -> PyClistCtrl: ... + def OnCommand(self, wparam, lparam) -> None: ... + +class PyCMDIChildWnd: + def ActivateFrame(self, cmdShow: int = ...) -> None: ... + def CreateWindow( + self, + wndClass: str, + title: str, + style, + PyCWnd, + rect: tuple[Incomplete, Incomplete, Incomplete, Incomplete] | None = ..., + createContext: Incomplete | None = ..., + ): ... + def GetMDIFrame(self) -> None: ... + def MDIActivate(self, cmdShow: int = ...) -> None: ... + def PreCreateWindow(self, createStruct): ... + def PreTranslateMessage(self) -> None: ... + def OnCommand(self, wparam, lparam) -> None: ... + def OnClose(self) -> None: ... + +class PyCMDIFrameWnd: + def GetMDIClient(self) -> PyCMDIFrameWnd: ... + def MDIGetActive(self) -> tuple[PyCMDIChildWnd, Incomplete]: ... + def MDIActivate(self, window: PyCWnd) -> PyCMDIFrameWnd: ... + def MDINext(self, fNext: int = ...) -> None: ... + def PreCreateWindow(self, createStruct): ... + def PreTranslateMessage(self) -> None: ... + def OnCommand(self, wparam, lparam) -> None: ... + def OnContextHelp(self): ... + def OnClose(self) -> None: ... + +class PyCMenu: + def AppendMenu(self, flags, _id: int = ..., value: str | None = ...) -> None: ... + def DeleteMenu(self, _id, flags) -> str: ... + def EnableMenuItem(self, _id, flags): ... + def GetMenuItemCount(self): ... + def GetMenuItemID(self, pos): ... + def GetMenuString(self, _id, arg) -> str: ... + def GetSubMenu(self, pos) -> PyCMenu: ... + def InsertMenu(self, pos, flags, _id: PyCMenu | int = ..., value: str | None = ...) -> None: ... + def ModifyMenu(self, pos, flags, _id: int = ..., value: str | None = ...) -> None: ... + def TrackPopupMenu(self, arg: tuple[Incomplete, Incomplete], arg1, arg2: PyCWnd) -> None: ... + +class PyCOleClientItem: + def CreateNewItem(self) -> None: ... + def Close(self) -> None: ... + def DoVerb(self) -> None: ... + def Draw(self) -> None: ... + def GetActiveView(self) -> PyCView: ... + def GetDocument(self) -> PyCDocument: ... + def GetInPlaceWindow(self) -> PyCWnd: ... + def GetItemState(self) -> None: ... + def GetObject(self) -> PyIUnknown: ... + def GetStorage(self) -> None: ... + def OnActivate(self) -> None: ... + def OnChange(self) -> None: ... + def OnChangeItemPosition(self): ... + def OnDeactivateUI(self): ... + def Run(self) -> None: ... + def SetItemRects(self) -> None: ... + +class PyCOleDialog: ... + +class PyCOleDocument: + def EnableCompoundFile(self, bEnable: int = ...) -> None: ... + def GetStartPosition(self): ... + def GetNextItem(self, pos) -> tuple[Incomplete, PyCOleClientItem]: ... + def GetInPlaceActiveItem(self, wnd: PyCWnd) -> PyCOleClientItem: ... + +class PyCOleInsertDialog: + def GetClassID(self): ... + def GetSelectionType(self): ... + def GetPathName(self): ... + +class PyCPrintDialog: ... + +class PyCPrintInfo: + def DocObject(self) -> None: ... + def GetDwFlags(self) -> None: ... + def SetDwFlags(self) -> None: ... + def GetDocOffsetPage(self) -> None: ... + def SetDocOffsetPage(self) -> None: ... + def SetPrintDialog(self) -> None: ... + def GetDirect(self) -> None: ... + def SetDirect(self) -> None: ... + def GetPreview(self) -> None: ... + def SetPreview(self) -> None: ... + def GetContinuePrinting(self) -> None: ... + def SetContinuePrinting(self) -> None: ... + def GetCurPage(self) -> None: ... + def SetCurPage(self) -> None: ... + def GetNumPreviewPages(self) -> None: ... + def SetNumPreviewPages(self) -> None: ... + def GetUserData(self) -> None: ... + def SetUserData(self) -> None: ... + def GetDraw(self) -> None: ... + def SetDraw(self) -> None: ... + def GetPageDesc(self) -> None: ... + def SetPageDesc(self) -> None: ... + def GetMinPage(self) -> None: ... + def SetMinPage(self) -> None: ... + def GetMaxPage(self) -> None: ... + def SetMaxPage(self) -> None: ... + def GetOffsetPage(self) -> None: ... + def GetFromPage(self) -> None: ... + def GetToPage(self) -> None: ... + def SetHDC(self, hdc) -> None: ... + def CreatePrinterDC(self) -> None: ... + def DoModal(self) -> None: ... + def GetCopies(self) -> None: ... + def GetDefaults(self) -> None: ... + def FreeDefaults(self) -> None: ... + def GetDeviceName(self) -> None: ... + def GetDriverName(self) -> None: ... + def GetDlgFromPage(self) -> None: ... + def GetDlgToPage(self) -> None: ... + def GetPortName(self) -> None: ... + def GetPrinterDC(self) -> None: ... + def PrintAll(self) -> None: ... + def PrintCollate(self) -> None: ... + def PrintRange(self) -> None: ... + def PrintSelection(self) -> None: ... + def GetHDC(self) -> None: ... + def GetFlags(self) -> None: ... + def SetFlags(self) -> None: ... + def SetFromPage(self) -> None: ... + def SetToPage(self) -> None: ... + def GetPRINTDLGMinPage(self) -> None: ... + def SetPRINTDLGMinPage(self) -> None: ... + def GetPRINTDLGCopies(self) -> None: ... + def SetPRINTDLGCopies(self) -> None: ... + +class PyCProgressCtrl: + def CreateWindow(self, style, rect: tuple[Incomplete, Incomplete, Incomplete, Incomplete], parent: PyCWnd, _id) -> None: ... + def SetRange(self, nLower: int = ..., nUpper: int = ...) -> None: ... + def SetPos(self, nPos: int = ...): ... + def OffsetPos(self, nPos: int = ...): ... + def SetStep(self, nStep: int = ...): ... + def StepIt(self): ... + +class PyCPropertyPage: + def CancelToClose(self) -> None: ... + def OnCancel(self) -> None: ... + def OnOK(self) -> None: ... + def OnApply(self) -> None: ... + def OnReset(self) -> None: ... + def OnQueryCancel(self) -> None: ... + def OnWizardBack(self) -> None: ... + def OnWizardNext(self) -> None: ... + def OnWizardFinish(self) -> None: ... + def OnSetActive(self): ... + def OnKillActive(self): ... + def SetModified(self, bChanged: int = ...) -> None: ... + def SetPSPBit(self, bitMask, bitValue) -> None: ... + +class PyCPropertySheet: + def AddPage(self, page: PyCPropertyPage) -> None: ... + def CreateWindow(self, style, exStyle, parent: PyCWnd | None = ...) -> None: ... + def DoModal(self): ... + def EnableStackedTabs(self, stacked) -> PyCPropertyPage: ... + def EndDialog(self, result) -> None: ... + def GetActiveIndex(self): ... + def GetActivePage(self) -> PyCPropertyPage: ... + def GetPage(self, pageNo) -> PyCPropertyPage: ... + def GetPageIndex(self, page: PyCPropertyPage): ... + def GetPageCount(self): ... + def GetTabCtrl(self) -> PyCTabCtrl: ... + def OnInitDialog(self): ... + def PressButton(self, button) -> None: ... + def RemovePage(self, offset, page) -> None: ... + def SetActivePage(self, page: PyCPropertyPage) -> None: ... + def SetTitle(self, title: str) -> None: ... + def SetFinishText(self, text: str) -> None: ... + def SetWizardMode(self) -> None: ... + def SetWizardButtons(self, flags) -> None: ... + def SetPSHBit(self, bitMask, bitValue) -> None: ... + +class PyCRect: ... +class PyCRgn: ... + +class PyCRichEditCtrl: + def Clear(self): ... + def Copy(self) -> None: ... + def CreateWindow(self, style, rect: tuple[Incomplete, Incomplete, Incomplete, Incomplete], parent: PyCWnd, _id) -> None: ... + def Cut(self) -> None: ... + def FindText(self, charPos) -> tuple[Incomplete, Incomplete, Incomplete]: ... + def GetCharPos(self, charPos): ... + def GetDefaultCharFormat(self): ... + def GetEventMask(self): ... + def GetSelectionCharFormat(self): ... + def GetFirstVisibleLine(self): ... + def GetParaFormat(self): ... + def GetSel(self) -> tuple[Incomplete, Incomplete]: ... + def GetSelText(self) -> str: ... + def GetTextLength(self): ... + def GetLine(self, lineNo): ... + def GetModify(self): ... + def GetLineCount(self): ... + def LimitText(self, nChars: int = ...) -> None: ... + def LineFromChar(self, charNo: int = ...): ... + def LineIndex(self, lineNo: int = ...): ... + def LineScroll(self, nLines, nChars: int = ...): ... + def Paste(self) -> None: ... + def ReplaceSel(self, text: str) -> None: ... + def SetBackgroundColor(self, bSysColor, cr: int = ...): ... + def SetDefaultCharFormat(self, charFormat) -> None: ... + def SetEventMask(self, eventMask): ... + def SetSelectionCharFormat(self, charFormat) -> None: ... + def SetModify(self, modified: int = ...) -> None: ... + def SetOptions(self, op, flags) -> None: ... + def SetParaFormat(self, paraFormat): ... + def SetReadOnly(self, bReadOnly: int = ...) -> None: ... + def SetSel(self, start, end, arg) -> None: ... + def SetSelAndCharFormat(self, charFormat) -> None: ... + def SetTargetDevice(self, dc: PyCDC, lineWidth) -> None: ... + def StreamIn(self, _format, method) -> tuple[Incomplete, Incomplete]: ... + def StreamOut(self, _format, method) -> tuple[Incomplete, Incomplete]: ... + +class PyCRichEditDoc: + def OnCloseDocument(self) -> None: ... + +class PyCRichEditDocTemplate: + def DoCreateRichEditDoc(self, fileName: str | None = ...) -> PyCRichEditDoc: ... + +class PyCRichEditView: + def GetRichEditCtrl(self) -> PyCRichEditCtrl: ... + def SetWordWrap(self, wordWrap): ... + def WrapChanged(self): ... + def SaveTextFile(self, FileName): ... + +class PyCScrollView: + def GetDeviceScrollPosition(self) -> tuple[Incomplete, Incomplete]: ... + def GetDC(self) -> PyCDC: ... + def GetScrollPosition(self) -> tuple[Incomplete, Incomplete]: ... + def GetTotalSize(self) -> tuple[Incomplete, Incomplete]: ... + def OnCommand(self, wparam, lparam) -> None: ... + def ResizeParentToFit(self, bShrinkOnly: int = ...): ... + def SetScaleToFitSize(self, size: tuple[Incomplete, Incomplete]) -> None: ... + def ScrollToPosition(self, position: tuple[Incomplete, Incomplete]) -> None: ... + def SetScrollSizes( + self, + mapMode, + sizeTotal: tuple[Incomplete, Incomplete], + arg: tuple[Incomplete, Incomplete], + arg1: tuple[Incomplete, Incomplete], + ) -> None: ... + def UpdateBars(self) -> None: ... + +class PyCSliderCtrl: + def CreateWindow(self, style, rect: tuple[Incomplete, Incomplete, Incomplete, Incomplete], parent: PyCWnd, _id) -> None: ... + def GetLineSize(self): ... + def SetLineSize(self, nLineSize: int = ...): ... + def GetPageSize(self): ... + def SetPageSize(self, nPageSize: int = ...): ... + def GetRangeMax(self): ... + def GetRangeMin(self): ... + def GetRange(self): ... + def SetRange(self, nRangeMin: int = ..., nRangeMax: int = ..., bRedraw: int = ...): ... + def GetSelection(self): ... + def SetSelection(self, nRangeMin: int = ..., nRangeMax: int = ...): ... + def GetChannelRect(self): ... + def GetThumbRect(self): ... + def GetPos(self): ... + def SetPos(self, nPos: int = ...): ... + def GetNumTics(self): ... + def GetTicArray(self): ... + def GetTic(self, nTic: int = ...): ... + def GetTicPos(self, nTic: int = ...): ... + def SetTic(self, nTic: int = ...): ... + def SetTicFreq(self, nFreq: int = ...): ... + def ClearSel(self, bRedraw: int = ...): ... + def VerifyPos(self): ... + def ClearTics(self, bRedraw: int = ...): ... + +class PyCSpinButtonCtrl: + def GetPos(self): ... + def SetPos(self, pos): ... + def SetRange(self): ... + def SetRange32(self): ... + +class PyCSplitterWnd: + def GetPane(self, row, col) -> PyCWnd: ... + def CreateView(self, view: PyCView, row, col, arg: tuple[Incomplete, Incomplete]) -> None: ... + def CreateStatic(self, parent, rows, cols, style, _id) -> None: ... + def SetColumnInfo(self, column, ideal, _min) -> None: ... + def SetRowInfo(self, row, ideal, _min) -> None: ... + def IdFromRowCol(self, row, col) -> None: ... + def DoKeyboardSplit(self): ... + +class PyCStatusBar: + def GetPaneInfo(self, index) -> tuple[Incomplete, Incomplete, Incomplete]: ... + def GetStatusBarCtrl(self) -> PyCStatusBarCtrl: ... + def SetIndicators(self, indicators) -> None: ... + def SetPaneInfo(self, index, _id, style, width) -> None: ... + +class PyCStatusBarCtrl: + def CreateWindow(self, style, rect: tuple[Incomplete, Incomplete, Incomplete, Incomplete], parent: PyCWnd, _id) -> None: ... + def GetBorders(self) -> tuple[Incomplete, Incomplete, Incomplete]: ... + def GetParts(self, nParts): ... + def GetRect(self, nPane) -> tuple[Incomplete, Incomplete, Incomplete, Incomplete]: ... + def GetText(self, nPane): ... + def GetTextAttr(self, nPane): ... + def GetTextLength(self, nPane): ... + def SetMinHeight(self, nHeight) -> None: ... + def SetParts(self, coord) -> None: ... + def SetText(self, text: str, nPane, nType) -> None: ... + def SetTipText(self, nPane, text: str) -> None: ... + +class PyCTabCtrl: + def GetCurSel(self): ... + def GetItemCountl(self): ... + def SetCurSel(self, index): ... + +class PyCToolBar: + def GetButtonStyle(self, index) -> None: ... + def GetButtonText(self, index) -> str: ... + def GetItemID(self, index) -> None: ... + def SetButtonInfo(self, index, ID, style, imageIx) -> None: ... + def GetToolBarCtrl(self) -> PyCToolBarCtrl: ... + def LoadBitmap(self, _id: PyResourceId) -> None: ... + def LoadToolBar(self, _id: PyResourceId) -> None: ... + def SetBarStyle(self, style) -> None: ... + def SetBitmap(self, hBitmap) -> None: ... + def SetButtons(self, buttons, numButtons) -> None: ... + def SetButtonStyle(self, index, style) -> None: ... + def SetHeight(self, height) -> None: ... + def SetSizes(self, sizeButton: tuple[Incomplete, Incomplete], sizeButton1: tuple[Incomplete, Incomplete]) -> None: ... + +class PyCToolBarCtrl: + def AddBitmap(self, numButtons, bitmap): ... + def AddButtons(self): ... + def AddStrings(self, strings): ... + def AutoSize(self) -> None: ... + def CheckButton(self, nID, bCheck: int = ...): ... + def CommandToIndex(self, nID): ... + def CreateWindow(self, style, rect: tuple[Incomplete, Incomplete, Incomplete, Incomplete], parent: PyCWnd, _id) -> None: ... + def Customize(self) -> None: ... + def DeleteButton(self, nID) -> None: ... + def EnableButton(self, nID, bEnable: int = ...) -> None: ... + def GetBitmapFlags(self): ... + def GetButton(self, nID): ... + def GetButtonCount(self): ... + def GetItemRect(self, nID) -> tuple[Incomplete, Incomplete, Incomplete, Incomplete]: ... + def GetRows(self) -> tuple[Incomplete, Incomplete, Incomplete, Incomplete]: ... + def HideButton(self, nID, bEnable: int = ...) -> None: ... + def Indeterminate(self, nID, bEnable: int = ...) -> None: ... + def InsertButton(self, nID, button: PyCToolBarCtrl): ... + def IsButtonChecked(self, nID) -> bool: ... + def IsButtonEnabled(self, nID) -> bool: ... + def IsButtonHidden(self, nID) -> bool: ... + def IsButtonIndeterminate(self, nID) -> bool: ... + def IsButtonPressed(self, nID) -> bool: ... + def PressButton(self, nID, bEnable: int = ...) -> None: ... + def SetBitmapSize(self, width1, height1, width: int = ..., height: int = ...) -> None: ... + def SetButtonSize(self, width1, height1, width: int = ..., height: int = ...) -> None: ... + def SetCmdID(self, nIndex, nID) -> None: ... + def SetRows(self, nRows, bLarger) -> tuple[Incomplete, Incomplete, Incomplete, Incomplete]: ... + +class PyCToolTipCtrl: + def CreateWindow(self, parent: PyCWnd, style) -> None: ... + def UpdateTipText(self, text: str, wnd: PyCWnd, _id) -> None: ... + def AddTool( + self, wnd: PyCWnd, text: str, _id, rect: tuple[Incomplete, Incomplete, Incomplete, Incomplete] | None = ... + ) -> None: ... + def SetMaxTipWidth(self, width): ... + +class PyCTreeCtrl: + def CreateWindow(self, style, rect: tuple[Incomplete, Incomplete, Incomplete, Incomplete], PyCWnd, _id) -> None: ... + def GetCount(self): ... + def GetIndent(self): ... + def SetIndent(self, indent) -> None: ... + def GetImagelist(self, nImagelist) -> PyCImagelist: ... + def SetImagelist(self, imagelist: PyCImagelist, imageType): ... + def GetNextItem(self, item, code): ... + def ItemHasChildren(self, item): ... + def GetChildItem(self, item): ... + def GetNextSiblingItem(self, item): ... + def GetPrevSiblingItem(self, item): ... + def GetParentItem(self, item): ... + def GetFirstVisibleItem(self): ... + def GetNextVisibleItem(self, item): ... + def GetSelectedItem(self): ... + def GetDropHilightItem(self): ... + def GetRootItem(self): ... + def GetToolTips(self): ... + def GetItem(self, item, arg) -> TV_ITEM: ... + def SetItem(self, item: TV_ITEM): ... + def GetItemState(self, item, stateMask) -> tuple[Incomplete, Incomplete]: ... + def SetItemState(self, item, state, stateMask) -> None: ... + def GetItemImage(self, item) -> tuple[Incomplete, Incomplete]: ... + def SetItemImage(self, item, iImage, iSelectedImage) -> None: ... + def SetItemText(self, item, text: str): ... + def GetItemText(self, item): ... + def GetItemData(self, item): ... + def SetItemData(self, item, Data): ... + def GetItemRect(self, item, bTextOnly) -> tuple[Incomplete, Incomplete, Incomplete, Incomplete]: ... + def GetEditControl(self) -> PyCEdit: ... + def GetVisibleCount(self): ... + def InsertItem( + self, + hParent, + hInsertAfter, + item: TV_ITEM, + mask, + text, + image, + selectedImage, + state, + stateMask, + lParam, + parent, + parent1, + text1, + image1, + selectedImage1, + parent2, + insertAfter, + text2, + parent3, + parent4, + ): ... + def DeleteItem(self, item) -> None: ... + def DeleteAllItems(self): ... + def Expand(self, item, code) -> None: ... + def Select(self, item, code) -> None: ... + def SelectItem(self, item) -> None: ... + def SelectDropTarget(self, item) -> None: ... + def SelectSetFirstVisible(self, item) -> None: ... + def EditLabel(self, item) -> PyCEdit: ... + def CreateDragImage(self, item) -> PyCImagelist: ... + def SortChildren(self, item) -> None: ... + def EnsureVisible(self, item): ... + def HitTest(self, arg) -> tuple[Incomplete, Incomplete]: ... + +class PyCTreeView: + def PreCreateWindow(self, createStruct): ... + def GetTreeCtrl(self) -> PyCTreeCtrl: ... + def OnCommand(self, wparam, lparam) -> None: ... + +class PyCView: + def CreateWindow(self, parent: PyCWnd, arg, arg1, arg2: tuple[Incomplete, Incomplete, Incomplete, Incomplete]) -> None: ... + def GetDocument(self) -> PyCDocument: ... + def OnActivateView(self, activate, activateView: PyCView, DeactivateView: PyCView): ... + def OnInitialUpdate(self) -> None: ... + def OnMouseActivate(self, wnd: PyCWnd, hittest, message): ... + def PreCreateWindow(self, createStruct): ... + def OnFilePrint(self) -> None: ... + def DoPreparePrinting(self): ... + def OnBeginPrinting(self) -> None: ... + def OnEndPrinting(self) -> None: ... + +class PyCWinApp: + def AddDocTemplate(self, template: PyCDocTemplate) -> None: ... + def FindOpenDocument(self, fileName: str) -> PyCDocument: ... + def GetDocTemplatelist(self) -> list[Incomplete]: ... + def InitDlgInstance(self, dialog: PyCDialog) -> None: ... + def LoadCursor(self, cursorId: PyResourceId): ... + def LoadStandardCursor(self, cursorId: PyResourceId): ... + def LoadOEMCursor(self, cursorId): ... + def LoadIcon(self, idResource: int) -> int: ... + def LoadStandardIcon(self, resourceName: PyResourceId): ... + def OpenDocumentFile(self, fileName: str) -> None: ... + def OnFileNew(self) -> None: ... + def OnFileOpen(self) -> None: ... + def RemoveDocTemplate(self, template: PyCDocTemplate) -> None: ... + def Run(self): ... + def IsInproc(self) -> bool: ... + +class PyCWinThread: + def CreateThread(self) -> None: ... + def PumpIdle(self) -> None: ... + def PumpMessages(self) -> None: ... + def Run(self): ... + def SetMainFrame(self, mainFrame: PyCWnd) -> None: ... + def SetThreadPriority(self, priority: PyCWnd) -> None: ... + +class PyCWnd: + def ActivateFrame(self, cmdShow) -> None: ... + def BringWindowToTop(self) -> None: ... + def BeginPaint(self) -> tuple[PyCDC, Incomplete]: ... + def CalcWindowRect( + self, rect: tuple[Incomplete, Incomplete, Incomplete, Incomplete], nAdjustType + ) -> tuple[Incomplete, Incomplete, Incomplete, Incomplete]: ... + def CenterWindow(self, altwin: PyCWnd | None = ...) -> None: ... + def CheckRadioButton(self, idFirst, idLast, idCheck) -> None: ... + def ChildWindowFromPoint(self, x, y, flag: int = ...) -> PyCWnd: ... + def ClientToScreen( + self, point: tuple[Incomplete, Incomplete], rect + ) -> tuple[Incomplete, Incomplete, Incomplete, Incomplete, Incomplete]: ... + def CreateWindow( + self, + classId: str, + windowName: str, + style, + rect: tuple[Incomplete, Incomplete, Incomplete, Incomplete], + parent: PyCWnd, + _id, + context: Incomplete | None = ..., + ) -> None: ... + def CreateWindowEx( + self, + styleEx, + classId: str, + windowName: str, + style, + rect: tuple[Incomplete, Incomplete, Incomplete, Incomplete], + parent: PyCWnd, + _id, + createStruct1, + createStruct: CREATESTRUCT | None = ..., + ) -> None: ... + def DefWindowProc(self, message, idLast, idCheck): ... + def DestroyWindow(self) -> None: ... + def DlgDirlist(self, defPath: str, idlistbox, idStaticPath, fileType) -> None: ... + def DlgDirlistComboBox(self) -> None: ... + def DlgDirSelect(self, idlistbox) -> str: ... + def DlgDirSelectComboBox(self, idlistbox) -> str: ... + def DragAcceptFiles(self, bAccept: int = ...) -> None: ... + def DrawMenuBar(self) -> None: ... + def EnableWindow(self, bEnable: int = ...): ... + def EndModalLoop(self, result) -> None: ... + def EndPaint(self, paintStruct) -> None: ... + def GetCheckedRadioButton(self, idFirst, idLast): ... + def GetClientRect(self) -> tuple[Incomplete, Incomplete, Incomplete, Incomplete]: ... + def GetDC(self) -> PyCDC: ... + def GetDCEx(self) -> PyCDC: ... + def GetDlgCtrlID(self): ... + def GetDlgItem(self, idControl) -> PyCWnd: ... + def GetDlgItemInt(self, idControl, bUnsigned: int = ...): ... + def GetDlgItemText(self, idControl) -> str: ... + def GetLastActivePopup(self) -> PyCWnd: ... + def GetMenu(self) -> PyCMenu: ... + def GetParent(self) -> PyCWnd: ... + def GetParentFrame(self) -> PyCWnd: ... + def GetSafeHwnd(self): ... + def GetScrollInfo(self, nBar, mask): ... + def GetScrollPos(self, nBar): ... + def GetStyle(self): ... + def GetExStyle(self): ... + def GetSystemMenu(self) -> PyCMenu: ... + def GetTopLevelFrame(self) -> PyCWnd: ... + def GetTopLevelOwner(self) -> PyCWnd: ... + def GetTopLevelParent(self) -> PyCWnd: ... + def GetTopWindow(self) -> PyCWnd: ... + def GetWindow(self, _type) -> PyCWnd: ... + def GetWindowDC(self) -> PyCDC: ... + def GetWindowPlacement(self): ... + def GetWindowRect(self) -> tuple[Incomplete, Incomplete, Incomplete, Incomplete]: ... + def GetWindowText(self) -> str: ... + def HideCaret(self) -> None: ... + def HookAllKeyStrokes(self, obHandler) -> None: ... + def HookKeyStroke(self, obHandler, ch): ... + def HookMessage(self, obHandler, message): ... + def InvalidateRect(self, arg: tuple[Incomplete, Incomplete, Incomplete, Incomplete], bErase: int = ...) -> None: ... + def InvalidateRgn(self, region: PyCRgn, bErase: int = ...) -> None: ... + def IsChild(self, obWnd: PyCWnd) -> bool: ... + def IsDlgButtonChecked(self, idCtl) -> bool: ... + def IsIconic(self) -> bool: ... + def IsZoomed(self) -> bool: ... + def IsWindow(self) -> bool: ... + def IsWindowVisible(self) -> bool: ... + def KillTimer(self): ... + def LockWindowUpdate(self) -> None: ... + def MapWindowPoints(self, wnd: PyCWnd, points: list[tuple[Incomplete, Incomplete]]) -> None: ... + def MouseCaptured(self): ... + def MessageBox(self, message: str, arg, title: str | None = ...) -> None: ... + def ModifyStyle(self, remove, add, flags: int = ...): ... + def ModifyStyleEx(self, remove, add, flags: int = ...): ... + def MoveWindow(self, rect: tuple[Incomplete, Incomplete, Incomplete, Incomplete], bRepaint: int = ...) -> None: ... + def OnClose(self): ... + def OnCtlColor(self, dc: PyCDC, control, _type): ... + def OnEraseBkgnd(self, dc: PyCDC): ... + def OnNcHitTest(self, arg: tuple[Incomplete, Incomplete]): ... + def OnPaint(self): ... + def OnQueryDragIcon(self): ... + def OnQueryNewPalette(self): ... + def OnSetCursor(self, wnd: PyCWnd, hittest, message): ... + def OnMouseActivate(self, wnd: PyCWnd, hittest, message): ... + def OnWndMsg(self, msg, wParam, lParam) -> tuple[Incomplete, Incomplete]: ... + def PreCreateWindow(self, createStruct): ... + def PumpWaitingMessages(self, firstMsg, lastMsg) -> None: ... + def RedrawWindow( + self, _object: PyCRgn, flags, rect: tuple[Incomplete, Incomplete, Incomplete, Incomplete] | None = ... + ) -> None: ... + def ReleaseCapture(self) -> None: ... + def ReleaseDC(self, dc: PyCDC) -> None: ... + def RepositionBars(self, idFirst, idLast, idLeftOver) -> None: ... + def RunModalLoop(self, flags): ... + def PostMessage(self, idMessage, wParam: int = ..., lParam: int = ...) -> None: ... + def SendMessageToDescendants(self, idMessage, wParam: int = ..., lParam: int = ..., bDeep: int = ...) -> None: ... + def SendMessage(self, idMessage, idMessage1, ob, wParam: int = ..., lParam: int = ...) -> None: ... + def SetActiveWindow(self) -> PyCWnd: ... + def SetForegroundWindow(self) -> None: ... + def SetWindowPos(self, hWndInsertAfter, position: tuple[Incomplete, Incomplete, Incomplete, Incomplete], flags) -> None: ... + def ScreenToClient( + self, rect: tuple[Incomplete, Incomplete, Incomplete, Incomplete, Incomplete], pnt + ) -> tuple[Incomplete, Incomplete, Incomplete, Incomplete, Incomplete]: ... + def SetCapture(self) -> None: ... + def SetDlgItemText(self, idControl, text: str) -> None: ... + def SetFocus(self) -> None: ... + def SetFont(self, font: PyCFont, bRedraw: int = ...) -> None: ... + def SetIcon(self): ... + def SetMenu(self, menuObj: PyCMenu) -> None: ... + def SetRedraw(self, bState: int = ...) -> None: ... + def SetScrollPos(self, nBar, nPos, redraw: int = ...): ... + def SetScrollInfo(self, nBar, ScrollInfo, redraw: int = ...): ... + def SetTimer(self, idEvent, elapse): ... + def SetWindowPlacement(self, placement) -> None: ... + def SetWindowText(self, text: str) -> None: ... + def ShowCaret(self) -> None: ... + def ShowScrollBar(self, nBar, bShow: int = ...) -> None: ... + def ShowWindow(self, arg): ... + def UnLockWindowUpdate(self) -> None: ... + def UpdateData(self, bSaveAndValidate: int = ...): ... + def UpdateDialogControls(self, pTarget: PyCCmdTarget, disableIfNoHandler): ... + def UpdateWindow(self) -> None: ... + +class PyDDEConv: + def ConnectTo(self, service: str, topic: str) -> None: ... + def Connected(self) -> None: ... + def Exec(self, Cmd: str) -> None: ... + def Request(self) -> None: ... + def Poke(self) -> None: ... + +class PyDDEServer: + def AddTopic(self, topic: PyDDETopic) -> None: ... + def Create(self, name: str, filterFlags: int = ...) -> None: ... + def Destroy(self) -> None: ... + def GetLastError(self): ... + def Shutdown(self) -> None: ... + +class PyDDEStringItem: + def SetData(self, data: str) -> None: ... + +class PyDDETopic: + def AddItem(self, item) -> None: ... + def Destroy(self) -> None: ... + +class PyDLL: + def GetFileName(self) -> str: ... + def AttachToMFC(self) -> None: ... + +class SCROLLINFO: ... +class TV_ITEM: ... + +class EXTENSION_CONTROL_BLOCK: + @property + def Version(self) -> int: ... + @property + def TotalBytes(self): ... + @property + def AvailableBytes(self): ... + @property + def HttpStatusCode(self): ... + @property + def Method(self): ... + @property + def ConnID(self): ... + @property + def QueryString(self): ... + @property + def PathInfo(self): ... + @property + def PathTranslated(self): ... + @property + def AvailableData(self): ... + @property + def ContentType(self): ... + @property + def LogData(self): ... + def WriteClient(self, data: str, reserved: int = ...): ... + def GetServerVariable(self, variable: str, default) -> str: ... + def ReadClient(self, nbytes) -> str: ... + def SendResponseHeaders(self, reply: str, headers: str, keepAlive: bool = ...) -> None: ... + def SetFlushFlag(self, flag) -> None: ... + def TransmitFile(self, callback, param, hFile, statusCode: str, BytesToWrite, Offset, head: str, tail: str, flags): ... + def MapURLToPath(self) -> None: ... + def DoneWithSession(self, status) -> None: ... + def Redirect(self, url: str) -> None: ... + def IsKeepAlive(self) -> bool: ... + def GetAnonymousToken(self, metabase_path: str): ... + def GetImpersonationToken(self): ... + def IsKeepConn(self) -> bool: ... + def ExecURL(self, url: str, method: str, clientHeaders: str, info, entity, flags): ... + def GetExecURLStatus(self): ... + def IOCompletion(self, func, arg: Incomplete | None = ...): ... + def ReportUnhealthy(self, reason: str | None = ...): ... + def IOCallback(self, ecb: EXTENSION_CONTROL_BLOCK, arg, cbIO, dwError): ... + +class HSE_VERSION_INFO: + @property + def ExtensionDesc(self) -> str: ... + +class HTTP_FILTER_AUTHENT: + @property + def User(self) -> str: ... + @property + def Password(self) -> str: ... + +class HTTP_FILTER_CONTEXT: + @property + def Revision(self): ... + @property + def fIsSecurePort(self): ... + @property + def NotificationType(self): ... + @property + def FilterContext(self): ... + def GetData(self): ... + def GetServerVariable(self, variable: str, default) -> str: ... + def WriteClient(self, data: str, reserverd: int = ...) -> None: ... + def AddResponseHeaders(self, data: str, reserverd: int = ...) -> None: ... + def SendResponseHeader(self, status: str, header: str) -> None: ... + def DisableNotifications(self, flags) -> None: ... + +class HTTP_FILTER_LOG: + @property + def ClientHostName(self) -> str: ... + @property + def ClientUserName(self) -> str: ... + @property + def ServerName(self) -> str: ... + @property + def Operation(self) -> str: ... + @property + def Target(self) -> str: ... + @property + def Parameters(self) -> str: ... + @property + def HttpStatus(self): ... + +class HTTP_FILTER_PREPROC_HEADERS: + def GetHeader(self, header: str, default) -> str: ... + def SetHeader(self, name: str, val: str) -> None: ... + def AddHeader(self) -> None: ... + +class HTTP_FILTER_RAW_DATA: + @property + def InData(self) -> str: ... + +class HTTP_FILTER_URL_MAP: + @property + def URL(self) -> str: ... + @property + def PhysicalPath(self) -> str: ... + +class HTTP_FILTER_VERSION: + @property + def ServerFilterVersion(self): ... + @property + def FilterVersion(self): ... + @property + def Flags(self): ... + @property + def FilterDesc(self) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/afxres.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/afxres.pyi new file mode 100644 index 000000000..0d3239c03 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/afxres.pyi @@ -0,0 +1 @@ +from win32.lib.afxres import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/commctrl.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/commctrl.pyi new file mode 100644 index 000000000..603c5703a --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/commctrl.pyi @@ -0,0 +1 @@ +from win32.lib.commctrl import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/dde.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/dde.pyi new file mode 100644 index 000000000..90a5be0f0 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/dde.pyi @@ -0,0 +1 @@ +from pythonwin.dde import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/isapi/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/isapi/__init__.pyi new file mode 100644 index 000000000..87815a678 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/isapi/__init__.pyi @@ -0,0 +1,11 @@ +from _typeshed import Incomplete + +class ISAPIError(Exception): + errno: Incomplete + strerror: Incomplete + funcname: Incomplete + def __init__(self, errno, strerror: Incomplete | None = ..., funcname: Incomplete | None = ...) -> None: ... + +class FilterError(ISAPIError): ... +class ExtensionError(ISAPIError): ... +class InternalReloadException(Exception): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/isapi/isapicon.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/isapi/isapicon.pyi new file mode 100644 index 000000000..33dc5d623 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/isapi/isapicon.pyi @@ -0,0 +1,86 @@ +from _typeshed import Incomplete + +HTTP_CONTINUE: int +HTTP_SWITCHING_PROTOCOLS: int +HTTP_PROCESSING: int +HTTP_OK: int +HTTP_CREATED: int +HTTP_ACCEPTED: int +HTTP_NON_AUTHORITATIVE: int +HTTP_NO_CONTENT: int +HTTP_RESET_CONTENT: int +HTTP_PARTIAL_CONTENT: int +HTTP_MULTI_STATUS: int +HTTP_MULTIPLE_CHOICES: int +HTTP_MOVED_PERMANENTLY: int +HTTP_MOVED_TEMPORARILY: int +HTTP_SEE_OTHER: int +HTTP_NOT_MODIFIED: int +HTTP_USE_PROXY: int +HTTP_TEMPORARY_REDIRECT: int +HTTP_BAD_REQUEST: int +HTTP_UNAUTHORIZED: int +HTTP_PAYMENT_REQUIRED: int +HTTP_FORBIDDEN: int +HTTP_NOT_FOUND: int +HTTP_METHOD_NOT_ALLOWED: int +HTTP_NOT_ACCEPTABLE: int +HTTP_PROXY_AUTHENTICATION_REQUIRED: int +HTTP_REQUEST_TIME_OUT: int +HTTP_CONFLICT: int +HTTP_GONE: int +HTTP_LENGTH_REQUIRED: int +HTTP_PRECONDITION_FAILED: int +HTTP_REQUEST_ENTITY_TOO_LARGE: int +HTTP_REQUEST_URI_TOO_LARGE: int +HTTP_UNSUPPORTED_MEDIA_TYPE: int +HTTP_RANGE_NOT_SATISFIABLE: int +HTTP_EXPECTATION_FAILED: int +HTTP_UNPROCESSABLE_ENTITY: int +HTTP_INTERNAL_SERVER_ERROR: int +HTTP_NOT_IMPLEMENTED: int +HTTP_BAD_GATEWAY: int +HTTP_SERVICE_UNAVAILABLE: int +HTTP_GATEWAY_TIME_OUT: int +HTTP_VERSION_NOT_SUPPORTED: int +HTTP_VARIANT_ALSO_VARIES: int +HSE_STATUS_SUCCESS: int +HSE_STATUS_SUCCESS_AND_KEEP_CONN: int +HSE_STATUS_PENDING: int +HSE_STATUS_ERROR: int +SF_NOTIFY_SECURE_PORT: int +SF_NOTIFY_NONSECURE_PORT: int +SF_NOTIFY_READ_RAW_DATA: int +SF_NOTIFY_PREPROC_HEADERS: int +SF_NOTIFY_AUTHENTICATION: int +SF_NOTIFY_URL_MAP: int +SF_NOTIFY_ACCESS_DENIED: int +SF_NOTIFY_SEND_RESPONSE: int +SF_NOTIFY_SEND_RAW_DATA: int +SF_NOTIFY_LOG: int +SF_NOTIFY_END_OF_REQUEST: int +SF_NOTIFY_END_OF_NET_SESSION: int +SF_NOTIFY_ORDER_HIGH: int +SF_NOTIFY_ORDER_MEDIUM: int +SF_NOTIFY_ORDER_LOW: int +SF_NOTIFY_ORDER_DEFAULT: int +SF_NOTIFY_ORDER_MASK: Incomplete +SF_STATUS_REQ_FINISHED: int +SF_STATUS_REQ_FINISHED_KEEP_CONN: Incomplete +SF_STATUS_REQ_NEXT_NOTIFICATION: Incomplete +SF_STATUS_REQ_HANDLED_NOTIFICATION: Incomplete +SF_STATUS_REQ_ERROR: Incomplete +SF_STATUS_REQ_READ_NEXT: Incomplete +HSE_IO_SYNC: int +HSE_IO_ASYNC: int +HSE_IO_DISCONNECT_AFTER_SEND: int +HSE_IO_SEND_HEADERS: int +HSE_IO_NODELAY: int +HSE_IO_FINAL_SEND: int +HSE_IO_CACHE_RESPONSE: int +HSE_EXEC_URL_NO_HEADERS: int +HSE_EXEC_URL_IGNORE_CURRENT_INTERCEPTOR: int +HSE_EXEC_URL_IGNORE_VALIDATION_AND_RANGE: int +HSE_EXEC_URL_DISABLE_CUSTOM_ERROR: int +HSE_EXEC_URL_SSI_CMD: int +HSE_EXEC_URL_HTTP_CACHE_ELIGIBLE: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/isapi/simple.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/isapi/simple.pyi new file mode 100644 index 000000000..7e9bc1b38 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/isapi/simple.pyi @@ -0,0 +1,12 @@ +from _typeshed import Incomplete + +class SimpleExtension: + def GetExtensionVersion(self, vi) -> None: ... + def HttpExtensionProc(self, control_block) -> None: ... + def TerminateExtension(self, status) -> None: ... + +class SimpleFilter: + filter_flags: Incomplete + def GetFilterVersion(self, fv) -> None: ... + def HttpFilterProc(self, fc) -> None: ... + def TerminateFilter(self, status) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/isapi/threaded_extension.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/isapi/threaded_extension.pyi new file mode 100644 index 000000000..502351d2e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/isapi/threaded_extension.pyi @@ -0,0 +1,29 @@ +import threading +from _typeshed import Incomplete + +import isapi.simple +from isapi import ExtensionError as ExtensionError, isapicon as isapicon +from win32event import INFINITE as INFINITE + +ISAPI_REQUEST: int +ISAPI_SHUTDOWN: int + +class WorkerThread(threading.Thread): + running: bool + io_req_port: Incomplete + extension: Incomplete + def __init__(self, extension, io_req_port) -> None: ... + def call_handler(self, cblock) -> None: ... + +class ThreadPoolExtension(isapi.simple.SimpleExtension): + max_workers: int + worker_shutdown_wait: int + workers: Incomplete + dispatch_map: Incomplete + io_req_port: Incomplete + def GetExtensionVersion(self, vi) -> None: ... + def HttpExtensionProc(self, control_block): ... + def TerminateExtension(self, status) -> None: ... + def DispatchConnection(self, errCode, bytes, key, overlapped) -> None: ... + def Dispatch(self, ecb) -> None: ... + def HandleDispatchError(self, ecb) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/mmapfile.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/mmapfile.pyi new file mode 100644 index 000000000..0b18e7600 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/mmapfile.pyi @@ -0,0 +1 @@ +from win32.mmapfile import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/mmsystem.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/mmsystem.pyi new file mode 100644 index 000000000..600475d28 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/mmsystem.pyi @@ -0,0 +1 @@ +from win32.lib.mmsystem import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/ntsecuritycon.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/ntsecuritycon.pyi new file mode 100644 index 000000000..0b2375482 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/ntsecuritycon.pyi @@ -0,0 +1 @@ +from win32.lib.ntsecuritycon import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/odbc.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/odbc.pyi new file mode 100644 index 000000000..4671d862c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/odbc.pyi @@ -0,0 +1 @@ +from win32.odbc import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/perfmon.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/perfmon.pyi new file mode 100644 index 000000000..eae890e08 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/perfmon.pyi @@ -0,0 +1 @@ +from win32.perfmon import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/pythoncom.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/pythoncom.pyi new file mode 100644 index 000000000..30a0f46a8 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/pythoncom.pyi @@ -0,0 +1,470 @@ +# Can't generate with stubgen because: +# "Critical error during semantic analysis: mypy: can't decode file '.venv\Lib\site-packages\pywin32_system32\pythoncom39.dll': 'utf-8' codec can't decode byte 0x90 in position 2: invalid start byte" +# https://github.com/python/mypy/issues/13822 +from _typeshed import Incomplete +from typing_extensions import TypeAlias + +import _win32typing +from win32.lib.pywintypes import com_error as com_error + +error: TypeAlias = com_error # noqa: Y042 + +class internal_error(Exception): ... + +def CoCreateFreeThreadedMarshaler(unk: _win32typing.PyIUnknown) -> _win32typing.PyIUnknown: ... +def CoCreateInstanceEx( + clsid: _win32typing.PyIID, + unkOuter: _win32typing.PyIUnknown, + context, + serverInfo: tuple[Incomplete, Incomplete, Incomplete, Incomplete], + iids: list[_win32typing.PyIID], +) -> _win32typing.PyIUnknown: ... +def CoCreateInstance( + __clsid: _win32typing.PyIID, __unkOuter: _win32typing.PyIUnknown | None, __context: int, __iid: _win32typing.PyIID +) -> _win32typing.PyIUnknown: ... +def CoFreeUnusedLibraries() -> None: ... +def CoInitialize() -> None: ... +def CoInitializeEx(flags) -> None: ... +def CoInitializeSecurity( + sd: _win32typing.PySECURITY_DESCRIPTOR, authSvc, reserved1, authnLevel, impLevel, authInfo, capabilities, reserved2 +) -> None: ... +def CoGetInterfaceAndReleaseStream(stream: _win32typing.PyIStream, iid: _win32typing.PyIID) -> _win32typing.PyIUnknown: ... +def CoMarshalInterThreadInterfaceInStream(iid: _win32typing.PyIID, unk: _win32typing.PyIUnknown) -> _win32typing.PyIStream: ... +def CoMarshalInterface( + Stm: _win32typing.PyIStream, riid: _win32typing.PyIID, Unk: _win32typing.PyIUnknown, DestContext, flags +) -> None: ... +def CoUnmarshalInterface(Stm: _win32typing.PyIStream, riid: _win32typing.PyIID): ... +def CoReleaseMarshalData(Stm: _win32typing.PyIStream) -> None: ... +def CoGetObject(name: str, iid: _win32typing.PyIID, bindOpts: Incomplete | None = ...) -> _win32typing.PyIUnknown: ... +def CoUninitialize() -> None: ... +def CoRegisterClassObject(iid: _win32typing.PyIID, factory: _win32typing.PyIUnknown, context, flags): ... +def CoResumeClassObjects() -> None: ... +def CoRevokeClassObject(reg) -> None: ... +def CoTreatAsClass(clsidold: _win32typing.PyIID, clsidnew: _win32typing.PyIID) -> None: ... +def CoWaitForMultipleHandles(Flags, Timeout, Handles: list[int]): ... +def Connect(cls) -> _win32typing.PyIDispatch: ... +def CreateGuid() -> _win32typing.PyIID: ... +def CreateBindCtx() -> _win32typing.PyIBindCtx: ... +def CreateFileMoniker(filename: str) -> _win32typing.PyIMoniker: ... +def CreateItemMoniker(delim: str, item: str) -> _win32typing.PyIMoniker: ... +def CreatePointerMoniker(IUnknown: _win32typing.PyIUnknown) -> _win32typing.PyIMoniker: ... +def CreateTypeLib(): ... +def CreateTypeLib2(): ... +def CreateStreamOnHGlobal(hGlobal: int | None = ..., DeleteOnRelease: bool = ...) -> _win32typing.PyIStream: ... +def CreateILockBytesOnHGlobal(hGlobal: int | None = ..., DeleteOnRelease: bool = ...) -> _win32typing.PyILockBytes: ... +def EnableQuitMessage(threadId) -> None: ... +def FUNCDESC() -> _win32typing.FUNCDESC: ... +def GetActiveObject(cls) -> _win32typing.PyIUnknown: ... +def GetClassFile(fileName) -> _win32typing.PyIID: ... +def GetFacilityString(scode) -> str: ... +def GetRecordFromGuids( + iid: _win32typing.PyIID, verMajor, verMinor, lcid, infoIID: _win32typing.PyIID, data: Incomplete | None = ... +): ... +def GetRecordFromTypeInfo(TypeInfo: _win32typing.PyITypeInfo): ... +def GetRunningObjectTable(reserved: int = ...) -> _win32typing.PyIRunningObjectTable: ... +def GetScodeString(scode) -> str: ... +def GetScodeRangeString(scode) -> str: ... +def GetSeverityString(scode) -> str: ... +def IsGatewayRegistered(__iid: _win32typing.PyIID | None) -> int: ... +def LoadRegTypeLib(iid: _win32typing.PyIID, versionMajor, versionMinor, lcid) -> _win32typing.PyITypeLib: ... +def LoadTypeLib(libFileName: str) -> _win32typing.PyITypeLib: ... +def MakePyFactory(iid: _win32typing.PyIID) -> _win32typing.PyIClassFactory: ... +def MkParseDisplayName( + displayName: str, bindCtx: _win32typing.PyIBindCtx | None = ... +) -> tuple[_win32typing.PyIMoniker, Incomplete, _win32typing.PyIBindCtx]: ... +def New(cls) -> _win32typing.PyIDispatch: ... +def ObjectFromAddress(address, iid: _win32typing.PyIID) -> _win32typing.PyIUnknown: ... +def ObjectFromLresult(lresult, iid: _win32typing.PyIID, wparm) -> _win32typing.PyIUnknown: ... +def OleInitialize() -> None: ... +def OleGetClipboard() -> _win32typing.PyIDataObject: ... +def OleFlushClipboard() -> None: ... +def OleIsCurrentClipboard(dataObj: _win32typing.PyIDataObject): ... +def OleSetClipboard(dataObj: _win32typing.PyIDataObject) -> None: ... +def OleLoadFromStream(stream: _win32typing.PyIStream, iid: _win32typing.PyIID) -> None: ... +def OleSaveToStream(persist: _win32typing.PyIPersistStream, stream: _win32typing.PyIStream) -> None: ... +def OleLoad(storage: _win32typing.PyIStorage, iid: _win32typing.PyIID, site: _win32typing.PyIOleClientSite) -> None: ... +def ProgIDFromCLSID(clsid) -> str: ... +def PumpWaitingMessages(__firstMessage: int = ..., __lastMessage: int = ...) -> int: ... +def PumpMessages() -> None: ... +def QueryPathOfRegTypeLib(iid: _win32typing.PyIID, versionMajor, versionMinor, lcid) -> str: ... +def ReadClassStg(storage: _win32typing.PyIStorage) -> _win32typing.PyIID: ... +def ReadClassStm(Stm: _win32typing.PyIStream) -> _win32typing.PyIID: ... +def RegisterTypeLib(typelib: _win32typing.PyITypeLib, fullPath: str, lcid, helpDir: str | None = ...) -> None: ... +def UnRegisterTypeLib(iid: _win32typing.PyIID, versionMajor, versionMinor, lcid, syskind) -> str: ... +def RegisterActiveObject(obUnknown: _win32typing.PyIUnknown, clsid: _win32typing.PyIID, flags): ... +def RevokeActiveObject(handle) -> None: ... +def RegisterDragDrop(hwnd: int, dropTarget: _win32typing.PyIDropTarget) -> None: ... +def RevokeDragDrop(hwnd: int) -> None: ... +def DoDragDrop() -> None: ... +def StgCreateDocfile(name: str, mode, reserved: int = ...) -> _win32typing.PyIStorage: ... +def StgCreateDocfileOnILockBytes(lockBytes: _win32typing.PyILockBytes, mode, reserved=...) -> _win32typing.PyIStorage: ... +def StgOpenStorageOnILockBytes( + lockBytes: _win32typing.PyILockBytes, + stgPriority: _win32typing.PyIStorage, + snbExclude: Incomplete | None = ..., + reserved: int = ..., +) -> _win32typing.PyIStorage: ... +def StgIsStorageFile(name: str): ... +def STGMEDIUM() -> _win32typing.PySTGMEDIUM: ... +def StgOpenStorage( + name: str, other: _win32typing.PyIStorage, mode, snbExclude: Incomplete | None = ..., reserved=... +) -> _win32typing.PyIStorage: ... +def StgOpenStorageEx( + Name: str, Mode, stgfmt, Attrs, riid: _win32typing.PyIID, StgOptions: Incomplete | None = ... +) -> _win32typing.PyIStorage: ... +def StgCreateStorageEx( + Name: str, + Mode, + stgfmt, + Attrs, + riid: _win32typing.PyIID, + StgOptions: Incomplete | None = ..., + SecurityDescriptor: _win32typing.PySECURITY_DESCRIPTOR | None = ..., +) -> _win32typing.PyIStorage: ... +def TYPEATTR() -> _win32typing.TYPEATTR: ... +def VARDESC() -> _win32typing.VARDESC: ... +def WrapObject(ob, gatewayIID: _win32typing.PyIID, interfaceIID: _win32typing.PyIID) -> _win32typing.PyIUnknown: ... +def WriteClassStg(storage: _win32typing.PyIStorage, iid: _win32typing.PyIID) -> None: ... +def WriteClassStm(Stm: _win32typing.PyIStream, clsid: _win32typing.PyIID) -> None: ... +def UnwrapObject(ob: _win32typing.PyIUnknown) -> _win32typing.PyIDispatch: ... +def FmtIdToPropStgName(fmtid: _win32typing.PyIID): ... +def PropStgNameToFmtId(Name: str) -> _win32typing.PyIID: ... +def CoGetCallContext(riid: _win32typing.PyIID) -> _win32typing.PyIServerSecurity: ... +def CoGetObjectContext(riid: _win32typing.PyIID) -> _win32typing.PyIContext: ... +def CoGetCancelObject(riid: _win32typing.PyIID, ThreadID: int = ...) -> _win32typing.PyICancelMethodCalls: ... +def CoSetCancelObject(Unk: _win32typing.PyIUnknown) -> None: ... +def CoEnableCallCancellation() -> None: ... +def CoDisableCallCancellation() -> None: ... +def CreateURLMonikerEx(*args, **kwargs): ... # incomplete +def new(__iid: _win32typing.PyIID | str): ... + +ACTIVEOBJECT_STRONG: int +ACTIVEOBJECT_WEAK: int +ArgNotFound: _win32typing.ArgNotFound +CLSCTX_ALL: int +CLSCTX_INPROC: int +CLSCTX_INPROC_HANDLER: int +CLSCTX_INPROC_SERVER: int +CLSCTX_LOCAL_SERVER: int +CLSCTX_REMOTE_SERVER: int +CLSCTX_SERVER: int +CLSID_DCOMAccessControl: _win32typing.PyIID +CLSID_StdComponentCategoriesMgr: _win32typing.PyIID +CLSID_StdGlobalInterfaceTable: _win32typing.PyIID +COINIT_APARTMENTTHREADED: int +COINIT_DISABLE_OLE1DDE: int +COINIT_MULTITHREADED: int +COINIT_SPEED_OVER_MEMORY: int +COWAIT_ALERTABLE: int +COWAIT_WAITALL: int + +DATADIR_GET: int +DATADIR_SET: int +DESCKIND_FUNCDESC: int +DESCKIND_VARDESC: int +DISPATCH_METHOD: int +DISPATCH_PROPERTYGET: int +DISPATCH_PROPERTYPUT: int +DISPATCH_PROPERTYPUTREF: int +DISPID_COLLECT: int +DISPID_CONSTRUCTOR: int +DISPID_DESTRUCTOR: int +DISPID_EVALUATE: int +DISPID_NEWENUM: int +DISPID_PROPERTYPUT: int +DISPID_STARTENUM: int +DISPID_THIS: int +DISPID_UNKNOWN: int +DISPID_VALUE: int +DVASPECT_CONTENT: int +DVASPECT_DOCPRINT: int +DVASPECT_ICON: int +DVASPECT_THUMBNAIL: int +EOAC_ACCESS_CONTROL: int +EOAC_ANY_AUTHORITY: int +EOAC_APPID: int +EOAC_AUTO_IMPERSONATE: int +EOAC_DEFAULT: int +EOAC_DISABLE_AAA: int +EOAC_DYNAMIC: int +EOAC_DYNAMIC_CLOAKING: int +EOAC_MAKE_FULLSIC: int +EOAC_MUTUAL_AUTH: int +EOAC_NONE: int +EOAC_NO_CUSTOM_MARSHAL: int +EOAC_REQUIRE_FULLSIC: int +EOAC_SECURE_REFS: int +EOAC_STATIC_CLOAKING: int +EXTCONN_CALLABLE: int +EXTCONN_STRONG: int +EXTCONN_WEAK: int +Empty: _win32typing.PyOleEmpty +FMTID_DocSummaryInformation: _win32typing.PyIID +FMTID_SummaryInformation: _win32typing.PyIID +FMTID_UserDefinedProperties: _win32typing.PyIID +FUNCFLAG_FBINDABLE: int +FUNCFLAG_FDEFAULTBIND: int +FUNCFLAG_FDISPLAYBIND: int +FUNCFLAG_FHIDDEN: int +FUNCFLAG_FREQUESTEDIT: int +FUNCFLAG_FRESTRICTED: int +FUNCFLAG_FSOURCE: int +FUNCFLAG_FUSESGETLASTERROR: int +FUNC_DISPATCH: int +FUNC_NONVIRTUAL: int +FUNC_PUREVIRTUAL: int +FUNC_STATIC: int +FUNC_VIRTUAL: int +IDLFLAG_FIN: int +IDLFLAG_FLCID: int +IDLFLAG_FOUT: int +IDLFLAG_FRETVAL: int +IDLFLAG_NONE: int +IID_IBindCtx: _win32typing.PyIID +IID_ICancelMethodCalls: _win32typing.PyIID +IID_ICatInformation: _win32typing.PyIID +IID_ICatRegister: _win32typing.PyIID +IID_IClassFactory: _win32typing.PyIID +IID_IClientSecurity: _win32typing.PyIID +IID_IConnectionPoint: _win32typing.PyIID +IID_IConnectionPointContainer: _win32typing.PyIID +IID_IContext: _win32typing.PyIID +IID_ICreateTypeInfo: _win32typing.PyIID +IID_ICreateTypeLib: _win32typing.PyIID +IID_ICreateTypeLib2: _win32typing.PyIID +IID_IDataObject: _win32typing.PyIID +IID_IDispatch: _win32typing.PyIID +IID_IDispatchEx: _win32typing.PyIID +IID_IDropSource: _win32typing.PyIID +IID_IDropTarget: _win32typing.PyIID +IID_IEnumCATEGORYINFO: _win32typing.PyIID +IID_IEnumConnectionPoints: _win32typing.PyIID +IID_IEnumConnections: _win32typing.PyIID +IID_IEnumContextProps: _win32typing.PyIID +IID_IEnumFORMATETC: _win32typing.PyIID +IID_IEnumGUID: _win32typing.PyIID +IID_IEnumMoniker: _win32typing.PyIID +IID_IEnumSTATPROPSETSTG: _win32typing.PyIID +IID_IEnumSTATPROPSTG: _win32typing.PyIID +IID_IEnumSTATSTG: _win32typing.PyIID +IID_IEnumString: _win32typing.PyIID +IID_IEnumVARIANT: _win32typing.PyIID +IID_IErrorLog: _win32typing.PyIID +IID_IExternalConnection: _win32typing.PyIID +IID_IGlobalInterfaceTable: _win32typing.PyIID +IID_ILockBytes: _win32typing.PyIID +IID_IMarshal: _win32typing.PyIID +IID_IMoniker: _win32typing.PyIID +IID_IOleWindow: _win32typing.PyIID +IID_IPersist: _win32typing.PyIID +IID_IPersistFile: _win32typing.PyIID +IID_IPersistPropertyBag: _win32typing.PyIID +IID_IPersistStorage: _win32typing.PyIID +IID_IPersistStream: _win32typing.PyIID +IID_IPersistStreamInit: _win32typing.PyIID +IID_IPropertyBag: _win32typing.PyIID +IID_IPropertySetStorage: _win32typing.PyIID +IID_IPropertyStorage: _win32typing.PyIID +IID_IProvideClassInfo: _win32typing.PyIID +IID_IProvideClassInfo2: _win32typing.PyIID +IID_IRunningObjectTable: _win32typing.PyIID +IID_IServerSecurity: _win32typing.PyIID +IID_IServiceProvider: _win32typing.PyIID +IID_IStdMarshalInfo: _win32typing.PyIID +IID_IStorage: _win32typing.PyIID +IID_IStream: _win32typing.PyIID +IID_ITypeComp: _win32typing.PyIID +IID_ITypeInfo: _win32typing.PyIID +IID_ITypeLib: _win32typing.PyIID +IID_IUnknown: _win32typing.PyIID +IID_NULL: _win32typing.PyIID +IID_StdOle: _win32typing.PyIID +IMPLTYPEFLAG_FDEFAULT: int +IMPLTYPEFLAG_FRESTRICTED: int +IMPLTYPEFLAG_FSOURCE: int +INVOKE_FUNC: int +INVOKE_PROPERTYGET: int +INVOKE_PROPERTYPUT: int +INVOKE_PROPERTYPUTREF: int +InterfaceNames: dict[str, _win32typing.PyIID] +MKSYS_ANTIMONIKER: int +MKSYS_CLASSMONIKER: int +MKSYS_FILEMONIKER: int +MKSYS_GENERICCOMPOSITE: int +MKSYS_ITEMMONIKER: int +MKSYS_NONE: int +MKSYS_POINTERMONIKER: int +MSHCTX_DIFFERENTMACHINE: int +MSHCTX_INPROC: int +MSHCTX_LOCAL: int +MSHCTX_NOSHAREDMEM: int +MSHLFLAGS_NOPING: int +MSHLFLAGS_NORMAL: int +MSHLFLAGS_TABLESTRONG: int +MSHLFLAGS_TABLEWEAK: int +Missing: _win32typing.PyOleMissing +Nothing: _win32typing.PyOleNothing +PARAMFLAG_FHASDEFAULT: int +PARAMFLAG_FIN: int +PARAMFLAG_FLCID: int +PARAMFLAG_FOPT: int +PARAMFLAG_FOUT: int +PARAMFLAG_FRETVAL: int +PARAMFLAG_NONE: int +REGCLS_MULTIPLEUSE: int +REGCLS_MULTI_SEPARATE: int +REGCLS_SINGLEUSE: int +REGCLS_SUSPENDED: int +ROTFLAGS_ALLOWANYCLIENT: int +ROTFLAGS_REGISTRATIONKEEPSALIVE: int +RPC_C_AUTHN_DCE_PRIVATE: int +RPC_C_AUTHN_DCE_PUBLIC: int +RPC_C_AUTHN_DEC_PUBLIC: int +RPC_C_AUTHN_DEFAULT: int +RPC_C_AUTHN_DPA: int +RPC_C_AUTHN_GSS_KERBEROS: int +RPC_C_AUTHN_GSS_NEGOTIATE: int +RPC_C_AUTHN_GSS_SCHANNEL: int +RPC_C_AUTHN_LEVEL_CALL: int +RPC_C_AUTHN_LEVEL_CONNECT: int +RPC_C_AUTHN_LEVEL_DEFAULT: int +RPC_C_AUTHN_LEVEL_NONE: int +RPC_C_AUTHN_LEVEL_PKT: int +RPC_C_AUTHN_LEVEL_PKT_INTEGRITY: int +RPC_C_AUTHN_LEVEL_PKT_PRIVACY: int +RPC_C_AUTHN_MQ: int +RPC_C_AUTHN_MSN: int +RPC_C_AUTHN_NONE: int +RPC_C_AUTHN_WINNT: int +RPC_C_AUTHZ_DCE: int +RPC_C_AUTHZ_DEFAULT: int +RPC_C_AUTHZ_NAME: int +RPC_C_AUTHZ_NONE: int +RPC_C_IMP_LEVEL_ANONYMOUS: int +RPC_C_IMP_LEVEL_DEFAULT: int +RPC_C_IMP_LEVEL_DELEGATE: int +RPC_C_IMP_LEVEL_IDENTIFY: int +RPC_C_IMP_LEVEL_IMPERSONATE: int +STDOLE2_LCID: int +STDOLE2_MAJORVERNUM: int +STDOLE2_MINORVERNUM: int +STDOLE_LCID: int +STDOLE_MAJORVERNUM: int +STDOLE_MINORVERNUM: int +STREAM_SEEK_CUR: int +STREAM_SEEK_END: int +STREAM_SEEK_SET: int +SYS_MAC: int +SYS_WIN16: int +SYS_WIN32: int +ServerInterfaces: dict[_win32typing.PyIID, bytes] +TKIND_ALIAS: int +TKIND_COCLASS: int +TKIND_DISPATCH: int +TKIND_ENUM: int +TKIND_INTERFACE: int +TKIND_MODULE: int +TKIND_RECORD: int +TKIND_UNION: int +TYMED_ENHMF: int +TYMED_FILE: int +TYMED_GDI: int +TYMED_HGLOBAL: int +TYMED_ISTORAGE: int +TYMED_ISTREAM: int +TYMED_MFPICT: int +TYMED_NULL: int +TYPEFLAG_FAGGREGATABLE: int +TYPEFLAG_FAPPOBJECT: int +TYPEFLAG_FCANCREATE: int +TYPEFLAG_FCONTROL: int +TYPEFLAG_FDISPATCHABLE: int +TYPEFLAG_FDUAL: int +TYPEFLAG_FHIDDEN: int +TYPEFLAG_FLICENSED: int +TYPEFLAG_FNONEXTENSIBLE: int +TYPEFLAG_FOLEAUTOMATION: int +TYPEFLAG_FPREDECLID: int +TYPEFLAG_FREPLACEABLE: int +TYPEFLAG_FRESTRICTED: int +TYPEFLAG_FREVERSEBIND: int +TypeIIDs: dict[_win32typing.PyIID, type] +URL_MK_LEGACY: int +URL_MK_UNIFORM: int +VARFLAG_FREADONLY: int +VAR_CONST: int +VAR_DISPATCH: int +VAR_PERINSTANCE: int +VAR_STATIC: int +VT_ARRAY: int +VT_BLOB: int +VT_BLOB_OBJECT: int +VT_BOOL: int +VT_BSTR: int +VT_BSTR_BLOB: int +VT_BYREF: int +VT_CARRAY: int +VT_CF: int +VT_CLSID: int +VT_CY: int +VT_DATE: int +VT_DECIMAL: int +VT_DISPATCH: int +VT_EMPTY: int +VT_ERROR: int +VT_FILETIME: int +VT_HRESULT: int +VT_I1: int +VT_I2: int +VT_I4: int +VT_I8: int +VT_ILLEGAL: int +VT_ILLEGALMASKED: int +VT_INT: int +VT_LPSTR: int +VT_LPWSTR: int +VT_NULL: int +VT_PTR: int +VT_R4: int +VT_R8: int +VT_RECORD: int +VT_RESERVED: int +VT_SAFEARRAY: int +VT_STORAGE: int +VT_STORED_OBJECT: int +VT_STREAM: int +VT_STREAMED_OBJECT: int +VT_TYPEMASK: int +VT_UI1: int +VT_UI2: int +VT_UI4: int +VT_UI8: int +VT_UINT: int +VT_UNKNOWN: int +VT_USERDEFINED: int +VT_VARIANT: int +VT_VECTOR: int +VT_VOID: int + +def connect(*args, **kwargs): ... # incomplete + +dcom: int +fdexNameCaseInsensitive: int +fdexNameCaseSensitive: int +fdexNameEnsure: int +fdexNameImplicit: int +fdexPropCanCall: int +fdexPropCanConstruct: int +fdexPropCanGet: int +fdexPropCanPut: int +fdexPropCanPutRef: int +fdexPropCanSourceEvents: int +fdexPropCannotCall: int +fdexPropCannotConstruct: int +fdexPropCannotGet: int +fdexPropCannotPut: int +fdexPropCannotPutRef: int +fdexPropCannotSourceEvents: int +fdexPropDynamicType: int +fdexPropNoSideEffects: int +frozen: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/pythonwin/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/pythonwin/__init__.pyi new file mode 100644 index 000000000..e69de29bb diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/pythonwin/dde.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/pythonwin/dde.pyi new file mode 100644 index 000000000..ac041d3cf --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/pythonwin/dde.pyi @@ -0,0 +1,33 @@ +# Can't generate with stubgen because: +# "ImportError: This must be an MFC application - try 'import win32ui' first" +APPCLASS_MONITOR: int +APPCLASS_STANDARD: int +APPCMD_CLIENTONLY: int +APPCMD_FILTERINITS: int +CBF_FAIL_ADVISES: int +CBF_FAIL_ALLSVRXACTIONS: int +CBF_FAIL_CONNECTIONS: int +CBF_FAIL_EXECUTES: int +CBF_FAIL_POKES: int +CBF_FAIL_REQUESTS: int +CBF_FAIL_SELFCONNECTIONS: int +CBF_SKIP_ALLNOTIFICATIONS: int +CBF_SKIP_CONNECT_CONFIRMS: int +CBF_SKIP_DISCONNECTS: int +CBF_SKIP_REGISTRATIONS: int + +def CreateConversation(*args, **kwargs): ... # incomplete +def CreateServer(*args, **kwargs): ... # incomplete +def CreateServerSystemTopic(*args, **kwargs): ... # incomplete +def CreateStringItem(*args, **kwargs): ... # incomplete +def CreateTopic(*args, **kwargs): ... # incomplete + +MF_CALLBACKS: int +MF_CONV: int +MF_ERRORS: int +MF_HSZ_INFO: int +MF_LINKS: int +MF_POSTMSGS: int +MF_SENDMSGS: int + +class error(Exception): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/pythonwin/win32ui.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/pythonwin/win32ui.pyi new file mode 100644 index 000000000..ab07c2db0 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/pythonwin/win32ui.pyi @@ -0,0 +1,369 @@ +from _typeshed import Incomplete + +import _win32typing + +class error(Exception): ... + +def ComparePath(path1: str, path2: str): ... +def CreateMDIFrame() -> _win32typing.PyCMDIFrameWnd: ... +def CreateMDIChild() -> _win32typing.PyCMDIChildWnd: ... +def CreateBitmap() -> _win32typing.PyCBitmap: ... +def CreateBitmapFromHandle(): ... +def CreateBrush() -> _win32typing.PyCBrush: ... +def CreateButton() -> _win32typing.PyCButton: ... +def CreateColorDialog( + initColor: int = ..., flags: int = ..., parent: _win32typing.PyCWnd | None = ... +) -> _win32typing.PyCColorDialog: ... +def CreateControl( + classId: str, + windowName: str, + style, + rect: tuple[Incomplete, Incomplete, Incomplete, Incomplete], + parent: _win32typing.PyCWnd, + _id, + bStorage, + obPersist: Incomplete | None = ..., + licKey: str | None = ..., +) -> _win32typing.PyCWnd: ... +def CreateControlBar() -> _win32typing.PyCControlBar: ... +def CreateCtrlView(doc: _win32typing.PyCDocument, className: str, style: int = ...) -> _win32typing.PyCCtrlView: ... +def CreateDC() -> None: ... +def CreateDCFromHandle(hwnd: int) -> _win32typing.PyCDC: ... +def CreateDialog(idRes, dll: _win32typing.PyDLL | None = ...) -> _win32typing.PyCDialog: ... +def CreateDialogBar() -> _win32typing.PyCDialogBar: ... +def CreateDialogIndirect(oblist) -> _win32typing.PyCDialog: ... +def CreatePrintDialog( + idRes, bPrintSetupOnly, dwFlags, parent: _win32typing.PyCWnd | None = ..., dll: _win32typing.PyDLL | None = ... +) -> _win32typing.PyCPrintDialog: ... +def CreateDocTemplate(idRes) -> _win32typing.PyCDocTemplate: ... +def CreateEdit() -> _win32typing.PyCEdit: ... +def CreateFileDialog( + bFileOpen, + arg, + defExt: str | None = ..., + fileName: str | None = ..., + _filter: str | None = ..., + parent: _win32typing.PyCWnd | None = ..., +) -> _win32typing.PyCFileDialog: ... +def CreateFontDialog( + arg, font: Incomplete | None = ..., dcPrinter: _win32typing.PyCDC | None = ..., parent: _win32typing.PyCWnd | None = ... +) -> _win32typing.PyCFontDialog: ... +def CreateFormView(doc: _win32typing.PyCDocument, Template) -> _win32typing.PyCFormView: ... +def CreateFrame(): ... +def CreateTreeCtrl() -> _win32typing.PyCTreeCtrl: ... +def CreateTreeView(doc: _win32typing.PyCDocument) -> _win32typing.PyCTreeView: ... +def CreatePalette(lp): ... +def CreatePopupMenu() -> _win32typing.PyCMenu: ... +def CreateMenu() -> _win32typing.PyCMenu: ... +def CreatePen(style, width, color): ... +def CreateProgressCtrl() -> _win32typing.PyCProgressCtrl: ... +def CreatePropertyPage(resource: _win32typing.PyResourceId, caption: int = ...) -> _win32typing.PyCPropertyPage: ... +def CreatePropertyPageIndirect(resourcelist: _win32typing.PyDialogTemplate, caption=...) -> _win32typing.PyCPropertyPage: ... +def CreatePropertySheet( + caption: _win32typing.PyResourceId, parent: _win32typing.PyCWnd | None = ..., select=... +) -> _win32typing.PyCPropertySheet: ... +def CreateRgn() -> _win32typing.PyCRgn: ... +def CreateRichEditCtrl() -> _win32typing.PyCRichEditCtrl: ... +def CreateRichEditDocTemplate(idRes) -> _win32typing.PyCRichEditDocTemplate: ... +def CreateRichEditView(doc: _win32typing.PyCDocument | None = ...) -> _win32typing.PyCRichEditView: ... +def CreateSliderCtrl() -> _win32typing.PyCSliderCtrl: ... +def CreateSplitter() -> _win32typing.PyCSplitterWnd: ... +def CreateStatusBar(parent: _win32typing.PyCWnd, arg, arg1, ctrlStype=...) -> _win32typing.PyCStatusBar: ... +def CreateStatusBarCtrl() -> _win32typing.PyCStatusBarCtrl: ... +def CreateFont(properties) -> _win32typing.PyCFont: ... +def CreateToolBar(parent: _win32typing.PyCWnd, style, arg) -> _win32typing.PyCToolBar: ... +def CreateToolBarCtrl() -> _win32typing.PyCToolBarCtrl: ... +def CreateToolTipCtrl() -> _win32typing.PyCToolTipCtrl: ... +def CreateThread() -> _win32typing.PyCWinThread: ... +def CreateView(doc: _win32typing.PyCDocument) -> _win32typing.PyCScrollView: ... +def CreateEditView(doc: _win32typing.PyCDocument) -> _win32typing.PyCEditView: ... +def CreateDebuggerThread() -> None: ... +def CreateWindowFromHandle(hwnd: int) -> _win32typing.PyCWnd: ... +def CreateWnd() -> _win32typing.PyCWnd: ... +def DestroyDebuggerThread() -> None: ... +def DoWaitCursor(code) -> None: ... +def DisplayTraceback() -> None: ... +def Enable3dControls(): ... +def FindWindow(className: str, windowName: str) -> _win32typing.PyCWnd: ... +def FindWindowEx( + parentWindow: _win32typing.PyCWnd, childAfter: _win32typing.PyCWnd, className: str, windowName: str +) -> _win32typing.PyCWnd: ... +def FullPath(path: str) -> str: ... +def GetActiveWindow() -> _win32typing.PyCWnd: ... +def GetApp() -> _win32typing.PyCWinApp: ... +def GetAppName(): ... +def GetAppRegistryKey() -> None: ... +def GetBytes(address, size) -> str: ... +def GetCommandLine() -> str: ... +def GetDeviceCaps(hdc, index): ... +def GetFileTitle(fileName: str) -> str: ... +def GetFocus() -> _win32typing.PyCWnd: ... +def GetForegroundWindow() -> _win32typing.PyCWnd: ... +def GetHalftoneBrush() -> _win32typing.PyCBrush: ... +def GetInitialStateRequest(): ... +def GetMainFrame() -> _win32typing.PyCWnd: ... +def GetName() -> str: ... +def GetProfileFileName() -> str: ... +def GetProfileVal(section: str, entry: str, defValue: str) -> str: ... +def GetResource() -> _win32typing.PyDLL: ... +def GetThread() -> _win32typing.PyCWinApp: ... +def GetType(): ... +def InitRichEdit() -> str: ... +def InstallCallbackCaller(): ... +def IsDebug() -> int: ... +def IsWin32s() -> int: ... +def IsObject(__o: object) -> bool: ... +def LoadDialogResource(idRes, dll: _win32typing.PyDLL | None = ...): ... +def LoadLibrary(fileName: str) -> _win32typing.PyDLL: ... +def LoadMenu(_id, dll: _win32typing.PyDLL | None = ...) -> _win32typing.PyCMenu: ... +def LoadStdProfileSettings(maxFiles) -> None: ... +def LoadString(stringId) -> str: ... +def MessageBox(message: str, arg, title: str | None = ...): ... +def OutputDebugString(msg: str) -> None: ... +def EnableControlContainer(): ... +def PrintTraceback(tb, output) -> None: ... +def PumpWaitingMessages(__firstMessage: int = ..., __lastMessage: int = ...) -> int: ... +def RegisterWndClass(style, hCursor: int = ..., hBrush: int = ..., hIcon=...) -> str: ... +def RemoveRecentFile(index: int = ...) -> None: ... +def SetAppHelpPath(): ... +def SetAppName(appName: str): ... +def SetCurrentInstanceHandle(newVal): ... +def SetCurrentResourceHandle(newVal): ... +def SetDialogBkColor(arg, arg1): ... +def SetProfileFileName(filename: str) -> None: ... +def SetRegistryKey(key: str) -> None: ... +def SetResource(dll) -> _win32typing.PyDLL: ... +def SetStatusText(msg: str, bForce: int = ...) -> None: ... +def StartDebuggerPump() -> None: ... +def StopDebuggerPump() -> None: ... +def TranslateMessage(): ... +def TranslateVirtualKey(vk) -> str: ... +def WinHelp(arg, data: str) -> None: ... +def WriteProfileVal(section: str, entry: str, value: str) -> None: ... +def AddToRecentFileList(*args, **kwargs): ... # incomplete +def CreateImageList(*args, **kwargs): ... # incomplete +def CreateListCtrl(*args, **kwargs): ... # incomplete +def CreateListView(*args, **kwargs): ... # incomplete +def CreateRectRgn(*args, **kwargs): ... # incomplete +def GetRecentFileList(*args, **kwargs): ... # incomplete +def OutputDebug(*args, **kwargs): ... # incomplete + +AFX_IDW_PANE_FIRST: int +AFX_IDW_PANE_LAST: int +AFX_WS_DEFAULT_VIEW: int +CDocTemplate_Confidence_maybeAttemptForeign: int +CDocTemplate_Confidence_maybeAttemptNative: int +CDocTemplate_Confidence_noAttempt: int +CDocTemplate_Confidence_yesAlreadyOpen: int +CDocTemplate_Confidence_yesAttemptForeign: int +CDocTemplate_Confidence_yesAttemptNative: int +CDocTemplate_docName: int +CDocTemplate_fileNewName: int +CDocTemplate_filterExt: int +CDocTemplate_filterName: int +CDocTemplate_regFileTypeId: int +CDocTemplate_regFileTypeName: int +CDocTemplate_windowTitle: int +CRichEditView_WrapNone: int +CRichEditView_WrapToTargetDevice: int +CRichEditView_WrapToWindow: int +debug: int +FWS_ADDTOTITLE: int +FWS_PREFIXTITLE: int +FWS_SNAPTOBARS: int +ID_APP_ABOUT: int +ID_APP_EXIT: int +ID_EDIT_CLEAR: int +ID_EDIT_CLEAR_ALL: int +ID_EDIT_COPY: int +ID_EDIT_CUT: int +ID_EDIT_FIND: int +ID_EDIT_GOTO_LINE: int +ID_EDIT_PASTE: int +ID_EDIT_REDO: int +ID_EDIT_REPEAT: int +ID_EDIT_REPLACE: int +ID_EDIT_SELECT_ALL: int +ID_EDIT_SELECT_BLOCK: int +ID_EDIT_UNDO: int +ID_FILE_CHECK: int +ID_FILE_CLOSE: int +ID_FILE_IMPORT: int +ID_FILE_LOCATE: int +ID_FILE_MRU_FILE1: int +ID_FILE_MRU_FILE2: int +ID_FILE_MRU_FILE3: int +ID_FILE_MRU_FILE4: int +ID_FILE_NEW: int +ID_FILE_OPEN: int +ID_FILE_PAGE_SETUP: int +ID_FILE_PRINT: int +ID_FILE_PRINT_PREVIEW: int +ID_FILE_PRINT_SETUP: int +ID_FILE_RUN: int +ID_FILE_SAVE: int +ID_FILE_SAVE_ALL: int +ID_FILE_SAVE_AS: int +ID_HELP_GUI_REF: int +ID_HELP_OTHER: int +ID_HELP_PYTHON: int +ID_INDICATOR_COLNUM: int +ID_INDICATOR_LINENUM: int +ID_NEXT_PANE: int +ID_PREV_PANE: int +ID_SEPARATOR: int +ID_VIEW_BROWSE: int +ID_VIEW_EOL: int +ID_VIEW_FIXED_FONT: int +ID_VIEW_FOLD_COLLAPSE: int +ID_VIEW_FOLD_COLLAPSE_ALL: int +ID_VIEW_FOLD_EXPAND: int +ID_VIEW_FOLD_EXPAND_ALL: int +ID_VIEW_INDENTATIONGUIDES: int +ID_VIEW_INTERACTIVE: int +ID_VIEW_OPTIONS: int +ID_VIEW_RIGHT_EDGE: int +ID_VIEW_STATUS_BAR: int +ID_VIEW_TOOLBAR: int +ID_VIEW_TOOLBAR_DBG: int +ID_VIEW_WHITESPACE: int +ID_WINDOW_ARRANGE: int +ID_WINDOW_CASCADE: int +ID_WINDOW_NEW: int +ID_WINDOW_SPLIT: int +ID_WINDOW_TILE_HORZ: int +ID_WINDOW_TILE_VERT: int +IDB_BROWSER_HIER: int +IDB_DEBUGGER_HIER: int +IDB_HIERFOLDERS: int +IDC_ABOUT_VERSION: int +IDC_AUTO_RELOAD: int +IDC_AUTOCOMPLETE: int +IDC_BUTTON1: int +IDC_BUTTON2: int +IDC_BUTTON3: int +IDC_BUTTON4: int +IDC_CALLTIPS: int +IDC_CHECK1: int +IDC_CHECK2: int +IDC_CHECK3: int +IDC_COMBO1: int +IDC_COMBO2: int +IDC_EDIT1: int +IDC_EDIT2: int +IDC_EDIT3: int +IDC_EDIT4: int +IDC_EDIT_TABS: int +IDC_INDENT_SIZE: int +IDC_KEYBOARD_CONFIG: int +IDC_PROMPT1: int +IDC_PROMPT2: int +IDC_PROMPT3: int +IDC_PROMPT4: int +IDC_PROMPT_TABS: int +IDC_RADIO1: int +IDC_RADIO2: int +IDC_RIGHTEDGE_COLUMN: int +IDC_RIGHTEDGE_DEFINE: int +IDC_RIGHTEDGE_ENABLE: int +IDC_RIGHTEDGE_SAMPLE: int +IDC_SPIN1: int +IDC_SPIN2: int +IDC_SPIN3: int +IDC_TAB_SIZE: int +IDC_USE_SMART_TABS: int +IDC_USE_TABS: int +IDC_VIEW_WHITESPACE: int +IDC_VSS_INTEGRATE: int +IDD_ABOUTBOX: int +IDD_DUMMYPROPPAGE: int +IDD_GENERAL_STATUS: int +IDD_LARGE_EDIT: int +IDD_PP_DEBUGGER: int +IDD_PP_EDITOR: int +IDD_PP_FORMAT: int +IDD_PP_IDE: int +IDD_PP_TABS: int +IDD_PP_TOOLMENU: int +IDD_PROPDEMO1: int +IDD_PROPDEMO2: int +IDD_RUN_SCRIPT: int +IDD_SET_TABSTOPS: int +IDD_SIMPLE_INPUT: int +IDD_TREE: int +IDD_TREE_MB: int +IDR_CNTR_INPLACE: int +IDR_DEBUGGER: int +IDR_MAINFRAME: int +IDR_PYTHONCONTYPE: int +IDR_PYTHONTYPE: int +IDR_PYTHONTYPE_CNTR_IP: int +IDR_TEXTTYPE: int +LM_COMMIT: int +LM_HORZ: int +LM_HORZDOCK: int +LM_LENGTHY: int +LM_MRUWIDTH: int +LM_STRETCH: int +LM_VERTDOCK: int +MFS_4THICKFRAME: int +MFS_BLOCKSYSMENU: int +MFS_MOVEFRAME: int +MFS_SYNCACTIVE: int +MFS_THICKFRAME: int +PD_ALLPAGES: int +PD_COLLATE: int +PD_DISABLEPRINTTOFILE: int +PD_ENABLEPRINTHOOK: int +PD_ENABLEPRINTTEMPLATE: int +PD_ENABLEPRINTTEMPLATEHANDLE: int +PD_ENABLESETUPHOOK: int +PD_ENABLESETUPTEMPLATE: int +PD_ENABLESETUPTEMPLATEHANDLE: int +PD_HIDEPRINTTOFILE: int +PD_NONETWORKBUTTON: int +PD_NOPAGENUMS: int +PD_NOSELECTION: int +PD_NOWARNING: int +PD_PAGENUMS: int +PD_PRINTSETUP: int +PD_PRINTTOFILE: int +PD_RETURNDC: int +PD_RETURNDEFAULT: int +PD_RETURNIC: int +PD_SELECTION: int +PD_SHOWHELP: int +PD_USEDEVMODECOPIES: int +PD_USEDEVMODECOPIESANDCOLLATE: int +PSWIZB_BACK: int +PSWIZB_DISABLEDFINISH: int +PSWIZB_FINISH: int +PSWIZB_NEXT: int +IDC_DBG_ADD: int +IDC_DBG_BREAKPOINTS: int +IDC_DBG_CLEAR: int +IDC_DBG_CLOSE: int +IDC_DBG_GO: int +IDC_DBG_STACK: int +IDC_DBG_STEP: int +IDC_DBG_STEPOUT: int +IDC_DBG_STEPOVER: int +IDC_DBG_WATCH: int +IDC_EDITOR_COLOR: int +IDC_FOLD_ENABLE: int +IDC_FOLD_ON_OPEN: int +IDC_FOLD_SHOW_LINES: int +IDC_LIST1: int +IDC_MARGIN_FOLD: int +IDC_MARGIN_LINENUMBER: int +IDC_MARGIN_MARKER: int +IDC_TABTIMMY_BG: int +IDC_TABTIMMY_IND: int +IDC_TABTIMMY_NONE: int +IDC_VIEW_EOL: int +IDC_VIEW_INDENTATIONGUIDES: int +ID_VIEW_FOLD_TOPLEVEL: int +UNICODE: int +copyright: str +dllhandle: int +types: dict[str, type] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/pythonwin/win32uiole.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/pythonwin/win32uiole.pyi new file mode 100644 index 000000000..5d30d75eb --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/pythonwin/win32uiole.pyi @@ -0,0 +1,25 @@ +import _win32typing + +def AfxOleInit(enabled) -> None: ... +def CreateInsertDialog() -> _win32typing.PyCOleInsertDialog: ... +def CreateOleClientItem() -> _win32typing.PyCOleClientItem: ... +def CreateOleDocument(template: _win32typing.PyCDocTemplate, fileName: str | None = ...) -> _win32typing.PyCOleDocument: ... +def DaoGetEngine() -> _win32typing.PyIDispatch: ... +def GetIDispatchForWindow() -> _win32typing.PyIDispatch: ... +def OleGetUserCtrl(): ... +def OleSetUserCtrl(bUserCtrl): ... +def SetMessagePendingDelay(delay) -> None: ... +def EnableNotRespondingDialog(enabled) -> None: ... +def EnableBusyDialog(*args, **kwargs): ... # incomplete + +COleClientItem_activeState: int +COleClientItem_activeUIState: int +COleClientItem_emptyState: int +COleClientItem_loadedState: int +COleClientItem_openState: int +OLE_CHANGED: int +OLE_CHANGED_ASPECT: int +OLE_CHANGED_STATE: int +OLE_CLOSED: int +OLE_RENAMED: int +OLE_SAVED: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/pywintypes.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/pywintypes.pyi new file mode 100644 index 000000000..64c9f845c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/pywintypes.pyi @@ -0,0 +1 @@ +from win32.lib.pywintypes import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/regutil.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/regutil.pyi new file mode 100644 index 000000000..ef4d7a48c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/regutil.pyi @@ -0,0 +1 @@ +from win32.lib.regutil import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/servicemanager.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/servicemanager.pyi new file mode 100644 index 000000000..91dbd2893 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/servicemanager.pyi @@ -0,0 +1 @@ +from win32.servicemanager import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/sspicon.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/sspicon.pyi new file mode 100644 index 000000000..0618e191e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/sspicon.pyi @@ -0,0 +1 @@ +from win32.lib.sspicon import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/timer.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/timer.pyi new file mode 100644 index 000000000..d3d280166 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/timer.pyi @@ -0,0 +1 @@ +from win32.timer import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win2kras.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win2kras.pyi new file mode 100644 index 000000000..e9b12664e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win2kras.pyi @@ -0,0 +1 @@ +from win32.lib.win2kras import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/__init__.pyi new file mode 100644 index 000000000..e69de29bb diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/_wincerapi.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/_wincerapi.pyi new file mode 100644 index 000000000..a8834cc80 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/_wincerapi.pyi @@ -0,0 +1,71 @@ +from _typeshed import Incomplete + +import _win32typing + +def CeRapiInit() -> None: ... +def CeRapiUninit() -> None: ... +def CreateProcess( + __appName: str | None, + __commandLine: str, + __processAttributes: _win32typing.PySECURITY_ATTRIBUTES | None, + __threadAttributes: _win32typing.PySECURITY_ATTRIBUTES | None, + __bInheritHandles: int | bool, + __dwCreationFlags: int, + __newEnvironment: dict[str, str] | None, + __currentDirectory: str | None, + __startupinfo: _win32typing.PySTARTUPINFO, +) -> tuple[int, int, Incomplete, Incomplete]: ... +def CeRapiInitEx(): ... +def CeCopyFile(_from: str, to: str, bFailIfExists) -> None: ... +def CeCheckPassword(password: str) -> None: ... +def CeCreateFile( + fileName: str, + desiredAccess, + shareMode, + attributes: _win32typing.PySECURITY_ATTRIBUTES, + creationDisposition, + flagsAndAttributes, + hTemplateFile: int, +) -> _win32typing.PyCEHANDLE: ... +def CeDeleteFile(fileName: str) -> None: ... +def CeMoveFile(existingFileName: str, newFileName: str) -> None: ... +def CeCreateDirectory(name: str, sa: _win32typing.PySECURITY_ATTRIBUTES) -> None: ... +def CeRemoveDirectory(lpPathName: str) -> None: ... +def CeGetTempPath() -> str: ... +def CeGetSystemInfo(): ... +def CeGetDesktopDeviceCaps(): ... +def CeGetSystemMetrics(): ... +def CeGetSpecialFolderPath() -> str: ... +def CeGetStoreInformation() -> tuple[Incomplete, Incomplete]: ... +def CeGetSystemPowerStatusEx(): ... +def CeSHCreateShortcut() -> None: ... +def CeSHGetShortcutTarget(): ... +def CeGetVersionEx() -> tuple[Incomplete, Incomplete, Incomplete, Incomplete, str]: ... +def CeGlobalMemoryStatus(): ... +def FindFiles(fileSpec: str): ... +def CeGetFileAttributes(fileName: str): ... +def CeSetFileAttributes(filename: str, newAttributes) -> None: ... +def CeGetFileSize(): ... +def CeReadFile(hFile: int, bufSize) -> str: ... +def WriteFile(__hFile: int, __data: str | bytes | _win32typing.PyOVERLAPPEDReadBuffer) -> tuple[int, int]: ... + +CSIDL_BITBUCKET = ... +CSIDL_COMMON_DESKTOPDIRECTORY = ... +CSIDL_COMMON_PROGRAMS = ... +CSIDL_COMMON_STARTMENU = ... +CSIDL_COMMON_STARTUP = ... +CSIDL_CONTROLS = ... +CSIDL_DESKTOP = ... +CSIDL_DESKTOPDIRECTORY = ... +CSIDL_DRIVES = ... +CSIDL_FONTS = ... +CSIDL_NETHOOD = ... +CSIDL_NETWORK = ... +CSIDL_PERSONAL = ... +CSIDL_PRINTERS = ... +CSIDL_PROGRAMS = ... +CSIDL_RECENT = ... +CSIDL_SENDTO = ... +CSIDL_STARTMENU = ... +CSIDL_STARTUP = ... +CSIDL_TEMPLATES = ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/__init__.pyi new file mode 100644 index 000000000..e69de29bb diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/afxres.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/afxres.pyi new file mode 100644 index 000000000..58a208695 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/afxres.pyi @@ -0,0 +1,499 @@ +from _typeshed import Incomplete + +TCS_MULTILINE: int +CBRS_ALIGN_LEFT: int +CBRS_ALIGN_TOP: int +CBRS_ALIGN_RIGHT: int +CBRS_ALIGN_BOTTOM: int +CBRS_ALIGN_ANY: int +CBRS_BORDER_LEFT: int +CBRS_BORDER_TOP: int +CBRS_BORDER_RIGHT: int +CBRS_BORDER_BOTTOM: int +CBRS_BORDER_ANY: int +CBRS_TOOLTIPS: int +CBRS_FLYBY: int +CBRS_FLOAT_MULTI: int +CBRS_BORDER_3D: int +CBRS_HIDE_INPLACE: int +CBRS_SIZE_DYNAMIC: int +CBRS_SIZE_FIXED: int +CBRS_FLOATING: int +CBRS_GRIPPER: int +CBRS_ORIENT_HORZ: Incomplete +CBRS_ORIENT_VERT: Incomplete +CBRS_ORIENT_ANY: Incomplete +CBRS_ALL: int +CBRS_NOALIGN: int +CBRS_LEFT: Incomplete +CBRS_TOP: Incomplete +CBRS_RIGHT: Incomplete +CBRS_BOTTOM: Incomplete +SBPS_NORMAL: int +SBPS_NOBORDERS: int +SBPS_POPOUT: int +SBPS_OWNERDRAW: int +SBPS_DISABLED: int +SBPS_STRETCH: int +ID_INDICATOR_EXT: int +ID_INDICATOR_CAPS: int +ID_INDICATOR_NUM: int +ID_INDICATOR_SCRL: int +ID_INDICATOR_OVR: int +ID_INDICATOR_REC: int +ID_INDICATOR_KANA: int +ID_SEPARATOR: int +AFX_IDW_CONTROLBAR_FIRST: int +AFX_IDW_CONTROLBAR_LAST: int +AFX_IDW_TOOLBAR: int +AFX_IDW_STATUS_BAR: int +AFX_IDW_PREVIEW_BAR: int +AFX_IDW_RESIZE_BAR: int +AFX_IDW_DOCKBAR_TOP: int +AFX_IDW_DOCKBAR_LEFT: int +AFX_IDW_DOCKBAR_RIGHT: int +AFX_IDW_DOCKBAR_BOTTOM: int +AFX_IDW_DOCKBAR_FLOAT: int + +def AFX_CONTROLBAR_MASK(nIDC): ... + +AFX_IDW_PANE_FIRST: int +AFX_IDW_PANE_LAST: int +AFX_IDW_HSCROLL_FIRST: int +AFX_IDW_VSCROLL_FIRST: int +AFX_IDW_SIZE_BOX: int +AFX_IDW_PANE_SAVE: int +AFX_IDS_APP_TITLE: int +AFX_IDS_IDLEMESSAGE: int +AFX_IDS_HELPMODEMESSAGE: int +AFX_IDS_APP_TITLE_EMBEDDING: int +AFX_IDS_COMPANY_NAME: int +AFX_IDS_OBJ_TITLE_INPLACE: int +ID_FILE_NEW: int +ID_FILE_OPEN: int +ID_FILE_CLOSE: int +ID_FILE_SAVE: int +ID_FILE_SAVE_AS: int +ID_FILE_PAGE_SETUP: int +ID_FILE_PRINT_SETUP: int +ID_FILE_PRINT: int +ID_FILE_PRINT_DIRECT: int +ID_FILE_PRINT_PREVIEW: int +ID_FILE_UPDATE: int +ID_FILE_SAVE_COPY_AS: int +ID_FILE_SEND_MAIL: int +ID_FILE_MRU_FIRST: int +ID_FILE_MRU_FILE1: int +ID_FILE_MRU_FILE2: int +ID_FILE_MRU_FILE3: int +ID_FILE_MRU_FILE4: int +ID_FILE_MRU_FILE5: int +ID_FILE_MRU_FILE6: int +ID_FILE_MRU_FILE7: int +ID_FILE_MRU_FILE8: int +ID_FILE_MRU_FILE9: int +ID_FILE_MRU_FILE10: int +ID_FILE_MRU_FILE11: int +ID_FILE_MRU_FILE12: int +ID_FILE_MRU_FILE13: int +ID_FILE_MRU_FILE14: int +ID_FILE_MRU_FILE15: int +ID_FILE_MRU_FILE16: int +ID_FILE_MRU_LAST: int +ID_EDIT_CLEAR: int +ID_EDIT_CLEAR_ALL: int +ID_EDIT_COPY: int +ID_EDIT_CUT: int +ID_EDIT_FIND: int +ID_EDIT_PASTE: int +ID_EDIT_PASTE_LINK: int +ID_EDIT_PASTE_SPECIAL: int +ID_EDIT_REPEAT: int +ID_EDIT_REPLACE: int +ID_EDIT_SELECT_ALL: int +ID_EDIT_UNDO: int +ID_EDIT_REDO: int +ID_WINDOW_NEW: int +ID_WINDOW_ARRANGE: int +ID_WINDOW_CASCADE: int +ID_WINDOW_TILE_HORZ: int +ID_WINDOW_TILE_VERT: int +ID_WINDOW_SPLIT: int +AFX_IDM_WINDOW_FIRST: int +AFX_IDM_WINDOW_LAST: int +AFX_IDM_FIRST_MDICHILD: int +ID_APP_ABOUT: int +ID_APP_EXIT: int +ID_HELP_INDEX: int +ID_HELP_FINDER: int +ID_HELP_USING: int +ID_CONTEXT_HELP: int +ID_HELP: int +ID_DEFAULT_HELP: int +ID_NEXT_PANE: int +ID_PREV_PANE: int +ID_FORMAT_FONT: int +ID_OLE_INSERT_NEW: int +ID_OLE_EDIT_LINKS: int +ID_OLE_EDIT_CONVERT: int +ID_OLE_EDIT_CHANGE_ICON: int +ID_OLE_EDIT_PROPERTIES: int +ID_OLE_VERB_FIRST: int +ID_OLE_VERB_LAST: int +AFX_ID_PREVIEW_CLOSE: int +AFX_ID_PREVIEW_NUMPAGE: int +AFX_ID_PREVIEW_NEXT: int +AFX_ID_PREVIEW_PREV: int +AFX_ID_PREVIEW_PRINT: int +AFX_ID_PREVIEW_ZOOMIN: int +AFX_ID_PREVIEW_ZOOMOUT: int +ID_VIEW_TOOLBAR: int +ID_VIEW_STATUS_BAR: int +ID_RECORD_FIRST: int +ID_RECORD_LAST: int +ID_RECORD_NEXT: int +ID_RECORD_PREV: int +IDC_STATIC: int +AFX_IDS_SCFIRST: int +AFX_IDS_SCSIZE: int +AFX_IDS_SCMOVE: int +AFX_IDS_SCMINIMIZE: int +AFX_IDS_SCMAXIMIZE: int +AFX_IDS_SCNEXTWINDOW: int +AFX_IDS_SCPREVWINDOW: int +AFX_IDS_SCCLOSE: int +AFX_IDS_SCRESTORE: int +AFX_IDS_SCTASKLIST: int +AFX_IDS_MDICHILD: int +AFX_IDS_DESKACCESSORY: int +AFX_IDS_OPENFILE: int +AFX_IDS_SAVEFILE: int +AFX_IDS_ALLFILTER: int +AFX_IDS_UNTITLED: int +AFX_IDS_SAVEFILECOPY: int +AFX_IDS_PREVIEW_CLOSE: int +AFX_IDS_UNNAMED_FILE: int +AFX_IDS_ABOUT: int +AFX_IDS_HIDE: int +AFX_IDP_NO_ERROR_AVAILABLE: int +AFX_IDS_NOT_SUPPORTED_EXCEPTION: int +AFX_IDS_RESOURCE_EXCEPTION: int +AFX_IDS_MEMORY_EXCEPTION: int +AFX_IDS_USER_EXCEPTION: int +AFX_IDS_PRINTONPORT: int +AFX_IDS_ONEPAGE: int +AFX_IDS_TWOPAGE: int +AFX_IDS_PRINTPAGENUM: int +AFX_IDS_PREVIEWPAGEDESC: int +AFX_IDS_PRINTDEFAULTEXT: int +AFX_IDS_PRINTDEFAULT: int +AFX_IDS_PRINTFILTER: int +AFX_IDS_PRINTCAPTION: int +AFX_IDS_PRINTTOFILE: int +AFX_IDS_OBJECT_MENUITEM: int +AFX_IDS_EDIT_VERB: int +AFX_IDS_ACTIVATE_VERB: int +AFX_IDS_CHANGE_LINK: int +AFX_IDS_AUTO: int +AFX_IDS_MANUAL: int +AFX_IDS_FROZEN: int +AFX_IDS_ALL_FILES: int +AFX_IDS_SAVE_MENU: int +AFX_IDS_UPDATE_MENU: int +AFX_IDS_SAVE_AS_MENU: int +AFX_IDS_SAVE_COPY_AS_MENU: int +AFX_IDS_EXIT_MENU: int +AFX_IDS_UPDATING_ITEMS: int +AFX_IDS_METAFILE_FORMAT: int +AFX_IDS_DIB_FORMAT: int +AFX_IDS_BITMAP_FORMAT: int +AFX_IDS_LINKSOURCE_FORMAT: int +AFX_IDS_EMBED_FORMAT: int +AFX_IDS_PASTELINKEDTYPE: int +AFX_IDS_UNKNOWNTYPE: int +AFX_IDS_RTF_FORMAT: int +AFX_IDS_TEXT_FORMAT: int +AFX_IDS_INVALID_CURRENCY: int +AFX_IDS_INVALID_DATETIME: int +AFX_IDS_INVALID_DATETIMESPAN: int +AFX_IDP_INVALID_FILENAME: int +AFX_IDP_FAILED_TO_OPEN_DOC: int +AFX_IDP_FAILED_TO_SAVE_DOC: int +AFX_IDP_ASK_TO_SAVE: int +AFX_IDP_FAILED_TO_CREATE_DOC: int +AFX_IDP_FILE_TOO_LARGE: int +AFX_IDP_FAILED_TO_START_PRINT: int +AFX_IDP_FAILED_TO_LAUNCH_HELP: int +AFX_IDP_INTERNAL_FAILURE: int +AFX_IDP_COMMAND_FAILURE: int +AFX_IDP_FAILED_MEMORY_ALLOC: int +AFX_IDP_PARSE_INT: int +AFX_IDP_PARSE_REAL: int +AFX_IDP_PARSE_INT_RANGE: int +AFX_IDP_PARSE_REAL_RANGE: int +AFX_IDP_PARSE_STRING_SIZE: int +AFX_IDP_PARSE_RADIO_BUTTON: int +AFX_IDP_PARSE_BYTE: int +AFX_IDP_PARSE_UINT: int +AFX_IDP_PARSE_DATETIME: int +AFX_IDP_PARSE_CURRENCY: int +AFX_IDP_FAILED_INVALID_FORMAT: int +AFX_IDP_FAILED_INVALID_PATH: int +AFX_IDP_FAILED_DISK_FULL: int +AFX_IDP_FAILED_ACCESS_READ: int +AFX_IDP_FAILED_ACCESS_WRITE: int +AFX_IDP_FAILED_IO_ERROR_READ: int +AFX_IDP_FAILED_IO_ERROR_WRITE: int +AFX_IDP_STATIC_OBJECT: int +AFX_IDP_FAILED_TO_CONNECT: int +AFX_IDP_SERVER_BUSY: int +AFX_IDP_BAD_VERB: int +AFX_IDP_FAILED_TO_NOTIFY: int +AFX_IDP_FAILED_TO_LAUNCH: int +AFX_IDP_ASK_TO_UPDATE: int +AFX_IDP_FAILED_TO_UPDATE: int +AFX_IDP_FAILED_TO_REGISTER: int +AFX_IDP_FAILED_TO_AUTO_REGISTER: int +AFX_IDP_FAILED_TO_CONVERT: int +AFX_IDP_GET_NOT_SUPPORTED: int +AFX_IDP_SET_NOT_SUPPORTED: int +AFX_IDP_ASK_TO_DISCARD: int +AFX_IDP_FAILED_TO_CREATE: int +AFX_IDP_FAILED_MAPI_LOAD: int +AFX_IDP_INVALID_MAPI_DLL: int +AFX_IDP_FAILED_MAPI_SEND: int +AFX_IDP_FILE_NONE: int +AFX_IDP_FILE_GENERIC: int +AFX_IDP_FILE_NOT_FOUND: int +AFX_IDP_FILE_BAD_PATH: int +AFX_IDP_FILE_TOO_MANY_OPEN: int +AFX_IDP_FILE_ACCESS_DENIED: int +AFX_IDP_FILE_INVALID_FILE: int +AFX_IDP_FILE_REMOVE_CURRENT: int +AFX_IDP_FILE_DIR_FULL: int +AFX_IDP_FILE_BAD_SEEK: int +AFX_IDP_FILE_HARD_IO: int +AFX_IDP_FILE_SHARING: int +AFX_IDP_FILE_LOCKING: int +AFX_IDP_FILE_DISKFULL: int +AFX_IDP_FILE_EOF: int +AFX_IDP_ARCH_NONE: int +AFX_IDP_ARCH_GENERIC: int +AFX_IDP_ARCH_READONLY: int +AFX_IDP_ARCH_ENDOFFILE: int +AFX_IDP_ARCH_WRITEONLY: int +AFX_IDP_ARCH_BADINDEX: int +AFX_IDP_ARCH_BADCLASS: int +AFX_IDP_ARCH_BADSCHEMA: int +AFX_IDS_OCC_SCALEUNITS_PIXELS: int +AFX_IDS_STATUS_FONT: int +AFX_IDS_TOOLTIP_FONT: int +AFX_IDS_UNICODE_FONT: int +AFX_IDS_MINI_FONT: int +AFX_IDP_SQL_FIRST: int +AFX_IDP_SQL_CONNECT_FAIL: int +AFX_IDP_SQL_RECORDSET_FORWARD_ONLY: int +AFX_IDP_SQL_EMPTY_COLUMN_LIST: int +AFX_IDP_SQL_FIELD_SCHEMA_MISMATCH: int +AFX_IDP_SQL_ILLEGAL_MODE: int +AFX_IDP_SQL_MULTIPLE_ROWS_AFFECTED: int +AFX_IDP_SQL_NO_CURRENT_RECORD: int +AFX_IDP_SQL_NO_ROWS_AFFECTED: int +AFX_IDP_SQL_RECORDSET_READONLY: int +AFX_IDP_SQL_SQL_NO_TOTAL: int +AFX_IDP_SQL_ODBC_LOAD_FAILED: int +AFX_IDP_SQL_DYNASET_NOT_SUPPORTED: int +AFX_IDP_SQL_SNAPSHOT_NOT_SUPPORTED: int +AFX_IDP_SQL_API_CONFORMANCE: int +AFX_IDP_SQL_SQL_CONFORMANCE: int +AFX_IDP_SQL_NO_DATA_FOUND: int +AFX_IDP_SQL_ROW_UPDATE_NOT_SUPPORTED: int +AFX_IDP_SQL_ODBC_V2_REQUIRED: int +AFX_IDP_SQL_NO_POSITIONED_UPDATES: int +AFX_IDP_SQL_LOCK_MODE_NOT_SUPPORTED: int +AFX_IDP_SQL_DATA_TRUNCATED: int +AFX_IDP_SQL_ROW_FETCH: int +AFX_IDP_SQL_INCORRECT_ODBC: int +AFX_IDP_SQL_UPDATE_DELETE_FAILED: int +AFX_IDP_SQL_DYNAMIC_CURSOR_NOT_SUPPORTED: int +AFX_IDP_DAO_FIRST: int +AFX_IDP_DAO_ENGINE_INITIALIZATION: int +AFX_IDP_DAO_DFX_BIND: int +AFX_IDP_DAO_OBJECT_NOT_OPEN: int +AFX_IDP_DAO_ROWTOOSHORT: int +AFX_IDP_DAO_BADBINDINFO: int +AFX_IDP_DAO_COLUMNUNAVAILABLE: int +AFX_IDC_LISTBOX: int +AFX_IDC_CHANGE: int +AFX_IDC_PRINT_DOCNAME: int +AFX_IDC_PRINT_PRINTERNAME: int +AFX_IDC_PRINT_PORTNAME: int +AFX_IDC_PRINT_PAGENUM: int +ID_APPLY_NOW: int +ID_WIZBACK: int +ID_WIZNEXT: int +ID_WIZFINISH: int +AFX_IDC_TAB_CONTROL: int +AFX_IDD_FILEOPEN: int +AFX_IDD_FILESAVE: int +AFX_IDD_FONT: int +AFX_IDD_COLOR: int +AFX_IDD_PRINT: int +AFX_IDD_PRINTSETUP: int +AFX_IDD_FIND: int +AFX_IDD_REPLACE: int +AFX_IDD_NEWTYPEDLG: int +AFX_IDD_PRINTDLG: int +AFX_IDD_PREVIEW_TOOLBAR: int +AFX_IDD_PREVIEW_SHORTTOOLBAR: int +AFX_IDD_INSERTOBJECT: int +AFX_IDD_CHANGEICON: int +AFX_IDD_CONVERT: int +AFX_IDD_PASTESPECIAL: int +AFX_IDD_EDITLINKS: int +AFX_IDD_FILEBROWSE: int +AFX_IDD_BUSY: int +AFX_IDD_OBJECTPROPERTIES: int +AFX_IDD_CHANGESOURCE: int +AFX_IDC_CONTEXTHELP: int +AFX_IDC_MAGNIFY: int +AFX_IDC_SMALLARROWS: int +AFX_IDC_HSPLITBAR: int +AFX_IDC_VSPLITBAR: int +AFX_IDC_NODROPCRSR: int +AFX_IDC_TRACKNWSE: int +AFX_IDC_TRACKNESW: int +AFX_IDC_TRACKNS: int +AFX_IDC_TRACKWE: int +AFX_IDC_TRACK4WAY: int +AFX_IDC_MOVE4WAY: int +AFX_IDB_MINIFRAME_MENU: int +AFX_IDB_CHECKLISTBOX_NT: int +AFX_IDB_CHECKLISTBOX_95: int +AFX_IDR_PREVIEW_ACCEL: int +AFX_IDI_STD_MDIFRAME: int +AFX_IDI_STD_FRAME: int +AFX_IDC_FONTPROP: int +AFX_IDC_FONTNAMES: int +AFX_IDC_FONTSTYLES: int +AFX_IDC_FONTSIZES: int +AFX_IDC_STRIKEOUT: int +AFX_IDC_UNDERLINE: int +AFX_IDC_SAMPLEBOX: int +AFX_IDC_COLOR_BLACK: int +AFX_IDC_COLOR_WHITE: int +AFX_IDC_COLOR_RED: int +AFX_IDC_COLOR_GREEN: int +AFX_IDC_COLOR_BLUE: int +AFX_IDC_COLOR_YELLOW: int +AFX_IDC_COLOR_MAGENTA: int +AFX_IDC_COLOR_CYAN: int +AFX_IDC_COLOR_GRAY: int +AFX_IDC_COLOR_LIGHTGRAY: int +AFX_IDC_COLOR_DARKRED: int +AFX_IDC_COLOR_DARKGREEN: int +AFX_IDC_COLOR_DARKBLUE: int +AFX_IDC_COLOR_LIGHTBROWN: int +AFX_IDC_COLOR_DARKMAGENTA: int +AFX_IDC_COLOR_DARKCYAN: int +AFX_IDC_COLORPROP: int +AFX_IDC_SYSTEMCOLORS: int +AFX_IDC_PROPNAME: int +AFX_IDC_PICTURE: int +AFX_IDC_BROWSE: int +AFX_IDC_CLEAR: int +AFX_IDD_PROPPAGE_COLOR: int +AFX_IDD_PROPPAGE_FONT: int +AFX_IDD_PROPPAGE_PICTURE: int +AFX_IDB_TRUETYPE: int +AFX_IDS_PROPPAGE_UNKNOWN: int +AFX_IDS_COLOR_DESKTOP: int +AFX_IDS_COLOR_APPWORKSPACE: int +AFX_IDS_COLOR_WNDBACKGND: int +AFX_IDS_COLOR_WNDTEXT: int +AFX_IDS_COLOR_MENUBAR: int +AFX_IDS_COLOR_MENUTEXT: int +AFX_IDS_COLOR_ACTIVEBAR: int +AFX_IDS_COLOR_INACTIVEBAR: int +AFX_IDS_COLOR_ACTIVETEXT: int +AFX_IDS_COLOR_INACTIVETEXT: int +AFX_IDS_COLOR_ACTIVEBORDER: int +AFX_IDS_COLOR_INACTIVEBORDER: int +AFX_IDS_COLOR_WNDFRAME: int +AFX_IDS_COLOR_SCROLLBARS: int +AFX_IDS_COLOR_BTNFACE: int +AFX_IDS_COLOR_BTNSHADOW: int +AFX_IDS_COLOR_BTNTEXT: int +AFX_IDS_COLOR_BTNHIGHLIGHT: int +AFX_IDS_COLOR_DISABLEDTEXT: int +AFX_IDS_COLOR_HIGHLIGHT: int +AFX_IDS_COLOR_HIGHLIGHTTEXT: int +AFX_IDS_REGULAR: int +AFX_IDS_BOLD: int +AFX_IDS_ITALIC: int +AFX_IDS_BOLDITALIC: int +AFX_IDS_SAMPLETEXT: int +AFX_IDS_DISPLAYSTRING_FONT: int +AFX_IDS_DISPLAYSTRING_COLOR: int +AFX_IDS_DISPLAYSTRING_PICTURE: int +AFX_IDS_PICTUREFILTER: int +AFX_IDS_PICTYPE_UNKNOWN: int +AFX_IDS_PICTYPE_NONE: int +AFX_IDS_PICTYPE_BITMAP: int +AFX_IDS_PICTYPE_METAFILE: int +AFX_IDS_PICTYPE_ICON: int +AFX_IDS_COLOR_PPG: int +AFX_IDS_COLOR_PPG_CAPTION: int +AFX_IDS_FONT_PPG: int +AFX_IDS_FONT_PPG_CAPTION: int +AFX_IDS_PICTURE_PPG: int +AFX_IDS_PICTURE_PPG_CAPTION: int +AFX_IDS_PICTUREBROWSETITLE: int +AFX_IDS_BORDERSTYLE_0: int +AFX_IDS_BORDERSTYLE_1: int +AFX_IDS_VERB_EDIT: int +AFX_IDS_VERB_PROPERTIES: int +AFX_IDP_PICTURECANTOPEN: int +AFX_IDP_PICTURECANTLOAD: int +AFX_IDP_PICTURETOOLARGE: int +AFX_IDP_PICTUREREADFAILED: int +AFX_IDP_E_ILLEGALFUNCTIONCALL: int +AFX_IDP_E_OVERFLOW: int +AFX_IDP_E_OUTOFMEMORY: int +AFX_IDP_E_DIVISIONBYZERO: int +AFX_IDP_E_OUTOFSTRINGSPACE: int +AFX_IDP_E_OUTOFSTACKSPACE: int +AFX_IDP_E_BADFILENAMEORNUMBER: int +AFX_IDP_E_FILENOTFOUND: int +AFX_IDP_E_BADFILEMODE: int +AFX_IDP_E_FILEALREADYOPEN: int +AFX_IDP_E_DEVICEIOERROR: int +AFX_IDP_E_FILEALREADYEXISTS: int +AFX_IDP_E_BADRECORDLENGTH: int +AFX_IDP_E_DISKFULL: int +AFX_IDP_E_BADRECORDNUMBER: int +AFX_IDP_E_BADFILENAME: int +AFX_IDP_E_TOOMANYFILES: int +AFX_IDP_E_DEVICEUNAVAILABLE: int +AFX_IDP_E_PERMISSIONDENIED: int +AFX_IDP_E_DISKNOTREADY: int +AFX_IDP_E_PATHFILEACCESSERROR: int +AFX_IDP_E_PATHNOTFOUND: int +AFX_IDP_E_INVALIDPATTERNSTRING: int +AFX_IDP_E_INVALIDUSEOFNULL: int +AFX_IDP_E_INVALIDFILEFORMAT: int +AFX_IDP_E_INVALIDPROPERTYVALUE: int +AFX_IDP_E_INVALIDPROPERTYARRAYINDEX: int +AFX_IDP_E_SETNOTSUPPORTEDATRUNTIME: int +AFX_IDP_E_SETNOTSUPPORTED: int +AFX_IDP_E_NEEDPROPERTYARRAYINDEX: int +AFX_IDP_E_SETNOTPERMITTED: int +AFX_IDP_E_GETNOTSUPPORTEDATRUNTIME: int +AFX_IDP_E_GETNOTSUPPORTED: int +AFX_IDP_E_PROPERTYNOTFOUND: int +AFX_IDP_E_INVALIDCLIPBOARDFORMAT: int +AFX_IDP_E_INVALIDPICTURE: int +AFX_IDP_E_PRINTERERROR: int +AFX_IDP_E_CANTSAVEFILETOTEMP: int +AFX_IDP_E_SEARCHTEXTNOTFOUND: int +AFX_IDP_E_REPLACEMENTSTOOLONG: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/commctrl.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/commctrl.pyi new file mode 100644 index 000000000..d1e76bcbe --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/commctrl.pyi @@ -0,0 +1,1522 @@ +from _typeshed import Incomplete + +WM_USER: int +ICC_LISTVIEW_CLASSES: int +ICC_TREEVIEW_CLASSES: int +ICC_BAR_CLASSES: int +ICC_TAB_CLASSES: int +ICC_UPDOWN_CLASS: int +ICC_PROGRESS_CLASS: int +ICC_HOTKEY_CLASS: int +ICC_ANIMATE_CLASS: int +ICC_WIN95_CLASSES: int +ICC_DATE_CLASSES: int +ICC_USEREX_CLASSES: int +ICC_COOL_CLASSES: int +ICC_INTERNET_CLASSES: int +ICC_PAGESCROLLER_CLASS: int +ICC_NATIVEFNTCTL_CLASS: int +ODT_HEADER: int +ODT_TAB: int +ODT_LISTVIEW: int +PY_0U: int +NM_FIRST: int +NM_LAST: Incomplete +LVN_FIRST: Incomplete +LVN_LAST: Incomplete +HDN_FIRST: Incomplete +HDN_LAST: Incomplete +TVN_FIRST: Incomplete +TVN_LAST: Incomplete +TTN_FIRST: Incomplete +TTN_LAST: Incomplete +TCN_FIRST: Incomplete +TCN_LAST: Incomplete +CDN_FIRST: Incomplete +CDN_LAST: Incomplete +TBN_FIRST: Incomplete +TBN_LAST: Incomplete +UDN_FIRST: Incomplete +UDN_LAST: Incomplete +MCN_FIRST: Incomplete +MCN_LAST: Incomplete +DTN_FIRST: Incomplete +DTN_LAST: Incomplete +CBEN_FIRST: Incomplete +CBEN_LAST: Incomplete +RBN_FIRST: Incomplete +RBN_LAST: Incomplete +IPN_FIRST: Incomplete +IPN_LAST: Incomplete +SBN_FIRST: Incomplete +SBN_LAST: Incomplete +PGN_FIRST: Incomplete +PGN_LAST: Incomplete +LVM_FIRST: int +TV_FIRST: int +HDM_FIRST: int +TCM_FIRST: int +PGM_FIRST: int +CCM_FIRST: int +CCM_SETBKCOLOR: Incomplete +CCM_SETCOLORSCHEME: Incomplete +CCM_GETCOLORSCHEME: Incomplete +CCM_GETDROPTARGET: Incomplete +CCM_SETUNICODEFORMAT: Incomplete +CCM_GETUNICODEFORMAT: Incomplete +INFOTIPSIZE: int +NM_OUTOFMEMORY: Incomplete +NM_CLICK: Incomplete +NM_DBLCLK: Incomplete +NM_RETURN: Incomplete +NM_RCLICK: Incomplete +NM_RDBLCLK: Incomplete +NM_SETFOCUS: Incomplete +NM_KILLFOCUS: Incomplete +NM_CUSTOMDRAW: Incomplete +NM_HOVER: Incomplete +NM_NCHITTEST: Incomplete +NM_KEYDOWN: Incomplete +NM_RELEASEDCAPTURE: Incomplete +NM_SETCURSOR: Incomplete +NM_CHAR: Incomplete +MSGF_COMMCTRL_BEGINDRAG: int +MSGF_COMMCTRL_SIZEHEADER: int +MSGF_COMMCTRL_DRAGSELECT: int +MSGF_COMMCTRL_TOOLBARCUST: int +CDRF_DODEFAULT: int +CDRF_NEWFONT: int +CDRF_SKIPDEFAULT: int +CDRF_NOTIFYPOSTPAINT: int +CDRF_NOTIFYITEMDRAW: int +CDRF_NOTIFYSUBITEMDRAW: int +CDRF_NOTIFYPOSTERASE: int +CDDS_PREPAINT: int +CDDS_POSTPAINT: int +CDDS_PREERASE: int +CDDS_POSTERASE: int +CDDS_ITEM: int +CDDS_ITEMPREPAINT: Incomplete +CDDS_ITEMPOSTPAINT: Incomplete +CDDS_ITEMPREERASE: Incomplete +CDDS_ITEMPOSTERASE: Incomplete +CDDS_SUBITEM: int +CDIS_SELECTED: int +CDIS_GRAYED: int +CDIS_DISABLED: int +CDIS_CHECKED: int +CDIS_FOCUS: int +CDIS_DEFAULT: int +CDIS_HOT: int +CDIS_MARKED: int +CDIS_INDETERMINATE: int +CLR_NONE: int +CLR_DEFAULT: int +ILC_MASK: int +ILC_COLOR: int +ILC_COLORDDB: int +ILC_COLOR4: int +ILC_COLOR8: int +ILC_COLOR16: int +ILC_COLOR24: int +ILC_COLOR32: int +ILC_PALETTE: int +ILD_NORMAL: int +ILD_TRANSPARENT: int +ILD_MASK: int +ILD_IMAGE: int +ILD_ROP: int +ILD_BLEND25: int +ILD_BLEND50: int +ILD_OVERLAYMASK: int +ILD_SELECTED: int +ILD_FOCUS: int +ILD_BLEND: int +CLR_HILIGHT: int +ILCF_MOVE: int +ILCF_SWAP: int +WC_HEADERA: str +WC_HEADER: str +HDS_HORZ: int +HDS_BUTTONS: int +HDS_HOTTRACK: int +HDS_HIDDEN: int +HDS_DRAGDROP: int +HDS_FULLDRAG: int +HDI_WIDTH: int +HDI_HEIGHT: int +HDI_TEXT: int +HDI_FORMAT: int +HDI_LPARAM: int +HDI_BITMAP: int +HDI_IMAGE: int +HDI_DI_SETITEM: int +HDI_ORDER: int +HDF_LEFT: int +HDF_RIGHT: int +HDF_CENTER: int +HDF_JUSTIFYMASK: int +HDF_RTLREADING: int +HDF_OWNERDRAW: int +HDF_STRING: int +HDF_BITMAP: int +HDF_BITMAP_ON_RIGHT: int +HDF_IMAGE: int +HDM_GETITEMCOUNT: Incomplete +HDM_INSERTITEMA: Incomplete +HDM_INSERTITEMW: Incomplete +HDM_INSERTITEM: Incomplete +HDM_DELETEITEM: Incomplete +HDM_GETITEMA: Incomplete +HDM_GETITEMW: Incomplete +HDM_GETITEM: Incomplete +HDM_SETITEMA: Incomplete +HDM_SETITEMW: Incomplete +HDM_SETITEM: Incomplete +HDM_LAYOUT: Incomplete +HHT_NOWHERE: int +HHT_ONHEADER: int +HHT_ONDIVIDER: int +HHT_ONDIVOPEN: int +HHT_ABOVE: int +HHT_BELOW: int +HHT_TORIGHT: int +HHT_TOLEFT: int +HDM_HITTEST: Incomplete +HDM_GETITEMRECT: Incomplete +HDM_SETIMAGELIST: Incomplete +HDM_GETIMAGELIST: Incomplete +HDM_ORDERTOINDEX: Incomplete +HDM_CREATEDRAGIMAGE: Incomplete +HDM_GETORDERARRAY: Incomplete +HDM_SETORDERARRAY: Incomplete +HDM_SETHOTDIVIDER: Incomplete +HDM_SETUNICODEFORMAT: Incomplete +HDM_GETUNICODEFORMAT: Incomplete +HDN_ITEMCHANGINGA: Incomplete +HDN_ITEMCHANGINGW: Incomplete +HDN_ITEMCHANGEDA: Incomplete +HDN_ITEMCHANGEDW: Incomplete +HDN_ITEMCLICKA: Incomplete +HDN_ITEMCLICKW: Incomplete +HDN_ITEMDBLCLICKA: Incomplete +HDN_ITEMDBLCLICKW: Incomplete +HDN_DIVIDERDBLCLICKA: Incomplete +HDN_DIVIDERDBLCLICKW: Incomplete +HDN_BEGINTRACKA: Incomplete +HDN_BEGINTRACKW: Incomplete +HDN_ENDTRACKA: Incomplete +HDN_ENDTRACKW: Incomplete +HDN_TRACKA: Incomplete +HDN_TRACKW: Incomplete +HDN_GETDISPINFOA: Incomplete +HDN_GETDISPINFOW: Incomplete +HDN_BEGINDRAG: Incomplete +HDN_ENDDRAG: Incomplete +HDN_ITEMCHANGING: Incomplete +HDN_ITEMCHANGED: Incomplete +HDN_ITEMCLICK: Incomplete +HDN_ITEMDBLCLICK: Incomplete +HDN_DIVIDERDBLCLICK: Incomplete +HDN_BEGINTRACK: Incomplete +HDN_ENDTRACK: Incomplete +HDN_TRACK: Incomplete +HDN_GETDISPINFO: Incomplete +TOOLBARCLASSNAMEA: str +TOOLBARCLASSNAME: str +CMB_MASKED: int +TBSTATE_CHECKED: int +TBSTATE_PRESSED: int +TBSTATE_ENABLED: int +TBSTATE_HIDDEN: int +TBSTATE_INDETERMINATE: int +TBSTATE_WRAP: int +TBSTATE_ELLIPSES: int +TBSTATE_MARKED: int +TBSTYLE_BUTTON: int +TBSTYLE_SEP: int +TBSTYLE_CHECK: int +TBSTYLE_GROUP: int +TBSTYLE_CHECKGROUP: Incomplete +TBSTYLE_DROPDOWN: int +TBSTYLE_AUTOSIZE: int +TBSTYLE_NOPREFIX: int +TBSTYLE_TOOLTIPS: int +TBSTYLE_WRAPABLE: int +TBSTYLE_ALTDRAG: int +TBSTYLE_FLAT: int +TBSTYLE_LIST: int +TBSTYLE_CUSTOMERASE: int +TBSTYLE_REGISTERDROP: int +TBSTYLE_TRANSPARENT: int +TBSTYLE_EX_DRAWDDARROWS: int +BTNS_BUTTON: int +BTNS_SEP: int +BTNS_CHECK: int +BTNS_GROUP: int +BTNS_CHECKGROUP: Incomplete +BTNS_DROPDOWN: int +BTNS_AUTOSIZE: int +BTNS_NOPREFIX: int +BTNS_SHOWTEXT: int +BTNS_WHOLEDROPDOWN: int +TBCDRF_NOEDGES: int +TBCDRF_HILITEHOTTRACK: int +TBCDRF_NOOFFSET: int +TBCDRF_NOMARK: int +TBCDRF_NOETCHEDEFFECT: int +TB_ENABLEBUTTON: Incomplete +TB_CHECKBUTTON: Incomplete +TB_PRESSBUTTON: Incomplete +TB_HIDEBUTTON: Incomplete +TB_INDETERMINATE: Incomplete +TB_MARKBUTTON: Incomplete +TB_ISBUTTONENABLED: Incomplete +TB_ISBUTTONCHECKED: Incomplete +TB_ISBUTTONPRESSED: Incomplete +TB_ISBUTTONHIDDEN: Incomplete +TB_ISBUTTONINDETERMINATE: Incomplete +TB_ISBUTTONHIGHLIGHTED: Incomplete +TB_SETSTATE: Incomplete +TB_GETSTATE: Incomplete +TB_ADDBITMAP: Incomplete +HINST_COMMCTRL: int +IDB_STD_SMALL_COLOR: int +IDB_STD_LARGE_COLOR: int +IDB_VIEW_SMALL_COLOR: int +IDB_VIEW_LARGE_COLOR: int +IDB_HIST_SMALL_COLOR: int +IDB_HIST_LARGE_COLOR: int +STD_CUT: int +STD_COPY: int +STD_PASTE: int +STD_UNDO: int +STD_REDOW: int +STD_DELETE: int +STD_FILENEW: int +STD_FILEOPEN: int +STD_FILESAVE: int +STD_PRINTPRE: int +STD_PROPERTIES: int +STD_HELP: int +STD_FIND: int +STD_REPLACE: int +STD_PRINT: int +VIEW_LARGEICONS: int +VIEW_SMALLICONS: int +VIEW_LIST: int +VIEW_DETAILS: int +VIEW_SORTNAME: int +VIEW_SORTSIZE: int +VIEW_SORTDATE: int +VIEW_SORTTYPE: int +VIEW_PARENTFOLDER: int +VIEW_NETCONNECT: int +VIEW_NETDISCONNECT: int +VIEW_NEWFOLDER: int +VIEW_VIEWMENU: int +HIST_BACK: int +HIST_FORWARD: int +HIST_FAVORITES: int +HIST_ADDTOFAVORITES: int +HIST_VIEWTREE: int +TB_ADDBUTTONSA: Incomplete +TB_INSERTBUTTONA: Incomplete +TB_ADDBUTTONS: Incomplete +TB_INSERTBUTTON: Incomplete +TB_DELETEBUTTON: Incomplete +TB_GETBUTTON: Incomplete +TB_BUTTONCOUNT: Incomplete +TB_COMMANDTOINDEX: Incomplete +TB_SAVERESTOREA: Incomplete +TB_SAVERESTOREW: Incomplete +TB_CUSTOMIZE: Incomplete +TB_ADDSTRINGA: Incomplete +TB_ADDSTRINGW: Incomplete +TB_GETITEMRECT: Incomplete +TB_BUTTONSTRUCTSIZE: Incomplete +TB_SETBUTTONSIZE: Incomplete +TB_SETBITMAPSIZE: Incomplete +TB_AUTOSIZE: Incomplete +TB_GETTOOLTIPS: Incomplete +TB_SETTOOLTIPS: Incomplete +TB_SETPARENT: Incomplete +TB_SETROWS: Incomplete +TB_GETROWS: Incomplete +TB_SETCMDID: Incomplete +TB_CHANGEBITMAP: Incomplete +TB_GETBITMAP: Incomplete +TB_GETBUTTONTEXTA: Incomplete +TB_GETBUTTONTEXTW: Incomplete +TB_REPLACEBITMAP: Incomplete +TB_SETINDENT: Incomplete +TB_SETIMAGELIST: Incomplete +TB_GETIMAGELIST: Incomplete +TB_LOADIMAGES: Incomplete +TB_GETRECT: Incomplete +TB_SETHOTIMAGELIST: Incomplete +TB_GETHOTIMAGELIST: Incomplete +TB_SETDISABLEDIMAGELIST: Incomplete +TB_GETDISABLEDIMAGELIST: Incomplete +TB_SETSTYLE: Incomplete +TB_GETSTYLE: Incomplete +TB_GETBUTTONSIZE: Incomplete +TB_SETBUTTONWIDTH: Incomplete +TB_SETMAXTEXTROWS: Incomplete +TB_GETTEXTROWS: Incomplete +TB_GETBUTTONTEXT: Incomplete +TB_SAVERESTORE: Incomplete +TB_ADDSTRING: Incomplete +TB_GETOBJECT: Incomplete +TB_GETHOTITEM: Incomplete +TB_SETHOTITEM: Incomplete +TB_SETANCHORHIGHLIGHT: Incomplete +TB_GETANCHORHIGHLIGHT: Incomplete +TB_MAPACCELERATORA: Incomplete +TBIMHT_AFTER: int +TBIMHT_BACKGROUND: int +TB_GETINSERTMARK: Incomplete +TB_SETINSERTMARK: Incomplete +TB_INSERTMARKHITTEST: Incomplete +TB_MOVEBUTTON: Incomplete +TB_GETMAXSIZE: Incomplete +TB_SETEXTENDEDSTYLE: Incomplete +TB_GETEXTENDEDSTYLE: Incomplete +TB_GETPADDING: Incomplete +TB_SETPADDING: Incomplete +TB_SETINSERTMARKCOLOR: Incomplete +TB_GETINSERTMARKCOLOR: Incomplete +TB_SETCOLORSCHEME: Incomplete +TB_GETCOLORSCHEME: Incomplete +TB_SETUNICODEFORMAT: Incomplete +TB_GETUNICODEFORMAT: Incomplete +TB_MAPACCELERATORW: Incomplete +TB_MAPACCELERATOR: Incomplete +TBBF_LARGE: int +TB_GETBITMAPFLAGS: Incomplete +TBIF_IMAGE: int +TBIF_TEXT: int +TBIF_STATE: int +TBIF_STYLE: int +TBIF_LPARAM: int +TBIF_COMMAND: int +TBIF_SIZE: int +TB_GETBUTTONINFOW: Incomplete +TB_SETBUTTONINFOW: Incomplete +TB_GETBUTTONINFOA: Incomplete +TB_SETBUTTONINFOA: Incomplete +TB_INSERTBUTTONW: Incomplete +TB_ADDBUTTONSW: Incomplete +TB_HITTEST: Incomplete +TB_SETDRAWTEXTFLAGS: Incomplete +TBN_GETBUTTONINFOA: Incomplete +TBN_GETBUTTONINFOW: Incomplete +TBN_BEGINDRAG: Incomplete +TBN_ENDDRAG: Incomplete +TBN_BEGINADJUST: Incomplete +TBN_ENDADJUST: Incomplete +TBN_RESET: Incomplete +TBN_QUERYINSERT: Incomplete +TBN_QUERYDELETE: Incomplete +TBN_TOOLBARCHANGE: Incomplete +TBN_CUSTHELP: Incomplete +TBN_DROPDOWN: Incomplete +TBN_GETOBJECT: Incomplete +HICF_OTHER: int +HICF_MOUSE: int +HICF_ARROWKEYS: int +HICF_ACCELERATOR: int +HICF_DUPACCEL: int +HICF_ENTERING: int +HICF_LEAVING: int +HICF_RESELECT: int +TBN_HOTITEMCHANGE: Incomplete +TBN_DRAGOUT: Incomplete +TBN_DELETINGBUTTON: Incomplete +TBN_GETDISPINFOA: Incomplete +TBN_GETDISPINFOW: Incomplete +TBN_GETINFOTIPA: Incomplete +TBN_GETINFOTIPW: Incomplete +TBN_GETINFOTIP: Incomplete +TBNF_IMAGE: int +TBNF_TEXT: int +TBNF_DI_SETITEM: int +TBN_GETDISPINFO: Incomplete +TBDDRET_DEFAULT: int +TBDDRET_NODEFAULT: int +TBDDRET_TREATPRESSED: int +TBN_GETBUTTONINFO: Incomplete +REBARCLASSNAMEA: str +REBARCLASSNAME: str +RBIM_IMAGELIST: int +RBS_TOOLTIPS: int +RBS_VARHEIGHT: int +RBS_BANDBORDERS: int +RBS_FIXEDORDER: int +RBS_REGISTERDROP: int +RBS_AUTOSIZE: int +RBS_VERTICALGRIPPER: int +RBS_DBLCLKTOGGLE: int +RBBS_BREAK: int +RBBS_FIXEDSIZE: int +RBBS_CHILDEDGE: int +RBBS_HIDDEN: int +RBBS_NOVERT: int +RBBS_FIXEDBMP: int +RBBS_VARIABLEHEIGHT: int +RBBS_GRIPPERALWAYS: int +RBBS_NOGRIPPER: int +RBBIM_STYLE: int +RBBIM_COLORS: int +RBBIM_TEXT: int +RBBIM_IMAGE: int +RBBIM_CHILD: int +RBBIM_CHILDSIZE: int +RBBIM_SIZE: int +RBBIM_BACKGROUND: int +RBBIM_ID: int +RBBIM_IDEALSIZE: int +RBBIM_LPARAM: int +RB_INSERTBANDA: Incomplete +RB_DELETEBAND: Incomplete +RB_GETBARINFO: Incomplete +RB_SETBARINFO: Incomplete +RB_SETBANDINFOA: Incomplete +RB_SETPARENT: Incomplete +RB_HITTEST: Incomplete +RB_GETRECT: Incomplete +RB_INSERTBANDW: Incomplete +RB_SETBANDINFOW: Incomplete +RB_GETBANDCOUNT: Incomplete +RB_GETROWCOUNT: Incomplete +RB_GETROWHEIGHT: Incomplete +RB_IDTOINDEX: Incomplete +RB_GETTOOLTIPS: Incomplete +RB_SETTOOLTIPS: Incomplete +RB_SETBKCOLOR: Incomplete +RB_GETBKCOLOR: Incomplete +RB_SETTEXTCOLOR: Incomplete +RB_GETTEXTCOLOR: Incomplete +RB_SIZETORECT: Incomplete +RB_SETCOLORSCHEME: Incomplete +RB_GETCOLORSCHEME: Incomplete +RB_INSERTBAND: Incomplete +RB_SETBANDINFO: Incomplete +RB_BEGINDRAG: Incomplete +RB_ENDDRAG: Incomplete +RB_DRAGMOVE: Incomplete +RB_GETBARHEIGHT: Incomplete +RB_GETBANDINFOW: Incomplete +RB_GETBANDINFOA: Incomplete +RB_GETBANDINFO: Incomplete +RB_MINIMIZEBAND: Incomplete +RB_MAXIMIZEBAND: Incomplete +RB_GETDROPTARGET: Incomplete +RB_GETBANDBORDERS: Incomplete +RB_SHOWBAND: Incomplete +RB_SETPALETTE: Incomplete +RB_GETPALETTE: Incomplete +RB_MOVEBAND: Incomplete +RB_SETUNICODEFORMAT: Incomplete +RB_GETUNICODEFORMAT: Incomplete +RBN_HEIGHTCHANGE: Incomplete +RBN_GETOBJECT: Incomplete +RBN_LAYOUTCHANGED: Incomplete +RBN_AUTOSIZE: Incomplete +RBN_BEGINDRAG: Incomplete +RBN_ENDDRAG: Incomplete +RBN_DELETINGBAND: Incomplete +RBN_DELETEDBAND: Incomplete +RBN_CHILDSIZE: Incomplete +RBNM_ID: int +RBNM_STYLE: int +RBNM_LPARAM: int +RBHT_NOWHERE: int +RBHT_CAPTION: int +RBHT_CLIENT: int +RBHT_GRABBER: int +TOOLTIPS_CLASSA: str +TOOLTIPS_CLASS: str +TTS_ALWAYSTIP: int +TTS_NOPREFIX: int +TTF_IDISHWND: int +TTF_CENTERTIP: int +TTF_RTLREADING: int +TTF_SUBCLASS: int +TTF_TRACK: int +TTF_ABSOLUTE: int +TTF_TRANSPARENT: int +TTF_DI_SETITEM: int +TTDT_AUTOMATIC: int +TTDT_RESHOW: int +TTDT_AUTOPOP: int +TTDT_INITIAL: int +TTM_ACTIVATE: Incomplete +TTM_SETDELAYTIME: Incomplete +TTM_ADDTOOLA: Incomplete +TTM_ADDTOOLW: Incomplete +TTM_DELTOOLA: Incomplete +TTM_DELTOOLW: Incomplete +TTM_NEWTOOLRECTA: Incomplete +TTM_NEWTOOLRECTW: Incomplete +TTM_RELAYEVENT: Incomplete +TTM_GETTOOLINFOA: Incomplete +TTM_GETTOOLINFOW: Incomplete +TTM_SETTOOLINFOA: Incomplete +TTM_SETTOOLINFOW: Incomplete +TTM_HITTESTA: Incomplete +TTM_HITTESTW: Incomplete +TTM_GETTEXTA: Incomplete +TTM_GETTEXTW: Incomplete +TTM_UPDATETIPTEXTA: Incomplete +TTM_UPDATETIPTEXTW: Incomplete +TTM_GETTOOLCOUNT: Incomplete +TTM_ENUMTOOLSA: Incomplete +TTM_ENUMTOOLSW: Incomplete +TTM_GETCURRENTTOOLA: Incomplete +TTM_GETCURRENTTOOLW: Incomplete +TTM_WINDOWFROMPOINT: Incomplete +TTM_TRACKACTIVATE: Incomplete +TTM_TRACKPOSITION: Incomplete +TTM_SETTIPBKCOLOR: Incomplete +TTM_SETTIPTEXTCOLOR: Incomplete +TTM_GETDELAYTIME: Incomplete +TTM_GETTIPBKCOLOR: Incomplete +TTM_GETTIPTEXTCOLOR: Incomplete +TTM_SETMAXTIPWIDTH: Incomplete +TTM_GETMAXTIPWIDTH: Incomplete +TTM_SETMARGIN: Incomplete +TTM_GETMARGIN: Incomplete +TTM_POP: Incomplete +TTM_UPDATE: Incomplete +TTM_ADDTOOL: Incomplete +TTM_DELTOOL: Incomplete +TTM_NEWTOOLRECT: Incomplete +TTM_GETTOOLINFO: Incomplete +TTM_SETTOOLINFO: Incomplete +TTM_HITTEST: Incomplete +TTM_GETTEXT: Incomplete +TTM_UPDATETIPTEXT: Incomplete +TTM_ENUMTOOLS: Incomplete +TTM_GETCURRENTTOOL: Incomplete +TTN_GETDISPINFOA: Incomplete +TTN_GETDISPINFOW: Incomplete +TTN_SHOW: Incomplete +TTN_POP: Incomplete +TTN_GETDISPINFO: Incomplete +TTN_NEEDTEXT: Incomplete +TTN_NEEDTEXTA: Incomplete +TTN_NEEDTEXTW: Incomplete +SBARS_SIZEGRIP: int +SBARS_TOOLTIPS: int +STATUSCLASSNAMEA: str +STATUSCLASSNAME: str +SB_SETTEXTA: Incomplete +SB_SETTEXTW: Incomplete +SB_GETTEXTA: Incomplete +SB_GETTEXTW: Incomplete +SB_GETTEXTLENGTHA: Incomplete +SB_GETTEXTLENGTHW: Incomplete +SB_GETTEXT: Incomplete +SB_SETTEXT: Incomplete +SB_GETTEXTLENGTH: Incomplete +SB_SETPARTS: Incomplete +SB_GETPARTS: Incomplete +SB_GETBORDERS: Incomplete +SB_SETMINHEIGHT: Incomplete +SB_SIMPLE: Incomplete +SB_GETRECT: Incomplete +SB_ISSIMPLE: Incomplete +SB_SETICON: Incomplete +SB_SETTIPTEXTA: Incomplete +SB_SETTIPTEXTW: Incomplete +SB_GETTIPTEXTA: Incomplete +SB_GETTIPTEXTW: Incomplete +SB_GETICON: Incomplete +SB_SETTIPTEXT: Incomplete +SB_GETTIPTEXT: Incomplete +SB_SETUNICODEFORMAT: Incomplete +SB_GETUNICODEFORMAT: Incomplete +SBT_OWNERDRAW: int +SBT_NOBORDERS: int +SBT_POPOUT: int +SBT_RTLREADING: int +SBT_NOTABPARSING: int +SBT_TOOLTIPS: int +SB_SETBKCOLOR: Incomplete +SBN_SIMPLEMODECHANGE: Incomplete +TRACKBAR_CLASSA: str +TRACKBAR_CLASS: str +TBS_AUTOTICKS: int +TBS_VERT: int +TBS_HORZ: int +TBS_TOP: int +TBS_BOTTOM: int +TBS_LEFT: int +TBS_RIGHT: int +TBS_BOTH: int +TBS_NOTICKS: int +TBS_ENABLESELRANGE: int +TBS_FIXEDLENGTH: int +TBS_NOTHUMB: int +TBS_TOOLTIPS: int +TBM_GETPOS: int +TBM_GETRANGEMIN: Incomplete +TBM_GETRANGEMAX: Incomplete +TBM_GETTIC: Incomplete +TBM_SETTIC: Incomplete +TBM_SETPOS: Incomplete +TBM_SETRANGE: Incomplete +TBM_SETRANGEMIN: Incomplete +TBM_SETRANGEMAX: Incomplete +TBM_CLEARTICS: Incomplete +TBM_SETSEL: Incomplete +TBM_SETSELSTART: Incomplete +TBM_SETSELEND: Incomplete +TBM_GETPTICS: Incomplete +TBM_GETTICPOS: Incomplete +TBM_GETNUMTICS: Incomplete +TBM_GETSELSTART: Incomplete +TBM_GETSELEND: Incomplete +TBM_CLEARSEL: Incomplete +TBM_SETTICFREQ: Incomplete +TBM_SETPAGESIZE: Incomplete +TBM_GETPAGESIZE: Incomplete +TBM_SETLINESIZE: Incomplete +TBM_GETLINESIZE: Incomplete +TBM_GETTHUMBRECT: Incomplete +TBM_GETCHANNELRECT: Incomplete +TBM_SETTHUMBLENGTH: Incomplete +TBM_GETTHUMBLENGTH: Incomplete +TBM_SETTOOLTIPS: Incomplete +TBM_GETTOOLTIPS: Incomplete +TBM_SETTIPSIDE: Incomplete +TBTS_TOP: int +TBTS_LEFT: int +TBTS_BOTTOM: int +TBTS_RIGHT: int +TBM_SETBUDDY: Incomplete +TBM_GETBUDDY: Incomplete +TBM_SETUNICODEFORMAT: Incomplete +TBM_GETUNICODEFORMAT: Incomplete +TB_LINEUP: int +TB_LINEDOWN: int +TB_PAGEUP: int +TB_PAGEDOWN: int +TB_THUMBPOSITION: int +TB_THUMBTRACK: int +TB_TOP: int +TB_BOTTOM: int +TB_ENDTRACK: int +TBCD_TICS: int +TBCD_THUMB: int +TBCD_CHANNEL: int +DL_BEGINDRAG: Incomplete +DL_DRAGGING: Incomplete +DL_DROPPED: Incomplete +DL_CANCELDRAG: Incomplete +DL_CURSORSET: int +DL_STOPCURSOR: int +DL_COPYCURSOR: int +DL_MOVECURSOR: int +DRAGLISTMSGSTRING: str +UPDOWN_CLASSA: str +UPDOWN_CLASS: str +UD_MAXVAL: int +UD_MINVAL: Incomplete +UDS_WRAP: int +UDS_SETBUDDYINT: int +UDS_ALIGNRIGHT: int +UDS_ALIGNLEFT: int +UDS_AUTOBUDDY: int +UDS_ARROWKEYS: int +UDS_HORZ: int +UDS_NOTHOUSANDS: int +UDS_HOTTRACK: int +UDM_SETRANGE: Incomplete +UDM_GETRANGE: Incomplete +UDM_SETPOS: Incomplete +UDM_GETPOS: Incomplete +UDM_SETBUDDY: Incomplete +UDM_GETBUDDY: Incomplete +UDM_SETACCEL: Incomplete +UDM_GETACCEL: Incomplete +UDM_SETBASE: Incomplete +UDM_GETBASE: Incomplete +UDM_SETRANGE32: Incomplete +UDM_GETRANGE32: Incomplete +UDM_SETUNICODEFORMAT: Incomplete +UDM_GETUNICODEFORMAT: Incomplete +UDN_DELTAPOS: Incomplete +PROGRESS_CLASSA: str +PROGRESS_CLASS: str +PBS_SMOOTH: int +PBS_VERTICAL: int +PBM_SETRANGE: Incomplete +PBM_SETPOS: Incomplete +PBM_DELTAPOS: Incomplete +PBM_SETSTEP: Incomplete +PBM_STEPIT: Incomplete +PBM_SETRANGE32: Incomplete +PBM_GETRANGE: Incomplete +PBM_GETPOS: Incomplete +PBM_SETBARCOLOR: Incomplete +PBM_SETBKCOLOR: Incomplete +HOTKEYF_SHIFT: int +HOTKEYF_CONTROL: int +HOTKEYF_ALT: int +HOTKEYF_EXT: int +HKCOMB_NONE: int +HKCOMB_S: int +HKCOMB_C: int +HKCOMB_A: int +HKCOMB_SC: int +HKCOMB_SA: int +HKCOMB_CA: int +HKCOMB_SCA: int +HKM_SETHOTKEY: Incomplete +HKM_GETHOTKEY: Incomplete +HKM_SETRULES: Incomplete +HOTKEY_CLASSA: str +HOTKEY_CLASS: str +CCS_TOP: int +CCS_NOMOVEY: int +CCS_BOTTOM: int +CCS_NORESIZE: int +CCS_NOPARENTALIGN: int +CCS_ADJUSTABLE: int +CCS_NODIVIDER: int +CCS_VERT: int +CCS_LEFT: Incomplete +CCS_RIGHT: Incomplete +CCS_NOMOVEX: Incomplete +WC_LISTVIEWA: str +WC_LISTVIEW: str +LVS_ICON: int +LVS_REPORT: int +LVS_SMALLICON: int +LVS_LIST: int +LVS_TYPEMASK: int +LVS_SINGLESEL: int +LVS_SHOWSELALWAYS: int +LVS_SORTASCENDING: int +LVS_SORTDESCENDING: int +LVS_SHAREIMAGELISTS: int +LVS_NOLABELWRAP: int +LVS_AUTOARRANGE: int +LVS_EDITLABELS: int +LVS_OWNERDATA: int +LVS_NOSCROLL: int +LVS_TYPESTYLEMASK: int +LVS_ALIGNTOP: int +LVS_ALIGNLEFT: int +LVS_ALIGNMASK: int +LVS_OWNERDRAWFIXED: int +LVS_NOCOLUMNHEADER: int +LVS_NOSORTHEADER: int +LVM_SETUNICODEFORMAT: Incomplete +LVM_GETUNICODEFORMAT: Incomplete +LVM_GETBKCOLOR: Incomplete +LVM_SETBKCOLOR: Incomplete +LVM_GETIMAGELIST: Incomplete +LVSIL_NORMAL: int +LVSIL_SMALL: int +LVSIL_STATE: int +LVM_SETIMAGELIST: Incomplete +LVM_GETITEMCOUNT: Incomplete +LVIF_TEXT: int +LVIF_IMAGE: int +LVIF_PARAM: int +LVIF_STATE: int +LVIF_INDENT: int +LVIF_NORECOMPUTE: int +LVIS_FOCUSED: int +LVIS_SELECTED: int +LVIS_CUT: int +LVIS_DROPHILITED: int +LVIS_ACTIVATING: int +LVIS_OVERLAYMASK: int +LVIS_STATEIMAGEMASK: int +I_INDENTCALLBACK: int +LPSTR_TEXTCALLBACKA: int +LPSTR_TEXTCALLBACK: int +I_IMAGECALLBACK: int +LVM_GETITEMA: Incomplete +LVM_GETITEMW: Incomplete +LVM_GETITEM: Incomplete +LVM_SETITEMA: Incomplete +LVM_SETITEMW: Incomplete +LVM_SETITEM: Incomplete +LVM_INSERTITEMA: Incomplete +LVM_INSERTITEMW: Incomplete +LVM_INSERTITEM: Incomplete +LVM_DELETEITEM: Incomplete +LVM_DELETEALLITEMS: Incomplete +LVM_GETCALLBACKMASK: Incomplete +LVM_SETCALLBACKMASK: Incomplete +LVNI_ALL: int +LVNI_FOCUSED: int +LVNI_SELECTED: int +LVNI_CUT: int +LVNI_DROPHILITED: int +LVNI_ABOVE: int +LVNI_BELOW: int +LVNI_TOLEFT: int +LVNI_TORIGHT: int +LVM_GETNEXTITEM: Incomplete +LVFI_PARAM: int +LVFI_STRING: int +LVFI_PARTIAL: int +LVFI_WRAP: int +LVFI_NEARESTXY: int +LVM_FINDITEMA: Incomplete +LVM_FINDITEMW: Incomplete +LVM_FINDITEM: Incomplete +LVIR_BOUNDS: int +LVIR_ICON: int +LVIR_LABEL: int +LVIR_SELECTBOUNDS: int +LVM_GETITEMRECT: Incomplete +LVM_SETITEMPOSITION: Incomplete +LVM_GETITEMPOSITION: Incomplete +LVM_GETSTRINGWIDTHA: Incomplete +LVM_GETSTRINGWIDTHW: Incomplete +LVM_GETSTRINGWIDTH: Incomplete +LVHT_NOWHERE: int +LVHT_ONITEMICON: int +LVHT_ONITEMLABEL: int +LVHT_ONITEMSTATEICON: int +LVHT_ONITEM: Incomplete +LVHT_ABOVE: int +LVHT_BELOW: int +LVHT_TORIGHT: int +LVHT_TOLEFT: int +LVM_HITTEST: Incomplete +LVM_ENSUREVISIBLE: Incomplete +LVM_SCROLL: Incomplete +LVM_REDRAWITEMS: Incomplete +LVA_DEFAULT: int +LVA_ALIGNLEFT: int +LVA_ALIGNTOP: int +LVA_SNAPTOGRID: int +LVM_ARRANGE: Incomplete +LVM_EDITLABELA: Incomplete +LVM_EDITLABELW: Incomplete +LVM_EDITLABEL: Incomplete +LVM_GETEDITCONTROL: Incomplete +LVCF_FMT: int +LVCF_WIDTH: int +LVCF_TEXT: int +LVCF_SUBITEM: int +LVCF_IMAGE: int +LVCF_ORDER: int +LVCFMT_LEFT: int +LVCFMT_RIGHT: int +LVCFMT_CENTER: int +LVCFMT_JUSTIFYMASK: int +LVCFMT_IMAGE: int +LVCFMT_BITMAP_ON_RIGHT: int +LVCFMT_COL_HAS_IMAGES: int +LVM_GETCOLUMNA: Incomplete +LVM_GETCOLUMNW: Incomplete +LVM_GETCOLUMN: Incomplete +LVM_SETCOLUMNA: Incomplete +LVM_SETCOLUMNW: Incomplete +LVM_SETCOLUMN: Incomplete +LVM_INSERTCOLUMNA: Incomplete +LVM_INSERTCOLUMNW: Incomplete +LVM_INSERTCOLUMN: Incomplete +LVM_DELETECOLUMN: Incomplete +LVM_GETCOLUMNWIDTH: Incomplete +LVSCW_AUTOSIZE: int +LVSCW_AUTOSIZE_USEHEADER: int +LVM_SETCOLUMNWIDTH: Incomplete +LVM_GETHEADER: Incomplete +LVM_CREATEDRAGIMAGE: Incomplete +LVM_GETVIEWRECT: Incomplete +LVM_GETTEXTCOLOR: Incomplete +LVM_SETTEXTCOLOR: Incomplete +LVM_GETTEXTBKCOLOR: Incomplete +LVM_SETTEXTBKCOLOR: Incomplete +LVM_GETTOPINDEX: Incomplete +LVM_GETCOUNTPERPAGE: Incomplete +LVM_GETORIGIN: Incomplete +LVM_UPDATE: Incomplete +LVM_SETITEMSTATE: Incomplete +LVM_GETITEMSTATE: Incomplete +LVM_GETITEMTEXTA: Incomplete +LVM_GETITEMTEXTW: Incomplete +LVM_GETITEMTEXT: Incomplete +LVM_SETITEMTEXTA: Incomplete +LVM_SETITEMTEXTW: Incomplete +LVM_SETITEMTEXT: Incomplete +LVSICF_NOINVALIDATEALL: int +LVSICF_NOSCROLL: int +LVM_SETITEMCOUNT: Incomplete +LVM_SORTITEMS: Incomplete +LVM_SETITEMPOSITION32: Incomplete +LVM_GETSELECTEDCOUNT: Incomplete +LVM_GETITEMSPACING: Incomplete +LVM_GETISEARCHSTRINGA: Incomplete +LVM_GETISEARCHSTRINGW: Incomplete +LVM_GETISEARCHSTRING: Incomplete +LVM_SETICONSPACING: Incomplete +LVM_SETEXTENDEDLISTVIEWSTYLE: Incomplete +LVM_GETEXTENDEDLISTVIEWSTYLE: Incomplete +LVS_EX_GRIDLINES: int +LVS_EX_SUBITEMIMAGES: int +LVS_EX_CHECKBOXES: int +LVS_EX_TRACKSELECT: int +LVS_EX_HEADERDRAGDROP: int +LVS_EX_FULLROWSELECT: int +LVS_EX_ONECLICKACTIVATE: int +LVS_EX_TWOCLICKACTIVATE: int +LVS_EX_FLATSB: int +LVS_EX_REGIONAL: int +LVS_EX_INFOTIP: int +LVS_EX_UNDERLINEHOT: int +LVS_EX_UNDERLINECOLD: int +LVS_EX_MULTIWORKAREAS: int +LVM_GETSUBITEMRECT: Incomplete +LVM_SUBITEMHITTEST: Incomplete +LVM_SETCOLUMNORDERARRAY: Incomplete +LVM_GETCOLUMNORDERARRAY: Incomplete +LVM_SETHOTITEM: Incomplete +LVM_GETHOTITEM: Incomplete +LVM_SETHOTCURSOR: Incomplete +LVM_GETHOTCURSOR: Incomplete +LVM_APPROXIMATEVIEWRECT: Incomplete +LV_MAX_WORKAREAS: int +LVM_SETWORKAREAS: Incomplete +LVM_GETWORKAREAS: Incomplete +LVM_GETNUMBEROFWORKAREAS: Incomplete +LVM_GETSELECTIONMARK: Incomplete +LVM_SETSELECTIONMARK: Incomplete +LVM_SETHOVERTIME: Incomplete +LVM_GETHOVERTIME: Incomplete +LVM_SETTOOLTIPS: Incomplete +LVM_GETTOOLTIPS: Incomplete +LVBKIF_SOURCE_NONE: int +LVBKIF_SOURCE_HBITMAP: int +LVBKIF_SOURCE_URL: int +LVBKIF_SOURCE_MASK: int +LVBKIF_STYLE_NORMAL: int +LVBKIF_STYLE_TILE: int +LVBKIF_STYLE_MASK: int +LVM_SETBKIMAGEA: Incomplete +LVM_SETBKIMAGEW: Incomplete +LVM_GETBKIMAGEA: Incomplete +LVM_GETBKIMAGEW: Incomplete +LVKF_ALT: int +LVKF_CONTROL: int +LVKF_SHIFT: int +LVN_ITEMCHANGING: Incomplete +LVN_ITEMCHANGED: Incomplete +LVN_INSERTITEM: Incomplete +LVN_DELETEITEM: Incomplete +LVN_DELETEALLITEMS: Incomplete +LVN_BEGINLABELEDITA: Incomplete +LVN_BEGINLABELEDITW: Incomplete +LVN_ENDLABELEDITA: Incomplete +LVN_ENDLABELEDITW: Incomplete +LVN_COLUMNCLICK: Incomplete +LVN_BEGINDRAG: Incomplete +LVN_BEGINRDRAG: Incomplete +LVN_ODCACHEHINT: Incomplete +LVN_ODFINDITEMA: Incomplete +LVN_ODFINDITEMW: Incomplete +LVN_ITEMACTIVATE: Incomplete +LVN_ODSTATECHANGED: Incomplete +LVN_ODFINDITEM: Incomplete +LVN_HOTTRACK: Incomplete +LVN_GETDISPINFOA: Incomplete +LVN_GETDISPINFOW: Incomplete +LVN_SETDISPINFOA: Incomplete +LVN_SETDISPINFOW: Incomplete +LVN_BEGINLABELEDIT: Incomplete +LVN_ENDLABELEDIT: Incomplete +LVN_GETDISPINFO: Incomplete +LVN_SETDISPINFO: Incomplete +LVIF_DI_SETITEM: int +LVN_KEYDOWN: Incomplete +LVN_MARQUEEBEGIN: Incomplete +LVGIT_UNFOLDED: int +LVN_GETINFOTIPA: Incomplete +LVN_GETINFOTIPW: Incomplete +LVN_GETINFOTIP: Incomplete +WC_TREEVIEWA: str +WC_TREEVIEW: str +TVS_HASBUTTONS: int +TVS_HASLINES: int +TVS_LINESATROOT: int +TVS_EDITLABELS: int +TVS_DISABLEDRAGDROP: int +TVS_SHOWSELALWAYS: int +TVS_RTLREADING: int +TVS_NOTOOLTIPS: int +TVS_CHECKBOXES: int +TVS_TRACKSELECT: int +TVS_SINGLEEXPAND: int +TVS_INFOTIP: int +TVS_FULLROWSELECT: int +TVS_NOSCROLL: int +TVS_NONEVENHEIGHT: int +TVIF_TEXT: int +TVIF_IMAGE: int +TVIF_PARAM: int +TVIF_STATE: int +TVIF_HANDLE: int +TVIF_SELECTEDIMAGE: int +TVIF_CHILDREN: int +TVIF_INTEGRAL: int +TVIS_SELECTED: int +TVIS_CUT: int +TVIS_DROPHILITED: int +TVIS_BOLD: int +TVIS_EXPANDED: int +TVIS_EXPANDEDONCE: int +TVIS_EXPANDPARTIAL: int +TVIS_OVERLAYMASK: int +TVIS_STATEIMAGEMASK: int +TVIS_USERMASK: int +I_CHILDRENCALLBACK: int +TVI_ROOT: int +TVI_FIRST: int +TVI_LAST: int +TVI_SORT: int +TVM_INSERTITEMA: Incomplete +TVM_INSERTITEMW: Incomplete +TVM_INSERTITEM: Incomplete +TVM_DELETEITEM: Incomplete +TVM_EXPAND: Incomplete +TVE_COLLAPSE: int +TVE_EXPAND: int +TVE_TOGGLE: int +TVE_EXPANDPARTIAL: int +TVE_COLLAPSERESET: int +TVM_GETITEMRECT: Incomplete +TVM_GETCOUNT: Incomplete +TVM_GETINDENT: Incomplete +TVM_SETINDENT: Incomplete +TVM_GETIMAGELIST: Incomplete +TVSIL_NORMAL: int +TVSIL_STATE: int +TVM_SETIMAGELIST: Incomplete +TVM_GETNEXTITEM: Incomplete +TVGN_ROOT: int +TVGN_NEXT: int +TVGN_PREVIOUS: int +TVGN_PARENT: int +TVGN_CHILD: int +TVGN_FIRSTVISIBLE: int +TVGN_NEXTVISIBLE: int +TVGN_PREVIOUSVISIBLE: int +TVGN_DROPHILITE: int +TVGN_CARET: int +TVGN_LASTVISIBLE: int +TVM_SELECTITEM: Incomplete +TVM_GETITEMA: Incomplete +TVM_GETITEMW: Incomplete +TVM_GETITEM: Incomplete +TVM_SETITEMA: Incomplete +TVM_SETITEMW: Incomplete +TVM_SETITEM: Incomplete +TVM_EDITLABELA: Incomplete +TVM_EDITLABELW: Incomplete +TVM_EDITLABEL: Incomplete +TVM_GETEDITCONTROL: Incomplete +TVM_GETVISIBLECOUNT: Incomplete +TVM_HITTEST: Incomplete +TVHT_NOWHERE: int +TVHT_ONITEMICON: int +TVHT_ONITEMLABEL: int +TVHT_ONITEMINDENT: int +TVHT_ONITEMBUTTON: int +TVHT_ONITEMRIGHT: int +TVHT_ONITEMSTATEICON: int +TVHT_ABOVE: int +TVHT_BELOW: int +TVHT_TORIGHT: int +TVHT_TOLEFT: int +TVHT_ONITEM: Incomplete +TVM_CREATEDRAGIMAGE: Incomplete +TVM_SORTCHILDREN: Incomplete +TVM_ENSUREVISIBLE: Incomplete +TVM_SORTCHILDRENCB: Incomplete +TVM_ENDEDITLABELNOW: Incomplete +TVM_GETISEARCHSTRINGA: Incomplete +TVM_GETISEARCHSTRINGW: Incomplete +TVM_GETISEARCHSTRING: Incomplete +TVM_SETTOOLTIPS: Incomplete +TVM_GETTOOLTIPS: Incomplete +TVM_SETINSERTMARK: Incomplete +TVM_SETUNICODEFORMAT: Incomplete +TVM_GETUNICODEFORMAT: Incomplete +TVM_SETITEMHEIGHT: Incomplete +TVM_GETITEMHEIGHT: Incomplete +TVM_SETBKCOLOR: Incomplete +TVM_SETTEXTCOLOR: Incomplete +TVM_GETBKCOLOR: Incomplete +TVM_GETTEXTCOLOR: Incomplete +TVM_SETSCROLLTIME: Incomplete +TVM_GETSCROLLTIME: Incomplete +TVM_SETINSERTMARKCOLOR: Incomplete +TVM_GETINSERTMARKCOLOR: Incomplete +TVN_SELCHANGINGA: Incomplete +TVN_SELCHANGINGW: Incomplete +TVN_SELCHANGEDA: Incomplete +TVN_SELCHANGEDW: Incomplete +TVC_UNKNOWN: int +TVC_BYMOUSE: int +TVC_BYKEYBOARD: int +TVN_GETDISPINFOA: Incomplete +TVN_GETDISPINFOW: Incomplete +TVN_SETDISPINFOA: Incomplete +TVN_SETDISPINFOW: Incomplete +TVIF_DI_SETITEM: int +TVN_ITEMEXPANDINGA: Incomplete +TVN_ITEMEXPANDINGW: Incomplete +TVN_ITEMEXPANDEDA: Incomplete +TVN_ITEMEXPANDEDW: Incomplete +TVN_BEGINDRAGA: Incomplete +TVN_BEGINDRAGW: Incomplete +TVN_BEGINRDRAGA: Incomplete +TVN_BEGINRDRAGW: Incomplete +TVN_DELETEITEMA: Incomplete +TVN_DELETEITEMW: Incomplete +TVN_BEGINLABELEDITA: Incomplete +TVN_BEGINLABELEDITW: Incomplete +TVN_ENDLABELEDITA: Incomplete +TVN_ENDLABELEDITW: Incomplete +TVN_KEYDOWN: Incomplete +TVN_GETINFOTIPA: Incomplete +TVN_GETINFOTIPW: Incomplete +TVN_SINGLEEXPAND: Incomplete +TVN_SELCHANGING: Incomplete +TVN_SELCHANGED: Incomplete +TVN_GETDISPINFO: Incomplete +TVN_SETDISPINFO: Incomplete +TVN_ITEMEXPANDING: Incomplete +TVN_ITEMEXPANDED: Incomplete +TVN_BEGINDRAG: Incomplete +TVN_BEGINRDRAG: Incomplete +TVN_DELETEITEM: Incomplete +TVN_BEGINLABELEDIT: Incomplete +TVN_ENDLABELEDIT: Incomplete +TVN_GETINFOTIP: Incomplete +TVCDRF_NOIMAGES: int +WC_COMBOBOXEXA: str +WC_COMBOBOXEX: str +CBEIF_TEXT: int +CBEIF_IMAGE: int +CBEIF_SELECTEDIMAGE: int +CBEIF_OVERLAY: int +CBEIF_INDENT: int +CBEIF_LPARAM: int +CBEIF_DI_SETITEM: int +CBEM_INSERTITEMA: Incomplete +CBEM_SETIMAGELIST: Incomplete +CBEM_GETIMAGELIST: Incomplete +CBEM_GETITEMA: Incomplete +CBEM_SETITEMA: Incomplete +CBEM_GETCOMBOCONTROL: Incomplete +CBEM_GETEDITCONTROL: Incomplete +CBEM_SETEXSTYLE: Incomplete +CBEM_SETEXTENDEDSTYLE: Incomplete +CBEM_GETEXSTYLE: Incomplete +CBEM_GETEXTENDEDSTYLE: Incomplete +CBEM_SETUNICODEFORMAT: Incomplete +CBEM_GETUNICODEFORMAT: Incomplete +CBEM_HASEDITCHANGED: Incomplete +CBEM_INSERTITEMW: Incomplete +CBEM_SETITEMW: Incomplete +CBEM_GETITEMW: Incomplete +CBEM_INSERTITEM: Incomplete +CBEM_SETITEM: Incomplete +CBEM_GETITEM: Incomplete +CBES_EX_NOEDITIMAGE: int +CBES_EX_NOEDITIMAGEINDENT: int +CBES_EX_PATHWORDBREAKPROC: int +CBES_EX_NOSIZELIMIT: int +CBES_EX_CASESENSITIVE: int +CBEN_GETDISPINFO: Incomplete +CBEN_GETDISPINFOA: Incomplete +CBEN_INSERTITEM: Incomplete +CBEN_DELETEITEM: Incomplete +CBEN_BEGINEDIT: Incomplete +CBEN_ENDEDITA: Incomplete +CBEN_ENDEDITW: Incomplete +CBEN_GETDISPINFOW: Incomplete +CBEN_DRAGBEGINA: Incomplete +CBEN_DRAGBEGINW: Incomplete +CBEN_DRAGBEGIN: Incomplete +CBEN_ENDEDIT: Incomplete +CBENF_KILLFOCUS: int +CBENF_RETURN: int +CBENF_ESCAPE: int +CBENF_DROPDOWN: int +CBEMAXSTRLEN: int +WC_TABCONTROLA: str +WC_TABCONTROL: str +TCS_SCROLLOPPOSITE: int +TCS_BOTTOM: int +TCS_RIGHT: int +TCS_MULTISELECT: int +TCS_FLATBUTTONS: int +TCS_FORCEICONLEFT: int +TCS_FORCELABELLEFT: int +TCS_HOTTRACK: int +TCS_VERTICAL: int +TCS_TABS: int +TCS_BUTTONS: int +TCS_SINGLELINE: int +TCS_MULTILINE: int +TCS_RIGHTJUSTIFY: int +TCS_FIXEDWIDTH: int +TCS_RAGGEDRIGHT: int +TCS_FOCUSONBUTTONDOWN: int +TCS_OWNERDRAWFIXED: int +TCS_TOOLTIPS: int +TCS_FOCUSNEVER: int +TCS_EX_FLATSEPARATORS: int +TCS_EX_REGISTERDROP: int +TCM_GETIMAGELIST: Incomplete +TCM_SETIMAGELIST: Incomplete +TCM_GETITEMCOUNT: Incomplete +TCIF_TEXT: int +TCIF_IMAGE: int +TCIF_RTLREADING: int +TCIF_PARAM: int +TCIF_STATE: int +TCIS_BUTTONPRESSED: int +TCIS_HIGHLIGHTED: int +TCM_GETITEMA: Incomplete +TCM_GETITEMW: Incomplete +TCM_GETITEM: Incomplete +TCM_SETITEMA: Incomplete +TCM_SETITEMW: Incomplete +TCM_SETITEM: Incomplete +TCM_INSERTITEMA: Incomplete +TCM_INSERTITEMW: Incomplete +TCM_INSERTITEM: Incomplete +TCM_DELETEITEM: Incomplete +TCM_DELETEALLITEMS: Incomplete +TCM_GETITEMRECT: Incomplete +TCM_GETCURSEL: Incomplete +TCM_SETCURSEL: Incomplete +TCHT_NOWHERE: int +TCHT_ONITEMICON: int +TCHT_ONITEMLABEL: int +TCHT_ONITEM: Incomplete +TCM_HITTEST: Incomplete +TCM_SETITEMEXTRA: Incomplete +TCM_ADJUSTRECT: Incomplete +TCM_SETITEMSIZE: Incomplete +TCM_REMOVEIMAGE: Incomplete +TCM_SETPADDING: Incomplete +TCM_GETROWCOUNT: Incomplete +TCM_GETTOOLTIPS: Incomplete +TCM_SETTOOLTIPS: Incomplete +TCM_GETCURFOCUS: Incomplete +TCM_SETCURFOCUS: Incomplete +TCM_SETMINTABWIDTH: Incomplete +TCM_DESELECTALL: Incomplete +TCM_HIGHLIGHTITEM: Incomplete +TCM_SETEXTENDEDSTYLE: Incomplete +TCM_GETEXTENDEDSTYLE: Incomplete +TCM_SETUNICODEFORMAT: Incomplete +TCM_GETUNICODEFORMAT: Incomplete +TCN_KEYDOWN: Incomplete +ANIMATE_CLASSA: str +ANIMATE_CLASS: str +ACS_CENTER: int +ACS_TRANSPARENT: int +ACS_AUTOPLAY: int +ACS_TIMER: int +ACM_OPENA: Incomplete +ACM_OPENW: Incomplete +ACM_OPEN: Incomplete +ACM_PLAY: Incomplete +ACM_STOP: Incomplete +ACN_START: int +ACN_STOP: int +MONTHCAL_CLASSA: str +MONTHCAL_CLASS: str +MCM_FIRST: int +MCM_GETCURSEL: Incomplete +MCM_SETCURSEL: Incomplete +MCM_GETMAXSELCOUNT: Incomplete +MCM_SETMAXSELCOUNT: Incomplete +MCM_GETSELRANGE: Incomplete +MCM_SETSELRANGE: Incomplete +MCM_GETMONTHRANGE: Incomplete +MCM_SETDAYSTATE: Incomplete +MCM_GETMINREQRECT: Incomplete +MCM_SETCOLOR: Incomplete +MCM_GETCOLOR: Incomplete +MCSC_BACKGROUND: int +MCSC_TEXT: int +MCSC_TITLEBK: int +MCSC_TITLETEXT: int +MCSC_MONTHBK: int +MCSC_TRAILINGTEXT: int +MCM_SETTODAY: Incomplete +MCM_GETTODAY: Incomplete +MCM_HITTEST: Incomplete +MCHT_TITLE: int +MCHT_CALENDAR: int +MCHT_TODAYLINK: int +MCHT_NEXT: int +MCHT_PREV: int +MCHT_NOWHERE: int +MCHT_TITLEBK: int +MCHT_TITLEMONTH: Incomplete +MCHT_TITLEYEAR: Incomplete +MCHT_TITLEBTNNEXT: Incomplete +MCHT_TITLEBTNPREV: Incomplete +MCHT_CALENDARBK: int +MCHT_CALENDARDATE: Incomplete +MCHT_CALENDARDATENEXT: Incomplete +MCHT_CALENDARDATEPREV: Incomplete +MCHT_CALENDARDAY: Incomplete +MCHT_CALENDARWEEKNUM: Incomplete +MCM_SETFIRSTDAYOFWEEK: Incomplete +MCM_GETFIRSTDAYOFWEEK: Incomplete +MCM_GETRANGE: Incomplete +MCM_SETRANGE: Incomplete +MCM_GETMONTHDELTA: Incomplete +MCM_SETMONTHDELTA: Incomplete +MCM_GETMAXTODAYWIDTH: Incomplete +MCM_SETUNICODEFORMAT: Incomplete +MCM_GETUNICODEFORMAT: Incomplete +MCN_SELCHANGE: Incomplete +MCN_GETDAYSTATE: Incomplete +MCN_SELECT: Incomplete +MCS_DAYSTATE: int +MCS_MULTISELECT: int +MCS_WEEKNUMBERS: int +MCS_NOTODAYCIRCLE: int +MCS_NOTODAY: int +GMR_VISIBLE: int +GMR_DAYSTATE: int +DATETIMEPICK_CLASSA: str +DATETIMEPICK_CLASS: str +DTM_FIRST: int +DTM_GETSYSTEMTIME: Incomplete +DTM_SETSYSTEMTIME: Incomplete +DTM_GETRANGE: Incomplete +DTM_SETRANGE: Incomplete +DTM_SETFORMATA: Incomplete +DTM_SETFORMATW: Incomplete +DTM_SETFORMAT: Incomplete +DTM_SETMCCOLOR: Incomplete +DTM_GETMCCOLOR: Incomplete +DTM_GETMONTHCAL: Incomplete +DTM_SETMCFONT: Incomplete +DTM_GETMCFONT: Incomplete +DTS_UPDOWN: int +DTS_SHOWNONE: int +DTS_SHORTDATEFORMAT: int +DTS_LONGDATEFORMAT: int +DTS_TIMEFORMAT: int +DTS_APPCANPARSE: int +DTS_RIGHTALIGN: int +DTN_DATETIMECHANGE: Incomplete +DTN_USERSTRINGA: Incomplete +DTN_USERSTRINGW: Incomplete +DTN_USERSTRING: Incomplete +DTN_WMKEYDOWNA: Incomplete +DTN_WMKEYDOWNW: Incomplete +DTN_WMKEYDOWN: Incomplete +DTN_FORMATA: Incomplete +DTN_FORMATW: Incomplete +DTN_FORMAT: Incomplete +DTN_FORMATQUERYA: Incomplete +DTN_FORMATQUERYW: Incomplete +DTN_FORMATQUERY: Incomplete +DTN_DROPDOWN: Incomplete +DTN_CLOSEUP: Incomplete +GDTR_MIN: int +GDTR_MAX: int +GDT_ERROR: int +GDT_VALID: int +GDT_NONE: int +IPM_CLEARADDRESS: Incomplete +IPM_SETADDRESS: Incomplete +IPM_GETADDRESS: Incomplete +IPM_SETRANGE: Incomplete +IPM_SETFOCUS: Incomplete +IPM_ISBLANK: Incomplete +WC_IPADDRESSA: str +WC_IPADDRESS: str +IPN_FIELDCHANGED: Incomplete +WC_PAGESCROLLERA: str +WC_PAGESCROLLER: str +PGS_VERT: int +PGS_HORZ: int +PGS_AUTOSCROLL: int +PGS_DRAGNDROP: int +PGF_INVISIBLE: int +PGF_NORMAL: int +PGF_GRAYED: int +PGF_DEPRESSED: int +PGF_HOT: int +PGB_TOPORLEFT: int +PGB_BOTTOMORRIGHT: int +PGM_SETCHILD: Incomplete +PGM_RECALCSIZE: Incomplete +PGM_FORWARDMOUSE: Incomplete +PGM_SETBKCOLOR: Incomplete +PGM_GETBKCOLOR: Incomplete +PGM_SETBORDER: Incomplete +PGM_GETBORDER: Incomplete +PGM_SETPOS: Incomplete +PGM_GETPOS: Incomplete +PGM_SETBUTTONSIZE: Incomplete +PGM_GETBUTTONSIZE: Incomplete +PGM_GETBUTTONSTATE: Incomplete +PGM_GETDROPTARGET: Incomplete +PGN_SCROLL: Incomplete +PGF_SCROLLUP: int +PGF_SCROLLDOWN: int +PGF_SCROLLLEFT: int +PGF_SCROLLRIGHT: int +PGK_SHIFT: int +PGK_CONTROL: int +PGK_MENU: int +PGN_CALCSIZE: Incomplete +PGF_CALCWIDTH: int +PGF_CALCHEIGHT: int +WC_NATIVEFONTCTLA: str +WC_NATIVEFONTCTL: str +NFS_EDIT: int +NFS_STATIC: int +NFS_LISTCOMBO: int +NFS_BUTTON: int +NFS_ALL: int +WM_MOUSEHOVER: int +WM_MOUSELEAVE: int +TME_HOVER: int +TME_LEAVE: int +TME_QUERY: int +TME_CANCEL: int +HOVER_DEFAULT: int +WSB_PROP_CYVSCROLL: int +WSB_PROP_CXHSCROLL: int +WSB_PROP_CYHSCROLL: int +WSB_PROP_CXVSCROLL: int +WSB_PROP_CXHTHUMB: int +WSB_PROP_CYVTHUMB: int +WSB_PROP_VBKGCOLOR: int +WSB_PROP_HBKGCOLOR: int +WSB_PROP_VSTYLE: int +WSB_PROP_HSTYLE: int +WSB_PROP_WINSTYLE: int +WSB_PROP_PALETTE: int +WSB_PROP_MASK: int +FSB_FLAT_MODE: int +FSB_ENCARTA_MODE: int +FSB_REGULAR_MODE: int + +def INDEXTOOVERLAYMASK(i): ... +def INDEXTOSTATEIMAGEMASK(i): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/mmsystem.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/mmsystem.pyi new file mode 100644 index 000000000..667047551 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/mmsystem.pyi @@ -0,0 +1,858 @@ +from _typeshed import Incomplete + +MAXPNAMELEN: int +MAXERRORLENGTH: int +MAX_JOYSTICKOEMVXDNAME: int +MM_MICROSOFT: int +MM_MIDI_MAPPER: int +MM_WAVE_MAPPER: int +MM_SNDBLST_MIDIOUT: int +MM_SNDBLST_MIDIIN: int +MM_SNDBLST_SYNTH: int +MM_SNDBLST_WAVEOUT: int +MM_SNDBLST_WAVEIN: int +MM_ADLIB: int +MM_MPU401_MIDIOUT: int +MM_MPU401_MIDIIN: int +MM_PC_JOYSTICK: int +TIME_MS: int +TIME_SAMPLES: int +TIME_BYTES: int +TIME_SMPTE: int +TIME_MIDI: int +TIME_TICKS: int +MM_JOY1MOVE: int +MM_JOY2MOVE: int +MM_JOY1ZMOVE: int +MM_JOY2ZMOVE: int +MM_JOY1BUTTONDOWN: int +MM_JOY2BUTTONDOWN: int +MM_JOY1BUTTONUP: int +MM_JOY2BUTTONUP: int +MM_MCINOTIFY: int +MM_WOM_OPEN: int +MM_WOM_CLOSE: int +MM_WOM_DONE: int +MM_WIM_OPEN: int +MM_WIM_CLOSE: int +MM_WIM_DATA: int +MM_MIM_OPEN: int +MM_MIM_CLOSE: int +MM_MIM_DATA: int +MM_MIM_LONGDATA: int +MM_MIM_ERROR: int +MM_MIM_LONGERROR: int +MM_MOM_OPEN: int +MM_MOM_CLOSE: int +MM_MOM_DONE: int +MM_STREAM_OPEN: int +MM_STREAM_CLOSE: int +MM_STREAM_DONE: int +MM_STREAM_ERROR: int +MM_MOM_POSITIONCB: int +MM_MIM_MOREDATA: int +MM_MIXM_LINE_CHANGE: int +MM_MIXM_CONTROL_CHANGE: int +MMSYSERR_BASE: int +WAVERR_BASE: int +MIDIERR_BASE: int +TIMERR_BASE: int +JOYERR_BASE: int +MCIERR_BASE: int +MIXERR_BASE: int +MCI_STRING_OFFSET: int +MCI_VD_OFFSET: int +MCI_CD_OFFSET: int +MCI_WAVE_OFFSET: int +MCI_SEQ_OFFSET: int +MMSYSERR_NOERROR: int +MMSYSERR_ERROR: Incomplete +MMSYSERR_BADDEVICEID: Incomplete +MMSYSERR_NOTENABLED: Incomplete +MMSYSERR_ALLOCATED: Incomplete +MMSYSERR_INVALHANDLE: Incomplete +MMSYSERR_NODRIVER: Incomplete +MMSYSERR_NOMEM: Incomplete +MMSYSERR_NOTSUPPORTED: Incomplete +MMSYSERR_BADERRNUM: Incomplete +MMSYSERR_INVALFLAG: Incomplete +MMSYSERR_INVALPARAM: Incomplete +MMSYSERR_HANDLEBUSY: Incomplete +MMSYSERR_INVALIDALIAS: Incomplete +MMSYSERR_BADDB: Incomplete +MMSYSERR_KEYNOTFOUND: Incomplete +MMSYSERR_READERROR: Incomplete +MMSYSERR_WRITEERROR: Incomplete +MMSYSERR_DELETEERROR: Incomplete +MMSYSERR_VALNOTFOUND: Incomplete +MMSYSERR_NODRIVERCB: Incomplete +MMSYSERR_LASTERROR: Incomplete +DRV_LOAD: int +DRV_ENABLE: int +DRV_OPEN: int +DRV_CLOSE: int +DRV_DISABLE: int +DRV_FREE: int +DRV_CONFIGURE: int +DRV_QUERYCONFIGURE: int +DRV_INSTALL: int +DRV_REMOVE: int +DRV_EXITSESSION: int +DRV_POWER: int +DRV_RESERVED: int +DRV_USER: int +DRVCNF_CANCEL: int +DRVCNF_OK: int +DRVCNF_RESTART: int +DRV_CANCEL: int +DRV_OK: int +DRV_RESTART: int +DRV_MCI_FIRST: int +DRV_MCI_LAST: Incomplete +CALLBACK_TYPEMASK: int +CALLBACK_NULL: int +CALLBACK_WINDOW: int +CALLBACK_TASK: int +CALLBACK_FUNCTION: int +CALLBACK_THREAD: int +CALLBACK_EVENT: int +SND_SYNC: int +SND_ASYNC: int +SND_NODEFAULT: int +SND_MEMORY: int +SND_LOOP: int +SND_NOSTOP: int +SND_NOWAIT: int +SND_ALIAS: int +SND_ALIAS_ID: int +SND_FILENAME: int +SND_RESOURCE: int +SND_PURGE: int +SND_APPLICATION: int +SND_ALIAS_START: int +WAVERR_BADFORMAT: Incomplete +WAVERR_STILLPLAYING: Incomplete +WAVERR_UNPREPARED: Incomplete +WAVERR_SYNC: Incomplete +WAVERR_LASTERROR: Incomplete +WOM_OPEN: int +WOM_CLOSE: int +WOM_DONE: int +WIM_OPEN: int +WIM_CLOSE: int +WIM_DATA: int +WAVE_MAPPER: int +WAVE_FORMAT_QUERY: int +WAVE_ALLOWSYNC: int +WAVE_MAPPED: int +WAVE_FORMAT_DIRECT: int +WAVE_FORMAT_DIRECT_QUERY: Incomplete +WHDR_DONE: int +WHDR_PREPARED: int +WHDR_BEGINLOOP: int +WHDR_ENDLOOP: int +WHDR_INQUEUE: int +WAVECAPS_PITCH: int +WAVECAPS_PLAYBACKRATE: int +WAVECAPS_VOLUME: int +WAVECAPS_LRVOLUME: int +WAVECAPS_SYNC: int +WAVECAPS_SAMPLEACCURATE: int +WAVECAPS_DIRECTSOUND: int +WAVE_INVALIDFORMAT: int +WAVE_FORMAT_1M08: int +WAVE_FORMAT_1S08: int +WAVE_FORMAT_1M16: int +WAVE_FORMAT_1S16: int +WAVE_FORMAT_2M08: int +WAVE_FORMAT_2S08: int +WAVE_FORMAT_2M16: int +WAVE_FORMAT_2S16: int +WAVE_FORMAT_4M08: int +WAVE_FORMAT_4S08: int +WAVE_FORMAT_4M16: int +WAVE_FORMAT_4S16: int +WAVE_FORMAT_PCM: int +WAVE_FORMAT_IEEE_FLOAT: int +MIDIERR_UNPREPARED: Incomplete +MIDIERR_STILLPLAYING: Incomplete +MIDIERR_NOMAP: Incomplete +MIDIERR_NOTREADY: Incomplete +MIDIERR_NODEVICE: Incomplete +MIDIERR_INVALIDSETUP: Incomplete +MIDIERR_BADOPENMODE: Incomplete +MIDIERR_DONT_CONTINUE: Incomplete +MIDIERR_LASTERROR: Incomplete +MIDIPATCHSIZE: int +MIM_OPEN: int +MIM_CLOSE: int +MIM_DATA: int +MIM_LONGDATA: int +MIM_ERROR: int +MIM_LONGERROR: int +MOM_OPEN: int +MOM_CLOSE: int +MOM_DONE: int +MIM_MOREDATA: int +MOM_POSITIONCB: int +MIDI_IO_STATUS: int +MIDI_CACHE_ALL: int +MIDI_CACHE_BESTFIT: int +MIDI_CACHE_QUERY: int +MIDI_UNCACHE: int +MOD_MIDIPORT: int +MOD_SYNTH: int +MOD_SQSYNTH: int +MOD_FMSYNTH: int +MOD_MAPPER: int +MIDICAPS_VOLUME: int +MIDICAPS_LRVOLUME: int +MIDICAPS_CACHE: int +MIDICAPS_STREAM: int +MHDR_DONE: int +MHDR_PREPARED: int +MHDR_INQUEUE: int +MHDR_ISSTRM: int +MEVT_F_SHORT: int +MEVT_F_LONG: int +MEVT_F_CALLBACK: int + +def MEVT_EVENTTYPE(x): ... +def MEVT_EVENTPARM(x): ... + +MIDISTRM_ERROR: int +MIDIPROP_SET: int +MIDIPROP_GET: int +MIDIPROP_TIMEDIV: int +MIDIPROP_TEMPO: int +AUXCAPS_CDAUDIO: int +AUXCAPS_AUXIN: int +AUXCAPS_VOLUME: int +AUXCAPS_LRVOLUME: int +MIXER_SHORT_NAME_CHARS: int +MIXER_LONG_NAME_CHARS: int +MIXERR_INVALLINE: Incomplete +MIXERR_INVALCONTROL: Incomplete +MIXERR_INVALVALUE: Incomplete +MIXERR_LASTERROR: Incomplete +MIXER_OBJECTF_HANDLE: int +MIXER_OBJECTF_MIXER: int +MIXER_OBJECTF_HMIXER: Incomplete +MIXER_OBJECTF_WAVEOUT: int +MIXER_OBJECTF_HWAVEOUT: Incomplete +MIXER_OBJECTF_WAVEIN: int +MIXER_OBJECTF_HWAVEIN: Incomplete +MIXER_OBJECTF_MIDIOUT: int +MIXER_OBJECTF_HMIDIOUT: Incomplete +MIXER_OBJECTF_MIDIIN: int +MIXER_OBJECTF_HMIDIIN: Incomplete +MIXER_OBJECTF_AUX: int +MIXERLINE_LINEF_ACTIVE: int +MIXERLINE_LINEF_DISCONNECTED: int +MIXERLINE_LINEF_SOURCE: int +MIXERLINE_COMPONENTTYPE_DST_FIRST: int +MIXERLINE_COMPONENTTYPE_DST_UNDEFINED: Incomplete +MIXERLINE_COMPONENTTYPE_DST_DIGITAL: Incomplete +MIXERLINE_COMPONENTTYPE_DST_LINE: Incomplete +MIXERLINE_COMPONENTTYPE_DST_MONITOR: Incomplete +MIXERLINE_COMPONENTTYPE_DST_SPEAKERS: Incomplete +MIXERLINE_COMPONENTTYPE_DST_HEADPHONES: Incomplete +MIXERLINE_COMPONENTTYPE_DST_TELEPHONE: Incomplete +MIXERLINE_COMPONENTTYPE_DST_WAVEIN: Incomplete +MIXERLINE_COMPONENTTYPE_DST_VOICEIN: Incomplete +MIXERLINE_COMPONENTTYPE_DST_LAST: Incomplete +MIXERLINE_COMPONENTTYPE_SRC_FIRST: int +MIXERLINE_COMPONENTTYPE_SRC_UNDEFINED: Incomplete +MIXERLINE_COMPONENTTYPE_SRC_DIGITAL: Incomplete +MIXERLINE_COMPONENTTYPE_SRC_LINE: Incomplete +MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE: Incomplete +MIXERLINE_COMPONENTTYPE_SRC_SYNTHESIZER: Incomplete +MIXERLINE_COMPONENTTYPE_SRC_COMPACTDISC: Incomplete +MIXERLINE_COMPONENTTYPE_SRC_TELEPHONE: Incomplete +MIXERLINE_COMPONENTTYPE_SRC_PCSPEAKER: Incomplete +MIXERLINE_COMPONENTTYPE_SRC_WAVEOUT: Incomplete +MIXERLINE_COMPONENTTYPE_SRC_AUXILIARY: Incomplete +MIXERLINE_COMPONENTTYPE_SRC_ANALOG: Incomplete +MIXERLINE_COMPONENTTYPE_SRC_LAST: Incomplete +MIXERLINE_TARGETTYPE_UNDEFINED: int +MIXERLINE_TARGETTYPE_WAVEOUT: int +MIXERLINE_TARGETTYPE_WAVEIN: int +MIXERLINE_TARGETTYPE_MIDIOUT: int +MIXERLINE_TARGETTYPE_MIDIIN: int +MIXERLINE_TARGETTYPE_AUX: int +MIXER_GETLINEINFOF_DESTINATION: int +MIXER_GETLINEINFOF_SOURCE: int +MIXER_GETLINEINFOF_LINEID: int +MIXER_GETLINEINFOF_COMPONENTTYPE: int +MIXER_GETLINEINFOF_TARGETTYPE: int +MIXER_GETLINEINFOF_QUERYMASK: int +MIXERCONTROL_CONTROLF_UNIFORM: int +MIXERCONTROL_CONTROLF_MULTIPLE: int +MIXERCONTROL_CONTROLF_DISABLED: int +MIXERCONTROL_CT_CLASS_MASK: int +MIXERCONTROL_CT_CLASS_CUSTOM: int +MIXERCONTROL_CT_CLASS_METER: int +MIXERCONTROL_CT_CLASS_SWITCH: int +MIXERCONTROL_CT_CLASS_NUMBER: int +MIXERCONTROL_CT_CLASS_SLIDER: int +MIXERCONTROL_CT_CLASS_FADER: int +MIXERCONTROL_CT_CLASS_TIME: int +MIXERCONTROL_CT_CLASS_LIST: int +MIXERCONTROL_CT_SUBCLASS_MASK: int +MIXERCONTROL_CT_SC_SWITCH_BOOLEAN: int +MIXERCONTROL_CT_SC_SWITCH_BUTTON: int +MIXERCONTROL_CT_SC_METER_POLLED: int +MIXERCONTROL_CT_SC_TIME_MICROSECS: int +MIXERCONTROL_CT_SC_TIME_MILLISECS: int +MIXERCONTROL_CT_SC_LIST_SINGLE: int +MIXERCONTROL_CT_SC_LIST_MULTIPLE: int +MIXERCONTROL_CT_UNITS_MASK: int +MIXERCONTROL_CT_UNITS_CUSTOM: int +MIXERCONTROL_CT_UNITS_BOOLEAN: int +MIXERCONTROL_CT_UNITS_SIGNED: int +MIXERCONTROL_CT_UNITS_UNSIGNED: int +MIXERCONTROL_CT_UNITS_DECIBELS: int +MIXERCONTROL_CT_UNITS_PERCENT: int +MIXERCONTROL_CONTROLTYPE_CUSTOM: Incomplete +MIXERCONTROL_CONTROLTYPE_BOOLEANMETER: Incomplete +MIXERCONTROL_CONTROLTYPE_SIGNEDMETER: Incomplete +MIXERCONTROL_CONTROLTYPE_PEAKMETER: Incomplete +MIXERCONTROL_CONTROLTYPE_UNSIGNEDMETER: Incomplete +MIXERCONTROL_CONTROLTYPE_BOOLEAN: Incomplete +MIXERCONTROL_CONTROLTYPE_ONOFF: Incomplete +MIXERCONTROL_CONTROLTYPE_MUTE: Incomplete +MIXERCONTROL_CONTROLTYPE_MONO: Incomplete +MIXERCONTROL_CONTROLTYPE_LOUDNESS: Incomplete +MIXERCONTROL_CONTROLTYPE_STEREOENH: Incomplete +MIXERCONTROL_CONTROLTYPE_BUTTON: Incomplete +MIXERCONTROL_CONTROLTYPE_DECIBELS: Incomplete +MIXERCONTROL_CONTROLTYPE_SIGNED: Incomplete +MIXERCONTROL_CONTROLTYPE_UNSIGNED: Incomplete +MIXERCONTROL_CONTROLTYPE_PERCENT: Incomplete +MIXERCONTROL_CONTROLTYPE_SLIDER: Incomplete +MIXERCONTROL_CONTROLTYPE_PAN: Incomplete +MIXERCONTROL_CONTROLTYPE_QSOUNDPAN: Incomplete +MIXERCONTROL_CONTROLTYPE_FADER: Incomplete +MIXERCONTROL_CONTROLTYPE_VOLUME: Incomplete +MIXERCONTROL_CONTROLTYPE_BASS: Incomplete +MIXERCONTROL_CONTROLTYPE_TREBLE: Incomplete +MIXERCONTROL_CONTROLTYPE_EQUALIZER: Incomplete +MIXERCONTROL_CONTROLTYPE_SINGLESELECT: Incomplete +MIXERCONTROL_CONTROLTYPE_MUX: Incomplete +MIXERCONTROL_CONTROLTYPE_MULTIPLESELECT: Incomplete +MIXERCONTROL_CONTROLTYPE_MIXER: Incomplete +MIXERCONTROL_CONTROLTYPE_MICROTIME: Incomplete +MIXERCONTROL_CONTROLTYPE_MILLITIME: Incomplete +MIXER_GETLINECONTROLSF_ALL: int +MIXER_GETLINECONTROLSF_ONEBYID: int +MIXER_GETLINECONTROLSF_ONEBYTYPE: int +MIXER_GETLINECONTROLSF_QUERYMASK: int +MIXER_GETCONTROLDETAILSF_VALUE: int +MIXER_GETCONTROLDETAILSF_LISTTEXT: int +MIXER_GETCONTROLDETAILSF_QUERYMASK: int +MIXER_SETCONTROLDETAILSF_VALUE: int +MIXER_SETCONTROLDETAILSF_CUSTOM: int +MIXER_SETCONTROLDETAILSF_QUERYMASK: int +TIMERR_NOERROR: int +TIMERR_NOCANDO: Incomplete +TIMERR_STRUCT: Incomplete +TIME_ONESHOT: int +TIME_PERIODIC: int +TIME_CALLBACK_FUNCTION: int +TIME_CALLBACK_EVENT_SET: int +TIME_CALLBACK_EVENT_PULSE: int +JOYERR_NOERROR: int +JOYERR_PARMS: Incomplete +JOYERR_NOCANDO: Incomplete +JOYERR_UNPLUGGED: Incomplete +JOY_BUTTON1: int +JOY_BUTTON2: int +JOY_BUTTON3: int +JOY_BUTTON4: int +JOY_BUTTON1CHG: int +JOY_BUTTON2CHG: int +JOY_BUTTON3CHG: int +JOY_BUTTON4CHG: int +JOY_BUTTON5: int +JOY_BUTTON6: int +JOY_BUTTON7: int +JOY_BUTTON8: int +JOY_BUTTON9: int +JOY_BUTTON10: int +JOY_BUTTON11: int +JOY_BUTTON12: int +JOY_BUTTON13: int +JOY_BUTTON14: int +JOY_BUTTON15: int +JOY_BUTTON16: int +JOY_BUTTON17: int +JOY_BUTTON18: int +JOY_BUTTON19: int +JOY_BUTTON20: int +JOY_BUTTON21: int +JOY_BUTTON22: int +JOY_BUTTON23: int +JOY_BUTTON24: int +JOY_BUTTON25: int +JOY_BUTTON26: int +JOY_BUTTON27: int +JOY_BUTTON28: int +JOY_BUTTON29: int +JOY_BUTTON30: int +JOY_BUTTON31: int +JOY_BUTTON32: int +JOY_POVFORWARD: int +JOY_POVRIGHT: int +JOY_POVBACKWARD: int +JOY_POVLEFT: int +JOY_RETURNX: int +JOY_RETURNY: int +JOY_RETURNZ: int +JOY_RETURNR: int +JOY_RETURNU: int +JOY_RETURNV: int +JOY_RETURNPOV: int +JOY_RETURNBUTTONS: int +JOY_RETURNRAWDATA: int +JOY_RETURNPOVCTS: int +JOY_RETURNCENTERED: int +JOY_USEDEADZONE: int +JOY_RETURNALL: Incomplete +JOY_CAL_READALWAYS: int +JOY_CAL_READXYONLY: int +JOY_CAL_READ3: int +JOY_CAL_READ4: int +JOY_CAL_READXONLY: int +JOY_CAL_READYONLY: int +JOY_CAL_READ5: int +JOY_CAL_READ6: int +JOY_CAL_READZONLY: int +JOY_CAL_READRONLY: int +JOY_CAL_READUONLY: int +JOY_CAL_READVONLY: int +JOYSTICKID1: int +JOYSTICKID2: int +JOYCAPS_HASZ: int +JOYCAPS_HASR: int +JOYCAPS_HASU: int +JOYCAPS_HASV: int +JOYCAPS_HASPOV: int +JOYCAPS_POV4DIR: int +JOYCAPS_POVCTS: int +MMIOERR_BASE: int +MMIOERR_FILENOTFOUND: Incomplete +MMIOERR_OUTOFMEMORY: Incomplete +MMIOERR_CANNOTOPEN: Incomplete +MMIOERR_CANNOTCLOSE: Incomplete +MMIOERR_CANNOTREAD: Incomplete +MMIOERR_CANNOTWRITE: Incomplete +MMIOERR_CANNOTSEEK: Incomplete +MMIOERR_CANNOTEXPAND: Incomplete +MMIOERR_CHUNKNOTFOUND: Incomplete +MMIOERR_UNBUFFERED: Incomplete +MMIOERR_PATHNOTFOUND: Incomplete +MMIOERR_ACCESSDENIED: Incomplete +MMIOERR_SHARINGVIOLATION: Incomplete +MMIOERR_NETWORKERROR: Incomplete +MMIOERR_TOOMANYOPENFILES: Incomplete +MMIOERR_INVALIDFILE: Incomplete +CFSEPCHAR: Incomplete +MMIO_RWMODE: int +MMIO_SHAREMODE: int +MMIO_CREATE: int +MMIO_PARSE: int +MMIO_DELETE: int +MMIO_EXIST: int +MMIO_ALLOCBUF: int +MMIO_GETTEMP: int +MMIO_DIRTY: int +MMIO_READ: int +MMIO_WRITE: int +MMIO_READWRITE: int +MMIO_COMPAT: int +MMIO_EXCLUSIVE: int +MMIO_DENYWRITE: int +MMIO_DENYREAD: int +MMIO_DENYNONE: int +MMIO_FHOPEN: int +MMIO_EMPTYBUF: int +MMIO_TOUPPER: int +MMIO_INSTALLPROC: int +MMIO_GLOBALPROC: int +MMIO_REMOVEPROC: int +MMIO_UNICODEPROC: int +MMIO_FINDPROC: int +MMIO_FINDCHUNK: int +MMIO_FINDRIFF: int +MMIO_FINDLIST: int +MMIO_CREATERIFF: int +MMIO_CREATELIST: int +MMIOM_READ: int +MMIOM_WRITE: int +MMIOM_SEEK: int +MMIOM_OPEN: int +MMIOM_CLOSE: int +MMIOM_WRITEFLUSH: int +MMIOM_RENAME: int +MMIOM_USER: int +SEEK_SET: int +SEEK_CUR: int +SEEK_END: int +MMIO_DEFAULTBUFFER: int +MCIERR_INVALID_DEVICE_ID: Incomplete +MCIERR_UNRECOGNIZED_KEYWORD: Incomplete +MCIERR_UNRECOGNIZED_COMMAND: Incomplete +MCIERR_HARDWARE: Incomplete +MCIERR_INVALID_DEVICE_NAME: Incomplete +MCIERR_OUT_OF_MEMORY: Incomplete +MCIERR_DEVICE_OPEN: Incomplete +MCIERR_CANNOT_LOAD_DRIVER: Incomplete +MCIERR_MISSING_COMMAND_STRING: Incomplete +MCIERR_PARAM_OVERFLOW: Incomplete +MCIERR_MISSING_STRING_ARGUMENT: Incomplete +MCIERR_BAD_INTEGER: Incomplete +MCIERR_PARSER_INTERNAL: Incomplete +MCIERR_DRIVER_INTERNAL: Incomplete +MCIERR_MISSING_PARAMETER: Incomplete +MCIERR_UNSUPPORTED_FUNCTION: Incomplete +MCIERR_FILE_NOT_FOUND: Incomplete +MCIERR_DEVICE_NOT_READY: Incomplete +MCIERR_INTERNAL: Incomplete +MCIERR_DRIVER: Incomplete +MCIERR_CANNOT_USE_ALL: Incomplete +MCIERR_MULTIPLE: Incomplete +MCIERR_EXTENSION_NOT_FOUND: Incomplete +MCIERR_OUTOFRANGE: Incomplete +MCIERR_FLAGS_NOT_COMPATIBLE: Incomplete +MCIERR_FILE_NOT_SAVED: Incomplete +MCIERR_DEVICE_TYPE_REQUIRED: Incomplete +MCIERR_DEVICE_LOCKED: Incomplete +MCIERR_DUPLICATE_ALIAS: Incomplete +MCIERR_BAD_CONSTANT: Incomplete +MCIERR_MUST_USE_SHAREABLE: Incomplete +MCIERR_MISSING_DEVICE_NAME: Incomplete +MCIERR_BAD_TIME_FORMAT: Incomplete +MCIERR_NO_CLOSING_QUOTE: Incomplete +MCIERR_DUPLICATE_FLAGS: Incomplete +MCIERR_INVALID_FILE: Incomplete +MCIERR_NULL_PARAMETER_BLOCK: Incomplete +MCIERR_UNNAMED_RESOURCE: Incomplete +MCIERR_NEW_REQUIRES_ALIAS: Incomplete +MCIERR_NOTIFY_ON_AUTO_OPEN: Incomplete +MCIERR_NO_ELEMENT_ALLOWED: Incomplete +MCIERR_NONAPPLICABLE_FUNCTION: Incomplete +MCIERR_ILLEGAL_FOR_AUTO_OPEN: Incomplete +MCIERR_FILENAME_REQUIRED: Incomplete +MCIERR_EXTRA_CHARACTERS: Incomplete +MCIERR_DEVICE_NOT_INSTALLED: Incomplete +MCIERR_GET_CD: Incomplete +MCIERR_SET_CD: Incomplete +MCIERR_SET_DRIVE: Incomplete +MCIERR_DEVICE_LENGTH: Incomplete +MCIERR_DEVICE_ORD_LENGTH: Incomplete +MCIERR_NO_INTEGER: Incomplete +MCIERR_WAVE_OUTPUTSINUSE: Incomplete +MCIERR_WAVE_SETOUTPUTINUSE: Incomplete +MCIERR_WAVE_INPUTSINUSE: Incomplete +MCIERR_WAVE_SETINPUTINUSE: Incomplete +MCIERR_WAVE_OUTPUTUNSPECIFIED: Incomplete +MCIERR_WAVE_INPUTUNSPECIFIED: Incomplete +MCIERR_WAVE_OUTPUTSUNSUITABLE: Incomplete +MCIERR_WAVE_SETOUTPUTUNSUITABLE: Incomplete +MCIERR_WAVE_INPUTSUNSUITABLE: Incomplete +MCIERR_WAVE_SETINPUTUNSUITABLE: Incomplete +MCIERR_SEQ_DIV_INCOMPATIBLE: Incomplete +MCIERR_SEQ_PORT_INUSE: Incomplete +MCIERR_SEQ_PORT_NONEXISTENT: Incomplete +MCIERR_SEQ_PORT_MAPNODEVICE: Incomplete +MCIERR_SEQ_PORT_MISCERROR: Incomplete +MCIERR_SEQ_TIMER: Incomplete +MCIERR_SEQ_PORTUNSPECIFIED: Incomplete +MCIERR_SEQ_NOMIDIPRESENT: Incomplete +MCIERR_NO_WINDOW: Incomplete +MCIERR_CREATEWINDOW: Incomplete +MCIERR_FILE_READ: Incomplete +MCIERR_FILE_WRITE: Incomplete +MCIERR_NO_IDENTITY: Incomplete +MCIERR_CUSTOM_DRIVER_BASE: Incomplete +MCI_FIRST: int +MCI_OPEN: int +MCI_CLOSE: int +MCI_ESCAPE: int +MCI_PLAY: int +MCI_SEEK: int +MCI_STOP: int +MCI_PAUSE: int +MCI_INFO: int +MCI_GETDEVCAPS: int +MCI_SPIN: int +MCI_SET: int +MCI_STEP: int +MCI_RECORD: int +MCI_SYSINFO: int +MCI_BREAK: int +MCI_SAVE: int +MCI_STATUS: int +MCI_CUE: int +MCI_REALIZE: int +MCI_WINDOW: int +MCI_PUT: int +MCI_WHERE: int +MCI_FREEZE: int +MCI_UNFREEZE: int +MCI_LOAD: int +MCI_CUT: int +MCI_COPY: int +MCI_PASTE: int +MCI_UPDATE: int +MCI_RESUME: int +MCI_DELETE: int +MCI_USER_MESSAGES: Incomplete +MCI_LAST: int +MCI_DEVTYPE_VCR: int +MCI_DEVTYPE_VIDEODISC: int +MCI_DEVTYPE_OVERLAY: int +MCI_DEVTYPE_CD_AUDIO: int +MCI_DEVTYPE_DAT: int +MCI_DEVTYPE_SCANNER: int +MCI_DEVTYPE_ANIMATION: int +MCI_DEVTYPE_DIGITAL_VIDEO: int +MCI_DEVTYPE_OTHER: int +MCI_DEVTYPE_WAVEFORM_AUDIO: int +MCI_DEVTYPE_SEQUENCER: int +MCI_DEVTYPE_FIRST: int +MCI_DEVTYPE_LAST: int +MCI_DEVTYPE_FIRST_USER: int +MCI_MODE_NOT_READY: Incomplete +MCI_MODE_STOP: Incomplete +MCI_MODE_PLAY: Incomplete +MCI_MODE_RECORD: Incomplete +MCI_MODE_SEEK: Incomplete +MCI_MODE_PAUSE: Incomplete +MCI_MODE_OPEN: Incomplete +MCI_FORMAT_MILLISECONDS: int +MCI_FORMAT_HMS: int +MCI_FORMAT_MSF: int +MCI_FORMAT_FRAMES: int +MCI_FORMAT_SMPTE_24: int +MCI_FORMAT_SMPTE_25: int +MCI_FORMAT_SMPTE_30: int +MCI_FORMAT_SMPTE_30DROP: int +MCI_FORMAT_BYTES: int +MCI_FORMAT_SAMPLES: int +MCI_FORMAT_TMSF: int + +def MCI_MSF_MINUTE(msf): ... +def MCI_MSF_SECOND(msf): ... +def MCI_MSF_FRAME(msf): ... +def MCI_TMSF_TRACK(tmsf): ... +def MCI_TMSF_MINUTE(tmsf): ... +def MCI_TMSF_SECOND(tmsf): ... +def MCI_TMSF_FRAME(tmsf): ... +def MCI_HMS_HOUR(hms): ... +def MCI_HMS_MINUTE(hms): ... +def MCI_HMS_SECOND(hms): ... + +MCI_NOTIFY_SUCCESSFUL: int +MCI_NOTIFY_SUPERSEDED: int +MCI_NOTIFY_ABORTED: int +MCI_NOTIFY_FAILURE: int +MCI_NOTIFY: int +MCI_WAIT: int +MCI_FROM: int +MCI_TO: int +MCI_TRACK: int +MCI_OPEN_SHAREABLE: int +MCI_OPEN_ELEMENT: int +MCI_OPEN_ALIAS: int +MCI_OPEN_ELEMENT_ID: int +MCI_OPEN_TYPE_ID: int +MCI_OPEN_TYPE: int +MCI_SEEK_TO_START: int +MCI_SEEK_TO_END: int +MCI_STATUS_ITEM: int +MCI_STATUS_START: int +MCI_STATUS_LENGTH: int +MCI_STATUS_POSITION: int +MCI_STATUS_NUMBER_OF_TRACKS: int +MCI_STATUS_MODE: int +MCI_STATUS_MEDIA_PRESENT: int +MCI_STATUS_TIME_FORMAT: int +MCI_STATUS_READY: int +MCI_STATUS_CURRENT_TRACK: int +MCI_INFO_PRODUCT: int +MCI_INFO_FILE: int +MCI_INFO_MEDIA_UPC: int +MCI_INFO_MEDIA_IDENTITY: int +MCI_INFO_NAME: int +MCI_INFO_COPYRIGHT: int +MCI_GETDEVCAPS_ITEM: int +MCI_GETDEVCAPS_CAN_RECORD: int +MCI_GETDEVCAPS_HAS_AUDIO: int +MCI_GETDEVCAPS_HAS_VIDEO: int +MCI_GETDEVCAPS_DEVICE_TYPE: int +MCI_GETDEVCAPS_USES_FILES: int +MCI_GETDEVCAPS_COMPOUND_DEVICE: int +MCI_GETDEVCAPS_CAN_EJECT: int +MCI_GETDEVCAPS_CAN_PLAY: int +MCI_GETDEVCAPS_CAN_SAVE: int +MCI_SYSINFO_QUANTITY: int +MCI_SYSINFO_OPEN: int +MCI_SYSINFO_NAME: int +MCI_SYSINFO_INSTALLNAME: int +MCI_SET_DOOR_OPEN: int +MCI_SET_DOOR_CLOSED: int +MCI_SET_TIME_FORMAT: int +MCI_SET_AUDIO: int +MCI_SET_VIDEO: int +MCI_SET_ON: int +MCI_SET_OFF: int +MCI_SET_AUDIO_ALL: int +MCI_SET_AUDIO_LEFT: int +MCI_SET_AUDIO_RIGHT: int +MCI_BREAK_KEY: int +MCI_BREAK_HWND: int +MCI_BREAK_OFF: int +MCI_RECORD_INSERT: int +MCI_RECORD_OVERWRITE: int +MCI_SAVE_FILE: int +MCI_LOAD_FILE: int +MCI_VD_MODE_PARK: Incomplete +MCI_VD_MEDIA_CLV: Incomplete +MCI_VD_MEDIA_CAV: Incomplete +MCI_VD_MEDIA_OTHER: Incomplete +MCI_VD_FORMAT_TRACK: int +MCI_VD_PLAY_REVERSE: int +MCI_VD_PLAY_FAST: int +MCI_VD_PLAY_SPEED: int +MCI_VD_PLAY_SCAN: int +MCI_VD_PLAY_SLOW: int +MCI_VD_SEEK_REVERSE: int +MCI_VD_STATUS_SPEED: int +MCI_VD_STATUS_FORWARD: int +MCI_VD_STATUS_MEDIA_TYPE: int +MCI_VD_STATUS_SIDE: int +MCI_VD_STATUS_DISC_SIZE: int +MCI_VD_GETDEVCAPS_CLV: int +MCI_VD_GETDEVCAPS_CAV: int +MCI_VD_SPIN_UP: int +MCI_VD_SPIN_DOWN: int +MCI_VD_GETDEVCAPS_CAN_REVERSE: int +MCI_VD_GETDEVCAPS_FAST_RATE: int +MCI_VD_GETDEVCAPS_SLOW_RATE: int +MCI_VD_GETDEVCAPS_NORMAL_RATE: int +MCI_VD_STEP_FRAMES: int +MCI_VD_STEP_REVERSE: int +MCI_VD_ESCAPE_STRING: int +MCI_CDA_STATUS_TYPE_TRACK: int +MCI_CDA_TRACK_AUDIO: Incomplete +MCI_CDA_TRACK_OTHER: Incomplete +MCI_WAVE_PCM: Incomplete +MCI_WAVE_MAPPER: Incomplete +MCI_WAVE_OPEN_BUFFER: int +MCI_WAVE_SET_FORMATTAG: int +MCI_WAVE_SET_CHANNELS: int +MCI_WAVE_SET_SAMPLESPERSEC: int +MCI_WAVE_SET_AVGBYTESPERSEC: int +MCI_WAVE_SET_BLOCKALIGN: int +MCI_WAVE_SET_BITSPERSAMPLE: int +MCI_WAVE_INPUT: int +MCI_WAVE_OUTPUT: int +MCI_WAVE_STATUS_FORMATTAG: int +MCI_WAVE_STATUS_CHANNELS: int +MCI_WAVE_STATUS_SAMPLESPERSEC: int +MCI_WAVE_STATUS_AVGBYTESPERSEC: int +MCI_WAVE_STATUS_BLOCKALIGN: int +MCI_WAVE_STATUS_BITSPERSAMPLE: int +MCI_WAVE_STATUS_LEVEL: int +MCI_WAVE_SET_ANYINPUT: int +MCI_WAVE_SET_ANYOUTPUT: int +MCI_WAVE_GETDEVCAPS_INPUTS: int +MCI_WAVE_GETDEVCAPS_OUTPUTS: int +MCI_SEQ_DIV_PPQN: Incomplete +MCI_SEQ_DIV_SMPTE_24: Incomplete +MCI_SEQ_DIV_SMPTE_25: Incomplete +MCI_SEQ_DIV_SMPTE_30DROP: Incomplete +MCI_SEQ_DIV_SMPTE_30: Incomplete +MCI_SEQ_FORMAT_SONGPTR: int +MCI_SEQ_FILE: int +MCI_SEQ_MIDI: int +MCI_SEQ_SMPTE: int +MCI_SEQ_NONE: int +MCI_SEQ_MAPPER: int +MCI_SEQ_STATUS_TEMPO: int +MCI_SEQ_STATUS_PORT: int +MCI_SEQ_STATUS_SLAVE: int +MCI_SEQ_STATUS_MASTER: int +MCI_SEQ_STATUS_OFFSET: int +MCI_SEQ_STATUS_DIVTYPE: int +MCI_SEQ_STATUS_NAME: int +MCI_SEQ_STATUS_COPYRIGHT: int +MCI_SEQ_SET_TEMPO: int +MCI_SEQ_SET_PORT: int +MCI_SEQ_SET_SLAVE: int +MCI_SEQ_SET_MASTER: int +MCI_SEQ_SET_OFFSET: int +MCI_ANIM_OPEN_WS: int +MCI_ANIM_OPEN_PARENT: int +MCI_ANIM_OPEN_NOSTATIC: int +MCI_ANIM_PLAY_SPEED: int +MCI_ANIM_PLAY_REVERSE: int +MCI_ANIM_PLAY_FAST: int +MCI_ANIM_PLAY_SLOW: int +MCI_ANIM_PLAY_SCAN: int +MCI_ANIM_STEP_REVERSE: int +MCI_ANIM_STEP_FRAMES: int +MCI_ANIM_STATUS_SPEED: int +MCI_ANIM_STATUS_FORWARD: int +MCI_ANIM_STATUS_HWND: int +MCI_ANIM_STATUS_HPAL: int +MCI_ANIM_STATUS_STRETCH: int +MCI_ANIM_INFO_TEXT: int +MCI_ANIM_GETDEVCAPS_CAN_REVERSE: int +MCI_ANIM_GETDEVCAPS_FAST_RATE: int +MCI_ANIM_GETDEVCAPS_SLOW_RATE: int +MCI_ANIM_GETDEVCAPS_NORMAL_RATE: int +MCI_ANIM_GETDEVCAPS_PALETTES: int +MCI_ANIM_GETDEVCAPS_CAN_STRETCH: int +MCI_ANIM_GETDEVCAPS_MAX_WINDOWS: int +MCI_ANIM_REALIZE_NORM: int +MCI_ANIM_REALIZE_BKGD: int +MCI_ANIM_WINDOW_HWND: int +MCI_ANIM_WINDOW_STATE: int +MCI_ANIM_WINDOW_TEXT: int +MCI_ANIM_WINDOW_ENABLE_STRETCH: int +MCI_ANIM_WINDOW_DISABLE_STRETCH: int +MCI_ANIM_WINDOW_DEFAULT: int +MCI_ANIM_RECT: int +MCI_ANIM_PUT_SOURCE: int +MCI_ANIM_PUT_DESTINATION: int +MCI_ANIM_WHERE_SOURCE: int +MCI_ANIM_WHERE_DESTINATION: int +MCI_ANIM_UPDATE_HDC: int +MCI_OVLY_OPEN_WS: int +MCI_OVLY_OPEN_PARENT: int +MCI_OVLY_STATUS_HWND: int +MCI_OVLY_STATUS_STRETCH: int +MCI_OVLY_INFO_TEXT: int +MCI_OVLY_GETDEVCAPS_CAN_STRETCH: int +MCI_OVLY_GETDEVCAPS_CAN_FREEZE: int +MCI_OVLY_GETDEVCAPS_MAX_WINDOWS: int +MCI_OVLY_WINDOW_HWND: int +MCI_OVLY_WINDOW_STATE: int +MCI_OVLY_WINDOW_TEXT: int +MCI_OVLY_WINDOW_ENABLE_STRETCH: int +MCI_OVLY_WINDOW_DISABLE_STRETCH: int +MCI_OVLY_WINDOW_DEFAULT: int +MCI_OVLY_RECT: int +MCI_OVLY_PUT_SOURCE: int +MCI_OVLY_PUT_DESTINATION: int +MCI_OVLY_PUT_FRAME: int +MCI_OVLY_PUT_VIDEO: int +MCI_OVLY_WHERE_SOURCE: int +MCI_OVLY_WHERE_DESTINATION: int +MCI_OVLY_WHERE_FRAME: int +MCI_OVLY_WHERE_VIDEO: int +SELECTDIB: int + +def DIBINDEX(n): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/ntsecuritycon.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/ntsecuritycon.pyi new file mode 100644 index 000000000..19bb7a9d5 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/ntsecuritycon.pyi @@ -0,0 +1,554 @@ +from typing_extensions import TypeAlias + +_SixIntTuple: TypeAlias = tuple[int, int, int, int, int, int] + +DELETE: int +READ_CONTROL: int +WRITE_DAC: int +WRITE_OWNER: int +SYNCHRONIZE: int +STANDARD_RIGHTS_REQUIRED: int +STANDARD_RIGHTS_READ: int +STANDARD_RIGHTS_WRITE: int +STANDARD_RIGHTS_EXECUTE: int +STANDARD_RIGHTS_ALL: int +SPECIFIC_RIGHTS_ALL: int +ACCESS_SYSTEM_SECURITY: int +MAXIMUM_ALLOWED: int +GENERIC_READ: int +GENERIC_WRITE: int +GENERIC_EXECUTE: int +GENERIC_ALL: int +FILE_READ_DATA: int +FILE_WRITE_DATA: int +FILE_ADD_FILE: int +FILE_APPEND_DATA: int +FILE_ADD_SUBDIRECTORY: int +FILE_CREATE_PIPE_INSTANCE: int +FILE_READ_EA: int +FILE_WRITE_EA: int +FILE_EXECUTE: int +FILE_TRAVERSE: int +FILE_DELETE_CHILD: int +FILE_READ_ATTRIBUTES: int +FILE_WRITE_ATTRIBUTES: int +FILE_ALL_ACCESS: int +FILE_GENERIC_READ: int +FILE_GENERIC_WRITE: int +FILE_GENERIC_EXECUTE: int +SECURITY_NULL_SID_AUTHORITY: _SixIntTuple +SECURITY_WORLD_SID_AUTHORITY: _SixIntTuple +SECURITY_LOCAL_SID_AUTHORITY: _SixIntTuple +SECURITY_CREATOR_SID_AUTHORITY: _SixIntTuple +SECURITY_NON_UNIQUE_AUTHORITY: _SixIntTuple +SECURITY_RESOURCE_MANAGER_AUTHORITY: _SixIntTuple +SECURITY_NULL_RID: int +SECURITY_WORLD_RID: int +SECURITY_LOCAL_RID: int +SECURITY_CREATOR_OWNER_RID: int +SECURITY_CREATOR_GROUP_RID: int +SECURITY_CREATOR_OWNER_SERVER_RID: int +SECURITY_CREATOR_GROUP_SERVER_RID: int +SECURITY_CREATOR_OWNER_RIGHTS_RID: int +SECURITY_NT_AUTHORITY: _SixIntTuple +SECURITY_DIALUP_RID: int +SECURITY_NETWORK_RID: int +SECURITY_BATCH_RID: int +SECURITY_INTERACTIVE_RID: int +SECURITY_SERVICE_RID: int +SECURITY_ANONYMOUS_LOGON_RID: int +SECURITY_PROXY_RID: int +SECURITY_SERVER_LOGON_RID: int +SECURITY_LOGON_IDS_RID: int +SECURITY_LOGON_IDS_RID_COUNT: int +SECURITY_LOCAL_SYSTEM_RID: int +SECURITY_NT_NON_UNIQUE: int +SECURITY_BUILTIN_DOMAIN_RID: int +DOMAIN_USER_RID_ADMIN: int +DOMAIN_USER_RID_GUEST: int +DOMAIN_USER_RID_KRBTGT: int +DOMAIN_USER_RID_MAX: int +DOMAIN_GROUP_RID_ADMINS: int +DOMAIN_GROUP_RID_USERS: int +DOMAIN_GROUP_RID_GUESTS: int +DOMAIN_GROUP_RID_COMPUTERS: int +DOMAIN_GROUP_RID_CONTROLLERS: int +DOMAIN_GROUP_RID_CERT_ADMINS: int +DOMAIN_GROUP_RID_SCHEMA_ADMINS: int +DOMAIN_GROUP_RID_ENTERPRISE_ADMINS: int +DOMAIN_GROUP_RID_POLICY_ADMINS: int +DOMAIN_GROUP_RID_READONLY_CONTROLLERS: int +DOMAIN_ALIAS_RID_ADMINS: int +DOMAIN_ALIAS_RID_USERS: int +DOMAIN_ALIAS_RID_GUESTS: int +DOMAIN_ALIAS_RID_POWER_USERS: int +DOMAIN_ALIAS_RID_ACCOUNT_OPS: int +DOMAIN_ALIAS_RID_SYSTEM_OPS: int +DOMAIN_ALIAS_RID_PRINT_OPS: int +DOMAIN_ALIAS_RID_BACKUP_OPS: int +DOMAIN_ALIAS_RID_REPLICATOR: int +DOMAIN_ALIAS_RID_RAS_SERVERS: int +DOMAIN_ALIAS_RID_PREW2KCOMPACCESS: int +DOMAIN_ALIAS_RID_REMOTE_DESKTOP_USERS: int +DOMAIN_ALIAS_RID_NETWORK_CONFIGURATION_OPS: int +DOMAIN_ALIAS_RID_INCOMING_FOREST_TRUST_BUILDERS: int +DOMAIN_ALIAS_RID_MONITORING_USERS: int +DOMAIN_ALIAS_RID_LOGGING_USERS: int +DOMAIN_ALIAS_RID_AUTHORIZATIONACCESS: int +DOMAIN_ALIAS_RID_TS_LICENSE_SERVERS: int +DOMAIN_ALIAS_RID_DCOM_USERS: int +DOMAIN_ALIAS_RID_IUSERS: int +DOMAIN_ALIAS_RID_CRYPTO_OPERATORS: int +DOMAIN_ALIAS_RID_CACHEABLE_PRINCIPALS_GROUP: int +DOMAIN_ALIAS_RID_NON_CACHEABLE_PRINCIPALS_GROUP: int +DOMAIN_ALIAS_RID_EVENT_LOG_READERS_GROUP: int +SECURITY_MANDATORY_LABEL_AUTHORITY: _SixIntTuple +SECURITY_MANDATORY_UNTRUSTED_RID: int +SECURITY_MANDATORY_LOW_RID: int +SECURITY_MANDATORY_MEDIUM_RID: int +SECURITY_MANDATORY_HIGH_RID: int +SECURITY_MANDATORY_SYSTEM_RID: int +SECURITY_MANDATORY_PROTECTED_PROCESS_RID: int +SECURITY_MANDATORY_MAXIMUM_USER_RID: int +SYSTEM_LUID: tuple[int, int] +ANONYMOUS_LOGON_LUID: tuple[int, int] +LOCALSERVICE_LUID: tuple[int, int] +NETWORKSERVICE_LUID: tuple[int, int] +IUSER_LUID: tuple[int, int] +SE_GROUP_MANDATORY: int +SE_GROUP_ENABLED_BY_DEFAULT: int +SE_GROUP_ENABLED: int +SE_GROUP_OWNER: int +SE_GROUP_USE_FOR_DENY_ONLY: int +SE_GROUP_INTEGRITY: int +SE_GROUP_INTEGRITY_ENABLED: int +SE_GROUP_RESOURCE: int +SE_GROUP_LOGON_ID: int +ACCESS_MIN_MS_ACE_TYPE: int +ACCESS_ALLOWED_ACE_TYPE: int +ACCESS_DENIED_ACE_TYPE: int +SYSTEM_AUDIT_ACE_TYPE: int +SYSTEM_ALARM_ACE_TYPE: int +ACCESS_MAX_MS_V2_ACE_TYPE: int +ACCESS_ALLOWED_COMPOUND_ACE_TYPE: int +ACCESS_MAX_MS_V3_ACE_TYPE: int +ACCESS_MIN_MS_OBJECT_ACE_TYPE: int +ACCESS_ALLOWED_OBJECT_ACE_TYPE: int +ACCESS_DENIED_OBJECT_ACE_TYPE: int +SYSTEM_AUDIT_OBJECT_ACE_TYPE: int +SYSTEM_ALARM_OBJECT_ACE_TYPE: int +ACCESS_MAX_MS_OBJECT_ACE_TYPE: int +ACCESS_MAX_MS_V4_ACE_TYPE: int +ACCESS_MAX_MS_ACE_TYPE: int +ACCESS_ALLOWED_CALLBACK_ACE_TYPE: int +ACCESS_DENIED_CALLBACK_ACE_TYPE: int +ACCESS_ALLOWED_CALLBACK_OBJECT_ACE_TYPE: int +ACCESS_DENIED_CALLBACK_OBJECT_ACE_TYPE: int +SYSTEM_AUDIT_CALLBACK_ACE_TYPE: int +SYSTEM_ALARM_CALLBACK_ACE_TYPE: int +SYSTEM_AUDIT_CALLBACK_OBJECT_ACE_TYPE: int +SYSTEM_ALARM_CALLBACK_OBJECT_ACE_TYPE: int +SYSTEM_MANDATORY_LABEL_ACE_TYPE: int +ACCESS_MAX_MS_V5_ACE_TYPE: int +OBJECT_INHERIT_ACE: int +CONTAINER_INHERIT_ACE: int +NO_PROPAGATE_INHERIT_ACE: int +INHERIT_ONLY_ACE: int +VALID_INHERIT_FLAGS: int +SUCCESSFUL_ACCESS_ACE_FLAG: int +FAILED_ACCESS_ACE_FLAG: int +SE_OWNER_DEFAULTED: int +SE_GROUP_DEFAULTED: int +SE_DACL_PRESENT: int +SE_DACL_DEFAULTED: int +SE_SACL_PRESENT: int +SE_SACL_DEFAULTED: int +SE_SELF_RELATIVE: int +SE_PRIVILEGE_ENABLED_BY_DEFAULT: int +SE_PRIVILEGE_ENABLED: int +SE_PRIVILEGE_USED_FOR_ACCESS: int +PRIVILEGE_SET_ALL_NECESSARY: int +SE_CREATE_TOKEN_NAME: str +SE_ASSIGNPRIMARYTOKEN_NAME: str +SE_LOCK_MEMORY_NAME: str +SE_INCREASE_QUOTA_NAME: str +SE_UNSOLICITED_INPUT_NAME: str +SE_MACHINE_ACCOUNT_NAME: str +SE_TCB_NAME: str +SE_SECURITY_NAME: str +SE_TAKE_OWNERSHIP_NAME: str +SE_LOAD_DRIVER_NAME: str +SE_SYSTEM_PROFILE_NAME: str +SE_SYSTEMTIME_NAME: str +SE_PROF_SINGLE_PROCESS_NAME: str +SE_INC_BASE_PRIORITY_NAME: str +SE_CREATE_PAGEFILE_NAME: str +SE_CREATE_PERMANENT_NAME: str +SE_BACKUP_NAME: str +SE_RESTORE_NAME: str +SE_SHUTDOWN_NAME: str +SE_DEBUG_NAME: str +SE_AUDIT_NAME: str +SE_SYSTEM_ENVIRONMENT_NAME: str +SE_CHANGE_NOTIFY_NAME: str +SE_REMOTE_SHUTDOWN_NAME: str +SecurityAnonymous: int +SecurityIdentification: int +SecurityImpersonation: int +SecurityDelegation: int +SECURITY_MAX_IMPERSONATION_LEVEL: int +DEFAULT_IMPERSONATION_LEVEL: int +TOKEN_ASSIGN_PRIMARY: int +TOKEN_DUPLICATE: int +TOKEN_IMPERSONATE: int +TOKEN_QUERY: int +TOKEN_QUERY_SOURCE: int +TOKEN_ADJUST_PRIVILEGES: int +TOKEN_ADJUST_GROUPS: int +TOKEN_ADJUST_DEFAULT: int +TOKEN_ALL_ACCESS: int +TOKEN_READ: int +TOKEN_WRITE: int +TOKEN_EXECUTE: int +SidTypeUser: int +SidTypeGroup: int +SidTypeDomain: int +SidTypeAlias: int +SidTypeWellKnownGroup: int +SidTypeDeletedAccount: int +SidTypeInvalid: int +SidTypeUnknown: int +SidTypeComputer: int +SidTypeLabel: int +TokenPrimary: int +TokenImpersonation: int +TokenUser: int +TokenGroups: int +TokenPrivileges: int +TokenOwner: int +TokenPrimaryGroup: int +TokenDefaultDacl: int +TokenSource: int +TokenType: int +TokenImpersonationLevel: int +TokenStatistics: int +TokenRestrictedSids: int +TokenSessionId: int +TokenGroupsAndPrivileges: int +TokenSessionReference: int +TokenSandBoxInert: int +TokenAuditPolicy: int +TokenOrigin: int +TokenElevationType: int +TokenLinkedToken: int +TokenElevation: int +TokenHasRestrictions: int +TokenAccessInformation: int +TokenVirtualizationAllowed: int +TokenVirtualizationEnabled: int +TokenIntegrityLevel: int +TokenUIAccess: int +TokenMandatoryPolicy: int +TokenLogonSid: int +DS_BEHAVIOR_WIN2000: int +DS_BEHAVIOR_WIN2003_WITH_MIXED_DOMAINS: int +DS_BEHAVIOR_WIN2003: int +DS_SYNCED_EVENT_NAME: str +ACTRL_DS_OPEN: int +ACTRL_DS_CREATE_CHILD: int +ACTRL_DS_DELETE_CHILD: int +ACTRL_DS_SELF: int +ACTRL_DS_READ_PROP: int +ACTRL_DS_WRITE_PROP: int +ACTRL_DS_DELETE_TREE: int +ACTRL_DS_CONTROL_ACCESS: int +NTDSAPI_BIND_ALLOW_DELEGATION: int +DS_REPSYNC_ASYNCHRONOUS_OPERATION: int +DS_REPSYNC_WRITEABLE: int +DS_REPSYNC_PERIODIC: int +DS_REPSYNC_INTERSITE_MESSAGING: int +DS_REPSYNC_ALL_SOURCES: int +DS_REPSYNC_FULL: int +DS_REPSYNC_URGENT: int +DS_REPSYNC_NO_DISCARD: int +DS_REPSYNC_FORCE: int +DS_REPSYNC_ADD_REFERENCE: int +DS_REPSYNC_NEVER_COMPLETED: int +DS_REPSYNC_TWO_WAY: int +DS_REPSYNC_NEVER_NOTIFY: int +DS_REPSYNC_INITIAL: int +DS_REPSYNC_USE_COMPRESSION: int +DS_REPSYNC_ABANDONED: int +DS_REPSYNC_INITIAL_IN_PROGRESS: int +DS_REPSYNC_PARTIAL_ATTRIBUTE_SET: int +DS_REPSYNC_REQUEUE: int +DS_REPSYNC_NOTIFICATION: int +DS_REPSYNC_ASYNCHRONOUS_REPLICA: int +DS_REPSYNC_CRITICAL: int +DS_REPSYNC_FULL_IN_PROGRESS: int +DS_REPSYNC_PREEMPTED: int +DS_REPADD_ASYNCHRONOUS_OPERATION: int +DS_REPADD_WRITEABLE: int +DS_REPADD_INITIAL: int +DS_REPADD_PERIODIC: int +DS_REPADD_INTERSITE_MESSAGING: int +DS_REPADD_ASYNCHRONOUS_REPLICA: int +DS_REPADD_DISABLE_NOTIFICATION: int +DS_REPADD_DISABLE_PERIODIC: int +DS_REPADD_USE_COMPRESSION: int +DS_REPADD_NEVER_NOTIFY: int +DS_REPADD_TWO_WAY: int +DS_REPADD_CRITICAL: int +DS_REPDEL_ASYNCHRONOUS_OPERATION: int +DS_REPDEL_WRITEABLE: int +DS_REPDEL_INTERSITE_MESSAGING: int +DS_REPDEL_IGNORE_ERRORS: int +DS_REPDEL_LOCAL_ONLY: int +DS_REPDEL_NO_SOURCE: int +DS_REPDEL_REF_OK: int +DS_REPMOD_ASYNCHRONOUS_OPERATION: int +DS_REPMOD_WRITEABLE: int +DS_REPMOD_UPDATE_FLAGS: int +DS_REPMOD_UPDATE_ADDRESS: int +DS_REPMOD_UPDATE_SCHEDULE: int +DS_REPMOD_UPDATE_RESULT: int +DS_REPMOD_UPDATE_TRANSPORT: int +DS_REPUPD_ASYNCHRONOUS_OPERATION: int +DS_REPUPD_WRITEABLE: int +DS_REPUPD_ADD_REFERENCE: int +DS_REPUPD_DELETE_REFERENCE: int +DS_INSTANCETYPE_IS_NC_HEAD: int +DS_INSTANCETYPE_NC_IS_WRITEABLE: int +DS_INSTANCETYPE_NC_COMING: int +DS_INSTANCETYPE_NC_GOING: int +NTDSDSA_OPT_IS_GC: int +NTDSDSA_OPT_DISABLE_INBOUND_REPL: int +NTDSDSA_OPT_DISABLE_OUTBOUND_REPL: int +NTDSDSA_OPT_DISABLE_NTDSCONN_XLATE: int +NTDSCONN_OPT_IS_GENERATED: int +NTDSCONN_OPT_TWOWAY_SYNC: int +NTDSCONN_OPT_OVERRIDE_NOTIFY_DEFAULT: int +NTDSCONN_OPT_USE_NOTIFY: int +NTDSCONN_OPT_DISABLE_INTERSITE_COMPRESSION: int +NTDSCONN_OPT_USER_OWNED_SCHEDULE: int +NTDSCONN_KCC_NO_REASON: int +NTDSCONN_KCC_GC_TOPOLOGY: int +NTDSCONN_KCC_RING_TOPOLOGY: int +NTDSCONN_KCC_MINIMIZE_HOPS_TOPOLOGY: int +NTDSCONN_KCC_STALE_SERVERS_TOPOLOGY: int +NTDSCONN_KCC_OSCILLATING_CONNECTION_TOPOLOGY: int +NTDSCONN_KCC_INTERSITE_GC_TOPOLOGY: int +NTDSCONN_KCC_INTERSITE_TOPOLOGY: int +NTDSCONN_KCC_SERVER_FAILOVER_TOPOLOGY: int +NTDSCONN_KCC_SITE_FAILOVER_TOPOLOGY: int +NTDSCONN_KCC_REDUNDANT_SERVER_TOPOLOGY: int +FRSCONN_PRIORITY_MASK: int +FRSCONN_MAX_PRIORITY: int +NTDSCONN_OPT_IGNORE_SCHEDULE_MASK: int +NTDSSETTINGS_OPT_IS_AUTO_TOPOLOGY_DISABLED: int +NTDSSETTINGS_OPT_IS_TOPL_CLEANUP_DISABLED: int +NTDSSETTINGS_OPT_IS_TOPL_MIN_HOPS_DISABLED: int +NTDSSETTINGS_OPT_IS_TOPL_DETECT_STALE_DISABLED: int +NTDSSETTINGS_OPT_IS_INTER_SITE_AUTO_TOPOLOGY_DISABLED: int +NTDSSETTINGS_OPT_IS_GROUP_CACHING_ENABLED: int +NTDSSETTINGS_OPT_FORCE_KCC_WHISTLER_BEHAVIOR: int +NTDSSETTINGS_OPT_FORCE_KCC_W2K_ELECTION: int +NTDSSETTINGS_OPT_IS_RAND_BH_SELECTION_DISABLED: int +NTDSSETTINGS_OPT_IS_SCHEDULE_HASHING_ENABLED: int +NTDSSETTINGS_OPT_IS_REDUNDANT_SERVER_TOPOLOGY_ENABLED: int +NTDSSETTINGS_DEFAULT_SERVER_REDUNDANCY: int +NTDSTRANSPORT_OPT_IGNORE_SCHEDULES: int +NTDSTRANSPORT_OPT_BRIDGES_REQUIRED: int +NTDSSITECONN_OPT_USE_NOTIFY: int +NTDSSITECONN_OPT_TWOWAY_SYNC: int +NTDSSITECONN_OPT_DISABLE_COMPRESSION: int +NTDSSITELINK_OPT_USE_NOTIFY: int +NTDSSITELINK_OPT_TWOWAY_SYNC: int +NTDSSITELINK_OPT_DISABLE_COMPRESSION: int +GUID_USERS_CONTAINER_A: str +GUID_COMPUTRS_CONTAINER_A: str +GUID_SYSTEMS_CONTAINER_A: str +GUID_DOMAIN_CONTROLLERS_CONTAINER_A: str +GUID_INFRASTRUCTURE_CONTAINER_A: str +GUID_DELETED_OBJECTS_CONTAINER_A: str +GUID_LOSTANDFOUND_CONTAINER_A: str +GUID_FOREIGNSECURITYPRINCIPALS_CONTAINER_A: str +GUID_PROGRAM_DATA_CONTAINER_A: str +GUID_MICROSOFT_PROGRAM_DATA_CONTAINER_A: str +GUID_NTDS_QUOTAS_CONTAINER_A: str +GUID_USERS_CONTAINER_BYTE: str +GUID_COMPUTRS_CONTAINER_BYTE: str +GUID_SYSTEMS_CONTAINER_BYTE: str +GUID_DOMAIN_CONTROLLERS_CONTAINER_BYTE: str +GUID_INFRASTRUCTURE_CONTAINER_BYTE: str +GUID_DELETED_OBJECTS_CONTAINER_BYTE: str +GUID_LOSTANDFOUND_CONTAINER_BYTE: str +GUID_FOREIGNSECURITYPRINCIPALS_CONTAINER_BYTE: str +GUID_PROGRAM_DATA_CONTAINER_BYTE: str +GUID_MICROSOFT_PROGRAM_DATA_CONTAINER_BYTE: str +GUID_NTDS_QUOTAS_CONTAINER_BYTE: str +DS_REPSYNCALL_NO_OPTIONS: int +DS_REPSYNCALL_ABORT_IF_SERVER_UNAVAILABLE: int +DS_REPSYNCALL_SYNC_ADJACENT_SERVERS_ONLY: int +DS_REPSYNCALL_ID_SERVERS_BY_DN: int +DS_REPSYNCALL_DO_NOT_SYNC: int +DS_REPSYNCALL_SKIP_INITIAL_CHECK: int +DS_REPSYNCALL_PUSH_CHANGES_OUTWARD: int +DS_REPSYNCALL_CROSS_SITE_BOUNDARIES: int +DS_ROLE_SCHEMA_OWNER: int +DS_ROLE_DOMAIN_OWNER: int +DS_ROLE_PDC_OWNER: int +DS_ROLE_RID_OWNER: int +DS_ROLE_INFRASTRUCTURE_OWNER: int +DS_SCHEMA_GUID_NOT_FOUND: int +DS_SCHEMA_GUID_ATTR: int +DS_SCHEMA_GUID_ATTR_SET: int +DS_SCHEMA_GUID_CLASS: int +DS_SCHEMA_GUID_CONTROL_RIGHT: int +DS_KCC_FLAG_ASYNC_OP: int +DS_KCC_FLAG_DAMPED: int +DS_EXIST_ADVISORY_MODE: int +DS_REPL_INFO_FLAG_IMPROVE_LINKED_ATTRS: int +DS_REPL_NBR_WRITEABLE: int +DS_REPL_NBR_SYNC_ON_STARTUP: int +DS_REPL_NBR_DO_SCHEDULED_SYNCS: int +DS_REPL_NBR_USE_ASYNC_INTERSITE_TRANSPORT: int +DS_REPL_NBR_TWO_WAY_SYNC: int +DS_REPL_NBR_RETURN_OBJECT_PARENTS: int +DS_REPL_NBR_FULL_SYNC_IN_PROGRESS: int +DS_REPL_NBR_FULL_SYNC_NEXT_PACKET: int +DS_REPL_NBR_NEVER_SYNCED: int +DS_REPL_NBR_PREEMPTED: int +DS_REPL_NBR_IGNORE_CHANGE_NOTIFICATIONS: int +DS_REPL_NBR_DISABLE_SCHEDULED_SYNC: int +DS_REPL_NBR_COMPRESS_CHANGES: int +DS_REPL_NBR_NO_CHANGE_NOTIFICATIONS: int +DS_REPL_NBR_PARTIAL_ATTRIBUTE_SET: int +DS_REPL_NBR_MODIFIABLE_MASK: int +DS_UNKNOWN_NAME: int +DS_FQDN_1779_NAME: int +DS_NT4_ACCOUNT_NAME: int +DS_DISPLAY_NAME: int +DS_UNIQUE_ID_NAME: int +DS_CANONICAL_NAME: int +DS_USER_PRINCIPAL_NAME: int +DS_CANONICAL_NAME_EX: int +DS_SERVICE_PRINCIPAL_NAME: int +DS_SID_OR_SID_HISTORY_NAME: int +DS_DNS_DOMAIN_NAME: int +DS_DOMAIN_SIMPLE_NAME: int +DS_ENTERPRISE_SIMPLE_NAME: int +DS_NAME_NO_FLAGS: int +DS_NAME_FLAG_SYNTACTICAL_ONLY: int +DS_NAME_FLAG_EVAL_AT_DC: int +DS_NAME_FLAG_GCVERIFY: int +DS_NAME_FLAG_TRUST_REFERRAL: int +DS_NAME_NO_ERROR: int +DS_NAME_ERROR_RESOLVING: int +DS_NAME_ERROR_NOT_FOUND: int +DS_NAME_ERROR_NOT_UNIQUE: int +DS_NAME_ERROR_NO_MAPPING: int +DS_NAME_ERROR_DOMAIN_ONLY: int +DS_NAME_ERROR_NO_SYNTACTICAL_MAPPING: int +DS_NAME_ERROR_TRUST_REFERRAL: int +DS_SPN_DNS_HOST: int +DS_SPN_DN_HOST: int +DS_SPN_NB_HOST: int +DS_SPN_DOMAIN: int +DS_SPN_NB_DOMAIN: int +DS_SPN_SERVICE: int +DS_SPN_ADD_SPN_OP: int +DS_SPN_REPLACE_SPN_OP: int +DS_SPN_DELETE_SPN_OP: int +DS_FORCE_REDISCOVERY: int +DS_DIRECTORY_SERVICE_REQUIRED: int +DS_DIRECTORY_SERVICE_PREFERRED: int +DS_GC_SERVER_REQUIRED: int +DS_PDC_REQUIRED: int +DS_BACKGROUND_ONLY: int +DS_IP_REQUIRED: int +DS_KDC_REQUIRED: int +DS_TIMESERV_REQUIRED: int +DS_WRITABLE_REQUIRED: int +DS_GOOD_TIMESERV_PREFERRED: int +DS_AVOID_SELF: int +DS_ONLY_LDAP_NEEDED: int +DS_IS_FLAT_NAME: int +DS_IS_DNS_NAME: int +DS_RETURN_DNS_NAME: int +DS_RETURN_FLAT_NAME: int +DSGETDC_VALID_FLAGS: int +DS_INET_ADDRESS: int +DS_NETBIOS_ADDRESS: int +DS_PDC_FLAG: int +DS_GC_FLAG: int +DS_LDAP_FLAG: int +DS_DS_FLAG: int +DS_KDC_FLAG: int +DS_TIMESERV_FLAG: int +DS_CLOSEST_FLAG: int +DS_WRITABLE_FLAG: int +DS_GOOD_TIMESERV_FLAG: int +DS_NDNC_FLAG: int +DS_PING_FLAGS: int +DS_DNS_CONTROLLER_FLAG: int +DS_DNS_DOMAIN_FLAG: int +DS_DNS_FOREST_FLAG: int +DS_DOMAIN_IN_FOREST: int +DS_DOMAIN_DIRECT_OUTBOUND: int +DS_DOMAIN_TREE_ROOT: int +DS_DOMAIN_PRIMARY: int +DS_DOMAIN_NATIVE_MODE: int +DS_DOMAIN_DIRECT_INBOUND: int +DS_DOMAIN_VALID_FLAGS: int +DS_GFTI_UPDATE_TDO: int +DS_GFTI_VALID_FLAGS: int +DS_ONLY_DO_SITE_NAME: int +DS_NOTIFY_AFTER_SITE_RECORDS: int +DS_OPEN_VALID_OPTION_FLAGS: int +DS_OPEN_VALID_FLAGS: int +SI_EDIT_PERMS: int +SI_EDIT_OWNER: int +SI_EDIT_AUDITS: int +SI_CONTAINER: int +SI_READONLY: int +SI_ADVANCED: int +SI_RESET: int +SI_OWNER_READONLY: int +SI_EDIT_PROPERTIES: int +SI_OWNER_RECURSE: int +SI_NO_ACL_PROTECT: int +SI_NO_TREE_APPLY: int +SI_PAGE_TITLE: int +SI_SERVER_IS_DC: int +SI_RESET_DACL_TREE: int +SI_RESET_SACL_TREE: int +SI_OBJECT_GUID: int +SI_EDIT_EFFECTIVE: int +SI_RESET_DACL: int +SI_RESET_SACL: int +SI_RESET_OWNER: int +SI_NO_ADDITIONAL_PERMISSION: int +SI_MAY_WRITE: int +SI_EDIT_ALL: int +SI_AUDITS_ELEVATION_REQUIRED: int +SI_VIEW_ONLY: int +SI_OWNER_ELEVATION_REQUIRED: int +SI_PERMS_ELEVATION_REQUIRED: int +SI_ACCESS_SPECIFIC: int +SI_ACCESS_GENERAL: int +SI_ACCESS_CONTAINER: int +SI_ACCESS_PROPERTY: int +SI_PAGE_PERM: int +SI_PAGE_ADVPERM: int +SI_PAGE_AUDIT: int +SI_PAGE_OWNER: int +SI_PAGE_EFFECTIVE: int +PSPCB_SI_INITDIALOG: int +ACTRL_DS_LIST: int +ACTRL_DS_LIST_OBJECT: int +CFSTR_ACLUI_SID_INFO_LIST: str +DS_LIST_ACCOUNT_OBJECT_FOR_SERVER: int +DS_LIST_DNS_HOST_NAME_FOR_SERVER: int +DS_LIST_DSA_OBJECT_FOR_SERVER: int +FILE_LIST_DIRECTORY: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/pywintypes.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/pywintypes.pyi new file mode 100644 index 000000000..c0f995607 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/pywintypes.pyi @@ -0,0 +1,42 @@ +# Can't generate with stubgen because: +# "KeyError: 'pywintypes'" +from _typeshed import Incomplete +from datetime import datetime +from typing_extensions import Literal + +import _win32typing + +class error(Exception): + winerror: int + funcname: str + strerror: str + def __init__(self, winerror: int, funcname: str, strerror: str): ... + +class com_error(Exception): ... +class UnicodeType(str): ... + +class TimeType(datetime): + Format = datetime.strftime + +IIDType = _win32typing.PyIID + +def DosDateTimeToTime() -> _win32typing.PyTime: ... +def Unicode() -> str: ... +def UnicodeFromRaw(_str: str) -> str: ... +def IsTextUnicode(_str: str, flags) -> tuple[Incomplete, Incomplete]: ... +def OVERLAPPED() -> _win32typing.PyOVERLAPPED: ... +def IID(iidString: str, is_bytes: bool = ...) -> _win32typing.PyIID: ... +def Time(timeRepr) -> _win32typing.PyTime: ... +def CreateGuid() -> _win32typing.PyIID: ... +def ACL(__bufSize: int = ...) -> _win32typing.PyACL: ... +def SID(buffer, idAuthority, subAuthorities, bufSize=...) -> _win32typing.PySID: ... +def SECURITY_ATTRIBUTES() -> _win32typing.PySECURITY_ATTRIBUTES: ... +def SECURITY_DESCRIPTOR() -> _win32typing.PySECURITY_DESCRIPTOR: ... +def HANDLE() -> int: ... +def HKEY() -> _win32typing.PyHKEY: ... +def WAVEFORMATEX() -> _win32typing.PyWAVEFORMATEX: ... +def TimeStamp(*args, **kwargs): ... # incomplete + +FALSE: Literal[False] +TRUE: Literal[True] +WAVE_FORMAT_PCM: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/regutil.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/regutil.pyi new file mode 100644 index 000000000..73aeee49f --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/regutil.pyi @@ -0,0 +1,27 @@ +from _typeshed import Incomplete + +error: str +CLSIDPyFile: str +RegistryIDPyFile: str +RegistryIDPycFile: str + +def BuildDefaultPythonKey(): ... +def GetRootKey(): ... +def GetRegistryDefaultValue(subkey, rootkey: Incomplete | None = ...): ... +def SetRegistryDefaultValue(subKey, value, rootkey: Incomplete | None = ...) -> None: ... +def GetAppPathsKey(): ... +def RegisterPythonExe(exeFullPath, exeAlias: Incomplete | None = ..., exeAppPath: Incomplete | None = ...) -> None: ... +def GetRegisteredExe(exeAlias): ... +def UnregisterPythonExe(exeAlias) -> None: ... +def RegisterNamedPath(name, path) -> None: ... +def UnregisterNamedPath(name) -> None: ... +def GetRegisteredNamedPath(name): ... +def RegisterModule(modName, modPath) -> None: ... +def UnregisterModule(modName) -> None: ... +def GetRegisteredHelpFile(helpDesc): ... +def RegisterHelpFile(helpFile, helpPath, helpDesc: Incomplete | None = ..., bCheckFile: int = ...) -> None: ... +def UnregisterHelpFile(helpFile, helpDesc: Incomplete | None = ...) -> None: ... +def RegisterCoreDLL(coredllName: Incomplete | None = ...) -> None: ... +def RegisterFileExtensions(defPyIcon, defPycIcon, runCommand) -> None: ... +def RegisterShellCommand(shellCommand, exeCommand, shellUserCommand: Incomplete | None = ...) -> None: ... +def RegisterDDECommand(shellCommand, ddeApp, ddeTopic, ddeCommand) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/sspicon.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/sspicon.pyi new file mode 100644 index 000000000..978a4370b --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/sspicon.pyi @@ -0,0 +1,457 @@ +ISSP_LEVEL: int +ISSP_MODE: int + +def SEC_SUCCESS(Status: int) -> bool: ... + +SECPKG_FLAG_INTEGRITY: int +SECPKG_FLAG_PRIVACY: int +SECPKG_FLAG_TOKEN_ONLY: int +SECPKG_FLAG_DATAGRAM: int +SECPKG_FLAG_CONNECTION: int +SECPKG_FLAG_MULTI_REQUIRED: int +SECPKG_FLAG_CLIENT_ONLY: int +SECPKG_FLAG_EXTENDED_ERROR: int +SECPKG_FLAG_IMPERSONATION: int +SECPKG_FLAG_ACCEPT_WIN32_NAME: int +SECPKG_FLAG_STREAM: int +SECPKG_FLAG_NEGOTIABLE: int +SECPKG_FLAG_GSS_COMPATIBLE: int +SECPKG_FLAG_LOGON: int +SECPKG_FLAG_ASCII_BUFFERS: int +SECPKG_FLAG_FRAGMENT: int +SECPKG_FLAG_MUTUAL_AUTH: int +SECPKG_FLAG_DELEGATION: int +SECPKG_FLAG_READONLY_WITH_CHECKSUM: int +SECPKG_ID_NONE: int +SECBUFFER_VERSION: int +SECBUFFER_EMPTY: int +SECBUFFER_DATA: int +SECBUFFER_TOKEN: int +SECBUFFER_PKG_PARAMS: int +SECBUFFER_MISSING: int +SECBUFFER_EXTRA: int +SECBUFFER_STREAM_TRAILER: int +SECBUFFER_STREAM_HEADER: int +SECBUFFER_NEGOTIATION_INFO: int +SECBUFFER_PADDING: int +SECBUFFER_STREAM: int +SECBUFFER_TARGET: int +SECBUFFER_CHANNEL_BINDINGS: int +SECBUFFER_ATTRMASK: int +SECBUFFER_READONLY: int +SECBUFFER_READONLY_WITH_CHECKSUM: int +SECBUFFER_RESERVED: int +SECURITY_NATIVE_DREP: int +SECURITY_NETWORK_DREP: int +SECPKG_CRED_INBOUND: int +SECPKG_CRED_OUTBOUND: int +SECPKG_CRED_BOTH: int +SECPKG_CRED_DEFAULT: int +SECPKG_CRED_RESERVED: int +ISC_REQ_DELEGATE: int +ISC_REQ_MUTUAL_AUTH: int +ISC_REQ_REPLAY_DETECT: int +ISC_REQ_SEQUENCE_DETECT: int +ISC_REQ_CONFIDENTIALITY: int +ISC_REQ_USE_SESSION_KEY: int +ISC_REQ_PROMPT_FOR_CREDS: int +ISC_REQ_USE_SUPPLIED_CREDS: int +ISC_REQ_ALLOCATE_MEMORY: int +ISC_REQ_USE_DCE_STYLE: int +ISC_REQ_DATAGRAM: int +ISC_REQ_CONNECTION: int +ISC_REQ_CALL_LEVEL: int +ISC_REQ_FRAGMENT_SUPPLIED: int +ISC_REQ_EXTENDED_ERROR: int +ISC_REQ_STREAM: int +ISC_REQ_INTEGRITY: int +ISC_REQ_IDENTIFY: int +ISC_REQ_NULL_SESSION: int +ISC_REQ_MANUAL_CRED_VALIDATION: int +ISC_REQ_RESERVED1: int +ISC_REQ_FRAGMENT_TO_FIT: int +ISC_REQ_HTTP: int +ISC_RET_DELEGATE: int +ISC_RET_MUTUAL_AUTH: int +ISC_RET_REPLAY_DETECT: int +ISC_RET_SEQUENCE_DETECT: int +ISC_RET_CONFIDENTIALITY: int +ISC_RET_USE_SESSION_KEY: int +ISC_RET_USED_COLLECTED_CREDS: int +ISC_RET_USED_SUPPLIED_CREDS: int +ISC_RET_ALLOCATED_MEMORY: int +ISC_RET_USED_DCE_STYLE: int +ISC_RET_DATAGRAM: int +ISC_RET_CONNECTION: int +ISC_RET_INTERMEDIATE_RETURN: int +ISC_RET_CALL_LEVEL: int +ISC_RET_EXTENDED_ERROR: int +ISC_RET_STREAM: int +ISC_RET_INTEGRITY: int +ISC_RET_IDENTIFY: int +ISC_RET_NULL_SESSION: int +ISC_RET_MANUAL_CRED_VALIDATION: int +ISC_RET_RESERVED1: int +ISC_RET_FRAGMENT_ONLY: int +ASC_REQ_DELEGATE: int +ASC_REQ_MUTUAL_AUTH: int +ASC_REQ_REPLAY_DETECT: int +ASC_REQ_SEQUENCE_DETECT: int +ASC_REQ_CONFIDENTIALITY: int +ASC_REQ_USE_SESSION_KEY: int +ASC_REQ_ALLOCATE_MEMORY: int +ASC_REQ_USE_DCE_STYLE: int +ASC_REQ_DATAGRAM: int +ASC_REQ_CONNECTION: int +ASC_REQ_CALL_LEVEL: int +ASC_REQ_EXTENDED_ERROR: int +ASC_REQ_STREAM: int +ASC_REQ_INTEGRITY: int +ASC_REQ_LICENSING: int +ASC_REQ_IDENTIFY: int +ASC_REQ_ALLOW_NULL_SESSION: int +ASC_REQ_ALLOW_NON_USER_LOGONS: int +ASC_REQ_ALLOW_CONTEXT_REPLAY: int +ASC_REQ_FRAGMENT_TO_FIT: int +ASC_REQ_FRAGMENT_SUPPLIED: int +ASC_REQ_NO_TOKEN: int +ASC_RET_DELEGATE: int +ASC_RET_MUTUAL_AUTH: int +ASC_RET_REPLAY_DETECT: int +ASC_RET_SEQUENCE_DETECT: int +ASC_RET_CONFIDENTIALITY: int +ASC_RET_USE_SESSION_KEY: int +ASC_RET_ALLOCATED_MEMORY: int +ASC_RET_USED_DCE_STYLE: int +ASC_RET_DATAGRAM: int +ASC_RET_CONNECTION: int +ASC_RET_CALL_LEVEL: int +ASC_RET_THIRD_LEG_FAILED: int +ASC_RET_EXTENDED_ERROR: int +ASC_RET_STREAM: int +ASC_RET_INTEGRITY: int +ASC_RET_LICENSING: int +ASC_RET_IDENTIFY: int +ASC_RET_NULL_SESSION: int +ASC_RET_ALLOW_NON_USER_LOGONS: int +ASC_RET_ALLOW_CONTEXT_REPLAY: int +ASC_RET_FRAGMENT_ONLY: int +SECPKG_CRED_ATTR_NAMES: int +SECPKG_ATTR_SIZES: int +SECPKG_ATTR_NAMES: int +SECPKG_ATTR_LIFESPAN: int +SECPKG_ATTR_DCE_INFO: int +SECPKG_ATTR_STREAM_SIZES: int +SECPKG_ATTR_KEY_INFO: int +SECPKG_ATTR_AUTHORITY: int +SECPKG_ATTR_PROTO_INFO: int +SECPKG_ATTR_PASSWORD_EXPIRY: int +SECPKG_ATTR_SESSION_KEY: int +SECPKG_ATTR_PACKAGE_INFO: int +SECPKG_ATTR_USER_FLAGS: int +SECPKG_ATTR_NEGOTIATION_INFO: int +SECPKG_ATTR_NATIVE_NAMES: int +SECPKG_ATTR_FLAGS: int +SECPKG_ATTR_USE_VALIDATED: int +SECPKG_ATTR_CREDENTIAL_NAME: int +SECPKG_ATTR_TARGET_INFORMATION: int +SECPKG_ATTR_ACCESS_TOKEN: int +SECPKG_ATTR_TARGET: int +SECPKG_ATTR_AUTHENTICATION_ID: int +SECPKG_ATTR_REMOTE_CERT_CONTEXT: int +SECPKG_ATTR_LOCAL_CERT_CONTEXT: int +SECPKG_ATTR_ROOT_STORE: int +SECPKG_ATTR_SUPPORTED_ALGS: int +SECPKG_ATTR_CIPHER_STRENGTHS: int +SECPKG_ATTR_SUPPORTED_PROTOCOLS: int +SECPKG_ATTR_CONNECTION_INFO: int +SECPKG_ATTR_EAP_KEY_BLOCK: int +SECPKG_ATTR_MAPPED_CRED_ATTR: int +SECPKG_ATTR_SESSION_INFO: int +SECPKG_ATTR_APP_DATA: int +SECPKG_NEGOTIATION_COMPLETE: int +SECPKG_NEGOTIATION_OPTIMISTIC: int +SECPKG_NEGOTIATION_IN_PROGRESS: int +SECPKG_NEGOTIATION_DIRECT: int +SECPKG_NEGOTIATION_TRY_MULTICRED: int +SECPKG_CONTEXT_EXPORT_RESET_NEW: int +SECPKG_CONTEXT_EXPORT_DELETE_OLD: int +SECQOP_WRAP_NO_ENCRYPT: int +SECURITY_ENTRYPOINT_ANSIW: str +SECURITY_ENTRYPOINT_ANSIA: str +SECURITY_ENTRYPOINT16: str +SECURITY_ENTRYPOINT: str +SECURITY_ENTRYPOINT_ANSI: str +SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION: int +SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION_2: int +SASL_OPTION_SEND_SIZE: int +SASL_OPTION_RECV_SIZE: int +SASL_OPTION_AUTHZ_STRING: int +SASL_OPTION_AUTHZ_PROCESSING: int +SEC_WINNT_AUTH_IDENTITY_ANSI: int +SEC_WINNT_AUTH_IDENTITY_UNICODE: int +SEC_WINNT_AUTH_IDENTITY_VERSION: int +SEC_WINNT_AUTH_IDENTITY_MARSHALLED: int +SEC_WINNT_AUTH_IDENTITY_ONLY: int +SECPKG_OPTIONS_TYPE_UNKNOWN: int +SECPKG_OPTIONS_TYPE_LSA: int +SECPKG_OPTIONS_TYPE_SSPI: int +SECPKG_OPTIONS_PERMANENT: int +SEC_E_INSUFFICIENT_MEMORY: int +SEC_E_INVALID_HANDLE: int +SEC_E_UNSUPPORTED_FUNCTION: int +SEC_E_TARGET_UNKNOWN: int +SEC_E_INTERNAL_ERROR: int +SEC_E_SECPKG_NOT_FOUND: int +SEC_E_NOT_OWNER: int +SEC_E_CANNOT_INSTALL: int +SEC_E_INVALID_TOKEN: int +SEC_E_CANNOT_PACK: int +SEC_E_QOP_NOT_SUPPORTED: int +SEC_E_NO_IMPERSONATION: int +SEC_E_LOGON_DENIED: int +SEC_E_UNKNOWN_CREDENTIALS: int +SEC_E_NO_CREDENTIALS: int +SEC_E_MESSAGE_ALTERED: int +SEC_E_OUT_OF_SEQUENCE: int +SEC_E_NO_AUTHENTICATING_AUTHORITY: int +SEC_I_CONTINUE_NEEDED: int +SEC_I_COMPLETE_NEEDED: int +SEC_I_COMPLETE_AND_CONTINUE: int +SEC_I_LOCAL_LOGON: int +SEC_E_BAD_PKGID: int +SEC_E_CONTEXT_EXPIRED: int +SEC_I_CONTEXT_EXPIRED: int +SEC_E_BUFFER_TOO_SMALL: int +SEC_I_RENEGOTIATE: int +SEC_E_WRONG_PRINCIPAL: int +SEC_I_NO_LSA_CONTEXT: int +SEC_E_TIME_SKEW: int +SEC_E_UNTRUSTED_ROOT: int +SEC_E_ILLEGAL_MESSAGE: int +SEC_E_CERT_UNKNOWN: int +SEC_E_CERT_EXPIRED: int +SEC_E_ENCRYPT_FAILURE: int +SEC_E_DECRYPT_FAILURE: int +SEC_E_ALGORITHM_MISMATCH: int +SEC_E_SECURITY_QOS_FAILED: int +SEC_E_UNFINISHED_CONTEXT_DELETED: int +SEC_E_NO_TGT_REPLY: int +SEC_E_NO_IP_ADDRESSES: int +SEC_E_WRONG_CREDENTIAL_HANDLE: int +SEC_E_CRYPTO_SYSTEM_INVALID: int +SEC_E_MAX_REFERRALS_EXCEEDED: int +SEC_E_MUST_BE_KDC: int +SEC_E_STRONG_CRYPTO_NOT_SUPPORTED: int +SEC_E_TOO_MANY_PRINCIPALS: int +SEC_E_NO_PA_DATA: int +SEC_E_PKINIT_NAME_MISMATCH: int +SEC_E_SMARTCARD_LOGON_REQUIRED: int +SEC_E_SHUTDOWN_IN_PROGRESS: int +SEC_E_KDC_INVALID_REQUEST: int +SEC_E_KDC_UNABLE_TO_REFER: int +SEC_E_KDC_UNKNOWN_ETYPE: int +SEC_E_UNSUPPORTED_PREAUTH: int +SEC_E_DELEGATION_REQUIRED: int +SEC_E_BAD_BINDINGS: int +SEC_E_MULTIPLE_ACCOUNTS: int +SEC_E_NO_KERB_KEY: int +ERROR_IPSEC_QM_POLICY_EXISTS: int +ERROR_IPSEC_QM_POLICY_NOT_FOUND: int +ERROR_IPSEC_QM_POLICY_IN_USE: int +ERROR_IPSEC_MM_POLICY_EXISTS: int +ERROR_IPSEC_MM_POLICY_NOT_FOUND: int +ERROR_IPSEC_MM_POLICY_IN_USE: int +ERROR_IPSEC_MM_FILTER_EXISTS: int +ERROR_IPSEC_MM_FILTER_NOT_FOUND: int +ERROR_IPSEC_TRANSPORT_FILTER_EXISTS: int +ERROR_IPSEC_TRANSPORT_FILTER_NOT_FOUND: int +ERROR_IPSEC_MM_AUTH_EXISTS: int +ERROR_IPSEC_MM_AUTH_NOT_FOUND: int +ERROR_IPSEC_MM_AUTH_IN_USE: int +ERROR_IPSEC_DEFAULT_MM_POLICY_NOT_FOUND: int +ERROR_IPSEC_DEFAULT_MM_AUTH_NOT_FOUND: int +ERROR_IPSEC_DEFAULT_QM_POLICY_NOT_FOUND: int +ERROR_IPSEC_TUNNEL_FILTER_EXISTS: int +ERROR_IPSEC_TUNNEL_FILTER_NOT_FOUND: int +ERROR_IPSEC_MM_FILTER_PENDING_DELETION: int +ERROR_IPSEC_TRANSPORT_FILTER_PENDING_DELETION: int +ERROR_IPSEC_TUNNEL_FILTER_PENDING_DELETION: int +ERROR_IPSEC_MM_POLICY_PENDING_DELETION: int +ERROR_IPSEC_MM_AUTH_PENDING_DELETION: int +ERROR_IPSEC_QM_POLICY_PENDING_DELETION: int +WARNING_IPSEC_MM_POLICY_PRUNED: int +WARNING_IPSEC_QM_POLICY_PRUNED: int +ERROR_IPSEC_IKE_NEG_STATUS_BEGIN: int +ERROR_IPSEC_IKE_AUTH_FAIL: int +ERROR_IPSEC_IKE_ATTRIB_FAIL: int +ERROR_IPSEC_IKE_NEGOTIATION_PENDING: int +ERROR_IPSEC_IKE_GENERAL_PROCESSING_ERROR: int +ERROR_IPSEC_IKE_TIMED_OUT: int +ERROR_IPSEC_IKE_NO_CERT: int +ERROR_IPSEC_IKE_SA_DELETED: int +ERROR_IPSEC_IKE_SA_REAPED: int +ERROR_IPSEC_IKE_MM_ACQUIRE_DROP: int +ERROR_IPSEC_IKE_QM_ACQUIRE_DROP: int +ERROR_IPSEC_IKE_QUEUE_DROP_MM: int +ERROR_IPSEC_IKE_QUEUE_DROP_NO_MM: int +ERROR_IPSEC_IKE_DROP_NO_RESPONSE: int +ERROR_IPSEC_IKE_MM_DELAY_DROP: int +ERROR_IPSEC_IKE_QM_DELAY_DROP: int +ERROR_IPSEC_IKE_ERROR: int +ERROR_IPSEC_IKE_CRL_FAILED: int +ERROR_IPSEC_IKE_INVALID_KEY_USAGE: int +ERROR_IPSEC_IKE_INVALID_CERT_TYPE: int +ERROR_IPSEC_IKE_NO_PRIVATE_KEY: int +ERROR_IPSEC_IKE_DH_FAIL: int +ERROR_IPSEC_IKE_INVALID_HEADER: int +ERROR_IPSEC_IKE_NO_POLICY: int +ERROR_IPSEC_IKE_INVALID_SIGNATURE: int +ERROR_IPSEC_IKE_KERBEROS_ERROR: int +ERROR_IPSEC_IKE_NO_PUBLIC_KEY: int +ERROR_IPSEC_IKE_PROCESS_ERR: int +ERROR_IPSEC_IKE_PROCESS_ERR_SA: int +ERROR_IPSEC_IKE_PROCESS_ERR_PROP: int +ERROR_IPSEC_IKE_PROCESS_ERR_TRANS: int +ERROR_IPSEC_IKE_PROCESS_ERR_KE: int +ERROR_IPSEC_IKE_PROCESS_ERR_ID: int +ERROR_IPSEC_IKE_PROCESS_ERR_CERT: int +ERROR_IPSEC_IKE_PROCESS_ERR_CERT_REQ: int +ERROR_IPSEC_IKE_PROCESS_ERR_HASH: int +ERROR_IPSEC_IKE_PROCESS_ERR_SIG: int +ERROR_IPSEC_IKE_PROCESS_ERR_NONCE: int +ERROR_IPSEC_IKE_PROCESS_ERR_NOTIFY: int +ERROR_IPSEC_IKE_PROCESS_ERR_DELETE: int +ERROR_IPSEC_IKE_PROCESS_ERR_VENDOR: int +ERROR_IPSEC_IKE_INVALID_PAYLOAD: int +ERROR_IPSEC_IKE_LOAD_SOFT_SA: int +ERROR_IPSEC_IKE_SOFT_SA_TORN_DOWN: int +ERROR_IPSEC_IKE_INVALID_COOKIE: int +ERROR_IPSEC_IKE_NO_PEER_CERT: int +ERROR_IPSEC_IKE_PEER_CRL_FAILED: int +ERROR_IPSEC_IKE_POLICY_CHANGE: int +ERROR_IPSEC_IKE_NO_MM_POLICY: int +ERROR_IPSEC_IKE_NOTCBPRIV: int +ERROR_IPSEC_IKE_SECLOADFAIL: int +ERROR_IPSEC_IKE_FAILSSPINIT: int +ERROR_IPSEC_IKE_FAILQUERYSSP: int +ERROR_IPSEC_IKE_SRVACQFAIL: int +ERROR_IPSEC_IKE_SRVQUERYCRED: int +ERROR_IPSEC_IKE_GETSPIFAIL: int +ERROR_IPSEC_IKE_INVALID_FILTER: int +ERROR_IPSEC_IKE_OUT_OF_MEMORY: int +ERROR_IPSEC_IKE_ADD_UPDATE_KEY_FAILED: int +ERROR_IPSEC_IKE_INVALID_POLICY: int +ERROR_IPSEC_IKE_UNKNOWN_DOI: int +ERROR_IPSEC_IKE_INVALID_SITUATION: int +ERROR_IPSEC_IKE_DH_FAILURE: int +ERROR_IPSEC_IKE_INVALID_GROUP: int +ERROR_IPSEC_IKE_ENCRYPT: int +ERROR_IPSEC_IKE_DECRYPT: int +ERROR_IPSEC_IKE_POLICY_MATCH: int +ERROR_IPSEC_IKE_UNSUPPORTED_ID: int +ERROR_IPSEC_IKE_INVALID_HASH: int +ERROR_IPSEC_IKE_INVALID_HASH_ALG: int +ERROR_IPSEC_IKE_INVALID_HASH_SIZE: int +ERROR_IPSEC_IKE_INVALID_ENCRYPT_ALG: int +ERROR_IPSEC_IKE_INVALID_AUTH_ALG: int +ERROR_IPSEC_IKE_INVALID_SIG: int +ERROR_IPSEC_IKE_LOAD_FAILED: int +ERROR_IPSEC_IKE_RPC_DELETE: int +ERROR_IPSEC_IKE_BENIGN_REINIT: int +ERROR_IPSEC_IKE_INVALID_RESPONDER_LIFETIME_NOTIFY: int +ERROR_IPSEC_IKE_INVALID_CERT_KEYLEN: int +ERROR_IPSEC_IKE_MM_LIMIT: int +ERROR_IPSEC_IKE_NEGOTIATION_DISABLED: int +ERROR_IPSEC_IKE_NEG_STATUS_END: int +CRYPT_E_MSG_ERROR: int +CRYPT_E_UNKNOWN_ALGO: int +CRYPT_E_OID_FORMAT: int +CRYPT_E_INVALID_MSG_TYPE: int +CRYPT_E_UNEXPECTED_ENCODING: int +CRYPT_E_AUTH_ATTR_MISSING: int +CRYPT_E_HASH_VALUE: int +CRYPT_E_INVALID_INDEX: int +CRYPT_E_ALREADY_DECRYPTED: int +CRYPT_E_NOT_DECRYPTED: int +CRYPT_E_RECIPIENT_NOT_FOUND: int +CRYPT_E_CONTROL_TYPE: int +CRYPT_E_ISSUER_SERIALNUMBER: int +CRYPT_E_SIGNER_NOT_FOUND: int +CRYPT_E_ATTRIBUTES_MISSING: int +CRYPT_E_STREAM_MSG_NOT_READY: int +CRYPT_E_STREAM_INSUFFICIENT_DATA: int +CRYPT_I_NEW_PROTECTION_REQUIRED: int +CRYPT_E_BAD_LEN: int +CRYPT_E_BAD_ENCODE: int +CRYPT_E_FILE_ERROR: int +CRYPT_E_NOT_FOUND: int +CRYPT_E_EXISTS: int +CRYPT_E_NO_PROVIDER: int +CRYPT_E_SELF_SIGNED: int +CRYPT_E_DELETED_PREV: int +CRYPT_E_NO_MATCH: int +CRYPT_E_UNEXPECTED_MSG_TYPE: int +CRYPT_E_NO_KEY_PROPERTY: int +CRYPT_E_NO_DECRYPT_CERT: int +CRYPT_E_BAD_MSG: int +CRYPT_E_NO_SIGNER: int +CRYPT_E_PENDING_CLOSE: int +CRYPT_E_REVOKED: int +CRYPT_E_NO_REVOCATION_DLL: int +CRYPT_E_NO_REVOCATION_CHECK: int +CRYPT_E_REVOCATION_OFFLINE: int +CRYPT_E_NOT_IN_REVOCATION_DATABASE: int +CRYPT_E_INVALID_NUMERIC_STRING: int +CRYPT_E_INVALID_PRINTABLE_STRING: int +CRYPT_E_INVALID_IA5_STRING: int +CRYPT_E_INVALID_X500_STRING: int +CRYPT_E_NOT_CHAR_STRING: int +CRYPT_E_FILERESIZED: int +CRYPT_E_SECURITY_SETTINGS: int +CRYPT_E_NO_VERIFY_USAGE_DLL: int +CRYPT_E_NO_VERIFY_USAGE_CHECK: int +CRYPT_E_VERIFY_USAGE_OFFLINE: int +CRYPT_E_NOT_IN_CTL: int +CRYPT_E_NO_TRUSTED_SIGNER: int +CRYPT_E_MISSING_PUBKEY_PARA: int +CRYPT_E_OSS_ERROR: int +KerbDebugRequestMessage: int +KerbQueryTicketCacheMessage: int +KerbChangeMachinePasswordMessage: int +KerbVerifyPacMessage: int +KerbRetrieveTicketMessage: int +KerbUpdateAddressesMessage: int +KerbPurgeTicketCacheMessage: int +KerbChangePasswordMessage: int +KerbRetrieveEncodedTicketMessage: int +KerbDecryptDataMessage: int +KerbAddBindingCacheEntryMessage: int +KerbSetPasswordMessage: int +KerbSetPasswordExMessage: int +KerbVerifyCredentialsMessage: int +KerbQueryTicketCacheExMessage: int +KerbPurgeTicketCacheExMessage: int +KerbRefreshSmartcardCredentialsMessage: int +KerbAddExtraCredentialsMessage: int +KerbQuerySupplementalCredentialsMessage: int +MsV1_0Lm20ChallengeRequest: int +MsV1_0Lm20GetChallengeResponse: int +MsV1_0EnumerateUsers: int +MsV1_0GetUserInfo: int +MsV1_0ReLogonUsers: int +MsV1_0ChangePassword: int +MsV1_0ChangeCachedPassword: int +MsV1_0GenericPassthrough: int +MsV1_0CacheLogon: int +MsV1_0SubAuth: int +MsV1_0DeriveCredential: int +MsV1_0CacheLookup: int +MsV1_0SetProcessOption: int +SEC_E_OK: int +SECBUFFER_MECHLIST: int +SECBUFFER_MECHLIST_SIGNATURE: int +SECPKG_ATTR_ISSUER_LIST_EX: int +SEC_E_INCOMPLETE_CREDENTIALS: int +SEC_E_INCOMPLETE_MESSAGE: int +SEC_I_INCOMPLETE_CREDENTIALS: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/win2kras.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/win2kras.pyi new file mode 100644 index 000000000..b766e47a1 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/win2kras.pyi @@ -0,0 +1,34 @@ +RASEAPF_Logon: int +RASEAPF_NonInteractive: int +RASEAPF_Preview: int + +def GetEapUserIdentity(*args, **kwargs): ... # incomplete + +RASCS_AllDevicesConnected: int +RASCS_AuthAck: int +RASCS_AuthCallback: int +RASCS_AuthChangePassword: int +RASCS_AuthLinkSpeed: int +RASCS_AuthNotify: int +RASCS_AuthProject: int +RASCS_AuthRetry: int +RASCS_Authenticate: int +RASCS_Authenticated: int +RASCS_CallbackComplete: int +RASCS_CallbackSetByCaller: int +RASCS_ConnectDevice: int +RASCS_Connected: int +RASCS_DeviceConnected: int +RASCS_Disconnected: int +RASCS_Interactive: int +RASCS_LogonNetwork: int +RASCS_OpenPort: int +RASCS_PasswordExpired: int +RASCS_PortOpened: int +RASCS_PrepareForCallback: int +RASCS_Projected: int +RASCS_ReAuthenticate: int +RASCS_RetryAuthentication: int +RASCS_StartAuthentication: int +RASCS_WaitForCallback: int +RASCS_WaitForModemReset: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/win32con.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/win32con.pyi new file mode 100644 index 000000000..b5f256e4b --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/win32con.pyi @@ -0,0 +1,4778 @@ +WINVER: int +WM_USER: int +PY_0U: int +OFN_READONLY: int +OFN_OVERWRITEPROMPT: int +OFN_HIDEREADONLY: int +OFN_NOCHANGEDIR: int +OFN_SHOWHELP: int +OFN_ENABLEHOOK: int +OFN_ENABLETEMPLATE: int +OFN_ENABLETEMPLATEHANDLE: int +OFN_NOVALIDATE: int +OFN_ALLOWMULTISELECT: int +OFN_EXTENSIONDIFFERENT: int +OFN_PATHMUSTEXIST: int +OFN_FILEMUSTEXIST: int +OFN_CREATEPROMPT: int +OFN_SHAREAWARE: int +OFN_NOREADONLYRETURN: int +OFN_NOTESTFILECREATE: int +OFN_NONETWORKBUTTON: int +OFN_NOLONGNAMES: int +OFN_EXPLORER: int +OFN_NODEREFERENCELINKS: int +OFN_LONGNAMES: int +OFN_ENABLEINCLUDENOTIFY: int +OFN_ENABLESIZING: int +OFN_DONTADDTORECENT: int +OFN_FORCESHOWHIDDEN: int +OFN_EX_NOPLACESBAR: int +OFN_SHAREFALLTHROUGH: int +OFN_SHARENOWARN: int +OFN_SHAREWARN: int +CDN_FIRST: int +CDN_LAST: int +CDN_INITDONE: int +CDN_SELCHANGE: int +CDN_FOLDERCHANGE: int +CDN_SHAREVIOLATION: int +CDN_HELP: int +CDN_FILEOK: int +CDN_TYPECHANGE: int +CDN_INCLUDEITEM: int +CDM_FIRST: int +CDM_LAST: int +CDM_GETSPEC: int +CDM_GETFILEPATH: int +CDM_GETFOLDERPATH: int +CDM_SETCONTROLTEXT: int +CDM_HIDECONTROL: int +CDM_SETDEFEXT: int +CC_RGBINIT: int +CC_FULLOPEN: int +CC_PREVENTFULLOPEN: int +CC_SHOWHELP: int +CC_ENABLEHOOK: int +CC_ENABLETEMPLATE: int +CC_ENABLETEMPLATEHANDLE: int +CC_SOLIDCOLOR: int +CC_ANYCOLOR: int +FR_DOWN: int +FR_WHOLEWORD: int +FR_MATCHCASE: int +FR_FINDNEXT: int +FR_REPLACE: int +FR_REPLACEALL: int +FR_DIALOGTERM: int +FR_SHOWHELP: int +FR_ENABLEHOOK: int +FR_ENABLETEMPLATE: int +FR_NOUPDOWN: int +FR_NOMATCHCASE: int +FR_NOWHOLEWORD: int +FR_ENABLETEMPLATEHANDLE: int +FR_HIDEUPDOWN: int +FR_HIDEMATCHCASE: int +FR_HIDEWHOLEWORD: int +CF_SCREENFONTS: int +CF_PRINTERFONTS: int +CF_BOTH: int +CF_SHOWHELP: int +CF_ENABLEHOOK: int +CF_ENABLETEMPLATE: int +CF_ENABLETEMPLATEHANDLE: int +CF_INITTOLOGFONTSTRUCT: int +CF_USESTYLE: int +CF_EFFECTS: int +CF_APPLY: int +CF_ANSIONLY: int +CF_SCRIPTSONLY: int +CF_NOVECTORFONTS: int +CF_NOOEMFONTS: int +CF_NOSIMULATIONS: int +CF_LIMITSIZE: int +CF_FIXEDPITCHONLY: int +CF_WYSIWYG: int +CF_FORCEFONTEXIST: int +CF_SCALABLEONLY: int +CF_TTONLY: int +CF_NOFACESEL: int +CF_NOSTYLESEL: int +CF_NOSIZESEL: int +CF_SELECTSCRIPT: int +CF_NOSCRIPTSEL: int +CF_NOVERTFONTS: int +SIMULATED_FONTTYPE: int +PRINTER_FONTTYPE: int +SCREEN_FONTTYPE: int +BOLD_FONTTYPE: int +ITALIC_FONTTYPE: int +REGULAR_FONTTYPE: int +OPENTYPE_FONTTYPE: int +TYPE1_FONTTYPE: int +DSIG_FONTTYPE: int +WM_CHOOSEFONT_GETLOGFONT: int +WM_CHOOSEFONT_SETLOGFONT: int +WM_CHOOSEFONT_SETFLAGS: int +LBSELCHSTRINGA: str +SHAREVISTRINGA: str +FILEOKSTRINGA: str +COLOROKSTRINGA: str +SETRGBSTRINGA: str +HELPMSGSTRINGA: str +FINDMSGSTRINGA: str +LBSELCHSTRING: str +SHAREVISTRING: str +FILEOKSTRING: str +COLOROKSTRING: str +SETRGBSTRING: str +HELPMSGSTRING: str +FINDMSGSTRING: str +CD_LBSELNOITEMS: int +CD_LBSELCHANGE: int +CD_LBSELSUB: int +CD_LBSELADD: int +PD_ALLPAGES: int +PD_SELECTION: int +PD_PAGENUMS: int +PD_NOSELECTION: int +PD_NOPAGENUMS: int +PD_COLLATE: int +PD_PRINTTOFILE: int +PD_PRINTSETUP: int +PD_NOWARNING: int +PD_RETURNDC: int +PD_RETURNIC: int +PD_RETURNDEFAULT: int +PD_SHOWHELP: int +PD_ENABLEPRINTHOOK: int +PD_ENABLESETUPHOOK: int +PD_ENABLEPRINTTEMPLATE: int +PD_ENABLESETUPTEMPLATE: int +PD_ENABLEPRINTTEMPLATEHANDLE: int +PD_ENABLESETUPTEMPLATEHANDLE: int +PD_USEDEVMODECOPIES: int +PD_DISABLEPRINTTOFILE: int +PD_HIDEPRINTTOFILE: int +PD_NONETWORKBUTTON: int +DN_DEFAULTPRN: int +WM_PSD_PAGESETUPDLG: int +WM_PSD_FULLPAGERECT: int +WM_PSD_MINMARGINRECT: int +WM_PSD_MARGINRECT: int +WM_PSD_GREEKTEXTRECT: int +WM_PSD_ENVSTAMPRECT: int +WM_PSD_YAFULLPAGERECT: int +PSD_DEFAULTMINMARGINS: int +PSD_INWININIINTLMEASURE: int +PSD_MINMARGINS: int +PSD_MARGINS: int +PSD_INTHOUSANDTHSOFINCHES: int +PSD_INHUNDREDTHSOFMILLIMETERS: int +PSD_DISABLEMARGINS: int +PSD_DISABLEPRINTER: int +PSD_NOWARNING: int +PSD_DISABLEORIENTATION: int +PSD_RETURNDEFAULT: int +PSD_DISABLEPAPER: int +PSD_SHOWHELP: int +PSD_ENABLEPAGESETUPHOOK: int +PSD_ENABLEPAGESETUPTEMPLATE: int +PSD_ENABLEPAGESETUPTEMPLATEHANDLE: int +PSD_ENABLEPAGEPAINTHOOK: int +PSD_DISABLEPAGEPAINTING: int +PSD_NONETWORKBUTTON: int +HKEY_CLASSES_ROOT: int +HKEY_CURRENT_USER: int +HKEY_LOCAL_MACHINE: int +HKEY_USERS: int +HKEY_PERFORMANCE_DATA: int +HKEY_CURRENT_CONFIG: int +HKEY_DYN_DATA: int +HKEY_PERFORMANCE_TEXT: int +HKEY_PERFORMANCE_NLSTEXT: int +HWND_BROADCAST: int +HWND_DESKTOP: int +HWND_TOP: int +HWND_BOTTOM: int +HWND_TOPMOST: int +HWND_NOTOPMOST: int +HWND_MESSAGE: int +SM_CXSCREEN: int +SM_CYSCREEN: int +SM_CXVSCROLL: int +SM_CYHSCROLL: int +SM_CYCAPTION: int +SM_CXBORDER: int +SM_CYBORDER: int +SM_CXDLGFRAME: int +SM_CYDLGFRAME: int +SM_CYVTHUMB: int +SM_CXHTHUMB: int +SM_CXICON: int +SM_CYICON: int +SM_CXCURSOR: int +SM_CYCURSOR: int +SM_CYMENU: int +SM_CXFULLSCREEN: int +SM_CYFULLSCREEN: int +SM_CYKANJIWINDOW: int +SM_MOUSEPRESENT: int +SM_CYVSCROLL: int +SM_CXHSCROLL: int +SM_DEBUG: int +SM_SWAPBUTTON: int +SM_RESERVED1: int +SM_RESERVED2: int +SM_RESERVED3: int +SM_RESERVED4: int +SM_CXMIN: int +SM_CYMIN: int +SM_CXSIZE: int +SM_CYSIZE: int +SM_CXFRAME: int +SM_CYFRAME: int +SM_CXMINTRACK: int +SM_CYMINTRACK: int +SM_CXDOUBLECLK: int +SM_CYDOUBLECLK: int +SM_CXICONSPACING: int +SM_CYICONSPACING: int +SM_MENUDROPALIGNMENT: int +SM_PENWINDOWS: int +SM_DBCSENABLED: int +SM_CMOUSEBUTTONS: int +SM_CXFIXEDFRAME: int +SM_CYFIXEDFRAME: int +SM_CXSIZEFRAME: int +SM_CYSIZEFRAME: int +SM_SECURE: int +SM_CXEDGE: int +SM_CYEDGE: int +SM_CXMINSPACING: int +SM_CYMINSPACING: int +SM_CXSMICON: int +SM_CYSMICON: int +SM_CYSMCAPTION: int +SM_CXSMSIZE: int +SM_CYSMSIZE: int +SM_CXMENUSIZE: int +SM_CYMENUSIZE: int +SM_ARRANGE: int +SM_CXMINIMIZED: int +SM_CYMINIMIZED: int +SM_CXMAXTRACK: int +SM_CYMAXTRACK: int +SM_CXMAXIMIZED: int +SM_CYMAXIMIZED: int +SM_NETWORK: int +SM_CLEANBOOT: int +SM_CXDRAG: int +SM_CYDRAG: int +SM_SHOWSOUNDS: int +SM_CXMENUCHECK: int +SM_CYMENUCHECK: int +SM_SLOWMACHINE: int +SM_MIDEASTENABLED: int +SM_MOUSEWHEELPRESENT: int +SM_XVIRTUALSCREEN: int +SM_YVIRTUALSCREEN: int +SM_CXVIRTUALSCREEN: int +SM_CYVIRTUALSCREEN: int +SM_CMONITORS: int +SM_SAMEDISPLAYFORMAT: int +SM_CMETRICS: int +MNC_IGNORE: int +MNC_CLOSE: int +MNC_EXECUTE: int +MNC_SELECT: int +MNS_NOCHECK: int +MNS_MODELESS: int +MNS_DRAGDROP: int +MNS_AUTODISMISS: int +MNS_NOTIFYBYPOS: int +MNS_CHECKORBMP: int +MIM_MAXHEIGHT: int +MIM_BACKGROUND: int +MIM_HELPID: int +MIM_MENUDATA: int +MIM_STYLE: int +MIM_APPLYTOSUBMENUS: int +MND_CONTINUE: int +MND_ENDMENU: int +MNGOF_GAP: int +MNGO_NOINTERFACE: int +MNGO_NOERROR: int +MIIM_STATE: int +MIIM_ID: int +MIIM_SUBMENU: int +MIIM_CHECKMARKS: int +MIIM_TYPE: int +MIIM_DATA: int +MIIM_STRING: int +MIIM_BITMAP: int +MIIM_FTYPE: int +HBMMENU_CALLBACK: int +HBMMENU_SYSTEM: int +HBMMENU_MBAR_RESTORE: int +HBMMENU_MBAR_MINIMIZE: int +HBMMENU_MBAR_CLOSE: int +HBMMENU_MBAR_CLOSE_D: int +HBMMENU_MBAR_MINIMIZE_D: int +HBMMENU_POPUP_CLOSE: int +HBMMENU_POPUP_RESTORE: int +HBMMENU_POPUP_MAXIMIZE: int +HBMMENU_POPUP_MINIMIZE: int +GMDI_USEDISABLED: int +GMDI_GOINTOPOPUPS: int +TPM_LEFTBUTTON: int +TPM_RIGHTBUTTON: int +TPM_LEFTALIGN: int +TPM_CENTERALIGN: int +TPM_RIGHTALIGN: int +TPM_TOPALIGN: int +TPM_VCENTERALIGN: int +TPM_BOTTOMALIGN: int +TPM_HORIZONTAL: int +TPM_VERTICAL: int +TPM_NONOTIFY: int +TPM_RETURNCMD: int +TPM_RECURSE: int +DOF_EXECUTABLE: int +DOF_DOCUMENT: int +DOF_DIRECTORY: int +DOF_MULTIPLE: int +DOF_PROGMAN: int +DOF_SHELLDATA: int +DO_DROPFILE: int +DO_PRINTFILE: int +DT_TOP: int +DT_LEFT: int +DT_CENTER: int +DT_RIGHT: int +DT_VCENTER: int +DT_BOTTOM: int +DT_WORDBREAK: int +DT_SINGLELINE: int +DT_EXPANDTABS: int +DT_TABSTOP: int +DT_NOCLIP: int +DT_EXTERNALLEADING: int +DT_CALCRECT: int +DT_NOPREFIX: int +DT_INTERNAL: int +DT_EDITCONTROL: int +DT_PATH_ELLIPSIS: int +DT_END_ELLIPSIS: int +DT_MODIFYSTRING: int +DT_RTLREADING: int +DT_WORD_ELLIPSIS: int +DST_COMPLEX: int +DST_TEXT: int +DST_PREFIXTEXT: int +DST_ICON: int +DST_BITMAP: int +DSS_NORMAL: int +DSS_UNION: int +DSS_DISABLED: int +DSS_MONO: int +DSS_RIGHT: int +DCX_WINDOW: int +DCX_CACHE: int +DCX_NORESETATTRS: int +DCX_CLIPCHILDREN: int +DCX_CLIPSIBLINGS: int +DCX_PARENTCLIP: int +DCX_EXCLUDERGN: int +DCX_INTERSECTRGN: int +DCX_EXCLUDEUPDATE: int +DCX_INTERSECTUPDATE: int +DCX_LOCKWINDOWUPDATE: int +DCX_VALIDATE: int +CUDR_NORMAL: int +CUDR_NOSNAPTOGRID: int +CUDR_NORESOLVEPOSITIONS: int +CUDR_NOCLOSEGAPS: int +CUDR_NEGATIVECOORDS: int +CUDR_NOPRIMARY: int +RDW_INVALIDATE: int +RDW_INTERNALPAINT: int +RDW_ERASE: int +RDW_VALIDATE: int +RDW_NOINTERNALPAINT: int +RDW_NOERASE: int +RDW_NOCHILDREN: int +RDW_ALLCHILDREN: int +RDW_UPDATENOW: int +RDW_ERASENOW: int +RDW_FRAME: int +RDW_NOFRAME: int +SW_SCROLLCHILDREN: int +SW_INVALIDATE: int +SW_ERASE: int +SW_SMOOTHSCROLL: int +ESB_ENABLE_BOTH: int +ESB_DISABLE_BOTH: int +ESB_DISABLE_LEFT: int +ESB_DISABLE_RIGHT: int +ESB_DISABLE_UP: int +ESB_DISABLE_DOWN: int +ESB_DISABLE_LTUP: int +ESB_DISABLE_RTDN: int +HELPINFO_WINDOW: int +HELPINFO_MENUITEM: int +MB_OK: int +MB_OKCANCEL: int +MB_ABORTRETRYIGNORE: int +MB_YESNOCANCEL: int +MB_YESNO: int +MB_RETRYCANCEL: int +MB_ICONHAND: int +MB_ICONQUESTION: int +MB_ICONEXCLAMATION: int +MB_ICONASTERISK: int +MB_ICONWARNING: int +MB_ICONERROR: int +MB_ICONINFORMATION: int +MB_ICONSTOP: int +MB_DEFBUTTON1: int +MB_DEFBUTTON2: int +MB_DEFBUTTON3: int +MB_DEFBUTTON4: int +MB_APPLMODAL: int +MB_SYSTEMMODAL: int +MB_TASKMODAL: int +MB_HELP: int +MB_NOFOCUS: int +MB_SETFOREGROUND: int +MB_DEFAULT_DESKTOP_ONLY: int +MB_TOPMOST: int +MB_RIGHT: int +MB_RTLREADING: int +MB_SERVICE_NOTIFICATION: int +MB_TYPEMASK: int +MB_USERICON: int +MB_ICONMASK: int +MB_DEFMASK: int +MB_MODEMASK: int +MB_MISCMASK: int +CWP_ALL: int +CWP_SKIPINVISIBLE: int +CWP_SKIPDISABLED: int +CWP_SKIPTRANSPARENT: int +CTLCOLOR_MSGBOX: int +CTLCOLOR_EDIT: int +CTLCOLOR_BTN: int +CTLCOLOR_DLG: int +CTLCOLOR_SCROLLBAR: int +CTLCOLOR_STATIC: int +CTLCOLOR_MAX: int +COLOR_SCROLLBAR: int +COLOR_BACKGROUND: int +COLOR_ACTIVECAPTION: int +COLOR_INACTIVECAPTION: int +COLOR_MENU: int +COLOR_WINDOW: int +COLOR_WINDOWFRAME: int +COLOR_MENUTEXT: int +COLOR_WINDOWTEXT: int +COLOR_CAPTIONTEXT: int +COLOR_ACTIVEBORDER: int +COLOR_INACTIVEBORDER: int +COLOR_APPWORKSPACE: int +COLOR_HIGHLIGHT: int +COLOR_HIGHLIGHTTEXT: int +COLOR_BTNFACE: int +COLOR_BTNSHADOW: int +COLOR_GRAYTEXT: int +COLOR_BTNTEXT: int +COLOR_INACTIVECAPTIONTEXT: int +COLOR_BTNHIGHLIGHT: int +COLOR_3DDKSHADOW: int +COLOR_3DLIGHT: int +COLOR_INFOTEXT: int +COLOR_INFOBK: int +COLOR_HOTLIGHT: int +COLOR_GRADIENTACTIVECAPTION: int +COLOR_GRADIENTINACTIVECAPTION: int +COLOR_DESKTOP: int +COLOR_3DFACE: int +COLOR_3DSHADOW: int +COLOR_3DHIGHLIGHT: int +COLOR_3DHILIGHT: int +COLOR_BTNHILIGHT: int +GW_HWNDFIRST: int +GW_HWNDLAST: int +GW_HWNDNEXT: int +GW_HWNDPREV: int +GW_OWNER: int +GW_CHILD: int +GW_ENABLEDPOPUP: int +GW_MAX: int +MF_INSERT: int +MF_CHANGE: int +MF_APPEND: int +MF_DELETE: int +MF_REMOVE: int +MF_BYCOMMAND: int +MF_BYPOSITION: int +MF_SEPARATOR: int +MF_ENABLED: int +MF_GRAYED: int +MF_DISABLED: int +MF_UNCHECKED: int +MF_CHECKED: int +MF_USECHECKBITMAPS: int +MF_STRING: int +MF_BITMAP: int +MF_OWNERDRAW: int +MF_POPUP: int +MF_MENUBARBREAK: int +MF_MENUBREAK: int +MF_UNHILITE: int +MF_HILITE: int +MF_DEFAULT: int +MF_SYSMENU: int +MF_HELP: int +MF_RIGHTJUSTIFY: int +MF_MOUSESELECT: int +MF_END: int +MFT_STRING: int +MFT_BITMAP: int +MFT_MENUBARBREAK: int +MFT_MENUBREAK: int +MFT_OWNERDRAW: int +MFT_RADIOCHECK: int +MFT_SEPARATOR: int +MFT_RIGHTORDER: int +MFT_RIGHTJUSTIFY: int +MFS_GRAYED: int +MFS_DISABLED: int +MFS_CHECKED: int +MFS_HILITE: int +MFS_ENABLED: int +MFS_UNCHECKED: int +MFS_UNHILITE: int +MFS_DEFAULT: int +MFS_MASK: int +MFS_HOTTRACKDRAWN: int +MFS_CACHEDBMP: int +MFS_BOTTOMGAPDROP: int +MFS_TOPGAPDROP: int +MFS_GAPDROP: int +SC_SIZE: int +SC_MOVE: int +SC_MINIMIZE: int +SC_MAXIMIZE: int +SC_NEXTWINDOW: int +SC_PREVWINDOW: int +SC_CLOSE: int +SC_VSCROLL: int +SC_HSCROLL: int +SC_MOUSEMENU: int +SC_KEYMENU: int +SC_ARRANGE: int +SC_RESTORE: int +SC_SCREENSAVE: int +SC_HOTKEY: int +SC_DEFAULT: int +SC_MONITORPOWER: int +SC_CONTEXTHELP: int +SC_SEPARATOR: int +SC_ICON: int +SC_ZOOM: int +IDC_ARROW: int +IDC_IBEAM: int +IDC_WAIT: int +IDC_CROSS: int +IDC_UPARROW: int +IDC_SIZE: int +IDC_ICON: int +IDC_SIZENWSE: int +IDC_SIZENESW: int +IDC_SIZEWE: int +IDC_SIZENS: int +IDC_SIZEALL: int +IDC_NO: int +IDC_HAND: int +IDC_APPSTARTING: int +IDC_HELP: int +IMAGE_BITMAP: int +IMAGE_ICON: int +IMAGE_CURSOR: int +IMAGE_ENHMETAFILE: int +LR_DEFAULTCOLOR: int +LR_MONOCHROME: int +LR_COLOR: int +LR_COPYRETURNORG: int +LR_COPYDELETEORG: int +LR_LOADFROMFILE: int +LR_LOADTRANSPARENT: int +LR_DEFAULTSIZE: int +LR_LOADREALSIZE: int +LR_LOADMAP3DCOLORS: int +LR_CREATEDIBSECTION: int +LR_COPYFROMRESOURCE: int +LR_SHARED: int +DI_MASK: int +DI_IMAGE: int +DI_NORMAL: int +DI_COMPAT: int +DI_DEFAULTSIZE: int +RES_ICON: int +RES_CURSOR: int +OBM_CLOSE: int +OBM_UPARROW: int +OBM_DNARROW: int +OBM_RGARROW: int +OBM_LFARROW: int +OBM_REDUCE: int +OBM_ZOOM: int +OBM_RESTORE: int +OBM_REDUCED: int +OBM_ZOOMD: int +OBM_RESTORED: int +OBM_UPARROWD: int +OBM_DNARROWD: int +OBM_RGARROWD: int +OBM_LFARROWD: int +OBM_MNARROW: int +OBM_COMBO: int +OBM_UPARROWI: int +OBM_DNARROWI: int +OBM_RGARROWI: int +OBM_LFARROWI: int +OBM_OLD_CLOSE: int +OBM_SIZE: int +OBM_OLD_UPARROW: int +OBM_OLD_DNARROW: int +OBM_OLD_RGARROW: int +OBM_OLD_LFARROW: int +OBM_BTSIZE: int +OBM_CHECK: int +OBM_CHECKBOXES: int +OBM_BTNCORNERS: int +OBM_OLD_REDUCE: int +OBM_OLD_ZOOM: int +OBM_OLD_RESTORE: int +OCR_NORMAL: int +OCR_IBEAM: int +OCR_WAIT: int +OCR_CROSS: int +OCR_UP: int +OCR_SIZE: int +OCR_ICON: int +OCR_SIZENWSE: int +OCR_SIZENESW: int +OCR_SIZEWE: int +OCR_SIZENS: int +OCR_SIZEALL: int +OCR_ICOCUR: int +OCR_NO: int +OCR_HAND: int +OCR_APPSTARTING: int +OIC_SAMPLE: int +OIC_HAND: int +OIC_QUES: int +OIC_BANG: int +OIC_NOTE: int +OIC_WINLOGO: int +OIC_WARNING: int +OIC_ERROR: int +OIC_INFORMATION: int +ORD_LANGDRIVER: int +IDI_APPLICATION: int +IDI_HAND: int +IDI_QUESTION: int +IDI_EXCLAMATION: int +IDI_ASTERISK: int +IDI_WINLOGO: int +IDI_WARNING: int +IDI_ERROR: int +IDI_INFORMATION: int +IDOK: int +IDCANCEL: int +IDABORT: int +IDRETRY: int +IDIGNORE: int +IDYES: int +IDNO: int +IDCLOSE: int +IDHELP: int +ES_LEFT: int +ES_CENTER: int +ES_RIGHT: int +ES_MULTILINE: int +ES_UPPERCASE: int +ES_LOWERCASE: int +ES_PASSWORD: int +ES_AUTOVSCROLL: int +ES_AUTOHSCROLL: int +ES_NOHIDESEL: int +ES_OEMCONVERT: int +ES_READONLY: int +ES_WANTRETURN: int +ES_NUMBER: int +EN_SETFOCUS: int +EN_KILLFOCUS: int +EN_CHANGE: int +EN_UPDATE: int +EN_ERRSPACE: int +EN_MAXTEXT: int +EN_HSCROLL: int +EN_VSCROLL: int +EC_LEFTMARGIN: int +EC_RIGHTMARGIN: int +EC_USEFONTINFO: int +EMSIS_COMPOSITIONSTRING: int +EIMES_GETCOMPSTRATONCE: int +EIMES_CANCELCOMPSTRINFOCUS: int +EIMES_COMPLETECOMPSTRKILLFOCUS: int +EM_GETSEL: int +EM_SETSEL: int +EM_GETRECT: int +EM_SETRECT: int +EM_SETRECTNP: int +EM_SCROLL: int +EM_LINESCROLL: int +EM_SCROLLCARET: int +EM_GETMODIFY: int +EM_SETMODIFY: int +EM_GETLINECOUNT: int +EM_LINEINDEX: int +EM_SETHANDLE: int +EM_GETHANDLE: int +EM_GETTHUMB: int +EM_LINELENGTH: int +EM_REPLACESEL: int +EM_GETLINE: int +EM_LIMITTEXT: int +EM_CANUNDO: int +EM_UNDO: int +EM_FMTLINES: int +EM_LINEFROMCHAR: int +EM_SETTABSTOPS: int +EM_SETPASSWORDCHAR: int +EM_EMPTYUNDOBUFFER: int +EM_GETFIRSTVISIBLELINE: int +EM_SETREADONLY: int +EM_SETWORDBREAKPROC: int +EM_GETWORDBREAKPROC: int +EM_GETPASSWORDCHAR: int +EM_SETMARGINS: int +EM_GETMARGINS: int +EM_SETLIMITTEXT: int +EM_GETLIMITTEXT: int +EM_POSFROMCHAR: int +EM_CHARFROMPOS: int +EM_SETIMESTATUS: int +EM_GETIMESTATUS: int +WB_LEFT: int +WB_RIGHT: int +WB_ISDELIMITER: int +BS_PUSHBUTTON: int +BS_DEFPUSHBUTTON: int +BS_CHECKBOX: int +BS_AUTOCHECKBOX: int +BS_RADIOBUTTON: int +BS_3STATE: int +BS_AUTO3STATE: int +BS_GROUPBOX: int +BS_USERBUTTON: int +BS_AUTORADIOBUTTON: int +BS_OWNERDRAW: int +BS_LEFTTEXT: int +BS_TEXT: int +BS_ICON: int +BS_BITMAP: int +BS_LEFT: int +BS_RIGHT: int +BS_CENTER: int +BS_TOP: int +BS_BOTTOM: int +BS_VCENTER: int +BS_PUSHLIKE: int +BS_MULTILINE: int +BS_NOTIFY: int +BS_FLAT: int +BS_RIGHTBUTTON: int +BN_CLICKED: int +BN_PAINT: int +BN_HILITE: int +BN_UNHILITE: int +BN_DISABLE: int +BN_DOUBLECLICKED: int +BN_PUSHED: int +BN_UNPUSHED: int +BN_DBLCLK: int +BN_SETFOCUS: int +BN_KILLFOCUS: int +BM_GETCHECK: int +BM_SETCHECK: int +BM_GETSTATE: int +BM_SETSTATE: int +BM_SETSTYLE: int +BM_CLICK: int +BM_GETIMAGE: int +BM_SETIMAGE: int +BST_UNCHECKED: int +BST_CHECKED: int +BST_INDETERMINATE: int +BST_PUSHED: int +BST_FOCUS: int +SS_LEFT: int +SS_CENTER: int +SS_RIGHT: int +SS_ICON: int +SS_BLACKRECT: int +SS_GRAYRECT: int +SS_WHITERECT: int +SS_BLACKFRAME: int +SS_GRAYFRAME: int +SS_WHITEFRAME: int +SS_USERITEM: int +SS_SIMPLE: int +SS_LEFTNOWORDWRAP: int +SS_BITMAP: int +SS_OWNERDRAW: int +SS_ENHMETAFILE: int +SS_ETCHEDHORZ: int +SS_ETCHEDVERT: int +SS_ETCHEDFRAME: int +SS_TYPEMASK: int +SS_NOPREFIX: int +SS_NOTIFY: int +SS_CENTERIMAGE: int +SS_RIGHTJUST: int +SS_REALSIZEIMAGE: int +SS_SUNKEN: int +SS_ENDELLIPSIS: int +SS_PATHELLIPSIS: int +SS_WORDELLIPSIS: int +SS_ELLIPSISMASK: int +STM_SETICON: int +STM_GETICON: int +STM_SETIMAGE: int +STM_GETIMAGE: int +STN_CLICKED: int +STN_DBLCLK: int +STN_ENABLE: int +STN_DISABLE: int +STM_MSGMAX: int +DWL_MSGRESULT: int +DWL_DLGPROC: int +DWL_USER: int +DDL_READWRITE: int +DDL_READONLY: int +DDL_HIDDEN: int +DDL_SYSTEM: int +DDL_DIRECTORY: int +DDL_ARCHIVE: int +DDL_POSTMSGS: int +DDL_DRIVES: int +DDL_EXCLUSIVE: int +RT_CURSOR: int +RT_BITMAP: int +RT_ICON: int +RT_MENU: int +RT_DIALOG: int +RT_STRING: int +RT_FONTDIR: int +RT_FONT: int +RT_ACCELERATOR: int +RT_RCDATA: int +RT_MESSAGETABLE: int +DIFFERENCE: int +RT_GROUP_CURSOR: int +RT_GROUP_ICON: int +RT_VERSION: int +RT_DLGINCLUDE: int +RT_PLUGPLAY: int +RT_VXD: int +RT_ANICURSOR: int +RT_ANIICON: int +RT_HTML: int +SB_HORZ: int +SB_VERT: int +SB_CTL: int +SB_BOTH: int +SB_LINEUP: int +SB_LINELEFT: int +SB_LINEDOWN: int +SB_LINERIGHT: int +SB_PAGEUP: int +SB_PAGELEFT: int +SB_PAGEDOWN: int +SB_PAGERIGHT: int +SB_THUMBPOSITION: int +SB_THUMBTRACK: int +SB_TOP: int +SB_LEFT: int +SB_BOTTOM: int +SB_RIGHT: int +SB_ENDSCROLL: int +SW_HIDE: int +SW_SHOWNORMAL: int +SW_NORMAL: int +SW_SHOWMINIMIZED: int +SW_SHOWMAXIMIZED: int +SW_MAXIMIZE: int +SW_SHOWNOACTIVATE: int +SW_SHOW: int +SW_MINIMIZE: int +SW_SHOWMINNOACTIVE: int +SW_SHOWNA: int +SW_RESTORE: int +SW_SHOWDEFAULT: int +SW_FORCEMINIMIZE: int +SW_MAX: int +HIDE_WINDOW: int +SHOW_OPENWINDOW: int +SHOW_ICONWINDOW: int +SHOW_FULLSCREEN: int +SHOW_OPENNOACTIVATE: int +SW_PARENTCLOSING: int +SW_OTHERZOOM: int +SW_PARENTOPENING: int +SW_OTHERUNZOOM: int +AW_HOR_POSITIVE: int +AW_HOR_NEGATIVE: int +AW_VER_POSITIVE: int +AW_VER_NEGATIVE: int +AW_CENTER: int +AW_HIDE: int +AW_ACTIVATE: int +AW_SLIDE: int +AW_BLEND: int +KF_EXTENDED: int +KF_DLGMODE: int +KF_MENUMODE: int +KF_ALTDOWN: int +KF_REPEAT: int +KF_UP: int +VK_LBUTTON: int +VK_RBUTTON: int +VK_CANCEL: int +VK_MBUTTON: int +VK_BACK: int +VK_TAB: int +VK_CLEAR: int +VK_RETURN: int +VK_SHIFT: int +VK_CONTROL: int +VK_MENU: int +VK_PAUSE: int +VK_CAPITAL: int +VK_KANA: int +VK_HANGEUL: int +VK_HANGUL: int +VK_JUNJA: int +VK_FINAL: int +VK_HANJA: int +VK_KANJI: int +VK_ESCAPE: int +VK_CONVERT: int +VK_NONCONVERT: int +VK_ACCEPT: int +VK_MODECHANGE: int +VK_SPACE: int +VK_PRIOR: int +VK_NEXT: int +VK_END: int +VK_HOME: int +VK_LEFT: int +VK_UP: int +VK_RIGHT: int +VK_DOWN: int +VK_SELECT: int +VK_PRINT: int +VK_EXECUTE: int +VK_SNAPSHOT: int +VK_INSERT: int +VK_DELETE: int +VK_HELP: int +VK_LWIN: int +VK_RWIN: int +VK_APPS: int +VK_NUMPAD0: int +VK_NUMPAD1: int +VK_NUMPAD2: int +VK_NUMPAD3: int +VK_NUMPAD4: int +VK_NUMPAD5: int +VK_NUMPAD6: int +VK_NUMPAD7: int +VK_NUMPAD8: int +VK_NUMPAD9: int +VK_MULTIPLY: int +VK_ADD: int +VK_SEPARATOR: int +VK_SUBTRACT: int +VK_DECIMAL: int +VK_DIVIDE: int +VK_F1: int +VK_F2: int +VK_F3: int +VK_F4: int +VK_F5: int +VK_F6: int +VK_F7: int +VK_F8: int +VK_F9: int +VK_F10: int +VK_F11: int +VK_F12: int +VK_F13: int +VK_F14: int +VK_F15: int +VK_F16: int +VK_F17: int +VK_F18: int +VK_F19: int +VK_F20: int +VK_F21: int +VK_F22: int +VK_F23: int +VK_F24: int +VK_NUMLOCK: int +VK_SCROLL: int +VK_LSHIFT: int +VK_RSHIFT: int +VK_LCONTROL: int +VK_RCONTROL: int +VK_LMENU: int +VK_RMENU: int +VK_PROCESSKEY: int +VK_ATTN: int +VK_CRSEL: int +VK_EXSEL: int +VK_EREOF: int +VK_PLAY: int +VK_ZOOM: int +VK_NONAME: int +VK_PA1: int +VK_OEM_CLEAR: int +MOUSEEVENTF_XDOWN: int +MOUSEEVENTF_XUP: int +MOUSEEVENTF_WHEEL: int +VK_XBUTTON1: int +VK_XBUTTON2: int +VK_VOLUME_MUTE: int +VK_VOLUME_DOWN: int +VK_VOLUME_UP: int +VK_MEDIA_NEXT_TRACK: int +VK_MEDIA_PREV_TRACK: int +VK_MEDIA_PLAY_PAUSE: int +VK_BROWSER_BACK: int +VK_BROWSER_FORWARD: int +WH_MIN: int +WH_MSGFILTER: int +WH_JOURNALRECORD: int +WH_JOURNALPLAYBACK: int +WH_KEYBOARD: int +WH_GETMESSAGE: int +WH_CALLWNDPROC: int +WH_CBT: int +WH_SYSMSGFILTER: int +WH_MOUSE: int +WH_HARDWARE: int +WH_DEBUG: int +WH_SHELL: int +WH_FOREGROUNDIDLE: int +WH_CALLWNDPROCRET: int +WH_KEYBOARD_LL: int +WH_MOUSE_LL: int +WH_MAX: int +WH_MINHOOK: int +WH_MAXHOOK: int +HC_ACTION: int +HC_GETNEXT: int +HC_SKIP: int +HC_NOREMOVE: int +HC_NOREM: int +HC_SYSMODALON: int +HC_SYSMODALOFF: int +HCBT_MOVESIZE: int +HCBT_MINMAX: int +HCBT_QS: int +HCBT_CREATEWND: int +HCBT_DESTROYWND: int +HCBT_ACTIVATE: int +HCBT_CLICKSKIPPED: int +HCBT_KEYSKIPPED: int +HCBT_SYSCOMMAND: int +HCBT_SETFOCUS: int +MSGF_DIALOGBOX: int +MSGF_MESSAGEBOX: int +MSGF_MENU: int +MSGF_SCROLLBAR: int +MSGF_NEXTWINDOW: int +MSGF_MAX: int +MSGF_USER: int +HSHELL_WINDOWCREATED: int +HSHELL_WINDOWDESTROYED: int +HSHELL_ACTIVATESHELLWINDOW: int +HSHELL_WINDOWACTIVATED: int +HSHELL_GETMINRECT: int +HSHELL_REDRAW: int +HSHELL_TASKMAN: int +HSHELL_LANGUAGE: int +HSHELL_ACCESSIBILITYSTATE: int +ACCESS_STICKYKEYS: int +ACCESS_FILTERKEYS: int +ACCESS_MOUSEKEYS: int +LLKHF_EXTENDED: int +LLKHF_INJECTED: int +LLKHF_ALTDOWN: int +LLKHF_UP: int +LLKHF_LOWER_IL_INJECTED: int +LLMHF_INJECTED: int +LLMHF_LOWER_IL_INJECTED: int +HKL_PREV: int +HKL_NEXT: int +KLF_ACTIVATE: int +KLF_SUBSTITUTE_OK: int +KLF_UNLOADPREVIOUS: int +KLF_REORDER: int +KLF_REPLACELANG: int +KLF_NOTELLSHELL: int +KLF_SETFORPROCESS: int +KL_NAMELENGTH: int +DESKTOP_READOBJECTS: int +DESKTOP_CREATEWINDOW: int +DESKTOP_CREATEMENU: int +DESKTOP_HOOKCONTROL: int +DESKTOP_JOURNALRECORD: int +DESKTOP_JOURNALPLAYBACK: int +DESKTOP_ENUMERATE: int +DESKTOP_WRITEOBJECTS: int +DESKTOP_SWITCHDESKTOP: int +DF_ALLOWOTHERACCOUNTHOOK: int +WINSTA_ENUMDESKTOPS: int +WINSTA_READATTRIBUTES: int +WINSTA_ACCESSCLIPBOARD: int +WINSTA_CREATEDESKTOP: int +WINSTA_WRITEATTRIBUTES: int +WINSTA_ACCESSGLOBALATOMS: int +WINSTA_EXITWINDOWS: int +WINSTA_ENUMERATE: int +WINSTA_READSCREEN: int +WSF_VISIBLE: int +UOI_FLAGS: int +UOI_NAME: int +UOI_TYPE: int +UOI_USER_SID: int +GWL_WNDPROC: int +GWL_HINSTANCE: int +GWL_HWNDPARENT: int +GWL_STYLE: int +GWL_EXSTYLE: int +GWL_USERDATA: int +GWL_ID: int +GCL_MENUNAME: int +GCL_HBRBACKGROUND: int +GCL_HCURSOR: int +GCL_HICON: int +GCL_HMODULE: int +GCL_CBWNDEXTRA: int +GCL_CBCLSEXTRA: int +GCL_WNDPROC: int +GCL_STYLE: int +GCW_ATOM: int +GCL_HICONSM: int +WM_NULL: int +WM_CREATE: int +WM_DESTROY: int +WM_MOVE: int +WM_SIZE: int +WM_ACTIVATE: int +WA_INACTIVE: int +WA_ACTIVE: int +WA_CLICKACTIVE: int +WM_SETFOCUS: int +WM_KILLFOCUS: int +WM_ENABLE: int +WM_SETREDRAW: int +WM_SETTEXT: int +WM_GETTEXT: int +WM_GETTEXTLENGTH: int +WM_PAINT: int +WM_CLOSE: int +WM_QUERYENDSESSION: int +WM_QUIT: int +WM_QUERYOPEN: int +WM_ERASEBKGND: int +WM_SYSCOLORCHANGE: int +WM_ENDSESSION: int +WM_SHOWWINDOW: int +WM_WININICHANGE: int +WM_SETTINGCHANGE: int +WM_DEVMODECHANGE: int +WM_ACTIVATEAPP: int +WM_FONTCHANGE: int +WM_TIMECHANGE: int +WM_CANCELMODE: int +WM_SETCURSOR: int +WM_MOUSEACTIVATE: int +WM_CHILDACTIVATE: int +WM_QUEUESYNC: int +WM_GETMINMAXINFO: int +WM_PAINTICON: int +WM_ICONERASEBKGND: int +WM_NEXTDLGCTL: int +WM_SPOOLERSTATUS: int +WM_DRAWITEM: int +WM_MEASUREITEM: int +WM_DELETEITEM: int +WM_VKEYTOITEM: int +WM_CHARTOITEM: int +WM_SETFONT: int +WM_GETFONT: int +WM_SETHOTKEY: int +WM_GETHOTKEY: int +WM_QUERYDRAGICON: int +WM_COMPAREITEM: int +WM_GETOBJECT: int +WM_COMPACTING: int +WM_COMMNOTIFY: int +WM_WINDOWPOSCHANGING: int +WM_WINDOWPOSCHANGED: int +WM_POWER: int +PWR_OK: int +PWR_FAIL: int +PWR_SUSPENDREQUEST: int +PWR_SUSPENDRESUME: int +PWR_CRITICALRESUME: int +WM_COPYDATA: int +WM_CANCELJOURNAL: int +WM_NOTIFY: int +WM_INPUTLANGCHANGEREQUEST: int +WM_INPUTLANGCHANGE: int +WM_TCARD: int +WM_HELP: int +WM_USERCHANGED: int +WM_NOTIFYFORMAT: int +NFR_ANSI: int +NFR_UNICODE: int +NF_QUERY: int +NF_REQUERY: int +WM_CONTEXTMENU: int +WM_STYLECHANGING: int +WM_STYLECHANGED: int +WM_DISPLAYCHANGE: int +WM_GETICON: int +WM_SETICON: int +WM_NCCREATE: int +WM_NCDESTROY: int +WM_NCCALCSIZE: int +WM_NCHITTEST: int +WM_NCPAINT: int +WM_NCACTIVATE: int +WM_GETDLGCODE: int +WM_SYNCPAINT: int +WM_NCMOUSEMOVE: int +WM_NCLBUTTONDOWN: int +WM_NCLBUTTONUP: int +WM_NCLBUTTONDBLCLK: int +WM_NCRBUTTONDOWN: int +WM_NCRBUTTONUP: int +WM_NCRBUTTONDBLCLK: int +WM_NCMBUTTONDOWN: int +WM_NCMBUTTONUP: int +WM_NCMBUTTONDBLCLK: int +WM_KEYFIRST: int +WM_KEYDOWN: int +WM_KEYUP: int +WM_CHAR: int +WM_DEADCHAR: int +WM_SYSKEYDOWN: int +WM_SYSKEYUP: int +WM_SYSCHAR: int +WM_SYSDEADCHAR: int +WM_KEYLAST: int +WM_IME_STARTCOMPOSITION: int +WM_IME_ENDCOMPOSITION: int +WM_IME_COMPOSITION: int +WM_IME_KEYLAST: int +WM_INITDIALOG: int +WM_COMMAND: int +WM_SYSCOMMAND: int +WM_TIMER: int +WM_HSCROLL: int +WM_VSCROLL: int +WM_INITMENU: int +WM_INITMENUPOPUP: int +WM_MENUSELECT: int +WM_MENUCHAR: int +WM_ENTERIDLE: int +WM_MENURBUTTONUP: int +WM_MENUDRAG: int +WM_MENUGETOBJECT: int +WM_UNINITMENUPOPUP: int +WM_MENUCOMMAND: int +WM_CTLCOLORMSGBOX: int +WM_CTLCOLOREDIT: int +WM_CTLCOLORBTN: int +WM_CTLCOLORDLG: int +WM_CTLCOLORSCROLLBAR: int +WM_CTLCOLORSTATIC: int +WM_MOUSEFIRST: int +WM_MOUSEMOVE: int +WM_LBUTTONDOWN: int +WM_LBUTTONUP: int +WM_LBUTTONDBLCLK: int +WM_RBUTTONDOWN: int +WM_RBUTTONUP: int +WM_RBUTTONDBLCLK: int +WM_MBUTTONDOWN: int +WM_MBUTTONUP: int +WM_MBUTTONDBLCLK: int +WM_MOUSEWHEEL: int +WM_MOUSELAST: int +WHEEL_DELTA: int +WHEEL_PAGESCROLL: int +WM_PARENTNOTIFY: int +MENULOOP_WINDOW: int +MENULOOP_POPUP: int +WM_ENTERMENULOOP: int +WM_EXITMENULOOP: int +WM_NEXTMENU: int +WM_SIZING: int +WM_CAPTURECHANGED: int +WM_MOVING: int +WM_POWERBROADCAST: int +PBT_APMQUERYSUSPEND: int +PBT_APMQUERYSTANDBY: int +PBT_APMQUERYSUSPENDFAILED: int +PBT_APMQUERYSTANDBYFAILED: int +PBT_APMSUSPEND: int +PBT_APMSTANDBY: int +PBT_APMRESUMECRITICAL: int +PBT_APMRESUMESUSPEND: int +PBT_APMRESUMESTANDBY: int +PBTF_APMRESUMEFROMFAILURE: int +PBT_APMBATTERYLOW: int +PBT_APMPOWERSTATUSCHANGE: int +PBT_APMOEMEVENT: int +PBT_APMRESUMEAUTOMATIC: int +WM_DEVICECHANGE: int +WM_MDICREATE: int +WM_MDIDESTROY: int +WM_MDIACTIVATE: int +WM_MDIRESTORE: int +WM_MDINEXT: int +WM_MDIMAXIMIZE: int +WM_MDITILE: int +WM_MDICASCADE: int +WM_MDIICONARRANGE: int +WM_MDIGETACTIVE: int +WM_MDISETMENU: int +WM_ENTERSIZEMOVE: int +WM_EXITSIZEMOVE: int +WM_DROPFILES: int +WM_MDIREFRESHMENU: int +WM_IME_SETCONTEXT: int +WM_IME_NOTIFY: int +WM_IME_CONTROL: int +WM_IME_COMPOSITIONFULL: int +WM_IME_SELECT: int +WM_IME_CHAR: int +WM_IME_REQUEST: int +WM_IME_KEYDOWN: int +WM_IME_KEYUP: int +WM_MOUSEHOVER: int +WM_MOUSELEAVE: int +WM_CUT: int +WM_COPY: int +WM_PASTE: int +WM_CLEAR: int +WM_UNDO: int +WM_RENDERFORMAT: int +WM_RENDERALLFORMATS: int +WM_DESTROYCLIPBOARD: int +WM_DRAWCLIPBOARD: int +WM_PAINTCLIPBOARD: int +WM_VSCROLLCLIPBOARD: int +WM_SIZECLIPBOARD: int +WM_ASKCBFORMATNAME: int +WM_CHANGECBCHAIN: int +WM_HSCROLLCLIPBOARD: int +WM_QUERYNEWPALETTE: int +WM_PALETTEISCHANGING: int +WM_PALETTECHANGED: int +WM_HOTKEY: int +WM_PRINT: int +WM_PRINTCLIENT: int +WM_HANDHELDFIRST: int +WM_HANDHELDLAST: int +WM_AFXFIRST: int +WM_AFXLAST: int +WM_PENWINFIRST: int +WM_PENWINLAST: int +WM_APP: int +WMSZ_LEFT: int +WMSZ_RIGHT: int +WMSZ_TOP: int +WMSZ_TOPLEFT: int +WMSZ_TOPRIGHT: int +WMSZ_BOTTOM: int +WMSZ_BOTTOMLEFT: int +WMSZ_BOTTOMRIGHT: int +HTERROR: int +HTTRANSPARENT: int +HTNOWHERE: int +HTCLIENT: int +HTCAPTION: int +HTSYSMENU: int +HTGROWBOX: int +HTSIZE: int +HTMENU: int +HTHSCROLL: int +HTVSCROLL: int +HTMINBUTTON: int +HTMAXBUTTON: int +HTLEFT: int +HTRIGHT: int +HTTOP: int +HTTOPLEFT: int +HTTOPRIGHT: int +HTBOTTOM: int +HTBOTTOMLEFT: int +HTBOTTOMRIGHT: int +HTBORDER: int +HTREDUCE: int +HTZOOM: int +HTSIZEFIRST: int +HTSIZELAST: int +HTOBJECT: int +HTCLOSE: int +HTHELP: int +SMTO_NORMAL: int +SMTO_BLOCK: int +SMTO_ABORTIFHUNG: int +SMTO_NOTIMEOUTIFNOTHUNG: int +MA_ACTIVATE: int +MA_ACTIVATEANDEAT: int +MA_NOACTIVATE: int +MA_NOACTIVATEANDEAT: int +ICON_SMALL: int +ICON_BIG: int +SIZE_RESTORED: int +SIZE_MINIMIZED: int +SIZE_MAXIMIZED: int +SIZE_MAXSHOW: int +SIZE_MAXHIDE: int +SIZENORMAL: int +SIZEICONIC: int +SIZEFULLSCREEN: int +SIZEZOOMSHOW: int +SIZEZOOMHIDE: int +WVR_ALIGNTOP: int +WVR_ALIGNLEFT: int +WVR_ALIGNBOTTOM: int +WVR_ALIGNRIGHT: int +WVR_HREDRAW: int +WVR_VREDRAW: int +WVR_REDRAW: int +WVR_VALIDRECTS: int +MK_LBUTTON: int +MK_RBUTTON: int +MK_SHIFT: int +MK_CONTROL: int +MK_MBUTTON: int +TME_HOVER: int +TME_LEAVE: int +TME_QUERY: int +TME_CANCEL: int +HOVER_DEFAULT: int +WS_OVERLAPPED: int +WS_POPUP: int +WS_CHILD: int +WS_MINIMIZE: int +WS_VISIBLE: int +WS_DISABLED: int +WS_CLIPSIBLINGS: int +WS_CLIPCHILDREN: int +WS_MAXIMIZE: int +WS_CAPTION: int +WS_BORDER: int +WS_DLGFRAME: int +WS_VSCROLL: int +WS_HSCROLL: int +WS_SYSMENU: int +WS_THICKFRAME: int +WS_GROUP: int +WS_TABSTOP: int +WS_MINIMIZEBOX: int +WS_MAXIMIZEBOX: int +WS_TILED: int +WS_ICONIC: int +WS_SIZEBOX: int +WS_OVERLAPPEDWINDOW: int +WS_POPUPWINDOW: int +WS_CHILDWINDOW: int +WS_TILEDWINDOW: int +WS_EX_DLGMODALFRAME: int +WS_EX_NOPARENTNOTIFY: int +WS_EX_TOPMOST: int +WS_EX_ACCEPTFILES: int +WS_EX_TRANSPARENT: int +WS_EX_MDICHILD: int +WS_EX_TOOLWINDOW: int +WS_EX_WINDOWEDGE: int +WS_EX_CLIENTEDGE: int +WS_EX_CONTEXTHELP: int +WS_EX_RIGHT: int +WS_EX_LEFT: int +WS_EX_RTLREADING: int +WS_EX_LTRREADING: int +WS_EX_LEFTSCROLLBAR: int +WS_EX_RIGHTSCROLLBAR: int +WS_EX_CONTROLPARENT: int +WS_EX_STATICEDGE: int +WS_EX_APPWINDOW: int +WS_EX_OVERLAPPEDWINDOW: int +WS_EX_PALETTEWINDOW: int +WS_EX_LAYERED: int +WS_EX_NOINHERITLAYOUT: int +WS_EX_LAYOUTRTL: int +WS_EX_COMPOSITED: int +WS_EX_NOACTIVATE: int +CS_VREDRAW: int +CS_HREDRAW: int +CS_DBLCLKS: int +CS_OWNDC: int +CS_CLASSDC: int +CS_PARENTDC: int +CS_NOCLOSE: int +CS_SAVEBITS: int +CS_BYTEALIGNCLIENT: int +CS_BYTEALIGNWINDOW: int +CS_GLOBALCLASS: int +CS_IME: int +PRF_CHECKVISIBLE: int +PRF_NONCLIENT: int +PRF_CLIENT: int +PRF_ERASEBKGND: int +PRF_CHILDREN: int +PRF_OWNED: int +BDR_RAISEDOUTER: int +BDR_SUNKENOUTER: int +BDR_RAISEDINNER: int +BDR_SUNKENINNER: int +BDR_OUTER: int +BDR_INNER: int +EDGE_RAISED: int +EDGE_SUNKEN: int +EDGE_ETCHED: int +EDGE_BUMP: int +ISMEX_NOSEND: int +ISMEX_SEND: int +ISMEX_NOTIFY: int +ISMEX_CALLBACK: int +ISMEX_REPLIED: int +CW_USEDEFAULT: int +FLASHW_STOP: int +FLASHW_CAPTION: int +FLASHW_TRAY: int +FLASHW_ALL: int +FLASHW_TIMER: int +FLASHW_TIMERNOFG: int +DS_ABSALIGN: int +DS_SYSMODAL: int +DS_LOCALEDIT: int +DS_SETFONT: int +DS_MODALFRAME: int +DS_NOIDLEMSG: int +DS_SETFOREGROUND: int +DS_3DLOOK: int +DS_FIXEDSYS: int +DS_NOFAILCREATE: int +DS_CONTROL: int +DS_CENTER: int +DS_CENTERMOUSE: int +DS_CONTEXTHELP: int +DM_GETDEFID: int +DM_SETDEFID: int +DM_REPOSITION: int +DC_HASDEFID: int +DLGC_WANTARROWS: int +DLGC_WANTTAB: int +DLGC_WANTALLKEYS: int +DLGC_WANTMESSAGE: int +DLGC_HASSETSEL: int +DLGC_DEFPUSHBUTTON: int +DLGC_UNDEFPUSHBUTTON: int +DLGC_RADIOBUTTON: int +DLGC_WANTCHARS: int +DLGC_STATIC: int +DLGC_BUTTON: int +LB_CTLCODE: int +LB_OKAY: int +LB_ERR: int +LB_ERRSPACE: int +LBN_ERRSPACE: int +LBN_SELCHANGE: int +LBN_DBLCLK: int +LBN_SELCANCEL: int +LBN_SETFOCUS: int +LBN_KILLFOCUS: int +LB_ADDSTRING: int +LB_INSERTSTRING: int +LB_DELETESTRING: int +LB_SELITEMRANGEEX: int +LB_RESETCONTENT: int +LB_SETSEL: int +LB_SETCURSEL: int +LB_GETSEL: int +LB_GETCURSEL: int +LB_GETTEXT: int +LB_GETTEXTLEN: int +LB_GETCOUNT: int +LB_SELECTSTRING: int +LB_DIR: int +LB_GETTOPINDEX: int +LB_FINDSTRING: int +LB_GETSELCOUNT: int +LB_GETSELITEMS: int +LB_SETTABSTOPS: int +LB_GETHORIZONTALEXTENT: int +LB_SETHORIZONTALEXTENT: int +LB_SETCOLUMNWIDTH: int +LB_ADDFILE: int +LB_SETTOPINDEX: int +LB_GETITEMRECT: int +LB_GETITEMDATA: int +LB_SETITEMDATA: int +LB_SELITEMRANGE: int +LB_SETANCHORINDEX: int +LB_GETANCHORINDEX: int +LB_SETCARETINDEX: int +LB_GETCARETINDEX: int +LB_SETITEMHEIGHT: int +LB_GETITEMHEIGHT: int +LB_FINDSTRINGEXACT: int +LB_SETLOCALE: int +LB_GETLOCALE: int +LB_SETCOUNT: int +LB_INITSTORAGE: int +LB_ITEMFROMPOINT: int +LB_MSGMAX: int +LBS_NOTIFY: int +LBS_SORT: int +LBS_NOREDRAW: int +LBS_MULTIPLESEL: int +LBS_OWNERDRAWFIXED: int +LBS_OWNERDRAWVARIABLE: int +LBS_HASSTRINGS: int +LBS_USETABSTOPS: int +LBS_NOINTEGRALHEIGHT: int +LBS_MULTICOLUMN: int +LBS_WANTKEYBOARDINPUT: int +LBS_EXTENDEDSEL: int +LBS_DISABLENOSCROLL: int +LBS_NODATA: int +LBS_NOSEL: int +LBS_STANDARD: int +CB_OKAY: int +CB_ERR: int +CB_ERRSPACE: int +CBN_ERRSPACE: int +CBN_SELCHANGE: int +CBN_DBLCLK: int +CBN_SETFOCUS: int +CBN_KILLFOCUS: int +CBN_EDITCHANGE: int +CBN_EDITUPDATE: int +CBN_DROPDOWN: int +CBN_CLOSEUP: int +CBN_SELENDOK: int +CBN_SELENDCANCEL: int +CBS_SIMPLE: int +CBS_DROPDOWN: int +CBS_OWNERDRAWFIXED: int +CBS_OWNERDRAWVARIABLE: int +CBS_AUTOHSCROLL: int +CBS_OEMCONVERT: int +CBS_SORT: int +CBS_HASSTRINGS: int +CBS_NOINTEGRALHEIGHT: int +CBS_DISABLENOSCROLL: int +CBS_UPPERCASE: int +CBS_LOWERCASE: int +CB_GETEDITSEL: int +CB_LIMITTEXT: int +CB_SETEDITSEL: int +CB_ADDSTRING: int +CB_DELETESTRING: int +CB_DIR: int +CB_GETCOUNT: int +CB_GETCURSEL: int +CB_GETLBTEXT: int +CB_GETLBTEXTLEN: int +CB_INSERTSTRING: int +CB_RESETCONTENT: int +CB_FINDSTRING: int +CB_SELECTSTRING: int +CB_SETCURSEL: int +CB_SHOWDROPDOWN: int +CB_GETITEMDATA: int +CB_SETITEMDATA: int +CB_GETDROPPEDCONTROLRECT: int +CB_SETITEMHEIGHT: int +CB_GETITEMHEIGHT: int +CB_SETEXTENDEDUI: int +CB_GETEXTENDEDUI: int +CB_GETDROPPEDSTATE: int +CB_FINDSTRINGEXACT: int +CB_SETLOCALE: int +CB_GETLOCALE: int +CB_GETTOPINDEX: int +CB_SETTOPINDEX: int +CB_GETHORIZONTALEXTENT: int +CB_SETHORIZONTALEXTENT: int +CB_GETDROPPEDWIDTH: int +CB_SETDROPPEDWIDTH: int +CB_INITSTORAGE: int +CB_MSGMAX: int +SBS_HORZ: int +SBS_VERT: int +SBS_TOPALIGN: int +SBS_LEFTALIGN: int +SBS_BOTTOMALIGN: int +SBS_RIGHTALIGN: int +SBS_SIZEBOXTOPLEFTALIGN: int +SBS_SIZEBOXBOTTOMRIGHTALIGN: int +SBS_SIZEBOX: int +SBS_SIZEGRIP: int +SBM_SETPOS: int +SBM_GETPOS: int +SBM_SETRANGE: int +SBM_SETRANGEREDRAW: int +SBM_GETRANGE: int +SBM_ENABLE_ARROWS: int +SBM_SETSCROLLINFO: int +SBM_GETSCROLLINFO: int +SIF_RANGE: int +SIF_PAGE: int +SIF_POS: int +SIF_DISABLENOSCROLL: int +SIF_TRACKPOS: int +SIF_ALL: int +MDIS_ALLCHILDSTYLES: int +MDITILE_VERTICAL: int +MDITILE_HORIZONTAL: int +MDITILE_SKIPDISABLED: int +IMC_GETCANDIDATEPOS: int +IMC_SETCANDIDATEPOS: int +IMC_GETCOMPOSITIONFONT: int +IMC_SETCOMPOSITIONFONT: int +IMC_GETCOMPOSITIONWINDOW: int +IMC_SETCOMPOSITIONWINDOW: int +IMC_GETSTATUSWINDOWPOS: int +IMC_SETSTATUSWINDOWPOS: int +IMC_CLOSESTATUSWINDOW: int +IMC_OPENSTATUSWINDOW: int +DELETE: int +READ_CONTROL: int +WRITE_DAC: int +WRITE_OWNER: int +SYNCHRONIZE: int +STANDARD_RIGHTS_REQUIRED: int +STANDARD_RIGHTS_READ: int +STANDARD_RIGHTS_WRITE: int +STANDARD_RIGHTS_EXECUTE: int +STANDARD_RIGHTS_ALL: int +SPECIFIC_RIGHTS_ALL: int +ACCESS_SYSTEM_SECURITY: int +MAXIMUM_ALLOWED: int +GENERIC_READ: int +GENERIC_WRITE: int +GENERIC_EXECUTE: int +GENERIC_ALL: int +SERVICE_KERNEL_DRIVER: int +SERVICE_FILE_SYSTEM_DRIVER: int +SERVICE_ADAPTER: int +SERVICE_RECOGNIZER_DRIVER: int +SERVICE_DRIVER: int +SERVICE_WIN32_OWN_PROCESS: int +SERVICE_WIN32_SHARE_PROCESS: int +SERVICE_WIN32: int +SERVICE_INTERACTIVE_PROCESS: int +SERVICE_TYPE_ALL: int +SERVICE_BOOT_START: int +SERVICE_SYSTEM_START: int +SERVICE_AUTO_START: int +SERVICE_DEMAND_START: int +SERVICE_DISABLED: int +SERVICE_ERROR_IGNORE: int +SERVICE_ERROR_NORMAL: int +SERVICE_ERROR_SEVERE: int +SERVICE_ERROR_CRITICAL: int +TAPE_ERASE_SHORT: int +TAPE_ERASE_LONG: int +TAPE_LOAD: int +TAPE_UNLOAD: int +TAPE_TENSION: int +TAPE_LOCK: int +TAPE_UNLOCK: int +TAPE_FORMAT: int +TAPE_SETMARKS: int +TAPE_FILEMARKS: int +TAPE_SHORT_FILEMARKS: int +TAPE_LONG_FILEMARKS: int +TAPE_ABSOLUTE_POSITION: int +TAPE_LOGICAL_POSITION: int +TAPE_PSEUDO_LOGICAL_POSITION: int +TAPE_REWIND: int +TAPE_ABSOLUTE_BLOCK: int +TAPE_LOGICAL_BLOCK: int +TAPE_PSEUDO_LOGICAL_BLOCK: int +TAPE_SPACE_END_OF_DATA: int +TAPE_SPACE_RELATIVE_BLOCKS: int +TAPE_SPACE_FILEMARKS: int +TAPE_SPACE_SEQUENTIAL_FMKS: int +TAPE_SPACE_SETMARKS: int +TAPE_SPACE_SEQUENTIAL_SMKS: int +TAPE_DRIVE_FIXED: int +TAPE_DRIVE_SELECT: int +TAPE_DRIVE_INITIATOR: int +TAPE_DRIVE_ERASE_SHORT: int +TAPE_DRIVE_ERASE_LONG: int +TAPE_DRIVE_ERASE_BOP_ONLY: int +TAPE_DRIVE_ERASE_IMMEDIATE: int +TAPE_DRIVE_TAPE_CAPACITY: int +TAPE_DRIVE_TAPE_REMAINING: int +TAPE_DRIVE_FIXED_BLOCK: int +TAPE_DRIVE_VARIABLE_BLOCK: int +TAPE_DRIVE_WRITE_PROTECT: int +TAPE_DRIVE_EOT_WZ_SIZE: int +TAPE_DRIVE_ECC: int +TAPE_DRIVE_COMPRESSION: int +TAPE_DRIVE_PADDING: int +TAPE_DRIVE_REPORT_SMKS: int +TAPE_DRIVE_GET_ABSOLUTE_BLK: int +TAPE_DRIVE_GET_LOGICAL_BLK: int +TAPE_DRIVE_SET_EOT_WZ_SIZE: int +TAPE_DRIVE_LOAD_UNLOAD: int +TAPE_DRIVE_TENSION: int +TAPE_DRIVE_LOCK_UNLOCK: int +TAPE_DRIVE_REWIND_IMMEDIATE: int +TAPE_DRIVE_SET_BLOCK_SIZE: int +TAPE_DRIVE_LOAD_UNLD_IMMED: int +TAPE_DRIVE_TENSION_IMMED: int +TAPE_DRIVE_LOCK_UNLK_IMMED: int +TAPE_DRIVE_SET_ECC: int +TAPE_DRIVE_SET_COMPRESSION: int +TAPE_DRIVE_SET_PADDING: int +TAPE_DRIVE_SET_REPORT_SMKS: int +TAPE_DRIVE_ABSOLUTE_BLK: int +TAPE_DRIVE_ABS_BLK_IMMED: int +TAPE_DRIVE_LOGICAL_BLK: int +TAPE_DRIVE_LOG_BLK_IMMED: int +TAPE_DRIVE_END_OF_DATA: int +TAPE_DRIVE_RELATIVE_BLKS: int +TAPE_DRIVE_FILEMARKS: int +TAPE_DRIVE_SEQUENTIAL_FMKS: int +TAPE_DRIVE_SETMARKS: int +TAPE_DRIVE_SEQUENTIAL_SMKS: int +TAPE_DRIVE_REVERSE_POSITION: int +TAPE_DRIVE_SPACE_IMMEDIATE: int +TAPE_DRIVE_WRITE_SETMARKS: int +TAPE_DRIVE_WRITE_FILEMARKS: int +TAPE_DRIVE_WRITE_SHORT_FMKS: int +TAPE_DRIVE_WRITE_LONG_FMKS: int +TAPE_DRIVE_WRITE_MARK_IMMED: int +TAPE_DRIVE_FORMAT: int +TAPE_DRIVE_FORMAT_IMMEDIATE: int +TAPE_FIXED_PARTITIONS: int +TAPE_SELECT_PARTITIONS: int +TAPE_INITIATOR_PARTITIONS: int +APPLICATION_ERROR_MASK: int +ERROR_SEVERITY_SUCCESS: int +ERROR_SEVERITY_INFORMATIONAL: int +ERROR_SEVERITY_WARNING: int +ERROR_SEVERITY_ERROR: int +MINCHAR: int +MAXCHAR: int +MINSHORT: int +MAXSHORT: int +MINLONG: int +MAXLONG: int +MAXBYTE: int +MAXWORD: int +MAXDWORD: int +LANG_NEUTRAL: int +LANG_BULGARIAN: int +LANG_CHINESE: int +LANG_CROATIAN: int +LANG_CZECH: int +LANG_DANISH: int +LANG_DUTCH: int +LANG_ENGLISH: int +LANG_FINNISH: int +LANG_FRENCH: int +LANG_GERMAN: int +LANG_GREEK: int +LANG_HUNGARIAN: int +LANG_ICELANDIC: int +LANG_ITALIAN: int +LANG_JAPANESE: int +LANG_KOREAN: int +LANG_NORWEGIAN: int +LANG_POLISH: int +LANG_PORTUGUESE: int +LANG_ROMANIAN: int +LANG_RUSSIAN: int +LANG_SLOVAK: int +LANG_SLOVENIAN: int +LANG_SPANISH: int +LANG_SWEDISH: int +LANG_TURKISH: int +SUBLANG_NEUTRAL: int +SUBLANG_DEFAULT: int +SUBLANG_SYS_DEFAULT: int +SUBLANG_CHINESE_TRADITIONAL: int +SUBLANG_CHINESE_SIMPLIFIED: int +SUBLANG_CHINESE_HONGKONG: int +SUBLANG_CHINESE_SINGAPORE: int +SUBLANG_DUTCH: int +SUBLANG_DUTCH_BELGIAN: int +SUBLANG_ENGLISH_US: int +SUBLANG_ENGLISH_UK: int +SUBLANG_ENGLISH_AUS: int +SUBLANG_ENGLISH_CAN: int +SUBLANG_ENGLISH_NZ: int +SUBLANG_ENGLISH_EIRE: int +SUBLANG_FRENCH: int +SUBLANG_FRENCH_BELGIAN: int +SUBLANG_FRENCH_CANADIAN: int +SUBLANG_FRENCH_SWISS: int +SUBLANG_GERMAN: int +SUBLANG_GERMAN_SWISS: int +SUBLANG_GERMAN_AUSTRIAN: int +SUBLANG_ITALIAN: int +SUBLANG_ITALIAN_SWISS: int +SUBLANG_NORWEGIAN_BOKMAL: int +SUBLANG_NORWEGIAN_NYNORSK: int +SUBLANG_PORTUGUESE: int +SUBLANG_PORTUGUESE_BRAZILIAN: int +SUBLANG_SPANISH: int +SUBLANG_SPANISH_MEXICAN: int +SUBLANG_SPANISH_MODERN: int +SORT_DEFAULT: int +SORT_JAPANESE_XJIS: int +SORT_JAPANESE_UNICODE: int +SORT_CHINESE_BIG5: int +SORT_CHINESE_UNICODE: int +SORT_KOREAN_KSC: int +SORT_KOREAN_UNICODE: int + +def PRIMARYLANGID(lgid: int) -> int: ... +def SUBLANGID(lgid: int) -> int: ... + +NLS_VALID_LOCALE_MASK: int +CONTEXT_PORTABLE_32BIT: int +CONTEXT_ALPHA: int +SIZE_OF_80387_REGISTERS: int +CONTEXT_CONTROL: int +CONTEXT_FLOATING_POINT: int +CONTEXT_INTEGER: int +CONTEXT_FULL: int +PROCESS_TERMINATE: int +PROCESS_CREATE_THREAD: int +PROCESS_VM_OPERATION: int +PROCESS_VM_READ: int +PROCESS_VM_WRITE: int +PROCESS_DUP_HANDLE: int +PROCESS_CREATE_PROCESS: int +PROCESS_SET_QUOTA: int +PROCESS_SET_INFORMATION: int +PROCESS_QUERY_INFORMATION: int +PROCESS_SUSPEND_RESUME: int +PROCESS_QUERY_LIMITED_INFORMATION: int +PROCESS_SET_LIMITED_INFORMATION: int +PROCESS_ALL_ACCESS: int +THREAD_TERMINATE: int +THREAD_SUSPEND_RESUME: int +THREAD_GET_CONTEXT: int +THREAD_SET_CONTEXT: int +THREAD_SET_INFORMATION: int +THREAD_QUERY_INFORMATION: int +THREAD_SET_THREAD_TOKEN: int +THREAD_IMPERSONATE: int +THREAD_DIRECT_IMPERSONATION: int +THREAD_SET_LIMITED_INFORMATION: int +THREAD_QUERY_LIMITED_INFORMATION: int +THREAD_RESUME: int +TLS_MINIMUM_AVAILABLE: int +EVENT_MODIFY_STATE: int +MUTANT_QUERY_STATE: int +SEMAPHORE_MODIFY_STATE: int +TIME_ZONE_ID_UNKNOWN: int +TIME_ZONE_ID_STANDARD: int +TIME_ZONE_ID_DAYLIGHT: int +PROCESSOR_INTEL_386: int +PROCESSOR_INTEL_486: int +PROCESSOR_INTEL_PENTIUM: int +PROCESSOR_INTEL_860: int +PROCESSOR_MIPS_R2000: int +PROCESSOR_MIPS_R3000: int +PROCESSOR_MIPS_R4000: int +PROCESSOR_ALPHA_21064: int +PROCESSOR_PPC_601: int +PROCESSOR_PPC_603: int +PROCESSOR_PPC_604: int +PROCESSOR_PPC_620: int +SECTION_QUERY: int +SECTION_MAP_WRITE: int +SECTION_MAP_READ: int +SECTION_MAP_EXECUTE: int +SECTION_EXTEND_SIZE: int +PAGE_NOACCESS: int +PAGE_READONLY: int +PAGE_READWRITE: int +PAGE_WRITECOPY: int +PAGE_EXECUTE: int +PAGE_EXECUTE_READ: int +PAGE_EXECUTE_READWRITE: int +PAGE_EXECUTE_WRITECOPY: int +PAGE_GUARD: int +PAGE_NOCACHE: int +MEM_COMMIT: int +MEM_RESERVE: int +MEM_DECOMMIT: int +MEM_RELEASE: int +MEM_FREE: int +MEM_PRIVATE: int +MEM_MAPPED: int +MEM_TOP_DOWN: int +SEC_FILE: int +SEC_IMAGE: int +SEC_RESERVE: int +SEC_COMMIT: int +SEC_NOCACHE: int +MEM_IMAGE: int +FILE_SHARE_READ: int +FILE_SHARE_WRITE: int +FILE_SHARE_DELETE: int +FILE_ATTRIBUTE_READONLY: int +FILE_ATTRIBUTE_HIDDEN: int +FILE_ATTRIBUTE_SYSTEM: int +FILE_ATTRIBUTE_DIRECTORY: int +FILE_ATTRIBUTE_ARCHIVE: int +FILE_ATTRIBUTE_DEVICE: int +FILE_ATTRIBUTE_NORMAL: int +FILE_ATTRIBUTE_TEMPORARY: int +FILE_ATTRIBUTE_SPARSE_FILE: int +FILE_ATTRIBUTE_REPARSE_POINT: int +FILE_ATTRIBUTE_COMPRESSED: int +FILE_ATTRIBUTE_OFFLINE: int +FILE_ATTRIBUTE_NOT_CONTENT_INDEXED: int +FILE_ATTRIBUTE_ENCRYPTED: int +FILE_ATTRIBUTE_VIRTUAL: int +FILE_ATTRIBUTE_ATOMIC_WRITE: int +FILE_ATTRIBUTE_XACTION_WRITE: int +FILE_NOTIFY_CHANGE_FILE_NAME: int +FILE_NOTIFY_CHANGE_DIR_NAME: int +FILE_NOTIFY_CHANGE_ATTRIBUTES: int +FILE_NOTIFY_CHANGE_SIZE: int +FILE_NOTIFY_CHANGE_LAST_WRITE: int +FILE_NOTIFY_CHANGE_SECURITY: int +FILE_CASE_SENSITIVE_SEARCH: int +FILE_CASE_PRESERVED_NAMES: int +FILE_UNICODE_ON_DISK: int +FILE_PERSISTENT_ACLS: int +FILE_FILE_COMPRESSION: int +FILE_VOLUME_IS_COMPRESSED: int +IO_COMPLETION_MODIFY_STATE: int +DUPLICATE_CLOSE_SOURCE: int +DUPLICATE_SAME_ACCESS: int +SID_MAX_SUB_AUTHORITIES: int +SECURITY_NULL_RID: int +SECURITY_WORLD_RID: int +SECURITY_LOCAL_RID: int +SECURITY_CREATOR_OWNER_RID: int +SECURITY_CREATOR_GROUP_RID: int +SECURITY_DIALUP_RID: int +SECURITY_NETWORK_RID: int +SECURITY_BATCH_RID: int +SECURITY_INTERACTIVE_RID: int +SECURITY_SERVICE_RID: int +SECURITY_ANONYMOUS_LOGON_RID: int +SECURITY_LOGON_IDS_RID: int +SECURITY_LOGON_IDS_RID_COUNT: int +SECURITY_LOCAL_SYSTEM_RID: int +SECURITY_NT_NON_UNIQUE: int +SECURITY_BUILTIN_DOMAIN_RID: int +DOMAIN_USER_RID_ADMIN: int +DOMAIN_USER_RID_GUEST: int +DOMAIN_GROUP_RID_ADMINS: int +DOMAIN_GROUP_RID_USERS: int +DOMAIN_GROUP_RID_GUESTS: int +DOMAIN_ALIAS_RID_ADMINS: int +DOMAIN_ALIAS_RID_USERS: int +DOMAIN_ALIAS_RID_GUESTS: int +DOMAIN_ALIAS_RID_POWER_USERS: int +DOMAIN_ALIAS_RID_ACCOUNT_OPS: int +DOMAIN_ALIAS_RID_SYSTEM_OPS: int +DOMAIN_ALIAS_RID_PRINT_OPS: int +DOMAIN_ALIAS_RID_BACKUP_OPS: int +DOMAIN_ALIAS_RID_REPLICATOR: int +SE_GROUP_MANDATORY: int +SE_GROUP_ENABLED_BY_DEFAULT: int +SE_GROUP_ENABLED: int +SE_GROUP_OWNER: int +SE_GROUP_LOGON_ID: int +ACL_REVISION: int +ACL_REVISION1: int +ACL_REVISION2: int +ACCESS_ALLOWED_ACE_TYPE: int +ACCESS_DENIED_ACE_TYPE: int +SYSTEM_AUDIT_ACE_TYPE: int +SYSTEM_ALARM_ACE_TYPE: int +OBJECT_INHERIT_ACE: int +CONTAINER_INHERIT_ACE: int +NO_PROPAGATE_INHERIT_ACE: int +INHERIT_ONLY_ACE: int +VALID_INHERIT_FLAGS: int +SUCCESSFUL_ACCESS_ACE_FLAG: int +FAILED_ACCESS_ACE_FLAG: int +SECURITY_DESCRIPTOR_REVISION: int +SECURITY_DESCRIPTOR_REVISION1: int +SECURITY_DESCRIPTOR_MIN_LENGTH: int +SE_OWNER_DEFAULTED: int +SE_GROUP_DEFAULTED: int +SE_DACL_PRESENT: int +SE_DACL_DEFAULTED: int +SE_SACL_PRESENT: int +SE_SACL_DEFAULTED: int +SE_SELF_RELATIVE: int +SE_PRIVILEGE_ENABLED_BY_DEFAULT: int +SE_PRIVILEGE_ENABLED: int +SE_PRIVILEGE_USED_FOR_ACCESS: int +PRIVILEGE_SET_ALL_NECESSARY: int +SE_CREATE_TOKEN_NAME: str +SE_ASSIGNPRIMARYTOKEN_NAME: str +SE_LOCK_MEMORY_NAME: str +SE_INCREASE_QUOTA_NAME: str +SE_UNSOLICITED_INPUT_NAME: str +SE_MACHINE_ACCOUNT_NAME: str +SE_TCB_NAME: str +SE_SECURITY_NAME: str +SE_TAKE_OWNERSHIP_NAME: str +SE_LOAD_DRIVER_NAME: str +SE_SYSTEM_PROFILE_NAME: str +SE_SYSTEMTIME_NAME: str +SE_PROF_SINGLE_PROCESS_NAME: str +SE_INC_BASE_PRIORITY_NAME: str +SE_CREATE_PAGEFILE_NAME: str +SE_CREATE_PERMANENT_NAME: str +SE_BACKUP_NAME: str +SE_RESTORE_NAME: str +SE_SHUTDOWN_NAME: str +SE_DEBUG_NAME: str +SE_AUDIT_NAME: str +SE_SYSTEM_ENVIRONMENT_NAME: str +SE_CHANGE_NOTIFY_NAME: str +SE_REMOTE_SHUTDOWN_NAME: str +TOKEN_ASSIGN_PRIMARY: int +TOKEN_DUPLICATE: int +TOKEN_IMPERSONATE: int +TOKEN_QUERY: int +TOKEN_QUERY_SOURCE: int +TOKEN_ADJUST_PRIVILEGES: int +TOKEN_ADJUST_GROUPS: int +TOKEN_ADJUST_DEFAULT: int +TOKEN_ALL_ACCESS: int +TOKEN_READ: int +TOKEN_WRITE: int +TOKEN_EXECUTE: int +TOKEN_SOURCE_LENGTH: int +KEY_QUERY_VALUE: int +KEY_SET_VALUE: int +KEY_CREATE_SUB_KEY: int +KEY_ENUMERATE_SUB_KEYS: int +KEY_NOTIFY: int +KEY_CREATE_LINK: int +KEY_WOW64_32KEY: int +KEY_WOW64_64KEY: int +KEY_WOW64_RES: int +KEY_READ: int +KEY_WRITE: int +KEY_EXECUTE: int +KEY_ALL_ACCESS: int +REG_NOTIFY_CHANGE_ATTRIBUTES: int +REG_NOTIFY_CHANGE_SECURITY: int +REG_NONE: int +REG_SZ: int +REG_EXPAND_SZ: int +REG_BINARY: int +REG_DWORD: int +REG_DWORD_LITTLE_ENDIAN: int +REG_DWORD_BIG_ENDIAN: int +REG_LINK: int +REG_MULTI_SZ: int +REG_FULL_RESOURCE_DESCRIPTOR: int +REG_QWORD: int +REG_QWORD_LITTLE_ENDIAN: int +NULL: int +HEAP_NO_SERIALIZE: int +HEAP_GROWABLE: int +HEAP_GENERATE_EXCEPTIONS: int +HEAP_ZERO_MEMORY: int +HEAP_REALLOC_IN_PLACE_ONLY: int +HEAP_TAIL_CHECKING_ENABLED: int +HEAP_FREE_CHECKING_ENABLED: int +HEAP_DISABLE_COALESCE_ON_FREE: int +IS_TEXT_UNICODE_ASCII16: int +IS_TEXT_UNICODE_REVERSE_ASCII16: int +IS_TEXT_UNICODE_STATISTICS: int +IS_TEXT_UNICODE_REVERSE_STATISTICS: int +IS_TEXT_UNICODE_CONTROLS: int +IS_TEXT_UNICODE_REVERSE_CONTROLS: int +IS_TEXT_UNICODE_SIGNATURE: int +IS_TEXT_UNICODE_REVERSE_SIGNATURE: int +IS_TEXT_UNICODE_ILLEGAL_CHARS: int +IS_TEXT_UNICODE_ODD_LENGTH: int +IS_TEXT_UNICODE_DBCS_LEADBYTE: int +IS_TEXT_UNICODE_NULL_BYTES: int +IS_TEXT_UNICODE_UNICODE_MASK: int +IS_TEXT_UNICODE_REVERSE_MASK: int +IS_TEXT_UNICODE_NOT_UNICODE_MASK: int +IS_TEXT_UNICODE_NOT_ASCII_MASK: int +COMPRESSION_FORMAT_NONE: int +COMPRESSION_FORMAT_DEFAULT: int +COMPRESSION_FORMAT_LZNT1: int +COMPRESSION_ENGINE_STANDARD: int +COMPRESSION_ENGINE_MAXIMUM: int +MESSAGE_RESOURCE_UNICODE: int +RTL_CRITSECT_TYPE: int +RTL_RESOURCE_TYPE: int +DLL_PROCESS_ATTACH: int +DLL_THREAD_ATTACH: int +DLL_THREAD_DETACH: int +DLL_PROCESS_DETACH: int +EVENTLOG_SEQUENTIAL_READ: int +EVENTLOG_SEEK_READ: int +EVENTLOG_FORWARDS_READ: int +EVENTLOG_BACKWARDS_READ: int +EVENTLOG_SUCCESS: int +EVENTLOG_ERROR_TYPE: int +EVENTLOG_WARNING_TYPE: int +EVENTLOG_INFORMATION_TYPE: int +EVENTLOG_AUDIT_SUCCESS: int +EVENTLOG_AUDIT_FAILURE: int +EVENTLOG_START_PAIRED_EVENT: int +EVENTLOG_END_PAIRED_EVENT: int +EVENTLOG_END_ALL_PAIRED_EVENTS: int +EVENTLOG_PAIRED_EVENT_ACTIVE: int +EVENTLOG_PAIRED_EVENT_INACTIVE: int +OWNER_SECURITY_INFORMATION: int +GROUP_SECURITY_INFORMATION: int +DACL_SECURITY_INFORMATION: int +SACL_SECURITY_INFORMATION: int +IMAGE_SIZEOF_FILE_HEADER: int +IMAGE_FILE_MACHINE_UNKNOWN: int +IMAGE_NUMBEROF_DIRECTORY_ENTRIES: int +IMAGE_SIZEOF_ROM_OPTIONAL_HEADER: int +IMAGE_SIZEOF_STD_OPTIONAL_HEADER: int +IMAGE_SIZEOF_NT_OPTIONAL_HEADER: int +IMAGE_NT_OPTIONAL_HDR_MAGIC: int +IMAGE_ROM_OPTIONAL_HDR_MAGIC: int +IMAGE_SIZEOF_SHORT_NAME: int +IMAGE_SIZEOF_SECTION_HEADER: int +IMAGE_SIZEOF_SYMBOL: int +IMAGE_SYM_CLASS_NULL: int +IMAGE_SYM_CLASS_AUTOMATIC: int +IMAGE_SYM_CLASS_EXTERNAL: int +IMAGE_SYM_CLASS_STATIC: int +IMAGE_SYM_CLASS_REGISTER: int +IMAGE_SYM_CLASS_EXTERNAL_DEF: int +IMAGE_SYM_CLASS_LABEL: int +IMAGE_SYM_CLASS_UNDEFINED_LABEL: int +IMAGE_SYM_CLASS_MEMBER_OF_STRUCT: int +IMAGE_SYM_CLASS_ARGUMENT: int +IMAGE_SYM_CLASS_STRUCT_TAG: int +IMAGE_SYM_CLASS_MEMBER_OF_UNION: int +IMAGE_SYM_CLASS_UNION_TAG: int +IMAGE_SYM_CLASS_TYPE_DEFINITION: int +IMAGE_SYM_CLASS_UNDEFINED_STATIC: int +IMAGE_SYM_CLASS_ENUM_TAG: int +IMAGE_SYM_CLASS_MEMBER_OF_ENUM: int +IMAGE_SYM_CLASS_REGISTER_PARAM: int +IMAGE_SYM_CLASS_BIT_FIELD: int +IMAGE_SYM_CLASS_BLOCK: int +IMAGE_SYM_CLASS_FUNCTION: int +IMAGE_SYM_CLASS_END_OF_STRUCT: int +IMAGE_SYM_CLASS_FILE: int +IMAGE_SYM_CLASS_SECTION: int +IMAGE_SYM_CLASS_WEAK_EXTERNAL: int +N_BTMASK: int +N_TMASK: int +N_TMASK1: int +N_TMASK2: int +N_BTSHFT: int +N_TSHIFT: int +IMAGE_SIZEOF_AUX_SYMBOL: int +IMAGE_COMDAT_SELECT_NODUPLICATES: int +IMAGE_COMDAT_SELECT_ANY: int +IMAGE_COMDAT_SELECT_SAME_SIZE: int +IMAGE_COMDAT_SELECT_EXACT_MATCH: int +IMAGE_COMDAT_SELECT_ASSOCIATIVE: int +IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY: int +IMAGE_WEAK_EXTERN_SEARCH_LIBRARY: int +IMAGE_WEAK_EXTERN_SEARCH_ALIAS: int +IMAGE_SIZEOF_RELOCATION: int +IMAGE_REL_I386_SECTION: int +IMAGE_REL_I386_SECREL: int +IMAGE_REL_MIPS_REFHALF: int +IMAGE_REL_MIPS_REFWORD: int +IMAGE_REL_MIPS_JMPADDR: int +IMAGE_REL_MIPS_REFHI: int +IMAGE_REL_MIPS_REFLO: int +IMAGE_REL_MIPS_GPREL: int +IMAGE_REL_MIPS_LITERAL: int +IMAGE_REL_MIPS_SECTION: int +IMAGE_REL_MIPS_SECREL: int +IMAGE_REL_MIPS_REFWORDNB: int +IMAGE_REL_MIPS_PAIR: int +IMAGE_REL_ALPHA_ABSOLUTE: int +IMAGE_REL_ALPHA_REFLONG: int +IMAGE_REL_ALPHA_REFQUAD: int +IMAGE_REL_ALPHA_GPREL32: int +IMAGE_REL_ALPHA_LITERAL: int +IMAGE_REL_ALPHA_LITUSE: int +IMAGE_REL_ALPHA_GPDISP: int +IMAGE_REL_ALPHA_BRADDR: int +IMAGE_REL_ALPHA_HINT: int +IMAGE_REL_ALPHA_INLINE_REFLONG: int +IMAGE_REL_ALPHA_REFHI: int +IMAGE_REL_ALPHA_REFLO: int +IMAGE_REL_ALPHA_PAIR: int +IMAGE_REL_ALPHA_MATCH: int +IMAGE_REL_ALPHA_SECTION: int +IMAGE_REL_ALPHA_SECREL: int +IMAGE_REL_ALPHA_REFLONGNB: int +IMAGE_SIZEOF_BASE_RELOCATION: int +IMAGE_REL_BASED_ABSOLUTE: int +IMAGE_REL_BASED_HIGH: int +IMAGE_REL_BASED_LOW: int +IMAGE_REL_BASED_HIGHLOW: int +IMAGE_REL_BASED_HIGHADJ: int +IMAGE_REL_BASED_MIPS_JMPADDR: int +IMAGE_SIZEOF_LINENUMBER: int +IMAGE_ARCHIVE_START_SIZE: int +IMAGE_ARCHIVE_START: str +IMAGE_ARCHIVE_END: str +IMAGE_ARCHIVE_PAD: str +IMAGE_ARCHIVE_LINKER_MEMBER: str +IMAGE_ARCHIVE_LONGNAMES_MEMBER: str +IMAGE_SIZEOF_ARCHIVE_MEMBER_HDR: int +IMAGE_ORDINAL_FLAG: int + +def IMAGE_SNAP_BY_ORDINAL(Ordinal: int) -> bool: ... +def IMAGE_ORDINAL(Ordinal: int) -> int: ... + +IMAGE_RESOURCE_NAME_IS_STRING: int +IMAGE_RESOURCE_DATA_IS_DIRECTORY: int +IMAGE_DEBUG_TYPE_UNKNOWN: int +IMAGE_DEBUG_TYPE_COFF: int +IMAGE_DEBUG_TYPE_CODEVIEW: int +IMAGE_DEBUG_TYPE_FPO: int +IMAGE_DEBUG_TYPE_MISC: int +IMAGE_DEBUG_TYPE_EXCEPTION: int +IMAGE_DEBUG_TYPE_FIXUP: int +IMAGE_DEBUG_TYPE_OMAP_TO_SRC: int +IMAGE_DEBUG_TYPE_OMAP_FROM_SRC: int +FRAME_FPO: int +FRAME_TRAP: int +FRAME_TSS: int +SIZEOF_RFPO_DATA: int +IMAGE_DEBUG_MISC_EXENAME: int +IMAGE_SEPARATE_DEBUG_SIGNATURE: int +NEWFRAME: int +ABORTDOC: int +NEXTBAND: int +SETCOLORTABLE: int +GETCOLORTABLE: int +FLUSHOUTPUT: int +DRAFTMODE: int +QUERYESCSUPPORT: int +SETABORTPROC: int +STARTDOC: int +ENDDOC: int +GETPHYSPAGESIZE: int +GETPRINTINGOFFSET: int +GETSCALINGFACTOR: int +MFCOMMENT: int +GETPENWIDTH: int +SETCOPYCOUNT: int +SELECTPAPERSOURCE: int +DEVICEDATA: int +PASSTHROUGH: int +GETTECHNOLGY: int +GETTECHNOLOGY: int +SETLINECAP: int +SETLINEJOIN: int +SETMITERLIMIT: int +BANDINFO: int +DRAWPATTERNRECT: int +GETVECTORPENSIZE: int +GETVECTORBRUSHSIZE: int +ENABLEDUPLEX: int +GETSETPAPERBINS: int +GETSETPRINTORIENT: int +ENUMPAPERBINS: int +SETDIBSCALING: int +EPSPRINTING: int +ENUMPAPERMETRICS: int +GETSETPAPERMETRICS: int +POSTSCRIPT_DATA: int +POSTSCRIPT_IGNORE: int +MOUSETRAILS: int +GETDEVICEUNITS: int +GETEXTENDEDTEXTMETRICS: int +GETEXTENTTABLE: int +GETPAIRKERNTABLE: int +GETTRACKKERNTABLE: int +EXTTEXTOUT: int +GETFACENAME: int +DOWNLOADFACE: int +ENABLERELATIVEWIDTHS: int +ENABLEPAIRKERNING: int +SETKERNTRACK: int +SETALLJUSTVALUES: int +SETCHARSET: int +STRETCHBLT: int +GETSETSCREENPARAMS: int +BEGIN_PATH: int +CLIP_TO_PATH: int +END_PATH: int +EXT_DEVICE_CAPS: int +RESTORE_CTM: int +SAVE_CTM: int +SET_ARC_DIRECTION: int +SET_BACKGROUND_COLOR: int +SET_POLY_MODE: int +SET_SCREEN_ANGLE: int +SET_SPREAD: int +TRANSFORM_CTM: int +SET_CLIP_BOX: int +SET_BOUNDS: int +SET_MIRROR_MODE: int +OPENCHANNEL: int +DOWNLOADHEADER: int +CLOSECHANNEL: int +POSTSCRIPT_PASSTHROUGH: int +ENCAPSULATED_POSTSCRIPT: int +SP_NOTREPORTED: int +SP_ERROR: int +SP_APPABORT: int +SP_USERABORT: int +SP_OUTOFDISK: int +SP_OUTOFMEMORY: int +PR_JOBSTATUS: int +OBJ_PEN: int +OBJ_BRUSH: int +OBJ_DC: int +OBJ_METADC: int +OBJ_PAL: int +OBJ_FONT: int +OBJ_BITMAP: int +OBJ_REGION: int +OBJ_METAFILE: int +OBJ_MEMDC: int +OBJ_EXTPEN: int +OBJ_ENHMETADC: int +OBJ_ENHMETAFILE: int +OBJ_COLORSPACE: int +MWT_IDENTITY: int +MWT_LEFTMULTIPLY: int +MWT_RIGHTMULTIPLY: int +MWT_MIN: int +MWT_MAX: int +BI_RGB: int +BI_RLE8: int +BI_RLE4: int +BI_BITFIELDS: int +TMPF_FIXED_PITCH: int +TMPF_VECTOR: int +TMPF_DEVICE: int +TMPF_TRUETYPE: int +NTM_REGULAR: int +NTM_BOLD: int +NTM_ITALIC: int +LF_FACESIZE: int +LF_FULLFACESIZE: int +OUT_DEFAULT_PRECIS: int +OUT_STRING_PRECIS: int +OUT_CHARACTER_PRECIS: int +OUT_STROKE_PRECIS: int +OUT_TT_PRECIS: int +OUT_DEVICE_PRECIS: int +OUT_RASTER_PRECIS: int +OUT_TT_ONLY_PRECIS: int +OUT_OUTLINE_PRECIS: int +CLIP_DEFAULT_PRECIS: int +CLIP_CHARACTER_PRECIS: int +CLIP_STROKE_PRECIS: int +CLIP_MASK: int +CLIP_LH_ANGLES: int +CLIP_TT_ALWAYS: int +CLIP_EMBEDDED: int +DEFAULT_QUALITY: int +DRAFT_QUALITY: int +PROOF_QUALITY: int +NONANTIALIASED_QUALITY: int +ANTIALIASED_QUALITY: int +CLEARTYPE_QUALITY: int +CLEARTYPE_NATURAL_QUALITY: int +DEFAULT_PITCH: int +FIXED_PITCH: int +VARIABLE_PITCH: int +ANSI_CHARSET: int +DEFAULT_CHARSET: int +SYMBOL_CHARSET: int +SHIFTJIS_CHARSET: int +HANGEUL_CHARSET: int +CHINESEBIG5_CHARSET: int +OEM_CHARSET: int +JOHAB_CHARSET: int +HEBREW_CHARSET: int +ARABIC_CHARSET: int +GREEK_CHARSET: int +TURKISH_CHARSET: int +VIETNAMESE_CHARSET: int +THAI_CHARSET: int +EASTEUROPE_CHARSET: int +RUSSIAN_CHARSET: int +MAC_CHARSET: int +BALTIC_CHARSET: int +FF_DONTCARE: int +FF_ROMAN: int +FF_SWISS: int +FF_MODERN: int +FF_SCRIPT: int +FF_DECORATIVE: int +FW_DONTCARE: int +FW_THIN: int +FW_EXTRALIGHT: int +FW_LIGHT: int +FW_NORMAL: int +FW_MEDIUM: int +FW_SEMIBOLD: int +FW_BOLD: int +FW_EXTRABOLD: int +FW_HEAVY: int +FW_ULTRALIGHT: int +FW_REGULAR: int +FW_DEMIBOLD: int +FW_ULTRABOLD: int +FW_BLACK: int +BS_SOLID: int +BS_NULL: int +BS_HOLLOW: int +BS_HATCHED: int +BS_PATTERN: int +BS_INDEXED: int +BS_DIBPATTERN: int +BS_DIBPATTERNPT: int +BS_PATTERN8X8: int +BS_DIBPATTERN8X8: int +HS_HORIZONTAL: int +HS_VERTICAL: int +HS_FDIAGONAL: int +HS_BDIAGONAL: int +HS_CROSS: int +HS_DIAGCROSS: int +HS_FDIAGONAL1: int +HS_BDIAGONAL1: int +HS_SOLID: int +HS_DENSE1: int +HS_DENSE2: int +HS_DENSE3: int +HS_DENSE4: int +HS_DENSE5: int +HS_DENSE6: int +HS_DENSE7: int +HS_DENSE8: int +HS_NOSHADE: int +HS_HALFTONE: int +HS_SOLIDCLR: int +HS_DITHEREDCLR: int +HS_SOLIDTEXTCLR: int +HS_DITHEREDTEXTCLR: int +HS_SOLIDBKCLR: int +HS_DITHEREDBKCLR: int +HS_API_MAX: int +PS_SOLID: int +PS_DASH: int +PS_DOT: int +PS_DASHDOT: int +PS_DASHDOTDOT: int +PS_NULL: int +PS_INSIDEFRAME: int +PS_USERSTYLE: int +PS_ALTERNATE: int +PS_STYLE_MASK: int +PS_ENDCAP_ROUND: int +PS_ENDCAP_SQUARE: int +PS_ENDCAP_FLAT: int +PS_ENDCAP_MASK: int +PS_JOIN_ROUND: int +PS_JOIN_BEVEL: int +PS_JOIN_MITER: int +PS_JOIN_MASK: int +PS_COSMETIC: int +PS_GEOMETRIC: int +PS_TYPE_MASK: int +AD_COUNTERCLOCKWISE: int +AD_CLOCKWISE: int +DRIVERVERSION: int +TECHNOLOGY: int +HORZSIZE: int +VERTSIZE: int +HORZRES: int +VERTRES: int +BITSPIXEL: int +PLANES: int +NUMBRUSHES: int +NUMPENS: int +NUMMARKERS: int +NUMFONTS: int +NUMCOLORS: int +PDEVICESIZE: int +CURVECAPS: int +LINECAPS: int +POLYGONALCAPS: int +TEXTCAPS: int +CLIPCAPS: int +RASTERCAPS: int +ASPECTX: int +ASPECTY: int +ASPECTXY: int +LOGPIXELSX: int +LOGPIXELSY: int +SIZEPALETTE: int +NUMRESERVED: int +COLORRES: int +PHYSICALWIDTH: int +PHYSICALHEIGHT: int +PHYSICALOFFSETX: int +PHYSICALOFFSETY: int +SCALINGFACTORX: int +SCALINGFACTORY: int +VREFRESH: int +DESKTOPVERTRES: int +DESKTOPHORZRES: int +BLTALIGNMENT: int +SHADEBLENDCAPS: int +COLORMGMTCAPS: int +DT_PLOTTER: int +DT_RASDISPLAY: int +DT_RASPRINTER: int +DT_RASCAMERA: int +DT_CHARSTREAM: int +DT_METAFILE: int +DT_DISPFILE: int +CC_NONE: int +CC_CIRCLES: int +CC_PIE: int +CC_CHORD: int +CC_ELLIPSES: int +CC_WIDE: int +CC_STYLED: int +CC_WIDESTYLED: int +CC_INTERIORS: int +CC_ROUNDRECT: int +LC_NONE: int +LC_POLYLINE: int +LC_MARKER: int +LC_POLYMARKER: int +LC_WIDE: int +LC_STYLED: int +LC_WIDESTYLED: int +LC_INTERIORS: int +PC_NONE: int +PC_POLYGON: int +PC_RECTANGLE: int +PC_WINDPOLYGON: int +PC_TRAPEZOID: int +PC_SCANLINE: int +PC_WIDE: int +PC_STYLED: int +PC_WIDESTYLED: int +PC_INTERIORS: int +CP_NONE: int +CP_RECTANGLE: int +CP_REGION: int +TC_OP_CHARACTER: int +TC_OP_STROKE: int +TC_CP_STROKE: int +TC_CR_90: int +TC_CR_ANY: int +TC_SF_X_YINDEP: int +TC_SA_DOUBLE: int +TC_SA_INTEGER: int +TC_SA_CONTIN: int +TC_EA_DOUBLE: int +TC_IA_ABLE: int +TC_UA_ABLE: int +TC_SO_ABLE: int +TC_RA_ABLE: int +TC_VA_ABLE: int +TC_RESERVED: int +TC_SCROLLBLT: int +RC_BITBLT: int +RC_BANDING: int +RC_SCALING: int +RC_BITMAP64: int +RC_GDI20_OUTPUT: int +RC_GDI20_STATE: int +RC_SAVEBITMAP: int +RC_DI_BITMAP: int +RC_PALETTE: int +RC_DIBTODEV: int +RC_BIGFONT: int +RC_STRETCHBLT: int +RC_FLOODFILL: int +RC_STRETCHDIB: int +RC_OP_DX_OUTPUT: int +RC_DEVBITS: int +DIB_RGB_COLORS: int +DIB_PAL_COLORS: int +DIB_PAL_INDICES: int +DIB_PAL_PHYSINDICES: int +DIB_PAL_LOGINDICES: int +SYSPAL_ERROR: int +SYSPAL_STATIC: int +SYSPAL_NOSTATIC: int +CBM_CREATEDIB: int +CBM_INIT: int +FLOODFILLBORDER: int +FLOODFILLSURFACE: int +CCHDEVICENAME: int +CCHFORMNAME: int +DM_SPECVERSION: int +DM_ORIENTATION: int +DM_PAPERSIZE: int +DM_PAPERLENGTH: int +DM_PAPERWIDTH: int +DM_SCALE: int +DM_POSITION: int +DM_NUP: int +DM_DISPLAYORIENTATION: int +DM_COPIES: int +DM_DEFAULTSOURCE: int +DM_PRINTQUALITY: int +DM_COLOR: int +DM_DUPLEX: int +DM_YRESOLUTION: int +DM_TTOPTION: int +DM_COLLATE: int +DM_FORMNAME: int +DM_LOGPIXELS: int +DM_BITSPERPEL: int +DM_PELSWIDTH: int +DM_PELSHEIGHT: int +DM_DISPLAYFLAGS: int +DM_DISPLAYFREQUENCY: int +DM_ICMMETHOD: int +DM_ICMINTENT: int +DM_MEDIATYPE: int +DM_DITHERTYPE: int +DM_PANNINGWIDTH: int +DM_PANNINGHEIGHT: int +DM_DISPLAYFIXEDOUTPUT: int +DMORIENT_PORTRAIT: int +DMORIENT_LANDSCAPE: int +DMDO_DEFAULT: int +DMDO_90: int +DMDO_180: int +DMDO_270: int +DMDFO_DEFAULT: int +DMDFO_STRETCH: int +DMDFO_CENTER: int +DMPAPER_LETTER: int +DMPAPER_LETTERSMALL: int +DMPAPER_TABLOID: int +DMPAPER_LEDGER: int +DMPAPER_LEGAL: int +DMPAPER_STATEMENT: int +DMPAPER_EXECUTIVE: int +DMPAPER_A3: int +DMPAPER_A4: int +DMPAPER_A4SMALL: int +DMPAPER_A5: int +DMPAPER_B4: int +DMPAPER_B5: int +DMPAPER_FOLIO: int +DMPAPER_QUARTO: int +DMPAPER_10X14: int +DMPAPER_11X17: int +DMPAPER_NOTE: int +DMPAPER_ENV_9: int +DMPAPER_ENV_10: int +DMPAPER_ENV_11: int +DMPAPER_ENV_12: int +DMPAPER_ENV_14: int +DMPAPER_CSHEET: int +DMPAPER_DSHEET: int +DMPAPER_ESHEET: int +DMPAPER_ENV_DL: int +DMPAPER_ENV_C5: int +DMPAPER_ENV_C3: int +DMPAPER_ENV_C4: int +DMPAPER_ENV_C6: int +DMPAPER_ENV_C65: int +DMPAPER_ENV_B4: int +DMPAPER_ENV_B5: int +DMPAPER_ENV_B6: int +DMPAPER_ENV_ITALY: int +DMPAPER_ENV_MONARCH: int +DMPAPER_ENV_PERSONAL: int +DMPAPER_FANFOLD_US: int +DMPAPER_FANFOLD_STD_GERMAN: int +DMPAPER_FANFOLD_LGL_GERMAN: int +DMPAPER_ISO_B4: int +DMPAPER_JAPANESE_POSTCARD: int +DMPAPER_9X11: int +DMPAPER_10X11: int +DMPAPER_15X11: int +DMPAPER_ENV_INVITE: int +DMPAPER_RESERVED_48: int +DMPAPER_RESERVED_49: int +DMPAPER_LETTER_EXTRA: int +DMPAPER_LEGAL_EXTRA: int +DMPAPER_TABLOID_EXTRA: int +DMPAPER_A4_EXTRA: int +DMPAPER_LETTER_TRANSVERSE: int +DMPAPER_A4_TRANSVERSE: int +DMPAPER_LETTER_EXTRA_TRANSVERSE: int +DMPAPER_A_PLUS: int +DMPAPER_B_PLUS: int +DMPAPER_LETTER_PLUS: int +DMPAPER_A4_PLUS: int +DMPAPER_A5_TRANSVERSE: int +DMPAPER_B5_TRANSVERSE: int +DMPAPER_A3_EXTRA: int +DMPAPER_A5_EXTRA: int +DMPAPER_B5_EXTRA: int +DMPAPER_A2: int +DMPAPER_A3_TRANSVERSE: int +DMPAPER_A3_EXTRA_TRANSVERSE: int +DMPAPER_DBL_JAPANESE_POSTCARD: int +DMPAPER_A6: int +DMPAPER_JENV_KAKU2: int +DMPAPER_JENV_KAKU3: int +DMPAPER_JENV_CHOU3: int +DMPAPER_JENV_CHOU4: int +DMPAPER_LETTER_ROTATED: int +DMPAPER_A3_ROTATED: int +DMPAPER_A4_ROTATED: int +DMPAPER_A5_ROTATED: int +DMPAPER_B4_JIS_ROTATED: int +DMPAPER_B5_JIS_ROTATED: int +DMPAPER_JAPANESE_POSTCARD_ROTATED: int +DMPAPER_DBL_JAPANESE_POSTCARD_ROTATED: int +DMPAPER_A6_ROTATED: int +DMPAPER_JENV_KAKU2_ROTATED: int +DMPAPER_JENV_KAKU3_ROTATED: int +DMPAPER_JENV_CHOU3_ROTATED: int +DMPAPER_JENV_CHOU4_ROTATED: int +DMPAPER_B6_JIS: int +DMPAPER_B6_JIS_ROTATED: int +DMPAPER_12X11: int +DMPAPER_JENV_YOU4: int +DMPAPER_JENV_YOU4_ROTATED: int +DMPAPER_P16K: int +DMPAPER_P32K: int +DMPAPER_P32KBIG: int +DMPAPER_PENV_1: int +DMPAPER_PENV_2: int +DMPAPER_PENV_3: int +DMPAPER_PENV_4: int +DMPAPER_PENV_5: int +DMPAPER_PENV_6: int +DMPAPER_PENV_7: int +DMPAPER_PENV_8: int +DMPAPER_PENV_9: int +DMPAPER_PENV_10: int +DMPAPER_P16K_ROTATED: int +DMPAPER_P32K_ROTATED: int +DMPAPER_P32KBIG_ROTATED: int +DMPAPER_PENV_1_ROTATED: int +DMPAPER_PENV_2_ROTATED: int +DMPAPER_PENV_3_ROTATED: int +DMPAPER_PENV_4_ROTATED: int +DMPAPER_PENV_5_ROTATED: int +DMPAPER_PENV_6_ROTATED: int +DMPAPER_PENV_7_ROTATED: int +DMPAPER_PENV_8_ROTATED: int +DMPAPER_PENV_9_ROTATED: int +DMPAPER_PENV_10_ROTATED: int +DMPAPER_LAST: int +DMPAPER_USER: int +DMBIN_UPPER: int +DMBIN_ONLYONE: int +DMBIN_LOWER: int +DMBIN_MIDDLE: int +DMBIN_MANUAL: int +DMBIN_ENVELOPE: int +DMBIN_ENVMANUAL: int +DMBIN_AUTO: int +DMBIN_TRACTOR: int +DMBIN_SMALLFMT: int +DMBIN_LARGEFMT: int +DMBIN_LARGECAPACITY: int +DMBIN_CASSETTE: int +DMBIN_FORMSOURCE: int +DMBIN_LAST: int +DMBIN_USER: int +DMRES_DRAFT: int +DMRES_LOW: int +DMRES_MEDIUM: int +DMRES_HIGH: int +DMCOLOR_MONOCHROME: int +DMCOLOR_COLOR: int +DMDUP_SIMPLEX: int +DMDUP_VERTICAL: int +DMDUP_HORIZONTAL: int +DMTT_BITMAP: int +DMTT_DOWNLOAD: int +DMTT_SUBDEV: int +DMTT_DOWNLOAD_OUTLINE: int +DMCOLLATE_FALSE: int +DMCOLLATE_TRUE: int +DM_GRAYSCALE: int +DM_INTERLACED: int +DMICMMETHOD_NONE: int +DMICMMETHOD_SYSTEM: int +DMICMMETHOD_DRIVER: int +DMICMMETHOD_DEVICE: int +DMICMMETHOD_USER: int +DMICM_SATURATE: int +DMICM_CONTRAST: int +DMICM_COLORIMETRIC: int +DMICM_ABS_COLORIMETRIC: int +DMICM_USER: int +DMMEDIA_STANDARD: int +DMMEDIA_TRANSPARENCY: int +DMMEDIA_GLOSSY: int +DMMEDIA_USER: int +DMDITHER_NONE: int +DMDITHER_COARSE: int +DMDITHER_FINE: int +DMDITHER_LINEART: int +DMDITHER_ERRORDIFFUSION: int +DMDITHER_RESERVED6: int +DMDITHER_RESERVED7: int +DMDITHER_RESERVED8: int +DMDITHER_RESERVED9: int +DMDITHER_GRAYSCALE: int +DMDITHER_USER: int +DMNUP_SYSTEM: int +DMNUP_ONEUP: int +FEATURESETTING_NUP: int +FEATURESETTING_OUTPUT: int +FEATURESETTING_PSLEVEL: int +FEATURESETTING_CUSTPAPER: int +FEATURESETTING_MIRROR: int +FEATURESETTING_NEGATIVE: int +FEATURESETTING_PROTOCOL: int +FEATURESETTING_PRIVATE_BEGIN: int +FEATURESETTING_PRIVATE_END: int +RDH_RECTANGLES: int +GGO_METRICS: int +GGO_BITMAP: int +GGO_NATIVE: int +TT_POLYGON_TYPE: int +TT_PRIM_LINE: int +TT_PRIM_QSPLINE: int +TT_AVAILABLE: int +TT_ENABLED: int +DM_UPDATE: int +DM_COPY: int +DM_PROMPT: int +DM_MODIFY: int +DM_IN_BUFFER: int +DM_IN_PROMPT: int +DM_OUT_BUFFER: int +DM_OUT_DEFAULT: int +DISPLAY_DEVICE_ATTACHED_TO_DESKTOP: int +DISPLAY_DEVICE_MULTI_DRIVER: int +DISPLAY_DEVICE_PRIMARY_DEVICE: int +DISPLAY_DEVICE_MIRRORING_DRIVER: int +DISPLAY_DEVICE_VGA_COMPATIBLE: int +DISPLAY_DEVICE_REMOVABLE: int +DISPLAY_DEVICE_MODESPRUNED: int +DISPLAY_DEVICE_REMOTE: int +DISPLAY_DEVICE_DISCONNECT: int +DC_FIELDS: int +DC_PAPERS: int +DC_PAPERSIZE: int +DC_MINEXTENT: int +DC_MAXEXTENT: int +DC_BINS: int +DC_DUPLEX: int +DC_SIZE: int +DC_EXTRA: int +DC_VERSION: int +DC_DRIVER: int +DC_BINNAMES: int +DC_ENUMRESOLUTIONS: int +DC_FILEDEPENDENCIES: int +DC_TRUETYPE: int +DC_PAPERNAMES: int +DC_ORIENTATION: int +DC_COPIES: int +DC_BINADJUST: int +DC_EMF_COMPLIANT: int +DC_DATATYPE_PRODUCED: int +DC_COLLATE: int +DC_MANUFACTURER: int +DC_MODEL: int +DC_PERSONALITY: int +DC_PRINTRATE: int +DC_PRINTRATEUNIT: int +DC_PRINTERMEM: int +DC_MEDIAREADY: int +DC_STAPLE: int +DC_PRINTRATEPPM: int +DC_COLORDEVICE: int +DC_NUP: int +DC_MEDIATYPENAMES: int +DC_MEDIATYPES: int +PRINTRATEUNIT_PPM: int +PRINTRATEUNIT_CPS: int +PRINTRATEUNIT_LPM: int +PRINTRATEUNIT_IPM: int +DCTT_BITMAP: int +DCTT_DOWNLOAD: int +DCTT_SUBDEV: int +DCTT_DOWNLOAD_OUTLINE: int +DCBA_FACEUPNONE: int +DCBA_FACEUPCENTER: int +DCBA_FACEUPLEFT: int +DCBA_FACEUPRIGHT: int +DCBA_FACEDOWNNONE: int +DCBA_FACEDOWNCENTER: int +DCBA_FACEDOWNLEFT: int +DCBA_FACEDOWNRIGHT: int +CA_NEGATIVE: int +CA_LOG_FILTER: int +ILLUMINANT_DEVICE_DEFAULT: int +ILLUMINANT_A: int +ILLUMINANT_B: int +ILLUMINANT_C: int +ILLUMINANT_D50: int +ILLUMINANT_D55: int +ILLUMINANT_D65: int +ILLUMINANT_D75: int +ILLUMINANT_F2: int +ILLUMINANT_MAX_INDEX: int +ILLUMINANT_TUNGSTEN: int +ILLUMINANT_DAYLIGHT: int +ILLUMINANT_FLUORESCENT: int +ILLUMINANT_NTSC: int +FONTMAPPER_MAX: int +ENHMETA_SIGNATURE: int +ENHMETA_STOCK_OBJECT: int +EMR_HEADER: int +EMR_POLYBEZIER: int +EMR_POLYGON: int +EMR_POLYLINE: int +EMR_POLYBEZIERTO: int +EMR_POLYLINETO: int +EMR_POLYPOLYLINE: int +EMR_POLYPOLYGON: int +EMR_SETWINDOWEXTEX: int +EMR_SETWINDOWORGEX: int +EMR_SETVIEWPORTEXTEX: int +EMR_SETVIEWPORTORGEX: int +EMR_SETBRUSHORGEX: int +EMR_EOF: int +EMR_SETPIXELV: int +EMR_SETMAPPERFLAGS: int +EMR_SETMAPMODE: int +EMR_SETBKMODE: int +EMR_SETPOLYFILLMODE: int +EMR_SETROP2: int +EMR_SETSTRETCHBLTMODE: int +EMR_SETTEXTALIGN: int +EMR_SETCOLORADJUSTMENT: int +EMR_SETTEXTCOLOR: int +EMR_SETBKCOLOR: int +EMR_OFFSETCLIPRGN: int +EMR_MOVETOEX: int +EMR_SETMETARGN: int +EMR_EXCLUDECLIPRECT: int +EMR_INTERSECTCLIPRECT: int +EMR_SCALEVIEWPORTEXTEX: int +EMR_SCALEWINDOWEXTEX: int +EMR_SAVEDC: int +EMR_RESTOREDC: int +EMR_SETWORLDTRANSFORM: int +EMR_MODIFYWORLDTRANSFORM: int +EMR_SELECTOBJECT: int +EMR_CREATEPEN: int +EMR_CREATEBRUSHINDIRECT: int +EMR_DELETEOBJECT: int +EMR_ANGLEARC: int +EMR_ELLIPSE: int +EMR_RECTANGLE: int +EMR_ROUNDRECT: int +EMR_ARC: int +EMR_CHORD: int +EMR_PIE: int +EMR_SELECTPALETTE: int +EMR_CREATEPALETTE: int +EMR_SETPALETTEENTRIES: int +EMR_RESIZEPALETTE: int +EMR_REALIZEPALETTE: int +EMR_EXTFLOODFILL: int +EMR_LINETO: int +EMR_ARCTO: int +EMR_POLYDRAW: int +EMR_SETARCDIRECTION: int +EMR_SETMITERLIMIT: int +EMR_BEGINPATH: int +EMR_ENDPATH: int +EMR_CLOSEFIGURE: int +EMR_FILLPATH: int +EMR_STROKEANDFILLPATH: int +EMR_STROKEPATH: int +EMR_FLATTENPATH: int +EMR_WIDENPATH: int +EMR_SELECTCLIPPATH: int +EMR_ABORTPATH: int +EMR_GDICOMMENT: int +EMR_FILLRGN: int +EMR_FRAMERGN: int +EMR_INVERTRGN: int +EMR_PAINTRGN: int +EMR_EXTSELECTCLIPRGN: int +EMR_BITBLT: int +EMR_STRETCHBLT: int +EMR_MASKBLT: int +EMR_PLGBLT: int +EMR_SETDIBITSTODEVICE: int +EMR_STRETCHDIBITS: int +EMR_EXTCREATEFONTINDIRECTW: int +EMR_EXTTEXTOUTA: int +EMR_EXTTEXTOUTW: int +EMR_POLYBEZIER16: int +EMR_POLYGON16: int +EMR_POLYLINE16: int +EMR_POLYBEZIERTO16: int +EMR_POLYLINETO16: int +EMR_POLYPOLYLINE16: int +EMR_POLYPOLYGON16: int +EMR_POLYDRAW16: int +EMR_CREATEMONOBRUSH: int +EMR_CREATEDIBPATTERNBRUSHPT: int +EMR_EXTCREATEPEN: int +EMR_POLYTEXTOUTA: int +EMR_POLYTEXTOUTW: int +EMR_MIN: int +EMR_MAX: int +PANOSE_COUNT: int +PAN_FAMILYTYPE_INDEX: int +PAN_SERIFSTYLE_INDEX: int +PAN_WEIGHT_INDEX: int +PAN_PROPORTION_INDEX: int +PAN_CONTRAST_INDEX: int +PAN_STROKEVARIATION_INDEX: int +PAN_ARMSTYLE_INDEX: int +PAN_LETTERFORM_INDEX: int +PAN_MIDLINE_INDEX: int +PAN_XHEIGHT_INDEX: int +PAN_CULTURE_LATIN: int +PAN_ANY: int +PAN_NO_FIT: int +PAN_FAMILY_TEXT_DISPLAY: int +PAN_FAMILY_SCRIPT: int +PAN_FAMILY_DECORATIVE: int +PAN_FAMILY_PICTORIAL: int +PAN_SERIF_COVE: int +PAN_SERIF_OBTUSE_COVE: int +PAN_SERIF_SQUARE_COVE: int +PAN_SERIF_OBTUSE_SQUARE_COVE: int +PAN_SERIF_SQUARE: int +PAN_SERIF_THIN: int +PAN_SERIF_BONE: int +PAN_SERIF_EXAGGERATED: int +PAN_SERIF_TRIANGLE: int +PAN_SERIF_NORMAL_SANS: int +PAN_SERIF_OBTUSE_SANS: int +PAN_SERIF_PERP_SANS: int +PAN_SERIF_FLARED: int +PAN_SERIF_ROUNDED: int +PAN_WEIGHT_VERY_LIGHT: int +PAN_WEIGHT_LIGHT: int +PAN_WEIGHT_THIN: int +PAN_WEIGHT_BOOK: int +PAN_WEIGHT_MEDIUM: int +PAN_WEIGHT_DEMI: int +PAN_WEIGHT_BOLD: int +PAN_WEIGHT_HEAVY: int +PAN_WEIGHT_BLACK: int +PAN_WEIGHT_NORD: int +PAN_PROP_OLD_STYLE: int +PAN_PROP_MODERN: int +PAN_PROP_EVEN_WIDTH: int +PAN_PROP_EXPANDED: int +PAN_PROP_CONDENSED: int +PAN_PROP_VERY_EXPANDED: int +PAN_PROP_VERY_CONDENSED: int +PAN_PROP_MONOSPACED: int +PAN_CONTRAST_NONE: int +PAN_CONTRAST_VERY_LOW: int +PAN_CONTRAST_LOW: int +PAN_CONTRAST_MEDIUM_LOW: int +PAN_CONTRAST_MEDIUM: int +PAN_CONTRAST_MEDIUM_HIGH: int +PAN_CONTRAST_HIGH: int +PAN_CONTRAST_VERY_HIGH: int +PAN_STROKE_GRADUAL_DIAG: int +PAN_STROKE_GRADUAL_TRAN: int +PAN_STROKE_GRADUAL_VERT: int +PAN_STROKE_GRADUAL_HORZ: int +PAN_STROKE_RAPID_VERT: int +PAN_STROKE_RAPID_HORZ: int +PAN_STROKE_INSTANT_VERT: int +PAN_STRAIGHT_ARMS_HORZ: int +PAN_STRAIGHT_ARMS_WEDGE: int +PAN_STRAIGHT_ARMS_VERT: int +PAN_STRAIGHT_ARMS_SINGLE_SERIF: int +PAN_STRAIGHT_ARMS_DOUBLE_SERIF: int +PAN_BENT_ARMS_HORZ: int +PAN_BENT_ARMS_WEDGE: int +PAN_BENT_ARMS_VERT: int +PAN_BENT_ARMS_SINGLE_SERIF: int +PAN_BENT_ARMS_DOUBLE_SERIF: int +PAN_LETT_NORMAL_CONTACT: int +PAN_LETT_NORMAL_WEIGHTED: int +PAN_LETT_NORMAL_BOXED: int +PAN_LETT_NORMAL_FLATTENED: int +PAN_LETT_NORMAL_ROUNDED: int +PAN_LETT_NORMAL_OFF_CENTER: int +PAN_LETT_NORMAL_SQUARE: int +PAN_LETT_OBLIQUE_CONTACT: int +PAN_LETT_OBLIQUE_WEIGHTED: int +PAN_LETT_OBLIQUE_BOXED: int +PAN_LETT_OBLIQUE_FLATTENED: int +PAN_LETT_OBLIQUE_ROUNDED: int +PAN_LETT_OBLIQUE_OFF_CENTER: int +PAN_LETT_OBLIQUE_SQUARE: int +PAN_MIDLINE_STANDARD_TRIMMED: int +PAN_MIDLINE_STANDARD_POINTED: int +PAN_MIDLINE_STANDARD_SERIFED: int +PAN_MIDLINE_HIGH_TRIMMED: int +PAN_MIDLINE_HIGH_POINTED: int +PAN_MIDLINE_HIGH_SERIFED: int +PAN_MIDLINE_CONSTANT_TRIMMED: int +PAN_MIDLINE_CONSTANT_POINTED: int +PAN_MIDLINE_CONSTANT_SERIFED: int +PAN_MIDLINE_LOW_TRIMMED: int +PAN_MIDLINE_LOW_POINTED: int +PAN_MIDLINE_LOW_SERIFED: int +PAN_XHEIGHT_CONSTANT_SMALL: int +PAN_XHEIGHT_CONSTANT_STD: int +PAN_XHEIGHT_CONSTANT_LARGE: int +PAN_XHEIGHT_DUCKING_SMALL: int +PAN_XHEIGHT_DUCKING_STD: int +PAN_XHEIGHT_DUCKING_LARGE: int +ELF_VENDOR_SIZE: int +ELF_VERSION: int +ELF_CULTURE_LATIN: int +RASTER_FONTTYPE: int +DEVICE_FONTTYPE: int +TRUETYPE_FONTTYPE: int + +def PALETTEINDEX(i: int) -> int: ... + +PC_RESERVED: int +PC_EXPLICIT: int +PC_NOCOLLAPSE: int + +def GetRValue(rgb: int) -> int: ... +def GetGValue(rgb: int) -> int: ... +def GetBValue(rgb: int) -> int: ... + +TRANSPARENT: int +OPAQUE: int +BKMODE_LAST: int +GM_COMPATIBLE: int +GM_ADVANCED: int +GM_LAST: int +PT_CLOSEFIGURE: int +PT_LINETO: int +PT_BEZIERTO: int +PT_MOVETO: int +MM_TEXT: int +MM_LOMETRIC: int +MM_HIMETRIC: int +MM_LOENGLISH: int +MM_HIENGLISH: int +MM_TWIPS: int +MM_ISOTROPIC: int +MM_ANISOTROPIC: int +MM_MIN: int +MM_MAX: int +MM_MAX_FIXEDSCALE: int +ABSOLUTE: int +RELATIVE: int +WHITE_BRUSH: int +LTGRAY_BRUSH: int +GRAY_BRUSH: int +DKGRAY_BRUSH: int +BLACK_BRUSH: int +NULL_BRUSH: int +HOLLOW_BRUSH: int +WHITE_PEN: int +BLACK_PEN: int +NULL_PEN: int +OEM_FIXED_FONT: int +ANSI_FIXED_FONT: int +ANSI_VAR_FONT: int +SYSTEM_FONT: int +DEVICE_DEFAULT_FONT: int +DEFAULT_PALETTE: int +SYSTEM_FIXED_FONT: int +STOCK_LAST: int +CLR_INVALID: int +DC_BRUSH: int +DC_PEN: int +STATUS_WAIT_0: int +STATUS_ABANDONED_WAIT_0: int +STATUS_USER_APC: int +STATUS_TIMEOUT: int +STATUS_PENDING: int +STATUS_SEGMENT_NOTIFICATION: int +STATUS_GUARD_PAGE_VIOLATION: int +STATUS_DATATYPE_MISALIGNMENT: int +STATUS_BREAKPOINT: int +STATUS_SINGLE_STEP: int +STATUS_ACCESS_VIOLATION: int +STATUS_IN_PAGE_ERROR: int +STATUS_INVALID_HANDLE: int +STATUS_NO_MEMORY: int +STATUS_ILLEGAL_INSTRUCTION: int +STATUS_NONCONTINUABLE_EXCEPTION: int +STATUS_INVALID_DISPOSITION: int +STATUS_ARRAY_BOUNDS_EXCEEDED: int +STATUS_FLOAT_DENORMAL_OPERAND: int +STATUS_FLOAT_DIVIDE_BY_ZERO: int +STATUS_FLOAT_INEXACT_RESULT: int +STATUS_FLOAT_INVALID_OPERATION: int +STATUS_FLOAT_OVERFLOW: int +STATUS_FLOAT_STACK_CHECK: int +STATUS_FLOAT_UNDERFLOW: int +STATUS_INTEGER_DIVIDE_BY_ZERO: int +STATUS_INTEGER_OVERFLOW: int +STATUS_PRIVILEGED_INSTRUCTION: int +STATUS_STACK_OVERFLOW: int +STATUS_CONTROL_C_EXIT: int +WAIT_FAILED: int +WAIT_OBJECT_0: int +WAIT_ABANDONED: int +WAIT_ABANDONED_0: int +WAIT_TIMEOUT: int +WAIT_IO_COMPLETION: int +STILL_ACTIVE: int +EXCEPTION_ACCESS_VIOLATION: int +EXCEPTION_DATATYPE_MISALIGNMENT: int +EXCEPTION_BREAKPOINT: int +EXCEPTION_SINGLE_STEP: int +EXCEPTION_ARRAY_BOUNDS_EXCEEDED: int +EXCEPTION_FLT_DENORMAL_OPERAND: int +EXCEPTION_FLT_DIVIDE_BY_ZERO: int +EXCEPTION_FLT_INEXACT_RESULT: int +EXCEPTION_FLT_INVALID_OPERATION: int +EXCEPTION_FLT_OVERFLOW: int +EXCEPTION_FLT_STACK_CHECK: int +EXCEPTION_FLT_UNDERFLOW: int +EXCEPTION_INT_DIVIDE_BY_ZERO: int +EXCEPTION_INT_OVERFLOW: int +EXCEPTION_PRIV_INSTRUCTION: int +EXCEPTION_IN_PAGE_ERROR: int +EXCEPTION_ILLEGAL_INSTRUCTION: int +EXCEPTION_NONCONTINUABLE_EXCEPTION: int +EXCEPTION_STACK_OVERFLOW: int +EXCEPTION_INVALID_DISPOSITION: int +EXCEPTION_GUARD_PAGE: int +EXCEPTION_INVALID_HANDLE: int +CONTROL_C_EXIT: int +SPI_GETBEEP: int +SPI_SETBEEP: int +SPI_GETMOUSE: int +SPI_SETMOUSE: int +SPI_GETBORDER: int +SPI_SETBORDER: int +SPI_GETKEYBOARDSPEED: int +SPI_SETKEYBOARDSPEED: int +SPI_LANGDRIVER: int +SPI_ICONHORIZONTALSPACING: int +SPI_GETSCREENSAVETIMEOUT: int +SPI_SETSCREENSAVETIMEOUT: int +SPI_GETSCREENSAVEACTIVE: int +SPI_SETSCREENSAVEACTIVE: int +SPI_GETGRIDGRANULARITY: int +SPI_SETGRIDGRANULARITY: int +SPI_SETDESKWALLPAPER: int +SPI_SETDESKPATTERN: int +SPI_GETKEYBOARDDELAY: int +SPI_SETKEYBOARDDELAY: int +SPI_ICONVERTICALSPACING: int +SPI_GETICONTITLEWRAP: int +SPI_SETICONTITLEWRAP: int +SPI_GETMENUDROPALIGNMENT: int +SPI_SETMENUDROPALIGNMENT: int +SPI_SETDOUBLECLKWIDTH: int +SPI_SETDOUBLECLKHEIGHT: int +SPI_GETICONTITLELOGFONT: int +SPI_SETDOUBLECLICKTIME: int +SPI_SETMOUSEBUTTONSWAP: int +SPI_SETICONTITLELOGFONT: int +SPI_GETFASTTASKSWITCH: int +SPI_SETFASTTASKSWITCH: int +SPI_SETDRAGFULLWINDOWS: int +SPI_GETDRAGFULLWINDOWS: int +SPI_GETNONCLIENTMETRICS: int +SPI_SETNONCLIENTMETRICS: int +SPI_GETMINIMIZEDMETRICS: int +SPI_SETMINIMIZEDMETRICS: int +SPI_GETICONMETRICS: int +SPI_SETICONMETRICS: int +SPI_SETWORKAREA: int +SPI_GETWORKAREA: int +SPI_SETPENWINDOWS: int +SPI_GETFILTERKEYS: int +SPI_SETFILTERKEYS: int +SPI_GETTOGGLEKEYS: int +SPI_SETTOGGLEKEYS: int +SPI_GETMOUSEKEYS: int +SPI_SETMOUSEKEYS: int +SPI_GETSHOWSOUNDS: int +SPI_SETSHOWSOUNDS: int +SPI_GETSTICKYKEYS: int +SPI_SETSTICKYKEYS: int +SPI_GETACCESSTIMEOUT: int +SPI_SETACCESSTIMEOUT: int +SPI_GETSERIALKEYS: int +SPI_SETSERIALKEYS: int +SPI_GETSOUNDSENTRY: int +SPI_SETSOUNDSENTRY: int +SPI_GETHIGHCONTRAST: int +SPI_SETHIGHCONTRAST: int +SPI_GETKEYBOARDPREF: int +SPI_SETKEYBOARDPREF: int +SPI_GETSCREENREADER: int +SPI_SETSCREENREADER: int +SPI_GETANIMATION: int +SPI_SETANIMATION: int +SPI_GETFONTSMOOTHING: int +SPI_SETFONTSMOOTHING: int +SPI_SETDRAGWIDTH: int +SPI_SETDRAGHEIGHT: int +SPI_SETHANDHELD: int +SPI_GETLOWPOWERTIMEOUT: int +SPI_GETPOWEROFFTIMEOUT: int +SPI_SETLOWPOWERTIMEOUT: int +SPI_SETPOWEROFFTIMEOUT: int +SPI_GETLOWPOWERACTIVE: int +SPI_GETPOWEROFFACTIVE: int +SPI_SETLOWPOWERACTIVE: int +SPI_SETPOWEROFFACTIVE: int +SPI_SETCURSORS: int +SPI_SETICONS: int +SPI_GETDEFAULTINPUTLANG: int +SPI_SETDEFAULTINPUTLANG: int +SPI_SETLANGTOGGLE: int +SPI_GETWINDOWSEXTENSION: int +SPI_SETMOUSETRAILS: int +SPI_GETMOUSETRAILS: int +SPI_GETSNAPTODEFBUTTON: int +SPI_SETSNAPTODEFBUTTON: int +SPI_SETSCREENSAVERRUNNING: int +SPI_SCREENSAVERRUNNING: int +SPI_GETMOUSEHOVERWIDTH: int +SPI_SETMOUSEHOVERWIDTH: int +SPI_GETMOUSEHOVERHEIGHT: int +SPI_SETMOUSEHOVERHEIGHT: int +SPI_GETMOUSEHOVERTIME: int +SPI_SETMOUSEHOVERTIME: int +SPI_GETWHEELSCROLLLINES: int +SPI_SETWHEELSCROLLLINES: int +SPI_GETMENUSHOWDELAY: int +SPI_SETMENUSHOWDELAY: int +SPI_GETSHOWIMEUI: int +SPI_SETSHOWIMEUI: int +SPI_GETMOUSESPEED: int +SPI_SETMOUSESPEED: int +SPI_GETSCREENSAVERRUNNING: int +SPI_GETDESKWALLPAPER: int +SPI_GETACTIVEWINDOWTRACKING: int +SPI_SETACTIVEWINDOWTRACKING: int +SPI_GETMENUANIMATION: int +SPI_SETMENUANIMATION: int +SPI_GETCOMBOBOXANIMATION: int +SPI_SETCOMBOBOXANIMATION: int +SPI_GETGRADIENTCAPTIONS: int +SPI_SETGRADIENTCAPTIONS: int +SPI_GETKEYBOARDCUES: int +SPI_SETKEYBOARDCUES: int +SPI_GETMENUUNDERLINES: int +SPI_SETMENUUNDERLINES: int +SPI_GETACTIVEWNDTRKZORDER: int +SPI_SETACTIVEWNDTRKZORDER: int +SPI_GETHOTTRACKING: int +SPI_SETHOTTRACKING: int +SPI_GETMENUFADE: int +SPI_SETMENUFADE: int +SPI_GETSELECTIONFADE: int +SPI_SETSELECTIONFADE: int +SPI_GETTOOLTIPANIMATION: int +SPI_SETTOOLTIPANIMATION: int +SPI_GETTOOLTIPFADE: int +SPI_SETTOOLTIPFADE: int +SPI_GETCURSORSHADOW: int +SPI_SETCURSORSHADOW: int +SPI_GETMOUSESONAR: int +SPI_SETMOUSESONAR: int +SPI_GETMOUSECLICKLOCK: int +SPI_SETMOUSECLICKLOCK: int +SPI_GETMOUSEVANISH: int +SPI_SETMOUSEVANISH: int +SPI_GETFLATMENU: int +SPI_SETFLATMENU: int +SPI_GETDROPSHADOW: int +SPI_SETDROPSHADOW: int +SPI_GETBLOCKSENDINPUTRESETS: int +SPI_SETBLOCKSENDINPUTRESETS: int +SPI_GETUIEFFECTS: int +SPI_SETUIEFFECTS: int +SPI_GETFOREGROUNDLOCKTIMEOUT: int +SPI_SETFOREGROUNDLOCKTIMEOUT: int +SPI_GETACTIVEWNDTRKTIMEOUT: int +SPI_SETACTIVEWNDTRKTIMEOUT: int +SPI_GETFOREGROUNDFLASHCOUNT: int +SPI_SETFOREGROUNDFLASHCOUNT: int +SPI_GETCARETWIDTH: int +SPI_SETCARETWIDTH: int +SPI_GETMOUSECLICKLOCKTIME: int +SPI_SETMOUSECLICKLOCKTIME: int +SPI_GETFONTSMOOTHINGTYPE: int +SPI_SETFONTSMOOTHINGTYPE: int +SPI_GETFONTSMOOTHINGCONTRAST: int +SPI_SETFONTSMOOTHINGCONTRAST: int +SPI_GETFOCUSBORDERWIDTH: int +SPI_SETFOCUSBORDERWIDTH: int +SPI_GETFOCUSBORDERHEIGHT: int +SPI_SETFOCUSBORDERHEIGHT: int +SPI_GETFONTSMOOTHINGORIENTATION: int +SPI_SETFONTSMOOTHINGORIENTATION: int +SPIF_UPDATEINIFILE: int +SPIF_SENDWININICHANGE: int +SPIF_SENDCHANGE: int +FE_FONTSMOOTHINGSTANDARD: int +FE_FONTSMOOTHINGCLEARTYPE: int +FE_FONTSMOOTHINGDOCKING: int +METRICS_USEDEFAULT: int +ARW_BOTTOMLEFT: int +ARW_BOTTOMRIGHT: int +ARW_TOPLEFT: int +ARW_TOPRIGHT: int +ARW_STARTMASK: int +ARW_STARTRIGHT: int +ARW_STARTTOP: int +ARW_LEFT: int +ARW_RIGHT: int +ARW_UP: int +ARW_DOWN: int +ARW_HIDE: int +SERKF_SERIALKEYSON: int +SERKF_AVAILABLE: int +SERKF_INDICATOR: int +HCF_HIGHCONTRASTON: int +HCF_AVAILABLE: int +HCF_HOTKEYACTIVE: int +HCF_CONFIRMHOTKEY: int +HCF_HOTKEYSOUND: int +HCF_INDICATOR: int +HCF_HOTKEYAVAILABLE: int +CDS_UPDATEREGISTRY: int +CDS_TEST: int +CDS_FULLSCREEN: int +CDS_GLOBAL: int +CDS_SET_PRIMARY: int +CDS_RESET: int +CDS_SETRECT: int +CDS_NORESET: int +DISP_CHANGE_SUCCESSFUL: int +DISP_CHANGE_RESTART: int +DISP_CHANGE_FAILED: int +DISP_CHANGE_BADMODE: int +DISP_CHANGE_NOTUPDATED: int +DISP_CHANGE_BADFLAGS: int +DISP_CHANGE_BADPARAM: int +DISP_CHANGE_BADDUALVIEW: int +ENUM_CURRENT_SETTINGS: int +ENUM_REGISTRY_SETTINGS: int +FKF_FILTERKEYSON: int +FKF_AVAILABLE: int +FKF_HOTKEYACTIVE: int +FKF_CONFIRMHOTKEY: int +FKF_HOTKEYSOUND: int +FKF_INDICATOR: int +FKF_CLICKON: int +SKF_STICKYKEYSON: int +SKF_AVAILABLE: int +SKF_HOTKEYACTIVE: int +SKF_CONFIRMHOTKEY: int +SKF_HOTKEYSOUND: int +SKF_INDICATOR: int +SKF_AUDIBLEFEEDBACK: int +SKF_TRISTATE: int +SKF_TWOKEYSOFF: int +SKF_LALTLATCHED: int +SKF_LCTLLATCHED: int +SKF_LSHIFTLATCHED: int +SKF_RALTLATCHED: int +SKF_RCTLLATCHED: int +SKF_RSHIFTLATCHED: int +SKF_LWINLATCHED: int +SKF_RWINLATCHED: int +SKF_LALTLOCKED: int +SKF_LCTLLOCKED: int +SKF_LSHIFTLOCKED: int +SKF_RALTLOCKED: int +SKF_RCTLLOCKED: int +SKF_RSHIFTLOCKED: int +SKF_LWINLOCKED: int +SKF_RWINLOCKED: int +MKF_MOUSEKEYSON: int +MKF_AVAILABLE: int +MKF_HOTKEYACTIVE: int +MKF_CONFIRMHOTKEY: int +MKF_HOTKEYSOUND: int +MKF_INDICATOR: int +MKF_MODIFIERS: int +MKF_REPLACENUMBERS: int +MKF_LEFTBUTTONSEL: int +MKF_RIGHTBUTTONSEL: int +MKF_LEFTBUTTONDOWN: int +MKF_RIGHTBUTTONDOWN: int +MKF_MOUSEMODE: int +ATF_TIMEOUTON: int +ATF_ONOFFFEEDBACK: int +SSGF_NONE: int +SSGF_DISPLAY: int +SSTF_NONE: int +SSTF_CHARS: int +SSTF_BORDER: int +SSTF_DISPLAY: int +SSWF_NONE: int +SSWF_TITLE: int +SSWF_WINDOW: int +SSWF_DISPLAY: int +SSWF_CUSTOM: int +SSF_SOUNDSENTRYON: int +SSF_AVAILABLE: int +SSF_INDICATOR: int +TKF_TOGGLEKEYSON: int +TKF_AVAILABLE: int +TKF_HOTKEYACTIVE: int +TKF_CONFIRMHOTKEY: int +TKF_HOTKEYSOUND: int +TKF_INDICATOR: int +SLE_ERROR: int +SLE_MINORERROR: int +SLE_WARNING: int +MONITOR_DEFAULTTONULL: int +MONITOR_DEFAULTTOPRIMARY: int +MONITOR_DEFAULTTONEAREST: int +MONITORINFOF_PRIMARY: int +CHILDID_SELF: int +INDEXID_OBJECT: int +INDEXID_CONTAINER: int +OBJID_WINDOW: int +OBJID_SYSMENU: int +OBJID_TITLEBAR: int +OBJID_MENU: int +OBJID_CLIENT: int +OBJID_VSCROLL: int +OBJID_HSCROLL: int +OBJID_SIZEGRIP: int +OBJID_CARET: int +OBJID_CURSOR: int +OBJID_ALERT: int +OBJID_SOUND: int +EVENT_MIN: int +EVENT_MAX: int +EVENT_SYSTEM_SOUND: int +EVENT_SYSTEM_ALERT: int +EVENT_SYSTEM_FOREGROUND: int +EVENT_SYSTEM_MENUSTART: int +EVENT_SYSTEM_MENUEND: int +EVENT_SYSTEM_MENUPOPUPSTART: int +EVENT_SYSTEM_MENUPOPUPEND: int +EVENT_SYSTEM_CAPTURESTART: int +EVENT_SYSTEM_CAPTUREEND: int +EVENT_SYSTEM_MOVESIZESTART: int +EVENT_SYSTEM_MOVESIZEEND: int +EVENT_SYSTEM_CONTEXTHELPSTART: int +EVENT_SYSTEM_CONTEXTHELPEND: int +EVENT_SYSTEM_DRAGDROPSTART: int +EVENT_SYSTEM_DRAGDROPEND: int +EVENT_SYSTEM_DIALOGSTART: int +EVENT_SYSTEM_DIALOGEND: int +EVENT_SYSTEM_SCROLLINGSTART: int +EVENT_SYSTEM_SCROLLINGEND: int +EVENT_SYSTEM_SWITCHSTART: int +EVENT_SYSTEM_SWITCHEND: int +EVENT_SYSTEM_MINIMIZESTART: int +EVENT_SYSTEM_MINIMIZEEND: int +EVENT_OBJECT_CREATE: int +EVENT_OBJECT_DESTROY: int +EVENT_OBJECT_SHOW: int +EVENT_OBJECT_HIDE: int +EVENT_OBJECT_REORDER: int +EVENT_OBJECT_FOCUS: int +EVENT_OBJECT_SELECTION: int +EVENT_OBJECT_SELECTIONADD: int +EVENT_OBJECT_SELECTIONREMOVE: int +EVENT_OBJECT_SELECTIONWITHIN: int +EVENT_OBJECT_STATECHANGE: int +EVENT_OBJECT_LOCATIONCHANGE: int +EVENT_OBJECT_NAMECHANGE: int +EVENT_OBJECT_DESCRIPTIONCHANGE: int +EVENT_OBJECT_VALUECHANGE: int +EVENT_OBJECT_PARENTCHANGE: int +EVENT_OBJECT_HELPCHANGE: int +EVENT_OBJECT_DEFACTIONCHANGE: int +EVENT_OBJECT_ACCELERATORCHANGE: int +SOUND_SYSTEM_STARTUP: int +SOUND_SYSTEM_SHUTDOWN: int +SOUND_SYSTEM_BEEP: int +SOUND_SYSTEM_ERROR: int +SOUND_SYSTEM_QUESTION: int +SOUND_SYSTEM_WARNING: int +SOUND_SYSTEM_INFORMATION: int +SOUND_SYSTEM_MAXIMIZE: int +SOUND_SYSTEM_MINIMIZE: int +SOUND_SYSTEM_RESTOREUP: int +SOUND_SYSTEM_RESTOREDOWN: int +SOUND_SYSTEM_APPSTART: int +SOUND_SYSTEM_FAULT: int +SOUND_SYSTEM_APPEND: int +SOUND_SYSTEM_MENUCOMMAND: int +SOUND_SYSTEM_MENUPOPUP: int +CSOUND_SYSTEM: int +ALERT_SYSTEM_INFORMATIONAL: int +ALERT_SYSTEM_WARNING: int +ALERT_SYSTEM_ERROR: int +ALERT_SYSTEM_QUERY: int +ALERT_SYSTEM_CRITICAL: int +CALERT_SYSTEM: int +WINEVENT_OUTOFCONTEXT: int +WINEVENT_SKIPOWNTHREAD: int +WINEVENT_SKIPOWNPROCESS: int +WINEVENT_INCONTEXT: int +GUI_CARETBLINKING: int +GUI_INMOVESIZE: int +GUI_INMENUMODE: int +GUI_SYSTEMMENUMODE: int +GUI_POPUPMENUMODE: int +STATE_SYSTEM_UNAVAILABLE: int +STATE_SYSTEM_SELECTED: int +STATE_SYSTEM_FOCUSED: int +STATE_SYSTEM_PRESSED: int +STATE_SYSTEM_CHECKED: int +STATE_SYSTEM_MIXED: int +STATE_SYSTEM_READONLY: int +STATE_SYSTEM_HOTTRACKED: int +STATE_SYSTEM_DEFAULT: int +STATE_SYSTEM_EXPANDED: int +STATE_SYSTEM_COLLAPSED: int +STATE_SYSTEM_BUSY: int +STATE_SYSTEM_FLOATING: int +STATE_SYSTEM_MARQUEED: int +STATE_SYSTEM_ANIMATED: int +STATE_SYSTEM_INVISIBLE: int +STATE_SYSTEM_OFFSCREEN: int +STATE_SYSTEM_SIZEABLE: int +STATE_SYSTEM_MOVEABLE: int +STATE_SYSTEM_SELFVOICING: int +STATE_SYSTEM_FOCUSABLE: int +STATE_SYSTEM_SELECTABLE: int +STATE_SYSTEM_LINKED: int +STATE_SYSTEM_TRAVERSED: int +STATE_SYSTEM_MULTISELECTABLE: int +STATE_SYSTEM_EXTSELECTABLE: int +STATE_SYSTEM_ALERT_LOW: int +STATE_SYSTEM_ALERT_MEDIUM: int +STATE_SYSTEM_ALERT_HIGH: int +STATE_SYSTEM_VALID: int +CCHILDREN_TITLEBAR: int +CCHILDREN_SCROLLBAR: int +CURSOR_SHOWING: int +WS_ACTIVECAPTION: int +GA_MIC: int +GA_PARENT: int +GA_ROOT: int +GA_ROOTOWNER: int +GA_MAC: int +BF_LEFT: int +BF_TOP: int +BF_RIGHT: int +BF_BOTTOM: int +BF_TOPLEFT: int +BF_TOPRIGHT: int +BF_BOTTOMLEFT: int +BF_BOTTOMRIGHT: int +BF_RECT: int +BF_DIAGONAL: int +BF_DIAGONAL_ENDTOPRIGHT: int +BF_DIAGONAL_ENDTOPLEFT: int +BF_DIAGONAL_ENDBOTTOMLEFT: int +BF_DIAGONAL_ENDBOTTOMRIGHT: int +BF_MIDDLE: int +BF_SOFT: int +BF_ADJUST: int +BF_FLAT: int +BF_MONO: int +DFC_CAPTION: int +DFC_MENU: int +DFC_SCROLL: int +DFC_BUTTON: int +DFC_POPUPMENU: int +DFCS_CAPTIONCLOSE: int +DFCS_CAPTIONMIN: int +DFCS_CAPTIONMAX: int +DFCS_CAPTIONRESTORE: int +DFCS_CAPTIONHELP: int +DFCS_MENUARROW: int +DFCS_MENUCHECK: int +DFCS_MENUBULLET: int +DFCS_MENUARROWRIGHT: int +DFCS_SCROLLUP: int +DFCS_SCROLLDOWN: int +DFCS_SCROLLLEFT: int +DFCS_SCROLLRIGHT: int +DFCS_SCROLLCOMBOBOX: int +DFCS_SCROLLSIZEGRIP: int +DFCS_SCROLLSIZEGRIPRIGHT: int +DFCS_BUTTONCHECK: int +DFCS_BUTTONRADIOIMAGE: int +DFCS_BUTTONRADIOMASK: int +DFCS_BUTTONRADIO: int +DFCS_BUTTON3STATE: int +DFCS_BUTTONPUSH: int +DFCS_INACTIVE: int +DFCS_PUSHED: int +DFCS_CHECKED: int +DFCS_TRANSPARENT: int +DFCS_HOT: int +DFCS_ADJUSTRECT: int +DFCS_FLAT: int +DFCS_MONO: int +DC_ACTIVE: int +DC_SMALLCAP: int +DC_ICON: int +DC_TEXT: int +DC_INBUTTON: int +DC_GRADIENT: int +IDANI_OPEN: int +IDANI_CLOSE: int +IDANI_CAPTION: int +CF_TEXT: int +CF_BITMAP: int +CF_METAFILEPICT: int +CF_SYLK: int +CF_DIF: int +CF_TIFF: int +CF_OEMTEXT: int +CF_DIB: int +CF_PALETTE: int +CF_PENDATA: int +CF_RIFF: int +CF_WAVE: int +CF_UNICODETEXT: int +CF_ENHMETAFILE: int +CF_HDROP: int +CF_LOCALE: int +CF_DIBV5: int +CF_MAX: int +CF_OWNERDISPLAY: int +CF_DSPTEXT: int +CF_DSPBITMAP: int +CF_DSPMETAFILEPICT: int +CF_DSPENHMETAFILE: int +CF_PRIVATEFIRST: int +CF_PRIVATELAST: int +CF_GDIOBJFIRST: int +CF_GDIOBJLAST: int +FVIRTKEY: int +FNOINVERT: int +FSHIFT: int +FCONTROL: int +FALT: int +WPF_SETMINPOSITION: int +WPF_RESTORETOMAXIMIZED: int +ODT_MENU: int +ODT_COMBOBOX: int +ODT_BUTTON: int +ODT_STATIC: int +ODA_DRAWENTIRE: int +ODA_SELECT: int +ODA_FOCUS: int +ODS_SELECTED: int +ODS_GRAYED: int +ODS_DISABLED: int +ODS_CHECKED: int +ODS_FOCUS: int +ODS_DEFAULT: int +ODS_COMBOBOXEDIT: int +ODS_HOTLIGHT: int +ODS_INACTIVE: int +PM_NOREMOVE: int +PM_REMOVE: int +PM_NOYIELD: int +MOD_ALT: int +MOD_CONTROL: int +MOD_SHIFT: int +MOD_WIN: int +IDHOT_SNAPWINDOW: int +IDHOT_SNAPDESKTOP: int +ENDSESSION_LOGOFF: int +EWX_LOGOFF: int +EWX_SHUTDOWN: int +EWX_REBOOT: int +EWX_FORCE: int +EWX_POWEROFF: int +EWX_FORCEIFHUNG: int +BSM_ALLCOMPONENTS: int +BSM_VXDS: int +BSM_NETDRIVER: int +BSM_INSTALLABLEDRIVERS: int +BSM_APPLICATIONS: int +BSM_ALLDESKTOPS: int +BSF_QUERY: int +BSF_IGNORECURRENTTASK: int +BSF_FLUSHDISK: int +BSF_NOHANG: int +BSF_POSTMESSAGE: int +BSF_FORCEIFHUNG: int +BSF_NOTIMEOUTIFNOTHUNG: int +BROADCAST_QUERY_DENY: int +DBWF_LPARAMPOINTER: int +SWP_NOSIZE: int +SWP_NOMOVE: int +SWP_NOZORDER: int +SWP_NOREDRAW: int +SWP_NOACTIVATE: int +SWP_FRAMECHANGED: int +SWP_SHOWWINDOW: int +SWP_HIDEWINDOW: int +SWP_NOCOPYBITS: int +SWP_NOOWNERZORDER: int +SWP_NOSENDCHANGING: int +SWP_DRAWFRAME: int +SWP_NOREPOSITION: int +SWP_DEFERERASE: int +SWP_ASYNCWINDOWPOS: int +DLGWINDOWEXTRA: int +KEYEVENTF_EXTENDEDKEY: int +KEYEVENTF_KEYUP: int +MOUSEEVENTF_MOVE: int +MOUSEEVENTF_LEFTDOWN: int +MOUSEEVENTF_LEFTUP: int +MOUSEEVENTF_RIGHTDOWN: int +MOUSEEVENTF_RIGHTUP: int +MOUSEEVENTF_MIDDLEDOWN: int +MOUSEEVENTF_MIDDLEUP: int +MOUSEEVENTF_ABSOLUTE: int +INPUT_MOUSE: int +INPUT_KEYBOARD: int +INPUT_HARDWARE: int +MWMO_WAITALL: int +MWMO_ALERTABLE: int +MWMO_INPUTAVAILABLE: int +QS_KEY: int +QS_MOUSEMOVE: int +QS_MOUSEBUTTON: int +QS_POSTMESSAGE: int +QS_TIMER: int +QS_PAINT: int +QS_SENDMESSAGE: int +QS_HOTKEY: int +QS_MOUSE: int +QS_INPUT: int +QS_ALLEVENTS: int +QS_ALLINPUT: int +IMN_CLOSESTATUSWINDOW: int +IMN_OPENSTATUSWINDOW: int +IMN_CHANGECANDIDATE: int +IMN_CLOSECANDIDATE: int +IMN_OPENCANDIDATE: int +IMN_SETCONVERSIONMODE: int +IMN_SETSENTENCEMODE: int +IMN_SETOPENSTATUS: int +IMN_SETCANDIDATEPOS: int +IMN_SETCOMPOSITIONFONT: int +IMN_SETCOMPOSITIONWINDOW: int +IMN_SETSTATUSWINDOWPOS: int +IMN_GUIDELINE: int +IMN_PRIVATE: int +HELP_CONTEXT: int +HELP_QUIT: int +HELP_INDEX: int +HELP_CONTENTS: int +HELP_HELPONHELP: int +HELP_SETINDEX: int +HELP_SETCONTENTS: int +HELP_CONTEXTPOPUP: int +HELP_FORCEFILE: int +HELP_KEY: int +HELP_COMMAND: int +HELP_PARTIALKEY: int +HELP_MULTIKEY: int +HELP_SETWINPOS: int +HELP_CONTEXTMENU: int +HELP_FINDER: int +HELP_WM_HELP: int +HELP_SETPOPUP_POS: int +HELP_TCARD: int +HELP_TCARD_DATA: int +HELP_TCARD_OTHER_CALLER: int +IDH_NO_HELP: int +IDH_MISSING_CONTEXT: int +IDH_GENERIC_HELP_BUTTON: int +IDH_OK: int +IDH_CANCEL: int +IDH_HELP: int +GR_GDIOBJECTS: int +GR_USEROBJECTS: int +SRCCOPY: int +SRCPAINT: int +SRCAND: int +SRCINVERT: int +SRCERASE: int +NOTSRCCOPY: int +NOTSRCERASE: int +MERGECOPY: int +MERGEPAINT: int +PATCOPY: int +PATPAINT: int +PATINVERT: int +DSTINVERT: int +BLACKNESS: int +WHITENESS: int +R2_BLACK: int +R2_NOTMERGEPEN: int +R2_MASKNOTPEN: int +R2_NOTCOPYPEN: int +R2_MASKPENNOT: int +R2_NOT: int +R2_XORPEN: int +R2_NOTMASKPEN: int +R2_MASKPEN: int +R2_NOTXORPEN: int +R2_NOP: int +R2_MERGENOTPEN: int +R2_COPYPEN: int +R2_MERGEPENNOT: int +R2_MERGEPEN: int +R2_WHITE: int +R2_LAST: int +GDI_ERROR: int +ERROR: int +NULLREGION: int +SIMPLEREGION: int +COMPLEXREGION: int +RGN_ERROR: int +RGN_AND: int +RGN_OR: int +RGN_XOR: int +RGN_DIFF: int +RGN_COPY: int +RGN_MIN: int +RGN_MAX: int +BLACKONWHITE: int +WHITEONBLACK: int +COLORONCOLOR: int +HALFTONE: int +MAXSTRETCHBLTMODE: int +STRETCH_ANDSCANS: int +STRETCH_ORSCANS: int +STRETCH_DELETESCANS: int +STRETCH_HALFTONE: int +ALTERNATE: int +WINDING: int +POLYFILL_LAST: int +LAYOUT_RTL: int +LAYOUT_BTT: int +LAYOUT_VBH: int +LAYOUT_ORIENTATIONMASK: int +LAYOUT_BITMAPORIENTATIONPRESERVED: int +TA_NOUPDATECP: int +TA_UPDATECP: int +TA_LEFT: int +TA_RIGHT: int +TA_CENTER: int +TA_TOP: int +TA_BOTTOM: int +TA_BASELINE: int +TA_MASK: int +VTA_BASELINE: int +VTA_LEFT: int +VTA_RIGHT: int +VTA_CENTER: int +VTA_BOTTOM: int +VTA_TOP: int +ETO_GRAYED: int +ETO_OPAQUE: int +ETO_CLIPPED: int +ASPECT_FILTERING: int +DCB_RESET: int +DCB_ACCUMULATE: int +DCB_DIRTY: int +DCB_SET: int +DCB_ENABLE: int +DCB_DISABLE: int +META_SETBKCOLOR: int +META_SETBKMODE: int +META_SETMAPMODE: int +META_SETROP2: int +META_SETRELABS: int +META_SETPOLYFILLMODE: int +META_SETSTRETCHBLTMODE: int +META_SETTEXTCHAREXTRA: int +META_SETTEXTCOLOR: int +META_SETTEXTJUSTIFICATION: int +META_SETWINDOWORG: int +META_SETWINDOWEXT: int +META_SETVIEWPORTORG: int +META_SETVIEWPORTEXT: int +META_OFFSETWINDOWORG: int +META_SCALEWINDOWEXT: int +META_OFFSETVIEWPORTORG: int +META_SCALEVIEWPORTEXT: int +META_LINETO: int +META_MOVETO: int +META_EXCLUDECLIPRECT: int +META_INTERSECTCLIPRECT: int +META_ARC: int +META_ELLIPSE: int +META_FLOODFILL: int +META_PIE: int +META_RECTANGLE: int +META_ROUNDRECT: int +META_PATBLT: int +META_SAVEDC: int +META_SETPIXEL: int +META_OFFSETCLIPRGN: int +META_TEXTOUT: int +META_BITBLT: int +META_STRETCHBLT: int +META_POLYGON: int +META_POLYLINE: int +META_ESCAPE: int +META_RESTOREDC: int +META_FILLREGION: int +META_FRAMEREGION: int +META_INVERTREGION: int +META_PAINTREGION: int +META_SELECTCLIPREGION: int +META_SELECTOBJECT: int +META_SETTEXTALIGN: int +META_CHORD: int +META_SETMAPPERFLAGS: int +META_EXTTEXTOUT: int +META_SETDIBTODEV: int +META_SELECTPALETTE: int +META_REALIZEPALETTE: int +META_ANIMATEPALETTE: int +META_SETPALENTRIES: int +META_POLYPOLYGON: int +META_RESIZEPALETTE: int +META_DIBBITBLT: int +META_DIBSTRETCHBLT: int +META_DIBCREATEPATTERNBRUSH: int +META_STRETCHDIB: int +META_EXTFLOODFILL: int +META_DELETEOBJECT: int +META_CREATEPALETTE: int +META_CREATEPATTERNBRUSH: int +META_CREATEPENINDIRECT: int +META_CREATEFONTINDIRECT: int +META_CREATEBRUSHINDIRECT: int +META_CREATEREGION: int +FILE_BEGIN: int +FILE_CURRENT: int +FILE_END: int +FILE_FLAG_WRITE_THROUGH: int +FILE_FLAG_OVERLAPPED: int +FILE_FLAG_NO_BUFFERING: int +FILE_FLAG_RANDOM_ACCESS: int +FILE_FLAG_SEQUENTIAL_SCAN: int +FILE_FLAG_DELETE_ON_CLOSE: int +FILE_FLAG_BACKUP_SEMANTICS: int +FILE_FLAG_POSIX_SEMANTICS: int +CREATE_NEW: int +CREATE_ALWAYS: int +OPEN_EXISTING: int +OPEN_ALWAYS: int +TRUNCATE_EXISTING: int +PIPE_ACCESS_INBOUND: int +PIPE_ACCESS_OUTBOUND: int +PIPE_ACCESS_DUPLEX: int +PIPE_CLIENT_END: int +PIPE_SERVER_END: int +PIPE_WAIT: int +PIPE_NOWAIT: int +PIPE_READMODE_BYTE: int +PIPE_READMODE_MESSAGE: int +PIPE_TYPE_BYTE: int +PIPE_TYPE_MESSAGE: int +PIPE_UNLIMITED_INSTANCES: int +SECURITY_CONTEXT_TRACKING: int +SECURITY_EFFECTIVE_ONLY: int +SECURITY_SQOS_PRESENT: int +SECURITY_VALID_SQOS_FLAGS: int +DTR_CONTROL_DISABLE: int +DTR_CONTROL_ENABLE: int +DTR_CONTROL_HANDSHAKE: int +RTS_CONTROL_DISABLE: int +RTS_CONTROL_ENABLE: int +RTS_CONTROL_HANDSHAKE: int +RTS_CONTROL_TOGGLE: int +GMEM_FIXED: int +GMEM_MOVEABLE: int +GMEM_NOCOMPACT: int +GMEM_NODISCARD: int +GMEM_ZEROINIT: int +GMEM_MODIFY: int +GMEM_DISCARDABLE: int +GMEM_NOT_BANKED: int +GMEM_SHARE: int +GMEM_DDESHARE: int +GMEM_NOTIFY: int +GMEM_LOWER: int +GMEM_VALID_FLAGS: int +GMEM_INVALID_HANDLE: int +GHND: int +GPTR: int +GMEM_DISCARDED: int +GMEM_LOCKCOUNT: int +LMEM_FIXED: int +LMEM_MOVEABLE: int +LMEM_NOCOMPACT: int +LMEM_NODISCARD: int +LMEM_ZEROINIT: int +LMEM_MODIFY: int +LMEM_DISCARDABLE: int +LMEM_VALID_FLAGS: int +LMEM_INVALID_HANDLE: int +LHND: int +LPTR: int +NONZEROLHND: int +NONZEROLPTR: int +LMEM_DISCARDED: int +LMEM_LOCKCOUNT: int +DEBUG_PROCESS: int +DEBUG_ONLY_THIS_PROCESS: int +CREATE_SUSPENDED: int +DETACHED_PROCESS: int +CREATE_NEW_CONSOLE: int +NORMAL_PRIORITY_CLASS: int +IDLE_PRIORITY_CLASS: int +HIGH_PRIORITY_CLASS: int +REALTIME_PRIORITY_CLASS: int +CREATE_NEW_PROCESS_GROUP: int +CREATE_UNICODE_ENVIRONMENT: int +CREATE_SEPARATE_WOW_VDM: int +CREATE_SHARED_WOW_VDM: int +CREATE_DEFAULT_ERROR_MODE: int +CREATE_NO_WINDOW: int +PROFILE_USER: int +PROFILE_KERNEL: int +PROFILE_SERVER: int +THREAD_BASE_PRIORITY_LOWRT: int +THREAD_BASE_PRIORITY_MAX: int +THREAD_BASE_PRIORITY_MIN: int +THREAD_BASE_PRIORITY_IDLE: int +THREAD_PRIORITY_LOWEST: int +THREAD_PRIORITY_BELOW_NORMAL: int +THREAD_PRIORITY_HIGHEST: int +THREAD_PRIORITY_ABOVE_NORMAL: int +THREAD_PRIORITY_ERROR_RETURN: int +THREAD_PRIORITY_TIME_CRITICAL: int +THREAD_PRIORITY_IDLE: int +THREAD_PRIORITY_NORMAL: int +THREAD_MODE_BACKGROUND_BEGIN: int +THREAD_MODE_BACKGROUND_END: int +EXCEPTION_DEBUG_EVENT: int +CREATE_THREAD_DEBUG_EVENT: int +CREATE_PROCESS_DEBUG_EVENT: int +EXIT_THREAD_DEBUG_EVENT: int +EXIT_PROCESS_DEBUG_EVENT: int +LOAD_DLL_DEBUG_EVENT: int +UNLOAD_DLL_DEBUG_EVENT: int +OUTPUT_DEBUG_STRING_EVENT: int +RIP_EVENT: int +DRIVE_UNKNOWN: int +DRIVE_NO_ROOT_DIR: int +DRIVE_REMOVABLE: int +DRIVE_FIXED: int +DRIVE_REMOTE: int +DRIVE_CDROM: int +DRIVE_RAMDISK: int +FILE_TYPE_UNKNOWN: int +FILE_TYPE_DISK: int +FILE_TYPE_CHAR: int +FILE_TYPE_PIPE: int +FILE_TYPE_REMOTE: int +NOPARITY: int +ODDPARITY: int +EVENPARITY: int +MARKPARITY: int +SPACEPARITY: int +ONESTOPBIT: int +ONE5STOPBITS: int +TWOSTOPBITS: int +CBR_110: int +CBR_300: int +CBR_600: int +CBR_1200: int +CBR_2400: int +CBR_4800: int +CBR_9600: int +CBR_14400: int +CBR_19200: int +CBR_38400: int +CBR_56000: int +CBR_57600: int +CBR_115200: int +CBR_128000: int +CBR_256000: int +S_QUEUEEMPTY: int +S_THRESHOLD: int +S_ALLTHRESHOLD: int +S_NORMAL: int +S_LEGATO: int +S_STACCATO: int +NMPWAIT_WAIT_FOREVER: int +NMPWAIT_NOWAIT: int +NMPWAIT_USE_DEFAULT_WAIT: int +OF_READ: int +OF_WRITE: int +OF_READWRITE: int +OF_SHARE_COMPAT: int +OF_SHARE_EXCLUSIVE: int +OF_SHARE_DENY_WRITE: int +OF_SHARE_DENY_READ: int +OF_SHARE_DENY_NONE: int +OF_PARSE: int +OF_DELETE: int +OF_VERIFY: int +OF_CANCEL: int +OF_CREATE: int +OF_PROMPT: int +OF_EXIST: int +OF_REOPEN: int +OFS_MAXPATHNAME: int +MAXINTATOM: int +PROCESS_HEAP_REGION: int +PROCESS_HEAP_UNCOMMITTED_RANGE: int +PROCESS_HEAP_ENTRY_BUSY: int +PROCESS_HEAP_ENTRY_MOVEABLE: int +PROCESS_HEAP_ENTRY_DDESHARE: int +SCS_32BIT_BINARY: int +SCS_DOS_BINARY: int +SCS_WOW_BINARY: int +SCS_PIF_BINARY: int +SCS_POSIX_BINARY: int +SCS_OS216_BINARY: int +SEM_FAILCRITICALERRORS: int +SEM_NOGPFAULTERRORBOX: int +SEM_NOALIGNMENTFAULTEXCEPT: int +SEM_NOOPENFILEERRORBOX: int +LOCKFILE_FAIL_IMMEDIATELY: int +LOCKFILE_EXCLUSIVE_LOCK: int +HANDLE_FLAG_INHERIT: int +HANDLE_FLAG_PROTECT_FROM_CLOSE: int +HINSTANCE_ERROR: int +GET_TAPE_MEDIA_INFORMATION: int +GET_TAPE_DRIVE_INFORMATION: int +SET_TAPE_MEDIA_INFORMATION: int +SET_TAPE_DRIVE_INFORMATION: int +FORMAT_MESSAGE_ALLOCATE_BUFFER: int +FORMAT_MESSAGE_IGNORE_INSERTS: int +FORMAT_MESSAGE_FROM_STRING: int +FORMAT_MESSAGE_FROM_HMODULE: int +FORMAT_MESSAGE_FROM_SYSTEM: int +FORMAT_MESSAGE_ARGUMENT_ARRAY: int +FORMAT_MESSAGE_MAX_WIDTH_MASK: int +BACKUP_INVALID: int +BACKUP_DATA: int +BACKUP_EA_DATA: int +BACKUP_SECURITY_DATA: int +BACKUP_ALTERNATE_DATA: int +BACKUP_LINK: int +BACKUP_PROPERTY_DATA: int +BACKUP_OBJECT_ID: int +BACKUP_REPARSE_DATA: int +BACKUP_SPARSE_BLOCK: int +STREAM_NORMAL_ATTRIBUTE: int +STREAM_MODIFIED_WHEN_READ: int +STREAM_CONTAINS_SECURITY: int +STREAM_CONTAINS_PROPERTIES: int +STARTF_USESHOWWINDOW: int +STARTF_USESIZE: int +STARTF_USEPOSITION: int +STARTF_USECOUNTCHARS: int +STARTF_USEFILLATTRIBUTE: int +STARTF_FORCEONFEEDBACK: int +STARTF_FORCEOFFFEEDBACK: int +STARTF_USESTDHANDLES: int +STARTF_USEHOTKEY: int +SHUTDOWN_NORETRY: int +DONT_RESOLVE_DLL_REFERENCES: int +LOAD_LIBRARY_AS_DATAFILE: int +LOAD_WITH_ALTERED_SEARCH_PATH: int +DDD_RAW_TARGET_PATH: int +DDD_REMOVE_DEFINITION: int +DDD_EXACT_MATCH_ON_REMOVE: int +MOVEFILE_REPLACE_EXISTING: int +MOVEFILE_COPY_ALLOWED: int +MOVEFILE_DELAY_UNTIL_REBOOT: int +MAX_COMPUTERNAME_LENGTH: int +LOGON32_LOGON_INTERACTIVE: int +LOGON32_LOGON_NETWORK: int +LOGON32_LOGON_BATCH: int +LOGON32_LOGON_SERVICE: int +LOGON32_LOGON_UNLOCK: int +LOGON32_LOGON_NETWORK_CLEARTEXT: int +LOGON32_LOGON_NEW_CREDENTIALS: int +LOGON32_PROVIDER_DEFAULT: int +LOGON32_PROVIDER_WINNT35: int +LOGON32_PROVIDER_WINNT40: int +LOGON32_PROVIDER_WINNT50: int +VER_PLATFORM_WIN32s: int +VER_PLATFORM_WIN32_WINDOWS: int +VER_PLATFORM_WIN32_NT: int +TC_NORMAL: int +TC_HARDERR: int +TC_GP_TRAP: int +TC_SIGNAL: int +AC_LINE_OFFLINE: int +AC_LINE_ONLINE: int +AC_LINE_BACKUP_POWER: int +AC_LINE_UNKNOWN: int +BATTERY_FLAG_HIGH: int +BATTERY_FLAG_LOW: int +BATTERY_FLAG_CRITICAL: int +BATTERY_FLAG_CHARGING: int +BATTERY_FLAG_NO_BATTERY: int +BATTERY_FLAG_UNKNOWN: int +BATTERY_PERCENTAGE_UNKNOWN: int +BATTERY_LIFE_UNKNOWN: int +cchTextLimitDefault: int +EN_MSGFILTER: int +EN_REQUESTRESIZE: int +EN_SELCHANGE: int +EN_DROPFILES: int +EN_PROTECTED: int +EN_CORRECTTEXT: int +EN_STOPNOUNDO: int +EN_IMECHANGE: int +EN_SAVECLIPBOARD: int +EN_OLEOPFAILED: int +ENM_NONE: int +ENM_CHANGE: int +ENM_UPDATE: int +ENM_SCROLL: int +ENM_KEYEVENTS: int +ENM_MOUSEEVENTS: int +ENM_REQUESTRESIZE: int +ENM_SELCHANGE: int +ENM_DROPFILES: int +ENM_PROTECTED: int +ENM_CORRECTTEXT: int +ENM_IMECHANGE: int +ES_SAVESEL: int +ES_SUNKEN: int +ES_DISABLENOSCROLL: int +ES_SELECTIONBAR: int +ES_EX_NOCALLOLEINIT: int +ES_VERTICAL: int +ES_NOIME: int +ES_SELFIME: int +ECO_AUTOWORDSELECTION: int +ECO_AUTOVSCROLL: int +ECO_AUTOHSCROLL: int +ECO_NOHIDESEL: int +ECO_READONLY: int +ECO_WANTRETURN: int +ECO_SAVESEL: int +ECO_SELECTIONBAR: int +ECO_VERTICAL: int +ECOOP_SET: int +ECOOP_OR: int +ECOOP_AND: int +ECOOP_XOR: int +WB_CLASSIFY: int +WB_MOVEWORDLEFT: int +WB_MOVEWORDRIGHT: int +WB_LEFTBREAK: int +WB_RIGHTBREAK: int +WB_MOVEWORDPREV: int +WB_MOVEWORDNEXT: int +WB_PREVBREAK: int +WB_NEXTBREAK: int +PC_FOLLOWING: int +PC_LEADING: int +PC_OVERFLOW: int +PC_DELIMITER: int +WBF_WORDWRAP: int +WBF_WORDBREAK: int +WBF_OVERFLOW: int +WBF_LEVEL1: int +WBF_LEVEL2: int +WBF_CUSTOM: int +CFM_BOLD: int +CFM_ITALIC: int +CFM_UNDERLINE: int +CFM_STRIKEOUT: int +CFM_PROTECTED: int +CFM_SIZE: int +CFM_COLOR: int +CFM_FACE: int +CFM_OFFSET: int +CFM_CHARSET: int +CFE_BOLD: int +CFE_ITALIC: int +CFE_UNDERLINE: int +CFE_STRIKEOUT: int +CFE_PROTECTED: int +CFE_AUTOCOLOR: int +yHeightCharPtsMost: int +SCF_SELECTION: int +SCF_WORD: int +SF_TEXT: int +SF_RTF: int +SF_RTFNOOBJS: int +SF_TEXTIZED: int +SFF_SELECTION: int +SFF_PLAINRTF: int +MAX_TAB_STOPS: int +lDefaultTab: int +PFM_STARTINDENT: int +PFM_RIGHTINDENT: int +PFM_OFFSET: int +PFM_ALIGNMENT: int +PFM_TABSTOPS: int +PFM_NUMBERING: int +PFM_OFFSETINDENT: int +PFN_BULLET: int +PFA_LEFT: int +PFA_RIGHT: int +PFA_CENTER: int +SEL_EMPTY: int +SEL_TEXT: int +SEL_OBJECT: int +SEL_MULTICHAR: int +SEL_MULTIOBJECT: int +OLEOP_DOVERB: int +CF_RTF: str +CF_RTFNOOBJS: str +CF_RETEXTOBJ: str +RIGHT_ALT_PRESSED: int +LEFT_ALT_PRESSED: int +RIGHT_CTRL_PRESSED: int +LEFT_CTRL_PRESSED: int +SHIFT_PRESSED: int +NUMLOCK_ON: int +SCROLLLOCK_ON: int +CAPSLOCK_ON: int +ENHANCED_KEY: int +NLS_DBCSCHAR: int +NLS_ALPHANUMERIC: int +NLS_KATAKANA: int +NLS_HIRAGANA: int +NLS_ROMAN: int +NLS_IME_CONVERSION: int +NLS_IME_DISABLE: int +FROM_LEFT_1ST_BUTTON_PRESSED: int +RIGHTMOST_BUTTON_PRESSED: int +FROM_LEFT_2ND_BUTTON_PRESSED: int +FROM_LEFT_3RD_BUTTON_PRESSED: int +FROM_LEFT_4TH_BUTTON_PRESSED: int +CTRL_C_EVENT: int +CTRL_BREAK_EVENT: int +CTRL_CLOSE_EVENT: int +CTRL_LOGOFF_EVENT: int +CTRL_SHUTDOWN_EVENT: int +MOUSE_MOVED: int +DOUBLE_CLICK: int +MOUSE_WHEELED: int +PSM_SETCURSEL: int +PSM_REMOVEPAGE: int +PSM_ADDPAGE: int +PSM_CHANGED: int +PSM_RESTARTWINDOWS: int +PSM_REBOOTSYSTEM: int +PSM_CANCELTOCLOSE: int +PSM_QUERYSIBLINGS: int +PSM_UNCHANGED: int +PSM_APPLY: int +PSM_SETTITLEA: int +PSM_SETTITLEW: int +PSM_SETWIZBUTTONS: int +PSM_PRESSBUTTON: int +PSM_SETCURSELID: int +PSM_SETFINISHTEXTA: int +PSM_SETFINISHTEXTW: int +PSM_GETTABCONTROL: int +PSM_ISDIALOGMESSAGE: int +PSM_GETCURRENTPAGEHWND: int +PSM_INSERTPAGE: int +PSM_SETHEADERTITLEA: int +PSM_SETHEADERTITLEW: int +PSM_SETHEADERSUBTITLEA: int +PSM_SETHEADERSUBTITLEW: int +PSM_HWNDTOINDEX: int +PSM_INDEXTOHWND: int +PSM_PAGETOINDEX: int +PSM_INDEXTOPAGE: int +PSM_IDTOINDEX: int +PSM_INDEXTOID: int +PSM_GETRESULT: int +PSM_RECALCPAGESIZES: int +NameUnknown: int +NameFullyQualifiedDN: int +NameSamCompatible: int +NameDisplay: int +NameUniqueId: int +NameCanonical: int +NameUserPrincipal: int +NameCanonicalEx: int +NameServicePrincipal: int +NameDnsDomain: int +ComputerNameNetBIOS: int +ComputerNameDnsHostname: int +ComputerNameDnsDomain: int +ComputerNameDnsFullyQualified: int +ComputerNamePhysicalNetBIOS: int +ComputerNamePhysicalDnsHostname: int +ComputerNamePhysicalDnsDomain: int +ComputerNamePhysicalDnsFullyQualified: int +LWA_COLORKEY: int +LWA_ALPHA: int +ULW_COLORKEY: int +ULW_ALPHA: int +ULW_OPAQUE: int +TRUE: int +FALSE: int +MAX_PATH: int +AC_SRC_OVER: int +AC_SRC_ALPHA: int +GRADIENT_FILL_RECT_H: int +GRADIENT_FILL_RECT_V: int +GRADIENT_FILL_TRIANGLE: int +GRADIENT_FILL_OP_FLAG: int +MM_WORKING_SET_MAX_HARD_ENABLE: int +MM_WORKING_SET_MAX_HARD_DISABLE: int +MM_WORKING_SET_MIN_HARD_ENABLE: int +MM_WORKING_SET_MIN_HARD_DISABLE: int +VOLUME_NAME_DOS: int +VOLUME_NAME_GUID: int +VOLUME_NAME_NT: int +VOLUME_NAME_NONE: int +FILE_NAME_NORMALIZED: int +FILE_NAME_OPENED: int +DEVICE_NOTIFY_WINDOW_HANDLE: int +DEVICE_NOTIFY_SERVICE_HANDLE: int +BSF_MSGSRV32ISOK: int +BSF_MSGSRV32ISOK_BIT: int +DBT_APPYEND: int +DBT_DEVNODES_CHANGED: int +DBT_QUERYCHANGECONFIG: int +DBT_CONFIGCHANGED: int +DBT_CONFIGCHANGECANCELED: int +DBT_MONITORCHANGE: int +DBT_SHELLLOGGEDON: int +DBT_CONFIGMGAPI32: int +DBT_VXDINITCOMPLETE: int +DBT_VOLLOCKQUERYLOCK: int +DBT_VOLLOCKLOCKTAKEN: int +DBT_VOLLOCKLOCKFAILED: int +DBT_VOLLOCKQUERYUNLOCK: int +DBT_VOLLOCKLOCKRELEASED: int +DBT_VOLLOCKUNLOCKFAILED: int +LOCKP_ALLOW_WRITES: int +LOCKP_FAIL_WRITES: int +LOCKP_FAIL_MEM_MAPPING: int +LOCKP_ALLOW_MEM_MAPPING: int +LOCKP_USER_MASK: int +LOCKP_LOCK_FOR_FORMAT: int +LOCKF_LOGICAL_LOCK: int +LOCKF_PHYSICAL_LOCK: int +DBT_NO_DISK_SPACE: int +DBT_LOW_DISK_SPACE: int +DBT_CONFIGMGPRIVATE: int +DBT_DEVICEARRIVAL: int +DBT_DEVICEQUERYREMOVE: int +DBT_DEVICEQUERYREMOVEFAILED: int +DBT_DEVICEREMOVEPENDING: int +DBT_DEVICEREMOVECOMPLETE: int +DBT_DEVICETYPESPECIFIC: int +DBT_CUSTOMEVENT: int +DBT_DEVTYP_OEM: int +DBT_DEVTYP_DEVNODE: int +DBT_DEVTYP_VOLUME: int +DBT_DEVTYP_PORT: int +DBT_DEVTYP_NET: int +DBT_DEVTYP_DEVICEINTERFACE: int +DBT_DEVTYP_HANDLE: int +DBTF_MEDIA: int +DBTF_NET: int +DBTF_RESOURCE: int +DBTF_XPORT: int +DBTF_SLOWNET: int +DBT_VPOWERDAPI: int +DBT_USERDEFINED: int +CBS_DROPDOWNLIST: int +CDM_GETFOLDERIDLIST: int +CTLCOLOR_LISTBOX: int +DBT_APPYBEGIN: int +FILE_NAMED_STREAMS: int +FILE_READ_ONLY_VOLUME: int +FILE_SEQUENTIAL_WRITE_ONCE: int +FILE_SUPPORTS_ENCRYPTION: int +FILE_SUPPORTS_EXTENDED_ATTRIBUTES: int +FILE_SUPPORTS_HARD_LINKS: int +FILE_SUPPORTS_OBJECT_IDS: int +FILE_SUPPORTS_OPEN_BY_FILE_ID: int +FILE_SUPPORTS_REPARSE_POINTS: int +FILE_SUPPORTS_SPARSE_FILES: int +FILE_SUPPORTS_TRANSACTIONS: int +FILE_SUPPORTS_USN_JOURNAL: int +FILE_VOLUME_QUOTAS: int +KEYEVENTF_SCANCODE: int +KEYEVENTF_UNICODE: int +MOUSEEVENTF_HWHEEL: int +MOUSEEVENTF_MOVE_NOCOALESCE: int +MOUSEEVENTF_VIRTUALDESK: int +ODT_LISTBOX: int +REG_RESOURCE_LIST: int +REG_RESOURCE_REQUIREMENTS_LIST: int +SC_TASKLIST: int +SPI_GETLISTBOXSMOOTHSCROLLING: int +SPI_SETLISTBOXSMOOTHSCROLLING: int +WM_CTLCOLORLISTBOX: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/win32cryptcon.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/win32cryptcon.pyi new file mode 100644 index 000000000..c3865abff --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/win32cryptcon.pyi @@ -0,0 +1,1790 @@ +def GET_ALG_CLASS(x: int) -> int: ... +def GET_ALG_TYPE(x: int) -> int: ... +def GET_ALG_SID(x: int) -> int: ... + +ALG_CLASS_ANY: int +ALG_CLASS_SIGNATURE: int +ALG_CLASS_MSG_ENCRYPT: int +ALG_CLASS_DATA_ENCRYPT: int +ALG_CLASS_HASH: int +ALG_CLASS_KEY_EXCHANGE: int +ALG_CLASS_ALL: int +ALG_TYPE_ANY: int +ALG_TYPE_DSS: int +ALG_TYPE_RSA: int +ALG_TYPE_BLOCK: int +ALG_TYPE_STREAM: int +ALG_TYPE_DH: int +ALG_TYPE_SECURECHANNEL: int +ALG_SID_ANY: int +ALG_SID_RSA_ANY: int +ALG_SID_RSA_PKCS: int +ALG_SID_RSA_MSATWORK: int +ALG_SID_RSA_ENTRUST: int +ALG_SID_RSA_PGP: int +ALG_SID_DSS_ANY: int +ALG_SID_DSS_PKCS: int +ALG_SID_DSS_DMS: int +ALG_SID_DES: int +ALG_SID_3DES: int +ALG_SID_DESX: int +ALG_SID_IDEA: int +ALG_SID_CAST: int +ALG_SID_SAFERSK64: int +ALG_SID_SAFERSK128: int +ALG_SID_3DES_112: int +ALG_SID_CYLINK_MEK: int +ALG_SID_RC5: int +ALG_SID_AES_128: int +ALG_SID_AES_192: int +ALG_SID_AES_256: int +ALG_SID_AES: int +ALG_SID_SKIPJACK: int +ALG_SID_TEK: int +CRYPT_MODE_CBCI: int +CRYPT_MODE_CFBP: int +CRYPT_MODE_OFBP: int +CRYPT_MODE_CBCOFM: int +CRYPT_MODE_CBCOFMI: int +ALG_SID_RC2: int +ALG_SID_RC4: int +ALG_SID_SEAL: int +ALG_SID_DH_SANDF: int +ALG_SID_DH_EPHEM: int +ALG_SID_AGREED_KEY_ANY: int +ALG_SID_KEA: int +ALG_SID_MD2: int +ALG_SID_MD4: int +ALG_SID_MD5: int +ALG_SID_SHA: int +ALG_SID_SHA1: int +ALG_SID_MAC: int +ALG_SID_RIPEMD: int +ALG_SID_RIPEMD160: int +ALG_SID_SSL3SHAMD5: int +ALG_SID_HMAC: int +ALG_SID_TLS1PRF: int +ALG_SID_HASH_REPLACE_OWF: int +ALG_SID_SHA_256: int +ALG_SID_SHA_384: int +ALG_SID_SHA_512: int +ALG_SID_SSL3_MASTER: int +ALG_SID_SCHANNEL_MASTER_HASH: int +ALG_SID_SCHANNEL_MAC_KEY: int +ALG_SID_PCT1_MASTER: int +ALG_SID_SSL2_MASTER: int +ALG_SID_TLS1_MASTER: int +ALG_SID_SCHANNEL_ENC_KEY: int +ALG_SID_EXAMPLE: int +CALG_MD2: int +CALG_MD4: int +CALG_MD5: int +CALG_SHA: int +CALG_SHA1: int +CALG_MAC: int +CALG_RSA_SIGN: int +CALG_DSS_SIGN: int +CALG_NO_SIGN: int +CALG_RSA_KEYX: int +CALG_DES: int +CALG_3DES_112: int +CALG_3DES: int +CALG_DESX: int +CALG_RC2: int +CALG_RC4: int +CALG_SEAL: int +CALG_DH_SF: int +CALG_DH_EPHEM: int +CALG_AGREEDKEY_ANY: int +CALG_KEA_KEYX: int +CALG_HUGHES_MD5: int +CALG_SKIPJACK: int +CALG_TEK: int +CALG_CYLINK_MEK: int +CALG_SSL3_SHAMD5: int +CALG_SSL3_MASTER: int +CALG_SCHANNEL_MASTER_HASH: int +CALG_SCHANNEL_MAC_KEY: int +CALG_SCHANNEL_ENC_KEY: int +CALG_PCT1_MASTER: int +CALG_SSL2_MASTER: int +CALG_TLS1_MASTER: int +CALG_RC5: int +CALG_HMAC: int +CALG_TLS1PRF: int +CALG_HASH_REPLACE_OWF: int +CALG_AES_128: int +CALG_AES_192: int +CALG_AES_256: int +CALG_AES: int +CALG_SHA_256: int +CALG_SHA_384: int +CALG_SHA_512: int +CRYPT_VERIFYCONTEXT: int +CRYPT_NEWKEYSET: int +CRYPT_DELETEKEYSET: int +CRYPT_MACHINE_KEYSET: int +CRYPT_SILENT: int +CRYPT_EXPORTABLE: int +CRYPT_USER_PROTECTED: int +CRYPT_CREATE_SALT: int +CRYPT_UPDATE_KEY: int +CRYPT_NO_SALT: int +CRYPT_PREGEN: int +CRYPT_RECIPIENT: int +CRYPT_INITIATOR: int +CRYPT_ONLINE: int +CRYPT_SF: int +CRYPT_CREATE_IV: int +CRYPT_KEK: int +CRYPT_DATA_KEY: int +CRYPT_VOLATILE: int +CRYPT_SGCKEY: int +CRYPT_ARCHIVABLE: int +RSA1024BIT_KEY: int +CRYPT_SERVER: int +KEY_LENGTH_MASK: int +CRYPT_Y_ONLY: int +CRYPT_SSL2_FALLBACK: int +CRYPT_DESTROYKEY: int +CRYPT_OAEP: int +CRYPT_BLOB_VER3: int +CRYPT_IPSEC_HMAC_KEY: int +CRYPT_DECRYPT_RSA_NO_PADDING_CHECK: int +CRYPT_SECRETDIGEST: int +CRYPT_OWF_REPL_LM_HASH: int +CRYPT_LITTLE_ENDIAN: int +CRYPT_NOHASHOID: int +CRYPT_TYPE2_FORMAT: int +CRYPT_X931_FORMAT: int +CRYPT_MACHINE_DEFAULT: int +CRYPT_USER_DEFAULT: int +CRYPT_DELETE_DEFAULT: int +SIMPLEBLOB: int +PUBLICKEYBLOB: int +PRIVATEKEYBLOB: int +PLAINTEXTKEYBLOB: int +OPAQUEKEYBLOB: int +PUBLICKEYBLOBEX: int +SYMMETRICWRAPKEYBLOB: int +AT_KEYEXCHANGE: int +AT_SIGNATURE: int +CRYPT_USERDATA: int +KP_IV: int +KP_SALT: int +KP_PADDING: int +KP_MODE: int +KP_MODE_BITS: int +KP_PERMISSIONS: int +KP_ALGID: int +KP_BLOCKLEN: int +KP_KEYLEN: int +KP_SALT_EX: int +KP_P: int +KP_G: int +KP_Q: int +KP_X: int +KP_Y: int +KP_RA: int +KP_RB: int +KP_INFO: int +KP_EFFECTIVE_KEYLEN: int +KP_SCHANNEL_ALG: int +KP_CLIENT_RANDOM: int +KP_SERVER_RANDOM: int +KP_RP: int +KP_PRECOMP_MD5: int +KP_PRECOMP_SHA: int +KP_CERTIFICATE: int +KP_CLEAR_KEY: int +KP_PUB_EX_LEN: int +KP_PUB_EX_VAL: int +KP_KEYVAL: int +KP_ADMIN_PIN: int +KP_KEYEXCHANGE_PIN: int +KP_SIGNATURE_PIN: int +KP_PREHASH: int +KP_ROUNDS: int +KP_OAEP_PARAMS: int +KP_CMS_KEY_INFO: int +KP_CMS_DH_KEY_INFO: int +KP_PUB_PARAMS: int +KP_VERIFY_PARAMS: int +KP_HIGHEST_VERSION: int +KP_GET_USE_COUNT: int +PKCS5_PADDING: int +RANDOM_PADDING: int +ZERO_PADDING: int +CRYPT_MODE_CBC: int +CRYPT_MODE_ECB: int +CRYPT_MODE_OFB: int +CRYPT_MODE_CFB: int +CRYPT_MODE_CTS: int +CRYPT_ENCRYPT: int +CRYPT_DECRYPT: int +CRYPT_EXPORT: int +CRYPT_READ: int +CRYPT_WRITE: int +CRYPT_MAC: int +CRYPT_EXPORT_KEY: int +CRYPT_IMPORT_KEY: int +CRYPT_ARCHIVE: int +HP_ALGID: int +HP_HASHVAL: int +HP_HASHSIZE: int +HP_HMAC_INFO: int +HP_TLS1PRF_LABEL: int +HP_TLS1PRF_SEED: int +CRYPT_FAILED: int +CRYPT_SUCCEED: int + +def RCRYPT_SUCCEEDED(rt: int) -> bool: ... +def RCRYPT_FAILED(rt: int) -> bool: ... + +PP_ENUMALGS: int +PP_ENUMCONTAINERS: int +PP_IMPTYPE: int +PP_NAME: int +PP_VERSION: int +PP_CONTAINER: int +PP_CHANGE_PASSWORD: int +PP_KEYSET_SEC_DESCR: int +PP_CERTCHAIN: int +PP_KEY_TYPE_SUBTYPE: int +PP_PROVTYPE: int +PP_KEYSTORAGE: int +PP_APPLI_CERT: int +PP_SYM_KEYSIZE: int +PP_SESSION_KEYSIZE: int +PP_UI_PROMPT: int +PP_ENUMALGS_EX: int +PP_ENUMMANDROOTS: int +PP_ENUMELECTROOTS: int +PP_KEYSET_TYPE: int +PP_ADMIN_PIN: int +PP_KEYEXCHANGE_PIN: int +PP_SIGNATURE_PIN: int +PP_SIG_KEYSIZE_INC: int +PP_KEYX_KEYSIZE_INC: int +PP_UNIQUE_CONTAINER: int +PP_SGC_INFO: int +PP_USE_HARDWARE_RNG: int +PP_KEYSPEC: int +PP_ENUMEX_SIGNING_PROT: int +PP_CRYPT_COUNT_KEY_USE: int +CRYPT_FIRST: int +CRYPT_NEXT: int +CRYPT_SGC_ENUM: int +CRYPT_IMPL_HARDWARE: int +CRYPT_IMPL_SOFTWARE: int +CRYPT_IMPL_MIXED: int +CRYPT_IMPL_UNKNOWN: int +CRYPT_IMPL_REMOVABLE: int +CRYPT_SEC_DESCR: int +CRYPT_PSTORE: int +CRYPT_UI_PROMPT: int +CRYPT_FLAG_PCT1: int +CRYPT_FLAG_SSL2: int +CRYPT_FLAG_SSL3: int +CRYPT_FLAG_TLS1: int +CRYPT_FLAG_IPSEC: int +CRYPT_FLAG_SIGNING: int +CRYPT_SGC: int +CRYPT_FASTSGC: int +PP_CLIENT_HWND: int +PP_CONTEXT_INFO: int +PP_KEYEXCHANGE_KEYSIZE: int +PP_SIGNATURE_KEYSIZE: int +PP_KEYEXCHANGE_ALG: int +PP_SIGNATURE_ALG: int +PP_DELETEKEY: int +PROV_RSA_FULL: int +PROV_RSA_SIG: int +PROV_DSS: int +PROV_FORTEZZA: int +PROV_MS_EXCHANGE: int +PROV_SSL: int +PROV_RSA_SCHANNEL: int +PROV_DSS_DH: int +PROV_EC_ECDSA_SIG: int +PROV_EC_ECNRA_SIG: int +PROV_EC_ECDSA_FULL: int +PROV_EC_ECNRA_FULL: int +PROV_DH_SCHANNEL: int +PROV_SPYRUS_LYNKS: int +PROV_RNG: int +PROV_INTEL_SEC: int +PROV_REPLACE_OWF: int +PROV_RSA_AES: int +MS_DEF_PROV_A: str +MS_DEF_PROV: str +MS_ENHANCED_PROV_A: str +MS_ENHANCED_PROV: str +MS_STRONG_PROV_A: str +MS_STRONG_PROV: str +MS_DEF_RSA_SIG_PROV_A: str +MS_DEF_RSA_SIG_PROV: str +MS_DEF_RSA_SCHANNEL_PROV_A: str +MS_DEF_RSA_SCHANNEL_PROV: str +MS_DEF_DSS_PROV_A: str +MS_DEF_DSS_PROV: str +MS_DEF_DSS_DH_PROV_A: str +MS_DEF_DSS_DH_PROV: str +MS_ENH_DSS_DH_PROV_A: str +MS_ENH_DSS_DH_PROV: str +MS_DEF_DH_SCHANNEL_PROV_A: str +MS_DEF_DH_SCHANNEL_PROV: str +MS_SCARD_PROV_A: str +MS_SCARD_PROV: str +MS_ENH_RSA_AES_PROV_A: str +MS_ENH_RSA_AES_PROV: str +MAXUIDLEN: int +EXPO_OFFLOAD_REG_VALUE: str +EXPO_OFFLOAD_FUNC_NAME: str +szKEY_CRYPTOAPI_PRIVATE_KEY_OPTIONS: str +szFORCE_KEY_PROTECTION: str +dwFORCE_KEY_PROTECTION_DISABLED: int +dwFORCE_KEY_PROTECTION_USER_SELECT: int +dwFORCE_KEY_PROTECTION_HIGH: int +szKEY_CACHE_ENABLED: str +szKEY_CACHE_SECONDS: str +CUR_BLOB_VERSION: int +SCHANNEL_MAC_KEY: int +SCHANNEL_ENC_KEY: int +INTERNATIONAL_USAGE: int +szOID_RSA: str +szOID_PKCS: str +szOID_RSA_HASH: str +szOID_RSA_ENCRYPT: str +szOID_PKCS_1: str +szOID_PKCS_2: str +szOID_PKCS_3: str +szOID_PKCS_4: str +szOID_PKCS_5: str +szOID_PKCS_6: str +szOID_PKCS_7: str +szOID_PKCS_8: str +szOID_PKCS_9: str +szOID_PKCS_10: str +szOID_PKCS_12: str +szOID_RSA_RSA: str +szOID_RSA_MD2RSA: str +szOID_RSA_MD4RSA: str +szOID_RSA_MD5RSA: str +szOID_RSA_SHA1RSA: str +szOID_RSA_SETOAEP_RSA: str +szOID_RSA_DH: str +szOID_RSA_data: str +szOID_RSA_signedData: str +szOID_RSA_envelopedData: str +szOID_RSA_signEnvData: str +szOID_RSA_digestedData: str +szOID_RSA_hashedData: str +szOID_RSA_encryptedData: str +szOID_RSA_emailAddr: str +szOID_RSA_unstructName: str +szOID_RSA_contentType: str +szOID_RSA_messageDigest: str +szOID_RSA_signingTime: str +szOID_RSA_counterSign: str +szOID_RSA_challengePwd: str +szOID_RSA_unstructAddr: str +szOID_RSA_extCertAttrs: str +szOID_RSA_certExtensions: str +szOID_RSA_SMIMECapabilities: str +szOID_RSA_preferSignedData: str +szOID_RSA_SMIMEalg: str +szOID_RSA_SMIMEalgESDH: str +szOID_RSA_SMIMEalgCMS3DESwrap: str +szOID_RSA_SMIMEalgCMSRC2wrap: str +szOID_RSA_MD2: str +szOID_RSA_MD4: str +szOID_RSA_MD5: str +szOID_RSA_RC2CBC: str +szOID_RSA_RC4: str +szOID_RSA_DES_EDE3_CBC: str +szOID_RSA_RC5_CBCPad: str +szOID_ANSI_X942: str +szOID_ANSI_X942_DH: str +szOID_X957: str +szOID_X957_DSA: str +szOID_X957_SHA1DSA: str +szOID_DS: str +szOID_DSALG: str +szOID_DSALG_CRPT: str +szOID_DSALG_HASH: str +szOID_DSALG_SIGN: str +szOID_DSALG_RSA: str +szOID_OIW: str +szOID_OIWSEC: str +szOID_OIWSEC_md4RSA: str +szOID_OIWSEC_md5RSA: str +szOID_OIWSEC_md4RSA2: str +szOID_OIWSEC_desECB: str +szOID_OIWSEC_desCBC: str +szOID_OIWSEC_desOFB: str +szOID_OIWSEC_desCFB: str +szOID_OIWSEC_desMAC: str +szOID_OIWSEC_rsaSign: str +szOID_OIWSEC_dsa: str +szOID_OIWSEC_shaDSA: str +szOID_OIWSEC_mdc2RSA: str +szOID_OIWSEC_shaRSA: str +szOID_OIWSEC_dhCommMod: str +szOID_OIWSEC_desEDE: str +szOID_OIWSEC_sha: str +szOID_OIWSEC_mdc2: str +szOID_OIWSEC_dsaComm: str +szOID_OIWSEC_dsaCommSHA: str +szOID_OIWSEC_rsaXchg: str +szOID_OIWSEC_keyHashSeal: str +szOID_OIWSEC_md2RSASign: str +szOID_OIWSEC_md5RSASign: str +szOID_OIWSEC_sha1: str +szOID_OIWSEC_dsaSHA1: str +szOID_OIWSEC_dsaCommSHA1: str +szOID_OIWSEC_sha1RSASign: str +szOID_OIWDIR: str +szOID_OIWDIR_CRPT: str +szOID_OIWDIR_HASH: str +szOID_OIWDIR_SIGN: str +szOID_OIWDIR_md2: str +szOID_OIWDIR_md2RSA: str +szOID_INFOSEC: str +szOID_INFOSEC_sdnsSignature: str +szOID_INFOSEC_mosaicSignature: str +szOID_INFOSEC_sdnsConfidentiality: str +szOID_INFOSEC_mosaicConfidentiality: str +szOID_INFOSEC_sdnsIntegrity: str +szOID_INFOSEC_mosaicIntegrity: str +szOID_INFOSEC_sdnsTokenProtection: str +szOID_INFOSEC_mosaicTokenProtection: str +szOID_INFOSEC_sdnsKeyManagement: str +szOID_INFOSEC_mosaicKeyManagement: str +szOID_INFOSEC_sdnsKMandSig: str +szOID_INFOSEC_mosaicKMandSig: str +szOID_INFOSEC_SuiteASignature: str +szOID_INFOSEC_SuiteAConfidentiality: str +szOID_INFOSEC_SuiteAIntegrity: str +szOID_INFOSEC_SuiteATokenProtection: str +szOID_INFOSEC_SuiteAKeyManagement: str +szOID_INFOSEC_SuiteAKMandSig: str +szOID_INFOSEC_mosaicUpdatedSig: str +szOID_INFOSEC_mosaicKMandUpdSig: str +szOID_INFOSEC_mosaicUpdatedInteg: str +szOID_COMMON_NAME: str +szOID_SUR_NAME: str +szOID_DEVICE_SERIAL_NUMBER: str +szOID_COUNTRY_NAME: str +szOID_LOCALITY_NAME: str +szOID_STATE_OR_PROVINCE_NAME: str +szOID_STREET_ADDRESS: str +szOID_ORGANIZATION_NAME: str +szOID_ORGANIZATIONAL_UNIT_NAME: str +szOID_TITLE: str +szOID_DESCRIPTION: str +szOID_SEARCH_GUIDE: str +szOID_BUSINESS_CATEGORY: str +szOID_POSTAL_ADDRESS: str +szOID_POSTAL_CODE: str +szOID_POST_OFFICE_BOX: str +szOID_PHYSICAL_DELIVERY_OFFICE_NAME: str +szOID_TELEPHONE_NUMBER: str +szOID_TELEX_NUMBER: str +szOID_TELETEXT_TERMINAL_IDENTIFIER: str +szOID_FACSIMILE_TELEPHONE_NUMBER: str +szOID_X21_ADDRESS: str +szOID_INTERNATIONAL_ISDN_NUMBER: str +szOID_REGISTERED_ADDRESS: str +szOID_DESTINATION_INDICATOR: str +szOID_PREFERRED_DELIVERY_METHOD: str +szOID_PRESENTATION_ADDRESS: str +szOID_SUPPORTED_APPLICATION_CONTEXT: str +szOID_MEMBER: str +szOID_OWNER: str +szOID_ROLE_OCCUPANT: str +szOID_SEE_ALSO: str +szOID_USER_PASSWORD: str +szOID_USER_CERTIFICATE: str +szOID_CA_CERTIFICATE: str +szOID_CROSS_CERTIFICATE_PAIR: str +szOID_GIVEN_NAME: str +szOID_INITIALS: str +szOID_DN_QUALIFIER: str +szOID_DOMAIN_COMPONENT: str +szOID_PKCS_12_FRIENDLY_NAME_ATTR: str +szOID_PKCS_12_LOCAL_KEY_ID: str +szOID_PKCS_12_KEY_PROVIDER_NAME_ATTR: str +szOID_LOCAL_MACHINE_KEYSET: str +szOID_KEYID_RDN: str +CERT_RDN_ANY_TYPE: int +CERT_RDN_ENCODED_BLOB: int +CERT_RDN_OCTET_STRING: int +CERT_RDN_NUMERIC_STRING: int +CERT_RDN_PRINTABLE_STRING: int +CERT_RDN_TELETEX_STRING: int +CERT_RDN_T61_STRING: int +CERT_RDN_VIDEOTEX_STRING: int +CERT_RDN_IA5_STRING: int +CERT_RDN_GRAPHIC_STRING: int +CERT_RDN_VISIBLE_STRING: int +CERT_RDN_ISO646_STRING: int +CERT_RDN_GENERAL_STRING: int +CERT_RDN_UNIVERSAL_STRING: int +CERT_RDN_INT4_STRING: int +CERT_RDN_BMP_STRING: int +CERT_RDN_UNICODE_STRING: int +CERT_RDN_UTF8_STRING: int +CERT_RDN_TYPE_MASK: int +CERT_RDN_FLAGS_MASK: int +CERT_RDN_ENABLE_T61_UNICODE_FLAG: int +CERT_RDN_ENABLE_UTF8_UNICODE_FLAG: int +CERT_RDN_DISABLE_CHECK_TYPE_FLAG: int +CERT_RDN_DISABLE_IE4_UTF8_FLAG: int +CERT_RSA_PUBLIC_KEY_OBJID: str +CERT_DEFAULT_OID_PUBLIC_KEY_SIGN: str +CERT_DEFAULT_OID_PUBLIC_KEY_XCHG: str +CERT_V1: int +CERT_V2: int +CERT_V3: int +CERT_INFO_VERSION_FLAG: int +CERT_INFO_SERIAL_NUMBER_FLAG: int +CERT_INFO_SIGNATURE_ALGORITHM_FLAG: int +CERT_INFO_ISSUER_FLAG: int +CERT_INFO_NOT_BEFORE_FLAG: int +CERT_INFO_NOT_AFTER_FLAG: int +CERT_INFO_SUBJECT_FLAG: int +CERT_INFO_SUBJECT_PUBLIC_KEY_INFO_FLAG: int +CERT_INFO_ISSUER_UNIQUE_ID_FLAG: int +CERT_INFO_SUBJECT_UNIQUE_ID_FLAG: int +CERT_INFO_EXTENSION_FLAG: int +CRL_V1: int +CRL_V2: int +CERT_REQUEST_V1: int +CERT_KEYGEN_REQUEST_V1: int +CTL_V1: int +CERT_ENCODING_TYPE_MASK: int +CMSG_ENCODING_TYPE_MASK: int + +def GET_CERT_ENCODING_TYPE(X: int) -> int: ... +def GET_CMSG_ENCODING_TYPE(X: int) -> int: ... + +CRYPT_ASN_ENCODING: int +CRYPT_NDR_ENCODING: int +X509_ASN_ENCODING: int +X509_NDR_ENCODING: int +PKCS_7_ASN_ENCODING: int +PKCS_7_NDR_ENCODING: int +CRYPT_FORMAT_STR_MULTI_LINE: int +CRYPT_FORMAT_STR_NO_HEX: int +CRYPT_FORMAT_SIMPLE: int +CRYPT_FORMAT_X509: int +CRYPT_FORMAT_OID: int +CRYPT_FORMAT_RDN_SEMICOLON: int +CRYPT_FORMAT_RDN_CRLF: int +CRYPT_FORMAT_RDN_UNQUOTE: int +CRYPT_FORMAT_RDN_REVERSE: int +CRYPT_FORMAT_COMMA: int +CRYPT_FORMAT_SEMICOLON: int +CRYPT_FORMAT_CRLF: int +CRYPT_ENCODE_NO_SIGNATURE_BYTE_REVERSAL_FLAG: int +CRYPT_ENCODE_ALLOC_FLAG: int +CRYPT_UNICODE_NAME_ENCODE_ENABLE_T61_UNICODE_FLAG: int +CRYPT_UNICODE_NAME_ENCODE_ENABLE_UTF8_UNICODE_FLAG: int +CRYPT_UNICODE_NAME_ENCODE_DISABLE_CHECK_TYPE_FLAG: int +CRYPT_SORTED_CTL_ENCODE_HASHED_SUBJECT_IDENTIFIER_FLAG: int +CRYPT_DECODE_NOCOPY_FLAG: int +CRYPT_DECODE_TO_BE_SIGNED_FLAG: int +CRYPT_DECODE_SHARE_OID_STRING_FLAG: int +CRYPT_DECODE_NO_SIGNATURE_BYTE_REVERSAL_FLAG: int +CRYPT_DECODE_ALLOC_FLAG: int +CRYPT_UNICODE_NAME_DECODE_DISABLE_IE4_UTF8_FLAG: int +CRYPT_ENCODE_DECODE_NONE: int +X509_CERT: int +X509_CERT_TO_BE_SIGNED: int +X509_CERT_CRL_TO_BE_SIGNED: int +X509_CERT_REQUEST_TO_BE_SIGNED: int +X509_EXTENSIONS: int +X509_NAME_VALUE: int +X509_NAME: int +X509_PUBLIC_KEY_INFO: int +X509_AUTHORITY_KEY_ID: int +X509_KEY_ATTRIBUTES: int +X509_KEY_USAGE_RESTRICTION: int +X509_ALTERNATE_NAME: int +X509_BASIC_CONSTRAINTS: int +X509_KEY_USAGE: int +X509_BASIC_CONSTRAINTS2: int +X509_CERT_POLICIES: int +PKCS_UTC_TIME: int +PKCS_TIME_REQUEST: int +RSA_CSP_PUBLICKEYBLOB: int +X509_UNICODE_NAME: int +X509_KEYGEN_REQUEST_TO_BE_SIGNED: int +PKCS_ATTRIBUTE: int +PKCS_CONTENT_INFO_SEQUENCE_OF_ANY: int +X509_UNICODE_NAME_VALUE: int +X509_ANY_STRING: int +X509_UNICODE_ANY_STRING: int +X509_OCTET_STRING: int +X509_BITS: int +X509_INTEGER: int +X509_MULTI_BYTE_INTEGER: int +X509_ENUMERATED: int +X509_CHOICE_OF_TIME: int +X509_AUTHORITY_KEY_ID2: int +X509_AUTHORITY_INFO_ACCESS: int +X509_SUBJECT_INFO_ACCESS: int +X509_CRL_REASON_CODE: int +PKCS_CONTENT_INFO: int +X509_SEQUENCE_OF_ANY: int +X509_CRL_DIST_POINTS: int +X509_ENHANCED_KEY_USAGE: int +PKCS_CTL: int +X509_MULTI_BYTE_UINT: int +X509_DSS_PUBLICKEY: int +X509_DSS_PARAMETERS: int +X509_DSS_SIGNATURE: int +PKCS_RC2_CBC_PARAMETERS: int +PKCS_SMIME_CAPABILITIES: int +X509_QC_STATEMENTS_EXT: int +PKCS_RSA_PRIVATE_KEY: int +PKCS_PRIVATE_KEY_INFO: int +PKCS_ENCRYPTED_PRIVATE_KEY_INFO: int +X509_PKIX_POLICY_QUALIFIER_USERNOTICE: int +X509_DH_PUBLICKEY: int +X509_DH_PARAMETERS: int +PKCS_ATTRIBUTES: int +PKCS_SORTED_CTL: int +X509_ECC_SIGNATURE: int +X942_DH_PARAMETERS: int +X509_BITS_WITHOUT_TRAILING_ZEROES: int +X942_OTHER_INFO: int +X509_CERT_PAIR: int +X509_ISSUING_DIST_POINT: int +X509_NAME_CONSTRAINTS: int +X509_POLICY_MAPPINGS: int +X509_POLICY_CONSTRAINTS: int +X509_CROSS_CERT_DIST_POINTS: int +CMC_DATA: int +CMC_RESPONSE: int +CMC_STATUS: int +CMC_ADD_EXTENSIONS: int +CMC_ADD_ATTRIBUTES: int +X509_CERTIFICATE_TEMPLATE: int +OCSP_SIGNED_REQUEST: int +OCSP_REQUEST: int +OCSP_RESPONSE: int +OCSP_BASIC_SIGNED_RESPONSE: int +OCSP_BASIC_RESPONSE: int +X509_LOGOTYPE_EXT: int +X509_BIOMETRIC_EXT: int +CNG_RSA_PUBLIC_KEY_BLOB: int +X509_OBJECT_IDENTIFIER: int +X509_ALGORITHM_IDENTIFIER: int +PKCS_RSA_SSA_PSS_PARAMETERS: int +PKCS_RSAES_OAEP_PARAMETERS: int +ECC_CMS_SHARED_INFO: int +TIMESTAMP_REQUEST: int +TIMESTAMP_RESPONSE: int +TIMESTAMP_INFO: int +X509_CERT_BUNDLE: int +PKCS7_SIGNER_INFO: int +CMS_SIGNER_INFO: int +szOID_AUTHORITY_KEY_IDENTIFIER: str +szOID_KEY_ATTRIBUTES: str +szOID_CERT_POLICIES_95: str +szOID_KEY_USAGE_RESTRICTION: str +szOID_SUBJECT_ALT_NAME: str +szOID_ISSUER_ALT_NAME: str +szOID_BASIC_CONSTRAINTS: str +szOID_KEY_USAGE: str +szOID_PRIVATEKEY_USAGE_PERIOD: str +szOID_BASIC_CONSTRAINTS2: str +szOID_CERT_POLICIES: str +szOID_ANY_CERT_POLICY: str +szOID_AUTHORITY_KEY_IDENTIFIER2: str +szOID_SUBJECT_KEY_IDENTIFIER: str +szOID_SUBJECT_ALT_NAME2: str +szOID_ISSUER_ALT_NAME2: str +szOID_CRL_REASON_CODE: str +szOID_REASON_CODE_HOLD: str +szOID_CRL_DIST_POINTS: str +szOID_ENHANCED_KEY_USAGE: str +szOID_CRL_NUMBER: str +szOID_DELTA_CRL_INDICATOR: str +szOID_ISSUING_DIST_POINT: str +szOID_FRESHEST_CRL: str +szOID_NAME_CONSTRAINTS: str +szOID_POLICY_MAPPINGS: str +szOID_LEGACY_POLICY_MAPPINGS: str +szOID_POLICY_CONSTRAINTS: str +szOID_RENEWAL_CERTIFICATE: str +szOID_ENROLLMENT_NAME_VALUE_PAIR: str +szOID_ENROLLMENT_CSP_PROVIDER: str +szOID_OS_VERSION: str +szOID_ENROLLMENT_AGENT: str +szOID_PKIX: str +szOID_PKIX_PE: str +szOID_AUTHORITY_INFO_ACCESS: str +szOID_CERT_EXTENSIONS: str +szOID_NEXT_UPDATE_LOCATION: str +szOID_REMOVE_CERTIFICATE: str +szOID_CROSS_CERT_DIST_POINTS: str +szOID_CTL: str +szOID_SORTED_CTL: str +szOID_SERIALIZED: str +szOID_NT_PRINCIPAL_NAME: str +szOID_PRODUCT_UPDATE: str +szOID_ANY_APPLICATION_POLICY: str +szOID_AUTO_ENROLL_CTL_USAGE: str +szOID_ENROLL_CERTTYPE_EXTENSION: str +szOID_CERT_MANIFOLD: str +szOID_CERTSRV_CA_VERSION: str +szOID_CERTSRV_PREVIOUS_CERT_HASH: str +szOID_CRL_VIRTUAL_BASE: str +szOID_CRL_NEXT_PUBLISH: str +szOID_KP_CA_EXCHANGE: str +szOID_KP_KEY_RECOVERY_AGENT: str +szOID_CERTIFICATE_TEMPLATE: str +szOID_ENTERPRISE_OID_ROOT: str +szOID_RDN_DUMMY_SIGNER: str +szOID_APPLICATION_CERT_POLICIES: str +szOID_APPLICATION_POLICY_MAPPINGS: str +szOID_APPLICATION_POLICY_CONSTRAINTS: str +szOID_ARCHIVED_KEY_ATTR: str +szOID_CRL_SELF_CDP: str +szOID_REQUIRE_CERT_CHAIN_POLICY: str +szOID_ARCHIVED_KEY_CERT_HASH: str +szOID_ISSUED_CERT_HASH: str +szOID_DS_EMAIL_REPLICATION: str +szOID_REQUEST_CLIENT_INFO: str +szOID_ENCRYPTED_KEY_HASH: str +szOID_CERTSRV_CROSSCA_VERSION: str +szOID_NTDS_REPLICATION: str +szOID_SUBJECT_DIR_ATTRS: str +szOID_PKIX_KP: str +szOID_PKIX_KP_SERVER_AUTH: str +szOID_PKIX_KP_CLIENT_AUTH: str +szOID_PKIX_KP_CODE_SIGNING: str +szOID_PKIX_KP_EMAIL_PROTECTION: str +szOID_PKIX_KP_IPSEC_END_SYSTEM: str +szOID_PKIX_KP_IPSEC_TUNNEL: str +szOID_PKIX_KP_IPSEC_USER: str +szOID_PKIX_KP_TIMESTAMP_SIGNING: str +szOID_IPSEC_KP_IKE_INTERMEDIATE: str +szOID_KP_CTL_USAGE_SIGNING: str +szOID_KP_TIME_STAMP_SIGNING: str +szOID_SERVER_GATED_CRYPTO: str +szOID_SGC_NETSCAPE: str +szOID_KP_EFS: str +szOID_EFS_RECOVERY: str +szOID_WHQL_CRYPTO: str +szOID_NT5_CRYPTO: str +szOID_OEM_WHQL_CRYPTO: str +szOID_EMBEDDED_NT_CRYPTO: str +szOID_KP_QUALIFIED_SUBORDINATION: str +szOID_KP_KEY_RECOVERY: str +szOID_KP_DOCUMENT_SIGNING: str +szOID_KP_LIFETIME_SIGNING: str +szOID_KP_MOBILE_DEVICE_SOFTWARE: str +szOID_DRM: str +szOID_DRM_INDIVIDUALIZATION: str +szOID_LICENSES: str +szOID_LICENSE_SERVER: str +szOID_KP_SMARTCARD_LOGON: str +szOID_YESNO_TRUST_ATTR: str +szOID_PKIX_POLICY_QUALIFIER_CPS: str +szOID_PKIX_POLICY_QUALIFIER_USERNOTICE: str +szOID_CERT_POLICIES_95_QUALIFIER1: str +CERT_UNICODE_RDN_ERR_INDEX_MASK: int +CERT_UNICODE_RDN_ERR_INDEX_SHIFT: int +CERT_UNICODE_ATTR_ERR_INDEX_MASK: int +CERT_UNICODE_ATTR_ERR_INDEX_SHIFT: int +CERT_UNICODE_VALUE_ERR_INDEX_MASK: int +CERT_UNICODE_VALUE_ERR_INDEX_SHIFT: int +CERT_DIGITAL_SIGNATURE_KEY_USAGE: int +CERT_NON_REPUDIATION_KEY_USAGE: int +CERT_KEY_ENCIPHERMENT_KEY_USAGE: int +CERT_DATA_ENCIPHERMENT_KEY_USAGE: int +CERT_KEY_AGREEMENT_KEY_USAGE: int +CERT_KEY_CERT_SIGN_KEY_USAGE: int +CERT_OFFLINE_CRL_SIGN_KEY_USAGE: int +CERT_CRL_SIGN_KEY_USAGE: int +CERT_ENCIPHER_ONLY_KEY_USAGE: int +CERT_DECIPHER_ONLY_KEY_USAGE: int +CERT_ALT_NAME_OTHER_NAME: int +CERT_ALT_NAME_RFC822_NAME: int +CERT_ALT_NAME_DNS_NAME: int +CERT_ALT_NAME_X400_ADDRESS: int +CERT_ALT_NAME_DIRECTORY_NAME: int +CERT_ALT_NAME_EDI_PARTY_NAME: int +CERT_ALT_NAME_URL: int +CERT_ALT_NAME_IP_ADDRESS: int +CERT_ALT_NAME_REGISTERED_ID: int +CERT_ALT_NAME_ENTRY_ERR_INDEX_MASK: int +CERT_ALT_NAME_ENTRY_ERR_INDEX_SHIFT: int +CERT_ALT_NAME_VALUE_ERR_INDEX_MASK: int +CERT_ALT_NAME_VALUE_ERR_INDEX_SHIFT: int +CERT_CA_SUBJECT_FLAG: int +CERT_END_ENTITY_SUBJECT_FLAG: int +szOID_PKIX_ACC_DESCR: str +szOID_PKIX_OCSP: str +szOID_PKIX_CA_ISSUERS: str +CRL_REASON_UNSPECIFIED: int +CRL_REASON_KEY_COMPROMISE: int +CRL_REASON_CA_COMPROMISE: int +CRL_REASON_AFFILIATION_CHANGED: int +CRL_REASON_SUPERSEDED: int +CRL_REASON_CESSATION_OF_OPERATION: int +CRL_REASON_CERTIFICATE_HOLD: int +CRL_REASON_REMOVE_FROM_CRL: int +CRL_DIST_POINT_NO_NAME: int +CRL_DIST_POINT_FULL_NAME: int +CRL_DIST_POINT_ISSUER_RDN_NAME: int +CRL_REASON_UNUSED_FLAG: int +CRL_REASON_KEY_COMPROMISE_FLAG: int +CRL_REASON_CA_COMPROMISE_FLAG: int +CRL_REASON_AFFILIATION_CHANGED_FLAG: int +CRL_REASON_SUPERSEDED_FLAG: int +CRL_REASON_CESSATION_OF_OPERATION_FLAG: int +CRL_REASON_CERTIFICATE_HOLD_FLAG: int +CRL_DIST_POINT_ERR_INDEX_MASK: int +CRL_DIST_POINT_ERR_INDEX_SHIFT: int +CRL_DIST_POINT_ERR_CRL_ISSUER_BIT: int +CROSS_CERT_DIST_POINT_ERR_INDEX_MASK: int +CROSS_CERT_DIST_POINT_ERR_INDEX_SHIFT: int +CERT_EXCLUDED_SUBTREE_BIT: int +SORTED_CTL_EXT_FLAGS_OFFSET: int +SORTED_CTL_EXT_COUNT_OFFSET: int +SORTED_CTL_EXT_MAX_COLLISION_OFFSET: int +SORTED_CTL_EXT_HASH_BUCKET_OFFSET: int +SORTED_CTL_EXT_HASHED_SUBJECT_IDENTIFIER_FLAG: int +CERT_DSS_R_LEN: int +CERT_DSS_S_LEN: int +CERT_DSS_SIGNATURE_LEN: int +CERT_MAX_ASN_ENCODED_DSS_SIGNATURE_LEN: int +CRYPT_X942_COUNTER_BYTE_LENGTH: int +CRYPT_X942_KEY_LENGTH_BYTE_LENGTH: int +CRYPT_X942_PUB_INFO_BYTE_LENGTH: float +CRYPT_RC2_40BIT_VERSION: int +CRYPT_RC2_56BIT_VERSION: int +CRYPT_RC2_64BIT_VERSION: int +CRYPT_RC2_128BIT_VERSION: int +szOID_VERISIGN_PRIVATE_6_9: str +szOID_VERISIGN_ONSITE_JURISDICTION_HASH: str +szOID_VERISIGN_BITSTRING_6_13: str +szOID_VERISIGN_ISS_STRONG_CRYPTO: str +szOID_NETSCAPE: str +szOID_NETSCAPE_CERT_EXTENSION: str +szOID_NETSCAPE_CERT_TYPE: str +szOID_NETSCAPE_BASE_URL: str +szOID_NETSCAPE_REVOCATION_URL: str +szOID_NETSCAPE_CA_REVOCATION_URL: str +szOID_NETSCAPE_CERT_RENEWAL_URL: str +szOID_NETSCAPE_CA_POLICY_URL: str +szOID_NETSCAPE_SSL_SERVER_NAME: str +szOID_NETSCAPE_COMMENT: str +szOID_NETSCAPE_DATA_TYPE: str +szOID_NETSCAPE_CERT_SEQUENCE: str +NETSCAPE_SSL_CLIENT_AUTH_CERT_TYPE: int +NETSCAPE_SSL_SERVER_AUTH_CERT_TYPE: int +NETSCAPE_SMIME_CERT_TYPE: int +NETSCAPE_SIGN_CERT_TYPE: int +NETSCAPE_SSL_CA_CERT_TYPE: int +NETSCAPE_SMIME_CA_CERT_TYPE: int +NETSCAPE_SIGN_CA_CERT_TYPE: int +szOID_CT_PKI_DATA: str +szOID_CT_PKI_RESPONSE: str +szOID_PKIX_NO_SIGNATURE: str +szOID_CMC: str +szOID_CMC_STATUS_INFO: str +szOID_CMC_IDENTIFICATION: str +szOID_CMC_IDENTITY_PROOF: str +szOID_CMC_DATA_RETURN: str +szOID_CMC_TRANSACTION_ID: str +szOID_CMC_SENDER_NONCE: str +szOID_CMC_RECIPIENT_NONCE: str +szOID_CMC_ADD_EXTENSIONS: str +szOID_CMC_ENCRYPTED_POP: str +szOID_CMC_DECRYPTED_POP: str +szOID_CMC_LRA_POP_WITNESS: str +szOID_CMC_GET_CERT: str +szOID_CMC_GET_CRL: str +szOID_CMC_REVOKE_REQUEST: str +szOID_CMC_REG_INFO: str +szOID_CMC_RESPONSE_INFO: str +szOID_CMC_QUERY_PENDING: str +szOID_CMC_ID_POP_LINK_RANDOM: str +szOID_CMC_ID_POP_LINK_WITNESS: str +szOID_CMC_ID_CONFIRM_CERT_ACCEPTANCE: str +szOID_CMC_ADD_ATTRIBUTES: str +CMC_TAGGED_CERT_REQUEST_CHOICE: int +CMC_OTHER_INFO_NO_CHOICE: int +CMC_OTHER_INFO_FAIL_CHOICE: int +CMC_OTHER_INFO_PEND_CHOICE: int +CMC_STATUS_SUCCESS: int +CMC_STATUS_FAILED: int +CMC_STATUS_PENDING: int +CMC_STATUS_NO_SUPPORT: int +CMC_STATUS_CONFIRM_REQUIRED: int +CMC_FAIL_BAD_ALG: int +CMC_FAIL_BAD_MESSAGE_CHECK: int +CMC_FAIL_BAD_REQUEST: int +CMC_FAIL_BAD_TIME: int +CMC_FAIL_BAD_CERT_ID: int +CMC_FAIL_UNSUPORTED_EXT: int +CMC_FAIL_MUST_ARCHIVE_KEYS: int +CMC_FAIL_BAD_IDENTITY: int +CMC_FAIL_POP_REQUIRED: int +CMC_FAIL_POP_FAILED: int +CMC_FAIL_NO_KEY_REUSE: int +CMC_FAIL_INTERNAL_CA_ERROR: int +CMC_FAIL_TRY_LATER: int +CRYPT_OID_ENCODE_OBJECT_FUNC: str +CRYPT_OID_DECODE_OBJECT_FUNC: str +CRYPT_OID_ENCODE_OBJECT_EX_FUNC: str +CRYPT_OID_DECODE_OBJECT_EX_FUNC: str +CRYPT_OID_CREATE_COM_OBJECT_FUNC: str +CRYPT_OID_VERIFY_REVOCATION_FUNC: str +CRYPT_OID_VERIFY_CTL_USAGE_FUNC: str +CRYPT_OID_FORMAT_OBJECT_FUNC: str +CRYPT_OID_FIND_OID_INFO_FUNC: str +CRYPT_OID_FIND_LOCALIZED_NAME_FUNC: str +CRYPT_OID_REGPATH: str +CRYPT_OID_REG_ENCODING_TYPE_PREFIX: str +CRYPT_OID_REG_DLL_VALUE_NAME: str +CRYPT_OID_REG_FUNC_NAME_VALUE_NAME: str +CRYPT_OID_REG_FUNC_NAME_VALUE_NAME_A: str +CRYPT_OID_REG_FLAGS_VALUE_NAME: str +CRYPT_DEFAULT_OID: str +CRYPT_INSTALL_OID_FUNC_BEFORE_FLAG: int +CRYPT_GET_INSTALLED_OID_FUNC_FLAG: int +CRYPT_REGISTER_FIRST_INDEX: int +CRYPT_REGISTER_LAST_INDEX: int +CRYPT_MATCH_ANY_ENCODING_TYPE: int +CRYPT_HASH_ALG_OID_GROUP_ID: int +CRYPT_ENCRYPT_ALG_OID_GROUP_ID: int +CRYPT_PUBKEY_ALG_OID_GROUP_ID: int +CRYPT_SIGN_ALG_OID_GROUP_ID: int +CRYPT_RDN_ATTR_OID_GROUP_ID: int +CRYPT_EXT_OR_ATTR_OID_GROUP_ID: int +CRYPT_ENHKEY_USAGE_OID_GROUP_ID: int +CRYPT_POLICY_OID_GROUP_ID: int +CRYPT_TEMPLATE_OID_GROUP_ID: int +CRYPT_LAST_OID_GROUP_ID: int +CRYPT_FIRST_ALG_OID_GROUP_ID: int +CRYPT_LAST_ALG_OID_GROUP_ID: int +CRYPT_OID_INHIBIT_SIGNATURE_FORMAT_FLAG: int +CRYPT_OID_USE_PUBKEY_PARA_FOR_PKCS7_FLAG: int +CRYPT_OID_NO_NULL_ALGORITHM_PARA_FLAG: int +CRYPT_OID_INFO_OID_KEY: int +CRYPT_OID_INFO_NAME_KEY: int +CRYPT_OID_INFO_ALGID_KEY: int +CRYPT_OID_INFO_SIGN_KEY: int +CRYPT_INSTALL_OID_INFO_BEFORE_FLAG: int +CRYPT_LOCALIZED_NAME_ENCODING_TYPE: int +CRYPT_LOCALIZED_NAME_OID: str +szOID_PKCS_7_DATA: str +szOID_PKCS_7_SIGNED: str +szOID_PKCS_7_ENVELOPED: str +szOID_PKCS_7_SIGNEDANDENVELOPED: str +szOID_PKCS_7_DIGESTED: str +szOID_PKCS_7_ENCRYPTED: str +szOID_PKCS_9_CONTENT_TYPE: str +szOID_PKCS_9_MESSAGE_DIGEST: str +CMSG_DATA: int +CMSG_SIGNED: int +CMSG_ENVELOPED: int +CMSG_SIGNED_AND_ENVELOPED: int +CMSG_HASHED: int +CMSG_ENCRYPTED: int +CMSG_ALL_FLAGS: int +CMSG_DATA_FLAG: int +CMSG_SIGNED_FLAG: int +CMSG_ENVELOPED_FLAG: int +CMSG_SIGNED_AND_ENVELOPED_FLAG: int +CMSG_HASHED_FLAG: int +CMSG_ENCRYPTED_FLAG: int +CERT_ID_ISSUER_SERIAL_NUMBER: int +CERT_ID_KEY_IDENTIFIER: int +CERT_ID_SHA1_HASH: int +CMSG_KEY_AGREE_EPHEMERAL_KEY_CHOICE: int +CMSG_KEY_AGREE_STATIC_KEY_CHOICE: int +CMSG_KEY_TRANS_RECIPIENT: int +CMSG_KEY_AGREE_RECIPIENT: int +CMSG_SP3_COMPATIBLE_ENCRYPT_FLAG: int +CMSG_RC4_NO_SALT_FLAG: int +CMSG_INDEFINITE_LENGTH: int +CMSG_BARE_CONTENT_FLAG: int +CMSG_LENGTH_ONLY_FLAG: int +CMSG_DETACHED_FLAG: int +CMSG_AUTHENTICATED_ATTRIBUTES_FLAG: int +CMSG_CONTENTS_OCTETS_FLAG: int +CMSG_MAX_LENGTH_FLAG: int +CMSG_CMS_ENCAPSULATED_CONTENT_FLAG: int +CMSG_CRYPT_RELEASE_CONTEXT_FLAG: int +CMSG_TYPE_PARAM: int +CMSG_CONTENT_PARAM: int +CMSG_BARE_CONTENT_PARAM: int +CMSG_INNER_CONTENT_TYPE_PARAM: int +CMSG_SIGNER_COUNT_PARAM: int +CMSG_SIGNER_INFO_PARAM: int +CMSG_SIGNER_CERT_INFO_PARAM: int +CMSG_SIGNER_HASH_ALGORITHM_PARAM: int +CMSG_SIGNER_AUTH_ATTR_PARAM: int +CMSG_SIGNER_UNAUTH_ATTR_PARAM: int +CMSG_CERT_COUNT_PARAM: int +CMSG_CERT_PARAM: int +CMSG_CRL_COUNT_PARAM: int +CMSG_CRL_PARAM: int +CMSG_ENVELOPE_ALGORITHM_PARAM: int +CMSG_RECIPIENT_COUNT_PARAM: int +CMSG_RECIPIENT_INDEX_PARAM: int +CMSG_RECIPIENT_INFO_PARAM: int +CMSG_HASH_ALGORITHM_PARAM: int +CMSG_HASH_DATA_PARAM: int +CMSG_COMPUTED_HASH_PARAM: int +CMSG_ENCRYPT_PARAM: int +CMSG_ENCRYPTED_DIGEST: int +CMSG_ENCODED_SIGNER: int +CMSG_ENCODED_MESSAGE: int +CMSG_VERSION_PARAM: int +CMSG_ATTR_CERT_COUNT_PARAM: int +CMSG_ATTR_CERT_PARAM: int +CMSG_CMS_RECIPIENT_COUNT_PARAM: int +CMSG_CMS_RECIPIENT_INDEX_PARAM: int +CMSG_CMS_RECIPIENT_ENCRYPTED_KEY_INDEX_PARAM: int +CMSG_CMS_RECIPIENT_INFO_PARAM: int +CMSG_UNPROTECTED_ATTR_PARAM: int +CMSG_SIGNER_CERT_ID_PARAM: int +CMSG_CMS_SIGNER_INFO_PARAM: int +CMSG_SIGNED_DATA_V1: int +CMSG_SIGNED_DATA_V3: int +CMSG_SIGNED_DATA_PKCS_1_5_VERSION: int +CMSG_SIGNED_DATA_CMS_VERSION: int +CMSG_SIGNER_INFO_V1: int +CMSG_SIGNER_INFO_V3: int +CMSG_SIGNER_INFO_PKCS_1_5_VERSION: int +CMSG_SIGNER_INFO_CMS_VERSION: int +CMSG_HASHED_DATA_V0: int +CMSG_HASHED_DATA_V2: int +CMSG_HASHED_DATA_PKCS_1_5_VERSION: int +CMSG_HASHED_DATA_CMS_VERSION: int +CMSG_ENVELOPED_DATA_V0: int +CMSG_ENVELOPED_DATA_V2: int +CMSG_ENVELOPED_DATA_PKCS_1_5_VERSION: int +CMSG_ENVELOPED_DATA_CMS_VERSION: int +CMSG_KEY_AGREE_ORIGINATOR_CERT: int +CMSG_KEY_AGREE_ORIGINATOR_PUBLIC_KEY: int +CMSG_ENVELOPED_RECIPIENT_V0: int +CMSG_ENVELOPED_RECIPIENT_V2: int +CMSG_ENVELOPED_RECIPIENT_V3: int +CMSG_ENVELOPED_RECIPIENT_V4: int +CMSG_KEY_TRANS_PKCS_1_5_VERSION: int +CMSG_KEY_TRANS_CMS_VERSION: int +CMSG_KEY_AGREE_VERSION: int +CMSG_CTRL_VERIFY_SIGNATURE: int +CMSG_CTRL_DECRYPT: int +CMSG_CTRL_VERIFY_HASH: int +CMSG_CTRL_ADD_SIGNER: int +CMSG_CTRL_DEL_SIGNER: int +CMSG_CTRL_ADD_SIGNER_UNAUTH_ATTR: int +CMSG_CTRL_DEL_SIGNER_UNAUTH_ATTR: int +CMSG_CTRL_ADD_CERT: int +CMSG_CTRL_DEL_CERT: int +CMSG_CTRL_ADD_CRL: int +CMSG_CTRL_DEL_CRL: int +CMSG_CTRL_ADD_ATTR_CERT: int +CMSG_CTRL_DEL_ATTR_CERT: int +CMSG_CTRL_KEY_TRANS_DECRYPT: int +CMSG_CTRL_KEY_AGREE_DECRYPT: int +CMSG_CTRL_VERIFY_SIGNATURE_EX: int +CMSG_CTRL_ADD_CMS_SIGNER_INFO: int +CMSG_VERIFY_SIGNER_PUBKEY: int +CMSG_VERIFY_SIGNER_CERT: int +CMSG_VERIFY_SIGNER_CHAIN: int +CMSG_VERIFY_SIGNER_NULL: int +CMSG_OID_GEN_ENCRYPT_KEY_FUNC: str +CMSG_OID_EXPORT_ENCRYPT_KEY_FUNC: str +CMSG_OID_IMPORT_ENCRYPT_KEY_FUNC: str +CMSG_CONTENT_ENCRYPT_PAD_ENCODED_LEN_FLAG: int +CMSG_DEFAULT_INSTALLABLE_FUNC_OID: int +CMSG_CONTENT_ENCRYPT_FREE_PARA_FLAG: int +CMSG_CONTENT_ENCRYPT_RELEASE_CONTEXT_FLAG: int +CMSG_OID_GEN_CONTENT_ENCRYPT_KEY_FUNC: str +CMSG_KEY_TRANS_ENCRYPT_FREE_PARA_FLAG: int +CMSG_OID_EXPORT_KEY_TRANS_FUNC: str +CMSG_KEY_AGREE_ENCRYPT_FREE_PARA_FLAG: int +CMSG_KEY_AGREE_ENCRYPT_FREE_MATERIAL_FLAG: int +CMSG_KEY_AGREE_ENCRYPT_FREE_PUBKEY_ALG_FLAG: int +CMSG_KEY_AGREE_ENCRYPT_FREE_PUBKEY_PARA_FLAG: int +CMSG_KEY_AGREE_ENCRYPT_FREE_PUBKEY_BITS_FLAG: int +CMSG_OID_EXPORT_KEY_AGREE_FUNC: str +CMSG_OID_IMPORT_KEY_TRANS_FUNC: str +CMSG_OID_IMPORT_KEY_AGREE_FUNC: str +CERT_KEY_PROV_HANDLE_PROP_ID: int +CERT_KEY_PROV_INFO_PROP_ID: int +CERT_SHA1_HASH_PROP_ID: int +CERT_MD5_HASH_PROP_ID: int +CERT_HASH_PROP_ID: int +CERT_KEY_CONTEXT_PROP_ID: int +CERT_KEY_SPEC_PROP_ID: int +CERT_IE30_RESERVED_PROP_ID: int +CERT_PUBKEY_HASH_RESERVED_PROP_ID: int +CERT_ENHKEY_USAGE_PROP_ID: int +CERT_CTL_USAGE_PROP_ID: int +CERT_NEXT_UPDATE_LOCATION_PROP_ID: int +CERT_FRIENDLY_NAME_PROP_ID: int +CERT_PVK_FILE_PROP_ID: int +CERT_DESCRIPTION_PROP_ID: int +CERT_ACCESS_STATE_PROP_ID: int +CERT_SIGNATURE_HASH_PROP_ID: int +CERT_SMART_CARD_DATA_PROP_ID: int +CERT_EFS_PROP_ID: int +CERT_FORTEZZA_DATA_PROP_ID: int +CERT_ARCHIVED_PROP_ID: int +CERT_KEY_IDENTIFIER_PROP_ID: int +CERT_AUTO_ENROLL_PROP_ID: int +CERT_PUBKEY_ALG_PARA_PROP_ID: int +CERT_CROSS_CERT_DIST_POINTS_PROP_ID: int +CERT_ISSUER_PUBLIC_KEY_MD5_HASH_PROP_ID: int +CERT_SUBJECT_PUBLIC_KEY_MD5_HASH_PROP_ID: int +CERT_ENROLLMENT_PROP_ID: int +CERT_DATE_STAMP_PROP_ID: int +CERT_ISSUER_SERIAL_NUMBER_MD5_HASH_PROP_ID: int +CERT_SUBJECT_NAME_MD5_HASH_PROP_ID: int +CERT_EXTENDED_ERROR_INFO_PROP_ID: int +CERT_RENEWAL_PROP_ID: int +CERT_ARCHIVED_KEY_HASH_PROP_ID: int +CERT_AUTO_ENROLL_RETRY_PROP_ID: int +CERT_AIA_URL_RETRIEVED_PROP_ID: int +CERT_AUTHORITY_INFO_ACCESS_PROP_ID: int +CERT_BACKED_UP_PROP_ID: int +CERT_OCSP_RESPONSE_PROP_ID: int +CERT_REQUEST_ORIGINATOR_PROP_ID: int +CERT_SOURCE_LOCATION_PROP_ID: int +CERT_SOURCE_URL_PROP_ID: int +CERT_NEW_KEY_PROP_ID: int +CERT_OCSP_CACHE_PREFIX_PROP_ID: int +CERT_SMART_CARD_ROOT_INFO_PROP_ID: int +CERT_NO_AUTO_EXPIRE_CHECK_PROP_ID: int +CERT_NCRYPT_KEY_HANDLE_PROP_ID: int +CERT_HCRYPTPROV_OR_NCRYPT_KEY_HANDLE_PROP_ID: int +CERT_SUBJECT_INFO_ACCESS_PROP_ID: int +CERT_CA_OCSP_AUTHORITY_INFO_ACCESS_PROP_ID: int +CERT_CA_DISABLE_CRL_PROP_ID: int +CERT_ROOT_PROGRAM_CERT_POLICIES_PROP_ID: int +CERT_ROOT_PROGRAM_NAME_CONSTRAINTS_PROP_ID: int +CERT_SUBJECT_OCSP_AUTHORITY_INFO_ACCESS_PROP_ID: int +CERT_SUBJECT_DISABLE_CRL_PROP_ID: int +CERT_CEP_PROP_ID: int +CERT_SIGN_HASH_CNG_ALG_PROP_ID: int +CERT_SCARD_PIN_ID_PROP_ID: int +CERT_SCARD_PIN_INFO_PROP_ID: int +CERT_FIRST_RESERVED_PROP_ID: int +CERT_LAST_RESERVED_PROP_ID: int +CERT_FIRST_USER_PROP_ID: int +CERT_LAST_USER_PROP_ID: int +szOID_CERT_PROP_ID_PREFIX: str +szOID_CERT_KEY_IDENTIFIER_PROP_ID: str +szOID_CERT_ISSUER_SERIAL_NUMBER_MD5_HASH_PROP_ID: str +szOID_CERT_SUBJECT_NAME_MD5_HASH_PROP_ID: str +CERT_ACCESS_STATE_WRITE_PERSIST_FLAG: int +CERT_ACCESS_STATE_SYSTEM_STORE_FLAG: int +CERT_ACCESS_STATE_LM_SYSTEM_STORE_FLAG: int +CERT_SET_KEY_PROV_HANDLE_PROP_ID: int +CERT_SET_KEY_CONTEXT_PROP_ID: int +sz_CERT_STORE_PROV_MEMORY: str +sz_CERT_STORE_PROV_FILENAME_W: str +sz_CERT_STORE_PROV_FILENAME: str +sz_CERT_STORE_PROV_SYSTEM_W: str +sz_CERT_STORE_PROV_SYSTEM: str +sz_CERT_STORE_PROV_PKCS7: str +sz_CERT_STORE_PROV_SERIALIZED: str +sz_CERT_STORE_PROV_COLLECTION: str +sz_CERT_STORE_PROV_SYSTEM_REGISTRY_W: str +sz_CERT_STORE_PROV_SYSTEM_REGISTRY: str +sz_CERT_STORE_PROV_PHYSICAL_W: str +sz_CERT_STORE_PROV_PHYSICAL: str +sz_CERT_STORE_PROV_SMART_CARD_W: str +sz_CERT_STORE_PROV_SMART_CARD: str +sz_CERT_STORE_PROV_LDAP_W: str +sz_CERT_STORE_PROV_LDAP: str +CERT_STORE_SIGNATURE_FLAG: int +CERT_STORE_TIME_VALIDITY_FLAG: int +CERT_STORE_REVOCATION_FLAG: int +CERT_STORE_NO_CRL_FLAG: int +CERT_STORE_NO_ISSUER_FLAG: int +CERT_STORE_BASE_CRL_FLAG: int +CERT_STORE_DELTA_CRL_FLAG: int +CERT_STORE_NO_CRYPT_RELEASE_FLAG: int +CERT_STORE_SET_LOCALIZED_NAME_FLAG: int +CERT_STORE_DEFER_CLOSE_UNTIL_LAST_FREE_FLAG: int +CERT_STORE_DELETE_FLAG: int +CERT_STORE_UNSAFE_PHYSICAL_FLAG: int +CERT_STORE_SHARE_STORE_FLAG: int +CERT_STORE_SHARE_CONTEXT_FLAG: int +CERT_STORE_MANIFOLD_FLAG: int +CERT_STORE_ENUM_ARCHIVED_FLAG: int +CERT_STORE_UPDATE_KEYID_FLAG: int +CERT_STORE_BACKUP_RESTORE_FLAG: int +CERT_STORE_READONLY_FLAG: int +CERT_STORE_OPEN_EXISTING_FLAG: int +CERT_STORE_CREATE_NEW_FLAG: int +CERT_STORE_MAXIMUM_ALLOWED_FLAG: int +CERT_SYSTEM_STORE_MASK: int +CERT_SYSTEM_STORE_RELOCATE_FLAG: int +CERT_SYSTEM_STORE_UNPROTECTED_FLAG: int +CERT_SYSTEM_STORE_LOCATION_MASK: int +CERT_SYSTEM_STORE_LOCATION_SHIFT: int +CERT_SYSTEM_STORE_CURRENT_USER_ID: int +CERT_SYSTEM_STORE_LOCAL_MACHINE_ID: int +CERT_SYSTEM_STORE_CURRENT_SERVICE_ID: int +CERT_SYSTEM_STORE_SERVICES_ID: int +CERT_SYSTEM_STORE_USERS_ID: int +CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY_ID: int +CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY_ID: int +CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE_ID: int +CERT_SYSTEM_STORE_CURRENT_USER: int +CERT_SYSTEM_STORE_LOCAL_MACHINE: int +CERT_SYSTEM_STORE_CURRENT_SERVICE: int +CERT_SYSTEM_STORE_SERVICES: int +CERT_SYSTEM_STORE_USERS: int +CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY: int +CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY: int +CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE: int +CERT_PROT_ROOT_DISABLE_CURRENT_USER_FLAG: int +CERT_PROT_ROOT_INHIBIT_ADD_AT_INIT_FLAG: int +CERT_PROT_ROOT_INHIBIT_PURGE_LM_FLAG: int +CERT_PROT_ROOT_DISABLE_LM_AUTH_FLAG: int +CERT_PROT_ROOT_ONLY_LM_GPT_FLAG: int +CERT_PROT_ROOT_DISABLE_NT_AUTH_REQUIRED_FLAG: int +CERT_PROT_ROOT_DISABLE_NOT_DEFINED_NAME_CONSTRAINT_FLAG: int +CERT_TRUST_PUB_ALLOW_TRUST_MASK: int +CERT_TRUST_PUB_ALLOW_END_USER_TRUST: int +CERT_TRUST_PUB_ALLOW_MACHINE_ADMIN_TRUST: int +CERT_TRUST_PUB_ALLOW_ENTERPRISE_ADMIN_TRUST: int +CERT_TRUST_PUB_CHECK_PUBLISHER_REV_FLAG: int +CERT_TRUST_PUB_CHECK_TIMESTAMP_REV_FLAG: int +CERT_AUTH_ROOT_AUTO_UPDATE_LOCAL_MACHINE_REGPATH: str +CERT_AUTH_ROOT_AUTO_UPDATE_DISABLE_UNTRUSTED_ROOT_LOGGING_FLAG: int +CERT_AUTH_ROOT_AUTO_UPDATE_DISABLE_PARTIAL_CHAIN_LOGGING_FLAG: int +CERT_AUTH_ROOT_AUTO_UPDATE_ROOT_DIR_URL_VALUE_NAME: str +CERT_AUTH_ROOT_AUTO_UPDATE_SYNC_DELTA_TIME_VALUE_NAME: str +CERT_AUTH_ROOT_AUTO_UPDATE_FLAGS_VALUE_NAME: str +CERT_AUTH_ROOT_CTL_FILENAME: str +CERT_AUTH_ROOT_CTL_FILENAME_A: str +CERT_AUTH_ROOT_CAB_FILENAME: str +CERT_AUTH_ROOT_SEQ_FILENAME: str +CERT_AUTH_ROOT_CERT_EXT: str +CERT_GROUP_POLICY_SYSTEM_STORE_REGPATH: str +CERT_EFSBLOB_REGPATH: str +CERT_EFSBLOB_VALUE_NAME: str +CERT_PROT_ROOT_FLAGS_REGPATH: str +CERT_PROT_ROOT_FLAGS_VALUE_NAME: str +CERT_TRUST_PUB_SAFER_GROUP_POLICY_REGPATH: str +CERT_LOCAL_MACHINE_SYSTEM_STORE_REGPATH: str +CERT_TRUST_PUB_SAFER_LOCAL_MACHINE_REGPATH: str +CERT_TRUST_PUB_AUTHENTICODE_FLAGS_VALUE_NAME: str +CERT_OCM_SUBCOMPONENTS_LOCAL_MACHINE_REGPATH: str +CERT_OCM_SUBCOMPONENTS_ROOT_AUTO_UPDATE_VALUE_NAME: str +CERT_DISABLE_ROOT_AUTO_UPDATE_REGPATH: str +CERT_DISABLE_ROOT_AUTO_UPDATE_VALUE_NAME: str +CERT_REGISTRY_STORE_REMOTE_FLAG: int +CERT_REGISTRY_STORE_SERIALIZED_FLAG: int +CERT_REGISTRY_STORE_CLIENT_GPT_FLAG: int +CERT_REGISTRY_STORE_LM_GPT_FLAG: int +CERT_REGISTRY_STORE_ROAMING_FLAG: int +CERT_REGISTRY_STORE_MY_IE_DIRTY_FLAG: int +CERT_IE_DIRTY_FLAGS_REGPATH: str +CERT_FILE_STORE_COMMIT_ENABLE_FLAG: int +CERT_LDAP_STORE_SIGN_FLAG: int +CERT_LDAP_STORE_AREC_EXCLUSIVE_FLAG: int +CERT_LDAP_STORE_OPENED_FLAG: int +CERT_LDAP_STORE_UNBIND_FLAG: int +CRYPT_OID_OPEN_STORE_PROV_FUNC: str +CERT_STORE_PROV_EXTERNAL_FLAG: int +CERT_STORE_PROV_DELETED_FLAG: int +CERT_STORE_PROV_NO_PERSIST_FLAG: int +CERT_STORE_PROV_SYSTEM_STORE_FLAG: int +CERT_STORE_PROV_LM_SYSTEM_STORE_FLAG: int +CERT_STORE_PROV_CLOSE_FUNC: int +CERT_STORE_PROV_READ_CERT_FUNC: int +CERT_STORE_PROV_WRITE_CERT_FUNC: int +CERT_STORE_PROV_DELETE_CERT_FUNC: int +CERT_STORE_PROV_SET_CERT_PROPERTY_FUNC: int +CERT_STORE_PROV_READ_CRL_FUNC: int +CERT_STORE_PROV_WRITE_CRL_FUNC: int +CERT_STORE_PROV_DELETE_CRL_FUNC: int +CERT_STORE_PROV_SET_CRL_PROPERTY_FUNC: int +CERT_STORE_PROV_READ_CTL_FUNC: int +CERT_STORE_PROV_WRITE_CTL_FUNC: int +CERT_STORE_PROV_DELETE_CTL_FUNC: int +CERT_STORE_PROV_SET_CTL_PROPERTY_FUNC: int +CERT_STORE_PROV_CONTROL_FUNC: int +CERT_STORE_PROV_FIND_CERT_FUNC: int +CERT_STORE_PROV_FREE_FIND_CERT_FUNC: int +CERT_STORE_PROV_GET_CERT_PROPERTY_FUNC: int +CERT_STORE_PROV_FIND_CRL_FUNC: int +CERT_STORE_PROV_FREE_FIND_CRL_FUNC: int +CERT_STORE_PROV_GET_CRL_PROPERTY_FUNC: int +CERT_STORE_PROV_FIND_CTL_FUNC: int +CERT_STORE_PROV_FREE_FIND_CTL_FUNC: int +CERT_STORE_PROV_GET_CTL_PROPERTY_FUNC: int +CERT_STORE_PROV_WRITE_ADD_FLAG: int +CERT_STORE_SAVE_AS_STORE: int +CERT_STORE_SAVE_AS_PKCS7: int +CERT_STORE_SAVE_TO_FILE: int +CERT_STORE_SAVE_TO_MEMORY: int +CERT_STORE_SAVE_TO_FILENAME_A: int +CERT_STORE_SAVE_TO_FILENAME_W: int +CERT_STORE_SAVE_TO_FILENAME: int +CERT_CLOSE_STORE_FORCE_FLAG: int +CERT_CLOSE_STORE_CHECK_FLAG: int +CERT_COMPARE_MASK: int +CERT_COMPARE_SHIFT: int +CERT_COMPARE_ANY: int +CERT_COMPARE_SHA1_HASH: int +CERT_COMPARE_NAME: int +CERT_COMPARE_ATTR: int +CERT_COMPARE_MD5_HASH: int +CERT_COMPARE_PROPERTY: int +CERT_COMPARE_PUBLIC_KEY: int +CERT_COMPARE_HASH: int +CERT_COMPARE_NAME_STR_A: int +CERT_COMPARE_NAME_STR_W: int +CERT_COMPARE_KEY_SPEC: int +CERT_COMPARE_ENHKEY_USAGE: int +CERT_COMPARE_CTL_USAGE: int +CERT_COMPARE_SUBJECT_CERT: int +CERT_COMPARE_ISSUER_OF: int +CERT_COMPARE_EXISTING: int +CERT_COMPARE_SIGNATURE_HASH: int +CERT_COMPARE_KEY_IDENTIFIER: int +CERT_COMPARE_CERT_ID: int +CERT_COMPARE_CROSS_CERT_DIST_POINTS: int +CERT_COMPARE_PUBKEY_MD5_HASH: int +CERT_FIND_ANY: int +CERT_FIND_SHA1_HASH: int +CERT_FIND_MD5_HASH: int +CERT_FIND_SIGNATURE_HASH: int +CERT_FIND_KEY_IDENTIFIER: int +CERT_FIND_HASH: int +CERT_FIND_PROPERTY: int +CERT_FIND_PUBLIC_KEY: int +CERT_FIND_SUBJECT_NAME: int +CERT_FIND_SUBJECT_ATTR: int +CERT_FIND_ISSUER_NAME: int +CERT_FIND_ISSUER_ATTR: int +CERT_FIND_SUBJECT_STR_A: int +CERT_FIND_SUBJECT_STR_W: int +CERT_FIND_SUBJECT_STR: int +CERT_FIND_ISSUER_STR_A: int +CERT_FIND_ISSUER_STR_W: int +CERT_FIND_ISSUER_STR: int +CERT_FIND_KEY_SPEC: int +CERT_FIND_ENHKEY_USAGE: int +CERT_FIND_CTL_USAGE: int +CERT_FIND_SUBJECT_CERT: int +CERT_FIND_ISSUER_OF: int +CERT_FIND_EXISTING: int +CERT_FIND_CERT_ID: int +CERT_FIND_CROSS_CERT_DIST_POINTS: int +CERT_FIND_PUBKEY_MD5_HASH: int +CERT_FIND_OPTIONAL_ENHKEY_USAGE_FLAG: int +CERT_FIND_EXT_ONLY_ENHKEY_USAGE_FLAG: int +CERT_FIND_PROP_ONLY_ENHKEY_USAGE_FLAG: int +CERT_FIND_NO_ENHKEY_USAGE_FLAG: int +CERT_FIND_OR_ENHKEY_USAGE_FLAG: int +CERT_FIND_VALID_ENHKEY_USAGE_FLAG: int +CERT_FIND_OPTIONAL_CTL_USAGE_FLAG: int +CERT_FIND_EXT_ONLY_CTL_USAGE_FLAG: int +CERT_FIND_PROP_ONLY_CTL_USAGE_FLAG: int +CERT_FIND_NO_CTL_USAGE_FLAG: int +CERT_FIND_OR_CTL_USAGE_FLAG: int +CERT_FIND_VALID_CTL_USAGE_FLAG: int +CERT_SET_PROPERTY_IGNORE_PERSIST_ERROR_FLAG: int +CERT_SET_PROPERTY_INHIBIT_PERSIST_FLAG: int +CTL_ENTRY_FROM_PROP_CHAIN_FLAG: int +CRL_FIND_ANY: int +CRL_FIND_ISSUED_BY: int +CRL_FIND_EXISTING: int +CRL_FIND_ISSUED_FOR: int +CRL_FIND_ISSUED_BY_AKI_FLAG: int +CRL_FIND_ISSUED_BY_SIGNATURE_FLAG: int +CRL_FIND_ISSUED_BY_DELTA_FLAG: int +CRL_FIND_ISSUED_BY_BASE_FLAG: int +CERT_STORE_ADD_NEW: int +CERT_STORE_ADD_USE_EXISTING: int +CERT_STORE_ADD_REPLACE_EXISTING: int +CERT_STORE_ADD_ALWAYS: int +CERT_STORE_ADD_REPLACE_EXISTING_INHERIT_PROPERTIES: int +CERT_STORE_ADD_NEWER: int +CERT_STORE_ADD_NEWER_INHERIT_PROPERTIES: int +CERT_STORE_CERTIFICATE_CONTEXT: int +CERT_STORE_CRL_CONTEXT: int +CERT_STORE_CTL_CONTEXT: int +CERT_STORE_ALL_CONTEXT_FLAG: int +CERT_STORE_CERTIFICATE_CONTEXT_FLAG: int +CERT_STORE_CRL_CONTEXT_FLAG: int +CERT_STORE_CTL_CONTEXT_FLAG: int +CTL_ANY_SUBJECT_TYPE: int +CTL_CERT_SUBJECT_TYPE: int +CTL_FIND_ANY: int +CTL_FIND_SHA1_HASH: int +CTL_FIND_MD5_HASH: int +CTL_FIND_USAGE: int +CTL_FIND_SUBJECT: int +CTL_FIND_EXISTING: int +CTL_FIND_SAME_USAGE_FLAG: int +CERT_STORE_CTRL_RESYNC: int +CERT_STORE_CTRL_NOTIFY_CHANGE: int +CERT_STORE_CTRL_COMMIT: int +CERT_STORE_CTRL_AUTO_RESYNC: int +CERT_STORE_CTRL_CANCEL_NOTIFY: int +CERT_STORE_CTRL_INHIBIT_DUPLICATE_HANDLE_FLAG: int +CERT_STORE_CTRL_COMMIT_FORCE_FLAG: int +CERT_STORE_CTRL_COMMIT_CLEAR_FLAG: int +CERT_STORE_LOCALIZED_NAME_PROP_ID: int +CERT_CREATE_CONTEXT_NOCOPY_FLAG: int +CERT_CREATE_CONTEXT_SORTED_FLAG: int +CERT_CREATE_CONTEXT_NO_HCRYPTMSG_FLAG: int +CERT_CREATE_CONTEXT_NO_ENTRY_FLAG: int +CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG: int +CERT_PHYSICAL_STORE_OPEN_DISABLE_FLAG: int +CERT_PHYSICAL_STORE_REMOTE_OPEN_DISABLE_FLAG: int +CERT_PHYSICAL_STORE_INSERT_COMPUTER_NAME_ENABLE_FLAG: int +CERT_PHYSICAL_STORE_PREDEFINED_ENUM_FLAG: int +CERT_PHYSICAL_STORE_DEFAULT_NAME: str +CERT_PHYSICAL_STORE_GROUP_POLICY_NAME: str +CERT_PHYSICAL_STORE_LOCAL_MACHINE_NAME: str +CERT_PHYSICAL_STORE_DS_USER_CERTIFICATE_NAME: str +CERT_PHYSICAL_STORE_LOCAL_MACHINE_GROUP_POLICY_NAME: str +CERT_PHYSICAL_STORE_ENTERPRISE_NAME: str +CERT_PHYSICAL_STORE_AUTH_ROOT_NAME: str +CERT_PHYSICAL_STORE_SMART_CARD_NAME: str +CRYPT_OID_OPEN_SYSTEM_STORE_PROV_FUNC: str +CRYPT_OID_REGISTER_SYSTEM_STORE_FUNC: str +CRYPT_OID_UNREGISTER_SYSTEM_STORE_FUNC: str +CRYPT_OID_ENUM_SYSTEM_STORE_FUNC: str +CRYPT_OID_REGISTER_PHYSICAL_STORE_FUNC: str +CRYPT_OID_UNREGISTER_PHYSICAL_STORE_FUNC: str +CRYPT_OID_ENUM_PHYSICAL_STORE_FUNC: str +CRYPT_OID_SYSTEM_STORE_LOCATION_VALUE_NAME: str +CMSG_TRUSTED_SIGNER_FLAG: int +CMSG_SIGNER_ONLY_FLAG: int +CMSG_USE_SIGNER_INDEX_FLAG: int +CMSG_CMS_ENCAPSULATED_CTL_FLAG: int +CMSG_ENCODE_SORTED_CTL_FLAG: int +CMSG_ENCODE_HASHED_SUBJECT_IDENTIFIER_FLAG: int +CERT_VERIFY_INHIBIT_CTL_UPDATE_FLAG: int +CERT_VERIFY_TRUSTED_SIGNERS_FLAG: int +CERT_VERIFY_NO_TIME_CHECK_FLAG: int +CERT_VERIFY_ALLOW_MORE_USAGE_FLAG: int +CERT_VERIFY_UPDATED_CTL_FLAG: int +CERT_CONTEXT_REVOCATION_TYPE: int +CERT_VERIFY_REV_CHAIN_FLAG: int +CERT_VERIFY_CACHE_ONLY_BASED_REVOCATION: int +CERT_VERIFY_REV_ACCUMULATIVE_TIMEOUT_FLAG: int +CERT_UNICODE_IS_RDN_ATTRS_FLAG: int +CERT_CASE_INSENSITIVE_IS_RDN_ATTRS_FLAG: int +CRYPT_VERIFY_CERT_SIGN_SUBJECT_BLOB: int +CRYPT_VERIFY_CERT_SIGN_SUBJECT_CERT: int +CRYPT_VERIFY_CERT_SIGN_SUBJECT_CRL: int +CRYPT_VERIFY_CERT_SIGN_ISSUER_PUBKEY: int +CRYPT_VERIFY_CERT_SIGN_ISSUER_CERT: int +CRYPT_VERIFY_CERT_SIGN_ISSUER_CHAIN: int +CRYPT_VERIFY_CERT_SIGN_ISSUER_NULL: int +CRYPT_DEFAULT_CONTEXT_AUTO_RELEASE_FLAG: int +CRYPT_DEFAULT_CONTEXT_PROCESS_FLAG: int +CRYPT_DEFAULT_CONTEXT_CERT_SIGN_OID: int +CRYPT_DEFAULT_CONTEXT_MULTI_CERT_SIGN_OID: int +CRYPT_OID_EXPORT_PUBLIC_KEY_INFO_FUNC: str +CRYPT_OID_IMPORT_PUBLIC_KEY_INFO_FUNC: str +CRYPT_ACQUIRE_CACHE_FLAG: int +CRYPT_ACQUIRE_USE_PROV_INFO_FLAG: int +CRYPT_ACQUIRE_COMPARE_KEY_FLAG: int +CRYPT_ACQUIRE_SILENT_FLAG: int +CRYPT_FIND_USER_KEYSET_FLAG: int +CRYPT_FIND_MACHINE_KEYSET_FLAG: int +CRYPT_FIND_SILENT_KEYSET_FLAG: int +CRYPT_OID_IMPORT_PRIVATE_KEY_INFO_FUNC: str +CRYPT_OID_EXPORT_PRIVATE_KEY_INFO_FUNC: str +CRYPT_DELETE_KEYSET: int +CERT_SIMPLE_NAME_STR: int +CERT_OID_NAME_STR: int +CERT_X500_NAME_STR: int +CERT_NAME_STR_SEMICOLON_FLAG: int +CERT_NAME_STR_NO_PLUS_FLAG: int +CERT_NAME_STR_NO_QUOTING_FLAG: int +CERT_NAME_STR_CRLF_FLAG: int +CERT_NAME_STR_COMMA_FLAG: int +CERT_NAME_STR_REVERSE_FLAG: int +CERT_NAME_STR_DISABLE_IE4_UTF8_FLAG: int +CERT_NAME_STR_ENABLE_T61_UNICODE_FLAG: int +CERT_NAME_STR_ENABLE_UTF8_UNICODE_FLAG: int +CERT_NAME_EMAIL_TYPE: int +CERT_NAME_RDN_TYPE: int +CERT_NAME_ATTR_TYPE: int +CERT_NAME_SIMPLE_DISPLAY_TYPE: int +CERT_NAME_FRIENDLY_DISPLAY_TYPE: int +CERT_NAME_DNS_TYPE: int +CERT_NAME_URL_TYPE: int +CERT_NAME_UPN_TYPE: int +CERT_NAME_ISSUER_FLAG: int +CERT_NAME_DISABLE_IE4_UTF8_FLAG: int +CRYPT_MESSAGE_BARE_CONTENT_OUT_FLAG: int +CRYPT_MESSAGE_ENCAPSULATED_CONTENT_OUT_FLAG: int +CRYPT_MESSAGE_KEYID_SIGNER_FLAG: int +CRYPT_MESSAGE_SILENT_KEYSET_FLAG: int +CRYPT_MESSAGE_KEYID_RECIPIENT_FLAG: int +CERT_QUERY_OBJECT_FILE: int +CERT_QUERY_OBJECT_BLOB: int +CERT_QUERY_CONTENT_CERT: int +CERT_QUERY_CONTENT_CTL: int +CERT_QUERY_CONTENT_CRL: int +CERT_QUERY_CONTENT_SERIALIZED_STORE: int +CERT_QUERY_CONTENT_SERIALIZED_CERT: int +CERT_QUERY_CONTENT_SERIALIZED_CTL: int +CERT_QUERY_CONTENT_SERIALIZED_CRL: int +CERT_QUERY_CONTENT_PKCS7_SIGNED: int +CERT_QUERY_CONTENT_PKCS7_UNSIGNED: int +CERT_QUERY_CONTENT_PKCS7_SIGNED_EMBED: int +CERT_QUERY_CONTENT_PKCS10: int +CERT_QUERY_CONTENT_PFX: int +CERT_QUERY_CONTENT_CERT_PAIR: int +CERT_QUERY_CONTENT_FLAG_CERT: int +CERT_QUERY_CONTENT_FLAG_CTL: int +CERT_QUERY_CONTENT_FLAG_CRL: int +CERT_QUERY_CONTENT_FLAG_SERIALIZED_STORE: int +CERT_QUERY_CONTENT_FLAG_SERIALIZED_CERT: int +CERT_QUERY_CONTENT_FLAG_SERIALIZED_CTL: int +CERT_QUERY_CONTENT_FLAG_SERIALIZED_CRL: int +CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED: int +CERT_QUERY_CONTENT_FLAG_PKCS7_UNSIGNED: int +CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED_EMBED: int +CERT_QUERY_CONTENT_FLAG_PKCS10: int +CERT_QUERY_CONTENT_FLAG_PFX: int +CERT_QUERY_CONTENT_FLAG_CERT_PAIR: int +CERT_QUERY_CONTENT_FLAG_ALL: int +CERT_QUERY_FORMAT_BINARY: int +CERT_QUERY_FORMAT_BASE64_ENCODED: int +CERT_QUERY_FORMAT_ASN_ASCII_HEX_ENCODED: int +CERT_QUERY_FORMAT_FLAG_BINARY: int +CERT_QUERY_FORMAT_FLAG_BASE64_ENCODED: int +CERT_QUERY_FORMAT_FLAG_ASN_ASCII_HEX_ENCODED: int +CERT_QUERY_FORMAT_FLAG_ALL: int +CREDENTIAL_OID_PASSWORD_CREDENTIALS_A: int +CREDENTIAL_OID_PASSWORD_CREDENTIALS_W: int +CREDENTIAL_OID_PASSWORD_CREDENTIALS: int +SCHEME_OID_RETRIEVE_ENCODED_OBJECT_FUNC: str +SCHEME_OID_RETRIEVE_ENCODED_OBJECTW_FUNC: str +CONTEXT_OID_CREATE_OBJECT_CONTEXT_FUNC: str +CONTEXT_OID_CERTIFICATE: int +CONTEXT_OID_CRL: int +CONTEXT_OID_CTL: int +CONTEXT_OID_PKCS7: int +CONTEXT_OID_CAPI2_ANY: int +CONTEXT_OID_OCSP_RESP: int +CRYPT_RETRIEVE_MULTIPLE_OBJECTS: int +CRYPT_CACHE_ONLY_RETRIEVAL: int +CRYPT_WIRE_ONLY_RETRIEVAL: int +CRYPT_DONT_CACHE_RESULT: int +CRYPT_ASYNC_RETRIEVAL: int +CRYPT_STICKY_CACHE_RETRIEVAL: int +CRYPT_LDAP_SCOPE_BASE_ONLY_RETRIEVAL: int +CRYPT_OFFLINE_CHECK_RETRIEVAL: int +CRYPT_LDAP_INSERT_ENTRY_ATTRIBUTE: int +CRYPT_LDAP_SIGN_RETRIEVAL: int +CRYPT_NO_AUTH_RETRIEVAL: int +CRYPT_LDAP_AREC_EXCLUSIVE_RETRIEVAL: int +CRYPT_AIA_RETRIEVAL: int +CRYPT_VERIFY_CONTEXT_SIGNATURE: int +CRYPT_VERIFY_DATA_HASH: int +CRYPT_KEEP_TIME_VALID: int +CRYPT_DONT_VERIFY_SIGNATURE: int +CRYPT_DONT_CHECK_TIME_VALIDITY: int +CRYPT_CHECK_FRESHNESS_TIME_VALIDITY: int +CRYPT_ACCUMULATIVE_TIMEOUT: int +CRYPT_PARAM_ASYNC_RETRIEVAL_COMPLETION: int +CRYPT_PARAM_CANCEL_ASYNC_RETRIEVAL: int +CRYPT_GET_URL_FROM_PROPERTY: int +CRYPT_GET_URL_FROM_EXTENSION: int +CRYPT_GET_URL_FROM_UNAUTH_ATTRIBUTE: int +CRYPT_GET_URL_FROM_AUTH_ATTRIBUTE: int +URL_OID_GET_OBJECT_URL_FUNC: str +TIME_VALID_OID_GET_OBJECT_FUNC: str +TIME_VALID_OID_FLUSH_OBJECT_FUNC: str +TIME_VALID_OID_GET_CTL: int +TIME_VALID_OID_GET_CRL: int +TIME_VALID_OID_GET_CRL_FROM_CERT: int +TIME_VALID_OID_GET_FRESHEST_CRL_FROM_CERT: int +TIME_VALID_OID_GET_FRESHEST_CRL_FROM_CRL: int +TIME_VALID_OID_FLUSH_CTL: int +TIME_VALID_OID_FLUSH_CRL: int +TIME_VALID_OID_FLUSH_CRL_FROM_CERT: int +TIME_VALID_OID_FLUSH_FRESHEST_CRL_FROM_CERT: int +TIME_VALID_OID_FLUSH_FRESHEST_CRL_FROM_CRL: int +CRYPTPROTECT_PROMPT_ON_UNPROTECT: int +CRYPTPROTECT_PROMPT_ON_PROTECT: int +CRYPTPROTECT_PROMPT_RESERVED: int +CRYPTPROTECT_PROMPT_STRONG: int +CRYPTPROTECT_PROMPT_REQUIRE_STRONG: int +CRYPTPROTECT_UI_FORBIDDEN: int +CRYPTPROTECT_LOCAL_MACHINE: int +CRYPTPROTECT_CRED_SYNC: int +CRYPTPROTECT_AUDIT: int +CRYPTPROTECT_NO_RECOVERY: int +CRYPTPROTECT_VERIFY_PROTECTION: int +CRYPTPROTECT_CRED_REGENERATE: int +CRYPTPROTECT_FIRST_RESERVED_FLAGVAL: int +CRYPTPROTECT_LAST_RESERVED_FLAGVAL: int +CRYPTPROTECTMEMORY_BLOCK_SIZE: int +CRYPTPROTECTMEMORY_SAME_PROCESS: int +CRYPTPROTECTMEMORY_CROSS_PROCESS: int +CRYPTPROTECTMEMORY_SAME_LOGON: int +CERT_CREATE_SELFSIGN_NO_SIGN: int +CERT_CREATE_SELFSIGN_NO_KEY_INFO: int +CRYPT_KEYID_MACHINE_FLAG: int +CRYPT_KEYID_ALLOC_FLAG: int +CRYPT_KEYID_DELETE_FLAG: int +CRYPT_KEYID_SET_NEW_FLAG: int +CERT_CHAIN_MAX_AIA_URL_COUNT_IN_CERT_DEFAULT: int +CERT_CHAIN_MAX_AIA_URL_RETRIEVAL_COUNT_PER_CHAIN_DEFAULT: int +CERT_CHAIN_MAX_AIA_URL_RETRIEVAL_BYTE_COUNT_DEFAULT: int +CERT_CHAIN_MAX_AIA_URL_RETRIEVAL_CERT_COUNT_DEFAULT: int +CERT_CHAIN_CACHE_END_CERT: int +CERT_CHAIN_THREAD_STORE_SYNC: int +CERT_CHAIN_CACHE_ONLY_URL_RETRIEVAL: int +CERT_CHAIN_USE_LOCAL_MACHINE_STORE: int +CERT_CHAIN_ENABLE_CACHE_AUTO_UPDATE: int +CERT_CHAIN_ENABLE_SHARE_STORE: int +CERT_TRUST_NO_ERROR: int +CERT_TRUST_IS_NOT_TIME_VALID: int +CERT_TRUST_IS_NOT_TIME_NESTED: int +CERT_TRUST_IS_REVOKED: int +CERT_TRUST_IS_NOT_SIGNATURE_VALID: int +CERT_TRUST_IS_NOT_VALID_FOR_USAGE: int +CERT_TRUST_IS_UNTRUSTED_ROOT: int +CERT_TRUST_REVOCATION_STATUS_UNKNOWN: int +CERT_TRUST_IS_CYCLIC: int +CERT_TRUST_INVALID_EXTENSION: int +CERT_TRUST_INVALID_POLICY_CONSTRAINTS: int +CERT_TRUST_INVALID_BASIC_CONSTRAINTS: int +CERT_TRUST_INVALID_NAME_CONSTRAINTS: int +CERT_TRUST_HAS_NOT_SUPPORTED_NAME_CONSTRAINT: int +CERT_TRUST_HAS_NOT_DEFINED_NAME_CONSTRAINT: int +CERT_TRUST_HAS_NOT_PERMITTED_NAME_CONSTRAINT: int +CERT_TRUST_HAS_EXCLUDED_NAME_CONSTRAINT: int +CERT_TRUST_IS_OFFLINE_REVOCATION: int +CERT_TRUST_NO_ISSUANCE_CHAIN_POLICY: int +CERT_TRUST_IS_PARTIAL_CHAIN: int +CERT_TRUST_CTL_IS_NOT_TIME_VALID: int +CERT_TRUST_CTL_IS_NOT_SIGNATURE_VALID: int +CERT_TRUST_CTL_IS_NOT_VALID_FOR_USAGE: int +CERT_TRUST_HAS_EXACT_MATCH_ISSUER: int +CERT_TRUST_HAS_KEY_MATCH_ISSUER: int +CERT_TRUST_HAS_NAME_MATCH_ISSUER: int +CERT_TRUST_IS_SELF_SIGNED: int +CERT_TRUST_HAS_PREFERRED_ISSUER: int +CERT_TRUST_HAS_ISSUANCE_CHAIN_POLICY: int +CERT_TRUST_HAS_VALID_NAME_CONSTRAINTS: int +CERT_TRUST_IS_COMPLEX_CHAIN: int +USAGE_MATCH_TYPE_AND: int +USAGE_MATCH_TYPE_OR: int +CERT_CHAIN_REVOCATION_CHECK_END_CERT: int +CERT_CHAIN_REVOCATION_CHECK_CHAIN: int +CERT_CHAIN_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT: int +CERT_CHAIN_REVOCATION_CHECK_CACHE_ONLY: int +CERT_CHAIN_REVOCATION_ACCUMULATIVE_TIMEOUT: int +CERT_CHAIN_DISABLE_PASS1_QUALITY_FILTERING: int +CERT_CHAIN_RETURN_LOWER_QUALITY_CONTEXTS: int +CERT_CHAIN_DISABLE_AUTH_ROOT_AUTO_UPDATE: int +CERT_CHAIN_TIMESTAMP_TIME: int +REVOCATION_OID_CRL_REVOCATION: int +CERT_CHAIN_FIND_BY_ISSUER: int +CERT_CHAIN_FIND_BY_ISSUER_COMPARE_KEY_FLAG: int +CERT_CHAIN_FIND_BY_ISSUER_COMPLEX_CHAIN_FLAG: int +CERT_CHAIN_FIND_BY_ISSUER_CACHE_ONLY_URL_FLAG: int +CERT_CHAIN_FIND_BY_ISSUER_LOCAL_MACHINE_FLAG: int +CERT_CHAIN_FIND_BY_ISSUER_NO_KEY_FLAG: int +CERT_CHAIN_FIND_BY_ISSUER_CACHE_ONLY_FLAG: int +CERT_CHAIN_POLICY_IGNORE_NOT_TIME_VALID_FLAG: int +CERT_CHAIN_POLICY_IGNORE_CTL_NOT_TIME_VALID_FLAG: int +CERT_CHAIN_POLICY_IGNORE_NOT_TIME_NESTED_FLAG: int +CERT_CHAIN_POLICY_IGNORE_INVALID_BASIC_CONSTRAINTS_FLAG: int +CERT_CHAIN_POLICY_IGNORE_ALL_NOT_TIME_VALID_FLAGS: int +CERT_CHAIN_POLICY_ALLOW_UNKNOWN_CA_FLAG: int +CERT_CHAIN_POLICY_IGNORE_WRONG_USAGE_FLAG: int +CERT_CHAIN_POLICY_IGNORE_INVALID_NAME_FLAG: int +CERT_CHAIN_POLICY_IGNORE_INVALID_POLICY_FLAG: int +CERT_CHAIN_POLICY_IGNORE_END_REV_UNKNOWN_FLAG: int +CERT_CHAIN_POLICY_IGNORE_CTL_SIGNER_REV_UNKNOWN_FLAG: int +CERT_CHAIN_POLICY_IGNORE_CA_REV_UNKNOWN_FLAG: int +CERT_CHAIN_POLICY_IGNORE_ROOT_REV_UNKNOWN_FLAG: int +CERT_CHAIN_POLICY_IGNORE_ALL_REV_UNKNOWN_FLAGS: int +CERT_CHAIN_POLICY_ALLOW_TESTROOT_FLAG: int +CERT_CHAIN_POLICY_TRUST_TESTROOT_FLAG: int +CRYPT_OID_VERIFY_CERTIFICATE_CHAIN_POLICY_FUNC: str +AUTHTYPE_CLIENT: int +AUTHTYPE_SERVER: int +BASIC_CONSTRAINTS_CERT_CHAIN_POLICY_CA_FLAG: int +BASIC_CONSTRAINTS_CERT_CHAIN_POLICY_END_ENTITY_FLAG: int +MICROSOFT_ROOT_CERT_CHAIN_POLICY_ENABLE_TEST_ROOT_FLAG: int +CRYPT_STRING_BASE64HEADER: int +CRYPT_STRING_BASE64: int +CRYPT_STRING_BINARY: int +CRYPT_STRING_BASE64REQUESTHEADER: int +CRYPT_STRING_HEX: int +CRYPT_STRING_HEXASCII: int +CRYPT_STRING_BASE64_ANY: int +CRYPT_STRING_ANY: int +CRYPT_STRING_HEX_ANY: int +CRYPT_STRING_BASE64X509CRLHEADER: int +CRYPT_STRING_HEXADDR: int +CRYPT_STRING_HEXASCIIADDR: int +CRYPT_STRING_NOCR: int +CRYPT_USER_KEYSET: int +PKCS12_IMPORT_RESERVED_MASK: int +REPORT_NO_PRIVATE_KEY: int +REPORT_NOT_ABLE_TO_EXPORT_PRIVATE_KEY: int +EXPORT_PRIVATE_KEYS: int +PKCS12_EXPORT_RESERVED_MASK: int +CERT_STORE_PROV_MSG: int +CERT_STORE_PROV_MEMORY: int +CERT_STORE_PROV_FILE: int +CERT_STORE_PROV_REG: int +CERT_STORE_PROV_PKCS7: int +CERT_STORE_PROV_SERIALIZED: int +CERT_STORE_PROV_FILENAME: int +CERT_STORE_PROV_SYSTEM: int +CERT_STORE_PROV_COLLECTION: int +CERT_STORE_PROV_SYSTEM_REGISTRY: int +CERT_STORE_PROV_PHYSICAL: int +CERT_STORE_PROV_SMART_CARD: int +CERT_STORE_PROV_LDAP: int +URL_OID_CERTIFICATE_ISSUER: int +URL_OID_CERTIFICATE_CRL_DIST_POINT: int +URL_OID_CTL_ISSUER: int +URL_OID_CTL_NEXT_UPDATE: int +URL_OID_CRL_ISSUER: int +URL_OID_CERTIFICATE_FRESHEST_CRL: int +URL_OID_CRL_FRESHEST_CRL: int +URL_OID_CROSS_CERT_DIST_POINT: int +URL_OID_CERTIFICATE_OCSP: int +URL_OID_CERTIFICATE_OCSP_AND_CRL_DIST_POINT: int +URL_OID_CERTIFICATE_CRL_DIST_POINT_AND_OCSP: int +URL_OID_CROSS_CERT_SUBJECT_INFO_ACCESS: int +URL_OID_CERTIFICATE_ONLY_OCSP: int +CMSG_CTRL_MAIL_LIST_DECRYPT: int +CMSG_MAIL_LIST_ENCRYPT_FREE_PARA_FLAG: int +CMSG_MAIL_LIST_HANDLE_KEY_CHOICE: int +CMSG_MAIL_LIST_RECIPIENT: int +CMSG_MAIL_LIST_VERSION: int +CMSG_OID_EXPORT_MAIL_LIST_FUNC: str +CMSG_OID_IMPORT_MAIL_LIST_FUNC: str +CTL_FIND_NO_LIST_ID_CBDATA: int +szOID_AUTHORITY_REVOCATION_LIST: str +szOID_CERTIFICATE_REVOCATION_LIST: str +szOID_ROOT_LIST_SIGNER: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/win32evtlogutil.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/win32evtlogutil.pyi new file mode 100644 index 000000000..626cab5b1 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/win32evtlogutil.pyi @@ -0,0 +1,24 @@ +from _typeshed import Incomplete +from collections.abc import Iterable + +import _win32typing + +error: Incomplete +langid: Incomplete + +def AddSourceToRegistry( + appName, msgDLL: Incomplete | None = ..., eventLogType: str = ..., eventLogFlags: Incomplete | None = ... +) -> None: ... +def RemoveSourceFromRegistry(appName, eventLogType: str = ...) -> None: ... +def ReportEvent( + appName: str, + eventID: int, + eventCategory: int = ..., + eventType: int = ..., + strings: Iterable[str] | None = ..., + data: bytes | None = ..., + sid: _win32typing.PySID | None = ..., +) -> None: ... +def FormatMessage(eventLogRecord: _win32typing.PyEventLogRecord, logType: str = ...): ... +def SafeFormatMessage(eventLogRecord, logType: Incomplete | None = ...): ... +def FeedEventLogRecords(feeder, machineName: Incomplete | None = ..., logName: str = ..., readFlags: Incomplete | None = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/win32gui_struct.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/win32gui_struct.pyi new file mode 100644 index 000000000..e7f2c24f6 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/win32gui_struct.pyi @@ -0,0 +1,198 @@ +from _typeshed import Incomplete, ReadableBuffer +from array import array +from typing import NamedTuple + +is64bit: bool + +class _WMNOTIFY(NamedTuple): + hwndFrom: Incomplete + idFrom: Incomplete + code: Incomplete + +def UnpackWMNOTIFY(lparam: int) -> _WMNOTIFY: ... + +class _NMITEMACTIVATE(NamedTuple): + hwndFrom: Incomplete + idFrom: Incomplete + code: Incomplete + iItem: Incomplete + iSubItem: Incomplete + uNewState: Incomplete + uOldState: Incomplete + uChanged: Incomplete + actionx: Incomplete + actiony: Incomplete + lParam: Incomplete + +def UnpackNMITEMACTIVATE(lparam) -> _NMITEMACTIVATE: ... +def PackMENUITEMINFO( + fType: Incomplete | None = ..., + fState: Incomplete | None = ..., + wID: Incomplete | None = ..., + hSubMenu: Incomplete | None = ..., + hbmpChecked: Incomplete | None = ..., + hbmpUnchecked: Incomplete | None = ..., + dwItemData: Incomplete | None = ..., + text: Incomplete | None = ..., + hbmpItem: Incomplete | None = ..., + dwTypeData: Incomplete | None = ..., +) -> tuple[array[int], list[Incomplete]]: ... + +class _MENUITEMINFO(NamedTuple): + fType: int | None + fState: int | None + wID: int | None + hSubMenu: int | None + hbmpChecked: int | None + hbmpUnchecked: int | None + dwItemData: int | None + text: str | None + hbmpItem: int | None + +def UnpackMENUITEMINFO(s: ReadableBuffer) -> _MENUITEMINFO: ... +def EmptyMENUITEMINFO(mask: Incomplete | None = ..., text_buf_size: int = ...) -> tuple[array[int], list[array[int]]]: ... +def PackMENUINFO( + dwStyle: Incomplete | None = ..., + cyMax: Incomplete | None = ..., + hbrBack: Incomplete | None = ..., + dwContextHelpID: Incomplete | None = ..., + dwMenuData: Incomplete | None = ..., + fMask: int = ..., +) -> array[int]: ... + +class _MENUINFO(NamedTuple): + dwStyle: Incomplete | None + cyMax: Incomplete | None + hbrBack: Incomplete | None + dwContextHelpID: Incomplete | None + dwMenuData: Incomplete | None + +def UnpackMENUINFO(s: ReadableBuffer) -> _MENUINFO: ... +def EmptyMENUINFO(mask: Incomplete | None = ...) -> array[int]: ... +def PackTVINSERTSTRUCT(parent, insertAfter, tvitem) -> tuple[bytes, list[Incomplete]]: ... +def PackTVITEM(hitem, state, stateMask, text, image, selimage, citems, param) -> tuple[array[int], list[Incomplete]]: ... +def EmptyTVITEM(hitem, mask: Incomplete | None = ..., text_buf_size: int = ...) -> tuple[array[int], list[Incomplete]]: ... + +class _TVITEM(NamedTuple): + item_hItem: Incomplete + item_state: Incomplete | None + item_stateMask: Incomplete | None + text: Incomplete | None + item_image: Incomplete | None + item_selimage: Incomplete | None + item_cChildren: Incomplete | None + item_param: Incomplete | None + +def UnpackTVITEM(buffer: ReadableBuffer) -> _TVITEM: ... + +class _TVNOTIFY(NamedTuple): + hwndFrom: Incomplete + id: Incomplete + code: Incomplete + action: Incomplete + item_old: _TVITEM + item_new: _TVITEM + +def UnpackTVNOTIFY(lparam: int) -> _TVNOTIFY: ... + +class _TVDISPINFO(NamedTuple): + hwndFrom: Incomplete + id: Incomplete + code: Incomplete + item: _TVITEM + +def UnpackTVDISPINFO(lparam: int) -> _TVDISPINFO: ... +def PackLVITEM( + item: Incomplete | None = ..., + subItem: Incomplete | None = ..., + state: Incomplete | None = ..., + stateMask: Incomplete | None = ..., + text: Incomplete | None = ..., + image: Incomplete | None = ..., + param: Incomplete | None = ..., + indent: Incomplete | None = ..., +) -> tuple[array[int], list[Incomplete]]: ... + +class _LVITEM(NamedTuple): + item_item: Incomplete + item_subItem: Incomplete + item_state: Incomplete | None + item_stateMask: Incomplete | None + text: Incomplete | None + item_image: Incomplete | None + item_param: Incomplete | None + item_indent: Incomplete | None + +def UnpackLVITEM(buffer: ReadableBuffer) -> _LVITEM: ... + +class _LVDISPINFO(NamedTuple): + hwndFrom: Incomplete + id: Incomplete + code: Incomplete + item: _LVITEM + +def UnpackLVDISPINFO(lparam: int) -> _LVDISPINFO: ... + +class _UnpackLVNOTIFY(NamedTuple): + hwndFrom: Incomplete + id: Incomplete + code: Incomplete + item: Incomplete + subitem: Incomplete + newstate: Incomplete + oldstate: Incomplete + changed: Incomplete + pt: tuple[Incomplete, Incomplete] + lparam: Incomplete + +def UnpackLVNOTIFY(lparam: int) -> _UnpackLVNOTIFY: ... +def EmptyLVITEM( + item, subitem, mask: Incomplete | None = ..., text_buf_size: int = ... +) -> tuple[array[int], list[Incomplete]]: ... +def PackLVCOLUMN( + fmt: Incomplete | None = ..., + cx: Incomplete | None = ..., + text: Incomplete | None = ..., + subItem: Incomplete | None = ..., + image: Incomplete | None = ..., + order: Incomplete | None = ..., +) -> tuple[array[int], list[Incomplete]]: ... + +class _LVCOLUMN(NamedTuple): + fmt: Incomplete | None + cx: Incomplete | None + text: Incomplete | None + subItem: Incomplete | None + image: Incomplete | None + order: Incomplete | None + +def UnpackLVCOLUMN(lparam: ReadableBuffer) -> _LVCOLUMN: ... +def EmptyLVCOLUMN(mask: Incomplete | None = ..., text_buf_size: int = ...) -> tuple[array[int], list[Incomplete]]: ... +def PackLVHITTEST(pt) -> tuple[array[int], None]: ... + +class _LVHITTEST(NamedTuple): + pt: tuple[Incomplete, Incomplete] + flags: Incomplete + item: Incomplete + subitem: Incomplete + +def UnpackLVHITTEST(buf: ReadableBuffer) -> tuple[tuple[Incomplete, Incomplete], Incomplete, Incomplete, Incomplete]: ... +def PackHDITEM( + cxy: Incomplete | None = ..., + text: Incomplete | None = ..., + hbm: Incomplete | None = ..., + fmt: Incomplete | None = ..., + param: Incomplete | None = ..., + image: Incomplete | None = ..., + order: Incomplete | None = ..., +) -> tuple[array[int], list[Incomplete]]: ... +def PackDEV_BROADCAST(devicetype, rest_fmt, rest_data, extra_data=...) -> bytes: ... +def PackDEV_BROADCAST_HANDLE(handle, hdevnotify: int = ..., guid=..., name_offset: int = ..., data=...) -> bytes: ... +def PackDEV_BROADCAST_VOLUME(unitmask, flags) -> bytes: ... +def PackDEV_BROADCAST_DEVICEINTERFACE(classguid, name: str = ...) -> bytes: ... + +class DEV_BROADCAST_INFO: + devicetype: Incomplete + def __init__(self, devicetype, **kw) -> None: ... + +def UnpackDEV_BROADCAST(lparam: int) -> DEV_BROADCAST_INFO | None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/win32inetcon.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/win32inetcon.pyi new file mode 100644 index 000000000..10e562a2c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/win32inetcon.pyi @@ -0,0 +1,989 @@ +INTERNET_INVALID_PORT_NUMBER: int +INTERNET_DEFAULT_FTP_PORT: int +INTERNET_DEFAULT_GOPHER_PORT: int +INTERNET_DEFAULT_HTTP_PORT: int +INTERNET_DEFAULT_HTTPS_PORT: int +INTERNET_DEFAULT_SOCKS_PORT: int +INTERNET_MAX_HOST_NAME_LENGTH: int +INTERNET_MAX_USER_NAME_LENGTH: int +INTERNET_MAX_PASSWORD_LENGTH: int +INTERNET_MAX_PORT_NUMBER_LENGTH: int +INTERNET_MAX_PORT_NUMBER_VALUE: int +INTERNET_MAX_PATH_LENGTH: int +INTERNET_MAX_SCHEME_LENGTH: int +INTERNET_KEEP_ALIVE_ENABLED: int +INTERNET_KEEP_ALIVE_DISABLED: int +INTERNET_REQFLAG_FROM_CACHE: int +INTERNET_REQFLAG_ASYNC: int +INTERNET_REQFLAG_VIA_PROXY: int +INTERNET_REQFLAG_NO_HEADERS: int +INTERNET_REQFLAG_PASSIVE: int +INTERNET_REQFLAG_CACHE_WRITE_DISABLED: int +INTERNET_REQFLAG_NET_TIMEOUT: int +INTERNET_FLAG_RELOAD: int +INTERNET_FLAG_RAW_DATA: int +INTERNET_FLAG_EXISTING_CONNECT: int +INTERNET_FLAG_ASYNC: int +INTERNET_FLAG_PASSIVE: int +INTERNET_FLAG_NO_CACHE_WRITE: int +INTERNET_FLAG_DONT_CACHE: int +INTERNET_FLAG_MAKE_PERSISTENT: int +INTERNET_FLAG_FROM_CACHE: int +INTERNET_FLAG_OFFLINE: int +INTERNET_FLAG_SECURE: int +INTERNET_FLAG_KEEP_CONNECTION: int +INTERNET_FLAG_NO_AUTO_REDIRECT: int +INTERNET_FLAG_READ_PREFETCH: int +INTERNET_FLAG_NO_COOKIES: int +INTERNET_FLAG_NO_AUTH: int +INTERNET_FLAG_RESTRICTED_ZONE: int +INTERNET_FLAG_CACHE_IF_NET_FAIL: int +INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP: int +INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS: int +INTERNET_FLAG_IGNORE_CERT_DATE_INVALID: int +INTERNET_FLAG_IGNORE_CERT_CN_INVALID: int +INTERNET_FLAG_RESYNCHRONIZE: int +INTERNET_FLAG_HYPERLINK: int +INTERNET_FLAG_NO_UI: int +INTERNET_FLAG_PRAGMA_NOCACHE: int +INTERNET_FLAG_CACHE_ASYNC: int +INTERNET_FLAG_FORMS_SUBMIT: int +INTERNET_FLAG_FWD_BACK: int +INTERNET_FLAG_NEED_FILE: int +INTERNET_FLAG_MUST_CACHE_REQUEST: int +SECURITY_INTERNET_MASK: int +INTERNET_ERROR_MASK_INSERT_CDROM: int +INTERNET_ERROR_MASK_COMBINED_SEC_CERT: int +INTERNET_ERROR_MASK_NEED_MSN_SSPI_PKG: int +INTERNET_ERROR_MASK_LOGIN_FAILURE_DISPLAY_ENTITY_BODY: int +WININET_API_FLAG_ASYNC: int +WININET_API_FLAG_SYNC: int +WININET_API_FLAG_USE_CONTEXT: int +INTERNET_NO_CALLBACK: int +IDSI_FLAG_KEEP_ALIVE: int +IDSI_FLAG_SECURE: int +IDSI_FLAG_PROXY: int +IDSI_FLAG_TUNNEL: int +INTERNET_PER_CONN_FLAGS: int +INTERNET_PER_CONN_PROXY_SERVER: int +INTERNET_PER_CONN_PROXY_BYPASS: int +INTERNET_PER_CONN_AUTOCONFIG_URL: int +INTERNET_PER_CONN_AUTODISCOVERY_FLAGS: int +INTERNET_PER_CONN_AUTOCONFIG_SECONDARY_URL: int +INTERNET_PER_CONN_AUTOCONFIG_RELOAD_DELAY_MINS: int +INTERNET_PER_CONN_AUTOCONFIG_LAST_DETECT_TIME: int +INTERNET_PER_CONN_AUTOCONFIG_LAST_DETECT_URL: int +PROXY_TYPE_DIRECT: int +PROXY_TYPE_PROXY: int +PROXY_TYPE_AUTO_PROXY_URL: int +PROXY_TYPE_AUTO_DETECT: int +AUTO_PROXY_FLAG_USER_SET: int +AUTO_PROXY_FLAG_ALWAYS_DETECT: int +AUTO_PROXY_FLAG_DETECTION_RUN: int +AUTO_PROXY_FLAG_MIGRATED: int +AUTO_PROXY_FLAG_DONT_CACHE_PROXY_RESULT: int +AUTO_PROXY_FLAG_CACHE_INIT_RUN: int +AUTO_PROXY_FLAG_DETECTION_SUSPECT: int +ISO_FORCE_DISCONNECTED: int +INTERNET_RFC1123_FORMAT: int +INTERNET_RFC1123_BUFSIZE: int +ICU_ESCAPE: int +ICU_USERNAME: int +ICU_NO_ENCODE: int +ICU_DECODE: int +ICU_NO_META: int +ICU_ENCODE_SPACES_ONLY: int +ICU_BROWSER_MODE: int +ICU_ENCODE_PERCENT: int +INTERNET_OPEN_TYPE_PRECONFIG: int +INTERNET_OPEN_TYPE_DIRECT: int +INTERNET_OPEN_TYPE_PROXY: int +INTERNET_OPEN_TYPE_PRECONFIG_WITH_NO_AUTOPROXY: int +PRE_CONFIG_INTERNET_ACCESS: int +LOCAL_INTERNET_ACCESS: int +CERN_PROXY_INTERNET_ACCESS: int +INTERNET_SERVICE_FTP: int +INTERNET_SERVICE_GOPHER: int +INTERNET_SERVICE_HTTP: int +IRF_ASYNC: int +IRF_SYNC: int +IRF_USE_CONTEXT: int +IRF_NO_WAIT: int +ISO_GLOBAL: int +ISO_REGISTRY: int +ISO_VALID_FLAGS: int +INTERNET_OPTION_CALLBACK: int +INTERNET_OPTION_CONNECT_TIMEOUT: int +INTERNET_OPTION_CONNECT_RETRIES: int +INTERNET_OPTION_CONNECT_BACKOFF: int +INTERNET_OPTION_SEND_TIMEOUT: int +INTERNET_OPTION_CONTROL_SEND_TIMEOUT: int +INTERNET_OPTION_RECEIVE_TIMEOUT: int +INTERNET_OPTION_CONTROL_RECEIVE_TIMEOUT: int +INTERNET_OPTION_DATA_SEND_TIMEOUT: int +INTERNET_OPTION_DATA_RECEIVE_TIMEOUT: int +INTERNET_OPTION_HANDLE_TYPE: int +INTERNET_OPTION_READ_BUFFER_SIZE: int +INTERNET_OPTION_WRITE_BUFFER_SIZE: int +INTERNET_OPTION_ASYNC_ID: int +INTERNET_OPTION_ASYNC_PRIORITY: int +INTERNET_OPTION_PARENT_HANDLE: int +INTERNET_OPTION_KEEP_CONNECTION: int +INTERNET_OPTION_REQUEST_FLAGS: int +INTERNET_OPTION_EXTENDED_ERROR: int +INTERNET_OPTION_OFFLINE_MODE: int +INTERNET_OPTION_CACHE_STREAM_HANDLE: int +INTERNET_OPTION_USERNAME: int +INTERNET_OPTION_PASSWORD: int +INTERNET_OPTION_ASYNC: int +INTERNET_OPTION_SECURITY_FLAGS: int +INTERNET_OPTION_SECURITY_CERTIFICATE_STRUCT: int +INTERNET_OPTION_DATAFILE_NAME: int +INTERNET_OPTION_URL: int +INTERNET_OPTION_SECURITY_CERTIFICATE: int +INTERNET_OPTION_SECURITY_KEY_BITNESS: int +INTERNET_OPTION_REFRESH: int +INTERNET_OPTION_PROXY: int +INTERNET_OPTION_SETTINGS_CHANGED: int +INTERNET_OPTION_VERSION: int +INTERNET_OPTION_USER_AGENT: int +INTERNET_OPTION_END_BROWSER_SESSION: int +INTERNET_OPTION_PROXY_USERNAME: int +INTERNET_OPTION_PROXY_PASSWORD: int +INTERNET_OPTION_CONTEXT_VALUE: int +INTERNET_OPTION_CONNECT_LIMIT: int +INTERNET_OPTION_SECURITY_SELECT_CLIENT_CERT: int +INTERNET_OPTION_POLICY: int +INTERNET_OPTION_DISCONNECTED_TIMEOUT: int +INTERNET_OPTION_CONNECTED_STATE: int +INTERNET_OPTION_IDLE_STATE: int +INTERNET_OPTION_OFFLINE_SEMANTICS: int +INTERNET_OPTION_SECONDARY_CACHE_KEY: int +INTERNET_OPTION_CALLBACK_FILTER: int +INTERNET_OPTION_CONNECT_TIME: int +INTERNET_OPTION_SEND_THROUGHPUT: int +INTERNET_OPTION_RECEIVE_THROUGHPUT: int +INTERNET_OPTION_REQUEST_PRIORITY: int +INTERNET_OPTION_HTTP_VERSION: int +INTERNET_OPTION_RESET_URLCACHE_SESSION: int +INTERNET_OPTION_ERROR_MASK: int +INTERNET_OPTION_FROM_CACHE_TIMEOUT: int +INTERNET_OPTION_BYPASS_EDITED_ENTRY: int +INTERNET_OPTION_DIAGNOSTIC_SOCKET_INFO: int +INTERNET_OPTION_CODEPAGE: int +INTERNET_OPTION_CACHE_TIMESTAMPS: int +INTERNET_OPTION_DISABLE_AUTODIAL: int +INTERNET_OPTION_MAX_CONNS_PER_SERVER: int +INTERNET_OPTION_MAX_CONNS_PER_1_0_SERVER: int +INTERNET_OPTION_PER_CONNECTION_OPTION: int +INTERNET_OPTION_DIGEST_AUTH_UNLOAD: int +INTERNET_OPTION_IGNORE_OFFLINE: int +INTERNET_OPTION_IDENTITY: int +INTERNET_OPTION_REMOVE_IDENTITY: int +INTERNET_OPTION_ALTER_IDENTITY: int +INTERNET_OPTION_SUPPRESS_BEHAVIOR: int +INTERNET_OPTION_AUTODIAL_MODE: int +INTERNET_OPTION_AUTODIAL_CONNECTION: int +INTERNET_OPTION_CLIENT_CERT_CONTEXT: int +INTERNET_OPTION_AUTH_FLAGS: int +INTERNET_OPTION_COOKIES_3RD_PARTY: int +INTERNET_OPTION_DISABLE_PASSPORT_AUTH: int +INTERNET_OPTION_SEND_UTF8_SERVERNAME_TO_PROXY: int +INTERNET_OPTION_EXEMPT_CONNECTION_LIMIT: int +INTERNET_OPTION_ENABLE_PASSPORT_AUTH: int +INTERNET_OPTION_HIBERNATE_INACTIVE_WORKER_THREADS: int +INTERNET_OPTION_ACTIVATE_WORKER_THREADS: int +INTERNET_OPTION_RESTORE_WORKER_THREAD_DEFAULTS: int +INTERNET_OPTION_SOCKET_SEND_BUFFER_LENGTH: int +INTERNET_OPTION_PROXY_SETTINGS_CHANGED: int +INTERNET_FIRST_OPTION: int +INTERNET_LAST_OPTION: int +INTERNET_PRIORITY_FOREGROUND: int +INTERNET_HANDLE_TYPE_INTERNET: int +INTERNET_HANDLE_TYPE_CONNECT_FTP: int +INTERNET_HANDLE_TYPE_CONNECT_GOPHER: int +INTERNET_HANDLE_TYPE_CONNECT_HTTP: int +INTERNET_HANDLE_TYPE_FTP_FIND: int +INTERNET_HANDLE_TYPE_FTP_FIND_HTML: int +INTERNET_HANDLE_TYPE_FTP_FILE: int +INTERNET_HANDLE_TYPE_FTP_FILE_HTML: int +INTERNET_HANDLE_TYPE_GOPHER_FIND: int +INTERNET_HANDLE_TYPE_GOPHER_FIND_HTML: int +INTERNET_HANDLE_TYPE_GOPHER_FILE: int +INTERNET_HANDLE_TYPE_GOPHER_FILE_HTML: int +INTERNET_HANDLE_TYPE_HTTP_REQUEST: int +INTERNET_HANDLE_TYPE_FILE_REQUEST: int +AUTH_FLAG_DISABLE_NEGOTIATE: int +AUTH_FLAG_ENABLE_NEGOTIATE: int +SECURITY_FLAG_SECURE: int +SECURITY_FLAG_STRENGTH_WEAK: int +SECURITY_FLAG_STRENGTH_MEDIUM: int +SECURITY_FLAG_STRENGTH_STRONG: int +SECURITY_FLAG_UNKNOWNBIT: int +SECURITY_FLAG_FORTEZZA: int +SECURITY_FLAG_NORMALBITNESS: int +SECURITY_FLAG_SSL: int +SECURITY_FLAG_SSL3: int +SECURITY_FLAG_PCT: int +SECURITY_FLAG_PCT4: int +SECURITY_FLAG_IETFSSL4: int +SECURITY_FLAG_40BIT: int +SECURITY_FLAG_128BIT: int +SECURITY_FLAG_56BIT: int +SECURITY_FLAG_IGNORE_REVOCATION: int +SECURITY_FLAG_IGNORE_UNKNOWN_CA: int +SECURITY_FLAG_IGNORE_WRONG_USAGE: int +SECURITY_FLAG_IGNORE_CERT_CN_INVALID: int +SECURITY_FLAG_IGNORE_CERT_DATE_INVALID: int +SECURITY_FLAG_IGNORE_REDIRECT_TO_HTTPS: int +SECURITY_FLAG_IGNORE_REDIRECT_TO_HTTP: int +SECURITY_SET_MASK: int +AUTODIAL_MODE_NEVER: int +AUTODIAL_MODE_ALWAYS: int +AUTODIAL_MODE_NO_NETWORK_PRESENT: int +INTERNET_STATUS_RESOLVING_NAME: int +INTERNET_STATUS_NAME_RESOLVED: int +INTERNET_STATUS_CONNECTING_TO_SERVER: int +INTERNET_STATUS_CONNECTED_TO_SERVER: int +INTERNET_STATUS_SENDING_REQUEST: int +INTERNET_STATUS_REQUEST_SENT: int +INTERNET_STATUS_RECEIVING_RESPONSE: int +INTERNET_STATUS_RESPONSE_RECEIVED: int +INTERNET_STATUS_CTL_RESPONSE_RECEIVED: int +INTERNET_STATUS_PREFETCH: int +INTERNET_STATUS_CLOSING_CONNECTION: int +INTERNET_STATUS_CONNECTION_CLOSED: int +INTERNET_STATUS_HANDLE_CREATED: int +INTERNET_STATUS_HANDLE_CLOSING: int +INTERNET_STATUS_DETECTING_PROXY: int +INTERNET_STATUS_REQUEST_COMPLETE: int +INTERNET_STATUS_REDIRECT: int +INTERNET_STATUS_INTERMEDIATE_RESPONSE: int +INTERNET_STATUS_USER_INPUT_REQUIRED: int +INTERNET_STATUS_STATE_CHANGE: int +INTERNET_STATUS_COOKIE_SENT: int +INTERNET_STATUS_COOKIE_RECEIVED: int +INTERNET_STATUS_PRIVACY_IMPACTED: int +INTERNET_STATUS_P3P_HEADER: int +INTERNET_STATUS_P3P_POLICYREF: int +INTERNET_STATUS_COOKIE_HISTORY: int +INTERNET_STATE_CONNECTED: int +INTERNET_STATE_DISCONNECTED: int +INTERNET_STATE_DISCONNECTED_BY_USER: int +INTERNET_STATE_IDLE: int +INTERNET_STATE_BUSY: int +FTP_TRANSFER_TYPE_UNKNOWN: int +FTP_TRANSFER_TYPE_ASCII: int +FTP_TRANSFER_TYPE_BINARY: int +FTP_TRANSFER_TYPE_MASK: int +MAX_GOPHER_DISPLAY_TEXT: int +MAX_GOPHER_SELECTOR_TEXT: int +MAX_GOPHER_HOST_NAME: int +MAX_GOPHER_LOCATOR_LENGTH: int +GOPHER_TYPE_TEXT_FILE: int +GOPHER_TYPE_DIRECTORY: int +GOPHER_TYPE_CSO: int +GOPHER_TYPE_ERROR: int +GOPHER_TYPE_MAC_BINHEX: int +GOPHER_TYPE_DOS_ARCHIVE: int +GOPHER_TYPE_UNIX_UUENCODED: int +GOPHER_TYPE_INDEX_SERVER: int +GOPHER_TYPE_TELNET: int +GOPHER_TYPE_BINARY: int +GOPHER_TYPE_REDUNDANT: int +GOPHER_TYPE_TN3270: int +GOPHER_TYPE_GIF: int +GOPHER_TYPE_IMAGE: int +GOPHER_TYPE_BITMAP: int +GOPHER_TYPE_MOVIE: int +GOPHER_TYPE_SOUND: int +GOPHER_TYPE_HTML: int +GOPHER_TYPE_PDF: int +GOPHER_TYPE_CALENDAR: int +GOPHER_TYPE_INLINE: int +GOPHER_TYPE_UNKNOWN: int +GOPHER_TYPE_ASK: int +GOPHER_TYPE_GOPHER_PLUS: int +GOPHER_TYPE_FILE_MASK: int +MAX_GOPHER_CATEGORY_NAME: int +MAX_GOPHER_ATTRIBUTE_NAME: int +MIN_GOPHER_ATTRIBUTE_LENGTH: int +GOPHER_ATTRIBUTE_ID_BASE: int +GOPHER_CATEGORY_ID_ALL: int +GOPHER_CATEGORY_ID_INFO: int +GOPHER_CATEGORY_ID_ADMIN: int +GOPHER_CATEGORY_ID_VIEWS: int +GOPHER_CATEGORY_ID_ABSTRACT: int +GOPHER_CATEGORY_ID_VERONICA: int +GOPHER_CATEGORY_ID_ASK: int +GOPHER_CATEGORY_ID_UNKNOWN: int +GOPHER_ATTRIBUTE_ID_ALL: int +GOPHER_ATTRIBUTE_ID_ADMIN: int +GOPHER_ATTRIBUTE_ID_MOD_DATE: int +GOPHER_ATTRIBUTE_ID_TTL: int +GOPHER_ATTRIBUTE_ID_SCORE: int +GOPHER_ATTRIBUTE_ID_RANGE: int +GOPHER_ATTRIBUTE_ID_SITE: int +GOPHER_ATTRIBUTE_ID_ORG: int +GOPHER_ATTRIBUTE_ID_LOCATION: int +GOPHER_ATTRIBUTE_ID_GEOG: int +GOPHER_ATTRIBUTE_ID_TIMEZONE: int +GOPHER_ATTRIBUTE_ID_PROVIDER: int +GOPHER_ATTRIBUTE_ID_VERSION: int +GOPHER_ATTRIBUTE_ID_ABSTRACT: int +GOPHER_ATTRIBUTE_ID_VIEW: int +GOPHER_ATTRIBUTE_ID_TREEWALK: int +GOPHER_ATTRIBUTE_ID_UNKNOWN: int +HTTP_MAJOR_VERSION: int +HTTP_MINOR_VERSION: int +HTTP_VERSIONA: str +HTTP_VERSION: str +HTTP_QUERY_MIME_VERSION: int +HTTP_QUERY_CONTENT_TYPE: int +HTTP_QUERY_CONTENT_TRANSFER_ENCODING: int +HTTP_QUERY_CONTENT_ID: int +HTTP_QUERY_CONTENT_DESCRIPTION: int +HTTP_QUERY_CONTENT_LENGTH: int +HTTP_QUERY_CONTENT_LANGUAGE: int +HTTP_QUERY_ALLOW: int +HTTP_QUERY_PUBLIC: int +HTTP_QUERY_DATE: int +HTTP_QUERY_EXPIRES: int +HTTP_QUERY_LAST_MODIFIED: int +HTTP_QUERY_MESSAGE_ID: int +HTTP_QUERY_URI: int +HTTP_QUERY_DERIVED_FROM: int +HTTP_QUERY_COST: int +HTTP_QUERY_LINK: int +HTTP_QUERY_PRAGMA: int +HTTP_QUERY_VERSION: int +HTTP_QUERY_STATUS_CODE: int +HTTP_QUERY_STATUS_TEXT: int +HTTP_QUERY_RAW_HEADERS: int +HTTP_QUERY_RAW_HEADERS_CRLF: int +HTTP_QUERY_CONNECTION: int +HTTP_QUERY_ACCEPT: int +HTTP_QUERY_ACCEPT_CHARSET: int +HTTP_QUERY_ACCEPT_ENCODING: int +HTTP_QUERY_ACCEPT_LANGUAGE: int +HTTP_QUERY_AUTHORIZATION: int +HTTP_QUERY_CONTENT_ENCODING: int +HTTP_QUERY_FORWARDED: int +HTTP_QUERY_FROM: int +HTTP_QUERY_IF_MODIFIED_SINCE: int +HTTP_QUERY_LOCATION: int +HTTP_QUERY_ORIG_URI: int +HTTP_QUERY_REFERER: int +HTTP_QUERY_RETRY_AFTER: int +HTTP_QUERY_SERVER: int +HTTP_QUERY_TITLE: int +HTTP_QUERY_USER_AGENT: int +HTTP_QUERY_WWW_AUTHENTICATE: int +HTTP_QUERY_PROXY_AUTHENTICATE: int +HTTP_QUERY_ACCEPT_RANGES: int +HTTP_QUERY_SET_COOKIE: int +HTTP_QUERY_COOKIE: int +HTTP_QUERY_REQUEST_METHOD: int +HTTP_QUERY_REFRESH: int +HTTP_QUERY_CONTENT_DISPOSITION: int +HTTP_QUERY_AGE: int +HTTP_QUERY_CACHE_CONTROL: int +HTTP_QUERY_CONTENT_BASE: int +HTTP_QUERY_CONTENT_LOCATION: int +HTTP_QUERY_CONTENT_MD5: int +HTTP_QUERY_CONTENT_RANGE: int +HTTP_QUERY_ETAG: int +HTTP_QUERY_HOST: int +HTTP_QUERY_IF_MATCH: int +HTTP_QUERY_IF_NONE_MATCH: int +HTTP_QUERY_IF_RANGE: int +HTTP_QUERY_IF_UNMODIFIED_SINCE: int +HTTP_QUERY_MAX_FORWARDS: int +HTTP_QUERY_PROXY_AUTHORIZATION: int +HTTP_QUERY_RANGE: int +HTTP_QUERY_TRANSFER_ENCODING: int +HTTP_QUERY_UPGRADE: int +HTTP_QUERY_VARY: int +HTTP_QUERY_VIA: int +HTTP_QUERY_WARNING: int +HTTP_QUERY_EXPECT: int +HTTP_QUERY_PROXY_CONNECTION: int +HTTP_QUERY_UNLESS_MODIFIED_SINCE: int +HTTP_QUERY_ECHO_REQUEST: int +HTTP_QUERY_ECHO_REPLY: int +HTTP_QUERY_ECHO_HEADERS: int +HTTP_QUERY_ECHO_HEADERS_CRLF: int +HTTP_QUERY_PROXY_SUPPORT: int +HTTP_QUERY_AUTHENTICATION_INFO: int +HTTP_QUERY_PASSPORT_URLS: int +HTTP_QUERY_PASSPORT_CONFIG: int +HTTP_QUERY_MAX: int +HTTP_QUERY_CUSTOM: int +HTTP_QUERY_FLAG_REQUEST_HEADERS: int +HTTP_QUERY_FLAG_SYSTEMTIME: int +HTTP_QUERY_FLAG_NUMBER: int +HTTP_QUERY_FLAG_COALESCE: int +HTTP_QUERY_MODIFIER_FLAGS_MASK: int +HTTP_QUERY_HEADER_MASK: int +HTTP_STATUS_CONTINUE: int +HTTP_STATUS_SWITCH_PROTOCOLS: int +HTTP_STATUS_OK: int +HTTP_STATUS_CREATED: int +HTTP_STATUS_ACCEPTED: int +HTTP_STATUS_PARTIAL: int +HTTP_STATUS_NO_CONTENT: int +HTTP_STATUS_RESET_CONTENT: int +HTTP_STATUS_PARTIAL_CONTENT: int +HTTP_STATUS_AMBIGUOUS: int +HTTP_STATUS_MOVED: int +HTTP_STATUS_REDIRECT: int +HTTP_STATUS_REDIRECT_METHOD: int +HTTP_STATUS_NOT_MODIFIED: int +HTTP_STATUS_USE_PROXY: int +HTTP_STATUS_REDIRECT_KEEP_VERB: int +HTTP_STATUS_BAD_REQUEST: int +HTTP_STATUS_DENIED: int +HTTP_STATUS_PAYMENT_REQ: int +HTTP_STATUS_FORBIDDEN: int +HTTP_STATUS_NOT_FOUND: int +HTTP_STATUS_BAD_METHOD: int +HTTP_STATUS_NONE_ACCEPTABLE: int +HTTP_STATUS_PROXY_AUTH_REQ: int +HTTP_STATUS_REQUEST_TIMEOUT: int +HTTP_STATUS_CONFLICT: int +HTTP_STATUS_GONE: int +HTTP_STATUS_LENGTH_REQUIRED: int +HTTP_STATUS_PRECOND_FAILED: int +HTTP_STATUS_REQUEST_TOO_LARGE: int +HTTP_STATUS_URI_TOO_LONG: int +HTTP_STATUS_UNSUPPORTED_MEDIA: int +HTTP_STATUS_RETRY_WITH: int +HTTP_STATUS_SERVER_ERROR: int +HTTP_STATUS_NOT_SUPPORTED: int +HTTP_STATUS_BAD_GATEWAY: int +HTTP_STATUS_SERVICE_UNAVAIL: int +HTTP_STATUS_GATEWAY_TIMEOUT: int +HTTP_STATUS_VERSION_NOT_SUP: int +HTTP_STATUS_FIRST: int +HTTP_STATUS_LAST: int +HTTP_ADDREQ_INDEX_MASK: int +HTTP_ADDREQ_FLAGS_MASK: int +HTTP_ADDREQ_FLAG_ADD_IF_NEW: int +HTTP_ADDREQ_FLAG_ADD: int +HTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA: int +HTTP_ADDREQ_FLAG_COALESCE_WITH_SEMICOLON: int +HTTP_ADDREQ_FLAG_COALESCE: int +HTTP_ADDREQ_FLAG_REPLACE: int +HSR_ASYNC: int +HSR_SYNC: int +HSR_USE_CONTEXT: int +HSR_INITIATE: int +HSR_DOWNLOAD: int +HSR_CHUNKED: int +INTERNET_COOKIE_IS_SECURE: int +INTERNET_COOKIE_IS_SESSION: int +INTERNET_COOKIE_THIRD_PARTY: int +INTERNET_COOKIE_PROMPT_REQUIRED: int +INTERNET_COOKIE_EVALUATE_P3P: int +INTERNET_COOKIE_APPLY_P3P: int +INTERNET_COOKIE_P3P_ENABLED: int +INTERNET_COOKIE_IS_RESTRICTED: int +INTERNET_COOKIE_IE6: int +INTERNET_COOKIE_IS_LEGACY: int +FLAG_ICC_FORCE_CONNECTION: int +FLAGS_ERROR_UI_FILTER_FOR_ERRORS: int +FLAGS_ERROR_UI_FLAGS_CHANGE_OPTIONS: int +FLAGS_ERROR_UI_FLAGS_GENERATE_DATA: int +FLAGS_ERROR_UI_FLAGS_NO_UI: int +FLAGS_ERROR_UI_SERIALIZE_DIALOGS: int +INTERNET_ERROR_BASE: int +ERROR_INTERNET_OUT_OF_HANDLES: int +ERROR_INTERNET_TIMEOUT: int +ERROR_INTERNET_EXTENDED_ERROR: int +ERROR_INTERNET_INTERNAL_ERROR: int +ERROR_INTERNET_INVALID_URL: int +ERROR_INTERNET_UNRECOGNIZED_SCHEME: int +ERROR_INTERNET_NAME_NOT_RESOLVED: int +ERROR_INTERNET_PROTOCOL_NOT_FOUND: int +ERROR_INTERNET_INVALID_OPTION: int +ERROR_INTERNET_BAD_OPTION_LENGTH: int +ERROR_INTERNET_OPTION_NOT_SETTABLE: int +ERROR_INTERNET_SHUTDOWN: int +ERROR_INTERNET_INCORRECT_USER_NAME: int +ERROR_INTERNET_INCORRECT_PASSWORD: int +ERROR_INTERNET_LOGIN_FAILURE: int +ERROR_INTERNET_INVALID_OPERATION: int +ERROR_INTERNET_OPERATION_CANCELLED: int +ERROR_INTERNET_INCORRECT_HANDLE_TYPE: int +ERROR_INTERNET_INCORRECT_HANDLE_STATE: int +ERROR_INTERNET_NOT_PROXY_REQUEST: int +ERROR_INTERNET_REGISTRY_VALUE_NOT_FOUND: int +ERROR_INTERNET_BAD_REGISTRY_PARAMETER: int +ERROR_INTERNET_NO_DIRECT_ACCESS: int +ERROR_INTERNET_NO_CONTEXT: int +ERROR_INTERNET_NO_CALLBACK: int +ERROR_INTERNET_REQUEST_PENDING: int +ERROR_INTERNET_INCORRECT_FORMAT: int +ERROR_INTERNET_ITEM_NOT_FOUND: int +ERROR_INTERNET_CANNOT_CONNECT: int +ERROR_INTERNET_CONNECTION_ABORTED: int +ERROR_INTERNET_CONNECTION_RESET: int +ERROR_INTERNET_FORCE_RETRY: int +ERROR_INTERNET_INVALID_PROXY_REQUEST: int +ERROR_INTERNET_NEED_UI: int +ERROR_INTERNET_HANDLE_EXISTS: int +ERROR_INTERNET_SEC_CERT_DATE_INVALID: int +ERROR_INTERNET_SEC_CERT_CN_INVALID: int +ERROR_INTERNET_HTTP_TO_HTTPS_ON_REDIR: int +ERROR_INTERNET_HTTPS_TO_HTTP_ON_REDIR: int +ERROR_INTERNET_MIXED_SECURITY: int +ERROR_INTERNET_CHG_POST_IS_NON_SECURE: int +ERROR_INTERNET_POST_IS_NON_SECURE: int +ERROR_INTERNET_CLIENT_AUTH_CERT_NEEDED: int +ERROR_INTERNET_INVALID_CA: int +ERROR_INTERNET_CLIENT_AUTH_NOT_SETUP: int +ERROR_INTERNET_ASYNC_THREAD_FAILED: int +ERROR_INTERNET_REDIRECT_SCHEME_CHANGE: int +ERROR_INTERNET_DIALOG_PENDING: int +ERROR_INTERNET_RETRY_DIALOG: int +ERROR_INTERNET_HTTPS_HTTP_SUBMIT_REDIR: int +ERROR_INTERNET_INSERT_CDROM: int +ERROR_INTERNET_FORTEZZA_LOGIN_NEEDED: int +ERROR_INTERNET_SEC_CERT_ERRORS: int +ERROR_INTERNET_SEC_CERT_NO_REV: int +ERROR_INTERNET_SEC_CERT_REV_FAILED: int +ERROR_FTP_TRANSFER_IN_PROGRESS: int +ERROR_FTP_DROPPED: int +ERROR_FTP_NO_PASSIVE_MODE: int +ERROR_GOPHER_PROTOCOL_ERROR: int +ERROR_GOPHER_NOT_FILE: int +ERROR_GOPHER_DATA_ERROR: int +ERROR_GOPHER_END_OF_DATA: int +ERROR_GOPHER_INVALID_LOCATOR: int +ERROR_GOPHER_INCORRECT_LOCATOR_TYPE: int +ERROR_GOPHER_NOT_GOPHER_PLUS: int +ERROR_GOPHER_ATTRIBUTE_NOT_FOUND: int +ERROR_GOPHER_UNKNOWN_LOCATOR: int +ERROR_HTTP_HEADER_NOT_FOUND: int +ERROR_HTTP_DOWNLEVEL_SERVER: int +ERROR_HTTP_INVALID_SERVER_RESPONSE: int +ERROR_HTTP_INVALID_HEADER: int +ERROR_HTTP_INVALID_QUERY_REQUEST: int +ERROR_HTTP_HEADER_ALREADY_EXISTS: int +ERROR_HTTP_REDIRECT_FAILED: int +ERROR_HTTP_NOT_REDIRECTED: int +ERROR_HTTP_COOKIE_NEEDS_CONFIRMATION: int +ERROR_HTTP_COOKIE_DECLINED: int +ERROR_HTTP_REDIRECT_NEEDS_CONFIRMATION: int +ERROR_INTERNET_SECURITY_CHANNEL_ERROR: int +ERROR_INTERNET_UNABLE_TO_CACHE_FILE: int +ERROR_INTERNET_TCPIP_NOT_INSTALLED: int +ERROR_INTERNET_DISCONNECTED: int +ERROR_INTERNET_SERVER_UNREACHABLE: int +ERROR_INTERNET_PROXY_SERVER_UNREACHABLE: int +ERROR_INTERNET_BAD_AUTO_PROXY_SCRIPT: int +ERROR_INTERNET_UNABLE_TO_DOWNLOAD_SCRIPT: int +ERROR_INTERNET_SEC_INVALID_CERT: int +ERROR_INTERNET_SEC_CERT_REVOKED: int +ERROR_INTERNET_FAILED_DUETOSECURITYCHECK: int +ERROR_INTERNET_NOT_INITIALIZED: int +ERROR_INTERNET_NEED_MSN_SSPI_PKG: int +ERROR_INTERNET_LOGIN_FAILURE_DISPLAY_ENTITY_BODY: int +INTERNET_ERROR_LAST: int +NORMAL_CACHE_ENTRY: int +STICKY_CACHE_ENTRY: int +EDITED_CACHE_ENTRY: int +TRACK_OFFLINE_CACHE_ENTRY: int +TRACK_ONLINE_CACHE_ENTRY: int +SPARSE_CACHE_ENTRY: int +COOKIE_CACHE_ENTRY: int +URLHISTORY_CACHE_ENTRY: int +URLCACHE_FIND_DEFAULT_FILTER: int +CACHEGROUP_ATTRIBUTE_GET_ALL: int +CACHEGROUP_ATTRIBUTE_BASIC: int +CACHEGROUP_ATTRIBUTE_FLAG: int +CACHEGROUP_ATTRIBUTE_TYPE: int +CACHEGROUP_ATTRIBUTE_QUOTA: int +CACHEGROUP_ATTRIBUTE_GROUPNAME: int +CACHEGROUP_ATTRIBUTE_STORAGE: int +CACHEGROUP_FLAG_NONPURGEABLE: int +CACHEGROUP_FLAG_GIDONLY: int +CACHEGROUP_FLAG_FLUSHURL_ONDELETE: int +CACHEGROUP_SEARCH_ALL: int +CACHEGROUP_SEARCH_BYURL: int +CACHEGROUP_TYPE_INVALID: int +CACHEGROUP_READWRITE_MASK: int +GROUPNAME_MAX_LENGTH: int +GROUP_OWNER_STORAGE_SIZE: int +CACHE_ENTRY_ATTRIBUTE_FC: int +CACHE_ENTRY_HITRATE_FC: int +CACHE_ENTRY_MODTIME_FC: int +CACHE_ENTRY_EXPTIME_FC: int +CACHE_ENTRY_ACCTIME_FC: int +CACHE_ENTRY_SYNCTIME_FC: int +CACHE_ENTRY_HEADERINFO_FC: int +CACHE_ENTRY_EXEMPT_DELTA_FC: int +INTERNET_CACHE_GROUP_ADD: int +INTERNET_CACHE_GROUP_REMOVE: int +INTERNET_DIAL_FORCE_PROMPT: int +INTERNET_DIAL_SHOW_OFFLINE: int +INTERNET_DIAL_UNATTENDED: int +INTERENT_GOONLINE_REFRESH: int +INTERENT_GOONLINE_MASK: int +INTERNET_AUTODIAL_FORCE_ONLINE: int +INTERNET_AUTODIAL_FORCE_UNATTENDED: int +INTERNET_AUTODIAL_FAILIFSECURITYCHECK: int +INTERNET_AUTODIAL_OVERRIDE_NET_PRESENT: int +INTERNET_AUTODIAL_FLAGS_MASK: int +PROXY_AUTO_DETECT_TYPE_DHCP: int +PROXY_AUTO_DETECT_TYPE_DNS_A: int +INTERNET_CONNECTION_MODEM: int +INTERNET_CONNECTION_LAN: int +INTERNET_CONNECTION_PROXY: int +INTERNET_CONNECTION_MODEM_BUSY: int +INTERNET_RAS_INSTALLED: int +INTERNET_CONNECTION_OFFLINE: int +INTERNET_CONNECTION_CONFIGURED: int +INTERNET_CUSTOMDIAL_CONNECT: int +INTERNET_CUSTOMDIAL_UNATTENDED: int +INTERNET_CUSTOMDIAL_DISCONNECT: int +INTERNET_CUSTOMDIAL_SHOWOFFLINE: int +INTERNET_CUSTOMDIAL_SAFE_FOR_UNATTENDED: int +INTERNET_CUSTOMDIAL_WILL_SUPPLY_STATE: int +INTERNET_CUSTOMDIAL_CAN_HANGUP: int +INTERNET_DIALSTATE_DISCONNECTED: int +INTERNET_IDENTITY_FLAG_PRIVATE_CACHE: int +INTERNET_IDENTITY_FLAG_SHARED_CACHE: int +INTERNET_IDENTITY_FLAG_CLEAR_DATA: int +INTERNET_IDENTITY_FLAG_CLEAR_COOKIES: int +INTERNET_IDENTITY_FLAG_CLEAR_HISTORY: int +INTERNET_IDENTITY_FLAG_CLEAR_CONTENT: int +INTERNET_SUPPRESS_RESET_ALL: int +INTERNET_SUPPRESS_COOKIE_POLICY: int +INTERNET_SUPPRESS_COOKIE_POLICY_RESET: int +PRIVACY_TEMPLATE_NO_COOKIES: int +PRIVACY_TEMPLATE_HIGH: int +PRIVACY_TEMPLATE_MEDIUM_HIGH: int +PRIVACY_TEMPLATE_MEDIUM: int +PRIVACY_TEMPLATE_MEDIUM_LOW: int +PRIVACY_TEMPLATE_LOW: int +PRIVACY_TEMPLATE_CUSTOM: int +PRIVACY_TEMPLATE_ADVANCED: int +PRIVACY_TEMPLATE_MAX: int +PRIVACY_TYPE_FIRST_PARTY: int +PRIVACY_TYPE_THIRD_PARTY: int +INTERNET_DEFAULT_PORT: int +WINHTTP_FLAG_ASYNC: int +WINHTTP_FLAG_SECURE: int +WINHTTP_FLAG_ESCAPE_PERCENT: int +WINHTTP_FLAG_NULL_CODEPAGE: int +WINHTTP_FLAG_BYPASS_PROXY_CACHE: int +WINHTTP_FLAG_REFRESH: int +WINHTTP_FLAG_ESCAPE_DISABLE: int +WINHTTP_FLAG_ESCAPE_DISABLE_QUERY: int +SECURITY_FLAG_IGNORE_CERT_WRONG_USAGE: int +INTERNET_SCHEME_HTTP: int +INTERNET_SCHEME_HTTPS: int +WINHTTP_AUTOPROXY_AUTO_DETECT: int +WINHTTP_AUTOPROXY_CONFIG_URL: int +WINHTTP_AUTOPROXY_RUN_INPROCESS: int +WINHTTP_AUTOPROXY_RUN_OUTPROCESS_ONLY: int +WINHTTP_AUTO_DETECT_TYPE_DHCP: int +WINHTTP_AUTO_DETECT_TYPE_DNS_A: int +WINHTTP_TIME_FORMAT_BUFSIZE: int +ICU_ESCAPE_AUTHORITY: int +ICU_REJECT_USERPWD: int +WINHTTP_ACCESS_TYPE_DEFAULT_PROXY: int +WINHTTP_ACCESS_TYPE_NO_PROXY: int +WINHTTP_ACCESS_TYPE_NAMED_PROXY: int +WINHTTP_OPTION_CALLBACK: int +WINHTTP_OPTION_RESOLVE_TIMEOUT: int +WINHTTP_OPTION_CONNECT_TIMEOUT: int +WINHTTP_OPTION_CONNECT_RETRIES: int +WINHTTP_OPTION_SEND_TIMEOUT: int +WINHTTP_OPTION_RECEIVE_TIMEOUT: int +WINHTTP_OPTION_RECEIVE_RESPONSE_TIMEOUT: int +WINHTTP_OPTION_HANDLE_TYPE: int +WINHTTP_OPTION_READ_BUFFER_SIZE: int +WINHTTP_OPTION_WRITE_BUFFER_SIZE: int +WINHTTP_OPTION_PARENT_HANDLE: int +WINHTTP_OPTION_EXTENDED_ERROR: int +WINHTTP_OPTION_SECURITY_FLAGS: int +WINHTTP_OPTION_SECURITY_CERTIFICATE_STRUCT: int +WINHTTP_OPTION_URL: int +WINHTTP_OPTION_SECURITY_KEY_BITNESS: int +WINHTTP_OPTION_PROXY: int +WINHTTP_OPTION_USER_AGENT: int +WINHTTP_OPTION_CONTEXT_VALUE: int +WINHTTP_OPTION_CLIENT_CERT_CONTEXT: int +WINHTTP_OPTION_REQUEST_PRIORITY: int +WINHTTP_OPTION_HTTP_VERSION: int +WINHTTP_OPTION_DISABLE_FEATURE: int +WINHTTP_OPTION_CODEPAGE: int +WINHTTP_OPTION_MAX_CONNS_PER_SERVER: int +WINHTTP_OPTION_MAX_CONNS_PER_1_0_SERVER: int +WINHTTP_OPTION_AUTOLOGON_POLICY: int +WINHTTP_OPTION_SERVER_CERT_CONTEXT: int +WINHTTP_OPTION_ENABLE_FEATURE: int +WINHTTP_OPTION_WORKER_THREAD_COUNT: int +WINHTTP_OPTION_PASSPORT_COBRANDING_TEXT: int +WINHTTP_OPTION_PASSPORT_COBRANDING_URL: int +WINHTTP_OPTION_CONFIGURE_PASSPORT_AUTH: int +WINHTTP_OPTION_SECURE_PROTOCOLS: int +WINHTTP_OPTION_ENABLETRACING: int +WINHTTP_OPTION_PASSPORT_SIGN_OUT: int +WINHTTP_OPTION_PASSPORT_RETURN_URL: int +WINHTTP_OPTION_REDIRECT_POLICY: int +WINHTTP_OPTION_MAX_HTTP_AUTOMATIC_REDIRECTS: int +WINHTTP_OPTION_MAX_HTTP_STATUS_CONTINUE: int +WINHTTP_OPTION_MAX_RESPONSE_HEADER_SIZE: int +WINHTTP_OPTION_MAX_RESPONSE_DRAIN_SIZE: int +WINHTTP_OPTION_CONNECTION_INFO: int +WINHTTP_OPTION_SPN: int +WINHTTP_OPTION_GLOBAL_PROXY_CREDS: int +WINHTTP_OPTION_GLOBAL_SERVER_CREDS: int +WINHTTP_OPTION_UNLOAD_NOTIFY_EVENT: int +WINHTTP_OPTION_REJECT_USERPWD_IN_URL: int +WINHTTP_OPTION_USE_GLOBAL_SERVER_CREDENTIALS: int +WINHTTP_LAST_OPTION: int +WINHTTP_OPTION_USERNAME: int +WINHTTP_OPTION_PASSWORD: int +WINHTTP_OPTION_PROXY_USERNAME: int +WINHTTP_OPTION_PROXY_PASSWORD: int +WINHTTP_CONNS_PER_SERVER_UNLIMITED: int +WINHTTP_AUTOLOGON_SECURITY_LEVEL_MEDIUM: int +WINHTTP_AUTOLOGON_SECURITY_LEVEL_LOW: int +WINHTTP_AUTOLOGON_SECURITY_LEVEL_HIGH: int +WINHTTP_AUTOLOGON_SECURITY_LEVEL_DEFAULT: int +WINHTTP_OPTION_REDIRECT_POLICY_NEVER: int +WINHTTP_OPTION_REDIRECT_POLICY_DISALLOW_HTTPS_TO_HTTP: int +WINHTTP_OPTION_REDIRECT_POLICY_ALWAYS: int +WINHTTP_OPTION_REDIRECT_POLICY_LAST: int +WINHTTP_OPTION_REDIRECT_POLICY_DEFAULT: int +WINHTTP_DISABLE_PASSPORT_AUTH: int +WINHTTP_ENABLE_PASSPORT_AUTH: int +WINHTTP_DISABLE_PASSPORT_KEYRING: int +WINHTTP_ENABLE_PASSPORT_KEYRING: int +WINHTTP_DISABLE_COOKIES: int +WINHTTP_DISABLE_REDIRECTS: int +WINHTTP_DISABLE_AUTHENTICATION: int +WINHTTP_DISABLE_KEEP_ALIVE: int +WINHTTP_ENABLE_SSL_REVOCATION: int +WINHTTP_ENABLE_SSL_REVERT_IMPERSONATION: int +WINHTTP_DISABLE_SPN_SERVER_PORT: int +WINHTTP_ENABLE_SPN_SERVER_PORT: int +WINHTTP_OPTION_SPN_MASK: int +WINHTTP_HANDLE_TYPE_SESSION: int +WINHTTP_HANDLE_TYPE_CONNECT: int +WINHTTP_HANDLE_TYPE_REQUEST: int +WINHTTP_AUTH_SCHEME_BASIC: int +WINHTTP_AUTH_SCHEME_NTLM: int +WINHTTP_AUTH_SCHEME_PASSPORT: int +WINHTTP_AUTH_SCHEME_DIGEST: int +WINHTTP_AUTH_SCHEME_NEGOTIATE: int +WINHTTP_AUTH_TARGET_SERVER: int +WINHTTP_AUTH_TARGET_PROXY: int +WINHTTP_CALLBACK_STATUS_FLAG_CERT_REV_FAILED: int +WINHTTP_CALLBACK_STATUS_FLAG_INVALID_CERT: int +WINHTTP_CALLBACK_STATUS_FLAG_CERT_REVOKED: int +WINHTTP_CALLBACK_STATUS_FLAG_INVALID_CA: int +WINHTTP_CALLBACK_STATUS_FLAG_CERT_CN_INVALID: int +WINHTTP_CALLBACK_STATUS_FLAG_CERT_DATE_INVALID: int +WINHTTP_CALLBACK_STATUS_FLAG_CERT_WRONG_USAGE: int +WINHTTP_CALLBACK_STATUS_FLAG_SECURITY_CHANNEL_ERROR: int +WINHTTP_FLAG_SECURE_PROTOCOL_SSL2: int +WINHTTP_FLAG_SECURE_PROTOCOL_SSL3: int +WINHTTP_FLAG_SECURE_PROTOCOL_TLS1: int +WINHTTP_FLAG_SECURE_PROTOCOL_ALL: int +WINHTTP_CALLBACK_STATUS_RESOLVING_NAME: int +WINHTTP_CALLBACK_STATUS_NAME_RESOLVED: int +WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER: int +WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER: int +WINHTTP_CALLBACK_STATUS_SENDING_REQUEST: int +WINHTTP_CALLBACK_STATUS_REQUEST_SENT: int +WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE: int +WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED: int +WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION: int +WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED: int +WINHTTP_CALLBACK_STATUS_HANDLE_CREATED: int +WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING: int +WINHTTP_CALLBACK_STATUS_DETECTING_PROXY: int +WINHTTP_CALLBACK_STATUS_REDIRECT: int +WINHTTP_CALLBACK_STATUS_INTERMEDIATE_RESPONSE: int +WINHTTP_CALLBACK_STATUS_SECURE_FAILURE: int +WINHTTP_CALLBACK_STATUS_HEADERS_AVAILABLE: int +WINHTTP_CALLBACK_STATUS_DATA_AVAILABLE: int +WINHTTP_CALLBACK_STATUS_READ_COMPLETE: int +WINHTTP_CALLBACK_STATUS_WRITE_COMPLETE: int +WINHTTP_CALLBACK_STATUS_REQUEST_ERROR: int +WINHTTP_CALLBACK_STATUS_SENDREQUEST_COMPLETE: int +API_RECEIVE_RESPONSE: int +API_QUERY_DATA_AVAILABLE: int +API_READ_DATA: int +API_WRITE_DATA: int +API_SEND_REQUEST: int +WINHTTP_CALLBACK_FLAG_RESOLVE_NAME: int +WINHTTP_CALLBACK_FLAG_CONNECT_TO_SERVER: int +WINHTTP_CALLBACK_FLAG_SEND_REQUEST: int +WINHTTP_CALLBACK_FLAG_RECEIVE_RESPONSE: int +WINHTTP_CALLBACK_FLAG_CLOSE_CONNECTION: int +WINHTTP_CALLBACK_FLAG_HANDLES: int +WINHTTP_CALLBACK_FLAG_DETECTING_PROXY: int +WINHTTP_CALLBACK_FLAG_REDIRECT: int +WINHTTP_CALLBACK_FLAG_INTERMEDIATE_RESPONSE: int +WINHTTP_CALLBACK_FLAG_SECURE_FAILURE: int +WINHTTP_CALLBACK_FLAG_SENDREQUEST_COMPLETE: int +WINHTTP_CALLBACK_FLAG_HEADERS_AVAILABLE: int +WINHTTP_CALLBACK_FLAG_DATA_AVAILABLE: int +WINHTTP_CALLBACK_FLAG_READ_COMPLETE: int +WINHTTP_CALLBACK_FLAG_WRITE_COMPLETE: int +WINHTTP_CALLBACK_FLAG_REQUEST_ERROR: int +WINHTTP_CALLBACK_FLAG_ALL_COMPLETIONS: int +WINHTTP_CALLBACK_FLAG_ALL_NOTIFICATIONS: int +WINHTTP_QUERY_MIME_VERSION: int +WINHTTP_QUERY_CONTENT_TYPE: int +WINHTTP_QUERY_CONTENT_TRANSFER_ENCODING: int +WINHTTP_QUERY_CONTENT_ID: int +WINHTTP_QUERY_CONTENT_DESCRIPTION: int +WINHTTP_QUERY_CONTENT_LENGTH: int +WINHTTP_QUERY_CONTENT_LANGUAGE: int +WINHTTP_QUERY_ALLOW: int +WINHTTP_QUERY_PUBLIC: int +WINHTTP_QUERY_DATE: int +WINHTTP_QUERY_EXPIRES: int +WINHTTP_QUERY_LAST_MODIFIED: int +WINHTTP_QUERY_MESSAGE_ID: int +WINHTTP_QUERY_URI: int +WINHTTP_QUERY_DERIVED_FROM: int +WINHTTP_QUERY_COST: int +WINHTTP_QUERY_LINK: int +WINHTTP_QUERY_PRAGMA: int +WINHTTP_QUERY_VERSION: int +WINHTTP_QUERY_STATUS_CODE: int +WINHTTP_QUERY_STATUS_TEXT: int +WINHTTP_QUERY_RAW_HEADERS: int +WINHTTP_QUERY_RAW_HEADERS_CRLF: int +WINHTTP_QUERY_CONNECTION: int +WINHTTP_QUERY_ACCEPT: int +WINHTTP_QUERY_ACCEPT_CHARSET: int +WINHTTP_QUERY_ACCEPT_ENCODING: int +WINHTTP_QUERY_ACCEPT_LANGUAGE: int +WINHTTP_QUERY_AUTHORIZATION: int +WINHTTP_QUERY_CONTENT_ENCODING: int +WINHTTP_QUERY_FORWARDED: int +WINHTTP_QUERY_FROM: int +WINHTTP_QUERY_IF_MODIFIED_SINCE: int +WINHTTP_QUERY_LOCATION: int +WINHTTP_QUERY_ORIG_URI: int +WINHTTP_QUERY_REFERER: int +WINHTTP_QUERY_RETRY_AFTER: int +WINHTTP_QUERY_SERVER: int +WINHTTP_QUERY_TITLE: int +WINHTTP_QUERY_USER_AGENT: int +WINHTTP_QUERY_WWW_AUTHENTICATE: int +WINHTTP_QUERY_PROXY_AUTHENTICATE: int +WINHTTP_QUERY_ACCEPT_RANGES: int +WINHTTP_QUERY_SET_COOKIE: int +WINHTTP_QUERY_COOKIE: int +WINHTTP_QUERY_REQUEST_METHOD: int +WINHTTP_QUERY_REFRESH: int +WINHTTP_QUERY_CONTENT_DISPOSITION: int +WINHTTP_QUERY_AGE: int +WINHTTP_QUERY_CACHE_CONTROL: int +WINHTTP_QUERY_CONTENT_BASE: int +WINHTTP_QUERY_CONTENT_LOCATION: int +WINHTTP_QUERY_CONTENT_MD5: int +WINHTTP_QUERY_CONTENT_RANGE: int +WINHTTP_QUERY_ETAG: int +WINHTTP_QUERY_HOST: int +WINHTTP_QUERY_IF_MATCH: int +WINHTTP_QUERY_IF_NONE_MATCH: int +WINHTTP_QUERY_IF_RANGE: int +WINHTTP_QUERY_IF_UNMODIFIED_SINCE: int +WINHTTP_QUERY_MAX_FORWARDS: int +WINHTTP_QUERY_PROXY_AUTHORIZATION: int +WINHTTP_QUERY_RANGE: int +WINHTTP_QUERY_TRANSFER_ENCODING: int +WINHTTP_QUERY_UPGRADE: int +WINHTTP_QUERY_VARY: int +WINHTTP_QUERY_VIA: int +WINHTTP_QUERY_WARNING: int +WINHTTP_QUERY_EXPECT: int +WINHTTP_QUERY_PROXY_CONNECTION: int +WINHTTP_QUERY_UNLESS_MODIFIED_SINCE: int +WINHTTP_QUERY_PROXY_SUPPORT: int +WINHTTP_QUERY_AUTHENTICATION_INFO: int +WINHTTP_QUERY_PASSPORT_URLS: int +WINHTTP_QUERY_PASSPORT_CONFIG: int +WINHTTP_QUERY_MAX: int +WINHTTP_QUERY_CUSTOM: int +WINHTTP_QUERY_FLAG_REQUEST_HEADERS: int +WINHTTP_QUERY_FLAG_SYSTEMTIME: int +WINHTTP_QUERY_FLAG_NUMBER: int +HTTP_STATUS_WEBDAV_MULTI_STATUS: int +WINHTTP_ADDREQ_INDEX_MASK: int +WINHTTP_ADDREQ_FLAGS_MASK: int +WINHTTP_ADDREQ_FLAG_ADD_IF_NEW: int +WINHTTP_ADDREQ_FLAG_ADD: int +WINHTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA: int +WINHTTP_ADDREQ_FLAG_COALESCE_WITH_SEMICOLON: int +WINHTTP_ADDREQ_FLAG_COALESCE: int +WINHTTP_ADDREQ_FLAG_REPLACE: int +WINHTTP_IGNORE_REQUEST_TOTAL_LENGTH: int +WINHTTP_ERROR_BASE: int +ERROR_WINHTTP_OUT_OF_HANDLES: int +ERROR_WINHTTP_TIMEOUT: int +ERROR_WINHTTP_INTERNAL_ERROR: int +ERROR_WINHTTP_INVALID_URL: int +ERROR_WINHTTP_UNRECOGNIZED_SCHEME: int +ERROR_WINHTTP_NAME_NOT_RESOLVED: int +ERROR_WINHTTP_INVALID_OPTION: int +ERROR_WINHTTP_OPTION_NOT_SETTABLE: int +ERROR_WINHTTP_SHUTDOWN: int +ERROR_WINHTTP_LOGIN_FAILURE: int +ERROR_WINHTTP_OPERATION_CANCELLED: int +ERROR_WINHTTP_INCORRECT_HANDLE_TYPE: int +ERROR_WINHTTP_INCORRECT_HANDLE_STATE: int +ERROR_WINHTTP_CANNOT_CONNECT: int +ERROR_WINHTTP_CONNECTION_ERROR: int +ERROR_WINHTTP_RESEND_REQUEST: int +ERROR_WINHTTP_CLIENT_AUTH_CERT_NEEDED: int +ERROR_WINHTTP_CANNOT_CALL_BEFORE_OPEN: int +ERROR_WINHTTP_CANNOT_CALL_BEFORE_SEND: int +ERROR_WINHTTP_CANNOT_CALL_AFTER_SEND: int +ERROR_WINHTTP_CANNOT_CALL_AFTER_OPEN: int +ERROR_WINHTTP_HEADER_NOT_FOUND: int +ERROR_WINHTTP_INVALID_SERVER_RESPONSE: int +ERROR_WINHTTP_INVALID_HEADER: int +ERROR_WINHTTP_INVALID_QUERY_REQUEST: int +ERROR_WINHTTP_HEADER_ALREADY_EXISTS: int +ERROR_WINHTTP_REDIRECT_FAILED: int +ERROR_WINHTTP_AUTO_PROXY_SERVICE_ERROR: int +ERROR_WINHTTP_BAD_AUTO_PROXY_SCRIPT: int +ERROR_WINHTTP_UNABLE_TO_DOWNLOAD_SCRIPT: int +ERROR_WINHTTP_NOT_INITIALIZED: int +ERROR_WINHTTP_SECURE_FAILURE: int +ERROR_WINHTTP_SECURE_CERT_DATE_INVALID: int +ERROR_WINHTTP_SECURE_CERT_CN_INVALID: int +ERROR_WINHTTP_SECURE_INVALID_CA: int +ERROR_WINHTTP_SECURE_CERT_REV_FAILED: int +ERROR_WINHTTP_SECURE_CHANNEL_ERROR: int +ERROR_WINHTTP_SECURE_INVALID_CERT: int +ERROR_WINHTTP_SECURE_CERT_REVOKED: int +ERROR_WINHTTP_SECURE_CERT_WRONG_USAGE: int +ERROR_WINHTTP_AUTODETECTION_FAILED: int +ERROR_WINHTTP_HEADER_COUNT_EXCEEDED: int +ERROR_WINHTTP_HEADER_SIZE_OVERFLOW: int +ERROR_WINHTTP_CHUNKED_ENCODING_HEADER_SIZE_OVERFLOW: int +ERROR_WINHTTP_RESPONSE_DRAIN_OVERFLOW: int +ERROR_WINHTTP_CLIENT_CERT_NO_PRIVATE_KEY: int +ERROR_WINHTTP_CLIENT_CERT_NO_ACCESS_PRIVATE_KEY: int +WINHTTP_ERROR_LAST: int +WINHTTP_NO_PROXY_NAME: None +WINHTTP_NO_PROXY_BYPASS: None +WINHTTP_NO_REFERER: None +WINHTTP_DEFAULT_ACCEPT_TYPES: None +WINHTTP_NO_ADDITIONAL_HEADERS: None +WINHTTP_NO_REQUEST_DATA: None +INTERNET_OPTION_LISTEN_TIMEOUT: int +WINHTTP_OPTION_CLIENT_CERT_ISSUER_LIST: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/win32netcon.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/win32netcon.pyi new file mode 100644 index 000000000..0538f443f --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/win32netcon.pyi @@ -0,0 +1,571 @@ +CNLEN: int +LM20_CNLEN: int +DNLEN: int +LM20_DNLEN: int +UNCLEN: int +LM20_UNCLEN: int +NNLEN: int +LM20_NNLEN: int +RMLEN: int +LM20_RMLEN: int +SNLEN: int +LM20_SNLEN: int +STXTLEN: int +LM20_STXTLEN: int +PATHLEN: int +LM20_PATHLEN: int +DEVLEN: int +LM20_DEVLEN: int +EVLEN: int +UNLEN: int +LM20_UNLEN: int +GNLEN: int +LM20_GNLEN: int +PWLEN: int +LM20_PWLEN: int +SHPWLEN: int +CLTYPE_LEN: int +MAXCOMMENTSZ: int +LM20_MAXCOMMENTSZ: int +QNLEN: int +LM20_QNLEN: int +ALERTSZ: int +NETBIOS_NAME_LEN: int +CRYPT_KEY_LEN: int +CRYPT_TXT_LEN: int +ENCRYPTED_PWLEN: int +SESSION_PWLEN: int +SESSION_CRYPT_KLEN: int +PARMNUM_ALL: int +PARM_ERROR_NONE: int +PARMNUM_BASE_INFOLEVEL: int +NULL: int +PLATFORM_ID_DOS: int +PLATFORM_ID_OS2: int +PLATFORM_ID_NT: int +PLATFORM_ID_OSF: int +PLATFORM_ID_VMS: int +MAX_LANMAN_MESSAGE_ID: int +UF_SCRIPT: int +UF_ACCOUNTDISABLE: int +UF_HOMEDIR_REQUIRED: int +UF_LOCKOUT: int +UF_PASSWD_NOTREQD: int +UF_PASSWD_CANT_CHANGE: int +UF_TEMP_DUPLICATE_ACCOUNT: int +UF_NORMAL_ACCOUNT: int +UF_INTERDOMAIN_TRUST_ACCOUNT: int +UF_WORKSTATION_TRUST_ACCOUNT: int +UF_SERVER_TRUST_ACCOUNT: int +UF_MACHINE_ACCOUNT_MASK: int +UF_ACCOUNT_TYPE_MASK: int +UF_DONT_EXPIRE_PASSWD: int +UF_MNS_LOGON_ACCOUNT: int +UF_SETTABLE_BITS: int +FILTER_TEMP_DUPLICATE_ACCOUNT: int +FILTER_NORMAL_ACCOUNT: int +FILTER_INTERDOMAIN_TRUST_ACCOUNT: int +FILTER_WORKSTATION_TRUST_ACCOUNT: int +FILTER_SERVER_TRUST_ACCOUNT: int +LG_INCLUDE_INDIRECT: int +AF_OP_PRINT: int +AF_OP_COMM: int +AF_OP_SERVER: int +AF_OP_ACCOUNTS: int +AF_SETTABLE_BITS: int +UAS_ROLE_STANDALONE: int +UAS_ROLE_MEMBER: int +UAS_ROLE_BACKUP: int +UAS_ROLE_PRIMARY: int +USER_NAME_PARMNUM: int +USER_PASSWORD_PARMNUM: int +USER_PASSWORD_AGE_PARMNUM: int +USER_PRIV_PARMNUM: int +USER_HOME_DIR_PARMNUM: int +USER_COMMENT_PARMNUM: int +USER_FLAGS_PARMNUM: int +USER_SCRIPT_PATH_PARMNUM: int +USER_AUTH_FLAGS_PARMNUM: int +USER_FULL_NAME_PARMNUM: int +USER_USR_COMMENT_PARMNUM: int +USER_PARMS_PARMNUM: int +USER_WORKSTATIONS_PARMNUM: int +USER_LAST_LOGON_PARMNUM: int +USER_LAST_LOGOFF_PARMNUM: int +USER_ACCT_EXPIRES_PARMNUM: int +USER_MAX_STORAGE_PARMNUM: int +USER_UNITS_PER_WEEK_PARMNUM: int +USER_LOGON_HOURS_PARMNUM: int +USER_PAD_PW_COUNT_PARMNUM: int +USER_NUM_LOGONS_PARMNUM: int +USER_LOGON_SERVER_PARMNUM: int +USER_COUNTRY_CODE_PARMNUM: int +USER_CODE_PAGE_PARMNUM: int +USER_PRIMARY_GROUP_PARMNUM: int +USER_PROFILE: int +USER_PROFILE_PARMNUM: int +USER_HOME_DIR_DRIVE_PARMNUM: int +USER_NAME_INFOLEVEL: int +USER_PASSWORD_INFOLEVEL: int +USER_PASSWORD_AGE_INFOLEVEL: int +USER_PRIV_INFOLEVEL: int +USER_HOME_DIR_INFOLEVEL: int +USER_COMMENT_INFOLEVEL: int +USER_FLAGS_INFOLEVEL: int +USER_SCRIPT_PATH_INFOLEVEL: int +USER_AUTH_FLAGS_INFOLEVEL: int +USER_FULL_NAME_INFOLEVEL: int +USER_USR_COMMENT_INFOLEVEL: int +USER_PARMS_INFOLEVEL: int +USER_WORKSTATIONS_INFOLEVEL: int +USER_LAST_LOGON_INFOLEVEL: int +USER_LAST_LOGOFF_INFOLEVEL: int +USER_ACCT_EXPIRES_INFOLEVEL: int +USER_MAX_STORAGE_INFOLEVEL: int +USER_UNITS_PER_WEEK_INFOLEVEL: int +USER_LOGON_HOURS_INFOLEVEL: int +USER_PAD_PW_COUNT_INFOLEVEL: int +USER_NUM_LOGONS_INFOLEVEL: int +USER_LOGON_SERVER_INFOLEVEL: int +USER_COUNTRY_CODE_INFOLEVEL: int +USER_CODE_PAGE_INFOLEVEL: int +USER_PRIMARY_GROUP_INFOLEVEL: int +USER_HOME_DIR_DRIVE_INFOLEVEL: int +NULL_USERSETINFO_PASSWD: str +UNITS_PER_DAY: int +UNITS_PER_WEEK: int +USER_PRIV_MASK: int +USER_PRIV_GUEST: int +USER_PRIV_USER: int +USER_PRIV_ADMIN: int +MAX_PASSWD_LEN: int +DEF_MIN_PWLEN: int +DEF_PWUNIQUENESS: int +DEF_MAX_PWHIST: int +DEF_MAX_BADPW: int +VALIDATED_LOGON: int +PASSWORD_EXPIRED: int +NON_VALIDATED_LOGON: int +VALID_LOGOFF: int +MODALS_MIN_PASSWD_LEN_PARMNUM: int +MODALS_MAX_PASSWD_AGE_PARMNUM: int +MODALS_MIN_PASSWD_AGE_PARMNUM: int +MODALS_FORCE_LOGOFF_PARMNUM: int +MODALS_PASSWD_HIST_LEN_PARMNUM: int +MODALS_ROLE_PARMNUM: int +MODALS_PRIMARY_PARMNUM: int +MODALS_DOMAIN_NAME_PARMNUM: int +MODALS_DOMAIN_ID_PARMNUM: int +MODALS_LOCKOUT_DURATION_PARMNUM: int +MODALS_LOCKOUT_OBSERVATION_WINDOW_PARMNUM: int +MODALS_LOCKOUT_THRESHOLD_PARMNUM: int +MODALS_MIN_PASSWD_LEN_INFOLEVEL: int +MODALS_MAX_PASSWD_AGE_INFOLEVEL: int +MODALS_MIN_PASSWD_AGE_INFOLEVEL: int +MODALS_FORCE_LOGOFF_INFOLEVEL: int +MODALS_PASSWD_HIST_LEN_INFOLEVEL: int +MODALS_ROLE_INFOLEVEL: int +MODALS_PRIMARY_INFOLEVEL: int +MODALS_DOMAIN_NAME_INFOLEVEL: int +MODALS_DOMAIN_ID_INFOLEVEL: int +GROUPIDMASK: int +GROUP_ALL_PARMNUM: int +GROUP_NAME_PARMNUM: int +GROUP_COMMENT_PARMNUM: int +GROUP_ATTRIBUTES_PARMNUM: int +GROUP_ALL_INFOLEVEL: int +GROUP_NAME_INFOLEVEL: int +GROUP_COMMENT_INFOLEVEL: int +GROUP_ATTRIBUTES_INFOLEVEL: int +LOCALGROUP_NAME_PARMNUM: int +LOCALGROUP_COMMENT_PARMNUM: int +MAXPERMENTRIES: int +ACCESS_NONE: int +ACCESS_READ: int +ACCESS_WRITE: int +ACCESS_CREATE: int +ACCESS_EXEC: int +ACCESS_DELETE: int +ACCESS_ATRIB: int +ACCESS_PERM: int +ACCESS_GROUP: int +ACCESS_AUDIT: int +ACCESS_SUCCESS_OPEN: int +ACCESS_SUCCESS_WRITE: int +ACCESS_SUCCESS_DELETE: int +ACCESS_SUCCESS_ACL: int +ACCESS_SUCCESS_MASK: int +ACCESS_FAIL_OPEN: int +ACCESS_FAIL_WRITE: int +ACCESS_FAIL_DELETE: int +ACCESS_FAIL_ACL: int +ACCESS_FAIL_MASK: int +ACCESS_FAIL_SHIFT: int +ACCESS_RESOURCE_NAME_PARMNUM: int +ACCESS_ATTR_PARMNUM: int +ACCESS_COUNT_PARMNUM: int +ACCESS_RESOURCE_NAME_INFOLEVEL: int +ACCESS_ATTR_INFOLEVEL: int +ACCESS_COUNT_INFOLEVEL: int +ACCESS_LETTERS: str +NETLOGON_CONTROL_QUERY: int +NETLOGON_CONTROL_REPLICATE: int +NETLOGON_CONTROL_SYNCHRONIZE: int +NETLOGON_CONTROL_PDC_REPLICATE: int +NETLOGON_CONTROL_REDISCOVER: int +NETLOGON_CONTROL_TC_QUERY: int +NETLOGON_CONTROL_TRANSPORT_NOTIFY: int +NETLOGON_CONTROL_FIND_USER: int +NETLOGON_CONTROL_UNLOAD_NETLOGON_DLL: int +NETLOGON_CONTROL_BACKUP_CHANGE_LOG: int +NETLOGON_CONTROL_TRUNCATE_LOG: int +NETLOGON_CONTROL_SET_DBFLAG: int +NETLOGON_CONTROL_BREAKPOINT: int +NETLOGON_REPLICATION_NEEDED: int +NETLOGON_REPLICATION_IN_PROGRESS: int +NETLOGON_FULL_SYNC_REPLICATION: int +NETLOGON_REDO_NEEDED: int + +def TEXT(x: str) -> str: ... + +MAX_PREFERRED_LENGTH: int +PARM_ERROR_UNKNOWN: int +MESSAGE_FILENAME: str +OS2MSG_FILENAME: str +HELP_MSG_FILENAME: str +BACKUP_MSG_FILENAME: str +TIMEQ_FOREVER: int +USER_MAXSTORAGE_UNLIMITED: int +USER_NO_LOGOFF: int +DEF_MAX_PWAGE: int +DEF_MIN_PWAGE: int +DEF_FORCE_LOGOFF: int +ONE_DAY: int +GROUP_SPECIALGRP_USERS: str +GROUP_SPECIALGRP_ADMINS: str +GROUP_SPECIALGRP_GUESTS: str +GROUP_SPECIALGRP_LOCAL: str +ACCESS_ALL: int +SV_PLATFORM_ID_OS2: int +SV_PLATFORM_ID_NT: int +MAJOR_VERSION_MASK: int +SV_TYPE_WORKSTATION: int +SV_TYPE_SERVER: int +SV_TYPE_SQLSERVER: int +SV_TYPE_DOMAIN_CTRL: int +SV_TYPE_DOMAIN_BAKCTRL: int +SV_TYPE_TIME_SOURCE: int +SV_TYPE_AFP: int +SV_TYPE_NOVELL: int +SV_TYPE_DOMAIN_MEMBER: int +SV_TYPE_PRINTQ_SERVER: int +SV_TYPE_DIALIN_SERVER: int +SV_TYPE_XENIX_SERVER: int +SV_TYPE_SERVER_UNIX: int +SV_TYPE_NT: int +SV_TYPE_WFW: int +SV_TYPE_SERVER_MFPN: int +SV_TYPE_SERVER_NT: int +SV_TYPE_POTENTIAL_BROWSER: int +SV_TYPE_BACKUP_BROWSER: int +SV_TYPE_MASTER_BROWSER: int +SV_TYPE_DOMAIN_MASTER: int +SV_TYPE_SERVER_OSF: int +SV_TYPE_SERVER_VMS: int +SV_TYPE_WINDOWS: int +SV_TYPE_DFS: int +SV_TYPE_CLUSTER_NT: int +SV_TYPE_DCE: int +SV_TYPE_ALTERNATE_XPORT: int +SV_TYPE_DOMAIN_ENUM: int +SV_TYPE_ALL: int +SV_NODISC: int +SV_USERSECURITY: int +SV_SHARESECURITY: int +SV_HIDDEN: int +SV_VISIBLE: int +SV_PLATFORM_ID_PARMNUM: int +SV_NAME_PARMNUM: int +SV_VERSION_MAJOR_PARMNUM: int +SV_VERSION_MINOR_PARMNUM: int +SV_TYPE_PARMNUM: int +SV_COMMENT_PARMNUM: int +SV_USERS_PARMNUM: int +SV_DISC_PARMNUM: int +SV_HIDDEN_PARMNUM: int +SV_ANNOUNCE_PARMNUM: int +SV_ANNDELTA_PARMNUM: int +SV_USERPATH_PARMNUM: int +SV_ALERTS_PARMNUM: int +SV_SECURITY_PARMNUM: int +SV_NUMADMIN_PARMNUM: int +SV_LANMASK_PARMNUM: int +SV_GUESTACC_PARMNUM: int +SV_CHDEVQ_PARMNUM: int +SV_CHDEVJOBS_PARMNUM: int +SV_CONNECTIONS_PARMNUM: int +SV_SHARES_PARMNUM: int +SV_OPENFILES_PARMNUM: int +SV_SESSREQS_PARMNUM: int +SV_ACTIVELOCKS_PARMNUM: int +SV_NUMREQBUF_PARMNUM: int +SV_NUMBIGBUF_PARMNUM: int +SV_NUMFILETASKS_PARMNUM: int +SV_ALERTSCHED_PARMNUM: int +SV_ERRORALERT_PARMNUM: int +SV_LOGONALERT_PARMNUM: int +SV_ACCESSALERT_PARMNUM: int +SV_DISKALERT_PARMNUM: int +SV_NETIOALERT_PARMNUM: int +SV_MAXAUDITSZ_PARMNUM: int +SV_SRVHEURISTICS_PARMNUM: int +SV_SESSOPENS_PARMNUM: int +SV_SESSVCS_PARMNUM: int +SV_OPENSEARCH_PARMNUM: int +SV_SIZREQBUF_PARMNUM: int +SV_INITWORKITEMS_PARMNUM: int +SV_MAXWORKITEMS_PARMNUM: int +SV_RAWWORKITEMS_PARMNUM: int +SV_IRPSTACKSIZE_PARMNUM: int +SV_MAXRAWBUFLEN_PARMNUM: int +SV_SESSUSERS_PARMNUM: int +SV_SESSCONNS_PARMNUM: int +SV_MAXNONPAGEDMEMORYUSAGE_PARMNUM: int +SV_MAXPAGEDMEMORYUSAGE_PARMNUM: int +SV_ENABLESOFTCOMPAT_PARMNUM: int +SV_ENABLEFORCEDLOGOFF_PARMNUM: int +SV_TIMESOURCE_PARMNUM: int +SV_ACCEPTDOWNLEVELAPIS_PARMNUM: int +SV_LMANNOUNCE_PARMNUM: int +SV_DOMAIN_PARMNUM: int +SV_MAXCOPYREADLEN_PARMNUM: int +SV_MAXCOPYWRITELEN_PARMNUM: int +SV_MINKEEPSEARCH_PARMNUM: int +SV_MAXKEEPSEARCH_PARMNUM: int +SV_MINKEEPCOMPLSEARCH_PARMNUM: int +SV_MAXKEEPCOMPLSEARCH_PARMNUM: int +SV_THREADCOUNTADD_PARMNUM: int +SV_NUMBLOCKTHREADS_PARMNUM: int +SV_SCAVTIMEOUT_PARMNUM: int +SV_MINRCVQUEUE_PARMNUM: int +SV_MINFREEWORKITEMS_PARMNUM: int +SV_XACTMEMSIZE_PARMNUM: int +SV_THREADPRIORITY_PARMNUM: int +SV_MAXMPXCT_PARMNUM: int +SV_OPLOCKBREAKWAIT_PARMNUM: int +SV_OPLOCKBREAKRESPONSEWAIT_PARMNUM: int +SV_ENABLEOPLOCKS_PARMNUM: int +SV_ENABLEOPLOCKFORCECLOSE_PARMNUM: int +SV_ENABLEFCBOPENS_PARMNUM: int +SV_ENABLERAW_PARMNUM: int +SV_ENABLESHAREDNETDRIVES_PARMNUM: int +SV_MINFREECONNECTIONS_PARMNUM: int +SV_MAXFREECONNECTIONS_PARMNUM: int +SV_INITSESSTABLE_PARMNUM: int +SV_INITCONNTABLE_PARMNUM: int +SV_INITFILETABLE_PARMNUM: int +SV_INITSEARCHTABLE_PARMNUM: int +SV_ALERTSCHEDULE_PARMNUM: int +SV_ERRORTHRESHOLD_PARMNUM: int +SV_NETWORKERRORTHRESHOLD_PARMNUM: int +SV_DISKSPACETHRESHOLD_PARMNUM: int +SV_MAXLINKDELAY_PARMNUM: int +SV_MINLINKTHROUGHPUT_PARMNUM: int +SV_LINKINFOVALIDTIME_PARMNUM: int +SV_SCAVQOSINFOUPDATETIME_PARMNUM: int +SV_MAXWORKITEMIDLETIME_PARMNUM: int +SV_MAXRAWWORKITEMS_PARMNUM: int +SV_PRODUCTTYPE_PARMNUM: int +SV_SERVERSIZE_PARMNUM: int +SV_CONNECTIONLESSAUTODISC_PARMNUM: int +SV_SHARINGVIOLATIONRETRIES_PARMNUM: int +SV_SHARINGVIOLATIONDELAY_PARMNUM: int +SV_MAXGLOBALOPENSEARCH_PARMNUM: int +SV_REMOVEDUPLICATESEARCHES_PARMNUM: int +SV_LOCKVIOLATIONRETRIES_PARMNUM: int +SV_LOCKVIOLATIONOFFSET_PARMNUM: int +SV_LOCKVIOLATIONDELAY_PARMNUM: int +SV_MDLREADSWITCHOVER_PARMNUM: int +SV_CACHEDOPENLIMIT_PARMNUM: int +SV_CRITICALTHREADS_PARMNUM: int +SV_RESTRICTNULLSESSACCESS_PARMNUM: int +SV_ENABLEWFW311DIRECTIPX_PARMNUM: int +SV_OTHERQUEUEAFFINITY_PARMNUM: int +SV_QUEUESAMPLESECS_PARMNUM: int +SV_BALANCECOUNT_PARMNUM: int +SV_PREFERREDAFFINITY_PARMNUM: int +SV_MAXFREERFCBS_PARMNUM: int +SV_MAXFREEMFCBS_PARMNUM: int +SV_MAXFREELFCBS_PARMNUM: int +SV_MAXFREEPAGEDPOOLCHUNKS_PARMNUM: int +SV_MINPAGEDPOOLCHUNKSIZE_PARMNUM: int +SV_MAXPAGEDPOOLCHUNKSIZE_PARMNUM: int +SV_SENDSFROMPREFERREDPROCESSOR_PARMNUM: int +SV_MAXTHREADSPERQUEUE_PARMNUM: int +SV_CACHEDDIRECTORYLIMIT_PARMNUM: int +SV_MAXCOPYLENGTH_PARMNUM: int +SV_ENABLEBULKTRANSFER_PARMNUM: int +SV_ENABLECOMPRESSION_PARMNUM: int +SV_AUTOSHAREWKS_PARMNUM: int +SV_AUTOSHARESERVER_PARMNUM: int +SV_ENABLESECURITYSIGNATURE_PARMNUM: int +SV_REQUIRESECURITYSIGNATURE_PARMNUM: int +SV_MINCLIENTBUFFERSIZE_PARMNUM: int +SV_CONNECTIONNOSESSIONSTIMEOUT_PARMNUM: int +SVI1_NUM_ELEMENTS: int +SVI2_NUM_ELEMENTS: int +SVI3_NUM_ELEMENTS: int +SW_AUTOPROF_LOAD_MASK: int +SW_AUTOPROF_SAVE_MASK: int +SV_MAX_SRV_HEUR_LEN: int +SV_USERS_PER_LICENSE: int +SVTI2_REMAP_PIPE_NAMES: int +SHARE_NETNAME_PARMNUM: int +SHARE_TYPE_PARMNUM: int +SHARE_REMARK_PARMNUM: int +SHARE_PERMISSIONS_PARMNUM: int +SHARE_MAX_USES_PARMNUM: int +SHARE_CURRENT_USES_PARMNUM: int +SHARE_PATH_PARMNUM: int +SHARE_PASSWD_PARMNUM: int +SHARE_FILE_SD_PARMNUM: int +SHI1_NUM_ELEMENTS: int +SHI2_NUM_ELEMENTS: int +STYPE_DISKTREE: int +STYPE_PRINTQ: int +STYPE_DEVICE: int +STYPE_IPC: int +STYPE_SPECIAL: int +SHI1005_FLAGS_DFS: int +SHI1005_FLAGS_DFS_ROOT: int +COW_PERMACHINE: int +COW_PERUSER: int +CSC_CACHEABLE: int +CSC_NOFLOWOPS: int +CSC_AUTO_INWARD: int +CSC_AUTO_OUTWARD: int +SHI1005_VALID_FLAGS_SET: int +SHI1007_VALID_FLAGS_SET: int +SESS_GUEST: int +SESS_NOENCRYPTION: int +SESI1_NUM_ELEMENTS: int +SESI2_NUM_ELEMENTS: int +PERM_FILE_READ: int +PERM_FILE_WRITE: int +PERM_FILE_CREATE: int +WNNC_NET_MSNET: int +WNNC_NET_LANMAN: int +WNNC_NET_NETWARE: int +WNNC_NET_VINES: int +WNNC_NET_10NET: int +WNNC_NET_LOCUS: int +WNNC_NET_SUN_PC_NFS: int +WNNC_NET_LANSTEP: int +WNNC_NET_9TILES: int +WNNC_NET_LANTASTIC: int +WNNC_NET_AS400: int +WNNC_NET_FTP_NFS: int +WNNC_NET_PATHWORKS: int +WNNC_NET_LIFENET: int +WNNC_NET_POWERLAN: int +WNNC_NET_BWNFS: int +WNNC_NET_COGENT: int +WNNC_NET_FARALLON: int +WNNC_NET_APPLETALK: int +WNNC_NET_INTERGRAPH: int +WNNC_NET_SYMFONET: int +WNNC_NET_CLEARCASE: int +WNNC_NET_FRONTIER: int +WNNC_NET_BMC: int +WNNC_NET_DCE: int +WNNC_NET_DECORB: int +WNNC_NET_PROTSTOR: int +WNNC_NET_FJ_REDIR: int +WNNC_NET_DISTINCT: int +WNNC_NET_TWINS: int +WNNC_NET_RDR2SAMPLE: int +RESOURCE_CONNECTED: int +RESOURCE_GLOBALNET: int +RESOURCE_REMEMBERED: int +RESOURCE_RECENT: int +RESOURCE_CONTEXT: int +RESOURCETYPE_ANY: int +RESOURCETYPE_DISK: int +RESOURCETYPE_PRINT: int +RESOURCETYPE_RESERVED: int +RESOURCETYPE_UNKNOWN: int +RESOURCEUSAGE_CONNECTABLE: int +RESOURCEUSAGE_CONTAINER: int +RESOURCEUSAGE_NOLOCALDEVICE: int +RESOURCEUSAGE_SIBLING: int +RESOURCEUSAGE_ATTACHED: int +RESOURCEUSAGE_ALL: int +RESOURCEUSAGE_RESERVED: int +RESOURCEDISPLAYTYPE_GENERIC: int +RESOURCEDISPLAYTYPE_DOMAIN: int +RESOURCEDISPLAYTYPE_SERVER: int +RESOURCEDISPLAYTYPE_SHARE: int +RESOURCEDISPLAYTYPE_FILE: int +RESOURCEDISPLAYTYPE_GROUP: int +RESOURCEDISPLAYTYPE_NETWORK: int +RESOURCEDISPLAYTYPE_ROOT: int +RESOURCEDISPLAYTYPE_SHAREADMIN: int +RESOURCEDISPLAYTYPE_DIRECTORY: int +RESOURCEDISPLAYTYPE_TREE: int +RESOURCEDISPLAYTYPE_NDSCONTAINER: int +NETPROPERTY_PERSISTENT: int +CONNECT_UPDATE_PROFILE: int +CONNECT_UPDATE_RECENT: int +CONNECT_TEMPORARY: int +CONNECT_INTERACTIVE: int +CONNECT_PROMPT: int +CONNECT_NEED_DRIVE: int +CONNECT_REFCOUNT: int +CONNECT_REDIRECT: int +CONNECT_LOCALDRIVE: int +CONNECT_CURRENT_MEDIA: int +CONNECT_DEFERRED: int +CONNECT_RESERVED: int +CONNDLG_RO_PATH: int +CONNDLG_CONN_POINT: int +CONNDLG_USE_MRU: int +CONNDLG_HIDE_BOX: int +CONNDLG_PERSIST: int +CONNDLG_NOT_PERSIST: int +DISC_UPDATE_PROFILE: int +DISC_NO_FORCE: int +UNIVERSAL_NAME_INFO_LEVEL: int +REMOTE_NAME_INFO_LEVEL: int +WNFMT_MULTILINE: int +WNFMT_ABBREVIATED: int +WNFMT_INENUM: int +WNFMT_CONNECTION: int +NETINFO_DLL16: int +NETINFO_DISKRED: int +NETINFO_PRINTERRED: int +RP_LOGON: int +RP_INIFILE: int +PP_DISPLAYERRORS: int +WNCON_FORNETCARD: int +WNCON_NOTROUTED: int +WNCON_SLOWLINK: int +WNCON_DYNAMIC: int +NetSetupUnknown: int +NetSetupMachine: int +NetSetupWorkgroup: int +NetSetupDomain: int +NetSetupNonExistentDomain: int +NetSetupDnsMachine: int +NetSetupUnknownStatus: int +NetSetupUnjoined: int +NetSetupWorkgroupName: int +NetSetupDomainName: int +NetValidateAuthentication: int +NetValidatePasswordChange: int +NetValidatePasswordReset: int +ACCESS_ACCESS_LIST_INFOLEVEL: int +ACCESS_ACCESS_LIST_PARMNUM: int +SV_ALIST_MTIME_PARMNUM: int +SV_GLIST_MTIME_PARMNUM: int +SV_TYPE_LOCAL_LIST_ONLY: int +SV_ULIST_MTIME_PARMNUM: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/win32pdhquery.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/win32pdhquery.pyi new file mode 100644 index 000000000..5130ceae5 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/win32pdhquery.pyi @@ -0,0 +1,42 @@ +from _typeshed import Incomplete + +class BaseQuery: + counters: Incomplete + paths: Incomplete + active: int + curpaths: Incomplete + def __init__(self, paths: Incomplete | None = ...) -> None: ... + def addcounterbybrowsing(self, flags=..., windowtitle: str = ...) -> None: ... + def rawaddcounter( + self, object, counter, instance: Incomplete | None = ..., inum: int = ..., machine: Incomplete | None = ... + ) -> None: ... + def addcounter( + self, object, counter, instance: Incomplete | None = ..., inum: int = ..., machine: Incomplete | None = ... + ): ... + def open(self): ... + def killbase(self, base: Incomplete | None = ...) -> None: ... + def close(self) -> None: ... + __del__: Incomplete + def collectdata(self, format=...): ... + def collectdataslave(self, format=...): ... + def __getinitargs__(self): ... + +class Query(BaseQuery): + volatilecounters: Incomplete + def __init__(self, *args, **namedargs) -> None: ... + def addinstcounter( + self, object, counter, machine: Incomplete | None = ..., objtype: str = ..., volatile: int = ..., format=... + ) -> None: ... + def getinstpaths(self, object, counter, machine: Incomplete | None = ..., objtype: str = ..., format=...): ... + def open(self, *args, **namedargs) -> None: ... + curresults: Incomplete + def collectdatafor(self, totalperiod, period: int = ...) -> None: ... + collectdatawhile_active: int + def collectdatawhile(self, period: int = ...) -> None: ... + def collectdatawhile_stop(self) -> None: ... + def collectdatawhile_slave(self, period) -> None: ... + def __getinitargs__(self): ... + +class QueryError(Exception): + query: Incomplete + def __init__(self, query) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/win32serviceutil.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/win32serviceutil.pyi new file mode 100644 index 000000000..d31471255 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/win32serviceutil.pyi @@ -0,0 +1,81 @@ +from _typeshed import Incomplete +from collections.abc import Iterable, Sequence + +error = RuntimeError + +def LocatePythonServiceExe(exe: Incomplete | None = ...): ... +def SmartOpenService(hscm, name, access): ... +def LocateSpecificServiceExe(serviceName): ... +def InstallPerfmonForService(serviceName, iniName, dllName: Incomplete | None = ...) -> None: ... +def InstallService( + pythonClassString, + serviceName, + displayName, + startType: Incomplete | None = ..., + errorControl: Incomplete | None = ..., + bRunInteractive: int = ..., + serviceDeps: Incomplete | None = ..., + userName: Incomplete | None = ..., + password: Incomplete | None = ..., + exeName: Incomplete | None = ..., + perfMonIni: Incomplete | None = ..., + perfMonDll: Incomplete | None = ..., + exeArgs: Incomplete | None = ..., + description: Incomplete | None = ..., + delayedstart: Incomplete | None = ..., +) -> None: ... +def ChangeServiceConfig( + pythonClassString, + serviceName, + startType: Incomplete | None = ..., + errorControl: Incomplete | None = ..., + bRunInteractive: int = ..., + serviceDeps: Incomplete | None = ..., + userName: Incomplete | None = ..., + password: Incomplete | None = ..., + exeName: Incomplete | None = ..., + displayName: Incomplete | None = ..., + perfMonIni: Incomplete | None = ..., + perfMonDll: Incomplete | None = ..., + exeArgs: Incomplete | None = ..., + description: Incomplete | None = ..., + delayedstart: Incomplete | None = ..., +) -> None: ... +def InstallPythonClassString(pythonClassString, serviceName) -> None: ... +def SetServiceCustomOption(serviceName, option, value) -> None: ... +def GetServiceCustomOption(serviceName, option, defaultValue: Incomplete | None = ...): ... +def RemoveService(serviceName) -> None: ... +def ControlService(serviceName, code, machine: Incomplete | None = ...): ... +def WaitForServiceStatus(serviceName, status, waitSecs, machine: Incomplete | None = ...) -> None: ... +def StopServiceWithDeps(serviceName, machine: Incomplete | None = ..., waitSecs: int = ...) -> None: ... +def StopService(serviceName, machine: Incomplete | None = ...): ... +def StartService(serviceName, args: Incomplete | None = ..., machine: Incomplete | None = ...) -> None: ... +def RestartService( + serviceName, args: Incomplete | None = ..., waitSeconds: int = ..., machine: Incomplete | None = ... +) -> None: ... +def DebugService(cls, argv=...) -> None: ... +def GetServiceClassString(cls, argv: Incomplete | None = ...): ... +def QueryServiceStatus(serviceName, machine: Incomplete | None = ...): ... +def usage() -> None: ... +def HandleCommandLine( + cls: type[ServiceFramework], + serviceClassString: Incomplete | None = ..., + argv: Sequence[str] | None = ..., + customInstallOptions: str = ..., + customOptionHandler: Incomplete | None = ..., +): ... + +class ServiceFramework: + ssh: Incomplete + checkPoint: int + def __init__(self, args: Iterable[str]) -> None: ... + def GetAcceptedControls(self): ... + def ReportServiceStatus( + self, serviceStatus, waitHint: int = ..., win32ExitCode: int = ..., svcExitCode: int = ... + ) -> None: ... + def SvcInterrogate(self) -> None: ... + def SvcOther(self, control) -> None: ... + def ServiceCtrlHandler(self, control): ... + def SvcOtherEx(self, control, event_type, data): ... + def ServiceCtrlHandlerEx(self, control, event_type, data): ... + def SvcRun(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/win32timezone.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/win32timezone.pyi new file mode 100644 index 000000000..763eee6be --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/win32timezone.pyi @@ -0,0 +1,73 @@ +import datetime +from _typeshed import Incomplete + +log: Incomplete + +class _SimpleStruct: + def __init__(self, *args, **kw) -> None: ... + def field_names(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class SYSTEMTIME(_SimpleStruct): ... +class TIME_ZONE_INFORMATION(_SimpleStruct): ... +class DYNAMIC_TIME_ZONE_INFORMATION(_SimpleStruct): ... + +class TimeZoneDefinition(DYNAMIC_TIME_ZONE_INFORMATION): + def __init__(self, *args, **kwargs) -> None: ... + def __getattribute__(self, attr: str): ... + @classmethod + def current(cls): ... + def set(self) -> None: ... + def copy(self): ... + def locate_daylight_start(self, year): ... + def locate_standard_start(self, year): ... + +class TimeZoneInfo(datetime.tzinfo): + tzRegKey: str + timeZoneName: Incomplete + fixedStandardTime: Incomplete + def __init__(self, param: Incomplete | None = ..., fix_standard_time: bool = ...) -> None: ... + def tzname(self, dt): ... + def getWinInfo(self, targetYear): ... + def utcoffset(self, dt): ... + def dst(self, dt): ... + def GetDSTStartTime(self, year): ... + def GetDSTEndTime(self, year): ... + def __cmp__(self, other): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + @classmethod + def local(cls): ... + @classmethod + def utc(cls): ... + @staticmethod + def get_sorted_time_zone_names(): ... + @staticmethod + def get_all_time_zones(): ... + @staticmethod + def get_sorted_time_zones(key: Incomplete | None = ...): ... + +def utcnow(): ... +def now(): ... +def GetTZCapabilities(): ... + +class DLLHandleCache: + def __getitem__(self, filename): ... + +DLLCache: Incomplete + +def resolveMUITimeZone(spec): ... + +class RangeMap(dict[int, str]): + sort_params: Incomplete + match: Incomplete + def __init__(self, source, sort_params=..., key_match_comparator=...) -> None: ... + def __getitem__(self, item): ... + def get(self, key, default: Incomplete | None = ...): ... + def bounds(self): ... + undefined_value: Incomplete + + class Item(int): ... + first_item: Incomplete + last_item: Incomplete diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/winerror.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/winerror.pyi new file mode 100644 index 000000000..b586d0f7a --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/winerror.pyi @@ -0,0 +1,2586 @@ +TRUST_E_PROVIDER_UNKNOWN: int +TRUST_E_ACTION_UNKNOWN: int +TRUST_E_SUBJECT_FORM_UNKNOWN: int +TRUST_E_SUBJECT_NOT_TRUSTED: int +FACILITY_WINRM: int +FACILITY_WINDOWSUPDATE: int +FACILITY_WINDOWS_DEFENDER: int +FACILITY_WINDOWS_CE: int +FACILITY_WINDOWS: int +FACILITY_URT: int +FACILITY_UMI: int +FACILITY_TPM_SOFTWARE: int +FACILITY_TPM_SERVICES: int +FACILITY_SXS: int +FACILITY_STORAGE: int +FACILITY_STATE_MANAGEMENT: int +FACILITY_SSPI: int +FACILITY_SCARD: int +FACILITY_SHELL: int +FACILITY_SETUPAPI: int +FACILITY_SECURITY: int +FACILITY_RPC: int +FACILITY_PLA: int +FACILITY_WIN32: int +FACILITY_CONTROL: int +FACILITY_NULL: int +FACILITY_NDIS: int +FACILITY_METADIRECTORY: int +FACILITY_MSMQ: int +FACILITY_MEDIASERVER: int +FACILITY_INTERNET: int +FACILITY_ITF: int +FACILITY_USERMODE_HYPERVISOR: int +FACILITY_HTTP: int +FACILITY_GRAPHICS: int +FACILITY_FWP: int +FACILITY_FVE: int +FACILITY_USERMODE_FILTER_MANAGER: int +FACILITY_DPLAY: int +FACILITY_DISPATCH: int +FACILITY_DIRECTORYSERVICE: int +FACILITY_CONFIGURATION: int +FACILITY_COMPLUS: int +FACILITY_USERMODE_COMMONLOG: int +FACILITY_CMI: int +FACILITY_CERT: int +FACILITY_BACKGROUNDCOPY: int +FACILITY_ACS: int +FACILITY_AAF: int +ERROR_SUCCESS: int +NO_ERROR: int +S_OK: int +S_FALSE: int +ERROR_INVALID_FUNCTION: int +ERROR_FILE_NOT_FOUND: int +ERROR_PATH_NOT_FOUND: int +ERROR_TOO_MANY_OPEN_FILES: int +ERROR_ACCESS_DENIED: int +ERROR_INVALID_HANDLE: int +ERROR_ARENA_TRASHED: int +ERROR_NOT_ENOUGH_MEMORY: int +ERROR_INVALID_BLOCK: int +ERROR_BAD_ENVIRONMENT: int +ERROR_BAD_FORMAT: int +ERROR_INVALID_ACCESS: int +ERROR_INVALID_DATA: int +ERROR_OUTOFMEMORY: int +ERROR_INVALID_DRIVE: int +ERROR_CURRENT_DIRECTORY: int +ERROR_NOT_SAME_DEVICE: int +ERROR_NO_MORE_FILES: int +ERROR_WRITE_PROTECT: int +ERROR_BAD_UNIT: int +ERROR_NOT_READY: int +ERROR_BAD_COMMAND: int +ERROR_CRC: int +ERROR_BAD_LENGTH: int +ERROR_SEEK: int +ERROR_NOT_DOS_DISK: int +ERROR_SECTOR_NOT_FOUND: int +ERROR_OUT_OF_PAPER: int +ERROR_WRITE_FAULT: int +ERROR_READ_FAULT: int +ERROR_GEN_FAILURE: int +ERROR_SHARING_VIOLATION: int +ERROR_LOCK_VIOLATION: int +ERROR_WRONG_DISK: int +ERROR_SHARING_BUFFER_EXCEEDED: int +ERROR_HANDLE_EOF: int +ERROR_HANDLE_DISK_FULL: int +ERROR_NOT_SUPPORTED: int +ERROR_REM_NOT_LIST: int +ERROR_DUP_NAME: int +ERROR_BAD_NETPATH: int +ERROR_NETWORK_BUSY: int +ERROR_DEV_NOT_EXIST: int +ERROR_TOO_MANY_CMDS: int +ERROR_ADAP_HDW_ERR: int +ERROR_BAD_NET_RESP: int +ERROR_UNEXP_NET_ERR: int +ERROR_BAD_REM_ADAP: int +ERROR_PRINTQ_FULL: int +ERROR_NO_SPOOL_SPACE: int +ERROR_PRINT_CANCELLED: int +ERROR_NETNAME_DELETED: int +ERROR_NETWORK_ACCESS_DENIED: int +ERROR_BAD_DEV_TYPE: int +ERROR_BAD_NET_NAME: int +ERROR_TOO_MANY_NAMES: int +ERROR_TOO_MANY_SESS: int +ERROR_SHARING_PAUSED: int +ERROR_REQ_NOT_ACCEP: int +ERROR_REDIR_PAUSED: int +ERROR_FILE_EXISTS: int +ERROR_CANNOT_MAKE: int +ERROR_FAIL_I24: int +ERROR_OUT_OF_STRUCTURES: int +ERROR_ALREADY_ASSIGNED: int +ERROR_INVALID_PASSWORD: int +ERROR_INVALID_PARAMETER: int +ERROR_NET_WRITE_FAULT: int +ERROR_NO_PROC_SLOTS: int +ERROR_TOO_MANY_SEMAPHORES: int +ERROR_EXCL_SEM_ALREADY_OWNED: int +ERROR_SEM_IS_SET: int +ERROR_TOO_MANY_SEM_REQUESTS: int +ERROR_INVALID_AT_INTERRUPT_TIME: int +ERROR_SEM_OWNER_DIED: int +ERROR_SEM_USER_LIMIT: int +ERROR_DISK_CHANGE: int +ERROR_DRIVE_LOCKED: int +ERROR_BROKEN_PIPE: int +ERROR_OPEN_FAILED: int +ERROR_BUFFER_OVERFLOW: int +ERROR_DISK_FULL: int +ERROR_NO_MORE_SEARCH_HANDLES: int +ERROR_INVALID_TARGET_HANDLE: int +ERROR_INVALID_CATEGORY: int +ERROR_INVALID_VERIFY_SWITCH: int +ERROR_BAD_DRIVER_LEVEL: int +ERROR_CALL_NOT_IMPLEMENTED: int +ERROR_SEM_TIMEOUT: int +ERROR_INSUFFICIENT_BUFFER: int +ERROR_INVALID_NAME: int +ERROR_INVALID_LEVEL: int +ERROR_NO_VOLUME_LABEL: int +ERROR_MOD_NOT_FOUND: int +ERROR_PROC_NOT_FOUND: int +ERROR_WAIT_NO_CHILDREN: int +ERROR_CHILD_NOT_COMPLETE: int +ERROR_DIRECT_ACCESS_HANDLE: int +ERROR_NEGATIVE_SEEK: int +ERROR_SEEK_ON_DEVICE: int +ERROR_IS_JOIN_TARGET: int +ERROR_IS_JOINED: int +ERROR_IS_SUBSTED: int +ERROR_NOT_JOINED: int +ERROR_NOT_SUBSTED: int +ERROR_JOIN_TO_JOIN: int +ERROR_SUBST_TO_SUBST: int +ERROR_JOIN_TO_SUBST: int +ERROR_SUBST_TO_JOIN: int +ERROR_BUSY_DRIVE: int +ERROR_SAME_DRIVE: int +ERROR_DIR_NOT_ROOT: int +ERROR_DIR_NOT_EMPTY: int +ERROR_IS_SUBST_PATH: int +ERROR_IS_JOIN_PATH: int +ERROR_PATH_BUSY: int +ERROR_IS_SUBST_TARGET: int +ERROR_SYSTEM_TRACE: int +ERROR_INVALID_EVENT_COUNT: int +ERROR_TOO_MANY_MUXWAITERS: int +ERROR_INVALID_LIST_FORMAT: int +ERROR_LABEL_TOO_LONG: int +ERROR_TOO_MANY_TCBS: int +ERROR_SIGNAL_REFUSED: int +ERROR_DISCARDED: int +ERROR_NOT_LOCKED: int +ERROR_BAD_THREADID_ADDR: int +ERROR_BAD_ARGUMENTS: int +ERROR_BAD_PATHNAME: int +ERROR_SIGNAL_PENDING: int +ERROR_MAX_THRDS_REACHED: int +ERROR_LOCK_FAILED: int +ERROR_BUSY: int +ERROR_CANCEL_VIOLATION: int +ERROR_ATOMIC_LOCKS_NOT_SUPPORTED: int +ERROR_INVALID_SEGMENT_NUMBER: int +ERROR_INVALID_ORDINAL: int +ERROR_ALREADY_EXISTS: int +ERROR_INVALID_FLAG_NUMBER: int +ERROR_SEM_NOT_FOUND: int +ERROR_INVALID_STARTING_CODESEG: int +ERROR_INVALID_STACKSEG: int +ERROR_INVALID_MODULETYPE: int +ERROR_INVALID_EXE_SIGNATURE: int +ERROR_EXE_MARKED_INVALID: int +ERROR_BAD_EXE_FORMAT: int +ERROR_ITERATED_DATA_EXCEEDS_64k: int +ERROR_INVALID_MINALLOCSIZE: int +ERROR_DYNLINK_FROM_INVALID_RING: int +ERROR_IOPL_NOT_ENABLED: int +ERROR_INVALID_SEGDPL: int +ERROR_AUTODATASEG_EXCEEDS_64k: int +ERROR_RING2SEG_MUST_BE_MOVABLE: int +ERROR_RELOC_CHAIN_XEEDS_SEGLIM: int +ERROR_INFLOOP_IN_RELOC_CHAIN: int +ERROR_ENVVAR_NOT_FOUND: int +ERROR_NO_SIGNAL_SENT: int +ERROR_FILENAME_EXCED_RANGE: int +ERROR_RING2_STACK_IN_USE: int +ERROR_META_EXPANSION_TOO_LONG: int +ERROR_INVALID_SIGNAL_NUMBER: int +ERROR_THREAD_1_INACTIVE: int +ERROR_LOCKED: int +ERROR_TOO_MANY_MODULES: int +ERROR_NESTING_NOT_ALLOWED: int +ERROR_EXE_MACHINE_TYPE_MISMATCH: int +ERROR_EXE_CANNOT_MODIFY_SIGNED_BINARY: int +ERROR_EXE_CANNOT_MODIFY_STRONG_SIGNED_BINARY: int +ERROR_FILE_CHECKED_OUT: int +ERROR_CHECKOUT_REQUIRED: int +ERROR_BAD_FILE_TYPE: int +ERROR_FILE_TOO_LARGE: int +ERROR_FORMS_AUTH_REQUIRED: int +ERROR_VIRUS_INFECTED: int +ERROR_VIRUS_DELETED: int +ERROR_PIPE_LOCAL: int +ERROR_BAD_PIPE: int +ERROR_PIPE_BUSY: int +ERROR_NO_DATA: int +ERROR_PIPE_NOT_CONNECTED: int +ERROR_MORE_DATA: int +ERROR_VC_DISCONNECTED: int +ERROR_INVALID_EA_NAME: int +ERROR_EA_LIST_INCONSISTENT: int +WAIT_TIMEOUT: int +ERROR_NO_MORE_ITEMS: int +ERROR_CANNOT_COPY: int +ERROR_DIRECTORY: int +ERROR_EAS_DIDNT_FIT: int +ERROR_EA_FILE_CORRUPT: int +ERROR_EA_TABLE_FULL: int +ERROR_INVALID_EA_HANDLE: int +ERROR_EAS_NOT_SUPPORTED: int +ERROR_NOT_OWNER: int +ERROR_TOO_MANY_POSTS: int +ERROR_PARTIAL_COPY: int +ERROR_OPLOCK_NOT_GRANTED: int +ERROR_INVALID_OPLOCK_PROTOCOL: int +ERROR_DISK_TOO_FRAGMENTED: int +ERROR_DELETE_PENDING: int +ERROR_MR_MID_NOT_FOUND: int +ERROR_SCOPE_NOT_FOUND: int +ERROR_FAIL_NOACTION_REBOOT: int +ERROR_FAIL_SHUTDOWN: int +ERROR_FAIL_RESTART: int +ERROR_MAX_SESSIONS_REACHED: int +ERROR_THREAD_MODE_ALREADY_BACKGROUND: int +ERROR_THREAD_MODE_NOT_BACKGROUND: int +ERROR_PROCESS_MODE_ALREADY_BACKGROUND: int +ERROR_PROCESS_MODE_NOT_BACKGROUND: int +ERROR_INVALID_ADDRESS: int +ERROR_USER_PROFILE_LOAD: int +ERROR_ARITHMETIC_OVERFLOW: int +ERROR_PIPE_CONNECTED: int +ERROR_PIPE_LISTENING: int +ERROR_VERIFIER_STOP: int +ERROR_ABIOS_ERROR: int +ERROR_WX86_WARNING: int +ERROR_WX86_ERROR: int +ERROR_TIMER_NOT_CANCELED: int +ERROR_UNWIND: int +ERROR_BAD_STACK: int +ERROR_INVALID_UNWIND_TARGET: int +ERROR_INVALID_PORT_ATTRIBUTES: int +ERROR_PORT_MESSAGE_TOO_LONG: int +ERROR_INVALID_QUOTA_LOWER: int +ERROR_DEVICE_ALREADY_ATTACHED: int +ERROR_INSTRUCTION_MISALIGNMENT: int +ERROR_PROFILING_NOT_STARTED: int +ERROR_PROFILING_NOT_STOPPED: int +ERROR_COULD_NOT_INTERPRET: int +ERROR_PROFILING_AT_LIMIT: int +ERROR_CANT_WAIT: int +ERROR_CANT_TERMINATE_SELF: int +ERROR_UNEXPECTED_MM_CREATE_ERR: int +ERROR_UNEXPECTED_MM_MAP_ERROR: int +ERROR_UNEXPECTED_MM_EXTEND_ERR: int +ERROR_BAD_FUNCTION_TABLE: int +ERROR_NO_GUID_TRANSLATION: int +ERROR_INVALID_LDT_SIZE: int +ERROR_INVALID_LDT_OFFSET: int +ERROR_INVALID_LDT_DESCRIPTOR: int +ERROR_TOO_MANY_THREADS: int +ERROR_THREAD_NOT_IN_PROCESS: int +ERROR_PAGEFILE_QUOTA_EXCEEDED: int +ERROR_LOGON_SERVER_CONFLICT: int +ERROR_SYNCHRONIZATION_REQUIRED: int +ERROR_NET_OPEN_FAILED: int +ERROR_IO_PRIVILEGE_FAILED: int +ERROR_CONTROL_C_EXIT: int +ERROR_MISSING_SYSTEMFILE: int +ERROR_UNHANDLED_EXCEPTION: int +ERROR_APP_INIT_FAILURE: int +ERROR_PAGEFILE_CREATE_FAILED: int +ERROR_INVALID_IMAGE_HASH: int +ERROR_NO_PAGEFILE: int +ERROR_ILLEGAL_FLOAT_CONTEXT: int +ERROR_NO_EVENT_PAIR: int +ERROR_DOMAIN_CTRLR_CONFIG_ERROR: int +ERROR_ILLEGAL_CHARACTER: int +ERROR_UNDEFINED_CHARACTER: int +ERROR_FLOPPY_VOLUME: int +ERROR_BIOS_FAILED_TO_CONNECT_INTERRUPT: int +ERROR_BACKUP_CONTROLLER: int +ERROR_MUTANT_LIMIT_EXCEEDED: int +ERROR_FS_DRIVER_REQUIRED: int +ERROR_CANNOT_LOAD_REGISTRY_FILE: int +ERROR_DEBUG_ATTACH_FAILED: int +ERROR_SYSTEM_PROCESS_TERMINATED: int +ERROR_DATA_NOT_ACCEPTED: int +ERROR_VDM_HARD_ERROR: int +ERROR_DRIVER_CANCEL_TIMEOUT: int +ERROR_REPLY_MESSAGE_MISMATCH: int +ERROR_LOST_WRITEBEHIND_DATA: int +ERROR_CLIENT_SERVER_PARAMETERS_INVALID: int +ERROR_NOT_TINY_STREAM: int +ERROR_STACK_OVERFLOW_READ: int +ERROR_CONVERT_TO_LARGE: int +ERROR_FOUND_OUT_OF_SCOPE: int +ERROR_ALLOCATE_BUCKET: int +ERROR_MARSHALL_OVERFLOW: int +ERROR_INVALID_VARIANT: int +ERROR_BAD_COMPRESSION_BUFFER: int +ERROR_AUDIT_FAILED: int +ERROR_TIMER_RESOLUTION_NOT_SET: int +ERROR_INSUFFICIENT_LOGON_INFO: int +ERROR_BAD_DLL_ENTRYPOINT: int +ERROR_BAD_SERVICE_ENTRYPOINT: int +ERROR_IP_ADDRESS_CONFLICT1: int +ERROR_IP_ADDRESS_CONFLICT2: int +ERROR_REGISTRY_QUOTA_LIMIT: int +ERROR_NO_CALLBACK_ACTIVE: int +ERROR_PWD_TOO_SHORT: int +ERROR_PWD_TOO_RECENT: int +ERROR_PWD_HISTORY_CONFLICT: int +ERROR_UNSUPPORTED_COMPRESSION: int +ERROR_INVALID_HW_PROFILE: int +ERROR_INVALID_PLUGPLAY_DEVICE_PATH: int +ERROR_QUOTA_LIST_INCONSISTENT: int +ERROR_EVALUATION_EXPIRATION: int +ERROR_ILLEGAL_DLL_RELOCATION: int +ERROR_DLL_INIT_FAILED_LOGOFF: int +ERROR_VALIDATE_CONTINUE: int +ERROR_NO_MORE_MATCHES: int +ERROR_RANGE_LIST_CONFLICT: int +ERROR_SERVER_SID_MISMATCH: int +ERROR_CANT_ENABLE_DENY_ONLY: int +ERROR_FLOAT_MULTIPLE_FAULTS: int +ERROR_FLOAT_MULTIPLE_TRAPS: int +ERROR_NOINTERFACE: int +ERROR_DRIVER_FAILED_SLEEP: int +ERROR_CORRUPT_SYSTEM_FILE: int +ERROR_COMMITMENT_MINIMUM: int +ERROR_PNP_RESTART_ENUMERATION: int +ERROR_SYSTEM_IMAGE_BAD_SIGNATURE: int +ERROR_PNP_REBOOT_REQUIRED: int +ERROR_INSUFFICIENT_POWER: int +ERROR_MULTIPLE_FAULT_VIOLATION: int +ERROR_SYSTEM_SHUTDOWN: int +ERROR_PORT_NOT_SET: int +ERROR_DS_VERSION_CHECK_FAILURE: int +ERROR_RANGE_NOT_FOUND: int +ERROR_NOT_SAFE_MODE_DRIVER: int +ERROR_FAILED_DRIVER_ENTRY: int +ERROR_DEVICE_ENUMERATION_ERROR: int +ERROR_MOUNT_POINT_NOT_RESOLVED: int +ERROR_INVALID_DEVICE_OBJECT_PARAMETER: int +ERROR_MCA_OCCURED: int +ERROR_DRIVER_DATABASE_ERROR: int +ERROR_SYSTEM_HIVE_TOO_LARGE: int +ERROR_DRIVER_FAILED_PRIOR_UNLOAD: int +ERROR_VOLSNAP_PREPARE_HIBERNATE: int +ERROR_HIBERNATION_FAILURE: int +ERROR_FILE_SYSTEM_LIMITATION: int +ERROR_ASSERTION_FAILURE: int +ERROR_ACPI_ERROR: int +ERROR_WOW_ASSERTION: int +ERROR_PNP_BAD_MPS_TABLE: int +ERROR_PNP_TRANSLATION_FAILED: int +ERROR_PNP_IRQ_TRANSLATION_FAILED: int +ERROR_PNP_INVALID_ID: int +ERROR_WAKE_SYSTEM_DEBUGGER: int +ERROR_HANDLES_CLOSED: int +ERROR_EXTRANEOUS_INFORMATION: int +ERROR_RXACT_COMMIT_NECESSARY: int +ERROR_MEDIA_CHECK: int +ERROR_GUID_SUBSTITUTION_MADE: int +ERROR_STOPPED_ON_SYMLINK: int +ERROR_LONGJUMP: int +ERROR_PLUGPLAY_QUERY_VETOED: int +ERROR_UNWIND_CONSOLIDATE: int +ERROR_REGISTRY_HIVE_RECOVERED: int +ERROR_DLL_MIGHT_BE_INSECURE: int +ERROR_DLL_MIGHT_BE_INCOMPATIBLE: int +ERROR_DBG_EXCEPTION_NOT_HANDLED: int +ERROR_DBG_REPLY_LATER: int +ERROR_DBG_UNABLE_TO_PROVIDE_HANDLE: int +ERROR_DBG_TERMINATE_THREAD: int +ERROR_DBG_TERMINATE_PROCESS: int +ERROR_DBG_CONTROL_C: int +ERROR_DBG_PRINTEXCEPTION_C: int +ERROR_DBG_RIPEXCEPTION: int +ERROR_DBG_CONTROL_BREAK: int +ERROR_DBG_COMMAND_EXCEPTION: int +ERROR_OBJECT_NAME_EXISTS: int +ERROR_THREAD_WAS_SUSPENDED: int +ERROR_IMAGE_NOT_AT_BASE: int +ERROR_RXACT_STATE_CREATED: int +ERROR_SEGMENT_NOTIFICATION: int +ERROR_BAD_CURRENT_DIRECTORY: int +ERROR_FT_READ_RECOVERY_FROM_BACKUP: int +ERROR_FT_WRITE_RECOVERY: int +ERROR_IMAGE_MACHINE_TYPE_MISMATCH: int +ERROR_RECEIVE_PARTIAL: int +ERROR_RECEIVE_EXPEDITED: int +ERROR_RECEIVE_PARTIAL_EXPEDITED: int +ERROR_EVENT_DONE: int +ERROR_EVENT_PENDING: int +ERROR_CHECKING_FILE_SYSTEM: int +ERROR_FATAL_APP_EXIT: int +ERROR_PREDEFINED_HANDLE: int +ERROR_WAS_UNLOCKED: int +ERROR_SERVICE_NOTIFICATION: int +ERROR_WAS_LOCKED: int +ERROR_LOG_HARD_ERROR: int +ERROR_ALREADY_WIN32: int +ERROR_IMAGE_MACHINE_TYPE_MISMATCH_EXE: int +ERROR_NO_YIELD_PERFORMED: int +ERROR_TIMER_RESUME_IGNORED: int +ERROR_ARBITRATION_UNHANDLED: int +ERROR_CARDBUS_NOT_SUPPORTED: int +ERROR_MP_PROCESSOR_MISMATCH: int +ERROR_HIBERNATED: int +ERROR_RESUME_HIBERNATION: int +ERROR_FIRMWARE_UPDATED: int +ERROR_DRIVERS_LEAKING_LOCKED_PAGES: int +ERROR_WAKE_SYSTEM: int +ERROR_WAIT_1: int +ERROR_WAIT_2: int +ERROR_WAIT_3: int +ERROR_WAIT_63: int +ERROR_ABANDONED_WAIT_0: int +ERROR_ABANDONED_WAIT_63: int +ERROR_USER_APC: int +ERROR_KERNEL_APC: int +ERROR_ALERTED: int +ERROR_ELEVATION_REQUIRED: int +ERROR_REPARSE: int +ERROR_OPLOCK_BREAK_IN_PROGRESS: int +ERROR_VOLUME_MOUNTED: int +ERROR_RXACT_COMMITTED: int +ERROR_NOTIFY_CLEANUP: int +ERROR_PRIMARY_TRANSPORT_CONNECT_FAILED: int +ERROR_PAGE_FAULT_TRANSITION: int +ERROR_PAGE_FAULT_DEMAND_ZERO: int +ERROR_PAGE_FAULT_COPY_ON_WRITE: int +ERROR_PAGE_FAULT_GUARD_PAGE: int +ERROR_PAGE_FAULT_PAGING_FILE: int +ERROR_CACHE_PAGE_LOCKED: int +ERROR_CRASH_DUMP: int +ERROR_BUFFER_ALL_ZEROS: int +ERROR_REPARSE_OBJECT: int +ERROR_RESOURCE_REQUIREMENTS_CHANGED: int +ERROR_TRANSLATION_COMPLETE: int +ERROR_NOTHING_TO_TERMINATE: int +ERROR_PROCESS_NOT_IN_JOB: int +ERROR_PROCESS_IN_JOB: int +ERROR_VOLSNAP_HIBERNATE_READY: int +ERROR_FSFILTER_OP_COMPLETED_SUCCESSFULLY: int +ERROR_INTERRUPT_VECTOR_ALREADY_CONNECTED: int +ERROR_INTERRUPT_STILL_CONNECTED: int +ERROR_WAIT_FOR_OPLOCK: int +ERROR_DBG_EXCEPTION_HANDLED: int +ERROR_DBG_CONTINUE: int +ERROR_CALLBACK_POP_STACK: int +ERROR_COMPRESSION_DISABLED: int +ERROR_CANTFETCHBACKWARDS: int +ERROR_CANTSCROLLBACKWARDS: int +ERROR_ROWSNOTRELEASED: int +ERROR_BAD_ACCESSOR_FLAGS: int +ERROR_ERRORS_ENCOUNTERED: int +ERROR_NOT_CAPABLE: int +ERROR_REQUEST_OUT_OF_SEQUENCE: int +ERROR_VERSION_PARSE_ERROR: int +ERROR_BADSTARTPOSITION: int +ERROR_MEMORY_HARDWARE: int +ERROR_DISK_REPAIR_DISABLED: int +ERROR_INSUFFICIENT_RESOURCE_FOR_SPECIFIED_SHARED_SECTION_SIZE: int +ERROR_SYSTEM_POWERSTATE_TRANSITION: int +ERROR_SYSTEM_POWERSTATE_COMPLEX_TRANSITION: int +ERROR_MCA_EXCEPTION: int +ERROR_ACCESS_AUDIT_BY_POLICY: int +ERROR_ACCESS_DISABLED_NO_SAFER_UI_BY_POLICY: int +ERROR_ABANDON_HIBERFILE: int +ERROR_LOST_WRITEBEHIND_DATA_NETWORK_DISCONNECTED: int +ERROR_LOST_WRITEBEHIND_DATA_NETWORK_SERVER_ERROR: int +ERROR_LOST_WRITEBEHIND_DATA_LOCAL_DISK_ERROR: int +ERROR_BAD_MCFG_TABLE: int +ERROR_EA_ACCESS_DENIED: int +ERROR_OPERATION_ABORTED: int +ERROR_IO_INCOMPLETE: int +ERROR_IO_PENDING: int +ERROR_NOACCESS: int +ERROR_SWAPERROR: int +ERROR_STACK_OVERFLOW: int +ERROR_INVALID_MESSAGE: int +ERROR_CAN_NOT_COMPLETE: int +ERROR_INVALID_FLAGS: int +ERROR_UNRECOGNIZED_VOLUME: int +ERROR_FILE_INVALID: int +ERROR_FULLSCREEN_MODE: int +ERROR_NO_TOKEN: int +ERROR_BADDB: int +ERROR_BADKEY: int +ERROR_CANTOPEN: int +ERROR_CANTREAD: int +ERROR_CANTWRITE: int +ERROR_REGISTRY_RECOVERED: int +ERROR_REGISTRY_CORRUPT: int +ERROR_REGISTRY_IO_FAILED: int +ERROR_NOT_REGISTRY_FILE: int +ERROR_KEY_DELETED: int +ERROR_NO_LOG_SPACE: int +ERROR_KEY_HAS_CHILDREN: int +ERROR_CHILD_MUST_BE_VOLATILE: int +ERROR_NOTIFY_ENUM_DIR: int +ERROR_DEPENDENT_SERVICES_RUNNING: int +ERROR_INVALID_SERVICE_CONTROL: int +ERROR_SERVICE_REQUEST_TIMEOUT: int +ERROR_SERVICE_NO_THREAD: int +ERROR_SERVICE_DATABASE_LOCKED: int +ERROR_SERVICE_ALREADY_RUNNING: int +ERROR_INVALID_SERVICE_ACCOUNT: int +ERROR_SERVICE_DISABLED: int +ERROR_CIRCULAR_DEPENDENCY: int +ERROR_SERVICE_DOES_NOT_EXIST: int +ERROR_SERVICE_CANNOT_ACCEPT_CTRL: int +ERROR_SERVICE_NOT_ACTIVE: int +ERROR_FAILED_SERVICE_CONTROLLER_CONNECT: int +ERROR_EXCEPTION_IN_SERVICE: int +ERROR_DATABASE_DOES_NOT_EXIST: int +ERROR_SERVICE_SPECIFIC_ERROR: int +ERROR_PROCESS_ABORTED: int +ERROR_SERVICE_DEPENDENCY_FAIL: int +ERROR_SERVICE_LOGON_FAILED: int +ERROR_SERVICE_START_HANG: int +ERROR_INVALID_SERVICE_LOCK: int +ERROR_SERVICE_MARKED_FOR_DELETE: int +ERROR_SERVICE_EXISTS: int +ERROR_ALREADY_RUNNING_LKG: int +ERROR_SERVICE_DEPENDENCY_DELETED: int +ERROR_BOOT_ALREADY_ACCEPTED: int +ERROR_SERVICE_NEVER_STARTED: int +ERROR_DUPLICATE_SERVICE_NAME: int +ERROR_DIFFERENT_SERVICE_ACCOUNT: int +ERROR_CANNOT_DETECT_DRIVER_FAILURE: int +ERROR_CANNOT_DETECT_PROCESS_ABORT: int +ERROR_NO_RECOVERY_PROGRAM: int +ERROR_SERVICE_NOT_IN_EXE: int +ERROR_NOT_SAFEBOOT_SERVICE: int +ERROR_END_OF_MEDIA: int +ERROR_FILEMARK_DETECTED: int +ERROR_BEGINNING_OF_MEDIA: int +ERROR_SETMARK_DETECTED: int +ERROR_NO_DATA_DETECTED: int +ERROR_PARTITION_FAILURE: int +ERROR_INVALID_BLOCK_LENGTH: int +ERROR_DEVICE_NOT_PARTITIONED: int +ERROR_UNABLE_TO_LOCK_MEDIA: int +ERROR_UNABLE_TO_UNLOAD_MEDIA: int +ERROR_MEDIA_CHANGED: int +ERROR_BUS_RESET: int +ERROR_NO_MEDIA_IN_DRIVE: int +ERROR_NO_UNICODE_TRANSLATION: int +ERROR_DLL_INIT_FAILED: int +ERROR_SHUTDOWN_IN_PROGRESS: int +ERROR_NO_SHUTDOWN_IN_PROGRESS: int +ERROR_IO_DEVICE: int +ERROR_SERIAL_NO_DEVICE: int +ERROR_IRQ_BUSY: int +ERROR_MORE_WRITES: int +ERROR_COUNTER_TIMEOUT: int +ERROR_FLOPPY_ID_MARK_NOT_FOUND: int +ERROR_FLOPPY_WRONG_CYLINDER: int +ERROR_FLOPPY_UNKNOWN_ERROR: int +ERROR_FLOPPY_BAD_REGISTERS: int +ERROR_DISK_RECALIBRATE_FAILED: int +ERROR_DISK_OPERATION_FAILED: int +ERROR_DISK_RESET_FAILED: int +ERROR_EOM_OVERFLOW: int +ERROR_NOT_ENOUGH_SERVER_MEMORY: int +ERROR_POSSIBLE_DEADLOCK: int +ERROR_MAPPED_ALIGNMENT: int +ERROR_SET_POWER_STATE_VETOED: int +ERROR_SET_POWER_STATE_FAILED: int +ERROR_TOO_MANY_LINKS: int +ERROR_OLD_WIN_VERSION: int +ERROR_APP_WRONG_OS: int +ERROR_SINGLE_INSTANCE_APP: int +ERROR_RMODE_APP: int +ERROR_INVALID_DLL: int +ERROR_NO_ASSOCIATION: int +ERROR_DDE_FAIL: int +ERROR_DLL_NOT_FOUND: int +ERROR_NO_MORE_USER_HANDLES: int +ERROR_MESSAGE_SYNC_ONLY: int +ERROR_SOURCE_ELEMENT_EMPTY: int +ERROR_DESTINATION_ELEMENT_FULL: int +ERROR_ILLEGAL_ELEMENT_ADDRESS: int +ERROR_MAGAZINE_NOT_PRESENT: int +ERROR_DEVICE_REINITIALIZATION_NEEDED: int +ERROR_DEVICE_REQUIRES_CLEANING: int +ERROR_DEVICE_DOOR_OPEN: int +ERROR_DEVICE_NOT_CONNECTED: int +ERROR_NOT_FOUND: int +ERROR_NO_MATCH: int +ERROR_SET_NOT_FOUND: int +ERROR_POINT_NOT_FOUND: int +ERROR_NO_TRACKING_SERVICE: int +ERROR_NO_VOLUME_ID: int +ERROR_CONNECTED_OTHER_PASSWORD: int +ERROR_BAD_USERNAME: int +ERROR_NOT_CONNECTED: int +ERROR_OPEN_FILES: int +ERROR_ACTIVE_CONNECTIONS: int +ERROR_DEVICE_IN_USE: int +ERROR_BAD_DEVICE: int +ERROR_CONNECTION_UNAVAIL: int +ERROR_DEVICE_ALREADY_REMEMBERED: int +ERROR_NO_NET_OR_BAD_PATH: int +ERROR_BAD_PROVIDER: int +ERROR_CANNOT_OPEN_PROFILE: int +ERROR_BAD_PROFILE: int +ERROR_NOT_CONTAINER: int +ERROR_EXTENDED_ERROR: int +ERROR_INVALID_GROUPNAME: int +ERROR_INVALID_COMPUTERNAME: int +ERROR_INVALID_EVENTNAME: int +ERROR_INVALID_DOMAINNAME: int +ERROR_INVALID_SERVICENAME: int +ERROR_INVALID_NETNAME: int +ERROR_INVALID_SHARENAME: int +ERROR_INVALID_PASSWORDNAME: int +ERROR_INVALID_MESSAGENAME: int +ERROR_INVALID_MESSAGEDEST: int +ERROR_SESSION_CREDENTIAL_CONFLICT: int +ERROR_REMOTE_SESSION_LIMIT_EXCEEDED: int +ERROR_DUP_DOMAINNAME: int +ERROR_NO_NETWORK: int +ERROR_CANCELLED: int +ERROR_USER_MAPPED_FILE: int +ERROR_CONNECTION_REFUSED: int +ERROR_GRACEFUL_DISCONNECT: int +ERROR_ADDRESS_ALREADY_ASSOCIATED: int +ERROR_ADDRESS_NOT_ASSOCIATED: int +ERROR_CONNECTION_INVALID: int +ERROR_CONNECTION_ACTIVE: int +ERROR_NETWORK_UNREACHABLE: int +ERROR_HOST_UNREACHABLE: int +ERROR_PROTOCOL_UNREACHABLE: int +ERROR_PORT_UNREACHABLE: int +ERROR_REQUEST_ABORTED: int +ERROR_CONNECTION_ABORTED: int +ERROR_RETRY: int +ERROR_CONNECTION_COUNT_LIMIT: int +ERROR_LOGIN_TIME_RESTRICTION: int +ERROR_LOGIN_WKSTA_RESTRICTION: int +ERROR_INCORRECT_ADDRESS: int +ERROR_ALREADY_REGISTERED: int +ERROR_SERVICE_NOT_FOUND: int +ERROR_NOT_AUTHENTICATED: int +ERROR_NOT_LOGGED_ON: int +ERROR_CONTINUE: int +ERROR_ALREADY_INITIALIZED: int +ERROR_NO_MORE_DEVICES: int +ERROR_NO_SUCH_SITE: int +ERROR_DOMAIN_CONTROLLER_EXISTS: int +ERROR_DS_NOT_INSTALLED: int +ERROR_NOT_ALL_ASSIGNED: int +ERROR_SOME_NOT_MAPPED: int +ERROR_NO_QUOTAS_FOR_ACCOUNT: int +ERROR_LOCAL_USER_SESSION_KEY: int +ERROR_NULL_LM_PASSWORD: int +ERROR_UNKNOWN_REVISION: int +ERROR_REVISION_MISMATCH: int +ERROR_INVALID_OWNER: int +ERROR_INVALID_PRIMARY_GROUP: int +ERROR_NO_IMPERSONATION_TOKEN: int +ERROR_CANT_DISABLE_MANDATORY: int +ERROR_NO_LOGON_SERVERS: int +ERROR_NO_SUCH_LOGON_SESSION: int +ERROR_NO_SUCH_PRIVILEGE: int +ERROR_PRIVILEGE_NOT_HELD: int +ERROR_INVALID_ACCOUNT_NAME: int +ERROR_USER_EXISTS: int +ERROR_NO_SUCH_USER: int +ERROR_GROUP_EXISTS: int +ERROR_NO_SUCH_GROUP: int +ERROR_MEMBER_IN_GROUP: int +ERROR_MEMBER_NOT_IN_GROUP: int +ERROR_LAST_ADMIN: int +ERROR_WRONG_PASSWORD: int +ERROR_ILL_FORMED_PASSWORD: int +ERROR_PASSWORD_RESTRICTION: int +ERROR_LOGON_FAILURE: int +ERROR_ACCOUNT_RESTRICTION: int +ERROR_INVALID_LOGON_HOURS: int +ERROR_INVALID_WORKSTATION: int +ERROR_PASSWORD_EXPIRED: int +ERROR_ACCOUNT_DISABLED: int +ERROR_NONE_MAPPED: int +ERROR_TOO_MANY_LUIDS_REQUESTED: int +ERROR_LUIDS_EXHAUSTED: int +ERROR_INVALID_SUB_AUTHORITY: int +ERROR_INVALID_ACL: int +ERROR_INVALID_SID: int +ERROR_INVALID_SECURITY_DESCR: int +ERROR_BAD_INHERITANCE_ACL: int +ERROR_SERVER_DISABLED: int +ERROR_SERVER_NOT_DISABLED: int +ERROR_INVALID_ID_AUTHORITY: int +ERROR_ALLOTTED_SPACE_EXCEEDED: int +ERROR_INVALID_GROUP_ATTRIBUTES: int +ERROR_BAD_IMPERSONATION_LEVEL: int +ERROR_CANT_OPEN_ANONYMOUS: int +ERROR_BAD_VALIDATION_CLASS: int +ERROR_BAD_TOKEN_TYPE: int +ERROR_NO_SECURITY_ON_OBJECT: int +ERROR_CANT_ACCESS_DOMAIN_INFO: int +ERROR_INVALID_SERVER_STATE: int +ERROR_INVALID_DOMAIN_STATE: int +ERROR_INVALID_DOMAIN_ROLE: int +ERROR_NO_SUCH_DOMAIN: int +ERROR_DOMAIN_EXISTS: int +ERROR_DOMAIN_LIMIT_EXCEEDED: int +ERROR_INTERNAL_DB_CORRUPTION: int +ERROR_INTERNAL_ERROR: int +ERROR_GENERIC_NOT_MAPPED: int +ERROR_BAD_DESCRIPTOR_FORMAT: int +ERROR_NOT_LOGON_PROCESS: int +ERROR_LOGON_SESSION_EXISTS: int +ERROR_NO_SUCH_PACKAGE: int +ERROR_BAD_LOGON_SESSION_STATE: int +ERROR_LOGON_SESSION_COLLISION: int +ERROR_INVALID_LOGON_TYPE: int +ERROR_CANNOT_IMPERSONATE: int +ERROR_RXACT_INVALID_STATE: int +ERROR_RXACT_COMMIT_FAILURE: int +ERROR_SPECIAL_ACCOUNT: int +ERROR_SPECIAL_GROUP: int +ERROR_SPECIAL_USER: int +ERROR_MEMBERS_PRIMARY_GROUP: int +ERROR_TOKEN_ALREADY_IN_USE: int +ERROR_NO_SUCH_ALIAS: int +ERROR_MEMBER_NOT_IN_ALIAS: int +ERROR_MEMBER_IN_ALIAS: int +ERROR_ALIAS_EXISTS: int +ERROR_LOGON_NOT_GRANTED: int +ERROR_TOO_MANY_SECRETS: int +ERROR_SECRET_TOO_LONG: int +ERROR_INTERNAL_DB_ERROR: int +ERROR_TOO_MANY_CONTEXT_IDS: int +ERROR_LOGON_TYPE_NOT_GRANTED: int +ERROR_NT_CROSS_ENCRYPTION_REQUIRED: int +ERROR_NO_SUCH_MEMBER: int +ERROR_INVALID_MEMBER: int +ERROR_TOO_MANY_SIDS: int +ERROR_LM_CROSS_ENCRYPTION_REQUIRED: int +ERROR_NO_INHERITANCE: int +ERROR_FILE_CORRUPT: int +ERROR_DISK_CORRUPT: int +ERROR_NO_USER_SESSION_KEY: int +ERROR_LICENSE_QUOTA_EXCEEDED: int +ERROR_INVALID_WINDOW_HANDLE: int +ERROR_INVALID_MENU_HANDLE: int +ERROR_INVALID_CURSOR_HANDLE: int +ERROR_INVALID_ACCEL_HANDLE: int +ERROR_INVALID_HOOK_HANDLE: int +ERROR_INVALID_DWP_HANDLE: int +ERROR_TLW_WITH_WSCHILD: int +ERROR_CANNOT_FIND_WND_CLASS: int +ERROR_WINDOW_OF_OTHER_THREAD: int +ERROR_HOTKEY_ALREADY_REGISTERED: int +ERROR_CLASS_ALREADY_EXISTS: int +ERROR_CLASS_DOES_NOT_EXIST: int +ERROR_CLASS_HAS_WINDOWS: int +ERROR_INVALID_INDEX: int +ERROR_INVALID_ICON_HANDLE: int +ERROR_PRIVATE_DIALOG_INDEX: int +ERROR_LISTBOX_ID_NOT_FOUND: int +ERROR_NO_WILDCARD_CHARACTERS: int +ERROR_CLIPBOARD_NOT_OPEN: int +ERROR_HOTKEY_NOT_REGISTERED: int +ERROR_WINDOW_NOT_DIALOG: int +ERROR_CONTROL_ID_NOT_FOUND: int +ERROR_INVALID_COMBOBOX_MESSAGE: int +ERROR_WINDOW_NOT_COMBOBOX: int +ERROR_INVALID_EDIT_HEIGHT: int +ERROR_DC_NOT_FOUND: int +ERROR_INVALID_HOOK_FILTER: int +ERROR_INVALID_FILTER_PROC: int +ERROR_HOOK_NEEDS_HMOD: int +ERROR_GLOBAL_ONLY_HOOK: int +ERROR_JOURNAL_HOOK_SET: int +ERROR_HOOK_NOT_INSTALLED: int +ERROR_INVALID_LB_MESSAGE: int +ERROR_SETCOUNT_ON_BAD_LB: int +ERROR_LB_WITHOUT_TABSTOPS: int +ERROR_DESTROY_OBJECT_OF_OTHER_THREAD: int +ERROR_CHILD_WINDOW_MENU: int +ERROR_NO_SYSTEM_MENU: int +ERROR_INVALID_MSGBOX_STYLE: int +ERROR_INVALID_SPI_VALUE: int +ERROR_SCREEN_ALREADY_LOCKED: int +ERROR_HWNDS_HAVE_DIFF_PARENT: int +ERROR_NOT_CHILD_WINDOW: int +ERROR_INVALID_GW_COMMAND: int +ERROR_INVALID_THREAD_ID: int +ERROR_NON_MDICHILD_WINDOW: int +ERROR_POPUP_ALREADY_ACTIVE: int +ERROR_NO_SCROLLBARS: int +ERROR_INVALID_SCROLLBAR_RANGE: int +ERROR_INVALID_SHOWWIN_COMMAND: int +ERROR_NO_SYSTEM_RESOURCES: int +ERROR_NONPAGED_SYSTEM_RESOURCES: int +ERROR_PAGED_SYSTEM_RESOURCES: int +ERROR_WORKING_SET_QUOTA: int +ERROR_PAGEFILE_QUOTA: int +ERROR_COMMITMENT_LIMIT: int +ERROR_MENU_ITEM_NOT_FOUND: int +ERROR_INVALID_KEYBOARD_HANDLE: int +ERROR_HOOK_TYPE_NOT_ALLOWED: int +ERROR_REQUIRES_INTERACTIVE_WINDOWSTATION: int +ERROR_TIMEOUT: int +ERROR_INVALID_MONITOR_HANDLE: int +ERROR_INCORRECT_SIZE: int +ERROR_SYMLINK_CLASS_DISABLED: int +ERROR_SYMLINK_NOT_SUPPORTED: int +ERROR_XML_PARSE_ERROR: int +ERROR_XMLDSIG_ERROR: int +ERROR_RESTART_APPLICATION: int +ERROR_WRONG_COMPARTMENT: int +ERROR_AUTHIP_FAILURE: int +ERROR_EVENTLOG_FILE_CORRUPT: int +ERROR_EVENTLOG_CANT_START: int +ERROR_LOG_FILE_FULL: int +ERROR_EVENTLOG_FILE_CHANGED: int +ERROR_INSTALL_SERVICE: int +ERROR_INSTALL_USEREXIT: int +ERROR_INSTALL_FAILURE: int +ERROR_INSTALL_SUSPEND: int +ERROR_UNKNOWN_PRODUCT: int +ERROR_UNKNOWN_FEATURE: int +ERROR_UNKNOWN_COMPONENT: int +ERROR_UNKNOWN_PROPERTY: int +ERROR_INVALID_HANDLE_STATE: int +ERROR_BAD_CONFIGURATION: int +ERROR_INDEX_ABSENT: int +ERROR_INSTALL_SOURCE_ABSENT: int +ERROR_BAD_DATABASE_VERSION: int +ERROR_PRODUCT_UNINSTALLED: int +ERROR_BAD_QUERY_SYNTAX: int +ERROR_INVALID_FIELD: int +ERROR_DEVICE_REMOVED: int +ERROR_INSTALL_ALREADY_RUNNING: int +ERROR_INSTALL_PACKAGE_OPEN_FAILED: int +ERROR_INSTALL_PACKAGE_INVALID: int +ERROR_INSTALL_UI_FAILURE: int +ERROR_INSTALL_LOG_FAILURE: int +ERROR_INSTALL_LANGUAGE_UNSUPPORTED: int +ERROR_INSTALL_TRANSFORM_FAILURE: int +ERROR_INSTALL_PACKAGE_REJECTED: int +ERROR_FUNCTION_NOT_CALLED: int +ERROR_FUNCTION_FAILED: int +ERROR_INVALID_TABLE: int +ERROR_DATATYPE_MISMATCH: int +ERROR_UNSUPPORTED_TYPE: int +ERROR_CREATE_FAILED: int +ERROR_INSTALL_TEMP_UNWRITABLE: int +ERROR_INSTALL_PLATFORM_UNSUPPORTED: int +ERROR_INSTALL_NOTUSED: int +ERROR_PATCH_PACKAGE_OPEN_FAILED: int +ERROR_PATCH_PACKAGE_INVALID: int +ERROR_PATCH_PACKAGE_UNSUPPORTED: int +ERROR_PRODUCT_VERSION: int +ERROR_INVALID_COMMAND_LINE: int +ERROR_INSTALL_REMOTE_DISALLOWED: int +ERROR_SUCCESS_REBOOT_INITIATED: int +ERROR_PATCH_TARGET_NOT_FOUND: int +ERROR_PATCH_PACKAGE_REJECTED: int +ERROR_INSTALL_TRANSFORM_REJECTED: int +ERROR_INSTALL_REMOTE_PROHIBITED: int +ERROR_PATCH_REMOVAL_UNSUPPORTED: int +ERROR_UNKNOWN_PATCH: int +ERROR_PATCH_NO_SEQUENCE: int +ERROR_PATCH_REMOVAL_DISALLOWED: int +ERROR_INVALID_PATCH_XML: int +ERROR_PATCH_MANAGED_ADVERTISED_PRODUCT: int +ERROR_INSTALL_SERVICE_SAFEBOOT: int +RPC_S_INVALID_STRING_BINDING: int +RPC_S_WRONG_KIND_OF_BINDING: int +RPC_S_INVALID_BINDING: int +RPC_S_PROTSEQ_NOT_SUPPORTED: int +RPC_S_INVALID_RPC_PROTSEQ: int +RPC_S_INVALID_STRING_UUID: int +RPC_S_INVALID_ENDPOINT_FORMAT: int +RPC_S_INVALID_NET_ADDR: int +RPC_S_NO_ENDPOINT_FOUND: int +RPC_S_INVALID_TIMEOUT: int +RPC_S_OBJECT_NOT_FOUND: int +RPC_S_ALREADY_REGISTERED: int +RPC_S_TYPE_ALREADY_REGISTERED: int +RPC_S_ALREADY_LISTENING: int +RPC_S_NO_PROTSEQS_REGISTERED: int +RPC_S_NOT_LISTENING: int +RPC_S_UNKNOWN_MGR_TYPE: int +RPC_S_UNKNOWN_IF: int +RPC_S_NO_BINDINGS: int +RPC_S_NO_PROTSEQS: int +RPC_S_CANT_CREATE_ENDPOINT: int +RPC_S_OUT_OF_RESOURCES: int +RPC_S_SERVER_UNAVAILABLE: int +RPC_S_SERVER_TOO_BUSY: int +RPC_S_INVALID_NETWORK_OPTIONS: int +RPC_S_NO_CALL_ACTIVE: int +RPC_S_CALL_FAILED: int +RPC_S_CALL_FAILED_DNE: int +RPC_S_PROTOCOL_ERROR: int +RPC_S_PROXY_ACCESS_DENIED: int +RPC_S_UNSUPPORTED_TRANS_SYN: int +RPC_S_UNSUPPORTED_TYPE: int +RPC_S_INVALID_TAG: int +RPC_S_INVALID_BOUND: int +RPC_S_NO_ENTRY_NAME: int +RPC_S_INVALID_NAME_SYNTAX: int +RPC_S_UNSUPPORTED_NAME_SYNTAX: int +RPC_S_UUID_NO_ADDRESS: int +RPC_S_DUPLICATE_ENDPOINT: int +RPC_S_UNKNOWN_AUTHN_TYPE: int +RPC_S_MAX_CALLS_TOO_SMALL: int +RPC_S_STRING_TOO_LONG: int +RPC_S_PROTSEQ_NOT_FOUND: int +RPC_S_PROCNUM_OUT_OF_RANGE: int +RPC_S_BINDING_HAS_NO_AUTH: int +RPC_S_UNKNOWN_AUTHN_SERVICE: int +RPC_S_UNKNOWN_AUTHN_LEVEL: int +RPC_S_INVALID_AUTH_IDENTITY: int +RPC_S_UNKNOWN_AUTHZ_SERVICE: int +EPT_S_INVALID_ENTRY: int +EPT_S_CANT_PERFORM_OP: int +EPT_S_NOT_REGISTERED: int +RPC_S_NOTHING_TO_EXPORT: int +RPC_S_INCOMPLETE_NAME: int +RPC_S_INVALID_VERS_OPTION: int +RPC_S_NO_MORE_MEMBERS: int +RPC_S_NOT_ALL_OBJS_UNEXPORTED: int +RPC_S_INTERFACE_NOT_FOUND: int +RPC_S_ENTRY_ALREADY_EXISTS: int +RPC_S_ENTRY_NOT_FOUND: int +RPC_S_NAME_SERVICE_UNAVAILABLE: int +RPC_S_INVALID_NAF_ID: int +RPC_S_CANNOT_SUPPORT: int +RPC_S_NO_CONTEXT_AVAILABLE: int +RPC_S_INTERNAL_ERROR: int +RPC_S_ZERO_DIVIDE: int +RPC_S_ADDRESS_ERROR: int +RPC_S_FP_DIV_ZERO: int +RPC_S_FP_UNDERFLOW: int +RPC_S_FP_OVERFLOW: int +RPC_X_NO_MORE_ENTRIES: int +RPC_X_SS_CHAR_TRANS_OPEN_FAIL: int +RPC_X_SS_CHAR_TRANS_SHORT_FILE: int +RPC_X_SS_IN_NULL_CONTEXT: int +RPC_X_SS_CONTEXT_DAMAGED: int +RPC_X_SS_HANDLES_MISMATCH: int +RPC_X_SS_CANNOT_GET_CALL_HANDLE: int +RPC_X_NULL_REF_POINTER: int +RPC_X_ENUM_VALUE_OUT_OF_RANGE: int +RPC_X_BYTE_COUNT_TOO_SMALL: int +RPC_X_BAD_STUB_DATA: int +ERROR_INVALID_USER_BUFFER: int +ERROR_UNRECOGNIZED_MEDIA: int +ERROR_NO_TRUST_LSA_SECRET: int +ERROR_NO_TRUST_SAM_ACCOUNT: int +ERROR_TRUSTED_DOMAIN_FAILURE: int +ERROR_TRUSTED_RELATIONSHIP_FAILURE: int +ERROR_TRUST_FAILURE: int +RPC_S_CALL_IN_PROGRESS: int +ERROR_NETLOGON_NOT_STARTED: int +ERROR_ACCOUNT_EXPIRED: int +ERROR_REDIRECTOR_HAS_OPEN_HANDLES: int +ERROR_PRINTER_DRIVER_ALREADY_INSTALLED: int +ERROR_UNKNOWN_PORT: int +ERROR_UNKNOWN_PRINTER_DRIVER: int +ERROR_UNKNOWN_PRINTPROCESSOR: int +ERROR_INVALID_SEPARATOR_FILE: int +ERROR_INVALID_PRIORITY: int +ERROR_INVALID_PRINTER_NAME: int +ERROR_PRINTER_ALREADY_EXISTS: int +ERROR_INVALID_PRINTER_COMMAND: int +ERROR_INVALID_DATATYPE: int +ERROR_INVALID_ENVIRONMENT: int +RPC_S_NO_MORE_BINDINGS: int +ERROR_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT: int +ERROR_NOLOGON_WORKSTATION_TRUST_ACCOUNT: int +ERROR_NOLOGON_SERVER_TRUST_ACCOUNT: int +ERROR_DOMAIN_TRUST_INCONSISTENT: int +ERROR_SERVER_HAS_OPEN_HANDLES: int +ERROR_RESOURCE_DATA_NOT_FOUND: int +ERROR_RESOURCE_TYPE_NOT_FOUND: int +ERROR_RESOURCE_NAME_NOT_FOUND: int +ERROR_RESOURCE_LANG_NOT_FOUND: int +ERROR_NOT_ENOUGH_QUOTA: int +RPC_S_NO_INTERFACES: int +RPC_S_CALL_CANCELLED: int +RPC_S_BINDING_INCOMPLETE: int +RPC_S_COMM_FAILURE: int +RPC_S_UNSUPPORTED_AUTHN_LEVEL: int +RPC_S_NO_PRINC_NAME: int +RPC_S_NOT_RPC_ERROR: int +RPC_S_UUID_LOCAL_ONLY: int +RPC_S_SEC_PKG_ERROR: int +RPC_S_NOT_CANCELLED: int +RPC_X_INVALID_ES_ACTION: int +RPC_X_WRONG_ES_VERSION: int +RPC_X_WRONG_STUB_VERSION: int +RPC_X_INVALID_PIPE_OBJECT: int +RPC_X_WRONG_PIPE_ORDER: int +RPC_X_WRONG_PIPE_VERSION: int +RPC_S_GROUP_MEMBER_NOT_FOUND: int +EPT_S_CANT_CREATE: int +RPC_S_INVALID_OBJECT: int +ERROR_INVALID_TIME: int +ERROR_INVALID_FORM_NAME: int +ERROR_INVALID_FORM_SIZE: int +ERROR_ALREADY_WAITING: int +ERROR_PRINTER_DELETED: int +ERROR_INVALID_PRINTER_STATE: int +ERROR_PASSWORD_MUST_CHANGE: int +ERROR_DOMAIN_CONTROLLER_NOT_FOUND: int +ERROR_ACCOUNT_LOCKED_OUT: int +OR_INVALID_OXID: int +OR_INVALID_OID: int +OR_INVALID_SET: int +RPC_S_SEND_INCOMPLETE: int +RPC_S_INVALID_ASYNC_HANDLE: int +RPC_S_INVALID_ASYNC_CALL: int +RPC_X_PIPE_CLOSED: int +RPC_X_PIPE_DISCIPLINE_ERROR: int +RPC_X_PIPE_EMPTY: int +ERROR_NO_SITENAME: int +ERROR_CANT_ACCESS_FILE: int +ERROR_CANT_RESOLVE_FILENAME: int +RPC_S_ENTRY_TYPE_MISMATCH: int +RPC_S_NOT_ALL_OBJS_EXPORTED: int +RPC_S_INTERFACE_NOT_EXPORTED: int +RPC_S_PROFILE_NOT_ADDED: int +RPC_S_PRF_ELT_NOT_ADDED: int +RPC_S_PRF_ELT_NOT_REMOVED: int +RPC_S_GRP_ELT_NOT_ADDED: int +RPC_S_GRP_ELT_NOT_REMOVED: int +ERROR_KM_DRIVER_BLOCKED: int +ERROR_CONTEXT_EXPIRED: int +ERROR_PER_USER_TRUST_QUOTA_EXCEEDED: int +ERROR_ALL_USER_TRUST_QUOTA_EXCEEDED: int +ERROR_USER_DELETE_TRUST_QUOTA_EXCEEDED: int +ERROR_AUTHENTICATION_FIREWALL_FAILED: int +ERROR_REMOTE_PRINT_CONNECTIONS_BLOCKED: int +ERROR_NTLM_BLOCKED: int +ERROR_INVALID_PIXEL_FORMAT: int +ERROR_BAD_DRIVER: int +ERROR_INVALID_WINDOW_STYLE: int +ERROR_METAFILE_NOT_SUPPORTED: int +ERROR_TRANSFORM_NOT_SUPPORTED: int +ERROR_CLIPPING_NOT_SUPPORTED: int +ERROR_INVALID_CMM: int +ERROR_INVALID_PROFILE: int +ERROR_TAG_NOT_FOUND: int +ERROR_TAG_NOT_PRESENT: int +ERROR_DUPLICATE_TAG: int +ERROR_PROFILE_NOT_ASSOCIATED_WITH_DEVICE: int +ERROR_PROFILE_NOT_FOUND: int +ERROR_INVALID_COLORSPACE: int +ERROR_ICM_NOT_ENABLED: int +ERROR_DELETING_ICM_XFORM: int +ERROR_INVALID_TRANSFORM: int +ERROR_COLORSPACE_MISMATCH: int +ERROR_INVALID_COLORINDEX: int +ERROR_PROFILE_DOES_NOT_MATCH_DEVICE: int +ERROR_CONNECTED_OTHER_PASSWORD_DEFAULT: int +ERROR_UNKNOWN_PRINT_MONITOR: int +ERROR_PRINTER_DRIVER_IN_USE: int +ERROR_SPOOL_FILE_NOT_FOUND: int +ERROR_SPL_NO_STARTDOC: int +ERROR_SPL_NO_ADDJOB: int +ERROR_PRINT_PROCESSOR_ALREADY_INSTALLED: int +ERROR_PRINT_MONITOR_ALREADY_INSTALLED: int +ERROR_INVALID_PRINT_MONITOR: int +ERROR_PRINT_MONITOR_IN_USE: int +ERROR_PRINTER_HAS_JOBS_QUEUED: int +ERROR_SUCCESS_REBOOT_REQUIRED: int +ERROR_SUCCESS_RESTART_REQUIRED: int +ERROR_PRINTER_NOT_FOUND: int +ERROR_PRINTER_DRIVER_WARNED: int +ERROR_PRINTER_DRIVER_BLOCKED: int +ERROR_PRINTER_DRIVER_PACKAGE_IN_USE: int +ERROR_CORE_DRIVER_PACKAGE_NOT_FOUND: int +ERROR_FAIL_REBOOT_REQUIRED: int +ERROR_FAIL_REBOOT_INITIATED: int +ERROR_PRINTER_DRIVER_DOWNLOAD_NEEDED: int +ERROR_PRINT_JOB_RESTART_REQUIRED: int +ERROR_IO_REISSUE_AS_CACHED: int +ERROR_WINS_INTERNAL: int +ERROR_CAN_NOT_DEL_LOCAL_WINS: int +ERROR_STATIC_INIT: int +ERROR_INC_BACKUP: int +ERROR_FULL_BACKUP: int +ERROR_REC_NON_EXISTENT: int +ERROR_RPL_NOT_ALLOWED: int +ERROR_DHCP_ADDRESS_CONFLICT: int +ERROR_WMI_GUID_NOT_FOUND: int +ERROR_WMI_INSTANCE_NOT_FOUND: int +ERROR_WMI_ITEMID_NOT_FOUND: int +ERROR_WMI_TRY_AGAIN: int +ERROR_WMI_DP_NOT_FOUND: int +ERROR_WMI_UNRESOLVED_INSTANCE_REF: int +ERROR_WMI_ALREADY_ENABLED: int +ERROR_WMI_GUID_DISCONNECTED: int +ERROR_WMI_SERVER_UNAVAILABLE: int +ERROR_WMI_DP_FAILED: int +ERROR_WMI_INVALID_MOF: int +ERROR_WMI_INVALID_REGINFO: int +ERROR_WMI_ALREADY_DISABLED: int +ERROR_WMI_READ_ONLY: int +ERROR_WMI_SET_FAILURE: int +ERROR_INVALID_MEDIA: int +ERROR_INVALID_LIBRARY: int +ERROR_INVALID_MEDIA_POOL: int +ERROR_DRIVE_MEDIA_MISMATCH: int +ERROR_MEDIA_OFFLINE: int +ERROR_LIBRARY_OFFLINE: int +ERROR_EMPTY: int +ERROR_NOT_EMPTY: int +ERROR_MEDIA_UNAVAILABLE: int +ERROR_RESOURCE_DISABLED: int +ERROR_INVALID_CLEANER: int +ERROR_UNABLE_TO_CLEAN: int +ERROR_OBJECT_NOT_FOUND: int +ERROR_DATABASE_FAILURE: int +ERROR_DATABASE_FULL: int +ERROR_MEDIA_INCOMPATIBLE: int +ERROR_RESOURCE_NOT_PRESENT: int +ERROR_INVALID_OPERATION: int +ERROR_MEDIA_NOT_AVAILABLE: int +ERROR_DEVICE_NOT_AVAILABLE: int +ERROR_REQUEST_REFUSED: int +ERROR_INVALID_DRIVE_OBJECT: int +ERROR_LIBRARY_FULL: int +ERROR_MEDIUM_NOT_ACCESSIBLE: int +ERROR_UNABLE_TO_LOAD_MEDIUM: int +ERROR_UNABLE_TO_INVENTORY_DRIVE: int +ERROR_UNABLE_TO_INVENTORY_SLOT: int +ERROR_UNABLE_TO_INVENTORY_TRANSPORT: int +ERROR_TRANSPORT_FULL: int +ERROR_CONTROLLING_IEPORT: int +ERROR_UNABLE_TO_EJECT_MOUNTED_MEDIA: int +ERROR_CLEANER_SLOT_SET: int +ERROR_CLEANER_SLOT_NOT_SET: int +ERROR_CLEANER_CARTRIDGE_SPENT: int +ERROR_UNEXPECTED_OMID: int +ERROR_CANT_DELETE_LAST_ITEM: int +ERROR_MESSAGE_EXCEEDS_MAX_SIZE: int +ERROR_VOLUME_CONTAINS_SYS_FILES: int +ERROR_INDIGENOUS_TYPE: int +ERROR_NO_SUPPORTING_DRIVES: int +ERROR_CLEANER_CARTRIDGE_INSTALLED: int +ERROR_IEPORT_FULL: int +ERROR_FILE_OFFLINE: int +ERROR_REMOTE_STORAGE_NOT_ACTIVE: int +ERROR_REMOTE_STORAGE_MEDIA_ERROR: int +ERROR_NOT_A_REPARSE_POINT: int +ERROR_REPARSE_ATTRIBUTE_CONFLICT: int +ERROR_INVALID_REPARSE_DATA: int +ERROR_REPARSE_TAG_INVALID: int +ERROR_REPARSE_TAG_MISMATCH: int +ERROR_VOLUME_NOT_SIS_ENABLED: int +ERROR_DEPENDENT_RESOURCE_EXISTS: int +ERROR_DEPENDENCY_NOT_FOUND: int +ERROR_DEPENDENCY_ALREADY_EXISTS: int +ERROR_RESOURCE_NOT_ONLINE: int +ERROR_HOST_NODE_NOT_AVAILABLE: int +ERROR_RESOURCE_NOT_AVAILABLE: int +ERROR_RESOURCE_NOT_FOUND: int +ERROR_SHUTDOWN_CLUSTER: int +ERROR_CANT_EVICT_ACTIVE_NODE: int +ERROR_OBJECT_ALREADY_EXISTS: int +ERROR_OBJECT_IN_LIST: int +ERROR_GROUP_NOT_AVAILABLE: int +ERROR_GROUP_NOT_FOUND: int +ERROR_GROUP_NOT_ONLINE: int +ERROR_HOST_NODE_NOT_RESOURCE_OWNER: int +ERROR_HOST_NODE_NOT_GROUP_OWNER: int +ERROR_RESMON_CREATE_FAILED: int +ERROR_RESMON_ONLINE_FAILED: int +ERROR_RESOURCE_ONLINE: int +ERROR_QUORUM_RESOURCE: int +ERROR_NOT_QUORUM_CAPABLE: int +ERROR_CLUSTER_SHUTTING_DOWN: int +ERROR_INVALID_STATE: int +ERROR_RESOURCE_PROPERTIES_STORED: int +ERROR_NOT_QUORUM_CLASS: int +ERROR_CORE_RESOURCE: int +ERROR_QUORUM_RESOURCE_ONLINE_FAILED: int +ERROR_QUORUMLOG_OPEN_FAILED: int +ERROR_CLUSTERLOG_CORRUPT: int +ERROR_CLUSTERLOG_RECORD_EXCEEDS_MAXSIZE: int +ERROR_CLUSTERLOG_EXCEEDS_MAXSIZE: int +ERROR_CLUSTERLOG_CHKPOINT_NOT_FOUND: int +ERROR_CLUSTERLOG_NOT_ENOUGH_SPACE: int +ERROR_QUORUM_OWNER_ALIVE: int +ERROR_NETWORK_NOT_AVAILABLE: int +ERROR_NODE_NOT_AVAILABLE: int +ERROR_ALL_NODES_NOT_AVAILABLE: int +ERROR_RESOURCE_FAILED: int +ERROR_CLUSTER_INVALID_NODE: int +ERROR_CLUSTER_NODE_EXISTS: int +ERROR_CLUSTER_JOIN_IN_PROGRESS: int +ERROR_CLUSTER_NODE_NOT_FOUND: int +ERROR_CLUSTER_LOCAL_NODE_NOT_FOUND: int +ERROR_CLUSTER_NETWORK_EXISTS: int +ERROR_CLUSTER_NETWORK_NOT_FOUND: int +ERROR_CLUSTER_NETINTERFACE_EXISTS: int +ERROR_CLUSTER_NETINTERFACE_NOT_FOUND: int +ERROR_CLUSTER_INVALID_REQUEST: int +ERROR_CLUSTER_INVALID_NETWORK_PROVIDER: int +ERROR_CLUSTER_NODE_DOWN: int +ERROR_CLUSTER_NODE_UNREACHABLE: int +ERROR_CLUSTER_NODE_NOT_MEMBER: int +ERROR_CLUSTER_JOIN_NOT_IN_PROGRESS: int +ERROR_CLUSTER_INVALID_NETWORK: int +ERROR_CLUSTER_NODE_UP: int +ERROR_CLUSTER_IPADDR_IN_USE: int +ERROR_CLUSTER_NODE_NOT_PAUSED: int +ERROR_CLUSTER_NO_SECURITY_CONTEXT: int +ERROR_CLUSTER_NETWORK_NOT_INTERNAL: int +ERROR_CLUSTER_NODE_ALREADY_UP: int +ERROR_CLUSTER_NODE_ALREADY_DOWN: int +ERROR_CLUSTER_NETWORK_ALREADY_ONLINE: int +ERROR_CLUSTER_NETWORK_ALREADY_OFFLINE: int +ERROR_CLUSTER_NODE_ALREADY_MEMBER: int +ERROR_CLUSTER_LAST_INTERNAL_NETWORK: int +ERROR_CLUSTER_NETWORK_HAS_DEPENDENTS: int +ERROR_INVALID_OPERATION_ON_QUORUM: int +ERROR_DEPENDENCY_NOT_ALLOWED: int +ERROR_CLUSTER_NODE_PAUSED: int +ERROR_NODE_CANT_HOST_RESOURCE: int +ERROR_CLUSTER_NODE_NOT_READY: int +ERROR_CLUSTER_NODE_SHUTTING_DOWN: int +ERROR_CLUSTER_JOIN_ABORTED: int +ERROR_CLUSTER_INCOMPATIBLE_VERSIONS: int +ERROR_CLUSTER_MAXNUM_OF_RESOURCES_EXCEEDED: int +ERROR_CLUSTER_SYSTEM_CONFIG_CHANGED: int +ERROR_CLUSTER_RESOURCE_TYPE_NOT_FOUND: int +ERROR_CLUSTER_RESTYPE_NOT_SUPPORTED: int +ERROR_CLUSTER_RESNAME_NOT_FOUND: int +ERROR_CLUSTER_NO_RPC_PACKAGES_REGISTERED: int +ERROR_CLUSTER_OWNER_NOT_IN_PREFLIST: int +ERROR_CLUSTER_DATABASE_SEQMISMATCH: int +ERROR_RESMON_INVALID_STATE: int +ERROR_CLUSTER_GUM_NOT_LOCKER: int +ERROR_QUORUM_DISK_NOT_FOUND: int +ERROR_DATABASE_BACKUP_CORRUPT: int +ERROR_CLUSTER_NODE_ALREADY_HAS_DFS_ROOT: int +ERROR_RESOURCE_PROPERTY_UNCHANGEABLE: int +ERROR_CLUSTER_MEMBERSHIP_INVALID_STATE: int +ERROR_CLUSTER_QUORUMLOG_NOT_FOUND: int +ERROR_CLUSTER_MEMBERSHIP_HALT: int +ERROR_CLUSTER_INSTANCE_ID_MISMATCH: int +ERROR_CLUSTER_NETWORK_NOT_FOUND_FOR_IP: int +ERROR_CLUSTER_PROPERTY_DATA_TYPE_MISMATCH: int +ERROR_CLUSTER_EVICT_WITHOUT_CLEANUP: int +ERROR_CLUSTER_PARAMETER_MISMATCH: int +ERROR_NODE_CANNOT_BE_CLUSTERED: int +ERROR_CLUSTER_WRONG_OS_VERSION: int +ERROR_CLUSTER_CANT_CREATE_DUP_CLUSTER_NAME: int +ERROR_CLUSCFG_ALREADY_COMMITTED: int +ERROR_CLUSCFG_ROLLBACK_FAILED: int +ERROR_CLUSCFG_SYSTEM_DISK_DRIVE_LETTER_CONFLICT: int +ERROR_CLUSTER_OLD_VERSION: int +ERROR_CLUSTER_MISMATCHED_COMPUTER_ACCT_NAME: int +ERROR_CLUSTER_NO_NET_ADAPTERS: int +ERROR_CLUSTER_POISONED: int +ERROR_CLUSTER_GROUP_MOVING: int +ERROR_CLUSTER_RESOURCE_TYPE_BUSY: int +ERROR_RESOURCE_CALL_TIMED_OUT: int +ERROR_INVALID_CLUSTER_IPV6_ADDRESS: int +ERROR_CLUSTER_INTERNAL_INVALID_FUNCTION: int +ERROR_CLUSTER_PARAMETER_OUT_OF_BOUNDS: int +ERROR_CLUSTER_PARTIAL_SEND: int +ERROR_CLUSTER_REGISTRY_INVALID_FUNCTION: int +ERROR_CLUSTER_INVALID_STRING_TERMINATION: int +ERROR_CLUSTER_INVALID_STRING_FORMAT: int +ERROR_CLUSTER_DATABASE_TRANSACTION_IN_PROGRESS: int +ERROR_CLUSTER_DATABASE_TRANSACTION_NOT_IN_PROGRESS: int +ERROR_CLUSTER_NULL_DATA: int +ERROR_CLUSTER_PARTIAL_READ: int +ERROR_CLUSTER_PARTIAL_WRITE: int +ERROR_CLUSTER_CANT_DESERIALIZE_DATA: int +ERROR_DEPENDENT_RESOURCE_PROPERTY_CONFLICT: int +ERROR_CLUSTER_NO_QUORUM: int +ERROR_CLUSTER_INVALID_IPV6_NETWORK: int +ERROR_CLUSTER_INVALID_IPV6_TUNNEL_NETWORK: int +ERROR_QUORUM_NOT_ALLOWED_IN_THIS_GROUP: int +ERROR_DEPENDENCY_TREE_TOO_COMPLEX: int +ERROR_EXCEPTION_IN_RESOURCE_CALL: int +ERROR_CLUSTER_RHS_FAILED_INITIALIZATION: int +ERROR_CLUSTER_NOT_INSTALLED: int +ERROR_CLUSTER_RESOURCES_MUST_BE_ONLINE_ON_THE_SAME_NODE: int +ERROR_ENCRYPTION_FAILED: int +ERROR_DECRYPTION_FAILED: int +ERROR_FILE_ENCRYPTED: int +ERROR_NO_RECOVERY_POLICY: int +ERROR_NO_EFS: int +ERROR_WRONG_EFS: int +ERROR_NO_USER_KEYS: int +ERROR_FILE_NOT_ENCRYPTED: int +ERROR_NOT_EXPORT_FORMAT: int +ERROR_FILE_READ_ONLY: int +ERROR_DIR_EFS_DISALLOWED: int +ERROR_EFS_SERVER_NOT_TRUSTED: int +ERROR_BAD_RECOVERY_POLICY: int +ERROR_EFS_ALG_BLOB_TOO_BIG: int +ERROR_VOLUME_NOT_SUPPORT_EFS: int +ERROR_EFS_DISABLED: int +ERROR_EFS_VERSION_NOT_SUPPORT: int +ERROR_CS_ENCRYPTION_INVALID_SERVER_RESPONSE: int +ERROR_CS_ENCRYPTION_UNSUPPORTED_SERVER: int +ERROR_CS_ENCRYPTION_EXISTING_ENCRYPTED_FILE: int +ERROR_CS_ENCRYPTION_NEW_ENCRYPTED_FILE: int +ERROR_CS_ENCRYPTION_FILE_NOT_CSE: int +ERROR_NO_BROWSER_SERVERS_FOUND: int +ERROR_LOG_SECTOR_INVALID: int +ERROR_LOG_SECTOR_PARITY_INVALID: int +ERROR_LOG_SECTOR_REMAPPED: int +ERROR_LOG_BLOCK_INCOMPLETE: int +ERROR_LOG_INVALID_RANGE: int +ERROR_LOG_BLOCKS_EXHAUSTED: int +ERROR_LOG_READ_CONTEXT_INVALID: int +ERROR_LOG_RESTART_INVALID: int +ERROR_LOG_BLOCK_VERSION: int +ERROR_LOG_BLOCK_INVALID: int +ERROR_LOG_READ_MODE_INVALID: int +ERROR_LOG_NO_RESTART: int +ERROR_LOG_METADATA_CORRUPT: int +ERROR_LOG_METADATA_INVALID: int +ERROR_LOG_METADATA_INCONSISTENT: int +ERROR_LOG_RESERVATION_INVALID: int +ERROR_LOG_CANT_DELETE: int +ERROR_LOG_CONTAINER_LIMIT_EXCEEDED: int +ERROR_LOG_START_OF_LOG: int +ERROR_LOG_POLICY_ALREADY_INSTALLED: int +ERROR_LOG_POLICY_NOT_INSTALLED: int +ERROR_LOG_POLICY_INVALID: int +ERROR_LOG_POLICY_CONFLICT: int +ERROR_LOG_PINNED_ARCHIVE_TAIL: int +ERROR_LOG_RECORD_NONEXISTENT: int +ERROR_LOG_RECORDS_RESERVED_INVALID: int +ERROR_LOG_SPACE_RESERVED_INVALID: int +ERROR_LOG_TAIL_INVALID: int +ERROR_LOG_FULL: int +ERROR_COULD_NOT_RESIZE_LOG: int +ERROR_LOG_MULTIPLEXED: int +ERROR_LOG_DEDICATED: int +ERROR_LOG_ARCHIVE_NOT_IN_PROGRESS: int +ERROR_LOG_ARCHIVE_IN_PROGRESS: int +ERROR_LOG_EPHEMERAL: int +ERROR_LOG_NOT_ENOUGH_CONTAINERS: int +ERROR_LOG_CLIENT_ALREADY_REGISTERED: int +ERROR_LOG_CLIENT_NOT_REGISTERED: int +ERROR_LOG_FULL_HANDLER_IN_PROGRESS: int +ERROR_LOG_CONTAINER_READ_FAILED: int +ERROR_LOG_CONTAINER_WRITE_FAILED: int +ERROR_LOG_CONTAINER_OPEN_FAILED: int +ERROR_LOG_CONTAINER_STATE_INVALID: int +ERROR_LOG_STATE_INVALID: int +ERROR_LOG_PINNED: int +ERROR_LOG_METADATA_FLUSH_FAILED: int +ERROR_LOG_INCONSISTENT_SECURITY: int +ERROR_LOG_APPENDED_FLUSH_FAILED: int +ERROR_LOG_PINNED_RESERVATION: int +ERROR_INVALID_TRANSACTION: int +ERROR_TRANSACTION_NOT_ACTIVE: int +ERROR_TRANSACTION_REQUEST_NOT_VALID: int +ERROR_TRANSACTION_NOT_REQUESTED: int +ERROR_TRANSACTION_ALREADY_ABORTED: int +ERROR_TRANSACTION_ALREADY_COMMITTED: int +ERROR_TM_INITIALIZATION_FAILED: int +ERROR_RESOURCEMANAGER_READ_ONLY: int +ERROR_TRANSACTION_NOT_JOINED: int +ERROR_TRANSACTION_SUPERIOR_EXISTS: int +ERROR_CRM_PROTOCOL_ALREADY_EXISTS: int +ERROR_TRANSACTION_PROPAGATION_FAILED: int +ERROR_CRM_PROTOCOL_NOT_FOUND: int +ERROR_TRANSACTION_INVALID_MARSHALL_BUFFER: int +ERROR_CURRENT_TRANSACTION_NOT_VALID: int +ERROR_TRANSACTION_NOT_FOUND: int +ERROR_RESOURCEMANAGER_NOT_FOUND: int +ERROR_ENLISTMENT_NOT_FOUND: int +ERROR_TRANSACTIONMANAGER_NOT_FOUND: int +ERROR_TRANSACTIONMANAGER_NOT_ONLINE: int +ERROR_TRANSACTIONMANAGER_RECOVERY_NAME_COLLISION: int +ERROR_TRANSACTION_NOT_ROOT: int +ERROR_TRANSACTION_OBJECT_EXPIRED: int +ERROR_TRANSACTION_RESPONSE_NOT_ENLISTED: int +ERROR_TRANSACTION_RECORD_TOO_LONG: int +ERROR_IMPLICIT_TRANSACTION_NOT_SUPPORTED: int +ERROR_TRANSACTION_INTEGRITY_VIOLATED: int +ERROR_TRANSACTIONAL_CONFLICT: int +ERROR_RM_NOT_ACTIVE: int +ERROR_RM_METADATA_CORRUPT: int +ERROR_DIRECTORY_NOT_RM: int +ERROR_TRANSACTIONS_UNSUPPORTED_REMOTE: int +ERROR_LOG_RESIZE_INVALID_SIZE: int +ERROR_OBJECT_NO_LONGER_EXISTS: int +ERROR_STREAM_MINIVERSION_NOT_FOUND: int +ERROR_STREAM_MINIVERSION_NOT_VALID: int +ERROR_MINIVERSION_INACCESSIBLE_FROM_SPECIFIED_TRANSACTION: int +ERROR_CANT_OPEN_MINIVERSION_WITH_MODIFY_INTENT: int +ERROR_CANT_CREATE_MORE_STREAM_MINIVERSIONS: int +ERROR_REMOTE_FILE_VERSION_MISMATCH: int +ERROR_HANDLE_NO_LONGER_VALID: int +ERROR_NO_TXF_METADATA: int +ERROR_LOG_CORRUPTION_DETECTED: int +ERROR_CANT_RECOVER_WITH_HANDLE_OPEN: int +ERROR_RM_DISCONNECTED: int +ERROR_ENLISTMENT_NOT_SUPERIOR: int +ERROR_RECOVERY_NOT_NEEDED: int +ERROR_RM_ALREADY_STARTED: int +ERROR_FILE_IDENTITY_NOT_PERSISTENT: int +ERROR_CANT_BREAK_TRANSACTIONAL_DEPENDENCY: int +ERROR_CANT_CROSS_RM_BOUNDARY: int +ERROR_TXF_DIR_NOT_EMPTY: int +ERROR_INDOUBT_TRANSACTIONS_EXIST: int +ERROR_TM_VOLATILE: int +ERROR_ROLLBACK_TIMER_EXPIRED: int +ERROR_TXF_ATTRIBUTE_CORRUPT: int +ERROR_EFS_NOT_ALLOWED_IN_TRANSACTION: int +ERROR_TRANSACTIONAL_OPEN_NOT_ALLOWED: int +ERROR_LOG_GROWTH_FAILED: int +ERROR_TRANSACTED_MAPPING_UNSUPPORTED_REMOTE: int +ERROR_TXF_METADATA_ALREADY_PRESENT: int +ERROR_TRANSACTION_SCOPE_CALLBACKS_NOT_SET: int +ERROR_TRANSACTION_REQUIRED_PROMOTION: int +ERROR_CANNOT_EXECUTE_FILE_IN_TRANSACTION: int +ERROR_TRANSACTIONS_NOT_FROZEN: int +ERROR_TRANSACTION_FREEZE_IN_PROGRESS: int +ERROR_NOT_SNAPSHOT_VOLUME: int +ERROR_NO_SAVEPOINT_WITH_OPEN_FILES: int +ERROR_DATA_LOST_REPAIR: int +ERROR_SPARSE_NOT_ALLOWED_IN_TRANSACTION: int +ERROR_TM_IDENTITY_MISMATCH: int +ERROR_FLOATED_SECTION: int +ERROR_CANNOT_ACCEPT_TRANSACTED_WORK: int +ERROR_CANNOT_ABORT_TRANSACTIONS: int +ERROR_BAD_CLUSTERS: int +ERROR_COMPRESSION_NOT_ALLOWED_IN_TRANSACTION: int +ERROR_VOLUME_DIRTY: int +ERROR_NO_LINK_TRACKING_IN_TRANSACTION: int +ERROR_OPERATION_NOT_SUPPORTED_IN_TRANSACTION: int +ERROR_CTX_WINSTATION_NAME_INVALID: int +ERROR_CTX_INVALID_PD: int +ERROR_CTX_PD_NOT_FOUND: int +ERROR_CTX_WD_NOT_FOUND: int +ERROR_CTX_CANNOT_MAKE_EVENTLOG_ENTRY: int +ERROR_CTX_SERVICE_NAME_COLLISION: int +ERROR_CTX_CLOSE_PENDING: int +ERROR_CTX_NO_OUTBUF: int +ERROR_CTX_MODEM_INF_NOT_FOUND: int +ERROR_CTX_INVALID_MODEMNAME: int +ERROR_CTX_MODEM_RESPONSE_ERROR: int +ERROR_CTX_MODEM_RESPONSE_TIMEOUT: int +ERROR_CTX_MODEM_RESPONSE_NO_CARRIER: int +ERROR_CTX_MODEM_RESPONSE_NO_DIALTONE: int +ERROR_CTX_MODEM_RESPONSE_BUSY: int +ERROR_CTX_MODEM_RESPONSE_VOICE: int +ERROR_CTX_TD_ERROR: int +ERROR_CTX_WINSTATION_NOT_FOUND: int +ERROR_CTX_WINSTATION_ALREADY_EXISTS: int +ERROR_CTX_WINSTATION_BUSY: int +ERROR_CTX_BAD_VIDEO_MODE: int +ERROR_CTX_GRAPHICS_INVALID: int +ERROR_CTX_LOGON_DISABLED: int +ERROR_CTX_NOT_CONSOLE: int +ERROR_CTX_CLIENT_QUERY_TIMEOUT: int +ERROR_CTX_CONSOLE_DISCONNECT: int +ERROR_CTX_CONSOLE_CONNECT: int +ERROR_CTX_SHADOW_DENIED: int +ERROR_CTX_WINSTATION_ACCESS_DENIED: int +ERROR_CTX_INVALID_WD: int +ERROR_CTX_SHADOW_INVALID: int +ERROR_CTX_SHADOW_DISABLED: int +ERROR_CTX_CLIENT_LICENSE_IN_USE: int +ERROR_CTX_CLIENT_LICENSE_NOT_SET: int +ERROR_CTX_LICENSE_NOT_AVAILABLE: int +ERROR_CTX_LICENSE_CLIENT_INVALID: int +ERROR_CTX_LICENSE_EXPIRED: int +ERROR_CTX_SHADOW_NOT_RUNNING: int +ERROR_CTX_SHADOW_ENDED_BY_MODE_CHANGE: int +ERROR_ACTIVATION_COUNT_EXCEEDED: int +ERROR_CTX_WINSTATIONS_DISABLED: int +ERROR_CTX_ENCRYPTION_LEVEL_REQUIRED: int +ERROR_CTX_SESSION_IN_USE: int +ERROR_CTX_NO_FORCE_LOGOFF: int +ERROR_CTX_ACCOUNT_RESTRICTION: int +ERROR_RDP_PROTOCOL_ERROR: int +ERROR_CTX_CDM_CONNECT: int +ERROR_CTX_CDM_DISCONNECT: int +ERROR_CTX_SECURITY_LAYER_ERROR: int +ERROR_TS_INCOMPATIBLE_SESSIONS: int +FRS_ERR_INVALID_API_SEQUENCE: int +FRS_ERR_STARTING_SERVICE: int +FRS_ERR_STOPPING_SERVICE: int +FRS_ERR_INTERNAL_API: int +FRS_ERR_INTERNAL: int +FRS_ERR_SERVICE_COMM: int +FRS_ERR_INSUFFICIENT_PRIV: int +FRS_ERR_AUTHENTICATION: int +FRS_ERR_PARENT_INSUFFICIENT_PRIV: int +FRS_ERR_PARENT_AUTHENTICATION: int +FRS_ERR_CHILD_TO_PARENT_COMM: int +FRS_ERR_PARENT_TO_CHILD_COMM: int +FRS_ERR_SYSVOL_POPULATE: int +FRS_ERR_SYSVOL_POPULATE_TIMEOUT: int +FRS_ERR_SYSVOL_IS_BUSY: int +FRS_ERR_SYSVOL_DEMOTE: int +FRS_ERR_INVALID_SERVICE_PARAMETER: int +DS_S_SUCCESS: int +ERROR_DS_MEMBERSHIP_EVALUATED_LOCALLY: int +ERROR_DS_NO_ATTRIBUTE_OR_VALUE: int +ERROR_DS_INVALID_ATTRIBUTE_SYNTAX: int +ERROR_DS_ATTRIBUTE_TYPE_UNDEFINED: int +ERROR_DS_ATTRIBUTE_OR_VALUE_EXISTS: int +ERROR_DS_BUSY: int +ERROR_DS_UNAVAILABLE: int +ERROR_DS_NO_RIDS_ALLOCATED: int +ERROR_DS_NO_MORE_RIDS: int +ERROR_DS_INCORRECT_ROLE_OWNER: int +ERROR_DS_RIDMGR_INIT_ERROR: int +ERROR_DS_OBJ_CLASS_VIOLATION: int +ERROR_DS_CANT_ON_NON_LEAF: int +ERROR_DS_CANT_ON_RDN: int +ERROR_DS_CANT_MOD_OBJ_CLASS: int +ERROR_DS_CROSS_DOM_MOVE_ERROR: int +ERROR_DS_GC_NOT_AVAILABLE: int +ERROR_SHARED_POLICY: int +ERROR_POLICY_OBJECT_NOT_FOUND: int +ERROR_POLICY_ONLY_IN_DS: int +ERROR_PROMOTION_ACTIVE: int +ERROR_NO_PROMOTION_ACTIVE: int +ERROR_DS_OPERATIONS_ERROR: int +ERROR_DS_PROTOCOL_ERROR: int +ERROR_DS_TIMELIMIT_EXCEEDED: int +ERROR_DS_SIZELIMIT_EXCEEDED: int +ERROR_DS_ADMIN_LIMIT_EXCEEDED: int +ERROR_DS_COMPARE_FALSE: int +ERROR_DS_COMPARE_TRUE: int +ERROR_DS_AUTH_METHOD_NOT_SUPPORTED: int +ERROR_DS_STRONG_AUTH_REQUIRED: int +ERROR_DS_INAPPROPRIATE_AUTH: int +ERROR_DS_AUTH_UNKNOWN: int +ERROR_DS_REFERRAL: int +ERROR_DS_UNAVAILABLE_CRIT_EXTENSION: int +ERROR_DS_CONFIDENTIALITY_REQUIRED: int +ERROR_DS_INAPPROPRIATE_MATCHING: int +ERROR_DS_CONSTRAINT_VIOLATION: int +ERROR_DS_NO_SUCH_OBJECT: int +ERROR_DS_ALIAS_PROBLEM: int +ERROR_DS_INVALID_DN_SYNTAX: int +ERROR_DS_IS_LEAF: int +ERROR_DS_ALIAS_DEREF_PROBLEM: int +ERROR_DS_UNWILLING_TO_PERFORM: int +ERROR_DS_LOOP_DETECT: int +ERROR_DS_NAMING_VIOLATION: int +ERROR_DS_OBJECT_RESULTS_TOO_LARGE: int +ERROR_DS_AFFECTS_MULTIPLE_DSAS: int +ERROR_DS_SERVER_DOWN: int +ERROR_DS_LOCAL_ERROR: int +ERROR_DS_ENCODING_ERROR: int +ERROR_DS_DECODING_ERROR: int +ERROR_DS_FILTER_UNKNOWN: int +ERROR_DS_PARAM_ERROR: int +ERROR_DS_NOT_SUPPORTED: int +ERROR_DS_NO_RESULTS_RETURNED: int +ERROR_DS_CONTROL_NOT_FOUND: int +ERROR_DS_CLIENT_LOOP: int +ERROR_DS_REFERRAL_LIMIT_EXCEEDED: int +ERROR_DS_SORT_CONTROL_MISSING: int +ERROR_DS_OFFSET_RANGE_ERROR: int +ERROR_DS_ROOT_MUST_BE_NC: int +ERROR_DS_ADD_REPLICA_INHIBITED: int +ERROR_DS_ATT_NOT_DEF_IN_SCHEMA: int +ERROR_DS_MAX_OBJ_SIZE_EXCEEDED: int +ERROR_DS_OBJ_STRING_NAME_EXISTS: int +ERROR_DS_NO_RDN_DEFINED_IN_SCHEMA: int +ERROR_DS_RDN_DOESNT_MATCH_SCHEMA: int +ERROR_DS_NO_REQUESTED_ATTS_FOUND: int +ERROR_DS_USER_BUFFER_TO_SMALL: int +ERROR_DS_ATT_IS_NOT_ON_OBJ: int +ERROR_DS_ILLEGAL_MOD_OPERATION: int +ERROR_DS_OBJ_TOO_LARGE: int +ERROR_DS_BAD_INSTANCE_TYPE: int +ERROR_DS_MASTERDSA_REQUIRED: int +ERROR_DS_OBJECT_CLASS_REQUIRED: int +ERROR_DS_MISSING_REQUIRED_ATT: int +ERROR_DS_ATT_NOT_DEF_FOR_CLASS: int +ERROR_DS_ATT_ALREADY_EXISTS: int +ERROR_DS_CANT_ADD_ATT_VALUES: int +ERROR_DS_SINGLE_VALUE_CONSTRAINT: int +ERROR_DS_RANGE_CONSTRAINT: int +ERROR_DS_ATT_VAL_ALREADY_EXISTS: int +ERROR_DS_CANT_REM_MISSING_ATT: int +ERROR_DS_CANT_REM_MISSING_ATT_VAL: int +ERROR_DS_ROOT_CANT_BE_SUBREF: int +ERROR_DS_NO_CHAINING: int +ERROR_DS_NO_CHAINED_EVAL: int +ERROR_DS_NO_PARENT_OBJECT: int +ERROR_DS_PARENT_IS_AN_ALIAS: int +ERROR_DS_CANT_MIX_MASTER_AND_REPS: int +ERROR_DS_CHILDREN_EXIST: int +ERROR_DS_OBJ_NOT_FOUND: int +ERROR_DS_ALIASED_OBJ_MISSING: int +ERROR_DS_BAD_NAME_SYNTAX: int +ERROR_DS_ALIAS_POINTS_TO_ALIAS: int +ERROR_DS_CANT_DEREF_ALIAS: int +ERROR_DS_OUT_OF_SCOPE: int +ERROR_DS_OBJECT_BEING_REMOVED: int +ERROR_DS_CANT_DELETE_DSA_OBJ: int +ERROR_DS_GENERIC_ERROR: int +ERROR_DS_DSA_MUST_BE_INT_MASTER: int +ERROR_DS_CLASS_NOT_DSA: int +ERROR_DS_INSUFF_ACCESS_RIGHTS: int +ERROR_DS_ILLEGAL_SUPERIOR: int +ERROR_DS_ATTRIBUTE_OWNED_BY_SAM: int +ERROR_DS_NAME_TOO_MANY_PARTS: int +ERROR_DS_NAME_TOO_LONG: int +ERROR_DS_NAME_VALUE_TOO_LONG: int +ERROR_DS_NAME_UNPARSEABLE: int +ERROR_DS_NAME_TYPE_UNKNOWN: int +ERROR_DS_NOT_AN_OBJECT: int +ERROR_DS_SEC_DESC_TOO_SHORT: int +ERROR_DS_SEC_DESC_INVALID: int +ERROR_DS_NO_DELETED_NAME: int +ERROR_DS_SUBREF_MUST_HAVE_PARENT: int +ERROR_DS_NCNAME_MUST_BE_NC: int +ERROR_DS_CANT_ADD_SYSTEM_ONLY: int +ERROR_DS_CLASS_MUST_BE_CONCRETE: int +ERROR_DS_INVALID_DMD: int +ERROR_DS_OBJ_GUID_EXISTS: int +ERROR_DS_NOT_ON_BACKLINK: int +ERROR_DS_NO_CROSSREF_FOR_NC: int +ERROR_DS_SHUTTING_DOWN: int +ERROR_DS_UNKNOWN_OPERATION: int +ERROR_DS_INVALID_ROLE_OWNER: int +ERROR_DS_COULDNT_CONTACT_FSMO: int +ERROR_DS_CROSS_NC_DN_RENAME: int +ERROR_DS_CANT_MOD_SYSTEM_ONLY: int +ERROR_DS_REPLICATOR_ONLY: int +ERROR_DS_OBJ_CLASS_NOT_DEFINED: int +ERROR_DS_OBJ_CLASS_NOT_SUBCLASS: int +ERROR_DS_NAME_REFERENCE_INVALID: int +ERROR_DS_CROSS_REF_EXISTS: int +ERROR_DS_CANT_DEL_MASTER_CROSSREF: int +ERROR_DS_SUBTREE_NOTIFY_NOT_NC_HEAD: int +ERROR_DS_NOTIFY_FILTER_TOO_COMPLEX: int +ERROR_DS_DUP_RDN: int +ERROR_DS_DUP_OID: int +ERROR_DS_DUP_MAPI_ID: int +ERROR_DS_DUP_SCHEMA_ID_GUID: int +ERROR_DS_DUP_LDAP_DISPLAY_NAME: int +ERROR_DS_SEMANTIC_ATT_TEST: int +ERROR_DS_SYNTAX_MISMATCH: int +ERROR_DS_EXISTS_IN_MUST_HAVE: int +ERROR_DS_EXISTS_IN_MAY_HAVE: int +ERROR_DS_NONEXISTENT_MAY_HAVE: int +ERROR_DS_NONEXISTENT_MUST_HAVE: int +ERROR_DS_AUX_CLS_TEST_FAIL: int +ERROR_DS_NONEXISTENT_POSS_SUP: int +ERROR_DS_SUB_CLS_TEST_FAIL: int +ERROR_DS_BAD_RDN_ATT_ID_SYNTAX: int +ERROR_DS_EXISTS_IN_AUX_CLS: int +ERROR_DS_EXISTS_IN_SUB_CLS: int +ERROR_DS_EXISTS_IN_POSS_SUP: int +ERROR_DS_RECALCSCHEMA_FAILED: int +ERROR_DS_TREE_DELETE_NOT_FINISHED: int +ERROR_DS_CANT_DELETE: int +ERROR_DS_ATT_SCHEMA_REQ_ID: int +ERROR_DS_BAD_ATT_SCHEMA_SYNTAX: int +ERROR_DS_CANT_CACHE_ATT: int +ERROR_DS_CANT_CACHE_CLASS: int +ERROR_DS_CANT_REMOVE_ATT_CACHE: int +ERROR_DS_CANT_REMOVE_CLASS_CACHE: int +ERROR_DS_CANT_RETRIEVE_DN: int +ERROR_DS_MISSING_SUPREF: int +ERROR_DS_CANT_RETRIEVE_INSTANCE: int +ERROR_DS_CODE_INCONSISTENCY: int +ERROR_DS_DATABASE_ERROR: int +ERROR_DS_GOVERNSID_MISSING: int +ERROR_DS_MISSING_EXPECTED_ATT: int +ERROR_DS_NCNAME_MISSING_CR_REF: int +ERROR_DS_SECURITY_CHECKING_ERROR: int +ERROR_DS_SCHEMA_NOT_LOADED: int +ERROR_DS_SCHEMA_ALLOC_FAILED: int +ERROR_DS_ATT_SCHEMA_REQ_SYNTAX: int +ERROR_DS_GCVERIFY_ERROR: int +ERROR_DS_DRA_SCHEMA_MISMATCH: int +ERROR_DS_CANT_FIND_DSA_OBJ: int +ERROR_DS_CANT_FIND_EXPECTED_NC: int +ERROR_DS_CANT_FIND_NC_IN_CACHE: int +ERROR_DS_CANT_RETRIEVE_CHILD: int +ERROR_DS_SECURITY_ILLEGAL_MODIFY: int +ERROR_DS_CANT_REPLACE_HIDDEN_REC: int +ERROR_DS_BAD_HIERARCHY_FILE: int +ERROR_DS_BUILD_HIERARCHY_TABLE_FAILED: int +ERROR_DS_CONFIG_PARAM_MISSING: int +ERROR_DS_COUNTING_AB_INDICES_FAILED: int +ERROR_DS_HIERARCHY_TABLE_MALLOC_FAILED: int +ERROR_DS_INTERNAL_FAILURE: int +ERROR_DS_UNKNOWN_ERROR: int +ERROR_DS_ROOT_REQUIRES_CLASS_TOP: int +ERROR_DS_REFUSING_FSMO_ROLES: int +ERROR_DS_MISSING_FSMO_SETTINGS: int +ERROR_DS_UNABLE_TO_SURRENDER_ROLES: int +ERROR_DS_DRA_GENERIC: int +ERROR_DS_DRA_INVALID_PARAMETER: int +ERROR_DS_DRA_BUSY: int +ERROR_DS_DRA_BAD_DN: int +ERROR_DS_DRA_BAD_NC: int +ERROR_DS_DRA_DN_EXISTS: int +ERROR_DS_DRA_INTERNAL_ERROR: int +ERROR_DS_DRA_INCONSISTENT_DIT: int +ERROR_DS_DRA_CONNECTION_FAILED: int +ERROR_DS_DRA_BAD_INSTANCE_TYPE: int +ERROR_DS_DRA_OUT_OF_MEM: int +ERROR_DS_DRA_MAIL_PROBLEM: int +ERROR_DS_DRA_REF_ALREADY_EXISTS: int +ERROR_DS_DRA_REF_NOT_FOUND: int +ERROR_DS_DRA_OBJ_IS_REP_SOURCE: int +ERROR_DS_DRA_DB_ERROR: int +ERROR_DS_DRA_NO_REPLICA: int +ERROR_DS_DRA_ACCESS_DENIED: int +ERROR_DS_DRA_NOT_SUPPORTED: int +ERROR_DS_DRA_RPC_CANCELLED: int +ERROR_DS_DRA_SOURCE_DISABLED: int +ERROR_DS_DRA_SINK_DISABLED: int +ERROR_DS_DRA_NAME_COLLISION: int +ERROR_DS_DRA_SOURCE_REINSTALLED: int +ERROR_DS_DRA_MISSING_PARENT: int +ERROR_DS_DRA_PREEMPTED: int +ERROR_DS_DRA_ABANDON_SYNC: int +ERROR_DS_DRA_SHUTDOWN: int +ERROR_DS_DRA_INCOMPATIBLE_PARTIAL_SET: int +ERROR_DS_DRA_SOURCE_IS_PARTIAL_REPLICA: int +ERROR_DS_DRA_EXTN_CONNECTION_FAILED: int +ERROR_DS_INSTALL_SCHEMA_MISMATCH: int +ERROR_DS_DUP_LINK_ID: int +ERROR_DS_NAME_ERROR_RESOLVING: int +ERROR_DS_NAME_ERROR_NOT_FOUND: int +ERROR_DS_NAME_ERROR_NOT_UNIQUE: int +ERROR_DS_NAME_ERROR_NO_MAPPING: int +ERROR_DS_NAME_ERROR_DOMAIN_ONLY: int +ERROR_DS_NAME_ERROR_NO_SYNTACTICAL_MAPPING: int +ERROR_DS_CONSTRUCTED_ATT_MOD: int +ERROR_DS_WRONG_OM_OBJ_CLASS: int +ERROR_DS_DRA_REPL_PENDING: int +ERROR_DS_DS_REQUIRED: int +ERROR_DS_INVALID_LDAP_DISPLAY_NAME: int +ERROR_DS_NON_BASE_SEARCH: int +ERROR_DS_CANT_RETRIEVE_ATTS: int +ERROR_DS_BACKLINK_WITHOUT_LINK: int +ERROR_DS_EPOCH_MISMATCH: int +ERROR_DS_SRC_NAME_MISMATCH: int +ERROR_DS_SRC_AND_DST_NC_IDENTICAL: int +ERROR_DS_DST_NC_MISMATCH: int +ERROR_DS_NOT_AUTHORITIVE_FOR_DST_NC: int +ERROR_DS_SRC_GUID_MISMATCH: int +ERROR_DS_CANT_MOVE_DELETED_OBJECT: int +ERROR_DS_PDC_OPERATION_IN_PROGRESS: int +ERROR_DS_CROSS_DOMAIN_CLEANUP_REQD: int +ERROR_DS_ILLEGAL_XDOM_MOVE_OPERATION: int +ERROR_DS_CANT_WITH_ACCT_GROUP_MEMBERSHPS: int +ERROR_DS_NC_MUST_HAVE_NC_PARENT: int +ERROR_DS_CR_IMPOSSIBLE_TO_VALIDATE: int +ERROR_DS_DST_DOMAIN_NOT_NATIVE: int +ERROR_DS_MISSING_INFRASTRUCTURE_CONTAINER: int +ERROR_DS_CANT_MOVE_ACCOUNT_GROUP: int +ERROR_DS_CANT_MOVE_RESOURCE_GROUP: int +ERROR_DS_INVALID_SEARCH_FLAG: int +ERROR_DS_NO_TREE_DELETE_ABOVE_NC: int +ERROR_DS_COULDNT_LOCK_TREE_FOR_DELETE: int +ERROR_DS_COULDNT_IDENTIFY_OBJECTS_FOR_TREE_DELETE: int +ERROR_DS_SAM_INIT_FAILURE: int +ERROR_DS_SENSITIVE_GROUP_VIOLATION: int +ERROR_DS_CANT_MOD_PRIMARYGROUPID: int +ERROR_DS_ILLEGAL_BASE_SCHEMA_MOD: int +ERROR_DS_NONSAFE_SCHEMA_CHANGE: int +ERROR_DS_SCHEMA_UPDATE_DISALLOWED: int +ERROR_DS_CANT_CREATE_UNDER_SCHEMA: int +ERROR_DS_INSTALL_NO_SRC_SCH_VERSION: int +ERROR_DS_INSTALL_NO_SCH_VERSION_IN_INIFILE: int +ERROR_DS_INVALID_GROUP_TYPE: int +ERROR_DS_NO_NEST_GLOBALGROUP_IN_MIXEDDOMAIN: int +ERROR_DS_NO_NEST_LOCALGROUP_IN_MIXEDDOMAIN: int +ERROR_DS_GLOBAL_CANT_HAVE_LOCAL_MEMBER: int +ERROR_DS_GLOBAL_CANT_HAVE_UNIVERSAL_MEMBER: int +ERROR_DS_UNIVERSAL_CANT_HAVE_LOCAL_MEMBER: int +ERROR_DS_GLOBAL_CANT_HAVE_CROSSDOMAIN_MEMBER: int +ERROR_DS_LOCAL_CANT_HAVE_CROSSDOMAIN_LOCAL_MEMBER: int +ERROR_DS_HAVE_PRIMARY_MEMBERS: int +ERROR_DS_STRING_SD_CONVERSION_FAILED: int +ERROR_DS_NAMING_MASTER_GC: int +ERROR_DS_DNS_LOOKUP_FAILURE: int +ERROR_DS_COULDNT_UPDATE_SPNS: int +ERROR_DS_CANT_RETRIEVE_SD: int +ERROR_DS_KEY_NOT_UNIQUE: int +ERROR_DS_WRONG_LINKED_ATT_SYNTAX: int +ERROR_DS_SAM_NEED_BOOTKEY_PASSWORD: int +ERROR_DS_SAM_NEED_BOOTKEY_FLOPPY: int +ERROR_DS_CANT_START: int +ERROR_DS_INIT_FAILURE: int +ERROR_DS_NO_PKT_PRIVACY_ON_CONNECTION: int +ERROR_DS_SOURCE_DOMAIN_IN_FOREST: int +ERROR_DS_DESTINATION_DOMAIN_NOT_IN_FOREST: int +ERROR_DS_DESTINATION_AUDITING_NOT_ENABLED: int +ERROR_DS_CANT_FIND_DC_FOR_SRC_DOMAIN: int +ERROR_DS_SRC_OBJ_NOT_GROUP_OR_USER: int +ERROR_DS_SRC_SID_EXISTS_IN_FOREST: int +ERROR_DS_SRC_AND_DST_OBJECT_CLASS_MISMATCH: int +ERROR_SAM_INIT_FAILURE: int +ERROR_DS_DRA_SCHEMA_INFO_SHIP: int +ERROR_DS_DRA_SCHEMA_CONFLICT: int +ERROR_DS_DRA_EARLIER_SCHEMA_CONFLICT: int +ERROR_DS_DRA_OBJ_NC_MISMATCH: int +ERROR_DS_NC_STILL_HAS_DSAS: int +ERROR_DS_GC_REQUIRED: int +ERROR_DS_LOCAL_MEMBER_OF_LOCAL_ONLY: int +ERROR_DS_NO_FPO_IN_UNIVERSAL_GROUPS: int +ERROR_DS_CANT_ADD_TO_GC: int +ERROR_DS_NO_CHECKPOINT_WITH_PDC: int +ERROR_DS_SOURCE_AUDITING_NOT_ENABLED: int +ERROR_DS_CANT_CREATE_IN_NONDOMAIN_NC: int +ERROR_DS_INVALID_NAME_FOR_SPN: int +ERROR_DS_FILTER_USES_CONTRUCTED_ATTRS: int +ERROR_DS_UNICODEPWD_NOT_IN_QUOTES: int +ERROR_DS_MACHINE_ACCOUNT_QUOTA_EXCEEDED: int +ERROR_DS_MUST_BE_RUN_ON_DST_DC: int +ERROR_DS_SRC_DC_MUST_BE_SP4_OR_GREATER: int +ERROR_DS_CANT_TREE_DELETE_CRITICAL_OBJ: int +ERROR_DS_INIT_FAILURE_CONSOLE: int +ERROR_DS_SAM_INIT_FAILURE_CONSOLE: int +ERROR_DS_FOREST_VERSION_TOO_HIGH: int +ERROR_DS_DOMAIN_VERSION_TOO_HIGH: int +ERROR_DS_FOREST_VERSION_TOO_LOW: int +ERROR_DS_DOMAIN_VERSION_TOO_LOW: int +ERROR_DS_INCOMPATIBLE_VERSION: int +ERROR_DS_LOW_DSA_VERSION: int +ERROR_DS_NO_BEHAVIOR_VERSION_IN_MIXEDDOMAIN: int +ERROR_DS_NOT_SUPPORTED_SORT_ORDER: int +ERROR_DS_NAME_NOT_UNIQUE: int +ERROR_DS_MACHINE_ACCOUNT_CREATED_PRENT4: int +ERROR_DS_OUT_OF_VERSION_STORE: int +ERROR_DS_INCOMPATIBLE_CONTROLS_USED: int +ERROR_DS_NO_REF_DOMAIN: int +ERROR_DS_RESERVED_LINK_ID: int +ERROR_DS_LINK_ID_NOT_AVAILABLE: int +ERROR_DS_AG_CANT_HAVE_UNIVERSAL_MEMBER: int +ERROR_DS_MODIFYDN_DISALLOWED_BY_INSTANCE_TYPE: int +ERROR_DS_NO_OBJECT_MOVE_IN_SCHEMA_NC: int +ERROR_DS_MODIFYDN_DISALLOWED_BY_FLAG: int +ERROR_DS_MODIFYDN_WRONG_GRANDPARENT: int +ERROR_DS_NAME_ERROR_TRUST_REFERRAL: int +ERROR_NOT_SUPPORTED_ON_STANDARD_SERVER: int +ERROR_DS_CANT_ACCESS_REMOTE_PART_OF_AD: int +ERROR_DS_CR_IMPOSSIBLE_TO_VALIDATE_V2: int +ERROR_DS_THREAD_LIMIT_EXCEEDED: int +ERROR_DS_NOT_CLOSEST: int +ERROR_DS_CANT_DERIVE_SPN_WITHOUT_SERVER_REF: int +ERROR_DS_SINGLE_USER_MODE_FAILED: int +ERROR_DS_NTDSCRIPT_SYNTAX_ERROR: int +ERROR_DS_NTDSCRIPT_PROCESS_ERROR: int +ERROR_DS_DIFFERENT_REPL_EPOCHS: int +ERROR_DS_DRS_EXTENSIONS_CHANGED: int +ERROR_DS_REPLICA_SET_CHANGE_NOT_ALLOWED_ON_DISABLED_CR: int +ERROR_DS_NO_MSDS_INTID: int +ERROR_DS_DUP_MSDS_INTID: int +ERROR_DS_EXISTS_IN_RDNATTID: int +ERROR_DS_AUTHORIZATION_FAILED: int +ERROR_DS_INVALID_SCRIPT: int +ERROR_DS_REMOTE_CROSSREF_OP_FAILED: int +ERROR_DS_CROSS_REF_BUSY: int +ERROR_DS_CANT_DERIVE_SPN_FOR_DELETED_DOMAIN: int +ERROR_DS_CANT_DEMOTE_WITH_WRITEABLE_NC: int +ERROR_DS_DUPLICATE_ID_FOUND: int +ERROR_DS_INSUFFICIENT_ATTR_TO_CREATE_OBJECT: int +ERROR_DS_GROUP_CONVERSION_ERROR: int +ERROR_DS_CANT_MOVE_APP_BASIC_GROUP: int +ERROR_DS_CANT_MOVE_APP_QUERY_GROUP: int +ERROR_DS_ROLE_NOT_VERIFIED: int +ERROR_DS_WKO_CONTAINER_CANNOT_BE_SPECIAL: int +ERROR_DS_DOMAIN_RENAME_IN_PROGRESS: int +ERROR_DS_EXISTING_AD_CHILD_NC: int +ERROR_DS_REPL_LIFETIME_EXCEEDED: int +ERROR_DS_DISALLOWED_IN_SYSTEM_CONTAINER: int +ERROR_DS_LDAP_SEND_QUEUE_FULL: int +ERROR_DS_DRA_OUT_SCHEDULE_WINDOW: int +ERROR_DS_POLICY_NOT_KNOWN: int +ERROR_NO_SITE_SETTINGS_OBJECT: int +ERROR_NO_SECRETS: int +ERROR_NO_WRITABLE_DC_FOUND: int +ERROR_DS_NO_SERVER_OBJECT: int +ERROR_DS_NO_NTDSA_OBJECT: int +ERROR_DS_NON_ASQ_SEARCH: int +ERROR_DS_AUDIT_FAILURE: int +ERROR_DS_INVALID_SEARCH_FLAG_SUBTREE: int +ERROR_DS_INVALID_SEARCH_FLAG_TUPLE: int +ERROR_DS_HIERARCHY_TABLE_TOO_DEEP: int +SEVERITY_SUCCESS: int +SEVERITY_ERROR: int + +def HRESULT_FROM_WIN32(scode): ... +def SUCCEEDED(Status): ... +def FAILED(Status): ... +def HRESULT_CODE(hr: int) -> int: ... +def SCODE_CODE(sc): ... +def HRESULT_FACILITY(hr): ... +def SCODE_FACILITY(sc): ... +def HRESULT_SEVERITY(hr): ... +def SCODE_SEVERITY(sc): ... + +FACILITY_NT_BIT: int + +def HRESULT_FROM_NT(x): ... +def GetScode(hr): ... +def ResultFromScode(sc): ... + +NOERROR: int +E_UNEXPECTED: int +E_NOTIMPL: int +E_OUTOFMEMORY: int +E_INVALIDARG: int +E_NOINTERFACE: int +E_POINTER: int +E_HANDLE: int +E_ABORT: int +E_FAIL: int +E_ACCESSDENIED: int +win16_E_NOTIMPL: int +win16_E_OUTOFMEMORY: int +win16_E_INVALIDARG: int +win16_E_NOINTERFACE: int +win16_E_POINTER: int +win16_E_HANDLE: int +win16_E_ABORT: int +win16_E_FAIL: int +win16_E_ACCESSDENIED: int +E_PENDING: int +CO_E_INIT_TLS: int +CO_E_INIT_SHARED_ALLOCATOR: int +CO_E_INIT_MEMORY_ALLOCATOR: int +CO_E_INIT_CLASS_CACHE: int +CO_E_INIT_RPC_CHANNEL: int +CO_E_INIT_TLS_SET_CHANNEL_CONTROL: int +CO_E_INIT_TLS_CHANNEL_CONTROL: int +CO_E_INIT_UNACCEPTED_USER_ALLOCATOR: int +CO_E_INIT_SCM_MUTEX_EXISTS: int +CO_E_INIT_SCM_FILE_MAPPING_EXISTS: int +CO_E_INIT_SCM_MAP_VIEW_OF_FILE: int +CO_E_INIT_SCM_EXEC_FAILURE: int +CO_E_INIT_ONLY_SINGLE_THREADED: int +CO_E_CANT_REMOTE: int +CO_E_BAD_SERVER_NAME: int +CO_E_WRONG_SERVER_IDENTITY: int +CO_E_OLE1DDE_DISABLED: int +CO_E_RUNAS_SYNTAX: int +CO_E_CREATEPROCESS_FAILURE: int +CO_E_RUNAS_CREATEPROCESS_FAILURE: int +CO_E_RUNAS_LOGON_FAILURE: int +CO_E_LAUNCH_PERMSSION_DENIED: int +CO_E_START_SERVICE_FAILURE: int +CO_E_REMOTE_COMMUNICATION_FAILURE: int +CO_E_SERVER_START_TIMEOUT: int +CO_E_CLSREG_INCONSISTENT: int +CO_E_IIDREG_INCONSISTENT: int +CO_E_NOT_SUPPORTED: int +CO_E_RELOAD_DLL: int +CO_E_MSI_ERROR: int +OLE_E_FIRST: int +OLE_E_LAST: int +OLE_S_FIRST: int +OLE_S_LAST: int +OLE_E_OLEVERB: int +OLE_E_ADVF: int +OLE_E_ENUM_NOMORE: int +OLE_E_ADVISENOTSUPPORTED: int +OLE_E_NOCONNECTION: int +OLE_E_NOTRUNNING: int +OLE_E_NOCACHE: int +OLE_E_BLANK: int +OLE_E_CLASSDIFF: int +OLE_E_CANT_GETMONIKER: int +OLE_E_CANT_BINDTOSOURCE: int +OLE_E_STATIC: int +OLE_E_PROMPTSAVECANCELLED: int +OLE_E_INVALIDRECT: int +OLE_E_WRONGCOMPOBJ: int +OLE_E_INVALIDHWND: int +OLE_E_NOT_INPLACEACTIVE: int +OLE_E_CANTCONVERT: int +OLE_E_NOSTORAGE: int +DV_E_FORMATETC: int +DV_E_DVTARGETDEVICE: int +DV_E_STGMEDIUM: int +DV_E_STATDATA: int +DV_E_LINDEX: int +DV_E_TYMED: int +DV_E_CLIPFORMAT: int +DV_E_DVASPECT: int +DV_E_DVTARGETDEVICE_SIZE: int +DV_E_NOIVIEWOBJECT: int +DRAGDROP_E_FIRST: int +DRAGDROP_E_LAST: int +DRAGDROP_S_FIRST: int +DRAGDROP_S_LAST: int +DRAGDROP_E_NOTREGISTERED: int +DRAGDROP_E_ALREADYREGISTERED: int +DRAGDROP_E_INVALIDHWND: int +CLASSFACTORY_E_FIRST: int +CLASSFACTORY_E_LAST: int +CLASSFACTORY_S_FIRST: int +CLASSFACTORY_S_LAST: int +CLASS_E_NOAGGREGATION: int +CLASS_E_CLASSNOTAVAILABLE: int +CLASS_E_NOTLICENSED: int +MARSHAL_E_FIRST: int +MARSHAL_E_LAST: int +MARSHAL_S_FIRST: int +MARSHAL_S_LAST: int +DATA_E_FIRST: int +DATA_E_LAST: int +DATA_S_FIRST: int +DATA_S_LAST: int +VIEW_E_FIRST: int +VIEW_E_LAST: int +VIEW_S_FIRST: int +VIEW_S_LAST: int +VIEW_E_DRAW: int +REGDB_E_FIRST: int +REGDB_E_LAST: int +REGDB_S_FIRST: int +REGDB_S_LAST: int +REGDB_E_READREGDB: int +REGDB_E_WRITEREGDB: int +REGDB_E_KEYMISSING: int +REGDB_E_INVALIDVALUE: int +REGDB_E_CLASSNOTREG: int +REGDB_E_IIDNOTREG: int +CAT_E_FIRST: int +CAT_E_LAST: int +CAT_E_CATIDNOEXIST: int +CAT_E_NODESCRIPTION: int +CS_E_FIRST: int +CS_E_LAST: int +CS_E_PACKAGE_NOTFOUND: int +CS_E_NOT_DELETABLE: int +CS_E_CLASS_NOTFOUND: int +CS_E_INVALID_VERSION: int +CS_E_NO_CLASSSTORE: int +CACHE_E_FIRST: int +CACHE_E_LAST: int +CACHE_S_FIRST: int +CACHE_S_LAST: int +CACHE_E_NOCACHE_UPDATED: int +OLEOBJ_E_FIRST: int +OLEOBJ_E_LAST: int +OLEOBJ_S_FIRST: int +OLEOBJ_S_LAST: int +OLEOBJ_E_NOVERBS: int +OLEOBJ_E_INVALIDVERB: int +CLIENTSITE_E_FIRST: int +CLIENTSITE_E_LAST: int +CLIENTSITE_S_FIRST: int +CLIENTSITE_S_LAST: int +INPLACE_E_NOTUNDOABLE: int +INPLACE_E_NOTOOLSPACE: int +INPLACE_E_FIRST: int +INPLACE_E_LAST: int +INPLACE_S_FIRST: int +INPLACE_S_LAST: int +ENUM_E_FIRST: int +ENUM_E_LAST: int +ENUM_S_FIRST: int +ENUM_S_LAST: int +CONVERT10_E_FIRST: int +CONVERT10_E_LAST: int +CONVERT10_S_FIRST: int +CONVERT10_S_LAST: int +CONVERT10_E_OLESTREAM_GET: int +CONVERT10_E_OLESTREAM_PUT: int +CONVERT10_E_OLESTREAM_FMT: int +CONVERT10_E_OLESTREAM_BITMAP_TO_DIB: int +CONVERT10_E_STG_FMT: int +CONVERT10_E_STG_NO_STD_STREAM: int +CONVERT10_E_STG_DIB_TO_BITMAP: int +CLIPBRD_E_FIRST: int +CLIPBRD_E_LAST: int +CLIPBRD_S_FIRST: int +CLIPBRD_S_LAST: int +CLIPBRD_E_CANT_OPEN: int +CLIPBRD_E_CANT_EMPTY: int +CLIPBRD_E_CANT_SET: int +CLIPBRD_E_BAD_DATA: int +CLIPBRD_E_CANT_CLOSE: int +MK_E_FIRST: int +MK_E_LAST: int +MK_S_FIRST: int +MK_S_LAST: int +MK_E_CONNECTMANUALLY: int +MK_E_EXCEEDEDDEADLINE: int +MK_E_NEEDGENERIC: int +MK_E_UNAVAILABLE: int +MK_E_SYNTAX: int +MK_E_NOOBJECT: int +MK_E_INVALIDEXTENSION: int +MK_E_INTERMEDIATEINTERFACENOTSUPPORTED: int +MK_E_NOTBINDABLE: int +MK_E_NOTBOUND: int +MK_E_CANTOPENFILE: int +MK_E_MUSTBOTHERUSER: int +MK_E_NOINVERSE: int +MK_E_NOSTORAGE: int +MK_E_NOPREFIX: int +MK_E_ENUMERATION_FAILED: int +CO_E_FIRST: int +CO_E_LAST: int +CO_S_FIRST: int +CO_S_LAST: int +CO_E_NOTINITIALIZED: int +CO_E_ALREADYINITIALIZED: int +CO_E_CANTDETERMINECLASS: int +CO_E_CLASSSTRING: int +CO_E_IIDSTRING: int +CO_E_APPNOTFOUND: int +CO_E_APPSINGLEUSE: int +CO_E_ERRORINAPP: int +CO_E_DLLNOTFOUND: int +CO_E_ERRORINDLL: int +CO_E_WRONGOSFORAPP: int +CO_E_OBJNOTREG: int +CO_E_OBJISREG: int +CO_E_OBJNOTCONNECTED: int +CO_E_APPDIDNTREG: int +CO_E_RELEASED: int +CO_E_FAILEDTOIMPERSONATE: int +CO_E_FAILEDTOGETSECCTX: int +CO_E_FAILEDTOOPENTHREADTOKEN: int +CO_E_FAILEDTOGETTOKENINFO: int +CO_E_TRUSTEEDOESNTMATCHCLIENT: int +CO_E_FAILEDTOQUERYCLIENTBLANKET: int +CO_E_FAILEDTOSETDACL: int +CO_E_ACCESSCHECKFAILED: int +CO_E_NETACCESSAPIFAILED: int +CO_E_WRONGTRUSTEENAMESYNTAX: int +CO_E_INVALIDSID: int +CO_E_CONVERSIONFAILED: int +CO_E_NOMATCHINGSIDFOUND: int +CO_E_LOOKUPACCSIDFAILED: int +CO_E_NOMATCHINGNAMEFOUND: int +CO_E_LOOKUPACCNAMEFAILED: int +CO_E_SETSERLHNDLFAILED: int +CO_E_FAILEDTOGETWINDIR: int +CO_E_PATHTOOLONG: int +CO_E_FAILEDTOGENUUID: int +CO_E_FAILEDTOCREATEFILE: int +CO_E_FAILEDTOCLOSEHANDLE: int +CO_E_EXCEEDSYSACLLIMIT: int +CO_E_ACESINWRONGORDER: int +CO_E_INCOMPATIBLESTREAMVERSION: int +CO_E_FAILEDTOOPENPROCESSTOKEN: int +CO_E_DECODEFAILED: int +CO_E_ACNOTINITIALIZED: int +OLE_S_USEREG: int +OLE_S_STATIC: int +OLE_S_MAC_CLIPFORMAT: int +DRAGDROP_S_DROP: int +DRAGDROP_S_CANCEL: int +DRAGDROP_S_USEDEFAULTCURSORS: int +DATA_S_SAMEFORMATETC: int +VIEW_S_ALREADY_FROZEN: int +CACHE_S_FORMATETC_NOTSUPPORTED: int +CACHE_S_SAMECACHE: int +CACHE_S_SOMECACHES_NOTUPDATED: int +OLEOBJ_S_INVALIDVERB: int +OLEOBJ_S_CANNOT_DOVERB_NOW: int +OLEOBJ_S_INVALIDHWND: int +INPLACE_S_TRUNCATED: int +CONVERT10_S_NO_PRESENTATION: int +MK_S_REDUCED_TO_SELF: int +MK_S_ME: int +MK_S_HIM: int +MK_S_US: int +MK_S_MONIKERALREADYREGISTERED: int +CO_E_CLASS_CREATE_FAILED: int +CO_E_SCM_ERROR: int +CO_E_SCM_RPC_FAILURE: int +CO_E_BAD_PATH: int +CO_E_SERVER_EXEC_FAILURE: int +CO_E_OBJSRV_RPC_FAILURE: int +MK_E_NO_NORMALIZED: int +CO_E_SERVER_STOPPING: int +MEM_E_INVALID_ROOT: int +MEM_E_INVALID_LINK: int +MEM_E_INVALID_SIZE: int +CO_S_NOTALLINTERFACES: int +DISP_E_UNKNOWNINTERFACE: int +DISP_E_MEMBERNOTFOUND: int +DISP_E_PARAMNOTFOUND: int +DISP_E_TYPEMISMATCH: int +DISP_E_UNKNOWNNAME: int +DISP_E_NONAMEDARGS: int +DISP_E_BADVARTYPE: int +DISP_E_EXCEPTION: int +DISP_E_OVERFLOW: int +DISP_E_BADINDEX: int +DISP_E_UNKNOWNLCID: int +DISP_E_ARRAYISLOCKED: int +DISP_E_BADPARAMCOUNT: int +DISP_E_PARAMNOTOPTIONAL: int +DISP_E_BADCALLEE: int +DISP_E_NOTACOLLECTION: int +DISP_E_DIVBYZERO: int +TYPE_E_BUFFERTOOSMALL: int +TYPE_E_FIELDNOTFOUND: int +TYPE_E_INVDATAREAD: int +TYPE_E_UNSUPFORMAT: int +TYPE_E_REGISTRYACCESS: int +TYPE_E_LIBNOTREGISTERED: int +TYPE_E_UNDEFINEDTYPE: int +TYPE_E_QUALIFIEDNAMEDISALLOWED: int +TYPE_E_INVALIDSTATE: int +TYPE_E_WRONGTYPEKIND: int +TYPE_E_ELEMENTNOTFOUND: int +TYPE_E_AMBIGUOUSNAME: int +TYPE_E_NAMECONFLICT: int +TYPE_E_UNKNOWNLCID: int +TYPE_E_DLLFUNCTIONNOTFOUND: int +TYPE_E_BADMODULEKIND: int +TYPE_E_SIZETOOBIG: int +TYPE_E_DUPLICATEID: int +TYPE_E_INVALIDID: int +TYPE_E_TYPEMISMATCH: int +TYPE_E_OUTOFBOUNDS: int +TYPE_E_IOERROR: int +TYPE_E_CANTCREATETMPFILE: int +TYPE_E_CANTLOADLIBRARY: int +TYPE_E_INCONSISTENTPROPFUNCS: int +TYPE_E_CIRCULARTYPE: int +STG_E_INVALIDFUNCTION: int +STG_E_FILENOTFOUND: int +STG_E_PATHNOTFOUND: int +STG_E_TOOMANYOPENFILES: int +STG_E_ACCESSDENIED: int +STG_E_INVALIDHANDLE: int +STG_E_INSUFFICIENTMEMORY: int +STG_E_INVALIDPOINTER: int +STG_E_NOMOREFILES: int +STG_E_DISKISWRITEPROTECTED: int +STG_E_SEEKERROR: int +STG_E_WRITEFAULT: int +STG_E_READFAULT: int +STG_E_SHAREVIOLATION: int +STG_E_LOCKVIOLATION: int +STG_E_FILEALREADYEXISTS: int +STG_E_INVALIDPARAMETER: int +STG_E_MEDIUMFULL: int +STG_E_PROPSETMISMATCHED: int +STG_E_ABNORMALAPIEXIT: int +STG_E_INVALIDHEADER: int +STG_E_INVALIDNAME: int +STG_E_UNKNOWN: int +STG_E_UNIMPLEMENTEDFUNCTION: int +STG_E_INVALIDFLAG: int +STG_E_INUSE: int +STG_E_NOTCURRENT: int +STG_E_REVERTED: int +STG_E_CANTSAVE: int +STG_E_OLDFORMAT: int +STG_E_OLDDLL: int +STG_E_SHAREREQUIRED: int +STG_E_NOTFILEBASEDSTORAGE: int +STG_E_EXTANTMARSHALLINGS: int +STG_E_DOCFILECORRUPT: int +STG_E_BADBASEADDRESS: int +STG_E_INCOMPLETE: int +STG_E_TERMINATED: int +STG_S_CONVERTED: int +STG_S_BLOCK: int +STG_S_RETRYNOW: int +STG_S_MONITORING: int +STG_S_MULTIPLEOPENS: int +STG_S_CONSOLIDATIONFAILED: int +STG_S_CANNOTCONSOLIDATE: int +RPC_E_CALL_REJECTED: int +RPC_E_CALL_CANCELED: int +RPC_E_CANTPOST_INSENDCALL: int +RPC_E_CANTCALLOUT_INASYNCCALL: int +RPC_E_CANTCALLOUT_INEXTERNALCALL: int +RPC_E_CONNECTION_TERMINATED: int +RPC_E_SERVER_DIED: int +RPC_E_CLIENT_DIED: int +RPC_E_INVALID_DATAPACKET: int +RPC_E_CANTTRANSMIT_CALL: int +RPC_E_CLIENT_CANTMARSHAL_DATA: int +RPC_E_CLIENT_CANTUNMARSHAL_DATA: int +RPC_E_SERVER_CANTMARSHAL_DATA: int +RPC_E_SERVER_CANTUNMARSHAL_DATA: int +RPC_E_INVALID_DATA: int +RPC_E_INVALID_PARAMETER: int +RPC_E_CANTCALLOUT_AGAIN: int +RPC_E_SERVER_DIED_DNE: int +RPC_E_SYS_CALL_FAILED: int +RPC_E_OUT_OF_RESOURCES: int +RPC_E_ATTEMPTED_MULTITHREAD: int +RPC_E_NOT_REGISTERED: int +RPC_E_FAULT: int +RPC_E_SERVERFAULT: int +RPC_E_CHANGED_MODE: int +RPC_E_INVALIDMETHOD: int +RPC_E_DISCONNECTED: int +RPC_E_RETRY: int +RPC_E_SERVERCALL_RETRYLATER: int +RPC_E_SERVERCALL_REJECTED: int +RPC_E_INVALID_CALLDATA: int +RPC_E_CANTCALLOUT_ININPUTSYNCCALL: int +RPC_E_WRONG_THREAD: int +RPC_E_THREAD_NOT_INIT: int +RPC_E_VERSION_MISMATCH: int +RPC_E_INVALID_HEADER: int +RPC_E_INVALID_EXTENSION: int +RPC_E_INVALID_IPID: int +RPC_E_INVALID_OBJECT: int +RPC_S_CALLPENDING: int +RPC_S_WAITONTIMER: int +RPC_E_CALL_COMPLETE: int +RPC_E_UNSECURE_CALL: int +RPC_E_TOO_LATE: int +RPC_E_NO_GOOD_SECURITY_PACKAGES: int +RPC_E_ACCESS_DENIED: int +RPC_E_REMOTE_DISABLED: int +RPC_E_INVALID_OBJREF: int +RPC_E_NO_CONTEXT: int +RPC_E_TIMEOUT: int +RPC_E_NO_SYNC: int +RPC_E_UNEXPECTED: int +NTE_BAD_UID: int +NTE_BAD_HASH: int +NTE_BAD_KEY: int +NTE_BAD_LEN: int +NTE_BAD_DATA: int +NTE_BAD_SIGNATURE: int +NTE_BAD_VER: int +NTE_BAD_ALGID: int +NTE_BAD_FLAGS: int +NTE_BAD_TYPE: int +NTE_BAD_KEY_STATE: int +NTE_BAD_HASH_STATE: int +NTE_NO_KEY: int +NTE_NO_MEMORY: int +NTE_EXISTS: int +NTE_PERM: int +NTE_NOT_FOUND: int +NTE_DOUBLE_ENCRYPT: int +NTE_BAD_PROVIDER: int +NTE_BAD_PROV_TYPE: int +NTE_BAD_PUBLIC_KEY: int +NTE_BAD_KEYSET: int +NTE_PROV_TYPE_NOT_DEF: int +NTE_PROV_TYPE_ENTRY_BAD: int +NTE_KEYSET_NOT_DEF: int +NTE_KEYSET_ENTRY_BAD: int +NTE_PROV_TYPE_NO_MATCH: int +NTE_SIGNATURE_FILE_BAD: int +NTE_PROVIDER_DLL_FAIL: int +NTE_PROV_DLL_NOT_FOUND: int +NTE_BAD_KEYSET_PARAM: int +NTE_FAIL: int +NTE_SYS_ERR: int +CRYPT_E_MSG_ERROR: int +CRYPT_E_UNKNOWN_ALGO: int +CRYPT_E_OID_FORMAT: int +CRYPT_E_INVALID_MSG_TYPE: int +CRYPT_E_UNEXPECTED_ENCODING: int +CRYPT_E_AUTH_ATTR_MISSING: int +CRYPT_E_HASH_VALUE: int +CRYPT_E_INVALID_INDEX: int +CRYPT_E_ALREADY_DECRYPTED: int +CRYPT_E_NOT_DECRYPTED: int +CRYPT_E_RECIPIENT_NOT_FOUND: int +CRYPT_E_CONTROL_TYPE: int +CRYPT_E_ISSUER_SERIALNUMBER: int +CRYPT_E_SIGNER_NOT_FOUND: int +CRYPT_E_ATTRIBUTES_MISSING: int +CRYPT_E_STREAM_MSG_NOT_READY: int +CRYPT_E_STREAM_INSUFFICIENT_DATA: int +CRYPT_E_BAD_LEN: int +CRYPT_E_BAD_ENCODE: int +CRYPT_E_FILE_ERROR: int +CRYPT_E_NOT_FOUND: int +CRYPT_E_EXISTS: int +CRYPT_E_NO_PROVIDER: int +CRYPT_E_SELF_SIGNED: int +CRYPT_E_DELETED_PREV: int +CRYPT_E_NO_MATCH: int +CRYPT_E_UNEXPECTED_MSG_TYPE: int +CRYPT_E_NO_KEY_PROPERTY: int +CRYPT_E_NO_DECRYPT_CERT: int +CRYPT_E_BAD_MSG: int +CRYPT_E_NO_SIGNER: int +CRYPT_E_PENDING_CLOSE: int +CRYPT_E_REVOKED: int +CRYPT_E_NO_REVOCATION_DLL: int +CRYPT_E_NO_REVOCATION_CHECK: int +CRYPT_E_REVOCATION_OFFLINE: int +CRYPT_E_NOT_IN_REVOCATION_DATABASE: int +CRYPT_E_INVALID_NUMERIC_STRING: int +CRYPT_E_INVALID_PRINTABLE_STRING: int +CRYPT_E_INVALID_IA5_STRING: int +CRYPT_E_INVALID_X500_STRING: int +CRYPT_E_NOT_CHAR_STRING: int +CRYPT_E_FILERESIZED: int +CRYPT_E_SECURITY_SETTINGS: int +CRYPT_E_NO_VERIFY_USAGE_DLL: int +CRYPT_E_NO_VERIFY_USAGE_CHECK: int +CRYPT_E_VERIFY_USAGE_OFFLINE: int +CRYPT_E_NOT_IN_CTL: int +CRYPT_E_NO_TRUSTED_SIGNER: int +CRYPT_E_OSS_ERROR: int +CERTSRV_E_BAD_REQUESTSUBJECT: int +CERTSRV_E_NO_REQUEST: int +CERTSRV_E_BAD_REQUESTSTATUS: int +CERTSRV_E_PROPERTY_EMPTY: int +CERTDB_E_JET_ERROR: int +TRUST_E_SYSTEM_ERROR: int +TRUST_E_NO_SIGNER_CERT: int +TRUST_E_COUNTER_SIGNER: int +TRUST_E_CERT_SIGNATURE: int +TRUST_E_TIME_STAMP: int +TRUST_E_BAD_DIGEST: int +TRUST_E_BASIC_CONSTRAINTS: int +TRUST_E_FINANCIAL_CRITERIA: int +NTE_OP_OK: int +DIGSIG_E_ENCODE: int +DIGSIG_E_DECODE: int +DIGSIG_E_EXTENSIBILITY: int +DIGSIG_E_CRYPTO: int +PERSIST_E_SIZEDEFINITE: int +PERSIST_E_SIZEINDEFINITE: int +PERSIST_E_NOTSELFSIZING: int +TRUST_E_NOSIGNATURE: int +CERT_E_EXPIRED: int +CERT_E_VALIDITYPERIODNESTING: int +CERT_E_ROLE: int +CERT_E_PATHLENCONST: int +CERT_E_CRITICAL: int +CERT_E_PURPOSE: int +CERT_E_ISSUERCHAINING: int +CERT_E_MALFORMED: int +CERT_E_UNTRUSTEDROOT: int +CERT_E_CHAINING: int +TRUST_E_FAIL: int +CERT_E_REVOKED: int +CERT_E_UNTRUSTEDTESTROOT: int +CERT_E_REVOCATION_FAILURE: int +CERT_E_CN_NO_MATCH: int +CERT_E_WRONG_USAGE: int +SPAPI_E_EXPECTED_SECTION_NAME: int +SPAPI_E_BAD_SECTION_NAME_LINE: int +SPAPI_E_SECTION_NAME_TOO_LONG: int +SPAPI_E_GENERAL_SYNTAX: int +SPAPI_E_WRONG_INF_STYLE: int +SPAPI_E_SECTION_NOT_FOUND: int +SPAPI_E_LINE_NOT_FOUND: int +SPAPI_E_NO_ASSOCIATED_CLASS: int +SPAPI_E_CLASS_MISMATCH: int +SPAPI_E_DUPLICATE_FOUND: int +SPAPI_E_NO_DRIVER_SELECTED: int +SPAPI_E_KEY_DOES_NOT_EXIST: int +SPAPI_E_INVALID_DEVINST_NAME: int +SPAPI_E_INVALID_CLASS: int +SPAPI_E_DEVINST_ALREADY_EXISTS: int +SPAPI_E_DEVINFO_NOT_REGISTERED: int +SPAPI_E_INVALID_REG_PROPERTY: int +SPAPI_E_NO_INF: int +SPAPI_E_NO_SUCH_DEVINST: int +SPAPI_E_CANT_LOAD_CLASS_ICON: int +SPAPI_E_INVALID_CLASS_INSTALLER: int +SPAPI_E_DI_DO_DEFAULT: int +SPAPI_E_DI_NOFILECOPY: int +SPAPI_E_INVALID_HWPROFILE: int +SPAPI_E_NO_DEVICE_SELECTED: int +SPAPI_E_DEVINFO_LIST_LOCKED: int +SPAPI_E_DEVINFO_DATA_LOCKED: int +SPAPI_E_DI_BAD_PATH: int +SPAPI_E_NO_CLASSINSTALL_PARAMS: int +SPAPI_E_FILEQUEUE_LOCKED: int +SPAPI_E_BAD_SERVICE_INSTALLSECT: int +SPAPI_E_NO_CLASS_DRIVER_LIST: int +SPAPI_E_NO_ASSOCIATED_SERVICE: int +SPAPI_E_NO_DEFAULT_DEVICE_INTERFACE: int +SPAPI_E_DEVICE_INTERFACE_ACTIVE: int +SPAPI_E_DEVICE_INTERFACE_REMOVED: int +SPAPI_E_BAD_INTERFACE_INSTALLSECT: int +SPAPI_E_NO_SUCH_INTERFACE_CLASS: int +SPAPI_E_INVALID_REFERENCE_STRING: int +SPAPI_E_INVALID_MACHINENAME: int +SPAPI_E_REMOTE_COMM_FAILURE: int +SPAPI_E_MACHINE_UNAVAILABLE: int +SPAPI_E_NO_CONFIGMGR_SERVICES: int +SPAPI_E_INVALID_PROPPAGE_PROVIDER: int +SPAPI_E_NO_SUCH_DEVICE_INTERFACE: int +SPAPI_E_DI_POSTPROCESSING_REQUIRED: int +SPAPI_E_INVALID_COINSTALLER: int +SPAPI_E_NO_COMPAT_DRIVERS: int +SPAPI_E_NO_DEVICE_ICON: int +SPAPI_E_INVALID_INF_LOGCONFIG: int +SPAPI_E_DI_DONT_INSTALL: int +SPAPI_E_INVALID_FILTER_DRIVER: int +SPAPI_E_ERROR_NOT_INSTALLED: int +CDERR_DIALOGFAILURE: int +CDERR_GENERALCODES: int +CDERR_STRUCTSIZE: int +CDERR_INITIALIZATION: int +CDERR_NOTEMPLATE: int +CDERR_NOHINSTANCE: int +CDERR_LOADSTRFAILURE: int +CDERR_FINDRESFAILURE: int +CDERR_LOADRESFAILURE: int +CDERR_LOCKRESFAILURE: int +CDERR_MEMALLOCFAILURE: int +CDERR_MEMLOCKFAILURE: int +CDERR_NOHOOK: int +CDERR_REGISTERMSGFAIL: int +PDERR_PRINTERCODES: int +PDERR_SETUPFAILURE: int +PDERR_PARSEFAILURE: int +PDERR_RETDEFFAILURE: int +PDERR_LOADDRVFAILURE: int +PDERR_GETDEVMODEFAIL: int +PDERR_INITFAILURE: int +PDERR_NODEVICES: int +PDERR_NODEFAULTPRN: int +PDERR_DNDMMISMATCH: int +PDERR_CREATEICFAILURE: int +PDERR_PRINTERNOTFOUND: int +PDERR_DEFAULTDIFFERENT: int +CFERR_CHOOSEFONTCODES: int +CFERR_NOFONTS: int +CFERR_MAXLESSTHANMIN: int +FNERR_FILENAMECODES: int +FNERR_SUBCLASSFAILURE: int +FNERR_INVALIDFILENAME: int +FNERR_BUFFERTOOSMALL: int +FRERR_FINDREPLACECODES: int +FRERR_BUFFERLENGTHZERO: int +CCERR_CHOOSECOLORCODES: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/winioctlcon.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/winioctlcon.pyi new file mode 100644 index 000000000..49028ceb8 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/winioctlcon.pyi @@ -0,0 +1,661 @@ +import _win32typing + +def CTL_CODE(DeviceType: int, Function: int, Method: int, Access: int) -> int: ... +def DEVICE_TYPE_FROM_CTL_CODE(ctrlCode: int) -> int: ... + +FILE_DEVICE_BEEP: int +FILE_DEVICE_CD_ROM: int +FILE_DEVICE_CD_ROM_FILE_SYSTEM: int +FILE_DEVICE_CONTROLLER: int +FILE_DEVICE_DATALINK: int +FILE_DEVICE_DFS: int +FILE_DEVICE_DISK: int +FILE_DEVICE_DISK_FILE_SYSTEM: int +FILE_DEVICE_FILE_SYSTEM: int +FILE_DEVICE_INPORT_PORT: int +FILE_DEVICE_KEYBOARD: int +FILE_DEVICE_MAILSLOT: int +FILE_DEVICE_MIDI_IN: int +FILE_DEVICE_MIDI_OUT: int +FILE_DEVICE_MOUSE: int +FILE_DEVICE_MULTI_UNC_PROVIDER: int +FILE_DEVICE_NAMED_PIPE: int +FILE_DEVICE_NETWORK: int +FILE_DEVICE_NETWORK_BROWSER: int +FILE_DEVICE_NETWORK_FILE_SYSTEM: int +FILE_DEVICE_NULL: int +FILE_DEVICE_PARALLEL_PORT: int +FILE_DEVICE_PHYSICAL_NETCARD: int +FILE_DEVICE_PRINTER: int +FILE_DEVICE_SCANNER: int +FILE_DEVICE_SERIAL_MOUSE_PORT: int +FILE_DEVICE_SERIAL_PORT: int +FILE_DEVICE_SCREEN: int +FILE_DEVICE_SOUND: int +FILE_DEVICE_STREAMS: int +FILE_DEVICE_TAPE: int +FILE_DEVICE_TAPE_FILE_SYSTEM: int +FILE_DEVICE_TRANSPORT: int +FILE_DEVICE_UNKNOWN: int +FILE_DEVICE_VIDEO: int +FILE_DEVICE_VIRTUAL_DISK: int +FILE_DEVICE_WAVE_IN: int +FILE_DEVICE_WAVE_OUT: int +FILE_DEVICE_8042_PORT: int +FILE_DEVICE_NETWORK_REDIRECTOR: int +FILE_DEVICE_BATTERY: int +FILE_DEVICE_BUS_EXTENDER: int +FILE_DEVICE_MODEM: int +FILE_DEVICE_VDM: int +FILE_DEVICE_MASS_STORAGE: int +FILE_DEVICE_SMB: int +FILE_DEVICE_KS: int +FILE_DEVICE_CHANGER: int +FILE_DEVICE_SMARTCARD: int +FILE_DEVICE_ACPI: int +FILE_DEVICE_DVD: int +FILE_DEVICE_FULLSCREEN_VIDEO: int +FILE_DEVICE_DFS_FILE_SYSTEM: int +FILE_DEVICE_DFS_VOLUME: int +FILE_DEVICE_SERENUM: int +FILE_DEVICE_TERMSRV: int +FILE_DEVICE_KSEC: int +FILE_DEVICE_FIPS: int +FILE_DEVICE_INFINIBAND: int +METHOD_BUFFERED: int +METHOD_IN_DIRECT: int +METHOD_OUT_DIRECT: int +METHOD_NEITHER: int +METHOD_DIRECT_TO_HARDWARE: int +METHOD_DIRECT_FROM_HARDWARE: int +FILE_ANY_ACCESS: int +FILE_SPECIAL_ACCESS: int +FILE_READ_ACCESS: int +FILE_WRITE_ACCESS: int +IOCTL_STORAGE_BASE: int +RECOVERED_WRITES_VALID: int +UNRECOVERED_WRITES_VALID: int +RECOVERED_READS_VALID: int +UNRECOVERED_READS_VALID: int +WRITE_COMPRESSION_INFO_VALID: int +READ_COMPRESSION_INFO_VALID: int +TAPE_RETURN_STATISTICS: int +TAPE_RETURN_ENV_INFO: int +TAPE_RESET_STATISTICS: int +MEDIA_ERASEABLE: int +MEDIA_WRITE_ONCE: int +MEDIA_READ_ONLY: int +MEDIA_READ_WRITE: int +MEDIA_WRITE_PROTECTED: int +MEDIA_CURRENTLY_MOUNTED: int +IOCTL_DISK_BASE: int +PARTITION_ENTRY_UNUSED: int +PARTITION_FAT_12: int +PARTITION_XENIX_1: int +PARTITION_XENIX_2: int +PARTITION_FAT_16: int +PARTITION_EXTENDED: int +PARTITION_HUGE: int +PARTITION_IFS: int +PARTITION_OS2BOOTMGR: int +PARTITION_FAT32: int +PARTITION_FAT32_XINT13: int +PARTITION_XINT13: int +PARTITION_XINT13_EXTENDED: int +PARTITION_PREP: int +PARTITION_LDM: int +PARTITION_UNIX: int +VALID_NTFT: int +PARTITION_NTFT: int +GPT_ATTRIBUTE_PLATFORM_REQUIRED: int +GPT_BASIC_DATA_ATTRIBUTE_NO_DRIVE_LETTER: int +GPT_BASIC_DATA_ATTRIBUTE_HIDDEN: int +GPT_BASIC_DATA_ATTRIBUTE_SHADOW_COPY: int +GPT_BASIC_DATA_ATTRIBUTE_READ_ONLY: int +HIST_NO_OF_BUCKETS: int +DISK_LOGGING_START: int +DISK_LOGGING_STOP: int +DISK_LOGGING_DUMP: int +DISK_BINNING: int +CAP_ATA_ID_CMD: int +CAP_ATAPI_ID_CMD: int +CAP_SMART_CMD: int +ATAPI_ID_CMD: int +ID_CMD: int +SMART_CMD: int +SMART_CYL_LOW: int +SMART_CYL_HI: int +SMART_NO_ERROR: int +SMART_IDE_ERROR: int +SMART_INVALID_FLAG: int +SMART_INVALID_COMMAND: int +SMART_INVALID_BUFFER: int +SMART_INVALID_DRIVE: int +SMART_INVALID_IOCTL: int +SMART_ERROR_NO_MEM: int +SMART_INVALID_REGISTER: int +SMART_NOT_SUPPORTED: int +SMART_NO_IDE_DEVICE: int +SMART_OFFLINE_ROUTINE_OFFLINE: int +SMART_SHORT_SELFTEST_OFFLINE: int +SMART_EXTENDED_SELFTEST_OFFLINE: int +SMART_ABORT_OFFLINE_SELFTEST: int +SMART_SHORT_SELFTEST_CAPTIVE: int +SMART_EXTENDED_SELFTEST_CAPTIVE: int +READ_ATTRIBUTE_BUFFER_SIZE: int +IDENTIFY_BUFFER_SIZE: int +READ_THRESHOLD_BUFFER_SIZE: int +SMART_LOG_SECTOR_SIZE: int +READ_ATTRIBUTES: int +READ_THRESHOLDS: int +ENABLE_DISABLE_AUTOSAVE: int +SAVE_ATTRIBUTE_VALUES: int +EXECUTE_OFFLINE_DIAGS: int +SMART_READ_LOG: int +SMART_WRITE_LOG: int +ENABLE_SMART: int +DISABLE_SMART: int +RETURN_SMART_STATUS: int +ENABLE_DISABLE_AUTO_OFFLINE: int +IOCTL_CHANGER_BASE: int +MAX_VOLUME_ID_SIZE: int +MAX_VOLUME_TEMPLATE_SIZE: int +VENDOR_ID_LENGTH: int +PRODUCT_ID_LENGTH: int +REVISION_LENGTH: int +SERIAL_NUMBER_LENGTH: int +CHANGER_BAR_CODE_SCANNER_INSTALLED: int +CHANGER_INIT_ELEM_STAT_WITH_RANGE: int +CHANGER_CLOSE_IEPORT: int +CHANGER_OPEN_IEPORT: int +CHANGER_STATUS_NON_VOLATILE: int +CHANGER_EXCHANGE_MEDIA: int +CHANGER_CLEANER_SLOT: int +CHANGER_LOCK_UNLOCK: int +CHANGER_CARTRIDGE_MAGAZINE: int +CHANGER_MEDIUM_FLIP: int +CHANGER_POSITION_TO_ELEMENT: int +CHANGER_REPORT_IEPORT_STATE: int +CHANGER_STORAGE_DRIVE: int +CHANGER_STORAGE_IEPORT: int +CHANGER_STORAGE_SLOT: int +CHANGER_STORAGE_TRANSPORT: int +CHANGER_DRIVE_CLEANING_REQUIRED: int +CHANGER_PREDISMOUNT_EJECT_REQUIRED: int +CHANGER_CLEANER_ACCESS_NOT_VALID: int +CHANGER_PREMOUNT_EJECT_REQUIRED: int +CHANGER_VOLUME_IDENTIFICATION: int +CHANGER_VOLUME_SEARCH: int +CHANGER_VOLUME_ASSERT: int +CHANGER_VOLUME_REPLACE: int +CHANGER_VOLUME_UNDEFINE: int +CHANGER_SERIAL_NUMBER_VALID: int +CHANGER_DEVICE_REINITIALIZE_CAPABLE: int +CHANGER_KEYPAD_ENABLE_DISABLE: int +CHANGER_DRIVE_EMPTY_ON_DOOR_ACCESS: int +CHANGER_RESERVED_BIT: int +CHANGER_PREDISMOUNT_ALIGN_TO_SLOT: int +CHANGER_PREDISMOUNT_ALIGN_TO_DRIVE: int +CHANGER_CLEANER_AUTODISMOUNT: int +CHANGER_TRUE_EXCHANGE_CAPABLE: int +CHANGER_SLOTS_USE_TRAYS: int +CHANGER_RTN_MEDIA_TO_ORIGINAL_ADDR: int +CHANGER_CLEANER_OPS_NOT_SUPPORTED: int +CHANGER_IEPORT_USER_CONTROL_OPEN: int +CHANGER_IEPORT_USER_CONTROL_CLOSE: int +CHANGER_MOVE_EXTENDS_IEPORT: int +CHANGER_MOVE_RETRACTS_IEPORT: int +CHANGER_TO_TRANSPORT: int +CHANGER_TO_SLOT: int +CHANGER_TO_IEPORT: int +CHANGER_TO_DRIVE: int +LOCK_UNLOCK_IEPORT: int +LOCK_UNLOCK_DOOR: int +LOCK_UNLOCK_KEYPAD: int +LOCK_ELEMENT: int +UNLOCK_ELEMENT: int +EXTEND_IEPORT: int +RETRACT_IEPORT: int +ELEMENT_STATUS_FULL: int +ELEMENT_STATUS_IMPEXP: int +ELEMENT_STATUS_EXCEPT: int +ELEMENT_STATUS_ACCESS: int +ELEMENT_STATUS_EXENAB: int +ELEMENT_STATUS_INENAB: int +ELEMENT_STATUS_PRODUCT_DATA: int +ELEMENT_STATUS_LUN_VALID: int +ELEMENT_STATUS_ID_VALID: int +ELEMENT_STATUS_NOT_BUS: int +ELEMENT_STATUS_INVERT: int +ELEMENT_STATUS_SVALID: int +ELEMENT_STATUS_PVOLTAG: int +ELEMENT_STATUS_AVOLTAG: int +ERROR_LABEL_UNREADABLE: int +ERROR_LABEL_QUESTIONABLE: int +ERROR_SLOT_NOT_PRESENT: int +ERROR_DRIVE_NOT_INSTALLED: int +ERROR_TRAY_MALFUNCTION: int +ERROR_INIT_STATUS_NEEDED: int +ERROR_UNHANDLED_ERROR: int +SEARCH_ALL: int +SEARCH_PRIMARY: int +SEARCH_ALTERNATE: int +SEARCH_ALL_NO_SEQ: int +SEARCH_PRI_NO_SEQ: int +SEARCH_ALT_NO_SEQ: int +ASSERT_PRIMARY: int +ASSERT_ALTERNATE: int +REPLACE_PRIMARY: int +REPLACE_ALTERNATE: int +UNDEFINE_PRIMARY: int +UNDEFINE_ALTERNATE: int +USN_PAGE_SIZE: int +USN_REASON_DATA_OVERWRITE: int +USN_REASON_DATA_EXTEND: int +USN_REASON_DATA_TRUNCATION: int +USN_REASON_NAMED_DATA_OVERWRITE: int +USN_REASON_NAMED_DATA_EXTEND: int +USN_REASON_NAMED_DATA_TRUNCATION: int +USN_REASON_FILE_CREATE: int +USN_REASON_FILE_DELETE: int +USN_REASON_EA_CHANGE: int +USN_REASON_SECURITY_CHANGE: int +USN_REASON_RENAME_OLD_NAME: int +USN_REASON_RENAME_NEW_NAME: int +USN_REASON_INDEXABLE_CHANGE: int +USN_REASON_BASIC_INFO_CHANGE: int +USN_REASON_HARD_LINK_CHANGE: int +USN_REASON_COMPRESSION_CHANGE: int +USN_REASON_ENCRYPTION_CHANGE: int +USN_REASON_OBJECT_ID_CHANGE: int +USN_REASON_REPARSE_POINT_CHANGE: int +USN_REASON_STREAM_CHANGE: int +USN_REASON_TRANSACTED_CHANGE: int +USN_REASON_CLOSE: int +USN_DELETE_FLAG_DELETE: int +USN_DELETE_FLAG_NOTIFY: int +USN_DELETE_VALID_FLAGS: int +USN_SOURCE_DATA_MANAGEMENT: int +USN_SOURCE_AUXILIARY_DATA: int +USN_SOURCE_REPLICATION_MANAGEMENT: int +MARK_HANDLE_PROTECT_CLUSTERS: int +MARK_HANDLE_TXF_SYSTEM_LOG: int +MARK_HANDLE_NOT_TXF_SYSTEM_LOG: int +VOLUME_IS_DIRTY: int +VOLUME_UPGRADE_SCHEDULED: int +VOLUME_SESSION_OPEN: int +FILE_PREFETCH_TYPE_FOR_CREATE: int +FILE_PREFETCH_TYPE_FOR_DIRENUM: int +FILE_PREFETCH_TYPE_FOR_CREATE_EX: int +FILE_PREFETCH_TYPE_FOR_DIRENUM_EX: int +FILE_PREFETCH_TYPE_MAX: int +FILESYSTEM_STATISTICS_TYPE_NTFS: int +FILESYSTEM_STATISTICS_TYPE_FAT: int +FILE_SET_ENCRYPTION: int +FILE_CLEAR_ENCRYPTION: int +STREAM_SET_ENCRYPTION: int +STREAM_CLEAR_ENCRYPTION: int +MAXIMUM_ENCRYPTION_VALUE: int +ENCRYPTION_FORMAT_DEFAULT: int +COMPRESSION_FORMAT_SPARSE: int +COPYFILE_SIS_LINK: int +COPYFILE_SIS_REPLACE: int +COPYFILE_SIS_FLAGS: int +WMI_DISK_GEOMETRY_GUID: _win32typing.PyIID +GUID_DEVINTERFACE_CDROM: _win32typing.PyIID +GUID_DEVINTERFACE_FLOPPY: _win32typing.PyIID +GUID_DEVINTERFACE_SERENUM_BUS_ENUMERATOR: _win32typing.PyIID +GUID_DEVINTERFACE_COMPORT: _win32typing.PyIID +GUID_DEVINTERFACE_DISK: _win32typing.PyIID +GUID_DEVINTERFACE_STORAGEPORT: _win32typing.PyIID +GUID_DEVINTERFACE_CDCHANGER: _win32typing.PyIID +GUID_DEVINTERFACE_PARTITION: _win32typing.PyIID +GUID_DEVINTERFACE_VOLUME: _win32typing.PyIID +GUID_DEVINTERFACE_WRITEONCEDISK: _win32typing.PyIID +GUID_DEVINTERFACE_TAPE: _win32typing.PyIID +GUID_DEVINTERFACE_MEDIUMCHANGER: _win32typing.PyIID +GUID_SERENUM_BUS_ENUMERATOR: int +GUID_CLASS_COMPORT: int +DiskClassGuid: int +CdRomClassGuid: int +PartitionClassGuid: int +TapeClassGuid: int +WriteOnceDiskClassGuid: int +VolumeClassGuid: int +MediumChangerClassGuid: int +FloppyClassGuid: int +CdChangerClassGuid: int +StoragePortClassGuid: int +IOCTL_STORAGE_CHECK_VERIFY: int +IOCTL_STORAGE_CHECK_VERIFY2: int +IOCTL_STORAGE_MEDIA_REMOVAL: int +IOCTL_STORAGE_EJECT_MEDIA: int +IOCTL_STORAGE_LOAD_MEDIA: int +IOCTL_STORAGE_LOAD_MEDIA2: int +IOCTL_STORAGE_RESERVE: int +IOCTL_STORAGE_RELEASE: int +IOCTL_STORAGE_FIND_NEW_DEVICES: int +IOCTL_STORAGE_EJECTION_CONTROL: int +IOCTL_STORAGE_MCN_CONTROL: int +IOCTL_STORAGE_GET_MEDIA_TYPES: int +IOCTL_STORAGE_GET_MEDIA_TYPES_EX: int +IOCTL_STORAGE_GET_MEDIA_SERIAL_NUMBER: int +IOCTL_STORAGE_GET_HOTPLUG_INFO: int +IOCTL_STORAGE_SET_HOTPLUG_INFO: int +IOCTL_STORAGE_RESET_BUS: int +IOCTL_STORAGE_RESET_DEVICE: int +IOCTL_STORAGE_BREAK_RESERVATION: int +IOCTL_STORAGE_GET_DEVICE_NUMBER: int +IOCTL_STORAGE_PREDICT_FAILURE: int +IOCTL_DISK_GET_DRIVE_GEOMETRY: int +IOCTL_DISK_GET_PARTITION_INFO: int +IOCTL_DISK_SET_PARTITION_INFO: int +IOCTL_DISK_GET_DRIVE_LAYOUT: int +IOCTL_DISK_SET_DRIVE_LAYOUT: int +IOCTL_DISK_VERIFY: int +IOCTL_DISK_FORMAT_TRACKS: int +IOCTL_DISK_REASSIGN_BLOCKS: int +IOCTL_DISK_PERFORMANCE: int +IOCTL_DISK_IS_WRITABLE: int +IOCTL_DISK_LOGGING: int +IOCTL_DISK_FORMAT_TRACKS_EX: int +IOCTL_DISK_HISTOGRAM_STRUCTURE: int +IOCTL_DISK_HISTOGRAM_DATA: int +IOCTL_DISK_HISTOGRAM_RESET: int +IOCTL_DISK_REQUEST_STRUCTURE: int +IOCTL_DISK_REQUEST_DATA: int +IOCTL_DISK_PERFORMANCE_OFF: int +IOCTL_DISK_CONTROLLER_NUMBER: int +SMART_GET_VERSION: int +SMART_SEND_DRIVE_COMMAND: int +SMART_RCV_DRIVE_DATA: int +IOCTL_DISK_GET_PARTITION_INFO_EX: int +IOCTL_DISK_SET_PARTITION_INFO_EX: int +IOCTL_DISK_GET_DRIVE_LAYOUT_EX: int +IOCTL_DISK_SET_DRIVE_LAYOUT_EX: int +IOCTL_DISK_CREATE_DISK: int +IOCTL_DISK_GET_LENGTH_INFO: int +IOCTL_DISK_GET_DRIVE_GEOMETRY_EX: int +IOCTL_DISK_REASSIGN_BLOCKS_EX: int +IOCTL_DISK_UPDATE_DRIVE_SIZE: int +IOCTL_DISK_GROW_PARTITION: int +IOCTL_DISK_GET_CACHE_INFORMATION: int +IOCTL_DISK_SET_CACHE_INFORMATION: int +OBSOLETE_IOCTL_STORAGE_RESET_BUS: int +OBSOLETE_IOCTL_STORAGE_RESET_DEVICE: int +OBSOLETE_DISK_GET_WRITE_CACHE_STATE: int +IOCTL_DISK_GET_WRITE_CACHE_STATE: int +IOCTL_DISK_DELETE_DRIVE_LAYOUT: int +IOCTL_DISK_UPDATE_PROPERTIES: int +IOCTL_DISK_FORMAT_DRIVE: int +IOCTL_DISK_SENSE_DEVICE: int +IOCTL_DISK_CHECK_VERIFY: int +IOCTL_DISK_MEDIA_REMOVAL: int +IOCTL_DISK_EJECT_MEDIA: int +IOCTL_DISK_LOAD_MEDIA: int +IOCTL_DISK_RESERVE: int +IOCTL_DISK_RELEASE: int +IOCTL_DISK_FIND_NEW_DEVICES: int +IOCTL_DISK_GET_MEDIA_TYPES: int +DISK_HISTOGRAM_SIZE: int +HISTOGRAM_BUCKET_SIZE: int +IOCTL_CHANGER_GET_PARAMETERS: int +IOCTL_CHANGER_GET_STATUS: int +IOCTL_CHANGER_GET_PRODUCT_DATA: int +IOCTL_CHANGER_SET_ACCESS: int +IOCTL_CHANGER_GET_ELEMENT_STATUS: int +IOCTL_CHANGER_INITIALIZE_ELEMENT_STATUS: int +IOCTL_CHANGER_SET_POSITION: int +IOCTL_CHANGER_EXCHANGE_MEDIUM: int +IOCTL_CHANGER_MOVE_MEDIUM: int +IOCTL_CHANGER_REINITIALIZE_TRANSPORT: int +IOCTL_CHANGER_QUERY_VOLUME_TAGS: int +IOCTL_SERIAL_LSRMST_INSERT: int +IOCTL_SERENUM_EXPOSE_HARDWARE: int +IOCTL_SERENUM_REMOVE_HARDWARE: int +IOCTL_SERENUM_PORT_DESC: int +IOCTL_SERENUM_GET_PORT_NAME: int +SERIAL_LSRMST_ESCAPE: int +SERIAL_LSRMST_LSR_DATA: int +SERIAL_LSRMST_LSR_NODATA: int +SERIAL_LSRMST_MST: int +SERIAL_IOC_FCR_FIFO_ENABLE: int +SERIAL_IOC_FCR_RCVR_RESET: int +SERIAL_IOC_FCR_XMIT_RESET: int +SERIAL_IOC_FCR_DMA_MODE: int +SERIAL_IOC_FCR_RES1: int +SERIAL_IOC_FCR_RES2: int +SERIAL_IOC_FCR_RCVR_TRIGGER_LSB: int +SERIAL_IOC_FCR_RCVR_TRIGGER_MSB: int +SERIAL_IOC_MCR_DTR: int +SERIAL_IOC_MCR_RTS: int +SERIAL_IOC_MCR_OUT1: int +SERIAL_IOC_MCR_OUT2: int +SERIAL_IOC_MCR_LOOP: int +FSCTL_REQUEST_OPLOCK_LEVEL_1: int +FSCTL_REQUEST_OPLOCK_LEVEL_2: int +FSCTL_REQUEST_BATCH_OPLOCK: int +FSCTL_OPLOCK_BREAK_ACKNOWLEDGE: int +FSCTL_OPBATCH_ACK_CLOSE_PENDING: int +FSCTL_OPLOCK_BREAK_NOTIFY: int +FSCTL_LOCK_VOLUME: int +FSCTL_UNLOCK_VOLUME: int +FSCTL_DISMOUNT_VOLUME: int +FSCTL_IS_VOLUME_MOUNTED: int +FSCTL_IS_PATHNAME_VALID: int +FSCTL_MARK_VOLUME_DIRTY: int +FSCTL_QUERY_RETRIEVAL_POINTERS: int +FSCTL_GET_COMPRESSION: int +FSCTL_SET_COMPRESSION: int +FSCTL_MARK_AS_SYSTEM_HIVE: int +FSCTL_OPLOCK_BREAK_ACK_NO_2: int +FSCTL_INVALIDATE_VOLUMES: int +FSCTL_QUERY_FAT_BPB: int +FSCTL_REQUEST_FILTER_OPLOCK: int +FSCTL_FILESYSTEM_GET_STATISTICS: int +FSCTL_GET_NTFS_VOLUME_DATA: int +FSCTL_GET_NTFS_FILE_RECORD: int +FSCTL_GET_VOLUME_BITMAP: int +FSCTL_GET_RETRIEVAL_POINTERS: int +FSCTL_MOVE_FILE: int +FSCTL_IS_VOLUME_DIRTY: int +FSCTL_ALLOW_EXTENDED_DASD_IO: int +FSCTL_FIND_FILES_BY_SID: int +FSCTL_SET_OBJECT_ID: int +FSCTL_GET_OBJECT_ID: int +FSCTL_DELETE_OBJECT_ID: int +FSCTL_SET_REPARSE_POINT: int +FSCTL_GET_REPARSE_POINT: int +FSCTL_DELETE_REPARSE_POINT: int +FSCTL_ENUM_USN_DATA: int +FSCTL_SECURITY_ID_CHECK: int +FSCTL_READ_USN_JOURNAL: int +FSCTL_SET_OBJECT_ID_EXTENDED: int +FSCTL_CREATE_OR_GET_OBJECT_ID: int +FSCTL_SET_SPARSE: int +FSCTL_SET_ZERO_DATA: int +FSCTL_QUERY_ALLOCATED_RANGES: int +FSCTL_SET_ENCRYPTION: int +FSCTL_ENCRYPTION_FSCTL_IO: int +FSCTL_WRITE_RAW_ENCRYPTED: int +FSCTL_READ_RAW_ENCRYPTED: int +FSCTL_CREATE_USN_JOURNAL: int +FSCTL_READ_FILE_USN_DATA: int +FSCTL_WRITE_USN_CLOSE_RECORD: int +FSCTL_EXTEND_VOLUME: int +FSCTL_QUERY_USN_JOURNAL: int +FSCTL_DELETE_USN_JOURNAL: int +FSCTL_MARK_HANDLE: int +FSCTL_SIS_COPYFILE: int +FSCTL_SIS_LINK_FILES: int +FSCTL_HSM_MSG: int +FSCTL_HSM_DATA: int +FSCTL_RECALL_FILE: int +FSCTL_READ_FROM_PLEX: int +FSCTL_FILE_PREFETCH: int +FSCTL_MAKE_MEDIA_COMPATIBLE: int +FSCTL_SET_DEFECT_MANAGEMENT: int +FSCTL_QUERY_SPARING_INFO: int +FSCTL_QUERY_ON_DISK_VOLUME_INFO: int +FSCTL_SET_VOLUME_COMPRESSION_STATE: int +FSCTL_TXFS_MODIFY_RM: int +FSCTL_TXFS_QUERY_RM_INFORMATION: int +FSCTL_TXFS_ROLLFORWARD_REDO: int +FSCTL_TXFS_ROLLFORWARD_UNDO: int +FSCTL_TXFS_START_RM: int +FSCTL_TXFS_SHUTDOWN_RM: int +FSCTL_TXFS_READ_BACKUP_INFORMATION: int +FSCTL_TXFS_WRITE_BACKUP_INFORMATION: int +FSCTL_TXFS_CREATE_SECONDARY_RM: int +FSCTL_TXFS_GET_METADATA_INFO: int +FSCTL_TXFS_GET_TRANSACTED_VERSION: int +FSCTL_TXFS_CREATE_MINIVERSION: int +FSCTL_TXFS_TRANSACTION_ACTIVE: int +FSCTL_SET_ZERO_ON_DEALLOCATION: int +FSCTL_SET_REPAIR: int +FSCTL_GET_REPAIR: int +FSCTL_WAIT_FOR_REPAIR: int +FSCTL_INITIATE_REPAIR: int +FSCTL_CSC_INTERNAL: int +FSCTL_SHRINK_VOLUME: int +FSCTL_SET_SHORT_NAME_BEHAVIOR: int +FSCTL_DFSR_SET_GHOST_HANDLE_STATE: int +FSCTL_QUERY_PAGEFILE_ENCRYPTION: int +IOCTL_VOLUME_BASE: int +IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS: int +IOCTL_VOLUME_ONLINE: int +IOCTL_VOLUME_OFFLINE: int +IOCTL_VOLUME_IS_CLUSTERED: int +IOCTL_VOLUME_GET_GPT_ATTRIBUTES: int +DDS_4mm: int +MiniQic: int +Travan: int +QIC: int +MP_8mm: int +AME_8mm: int +AIT1_8mm: int +DLT: int +NCTP: int +IBM_3480: int +IBM_3490E: int +IBM_Magstar_3590: int +IBM_Magstar_MP: int +STK_DATA_D3: int +SONY_DTF: int +DV_6mm: int +DMI: int +SONY_D2: int +CLEANER_CARTRIDGE: int +CD_ROM: int +CD_R: int +CD_RW: int +DVD_ROM: int +DVD_R: int +DVD_RW: int +MO_3_RW: int +MO_5_WO: int +MO_5_RW: int +MO_5_LIMDOW: int +PC_5_WO: int +PC_5_RW: int +PD_5_RW: int +ABL_5_WO: int +PINNACLE_APEX_5_RW: int +SONY_12_WO: int +PHILIPS_12_WO: int +HITACHI_12_WO: int +CYGNET_12_WO: int +KODAK_14_WO: int +MO_NFR_525: int +NIKON_12_RW: int +IOMEGA_ZIP: int +IOMEGA_JAZ: int +SYQUEST_EZ135: int +SYQUEST_EZFLYER: int +SYQUEST_SYJET: int +AVATAR_F2: int +MP2_8mm: int +DST_S: int +DST_M: int +DST_L: int +VXATape_1: int +VXATape_2: int +STK_9840: int +LTO_Ultrium: int +LTO_Accelis: int +DVD_RAM: int +AIT_8mm: int +ADR_1: int +ADR_2: int +STK_9940: int +BusTypeUnknown: int +BusTypeScsi: int +BusTypeAtapi: int +BusTypeAta: int +BusType1394: int +BusTypeSsa: int +BusTypeFibre: int +BusTypeUsb: int +BusTypeRAID: int +BusTypeiScsi: int +BusTypeSas: int +BusTypeSata: int +BusTypeMaxReserved: int +Unknown: int +F5_1Pt2_512: int +F3_1Pt44_512: int +F3_2Pt88_512: int +F3_20Pt8_512: int +F3_720_512: int +F5_360_512: int +F5_320_512: int +F5_320_1024: int +F5_180_512: int +F5_160_512: int +RemovableMedia: int +FixedMedia: int +F3_120M_512: int +F3_640_512: int +F5_640_512: int +F5_720_512: int +F3_1Pt2_512: int +F3_1Pt23_1024: int +F5_1Pt23_1024: int +F3_128Mb_512: int +F3_230Mb_512: int +F8_256_128: int +F3_200Mb_512: int +F3_240M_512: int +F3_32M_512: int +PARTITION_STYLE_MBR: int +PARTITION_STYLE_GPT: int +PARTITION_STYLE_RAW: int +DetectNone: int +DetectInt13: int +DetectExInt13: int +EqualPriority: int +KeepPrefetchedData: int +KeepReadData: int +DiskWriteCacheNormal: int +DiskWriteCacheForceDisable: int +DiskWriteCacheDisableNotSupported: int +RequestSize: int +RequestLocation: int +DeviceProblemNone: int +DeviceProblemHardware: int +DeviceProblemCHMError: int +DeviceProblemDoorOpen: int +DeviceProblemCalibrationError: int +DeviceProblemTargetFailure: int +DeviceProblemCHMMoveError: int +DeviceProblemCHMZeroError: int +DeviceProblemCartridgeInsertError: int +DeviceProblemPositionError: int +DeviceProblemSensorError: int +DeviceProblemCartridgeEjectError: int +DeviceProblemGripperError: int +DeviceProblemDriveError: int +FILE_READ_DATA: int +FILE_WRITE_DATA: int +FSCTL_TXFS_LIST_TRANSACTIONS: int +FSCTL_TXFS_LIST_TRANSACTION_LOCKED_FILES: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/winnt.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/winnt.pyi new file mode 100644 index 000000000..9c49122df --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/winnt.pyi @@ -0,0 +1,1137 @@ +from _typeshed import Incomplete + +APPLICATION_ERROR_MASK: int +ERROR_SEVERITY_SUCCESS: int +ERROR_SEVERITY_INFORMATIONAL: int +ERROR_SEVERITY_WARNING: int +ERROR_SEVERITY_ERROR: int +MINCHAR: int +MAXCHAR: int +MINSHORT: int +MAXSHORT: int +MINLONG: int +MAXLONG: int +MAXBYTE: int +MAXWORD: int +MAXDWORD: int +LANG_NEUTRAL: int +LANG_AFRIKAANS: int +LANG_ALBANIAN: int +LANG_ARABIC: int +LANG_BASQUE: int +LANG_BELARUSIAN: int +LANG_BULGARIAN: int +LANG_CATALAN: int +LANG_CHINESE: int +LANG_CROATIAN: int +LANG_CZECH: int +LANG_DANISH: int +LANG_DUTCH: int +LANG_ENGLISH: int +LANG_ESTONIAN: int +LANG_FAEROESE: int +LANG_FARSI: int +LANG_FINNISH: int +LANG_FRENCH: int +LANG_GERMAN: int +LANG_GREEK: int +LANG_HEBREW: int +LANG_HINDI: int +LANG_HUNGARIAN: int +LANG_ICELANDIC: int +LANG_INDONESIAN: int +LANG_ITALIAN: int +LANG_JAPANESE: int +LANG_KOREAN: int +LANG_LATVIAN: int +LANG_LITHUANIAN: int +LANG_MACEDONIAN: int +LANG_MALAY: int +LANG_NORWEGIAN: int +LANG_POLISH: int +LANG_PORTUGUESE: int +LANG_ROMANIAN: int +LANG_RUSSIAN: int +LANG_SERBIAN: int +LANG_SLOVAK: int +LANG_SLOVENIAN: int +LANG_SPANISH: int +LANG_SWAHILI: int +LANG_SWEDISH: int +LANG_THAI: int +LANG_TURKISH: int +LANG_UKRAINIAN: int +LANG_VIETNAMESE: int +SUBLANG_NEUTRAL: int +SUBLANG_DEFAULT: int +SUBLANG_SYS_DEFAULT: int +SUBLANG_ARABIC_SAUDI_ARABIA: int +SUBLANG_ARABIC_IRAQ: int +SUBLANG_ARABIC_EGYPT: int +SUBLANG_ARABIC_LIBYA: int +SUBLANG_ARABIC_ALGERIA: int +SUBLANG_ARABIC_MOROCCO: int +SUBLANG_ARABIC_TUNISIA: int +SUBLANG_ARABIC_OMAN: int +SUBLANG_ARABIC_YEMEN: int +SUBLANG_ARABIC_SYRIA: int +SUBLANG_ARABIC_JORDAN: int +SUBLANG_ARABIC_LEBANON: int +SUBLANG_ARABIC_KUWAIT: int +SUBLANG_ARABIC_UAE: int +SUBLANG_ARABIC_BAHRAIN: int +SUBLANG_ARABIC_QATAR: int +SUBLANG_CHINESE_TRADITIONAL: int +SUBLANG_CHINESE_SIMPLIFIED: int +SUBLANG_CHINESE_HONGKONG: int +SUBLANG_CHINESE_SINGAPORE: int +SUBLANG_CHINESE_MACAU: int +SUBLANG_DUTCH: int +SUBLANG_DUTCH_BELGIAN: int +SUBLANG_ENGLISH_US: int +SUBLANG_ENGLISH_UK: int +SUBLANG_ENGLISH_AUS: int +SUBLANG_ENGLISH_CAN: int +SUBLANG_ENGLISH_NZ: int +SUBLANG_ENGLISH_EIRE: int +SUBLANG_ENGLISH_SOUTH_AFRICA: int +SUBLANG_ENGLISH_JAMAICA: int +SUBLANG_ENGLISH_CARIBBEAN: int +SUBLANG_ENGLISH_BELIZE: int +SUBLANG_ENGLISH_TRINIDAD: int +SUBLANG_ENGLISH_ZIMBABWE: int +SUBLANG_ENGLISH_PHILIPPINES: int +SUBLANG_FRENCH: int +SUBLANG_FRENCH_BELGIAN: int +SUBLANG_FRENCH_CANADIAN: int +SUBLANG_FRENCH_SWISS: int +SUBLANG_FRENCH_LUXEMBOURG: int +SUBLANG_FRENCH_MONACO: int +SUBLANG_GERMAN: int +SUBLANG_GERMAN_SWISS: int +SUBLANG_GERMAN_AUSTRIAN: int +SUBLANG_GERMAN_LUXEMBOURG: int +SUBLANG_GERMAN_LIECHTENSTEIN: int +SUBLANG_ITALIAN: int +SUBLANG_ITALIAN_SWISS: int +SUBLANG_KOREAN: int +SUBLANG_KOREAN_JOHAB: int +SUBLANG_LITHUANIAN: int +SUBLANG_LITHUANIAN_CLASSIC: int +SUBLANG_MALAY_MALAYSIA: int +SUBLANG_MALAY_BRUNEI_DARUSSALAM: int +SUBLANG_NORWEGIAN_BOKMAL: int +SUBLANG_NORWEGIAN_NYNORSK: int +SUBLANG_PORTUGUESE: int +SUBLANG_PORTUGUESE_BRAZILIAN: int +SUBLANG_SERBIAN_LATIN: int +SUBLANG_SERBIAN_CYRILLIC: int +SUBLANG_SPANISH: int +SUBLANG_SPANISH_MEXICAN: int +SUBLANG_SPANISH_MODERN: int +SUBLANG_SPANISH_GUATEMALA: int +SUBLANG_SPANISH_COSTA_RICA: int +SUBLANG_SPANISH_PANAMA: int +SUBLANG_SPANISH_DOMINICAN_REPUBLIC: int +SUBLANG_SPANISH_VENEZUELA: int +SUBLANG_SPANISH_COLOMBIA: int +SUBLANG_SPANISH_PERU: int +SUBLANG_SPANISH_ARGENTINA: int +SUBLANG_SPANISH_ECUADOR: int +SUBLANG_SPANISH_CHILE: int +SUBLANG_SPANISH_URUGUAY: int +SUBLANG_SPANISH_PARAGUAY: int +SUBLANG_SPANISH_BOLIVIA: int +SUBLANG_SPANISH_EL_SALVADOR: int +SUBLANG_SPANISH_HONDURAS: int +SUBLANG_SPANISH_NICARAGUA: int +SUBLANG_SPANISH_PUERTO_RICO: int +SUBLANG_SWEDISH: int +SUBLANG_SWEDISH_FINLAND: int +SORT_DEFAULT: int +SORT_JAPANESE_XJIS: int +SORT_JAPANESE_UNICODE: int +SORT_CHINESE_BIG5: int +SORT_CHINESE_PRCP: int +SORT_CHINESE_UNICODE: int +SORT_CHINESE_PRC: int +SORT_KOREAN_KSC: int +SORT_KOREAN_UNICODE: int +SORT_GERMAN_PHONE_BOOK: int + +def PRIMARYLANGID(lgid): ... +def SUBLANGID(lgid): ... + +NLS_VALID_LOCALE_MASK: int + +def LANGIDFROMLCID(lcid): ... +def SORTIDFROMLCID(lcid): ... +def UNREFERENCED_PARAMETER(P): ... +def DBG_UNREFERENCED_PARAMETER(P): ... +def DBG_UNREFERENCED_LOCAL_VARIABLE(V): ... + +MAXIMUM_WAIT_OBJECTS: int +MAXIMUM_SUSPEND_COUNT: int +EXCEPTION_NONCONTINUABLE: int +EXCEPTION_MAXIMUM_PARAMETERS: int +PROCESS_TERMINATE: int +PROCESS_CREATE_THREAD: int +PROCESS_VM_OPERATION: int +PROCESS_VM_READ: int +PROCESS_VM_WRITE: int +PROCESS_DUP_HANDLE: int +PROCESS_CREATE_PROCESS: int +PROCESS_SET_QUOTA: int +PROCESS_SET_INFORMATION: int +PROCESS_QUERY_INFORMATION: int +PROCESS_SUSPEND_RESUME: int +PROCESS_QUERY_LIMITED_INFORMATION: int +PROCESS_SET_LIMITED_INFORMATION: int +MAXIMUM_PROCESSORS: int +THREAD_TERMINATE: int +THREAD_SUSPEND_RESUME: int +THREAD_GET_CONTEXT: int +THREAD_SET_CONTEXT: int +THREAD_SET_INFORMATION: int +THREAD_QUERY_INFORMATION: int +THREAD_SET_THREAD_TOKEN: int +THREAD_IMPERSONATE: int +THREAD_DIRECT_IMPERSONATION: int +THREAD_SET_LIMITED_INFORMATION: int +THREAD_QUERY_LIMITED_INFORMATION: int +THREAD_RESUME: int +JOB_OBJECT_ASSIGN_PROCESS: int +JOB_OBJECT_SET_ATTRIBUTES: int +JOB_OBJECT_QUERY: int +JOB_OBJECT_TERMINATE: int +TLS_MINIMUM_AVAILABLE: int +THREAD_BASE_PRIORITY_LOWRT: int +THREAD_BASE_PRIORITY_MAX: int +THREAD_BASE_PRIORITY_MIN: int +THREAD_BASE_PRIORITY_IDLE: int +JOB_OBJECT_LIMIT_WORKINGSET: int +JOB_OBJECT_LIMIT_PROCESS_TIME: int +JOB_OBJECT_LIMIT_JOB_TIME: int +JOB_OBJECT_LIMIT_ACTIVE_PROCESS: int +JOB_OBJECT_LIMIT_AFFINITY: int +JOB_OBJECT_LIMIT_PRIORITY_CLASS: int +JOB_OBJECT_LIMIT_VALID_FLAGS: int +EVENT_MODIFY_STATE: int +MUTANT_QUERY_STATE: int +SEMAPHORE_MODIFY_STATE: int +TIME_ZONE_ID_UNKNOWN: int +TIME_ZONE_ID_STANDARD: int +TIME_ZONE_ID_DAYLIGHT: int +PROCESSOR_INTEL_386: int +PROCESSOR_INTEL_486: int +PROCESSOR_INTEL_PENTIUM: int +PROCESSOR_MIPS_R4000: int +PROCESSOR_ALPHA_21064: int +PROCESSOR_HITACHI_SH3: int +PROCESSOR_HITACHI_SH3E: int +PROCESSOR_HITACHI_SH4: int +PROCESSOR_MOTOROLA_821: int +PROCESSOR_ARM_7TDMI: int +PROCESSOR_ARCHITECTURE_INTEL: int +PROCESSOR_ARCHITECTURE_MIPS: int +PROCESSOR_ARCHITECTURE_ALPHA: int +PROCESSOR_ARCHITECTURE_PPC: int +PROCESSOR_ARCHITECTURE_SH: int +PROCESSOR_ARCHITECTURE_ARM: int +PROCESSOR_ARCHITECTURE_IA64: int +PROCESSOR_ARCHITECTURE_ALPHA64: int +PROCESSOR_ARCHITECTURE_MSIL: int +PROCESSOR_ARCHITECTURE_AMD64: int +PROCESSOR_ARCHITECTURE_IA32_ON_WIN64: int +PROCESSOR_ARCHITECTURE_UNKNOWN: int +PF_FLOATING_POINT_PRECISION_ERRATA: int +PF_FLOATING_POINT_EMULATED: int +PF_COMPARE_EXCHANGE_DOUBLE: int +PF_MMX_INSTRUCTIONS_AVAILABLE: int +PF_PPC_MOVEMEM_64BIT_OK: int +PF_ALPHA_BYTE_INSTRUCTIONS: int +SECTION_QUERY: int +SECTION_MAP_WRITE: int +SECTION_MAP_READ: int +SECTION_MAP_EXECUTE: int +SECTION_EXTEND_SIZE: int +PAGE_NOACCESS: int +PAGE_READONLY: int +PAGE_READWRITE: int +PAGE_WRITECOPY: int +PAGE_EXECUTE: int +PAGE_EXECUTE_READ: int +PAGE_EXECUTE_READWRITE: int +PAGE_EXECUTE_WRITECOPY: int +PAGE_GUARD: int +PAGE_NOCACHE: int +MEM_COMMIT: int +MEM_RESERVE: int +MEM_DECOMMIT: int +MEM_RELEASE: int +MEM_FREE: int +MEM_PRIVATE: int +MEM_MAPPED: int +MEM_RESET: int +MEM_TOP_DOWN: int +MEM_4MB_PAGES: int +SEC_FILE: int +SEC_IMAGE: int +SEC_VLM: int +SEC_RESERVE: int +SEC_COMMIT: int +SEC_NOCACHE: int +MEM_IMAGE: int +FILE_READ_DATA: int +FILE_LIST_DIRECTORY: int +FILE_WRITE_DATA: int +FILE_ADD_FILE: int +FILE_APPEND_DATA: int +FILE_ADD_SUBDIRECTORY: int +FILE_CREATE_PIPE_INSTANCE: int +FILE_READ_EA: int +FILE_WRITE_EA: int +FILE_EXECUTE: int +FILE_TRAVERSE: int +FILE_DELETE_CHILD: int +FILE_READ_ATTRIBUTES: int +FILE_WRITE_ATTRIBUTES: int +FILE_SHARE_READ: int +FILE_SHARE_WRITE: int +FILE_SHARE_DELETE: int +FILE_ATTRIBUTE_READONLY: int +FILE_ATTRIBUTE_HIDDEN: int +FILE_ATTRIBUTE_SYSTEM: int +FILE_ATTRIBUTE_DIRECTORY: int +FILE_ATTRIBUTE_ARCHIVE: int +FILE_ATTRIBUTE_DEVICE: int +FILE_ATTRIBUTE_NORMAL: int +FILE_ATTRIBUTE_TEMPORARY: int +FILE_ATTRIBUTE_SPARSE_FILE: int +FILE_ATTRIBUTE_REPARSE_POINT: int +FILE_ATTRIBUTE_COMPRESSED: int +FILE_ATTRIBUTE_OFFLINE: int +FILE_ATTRIBUTE_NOT_CONTENT_INDEXED: int +FILE_ATTRIBUTE_ENCRYPTED: int +FILE_ATTRIBUTE_VIRTUAL: int +FILE_NOTIFY_CHANGE_FILE_NAME: int +FILE_NOTIFY_CHANGE_DIR_NAME: int +FILE_NOTIFY_CHANGE_ATTRIBUTES: int +FILE_NOTIFY_CHANGE_SIZE: int +FILE_NOTIFY_CHANGE_LAST_WRITE: int +FILE_NOTIFY_CHANGE_LAST_ACCESS: int +FILE_NOTIFY_CHANGE_CREATION: int +FILE_NOTIFY_CHANGE_SECURITY: int +FILE_ACTION_ADDED: int +FILE_ACTION_REMOVED: int +FILE_ACTION_MODIFIED: int +FILE_ACTION_RENAMED_OLD_NAME: int +FILE_ACTION_RENAMED_NEW_NAME: int +FILE_CASE_SENSITIVE_SEARCH: int +FILE_CASE_PRESERVED_NAMES: int +FILE_UNICODE_ON_DISK: int +FILE_PERSISTENT_ACLS: int +FILE_FILE_COMPRESSION: int +FILE_VOLUME_QUOTAS: int +FILE_SUPPORTS_SPARSE_FILES: int +FILE_SUPPORTS_REPARSE_POINTS: int +FILE_SUPPORTS_REMOTE_STORAGE: int +FILE_VOLUME_IS_COMPRESSED: int +FILE_SUPPORTS_OBJECT_IDS: int +FILE_SUPPORTS_ENCRYPTION: int +MAXIMUM_REPARSE_DATA_BUFFER_SIZE: Incomplete +IO_REPARSE_TAG_RESERVED_ZERO: int +IO_REPARSE_TAG_RESERVED_ONE: int +IO_REPARSE_TAG_SYMBOLIC_LINK: int +IO_REPARSE_TAG_NSS: int +IO_REPARSE_TAG_FILTER_MANAGER: int +IO_REPARSE_TAG_DFS: int +IO_REPARSE_TAG_SIS: int +IO_REPARSE_TAG_MOUNT_POINT: int +IO_REPARSE_TAG_HSM: int +IO_REPARSE_TAG_NSSRECOVER: int +IO_REPARSE_TAG_RESERVED_MS_RANGE: int +IO_REPARSE_TAG_RESERVED_RANGE: int +IO_COMPLETION_MODIFY_STATE: int +DUPLICATE_CLOSE_SOURCE: int +DUPLICATE_SAME_ACCESS: int +DELETE: int +READ_CONTROL: int +WRITE_DAC: int +WRITE_OWNER: int +SYNCHRONIZE: int +STANDARD_RIGHTS_REQUIRED: int +STANDARD_RIGHTS_READ: int +STANDARD_RIGHTS_WRITE: int +STANDARD_RIGHTS_EXECUTE: int +STANDARD_RIGHTS_ALL: int +SPECIFIC_RIGHTS_ALL: int +IO_COMPLETION_ALL_ACCESS: Incomplete +ACCESS_SYSTEM_SECURITY: int +MAXIMUM_ALLOWED: int +GENERIC_READ: int +GENERIC_WRITE: int +GENERIC_EXECUTE: int +GENERIC_ALL: int +SID_REVISION: int +SID_MAX_SUB_AUTHORITIES: int +SID_RECOMMENDED_SUB_AUTHORITIES: int +SidTypeUser: int +SidTypeGroup: int +SidTypeDomain: int +SidTypeAlias: int +SidTypeWellKnownGroup: int +SidTypeDeletedAccount: int +SidTypeInvalid: int +SidTypeUnknown: int +SECURITY_NULL_RID: int +SECURITY_WORLD_RID: int +SECURITY_LOCAL_RID: int +SECURITY_CREATOR_OWNER_RID: int +SECURITY_CREATOR_GROUP_RID: int +SECURITY_CREATOR_OWNER_SERVER_RID: int +SECURITY_CREATOR_GROUP_SERVER_RID: int +SECURITY_DIALUP_RID: int +SECURITY_NETWORK_RID: int +SECURITY_BATCH_RID: int +SECURITY_INTERACTIVE_RID: int +SECURITY_SERVICE_RID: int +SECURITY_ANONYMOUS_LOGON_RID: int +SECURITY_PROXY_RID: int +SECURITY_SERVER_LOGON_RID: int +SECURITY_PRINCIPAL_SELF_RID: int +SECURITY_AUTHENTICATED_USER_RID: int +SECURITY_LOGON_IDS_RID: int +SECURITY_LOGON_IDS_RID_COUNT: int +SECURITY_LOCAL_SYSTEM_RID: int +SECURITY_NT_NON_UNIQUE: int +SECURITY_BUILTIN_DOMAIN_RID: int +DOMAIN_USER_RID_ADMIN: int +DOMAIN_USER_RID_GUEST: int +DOMAIN_GROUP_RID_ADMINS: int +DOMAIN_GROUP_RID_USERS: int +DOMAIN_GROUP_RID_GUESTS: int +DOMAIN_ALIAS_RID_ADMINS: int +DOMAIN_ALIAS_RID_USERS: int +DOMAIN_ALIAS_RID_GUESTS: int +DOMAIN_ALIAS_RID_POWER_USERS: int +DOMAIN_ALIAS_RID_ACCOUNT_OPS: int +DOMAIN_ALIAS_RID_SYSTEM_OPS: int +DOMAIN_ALIAS_RID_PRINT_OPS: int +DOMAIN_ALIAS_RID_BACKUP_OPS: int +DOMAIN_ALIAS_RID_REPLICATOR: int +SE_GROUP_MANDATORY: int +SE_GROUP_ENABLED_BY_DEFAULT: int +SE_GROUP_ENABLED: int +SE_GROUP_OWNER: int +SE_GROUP_LOGON_ID: int +ACL_REVISION: int +ACL_REVISION_DS: int +ACL_REVISION1: int +ACL_REVISION2: int +ACL_REVISION3: int +ACL_REVISION4: int +MAX_ACL_REVISION: int +ACCESS_MIN_MS_ACE_TYPE: int +ACCESS_ALLOWED_ACE_TYPE: int +ACCESS_DENIED_ACE_TYPE: int +SYSTEM_AUDIT_ACE_TYPE: int +SYSTEM_ALARM_ACE_TYPE: int +ACCESS_MAX_MS_V2_ACE_TYPE: int +ACCESS_ALLOWED_COMPOUND_ACE_TYPE: int +ACCESS_MAX_MS_V3_ACE_TYPE: int +ACCESS_MIN_MS_OBJECT_ACE_TYPE: int +ACCESS_ALLOWED_OBJECT_ACE_TYPE: int +ACCESS_DENIED_OBJECT_ACE_TYPE: int +SYSTEM_AUDIT_OBJECT_ACE_TYPE: int +SYSTEM_ALARM_OBJECT_ACE_TYPE: int +ACCESS_MAX_MS_OBJECT_ACE_TYPE: int +ACCESS_MAX_MS_V4_ACE_TYPE: int +ACCESS_MAX_MS_ACE_TYPE: int +ACCESS_ALLOWED_CALLBACK_ACE_TYPE: int +ACCESS_DENIED_CALLBACK_ACE_TYPE: int +ACCESS_ALLOWED_CALLBACK_OBJECT_ACE_TYPE: int +ACCESS_DENIED_CALLBACK_OBJECT_ACE_TYPE: int +SYSTEM_AUDIT_CALLBACK_ACE_TYPE: int +SYSTEM_ALARM_CALLBACK_ACE_TYPE: int +SYSTEM_AUDIT_CALLBACK_OBJECT_ACE_TYPE: int +SYSTEM_ALARM_CALLBACK_OBJECT_ACE_TYPE: int +SYSTEM_MANDATORY_LABEL_ACE_TYPE: int +ACCESS_MAX_MS_V5_ACE_TYPE: int +OBJECT_INHERIT_ACE: int +CONTAINER_INHERIT_ACE: int +NO_PROPAGATE_INHERIT_ACE: int +INHERIT_ONLY_ACE: int +INHERITED_ACE: int +VALID_INHERIT_FLAGS: int +SUCCESSFUL_ACCESS_ACE_FLAG: int +FAILED_ACCESS_ACE_FLAG: int +ACE_OBJECT_TYPE_PRESENT: int +ACE_INHERITED_OBJECT_TYPE_PRESENT: int +SECURITY_DESCRIPTOR_REVISION: int +SECURITY_DESCRIPTOR_REVISION1: int +SECURITY_DESCRIPTOR_MIN_LENGTH: int +SE_OWNER_DEFAULTED: int +SE_GROUP_DEFAULTED: int +SE_DACL_PRESENT: int +SE_DACL_DEFAULTED: int +SE_SACL_PRESENT: int +SE_SACL_DEFAULTED: int +SE_DACL_AUTO_INHERIT_REQ: int +SE_SACL_AUTO_INHERIT_REQ: int +SE_DACL_AUTO_INHERITED: int +SE_SACL_AUTO_INHERITED: int +SE_DACL_PROTECTED: int +SE_SACL_PROTECTED: int +SE_SELF_RELATIVE: int +ACCESS_OBJECT_GUID: int +ACCESS_PROPERTY_SET_GUID: int +ACCESS_PROPERTY_GUID: int +ACCESS_MAX_LEVEL: int +AUDIT_ALLOW_NO_PRIVILEGE: int +ACCESS_DS_SOURCE_A: str +ACCESS_DS_OBJECT_TYPE_NAME_A: str +SE_PRIVILEGE_ENABLED_BY_DEFAULT: int +SE_PRIVILEGE_ENABLED: int +SE_PRIVILEGE_USED_FOR_ACCESS: int +PRIVILEGE_SET_ALL_NECESSARY: int +SE_CREATE_TOKEN_NAME: str +SE_ASSIGNPRIMARYTOKEN_NAME: str +SE_LOCK_MEMORY_NAME: str +SE_INCREASE_QUOTA_NAME: str +SE_UNSOLICITED_INPUT_NAME: str +SE_MACHINE_ACCOUNT_NAME: str +SE_TCB_NAME: str +SE_SECURITY_NAME: str +SE_TAKE_OWNERSHIP_NAME: str +SE_LOAD_DRIVER_NAME: str +SE_SYSTEM_PROFILE_NAME: str +SE_SYSTEMTIME_NAME: str +SE_PROF_SINGLE_PROCESS_NAME: str +SE_INC_BASE_PRIORITY_NAME: str +SE_CREATE_PAGEFILE_NAME: str +SE_CREATE_PERMANENT_NAME: str +SE_BACKUP_NAME: str +SE_RESTORE_NAME: str +SE_SHUTDOWN_NAME: str +SE_DEBUG_NAME: str +SE_AUDIT_NAME: str +SE_SYSTEM_ENVIRONMENT_NAME: str +SE_CHANGE_NOTIFY_NAME: str +SE_REMOTE_SHUTDOWN_NAME: str +TOKEN_ASSIGN_PRIMARY: int +TOKEN_DUPLICATE: int +TOKEN_IMPERSONATE: int +TOKEN_QUERY: int +TOKEN_QUERY_SOURCE: int +TOKEN_ADJUST_PRIVILEGES: int +TOKEN_ADJUST_GROUPS: int +TOKEN_ADJUST_DEFAULT: int +TOKEN_ALL_ACCESS: Incomplete +TOKEN_READ: Incomplete +TOKEN_WRITE: Incomplete +TOKEN_EXECUTE: int +TOKEN_SOURCE_LENGTH: int +TokenPrimary: int +TokenImpersonation: int +TokenUser: int +TokenGroups: int +TokenPrivileges: int +TokenOwner: int +TokenPrimaryGroup: int +TokenDefaultDacl: int +TokenSource: int +TokenType: int +TokenImpersonationLevel: int +TokenStatistics: int +TokenRestrictedSids: int +TokenSessionId: int +TokenGroupsAndPrivileges: int +TokenSessionReference: int +TokenSandBoxInert: int +TokenAuditPolicy: int +TokenOrigin: int +TokenElevationType: int +TokenLinkedToken: int +TokenElevation: int +TokenHasRestrictions: int +TokenAccessInformation: int +TokenVirtualizationAllowed: int +TokenVirtualizationEnabled: int +TokenIntegrityLevel: int +TokenUIAccess: int +TokenMandatoryPolicy: int +TokenLogonSid: int +OWNER_SECURITY_INFORMATION: int +GROUP_SECURITY_INFORMATION: int +DACL_SECURITY_INFORMATION: int +SACL_SECURITY_INFORMATION: int +LABEL_SECURITY_INFORMATION: int +IMAGE_DOS_SIGNATURE: int +IMAGE_OS2_SIGNATURE: int +IMAGE_OS2_SIGNATURE_LE: int +IMAGE_VXD_SIGNATURE: int +IMAGE_NT_SIGNATURE: int +IMAGE_SIZEOF_FILE_HEADER: int +IMAGE_FILE_RELOCS_STRIPPED: int +IMAGE_FILE_EXECUTABLE_IMAGE: int +IMAGE_FILE_LINE_NUMS_STRIPPED: int +IMAGE_FILE_LOCAL_SYMS_STRIPPED: int +IMAGE_FILE_AGGRESIVE_WS_TRIM: int +IMAGE_FILE_LARGE_ADDRESS_AWARE: int +IMAGE_FILE_BYTES_REVERSED_LO: int +IMAGE_FILE_32BIT_MACHINE: int +IMAGE_FILE_DEBUG_STRIPPED: int +IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP: int +IMAGE_FILE_NET_RUN_FROM_SWAP: int +IMAGE_FILE_SYSTEM: int +IMAGE_FILE_DLL: int +IMAGE_FILE_UP_SYSTEM_ONLY: int +IMAGE_FILE_BYTES_REVERSED_HI: int +IMAGE_FILE_MACHINE_UNKNOWN: int +IMAGE_FILE_MACHINE_I386: int +IMAGE_FILE_MACHINE_R3000: int +IMAGE_FILE_MACHINE_R4000: int +IMAGE_FILE_MACHINE_R10000: int +IMAGE_FILE_MACHINE_WCEMIPSV2: int +IMAGE_FILE_MACHINE_ALPHA: int +IMAGE_FILE_MACHINE_POWERPC: int +IMAGE_FILE_MACHINE_SH3: int +IMAGE_FILE_MACHINE_SH3E: int +IMAGE_FILE_MACHINE_SH4: int +IMAGE_FILE_MACHINE_ARM: int +IMAGE_NUMBEROF_DIRECTORY_ENTRIES: int +IMAGE_SIZEOF_ROM_OPTIONAL_HEADER: int +IMAGE_SIZEOF_STD_OPTIONAL_HEADER: int +IMAGE_SIZEOF_NT_OPTIONAL_HEADER: int +IMAGE_NT_OPTIONAL_HDR_MAGIC: int +IMAGE_ROM_OPTIONAL_HDR_MAGIC: int +IMAGE_SUBSYSTEM_UNKNOWN: int +IMAGE_SUBSYSTEM_NATIVE: int +IMAGE_SUBSYSTEM_WINDOWS_GUI: int +IMAGE_SUBSYSTEM_WINDOWS_CUI: int +IMAGE_SUBSYSTEM_WINDOWS_CE_GUI: int +IMAGE_SUBSYSTEM_OS2_CUI: int +IMAGE_SUBSYSTEM_POSIX_CUI: int +IMAGE_SUBSYSTEM_RESERVED8: int +IMAGE_DLLCHARACTERISTICS_WDM_DRIVER: int +IMAGE_DIRECTORY_ENTRY_EXPORT: int +IMAGE_DIRECTORY_ENTRY_IMPORT: int +IMAGE_DIRECTORY_ENTRY_RESOURCE: int +IMAGE_DIRECTORY_ENTRY_EXCEPTION: int +IMAGE_DIRECTORY_ENTRY_SECURITY: int +IMAGE_DIRECTORY_ENTRY_BASERELOC: int +IMAGE_DIRECTORY_ENTRY_DEBUG: int +IMAGE_DIRECTORY_ENTRY_COPYRIGHT: int +IMAGE_DIRECTORY_ENTRY_GLOBALPTR: int +IMAGE_DIRECTORY_ENTRY_TLS: int +IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG: int +IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT: int +IMAGE_DIRECTORY_ENTRY_IAT: int +IMAGE_SIZEOF_SHORT_NAME: int +IMAGE_SIZEOF_SECTION_HEADER: int +IMAGE_SCN_TYPE_NO_PAD: int +IMAGE_SCN_CNT_CODE: int +IMAGE_SCN_CNT_INITIALIZED_DATA: int +IMAGE_SCN_CNT_UNINITIALIZED_DATA: int +IMAGE_SCN_LNK_OTHER: int +IMAGE_SCN_LNK_INFO: int +IMAGE_SCN_LNK_REMOVE: int +IMAGE_SCN_LNK_COMDAT: int +IMAGE_SCN_MEM_FARDATA: int +IMAGE_SCN_MEM_PURGEABLE: int +IMAGE_SCN_MEM_16BIT: int +IMAGE_SCN_MEM_LOCKED: int +IMAGE_SCN_MEM_PRELOAD: int +IMAGE_SCN_ALIGN_1BYTES: int +IMAGE_SCN_ALIGN_2BYTES: int +IMAGE_SCN_ALIGN_4BYTES: int +IMAGE_SCN_ALIGN_8BYTES: int +IMAGE_SCN_ALIGN_16BYTES: int +IMAGE_SCN_ALIGN_32BYTES: int +IMAGE_SCN_ALIGN_64BYTES: int +IMAGE_SCN_LNK_NRELOC_OVFL: int +IMAGE_SCN_MEM_DISCARDABLE: int +IMAGE_SCN_MEM_NOT_CACHED: int +IMAGE_SCN_MEM_NOT_PAGED: int +IMAGE_SCN_MEM_SHARED: int +IMAGE_SCN_MEM_EXECUTE: int +IMAGE_SCN_MEM_READ: int +IMAGE_SCN_MEM_WRITE: int +IMAGE_SCN_SCALE_INDEX: int +IMAGE_SIZEOF_SYMBOL: int +IMAGE_SYM_TYPE_NULL: int +IMAGE_SYM_TYPE_VOID: int +IMAGE_SYM_TYPE_CHAR: int +IMAGE_SYM_TYPE_SHORT: int +IMAGE_SYM_TYPE_INT: int +IMAGE_SYM_TYPE_LONG: int +IMAGE_SYM_TYPE_FLOAT: int +IMAGE_SYM_TYPE_DOUBLE: int +IMAGE_SYM_TYPE_STRUCT: int +IMAGE_SYM_TYPE_UNION: int +IMAGE_SYM_TYPE_ENUM: int +IMAGE_SYM_TYPE_MOE: int +IMAGE_SYM_TYPE_BYTE: int +IMAGE_SYM_TYPE_WORD: int +IMAGE_SYM_TYPE_UINT: int +IMAGE_SYM_TYPE_DWORD: int +IMAGE_SYM_TYPE_PCODE: int +IMAGE_SYM_DTYPE_NULL: int +IMAGE_SYM_DTYPE_POINTER: int +IMAGE_SYM_DTYPE_FUNCTION: int +IMAGE_SYM_DTYPE_ARRAY: int +IMAGE_SYM_CLASS_NULL: int +IMAGE_SYM_CLASS_AUTOMATIC: int +IMAGE_SYM_CLASS_EXTERNAL: int +IMAGE_SYM_CLASS_STATIC: int +IMAGE_SYM_CLASS_REGISTER: int +IMAGE_SYM_CLASS_EXTERNAL_DEF: int +IMAGE_SYM_CLASS_LABEL: int +IMAGE_SYM_CLASS_UNDEFINED_LABEL: int +IMAGE_SYM_CLASS_MEMBER_OF_STRUCT: int +IMAGE_SYM_CLASS_ARGUMENT: int +IMAGE_SYM_CLASS_STRUCT_TAG: int +IMAGE_SYM_CLASS_MEMBER_OF_UNION: int +IMAGE_SYM_CLASS_UNION_TAG: int +IMAGE_SYM_CLASS_TYPE_DEFINITION: int +IMAGE_SYM_CLASS_UNDEFINED_STATIC: int +IMAGE_SYM_CLASS_ENUM_TAG: int +IMAGE_SYM_CLASS_MEMBER_OF_ENUM: int +IMAGE_SYM_CLASS_REGISTER_PARAM: int +IMAGE_SYM_CLASS_BIT_FIELD: int +IMAGE_SYM_CLASS_FAR_EXTERNAL: int +IMAGE_SYM_CLASS_BLOCK: int +IMAGE_SYM_CLASS_FUNCTION: int +IMAGE_SYM_CLASS_END_OF_STRUCT: int +IMAGE_SYM_CLASS_FILE: int +IMAGE_SYM_CLASS_SECTION: int +IMAGE_SYM_CLASS_WEAK_EXTERNAL: int +N_BTMASK: int +N_TMASK: int +N_TMASK1: int +N_TMASK2: int +N_BTSHFT: int +N_TSHIFT: int + +def BTYPE(x): ... +def ISPTR(x): ... +def ISFCN(x): ... +def ISARY(x): ... +def INCREF(x): ... +def DECREF(x): ... + +IMAGE_SIZEOF_AUX_SYMBOL: int +IMAGE_COMDAT_SELECT_NODUPLICATES: int +IMAGE_COMDAT_SELECT_ANY: int +IMAGE_COMDAT_SELECT_SAME_SIZE: int +IMAGE_COMDAT_SELECT_EXACT_MATCH: int +IMAGE_COMDAT_SELECT_ASSOCIATIVE: int +IMAGE_COMDAT_SELECT_LARGEST: int +IMAGE_COMDAT_SELECT_NEWEST: int +IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY: int +IMAGE_WEAK_EXTERN_SEARCH_LIBRARY: int +IMAGE_WEAK_EXTERN_SEARCH_ALIAS: int +IMAGE_SIZEOF_RELOCATION: int +IMAGE_REL_I386_ABSOLUTE: int +IMAGE_REL_I386_DIR16: int +IMAGE_REL_I386_REL16: int +IMAGE_REL_I386_DIR32: int +IMAGE_REL_I386_DIR32NB: int +IMAGE_REL_I386_SEG12: int +IMAGE_REL_I386_SECTION: int +IMAGE_REL_I386_SECREL: int +IMAGE_REL_I386_REL32: int +IMAGE_REL_MIPS_ABSOLUTE: int +IMAGE_REL_MIPS_REFHALF: int +IMAGE_REL_MIPS_REFWORD: int +IMAGE_REL_MIPS_JMPADDR: int +IMAGE_REL_MIPS_REFHI: int +IMAGE_REL_MIPS_REFLO: int +IMAGE_REL_MIPS_GPREL: int +IMAGE_REL_MIPS_LITERAL: int +IMAGE_REL_MIPS_SECTION: int +IMAGE_REL_MIPS_SECREL: int +IMAGE_REL_MIPS_SECRELLO: int +IMAGE_REL_MIPS_SECRELHI: int +IMAGE_REL_MIPS_REFWORDNB: int +IMAGE_REL_MIPS_PAIR: int +IMAGE_REL_ALPHA_ABSOLUTE: int +IMAGE_REL_ALPHA_REFLONG: int +IMAGE_REL_ALPHA_REFQUAD: int +IMAGE_REL_ALPHA_GPREL32: int +IMAGE_REL_ALPHA_LITERAL: int +IMAGE_REL_ALPHA_LITUSE: int +IMAGE_REL_ALPHA_GPDISP: int +IMAGE_REL_ALPHA_BRADDR: int +IMAGE_REL_ALPHA_HINT: int +IMAGE_REL_ALPHA_INLINE_REFLONG: int +IMAGE_REL_ALPHA_REFHI: int +IMAGE_REL_ALPHA_REFLO: int +IMAGE_REL_ALPHA_PAIR: int +IMAGE_REL_ALPHA_MATCH: int +IMAGE_REL_ALPHA_SECTION: int +IMAGE_REL_ALPHA_SECREL: int +IMAGE_REL_ALPHA_REFLONGNB: int +IMAGE_REL_ALPHA_SECRELLO: int +IMAGE_REL_ALPHA_SECRELHI: int +IMAGE_REL_PPC_ABSOLUTE: int +IMAGE_REL_PPC_ADDR64: int +IMAGE_REL_PPC_ADDR32: int +IMAGE_REL_PPC_ADDR24: int +IMAGE_REL_PPC_ADDR16: int +IMAGE_REL_PPC_ADDR14: int +IMAGE_REL_PPC_REL24: int +IMAGE_REL_PPC_REL14: int +IMAGE_REL_PPC_TOCREL16: int +IMAGE_REL_PPC_TOCREL14: int +IMAGE_REL_PPC_ADDR32NB: int +IMAGE_REL_PPC_SECREL: int +IMAGE_REL_PPC_SECTION: int +IMAGE_REL_PPC_IFGLUE: int +IMAGE_REL_PPC_IMGLUE: int +IMAGE_REL_PPC_SECREL16: int +IMAGE_REL_PPC_REFHI: int +IMAGE_REL_PPC_REFLO: int +IMAGE_REL_PPC_PAIR: int +IMAGE_REL_PPC_SECRELLO: int +IMAGE_REL_PPC_SECRELHI: int +IMAGE_REL_PPC_TYPEMASK: int +IMAGE_REL_PPC_NEG: int +IMAGE_REL_PPC_BRTAKEN: int +IMAGE_REL_PPC_BRNTAKEN: int +IMAGE_REL_PPC_TOCDEFN: int +IMAGE_REL_SH3_ABSOLUTE: int +IMAGE_REL_SH3_DIRECT16: int +IMAGE_REL_SH3_DIRECT32: int +IMAGE_REL_SH3_DIRECT8: int +IMAGE_REL_SH3_DIRECT8_WORD: int +IMAGE_REL_SH3_DIRECT8_LONG: int +IMAGE_REL_SH3_DIRECT4: int +IMAGE_REL_SH3_DIRECT4_WORD: int +IMAGE_REL_SH3_DIRECT4_LONG: int +IMAGE_REL_SH3_PCREL8_WORD: int +IMAGE_REL_SH3_PCREL8_LONG: int +IMAGE_REL_SH3_PCREL12_WORD: int +IMAGE_REL_SH3_STARTOF_SECTION: int +IMAGE_REL_SH3_SIZEOF_SECTION: int +IMAGE_REL_SH3_SECTION: int +IMAGE_REL_SH3_SECREL: int +IMAGE_REL_SH3_DIRECT32_NB: int +IMAGE_SIZEOF_LINENUMBER: int +IMAGE_SIZEOF_BASE_RELOCATION: int +IMAGE_REL_BASED_ABSOLUTE: int +IMAGE_REL_BASED_HIGH: int +IMAGE_REL_BASED_LOW: int +IMAGE_REL_BASED_HIGHLOW: int +IMAGE_REL_BASED_HIGHADJ: int +IMAGE_REL_BASED_MIPS_JMPADDR: int +IMAGE_REL_BASED_SECTION: int +IMAGE_REL_BASED_REL32: int +IMAGE_ARCHIVE_START_SIZE: int +IMAGE_ARCHIVE_START: str +IMAGE_ARCHIVE_END: str +IMAGE_ARCHIVE_PAD: str +IMAGE_ARCHIVE_LINKER_MEMBER: str +IMAGE_SIZEOF_ARCHIVE_MEMBER_HDR: int +IMAGE_ORDINAL_FLAG: int + +def IMAGE_SNAP_BY_ORDINAL(Ordina): ... +def IMAGE_ORDINAL(Ordina): ... + +IMAGE_RESOURCE_NAME_IS_STRING: int +IMAGE_RESOURCE_DATA_IS_DIRECTORY: int +IMAGE_DEBUG_TYPE_UNKNOWN: int +IMAGE_DEBUG_TYPE_COFF: int +IMAGE_DEBUG_TYPE_CODEVIEW: int +IMAGE_DEBUG_TYPE_FPO: int +IMAGE_DEBUG_TYPE_MISC: int +IMAGE_DEBUG_TYPE_EXCEPTION: int +IMAGE_DEBUG_TYPE_FIXUP: int +IMAGE_DEBUG_TYPE_OMAP_TO_SRC: int +IMAGE_DEBUG_TYPE_OMAP_FROM_SRC: int +IMAGE_DEBUG_TYPE_BORLAND: int +FRAME_FPO: int +FRAME_TRAP: int +FRAME_TSS: int +FRAME_NONFPO: int +SIZEOF_RFPO_DATA: int +IMAGE_DEBUG_MISC_EXENAME: int +IMAGE_SEPARATE_DEBUG_SIGNATURE: int +IMAGE_SEPARATE_DEBUG_FLAGS_MASK: int +IMAGE_SEPARATE_DEBUG_MISMATCH: int +NULL: int +HEAP_NO_SERIALIZE: int +HEAP_GROWABLE: int +HEAP_GENERATE_EXCEPTIONS: int +HEAP_ZERO_MEMORY: int +HEAP_REALLOC_IN_PLACE_ONLY: int +HEAP_TAIL_CHECKING_ENABLED: int +HEAP_FREE_CHECKING_ENABLED: int +HEAP_DISABLE_COALESCE_ON_FREE: int +HEAP_CREATE_ALIGN_16: int +HEAP_CREATE_ENABLE_TRACING: int +HEAP_MAXIMUM_TAG: int +HEAP_PSEUDO_TAG_FLAG: int +HEAP_TAG_SHIFT: int +IS_TEXT_UNICODE_ASCII16: int +IS_TEXT_UNICODE_REVERSE_ASCII16: int +IS_TEXT_UNICODE_STATISTICS: int +IS_TEXT_UNICODE_REVERSE_STATISTICS: int +IS_TEXT_UNICODE_CONTROLS: int +IS_TEXT_UNICODE_REVERSE_CONTROLS: int +IS_TEXT_UNICODE_SIGNATURE: int +IS_TEXT_UNICODE_REVERSE_SIGNATURE: int +IS_TEXT_UNICODE_ILLEGAL_CHARS: int +IS_TEXT_UNICODE_ODD_LENGTH: int +IS_TEXT_UNICODE_DBCS_LEADBYTE: int +IS_TEXT_UNICODE_NULL_BYTES: int +IS_TEXT_UNICODE_UNICODE_MASK: int +IS_TEXT_UNICODE_REVERSE_MASK: int +IS_TEXT_UNICODE_NOT_UNICODE_MASK: int +IS_TEXT_UNICODE_NOT_ASCII_MASK: int +COMPRESSION_FORMAT_NONE: int +COMPRESSION_FORMAT_DEFAULT: int +COMPRESSION_FORMAT_LZNT1: int +COMPRESSION_ENGINE_STANDARD: int +COMPRESSION_ENGINE_MAXIMUM: int +MESSAGE_RESOURCE_UNICODE: int +RTL_CRITSECT_TYPE: int +RTL_RESOURCE_TYPE: int +SEF_DACL_AUTO_INHERIT: int +SEF_SACL_AUTO_INHERIT: int +SEF_DEFAULT_DESCRIPTOR_FOR_OBJECT: int +SEF_AVOID_PRIVILEGE_CHECK: int +DLL_PROCESS_ATTACH: int +DLL_THREAD_ATTACH: int +DLL_THREAD_DETACH: int +DLL_PROCESS_DETACH: int +EVENTLOG_SEQUENTIAL_READ: int +EVENTLOG_SEEK_READ: int +EVENTLOG_FORWARDS_READ: int +EVENTLOG_BACKWARDS_READ: int +EVENTLOG_SUCCESS: int +EVENTLOG_ERROR_TYPE: int +EVENTLOG_WARNING_TYPE: int +EVENTLOG_INFORMATION_TYPE: int +EVENTLOG_AUDIT_SUCCESS: int +EVENTLOG_AUDIT_FAILURE: int +EVENTLOG_START_PAIRED_EVENT: int +EVENTLOG_END_PAIRED_EVENT: int +EVENTLOG_END_ALL_PAIRED_EVENTS: int +EVENTLOG_PAIRED_EVENT_ACTIVE: int +EVENTLOG_PAIRED_EVENT_INACTIVE: int +KEY_QUERY_VALUE: int +KEY_SET_VALUE: int +KEY_CREATE_SUB_KEY: int +KEY_ENUMERATE_SUB_KEYS: int +KEY_NOTIFY: int +KEY_CREATE_LINK: int +KEY_READ: Incomplete +KEY_WRITE: Incomplete +KEY_EXECUTE: Incomplete +KEY_ALL_ACCESS: Incomplete +REG_OPTION_RESERVED: int +REG_OPTION_NON_VOLATILE: int +REG_OPTION_VOLATILE: int +REG_OPTION_CREATE_LINK: int +REG_OPTION_BACKUP_RESTORE: int +REG_OPTION_OPEN_LINK: int +REG_LEGAL_OPTION: Incomplete +REG_CREATED_NEW_KEY: int +REG_OPENED_EXISTING_KEY: int +REG_STANDARD_FORMAT: int +REG_LATEST_FORMAT: int +REG_NO_COMPRESSION: int +REG_WHOLE_HIVE_VOLATILE: int +REG_REFRESH_HIVE: int +REG_NO_LAZY_FLUSH: int +REG_FORCE_RESTORE: int +REG_NOTIFY_CHANGE_NAME: int +REG_NOTIFY_CHANGE_ATTRIBUTES: int +REG_NOTIFY_CHANGE_LAST_SET: int +REG_NOTIFY_CHANGE_SECURITY: int +REG_LEGAL_CHANGE_FILTER: Incomplete +REG_NONE: int +REG_SZ: int +REG_EXPAND_SZ: int +REG_BINARY: int +REG_DWORD: int +REG_DWORD_LITTLE_ENDIAN: int +REG_DWORD_BIG_ENDIAN: int +REG_LINK: int +REG_MULTI_SZ: int +REG_RESOURCE_LIST: int +REG_FULL_RESOURCE_DESCRIPTOR: int +REG_RESOURCE_REQUIREMENTS_LIST: int +SERVICE_KERNEL_DRIVER: int +SERVICE_FILE_SYSTEM_DRIVER: int +SERVICE_ADAPTER: int +SERVICE_RECOGNIZER_DRIVER: int +SERVICE_DRIVER: Incomplete +SERVICE_WIN32_OWN_PROCESS: int +SERVICE_WIN32_SHARE_PROCESS: int +SERVICE_WIN32: Incomplete +SERVICE_INTERACTIVE_PROCESS: int +SERVICE_TYPE_ALL: Incomplete +SERVICE_BOOT_START: int +SERVICE_SYSTEM_START: int +SERVICE_AUTO_START: int +SERVICE_DEMAND_START: int +SERVICE_DISABLED: int +SERVICE_ERROR_IGNORE: int +SERVICE_ERROR_NORMAL: int +SERVICE_ERROR_SEVERE: int +SERVICE_ERROR_CRITICAL: int +TAPE_ERASE_SHORT: int +TAPE_ERASE_LONG: int +TAPE_LOAD: int +TAPE_UNLOAD: int +TAPE_TENSION: int +TAPE_LOCK: int +TAPE_UNLOCK: int +TAPE_FORMAT: int +TAPE_SETMARKS: int +TAPE_FILEMARKS: int +TAPE_SHORT_FILEMARKS: int +TAPE_LONG_FILEMARKS: int +TAPE_ABSOLUTE_POSITION: int +TAPE_LOGICAL_POSITION: int +TAPE_PSEUDO_LOGICAL_POSITION: int +TAPE_REWIND: int +TAPE_ABSOLUTE_BLOCK: int +TAPE_LOGICAL_BLOCK: int +TAPE_PSEUDO_LOGICAL_BLOCK: int +TAPE_SPACE_END_OF_DATA: int +TAPE_SPACE_RELATIVE_BLOCKS: int +TAPE_SPACE_FILEMARKS: int +TAPE_SPACE_SEQUENTIAL_FMKS: int +TAPE_SPACE_SETMARKS: int +TAPE_SPACE_SEQUENTIAL_SMKS: int +TAPE_DRIVE_FIXED: int +TAPE_DRIVE_SELECT: int +TAPE_DRIVE_INITIATOR: int +TAPE_DRIVE_ERASE_SHORT: int +TAPE_DRIVE_ERASE_LONG: int +TAPE_DRIVE_ERASE_BOP_ONLY: int +TAPE_DRIVE_ERASE_IMMEDIATE: int +TAPE_DRIVE_TAPE_CAPACITY: int +TAPE_DRIVE_TAPE_REMAINING: int +TAPE_DRIVE_FIXED_BLOCK: int +TAPE_DRIVE_VARIABLE_BLOCK: int +TAPE_DRIVE_WRITE_PROTECT: int +TAPE_DRIVE_EOT_WZ_SIZE: int +TAPE_DRIVE_ECC: int +TAPE_DRIVE_COMPRESSION: int +TAPE_DRIVE_PADDING: int +TAPE_DRIVE_REPORT_SMKS: int +TAPE_DRIVE_GET_ABSOLUTE_BLK: int +TAPE_DRIVE_GET_LOGICAL_BLK: int +TAPE_DRIVE_SET_EOT_WZ_SIZE: int +TAPE_DRIVE_EJECT_MEDIA: int +TAPE_DRIVE_RESERVED_BIT: int +TAPE_DRIVE_LOAD_UNLOAD: int +TAPE_DRIVE_TENSION: int +TAPE_DRIVE_LOCK_UNLOCK: int +TAPE_DRIVE_REWIND_IMMEDIATE: int +TAPE_DRIVE_SET_BLOCK_SIZE: int +TAPE_DRIVE_LOAD_UNLD_IMMED: int +TAPE_DRIVE_TENSION_IMMED: int +TAPE_DRIVE_LOCK_UNLK_IMMED: int +TAPE_DRIVE_SET_ECC: int +TAPE_DRIVE_SET_COMPRESSION: int +TAPE_DRIVE_SET_PADDING: int +TAPE_DRIVE_SET_REPORT_SMKS: int +TAPE_DRIVE_ABSOLUTE_BLK: int +TAPE_DRIVE_ABS_BLK_IMMED: int +TAPE_DRIVE_LOGICAL_BLK: int +TAPE_DRIVE_LOG_BLK_IMMED: int +TAPE_DRIVE_END_OF_DATA: int +TAPE_DRIVE_RELATIVE_BLKS: int +TAPE_DRIVE_FILEMARKS: int +TAPE_DRIVE_SEQUENTIAL_FMKS: int +TAPE_DRIVE_SETMARKS: int +TAPE_DRIVE_SEQUENTIAL_SMKS: int +TAPE_DRIVE_REVERSE_POSITION: int +TAPE_DRIVE_SPACE_IMMEDIATE: int +TAPE_DRIVE_WRITE_SETMARKS: int +TAPE_DRIVE_WRITE_FILEMARKS: int +TAPE_DRIVE_WRITE_SHORT_FMKS: int +TAPE_DRIVE_WRITE_LONG_FMKS: int +TAPE_DRIVE_WRITE_MARK_IMMED: int +TAPE_DRIVE_FORMAT: int +TAPE_DRIVE_FORMAT_IMMEDIATE: int +TAPE_DRIVE_HIGH_FEATURES: int +TAPE_FIXED_PARTITIONS: int +TAPE_SELECT_PARTITIONS: int +TAPE_INITIATOR_PARTITIONS: int +TRANSACTIONMANAGER_QUERY_INFORMATION: int +TRANSACTIONMANAGER_SET_INFORMATION: int +TRANSACTIONMANAGER_RECOVER: int +TRANSACTIONMANAGER_RENAME: int +TRANSACTIONMANAGER_CREATE_RM: int +TRANSACTIONMANAGER_BIND_TRANSACTION: int +TRANSACTIONMANAGER_GENERIC_READ: Incomplete +TRANSACTIONMANAGER_GENERIC_WRITE: Incomplete +TRANSACTIONMANAGER_GENERIC_EXECUTE: int +TRANSACTIONMANAGER_ALL_ACCESS: Incomplete +TRANSACTION_QUERY_INFORMATION: int +TRANSACTION_SET_INFORMATION: int +TRANSACTION_ENLIST: int +TRANSACTION_COMMIT: int +TRANSACTION_ROLLBACK: int +TRANSACTION_PROPAGATE: int +TRANSACTION_SAVEPOINT: int +TRANSACTION_MARSHALL: int +TRANSACTION_GENERIC_READ: Incomplete +TRANSACTION_GENERIC_WRITE: Incomplete +TRANSACTION_GENERIC_EXECUTE: Incomplete +TRANSACTION_ALL_ACCESS: Incomplete +TRANSACTION_RESOURCE_MANAGER_RIGHTS: Incomplete +RESOURCEMANAGER_QUERY_INFORMATION: int +RESOURCEMANAGER_SET_INFORMATION: int +RESOURCEMANAGER_RECOVER: int +RESOURCEMANAGER_ENLIST: int +RESOURCEMANAGER_GET_NOTIFICATION: int +RESOURCEMANAGER_REGISTER_PROTOCOL: int +RESOURCEMANAGER_COMPLETE_PROPAGATION: int +RESOURCEMANAGER_GENERIC_READ: Incomplete +RESOURCEMANAGER_GENERIC_WRITE: Incomplete +RESOURCEMANAGER_GENERIC_EXECUTE: Incomplete +RESOURCEMANAGER_ALL_ACCESS: Incomplete +ENLISTMENT_QUERY_INFORMATION: int +ENLISTMENT_SET_INFORMATION: int +ENLISTMENT_RECOVER: int +ENLISTMENT_SUBORDINATE_RIGHTS: int +ENLISTMENT_SUPERIOR_RIGHTS: int +ENLISTMENT_GENERIC_READ: Incomplete +ENLISTMENT_GENERIC_WRITE: Incomplete +ENLISTMENT_GENERIC_EXECUTE: Incomplete +ENLISTMENT_ALL_ACCESS: Incomplete +TransactionOutcomeUndetermined: int +TransactionOutcomeCommitted: int +TransactionOutcomeAborted: int +TransactionStateNormal: int +TransactionStateIndoubt: int +TransactionStateCommittedNotify: int +TransactionBasicInformation: int +TransactionPropertiesInformation: int +TransactionEnlistmentInformation: int +TransactionFullInformation: int +TransactionManagerBasicInformation: int +TransactionManagerLogInformation: int +TransactionManagerLogPathInformation: int +TransactionManagerOnlineProbeInformation: int +ResourceManagerBasicInformation: int +ResourceManagerCompletionInformation: int +ResourceManagerFullInformation: int +ResourceManagerNameInformation: int +EnlistmentBasicInformation: int +EnlistmentRecoveryInformation: int +EnlistmentFullInformation: int +EnlistmentNameInformation: int +KTMOBJECT_TRANSACTION: int +KTMOBJECT_TRANSACTION_MANAGER: int +KTMOBJECT_RESOURCE_MANAGER: int +KTMOBJECT_ENLISTMENT: int +KTMOBJECT_INVALID: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/winperf.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/winperf.pyi new file mode 100644 index 000000000..bcda5bf33 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/winperf.pyi @@ -0,0 +1,73 @@ +from _typeshed import Incomplete + +PERF_DATA_VERSION: int +PERF_DATA_REVISION: int +PERF_NO_INSTANCES: int +PERF_SIZE_DWORD: int +PERF_SIZE_LARGE: int +PERF_SIZE_ZERO: int +PERF_SIZE_VARIABLE_LEN: int +PERF_TYPE_NUMBER: int +PERF_TYPE_COUNTER: int +PERF_TYPE_TEXT: int +PERF_TYPE_ZERO: int +PERF_NUMBER_HEX: int +PERF_NUMBER_DECIMAL: int +PERF_NUMBER_DEC_1000: int +PERF_COUNTER_VALUE: int +PERF_COUNTER_RATE: int +PERF_COUNTER_FRACTION: int +PERF_COUNTER_BASE: int +PERF_COUNTER_ELAPSED: int +PERF_COUNTER_QUEUELEN: int +PERF_COUNTER_HISTOGRAM: int +PERF_TEXT_UNICODE: int +PERF_TEXT_ASCII: int +PERF_TIMER_TICK: int +PERF_TIMER_100NS: int +PERF_OBJECT_TIMER: int +PERF_DELTA_COUNTER: int +PERF_DELTA_BASE: int +PERF_INVERSE_COUNTER: int +PERF_MULTI_COUNTER: int +PERF_DISPLAY_NO_SUFFIX: int +PERF_DISPLAY_PER_SEC: int +PERF_DISPLAY_PERCENT: int +PERF_DISPLAY_SECONDS: int +PERF_DISPLAY_NOSHOW: int +PERF_COUNTER_COUNTER: Incomplete +PERF_COUNTER_TIMER: Incomplete +PERF_COUNTER_QUEUELEN_TYPE: Incomplete +PERF_COUNTER_LARGE_QUEUELEN_TYPE: Incomplete +PERF_COUNTER_BULK_COUNT: Incomplete +PERF_COUNTER_TEXT: Incomplete +PERF_COUNTER_RAWCOUNT: Incomplete +PERF_COUNTER_LARGE_RAWCOUNT: Incomplete +PERF_COUNTER_RAWCOUNT_HEX: Incomplete +PERF_COUNTER_LARGE_RAWCOUNT_HEX: Incomplete +PERF_SAMPLE_FRACTION: Incomplete +PERF_SAMPLE_COUNTER: Incomplete +PERF_COUNTER_NODATA: Incomplete +PERF_COUNTER_TIMER_INV: Incomplete +PERF_SAMPLE_BASE: Incomplete +PERF_AVERAGE_TIMER: Incomplete +PERF_AVERAGE_BASE: Incomplete +PERF_AVERAGE_BULK: Incomplete +PERF_100NSEC_TIMER: Incomplete +PERF_100NSEC_TIMER_INV: Incomplete +PERF_COUNTER_MULTI_TIMER: Incomplete +PERF_COUNTER_MULTI_TIMER_INV: Incomplete +PERF_COUNTER_MULTI_BASE: Incomplete +PERF_100NSEC_MULTI_TIMER: Incomplete +PERF_100NSEC_MULTI_TIMER_INV: Incomplete +PERF_RAW_FRACTION: Incomplete +PERF_RAW_BASE: Incomplete +PERF_ELAPSED_TIME: Incomplete +PERF_COUNTER_HISTOGRAM_TYPE: int +PERF_COUNTER_DELTA: Incomplete +PERF_COUNTER_LARGE_DELTA: Incomplete +PERF_DETAIL_NOVICE: int +PERF_DETAIL_ADVANCED: int +PERF_DETAIL_EXPERT: int +PERF_DETAIL_WIZARD: int +PERF_NO_UNIQUE_ID: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/winxptheme.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/winxptheme.pyi new file mode 100644 index 000000000..080eb5329 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/winxptheme.pyi @@ -0,0 +1,25 @@ +import _win32typing + +def OpenThemeData(hwnd: int, pszClasslist: str) -> _win32typing.PyHTHEME: ... +def CloseThemeData(hTheme: _win32typing.PyHTHEME) -> None: ... +def DrawThemeBackground(hTheme: _win32typing.PyHTHEME, hdc, iPartId, iStateId, pRect, pClipRect) -> None: ... +def DrawThemeText( + hTheme: _win32typing.PyHTHEME, hdc, iPartId, iStateId, pszText: str, dwCharCount, dwTextFlags, dwTextFlags2, pRect +) -> None: ... +def GetThemeBackgroundContentRect(hTheme: _win32typing.PyHTHEME, hdc, iPartId, iStateId, pBoundingRect): ... +def GetThemeBackgroundExtent(hTheme: _win32typing.PyHTHEME, hdc, iPartId, iStateId, pContentRect): ... +def IsThemeActive() -> int: ... +def IsAppThemed() -> int: ... +def GetWindowTheme(hwnd: int) -> _win32typing.PyHTHEME: ... +def EnableThemeDialogTexture(hdlg, dwFlags) -> None: ... +def IsThemeDialogTextureEnabled(__hdlg: int | None) -> bool: ... +def GetThemeAppProperties(): ... +def EnableTheming(fEnable) -> None: ... +def SetWindowTheme(hwnd: int, pszSubAppName: str, pszSubIdlist: str) -> None: ... +def GetCurrentThemeName() -> tuple[str, str, str]: ... + +ETDT_DISABLE: int +ETDT_ENABLE: int +ETDT_ENABLETAB: int +ETDT_USETABTEXTURE: int +UNICODE: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/mmapfile.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/mmapfile.pyi new file mode 100644 index 000000000..8d943c372 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/mmapfile.pyi @@ -0,0 +1,6 @@ +import _win32typing +from win32.lib.pywintypes import error as error + +def mmapfile( + File, Name, MaximumSize: int = ..., FileOffset: int = ..., NumberOfBytesToMap: int = ... +) -> _win32typing.Pymmapfile: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/odbc.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/odbc.pyi new file mode 100644 index 000000000..8ba629f38 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/odbc.pyi @@ -0,0 +1,29 @@ +from _typeshed import Incomplete +from typing_extensions import Literal, TypeAlias + +import _win32typing + +def odbc(connectionString: str) -> _win32typing.connection: ... +def SQLDataSources(direction) -> tuple[Incomplete, Incomplete]: ... + +_odbcError: TypeAlias = type # noqa: Y042 # Does not exist at runtime, but odbc.odbcError is a valid type. +DATE: str +NUMBER: str +RAW: str +SQL_FETCH_ABSOLUTE: int +SQL_FETCH_FIRST: int +SQL_FETCH_FIRST_SYSTEM: int +SQL_FETCH_FIRST_USER: int +SQL_FETCH_LAST: int +SQL_FETCH_NEXT: int +SQL_FETCH_PRIOR: int +SQL_FETCH_RELATIVE: int +STRING: str +TYPES: tuple[Literal["STRING"], Literal["RAW"], Literal["NUMBER"], Literal["DATE"]] +dataError: Incomplete +error: _odbcError +integrityError: Incomplete +internalError: Incomplete +noError: Incomplete +opError: Incomplete +progError: Incomplete diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/perfmon.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/perfmon.pyi new file mode 100644 index 000000000..0656bec3f --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/perfmon.pyi @@ -0,0 +1,12 @@ +import _win32typing + +def LoadPerfCounterTextStrings(__commandLine: str) -> None: ... +def UnloadPerfCounterTextStrings(__commandLine: str) -> None: ... +def CounterDefinition() -> _win32typing.PyPERF_COUNTER_DEFINITION: ... +def ObjectType() -> _win32typing.PyPERF_OBJECT_TYPE: ... +def PerfMonManager( + serviceName: str, + seqPerfObTypes: list[_win32typing.PyPERF_OBJECT_TYPE], + mappingName: str | None = ..., + eventSourceName: str | None = ..., +) -> _win32typing.PyPerfMonManager: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/servicemanager.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/servicemanager.pyi new file mode 100644 index 000000000..80f4b7e2e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/servicemanager.pyi @@ -0,0 +1,34 @@ +from _typeshed import Incomplete + +def CoInitializeEx() -> None: ... +def CoUninitialize() -> None: ... +def RegisterServiceCtrlHandler(serviceName: str, callback, extra_args: bool = ...): ... +def LogMsg(__errorType: int, __eventId: int, __inserts: tuple[str, str] | None = ...) -> None: ... +def LogInfoMsg(msg: str) -> None: ... +def LogErrorMsg(msg: str) -> None: ... +def LogWarningMsg(msg: str) -> None: ... +def PumpWaitingMessages(__firstMessage: int = ..., __lastMessage: int = ...) -> int: ... +def Debugging(newVal: int = ...): ... +def Initialize(eventSourceName: str | None = ..., eventSourceFile: str | None = ...) -> None: ... +def Finalize() -> None: ... +def PrepareToHostSingle(klass: Incomplete | None = ...) -> None: ... +def PrepareToHostMultiple(service_name: str, klass) -> None: ... +def RunningAsService(): ... +def SetEventSourceName(sourceName: str, registerNow: bool = ...) -> None: ... +def StartServiceCtrlDispatcher(*args, **kwargs): ... # incomplete + +COINIT_APARTMENTTHREADED: int +COINIT_DISABLE_OLE1DDE: int +COINIT_MULTITHREADED: int +COINIT_SPEED_OVER_MEMORY: int +EVENTLOG_AUDIT_FAILURE: int +EVENTLOG_AUDIT_SUCCESS: int +EVENTLOG_ERROR_TYPE: int +EVENTLOG_INFORMATION_TYPE: int +EVENTLOG_WARNING_TYPE: int +PYS_SERVICE_STARTED: int +PYS_SERVICE_STARTING: int +PYS_SERVICE_STOPPED: int +PYS_SERVICE_STOPPING: int + +class startup_error(Exception): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/timer.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/timer.pyi new file mode 100644 index 000000000..751757b83 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/timer.pyi @@ -0,0 +1,6 @@ +from win32.lib.pywintypes import error as error + +def set_timer(Elapse, TimerFunc): ... +def kill_timer(timer_id): ... + +__version__: bytes diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32api.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32api.pyi new file mode 100644 index 000000000..855559c79 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32api.pyi @@ -0,0 +1,311 @@ +from _typeshed import Incomplete, ReadableBuffer +from collections.abc import Callable, Iterable +from typing_extensions import TypedDict + +import _win32typing +from win32.lib.pywintypes import error as error + +class _MonitorInfo(TypedDict): + Monitor: tuple[int, int, int, int] + Work: tuple[int, int, int, int] + Flags: int + Device: str + +def AbortSystemShutdown(computerName: str) -> None: ... +def InitiateSystemShutdown(computerName: str, message: str, timeOut, bForceClose, bRebootAfterShutdown) -> None: ... +def Apply(exceptionHandler, func, args): ... +def Beep(freq, dur) -> None: ... +def BeginUpdateResource(filename: str, delete) -> int: ... +def ChangeDisplaySettings(DevMode: _win32typing.PyDEVMODE, Flags): ... +def ChangeDisplaySettingsEx(DeviceName: Incomplete | None = ..., DevMode: _win32typing.PyDEVMODE | None = ..., Flags=...): ... +def ClipCursor(arg: tuple[Incomplete, Incomplete, Incomplete, Incomplete]) -> None: ... +def CloseHandle(__handle: int) -> None: ... +def CopyFile(src, dest: str, bFailOnExist: int = ...) -> None: ... +def DebugBreak() -> None: ... +def DeleteFile(fileName: str) -> None: ... +def DragQueryFile(hDrop, fileNum: int = ...) -> str: ... +def DragFinish(hDrop) -> None: ... +def DuplicateHandle( + __hSourceProcess: int, + __hSource: int, + __hTargetProcessHandle: int, + __desiredAccess: int, + __bInheritHandle: int, + __options: int, +) -> int: ... +def EndUpdateResource(handle: int, discard) -> None: ... +def EnumDisplayDevices(Device: str | None = ..., DevNum: int = ..., Flags: int = ...) -> _win32typing.PyDISPLAY_DEVICE: ... +def EnumDisplayMonitors( + hdc: int | None = ..., rcClip: _win32typing.PyRECT | None = ... +) -> list[tuple[_win32typing.PyHANDLE, _win32typing.PyHANDLE, tuple[int, int, int, int]]]: ... +def EnumDisplaySettings(DeviceName: str | None = ..., ModeNum: int = ...) -> _win32typing.PyDEVMODE: ... +def EnumDisplaySettingsEx(ModeNum, DeviceName: str | None = ..., Flags=...) -> _win32typing.PyDEVMODE: ... +def EnumResourceLanguages( + hmodule: int, lpType: _win32typing.PyResourceId, lpName: _win32typing.PyResourceId +) -> list[Incomplete]: ... +def EnumResourceNames(hmodule: int, resType: _win32typing.PyResourceId) -> list[str]: ... +def EnumResourceTypes(hmodule: int) -> list[Incomplete]: ... +def ExpandEnvironmentStrings(_in: str) -> str: ... +def ExitWindows(reserved1: int = ..., reserved2: int = ...) -> None: ... +def ExitWindowsEx(flags, reserved: int = ...) -> None: ... +def FindFiles(fileSpec: str): ... +def FindFirstChangeNotification(pathName: str, bSubDirs, _filter): ... +def FindNextChangeNotification(handle: int) -> None: ... +def FindCloseChangeNotification(handle) -> None: ... +def FindExecutable(filename: str, _dir: str) -> tuple[Incomplete, str]: ... +def FormatMessage( + __flags: int, + __source: str | None = ..., + __messageId: int = ..., + __languageID: int = ..., + __inserts: Iterable[str] | None = ..., +) -> str: ... +def FormatMessageW( + __flags: int, + __source: int | None = ..., + __messageId: int = ..., + __languageID: int = ..., + __inserts: Iterable[str] | None = ..., +) -> str: ... +def FreeLibrary(hModule: int) -> None: ... +def GenerateConsoleCtrlEvent(__controlEvent: int, __processGroupId: int) -> None: ... +def GetAsyncKeyState(key): ... +def GetCommandLine() -> str: ... +def GetComputerName() -> str: ... +def GetComputerNameEx(NameType) -> str: ... +def GetComputerObjectName(NameFormat) -> str: ... +def GetMonitorInfo(hMonitor: int) -> _MonitorInfo: ... +def GetUserName() -> str: ... +def GetUserNameEx(__NameFormat: int) -> str: ... +def GetCursorPos() -> tuple[Incomplete, Incomplete]: ... +def GetCurrentThread(): ... +def GetCurrentThreadId(): ... +def GetCurrentProcessId(): ... +def GetCurrentProcess() -> int: ... +def GetConsoleTitle() -> str: ... +def GetDateFormat(locale, flags, time: _win32typing.PyTime, _format: str) -> str: ... +def GetDiskFreeSpace(rootPath: str): ... +def GetDiskFreeSpaceEx(__rootPath: str) -> tuple[int, int, int]: ... +def GetDllDirectory() -> str: ... +def GetDomainName() -> str: ... +def GetEnvironmentVariable(variable): ... +def GetEnvironmentVariableW(Name) -> str: ... +def GetFileAttributes(pathName: str): ... +def GetFileVersionInfo(Filename: str, SubBlock: str) -> None: ... +def GetFocus(): ... +def GetFullPathName(fileName: str) -> str: ... +def GetHandleInformation(__Object: int): ... +def GetKeyboardLayout(threadId: int = ...): ... +def GetKeyboardLayoutName(): ... +def GetKeyboardState() -> str: ... +def GetKeyState(key): ... +def GetLastError(): ... +def GetLastInputInfo(): ... +def GetLocalTime(): ... +def GetLongPathName(__fileName: str) -> str: ... +def GetLongPathNameW(fileName: str) -> str: ... +def GetLogicalDrives(): ... +def GetLogicalDriveStrings() -> str: ... +def GetModuleFileName(hModule: int) -> str: ... +def GetModuleFileNameW(hModule: int) -> str: ... +def GetModuleHandle(__fileName: str | None = ...) -> int: ... +def GetPwrCapabilities(): ... +def GetProfileSection(section: str, iniName: str | None = ...): ... +def GetProcAddress(hModule: int, functionName: _win32typing.PyResourceId): ... +def GetProfileVal(section: str, entry: str, defValue: str, iniName: str | None = ...) -> str: ... +def GetShortPathName(path: str) -> str: ... +def GetStdHandle(__handle: int) -> _win32typing.PyHANDLE: ... +def GetSysColor(index): ... +def GetSystemDefaultLangID(): ... +def GetSystemDefaultLCID(): ... +def GetSystemDirectory() -> str: ... +def GetSystemFileCacheSize(): ... +def SetSystemFileCacheSize(MinimumFileCacheSize, MaximumFileCacheSize, Flags=...) -> None: ... +def GetSystemInfo(): ... +def GetNativeSystemInfo(): ... +def GetSystemMetrics(index): ... +def GetSystemTime(): ... +def GetTempFileName(path: str, prefix: str, nUnique): ... +def GetTempPath() -> str: ... +def GetThreadLocale(): ... +def GetTickCount() -> int: ... +def GetTimeFormat(locale, flags, time: _win32typing.PyTime, _format: str) -> str: ... +def GetTimeZoneInformation(times_as_tuples: bool = ...): ... +def GetVersion(): ... +def GetVersionEx(_format: int = ...): ... +def GetVolumeInformation(path: str): ... +def GetWindowsDirectory() -> str: ... +def GetWindowLong(__hwnd: int | None, __offset: int) -> int: ... +def GetUserDefaultLangID(): ... +def GetUserDefaultLCID(): ... +def GlobalMemoryStatus(): ... +def GlobalMemoryStatusEx() -> dict[str, int]: ... +def keybd_event(bVk, bScan, dwFlags: int = ..., dwExtraInfo: int = ...) -> None: ... +def mouse_event(dx, dy, dwData, dwFlags: int = ..., dwExtraInfo=...) -> None: ... +def LoadCursor(hInstance: int, cursorid: _win32typing.PyResourceId) -> int: ... +def LoadKeyboardLayout(KLID: str, Flags: int = ...): ... +def LoadLibrary(fileName: str): ... +def LoadLibraryEx(fileName: str, handle: int, handle1) -> int: ... +def LoadResource(handle: int, _type: _win32typing.PyResourceId, name: _win32typing.PyResourceId, language) -> str: ... +def LoadString(handle: int, stringId, numChars: int = ...) -> str: ... +def MessageBeep(arg): ... +def MessageBox(hwnd: int, message: str, title: str, arg, arg1): ... +def MonitorFromPoint(pt: tuple[Incomplete, Incomplete], Flags: int = ...) -> int: ... +def MonitorFromRect(__rc: _win32typing.PyRECT | tuple[int, int, int, int], __Flags: int = ...) -> int: ... +def MonitorFromWindow(hwnd: int, Flags: int = ...) -> int: ... +def MoveFile(srcName: str, destName: str) -> None: ... +def MoveFileEx(srcName: str, destName: str, flag) -> None: ... +def OpenProcess(__reqdAccess: int, __bInherit: int | bool, __pid: int) -> int: ... +def OutputDebugString(msg: str) -> None: ... +def PostMessage(hwnd: int, idMessage, wParam: Incomplete | None = ..., lParam: Incomplete | None = ...) -> None: ... +def PostQuitMessage(__exitCode: int = ...) -> None: ... +def PostThreadMessage(tid, idMessage, wParam: Incomplete | None = ..., lParam: Incomplete | None = ...) -> None: ... +def RegCloseKey(key: _win32typing.PyHKEY) -> None: ... +def RegConnectRegistry(computerName: str, key): ... +def RegCopyTree(KeySrc: _win32typing.PyHKEY, SubKey: str, KeyDest: _win32typing.PyHKEY) -> None: ... +def RegCreateKey(key: _win32typing.PyHKEY | int, subKey: str) -> _win32typing.PyHKEY: ... +def RegCreateKeyEx( + Key: _win32typing.PyHKEY, + SubKey: str, + samDesired, + Options, + Class: str | None = ..., + SecurityAttributes: _win32typing.PySECURITY_ATTRIBUTES | None = ..., + Transaction: int | None = ..., +) -> tuple[_win32typing.PyHKEY, Incomplete]: ... +def RegDeleteKey(key: _win32typing.PyHKEY, subKey: str) -> None: ... +def RegDeleteKeyEx(Key: _win32typing.PyHKEY, SubKey: str, samDesired: int = ..., Transaction: int | None = ...) -> None: ... +def RegDeleteTree(Key: _win32typing.PyHKEY, SubKey: str) -> None: ... +def RegDeleteValue(key: _win32typing.PyHKEY, value: str) -> None: ... +def RegEnumKey(key: _win32typing.PyHKEY, index) -> str: ... +def RegEnumKeyEx(Key: _win32typing.PyHKEY): ... +def RegEnumKeyExW(Key: _win32typing.PyHKEY): ... +def RegEnumValue(key: _win32typing.PyHKEY, index) -> tuple[str, Incomplete, Incomplete]: ... +def RegFlushKey(key: _win32typing.PyHKEY) -> None: ... +def RegGetKeySecurity(key: _win32typing.PyHKEY, security_info) -> _win32typing.PySECURITY_DESCRIPTOR: ... +def RegLoadKey(key: _win32typing.PyHKEY, subKey: str, filename: str) -> None: ... +def RegOpenCurrentUser(samDesired) -> _win32typing.PyHKEY: ... +def RegOpenKey( + __key: _win32typing.PyHKEY | int, __subkey: str | None, __reserved: bool = ..., __sam: int = ... +) -> _win32typing.PyHKEY: ... +def RegOpenKeyEx(__key: _win32typing.PyHKEY, __subKey: str, __sam: int, __reserved: bool = ...) -> _win32typing.PyHKEY: ... +def RegOpenKeyTransacted( + Key: _win32typing.PyHKEY, SubKey: str, samDesired, Transaction: int, Options: int = ... +) -> _win32typing.PyHKEY: ... +def RegOverridePredefKey(Key: _win32typing.PyHKEY, NewKey: _win32typing.PyHKEY) -> None: ... +def RegQueryValue(key: _win32typing.PyHKEY, subKey: str) -> str: ... +def RegQueryValueEx(__key: _win32typing.PyHKEY | int, __valueName: str | None) -> tuple[str, int]: ... +def RegQueryInfoKey(key: _win32typing.PyHKEY) -> tuple[Incomplete, Incomplete, Incomplete]: ... +def RegQueryInfoKeyW(Key: _win32typing.PyHKEY): ... +def RegRestoreKey(Key: _win32typing.PyHKEY, File: str, Flags: int = ...) -> None: ... +def RegSaveKey(key: _win32typing.PyHKEY, filename: str, sa: _win32typing.PySECURITY_ATTRIBUTES | None = ...) -> None: ... +def RegSaveKeyEx( + Key: _win32typing.PyHKEY, File: str, Flags, SecurityAttributes: _win32typing.PySECURITY_ATTRIBUTES | None = ... +) -> None: ... +def RegSetKeySecurity(key: _win32typing.PyHKEY, security_info, sd: _win32typing.PySECURITY_DESCRIPTOR) -> None: ... +def RegSetValue(key: _win32typing.PyHKEY, subKey: str | None, _type, value: str) -> None: ... +def RegSetValueEx(key: _win32typing.PyHKEY, valueName: str, reserved, _type, value) -> None: ... +def RegUnLoadKey(key: _win32typing.PyHKEY, subKey: str) -> None: ... +def RegisterWindowMessage(msgString: str) -> None: ... +def RegNotifyChangeKeyValue(key: _win32typing.PyHKEY, bWatchSubTree, dwNotifyFilter, hKey: int, fAsynchronous) -> None: ... +def SearchPath(path: str, fileName: str, fileExt: str | None = ...): ... +def SendMessage(hwnd: int, idMessage, wParam: str | None = ..., lParam: str | None = ...) -> None: ... +def SetConsoleCtrlHandler(__ctrlHandler: Callable[[int], bool], __bAdd: bool) -> None: ... +def SetConsoleTitle(title: str) -> None: ... +def SetCursorPos(arg: tuple[Incomplete, Incomplete]) -> None: ... +def SetDllDirectory(PathName: str) -> None: ... +def SetErrorMode(errorMode): ... +def SetFileAttributes(pathName: str, attrs): ... +def SetLastError(): ... +def SetSysColors(Elements, RgbValues) -> None: ... +def SetLocalTime(SystemTime: _win32typing.PyTime) -> None: ... +def SetSystemTime(year, month, dayOfWeek, day, hour, minute, second, millseconds): ... +def SetClassLong(hwnd: int, offset, val): ... +def SetClassWord(hwnd: int, offset, val): ... +def SetCursor(hCursor: int) -> int: ... +def SetEnvironmentVariable(Name, Value) -> None: ... +def SetEnvironmentVariableW(Name, Value) -> None: ... +def SetHandleInformation(Object: int, Mask, Flags) -> None: ... +def SetStdHandle(handle, handle1: int) -> None: ... +def SetSystemPowerState(Suspend, Force) -> None: ... +def SetThreadLocale(lcid) -> None: ... +def SetTimeZoneInformation(tzi): ... +def SetWindowLong(__hwnd: int | None, __offset: int, __value: float) -> int: ... +def ShellExecute(hwnd: int, op: str, file: str, params: str, _dir: str, bShow): ... +def ShowCursor(show): ... +def Sleep(time, bAlterable: int = ...): ... +def TerminateProcess(__handle: int, __exitCode: int) -> None: ... +def ToAsciiEx(vk, scancode, keyboardstate, flags: int = ..., hlayout: Incomplete | None = ...): ... +def Unicode() -> str: ... +def UpdateResource( + __handle: int, + __type: _win32typing.PyResourceId | int, + __name: _win32typing.PyResourceId | int, + __data: ReadableBuffer | None, + language: int = ..., +) -> None: ... +def VkKeyScan(char, char1): ... +def WinExec(cmdLine: str, arg) -> None: ... +def WinHelp(hwnd: int, hlpFile: str, cmd, data: str | int = ...) -> None: ... +def WriteProfileSection(section: str, data: str, iniName: str | None = ...): ... +def WriteProfileVal(section: str, entry: str, value: str, iniName: str | None = ...) -> None: ... +def HIBYTE(val): ... +def LOBYTE(val): ... +def HIWORD(val): ... +def LOWORD(val): ... +def RGB(red, green, blue): ... +def MAKELANGID(PrimaryLanguage, SubLanguage): ... +def MAKEWORD(low, high): ... +def MAKELONG(low, high): ... +def CommandLineToArgv(*args, **kwargs): ... # incomplete +def GetKeyboardLayoutList(*args, **kwargs): ... # incomplete +def MapVirtualKey(*args, **kwargs): ... # incomplete +def MessageBoxEx(*args, **kwargs): ... # incomplete +def OpenThread(*args, **kwargs): ... # incomplete +def SleepEx(*args, **kwargs): ... # incomplete +def VkKeyScanEx(*args, **kwargs): ... # incomplete + +NameCanonical: int +NameCanonicalEx: int +NameDisplay: int +NameFullyQualifiedDN: int +NameSamCompatible: int +NameServicePrincipal: int +NameUniqueId: int +NameUnknown: int +NameUserPrincipal: int +PyDISPLAY_DEVICEType = _win32typing.PyDISPLAY_DEVICE +REG_NOTIFY_CHANGE_ATTRIBUTES: int +REG_NOTIFY_CHANGE_LAST_SET: int +REG_NOTIFY_CHANGE_NAME: int +REG_NOTIFY_CHANGE_SECURITY: int +STD_ERROR_HANDLE: int +STD_INPUT_HANDLE: int +STD_OUTPUT_HANDLE: int +VFT_APP: int +VFT_DLL: int +VFT_DRV: int +VFT_FONT: int +VFT_STATIC_LIB: int +VFT_UNKNOWN: int +VFT_VXD: int +VOS_DOS: int +VOS_DOS_WINDOWS16: int +VOS_DOS_WINDOWS32: int +VOS_NT: int +VOS_NT_WINDOWS32: int +VOS_OS216: int +VOS_OS216_PM16: int +VOS_OS232: int +VOS_OS232_PM32: int +VOS_UNKNOWN: int +VOS__PM16: int +VOS__PM32: int +VOS__WINDOWS16: int +VOS__WINDOWS32: int +VS_FF_DEBUG: int +VS_FF_INFOINFERRED: int +VS_FF_PATCHED: int +VS_FF_PRERELEASE: int +VS_FF_PRIVATEBUILD: int +VS_FF_SPECIALBUILD: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32clipboard.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32clipboard.pyi new file mode 100644 index 000000000..5fbc2c402 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32clipboard.pyi @@ -0,0 +1,47 @@ +from win32.lib.pywintypes import error as error + +def ChangeClipboardChain(hWndRemove: int, hWndNewNext: int): ... +def CloseClipboard(): ... +def CountClipboardFormats(): ... +def EmptyClipboard(): ... +def EnumClipboardFormats(_format: int = ...): ... +def GetClipboardData(_format) -> str: ... +def GetClipboardDataHandle(_format): ... +def GetClipboardFormatName(_format) -> str: ... +def GetClipboardOwner(): ... +def GetClipboardSequenceNumber(): ... +def GetClipboardViewer(): ... +def GetGlobalMemory(hglobal: int) -> str: ... +def GetOpenClipboardWindow(): ... +def GetPriorityClipboardFormat(formats): ... +def IsClipboardFormatAvailable(__format: int) -> int: ... +def OpenClipboard(hWnd: int | None = ...): ... +def RegisterClipboardFormat(name: str): ... +def SetClipboardData(_format, hMem): ... +def SetClipboardText(text, _format): ... +def SetClipboardViewer(hWndNewViewer: int) -> int: ... + +CF_BITMAP: int +CF_DIB: int +CF_DIBV5: int +CF_DIF: int +CF_DSPBITMAP: int +CF_DSPENHMETAFILE: int +CF_DSPMETAFILEPICT: int +CF_DSPTEXT: int +CF_ENHMETAFILE: int +CF_HDROP: int +CF_LOCALE: int +CF_MAX: int +CF_METAFILEPICT: int +CF_OEMTEXT: int +CF_OWNERDISPLAY: int +CF_PALETTE: int +CF_PENDATA: int +CF_RIFF: int +CF_SYLK: int +CF_TEXT: int +CF_TIFF: int +CF_UNICODETEXT: int +CF_WAVE: int +UNICODE: bool diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32console.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32console.pyi new file mode 100644 index 000000000..e66038afe --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32console.pyi @@ -0,0 +1,74 @@ +import _win32typing +from win32.lib.pywintypes import error as error + +def CreateConsoleScreenBuffer( + DesiredAccess, ShareMode, Flags, SecurityAttributes: _win32typing.PySECURITY_ATTRIBUTES | None = ... +) -> _win32typing.PyConsoleScreenBuffer: ... +def GetConsoleDisplayMode(): ... +def AttachConsole(ProcessId) -> None: ... +def AllocConsole() -> None: ... +def FreeConsole() -> None: ... +def GetConsoleCP(): ... +def GetConsoleOutputCP(): ... +def SetConsoleCP(CodePageId) -> None: ... +def SetConsoleOutputCP(CodePageID) -> None: ... +def GetConsoleSelectionInfo(): ... +def AddConsoleAlias(Source, Target, ExeName) -> None: ... +def GetConsoleAliases(ExeName): ... +def GetConsoleAliasExes(): ... +def GetConsoleWindow(): ... +def GetNumberOfConsoleFonts(): ... +def SetConsoleTitle(ConsoleTitle) -> None: ... +def GetConsoleTitle(): ... +def GenerateConsoleCtrlEvent(__CtrlEvent: int, __ProcessGroupId: int = ...) -> None: ... +def GetStdHandle(__StdHandle: int) -> _win32typing.PyConsoleScreenBuffer: ... +def GetConsoleProcessList(*args, **kwargs): ... # incomplete + +ATTACH_PARENT_PROCESS: int +BACKGROUND_BLUE: int +BACKGROUND_GREEN: int +BACKGROUND_INTENSITY: int +BACKGROUND_RED: int +COMMON_LVB_GRID_HORIZONTAL: int +COMMON_LVB_GRID_LVERTICAL: int +COMMON_LVB_GRID_RVERTICAL: int +COMMON_LVB_LEADING_BYTE: int +COMMON_LVB_REVERSE_VIDEO: int +COMMON_LVB_TRAILING_BYTE: int +COMMON_LVB_UNDERSCORE: int +CONSOLE_FULLSCREEN: int +CONSOLE_FULLSCREEN_HARDWARE: int +CONSOLE_FULLSCREEN_MODE: int +CONSOLE_MOUSE_DOWN: int +CONSOLE_MOUSE_SELECTION: int +CONSOLE_NO_SELECTION: int +CONSOLE_SELECTION_IN_PROGRESS: int +CONSOLE_SELECTION_NOT_EMPTY: int +CONSOLE_TEXTMODE_BUFFER: int +CONSOLE_WINDOWED_MODE: int +CTRL_BREAK_EVENT: int +CTRL_C_EVENT: int +ENABLE_ECHO_INPUT: int +ENABLE_LINE_INPUT: int +ENABLE_MOUSE_INPUT: int +ENABLE_PROCESSED_INPUT: int +ENABLE_PROCESSED_OUTPUT: int +ENABLE_WINDOW_INPUT: int +ENABLE_WRAP_AT_EOL_OUTPUT: int +FOCUS_EVENT: int +FOREGROUND_BLUE: int +FOREGROUND_GREEN: int +FOREGROUND_INTENSITY: int +FOREGROUND_RED: int +KEY_EVENT: int +LOCALE_USER_DEFAULT: int +MENU_EVENT: int +MOUSE_EVENT: int +PyCOORDType = _win32typing.PyCOORD +PyConsoleScreenBufferType = _win32typing.PyConsoleScreenBuffer +PyINPUT_RECORDType = _win32typing.PyINPUT_RECORD +PySMALL_RECTType = _win32typing.PySMALL_RECT +STD_ERROR_HANDLE: int +STD_INPUT_HANDLE: int +STD_OUTPUT_HANDLE: int +WINDOW_BUFFER_SIZE_EVENT: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32cred.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32cred.pyi new file mode 100644 index 000000000..a915399d0 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32cred.pyi @@ -0,0 +1,85 @@ +from _typeshed import Incomplete + +def CredMarshalCredential(CredType, Credential: str) -> str: ... +def CredUnmarshalCredential(MarshaledCredential: str) -> tuple[Incomplete, str]: ... +def CredIsMarshaledCredential(MarshaledCredential: str): ... +def CredEnumerate(Filter: str | None = ..., Flags: int = ...) -> tuple[Incomplete, ...]: ... +def CredGetTargetInfo(TargetName: str, Flags: int = ...): ... +def CredWriteDomainCredentials(TargetInfo, Credential, Flags: int = ...) -> None: ... +def CredReadDomainCredentials(TargetInfo, Flags: int = ...) -> tuple[Incomplete, ...]: ... +def CredDelete(TargetName: str, Type, Flags: int = ...) -> None: ... +def CredWrite(Credential, Flags: int = ...) -> None: ... +def CredRead(TargetName: str, Type, Flags: int = ...): ... +def CredRename(OldTargetName: str, NewTargetName: str, Type, Flags: int = ...): ... +def CredUICmdLinePromptForCredentials( + TargetName: str, Flags, AuthError: int = ..., UserName: str | None = ..., Password: str | None = ..., Save: int = ... +) -> tuple[str, str, Incomplete]: ... +def CredUIPromptForCredentials( + TargetName: str, + AuthError: int = ..., + UserName: str | None = ..., + Password: str | None = ..., + Save: bool = ..., + Flags: int = ..., + UiInfo: Incomplete | None = ..., +) -> tuple[str, str, Incomplete]: ... +def CredUIConfirmCredentials(TargetName: str, Confirm) -> None: ... +def CredUIReadSSOCredW(Realm: str | None = ...) -> str: ... +def CredUIStoreSSOCredW(Realm: str, Username: str, Password: str, Persist) -> None: ... +def CredUIParseUserName(UserName: str) -> tuple[str, str]: ... + +CREDUI_FLAGS_ALWAYS_SHOW_UI: int +CREDUI_FLAGS_COMPLETE_USERNAME: int +CREDUI_FLAGS_DO_NOT_PERSIST: int +CREDUI_FLAGS_EXCLUDE_CERTIFICATES: int +CREDUI_FLAGS_EXPECT_CONFIRMATION: int +CREDUI_FLAGS_GENERIC_CREDENTIALS: int +CREDUI_FLAGS_INCORRECT_PASSWORD: int +CREDUI_FLAGS_KEEP_USERNAME: int +CREDUI_FLAGS_PASSWORD_ONLY_OK: int +CREDUI_FLAGS_PERSIST: int +CREDUI_FLAGS_PROMPT_VALID: int +CREDUI_FLAGS_REQUEST_ADMINISTRATOR: int +CREDUI_FLAGS_REQUIRE_CERTIFICATE: int +CREDUI_FLAGS_REQUIRE_SMARTCARD: int +CREDUI_FLAGS_SERVER_CREDENTIAL: int +CREDUI_FLAGS_SHOW_SAVE_CHECK_BOX: int +CREDUI_FLAGS_USERNAME_TARGET_CREDENTIALS: int +CREDUI_FLAGS_VALIDATE_USERNAME: int +CREDUI_MAX_CAPTION_LENGTH: int +CREDUI_MAX_DOMAIN_TARGET_LENGTH: int +CREDUI_MAX_GENERIC_TARGET_LENGTH: int +CREDUI_MAX_MESSAGE_LENGTH: int +CREDUI_MAX_PASSWORD_LENGTH: int +CREDUI_MAX_USERNAME_LENGTH: int +CRED_ALLOW_NAME_RESOLUTION: int +CRED_CACHE_TARGET_INFORMATION: int +CRED_FLAGS_OWF_CRED_BLOB: int +CRED_FLAGS_PASSWORD_FOR_CERT: int +CRED_FLAGS_PROMPT_NOW: int +CRED_FLAGS_USERNAME_TARGET: int +CRED_FLAGS_VALID_FLAGS: int +CRED_MAX_ATTRIBUTES: int +CRED_MAX_DOMAIN_TARGET_NAME_LENGTH: int +CRED_MAX_GENERIC_TARGET_NAME_LENGTH: int +CRED_MAX_STRING_LENGTH: int +CRED_MAX_USERNAME_LENGTH: int +CRED_MAX_VALUE_SIZE: int +CRED_PERSIST_ENTERPRISE: int +CRED_PERSIST_LOCAL_MACHINE: int +CRED_PERSIST_NONE: int +CRED_PERSIST_SESSION: int +CRED_PRESERVE_CREDENTIAL_BLOB: int +CRED_TI_CREATE_EXPLICIT_CRED: int +CRED_TI_DOMAIN_FORMAT_UNKNOWN: int +CRED_TI_ONLY_PASSWORD_REQUIRED: int +CRED_TI_SERVER_FORMAT_UNKNOWN: int +CRED_TI_USERNAME_TARGET: int +CRED_TI_VALID_FLAGS: int +CRED_TI_WORKGROUP_MEMBER: int +CRED_TYPE_DOMAIN_CERTIFICATE: int +CRED_TYPE_DOMAIN_PASSWORD: int +CRED_TYPE_DOMAIN_VISIBLE_PASSWORD: int +CRED_TYPE_GENERIC: int +CertCredential: int +UsernameTargetCredential: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32crypt.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32crypt.pyi new file mode 100644 index 000000000..9a5d44277 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32crypt.pyi @@ -0,0 +1,100 @@ +from _typeshed import Incomplete + +import _win32typing + +def CryptProtectData( + DataIn, + DataDescr: str | None = ..., + OptionalEntropy: Incomplete | None = ..., + Reserved: Incomplete | None = ..., + PromptStruct: _win32typing.PyCRYPTPROTECT_PROMPTSTRUCT | None = ..., + Flags: int = ..., +): ... +def CryptUnprotectData( + DataIn, + OptionalEntropy: Incomplete | None = ..., + Reserved: Incomplete | None = ..., + PromptStruct: _win32typing.PyCRYPTPROTECT_PROMPTSTRUCT | None = ..., + Flags: int = ..., +) -> tuple[Incomplete, Incomplete]: ... +def CryptEnumProviders() -> list[tuple[str, Incomplete]]: ... +def CryptEnumProviderTypes() -> list[tuple[str, Incomplete]]: ... +def CryptGetDefaultProvider(ProvType, Flags) -> str: ... +def CryptSetProviderEx(ProvName: str, ProvType, Flags) -> None: ... +def CryptAcquireContext(Container: str, Provider: str, ProvType, Flags) -> _win32typing.PyCRYPTPROV: ... +def CryptFindLocalizedName(CryptName: str) -> str: ... +def CertEnumSystemStore(dwFlags, pvSystemStoreLocationPara: Incomplete | None = ...) -> list[Incomplete]: ... +def CertEnumSystemStoreLocation(Flags: int = ...) -> list[Incomplete]: ... +def CertEnumPhysicalStore(pvSystemStore: str, dwFlags) -> list[Incomplete]: ... +def CertRegisterSystemStore(SystemStore: str, Flags) -> None: ... +def CertUnregisterSystemStore(SystemStore: str, Flags) -> None: ... +def CertOpenStore( + StoreProvider, MsgAndCertEncodingType, CryptProv: _win32typing.PyCRYPTPROV, Flags, Para: Incomplete | None = ... +) -> _win32typing.PyCERTSTORE: ... +def CertOpenSystemStore(SubsystemProtocol: str, Prov: _win32typing.PyCRYPTPROV | None = ...) -> _win32typing.PyCERTSTORE: ... +def CryptFindOIDInfo(KeyType, Key, GroupId: int = ...): ... +def CertAlgIdToOID(AlgId) -> str: ... +def CertOIDToAlgId(ObjId: str): ... +def CryptGetKeyIdentifierProperty(KeyIdentifier: str, PropId, Flags: int = ..., ComputerName: str | None = ...): ... +def CryptEnumKeyIdentifierProperties( + KeyIdentifier: str | None = ..., PropId: int = ..., Flags: int = ..., ComputerName: str | None = ... +): ... +def CryptEnumOIDInfo(GroupId: int = ...): ... +def CertAddSerializedElementToStore( + CertStore: _win32typing.PyCERTSTORE, Element, AddDisposition, ContextTypeFlags, Flags: int = ... +) -> _win32typing.PyCERT_CONTEXT: ... +def CryptQueryObject(ObjectType, Object, ExpectedContentTypeFlags, ExpectedFormatTypeFlags, Flags: int = ...): ... +def CryptDecodeMessage( + EncodedBlob, + DecryptPara, + MsgTypeFlags, + VerifyPara: Incomplete | None = ..., + SignerIndex: int = ..., + PrevInnerContentType: int = ..., + ReturnData: bool = ..., +): ... +def CryptEncryptMessage( + EncryptPara: _win32typing.PyCRYPT_ENCRYPT_MESSAGE_PARA, RecipientCert: tuple[_win32typing.PyCERT_CONTEXT, ...], ToBeEncrypted +): ... +def CryptDecryptMessage( + DecryptPara: _win32typing.PyCRYPT_DECRYPT_MESSAGE_PARA, EncryptedBlob +) -> tuple[Incomplete, _win32typing.PyCERT_CONTEXT]: ... +def CryptSignAndEncryptMessage( + SignPara: _win32typing.PyCRYPT_SIGN_MESSAGE_PARA, + EncryptPara: _win32typing.PyCRYPT_ENCRYPT_MESSAGE_PARA, + RecipientCert: tuple[_win32typing.PyCERT_CONTEXT, ...], + ToBeSignedAndEncrypted, +): ... +def CryptVerifyMessageSignature( + SignedBlob, SignerIndex: int = ..., VerifyPara: _win32typing.PyCRYPT_VERIFY_MESSAGE_PARA | None = ..., ReturnData: bool = ... +) -> tuple[_win32typing.PyCERT_CONTEXT, Incomplete]: ... +def CryptGetMessageCertificates( + SignedBlob, MsgAndCertEncodingType, CryptProv: _win32typing.PyCRYPTPROV | None = ..., Flags: int = ... +) -> _win32typing.PyCERTSTORE: ... +def CryptGetMessageSignerCount(SignedBlob, MsgEncodingType): ... +def CryptSignMessage( + SignPara: _win32typing.PyCRYPT_SIGN_MESSAGE_PARA, ToBeSigned: tuple[Incomplete, ...], DetachedSignature: bool = ... +): ... +def CryptVerifyDetachedMessageSignature( + SignerIndex, + DetachedSignBlob, + ToBeSigned: tuple[Incomplete, ...], + VerifyPara: _win32typing.PyCRYPT_VERIFY_MESSAGE_PARA | None = ..., +) -> _win32typing.PyCERT_CONTEXT: ... +def CryptDecryptAndVerifyMessageSignature( + EncryptedBlob, + DecryptPara: _win32typing.PyCRYPT_DECRYPT_MESSAGE_PARA, + VerifyPara: _win32typing.PyCRYPT_VERIFY_MESSAGE_PARA | None = ..., + SignerIndex: int = ..., +): ... +def CryptEncodeObjectEx(StructType, StructInfo, CertEncodingType, Flags: int = ..., EncodePara: Incomplete | None = ...): ... +def CryptDecodeObjectEx(StructType, Encoded, CertEncodingType, Flags: int = ..., DecodePara: Incomplete | None = ...): ... +def CertNameToStr(Name, StrType, CertEncodingType): ... +def CryptFormatObject( + StructType, Encoded, CertEncodingType, FormatStrType: int = ..., FormatType: int = ..., FormatStruct: Incomplete | None = ... +): ... +def PFXImportCertStore(PFX, Password, Flags) -> _win32typing.PyCERTSTORE: ... +def PFXVerifyPassword(PFX, Password, Flags): ... +def PFXIsPFXBlob(PFX): ... +def CryptBinaryToString(Binary, Flags): ... +def CryptStringToBinary(String, Flags) -> tuple[Incomplete, Incomplete, Incomplete]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32event.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32event.pyi new file mode 100644 index 000000000..344afc119 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32event.pyi @@ -0,0 +1,71 @@ +from collections.abc import Iterable + +import _win32typing +from win32.lib.pywintypes import error as error + +def CancelWaitableTimer() -> None: ... +def CreateEvent( + __EventAttributes: _win32typing.PySECURITY_ATTRIBUTES | None, + __bManualReset: int | bool, + __bInitialState: int | bool, + __Name: str | None, +) -> int: ... +def CreateMutex(MutexAttributes: _win32typing.PySECURITY_ATTRIBUTES, InitialOwner, Name: str) -> int: ... +def CreateSemaphore( + SemaphoreAttributes: _win32typing.PySECURITY_ATTRIBUTES, InitialCount, MaximumCount, SemaphoreName +) -> int: ... +def CreateWaitableTimer(TimerAttributes: _win32typing.PySECURITY_ATTRIBUTES, ManualReset, TimerName) -> int: ... +def CreateWaitableTimerEx( + __lpTimerAttributes: _win32typing.PySECURITY_ATTRIBUTES | None, + __lpTimerName: str | None, + __dwFlags: int, + __dwDesiredAccess: int, +) -> _win32typing.PyHANDLE: ... +def MsgWaitForMultipleObjects(__handlelist: Iterable[int], __bWaitAll: int, __milliseconds: int, __wakeMask: int) -> int: ... +def MsgWaitForMultipleObjectsEx(handlelist: list[int], milliseconds, wakeMask, waitFlags): ... +def OpenEvent(desiredAccess, bInheritHandle, name: str) -> int: ... +def OpenMutex(desiredAccess, bInheritHandle, name: str) -> int: ... +def OpenSemaphore(desiredAccess, bInheritHandle, name: str) -> int: ... +def OpenWaitableTimer(desiredAccess, bInheritHandle, timerName) -> int: ... +def PulseEvent(hEvent: int) -> None: ... +def ReleaseMutex(hEvent: int) -> None: ... +def ReleaseSemaphore(hEvent: int, lReleaseCount): ... +def ResetEvent(__hEvent: int) -> None: ... +def SetEvent(__hEvent: int) -> None: ... +def SetWaitableTimer(handle: int, dueTime, period, func, param, resume_state) -> None: ... +def WaitForMultipleObjects(handlelist: list[int], bWaitAll, milliseconds): ... +def WaitForMultipleObjectsEx(handlelist: list[int], bWaitAll, milliseconds, bAlertable): ... +def WaitForSingleObject(__hHandle: int, __milliseconds: int) -> int: ... +def WaitForSingleObjectEx(hHandle: int, milliseconds, bAlertable): ... +def WaitForInputIdle(hProcess: int, milliseconds): ... +def SignalObjectAndWait(*args, **kwargs): ... # incomplete + +CREATE_WAITABLE_TIMER_HIGH_RESOLUTION: int +CREATE_WAITABLE_TIMER_MANUAL_RESET: int +EVENT_ALL_ACCESS: int +EVENT_MODIFY_STATE: int +INFINITE: int +MAXIMUM_WAIT_OBJECTS: int +QS_ALLEVENTS: int +QS_ALLINPUT: int +QS_HOTKEY: int +QS_INPUT: int +QS_KEY: int +QS_MOUSE: int +QS_MOUSEBUTTON: int +QS_MOUSEMOVE: int +QS_PAINT: int +QS_POSTMESSAGE: int +QS_SENDMESSAGE: int +QS_TIMER: int +SYNCHRONIZE: int +TIMER_ALL_ACCESS: int +TIMER_MODIFY_STATE: int +TIMER_QUERY_STATE: int +WAIT_ABANDONED: int +WAIT_ABANDONED_0: int +WAIT_FAILED: int +WAIT_IO_COMPLETION: int +WAIT_OBJECT_0: int +WAIT_TIMEOUT: int +UNICODE: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32evtlog.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32evtlog.pyi new file mode 100644 index 000000000..bf2823980 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32evtlog.pyi @@ -0,0 +1,271 @@ +from _typeshed import Incomplete +from collections.abc import Iterable + +import _win32typing +from win32.lib.pywintypes import error as error + +def ReadEventLog( + __Handle: _win32typing.PyEVTLOG_HANDLE, __Flags: int, __Offset: int, Size=... +) -> list[_win32typing.PyEventLogRecord]: ... +def ClearEventLog(handle: _win32typing.PyEVTLOG_HANDLE, eventLogName: str) -> None: ... +def BackupEventLog(handle, eventLogName: str) -> None: ... +def CloseEventLog(__handle: _win32typing.PyEVTLOG_HANDLE) -> None: ... +def DeregisterEventSource(handle) -> None: ... +def NotifyChangeEventLog(handle, handle1) -> None: ... +def GetNumberOfEventLogRecords(handle: _win32typing.PyEVTLOG_HANDLE) -> int: ... +def GetOldestEventLogRecord(): ... +def OpenEventLog(__serverName: str | None, __sourceName: str) -> _win32typing.PyEVTLOG_HANDLE: ... +def RegisterEventSource(__serverName: str | None, __sourceName: str): ... +def OpenBackupEventLog(serverName: str, fileName: str) -> _win32typing.PyEVTLOG_HANDLE: ... +def ReportEvent( + __EventLog: int, + __Type: int, + __Category: int, + __EventID: int, + __UserSid: _win32typing.PySID | None, + __Strings: Iterable[str] | None, + __RawData: bytes | None, +) -> None: ... +def EvtOpenChannelEnum(Session: _win32typing.PyEVT_HANDLE | None = ..., Flags: int = ...) -> _win32typing.PyEVT_HANDLE: ... +def EvtNextChannelPath(ChannelEnum: _win32typing.PyEVT_HANDLE): ... +def EvtOpenLog(Path, Flags, Session: _win32typing.PyEVT_HANDLE | None = ...) -> _win32typing.PyEVT_HANDLE: ... +def EvtClearLog( + ChannelPath, TargetFilePath: Incomplete | None = ..., Session: _win32typing.PyEVT_HANDLE | None = ..., Flags: int = ... +) -> None: ... +def EvtExportLog( + Path, TargetFilePath, Flags, Query: Incomplete | None = ..., Session: _win32typing.PyEVT_HANDLE | None = ... +) -> None: ... +def EvtArchiveExportedLog(LogFilePath, Locale, Session: _win32typing.PyEVT_HANDLE | None = ..., Flags=...) -> None: ... +def EvtGetExtendedStatus(): ... +def EvtQuery( + __Path: str, __Flags: int, __Query: str | None = ..., __Session: _win32typing.PyEVT_HANDLE | None = ... +) -> _win32typing.PyEVT_HANDLE: ... +def EvtNext( + __ResultSet: _win32typing.PyEVT_HANDLE, __Count: int, __Timeout: int = ..., __Flags: int = ... +) -> tuple[_win32typing.PyEVT_HANDLE, ...]: ... +def EvtSeek( + ResultSet: _win32typing.PyEVT_HANDLE, Position, Flags, Bookmark: _win32typing.PyEVT_HANDLE | None = ..., Timeout: int = ... +) -> None: ... +def EvtRender(__Event: _win32typing.PyEVT_HANDLE, __Flags: int, Context=...): ... +def EvtSubscribe( + ChannelPath, + Flags, + SignalEvent: Incomplete | None = ..., + Callback: Incomplete | None = ..., + Context: Incomplete | None = ..., + Query: Incomplete | None = ..., + Session: _win32typing.PyEVT_HANDLE | None = ..., + Bookmark: _win32typing.PyEVT_HANDLE | None = ..., +) -> _win32typing.PyEVT_HANDLE: ... +def EvtCreateBookmark(BookmarkXML: Incomplete | None = ...) -> _win32typing.PyEVT_HANDLE: ... +def EvtUpdateBookmark(Bookmark: _win32typing.PyEVT_HANDLE, Event: _win32typing.PyEVT_HANDLE) -> _win32typing.PyEVT_HANDLE: ... +def EvtGetChannelConfigProperty( + ChannelConfig: _win32typing.PyEVT_HANDLE, PropertyId, Flags=... +) -> tuple[Incomplete, Incomplete]: ... +def EvtOpenChannelConfig( + ChannelPath, Session: _win32typing.PyEVT_HANDLE | None = ..., Flags=... +) -> _win32typing.PyEVT_HANDLE: ... +def EvtOpenSession( + Login: _win32typing.PyEVT_RPC_LOGIN, LoginClass, Timeout: int = ..., Flags=... +) -> _win32typing.PyEVT_HANDLE: ... +def EvtOpenPublisherEnum(Session: _win32typing.PyEVT_HANDLE | None = ..., Flags: int = ...) -> _win32typing.PyEVT_HANDLE: ... +def EvtNextPublisherId(PublisherEnum: _win32typing.PyEVT_HANDLE): ... +def EvtOpenPublisherMetadata( + PublisherIdentity, + Session: _win32typing.PyEVT_HANDLE | None = ..., + LogFilePath: Incomplete | None = ..., + Locale: int = ..., + Flags: int = ..., +) -> _win32typing.PyEVT_HANDLE: ... +def EvtGetPublisherMetadataProperty( + PublisherMetadata: _win32typing.PyEVT_HANDLE, PropertyId, Flags=... +) -> tuple[Incomplete, Incomplete]: ... +def EvtOpenEventMetadataEnum(PublisherMetadata: _win32typing.PyEVT_HANDLE, Flags=...) -> _win32typing.PyEVT_HANDLE: ... +def EvtNextEventMetadata(EventMetadataEnum: _win32typing.PyEVT_HANDLE, Flags=...) -> _win32typing.PyEVT_HANDLE: ... +def EvtGetEventMetadataProperty( + EventMetadata: _win32typing.PyEVT_HANDLE, PropertyId, Flags=... +) -> tuple[Incomplete, Incomplete]: ... +def EvtGetLogInfo(Log: _win32typing.PyEVT_HANDLE, PropertyId) -> tuple[Incomplete, Incomplete]: ... +def EvtGetEventInfo(Event: _win32typing.PyEVT_HANDLE, PropertyId) -> tuple[Incomplete, Incomplete]: ... +def EvtGetObjectArraySize(ObjectArray: _win32typing.PyEVT_HANDLE): ... +def EvtGetObjectArrayProperty( + ObjectArray: _win32typing.PyEVT_HANDLE, PropertyId, ArrayIndex, Flags=... +) -> tuple[Incomplete, Incomplete]: ... +def EvtCreateRenderContext(*args, **kwargs): ... # incomplete +def EvtFormatMessage(*args, **kwargs): ... # incomplete + +EVENTLOG_AUDIT_FAILURE: int +EVENTLOG_AUDIT_SUCCESS: int +EVENTLOG_BACKWARDS_READ: int +EVENTLOG_END_ALL_PAIRED_EVENTS: int +EVENTLOG_END_PAIRED_EVENT: int +EVENTLOG_ERROR_TYPE: int +EVENTLOG_FORWARDS_READ: int +EVENTLOG_INFORMATION_TYPE: int +EVENTLOG_PAIRED_EVENT_ACTIVE: int +EVENTLOG_PAIRED_EVENT_INACTIVE: int +EVENTLOG_SEEK_READ: int +EVENTLOG_SEQUENTIAL_READ: int +EVENTLOG_START_PAIRED_EVENT: int +EVENTLOG_SUCCESS: int +EVENTLOG_WARNING_TYPE: int +EventMetadataEventChannel: int +EventMetadataEventID: int +EventMetadataEventKeyword: int +EventMetadataEventLevel: int +EventMetadataEventMessageID: int +EventMetadataEventOpcode: int +EventMetadataEventTask: int +EventMetadataEventTemplate: int +EventMetadataEventVersion: int +EvtChannelConfigAccess: int +EvtChannelConfigClassicEventlog: int +EvtChannelConfigEnabled: int +EvtChannelConfigIsolation: int +EvtChannelConfigOwningPublisher: int +EvtChannelConfigPropertyIdEND: int +EvtChannelConfigType: int +EvtChannelLoggingConfigAutoBackup: int +EvtChannelLoggingConfigLogFilePath: int +EvtChannelLoggingConfigMaxSize: int +EvtChannelLoggingConfigRetention: int +EvtChannelPublishingConfigBufferSize: int +EvtChannelPublishingConfigClockType: int +EvtChannelPublishingConfigControlGuid: int +EvtChannelPublishingConfigKeywords: int +EvtChannelPublishingConfigLatency: int +EvtChannelPublishingConfigLevel: int +EvtChannelPublishingConfigMaxBuffers: int +EvtChannelPublishingConfigMinBuffers: int +EvtChannelPublishingConfigSidType: int +EvtEventMetadataPropertyIdEND: int +EvtEventPath: int +EvtEventPropertyIdEND: int +EvtEventQueryIDs: int +EvtExportLogChannelPath: int +EvtExportLogFilePath: int +EvtExportLogTolerateQueryErrors: int +EvtLogAttributes: int +EvtLogCreationTime: int +EvtLogFileSize: int +EvtLogFull: int +EvtLogLastAccessTime: int +EvtLogLastWriteTime: int +EvtLogNumberOfLogRecords: int +EvtLogOldestRecordNumber: int +EvtOpenChannelPath: int +EvtOpenFilePath: int +EvtPublisherMetadataChannelReferenceFlags: int +EvtPublisherMetadataChannelReferenceID: int +EvtPublisherMetadataChannelReferenceIndex: int +EvtPublisherMetadataChannelReferenceMessageID: int +EvtPublisherMetadataChannelReferencePath: int +EvtPublisherMetadataChannelReferences: int +EvtPublisherMetadataHelpLink: int +EvtPublisherMetadataKeywordMessageID: int +EvtPublisherMetadataKeywordName: int +EvtPublisherMetadataKeywords: int +EvtPublisherMetadataKeywordValue: int +EvtPublisherMetadataLevelMessageID: int +EvtPublisherMetadataLevelName: int +EvtPublisherMetadataLevels: int +EvtPublisherMetadataLevelValue: int +EvtPublisherMetadataMessageFilePath: int +EvtPublisherMetadataOpcodeMessageID: int +EvtPublisherMetadataOpcodeName: int +EvtPublisherMetadataOpcodes: int +EvtPublisherMetadataOpcodeValue: int +EvtPublisherMetadataParameterFilePath: int +EvtPublisherMetadataPropertyIdEND: int +EvtPublisherMetadataPublisherGuid: int +EvtPublisherMetadataPublisherMessageID: int +EvtPublisherMetadataResourceFilePath: int +EvtPublisherMetadataTaskEventGuid: int +EvtPublisherMetadataTaskMessageID: int +EvtPublisherMetadataTaskName: int +EvtPublisherMetadataTasks: int +EvtPublisherMetadataTaskValue: int +EvtQueryChannelPath: int +EvtQueryFilePath: int +EvtQueryForwardDirection: int +EvtQueryReverseDirection: int +EvtQueryTolerateQueryErrors: int +EvtRenderBookmark: int +EvtRenderEventValues: int +EvtRenderEventXml: int +EvtRpcLogin: int +EvtRpcLoginAuthDefault: int +EvtRpcLoginAuthKerberos: int +EvtRpcLoginAuthNegotiate: int +EvtRpcLoginAuthNTLM: int +EvtSeekOriginMask: int +EvtSeekRelativeToBookmark: int +EvtSeekRelativeToCurrent: int +EvtSeekRelativeToFirst: int +EvtSeekRelativeToLast: int +EvtSeekStrict: int +EvtSubscribeActionDeliver: int +EvtSubscribeActionError: int +EvtSubscribeOriginMask: int +EvtSubscribeStartAfterBookmark: int +EvtSubscribeStartAtOldestRecord: int +EvtSubscribeStrict: int +EvtSubscribeToFutureEvents: int +EvtSubscribeTolerateQueryErrors: int +EvtVarTypeAnsiString: int +EvtVarTypeBinary: int +EvtVarTypeBoolean: int +EvtVarTypeByte: int +EvtVarTypeDouble: int +EvtVarTypeEvtHandle: int +EvtVarTypeEvtXml: int +EvtVarTypeFileTime: int +EvtVarTypeGuid: int +EvtVarTypeHexInt32: int +EvtVarTypeHexInt64: int +EvtVarTypeInt16: int +EvtVarTypeInt32: int +EvtVarTypeInt64: int +EvtVarTypeNull: int +EvtVarTypeSByte: int +EvtVarTypeSid: int +EvtVarTypeSingle: int +EvtVarTypeSizeT: int +EvtVarTypeString: int +EvtVarTypeSysTime: int +EvtVarTypeUInt16: int +EvtVarTypeUInt32: int +EvtVarTypeUInt64: int +EvtChannelPublisherList: int +EvtFormatMessageChannel: int +EvtFormatMessageEvent: int +EvtFormatMessageId: int +EvtFormatMessageKeyword: int +EvtFormatMessageLevel: int +EvtFormatMessageOpcode: int +EvtFormatMessageProvider: int +EvtFormatMessageTask: int +EvtFormatMessageXml: int +EvtRenderContextSystem: int +EvtRenderContextUser: int +EvtRenderContextValues: int +EvtSystemActivityID: int +EvtSystemChannel: int +EvtSystemComputer: int +EvtSystemEventID: int +EvtSystemEventRecordId: int +EvtSystemKeywords: int +EvtSystemLevel: int +EvtSystemOpcode: int +EvtSystemProcessID: int +EvtSystemPropertyIdEND: int +EvtSystemProviderGuid: int +EvtSystemProviderName: int +EvtSystemQualifiers: int +EvtSystemRelatedActivityID: int +EvtSystemTask: int +EvtSystemThreadID: int +EvtSystemTimeCreated: int +EvtSystemUserID: int +EvtSystemVersion: int +UNICODE: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32file.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32file.pyi new file mode 100644 index 000000000..a66b91c93 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32file.pyi @@ -0,0 +1,447 @@ +from _typeshed import Incomplete +from socket import socket +from typing import overload + +import _win32typing +from win32.lib.pywintypes import error as error + +def AreFileApisANSI(): ... +def CancelIo(handle: int) -> None: ... +def CopyFile(_from: str, to: str, bFailIfExists) -> None: ... +def CopyFileW(_from: str, to: str, bFailIfExists) -> None: ... +def CreateDirectory(__name: str, __sa: _win32typing.PySECURITY_ATTRIBUTES) -> None: ... +def CreateDirectoryW(name: str, sa: _win32typing.PySECURITY_ATTRIBUTES) -> None: ... +def CreateDirectoryEx(templateName: str, newDirectory: str, sa: _win32typing.PySECURITY_ATTRIBUTES) -> None: ... +def CreateFile( + __fileName: str, + __desiredAccess: int, + __shareMode: int, + __attributes: _win32typing.PySECURITY_ATTRIBUTES | None, + __CreationDisposition: int, + __flagsAndAttributes: int, + __hTemplateFile: int | None, +) -> _win32typing.PyHANDLE: ... +def CreateIoCompletionPort(handle: int, existing: int, completionKey, numThreads) -> int: ... +def CreateMailslot(Name, MaxMessageSize, ReadTimeout, SecurityAttributes: _win32typing.PySECURITY_ATTRIBUTES) -> int: ... +def GetMailslotInfo(Mailslot: int) -> tuple[Incomplete, Incomplete, Incomplete, Incomplete]: ... +def SetMailslotInfo(Mailslot: int, ReadTimeout) -> None: ... +def DefineDosDevice(flags, deviceName: str, targetPath: str) -> None: ... +def DefineDosDeviceW(flags, deviceName: str, targetPath: str) -> None: ... +def DeleteFile(fileName: str) -> None: ... +def DeviceIoControl(Device: int, IoControlCode, InBuffer, OutBuffer, Overlapped: _win32typing.PyOVERLAPPED | None = ...): ... +def FindClose(hFindFile) -> None: ... +def FindCloseChangeNotification(hChangeHandle) -> None: ... +def FindFirstChangeNotification(pathName: str, bWatchSubtree, notifyFilter): ... +def FindNextChangeNotification(hChangeHandle): ... +def FlushFileBuffers(hFile: int) -> None: ... +def GetBinaryType(appName: str): ... +def GetDiskFreeSpace(rootPathName: str) -> tuple[Incomplete, Incomplete, Incomplete, Incomplete]: ... +def GetDiskFreeSpaceEx(__rootPathName: str) -> tuple[int, int, int]: ... +def GetDriveType(rootPathName: str): ... +def GetDriveTypeW(rootPathName: str): ... +def GetFileAttributes(fileName: str): ... +def GetFileAttributesW(fileName: str): ... +def GetFileTime( + handle: int, creationTime: _win32typing.PyTime, accessTime: _win32typing.PyTime, writeTime: _win32typing.PyTime +) -> tuple[_win32typing.PyTime, _win32typing.PyTime, _win32typing.PyTime]: ... +def SetFileTime( + File: int, + CreationTime: _win32typing.PyTime | None = ..., + LastAccessTime: _win32typing.PyTime | None = ..., + LastWriteTime: _win32typing.PyTime | None = ..., + UTCTimes: bool = ..., +) -> None: ... +def GetFileInformationByHandle(handle: int): ... +def GetCompressedFileSize(): ... +def GetFileSize(): ... +def AllocateReadBuffer(__bufSize: int) -> _win32typing.PyOVERLAPPEDReadBuffer: ... +@overload +def ReadFile(__hFile: int, __bufSize: int) -> tuple[int, str]: ... +@overload +def ReadFile( + __hFile: int, __buffer: _win32typing.PyOVERLAPPEDReadBuffer, __overlapped: _win32typing.PyOVERLAPPED | None +) -> tuple[int, str]: ... +def WriteFile( + __hFile: int, __data: str | bytes | _win32typing.PyOVERLAPPEDReadBuffer, __ol: _win32typing.PyOVERLAPPED | None = ... +) -> tuple[int, int]: ... +def CloseHandle(__handle: int) -> None: ... +def LockFileEx(hFile: int, _int, _int1, _int2, ol: _win32typing.PyOVERLAPPED | None = ...) -> None: ... +def UnlockFileEx(hFile: int, _int, _int1, ol: _win32typing.PyOVERLAPPED | None = ...) -> None: ... +def GetQueuedCompletionStatus(hPort: int, timeOut) -> tuple[Incomplete, Incomplete, Incomplete, _win32typing.PyOVERLAPPED]: ... +def PostQueuedCompletionStatus( + handle: int, numberOfbytes: int = ..., completionKey: int = ..., overlapped: _win32typing.PyOVERLAPPED | None = ... +): ... +def GetFileType(hFile: int): ... +def GetLogicalDrives(): ... +def GetOverlappedResult(__hFile: int, __overlapped: _win32typing.PyOVERLAPPED, __bWait: int | bool) -> int: ... +def LockFile(hFile: int, offsetLow, offsetHigh, nNumberOfBytesToLockLow, nNumberOfBytesToLockHigh) -> None: ... +def MoveFile(existingFileName: str, newFileName: str) -> None: ... +def MoveFileW(existingFileName: str, newFileName: str) -> None: ... +def MoveFileEx(existingFileName: str, newFileName: str, flags) -> None: ... +def MoveFileExW(existingFileName: str, newFileName: str, flags) -> None: ... +def QueryDosDevice(DeviceName: str) -> str: ... +def ReadDirectoryChangesW( + handle: int, size, bWatchSubtree, dwNotifyFilter, overlapped: _win32typing.PyOVERLAPPED | None = ... +) -> None: ... +def FILE_NOTIFY_INFORMATION(buffer: str, size) -> tuple[tuple[Incomplete, Incomplete], ...]: ... +def SetCurrentDirectory(lpPathName: str) -> None: ... +def SetEndOfFile(hFile: int) -> None: ... +def SetFileApisToANSI() -> None: ... +def SetFileApisToOEM() -> None: ... +def SetFileAttributes(__filename: str, __newAttributes: int) -> None: ... +def SetFilePointer(handle: int, offset, moveMethod) -> None: ... +def SetVolumeLabel(rootPathName: str, volumeName: str) -> None: ... +def UnlockFile(hFile: int, offsetLow, offsetHigh, nNumberOfBytesToUnlockLow, nNumberOfBytesToUnlockHigh) -> None: ... +def TransmitFile( + Socket, + File: int, + NumberOfBytesToWrite, + NumberOfBytesPerSend, + Overlapped: _win32typing.PyOVERLAPPED, + Flags, + Head: Incomplete | None = ..., + Tail: Incomplete | None = ..., +) -> None: ... +def ConnectEx( + s, name, Overlapped: _win32typing.PyOVERLAPPED, SendBuffer: Incomplete | None = ... +) -> tuple[Incomplete, Incomplete]: ... +def AcceptEx(slistening, sAccepting, buffer, ol: _win32typing.PyOVERLAPPED) -> None: ... +def CalculateSocketEndPointSize(socket): ... +def GetAcceptExSockaddrs( + sAccepting, buffer: _win32typing.PyOVERLAPPEDReadBuffer +) -> tuple[Incomplete, Incomplete, Incomplete]: ... +def WSAEventSelect(__socket: socket, __hEvent: int, __networkEvents: int) -> None: ... +def WSAEnumNetworkEvents(__s: socket, __hEvent: int) -> dict[int, int]: ... +def WSAAsyncSelect(socket, hwnd: int, _int, networkEvents) -> None: ... +def WSASend(s, buffer: str, ol: _win32typing.PyOVERLAPPED, dwFlags) -> tuple[Incomplete, Incomplete]: ... +def WSARecv(s, buffer, ol: _win32typing.PyOVERLAPPED, dwFlags) -> tuple[Incomplete, Incomplete]: ... +def BuildCommDCB(_def: str, dcb: _win32typing.PyDCB) -> _win32typing.PyDCB: ... +def ClearCommError(__handle: int) -> tuple[Incomplete, _win32typing.PyCOMSTAT]: ... +def EscapeCommFunction(handle: int) -> None: ... +def GetCommState(handle: int) -> _win32typing.PyDCB: ... +def SetCommState(handle: int, dcb: _win32typing.PyDCB) -> None: ... +def ClearCommBreak(handle: int) -> None: ... +def GetCommMask(handle: int): ... +def SetCommMask(handle: int, val): ... +def GetCommModemStatus(handle: int): ... +def GetCommTimeouts(handle: int): ... +def SetCommTimeouts(handle: int, val): ... +def PurgeComm(handle: int, action) -> None: ... +def SetCommBreak(handle: int) -> None: ... +def SetupComm(handle: int, dwInQueue, dwOutQueue) -> None: ... +def TransmitCommChar(handle: int, cChar) -> None: ... +def WaitCommEvent(handle: int, overlapped: _win32typing.PyOVERLAPPED) -> None: ... +def SetVolumeMountPoint(VolumeMountPoint: str, VolumeName: str) -> str: ... +def DeleteVolumeMountPoint(VolumeMountPoint: str) -> None: ... +def GetVolumeNameForVolumeMountPoint(VolumeMountPoint: str) -> str: ... +def GetVolumePathName(FileName: str, BufferLength: int = ...) -> str: ... +def GetVolumePathNamesForVolumeName(VolumeName: str) -> list[Incomplete]: ... +def CreateHardLink( + FileName: str, + ExistingFileName: str, + SecurityAttributes: _win32typing.PySECURITY_ATTRIBUTES | None = ..., + Transaction: int | None = ..., +) -> None: ... +def CreateSymbolicLink(SymlinkFileName: str, TargetFileName: str, Flags: int = ..., Transaction: int | None = ...) -> None: ... +def EncryptFile(filename: str) -> None: ... +def DecryptFile(filename: str) -> None: ... +def EncryptionDisable(DirName: str, Disable) -> None: ... +def FileEncryptionStatus(FileName: str): ... +def QueryUsersOnEncryptedFile(FileName: str) -> tuple[_win32typing.PySID, str, Incomplete]: ... +def QueryRecoveryAgentsOnEncryptedFile(FileName: str) -> tuple[_win32typing.PySID, str, Incomplete]: ... +def RemoveUsersFromEncryptedFile(FileName: str, pHashes: tuple[tuple[_win32typing.PySID, str, Incomplete], ...]) -> None: ... +def AddUsersToEncryptedFile(FileName: str, pUsers: tuple[tuple[_win32typing.PySID, str, Incomplete], ...]) -> None: ... +def DuplicateEncryptionInfoFile( + SrcFileName: str, + DstFileName: str, + CreationDisposition, + Attributes, + SecurityAttributes: _win32typing.PySECURITY_ATTRIBUTES | None = ..., +) -> None: ... +def BackupRead( + hFile: int, NumberOfBytesToRead, Buffer, bAbort, bProcessSecurity, lpContext +) -> tuple[Incomplete, Incomplete, Incomplete]: ... +def BackupSeek(hFile: int, NumberOfBytesToSeek, lpContext): ... +def BackupWrite( + hFile: int, NumberOfBytesToWrite, Buffer: str, bAbort, bProcessSecurity, lpContext +) -> tuple[Incomplete, Incomplete]: ... +def SetFileShortName(hFile: int, ShortName) -> None: ... +def CopyFileEx( + ExistingFileName, + NewFileName, + ProgressRoutine: _win32typing.CopyProgressRoutine | None = ..., + Data: Incomplete | None = ..., + Cancel: bool = ..., + CopyFlags: int = ..., + Transaction: int | None = ..., +) -> None: ... +def MoveFileWithProgress( + ExistingFileName, + NewFileName, + ProgressRoutine: _win32typing.CopyProgressRoutine | None = ..., + Data: Incomplete | None = ..., + Flags: int = ..., + Transaction: int | None = ..., +) -> None: ... +def ReplaceFile( + ReplacedFileName, + ReplacementFileName, + BackupFileName: Incomplete | None = ..., + ReplaceFlags: int = ..., + Exclude: Incomplete | None = ..., + Reserved: Incomplete | None = ..., +) -> None: ... +def OpenEncryptedFileRaw(FileName, Flags): ... +def ReadEncryptedFileRaw(ExportCallback, CallbackContext, Context) -> None: ... +def WriteEncryptedFileRaw(ImportCallback, CallbackContext, Context) -> None: ... +def CloseEncryptedFileRaw(Context) -> None: ... +def CreateFileW( + FileName: str, + DesiredAccess, + ShareMode, + SecurityAttributes: _win32typing.PySECURITY_ATTRIBUTES, + CreationDisposition, + FlagsAndAttributes, + TemplateFile: int | None = ..., + Transaction: int | None = ..., + MiniVersion: Incomplete | None = ..., + ExtendedParameter: Incomplete | None = ..., +) -> int: ... +def DeleteFileW(FileName: str, Transaction: int | None = ...) -> None: ... +def GetFileAttributesEx(FileName: str, InfoLevelId, Transaction: int | None = ...): ... +def SetFileAttributesW(FileName, FileAttributes, Transaction: int | None = ...) -> None: ... +def CreateDirectoryExW( + TemplateDirectory: str, + NewDirectory: str, + SecurityAttributes: _win32typing.PySECURITY_ATTRIBUTES | None = ..., + Transaction: int | None = ..., +) -> None: ... +def RemoveDirectory(PathName: str, Transaction: int | None = ...) -> None: ... +def FindFilesW(FileName: str, Transaction: int | None = ...): ... +def FindFilesIterator(FileName: str, Transaction: int | None = ...): ... +def FindStreams(FileName: str, Transaction: int | None = ...) -> list[tuple[Incomplete, str]]: ... +def FindFileNames(FileName: str, Transaction: int | None = ...) -> list[Incomplete]: ... +def GetFinalPathNameByHandle(File: int, Flags) -> str: ... +def SfcGetNextProtectedFile() -> list[Incomplete]: ... +def SfcIsFileProtected(ProtFileName: str): ... +def GetLongPathName(__ShortPath: str, __Transaction: int | None = ...) -> str: ... +def GetFullPathName(FileName, Transaction: int | None = ...): ... +def Wow64DisableWow64FsRedirection(): ... +def Wow64RevertWow64FsRedirection(OldValue) -> None: ... +def GetFileInformationByHandleEx(File: int, FileInformationClass): ... +def SetFileInformationByHandle(File: int, FileInformationClass, Information) -> None: ... +def ReOpenFile(OriginalFile: int, DesiredAccess, ShareMode, Flags) -> int: ... +def OpenFileById( + File: int, + FileId: _win32typing.PyIID, + DesiredAccess, + ShareMode, + Flags, + SecurityAttributes: _win32typing.PySECURITY_ATTRIBUTES | None = ..., +) -> int: ... +def DCB(*args, **kwargs): ... # incomplete +def GetFileAttributesExW(*args, **kwargs): ... # incomplete +def OVERLAPPED() -> _win32typing.PyOVERLAPPED: ... + +CALLBACK_CHUNK_FINISHED: int +CALLBACK_STREAM_SWITCH: int +CBR_110: int +CBR_115200: int +CBR_1200: int +CBR_128000: int +CBR_14400: int +CBR_19200: int +CBR_2400: int +CBR_256000: int +CBR_300: int +CBR_38400: int +CBR_4800: int +CBR_56000: int +CBR_57600: int +CBR_600: int +CBR_9600: int +CLRBREAK: int +CLRDTR: int +CLRRTS: int +COPY_FILE_ALLOW_DECRYPTED_DESTINATION: int +COPY_FILE_FAIL_IF_EXISTS: int +COPY_FILE_OPEN_SOURCE_FOR_WRITE: int +COPY_FILE_RESTARTABLE: int +CREATE_ALWAYS: int +CREATE_FOR_DIR: int +CREATE_FOR_IMPORT: int +CREATE_NEW: int +DRIVE_CDROM: int +DRIVE_FIXED: int +DRIVE_NO_ROOT_DIR: int +DRIVE_RAMDISK: int +DRIVE_REMOTE: int +DRIVE_REMOVABLE: int +DRIVE_UNKNOWN: int +DTR_CONTROL_DISABLE: int +DTR_CONTROL_ENABLE: int +DTR_CONTROL_HANDSHAKE: int +EV_BREAK: int +EV_CTS: int +EV_DSR: int +EV_ERR: int +EV_RING: int +EV_RLSD: int +EV_RXCHAR: int +EV_RXFLAG: int +EV_TXEMPTY: int +EVENPARITY: int +FD_ACCEPT: int +FD_CLOSE: int +FD_CONNECT: int +FD_GROUP_QOS: int +FD_OOB: int +FD_QOS: int +FD_READ: int +FD_ROUTING_INTERFACE_CHANGE: int +FD_WRITE: int +FILE_ALL_ACCESS: int +FILE_ATTRIBUTE_ARCHIVE: int +FILE_ATTRIBUTE_COMPRESSED: int +FILE_ATTRIBUTE_DIRECTORY: int +FILE_ATTRIBUTE_HIDDEN: int +FILE_ATTRIBUTE_NORMAL: int +FILE_ATTRIBUTE_OFFLINE: int +FILE_ATTRIBUTE_READONLY: int +FILE_ATTRIBUTE_SYSTEM: int +FILE_ATTRIBUTE_TEMPORARY: int +FILE_BEGIN: int +FILE_CURRENT: int +FILE_ENCRYPTABLE: int +FILE_END: int +FILE_FLAG_BACKUP_SEMANTICS: int +FILE_FLAG_DELETE_ON_CLOSE: int +FILE_FLAG_NO_BUFFERING: int +FILE_FLAG_OPEN_REPARSE_POINT: int +FILE_FLAG_OVERLAPPED: int +FILE_FLAG_POSIX_SEMANTICS: int +FILE_FLAG_RANDOM_ACCESS: int +FILE_FLAG_SEQUENTIAL_SCAN: int +FILE_FLAG_WRITE_THROUGH: int +FILE_GENERIC_READ: int +FILE_GENERIC_WRITE: int +FILE_IS_ENCRYPTED: int +FILE_READ_ONLY: int +FILE_ROOT_DIR: int +FILE_SHARE_DELETE: int +FILE_SHARE_READ: int +FILE_SHARE_WRITE: int +FILE_SYSTEM_ATTR: int +FILE_SYSTEM_DIR: int +FILE_SYSTEM_NOT_SUPPORT: int +FILE_TYPE_CHAR: int +FILE_TYPE_DISK: int +FILE_TYPE_PIPE: int +FILE_TYPE_UNKNOWN: int +FILE_UNKNOWN: int +FILE_USER_DISALLOWED: int +FileAllocationInfo: int +FileAttributeTagInfo: int +FileBasicInfo: int +FileCompressionInfo: int +FileDispositionInfo: int +FileEndOfFileInfo: int +FileIdBothDirectoryInfo: int +FileIdBothDirectoryRestartInfo: int +FileIdType: int +FileIoPriorityHintInfo: int +FileNameInfo: int +FileRenameInfo: int +FileStandardInfo: int +FileStreamInfo: int +GENERIC_EXECUTE: int +GENERIC_READ: int +GENERIC_WRITE: int +GetFileExInfoStandard: int +IoPriorityHintLow: int +IoPriorityHintNormal: int +IoPriorityHintVeryLow: int +MARKPARITY: int +MOVEFILE_COPY_ALLOWED: int +MOVEFILE_CREATE_HARDLINK: int +MOVEFILE_DELAY_UNTIL_REBOOT: int +MOVEFILE_FAIL_IF_NOT_TRACKABLE: int +MOVEFILE_REPLACE_EXISTING: int +MOVEFILE_WRITE_THROUGH: int +NOPARITY: int +ObjectIdType: int +ODDPARITY: int +ONE5STOPBITS: int +ONESTOPBIT: int +OPEN_ALWAYS: int +OPEN_EXISTING: int +OVERWRITE_HIDDEN: int +PROGRESS_CANCEL: int +PROGRESS_CONTINUE: int +PROGRESS_QUIET: int +PROGRESS_STOP: int +PURGE_RXABORT: int +PURGE_RXCLEAR: int +PURGE_TXABORT: int +PURGE_TXCLEAR: int +REPLACEFILE_IGNORE_MERGE_ERRORS: int +REPLACEFILE_WRITE_THROUGH: int +RTS_CONTROL_DISABLE: int +RTS_CONTROL_ENABLE: int +RTS_CONTROL_HANDSHAKE: int +RTS_CONTROL_TOGGLE: int +SCS_32BIT_BINARY: int +SCS_DOS_BINARY: int +SCS_OS216_BINARY: int +SCS_PIF_BINARY: int +SCS_POSIX_BINARY: int +SCS_WOW_BINARY: int +SECURITY_ANONYMOUS: int +SECURITY_CONTEXT_TRACKING: int +SECURITY_DELEGATION: int +SECURITY_EFFECTIVE_ONLY: int +SECURITY_IDENTIFICATION: int +SECURITY_IMPERSONATION: int +SETBREAK: int +SETDTR: int +SETRTS: int +SETXOFF: int +SETXON: int +SO_CONNECT_TIME: int +SO_UPDATE_ACCEPT_CONTEXT: int +SO_UPDATE_CONNECT_CONTEXT: int +SPACEPARITY: int +SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE: int +SYMBOLIC_LINK_FLAG_DIRECTORY: int +TF_DISCONNECT: int +TF_REUSE_SOCKET: int +TF_USE_DEFAULT_WORKER: int +TF_USE_KERNEL_APC: int +TF_USE_SYSTEM_THREAD: int +TF_WRITE_BEHIND: int +TRUNCATE_EXISTING: int +TWOSTOPBITS: int +WSA_IO_PENDING: int +WSA_OPERATION_ABORTED: int +WSAECONNABORTED: int +WSAECONNRESET: int +WSAEDISCON: int +WSAEFAULT: int +WSAEINPROGRESS: int +WSAEINTR: int +WSAEINVAL: int +WSAEMSGSIZE: int +WSAENETDOWN: int +WSAENETRESET: int +WSAENOBUFS: int +WSAENOTCONN: int +WSAENOTSOCK: int +WSAEOPNOTSUPP: int +WSAESHUTDOWN: int +WSAEWOULDBLOCK: int +FD_ADDRESS_LIST_CHANGE: int +INVALID_HANDLE_VALUE: int +UNICODE: int + +# win32pipe.FDCreatePipe is the only known public method to expose this. But it opens both read and write handles. +def _open_osfhandle(osfhandle: _win32typing.PyHANDLE, flags: int) -> int: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32gui.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32gui.pyi new file mode 100644 index 000000000..8d5055a0a --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32gui.pyi @@ -0,0 +1,514 @@ +from _typeshed import Incomplete, ReadableBuffer, WriteableBuffer +from collections.abc import Callable +from typing import TypeVar +from typing_extensions import Literal + +import _win32typing +from win32.lib.pywintypes import error as error + +_T = TypeVar("_T") + +def EnumFontFamilies(hdc: int, Family: str, EnumFontFamProc, Param): ... +def set_logger(logger) -> None: ... +def LOGFONT() -> _win32typing.PyLOGFONT: ... +def CreateFontIndirect(lplf: _win32typing.PyLOGFONT): ... +def GetObject(handle: int): ... +def GetObjectType(h: int): ... +def PyGetMemory(__addr: int, __len: int): ... +def PyGetString(addr, _len=...) -> str: ... +def PySetString(addr, String, maxLen): ... +def PySetMemory(addr, String): ... +def PyGetArraySignedLong(array, index): ... +def PyGetBufferAddressAndLen(obj): ... +def FlashWindow(hwnd: int, bInvert): ... +def FlashWindowEx(hwnd: int, dwFlags, uCount, dwTimeout): ... +def GetWindowLong(hwnd: int, index): ... +def GetClassLong(hwnd: int, index): ... +def SetWindowLong(hwnd: int, index, value): ... +def CallWindowProc(wndproc, hwnd: int, msg, wparam, lparam): ... +def SendMessage( + __hwnd: int | None, __message: int, __wparam: int | None = ..., __lparam: ReadableBuffer | float | None = ... +) -> int: ... +def SendMessageTimeout( + __hwnd: int, + __message: int, + __wparam: ReadableBuffer | float | None, + __lparam: ReadableBuffer | float | None, + __flags: int, + __timeout: int, +) -> tuple[int, int]: ... +def PostMessage( + __hwnd: int | None, __message: int, __wparam: int | None = ..., __lparam: ReadableBuffer | float | None = ... +) -> None: ... +def PostThreadMessage(threadId, message, wparam, lparam) -> None: ... +def ReplyMessage(result): ... +def RegisterWindowMessage(name: str): ... +def DefWindowProc( + hwnd: int | None, message: int, wparam: ReadableBuffer | float | None, lparam: ReadableBuffer | float | None +) -> int: ... +def EnumWindows(__callback: Callable[[int, _T], object], __extra: _T) -> None: ... +def EnumThreadWindows(dwThreadId, __callback: Callable[[int, _T], object], __extra: _T) -> None: ... +def EnumChildWindows(__hwnd: int | None, __callback: Callable[[int, _T], object], __extra: _T) -> None: ... +def DialogBox(hInstance: int, TemplateName: _win32typing.PyResourceId, hWndParent: int, DialogFunc, InitParam: int = ...): ... +def DialogBoxParam(): ... +def DialogBoxIndirect( + hInstance: int, controllist: _win32typing.PyDialogTemplate, hWndParent: int, DialogFunc, InitParam: int = ... +): ... +def DialogBoxIndirectParam(): ... +def CreateDialogIndirect( + hInstance: int, controllist: _win32typing.PyDialogTemplate, hWndParent: int, DialogFunc, InitParam: int = ... +): ... +def EndDialog(hwnd: int, result) -> None: ... +def GetDlgItem(hDlg: int, IDDlgItem): ... +def GetDlgItemInt(hDlg: int, IDDlgItem, Signed) -> None: ... +def SetDlgItemInt(hDlg: int, IDDlgItem, Value, Signed) -> None: ... +def GetDlgCtrlID(hwnd: int): ... +def GetDlgItemText(hDlg: int, IDDlgItem) -> str: ... +def SetDlgItemText(hDlg: int, IDDlgItem, String) -> None: ... +def GetNextDlgTabItem(hDlg, hCtl, bPrevious): ... +def GetNextDlgGroupItem(hDlg, hCtl, bPrevious): ... +def SetWindowText() -> None: ... +def GetWindowText(hwnd: int) -> str: ... +def InitCommonControls() -> None: ... +def InitCommonControlsEx(flag) -> None: ... +def LoadCursor(hinstance, resid): ... +def SetCursor(hcursor): ... +def GetCursor(): ... +def GetCursorInfo() -> tuple[int, int, int, int]: ... +def CreateAcceleratorTable(accels: tuple[tuple[Incomplete, Incomplete, Incomplete], ...]): ... +def LoadMenu(hinstance, resource_id: str): ... +def DestroyMenu() -> None: ... +def SetMenu(hwnd: int, hmenu) -> None: ... +def GetMenu(__hwnd: int) -> int: ... +def LoadIcon(__hinstance: int, __resource_id_or_name: str | int) -> _win32typing.PyWNDCLASS: ... +def CopyIcon(hicon): ... +def DrawIcon(hDC, X, Y, hicon) -> None: ... +def DrawIconEx( + hDC, xLeft, yTop, hIcon, cxWidth, cyWidth, istepIfAniCur, hbrFlickerFreeDraw: _win32typing.PyGdiHANDLE, diFlags +) -> None: ... +def CreateIconIndirect(iconinfo: _win32typing.PyICONINFO): ... +def CreateIconFromResource(bits: str, fIcon, ver: int = ...) -> int: ... +def LoadImage( + __hinst: int, __name: str, __type: int, __cxDesired: int, __cyDesired: int, __fuLoad: int +) -> _win32typing.PyGdiHANDLE: ... +def DeleteObject(handle: _win32typing.PyGdiHANDLE) -> None: ... +def BitBlt(hdcDest, x, y, width, height, hdcSrc, nXSrc, nYSrc, dwRop) -> None: ... +def StretchBlt(hdcDest, x, y, width, height, hdcSrc, nXSrc, nYSrc, nWidthSrc, nHeightSrc, dwRop) -> None: ... +def PatBlt(hdc: int, XLeft, YLeft, Width, Height, Rop) -> None: ... +def SetStretchBltMode(hdc: int, StretchMode): ... +def GetStretchBltMode(hdc: int): ... +def TransparentBlt( + Dest: int, XOriginDest, YOriginDest, WidthDest, HeightDest, Src: int, XOriginSrc, YOriginSrc, WidthSrc, HeightSrc, Transparent +) -> None: ... +def MaskBlt( + Dest: int, XDest, YDest, Width, Height, Src: int, XSrc, YSrc, Mask: _win32typing.PyGdiHANDLE, xMask, yMask, Rop +) -> None: ... +def AlphaBlend( + Dest: int, + XOriginDest, + YOriginDest, + WidthDest, + HeightDest, + Src: int, + XOriginSrc, + YOriginSrc, + WidthSrc, + HeightSrc, + blendFunction: _win32typing.PyBLENDFUNCTION, +) -> None: ... +def MessageBox(parent, text: str, caption: str, flags): ... +def MessageBeep(_type) -> None: ... +def CreateWindow( + __className: str | _win32typing.PyResourceId, + __windowTitle: str | None, + __style: int, + __x: int, + __y: int, + __width: int, + __height: int, + __parent: int, + __menu: int, + __hinstance: int, + __reserved: Incomplete | None, +) -> int: ... +def DestroyWindow(_hwnd: int) -> None: ... +def EnableWindow(hWnd: int, bEnable): ... +def FindWindow(__ClassName: _win32typing.PyResourceId | str | None, __WindowName: str | None) -> int: ... +def FindWindowEx( + __Parent: int | None, __ChildAfter: int | None, __ClassName: _win32typing.PyResourceId | str | None, __WindowName: str | None +) -> int: ... +def DragAcceptFiles(hwnd: int, fAccept) -> None: ... +def DragDetect(hwnd: int, point: tuple[Incomplete, Incomplete]) -> None: ... +def SetDoubleClickTime(newVal) -> None: ... +def GetDoubleClickTime(): ... +def HideCaret(hWnd: int) -> None: ... +def SetCaretPos(x, y) -> None: ... +def GetCaretPos() -> tuple[Incomplete, Incomplete]: ... +def ShowCaret(hWnd: int) -> None: ... +def ShowWindow(__hWnd: int | None, __cmdShow: int) -> int: ... +def IsWindowVisible(__hwnd: int | None) -> int: ... +def IsWindowEnabled(__hwnd: int | None) -> int: ... +def SetFocus(hwnd: int) -> None: ... +def GetFocus() -> None: ... +def UpdateWindow(__hwnd: int) -> None: ... +def BringWindowToTop(hwnd: int) -> None: ... +def SetActiveWindow(hwnd: int): ... +def GetActiveWindow(): ... +def SetForegroundWindow(__hwnd: int) -> None: ... +def GetForegroundWindow() -> int: ... +def GetClientRect(hwnd: int) -> tuple[int, int, int, int]: ... +def GetDC(hwnd: int): ... +def SaveDC(hdc: int): ... +def RestoreDC(hdc: int, SavedDC) -> None: ... +def DeleteDC(hdc) -> None: ... +def CreateCompatibleDC(dc): ... +def CreateCompatibleBitmap(hdc, width, height) -> _win32typing.PyGdiHANDLE: ... +def CreateBitmap(width, height, cPlanes, cBitsPerPixel, bitmap_bits) -> _win32typing.PyGdiHANDLE: ... +def SelectObject(hdc, _object): ... +def GetCurrentObject(hdc: int, ObjectType) -> int: ... +def GetWindowRect(hwnd: int) -> tuple[int, int, int, int]: ... +def GetStockObject(Object) -> int: ... +def PostQuitMessage(__rc: int) -> None: ... +def WaitMessage() -> None: ... +def SetWindowPos(__hWnd: int, __InsertAfter: int | None, __X: int, __Y: int, __cx: int, __cy: int, __Flags: int) -> None: ... +def GetWindowPlacement(__hwnd: int) -> tuple[int, int, tuple[int, int], tuple[int, int], tuple[int, int, int, int]]: ... +def SetWindowPlacement(hWnd: int, placement) -> None: ... +def RegisterClass(__wndClass: _win32typing.PyWNDCLASS) -> _win32typing.PyResourceId: ... +def UnregisterClass(__atom: _win32typing.PyResourceId, __hinst: int) -> None: ... +def PumpMessages() -> None: ... +def PumpWaitingMessages(__firstMessage: int = ..., __lastMessage: int = ...) -> int: ... +def GetMessage(hwnd: int, _min, _max): ... +def TranslateMessage(msg): ... +def DispatchMessage(msg): ... +def TranslateAccelerator(hwnd: int, haccel, msg): ... +def PeekMessage(hwnd: int, filterMin, filterMax, removalOptions): ... +def Shell_NotifyIcon(__Message: int, __nid: _win32typing.PyNOTIFYICONDATA) -> None: ... +def GetSystemMenu(hwnd: int, bRevert): ... +def DrawMenuBar(hwnd: int) -> None: ... +def MoveWindow(__hwnd: int, __x: int, __y: int, __width: int, __height: int, __bRepaint: bool) -> None: ... +def CloseWindow() -> None: ... +def DeleteMenu(hmenu, position, flags) -> None: ... +def RemoveMenu(hmenu, position, flags) -> None: ... +def CreateMenu(): ... +def CreatePopupMenu(): ... +def TrackPopupMenu(hmenu, flags, x, y, reserved, hwnd: int, prcRect: _win32typing.PyRECT): ... +def CommDlgExtendedError(): ... +def ExtractIcon(hinstance, moduleName: str, index): ... +def ExtractIconEx(moduleName: str, index, numIcons: int = ...): ... +def DestroyIcon(hicon) -> None: ... +def GetIconInfo(hicon: int) -> _win32typing.PyICONINFO: ... +def ScreenToClient(hWnd: int, Point: tuple[Incomplete, Incomplete]) -> tuple[Incomplete, Incomplete]: ... +def ClientToScreen(hWnd: int, Point: tuple[Incomplete, Incomplete]) -> tuple[Incomplete, Incomplete]: ... +def PaintDesktop(hdc: int) -> None: ... +def RedrawWindow(hWnd: int, rcUpdate: tuple[int, int, int, int], hrgnUpdate: _win32typing.PyGdiHANDLE, flags) -> None: ... +def GetTextExtentPoint32(hdc: int, _str: str) -> tuple[Incomplete, Incomplete]: ... +def GetTextMetrics(): ... +def GetTextCharacterExtra(hdc: int): ... +def SetTextCharacterExtra(hdc: int, CharExtra): ... +def GetTextAlign(hdc: int): ... +def SetTextAlign(hdc: int, Mode): ... +def GetTextFace(hdc: int) -> str: ... +def GetMapMode(hdc: int): ... +def SetMapMode(hdc: int, MapMode): ... +def GetGraphicsMode(hdc: int): ... +def SetGraphicsMode(hdc: int, Mode): ... +def GetLayout(hdc: int): ... +def SetLayout(hdc: int, Layout): ... +def GetPolyFillMode(hdc: int): ... +def SetPolyFillMode(hdc: int, PolyFillMode): ... +def GetWorldTransform(hdc: int) -> _win32typing.PyXFORM: ... +def SetWorldTransform(hdc: int, Xform: _win32typing.PyXFORM) -> None: ... +def ModifyWorldTransform(hdc: int, Xform: _win32typing.PyXFORM, Mode) -> None: ... +def CombineTransform(xform1: _win32typing.PyXFORM, xform2: _win32typing.PyXFORM) -> _win32typing.PyXFORM: ... +def GetWindowOrgEx(hdc: int) -> tuple[Incomplete, Incomplete]: ... +def SetWindowOrgEx(hdc: int, X, Y) -> tuple[Incomplete, Incomplete]: ... +def GetViewportOrgEx(hdc: int) -> tuple[Incomplete, Incomplete]: ... +def SetViewportOrgEx(hdc: int, X, Y) -> tuple[Incomplete, Incomplete]: ... +def GetWindowExtEx(hdc: int) -> tuple[Incomplete, Incomplete]: ... +def SetWindowExtEx(hdc: int, XExtent, YExtent) -> tuple[Incomplete, Incomplete]: ... +def GetViewportExtEx(hdc: int) -> tuple[Incomplete, Incomplete]: ... +def SetViewportExtEx(hdc: int, XExtent, YExtent) -> tuple[Incomplete, Incomplete]: ... +def GradientFill(hdc, Vertex: tuple[_win32typing.PyTRIVERTEX, ...], Mesh, Mode) -> None: ... +def GetOpenFileName(OPENFILENAME: str): ... +def InsertMenuItem(hMenu, uItem, fByPosition, menuItem) -> None: ... +def SetMenuItemInfo(hMenu, uItem, fByPosition, menuItem) -> None: ... +def GetMenuItemInfo(__hMenu: int, __uItem: int, __fByPosition: bool, __menuItem: ReadableBuffer) -> None: ... +def GetMenuItemCount(__hMenu: int | None) -> int: ... + +# Actually returns a list of int|tuple, but lists don't support positional types +def GetMenuItemRect(__hWnd: int | None, __hMenu: int | None, __uItem: int) -> tuple[int, tuple[int, int, int, int]]: ... +def GetMenuState(hMenu, uID, flags): ... +def SetMenuDefaultItem(hMenu, uItem, fByPos) -> None: ... +def GetMenuDefaultItem(hMenu, fByPos, flags): ... +def AppendMenu() -> None: ... +def InsertMenu() -> None: ... +def EnableMenuItem() -> None: ... +def CheckMenuItem(): ... +def GetSubMenu(hMenu, nPos): ... +def ModifyMenu(hMnu, uPosition, uFlags, uIDNewItem, newItem: str) -> None: ... +def GetMenuItemID(hMenu, nPos): ... +def SetMenuItemBitmaps( + hMenu, uPosition, uFlags, hBitmapUnchecked: _win32typing.PyGdiHANDLE, hBitmapChecked: _win32typing.PyGdiHANDLE +) -> None: ... +def CheckMenuRadioItem(hMenu, idFirst, idLast, idCheck, uFlags) -> None: ... +def SetMenuInfo(hmenu, info) -> None: ... +def GetMenuInfo(__hmenu: int, __info: WriteableBuffer) -> None: ... +def DrawFocusRect(hDC: int, rc: tuple[int, int, int, int]) -> None: ... +def DrawText(hDC: int, String, nCount, Rect: _win32typing.PyRECT, Format) -> tuple[Incomplete, _win32typing.PyRECT]: ... +def LineTo(hdc: int, XEnd, YEnd) -> None: ... +def Ellipse(hdc: int, LeftRect, TopRect, RightRect, BottomRect) -> None: ... +def Pie(hdc: int, LeftRect, TopRect, RightRect, BottomRect, XRadial1, YRadial1, XRadial2, YRadial2) -> None: ... +def Arc(hdc: int, LeftRect, TopRect, RightRect, BottomRect, XRadial1, YRadial1, XRadial2, YRadial2) -> None: ... +def ArcTo(hdc: int, LeftRect, TopRect, RightRect, BottomRect, XRadial1, YRadial1, XRadial2, YRadial2) -> None: ... +def AngleArc(hdc: int, Y, Y1, Radius, StartAngle: float, SweepAngle: float) -> None: ... +def Chord(hdc: int, LeftRect, TopRect, RightRect, BottomRect, XRadial1, YRadial1, XRadial2, YRadial2) -> None: ... +def ExtFloodFill(arg: int, XStart, YStart, Color, FillType) -> None: ... +def SetPixel(hdc: int, X, Y, Color): ... +def GetPixel(hdc: int, XPos, YPos): ... +def GetROP2(hdc: int): ... +def SetROP2(hdc: int, DrawMode): ... +def SetPixelV(hdc: int, X, Y, Color) -> None: ... +def MoveToEx(hdc: int, X, Y) -> tuple[Incomplete, Incomplete]: ... +def GetCurrentPositionEx(hdc: int) -> tuple[Incomplete, Incomplete]: ... +def GetArcDirection(hdc: int): ... +def SetArcDirection(hdc: int, ArcDirection): ... +def Polygon(hdc: int, Points: list[tuple[Incomplete, Incomplete]]) -> None: ... +def Polyline(hdc: int, Points: list[tuple[Incomplete, Incomplete]]) -> None: ... +def PolylineTo(hdc: int, Points: list[tuple[Incomplete, Incomplete]]) -> None: ... +def PolyBezier(hdc: int, Points: list[tuple[Incomplete, Incomplete]]) -> None: ... +def PolyBezierTo(hdc: int, Points: list[tuple[Incomplete, Incomplete]]) -> None: ... +def PlgBlt( + Dest: int, + Point, + Src: int, + XSrc, + YSrc, + Width, + Height, + Mask: _win32typing.PyGdiHANDLE | None = ..., + xMask: int = ..., + yMask: int = ..., +) -> None: ... +def CreatePolygonRgn(Points: list[tuple[Incomplete, Incomplete]], PolyFillMode) -> _win32typing.PyGdiHANDLE: ... +def ExtTextOut( + hdc: int, _int, _int1, _int2, rect: _win32typing.PyRECT, string, _tuple: tuple[tuple[Incomplete, Incomplete], ...] +): ... +def GetTextColor(hdc): ... +def SetTextColor(hdc, color): ... +def GetBkMode(hdc: int): ... +def SetBkMode(hdc: int, BkMode): ... +def GetBkColor(hdc: int): ... +def SetBkColor(hdc: int, color): ... +def DrawEdge(hdc: int, rc: _win32typing.PyRECT, edge, Flags) -> _win32typing.PyRECT: ... +def FillRect(hDC: int, rc: _win32typing.PyRECT, hbr: _win32typing.PyGdiHANDLE) -> None: ... +def FillRgn(hdc: int, hrgn: _win32typing.PyGdiHANDLE, hbr: _win32typing.PyGdiHANDLE) -> None: ... +def PaintRgn(hdc: int, hrgn: _win32typing.PyGdiHANDLE) -> None: ... +def FrameRgn(hdc: int, hrgn, hbr, Width, Height) -> None: ... +def InvertRgn(hdc: int, hrgn) -> None: ... +def EqualRgn(SrcRgn1, SrcRgn2): ... +def PtInRegion(hrgn, X, Y): ... +def PtInRect(rect: tuple[int, int, int, int], point: tuple[Incomplete, Incomplete]): ... +def RectInRegion(hrgn, rc: _win32typing.PyRECT): ... +def SetRectRgn(hrgn, LeftRect, TopRect, RightRect, BottomRect) -> None: ... +def CombineRgn(Dest, Src1, Src2, CombineMode): ... +def DrawAnimatedRects(hwnd: int, idAni, minCoords: _win32typing.PyRECT, restCoords: _win32typing.PyRECT) -> None: ... +def CreateSolidBrush(Color) -> _win32typing.PyGdiHANDLE: ... +def CreatePatternBrush(hbmp: _win32typing.PyGdiHANDLE) -> _win32typing.PyGdiHANDLE: ... +def CreateHatchBrush(Style, clrref) -> _win32typing.PyGdiHANDLE: ... +def CreatePen(PenStyle, Width, Color) -> _win32typing.PyGdiHANDLE: ... +def GetSysColor(Index): ... +def GetSysColorBrush(Index) -> _win32typing.PyGdiHANDLE: ... +def InvalidateRect(hWnd: int, Rect: _win32typing.PyRECT, Erase) -> None: ... +def FrameRect(hDC: int, rc: _win32typing.PyRECT, hbr: _win32typing.PyGdiHANDLE) -> None: ... +def InvertRect(hDC: int, rc: _win32typing.PyRECT) -> None: ... +def WindowFromDC(hDC: int) -> int: ... +def GetUpdateRgn(hWnd: int, hRgn: _win32typing.PyGdiHANDLE, Erase): ... +def GetWindowRgn(hWnd: int, hRgn: _win32typing.PyGdiHANDLE): ... +def SetWindowRgn(hWnd: int, hRgn: _win32typing.PyGdiHANDLE, Redraw) -> None: ... +def ValidateRgn(hWnd: int, hRgn: _win32typing.PyGdiHANDLE) -> None: ... +def InvalidateRgn(hWnd: int, hRgn: _win32typing.PyGdiHANDLE, Erase) -> None: ... +def GetRgnBox(hrgn: _win32typing.PyGdiHANDLE) -> tuple[Incomplete, _win32typing.PyRECT]: ... +def OffsetRgn(hrgn: _win32typing.PyGdiHANDLE, XOffset, YOffset): ... +def Rectangle(hdc: int, LeftRect, TopRect, RightRect, BottomRect) -> None: ... +def RoundRect(hdc: int, LeftRect, TopRect, RightRect, BottomRect, Width, Height) -> None: ... +def BeginPaint() -> tuple[Incomplete, Incomplete]: ... +def EndPaint(hwnd: int, ps) -> None: ... +def BeginPath(hdc: int) -> None: ... +def EndPath(hdc: int) -> None: ... +def AbortPath(hdc: int) -> None: ... +def CloseFigure(hdc: int) -> None: ... +def FlattenPath(hdc: int) -> None: ... +def FillPath(hdc: int) -> None: ... +def WidenPath(hdc: int) -> None: ... +def StrokePath(hdc: int) -> None: ... +def StrokeAndFillPath(hdc: int) -> None: ... +def GetMiterLimit(hdc: int) -> float: ... +def SetMiterLimit(hdc: int, NewLimit: float) -> float: ... +def PathToRegion(hdc: int) -> _win32typing.PyGdiHANDLE: ... +def GetPath(hdc: int) -> tuple[Incomplete, Incomplete]: ... +def CreateRoundRectRgn(LeftRect, TopRect, RightRect, BottomRect, WidthEllipse, HeightEllipse): ... +def CreateRectRgnIndirect(rc: _win32typing.PyRECT): ... +def CreateEllipticRgnIndirect(rc: _win32typing.PyRECT): ... +def CreateWindowEx( + dwExStyle, className: str, windowTitle: str, style, x, y, width, height, parent, menu, hinstance, reserved +): ... +def GetParent(child: int) -> int: ... +def SetParent(__child: int, __child1: int | None | _win32typing.PyHANDLE) -> int: ... +def GetCursorPos() -> tuple[Incomplete, Incomplete]: ... +def GetDesktopWindow(): ... +def GetWindow(__hWnd: int, __uCmd: int) -> int: ... +def GetWindowDC(hWnd: int) -> int: ... +def IsIconic(__hWnd: int) -> int: ... +def IsWindow(__hWnd: int) -> int: ... +def IsChild(__hWndParent: int, hWnd: int) -> int: ... +def ReleaseCapture() -> None: ... +def GetCapture(): ... +def SetCapture() -> None: ... +def ReleaseDC(hWnd: int, hDC): ... +def CreateCaret(hWnd: int, hBitmap: _win32typing.PyGdiHANDLE, nWidth, nHeight) -> None: ... +def DestroyCaret() -> None: ... +def ScrollWindowEx( + hWnd: int, dx, dy, rcScroll: _win32typing.PyRECT, rcClip: _win32typing.PyRECT, hrgnUpdate, flags +) -> tuple[Incomplete, _win32typing.PyRECT]: ... +def SetScrollInfo(hwnd: int, nBar, scollInfo: _win32typing.PySCROLLINFO, bRedraw=...) -> None: ... +def GetScrollInfo(hwnd: int, nBar, mask) -> _win32typing.PySCROLLINFO: ... +def GetClassName(hwnd: int) -> str: ... +def WindowFromPoint(point: tuple[int, int]) -> int: ... +def ChildWindowFromPoint(hwndParent: int, point: tuple[Incomplete, Incomplete]): ... +def CreateDC(Driver: str, Device: str, InitData: _win32typing.PyDEVMODE): ... +def GetSaveFileNameW( + hwndOwner: int | None = ..., + hInstance: int | None = ..., + Filter: Incomplete | None = ..., + CustomFilter: Incomplete | None = ..., + FilterIndex: int = ..., + File: Incomplete | None = ..., + MaxFile: int = ..., + InitialDir: Incomplete | None = ..., + Title: Incomplete | None = ..., + Flags: int = ..., + DefExt: Incomplete | None = ..., + TemplateName: _win32typing.PyResourceId | None = ..., +) -> tuple[Incomplete, Incomplete, Incomplete]: ... +def GetOpenFileNameW( + hwndOwner: int | None = ..., + hInstance: int | None = ..., + Filter: Incomplete | None = ..., + CustomFilter: Incomplete | None = ..., + FilterIndex: int = ..., + File: Incomplete | None = ..., + MaxFile: int = ..., + InitialDir: Incomplete | None = ..., + Title: Incomplete | None = ..., + Flags: int = ..., + DefExt: Incomplete | None = ..., + TemplateName: _win32typing.PyResourceId | None = ..., +) -> tuple[Incomplete, Incomplete, Incomplete]: ... +def SystemParametersInfo(Action, Param: Incomplete | None = ..., WinIni: int = ...) -> None: ... +def SetLayeredWindowAttributes(hwnd: int, Key, Alpha, Flags) -> None: ... +def GetLayeredWindowAttributes(hwnd: int) -> tuple[Incomplete, Incomplete, Incomplete]: ... +def UpdateLayeredWindow( + hwnd: int, + arg: tuple[int, int, int, int], + hdcDst: int | None = ..., + ptDst: tuple[Incomplete, Incomplete] | None = ..., + size: tuple[Incomplete, Incomplete] | None = ..., + hdcSrc: Incomplete | None = ..., + ptSrc: tuple[Incomplete, Incomplete] | None = ..., + Key: int = ..., + Flags: int = ..., +) -> None: ... +def AnimateWindow(hwnd: int, Time, Flags) -> None: ... +def CreateBrushIndirect(lb: _win32typing.PyLOGBRUSH) -> _win32typing.PyGdiHANDLE: ... +def ExtCreatePen(PenStyle, Width, lb: _win32typing.PyLOGBRUSH, Style: tuple[Incomplete, ...] | None = ...) -> int: ... +def DrawTextW(hDC: int, String: str, Count, Rect: _win32typing.PyRECT, Format) -> tuple[Incomplete, _win32typing.PyRECT]: ... +def EnumPropsEx(hWnd: int, EnumFunc, Param) -> None: ... +def RegisterDeviceNotification(handle: int, _filter, flags) -> _win32typing.PyHDEVNOTIFY: ... +def UnregisterDeviceNotification() -> None: ... +def RegisterHotKey(hWnd: int, _id, Modifiers, vk) -> None: ... +def GetAncestor(__hwnd: int, __gaFlags: int) -> int: ... +def GetTopWindow(__hWnd: int | None) -> int: ... +def ChildWindowFromPointEx(*args, **kwargs): ... # incomplete +def CreateDialogIndirectParam(*args, **kwargs): ... # incomplete +def DestroyAcceleratorTable(*args, **kwargs): ... # incomplete +def Edit_GetLine(*args, **kwargs): ... # incomplete +def GetModuleHandle(__lpModuleName: str | None) -> int: ... +def GetWindowTextLength(*args, **kwargs): ... # incomplete +def HIWORD(*args, **kwargs): ... # incomplete +def ImageList_Add(*args, **kwargs): ... # incomplete +def ImageList_Create(*args, **kwargs): ... # incomplete +def ImageList_Destroy(*args, **kwargs): ... # incomplete +def ImageList_Draw(*args, **kwargs): ... # incomplete +def ImageList_DrawEx(*args, **kwargs): ... # incomplete +def ImageList_GetIcon(*args, **kwargs): ... # incomplete +def ImageList_GetImageCount(*args, **kwargs): ... # incomplete +def ImageList_LoadBitmap(*args, **kwargs): ... # incomplete +def ImageList_LoadImage(*args, **kwargs): ... # incomplete +def ImageList_Remove(*args, **kwargs): ... # incomplete +def ImageList_Replace(*args, **kwargs): ... # incomplete +def ImageList_ReplaceIcon(*args, **kwargs): ... # incomplete +def ImageList_SetBkColor(*args, **kwargs): ... # incomplete +def ImageList_SetOverlayImage(*args, **kwargs): ... # incomplete +def LOWORD(*args, **kwargs): ... # incomplete +def ListView_SortItems(*args, **kwargs): ... # incomplete +def ListView_SortItemsEx(*args, **kwargs): ... # incomplete +def ValidateRect(*args, **kwargs): ... # incomplete +def WNDCLASS() -> _win32typing.PyWNDCLASS: ... +def lpstr(*args, **kwargs): ... # incomplete + +CLR_NONE: int +ILC_COLOR: int +ILC_COLOR16: int +ILC_COLOR24: int +ILC_COLOR32: int +ILC_COLOR4: int +ILC_COLOR8: int +ILC_COLORDDB: int +ILC_MASK: int +ILD_BLEND: int +ILD_BLEND25: int +ILD_BLEND50: int +ILD_FOCUS: int +ILD_MASK: int +ILD_NORMAL: int +ILD_SELECTED: int +ILD_TRANSPARENT: int +IMAGE_BITMAP: int +IMAGE_CURSOR: int +IMAGE_ICON: int +LR_CREATEDIBSECTION: int +LR_DEFAULTCOLOR: int +LR_DEFAULTSIZE: int +LR_LOADFROMFILE: int +LR_LOADMAP3DCOLORS: int +LR_LOADTRANSPARENT: int +LR_MONOCHROME: int +LR_SHARED: int +LR_VGACOLOR: int +NIF_ICON: int +NIF_INFO: int +NIF_MESSAGE: int +NIF_STATE: int +NIF_TIP: int +NIIF_ERROR: int +NIIF_ICON_MASK: int +NIIF_INFO: int +NIIF_NONE: int +NIIF_NOSOUND: int +NIIF_WARNING: int +NIM_ADD: int +NIM_DELETE: int +NIM_MODIFY: int +NIM_SETVERSION: int +TPM_BOTTOMALIGN: int +TPM_CENTERALIGN: int +TPM_LEFTALIGN: int +TPM_LEFTBUTTON: int +TPM_NONOTIFY: int +TPM_RETURNCMD: int +TPM_RIGHTALIGN: int +TPM_RIGHTBUTTON: int +TPM_TOPALIGN: int +TPM_VCENTERALIGN: int +UNICODE: Literal[True] +dllhandle: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32help.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32help.pyi new file mode 100644 index 000000000..7d8b00127 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32help.pyi @@ -0,0 +1,180 @@ +import _win32typing + +def WinHelp(hwnd: int, hlpFile: str, cmd, data: str | None = ...) -> None: ... +def HH_AKLINK() -> _win32typing.PyHH_AKLINK: ... +def HH_FTS_QUERY() -> _win32typing.PyHH_FTS_QUERY: ... +def HH_POPUP() -> _win32typing.PyHH_POPUP: ... +def HH_WINTYPE() -> _win32typing.PyHH_WINTYPE: ... +def NMHDR() -> _win32typing.PyNMHDR: ... +def HHN_NOTIFY() -> _win32typing.PyHHN_NOTIFY: ... +def HHNTRACK() -> _win32typing.PyHHNTRACK: ... +def HtmlHelp(hwnd: int, file: str, cmd, data: str | tuple[int] | int = ...): ... + +debug: int +HH_ALINK_LOOKUP: int +HH_CLOSE_ALL: int +HH_DISPLAY_INDEX: int +HH_DISPLAY_SEARCH: int +HH_DISPLAY_TEXT_POPUP: int +HH_DISPLAY_TOC: int +HH_DISPLAY_TOPIC: int +HH_ENUM_CATEGORY: int +HH_ENUM_CATEGORY_IT: int +HH_ENUM_INFO_TYPE: int +HH_FTS_DEFAULT_PROXIMITY: int +HH_GET_LAST_ERROR: int +HH_GET_WIN_HANDLE: int +HH_GET_WIN_TYPE: int +HH_GPROPID_CONTENT_LANGUAGE: int +HH_GPROPID_CURRENT_SUBSET: int +HH_GPROPID_SINGLETHREAD: int +HH_GPROPID_TOOLBAR_MARGIN: int +HH_GPROPID_UI_LANGUAGE: int +HH_HELP_CONTEXT: int +HH_HELP_FINDER: int +HH_INITIALIZE: int +HH_KEYWORD_LOOKUP: int +HH_MAX_TABS_CUSTOM: int +HH_PRETRANSLATEMESSAGE: int +HH_RESERVED1: int +HH_RESERVED2: int +HH_RESERVED3: int +HH_RESET_IT_FILTER: int +HH_SET_EXCLUSIVE_FILTER: int +HH_SET_GLOBAL_PROPERTY: int +HH_SET_INCLUSIVE_FILTER: int +HH_SET_INFO_TYPE: int +HH_SET_WIN_TYPE: int +HH_SYNC: int +HH_TAB_AUTHOR: int +HH_TAB_CONTENTS: int +HH_TAB_CUSTOM_FIRST: int +HH_TAB_CUSTOM_LAST: int +HH_TAB_FAVORITES: int +HH_TAB_HISTORY: int +HH_TAB_INDEX: int +HH_TAB_SEARCH: int +HH_TP_HELP_CONTEXTMENU: int +HH_TP_HELP_WM_HELP: int +HH_UNINITIALIZE: int +HHACT_BACK: int +HHACT_CONTRACT: int +HHACT_CUSTOMIZE: int +HHACT_EXPAND: int +HHACT_FORWARD: int +HHACT_HIGHLIGHT: int +HHACT_HOME: int +HHACT_JUMP1: int +HHACT_JUMP2: int +HHACT_LAST_ENUM: int +HHACT_NOTES: int +HHACT_OPTIONS: int +HHACT_PRINT: int +HHACT_REFRESH: int +HHACT_STOP: int +HHACT_SYNC: int +HHACT_TAB_CONTENTS: int +HHACT_TAB_FAVORITES: int +HHACT_TAB_HISTORY: int +HHACT_TAB_INDEX: int +HHACT_TAB_SEARCH: int +HHACT_TOC_NEXT: int +HHACT_TOC_PREV: int +HHACT_ZOOM: int +HHN_FIRST: int +HHN_LAST: int +HHN_NAVCOMPLETE: int +HHN_TRACK: int +HHN_WINDOW_CREATE: int +HHWIN_BUTTON_BACK: int +HHWIN_BUTTON_BROWSE_BCK: int +HHWIN_BUTTON_BROWSE_FWD: int +HHWIN_BUTTON_CONTENTS: int +HHWIN_BUTTON_EXPAND: int +HHWIN_BUTTON_FAVORITES: int +HHWIN_BUTTON_FORWARD: int +HHWIN_BUTTON_HISTORY: int +HHWIN_BUTTON_HOME: int +HHWIN_BUTTON_INDEX: int +HHWIN_BUTTON_JUMP1: int +HHWIN_BUTTON_JUMP2: int +HHWIN_BUTTON_NOTES: int +HHWIN_BUTTON_OPTIONS: int +HHWIN_BUTTON_PRINT: int +HHWIN_BUTTON_REFRESH: int +HHWIN_BUTTON_SEARCH: int +HHWIN_BUTTON_STOP: int +HHWIN_BUTTON_SYNC: int +HHWIN_BUTTON_TOC_NEXT: int +HHWIN_BUTTON_TOC_PREV: int +HHWIN_BUTTON_ZOOM: int +HHWIN_DEF_BUTTONS: int +HHWIN_NAVTAB_BOTTOM: int +HHWIN_NAVTAB_LEFT: int +HHWIN_NAVTAB_TOP: int +HHWIN_PARAM_CUR_TAB: int +HHWIN_PARAM_EXPANSION: int +HHWIN_PARAM_EXSTYLES: int +HHWIN_PARAM_HISTORY_COUNT: int +HHWIN_PARAM_INFOTYPES: int +HHWIN_PARAM_NAV_WIDTH: int +HHWIN_PARAM_PROPERTIES: int +HHWIN_PARAM_RECT: int +HHWIN_PARAM_SHOWSTATE: int +HHWIN_PARAM_STYLES: int +HHWIN_PARAM_TABORDER: int +HHWIN_PARAM_TABPOS: int +HHWIN_PARAM_TB_FLAGS: int +HHWIN_PROP_AUTO_SYNC: int +HHWIN_PROP_CHANGE_TITLE: int +HHWIN_PROP_MENU: int +HHWIN_PROP_NAV_ONLY_WIN: int +HHWIN_PROP_NO_TOOLBAR: int +HHWIN_PROP_NODEF_EXSTYLES: int +HHWIN_PROP_NODEF_STYLES: int +HHWIN_PROP_NOTB_TEXT: int +HHWIN_PROP_NOTITLEBAR: int +HHWIN_PROP_ONTOP: int +HHWIN_PROP_POST_QUIT: int +HHWIN_PROP_TAB_ADVSEARCH: int +HHWIN_PROP_TAB_AUTOHIDESHOW: int +HHWIN_PROP_TAB_CUSTOM1: int +HHWIN_PROP_TAB_CUSTOM2: int +HHWIN_PROP_TAB_CUSTOM3: int +HHWIN_PROP_TAB_CUSTOM4: int +HHWIN_PROP_TAB_CUSTOM5: int +HHWIN_PROP_TAB_CUSTOM6: int +HHWIN_PROP_TAB_CUSTOM7: int +HHWIN_PROP_TAB_CUSTOM8: int +HHWIN_PROP_TAB_CUSTOM9: int +HHWIN_PROP_TAB_FAVORITES: int +HHWIN_PROP_TAB_HISTORY: int +HHWIN_PROP_TAB_SEARCH: int +HHWIN_PROP_TRACKING: int +HHWIN_PROP_TRI_PANE: int +HHWIN_PROP_USER_POS: int +HHWIN_TB_MARGIN: int +IDTB_BACK: int +IDTB_BROWSE_BACK: int +IDTB_BROWSE_FWD: int +IDTB_CONTENTS: int +IDTB_CONTRACT: int +IDTB_CUSTOMIZE: int +IDTB_EXPAND: int +IDTB_FAVORITES: int +IDTB_FORWARD: int +IDTB_HISTORY: int +IDTB_HOME: int +IDTB_INDEX: int +IDTB_JUMP1: int +IDTB_JUMP2: int +IDTB_NOTES: int +IDTB_OPTIONS: int +IDTB_PRINT: int +IDTB_REFRESH: int +IDTB_SEARCH: int +IDTB_STOP: int +IDTB_SYNC: int +IDTB_TOC_NEXT: int +IDTB_TOC_PREV: int +IDTB_ZOOM: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32inet.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32inet.pyi new file mode 100644 index 000000000..ec5eb2242 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32inet.pyi @@ -0,0 +1,69 @@ +from _typeshed import Incomplete + +import _win32typing +from win32.lib.pywintypes import error as error + +def InternetSetCookie(url: str, lpszCookieName: str, data: str) -> None: ... +def InternetGetCookie(Url: str, CookieName: str) -> str: ... +def InternetAttemptConnect(Reserved: int = ...) -> None: ... +def InternetCheckConnection(Url: str, Flags: int = ..., Reserved: int = ...) -> None: ... +def InternetGoOnline(Url: str, Parent: Incomplete | None = ..., Flags: int = ...) -> None: ... +def InternetCloseHandle(handle: _win32typing.PyHINTERNET) -> None: ... +def InternetConnect( + Internet: _win32typing.PyHINTERNET, + ServerName: str, + ServerPort, + Username: str, + Password: str, + Service, + Flags, + Context: Incomplete | None = ..., +) -> None: ... +def InternetOpen(agent: str, proxyName: str, proxyBypass: str, flags) -> None: ... +def InternetOpenUrl( + Internet: _win32typing.PyHINTERNET, Url: str, Headers: str | None = ..., Flags: int = ..., Context: Incomplete | None = ... +) -> _win32typing.PyHINTERNET: ... +def InternetCanonicalizeUrl(url: str, flags: int = ...) -> str: ... +def InternetGetLastResponseInfo() -> tuple[Incomplete, str]: ... +def InternetReadFile(hInternet: _win32typing.PyHINTERNET, size) -> str: ... +def InternetWriteFile(File: _win32typing.PyHINTERNET, Buffer: str): ... +def FtpOpenFile( + hConnect: _win32typing.PyHINTERNET, FileName: str, Access, Flags, Context: Incomplete | None = ... +) -> _win32typing.PyHINTERNET: ... +def FtpCommand( + Connect: _win32typing.PyHINTERNET, ExpectResponse, Flags, Command: str, Context: Incomplete | None = ... +) -> _win32typing.PyHINTERNET: ... +def InternetQueryOption(hInternet: _win32typing.PyHINTERNET, Option): ... +def InternetSetOption(hInternet: _win32typing.PyHINTERNET, Option, Buffer) -> None: ... +def FindFirstUrlCacheEntry(SearchPattern: Incomplete | None = ...) -> tuple[_win32typing.PyUrlCacheHANDLE, Incomplete]: ... +def FindNextUrlCacheEntry(EnumHandle: _win32typing.PyUrlCacheHANDLE): ... +def FindFirstUrlCacheEntryEx( + SearchPattern: Incomplete | None = ..., Flags: int = ..., Filter: int = ..., GroupId=... +) -> tuple[_win32typing.PyUrlCacheHANDLE, Incomplete]: ... +def FindNextUrlCacheEntryEx(EnumHandle: _win32typing.PyUrlCacheHANDLE): ... +def FindCloseUrlCache(EnumHandle: _win32typing.PyUrlCacheHANDLE) -> None: ... +def FindFirstUrlCacheGroup(Filter) -> tuple[_win32typing.PyUrlCacheHANDLE, Incomplete]: ... +def FindNextUrlCacheGroup(Find: int): ... +def GetUrlCacheEntryInfo(UrlName): ... +def DeleteUrlCacheGroup(GroupId, Attributes) -> None: ... +def CreateUrlCacheGroup(Flags: int = ...): ... +def CreateUrlCacheEntry(UrlName, ExpectedFileSize, FileExtension): ... +def CommitUrlCacheEntry( + UrlName, + LocalFileName, + CacheEntryType, + ExpireTime: _win32typing.PyTime | None = ..., + LastModifiedTime: _win32typing.PyTime | None = ..., + HeaderInfo: Incomplete | None = ..., + OriginalUrl: Incomplete | None = ..., +): ... +def SetUrlCacheEntryGroup(UrlName, Flags, GroupId) -> None: ... +def GetUrlCacheGroupAttribute(GroupId, Attributes): ... +def SetUrlCacheGroupAttribute(GroupId, Attributes, GroupInfo, Flags=...) -> None: ... +def DeleteUrlCacheEntry(UrlName) -> None: ... +def WinHttpGetDefaultProxyConfiguration(*args, **kwargs): ... # incomplete +def WinHttpGetIEProxyConfigForCurrentUser(*args, **kwargs): ... # incomplete +def WinHttpGetProxyForUrl(*args, **kwargs): ... # incomplete +def WinHttpOpen(*args, **kwargs): ... # incomplete + +UNICODE: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32job.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32job.pyi new file mode 100644 index 000000000..23b5d7af0 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32job.pyi @@ -0,0 +1,74 @@ +import _win32typing +from win32.lib.pywintypes import error as error + +def AssignProcessToJobObject(hJob: int, hProcess: int) -> None: ... +def CreateJobObject(__jobAttributes: _win32typing.PySECURITY_ATTRIBUTES | None, __name: str) -> None: ... +def OpenJobObject(desiredAccess, inheritHandles, name) -> None: ... +def TerminateJobObject(hJob: int, exitCode) -> None: ... +def UserHandleGrantAccess(hUserHandle: int, hJob: int, grant) -> None: ... +def IsProcessInJob(__hProcess: int, __hJob: int): ... +def QueryInformationJobObject(Job: int, JobObjectInfoClass): ... +def SetInformationJobObject(Job: int, JobObjectInfoClass, JobObjectInfo) -> None: ... + +JOB_OBJECT_ALL_ACCESS: int +JOB_OBJECT_ASSIGN_PROCESS: int +JOB_OBJECT_BASIC_LIMIT_VALID_FLAGS: int +JOB_OBJECT_EXTENDED_LIMIT_VALID_FLAGS: int +JOB_OBJECT_LIMIT_ACTIVE_PROCESS: int +JOB_OBJECT_LIMIT_AFFINITY: int +JOB_OBJECT_LIMIT_BREAKAWAY_OK: int +JOB_OBJECT_LIMIT_DIE_ON_UNHANDLED_EXCEPTION: int +JOB_OBJECT_LIMIT_JOB_MEMORY: int +JOB_OBJECT_LIMIT_JOB_TIME: int +JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE: int +JOB_OBJECT_LIMIT_PRESERVE_JOB_TIME: int +JOB_OBJECT_LIMIT_PRIORITY_CLASS: int +JOB_OBJECT_LIMIT_PROCESS_MEMORY: int +JOB_OBJECT_LIMIT_PROCESS_TIME: int +JOB_OBJECT_LIMIT_SCHEDULING_CLASS: int +JOB_OBJECT_LIMIT_SILENT_BREAKAWAY_OK: int +JOB_OBJECT_LIMIT_VALID_FLAGS: int +JOB_OBJECT_LIMIT_WORKINGSET: int +JOB_OBJECT_MSG_ABNORMAL_EXIT_PROCESS: int +JOB_OBJECT_MSG_ACTIVE_PROCESS_LIMIT: int +JOB_OBJECT_MSG_ACTIVE_PROCESS_ZERO: int +JOB_OBJECT_MSG_END_OF_JOB_TIME: int +JOB_OBJECT_MSG_END_OF_PROCESS_TIME: int +JOB_OBJECT_MSG_EXIT_PROCESS: int +JOB_OBJECT_MSG_JOB_MEMORY_LIMIT: int +JOB_OBJECT_MSG_NEW_PROCESS: int +JOB_OBJECT_MSG_PROCESS_MEMORY_LIMIT: int +JOB_OBJECT_POST_AT_END_OF_JOB: int +JOB_OBJECT_QUERY: int +JOB_OBJECT_SECURITY_FILTER_TOKENS: int +JOB_OBJECT_SECURITY_NO_ADMIN: int +JOB_OBJECT_SECURITY_ONLY_TOKEN: int +JOB_OBJECT_SECURITY_RESTRICTED_TOKEN: int +JOB_OBJECT_SECURITY_VALID_FLAGS: int +JOB_OBJECT_SET_ATTRIBUTES: int +JOB_OBJECT_SET_SECURITY_ATTRIBUTES: int +JOB_OBJECT_TERMINATE: int +JOB_OBJECT_TERMINATE_AT_END_OF_JOB: int +JOB_OBJECT_UI_VALID_FLAGS: int +JOB_OBJECT_UILIMIT_ALL: int +JOB_OBJECT_UILIMIT_DESKTOP: int +JOB_OBJECT_UILIMIT_DISPLAYSETTINGS: int +JOB_OBJECT_UILIMIT_EXITWINDOWS: int +JOB_OBJECT_UILIMIT_GLOBALATOMS: int +JOB_OBJECT_UILIMIT_HANDLES: int +JOB_OBJECT_UILIMIT_NONE: int +JOB_OBJECT_UILIMIT_READCLIPBOARD: int +JOB_OBJECT_UILIMIT_SYSTEMPARAMETERS: int +JOB_OBJECT_UILIMIT_WRITECLIPBOARD: int +JobObjectAssociateCompletionPortInformation: int +JobObjectBasicAccountingInformation: int +JobObjectBasicAndIoAccountingInformation: int +JobObjectBasicLimitInformation: int +JobObjectBasicUIRestrictions: int +JobObjectEndOfJobTimeInformation: int +JobObjectExtendedLimitInformation: int +JobObjectJobSetInformation: int +JobObjectSecurityLimitInformation: int +MaxJobObjectInfoClass: int +JobObjectBasicProcessIdList: int +UNICODE: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32lz.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32lz.pyi new file mode 100644 index 000000000..21a271c8b --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32lz.pyi @@ -0,0 +1,9 @@ +from _typeshed import Incomplete + +from win32.lib.pywintypes import error as error + +def GetExpandedName(Source) -> str: ... +def Close(handle) -> None: ... +def Copy(hSrc, hDest): ... +def Init(handle) -> None: ... +def OpenFile(fileName: str, action) -> tuple[Incomplete, Incomplete]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32net.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32net.pyi new file mode 100644 index 000000000..453681066 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32net.pyi @@ -0,0 +1,90 @@ +from _typeshed import Incomplete + +from win32.lib.pywintypes import error as error + +def NetGetJoinInformation() -> tuple[str, Incomplete]: ... +def NetGroupGetInfo(server: str, groupname: str, level): ... +def NetGroupGetUsers( + server: str, groupName: str, level, resumeHandle: int = ..., prefLen: int = ... +) -> tuple[Incomplete, Incomplete, Incomplete, Incomplete]: ... +def NetGroupSetUsers(server: str, group: str, level, members: tuple[Incomplete, Incomplete]) -> None: ... +def NetGroupSetInfo(server: str, groupname: str, level, data) -> None: ... +def NetGroupAdd(server: str, level, data) -> None: ... +def NetGroupAddUser(server: str, group: str, username: str) -> None: ... +def NetGroupDel(server: str, groupname: str) -> None: ... +def NetGroupDelUser(server: str, group: str, username: str) -> None: ... +def NetGroupEnum(server: str, level, prefLen, resumeHandle=...) -> tuple[Incomplete, Incomplete, Incomplete, Incomplete]: ... +def NetLocalGroupAddMembers(server: str, group: str, level, members: tuple[Incomplete, Incomplete]) -> None: ... +def NetLocalGroupDelMembers(server: str, group: str, members: list[str]) -> None: ... +def NetLocalGroupGetMembers( + server: str, groupName: str, level, resumeHandle: int = ..., prefLen: int = ... +) -> tuple[Incomplete, Incomplete, Incomplete, Incomplete]: ... +def NetLocalGroupSetMembers(server: str, group: str, level, members: tuple[Incomplete, Incomplete]) -> None: ... +def NetMessageBufferSend(domain: str, userName: str, fromName: str, message: str) -> None: ... +def NetMessageNameAdd(server, msgname) -> None: ... +def NetMessageNameDel(server, msgname) -> None: ... +def NetMessageNameEnum(Server) -> None: ... +def NetServerEnum( + server: str, level, _type, prefLen, domain: str | None = ..., resumeHandle: int = ... +) -> tuple[Incomplete, Incomplete, Incomplete, Incomplete]: ... +def NetServerGetInfo(server: str, level): ... +def NetServerSetInfo(server: str, level, data) -> None: ... +def NetShareAdd(server: str, level, data) -> None: ... +def NetShareDel(server: str, shareName: str, reserved: int = ...) -> None: ... +def NetShareCheck(server: str, deviceName: str) -> tuple[Incomplete, Incomplete]: ... +def NetShareEnum( + server: str, level, prefLen, serverName, resumeHandle=... +) -> tuple[Incomplete, Incomplete, Incomplete, Incomplete]: ... +def NetShareGetInfo(server: str, netname: str, level): ... +def NetShareSetInfo(server: str, netname: str, level, data) -> None: ... +def NetUserAdd(server: str, level, data) -> None: ... +def NetUserChangePassword(server: str, username: str, oldPassword: str, newPassword: str) -> None: ... +def NetUserEnum(server: str, level, arg, prefLen, resumeHandle=...) -> tuple[Incomplete, Incomplete, Incomplete, Incomplete]: ... +def NetUserGetGroups(serverName: str, userName: str) -> list[tuple[Incomplete, Incomplete]]: ... +def NetUserGetInfo(server: str, username: str, level): ... +def NetUserGetLocalGroups(serverName: str, userName: str, flags) -> list[Incomplete]: ... +def NetUserSetInfo(server: str, username: str, level, data) -> None: ... +def NetUserDel(server: str, username: str) -> None: ... +def NetUserModalsGet(server: str, level): ... +def NetUserModalsSet(server: str, level, data) -> None: ... +def NetWkstaUserEnum(server: str, level, prefLen, resumeHandle=...) -> tuple[Incomplete, Incomplete, Incomplete, Incomplete]: ... +def NetWkstaGetInfo(server: str, level): ... +def NetWkstaSetInfo(server: str, level, data) -> None: ... +def NetWkstaTransportEnum( + server: str, level, prefLen, resumeHandle=... +) -> tuple[Incomplete, Incomplete, Incomplete, Incomplete]: ... +def NetWkstaTransportAdd(server: str, level, data) -> None: ... +def NetWkstaTransportDel(server: str, TransportName: str, ucond: int = ...) -> None: ... +def NetServerDiskEnum(server: str, level): ... +def NetUseAdd(server: str, level, data) -> None: ... +def NetUseDel(server: str, useName: str, forceCond: int = ...) -> None: ... +def NetUseEnum(server: str, level, prefLen, resumeHandle=...) -> tuple[Incomplete, Incomplete, Incomplete, Incomplete]: ... +def NetUseGetInfo(server: str, usename: str, level: int = ...): ... +def NetGetAnyDCName(server: str | None = ..., domain: str | None = ...) -> str: ... +def NetGetDCName(server: str | None = ..., domain: str | None = ...) -> str: ... +def NetSessionEnum( + level, server: str | None = ..., client: str | None = ..., username: str | None = ... +) -> tuple[Incomplete, ...]: ... +def NetSessionDel(server: str, client: str | None = ..., username: str | None = ...) -> None: ... +def NetSessionGetInfo(level, server: str, client: str, username: str): ... +def NetFileEnum( + level, servername: str | None = ..., basepath: str | None = ..., username: str | None = ... +) -> tuple[Incomplete, ...]: ... +def NetFileClose(servername: str, fileid) -> None: ... +def NetFileGetInfo(level, servername: str, fileid): ... +def NetStatisticsGet(server: str, service: str, level, options): ... +def NetServerComputerNameAdd(ServerName: str, EmulatedDomainName: str, EmulatedServerName: str) -> None: ... +def NetServerComputerNameDel(ServerName: str, EmulatedServerName: str) -> None: ... +def NetValidateName(Server: str, Name: str, NameType, Account: str | None = ..., Password: str | None = ...) -> None: ... +def NetValidatePasswordPolicy(Server: str, Qualifier, ValidationType, arg) -> None: ... +def NetLocalGroupAdd(*args, **kwargs): ... # incomplete +def NetLocalGroupDel(*args, **kwargs): ... # incomplete +def NetLocalGroupEnum(*args, **kwargs): ... # incomplete +def NetLocalGroupGetInfo(*args, **kwargs): ... # incomplete +def NetLocalGroupSetInfo(*args, **kwargs): ... # incomplete + +SERVICE_SERVER: str +SERVICE_WORKSTATION: str +USE_FORCE: int +USE_LOTS_OF_FORCE: int +USE_NOFORCE: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32pdh.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32pdh.pyi new file mode 100644 index 000000000..c2b768e16 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32pdh.pyi @@ -0,0 +1,60 @@ +from _typeshed import Incomplete + +from win32.lib.pywintypes import error as error + +def AddCounter(hQuery, path: str, userData: int = ...): ... +def AddEnglishCounter(hQuery, path: str, userData: int = ...): ... +def RemoveCounter(handle) -> None: ... +def EnumObjectItems(DataSource: str | None, machine: str | None, _object: str, detailLevel, flags=...): ... +def EnumObjects(DataSource: str | None, machine: str | None, detailLevel: int, refresh: bool = ...): ... +def OpenQuery(DataSource: Incomplete | None = ..., userData: int = ...): ... +def CloseQuery(handle) -> None: ... +def MakeCounterPath( + elements: tuple[Incomplete, Incomplete, Incomplete, Incomplete, Incomplete, Incomplete], flags=... +) -> None: ... +def GetCounterInfo(handle, bRetrieveExplainText) -> None: ... +def GetFormattedCounterValue(handle, _format) -> tuple[Incomplete, Incomplete]: ... +def CollectQueryData(hQuery) -> None: ... +def ValidatePath(path: str): ... +def ExpandCounterPath(wildCardPath: str) -> tuple[Incomplete, Incomplete]: ... +def ParseCounterPath(path: str, flags=...) -> tuple[Incomplete, Incomplete, Incomplete, Incomplete, Incomplete, Incomplete]: ... +def ParseInstanceName(instanceName: str) -> tuple[Incomplete, Incomplete, Incomplete]: ... +def SetCounterScaleFactor(hCounter, factor) -> None: ... +def BrowseCounters( + Flags: tuple[Incomplete, ...] | None, + hWndOwner: int, + CallBack1, + CallBack2, + DialogBoxCaption: str | None = ..., + InitialPath: Incomplete | None = ..., + DataSource: Incomplete | None = ..., + ReturnMultiple: bool = ..., + CallBackArg: Incomplete | None = ..., +) -> str: ... +def ConnectMachine(machineName: str) -> str: ... +def LookupPerfIndexByName(machineName: str, instanceName: str): ... +def LookupPerfNameByIndex(machineName: str | None, index) -> str: ... +def GetFormattedCounterArray(*args, **kwargs): ... # incomplete + +PDH_FMT_1000: int +PDH_FMT_ANSI: int +PDH_FMT_DOUBLE: int +PDH_FMT_LARGE: int +PDH_FMT_LONG: int +PDH_FMT_NODATA: int +PDH_FMT_NOSCALE: int +PDH_FMT_RAW: int +PDH_FMT_UNICODE: int +PDH_MAX_SCALE: int +PDH_MIN_SCALE: int +PDH_PATH_WBEM_INPUT: int +PDH_PATH_WBEM_RESULT: int +PDH_VERSION: int +PERF_DETAIL_ADVANCED: int +PERF_DETAIL_EXPERT: int +PERF_DETAIL_NOVICE: int +PERF_DETAIL_WIZARD: int + +class counter_status_error(Exception): ... + +PDH_FMT_NOCAP100: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32pipe.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32pipe.pyi new file mode 100644 index 000000000..7fa9ca0fe --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32pipe.pyi @@ -0,0 +1,60 @@ +from _typeshed import Incomplete + +import _win32typing +from win32.lib.pywintypes import error as error + +def GetNamedPipeHandleState(hPipe: int, bGetCollectionData=...) -> tuple[Incomplete, Incomplete, Incomplete, Incomplete, str]: ... +def SetNamedPipeHandleState( + __hPipe: int, __Mode: int, __MaxCollectionCount: None | Incomplete, __CollectDataTimeout: None | Incomplete +) -> None: ... +def ConnectNamedPipe(hPipe: int, overlapped: _win32typing.PyOVERLAPPED | None = ...): ... +def TransactNamedPipe( + pipeName, + writeData: str, + buffer_bufSize: _win32typing.PyOVERLAPPEDReadBuffer, + overlapped: _win32typing.PyOVERLAPPED | None = ..., +) -> str: ... +def CallNamedPipe(pipeName, data: str, bufSize, timeOut) -> str: ... +def CreatePipe(__sa: _win32typing.PySECURITY_ATTRIBUTES, __nSize: int) -> tuple[int, int]: ... +def FdCreatePipe(sa: _win32typing.PySECURITY_ATTRIBUTES, nSize, mode) -> tuple[Incomplete, Incomplete]: ... +def CreateNamedPipe( + pipeName: str, + openMode, + pipeMode, + nMaxInstances, + nOutBufferSize, + nInBufferSize, + nDefaultTimeOut, + sa: _win32typing.PySECURITY_ATTRIBUTES, +) -> int: ... +def DisconnectNamedPipe(hFile: int) -> None: ... +def GetOverlappedResult(__hFile: int, __overlapped: _win32typing.PyOVERLAPPED, __bWait: int | bool) -> int: ... +def WaitNamedPipe(pipeName: str, timeout) -> None: ... +def GetNamedPipeInfo(hNamedPipe: int) -> tuple[Incomplete, Incomplete, Incomplete, Incomplete]: ... +def PeekNamedPipe(__hPipe: int, __size: int) -> tuple[str, int, Incomplete]: ... +def GetNamedPipeClientProcessId(hPipe: int): ... +def GetNamedPipeServerProcessId(hPipe: int): ... +def GetNamedPipeClientSessionId(hPipe: int): ... +def GetNamedPipeServerSessionId(hPipe: int): ... +def popen(cmdstring: str, mode: str): ... +def popen2(*args, **kwargs): ... # incomplete +def popen3(*args, **kwargs): ... # incomplete +def popen4(*args, **kwargs): ... # incomplete + +FILE_FLAG_FIRST_PIPE_INSTANCE: int +PIPE_ACCEPT_REMOTE_CLIENTS: int +PIPE_REJECT_REMOTE_CLIENTS: int +NMPWAIT_NOWAIT: int +NMPWAIT_USE_DEFAULT_WAIT: int +NMPWAIT_WAIT_FOREVER: int +PIPE_ACCESS_DUPLEX: int +PIPE_ACCESS_INBOUND: int +PIPE_ACCESS_OUTBOUND: int +PIPE_NOWAIT: int +PIPE_READMODE_BYTE: int +PIPE_READMODE_MESSAGE: int +PIPE_TYPE_BYTE: int +PIPE_TYPE_MESSAGE: int +PIPE_UNLIMITED_INSTANCES: int +PIPE_WAIT: int +UNICODE: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32print.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32print.pyi new file mode 100644 index 000000000..7d726f422 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32print.pyi @@ -0,0 +1,197 @@ +from _typeshed import Incomplete + +import _win32typing + +def OpenPrinter(printer: str, Defaults: Incomplete | None = ...) -> _win32typing.PyPrinterHANDLE: ... +def GetPrinter(hPrinter: _win32typing.PyPrinterHANDLE, Level: int = ...): ... +def SetPrinter(hPrinter: _win32typing.PyPrinterHANDLE, Level, pPrinter, Command) -> None: ... +def ClosePrinter(hPrinter: _win32typing.PyPrinterHANDLE) -> None: ... +def AddPrinterConnection(printer: str): ... +def DeletePrinterConnection(printer: str): ... +def EnumPrinters(flags, name: str | None = ..., level: int = ...): ... +def GetDefaultPrinter() -> str: ... +def GetDefaultPrinterW() -> str: ... +def SetDefaultPrinter(printer: str): ... +def SetDefaultPrinterW(Printer: str): ... +def StartDocPrinter(hprinter: _win32typing.PyPrinterHANDLE, _tuple, level: int = ...): ... +def EndDocPrinter(hPrinter: _win32typing.PyPrinterHANDLE): ... +def AbortPrinter(hPrinter: _win32typing.PyPrinterHANDLE) -> None: ... +def StartPagePrinter(hprinter: _win32typing.PyPrinterHANDLE) -> None: ... +def EndPagePrinter(hprinter: _win32typing.PyPrinterHANDLE) -> None: ... +def StartDoc(hdc: int, docinfo): ... +def EndDoc(hdc: int) -> None: ... +def AbortDoc(hdc: int) -> None: ... +def StartPage(hdc: int) -> None: ... +def EndPage(hdc: int) -> None: ... +def WritePrinter(hprinter: _win32typing.PyPrinterHANDLE, buf: str): ... +def EnumJobs(hPrinter: _win32typing.PyPrinterHANDLE, FirstJob, NoJobs, Level=...): ... +def GetJob(hPrinter: _win32typing.PyPrinterHANDLE, JobID, Level: int = ...): ... +def SetJob(hPrinter: _win32typing.PyPrinterHANDLE, JobID, Level, JobInfo, Command): ... +def DocumentProperties( + HWnd: int, + hPrinter: _win32typing.PyPrinterHANDLE, + DeviceName: str, + DevModeOutput: _win32typing.PyDEVMODE, + DevModeInput: _win32typing.PyDEVMODE, + Mode, +): ... +def EnumPrintProcessors(Server: str | None = ..., Environment: str | None = ...) -> tuple[str, ...]: ... +def EnumPrintProcessorDatatypes(ServerName: str, PrintProcessorName: str) -> tuple[str, ...]: ... +def EnumPrinterDrivers(Server: str | None = ..., Environment: str | None = ..., Level=...) -> tuple[Incomplete, ...]: ... +def EnumForms(hprinter: _win32typing.PyPrinterHANDLE) -> tuple[_win32typing.FORM_INFO_1, ...]: ... +def AddForm(hprinter: _win32typing.PyPrinterHANDLE, Form) -> None: ... +def DeleteForm(hprinter: _win32typing.PyPrinterHANDLE, FormName: str) -> None: ... +def GetForm(hprinter: _win32typing.PyPrinterHANDLE, FormName: str) -> None: ... +def SetForm(hprinter: _win32typing.PyPrinterHANDLE, FormName: str, Form) -> None: ... +def AddJob(hprinter: _win32typing.PyPrinterHANDLE) -> None: ... +def ScheduleJob(hprinter: _win32typing.PyPrinterHANDLE, JobId) -> None: ... +def DeviceCapabilities(Device: str, Port: str, Capability, DEVMODE: _win32typing.PyDEVMODE | None = ...) -> None: ... +def GetDeviceCaps(hdc: int, Index): ... +def EnumMonitors(Name: str, Level) -> tuple[Incomplete, ...]: ... +def EnumPorts(Name: str, Level) -> tuple[Incomplete, ...]: ... +def GetPrintProcessorDirectory(Name: str, Environment: str) -> str: ... +def GetPrinterDriverDirectory(Name: str, Environment: str) -> str: ... +def AddPrinter(Name: str, Level, pPrinter) -> _win32typing.PyPrinterHANDLE: ... +def DeletePrinter(hPrinter: _win32typing.PyPrinterHANDLE) -> None: ... +def DeletePrinterDriver(Server: str, Environment: str, DriverName: str) -> None: ... +def DeletePrinterDriverEx(Server: str, Environment: str, DriverName: str, DeleteFlag, VersionFlag) -> None: ... +def FlushPrinter(Printer: _win32typing.PyPrinterHANDLE, Buf, Sleep): ... + +DEF_PRIORITY: int +DI_APPBANDING: int +DI_ROPS_READ_DESTINATION: int +DPD_DELETE_ALL_FILES: int +DPD_DELETE_SPECIFIC_VERSION: int +DPD_DELETE_UNUSED_FILES: int +DSPRINT_PENDING: int +DSPRINT_PUBLISH: int +DSPRINT_REPUBLISH: int +DSPRINT_UNPUBLISH: int +DSPRINT_UPDATE: int +FORM_BUILTIN: int +FORM_PRINTER: int +FORM_USER: int +JOB_ACCESS_ADMINISTER: int +JOB_ACCESS_READ: int +JOB_ALL_ACCESS: int +JOB_CONTROL_CANCEL: int +JOB_CONTROL_DELETE: int +JOB_CONTROL_LAST_PAGE_EJECTED: int +JOB_CONTROL_PAUSE: int +JOB_CONTROL_RESTART: int +JOB_CONTROL_RESUME: int +JOB_CONTROL_SENT_TO_PRINTER: int +JOB_EXECUTE: int +JOB_INFO_1: int +JOB_POSITION_UNSPECIFIED: int +JOB_READ: int +JOB_STATUS_BLOCKED_DEVQ: int +JOB_STATUS_COMPLETE: int +JOB_STATUS_DELETED: int +JOB_STATUS_DELETING: int +JOB_STATUS_ERROR: int +JOB_STATUS_OFFLINE: int +JOB_STATUS_PAPEROUT: int +JOB_STATUS_PAUSED: int +JOB_STATUS_PRINTED: int +JOB_STATUS_PRINTING: int +JOB_STATUS_RESTART: int +JOB_STATUS_SPOOLING: int +JOB_STATUS_USER_INTERVENTION: int +JOB_WRITE: int +MAX_PRIORITY: int +MIN_PRIORITY: int +PORT_STATUS_DOOR_OPEN: int +PORT_STATUS_NO_TONER: int +PORT_STATUS_OFFLINE: int +PORT_STATUS_OUTPUT_BIN_FULL: int +PORT_STATUS_OUT_OF_MEMORY: int +PORT_STATUS_PAPER_JAM: int +PORT_STATUS_PAPER_OUT: int +PORT_STATUS_PAPER_PROBLEM: int +PORT_STATUS_POWER_SAVE: int +PORT_STATUS_TONER_LOW: int +PORT_STATUS_TYPE_ERROR: int +PORT_STATUS_TYPE_INFO: int +PORT_STATUS_TYPE_WARNING: int +PORT_STATUS_USER_INTERVENTION: int +PORT_STATUS_WARMING_UP: int +PORT_TYPE_NET_ATTACHED: int +PORT_TYPE_READ: int +PORT_TYPE_REDIRECTED: int +PORT_TYPE_WRITE: int +PRINTER_ACCESS_ADMINISTER: int +PRINTER_ACCESS_USE: int +PRINTER_ALL_ACCESS: int +PRINTER_ATTRIBUTE_DEFAULT: int +PRINTER_ATTRIBUTE_DIRECT: int +PRINTER_ATTRIBUTE_DO_COMPLETE_FIRST: int +PRINTER_ATTRIBUTE_ENABLE_BIDI: int +PRINTER_ATTRIBUTE_ENABLE_DEVQ: int +PRINTER_ATTRIBUTE_FAX: int +PRINTER_ATTRIBUTE_HIDDEN: int +PRINTER_ATTRIBUTE_KEEPPRINTEDJOBS: int +PRINTER_ATTRIBUTE_LOCAL: int +PRINTER_ATTRIBUTE_NETWORK: int +PRINTER_ATTRIBUTE_PUBLISHED: int +PRINTER_ATTRIBUTE_QUEUED: int +PRINTER_ATTRIBUTE_RAW_ONLY: int +PRINTER_ATTRIBUTE_SHARED: int +PRINTER_ATTRIBUTE_TS: int +PRINTER_ATTRIBUTE_WORK_OFFLINE: int +PRINTER_CONTROL_PAUSE: int +PRINTER_CONTROL_PURGE: int +PRINTER_CONTROL_RESUME: int +PRINTER_CONTROL_SET_STATUS: int +PRINTER_ENUM_CONNECTIONS: int +PRINTER_ENUM_CONTAINER: int +PRINTER_ENUM_DEFAULT: int +PRINTER_ENUM_EXPAND: int +PRINTER_ENUM_ICON1: int +PRINTER_ENUM_ICON2: int +PRINTER_ENUM_ICON3: int +PRINTER_ENUM_ICON4: int +PRINTER_ENUM_ICON5: int +PRINTER_ENUM_ICON6: int +PRINTER_ENUM_ICON7: int +PRINTER_ENUM_ICON8: int +PRINTER_ENUM_LOCAL: int +PRINTER_ENUM_NAME: int +PRINTER_ENUM_NETWORK: int +PRINTER_ENUM_REMOTE: int +PRINTER_ENUM_SHARED: int +PRINTER_EXECUTE: int +PRINTER_INFO_1: int +PRINTER_READ: int +PRINTER_STATUS_BUSY: int +PRINTER_STATUS_DOOR_OPEN: int +PRINTER_STATUS_ERROR: int +PRINTER_STATUS_INITIALIZING: int +PRINTER_STATUS_IO_ACTIVE: int +PRINTER_STATUS_MANUAL_FEED: int +PRINTER_STATUS_NOT_AVAILABLE: int +PRINTER_STATUS_NO_TONER: int +PRINTER_STATUS_OFFLINE: int +PRINTER_STATUS_OUTPUT_BIN_FULL: int +PRINTER_STATUS_OUT_OF_MEMORY: int +PRINTER_STATUS_PAGE_PUNT: int +PRINTER_STATUS_PAPER_JAM: int +PRINTER_STATUS_PAPER_OUT: int +PRINTER_STATUS_PAPER_PROBLEM: int +PRINTER_STATUS_PAUSED: int +PRINTER_STATUS_PENDING_DELETION: int +PRINTER_STATUS_POWER_SAVE: int +PRINTER_STATUS_PRINTING: int +PRINTER_STATUS_PROCESSING: int +PRINTER_STATUS_SERVER_UNKNOWN: int +PRINTER_STATUS_TONER_LOW: int +PRINTER_STATUS_USER_INTERVENTION: int +PRINTER_STATUS_WAITING: int +PRINTER_STATUS_WARMING_UP: int +PRINTER_WRITE: int +SERVER_ACCESS_ADMINISTER: int +SERVER_ACCESS_ENUMERATE: int +SERVER_ALL_ACCESS: int +SERVER_EXECUTE: int +SERVER_READ: int +SERVER_WRITE: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32process.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32process.pyi new file mode 100644 index 000000000..c80062a07 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32process.pyi @@ -0,0 +1,122 @@ +from _typeshed import Incomplete + +import _win32typing +from win32.lib.pywintypes import error as error + +def STARTUPINFO() -> _win32typing.PySTARTUPINFO: ... +def beginthreadex(sa: _win32typing.PySECURITY_ATTRIBUTES, stackSize, entryPoint, args, flags) -> tuple[int, Incomplete]: ... +def CreateRemoteThread( + hprocess: int, sa: _win32typing.PySECURITY_ATTRIBUTES, stackSize, entryPoint, Parameter, flags +) -> tuple[int, Incomplete]: ... +def CreateProcess( + __appName: str | None, + __commandLine: str, + __processAttributes: _win32typing.PySECURITY_ATTRIBUTES | None, + __threadAttributes: _win32typing.PySECURITY_ATTRIBUTES | None, + __bInheritHandles: int | bool, + __dwCreationFlags: int, + __newEnvironment: dict[str, str] | None, + __currentDirectory: str | None, + __startupinfo: _win32typing.PySTARTUPINFO, +) -> tuple[int, int, Incomplete, Incomplete]: ... +def CreateProcessAsUser( + hToken: int, + appName: str, + commandLine: str, + processAttributes: _win32typing.PySECURITY_ATTRIBUTES, + threadAttributes: _win32typing.PySECURITY_ATTRIBUTES, + bInheritHandles, + dwCreationFlags, + newEnvironment, + currentDirectory: str, + startupinfo: _win32typing.PySTARTUPINFO, +) -> tuple[int, int, Incomplete, Incomplete]: ... +def GetCurrentProcess() -> int: ... +def GetProcessVersion(processId): ... +def GetCurrentProcessId(): ... +def GetStartupInfo() -> _win32typing.PySTARTUPINFO: ... +def GetPriorityClass(handle: int): ... +def GetExitCodeThread(handle: int): ... +def GetExitCodeProcess(__handle: int) -> int: ... +def GetWindowThreadProcessId(__hwnd: int | None) -> tuple[int, int]: ... +def SetThreadPriority(handle: int, nPriority) -> None: ... +def GetThreadPriority(handle: int): ... +def GetProcessPriorityBoost(Process: int): ... +def SetProcessPriorityBoost(Process: int, DisablePriorityBoost) -> None: ... +def GetThreadPriorityBoost(Thread: int): ... +def SetThreadPriorityBoost(Thread: int, DisablePriorityBoost) -> None: ... +def GetThreadIOPendingFlag(Thread: int): ... +def GetThreadTimes(Thread: int): ... +def GetProcessId(Process: int): ... +def SetPriorityClass(__handle: int, __dwPriorityClass: int) -> None: ... +def AttachThreadInput(idAttach, idAttachTo, Attach) -> None: ... +def SetThreadIdealProcessor(handle: int, dwIdealProcessor): ... +def GetProcessAffinityMask(hProcess: int) -> tuple[Incomplete, Incomplete]: ... +def SetProcessAffinityMask(hProcess: int, mask) -> None: ... +def SetThreadAffinityMask(hThread: int, ThreadAffinityMask): ... +def SuspendThread(handle: int): ... +def ResumeThread(handle: int): ... +def TerminateProcess(__handle: int, __exitCode: int) -> None: ... +def ExitProcess(exitCode) -> None: ... +def EnumProcesses() -> tuple[Incomplete, Incomplete]: ... +def EnumProcessModules(hProcess: int) -> tuple[Incomplete, Incomplete]: ... +def EnumProcessModulesEx(hProcess: int, FilterFlag) -> tuple[Incomplete, Incomplete]: ... +def GetModuleFileNameEx(hProcess: int, hModule: int): ... +def GetProcessMemoryInfo(hProcess: int): ... +def GetProcessTimes(hProcess: int): ... +def GetProcessIoCounters(hProcess: int): ... +def GetProcessWindowStation() -> None: ... +def GetProcessWorkingSetSize(hProcess: int) -> tuple[Incomplete, Incomplete]: ... +def SetProcessWorkingSetSize(hProcess: int, MinimumWorkingSetSize, MaximumWorkingSetSize) -> None: ... +def GetProcessShutdownParameters() -> tuple[Incomplete, Incomplete]: ... +def SetProcessShutdownParameters(Level, Flags) -> None: ... +def GetGuiResources(Process: int, Flags): ... +def IsWow64Process(__Process: int | None = ...) -> bool: ... +def ReadProcessMemory(*args, **kwargs): ... # incomplete +def VirtualAllocEx(*args, **kwargs): ... # incomplete +def VirtualFreeEx(*args, **kwargs): ... # incomplete +def WriteProcessMemory(*args, **kwargs): ... # incomplete + +ABOVE_NORMAL_PRIORITY_CLASS: int +BELOW_NORMAL_PRIORITY_CLASS: int +CREATE_BREAKAWAY_FROM_JOB: int +CREATE_DEFAULT_ERROR_MODE: int +CREATE_NEW_CONSOLE: int +CREATE_NEW_PROCESS_GROUP: int +CREATE_NO_WINDOW: int +CREATE_PRESERVE_CODE_AUTHZ_LEVEL: int +CREATE_SEPARATE_WOW_VDM: int +CREATE_SHARED_WOW_VDM: int +CREATE_SUSPENDED: int +CREATE_UNICODE_ENVIRONMENT: int +DEBUG_ONLY_THIS_PROCESS: int +DEBUG_PROCESS: int +DETACHED_PROCESS: int +HIGH_PRIORITY_CLASS: int +IDLE_PRIORITY_CLASS: int +MAXIMUM_PROCESSORS: int +NORMAL_PRIORITY_CLASS: int +REALTIME_PRIORITY_CLASS: int +STARTF_FORCEOFFFEEDBACK: int +STARTF_FORCEONFEEDBACK: int +STARTF_RUNFULLSCREEN: int +STARTF_USECOUNTCHARS: int +STARTF_USEFILLATTRIBUTE: int +STARTF_USEPOSITION: int +STARTF_USESHOWWINDOW: int +STARTF_USESIZE: int +STARTF_USESTDHANDLES: int +THREAD_MODE_BACKGROUND_BEGIN: int +THREAD_MODE_BACKGROUND_END: int +THREAD_PRIORITY_ABOVE_NORMAL: int +THREAD_PRIORITY_BELOW_NORMAL: int +THREAD_PRIORITY_HIGHEST: int +THREAD_PRIORITY_IDLE: int +THREAD_PRIORITY_LOWEST: int +THREAD_PRIORITY_NORMAL: int +THREAD_PRIORITY_TIME_CRITICAL: int +LIST_MODULES_32BIT: int +LIST_MODULES_64BIT: int +LIST_MODULES_ALL: int +LIST_MODULES_DEFAULT: int +UNICODE: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32profile.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32profile.pyi new file mode 100644 index 000000000..155a77cbd --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32profile.pyi @@ -0,0 +1,19 @@ +import _win32typing + +def CreateEnvironmentBlock(Token: int, Inherit): ... +def DeleteProfile(SidString: str, ProfilePath: str | None = ..., ComputerName: str | None = ...) -> None: ... +def ExpandEnvironmentStringsForUser(Token: int, Src: str) -> str: ... +def GetAllUsersProfileDirectory() -> str: ... +def GetDefaultUserProfileDirectory() -> str: ... +def GetEnvironmentStrings(): ... +def GetProfilesDirectory() -> str: ... +def GetProfileType(): ... +def GetUserProfileDirectory(Token: int) -> str: ... +def LoadUserProfile(hToken: int, ProfileInfo: _win32typing.PyPROFILEINFO) -> _win32typing.PyHKEY: ... +def UnloadUserProfile(Token: int, Profile: _win32typing.PyHKEY) -> None: ... + +PI_APPLYPOLICY: int +PI_NOUI: int +PT_MANDATORY: int +PT_ROAMING: int +PT_TEMPORARY: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32ras.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32ras.pyi new file mode 100644 index 000000000..57be9a176 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32ras.pyi @@ -0,0 +1,54 @@ +from _typeshed import Incomplete + +import _win32typing +from win32.lib.pywintypes import error as error + +def CreatePhonebookEntry(hWnd: int, fileName: str | None = ...) -> None: ... +def Dial(dialExtensions, fileName: str, RasDialParams: _win32typing.RASDIALPARAMS, callback) -> tuple[Incomplete, Incomplete]: ... +def EditPhonebookEntry(hWnd: int, fileName: str, entryName: str | None = ...) -> None: ... +def EnumConnections(): ... +def EnumEntries(reserved: str | None = ..., fileName: str | None = ...) -> None: ... +def GetConnectStatus(hrasconn) -> tuple[Incomplete, Incomplete, str, str]: ... +def GetEntryDialParams( + fileName: str, entryName: str +) -> tuple[Incomplete, Incomplete, Incomplete, Incomplete, Incomplete, Incomplete, Incomplete]: ... +def GetErrorString(error) -> str: ... # noqa: F811 +def HangUp(hras) -> None: ... +def IsHandleValid(__hras: int | None) -> bool: ... +def SetEntryDialParams(fileName: str, RasDialParams, bSavePassword) -> None: ... +def RASDIALEXTENSIONS(*args, **kwargs): ... # incomplete + +RASCS_AllDevicesConnected: int +RASCS_AuthAck: int +RASCS_AuthCallback: int +RASCS_AuthChangePassword: int +RASCS_Authenticate: int +RASCS_Authenticated: int +RASCS_AuthLinkSpeed: int +RASCS_AuthNotify: int +RASCS_AuthProject: int +RASCS_AuthRetry: int +RASCS_CallbackComplete: int +RASCS_CallbackSetByCaller: int +RASCS_ConnectDevice: int +RASCS_Connected: int +RASCS_DeviceConnected: int +RASCS_Disconnected: int +RASCS_Interactive: int +RASCS_LogonNetwork: int +RASCS_OpenPort: int +RASCS_PasswordExpired: int +RASCS_PortOpened: int +RASCS_PrepareForCallback: int +RASCS_Projected: int +RASCS_ReAuthenticate: int +RASCS_RetryAuthentication: int +RASCS_StartAuthentication: int +RASCS_WaitForCallback: int +RASCS_WaitForModemReset: int + +def GetEapUserIdentity(*args, **kwargs): ... # incomplete + +RASEAPF_Logon: int +RASEAPF_NonInteractive: int +RASEAPF_Preview: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32security.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32security.pyi new file mode 100644 index 000000000..d47f00a55 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32security.pyi @@ -0,0 +1,571 @@ +from _typeshed import Incomplete + +import _win32typing +from win32.lib.pywintypes import error as error + +def DsGetSpn( + ServiceType, + ServiceClass: str, + ServiceName: str, + InstancePort: int = ..., + InstanceNames: tuple[str, ...] | None = ..., + InstancePorts: tuple[Incomplete, ...] | None = ..., +) -> tuple[str, ...]: ... +def DsWriteAccountSpn(hDS: _win32typing.PyDS_HANDLE, Operation, Account: str, Spns: tuple[str, ...]) -> None: ... +def DsBind(DomainController: str, DnsDomainName: str) -> _win32typing.PyDS_HANDLE: ... +def DsUnBind(hDS: _win32typing.PyDS_HANDLE) -> None: ... +def DsGetDcName( + computerName: str | None = ..., + domainName: str | None = ..., + domainGUID: _win32typing.PyIID | None = ..., + siteName: str | None = ..., + flags: int = ..., +): ... +def DsCrackNames( + hds: _win32typing.PyDS_HANDLE, flags, formatOffered, formatDesired, names: list[Incomplete] +) -> tuple[Incomplete, Incomplete, Incomplete]: ... +def ACL(__bufSize: int = ...) -> _win32typing.PyACL: ... +def SID() -> _win32typing.PySID: ... +def SECURITY_ATTRIBUTES() -> _win32typing.PySECURITY_ATTRIBUTES: ... +def SECURITY_DESCRIPTOR() -> _win32typing.PySECURITY_DESCRIPTOR: ... +def ImpersonateNamedPipeClient(handle) -> None: ... +def ImpersonateLoggedOnUser(handle: int) -> None: ... +def ImpersonateAnonymousToken(ThreadHandle: int) -> None: ... +def IsTokenRestricted(__TokenHandle: int | None) -> bool: ... +def RevertToSelf() -> None: ... +def LogonUser( + __Username: str, __Domain: str | None, __Password: str, __LogonType: int, __LogonProvider: int +) -> _win32typing.PyHANDLE: ... +def LogonUserEx( + Username: str, Domain: str, Password: str, LogonType, LogonProvider +) -> tuple[int, _win32typing.PySID, Incomplete, Incomplete]: ... +def LookupAccountName(__systemName: str | None, __accountName: str) -> tuple[_win32typing.PySID, str, int]: ... +def LookupAccountSid(__systemName: str, __sid: _win32typing.PySID) -> tuple[str, str, Incomplete]: ... +def GetBinarySid(__SID: str) -> _win32typing.PySID: ... +def SetSecurityInfo( + handle: int, + ObjectType, + SecurityInfo, + Owner: _win32typing.PySID, + Group: _win32typing.PySID, + Dacl: _win32typing.PyACL, + Sacl: _win32typing.PyACL, +) -> None: ... +def GetSecurityInfo(handle: int, ObjectType, SecurityInfo) -> _win32typing.PySECURITY_DESCRIPTOR: ... +def SetNamedSecurityInfo( + __ObjectName: str, + __ObjectType: int, + __SecurityInfo: int, + __Owner: _win32typing.PySID | None, + __Group: _win32typing.PySID | None, + __Dacl: _win32typing.PyACL | None, + __Sacl: _win32typing.PyACL | None, +) -> None: ... +def GetNamedSecurityInfo(__ObjectName: str, __ObjectType: int, __SecurityInfo: int) -> _win32typing.PySECURITY_DESCRIPTOR: ... +def OpenProcessToken(processHandle, desiredAccess) -> int: ... +def LookupPrivilegeValue(systemName: str, privilegeName: str) -> _win32typing.LARGE_INTEGER: ... +def LookupPrivilegeName(SystemName: str, luid: _win32typing.LARGE_INTEGER) -> str: ... +def LookupPrivilegeDisplayName(SystemName: str, Name: str) -> str: ... +def AdjustTokenPrivileges( + TokenHandle: int, bDisableAllPrivileges, NewState: _win32typing.PyTOKEN_PRIVILEGES +) -> _win32typing.PyTOKEN_PRIVILEGES: ... +def AdjustTokenGroups(TokenHandle: int, ResetToDefault, NewState: _win32typing.PyTOKEN_GROUPS) -> _win32typing.PyTOKEN_GROUPS: ... +def GetTokenInformation(TokenHandle: int, TokenInformationClass): ... +def OpenThreadToken(handle: int, desiredAccess, openAsSelf): ... +def SetThreadToken(Thread: int, Token: int) -> None: ... +def GetFileSecurity(__filename: str, __info: int = ...) -> _win32typing.PySECURITY_DESCRIPTOR: ... +def SetFileSecurity(__filename: str, __info: int, __security: _win32typing.PySECURITY_DESCRIPTOR) -> None: ... +def GetUserObjectSecurity(handle: int, info) -> _win32typing.PySECURITY_DESCRIPTOR: ... +def SetUserObjectSecurity(handle: int, info, security: _win32typing.PySECURITY_DESCRIPTOR) -> None: ... +def GetKernelObjectSecurity(handle: int, info) -> _win32typing.PySECURITY_DESCRIPTOR: ... +def SetKernelObjectSecurity(handle: int, info, security: _win32typing.PySECURITY_DESCRIPTOR) -> None: ... +def SetTokenInformation(TokenHandle: int, TokenInformationClass, TokenInformation) -> None: ... +def LsaOpenPolicy(system_name: str, access_mask) -> _win32typing.PyLSA_HANDLE: ... +def LsaClose(PolicyHandle: int) -> None: ... +def LsaQueryInformationPolicy(PolicyHandle: _win32typing.PyLSA_HANDLE, InformationClass) -> None: ... +def LsaSetInformationPolicy(PolicyHandle: _win32typing.PyLSA_HANDLE, InformationClass, Information) -> None: ... +def LsaAddAccountRights( + PolicyHandle: _win32typing.PyLSA_HANDLE, AccountSid: _win32typing.PySID, UserRights: tuple[Incomplete, ...] +) -> None: ... +def LsaRemoveAccountRights( + PolicyHandle: _win32typing.PyLSA_HANDLE, AccountSid: _win32typing.PySID, AllRights, UserRights: tuple[Incomplete, ...] +) -> None: ... +def LsaEnumerateAccountRights(PolicyHandle: _win32typing.PyLSA_HANDLE, AccountSid: _win32typing.PySID) -> list[str]: ... +def LsaEnumerateAccountsWithUserRight(PolicyHandle: _win32typing.PyLSA_HANDLE, UserRight) -> tuple[_win32typing.PySID, ...]: ... +def ConvertSidToStringSid(__Sid: _win32typing.PySID) -> str: ... +def ConvertStringSidToSid(__StringSid: str) -> _win32typing.PySID: ... +def ConvertSecurityDescriptorToStringSecurityDescriptor( + SecurityDescriptor: _win32typing.PySECURITY_DESCRIPTOR, RequestedStringSDRevision, SecurityInformation +) -> str: ... +def ConvertStringSecurityDescriptorToSecurityDescriptor( + StringSecurityDescriptor: str, StringSDRevision +) -> _win32typing.PySECURITY_DESCRIPTOR: ... +def LsaStorePrivateData(PolicyHandle: _win32typing.PyLSA_HANDLE, KeyName: str, PrivateData) -> None: ... +def LsaRetrievePrivateData(PolicyHandle: _win32typing.PyLSA_HANDLE, KeyName: str) -> str: ... +def LsaRegisterPolicyChangeNotification(InformationClass, NotificationEventHandle: int) -> None: ... +def LsaUnregisterPolicyChangeNotification(InformationClass, NotificationEventHandle: int) -> None: ... +def CryptEnumProviders() -> list[tuple[str, Incomplete]]: ... +def EnumerateSecurityPackages() -> tuple[Incomplete, ...]: ... +def AllocateLocallyUniqueId() -> None: ... +def ImpersonateSelf(ImpersonationLevel) -> None: ... +def DuplicateToken(ExistingTokenHandle: int, ImpersonationLevel) -> int: ... +def DuplicateTokenEx( + ExistingToken: int, + ImpersonationLevel, + DesiredAccess, + TokenType, + TokenAttributes: _win32typing.PySECURITY_ATTRIBUTES | None = ..., +) -> int: ... +def CheckTokenMembership(TokenHandle: int, SidToCheck: _win32typing.PySID): ... +def CreateRestrictedToken( + ExistingTokenHandle: int, + Flags, + SidsToDisable: tuple[_win32typing.PySID_AND_ATTRIBUTES, ...], + PrivilegesToDelete: tuple[_win32typing.PyLUID_AND_ATTRIBUTES, ...], + SidsToRestrict: tuple[_win32typing.PySID_AND_ATTRIBUTES, ...], +) -> int: ... +def LsaRegisterLogonProcess(LogonProcessName: str) -> _win32typing.PyLsaLogon_HANDLE: ... +def LsaConnectUntrusted() -> _win32typing.PyLsaLogon_HANDLE: ... +def LsaDeregisterLogonProcess(LsaHandle: _win32typing.PyLsaLogon_HANDLE) -> None: ... +def LsaLookupAuthenticationPackage(LsaHandle: _win32typing.PyLsaLogon_HANDLE, PackageName: str): ... +def LsaEnumerateLogonSessions() -> tuple[Incomplete, ...]: ... +def LsaGetLogonSessionData(LogonId) -> tuple[Incomplete, ...]: ... +def AcquireCredentialsHandle( + Principal, Package, CredentialUse, LogonID, AuthData +) -> tuple[_win32typing.PyCredHandle, _win32typing.PyTime]: ... +def InitializeSecurityContext( + Credential: _win32typing.PyCredHandle, + Context: _win32typing.PyCtxtHandle, + TargetName, + ContextReq, + TargetDataRep, + pInput: _win32typing.PySecBufferDesc, + NewContext: _win32typing.PyCtxtHandle, + pOutput: _win32typing.PySecBufferDesc, +) -> tuple[Incomplete, Incomplete, _win32typing.PyTime]: ... +def AcceptSecurityContext( + Credential: _win32typing.PyCredHandle, + Context: _win32typing.PyCtxtHandle, + pInput: _win32typing.PySecBufferDesc, + ContextReq, + TargetDataRep, + NewContext: _win32typing.PyCtxtHandle, + pOutput: _win32typing.PySecBufferDesc, +) -> tuple[Incomplete, Incomplete, Incomplete]: ... +def QuerySecurityPackageInfo(PackageName): ... +def LsaCallAuthenticationPackage( + LsaHandle: _win32typing.PyLsaLogon_HANDLE, AuthenticationPackage, MessageType, ProtocolSubmitBuffer +) -> None: ... +def TranslateName(accountName: str, accountNameFormat, accountNameFormat1, numChars=...) -> str: ... +def CreateWellKnownSid(WellKnownSidType, DomainSid: _win32typing.PySID | None = ...) -> _win32typing.PySID: ... +def MapGenericMask(AccessMask, GenericMapping: tuple[Incomplete, Incomplete, Incomplete, Incomplete]): ... + +ACCESS_ALLOWED_ACE_TYPE: int +ACCESS_ALLOWED_OBJECT_ACE_TYPE: int +ACCESS_DENIED_ACE_TYPE: int +ACCESS_DENIED_OBJECT_ACE_TYPE: int +ACL_REVISION: int +ACL_REVISION_DS: int +AuditCategoryAccountLogon: int +AuditCategoryAccountManagement: int +AuditCategoryDetailedTracking: int +AuditCategoryDirectoryServiceAccess: int +AuditCategoryLogon: int +AuditCategoryObjectAccess: int +AuditCategoryPolicyChange: int +AuditCategoryPrivilegeUse: int +AuditCategorySystem: int +CONTAINER_INHERIT_ACE: int +DACL_SECURITY_INFORMATION: int +DENY_ACCESS: int +DISABLE_MAX_PRIVILEGE: int +DS_SPN_ADD_SPN_OP: int +DS_SPN_DELETE_SPN_OP: int +DS_SPN_DN_HOST: int +DS_SPN_DNS_HOST: int +DS_SPN_DOMAIN: int +DS_SPN_NB_DOMAIN: int +DS_SPN_NB_HOST: int +DS_SPN_REPLACE_SPN_OP: int +DS_SPN_SERVICE: int +FAILED_ACCESS_ACE_FLAG: int +GRANT_ACCESS: int +GROUP_SECURITY_INFORMATION: int +INHERIT_ONLY_ACE: int +INHERITED_ACE: int +LABEL_SECURITY_INFORMATION: int +LOGON32_LOGON_BATCH: int +LOGON32_LOGON_INTERACTIVE: int +LOGON32_LOGON_NETWORK: int +LOGON32_LOGON_NETWORK_CLEARTEXT: int +LOGON32_LOGON_NEW_CREDENTIALS: int +LOGON32_LOGON_SERVICE: int +LOGON32_LOGON_UNLOCK: int +LOGON32_PROVIDER_DEFAULT: int +LOGON32_PROVIDER_WINNT35: int +LOGON32_PROVIDER_WINNT40: int +LOGON32_PROVIDER_WINNT50: int +NO_INHERITANCE: int +NO_PROPAGATE_INHERIT_ACE: int +NOT_USED_ACCESS: int +OBJECT_INHERIT_ACE: int +OWNER_SECURITY_INFORMATION: int +POLICY_ALL_ACCESS: int +POLICY_AUDIT_EVENT_FAILURE: int +POLICY_AUDIT_EVENT_NONE: int +POLICY_AUDIT_EVENT_SUCCESS: int +POLICY_AUDIT_EVENT_UNCHANGED: int +POLICY_AUDIT_LOG_ADMIN: int +POLICY_CREATE_ACCOUNT: int +POLICY_CREATE_PRIVILEGE: int +POLICY_CREATE_SECRET: int +POLICY_EXECUTE: int +POLICY_GET_PRIVATE_INFORMATION: int +POLICY_LOOKUP_NAMES: int +POLICY_NOTIFICATION: int +POLICY_READ: int +POLICY_SERVER_ADMIN: int +POLICY_SET_AUDIT_REQUIREMENTS: int +POLICY_SET_DEFAULT_QUOTA_LIMITS: int +POLICY_TRUST_ADMIN: int +POLICY_VIEW_AUDIT_INFORMATION: int +POLICY_VIEW_LOCAL_INFORMATION: int +POLICY_WRITE: int +PolicyAccountDomainInformation: int +PolicyAuditEventsInformation: int +PolicyAuditFullQueryInformation: int +PolicyAuditFullSetInformation: int +PolicyAuditLogInformation: int +PolicyDefaultQuotaInformation: int +PolicyDnsDomainInformation: int +PolicyLsaServerRoleInformation: int +PolicyModificationInformation: int +PolicyNotifyAccountDomainInformation: int +PolicyNotifyAuditEventsInformation: int +PolicyNotifyDnsDomainInformation: int +PolicyNotifyDomainEfsInformation: int +PolicyNotifyDomainKerberosTicketInformation: int +PolicyNotifyMachineAccountPasswordInformation: int +PolicyNotifyServerRoleInformation: int +PolicyPdAccountInformation: int +PolicyPrimaryDomainInformation: int +PolicyReplicaSourceInformation: int +PolicyServerDisabled: int +PolicyServerEnabled: int +PolicyServerRoleBackup: int +PolicyServerRolePrimary: int +PROTECTED_DACL_SECURITY_INFORMATION: int +PROTECTED_SACL_SECURITY_INFORMATION: int +REVOKE_ACCESS: int +SACL_SECURITY_INFORMATION: int +SANDBOX_INERT: int +SDDL_REVISION_1: int +SE_DACL_AUTO_INHERITED: int +SE_DACL_DEFAULTED: int +SE_DACL_PRESENT: int +SE_DACL_PROTECTED: int +SE_DS_OBJECT: int +SE_DS_OBJECT_ALL: int +SE_FILE_OBJECT: int +SE_GROUP_DEFAULTED: int +SE_GROUP_ENABLED: int +SE_GROUP_ENABLED_BY_DEFAULT: int +SE_GROUP_LOGON_ID: int +SE_GROUP_MANDATORY: int +SE_GROUP_OWNER: int +SE_GROUP_RESOURCE: int +SE_GROUP_USE_FOR_DENY_ONLY: int +SE_KERNEL_OBJECT: int +SE_LMSHARE: int +SE_OWNER_DEFAULTED: int +SE_PRINTER: int +SE_PRIVILEGE_ENABLED: int +SE_PRIVILEGE_ENABLED_BY_DEFAULT: int +SE_PRIVILEGE_REMOVED: int +SE_PRIVILEGE_USED_FOR_ACCESS: int +SE_PROVIDER_DEFINED_OBJECT: int +SE_REGISTRY_KEY: int +SE_REGISTRY_WOW64_32KEY: int +SE_SACL_AUTO_INHERITED: int +SE_SACL_DEFAULTED: int +SE_SACL_PRESENT: int +SE_SACL_PROTECTED: int +SE_SELF_RELATIVE: int +SE_SERVICE: int +SE_UNKNOWN_OBJECT_TYPE: int +SE_WINDOW_OBJECT: int +SE_WMIGUID_OBJECT: int +SECPKG_CRED_BOTH: int +SECPKG_CRED_INBOUND: int +SECPKG_CRED_OUTBOUND: int +SECPKG_FLAG_ACCEPT_WIN32_NAME: int +SECPKG_FLAG_CLIENT_ONLY: int +SECPKG_FLAG_CONNECTION: int +SECPKG_FLAG_DATAGRAM: int +SECPKG_FLAG_EXTENDED_ERROR: int +SECPKG_FLAG_IMPERSONATION: int +SECPKG_FLAG_INTEGRITY: int +SECPKG_FLAG_MULTI_REQUIRED: int +SECPKG_FLAG_PRIVACY: int +SECPKG_FLAG_STREAM: int +SECPKG_FLAG_TOKEN_ONLY: int +SECURITY_CREATOR_SID_AUTHORITY: int +SECURITY_LOCAL_SID_AUTHORITY: int +SECURITY_NON_UNIQUE_AUTHORITY: int +SECURITY_NT_AUTHORITY: int +SECURITY_NULL_SID_AUTHORITY: int +SECURITY_RESOURCE_MANAGER_AUTHORITY: int +SECURITY_WORLD_SID_AUTHORITY: int +SecurityAnonymous: int +SecurityDelegation: int +SecurityIdentification: int +SecurityImpersonation: int +SET_ACCESS: int +SET_AUDIT_FAILURE: int +SET_AUDIT_SUCCESS: int +SidTypeAlias: int +SidTypeComputer: int +SidTypeDeletedAccount: int +SidTypeDomain: int +SidTypeGroup: int +SidTypeInvalid: int +SidTypeUnknown: int +SidTypeUser: int +SidTypeWellKnownGroup: int +STYPE_DEVICE: int +STYPE_DISKTREE: int +STYPE_IPC: int +STYPE_PRINTQ: int +STYPE_SPECIAL: int +STYPE_TEMPORARY: int +SUB_CONTAINERS_AND_OBJECTS_INHERIT: int +SUB_CONTAINERS_ONLY_INHERIT: int +SUB_OBJECTS_ONLY_INHERIT: int +SUCCESSFUL_ACCESS_ACE_FLAG: int +SYSTEM_AUDIT_ACE_TYPE: int +SYSTEM_AUDIT_OBJECT_ACE_TYPE: int +TOKEN_ADJUST_DEFAULT: int +TOKEN_ADJUST_GROUPS: int +TOKEN_ADJUST_PRIVILEGES: int +TOKEN_ALL_ACCESS: int +TOKEN_ASSIGN_PRIMARY: int +TOKEN_DUPLICATE: int +TOKEN_EXECUTE: int +TOKEN_IMPERSONATE: int +TOKEN_QUERY: int +TOKEN_QUERY_SOURCE: int +TOKEN_READ: int +TOKEN_WRITE: int +TokenImpersonation: int +TokenPrimary: int +TrustedControllersInformation: int +TrustedDomainAuthInformation: int +TrustedDomainAuthInformationInternal: int +TrustedDomainFullInformation: int +TrustedDomainFullInformation2Internal: int +TrustedDomainFullInformationInternal: int +TrustedDomainInformationBasic: int +TrustedDomainInformationEx: int +TrustedDomainInformationEx2Internal: int +TrustedDomainNameInformation: int +TrustedPasswordInformation: int +TrustedPosixOffsetInformation: int +TRUSTEE_BAD_FORM: int +TRUSTEE_IS_ALIAS: int +TRUSTEE_IS_COMPUTER: int +TRUSTEE_IS_DELETED: int +TRUSTEE_IS_DOMAIN: int +TRUSTEE_IS_GROUP: int +TRUSTEE_IS_INVALID: int +TRUSTEE_IS_NAME: int +TRUSTEE_IS_OBJECTS_AND_NAME: int +TRUSTEE_IS_OBJECTS_AND_SID: int +TRUSTEE_IS_SID: int +TRUSTEE_IS_UNKNOWN: int +TRUSTEE_IS_USER: int +TRUSTEE_IS_WELL_KNOWN_GROUP: int +UNPROTECTED_DACL_SECURITY_INFORMATION: int +UNPROTECTED_SACL_SECURITY_INFORMATION: int +CredHandleType = _win32typing.PyCredHandle +CtxtHandleType = _win32typing.PyCtxtHandle + +def DsListDomainsInSite(*args, **kwargs): ... # incomplete +def DsListInfoForServer(*args, **kwargs): ... # incomplete +def DsListRoles(*args, **kwargs): ... # incomplete +def DsListServersForDomainInSite(*args, **kwargs): ... # incomplete +def DsListServersInSite(*args, **kwargs): ... # incomplete +def DsListSites(*args, **kwargs): ... # incomplete +def GetPolicyHandle(*args, **kwargs): ... # incomplete + +MICROSOFT_KERBEROS_NAME_A: bytes +MSV1_0_PACKAGE_NAME: bytes +PyCredHandleType = _win32typing.PyCredHandle +PyCtxtHandleType = _win32typing.PyCtxtHandle +PySecBufferDescType = _win32typing.PySecBufferDesc +PySecBufferType = _win32typing.PySecBuffer +SE_ASSIGNPRIMARYTOKEN_NAME: str +SE_AUDIT_NAME: str +SE_BACKUP_NAME: str +SE_BATCH_LOGON_NAME: str +SE_CHANGE_NOTIFY_NAME: str +SE_CREATE_GLOBAL_NAME: str +SE_CREATE_PAGEFILE_NAME: str +SE_CREATE_PERMANENT_NAME: str +SE_CREATE_SYMBOLIC_LINK_NAME: str +SE_CREATE_TOKEN_NAME: str +SE_DEBUG_NAME: str +SE_DENY_BATCH_LOGON_NAME: str +SE_DENY_INTERACTIVE_LOGON_NAME: str +SE_DENY_NETWORK_LOGON_NAME: str +SE_DENY_REMOTE_INTERACTIVE_LOGON_NAME: str +SE_DENY_SERVICE_LOGON_NAME: str +SE_ENABLE_DELEGATION_NAME: str +SE_GROUP_INTEGRITY: int +SE_GROUP_INTEGRITY_ENABLED: int +SE_IMPERSONATE_NAME: str +SE_INCREASE_QUOTA_NAME: str +SE_INC_BASE_PRIORITY_NAME: str +SE_INC_WORKING_SET_NAME: str +SE_INTERACTIVE_LOGON_NAME: str +SE_LOAD_DRIVER_NAME: str +SE_LOCK_MEMORY_NAME: str +SE_MACHINE_ACCOUNT_NAME: str +SE_MANAGE_VOLUME_NAME: str +SE_NETWORK_LOGON_NAME: str +SE_PROF_SINGLE_PROCESS_NAME: str +SE_RELABEL_NAME: str +SE_REMOTE_INTERACTIVE_LOGON_NAME: str +SE_REMOTE_SHUTDOWN_NAME: str +SE_RESTORE_NAME: str +SE_SECURITY_NAME: str +SE_SERVICE_LOGON_NAME: str +SE_SHUTDOWN_NAME: str +SE_SYNC_AGENT_NAME: str +SE_SYSTEMTIME_NAME: str +SE_SYSTEM_ENVIRONMENT_NAME: str +SE_SYSTEM_PROFILE_NAME: str +SE_TAKE_OWNERSHIP_NAME: str +SE_TCB_NAME: str +SE_TIME_ZONE_NAME: str +SE_TRUSTED_CREDMAN_ACCESS_NAME: str +SE_UNDOCK_NAME: str +SE_UNSOLICITED_INPUT_NAME: str +SYSTEM_MANDATORY_LABEL_NO_EXECUTE_UP: int +SYSTEM_MANDATORY_LABEL_NO_READ_UP: int +SYSTEM_MANDATORY_LABEL_NO_WRITE_UP: int +SYSTEM_MANDATORY_LABEL_VALID_MASK: int +SecBufferDescType = _win32typing.PySecBufferDesc +SecBufferType = _win32typing.PySecBuffer +TOKEN_MANDATORY_POLICY_NEW_PROCESS_MIN: int +TOKEN_MANDATORY_POLICY_NO_WRITE_UP: int +TOKEN_MANDATORY_POLICY_OFF: int +TOKEN_MANDATORY_POLICY_VALID_MASK: int +TokenAccessInformation: int +TokenAuditPolicy: int +TokenDefaultDacl: int +TokenElevation: int +TokenElevationType: int +TokenElevationTypeDefault: int +TokenElevationTypeFull: int +TokenElevationTypeLimited: int +TokenGroups: int +TokenGroupsAndPrivileges: int +TokenHasRestrictions: int +TokenImpersonationLevel: int +TokenIntegrityLevel: int +TokenLinkedToken: int +TokenLogonSid: int +TokenMandatoryPolicy: int +TokenOrigin: int +TokenOwner: int +TokenPrimaryGroup: int +TokenPrivileges: int +TokenRestrictedSids: int +TokenSandBoxInert: int +TokenSessionId: int +TokenSessionReference: int +TokenSource: int +TokenStatistics: int +TokenType: int +TokenUIAccess: int +TokenUser: int +TokenVirtualizationAllowed: int +TokenVirtualizationEnabled: int +UNICODE: int +WinAccountAdministratorSid: int +WinAccountCertAdminsSid: int +WinAccountComputersSid: int +WinAccountControllersSid: int +WinAccountDomainAdminsSid: int +WinAccountDomainGuestsSid: int +WinAccountDomainUsersSid: int +WinAccountEnterpriseAdminsSid: int +WinAccountGuestSid: int +WinAccountKrbtgtSid: int +WinAccountPolicyAdminsSid: int +WinAccountRasAndIasServersSid: int +WinAccountReadonlyControllersSid: int +WinAccountSchemaAdminsSid: int +WinAnonymousSid: int +WinAuthenticatedUserSid: int +WinBatchSid: int +WinBuiltinAccountOperatorsSid: int +WinBuiltinAdministratorsSid: int +WinBuiltinAuthorizationAccessSid: int +WinBuiltinBackupOperatorsSid: int +WinBuiltinCryptoOperatorsSid: int +WinBuiltinDCOMUsersSid: int +WinBuiltinDomainSid: int +WinBuiltinEventLogReadersGroup: int +WinBuiltinGuestsSid: int +WinBuiltinIUsersSid: int +WinBuiltinIncomingForestTrustBuildersSid: int +WinBuiltinNetworkConfigurationOperatorsSid: int +WinBuiltinPerfLoggingUsersSid: int +WinBuiltinPerfMonitoringUsersSid: int +WinBuiltinPowerUsersSid: int +WinBuiltinPreWindows2000CompatibleAccessSid: int +WinBuiltinPrintOperatorsSid: int +WinBuiltinRemoteDesktopUsersSid: int +WinBuiltinReplicatorSid: int +WinBuiltinSystemOperatorsSid: int +WinBuiltinTerminalServerLicenseServersSid: int +WinBuiltinUsersSid: int +WinCacheablePrincipalsGroupSid: int +WinCreatorGroupServerSid: int +WinCreatorGroupSid: int +WinCreatorOwnerRightsSid: int +WinCreatorOwnerServerSid: int +WinCreatorOwnerSid: int +WinDialupSid: int +WinDigestAuthenticationSid: int +WinEnterpriseControllersSid: int +WinEnterpriseReadonlyControllersSid: int +WinHighLabelSid: int +WinIUserSid: int +WinInteractiveSid: int +WinLocalServiceSid: int +WinLocalSid: int +WinLocalSystemSid: int +WinLogonIdsSid: int +WinLowLabelSid: int +WinMediumLabelSid: int +WinNTLMAuthenticationSid: int +WinNetworkServiceSid: int +WinNetworkSid: int +WinNonCacheablePrincipalsGroupSid: int +WinNtAuthoritySid: int +WinNullSid: int +WinOtherOrganizationSid: int +WinProxySid: int +WinRemoteLogonIdSid: int +WinRestrictedCodeSid: int +WinSChannelAuthenticationSid: int +WinSelfSid: int +WinServiceSid: int +WinSystemLabelSid: int +WinTerminalServerSid: int +WinThisOrganizationSid: int +WinUntrustedLabelSid: int +WinWorldSid: int +WinWriteRestrictedCodeSid: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32service.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32service.pyi new file mode 100644 index 000000000..47492ad6b --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32service.pyi @@ -0,0 +1,179 @@ +from _typeshed import Incomplete +from collections.abc import Iterable + +import _win32typing +from win32.lib.pywintypes import error as error + +def GetThreadDesktop(ThreadId) -> _win32typing.PyHDESK: ... +def EnumWindowStations() -> tuple[tuple[str, Incomplete], ...]: ... +def GetUserObjectInformation(Handle: int, _type) -> None: ... +def SetUserObjectInformation(Handle: int, info, _type) -> None: ... +def OpenWindowStation(szWinSta, Inherit, DesiredAccess) -> _win32typing.PyHWINSTA: ... +def OpenDesktop(szDesktop, Flags, Inherit, DesiredAccess) -> _win32typing.PyHDESK: ... +def CreateDesktop( + Desktop, Flags, DesiredAccess, SecurityAttributes: _win32typing.PySECURITY_ATTRIBUTES +) -> _win32typing.PyHDESK: ... +def OpenInputDesktop(Flags, Inherit, DesiredAccess) -> _win32typing.PyHDESK: ... +def GetProcessWindowStation() -> _win32typing.PyHWINSTA: ... +def CreateWindowStation( + WindowStation, Flags, DesiredAccess, SecurityAttributes: _win32typing.PySECURITY_ATTRIBUTES +) -> _win32typing.PyHWINSTA: ... +def EnumServicesStatus(hSCManager: _win32typing.PySC_HANDLE, ServiceType, ServiceState) -> tuple[Incomplete, ...]: ... +def EnumServicesStatusEx( + SCManager: _win32typing.PySC_HANDLE, ServiceType, ServiceState, InfoLevel, GroupName: Incomplete | None = ... +) -> tuple[Incomplete, ...]: ... +def EnumDependentServices(hService: _win32typing.PySC_HANDLE, ServiceState) -> tuple[Incomplete, ...]: ... +def QueryServiceConfig(hService: _win32typing.PySC_HANDLE): ... +def StartService(hService: _win32typing.PySC_HANDLE, args: Iterable[str] | None) -> None: ... +def OpenService(scHandle: _win32typing.PySC_HANDLE, name: str, desiredAccess) -> _win32typing.PySC_HANDLE: ... +def OpenSCManager(machineName: str | None, dbName: str | None, desiredAccess: int) -> _win32typing.PySC_HANDLE: ... +def CloseServiceHandle(scHandle: _win32typing.PySC_HANDLE) -> None: ... +def QueryServiceStatus(hService: _win32typing.PySC_HANDLE) -> _win32typing.SERVICE_STATUS: ... +def QueryServiceStatusEx(hService: _win32typing.PySC_HANDLE) -> _win32typing.SERVICE_STATUS: ... +def SetServiceObjectSecurity( + Handle: _win32typing.PySC_HANDLE, SecurityInformation, SecurityDescriptor: _win32typing.PySECURITY_DESCRIPTOR +) -> None: ... +def QueryServiceObjectSecurity(Handle: _win32typing.PySC_HANDLE, SecurityInformation) -> _win32typing.PySECURITY_DESCRIPTOR: ... +def GetServiceKeyName(hSCManager: _win32typing.PySC_HANDLE, DisplayName): ... +def GetServiceDisplayName(hSCManager: _win32typing.PySC_HANDLE, ServiceName): ... +def SetServiceStatus(scHandle, serviceStatus: _win32typing.SERVICE_STATUS | tuple[int, int, int, int, int, int, int]) -> None: ... +def ControlService(scHandle: _win32typing.PySC_HANDLE, code) -> _win32typing.SERVICE_STATUS: ... +def DeleteService(scHandle: _win32typing.PySC_HANDLE) -> None: ... +def CreateService( + scHandle: _win32typing.PySC_HANDLE, + name: str, + displayName: str, + desiredAccess: int, + serviceType: int, + startType: int, + errorControl: int, + binaryFile: str, + loadOrderGroup: str | None, + bFetchTag: bool, + serviceDeps: Iterable[Incomplete] | None, + acctName: str | None, + password: str | None, +) -> _win32typing.PySC_HANDLE: ... +def ChangeServiceConfig( + hService: _win32typing.PySC_HANDLE, + serviceType: int, + startType: int, + errorControl: int, + binaryFile: str | None, + loadOrderGroup: str | None, + bFetchTag: bool, + serviceDeps: Iterable[Incomplete] | None, + acctName: str | None, + password: str | None, + displayName: str | None, +): ... +def LockServiceDatabase(sc_handle: _win32typing.PySC_HANDLE): ... +def UnlockServiceDatabase(lock): ... +def QueryServiceLockStatus(hSCManager: _win32typing.PySC_HANDLE) -> tuple[Incomplete, str, Incomplete]: ... +def ChangeServiceConfig2(hService: _win32typing.PySC_HANDLE, InfoLevel, info) -> None: ... +def QueryServiceConfig2(hService: _win32typing.PySC_HANDLE, InfoLevel): ... + +DBT_CONFIGCHANGECANCELED: int +DBT_CONFIGCHANGED: int +DBT_CUSTOMEVENT: int +DBT_DEVICEARRIVAL: int +DBT_DEVICEQUERYREMOVE: int +DBT_DEVICEQUERYREMOVEFAILED: int +DBT_DEVICEREMOVECOMPLETE: int +DBT_DEVICEREMOVEPENDING: int +DBT_DEVICETYPESPECIFIC: int +DBT_QUERYCHANGECONFIG: int +DF_ALLOWOTHERACCOUNTHOOK: int +SC_ACTION_NONE: int +SC_ACTION_REBOOT: int +SC_ACTION_RESTART: int +SC_ACTION_RUN_COMMAND: int +SC_ENUM_PROCESS_INFO: int +SC_GROUP_IDENTIFIER: int +SC_MANAGER_ALL_ACCESS: int +SC_MANAGER_CONNECT: int +SC_MANAGER_CREATE_SERVICE: int +SC_MANAGER_ENUMERATE_SERVICE: int +SC_MANAGER_LOCK: int +SC_MANAGER_MODIFY_BOOT_CONFIG: int +SC_MANAGER_QUERY_LOCK_STATUS: int +SERVICE_ACCEPT_HARDWAREPROFILECHANGE: int +SERVICE_ACCEPT_NETBINDCHANGE: int +SERVICE_ACCEPT_PARAMCHANGE: int +SERVICE_ACCEPT_PAUSE_CONTINUE: int +SERVICE_ACCEPT_POWEREVENT: int +SERVICE_ACCEPT_PRESHUTDOWN: int +SERVICE_ACCEPT_SESSIONCHANGE: int +SERVICE_ACCEPT_SHUTDOWN: int +SERVICE_ACCEPT_STOP: int +SERVICE_ACTIVE: int +SERVICE_ALL_ACCESS: int +SERVICE_AUTO_START: int +SERVICE_BOOT_START: int +SERVICE_CHANGE_CONFIG: int +SERVICE_CONFIG_DELAYED_AUTO_START_INFO: int +SERVICE_CONFIG_DESCRIPTION: int +SERVICE_CONFIG_FAILURE_ACTIONS: int +SERVICE_CONFIG_FAILURE_ACTIONS_FLAG: int +SERVICE_CONFIG_PRESHUTDOWN_INFO: int +SERVICE_CONFIG_REQUIRED_PRIVILEGES_INFO: int +SERVICE_CONFIG_SERVICE_SID_INFO: int +SERVICE_CONTINUE_PENDING: int +SERVICE_CONTROL_CONTINUE: int +SERVICE_CONTROL_DEVICEEVENT: int +SERVICE_CONTROL_HARDWAREPROFILECHANGE: int +SERVICE_CONTROL_INTERROGATE: int +SERVICE_CONTROL_NETBINDADD: int +SERVICE_CONTROL_NETBINDDISABLE: int +SERVICE_CONTROL_NETBINDENABLE: int +SERVICE_CONTROL_NETBINDREMOVE: int +SERVICE_CONTROL_PARAMCHANGE: int +SERVICE_CONTROL_PAUSE: int +SERVICE_CONTROL_POWEREVENT: int +SERVICE_CONTROL_PRESHUTDOWN: int +SERVICE_CONTROL_SESSIONCHANGE: int +SERVICE_CONTROL_SHUTDOWN: int +SERVICE_CONTROL_STOP: int +SERVICE_DEMAND_START: int +SERVICE_DISABLED: int +SERVICE_DRIVER: int +SERVICE_ENUMERATE_DEPENDENTS: int +SERVICE_ERROR_CRITICAL: int +SERVICE_ERROR_IGNORE: int +SERVICE_ERROR_NORMAL: int +SERVICE_ERROR_SEVERE: int +SERVICE_FILE_SYSTEM_DRIVER: int +SERVICE_INACTIVE: int +SERVICE_INTERACTIVE_PROCESS: int +SERVICE_INTERROGATE: int +SERVICE_KERNEL_DRIVER: int +SERVICE_NO_CHANGE: int +SERVICE_PAUSE_CONTINUE: int +SERVICE_PAUSE_PENDING: int +SERVICE_PAUSED: int +SERVICE_QUERY_CONFIG: int +SERVICE_QUERY_STATUS: int +SERVICE_RUNNING: int +SERVICE_SID_TYPE_NONE: int +SERVICE_SID_TYPE_RESTRICTED: int +SERVICE_SID_TYPE_UNRESTRICTED: int +SERVICE_SPECIFIC_ERROR: int +SERVICE_START: int +SERVICE_START_PENDING: int +SERVICE_STATE_ALL: int +SERVICE_STOP: int +SERVICE_STOP_PENDING: int +SERVICE_STOPPED: int +SERVICE_SYSTEM_START: int +SERVICE_USER_DEFINED_CONTROL: int +SERVICE_WIN32: int +SERVICE_WIN32_OWN_PROCESS: int +SERVICE_WIN32_SHARE_PROCESS: int +UOI_FLAGS: int +UOI_NAME: int +UOI_TYPE: int +UOI_USER_SID: int +WSF_VISIBLE: int +HDESKType = _win32typing.PyHDESK +HWINSTAType = _win32typing.PyHWINSTA +UNICODE: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32trace.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32trace.pyi new file mode 100644 index 000000000..542d733f6 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32trace.pyi @@ -0,0 +1,13 @@ +from win32.lib.pywintypes import error as error + +def GetHandle(*args, **kwargs): ... # incomplete +def GetTracer(*args, **kwargs): ... # incomplete +def InitRead(*args, **kwargs): ... # incomplete +def InitWrite(*args, **kwargs): ... # incomplete +def TermRead(*args, **kwargs): ... # incomplete +def TermWrite(*args, **kwargs): ... # incomplete +def blockingread(*args, **kwargs): ... # incomplete +def flush(*args, **kwargs): ... # incomplete +def read(*args, **kwargs): ... # incomplete +def setprint(*args, **kwargs): ... # incomplete +def write(*args, **kwargs): ... # incomplete diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32transaction.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32transaction.pyi new file mode 100644 index 000000000..26d5077d5 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32transaction.pyi @@ -0,0 +1,18 @@ +import _win32typing +from win32.lib.pywintypes import error as error + +def CreateTransaction( + TransactionAttributes: _win32typing.PySECURITY_ATTRIBUTES | None = ..., + UOW: _win32typing.PyIID | None = ..., + CreateOptions: int = ..., + IsolationLevel: int = ..., + IsolationFlags: int = ..., + Timeout: int = ..., + Description: str | None = ..., +) -> int: ... +def RollbackTransaction(TransactionHandle: int) -> None: ... +def RollbackTransactionAsync(TransactionHandle: int) -> None: ... +def CommitTransaction(TransactionHandle: int) -> None: ... +def CommitTransactionAsync(TransactionHandle: int) -> None: ... +def GetTransactionId(TransactionHandle: int) -> _win32typing.PyIID: ... +def OpenTransaction(DesiredAccess, TransactionId: _win32typing.PyIID) -> int: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32ts.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32ts.pyi new file mode 100644 index 000000000..7e37d2ec9 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32ts.pyi @@ -0,0 +1,96 @@ +from _typeshed import Incomplete + +def WTSOpenServer(ServerName: str) -> int: ... +def WTSCloseServer(Server: int) -> None: ... +def WTSQueryUserConfig(ServerName: str, UserName: str, ConfigClass): ... +def WTSSetUserConfig(ServerName: str, UserName: str, ConfigClass) -> None: ... +def WTSEnumerateServers(DomainName: str | None = ..., Version: int = ..., Reserved=...) -> tuple[str, ...]: ... +def WTSEnumerateSessions(__Server: int, __Version: int = ..., __Reserved=...) -> tuple[dict[str, str | int], ...]: ... +def WTSLogoffSession(__Server: int, __SessionId: int, __Wait: bool) -> None: ... +def WTSDisconnectSession(__Server: int, __SessionId: int, __Wait: bool) -> None: ... +def WTSQuerySessionInformation(__Server: int, __SessionId: int, __WTSInfoClass: int) -> str: ... +def WTSEnumerateProcesses(Server: int, Version: int = ..., Reserved: int = ...) -> tuple[str, ...]: ... +def WTSQueryUserToken(SessionId) -> int: ... +def WTSShutdownSystem(Server: int, ShutdownFlag) -> None: ... +def WTSTerminateProcess(Server: int, ProcessId, ExitCode) -> None: ... +def ProcessIdToSessionId(ProcessId): ... +def WTSGetActiveConsoleSessionId(): ... +def WTSRegisterSessionNotification(Wnd: int, Flags) -> None: ... +def WTSUnRegisterSessionNotification(Wnd: int) -> None: ... +def WTSWaitSystemEvent(Server: int, EventMask): ... +def WTSSendMessage(Server: int, SessionId, Title: str, Message: str, Style, Timeout, Wait): ... + +NOTIFY_FOR_ALL_SESSIONS: int +NOTIFY_FOR_THIS_SESSION: int +WTSActive: int +WTSApplicationName: int +WTSClientAddress: int +WTSClientBuildNumber: int +WTSClientDirectory: int +WTSClientDisplay: int +WTSClientHardwareId: int +WTSClientName: int +WTSClientProductId: int +WTSClientProtocolType: int +WTSConnectQuery: int +WTSConnectState: int +WTSConnected: int +WTSDisconnected: int +WTSDomainName: int +WTSDown: int +WTSIdle: int +WTSInit: int +WTSInitialProgram: int +WTSListen: int +WTSOEMId: int +WTSReset: int +WTSSessionId: int +WTSShadow: int +WTSUserConfigBrokenTimeoutSettings: int +WTSUserConfigInitialProgram: int +WTSUserConfigModemCallbackPhoneNumber: int +WTSUserConfigModemCallbackSettings: int +WTSUserConfigReconnectSettings: int +WTSUserConfigShadowingSettings: int +WTSUserConfigTerminalServerHomeDir: int +WTSUserConfigTerminalServerHomeDirDrive: int +WTSUserConfigTerminalServerProfilePath: int +WTSUserConfigTimeoutSettingsConnections: int +WTSUserConfigTimeoutSettingsDisconnections: int +WTSUserConfigTimeoutSettingsIdle: int +WTSUserConfigWorkingDirectory: int +WTSUserConfigfAllowLogonTerminalServer: int +WTSUserConfigfDeviceClientDefaultPrinter: int +WTSUserConfigfDeviceClientDrives: int +WTSUserConfigfDeviceClientPrinters: int +WTSUserConfigfInheritInitialProgram: int +WTSUserConfigfTerminalServerRemoteHomeDir: int +WTSUserName: int +WTSVirtualClientData: int +WTSVirtualFileHandle: int +WTSWinStationName: int +WTSWorkingDirectory: int +WTS_CURRENT_SERVER: int +WTS_CURRENT_SERVER_HANDLE: int +WTS_CURRENT_SERVER_NAME: Incomplete +WTS_CURRENT_SESSION: int +WTS_EVENT_ALL: int +WTS_EVENT_CONNECT: int +WTS_EVENT_CREATE: int +WTS_EVENT_DELETE: int +WTS_EVENT_DISCONNECT: int +WTS_EVENT_FLUSH: int +WTS_EVENT_LICENSE: int +WTS_EVENT_LOGOFF: int +WTS_EVENT_LOGON: int +WTS_EVENT_NONE: int +WTS_EVENT_RENAME: int +WTS_EVENT_STATECHANGE: int +WTS_PROTOCOL_TYPE_CONSOLE: int +WTS_PROTOCOL_TYPE_ICA: int +WTS_PROTOCOL_TYPE_RDP: int +WTS_WSD_FASTREBOOT: int +WTS_WSD_LOGOFF: int +WTS_WSD_POWEROFF: int +WTS_WSD_REBOOT: int +WTS_WSD_SHUTDOWN: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32wnet.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32wnet.pyi new file mode 100644 index 000000000..320fac3a2 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32wnet.pyi @@ -0,0 +1,35 @@ +from _typeshed import Incomplete + +import _win32typing +from win32.lib.pywintypes import error as error + +def NCBBuffer(size): ... +def Netbios(ncb: _win32typing.NCB): ... +def WNetAddConnection2( + NetResource: _win32typing.PyNETRESOURCE, + Password: Incomplete | None = ..., + UserName: Incomplete | None = ..., + Flags: int = ..., +) -> None: ... +def WNetAddConnection3( + HwndParent: int, + NetResource: _win32typing.PyNETRESOURCE, + Password: Incomplete | None = ..., + UserName: Incomplete | None = ..., + Flags: int = ..., +) -> None: ... +def WNetCancelConnection2(name: str, flags, force) -> None: ... +def WNetOpenEnum(scope, _type, usage, resource: _win32typing.PyNETRESOURCE) -> int: ... +def WNetCloseEnum(handle: int) -> None: ... +def WNetEnumResource(handle: int, maxExtries: int = ...) -> list[_win32typing.PyNETRESOURCE]: ... +def WNetGetUser(connection: str | None = ...) -> str: ... +def WNetGetUniversalName(localPath: str, infoLevel) -> str: ... +def WNetGetResourceInformation(NetResource: _win32typing.PyNETRESOURCE) -> tuple[_win32typing.PyNETRESOURCE, Incomplete]: ... +def WNetGetLastError() -> tuple[Incomplete, Incomplete, Incomplete]: ... +def WNetGetResourceParent(NetResource: _win32typing.PyNETRESOURCE) -> _win32typing.PyNETRESOURCE: ... +def WNetGetConnection(connection: str | None = ...) -> str: ... + +NCB = _win32typing.PyNCB +NCBType = _win32typing.PyNCB +NETRESOURCE = _win32typing.PyNETRESOURCE +NETRESOURCEType = _win32typing.PyNETRESOURCE diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/winxpgui.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/winxpgui.pyi new file mode 100644 index 000000000..363045bfb --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/winxpgui.pyi @@ -0,0 +1,6 @@ +from win32.win32gui import * + +def GetConsoleWindow() -> int: ... + +# Actually returns a list of int|tuple, but lists don't support positional types +def GetWindowRgnBox(__hWnd: int) -> tuple[int, tuple[int, int, int, int]]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32api.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32api.pyi new file mode 100644 index 000000000..8beb8a8a1 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32api.pyi @@ -0,0 +1 @@ +from win32.win32api import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32clipboard.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32clipboard.pyi new file mode 100644 index 000000000..77dbe6673 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32clipboard.pyi @@ -0,0 +1 @@ +from win32.win32clipboard import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/__init__.pyi new file mode 100644 index 000000000..3ceebb09d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/__init__.pyi @@ -0,0 +1,9 @@ +from _typeshed import Incomplete + +__gen_path__: str +__build_path__: Incomplete + +def SetupEnvironment() -> None: ... +def __PackageSupportBuildPath__(package_path) -> None: ... + +gen_py: Incomplete diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/adsi/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/adsi/__init__.pyi new file mode 100644 index 000000000..548c6c617 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/adsi/__init__.pyi @@ -0,0 +1 @@ +from win32comext.adsi import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/adsi/adsi.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/adsi/adsi.pyi new file mode 100644 index 000000000..a6269d428 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/adsi/adsi.pyi @@ -0,0 +1 @@ +from win32comext.adsi.adsi import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/adsi/adsicon.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/adsi/adsicon.pyi new file mode 100644 index 000000000..1776450e4 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/adsi/adsicon.pyi @@ -0,0 +1 @@ +from win32comext.adsi.adsicon import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/authorization/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/authorization/__init__.pyi new file mode 100644 index 000000000..975c5a823 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/authorization/__init__.pyi @@ -0,0 +1 @@ +from win32comext.authorization import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/authorization/authorization.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/authorization/authorization.pyi new file mode 100644 index 000000000..0ad104f7e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/authorization/authorization.pyi @@ -0,0 +1 @@ +from win32comext.authorization.authorization import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axcontrol/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axcontrol/__init__.pyi new file mode 100644 index 000000000..fde8be560 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axcontrol/__init__.pyi @@ -0,0 +1 @@ +from win32comext.axcontrol import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axcontrol/axcontrol.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axcontrol/axcontrol.pyi new file mode 100644 index 000000000..d3c73448d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axcontrol/axcontrol.pyi @@ -0,0 +1 @@ +from win32comext.axcontrol.axcontrol import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axdebug/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axdebug/__init__.pyi new file mode 100644 index 000000000..97d083e95 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axdebug/__init__.pyi @@ -0,0 +1 @@ +from win32comext.axdebug import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axdebug/adb.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axdebug/adb.pyi new file mode 100644 index 000000000..48966a119 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axdebug/adb.pyi @@ -0,0 +1 @@ +from win32comext.axdebug.adb import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axdebug/axdebug.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axdebug/axdebug.pyi new file mode 100644 index 000000000..45b111326 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axdebug/axdebug.pyi @@ -0,0 +1 @@ +from win32comext.axdebug.axdebug import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axdebug/codecontainer.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axdebug/codecontainer.pyi new file mode 100644 index 000000000..60d3a50fb --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axdebug/codecontainer.pyi @@ -0,0 +1 @@ +from win32comext.axdebug.codecontainer import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axdebug/contexts.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axdebug/contexts.pyi new file mode 100644 index 000000000..c1c9fbfd9 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axdebug/contexts.pyi @@ -0,0 +1 @@ +from win32comext.axdebug.contexts import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axdebug/debugger.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axdebug/debugger.pyi new file mode 100644 index 000000000..83a0e9c94 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axdebug/debugger.pyi @@ -0,0 +1 @@ +from win32comext.axdebug.debugger import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axdebug/documents.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axdebug/documents.pyi new file mode 100644 index 000000000..e0d1bb743 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axdebug/documents.pyi @@ -0,0 +1 @@ +from win32comext.axdebug.documents import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axdebug/expressions.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axdebug/expressions.pyi new file mode 100644 index 000000000..3816f7647 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axdebug/expressions.pyi @@ -0,0 +1 @@ +from win32comext.axdebug.expressions import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axdebug/gateways.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axdebug/gateways.pyi new file mode 100644 index 000000000..517204a57 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axdebug/gateways.pyi @@ -0,0 +1 @@ +from win32comext.axdebug.gateways import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axdebug/stackframe.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axdebug/stackframe.pyi new file mode 100644 index 000000000..3184248da --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axdebug/stackframe.pyi @@ -0,0 +1 @@ +from win32comext.axdebug.stackframe import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axdebug/util.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axdebug/util.pyi new file mode 100644 index 000000000..1ea282e4c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axdebug/util.pyi @@ -0,0 +1 @@ +from win32comext.axdebug.util import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axscript/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axscript/__init__.pyi new file mode 100644 index 000000000..afc72ec7e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axscript/__init__.pyi @@ -0,0 +1 @@ +from win32comext.axscript import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axscript/asputil.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axscript/asputil.pyi new file mode 100644 index 000000000..1e04c857f --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axscript/asputil.pyi @@ -0,0 +1 @@ +from win32comext.axscript.asputil import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axscript/axscript.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axscript/axscript.pyi new file mode 100644 index 000000000..7ec0b3484 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axscript/axscript.pyi @@ -0,0 +1 @@ +from win32comext.axscript.axscript import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axscript/client/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axscript/client/__init__.pyi new file mode 100644 index 000000000..203d0ab35 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axscript/client/__init__.pyi @@ -0,0 +1 @@ +from win32comext.axscript.client import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axscript/client/error.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axscript/client/error.pyi new file mode 100644 index 000000000..f1a3310b6 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axscript/client/error.pyi @@ -0,0 +1 @@ +from win32comext.axscript.client.error import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axscript/server/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axscript/server/__init__.pyi new file mode 100644 index 000000000..6cb0b07bc --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axscript/server/__init__.pyi @@ -0,0 +1 @@ +from win32comext.axscript.server import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axscript/server/axsite.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axscript/server/axsite.pyi new file mode 100644 index 000000000..e07103462 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axscript/server/axsite.pyi @@ -0,0 +1 @@ +from win32comext.axscript.server.axsite import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axscript/server/error.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axscript/server/error.pyi new file mode 100644 index 000000000..6de1e5dd2 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/axscript/server/error.pyi @@ -0,0 +1 @@ +from win32comext.axscript.server.error import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/bits/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/bits/__init__.pyi new file mode 100644 index 000000000..020ede08f --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/bits/__init__.pyi @@ -0,0 +1 @@ +from win32comext.bits import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/bits/bits.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/bits/bits.pyi new file mode 100644 index 000000000..fcea1eb79 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/bits/bits.pyi @@ -0,0 +1 @@ +from win32comext.bits.bits import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/client/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/client/__init__.pyi new file mode 100644 index 000000000..930b06f00 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/client/__init__.pyi @@ -0,0 +1,74 @@ +from _typeshed import Incomplete +from typing_extensions import TypeAlias + +import _win32typing +from win32com.client import dynamic as dynamic, gencache as gencache + +_Stringifiable: TypeAlias = object + +def GetObject(Pathname: str | None = ..., Class: Incomplete | None = ..., clsctx: Incomplete | None = ...) -> CDispatch: ... +def GetActiveObject(Class, clsctx=...): ... +def Moniker(Pathname, clsctx=...): ... +def Dispatch( + dispatch: str | dynamic.PyIDispatchType | dynamic._GoodDispatchTypes | dynamic.PyIUnknownType, + userName: str | None = ..., + resultCLSID: _Stringifiable | None = ..., + typeinfo: _win32typing.PyITypeInfo | None = ..., + UnicodeToString: None = ..., + clsctx: int = ..., +) -> dynamic.CDispatch: ... +def DispatchEx( + clsid, + machine: Incomplete | None = ..., + userName: Incomplete | None = ..., + resultCLSID: Incomplete | None = ..., + typeinfo: Incomplete | None = ..., + UnicodeToString: None = ..., + clsctx: Incomplete | None = ..., +): ... + +class CDispatch(dynamic.CDispatch): + def __dir__(self): ... + +def CastTo(ob, target, typelib: Incomplete | None = ...): ... + +class Constants: + __dicts__: Incomplete + def __getattr__(self, a: str): ... + +constants: Incomplete + +class EventsProxy: + def __init__(self, ob) -> None: ... + def __del__(self) -> None: ... + def __getattr__(self, attr: str): ... + def __setattr__(self, attr: str, val) -> None: ... + +def DispatchWithEvents(clsid, user_event_class): ... +def WithEvents(disp, user_event_class): ... +def getevents(clsid): ... +def Record(name, object): ... + +class DispatchBaseClass: + def __init__(self, oobj: Incomplete | None = ...) -> None: ... + def __dir__(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + def __getattr__(self, attr: str): ... + def __setattr__(self, attr: str, value) -> None: ... + +class CoClassBaseClass: + def __init__(self, oobj: Incomplete | None = ...) -> None: ... + def __getattr__(self, attr: str): ... + def __setattr__(self, attr: str, value) -> None: ... + def __maybe__call__(self, *args, **kwargs): ... + def __maybe__str__(self, *args): ... + def __maybe__int__(self, *args): ... + def __maybe__iter__(self): ... + def __maybe__len__(self): ... + def __maybe__nonzero__(self): ... + +class VARIANT: + varianttype: Incomplete + def __init__(self, vt, value) -> None: ... + value: Incomplete diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/client/build.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/client/build.pyi new file mode 100644 index 000000000..cbbcd2e9a --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/client/build.pyi @@ -0,0 +1,36 @@ +from _typeshed import Incomplete + +class OleItem: + typename: str + doc: Incomplete + python_name: Incomplete + bWritten: int + bIsDispatch: int + bIsSink: int + clsid: Incomplete + co_class: Incomplete + def __init__(self, doc: Incomplete | None = ...) -> None: ... + +class DispatchItem(OleItem): + typename: str + propMap: Incomplete + propMapGet: Incomplete + propMapPut: Incomplete + mapFuncs: Incomplete + defaultDispatchName: Incomplete + hidden: int + def __init__( + self, typeinfo: Incomplete | None = ..., attr: Incomplete | None = ..., doc: Incomplete | None = ..., bForUser: int = ... + ) -> None: ... + clsid: Incomplete + bIsDispatch: Incomplete + def Build(self, typeinfo, attr, bForUser: int = ...) -> None: ... + def CountInOutOptArgs(self, argTuple): ... + def MakeFuncMethod(self, entry, name, bMakeClass: int = ...): ... + def MakeDispatchFuncMethod(self, entry, name, bMakeClass: int = ...): ... + def MakeVarArgsFuncMethod(self, entry, name, bMakeClass: int = ...): ... + +class LazyDispatchItem(DispatchItem): + typename: str + clsid: Incomplete + def __init__(self, attr, doc) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/client/dynamic.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/client/dynamic.pyi new file mode 100644 index 000000000..d9cdc85b6 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/client/dynamic.pyi @@ -0,0 +1,87 @@ +from _typeshed import Incomplete +from typing import Any, Protocol, TypeVar, overload +from typing_extensions import TypeAlias + +import _win32typing +from win32.lib.pywintypes import IIDType +from win32com.client import build as build + +_T_co = TypeVar("_T_co", covariant=True) +_T = TypeVar("_T") + +class _DispatchCreateClass(Protocol[_T_co]): + @staticmethod + def __call__( + IDispatch: str | PyIDispatchType | _GoodDispatchTypes | PyIUnknownType, + olerepr: build.DispatchItem | build.LazyDispatchItem, + userName: str | None = ..., + UnicodeToString: None = ..., + lazydata: Incomplete | None = ..., + ) -> _T_co: ... + +debugging: int +debugging_attr: int +LCID: int +ERRORS_BAD_CONTEXT: Incomplete +ALL_INVOKE_TYPES: Incomplete + +def debug_print(*args) -> None: ... +def debug_attr_print(*args) -> None: ... +def MakeMethod(func, inst, cls): ... + +PyIDispatchType = _win32typing.PyIDispatch +PyIUnknownType = _win32typing.PyIUnknown + +_GoodDispatchTypes: TypeAlias = tuple[type[str], type[IIDType]] + +@overload +def Dispatch( + IDispatch: str | PyIDispatchType | _GoodDispatchTypes | PyIUnknownType, + userName: str | None, + createClass: _DispatchCreateClass[_T], + typeinfo: _win32typing.PyITypeInfo | None = ..., + UnicodeToString: None = ..., + clsctx: int = ..., +) -> _T: ... +@overload +def Dispatch( + IDispatch: str | PyIDispatchType | _GoodDispatchTypes | PyIUnknownType, + userName: str | None = ..., + createClass: None = ..., + typeinfo: _win32typing.PyITypeInfo | None = ..., + UnicodeToString: None = ..., + clsctx: int = ..., +) -> CDispatch: ... +def MakeOleRepr(IDispatch, typeinfo, typecomp): ... +def DumbDispatch( + IDispatch, + userName: Incomplete | None = ..., + createClass: Incomplete | None = ..., + UnicodeToString: Incomplete | None = ..., + clsctx=..., +): ... + +class CDispatch: + def __init__( + self, + IDispatch, + olerepr, + userName: Incomplete | None = ..., + UnicodeToString: None = ..., + lazydata: Incomplete | None = ..., + ) -> None: ... + def __call__(self, *args): ... + def __bool__(self) -> bool: ... + def __dir__(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + def __int__(self) -> int: ... + def __len__(self) -> int: ... + def __getitem__(self, index): ... + def __setitem__(self, index, *args) -> None: ... + def __LazyMap__(self, attr): ... + def __AttrToID__(self, attr): ... + ob: Incomplete + # CDispatch objects are dynamically generated and too complex to type + def __getattr__(self, attr: str) -> Any: ... + def __setattr__(self, attr: str, value: Any) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/client/gencache.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/client/gencache.pyi new file mode 100644 index 000000000..825af08d8 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/client/gencache.pyi @@ -0,0 +1,5 @@ +from win32com.client import dynamic + +def EnsureDispatch( + prog_id: str | dynamic.PyIDispatchType | dynamic._GoodDispatchTypes | dynamic.PyIUnknownType, bForDemand: int = ... +) -> dynamic.CDispatch: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/directsound/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/directsound/__init__.pyi new file mode 100644 index 000000000..6ac36b68e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/directsound/__init__.pyi @@ -0,0 +1 @@ +from win32comext.directsound import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/directsound/directsound.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/directsound/directsound.pyi new file mode 100644 index 000000000..ec66ab405 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/directsound/directsound.pyi @@ -0,0 +1 @@ +from win32comext.directsound.directsound import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/ifilter/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/ifilter/__init__.pyi new file mode 100644 index 000000000..258d3a36f --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/ifilter/__init__.pyi @@ -0,0 +1 @@ +from win32comext.ifilter import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/ifilter/ifilter.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/ifilter/ifilter.pyi new file mode 100644 index 000000000..01872b20c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/ifilter/ifilter.pyi @@ -0,0 +1 @@ +from win32comext.ifilter.ifilter import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/ifilter/ifiltercon.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/ifilter/ifiltercon.pyi new file mode 100644 index 000000000..8f2260e73 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/ifilter/ifiltercon.pyi @@ -0,0 +1 @@ +from win32comext.ifilter.ifiltercon import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/internet/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/internet/__init__.pyi new file mode 100644 index 000000000..8fb46e57e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/internet/__init__.pyi @@ -0,0 +1 @@ +from win32comext.internet import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/internet/inetcon.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/internet/inetcon.pyi new file mode 100644 index 000000000..58e4a6236 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/internet/inetcon.pyi @@ -0,0 +1 @@ +from win32comext.internet.inetcon import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/internet/internet.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/internet/internet.pyi new file mode 100644 index 000000000..e08fbee40 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/internet/internet.pyi @@ -0,0 +1 @@ +from win32comext.internet.internet import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/mapi/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/mapi/__init__.pyi new file mode 100644 index 000000000..cc183a971 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/mapi/__init__.pyi @@ -0,0 +1 @@ +from win32comext.mapi import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/mapi/_exchdapi.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/mapi/_exchdapi.pyi new file mode 100644 index 000000000..fe5f8ed0f --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/mapi/_exchdapi.pyi @@ -0,0 +1 @@ +from win32comext.mapi._exchdapi import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/mapi/emsabtags.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/mapi/emsabtags.pyi new file mode 100644 index 000000000..d38198bb2 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/mapi/emsabtags.pyi @@ -0,0 +1 @@ +from win32comext.mapi.emsabtags import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/mapi/exchange.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/mapi/exchange.pyi new file mode 100644 index 000000000..1d4b98a43 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/mapi/exchange.pyi @@ -0,0 +1 @@ +from win32comext.mapi.exchange import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/mapi/mapi.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/mapi/mapi.pyi new file mode 100644 index 000000000..e7bacd919 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/mapi/mapi.pyi @@ -0,0 +1 @@ +from win32comext.mapi.mapi import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/mapi/mapitags.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/mapi/mapitags.pyi new file mode 100644 index 000000000..f4ff53e2e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/mapi/mapitags.pyi @@ -0,0 +1 @@ +from win32comext.mapi.mapitags import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/mapi/mapiutil.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/mapi/mapiutil.pyi new file mode 100644 index 000000000..cd19df1c9 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/mapi/mapiutil.pyi @@ -0,0 +1 @@ +from win32comext.mapi.mapiutil import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/olectl.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/olectl.pyi new file mode 100644 index 000000000..33c11076d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/olectl.pyi @@ -0,0 +1,54 @@ +FACILITY_CONTROL: int + +def MAKE_SCODE(sev: int, fac: int, code: int) -> int: ... +def STD_CTL_SCODE(n: int) -> int: ... + +CTL_E_ILLEGALFUNCTIONCALL: int +CTL_E_OVERFLOW: int +CTL_E_OUTOFMEMORY: int +CTL_E_DIVISIONBYZERO: int +CTL_E_OUTOFSTRINGSPACE: int +CTL_E_OUTOFSTACKSPACE: int +CTL_E_BADFILENAMEORNUMBER: int +CTL_E_FILENOTFOUND: int +CTL_E_BADFILEMODE: int +CTL_E_FILEALREADYOPEN: int +CTL_E_DEVICEIOERROR: int +CTL_E_FILEALREADYEXISTS: int +CTL_E_BADRECORDLENGTH: int +CTL_E_DISKFULL: int +CTL_E_BADRECORDNUMBER: int +CTL_E_BADFILENAME: int +CTL_E_TOOMANYFILES: int +CTL_E_DEVICEUNAVAILABLE: int +CTL_E_PERMISSIONDENIED: int +CTL_E_DISKNOTREADY: int +CTL_E_PATHFILEACCESSERROR: int +CTL_E_PATHNOTFOUND: int +CTL_E_INVALIDPATTERNSTRING: int +CTL_E_INVALIDUSEOFNULL: int +CTL_E_INVALIDFILEFORMAT: int +CTL_E_INVALIDPROPERTYVALUE: int +CTL_E_INVALIDPROPERTYARRAYINDEX: int +CTL_E_SETNOTSUPPORTEDATRUNTIME: int +CTL_E_SETNOTSUPPORTED: int +CTL_E_NEEDPROPERTYARRAYINDEX: int +CTL_E_SETNOTPERMITTED: int +CTL_E_GETNOTSUPPORTEDATRUNTIME: int +CTL_E_GETNOTSUPPORTED: int +CTL_E_PROPERTYNOTFOUND: int +CTL_E_INVALIDCLIPBOARDFORMAT: int +CTL_E_INVALIDPICTURE: int +CTL_E_PRINTERERROR: int +CTL_E_CANTSAVEFILETOTEMP: int +CTL_E_SEARCHTEXTNOTFOUND: int +CTL_E_REPLACEMENTSTOOLONG: int +CONNECT_E_FIRST: int +CONNECT_E_LAST: int +CONNECT_S_FIRST: int +CONNECT_S_LAST: int +CONNECT_E_NOCONNECTION: int +CONNECT_E_ADVISELIMIT: int +CONNECT_E_CANNOTCONNECT: int +CONNECT_E_OVERRIDDEN: int +CLASS_E_NOTLICENSED: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/propsys/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/propsys/__init__.pyi new file mode 100644 index 000000000..34b721052 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/propsys/__init__.pyi @@ -0,0 +1 @@ +from win32comext.propsys import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/propsys/propsys.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/propsys/propsys.pyi new file mode 100644 index 000000000..c5afd3cba --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/propsys/propsys.pyi @@ -0,0 +1 @@ +from win32comext.propsys.propsys import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/propsys/pscon.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/propsys/pscon.pyi new file mode 100644 index 000000000..0f35b4734 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/propsys/pscon.pyi @@ -0,0 +1 @@ +from win32comext.propsys.pscon import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/server/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/server/__init__.pyi new file mode 100644 index 000000000..e69de29bb diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/server/connect.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/server/connect.pyi new file mode 100644 index 000000000..cf8670a6d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/server/connect.pyi @@ -0,0 +1,18 @@ +from _typeshed import Incomplete + +from win32com import olectl as olectl +from win32com.server.exception import Exception as Exception + +IConnectionPointContainer_methods: Incomplete +IConnectionPoint_methods: Incomplete + +class ConnectableServer: + cookieNo: int + connections: Incomplete + def EnumConnections(self) -> None: ... + def GetConnectionInterface(self) -> None: ... + def GetConnectionPointContainer(self): ... + def Advise(self, pUnk): ... + def Unadvise(self, cookie) -> None: ... + def EnumConnectionPoints(self) -> None: ... + def FindConnectionPoint(self, iid): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/server/dispatcher.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/server/dispatcher.pyi new file mode 100644 index 000000000..d88bf4f40 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/server/dispatcher.pyi @@ -0,0 +1,22 @@ +from _typeshed import Incomplete +from typing_extensions import TypeAlias + +from win32com.server.exception import IsCOMServerException as IsCOMServerException +from win32com.util import IIDToInterfaceName as IIDToInterfaceName + +class DispatcherBase: + policy: Incomplete + logger: Incomplete + def __init__(self, policyClass, object) -> None: ... + +class DispatcherTrace(DispatcherBase): ... + +class DispatcherWin32trace(DispatcherTrace): + def __init__(self, policyClass, object) -> None: ... + +class DispatcherOutputDebugString(DispatcherTrace): ... + +class DispatcherWin32dbg(DispatcherBase): + def __init__(self, policyClass, ob) -> None: ... + +DefaultDebugDispatcher: TypeAlias = DispatcherTrace diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/server/exception.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/server/exception.pyi new file mode 100644 index 000000000..6d27f7094 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/server/exception.pyi @@ -0,0 +1,25 @@ +from _typeshed import Incomplete + +import pythoncom + +class COMException(pythoncom.com_error): + scode: Incomplete + description: Incomplete + source: Incomplete + helpfile: Incomplete + helpcontext: Incomplete + def __init__( + self, + description: Incomplete | None = ..., + scode: Incomplete | None = ..., + source: Incomplete | None = ..., + helpfile: Incomplete | None = ..., + helpContext: Incomplete | None = ..., + desc: Incomplete | None = ..., + hresult: Incomplete | None = ..., + ) -> None: ... + +Exception = COMException + +def IsCOMException(t: Incomplete | None = ...): ... +def IsCOMServerException(t: Incomplete | None = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/server/policy.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/server/policy.pyi new file mode 100644 index 000000000..8edf97e27 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/server/policy.pyi @@ -0,0 +1,53 @@ +from _typeshed import Incomplete +from abc import ABC, abstractmethod + +from pythoncom import ( + DISPID_COLLECT as DISPID_COLLECT, + DISPID_CONSTRUCTOR as DISPID_CONSTRUCTOR, + DISPID_DESTRUCTOR as DISPID_DESTRUCTOR, + DISPID_UNKNOWN as DISPID_UNKNOWN, +) +from win32com.server.dispatcher import DispatcherTrace as DispatcherTrace, DispatcherWin32trace as DispatcherWin32trace +from win32com.server.exception import COMException as COMException + +S_OK: int +IDispatchType: Incomplete +IUnknownType: Incomplete +error: Incomplete +regSpec: str +regPolicy: str +regDispatcher: str +regAddnPath: str + +def CreateInstance(clsid, reqIID): ... + +class BasicWrapPolicy(ABC): + def __init__(self, object) -> None: ... + def _InvokeEx_(self, dispid, lcid, wFlags, args, kwargs, serviceProvider) -> tuple[Incomplete]: ... + @abstractmethod + def _invokeex_(self, dispid, lcid, wFlags, args, kwargs, serviceProvider) -> tuple[Incomplete]: ... + +class MappedWrapPolicy(BasicWrapPolicy): + _dispid_to_func_: dict[int, str] + def _invokeex_(self, dispid, lcid, wFlags, args, kwargs, serviceProvider) -> tuple[Incomplete]: ... + +class DesignatedWrapPolicy(MappedWrapPolicy): ... +class EventHandlerPolicy(DesignatedWrapPolicy): ... + +class DynamicPolicy(BasicWrapPolicy): + def _invokeex_(self, dispid, lcid, wFlags, args, kwargs, serviceProvider) -> tuple[Incomplete]: ... + +DefaultPolicy = DesignatedWrapPolicy + +def resolve_func(spec): ... +def call_func(spec, *args): ... + +DISPATCH_METHOD: int +DISPATCH_PROPERTYGET: int +DISPATCH_PROPERTYPUT: int +DISPATCH_PROPERTYPUTREF: int +DISPID_EVALUATE: int +DISPID_NEWENUM: int +DISPID_PROPERTYPUT: int +DISPID_STARTENUM: int +DISPID_VALUE: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/server/util.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/server/util.pyi new file mode 100644 index 000000000..14fe4b0f4 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/server/util.pyi @@ -0,0 +1,40 @@ +from _typeshed import Incomplete + +from win32com.server import policy as policy +from win32com.server.exception import COMException as COMException + +def wrap(ob, iid: Incomplete | None = ..., usePolicy: Incomplete | None = ..., useDispatcher: Incomplete | None = ...): ... +def unwrap(ob): ... + +class ListEnumerator: + index: Incomplete + def __init__(self, data, index: int = ..., iid=...) -> None: ... + def Next(self, count): ... + def Skip(self, count) -> None: ... + def Reset(self) -> None: ... + def Clone(self): ... + +class ListEnumeratorGateway(ListEnumerator): + def Next(self, count): ... + +def NewEnum(seq, cls=..., iid=..., usePolicy: Incomplete | None = ..., useDispatcher: Incomplete | None = ...): ... + +class Collection: + data: Incomplete + def __init__(self, data: Incomplete | None = ..., readOnly: int = ...) -> None: ... + def Item(self, *args): ... + def Count(self): ... + def Add(self, value) -> None: ... + def Remove(self, index) -> None: ... + def Insert(self, index, value) -> None: ... + +def NewCollection(seq, cls=...): ... + +class FileStream: + file: Incomplete + def __init__(self, file) -> None: ... + def Read(self, amount): ... + def Write(self, data): ... + def Clone(self): ... + def CopyTo(self, dest, cb): ... + def Seek(self, offset, origin): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/shell/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/shell/__init__.pyi new file mode 100644 index 000000000..1074dc68a --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/shell/__init__.pyi @@ -0,0 +1 @@ +from win32comext.shell import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/shell/shell.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/shell/shell.pyi new file mode 100644 index 000000000..63f042162 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/shell/shell.pyi @@ -0,0 +1 @@ +from win32comext.shell.shell import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/shell/shellcon.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/shell/shellcon.pyi new file mode 100644 index 000000000..d10057f46 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/shell/shellcon.pyi @@ -0,0 +1 @@ +from win32comext.shell.shellcon import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/storagecon.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/storagecon.pyi new file mode 100644 index 000000000..3242473ca --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/storagecon.pyi @@ -0,0 +1,113 @@ +STGC_DEFAULT: int +STGC_OVERWRITE: int +STGC_ONLYIFCURRENT: int +STGC_DANGEROUSLYCOMMITMERELYTODISKCACHE: int +STGC_CONSOLIDATE: int +STGTY_STORAGE: int +STGTY_STREAM: int +STGTY_LOCKBYTES: int +STGTY_PROPERTY: int +STREAM_SEEK_SET: int +STREAM_SEEK_CUR: int +STREAM_SEEK_END: int +LOCK_WRITE: int +LOCK_EXCLUSIVE: int +LOCK_ONLYONCE: int +CWCSTORAGENAME: int +STGM_DIRECT: int +STGM_TRANSACTED: int +STGM_SIMPLE: int +STGM_READ: int +STGM_WRITE: int +STGM_READWRITE: int +STGM_SHARE_DENY_NONE: int +STGM_SHARE_DENY_READ: int +STGM_SHARE_DENY_WRITE: int +STGM_SHARE_EXCLUSIVE: int +STGM_PRIORITY: int +STGM_DELETEONRELEASE: int +STGM_NOSCRATCH: int +STGM_CREATE: int +STGM_CONVERT: int +STGM_FAILIFTHERE: int +STGM_NOSNAPSHOT: int +ASYNC_MODE_COMPATIBILITY: int +ASYNC_MODE_DEFAULT: int +STGTY_REPEAT: int +STG_TOEND: int +STG_LAYOUT_SEQUENTIAL: int +STG_LAYOUT_INTERLEAVED: int +COM_RIGHTS_EXECUTE: int +COM_RIGHTS_EXECUTE_LOCAL: int +COM_RIGHTS_EXECUTE_REMOTE: int +COM_RIGHTS_ACTIVATE_LOCAL: int +COM_RIGHTS_ACTIVATE_REMOTE: int +STGFMT_DOCUMENT: int +STGFMT_STORAGE: int +STGFMT_NATIVE: int +STGFMT_FILE: int +STGFMT_ANY: int +STGFMT_DOCFILE: int +PID_DICTIONARY: int +PID_CODEPAGE: int +PID_FIRST_USABLE: int +PID_FIRST_NAME_DEFAULT: int +PID_LOCALE: int +PID_MODIFY_TIME: int +PID_SECURITY: int +PID_BEHAVIOR: int +PID_ILLEGAL: int +PID_MIN_READONLY: int +PID_MAX_READONLY: int +PIDDI_THUMBNAIL: int +PIDSI_TITLE: int +PIDSI_SUBJECT: int +PIDSI_AUTHOR: int +PIDSI_KEYWORDS: int +PIDSI_COMMENTS: int +PIDSI_TEMPLATE: int +PIDSI_LASTAUTHOR: int +PIDSI_REVNUMBER: int +PIDSI_EDITTIME: int +PIDSI_LASTPRINTED: int +PIDSI_CREATE_DTM: int +PIDSI_LASTSAVE_DTM: int +PIDSI_PAGECOUNT: int +PIDSI_WORDCOUNT: int +PIDSI_CHARCOUNT: int +PIDSI_THUMBNAIL: int +PIDSI_APPNAME: int +PIDSI_DOC_SECURITY: int +PIDDSI_CATEGORY: int +PIDDSI_PRESFORMAT: int +PIDDSI_BYTECOUNT: int +PIDDSI_LINECOUNT: int +PIDDSI_PARCOUNT: int +PIDDSI_SLIDECOUNT: int +PIDDSI_NOTECOUNT: int +PIDDSI_HIDDENCOUNT: int +PIDDSI_MMCLIPCOUNT: int +PIDDSI_SCALE: int +PIDDSI_HEADINGPAIR: int +PIDDSI_DOCPARTS: int +PIDDSI_MANAGER: int +PIDDSI_COMPANY: int +PIDDSI_LINKSDIRTY: int +PIDMSI_EDITOR: int +PIDMSI_SUPPLIER: int +PIDMSI_SOURCE: int +PIDMSI_SEQUENCE_NO: int +PIDMSI_PROJECT: int +PIDMSI_STATUS: int +PIDMSI_OWNER: int +PIDMSI_RATING: int +PIDMSI_PRODUCTION: int +PIDMSI_COPYRIGHT: int +PROPSETFLAG_DEFAULT: int +PROPSETFLAG_NONSIMPLE: int +PROPSETFLAG_ANSI: int +PROPSETFLAG_UNBUFFERED: int +PROPSETFLAG_CASE_SENSITIVE: int +STGMOVE_MOVE: int +STGMOVE_COPY: int +STGMOVE_SHALLOWCOPY: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/taskscheduler/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/taskscheduler/__init__.pyi new file mode 100644 index 000000000..2d22e3f9c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/taskscheduler/__init__.pyi @@ -0,0 +1 @@ +from win32comext.taskscheduler import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/taskscheduler/taskscheduler.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/taskscheduler/taskscheduler.pyi new file mode 100644 index 000000000..7771ba730 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/taskscheduler/taskscheduler.pyi @@ -0,0 +1 @@ +from win32comext.taskscheduler.taskscheduler import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/universal.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/universal.pyi new file mode 100644 index 000000000..f10b28b8a --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/universal.pyi @@ -0,0 +1,27 @@ +from _typeshed import Incomplete + +from pythoncom import com_error as com_error +from win32com.client import gencache as gencache + +def RegisterInterfaces(typelibGUID, lcid, major, minor, interface_names: Incomplete | None = ...): ... + +class Arg: + name: Incomplete + size: Incomplete + offset: int + def __init__(self, arg_info, name: Incomplete | None = ...) -> None: ... + +class Method: + dispid: Incomplete + invkind: Incomplete + name: Incomplete + args: Incomplete + cbArgs: Incomplete + def __init__(self, method_info, isEventSink: int = ...) -> None: ... + +class Definition: + def __init__(self, iid, is_dispatch, method_defs) -> None: ... + def iid(self): ... + def vtbl_argsizes(self): ... + def vtbl_argcounts(self): ... + def dispatch(self, ob, index, argPtr, ReadFromInTuple=..., WriteFromOutTuple=...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/util.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/util.pyi new file mode 100644 index 000000000..6c896a886 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/util.pyi @@ -0,0 +1 @@ +def IIDToInterfaceName(iid): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/__init__.pyi new file mode 100644 index 000000000..e69de29bb diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/adsi/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/adsi/__init__.pyi new file mode 100644 index 000000000..8a3afe5f5 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/adsi/__init__.pyi @@ -0,0 +1,73 @@ +from _typeshed import Incomplete + +import _win32typing +import win32com.client +from win32comext.adsi.adsi import ( + DBPROPSET_ADSISEARCH as DBPROPSET_ADSISEARCH, + ADsBuildEnumerator as ADsBuildEnumerator, + ADsEnumerateNext as ADsEnumerateNext, + ADsGetLastError as ADsGetLastError, + CLSID_AccessControlEntry as CLSID_AccessControlEntry, + CLSID_AccessControlList as CLSID_AccessControlList, + CLSID_ADsDSOObject as CLSID_ADsDSOObject, + CLSID_DsObjectPicker as CLSID_DsObjectPicker, + CLSID_SecurityDescriptor as CLSID_SecurityDescriptor, + DBGUID_LDAPDialect as DBGUID_LDAPDialect, + DSOP_SCOPE_INIT_INFOs as DSOP_SCOPE_INIT_INFOs, + IID_IADs as IID_IADs, + IID_IADsClass as IID_IADsClass, + IID_IADsCollection as IID_IADsCollection, + IID_IADsComputer as IID_IADsComputer, + IID_IADsComputerOperations as IID_IADsComputerOperations, + IID_IADsContainer as IID_IADsContainer, + IID_IADsDeleteOps as IID_IADsDeleteOps, + IID_IADsDomain as IID_IADsDomain, + IID_IADsFileService as IID_IADsFileService, + IID_IADsFileServiceOperations as IID_IADsFileServiceOperations, + IID_IADsFileShare as IID_IADsFileShare, + IID_IADsGroup as IID_IADsGroup, + IID_IADsLocality as IID_IADsLocality, + IID_IADsMembers as IID_IADsMembers, + IID_IADsNamespaces as IID_IADsNamespaces, + IID_IADsO as IID_IADsO, + IID_IADsOpenDSObject as IID_IADsOpenDSObject, + IID_IADsOU as IID_IADsOU, + IID_IADsPrintJob as IID_IADsPrintJob, + IID_IADsPrintJobOperations as IID_IADsPrintJobOperations, + IID_IADsPrintQueue as IID_IADsPrintQueue, + IID_IADsPrintQueueOperations as IID_IADsPrintQueueOperations, + IID_IADsProperty as IID_IADsProperty, + IID_IADsPropertyList as IID_IADsPropertyList, + IID_IADsResource as IID_IADsResource, + IID_IADsSearch as IID_IADsSearch, + IID_IADsService as IID_IADsService, + IID_IADsServiceOperations as IID_IADsServiceOperations, + IID_IADsSession as IID_IADsSession, + IID_IADsSyntax as IID_IADsSyntax, + IID_IADsUser as IID_IADsUser, + IID_IDirectoryObject as IID_IDirectoryObject, + IID_IDirectorySearch as IID_IDirectorySearch, + IID_IDsObjectPicker as IID_IDsObjectPicker, + LIBID_ADs as LIBID_ADs, + StringAsDS_SELECTION_LIST as StringAsDS_SELECTION_LIST, +) + +LCID: int +IDispatchType: Incomplete +IADsContainerType: Incomplete + +class ADSIEnumerator: + index: int + def __init__(self, ob) -> None: ... + def __getitem__(self, index): ... + def __call__(self, index): ... + +class ADSIDispatch(win32com.client.CDispatch): + def __getattr__(self, attr: str): ... + def QueryInterface(self, iid): ... + +# Redefinition making "iid" optional. +def ADsGetObject(path, iid: _win32typing.PyIID = ...): ... + +# Redefinition with flipped "reserved" and "iid" arguments. +def ADsOpenObject(path, username, password, reserved: int = ..., iid: _win32typing.PyIID = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/adsi/adsi.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/adsi/adsi.pyi new file mode 100644 index 000000000..4004c541d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/adsi/adsi.pyi @@ -0,0 +1,58 @@ +from _typeshed import Incomplete +from typing_extensions import TypeAlias + +import _win32typing +from win32.lib.pywintypes import com_error + +error: TypeAlias = com_error # noqa: Y042 + +def ADsOpenObject(path, username, password, iid: _win32typing.PyIID, reserved: int = ...): ... +def ADsGetObject(path, iid: _win32typing.PyIID): ... +def ADsBuildEnumerator(container: _win32typing.PyIADsContainer): ... +def ADsEnumerateNext(enum, num: int = ...): ... +def ADsGetLastError() -> tuple[Incomplete, Incomplete, Incomplete]: ... +def StringAsDS_SELECTION_LIST(*args, **kwargs): ... # incomplete + +DSOP_SCOPE_INIT_INFOs = _win32typing.PyDSOP_SCOPE_INIT_INFOs +CLSID_ADsDSOObject: _win32typing.PyIID +CLSID_AccessControlEntry: _win32typing.PyIID +CLSID_AccessControlList: _win32typing.PyIID +CLSID_DsObjectPicker: _win32typing.PyIID +CLSID_SecurityDescriptor: _win32typing.PyIID +DBGUID_LDAPDialect: _win32typing.PyIID +DBPROPSET_ADSISEARCH: _win32typing.PyIID +IID_IADs: _win32typing.PyIID +IID_IADsClass: _win32typing.PyIID +IID_IADsCollection: _win32typing.PyIID +IID_IADsComputer: _win32typing.PyIID +IID_IADsComputerOperations: _win32typing.PyIID +IID_IADsContainer: _win32typing.PyIID +IID_IADsDeleteOps: _win32typing.PyIID +IID_IADsDomain: _win32typing.PyIID +IID_IADsFileService: _win32typing.PyIID +IID_IADsFileServiceOperations: _win32typing.PyIID +IID_IADsFileShare: _win32typing.PyIID +IID_IADsGroup: _win32typing.PyIID +IID_IADsLocality: _win32typing.PyIID +IID_IADsMembers: _win32typing.PyIID +IID_IADsNamespaces: _win32typing.PyIID +IID_IADsO: _win32typing.PyIID +IID_IADsOU: _win32typing.PyIID +IID_IADsOpenDSObject: _win32typing.PyIID +IID_IADsPrintJob: _win32typing.PyIID +IID_IADsPrintJobOperations: _win32typing.PyIID +IID_IADsPrintQueue: _win32typing.PyIID +IID_IADsPrintQueueOperations: _win32typing.PyIID +IID_IADsProperty: _win32typing.PyIID +IID_IADsPropertyList: _win32typing.PyIID +IID_IADsResource: _win32typing.PyIID +IID_IADsSearch: _win32typing.PyIID +IID_IADsService: _win32typing.PyIID +IID_IADsServiceOperations: _win32typing.PyIID +IID_IADsSession: _win32typing.PyIID +IID_IADsSyntax: _win32typing.PyIID +IID_IADsUser: _win32typing.PyIID +IID_IDirectoryObject: _win32typing.PyIID +IID_IDirectorySearch: _win32typing.PyIID +IID_IDsObjectPicker: _win32typing.PyIID +LIBID_ADs: _win32typing.PyIID diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/adsi/adsicon.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/adsi/adsicon.pyi new file mode 100644 index 000000000..f31229dd0 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/adsi/adsicon.pyi @@ -0,0 +1,318 @@ +from _typeshed import Incomplete + +ADS_ATTR_CLEAR: int +ADS_ATTR_UPDATE: int +ADS_ATTR_APPEND: int +ADS_ATTR_DELETE: int +ADS_EXT_MINEXTDISPID: int +ADS_EXT_MAXEXTDISPID: int +ADS_EXT_INITCREDENTIALS: int +ADS_EXT_INITIALIZE_COMPLETE: int +ADS_SEARCHPREF_ASYNCHRONOUS: int +ADS_SEARCHPREF_DEREF_ALIASES: int +ADS_SEARCHPREF_SIZE_LIMIT: int +ADS_SEARCHPREF_TIME_LIMIT: int +ADS_SEARCHPREF_ATTRIBTYPES_ONLY: int +ADS_SEARCHPREF_SEARCH_SCOPE: int +ADS_SEARCHPREF_TIMEOUT: int +ADS_SEARCHPREF_PAGESIZE: int +ADS_SEARCHPREF_PAGED_TIME_LIMIT: int +ADS_SEARCHPREF_CHASE_REFERRALS: int +ADS_SEARCHPREF_SORT_ON: int +ADS_SEARCHPREF_CACHE_RESULTS: int +ADS_SEARCHPREF_DIRSYNC: int +ADS_SEARCHPREF_TOMBSTONE: int +ADS_SCOPE_BASE: int +ADS_SCOPE_ONELEVEL: int +ADS_SCOPE_SUBTREE: int +ADS_SECURE_AUTHENTICATION: int +ADS_USE_ENCRYPTION: int +ADS_USE_SSL: int +ADS_READONLY_SERVER: int +ADS_PROMPT_CREDENTIALS: int +ADS_NO_AUTHENTICATION: int +ADS_FAST_BIND: int +ADS_USE_SIGNING: int +ADS_USE_SEALING: int +ADS_USE_DELEGATION: int +ADS_SERVER_BIND: int +ADSTYPE_INVALID: int +ADSTYPE_DN_STRING: Incomplete +ADSTYPE_CASE_EXACT_STRING: Incomplete +ADSTYPE_CASE_IGNORE_STRING: Incomplete +ADSTYPE_PRINTABLE_STRING: Incomplete +ADSTYPE_NUMERIC_STRING: Incomplete +ADSTYPE_BOOLEAN: Incomplete +ADSTYPE_INTEGER: Incomplete +ADSTYPE_OCTET_STRING: Incomplete +ADSTYPE_UTC_TIME: Incomplete +ADSTYPE_LARGE_INTEGER: Incomplete +ADSTYPE_PROV_SPECIFIC: Incomplete +ADSTYPE_OBJECT_CLASS: Incomplete +ADSTYPE_CASEIGNORE_LIST: Incomplete +ADSTYPE_OCTET_LIST: Incomplete +ADSTYPE_PATH: Incomplete +ADSTYPE_POSTALADDRESS: Incomplete +ADSTYPE_TIMESTAMP: Incomplete +ADSTYPE_BACKLINK: Incomplete +ADSTYPE_TYPEDNAME: Incomplete +ADSTYPE_HOLD: Incomplete +ADSTYPE_NETADDRESS: Incomplete +ADSTYPE_REPLICAPOINTER: Incomplete +ADSTYPE_FAXNUMBER: Incomplete +ADSTYPE_EMAIL: Incomplete +ADSTYPE_NT_SECURITY_DESCRIPTOR: Incomplete +ADSTYPE_UNKNOWN: Incomplete +ADSTYPE_DN_WITH_BINARY: Incomplete +ADSTYPE_DN_WITH_STRING: Incomplete +ADS_PROPERTY_CLEAR: int +ADS_PROPERTY_UPDATE: int +ADS_PROPERTY_APPEND: int +ADS_PROPERTY_DELETE: int +ADS_SYSTEMFLAG_DISALLOW_DELETE: int +ADS_SYSTEMFLAG_CONFIG_ALLOW_RENAME: int +ADS_SYSTEMFLAG_CONFIG_ALLOW_MOVE: int +ADS_SYSTEMFLAG_CONFIG_ALLOW_LIMITED_MOVE: int +ADS_SYSTEMFLAG_DOMAIN_DISALLOW_RENAME: int +ADS_SYSTEMFLAG_DOMAIN_DISALLOW_MOVE: int +ADS_SYSTEMFLAG_CR_NTDS_NC: int +ADS_SYSTEMFLAG_CR_NTDS_DOMAIN: int +ADS_SYSTEMFLAG_ATTR_NOT_REPLICATED: int +ADS_SYSTEMFLAG_ATTR_IS_CONSTRUCTED: int +ADS_GROUP_TYPE_GLOBAL_GROUP: int +ADS_GROUP_TYPE_DOMAIN_LOCAL_GROUP: int +ADS_GROUP_TYPE_LOCAL_GROUP: int +ADS_GROUP_TYPE_UNIVERSAL_GROUP: int +ADS_GROUP_TYPE_SECURITY_ENABLED: int +ADS_UF_SCRIPT: int +ADS_UF_ACCOUNTDISABLE: int +ADS_UF_HOMEDIR_REQUIRED: int +ADS_UF_LOCKOUT: int +ADS_UF_PASSWD_NOTREQD: int +ADS_UF_PASSWD_CANT_CHANGE: int +ADS_UF_ENCRYPTED_TEXT_PASSWORD_ALLOWED: int +ADS_UF_TEMP_DUPLICATE_ACCOUNT: int +ADS_UF_NORMAL_ACCOUNT: int +ADS_UF_INTERDOMAIN_TRUST_ACCOUNT: int +ADS_UF_WORKSTATION_TRUST_ACCOUNT: int +ADS_UF_SERVER_TRUST_ACCOUNT: int +ADS_UF_DONT_EXPIRE_PASSWD: int +ADS_UF_MNS_LOGON_ACCOUNT: int +ADS_UF_SMARTCARD_REQUIRED: int +ADS_UF_TRUSTED_FOR_DELEGATION: int +ADS_UF_NOT_DELEGATED: int +ADS_UF_USE_DES_KEY_ONLY: int +ADS_UF_DONT_REQUIRE_PREAUTH: int +ADS_UF_PASSWORD_EXPIRED: int +ADS_UF_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION: int +ADS_RIGHT_DELETE: int +ADS_RIGHT_READ_CONTROL: int +ADS_RIGHT_WRITE_DAC: int +ADS_RIGHT_WRITE_OWNER: int +ADS_RIGHT_SYNCHRONIZE: int +ADS_RIGHT_ACCESS_SYSTEM_SECURITY: int +ADS_RIGHT_GENERIC_READ: int +ADS_RIGHT_GENERIC_WRITE: int +ADS_RIGHT_GENERIC_EXECUTE: int +ADS_RIGHT_GENERIC_ALL: int +ADS_RIGHT_DS_CREATE_CHILD: int +ADS_RIGHT_DS_DELETE_CHILD: int +ADS_RIGHT_ACTRL_DS_LIST: int +ADS_RIGHT_DS_SELF: int +ADS_RIGHT_DS_READ_PROP: int +ADS_RIGHT_DS_WRITE_PROP: int +ADS_RIGHT_DS_DELETE_TREE: int +ADS_RIGHT_DS_LIST_OBJECT: int +ADS_RIGHT_DS_CONTROL_ACCESS: int +ADS_ACETYPE_ACCESS_ALLOWED: int +ADS_ACETYPE_ACCESS_DENIED: int +ADS_ACETYPE_SYSTEM_AUDIT: int +ADS_ACETYPE_ACCESS_ALLOWED_OBJECT: int +ADS_ACETYPE_ACCESS_DENIED_OBJECT: int +ADS_ACETYPE_SYSTEM_AUDIT_OBJECT: int +ADS_ACETYPE_SYSTEM_ALARM_OBJECT: int +ADS_ACETYPE_ACCESS_ALLOWED_CALLBACK: int +ADS_ACETYPE_ACCESS_DENIED_CALLBACK: int +ADS_ACETYPE_ACCESS_ALLOWED_CALLBACK_OBJECT: int +ADS_ACETYPE_ACCESS_DENIED_CALLBACK_OBJECT: int +ADS_ACETYPE_SYSTEM_AUDIT_CALLBACK: int +ADS_ACETYPE_SYSTEM_ALARM_CALLBACK: int +ADS_ACETYPE_SYSTEM_AUDIT_CALLBACK_OBJECT: int +ADS_ACETYPE_SYSTEM_ALARM_CALLBACK_OBJECT: int +ADS_ACEFLAG_INHERIT_ACE: int +ADS_ACEFLAG_NO_PROPAGATE_INHERIT_ACE: int +ADS_ACEFLAG_INHERIT_ONLY_ACE: int +ADS_ACEFLAG_INHERITED_ACE: int +ADS_ACEFLAG_VALID_INHERIT_FLAGS: int +ADS_ACEFLAG_SUCCESSFUL_ACCESS: int +ADS_ACEFLAG_FAILED_ACCESS: int +ADS_FLAG_OBJECT_TYPE_PRESENT: int +ADS_FLAG_INHERITED_OBJECT_TYPE_PRESENT: int +ADS_SD_CONTROL_SE_OWNER_DEFAULTED: int +ADS_SD_CONTROL_SE_GROUP_DEFAULTED: int +ADS_SD_CONTROL_SE_DACL_PRESENT: int +ADS_SD_CONTROL_SE_DACL_DEFAULTED: int +ADS_SD_CONTROL_SE_SACL_PRESENT: int +ADS_SD_CONTROL_SE_SACL_DEFAULTED: int +ADS_SD_CONTROL_SE_DACL_AUTO_INHERIT_REQ: int +ADS_SD_CONTROL_SE_SACL_AUTO_INHERIT_REQ: int +ADS_SD_CONTROL_SE_DACL_AUTO_INHERITED: int +ADS_SD_CONTROL_SE_SACL_AUTO_INHERITED: int +ADS_SD_CONTROL_SE_DACL_PROTECTED: int +ADS_SD_CONTROL_SE_SACL_PROTECTED: int +ADS_SD_CONTROL_SE_SELF_RELATIVE: int +ADS_SD_REVISION_DS: int +ADS_NAME_TYPE_1779: int +ADS_NAME_TYPE_CANONICAL: int +ADS_NAME_TYPE_NT4: int +ADS_NAME_TYPE_DISPLAY: int +ADS_NAME_TYPE_DOMAIN_SIMPLE: int +ADS_NAME_TYPE_ENTERPRISE_SIMPLE: int +ADS_NAME_TYPE_GUID: int +ADS_NAME_TYPE_UNKNOWN: int +ADS_NAME_TYPE_USER_PRINCIPAL_NAME: int +ADS_NAME_TYPE_CANONICAL_EX: int +ADS_NAME_TYPE_SERVICE_PRINCIPAL_NAME: int +ADS_NAME_TYPE_SID_OR_SID_HISTORY_NAME: int +ADS_NAME_INITTYPE_DOMAIN: int +ADS_NAME_INITTYPE_SERVER: int +ADS_NAME_INITTYPE_GC: int +ADS_OPTION_SERVERNAME: int +ADS_OPTION_REFERRALS: Incomplete +ADS_OPTION_PAGE_SIZE: Incomplete +ADS_OPTION_SECURITY_MASK: Incomplete +ADS_OPTION_MUTUAL_AUTH_STATUS: Incomplete +ADS_OPTION_QUOTA: Incomplete +ADS_OPTION_PASSWORD_PORTNUMBER: Incomplete +ADS_OPTION_PASSWORD_METHOD: Incomplete +ADS_SECURITY_INFO_OWNER: int +ADS_SECURITY_INFO_GROUP: int +ADS_SECURITY_INFO_DACL: int +ADS_SECURITY_INFO_SACL: int +ADS_SETTYPE_FULL: int +ADS_SETTYPE_PROVIDER: int +ADS_SETTYPE_SERVER: int +ADS_SETTYPE_DN: int +ADS_FORMAT_WINDOWS: int +ADS_FORMAT_WINDOWS_NO_SERVER: int +ADS_FORMAT_WINDOWS_DN: int +ADS_FORMAT_WINDOWS_PARENT: int +ADS_FORMAT_X500: int +ADS_FORMAT_X500_NO_SERVER: int +ADS_FORMAT_X500_DN: int +ADS_FORMAT_X500_PARENT: int +ADS_FORMAT_SERVER: int +ADS_FORMAT_PROVIDER: int +ADS_FORMAT_LEAF: int +ADS_DISPLAY_FULL: int +ADS_DISPLAY_VALUE_ONLY: int +ADS_ESCAPEDMODE_DEFAULT: int +ADS_ESCAPEDMODE_ON: int +ADS_ESCAPEDMODE_OFF: int +ADS_ESCAPEDMODE_OFF_EX: int +ADS_PATH_FILE: int +ADS_PATH_FILESHARE: int +ADS_PATH_REGISTRY: int +ADS_SD_FORMAT_IID: int +ADS_SD_FORMAT_RAW: int +ADS_SD_FORMAT_HEXSTRING: int +E_ADS_BAD_PATHNAME: Incomplete +E_ADS_INVALID_DOMAIN_OBJECT: Incomplete +E_ADS_INVALID_USER_OBJECT: Incomplete +E_ADS_INVALID_COMPUTER_OBJECT: Incomplete +E_ADS_UNKNOWN_OBJECT: Incomplete +E_ADS_PROPERTY_NOT_SET: Incomplete +E_ADS_PROPERTY_NOT_SUPPORTED: Incomplete +E_ADS_PROPERTY_INVALID: Incomplete +E_ADS_BAD_PARAMETER: Incomplete +E_ADS_OBJECT_UNBOUND: Incomplete +E_ADS_PROPERTY_NOT_MODIFIED: Incomplete +E_ADS_PROPERTY_MODIFIED: Incomplete +E_ADS_CANT_CONVERT_DATATYPE: Incomplete +E_ADS_PROPERTY_NOT_FOUND: Incomplete +E_ADS_OBJECT_EXISTS: Incomplete +E_ADS_SCHEMA_VIOLATION: Incomplete +E_ADS_COLUMN_NOT_SET: Incomplete +S_ADS_ERRORSOCCURRED: Incomplete +S_ADS_NOMORE_ROWS: Incomplete +S_ADS_NOMORE_COLUMNS: Incomplete +E_ADS_INVALID_FILTER: Incomplete +ADS_DEREF_NEVER: int +ADS_DEREF_SEARCHING: int +ADS_DEREF_FINDING: int +ADS_DEREF_ALWAYS: int +ADSIPROP_ASYNCHRONOUS: int +ADSIPROP_DEREF_ALIASES: int +ADSIPROP_SIZE_LIMIT: int +ADSIPROP_TIME_LIMIT: int +ADSIPROP_ATTRIBTYPES_ONLY: int +ADSIPROP_SEARCH_SCOPE: int +ADSIPROP_TIMEOUT: int +ADSIPROP_PAGESIZE: int +ADSIPROP_PAGED_TIME_LIMIT: int +ADSIPROP_CHASE_REFERRALS: int +ADSIPROP_SORT_ON: int +ADSIPROP_CACHE_RESULTS: int +ADSIPROP_ADSIFLAG: int +ADSI_DIALECT_LDAP: int +ADSI_DIALECT_SQL: int +ADS_CHASE_REFERRALS_NEVER: int +ADS_CHASE_REFERRALS_SUBORDINATE: int +ADS_CHASE_REFERRALS_EXTERNAL: int +ADS_CHASE_REFERRALS_ALWAYS: Incomplete +DSOP_SCOPE_TYPE_TARGET_COMPUTER: int +DSOP_SCOPE_TYPE_UPLEVEL_JOINED_DOMAIN: int +DSOP_SCOPE_TYPE_DOWNLEVEL_JOINED_DOMAIN: int +DSOP_SCOPE_TYPE_ENTERPRISE_DOMAIN: int +DSOP_SCOPE_TYPE_GLOBAL_CATALOG: int +DSOP_SCOPE_TYPE_EXTERNAL_UPLEVEL_DOMAIN: int +DSOP_SCOPE_TYPE_EXTERNAL_DOWNLEVEL_DOMAIN: int +DSOP_SCOPE_TYPE_WORKGROUP: int +DSOP_SCOPE_TYPE_USER_ENTERED_UPLEVEL_SCOPE: int +DSOP_SCOPE_TYPE_USER_ENTERED_DOWNLEVEL_SCOPE: int +DSOP_SCOPE_FLAG_STARTING_SCOPE: int +DSOP_SCOPE_FLAG_WANT_PROVIDER_WINNT: int +DSOP_SCOPE_FLAG_WANT_PROVIDER_LDAP: int +DSOP_SCOPE_FLAG_WANT_PROVIDER_GC: int +DSOP_SCOPE_FLAG_WANT_SID_PATH: int +DSOP_SCOPE_FLAG_WANT_DOWNLEVEL_BUILTIN_PATH: int +DSOP_SCOPE_FLAG_DEFAULT_FILTER_USERS: int +DSOP_SCOPE_FLAG_DEFAULT_FILTER_GROUPS: int +DSOP_SCOPE_FLAG_DEFAULT_FILTER_COMPUTERS: int +DSOP_SCOPE_FLAG_DEFAULT_FILTER_CONTACTS: int +DSOP_FILTER_INCLUDE_ADVANCED_VIEW: int +DSOP_FILTER_USERS: int +DSOP_FILTER_BUILTIN_GROUPS: int +DSOP_FILTER_WELL_KNOWN_PRINCIPALS: int +DSOP_FILTER_UNIVERSAL_GROUPS_DL: int +DSOP_FILTER_UNIVERSAL_GROUPS_SE: int +DSOP_FILTER_GLOBAL_GROUPS_DL: int +DSOP_FILTER_GLOBAL_GROUPS_SE: int +DSOP_FILTER_DOMAIN_LOCAL_GROUPS_DL: int +DSOP_FILTER_DOMAIN_LOCAL_GROUPS_SE: int +DSOP_FILTER_CONTACTS: int +DSOP_FILTER_COMPUTERS: int +DSOP_DOWNLEVEL_FILTER_USERS: int +DSOP_DOWNLEVEL_FILTER_LOCAL_GROUPS: int +DSOP_DOWNLEVEL_FILTER_GLOBAL_GROUPS: int +DSOP_DOWNLEVEL_FILTER_COMPUTERS: int +DSOP_DOWNLEVEL_FILTER_WORLD: int +DSOP_DOWNLEVEL_FILTER_AUTHENTICATED_USER: int +DSOP_DOWNLEVEL_FILTER_ANONYMOUS: int +DSOP_DOWNLEVEL_FILTER_BATCH: int +DSOP_DOWNLEVEL_FILTER_CREATOR_OWNER: int +DSOP_DOWNLEVEL_FILTER_CREATOR_GROUP: int +DSOP_DOWNLEVEL_FILTER_DIALUP: int +DSOP_DOWNLEVEL_FILTER_INTERACTIVE: int +DSOP_DOWNLEVEL_FILTER_NETWORK: int +DSOP_DOWNLEVEL_FILTER_SERVICE: int +DSOP_DOWNLEVEL_FILTER_SYSTEM: int +DSOP_DOWNLEVEL_FILTER_EXCLUDE_BUILTIN_GROUPS: int +DSOP_DOWNLEVEL_FILTER_TERMINAL_SERVER: int +DSOP_DOWNLEVEL_FILTER_ALL_WELLKNOWN_SIDS: int +DSOP_DOWNLEVEL_FILTER_LOCAL_SERVICE: int +DSOP_DOWNLEVEL_FILTER_NETWORK_SERVICE: int +DSOP_DOWNLEVEL_FILTER_REMOTE_LOGON: int +DSOP_FLAG_MULTISELECT: int +DSOP_FLAG_SKIP_TARGET_COMPUTER_DC_CHECK: int +CFSTR_DSOP_DS_SELECTION_LIST: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/authorization/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/authorization/__init__.pyi new file mode 100644 index 000000000..e69de29bb diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/authorization/authorization.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/authorization/authorization.pyi new file mode 100644 index 000000000..0a9881848 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/authorization/authorization.pyi @@ -0,0 +1,5 @@ +import _win32typing + +def EditSecurity(*args, **kwargs): ... # incomplete + +IID_ISecurityInformation: _win32typing.PyIID diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axcontrol/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axcontrol/__init__.pyi new file mode 100644 index 000000000..e69de29bb diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axcontrol/axcontrol.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axcontrol/axcontrol.pyi new file mode 100644 index 000000000..c4f346bc8 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axcontrol/axcontrol.pyi @@ -0,0 +1,60 @@ +import _win32typing + +def OleCreate( + clsid, + clsid1, + obCLSID: _win32typing.PyIID, + obIID: _win32typing.PyIID, + renderopt, + obFormatEtc, + obOleClientSite: _win32typing.PyIOleClientSite, + obStorage: _win32typing.PyIStorage, +) -> _win32typing.PyIOleObject: ... +def OleLoadPicture( + stream: _win32typing.PyIStream, size, runMode, arg: _win32typing.PyIID, arg1: _win32typing.PyIID +) -> _win32typing.PyIUnknown: ... +def OleLoadPicturePath( + url_or_path: str, unk, reserved, clr, arg: _win32typing.PyIID, arg1: _win32typing.PyIID +) -> _win32typing.PyIUnknown: ... +def OleSetContainedObject(unk: _win32typing.PyIUnknown, fContained) -> None: ... +def OleTranslateAccelerator(frame: _win32typing.PyIOleInPlaceFrame, frame_info, msg: _win32typing.PyMSG) -> None: ... + +EMBDHLP_CREATENOW: int +EMBDHLP_DELAYCREATE: int +EMBDHLP_INPROC_HANDLER: int +EMBDHLP_INPROC_SERVER: int +OLECLOSE_NOSAVE: int +OLECLOSE_PROMPTSAVE: int +OLECLOSE_SAVEIFDIRTY: int +OLECMDF_ENABLED: int +OLECMDF_LATCHED: int +OLECMDF_NINCHED: int +OLECMDF_SUPPORTED: int +OLECMDTEXTF_NAME: int +OLECMDTEXTF_NONE: int +OLECMDTEXTF_STATUS: int +OLECREATE_LEAVERUNNING: int +OLEIVERB_DISCARDUNDOSTATE: int +OLEIVERB_HIDE: int +OLEIVERB_INPLACEACTIVATE: int +OLEIVERB_OPEN: int +OLEIVERB_PRIMARY: int +OLEIVERB_SHOW: int +OLEIVERB_UIACTIVATE: int +IID_IObjectWithSite: _win32typing.PyIID +IID_IOleClientSite: _win32typing.PyIID +IID_IOleCommandTarget: _win32typing.PyIID +IID_IOleControl: _win32typing.PyIID +IID_IOleControlSite: _win32typing.PyIID +IID_IOleInPlaceActiveObject: _win32typing.PyIID +IID_IOleInPlaceFrame: _win32typing.PyIID +IID_IOleInPlaceObject: _win32typing.PyIID +IID_IOleInPlaceSite: _win32typing.PyIID +IID_IOleInPlaceSiteEx: _win32typing.PyIID +IID_IOleInPlaceSiteWindowless: _win32typing.PyIID +IID_IOleInPlaceUIWindow: _win32typing.PyIID +IID_IOleLink: _win32typing.PyIID +IID_IOleObject: _win32typing.PyIID +IID_ISpecifyPropertyPages: _win32typing.PyIID +IID_IViewObject: _win32typing.PyIID +IID_IViewObject2: _win32typing.PyIID diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axdebug/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axdebug/__init__.pyi new file mode 100644 index 000000000..e69de29bb diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axdebug/adb.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axdebug/adb.pyi new file mode 100644 index 000000000..70d39be22 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axdebug/adb.pyi @@ -0,0 +1,71 @@ +import bdb +from _typeshed import Incomplete + +from win32com.axdebug.util import trace +from win32com.server.util import unwrap as unwrap +from win32comext.axdebug import gateways as gateways + +def fnull(*args) -> None: ... + +debugging: int +traceenter = fnull +tracev = fnull +traceenter = trace +tracev = trace + +class OutputReflector: + writefunc: Incomplete + file: Incomplete + def __init__(self, file, writefunc) -> None: ... + def __getattr__(self, name: str): ... + def write(self, message) -> None: ... + +g_adb: Incomplete + +def OnSetBreakPoint(codeContext, breakPointState, lineNo) -> None: ... + +class Adb(bdb.Bdb, gateways.RemoteDebugApplicationEvents): + debugApplication: Incomplete + debuggingThread: Incomplete + debuggingThreadStateHandle: Incomplete + stackSnifferCookie: Incomplete + codeContainerProvider: Incomplete + breakFlags: Incomplete + breakReason: Incomplete + appDebugger: Incomplete + appEventConnection: Incomplete + logicalbotframe: Incomplete + currentframe: Incomplete + recursiveData: Incomplete + def canonic(self, fname): ... + def reset(self) -> None: ... + def stop_here(self, frame): ... + def break_here(self, frame): ... + def break_anywhere(self, frame): ... + def dispatch_return(self, frame, arg): ... + def dispatch_line(self, frame): ... + def dispatch_call(self, frame, arg): ... + def trace_dispatch(self, frame, event, arg): ... + def user_line(self, frame) -> None: ... + def user_return(self, frame, return_value) -> None: ... + def user_exception(self, frame, exc_info) -> None: ... + def set_trace(self) -> None: ... # type: ignore[override] + def CloseApp(self) -> None: ... + stackSniffer: Incomplete + def AttachApp(self, debugApplication, codeContainerProvider) -> None: ... + def ResetAXDebugging(self) -> None: ... + botframe: Incomplete + stopframe: Incomplete + def SetupAXDebugging(self, baseFrame: Incomplete | None = ..., userFrame: Incomplete | None = ...) -> None: ... + def OnConnectDebugger(self, appDebugger): ... + def OnDisconnectDebugger(self) -> None: ... + def OnSetName(self, name) -> None: ... + def OnDebugOutput(self, string) -> None: ... + def OnClose(self) -> None: ... + def OnEnterBreakPoint(self, rdat) -> None: ... + def OnLeaveBreakPoint(self, rdat) -> None: ... + def OnCreateThread(self, rdat) -> None: ... + def OnDestroyThread(self, rdat) -> None: ... + def OnBreakFlagChange(self, abf, rdat) -> None: ... + +def Debugger(): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axdebug/axdebug.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axdebug/axdebug.pyi new file mode 100644 index 000000000..2ecd3063a --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axdebug/axdebug.pyi @@ -0,0 +1,124 @@ +# Can't generate with stubgen because: +# "ImportError: DLL load failed while importing axdebug: The specified module could not be found." +# https://github.com/python/mypy/issues/13822 +import _win32typing + +APPBREAKFLAG_DEBUGGER_BLOCK: int +APPBREAKFLAG_DEBUGGER_HALT: int +APPBREAKFLAG_STEP: int +BREAKPOINT_DELETED: int +BREAKPOINT_DISABLED: int +BREAKPOINT_ENABLED: int +BREAKREASON_BREAKPOINT: int +BREAKREASON_DEBUGGER_BLOCK: int +BREAKREASON_DEBUGGER_HALT: int +BREAKREASON_ERROR: int +BREAKREASON_HOST_INITIATED: int +BREAKREASON_LANGUAGE_INITIATED: int +BREAKREASON_STEP: int +BREAKRESUMEACTION_ABORT: int +BREAKRESUMEACTION_CONTINUE: int +BREAKRESUMEACTION_STEP_INTO: int +BREAKRESUMEACTION_STEP_OUT: int +BREAKRESUMEACTION_STEP_OVER: int +CLSID_DefaultDebugSessionProvider: int +CLSID_MachineDebugManager: int +CLSID_ProcessDebugManager: int +DBGPROP_ATTRIB_ACCESS_FINAL: int +DBGPROP_ATTRIB_ACCESS_PRIVATE: int +DBGPROP_ATTRIB_ACCESS_PROTECTED: int +DBGPROP_ATTRIB_ACCESS_PUBLIC: int +DBGPROP_ATTRIB_HAS_EXTENDED_ATTRIBS: int +DBGPROP_ATTRIB_NO_ATTRIB: int +DBGPROP_ATTRIB_STORAGE_FIELD: int +DBGPROP_ATTRIB_STORAGE_GLOBAL: int +DBGPROP_ATTRIB_STORAGE_STATIC: int +DBGPROP_ATTRIB_STORAGE_VIRTUAL: int +DBGPROP_ATTRIB_TYPE_IS_CONSTANT: int +DBGPROP_ATTRIB_TYPE_IS_SYNCHRONIZED: int +DBGPROP_ATTRIB_TYPE_IS_VOLATILE: int +DBGPROP_ATTRIB_VALUE_IS_EXPANDABLE: int +DBGPROP_ATTRIB_VALUE_IS_INVALID: int +DBGPROP_ATTRIB_VALUE_READONLY: int +DBGPROP_INFO_ATTRIBUTES: int +DBGPROP_INFO_AUTOEXPAND: int +DBGPROP_INFO_DEBUGPROP: int +DBGPROP_INFO_FULLNAME: int +DBGPROP_INFO_NAME: int +DBGPROP_INFO_TYPE: int +DBGPROP_INFO_VALUE: int +DEBUG_TEXT_ALLOWBREAKPOINTS: int +DEBUG_TEXT_ISEXPRESSION: int +DOCUMENTNAMETYPE_APPNODE: int +DOCUMENTNAMETYPE_FILE_TAIL: int +DOCUMENTNAMETYPE_TITLE: int +DOCUMENTNAMETYPE_URL: int +ERRORRESUMEACTION_AbortCallAndReturnErrorToCaller: int +ERRORRESUMEACTION_ReexecuteErrorStatement: int +ERRORRESUMEACTION_SkipErrorStatement: int +EX_DBGPROP_INFO_DEBUGEXTPROP: int +EX_DBGPROP_INFO_ID: int +EX_DBGPROP_INFO_LOCKBYTES: int +EX_DBGPROP_INFO_NTYPE: int +EX_DBGPROP_INFO_NVALUE: int +SOURCETEXT_ATTR_COMMENT: int +SOURCETEXT_ATTR_FUNCTION_START: int +SOURCETEXT_ATTR_KEYWORD: int +SOURCETEXT_ATTR_NONSOURCE: int +SOURCETEXT_ATTR_NUMBER: int +SOURCETEXT_ATTR_OPERATOR: int +SOURCETEXT_ATTR_STRING: int +TEXT_DOC_ATTR_READONLY: int +APPBREAKFLAG_IN_BREAKPOINT: int +APPBREAKFLAG_STEPTYPE_BYTECODE: int +APPBREAKFLAG_STEPTYPE_MACHINE: int +APPBREAKFLAG_STEPTYPE_MASK: int +APPBREAKFLAG_STEPTYPE_SOURCE: int + +def GetStackAddress(*args, **kwargs): ... # incomplete +def GetThreadStateHandle(*args, **kwargs): ... # incomplete + +IID_IActiveScriptDebug: _win32typing.PyIID +IID_IActiveScriptErrorDebug: _win32typing.PyIID +IID_IActiveScriptSiteDebug: _win32typing.PyIID +IID_IApplicationDebugger: _win32typing.PyIID +IID_IDebugApplication: _win32typing.PyIID +IID_IDebugApplicationNode: _win32typing.PyIID +IID_IDebugApplicationNodeEvents: _win32typing.PyIID +IID_IDebugApplicationThread: _win32typing.PyIID +IID_IDebugCodeContext: _win32typing.PyIID +IID_IDebugDocument: _win32typing.PyIID +IID_IDebugDocumentContext: _win32typing.PyIID +IID_IDebugDocumentHelper: _win32typing.PyIID +IID_IDebugDocumentHost: _win32typing.PyIID +IID_IDebugDocumentInfo: _win32typing.PyIID +IID_IDebugDocumentProvider: _win32typing.PyIID +IID_IDebugDocumentText: _win32typing.PyIID +IID_IDebugDocumentTextAuthor: _win32typing.PyIID +IID_IDebugDocumentTextEvents: _win32typing.PyIID +IID_IDebugDocumentTextExternalAuthor: _win32typing.PyIID +IID_IDebugExpression: _win32typing.PyIID +IID_IDebugExpressionCallBack: _win32typing.PyIID +IID_IDebugExpressionContext: _win32typing.PyIID +IID_IDebugProperty: _win32typing.PyIID +IID_IDebugSessionProvider: _win32typing.PyIID +IID_IDebugStackFrame: _win32typing.PyIID +IID_IDebugStackFrameSniffer: _win32typing.PyIID +IID_IDebugStackFrameSnifferEx: _win32typing.PyIID +IID_IDebugSyncOperation: _win32typing.PyIID +IID_IEnumDebugApplicationNodes: _win32typing.PyIID +IID_IEnumDebugCodeContexts: _win32typing.PyIID +IID_IEnumDebugExpressionContexts: _win32typing.PyIID +IID_IEnumDebugPropertyInfo: _win32typing.PyIID +IID_IEnumDebugStackFrames: _win32typing.PyIID +IID_IEnumRemoteDebugApplicationThreads: _win32typing.PyIID +IID_IEnumRemoteDebugApplications: _win32typing.PyIID +IID_IMachineDebugManager: _win32typing.PyIID +IID_IMachineDebugManagerEvents: _win32typing.PyIID +IID_IProcessDebugManager: _win32typing.PyIID +IID_IProvideExpressionContexts: _win32typing.PyIID +IID_IRemoteDebugApplication: _win32typing.PyIID +IID_IRemoteDebugApplicationEvents: _win32typing.PyIID +IID_IRemoteDebugApplicationThread: _win32typing.PyIID + +def SetThreadStateTrace(*args, **kwargs): ... # incomplete diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axdebug/codecontainer.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axdebug/codecontainer.pyi new file mode 100644 index 000000000..e42c470b2 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axdebug/codecontainer.pyi @@ -0,0 +1,43 @@ +from _typeshed import Incomplete + +from win32comext.axdebug import contexts as contexts +from win32comext.axdebug.util import RaiseNotImpl as RaiseNotImpl + +class SourceCodeContainer: + sourceContext: Incomplete + text: Incomplete + nextLineNo: int + fileName: Incomplete + codeContexts: Incomplete + site: Incomplete + startLineNumber: Incomplete + debugDocument: Incomplete + def __init__( + self, + text, + fileName: str = ..., + sourceContext: int = ..., + startLineNumber: int = ..., + site: Incomplete | None = ..., + debugDocument: Incomplete | None = ..., + ) -> None: ... + def GetText(self): ... + def GetName(self, dnt) -> None: ... + def GetFileName(self): ... + def GetPositionOfLine(self, cLineNumber): ... + def GetLineOfPosition(self, charPos): ... + def GetNextLine(self): ... + def GetLine(self, num): ... + def GetNumChars(self): ... + def GetNumLines(self): ... + lastPos: int + attrs: Incomplete + def GetSyntaxColorAttributes(self): ... + def GetCodeContextAtPosition(self, charPos): ... + +class SourceModuleContainer(SourceCodeContainer): + module: Incomplete + def __init__(self, module) -> None: ... + text: Incomplete + def GetText(self): ... + def GetName(self, dnt): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axdebug/contexts.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axdebug/contexts.pyi new file mode 100644 index 000000000..4561b453c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axdebug/contexts.pyi @@ -0,0 +1,19 @@ +from _typeshed import Incomplete + +from win32comext.axdebug import adb as adb, gateways +from win32comext.axdebug.util import trace as trace + +class DebugCodeContext(gateways.DebugCodeContext, gateways.DebugDocumentContext): + debugSite: Incomplete + offset: Incomplete + length: Incomplete + breakPointState: int + lineno: Incomplete + codeContainer: Incomplete + def __init__(self, lineNo, charPos, len, codeContainer, debugSite) -> None: ... + def GetDocumentContext(self): ... + def SetBreakPoint(self, bps) -> None: ... + def GetDocument(self): ... + def EnumCodeContexts(self): ... + +class EnumDebugCodeContexts(gateways.EnumDebugCodeContexts): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axdebug/debugger.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axdebug/debugger.pyi new file mode 100644 index 000000000..f8d294be9 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axdebug/debugger.pyi @@ -0,0 +1,58 @@ +from _typeshed import Incomplete + +from win32com.axdebug import contexts as contexts, documents, gateways as gateways +from win32com.axdebug.util import trace as trace +from win32com.axscript import axscript as axscript + +currentDebugger: Incomplete + +class ModuleTreeNode: + moduleName: Incomplete + module: Incomplete + realNode: Incomplete + cont: Incomplete + def __init__(self, module) -> None: ... + def Attach(self, parentRealNode) -> None: ... + def Close(self) -> None: ... + +def BuildModule(module, built_nodes, rootNode, create_node_fn, create_node_args) -> None: ... +def RefreshAllModules(builtItems, rootNode, create_node, create_node_args) -> None: ... + +class CodeContainerProvider(documents.CodeContainerProvider): + axdebugger: Incomplete + currentNumModules: Incomplete + nodes: Incomplete + def __init__(self, axdebugger) -> None: ... + def FromFileName(self, fname): ... + def Close(self) -> None: ... + +class OriginalInterfaceMaker: + cookie: Incomplete + def MakeInterfaces(self, pdm): ... + def CloseInterfaces(self, pdm) -> None: ... + +class SimpleHostStyleInterfaceMaker: + def MakeInterfaces(self, pdm): ... + def CloseInterfaces(self, pdm) -> None: ... + +class AXDebugger: + pydebugger: Incomplete + pdm: Incomplete + interfaceMaker: Incomplete + expressionCookie: Incomplete + def __init__(self, interfaceMaker: Incomplete | None = ..., processName: Incomplete | None = ...) -> None: ... + def Break(self) -> None: ... + app: Incomplete + root: Incomplete + def Close(self) -> None: ... + def RefreshAllModules(self, nodes, containerProvider) -> None: ... + def CreateApplicationNode(self, node, containerProvider): ... + +def Break() -> None: ... + +brk = Break +set_trace = Break + +def dosomethingelse() -> None: ... +def dosomething() -> None: ... +def test() -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axdebug/documents.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axdebug/documents.pyi new file mode 100644 index 000000000..7c1516b6a --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axdebug/documents.pyi @@ -0,0 +1,34 @@ +from _typeshed import Incomplete + +from win32com.server.exception import Exception as Exception +from win32comext.axdebug import codecontainer as codecontainer, contexts as contexts, gateways +from win32comext.axdebug.util import RaiseNotImpl as RaiseNotImpl, trace as trace + +def GetGoodFileName(fname): ... + +class DebugDocumentProvider(gateways.DebugDocumentProvider): + doc: Incomplete + def __init__(self, doc) -> None: ... + def GetName(self, dnt): ... + def GetDocumentClassId(self): ... + def GetDocument(self): ... + +# error: Cannot determine consistent method resolution order (MRO) for "DebugDocumentText" +# pyright doesn't have a specific error code for MRO error! +class DebugDocumentText(gateways.DebugDocumentInfo, gateways.DebugDocumentText, gateways.DebugDocument): # type: ignore[misc] # pyright: ignore + codeContainer: Incomplete + def __init__(self, codeContainer) -> None: ... + def GetName(self, dnt): ... + def GetDocumentClassId(self): ... + def GetSize(self): ... + def GetPositionOfLine(self, cLineNumber): ... + def GetLineOfPosition(self, charPos): ... + def GetText(self, charPos, maxChars, wantAttr): ... + def GetPositionOfContext(self, context): ... + def GetContextOfPosition(self, charPos, maxChars): ... + +class CodeContainerProvider: + ccsAndNodes: Incomplete + def AddCodeContainer(self, cc, node: Incomplete | None = ...) -> None: ... + def FromFileName(self, fname): ... + def Close(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axdebug/expressions.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axdebug/expressions.pyi new file mode 100644 index 000000000..fac92805b --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axdebug/expressions.pyi @@ -0,0 +1,69 @@ +from _typeshed import Incomplete + +from win32com.server.exception import COMException as COMException +from win32com.server.util import ListEnumeratorGateway +from win32comext.axdebug import gateways +from win32comext.axdebug.util import RaiseNotImpl as RaiseNotImpl + +def MakeNiceString(ob): ... + +class ProvideExpressionContexts(gateways.ProvideExpressionContexts): ... + +class ExpressionContext(gateways.DebugExpressionContext): + frame: Incomplete + def __init__(self, frame) -> None: ... + def ParseLanguageText(self, code, radix, delim, flags): ... + def GetLanguageInfo(self): ... + +class Expression(gateways.DebugExpression): + callback: Incomplete + frame: Incomplete + code: Incomplete + radix: Incomplete + delim: Incomplete + flags: Incomplete + isComplete: int + result: Incomplete + hresult: Incomplete + def __init__(self, frame, code, radix, delim, flags) -> None: ... + def Start(self, callback): ... + def Abort(self) -> None: ... + def QueryIsComplete(self): ... + def GetResultAsString(self): ... + def GetResultAsDebugProperty(self): ... + +def MakeEnumDebugProperty(object, dwFieldSpec, nRadix, iid, stackFrame: Incomplete | None = ...): ... +def GetPropertyInfo( + obname, + obvalue, + dwFieldSpec, + nRadix, + hresult: int = ..., + dictionary: Incomplete | None = ..., + stackFrame: Incomplete | None = ..., +): ... + +class EnumDebugPropertyInfo(ListEnumeratorGateway): + def GetCount(self): ... + +class DebugProperty: + name: Incomplete + value: Incomplete + parent: Incomplete + hresult: Incomplete + dictionary: Incomplete + stackFrame: Incomplete + def __init__( + self, + name, + value, + parent: Incomplete | None = ..., + hresult: int = ..., + dictionary: Incomplete | None = ..., + stackFrame: Incomplete | None = ..., + ) -> None: ... + def GetPropertyInfo(self, dwFieldSpec, nRadix): ... + def GetExtendedInfo(self) -> None: ... + def SetValueAsString(self, value, radix) -> None: ... + def EnumMembers(self, dwFieldSpec, nRadix, iid): ... + def GetParent(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axdebug/gateways.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axdebug/gateways.pyi new file mode 100644 index 000000000..8ed3bb316 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axdebug/gateways.pyi @@ -0,0 +1,114 @@ +from _typeshed import Incomplete + +from win32com.server.util import ListEnumeratorGateway + +class EnumDebugCodeContexts(ListEnumeratorGateway): ... +class EnumDebugStackFrames(ListEnumeratorGateway): ... +class EnumDebugApplicationNodes(ListEnumeratorGateway): ... +class EnumRemoteDebugApplications(ListEnumeratorGateway): ... +class EnumRemoteDebugApplicationThreads(ListEnumeratorGateway): ... + +class DebugDocumentInfo: + def GetName(self, dnt) -> None: ... + def GetDocumentClassId(self) -> None: ... + +class DebugDocumentProvider(DebugDocumentInfo): + def GetDocument(self) -> None: ... + +class DebugApplicationNode(DebugDocumentProvider): + def EnumChildren(self) -> None: ... + def GetParent(self) -> None: ... + def SetDocumentProvider(self, pddp) -> None: ... + def Close(self) -> None: ... + def Attach(self, parent) -> None: ... + def Detach(self) -> None: ... + +class DebugApplicationNodeEvents: + def onAddChild(self, child) -> None: ... + def onRemoveChild(self, child) -> None: ... + def onDetach(self) -> None: ... + def onAttach(self, parent) -> None: ... + +class DebugDocument(DebugDocumentInfo): ... + +class DebugDocumentText(DebugDocument): + def GetDocumentAttributes(self) -> None: ... + def GetSize(self) -> None: ... + def GetPositionOfLine(self, cLineNumber) -> None: ... + def GetLineOfPosition(self, charPos) -> None: ... + def GetText(self, charPos, maxChars, wantAttr) -> None: ... + def GetPositionOfContext(self, debugDocumentContext) -> None: ... + def GetContextOfPosition(self, charPos, maxChars) -> None: ... + +class DebugDocumentTextExternalAuthor: + def GetPathName(self) -> None: ... + def GetFileName(self) -> None: ... + def NotifyChanged(self) -> None: ... + +class DebugDocumentTextEvents: + def onDestroy(self) -> None: ... + def onInsertText(self, cCharacterPosition, cNumToInsert) -> None: ... + def onRemoveText(self, cCharacterPosition, cNumToRemove) -> None: ... + def onReplaceText(self, cCharacterPosition, cNumToReplace) -> None: ... + def onUpdateTextAttributes(self, cCharacterPosition, cNumToUpdate) -> None: ... + def onUpdateDocumentAttributes(self, textdocattr) -> None: ... + +class DebugDocumentContext: + def GetDocument(self) -> None: ... + def EnumCodeContexts(self) -> None: ... + +class DebugCodeContext: + def GetDocumentContext(self) -> None: ... + def SetBreakPoint(self, bps) -> None: ... + +class DebugStackFrame: + def GetCodeContext(self) -> None: ... + def GetDescriptionString(self, fLong) -> None: ... + def GetLanguageString(self) -> None: ... + def GetThread(self) -> None: ... + def GetDebugProperty(self) -> None: ... + +class DebugDocumentHost: + def GetDeferredText(self, dwTextStartCookie, maxChars, bWantAttr) -> None: ... + def GetScriptTextAttributes(self, codeText, delimterText, flags) -> None: ... + def OnCreateDocumentContext(self) -> None: ... + def GetPathName(self) -> None: ... + def GetFileName(self) -> None: ... + def NotifyChanged(self) -> None: ... + +class DebugDocumentTextConnectServer: + cookieNo: int + connections: Incomplete + def EnumConnections(self) -> None: ... + def GetConnectionInterface(self) -> None: ... + def GetConnectionPointContainer(self): ... + def Advise(self, pUnk): ... + def Unadvise(self, cookie): ... + def EnumConnectionPoints(self) -> None: ... + def FindConnectionPoint(self, iid): ... + +class RemoteDebugApplicationEvents: + def OnConnectDebugger(self, appDebugger) -> None: ... + def OnDisconnectDebugger(self) -> None: ... + def OnSetName(self, name) -> None: ... + def OnDebugOutput(self, string) -> None: ... + def OnClose(self) -> None: ... + def OnEnterBreakPoint(self, rdat) -> None: ... + def OnLeaveBreakPoint(self, rdat) -> None: ... + def OnCreateThread(self, rdat) -> None: ... + def OnDestroyThread(self, rdat) -> None: ... + def OnBreakFlagChange(self, abf, rdat) -> None: ... + +class DebugExpressionContext: + def ParseLanguageText(self, code, radix, delim, flags) -> None: ... + def GetLanguageInfo(self) -> None: ... + +class DebugExpression: + def Start(self, callback) -> None: ... + def Abort(self) -> None: ... + def QueryIsComplete(self) -> None: ... + def GetResultAsString(self) -> None: ... + def GetResultAsDebugProperty(self) -> None: ... + +class ProvideExpressionContexts: + def EnumExpressionContexts(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axdebug/stackframe.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axdebug/stackframe.pyi new file mode 100644 index 000000000..63832412b --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axdebug/stackframe.pyi @@ -0,0 +1,35 @@ +from _typeshed import Incomplete + +from win32com.server.exception import COMException as COMException +from win32comext.axdebug import gateways +from win32comext.axdebug.util import RaiseNotImpl as RaiseNotImpl, trace as trace + +class EnumDebugStackFrames(gateways.EnumDebugStackFrames): + def __init__(self, debugger) -> None: ... + def Next(self, count): ... + +class DebugStackFrame(gateways.DebugStackFrame): + frame: Incomplete + lineno: Incomplete + codeContainer: Incomplete + expressionContext: Incomplete + def __init__(self, frame, lineno, codeContainer) -> None: ... + def GetThread(self) -> None: ... + def GetCodeContext(self): ... + def GetDescriptionString(self, fLong): ... + def GetLanguageString(self, fLong): ... + def GetDebugProperty(self): ... + +class DebugStackFrameSniffer: + debugger: Incomplete + def __init__(self, debugger) -> None: ... + def EnumStackFrames(self): ... + +class StackFrameDebugProperty: + frame: Incomplete + def __init__(self, frame) -> None: ... + def GetPropertyInfo(self, dwFieldSpec, nRadix) -> None: ... + def GetExtendedInfo(self) -> None: ... + def SetValueAsString(self, value, radix) -> None: ... + def EnumMembers(self, dwFieldSpec, nRadix, iid): ... + def GetParent(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axdebug/util.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axdebug/util.pyi new file mode 100644 index 000000000..5ec04b350 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axdebug/util.pyi @@ -0,0 +1,14 @@ +from _typeshed import Incomplete + +import win32com.server.policy + +debugging: int + +def trace(*args) -> None: ... + +all_wrapped: Incomplete + +def RaiseNotImpl(who: Incomplete | None = ...) -> None: ... + +class Dispatcher(win32com.server.policy.DispatcherWin32trace): + def __init__(self, policyClass, object) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axscript/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axscript/__init__.pyi new file mode 100644 index 000000000..e69de29bb diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axscript/asputil.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axscript/asputil.pyi new file mode 100644 index 000000000..37227df96 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axscript/asputil.pyi @@ -0,0 +1 @@ +def iif(cond, t, f): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axscript/axscript.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axscript/axscript.pyi new file mode 100644 index 000000000..8914786fa --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axscript/axscript.pyi @@ -0,0 +1,52 @@ +import _win32typing + +CATID_ActiveScript: _win32typing.PyIID +CATID_ActiveScriptParse: _win32typing.PyIID +IID_IActiveScript: _win32typing.PyIID +IID_IActiveScriptError: _win32typing.PyIID +IID_IActiveScriptParse: _win32typing.PyIID +IID_IActiveScriptParseProcedure: _win32typing.PyIID +IID_IActiveScriptSite: _win32typing.PyIID +IID_IObjectSafety: _win32typing.PyIID +IID_IProvideMultipleClassInfo: _win32typing.PyIID +INTERFACESAFE_FOR_UNTRUSTED_CALLER: int +INTERFACESAFE_FOR_UNTRUSTED_DATA: int +INTERFACE_USES_DISPEX: int +INTERFACE_USES_SECURITY_MANAGER: int +MULTICLASSINFO_GETIIDPRIMARY: int +MULTICLASSINFO_GETIIDSOURCE: int +MULTICLASSINFO_GETNUMRESERVEDDISPIDS: int +MULTICLASSINFO_GETTYPEINFO: int +SCRIPTINFO_ALL_FLAGS: int +SCRIPTINFO_ITYPEINFO: int +SCRIPTINFO_IUNKNOWN: int +SCRIPTINTERRUPT_ALL_FLAGS: int +SCRIPTINTERRUPT_DEBUG: int +SCRIPTINTERRUPT_RAISEEXCEPTION: int +SCRIPTITEM_ALL_FLAGS: int +SCRIPTITEM_CODEONLY: int +SCRIPTITEM_GLOBALMEMBERS: int +SCRIPTITEM_ISPERSISTENT: int +SCRIPTITEM_ISSOURCE: int +SCRIPTITEM_ISVISIBLE: int +SCRIPTITEM_NOCODE: int +SCRIPTPROC_ALL_FLAGS: int +SCRIPTPROC_HOSTMANAGESSOURCE: int +SCRIPTPROC_IMPLICIT_PARENTS: int +SCRIPTPROC_IMPLICIT_THIS: int +SCRIPTSTATE_CLOSED: int +SCRIPTSTATE_CONNECTED: int +SCRIPTSTATE_DISCONNECTED: int +SCRIPTSTATE_INITIALIZED: int +SCRIPTSTATE_STARTED: int +SCRIPTSTATE_UNINITIALIZED: int +SCRIPTTEXT_ALL_FLAGS: int +SCRIPTTEXT_ISEXPRESSION: int +SCRIPTTEXT_ISPERSISTENT: int +SCRIPTTEXT_ISVISIBLE: int +SCRIPTTHREADSTATE_NOTINSCRIPT: int +SCRIPTTHREADSTATE_RUNNING: int +SCRIPTTYPELIB_ISCONTROL: int +SCRIPTTYPELIB_ISPERSISTENT: int +SCRIPT_E_REPORTED: int +TIFLAGS_EXTENDDISPATCHONLY: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axscript/client/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axscript/client/__init__.pyi new file mode 100644 index 000000000..e69de29bb diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axscript/client/error.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axscript/client/error.pyi new file mode 100644 index 000000000..24ce7a521 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axscript/client/error.pyi @@ -0,0 +1,21 @@ +from win32com.server.exception import COMException + +debugging: int + +def FormatForAX(text): ... +def ExpandTabs(text): ... +def AddCR(text): ... + +class IActiveScriptError: + def GetSourceLineText(self): ... + def GetSourcePosition(self): ... + def GetExceptionInfo(self): ... + +class AXScriptException(COMException): + sourceContext: int + startLineNo: int + linetext: str + def __init__(self, site, codeBlock, exc_type, exc_value, exc_traceback) -> None: ... + def ExtractTracebackInfo(self, tb, site): ... + +def ProcessAXScriptException(scriptingSite, debugManager, exceptionInstance): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axscript/client/pyscript.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axscript/client/pyscript.pyi new file mode 100644 index 000000000..548e95fe2 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axscript/client/pyscript.pyi @@ -0,0 +1,3 @@ +# Necessary for mypy to not fail with: +# 'error: Cannot find implementation or library stub for module named "win32comext.axscript.client.pyscript"' +# in: .gateways, .stackframe, .expressions, .adb, .contexts, .codecontainer, .documents, .debugger diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axscript/server/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axscript/server/__init__.pyi new file mode 100644 index 000000000..e69de29bb diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axscript/server/axsite.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axscript/server/axsite.pyi new file mode 100644 index 000000000..aa77ad51b --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axscript/server/axsite.pyi @@ -0,0 +1,32 @@ +from _typeshed import Incomplete + +class AXEngine: + eScript: Incomplete + eParse: Incomplete + eSafety: Incomplete + def __init__(self, site, engine) -> None: ... + def __del__(self) -> None: ... + def GetScriptDispatch(self, name: Incomplete | None = ...): ... + def AddNamedItem(self, item, flags): ... + def AddCode(self, code, flags: int = ...) -> None: ... + def EvalCode(self, code): ... + def Start(self) -> None: ... + def Close(self) -> None: ... + def SetScriptState(self, state) -> None: ... + +IActiveScriptSite_methods: Incomplete + +class AXSite: + lcid: Incomplete + objModel: Incomplete + engine: Incomplete + def __init__(self, objModel=..., engine: Incomplete | None = ..., lcid: int = ...) -> None: ... + def AddEngine(self, engine): ... + def GetLCID(self): ... + def GetItemInfo(self, name, returnMask): ... + def GetDocVersionString(self): ... + def OnScriptTerminate(self, result, excepInfo) -> None: ... + def OnStateChange(self, state) -> None: ... + def OnScriptError(self, errorInterface): ... + def OnEnterScript(self) -> None: ... + def OnLeaveScript(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axscript/server/error.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axscript/server/error.pyi new file mode 100644 index 000000000..deb38c3cf --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axscript/server/error.pyi @@ -0,0 +1,6 @@ +from _typeshed import Incomplete + +class Exception: + activeScriptError: Incomplete + def __init__(self, activeScriptError) -> None: ... + def __getattr__(self, attr: str): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/bits/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/bits/__init__.pyi new file mode 100644 index 000000000..e69de29bb diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/bits/bits.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/bits/bits.pyi new file mode 100644 index 000000000..8bc0c0563 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/bits/bits.pyi @@ -0,0 +1,61 @@ +import _win32typing + +BG_AUTH_SCHEME_BASIC: int +BG_AUTH_SCHEME_DIGEST: int +BG_AUTH_SCHEME_NEGOTIATE: int +BG_AUTH_SCHEME_NTLM: int +BG_AUTH_SCHEME_PASSPORT: int +BG_AUTH_TARGET_PROXY: int +BG_AUTH_TARGET_SERVER: int +BG_CERT_STORE_LOCATION_CURRENT_SERVICE: int +BG_CERT_STORE_LOCATION_CURRENT_USER: int +BG_CERT_STORE_LOCATION_CURRENT_USER_GROUP_POLICY: int +BG_CERT_STORE_LOCATION_LOCAL_MACHINE: int +BG_CERT_STORE_LOCATION_LOCAL_MACHINE_ENTERPRISE: int +BG_CERT_STORE_LOCATION_LOCAL_MACHINE_GROUP_POLICY: int +BG_CERT_STORE_LOCATION_SERVICES: int +BG_CERT_STORE_LOCATION_USERS: int +BG_ERROR_CONTEXT_GENERAL_QUEUE_MANAGER: int +BG_ERROR_CONTEXT_GENERAL_TRANSPORT: int +BG_ERROR_CONTEXT_LOCAL_FILE: int +BG_ERROR_CONTEXT_NONE: int +BG_ERROR_CONTEXT_QUEUE_MANAGER_NOTIFICATION: int +BG_ERROR_CONTEXT_REMOTE_APPLICATION: int +BG_ERROR_CONTEXT_REMOTE_FILE: int +BG_ERROR_CONTEXT_UNKNOWN: int +BG_JOB_ENUM_ALL_USERS: int +BG_JOB_PRIORITY_FOREGROUND: int +BG_JOB_PRIORITY_HIGH: int +BG_JOB_PRIORITY_LOW: int +BG_JOB_PRIORITY_NORMAL: int +BG_JOB_PROXY_USAGE_AUTODETECT: int +BG_JOB_PROXY_USAGE_NO_PROXY: int +BG_JOB_PROXY_USAGE_OVERRIDE: int +BG_JOB_PROXY_USAGE_PRECONFIG: int +BG_JOB_STATE_ACKNOWLEDGED: int +BG_JOB_STATE_CANCELLED: int +BG_JOB_STATE_CONNECTING: int +BG_JOB_STATE_ERROR: int +BG_JOB_STATE_QUEUED: int +BG_JOB_STATE_SUSPENDED: int +BG_JOB_STATE_TRANSFERRED: int +BG_JOB_STATE_TRANSFERRING: int +BG_JOB_STATE_TRANSIENT_ERROR: int +BG_JOB_TYPE_DOWNLOAD: int +BG_JOB_TYPE_UPLOAD: int +BG_JOB_TYPE_UPLOAD_REPLY: int +BG_NOTIFY_DISABLE: int +BG_NOTIFY_JOB_ERROR: int +BG_NOTIFY_JOB_MODIFICATION: int +BG_NOTIFY_JOB_TRANSFERRED: int +CLSID_BackgroundCopyManager: _win32typing.PyIID +IID_IBackgroundCopyCallback: _win32typing.PyIID +IID_IBackgroundCopyError: _win32typing.PyIID +IID_IBackgroundCopyFile: _win32typing.PyIID +IID_IBackgroundCopyFile2: _win32typing.PyIID +IID_IBackgroundCopyJob: _win32typing.PyIID +IID_IBackgroundCopyJob2: _win32typing.PyIID +IID_IBackgroundCopyJob3: _win32typing.PyIID +IID_IBackgroundCopyManager: _win32typing.PyIID +IID_IEnumBackgroundCopyFiles: _win32typing.PyIID +IID_IEnumBackgroundCopyJobs: _win32typing.PyIID diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/directsound/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/directsound/__init__.pyi new file mode 100644 index 000000000..e69de29bb diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/directsound/directsound.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/directsound/directsound.pyi new file mode 100644 index 000000000..3fee30636 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/directsound/directsound.pyi @@ -0,0 +1,114 @@ +from _typeshed import Incomplete + +import _win32typing + +def DirectSoundCreate(guid: _win32typing.PyIID | None = ..., unk: Incomplete | None = ...) -> _win32typing.PyIUnknown: ... +def DirectSoundEnumerate(): ... +def DirectSoundCaptureCreate(guid: _win32typing.PyIID | None = ..., unk: Incomplete | None = ...) -> _win32typing.PyIUnknown: ... +def DirectSoundCaptureEnumerate(): ... +def DSCAPS() -> _win32typing.PyDSCAPS: ... +def DSBCAPS() -> _win32typing.PyDSBCAPS: ... +def DSCCAPS() -> _win32typing.PyDSCCAPS: ... +def DSCBCAPS() -> _win32typing.PyDSCBCAPS: ... +def DSBUFFERDESC() -> _win32typing.PyDSBUFFERDESC: ... +def DSCBUFFERDESC() -> _win32typing.PyDSCBUFFERDESC: ... + +DS3DMODE_DISABLE: int +DS3DMODE_HEADRELATIVE: int +DS3DMODE_NORMAL: int +DSBCAPS_CTRL3D: int +DSBCAPS_CTRLFREQUENCY: int +DSBCAPS_CTRLPAN: int +DSBCAPS_CTRLPOSITIONNOTIFY: int +DSBCAPS_CTRLVOLUME: int +DSBCAPS_GETCURRENTPOSITION2: int +DSBCAPS_GLOBALFOCUS: int +DSBCAPS_LOCHARDWARE: int +DSBCAPS_LOCSOFTWARE: int +DSBCAPS_MUTE3DATMAXDISTANCE: int +DSBCAPS_PRIMARYBUFFER: int +DSBCAPS_STATIC: int +DSBCAPS_STICKYFOCUS: int +DSBLOCK_ENTIREBUFFER: int +DSBLOCK_FROMWRITECURSOR: int +DSBPLAY_LOOPING: int +DSBSTATUS_BUFFERLOST: int +DSBSTATUS_LOOPING: int +DSBSTATUS_PLAYING: int +DSCAPS_CERTIFIED: int +DSCAPS_CONTINUOUSRATE: int +DSCAPS_EMULDRIVER: int +DSCAPS_PRIMARY16BIT: int +DSCAPS_PRIMARY8BIT: int +DSCAPS_PRIMARYMONO: int +DSCAPS_PRIMARYSTEREO: int +DSCAPS_SECONDARY16BIT: int +DSCAPS_SECONDARY8BIT: int +DSCAPS_SECONDARYMONO: int +DSCAPS_SECONDARYSTEREO: int +DSCBCAPS_WAVEMAPPED: int +DSCCAPS_EMULDRIVER: int +DSSCL_EXCLUSIVE: int +DSSCL_NORMAL: int +DSSCL_PRIORITY: int +DSSCL_WRITEPRIMARY: int +DSSPEAKER_GEOMETRY_MAX: int +DSSPEAKER_GEOMETRY_MIN: int +DSSPEAKER_GEOMETRY_NARROW: int +DSSPEAKER_GEOMETRY_WIDE: int +DSSPEAKER_HEADPHONE: int +DSSPEAKER_MONO: int +DSSPEAKER_QUAD: int +DSSPEAKER_STEREO: int +DSSPEAKER_SURROUND: int +DSBCAPSType = _win32typing.PyDSBCAPS +DSBFREQUENCY_MAX: int +DSBFREQUENCY_MIN: int +DSBFREQUENCY_ORIGINAL: int +DSBPAN_CENTER: int +DSBPAN_LEFT: int +DSBPAN_RIGHT: int +DSBPN_OFFSETSTOP: int +DSBSIZE_MAX: int +DSBSIZE_MIN: int +DSBUFFERDESCType = _win32typing.PyDSBUFFERDESC +DSBVOLUME_MAX: int +DSBVOLUME_MIN: int +DSCAPSType = _win32typing.PyDSCAPSType +DSCBCAPSType = _win32typing.PyDSCBCAPSType +DSCBLOCK_ENTIREBUFFER: int +DSCBSTART_LOOPING: int +DSCBSTATUS_CAPTURING: int +DSCBSTATUS_LOOPING: int +DSCBUFFERDESCType = _win32typing.PyDSCBUFFERDESC +DSCCAPSType = _win32typing.PyDSCCAPSType +DSERR_ACCESSDENIED: int +DSERR_ALLOCATED: int +DSERR_ALREADYINITIALIZED: int +DSERR_BADFORMAT: int +DSERR_BADSENDBUFFERGUID: int +DSERR_BUFFERLOST: int +DSERR_BUFFERTOOSMALL: int +DSERR_CONTROLUNAVAIL: int +DSERR_DS8_REQUIRED: int +DSERR_FXUNAVAILABLE: int +DSERR_GENERIC: int +DSERR_INVALIDCALL: int +DSERR_INVALIDPARAM: int +DSERR_NOAGGREGATION: int +DSERR_NODRIVER: int +DSERR_NOINTERFACE: int +DSERR_OBJECTNOTFOUND: int +DSERR_OTHERAPPHASPRIO: int +DSERR_OUTOFMEMORY: int +DSERR_PRIOLEVELNEEDED: int +DSERR_SENDLOOP: int +DSERR_UNINITIALIZED: int +DSERR_UNSUPPORTED: int +DS_NO_VIRTUALIZATION: int +DS_OK: int +IID_IDirectSound: _win32typing.PyIID +IID_IDirectSoundBuffer: _win32typing.PyIID +IID_IDirectSoundCapture: _win32typing.PyIID +IID_IDirectSoundCaptureBuffer: _win32typing.PyIID +IID_IDirectSoundNotify: _win32typing.PyIID diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/ifilter/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/ifilter/__init__.pyi new file mode 100644 index 000000000..e69de29bb diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/ifilter/ifilter.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/ifilter/ifilter.pyi new file mode 100644 index 000000000..9d7a52077 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/ifilter/ifilter.pyi @@ -0,0 +1,33 @@ +import _win32typing + +def BindIFilterFromStorage(*args, **kwargs): ... # incomplete +def BindIFilterFromStream(*args, **kwargs): ... # incomplete +def LoadIFilter(*args, **kwargs): ... # incomplete + +CHUNK_EOC: int +CHUNK_EOP: int +CHUNK_EOS: int +CHUNK_EOW: int +CHUNK_NO_BREAK: int +CHUNK_TEXT: int +CHUNK_VALUE: int +FILTER_E_ACCESS: int +FILTER_E_EMBEDDING_UNAVAILABLE: int +FILTER_E_END_OF_CHUNKS: int +FILTER_E_LINK_UNAVAILABLE: int +FILTER_E_NO_MORE_TEXT: int +FILTER_E_NO_MORE_VALUES: int +FILTER_E_NO_TEXT: int +FILTER_E_NO_VALUES: int +FILTER_E_PASSWORD: int +FILTER_S_LAST_TEXT: int +IFILTER_FLAGS_OLE_PROPERTIES: int +IFILTER_INIT_APPLY_INDEX_ATTRIBUTES: int +IFILTER_INIT_APPLY_OTHER_ATTRIBUTES: int +IFILTER_INIT_CANON_HYPHENS: int +IFILTER_INIT_CANON_PARAGRAPHS: int +IFILTER_INIT_CANON_SPACES: int +IFILTER_INIT_HARD_LINE_BREAKS: int +IFILTER_INIT_INDEXING_ONLY: int +IFILTER_INIT_SEARCH_LINKS: int +IID_IFilter: _win32typing.PyIID diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/ifilter/ifiltercon.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/ifilter/ifiltercon.pyi new file mode 100644 index 000000000..2b6623498 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/ifilter/ifiltercon.pyi @@ -0,0 +1,103 @@ +from _typeshed import Incomplete + +PSGUID_STORAGE: Incomplete +PSGUID_SUMMARYINFORMATION: Incomplete +PSGUID_HTMLINFORMATION: Incomplete +PSGUID_HTML2_INFORMATION: Incomplete +IFILTER_INIT_CANON_PARAGRAPHS: int +IFILTER_INIT_HARD_LINE_BREAKS: int +IFILTER_INIT_CANON_HYPHENS: int +IFILTER_INIT_CANON_SPACES: int +IFILTER_INIT_APPLY_INDEX_ATTRIBUTES: int +IFILTER_INIT_APPLY_CRAWL_ATTRIBUTES: int +IFILTER_INIT_APPLY_OTHER_ATTRIBUTES: int +IFILTER_INIT_INDEXING_ONLY: int +IFILTER_INIT_SEARCH_LINKS: int +IFILTER_INIT_FILTER_OWNED_VALUE_OK: int +IFILTER_FLAGS_OLE_PROPERTIES: int +CHUNK_TEXT: int +CHUNK_VALUE: int +CHUNK_NO_BREAK: int +CHUNK_EOW: int +CHUNK_EOS: int +CHUNK_EOP: int +CHUNK_EOC: int +NOT_AN_ERROR: int +FILTER_E_END_OF_CHUNKS: int +FILTER_E_NO_MORE_TEXT: int +FILTER_E_NO_MORE_VALUES: int +FILTER_E_ACCESS: int +FILTER_W_MONIKER_CLIPPED: int +FILTER_E_NO_TEXT: int +FILTER_E_NO_VALUES: int +FILTER_E_EMBEDDING_UNAVAILABLE: int +FILTER_E_LINK_UNAVAILABLE: int +FILTER_S_LAST_TEXT: int +FILTER_S_LAST_VALUES: int +FILTER_E_PASSWORD: int +FILTER_E_UNKNOWNFORMAT: int +PROPSETFLAG_DEFAULT: int +PROPSETFLAG_NONSIMPLE: int +PROPSETFLAG_ANSI: int +PROPSETFLAG_UNBUFFERED: int +PROPSETFLAG_CASE_SENSITIVE: int +PROPSET_BEHAVIOR_CASE_SENSITIVE: int +PID_DICTIONARY: int +PID_CODEPAGE: int +PID_FIRST_USABLE: int +PID_FIRST_NAME_DEFAULT: int +PID_LOCALE: int +PID_MODIFY_TIME: int +PID_SECURITY: int +PID_BEHAVIOR: int +PID_ILLEGAL: int +PID_MIN_READONLY: int +PID_MAX_READONLY: int +PIDDI_THUMBNAIL: int +PIDSI_TITLE: int +PIDSI_SUBJECT: int +PIDSI_AUTHOR: int +PIDSI_KEYWORDS: int +PIDSI_COMMENTS: int +PIDSI_TEMPLATE: int +PIDSI_LASTAUTHOR: int +PIDSI_REVNUMBER: int +PIDSI_EDITTIME: int +PIDSI_LASTPRINTED: int +PIDSI_CREATE_DTM: int +PIDSI_LASTSAVE_DTM: int +PIDSI_PAGECOUNT: int +PIDSI_WORDCOUNT: int +PIDSI_CHARCOUNT: int +PIDSI_THUMBNAIL: int +PIDSI_APPNAME: int +PIDSI_DOC_SECURITY: int +PIDDSI_CATEGORY: int +PIDDSI_PRESFORMAT: int +PIDDSI_BYTECOUNT: int +PIDDSI_LINECOUNT: int +PIDDSI_PARCOUNT: int +PIDDSI_SLIDECOUNT: int +PIDDSI_NOTECOUNT: int +PIDDSI_HIDDENCOUNT: int +PIDDSI_MMCLIPCOUNT: int +PIDDSI_SCALE: int +PIDDSI_HEADINGPAIR: int +PIDDSI_DOCPARTS: int +PIDDSI_MANAGER: int +PIDDSI_COMPANY: int +PIDDSI_LINKSDIRTY: int +PIDMSI_EDITOR: int +PIDMSI_SUPPLIER: int +PIDMSI_SOURCE: int +PIDMSI_SEQUENCE_NO: int +PIDMSI_PROJECT: int +PIDMSI_STATUS: int +PIDMSI_OWNER: int +PIDMSI_RATING: int +PIDMSI_PRODUCTION: int +PIDMSI_COPYRIGHT: int +PRSPEC_INVALID: int +PRSPEC_LPWSTR: int +PRSPEC_PROPID: int +CCH_MAX_PROPSTG_NAME: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/internet/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/internet/__init__.pyi new file mode 100644 index 000000000..e69de29bb diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/internet/inetcon.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/internet/inetcon.pyi new file mode 100644 index 000000000..7a90c6357 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/internet/inetcon.pyi @@ -0,0 +1,254 @@ +from _typeshed import Incomplete + +INET_E_USE_DEFAULT_PROTOCOLHANDLER: int +INET_E_USE_DEFAULT_SETTING: int +INET_E_DEFAULT_ACTION: int +INET_E_QUERYOPTION_UNKNOWN: int +INET_E_REDIRECTING: int +INET_E_INVALID_URL: int +INET_E_NO_SESSION: int +INET_E_CANNOT_CONNECT: int +INET_E_RESOURCE_NOT_FOUND: int +INET_E_OBJECT_NOT_FOUND: int +INET_E_DATA_NOT_AVAILABLE: int +INET_E_DOWNLOAD_FAILURE: int +INET_E_AUTHENTICATION_REQUIRED: int +INET_E_NO_VALID_MEDIA: int +INET_E_CONNECTION_TIMEOUT: int +INET_E_INVALID_REQUEST: int +INET_E_UNKNOWN_PROTOCOL: int +INET_E_SECURITY_PROBLEM: int +INET_E_CANNOT_LOAD_DATA: int +INET_E_CANNOT_INSTANTIATE_OBJECT: int +INET_E_INVALID_CERTIFICATE: int +INET_E_REDIRECT_FAILED: int +INET_E_REDIRECT_TO_DIR: int +INET_E_CANNOT_LOCK_REQUEST: int +INET_E_USE_EXTEND_BINDING: int +INET_E_TERMINATED_BIND: int +INET_E_CODE_DOWNLOAD_DECLINED: int +INET_E_RESULT_DISPATCHED: int +INET_E_CANNOT_REPLACE_SFP_FILE: int +INET_E_CODE_INSTALL_SUPPRESSED: int +INET_E_CODE_INSTALL_BLOCKED_BY_HASH_POLICY: int +MKSYS_URLMONIKER: int +URL_MK_LEGACY: int +URL_MK_UNIFORM: int +URL_MK_NO_CANONICALIZE: int +FIEF_FLAG_FORCE_JITUI: int +FIEF_FLAG_PEEK: int +FIEF_FLAG_SKIP_INSTALLED_VERSION_CHECK: int +FMFD_DEFAULT: int +FMFD_URLASFILENAME: int +FMFD_ENABLEMIMESNIFFING: int +FMFD_IGNOREMIMETEXTPLAIN: int +URLMON_OPTION_USERAGENT: int +URLMON_OPTION_USERAGENT_REFRESH: int +URLMON_OPTION_URL_ENCODING: int +URLMON_OPTION_USE_BINDSTRINGCREDS: int +URLMON_OPTION_USE_BROWSERAPPSDOCUMENTS: int +CF_NULL: int +Uri_CREATE_ALLOW_RELATIVE: int +Uri_CREATE_ALLOW_IMPLICIT_WILDCARD_SCHEME: int +Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME: int +Uri_CREATE_NOFRAG: int +Uri_CREATE_NO_CANONICALIZE: int +Uri_CREATE_CANONICALIZE: int +Uri_CREATE_FILE_USE_DOS_PATH: int +Uri_CREATE_DECODE_EXTRA_INFO: int +Uri_CREATE_NO_DECODE_EXTRA_INFO: int +Uri_CREATE_CRACK_UNKNOWN_SCHEMES: int +Uri_CREATE_NO_CRACK_UNKNOWN_SCHEMES: int +Uri_CREATE_PRE_PROCESS_HTML_URI: int +Uri_CREATE_NO_PRE_PROCESS_HTML_URI: int +Uri_CREATE_IE_SETTINGS: int +Uri_CREATE_NO_IE_SETTINGS: int +Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS: int +Uri_DISPLAY_NO_FRAGMENT: int +Uri_PUNYCODE_IDN_HOST: int +Uri_DISPLAY_IDN_HOST: int +Uri_ENCODING_USER_INFO_AND_PATH_IS_PERCENT_ENCODED_UTF8: int +Uri_ENCODING_USER_INFO_AND_PATH_IS_CP: int +Uri_ENCODING_HOST_IS_IDN: int +Uri_ENCODING_HOST_IS_PERCENT_ENCODED_UTF8: int +Uri_ENCODING_HOST_IS_PERCENT_ENCODED_CP: int +Uri_ENCODING_QUERY_AND_FRAGMENT_IS_PERCENT_ENCODED_UTF8: int +Uri_ENCODING_QUERY_AND_FRAGMENT_IS_CP: int +Uri_ENCODING_RFC: Incomplete +UriBuilder_USE_ORIGINAL_FLAGS: int +WININETINFO_OPTION_LOCK_HANDLE: int +URLOSTRM_USECACHEDCOPY_ONLY: int +URLOSTRM_USECACHEDCOPY: int +URLOSTRM_GETNEWESTVERSION: int +SET_FEATURE_ON_THREAD: int +SET_FEATURE_ON_PROCESS: int +SET_FEATURE_IN_REGISTRY: int +SET_FEATURE_ON_THREAD_LOCALMACHINE: int +SET_FEATURE_ON_THREAD_INTRANET: int +SET_FEATURE_ON_THREAD_TRUSTED: int +SET_FEATURE_ON_THREAD_INTERNET: int +SET_FEATURE_ON_THREAD_RESTRICTED: int +GET_FEATURE_FROM_THREAD: int +GET_FEATURE_FROM_PROCESS: int +GET_FEATURE_FROM_REGISTRY: int +GET_FEATURE_FROM_THREAD_LOCALMACHINE: int +GET_FEATURE_FROM_THREAD_INTRANET: int +GET_FEATURE_FROM_THREAD_TRUSTED: int +GET_FEATURE_FROM_THREAD_INTERNET: int +GET_FEATURE_FROM_THREAD_RESTRICTED: int +PROTOCOLFLAG_NO_PICS_CHECK: int +MUTZ_NOSAVEDFILECHECK: int +MUTZ_ISFILE: int +MUTZ_ACCEPT_WILDCARD_SCHEME: int +MUTZ_ENFORCERESTRICTED: int +MUTZ_RESERVED: int +MUTZ_REQUIRESAVEDFILECHECK: int +MUTZ_DONT_UNESCAPE: int +MUTZ_DONT_USE_CACHE: int +MUTZ_FORCE_INTRANET_FLAGS: int +MUTZ_IGNORE_ZONE_MAPPINGS: int +MAX_SIZE_SECURITY_ID: int +URLACTION_MIN: int +URLACTION_DOWNLOAD_MIN: int +URLACTION_DOWNLOAD_SIGNED_ACTIVEX: int +URLACTION_DOWNLOAD_UNSIGNED_ACTIVEX: int +URLACTION_DOWNLOAD_CURR_MAX: int +URLACTION_DOWNLOAD_MAX: int +URLACTION_ACTIVEX_MIN: int +URLACTION_ACTIVEX_RUN: int +URLPOLICY_ACTIVEX_CHECK_LIST: int +URLACTION_ACTIVEX_OVERRIDE_OBJECT_SAFETY: int +URLACTION_ACTIVEX_OVERRIDE_DATA_SAFETY: int +URLACTION_ACTIVEX_OVERRIDE_SCRIPT_SAFETY: int +URLACTION_SCRIPT_OVERRIDE_SAFETY: int +URLACTION_ACTIVEX_CONFIRM_NOOBJECTSAFETY: int +URLACTION_ACTIVEX_TREATASUNTRUSTED: int +URLACTION_ACTIVEX_NO_WEBOC_SCRIPT: int +URLACTION_ACTIVEX_OVERRIDE_REPURPOSEDETECTION: int +URLACTION_ACTIVEX_OVERRIDE_OPTIN: int +URLACTION_ACTIVEX_SCRIPTLET_RUN: int +URLACTION_ACTIVEX_DYNSRC_VIDEO_AND_ANIMATION: int +URLACTION_ACTIVEX_CURR_MAX: int +URLACTION_ACTIVEX_MAX: int +URLACTION_SCRIPT_MIN: int +URLACTION_SCRIPT_RUN: int +URLACTION_SCRIPT_JAVA_USE: int +URLACTION_SCRIPT_SAFE_ACTIVEX: int +URLACTION_CROSS_DOMAIN_DATA: int +URLACTION_SCRIPT_PASTE: int +URLACTION_ALLOW_XDOMAIN_SUBFRAME_RESIZE: int +URLACTION_SCRIPT_CURR_MAX: int +URLACTION_SCRIPT_MAX: int +URLACTION_HTML_MIN: int +URLACTION_HTML_SUBMIT_FORMS: int +URLACTION_HTML_SUBMIT_FORMS_FROM: int +URLACTION_HTML_SUBMIT_FORMS_TO: int +URLACTION_HTML_FONT_DOWNLOAD: int +URLACTION_HTML_JAVA_RUN: int +URLACTION_HTML_USERDATA_SAVE: int +URLACTION_HTML_SUBFRAME_NAVIGATE: int +URLACTION_HTML_META_REFRESH: int +URLACTION_HTML_MIXED_CONTENT: int +URLACTION_HTML_INCLUDE_FILE_PATH: int +URLACTION_HTML_MAX: int +URLACTION_SHELL_MIN: int +URLACTION_SHELL_INSTALL_DTITEMS: int +URLACTION_SHELL_MOVE_OR_COPY: int +URLACTION_SHELL_FILE_DOWNLOAD: int +URLACTION_SHELL_VERB: int +URLACTION_SHELL_WEBVIEW_VERB: int +URLACTION_SHELL_SHELLEXECUTE: int +URLACTION_SHELL_EXECUTE_HIGHRISK: int +URLACTION_SHELL_EXECUTE_MODRISK: int +URLACTION_SHELL_EXECUTE_LOWRISK: int +URLACTION_SHELL_POPUPMGR: int +URLACTION_SHELL_RTF_OBJECTS_LOAD: int +URLACTION_SHELL_ENHANCED_DRAGDROP_SECURITY: int +URLACTION_SHELL_EXTENSIONSECURITY: int +URLACTION_SHELL_SECURE_DRAGSOURCE: int +URLACTION_SHELL_CURR_MAX: int +URLACTION_SHELL_MAX: int +URLACTION_NETWORK_MIN: int +URLACTION_CREDENTIALS_USE: int +URLPOLICY_CREDENTIALS_SILENT_LOGON_OK: int +URLPOLICY_CREDENTIALS_MUST_PROMPT_USER: int +URLPOLICY_CREDENTIALS_CONDITIONAL_PROMPT: int +URLPOLICY_CREDENTIALS_ANONYMOUS_ONLY: int +URLACTION_AUTHENTICATE_CLIENT: int +URLPOLICY_AUTHENTICATE_CLEARTEXT_OK: int +URLPOLICY_AUTHENTICATE_CHALLENGE_RESPONSE: int +URLPOLICY_AUTHENTICATE_MUTUAL_ONLY: int +URLACTION_COOKIES: int +URLACTION_COOKIES_SESSION: int +URLACTION_CLIENT_CERT_PROMPT: int +URLACTION_COOKIES_THIRD_PARTY: int +URLACTION_COOKIES_SESSION_THIRD_PARTY: int +URLACTION_COOKIES_ENABLED: int +URLACTION_NETWORK_CURR_MAX: int +URLACTION_NETWORK_MAX: int +URLACTION_JAVA_MIN: int +URLACTION_JAVA_PERMISSIONS: int +URLPOLICY_JAVA_PROHIBIT: int +URLPOLICY_JAVA_HIGH: int +URLPOLICY_JAVA_MEDIUM: int +URLPOLICY_JAVA_LOW: int +URLPOLICY_JAVA_CUSTOM: int +URLACTION_JAVA_CURR_MAX: int +URLACTION_JAVA_MAX: int +URLACTION_INFODELIVERY_MIN: int +URLACTION_INFODELIVERY_NO_ADDING_CHANNELS: int +URLACTION_INFODELIVERY_NO_EDITING_CHANNELS: int +URLACTION_INFODELIVERY_NO_REMOVING_CHANNELS: int +URLACTION_INFODELIVERY_NO_ADDING_SUBSCRIPTIONS: int +URLACTION_INFODELIVERY_NO_EDITING_SUBSCRIPTIONS: int +URLACTION_INFODELIVERY_NO_REMOVING_SUBSCRIPTIONS: int +URLACTION_INFODELIVERY_NO_CHANNEL_LOGGING: int +URLACTION_INFODELIVERY_CURR_MAX: int +URLACTION_INFODELIVERY_MAX: int +URLACTION_CHANNEL_SOFTDIST_MIN: int +URLACTION_CHANNEL_SOFTDIST_PERMISSIONS: int +URLPOLICY_CHANNEL_SOFTDIST_PROHIBIT: int +URLPOLICY_CHANNEL_SOFTDIST_PRECACHE: int +URLPOLICY_CHANNEL_SOFTDIST_AUTOINSTALL: int +URLACTION_CHANNEL_SOFTDIST_MAX: int +URLACTION_BEHAVIOR_MIN: int +URLACTION_BEHAVIOR_RUN: int +URLPOLICY_BEHAVIOR_CHECK_LIST: int +URLACTION_FEATURE_MIN: int +URLACTION_FEATURE_MIME_SNIFFING: int +URLACTION_FEATURE_ZONE_ELEVATION: int +URLACTION_FEATURE_WINDOW_RESTRICTIONS: int +URLACTION_FEATURE_SCRIPT_STATUS_BAR: int +URLACTION_FEATURE_FORCE_ADDR_AND_STATUS: int +URLACTION_FEATURE_BLOCK_INPUT_PROMPTS: int +URLACTION_AUTOMATIC_DOWNLOAD_UI_MIN: int +URLACTION_AUTOMATIC_DOWNLOAD_UI: int +URLACTION_AUTOMATIC_ACTIVEX_UI: int +URLACTION_ALLOW_RESTRICTEDPROTOCOLS: int +URLACTION_ALLOW_APEVALUATION: int +URLACTION_WINDOWS_BROWSER_APPLICATIONS: int +URLACTION_XPS_DOCUMENTS: int +URLACTION_LOOSE_XAML: int +URLACTION_LOWRIGHTS: int +URLACTION_WINFX_SETUP: int +URLPOLICY_ALLOW: int +URLPOLICY_QUERY: int +URLPOLICY_DISALLOW: int +URLPOLICY_NOTIFY_ON_ALLOW: int +URLPOLICY_NOTIFY_ON_DISALLOW: int +URLPOLICY_LOG_ON_ALLOW: int +URLPOLICY_LOG_ON_DISALLOW: int +URLPOLICY_MASK_PERMISSIONS: int +URLPOLICY_DONTCHECKDLGBOX: int +URLZONE_ESC_FLAG: int +SECURITY_IE_STATE_GREEN: int +SECURITY_IE_STATE_RED: int +SOFTDIST_FLAG_USAGE_EMAIL: int +SOFTDIST_FLAG_USAGE_PRECACHE: int +SOFTDIST_FLAG_USAGE_AUTOINSTALL: int +SOFTDIST_FLAG_DELETE_SUBSCRIPTION: int +SOFTDIST_ADSTATE_NONE: int +SOFTDIST_ADSTATE_AVAILABLE: int +SOFTDIST_ADSTATE_DOWNLOADED: int +SOFTDIST_ADSTATE_INSTALLED: int +CONFIRMSAFETYACTION_LOADOBJECT: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/internet/internet.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/internet/internet.pyi new file mode 100644 index 000000000..8fd6b3806 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/internet/internet.pyi @@ -0,0 +1,51 @@ +import _win32typing + +def CoInternetCreateSecurityManager(reserved) -> _win32typing.PyIInternetSecurityManager: ... +def CoInternetIsFeatureEnabled(flags): ... +def CoInternetSetFeatureEnabled(flags, enable): ... + +FEATURE_ADDON_MANAGEMENT: int +FEATURE_BEHAVIORS: int +FEATURE_DISABLE_MK_PROTOCOL: int +FEATURE_ENTRY_COUNT: int +FEATURE_GET_URL_DOM_FILEPATH_UNENCODED: int +FEATURE_HTTP_USERNAME_PASSWORD_DISABLE: int +FEATURE_LOCALMACHINE_LOCKDOWN: int +FEATURE_MIME_HANDLING: int +FEATURE_MIME_SNIFFING: int +FEATURE_OBJECT_CACHING: int +FEATURE_PROTOCOL_LOCKDOWN: int +FEATURE_RESTRICT_ACTIVEXINSTALL: int +FEATURE_RESTRICT_FILEDOWNLOAD: int +FEATURE_SAFE_BINDTOOBJECT: int +FEATURE_SECURITYBAND: int +FEATURE_UNC_SAVEDFILECHECK: int +FEATURE_VALIDATE_NAVIGATE_URL: int +FEATURE_WEBOC_POPUPMANAGEMENT: int +FEATURE_WINDOW_RESTRICTIONS: int +FEATURE_ZONE_ELEVATION: int +GET_FEATURE_FROM_PROCESS: int +GET_FEATURE_FROM_REGISTRY: int +GET_FEATURE_FROM_THREAD: int +GET_FEATURE_FROM_THREAD_INTERNET: int +GET_FEATURE_FROM_THREAD_INTRANET: int +GET_FEATURE_FROM_THREAD_LOCALMACHINE: int +GET_FEATURE_FROM_THREAD_RESTRICTED: int +GET_FEATURE_FROM_THREAD_TRUSTED: int +IID_IDocHostUIHandler: _win32typing.PyIID +IID_IHTMLOMWindowServices: _win32typing.PyIID +IID_IInternetBindInfo: _win32typing.PyIID +IID_IInternetPriority: _win32typing.PyIID +IID_IInternetProtocol: _win32typing.PyIID +IID_IInternetProtocolInfo: _win32typing.PyIID +IID_IInternetProtocolRoot: _win32typing.PyIID +IID_IInternetProtocolSink: _win32typing.PyIID +IID_IInternetSecurityManager: _win32typing.PyIID +SET_FEATURE_IN_REGISTRY: int +SET_FEATURE_ON_PROCESS: int +SET_FEATURE_ON_THREAD: int +SET_FEATURE_ON_THREAD_INTERNET: int +SET_FEATURE_ON_THREAD_INTRANET: int +SET_FEATURE_ON_THREAD_LOCALMACHINE: int +SET_FEATURE_ON_THREAD_RESTRICTED: int +SET_FEATURE_ON_THREAD_TRUSTED: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/mapi/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/mapi/__init__.pyi new file mode 100644 index 000000000..e69de29bb diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/mapi/_exchdapi.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/mapi/_exchdapi.pyi new file mode 100644 index 000000000..2d86d5bf1 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/mapi/_exchdapi.pyi @@ -0,0 +1,43 @@ +from _typeshed import Incomplete + +import _win32typing + +def HrInstallService() -> None: ... +def HrInstallMailboxAgent() -> None: ... +def HrCreateMailboxAgentProfile(serviceName: str, profile: str) -> None: ... +def HrCreateGatewayProfile(serviceName: str, profile: str) -> None: ... +def HrMailboxAgentExists(server: str, siteDN: str, rdn: str) -> None: ... +def HrAdminProgramExists() -> None: ... +def HrRemoveMailboxAgent(server: str, siteDN: str, rdn: str) -> None: ... +def HrRemoveProfile(profile: str) -> None: ... +def HrEnumOrganizations(rootDN: str, server: str) -> list[str]: ... +def HrEnumSites(server: str, organizationDN: str) -> list[str]: ... +def HrEnumContainers(server: str, siteDN: str, fSubtree) -> list[str]: ... +def HrEnumSiteAdmins(server: str, siteDN: str) -> list[str]: ... +def HrGetServiceAccountName(serviceName: str, serviceName1: str) -> str: ... +def HrCreateDirEntryIdEx(addrBook: _win32typing.PyIAddrBook, distinguishedName: str) -> str: ... +def HrCreateProfileName(profPrefix: str) -> str: ... +def HrFindExchangeGlobalAddresslist(addrBook: _win32typing.PyIAddrBook) -> str: ... +def HrGetExchangeStatus(server: str) -> tuple[Incomplete, Incomplete]: ... +def HrGetMailboxDN(session) -> str: ... +def HrGetServerDN(session) -> str: ... +def HrMAPIFindDefaultMsgStore(session: _win32typing.PyIMAPISession) -> str: ... +def HrMAPIFindFolder(folder: _win32typing.PyIMAPIFolder, name: str) -> str: ... +def HrMAPIFindFolderEx(msgStore: _win32typing.PyIMsgStore, sepString: str, path: str) -> str: ... +def HrMAPIFindIPMSubtree(msgStore: _win32typing.PyIMsgStore) -> str: ... +def HrMAPIFindInbox(msgStore: _win32typing.PyIMsgStore) -> str: ... +def HrMAPIFindStore(session: _win32typing.PyIMAPISession, name: str) -> _win32typing.PyIMsgStore: ... +def HrMAPIFindSubfolderEx(rootFolder: _win32typing.PyIMAPIFolder, sep: str, name: str) -> _win32typing.PyIMsgStore: ... +def HrMAPIOpenFolderEx(msgStore: _win32typing.PyIMsgStore, sep: str, name: str) -> _win32typing.PyIMAPIFolder: ... +def HrMAPISetPropBoolean(obj: _win32typing.PyIMAPIProp, tag) -> None: ... +def HrMAPISetPropLong(obj: _win32typing.PyIMAPIProp, tag) -> None: ... +def HrMailboxLogoff(inbox: _win32typing.PyIMsgStore) -> None: ... +def HrMailboxLogon( + session: _win32typing.PyIMAPISession, msgStore: _win32typing.PyIMsgStore, msgStoreDN: str, mailboxDN: str +) -> _win32typing.PyIMsgStore: ... +def HrOpenExchangePrivateStore(session: _win32typing.PyIMAPISession) -> _win32typing.PyIMsgStore: ... +def HrOpenExchangePublicFolders(store: _win32typing.PyIMsgStore) -> _win32typing.PyIMAPIFolder: ... +def HrOpenExchangePublicStore(session: _win32typing.PyIMAPISession) -> _win32typing.PyIMsgStore: ... +def HrOpenSessionObject(session: _win32typing.PyIMAPISession) -> _win32typing.PyIMAPIProp: ... +def HrOpenSiteContainer(session: _win32typing.PyIMAPISession) -> _win32typing.PyIMAPIProp: ... +def HrOpenSiteContainerAddressing(session: _win32typing.PyIMAPISession) -> _win32typing.PyIMAPIProp: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/mapi/emsabtags.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/mapi/emsabtags.pyi new file mode 100644 index 000000000..59cfd215c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/mapi/emsabtags.pyi @@ -0,0 +1,865 @@ +from _typeshed import Incomplete + +from win32comext.mapi.mapitags import ( + PROP_TAG as PROP_TAG, + PT_APPTIME as PT_APPTIME, + PT_BINARY as PT_BINARY, + PT_BOOLEAN as PT_BOOLEAN, + PT_CLSID as PT_CLSID, + PT_CURRENCY as PT_CURRENCY, + PT_DOUBLE as PT_DOUBLE, + PT_ERROR as PT_ERROR, + PT_FLOAT as PT_FLOAT, + PT_I2 as PT_I2, + PT_I4 as PT_I4, + PT_I8 as PT_I8, + PT_LONG as PT_LONG, + PT_LONGLONG as PT_LONGLONG, + PT_MV_APPTIME as PT_MV_APPTIME, + PT_MV_BINARY as PT_MV_BINARY, + PT_MV_CLSID as PT_MV_CLSID, + PT_MV_CURRENCY as PT_MV_CURRENCY, + PT_MV_DOUBLE as PT_MV_DOUBLE, + PT_MV_FLOAT as PT_MV_FLOAT, + PT_MV_I2 as PT_MV_I2, + PT_MV_I4 as PT_MV_I4, + PT_MV_I8 as PT_MV_I8, + PT_MV_LONG as PT_MV_LONG, + PT_MV_LONGLONG as PT_MV_LONGLONG, + PT_MV_R4 as PT_MV_R4, + PT_MV_R8 as PT_MV_R8, + PT_MV_SHORT as PT_MV_SHORT, + PT_MV_STRING8 as PT_MV_STRING8, + PT_MV_SYSTIME as PT_MV_SYSTIME, + PT_MV_TSTRING as PT_MV_TSTRING, + PT_MV_UNICODE as PT_MV_UNICODE, + PT_NULL as PT_NULL, + PT_OBJECT as PT_OBJECT, + PT_R4 as PT_R4, + PT_SHORT as PT_SHORT, + PT_STRING8 as PT_STRING8, + PT_SYSTIME as PT_SYSTIME, + PT_TSTRING as PT_TSTRING, + PT_UNICODE as PT_UNICODE, + PT_UNSPECIFIED as PT_UNSPECIFIED, +) + +AB_SHOW_PHANTOMS: int +AB_SHOW_OTHERS: int +EMS_AB_ADDRESS_LOOKUP: int +PR_EMS_AB_SERVER: Incomplete +PR_EMS_AB_SERVER_A: Incomplete +PR_EMS_AB_SERVER_W: Incomplete +PR_EMS_AB_CONTAINERID: Incomplete +PR_EMS_AB_DOS_ENTRYID: Incomplete +PR_EMS_AB_PARENT_ENTRYID: Incomplete +PR_EMS_AB_IS_MASTER: Incomplete +PR_EMS_AB_OBJECT_OID: Incomplete +PR_EMS_AB_HIERARCHY_PATH: Incomplete +PR_EMS_AB_HIERARCHY_PATH_A: Incomplete +PR_EMS_AB_HIERARCHY_PATH_W: Incomplete +PR_EMS_AB_CHILD_RDNS: Incomplete +MIN_EMS_AB_CONSTRUCTED_PROP_ID: int +PR_EMS_AB_OTHER_RECIPS: Incomplete +PR_EMS_AB_DISPLAY_NAME_PRINTABLE: Incomplete +PR_EMS_AB_DISPLAY_NAME_PRINTABLE_A: Incomplete +PR_EMS_AB_DISPLAY_NAME_PRINTABLE_W: Incomplete +PR_EMS_AB_ACCESS_CATEGORY: Incomplete +PR_EMS_AB_ACTIVATION_SCHEDULE: Incomplete +PR_EMS_AB_ACTIVATION_STYLE: Incomplete +PR_EMS_AB_ADDRESS_ENTRY_DISPLAY_TABLE: Incomplete +PR_EMS_AB_ADDRESS_ENTRY_DISPLAY_TABLE_MSDOS: Incomplete +PR_EMS_AB_ADDRESS_SYNTAX: Incomplete +PR_EMS_AB_ADDRESS_TYPE: Incomplete +PR_EMS_AB_ADDRESS_TYPE_A: Incomplete +PR_EMS_AB_ADDRESS_TYPE_W: Incomplete +PR_EMS_AB_ADMD: Incomplete +PR_EMS_AB_ADMD_A: Incomplete +PR_EMS_AB_ADMD_W: Incomplete +PR_EMS_AB_ADMIN_DESCRIPTION: Incomplete +PR_EMS_AB_ADMIN_DESCRIPTION_A: Incomplete +PR_EMS_AB_ADMIN_DESCRIPTION_W: Incomplete +PR_EMS_AB_ADMIN_DISPLAY_NAME: Incomplete +PR_EMS_AB_ADMIN_DISPLAY_NAME_A: Incomplete +PR_EMS_AB_ADMIN_DISPLAY_NAME_W: Incomplete +PR_EMS_AB_ADMIN_EXTENSION_DLL: Incomplete +PR_EMS_AB_ADMIN_EXTENSION_DLL_A: Incomplete +PR_EMS_AB_ADMIN_EXTENSION_DLL_W: Incomplete +PR_EMS_AB_ALIASED_OBJECT_NAME: Incomplete +PR_EMS_AB_ALIASED_OBJECT_NAME_A: Incomplete +PR_EMS_AB_ALIASED_OBJECT_NAME_W: Incomplete +PR_EMS_AB_ALIASED_OBJECT_NAME_O: Incomplete +PR_EMS_AB_ALIASED_OBJECT_NAME_T: Incomplete +PR_EMS_AB_ALT_RECIPIENT: Incomplete +PR_EMS_AB_ALT_RECIPIENT_A: Incomplete +PR_EMS_AB_ALT_RECIPIENT_W: Incomplete +PR_EMS_AB_ALT_RECIPIENT_O: Incomplete +PR_EMS_AB_ALT_RECIPIENT_T: Incomplete +PR_EMS_AB_ALT_RECIPIENT_BL: Incomplete +PR_EMS_AB_ALT_RECIPIENT_BL_A: Incomplete +PR_EMS_AB_ALT_RECIPIENT_BL_W: Incomplete +PR_EMS_AB_ALT_RECIPIENT_BL_O: Incomplete +PR_EMS_AB_ALT_RECIPIENT_BL_T: Incomplete +PR_EMS_AB_ANCESTOR_ID: Incomplete +PR_EMS_AB_ASSOC_NT_ACCOUNT: Incomplete +PR_EMS_AB_ASSOC_REMOTE_DXA: Incomplete +PR_EMS_AB_ASSOC_REMOTE_DXA_A: Incomplete +PR_EMS_AB_ASSOC_REMOTE_DXA_W: Incomplete +PR_EMS_AB_ASSOC_REMOTE_DXA_O: Incomplete +PR_EMS_AB_ASSOC_REMOTE_DXA_T: Incomplete +PR_EMS_AB_ASSOCIATION_LIFETIME: Incomplete +PR_EMS_AB_AUTH_ORIG_BL: Incomplete +PR_EMS_AB_AUTH_ORIG_BL_A: Incomplete +PR_EMS_AB_AUTH_ORIG_BL_W: Incomplete +PR_EMS_AB_AUTH_ORIG_BL_O: Incomplete +PR_EMS_AB_AUTH_ORIG_BL_T: Incomplete +PR_EMS_AB_AUTHORITY_REVOCATION_LIST: Incomplete +PR_EMS_AB_AUTHORIZED_DOMAIN: Incomplete +PR_EMS_AB_AUTHORIZED_DOMAIN_A: Incomplete +PR_EMS_AB_AUTHORIZED_DOMAIN_W: Incomplete +PR_EMS_AB_AUTHORIZED_PASSWORD: Incomplete +PR_EMS_AB_AUTHORIZED_USER: Incomplete +PR_EMS_AB_AUTHORIZED_USER_A: Incomplete +PR_EMS_AB_AUTHORIZED_USER_W: Incomplete +PR_EMS_AB_AUTOREPLY: Incomplete +PR_EMS_AB_AUTOREPLY_MESSAGE: Incomplete +PR_EMS_AB_AUTOREPLY_MESSAGE_A: Incomplete +PR_EMS_AB_AUTOREPLY_MESSAGE_W: Incomplete +PR_EMS_AB_AUTOREPLY_SUBJECT: Incomplete +PR_EMS_AB_AUTOREPLY_SUBJECT_A: Incomplete +PR_EMS_AB_AUTOREPLY_SUBJECT_W: Incomplete +PR_EMS_AB_BRIDGEHEAD_SERVERS: Incomplete +PR_EMS_AB_BRIDGEHEAD_SERVERS_A: Incomplete +PR_EMS_AB_BRIDGEHEAD_SERVERS_W: Incomplete +PR_EMS_AB_BRIDGEHEAD_SERVERS_O: Incomplete +PR_EMS_AB_BRIDGEHEAD_SERVERS_T: Incomplete +PR_EMS_AB_BUSINESS_CATEGORY: Incomplete +PR_EMS_AB_BUSINESS_CATEGORY_A: Incomplete +PR_EMS_AB_BUSINESS_CATEGORY_W: Incomplete +PR_EMS_AB_BUSINESS_ROLES: Incomplete +PR_EMS_AB_CA_CERTIFICATE: Incomplete +PR_EMS_AB_CAN_CREATE_PF: Incomplete +PR_EMS_AB_CAN_CREATE_PF_A: Incomplete +PR_EMS_AB_CAN_CREATE_PF_W: Incomplete +PR_EMS_AB_CAN_CREATE_PF_O: Incomplete +PR_EMS_AB_CAN_CREATE_PF_T: Incomplete +PR_EMS_AB_CAN_CREATE_PF_BL: Incomplete +PR_EMS_AB_CAN_CREATE_PF_BL_A: Incomplete +PR_EMS_AB_CAN_CREATE_PF_BL_W: Incomplete +PR_EMS_AB_CAN_CREATE_PF_BL_O: Incomplete +PR_EMS_AB_CAN_CREATE_PF_BL_T: Incomplete +PR_EMS_AB_CAN_CREATE_PF_DL: Incomplete +PR_EMS_AB_CAN_CREATE_PF_DL_A: Incomplete +PR_EMS_AB_CAN_CREATE_PF_DL_W: Incomplete +PR_EMS_AB_CAN_CREATE_PF_DL_O: Incomplete +PR_EMS_AB_CAN_CREATE_PF_DL_T: Incomplete +PR_EMS_AB_CAN_CREATE_PF_DL_BL: Incomplete +PR_EMS_AB_CAN_CREATE_PF_DL_BL_A: Incomplete +PR_EMS_AB_CAN_CREATE_PF_DL_BL_W: Incomplete +PR_EMS_AB_CAN_CREATE_PF_DL_BL_O: Incomplete +PR_EMS_AB_CAN_CREATE_PF_DL_BL_T: Incomplete +PR_EMS_AB_CAN_NOT_CREATE_PF: Incomplete +PR_EMS_AB_CAN_NOT_CREATE_PF_A: Incomplete +PR_EMS_AB_CAN_NOT_CREATE_PF_W: Incomplete +PR_EMS_AB_CAN_NOT_CREATE_PF_O: Incomplete +PR_EMS_AB_CAN_NOT_CREATE_PF_T: Incomplete +PR_EMS_AB_CAN_NOT_CREATE_PF_BL: Incomplete +PR_EMS_AB_CAN_NOT_CREATE_PF_BL_A: Incomplete +PR_EMS_AB_CAN_NOT_CREATE_PF_BL_W: Incomplete +PR_EMS_AB_CAN_NOT_CREATE_PF_BL_O: Incomplete +PR_EMS_AB_CAN_NOT_CREATE_PF_BL_T: Incomplete +PR_EMS_AB_CAN_NOT_CREATE_PF_DL: Incomplete +PR_EMS_AB_CAN_NOT_CREATE_PF_DL_A: Incomplete +PR_EMS_AB_CAN_NOT_CREATE_PF_DL_W: Incomplete +PR_EMS_AB_CAN_NOT_CREATE_PF_DL_O: Incomplete +PR_EMS_AB_CAN_NOT_CREATE_PF_DL_T: Incomplete +PR_EMS_AB_CAN_NOT_CREATE_PF_DL_BL: Incomplete +PR_EMS_AB_CAN_NOT_CREATE_PF_DL_BL_A: Incomplete +PR_EMS_AB_CAN_NOT_CREATE_PF_DL_BL_W: Incomplete +PR_EMS_AB_CAN_NOT_CREATE_PF_DL_BL_O: Incomplete +PR_EMS_AB_CAN_NOT_CREATE_PF_DL_BL_T: Incomplete +PR_EMS_AB_CAN_PRESERVE_DNS: Incomplete +PR_EMS_AB_CERTIFICATE_REVOCATION_LIST: Incomplete +PR_EMS_AB_CLOCK_ALERT_OFFSET: Incomplete +PR_EMS_AB_CLOCK_ALERT_REPAIR: Incomplete +PR_EMS_AB_CLOCK_WARNING_OFFSET: Incomplete +PR_EMS_AB_CLOCK_WARNING_REPAIR: Incomplete +PR_EMS_AB_COMPUTER_NAME: Incomplete +PR_EMS_AB_COMPUTER_NAME_A: Incomplete +PR_EMS_AB_COMPUTER_NAME_W: Incomplete +PR_EMS_AB_CONNECTED_DOMAINS: Incomplete +PR_EMS_AB_CONNECTED_DOMAINS_A: Incomplete +PR_EMS_AB_CONNECTED_DOMAINS_W: Incomplete +PR_EMS_AB_CONTAINER_INFO: Incomplete +PR_EMS_AB_COST: Incomplete +PR_EMS_AB_COUNTRY_NAME: Incomplete +PR_EMS_AB_COUNTRY_NAME_A: Incomplete +PR_EMS_AB_COUNTRY_NAME_W: Incomplete +PR_EMS_AB_CROSS_CERTIFICATE_PAIR: Incomplete +PR_EMS_AB_DELIV_CONT_LENGTH: Incomplete +PR_EMS_AB_DELIV_EITS: Incomplete +PR_EMS_AB_DELIV_EXT_CONT_TYPES: Incomplete +PR_EMS_AB_DELIVER_AND_REDIRECT: Incomplete +PR_EMS_AB_DELIVERY_MECHANISM: Incomplete +PR_EMS_AB_DESCRIPTION: Incomplete +PR_EMS_AB_DESCRIPTION_A: Incomplete +PR_EMS_AB_DESCRIPTION_W: Incomplete +PR_EMS_AB_DESTINATION_INDICATOR: Incomplete +PR_EMS_AB_DESTINATION_INDICATOR_A: Incomplete +PR_EMS_AB_DESTINATION_INDICATOR_W: Incomplete +PR_EMS_AB_DIAGNOSTIC_REG_KEY: Incomplete +PR_EMS_AB_DIAGNOSTIC_REG_KEY_A: Incomplete +PR_EMS_AB_DIAGNOSTIC_REG_KEY_W: Incomplete +PR_EMS_AB_DISPLAY_NAME_OVERRIDE: Incomplete +PR_EMS_AB_DL_MEM_REJECT_PERMS_BL: Incomplete +PR_EMS_AB_DL_MEM_REJECT_PERMS_BL_A: Incomplete +PR_EMS_AB_DL_MEM_REJECT_PERMS_BL_W: Incomplete +PR_EMS_AB_DL_MEM_REJECT_PERMS_BL_O: Incomplete +PR_EMS_AB_DL_MEM_REJECT_PERMS_BL_T: Incomplete +PR_EMS_AB_DL_MEM_SUBMIT_PERMS_BL: Incomplete +PR_EMS_AB_DL_MEM_SUBMIT_PERMS_BL_A: Incomplete +PR_EMS_AB_DL_MEM_SUBMIT_PERMS_BL_W: Incomplete +PR_EMS_AB_DL_MEM_SUBMIT_PERMS_BL_O: Incomplete +PR_EMS_AB_DL_MEM_SUBMIT_PERMS_BL_T: Incomplete +PR_EMS_AB_DL_MEMBER_RULE: Incomplete +PR_EMS_AB_DOMAIN_DEF_ALT_RECIP: Incomplete +PR_EMS_AB_DOMAIN_DEF_ALT_RECIP_A: Incomplete +PR_EMS_AB_DOMAIN_DEF_ALT_RECIP_W: Incomplete +PR_EMS_AB_DOMAIN_DEF_ALT_RECIP_O: Incomplete +PR_EMS_AB_DOMAIN_DEF_ALT_RECIP_T: Incomplete +PR_EMS_AB_DOMAIN_NAME: Incomplete +PR_EMS_AB_DOMAIN_NAME_A: Incomplete +PR_EMS_AB_DOMAIN_NAME_W: Incomplete +PR_EMS_AB_DSA_SIGNATURE: Incomplete +PR_EMS_AB_DXA_ADMIN_COPY: Incomplete +PR_EMS_AB_DXA_ADMIN_FORWARD: Incomplete +PR_EMS_AB_DXA_ADMIN_UPDATE: Incomplete +PR_EMS_AB_DXA_APPEND_REQCN: Incomplete +PR_EMS_AB_DXA_CONF_CONTAINER_LIST: Incomplete +PR_EMS_AB_DXA_CONF_CONTAINER_LIST_A: Incomplete +PR_EMS_AB_DXA_CONF_CONTAINER_LIST_W: Incomplete +PR_EMS_AB_DXA_CONF_CONTAINER_LIST_O: Incomplete +PR_EMS_AB_DXA_CONF_CONTAINER_LIST_T: Incomplete +PR_EMS_AB_DXA_CONF_REQ_TIME: Incomplete +PR_EMS_AB_DXA_CONF_SEQ: Incomplete +PR_EMS_AB_DXA_CONF_SEQ_A: Incomplete +PR_EMS_AB_DXA_CONF_SEQ_W: Incomplete +PR_EMS_AB_DXA_CONF_SEQ_USN: Incomplete +PR_EMS_AB_DXA_EXCHANGE_OPTIONS: Incomplete +PR_EMS_AB_DXA_EXPORT_NOW: Incomplete +PR_EMS_AB_DXA_FLAGS: Incomplete +PR_EMS_AB_DXA_IMP_SEQ: Incomplete +PR_EMS_AB_DXA_IMP_SEQ_A: Incomplete +PR_EMS_AB_DXA_IMP_SEQ_W: Incomplete +PR_EMS_AB_DXA_IMP_SEQ_TIME: Incomplete +PR_EMS_AB_DXA_IMP_SEQ_USN: Incomplete +PR_EMS_AB_DXA_IMPORT_NOW: Incomplete +PR_EMS_AB_DXA_IN_TEMPLATE_MAP: Incomplete +PR_EMS_AB_DXA_IN_TEMPLATE_MAP_A: Incomplete +PR_EMS_AB_DXA_IN_TEMPLATE_MAP_W: Incomplete +PR_EMS_AB_DXA_LOCAL_ADMIN: Incomplete +PR_EMS_AB_DXA_LOCAL_ADMIN_A: Incomplete +PR_EMS_AB_DXA_LOCAL_ADMIN_W: Incomplete +PR_EMS_AB_DXA_LOCAL_ADMIN_O: Incomplete +PR_EMS_AB_DXA_LOCAL_ADMIN_T: Incomplete +PR_EMS_AB_DXA_LOGGING_LEVEL: Incomplete +PR_EMS_AB_DXA_NATIVE_ADDRESS_TYPE: Incomplete +PR_EMS_AB_DXA_NATIVE_ADDRESS_TYPE_A: Incomplete +PR_EMS_AB_DXA_NATIVE_ADDRESS_TYPE_W: Incomplete +PR_EMS_AB_DXA_OUT_TEMPLATE_MAP: Incomplete +PR_EMS_AB_DXA_OUT_TEMPLATE_MAP_A: Incomplete +PR_EMS_AB_DXA_OUT_TEMPLATE_MAP_W: Incomplete +PR_EMS_AB_DXA_PASSWORD: Incomplete +PR_EMS_AB_DXA_PASSWORD_A: Incomplete +PR_EMS_AB_DXA_PASSWORD_W: Incomplete +PR_EMS_AB_DXA_PREV_EXCHANGE_OPTIONS: Incomplete +PR_EMS_AB_DXA_PREV_EXPORT_NATIVE_ONLY: Incomplete +PR_EMS_AB_DXA_PREV_IN_EXCHANGE_SENSITIVITY: Incomplete +PR_EMS_AB_DXA_PREV_REMOTE_ENTRIES: Incomplete +PR_EMS_AB_DXA_PREV_REMOTE_ENTRIES_A: Incomplete +PR_EMS_AB_DXA_PREV_REMOTE_ENTRIES_W: Incomplete +PR_EMS_AB_DXA_PREV_REMOTE_ENTRIES_O: Incomplete +PR_EMS_AB_DXA_PREV_REMOTE_ENTRIES_T: Incomplete +PR_EMS_AB_DXA_PREV_REPLICATION_SENSITIVITY: Incomplete +PR_EMS_AB_DXA_PREV_TEMPLATE_OPTIONS: Incomplete +PR_EMS_AB_DXA_PREV_TYPES: Incomplete +PR_EMS_AB_DXA_RECIPIENT_CP: Incomplete +PR_EMS_AB_DXA_RECIPIENT_CP_A: Incomplete +PR_EMS_AB_DXA_RECIPIENT_CP_W: Incomplete +PR_EMS_AB_DXA_REMOTE_CLIENT: Incomplete +PR_EMS_AB_DXA_REMOTE_CLIENT_A: Incomplete +PR_EMS_AB_DXA_REMOTE_CLIENT_W: Incomplete +PR_EMS_AB_DXA_REMOTE_CLIENT_O: Incomplete +PR_EMS_AB_DXA_REMOTE_CLIENT_T: Incomplete +PR_EMS_AB_DXA_REQ_SEQ: Incomplete +PR_EMS_AB_DXA_REQ_SEQ_A: Incomplete +PR_EMS_AB_DXA_REQ_SEQ_W: Incomplete +PR_EMS_AB_DXA_REQ_SEQ_TIME: Incomplete +PR_EMS_AB_DXA_REQ_SEQ_USN: Incomplete +PR_EMS_AB_DXA_REQNAME: Incomplete +PR_EMS_AB_DXA_REQNAME_A: Incomplete +PR_EMS_AB_DXA_REQNAME_W: Incomplete +PR_EMS_AB_DXA_SVR_SEQ: Incomplete +PR_EMS_AB_DXA_SVR_SEQ_A: Incomplete +PR_EMS_AB_DXA_SVR_SEQ_W: Incomplete +PR_EMS_AB_DXA_SVR_SEQ_TIME: Incomplete +PR_EMS_AB_DXA_SVR_SEQ_USN: Incomplete +PR_EMS_AB_DXA_TASK: Incomplete +PR_EMS_AB_DXA_TEMPLATE_OPTIONS: Incomplete +PR_EMS_AB_DXA_TEMPLATE_TIMESTAMP: Incomplete +PR_EMS_AB_DXA_TYPES: Incomplete +PR_EMS_AB_DXA_UNCONF_CONTAINER_LIST: Incomplete +PR_EMS_AB_DXA_UNCONF_CONTAINER_LIST_A: Incomplete +PR_EMS_AB_DXA_UNCONF_CONTAINER_LIST_W: Incomplete +PR_EMS_AB_DXA_UNCONF_CONTAINER_LIST_O: Incomplete +PR_EMS_AB_DXA_UNCONF_CONTAINER_LIST_T: Incomplete +PR_EMS_AB_ENABLED_PROTOCOLS: Incomplete +PR_EMS_AB_ENCAPSULATION_METHOD: Incomplete +PR_EMS_AB_ENCRYPT: Incomplete +PR_EMS_AB_ENCRYPT_ALG_LIST_NA: Incomplete +PR_EMS_AB_ENCRYPT_ALG_LIST_NA_A: Incomplete +PR_EMS_AB_ENCRYPT_ALG_LIST_NA_W: Incomplete +PR_EMS_AB_ENCRYPT_ALG_LIST_OTHER: Incomplete +PR_EMS_AB_ENCRYPT_ALG_LIST_OTHER_A: Incomplete +PR_EMS_AB_ENCRYPT_ALG_LIST_OTHER_W: Incomplete +PR_EMS_AB_ENCRYPT_ALG_SELECTED_NA: Incomplete +PR_EMS_AB_ENCRYPT_ALG_SELECTED_NA_A: Incomplete +PR_EMS_AB_ENCRYPT_ALG_SELECTED_NA_W: Incomplete +PR_EMS_AB_ENCRYPT_ALG_SELECTED_OTHER: Incomplete +PR_EMS_AB_ENCRYPT_ALG_SELECTED_OTHER_A: Incomplete +PR_EMS_AB_ENCRYPT_ALG_SELECTED_OTHER_W: Incomplete +PR_EMS_AB_EXPAND_DLS_LOCALLY: Incomplete +PR_EMS_AB_EXPIRATION_TIME: Incomplete +PR_EMS_AB_EXPORT_CONTAINERS: Incomplete +PR_EMS_AB_EXPORT_CONTAINERS_A: Incomplete +PR_EMS_AB_EXPORT_CONTAINERS_W: Incomplete +PR_EMS_AB_EXPORT_CONTAINERS_O: Incomplete +PR_EMS_AB_EXPORT_CONTAINERS_T: Incomplete +PR_EMS_AB_EXPORT_CUSTOM_RECIPIENTS: Incomplete +PR_EMS_AB_EXTENDED_CHARS_ALLOWED: Incomplete +PR_EMS_AB_EXTENSION_ATTRIBUTE_1: Incomplete +PR_EMS_AB_EXTENSION_ATTRIBUTE_1_A: Incomplete +PR_EMS_AB_EXTENSION_ATTRIBUTE_1_W: Incomplete +PR_EMS_AB_EXTENSION_ATTRIBUTE_10: Incomplete +PR_EMS_AB_EXTENSION_ATTRIBUTE_10_A: Incomplete +PR_EMS_AB_EXTENSION_ATTRIBUTE_10_W: Incomplete +PR_EMS_AB_EXTENSION_ATTRIBUTE_2: Incomplete +PR_EMS_AB_EXTENSION_ATTRIBUTE_2_A: Incomplete +PR_EMS_AB_EXTENSION_ATTRIBUTE_2_W: Incomplete +PR_EMS_AB_EXTENSION_ATTRIBUTE_3: Incomplete +PR_EMS_AB_EXTENSION_ATTRIBUTE_3_A: Incomplete +PR_EMS_AB_EXTENSION_ATTRIBUTE_3_W: Incomplete +PR_EMS_AB_EXTENSION_ATTRIBUTE_4: Incomplete +PR_EMS_AB_EXTENSION_ATTRIBUTE_4_A: Incomplete +PR_EMS_AB_EXTENSION_ATTRIBUTE_4_W: Incomplete +PR_EMS_AB_EXTENSION_ATTRIBUTE_5: Incomplete +PR_EMS_AB_EXTENSION_ATTRIBUTE_5_A: Incomplete +PR_EMS_AB_EXTENSION_ATTRIBUTE_5_W: Incomplete +PR_EMS_AB_EXTENSION_ATTRIBUTE_6: Incomplete +PR_EMS_AB_EXTENSION_ATTRIBUTE_6_A: Incomplete +PR_EMS_AB_EXTENSION_ATTRIBUTE_6_W: Incomplete +PR_EMS_AB_EXTENSION_ATTRIBUTE_7: Incomplete +PR_EMS_AB_EXTENSION_ATTRIBUTE_7_A: Incomplete +PR_EMS_AB_EXTENSION_ATTRIBUTE_7_W: Incomplete +PR_EMS_AB_EXTENSION_ATTRIBUTE_8: Incomplete +PR_EMS_AB_EXTENSION_ATTRIBUTE_8_A: Incomplete +PR_EMS_AB_EXTENSION_ATTRIBUTE_8_W: Incomplete +PR_EMS_AB_EXTENSION_ATTRIBUTE_9: Incomplete +PR_EMS_AB_EXTENSION_ATTRIBUTE_9_A: Incomplete +PR_EMS_AB_EXTENSION_ATTRIBUTE_9_W: Incomplete +PR_EMS_AB_EXTENSION_DATA: Incomplete +PR_EMS_AB_EXTENSION_NAME: Incomplete +PR_EMS_AB_EXTENSION_NAME_A: Incomplete +PR_EMS_AB_EXTENSION_NAME_W: Incomplete +PR_EMS_AB_EXTENSION_NAME_INHERITED: Incomplete +PR_EMS_AB_EXTENSION_NAME_INHERITED_A: Incomplete +PR_EMS_AB_EXTENSION_NAME_INHERITED_W: Incomplete +PR_EMS_AB_FACSIMILE_TELEPHONE_NUMBER: Incomplete +PR_EMS_AB_FILE_VERSION: Incomplete +PR_EMS_AB_FILTER_LOCAL_ADDRESSES: Incomplete +PR_EMS_AB_FOLDER_PATHNAME: Incomplete +PR_EMS_AB_FOLDER_PATHNAME_A: Incomplete +PR_EMS_AB_FOLDER_PATHNAME_W: Incomplete +PR_EMS_AB_FOLDERS_CONTAINER: Incomplete +PR_EMS_AB_FOLDERS_CONTAINER_A: Incomplete +PR_EMS_AB_FOLDERS_CONTAINER_W: Incomplete +PR_EMS_AB_FOLDERS_CONTAINER_O: Incomplete +PR_EMS_AB_FOLDERS_CONTAINER_T: Incomplete +PR_EMS_AB_GARBAGE_COLL_PERIOD: Incomplete +PR_EMS_AB_GATEWAY_LOCAL_CRED: Incomplete +PR_EMS_AB_GATEWAY_LOCAL_CRED_A: Incomplete +PR_EMS_AB_GATEWAY_LOCAL_CRED_W: Incomplete +PR_EMS_AB_GATEWAY_LOCAL_DESIG: Incomplete +PR_EMS_AB_GATEWAY_LOCAL_DESIG_A: Incomplete +PR_EMS_AB_GATEWAY_LOCAL_DESIG_W: Incomplete +PR_EMS_AB_GATEWAY_PROXY: Incomplete +PR_EMS_AB_GATEWAY_PROXY_A: Incomplete +PR_EMS_AB_GATEWAY_PROXY_W: Incomplete +PR_EMS_AB_GATEWAY_ROUTING_TREE: Incomplete +PR_EMS_AB_GWART_LAST_MODIFIED: Incomplete +PR_EMS_AB_HAS_FULL_REPLICA_NCS: Incomplete +PR_EMS_AB_HAS_FULL_REPLICA_NCS_A: Incomplete +PR_EMS_AB_HAS_FULL_REPLICA_NCS_W: Incomplete +PR_EMS_AB_HAS_FULL_REPLICA_NCS_O: Incomplete +PR_EMS_AB_HAS_FULL_REPLICA_NCS_T: Incomplete +PR_EMS_AB_HAS_MASTER_NCS: Incomplete +PR_EMS_AB_HAS_MASTER_NCS_A: Incomplete +PR_EMS_AB_HAS_MASTER_NCS_W: Incomplete +PR_EMS_AB_HAS_MASTER_NCS_O: Incomplete +PR_EMS_AB_HAS_MASTER_NCS_T: Incomplete +PR_EMS_AB_HELP_DATA16: Incomplete +PR_EMS_AB_HELP_DATA32: Incomplete +PR_EMS_AB_HELP_FILE_NAME: Incomplete +PR_EMS_AB_HELP_FILE_NAME_A: Incomplete +PR_EMS_AB_HELP_FILE_NAME_W: Incomplete +PR_EMS_AB_HEURISTICS: Incomplete +PR_EMS_AB_HIDE_DL_MEMBERSHIP: Incomplete +PR_EMS_AB_HIDE_FROM_ADDRESS_BOOK: Incomplete +PR_EMS_AB_HOME_MDB: Incomplete +PR_EMS_AB_HOME_MDB_A: Incomplete +PR_EMS_AB_HOME_MDB_W: Incomplete +PR_EMS_AB_HOME_MDB_O: Incomplete +PR_EMS_AB_HOME_MDB_T: Incomplete +PR_EMS_AB_HOME_MDB_BL: Incomplete +PR_EMS_AB_HOME_MDB_BL_A: Incomplete +PR_EMS_AB_HOME_MDB_BL_W: Incomplete +PR_EMS_AB_HOME_MDB_BL_O: Incomplete +PR_EMS_AB_HOME_MDB_BL_T: Incomplete +PR_EMS_AB_HOME_MTA: Incomplete +PR_EMS_AB_HOME_MTA_A: Incomplete +PR_EMS_AB_HOME_MTA_W: Incomplete +PR_EMS_AB_HOME_MTA_O: Incomplete +PR_EMS_AB_HOME_MTA_T: Incomplete +PR_EMS_AB_HOME_PUBLIC_SERVER: Incomplete +PR_EMS_AB_HOME_PUBLIC_SERVER_A: Incomplete +PR_EMS_AB_HOME_PUBLIC_SERVER_W: Incomplete +PR_EMS_AB_HOME_PUBLIC_SERVER_O: Incomplete +PR_EMS_AB_HOME_PUBLIC_SERVER_T: Incomplete +PR_EMS_AB_IMPORT_CONTAINER: Incomplete +PR_EMS_AB_IMPORT_CONTAINER_A: Incomplete +PR_EMS_AB_IMPORT_CONTAINER_W: Incomplete +PR_EMS_AB_IMPORT_CONTAINER_O: Incomplete +PR_EMS_AB_IMPORT_CONTAINER_T: Incomplete +PR_EMS_AB_IMPORT_SENSITIVITY: Incomplete +PR_EMS_AB_IMPORTED_FROM: Incomplete +PR_EMS_AB_IMPORTED_FROM_A: Incomplete +PR_EMS_AB_IMPORTED_FROM_W: Incomplete +PR_EMS_AB_INBOUND_SITES: Incomplete +PR_EMS_AB_INBOUND_SITES_A: Incomplete +PR_EMS_AB_INBOUND_SITES_W: Incomplete +PR_EMS_AB_INBOUND_SITES_O: Incomplete +PR_EMS_AB_INBOUND_SITES_T: Incomplete +PR_EMS_AB_INSTANCE_TYPE: Incomplete +PR_EMS_AB_INTERNATIONAL_ISDN_NUMBER: Incomplete +PR_EMS_AB_INTERNATIONAL_ISDN_NUMBER_A: Incomplete +PR_EMS_AB_INTERNATIONAL_ISDN_NUMBER_W: Incomplete +PR_EMS_AB_INVOCATION_ID: Incomplete +PR_EMS_AB_IS_DELETED: Incomplete +PR_EMS_AB_IS_MEMBER_OF_DL: Incomplete +PR_EMS_AB_IS_MEMBER_OF_DL_A: Incomplete +PR_EMS_AB_IS_MEMBER_OF_DL_W: Incomplete +PR_EMS_AB_IS_MEMBER_OF_DL_O: Incomplete +PR_EMS_AB_IS_MEMBER_OF_DL_T: Incomplete +PR_EMS_AB_IS_SINGLE_VALUED: Incomplete +PR_EMS_AB_KCC_STATUS: Incomplete +PR_EMS_AB_KM_SERVER: Incomplete +PR_EMS_AB_KM_SERVER_A: Incomplete +PR_EMS_AB_KM_SERVER_W: Incomplete +PR_EMS_AB_KM_SERVER_O: Incomplete +PR_EMS_AB_KM_SERVER_T: Incomplete +PR_EMS_AB_KNOWLEDGE_INFORMATION: Incomplete +PR_EMS_AB_KNOWLEDGE_INFORMATION_A: Incomplete +PR_EMS_AB_KNOWLEDGE_INFORMATION_W: Incomplete +PR_EMS_AB_LANGUAGE: Incomplete +PR_EMS_AB_LDAP_DISPLAY_NAME: Incomplete +PR_EMS_AB_LDAP_DISPLAY_NAME_A: Incomplete +PR_EMS_AB_LDAP_DISPLAY_NAME_W: Incomplete +PR_EMS_AB_LINE_WRAP: Incomplete +PR_EMS_AB_LINK_ID: Incomplete +PR_EMS_AB_LOCAL_BRIDGE_HEAD: Incomplete +PR_EMS_AB_LOCAL_BRIDGE_HEAD_A: Incomplete +PR_EMS_AB_LOCAL_BRIDGE_HEAD_W: Incomplete +PR_EMS_AB_LOCAL_BRIDGE_HEAD_ADDRESS: Incomplete +PR_EMS_AB_LOCAL_BRIDGE_HEAD_ADDRESS_A: Incomplete +PR_EMS_AB_LOCAL_BRIDGE_HEAD_ADDRESS_W: Incomplete +PR_EMS_AB_LOCAL_INITIAL_TURN: Incomplete +PR_EMS_AB_LOCAL_SCOPE: Incomplete +PR_EMS_AB_LOCAL_SCOPE_A: Incomplete +PR_EMS_AB_LOCAL_SCOPE_W: Incomplete +PR_EMS_AB_LOCAL_SCOPE_O: Incomplete +PR_EMS_AB_LOCAL_SCOPE_T: Incomplete +PR_EMS_AB_LOG_FILENAME: Incomplete +PR_EMS_AB_LOG_FILENAME_A: Incomplete +PR_EMS_AB_LOG_FILENAME_W: Incomplete +PR_EMS_AB_LOG_ROLLOVER_INTERVAL: Incomplete +PR_EMS_AB_MAINTAIN_AUTOREPLY_HISTORY: Incomplete +PR_EMS_AB_MANAGER: Incomplete +PR_EMS_AB_MANAGER_A: Incomplete +PR_EMS_AB_MANAGER_W: Incomplete +PR_EMS_AB_MANAGER_O: Incomplete +PR_EMS_AB_MANAGER_T: Incomplete +PR_EMS_AB_MAPI_DISPLAY_TYPE: Incomplete +PR_EMS_AB_MAPI_ID: Incomplete +PR_EMS_AB_MAXIMUM_OBJECT_ID: Incomplete +PR_EMS_AB_MDB_BACKOFF_INTERVAL: Incomplete +PR_EMS_AB_MDB_MSG_TIME_OUT_PERIOD: Incomplete +PR_EMS_AB_MDB_OVER_QUOTA_LIMIT: Incomplete +PR_EMS_AB_MDB_STORAGE_QUOTA: Incomplete +PR_EMS_AB_MDB_UNREAD_LIMIT: Incomplete +PR_EMS_AB_MDB_USE_DEFAULTS: Incomplete +PR_EMS_AB_MEMBER: Incomplete +PR_EMS_AB_MEMBER_A: Incomplete +PR_EMS_AB_MEMBER_W: Incomplete +PR_EMS_AB_MEMBER_O: Incomplete +PR_EMS_AB_MEMBER_T: Incomplete +PR_EMS_AB_MESSAGE_TRACKING_ENABLED: Incomplete +PR_EMS_AB_MONITOR_CLOCK: Incomplete +PR_EMS_AB_MONITOR_SERVERS: Incomplete +PR_EMS_AB_MONITOR_SERVICES: Incomplete +PR_EMS_AB_MONITORED_CONFIGURATIONS: Incomplete +PR_EMS_AB_MONITORED_CONFIGURATIONS_A: Incomplete +PR_EMS_AB_MONITORED_CONFIGURATIONS_W: Incomplete +PR_EMS_AB_MONITORED_CONFIGURATIONS_O: Incomplete +PR_EMS_AB_MONITORED_CONFIGURATIONS_T: Incomplete +PR_EMS_AB_MONITORED_SERVERS: Incomplete +PR_EMS_AB_MONITORED_SERVERS_A: Incomplete +PR_EMS_AB_MONITORED_SERVERS_W: Incomplete +PR_EMS_AB_MONITORED_SERVERS_O: Incomplete +PR_EMS_AB_MONITORED_SERVERS_T: Incomplete +PR_EMS_AB_MONITORED_SERVICES: Incomplete +PR_EMS_AB_MONITORED_SERVICES_A: Incomplete +PR_EMS_AB_MONITORED_SERVICES_W: Incomplete +PR_EMS_AB_MONITORING_ALERT_DELAY: Incomplete +PR_EMS_AB_MONITORING_ALERT_UNITS: Incomplete +PR_EMS_AB_MONITORING_AVAILABILITY_STYLE: Incomplete +PR_EMS_AB_MONITORING_AVAILABILITY_WINDOW: Incomplete +PR_EMS_AB_MONITORING_CACHED_VIA_MAIL: Incomplete +PR_EMS_AB_MONITORING_CACHED_VIA_MAIL_A: Incomplete +PR_EMS_AB_MONITORING_CACHED_VIA_MAIL_W: Incomplete +PR_EMS_AB_MONITORING_CACHED_VIA_MAIL_O: Incomplete +PR_EMS_AB_MONITORING_CACHED_VIA_MAIL_T: Incomplete +PR_EMS_AB_MONITORING_CACHED_VIA_RPC: Incomplete +PR_EMS_AB_MONITORING_CACHED_VIA_RPC_A: Incomplete +PR_EMS_AB_MONITORING_CACHED_VIA_RPC_W: Incomplete +PR_EMS_AB_MONITORING_CACHED_VIA_RPC_O: Incomplete +PR_EMS_AB_MONITORING_CACHED_VIA_RPC_T: Incomplete +PR_EMS_AB_MONITORING_ESCALATION_PROCEDURE: Incomplete +PR_EMS_AB_MONITORING_HOTSITE_POLL_INTERVAL: Incomplete +PR_EMS_AB_MONITORING_HOTSITE_POLL_UNITS: Incomplete +PR_EMS_AB_MONITORING_MAIL_UPDATE_INTERVAL: Incomplete +PR_EMS_AB_MONITORING_MAIL_UPDATE_UNITS: Incomplete +PR_EMS_AB_MONITORING_NORMAL_POLL_INTERVAL: Incomplete +PR_EMS_AB_MONITORING_NORMAL_POLL_UNITS: Incomplete +PR_EMS_AB_MONITORING_RECIPIENTS: Incomplete +PR_EMS_AB_MONITORING_RECIPIENTS_A: Incomplete +PR_EMS_AB_MONITORING_RECIPIENTS_W: Incomplete +PR_EMS_AB_MONITORING_RECIPIENTS_O: Incomplete +PR_EMS_AB_MONITORING_RECIPIENTS_T: Incomplete +PR_EMS_AB_MONITORING_RECIPIENTS_NDR: Incomplete +PR_EMS_AB_MONITORING_RECIPIENTS_NDR_A: Incomplete +PR_EMS_AB_MONITORING_RECIPIENTS_NDR_W: Incomplete +PR_EMS_AB_MONITORING_RECIPIENTS_NDR_O: Incomplete +PR_EMS_AB_MONITORING_RECIPIENTS_NDR_T: Incomplete +PR_EMS_AB_MONITORING_RPC_UPDATE_INTERVAL: Incomplete +PR_EMS_AB_MONITORING_RPC_UPDATE_UNITS: Incomplete +PR_EMS_AB_MONITORING_WARNING_DELAY: Incomplete +PR_EMS_AB_MONITORING_WARNING_UNITS: Incomplete +PR_EMS_AB_MTA_LOCAL_CRED: Incomplete +PR_EMS_AB_MTA_LOCAL_CRED_A: Incomplete +PR_EMS_AB_MTA_LOCAL_CRED_W: Incomplete +PR_EMS_AB_MTA_LOCAL_DESIG: Incomplete +PR_EMS_AB_MTA_LOCAL_DESIG_A: Incomplete +PR_EMS_AB_MTA_LOCAL_DESIG_W: Incomplete +PR_EMS_AB_N_ADDRESS: Incomplete +PR_EMS_AB_N_ADDRESS_TYPE: Incomplete +PR_EMS_AB_NETWORK_ADDRESS: Incomplete +PR_EMS_AB_NETWORK_ADDRESS_A: Incomplete +PR_EMS_AB_NETWORK_ADDRESS_W: Incomplete +PR_EMS_AB_NNTP_CHARACTER_SET: Incomplete +PR_EMS_AB_NNTP_CHARACTER_SET_A: Incomplete +PR_EMS_AB_NNTP_CHARACTER_SET_W: Incomplete +PR_EMS_AB_NNTP_CONTENT_FORMAT: Incomplete +PR_EMS_AB_NNTP_CONTENT_FORMAT_A: Incomplete +PR_EMS_AB_NNTP_CONTENT_FORMAT_W: Incomplete +PR_EMS_AB_NT_MACHINE_NAME: Incomplete +PR_EMS_AB_NT_MACHINE_NAME_A: Incomplete +PR_EMS_AB_NT_MACHINE_NAME_W: Incomplete +PR_EMS_AB_NT_SECURITY_DESCRIPTOR: Incomplete +PR_EMS_AB_NUM_OF_OPEN_RETRIES: Incomplete +PR_EMS_AB_NUM_OF_TRANSFER_RETRIES: Incomplete +PR_EMS_AB_OBJ_DIST_NAME: Incomplete +PR_EMS_AB_OBJ_DIST_NAME_A: Incomplete +PR_EMS_AB_OBJ_DIST_NAME_W: Incomplete +PR_EMS_AB_OBJ_DIST_NAME_O: Incomplete +PR_EMS_AB_OBJ_DIST_NAME_T: Incomplete +PR_EMS_AB_OBJECT_CLASS_CATEGORY: Incomplete +PR_EMS_AB_OBJECT_VERSION: Incomplete +PR_EMS_AB_OFF_LINE_AB_CONTAINERS: Incomplete +PR_EMS_AB_OFF_LINE_AB_CONTAINERS_A: Incomplete +PR_EMS_AB_OFF_LINE_AB_CONTAINERS_W: Incomplete +PR_EMS_AB_OFF_LINE_AB_CONTAINERS_O: Incomplete +PR_EMS_AB_OFF_LINE_AB_CONTAINERS_T: Incomplete +PR_EMS_AB_OFF_LINE_AB_SCHEDULE: Incomplete +PR_EMS_AB_OFF_LINE_AB_SERVER: Incomplete +PR_EMS_AB_OFF_LINE_AB_SERVER_A: Incomplete +PR_EMS_AB_OFF_LINE_AB_SERVER_W: Incomplete +PR_EMS_AB_OFF_LINE_AB_SERVER_O: Incomplete +PR_EMS_AB_OFF_LINE_AB_SERVER_T: Incomplete +PR_EMS_AB_OFF_LINE_AB_STYLE: Incomplete +PR_EMS_AB_OID_TYPE: Incomplete +PR_EMS_AB_OM_OBJECT_CLASS: Incomplete +PR_EMS_AB_OM_SYNTAX: Incomplete +PR_EMS_AB_OOF_REPLY_TO_ORIGINATOR: Incomplete +PR_EMS_AB_OPEN_RETRY_INTERVAL: Incomplete +PR_EMS_AB_ORGANIZATION_NAME: Incomplete +PR_EMS_AB_ORGANIZATION_NAME_A: Incomplete +PR_EMS_AB_ORGANIZATION_NAME_W: Incomplete +PR_EMS_AB_ORGANIZATIONAL_UNIT_NAME: Incomplete +PR_EMS_AB_ORGANIZATIONAL_UNIT_NAME_A: Incomplete +PR_EMS_AB_ORGANIZATIONAL_UNIT_NAME_W: Incomplete +PR_EMS_AB_ORIGINAL_DISPLAY_TABLE: Incomplete +PR_EMS_AB_ORIGINAL_DISPLAY_TABLE_MSDOS: Incomplete +PR_EMS_AB_OUTBOUND_SITES: Incomplete +PR_EMS_AB_OUTBOUND_SITES_A: Incomplete +PR_EMS_AB_OUTBOUND_SITES_W: Incomplete +PR_EMS_AB_OUTBOUND_SITES_O: Incomplete +PR_EMS_AB_OUTBOUND_SITES_T: Incomplete +PR_EMS_AB_OWNER: Incomplete +PR_EMS_AB_OWNER_A: Incomplete +PR_EMS_AB_OWNER_W: Incomplete +PR_EMS_AB_OWNER_O: Incomplete +PR_EMS_AB_OWNER_T: Incomplete +PR_EMS_AB_OWNER_BL: Incomplete +PR_EMS_AB_OWNER_BL_A: Incomplete +PR_EMS_AB_OWNER_BL_W: Incomplete +PR_EMS_AB_OWNER_BL_O: Incomplete +PR_EMS_AB_OWNER_BL_T: Incomplete +PR_EMS_AB_P_SELECTOR: Incomplete +PR_EMS_AB_P_SELECTOR_INBOUND: Incomplete +PR_EMS_AB_PER_MSG_DIALOG_DISPLAY_TABLE: Incomplete +PR_EMS_AB_PER_RECIP_DIALOG_DISPLAY_TABLE: Incomplete +PR_EMS_AB_PERIOD_REP_SYNC_TIMES: Incomplete +PR_EMS_AB_PERIOD_REPL_STAGGER: Incomplete +PR_EMS_AB_PF_CONTACTS: Incomplete +PR_EMS_AB_PF_CONTACTS_A: Incomplete +PR_EMS_AB_PF_CONTACTS_W: Incomplete +PR_EMS_AB_PF_CONTACTS_O: Incomplete +PR_EMS_AB_PF_CONTACTS_T: Incomplete +PR_EMS_AB_POP_CHARACTER_SET: Incomplete +PR_EMS_AB_POP_CHARACTER_SET_A: Incomplete +PR_EMS_AB_POP_CHARACTER_SET_W: Incomplete +PR_EMS_AB_POP_CONTENT_FORMAT: Incomplete +PR_EMS_AB_POP_CONTENT_FORMAT_A: Incomplete +PR_EMS_AB_POP_CONTENT_FORMAT_W: Incomplete +PR_EMS_AB_POSTAL_ADDRESS: Incomplete +PR_EMS_AB_PREFERRED_DELIVERY_METHOD: Incomplete +PR_EMS_AB_PRMD: Incomplete +PR_EMS_AB_PRMD_A: Incomplete +PR_EMS_AB_PRMD_W: Incomplete +PR_EMS_AB_PROXY_ADDRESSES: Incomplete +PR_EMS_AB_PROXY_ADDRESSES_A: Incomplete +PR_EMS_AB_PROXY_ADDRESSES_W: Incomplete +PR_EMS_AB_PROXY_GENERATOR_DLL: Incomplete +PR_EMS_AB_PROXY_GENERATOR_DLL_A: Incomplete +PR_EMS_AB_PROXY_GENERATOR_DLL_W: Incomplete +PR_EMS_AB_PUBLIC_DELEGATES: Incomplete +PR_EMS_AB_PUBLIC_DELEGATES_A: Incomplete +PR_EMS_AB_PUBLIC_DELEGATES_W: Incomplete +PR_EMS_AB_PUBLIC_DELEGATES_O: Incomplete +PR_EMS_AB_PUBLIC_DELEGATES_T: Incomplete +PR_EMS_AB_PUBLIC_DELEGATES_BL: Incomplete +PR_EMS_AB_PUBLIC_DELEGATES_BL_A: Incomplete +PR_EMS_AB_PUBLIC_DELEGATES_BL_W: Incomplete +PR_EMS_AB_PUBLIC_DELEGATES_BL_O: Incomplete +PR_EMS_AB_PUBLIC_DELEGATES_BL_T: Incomplete +PR_EMS_AB_QUOTA_NOTIFICATION_SCHEDULE: Incomplete +PR_EMS_AB_QUOTA_NOTIFICATION_STYLE: Incomplete +PR_EMS_AB_RANGE_LOWER: Incomplete +PR_EMS_AB_RANGE_UPPER: Incomplete +PR_EMS_AB_RAS_CALLBACK_NUMBER: Incomplete +PR_EMS_AB_RAS_CALLBACK_NUMBER_A: Incomplete +PR_EMS_AB_RAS_CALLBACK_NUMBER_W: Incomplete +PR_EMS_AB_RAS_PHONE_NUMBER: Incomplete +PR_EMS_AB_RAS_PHONE_NUMBER_A: Incomplete +PR_EMS_AB_RAS_PHONE_NUMBER_W: Incomplete +PR_EMS_AB_RAS_PHONEBOOK_ENTRY_NAME: Incomplete +PR_EMS_AB_RAS_PHONEBOOK_ENTRY_NAME_A: Incomplete +PR_EMS_AB_RAS_PHONEBOOK_ENTRY_NAME_W: Incomplete +PR_EMS_AB_RAS_REMOTE_SRVR_NAME: Incomplete +PR_EMS_AB_RAS_REMOTE_SRVR_NAME_A: Incomplete +PR_EMS_AB_RAS_REMOTE_SRVR_NAME_W: Incomplete +PR_EMS_AB_REGISTERED_ADDRESS: Incomplete +PR_EMS_AB_REMOTE_BRIDGE_HEAD: Incomplete +PR_EMS_AB_REMOTE_BRIDGE_HEAD_A: Incomplete +PR_EMS_AB_REMOTE_BRIDGE_HEAD_W: Incomplete +PR_EMS_AB_REMOTE_BRIDGE_HEAD_ADDRESS: Incomplete +PR_EMS_AB_REMOTE_BRIDGE_HEAD_ADDRESS_A: Incomplete +PR_EMS_AB_REMOTE_BRIDGE_HEAD_ADDRESS_W: Incomplete +PR_EMS_AB_REMOTE_OUT_BH_SERVER: Incomplete +PR_EMS_AB_REMOTE_OUT_BH_SERVER_A: Incomplete +PR_EMS_AB_REMOTE_OUT_BH_SERVER_W: Incomplete +PR_EMS_AB_REMOTE_OUT_BH_SERVER_O: Incomplete +PR_EMS_AB_REMOTE_OUT_BH_SERVER_T: Incomplete +PR_EMS_AB_REMOTE_SITE: Incomplete +PR_EMS_AB_REMOTE_SITE_A: Incomplete +PR_EMS_AB_REMOTE_SITE_W: Incomplete +PR_EMS_AB_REMOTE_SITE_O: Incomplete +PR_EMS_AB_REMOTE_SITE_T: Incomplete +PR_EMS_AB_REPLICATION_MAIL_MSG_SIZE: Incomplete +PR_EMS_AB_REPLICATION_SENSITIVITY: Incomplete +PR_EMS_AB_REPLICATION_STAGGER: Incomplete +PR_EMS_AB_REPORT_TO_ORIGINATOR: Incomplete +PR_EMS_AB_REPORT_TO_OWNER: Incomplete +PR_EMS_AB_REPORTS: Incomplete +PR_EMS_AB_REPORTS_A: Incomplete +PR_EMS_AB_REPORTS_W: Incomplete +PR_EMS_AB_REPORTS_O: Incomplete +PR_EMS_AB_REPORTS_T: Incomplete +PR_EMS_AB_REQ_SEQ: Incomplete +PR_EMS_AB_RESPONSIBLE_LOCAL_DXA: Incomplete +PR_EMS_AB_RESPONSIBLE_LOCAL_DXA_A: Incomplete +PR_EMS_AB_RESPONSIBLE_LOCAL_DXA_W: Incomplete +PR_EMS_AB_RESPONSIBLE_LOCAL_DXA_O: Incomplete +PR_EMS_AB_RESPONSIBLE_LOCAL_DXA_T: Incomplete +PR_EMS_AB_RID_SERVER: Incomplete +PR_EMS_AB_RID_SERVER_A: Incomplete +PR_EMS_AB_RID_SERVER_W: Incomplete +PR_EMS_AB_RID_SERVER_O: Incomplete +PR_EMS_AB_RID_SERVER_T: Incomplete +PR_EMS_AB_ROLE_OCCUPANT: Incomplete +PR_EMS_AB_ROLE_OCCUPANT_A: Incomplete +PR_EMS_AB_ROLE_OCCUPANT_W: Incomplete +PR_EMS_AB_ROLE_OCCUPANT_O: Incomplete +PR_EMS_AB_ROLE_OCCUPANT_T: Incomplete +PR_EMS_AB_ROUTING_LIST: Incomplete +PR_EMS_AB_ROUTING_LIST_A: Incomplete +PR_EMS_AB_ROUTING_LIST_W: Incomplete +PR_EMS_AB_RTS_CHECKPOINT_SIZE: Incomplete +PR_EMS_AB_RTS_RECOVERY_TIMEOUT: Incomplete +PR_EMS_AB_RTS_WINDOW_SIZE: Incomplete +PR_EMS_AB_RUNS_ON: Incomplete +PR_EMS_AB_RUNS_ON_A: Incomplete +PR_EMS_AB_RUNS_ON_W: Incomplete +PR_EMS_AB_RUNS_ON_O: Incomplete +PR_EMS_AB_RUNS_ON_T: Incomplete +PR_EMS_AB_S_SELECTOR: Incomplete +PR_EMS_AB_S_SELECTOR_INBOUND: Incomplete +PR_EMS_AB_SCHEMA_FLAGS: Incomplete +PR_EMS_AB_SCHEMA_VERSION: Incomplete +PR_EMS_AB_SEARCH_FLAGS: Incomplete +PR_EMS_AB_SEARCH_GUIDE: Incomplete +PR_EMS_AB_SECURITY_PROTOCOL: Incomplete +PR_EMS_AB_SEE_ALSO: Incomplete +PR_EMS_AB_SEE_ALSO_A: Incomplete +PR_EMS_AB_SEE_ALSO_W: Incomplete +PR_EMS_AB_SEE_ALSO_O: Incomplete +PR_EMS_AB_SEE_ALSO_T: Incomplete +PR_EMS_AB_SERIAL_NUMBER: Incomplete +PR_EMS_AB_SERIAL_NUMBER_A: Incomplete +PR_EMS_AB_SERIAL_NUMBER_W: Incomplete +PR_EMS_AB_SERVICE_ACTION_FIRST: Incomplete +PR_EMS_AB_SERVICE_ACTION_OTHER: Incomplete +PR_EMS_AB_SERVICE_ACTION_SECOND: Incomplete +PR_EMS_AB_SERVICE_RESTART_DELAY: Incomplete +PR_EMS_AB_SERVICE_RESTART_MESSAGE: Incomplete +PR_EMS_AB_SERVICE_RESTART_MESSAGE_A: Incomplete +PR_EMS_AB_SERVICE_RESTART_MESSAGE_W: Incomplete +PR_EMS_AB_SESSION_DISCONNECT_TIMER: Incomplete +PR_EMS_AB_SITE_AFFINITY: Incomplete +PR_EMS_AB_SITE_AFFINITY_A: Incomplete +PR_EMS_AB_SITE_AFFINITY_W: Incomplete +PR_EMS_AB_SITE_FOLDER_GUID: Incomplete +PR_EMS_AB_SITE_FOLDER_SERVER: Incomplete +PR_EMS_AB_SITE_FOLDER_SERVER_A: Incomplete +PR_EMS_AB_SITE_FOLDER_SERVER_W: Incomplete +PR_EMS_AB_SITE_FOLDER_SERVER_O: Incomplete +PR_EMS_AB_SITE_FOLDER_SERVER_T: Incomplete +PR_EMS_AB_SITE_PROXY_SPACE: Incomplete +PR_EMS_AB_SITE_PROXY_SPACE_A: Incomplete +PR_EMS_AB_SITE_PROXY_SPACE_W: Incomplete +PR_EMS_AB_SPACE_LAST_COMPUTED: Incomplete +PR_EMS_AB_STREET_ADDRESS: Incomplete +PR_EMS_AB_STREET_ADDRESS_A: Incomplete +PR_EMS_AB_STREET_ADDRESS_W: Incomplete +PR_EMS_AB_SUB_REFS: Incomplete +PR_EMS_AB_SUB_REFS_A: Incomplete +PR_EMS_AB_SUB_REFS_W: Incomplete +PR_EMS_AB_SUB_REFS_O: Incomplete +PR_EMS_AB_SUB_REFS_T: Incomplete +PR_EMS_AB_SUB_SITE: Incomplete +PR_EMS_AB_SUB_SITE_A: Incomplete +PR_EMS_AB_SUB_SITE_W: Incomplete +PR_EMS_AB_SUBMISSION_CONT_LENGTH: Incomplete +PR_EMS_AB_SUPPORTED_APPLICATION_CONTEXT: Incomplete +PR_EMS_AB_SUPPORTING_STACK: Incomplete +PR_EMS_AB_SUPPORTING_STACK_A: Incomplete +PR_EMS_AB_SUPPORTING_STACK_W: Incomplete +PR_EMS_AB_SUPPORTING_STACK_O: Incomplete +PR_EMS_AB_SUPPORTING_STACK_T: Incomplete +PR_EMS_AB_SUPPORTING_STACK_BL: Incomplete +PR_EMS_AB_SUPPORTING_STACK_BL_A: Incomplete +PR_EMS_AB_SUPPORTING_STACK_BL_W: Incomplete +PR_EMS_AB_SUPPORTING_STACK_BL_O: Incomplete +PR_EMS_AB_SUPPORTING_STACK_BL_T: Incomplete +PR_EMS_AB_T_SELECTOR: Incomplete +PR_EMS_AB_T_SELECTOR_INBOUND: Incomplete +PR_EMS_AB_TARGET_ADDRESS: Incomplete +PR_EMS_AB_TARGET_ADDRESS_A: Incomplete +PR_EMS_AB_TARGET_ADDRESS_W: Incomplete +PR_EMS_AB_TARGET_MTAS: Incomplete +PR_EMS_AB_TARGET_MTAS_A: Incomplete +PR_EMS_AB_TARGET_MTAS_W: Incomplete +PR_EMS_AB_TELEPHONE_NUMBER: Incomplete +PR_EMS_AB_TELEPHONE_NUMBER_A: Incomplete +PR_EMS_AB_TELEPHONE_NUMBER_W: Incomplete +PR_EMS_AB_TELETEX_TERMINAL_IDENTIFIER: Incomplete +PR_EMS_AB_TEMP_ASSOC_THRESHOLD: Incomplete +PR_EMS_AB_TOMBSTONE_LIFETIME: Incomplete +PR_EMS_AB_TRACKING_LOG_PATH_NAME: Incomplete +PR_EMS_AB_TRACKING_LOG_PATH_NAME_A: Incomplete +PR_EMS_AB_TRACKING_LOG_PATH_NAME_W: Incomplete +PR_EMS_AB_TRANS_RETRY_MINS: Incomplete +PR_EMS_AB_TRANS_TIMEOUT_MINS: Incomplete +PR_EMS_AB_TRANSFER_RETRY_INTERVAL: Incomplete +PR_EMS_AB_TRANSFER_TIMEOUT_NON_URGENT: Incomplete +PR_EMS_AB_TRANSFER_TIMEOUT_NORMAL: Incomplete +PR_EMS_AB_TRANSFER_TIMEOUT_URGENT: Incomplete +PR_EMS_AB_TRANSLATION_TABLE_USED: Incomplete +PR_EMS_AB_TRANSPORT_EXPEDITED_DATA: Incomplete +PR_EMS_AB_TRUST_LEVEL: Incomplete +PR_EMS_AB_TURN_REQUEST_THRESHOLD: Incomplete +PR_EMS_AB_TWO_WAY_ALTERNATE_FACILITY: Incomplete +PR_EMS_AB_UNAUTH_ORIG_BL: Incomplete +PR_EMS_AB_UNAUTH_ORIG_BL_A: Incomplete +PR_EMS_AB_UNAUTH_ORIG_BL_W: Incomplete +PR_EMS_AB_UNAUTH_ORIG_BL_O: Incomplete +PR_EMS_AB_UNAUTH_ORIG_BL_T: Incomplete +PR_EMS_AB_USE_SERVER_VALUES: Incomplete +PR_EMS_AB_USER_PASSWORD: Incomplete +PR_EMS_AB_USN_CHANGED: Incomplete +PR_EMS_AB_USN_CREATED: Incomplete +PR_EMS_AB_USN_DSA_LAST_OBJ_REMOVED: Incomplete +PR_EMS_AB_USN_INTERSITE: Incomplete +PR_EMS_AB_USN_LAST_OBJ_REM: Incomplete +PR_EMS_AB_USN_SOURCE: Incomplete +PR_EMS_AB_WWW_HOME_PAGE: Incomplete +PR_EMS_AB_WWW_HOME_PAGE_A: Incomplete +PR_EMS_AB_WWW_HOME_PAGE_W: Incomplete +PR_EMS_AB_X121_ADDRESS: Incomplete +PR_EMS_AB_X121_ADDRESS_A: Incomplete +PR_EMS_AB_X121_ADDRESS_W: Incomplete +PR_EMS_AB_X25_CALL_USER_DATA_INCOMING: Incomplete +PR_EMS_AB_X25_CALL_USER_DATA_OUTGOING: Incomplete +PR_EMS_AB_X25_FACILITIES_DATA_INCOMING: Incomplete +PR_EMS_AB_X25_FACILITIES_DATA_OUTGOING: Incomplete +PR_EMS_AB_X25_LEASED_LINE_PORT: Incomplete +PR_EMS_AB_X25_LEASED_OR_SWITCHED: Incomplete +PR_EMS_AB_X25_REMOTE_MTA_PHONE: Incomplete +PR_EMS_AB_X25_REMOTE_MTA_PHONE_A: Incomplete +PR_EMS_AB_X25_REMOTE_MTA_PHONE_W: Incomplete +PR_EMS_AB_X400_ATTACHMENT_TYPE: Incomplete +PR_EMS_AB_X400_SELECTOR_SYNTAX: Incomplete +PR_EMS_AB_X500_ACCESS_CONTROL_LIST: Incomplete +PR_EMS_AB_XMIT_TIMEOUT_NON_URGENT: Incomplete +PR_EMS_AB_XMIT_TIMEOUT_NORMAL: Incomplete +PR_EMS_AB_XMIT_TIMEOUT_URGENT: Incomplete diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/mapi/exchange.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/mapi/exchange.pyi new file mode 100644 index 000000000..ac1a9741b --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/mapi/exchange.pyi @@ -0,0 +1,9 @@ +import _win32typing + +OPENSTORE_HOME_LOGON: int +OPENSTORE_OVERRIDE_HOME_MDB: int +OPENSTORE_PUBLIC: int +OPENSTORE_TAKE_OWNERSHIP: int +OPENSTORE_USE_ADMIN_PRIVILEGE: int +IID_IExchangeManageStore: _win32typing.PyIID +IID_IExchangeManageStoreEx: _win32typing.PyIID diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/mapi/mapi.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/mapi/mapi.pyi new file mode 100644 index 000000000..2eddb48b5 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/mapi/mapi.pyi @@ -0,0 +1,331 @@ +from _typeshed import Incomplete + +import _win32typing + +def HexFromBin(val: str) -> str: ... +def BinFromHex(val: str) -> str: ... +def MAPIUninitialize() -> None: ... +def MAPIInitialize(init: _win32typing.MAPIINIT_0) -> None: ... +def MAPILogonEx(uiParam, profileName: str, password: str | None = ..., flags=...) -> _win32typing.PyIMAPISession: ... +def MAPIAdminProfiles(fFlags) -> _win32typing.PyIProfAdmin: ... +def HrQueryAllRows( + table: _win32typing.PyIMAPITable, + properties: _win32typing.PySPropTagArray, + restrictions: _win32typing.PySRestriction, + sortOrderSet: _win32typing.PySSortOrderSet, + rowsMax, +): ... +def RTFSync(message: _win32typing.PyIMessage, flags): ... +def WrapCompressedRTFStream(stream: _win32typing.PyIStream, flags) -> _win32typing.PyIStream: ... +def WrapCompressedRTFStreamEx() -> tuple[_win32typing.PyIStream, Incomplete]: ... +def OpenIMsgSession(): ... +def CloseIMsgSession() -> None: ... +def OpenIMsgOnIStg( + session, + support, + storage: _win32typing.PyIStorage, + callback: Incomplete | None = ..., + callbackData: int = ..., + flags: int = ..., +) -> _win32typing.PyIMessage: ... +def RTFStreamToHTML(The_stream_to_read_the_uncompressed_RTF_from: _win32typing.PyIStream) -> None: ... +def OpenStreamOnFile(filename: str, flags: int = ..., prefix: str | None = ...) -> _win32typing.PyIStream: ... +def OpenStreamOnFileW(filename, flags: int = ..., prefix: Incomplete | None = ...) -> _win32typing.PyIStream: ... +def HrGetOneProp(prop: _win32typing.PyIMAPIProp, propTag): ... +def HrSetOneProp(prop: _win32typing.PyIMAPIProp, propValue: _win32typing.PySPropValue): ... +def HrAllocAdviseSink(callback, context): ... +def HrThisThreadAdviseSink(_object): ... +def HrDispatchNotifications(*args, **kwargs): ... # incomplete +def MAPIUIDFromBinary(*args, **kwargs): ... # incomplete + +AB_NO_DIALOG: int +ATTACH_BY_REF_ONLY: int +ATTACH_BY_REF_RESOLVE: int +ATTACH_BY_REFERENCE: int +ATTACH_BY_VALUE: int +ATTACH_EMBEDDED_MSG: int +ATTACH_OLE: int +BMR_EQZ: int +BMR_NEZ: int +BOOKMARK_BEGINNING: int +BOOKMARK_CURRENT: int +BOOKMARK_END: int +CCSF_8BITHEADERS: int +CCSF_EMBEDDED_MESSAGE: int +CCSF_INCLUDE_BCC: int +CCSF_NO_MSGID: int +CCSF_NOHEADERS: int +CCSF_PLAIN_TEXT_ONLY: int +CCSF_PRESERVE_SOURCE: int +CCSF_SMTP: int +CCSF_USE_RTF: int +CCSF_USE_TNEF: int +CLEAR_NRN_PENDING: int +CLEAR_READ_FLAG: int +CLEAR_RN_PENDING: int +CONVENIENT_DEPTH: int +DEL_FOLDERS: int +DEL_MESSAGES: int +DELETE_HARD_DELETE: int +DIR_BACKWARD: int +FL_FULLSTRING: int +FL_IGNORECASE: int +FL_IGNORENONSPACE: int +FL_LOOSE: int +FL_PREFIX: int +FL_SUBSTRING: int +FLUSH_ASYNC_OK: int +FLUSH_DOWNLOAD: int +FLUSH_FORCE: int +FLUSH_NO_UI: int +FLUSH_UPLOAD: int +fnevCriticalError: int +fnevExtended: int +fnevNewMail: int +fnevObjectCopied: int +fnevObjectCreated: int +fnevObjectDeleted: int +fnevObjectModified: int +fnevObjectMoved: int +fnevReservedForMapi: int +fnevSearchComplete: int +fnevStatusObjectModified: int +fnevTableModified: int +FOLDER_DIALOG: int +FOLDER_GENERIC: int +FOLDER_SEARCH: int +FORCE_SAVE: int +GENERATE_RECEIPT_ONLY: int +KEEP_OPEN_READONLY: int +KEEP_OPEN_READWRITE: int +MAIL_E_NAMENOTFOUND: int +MAPI_ABCONT: int +MAPI_ADDRBOOK: int +MAPI_ALLOW_OTHERS: int +MAPI_ASSOCIATED: int +MAPI_ATTACH: int +MAPI_BCC: int +MAPI_BEST_ACCESS: int +MAPI_CC: int +MAPI_CREATE: int +MAPI_DEFAULT_SERVICES: int +MAPI_DEFERRED_ERRORS: int +MAPI_DIALOG: int +MAPI_E_ACCOUNT_DISABLED: int +MAPI_E_AMBIGUOUS_RECIP: int +MAPI_E_BAD_CHARWIDTH: int +MAPI_E_BAD_COLUMN: int +MAPI_E_BAD_VALUE: int +MAPI_E_BUSY: int +MAPI_E_CALL_FAILED: int +MAPI_E_CANCEL: int +MAPI_E_COLLISION: int +MAPI_E_COMPUTED: int +MAPI_E_CORRUPT_DATA: int +MAPI_E_CORRUPT_STORE: int +MAPI_E_DECLINE_COPY: int +MAPI_E_DISK_ERROR: int +MAPI_E_END_OF_SESSION: int +MAPI_E_EXTENDED_ERROR: int +MAPI_E_FAILONEPROVIDER: int +MAPI_E_FOLDER_CYCLE: int +MAPI_E_HAS_FOLDERS: int +MAPI_E_HAS_MESSAGES: int +MAPI_E_INTERFACE_NOT_SUPPORTED: int +MAPI_E_INVALID_ACCESS_TIME: int +MAPI_E_INVALID_BOOKMARK: int +MAPI_E_INVALID_ENTRYID: int +MAPI_E_INVALID_OBJECT: int +MAPI_E_INVALID_PARAMETER: int +MAPI_E_INVALID_TYPE: int +MAPI_E_INVALID_WORKSTATION_ACCOUNT: int +MAPI_E_LOCKID_LIMIT: int +MAPI_E_LOGON_FAILED: int +MAPI_E_MISSING_REQUIRED_COLUMN: int +MAPI_E_NAMED_PROP_QUOTA_EXCEEDED: int +MAPI_E_NETWORK_ERROR: int +MAPI_E_NO_ACCESS: int +MAPI_E_NO_RECIPIENTS: int +MAPI_E_NO_SUPPORT: int +MAPI_E_NO_SUPPRESS: int +MAPI_E_NON_STANDARD: int +MAPI_E_NOT_ENOUGH_DISK: int +MAPI_E_NOT_ENOUGH_MEMORY: int +MAPI_E_NOT_ENOUGH_RESOURCES: int +MAPI_E_NOT_FOUND: int +MAPI_E_NOT_IN_QUEUE: int +MAPI_E_NOT_INITIALIZED: int +MAPI_E_NOT_ME: int +MAPI_E_OBJECT_CHANGED: int +MAPI_E_OBJECT_DELETED: int +MAPI_E_OFFLINE: int +MAPI_E_PASSWORD_CHANGE_REQUIRED: int +MAPI_E_PASSWORD_EXPIRED: int +MAPI_E_PROFILE_DELETED: int +MAPI_E_RECONNECTED: int +MAPI_E_SESSION_LIMIT: int +MAPI_E_STORE_FULL: int +MAPI_E_STRING_TOO_LONG: int +MAPI_E_SUBMITTED: int +MAPI_E_TABLE_EMPTY: int +MAPI_E_TABLE_TOO_BIG: int +MAPI_E_TIMEOUT: int +MAPI_E_TOO_BIG: int +MAPI_E_TOO_COMPLEX: int +MAPI_E_TYPE_NO_SUPPORT: int +MAPI_E_UNABLE_TO_ABORT: int +MAPI_E_UNABLE_TO_COMPLETE: int +MAPI_E_UNCONFIGURED: int +MAPI_E_UNEXPECTED_ID: int +MAPI_E_UNEXPECTED_TYPE: int +MAPI_E_UNKNOWN_CPID: int +MAPI_E_UNKNOWN_ENTRYID: int +MAPI_E_UNKNOWN_FLAGS: int +MAPI_E_UNKNOWN_LCID: int +MAPI_E_USER_CANCEL: int +MAPI_E_VERSION: int +MAPI_E_WAIT: int +MAPI_EXPLICIT_PROFILE: int +MAPI_EXTENDED: int +MAPI_FOLDER: int +MAPI_FORCE_ACCESS: int +MAPI_FORCE_DOWNLOAD: int +MAPI_FORMINFO: int +MAPI_INIT_VERSION: int +MAPI_LOGON_UI: int +MAPI_MAILUSER: int +MAPI_MESSAGE: int +MAPI_MODIFY: int +MAPI_MOVE: int +MAPI_MULTITHREAD_NOTIFICATIONS: int +MAPI_NATIVE_BODY: int +MAPI_NATIVE_BODY_TYPE_HTML: int +MAPI_NATIVE_BODY_TYPE_PLAINTEXT: int +MAPI_NATIVE_BODY_TYPE_RTF: int +MAPI_NEW_SESSION: int +MAPI_NO_IDS: int +MAPI_NO_MAIL: int +MAPI_NO_STRINGS: int +MAPI_NOREPLACE: int +MAPI_NT_SERVICE: int +MAPI_P1: int +MAPI_PASSWORD_UI: int +MAPI_PROFSECT: int +MAPI_SERVICE_UI_ALWAYS: int +MAPI_SESSION: int +MAPI_STATUS: int +MAPI_STORE: int +MAPI_SUBMITTED: int +MAPI_TIMEOUT_SHORT: int +MAPI_TO: int +MAPI_UNICODE: int +MAPI_USE_DEFAULT: int +MAPI_W_APPROX_COUNT: int +MAPI_W_CANCEL_MESSAGE: int +MAPI_W_ERRORS_RETURNED: int +MAPI_W_NO_SERVICE: int +MAPI_W_PARTIAL_COMPLETION: int +MAPI_W_POSITION_CHANGED: int +MDB_NO_DIALOG: int +MDB_NO_MAIL: int +MDB_TEMPORARY: int +MDB_WRITE: int +MESSAGE_DIALOG: int +MODRECIP_ADD: int +MODRECIP_MODIFY: int +MODRECIP_REMOVE: int +NO_ATTACHMENT: int +OPEN_IF_EXISTS: int +PSTF_BEST_ENCRYPTION: int +PSTF_COMPRESSABLE_ENCRYPTION: int +PSTF_NO_ENCRYPTION: int +RELOP_EQ: int +RELOP_GE: int +RELOP_GT: int +RELOP_LE: int +RELOP_LT: int +RELOP_NE: int +RELOP_RE: int +RES_AND: int +RES_BITMASK: int +RES_COMMENT: int +RES_COMPAREPROPS: int +RES_CONTENT: int +RES_EXIST: int +RES_NOT: int +RES_OR: int +RES_PROPERTY: int +RES_SIZE: int +RES_SUBRESTRICTION: int +RTF_SYNC_BODY_CHANGED: int +RTF_SYNC_RTF_CHANGED: int +SERVICE_UI_ALLOWED: int +SERVICE_UI_ALWAYS: int +SHOW_SOFT_DELETES: int +SOF_UNIQUEFILENAME: int +STATUS_DEFAULT_STORE: int +STATUS_FLUSH_QUEUES: int +STATUS_INBOUND_FLUSH: int +STATUS_OUTBOUND_FLUSH: int +SUPPRESS_RECEIPT: int +TABLE_CHANGED: int +TABLE_ERROR: int +TABLE_RELOAD: int +TABLE_RESTRICT_DONE: int +TABLE_ROW_ADDED: int +TABLE_ROW_DELETED: int +TABLE_ROW_MODIFIED: int +TABLE_SETCOL_DONE: int +TABLE_SORT_ASCEND: int +TABLE_SORT_COMBINE: int +TABLE_SORT_DESCEND: int +TABLE_SORT_DONE: int +TBL_ALL_COLUMNS: int +TBL_ASYNC: int +TBL_BATCH: int +CLSID_IConverterSession: _win32typing.PyIID +CLSID_MailMessage: _win32typing.PyIID +IID_IABContainer: _win32typing.PyIID +IID_IAddrBook: _win32typing.PyIID +IID_IAttachment: _win32typing.PyIID +IID_IConverterSession: _win32typing.PyIID +IID_IDistList: _win32typing.PyIID +IID_IMAPIAdviseSink: _win32typing.PyIID +IID_IMAPIContainer: _win32typing.PyIID +IID_IMAPIFolder: _win32typing.PyIID +IID_IMAPIProp: _win32typing.PyIID +IID_IMAPISession: _win32typing.PyIID +IID_IMAPIStatus: _win32typing.PyIID +IID_IMAPITable: _win32typing.PyIID +IID_IMailUser: _win32typing.PyIID +IID_IMessage: _win32typing.PyIID +IID_IMsgServiceAdmin: _win32typing.PyIID +IID_IMsgServiceAdmin2: _win32typing.PyIID +IID_IMsgStore: _win32typing.PyIID +IID_IProfAdmin: _win32typing.PyIID +IID_IProfSect: _win32typing.PyIID +IID_IProviderAdmin: _win32typing.PyIID +MAPI_DISTLIST: int +MSPST_UID_PROVIDER: _win32typing.PyIID +PSETID_Address: _win32typing.PyIID +PSETID_AirSync: _win32typing.PyIID +PSETID_Appointment: _win32typing.PyIID +PSETID_Common: _win32typing.PyIID +PSETID_Log: _win32typing.PyIID +PSETID_Meeting: _win32typing.PyIID +PSETID_Messaging: _win32typing.PyIID +PSETID_Note: _win32typing.PyIID +PSETID_PostRss: _win32typing.PyIID +PSETID_Remote: _win32typing.PyIID +PSETID_Report: _win32typing.PyIID +PSETID_Sharing: _win32typing.PyIID +PSETID_Task: _win32typing.PyIID +PSETID_UnifiedMessaging: _win32typing.PyIID +PS_INTERNET_HEADERS: _win32typing.PyIID +PS_MAPI: _win32typing.PyIID +PS_PUBLIC_STRINGS: _win32typing.PyIID +PS_ROUTING_ADDRTYPE: _win32typing.PyIID +PS_ROUTING_DISPLAY_NAME: _win32typing.PyIID +PS_ROUTING_EMAIL_ADDRESSES: _win32typing.PyIID +PS_ROUTING_ENTRYID: _win32typing.PyIID +PS_ROUTING_SEARCH_KEY: _win32typing.PyIID diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/mapi/mapitags.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/mapi/mapitags.pyi new file mode 100644 index 000000000..660f492e9 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/mapi/mapitags.pyi @@ -0,0 +1,991 @@ +MV_FLAG: int +PT_UNSPECIFIED: int +PT_NULL: int +PT_I2: int +PT_LONG: int +PT_R4: int +PT_DOUBLE: int +PT_CURRENCY: int +PT_APPTIME: int +PT_ERROR: int +PT_BOOLEAN: int +PT_OBJECT: int +PT_I8: int +PT_STRING8: int +PT_UNICODE: int +PT_SYSTIME: int +PT_CLSID: int +PT_BINARY: int +PT_SHORT: int +PT_I4: int +PT_FLOAT: int +PT_R8: int +PT_LONGLONG: int +PT_MV_I2: int +PT_MV_LONG: int +PT_MV_R4: int +PT_MV_DOUBLE: int +PT_MV_CURRENCY: int +PT_MV_APPTIME: int +PT_MV_SYSTIME: int +PT_MV_STRING8: int +PT_MV_BINARY: int +PT_MV_UNICODE: int +PT_MV_CLSID: int +PT_MV_I8: int +PT_MV_SHORT: int +PT_MV_I4: int +PT_MV_FLOAT: int +PT_MV_R8: int +PT_MV_LONGLONG: int +PT_TSTRING: int +PT_MV_TSTRING: int +PROP_TYPE_MASK: int + +def PROP_TYPE(ulPropTag: int) -> int: ... +def PROP_ID(ulPropTag: int) -> int: ... +def PROP_TAG(ulPropType: int, ulPropID: int) -> int: ... + +PROP_ID_NULL: int +PROP_ID_INVALID: int +PR_NULL: int +PR_ACKNOWLEDGEMENT_MODE: int +PR_ALTERNATE_RECIPIENT_ALLOWED: int +PR_AUTHORIZING_USERS: int +PR_AUTO_FORWARD_COMMENT: int +PR_AUTO_FORWARD_COMMENT_W: int +PR_AUTO_FORWARD_COMMENT_A: int +PR_AUTO_FORWARDED: int +PR_CONTENT_CONFIDENTIALITY_ALGORITHM_ID: int +PR_CONTENT_CORRELATOR: int +PR_CONTENT_IDENTIFIER: int +PR_CONTENT_IDENTIFIER_W: int +PR_CONTENT_IDENTIFIER_A: int +PR_CONTENT_LENGTH: int +PR_CONTENT_RETURN_REQUESTED: int +PR_CONVERSATION_KEY: int +PR_CONVERSION_EITS: int +PR_CONVERSION_WITH_LOSS_PROHIBITED: int +PR_CONVERTED_EITS: int +PR_DEFERRED_DELIVERY_TIME: int +PR_DELIVER_TIME: int +PR_DISCARD_REASON: int +PR_DISCLOSURE_OF_RECIPIENTS: int +PR_DL_EXPANSION_HISTORY: int +PR_DL_EXPANSION_PROHIBITED: int +PR_EXPIRY_TIME: int +PR_IMPLICIT_CONVERSION_PROHIBITED: int +PR_IMPORTANCE: int +PR_IPM_ID: int +PR_LATEST_DELIVERY_TIME: int +PR_MESSAGE_CLASS: int +PR_MESSAGE_CLASS_W: int +PR_MESSAGE_CLASS_A: int +PR_MESSAGE_DELIVERY_ID: int +PR_MESSAGE_SECURITY_LABEL: int +PR_OBSOLETED_IPMS: int +PR_ORIGINALLY_INTENDED_RECIPIENT_NAME: int +PR_ORIGINAL_EITS: int +PR_ORIGINATOR_CERTIFICATE: int +PR_ORIGINATOR_DELIVERY_REPORT_REQUESTED: int +PR_ORIGINATOR_RETURN_ADDRESS: int +PR_PARENT_KEY: int +PR_PRIORITY: int +PR_ORIGIN_CHECK: int +PR_PROOF_OF_SUBMISSION_REQUESTED: int +PR_READ_RECEIPT_REQUESTED: int +PR_RECEIPT_TIME: int +PR_RECIPIENT_REASSIGNMENT_PROHIBITED: int +PR_REDIRECTION_HISTORY: int +PR_RELATED_IPMS: int +PR_ORIGINAL_SENSITIVITY: int +PR_LANGUAGES: int +PR_LANGUAGES_W: int +PR_LANGUAGES_A: int +PR_REPLY_TIME: int +PR_REPORT_TAG: int +PR_REPORT_TIME: int +PR_RETURNED_IPM: int +PR_SECURITY: int +PR_INCOMPLETE_COPY: int +PR_SENSITIVITY: int +PR_SUBJECT: int +PR_SUBJECT_W: int +PR_SUBJECT_A: int +PR_SUBJECT_IPM: int +PR_CLIENT_SUBMIT_TIME: int +PR_REPORT_NAME: int +PR_REPORT_NAME_W: int +PR_REPORT_NAME_A: int +PR_SENT_REPRESENTING_SEARCH_KEY: int +PR_X400_CONTENT_TYPE: int +PR_SUBJECT_PREFIX: int +PR_SUBJECT_PREFIX_W: int +PR_SUBJECT_PREFIX_A: int +PR_NON_RECEIPT_REASON: int +PR_RECEIVED_BY_ENTRYID: int +PR_RECEIVED_BY_NAME: int +PR_RECEIVED_BY_NAME_W: int +PR_RECEIVED_BY_NAME_A: int +PR_SENT_REPRESENTING_ENTRYID: int +PR_SENT_REPRESENTING_NAME: int +PR_SENT_REPRESENTING_NAME_W: int +PR_SENT_REPRESENTING_NAME_A: int +PR_RCVD_REPRESENTING_ENTRYID: int +PR_RCVD_REPRESENTING_NAME: int +PR_RCVD_REPRESENTING_NAME_W: int +PR_RCVD_REPRESENTING_NAME_A: int +PR_REPORT_ENTRYID: int +PR_READ_RECEIPT_ENTRYID: int +PR_MESSAGE_SUBMISSION_ID: int +PR_PROVIDER_SUBMIT_TIME: int +PR_ORIGINAL_SUBJECT: int +PR_ORIGINAL_SUBJECT_W: int +PR_ORIGINAL_SUBJECT_A: int +PR_DISC_VAL: int +PR_ORIG_MESSAGE_CLASS: int +PR_ORIG_MESSAGE_CLASS_W: int +PR_ORIG_MESSAGE_CLASS_A: int +PR_ORIGINAL_AUTHOR_ENTRYID: int +PR_ORIGINAL_AUTHOR_NAME: int +PR_ORIGINAL_AUTHOR_NAME_W: int +PR_ORIGINAL_AUTHOR_NAME_A: int +PR_ORIGINAL_SUBMIT_TIME: int +PR_REPLY_RECIPIENT_ENTRIES: int +PR_REPLY_RECIPIENT_NAMES: int +PR_REPLY_RECIPIENT_NAMES_W: int +PR_REPLY_RECIPIENT_NAMES_A: int +PR_RECEIVED_BY_SEARCH_KEY: int +PR_RCVD_REPRESENTING_SEARCH_KEY: int +PR_READ_RECEIPT_SEARCH_KEY: int +PR_REPORT_SEARCH_KEY: int +PR_ORIGINAL_DELIVERY_TIME: int +PR_ORIGINAL_AUTHOR_SEARCH_KEY: int +PR_MESSAGE_TO_ME: int +PR_MESSAGE_CC_ME: int +PR_MESSAGE_RECIP_ME: int +PR_ORIGINAL_SENDER_NAME: int +PR_ORIGINAL_SENDER_NAME_W: int +PR_ORIGINAL_SENDER_NAME_A: int +PR_ORIGINAL_SENDER_ENTRYID: int +PR_ORIGINAL_SENDER_SEARCH_KEY: int +PR_ORIGINAL_SENT_REPRESENTING_NAME: int +PR_ORIGINAL_SENT_REPRESENTING_NAME_W: int +PR_ORIGINAL_SENT_REPRESENTING_NAME_A: int +PR_ORIGINAL_SENT_REPRESENTING_ENTRYID: int +PR_ORIGINAL_SENT_REPRESENTING_SEARCH_KEY: int +PR_START_DATE: int +PR_END_DATE: int +PR_OWNER_APPT_ID: int +PR_RESPONSE_REQUESTED: int +PR_SENT_REPRESENTING_ADDRTYPE: int +PR_SENT_REPRESENTING_ADDRTYPE_W: int +PR_SENT_REPRESENTING_ADDRTYPE_A: int +PR_SENT_REPRESENTING_EMAIL_ADDRESS: int +PR_SENT_REPRESENTING_EMAIL_ADDRESS_W: int +PR_SENT_REPRESENTING_EMAIL_ADDRESS_A: int +PR_ORIGINAL_SENDER_ADDRTYPE: int +PR_ORIGINAL_SENDER_ADDRTYPE_W: int +PR_ORIGINAL_SENDER_ADDRTYPE_A: int +PR_ORIGINAL_SENDER_EMAIL_ADDRESS: int +PR_ORIGINAL_SENDER_EMAIL_ADDRESS_W: int +PR_ORIGINAL_SENDER_EMAIL_ADDRESS_A: int +PR_ORIGINAL_SENT_REPRESENTING_ADDRTYPE: int +PR_ORIGINAL_SENT_REPRESENTING_ADDRTYPE_W: int +PR_ORIGINAL_SENT_REPRESENTING_ADDRTYPE_A: int +PR_ORIGINAL_SENT_REPRESENTING_EMAIL_ADDRESS: int +PR_ORIGINAL_SENT_REPRESENTING_EMAIL_ADDRESS_W: int +PR_ORIGINAL_SENT_REPRESENTING_EMAIL_ADDRESS_A: int +PR_CONVERSATION_TOPIC: int +PR_CONVERSATION_TOPIC_W: int +PR_CONVERSATION_TOPIC_A: int +PR_CONVERSATION_INDEX: int +PR_ORIGINAL_DISPLAY_BCC: int +PR_ORIGINAL_DISPLAY_BCC_W: int +PR_ORIGINAL_DISPLAY_BCC_A: int +PR_ORIGINAL_DISPLAY_CC: int +PR_ORIGINAL_DISPLAY_CC_W: int +PR_ORIGINAL_DISPLAY_CC_A: int +PR_ORIGINAL_DISPLAY_TO: int +PR_ORIGINAL_DISPLAY_TO_W: int +PR_ORIGINAL_DISPLAY_TO_A: int +PR_RECEIVED_BY_ADDRTYPE: int +PR_RECEIVED_BY_ADDRTYPE_W: int +PR_RECEIVED_BY_ADDRTYPE_A: int +PR_RECEIVED_BY_EMAIL_ADDRESS: int +PR_RECEIVED_BY_EMAIL_ADDRESS_W: int +PR_RECEIVED_BY_EMAIL_ADDRESS_A: int +PR_RCVD_REPRESENTING_ADDRTYPE: int +PR_RCVD_REPRESENTING_ADDRTYPE_W: int +PR_RCVD_REPRESENTING_ADDRTYPE_A: int +PR_RCVD_REPRESENTING_EMAIL_ADDRESS: int +PR_RCVD_REPRESENTING_EMAIL_ADDRESS_W: int +PR_RCVD_REPRESENTING_EMAIL_ADDRESS_A: int +PR_ORIGINAL_AUTHOR_ADDRTYPE: int +PR_ORIGINAL_AUTHOR_ADDRTYPE_W: int +PR_ORIGINAL_AUTHOR_ADDRTYPE_A: int +PR_ORIGINAL_AUTHOR_EMAIL_ADDRESS: int +PR_ORIGINAL_AUTHOR_EMAIL_ADDRESS_W: int +PR_ORIGINAL_AUTHOR_EMAIL_ADDRESS_A: int +PR_ORIGINALLY_INTENDED_RECIP_ADDRTYPE: int +PR_ORIGINALLY_INTENDED_RECIP_ADDRTYPE_W: int +PR_ORIGINALLY_INTENDED_RECIP_ADDRTYPE_A: int +PR_ORIGINALLY_INTENDED_RECIP_EMAIL_ADDRESS: int +PR_ORIGINALLY_INTENDED_RECIP_EMAIL_ADDRESS_W: int +PR_ORIGINALLY_INTENDED_RECIP_EMAIL_ADDRESS_A: int +PR_TRANSPORT_MESSAGE_HEADERS: int +PR_TRANSPORT_MESSAGE_HEADERS_W: int +PR_TRANSPORT_MESSAGE_HEADERS_A: int +PR_DELEGATION: int +PR_TNEF_CORRELATION_KEY: int +PR_BODY: int +PR_BODY_W: int +PR_BODY_A: int +PR_BODY_HTML: int +PR_BODY_HTML_W: int +PR_BODY_HTML_A: int +PR_REPORT_TEXT: int +PR_REPORT_TEXT_W: int +PR_REPORT_TEXT_A: int +PR_ORIGINATOR_AND_DL_EXPANSION_HISTORY: int +PR_REPORTING_DL_NAME: int +PR_REPORTING_MTA_CERTIFICATE: int +PR_RTF_SYNC_BODY_CRC: int +PR_RTF_SYNC_BODY_COUNT: int +PR_RTF_SYNC_BODY_TAG: int +PR_RTF_SYNC_BODY_TAG_W: int +PR_RTF_SYNC_BODY_TAG_A: int +PR_RTF_COMPRESSED: int +PR_RTF_SYNC_PREFIX_COUNT: int +PR_RTF_SYNC_TRAILING_COUNT: int +PR_ORIGINALLY_INTENDED_RECIP_ENTRYID: int +PR_CONTENT_INTEGRITY_CHECK: int +PR_EXPLICIT_CONVERSION: int +PR_IPM_RETURN_REQUESTED: int +PR_MESSAGE_TOKEN: int +PR_NDR_REASON_CODE: int +PR_NDR_DIAG_CODE: int +PR_NON_RECEIPT_NOTIFICATION_REQUESTED: int +PR_DELIVERY_POINT: int +PR_ORIGINATOR_NON_DELIVERY_REPORT_REQUESTED: int +PR_ORIGINATOR_REQUESTED_ALTERNATE_RECIPIENT: int +PR_PHYSICAL_DELIVERY_BUREAU_FAX_DELIVERY: int +PR_PHYSICAL_DELIVERY_MODE: int +PR_PHYSICAL_DELIVERY_REPORT_REQUEST: int +PR_PHYSICAL_FORWARDING_ADDRESS: int +PR_PHYSICAL_FORWARDING_ADDRESS_REQUESTED: int +PR_PHYSICAL_FORWARDING_PROHIBITED: int +PR_PHYSICAL_RENDITION_ATTRIBUTES: int +PR_PROOF_OF_DELIVERY: int +PR_PROOF_OF_DELIVERY_REQUESTED: int +PR_RECIPIENT_CERTIFICATE: int +PR_RECIPIENT_NUMBER_FOR_ADVICE: int +PR_RECIPIENT_NUMBER_FOR_ADVICE_W: int +PR_RECIPIENT_NUMBER_FOR_ADVICE_A: int +PR_RECIPIENT_TYPE: int +PR_REGISTERED_MAIL_TYPE: int +PR_REPLY_REQUESTED: int +PR_REQUESTED_DELIVERY_METHOD: int +PR_SENDER_ENTRYID: int +PR_SENDER_NAME: int +PR_SENDER_NAME_W: int +PR_SENDER_NAME_A: int +PR_SUPPLEMENTARY_INFO: int +PR_SUPPLEMENTARY_INFO_W: int +PR_SUPPLEMENTARY_INFO_A: int +PR_TYPE_OF_MTS_USER: int +PR_SENDER_SEARCH_KEY: int +PR_SENDER_ADDRTYPE: int +PR_SENDER_ADDRTYPE_W: int +PR_SENDER_ADDRTYPE_A: int +PR_SENDER_EMAIL_ADDRESS: int +PR_SENDER_EMAIL_ADDRESS_W: int +PR_SENDER_EMAIL_ADDRESS_A: int +PR_CURRENT_VERSION: int +PR_DELETE_AFTER_SUBMIT: int +PR_DISPLAY_BCC: int +PR_DISPLAY_BCC_W: int +PR_DISPLAY_BCC_A: int +PR_DISPLAY_CC: int +PR_DISPLAY_CC_W: int +PR_DISPLAY_CC_A: int +PR_DISPLAY_TO: int +PR_DISPLAY_TO_W: int +PR_DISPLAY_TO_A: int +PR_PARENT_DISPLAY: int +PR_PARENT_DISPLAY_W: int +PR_PARENT_DISPLAY_A: int +PR_MESSAGE_DELIVERY_TIME: int +PR_MESSAGE_FLAGS: int +PR_MESSAGE_SIZE: int +PR_PARENT_ENTRYID: int +PR_SENTMAIL_ENTRYID: int +PR_CORRELATE: int +PR_CORRELATE_MTSID: int +PR_DISCRETE_VALUES: int +PR_RESPONSIBILITY: int +PR_SPOOLER_STATUS: int +PR_TRANSPORT_STATUS: int +PR_MESSAGE_RECIPIENTS: int +PR_MESSAGE_ATTACHMENTS: int +PR_SUBMIT_FLAGS: int +PR_RECIPIENT_STATUS: int +PR_TRANSPORT_KEY: int +PR_MSG_STATUS: int +PR_MESSAGE_DOWNLOAD_TIME: int +PR_CREATION_VERSION: int +PR_MODIFY_VERSION: int +PR_HASATTACH: int +PR_BODY_CRC: int +PR_NORMALIZED_SUBJECT: int +PR_NORMALIZED_SUBJECT_W: int +PR_NORMALIZED_SUBJECT_A: int +PR_RTF_IN_SYNC: int +PR_ATTACH_SIZE: int +PR_ATTACH_NUM: int +PR_PREPROCESS: int +PR_ORIGINATING_MTA_CERTIFICATE: int +PR_PROOF_OF_SUBMISSION: int +PR_ENTRYID: int +PR_OBJECT_TYPE: int +PR_ICON: int +PR_MINI_ICON: int +PR_STORE_ENTRYID: int +PR_STORE_RECORD_KEY: int +PR_RECORD_KEY: int +PR_MAPPING_SIGNATURE: int +PR_ACCESS_LEVEL: int +PR_INSTANCE_KEY: int +PR_ROW_TYPE: int +PR_ACCESS: int +PR_ROWID: int +PR_DISPLAY_NAME: int +PR_DISPLAY_NAME_W: int +PR_DISPLAY_NAME_A: int +PR_ADDRTYPE: int +PR_ADDRTYPE_W: int +PR_ADDRTYPE_A: int +PR_EMAIL_ADDRESS: int +PR_EMAIL_ADDRESS_W: int +PR_EMAIL_ADDRESS_A: int +PR_COMMENT: int +PR_COMMENT_W: int +PR_COMMENT_A: int +PR_DEPTH: int +PR_PROVIDER_DISPLAY: int +PR_PROVIDER_DISPLAY_W: int +PR_PROVIDER_DISPLAY_A: int +PR_CREATION_TIME: int +PR_LAST_MODIFICATION_TIME: int +PR_RESOURCE_FLAGS: int +PR_PROVIDER_DLL_NAME: int +PR_PROVIDER_DLL_NAME_W: int +PR_PROVIDER_DLL_NAME_A: int +PR_SEARCH_KEY: int +PR_PROVIDER_UID: int +PR_PROVIDER_ORDINAL: int +PR_FORM_VERSION: int +PR_FORM_VERSION_W: int +PR_FORM_VERSION_A: int +PR_FORM_CLSID: int +PR_FORM_CONTACT_NAME: int +PR_FORM_CONTACT_NAME_W: int +PR_FORM_CONTACT_NAME_A: int +PR_FORM_CATEGORY: int +PR_FORM_CATEGORY_W: int +PR_FORM_CATEGORY_A: int +PR_FORM_CATEGORY_SUB: int +PR_FORM_CATEGORY_SUB_W: int +PR_FORM_CATEGORY_SUB_A: int +PR_FORM_HOST_MAP: int +PR_FORM_HIDDEN: int +PR_FORM_DESIGNER_NAME: int +PR_FORM_DESIGNER_NAME_W: int +PR_FORM_DESIGNER_NAME_A: int +PR_FORM_DESIGNER_GUID: int +PR_FORM_MESSAGE_BEHAVIOR: int +PR_DEFAULT_STORE: int +PR_STORE_SUPPORT_MASK: int +PR_STORE_STATE: int +PR_IPM_SUBTREE_SEARCH_KEY: int +PR_IPM_OUTBOX_SEARCH_KEY: int +PR_IPM_WASTEBASKET_SEARCH_KEY: int +PR_IPM_SENTMAIL_SEARCH_KEY: int +PR_MDB_PROVIDER: int +PR_RECEIVE_FOLDER_SETTINGS: int +PR_VALID_FOLDER_MASK: int +PR_IPM_SUBTREE_ENTRYID: int +PR_IPM_OUTBOX_ENTRYID: int +PR_IPM_WASTEBASKET_ENTRYID: int +PR_IPM_SENTMAIL_ENTRYID: int +PR_VIEWS_ENTRYID: int +PR_COMMON_VIEWS_ENTRYID: int +PR_FINDER_ENTRYID: int +PR_CONTAINER_FLAGS: int +PR_FOLDER_TYPE: int +PR_CONTENT_COUNT: int +PR_CONTENT_UNREAD: int +PR_CREATE_TEMPLATES: int +PR_DETAILS_TABLE: int +PR_SEARCH: int +PR_SELECTABLE: int +PR_SUBFOLDERS: int +PR_STATUS: int +PR_ANR: int +PR_ANR_W: int +PR_ANR_A: int +PR_CONTENTS_SORT_ORDER: int +PR_CONTAINER_HIERARCHY: int +PR_CONTAINER_CONTENTS: int +PR_FOLDER_ASSOCIATED_CONTENTS: int +PR_DEF_CREATE_DL: int +PR_DEF_CREATE_MAILUSER: int +PR_CONTAINER_CLASS: int +PR_CONTAINER_CLASS_W: int +PR_CONTAINER_CLASS_A: int +PR_CONTAINER_MODIFY_VERSION: int +PR_AB_PROVIDER_ID: int +PR_DEFAULT_VIEW_ENTRYID: int +PR_ASSOC_CONTENT_COUNT: int +PR_ATTACHMENT_X400_PARAMETERS: int +PR_ATTACH_DATA_OBJ: int +PR_ATTACH_DATA_BIN: int +PR_ATTACH_ENCODING: int +PR_ATTACH_EXTENSION: int +PR_ATTACH_EXTENSION_W: int +PR_ATTACH_EXTENSION_A: int +PR_ATTACH_FILENAME: int +PR_ATTACH_FILENAME_W: int +PR_ATTACH_FILENAME_A: int +PR_ATTACH_METHOD: int +PR_ATTACH_LONG_FILENAME: int +PR_ATTACH_LONG_FILENAME_W: int +PR_ATTACH_LONG_FILENAME_A: int +PR_ATTACH_PATHNAME: int +PR_ATTACH_PATHNAME_W: int +PR_ATTACH_PATHNAME_A: int +PR_ATTACH_RENDERING: int +PR_ATTACH_TAG: int +PR_RENDERING_POSITION: int +PR_ATTACH_TRANSPORT_NAME: int +PR_ATTACH_TRANSPORT_NAME_W: int +PR_ATTACH_TRANSPORT_NAME_A: int +PR_ATTACH_LONG_PATHNAME: int +PR_ATTACH_LONG_PATHNAME_W: int +PR_ATTACH_LONG_PATHNAME_A: int +PR_ATTACH_MIME_TAG: int +PR_ATTACH_MIME_TAG_W: int +PR_ATTACH_MIME_TAG_A: int +PR_ATTACH_ADDITIONAL_INFO: int +PR_DISPLAY_TYPE: int +PR_TEMPLATEID: int +PR_PRIMARY_CAPABILITY: int +PR_7BIT_DISPLAY_NAME: int +PR_ACCOUNT: int +PR_ACCOUNT_W: int +PR_ACCOUNT_A: int +PR_ALTERNATE_RECIPIENT: int +PR_CALLBACK_TELEPHONE_NUMBER: int +PR_CALLBACK_TELEPHONE_NUMBER_W: int +PR_CALLBACK_TELEPHONE_NUMBER_A: int +PR_CONVERSION_PROHIBITED: int +PR_DISCLOSE_RECIPIENTS: int +PR_GENERATION: int +PR_GENERATION_W: int +PR_GENERATION_A: int +PR_GIVEN_NAME: int +PR_GIVEN_NAME_W: int +PR_GIVEN_NAME_A: int +PR_GOVERNMENT_ID_NUMBER: int +PR_GOVERNMENT_ID_NUMBER_W: int +PR_GOVERNMENT_ID_NUMBER_A: int +PR_BUSINESS_TELEPHONE_NUMBER: int +PR_BUSINESS_TELEPHONE_NUMBER_W: int +PR_BUSINESS_TELEPHONE_NUMBER_A: int +PR_OFFICE_TELEPHONE_NUMBER: int +PR_OFFICE_TELEPHONE_NUMBER_W: int +PR_OFFICE_TELEPHONE_NUMBER_A: int +PR_HOME_TELEPHONE_NUMBER: int +PR_HOME_TELEPHONE_NUMBER_W: int +PR_HOME_TELEPHONE_NUMBER_A: int +PR_INITIALS: int +PR_INITIALS_W: int +PR_INITIALS_A: int +PR_KEYWORD: int +PR_KEYWORD_W: int +PR_KEYWORD_A: int +PR_LANGUAGE: int +PR_LANGUAGE_W: int +PR_LANGUAGE_A: int +PR_LOCATION: int +PR_LOCATION_W: int +PR_LOCATION_A: int +PR_MAIL_PERMISSION: int +PR_MHS_COMMON_NAME: int +PR_MHS_COMMON_NAME_W: int +PR_MHS_COMMON_NAME_A: int +PR_ORGANIZATIONAL_ID_NUMBER: int +PR_ORGANIZATIONAL_ID_NUMBER_W: int +PR_ORGANIZATIONAL_ID_NUMBER_A: int +PR_SURNAME: int +PR_SURNAME_W: int +PR_SURNAME_A: int +PR_ORIGINAL_ENTRYID: int +PR_ORIGINAL_DISPLAY_NAME: int +PR_ORIGINAL_DISPLAY_NAME_W: int +PR_ORIGINAL_DISPLAY_NAME_A: int +PR_ORIGINAL_SEARCH_KEY: int +PR_POSTAL_ADDRESS: int +PR_POSTAL_ADDRESS_W: int +PR_POSTAL_ADDRESS_A: int +PR_COMPANY_NAME: int +PR_COMPANY_NAME_W: int +PR_COMPANY_NAME_A: int +PR_TITLE: int +PR_TITLE_W: int +PR_TITLE_A: int +PR_DEPARTMENT_NAME: int +PR_DEPARTMENT_NAME_W: int +PR_DEPARTMENT_NAME_A: int +PR_OFFICE_LOCATION: int +PR_OFFICE_LOCATION_W: int +PR_OFFICE_LOCATION_A: int +PR_PRIMARY_TELEPHONE_NUMBER: int +PR_PRIMARY_TELEPHONE_NUMBER_W: int +PR_PRIMARY_TELEPHONE_NUMBER_A: int +PR_BUSINESS2_TELEPHONE_NUMBER: int +PR_BUSINESS2_TELEPHONE_NUMBER_W: int +PR_BUSINESS2_TELEPHONE_NUMBER_A: int +PR_OFFICE2_TELEPHONE_NUMBER: int +PR_OFFICE2_TELEPHONE_NUMBER_W: int +PR_OFFICE2_TELEPHONE_NUMBER_A: int +PR_MOBILE_TELEPHONE_NUMBER: int +PR_MOBILE_TELEPHONE_NUMBER_W: int +PR_MOBILE_TELEPHONE_NUMBER_A: int +PR_CELLULAR_TELEPHONE_NUMBER: int +PR_CELLULAR_TELEPHONE_NUMBER_W: int +PR_CELLULAR_TELEPHONE_NUMBER_A: int +PR_RADIO_TELEPHONE_NUMBER: int +PR_RADIO_TELEPHONE_NUMBER_W: int +PR_RADIO_TELEPHONE_NUMBER_A: int +PR_CAR_TELEPHONE_NUMBER: int +PR_CAR_TELEPHONE_NUMBER_W: int +PR_CAR_TELEPHONE_NUMBER_A: int +PR_OTHER_TELEPHONE_NUMBER: int +PR_OTHER_TELEPHONE_NUMBER_W: int +PR_OTHER_TELEPHONE_NUMBER_A: int +PR_TRANSMITABLE_DISPLAY_NAME: int +PR_TRANSMITABLE_DISPLAY_NAME_W: int +PR_TRANSMITABLE_DISPLAY_NAME_A: int +PR_PAGER_TELEPHONE_NUMBER: int +PR_PAGER_TELEPHONE_NUMBER_W: int +PR_PAGER_TELEPHONE_NUMBER_A: int +PR_BEEPER_TELEPHONE_NUMBER: int +PR_BEEPER_TELEPHONE_NUMBER_W: int +PR_BEEPER_TELEPHONE_NUMBER_A: int +PR_USER_CERTIFICATE: int +PR_PRIMARY_FAX_NUMBER: int +PR_PRIMARY_FAX_NUMBER_W: int +PR_PRIMARY_FAX_NUMBER_A: int +PR_BUSINESS_FAX_NUMBER: int +PR_BUSINESS_FAX_NUMBER_W: int +PR_BUSINESS_FAX_NUMBER_A: int +PR_HOME_FAX_NUMBER: int +PR_HOME_FAX_NUMBER_W: int +PR_HOME_FAX_NUMBER_A: int +PR_COUNTRY: int +PR_COUNTRY_W: int +PR_COUNTRY_A: int +PR_BUSINESS_ADDRESS_COUNTRY: int +PR_BUSINESS_ADDRESS_COUNTRY_W: int +PR_BUSINESS_ADDRESS_COUNTRY_A: int +PR_LOCALITY: int +PR_LOCALITY_W: int +PR_LOCALITY_A: int +PR_BUSINESS_ADDRESS_CITY: int +PR_BUSINESS_ADDRESS_CITY_W: int +PR_BUSINESS_ADDRESS_CITY_A: int +PR_STATE_OR_PROVINCE: int +PR_STATE_OR_PROVINCE_W: int +PR_STATE_OR_PROVINCE_A: int +PR_BUSINESS_ADDRESS_STATE_OR_PROVINCE: int +PR_BUSINESS_ADDRESS_STATE_OR_PROVINCE_W: int +PR_BUSINESS_ADDRESS_STATE_OR_PROVINCE_A: int +PR_STREET_ADDRESS: int +PR_STREET_ADDRESS_W: int +PR_STREET_ADDRESS_A: int +PR_BUSINESS_ADDRESS_STREET: int +PR_BUSINESS_ADDRESS_STREET_W: int +PR_BUSINESS_ADDRESS_STREET_A: int +PR_POSTAL_CODE: int +PR_POSTAL_CODE_W: int +PR_POSTAL_CODE_A: int +PR_BUSINESS_ADDRESS_POSTAL_CODE: int +PR_BUSINESS_ADDRESS_POSTAL_CODE_W: int +PR_BUSINESS_ADDRESS_POSTAL_CODE_A: int +PR_POST_OFFICE_BOX: int +PR_POST_OFFICE_BOX_W: int +PR_POST_OFFICE_BOX_A: int +PR_BUSINESS_ADDRESS_POST_OFFICE_BOX: int +PR_BUSINESS_ADDRESS_POST_OFFICE_BOX_W: int +PR_BUSINESS_ADDRESS_POST_OFFICE_BOX_A: int +PR_TELEX_NUMBER: int +PR_TELEX_NUMBER_W: int +PR_TELEX_NUMBER_A: int +PR_ISDN_NUMBER: int +PR_ISDN_NUMBER_W: int +PR_ISDN_NUMBER_A: int +PR_ASSISTANT_TELEPHONE_NUMBER: int +PR_ASSISTANT_TELEPHONE_NUMBER_W: int +PR_ASSISTANT_TELEPHONE_NUMBER_A: int +PR_HOME2_TELEPHONE_NUMBER: int +PR_HOME2_TELEPHONE_NUMBER_W: int +PR_HOME2_TELEPHONE_NUMBER_A: int +PR_ASSISTANT: int +PR_ASSISTANT_W: int +PR_ASSISTANT_A: int +PR_SEND_RICH_INFO: int +PR_WEDDING_ANNIVERSARY: int +PR_BIRTHDAY: int +PR_HOBBIES: int +PR_HOBBIES_W: int +PR_HOBBIES_A: int +PR_MIDDLE_NAME: int +PR_MIDDLE_NAME_W: int +PR_MIDDLE_NAME_A: int +PR_DISPLAY_NAME_PREFIX: int +PR_DISPLAY_NAME_PREFIX_W: int +PR_DISPLAY_NAME_PREFIX_A: int +PR_PROFESSION: int +PR_PROFESSION_W: int +PR_PROFESSION_A: int +PR_PREFERRED_BY_NAME: int +PR_PREFERRED_BY_NAME_W: int +PR_PREFERRED_BY_NAME_A: int +PR_SPOUSE_NAME: int +PR_SPOUSE_NAME_W: int +PR_SPOUSE_NAME_A: int +PR_COMPUTER_NETWORK_NAME: int +PR_COMPUTER_NETWORK_NAME_W: int +PR_COMPUTER_NETWORK_NAME_A: int +PR_CUSTOMER_ID: int +PR_CUSTOMER_ID_W: int +PR_CUSTOMER_ID_A: int +PR_TTYTDD_PHONE_NUMBER: int +PR_TTYTDD_PHONE_NUMBER_W: int +PR_TTYTDD_PHONE_NUMBER_A: int +PR_FTP_SITE: int +PR_FTP_SITE_W: int +PR_FTP_SITE_A: int +PR_GENDER: int +PR_MANAGER_NAME: int +PR_MANAGER_NAME_W: int +PR_MANAGER_NAME_A: int +PR_NICKNAME: int +PR_NICKNAME_W: int +PR_NICKNAME_A: int +PR_PERSONAL_HOME_PAGE: int +PR_PERSONAL_HOME_PAGE_W: int +PR_PERSONAL_HOME_PAGE_A: int +PR_BUSINESS_HOME_PAGE: int +PR_BUSINESS_HOME_PAGE_W: int +PR_BUSINESS_HOME_PAGE_A: int +PR_CONTACT_VERSION: int +PR_CONTACT_ENTRYIDS: int +PR_CONTACT_ADDRTYPES: int +PR_CONTACT_ADDRTYPES_W: int +PR_CONTACT_ADDRTYPES_A: int +PR_CONTACT_DEFAULT_ADDRESS_INDEX: int +PR_CONTACT_EMAIL_ADDRESSES: int +PR_CONTACT_EMAIL_ADDRESSES_W: int +PR_CONTACT_EMAIL_ADDRESSES_A: int +PR_COMPANY_MAIN_PHONE_NUMBER: int +PR_COMPANY_MAIN_PHONE_NUMBER_W: int +PR_COMPANY_MAIN_PHONE_NUMBER_A: int +PR_CHILDRENS_NAMES: int +PR_CHILDRENS_NAMES_W: int +PR_CHILDRENS_NAMES_A: int +PR_HOME_ADDRESS_CITY: int +PR_HOME_ADDRESS_CITY_W: int +PR_HOME_ADDRESS_CITY_A: int +PR_HOME_ADDRESS_COUNTRY: int +PR_HOME_ADDRESS_COUNTRY_W: int +PR_HOME_ADDRESS_COUNTRY_A: int +PR_HOME_ADDRESS_POSTAL_CODE: int +PR_HOME_ADDRESS_POSTAL_CODE_W: int +PR_HOME_ADDRESS_POSTAL_CODE_A: int +PR_HOME_ADDRESS_STATE_OR_PROVINCE: int +PR_HOME_ADDRESS_STATE_OR_PROVINCE_W: int +PR_HOME_ADDRESS_STATE_OR_PROVINCE_A: int +PR_HOME_ADDRESS_STREET: int +PR_HOME_ADDRESS_STREET_W: int +PR_HOME_ADDRESS_STREET_A: int +PR_HOME_ADDRESS_POST_OFFICE_BOX: int +PR_HOME_ADDRESS_POST_OFFICE_BOX_W: int +PR_HOME_ADDRESS_POST_OFFICE_BOX_A: int +PR_OTHER_ADDRESS_CITY: int +PR_OTHER_ADDRESS_CITY_W: int +PR_OTHER_ADDRESS_CITY_A: int +PR_OTHER_ADDRESS_COUNTRY: int +PR_OTHER_ADDRESS_COUNTRY_W: int +PR_OTHER_ADDRESS_COUNTRY_A: int +PR_OTHER_ADDRESS_POSTAL_CODE: int +PR_OTHER_ADDRESS_POSTAL_CODE_W: int +PR_OTHER_ADDRESS_POSTAL_CODE_A: int +PR_OTHER_ADDRESS_STATE_OR_PROVINCE: int +PR_OTHER_ADDRESS_STATE_OR_PROVINCE_W: int +PR_OTHER_ADDRESS_STATE_OR_PROVINCE_A: int +PR_OTHER_ADDRESS_STREET: int +PR_OTHER_ADDRESS_STREET_W: int +PR_OTHER_ADDRESS_STREET_A: int +PR_OTHER_ADDRESS_POST_OFFICE_BOX: int +PR_OTHER_ADDRESS_POST_OFFICE_BOX_W: int +PR_OTHER_ADDRESS_POST_OFFICE_BOX_A: int +PR_STORE_PROVIDERS: int +PR_AB_PROVIDERS: int +PR_TRANSPORT_PROVIDERS: int +PR_DEFAULT_PROFILE: int +PR_AB_SEARCH_PATH: int +PR_AB_DEFAULT_DIR: int +PR_AB_DEFAULT_PAB: int +PR_FILTERING_HOOKS: int +PR_SERVICE_NAME: int +PR_SERVICE_NAME_W: int +PR_SERVICE_NAME_A: int +PR_SERVICE_DLL_NAME: int +PR_SERVICE_DLL_NAME_W: int +PR_SERVICE_DLL_NAME_A: int +PR_SERVICE_ENTRY_NAME: int +PR_SERVICE_UID: int +PR_SERVICE_EXTRA_UIDS: int +PR_SERVICES: int +PR_SERVICE_SUPPORT_FILES: int +PR_SERVICE_SUPPORT_FILES_W: int +PR_SERVICE_SUPPORT_FILES_A: int +PR_SERVICE_DELETE_FILES: int +PR_SERVICE_DELETE_FILES_W: int +PR_SERVICE_DELETE_FILES_A: int +PR_AB_SEARCH_PATH_UPDATE: int +PR_PROFILE_NAME: int +PR_PROFILE_NAME_A: int +PR_PROFILE_NAME_W: int +PR_IDENTITY_DISPLAY: int +PR_IDENTITY_DISPLAY_W: int +PR_IDENTITY_DISPLAY_A: int +PR_IDENTITY_ENTRYID: int +PR_RESOURCE_METHODS: int +PR_RESOURCE_TYPE: int +PR_STATUS_CODE: int +PR_IDENTITY_SEARCH_KEY: int +PR_OWN_STORE_ENTRYID: int +PR_RESOURCE_PATH: int +PR_RESOURCE_PATH_W: int +PR_RESOURCE_PATH_A: int +PR_STATUS_STRING: int +PR_STATUS_STRING_W: int +PR_STATUS_STRING_A: int +PR_X400_DEFERRED_DELIVERY_CANCEL: int +PR_HEADER_FOLDER_ENTRYID: int +PR_REMOTE_PROGRESS: int +PR_REMOTE_PROGRESS_TEXT: int +PR_REMOTE_PROGRESS_TEXT_W: int +PR_REMOTE_PROGRESS_TEXT_A: int +PR_REMOTE_VALIDATE_OK: int +PR_CONTROL_FLAGS: int +PR_CONTROL_STRUCTURE: int +PR_CONTROL_TYPE: int +PR_DELTAX: int +PR_DELTAY: int +PR_XPOS: int +PR_YPOS: int +PR_CONTROL_ID: int +PR_INITIAL_DETAILS_PANE: int +PROP_ID_SECURE_MIN: int +PROP_ID_SECURE_MAX: int +pidExchangeXmitReservedMin: int +pidExchangeNonXmitReservedMin: int +pidProfileMin: int +pidStoreMin: int +pidFolderMin: int +pidMessageReadOnlyMin: int +pidMessageWriteableMin: int +pidAttachReadOnlyMin: int +pidSpecialMin: int +pidAdminMin: int +pidSecureProfileMin: int +PR_PROFILE_VERSION: int +PR_PROFILE_CONFIG_FLAGS: int +PR_PROFILE_HOME_SERVER: int +PR_PROFILE_HOME_SERVER_DN: int +PR_PROFILE_HOME_SERVER_ADDRS: int +PR_PROFILE_USER: int +PR_PROFILE_CONNECT_FLAGS: int +PR_PROFILE_TRANSPORT_FLAGS: int +PR_PROFILE_UI_STATE: int +PR_PROFILE_UNRESOLVED_NAME: int +PR_PROFILE_UNRESOLVED_SERVER: int +PR_PROFILE_BINDING_ORDER: int +PR_PROFILE_MAX_RESTRICT: int +PR_PROFILE_AB_FILES_PATH: int +PR_PROFILE_OFFLINE_STORE_PATH: int +PR_PROFILE_OFFLINE_INFO: int +PR_PROFILE_ADDR_INFO: int +PR_PROFILE_OPTIONS_DATA: int +PR_PROFILE_SECURE_MAILBOX: int +PR_DISABLE_WINSOCK: int +PR_OST_ENCRYPTION: int +PR_PROFILE_OPEN_FLAGS: int +PR_PROFILE_TYPE: int +PR_PROFILE_MAILBOX: int +PR_PROFILE_SERVER: int +PR_PROFILE_SERVER_DN: int +PR_PROFILE_FAVFLD_DISPLAY_NAME: int +PR_PROFILE_FAVFLD_COMMENT: int +PR_PROFILE_ALLPUB_DISPLAY_NAME: int +PR_PROFILE_ALLPUB_COMMENT: int +OSTF_NO_ENCRYPTION: int +OSTF_COMPRESSABLE_ENCRYPTION: int +OSTF_BEST_ENCRYPTION: int +PR_NON_IPM_SUBTREE_ENTRYID: int +PR_EFORMS_REGISTRY_ENTRYID: int +PR_SPLUS_FREE_BUSY_ENTRYID: int +PR_OFFLINE_ADDRBOOK_ENTRYID: int +PR_EFORMS_FOR_LOCALE_ENTRYID: int +PR_FREE_BUSY_FOR_LOCAL_SITE_ENTRYID: int +PR_ADDRBOOK_FOR_LOCAL_SITE_ENTRYID: int +PR_OFFLINE_MESSAGE_ENTRYID: int +PR_IPM_FAVORITES_ENTRYID: int +PR_IPM_PUBLIC_FOLDERS_ENTRYID: int +PR_GW_MTSIN_ENTRYID: int +PR_GW_MTSOUT_ENTRYID: int +PR_TRANSFER_ENABLED: int +PR_TEST_LINE_SPEED: int +PR_HIERARCHY_SYNCHRONIZER: int +PR_CONTENTS_SYNCHRONIZER: int +PR_COLLECTOR: int +PR_FAST_TRANSFER: int +PR_STORE_OFFLINE: int +PR_IN_TRANSIT: int +PR_REPLICATION_STYLE: int +PR_REPLICATION_SCHEDULE: int +PR_REPLICATION_MESSAGE_PRIORITY: int +PR_OVERALL_MSG_AGE_LIMIT: int +PR_REPLICATION_ALWAYS_INTERVAL: int +PR_REPLICATION_MSG_SIZE: int +STYLE_ALWAYS_INTERVAL_DEFAULT: int +REPLICATION_MESSAGE_SIZE_LIMIT_DEFAULT: int +STYLE_NEVER: int +STYLE_NORMAL: int +STYLE_ALWAYS: int +STYLE_DEFAULT: int +PR_SOURCE_KEY: int +PR_PARENT_SOURCE_KEY: int +PR_CHANGE_KEY: int +PR_PREDECESSOR_CHANGE_LIST: int +PR_FOLDER_CHILD_COUNT: int +PR_RIGHTS: int +PR_ACL_TABLE: int +PR_RULES_TABLE: int +PR_HAS_RULES: int +PR_ADDRESS_BOOK_ENTRYID: int +PR_ACL_DATA: int +PR_RULES_DATA: int +PR_FOLDER_DESIGN_FLAGS: int +PR_DESIGN_IN_PROGRESS: int +PR_SECURE_ORIGINATION: int +PR_PUBLISH_IN_ADDRESS_BOOK: int +PR_RESOLVE_METHOD: int +PR_ADDRESS_BOOK_DISPLAY_NAME: int +PR_EFORMS_LOCALE_ID: int +PR_REPLICA_LIST: int +PR_OVERALL_AGE_LIMIT: int +RESOLVE_METHOD_DEFAULT: int +RESOLVE_METHOD_LAST_WRITER_WINS: int +RESOLVE_METHOD_NO_CONFLICT_NOTIFICATION: int +PR_PUBLIC_FOLDER_ENTRYID: int +PR_HAS_NAMED_PROPERTIES: int +PR_CREATOR_NAME: int +PR_CREATOR_ENTRYID: int +PR_LAST_MODIFIER_NAME: int +PR_LAST_MODIFIER_ENTRYID: int +PR_HAS_DAMS: int +PR_RULE_TRIGGER_HISTORY: int +PR_MOVE_TO_STORE_ENTRYID: int +PR_MOVE_TO_FOLDER_ENTRYID: int +PR_REPLICA_SERVER: int +PR_DEFERRED_SEND_NUMBER: int +PR_DEFERRED_SEND_UNITS: int +PR_EXPIRY_NUMBER: int +PR_EXPIRY_UNITS: int +PR_DEFERRED_SEND_TIME: int +PR_GW_ADMIN_OPERATIONS: int +PR_P1_CONTENT: int +PR_P1_CONTENT_TYPE: int +PR_CLIENT_ACTIONS: int +PR_DAM_ORIGINAL_ENTRYID: int +PR_DAM_BACK_PATCHED: int +PR_RULE_ERROR: int +PR_RULE_ACTION_TYPE: int +PR_RULE_ACTION_NUMBER: int +PR_RULE_FOLDER_ENTRYID: int +PR_CONFLICT_ENTRYID: int +PR_MESSAGE_LOCALE_ID: int +PR_STORAGE_QUOTA_LIMIT: int +PR_EXCESS_STORAGE_USED: int +PR_SVR_GENERATING_QUOTA_MSG: int +PR_DELEGATED_BY_RULE: int +MSGSTATUS_IN_CONFLICT: int +PR_IN_CONFLICT: int +PR_LONGTERM_ENTRYID_FROM_TABLE: int +PR_ORIGINATOR_NAME: int +PR_ORIGINATOR_ADDR: int +PR_ORIGINATOR_ADDRTYPE: int +PR_ORIGINATOR_ENTRYID: int +PR_ARRIVAL_TIME: int +PR_TRACE_INFO: int +PR_INTERNAL_TRACE_INFO: int +PR_SUBJECT_TRACE_INFO: int +PR_RECIPIENT_NUMBER: int +PR_MTS_SUBJECT_ID: int +PR_REPORT_DESTINATION_NAME: int +PR_REPORT_DESTINATION_ENTRYID: int +PR_CONTENT_SEARCH_KEY: int +PR_FOREIGN_ID: int +PR_FOREIGN_REPORT_ID: int +PR_FOREIGN_SUBJECT_ID: int +PR_MTS_ID: int +PR_MTS_REPORT_ID: int +PR_FOLDER_FLAGS: int +PR_LAST_ACCESS_TIME: int +PR_RESTRICTION_COUNT: int +PR_CATEG_COUNT: int +PR_CACHED_COLUMN_COUNT: int +PR_NORMAL_MSG_W_ATTACH_COUNT: int +PR_ASSOC_MSG_W_ATTACH_COUNT: int +PR_RECIPIENT_ON_NORMAL_MSG_COUNT: int +PR_RECIPIENT_ON_ASSOC_MSG_COUNT: int +PR_ATTACH_ON_NORMAL_MSG_COUNT: int +PR_ATTACH_ON_ASSOC_MSG_COUNT: int +PR_NORMAL_MESSAGE_SIZE: int +PR_NORMAL_MESSAGE_SIZE_EXTENDED: int +PR_ASSOC_MESSAGE_SIZE: int +PR_ASSOC_MESSAGE_SIZE_EXTENDED: int +PR_FOLDER_PATHNAME: int +PR_OWNER_COUNT: int +PR_CONTACT_COUNT: int +PR_MESSAGE_SIZE_EXTENDED: int +PR_USERFIELDS: int +PR_FORCE_USE_ENTRYID_SERVER: int +PR_PROFILE_MDB_DN: int +PST_EXTERN_PROPID_BASE: int +PR_PST_PATH: int +PR_PST_PATH_W: int +PR_PST_PATH_A: int +PR_PST_REMEMBER_PW: int +PR_PST_ENCRYPTION: int +PR_PST_PW_SZ_OLD: int +PR_PST_PW_SZ_OLD_W: int +PR_PST_PW_SZ_OLD_A: int +PR_PST_PW_SZ_NEW: int +PR_PST_PW_SZ_NEW_W: int +PR_PST_PW_SZ_NEW_A: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/mapi/mapiutil.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/mapi/mapiutil.pyi new file mode 100644 index 000000000..f370af558 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/mapi/mapiutil.pyi @@ -0,0 +1,22 @@ +from _typeshed import Incomplete + +from win32comext.mapi import mapi as mapi, mapitags as mapitags + +TupleType = tuple +ListType = list +IntType = int +prTable: Incomplete + +def GetPropTagName(pt): ... + +mapiErrorTable: Incomplete + +def GetScodeString(hr): ... + +ptTable: Incomplete + +def GetMapiTypeName(propType, rawType: bool = ...): ... +def GetProperties(obj, propList): ... +def GetAllProperties(obj, make_tag_names: bool = ...): ... +def SetPropertyValue(obj, prop, val) -> None: ... +def SetProperties(msg, propDict) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/propsys/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/propsys/__init__.pyi new file mode 100644 index 000000000..e69de29bb diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/propsys/propsys.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/propsys/propsys.pyi new file mode 100644 index 000000000..851372545 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/propsys/propsys.pyi @@ -0,0 +1,60 @@ +from typing_extensions import TypeAlias + +import _win32typing +from win32.lib.pywintypes import com_error + +error: TypeAlias = com_error # noqa: Y042 + +def PSGetItemPropertyHandler( + Item: _win32typing.PyIShellItem, riid: _win32typing.PyIID, ReadWrite: int +) -> _win32typing.PyIPropertyStore: ... +def PSGetPropertyDescription( + Key: _win32typing.PyPROPERTYKEY, riid: _win32typing.PyIID +) -> _win32typing.PyIPropertyDescription: ... +def PSGetPropertySystem(riid: _win32typing.PyIID) -> _win32typing.PyIPropertySystem: ... +def PSGetNameFromPropertyKey(Key: _win32typing.PyPROPERTYKEY) -> str: ... +def PSGetPropertyKeyFromName(Name) -> _win32typing.PyPROPERTYKEY: ... +def PSRegisterPropertySchema(filename) -> None: ... +def PSUnregisterPropertySchema(filename) -> None: ... +def SHGetPropertyStoreFromParsingName( + Path: str, Flags, riid: _win32typing.PyIID, BindCtx: _win32typing.PyIBindCtx | None = ... +) -> _win32typing.PyIPropertyStore: ... +def StgSerializePropVariant(propvar: _win32typing.PyPROPVARIANT): ... +def StgDeserializePropVariant(prop) -> _win32typing.PyPROPVARIANT: ... +def PSCreateMemoryPropertyStore(riid: _win32typing.PyIID) -> _win32typing.PyIPropertyStore: ... +def PSCreatePropertyStoreFromPropertySetStorage( + pss: _win32typing.PyIPropertySetStorage, Mode, riid: _win32typing.PyIID +) -> _win32typing.PyIPropertyStore: ... +def PSLookupPropertyHandlerCLSID(FilePath) -> _win32typing.PyIID: ... +def SHGetPropertyStoreForWindow(hwnd: int, riid: _win32typing.PyIID) -> _win32typing.PyIPropertyStore: ... +def PSGetPropertyFromPropertyStorage(ps, key: _win32typing.PyPROPERTYKEY) -> _win32typing.PyPROPVARIANT: ... +def PSGetNamedPropertyFromPropertyStorage(ps, name) -> _win32typing.PyPROPVARIANT: ... +def PSCreateSimplePropertyChange( + flags, key: _win32typing.PyPROPERTYKEY, val: _win32typing.PyPROPVARIANT, riid: _win32typing.PyIID +) -> _win32typing.PyIPropertyChange: ... +def PSCreatePropertyChangeArray() -> _win32typing.PyIPropertyChangeArray: ... +def SHSetDefaultProperties( + hwnd: int, + Item: _win32typing.PyIShellItem, + FileOpFlags: int = ..., + Sink: _win32typing.PyGFileOperationProgressSink | None = ..., +) -> None: ... + +IID_IInitializeWithFile: _win32typing.PyIID +IID_IInitializeWithStream: _win32typing.PyIID +IID_INamedPropertyStore: _win32typing.PyIID +IID_IObjectWithPropertyKey: _win32typing.PyIID +IID_IPersistSerializedPropStorage: _win32typing.PyIID +IID_IPropertyChange: _win32typing.PyIID +IID_IPropertyChangeArray: _win32typing.PyIID +IID_IPropertyDescription: _win32typing.PyIID +IID_IPropertyDescriptionAliasInfo: _win32typing.PyIID +IID_IPropertyDescriptionList: _win32typing.PyIID +IID_IPropertyDescriptionSearchInfo: _win32typing.PyIID +IID_IPropertyEnumType: _win32typing.PyIID +IID_IPropertyEnumTypeList: _win32typing.PyIID +IID_IPropertyStore: _win32typing.PyIID +IID_IPropertyStoreCache: _win32typing.PyIID +IID_IPropertyStoreCapabilities: _win32typing.PyIID +IID_IPropertySystem: _win32typing.PyIID +PROPVARIANTType = _win32typing.PyPROPVARIANT diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/propsys/pscon.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/propsys/pscon.pyi new file mode 100644 index 000000000..f142fe8e7 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/propsys/pscon.pyi @@ -0,0 +1,694 @@ +from _typeshed import Incomplete + +PET_DISCRETEVALUE: int +PET_RANGEDVALUE: int +PET_DEFAULTVALUE: int +PET_ENDRANGE: int +PDTF_DEFAULT: int +PDTF_MULTIPLEVALUES: int +PDTF_ISINNATE: int +PDTF_ISGROUP: int +PDTF_CANGROUPBY: int +PDTF_CANSTACKBY: int +PDTF_ISTREEPROPERTY: int +PDTF_INCLUDEINFULLTEXTQUERY: int +PDTF_ISVIEWABLE: int +PDTF_ISQUERYABLE: int +PDTF_ISSYSTEMPROPERTY: int +PDTF_MASK_ALL: int +PDVF_DEFAULT: int +PDVF_CENTERALIGN: int +PDVF_RIGHTALIGN: int +PDVF_BEGINNEWGROUP: int +PDVF_FILLAREA: int +PDVF_SORTDESCENDING: int +PDVF_SHOWONLYIFPRESENT: int +PDVF_SHOWBYDEFAULT: int +PDVF_SHOWINPRIMARYLIST: int +PDVF_SHOWINSECONDARYLIST: int +PDVF_HIDELABEL: int +PDVF_HIDDEN: int +PDVF_CANWRAP: int +PDVF_MASK_ALL: int +PDDT_STRING: int +PDDT_NUMBER: int +PDDT_BOOLEAN: int +PDDT_DATETIME: int +PDDT_ENUMERATED: int +PDGR_DISCRETE: int +PDGR_ALPHANUMERIC: int +PDGR_SIZE: int +PDGR_DYNAMIC: int +PDGR_DATE: int +PDGR_PERCENT: int +PDGR_ENUMERATED: int +PDFF_DEFAULT: int +PDFF_PREFIXNAME: int +PDFF_FILENAME: int +PDFF_ALWAYSKB: int +PDFF_RESERVED_RIGHTTOLEFT: int +PDFF_SHORTTIME: int +PDFF_LONGTIME: int +PDFF_HIDETIME: int +PDFF_SHORTDATE: int +PDFF_LONGDATE: int +PDFF_HIDEDATE: int +PDFF_RELATIVEDATE: int +PDFF_USEEDITINVITATION: int +PDFF_READONLY: int +PDFF_NOAUTOREADINGORDER: int +PDSD_GENERAL: int +PDSD_A_Z: int +PDSD_LOWEST_HIGHEST: int +PDSD_SMALLEST_BIGGEST: int +PDSD_OLDEST_NEWEST: int +PDRDT_GENERAL: int +PDRDT_DATE: int +PDRDT_SIZE: int +PDRDT_COUNT: int +PDRDT_REVISION: int +PDRDT_LENGTH: int +PDRDT_DURATION: int +PDRDT_SPEED: int +PDRDT_RATE: int +PDRDT_RATING: int +PDRDT_PRIORITY: int +PDAT_DEFAULT: int +PDAT_FIRST: int +PDAT_SUM: int +PDAT_AVERAGE: int +PDAT_DATERANGE: int +PDAT_UNION: int +PDAT_MAX: int +PDAT_MIN: int +PDCOT_NONE: int +PDCOT_STRING: int +PDCOT_SIZE: int +PDCOT_DATETIME: int +PDCOT_BOOLEAN: int +PDCOT_NUMBER: int +PDSIF_DEFAULT: int +PDSIF_ININVERTEDINDEX: int +PDSIF_ISCOLUMN: int +PDSIF_ISCOLUMNSPARSE: int +PDCIT_NONE: int +PDCIT_ONDISK: int +PDCIT_INMEMORY: int +PDEF_ALL: int +PDEF_SYSTEM: int +PDEF_NONSYSTEM: int +PDEF_VIEWABLE: int +PDEF_QUERYABLE: int +PDEF_INFULLTEXTQUERY: int +PDEF_COLUMN: int +PSC_NORMAL: int +PSC_NOTINSOURCE: int +PSC_DIRTY: int +COP_IMPLICIT: int +COP_EQUAL: int +COP_NOTEQUAL: int +COP_LESSTHAN: int +COP_GREATERTHAN: int +COP_LESSTHANOREQUAL: int +COP_GREATERTHANOREQUAL: int +COP_VALUE_STARTSWITH: int +COP_VALUE_ENDSWITH: int +COP_VALUE_CONTAINS: int +COP_VALUE_NOTCONTAINS: int +COP_DOSWILDCARDS: int +COP_WORD_EQUAL: int +COP_WORD_STARTSWITH: int +COP_APPLICATION_SPECIFIC: int +FPSPS_READONLY: int +PKEY_PIDSTR_MAX: int +GUIDSTRING_MAX: Incomplete +PKEYSTR_MAX: Incomplete +PKEY_Audio_ChannelCount: Incomplete +PKEY_Audio_Compression: Incomplete +PKEY_Audio_EncodingBitrate: Incomplete +PKEY_Audio_Format: Incomplete +PKEY_Audio_IsVariableBitRate: Incomplete +PKEY_Audio_PeakValue: Incomplete +PKEY_Audio_SampleRate: Incomplete +PKEY_Audio_SampleSize: Incomplete +PKEY_Audio_StreamName: Incomplete +PKEY_Audio_StreamNumber: Incomplete +PKEY_Calendar_Duration: Incomplete +PKEY_Calendar_IsOnline: Incomplete +PKEY_Calendar_IsRecurring: Incomplete +PKEY_Calendar_Location: Incomplete +PKEY_Calendar_OptionalAttendeeAddresses: Incomplete +PKEY_Calendar_OptionalAttendeeNames: Incomplete +PKEY_Calendar_OrganizerAddress: Incomplete +PKEY_Calendar_OrganizerName: Incomplete +PKEY_Calendar_ReminderTime: Incomplete +PKEY_Calendar_RequiredAttendeeAddresses: Incomplete +PKEY_Calendar_RequiredAttendeeNames: Incomplete +PKEY_Calendar_Resources: Incomplete +PKEY_Calendar_ShowTimeAs: Incomplete +PKEY_Calendar_ShowTimeAsText: Incomplete +PKEY_Communication_AccountName: Incomplete +PKEY_Communication_Suffix: Incomplete +PKEY_Communication_TaskStatus: Incomplete +PKEY_Communication_TaskStatusText: Incomplete +PKEY_Computer_DecoratedFreeSpace: Incomplete +PKEY_Contact_Anniversary: Incomplete +PKEY_Contact_AssistantName: Incomplete +PKEY_Contact_AssistantTelephone: Incomplete +PKEY_Contact_Birthday: Incomplete +PKEY_Contact_BusinessAddress: Incomplete +PKEY_Contact_BusinessAddressCity: Incomplete +PKEY_Contact_BusinessAddressCountry: Incomplete +PKEY_Contact_BusinessAddressPostalCode: Incomplete +PKEY_Contact_BusinessAddressPostOfficeBox: Incomplete +PKEY_Contact_BusinessAddressState: Incomplete +PKEY_Contact_BusinessAddressStreet: Incomplete +PKEY_Contact_BusinessFaxNumber: Incomplete +PKEY_Contact_BusinessHomePage: Incomplete +PKEY_Contact_BusinessTelephone: Incomplete +PKEY_Contact_CallbackTelephone: Incomplete +PKEY_Contact_CarTelephone: Incomplete +PKEY_Contact_Children: Incomplete +PKEY_Contact_CompanyMainTelephone: Incomplete +PKEY_Contact_Department: Incomplete +PKEY_Contact_EmailAddress: Incomplete +PKEY_Contact_EmailAddress2: Incomplete +PKEY_Contact_EmailAddress3: Incomplete +PKEY_Contact_EmailAddresses: Incomplete +PKEY_Contact_EmailName: Incomplete +PKEY_Contact_FileAsName: Incomplete +PKEY_Contact_FirstName: Incomplete +PKEY_Contact_FullName: Incomplete +PKEY_Contact_Gender: Incomplete +PKEY_Contact_Hobbies: Incomplete +PKEY_Contact_HomeAddress: Incomplete +PKEY_Contact_HomeAddressCity: Incomplete +PKEY_Contact_HomeAddressCountry: Incomplete +PKEY_Contact_HomeAddressPostalCode: Incomplete +PKEY_Contact_HomeAddressPostOfficeBox: Incomplete +PKEY_Contact_HomeAddressState: Incomplete +PKEY_Contact_HomeAddressStreet: Incomplete +PKEY_Contact_HomeFaxNumber: Incomplete +PKEY_Contact_HomeTelephone: Incomplete +PKEY_Contact_IMAddress: Incomplete +PKEY_Contact_Initials: Incomplete +PKEY_Contact_JA_CompanyNamePhonetic: Incomplete +PKEY_Contact_JA_FirstNamePhonetic: Incomplete +PKEY_Contact_JA_LastNamePhonetic: Incomplete +PKEY_Contact_JobTitle: Incomplete +PKEY_Contact_Label: Incomplete +PKEY_Contact_LastName: Incomplete +PKEY_Contact_MailingAddress: Incomplete +PKEY_Contact_MiddleName: Incomplete +PKEY_Contact_MobileTelephone: Incomplete +PKEY_Contact_NickName: Incomplete +PKEY_Contact_OfficeLocation: Incomplete +PKEY_Contact_OtherAddress: Incomplete +PKEY_Contact_OtherAddressCity: Incomplete +PKEY_Contact_OtherAddressCountry: Incomplete +PKEY_Contact_OtherAddressPostalCode: Incomplete +PKEY_Contact_OtherAddressPostOfficeBox: Incomplete +PKEY_Contact_OtherAddressState: Incomplete +PKEY_Contact_OtherAddressStreet: Incomplete +PKEY_Contact_PagerTelephone: Incomplete +PKEY_Contact_PersonalTitle: Incomplete +PKEY_Contact_PrimaryAddressCity: Incomplete +PKEY_Contact_PrimaryAddressCountry: Incomplete +PKEY_Contact_PrimaryAddressPostalCode: Incomplete +PKEY_Contact_PrimaryAddressPostOfficeBox: Incomplete +PKEY_Contact_PrimaryAddressState: Incomplete +PKEY_Contact_PrimaryAddressStreet: Incomplete +PKEY_Contact_PrimaryEmailAddress: Incomplete +PKEY_Contact_PrimaryTelephone: Incomplete +PKEY_Contact_Profession: Incomplete +PKEY_Contact_SpouseName: Incomplete +PKEY_Contact_Suffix: Incomplete +PKEY_Contact_TelexNumber: Incomplete +PKEY_Contact_TTYTDDTelephone: Incomplete +PKEY_Contact_WebPage: Incomplete +PKEY_AcquisitionID: Incomplete +PKEY_ApplicationName: Incomplete +PKEY_Author: Incomplete +PKEY_Capacity: Incomplete +PKEY_Category: Incomplete +PKEY_Comment: Incomplete +PKEY_Company: Incomplete +PKEY_ComputerName: Incomplete +PKEY_ContainedItems: Incomplete +PKEY_ContentStatus: Incomplete +PKEY_ContentType: Incomplete +PKEY_Copyright: Incomplete +PKEY_DateAccessed: Incomplete +PKEY_DateAcquired: Incomplete +PKEY_DateArchived: Incomplete +PKEY_DateCompleted: Incomplete +PKEY_DateCreated: Incomplete +PKEY_DateImported: Incomplete +PKEY_DateModified: Incomplete +PKEY_DueDate: Incomplete +PKEY_EndDate: Incomplete +PKEY_FileAllocationSize: Incomplete +PKEY_FileAttributes: Incomplete +PKEY_FileCount: Incomplete +PKEY_FileDescription: Incomplete +PKEY_FileExtension: Incomplete +PKEY_FileFRN: Incomplete +PKEY_FileName: Incomplete +PKEY_FileOwner: Incomplete +PKEY_FileVersion: Incomplete +PKEY_FindData: Incomplete +PKEY_FlagColor: Incomplete +PKEY_FlagColorText: Incomplete +PKEY_FlagStatus: Incomplete +PKEY_FlagStatusText: Incomplete +PKEY_FreeSpace: Incomplete +PKEY_Identity: Incomplete +PKEY_Importance: Incomplete +PKEY_ImportanceText: Incomplete +PKEY_IsAttachment: Incomplete +PKEY_IsDeleted: Incomplete +PKEY_IsFlagged: Incomplete +PKEY_IsFlaggedComplete: Incomplete +PKEY_IsIncomplete: Incomplete +PKEY_IsRead: Incomplete +PKEY_IsSendToTarget: Incomplete +PKEY_IsShared: Incomplete +PKEY_ItemAuthors: Incomplete +PKEY_ItemDate: Incomplete +PKEY_ItemFolderNameDisplay: Incomplete +PKEY_ItemFolderPathDisplay: Incomplete +PKEY_ItemFolderPathDisplayNarrow: Incomplete +PKEY_ItemName: Incomplete +PKEY_ItemNameDisplay: Incomplete +PKEY_ItemNamePrefix: Incomplete +PKEY_ItemParticipants: Incomplete +PKEY_ItemPathDisplay: Incomplete +PKEY_ItemPathDisplayNarrow: Incomplete +PKEY_ItemType: Incomplete +PKEY_ItemTypeText: Incomplete +PKEY_ItemUrl: Incomplete +PKEY_Keywords: Incomplete +PKEY_Kind: Incomplete +PKEY_KindText: Incomplete +PKEY_Language: Incomplete +PKEY_MileageInformation: Incomplete +PKEY_MIMEType: Incomplete +PKEY_Null: Incomplete +PKEY_OfflineAvailability: Incomplete +PKEY_OfflineStatus: Incomplete +PKEY_OriginalFileName: Incomplete +PKEY_ParentalRating: Incomplete +PKEY_ParentalRatingReason: Incomplete +PKEY_ParentalRatingsOrganization: Incomplete +PKEY_ParsingBindContext: Incomplete +PKEY_ParsingName: Incomplete +PKEY_ParsingPath: Incomplete +PKEY_PerceivedType: Incomplete +PKEY_PercentFull: Incomplete +PKEY_Priority: Incomplete +PKEY_PriorityText: Incomplete +PKEY_Project: Incomplete +PKEY_ProviderItemID: Incomplete +PKEY_Rating: Incomplete +PKEY_RatingText: Incomplete +PKEY_Sensitivity: Incomplete +PKEY_SensitivityText: Incomplete +PKEY_SFGAOFlags: Incomplete +PKEY_SharedWith: Incomplete +PKEY_ShareUserRating: Incomplete +PKEY_Shell_OmitFromView: Incomplete +PKEY_SimpleRating: Incomplete +PKEY_Size: Incomplete +PKEY_SoftwareUsed: Incomplete +PKEY_SourceItem: Incomplete +PKEY_StartDate: Incomplete +PKEY_Status: Incomplete +PKEY_Subject: Incomplete +PKEY_Thumbnail: Incomplete +PKEY_ThumbnailCacheId: Incomplete +PKEY_ThumbnailStream: Incomplete +PKEY_Title: Incomplete +PKEY_TotalFileSize: Incomplete +PKEY_Trademarks: Incomplete +PKEY_Document_ByteCount: Incomplete +PKEY_Document_CharacterCount: Incomplete +PKEY_Document_ClientID: Incomplete +PKEY_Document_Contributor: Incomplete +PKEY_Document_DateCreated: Incomplete +PKEY_Document_DatePrinted: Incomplete +PKEY_Document_DateSaved: Incomplete +PKEY_Document_Division: Incomplete +PKEY_Document_DocumentID: Incomplete +PKEY_Document_HiddenSlideCount: Incomplete +PKEY_Document_LastAuthor: Incomplete +PKEY_Document_LineCount: Incomplete +PKEY_Document_Manager: Incomplete +PKEY_Document_MultimediaClipCount: Incomplete +PKEY_Document_NoteCount: Incomplete +PKEY_Document_PageCount: Incomplete +PKEY_Document_ParagraphCount: Incomplete +PKEY_Document_PresentationFormat: Incomplete +PKEY_Document_RevisionNumber: Incomplete +PKEY_Document_Security: Incomplete +PKEY_Document_SlideCount: Incomplete +PKEY_Document_Template: Incomplete +PKEY_Document_TotalEditingTime: Incomplete +PKEY_Document_Version: Incomplete +PKEY_Document_WordCount: Incomplete +PKEY_DRM_DatePlayExpires: Incomplete +PKEY_DRM_DatePlayStarts: Incomplete +PKEY_DRM_Description: Incomplete +PKEY_DRM_IsProtected: Incomplete +PKEY_DRM_PlayCount: Incomplete +PKEY_GPS_Altitude: Incomplete +PKEY_GPS_AltitudeDenominator: Incomplete +PKEY_GPS_AltitudeNumerator: Incomplete +PKEY_GPS_AltitudeRef: Incomplete +PKEY_GPS_AreaInformation: Incomplete +PKEY_GPS_Date: Incomplete +PKEY_GPS_DestBearing: Incomplete +PKEY_GPS_DestBearingDenominator: Incomplete +PKEY_GPS_DestBearingNumerator: Incomplete +PKEY_GPS_DestBearingRef: Incomplete +PKEY_GPS_DestDistance: Incomplete +PKEY_GPS_DestDistanceDenominator: Incomplete +PKEY_GPS_DestDistanceNumerator: Incomplete +PKEY_GPS_DestDistanceRef: Incomplete +PKEY_GPS_DestLatitude: Incomplete +PKEY_GPS_DestLatitudeDenominator: Incomplete +PKEY_GPS_DestLatitudeNumerator: Incomplete +PKEY_GPS_DestLatitudeRef: Incomplete +PKEY_GPS_DestLongitude: Incomplete +PKEY_GPS_DestLongitudeDenominator: Incomplete +PKEY_GPS_DestLongitudeNumerator: Incomplete +PKEY_GPS_DestLongitudeRef: Incomplete +PKEY_GPS_Differential: Incomplete +PKEY_GPS_DOP: Incomplete +PKEY_GPS_DOPDenominator: Incomplete +PKEY_GPS_DOPNumerator: Incomplete +PKEY_GPS_ImgDirection: Incomplete +PKEY_GPS_ImgDirectionDenominator: Incomplete +PKEY_GPS_ImgDirectionNumerator: Incomplete +PKEY_GPS_ImgDirectionRef: Incomplete +PKEY_GPS_Latitude: Incomplete +PKEY_GPS_LatitudeDenominator: Incomplete +PKEY_GPS_LatitudeNumerator: Incomplete +PKEY_GPS_LatitudeRef: Incomplete +PKEY_GPS_Longitude: Incomplete +PKEY_GPS_LongitudeDenominator: Incomplete +PKEY_GPS_LongitudeNumerator: Incomplete +PKEY_GPS_LongitudeRef: Incomplete +PKEY_GPS_MapDatum: Incomplete +PKEY_GPS_MeasureMode: Incomplete +PKEY_GPS_ProcessingMethod: Incomplete +PKEY_GPS_Satellites: Incomplete +PKEY_GPS_Speed: Incomplete +PKEY_GPS_SpeedDenominator: Incomplete +PKEY_GPS_SpeedNumerator: Incomplete +PKEY_GPS_SpeedRef: Incomplete +PKEY_GPS_Status: Incomplete +PKEY_GPS_Track: Incomplete +PKEY_GPS_TrackDenominator: Incomplete +PKEY_GPS_TrackNumerator: Incomplete +PKEY_GPS_TrackRef: Incomplete +PKEY_GPS_VersionID: Incomplete +PKEY_Image_BitDepth: Incomplete +PKEY_Image_ColorSpace: Incomplete +PKEY_Image_CompressedBitsPerPixel: Incomplete +PKEY_Image_CompressedBitsPerPixelDenominator: Incomplete +PKEY_Image_CompressedBitsPerPixelNumerator: Incomplete +PKEY_Image_Compression: Incomplete +PKEY_Image_CompressionText: Incomplete +PKEY_Image_Dimensions: Incomplete +PKEY_Image_HorizontalResolution: Incomplete +PKEY_Image_HorizontalSize: Incomplete +PKEY_Image_ImageID: Incomplete +PKEY_Image_ResolutionUnit: Incomplete +PKEY_Image_VerticalResolution: Incomplete +PKEY_Image_VerticalSize: Incomplete +PKEY_Journal_Contacts: Incomplete +PKEY_Journal_EntryType: Incomplete +PKEY_Link_Comment: Incomplete +PKEY_Link_DateVisited: Incomplete +PKEY_Link_Description: Incomplete +PKEY_Link_Status: Incomplete +PKEY_Link_TargetExtension: Incomplete +PKEY_Link_TargetParsingPath: Incomplete +PKEY_Link_TargetSFGAOFlags: Incomplete +PKEY_Media_AuthorUrl: Incomplete +PKEY_Media_AverageLevel: Incomplete +PKEY_Media_ClassPrimaryID: Incomplete +PKEY_Media_ClassSecondaryID: Incomplete +PKEY_Media_CollectionGroupID: Incomplete +PKEY_Media_CollectionID: Incomplete +PKEY_Media_ContentDistributor: Incomplete +PKEY_Media_ContentID: Incomplete +PKEY_Media_CreatorApplication: Incomplete +PKEY_Media_CreatorApplicationVersion: Incomplete +PKEY_Media_DateEncoded: Incomplete +PKEY_Media_DateReleased: Incomplete +PKEY_Media_Duration: Incomplete +PKEY_Media_DVDID: Incomplete +PKEY_Media_EncodedBy: Incomplete +PKEY_Media_EncodingSettings: Incomplete +PKEY_Media_FrameCount: Incomplete +PKEY_Media_MCDI: Incomplete +PKEY_Media_MetadataContentProvider: Incomplete +PKEY_Media_Producer: Incomplete +PKEY_Media_PromotionUrl: Incomplete +PKEY_Media_ProtectionType: Incomplete +PKEY_Media_ProviderRating: Incomplete +PKEY_Media_ProviderStyle: Incomplete +PKEY_Media_Publisher: Incomplete +PKEY_Media_SubscriptionContentId: Incomplete +PKEY_Media_SubTitle: Incomplete +PKEY_Media_UniqueFileIdentifier: Incomplete +PKEY_Media_UserNoAutoInfo: Incomplete +PKEY_Media_UserWebUrl: Incomplete +PKEY_Media_Writer: Incomplete +PKEY_Media_Year: Incomplete +PKEY_Message_AttachmentContents: Incomplete +PKEY_Message_AttachmentNames: Incomplete +PKEY_Message_BccAddress: Incomplete +PKEY_Message_BccName: Incomplete +PKEY_Message_CcAddress: Incomplete +PKEY_Message_CcName: Incomplete +PKEY_Message_ConversationID: Incomplete +PKEY_Message_ConversationIndex: Incomplete +PKEY_Message_DateReceived: Incomplete +PKEY_Message_DateSent: Incomplete +PKEY_Message_FromAddress: Incomplete +PKEY_Message_FromName: Incomplete +PKEY_Message_HasAttachments: Incomplete +PKEY_Message_IsFwdOrReply: Incomplete +PKEY_Message_MessageClass: Incomplete +PKEY_Message_SenderAddress: Incomplete +PKEY_Message_SenderName: Incomplete +PKEY_Message_Store: Incomplete +PKEY_Message_ToAddress: Incomplete +PKEY_Message_ToDoTitle: Incomplete +PKEY_Message_ToName: Incomplete +PKEY_Music_AlbumArtist: Incomplete +PKEY_Music_AlbumTitle: Incomplete +PKEY_Music_Artist: Incomplete +PKEY_Music_BeatsPerMinute: Incomplete +PKEY_Music_Composer: Incomplete +PKEY_Music_Conductor: Incomplete +PKEY_Music_ContentGroupDescription: Incomplete +PKEY_Music_Genre: Incomplete +PKEY_Music_InitialKey: Incomplete +PKEY_Music_Lyrics: Incomplete +PKEY_Music_Mood: Incomplete +PKEY_Music_PartOfSet: Incomplete +PKEY_Music_Period: Incomplete +PKEY_Music_SynchronizedLyrics: Incomplete +PKEY_Music_TrackNumber: Incomplete +PKEY_Note_Color: Incomplete +PKEY_Note_ColorText: Incomplete +PKEY_Photo_Aperture: Incomplete +PKEY_Photo_ApertureDenominator: Incomplete +PKEY_Photo_ApertureNumerator: Incomplete +PKEY_Photo_Brightness: Incomplete +PKEY_Photo_BrightnessDenominator: Incomplete +PKEY_Photo_BrightnessNumerator: Incomplete +PKEY_Photo_CameraManufacturer: Incomplete +PKEY_Photo_CameraModel: Incomplete +PKEY_Photo_CameraSerialNumber: Incomplete +PKEY_Photo_Contrast: Incomplete +PKEY_Photo_ContrastText: Incomplete +PKEY_Photo_DateTaken: Incomplete +PKEY_Photo_DigitalZoom: Incomplete +PKEY_Photo_DigitalZoomDenominator: Incomplete +PKEY_Photo_DigitalZoomNumerator: Incomplete +PKEY_Photo_Event: Incomplete +PKEY_Photo_EXIFVersion: Incomplete +PKEY_Photo_ExposureBias: Incomplete +PKEY_Photo_ExposureBiasDenominator: Incomplete +PKEY_Photo_ExposureBiasNumerator: Incomplete +PKEY_Photo_ExposureIndex: Incomplete +PKEY_Photo_ExposureIndexDenominator: Incomplete +PKEY_Photo_ExposureIndexNumerator: Incomplete +PKEY_Photo_ExposureProgram: Incomplete +PKEY_Photo_ExposureProgramText: Incomplete +PKEY_Photo_ExposureTime: Incomplete +PKEY_Photo_ExposureTimeDenominator: Incomplete +PKEY_Photo_ExposureTimeNumerator: Incomplete +PKEY_Photo_Flash: Incomplete +PKEY_Photo_FlashEnergy: Incomplete +PKEY_Photo_FlashEnergyDenominator: Incomplete +PKEY_Photo_FlashEnergyNumerator: Incomplete +PKEY_Photo_FlashManufacturer: Incomplete +PKEY_Photo_FlashModel: Incomplete +PKEY_Photo_FlashText: Incomplete +PKEY_Photo_FNumber: Incomplete +PKEY_Photo_FNumberDenominator: Incomplete +PKEY_Photo_FNumberNumerator: Incomplete +PKEY_Photo_FocalLength: Incomplete +PKEY_Photo_FocalLengthDenominator: Incomplete +PKEY_Photo_FocalLengthInFilm: Incomplete +PKEY_Photo_FocalLengthNumerator: Incomplete +PKEY_Photo_FocalPlaneXResolution: Incomplete +PKEY_Photo_FocalPlaneXResolutionDenominator: Incomplete +PKEY_Photo_FocalPlaneXResolutionNumerator: Incomplete +PKEY_Photo_FocalPlaneYResolution: Incomplete +PKEY_Photo_FocalPlaneYResolutionDenominator: Incomplete +PKEY_Photo_FocalPlaneYResolutionNumerator: Incomplete +PKEY_Photo_GainControl: Incomplete +PKEY_Photo_GainControlDenominator: Incomplete +PKEY_Photo_GainControlNumerator: Incomplete +PKEY_Photo_GainControlText: Incomplete +PKEY_Photo_ISOSpeed: Incomplete +PKEY_Photo_LensManufacturer: Incomplete +PKEY_Photo_LensModel: Incomplete +PKEY_Photo_LightSource: Incomplete +PKEY_Photo_MakerNote: Incomplete +PKEY_Photo_MakerNoteOffset: Incomplete +PKEY_Photo_MaxAperture: Incomplete +PKEY_Photo_MaxApertureDenominator: Incomplete +PKEY_Photo_MaxApertureNumerator: Incomplete +PKEY_Photo_MeteringMode: Incomplete +PKEY_Photo_MeteringModeText: Incomplete +PKEY_Photo_Orientation: Incomplete +PKEY_Photo_OrientationText: Incomplete +PKEY_Photo_PhotometricInterpretation: Incomplete +PKEY_Photo_PhotometricInterpretationText: Incomplete +PKEY_Photo_ProgramMode: Incomplete +PKEY_Photo_ProgramModeText: Incomplete +PKEY_Photo_RelatedSoundFile: Incomplete +PKEY_Photo_Saturation: Incomplete +PKEY_Photo_SaturationText: Incomplete +PKEY_Photo_Sharpness: Incomplete +PKEY_Photo_SharpnessText: Incomplete +PKEY_Photo_ShutterSpeed: Incomplete +PKEY_Photo_ShutterSpeedDenominator: Incomplete +PKEY_Photo_ShutterSpeedNumerator: Incomplete +PKEY_Photo_SubjectDistance: Incomplete +PKEY_Photo_SubjectDistanceDenominator: Incomplete +PKEY_Photo_SubjectDistanceNumerator: Incomplete +PKEY_Photo_TranscodedForSync: Incomplete +PKEY_Photo_WhiteBalance: Incomplete +PKEY_Photo_WhiteBalanceText: Incomplete +PKEY_PropGroup_Advanced: Incomplete +PKEY_PropGroup_Audio: Incomplete +PKEY_PropGroup_Calendar: Incomplete +PKEY_PropGroup_Camera: Incomplete +PKEY_PropGroup_Contact: Incomplete +PKEY_PropGroup_Content: Incomplete +PKEY_PropGroup_Description: Incomplete +PKEY_PropGroup_FileSystem: Incomplete +PKEY_PropGroup_General: Incomplete +PKEY_PropGroup_GPS: Incomplete +PKEY_PropGroup_Image: Incomplete +PKEY_PropGroup_Media: Incomplete +PKEY_PropGroup_MediaAdvanced: Incomplete +PKEY_PropGroup_Message: Incomplete +PKEY_PropGroup_Music: Incomplete +PKEY_PropGroup_Origin: Incomplete +PKEY_PropGroup_PhotoAdvanced: Incomplete +PKEY_PropGroup_RecordedTV: Incomplete +PKEY_PropGroup_Video: Incomplete +PKEY_PropList_ConflictPrompt: Incomplete +PKEY_PropList_ExtendedTileInfo: Incomplete +PKEY_PropList_FileOperationPrompt: Incomplete +PKEY_PropList_FullDetails: Incomplete +PKEY_PropList_InfoTip: Incomplete +PKEY_PropList_NonPersonal: Incomplete +PKEY_PropList_PreviewDetails: Incomplete +PKEY_PropList_PreviewTitle: Incomplete +PKEY_PropList_QuickTip: Incomplete +PKEY_PropList_TileInfo: Incomplete +PKEY_PropList_XPDetailsPanel: Incomplete +PKEY_RecordedTV_ChannelNumber: Incomplete +PKEY_RecordedTV_Credits: Incomplete +PKEY_RecordedTV_DateContentExpires: Incomplete +PKEY_RecordedTV_EpisodeName: Incomplete +PKEY_RecordedTV_IsATSCContent: Incomplete +PKEY_RecordedTV_IsClosedCaptioningAvailable: Incomplete +PKEY_RecordedTV_IsDTVContent: Incomplete +PKEY_RecordedTV_IsHDContent: Incomplete +PKEY_RecordedTV_IsRepeatBroadcast: Incomplete +PKEY_RecordedTV_IsSAP: Incomplete +PKEY_RecordedTV_NetworkAffiliation: Incomplete +PKEY_RecordedTV_OriginalBroadcastDate: Incomplete +PKEY_RecordedTV_ProgramDescription: Incomplete +PKEY_RecordedTV_RecordingTime: Incomplete +PKEY_RecordedTV_StationCallSign: Incomplete +PKEY_RecordedTV_StationName: Incomplete +PKEY_Search_AutoSummary: Incomplete +PKEY_Search_ContainerHash: Incomplete +PKEY_Search_Contents: Incomplete +PKEY_Search_EntryID: Incomplete +PKEY_Search_GatherTime: Incomplete +PKEY_Search_IsClosedDirectory: Incomplete +PKEY_Search_IsFullyContained: Incomplete +PKEY_Search_QueryFocusedSummary: Incomplete +PKEY_Search_Rank: Incomplete +PKEY_Search_Store: Incomplete +PKEY_Search_UrlToIndex: Incomplete +PKEY_Search_UrlToIndexWithModificationTime: Incomplete +PKEY_DescriptionID: Incomplete +PKEY_Link_TargetSFGAOFlagsStrings: Incomplete +PKEY_Link_TargetUrl: Incomplete +PKEY_Shell_SFGAOFlagsStrings: Incomplete +PKEY_Software_DateLastUsed: Incomplete +PKEY_Software_ProductName: Incomplete +PKEY_Sync_Comments: Incomplete +PKEY_Sync_ConflictDescription: Incomplete +PKEY_Sync_ConflictFirstLocation: Incomplete +PKEY_Sync_ConflictSecondLocation: Incomplete +PKEY_Sync_HandlerCollectionID: Incomplete +PKEY_Sync_HandlerID: Incomplete +PKEY_Sync_HandlerName: Incomplete +PKEY_Sync_HandlerType: Incomplete +PKEY_Sync_HandlerTypeLabel: Incomplete +PKEY_Sync_ItemID: Incomplete +PKEY_Sync_ItemName: Incomplete +PKEY_Task_BillingInformation: Incomplete +PKEY_Task_CompletionStatus: Incomplete +PKEY_Task_Owner: Incomplete +PKEY_Video_Compression: Incomplete +PKEY_Video_Director: Incomplete +PKEY_Video_EncodingBitrate: Incomplete +PKEY_Video_FourCC: Incomplete +PKEY_Video_FrameHeight: Incomplete +PKEY_Video_FrameRate: Incomplete +PKEY_Video_FrameWidth: Incomplete +PKEY_Video_HorizontalAspectRatio: Incomplete +PKEY_Video_SampleSize: Incomplete +PKEY_Video_StreamName: Incomplete +PKEY_Video_StreamNumber: Incomplete +PKEY_Video_TotalBitrate: Incomplete +PKEY_Video_VerticalAspectRatio: Incomplete +PKEY_Volume_FileSystem: Incomplete +PKEY_Volume_IsMappedDrive: Incomplete +PKEY_Volume_IsRoot: Incomplete +PKEY_AppUserModel_RelaunchCommand: Incomplete +PKEY_AppUserModel_RelaunchIconResource: Incomplete +PKEY_AppUserModel_RelaunchDisplayNameResource: Incomplete +PKEY_AppUserModel_ID: Incomplete +PKEY_AppUserModel_IsDestListSeparator: Incomplete +PKEY_AppUserModel_ExcludeFromShowInNewInstall: Incomplete +PKEY_AppUserModel_PreventPinning: Incomplete +PKA_SET: int +PKA_APPEND: int +PKA_DELETE: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/shell/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/shell/__init__.pyi new file mode 100644 index 000000000..e69de29bb diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/shell/shell.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/shell/shell.pyi new file mode 100644 index 000000000..35a077266 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/shell/shell.pyi @@ -0,0 +1,436 @@ +from _typeshed import Incomplete +from typing_extensions import TypeAlias + +import _win32typing +from win32.lib.pywintypes import com_error + +error: TypeAlias = com_error # noqa: Y042 + +def AssocCreate() -> _win32typing.PyIQueryAssociations: ... +def AssocCreateForClasses() -> _win32typing.PyIUnknown: ... +def DragQueryFile(hglobal: int, index) -> str: ... +def DragQueryFileW(hglobal: int, index) -> str: ... +def DragQueryPoint(hglobal: int) -> tuple[Incomplete, Incomplete, Incomplete]: ... +def IsUserAnAdmin() -> bool: ... +def SHCreateDataObject( + parent, children: list[Incomplete], do_inner: _win32typing.PyIDataObject, iid: _win32typing.PyIID +) -> _win32typing.PyIUnknown: ... +def SHCreateDefaultContextMenu(dcm, iid: _win32typing.PyIID) -> _win32typing.PyIUnknown: ... +def SHCreateDefaultExtractIcon() -> _win32typing.PyIDefaultExtractIconInit: ... +def SHCreateShellFolderView( + sf: _win32typing.PyIShellFolder, viewOuter: _win32typing.PyIShellView | None = ..., callbacks: Incomplete | None = ... +) -> _win32typing.PyIShellView: ... +def SHCreateShellItemArray( + parent: _win32typing.PyIDL, sf: _win32typing.PyIShellFolder, children: list[_win32typing.PyIDL] +) -> _win32typing.PyIShellItemArray: ... +def SHCreateShellItemArrayFromDataObject( + do: _win32typing.PyIDataObject, iid: _win32typing.PyIID +) -> _win32typing.PyIShellItemArray: ... +def SHCreateShellItemArrayFromShellItem( + si: _win32typing.PyIShellItem, riid: _win32typing.PyIID +) -> _win32typing.PyIShellItemArray: ... +def SHBrowseForFolder( + hwndOwner: int | None = ..., + pidlRoot: _win32typing.PyIDL | None = ..., + title: str | None = ..., + flags: int = ..., + callback: Incomplete | None = ..., + callback_data: Incomplete | None = ..., +) -> tuple[_win32typing.PyIDL, Incomplete, Incomplete]: ... +def SHGetFileInfo( + name: _win32typing.PyIDL | str, dwFileAttributes, uFlags, infoAttrs: int = ... +) -> tuple[Incomplete, _win32typing.SHFILEINFO]: ... +def SHGetFolderPath(hwndOwner: int, nFolder, handle: int, flags) -> str: ... +def SHSetFolderPath(csidl, Path, hToken: int | None = ...) -> None: ... +def SHGetFolderLocation(hwndOwner: int, nFolder, hToken: int | None = ..., reserved=...) -> _win32typing.PyIDL: ... +def SHGetSpecialFolderPath(hwndOwner: int, nFolder, bCreate: int = ...) -> str: ... +def SHGetSpecialFolderLocation(hwndOwner: int, nFolder) -> _win32typing.PyIDL: ... +def SHAddToRecentDocs(Flags, data) -> None: ... +def SHEmptyRecycleBin(hwnd: int, path: str, flags) -> None: ... +def SHQueryRecycleBin(RootPath: str | None = ...) -> tuple[Incomplete, Incomplete]: ... +def SHGetDesktopFolder() -> _win32typing.PyIShellFolder: ... +def SHUpdateImage(HashItem: str, Index, Flags, ImageIndex) -> None: ... +def SHChangeNotify(EventId, Flags, Item1, Item2) -> None: ... +def SHChangeNotifyRegister(hwnd: int, sources, events, msg): ... +def SHChangeNotifyDeregister(_id) -> None: ... +def SHCreateItemFromParsingName(name, ctx: _win32typing.PyIBindCtx, riid: _win32typing.PyIID) -> _win32typing.PyIShellItem: ... +def SHCreateItemFromRelativeName( + Parent: _win32typing.PyIShellItem, Name, ctx: _win32typing.PyIBindCtx, riid: _win32typing.PyIID +) -> _win32typing.PyIShellItem: ... +def SHCreateItemInKnownFolder( + FolderId: _win32typing.PyIID, Flags, Name, riid: _win32typing.PyIID +) -> _win32typing.PyIShellItem: ... +def SHCreateItemWithParent( + Parent: _win32typing.PyIDL, sfParent: _win32typing.PyIShellFolder, child: _win32typing.PyIDL, riid: _win32typing.PyIID +) -> _win32typing.PyIShellItem: ... +def SHGetInstanceExplorer() -> _win32typing.PyIUnknown: ... +def SHFileOperation(operation: _win32typing.SHFILEOPSTRUCT) -> tuple[Incomplete, Incomplete]: ... +def StringAsCIDA(pidl: str) -> tuple[_win32typing.PyIDL, Incomplete]: ... +def CIDAAsString(pidl: str) -> str: ... +def StringAsPIDL(pidl: str) -> _win32typing.PyIDL: ... +def AddressAsPIDL(address) -> _win32typing.PyIDL: ... +def PIDLAsString(pidl: _win32typing.PyIDL) -> str: ... +def SHGetSettings(mask: int = ...): ... +def FILEGROUPDESCRIPTORAsString(descriptors: list[Incomplete], arg) -> str: ... +def StringAsFILEGROUPDESCRIPTOR(buf, make_unicode: int = ...) -> list[Incomplete]: ... +def ShellExecuteEx( + lpVerb: str, + lpFile: str, + lpParameters: str, + lpDirectory: str, + lpIDlist: _win32typing.PyIDL, + obClass: str, + hkeyClass, + dwHotKey, + hIcon: int, + hMonitor: int, + fMask: int = ..., + hwnd: int = ..., + nShow: int = ..., +): ... +def SHGetViewStatePropertyBag( + pidl: _win32typing.PyIDL, BagName: str, Flags, riid: _win32typing.PyIID +) -> _win32typing.PyIPropertyBag: ... +def SHILCreateFromPath(Path: str, Flags) -> tuple[_win32typing.PyIDL, Incomplete]: ... +def SHCreateShellItem( + pidlParent: _win32typing.PyIDL, sfParent: _win32typing.PyIShellFolder, Child: _win32typing.PyIDL +) -> _win32typing.PyIShellItem: ... +def SHOpenFolderAndSelectItems(Folder: _win32typing.PyIDL, Items: tuple[_win32typing.PyIDL, ...], Flags=...) -> None: ... +def SHCreateStreamOnFileEx(File, Mode, Attributes, Create, Template: Incomplete | None = ...) -> _win32typing.PyIStream: ... +def SetCurrentProcessExplicitAppUserModelID(AppID) -> None: ... +def GetCurrentProcessExplicitAppUserModelID(): ... +def SHParseDisplayName( + Name, Attributes, BindCtx: _win32typing.PyIBindCtx | None = ... +) -> tuple[_win32typing.PyIDL, Incomplete]: ... +def SHCreateItemFromIDList(*args, **kwargs): ... # incomplete +def SHCreateShellItemArrayFromIDLists(*args, **kwargs): ... # incomplete +def SHGetIDListFromObject(*args, **kwargs): ... # incomplete +def SHGetNameFromIDList(*args, **kwargs): ... # incomplete +def SHGetPathFromIDList(*args, **kwargs): ... # incomplete +def SHGetPathFromIDListW(*args, **kwargs): ... # incomplete + +BHID_AssociationArray: _win32typing.PyIID +BHID_DataObject: _win32typing.PyIID +BHID_EnumItems: _win32typing.PyIID +BHID_Filter: _win32typing.PyIID +BHID_LinkTargetItem: _win32typing.PyIID +BHID_PropertyStore: _win32typing.PyIID +BHID_SFObject: _win32typing.PyIID +BHID_SFUIObject: _win32typing.PyIID +BHID_SFViewObject: _win32typing.PyIID +BHID_Storage: _win32typing.PyIID +BHID_StorageEnum: _win32typing.PyIID +BHID_Stream: _win32typing.PyIID +BHID_ThumbnailHandler: _win32typing.PyIID +BHID_Transfer: _win32typing.PyIID +CGID_DefView: _win32typing.PyIID +CGID_Explorer: _win32typing.PyIID +CGID_ExplorerBarDoc: _win32typing.PyIID +CGID_ShellDocView: _win32typing.PyIID +CGID_ShellServiceObject: _win32typing.PyIID +CLSID_ActiveDesktop: _win32typing.PyIID +CLSID_ApplicationDestinations: _win32typing.PyIID +CLSID_ApplicationDocumentLists: _win32typing.PyIID +CLSID_ControlPanel: _win32typing.PyIID +CLSID_DestinationList: _win32typing.PyIID +CLSID_DragDropHelper: _win32typing.PyIID +CLSID_EnumerableObjectCollection: _win32typing.PyIID +CLSID_FileOperation: _win32typing.PyIID +CLSID_Internet: _win32typing.PyIID +CLSID_InternetShortcut: _win32typing.PyIID +CLSID_KnownFolderManager: _win32typing.PyIID +CLSID_MyComputer: _win32typing.PyIID +CLSID_MyDocuments: _win32typing.PyIID +CLSID_NetworkDomain: _win32typing.PyIID +CLSID_NetworkPlaces: _win32typing.PyIID +CLSID_NetworkServer: _win32typing.PyIID +CLSID_NetworkShare: _win32typing.PyIID +CLSID_Printers: _win32typing.PyIID +CLSID_RecycleBin: _win32typing.PyIID +CLSID_ShellDesktop: _win32typing.PyIID +CLSID_ShellFSFolder: _win32typing.PyIID +CLSID_ShellItem: _win32typing.PyIID +CLSID_ShellLibrary: _win32typing.PyIID +CLSID_ShellLink: _win32typing.PyIID +CLSID_TaskbarList: _win32typing.PyIID +EP_AdvQueryPane: _win32typing.PyIID +EP_Commands: _win32typing.PyIID +EP_Commands_Organize: _win32typing.PyIID +EP_Commands_View: _win32typing.PyIID +EP_DetailsPane: _win32typing.PyIID +EP_NavPane: _win32typing.PyIID +EP_PreviewPane: _win32typing.PyIID +EP_QueryPane: _win32typing.PyIID +FMTID_AudioSummaryInformation: _win32typing.PyIID +FMTID_Briefcase: _win32typing.PyIID +FMTID_Displaced: _win32typing.PyIID +FMTID_ImageProperties: _win32typing.PyIID +FMTID_ImageSummaryInformation: _win32typing.PyIID +FMTID_InternetSite: _win32typing.PyIID +FMTID_Intshcut: _win32typing.PyIID +FMTID_MediaFileSummaryInformation: _win32typing.PyIID +FMTID_Misc: _win32typing.PyIID +FMTID_Query: _win32typing.PyIID +FMTID_ShellDetails: _win32typing.PyIID +FMTID_Storage: _win32typing.PyIID +FMTID_SummaryInformation: _win32typing.PyIID +FMTID_Volume: _win32typing.PyIID +FMTID_WebView: _win32typing.PyIID +FOLDERID_AddNewPrograms: _win32typing.PyIID +FOLDERID_AdminTools: _win32typing.PyIID +FOLDERID_AppUpdates: _win32typing.PyIID +FOLDERID_CDBurning: _win32typing.PyIID +FOLDERID_ChangeRemovePrograms: _win32typing.PyIID +FOLDERID_CommonAdminTools: _win32typing.PyIID +FOLDERID_CommonOEMLinks: _win32typing.PyIID +FOLDERID_CommonPrograms: _win32typing.PyIID +FOLDERID_CommonStartMenu: _win32typing.PyIID +FOLDERID_CommonStartup: _win32typing.PyIID +FOLDERID_CommonTemplates: _win32typing.PyIID +FOLDERID_ComputerFolder: _win32typing.PyIID +FOLDERID_ConflictFolder: _win32typing.PyIID +FOLDERID_ConnectionsFolder: _win32typing.PyIID +FOLDERID_Contacts: _win32typing.PyIID +FOLDERID_ControlPanelFolder: _win32typing.PyIID +FOLDERID_Cookies: _win32typing.PyIID +FOLDERID_Desktop: _win32typing.PyIID +FOLDERID_DeviceMetadataStore: _win32typing.PyIID +FOLDERID_Documents: _win32typing.PyIID +FOLDERID_DocumentsLibrary: _win32typing.PyIID +FOLDERID_Downloads: _win32typing.PyIID +FOLDERID_Favorites: _win32typing.PyIID +FOLDERID_Fonts: _win32typing.PyIID +FOLDERID_GameTasks: _win32typing.PyIID +FOLDERID_Games: _win32typing.PyIID +FOLDERID_History: _win32typing.PyIID +FOLDERID_HomeGroup: _win32typing.PyIID +FOLDERID_ImplicitAppShortcuts: _win32typing.PyIID +FOLDERID_InternetCache: _win32typing.PyIID +FOLDERID_InternetFolder: _win32typing.PyIID +FOLDERID_Libraries: _win32typing.PyIID +FOLDERID_Links: _win32typing.PyIID +FOLDERID_LocalAppData: _win32typing.PyIID +FOLDERID_LocalAppDataLow: _win32typing.PyIID +FOLDERID_LocalizedResourcesDir: _win32typing.PyIID +FOLDERID_Music: _win32typing.PyIID +FOLDERID_MusicLibrary: _win32typing.PyIID +FOLDERID_NetHood: _win32typing.PyIID +FOLDERID_NetworkFolder: _win32typing.PyIID +FOLDERID_OriginalImages: _win32typing.PyIID +FOLDERID_PhotoAlbums: _win32typing.PyIID +FOLDERID_Pictures: _win32typing.PyIID +FOLDERID_PicturesLibrary: _win32typing.PyIID +FOLDERID_Playlists: _win32typing.PyIID +FOLDERID_PrintHood: _win32typing.PyIID +FOLDERID_PrintersFolder: _win32typing.PyIID +FOLDERID_Profile: _win32typing.PyIID +FOLDERID_ProgramData: _win32typing.PyIID +FOLDERID_ProgramFiles: _win32typing.PyIID +FOLDERID_ProgramFilesCommon: _win32typing.PyIID +FOLDERID_ProgramFilesCommonX64: _win32typing.PyIID +FOLDERID_ProgramFilesCommonX86: _win32typing.PyIID +FOLDERID_ProgramFilesX64: _win32typing.PyIID +FOLDERID_ProgramFilesX86: _win32typing.PyIID +FOLDERID_Programs: _win32typing.PyIID +FOLDERID_Public: _win32typing.PyIID +FOLDERID_PublicDesktop: _win32typing.PyIID +FOLDERID_PublicDocuments: _win32typing.PyIID +FOLDERID_PublicDownloads: _win32typing.PyIID +FOLDERID_PublicGameTasks: _win32typing.PyIID +FOLDERID_PublicLibraries: _win32typing.PyIID +FOLDERID_PublicMusic: _win32typing.PyIID +FOLDERID_PublicPictures: _win32typing.PyIID +FOLDERID_PublicRingtones: _win32typing.PyIID +FOLDERID_PublicVideos: _win32typing.PyIID +FOLDERID_QuickLaunch: _win32typing.PyIID +FOLDERID_Recent: _win32typing.PyIID +FOLDERID_RecordedTVLibrary: _win32typing.PyIID +FOLDERID_RecycleBinFolder: _win32typing.PyIID +FOLDERID_ResourceDir: _win32typing.PyIID +FOLDERID_Ringtones: _win32typing.PyIID +FOLDERID_RoamingAppData: _win32typing.PyIID +FOLDERID_SEARCH_CSC: _win32typing.PyIID +FOLDERID_SEARCH_MAPI: _win32typing.PyIID +FOLDERID_SampleMusic: _win32typing.PyIID +FOLDERID_SamplePictures: _win32typing.PyIID +FOLDERID_SamplePlaylists: _win32typing.PyIID +FOLDERID_SampleVideos: _win32typing.PyIID +FOLDERID_SavedGames: _win32typing.PyIID +FOLDERID_SavedSearches: _win32typing.PyIID +FOLDERID_SearchHome: _win32typing.PyIID +FOLDERID_SendTo: _win32typing.PyIID +FOLDERID_SidebarDefaultParts: _win32typing.PyIID +FOLDERID_SidebarParts: _win32typing.PyIID +FOLDERID_StartMenu: _win32typing.PyIID +FOLDERID_Startup: _win32typing.PyIID +FOLDERID_SyncManagerFolder: _win32typing.PyIID +FOLDERID_SyncResultsFolder: _win32typing.PyIID +FOLDERID_SyncSetupFolder: _win32typing.PyIID +FOLDERID_System: _win32typing.PyIID +FOLDERID_SystemX86: _win32typing.PyIID +FOLDERID_Templates: _win32typing.PyIID +FOLDERID_UserPinned: _win32typing.PyIID +FOLDERID_UserProfiles: _win32typing.PyIID +FOLDERID_UserProgramFiles: _win32typing.PyIID +FOLDERID_UserProgramFilesCommon: _win32typing.PyIID +FOLDERID_UsersFiles: _win32typing.PyIID +FOLDERID_UsersLibraries: _win32typing.PyIID +FOLDERID_Videos: _win32typing.PyIID +FOLDERID_VideosLibrary: _win32typing.PyIID +FOLDERID_Windows: _win32typing.PyIID +FOLDERTYPEID_Communications: _win32typing.PyIID +FOLDERTYPEID_CompressedFolder: _win32typing.PyIID +FOLDERTYPEID_Contacts: _win32typing.PyIID +FOLDERTYPEID_ControlPanelCategory: _win32typing.PyIID +FOLDERTYPEID_ControlPanelClassic: _win32typing.PyIID +FOLDERTYPEID_Documents: _win32typing.PyIID +FOLDERTYPEID_Games: _win32typing.PyIID +FOLDERTYPEID_Generic: _win32typing.PyIID +FOLDERTYPEID_GenericLibrary: _win32typing.PyIID +FOLDERTYPEID_GenericSearchResults: _win32typing.PyIID +FOLDERTYPEID_Invalid: _win32typing.PyIID +FOLDERTYPEID_Music: _win32typing.PyIID +FOLDERTYPEID_NetworkExplorer: _win32typing.PyIID +FOLDERTYPEID_OpenSearch: _win32typing.PyIID +FOLDERTYPEID_OtherUsers: _win32typing.PyIID +FOLDERTYPEID_Pictures: _win32typing.PyIID +FOLDERTYPEID_Printers: _win32typing.PyIID +FOLDERTYPEID_PublishedItems: _win32typing.PyIID +FOLDERTYPEID_RecordedTV: _win32typing.PyIID +FOLDERTYPEID_RecycleBin: _win32typing.PyIID +FOLDERTYPEID_SavedGames: _win32typing.PyIID +FOLDERTYPEID_SearchConnector: _win32typing.PyIID +FOLDERTYPEID_SearchHome: _win32typing.PyIID +FOLDERTYPEID_Searches: _win32typing.PyIID +FOLDERTYPEID_SoftwareExplorer: _win32typing.PyIID +FOLDERTYPEID_StartMenu: _win32typing.PyIID +FOLDERTYPEID_UserFiles: _win32typing.PyIID +FOLDERTYPEID_UsersLibraries: _win32typing.PyIID +FOLDERTYPEID_Videos: _win32typing.PyIID +HOTKEYF_ALT: int +HOTKEYF_CONTROL: int +HOTKEYF_EXT: int +HOTKEYF_SHIFT: int +IID_CDefView: _win32typing.PyIID +IID_IADesktopP2: _win32typing.PyIID +IID_IActiveDesktop: _win32typing.PyIID +IID_IActiveDesktopP: _win32typing.PyIID +IID_IApplicationDestinations: _win32typing.PyIID +IID_IApplicationDocumentLists: _win32typing.PyIID +IID_IAsyncOperation: _win32typing.PyIID +IID_IBrowserFrameOptions: _win32typing.PyIID +IID_ICategorizer: _win32typing.PyIID +IID_ICategoryProvider: _win32typing.PyIID +IID_IColumnProvider: _win32typing.PyIID +IID_IContextMenu: _win32typing.PyIID +IID_IContextMenu2: _win32typing.PyIID +IID_IContextMenu3: _win32typing.PyIID +IID_ICopyHook: _win32typing.PyIID +IID_ICopyHookA: _win32typing.PyIID +IID_ICopyHookW: _win32typing.PyIID +IID_ICurrentItem: _win32typing.PyIID +IID_ICustomDestinationList: _win32typing.PyIID +IID_IDefaultExtractIconInit: _win32typing.PyIID +IID_IDeskBand: _win32typing.PyIID +IID_IDisplayItem: _win32typing.PyIID +IID_IDockingWindow: _win32typing.PyIID +IID_IDropTargetHelper: _win32typing.PyIID +IID_IEmptyVolumeCache: _win32typing.PyIID +IID_IEmptyVolumeCache2: _win32typing.PyIID +IID_IEmptyVolumeCacheCallBack: _win32typing.PyIID +IID_IEnumExplorerCommand: _win32typing.PyIID +IID_IEnumIDList: _win32typing.PyIID +IID_IEnumObjects: _win32typing.PyIID +IID_IEnumResources: _win32typing.PyIID +IID_IEnumShellItems: _win32typing.PyIID +IID_IExplorerBrowser: _win32typing.PyIID +IID_IExplorerBrowserEvents: _win32typing.PyIID +IID_IExplorerCommand: _win32typing.PyIID +IID_IExplorerCommandProvider: _win32typing.PyIID +IID_IExplorerPaneVisibility: _win32typing.PyIID +IID_IExtractIcon: _win32typing.PyIID +IID_IExtractIconW: _win32typing.PyIID +IID_IExtractImage: _win32typing.PyIID +IID_IFileOperation: _win32typing.PyIID +IID_IFileOperationProgressSink: _win32typing.PyIID +IID_IIdentityName: _win32typing.PyIID +IID_IKnownFolder: _win32typing.PyIID +IID_IKnownFolderManager: _win32typing.PyIID +IID_INameSpaceTreeControl: _win32typing.PyIID +IID_IObjectArray: _win32typing.PyIID +IID_IObjectCollection: _win32typing.PyIID +IID_IPersistFolder: _win32typing.PyIID +IID_IPersistFolder2: _win32typing.PyIID +IID_IQueryAssociations: _win32typing.PyIID +IID_IRelatedItem: _win32typing.PyIID +IID_IShellBrowser: _win32typing.PyIID +IID_IShellCopyHook: _win32typing.PyIID +IID_IShellCopyHookA: _win32typing.PyIID +IID_IShellCopyHookW: _win32typing.PyIID +IID_IShellExtInit: _win32typing.PyIID +IID_IShellFolder: _win32typing.PyIID +IID_IShellFolder2: _win32typing.PyIID +IID_IShellIcon: _win32typing.PyIID +IID_IShellIconOverlay: _win32typing.PyIID +IID_IShellIconOverlayIdentifier: _win32typing.PyIID +IID_IShellIconOverlayManager: _win32typing.PyIID +IID_IShellItem: _win32typing.PyIID +IID_IShellItem2: _win32typing.PyIID +IID_IShellItemArray: _win32typing.PyIID +IID_IShellItemResources: _win32typing.PyIID +IID_IShellLibrary: _win32typing.PyIID +IID_IShellLink: _win32typing.PyIID +IID_IShellLinkA: _win32typing.PyIID +IID_IShellLinkDataList: _win32typing.PyIID +IID_IShellLinkW: _win32typing.PyIID +IID_IShellView: _win32typing.PyIID +IID_ITaskbarList: _win32typing.PyIID +IID_ITransferAdviseSink: _win32typing.PyIID +IID_ITransferDestination: _win32typing.PyIID +IID_ITransferMediumItem: _win32typing.PyIID +IID_ITransferSource: _win32typing.PyIID +IID_IUniformResourceLocator: _win32typing.PyIID +ResourceTypeStream: _win32typing.PyIID +SID_CtxQueryAssociations: _win32typing.PyIID +SID_DefView: _win32typing.PyIID +SID_LinkSite: _win32typing.PyIID +SID_MenuShellFolder: _win32typing.PyIID +SID_SCommDlgBrowser: _win32typing.PyIID +SID_SGetViewFromViewDual: _win32typing.PyIID +SID_SInternetExplorer: _win32typing.PyIID +SID_SMenuBandBKContextMenu: _win32typing.PyIID +SID_SMenuBandBottom: _win32typing.PyIID +SID_SMenuBandBottomSelected: _win32typing.PyIID +SID_SMenuBandChild: _win32typing.PyIID +SID_SMenuBandContextMenuModifier: _win32typing.PyIID +SID_SMenuBandParent: _win32typing.PyIID +SID_SMenuBandTop: _win32typing.PyIID +SID_SMenuPopup: _win32typing.PyIID +SID_SProgressUI: _win32typing.PyIID +SID_SShellBrowser: _win32typing.PyIID +SID_SShellDesktop: _win32typing.PyIID +SID_STopLevelBrowser: _win32typing.PyIID +SID_STopWindow: _win32typing.PyIID +SID_SUrlHistory: _win32typing.PyIID +SID_SWebBrowserApp: _win32typing.PyIID +SID_ShellFolderViewCB: _win32typing.PyIID +SLGP_RAWPATH: int +SLGP_SHORTPATH: int +SLGP_UNCPRIORITY: int +SLR_ANY_MATCH: int +SLR_INVOKE_MSI: int +SLR_NOLINKINFO: int +SLR_NOSEARCH: int +SLR_NOTRACK: int +SLR_NOUPDATE: int +SLR_NO_UI: int +SLR_UPDATE: int +VID_Details: _win32typing.PyIID +VID_LargeIcons: _win32typing.PyIID +VID_List: _win32typing.PyIID +VID_SmallIcons: _win32typing.PyIID +VID_ThumbStrip: _win32typing.PyIID +VID_Thumbnails: _win32typing.PyIID +VID_Tile: _win32typing.PyIID + +def SHGetKnownFolderPath(*args, **kwargs): ... # incomplete diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/shell/shellcon.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/shell/shellcon.pyi new file mode 100644 index 000000000..88e92081b --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/shell/shellcon.pyi @@ -0,0 +1,1399 @@ +from _typeshed import Incomplete + +WM_USER: int +DROPEFFECT_NONE: int +DROPEFFECT_COPY: int +DROPEFFECT_MOVE: int +DROPEFFECT_LINK: int +DROPEFFECT_SCROLL: int +FO_MOVE: int +FO_COPY: int +FO_DELETE: int +FO_RENAME: int +FOF_MULTIDESTFILES: int +FOF_CONFIRMMOUSE: int +FOF_SILENT: int +FOF_RENAMEONCOLLISION: int +FOF_NOCONFIRMATION: int +FOF_WANTMAPPINGHANDLE: int +FOF_ALLOWUNDO: int +FOF_FILESONLY: int +FOF_SIMPLEPROGRESS: int +FOF_NOCONFIRMMKDIR: int +FOF_NOERRORUI: int +FOF_NOCOPYSECURITYATTRIBS: int +FOF_NORECURSION: int +FOF_NO_CONNECTED_ELEMENTS: int +FOF_WANTNUKEWARNING: int +FOF_NORECURSEREPARSE: int +FOF_NO_UI: Incomplete +FOFX_NOSKIPJUNCTIONS: int +FOFX_PREFERHARDLINK: int +FOFX_SHOWELEVATIONPROMPT: int +FOFX_EARLYFAILURE: int +FOFX_PRESERVEFILEEXTENSIONS: int +FOFX_KEEPNEWERFILE: int +FOFX_NOCOPYHOOKS: int +FOFX_NOMINIMIZEBOX: int +FOFX_MOVEACLSACROSSVOLUMES: int +FOFX_DONTDISPLAYSOURCEPATH: int +FOFX_DONTDISPLAYDESTPATH: int +FOFX_REQUIREELEVATION: int +FOFX_COPYASDOWNLOAD: int +FOFX_DONTDISPLAYLOCATIONS: int +PO_DELETE: int +PO_RENAME: int +PO_PORTCHANGE: int +PO_REN_PORT: int +SE_ERR_FNF: int +SE_ERR_PNF: int +SE_ERR_ACCESSDENIED: int +SE_ERR_OOM: int +SE_ERR_DLLNOTFOUND: int +SE_ERR_SHARE: int +SE_ERR_ASSOCINCOMPLETE: int +SE_ERR_DDETIMEOUT: int +SE_ERR_DDEFAIL: int +SE_ERR_DDEBUSY: int +SE_ERR_NOASSOC: int +SEE_MASK_CLASSNAME: int +SEE_MASK_CLASSKEY: int +SEE_MASK_IDLIST: int +SEE_MASK_INVOKEIDLIST: int +SEE_MASK_ICON: int +SEE_MASK_HOTKEY: int +SEE_MASK_NOCLOSEPROCESS: int +SEE_MASK_CONNECTNETDRV: int +SEE_MASK_FLAG_DDEWAIT: int +SEE_MASK_DOENVSUBST: int +SEE_MASK_FLAG_NO_UI: int +SEE_MASK_UNICODE: int +SEE_MASK_NO_CONSOLE: int +SEE_MASK_ASYNCOK: int +SEE_MASK_HMONITOR: int +SHERB_NOCONFIRMATION: int +SHERB_NOPROGRESSUI: int +SHERB_NOSOUND: int +NIM_ADD: int +NIM_MODIFY: int +NIM_DELETE: int +NIF_MESSAGE: int +NIF_ICON: int +NIF_TIP: int +SHGFI_ICON: int +SHGFI_DISPLAYNAME: int +SHGFI_TYPENAME: int +SHGFI_ATTRIBUTES: int +SHGFI_ICONLOCATION: int +SHGFI_EXETYPE: int +SHGFI_SYSICONINDEX: int +SHGFI_LINKOVERLAY: int +SHGFI_SELECTED: int +SHGFI_ATTR_SPECIFIED: int +SHGFI_LARGEICON: int +SHGFI_SMALLICON: int +SHGFI_OPENICON: int +SHGFI_SHELLICONSIZE: int +SHGFI_PIDL: int +SHGFI_USEFILEATTRIBUTES: int +SHGNLI_PIDL: int +SHGNLI_PREFIXNAME: int +SHGNLI_NOUNIQUE: int +PRINTACTION_OPEN: int +PRINTACTION_PROPERTIES: int +PRINTACTION_NETINSTALL: int +PRINTACTION_NETINSTALLLINK: int +PRINTACTION_TESTPAGE: int +PRINTACTION_OPENNETPRN: int +PRINTACTION_DOCUMENTDEFAULTS: int +PRINTACTION_SERVERPROPERTIES: int +CMF_NORMAL: int +CMF_DEFAULTONLY: int +CMF_VERBSONLY: int +CMF_EXPLORE: int +CMF_NOVERBS: int +CMF_CANRENAME: int +CMF_NODEFAULT: int +CMF_INCLUDESTATIC: int +CMF_ITEMMENU: int +CMF_EXTENDEDVERBS: int +CMF_DISABLEDVERBS: int +CMF_ASYNCVERBSTATE: int +CMF_OPTIMIZEFORINVOKE: int +CMF_SYNCCASCADEMENU: int +CMF_DONOTPICKDEFAULT: int +CMF_RESERVED: int +GCS_VERBA: int +GCS_HELPTEXTA: int +GCS_VALIDATEA: int +GCS_VERBW: int +GCS_HELPTEXTW: int +GCS_VALIDATEW: int +GCS_UNICODE: int +GCS_VERB: int +GCS_HELPTEXT: int +GCS_VALIDATE: int +CMDSTR_NEWFOLDERA: str +CMDSTR_VIEWLISTA: str +CMDSTR_VIEWDETAILSA: str +CMDSTR_NEWFOLDER: str +CMDSTR_VIEWLIST: str +CMDSTR_VIEWDETAILS: str +CMIC_MASK_HOTKEY: int +CMIC_MASK_ICON: int +CMIC_MASK_FLAG_NO_UI: int +CMIC_MASK_UNICODE: int +CMIC_MASK_NO_CONSOLE: int +CMIC_MASK_ASYNCOK: int +CMIC_MASK_PTINVOKE: int +GIL_OPENICON: int +GIL_FORSHELL: int +GIL_ASYNC: int +GIL_DEFAULTICON: int +GIL_FORSHORTCUT: int +GIL_CHECKSHIELD: int +GIL_SIMULATEDOC: int +GIL_PERINSTANCE: int +GIL_PERCLASS: int +GIL_NOTFILENAME: int +GIL_DONTCACHE: int +GIL_SHIELD: int +GIL_FORCENOSHIELD: int +ISIOI_ICONFILE: int +ISIOI_ICONINDEX: int +ISIOI_SYSIMAGELISTINDEX: int +FVSIF_RECT: int +FVSIF_PINNED: int +FVSIF_NEWFAILED: int +FVSIF_NEWFILE: int +FVSIF_CANVIEWIT: int +FCIDM_SHVIEWFIRST: int +FCIDM_SHVIEWLAST: int +FCIDM_BROWSERFIRST: int +FCIDM_BROWSERLAST: int +FCIDM_GLOBALFIRST: int +FCIDM_GLOBALLAST: int +FCIDM_MENU_FILE: Incomplete +FCIDM_MENU_EDIT: Incomplete +FCIDM_MENU_VIEW: Incomplete +FCIDM_MENU_VIEW_SEP_OPTIONS: Incomplete +FCIDM_MENU_TOOLS: Incomplete +FCIDM_MENU_TOOLS_SEP_GOTO: Incomplete +FCIDM_MENU_HELP: Incomplete +FCIDM_MENU_FIND: Incomplete +FCIDM_MENU_EXPLORE: Incomplete +FCIDM_MENU_FAVORITES: Incomplete +FCIDM_TOOLBAR: Incomplete +FCIDM_STATUS: Incomplete +IDC_OFFLINE_HAND: int +SBSP_DEFBROWSER: int +SBSP_SAMEBROWSER: int +SBSP_NEWBROWSER: int +SBSP_DEFMODE: int +SBSP_OPENMODE: int +SBSP_EXPLOREMODE: int +SBSP_ABSOLUTE: int +SBSP_RELATIVE: int +SBSP_PARENT: int +SBSP_NAVIGATEBACK: int +SBSP_NAVIGATEFORWARD: int +SBSP_ALLOW_AUTONAVIGATE: int +SBSP_INITIATEDBYHLINKFRAME: int +SBSP_REDIRECT: int +SBSP_WRITENOHISTORY: int +SBSP_NOAUTOSELECT: int +FCW_STATUS: int +FCW_TOOLBAR: int +FCW_TREE: int +FCW_INTERNETBAR: int +FCW_PROGRESS: int +FCT_MERGE: int +FCT_CONFIGABLE: int +FCT_ADDTOEND: int +CDBOSC_SETFOCUS: int +CDBOSC_KILLFOCUS: int +CDBOSC_SELCHANGE: int +CDBOSC_RENAME: int +SVSI_DESELECT: int +SVSI_SELECT: int +SVSI_EDIT: int +SVSI_DESELECTOTHERS: int +SVSI_ENSUREVISIBLE: int +SVSI_FOCUSED: int +SVSI_TRANSLATEPT: int +SVGIO_BACKGROUND: int +SVGIO_SELECTION: int +SVGIO_ALLVIEW: int +SVGIO_CHECKED: Incomplete +SVGIO_TYPE_MASK: Incomplete +SVGIO_FLAG_VIEWORDER: int +STRRET_WSTR: int +STRRET_OFFSET: int +STRRET_CSTR: int +CSIDL_DESKTOP: int +CSIDL_INTERNET: int +CSIDL_PROGRAMS: int +CSIDL_CONTROLS: int +CSIDL_PRINTERS: int +CSIDL_PERSONAL: int +CSIDL_FAVORITES: int +CSIDL_STARTUP: int +CSIDL_RECENT: int +CSIDL_SENDTO: int +CSIDL_BITBUCKET: int +CSIDL_STARTMENU: int +CSIDL_MYDOCUMENTS: int +CSIDL_MYMUSIC: int +CSIDL_MYVIDEO: int +CSIDL_DESKTOPDIRECTORY: int +CSIDL_DRIVES: int +CSIDL_NETWORK: int +CSIDL_NETHOOD: int +CSIDL_FONTS: int +CSIDL_TEMPLATES: int +CSIDL_COMMON_STARTMENU: int +CSIDL_COMMON_PROGRAMS: int +CSIDL_COMMON_STARTUP: int +CSIDL_COMMON_DESKTOPDIRECTORY: int +CSIDL_APPDATA: int +CSIDL_PRINTHOOD: int +CSIDL_LOCAL_APPDATA: int +CSIDL_ALTSTARTUP: int +CSIDL_COMMON_ALTSTARTUP: int +CSIDL_COMMON_FAVORITES: int +CSIDL_INTERNET_CACHE: int +CSIDL_COOKIES: int +CSIDL_HISTORY: int +CSIDL_COMMON_APPDATA: int +CSIDL_WINDOWS: int +CSIDL_SYSTEM: int +CSIDL_PROGRAM_FILES: int +CSIDL_MYPICTURES: int +CSIDL_PROFILE: int +CSIDL_SYSTEMX86: int +CSIDL_PROGRAM_FILESX86: int +CSIDL_PROGRAM_FILES_COMMON: int +CSIDL_PROGRAM_FILES_COMMONX86: int +CSIDL_COMMON_TEMPLATES: int +CSIDL_COMMON_DOCUMENTS: int +CSIDL_COMMON_ADMINTOOLS: int +CSIDL_ADMINTOOLS: int +CSIDL_CONNECTIONS: int +CSIDL_COMMON_MUSIC: int +CSIDL_COMMON_PICTURES: int +CSIDL_COMMON_VIDEO: int +CSIDL_RESOURCES: int +CSIDL_RESOURCES_LOCALIZED: int +CSIDL_COMMON_OEM_LINKS: int +CSIDL_CDBURN_AREA: int +CSIDL_COMPUTERSNEARME: int +BIF_RETURNONLYFSDIRS: int +BIF_DONTGOBELOWDOMAIN: int +BIF_STATUSTEXT: int +BIF_RETURNFSANCESTORS: int +BIF_EDITBOX: int +BIF_VALIDATE: int +BIF_BROWSEFORCOMPUTER: int +BIF_BROWSEFORPRINTER: int +BIF_BROWSEINCLUDEFILES: int +BFFM_INITIALIZED: int +BFFM_SELCHANGED: int +BFFM_VALIDATEFAILEDA: int +BFFM_VALIDATEFAILEDW: int +BFFM_SETSTATUSTEXTA: Incomplete +BFFM_ENABLEOK: Incomplete +BFFM_SETSELECTIONA: Incomplete +BFFM_SETSELECTIONW: Incomplete +BFFM_SETSTATUSTEXTW: Incomplete +BFFM_SETSTATUSTEXT: Incomplete +BFFM_SETSELECTION: Incomplete +BFFM_VALIDATEFAILED: int +SFGAO_CANCOPY: int +SFGAO_CANMOVE: int +SFGAO_CANLINK: int +SFGAO_CANRENAME: int +SFGAO_CANDELETE: int +SFGAO_HASPROPSHEET: int +SFGAO_DROPTARGET: int +SFGAO_CAPABILITYMASK: int +SFGAO_LINK: int +SFGAO_SHARE: int +SFGAO_READONLY: int +SFGAO_GHOSTED: int +SFGAO_HIDDEN: int +SFGAO_DISPLAYATTRMASK: int +SFGAO_FILESYSANCESTOR: int +SFGAO_FOLDER: int +SFGAO_FILESYSTEM: int +SFGAO_HASSUBFOLDER: int +SFGAO_CONTENTSMASK: int +SFGAO_VALIDATE: int +SFGAO_REMOVABLE: int +SFGAO_COMPRESSED: int +SFGAO_BROWSABLE: int +SFGAO_NONENUMERATED: int +SFGAO_NEWCONTENT: int +SFGAO_STORAGE: int +DWFRF_NORMAL: int +DWFRF_DELETECONFIGDATA: int +DWFAF_HIDDEN: int +DBIM_MINSIZE: int +DBIM_MAXSIZE: int +DBIM_INTEGRAL: int +DBIM_ACTUAL: int +DBIM_TITLE: int +DBIM_MODEFLAGS: int +DBIM_BKCOLOR: int +DBIMF_NORMAL: int +DBIMF_VARIABLEHEIGHT: int +DBIMF_DEBOSSED: int +DBIMF_BKCOLOR: int +DBIF_VIEWMODE_NORMAL: int +DBIF_VIEWMODE_VERTICAL: int +DBIF_VIEWMODE_FLOATING: int +DBIF_VIEWMODE_TRANSPARENT: int +COMPONENT_TOP: int +COMP_TYPE_HTMLDOC: int +COMP_TYPE_PICTURE: int +COMP_TYPE_WEBSITE: int +COMP_TYPE_CONTROL: int +COMP_TYPE_CFHTML: int +COMP_TYPE_MAX: int +AD_APPLY_SAVE: int +AD_APPLY_HTMLGEN: int +AD_APPLY_REFRESH: int +AD_APPLY_ALL: Incomplete +AD_APPLY_FORCE: int +AD_APPLY_BUFFERED_REFRESH: int +WPSTYLE_CENTER: int +WPSTYLE_TILE: int +WPSTYLE_STRETCH: int +WPSTYLE_MAX: int +COMP_ELEM_TYPE: int +COMP_ELEM_CHECKED: int +COMP_ELEM_DIRTY: int +COMP_ELEM_NOSCROLL: int +COMP_ELEM_POS_LEFT: int +COMP_ELEM_POS_TOP: int +COMP_ELEM_SIZE_WIDTH: int +COMP_ELEM_SIZE_HEIGHT: int +COMP_ELEM_POS_ZINDEX: int +COMP_ELEM_SOURCE: int +COMP_ELEM_FRIENDLYNAME: int +COMP_ELEM_SUBSCRIBEDURL: int +ADDURL_SILENT: int +CFSTR_SHELLIDLIST: str +CFSTR_SHELLIDLISTOFFSET: str +CFSTR_NETRESOURCES: str +CFSTR_FILEDESCRIPTORA: str +CFSTR_FILEDESCRIPTORW: str +CFSTR_FILECONTENTS: str +CFSTR_FILENAMEA: str +CFSTR_FILENAMEW: str +CFSTR_PRINTERGROUP: str +CFSTR_FILENAMEMAPA: str +CFSTR_FILENAMEMAPW: str +CFSTR_SHELLURL: str +CFSTR_INETURLA: str +CFSTR_INETURLW: str +CFSTR_PREFERREDDROPEFFECT: str +CFSTR_PERFORMEDDROPEFFECT: str +CFSTR_PASTESUCCEEDED: str +CFSTR_INDRAGLOOP: str +CFSTR_DRAGCONTEXT: str +CFSTR_MOUNTEDVOLUME: str +CFSTR_PERSISTEDDATAOBJECT: str +CFSTR_TARGETCLSID: str +CFSTR_LOGICALPERFORMEDDROPEFFECT: str +CFSTR_AUTOPLAY_SHELLIDLISTS: str +CFSTR_FILEDESCRIPTOR: str +CFSTR_FILENAME: str +CFSTR_FILENAMEMAP: str +DVASPECT_SHORTNAME: int +SHCNE_RENAMEITEM: int +SHCNE_CREATE: int +SHCNE_DELETE: int +SHCNE_MKDIR: int +SHCNE_RMDIR: int +SHCNE_MEDIAINSERTED: int +SHCNE_MEDIAREMOVED: int +SHCNE_DRIVEREMOVED: int +SHCNE_DRIVEADD: int +SHCNE_NETSHARE: int +SHCNE_NETUNSHARE: int +SHCNE_ATTRIBUTES: int +SHCNE_UPDATEDIR: int +SHCNE_UPDATEITEM: int +SHCNE_SERVERDISCONNECT: int +SHCNE_UPDATEIMAGE: int +SHCNE_DRIVEADDGUI: int +SHCNE_RENAMEFOLDER: int +SHCNE_FREESPACE: int +SHCNE_EXTENDED_EVENT: int +SHCNE_ASSOCCHANGED: int +SHCNE_DISKEVENTS: int +SHCNE_GLOBALEVENTS: int +SHCNE_ALLEVENTS: int +SHCNE_INTERRUPT: int +SHCNEE_ORDERCHANGED: int +SHCNF_IDLIST: int +SHCNF_PATHA: int +SHCNF_PRINTERA: int +SHCNF_DWORD: int +SHCNF_PATHW: int +SHCNF_PRINTERW: int +SHCNF_TYPE: int +SHCNF_FLUSH: int +SHCNF_FLUSHNOWAIT: int +SHCNF_PATH: int +SHCNF_PRINTER: int +QIF_CACHED: int +QIF_DONTEXPANDFOLDER: int +SHARD_PIDL: int +SHARD_PATHA: int +SHARD_PATHW: int +SHARD_APPIDINFO: int +SHARD_APPIDINFOIDLIST: int +SHARD_LINK: int +SHARD_APPIDINFOLINK: int +SHARD_SHELLITEM: int +SHARD_PATH: int +SHGDFIL_FINDDATA: int +SHGDFIL_NETRESOURCE: int +SHGDFIL_DESCRIPTIONID: int +SHDID_ROOT_REGITEM: int +SHDID_FS_FILE: int +SHDID_FS_DIRECTORY: int +SHDID_FS_OTHER: int +SHDID_COMPUTER_DRIVE35: int +SHDID_COMPUTER_DRIVE525: int +SHDID_COMPUTER_REMOVABLE: int +SHDID_COMPUTER_FIXED: int +SHDID_COMPUTER_NETDRIVE: int +SHDID_COMPUTER_CDROM: int +SHDID_COMPUTER_RAMDISK: int +SHDID_COMPUTER_OTHER: int +SHDID_NET_DOMAIN: int +SHDID_NET_SERVER: int +SHDID_NET_SHARE: int +SHDID_NET_RESTOFNET: int +SHDID_NET_OTHER: int +PID_IS_URL: int +PID_IS_NAME: int +PID_IS_WORKINGDIR: int +PID_IS_HOTKEY: int +PID_IS_SHOWCMD: int +PID_IS_ICONINDEX: int +PID_IS_ICONFILE: int +PID_IS_WHATSNEW: int +PID_IS_AUTHOR: int +PID_IS_DESCRIPTION: int +PID_IS_COMMENT: int +PID_INTSITE_WHATSNEW: int +PID_INTSITE_AUTHOR: int +PID_INTSITE_LASTVISIT: int +PID_INTSITE_LASTMOD: int +PID_INTSITE_VISITCOUNT: int +PID_INTSITE_DESCRIPTION: int +PID_INTSITE_COMMENT: int +PID_INTSITE_FLAGS: int +PID_INTSITE_CONTENTLEN: int +PID_INTSITE_CONTENTCODE: int +PID_INTSITE_RECURSE: int +PID_INTSITE_WATCH: int +PID_INTSITE_SUBSCRIPTION: int +PID_INTSITE_URL: int +PID_INTSITE_TITLE: int +PID_INTSITE_CODEPAGE: int +PID_INTSITE_TRACKING: int +PIDISF_RECENTLYCHANGED: int +PIDISF_CACHEDSTICKY: int +PIDISF_CACHEIMAGES: int +PIDISF_FOLLOWALLLINKS: int +PIDISM_GLOBAL: int +PIDISM_WATCH: int +PIDISM_DONTWATCH: int +SSF_SHOWALLOBJECTS: int +SSF_SHOWEXTENSIONS: int +SSF_SHOWCOMPCOLOR: int +SSF_SHOWSYSFILES: int +SSF_DOUBLECLICKINWEBVIEW: int +SSF_SHOWATTRIBCOL: int +SSF_DESKTOPHTML: int +SSF_WIN95CLASSIC: int +SSF_DONTPRETTYPATH: int +SSF_SHOWINFOTIP: int +SSF_MAPNETDRVBUTTON: int +SSF_NOCONFIRMRECYCLE: int +SSF_HIDEICONS: int +ABM_NEW: int +ABM_REMOVE: int +ABM_QUERYPOS: int +ABM_SETPOS: int +ABM_GETSTATE: int +ABM_GETTASKBARPOS: int +ABM_ACTIVATE: int +ABM_GETAUTOHIDEBAR: int +ABM_SETAUTOHIDEBAR: int +ABM_WINDOWPOSCHANGED: int +ABN_STATECHANGE: int +ABN_POSCHANGED: int +ABN_FULLSCREENAPP: int +ABN_WINDOWARRANGE: int +ABS_AUTOHIDE: int +ABS_ALWAYSONTOP: int +ABE_LEFT: int +ABE_TOP: int +ABE_RIGHT: int +ABE_BOTTOM: int + +def EIRESID(x): ... + +SHCONTF_FOLDERS: int +SHCONTF_NONFOLDERS: int +SHCONTF_INCLUDEHIDDEN: int +SHCONTF_INIT_ON_FIRST_NEXT: int +SHCONTF_NETPRINTERSRCH: int +SHCONTF_SHAREABLE: int +SHCONTF_STORAGE: int +SHGDN_NORMAL: int +SHGDN_INFOLDER: int +SHGDN_FOREDITING: int +SHGDN_INCLUDE_NONFILESYS: int +SHGDN_FORADDRESSBAR: int +SHGDN_FORPARSING: int +BFO_NONE: int +BFO_BROWSER_PERSIST_SETTINGS: int +BFO_RENAME_FOLDER_OPTIONS_TOINTERNET: int +BFO_BOTH_OPTIONS: int +BIF_PREFER_INTERNET_SHORTCUT: int +BFO_BROWSE_NO_IN_NEW_PROCESS: int +BFO_ENABLE_HYPERLINK_TRACKING: int +BFO_USE_IE_OFFLINE_SUPPORT: int +BFO_SUBSTITUE_INTERNET_START_PAGE: int +BFO_USE_IE_LOGOBANDING: int +BFO_ADD_IE_TOCAPTIONBAR: int +BFO_USE_DIALUP_REF: int +BFO_USE_IE_TOOLBAR: int +BFO_NO_PARENT_FOLDER_SUPPORT: int +BFO_NO_REOPEN_NEXT_RESTART: int +BFO_GO_HOME_PAGE: int +BFO_PREFER_IEPROCESS: int +BFO_SHOW_NAVIGATION_CANCELLED: int +BFO_QUERY_ALL: int +PID_FINDDATA: int +PID_NETRESOURCE: int +PID_DESCRIPTIONID: int +PID_WHICHFOLDER: int +PID_NETWORKLOCATION: int +PID_COMPUTERNAME: int +PID_DISPLACED_FROM: int +PID_DISPLACED_DATE: int +PID_SYNC_COPY_IN: int +PID_MISC_STATUS: int +PID_MISC_ACCESSCOUNT: int +PID_MISC_OWNER: int +PID_HTMLINFOTIPFILE: int +PID_MISC_PICS: int +PID_DISPLAY_PROPERTIES: int +PID_INTROTEXT: int +PIDSI_ARTIST: int +PIDSI_SONGTITLE: int +PIDSI_ALBUM: int +PIDSI_YEAR: int +PIDSI_COMMENT: int +PIDSI_TRACK: int +PIDSI_GENRE: int +PIDSI_LYRICS: int +PIDDRSI_PROTECTED: int +PIDDRSI_DESCRIPTION: int +PIDDRSI_PLAYCOUNT: int +PIDDRSI_PLAYSTARTS: int +PIDDRSI_PLAYEXPIRES: int +PIDVSI_STREAM_NAME: int +PIDVSI_FRAME_WIDTH: int +PIDVSI_FRAME_HEIGHT: int +PIDVSI_TIMELENGTH: int +PIDVSI_FRAME_COUNT: int +PIDVSI_FRAME_RATE: int +PIDVSI_DATA_RATE: int +PIDVSI_SAMPLE_SIZE: int +PIDVSI_COMPRESSION: int +PIDVSI_STREAM_NUMBER: int +PIDASI_FORMAT: int +PIDASI_TIMELENGTH: int +PIDASI_AVG_DATA_RATE: int +PIDASI_SAMPLE_RATE: int +PIDASI_SAMPLE_SIZE: int +PIDASI_CHANNEL_COUNT: int +PIDASI_STREAM_NUMBER: int +PIDASI_STREAM_NAME: int +PIDASI_COMPRESSION: int +PID_CONTROLPANEL_CATEGORY: int +PID_VOLUME_FREE: int +PID_VOLUME_CAPACITY: int +PID_VOLUME_FILESYSTEM: int +PID_SHARE_CSC_STATUS: int +PID_LINK_TARGET: int +PID_QUERY_RANK: int +PROPSETFLAG_DEFAULT: int +PROPSETFLAG_NONSIMPLE: int +PROPSETFLAG_ANSI: int +PROPSETFLAG_UNBUFFERED: int +PROPSETFLAG_CASE_SENSITIVE: int +PROPSET_BEHAVIOR_CASE_SENSITIVE: int +PID_DICTIONARY: int +PID_CODEPAGE: int +PID_FIRST_USABLE: int +PID_FIRST_NAME_DEFAULT: int +PID_LOCALE: int +PID_MODIFY_TIME: int +PID_SECURITY: int +PID_BEHAVIOR: int +PID_ILLEGAL: int +PID_MIN_READONLY: int +PID_MAX_READONLY: int +PIDDI_THUMBNAIL: int +PIDSI_TITLE: int +PIDSI_SUBJECT: int +PIDSI_AUTHOR: int +PIDSI_KEYWORDS: int +PIDSI_COMMENTS: int +PIDSI_TEMPLATE: int +PIDSI_LASTAUTHOR: int +PIDSI_REVNUMBER: int +PIDSI_EDITTIME: int +PIDSI_LASTPRINTED: int +PIDSI_CREATE_DTM: int +PIDSI_LASTSAVE_DTM: int +PIDSI_PAGECOUNT: int +PIDSI_WORDCOUNT: int +PIDSI_CHARCOUNT: int +PIDSI_THUMBNAIL: int +PIDSI_APPNAME: int +PIDSI_DOC_SECURITY: int +PIDDSI_CATEGORY: int +PIDDSI_PRESFORMAT: int +PIDDSI_BYTECOUNT: int +PIDDSI_LINECOUNT: int +PIDDSI_PARCOUNT: int +PIDDSI_SLIDECOUNT: int +PIDDSI_NOTECOUNT: int +PIDDSI_HIDDENCOUNT: int +PIDDSI_MMCLIPCOUNT: int +PIDDSI_SCALE: int +PIDDSI_HEADINGPAIR: int +PIDDSI_DOCPARTS: int +PIDDSI_MANAGER: int +PIDDSI_COMPANY: int +PIDDSI_LINKSDIRTY: int +PIDMSI_EDITOR: int +PIDMSI_SUPPLIER: int +PIDMSI_SOURCE: int +PIDMSI_SEQUENCE_NO: int +PIDMSI_PROJECT: int +PIDMSI_STATUS: int +PIDMSI_OWNER: int +PIDMSI_RATING: int +PIDMSI_PRODUCTION: int +PIDMSI_COPYRIGHT: int +PRSPEC_INVALID: int +PRSPEC_LPWSTR: int +PRSPEC_PROPID: int +SHCIDS_ALLFIELDS: int +SHCIDS_CANONICALONLY: int +SHCIDS_BITMASK: int +SHCIDS_COLUMNMASK: int +SFGAO_CANMONIKER: int +SFGAO_HASSTORAGE: int +SFGAO_STREAM: int +SFGAO_STORAGEANCESTOR: int +SFGAO_STORAGECAPMASK: int +MAXPROPPAGES: int +PSP_DEFAULT: int +PSP_DLGINDIRECT: int +PSP_USEHICON: int +PSP_USEICONID: int +PSP_USETITLE: int +PSP_RTLREADING: int +PSP_HASHELP: int +PSP_USEREFPARENT: int +PSP_USECALLBACK: int +PSP_PREMATURE: int +PSP_HIDEHEADER: int +PSP_USEHEADERTITLE: int +PSP_USEHEADERSUBTITLE: int +PSP_USEFUSIONCONTEXT: int +PSPCB_ADDREF: int +PSPCB_RELEASE: int +PSPCB_CREATE: int +PSH_DEFAULT: int +PSH_PROPTITLE: int +PSH_USEHICON: int +PSH_USEICONID: int +PSH_PROPSHEETPAGE: int +PSH_WIZARDHASFINISH: int +PSH_WIZARD: int +PSH_USEPSTARTPAGE: int +PSH_NOAPPLYNOW: int +PSH_USECALLBACK: int +PSH_HASHELP: int +PSH_MODELESS: int +PSH_RTLREADING: int +PSH_WIZARDCONTEXTHELP: int +PSH_WIZARD97: int +PSH_WATERMARK: int +PSH_USEHBMWATERMARK: int +PSH_USEHPLWATERMARK: int +PSH_STRETCHWATERMARK: int +PSH_HEADER: int +PSH_USEHBMHEADER: int +PSH_USEPAGELANG: int +PSH_WIZARD_LITE: int +PSH_NOCONTEXTHELP: int +PSCB_INITIALIZED: int +PSCB_PRECREATE: int +PSCB_BUTTONPRESSED: int +PSNRET_NOERROR: int +PSNRET_INVALID: int +PSNRET_INVALID_NOCHANGEPAGE: int +PSNRET_MESSAGEHANDLED: int +PSWIZB_BACK: int +PSWIZB_NEXT: int +PSWIZB_FINISH: int +PSWIZB_DISABLEDFINISH: int +PSBTN_BACK: int +PSBTN_NEXT: int +PSBTN_FINISH: int +PSBTN_OK: int +PSBTN_APPLYNOW: int +PSBTN_CANCEL: int +PSBTN_HELP: int +PSBTN_MAX: int +ID_PSRESTARTWINDOWS: int +ID_PSREBOOTSYSTEM: Incomplete +WIZ_CXDLG: int +WIZ_CYDLG: int +WIZ_CXBMP: int +WIZ_BODYX: int +WIZ_BODYCX: int +PROP_SM_CXDLG: int +PROP_SM_CYDLG: int +PROP_MED_CXDLG: int +PROP_MED_CYDLG: int +PROP_LG_CXDLG: int +PROP_LG_CYDLG: int +ISOLATION_AWARE_USE_STATIC_LIBRARY: int +ISOLATION_AWARE_BUILD_STATIC_LIBRARY: int +SHCOLSTATE_TYPE_STR: int +SHCOLSTATE_TYPE_INT: int +SHCOLSTATE_TYPE_DATE: int +SHCOLSTATE_TYPEMASK: int +SHCOLSTATE_ONBYDEFAULT: int +SHCOLSTATE_SLOW: int +SHCOLSTATE_EXTENDED: int +SHCOLSTATE_SECONDARYUI: int +SHCOLSTATE_HIDDEN: int +SHCOLSTATE_PREFER_VARCMP: int +FWF_AUTOARRANGE: int +FWF_ABBREVIATEDNAMES: int +FWF_SNAPTOGRID: int +FWF_OWNERDATA: int +FWF_BESTFITWINDOW: int +FWF_DESKTOP: int +FWF_SINGLESEL: int +FWF_NOSUBFOLDERS: int +FWF_TRANSPARENT: int +FWF_NOCLIENTEDGE: int +FWF_NOSCROLL: int +FWF_ALIGNLEFT: int +FWF_NOICONS: int +FWF_SHOWSELALWAYS: int +FWF_NOVISIBLE: int +FWF_SINGLECLICKACTIVATE: int +FWF_NOWEBVIEW: int +FWF_HIDEFILENAMES: int +FWF_CHECKSELECT: int +FVM_FIRST: int +FVM_ICON: int +FVM_SMALLICON: int +FVM_LIST: int +FVM_DETAILS: int +FVM_THUMBNAIL: int +FVM_TILE: int +FVM_THUMBSTRIP: int +SVUIA_DEACTIVATE: int +SVUIA_ACTIVATE_NOFOCUS: int +SVUIA_ACTIVATE_FOCUS: int +SVUIA_INPLACEACTIVATE: int +SHCNRF_InterruptLevel: int +SHCNRF_ShellLevel: int +SHCNRF_RecursiveInterrupt: int +SHCNRF_NewDelivery: int +FD_CLSID: int +FD_SIZEPOINT: int +FD_ATTRIBUTES: int +FD_CREATETIME: int +FD_ACCESSTIME: int +FD_WRITESTIME: int +FD_FILESIZE: int +FD_PROGRESSUI: int +FD_LINKUI: int +ASSOCF_INIT_NOREMAPCLSID: int +ASSOCF_INIT_BYEXENAME: int +ASSOCF_OPEN_BYEXENAME: int +ASSOCF_INIT_DEFAULTTOSTAR: int +ASSOCF_INIT_DEFAULTTOFOLDER: int +ASSOCF_NOUSERSETTINGS: int +ASSOCF_NOTRUNCATE: int +ASSOCF_VERIFY: int +ASSOCF_REMAPRUNDLL: int +ASSOCF_NOFIXUPS: int +ASSOCF_IGNOREBASECLASS: int +ASSOCSTR_COMMAND: int +ASSOCSTR_EXECUTABLE: int +ASSOCSTR_FRIENDLYDOCNAME: int +ASSOCSTR_FRIENDLYAPPNAME: int +ASSOCSTR_NOOPEN: int +ASSOCSTR_SHELLNEWVALUE: int +ASSOCSTR_DDECOMMAND: int +ASSOCSTR_DDEIFEXEC: int +ASSOCSTR_DDEAPPLICATION: int +ASSOCSTR_DDETOPIC: int +ASSOCSTR_INFOTIP: int +ASSOCSTR_QUICKTIP: int +ASSOCSTR_TILEINFO: int +ASSOCSTR_CONTENTTYPE: int +ASSOCSTR_DEFAULTICON: int +ASSOCSTR_SHELLEXTENSION: int +ASSOCKEY_SHELLEXECCLASS: int +ASSOCKEY_APP: int +ASSOCKEY_CLASS: int +ASSOCKEY_BASECLASS: int +ASSOCDATA_MSIDESCRIPTOR: int +ASSOCDATA_NOACTIVATEHANDLER: int +ASSOCDATA_QUERYCLASSSTORE: int +ASSOCDATA_HASPERUSERASSOC: int +ASSOCDATA_EDITFLAGS: int +ASSOCDATA_VALUE: int +SHGVSPB_PERUSER: int +SHGVSPB_ALLUSERS: int +SHGVSPB_PERFOLDER: int +SHGVSPB_ALLFOLDERS: int +SHGVSPB_INHERIT: int +SHGVSPB_ROAM: int +SHGVSPB_NOAUTODEFAULTS: int +SHGVSPB_FOLDER: Incomplete +SHGVSPB_FOLDERNODEFAULTS: Incomplete +SHGVSPB_USERDEFAULTS: Incomplete +SHGVSPB_GLOBALDEAFAULTS: Incomplete +SFVM_REARRANGE: int +SFVM_ADDOBJECT: int +SFVM_REMOVEOBJECT: int +SFVM_UPDATEOBJECT: int +SFVM_GETSELECTEDOBJECTS: int +SFVM_SETITEMPOS: int +SFVM_SETCLIPBOARD: int +SFVM_SETPOINTS: int +SLDF_HAS_ID_LIST: int +SLDF_HAS_LINK_INFO: int +SLDF_HAS_NAME: int +SLDF_HAS_RELPATH: int +SLDF_HAS_WORKINGDIR: int +SLDF_HAS_ARGS: int +SLDF_HAS_ICONLOCATION: int +SLDF_UNICODE: int +SLDF_FORCE_NO_LINKINFO: int +SLDF_HAS_EXP_SZ: int +SLDF_RUN_IN_SEPARATE: int +SLDF_HAS_LOGO3ID: int +SLDF_HAS_DARWINID: int +SLDF_RUNAS_USER: int +SLDF_NO_PIDL_ALIAS: int +SLDF_FORCE_UNCNAME: int +SLDF_HAS_EXP_ICON_SZ: int +SLDF_RUN_WITH_SHIMLAYER: int +SLDF_RESERVED: int +EXP_SPECIAL_FOLDER_SIG: int +NT_CONSOLE_PROPS_SIG: int +NT_FE_CONSOLE_PROPS_SIG: int +EXP_DARWIN_ID_SIG: int +EXP_LOGO3_ID_SIG: int +EXP_SZ_ICON_SIG: int +EXP_SZ_LINK_SIG: int +IURL_SETURL_FL_GUESS_PROTOCOL: int +IURL_SETURL_FL_USE_DEFAULT_PROTOCOL: int +IURL_INVOKECOMMAND_FL_ALLOW_UI: int +IURL_INVOKECOMMAND_FL_USE_DEFAULT_VERB: int +IURL_INVOKECOMMAND_FL_DDEWAIT: int +IS_NORMAL: int +IS_FULLSCREEN: int +IS_SPLIT: int +IS_VALIDSIZESTATEBITS: Incomplete +IS_VALIDSTATEBITS: Incomplete +AD_APPLY_DYNAMICREFRESH: int +COMP_ELEM_ORIGINAL_CSI: int +COMP_ELEM_RESTORED_CSI: int +COMP_ELEM_CURITEMSTATE: int +COMP_ELEM_ALL: Incomplete +DTI_ADDUI_DEFAULT: int +DTI_ADDUI_DISPSUBWIZARD: int +DTI_ADDUI_POSITIONITEM: int +COMPONENT_DEFAULT_LEFT: int +COMPONENT_DEFAULT_TOP: int +SSM_CLEAR: int +SSM_SET: int +SSM_REFRESH: int +SSM_UPDATE: int +SCHEME_DISPLAY: int +SCHEME_EDIT: int +SCHEME_LOCAL: int +SCHEME_GLOBAL: int +SCHEME_REFRESH: int +SCHEME_UPDATE: int +SCHEME_DONOTUSE: int +SCHEME_CREATE: int +GADOF_DIRTY: int +EVCF_HASSETTINGS: int +EVCF_ENABLEBYDEFAULT: int +EVCF_REMOVEFROMLIST: int +EVCF_ENABLEBYDEFAULT_AUTO: int +EVCF_DONTSHOWIFZERO: int +EVCF_SETTINGSMODE: int +EVCF_OUTOFDISKSPACE: int +EVCCBF_LASTNOTIFICATION: int +EBO_NONE: int +EBO_NAVIGATEONCE: int +EBO_SHOWFRAMES: int +EBO_ALWAYSNAVIGATE: int +EBO_NOTRAVELLOG: int +EBO_NOWRAPPERWINDOW: int +EBF_NONE: int +EBF_SELECTFROMDATAOBJECT: int +EBF_NODROPTARGET: int +ECS_ENABLED: int +ECS_DISABLED: int +ECS_HIDDEN: int +ECS_CHECKBOX: int +ECS_CHECKED: int +ECF_HASSUBCOMMANDS: int +ECF_HASSPLITBUTTON: int +ECF_HIDELABEL: int +ECF_ISSEPARATOR: int +ECF_HASLUASHIELD: int +SIATTRIBFLAGS_AND: int +SIATTRIBFLAGS_OR: int +SIATTRIBFLAGS_APPCOMPAT: int +SIATTRIBFLAGS_MASK: int +SIGDN_NORMALDISPLAY: int +SIGDN_PARENTRELATIVEPARSING: int +SIGDN_DESKTOPABSOLUTEPARSING: int +SIGDN_PARENTRELATIVEEDITING: int +SIGDN_DESKTOPABSOLUTEEDITING: int +SIGDN_FILESYSPATH: int +SIGDN_URL: int +SIGDN_PARENTRELATIVEFORADDRESSBAR: int +SIGDN_PARENTRELATIVE: int +SICHINT_DISPLAY: Incomplete +SICHINT_ALLFIELDS: int +SICHINT_CANONICAL: int +ASSOCCLASS_SHELL_KEY: int +ASSOCCLASS_PROGID_KEY: int +ASSOCCLASS_PROGID_STR: int +ASSOCCLASS_CLSID_KEY: int +ASSOCCLASS_CLSID_STR: int +ASSOCCLASS_APP_KEY: int +ASSOCCLASS_APP_STR: int +ASSOCCLASS_SYSTEM_STR: int +ASSOCCLASS_FOLDER: int +ASSOCCLASS_STAR: int +NSTCS_HASEXPANDOS: int +NSTCS_HASLINES: int +NSTCS_SINGLECLICKEXPAND: int +NSTCS_FULLROWSELECT: int +NSTCS_SPRINGEXPAND: int +NSTCS_HORIZONTALSCROLL: int +NSTCS_ROOTHASEXPANDO: int +NSTCS_SHOWSELECTIONALWAYS: int +NSTCS_NOINFOTIP: int +NSTCS_EVENHEIGHT: int +NSTCS_NOREPLACEOPEN: int +NSTCS_DISABLEDRAGDROP: int +NSTCS_NOORDERSTREAM: int +NSTCS_RICHTOOLTIP: int +NSTCS_BORDER: int +NSTCS_NOEDITLABELS: int +NSTCS_TABSTOP: int +NSTCS_FAVORITESMODE: int +NSTCS_AUTOHSCROLL: int +NSTCS_FADEINOUTEXPANDOS: int +NSTCS_EMPTYTEXT: int +NSTCS_CHECKBOXES: int +NSTCS_PARTIALCHECKBOXES: int +NSTCS_EXCLUSIONCHECKBOXES: int +NSTCS_DIMMEDCHECKBOXES: int +NSTCS_NOINDENTCHECKS: int +NSTCS_ALLOWJUNCTIONS: int +NSTCS_SHOWTABSBUTTON: int +NSTCS_SHOWDELETEBUTTON: int +NSTCS_SHOWREFRESHBUTTON: int +NSTCRS_VISIBLE: int +NSTCRS_HIDDEN: int +NSTCRS_EXPANDED: int +NSTCIS_NONE: int +NSTCIS_SELECTED: int +NSTCIS_EXPANDED: int +NSTCIS_BOLD: int +NSTCIS_DISABLED: int +NSTCGNI_NEXT: int +NSTCGNI_NEXTVISIBLE: int +NSTCGNI_PREV: int +NSTCGNI_PREVVISIBLE: int +NSTCGNI_PARENT: int +NSTCGNI_CHILD: int +NSTCGNI_FIRSTVISIBLE: int +NSTCGNI_LASTVISIBLE: int +CLSID_ExplorerBrowser: str +IBrowserFrame_Methods: Incomplete +ICategorizer_Methods: Incomplete +ICategoryProvider_Methods: Incomplete +IContextMenu_Methods: Incomplete +IExplorerCommand_Methods: Incomplete +IExplorerCommandProvider_Methods: Incomplete +IOleWindow_Methods: Incomplete +IPersist_Methods: Incomplete +IPersistFolder_Methods: Incomplete +IPersistFolder2_Methods: Incomplete +IShellExtInit_Methods: Incomplete +IShellView_Methods: Incomplete +IShellFolder_Methods: Incomplete +IShellFolder2_Methods: Incomplete +GPS_DEFAULT: int +GPS_HANDLERPROPERTIESONLY: int +GPS_READWRITE: int +GPS_TEMPORARY: int +GPS_FASTPROPERTIESONLY: int +GPS_OPENSLOWITEM: int +GPS_DELAYCREATION: int +GPS_BESTEFFORT: int +GPS_MASK_VALID: int +STR_AVOID_DRIVE_RESTRICTION_POLICY: str +STR_BIND_DELEGATE_CREATE_OBJECT: str +STR_BIND_FOLDERS_READ_ONLY: str +STR_BIND_FOLDER_ENUM_MODE: str +STR_BIND_FORCE_FOLDER_SHORTCUT_RESOLVE: str +STR_DONT_PARSE_RELATIVE: str +STR_DONT_RESOLVE_LINK: str +STR_FILE_SYS_BIND_DATA: str +STR_GET_ASYNC_HANDLER: str +STR_GPS_BESTEFFORT: str +STR_GPS_DELAYCREATION: str +STR_GPS_FASTPROPERTIESONLY: str +STR_GPS_HANDLERPROPERTIESONLY: str +STR_GPS_NO_OPLOCK: str +STR_GPS_OPENSLOWITEM: str +STR_IFILTER_FORCE_TEXT_FILTER_FALLBACK: str +STR_IFILTER_LOAD_DEFINED_FILTER: str +STR_INTERNAL_NAVIGATE: str +STR_INTERNETFOLDER_PARSE_ONLY_URLMON_BINDABLE: str +STR_ITEM_CACHE_CONTEXT: str +STR_NO_VALIDATE_FILENAME_CHARS: str +STR_PARSE_ALLOW_INTERNET_SHELL_FOLDERS: str +STR_PARSE_AND_CREATE_ITEM: str +STR_PARSE_DONT_REQUIRE_VALIDATED_URLS: str +STR_PARSE_EXPLICIT_ASSOCIATION_SUCCESSFUL: str +STR_PARSE_PARTIAL_IDLIST: str +STR_PARSE_PREFER_FOLDER_BROWSING: str +STR_PARSE_PREFER_WEB_BROWSING: str +STR_PARSE_PROPERTYSTORE: str +STR_PARSE_SHELL_PROTOCOL_TO_FILE_OBJECTS: str +STR_PARSE_SHOW_NET_DIAGNOSTICS_UI: str +STR_PARSE_SKIP_NET_CACHE: str +STR_PARSE_TRANSLATE_ALIASES: str +STR_PARSE_WITH_EXPLICIT_ASSOCAPP: str +STR_PARSE_WITH_EXPLICIT_PROGID: str +STR_PARSE_WITH_PROPERTIES: str +STR_SKIP_BINDING_CLSID: str +STR_TRACK_CLSID: str +KF_REDIRECTION_CAPABILITIES_ALLOW_ALL: int +KF_REDIRECTION_CAPABILITIES_REDIRECTABLE: int +KF_REDIRECTION_CAPABILITIES_DENY_ALL: int +KF_REDIRECTION_CAPABILITIES_DENY_POLICY_REDIRECTED: int +KF_REDIRECTION_CAPABILITIES_DENY_POLICY: int +KF_REDIRECTION_CAPABILITIES_DENY_PERMISSIONS: int +KF_REDIRECT_USER_EXCLUSIVE: int +KF_REDIRECT_COPY_SOURCE_DACL: int +KF_REDIRECT_OWNER_USER: int +KF_REDIRECT_SET_OWNER_EXPLICIT: int +KF_REDIRECT_CHECK_ONLY: int +KF_REDIRECT_WITH_UI: int +KF_REDIRECT_UNPIN: int +KF_REDIRECT_PIN: int +KF_REDIRECT_COPY_CONTENTS: int +KF_REDIRECT_DEL_SOURCE_CONTENTS: int +KF_REDIRECT_EXCLUDE_ALL_KNOWN_SUBFOLDERS: int +KF_CATEGORY_VIRTUAL: int +KF_CATEGORY_FIXED: int +KF_CATEGORY_COMMON: int +KF_CATEGORY_PERUSER: int +FFFP_EXACTMATCH: int +FFFP_NEARESTPARENTMATCH: int +KF_FLAG_CREATE: int +KF_FLAG_DONT_VERIFY: int +KF_FLAG_DONT_UNEXPAND: int +KF_FLAG_NO_ALIAS: int +KF_FLAG_INIT: int +KF_FLAG_DEFAULT_PATH: int +KF_FLAG_NOT_PARENT_RELATIVE: int +KF_FLAG_SIMPLE_IDLIST: int +ADLT_RECENT: int +ADLT_FREQUENT: int +KDC_FREQUENT: int +KDC_RECENT: int +LFF_FORCEFILESYSTEM: int +LFF_STORAGEITEMS: int +LFF_ALLITEMS: int +DSFT_DETECT: int +DSFT_PRIVATE: int +DSFT_PUBLIC: int +LOF_DEFAULT: int +LOF_PINNEDTONAVPANE: int +LOF_MASK_ALL: int +LSF_FAILIFTHERE: int +LSF_OVERRIDEEXISTING: int +LSF_MAKEUNIQUENAME: int +TSF_NORMAL: int +TSF_FAIL_EXIST: int +TSF_RENAME_EXIST: int +TSF_OVERWRITE_EXIST: int +TSF_ALLOW_DECRYPTION: int +TSF_NO_SECURITY: int +TSF_COPY_CREATION_TIME: int +TSF_COPY_WRITE_TIME: int +TSF_USE_FULL_ACCESS: int +TSF_DELETE_RECYCLE_IF_POSSIBLE: int +TSF_COPY_HARD_LINK: int +TSF_COPY_LOCALIZED_NAME: int +TSF_MOVE_AS_COPY_DELETE: int +TSF_SUSPEND_SHELLEVENTS: int +TS_NONE: int +TS_PERFORMING: int +TS_PREPARING: int +TS_INDETERMINATE: int +COPYENGINE_S_YES: int +COPYENGINE_S_NOT_HANDLED: int +COPYENGINE_S_USER_RETRY: int +COPYENGINE_S_USER_IGNORED: int +COPYENGINE_S_MERGE: int +COPYENGINE_S_DONT_PROCESS_CHILDREN: int +COPYENGINE_S_ALREADY_DONE: int +COPYENGINE_S_PENDING: int +COPYENGINE_S_KEEP_BOTH: int +COPYENGINE_S_CLOSE_PROGRAM: int +COPYENGINE_S_COLLISIONRESOLVED: int +COPYENGINE_E_USER_CANCELLED: int +COPYENGINE_E_CANCELLED: int +COPYENGINE_E_REQUIRES_ELEVATION: int +COPYENGINE_E_SAME_FILE: int +COPYENGINE_E_DIFF_DIR: int +COPYENGINE_E_MANY_SRC_1_DEST: int +COPYENGINE_E_DEST_SUBTREE: int +COPYENGINE_E_DEST_SAME_TREE: int +COPYENGINE_E_FLD_IS_FILE_DEST: int +COPYENGINE_E_FILE_IS_FLD_DEST: int +COPYENGINE_E_FILE_TOO_LARGE: int +COPYENGINE_E_REMOVABLE_FULL: int +COPYENGINE_E_DEST_IS_RO_CD: int +COPYENGINE_E_DEST_IS_RW_CD: int +COPYENGINE_E_DEST_IS_R_CD: int +COPYENGINE_E_DEST_IS_RO_DVD: int +COPYENGINE_E_DEST_IS_RW_DVD: int +COPYENGINE_E_DEST_IS_R_DVD: int +COPYENGINE_E_SRC_IS_RO_CD: int +COPYENGINE_E_SRC_IS_RW_CD: int +COPYENGINE_E_SRC_IS_R_CD: int +COPYENGINE_E_SRC_IS_RO_DVD: int +COPYENGINE_E_SRC_IS_RW_DVD: int +COPYENGINE_E_SRC_IS_R_DVD: int +COPYENGINE_E_INVALID_FILES_SRC: int +COPYENGINE_E_INVALID_FILES_DEST: int +COPYENGINE_E_PATH_TOO_DEEP_SRC: int +COPYENGINE_E_PATH_TOO_DEEP_DEST: int +COPYENGINE_E_ROOT_DIR_SRC: int +COPYENGINE_E_ROOT_DIR_DEST: int +COPYENGINE_E_ACCESS_DENIED_SRC: int +COPYENGINE_E_ACCESS_DENIED_DEST: int +COPYENGINE_E_PATH_NOT_FOUND_SRC: int +COPYENGINE_E_PATH_NOT_FOUND_DEST: int +COPYENGINE_E_NET_DISCONNECT_SRC: int +COPYENGINE_E_NET_DISCONNECT_DEST: int +COPYENGINE_E_SHARING_VIOLATION_SRC: int +COPYENGINE_E_SHARING_VIOLATION_DEST: int +COPYENGINE_E_ALREADY_EXISTS_NORMAL: int +COPYENGINE_E_ALREADY_EXISTS_READONLY: int +COPYENGINE_E_ALREADY_EXISTS_SYSTEM: int +COPYENGINE_E_ALREADY_EXISTS_FOLDER: int +COPYENGINE_E_STREAM_LOSS: int +COPYENGINE_E_EA_LOSS: int +COPYENGINE_E_PROPERTY_LOSS: int +COPYENGINE_E_PROPERTIES_LOSS: int +COPYENGINE_E_ENCRYPTION_LOSS: int +COPYENGINE_E_DISK_FULL: int +COPYENGINE_E_DISK_FULL_CLEAN: int +COPYENGINE_E_EA_NOT_SUPPORTED: int +COPYENGINE_E_CANT_REACH_SOURCE: int +COPYENGINE_E_RECYCLE_UNKNOWN_ERROR: int +COPYENGINE_E_RECYCLE_FORCE_NUKE: int +COPYENGINE_E_RECYCLE_SIZE_TOO_BIG: int +COPYENGINE_E_RECYCLE_PATH_TOO_LONG: int +COPYENGINE_E_RECYCLE_BIN_NOT_FOUND: int +COPYENGINE_E_NEWFILE_NAME_TOO_LONG: int +COPYENGINE_E_NEWFOLDER_NAME_TOO_LONG: int +COPYENGINE_E_DIR_NOT_EMPTY: int +COPYENGINE_E_FAT_MAX_IN_ROOT: int +COPYENGINE_E_ACCESSDENIED_READONLY: int +COPYENGINE_E_REDIRECTED_TO_WEBPAGE: int +COPYENGINE_E_SERVER_BAD_FILE_TYPE: int +FOLDERID_NetworkFolder: str +FOLDERID_ComputerFolder: str +FOLDERID_InternetFolder: str +FOLDERID_ControlPanelFolder: str +FOLDERID_PrintersFolder: str +FOLDERID_SyncManagerFolder: str +FOLDERID_SyncSetupFolder: str +FOLDERID_ConflictFolder: str +FOLDERID_SyncResultsFolder: str +FOLDERID_RecycleBinFolder: str +FOLDERID_ConnectionsFolder: str +FOLDERID_Fonts: str +FOLDERID_Desktop: str +FOLDERID_Startup: str +FOLDERID_Programs: str +FOLDERID_StartMenu: str +FOLDERID_Recent: str +FOLDERID_SendTo: str +FOLDERID_Documents: str +FOLDERID_Favorites: str +FOLDERID_NetHood: str +FOLDERID_PrintHood: str +FOLDERID_Templates: str +FOLDERID_CommonStartup: str +FOLDERID_CommonPrograms: str +FOLDERID_CommonStartMenu: str +FOLDERID_PublicDesktop: str +FOLDERID_ProgramData: str +FOLDERID_CommonTemplates: str +FOLDERID_PublicDocuments: str +FOLDERID_RoamingAppData: str +FOLDERID_LocalAppData: str +FOLDERID_LocalAppDataLow: str +FOLDERID_InternetCache: str +FOLDERID_Cookies: str +FOLDERID_History: str +FOLDERID_System: str +FOLDERID_SystemX86: str +FOLDERID_Windows: str +FOLDERID_Profile: str +FOLDERID_Pictures: str +FOLDERID_ProgramFilesX86: str +FOLDERID_ProgramFilesCommonX86: str +FOLDERID_ProgramFilesX64: str +FOLDERID_ProgramFilesCommonX64: str +FOLDERID_ProgramFiles: str +FOLDERID_ProgramFilesCommon: str +FOLDERID_UserProgramFiles: str +FOLDERID_UserProgramFilesCommon: str +FOLDERID_AdminTools: str +FOLDERID_CommonAdminTools: str +FOLDERID_Music: str +FOLDERID_Videos: str +FOLDERID_Ringtones: str +FOLDERID_PublicPictures: str +FOLDERID_PublicMusic: str +FOLDERID_PublicVideos: str +FOLDERID_PublicRingtones: str +FOLDERID_ResourceDir: str +FOLDERID_LocalizedResourcesDir: str +FOLDERID_CommonOEMLinks: str +FOLDERID_CDBurning: str +FOLDERID_UserProfiles: str +FOLDERID_Playlists: str +FOLDERID_SamplePlaylists: str +FOLDERID_SampleMusic: str +FOLDERID_SamplePictures: str +FOLDERID_SampleVideos: str +FOLDERID_PhotoAlbums: str +FOLDERID_Public: str +FOLDERID_ChangeRemovePrograms: str +FOLDERID_AppUpdates: str +FOLDERID_AddNewPrograms: str +FOLDERID_Downloads: str +FOLDERID_PublicDownloads: str +FOLDERID_SavedSearches: str +FOLDERID_QuickLaunch: str +FOLDERID_Contacts: str +FOLDERID_SidebarParts: str +FOLDERID_SidebarDefaultParts: str +FOLDERID_PublicGameTasks: str +FOLDERID_GameTasks: str +FOLDERID_SavedGames: str +FOLDERID_Games: str +FOLDERID_SEARCH_MAPI: str +FOLDERID_SEARCH_CSC: str +FOLDERID_Links: str +FOLDERID_UsersFiles: str +FOLDERID_UsersLibraries: str +FOLDERID_SearchHome: str +FOLDERID_OriginalImages: str +FOLDERID_DocumentsLibrary: str +FOLDERID_MusicLibrary: str +FOLDERID_PicturesLibrary: str +FOLDERID_VideosLibrary: str +FOLDERID_RecordedTVLibrary: str +FOLDERID_HomeGroup: str +FOLDERID_HomeGroupCurrentUser: str +FOLDERID_DeviceMetadataStore: str +FOLDERID_Libraries: str +FOLDERID_PublicLibraries: str +FOLDERID_UserPinned: str +FOLDERID_ImplicitAppShortcuts: str +FOLDERID_AccountPictures: str +FOLDERID_PublicUserTiles: str +FOLDERID_AppsFolder: str +FOLDERID_StartMenuAllPrograms: str +FOLDERID_CommonStartMenuPlaces: str +FOLDERID_ApplicationShortcuts: str +FOLDERID_RoamingTiles: str +FOLDERID_RoamedTileImages: str +FOLDERID_Screenshots: str +FOLDERID_CameraRoll: str +FOLDERID_SkyDrive: str +FOLDERID_OneDrive: str +FOLDERID_SkyDriveDocuments: str +FOLDERID_SkyDrivePictures: str +FOLDERID_SkyDriveMusic: str +FOLDERID_SkyDriveCameraRoll: str +FOLDERID_SearchHistory: str +FOLDERID_SearchTemplates: str +FOLDERID_CameraRollLibrary: str +FOLDERID_SavedPictures: str +FOLDERID_SavedPicturesLibrary: str +FOLDERID_RetailDemo: str +FOLDERID_Device: str +FOLDERID_DevelopmentFiles: str +FOLDERID_Objects3D: str +FOLDERID_AppCaptures: str +FOLDERID_LocalDocuments: str +FOLDERID_LocalPictures: str +FOLDERID_LocalVideos: str +FOLDERID_LocalMusic: str +FOLDERID_LocalDownloads: str +FOLDERID_RecordedCalls: str +KF_FLAG_DEFAULT: int +KF_FLAG_FORCE_APP_DATA_REDIRECTION: int +KF_FLAG_RETURN_FILTER_REDIRECTION_TARGET: int +KF_FLAG_FORCE_PACKAGE_REDIRECTION: int +KF_FLAG_NO_PACKAGE_REDIRECTION: int +KF_FLAG_FORCE_APPCONTAINER_REDIRECTION: int +KF_FLAG_NO_APPCONTAINER_REDIRECTION: int +KF_FLAG_ALIAS_ONLY: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/taskscheduler/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/taskscheduler/__init__.pyi new file mode 100644 index 000000000..e69de29bb diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/taskscheduler/taskscheduler.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/taskscheduler/taskscheduler.pyi new file mode 100644 index 000000000..b37d72241 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/taskscheduler/taskscheduler.pyi @@ -0,0 +1,83 @@ +import _win32typing + +CLSID_CTask: _win32typing.PyIID +CLSID_CTaskScheduler: _win32typing.PyIID +HIGH_PRIORITY_CLASS: int +IDLE_PRIORITY_CLASS: int +IID_IProvideTaskPage: _win32typing.PyIID +IID_IScheduledWorkItem: _win32typing.PyIID +IID_ITask: _win32typing.PyIID +IID_ITaskScheduler: _win32typing.PyIID +IID_ITaskTrigger: _win32typing.PyIID +NORMAL_PRIORITY_CLASS: int +REALTIME_PRIORITY_CLASS: int +SCHED_E_ACCOUNT_DBASE_CORRUPT: int +SCHED_E_ACCOUNT_INFORMATION_NOT_SET: int +SCHED_E_ACCOUNT_NAME_NOT_FOUND: int +SCHED_E_CANNOT_OPEN_TASK: int +SCHED_E_INVALID_TASK: int +SCHED_E_SERVICE_NOT_INSTALLED: int +SCHED_E_TASK_NOT_READY: int +SCHED_E_TASK_NOT_RUNNING: int +SCHED_E_TRIGGER_NOT_FOUND: int +SCHED_E_UNKNOWN_OBJECT_VERSION: int +SCHED_S_EVENT_TRIGGER: int +SCHED_S_TASK_DISABLED: int +SCHED_S_TASK_HAS_NOT_RUN: int +SCHED_S_TASK_NOT_SCHEDULED: int +SCHED_S_TASK_NO_MORE_RUNS: int +SCHED_S_TASK_NO_VALID_TRIGGERS: int +SCHED_S_TASK_READY: int +SCHED_S_TASK_RUNNING: int +SCHED_S_TASK_TERMINATED: int +TASKPAGE_SCHEDULE: int +TASKPAGE_SETTINGS: int +TASKPAGE_TASK: int +TASK_APRIL: int +TASK_AUGUST: int +TASK_DECEMBER: int +TASK_EVENT_TRIGGER_AT_LOGON: int +TASK_EVENT_TRIGGER_AT_SYSTEMSTART: int +TASK_EVENT_TRIGGER_ON_IDLE: int +TASK_FEBRUARY: int +TASK_FIRST_WEEK: int +TASK_FLAG_DELETE_WHEN_DONE: int +TASK_FLAG_DISABLED: int +TASK_FLAG_DONT_START_IF_ON_BATTERIES: int +TASK_FLAG_HIDDEN: int +TASK_FLAG_INTERACTIVE: int +TASK_FLAG_KILL_IF_GOING_ON_BATTERIES: int +TASK_FLAG_KILL_ON_IDLE_END: int +TASK_FLAG_RESTART_ON_IDLE_RESUME: int +TASK_FLAG_RUN_IF_CONNECTED_TO_INTERNET: int +TASK_FLAG_RUN_ONLY_IF_DOCKED: int +TASK_FLAG_RUN_ONLY_IF_LOGGED_ON: int +TASK_FLAG_START_ONLY_IF_IDLE: int +TASK_FLAG_SYSTEM_REQUIRED: int +TASK_FOURTH_WEEK: int +TASK_FRIDAY: int +TASK_JANUARY: int +TASK_JULY: int +TASK_JUNE: int +TASK_LAST_WEEK: int +TASK_MARCH: int +TASK_MAY: int +TASK_MONDAY: int +TASK_NOVEMBER: int +TASK_OCTOBER: int +TASK_SATURDAY: int +TASK_SECOND_WEEK: int +TASK_SEPTEMBER: int +TASK_SUNDAY: int +TASK_THIRD_WEEK: int +TASK_THURSDAY: int +TASK_TIME_TRIGGER_DAILY: int +TASK_TIME_TRIGGER_MONTHLYDATE: int +TASK_TIME_TRIGGER_MONTHLYDOW: int +TASK_TIME_TRIGGER_ONCE: int +TASK_TIME_TRIGGER_WEEKLY: int +TASK_TRIGGER_FLAG_DISABLED: int +TASK_TRIGGER_FLAG_HAS_END_DATE: int +TASK_TRIGGER_FLAG_KILL_AT_DURATION_END: int +TASK_TUESDAY: int +TASK_WEDNESDAY: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32con.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32con.pyi new file mode 100644 index 000000000..54cfd26a8 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32con.pyi @@ -0,0 +1 @@ +from win32.lib.win32con import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32console.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32console.pyi new file mode 100644 index 000000000..f8539ed68 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32console.pyi @@ -0,0 +1 @@ +from win32.win32console import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32cred.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32cred.pyi new file mode 100644 index 000000000..6cb3e268e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32cred.pyi @@ -0,0 +1 @@ +from win32.win32cred import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32crypt.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32crypt.pyi new file mode 100644 index 000000000..223df5e3f --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32crypt.pyi @@ -0,0 +1 @@ +from win32.win32crypt import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32cryptcon.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32cryptcon.pyi new file mode 100644 index 000000000..6df8b4407 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32cryptcon.pyi @@ -0,0 +1 @@ +from win32.lib.win32cryptcon import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32event.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32event.pyi new file mode 100644 index 000000000..53191d417 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32event.pyi @@ -0,0 +1 @@ +from win32.win32event import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32evtlog.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32evtlog.pyi new file mode 100644 index 000000000..7c7ffe5ca --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32evtlog.pyi @@ -0,0 +1 @@ +from win32.win32evtlog import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32evtlogutil.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32evtlogutil.pyi new file mode 100644 index 000000000..c37e5dd7b --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32evtlogutil.pyi @@ -0,0 +1 @@ +from win32.lib.win32evtlogutil import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32file.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32file.pyi new file mode 100644 index 000000000..3a703a973 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32file.pyi @@ -0,0 +1 @@ +from win32.win32file import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32gui.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32gui.pyi new file mode 100644 index 000000000..3b2b41ae5 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32gui.pyi @@ -0,0 +1 @@ +from win32.win32gui import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32gui_struct.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32gui_struct.pyi new file mode 100644 index 000000000..3c7cd0a8a --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32gui_struct.pyi @@ -0,0 +1 @@ +from win32.lib.win32gui_struct import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32help.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32help.pyi new file mode 100644 index 000000000..bd6fce507 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32help.pyi @@ -0,0 +1 @@ +from win32.win32help import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32inet.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32inet.pyi new file mode 100644 index 000000000..98e6e47ff --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32inet.pyi @@ -0,0 +1 @@ +from win32.win32inet import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32inetcon.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32inetcon.pyi new file mode 100644 index 000000000..db893b68d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32inetcon.pyi @@ -0,0 +1 @@ +from win32.lib.win32inetcon import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32job.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32job.pyi new file mode 100644 index 000000000..9c8f7891e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32job.pyi @@ -0,0 +1 @@ +from win32.win32job import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32lz.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32lz.pyi new file mode 100644 index 000000000..64281098a --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32lz.pyi @@ -0,0 +1 @@ +from win32.win32lz import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32net.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32net.pyi new file mode 100644 index 000000000..f318e55d7 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32net.pyi @@ -0,0 +1 @@ +from win32.win32net import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32netcon.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32netcon.pyi new file mode 100644 index 000000000..f86b2ef4b --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32netcon.pyi @@ -0,0 +1 @@ +from win32.lib.win32netcon import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32pdh.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32pdh.pyi new file mode 100644 index 000000000..739ad216e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32pdh.pyi @@ -0,0 +1 @@ +from win32.win32pdh import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32pdhquery.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32pdhquery.pyi new file mode 100644 index 000000000..2d0976fbb --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32pdhquery.pyi @@ -0,0 +1 @@ +from win32.lib.win32pdhquery import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32pipe.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32pipe.pyi new file mode 100644 index 000000000..bf607d6b0 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32pipe.pyi @@ -0,0 +1 @@ +from win32.win32pipe import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32print.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32print.pyi new file mode 100644 index 000000000..ad2515011 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32print.pyi @@ -0,0 +1 @@ +from win32.win32print import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32process.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32process.pyi new file mode 100644 index 000000000..86b050b2b --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32process.pyi @@ -0,0 +1 @@ +from win32.win32process import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32profile.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32profile.pyi new file mode 100644 index 000000000..b89eef14b --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32profile.pyi @@ -0,0 +1 @@ +from win32.win32profile import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32ras.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32ras.pyi new file mode 100644 index 000000000..455d2763b --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32ras.pyi @@ -0,0 +1 @@ +from win32.win32ras import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32security.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32security.pyi new file mode 100644 index 000000000..bc0b8d20e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32security.pyi @@ -0,0 +1 @@ +from win32.win32security import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32service.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32service.pyi new file mode 100644 index 000000000..b98158e9a --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32service.pyi @@ -0,0 +1 @@ +from win32.win32service import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32serviceutil.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32serviceutil.pyi new file mode 100644 index 000000000..1e989b027 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32serviceutil.pyi @@ -0,0 +1 @@ +from win32.lib.win32serviceutil import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32timezone.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32timezone.pyi new file mode 100644 index 000000000..bd22d6774 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32timezone.pyi @@ -0,0 +1 @@ +from win32.lib.win32timezone import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32trace.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32trace.pyi new file mode 100644 index 000000000..3ece62970 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32trace.pyi @@ -0,0 +1 @@ +from win32.win32trace import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32transaction.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32transaction.pyi new file mode 100644 index 000000000..bd529b091 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32transaction.pyi @@ -0,0 +1 @@ +from win32.win32transaction import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32ts.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32ts.pyi new file mode 100644 index 000000000..dd0d8a231 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32ts.pyi @@ -0,0 +1 @@ +from win32.win32ts import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32ui.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32ui.pyi new file mode 100644 index 000000000..49ea5db90 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32ui.pyi @@ -0,0 +1 @@ +from pythonwin.win32ui import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32uiole.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32uiole.pyi new file mode 100644 index 000000000..b0ae818da --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32uiole.pyi @@ -0,0 +1 @@ +from pythonwin.win32uiole import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32wnet.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32wnet.pyi new file mode 100644 index 000000000..67facc0ca --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32wnet.pyi @@ -0,0 +1 @@ +from win32.win32wnet import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/winerror.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/winerror.pyi new file mode 100644 index 000000000..d0bdce6c4 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/winerror.pyi @@ -0,0 +1 @@ +from win32.lib.winerror import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/winioctlcon.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/winioctlcon.pyi new file mode 100644 index 000000000..6e51730f9 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/winioctlcon.pyi @@ -0,0 +1 @@ +from win32.lib.winioctlcon import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/winnt.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/winnt.pyi new file mode 100644 index 000000000..8bbdea596 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/winnt.pyi @@ -0,0 +1 @@ +from win32.lib.winnt import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/winperf.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/winperf.pyi new file mode 100644 index 000000000..d3138f48c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/winperf.pyi @@ -0,0 +1 @@ +from win32.lib.winperf import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/winxpgui.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/winxpgui.pyi new file mode 100644 index 000000000..9a8e6233d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/winxpgui.pyi @@ -0,0 +1 @@ +from win32.winxpgui import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/winxptheme.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/winxptheme.pyi new file mode 100644 index 000000000..e4b09f60b --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/winxptheme.pyi @@ -0,0 +1 @@ +from win32.lib.winxptheme import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/redis/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/redis/METADATA.toml index a51d6edb1..ab5b672a1 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/redis/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/redis/METADATA.toml @@ -1 +1,7 @@ -version = "4.3.*" +version = "4.5.1" +# Requires a version of cryptography with a `py.typed` file +requires = ["cryptography>=35.0.0", "types-pyOpenSSL"] + +[tool.stubtest] +ignore_missing_stub = true +extras = ["ocsp"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/asyncio/client.pyi b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/asyncio/client.pyi index a841469d2..663d50079 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/asyncio/client.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/asyncio/client.pyi @@ -1,8 +1,9 @@ -from _typeshed import Incomplete, Self +from _typeshed import Incomplete, Unused from collections.abc import AsyncIterator, Awaitable, Callable, Iterable, Mapping, MutableMapping, Sequence from datetime import datetime, timedelta +from types import TracebackType from typing import Any, ClassVar, Generic, NoReturn, Protocol, overload -from typing_extensions import Literal, TypeAlias, TypedDict +from typing_extensions import Literal, Self, TypeAlias, TypedDict from redis import RedisError from redis.asyncio.connection import ConnectCallbackT, Connection, ConnectionPool @@ -10,7 +11,8 @@ from redis.asyncio.lock import Lock from redis.asyncio.retry import Retry from redis.client import AbstractRedis, _CommandOptions, _Key, _StrType, _Value from redis.commands import AsyncCoreCommands, AsyncSentinelCommands, RedisModuleCommands -from redis.typing import ChannelT, EncodableT, KeyT, PatternT +from redis.credentials import CredentialProvider +from redis.typing import ChannelT, EncodableT, KeyT, PatternT, StreamIdT PubSubHandler: TypeAlias = Callable[[dict[str, str]], Awaitable[None]] @@ -63,9 +65,10 @@ class Redis(AbstractRedis, RedisModuleCommands, AsyncCoreCommands[_StrType], Asy retry: Retry | None = ..., auto_close_connection_pool: bool = ..., redis_connect_func: ConnectCallbackT | None = ..., + credential_provider: CredentialProvider | None = ..., ) -> None: ... def __await__(self): ... - async def initialize(self: Self) -> Self: ... + async def initialize(self) -> Self: ... def set_response_callback(self, command: str, callback: ResponseCallbackT): ... def load_external_module(self, funcname, func) -> None: ... def pipeline(self, transaction: bool = ..., shard_hint: str | None = ...) -> Pipeline[_StrType]: ... @@ -82,6 +85,7 @@ class Redis(AbstractRedis, RedisModuleCommands, AsyncCoreCommands[_StrType], Asy name: KeyT, timeout: float | None = ..., sleep: float = ..., + blocking: bool = ..., blocking_timeout: float | None = ..., lock_class: type[Lock] | None = ..., thread_local: bool = ..., @@ -89,8 +93,10 @@ class Redis(AbstractRedis, RedisModuleCommands, AsyncCoreCommands[_StrType], Asy def pubsub(self, **kwargs) -> PubSub: ... def monitor(self) -> Monitor: ... def client(self) -> Redis[_StrType]: ... - async def __aenter__(self: Self) -> Self: ... - async def __aexit__(self, exc_type, exc_value, traceback) -> None: ... + async def __aenter__(self) -> Self: ... + async def __aexit__( + self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None + ) -> None: ... def __del__(self, _warnings: Any = ...) -> None: ... async def close(self, close_connection_pool: bool | None = ...) -> None: ... async def execute_command(self, *args, **options): ... @@ -113,10 +119,10 @@ class Monitor: connection: Any def __init__(self, connection_pool: ConnectionPool) -> None: ... async def connect(self) -> None: ... - async def __aenter__(self): ... - async def __aexit__(self, *args) -> None: ... + async def __aenter__(self) -> Self: ... + async def __aexit__(self, *args: Unused) -> None: ... async def next_command(self) -> MonitorCommandInfo: ... - async def listen(self) -> AsyncIterator[MonitorCommandInfo]: ... + def listen(self) -> AsyncIterator[MonitorCommandInfo]: ... class PubSub: PUBLISH_MESSAGE_TYPES: ClassVar[tuple[str, ...]] @@ -137,10 +143,12 @@ class PubSub: connection_pool: ConnectionPool, shard_hint: str | None = ..., ignore_subscribe_messages: bool = ..., - encoder: Any | None = ..., + encoder: Incomplete | None = ..., + ) -> None: ... + async def __aenter__(self) -> Self: ... + async def __aexit__( + self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None ) -> None: ... - async def __aenter__(self): ... - async def __aexit__(self, exc_type, exc_value, traceback) -> None: ... def __del__(self) -> None: ... async def reset(self) -> None: ... def close(self) -> Awaitable[NoReturn]: ... @@ -154,9 +162,9 @@ class PubSub: def punsubscribe(self, *args: ChannelT) -> Awaitable[Any]: ... async def subscribe(self, *args: ChannelT, **kwargs: Callable[..., Any]): ... def unsubscribe(self, *args) -> Awaitable[Any]: ... - async def listen(self) -> AsyncIterator[Any]: ... + def listen(self) -> AsyncIterator[Any]: ... async def get_message(self, ignore_subscribe_messages: bool = ..., timeout: float = ...): ... - def ping(self, message: Any | None = ...) -> Awaitable[Any]: ... + def ping(self, message: Incomplete | None = ...) -> Awaitable[Any]: ... async def handle_message(self, response, ignore_subscribe_messages: bool = ...): ... async def run(self, *, exception_handler: PSWorkerThreadExcHandlerT | None = ..., poll_timeout: float = ...) -> None: ... @@ -188,8 +196,10 @@ class Pipeline(Redis[_StrType], Generic[_StrType]): transaction: bool, shard_hint: str | None, ) -> None: ... - async def __aenter__(self: Self) -> Self: ... - async def __aexit__(self, exc_type, exc_value, traceback) -> None: ... + async def __aenter__(self) -> Self: ... + async def __aexit__( + self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None + ) -> None: ... def __await__(self): ... def __len__(self) -> int: ... def __bool__(self) -> bool: ... @@ -229,9 +239,10 @@ class Pipeline(Redis[_StrType], Generic[_StrType]): keys: Sequence[str] | None = ..., channels: Iterable[ChannelT] | None = ..., selectors: Iterable[tuple[str, KeyT]] | None = ..., - reset: bool = ..., - reset_keys: bool = ..., - reset_passwords: bool = ..., + reset: bool = False, + reset_keys: bool = False, + reset_channels: bool = False, + reset_passwords: bool = False, **kwargs: _CommandOptions, ) -> Pipeline[_StrType]: ... def acl_users(self, **kwargs: _CommandOptions) -> Any: ... # type: ignore[override] @@ -586,7 +597,7 @@ class Pipeline(Redis[_StrType], Generic[_StrType]): groupname, consumername, min_idle_time, - start_id: int = ..., + start_id: StreamIdT = ..., count: Incomplete | None = ..., justid: bool = ..., ) -> Any: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/asyncio/cluster.pyi b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/asyncio/cluster.pyi new file mode 100644 index 000000000..10c8e93d6 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/asyncio/cluster.pyi @@ -0,0 +1,171 @@ +from _typeshed import Incomplete +from collections.abc import Awaitable, Callable, Mapping +from types import TracebackType +from typing import Any, Generic +from typing_extensions import Self + +from redis.asyncio.client import ResponseCallbackT +from redis.asyncio.connection import BaseParser, Connection, Encoder +from redis.asyncio.parser import CommandsParser +from redis.client import AbstractRedis +from redis.cluster import AbstractRedisCluster, LoadBalancer + +# TODO: add AsyncRedisClusterCommands stubs +# from redis.commands import AsyncRedisClusterCommands +from redis.commands.core import _StrType +from redis.credentials import CredentialProvider +from redis.retry import Retry +from redis.typing import AnyKeyT, EncodableT, KeyT + +# It uses `DefaultParser` in real life, but it is a dynamic base class. +class ClusterParser(BaseParser): ... + +class RedisCluster(AbstractRedis, AbstractRedisCluster, Generic[_StrType]): # TODO: AsyncRedisClusterCommands + retry: Retry | None + connection_kwargs: dict[str, Any] + nodes_manager: NodesManager + encoder: Encoder + read_from_replicas: bool + reinitialize_steps: int + cluster_error_retry_attempts: int + reinitialize_counter: int + commands_parser: CommandsParser + node_flags: set[str] + command_flags: dict[str, str] + response_callbacks: Incomplete + result_callbacks: dict[str, Callable[[Incomplete, Incomplete], Incomplete]] + def __init__( + self, + host: str | None = ..., + port: str | int = ..., + # Cluster related kwargs + startup_nodes: list[ClusterNode] | None = ..., + require_full_coverage: bool = ..., + read_from_replicas: bool = ..., + reinitialize_steps: int = ..., + cluster_error_retry_attempts: int = ..., + connection_error_retry_attempts: int = ..., + max_connections: int = ..., + # Client related kwargs + db: str | int = ..., + path: str | None = ..., + credential_provider: CredentialProvider | None = ..., + username: str | None = ..., + password: str | None = ..., + client_name: str | None = ..., + # Encoding related kwargs + encoding: str = ..., + encoding_errors: str = ..., + decode_responses: bool = ..., + # Connection related kwargs + health_check_interval: float = ..., + socket_connect_timeout: float | None = ..., + socket_keepalive: bool = ..., + socket_keepalive_options: Mapping[int, int | bytes] | None = ..., + socket_timeout: float | None = ..., + retry: Retry | None = ..., + retry_on_error: list[Exception] | None = ..., + # SSL related kwargs + ssl: bool = ..., + ssl_ca_certs: str | None = ..., + ssl_ca_data: str | None = ..., + ssl_cert_reqs: str = ..., + ssl_certfile: str | None = ..., + ssl_check_hostname: bool = ..., + ssl_keyfile: str | None = ..., + ) -> None: ... + async def initialize(self) -> Self: ... + async def close(self) -> None: ... + async def __aenter__(self) -> Self: ... + async def __aexit__( + self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None + ) -> None: ... + def __await__(self) -> Awaitable[Self]: ... + def __del__(self) -> None: ... + async def on_connect(self, connection: Connection) -> None: ... + def get_nodes(self) -> list[ClusterNode]: ... + def get_primaries(self) -> list[ClusterNode]: ... + def get_replicas(self) -> list[ClusterNode]: ... + def get_random_node(self) -> ClusterNode: ... + def get_default_node(self) -> ClusterNode: ... + def set_default_node(self, node: ClusterNode) -> None: ... + def get_node(self, host: str | None = ..., port: int | None = ..., node_name: str | None = ...) -> ClusterNode | None: ... + def get_node_from_key(self, key: str, replica: bool = ...) -> ClusterNode | None: ... + def keyslot(self, key: EncodableT) -> int: ... + def get_encoder(self) -> Encoder: ... + def get_connection_kwargs(self) -> dict[str, Any | None]: ... + def set_response_callback(self, command: str, callback: ResponseCallbackT) -> None: ... + async def execute_command(self, *args: EncodableT, **kwargs: Any) -> Any: ... + def pipeline(self, transaction: Any | None = ..., shard_hint: Any | None = ...) -> ClusterPipeline[_StrType]: ... + @classmethod + def from_url(cls, url: str, **kwargs) -> Self: ... + +class ClusterNode: + host: str + port: str | int + name: str + server_type: str | None + max_connections: int + connection_class: type[Connection] + connection_kwargs: dict[str, Any] + response_callbacks: dict[Incomplete, Incomplete] + def __init__( + self, + host: str, + port: str | int, + server_type: str | None = ..., + *, + max_connections: int = ..., + connection_class: type[Connection] = ..., + **connection_kwargs: Any, + ) -> None: ... + def __eq__(self, obj: object) -> bool: ... + def __del__(self) -> None: ... + async def disconnect(self) -> None: ... + def acquire_connection(self) -> Connection: ... + async def parse_response(self, connection: Connection, command: str, **kwargs: Any) -> Any: ... + async def execute_command(self, *args: Any, **kwargs: Any) -> Any: ... + async def execute_pipeline(self, commands: list[PipelineCommand]) -> bool: ... + +class NodesManager: + startup_nodes: dict[str, ClusterNode] + require_full_coverage: bool + connection_kwargs: dict[str, Any] + default_node: ClusterNode | None + nodes_cache: dict[str, ClusterNode] + slots_cache: dict[int, list[ClusterNode]] + read_load_balancer: LoadBalancer + def __init__( + self, startup_nodes: list[ClusterNode], require_full_coverage: bool, connection_kwargs: dict[str, Any] + ) -> None: ... + def get_node(self, host: str | None = ..., port: int | None = ..., node_name: str | None = ...) -> ClusterNode | None: ... + def set_nodes(self, old: dict[str, ClusterNode], new: dict[str, ClusterNode], remove_old: bool = ...) -> None: ... + def get_node_from_slot(self, slot: int, read_from_replicas: bool = ...) -> ClusterNode: ... + def get_nodes_by_server_type(self, server_type: str) -> list[ClusterNode]: ... + async def initialize(self) -> None: ... + async def close(self, attr: str = ...) -> None: ... + +class ClusterPipeline(AbstractRedis, AbstractRedisCluster, Generic[_StrType]): # TODO: AsyncRedisClusterCommands + def __init__(self, client: RedisCluster[_StrType]) -> None: ... + async def initialize(self) -> Self: ... + async def __aenter__(self) -> Self: ... + async def __aexit__( + self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None + ) -> None: ... + def __await__(self) -> Awaitable[Self]: ... + def __enter__(self) -> Self: ... + def __exit__( + self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None + ) -> None: ... + def __bool__(self) -> bool: ... + def __len__(self) -> int: ... + def execute_command(self, *args: KeyT | EncodableT, **kwargs: Any) -> Self: ... + async def execute(self, raise_on_error: bool = ..., allow_redirections: bool = ...) -> list[Any]: ... + def mset_nonatomic(self, mapping: Mapping[AnyKeyT, EncodableT]) -> Self: ... + +class PipelineCommand: + args: Any + kwargs: Any + position: int + result: Exception | None | Any + def __init__(self, position: int, *args: Any, **kwargs: Any) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/asyncio/connection.pyi b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/asyncio/connection.pyi index 84fdaa23c..435c5854f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/asyncio/connection.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/asyncio/connection.pyi @@ -1,18 +1,18 @@ import asyncio import enum import ssl +from _typeshed import Incomplete from collections.abc import Callable, Iterable, Mapping -from typing import Any, Protocol -from typing_extensions import TypeAlias, TypedDict +from typing import Any, Protocol, overload +from typing_extensions import Literal, TypeAlias, TypedDict from redis import RedisError from redis.asyncio.retry import Retry +from redis.credentials import CredentialProvider from redis.exceptions import ResponseError from redis.typing import EncodableT, EncodedT hiredis: Any -NONBLOCKING_EXCEPTION_ERROR_NUMBERS: Any -NONBLOCKING_EXCEPTIONS: Any SYM_STAR: bytes SYM_DOLLAR: bytes SYM_CRLF: bytes @@ -29,12 +29,6 @@ NO_SUCH_MODULE_ERROR: str MODULE_UNLOAD_NOT_POSSIBLE_ERROR: str MODULE_EXPORTS_DATA_TYPES_ERROR: str -class _HiredisReaderArgs(TypedDict): - protocolError: Callable[[str], Exception] - replyError: Callable[[str], Exception] - encoding: str | None - errors: str | None - class Encoder: encoding: Any encoding_errors: Any @@ -52,37 +46,20 @@ class BaseParser: def parse_error(self, response: str) -> ResponseError: ... def on_disconnect(self) -> None: ... def on_connect(self, connection: Connection): ... - async def can_read(self, timeout: float) -> bool: ... async def read_response(self, disable_decoding: bool = ...) -> EncodableT | ResponseError | list[EncodableT] | None: ... -class SocketBuffer: - socket_read_size: Any - socket_timeout: Any - bytes_written: int - bytes_read: int - def __init__(self, stream_reader: asyncio.StreamReader, socket_read_size: int, socket_timeout: float | None) -> None: ... - @property - def length(self): ... - async def can_read(self, timeout: float) -> bool: ... - async def read(self, length: int) -> bytes: ... - async def readline(self) -> bytes: ... - def purge(self) -> None: ... - def close(self) -> None: ... - class PythonParser(BaseParser): encoder: Any def __init__(self, socket_read_size: int) -> None: ... def on_connect(self, connection: Connection): ... def on_disconnect(self) -> None: ... - async def can_read(self, timeout: float): ... async def read_response(self, disable_decoding: bool = ...) -> EncodableT | ResponseError | None: ... class HiredisParser(BaseParser): def __init__(self, socket_read_size: int) -> None: ... def on_connect(self, connection: Connection): ... def on_disconnect(self) -> None: ... - async def can_read(self, timeout: float): ... - async def read_from_socket(self, timeout: float | None | _Sentinel = ..., raise_on_timeout: bool = ...): ... + async def read_from_socket(self) -> Literal[True]: ... async def read_response(self, disable_decoding: bool = ...) -> EncodableT | list[EncodableT]: ... DefaultParser: type[PythonParser | HiredisParser] @@ -141,6 +118,7 @@ class Connection: retry: Retry | None = ..., redis_connect_func: ConnectCallbackT | None = ..., encoder_class: type[Encoder] = ..., + credential_provider: CredentialProvider | None = ..., ) -> None: ... def repr_pieces(self): ... def __del__(self) -> None: ... @@ -151,12 +129,16 @@ class Connection: def set_parser(self, parser_class) -> None: ... async def connect(self) -> None: ... async def on_connect(self) -> None: ... - async def disconnect(self) -> None: ... + async def disconnect(self, nowait: bool = ...) -> None: ... async def check_health(self) -> None: ... async def send_packed_command(self, command: bytes | str | Iterable[bytes], check_health: bool = ...): ... async def send_command(self, *args, **kwargs) -> None: ... - async def can_read(self, timeout: float = ...): ... - async def read_response(self, disable_decoding: bool = ...): ... + @overload + async def read_response(self, *, timeout: float) -> Incomplete | None: ... + @overload + async def read_response(self, disable_decoding: bool, timeout: float) -> Incomplete | None: ... + @overload + async def read_response(self, disable_decoding: bool = False, timeout: None = None): ... def pack_command(self, *args: EncodableT) -> list[bytes]: ... def pack_commands(self, commands: Iterable[Iterable[EncodableT]]) -> list[bytes]: ... @@ -240,6 +222,7 @@ class UnixDomainSocketConnection(Connection): client_name: str | None = ..., retry: Retry | None = ..., redis_connect_func: ConnectCallbackT | None = ..., + credential_provider: CredentialProvider | None = ..., ) -> None: ... def repr_pieces(self) -> Iterable[tuple[str, str | int]]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/asyncio/lock.pyi b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/asyncio/lock.pyi index e2285460b..aa90042b4 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/asyncio/lock.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/asyncio/lock.pyi @@ -1,23 +1,27 @@ +import threading from collections.abc import Awaitable -from typing import Any +from types import SimpleNamespace, TracebackType +from typing import Any, ClassVar +from typing_extensions import Self from redis.asyncio import Redis +from redis.commands.core import AsyncScript class Lock: - lua_release: Any - lua_extend: Any - lua_reacquire: Any - LUA_RELEASE_SCRIPT: str - LUA_EXTEND_SCRIPT: str - LUA_REACQUIRE_SCRIPT: str - redis: Any - name: Any - timeout: Any - sleep: Any - blocking: Any - blocking_timeout: Any - thread_local: Any - local: Any + lua_release: ClassVar[AsyncScript | None] + lua_extend: ClassVar[AsyncScript | None] + lua_reacquire: ClassVar[AsyncScript | None] + LUA_RELEASE_SCRIPT: ClassVar[str] + LUA_EXTEND_SCRIPT: ClassVar[str] + LUA_REACQUIRE_SCRIPT: ClassVar[str] + redis: Redis[Any] + name: str | bytes | memoryview + timeout: float | None + sleep: float + blocking: bool + blocking_timeout: float | None + thread_local: bool + local: threading.local | SimpleNamespace def __init__( self, redis: Redis[Any], @@ -29,17 +33,19 @@ class Lock: thread_local: bool = ..., ) -> None: ... def register_scripts(self) -> None: ... - async def __aenter__(self): ... - async def __aexit__(self, exc_type, exc_value, traceback) -> None: ... + async def __aenter__(self) -> Self: ... + async def __aexit__( + self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None + ) -> None: ... async def acquire( self, blocking: bool | None = ..., blocking_timeout: float | None = ..., token: str | bytes | None = ... - ): ... + ) -> bool: ... async def do_acquire(self, token: str | bytes) -> bool: ... async def locked(self) -> bool: ... async def owned(self) -> bool: ... def release(self) -> Awaitable[None]: ... - async def do_release(self, expected_token: bytes): ... + async def do_release(self, expected_token: bytes) -> None: ... def extend(self, additional_time: float, replace_ttl: bool = ...) -> Awaitable[bool]: ... - async def do_extend(self, additional_time, replace_ttl) -> bool: ... + async def do_extend(self, additional_time: float, replace_ttl: bool) -> bool: ... def reacquire(self) -> Awaitable[bool]: ... async def do_reacquire(self) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/asyncio/parser.pyi b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/asyncio/parser.pyi new file mode 100644 index 000000000..6053518e6 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/asyncio/parser.pyi @@ -0,0 +1,9 @@ +from _typeshed import Incomplete +from typing import Any + +# TODO: define and use: +# from redis.asyncio.cluster import ClusterNode + +class CommandsParser: + async def initialize(self, node: Incomplete | None = ...) -> None: ... # TODO: ClusterNode + async def get_keys(self, *args: Any) -> tuple[str, ...] | None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/asyncio/retry.pyi b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/asyncio/retry.pyi index f6c2f9594..1579606a5 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/asyncio/retry.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/asyncio/retry.pyi @@ -1,5 +1,5 @@ from collections.abc import Awaitable, Callable, Iterable -from typing import Any, TypeVar +from typing import TypeVar from redis.backoff import AbstractBackoff from redis.exceptions import RedisError @@ -9,4 +9,4 @@ _T = TypeVar("_T") class Retry: def __init__(self, backoff: AbstractBackoff, retries: int, supported_errors: tuple[type[RedisError], ...] = ...) -> None: ... def update_supported_errors(self, specified_errors: Iterable[type[RedisError]]) -> None: ... - async def call_with_retry(self, do: Callable[[], Awaitable[_T]], fail: Callable[[RedisError], Any]) -> _T: ... + async def call_with_retry(self, do: Callable[[], Awaitable[_T]], fail: Callable[[RedisError], Awaitable[object]]) -> _T: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/asyncio/sentinel.pyi b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/asyncio/sentinel.pyi index 59b31e0c5..e452986c8 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/asyncio/sentinel.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/asyncio/sentinel.pyi @@ -1,5 +1,6 @@ +from _typeshed import Incomplete from collections.abc import AsyncIterator, Iterable, Mapping, Sequence -from typing import Any +from typing import Any, overload from redis.asyncio.client import Redis from redis.asyncio.connection import Connection, ConnectionPool, SSLConnection @@ -15,7 +16,12 @@ class SentinelManagedConnection(Connection): def __init__(self, **kwargs) -> None: ... async def connect_to(self, address) -> None: ... async def connect(self): ... - async def read_response(self, disable_decoding: bool = ...): ... + @overload + async def read_response(self, *, timeout: float) -> Incomplete | None: ... + @overload + async def read_response(self, disable_decoding: bool, timeout: float) -> Incomplete | None: ... + @overload + async def read_response(self, disable_decoding: bool = False, timeout: None = None): ... class SentinelManagedSSLConnection(SentinelManagedConnection, SSLConnection): ... @@ -38,7 +44,7 @@ class Sentinel(AsyncSentinelCommands): min_other_sentinels: Any connection_kwargs: Any def __init__( - self, sentinels, min_other_sentinels: int = ..., sentinel_kwargs: Any | None = ..., **connection_kwargs + self, sentinels, min_other_sentinels: int = ..., sentinel_kwargs: Incomplete | None = ..., **connection_kwargs ) -> None: ... async def execute_command(self, *args, **kwargs): ... def check_master_state(self, state: dict[Any, Any], service_name: str) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/asyncio/utils.pyi b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/asyncio/utils.pyi index f63aa2dae..37f7fa8bf 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/asyncio/utils.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/asyncio/utils.pyi @@ -1,3 +1,4 @@ +from types import TracebackType from typing import Any, Generic from redis.asyncio.client import Pipeline, Redis @@ -9,4 +10,6 @@ class pipeline(Generic[_StrType]): p: Pipeline[_StrType] def __init__(self, redis_obj: Redis[_StrType]) -> None: ... async def __aenter__(self) -> Pipeline[_StrType]: ... - async def __aexit__(self, exc_type: object, exc_value: object, traceback: object) -> None: ... + async def __aexit__( + self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None + ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/backoff.pyi b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/backoff.pyi index 643c0bceb..03b559e5b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/backoff.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/backoff.pyi @@ -13,17 +13,17 @@ class NoBackoff(ConstantBackoff): def __init__(self) -> None: ... class ExponentialBackoff(AbstractBackoff): - def __init__(self, cap: float, base: float) -> None: ... + def __init__(self, cap: float = ..., base: float = ...) -> None: ... def compute(self, failures: int) -> float: ... class FullJitterBackoff(AbstractBackoff): - def __init__(self, cap: float, base: float) -> None: ... + def __init__(self, cap: float = ..., base: float = ...) -> None: ... def compute(self, failures: int) -> float: ... class EqualJitterBackoff(AbstractBackoff): - def __init__(self, cap: float, base: float) -> None: ... + def __init__(self, cap: float = ..., base: float = ...) -> None: ... def compute(self, failures: int) -> float: ... class DecorrelatedJitterBackoff(AbstractBackoff): - def __init__(self, cap: float, base: float) -> None: ... + def __init__(self, cap: float = ..., base: float = ...) -> None: ... def compute(self, failures: int) -> float: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/client.pyi b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/client.pyi index 0ba5c326b..1d82f231a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/client.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/client.pyi @@ -1,16 +1,17 @@ import threading -from _typeshed import Incomplete, Self, SupportsItems +from _typeshed import Incomplete, SupportsItems, Unused from collections.abc import Callable, Iterable, Iterator, Mapping, Sequence from datetime import datetime, timedelta from re import Pattern from types import TracebackType from typing import Any, ClassVar, Generic, TypeVar, overload -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal, Self, TypeAlias from redis import RedisError from .commands import CoreCommands, RedisModuleCommands, SentinelCommands from .connection import ConnectionPool, _ConnectFunc, _ConnectionPoolOptions +from .credentials import CredentialProvider from .lock import Lock from .retry import Retry from .typing import ChannelT, EncodableT, KeyT, PatternT @@ -23,7 +24,6 @@ _StrType = TypeVar("_StrType", bound=str | bytes) _VT = TypeVar("_VT") _T = TypeVar("_T") -_ScoreCastFuncReturn = TypeVar("_ScoreCastFuncReturn") # Keyword arguments that are passed to Redis.parse_response(). _ParseResponseOptions: TypeAlias = Any @@ -74,10 +74,9 @@ def parse_slowlog_get(response, **options): ... _LockType = TypeVar("_LockType") class AbstractRedis: - RESPONSE_CALLBACKS: dict[Any, Any] + RESPONSE_CALLBACKS: dict[str, Any] class Redis(AbstractRedis, RedisModuleCommands, CoreCommands[_StrType], SentinelCommands, Generic[_StrType]): - RESPONSE_CALLBACKS: Any @overload @classmethod def from_url( @@ -173,14 +172,14 @@ class Redis(AbstractRedis, RedisModuleCommands, CoreCommands[_StrType], Sentinel ssl_certfile: str | None = ..., ssl_cert_reqs: str | int | None = ..., ssl_ca_certs: str | None = ..., - ssl_ca_path: Any | None = ..., - ssl_ca_data: Any | None = ..., + ssl_ca_path: Incomplete | None = ..., + ssl_ca_data: Incomplete | None = ..., ssl_check_hostname: bool = ..., - ssl_password: Any | None = ..., + ssl_password: Incomplete | None = ..., ssl_validate_ocsp: bool = ..., ssl_validate_ocsp_stapled: bool = ..., # added in 4.1.1 - ssl_ocsp_context: Any | None = ..., # added in 4.1.1 - ssl_ocsp_expected_cert: Any | None = ..., # added in 4.1.1 + ssl_ocsp_context: Incomplete | None = ..., # added in 4.1.1 + ssl_ocsp_expected_cert: Incomplete | None = ..., # added in 4.1.1 max_connections: int | None = ..., single_connection_client: bool = ..., health_check_interval: float = ..., @@ -188,6 +187,7 @@ class Redis(AbstractRedis, RedisModuleCommands, CoreCommands[_StrType], Sentinel username: str | None = ..., retry: Retry | None = ..., redis_connect_func: _ConnectFunc | None = ..., + credential_provider: CredentialProvider | None = ..., ) -> None: ... @overload def __init__( @@ -214,13 +214,13 @@ class Redis(AbstractRedis, RedisModuleCommands, CoreCommands[_StrType], Sentinel ssl_certfile: str | None = ..., ssl_cert_reqs: str | int | None = ..., ssl_ca_certs: str | None = ..., - ssl_ca_data: Any | None = ..., + ssl_ca_data: Incomplete | None = ..., ssl_check_hostname: bool = ..., - ssl_password: Any | None = ..., + ssl_password: Incomplete | None = ..., ssl_validate_ocsp: bool = ..., ssl_validate_ocsp_stapled: bool = ..., # added in 4.1.1 - ssl_ocsp_context: Any | None = ..., # added in 4.1.1 - ssl_ocsp_expected_cert: Any | None = ..., # added in 4.1.1 + ssl_ocsp_context: Incomplete | None = ..., # added in 4.1.1 + ssl_ocsp_expected_cert: Incomplete | None = ..., # added in 4.1.1 max_connections: int | None = ..., single_connection_client: bool = ..., health_check_interval: float = ..., @@ -228,6 +228,7 @@ class Redis(AbstractRedis, RedisModuleCommands, CoreCommands[_StrType], Sentinel username: str | None = ..., retry: Retry | None = ..., redis_connect_func: _ConnectFunc | None = ..., + credential_provider: CredentialProvider | None = ..., ) -> None: ... @overload def __init__( @@ -253,13 +254,13 @@ class Redis(AbstractRedis, RedisModuleCommands, CoreCommands[_StrType], Sentinel ssl_certfile: str | None = ..., ssl_cert_reqs: str | int | None = ..., ssl_ca_certs: str | None = ..., - ssl_ca_data: Any | None = ..., + ssl_ca_data: Incomplete | None = ..., ssl_check_hostname: bool = ..., - ssl_password: Any | None = ..., + ssl_password: Incomplete | None = ..., ssl_validate_ocsp: bool = ..., ssl_validate_ocsp_stapled: bool = ..., # added in 4.1.1 - ssl_ocsp_context: Any | None = ..., # added in 4.1.1 - ssl_ocsp_expected_cert: Any | None = ..., # added in 4.1.1 + ssl_ocsp_context: Incomplete | None = ..., # added in 4.1.1 + ssl_ocsp_expected_cert: Incomplete | None = ..., # added in 4.1.1 max_connections: int | None = ..., single_connection_client: bool = ..., health_check_interval: float = ..., @@ -267,6 +268,7 @@ class Redis(AbstractRedis, RedisModuleCommands, CoreCommands[_StrType], Sentinel username: str | None = ..., retry: Retry | None = ..., redis_connect_func: _ConnectFunc | None = ..., + credential_provider: CredentialProvider | None = ..., ) -> None: ... def get_encoder(self): ... def get_connection_kwargs(self): ... @@ -312,7 +314,9 @@ class Redis(AbstractRedis, RedisModuleCommands, CoreCommands[_StrType], Sentinel def parse_response(self, connection, command_name, **options: _ParseResponseOptions): ... def monitor(self) -> Monitor: ... def __enter__(self) -> Redis[_StrType]: ... - def __exit__(self, exc_type, exc_value, traceback): ... + def __exit__( + self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None + ) -> None: ... def __del__(self) -> None: ... def close(self) -> None: ... def client(self) -> Redis[_StrType]: ... @@ -332,9 +336,13 @@ class PubSub: health_check_response_b: bytes health_check_response: list[str] | list[bytes] def __init__( - self, connection_pool, shard_hint: Any | None = ..., ignore_subscribe_messages: bool = ..., encoder: Any | None = ... + self, + connection_pool, + shard_hint: Incomplete | None = ..., + ignore_subscribe_messages: bool = ..., + encoder: Incomplete | None = ..., ) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None ) -> None: ... @@ -358,7 +366,7 @@ class PubSub: def listen(self): ... def get_message(self, ignore_subscribe_messages: bool = ..., timeout: float = ...) -> dict[str, Any] | None: ... def handle_message(self, response, ignore_subscribe_messages: bool = ...) -> dict[str, Any] | None: ... - def run_in_thread(self, sleep_time: float = ..., daemon: bool = ..., exception_handler: Any | None = ...): ... + def run_in_thread(self, sleep_time: float = ..., daemon: bool = ..., exception_handler: Incomplete | None = ...): ... def ping(self, message: _Value | None = ...) -> None: ... class PubSubWorkerThread(threading.Thread): @@ -366,7 +374,7 @@ class PubSubWorkerThread(threading.Thread): pubsub: Any sleep_time: Any exception_handler: Any - def __init__(self, pubsub, sleep_time, daemon: bool = ..., exception_handler: Any | None = ...) -> None: ... + def __init__(self, pubsub, sleep_time, daemon: bool = ..., exception_handler: Incomplete | None = ...) -> None: ... def run(self) -> None: ... def stop(self) -> None: ... @@ -384,7 +392,9 @@ class Pipeline(Redis[_StrType], Generic[_StrType]): explicit_transaction: Any def __init__(self, connection_pool, response_callbacks, transaction, shard_hint) -> None: ... def __enter__(self) -> Pipeline[_StrType]: ... # type: ignore[override] - def __exit__(self, exc_type, exc_value, traceback) -> None: ... + def __exit__( + self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None + ) -> None: ... def __del__(self) -> None: ... def __len__(self) -> int: ... def __bool__(self) -> bool: ... @@ -422,9 +432,11 @@ class Pipeline(Redis[_StrType], Generic[_StrType]): keys: Sequence[str] | None = ..., channels: Iterable[ChannelT] | None = ..., selectors: Iterable[tuple[str, KeyT]] | None = ..., - reset: bool = ..., - reset_keys: bool = ..., - reset_passwords: bool = ..., + reset: bool = False, + reset_keys: bool = False, + reset_channels: bool = False, + reset_passwords: bool = False, + **kwargs: _CommandOptions, ) -> Pipeline[_StrType]: ... def acl_users(self) -> Pipeline[_StrType]: ... # type: ignore[override] def acl_whoami(self) -> Pipeline[_StrType]: ... # type: ignore[override] @@ -497,7 +509,7 @@ class Pipeline(Redis[_StrType], Generic[_StrType]): def randomkey(self) -> Pipeline[_StrType]: ... # type: ignore[override] def rename(self, src, dst) -> Pipeline[_StrType]: ... # type: ignore[override] def renamenx(self, src, dst) -> Pipeline[_StrType]: ... # type: ignore[override] - def restore(self, name, ttl, value, replace: bool = ..., absttl: bool = ..., idletime: Any | None = ..., frequency: Any | None = ...) -> Pipeline[_StrType]: ... # type: ignore[override] + def restore(self, name, ttl, value, replace: bool = ..., absttl: bool = ..., idletime: Incomplete | None = ..., frequency: Incomplete | None = ...) -> Pipeline[_StrType]: ... # type: ignore[override] def set( # type: ignore[override] self, name: _Key, @@ -508,8 +520,8 @@ class Pipeline(Redis[_StrType], Generic[_StrType]): xx: bool = ..., keepttl: bool = ..., get: bool = ..., - exat: Any | None = ..., - pxat: Any | None = ..., + exat: Incomplete | None = ..., + pxat: Incomplete | None = ..., ) -> Pipeline[_StrType]: ... def __setitem__(self, name, value) -> None: ... def setbit(self, name: _Key, offset: int, value: int) -> Pipeline[_StrType]: ... # type: ignore[override] @@ -569,7 +581,6 @@ class Pipeline(Redis[_StrType], Generic[_StrType]): def sscan_iter(self, name: _Key, match: _Key | None = ..., count: int | None = ...) -> Iterator[Any]: ... def hscan(self, name: _Key, cursor: int = ..., match: _Key | None = ..., count: int | None = ...) -> Pipeline[_StrType]: ... # type: ignore[override] def hscan_iter(self, name, match: _Key | None = ..., count: int | None = ...) -> Iterator[Any]: ... - def zscan(self, name: _Key, cursor: int = ..., match: _Key | None = ..., count: int | None = ..., score_cast_func: Callable[[_StrType], _ScoreCastFuncReturn] = ...) -> Pipeline[_StrType]: ... # type: ignore[override] def zscan_iter( self, name: _Key, match: _Key | None = ..., count: int | None = ..., score_cast_func: Callable[[_StrType], Any] = ... ) -> Iterator[Any]: ... @@ -588,7 +599,7 @@ class Pipeline(Redis[_StrType], Generic[_StrType]): def sunion(self, keys: _Key | Iterable[_Key], *args: _Key) -> Pipeline[_StrType]: ... # type: ignore[override] def sunionstore(self, dest: _Key, keys: _Key | Iterable[_Key], *args: _Key) -> Pipeline[_StrType]: ... # type: ignore[override] def xack(self, name, groupname, *ids) -> Pipeline[_StrType]: ... # type: ignore[override] - def xadd(self, name, fields, id=..., maxlen=..., approximate: bool = ..., nomkstream: bool = ..., minid: Any | None = ..., limit: int | None = ...) -> Pipeline[_StrType]: ... # type: ignore[override] + def xadd(self, name, fields, id=..., maxlen=..., approximate: bool = ..., nomkstream: bool = ..., minid: Incomplete | None = ..., limit: int | None = ...) -> Pipeline[_StrType]: ... # type: ignore[override] def xclaim( self, name, groupname, consumername, min_idle_time, message_ids, idle=..., time=..., retrycount=..., force=..., justid=... ) -> Pipeline[_StrType]: ... # type: ignore[override] @@ -602,7 +613,7 @@ class Pipeline(Redis[_StrType], Generic[_StrType]): def xinfo_stream(self, name, full: bool = ...) -> Pipeline[_StrType]: ... # type: ignore[override] def xlen(self, name: _Key) -> Pipeline[_StrType]: ... # type: ignore[override] def xpending(self, name, groupname) -> Pipeline[_StrType]: ... # type: ignore[override] - def xpending_range(self, name: _Key, groupname, min, max, count: int, consumername: Any | None = ..., idle: int | None = ...) -> Pipeline[_StrType]: ... # type: ignore[override] + def xpending_range(self, name: _Key, groupname, min, max, count: int, consumername: Incomplete | None = ..., idle: int | None = ...) -> Pipeline[_StrType]: ... # type: ignore[override] def xrange(self, name, min=..., max=..., count=...) -> Pipeline[_StrType]: ... # type: ignore[override] def xread(self, streams, count=..., block=...) -> Pipeline[_StrType]: ... # type: ignore[override] def xreadgroup(self, groupname, consumername, streams, count=..., block=..., noack=...) -> Pipeline[_StrType]: ... # type: ignore[override] @@ -616,8 +627,8 @@ class Pipeline(Redis[_StrType], Generic[_StrType]): xx: bool = ..., ch: bool = ..., incr: bool = ..., - gt: Any | None = ..., - lt: Any | None = ..., + gt: Incomplete | None = ..., + lt: Incomplete | None = ..., ) -> Pipeline[_StrType]: ... def zcard(self, name: _Key) -> Pipeline[_StrType]: ... # type: ignore[override] def zcount(self, name: _Key, min: _Value, max: _Value) -> Pipeline[_StrType]: ... # type: ignore[override] @@ -689,14 +700,14 @@ class Pipeline(Redis[_StrType], Generic[_StrType]): def hlen(self, name: _Key) -> Pipeline[_StrType]: ... # type: ignore[override] @overload # type: ignore[override] def hset( - self, name: _Key, key: _Key, value: _Value, mapping: Mapping[_Key, _Value] | None = ..., items: Any | None = ... + self, name: _Key, key: _Key, value: _Value, mapping: Mapping[_Key, _Value] | None = ..., items: Incomplete | None = ... ) -> Pipeline[_StrType]: ... @overload # type: ignore[override] def hset( - self, name: _Key, key: None, value: None, mapping: Mapping[_Key, _Value], items: Any | None = ... + self, name: _Key, key: None, value: None, mapping: Mapping[_Key, _Value], items: Incomplete | None = ... ) -> Pipeline[_StrType]: ... @overload # type: ignore[override] - def hset(self, name: _Key, *, mapping: Mapping[_Key, _Value], items: Any | None = ...) -> Pipeline[_StrType]: ... + def hset(self, name: _Key, *, mapping: Mapping[_Key, _Value], items: Incomplete | None = ...) -> Pipeline[_StrType]: ... def hsetnx(self, name: _Key, key: _Key, value: _Value) -> Pipeline[_StrType]: ... # type: ignore[override] def hmset(self, name: _Key, mapping: Mapping[_Key, _Value]) -> Pipeline[_StrType]: ... # type: ignore[override] def hmget(self, name: _Key, keys: _Key | Iterable[_Key], *args: _Key) -> Pipeline[_StrType]: ... # type: ignore[override] @@ -705,7 +716,7 @@ class Pipeline(Redis[_StrType], Generic[_StrType]): def eval(self, script, numkeys, *keys_and_args) -> Pipeline[_StrType]: ... # type: ignore[override] def evalsha(self, sha, numkeys, *keys_and_args) -> Pipeline[_StrType]: ... # type: ignore[override] def script_exists(self, *args) -> Pipeline[_StrType]: ... # type: ignore[override] - def script_flush(self, sync_type: Any | None = ...) -> Pipeline[_StrType]: ... # type: ignore[override] + def script_flush(self, sync_type: Incomplete | None = ...) -> Pipeline[_StrType]: ... # type: ignore[override] def script_kill(self) -> Pipeline[_StrType]: ... # type: ignore[override] def script_load(self, script) -> Pipeline[_StrType]: ... # type: ignore[override] def pubsub_channels(self, pattern: _Key = ...) -> Pipeline[_StrType]: ... # type: ignore[override] @@ -719,7 +730,7 @@ class Monitor: command_re: Pattern[str] monitor_re: Pattern[str] def __init__(self, connection_pool) -> None: ... - def __enter__(self: Self) -> Self: ... - def __exit__(self, *args: object) -> None: ... + def __enter__(self) -> Self: ... + def __exit__(self, *args: Unused) -> None: ... def next_command(self) -> dict[str, Any]: ... def listen(self) -> Iterable[dict[str, Any]]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/cluster.pyi b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/cluster.pyi index c32379de6..fd4e906e6 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/cluster.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/cluster.pyi @@ -1,29 +1,32 @@ -from _typeshed import Incomplete, Self -from collections.abc import Callable +from _typeshed import Incomplete, Unused +from collections.abc import Callable, Iterable, Sequence from threading import Lock from types import TracebackType -from typing import Any, ClassVar, Generic -from typing_extensions import Literal +from typing import Any, ClassVar, Generic, NoReturn, Protocol +from typing_extensions import Literal, Self -from redis.client import CaseInsensitiveDict, PubSub, Redis +from redis.client import CaseInsensitiveDict, PubSub, Redis, _ParseResponseOptions from redis.commands import CommandsParser, RedisClusterCommands from redis.commands.core import _StrType -from redis.connection import BaseParser, Connection, Encoder -from redis.exceptions import RedisError +from redis.connection import BaseParser, Connection, ConnectionPool, Encoder, _ConnectionPoolOptions, _Encodable +from redis.exceptions import MovedError, RedisError +from redis.retry import Retry +from redis.typing import EncodableT def get_node_name(host: str, port: str | int) -> str: ... -def get_connection(redis_node: Redis[Any], *args, **options) -> Connection: ... -def parse_scan_result(command, res, **options): ... -def parse_pubsub_numsub(command, res, **options): ... -def parse_cluster_slots(resp, **options): ... +def get_connection(redis_node: Redis[Any], *args, **options: _ConnectionPoolOptions) -> Connection: ... +def parse_scan_result(command: Unused, res, **options): ... +def parse_pubsub_numsub(command: Unused, res, **options: Unused): ... +def parse_cluster_slots(resp, **options) -> dict[tuple[int, int], dict[str, Any]]: ... PRIMARY: str REPLICA: str SLOT_ID: str REDIS_ALLOWED_KEYS: tuple[str, ...] KWARGS_DISABLED_KEYS: tuple[str, ...] +PIPELINE_BLOCKED_COMMANDS: tuple[str, ...] -def cleanup_kwargs(**kwargs): ... +def cleanup_kwargs(**kwargs: Any) -> dict[str, Any]: ... # It uses `DefaultParser` in real life, but it is a dynamic base class. class ClusterParser(BaseParser): ... @@ -60,6 +63,7 @@ class RedisCluster(AbstractRedisCluster, RedisClusterCommands[_StrType], Generic port: int | None = ..., startup_nodes: list[ClusterNode] | None = ..., cluster_error_retry_attempts: int = ..., + retry: Retry | None = ..., require_full_coverage: bool = ..., reinitialize_steps: int = ..., read_from_replicas: bool = ..., @@ -67,27 +71,29 @@ class RedisCluster(AbstractRedisCluster, RedisClusterCommands[_StrType], Generic url: str | None = ..., **kwargs, ) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, type: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None ) -> None: ... def __del__(self) -> None: ... def disconnect_connection_pools(self) -> None: ... @classmethod - def from_url(cls: type[Self], url: str, **kwargs) -> Self: ... - def on_connect(self, connection) -> None: ... - def get_redis_connection(self, node): ... - def get_node(self, host: Any | None = ..., port: Any | None = ..., node_name: Any | None = ...): ... - def get_primaries(self): ... - def get_replicas(self): ... - def get_random_node(self): ... - def get_nodes(self): ... - def get_node_from_key(self, key, replica: bool = ...): ... - def get_default_node(self): ... - def set_default_node(self, node): ... - def monitor(self, target_node: Any | None = ...): ... - def pubsub(self, node: Any | None = ..., host: Any | None = ..., port: Any | None = ..., **kwargs): ... - def pipeline(self, transaction: Any | None = ..., shard_hint: Any | None = ...): ... + def from_url(cls, url: str, **kwargs) -> Self: ... + def on_connect(self, connection: Connection) -> None: ... + def get_redis_connection(self, node: ClusterNode) -> Redis[Any]: ... + def get_node( + self, host: str | None = ..., port: str | int | None = ..., node_name: str | None = ... + ) -> ClusterNode | None: ... + def get_primaries(self) -> list[ClusterNode]: ... + def get_replicas(self) -> list[ClusterNode]: ... + def get_random_node(self) -> ClusterNode: ... + def get_nodes(self) -> list[ClusterNode]: ... + def get_node_from_key(self, key: _Encodable, replica: bool = ...) -> ClusterNode | None: ... + def get_default_node(self) -> ClusterNode | None: ... + def set_default_node(self, node: ClusterNode | None) -> bool: ... + def monitor(self, target_node: Incomplete | None = ...): ... + def pubsub(self, node: Incomplete | None = ..., host: Incomplete | None = ..., port: Incomplete | None = ..., **kwargs): ... + def pipeline(self, transaction: Incomplete | None = ..., shard_hint: Incomplete | None = ...): ... def lock( self, name: str, @@ -98,69 +104,82 @@ class RedisCluster(AbstractRedisCluster, RedisClusterCommands[_StrType], Generic lock_class: type[Incomplete] | None = ..., thread_local: bool = ..., ): ... - def keyslot(self, key): ... + def keyslot(self, key: _Encodable) -> int: ... def determine_slot(self, *args): ... - def get_encoder(self): ... - def get_connection_kwargs(self): ... + def get_encoder(self) -> Encoder: ... + def get_connection_kwargs(self) -> dict[str, Any]: ... def execute_command(self, *args, **kwargs): ... def close(self) -> None: ... class ClusterNode: - host: Any - port: Any - name: Any - server_type: Any - redis_connection: Any - def __init__(self, host, port, server_type: Any | None = ..., redis_connection: Any | None = ...) -> None: ... - def __eq__(self, obj): ... + host: str + port: int + name: str + server_type: str | None + redis_connection: Redis[Incomplete] | None + def __init__( + self, host: str, port: int, server_type: str | None = ..., redis_connection: Redis[Incomplete] | None = ... + ) -> None: ... + def __eq__(self, obj: object) -> bool: ... def __del__(self) -> None: ... class LoadBalancer: - primary_to_idx: Any - start_index: Any + primary_to_idx: dict[str, int] + start_index: int def __init__(self, start_index: int = ...) -> None: ... - def get_server_index(self, primary, list_size): ... + def get_server_index(self, primary: str, list_size: int) -> int: ... def reset(self) -> None: ... class NodesManager: - nodes_cache: Any - slots_cache: Any - startup_nodes: Any - default_node: Any - from_url: Any - connection_kwargs: Any - read_load_balancer: Any + nodes_cache: dict[str, ClusterNode] + slots_cache: dict[str, list[ClusterNode]] + startup_nodes: dict[str, ClusterNode] + default_node: ClusterNode | None + from_url: bool + connection_pool_class: type[ConnectionPool] + connection_kwargs: dict[str, Incomplete] # TODO: could be a TypedDict + read_load_balancer: LoadBalancer def __init__( self, - startup_nodes, - from_url: bool = ..., - require_full_coverage: bool = ..., - lock: Incomplete | None = ..., - dynamic_startup_nodes: bool = ..., - **kwargs, + startup_nodes: Iterable[ClusterNode], + from_url: bool = False, + require_full_coverage: bool = False, + lock: Lock | None = None, + dynamic_startup_nodes: bool = True, + connection_pool_class: type[ConnectionPool] = ..., + **kwargs, # TODO: same type as connection_kwargs ) -> None: ... - def get_node(self, host: Any | None = ..., port: Any | None = ..., node_name: Any | None = ...): ... - def update_moved_exception(self, exception) -> None: ... - def get_node_from_slot(self, slot, read_from_replicas: bool = ..., server_type: Any | None = ...): ... - def get_nodes_by_server_type(self, server_type): ... - def populate_startup_nodes(self, nodes) -> None: ... - def check_slots_coverage(self, slots_cache): ... - def create_redis_connections(self, nodes) -> None: ... - def create_redis_node(self, host, port, **kwargs): ... + def get_node( + self, host: str | None = ..., port: int | str | None = ..., node_name: str | None = ... + ) -> ClusterNode | None: ... + def update_moved_exception(self, exception: MovedError) -> None: ... + def get_node_from_slot(self, slot: str, read_from_replicas: bool = ..., server_type: str | None = ...) -> ClusterNode: ... + def get_nodes_by_server_type(self, server_type: str) -> list[ClusterNode]: ... + def populate_startup_nodes(self, nodes: Iterable[ClusterNode]) -> None: ... + def check_slots_coverage(self, slots_cache: dict[str, list[ClusterNode]]) -> bool: ... + def create_redis_connections(self, nodes: Iterable[ClusterNode]) -> None: ... + def create_redis_node(self, host: str, port: int | str, **kwargs: Any) -> Redis[Incomplete]: ... def initialize(self) -> None: ... def close(self) -> None: ... def reset(self) -> None: ... class ClusterPubSub(PubSub): - node: Any - cluster: Any + node: ClusterNode | None + cluster: RedisCluster[Any] def __init__( - self, redis_cluster, node: Any | None = ..., host: Any | None = ..., port: Any | None = ..., **kwargs + self, + redis_cluster: RedisCluster[Any], + node: ClusterNode | None = ..., + host: str | None = ..., + port: int | None = ..., + **kwargs, + ) -> None: ... + def set_pubsub_node( + self, cluster: RedisCluster[Any], node: ClusterNode | None = ..., host: str | None = ..., port: int | None = ... ) -> None: ... - def set_pubsub_node(self, cluster, node: Any | None = ..., host: Any | None = ..., port: Any | None = ...) -> None: ... - def get_pubsub_node(self): ... + def get_pubsub_node(self) -> ClusterNode | None: ... def execute_command(self, *args, **kwargs) -> None: ... - def get_redis_connection(self): ... + def get_redis_connection(self) -> Redis[Any] | None: ... class ClusterPipeline(RedisCluster[_StrType], Generic[_StrType]): command_stack: list[Incomplete] @@ -190,16 +209,15 @@ class ClusterPipeline(RedisCluster[_StrType], Generic[_StrType]): **kwargs, ) -> None: ... def __len__(self) -> int: ... - def __nonzero__(self) -> Literal[True]: ... def __bool__(self) -> Literal[True]: ... def execute_command(self, *args, **kwargs): ... def pipeline_execute_command(self, *args, **options): ... def raise_first_error(self, stack) -> None: ... def annotate_exception(self, exception, number, command) -> None: ... def execute(self, raise_on_error: bool = ...): ... - scripts: Any - watching: bool - explicit_transaction: bool + scripts: set[Any] # is only set in `reset()` + watching: bool # is only set in `reset()` + explicit_transaction: bool # is only set in `reset()` def reset(self) -> None: ... def send_cluster_commands(self, stack, raise_on_error: bool = ..., allow_redirections: bool = ...): ... def eval(self) -> None: ... @@ -211,23 +229,30 @@ class ClusterPipeline(RedisCluster[_StrType], Generic[_StrType]): def script_load_for_pipeline(self, *args, **kwargs) -> None: ... def delete(self, *names): ... -def block_pipeline_command(name: str) -> Callable[..., Any]: ... +def block_pipeline_command(name: str) -> Callable[..., NoReturn]: ... class PipelineCommand: - args: Any - options: Any - position: Any - result: Any - node: Any + args: Sequence[EncodableT] + options: _ParseResponseOptions + position: int | None + result: Any | Exception | None + node: Incomplete | None asking: bool - def __init__(self, args, options: Any | None = ..., position: Any | None = ...) -> None: ... + def __init__( + self, args: Sequence[EncodableT], options: _ParseResponseOptions | None = ..., position: int | None = ... + ) -> None: ... + +class _ParseResponseCallback(Protocol): + def __call__(self, __connection: Connection, __command: EncodableT, **kwargs: Incomplete) -> Any: ... class NodeCommands: - parse_response: Any - connection_pool: Any - connection: Any - commands: Any - def __init__(self, parse_response, connection_pool, connection) -> None: ... - def append(self, c) -> None: ... + parse_response: _ParseResponseCallback + connection_pool: ConnectionPool + connection: Connection + commands: list[PipelineCommand] + def __init__( + self, parse_response: _ParseResponseCallback, connection_pool: ConnectionPool, connection: Connection + ) -> None: ... + def append(self, c: PipelineCommand) -> None: ... def write(self) -> None: ... def read(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/bf/commands.pyi b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/bf/commands.pyi index 5036d1108..73b0beb1e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/bf/commands.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/bf/commands.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete BF_RESERVE: str BF_ADD: str @@ -44,18 +44,18 @@ TDIGEST_MAX: str TDIGEST_INFO: str class BFCommands: - def create(self, key, errorRate, capacity, expansion: Any | None = ..., noScale: Any | None = ...): ... + def create(self, key, errorRate, capacity, expansion: Incomplete | None = ..., noScale: Incomplete | None = ...): ... def add(self, key, item): ... def madd(self, key, *items): ... def insert( self, key, items, - capacity: Any | None = ..., - error: Any | None = ..., - noCreate: Any | None = ..., - expansion: Any | None = ..., - noScale: Any | None = ..., + capacity: Incomplete | None = ..., + error: Incomplete | None = ..., + noCreate: Incomplete | None = ..., + expansion: Incomplete | None = ..., + noScale: Incomplete | None = ..., ): ... def exists(self, key, item): ... def mexists(self, key, *items): ... @@ -65,12 +65,17 @@ class BFCommands: class CFCommands: def create( - self, key, capacity, expansion: Any | None = ..., bucket_size: Any | None = ..., max_iterations: Any | None = ... + self, + key, + capacity, + expansion: Incomplete | None = ..., + bucket_size: Incomplete | None = ..., + max_iterations: Incomplete | None = ..., ): ... def add(self, key, item): ... def addnx(self, key, item): ... - def insert(self, key, items, capacity: Any | None = ..., nocreate: Any | None = ...): ... - def insertnx(self, key, items, capacity: Any | None = ..., nocreate: Any | None = ...): ... + def insert(self, key, items, capacity: Incomplete | None = ..., nocreate: Incomplete | None = ...): ... + def insertnx(self, key, items, capacity: Incomplete | None = ..., nocreate: Incomplete | None = ...): ... def exists(self, key, item): ... def delete(self, key, item): ... def count(self, key, item): ... @@ -88,14 +93,14 @@ class TOPKCommands: def info(self, key): ... class TDigestCommands: - def create(self, key, compression): ... + def create(self, key, compression: int = ...): ... def reset(self, key): ... - def add(self, key, values, weights): ... - def merge(self, toKey, fromKey): ... + def add(self, key, values): ... + def merge(self, destination_key, num_keys, *keys, compression: int | None = ..., override: bool = ...): ... def min(self, key): ... def max(self, key): ... - def quantile(self, key, quantile): ... - def cdf(self, key, value): ... + def quantile(self, key, quantile, *quantiles): ... + def cdf(self, key, value, *values): ... def info(self, key): ... class CMSCommands: diff --git a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/cluster.pyi b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/cluster.pyi index 66324ed8a..0a5981b01 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/cluster.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/cluster.pyi @@ -1,4 +1,5 @@ -from typing import Any, Generic +from _typeshed import Incomplete +from typing import Generic from .core import ACLCommands, DataAccessCommands, ManagementCommands, PubSubCommands, _StrType @@ -24,7 +25,7 @@ class ClusterDataAccessCommands(DataAccessCommands[_StrType], Generic[_StrType]) specific_argument: str = ..., len: bool = ..., idx: bool = ..., - minmatchlen: Any | None = ..., + minmatchlen: Incomplete | None = ..., withmatchlen: bool = ..., **kwargs, ): ... @@ -41,20 +42,20 @@ class RedisClusterCommands( def cluster_countkeysinslot(self, slot_id): ... def cluster_count_failure_report(self, node_id): ... def cluster_delslots(self, *slots): ... - def cluster_failover(self, target_node, option: Any | None = ...): ... - def cluster_info(self, target_nodes: Any | None = ...): ... + def cluster_failover(self, target_node, option: Incomplete | None = ...): ... + def cluster_info(self, target_nodes: Incomplete | None = ...): ... def cluster_keyslot(self, key): ... - def cluster_meet(self, host, port, target_nodes: Any | None = ...): ... + def cluster_meet(self, host, port, target_nodes: Incomplete | None = ...): ... def cluster_nodes(self): ... def cluster_replicate(self, target_nodes, node_id): ... - def cluster_reset(self, soft: bool = ..., target_nodes: Any | None = ...): ... - def cluster_save_config(self, target_nodes: Any | None = ...): ... + def cluster_reset(self, soft: bool = ..., target_nodes: Incomplete | None = ...): ... + def cluster_save_config(self, target_nodes: Incomplete | None = ...): ... def cluster_get_keys_in_slot(self, slot, num_keys): ... - def cluster_set_config_epoch(self, epoch, target_nodes: Any | None = ...): ... + def cluster_set_config_epoch(self, epoch, target_nodes: Incomplete | None = ...): ... def cluster_setslot(self, target_node, node_id, slot_id, state): ... def cluster_setslot_stable(self, slot_id): ... - def cluster_replicas(self, node_id, target_nodes: Any | None = ...): ... - def cluster_slots(self, target_nodes: Any | None = ...): ... + def cluster_replicas(self, node_id, target_nodes: Incomplete | None = ...): ... + def cluster_slots(self, target_nodes: Incomplete | None = ...): ... read_from_replicas: bool - def readonly(self, target_nodes: Any | None = ...): ... - def readwrite(self, target_nodes: Any | None = ...): ... + def readonly(self, target_nodes: Incomplete | None = ...): ... + def readwrite(self, target_nodes: Incomplete | None = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/core.pyi b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/core.pyi index 3b1f84d9c..65aca2c57 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/core.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/core.pyi @@ -7,7 +7,7 @@ from typing_extensions import Literal from ..asyncio.client import Redis as AsyncRedis from ..client import _CommandOptions, _Key, _Value -from ..typing import ChannelT, EncodableT, KeyT, PatternT, ScriptTextT +from ..typing import ChannelT, EncodableT, KeyT, PatternT, ScriptTextT, StreamIdT _ScoreCastFuncReturn = TypeVar("_ScoreCastFuncReturn") _StrType = TypeVar("_StrType", bound=str | bytes) @@ -35,9 +35,10 @@ class ACLCommands(Generic[_StrType]): keys: Sequence[str] | None = ..., channels: Iterable[ChannelT] | None = ..., selectors: Iterable[tuple[str, KeyT]] | None = ..., - reset: bool = ..., - reset_keys: bool = ..., - reset_passwords: bool = ..., + reset: bool = False, + reset_keys: bool = False, + reset_channels: bool = False, + reset_passwords: bool = False, **kwargs: _CommandOptions, ) -> bool: ... def acl_users(self, **kwargs: _CommandOptions) -> list[str]: ... @@ -66,9 +67,10 @@ class AsyncACLCommands(Generic[_StrType]): keys: Sequence[str] | None = ..., channels: Iterable[ChannelT] | None = ..., selectors: Iterable[tuple[str, KeyT]] | None = ..., - reset: bool = ..., - reset_keys: bool = ..., - reset_passwords: bool = ..., + reset: bool = False, + reset_keys: bool = False, + reset_channels: bool = False, + reset_passwords: bool = False, **kwargs: _CommandOptions, ) -> bool: ... async def acl_users(self, **kwargs: _CommandOptions) -> list[str]: ... @@ -81,12 +83,12 @@ class ManagementCommands: def client_kill(self, address: str, **kwargs: _CommandOptions) -> bool: ... def client_kill_filter( self, - _id: Any | None = ..., - _type: Any | None = ..., - addr: Any | None = ..., - skipme: Any | None = ..., - laddr: Any | None = ..., - user: Any | None = ..., + _id: Incomplete | None = ..., + _type: Incomplete | None = ..., + addr: Incomplete | None = ..., + skipme: Incomplete | None = ..., + laddr: Incomplete | None = ..., + user: Incomplete | None = ..., **kwargs: _CommandOptions, ): ... def client_info(self, **kwargs: _CommandOptions): ... @@ -98,15 +100,27 @@ class ManagementCommands: def client_reply(self, reply, **kwargs: _CommandOptions): ... def client_id(self, **kwargs: _CommandOptions) -> int: ... def client_tracking_on( - self, clientid: Any | None = ..., prefix=..., bcast: bool = ..., optin: bool = ..., optout: bool = ..., noloop: bool = ... + self, + clientid: Incomplete | None = ..., + prefix=..., + bcast: bool = ..., + optin: bool = ..., + optout: bool = ..., + noloop: bool = ..., ): ... def client_tracking_off( - self, clientid: Any | None = ..., prefix=..., bcast: bool = ..., optin: bool = ..., optout: bool = ..., noloop: bool = ... + self, + clientid: Incomplete | None = ..., + prefix=..., + bcast: bool = ..., + optin: bool = ..., + optout: bool = ..., + noloop: bool = ..., ): ... def client_tracking( self, on: bool = ..., - clientid: Any | None = ..., + clientid: Incomplete | None = ..., prefix=..., bcast: bool = ..., optin: bool = ..., @@ -149,7 +163,7 @@ class ManagementCommands: timeout, copy: bool = ..., replace: bool = ..., - auth: Any | None = ..., + auth: Incomplete | None = ..., **kwargs: _CommandOptions, ): ... def object(self, infotype, key, **kwargs: _CommandOptions): ... @@ -157,7 +171,7 @@ class ManagementCommands: def memory_help(self, **kwargs: _CommandOptions): ... def memory_stats(self, **kwargs: _CommandOptions) -> dict[str, Any]: ... def memory_malloc_stats(self, **kwargs: _CommandOptions): ... - def memory_usage(self, key, samples: Any | None = ..., **kwargs: _CommandOptions): ... + def memory_usage(self, key, samples: Incomplete | None = ..., **kwargs: _CommandOptions): ... def memory_purge(self, **kwargs: _CommandOptions): ... def ping(self, **kwargs: _CommandOptions) -> bool: ... def quit(self, **kwargs: _CommandOptions): ... @@ -172,8 +186,8 @@ class ManagementCommands: abort: bool = ..., **kwargs: _CommandOptions, ) -> None: ... - def slaveof(self, host: Any | None = ..., port: Any | None = ..., **kwargs: _CommandOptions): ... - def slowlog_get(self, num: Any | None = ..., **kwargs: _CommandOptions): ... + def slaveof(self, host: Incomplete | None = ..., port: Incomplete | None = ..., **kwargs: _CommandOptions): ... + def slowlog_get(self, num: Incomplete | None = ..., **kwargs: _CommandOptions): ... def slowlog_len(self, **kwargs: _CommandOptions): ... def slowlog_reset(self, **kwargs: _CommandOptions): ... def time(self, **kwargs: _CommandOptions): ... @@ -186,12 +200,12 @@ class AsyncManagementCommands: async def client_kill(self, address: str, **kwargs: _CommandOptions) -> bool: ... async def client_kill_filter( self, - _id: Any | None = ..., - _type: Any | None = ..., - addr: Any | None = ..., - skipme: Any | None = ..., - laddr: Any | None = ..., - user: Any | None = ..., + _id: Incomplete | None = ..., + _type: Incomplete | None = ..., + addr: Incomplete | None = ..., + skipme: Incomplete | None = ..., + laddr: Incomplete | None = ..., + user: Incomplete | None = ..., **kwargs: _CommandOptions, ): ... async def client_info(self, **kwargs: _CommandOptions): ... @@ -203,15 +217,27 @@ class AsyncManagementCommands: async def client_reply(self, reply, **kwargs: _CommandOptions): ... async def client_id(self, **kwargs: _CommandOptions) -> int: ... async def client_tracking_on( - self, clientid: Any | None = ..., prefix=..., bcast: bool = ..., optin: bool = ..., optout: bool = ..., noloop: bool = ... + self, + clientid: Incomplete | None = ..., + prefix=..., + bcast: bool = ..., + optin: bool = ..., + optout: bool = ..., + noloop: bool = ..., ): ... async def client_tracking_off( - self, clientid: Any | None = ..., prefix=..., bcast: bool = ..., optin: bool = ..., optout: bool = ..., noloop: bool = ... + self, + clientid: Incomplete | None = ..., + prefix=..., + bcast: bool = ..., + optin: bool = ..., + optout: bool = ..., + noloop: bool = ..., ): ... async def client_tracking( self, on: bool = ..., - clientid: Any | None = ..., + clientid: Incomplete | None = ..., prefix=..., bcast: bool = ..., optin: bool = ..., @@ -254,7 +280,7 @@ class AsyncManagementCommands: timeout, copy: bool = ..., replace: bool = ..., - auth: Any | None = ..., + auth: Incomplete | None = ..., **kwargs: _CommandOptions, ): ... async def object(self, infotype, key, **kwargs: _CommandOptions): ... @@ -262,7 +288,7 @@ class AsyncManagementCommands: async def memory_help(self, **kwargs: _CommandOptions): ... async def memory_stats(self, **kwargs: _CommandOptions) -> dict[str, Any]: ... async def memory_malloc_stats(self, **kwargs: _CommandOptions): ... - async def memory_usage(self, key, samples: Any | None = ..., **kwargs: _CommandOptions): ... + async def memory_usage(self, key, samples: Incomplete | None = ..., **kwargs: _CommandOptions): ... async def memory_purge(self, **kwargs: _CommandOptions): ... async def ping(self, **kwargs: _CommandOptions) -> bool: ... async def quit(self, **kwargs: _CommandOptions): ... @@ -277,8 +303,8 @@ class AsyncManagementCommands: abort: bool = ..., **kwargs: _CommandOptions, ) -> None: ... - async def slaveof(self, host: Any | None = ..., port: Any | None = ..., **kwargs: _CommandOptions): ... - async def slowlog_get(self, num: Any | None = ..., **kwargs: _CommandOptions): ... + async def slaveof(self, host: Incomplete | None = ..., port: Incomplete | None = ..., **kwargs: _CommandOptions): ... + async def slowlog_get(self, num: Incomplete | None = ..., **kwargs: _CommandOptions): ... async def slowlog_len(self, **kwargs: _CommandOptions): ... async def slowlog_reset(self, **kwargs: _CommandOptions): ... async def time(self, **kwargs: _CommandOptions): ... @@ -287,10 +313,10 @@ class AsyncManagementCommands: class BasicKeyCommands(Generic[_StrType]): def append(self, key, value): ... def bitcount(self, key: _Key, start: int | None = ..., end: int | None = ..., mode: str | None = ...) -> int: ... - def bitfield(self, key, default_overflow: Any | None = ...): ... + def bitfield(self, key, default_overflow: Incomplete | None = ...): ... def bitop(self, operation, dest, *keys): ... def bitpos(self, key: _Key, bit: int, start: int | None = ..., end: int | None = ..., mode: str | None = ...): ... - def copy(self, source, destination, destination_db: Any | None = ..., replace: bool = ...): ... + def copy(self, source, destination, destination_db: Incomplete | None = ..., replace: bool = ...): ... def decr(self, name, amount: int = ...) -> int: ... def decrby(self, name, amount: int = ...) -> int: ... def delete(self, *names: _Key) -> int: ... @@ -307,10 +333,10 @@ class BasicKeyCommands(Generic[_StrType]): def getex( self, name, - ex: Any | None = ..., - px: Any | None = ..., - exat: Any | None = ..., - pxat: Any | None = ..., + ex: Incomplete | None = ..., + px: Incomplete | None = ..., + exat: Incomplete | None = ..., + pxat: Incomplete | None = ..., persist: bool = ..., ): ... def __getitem__(self, name: str): ... @@ -345,25 +371,32 @@ class BasicKeyCommands(Generic[_StrType]): ) -> Literal[1, 0]: ... def psetex(self, name, time_ms, value): ... def pttl(self, name: _Key) -> int: ... - def hrandfield(self, key, count: Any | None = ..., withvalues: bool = ...): ... + def hrandfield(self, key, count: Incomplete | None = ..., withvalues: bool = ...): ... def randomkey(self, **kwargs: _CommandOptions): ... def rename(self, src, dst): ... def renamenx(self, src, dst): ... def restore( - self, name, ttl, value, replace: bool = ..., absttl: bool = ..., idletime: Any | None = ..., frequency: Any | None = ... + self, + name, + ttl, + value, + replace: bool = ..., + absttl: bool = ..., + idletime: Incomplete | None = ..., + frequency: Incomplete | None = ..., ): ... def set( self, name: _Key, value: _Value, - ex: None | int | timedelta = ..., - px: None | int | timedelta = ..., + ex: None | float | timedelta = ..., + px: None | float | timedelta = ..., nx: bool = ..., xx: bool = ..., keepttl: bool = ..., get: bool = ..., - exat: Any | None = ..., - pxat: Any | None = ..., + exat: Incomplete | None = ..., + pxat: Incomplete | None = ..., ) -> bool | None: ... def __setitem__(self, name, value) -> None: ... def setbit(self, name: _Key, offset: int, value: int) -> int: ... @@ -378,7 +411,7 @@ class BasicKeyCommands(Generic[_StrType]): specific_argument: str = ..., len: bool = ..., idx: bool = ..., - minmatchlen: Any | None = ..., + minmatchlen: Incomplete | None = ..., withmatchlen: bool = ..., **kwargs: _CommandOptions, ): ... @@ -394,10 +427,10 @@ class BasicKeyCommands(Generic[_StrType]): class AsyncBasicKeyCommands(Generic[_StrType]): async def append(self, key, value): ... async def bitcount(self, key: _Key, start: int | None = ..., end: int | None = ..., mode: str | None = ...) -> int: ... - async def bitfield(self, key, default_overflow: Any | None = ...): ... + async def bitfield(self, key, default_overflow: Incomplete | None = ...): ... async def bitop(self, operation, dest, *keys): ... async def bitpos(self, key: _Key, bit: int, start: int | None = ..., end: int | None = ..., mode: str | None = ...): ... - async def copy(self, source, destination, destination_db: Any | None = ..., replace: bool = ...): ... + async def copy(self, source, destination, destination_db: Incomplete | None = ..., replace: bool = ...): ... async def decr(self, name, amount: int = ...) -> int: ... async def decrby(self, name, amount: int = ...) -> int: ... async def delete(self, *names: _Key) -> int: ... @@ -412,10 +445,10 @@ class AsyncBasicKeyCommands(Generic[_StrType]): async def getex( self, name, - ex: Any | None = ..., - px: Any | None = ..., - exat: Any | None = ..., - pxat: Any | None = ..., + ex: Incomplete | None = ..., + px: Incomplete | None = ..., + exat: Incomplete | None = ..., + pxat: Incomplete | None = ..., persist: bool = ..., ): ... async def getbit(self, name: _Key, offset: int) -> int: ... @@ -449,25 +482,32 @@ class AsyncBasicKeyCommands(Generic[_StrType]): ) -> Literal[1, 0]: ... async def psetex(self, name, time_ms, value): ... async def pttl(self, name: _Key) -> int: ... - async def hrandfield(self, key, count: Any | None = ..., withvalues: bool = ...): ... + async def hrandfield(self, key, count: Incomplete | None = ..., withvalues: bool = ...): ... async def randomkey(self, **kwargs: _CommandOptions): ... async def rename(self, src, dst): ... async def renamenx(self, src, dst): ... async def restore( - self, name, ttl, value, replace: bool = ..., absttl: bool = ..., idletime: Any | None = ..., frequency: Any | None = ... + self, + name, + ttl, + value, + replace: bool = ..., + absttl: bool = ..., + idletime: Incomplete | None = ..., + frequency: Incomplete | None = ..., ): ... async def set( self, name: _Key, value: _Value, - ex: None | int | timedelta = ..., - px: None | int | timedelta = ..., + ex: None | float | timedelta = ..., + px: None | float | timedelta = ..., nx: bool = ..., xx: bool = ..., keepttl: bool = ..., get: bool = ..., - exat: Any | None = ..., - pxat: Any | None = ..., + exat: Incomplete | None = ..., + pxat: Incomplete | None = ..., ) -> bool | None: ... async def setbit(self, name: _Key, offset: int, value: int) -> int: ... async def setex(self, name: _Key, time: int | timedelta, value: _Value) -> bool: ... @@ -481,7 +521,7 @@ class AsyncBasicKeyCommands(Generic[_StrType]): specific_argument: str = ..., len: bool = ..., idx: bool = ..., - minmatchlen: Any | None = ..., + minmatchlen: Incomplete | None = ..., withmatchlen: bool = ..., **kwargs: _CommandOptions, ): ... @@ -524,7 +564,9 @@ class ListCommands(Generic[_StrType]): def rpoplpush(self, src, dst): ... def rpush(self, name: _Value, *values: _Value) -> int: ... def rpushx(self, name, value): ... - def lpos(self, name, value, rank: Any | None = ..., count: Any | None = ..., maxlen: Any | None = ...): ... + def lpos( + self, name, value, rank: Incomplete | None = ..., count: Incomplete | None = ..., maxlen: Incomplete | None = ... + ): ... @overload def sort( self, @@ -592,7 +634,9 @@ class AsyncListCommands(Generic[_StrType]): async def rpoplpush(self, src, dst): ... async def rpush(self, name: _Value, *values: _Value) -> int: ... async def rpushx(self, name, value): ... - async def lpos(self, name, value, rank: Any | None = ..., count: Any | None = ..., maxlen: Any | None = ...): ... + async def lpos( + self, name, value, rank: Incomplete | None = ..., count: Incomplete | None = ..., maxlen: Incomplete | None = ... + ): ... @overload async def sort( self, @@ -814,11 +858,18 @@ class StreamCommands: maxlen=..., approximate: bool = ..., nomkstream: bool = ..., - minid: Any | None = ..., - limit: Any | None = ..., + minid: Incomplete | None = ..., + limit: Incomplete | None = ..., ): ... def xautoclaim( - self, name, groupname, consumername, min_idle_time, start_id: int = ..., count: Any | None = ..., justid: bool = ... + self, + name, + groupname, + consumername, + min_idle_time, + start_id: StreamIdT = ..., + count: Incomplete | None = ..., + justid: bool = ..., ): ... def xclaim( self, name, groupname, consumername, min_idle_time, message_ids, idle=..., time=..., retrycount=..., force=..., justid=... @@ -835,14 +886,14 @@ class StreamCommands: def xlen(self, name: _Key) -> int: ... def xpending(self, name, groupname): ... def xpending_range( - self, name: _Key, groupname, min, max, count: int, consumername: Any | None = ..., idle: int | None = ... + self, name: _Key, groupname, min, max, count: int, consumername: Incomplete | None = ..., idle: int | None = ... ): ... - def xrange(self, name, min: str = ..., max: str = ..., count: Any | None = ...): ... - def xread(self, streams, count: Any | None = ..., block: Any | None = ...): ... + def xrange(self, name, min: str = ..., max: str = ..., count: Incomplete | None = ...): ... + def xread(self, streams, count: Incomplete | None = ..., block: Incomplete | None = ...): ... def xreadgroup( - self, groupname, consumername, streams, count: Any | None = ..., block: Any | None = ..., noack: bool = ... + self, groupname, consumername, streams, count: Incomplete | None = ..., block: Incomplete | None = ..., noack: bool = ... ): ... - def xrevrange(self, name, max: str = ..., min: str = ..., count: Any | None = ...): ... + def xrevrange(self, name, max: str = ..., min: str = ..., count: Incomplete | None = ...): ... def xtrim( self, name, maxlen: int | None = ..., approximate: bool = ..., minid: Incomplete | None = ..., limit: int | None = ... ): ... @@ -857,11 +908,18 @@ class AsyncStreamCommands: maxlen=..., approximate: bool = ..., nomkstream: bool = ..., - minid: Any | None = ..., - limit: Any | None = ..., + minid: Incomplete | None = ..., + limit: Incomplete | None = ..., ): ... async def xautoclaim( - self, name, groupname, consumername, min_idle_time, start_id: int = ..., count: Any | None = ..., justid: bool = ... + self, + name, + groupname, + consumername, + min_idle_time, + start_id: StreamIdT = ..., + count: Incomplete | None = ..., + justid: bool = ..., ): ... async def xclaim( self, name, groupname, consumername, min_idle_time, message_ids, idle=..., time=..., retrycount=..., force=..., justid=... @@ -878,14 +936,14 @@ class AsyncStreamCommands: async def xlen(self, name: _Key) -> int: ... async def xpending(self, name, groupname): ... async def xpending_range( - self, name: _Key, groupname, min, max, count: int, consumername: Any | None = ..., idle: int | None = ... + self, name: _Key, groupname, min, max, count: int, consumername: Incomplete | None = ..., idle: int | None = ... ): ... - async def xrange(self, name, min: str = ..., max: str = ..., count: Any | None = ...): ... - async def xread(self, streams, count: Any | None = ..., block: Any | None = ...): ... + async def xrange(self, name, min: str = ..., max: str = ..., count: Incomplete | None = ...): ... + async def xread(self, streams, count: Incomplete | None = ..., block: Incomplete | None = ...): ... async def xreadgroup( - self, groupname, consumername, streams, count: Any | None = ..., block: Any | None = ..., noack: bool = ... + self, groupname, consumername, streams, count: Incomplete | None = ..., block: Incomplete | None = ..., noack: bool = ... ): ... - async def xrevrange(self, name, max: str = ..., min: str = ..., count: Any | None = ...): ... + async def xrevrange(self, name, max: str = ..., min: str = ..., count: Incomplete | None = ...): ... async def xtrim( self, name, maxlen: int | None = ..., approximate: bool = ..., minid: Incomplete | None = ..., limit: int | None = ... ): ... @@ -899,20 +957,20 @@ class SortedSetCommands(Generic[_StrType]): xx: bool = ..., ch: bool = ..., incr: bool = ..., - gt: Any | None = ..., - lt: Any | None = ..., + gt: Incomplete | None = ..., + lt: Incomplete | None = ..., ) -> int: ... def zcard(self, name: _Key) -> int: ... def zcount(self, name: _Key, min: _Value, max: _Value) -> int: ... def zdiff(self, keys, withscores: bool = ...): ... def zdiffstore(self, dest, keys): ... def zincrby(self, name: _Key, amount: float, value: _Value) -> float: ... - def zinter(self, keys, aggregate: Any | None = ..., withscores: bool = ...): ... + def zinter(self, keys, aggregate: Incomplete | None = ..., withscores: bool = ...): ... def zinterstore(self, dest: _Key, keys: Iterable[_Key], aggregate: Literal["SUM", "MIN", "MAX"] | None = ...) -> int: ... def zlexcount(self, name: _Key, min: _Value, max: _Value) -> int: ... def zpopmax(self, name: _Key, count: int | None = ...) -> list[tuple[_StrType, float]]: ... def zpopmin(self, name: _Key, count: int | None = ...) -> list[tuple[_StrType, float]]: ... - def zrandmember(self, key, count: Any | None = ..., withscores: bool = ...): ... + def zrandmember(self, key, count: Incomplete | None = ..., withscores: bool = ...): ... @overload def bzpopmax(self, keys: _Key | Iterable[_Key], timeout: Literal[0] = ...) -> tuple[_StrType, _StrType, float]: ... @overload @@ -1015,8 +1073,8 @@ class SortedSetCommands(Generic[_StrType]): byscore: bool = ..., bylex: bool = ..., desc: bool = ..., - offset: Any | None = ..., - num: Any | None = ..., + offset: Incomplete | None = ..., + num: Incomplete | None = ..., ): ... def zrangebylex( self, name: _Key, min: _Value, max: _Value, start: int | None = ..., num: int | None = ... @@ -1085,7 +1143,7 @@ class SortedSetCommands(Generic[_StrType]): def zremrangebyscore(self, name: _Key, min: _Value, max: _Value) -> int: ... def zrevrank(self, name: _Key, value: _Value) -> int | None: ... def zscore(self, name: _Key, value: _Value) -> float | None: ... - def zunion(self, keys, aggregate: Any | None = ..., withscores: bool = ...): ... + def zunion(self, keys, aggregate: Incomplete | None = ..., withscores: bool = ...): ... def zunionstore(self, dest: _Key, keys: Iterable[_Key], aggregate: Literal["SUM", "MIN", "MAX"] | None = ...) -> int: ... def zmscore(self, key, members): ... @@ -1098,22 +1156,22 @@ class AsyncSortedSetCommands(Generic[_StrType]): xx: bool = ..., ch: bool = ..., incr: bool = ..., - gt: Any | None = ..., - lt: Any | None = ..., + gt: Incomplete | None = ..., + lt: Incomplete | None = ..., ) -> int: ... async def zcard(self, name: _Key) -> int: ... async def zcount(self, name: _Key, min: _Value, max: _Value) -> int: ... async def zdiff(self, keys, withscores: bool = ...): ... async def zdiffstore(self, dest, keys): ... async def zincrby(self, name: _Key, amount: float, value: _Value) -> float: ... - async def zinter(self, keys, aggregate: Any | None = ..., withscores: bool = ...): ... + async def zinter(self, keys, aggregate: Incomplete | None = ..., withscores: bool = ...): ... async def zinterstore( self, dest: _Key, keys: Iterable[_Key], aggregate: Literal["SUM", "MIN", "MAX"] | None = ... ) -> int: ... async def zlexcount(self, name: _Key, min: _Value, max: _Value) -> int: ... async def zpopmax(self, name: _Key, count: int | None = ...) -> list[tuple[_StrType, float]]: ... async def zpopmin(self, name: _Key, count: int | None = ...) -> list[tuple[_StrType, float]]: ... - async def zrandmember(self, key, count: Any | None = ..., withscores: bool = ...): ... + async def zrandmember(self, key, count: Incomplete | None = ..., withscores: bool = ...): ... @overload async def bzpopmax(self, keys: _Key | Iterable[_Key], timeout: Literal[0] = ...) -> tuple[_StrType, _StrType, float]: ... @overload @@ -1218,8 +1276,8 @@ class AsyncSortedSetCommands(Generic[_StrType]): byscore: bool = ..., bylex: bool = ..., desc: bool = ..., - offset: Any | None = ..., - num: Any | None = ..., + offset: Incomplete | None = ..., + num: Incomplete | None = ..., ): ... async def zrangebylex( self, name: _Key, min: _Value, max: _Value, start: int | None = ..., num: int | None = ... @@ -1288,7 +1346,7 @@ class AsyncSortedSetCommands(Generic[_StrType]): async def zremrangebyscore(self, name: _Key, min: _Value, max: _Value) -> int: ... async def zrevrank(self, name: _Key, value: _Value) -> int | None: ... async def zscore(self, name: _Key, value: _Value) -> float | None: ... - async def zunion(self, keys, aggregate: Any | None = ..., withscores: bool = ...): ... + async def zunion(self, keys, aggregate: Incomplete | None = ..., withscores: bool = ...): ... async def zunionstore( self, dest: _Key, keys: Iterable[_Key], aggregate: Literal["SUM", "MIN", "MAX"] | None = ... ) -> int: ... @@ -1315,12 +1373,12 @@ class HashCommands(Generic[_StrType]): def hlen(self, name: _Key) -> int: ... @overload def hset( - self, name: _Key, key: _Key, value: _Value, mapping: Mapping[_Key, _Value] | None = ..., items: Any | None = ... + self, name: _Key, key: _Key, value: _Value, mapping: Mapping[_Key, _Value] | None = ..., items: Incomplete | None = ... ) -> int: ... @overload - def hset(self, name: _Key, key: None, value: None, mapping: Mapping[_Key, _Value], items: Any | None = ...) -> int: ... + def hset(self, name: _Key, key: None, value: None, mapping: Mapping[_Key, _Value], items: Incomplete | None = ...) -> int: ... @overload - def hset(self, name: _Key, *, mapping: Mapping[_Key, _Value], items: Any | None = ...) -> int: ... + def hset(self, name: _Key, *, mapping: Mapping[_Key, _Value], items: Incomplete | None = ...) -> int: ... def hsetnx(self, name: _Key, key: _Key, value: _Value) -> int: ... def hmset(self, name: _Key, mapping: Mapping[_Key, _Value]) -> bool: ... def hmget(self, name: _Key, keys: _Key | Iterable[_Key], *args: _Key) -> list[_StrType | None]: ... @@ -1338,12 +1396,14 @@ class AsyncHashCommands(Generic[_StrType]): async def hlen(self, name: _Key) -> int: ... @overload async def hset( - self, name: _Key, key: _Key, value: _Value, mapping: Mapping[_Key, _Value] | None = ..., items: Any | None = ... + self, name: _Key, key: _Key, value: _Value, mapping: Mapping[_Key, _Value] | None = ..., items: Incomplete | None = ... ) -> int: ... @overload - async def hset(self, name: _Key, key: None, value: None, mapping: Mapping[_Key, _Value], items: Any | None = ...) -> int: ... + async def hset( + self, name: _Key, key: None, value: None, mapping: Mapping[_Key, _Value], items: Incomplete | None = ... + ) -> int: ... @overload - async def hset(self, name: _Key, *, mapping: Mapping[_Key, _Value], items: Any | None = ...) -> int: ... + async def hset(self, name: _Key, *, mapping: Mapping[_Key, _Value], items: Incomplete | None = ...) -> int: ... async def hsetnx(self, name: _Key, key: _Key, value: _Value) -> int: ... async def hmset(self, name: _Key, mapping: Mapping[_Key, _Value]) -> bool: ... async def hmget(self, name: _Key, keys: _Key | Iterable[_Key], *args: _Key) -> list[_StrType | None]: ... @@ -1373,7 +1433,7 @@ class ScriptCommands(Generic[_StrType]): def evalsha(self, sha, numkeys, *keys_and_args): ... def script_exists(self, *args): ... def script_debug(self, *args): ... - def script_flush(self, sync_type: Any | None = ...): ... + def script_flush(self, sync_type: Incomplete | None = ...): ... def script_kill(self): ... def script_load(self, script): ... def register_script(self, script: str | _StrType) -> Script: ... @@ -1383,14 +1443,14 @@ class AsyncScriptCommands(Generic[_StrType]): async def evalsha(self, sha, numkeys, *keys_and_args): ... async def script_exists(self, *args): ... async def script_debug(self, *args): ... - async def script_flush(self, sync_type: Any | None = ...): ... + async def script_flush(self, sync_type: Incomplete | None = ...): ... async def script_kill(self): ... async def script_load(self, script): ... def register_script(self, script: ScriptTextT) -> AsyncScript: ... # type: ignore[override] class GeoCommands: def geoadd(self, name, values, nx: bool = ..., xx: bool = ..., ch: bool = ...): ... - def geodist(self, name, place1, place2, unit: Any | None = ...): ... + def geodist(self, name, place1, place2, unit: Incomplete | None = ...): ... def geohash(self, name, *values): ... def geopos(self, name, *values): ... def georadius( @@ -1399,14 +1459,14 @@ class GeoCommands: longitude, latitude, radius, - unit: Any | None = ..., + unit: Incomplete | None = ..., withdist: bool = ..., withcoord: bool = ..., withhash: bool = ..., - count: Any | None = ..., - sort: Any | None = ..., - store: Any | None = ..., - store_dist: Any | None = ..., + count: Incomplete | None = ..., + sort: Incomplete | None = ..., + store: Incomplete | None = ..., + store_dist: Incomplete | None = ..., any: bool = ..., ): ... def georadiusbymember( @@ -1414,28 +1474,28 @@ class GeoCommands: name, member, radius, - unit: Any | None = ..., + unit: Incomplete | None = ..., withdist: bool = ..., withcoord: bool = ..., withhash: bool = ..., - count: Any | None = ..., - sort: Any | None = ..., - store: Any | None = ..., - store_dist: Any | None = ..., + count: Incomplete | None = ..., + sort: Incomplete | None = ..., + store: Incomplete | None = ..., + store_dist: Incomplete | None = ..., any: bool = ..., ): ... def geosearch( self, name, - member: Any | None = ..., - longitude: Any | None = ..., - latitude: Any | None = ..., + member: Incomplete | None = ..., + longitude: Incomplete | None = ..., + latitude: Incomplete | None = ..., unit: str = ..., - radius: Any | None = ..., - width: Any | None = ..., - height: Any | None = ..., - sort: Any | None = ..., - count: Any | None = ..., + radius: Incomplete | None = ..., + width: Incomplete | None = ..., + height: Incomplete | None = ..., + sort: Incomplete | None = ..., + count: Incomplete | None = ..., any: bool = ..., withcoord: bool = ..., withdist: bool = ..., @@ -1445,22 +1505,22 @@ class GeoCommands: self, dest, name, - member: Any | None = ..., - longitude: Any | None = ..., - latitude: Any | None = ..., + member: Incomplete | None = ..., + longitude: Incomplete | None = ..., + latitude: Incomplete | None = ..., unit: str = ..., - radius: Any | None = ..., - width: Any | None = ..., - height: Any | None = ..., - sort: Any | None = ..., - count: Any | None = ..., + radius: Incomplete | None = ..., + width: Incomplete | None = ..., + height: Incomplete | None = ..., + sort: Incomplete | None = ..., + count: Incomplete | None = ..., any: bool = ..., storedist: bool = ..., ): ... class AsyncGeoCommands: async def geoadd(self, name, values, nx: bool = ..., xx: bool = ..., ch: bool = ...): ... - async def geodist(self, name, place1, place2, unit: Any | None = ...): ... + async def geodist(self, name, place1, place2, unit: Incomplete | None = ...): ... async def geohash(self, name, *values): ... async def geopos(self, name, *values): ... async def georadius( @@ -1469,14 +1529,14 @@ class AsyncGeoCommands: longitude, latitude, radius, - unit: Any | None = ..., + unit: Incomplete | None = ..., withdist: bool = ..., withcoord: bool = ..., withhash: bool = ..., - count: Any | None = ..., - sort: Any | None = ..., - store: Any | None = ..., - store_dist: Any | None = ..., + count: Incomplete | None = ..., + sort: Incomplete | None = ..., + store: Incomplete | None = ..., + store_dist: Incomplete | None = ..., any: bool = ..., ): ... async def georadiusbymember( @@ -1484,28 +1544,28 @@ class AsyncGeoCommands: name, member, radius, - unit: Any | None = ..., + unit: Incomplete | None = ..., withdist: bool = ..., withcoord: bool = ..., withhash: bool = ..., - count: Any | None = ..., - sort: Any | None = ..., - store: Any | None = ..., - store_dist: Any | None = ..., + count: Incomplete | None = ..., + sort: Incomplete | None = ..., + store: Incomplete | None = ..., + store_dist: Incomplete | None = ..., any: bool = ..., ): ... async def geosearch( self, name, - member: Any | None = ..., - longitude: Any | None = ..., - latitude: Any | None = ..., + member: Incomplete | None = ..., + longitude: Incomplete | None = ..., + latitude: Incomplete | None = ..., unit: str = ..., - radius: Any | None = ..., - width: Any | None = ..., - height: Any | None = ..., - sort: Any | None = ..., - count: Any | None = ..., + radius: Incomplete | None = ..., + width: Incomplete | None = ..., + height: Incomplete | None = ..., + sort: Incomplete | None = ..., + count: Incomplete | None = ..., any: bool = ..., withcoord: bool = ..., withdist: bool = ..., @@ -1515,15 +1575,15 @@ class AsyncGeoCommands: self, dest, name, - member: Any | None = ..., - longitude: Any | None = ..., - latitude: Any | None = ..., + member: Incomplete | None = ..., + longitude: Incomplete | None = ..., + latitude: Incomplete | None = ..., unit: str = ..., - radius: Any | None = ..., - width: Any | None = ..., - height: Any | None = ..., - sort: Any | None = ..., - count: Any | None = ..., + radius: Incomplete | None = ..., + width: Incomplete | None = ..., + height: Incomplete | None = ..., + sort: Incomplete | None = ..., + count: Incomplete | None = ..., any: bool = ..., storedist: bool = ..., ): ... @@ -1539,13 +1599,13 @@ class ModuleCommands: class Script: def __init__(self, registered_client, script) -> None: ... - def __call__(self, keys=..., args=..., client: Any | None = ...): ... + def __call__(self, keys=..., args=..., client: Incomplete | None = ...): ... class BitFieldOperation: - def __init__(self, client, key, default_overflow: Any | None = ...): ... + def __init__(self, client, key, default_overflow: Incomplete | None = ...): ... def reset(self) -> None: ... def overflow(self, overflow): ... - def incrby(self, fmt, offset, increment, overflow: Any | None = ...): ... + def incrby(self, fmt, offset, increment, overflow: Incomplete | None = ...): ... def get(self, fmt, offset): ... def set(self, fmt, offset, value): ... @property diff --git a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/graph/commands.pyi b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/graph/commands.pyi index baa061374..b5ccf8519 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/graph/commands.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/graph/commands.pyi @@ -1,17 +1,20 @@ +from _typeshed import Incomplete from typing import Any class GraphCommands: def commit(self): ... version: Any - def query(self, q, params: Any | None = ..., timeout: Any | None = ..., read_only: bool = ..., profile: bool = ...): ... + def query( + self, q, params: Incomplete | None = ..., timeout: Incomplete | None = ..., read_only: bool = ..., profile: bool = ... + ): ... def merge(self, pattern): ... def delete(self): ... nodes: Any edges: Any def flush(self) -> None: ... - def explain(self, query, params: Any | None = ...): ... + def explain(self, query, params: Incomplete | None = ...): ... def bulk(self, **kwargs) -> None: ... def profile(self, query): ... def slowlog(self): ... - def config(self, name, value: Any | None = ..., set: bool = ...): ... + def config(self, name, value: Incomplete | None = ..., set: bool = ...): ... def list_keys(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/graph/edge.pyi b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/graph/edge.pyi index 643175d75..159755792 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/graph/edge.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/graph/edge.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any class Edge: @@ -6,6 +7,8 @@ class Edge: properties: Any src_node: Any dest_node: Any - def __init__(self, src_node, relation, dest_node, edge_id: Any | None = ..., properties: Any | None = ...) -> None: ... + def __init__( + self, src_node, relation, dest_node, edge_id: Incomplete | None = ..., properties: Incomplete | None = ... + ) -> None: ... def to_string(self): ... def __eq__(self, rhs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/graph/node.pyi b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/graph/node.pyi index 8c5ec73ac..9160daee9 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/graph/node.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/graph/node.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any class Node: @@ -8,10 +9,10 @@ class Node: properties: Any def __init__( self, - node_id: Any | None = ..., - alias: Any | None = ..., + node_id: Incomplete | None = ..., + alias: Incomplete | None = ..., label: str | list[str] | None = ..., - properties: Any | None = ..., + properties: Incomplete | None = ..., ) -> None: ... def to_string(self): ... def __eq__(self, rhs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/json/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/json/__init__.pyi index e67c7bfef..ef69aceb6 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/json/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/json/__init__.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from ...client import Pipeline as ClientPipeline @@ -7,8 +8,8 @@ class JSON(JSONCommands): MODULE_CALLBACKS: dict[str, Any] client: Any execute_command: Any - MODULE_VERSION: Any | None - def __init__(self, client, version: Any | None = ..., decoder=..., encoder=...) -> None: ... - def pipeline(self, transaction: bool = ..., shard_hint: Any | None = ...) -> Pipeline: ... + MODULE_VERSION: Incomplete | None + def __init__(self, client, version: Incomplete | None = ..., decoder=..., encoder=...) -> None: ... + def pipeline(self, transaction: bool = ..., shard_hint: Incomplete | None = ...) -> Pipeline: ... -class Pipeline(JSONCommands, ClientPipeline): ... # type: ignore[misc] +class Pipeline(JSONCommands, ClientPipeline[Incomplete]): ... # type: ignore[misc] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/json/commands.pyi b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/json/commands.pyi index 6f830282a..a40138525 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/json/commands.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/json/commands.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete class JSONCommands: def arrappend(self, name, path=..., *args): ... @@ -21,10 +21,10 @@ class JSONCommands: def set(self, name, path, obj, nx: bool = ..., xx: bool = ..., decode_keys: bool = ...): ... def set_file(self, name, path, file_name, nx: bool = ..., xx: bool = ..., decode_keys: bool = ...): ... def set_path(self, json_path, root_folder, nx: bool = ..., xx: bool = ..., decode_keys: bool = ...): ... - def strlen(self, name, path: Any | None = ...): ... + def strlen(self, name, path: Incomplete | None = ...): ... def toggle(self, name, path=...): ... def strappend(self, name, value, path=...): ... - def debug(self, subcommand, key: Any | None = ..., path=...): ... + def debug(self, subcommand, key: Incomplete | None = ..., path=...): ... def jsonget(self, *args, **kwargs): ... def jsonmget(self, *args, **kwargs): ... def jsonset(self, *args, **kwargs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/parser.pyi b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/parser.pyi index 58094e5d7..f76490828 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/parser.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/parser.pyi @@ -1,8 +1,8 @@ -from typing import Any +from redis.client import AbstractRedis +from redis.typing import EncodableT class CommandsParser: - initialized: bool - commands: Any - def __init__(self, redis_connection) -> None: ... - def initialize(self, r) -> None: ... - def get_keys(self, redis_conn, *args): ... + commands: dict[str, str] + def __init__(self, redis_connection: AbstractRedis) -> None: ... + def initialize(self, r: AbstractRedis) -> None: ... + def get_keys(self, redis_conn: AbstractRedis, *args: EncodableT) -> list[EncodableT] | None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/search/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/search/__init__.pyi index 5f8452305..d62721a01 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/search/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/search/__init__.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete from .commands import SearchCommands @@ -10,7 +10,7 @@ class Search(SearchCommands): doc_id, nosave: bool = ..., score: float = ..., - payload: Any | None = ..., + payload: Incomplete | None = ..., replace: bool = ..., partial: bool = ..., no_create: bool = ..., diff --git a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/search/commands.pyi b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/search/commands.pyi index bbff97b89..29777c638 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/search/commands.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/search/commands.pyi @@ -56,10 +56,10 @@ class SearchCommands: fields, no_term_offsets: bool = ..., no_field_flags: bool = ..., - stopwords: Any | None = ..., - definition: Any | None = ..., + stopwords: Incomplete | None = ..., + definition: Incomplete | None = ..., max_text_fields: bool = ..., # added in 4.1.1 - temporary: Any | None = ..., # added in 4.1.1 + temporary: Incomplete | None = ..., # added in 4.1.1 no_highlight: bool = ..., # added in 4.1.1 no_term_frequencies: bool = ..., # added in 4.1.1 skip_initial_scan: bool = ..., # added in 4.1.1 @@ -71,15 +71,15 @@ class SearchCommands: doc_id, nosave: bool = ..., score: float = ..., - payload: Any | None = ..., + payload: Incomplete | None = ..., replace: bool = ..., partial: bool = ..., - language: Any | None = ..., + language: Incomplete | None = ..., no_create: bool = ..., **fields, ): ... - def add_document_hash(self, doc_id, score: float = ..., language: Any | None = ..., replace: bool = ...): ... - def delete_document(self, doc_id, conn: Any | None = ..., delete_actual_document: bool = ...): ... + def add_document_hash(self, doc_id, score: float = ..., language: Incomplete | None = ..., replace: bool = ...): ... + def delete_document(self, doc_id, conn: Incomplete | None = ..., delete_actual_document: bool = ...): ... def load_document(self, id): ... def get(self, *ids): ... def info(self): ... @@ -91,7 +91,9 @@ class SearchCommands: def profile( self, query: str | Query | AggregateRequest, limited: bool = ..., query_params: Mapping[str, str | float] | None = ... ) -> tuple[Incomplete, Incomplete]: ... - def spellcheck(self, query, distance: Any | None = ..., include: Any | None = ..., exclude: Any | None = ...): ... + def spellcheck( + self, query, distance: Incomplete | None = ..., include: Incomplete | None = ..., exclude: Incomplete | None = ... + ): ... def dict_add(self, name, *terms): ... def dict_del(self, name, *terms): ... def dict_dump(self, name): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/search/query.pyi b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/search/query.pyi index b41ee067d..e88f2a565 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/search/query.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/search/query.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any class Query: @@ -5,11 +6,15 @@ class Query: def query_string(self): ... def limit_ids(self, *ids): ... def return_fields(self, *fields): ... - def return_field(self, field, as_field: Any | None = ...): ... + def return_field(self, field, as_field: Incomplete | None = ...): ... def summarize( - self, fields: Any | None = ..., context_len: Any | None = ..., num_frags: Any | None = ..., sep: Any | None = ... + self, + fields: Incomplete | None = ..., + context_len: Incomplete | None = ..., + num_frags: Incomplete | None = ..., + sep: Incomplete | None = ..., ): ... - def highlight(self, fields: Any | None = ..., tags: Any | None = ...): ... + def highlight(self, fields: Incomplete | None = ..., tags: Incomplete | None = ...): ... def language(self, language): ... def slop(self, slop): ... def in_order(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/timeseries/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/timeseries/__init__.pyi index fae4f849b..425d3a4ca 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/timeseries/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/timeseries/__init__.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from ...client import Pipeline as ClientPipeline @@ -7,7 +8,7 @@ class TimeSeries(TimeSeriesCommands): MODULE_CALLBACKS: dict[str, Any] client: Any execute_command: Any - def __init__(self, client: Any | None = ..., **kwargs) -> None: ... - def pipeline(self, transaction: bool = ..., shard_hint: Any | None = ...) -> Pipeline: ... + def __init__(self, client: Incomplete | None = ..., **kwargs) -> None: ... + def pipeline(self, transaction: bool = ..., shard_hint: Incomplete | None = ...) -> Pipeline: ... -class Pipeline(TimeSeriesCommands, ClientPipeline): ... # type: ignore[misc] +class Pipeline(TimeSeriesCommands, ClientPipeline[Incomplete]): ... # type: ignore[misc] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/timeseries/commands.pyi b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/timeseries/commands.pyi index 4a5a19af1..dc15c8506 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/timeseries/commands.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/timeseries/commands.pyi @@ -1,5 +1,6 @@ -from typing import Any -from typing_extensions import Literal +from typing_extensions import Literal, TypeAlias + +_Key: TypeAlias = bytes | str | memoryview ADD_CMD: Literal["TS.ADD"] ALTER_CMD: Literal["TS.ALTER"] @@ -20,76 +21,135 @@ RANGE_CMD: Literal["TS.RANGE"] REVRANGE_CMD: Literal["TS.REVRANGE"] class TimeSeriesCommands: - def create(self, key, **kwargs): ... - def alter(self, key, **kwargs): ... - def add(self, key, timestamp, value, **kwargs): ... + def create( + self, + key: _Key, + retention_msecs: int | None = ..., + uncompressed: bool | None = ..., + labels: dict[str, str] | None = ..., + chunk_size: int | None = ..., + duplicate_policy: str | None = ..., + ): ... + def alter( + self, + key: _Key, + retention_msecs: int | None = ..., + labels: dict[str, str] | None = ..., + chunk_size: int | None = ..., + duplicate_policy: str | None = ..., + ): ... + def add( + self, + key: _Key, + timestamp: int | str, + value: float, + retention_msecs: int | None = ..., + uncompressed: bool | None = ..., + labels: dict[str, str] | None = ..., + chunk_size: int | None = ..., + duplicate_policy: str | None = ..., + ): ... def madd(self, ktv_tuples): ... - def incrby(self, key, value, **kwargs): ... - def decrby(self, key, value, **kwargs): ... + def incrby( + self, + key: _Key, + value: float, + timestamp: int | str | None = ..., + retention_msecs: int | None = ..., + uncompressed: bool | None = ..., + labels: dict[str, str] | None = ..., + chunk_size: int | None = ..., + ): ... + def decrby( + self, + key: _Key, + value: float, + timestamp: int | str | None = ..., + retention_msecs: int | None = ..., + uncompressed: bool | None = ..., + labels: dict[str, str] | None = ..., + chunk_size: int | None = ..., + ): ... def delete(self, key, from_time, to_time): ... - def createrule(self, source_key, dest_key, aggregation_type, bucket_size_msec): ... + def createrule( + self, source_key: _Key, dest_key: _Key, aggregation_type: str, bucket_size_msec: int, align_timestamp: int | None = ... + ): ... def deleterule(self, source_key, dest_key): ... def range( self, - key, - from_time, - to_time, - count: Any | None = ..., - aggregation_type: Any | None = ..., - bucket_size_msec: int = ..., - filter_by_ts: Any | None = ..., - filter_by_min_value: Any | None = ..., - filter_by_max_value: Any | None = ..., - align: Any | None = ..., + key: _Key, + from_time: int | str, + to_time: int | str, + count: int | None = ..., + aggregation_type: str | None = ..., + bucket_size_msec: int | None = ..., + filter_by_ts: list[int] | None = ..., + filter_by_min_value: int | None = ..., + filter_by_max_value: int | None = ..., + align: int | str | None = ..., + latest: bool | None = ..., + bucket_timestamp: str | None = ..., + empty: bool | None = ..., ): ... def revrange( self, - key, - from_time, - to_time, - count: Any | None = ..., - aggregation_type: Any | None = ..., - bucket_size_msec: int = ..., - filter_by_ts: Any | None = ..., - filter_by_min_value: Any | None = ..., - filter_by_max_value: Any | None = ..., - align: Any | None = ..., + key: _Key, + from_time: int | str, + to_time: int | str, + count: int | None = ..., + aggregation_type: str | None = ..., + bucket_size_msec: int | None = ..., + filter_by_ts: list[int] | None = ..., + filter_by_min_value: int | None = ..., + filter_by_max_value: int | None = ..., + align: int | str | None = ..., + latest: bool | None = ..., + bucket_timestamp: str | None = ..., + empty: bool | None = ..., ): ... def mrange( self, - from_time, - to_time, - filters, - count: Any | None = ..., - aggregation_type: Any | None = ..., - bucket_size_msec: int = ..., - with_labels: bool = ..., - filter_by_ts: Any | None = ..., - filter_by_min_value: Any | None = ..., - filter_by_max_value: Any | None = ..., - groupby: Any | None = ..., - reduce: Any | None = ..., - select_labels: Any | None = ..., - align: Any | None = ..., + from_time: int | str, + to_time: int | str, + filters: list[str], + count: int | None = ..., + aggregation_type: str | None = ..., + bucket_size_msec: int | None = ..., + with_labels: bool | None = ..., + filter_by_ts: list[int] | None = ..., + filter_by_min_value: int | None = ..., + filter_by_max_value: int | None = ..., + groupby: str | None = ..., + reduce: str | None = ..., + select_labels: list[str] | None = ..., + align: int | str | None = ..., + latest: bool | None = ..., + bucket_timestamp: str | None = ..., + empty: bool | None = ..., ): ... def mrevrange( self, - from_time, - to_time, - filters, - count: Any | None = ..., - aggregation_type: Any | None = ..., - bucket_size_msec: int = ..., - with_labels: bool = ..., - filter_by_ts: Any | None = ..., - filter_by_min_value: Any | None = ..., - filter_by_max_value: Any | None = ..., - groupby: Any | None = ..., - reduce: Any | None = ..., - select_labels: Any | None = ..., - align: Any | None = ..., + from_time: int | str, + to_time: int | str, + filters: list[str], + count: int | None = ..., + aggregation_type: str | None = ..., + bucket_size_msec: int | None = ..., + with_labels: bool | None = ..., + filter_by_ts: list[int] | None = ..., + filter_by_min_value: int | None = ..., + filter_by_max_value: int | None = ..., + groupby: str | None = ..., + reduce: str | None = ..., + select_labels: list[str] | None = ..., + align: int | str | None = ..., + latest: bool | None = ..., + bucket_timestamp: str | None = ..., + empty: bool | None = ..., + ): ... + def get(self, key: _Key, latest: bool | None = ...): ... + def mget( + self, filters: list[str], with_labels: bool | None = ..., select_labels: list[str] | None = ..., latest: bool | None = ... ): ... - def get(self, key): ... - def mget(self, filters, with_labels: bool = ...): ... def info(self, key): ... def queryindex(self, filters): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/timeseries/info.pyi b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/timeseries/info.pyi index 425dd29d5..8b082c7d6 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/timeseries/info.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/commands/timeseries/info.pyi @@ -1,17 +1,18 @@ +from _typeshed import Incomplete from typing import Any class TSInfo: rules: list[Any] labels: list[Any] - sourceKey: Any | None - chunk_count: Any | None - memory_usage: Any | None - total_samples: Any | None - retention_msecs: Any | None - last_time_stamp: Any | None - first_time_stamp: Any | None + sourceKey: Incomplete | None + chunk_count: Incomplete | None + memory_usage: Incomplete | None + total_samples: Incomplete | None + retention_msecs: Incomplete | None + last_time_stamp: Incomplete | None + first_time_stamp: Incomplete | None - max_samples_per_chunk: Any | None - chunk_size: Any | None - duplicate_policy: Any | None + max_samples_per_chunk: Incomplete | None + chunk_size: Incomplete | None + duplicate_policy: Incomplete | None def __init__(self, args) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/connection.pyi b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/connection.pyi index 88237fb01..a409a9d83 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/connection.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/connection.pyi @@ -1,10 +1,11 @@ -from _typeshed import Incomplete, Self +from _typeshed import Incomplete, Unused from collections.abc import Callable, Iterable, Mapping from queue import Queue from socket import socket from typing import Any, ClassVar -from typing_extensions import TypeAlias +from typing_extensions import Self, TypeAlias +from .credentials import CredentialProvider from .retry import Retry ssl_available: bool @@ -37,13 +38,14 @@ class SocketBuffer: bytes_read: int socket_timeout: float | None def __init__(self, socket: socket, socket_read_size: int, socket_timeout: float | None) -> None: ... - @property - def length(self) -> int: ... + def unread_bytes(self) -> int: ... + def can_read(self, timeout: float | None) -> bool: ... def read(self, length: int) -> bytes: ... def readline(self) -> bytes: ... + def get_pos(self) -> int: ... + def rewind(self, pos: int) -> None: ... def purge(self) -> None: ... def close(self) -> None: ... - def can_read(self, timeout: float | None) -> bool: ... class PythonParser(BaseParser): encoding: str @@ -68,12 +70,14 @@ class HiredisParser(BaseParser): DefaultParser: type[BaseParser] # Hiredis or PythonParser +_Encodable: TypeAlias = str | bytes | memoryview | bool | float + class Encoder: encoding: str encoding_errors: str decode_responses: bool def __init__(self, encoding: str, encoding_errors: str, decode_responses: bool) -> None: ... - def encode(self, value: str | bytes | memoryview | bool | float) -> bytes: ... + def encode(self, value: _Encodable) -> bytes: ... def decode(self, value: str | bytes | memoryview, force: bool = ...) -> str: ... class Connection: @@ -98,27 +102,29 @@ class Connection: health_check_interval: int def __init__( self, - host: str = ..., - port: int = ..., - db: int = ..., - password: str | None = ..., - socket_timeout: float | None = ..., - socket_connect_timeout: float | None = ..., - socket_keepalive: bool = ..., - socket_keepalive_options: Mapping[str, int | str] | None = ..., - socket_type: int = ..., - retry_on_timeout: bool = ..., + host: str = "localhost", + port: int = 6379, + db: int = 0, + password: str | None = None, + socket_timeout: float | None = None, + socket_connect_timeout: float | None = None, + socket_keepalive: bool = False, + socket_keepalive_options: Mapping[str, int | str] | None = None, + socket_type: int = 0, + retry_on_timeout: bool = False, retry_on_error: list[type[Exception]] = ..., - encoding: str = ..., - encoding_errors: str = ..., - decode_responses: bool = ..., + encoding: str = "utf-8", + encoding_errors: str = "strict", + decode_responses: bool = False, parser_class: type[BaseParser] = ..., - socket_read_size: int = ..., - health_check_interval: int = ..., - client_name: str | None = ..., - username: str | None = ..., - retry: Retry | None = ..., - redis_connect_func: _ConnectFunc | None = ..., + socket_read_size: int = 65536, + health_check_interval: int = 0, + client_name: str | None = None, + username: str | None = None, + retry: Retry | None = None, + redis_connect_func: _ConnectFunc | None = None, + credential_provider: CredentialProvider | None = None, + command_packer: Incomplete | None = None, ) -> None: ... def __del__(self) -> None: ... def register_connect_callback(self, callback: _ConnectFunc) -> None: ... @@ -126,7 +132,7 @@ class Connection: def set_parser(self, parser_class: type[BaseParser]) -> None: ... def connect(self) -> None: ... def on_connect(self) -> None: ... - def disconnect(self, *args: object) -> None: ... # 'args' added in redis 4.1.2 + def disconnect(self, *args: Unused) -> None: ... # 'args' added in redis 4.1.2 def check_health(self) -> None: ... def send_packed_command(self, command: str | Iterable[str], check_health: bool = ...) -> None: ... def send_command(self, *args, **kwargs) -> None: ... @@ -141,27 +147,27 @@ class SSLConnection(Connection): certfile: Any cert_reqs: Any ca_certs: Any - ca_path: Any | None + ca_path: Incomplete | None check_hostname: bool - certificate_password: Any | None + certificate_password: Incomplete | None ssl_validate_ocsp: bool ssl_validate_ocsp_stapled: bool # added in 4.1.1 - ssl_ocsp_context: Any | None # added in 4.1.1 - ssl_ocsp_expected_cert: Any | None # added in 4.1.1 + ssl_ocsp_context: Incomplete | None # added in 4.1.1 + ssl_ocsp_expected_cert: Incomplete | None # added in 4.1.1 def __init__( self, ssl_keyfile=..., ssl_certfile=..., ssl_cert_reqs=..., ssl_ca_certs=..., - ssl_ca_data: Any | None = ..., + ssl_ca_data: Incomplete | None = ..., ssl_check_hostname: bool = ..., - ssl_ca_path: Any | None = ..., - ssl_password: Any | None = ..., + ssl_ca_path: Incomplete | None = ..., + ssl_password: Incomplete | None = ..., ssl_validate_ocsp: bool = ..., ssl_validate_ocsp_stapled: bool = ..., # added in 4.1.1 - ssl_ocsp_context: Any | None = ..., # added in 4.1.1 - ssl_ocsp_expected_cert: Any | None = ..., # added in 4.1.1 + ssl_ocsp_context: Incomplete | None = ..., # added in 4.1.1 + ssl_ocsp_expected_cert: Incomplete | None = ..., # added in 4.1.1 **kwargs, ) -> None: ... @@ -169,22 +175,24 @@ class UnixDomainSocketConnection(Connection): path: str def __init__( self, - path: str = ..., - db: int = ..., - username: str | None = ..., - password: str | None = ..., - socket_timeout: float | None = ..., - encoding: str = ..., - encoding_errors: str = ..., - decode_responses: bool = ..., - retry_on_timeout: bool = ..., + path: str = "", + db: int = 0, + username: str | None = None, + password: str | None = None, + socket_timeout: float | None = None, + encoding: str = "utf-8", + encoding_errors: str = "strict", + decode_responses: bool = False, + retry_on_timeout: bool = False, retry_on_error: list[type[Exception]] = ..., parser_class: type[BaseParser] = ..., - socket_read_size: int = ..., - health_check_interval: int = ..., - client_name: str | None = ..., - retry: Retry | None = ..., - redis_connect_func: _ConnectFunc | None = ..., + socket_read_size: int = 65536, + health_check_interval: int = 0, + client_name: str | None = None, + retry: Retry | None = None, + redis_connect_func: _ConnectFunc | None = None, + credential_provider: CredentialProvider | None = None, + command_packer: Incomplete | None = None, ) -> None: ... # TODO: make generic on `connection_class` @@ -194,12 +202,12 @@ class ConnectionPool: max_connections: int pid: int @classmethod - def from_url(cls: type[Self], url: str, *, db: int = ..., decode_components: bool = ..., **kwargs) -> Self: ... + def from_url(cls, url: str, *, db: int = ..., decode_components: bool = ..., **kwargs) -> Self: ... def __init__( self, connection_class: type[Connection] = ..., max_connections: int | None = ..., **connection_kwargs ) -> None: ... def reset(self) -> None: ... - def get_connection(self, command_name: object, *keys, **options: _ConnectionPoolOptions) -> Connection: ... + def get_connection(self, command_name: Unused, *keys, **options: _ConnectionPoolOptions) -> Connection: ... def make_connection(self) -> Connection: ... def release(self, connection: Connection) -> None: ... def disconnect(self, inuse_connections: bool = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/credentials.pyi b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/credentials.pyi new file mode 100644 index 000000000..aecf728a9 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/credentials.pyi @@ -0,0 +1,11 @@ +from abc import abstractmethod + +class CredentialProvider: + @abstractmethod + def get_credentials(self) -> tuple[str] | tuple[str, str]: ... + +class UsernamePasswordCredentialProvider(CredentialProvider): + username: str + password: str + def __init__(self, username: str | None = ..., password: str | None = ...) -> None: ... + def get_credentials(self) -> tuple[str] | tuple[str, str]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/lock.pyi b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/lock.pyi index 7d6bc94fa..63c461d68 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/lock.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/lock.pyi @@ -1,6 +1,7 @@ -from _typeshed import Self +from _typeshed import Incomplete from types import TracebackType from typing import Any, ClassVar, Protocol +from typing_extensions import Self from redis.client import Redis @@ -11,9 +12,16 @@ class Lock: LUA_EXTEND_SCRIPT: ClassVar[str] LUA_REACQUIRE_SCRIPT: ClassVar[str] LUA_RELEASE_SCRIPT: ClassVar[str] - lua_extend: ClassVar[Any | None] - lua_reacquire: ClassVar[Any | None] - lua_release: ClassVar[Any | None] + lua_extend: ClassVar[Incomplete | None] + lua_reacquire: ClassVar[Incomplete | None] + lua_release: ClassVar[Incomplete | None] + redis: Redis[Any] + name: str + timeout: float | None + sleep: float + blocking: bool + blocking_timeout: float | None + thread_local: bool local: _Local def __init__( self, @@ -26,7 +34,7 @@ class Lock: thread_local: bool = ..., ) -> None: ... def register_scripts(self) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None ) -> bool | None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/ocsp.pyi b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/ocsp.pyi index 41d879720..da9473a1c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/ocsp.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/ocsp.pyi @@ -1,13 +1,21 @@ -from typing import Any +from _typeshed import Incomplete +from ssl import SSLObject, SSLSocket +from typing_extensions import Literal + +from cryptography.x509.base import Certificate +from OpenSSL.SSL import Connection + +def ocsp_staple_verifier(con: Connection, ocsp_bytes: bytes, expected: bytes | None = ...) -> Literal[True]: ... class OCSPVerifier: - SOCK: Any - HOST: Any - PORT: Any - CA_CERTS: Any - def __init__(self, sock, host, port, ca_certs: Any | None = ...) -> None: ... - def components_from_socket(self): ... - def components_from_direct_connection(self): ... - def build_certificate_url(self, server, cert, issuer_cert): ... - def check_certificate(self, server, cert, issuer_url): ... - def is_valid(self): ... + SOCK: SSLObject | SSLSocket + HOST: str + PORT: int + CA_CERTS: str | None + def __init__(self, sock: SSLObject | SSLSocket, host: str, port: int, ca_certs: str | None = ...) -> None: ... + # cryptography.x509.general_name.GeneralName.value is typed as Any + def components_from_socket(self) -> tuple[Certificate, Incomplete | None, Incomplete]: ... + def components_from_direct_connection(self) -> tuple[Certificate, Incomplete | None, Incomplete]: ... + def build_certificate_url(self, server: str, cert: Certificate, issuer_cert: Certificate) -> str: ... + def check_certificate(self, server: str, cert: Certificate, issuer_url: str | bytes) -> Literal[True]: ... + def is_valid(self) -> Literal[True]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/sentinel.pyi b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/sentinel.pyi index 915f79314..ea13ae681 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/sentinel.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/sentinel.pyi @@ -27,7 +27,6 @@ class SentinelManagedSSLConnection(SentinelManagedConnection, SSLConnection): .. class SentinelConnectionPool(ConnectionPool): is_master: bool check_connection: bool - connection_kwargs: Any service_name: str sentinel_manager: Sentinel def __init__(self, service_name: str, sentinel_manager: Sentinel, **kwargs) -> None: ... @@ -37,15 +36,15 @@ class SentinelConnectionPool(ConnectionPool): def rotate_slaves(self) -> Iterator[_AddressAndPort]: ... class Sentinel(SentinelCommands): - sentinel_kwargs: Any + sentinel_kwargs: dict[str, Any] sentinels: list[Redis[Any]] min_other_sentinels: int - connection_kwargs: Any + connection_kwargs: dict[str, Any] def __init__( self, sentinels: Iterable[_AddressAndPort], min_other_sentinels: int = ..., - sentinel_kwargs: Any | None = ..., + sentinel_kwargs: dict[str, Any] | None = ..., **connection_kwargs, ) -> None: ... def check_master_state(self, state: _SentinelState, service_name: str) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/utils.pyi b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/utils.pyi index 09f261095..7a562c4b1 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/utils.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/utils.pyi @@ -1,3 +1,4 @@ +from _typeshed import Unused from collections.abc import Iterable, Mapping from contextlib import AbstractContextManager from typing import Any, TypeVar, overload @@ -19,4 +20,4 @@ def str_if_bytes(value: str | bytes) -> str: ... def safe_str(value: object) -> str: ... def dict_merge(*dicts: Mapping[str, _T]) -> dict[str, _T]: ... def list_keys_to_dict(key_list, callback): ... # unused, alias for `dict.fromkeys` -def merge_result(command: object, res: Mapping[Any, Iterable[_T]]) -> list[_T]: ... +def merge_result(command: Unused, res: Mapping[Any, Iterable[_T]]) -> list[_T]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/regex/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/regex/METADATA.toml index f34316447..f508c79b6 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/regex/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/regex/METADATA.toml @@ -1 +1 @@ -version = "2022.7.25" +version = "2022.10.31" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/regex/regex/_regex.pyi b/packages/pyright-internal/typeshed-fallback/stubs/regex/regex/_regex.pyi index 9cf70db3e..a8744d0d9 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/regex/regex/_regex.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/regex/regex/_regex.pyi @@ -1,335 +1,18 @@ -from _typeshed import ReadableBuffer, Self -from collections.abc import Callable, Mapping -from typing import Any, AnyStr, Generic, TypeVar, overload -from typing_extensions import Literal, final +# This is actually a C-extension module. +# Not all types defined in C are exported to Python. +# For example: `Pattern` and `Match` are not exported +# and are redefined in `regex.regex module. -_T = TypeVar("_T") +from typing import Any, AnyStr, Generic +from typing_extensions import Self, final -@final -class Pattern(Generic[AnyStr]): - @property - def flags(self) -> int: ... - @property - def groupindex(self) -> Mapping[str, int]: ... - @property - def groups(self) -> int: ... - @property - def pattern(self) -> AnyStr: ... - @property - def named_lists(self) -> Mapping[str, frozenset[AnyStr]]: ... - @overload - def search( - self: Pattern[str], - string: str, - pos: int = ..., - endpos: int = ..., - concurrent: bool | None = ..., - timeout: float | None = ..., - ) -> Match[str] | None: ... - @overload - def search( - self: Pattern[bytes], - string: ReadableBuffer, - pos: int = ..., - endpos: int = ..., - concurrent: bool | None = ..., - timeout: float | None = ..., - ) -> Match[bytes] | None: ... - @overload - def match( - self: Pattern[str], - string: str, - pos: int = ..., - endpos: int = ..., - concurrent: bool | None = ..., - timeout: float | None = ..., - ) -> Match[str] | None: ... - @overload - def match( - self: Pattern[bytes], - string: ReadableBuffer, - pos: int = ..., - endpos: int = ..., - concurrent: bool | None = ..., - timeout: float | None = ..., - ) -> Match[bytes] | None: ... - @overload - def fullmatch( - self: Pattern[str], - string: str, - pos: int = ..., - endpos: int = ..., - concurrent: bool | None = ..., - timeout: float | None = ..., - ) -> Match[str] | None: ... - @overload - def fullmatch( - self: Pattern[bytes], - string: ReadableBuffer, - pos: int = ..., - endpos: int = ..., - concurrent: bool | None = ..., - timeout: float | None = ..., - ) -> Match[bytes] | None: ... - @overload - def split( - self: Pattern[str], string: str, maxsplit: int = ..., concurrent: bool | None = ..., timeout: float | None = ... - ) -> list[str | Any]: ... - @overload - def split( - self: Pattern[bytes], - string: ReadableBuffer, - maxsplit: int = ..., - concurrent: bool | None = ..., - timeout: float | None = ..., - ) -> list[bytes | Any]: ... - @overload - def splititer( - self: Pattern[str], string: str, maxsplit: int = ..., concurrent: bool | None = ..., timeout: float | None = ... - ) -> Splitter[str]: ... - @overload - def splititer( - self: Pattern[bytes], - string: ReadableBuffer, - maxsplit: int = ..., - concurrent: bool | None = ..., - timeout: float | None = ..., - ) -> Splitter[bytes]: ... - @overload - def findall( - self: Pattern[str], - string: str, - pos: int = ..., - endpos: int = ..., - overlapped: bool = ..., - concurrent: bool | None = ..., - timeout: float | None = ..., - ) -> list[Any]: ... - @overload - def findall( - self: Pattern[bytes], - string: ReadableBuffer, - pos: int = ..., - endpos: int = ..., - overlapped: bool = ..., - concurrent: bool | None = ..., - timeout: float | None = ..., - ) -> list[Any]: ... - @overload - def finditer( - self: Pattern[str], - string: str, - pos: int = ..., - endpos: int = ..., - overlapped: bool = ..., - concurrent: bool | None = ..., - timeout: float | None = ..., - ) -> Scanner[str]: ... - @overload - def finditer( - self: Pattern[bytes], - string: ReadableBuffer, - pos: int = ..., - endpos: int = ..., - overlapped: bool = ..., - concurrent: bool | None = ..., - timeout: float | None = ..., - ) -> Scanner[bytes]: ... - @overload - def sub( - self: Pattern[str], - repl: str | Callable[[Match[str]], str], - string: str, - count: int = ..., - flags: int = ..., - pos: int | None = ..., - endpos: int | None = ..., - concurrent: bool | None = ..., - timeout: float | None = ..., - ) -> str: ... - @overload - def sub( - self: Pattern[bytes], - repl: ReadableBuffer | Callable[[Match[bytes]], ReadableBuffer], - string: ReadableBuffer, - count: int = ..., - flags: int = ..., - pos: int | None = ..., - endpos: int | None = ..., - concurrent: bool | None = ..., - timeout: float | None = ..., - ) -> bytes: ... - @overload - def subf( - self: Pattern[str], - format: str | Callable[[Match[str]], str], - string: str, - count: int = ..., - flags: int = ..., - pos: int | None = ..., - endpos: int | None = ..., - concurrent: bool | None = ..., - timeout: float | None = ..., - ) -> str: ... - @overload - def subf( - self: Pattern[bytes], - format: ReadableBuffer | Callable[[Match[bytes]], ReadableBuffer], - string: ReadableBuffer, - count: int = ..., - flags: int = ..., - pos: int | None = ..., - endpos: int | None = ..., - concurrent: bool | None = ..., - timeout: float | None = ..., - ) -> bytes: ... - @overload - def subn( - self: Pattern[str], - repl: str | Callable[[Match[str]], str], - string: str, - count: int = ..., - flags: int = ..., - pos: int | None = ..., - endpos: int | None = ..., - concurrent: bool | None = ..., - timeout: float | None = ..., - ) -> tuple[str, int]: ... - @overload - def subn( - self: Pattern[bytes], - repl: ReadableBuffer | Callable[[Match[bytes]], ReadableBuffer], - string: ReadableBuffer, - count: int = ..., - flags: int = ..., - pos: int | None = ..., - endpos: int | None = ..., - concurrent: bool | None = ..., - timeout: float | None = ..., - ) -> tuple[bytes, int]: ... - @overload - def subfn( - self: Pattern[str], - format: str | Callable[[Match[str]], str], - string: str, - count: int = ..., - flags: int = ..., - pos: int | None = ..., - endpos: int | None = ..., - concurrent: bool | None = ..., - timeout: float | None = ..., - ) -> tuple[str, int]: ... - @overload - def subfn( - self: Pattern[bytes], - format: ReadableBuffer | Callable[[Match[bytes]], ReadableBuffer], - string: ReadableBuffer, - count: int = ..., - flags: int = ..., - pos: int | None = ..., - endpos: int | None = ..., - concurrent: bool | None = ..., - timeout: float | None = ..., - ) -> tuple[bytes, int]: ... - @overload - def scanner( - self: Pattern[str], - string: str, - pos: int | None = ..., - endpos: int | None = ..., - overlapped: bool = ..., - concurrent: bool | None = ..., - timeout: float | None = ..., - ) -> Scanner[str]: ... - @overload - def scanner( - self: Pattern[bytes], - string: bytes, - pos: int | None = ..., - endpos: int | None = ..., - overlapped: bool = ..., - concurrent: bool | None = ..., - timeout: float | None = ..., - ) -> Scanner[bytes]: ... - -@final -class Match(Generic[AnyStr]): - @property - def pos(self) -> int: ... - @property - def endpos(self) -> int: ... - @property - def lastindex(self) -> int | None: ... - @property - def lastgroup(self) -> str | None: ... - @property - def string(self) -> AnyStr: ... - @property - def re(self) -> Pattern[AnyStr]: ... - @property - def partial(self) -> bool: ... - @property - def regs(self) -> tuple[tuple[int, int], ...]: ... - @property - def fuzzy_counts(self) -> tuple[int, int, int]: ... - @property - def fuzzy_changes(self) -> tuple[list[int], list[int], list[int]]: ... - @overload - def group(self, __group: Literal[0] = ...) -> AnyStr: ... - @overload - def group(self, __group: int | str = ...) -> AnyStr | Any: ... - @overload - def group(self, __group1: int | str, __group2: int | str, *groups: int | str) -> tuple[AnyStr | Any, ...]: ... - @overload - def groups(self, default: None = ...) -> tuple[AnyStr | Any, ...]: ... - @overload - def groups(self, default: _T) -> tuple[AnyStr | _T, ...]: ... - @overload - def groupdict(self, default: None = ...) -> dict[str, AnyStr | Any]: ... - @overload - def groupdict(self, default: _T) -> dict[str, AnyStr | _T]: ... - @overload - def span(self, __group: int | str = ...) -> tuple[int, int]: ... - @overload - def span(self, __group1: int | str, __group2: int | str, *groups: int | str) -> tuple[tuple[int, int], ...]: ... - @overload - def spans(self, __group: int | str = ...) -> list[tuple[int, int]]: ... - @overload - def spans(self, __group1: int | str, __group2: int | str, *groups: int | str) -> tuple[list[tuple[int, int]], ...]: ... - @overload - def start(self, __group: int | str = ...) -> int: ... - @overload - def start(self, __group1: int | str, __group2: int | str, *groups: int | str) -> tuple[int, ...]: ... - @overload - def starts(self, __group: int | str = ...) -> list[int]: ... - @overload - def starts(self, __group1: int | str, __group2: int | str, *groups: int | str) -> tuple[list[int], ...]: ... - @overload - def end(self, __group: int | str = ...) -> int: ... - @overload - def end(self, __group1: int | str, __group2: int | str, *groups: int | str) -> tuple[int, ...]: ... - @overload - def ends(self, __group: int | str = ...) -> list[int]: ... - @overload - def ends(self, __group1: int | str, __group2: int | str, *groups: int | str) -> tuple[list[int], ...]: ... - def expand(self, template: AnyStr) -> AnyStr: ... - def expandf(self, format: AnyStr) -> AnyStr: ... - @overload - def captures(self, __group: int | str = ...) -> list[AnyStr]: ... - @overload - def captures(self, __group1: int | str, __group2: int | str, *groups: int | str) -> tuple[list[AnyStr], ...]: ... - def capturesdict(self) -> dict[str, list[AnyStr]]: ... - def detach_string(self) -> None: ... - @overload - def __getitem__(self, __key: Literal[0]) -> AnyStr: ... - @overload - def __getitem__(self, __key: int | str) -> AnyStr | Any: ... +from .regex import Match, Pattern @final class Splitter(Generic[AnyStr]): @property def pattern(self) -> Pattern[AnyStr]: ... - def __iter__(self: Self) -> Self: ... + def __iter__(self) -> Self: ... def __next__(self) -> AnyStr | Any: ... def split(self) -> AnyStr | Any: ... @@ -337,7 +20,7 @@ class Splitter(Generic[AnyStr]): class Scanner(Generic[AnyStr]): @property def pattern(self) -> Pattern[AnyStr]: ... - def __iter__(self: Self) -> Self: ... + def __iter__(self) -> Self: ... def __next__(self) -> Match[AnyStr]: ... def match(self) -> Match[AnyStr] | None: ... def search(self) -> Match[AnyStr] | None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/regex/regex/_regex_core.pyi b/packages/pyright-internal/typeshed-fallback/stubs/regex/regex/_regex_core.pyi index c3f5685c1..cca9a476c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/regex/regex/_regex_core.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/regex/regex/_regex_core.pyi @@ -1,8 +1,49 @@ -from typing import AnyStr +import enum +from collections.abc import Callable +from typing import Any, AnyStr, Generic +from typing_extensions import TypeAlias + +from .regex import Pattern class error(Exception): def __init__(self, message: str, pattern: AnyStr | None = ..., pos: int | None = ...) -> None: ... +class RegexFlag(enum.IntFlag): + A: int + ASCII: int + B: int + BESTMATCH: int + D: int + DEBUG: int + E: int + ENHANCEMATCH: int + F: int + FULLCASE: int + I: int + IGNORECASE: int + L: int + LOCALE: int + M: int + MULTILINE: int + P: int + POSIX: int + R: int + REVERSE: int + T: int + TEMPLATE: int + S: int + DOTALL: int + U: int + UNICODE: int + V0: int + VERSION0: int + V1: int + VERSION1: int + W: int + WORD: int + X: int + VERBOSE: int + A: int ASCII: int B: int @@ -39,3 +80,12 @@ X: int VERBOSE: int DEFAULT_VERSION: int + +_Lexicon: TypeAlias = list[tuple[AnyStr, Callable[[Scanner[AnyStr], AnyStr], Any]]] + +class Scanner(Generic[AnyStr]): + lexicon: _Lexicon[AnyStr] + scanner: Pattern[AnyStr] + + def __init__(self, lexicon: _Lexicon[AnyStr], flags: int = ...) -> None: ... + def scan(self, string: AnyStr) -> tuple[list[Any], AnyStr]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/regex/regex/regex.pyi b/packages/pyright-internal/typeshed-fallback/stubs/regex/regex/regex.pyi index 694da59e2..6a6d25f47 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/regex/regex/regex.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/regex/regex/regex.pyi @@ -1,20 +1,26 @@ +import sys from _typeshed import ReadableBuffer -from collections.abc import Callable -from typing import Any, AnyStr, overload +from collections.abc import Callable, Mapping +from typing import Any, AnyStr, Generic, TypeVar, overload +from typing_extensions import Literal, Self, final from . import _regex -from ._regex import Match as Match, Pattern as Pattern from ._regex_core import * +if sys.version_info >= (3, 9): + from types import GenericAlias + +_T = TypeVar("_T") + __version__: str def compile( - pattern: AnyStr | _regex.Pattern[AnyStr], + pattern: AnyStr | Pattern[AnyStr], flags: int = ..., ignore_unused: bool = ..., cache_pattern: bool | None = ..., **kwargs: Any, -) -> _regex.Pattern[AnyStr]: ... +) -> Pattern[AnyStr]: ... @overload def search( pattern: str | Pattern[str], @@ -27,7 +33,7 @@ def search( timeout: float | None = ..., ignore_unused: bool = ..., **kwargs: Any, -) -> _regex.Match[str] | None: ... +) -> Match[str] | None: ... @overload def search( pattern: bytes | Pattern[bytes], @@ -40,7 +46,7 @@ def search( timeout: float | None = ..., ignore_unused: bool = ..., **kwargs: Any, -) -> _regex.Match[bytes] | None: ... +) -> Match[bytes] | None: ... @overload def match( pattern: str | Pattern[str], @@ -53,7 +59,7 @@ def match( timeout: float | None = ..., ignore_unused: bool = ..., **kwargs: Any, -) -> _regex.Match[str] | None: ... +) -> Match[str] | None: ... @overload def match( pattern: bytes | Pattern[bytes], @@ -66,7 +72,7 @@ def match( timeout: float | None = ..., ignore_unused: bool = ..., **kwargs: Any, -) -> _regex.Match[bytes] | None: ... +) -> Match[bytes] | None: ... @overload def fullmatch( pattern: str | Pattern[str], @@ -79,7 +85,7 @@ def fullmatch( timeout: float | None = ..., ignore_unused: bool = ..., **kwargs: Any, -) -> _regex.Match[str] | None: ... +) -> Match[str] | None: ... @overload def fullmatch( pattern: bytes | Pattern[bytes], @@ -92,10 +98,10 @@ def fullmatch( timeout: float | None = ..., ignore_unused: bool = ..., **kwargs: Any, -) -> _regex.Match[bytes] | None: ... +) -> Match[bytes] | None: ... @overload def split( - pattern: str | _regex.Pattern[str], + pattern: str | Pattern[str], string: str, maxsplit: int = ..., flags: int = ..., @@ -106,7 +112,7 @@ def split( ) -> list[str | Any]: ... @overload def split( - pattern: ReadableBuffer | _regex.Pattern[bytes], + pattern: ReadableBuffer | Pattern[bytes], string: ReadableBuffer, maxsplit: int = ..., flags: int = ..., @@ -117,7 +123,7 @@ def split( ) -> list[bytes | Any]: ... @overload def splititer( - pattern: str | _regex.Pattern[str], + pattern: str | Pattern[str], string: str, maxsplit: int = ..., flags: int = ..., @@ -128,7 +134,7 @@ def splititer( ) -> _regex.Splitter[str]: ... @overload def splititer( - pattern: ReadableBuffer | _regex.Pattern[bytes], + pattern: ReadableBuffer | Pattern[bytes], string: ReadableBuffer, maxsplit: int = ..., flags: int = ..., @@ -139,7 +145,7 @@ def splititer( ) -> _regex.Splitter[bytes]: ... @overload def findall( - pattern: str | _regex.Pattern[str], + pattern: str | Pattern[str], string: str, flags: int = ..., pos: int | None = ..., @@ -152,7 +158,7 @@ def findall( ) -> list[Any]: ... @overload def findall( - pattern: ReadableBuffer | _regex.Pattern[bytes], + pattern: ReadableBuffer | Pattern[bytes], string: ReadableBuffer, flags: int = ..., pos: int | None = ..., @@ -165,7 +171,7 @@ def findall( ) -> list[Any]: ... @overload def finditer( - pattern: str | _regex.Pattern[str], + pattern: str | Pattern[str], string: str, flags: int = ..., pos: int | None = ..., @@ -179,7 +185,7 @@ def finditer( ) -> _regex.Scanner[str]: ... @overload def finditer( - pattern: ReadableBuffer | _regex.Pattern[bytes], + pattern: ReadableBuffer | Pattern[bytes], string: ReadableBuffer, flags: int = ..., pos: int | None = ..., @@ -193,8 +199,8 @@ def finditer( ) -> _regex.Scanner[bytes]: ... @overload def sub( - pattern: str | _regex.Pattern[str], - repl: str | Callable[[_regex.Match[str]], str], + pattern: str | Pattern[str], + repl: str | Callable[[Match[str]], str], string: str, count: int = ..., flags: int = ..., @@ -207,8 +213,8 @@ def sub( ) -> str: ... @overload def sub( - pattern: ReadableBuffer | _regex.Pattern[bytes], - repl: ReadableBuffer | Callable[[_regex.Match[bytes]], ReadableBuffer], + pattern: ReadableBuffer | Pattern[bytes], + repl: ReadableBuffer | Callable[[Match[bytes]], ReadableBuffer], string: ReadableBuffer, count: int = ..., flags: int = ..., @@ -221,8 +227,8 @@ def sub( ) -> bytes: ... @overload def subf( - pattern: str | _regex.Pattern[str], - format: str | Callable[[_regex.Match[str]], str], + pattern: str | Pattern[str], + format: str | Callable[[Match[str]], str], string: str, count: int = ..., flags: int = ..., @@ -235,8 +241,8 @@ def subf( ) -> str: ... @overload def subf( - pattern: ReadableBuffer | _regex.Pattern[bytes], - format: ReadableBuffer | Callable[[_regex.Match[bytes]], ReadableBuffer], + pattern: ReadableBuffer | Pattern[bytes], + format: ReadableBuffer | Callable[[Match[bytes]], ReadableBuffer], string: ReadableBuffer, count: int = ..., flags: int = ..., @@ -249,8 +255,8 @@ def subf( ) -> bytes: ... @overload def subn( - pattern: str | _regex.Pattern[str], - repl: str | Callable[[_regex.Match[str]], str], + pattern: str | Pattern[str], + repl: str | Callable[[Match[str]], str], string: str, count: int = ..., flags: int = ..., @@ -263,8 +269,8 @@ def subn( ) -> tuple[str, int]: ... @overload def subn( - pattern: ReadableBuffer | _regex.Pattern[bytes], - repl: ReadableBuffer | Callable[[_regex.Match[bytes]], ReadableBuffer], + pattern: ReadableBuffer | Pattern[bytes], + repl: ReadableBuffer | Callable[[Match[bytes]], ReadableBuffer], string: ReadableBuffer, count: int = ..., flags: int = ..., @@ -277,8 +283,8 @@ def subn( ) -> tuple[bytes, int]: ... @overload def subfn( - pattern: str | _regex.Pattern[str], - format: str | Callable[[_regex.Match[str]], str], + pattern: str | Pattern[str], + format: str | Callable[[Match[str]], str], string: str, count: int = ..., flags: int = ..., @@ -291,8 +297,8 @@ def subfn( ) -> tuple[str, int]: ... @overload def subfn( - pattern: ReadableBuffer | _regex.Pattern[bytes], - format: ReadableBuffer | Callable[[_regex.Match[bytes]], ReadableBuffer], + pattern: ReadableBuffer | Pattern[bytes], + format: ReadableBuffer | Callable[[Match[bytes]], ReadableBuffer], string: ReadableBuffer, count: int = ..., flags: int = ..., @@ -309,6 +315,336 @@ def cache_all(value: bool = ...) -> None: ... @overload def cache_all(value: None) -> bool: ... def escape(pattern: AnyStr, special_only: bool = ..., literal_spaces: bool = ...) -> AnyStr: ... -def template(pattern: AnyStr | _regex.Pattern[AnyStr], flags: int = ...) -> _regex.Pattern[AnyStr]: ... +def template(pattern: AnyStr | Pattern[AnyStr], flags: int = ...) -> Pattern[AnyStr]: ... Regex = compile + +@final +class Pattern(Generic[AnyStr]): + @property + def flags(self) -> int: ... + @property + def groupindex(self) -> Mapping[str, int]: ... + @property + def groups(self) -> int: ... + @property + def pattern(self) -> AnyStr: ... + @property + def named_lists(self) -> Mapping[str, frozenset[AnyStr]]: ... + @overload + def search( + self: Pattern[str], + string: str, + pos: int = ..., + endpos: int = ..., + concurrent: bool | None = ..., + timeout: float | None = ..., + ) -> Match[str] | None: ... + @overload + def search( + self: Pattern[bytes], + string: ReadableBuffer, + pos: int = ..., + endpos: int = ..., + concurrent: bool | None = ..., + timeout: float | None = ..., + ) -> Match[bytes] | None: ... + @overload + def match( + self: Pattern[str], + string: str, + pos: int = ..., + endpos: int = ..., + concurrent: bool | None = ..., + timeout: float | None = ..., + ) -> Match[str] | None: ... + @overload + def match( + self: Pattern[bytes], + string: ReadableBuffer, + pos: int = ..., + endpos: int = ..., + concurrent: bool | None = ..., + timeout: float | None = ..., + ) -> Match[bytes] | None: ... + @overload + def fullmatch( + self: Pattern[str], + string: str, + pos: int = ..., + endpos: int = ..., + concurrent: bool | None = ..., + timeout: float | None = ..., + ) -> Match[str] | None: ... + @overload + def fullmatch( + self: Pattern[bytes], + string: ReadableBuffer, + pos: int = ..., + endpos: int = ..., + concurrent: bool | None = ..., + timeout: float | None = ..., + ) -> Match[bytes] | None: ... + @overload + def split( + self: Pattern[str], string: str, maxsplit: int = ..., concurrent: bool | None = ..., timeout: float | None = ... + ) -> list[str | Any]: ... + @overload + def split( + self: Pattern[bytes], + string: ReadableBuffer, + maxsplit: int = ..., + concurrent: bool | None = ..., + timeout: float | None = ..., + ) -> list[bytes | Any]: ... + @overload + def splititer( + self: Pattern[str], string: str, maxsplit: int = ..., concurrent: bool | None = ..., timeout: float | None = ... + ) -> _regex.Splitter[str]: ... + @overload + def splititer( + self: Pattern[bytes], + string: ReadableBuffer, + maxsplit: int = ..., + concurrent: bool | None = ..., + timeout: float | None = ..., + ) -> _regex.Splitter[bytes]: ... + @overload + def findall( + self: Pattern[str], + string: str, + pos: int = ..., + endpos: int = ..., + overlapped: bool = ..., + concurrent: bool | None = ..., + timeout: float | None = ..., + ) -> list[Any]: ... + @overload + def findall( + self: Pattern[bytes], + string: ReadableBuffer, + pos: int = ..., + endpos: int = ..., + overlapped: bool = ..., + concurrent: bool | None = ..., + timeout: float | None = ..., + ) -> list[Any]: ... + @overload + def finditer( + self: Pattern[str], + string: str, + pos: int = ..., + endpos: int = ..., + overlapped: bool = ..., + concurrent: bool | None = ..., + timeout: float | None = ..., + ) -> _regex.Scanner[str]: ... + @overload + def finditer( + self: Pattern[bytes], + string: ReadableBuffer, + pos: int = ..., + endpos: int = ..., + overlapped: bool = ..., + concurrent: bool | None = ..., + timeout: float | None = ..., + ) -> _regex.Scanner[bytes]: ... + @overload + def sub( + self: Pattern[str], + repl: str | Callable[[Match[str]], str], + string: str, + count: int = ..., + flags: int = ..., + pos: int | None = ..., + endpos: int | None = ..., + concurrent: bool | None = ..., + timeout: float | None = ..., + ) -> str: ... + @overload + def sub( + self: Pattern[bytes], + repl: ReadableBuffer | Callable[[Match[bytes]], ReadableBuffer], + string: ReadableBuffer, + count: int = ..., + flags: int = ..., + pos: int | None = ..., + endpos: int | None = ..., + concurrent: bool | None = ..., + timeout: float | None = ..., + ) -> bytes: ... + @overload + def subf( + self: Pattern[str], + format: str | Callable[[Match[str]], str], + string: str, + count: int = ..., + flags: int = ..., + pos: int | None = ..., + endpos: int | None = ..., + concurrent: bool | None = ..., + timeout: float | None = ..., + ) -> str: ... + @overload + def subf( + self: Pattern[bytes], + format: ReadableBuffer | Callable[[Match[bytes]], ReadableBuffer], + string: ReadableBuffer, + count: int = ..., + flags: int = ..., + pos: int | None = ..., + endpos: int | None = ..., + concurrent: bool | None = ..., + timeout: float | None = ..., + ) -> bytes: ... + @overload + def subn( + self: Pattern[str], + repl: str | Callable[[Match[str]], str], + string: str, + count: int = ..., + flags: int = ..., + pos: int | None = ..., + endpos: int | None = ..., + concurrent: bool | None = ..., + timeout: float | None = ..., + ) -> tuple[str, int]: ... + @overload + def subn( + self: Pattern[bytes], + repl: ReadableBuffer | Callable[[Match[bytes]], ReadableBuffer], + string: ReadableBuffer, + count: int = ..., + flags: int = ..., + pos: int | None = ..., + endpos: int | None = ..., + concurrent: bool | None = ..., + timeout: float | None = ..., + ) -> tuple[bytes, int]: ... + @overload + def subfn( + self: Pattern[str], + format: str | Callable[[Match[str]], str], + string: str, + count: int = ..., + flags: int = ..., + pos: int | None = ..., + endpos: int | None = ..., + concurrent: bool | None = ..., + timeout: float | None = ..., + ) -> tuple[str, int]: ... + @overload + def subfn( + self: Pattern[bytes], + format: ReadableBuffer | Callable[[Match[bytes]], ReadableBuffer], + string: ReadableBuffer, + count: int = ..., + flags: int = ..., + pos: int | None = ..., + endpos: int | None = ..., + concurrent: bool | None = ..., + timeout: float | None = ..., + ) -> tuple[bytes, int]: ... + @overload + def scanner( + self: Pattern[str], + string: str, + pos: int | None = ..., + endpos: int | None = ..., + overlapped: bool = ..., + concurrent: bool | None = ..., + timeout: float | None = ..., + ) -> _regex.Scanner[str]: ... + @overload + def scanner( + self: Pattern[bytes], + string: bytes, + pos: int | None = ..., + endpos: int | None = ..., + overlapped: bool = ..., + concurrent: bool | None = ..., + timeout: float | None = ..., + ) -> _regex.Scanner[bytes]: ... + def __copy__(self) -> Self: ... + def __deepcopy__(self) -> Self: ... + if sys.version_info >= (3, 9): + def __class_getitem__(cls, item: Any) -> GenericAlias: ... + +@final +class Match(Generic[AnyStr]): + @property + def pos(self) -> int: ... + @property + def endpos(self) -> int: ... + @property + def lastindex(self) -> int | None: ... + @property + def lastgroup(self) -> str | None: ... + @property + def string(self) -> AnyStr: ... + @property + def re(self) -> Pattern[AnyStr]: ... + @property + def partial(self) -> bool: ... + @property + def regs(self) -> tuple[tuple[int, int], ...]: ... + @property + def fuzzy_counts(self) -> tuple[int, int, int]: ... + @property + def fuzzy_changes(self) -> tuple[list[int], list[int], list[int]]: ... + @overload + def group(self, __group: Literal[0] = ...) -> AnyStr: ... + @overload + def group(self, __group: int | str = ...) -> AnyStr | Any: ... + @overload + def group(self, __group1: int | str, __group2: int | str, *groups: int | str) -> tuple[AnyStr | Any, ...]: ... + @overload + def groups(self, default: None = ...) -> tuple[AnyStr | Any, ...]: ... + @overload + def groups(self, default: _T) -> tuple[AnyStr | _T, ...]: ... + @overload + def groupdict(self, default: None = ...) -> dict[str, AnyStr | Any]: ... + @overload + def groupdict(self, default: _T) -> dict[str, AnyStr | _T]: ... + @overload + def span(self, __group: int | str = ...) -> tuple[int, int]: ... + @overload + def span(self, __group1: int | str, __group2: int | str, *groups: int | str) -> tuple[tuple[int, int], ...]: ... + @overload + def spans(self, __group: int | str = ...) -> list[tuple[int, int]]: ... + @overload + def spans(self, __group1: int | str, __group2: int | str, *groups: int | str) -> tuple[list[tuple[int, int]], ...]: ... + @overload + def start(self, __group: int | str = ...) -> int: ... + @overload + def start(self, __group1: int | str, __group2: int | str, *groups: int | str) -> tuple[int, ...]: ... + @overload + def starts(self, __group: int | str = ...) -> list[int]: ... + @overload + def starts(self, __group1: int | str, __group2: int | str, *groups: int | str) -> tuple[list[int], ...]: ... + @overload + def end(self, __group: int | str = ...) -> int: ... + @overload + def end(self, __group1: int | str, __group2: int | str, *groups: int | str) -> tuple[int, ...]: ... + @overload + def ends(self, __group: int | str = ...) -> list[int]: ... + @overload + def ends(self, __group1: int | str, __group2: int | str, *groups: int | str) -> tuple[list[int], ...]: ... + def expand(self, template: AnyStr) -> AnyStr: ... + def expandf(self, format: AnyStr) -> AnyStr: ... + @overload + def captures(self, __group: int | str = ...) -> list[AnyStr]: ... + @overload + def captures(self, __group1: int | str, __group2: int | str, *groups: int | str) -> tuple[list[AnyStr], ...]: ... + def capturesdict(self) -> dict[str, list[AnyStr]]: ... + def detach_string(self) -> None: ... + def allcaptures(self) -> tuple[list[AnyStr]]: ... + def allspans(self) -> tuple[list[tuple[int, int]]]: ... + @overload + def __getitem__(self, __key: Literal[0]) -> AnyStr: ... + @overload + def __getitem__(self, __key: int | str) -> AnyStr | Any: ... + def __copy__(self) -> Self: ... + def __deepcopy__(self) -> Self: ... + if sys.version_info >= (3, 9): + def __class_getitem__(cls, item: Any) -> GenericAlias: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/requests/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/requests/METADATA.toml index 8d026239e..0bd4bd92e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/requests/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/requests/METADATA.toml @@ -1,2 +1,5 @@ version = "2.28.*" requires = ["types-urllib3<1.27"] # keep in sync with requests's setup.py + +[tool.stubtest] +extras = ["socks"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/api.pyi b/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/api.pyi index c4b3d5c5f..c07a4900c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/api.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/api.pyi @@ -1,5 +1,5 @@ +from _typeshed import Incomplete from collections.abc import Mapping -from typing import Any from typing_extensions import TypeAlias from .models import Response @@ -24,7 +24,7 @@ def request( stream: bool | None = ..., verify: _Verify | None = ..., cert: _Cert | None = ..., - json: Any | None = ..., + json: Incomplete | None = ..., ) -> Response: ... def get( url: str | bytes, @@ -42,7 +42,7 @@ def get( stream: bool | None = ..., verify: _Verify | None = ..., cert: _Cert | None = ..., - json: Any | None = ..., + json: Incomplete | None = ..., ) -> Response: ... def options( url: str | bytes, @@ -60,7 +60,7 @@ def options( stream: bool | None = ..., verify: _Verify | None = ..., cert: _Cert | None = ..., - json: Any | None = ..., + json: Incomplete | None = ..., ) -> Response: ... def head( url: str | bytes, @@ -78,12 +78,12 @@ def head( stream: bool | None = ..., verify: _Verify | None = ..., cert: _Cert | None = ..., - json: Any | None = ..., + json: Incomplete | None = ..., ) -> Response: ... def post( url: str | bytes, data: _Data | None = ..., - json: Any | None = ..., + json: Incomplete | None = ..., *, params: _Params | None = ..., headers: _HeadersMapping | None = ..., @@ -114,7 +114,7 @@ def put( stream: bool | None = ..., verify: _Verify | None = ..., cert: _Cert | None = ..., - json: Any | None = ..., + json: Incomplete | None = ..., ) -> Response: ... def patch( url: str | bytes, @@ -132,7 +132,7 @@ def patch( stream: bool | None = ..., verify: _Verify | None = ..., cert: _Cert | None = ..., - json: Any | None = ..., + json: Incomplete | None = ..., ) -> Response: ... def delete( url: str | bytes, @@ -150,5 +150,5 @@ def delete( stream: bool | None = ..., verify: _Verify | None = ..., cert: _Cert | None = ..., - json: Any | None = ..., + json: Incomplete | None = ..., ) -> Response: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/auth.pyi b/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/auth.pyi index 4f59bdc72..21ef4abf5 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/auth.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/auth.pyi @@ -15,23 +15,23 @@ class AuthBase: def __call__(self, r: models.PreparedRequest) -> models.PreparedRequest: ... class HTTPBasicAuth(AuthBase): - username: Any - password: Any - def __init__(self, username, password) -> None: ... + username: bytes | str + password: bytes | str + def __init__(self, username: bytes | str, password: bytes | str) -> None: ... def __call__(self, r): ... class HTTPProxyAuth(HTTPBasicAuth): def __call__(self, r): ... class HTTPDigestAuth(AuthBase): - username: Any - password: Any + username: bytes | str + password: bytes | str last_nonce: Any nonce_count: Any chal: Any pos: Any num_401_calls: Any - def __init__(self, username, password) -> None: ... + def __init__(self, username: bytes | str, password: bytes | str) -> None: ... def build_digest_header(self, method, url): ... def handle_redirect(self, r, **kwargs): ... def handle_401(self, r, **kwargs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/certs.pyi b/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/certs.pyi new file mode 100644 index 000000000..7c5857d69 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/certs.pyi @@ -0,0 +1 @@ +# no public data diff --git a/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/compat.pyi b/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/compat.pyi index c7f4131cc..bf90bf09f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/compat.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/compat.pyi @@ -1,4 +1,6 @@ +from builtins import bytes as bytes, str as str from collections import OrderedDict as OrderedDict +from typing_extensions import Literal, TypeAlias from urllib.parse import ( quote as quote, quote_plus as quote_plus, @@ -13,6 +15,11 @@ from urllib.parse import ( ) from urllib.request import getproxies as getproxies, parse_http_list as parse_http_list, proxy_bypass as proxy_bypass -is_py2: bool -is_py3: bool +is_py2: Literal[False] +is_py3: Literal[True] has_simplejson: bool + +builtin_str: TypeAlias = str # noqa: Y042 +basestring: tuple[type, ...] +numeric_types: tuple[type, ...] +integer_types: tuple[type, ...] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/cookies.pyi b/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/cookies.pyi index d27dea762..b7f0812a4 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/cookies.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/cookies.pyi @@ -47,8 +47,8 @@ class RequestsCookieJar(CookieJar, MutableMapping[Any, Any]): def multiple_domains(self): ... def get_dict(self, domain=..., path=...): ... def __getitem__(self, name): ... - def __setitem__(self, name, value): ... - def __delitem__(self, name): ... + def __setitem__(self, name, value) -> None: ... + def __delitem__(self, name) -> None: ... def set_cookie(self, cookie, *args, **kwargs): ... def update(self, other): ... def copy(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/exceptions.pyi b/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/exceptions.pyi index 88479bbca..b642d5ad3 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/exceptions.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/exceptions.pyi @@ -2,7 +2,7 @@ from typing import Any from urllib3.exceptions import HTTPError as BaseHTTPError -class RequestException(IOError): +class RequestException(OSError): response: Any request: Any def __init__(self, *args, **kwargs) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/models.pyi b/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/models.pyi index e58361869..9cdb2443f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/models.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/models.pyi @@ -1,8 +1,9 @@ import datetime -from _typeshed import Self +from _typeshed import Unused from collections.abc import Callable, Iterator from json import JSONDecoder from typing import Any +from typing_extensions import Self from urllib3 import exceptions as urllib3_exceptions, fields, filepost, util @@ -106,8 +107,8 @@ class Response: def __bool__(self) -> bool: ... def __nonzero__(self) -> bool: ... def __iter__(self) -> Iterator[bytes]: ... - def __enter__(self: Self) -> Self: ... - def __exit__(self, *args: object) -> None: ... + def __enter__(self) -> Self: ... + def __exit__(self, *args: Unused) -> None: ... @property def next(self) -> PreparedRequest | None: ... @property diff --git a/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/sessions.pyi b/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/sessions.pyi index f6df1d688..19b86d320 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/sessions.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/sessions.pyi @@ -1,7 +1,7 @@ -from _typeshed import Self, SupportsItems, SupportsRead +from _typeshed import Incomplete, SupportsItems, SupportsRead, Unused from collections.abc import Callable, Iterable, Mapping, MutableMapping -from typing import IO, Any, Union -from typing_extensions import TypeAlias, TypedDict +from typing import Any +from typing_extensions import Self, TypeAlias, TypedDict from urllib3._collections import RecentlyUsedContainer @@ -40,14 +40,45 @@ def merge_setting(request_setting, session_setting, dict_class=...): ... def merge_hooks(request_hooks, session_hooks, dict_class=...): ... class SessionRedirectMixin: - def resolve_redirects(self, resp, req, stream=..., timeout=..., verify=..., cert=..., proxies=...): ... + def resolve_redirects( + self, + resp, + req, + stream: bool = ..., + timeout: Incomplete | None = ..., + verify: bool = ..., + cert: Incomplete | None = ..., + proxies: Incomplete | None = ..., + yield_requests: bool = ..., + **adapter_kwargs, + ): ... def rebuild_auth(self, prepared_request, response): ... def rebuild_proxies(self, prepared_request, proxies): ... def should_strip_auth(self, old_url, new_url): ... + def rebuild_method(self, prepared_request: PreparedRequest, response: Response) -> None: ... + def get_redirect_target(self, resp: Response) -> str | None: ... -_Data: TypeAlias = str | bytes | Mapping[str, Any] | Iterable[tuple[str, str | None]] | IO[Any] -_Auth: TypeAlias = Union[tuple[str, str], _auth.AuthBase, Callable[[PreparedRequest], PreparedRequest]] -_Cert: TypeAlias = Union[str, tuple[str, str]] +_Data: TypeAlias = ( + # used in requests.models.PreparedRequest.prepare_body + # + # case: is_stream + # see requests.adapters.HTTPAdapter.send + # will be sent directly to http.HTTPConnection.send(...) (through urllib3) + Iterable[bytes] + # case: not is_stream + # will be modified before being sent to urllib3.HTTPConnectionPool.urlopen(body=...) + # see requests.models.RequestEncodingMixin._encode_params + # see requests.models.RequestEncodingMixin._encode_files + # note that keys&values are converted from Any to str by urllib.parse.urlencode + | str + | bytes + | SupportsRead[str | bytes] + | list[tuple[Any, Any]] + | tuple[tuple[Any, Any], ...] + | Mapping[Any, Any] +) +_Auth: TypeAlias = tuple[str, str] | _auth.AuthBase | Callable[[PreparedRequest], PreparedRequest] +_Cert: TypeAlias = str | tuple[str, str] # Files is passed to requests.utils.to_key_val_list() _FileName: TypeAlias = str | None _FileContent: TypeAlias = SupportsRead[str | bytes] | str | bytes @@ -63,15 +94,16 @@ _HooksInput: TypeAlias = Mapping[str, Iterable[_Hook] | _Hook] _ParamsMappingKeyType: TypeAlias = str | bytes | int | float _ParamsMappingValueType: TypeAlias = str | bytes | int | float | Iterable[str | bytes | int | float] | None -_Params: TypeAlias = Union[ - SupportsItems[_ParamsMappingKeyType, _ParamsMappingValueType], - tuple[_ParamsMappingKeyType, _ParamsMappingValueType], - Iterable[tuple[_ParamsMappingKeyType, _ParamsMappingValueType]], - str | bytes, -] +_Params: TypeAlias = ( + SupportsItems[_ParamsMappingKeyType, _ParamsMappingValueType] + | tuple[_ParamsMappingKeyType, _ParamsMappingValueType] + | Iterable[tuple[_ParamsMappingKeyType, _ParamsMappingValueType]] + | str + | bytes +) _TextMapping: TypeAlias = MutableMapping[str, str] _HeadersUpdateMapping: TypeAlias = Mapping[str, str | bytes | None] -_Timeout: TypeAlias = Union[float, tuple[float, float], tuple[float, None]] +_Timeout: TypeAlias = float | tuple[float, float] | tuple[float, None] _Verify: TypeAlias = bool | str class _Settings(TypedDict): @@ -82,7 +114,9 @@ class _Settings(TypedDict): class Session(SessionRedirectMixin): __attrs__: Any - headers: CaseInsensitiveDict[str | bytes] + # See https://github.com/psf/requests/issues/5020#issuecomment-989082461: + # requests sets this as a CaseInsensitiveDict, but users may set it to any MutableMapping + headers: MutableMapping[str, str | bytes] auth: _Auth | None proxies: _TextMapping # Don't complain if: @@ -99,8 +133,8 @@ class Session(SessionRedirectMixin): adapters: MutableMapping[Any, Any] redirect_cache: RecentlyUsedContainer[Any, Any] def __init__(self) -> None: ... - def __enter__(self: Self) -> Self: ... - def __exit__(self, *args) -> None: ... + def __enter__(self) -> Self: ... + def __exit__(self, *args: Unused) -> None: ... def prepare_request(self, request: Request) -> PreparedRequest: ... def request( self, @@ -119,7 +153,7 @@ class Session(SessionRedirectMixin): stream: bool | None = ..., verify: _Verify | None = ..., cert: _Cert | None = ..., - json: Any | None = ..., + json: Incomplete | None = ..., ) -> Response: ... def get( self, @@ -138,7 +172,7 @@ class Session(SessionRedirectMixin): stream: bool | None = ..., verify: _Verify | None = ..., cert: _Cert | None = ..., - json: Any | None = ..., + json: Incomplete | None = ..., ) -> Response: ... def options( self, @@ -157,7 +191,7 @@ class Session(SessionRedirectMixin): stream: bool | None = ..., verify: _Verify | None = ..., cert: _Cert | None = ..., - json: Any | None = ..., + json: Incomplete | None = ..., ) -> Response: ... def head( self, @@ -176,13 +210,13 @@ class Session(SessionRedirectMixin): stream: bool | None = ..., verify: _Verify | None = ..., cert: _Cert | None = ..., - json: Any | None = ..., + json: Incomplete | None = ..., ) -> Response: ... def post( self, url: str | bytes, data: _Data | None = ..., - json: Any | None = ..., + json: Incomplete | None = ..., *, params: _Params | None = ..., headers: _HeadersUpdateMapping | None = ..., @@ -214,7 +248,7 @@ class Session(SessionRedirectMixin): stream: bool | None = ..., verify: _Verify | None = ..., cert: _Cert | None = ..., - json: Any | None = ..., + json: Incomplete | None = ..., ) -> Response: ... def patch( self, @@ -233,7 +267,7 @@ class Session(SessionRedirectMixin): stream: bool | None = ..., verify: _Verify | None = ..., cert: _Cert | None = ..., - json: Any | None = ..., + json: Incomplete | None = ..., ) -> Response: ... def delete( self, @@ -252,7 +286,7 @@ class Session(SessionRedirectMixin): stream: bool | None = ..., verify: _Verify | None = ..., cert: _Cert | None = ..., - json: Any | None = ..., + json: Incomplete | None = ..., ) -> Response: ... def send( self, diff --git a/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/structures.pyi b/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/structures.pyi index 4e519ac96..14ef93c4a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/structures.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/structures.pyi @@ -1,6 +1,7 @@ from collections.abc import Iterable, Iterator, Mapping, MutableMapping -from typing import Any, Generic, TypeVar +from typing import Any, Generic, TypeVar, overload +_D = TypeVar("_D") _VT = TypeVar("_VT") class CaseInsensitiveDict(MutableMapping[str, _VT], Generic[_VT]): @@ -17,5 +18,8 @@ class LookupDict(dict[str, _VT]): name: Any def __init__(self, name: Any = ...) -> None: ... def __getitem__(self, key: str) -> _VT | None: ... # type: ignore[override] - def __getattr__(self, attr: str) -> _VT: ... def __setattr__(self, __attr: str, __value: _VT) -> None: ... + @overload + def get(self, key: str, default: None = ...) -> _VT | None: ... + @overload + def get(self, key: str, default: _D | _VT) -> _D | _VT: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/utils.pyi b/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/utils.pyi index 5fa6519d8..34cd796cd 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/utils.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/utils.pyi @@ -1,10 +1,13 @@ +import sys +from _typeshed import StrOrBytesPath from collections.abc import Generator, Iterable, Mapping -from contextlib import AbstractContextManager +from contextlib import _GeneratorContextManager +from io import BufferedWriter from typing import Any, AnyStr from typing_extensions import TypeAlias from . import compat, cookies, exceptions, structures -from .models import PreparedRequest +from .models import PreparedRequest, Request _Uri: TypeAlias = str | bytes OrderedDict = compat.OrderedDict @@ -22,6 +25,7 @@ def super_len(o): ... def get_netrc_auth(url: _Uri, raise_errors: bool = ...) -> tuple[str, str] | None: ... def guess_filename(obj): ... def extract_zipped_paths(path): ... +def atomic_open(filename: StrOrBytesPath) -> _GeneratorContextManager[BufferedWriter]: ... def from_key_val_list(value): ... def to_key_val_list(value): ... def parse_list_header(value): ... @@ -43,10 +47,11 @@ def address_in_network(ip: str, net: str) -> bool: ... def dotted_netmask(mask: int) -> str: ... def is_ipv4_address(string_ip: str) -> bool: ... def is_valid_cidr(string_network: str) -> bool: ... -def set_environ(env_name: str, value: None) -> AbstractContextManager[None]: ... +def set_environ(env_name: str, value: None) -> _GeneratorContextManager[None]: ... def should_bypass_proxies(url: _Uri, no_proxy: Iterable[str] | None) -> bool: ... def get_environ_proxies(url: _Uri, no_proxy: Iterable[str] | None = ...) -> dict[Any, Any]: ... def select_proxy(url: _Uri, proxies: Mapping[Any, Any] | None): ... +def resolve_proxies(request: Request | PreparedRequest, proxies: Mapping[str, str] | None, trust_env: bool = ...): ... def default_user_agent(name: str = ...) -> str: ... def default_headers() -> CaseInsensitiveDict[str]: ... def parse_header_links(value: str) -> list[dict[str, str]]: ... @@ -57,3 +62,7 @@ def to_native_string(string, encoding=...): ... def urldefragauth(url: _Uri): ... def rewind_body(prepared_request: PreparedRequest) -> None: ... def check_header_validity(header: tuple[AnyStr, AnyStr]) -> None: ... + +if sys.platform == "win32": + def proxy_bypass_registry(host: str) -> bool: ... + def proxy_bypass(host: str) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/retry/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/retry/METADATA.toml index 1548770aa..51e869b47 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/retry/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/retry/METADATA.toml @@ -1,4 +1 @@ version = "0.9.*" - -[tool.stubtest] -ignore_missing_stub = false diff --git a/packages/pyright-internal/typeshed-fallback/stubs/retry/retry/api.pyi b/packages/pyright-internal/typeshed-fallback/stubs/retry/retry/api.pyi index 32f16dd5e..2221d4543 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/retry/retry/api.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/retry/retry/api.pyi @@ -5,6 +5,8 @@ from typing import Any, TypeVar _R = TypeVar("_R") +logging_logger: Logger + def retry_call( f: Callable[..., _R], fargs: Sequence[Any] | None = ..., diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/selenium/METADATA.toml deleted file mode 100644 index 9d7ee7b9c..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/METADATA.toml +++ /dev/null @@ -1,2 +0,0 @@ -version = "3.141.*" -obsolete_since = "4.1.2" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/common/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/common/__init__.pyi deleted file mode 100644 index baafbaf54..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/common/__init__.pyi +++ /dev/null @@ -1 +0,0 @@ -from . import exceptions as exceptions diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/common/exceptions.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/common/exceptions.pyi deleted file mode 100644 index f3f9f6dc9..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/common/exceptions.pyi +++ /dev/null @@ -1,49 +0,0 @@ -from typing import Any - -class WebDriverException(Exception): - msg: Any - screen: Any - stacktrace: Any - def __init__(self, msg: Any | None = ..., screen: Any | None = ..., stacktrace: Any | None = ...) -> None: ... - -class ErrorInResponseException(WebDriverException): - response: Any - def __init__(self, response, msg) -> None: ... - -class InvalidSwitchToTargetException(WebDriverException): ... -class NoSuchFrameException(InvalidSwitchToTargetException): ... -class NoSuchWindowException(InvalidSwitchToTargetException): ... -class NoSuchElementException(WebDriverException): ... -class NoSuchAttributeException(WebDriverException): ... -class StaleElementReferenceException(WebDriverException): ... -class InvalidElementStateException(WebDriverException): ... - -class UnexpectedAlertPresentException(WebDriverException): - alert_text: Any - def __init__( - self, msg: Any | None = ..., screen: Any | None = ..., stacktrace: Any | None = ..., alert_text: Any | None = ... - ) -> None: ... - -class NoAlertPresentException(WebDriverException): ... -class ElementNotVisibleException(InvalidElementStateException): ... -class ElementNotInteractableException(InvalidElementStateException): ... -class ElementNotSelectableException(InvalidElementStateException): ... -class InvalidCookieDomainException(WebDriverException): ... -class UnableToSetCookieException(WebDriverException): ... -class RemoteDriverServerException(WebDriverException): ... -class TimeoutException(WebDriverException): ... -class MoveTargetOutOfBoundsException(WebDriverException): ... -class UnexpectedTagNameException(WebDriverException): ... -class InvalidSelectorException(NoSuchElementException): ... -class ImeNotAvailableException(WebDriverException): ... -class ImeActivationFailedException(WebDriverException): ... -class InvalidArgumentException(WebDriverException): ... -class JavascriptException(WebDriverException): ... -class NoSuchCookieException(WebDriverException): ... -class ScreenshotException(WebDriverException): ... -class ElementClickInterceptedException(WebDriverException): ... -class InsecureCertificateException(WebDriverException): ... -class InvalidCoordinatesException(WebDriverException): ... -class InvalidSessionIdException(WebDriverException): ... -class SessionNotCreatedException(WebDriverException): ... -class UnknownMethodException(WebDriverException): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/__init__.pyi deleted file mode 100644 index c352e5e54..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/__init__.pyi +++ /dev/null @@ -1,45 +0,0 @@ -from .android.webdriver import WebDriver as Android -from .blackberry.webdriver import WebDriver as BlackBerry -from .chrome.options import Options as ChromeOptions -from .chrome.webdriver import WebDriver as Chrome -from .common.action_chains import ActionChains as ActionChains -from .common.desired_capabilities import DesiredCapabilities as DesiredCapabilities -from .common.proxy import Proxy as Proxy -from .common.touch_actions import TouchActions as TouchActions -from .edge.webdriver import WebDriver as Edge -from .firefox.firefox_profile import FirefoxProfile as FirefoxProfile -from .firefox.options import Options as FirefoxOptions -from .firefox.webdriver import WebDriver as Firefox -from .ie.options import Options as IeOptions -from .ie.webdriver import WebDriver as Ie -from .opera.webdriver import WebDriver as Opera -from .phantomjs.webdriver import WebDriver as PhantomJS -from .remote.webdriver import WebDriver as Remote -from .safari.webdriver import WebDriver as Safari -from .webkitgtk.options import Options as WebKitGTKOptions -from .webkitgtk.webdriver import WebDriver as WebKitGTK - -# We need an explicit __all__ because some of the above won't otherwise be exported. -# This could also be fixed using assignments -__all__ = [ - "Firefox", - "FirefoxProfile", - "FirefoxOptions", - "Chrome", - "ChromeOptions", - "Ie", - "IeOptions", - "Edge", - "Opera", - "Safari", - "BlackBerry", - "PhantomJS", - "Android", - "WebKitGTK", - "WebKitGTKOptions", - "Remote", - "DesiredCapabilities", - "ActionChains", - "TouchActions", - "Proxy", -] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/android/webdriver.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/android/webdriver.pyi deleted file mode 100644 index c310c4acd..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/android/webdriver.pyi +++ /dev/null @@ -1,5 +0,0 @@ -from selenium.webdriver.common.desired_capabilities import DesiredCapabilities as DesiredCapabilities -from selenium.webdriver.remote.webdriver import WebDriver as RemoteWebDriver - -class WebDriver(RemoteWebDriver): - def __init__(self, host: str = ..., port: int = ..., desired_capabilities=...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/blackberry/webdriver.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/blackberry/webdriver.pyi deleted file mode 100644 index 8caafb6c4..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/blackberry/webdriver.pyi +++ /dev/null @@ -1,11 +0,0 @@ -from typing import Any - -from selenium.webdriver.remote.webdriver import WebDriver as RemoteWebDriver - -LOAD_TIMEOUT: int - -class WebDriver(RemoteWebDriver): - def __init__( - self, device_password, bb_tools_dir: Any | None = ..., hostip: str = ..., port: int = ..., desired_capabilities=... - ): ... - def quit(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/chrome/options.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/chrome/options.pyi deleted file mode 100644 index 83baf8ac0..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/chrome/options.pyi +++ /dev/null @@ -1,30 +0,0 @@ -class Options: - KEY: str - def __init__(self) -> None: ... - @property - def binary_location(self): ... - @binary_location.setter - def binary_location(self, value) -> None: ... - @property - def capabilities(self): ... - def set_capability(self, name, value) -> None: ... - @property - def debugger_address(self): ... - @debugger_address.setter - def debugger_address(self, value) -> None: ... - @property - def arguments(self): ... - def add_argument(self, argument) -> None: ... - @property - def extensions(self): ... - def add_extension(self, extension) -> None: ... - def add_encoded_extension(self, extension) -> None: ... - @property - def experimental_options(self): ... - def add_experimental_option(self, name, value) -> None: ... - @property - def headless(self): ... - @headless.setter - def headless(self, value) -> None: ... - def set_headless(self, headless: bool = ...) -> None: ... - def to_capabilities(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/chrome/remote_connection.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/chrome/remote_connection.pyi deleted file mode 100644 index 0e5870aef..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/chrome/remote_connection.pyi +++ /dev/null @@ -1,4 +0,0 @@ -from selenium.webdriver.remote.remote_connection import RemoteConnection as RemoteConnection - -class ChromeRemoteConnection(RemoteConnection): - def __init__(self, remote_server_addr, keep_alive: bool = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/chrome/service.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/chrome/service.pyi deleted file mode 100644 index d581b7901..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/chrome/service.pyi +++ /dev/null @@ -1,10 +0,0 @@ -from typing import Any - -from selenium.webdriver.common import service as service - -class Service(service.Service): - service_args: Any - def __init__( - self, executable_path, port: int = ..., service_args: Any | None = ..., log_path: Any | None = ..., env: Any | None = ... - ) -> None: ... - def command_line_args(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/chrome/webdriver.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/chrome/webdriver.pyi deleted file mode 100644 index 754ebf515..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/chrome/webdriver.pyi +++ /dev/null @@ -1,25 +0,0 @@ -from typing import Any - -from selenium.webdriver.remote.webdriver import WebDriver as RemoteWebDriver - -from .remote_connection import ChromeRemoteConnection as ChromeRemoteConnection - -class WebDriver(RemoteWebDriver): - service: Any - def __init__( - self, - executable_path: str = ..., - port: int = ..., - options: Any | None = ..., - service_args: Any | None = ..., - desired_capabilities: Any | None = ..., - service_log_path: Any | None = ..., - chrome_options: Any | None = ..., - keep_alive: bool = ..., - ) -> None: ... - def launch_app(self, id): ... - def get_network_conditions(self): ... - def set_network_conditions(self, **network_conditions) -> None: ... - def execute_cdp_cmd(self, cmd, cmd_args): ... - def quit(self) -> None: ... - def create_options(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/action_chains.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/action_chains.pyi deleted file mode 100644 index e1ab3cda0..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/action_chains.pyi +++ /dev/null @@ -1,29 +0,0 @@ -from typing import Any - -from selenium.webdriver.remote.command import Command as Command - -from .actions.action_builder import ActionBuilder as ActionBuilder -from .utils import keys_to_typing as keys_to_typing - -class ActionChains: - w3c_actions: Any - def __init__(self, driver) -> None: ... - def perform(self) -> None: ... - def reset_actions(self) -> None: ... - def click(self, on_element: Any | None = ...): ... - def click_and_hold(self, on_element: Any | None = ...): ... - def context_click(self, on_element: Any | None = ...): ... - def double_click(self, on_element: Any | None = ...): ... - def drag_and_drop(self, source, target): ... - def drag_and_drop_by_offset(self, source, xoffset, yoffset): ... - def key_down(self, value, element: Any | None = ...): ... - def key_up(self, value, element: Any | None = ...): ... - def move_by_offset(self, xoffset, yoffset): ... - def move_to_element(self, to_element): ... - def move_to_element_with_offset(self, to_element, xoffset, yoffset): ... - def pause(self, seconds): ... - def release(self, on_element: Any | None = ...): ... - def send_keys(self, *keys_to_send): ... - def send_keys_to_element(self, element, *keys_to_send): ... - def __enter__(self): ... - def __exit__(self, _type, _value, _traceback) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/actions/action_builder.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/actions/action_builder.pyi deleted file mode 100644 index 40be96286..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/actions/action_builder.pyi +++ /dev/null @@ -1,27 +0,0 @@ -from typing import Any - -from selenium.webdriver.remote.command import Command as Command - -from . import interaction as interaction -from .key_actions import KeyActions as KeyActions -from .key_input import KeyInput as KeyInput -from .pointer_actions import PointerActions as PointerActions -from .pointer_input import PointerInput as PointerInput - -class ActionBuilder: - devices: Any - driver: Any - def __init__(self, driver, mouse: Any | None = ..., keyboard: Any | None = ...) -> None: ... - def get_device_with(self, name): ... - @property - def pointer_inputs(self): ... - @property - def key_inputs(self): ... - @property - def key_action(self): ... - @property - def pointer_action(self): ... - def add_key_input(self, name): ... - def add_pointer_input(self, kind, name): ... - def perform(self) -> None: ... - def clear_actions(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/actions/input_device.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/actions/input_device.pyi deleted file mode 100644 index 461e84e98..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/actions/input_device.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing import Any - -class InputDevice: - name: Any - actions: Any - def __init__(self, name: Any | None = ...) -> None: ... - def add_action(self, action) -> None: ... - def clear_actions(self) -> None: ... - def create_pause(self, duraton: int = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/actions/interaction.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/actions/interaction.pyi deleted file mode 100644 index 61cb9eec9..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/actions/interaction.pyi +++ /dev/null @@ -1,21 +0,0 @@ -from typing import Any - -KEY: str -POINTER: str -NONE: str -SOURCE_TYPES: Any -POINTER_MOUSE: str -POINTER_TOUCH: str -POINTER_PEN: str -POINTER_KINDS: Any - -class Interaction: - PAUSE: str - source: Any - def __init__(self, source) -> None: ... - -class Pause(Interaction): - source: Any - duration: Any - def __init__(self, source, duration: int = ...) -> None: ... - def encode(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/actions/key_actions.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/actions/key_actions.pyi deleted file mode 100644 index b5412a65b..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/actions/key_actions.pyi +++ /dev/null @@ -1,13 +0,0 @@ -from typing import Any - -from ..utils import keys_to_typing as keys_to_typing -from .interaction import KEY as KEY, Interaction as Interaction -from .key_input import KeyInput as KeyInput - -class KeyActions(Interaction): - source: Any - def __init__(self, source: Any | None = ...) -> None: ... - def key_down(self, letter): ... - def key_up(self, letter): ... - def pause(self, duration: int = ...): ... - def send_keys(self, text): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/actions/key_input.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/actions/key_input.pyi deleted file mode 100644 index 744422672..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/actions/key_input.pyi +++ /dev/null @@ -1,20 +0,0 @@ -from typing import Any - -from . import interaction as interaction -from .input_device import InputDevice as InputDevice -from .interaction import Interaction as Interaction, Pause as Pause - -class KeyInput(InputDevice): - name: Any - type: Any - def __init__(self, name) -> None: ... - def encode(self): ... - def create_key_down(self, key) -> None: ... - def create_key_up(self, key) -> None: ... - def create_pause(self, pause_duration: int = ...) -> None: ... - -class TypingInteraction(Interaction): - type: Any - key: Any - def __init__(self, source, type_, key) -> None: ... - def encode(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/actions/mouse_button.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/actions/mouse_button.pyi deleted file mode 100644 index 603c6f6bc..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/actions/mouse_button.pyi +++ /dev/null @@ -1,4 +0,0 @@ -class MouseButton: - LEFT: int - MIDDLE: int - RIGHT: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/actions/pointer_actions.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/actions/pointer_actions.pyi deleted file mode 100644 index 4cf6e0ce1..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/actions/pointer_actions.pyi +++ /dev/null @@ -1,23 +0,0 @@ -from typing import Any - -from selenium.webdriver.remote.webelement import WebElement as WebElement - -from . import interaction as interaction -from .interaction import Interaction as Interaction -from .mouse_button import MouseButton as MouseButton -from .pointer_input import PointerInput as PointerInput - -class PointerActions(Interaction): - source: Any - def __init__(self, source: Any | None = ...) -> None: ... - def pointer_down(self, button=...) -> None: ... - def pointer_up(self, button=...) -> None: ... - def move_to(self, element, x: Any | None = ..., y: Any | None = ...): ... - def move_by(self, x, y): ... - def move_to_location(self, x, y): ... - def click(self, element: Any | None = ...): ... - def context_click(self, element: Any | None = ...): ... - def click_and_hold(self, element: Any | None = ...): ... - def release(self): ... - def double_click(self, element: Any | None = ...) -> None: ... - def pause(self, duration: int = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/actions/pointer_input.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/actions/pointer_input.pyi deleted file mode 100644 index 1647f90f1..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/actions/pointer_input.pyi +++ /dev/null @@ -1,17 +0,0 @@ -from typing import Any - -from .input_device import InputDevice as InputDevice -from .interaction import POINTER as POINTER, POINTER_KINDS as POINTER_KINDS - -class PointerInput(InputDevice): - DEFAULT_MOVE_DURATION: int - type: Any - kind: Any - name: Any - def __init__(self, kind, name) -> None: ... - def create_pointer_move(self, duration=..., x: Any | None = ..., y: Any | None = ..., origin: Any | None = ...) -> None: ... - def create_pointer_down(self, button) -> None: ... - def create_pointer_up(self, button) -> None: ... - def create_pointer_cancel(self) -> None: ... - def create_pause(self, pause_duration) -> None: ... # type: ignore[override] - def encode(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/alert.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/alert.pyi deleted file mode 100644 index 942702218..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/alert.pyi +++ /dev/null @@ -1,10 +0,0 @@ -from typing import Any - -class Alert: - driver: Any - def __init__(self, driver) -> None: ... - @property - def text(self): ... - def dismiss(self) -> None: ... - def accept(self) -> None: ... - def send_keys(self, keysToSend) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/by.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/by.pyi deleted file mode 100644 index fbdf77bd6..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/by.pyi +++ /dev/null @@ -1,9 +0,0 @@ -class By: - ID: str - XPATH: str - LINK_TEXT: str - PARTIAL_LINK_TEXT: str - NAME: str - TAG_NAME: str - CLASS_NAME: str - CSS_SELECTOR: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/desired_capabilities.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/desired_capabilities.pyi deleted file mode 100644 index c9b16cae2..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/desired_capabilities.pyi +++ /dev/null @@ -1,16 +0,0 @@ -from typing import Any - -class DesiredCapabilities: - FIREFOX: Any - INTERNETEXPLORER: Any - EDGE: Any - CHROME: Any - OPERA: Any - SAFARI: Any - HTMLUNIT: Any - HTMLUNITWITHJS: Any - IPHONE: Any - IPAD: Any - ANDROID: Any - PHANTOMJS: Any - WEBKITGTK: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/html5/application_cache.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/html5/application_cache.pyi deleted file mode 100644 index 248010ea2..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/html5/application_cache.pyi +++ /dev/null @@ -1,13 +0,0 @@ -from typing import Any - -class ApplicationCache: - UNCACHED: int - IDLE: int - CHECKING: int - DOWNLOADING: int - UPDATE_READY: int - OBSOLETE: int - driver: Any - def __init__(self, driver) -> None: ... - @property - def status(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/keys.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/keys.pyi deleted file mode 100644 index b93ef383b..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/keys.pyi +++ /dev/null @@ -1,67 +0,0 @@ -from typing import Any - -class Keys: - NULL: str - CANCEL: str - HELP: str - BACKSPACE: str - BACK_SPACE: Any - TAB: str - CLEAR: str - RETURN: str - ENTER: str - SHIFT: str - LEFT_SHIFT: Any - CONTROL: str - LEFT_CONTROL: Any - ALT: str - LEFT_ALT: Any - PAUSE: str - ESCAPE: str - SPACE: str - PAGE_UP: str - PAGE_DOWN: str - END: str - HOME: str - LEFT: str - ARROW_LEFT: Any - UP: str - ARROW_UP: Any - RIGHT: str - ARROW_RIGHT: Any - DOWN: str - ARROW_DOWN: Any - INSERT: str - DELETE: str - SEMICOLON: str - EQUALS: str - NUMPAD0: str - NUMPAD1: str - NUMPAD2: str - NUMPAD3: str - NUMPAD4: str - NUMPAD5: str - NUMPAD6: str - NUMPAD7: str - NUMPAD8: str - NUMPAD9: str - MULTIPLY: str - ADD: str - SEPARATOR: str - SUBTRACT: str - DECIMAL: str - DIVIDE: str - F1: str - F2: str - F3: str - F4: str - F5: str - F6: str - F7: str - F8: str - F9: str - F10: str - F11: str - F12: str - META: str - COMMAND: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/proxy.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/proxy.pyi deleted file mode 100644 index a058d9dee..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/proxy.pyi +++ /dev/null @@ -1,70 +0,0 @@ -from typing import Any - -class ProxyTypeFactory: - @staticmethod - def make(ff_value, string): ... - -class ProxyType: - DIRECT: Any - MANUAL: Any - PAC: Any - RESERVED_1: Any - AUTODETECT: Any - SYSTEM: Any - UNSPECIFIED: Any - @classmethod - def load(cls, value): ... - -class Proxy: - proxyType: Any - autodetect: bool - ftpProxy: str - httpProxy: str - noProxy: str - proxyAutoconfigUrl: str - sslProxy: str - socksProxy: str - socksUsername: str - socksPassword: str - def __init__(self, raw: Any | None = ...) -> None: ... - @property - def proxy_type(self): ... - @proxy_type.setter - def proxy_type(self, value) -> None: ... - @property - def auto_detect(self): ... - @auto_detect.setter - def auto_detect(self, value) -> None: ... - @property - def ftp_proxy(self): ... - @ftp_proxy.setter - def ftp_proxy(self, value) -> None: ... - @property - def http_proxy(self): ... - @http_proxy.setter - def http_proxy(self, value) -> None: ... - @property - def no_proxy(self): ... - @no_proxy.setter - def no_proxy(self, value) -> None: ... - @property - def proxy_autoconfig_url(self): ... - @proxy_autoconfig_url.setter - def proxy_autoconfig_url(self, value) -> None: ... - @property - def ssl_proxy(self): ... - @ssl_proxy.setter - def ssl_proxy(self, value) -> None: ... - @property - def socks_proxy(self): ... - @socks_proxy.setter - def socks_proxy(self, value) -> None: ... - @property - def socks_username(self): ... - @socks_username.setter - def socks_username(self, value) -> None: ... - @property - def socks_password(self): ... - @socks_password.setter - def socks_password(self, value) -> None: ... - def add_to_capabilities(self, capabilities) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/service.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/service.pyi deleted file mode 100644 index f8b281108..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/service.pyi +++ /dev/null @@ -1,21 +0,0 @@ -from typing import Any - -class Service: - path: Any - port: Any - start_error_message: Any - log_file: Any - env: Any - def __init__( - self, executable, port: int = ..., log_file=..., env: Any | None = ..., start_error_message: str = ... - ) -> None: ... - @property - def service_url(self): ... - def command_line_args(self) -> None: ... - process: Any - def start(self) -> None: ... - def assert_process_still_running(self) -> None: ... - def is_connectable(self): ... - def send_remote_shutdown_command(self) -> None: ... - def stop(self) -> None: ... - def __del__(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/touch_actions.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/touch_actions.pyi deleted file mode 100644 index 04a5d1717..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/touch_actions.pyi +++ /dev/null @@ -1,15 +0,0 @@ -class TouchActions: - def __init__(self, driver) -> None: ... - def perform(self) -> None: ... - def tap(self, on_element): ... - def double_tap(self, on_element): ... - def tap_and_hold(self, xcoord, ycoord): ... - def move(self, xcoord, ycoord): ... - def release(self, xcoord, ycoord): ... - def scroll(self, xoffset, yoffset): ... - def scroll_from_element(self, on_element, xoffset, yoffset): ... - def long_press(self, on_element): ... - def flick(self, xspeed, yspeed): ... - def flick_element(self, on_element, xoffset, yoffset, speed): ... - def __enter__(self): ... - def __exit__(self, _type, _value, _traceback) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/utils.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/utils.pyi deleted file mode 100644 index ffd77721b..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/common/utils.pyi +++ /dev/null @@ -1,12 +0,0 @@ -from typing import Any - -from selenium.webdriver.common.keys import Keys as Keys - -basestring = str - -def free_port(): ... -def find_connectable_ip(host, port: Any | None = ...): ... -def join_host_port(host, port): ... -def is_connectable(port, host: str = ...): ... -def is_url_connectable(port): ... -def keys_to_typing(value): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/edge/options.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/edge/options.pyi deleted file mode 100644 index 990c0923e..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/edge/options.pyi +++ /dev/null @@ -1,10 +0,0 @@ -class Options: - def __init__(self) -> None: ... - @property - def page_load_strategy(self): ... - @page_load_strategy.setter - def page_load_strategy(self, value) -> None: ... - @property - def capabilities(self): ... - def set_capability(self, name, value) -> None: ... - def to_capabilities(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/edge/service.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/edge/service.pyi deleted file mode 100644 index 87abed56f..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/edge/service.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from typing import Any - -from selenium.webdriver.common import service as service - -class Service(service.Service): - service_args: Any - def __init__(self, executable_path, port: int = ..., verbose: bool = ..., log_path: Any | None = ...) -> None: ... - def command_line_args(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/edge/webdriver.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/edge/webdriver.pyi deleted file mode 100644 index 1a76a70c2..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/edge/webdriver.pyi +++ /dev/null @@ -1,18 +0,0 @@ -from typing import Any - -from selenium.webdriver.remote.webdriver import WebDriver as RemoteWebDriver - -class WebDriver(RemoteWebDriver): - port: Any - edge_service: Any - def __init__( - self, - executable_path: str = ..., - capabilities: Any | None = ..., - port: int = ..., - verbose: bool = ..., - service_log_path: Any | None = ..., - log_path: Any | None = ..., - keep_alive: bool = ..., - ) -> None: ... - def quit(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/firefox/extension_connection.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/firefox/extension_connection.pyi deleted file mode 100644 index d47e2b80d..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/firefox/extension_connection.pyi +++ /dev/null @@ -1,20 +0,0 @@ -from typing import Any - -from selenium.webdriver.remote.remote_connection import RemoteConnection as RemoteConnection - -LOGGER: Any -PORT: int -HOST: Any - -class ExtensionConnection(RemoteConnection): - profile: Any - binary: Any - def __init__(self, host, firefox_profile, firefox_binary: Any | None = ..., timeout: int = ...) -> None: ... - def quit(self, sessionId: Any | None = ...) -> None: ... - def connect(self): ... - @classmethod - def connect_and_quit(cls) -> None: ... - @classmethod - def is_connectable(cls) -> None: ... - -class ExtensionConnectionError(Exception): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/firefox/firefox_binary.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/firefox/firefox_binary.pyi deleted file mode 100644 index 4b146ba45..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/firefox/firefox_binary.pyi +++ /dev/null @@ -1,11 +0,0 @@ -from typing import Any - -class FirefoxBinary: - NO_FOCUS_LIBRARY_NAME: str - command_line: Any - def __init__(self, firefox_path: Any | None = ..., log_file: Any | None = ...) -> None: ... - def add_command_line_options(self, *args) -> None: ... - profile: Any - def launch_browser(self, profile, timeout: int = ...) -> None: ... - def kill(self) -> None: ... - def which(self, fname): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/firefox/firefox_profile.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/firefox/firefox_profile.pyi deleted file mode 100644 index 885b25454..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/firefox/firefox_profile.pyi +++ /dev/null @@ -1,41 +0,0 @@ -from typing import Any - -WEBDRIVER_EXT: str -WEBDRIVER_PREFERENCES: str -EXTENSION_NAME: str - -class AddonFormatError(Exception): ... - -class FirefoxProfile: - ANONYMOUS_PROFILE_NAME: str - DEFAULT_PREFERENCES: Any - default_preferences: Any - profile_dir: Any - tempfolder: Any - extensionsDir: Any - userPrefs: Any - def __init__(self, profile_directory: Any | None = ...) -> None: ... - def set_preference(self, key, value) -> None: ... - def add_extension(self, extension=...) -> None: ... - def update_preferences(self) -> None: ... - @property - def path(self): ... - @property - def port(self): ... - @port.setter - def port(self, port) -> None: ... - @property - def accept_untrusted_certs(self): ... - @accept_untrusted_certs.setter - def accept_untrusted_certs(self, value) -> None: ... - @property - def assume_untrusted_cert_issuer(self): ... - @assume_untrusted_cert_issuer.setter - def assume_untrusted_cert_issuer(self, value) -> None: ... - @property - def native_events_enabled(self): ... - @native_events_enabled.setter - def native_events_enabled(self, value) -> None: ... - @property - def encoded(self): ... - def set_proxy(self, proxy) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/firefox/options.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/firefox/options.pyi deleted file mode 100644 index d5f52f8f5..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/firefox/options.pyi +++ /dev/null @@ -1,46 +0,0 @@ -from typing import Any - -class Log: - level: Any - def __init__(self) -> None: ... - def to_capabilities(self): ... - -class Options: - KEY: str - log: Any - def __init__(self) -> None: ... - @property - def binary(self): ... - @binary.setter - def binary(self, new_binary) -> None: ... - @property - def binary_location(self): ... - @binary_location.setter - def binary_location(self, value) -> None: ... - @property - def accept_insecure_certs(self): ... - @accept_insecure_certs.setter - def accept_insecure_certs(self, value) -> None: ... - @property - def capabilities(self): ... - def set_capability(self, name, value) -> None: ... - @property - def preferences(self): ... - def set_preference(self, name, value) -> None: ... - @property - def proxy(self): ... - @proxy.setter - def proxy(self, value) -> None: ... - @property - def profile(self): ... - @profile.setter - def profile(self, new_profile) -> None: ... - @property - def arguments(self): ... - def add_argument(self, argument) -> None: ... - @property - def headless(self): ... - @headless.setter - def headless(self, value) -> None: ... - def set_headless(self, headless: bool = ...) -> None: ... - def to_capabilities(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/firefox/remote_connection.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/firefox/remote_connection.pyi deleted file mode 100644 index 7bfe08472..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/firefox/remote_connection.pyi +++ /dev/null @@ -1,4 +0,0 @@ -from selenium.webdriver.remote.remote_connection import RemoteConnection as RemoteConnection - -class FirefoxRemoteConnection(RemoteConnection): - def __init__(self, remote_server_addr, keep_alive: bool = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/firefox/service.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/firefox/service.pyi deleted file mode 100644 index a28db4351..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/firefox/service.pyi +++ /dev/null @@ -1,11 +0,0 @@ -from typing import Any - -from selenium.webdriver.common import service as service - -class Service(service.Service): - service_args: Any - def __init__( - self, executable_path, port: int = ..., service_args: Any | None = ..., log_path: str = ..., env: Any | None = ... - ) -> None: ... - def command_line_args(self): ... - def send_remote_shutdown_command(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/firefox/webdriver.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/firefox/webdriver.pyi deleted file mode 100644 index e76cf3bfd..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/firefox/webdriver.pyi +++ /dev/null @@ -1,45 +0,0 @@ -from collections.abc import Generator -from typing import Any - -from selenium.webdriver.remote.webdriver import WebDriver as RemoteWebDriver - -from .extension_connection import ExtensionConnection as ExtensionConnection -from .firefox_binary import FirefoxBinary as FirefoxBinary -from .firefox_profile import FirefoxProfile as FirefoxProfile -from .options import Options as Options -from .remote_connection import FirefoxRemoteConnection as FirefoxRemoteConnection -from .service import Service as Service -from .webelement import FirefoxWebElement as FirefoxWebElement - -basestring = str - -class WebDriver(RemoteWebDriver): - NATIVE_EVENTS_ALLOWED: Any - CONTEXT_CHROME: str - CONTEXT_CONTENT: str - binary: Any - profile: Any - service: Any - def __init__( - self, - firefox_profile: Any | None = ..., - firefox_binary: Any | None = ..., - timeout: int = ..., - capabilities: Any | None = ..., - proxy: Any | None = ..., - executable_path: str = ..., - options: Any | None = ..., - service_log_path: str = ..., - firefox_options: Any | None = ..., - service_args: Any | None = ..., - desired_capabilities: Any | None = ..., - log_path: Any | None = ..., - keep_alive: bool = ..., - ) -> None: ... - def quit(self) -> None: ... - @property - def firefox_profile(self): ... - def set_context(self, context) -> None: ... - def context(self, context) -> Generator[None, None, None]: ... - def install_addon(self, path, temporary: Any | None = ...): ... - def uninstall_addon(self, identifier) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/firefox/webelement.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/firefox/webelement.pyi deleted file mode 100644 index 1a4b49fc6..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/firefox/webelement.pyi +++ /dev/null @@ -1,6 +0,0 @@ -from selenium.webdriver.remote.webelement import WebElement as RemoteWebElement - -class FirefoxWebElement(RemoteWebElement): - @property - def anonymous_children(self): ... - def find_anonymous_element_by_attribute(self, name, value): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/ie/options.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/ie/options.pyi deleted file mode 100644 index e32af1727..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/ie/options.pyi +++ /dev/null @@ -1,95 +0,0 @@ -class ElementScrollBehavior: - TOP: int - BOTTOM: int - -class Options: - KEY: str - SWITCHES: str - BROWSER_ATTACH_TIMEOUT: str - ELEMENT_SCROLL_BEHAVIOR: str - ENSURE_CLEAN_SESSION: str - FILE_UPLOAD_DIALOG_TIMEOUT: str - FORCE_CREATE_PROCESS_API: str - FORCE_SHELL_WINDOWS_API: str - FULL_PAGE_SCREENSHOT: str - IGNORE_PROTECTED_MODE_SETTINGS: str - IGNORE_ZOOM_LEVEL: str - INITIAL_BROWSER_URL: str - NATIVE_EVENTS: str - PERSISTENT_HOVER: str - REQUIRE_WINDOW_FOCUS: str - USE_PER_PROCESS_PROXY: str - VALIDATE_COOKIE_DOCUMENT_TYPE: str - def __init__(self) -> None: ... - @property - def arguments(self): ... - def add_argument(self, argument) -> None: ... - @property - def options(self): ... - @property - def capabilities(self): ... - def set_capability(self, name, value) -> None: ... - @property - def browser_attach_timeout(self): ... - @browser_attach_timeout.setter - def browser_attach_timeout(self, value) -> None: ... - @property - def element_scroll_behavior(self): ... - @element_scroll_behavior.setter - def element_scroll_behavior(self, value) -> None: ... - @property - def ensure_clean_session(self): ... - @ensure_clean_session.setter - def ensure_clean_session(self, value) -> None: ... - @property - def file_upload_dialog_timeout(self): ... - @file_upload_dialog_timeout.setter - def file_upload_dialog_timeout(self, value) -> None: ... - @property - def force_create_process_api(self): ... - @force_create_process_api.setter - def force_create_process_api(self, value) -> None: ... - @property - def force_shell_windows_api(self): ... - @force_shell_windows_api.setter - def force_shell_windows_api(self, value) -> None: ... - @property - def full_page_screenshot(self): ... - @full_page_screenshot.setter - def full_page_screenshot(self, value) -> None: ... - @property - def ignore_protected_mode_settings(self): ... - @ignore_protected_mode_settings.setter - def ignore_protected_mode_settings(self, value) -> None: ... - @property - def ignore_zoom_level(self): ... - @ignore_zoom_level.setter - def ignore_zoom_level(self, value) -> None: ... - @property - def initial_browser_url(self): ... - @initial_browser_url.setter - def initial_browser_url(self, value) -> None: ... - @property - def native_events(self): ... - @native_events.setter - def native_events(self, value) -> None: ... - @property - def persistent_hover(self): ... - @persistent_hover.setter - def persistent_hover(self, value) -> None: ... - @property - def require_window_focus(self): ... - @require_window_focus.setter - def require_window_focus(self, value) -> None: ... - @property - def use_per_process_proxy(self): ... - @use_per_process_proxy.setter - def use_per_process_proxy(self, value) -> None: ... - @property - def validate_cookie_document_type(self): ... - @validate_cookie_document_type.setter - def validate_cookie_document_type(self, value) -> None: ... - @property - def additional_options(self): ... - def add_additional_option(self, name, value) -> None: ... - def to_capabilities(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/ie/service.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/ie/service.pyi deleted file mode 100644 index faae611e7..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/ie/service.pyi +++ /dev/null @@ -1,10 +0,0 @@ -from typing import Any - -from selenium.webdriver.common import service as service - -class Service(service.Service): - service_args: Any - def __init__( - self, executable_path, port: int = ..., host: Any | None = ..., log_level: Any | None = ..., log_file: Any | None = ... - ) -> None: ... - def command_line_args(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/ie/webdriver.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/ie/webdriver.pyi deleted file mode 100644 index 94e00380e..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/ie/webdriver.pyi +++ /dev/null @@ -1,34 +0,0 @@ -from typing import Any - -from selenium.webdriver.remote.webdriver import WebDriver as RemoteWebDriver - -from .options import Options as Options -from .service import Service as Service - -DEFAULT_TIMEOUT: int -DEFAULT_PORT: int -DEFAULT_HOST: Any -DEFAULT_LOG_LEVEL: Any -DEFAULT_SERVICE_LOG_PATH: Any - -class WebDriver(RemoteWebDriver): - port: Any - host: Any - iedriver: Any - def __init__( - self, - executable_path: str = ..., - capabilities: Any | None = ..., - port=..., - timeout=..., - host=..., - log_level=..., - service_log_path=..., - options: Any | None = ..., - ie_options: Any | None = ..., - desired_capabilities: Any | None = ..., - log_file: Any | None = ..., - keep_alive: bool = ..., - ) -> None: ... - def quit(self) -> None: ... - def create_options(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/opera/options.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/opera/options.pyi deleted file mode 100644 index 508b61b51..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/opera/options.pyi +++ /dev/null @@ -1,25 +0,0 @@ -from selenium.webdriver.chrome.options import Options as ChromeOptions - -class Options(ChromeOptions): - KEY: str - def __init__(self) -> None: ... - @property - def capabilities(self): ... - def set_capability(self, name, value) -> None: ... - @property - def android_package_name(self): ... - @android_package_name.setter - def android_package_name(self, value) -> None: ... - @property - def android_device_socket(self): ... - @android_device_socket.setter - def android_device_socket(self, value) -> None: ... - @property - def android_command_line_file(self): ... - @android_command_line_file.setter - def android_command_line_file(self, value) -> None: ... - def to_capabilities(self): ... - -class AndroidOptions(Options): - android_package_name: str - def __init__(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/opera/webdriver.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/opera/webdriver.pyi deleted file mode 100644 index bad77b141..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/opera/webdriver.pyi +++ /dev/null @@ -1,32 +0,0 @@ -from typing import Any - -from selenium.webdriver.chrome.webdriver import WebDriver as ChromiumDriver - -from .options import Options as Options - -class OperaDriver(ChromiumDriver): - def __init__( - self, - executable_path: Any | None = ..., - port: int = ..., - options: Any | None = ..., - service_args: Any | None = ..., - desired_capabilities: Any | None = ..., - service_log_path: Any | None = ..., - opera_options: Any | None = ..., - keep_alive: bool = ..., - ) -> None: ... - def create_options(self): ... - -class WebDriver(OperaDriver): - class ServiceType: - CHROMIUM: int - def __init__( - self, - desired_capabilities: Any | None = ..., - executable_path: Any | None = ..., - port: int = ..., - service_log_path: Any | None = ..., - service_args: Any | None = ..., - options: Any | None = ..., - ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/phantomjs/service.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/phantomjs/service.pyi deleted file mode 100644 index bc6d763b9..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/phantomjs/service.pyi +++ /dev/null @@ -1,11 +0,0 @@ -from typing import Any - -from selenium.webdriver.common import service as service - -class Service(service.Service): - service_args: Any - def __init__(self, executable_path, port: int = ..., service_args: Any | None = ..., log_path: Any | None = ...) -> None: ... - def command_line_args(self): ... - @property - def service_url(self): ... - def send_remote_shutdown_command(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/phantomjs/webdriver.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/phantomjs/webdriver.pyi deleted file mode 100644 index e57f48858..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/phantomjs/webdriver.pyi +++ /dev/null @@ -1,17 +0,0 @@ -from typing import Any - -from selenium.webdriver.remote.webdriver import WebDriver as RemoteWebDriver - -from .service import Service as Service - -class WebDriver(RemoteWebDriver): - service: Any - def __init__( - self, - executable_path: str = ..., - port: int = ..., - desired_capabilities=..., - service_args: Any | None = ..., - service_log_path: Any | None = ..., - ) -> None: ... - def quit(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/remote/command.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/remote/command.pyi deleted file mode 100644 index 18918be06..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/remote/command.pyi +++ /dev/null @@ -1,126 +0,0 @@ -class Command: - STATUS: str - NEW_SESSION: str - GET_ALL_SESSIONS: str - DELETE_SESSION: str - CLOSE: str - QUIT: str - GET: str - GO_BACK: str - GO_FORWARD: str - REFRESH: str - ADD_COOKIE: str - GET_COOKIE: str - GET_ALL_COOKIES: str - DELETE_COOKIE: str - DELETE_ALL_COOKIES: str - FIND_ELEMENT: str - FIND_ELEMENTS: str - FIND_CHILD_ELEMENT: str - FIND_CHILD_ELEMENTS: str - CLEAR_ELEMENT: str - CLICK_ELEMENT: str - SEND_KEYS_TO_ELEMENT: str - SEND_KEYS_TO_ACTIVE_ELEMENT: str - SUBMIT_ELEMENT: str - UPLOAD_FILE: str - GET_CURRENT_WINDOW_HANDLE: str - W3C_GET_CURRENT_WINDOW_HANDLE: str - GET_WINDOW_HANDLES: str - W3C_GET_WINDOW_HANDLES: str - GET_WINDOW_SIZE: str - W3C_GET_WINDOW_SIZE: str - W3C_GET_WINDOW_POSITION: str - GET_WINDOW_POSITION: str - SET_WINDOW_SIZE: str - W3C_SET_WINDOW_SIZE: str - SET_WINDOW_RECT: str - GET_WINDOW_RECT: str - SET_WINDOW_POSITION: str - W3C_SET_WINDOW_POSITION: str - SWITCH_TO_WINDOW: str - SWITCH_TO_FRAME: str - SWITCH_TO_PARENT_FRAME: str - GET_ACTIVE_ELEMENT: str - W3C_GET_ACTIVE_ELEMENT: str - GET_CURRENT_URL: str - GET_PAGE_SOURCE: str - GET_TITLE: str - EXECUTE_SCRIPT: str - W3C_EXECUTE_SCRIPT: str - W3C_EXECUTE_SCRIPT_ASYNC: str - GET_ELEMENT_TEXT: str - GET_ELEMENT_VALUE: str - GET_ELEMENT_TAG_NAME: str - SET_ELEMENT_SELECTED: str - IS_ELEMENT_SELECTED: str - IS_ELEMENT_ENABLED: str - IS_ELEMENT_DISPLAYED: str - GET_ELEMENT_LOCATION: str - GET_ELEMENT_LOCATION_ONCE_SCROLLED_INTO_VIEW: str - GET_ELEMENT_SIZE: str - GET_ELEMENT_RECT: str - GET_ELEMENT_ATTRIBUTE: str - GET_ELEMENT_PROPERTY: str - GET_ELEMENT_VALUE_OF_CSS_PROPERTY: str - SCREENSHOT: str - ELEMENT_SCREENSHOT: str - IMPLICIT_WAIT: str - EXECUTE_ASYNC_SCRIPT: str - SET_SCRIPT_TIMEOUT: str - SET_TIMEOUTS: str - MAXIMIZE_WINDOW: str - W3C_MAXIMIZE_WINDOW: str - GET_LOG: str - GET_AVAILABLE_LOG_TYPES: str - FULLSCREEN_WINDOW: str - MINIMIZE_WINDOW: str - DISMISS_ALERT: str - W3C_DISMISS_ALERT: str - ACCEPT_ALERT: str - W3C_ACCEPT_ALERT: str - SET_ALERT_VALUE: str - W3C_SET_ALERT_VALUE: str - GET_ALERT_TEXT: str - W3C_GET_ALERT_TEXT: str - SET_ALERT_CREDENTIALS: str - W3C_ACTIONS: str - W3C_CLEAR_ACTIONS: str - CLICK: str - DOUBLE_CLICK: str - MOUSE_DOWN: str - MOUSE_UP: str - MOVE_TO: str - SET_SCREEN_ORIENTATION: str - GET_SCREEN_ORIENTATION: str - SINGLE_TAP: str - TOUCH_DOWN: str - TOUCH_UP: str - TOUCH_MOVE: str - TOUCH_SCROLL: str - DOUBLE_TAP: str - LONG_PRESS: str - FLICK: str - EXECUTE_SQL: str - GET_LOCATION: str - SET_LOCATION: str - GET_APP_CACHE: str - GET_APP_CACHE_STATUS: str - CLEAR_APP_CACHE: str - GET_LOCAL_STORAGE_ITEM: str - REMOVE_LOCAL_STORAGE_ITEM: str - GET_LOCAL_STORAGE_KEYS: str - SET_LOCAL_STORAGE_ITEM: str - CLEAR_LOCAL_STORAGE: str - GET_LOCAL_STORAGE_SIZE: str - GET_SESSION_STORAGE_ITEM: str - REMOVE_SESSION_STORAGE_ITEM: str - GET_SESSION_STORAGE_KEYS: str - SET_SESSION_STORAGE_ITEM: str - CLEAR_SESSION_STORAGE: str - GET_SESSION_STORAGE_SIZE: str - GET_NETWORK_CONNECTION: str - SET_NETWORK_CONNECTION: str - CURRENT_CONTEXT_HANDLE: str - CONTEXT_HANDLES: str - SWITCH_TO_CONTEXT: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/remote/errorhandler.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/remote/errorhandler.pyi deleted file mode 100644 index 5bdaa4629..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/remote/errorhandler.pyi +++ /dev/null @@ -1,74 +0,0 @@ -from typing import Any - -from selenium.common.exceptions import ( - ElementClickInterceptedException as ElementClickInterceptedException, - ElementNotInteractableException as ElementNotInteractableException, - ElementNotSelectableException as ElementNotSelectableException, - ElementNotVisibleException as ElementNotVisibleException, - ErrorInResponseException as ErrorInResponseException, - ImeActivationFailedException as ImeActivationFailedException, - ImeNotAvailableException as ImeNotAvailableException, - InsecureCertificateException as InsecureCertificateException, - InvalidArgumentException as InvalidArgumentException, - InvalidCookieDomainException as InvalidCookieDomainException, - InvalidCoordinatesException as InvalidCoordinatesException, - InvalidElementStateException as InvalidElementStateException, - InvalidSelectorException as InvalidSelectorException, - InvalidSessionIdException as InvalidSessionIdException, - JavascriptException as JavascriptException, - MoveTargetOutOfBoundsException as MoveTargetOutOfBoundsException, - NoAlertPresentException as NoAlertPresentException, - NoSuchCookieException as NoSuchCookieException, - NoSuchElementException as NoSuchElementException, - NoSuchFrameException as NoSuchFrameException, - NoSuchWindowException as NoSuchWindowException, - ScreenshotException as ScreenshotException, - SessionNotCreatedException as SessionNotCreatedException, - StaleElementReferenceException as StaleElementReferenceException, - TimeoutException as TimeoutException, - UnableToSetCookieException as UnableToSetCookieException, - UnexpectedAlertPresentException as UnexpectedAlertPresentException, - UnknownMethodException as UnknownMethodException, - WebDriverException as WebDriverException, -) - -class ErrorCode: - SUCCESS: int - NO_SUCH_ELEMENT: Any - NO_SUCH_FRAME: Any - UNKNOWN_COMMAND: Any - STALE_ELEMENT_REFERENCE: Any - ELEMENT_NOT_VISIBLE: Any - INVALID_ELEMENT_STATE: Any - UNKNOWN_ERROR: Any - ELEMENT_IS_NOT_SELECTABLE: Any - JAVASCRIPT_ERROR: Any - XPATH_LOOKUP_ERROR: Any - TIMEOUT: Any - NO_SUCH_WINDOW: Any - INVALID_COOKIE_DOMAIN: Any - UNABLE_TO_SET_COOKIE: Any - UNEXPECTED_ALERT_OPEN: Any - NO_ALERT_OPEN: Any - SCRIPT_TIMEOUT: Any - INVALID_ELEMENT_COORDINATES: Any - IME_NOT_AVAILABLE: Any - IME_ENGINE_ACTIVATION_FAILED: Any - INVALID_SELECTOR: Any - SESSION_NOT_CREATED: Any - MOVE_TARGET_OUT_OF_BOUNDS: Any - INVALID_XPATH_SELECTOR: Any - INVALID_XPATH_SELECTOR_RETURN_TYPER: Any - ELEMENT_NOT_INTERACTABLE: Any - INSECURE_CERTIFICATE: Any - INVALID_ARGUMENT: Any - INVALID_COORDINATES: Any - INVALID_SESSION_ID: Any - NO_SUCH_COOKIE: Any - UNABLE_TO_CAPTURE_SCREEN: Any - ELEMENT_CLICK_INTERCEPTED: Any - UNKNOWN_METHOD: Any - METHOD_NOT_ALLOWED: Any - -class ErrorHandler: - def check_response(self, response) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/remote/file_detector.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/remote/file_detector.pyi deleted file mode 100644 index cbb4739b4..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/remote/file_detector.pyi +++ /dev/null @@ -1,13 +0,0 @@ -import abc -from typing import Any - -class FileDetector(metaclass=abc.ABCMeta): - __metaclass__: Any - @abc.abstractmethod - def is_local_file(self, *keys): ... - -class UselessFileDetector(FileDetector): - def is_local_file(self, *keys) -> None: ... - -class LocalFileDetector(FileDetector): - def is_local_file(self, *keys): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/remote/mobile.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/remote/mobile.pyi deleted file mode 100644 index 2f05913c3..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/remote/mobile.pyi +++ /dev/null @@ -1,28 +0,0 @@ -from typing import Any - -from .command import Command as Command - -class Mobile: - class ConnectionType: - mask: Any - def __init__(self, mask) -> None: ... - @property - def airplane_mode(self): ... - @property - def wifi(self): ... - @property - def data(self): ... - ALL_NETWORK: Any - WIFI_NETWORK: Any - DATA_NETWORK: Any - AIRPLANE_MODE: Any - def __init__(self, driver) -> None: ... - @property - def network_connection(self): ... - def set_network_connection(self, network): ... - @property - def context(self): ... - @context.setter - def context(self, new_context) -> None: ... - @property - def contexts(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/remote/remote_connection.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/remote/remote_connection.pyi deleted file mode 100644 index 9e6d103fd..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/remote/remote_connection.pyi +++ /dev/null @@ -1,19 +0,0 @@ -from typing import Any - -from .command import Command as Command -from .errorhandler import ErrorCode as ErrorCode - -LOGGER: Any - -class RemoteConnection: - @classmethod - def get_timeout(cls): ... - @classmethod - def set_timeout(cls, timeout) -> None: ... - @classmethod - def reset_timeout(cls) -> None: ... - @classmethod - def get_remote_connection_headers(cls, parsed_url, keep_alive: bool = ...): ... - keep_alive: Any - def __init__(self, remote_server_addr, keep_alive: bool = ..., resolve_ip: bool = ...) -> None: ... - def execute(self, command, params): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/remote/switch_to.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/remote/switch_to.pyi deleted file mode 100644 index 52e8b96fc..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/remote/switch_to.pyi +++ /dev/null @@ -1,22 +0,0 @@ -from selenium.common.exceptions import ( - NoSuchElementException as NoSuchElementException, - NoSuchFrameException as NoSuchFrameException, - NoSuchWindowException as NoSuchWindowException, -) -from selenium.webdriver.common.alert import Alert as Alert -from selenium.webdriver.common.by import By as By - -from .command import Command as Command - -basestring = str - -class SwitchTo: - def __init__(self, driver) -> None: ... - @property - def active_element(self): ... - @property - def alert(self): ... - def default_content(self) -> None: ... - def frame(self, frame_reference) -> None: ... - def parent_frame(self) -> None: ... - def window(self, window_name) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/remote/utils.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/remote/utils.pyi deleted file mode 100644 index d9cea7304..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/remote/utils.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from typing import Any - -LOGGER: Any - -def format_json(json_struct): ... -def dump_json(json_struct): ... -def load_json(s): ... -def unzip_to_temp_dir(zip_file_name): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/remote/webdriver.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/remote/webdriver.pyi deleted file mode 100644 index 2f117cb00..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/remote/webdriver.pyi +++ /dev/null @@ -1,126 +0,0 @@ -from collections.abc import Generator -from typing import Any - -from selenium.common.exceptions import ( - InvalidArgumentException as InvalidArgumentException, - NoSuchCookieException as NoSuchCookieException, - WebDriverException as WebDriverException, -) -from selenium.webdriver.common.by import By as By -from selenium.webdriver.common.html5.application_cache import ApplicationCache as ApplicationCache - -from .command import Command as Command -from .errorhandler import ErrorHandler as ErrorHandler -from .file_detector import FileDetector as FileDetector, LocalFileDetector as LocalFileDetector -from .mobile import Mobile as Mobile -from .remote_connection import RemoteConnection as RemoteConnection -from .switch_to import SwitchTo as SwitchTo -from .webelement import WebElement as WebElement - -class WebDriver: - command_executor: Any - session_id: Any - capabilities: Any - error_handler: Any - def __init__( - self, - command_executor: str | RemoteConnection = ..., - desired_capabilities: Any | None = ..., - browser_profile: Any | None = ..., - proxy: Any | None = ..., - keep_alive: bool = ..., - file_detector: Any | None = ..., - options: Any | None = ..., - ) -> None: ... - def __enter__(self): ... - def __exit__(self, *args) -> None: ... - def file_detector_context(self, file_detector_class, *args, **kwargs) -> Generator[None, None, None]: ... - @property - def mobile(self): ... - @property - def name(self) -> str: ... - def start_client(self) -> None: ... - def stop_client(self) -> None: ... - w3c: Any - def start_session(self, capabilities, browser_profile: Any | None = ...) -> None: ... - def create_web_element(self, element_id) -> WebElement: ... - def execute(self, driver_command, params: Any | None = ...): ... - def get(self, url) -> None: ... - @property - def title(self) -> str: ... - def find_element_by_id(self, id_) -> WebElement: ... - def find_elements_by_id(self, id_) -> list[WebElement]: ... - def find_element_by_xpath(self, xpath) -> WebElement: ... - def find_elements_by_xpath(self, xpath) -> list[WebElement]: ... - def find_element_by_link_text(self, link_text) -> WebElement: ... - def find_elements_by_link_text(self, text) -> list[WebElement]: ... - def find_element_by_partial_link_text(self, link_text) -> WebElement: ... - def find_elements_by_partial_link_text(self, link_text) -> list[WebElement]: ... - def find_element_by_name(self, name) -> WebElement: ... - def find_elements_by_name(self, name) -> list[WebElement]: ... - def find_element_by_tag_name(self, name) -> WebElement: ... - def find_elements_by_tag_name(self, name) -> list[WebElement]: ... - def find_element_by_class_name(self, name) -> WebElement: ... - def find_elements_by_class_name(self, name) -> list[WebElement]: ... - def find_element_by_css_selector(self, css_selector) -> WebElement: ... - def find_elements_by_css_selector(self, css_selector) -> list[WebElement]: ... - def execute_script(self, script, *args): ... - def execute_async_script(self, script, *args): ... - @property - def current_url(self) -> str: ... - @property - def page_source(self) -> str: ... - def close(self) -> None: ... - def quit(self) -> None: ... - @property - def current_window_handle(self) -> str: ... - @property - def window_handles(self) -> list[str]: ... - def maximize_window(self) -> None: ... - def fullscreen_window(self) -> None: ... - def minimize_window(self) -> None: ... - @property - def switch_to(self) -> SwitchTo: ... - def switch_to_active_element(self): ... - def switch_to_window(self, window_name) -> None: ... - def switch_to_frame(self, frame_reference) -> None: ... - def switch_to_default_content(self) -> None: ... - def switch_to_alert(self): ... - def back(self) -> None: ... - def forward(self) -> None: ... - def refresh(self) -> None: ... - def get_cookies(self): ... - def get_cookie(self, name): ... - def delete_cookie(self, name) -> None: ... - def delete_all_cookies(self) -> None: ... - def add_cookie(self, cookie_dict) -> None: ... - def implicitly_wait(self, time_to_wait) -> None: ... - def set_script_timeout(self, time_to_wait) -> None: ... - def set_page_load_timeout(self, time_to_wait) -> None: ... - def find_element(self, by=..., value: Any | None = ...) -> WebElement: ... - def find_elements(self, by=..., value: Any | None = ...) -> list[WebElement]: ... - @property - def desired_capabilities(self): ... - def get_screenshot_as_file(self, filename) -> bool: ... - def save_screenshot(self, filename) -> bool: ... - def get_screenshot_as_png(self) -> bytes: ... - def get_screenshot_as_base64(self) -> str: ... - def set_window_size(self, width, height, windowHandle: str = ...) -> None: ... - def get_window_size(self, windowHandle: str = ...): ... - def set_window_position(self, x, y, windowHandle: str = ...): ... - def get_window_position(self, windowHandle: str = ...): ... - def get_window_rect(self): ... - def set_window_rect(self, x: Any | None = ..., y: Any | None = ..., width: Any | None = ..., height: Any | None = ...): ... - @property - def file_detector(self): ... - @file_detector.setter - def file_detector(self, detector) -> None: ... - @property - def orientation(self): ... - @orientation.setter - def orientation(self, value) -> None: ... - @property - def application_cache(self): ... - @property - def log_types(self): ... - def get_log(self, log_type): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/remote/webelement.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/remote/webelement.pyi deleted file mode 100644 index 8aa477256..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/remote/webelement.pyi +++ /dev/null @@ -1,64 +0,0 @@ -from typing import Any - -from selenium.common.exceptions import WebDriverException as WebDriverException -from selenium.webdriver.common.by import By as By - -from .command import Command as Command - -getAttribute_js: Any -isDisplayed_js: Any - -class WebElement: - def __init__(self, parent, id_, w3c: bool = ...) -> None: ... - @property - def tag_name(self): ... - @property - def text(self): ... - def click(self) -> None: ... - def submit(self) -> None: ... - def clear(self) -> None: ... - def get_property(self, name): ... - def get_attribute(self, name): ... - def is_selected(self): ... - def is_enabled(self): ... - def find_element_by_id(self, id_): ... - def find_elements_by_id(self, id_): ... - def find_element_by_name(self, name): ... - def find_elements_by_name(self, name): ... - def find_element_by_link_text(self, link_text): ... - def find_elements_by_link_text(self, link_text): ... - def find_element_by_partial_link_text(self, link_text): ... - def find_elements_by_partial_link_text(self, link_text): ... - def find_element_by_tag_name(self, name): ... - def find_elements_by_tag_name(self, name): ... - def find_element_by_xpath(self, xpath): ... - def find_elements_by_xpath(self, xpath): ... - def find_element_by_class_name(self, name): ... - def find_elements_by_class_name(self, name): ... - def find_element_by_css_selector(self, css_selector): ... - def find_elements_by_css_selector(self, css_selector): ... - def send_keys(self, *value) -> None: ... - def is_displayed(self): ... - @property - def location_once_scrolled_into_view(self): ... - @property - def size(self): ... - def value_of_css_property(self, property_name): ... - @property - def location(self): ... - @property - def rect(self): ... - @property - def screenshot_as_base64(self): ... - @property - def screenshot_as_png(self): ... - def screenshot(self, filename): ... - @property - def parent(self): ... - @property - def id(self): ... - def __eq__(self, element): ... - def __ne__(self, element): ... - def find_element(self, by=..., value: Any | None = ...): ... - def find_elements(self, by=..., value: Any | None = ...): ... - def __hash__(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/safari/permissions.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/safari/permissions.pyi deleted file mode 100644 index dc83876e0..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/safari/permissions.pyi +++ /dev/null @@ -1,2 +0,0 @@ -class Permission: - GET_USER_MEDIA: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/safari/remote_connection.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/safari/remote_connection.pyi deleted file mode 100644 index ae5623f80..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/safari/remote_connection.pyi +++ /dev/null @@ -1,4 +0,0 @@ -from selenium.webdriver.remote.remote_connection import RemoteConnection as RemoteConnection - -class SafariRemoteConnection(RemoteConnection): - def __init__(self, remote_server_addr, keep_alive: bool = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/safari/service.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/safari/service.pyi deleted file mode 100644 index d45b0525d..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/safari/service.pyi +++ /dev/null @@ -1,11 +0,0 @@ -from typing import Any - -from selenium.webdriver.common import service as service - -class Service(service.Service): - service_args: Any - quiet: Any - def __init__(self, executable_path, port: int = ..., quiet: bool = ..., service_args: Any | None = ...) -> None: ... - def command_line_args(self): ... - @property - def service_url(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/safari/webdriver.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/safari/webdriver.pyi deleted file mode 100644 index 3f9c07b54..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/safari/webdriver.pyi +++ /dev/null @@ -1,25 +0,0 @@ -from typing import Any - -from selenium.common.exceptions import WebDriverException as WebDriverException -from selenium.webdriver.common.desired_capabilities import DesiredCapabilities as DesiredCapabilities -from selenium.webdriver.remote.webdriver import WebDriver as RemoteWebDriver - -from .remote_connection import SafariRemoteConnection as SafariRemoteConnection -from .service import Service as Service - -class WebDriver(RemoteWebDriver): - service: Any - def __init__( - self, - port: int = ..., - executable_path: str = ..., - reuse_service: bool = ..., - desired_capabilities=..., - quiet: bool = ..., - keep_alive: bool = ..., - service_args: Any | None = ..., - ) -> None: ... - def quit(self) -> None: ... - def set_permission(self, permission, value) -> None: ... - def get_permission(self, permission): ... - def debug(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/support/abstract_event_listener.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/support/abstract_event_listener.pyi deleted file mode 100644 index afea81634..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/support/abstract_event_listener.pyi +++ /dev/null @@ -1,20 +0,0 @@ -class AbstractEventListener: - def before_navigate_to(self, url, driver) -> None: ... - def after_navigate_to(self, url, driver) -> None: ... - def before_navigate_back(self, driver) -> None: ... - def after_navigate_back(self, driver) -> None: ... - def before_navigate_forward(self, driver) -> None: ... - def after_navigate_forward(self, driver) -> None: ... - def before_find(self, by, value, driver) -> None: ... - def after_find(self, by, value, driver) -> None: ... - def before_click(self, element, driver) -> None: ... - def after_click(self, element, driver) -> None: ... - def before_change_value_of(self, element, driver) -> None: ... - def after_change_value_of(self, element, driver) -> None: ... - def before_execute_script(self, script, driver) -> None: ... - def after_execute_script(self, script, driver) -> None: ... - def before_close(self, driver) -> None: ... - def after_close(self, driver) -> None: ... - def before_quit(self, driver) -> None: ... - def after_quit(self, driver) -> None: ... - def on_exception(self, exception, driver) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/support/color.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/support/color.pyi deleted file mode 100644 index 48bde3021..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/support/color.pyi +++ /dev/null @@ -1,31 +0,0 @@ -from typing import Any - -RGB_PATTERN: str -RGB_PCT_PATTERN: str -RGBA_PATTERN: str -RGBA_PCT_PATTERN: str -HEX_PATTERN: str -HEX3_PATTERN: str -HSL_PATTERN: str -HSLA_PATTERN: str - -class Color: - match_obj: Any - @staticmethod - def from_string(str_): ... - red: Any - green: Any - blue: Any - alpha: Any - def __init__(self, red, green, blue, alpha: int = ...) -> None: ... - @property - def rgb(self): ... - @property - def rgba(self): ... - @property - def hex(self): ... - def __eq__(self, other): ... - def __ne__(self, other): ... - def __hash__(self): ... - -Colors: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/support/event_firing_webdriver.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/support/event_firing_webdriver.pyi deleted file mode 100644 index 0720d7f3b..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/support/event_firing_webdriver.pyi +++ /dev/null @@ -1,68 +0,0 @@ -from typing import Any - -from selenium.common.exceptions import WebDriverException as WebDriverException -from selenium.webdriver.common.by import By as By -from selenium.webdriver.remote.webdriver import WebDriver as WebDriver -from selenium.webdriver.remote.webelement import WebElement as WebElement - -from .abstract_event_listener import AbstractEventListener as AbstractEventListener - -class EventFiringWebDriver: - def __init__(self, driver, event_listener) -> None: ... - @property - def wrapped_driver(self): ... - def get(self, url) -> None: ... - def back(self) -> None: ... - def forward(self) -> None: ... - def execute_script(self, script, *args): ... - def execute_async_script(self, script, *args): ... - def close(self) -> None: ... - def quit(self) -> None: ... - def find_element(self, by=..., value: Any | None = ...): ... - def find_elements(self, by=..., value: Any | None = ...): ... - def find_element_by_id(self, id_): ... - def find_elements_by_id(self, id_): ... - def find_element_by_xpath(self, xpath): ... - def find_elements_by_xpath(self, xpath): ... - def find_element_by_link_text(self, link_text): ... - def find_elements_by_link_text(self, text): ... - def find_element_by_partial_link_text(self, link_text): ... - def find_elements_by_partial_link_text(self, link_text): ... - def find_element_by_name(self, name): ... - def find_elements_by_name(self, name): ... - def find_element_by_tag_name(self, name): ... - def find_elements_by_tag_name(self, name): ... - def find_element_by_class_name(self, name): ... - def find_elements_by_class_name(self, name): ... - def find_element_by_css_selector(self, css_selector): ... - def find_elements_by_css_selector(self, css_selector): ... - def __setattr__(self, item, value) -> None: ... - def __getattr__(self, name): ... - -class EventFiringWebElement: - def __init__(self, webelement, ef_driver) -> None: ... - @property - def wrapped_element(self): ... - def click(self) -> None: ... - def clear(self) -> None: ... - def send_keys(self, *value) -> None: ... - def find_element(self, by=..., value: Any | None = ...): ... - def find_elements(self, by=..., value: Any | None = ...): ... - def find_element_by_id(self, id_): ... - def find_elements_by_id(self, id_): ... - def find_element_by_name(self, name): ... - def find_elements_by_name(self, name): ... - def find_element_by_link_text(self, link_text): ... - def find_elements_by_link_text(self, link_text): ... - def find_element_by_partial_link_text(self, link_text): ... - def find_elements_by_partial_link_text(self, link_text): ... - def find_element_by_tag_name(self, name): ... - def find_elements_by_tag_name(self, name): ... - def find_element_by_xpath(self, xpath): ... - def find_elements_by_xpath(self, xpath): ... - def find_element_by_class_name(self, name): ... - def find_elements_by_class_name(self, name): ... - def find_element_by_css_selector(self, css_selector): ... - def find_elements_by_css_selector(self, css_selector): ... - def __setattr__(self, item, value) -> None: ... - def __getattr__(self, name): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/support/events.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/support/events.pyi deleted file mode 100644 index 1e3e7dd86..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/support/events.pyi +++ /dev/null @@ -1,2 +0,0 @@ -from .abstract_event_listener import AbstractEventListener as AbstractEventListener -from .event_firing_webdriver import EventFiringWebDriver as EventFiringWebDriver diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/support/expected_conditions.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/support/expected_conditions.pyi deleted file mode 100644 index 642f4015f..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/support/expected_conditions.pyi +++ /dev/null @@ -1,140 +0,0 @@ -from typing import Any - -from selenium.common.exceptions import ( - NoAlertPresentException as NoAlertPresentException, - NoSuchElementException as NoSuchElementException, - NoSuchFrameException as NoSuchFrameException, - StaleElementReferenceException as StaleElementReferenceException, - WebDriverException as WebDriverException, -) -from selenium.webdriver.remote.webdriver import WebElement as WebElement - -class title_is: - title: Any - def __init__(self, title) -> None: ... - def __call__(self, driver): ... - -class title_contains: - title: Any - def __init__(self, title) -> None: ... - def __call__(self, driver): ... - -class presence_of_element_located: - locator: Any - def __init__(self, locator) -> None: ... - def __call__(self, driver): ... - -class url_contains: - url: Any - def __init__(self, url) -> None: ... - def __call__(self, driver): ... - -class url_matches: - pattern: Any - def __init__(self, pattern) -> None: ... - def __call__(self, driver): ... - -class url_to_be: - url: Any - def __init__(self, url) -> None: ... - def __call__(self, driver): ... - -class url_changes: - url: Any - def __init__(self, url) -> None: ... - def __call__(self, driver): ... - -class visibility_of_element_located: - locator: Any - def __init__(self, locator) -> None: ... - def __call__(self, driver): ... - -class visibility_of: - element: Any - def __init__(self, element) -> None: ... - def __call__(self, ignored): ... - -class presence_of_all_elements_located: - locator: Any - def __init__(self, locator) -> None: ... - def __call__(self, driver): ... - -class visibility_of_any_elements_located: - locator: Any - def __init__(self, locator) -> None: ... - def __call__(self, driver): ... - -class visibility_of_all_elements_located: - locator: Any - def __init__(self, locator) -> None: ... - def __call__(self, driver): ... - -class text_to_be_present_in_element: - locator: Any - text: Any - def __init__(self, locator, text_) -> None: ... - def __call__(self, driver): ... - -class text_to_be_present_in_element_value: - locator: Any - text: Any - def __init__(self, locator, text_) -> None: ... - def __call__(self, driver): ... - -class frame_to_be_available_and_switch_to_it: - frame_locator: Any - def __init__(self, locator) -> None: ... - def __call__(self, driver): ... - -class invisibility_of_element_located: - target: Any - def __init__(self, locator) -> None: ... - def __call__(self, driver): ... - -class invisibility_of_element(invisibility_of_element_located): ... - -class element_to_be_clickable: - locator: Any - def __init__(self, locator) -> None: ... - def __call__(self, driver): ... - -class staleness_of: - element: Any - def __init__(self, element) -> None: ... - def __call__(self, ignored): ... - -class element_to_be_selected: - element: Any - def __init__(self, element) -> None: ... - def __call__(self, ignored): ... - -class element_located_to_be_selected: - locator: Any - def __init__(self, locator) -> None: ... - def __call__(self, driver): ... - -class element_selection_state_to_be: - element: Any - is_selected: Any - def __init__(self, element, is_selected) -> None: ... - def __call__(self, ignored): ... - -class element_located_selection_state_to_be: - locator: Any - is_selected: Any - def __init__(self, locator, is_selected) -> None: ... - def __call__(self, driver): ... - -class number_of_windows_to_be: - num_windows: Any - def __init__(self, num_windows) -> None: ... - def __call__(self, driver): ... - -class new_window_is_opened: - current_handles: Any - def __init__(self, current_handles) -> None: ... - def __call__(self, driver): ... - -class alert_is_present: - def __init__(self) -> None: ... - def __call__(self, driver): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/support/select.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/support/select.pyi deleted file mode 100644 index 690656a3b..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/support/select.pyi +++ /dev/null @@ -1,24 +0,0 @@ -from typing import Any - -from selenium.common.exceptions import ( - NoSuchElementException as NoSuchElementException, - UnexpectedTagNameException as UnexpectedTagNameException, -) -from selenium.webdriver.common.by import By as By - -class Select: - is_multiple: Any - def __init__(self, webelement) -> None: ... - @property - def options(self): ... - @property - def all_selected_options(self): ... - @property - def first_selected_option(self): ... - def select_by_value(self, value) -> None: ... - def select_by_index(self, index) -> None: ... - def select_by_visible_text(self, text) -> None: ... - def deselect_all(self) -> None: ... - def deselect_by_value(self, value) -> None: ... - def deselect_by_index(self, index) -> None: ... - def deselect_by_visible_text(self, text) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/support/ui.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/support/ui.pyi deleted file mode 100644 index 5ab0b93a1..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/support/ui.pyi +++ /dev/null @@ -1,2 +0,0 @@ -from .select import Select as Select -from .wait import WebDriverWait as WebDriverWait diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/support/wait.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/support/wait.pyi deleted file mode 100644 index 51063488f..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/support/wait.pyi +++ /dev/null @@ -1,11 +0,0 @@ -from typing import Any - -from selenium.common.exceptions import NoSuchElementException as NoSuchElementException, TimeoutException as TimeoutException - -POLL_FREQUENCY: float -IGNORED_EXCEPTIONS: Any - -class WebDriverWait: - def __init__(self, driver, timeout, poll_frequency=..., ignored_exceptions: Any | None = ...) -> None: ... - def until(self, method, message: str = ...): ... - def until_not(self, method, message: str = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/webkitgtk/options.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/webkitgtk/options.pyi deleted file mode 100644 index 61f298c4e..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/webkitgtk/options.pyi +++ /dev/null @@ -1,18 +0,0 @@ -class Options: - KEY: str - def __init__(self) -> None: ... - @property - def capabilities(self): ... - def set_capability(self, name, value) -> None: ... - @property - def binary_location(self): ... - @binary_location.setter - def binary_location(self, value) -> None: ... - @property - def arguments(self): ... - def add_argument(self, argument) -> None: ... - @property - def overlay_scrollbars_enabled(self): ... - @overlay_scrollbars_enabled.setter - def overlay_scrollbars_enabled(self, value) -> None: ... - def to_capabilities(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/webkitgtk/service.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/webkitgtk/service.pyi deleted file mode 100644 index dc2804fea..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/webkitgtk/service.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from typing import Any - -from selenium.webdriver.common import service as service - -class Service(service.Service): - def __init__(self, executable_path, port: int = ..., log_path: Any | None = ...) -> None: ... - def command_line_args(self): ... - def send_remote_shutdown_command(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/webkitgtk/webdriver.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/webkitgtk/webdriver.pyi deleted file mode 100644 index 4bc5b02c8..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/webkitgtk/webdriver.pyi +++ /dev/null @@ -1,18 +0,0 @@ -from typing import Any - -from selenium.webdriver.remote.webdriver import WebDriver as RemoteWebDriver - -from .service import Service as Service - -class WebDriver(RemoteWebDriver): - service: Any - def __init__( - self, - executable_path: str = ..., - port: int = ..., - options: Any | None = ..., - desired_capabilities=..., - service_log_path: Any | None = ..., - keep_alive: bool = ..., - ) -> None: ... - def quit(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/METADATA.toml index 76178fdcc..d67b34ab7 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/METADATA.toml @@ -1 +1,4 @@ -version = "63.4.*" +version = "67.6.*" + +[tool.stubtest] +ignore_missing_stub = true diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/pkg_resources/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/pkg_resources/__init__.pyi index ceac29f7d..7888500e6 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/pkg_resources/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/pkg_resources/__init__.pyi @@ -1,16 +1,18 @@ import importlib.abc import types import zipimport -from _typeshed import Self +from _typeshed import Incomplete from abc import ABCMeta from collections.abc import Callable, Generator, Iterable, Sequence -from typing import IO, Any, TypeVar, overload -from typing_extensions import TypeAlias +from io import BytesIO +from re import Pattern +from typing import IO, Any, ClassVar, TypeVar, overload +from typing_extensions import Literal, Self, TypeAlias -_LegacyVersion: TypeAlias = Any # from packaging.version -_Version: TypeAlias = Any # from packaging.version +_Version: TypeAlias = Incomplete # from packaging.version _T = TypeVar("_T") +_D = TypeVar("_D", bound=Distribution) _NestedStr: TypeAlias = str | Iterable[str | Iterable[Any]] _InstallerType: TypeAlias = Callable[[Requirement], Distribution | None] _EPDistType: TypeAlias = Distribution | Requirement | str @@ -56,7 +58,7 @@ class Environment: def remove(self, dist: Distribution) -> None: ... def can_add(self, dist: Distribution) -> bool: ... def __add__(self, other: Distribution | Environment) -> Environment: ... - def __iadd__(self: Self, other: Distribution | Environment) -> Self: ... + def __iadd__(self, other: Distribution | Environment) -> Self: ... @overload def best_match(self, req: Requirement, working_set: WorkingSet, *, replace_conflicting: bool = ...) -> Distribution: ... @overload @@ -69,6 +71,10 @@ class Environment: def obtain(self, requirement: Requirement, installer: Callable[[Requirement], _T]) -> _T: ... def scan(self, search_path: Sequence[str] | None = ...) -> None: ... +class DistInfoDistribution(Distribution): + PKG_INFO: ClassVar[Literal["METADATA"]] + EQEQ: ClassVar[Pattern[str]] + def parse_requirements(strs: str | Iterable[str]) -> Generator[Requirement, None, None]: ... class Requirement: @@ -77,9 +83,10 @@ class Requirement: key: str extras: tuple[str, ...] specs: list[tuple[str, str]] + url: str | None # TODO: change this to packaging.markers.Marker | None once we can import # packaging.markers - marker: Any | None + marker: Incomplete | None @staticmethod def parse(s: str | Iterable[str]) -> Requirement: ... def __contains__(self, item: Distribution | str | tuple[str, ...]) -> bool: ... @@ -119,10 +126,13 @@ class EntryPoint: def resolve(self) -> Any: ... def find_distributions(path_item: str, only: bool = ...) -> Generator[Distribution, None, None]: ... -def get_distribution(dist: Requirement | str | Distribution) -> Distribution: ... +@overload +def get_distribution(dist: _D) -> _D: ... +@overload +def get_distribution(dist: _PkgReqType) -> Distribution: ... -class Distribution(IResourceProvider, IMetadataProvider): - PKG_INFO: str +class Distribution(NullProvider, IResourceProvider, IMetadataProvider): + PKG_INFO: ClassVar[str] location: str project_name: str @property @@ -156,7 +166,7 @@ class Distribution(IResourceProvider, IMetadataProvider): def as_requirement(self) -> Requirement: ... def requires(self, extras: tuple[str, ...] = ...) -> list[Requirement]: ... def clone(self, **kw: str | int | None) -> Requirement: ... - def egg_name(self) -> str: ... + def egg_name(self) -> str: ... # type: ignore[override] # supertype's egg_name is a variable, not a method def __cmp__(self, other: Any) -> bool: ... def get_entry_info(self, group: str, name: str) -> EntryPoint | None: ... @overload @@ -199,7 +209,7 @@ def get_provider(package_or_requirement: str) -> IResourceProvider: ... def get_provider(package_or_requirement: Requirement) -> Distribution: ... class IMetadataProvider: - def has_metadata(self, name: str) -> bool: ... + def has_metadata(self, name: str) -> bool | None: ... def metadata_isdir(self, name: str) -> bool: ... def metadata_listdir(self, name: str) -> list[str]: ... def get_metadata(self, name: str) -> str: ... @@ -243,28 +253,59 @@ def register_loader_type(loader_type: type, provider_factory: Callable[[types.Mo def register_namespace_handler(importer_type: type, namespace_handler: _NSHandlerType) -> None: ... class IResourceProvider(IMetadataProvider): ... -class NullProvider: ... -class EggProvider(NullProvider): ... + +class NullProvider: + egg_name: str | None + egg_info: str | None + loader: types._LoaderProtocol | None + module_path: str | None + + def __init__(self, module) -> None: ... + def get_resource_filename(self, manager, resource_name) -> str: ... + def get_resource_stream(self, manager, resource_name) -> BytesIO: ... + def get_resource_string(self, manager, resource_name): ... + def has_resource(self, resource_name) -> bool: ... + def has_metadata(self, name: str) -> bool | None: ... + def get_metadata(self, name: str) -> str: ... + def get_metadata_lines(self, name: str) -> Generator[str, None, None]: ... + def resource_isdir(self, resource_name) -> bool: ... + def metadata_isdir(self, name: str) -> bool: ... + def resource_listdir(self, resource_name) -> list[str]: ... + def metadata_listdir(self, name: str) -> list[str]: ... + def run_script(self, script_name: str, namespace: dict[str, Any]) -> None: ... + +class EggProvider(NullProvider): + egg_root: str + class DefaultProvider(EggProvider): ... class PathMetadata(DefaultProvider, IResourceProvider): + egg_info: str + module_path: str def __init__(self, path: str, egg_info: str) -> None: ... -class ZipProvider(EggProvider): ... +class ZipProvider(EggProvider): + eagers: list[str] | None + zip_pre: str class EggMetadata(ZipProvider, IResourceProvider): + loader: zipimport.zipimporter + module_path: str def __init__(self, zipimporter: zipimport.zipimporter) -> None: ... -class EmptyProvider(NullProvider): ... +class EmptyProvider(NullProvider): + module_path: None + def __init__(self) -> None: ... empty_provider: EmptyProvider class FileMetadata(EmptyProvider, IResourceProvider): def __init__(self, path_to_pkg_info: str) -> None: ... -def parse_version(v: str) -> _Version | _LegacyVersion: ... +parse_version = _Version + def yield_lines(iterable: _NestedStr) -> Generator[str, None, None]: ... -def split_sections(strs: _NestedStr) -> Generator[tuple[str | None, str], None, None]: ... +def split_sections(strs: _NestedStr) -> Generator[tuple[str | None, list[str]], None, None]: ... def safe_name(name: str) -> str: ... def safe_version(version: str) -> str: ... def safe_extra(extra: str) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/pkg_resources/py31compat.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/pkg_resources/py31compat.pyi deleted file mode 100644 index 162da65e0..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/pkg_resources/py31compat.pyi +++ /dev/null @@ -1,5 +0,0 @@ -import os - -needs_makedirs: bool - -makedirs = os.makedirs diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/__init__.pyi index bc712d21a..3111dd680 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/__init__.pyi @@ -1,6 +1,5 @@ from abc import abstractmethod -from collections.abc import Iterable, Mapping -from distutils.core import Command as _Command +from collections.abc import Iterable, Mapping, Sequence from typing import Any from setuptools._deprecation_warning import SetuptoolsDeprecationWarning as SetuptoolsDeprecationWarning @@ -8,6 +7,8 @@ from setuptools.depends import Require as Require from setuptools.dist import Distribution as Distribution from setuptools.extension import Extension as Extension +from ._distutils.cmd import Command as _Command + __version__: str class PackageFinder: @@ -34,7 +35,7 @@ def setup( packages: list[str] = ..., py_modules: list[str] = ..., scripts: list[str] = ..., - ext_modules: list[Extension] = ..., + ext_modules: Sequence[Extension] = ..., classifiers: list[str] = ..., distclass: type[Distribution] = ..., script_name: str = ..., diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/archive_util.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/archive_util.pyi deleted file mode 100644 index 38458fc0e..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/archive_util.pyi +++ /dev/null @@ -1,20 +0,0 @@ -def make_archive( - base_name: str, - format: str, - root_dir: str | None = ..., - base_dir: str | None = ..., - verbose: int = ..., - dry_run: int = ..., - owner: str | None = ..., - group: str | None = ..., -) -> str: ... -def make_tarball( - base_name: str, - base_dir: str, - compress: str | None = ..., - verbose: int = ..., - dry_run: int = ..., - owner: str | None = ..., - group: str | None = ..., -) -> str: ... -def make_zipfile(base_name: str, base_dir: str, verbose: int = ..., dry_run: int = ...) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/bcppcompiler.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/bcppcompiler.pyi deleted file mode 100644 index 3e432f94b..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/bcppcompiler.pyi +++ /dev/null @@ -1,3 +0,0 @@ -from distutils.ccompiler import CCompiler - -class BCPPCompiler(CCompiler): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/ccompiler.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/ccompiler.pyi deleted file mode 100644 index 5b92c5f5c..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/ccompiler.pyi +++ /dev/null @@ -1,152 +0,0 @@ -from collections.abc import Callable -from typing import Any, Union -from typing_extensions import TypeAlias - -_Macro: TypeAlias = Union[tuple[str], tuple[str, str | None]] - -def gen_lib_options( - compiler: CCompiler, library_dirs: list[str], runtime_library_dirs: list[str], libraries: list[str] -) -> list[str]: ... -def gen_preprocess_options(macros: list[_Macro], include_dirs: list[str]) -> list[str]: ... -def get_default_compiler(osname: str | None = ..., platform: str | None = ...) -> str: ... -def new_compiler( - plat: str | None = ..., compiler: str | None = ..., verbose: int = ..., dry_run: int = ..., force: int = ... -) -> CCompiler: ... -def show_compilers() -> None: ... - -class CCompiler: - dry_run: bool - force: bool - verbose: bool - output_dir: str | None - macros: list[_Macro] - include_dirs: list[str] - libraries: list[str] - library_dirs: list[str] - runtime_library_dirs: list[str] - objects: list[str] - def __init__(self, verbose: int = ..., dry_run: int = ..., force: int = ...) -> None: ... - def add_include_dir(self, dir: str) -> None: ... - def set_include_dirs(self, dirs: list[str]) -> None: ... - def add_library(self, libname: str) -> None: ... - def set_libraries(self, libnames: list[str]) -> None: ... - def add_library_dir(self, dir: str) -> None: ... - def set_library_dirs(self, dirs: list[str]) -> None: ... - def add_runtime_library_dir(self, dir: str) -> None: ... - def set_runtime_library_dirs(self, dirs: list[str]) -> None: ... - def define_macro(self, name: str, value: str | None = ...) -> None: ... - def undefine_macro(self, name: str) -> None: ... - def add_link_object(self, object: str) -> None: ... - def set_link_objects(self, objects: list[str]) -> None: ... - def detect_language(self, sources: str | list[str]) -> str | None: ... - def find_library_file(self, dirs: list[str], lib: str, debug: bool = ...) -> str | None: ... - def has_function( - self, - funcname: str, - includes: list[str] | None = ..., - include_dirs: list[str] | None = ..., - libraries: list[str] | None = ..., - library_dirs: list[str] | None = ..., - ) -> bool: ... - def library_dir_option(self, dir: str) -> str: ... - def library_option(self, lib: str) -> str: ... - def runtime_library_dir_option(self, dir: str) -> str: ... - def set_executables(self, **args: str) -> None: ... - def compile( - self, - sources: list[str], - output_dir: str | None = ..., - macros: _Macro | None = ..., - include_dirs: list[str] | None = ..., - debug: bool = ..., - extra_preargs: list[str] | None = ..., - extra_postargs: list[str] | None = ..., - depends: list[str] | None = ..., - ) -> list[str]: ... - def create_static_lib( - self, - objects: list[str], - output_libname: str, - output_dir: str | None = ..., - debug: bool = ..., - target_lang: str | None = ..., - ) -> None: ... - def link( - self, - target_desc: str, - objects: list[str], - output_filename: str, - output_dir: str | None = ..., - libraries: list[str] | None = ..., - library_dirs: list[str] | None = ..., - runtime_library_dirs: list[str] | None = ..., - export_symbols: list[str] | None = ..., - debug: bool = ..., - extra_preargs: list[str] | None = ..., - extra_postargs: list[str] | None = ..., - build_temp: str | None = ..., - target_lang: str | None = ..., - ) -> None: ... - def link_executable( - self, - objects: list[str], - output_progname: str, - output_dir: str | None = ..., - libraries: list[str] | None = ..., - library_dirs: list[str] | None = ..., - runtime_library_dirs: list[str] | None = ..., - debug: bool = ..., - extra_preargs: list[str] | None = ..., - extra_postargs: list[str] | None = ..., - target_lang: str | None = ..., - ) -> None: ... - def link_shared_lib( - self, - objects: list[str], - output_libname: str, - output_dir: str | None = ..., - libraries: list[str] | None = ..., - library_dirs: list[str] | None = ..., - runtime_library_dirs: list[str] | None = ..., - export_symbols: list[str] | None = ..., - debug: bool = ..., - extra_preargs: list[str] | None = ..., - extra_postargs: list[str] | None = ..., - build_temp: str | None = ..., - target_lang: str | None = ..., - ) -> None: ... - def link_shared_object( - self, - objects: list[str], - output_filename: str, - output_dir: str | None = ..., - libraries: list[str] | None = ..., - library_dirs: list[str] | None = ..., - runtime_library_dirs: list[str] | None = ..., - export_symbols: list[str] | None = ..., - debug: bool = ..., - extra_preargs: list[str] | None = ..., - extra_postargs: list[str] | None = ..., - build_temp: str | None = ..., - target_lang: str | None = ..., - ) -> None: ... - def preprocess( - self, - source: str, - output_file: str | None = ..., - macros: list[_Macro] | None = ..., - include_dirs: list[str] | None = ..., - extra_preargs: list[str] | None = ..., - extra_postargs: list[str] | None = ..., - ) -> None: ... - def executable_filename(self, basename: str, strip_dir: int = ..., output_dir: str = ...) -> str: ... - def library_filename(self, libname: str, lib_type: str = ..., strip_dir: int = ..., output_dir: str = ...) -> str: ... - def object_filenames(self, source_filenames: list[str], strip_dir: int = ..., output_dir: str = ...) -> list[str]: ... - def shared_object_filename(self, basename: str, strip_dir: int = ..., output_dir: str = ...) -> str: ... - def execute(self, func: Callable[..., object], args: tuple[Any, ...], msg: str | None = ..., level: int = ...) -> None: ... - def spawn(self, cmd: list[str]) -> None: ... - def mkpath(self, name: str, mode: int = ...) -> None: ... - def move_file(self, src: str, dst: str) -> str: ... - def announce(self, msg: str, level: int = ...) -> None: ... - def warn(self, msg: str) -> None: ... - def debug_print(self, msg: str) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/cmd.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/cmd.pyi index e706bdbc5..3c05f2680 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/cmd.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/cmd.pyi @@ -1,10 +1,14 @@ +from _typeshed import Incomplete from abc import abstractmethod from collections.abc import Callable, Iterable -from distutils.dist import Distribution -from typing import Any +from typing import ClassVar +from typing_extensions import Self + +from .dist import Distribution class Command: - sub_commands: list[tuple[str, Callable[[Command], bool] | None]] + distribution: Distribution + sub_commands: ClassVar[list[tuple[str, Callable[[Self], bool] | None]]] def __init__(self, dist: Distribution) -> None: ... @abstractmethod def initialize_options(self) -> None: ... @@ -25,7 +29,9 @@ class Command: def run_command(self, command: str) -> None: ... def get_sub_commands(self) -> list[str]: ... def warn(self, msg: str) -> None: ... - def execute(self, func: Callable[..., object], args: Iterable[Any], msg: str | None = ..., level: int = ...) -> None: ... + def execute( + self, func: Callable[..., object], args: Iterable[Incomplete], msg: str | None = ..., level: int = ... + ) -> None: ... def mkpath(self, name: str, mode: int = ...) -> None: ... def copy_file( self, @@ -34,7 +40,7 @@ class Command: preserve_mode: int = ..., preserve_times: int = ..., link: str | None = ..., - level: Any = ..., + level: int = ..., ) -> tuple[str, bool]: ... # level is not used def copy_tree( self, @@ -43,10 +49,10 @@ class Command: preserve_mode: int = ..., preserve_times: int = ..., preserve_symlinks: int = ..., - level: Any = ..., + level: int = ..., ) -> list[str]: ... # level is not used - def move_file(self, src: str, dst: str, level: Any = ...) -> str: ... # level is not used - def spawn(self, cmd: Iterable[str], search_path: int = ..., level: Any = ...) -> None: ... # level is not used + def move_file(self, src: str, dst: str, level: int = ...) -> str: ... # level is not used + def spawn(self, cmd: Iterable[str], search_path: int = ..., level: int = ...) -> None: ... # level is not used def make_archive( self, base_name: str, @@ -61,8 +67,8 @@ class Command: infiles: str | list[str] | tuple[str, ...], outfile: str, func: Callable[..., object], - args: list[Any], + args: list[Incomplete], exec_msg: str | None = ..., skip_msg: str | None = ..., - level: Any = ..., + level: int = ..., ) -> None: ... # level is not used diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/bdist.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/bdist.pyi deleted file mode 100644 index e1f141d3a..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/bdist.pyi +++ /dev/null @@ -1,25 +0,0 @@ -from typing import Any - -from ..cmd import Command - -def show_formats() -> None: ... - -class bdist(Command): - description: str - user_options: Any - boolean_options: Any - help_options: Any - no_format_option: Any - default_format: Any - format_commands: Any - format_command: Any - bdist_base: Any - plat_name: Any - formats: Any - dist_dir: Any - skip_build: int - group: Any - owner: Any - def initialize_options(self) -> None: ... - def finalize_options(self) -> None: ... - def run(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/bdist_dumb.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/bdist_dumb.pyi deleted file mode 100644 index 74cca4d13..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/bdist_dumb.pyi +++ /dev/null @@ -1,21 +0,0 @@ -from typing import Any - -from ..cmd import Command - -class bdist_dumb(Command): - description: str - user_options: Any - boolean_options: Any - default_format: Any - bdist_dir: Any - plat_name: Any - format: Any - keep_temp: int - dist_dir: Any - skip_build: Any - relative: int - owner: Any - group: Any - def initialize_options(self) -> None: ... - def finalize_options(self) -> None: ... - def run(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/bdist_msi.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/bdist_msi.pyi deleted file mode 100644 index 66202e841..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/bdist_msi.pyi +++ /dev/null @@ -1,45 +0,0 @@ -import sys -from typing import Any - -from ..cmd import Command - -if sys.platform == "win32": - from msilib import Dialog - - class PyDialog(Dialog): - def __init__(self, *args, **kw) -> None: ... - def title(self, title) -> None: ... - def back(self, title, next, name: str = ..., active: int = ...): ... - def cancel(self, title, next, name: str = ..., active: int = ...): ... - def next(self, title, next, name: str = ..., active: int = ...): ... - def xbutton(self, name, title, next, xpos): ... - - class bdist_msi(Command): - description: str - user_options: Any - boolean_options: Any - all_versions: Any - other_version: str - if sys.version_info >= (3, 9): - def __init__(self, *args, **kw) -> None: ... - bdist_dir: Any - plat_name: Any - keep_temp: int - no_target_compile: int - no_target_optimize: int - target_version: Any - dist_dir: Any - skip_build: Any - install_script: Any - pre_install_script: Any - versions: Any - def initialize_options(self) -> None: ... - install_script_key: Any - def finalize_options(self) -> None: ... - db: Any - def run(self) -> None: ... - def add_files(self) -> None: ... - def add_find_python(self) -> None: ... - def add_scripts(self) -> None: ... - def add_ui(self) -> None: ... - def get_installer_filename(self, fullname): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/bdist_rpm.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/bdist_rpm.pyi deleted file mode 100644 index 76691310b..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/bdist_rpm.pyi +++ /dev/null @@ -1,52 +0,0 @@ -from typing import Any - -from ..cmd import Command - -class bdist_rpm(Command): - description: str - user_options: Any - boolean_options: Any - negative_opt: Any - bdist_base: Any - rpm_base: Any - dist_dir: Any - python: Any - fix_python: Any - spec_only: Any - binary_only: Any - source_only: Any - use_bzip2: Any - distribution_name: Any - group: Any - release: Any - serial: Any - vendor: Any - packager: Any - doc_files: Any - changelog: Any - icon: Any - prep_script: Any - build_script: Any - install_script: Any - clean_script: Any - verify_script: Any - pre_install: Any - post_install: Any - pre_uninstall: Any - post_uninstall: Any - prep: Any - provides: Any - requires: Any - conflicts: Any - build_requires: Any - obsoletes: Any - keep_temp: int - use_rpm_opt_flags: int - rpm3_mode: int - no_autoreq: int - force_arch: Any - quiet: int - def initialize_options(self) -> None: ... - def finalize_options(self) -> None: ... - def finalize_package_data(self) -> None: ... - def run(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/bdist_wininst.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/bdist_wininst.pyi deleted file mode 100644 index 1091fb278..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/bdist_wininst.pyi +++ /dev/null @@ -1,16 +0,0 @@ -from _typeshed import StrOrBytesPath -from distutils.cmd import Command -from typing import Any, ClassVar - -class bdist_wininst(Command): - description: ClassVar[str] - user_options: ClassVar[list[tuple[Any, ...]]] - boolean_options: ClassVar[list[str]] - - def initialize_options(self) -> None: ... - def finalize_options(self) -> None: ... - def run(self) -> None: ... - def get_inidata(self) -> str: ... - def create_exe(self, arcname: StrOrBytesPath, fullname: str, bitmap: StrOrBytesPath | None = ...) -> None: ... - def get_installer_filename(self, fullname: str) -> str: ... - def get_exe_bytes(self) -> bytes: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/build.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/build.pyi deleted file mode 100644 index cf3c8a562..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/build.pyi +++ /dev/null @@ -1,31 +0,0 @@ -from typing import Any - -from ..cmd import Command - -def show_compilers() -> None: ... - -class build(Command): - description: str - user_options: Any - boolean_options: Any - help_options: Any - build_base: str - build_purelib: Any - build_platlib: Any - build_lib: Any - build_temp: Any - build_scripts: Any - compiler: Any - plat_name: Any - debug: Any - force: int - executable: Any - parallel: Any - def initialize_options(self) -> None: ... - def finalize_options(self) -> None: ... - def run(self) -> None: ... - def has_pure_modules(self): ... - def has_c_libraries(self): ... - def has_ext_modules(self): ... - def has_scripts(self): ... - sub_commands: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/build_clib.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/build_clib.pyi index 32ab182b3..5a9b049ad 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/build_clib.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/build_clib.pyi @@ -1,23 +1,21 @@ -from typing import Any +from _typeshed import Incomplete from ..cmd import Command -def show_compilers() -> None: ... - class build_clib(Command): description: str - user_options: Any - boolean_options: Any - help_options: Any - build_clib: Any - build_temp: Any - libraries: Any - include_dirs: Any - define: Any - undef: Any - debug: Any + user_options: Incomplete + boolean_options: Incomplete + help_options: Incomplete + build_clib: Incomplete + build_temp: Incomplete + libraries: Incomplete + include_dirs: Incomplete + define: Incomplete + undef: Incomplete + debug: Incomplete force: int - compiler: Any + compiler: Incomplete def initialize_options(self) -> None: ... def finalize_options(self) -> None: ... def run(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/build_ext.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/build_ext.pyi index 80cd78936..dfdfe4427 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/build_ext.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/build_ext.pyi @@ -1,38 +1,34 @@ -from typing import Any +from _typeshed import Incomplete from ..cmd import Command -extension_name_re: Any - -def show_compilers() -> None: ... - class build_ext(Command): description: str - sep_by: Any - user_options: Any - boolean_options: Any - help_options: Any - extensions: Any - build_lib: Any - plat_name: Any - build_temp: Any + sep_by: Incomplete + user_options: Incomplete + boolean_options: Incomplete + help_options: Incomplete + extensions: Incomplete + build_lib: Incomplete + plat_name: Incomplete + build_temp: Incomplete inplace: int - package: Any - include_dirs: Any - define: Any - undef: Any - libraries: Any - library_dirs: Any - rpath: Any - link_objects: Any - debug: Any - force: Any - compiler: Any - swig: Any - swig_cpp: Any - swig_opts: Any - user: Any - parallel: Any + package: Incomplete + include_dirs: Incomplete + define: Incomplete + undef: Incomplete + libraries: Incomplete + library_dirs: Incomplete + rpath: Incomplete + link_objects: Incomplete + debug: Incomplete + force: Incomplete + compiler: Incomplete + swig: Incomplete + swig_cpp: Incomplete + swig_opts: Incomplete + user: Incomplete + parallel: Incomplete def initialize_options(self) -> None: ... def finalize_options(self) -> None: ... def run(self) -> None: ... @@ -43,8 +39,8 @@ class build_ext(Command): def build_extension(self, ext) -> None: ... def swig_sources(self, sources, extension): ... def find_swig(self): ... - def get_ext_fullpath(self, ext_name): ... - def get_ext_fullname(self, ext_name): ... - def get_ext_filename(self, ext_name): ... + def get_ext_fullpath(self, ext_name: str) -> str: ... + def get_ext_fullname(self, ext_name: str) -> str: ... + def get_ext_filename(self, ext_name: str) -> str: ... def get_export_symbols(self, ext): ... def get_libraries(self, ext): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/build_py.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/build_py.pyi index f4803e30e..b5bada633 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/build_py.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/build_py.pyi @@ -1,23 +1,23 @@ -from typing import Any +from _typeshed import Incomplete from ..cmd import Command class build_py(Command): description: str - user_options: Any - boolean_options: Any - negative_opt: Any - build_lib: Any - py_modules: Any - package: Any - package_data: Any - package_dir: Any + user_options: Incomplete + boolean_options: Incomplete + negative_opt: Incomplete + build_lib: Incomplete + py_modules: Incomplete + package: Incomplete + package_data: Incomplete + package_dir: Incomplete compile: int optimize: int - force: Any + force: Incomplete def initialize_options(self) -> None: ... - packages: Any - data_files: Any + packages: Incomplete + data_files: Incomplete def finalize_options(self) -> None: ... def run(self) -> None: ... def get_data_files(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/build_scripts.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/build_scripts.pyi deleted file mode 100644 index 9ce9d7b85..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/build_scripts.pyi +++ /dev/null @@ -1,21 +0,0 @@ -from re import Pattern -from typing import Any - -from ..cmd import Command - -first_line_re: Pattern[str] - -class build_scripts(Command): - description: str - user_options: Any - boolean_options: Any - build_dir: Any - scripts: Any - force: Any - executable: Any - outfiles: Any - def initialize_options(self) -> None: ... - def finalize_options(self) -> None: ... - def get_source_files(self): ... - def run(self) -> None: ... - def copy_scripts(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/check.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/check.pyi deleted file mode 100644 index cdbe40fff..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/check.pyi +++ /dev/null @@ -1,37 +0,0 @@ -from typing import Any -from typing_extensions import TypeAlias - -from ..cmd import Command - -_Reporter: TypeAlias = Any # really docutils.utils.Reporter - -# Only defined if docutils is installed. -class SilentReporter(_Reporter): - messages: Any - def __init__( - self, - source, - report_level, - halt_level, - stream: Any | None = ..., - debug: int = ..., - encoding: str = ..., - error_handler: str = ..., - ) -> None: ... - def system_message(self, level, message, *children, **kwargs): ... - -HAS_DOCUTILS: bool - -class check(Command): - description: str - user_options: Any - boolean_options: Any - restructuredtext: int - metadata: int - strict: int - def initialize_options(self) -> None: ... - def finalize_options(self) -> None: ... - def warn(self, msg): ... - def run(self) -> None: ... - def check_metadata(self) -> None: ... - def check_restructuredtext(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/clean.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/clean.pyi deleted file mode 100644 index 99560aa8a..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/clean.pyi +++ /dev/null @@ -1,17 +0,0 @@ -from typing import Any - -from ..cmd import Command - -class clean(Command): - description: str - user_options: Any - boolean_options: Any - build_base: Any - build_lib: Any - build_temp: Any - build_scripts: Any - bdist_base: Any - all: Any - def initialize_options(self) -> None: ... - def finalize_options(self) -> None: ... - def run(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/config.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/config.pyi deleted file mode 100644 index 03466ca72..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/config.pyi +++ /dev/null @@ -1,83 +0,0 @@ -from collections.abc import Sequence -from re import Pattern -from typing import Any - -from ..ccompiler import CCompiler -from ..cmd import Command - -LANG_EXT: dict[str, str] - -class config(Command): - description: str - # Tuple is full name, short name, description - user_options: Sequence[tuple[str, str | None, str]] - compiler: str | CCompiler - cc: str | None - include_dirs: Sequence[str] | None - libraries: Sequence[str] | None - library_dirs: Sequence[str] | None - noisy: int - dump_source: int - temp_files: Sequence[str] - def initialize_options(self) -> None: ... - def finalize_options(self) -> None: ... - def run(self) -> None: ... - def try_cpp( - self, - body: str | None = ..., - headers: Sequence[str] | None = ..., - include_dirs: Sequence[str] | None = ..., - lang: str = ..., - ) -> bool: ... - def search_cpp( - self, - pattern: Pattern[str] | str, - body: str | None = ..., - headers: Sequence[str] | None = ..., - include_dirs: Sequence[str] | None = ..., - lang: str = ..., - ) -> bool: ... - def try_compile( - self, body: str, headers: Sequence[str] | None = ..., include_dirs: Sequence[str] | None = ..., lang: str = ... - ) -> bool: ... - def try_link( - self, - body: str, - headers: Sequence[str] | None = ..., - include_dirs: Sequence[str] | None = ..., - libraries: Sequence[str] | None = ..., - library_dirs: Sequence[str] | None = ..., - lang: str = ..., - ) -> bool: ... - def try_run( - self, - body: str, - headers: Sequence[str] | None = ..., - include_dirs: Sequence[str] | None = ..., - libraries: Sequence[str] | None = ..., - library_dirs: Sequence[str] | None = ..., - lang: str = ..., - ) -> bool: ... - def check_func( - self, - func: str, - headers: Sequence[str] | None = ..., - include_dirs: Sequence[str] | None = ..., - libraries: Sequence[str] | None = ..., - library_dirs: Sequence[str] | None = ..., - decl: int = ..., - call: int = ..., - ) -> bool: ... - def check_lib( - self, - library: str, - library_dirs: Sequence[str] | None = ..., - headers: Sequence[str] | None = ..., - include_dirs: Sequence[str] | None = ..., - other_libraries: list[str] = ..., - ) -> bool: ... - def check_header( - self, header: str, include_dirs: Sequence[str] | None = ..., library_dirs: Sequence[str] | None = ..., lang: str = ... - ) -> bool: ... - -def dump_file(filename: str, head: Any | None = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/install.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/install.pyi index 661d256e6..44f557e58 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/install.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/install.pyi @@ -1,44 +1,40 @@ -from typing import Any +from _typeshed import Incomplete from ..cmd import Command -HAS_USER_SITE: bool -SCHEME_KEYS: tuple[str, ...] -INSTALL_SCHEMES: dict[str, dict[Any, Any]] - class install(Command): description: str - user_options: Any - boolean_options: Any - negative_opt: Any + user_options: Incomplete + boolean_options: Incomplete + negative_opt: Incomplete prefix: str | None - exec_prefix: Any + exec_prefix: Incomplete home: str | None user: bool - install_base: Any - install_platbase: Any + install_base: Incomplete + install_platbase: Incomplete root: str | None - install_purelib: Any - install_platlib: Any - install_headers: Any + install_purelib: Incomplete + install_platlib: Incomplete + install_headers: Incomplete install_lib: str | None - install_scripts: Any - install_data: Any - install_userbase: Any - install_usersite: Any - compile: Any - optimize: Any - extra_path: Any + install_scripts: Incomplete + install_data: Incomplete + install_userbase: Incomplete + install_usersite: Incomplete + compile: Incomplete + optimize: Incomplete + extra_path: Incomplete install_path_file: int force: int skip_build: int warn_dir: int - build_base: Any - build_lib: Any - record: Any + build_base: Incomplete + build_lib: Incomplete + record: Incomplete def initialize_options(self) -> None: ... - config_vars: Any - install_libbase: Any + config_vars: Incomplete + install_libbase: Incomplete def finalize_options(self) -> None: ... def dump_dirs(self, msg) -> None: ... def finalize_unix(self) -> None: ... @@ -47,8 +43,8 @@ class install(Command): def expand_basedirs(self) -> None: ... def expand_dirs(self) -> None: ... def convert_paths(self, *names) -> None: ... - path_file: Any - extra_dirs: Any + path_file: Incomplete + extra_dirs: Incomplete def handle_extra_path(self) -> None: ... def change_roots(self, *names) -> None: ... def create_home_path(self) -> None: ... @@ -60,4 +56,3 @@ class install(Command): def has_headers(self): ... def has_scripts(self): ... def has_data(self): ... - sub_commands: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/install_data.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/install_data.pyi deleted file mode 100644 index 6cc9b528a..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/install_data.pyi +++ /dev/null @@ -1,19 +0,0 @@ -from typing import Any - -from ..cmd import Command - -class install_data(Command): - description: str - user_options: Any - boolean_options: Any - install_dir: Any - outfiles: Any - root: Any - force: int - data_files: Any - warn_dir: int - def initialize_options(self) -> None: ... - def finalize_options(self) -> None: ... - def run(self) -> None: ... - def get_inputs(self): ... - def get_outputs(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/install_egg_info.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/install_egg_info.pyi deleted file mode 100644 index 776eafc1d..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/install_egg_info.pyi +++ /dev/null @@ -1,18 +0,0 @@ -from typing import Any, ClassVar - -from ..cmd import Command - -class install_egg_info(Command): - description: ClassVar[str] - user_options: ClassVar[list[tuple[str, str | None, str]]] - install_dir: Any - def initialize_options(self) -> None: ... - target: Any - outputs: Any - def finalize_options(self) -> None: ... - def run(self) -> None: ... - def get_outputs(self) -> list[str]: ... - -def safe_name(name): ... -def safe_version(version): ... -def to_filename(name): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/install_headers.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/install_headers.pyi deleted file mode 100644 index 795bd1cf8..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/install_headers.pyi +++ /dev/null @@ -1,16 +0,0 @@ -from typing import Any - -from ..cmd import Command - -class install_headers(Command): - description: str - user_options: Any - boolean_options: Any - install_dir: Any - force: int - outfiles: Any - def initialize_options(self) -> None: ... - def finalize_options(self) -> None: ... - def run(self) -> None: ... - def get_inputs(self): ... - def get_outputs(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/install_lib.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/install_lib.pyi index a6a5e4e73..dee5fbdf6 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/install_lib.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/install_lib.pyi @@ -1,20 +1,18 @@ -from typing import Any +from _typeshed import Incomplete from ..cmd import Command -PYTHON_SOURCE_EXTENSION: str - class install_lib(Command): description: str - user_options: Any - boolean_options: Any - negative_opt: Any - install_dir: Any - build_dir: Any + user_options: Incomplete + boolean_options: Incomplete + negative_opt: Incomplete + install_dir: Incomplete + build_dir: Incomplete force: int - compile: Any - optimize: Any - skip_build: Any + compile: Incomplete + optimize: Incomplete + skip_build: Incomplete def initialize_options(self) -> None: ... def finalize_options(self) -> None: ... def run(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/install_scripts.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/install_scripts.pyi index 92728a16a..f57fcf890 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/install_scripts.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/install_scripts.pyi @@ -1,18 +1,18 @@ -from typing import Any +from _typeshed import Incomplete from ..cmd import Command class install_scripts(Command): description: str - user_options: Any - boolean_options: Any - install_dir: Any + user_options: Incomplete + boolean_options: Incomplete + install_dir: Incomplete force: int - build_dir: Any - skip_build: Any + build_dir: Incomplete + skip_build: Incomplete def initialize_options(self) -> None: ... def finalize_options(self) -> None: ... - outfiles: Any + outfiles: Incomplete def run(self) -> None: ... def get_inputs(self): ... def get_outputs(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/py37compat.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/py37compat.pyi deleted file mode 100644 index 9d921db3d..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/py37compat.pyi +++ /dev/null @@ -1,5 +0,0 @@ -from _typeshed import Incomplete - -def compose(f1, f2): ... - -pythonlib: Incomplete diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/register.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/register.pyi index a1a7a45fb..891d6a2a5 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/register.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/register.pyi @@ -1,10 +1,9 @@ -from typing import Any +from _typeshed import Incomplete from ..config import PyPIRCCommand class register(PyPIRCCommand): description: str - sub_commands: Any list_classifiers: int strict: int def initialize_options(self) -> None: ... @@ -15,4 +14,4 @@ class register(PyPIRCCommand): def verify_metadata(self) -> None: ... def send_metadata(self) -> None: ... def build_post_data(self, action): ... - def post_to_server(self, data, auth: Any | None = ...): ... + def post_to_server(self, data, auth: Incomplete | None = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/sdist.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/sdist.pyi index 636c4a351..b724561ef 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/sdist.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/sdist.pyi @@ -1,34 +1,31 @@ -from typing import Any +from _typeshed import Incomplete from ..cmd import Command -def show_formats() -> None: ... - class sdist(Command): description: str def checking_metadata(self): ... - user_options: Any - boolean_options: Any - help_options: Any - negative_opt: Any - sub_commands: Any - READMES: Any - template: Any - manifest: Any + user_options: Incomplete + boolean_options: Incomplete + help_options: Incomplete + negative_opt: Incomplete + READMES: Incomplete + template: Incomplete + manifest: Incomplete use_defaults: int prune: int manifest_only: int force_manifest: int - formats: Any + formats: Incomplete keep_temp: int - dist_dir: Any - archive_files: Any + dist_dir: Incomplete + archive_files: Incomplete metadata_check: int - owner: Any - group: Any + owner: Incomplete + group: Incomplete def initialize_options(self) -> None: ... def finalize_options(self) -> None: ... - filelist: Any + filelist: Incomplete def run(self) -> None: ... def check_metadata(self) -> None: ... def get_file_list(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/upload.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/upload.pyi index e6b77825c..afcfbaf48 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/upload.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/upload.pyi @@ -1,4 +1,5 @@ -from typing import Any, ClassVar +from _typeshed import Incomplete +from typing import ClassVar from ..config import PyPIRCCommand @@ -8,10 +9,10 @@ class upload(PyPIRCCommand): password: str show_response: int sign: bool - identity: Any + identity: Incomplete def initialize_options(self) -> None: ... - repository: Any - realm: Any + repository: Incomplete + realm: Incomplete def finalize_options(self) -> None: ... def run(self) -> None: ... def upload_file(self, command: str, pyversion: str, filename: str) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/config.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/config.pyi index 5814a8284..4dfa5e97f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/config.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/config.pyi @@ -1,8 +1,7 @@ from abc import abstractmethod -from distutils.cmd import Command from typing import ClassVar -DEFAULT_PYPIRC: str +from .cmd import Command class PyPIRCCommand(Command): DEFAULT_REPOSITORY: ClassVar[str] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/core.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/core.pyi deleted file mode 100644 index 199a4d70a..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/core.pyi +++ /dev/null @@ -1,49 +0,0 @@ -from collections.abc import Mapping -from distutils.cmd import Command as Command -from distutils.dist import Distribution as Distribution -from distutils.extension import Extension as Extension -from typing import Any - -def setup( - *, - name: str = ..., - version: str = ..., - description: str = ..., - long_description: str = ..., - author: str = ..., - author_email: str = ..., - maintainer: str = ..., - maintainer_email: str = ..., - url: str = ..., - download_url: str = ..., - packages: list[str] = ..., - py_modules: list[str] = ..., - scripts: list[str] = ..., - ext_modules: list[Extension] = ..., - classifiers: list[str] = ..., - distclass: type[Distribution] = ..., - script_name: str = ..., - script_args: list[str] = ..., - options: Mapping[str, Any] = ..., - license: str = ..., - keywords: list[str] | str = ..., - platforms: list[str] | str = ..., - cmdclass: Mapping[str, type[Command]] = ..., - data_files: list[tuple[str, list[str]]] = ..., - package_dir: Mapping[str, str] = ..., - obsoletes: list[str] = ..., - provides: list[str] = ..., - requires: list[str] = ..., - command_packages: list[str] = ..., - command_options: Mapping[str, Mapping[str, tuple[Any, Any]]] = ..., - package_data: Mapping[str, list[str]] = ..., - include_package_data: bool = ..., - libraries: list[str] = ..., - headers: list[str] = ..., - ext_package: str = ..., - include_dirs: list[str] = ..., - password: str = ..., - fullname: str = ..., - **attrs: Any, -) -> None: ... -def run_setup(script_name: str, script_args: list[str] | None = ..., stop_after: str = ...) -> Distribution: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/cygwinccompiler.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/cygwinccompiler.pyi deleted file mode 100644 index 1f85b2548..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/cygwinccompiler.pyi +++ /dev/null @@ -1,4 +0,0 @@ -from distutils.unixccompiler import UnixCCompiler - -class CygwinCCompiler(UnixCCompiler): ... -class Mingw32CCompiler(CygwinCCompiler): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/debug.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/debug.pyi deleted file mode 100644 index 11f28a8bc..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/debug.pyi +++ /dev/null @@ -1 +0,0 @@ -DEBUG: bool | None diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/dep_util.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/dep_util.pyi deleted file mode 100644 index 929d6ffd0..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/dep_util.pyi +++ /dev/null @@ -1,3 +0,0 @@ -def newer(source: str, target: str) -> bool: ... -def newer_pairwise(sources: list[str], targets: list[str]) -> list[tuple[str, str]]: ... -def newer_group(sources: list[str], target: str, missing: str = ...) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/dir_util.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/dir_util.pyi deleted file mode 100644 index ffe5ff1cf..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/dir_util.pyi +++ /dev/null @@ -1,13 +0,0 @@ -def mkpath(name: str, mode: int = ..., verbose: int = ..., dry_run: int = ...) -> list[str]: ... -def create_tree(base_dir: str, files: list[str], mode: int = ..., verbose: int = ..., dry_run: int = ...) -> None: ... -def copy_tree( - src: str, - dst: str, - preserve_mode: int = ..., - preserve_times: int = ..., - preserve_symlinks: int = ..., - update: int = ..., - verbose: int = ..., - dry_run: int = ..., -) -> list[str]: ... -def remove_tree(directory: str, verbose: int = ..., dry_run: int = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/dist.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/dist.pyi index ef47e4e4d..cfa6c6ea1 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/dist.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/dist.pyi @@ -1,10 +1,18 @@ -from _typeshed import StrOrBytesPath, SupportsWrite +from _typeshed import FileDescriptorOrPath, Incomplete, SupportsWrite from collections.abc import Iterable, Mapping -from distutils.cmd import Command -from typing import IO, Any +from re import Pattern +from typing import IO, Any, ClassVar, TypeVar, overload +from typing_extensions import TypeAlias + +from .cmd import Command + +command_re: Pattern[str] + +_OptionsList: TypeAlias = list[tuple[str, str | None, str, int] | tuple[str, str | None, str]] +_CommandT = TypeVar("_CommandT", bound=Command) class DistributionMetadata: - def __init__(self, path: int | StrOrBytesPath | None = ...) -> None: ... + def __init__(self, path: FileDescriptorOrPath | None = None) -> None: ... name: str | None version: str | None author: str | None @@ -53,7 +61,87 @@ class DistributionMetadata: class Distribution: cmdclass: dict[str, type[Command]] metadata: DistributionMetadata - def __init__(self, attrs: Mapping[str, Any] | None = ...) -> None: ... + def __init__(self, attrs: Mapping[str, Any] | None = None) -> None: ... def get_option_dict(self, command: str) -> dict[str, tuple[str, str]]: ... - def parse_config_files(self, filenames: Iterable[str] | None = ...) -> None: ... - def get_command_obj(self, command: str, create: bool = ...) -> Command | None: ... + def parse_config_files(self, filenames: Iterable[str] | None = None) -> None: ... + def get_command_obj(self, command: str, create: bool = True) -> Command | None: ... + global_options: ClassVar[_OptionsList] + common_usage: ClassVar[str] + display_options: ClassVar[_OptionsList] + display_option_names: ClassVar[list[str]] + negative_opt: ClassVar[dict[str, str]] + verbose: int + dry_run: int + help: int + command_packages: list[str] | None + script_name: str | None + script_args: list[str] | None + command_options: dict[str, dict[str, tuple[str, str]]] + dist_files: list[tuple[str, str, str]] + packages: Incomplete + package_data: dict[str, list[str]] + package_dir: Incomplete + py_modules: Incomplete + libraries: Incomplete + headers: Incomplete + ext_modules: Incomplete + ext_package: Incomplete + include_dirs: Incomplete + extra_path: Incomplete + scripts: Incomplete + data_files: Incomplete + password: str + command_obj: dict[str, Command] + have_run: dict[str, bool] + want_user_cfg: bool + def dump_option_dicts( + self, header: Incomplete | None = None, commands: Incomplete | None = None, indent: str = "" + ) -> None: ... + def find_config_files(self): ... + commands: Incomplete + def parse_command_line(self): ... + def finalize_options(self) -> None: ... + def handle_display_options(self, option_order): ... + def print_command_list(self, commands, header, max_length) -> None: ... + def print_commands(self) -> None: ... + def get_command_list(self): ... + def get_command_packages(self): ... + def get_command_class(self, command: str) -> type[Command]: ... + @overload + def reinitialize_command(self, command: str, reinit_subcommands: bool = False) -> Command: ... + @overload + def reinitialize_command(self, command: _CommandT, reinit_subcommands: bool = False) -> _CommandT: ... + def announce(self, msg, level: int = ...) -> None: ... + def run_commands(self) -> None: ... + def run_command(self, command: str) -> None: ... + def has_pure_modules(self) -> bool: ... + def has_ext_modules(self) -> bool: ... + def has_c_libraries(self) -> bool: ... + def has_modules(self) -> bool: ... + def has_headers(self) -> bool: ... + def has_scripts(self) -> bool: ... + def has_data_files(self) -> bool: ... + def is_pure(self) -> bool: ... + + # Getter methods generated in __init__ + def get_name(self) -> str: ... + def get_version(self) -> str: ... + def get_fullname(self) -> str: ... + def get_author(self) -> str: ... + def get_author_email(self) -> str: ... + def get_maintainer(self) -> str: ... + def get_maintainer_email(self) -> str: ... + def get_contact(self) -> str: ... + def get_contact_email(self) -> str: ... + def get_url(self) -> str: ... + def get_license(self) -> str: ... + def get_licence(self) -> str: ... + def get_description(self) -> str: ... + def get_long_description(self) -> str: ... + def get_keywords(self) -> str | list[str]: ... + def get_platforms(self) -> str | list[str]: ... + def get_classifiers(self) -> str | list[str]: ... + def get_download_url(self) -> str: ... + def get_requires(self) -> list[str]: ... + def get_provides(self) -> list[str]: ... + def get_obsoletes(self) -> list[str]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/errors.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/errors.pyi index e483362bf..d19ac8b04 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/errors.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/errors.pyi @@ -1,19 +1 @@ class DistutilsError(Exception): ... -class DistutilsModuleError(DistutilsError): ... -class DistutilsClassError(DistutilsError): ... -class DistutilsGetoptError(DistutilsError): ... -class DistutilsArgError(DistutilsError): ... -class DistutilsFileError(DistutilsError): ... -class DistutilsOptionError(DistutilsError): ... -class DistutilsSetupError(DistutilsError): ... -class DistutilsPlatformError(DistutilsError): ... -class DistutilsExecError(DistutilsError): ... -class DistutilsInternalError(DistutilsError): ... -class DistutilsTemplateError(DistutilsError): ... -class DistutilsByteCompileError(DistutilsError): ... -class CCompilerError(Exception): ... -class PreprocessError(CCompilerError): ... -class CompileError(CCompilerError): ... -class LibError(CCompilerError): ... -class LinkError(CCompilerError): ... -class UnknownFileError(CCompilerError): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/extension.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/extension.pyi index 5639f44a6..789bbf6ec 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/extension.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/extension.pyi @@ -19,18 +19,18 @@ class Extension: self, name: str, sources: list[str], - include_dirs: list[str] | None = ..., - define_macros: list[tuple[str, str | None]] | None = ..., - undef_macros: list[str] | None = ..., - library_dirs: list[str] | None = ..., - libraries: list[str] | None = ..., - runtime_library_dirs: list[str] | None = ..., - extra_objects: list[str] | None = ..., - extra_compile_args: list[str] | None = ..., - extra_link_args: list[str] | None = ..., - export_symbols: list[str] | None = ..., - swig_opts: list[str] | None = ..., - depends: list[str] | None = ..., - language: str | None = ..., - optional: bool | None = ..., + include_dirs: list[str] | None = None, + define_macros: list[tuple[str, str | None]] | None = None, + undef_macros: list[str] | None = None, + library_dirs: list[str] | None = None, + libraries: list[str] | None = None, + runtime_library_dirs: list[str] | None = None, + extra_objects: list[str] | None = None, + extra_compile_args: list[str] | None = None, + extra_link_args: list[str] | None = None, + export_symbols: list[str] | None = None, + swig_opts: list[str] | None = None, + depends: list[str] | None = None, + language: str | None = None, + optional: bool | None = None, ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/fancy_getopt.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/fancy_getopt.pyi deleted file mode 100644 index 6a7124bd1..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/fancy_getopt.pyi +++ /dev/null @@ -1,24 +0,0 @@ -from collections.abc import Iterable, Mapping -from typing import Any, overload -from typing_extensions import TypeAlias - -_Option: TypeAlias = tuple[str, str | None, str] -_GR: TypeAlias = tuple[list[str], OptionDummy] - -def fancy_getopt( - options: list[_Option], negative_opt: Mapping[_Option, _Option], object: Any, args: list[str] | None -) -> list[str] | _GR: ... -def wrap_text(text: str, width: int) -> list[str]: ... - -class FancyGetopt: - def __init__(self, option_table: list[_Option] | None = ...) -> None: ... - # TODO kinda wrong, `getopt(object=object())` is invalid - @overload - def getopt(self, args: list[str] | None = ...) -> _GR: ... - @overload - def getopt(self, args: list[str] | None, object: Any) -> list[str]: ... - def get_option_order(self) -> list[tuple[str, str]]: ... - def generate_help(self, header: str | None = ...) -> list[str]: ... - -class OptionDummy: - def __init__(self, options: Iterable[str] = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/file_util.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/file_util.pyi deleted file mode 100644 index b3127841b..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/file_util.pyi +++ /dev/null @@ -1,14 +0,0 @@ -from collections.abc import Sequence - -def copy_file( - src: str, - dst: str, - preserve_mode: bool = ..., - preserve_times: bool = ..., - update: bool = ..., - link: str | None = ..., - verbose: bool = ..., - dry_run: bool = ..., -) -> tuple[str, str]: ... -def move_file(src: str, dst: str, verbose: bool = ..., dry_run: bool = ...) -> str: ... -def write_file(filename: str, contents: Sequence[str]) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/filelist.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/filelist.pyi index 1cfdcf08d..d242be1c3 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/filelist.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/filelist.pyi @@ -36,16 +36,3 @@ class FileList: def exclude_pattern( self, pattern: str | Pattern[str], anchor: bool | Literal[0, 1] = ..., prefix: str | None = ..., is_regex: int = ... ) -> bool: ... - -def findall(dir: str = ...) -> list[str]: ... -def glob_to_re(pattern: str) -> str: ... -@overload -def translate_pattern( - pattern: str, anchor: bool | Literal[0, 1] = ..., prefix: str | None = ..., is_regex: Literal[False, 0] = ... -) -> Pattern[str]: ... -@overload -def translate_pattern(pattern: str | Pattern[str], *, is_regex: Literal[True, 1] = ...) -> Pattern[str]: ... -@overload -def translate_pattern( - pattern: str | Pattern[str], anchor: bool | Literal[0, 1] = ..., prefix: str | None = ..., is_regex: int = ... -) -> Pattern[str]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/log.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/log.pyi deleted file mode 100644 index 549b569e7..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/log.pyi +++ /dev/null @@ -1,25 +0,0 @@ -from typing import Any - -DEBUG: int -INFO: int -WARN: int -ERROR: int -FATAL: int - -class Log: - def __init__(self, threshold: int = ...) -> None: ... - def log(self, level: int, msg: str, *args: Any) -> None: ... - def debug(self, msg: str, *args: Any) -> None: ... - def info(self, msg: str, *args: Any) -> None: ... - def warn(self, msg: str, *args: Any) -> None: ... - def error(self, msg: str, *args: Any) -> None: ... - def fatal(self, msg: str, *args: Any) -> None: ... - -def log(level: int, msg: str, *args: Any) -> None: ... -def debug(msg: str, *args: Any) -> None: ... -def info(msg: str, *args: Any) -> None: ... -def warn(msg: str, *args: Any) -> None: ... -def error(msg: str, *args: Any) -> None: ... -def fatal(msg: str, *args: Any) -> None: ... -def set_threshold(level: int) -> int: ... -def set_verbosity(v: int) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/msvccompiler.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/msvccompiler.pyi deleted file mode 100644 index 80872a6b7..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/msvccompiler.pyi +++ /dev/null @@ -1,3 +0,0 @@ -from distutils.ccompiler import CCompiler - -class MSVCCompiler(CCompiler): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/spawn.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/spawn.pyi deleted file mode 100644 index 2dc07dcd5..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/spawn.pyi +++ /dev/null @@ -1,6 +0,0 @@ -from _typeshed import Incomplete - -def spawn( - cmd: list[str], search_path: bool = ..., verbose: bool = ..., dry_run: bool = ..., env: Incomplete | None = ... -) -> None: ... -def find_executable(executable: str, path: str | None = ...) -> str | None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/sysconfig.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/sysconfig.pyi deleted file mode 100644 index bf7db9c8f..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/sysconfig.pyi +++ /dev/null @@ -1,13 +0,0 @@ -from collections.abc import Mapping -from distutils.ccompiler import CCompiler - -PREFIX: str -EXEC_PREFIX: str - -def get_config_var(name: str) -> int | str | None: ... -def get_config_vars(*args: str) -> Mapping[str, int | str]: ... -def get_config_h_filename() -> str: ... -def get_makefile_filename() -> str: ... -def get_python_inc(plat_specific: bool = ..., prefix: str | None = ...) -> str: ... -def get_python_lib(plat_specific: bool = ..., standard_lib: bool = ..., prefix: str | None = ...) -> str: ... -def customize_compiler(compiler: CCompiler) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/text_file.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/text_file.pyi deleted file mode 100644 index ace642e02..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/text_file.pyi +++ /dev/null @@ -1,21 +0,0 @@ -from typing import IO - -class TextFile: - def __init__( - self, - filename: str | None = ..., - file: IO[str] | None = ..., - *, - strip_comments: bool = ..., - lstrip_ws: bool = ..., - rstrip_ws: bool = ..., - skip_blanks: bool = ..., - join_lines: bool = ..., - collapse_join: bool = ..., - ) -> None: ... - def open(self, filename: str) -> None: ... - def close(self) -> None: ... - def warn(self, msg: str, line: list[int] | tuple[int, int] | int | None = ...) -> None: ... - def readline(self) -> str | None: ... - def readlines(self) -> list[str]: ... - def unreadline(self, line: str) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/unixccompiler.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/unixccompiler.pyi deleted file mode 100644 index e1d443471..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/unixccompiler.pyi +++ /dev/null @@ -1,3 +0,0 @@ -from distutils.ccompiler import CCompiler - -class UnixCCompiler(CCompiler): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/util.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/util.pyi deleted file mode 100644 index 6790712ff..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/util.pyi +++ /dev/null @@ -1,30 +0,0 @@ -from collections.abc import Callable, Mapping -from typing import Any -from typing_extensions import Literal - -def get_host_platform() -> str: ... -def get_platform() -> str: ... -def get_macosx_target_ver_from_syscfg(): ... -def get_macosx_target_ver(): ... -def split_version(s: str) -> list[int]: ... -def convert_path(pathname: str) -> str: ... -def change_root(new_root: str, pathname: str) -> str: ... -def check_environ() -> None: ... -def subst_vars(s: str, local_vars: Mapping[str, str]) -> None: ... -def grok_environment_error(exc: object, prefix: str = ...) -> str: ... -def split_quoted(s: str) -> list[str]: ... -def execute( - func: Callable[..., object], args: tuple[Any, ...], msg: str | None = ..., verbose: bool = ..., dry_run: bool = ... -) -> None: ... -def strtobool(val: str) -> Literal[0, 1]: ... -def byte_compile( - py_files: list[str], - optimize: int = ..., - force: bool = ..., - prefix: str | None = ..., - base_dir: str | None = ..., - verbose: bool = ..., - dry_run: bool = ..., - direct: bool | None = ..., -) -> None: ... -def rfc822_escape(header: str) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/version.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/version.pyi deleted file mode 100644 index 7e807d7d0..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/version.pyi +++ /dev/null @@ -1,26 +0,0 @@ -from _typeshed import Self -from re import Pattern - -class Version: - def __init__(self, vstring: str | None = ...) -> None: ... - def __eq__(self, other: object) -> bool: ... - def __lt__(self: Self, other: Self | str) -> bool: ... - def __le__(self: Self, other: Self | str) -> bool: ... - def __gt__(self: Self, other: Self | str) -> bool: ... - def __ge__(self: Self, other: Self | str) -> bool: ... - -class StrictVersion(Version): - version_re: Pattern[str] - version: tuple[int, int, int] - prerelease: tuple[str, int] | None - def __init__(self, vstring: str | None = ...) -> None: ... - def parse(self: Self, vstring: str) -> Self: ... - def _cmp(self: Self, other: Self | str) -> bool: ... - -class LooseVersion(Version): - component_re: Pattern[str] - vstring: str - version: tuple[str | int, ...] - def __init__(self, vstring: str | None = ...) -> None: ... - def parse(self: Self, vstring: str) -> Self: ... - def _cmp(self: Self, other: Self | str) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/archive_util.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/archive_util.pyi index cbc27e020..b550a6164 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/archive_util.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/archive_util.pyi @@ -1,10 +1,12 @@ -from distutils.errors import DistutilsError +from _typeshed import Incomplete from typing import Any +from ._distutils.errors import DistutilsError + class UnrecognizedFormat(DistutilsError): ... def default_filter(src, dst): ... -def unpack_archive(filename, extract_dir, progress_filter=..., drivers: Any | None = ...) -> None: ... +def unpack_archive(filename, extract_dir, progress_filter=..., drivers: Incomplete | None = ...) -> None: ... def unpack_directory(filename, extract_dir, progress_filter=...) -> None: ... def unpack_zipfile(filename, extract_dir, progress_filter=...) -> None: ... def unpack_tarfile(filename, extract_dir, progress_filter=...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/build_meta.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/build_meta.pyi index 1e3e81f6f..323e34827 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/build_meta.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/build_meta.pyi @@ -1,3 +1,4 @@ +from collections.abc import Mapping from typing import Any from setuptools import dist @@ -13,18 +14,31 @@ class Distribution(dist.Distribution): class _BuildMetaBackend: def run_setup(self, setup_script: str = ...) -> None: ... - def get_requires_for_build_wheel(self, config_settings: Any | None = ...): ... - def get_requires_for_build_sdist(self, config_settings: Any | None = ...): ... - def prepare_metadata_for_build_wheel(self, metadata_directory, config_settings: Any | None = ...): ... - def build_wheel(self, wheel_directory, config_settings: Any | None = ..., metadata_directory: Any | None = ...): ... - def build_sdist(self, sdist_directory, config_settings: Any | None = ...): ... + def get_requires_for_build_wheel(self, config_settings: Mapping[str, Any] | None = ...) -> list[str]: ... + def get_requires_for_build_sdist(self, config_settings: Mapping[str, Any] | None = ...) -> list[str]: ... + def prepare_metadata_for_build_wheel( + self, metadata_directory: str, config_settings: Mapping[str, Any] | None = ... + ) -> str: ... + def build_wheel( + self, wheel_directory: str, config_settings: Mapping[str, Any] | None = ..., metadata_directory: str | None = ... + ) -> str: ... + def build_sdist(self, sdist_directory: str, config_settings: Mapping[str, Any] | None = ...) -> str: ... + def build_editable( + self, wheel_directory: str, config_settings: Mapping[str, Any] | None = ..., metadata_directory: str | None = ... + ) -> str: ... + def get_requires_for_build_editable(self, config_settings: Mapping[str, Any] | None = ...) -> list[str]: ... + def prepare_metadata_for_build_editable( + self, metadata_directory: str, config_settings: Mapping[str, Any] | None = ... + ) -> str: ... class _BuildMetaLegacyBackend(_BuildMetaBackend): def run_setup(self, setup_script: str = ...) -> None: ... -get_requires_for_build_wheel: Any -get_requires_for_build_sdist: Any -prepare_metadata_for_build_wheel: Any -build_wheel: Any -build_sdist: Any -__legacy__: Any +_BACKEND: _BuildMetaBackend = ... +get_requires_for_build_wheel = _BACKEND.get_requires_for_build_wheel +get_requires_for_build_sdist = _BACKEND.get_requires_for_build_sdist +prepare_metadata_for_build_wheel = _BACKEND.prepare_metadata_for_build_wheel +build_wheel = _BACKEND.build_wheel +build_sdist = _BACKEND.build_sdist + +__legacy__: _BuildMetaLegacyBackend diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/bdist_egg.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/bdist_egg.pyi deleted file mode 100644 index fca2f7579..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/bdist_egg.pyi +++ /dev/null @@ -1,48 +0,0 @@ -from typing import Any - -from setuptools import Command - -def strip_module(filename): ... -def sorted_walk(dir) -> None: ... -def write_stub(resource, pyfile) -> None: ... - -class bdist_egg(Command): - description: str - user_options: Any - boolean_options: Any - bdist_dir: Any - plat_name: Any - keep_temp: int - dist_dir: Any - skip_build: int - egg_output: Any - exclude_source_files: Any - def initialize_options(self) -> None: ... - egg_info: Any - def finalize_options(self) -> None: ... - def do_install_data(self) -> None: ... - def get_outputs(self): ... - def call_command(self, cmdname, **kw): ... - stubs: Any - def run(self) -> None: ... - def zap_pyfiles(self) -> None: ... - def zip_safe(self): ... - def gen_header(self): ... - def copy_metadata_to(self, target_dir) -> None: ... - def get_ext_outputs(self): ... - -NATIVE_EXTENSIONS: Any - -def walk_egg(egg_dir) -> None: ... -def analyze_egg(egg_dir, stubs): ... -def write_safety_flag(egg_dir, safe) -> None: ... - -safety_flags: Any - -def scan_module(egg_dir, base, name, stubs): ... -def iter_symbols(code) -> None: ... -def can_scan(): ... - -INSTALL_DIRECTORY_ATTRS: Any - -def make_zipfile(zip_filename, base_dir, verbose: int = ..., dry_run: int = ..., compress: bool = ..., mode: str = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/bdist_rpm.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/bdist_rpm.pyi deleted file mode 100644 index 4942eafe9..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/bdist_rpm.pyi +++ /dev/null @@ -1,4 +0,0 @@ -import distutils.command.bdist_rpm as orig - -class bdist_rpm(orig.bdist_rpm): - def run(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/build_clib.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/build_clib.pyi index c088f7d79..a8fe07c51 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/build_clib.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/build_clib.pyi @@ -1,4 +1,4 @@ -import distutils.command.build_clib as orig +from .._distutils.command import build_clib as orig class build_clib(orig.build_clib): def build_libraries(self, libraries) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/build_ext.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/build_ext.pyi index b627be356..507718c27 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/build_ext.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/build_ext.pyi @@ -1,6 +1,8 @@ -from distutils.command.build_ext import build_ext as _build_ext +from _typeshed import Incomplete from typing import Any +from .._distutils.command.build_ext import build_ext as _build_ext + have_rtld: bool use_stubs: bool libtype: str @@ -31,14 +33,14 @@ def link_shared_object( self, objects, output_libname, - output_dir: Any | None = ..., - libraries: Any | None = ..., - library_dirs: Any | None = ..., - runtime_library_dirs: Any | None = ..., - export_symbols: Any | None = ..., + output_dir: Incomplete | None = ..., + libraries: Incomplete | None = ..., + library_dirs: Incomplete | None = ..., + runtime_library_dirs: Incomplete | None = ..., + export_symbols: Incomplete | None = ..., debug: int = ..., - extra_preargs: Any | None = ..., - extra_postargs: Any | None = ..., - build_temp: Any | None = ..., - target_lang: Any | None = ..., + extra_preargs: Incomplete | None = ..., + extra_postargs: Incomplete | None = ..., + build_temp: Incomplete | None = ..., + target_lang: Incomplete | None = ..., ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/build_py.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/build_py.pyi index 8e5e773a8..0e2fc54ab 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/build_py.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/build_py.pyi @@ -1,6 +1,7 @@ -import distutils.command.build_py as orig from typing import Any +from .._distutils.command import build_py as orig + def make_writable(target) -> None: ... class build_py(orig.build_py): @@ -9,7 +10,7 @@ class build_py(orig.build_py): def finalize_options(self) -> None: ... def run(self) -> None: ... data_files: Any - def __getattr__(self, attr): ... + def __getattr__(self, attr: str): ... def build_module(self, module, module_file, package): ... def find_data_files(self, package, src_dir): ... def build_package_data(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/develop.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/develop.pyi index 8b099dc80..f7c1058ce 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/develop.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/develop.pyi @@ -27,5 +27,5 @@ class develop(namespaces.DevelopInstaller, easy_install): class VersionlessRequirement: def __init__(self, dist) -> None: ... - def __getattr__(self, name): ... + def __getattr__(self, name: str): ... def as_requirement(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/dist_info.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/dist_info.pyi index aa9d3f409..d2501e80b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/dist_info.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/dist_info.pyi @@ -1,6 +1,7 @@ -from distutils.core import Command from typing import Any +from .._distutils.cmd import Command + class dist_info(Command): description: str user_options: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/easy_install.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/easy_install.pyi index af873219b..d0289f629 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/easy_install.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/easy_install.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from collections.abc import Iterator from typing import Any @@ -67,7 +68,7 @@ class easy_install(Command): def should_unzip(self, dist): ... def maybe_move(self, spec, dist_filename, setup_base): ... def install_wrapper_scripts(self, dist) -> None: ... - def install_script(self, dist, script_name, script_text, dev_path: Any | None = ...) -> None: ... + def install_script(self, dist, script_name, script_text, dev_path: Incomplete | None = ...) -> None: ... def write_script(self, script_name, contents, mode: str = ..., blockers=...) -> None: ... def install_eggs(self, spec, dist_filename, tmpdir): ... def egg_distribution(self, egg_path): ... @@ -126,17 +127,17 @@ class ScriptWriter: template: Any command_spec_class: Any @classmethod - def get_script_args(cls, dist, executable: Any | None = ..., wininst: bool = ...) -> Iterator[tuple[str, str]]: ... + def get_script_args(cls, dist, executable: Incomplete | None = ..., wininst: bool = ...) -> Iterator[tuple[str, str]]: ... @classmethod - def get_script_header(cls, script_text, executable: Any | None = ..., wininst: bool = ...) -> str: ... + def get_script_header(cls, script_text, executable: Incomplete | None = ..., wininst: bool = ...) -> str: ... @classmethod - def get_args(cls, dist, header: Any | None = ...) -> Iterator[tuple[str, str]]: ... + def get_args(cls, dist, header: Incomplete | None = ...) -> Iterator[tuple[str, str]]: ... @classmethod def get_writer(cls, force_windows: bool) -> type[ScriptWriter]: ... @classmethod def best(cls) -> type[ScriptWriter]: ... @classmethod - def get_header(cls, script_text: str = ..., executable: Any | None = ...) -> str: ... + def get_header(cls, script_text: str = ..., executable: Incomplete | None = ...) -> str: ... class WindowsScriptWriter(ScriptWriter): command_spec_class: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/egg_info.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/egg_info.pyi index a1feeb5c1..931911f07 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/egg_info.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/egg_info.pyi @@ -1,9 +1,10 @@ -from distutils.filelist import FileList as _FileList from typing import Any from setuptools import Command, SetuptoolsDeprecationWarning from setuptools.command.sdist import sdist +from .._distutils.filelist import FileList as _FileList + def translate_pattern(glob): ... class InfoCommon: @@ -42,6 +43,7 @@ class egg_info(InfoCommon, Command): def check_broken_egg_info(self) -> None: ... class FileList(_FileList): + def __init__(self, warn=..., debug_print=..., ignore_egg_info_dir: bool = ...) -> None: ... def process_template_line(self, line) -> None: ... def include(self, pattern): ... def exclude(self, pattern): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/install.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/install.pyi index 50594f2d3..aa2aabf73 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/install.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/install.pyi @@ -1,6 +1,7 @@ -import distutils.command.install as orig from typing import Any +from .._distutils.command import install as orig + class install(orig.install): user_options: Any boolean_options: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/install_lib.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/install_lib.pyi index cd76c4752..7cd28d8f1 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/install_lib.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/install_lib.pyi @@ -1,4 +1,4 @@ -import distutils.command.install_lib as orig +from .._distutils.command import install_lib as orig class install_lib(orig.install_lib): def run(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/install_scripts.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/install_scripts.pyi index 354faa7f0..3dc4c1a1f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/install_scripts.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/install_scripts.pyi @@ -1,6 +1,7 @@ -import distutils.command.install_scripts as orig from typing import Any +from .._distutils.command import install_scripts as orig + class install_scripts(orig.install_scripts): no_ep: bool def initialize_options(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/py36compat.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/py36compat.pyi deleted file mode 100644 index eac937030..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/py36compat.pyi +++ /dev/null @@ -1 +0,0 @@ -class sdist_add_defaults: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/register.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/register.pyi index 02c63f18e..60a5f7094 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/register.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/register.pyi @@ -1,4 +1,4 @@ -import distutils.command.register as orig +from .._distutils.command import register as orig class register(orig.register): def run(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/sdist.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/sdist.pyi index 0d150e7ee..f544dbfc7 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/sdist.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/sdist.pyi @@ -1,11 +1,10 @@ -import distutils.command.sdist as orig from typing import Any -from .py36compat import sdist_add_defaults +from .._distutils.command import sdist as orig def walk_revctrl(dirname: str = ...) -> None: ... -class sdist(sdist_add_defaults, orig.sdist): +class sdist(orig.sdist): user_options: Any negative_opt: Any README_EXTENSIONS: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/test.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/test.pyi index 2e11178b6..1b7a32f4f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/test.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/test.pyi @@ -1,7 +1,8 @@ -from _typeshed import Self +from _typeshed import Incomplete, Unused from collections.abc import Callable from types import ModuleType from typing import Any, Generic, TypeVar, overload +from typing_extensions import Self from unittest import TestLoader, TestSuite from setuptools import Command @@ -10,15 +11,15 @@ _T = TypeVar("_T") class ScanningLoader(TestLoader): def __init__(self) -> None: ... - def loadTestsFromModule(self, module: ModuleType, pattern: Any | None = ...) -> list[TestSuite]: ... # type: ignore[override] + def loadTestsFromModule(self, module: ModuleType, pattern: Incomplete | None = ...) -> list[TestSuite]: ... # type: ignore[override] class NonDataProperty(Generic[_T]): fget: Callable[..., _T] def __init__(self, fget: Callable[..., _T]) -> None: ... @overload - def __get__(self: Self, obj: None, objtype: object = ...) -> Self: ... + def __get__(self, obj: None, objtype: Unused = None) -> Self: ... @overload - def __get__(self, obj: Any, objtype: object = ...) -> _T: ... + def __get__(self, obj: Any, objtype: Unused = None) -> _T: ... class test(Command): description: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/upload.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/upload.pyi index ea60d6e6b..efffae3b7 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/upload.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/upload.pyi @@ -1,4 +1,4 @@ -from distutils.command import upload as orig +from .._distutils.command import upload as orig class upload(orig.upload): def run(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/upload_docs.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/upload_docs.pyi index 0660bff72..5f923d96c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/upload_docs.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/upload_docs.pyi @@ -1,4 +1,6 @@ +from collections.abc import Callable from typing import Any, ClassVar +from typing_extensions import Self from .upload import upload @@ -8,7 +10,8 @@ class upload_docs(upload): user_options: ClassVar[list[tuple[str, str | None, str]]] boolean_options: ClassVar[list[str]] def has_sphinx(self): ... - sub_commands: Any + # The callable parameter is self: Self, but using Self still trips up mypy + sub_commands: ClassVar[list[tuple[str, Callable[[Self], bool] | None]]] # type: ignore[misc, assignment] upload_dir: Any target_dir: Any def initialize_options(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/depends.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/depends.pyi index 13a011bef..a34fe5392 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/depends.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/depends.pyi @@ -1,14 +1,20 @@ -from typing import Any +from _typeshed import Incomplete class Require: def __init__( - self, name, requested_version, module, homepage: str = ..., attribute: Any | None = ..., format: Any | None = ... + self, + name, + requested_version, + module, + homepage: str = ..., + attribute: Incomplete | None = ..., + format: Incomplete | None = ..., ) -> None: ... def full_name(self): ... def version_ok(self, version): ... - def get_version(self, paths: Any | None = ..., default: str = ...): ... - def is_present(self, paths: Any | None = ...): ... - def is_current(self, paths: Any | None = ...): ... + def get_version(self, paths: Incomplete | None = ..., default: str = ...): ... + def is_present(self, paths: Incomplete | None = ...): ... + def is_current(self, paths: Incomplete | None = ...): ... -def get_module_constant(module, symbol, default: int = ..., paths: Any | None = ...): ... +def get_module_constant(module, symbol, default: int = ..., paths: Incomplete | None = ...): ... def extract_constant(code, symbol, default: int = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/dist.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/dist.pyi index b47795f82..3e34d9b1b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/dist.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/dist.pyi @@ -1,35 +1,29 @@ -from _typeshed import Incomplete -from distutils.core import Distribution as _Distribution +from collections.abc import Iterable, Iterator, Mapping, MutableMapping +from typing import Any -from setuptools import SetuptoolsDeprecationWarning +from setuptools import Command, SetuptoolsDeprecationWarning + +from ._distutils.dist import Distribution as _Distribution class Distribution(_Distribution): - def patch_missing_pkg_info(self, attrs) -> None: ... - package_data: Incomplete - dist_files: Incomplete - src_root: Incomplete - dependency_links: Incomplete - setup_requires: Incomplete - def __init__(self, attrs: Incomplete | None = ...) -> None: ... - def warn_dash_deprecation(self, opt, section): ... - def make_option_lowercase(self, opt, section): ... - def parse_config_files(self, filenames: Incomplete | None = ..., ignore_option_errors: bool = ...) -> None: ... - def fetch_build_eggs(self, requires): ... - def finalize_options(self): ... - def get_egg_cache_dir(self): ... + def patch_missing_pkg_info(self, attrs: Mapping[str, Any]) -> None: ... + src_root: str | None + dependency_links: list[str] + setup_requires: list[str] + def __init__(self, attrs: MutableMapping[str, Any] | None = None) -> None: ... + def warn_dash_deprecation(self, opt: str, section: str) -> str: ... + def make_option_lowercase(self, opt: str, section: str) -> str: ... + def parse_config_files(self, filenames: Iterable[str] | None = ..., ignore_option_errors: bool = ...) -> None: ... + def fetch_build_eggs(self, requires: str | Iterable[str]): ... + def get_egg_cache_dir(self) -> str: ... def fetch_build_egg(self, req): ... - def get_command_class(self, command): ... - def print_commands(self): ... - def get_command_list(self): ... + def get_command_class(self, command: str) -> type[Command]: ... def include(self, **attrs) -> None: ... - packages: Incomplete - py_modules: Incomplete - ext_modules: Incomplete - def exclude_package(self, package) -> None: ... - def has_contents_for(self, package): ... + def exclude_package(self, package: str) -> None: ... + def has_contents_for(self, package: str) -> bool | None: ... def exclude(self, **attrs) -> None: ... - def get_cmdline_options(self): ... - def iter_distribution_names(self) -> None: ... + def get_cmdline_options(self) -> dict[str, dict[str, str | None]]: ... + def iter_distribution_names(self) -> Iterator[str]: ... def handle_display_options(self, option_order): ... class DistDeprecationWarning(SetuptoolsDeprecationWarning): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/errors.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/errors.pyi index 0791eeee9..2e31b89c8 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/errors.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/errors.pyi @@ -1,3 +1,3 @@ -from distutils.errors import DistutilsError +from ._distutils.errors import DistutilsError class RemovedCommandError(DistutilsError, RuntimeError): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/extension.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/extension.pyi index ac7cf1c86..f32953d15 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/extension.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/extension.pyi @@ -1,10 +1,31 @@ -from distutils.core import Extension as _Extension from typing import Any +from ._distutils.extension import Extension as _Extension + have_pyrex: Any class Extension(_Extension): - py_limited_api: Any - def __init__(self, name, sources, *args, **kw) -> None: ... + py_limited_api: bool + def __init__( + self, + name: str, + sources: list[str], + include_dirs: list[str] | None = None, + define_macros: list[tuple[str, str | None]] | None = None, + undef_macros: list[str] | None = None, + library_dirs: list[str] | None = None, + libraries: list[str] | None = None, + runtime_library_dirs: list[str] | None = None, + extra_objects: list[str] | None = None, + extra_compile_args: list[str] | None = None, + extra_link_args: list[str] | None = None, + export_symbols: list[str] | None = None, + swig_opts: list[str] | None = None, + depends: list[str] | None = None, + language: str | None = None, + optional: bool | None = None, + *, + py_limited_api: bool = False, + ) -> None: ... class Library(Extension): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/extern/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/extern/__init__.pyi index dcc8e3b56..864dc18dc 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/extern/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/extern/__init__.pyi @@ -1,16 +1,17 @@ +from _typeshed import Incomplete from typing import Any class VendorImporter: root_name: Any vendored_names: Any vendor_pkg: Any - def __init__(self, root_name, vendored_names=..., vendor_pkg: Any | None = ...) -> None: ... + def __init__(self, root_name, vendored_names=..., vendor_pkg: Incomplete | None = ...) -> None: ... @property def search_path(self) -> None: ... def load_module(self, fullname): ... def create_module(self, spec): ... def exec_module(self, module) -> None: ... - def find_spec(self, fullname, path: Any | None = ..., target: Any | None = ...): ... + def find_spec(self, fullname, path: Incomplete | None = ..., target: Incomplete | None = ...): ... def install(self) -> None: ... names: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/msvc.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/msvc.pyi index 0bf9ce791..952f11893 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/msvc.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/msvc.pyi @@ -1,22 +1,12 @@ -from typing import Any +from _typeshed import Incomplete -class winreg: - HKEY_USERS: Any - HKEY_CURRENT_USER: Any - HKEY_LOCAL_MACHINE: Any - HKEY_CLASSES_ROOT: Any +PLAT_SPEC_TO_RUNTIME: dict[str, str] -def msvc9_find_vcvarsall(version): ... -def msvc9_query_vcvarsall(ver, arch: str = ..., *args, **kwargs): ... - -PLAT_SPEC_TO_RUNTIME: Any - -def msvc14_get_vc_env(plat_spec): ... -def msvc14_gen_lib_options(*args, **kwargs): ... +def msvc14_get_vc_env(plat_spec: str) -> dict[str, Incomplete]: ... class PlatformInfo: - current_cpu: Any - arch: Any + current_cpu: Incomplete + arch: Incomplete def __init__(self, arch) -> None: ... @property def target_cpu(self): ... @@ -27,8 +17,8 @@ class PlatformInfo: def cross_dir(self, forcex86: bool = ...): ... class RegistryInfo: - HKEYS: Any - pi: Any + HKEYS: Incomplete + pi: Incomplete def __init__(self, platform_info) -> None: ... @property def visualstudio(self): ... @@ -52,14 +42,14 @@ class RegistryInfo: def lookup(self, key, name): ... class SystemInfo: - WinDir: Any - ProgramFiles: Any - ProgramFilesx86: Any - ri: Any - pi: Any - known_vs_paths: Any - vs_ver: Any - def __init__(self, registry_info, vc_ver: Any | None = ...) -> None: ... + WinDir: Incomplete + ProgramFiles: Incomplete + ProgramFilesx86: Incomplete + ri: Incomplete + pi: Incomplete + known_vs_paths: Incomplete + vs_ver: Incomplete + def __init__(self, registry_info, vc_ver: Incomplete | None = ...) -> None: ... def find_reg_vs_vers(self): ... def find_programdata_vs_vers(self): ... @property @@ -94,10 +84,10 @@ class SystemInfo: def FrameworkVersion64(self): ... class EnvironmentInfo: - pi: Any - ri: Any - si: Any - def __init__(self, arch, vc_ver: Any | None = ..., vc_min_ver: int = ...) -> None: ... + pi: Incomplete + ri: Incomplete + si: Incomplete + def __init__(self, arch, vc_ver: Incomplete | None = ..., vc_min_ver: int = ...) -> None: ... @property def vs_ver(self): ... @property diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/package_index.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/package_index.pyi index f4d14b940..f672a1047 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/package_index.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/package_index.pyi @@ -1,12 +1,13 @@ import configparser +from _typeshed import Incomplete from typing import Any from pkg_resources import Environment def parse_bdist_wininst(name): ... -def distros_for_url(url, metadata: Any | None = ...) -> None: ... +def distros_for_url(url, metadata: Incomplete | None = ...) -> None: ... def interpret_distro_name( - location, basename, metadata, py_version: Any | None = ..., precedence=..., platform: Any | None = ... + location, basename, metadata, py_version: Incomplete | None = ..., precedence=..., platform: Incomplete | None = ... ) -> None: ... class ContentChecker: @@ -35,7 +36,7 @@ class PackageIndex(Environment): to_scan: Any opener: Any def __init__( - self, index_url: str = ..., hosts=..., ca_bundle: Any | None = ..., verify_ssl: bool = ..., *args, **kw + self, index_url: str = ..., hosts=..., ca_bundle: Incomplete | None = ..., verify_ssl: bool = ..., *args, **kw ) -> None: ... def process_url(self, url, retrieve: bool = ...) -> None: ... def process_filename(self, fn, nested: bool = ...) -> None: ... @@ -44,9 +45,9 @@ class PackageIndex(Environment): def scan_egg_link(self, path, entry) -> None: ... def process_index(self, url, page): ... def need_version_info(self, url) -> None: ... - def scan_all(self, msg: Any | None = ..., *args) -> None: ... + def scan_all(self, msg: Incomplete | None = ..., *args) -> None: ... def find_packages(self, requirement) -> None: ... - def obtain(self, requirement, installer: Any | None = ...): ... + def obtain(self, requirement, installer: Incomplete | None = ...): ... def check_hash(self, checker, filename, tfp) -> None: ... def add_find_links(self, urls) -> None: ... def prescan(self) -> None: ... @@ -59,13 +60,13 @@ class PackageIndex(Environment): force_scan: bool = ..., source: bool = ..., develop_ok: bool = ..., - local_index: Any | None = ..., + local_index: Incomplete | None = ..., ): ... def fetch(self, requirement, tmpdir, force_scan: bool = ..., source: bool = ...): ... def gen_setup(self, filename, fragment, tmpdir): ... dl_blocksize: int def reporthook(self, url, filename, blocknum, blksize, size) -> None: ... - def open_url(self, url, warning: Any | None = ...): ... + def open_url(self, url, warning: Incomplete | None = ...): ... def scan_url(self, url) -> None: ... def debug(self, msg, *args) -> None: ... def info(self, msg, *args) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/sandbox.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/sandbox.pyi index 293d11288..71fb7cf5c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/sandbox.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/sandbox.pyi @@ -1,5 +1,8 @@ -from distutils.errors import DistutilsError +from types import TracebackType from typing import Any +from typing_extensions import Literal + +from ._distutils.errors import DistutilsError class UnpickleableException(Exception): @staticmethod @@ -7,15 +10,18 @@ class UnpickleableException(Exception): class ExceptionSaver: def __enter__(self): ... - def __exit__(self, type, exc, tb): ... + def __exit__( + self, type: type[BaseException] | None, exc: BaseException | None, tb: TracebackType | None + ) -> Literal[True] | None: ... def resume(self) -> None: ... def run_setup(setup_script, args): ... class AbstractSandbox: - def __init__(self) -> None: ... def __enter__(self) -> None: ... - def __exit__(self, exc_type, exc_value, traceback) -> None: ... + def __exit__( + self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None + ) -> None: ... def run(self, func): ... class DirectorySandbox(AbstractSandbox): diff --git a/packages/pyright-internal/typeshed-fallback/stubs/simplejson/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/simplejson/METADATA.toml index b4d0bc7dc..5a55c100a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/simplejson/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/simplejson/METADATA.toml @@ -1 +1,4 @@ -version = "3.17.*" +version = "3.18.*" + +[tool.stubtest] +ignore_missing_stub = true diff --git a/packages/pyright-internal/typeshed-fallback/stubs/simplejson/simplejson/decoder.pyi b/packages/pyright-internal/typeshed-fallback/stubs/simplejson/simplejson/decoder.pyi index babb0f633..d2b1ac14a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/simplejson/simplejson/decoder.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/simplejson/simplejson/decoder.pyi @@ -3,5 +3,5 @@ from typing import Any class JSONDecoder: def __init__(self, **kwargs: Any) -> None: ... - def decode(self, s: str, _w: Match[str], _PY3: bool): ... - def raw_decode(self, s: str, idx: int, _w: Match[str], _PY3: bool): ... + def decode(self, s: str, _w: Match[str], _PY3: bool) -> Any: ... + def raw_decode(self, s: str, idx: int, _w: Match[str], _PY3: bool) -> tuple[Any, int]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/simplejson/simplejson/encoder.pyi b/packages/pyright-internal/typeshed-fallback/stubs/simplejson/simplejson/encoder.pyi index 7997976e6..a3603029a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/simplejson/simplejson/encoder.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/simplejson/simplejson/encoder.pyi @@ -1,9 +1,10 @@ -from typing import Any +from collections.abc import Iterator +from typing import Any, NoReturn class JSONEncoder: def __init__(self, *args: Any, **kwargs: Any) -> None: ... - def encode(self, o: Any): ... - def default(self, o: Any): ... - def iterencode(self, o: Any, _one_shot: bool): ... + def encode(self, o: Any) -> str: ... + def default(self, o: Any) -> NoReturn: ... + def iterencode(self, o: Any, _one_shot: bool = ...) -> Iterator[str]: ... class JSONEncoderForHTML(JSONEncoder): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/singledispatch/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/singledispatch/METADATA.toml index 1cc454093..3188e8fc2 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/singledispatch/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/singledispatch/METADATA.toml @@ -1 +1 @@ -version = "3.7.*" +version = "4.0.*" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/singledispatch/singledispatch.pyi b/packages/pyright-internal/typeshed-fallback/stubs/singledispatch/singledispatch.pyi index 59d201deb..bd3671473 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/singledispatch/singledispatch.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/singledispatch/singledispatch.pyi @@ -2,6 +2,7 @@ from collections.abc import Callable, Mapping from typing import Any, Generic, TypeVar, overload _T = TypeVar("_T") +_S = TypeVar("_S") class _SingleDispatchCallable(Generic[_T]): registry: Mapping[Any, Callable[..., _T]] @@ -19,10 +20,12 @@ class singledispatchmethod(Generic[_T]): dispatcher: _SingleDispatchCallable[_T] func: Callable[..., _T] def __init__(self, func: Callable[..., _T]) -> None: ... + @property + def __isabstractmethod__(self) -> bool: ... @overload def register(self, cls: type[Any], method: None = ...) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ... @overload def register(self, cls: Callable[..., _T], method: None = ...) -> Callable[..., _T]: ... @overload def register(self, cls: type[Any], method: Callable[..., _T]) -> Callable[..., _T]: ... - def __call__(self, *args: Any, **kwargs: Any) -> _T: ... + def __get__(self, obj: _S, cls: type[_S] | None = ...) -> Callable[..., _T]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/six/six/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/six/six/__init__.pyi index 7a084b3cc..a5333e1ff 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/six/six/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/six/six/__init__.pyi @@ -1,19 +1,24 @@ -from __future__ import print_function - import builtins +import operator import types import unittest -from _typeshed import IdentityFunction +from _typeshed import IdentityFunction, Unused, _KT_contra, _VT_co from builtins import next as next from collections.abc import Callable, ItemsView, Iterable, Iterator as _Iterator, KeysView, Mapping, ValuesView from functools import wraps as wraps from importlib.util import spec_from_loader as spec_from_loader from io import BytesIO as BytesIO, StringIO as StringIO from re import Pattern -from typing import Any, AnyStr, NoReturn, TypeVar, overload +from typing import Any, AnyStr, NoReturn, Protocol, TypeVar, overload from typing_extensions import Literal -from . import moves as moves +from six import moves as moves + +# TODO: We should switch to the _typeshed version of SupportsGetItem +# once mypy updates its vendored copy of typeshed and makes a new release +class _SupportsGetItem(Protocol[_KT_contra, _VT_co]): + def __contains__(self, __x: Any) -> bool: ... + def __getitem__(self, __key: _KT_contra) -> _VT_co: ... _T = TypeVar("_T") _K = TypeVar("_K") @@ -28,7 +33,7 @@ PY34: Literal[True] string_types: tuple[type[str]] integer_types: tuple[type[int]] -class_types: tuple[type[type[Any]]] +class_types: tuple[type[type]] text_type = str binary_type = bytes @@ -45,7 +50,7 @@ def create_unbound_method(func: types.FunctionType, cls: type) -> types.Function Iterator = object def get_method_function(meth: types.MethodType) -> types.FunctionType: ... -def get_method_self(meth: types.MethodType) -> object | None: ... +def get_method_self(meth: types.MethodType) -> object: ... def get_function_closure(fun: types.FunctionType) -> tuple[types._Cell, ...] | None: ... def get_function_code(fun: types.FunctionType) -> types.CodeType: ... def get_function_defaults(fun: types.FunctionType) -> tuple[Any, ...] | None: ... @@ -53,9 +58,6 @@ def get_function_globals(fun: types.FunctionType) -> dict[str, Any]: ... def iterkeys(d: Mapping[_K, Any]) -> _Iterator[_K]: ... def itervalues(d: Mapping[Any, _V]) -> _Iterator[_V]: ... def iteritems(d: Mapping[_K, _V]) -> _Iterator[tuple[_K, _V]]: ... - -# def iterlists - def viewkeys(d: Mapping[_K, Any]) -> KeysView[_K]: ... def viewvalues(d: Mapping[Any, _V]) -> ValuesView[_V]: ... def viewitems(d: Mapping[_K, _V]) -> ItemsView[_K, _V]: ... @@ -65,17 +67,20 @@ def u(s: str) -> str: ... unichr = chr def int2byte(i: int) -> bytes: ... -def byte2int(bs: bytes) -> int: ... -def indexbytes(buf: bytes, i: int) -> int: ... -def iterbytes(buf: bytes) -> _Iterator[int]: ... + +# Should be `byte2int: operator.itemgetter[int]`. But a bug in mypy prevents using TypeVar in itemgetter.__call__ +def byte2int(obj: _SupportsGetItem[int, _T]) -> _T: ... + +indexbytes = operator.getitem +iterbytes = iter + def assertCountEqual(self: unittest.TestCase, first: Iterable[_T], second: Iterable[_T], msg: str | None = ...) -> None: ... @overload def assertRaisesRegex(self: unittest.TestCase, msg: str | None = ...) -> Any: ... @overload def assertRaisesRegex(self: unittest.TestCase, callable_obj: Callable[..., object], *args: Any, **kwargs: Any) -> Any: ... -def assertRegex( - self: unittest.TestCase, text: AnyStr, expected_regex: AnyStr | Pattern[AnyStr], msg: str | None = ... -) -> None: ... +def assertRegex(self: unittest.TestCase, text: AnyStr, expected_regex: AnyStr | Pattern[AnyStr], msg: Any = ...) -> None: ... +def assertNotRegex(self: unittest.TestCase, text: AnyStr, expected_regex: AnyStr | Pattern[AnyStr], msg: Any = ...) -> None: ... exec_ = exec @@ -94,7 +99,7 @@ def python_2_unicode_compatible(klass: _T) -> _T: ... class _LazyDescr: name: str def __init__(self, name: str) -> None: ... - def __get__(self, obj: object | None, tp: object) -> Any: ... + def __get__(self, obj: object, tp: Unused) -> Any: ... class MovedModule(_LazyDescr): mod: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/six/six/moves/urllib/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/six/six/moves/urllib/__init__.pyi index d08209c51..fa6dc9779 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/six/six/moves/urllib/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/six/six/moves/urllib/__init__.pyi @@ -1,5 +1 @@ -import six.moves.urllib.error as error -import six.moves.urllib.parse as parse -import six.moves.urllib.request as request -import six.moves.urllib.response as response -import six.moves.urllib.robotparser as robotparser +from six.moves.urllib import error as error, parse as parse, request as request, response as response, robotparser as robotparser diff --git a/packages/pyright-internal/typeshed-fallback/stubs/slumber/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/slumber/METADATA.toml index 161ee7abb..55019ecce 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/slumber/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/slumber/METADATA.toml @@ -1,4 +1,2 @@ version = "0.7.*" - -[tool.stubtest] -ignore_missing_stub = false +requires = ["types-requests"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/slumber/slumber/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/slumber/slumber/__init__.pyi index 8d6f59e49..f35d7855e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/slumber/slumber/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/slumber/slumber/__init__.pyi @@ -1,30 +1,39 @@ from typing import Any +from typing_extensions import Self + +from requests import Response, Session +from requests.sessions import _Auth, _Data, _Files + +from .serialize import Serializer + +__all__ = ["Resource", "API"] class ResourceAttributesMixin: - def __getattr__(self, item): ... + # Exists at runtime: + def __getattr__(self, item: str) -> Any: ... class Resource(ResourceAttributesMixin): - def __init__(self, *args, **kwargs) -> None: ... - def __call__(self, id: Any | None = ..., format: Any | None = ..., url_override: Any | None = ...): ... - def as_raw(self): ... - def get(self, **kwargs): ... - def options(self, **kwargs): ... - def head(self, **kwargs): ... - def post(self, data: Any | None = ..., files: Any | None = ..., **kwargs): ... - def patch(self, data: Any | None = ..., files: Any | None = ..., **kwargs): ... - def put(self, data: Any | None = ..., files: Any | None = ..., **kwargs): ... - def delete(self, **kwargs): ... - def url(self): ... + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + def __call__(self, id: str | None = ..., format: str | None = ..., url_override: str | None = ...) -> Self: ... + def as_raw(self) -> Self: ... + def get(self, **kwargs: Any) -> Response: ... + def options(self, **kwargs: Any) -> Response: ... + def head(self, **kwargs: Any) -> Response: ... + def post(self, data: _Data | None = ..., files: _Files | None = ..., **kwargs: Any) -> Response: ... + def patch(self, data: _Data | None = ..., files: _Files | None = ..., **kwargs: Any) -> Response: ... + def put(self, data: _Data | None = ..., files: _Files | None = ..., **kwargs: Any) -> Response: ... + def delete(self, **kwargs: Any) -> Response: ... + def url(self) -> str: ... class API(ResourceAttributesMixin): - resource_class: Any + resource_class: type[Resource] def __init__( self, - base_url: Any | None = ..., - auth: Any | None = ..., - format: Any | None = ..., + base_url: str | None = ..., + auth: _Auth | None = ..., + format: str | None = ..., append_slash: bool = ..., - session: Any | None = ..., - serializer: Any | None = ..., + session: Session | None = ..., + serializer: Serializer | None = ..., raw: bool = ..., ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/slumber/slumber/exceptions.pyi b/packages/pyright-internal/typeshed-fallback/stubs/slumber/slumber/exceptions.pyi index a077fd22a..20cac92d7 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/slumber/slumber/exceptions.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/slumber/slumber/exceptions.pyi @@ -1,7 +1,9 @@ +from typing import Any + class SlumberBaseException(Exception): ... class SlumberHttpBaseException(SlumberBaseException): - def __init__(self, *args, **kwargs) -> None: ... + def __init__(self, *args: Any, **kwargs: Any) -> None: ... class HttpClientError(SlumberHttpBaseException): ... class HttpNotFoundError(HttpClientError): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/slumber/slumber/serialize.pyi b/packages/pyright-internal/typeshed-fallback/stubs/slumber/slumber/serialize.pyi index a3cb19796..b9256756a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/slumber/slumber/serialize.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/slumber/slumber/serialize.pyi @@ -1,29 +1,28 @@ from typing import Any +from typing_extensions import TypeAlias + +_Data: TypeAlias = str | bytes | bytearray class BaseSerializer: - content_types: Any - key: Any - def get_content_type(self): ... - def loads(self, data) -> None: ... - def dumps(self, data) -> None: ... + content_types: list[str] | None + key: str | None + def get_content_type(self) -> str: ... + def loads(self, data: _Data) -> Any: ... + def dumps(self, data: _Data) -> Any: ... class JsonSerializer(BaseSerializer): - content_types: Any + content_types: list[str] key: str - def loads(self, data): ... - def dumps(self, data): ... class YamlSerializer(BaseSerializer): - content_types: Any + content_types: list[str] key: str - def loads(self, data): ... - def dumps(self, data): ... class Serializer: - serializers: Any - default: Any - def __init__(self, default: Any | None = ..., serializers: Any | None = ...) -> None: ... - def get_serializer(self, name: Any | None = ..., content_type: Any | None = ...): ... - def loads(self, data, format: Any | None = ...): ... - def dumps(self, data, format: Any | None = ...): ... - def get_content_type(self, format: Any | None = ...): ... + serializers: list[BaseSerializer] + default: str + def __init__(self, default: str | None = ..., serializers: list[BaseSerializer] | None = ...) -> None: ... + def get_serializer(self, name: str | None = ..., content_type: str | None = ...) -> BaseSerializer: ... + def loads(self, data: _Data, format: str | None = ...) -> Any: ... + def dumps(self, data: _Data, format: str | None = ...) -> Any: ... + def get_content_type(self, format: str | None = ...) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/slumber/slumber/utils.pyi b/packages/pyright-internal/typeshed-fallback/stubs/slumber/slumber/utils.pyi index 818c5a39f..3dc0c9ee6 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/slumber/slumber/utils.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/slumber/slumber/utils.pyi @@ -1,3 +1,10 @@ -def url_join(base, *args): ... -def copy_kwargs(dictionary): ... -def iterator(d): ... +from collections.abc import ItemsView, Mapping, MutableMapping +from typing import Any, TypeVar + +_KT = TypeVar("_KT") +_VT_co = TypeVar("_VT_co", covariant=True) +_MM = TypeVar("_MM", bound=MutableMapping[Any, Any]) + +def url_join(base: str, *args: str) -> str: ... +def copy_kwargs(dictionary: _MM) -> _MM: ... +def iterator(d: Mapping[_KT, _VT_co]) -> ItemsView[_KT, _VT_co]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/stdlib-list/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/stdlib-list/METADATA.toml index 54042496d..29511ee7d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/stdlib-list/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/stdlib-list/METADATA.toml @@ -1,4 +1 @@ version = "0.8.*" - -[tool.stubtest] -ignore_missing_stub = false diff --git a/packages/pyright-internal/typeshed-fallback/stubs/stripe/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/stripe/METADATA.toml index 204547d94..098add938 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/stripe/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/stripe/METADATA.toml @@ -1 +1,4 @@ version = "3.5.*" + +[tool.stubtest] +ignore_missing_stub = true diff --git a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/__init__.pyi index 3fa008c88..d05cf52b6 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/__init__.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from stripe.api_resources import * @@ -19,4 +20,6 @@ max_network_retries: int ca_bundle_path: Any log: Any -def set_app_info(name, partner_id: Any | None = ..., url: Any | None = ..., version: Any | None = ...) -> None: ... +def set_app_info( + name, partner_id: Incomplete | None = ..., url: Incomplete | None = ..., version: Incomplete | None = ... +) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_requestor.pyi b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_requestor.pyi index 59887448a..858371a18 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_requestor.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_requestor.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from stripe import error as error, http_client as http_client, oauth_error as oauth_error, version as version @@ -11,22 +12,22 @@ class APIRequestor: stripe_account: Any def __init__( self, - key: Any | None = ..., - client: Any | None = ..., - api_base: Any | None = ..., - api_version: Any | None = ..., - account: Any | None = ..., + key: Incomplete | None = ..., + client: Incomplete | None = ..., + api_base: Incomplete | None = ..., + api_version: Incomplete | None = ..., + account: Incomplete | None = ..., ) -> None: ... @classmethod def format_app_info(cls, info): ... - def request(self, method, url, params: Any | None = ..., headers: Any | None = ...): ... - def request_stream(self, method, url, params: Any | None = ..., headers: Any | None = ...): ... + def request(self, method, url, params: Incomplete | None = ..., headers: Incomplete | None = ...): ... + def request_stream(self, method, url, params: Incomplete | None = ..., headers: Incomplete | None = ...): ... def handle_error_response(self, rbody, rcode, resp, rheaders) -> None: ... def specific_api_error(self, rbody, rcode, resp, rheaders, error_data): ... def specific_oauth_error(self, rbody, rcode, resp, rheaders, error_code): ... def request_headers(self, api_key, method): ... def request_raw( - self, method, url, params: Any | None = ..., supplied_headers: Any | None = ..., is_streaming: bool = ... + self, method, url, params: Incomplete | None = ..., supplied_headers: Incomplete | None = ..., is_streaming: bool = ... ): ... def interpret_response(self, rbody, rcode, rheaders): ... def interpret_streaming_response(self, stream, rcode, rheaders): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/__init__.pyi index 0226e34c1..f37d1806c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/__init__.pyi @@ -7,6 +7,7 @@ from stripe.api_resources import ( reporting as reporting, sigma as sigma, terminal as terminal, + test_helpers as test_helpers, ) from stripe.api_resources.account import Account as Account from stripe.api_resources.account_link import AccountLink as AccountLink @@ -58,6 +59,7 @@ from stripe.api_resources.recipient_transfer import RecipientTransfer as Recipie from stripe.api_resources.refund import Refund as Refund from stripe.api_resources.reversal import Reversal as Reversal from stripe.api_resources.review import Review as Review +from stripe.api_resources.search_result_object import SearchResultObject as SearchResultObject from stripe.api_resources.setup_attempt import SetupAttempt as SetupAttempt from stripe.api_resources.setup_intent import SetupIntent as SetupIntent from stripe.api_resources.sku import SKU as SKU diff --git a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/abstract/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/abstract/__init__.pyi index a3d77265c..f73b09fd6 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/abstract/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/abstract/__init__.pyi @@ -6,6 +6,7 @@ from stripe.api_resources.abstract.listable_api_resource import ListableAPIResou from stripe.api_resources.abstract.nested_resource_class_methods import ( nested_resource_class_methods as nested_resource_class_methods, ) +from stripe.api_resources.abstract.searchable_api_resource import SearchableAPIResource as SearchableAPIResource from stripe.api_resources.abstract.singleton_api_resource import SingletonAPIResource as SingletonAPIResource from stripe.api_resources.abstract.updateable_api_resource import UpdateableAPIResource as UpdateableAPIResource from stripe.api_resources.abstract.verify_mixin import VerifyMixin as VerifyMixin diff --git a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/abstract/api_resource.pyi b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/abstract/api_resource.pyi index 70e818328..8891f1133 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/abstract/api_resource.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/abstract/api_resource.pyi @@ -1,13 +1,13 @@ -from _typeshed import Self -from typing import Any +from _typeshed import Incomplete +from typing_extensions import Self from stripe import api_requestor as api_requestor, error as error from stripe.stripe_object import StripeObject as StripeObject class APIResource(StripeObject): @classmethod - def retrieve(cls: type[Self], id, api_key: Any | None = ..., **params) -> Self: ... - def refresh(self: Self) -> Self: ... + def retrieve(cls, id, api_key: Incomplete | None = ..., **params) -> Self: ... + def refresh(self) -> Self: ... @classmethod def class_url(cls) -> str: ... def instance_url(self) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/abstract/createable_api_resource.pyi b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/abstract/createable_api_resource.pyi index 073c37889..1191ea7ff 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/abstract/createable_api_resource.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/abstract/createable_api_resource.pyi @@ -1,5 +1,5 @@ -from _typeshed import Self -from typing import Any +from _typeshed import Incomplete +from typing_extensions import Self from stripe import api_requestor as api_requestor from stripe.api_resources.abstract.api_resource import APIResource as APIResource @@ -7,10 +7,10 @@ from stripe.api_resources.abstract.api_resource import APIResource as APIResourc class CreateableAPIResource(APIResource): @classmethod def create( - cls: type[Self], - api_key: Any | None = ..., + cls, + api_key: Incomplete | None = ..., idempotency_key: str | None = ..., - stripe_version: Any | None = ..., - stripe_account: Any | None = ..., + stripe_version: Incomplete | None = ..., + stripe_account: Incomplete | None = ..., **params, ) -> Self: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/abstract/custom_method.pyi b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/abstract/custom_method.pyi index fc352568f..8ac66a251 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/abstract/custom_method.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/abstract/custom_method.pyi @@ -1,3 +1,3 @@ -from typing import Any +from _typeshed import Incomplete -def custom_method(name, http_verb, http_path: Any | None = ..., is_streaming: bool = ...): ... +def custom_method(name, http_verb, http_path: Incomplete | None = ..., is_streaming: bool = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/abstract/deletable_api_resource.pyi b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/abstract/deletable_api_resource.pyi index 154355211..b82f72b7b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/abstract/deletable_api_resource.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/abstract/deletable_api_resource.pyi @@ -1,7 +1,7 @@ -from _typeshed import Self +from typing_extensions import Self from stripe.api_resources.abstract.api_resource import APIResource as APIResource class DeletableAPIResource(APIResource): @classmethod - def delete(cls: type[Self], sid: str = ..., **params) -> Self: ... + def delete(cls, sid: str = ..., **params) -> Self: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/abstract/listable_api_resource.pyi b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/abstract/listable_api_resource.pyi index 6db62c671..926e41fcf 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/abstract/listable_api_resource.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/abstract/listable_api_resource.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from collections.abc import Iterator from typing import Any @@ -10,5 +11,9 @@ class ListableAPIResource(APIResource): def auto_paging_iter(cls, *args, **params) -> Iterator[Any]: ... @classmethod def list( - cls, api_key: Any | None = ..., stripe_version: Any | None = ..., stripe_account: Any | None = ..., **params + cls, + api_key: Incomplete | None = ..., + stripe_version: Incomplete | None = ..., + stripe_account: Incomplete | None = ..., + **params, ) -> ListObject: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/abstract/nested_resource_class_methods.pyi b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/abstract/nested_resource_class_methods.pyi index 38c2d65fc..080ce1753 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/abstract/nested_resource_class_methods.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/abstract/nested_resource_class_methods.pyi @@ -1,7 +1,7 @@ -from typing import Any +from _typeshed import Incomplete from stripe import api_requestor as api_requestor def nested_resource_class_methods( - resource, path: Any | None = ..., operations: Any | None = ..., resource_plural: Any | None = ... + resource, path: Incomplete | None = ..., operations: Incomplete | None = ..., resource_plural: Incomplete | None = ... ): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/abstract/searchable_api_resource.pyi b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/abstract/searchable_api_resource.pyi new file mode 100644 index 000000000..cf6838613 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/abstract/searchable_api_resource.pyi @@ -0,0 +1,11 @@ +from collections.abc import Iterator +from typing_extensions import Self + +from stripe.api_resources.abstract.api_resource import APIResource as APIResource +from stripe.api_resources.search_result_object import SearchResultObject + +class SearchableAPIResource(APIResource): + @classmethod + def search(cls, *args: str | None, **kwargs) -> SearchResultObject[Self]: ... + @classmethod + def search_auto_paging_iter(cls, *args: str | None, **kwargs) -> Iterator[Self]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/abstract/updateable_api_resource.pyi b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/abstract/updateable_api_resource.pyi index b7ee885f2..ffbcbb141 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/abstract/updateable_api_resource.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/abstract/updateable_api_resource.pyi @@ -1,8 +1,8 @@ -from _typeshed import Self +from typing_extensions import Self from stripe.api_resources.abstract.api_resource import APIResource as APIResource class UpdateableAPIResource(APIResource): @classmethod - def modify(cls: type[Self], sid: str, **params) -> Self: ... - def save(self: Self, idempotency_key: str | None = ...) -> Self: ... + def modify(cls, sid: str, **params) -> Self: ... + def save(self, idempotency_key: str | None = ...) -> Self: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/account.pyi b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/account.pyi index 58c6a4d60..98c789604 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/account.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/account.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete from stripe import oauth as oauth from stripe.api_resources.abstract import ( @@ -14,9 +14,9 @@ class Account(CreateableAPIResource, DeletableAPIResource, ListableAPIResource): OBJECT_NAME: str def reject(self, idempotency_key: str | None = ..., **params): ... @classmethod - def retrieve(cls, id: Any | None = ..., api_key: Any | None = ..., **params): ... + def retrieve(cls, id: Incomplete | None = ..., api_key: Incomplete | None = ..., **params): ... @classmethod - def modify(cls, id: Any | None = ..., **params): ... + def modify(cls, id: Incomplete | None = ..., **params): ... def instance_url(self): ... def persons(self, idempotency_key: str | None = ..., **params): ... def deauthorize(self, **params): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/alipay_account.pyi b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/alipay_account.pyi index f308c7ea5..f18475a67 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/alipay_account.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/alipay_account.pyi @@ -1,4 +1,5 @@ -from typing import Any, NoReturn +from _typeshed import Incomplete +from typing import NoReturn from stripe.api_resources.abstract import ( DeletableAPIResource as DeletableAPIResource, @@ -13,5 +14,10 @@ class AlipayAccount(DeletableAPIResource, UpdateableAPIResource): def modify(cls, customer, id, **params): ... @classmethod def retrieve( - cls, id, api_key: Any | None = ..., stripe_version: Any | None = ..., stripe_account: Any | None = ..., **params + cls, + id, + api_key: Incomplete | None = ..., + stripe_version: Incomplete | None = ..., + stripe_account: Incomplete | None = ..., + **params, ) -> NoReturn: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/application_fee_refund.pyi b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/application_fee_refund.pyi index 948ff9c5c..865bb0fc9 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/application_fee_refund.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/application_fee_refund.pyi @@ -1,5 +1,6 @@ -from _typeshed import Self -from typing import Any, NoReturn +from _typeshed import Incomplete +from typing import NoReturn +from typing_extensions import Self from stripe.api_resources import ApplicationFee as ApplicationFee from stripe.api_resources.abstract import UpdateableAPIResource as UpdateableAPIResource @@ -7,7 +8,7 @@ from stripe.api_resources.abstract import UpdateableAPIResource as UpdateableAPI class ApplicationFeeRefund(UpdateableAPIResource): OBJECT_NAME: str @classmethod - def modify(cls: type[Self], fee, sid: str, **params) -> Self: ... # type: ignore[override] + def modify(cls, fee, sid: str, **params) -> Self: ... # type: ignore[override] def instance_url(self) -> str: ... @classmethod - def retrieve(cls, id, api_key: Any | None = ..., **params) -> NoReturn: ... + def retrieve(cls, id, api_key: Incomplete | None = ..., **params) -> NoReturn: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/bank_account.pyi b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/bank_account.pyi index c09ec6755..5698d9146 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/bank_account.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/bank_account.pyi @@ -1,4 +1,5 @@ -from typing import Any, NoReturn +from _typeshed import Incomplete +from typing import NoReturn from stripe import error as error from stripe.api_resources.abstract import ( @@ -16,5 +17,10 @@ class BankAccount(DeletableAPIResource, UpdateableAPIResource, VerifyMixin): def modify(cls, sid, **params) -> NoReturn: ... @classmethod def retrieve( - cls, id, api_key: Any | None = ..., stripe_version: Any | None = ..., stripe_account: Any | None = ..., **params + cls, + id, + api_key: Incomplete | None = ..., + stripe_version: Incomplete | None = ..., + stripe_account: Incomplete | None = ..., + **params, ) -> NoReturn: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/capability.pyi b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/capability.pyi index a7ceb56b5..fc0a30b36 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/capability.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/capability.pyi @@ -1,4 +1,5 @@ -from typing import Any, NoReturn +from _typeshed import Incomplete +from typing import NoReturn from stripe.api_resources.abstract import UpdateableAPIResource as UpdateableAPIResource from stripe.api_resources.account import Account as Account @@ -9,4 +10,4 @@ class Capability(UpdateableAPIResource): @classmethod def modify(cls, sid, **params) -> NoReturn: ... @classmethod - def retrieve(cls, id, api_key: Any | None = ..., **params) -> NoReturn: ... + def retrieve(cls, id, api_key: Incomplete | None = ..., **params) -> NoReturn: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/card.pyi b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/card.pyi index f6025f163..663cb32b6 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/card.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/card.pyi @@ -1,4 +1,5 @@ -from typing import Any, NoReturn +from _typeshed import Incomplete +from typing import NoReturn from stripe import error as error from stripe.api_resources.abstract import ( @@ -16,5 +17,10 @@ class Card(DeletableAPIResource, UpdateableAPIResource): def modify(cls, sid, **params) -> NoReturn: ... @classmethod def retrieve( - cls, id, api_key: Any | None = ..., stripe_version: Any | None = ..., stripe_account: Any | None = ..., **params + cls, + id, + api_key: Incomplete | None = ..., + stripe_version: Incomplete | None = ..., + stripe_account: Incomplete | None = ..., + **params, ) -> NoReturn: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/charge.pyi b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/charge.pyi index 163793340..a9c624668 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/charge.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/charge.pyi @@ -2,11 +2,12 @@ from stripe import api_requestor as api_requestor from stripe.api_resources.abstract import ( CreateableAPIResource as CreateableAPIResource, ListableAPIResource as ListableAPIResource, + SearchableAPIResource as SearchableAPIResource, UpdateableAPIResource as UpdateableAPIResource, custom_method as custom_method, ) -class Charge(CreateableAPIResource, ListableAPIResource, UpdateableAPIResource): +class Charge(CreateableAPIResource, ListableAPIResource, SearchableAPIResource, UpdateableAPIResource): OBJECT_NAME: str def capture(self, idempotency_key: str | None = ..., **params): ... def refund(self, idempotency_key: str | None = ..., **params): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/checkout/session.pyi b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/checkout/session.pyi index 9e165da4c..47ca10462 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/checkout/session.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/checkout/session.pyi @@ -1,3 +1,5 @@ +from typing import overload + from stripe.api_resources.abstract import ( CreateableAPIResource as CreateableAPIResource, ListableAPIResource as ListableAPIResource, @@ -6,3 +8,9 @@ from stripe.api_resources.abstract import ( class Session(CreateableAPIResource, ListableAPIResource): OBJECT_NAME: str + @overload + @classmethod + def expire(cls, session, api_key=None, stripe_version=None, stripe_account=None, **params): ... + @overload + @classmethod + def expire(cls, idempotency_key: str | None = ..., **params): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/credit_note.pyi b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/credit_note.pyi index c6badb78e..906b80a1e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/credit_note.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/credit_note.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete from stripe import api_requestor as api_requestor from stripe.api_resources.abstract import ( @@ -12,4 +12,10 @@ class CreditNote(CreateableAPIResource, ListableAPIResource, UpdateableAPIResour OBJECT_NAME: str def void_credit_note(self, idempotency_key: str | None = ..., **params): ... @classmethod - def preview(cls, api_key: Any | None = ..., stripe_version: Any | None = ..., stripe_account: Any | None = ..., **params): ... + def preview( + cls, + api_key: Incomplete | None = ..., + stripe_version: Incomplete | None = ..., + stripe_account: Incomplete | None = ..., + **params, + ): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/customer.pyi b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/customer.pyi index 4010c7a5c..36e3327d9 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/customer.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/customer.pyi @@ -3,12 +3,13 @@ from stripe.api_resources.abstract import ( CreateableAPIResource as CreateableAPIResource, DeletableAPIResource as DeletableAPIResource, ListableAPIResource as ListableAPIResource, + SearchableAPIResource as SearchableAPIResource, UpdateableAPIResource as UpdateableAPIResource, custom_method as custom_method, nested_resource_class_methods as nested_resource_class_methods, ) -class Customer(CreateableAPIResource, DeletableAPIResource, ListableAPIResource, UpdateableAPIResource): +class Customer(CreateableAPIResource, DeletableAPIResource, ListableAPIResource, SearchableAPIResource, UpdateableAPIResource): OBJECT_NAME: str def delete_discount(self, **params) -> None: ... @classmethod diff --git a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/customer_balance_transaction.pyi b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/customer_balance_transaction.pyi index 703f9300a..6a27ca9cf 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/customer_balance_transaction.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/customer_balance_transaction.pyi @@ -1,4 +1,5 @@ -from typing import Any, NoReturn +from _typeshed import Incomplete +from typing import NoReturn from stripe.api_resources.abstract import APIResource as APIResource from stripe.api_resources.customer import Customer as Customer @@ -7,4 +8,4 @@ class CustomerBalanceTransaction(APIResource): OBJECT_NAME: str def instance_url(self) -> str: ... @classmethod - def retrieve(cls, id, api_key: Any | None = ..., **params) -> NoReturn: ... + def retrieve(cls, id, api_key: Incomplete | None = ..., **params) -> NoReturn: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/ephemeral_key.pyi b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/ephemeral_key.pyi index 6aca7ef2c..287efb6b1 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/ephemeral_key.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/ephemeral_key.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete from stripe import api_requestor as api_requestor from stripe.api_resources.abstract import DeletableAPIResource as DeletableAPIResource @@ -8,9 +8,9 @@ class EphemeralKey(DeletableAPIResource): @classmethod def create( cls, - api_key: Any | None = ..., + api_key: Incomplete | None = ..., idempotency_key: str | None = ..., - stripe_version: Any | None = ..., - stripe_account: Any | None = ..., + stripe_version: Incomplete | None = ..., + stripe_account: Incomplete | None = ..., **params, ): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/error_object.pyi b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/error_object.pyi index cf13a8410..ba075a8a8 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/error_object.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/error_object.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete from stripe.stripe_object import StripeObject as StripeObject @@ -6,20 +6,20 @@ class ErrorObject(StripeObject): def refresh_from( self, values, - api_key: Any | None = ..., + api_key: Incomplete | None = ..., partial: bool = ..., - stripe_version: Any | None = ..., - stripe_account: Any | None = ..., - last_response: Any | None = ..., + stripe_version: Incomplete | None = ..., + stripe_account: Incomplete | None = ..., + last_response: Incomplete | None = ..., ): ... class OAuthErrorObject(StripeObject): def refresh_from( self, values, - api_key: Any | None = ..., + api_key: Incomplete | None = ..., partial: bool = ..., - stripe_version: Any | None = ..., - stripe_account: Any | None = ..., - last_response: Any | None = ..., + stripe_version: Incomplete | None = ..., + stripe_account: Incomplete | None = ..., + last_response: Incomplete | None = ..., ): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/file.pyi b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/file.pyi index d92200fa7..9c3198560 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/file.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/file.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete from stripe import api_requestor as api_requestor from stripe.api_resources.abstract import ListableAPIResource as ListableAPIResource @@ -11,10 +11,10 @@ class File(ListableAPIResource): @classmethod def create( cls, - api_key: Any | None = ..., - api_version: Any | None = ..., - stripe_version: Any | None = ..., - stripe_account: Any | None = ..., + api_key: Incomplete | None = ..., + api_version: Incomplete | None = ..., + stripe_version: Incomplete | None = ..., + stripe_account: Incomplete | None = ..., **params, ): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/invoice.pyi b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/invoice.pyi index 4aa742c99..50d8c9f31 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/invoice.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/invoice.pyi @@ -1,23 +1,28 @@ -from _typeshed import Self -from typing import Any +from _typeshed import Incomplete +from typing_extensions import Self from stripe import api_requestor as api_requestor from stripe.api_resources.abstract import ( CreateableAPIResource as CreateableAPIResource, DeletableAPIResource as DeletableAPIResource, ListableAPIResource as ListableAPIResource, + SearchableAPIResource as SearchableAPIResource, UpdateableAPIResource as UpdateableAPIResource, custom_method as custom_method, ) -class Invoice(CreateableAPIResource, DeletableAPIResource, ListableAPIResource, UpdateableAPIResource): +class Invoice(CreateableAPIResource, DeletableAPIResource, ListableAPIResource, SearchableAPIResource, UpdateableAPIResource): OBJECT_NAME: str - def finalize_invoice(self: Self, idempotency_key: str | None = ..., **params) -> Self: ... - def mark_uncollectible(self: Self, idempotency_key: str | None = ..., **params) -> Self: ... - def pay(self: Self, idempotency_key: str | None = ..., **params) -> Self: ... - def send_invoice(self: Self, idempotency_key: str | None = ..., **params) -> Self: ... - def void_invoice(self: Self, idempotency_key: str | None = ..., **params) -> Self: ... + def finalize_invoice(self, idempotency_key: str | None = ..., **params) -> Self: ... + def mark_uncollectible(self, idempotency_key: str | None = ..., **params) -> Self: ... + def pay(self, idempotency_key: str | None = ..., **params) -> Self: ... + def send_invoice(self, idempotency_key: str | None = ..., **params) -> Self: ... + def void_invoice(self, idempotency_key: str | None = ..., **params) -> Self: ... @classmethod def upcoming( - cls, api_key: Any | None = ..., stripe_version: Any | None = ..., stripe_account: Any | None = ..., **params + cls, + api_key: Incomplete | None = ..., + stripe_version: Incomplete | None = ..., + stripe_account: Incomplete | None = ..., + **params, ) -> Invoice: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/list_object.pyi b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/list_object.pyi index ca6de089e..be26574ec 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/list_object.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/list_object.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from collections.abc import Iterator from typing import Any @@ -7,18 +8,27 @@ from stripe.stripe_object import StripeObject as StripeObject class ListObject(StripeObject): OBJECT_NAME: str def list( - self, api_key: Any | None = ..., stripe_version: Any | None = ..., stripe_account: Any | None = ..., **params + self, + api_key: Incomplete | None = ..., + stripe_version: Incomplete | None = ..., + stripe_account: Incomplete | None = ..., + **params, ) -> ListObject: ... def create( self, - api_key: Any | None = ..., + api_key: Incomplete | None = ..., idempotency_key: str | None = ..., - stripe_version: Any | None = ..., - stripe_account: Any | None = ..., + stripe_version: Incomplete | None = ..., + stripe_account: Incomplete | None = ..., **params, ): ... def retrieve( - self, id, api_key: Any | None = ..., stripe_version: Any | None = ..., stripe_account: Any | None = ..., **params + self, + id, + api_key: Incomplete | None = ..., + stripe_version: Incomplete | None = ..., + stripe_account: Incomplete | None = ..., + **params, ): ... def __getitem__(self, k): ... def __iter__(self): ... @@ -27,13 +37,21 @@ class ListObject(StripeObject): def auto_paging_iter(self) -> Iterator[Any]: ... @classmethod def empty_list( - cls, api_key: Any | None = ..., stripe_version: Any | None = ..., stripe_account: Any | None = ... + cls, api_key: Incomplete | None = ..., stripe_version: Incomplete | None = ..., stripe_account: Incomplete | None = ... ) -> ListObject: ... @property def is_empty(self) -> bool: ... def next_page( - self, api_key: Any | None = ..., stripe_version: Any | None = ..., stripe_account: Any | None = ..., **params + self, + api_key: Incomplete | None = ..., + stripe_version: Incomplete | None = ..., + stripe_account: Incomplete | None = ..., + **params, ) -> ListObject: ... def previous_page( - self, api_key: Any | None = ..., stripe_version: Any | None = ..., stripe_account: Any | None = ..., **params + self, + api_key: Incomplete | None = ..., + stripe_version: Incomplete | None = ..., + stripe_account: Incomplete | None = ..., + **params, ) -> ListObject: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/payment_intent.pyi b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/payment_intent.pyi index f90e3d447..203ce28f9 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/payment_intent.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/payment_intent.pyi @@ -1,12 +1,22 @@ +from typing import overload + from stripe.api_resources.abstract import ( CreateableAPIResource as CreateableAPIResource, ListableAPIResource as ListableAPIResource, + SearchableAPIResource as SearchableAPIResource, UpdateableAPIResource as UpdateableAPIResource, custom_method as custom_method, ) -class PaymentIntent(CreateableAPIResource, ListableAPIResource, UpdateableAPIResource): +class PaymentIntent(CreateableAPIResource, ListableAPIResource, SearchableAPIResource, UpdateableAPIResource): OBJECT_NAME: str def cancel(self, idempotency_key: str | None = ..., **params): ... def capture(self, idempotency_key: str | None = ..., **params): ... - def confirm(self, idempotency_key: str | None = ..., **params): ... + @overload + @classmethod + def confirm( + cls, intent: str, api_key: str | None = ..., stripe_version: str | None = ..., stripe_account: str | None = ..., **params + ): ... + @overload + @classmethod + def confirm(cls, idempotency_key: str | None = ..., **params): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/payment_method.pyi b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/payment_method.pyi index 4a8f17435..47310ad78 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/payment_method.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/payment_method.pyi @@ -1,4 +1,4 @@ -from _typeshed import Self +from typing_extensions import Self from stripe.api_resources.abstract import ( CreateableAPIResource as CreateableAPIResource, @@ -9,5 +9,5 @@ from stripe.api_resources.abstract import ( class PaymentMethod(CreateableAPIResource, ListableAPIResource, UpdateableAPIResource): OBJECT_NAME: str - def attach(self: Self, idempotency_key: str | None = ..., **params) -> Self: ... - def detach(self: Self, idempotency_key: str | None = ..., **params) -> Self: ... + def attach(self, idempotency_key: str | None = ..., **params) -> Self: ... + def detach(self, idempotency_key: str | None = ..., **params) -> Self: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/person.pyi b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/person.pyi index a380d7433..487ae3472 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/person.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/person.pyi @@ -1,4 +1,5 @@ -from typing import Any, NoReturn +from _typeshed import Incomplete +from typing import NoReturn from stripe.api_resources.abstract import UpdateableAPIResource as UpdateableAPIResource from stripe.api_resources.account import Account as Account @@ -9,4 +10,4 @@ class Person(UpdateableAPIResource): @classmethod def modify(cls, sid, **params) -> NoReturn: ... @classmethod - def retrieve(cls, id, api_key: Any | None = ..., **params) -> NoReturn: ... + def retrieve(cls, id, api_key: Incomplete | None = ..., **params) -> NoReturn: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/price.pyi b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/price.pyi index 7c1c73688..773254d0a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/price.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/price.pyi @@ -1,8 +1,9 @@ from stripe.api_resources.abstract import ( CreateableAPIResource as CreateableAPIResource, ListableAPIResource as ListableAPIResource, + SearchableAPIResource as SearchableAPIResource, UpdateableAPIResource as UpdateableAPIResource, ) -class Price(CreateableAPIResource, ListableAPIResource, UpdateableAPIResource): +class Price(CreateableAPIResource, ListableAPIResource, SearchableAPIResource, UpdateableAPIResource): OBJECT_NAME: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/product.pyi b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/product.pyi index 8e42ea069..10149e003 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/product.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/product.pyi @@ -2,8 +2,9 @@ from stripe.api_resources.abstract import ( CreateableAPIResource as CreateableAPIResource, DeletableAPIResource as DeletableAPIResource, ListableAPIResource as ListableAPIResource, + SearchableAPIResource as SearchableAPIResource, UpdateableAPIResource as UpdateableAPIResource, ) -class Product(CreateableAPIResource, DeletableAPIResource, ListableAPIResource, UpdateableAPIResource): +class Product(CreateableAPIResource, DeletableAPIResource, ListableAPIResource, SearchableAPIResource, UpdateableAPIResource): OBJECT_NAME: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/quote.pyi b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/quote.pyi index cb97dd2ef..fb5a68c5a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/quote.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/quote.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete from stripe import api_requestor as api_requestor from stripe.api_resources.abstract import ( @@ -16,9 +16,9 @@ class Quote(CreateableAPIResource, ListableAPIResource, UpdateableAPIResource): def list_line_items(self, idempotency_key: str | None = ..., **params): ... def pdf( self, - api_key: Any | None = ..., - api_version: Any | None = ..., - stripe_version: Any | None = ..., - stripe_account: Any | None = ..., + api_key: Incomplete | None = ..., + api_version: Incomplete | None = ..., + stripe_version: Incomplete | None = ..., + stripe_account: Incomplete | None = ..., **params, ): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/reversal.pyi b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/reversal.pyi index dff98c054..80d393fe8 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/reversal.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/reversal.pyi @@ -1,4 +1,5 @@ -from typing import Any, NoReturn +from _typeshed import Incomplete +from typing import NoReturn from stripe.api_resources.abstract import UpdateableAPIResource as UpdateableAPIResource from stripe.api_resources.transfer import Transfer as Transfer @@ -9,4 +10,4 @@ class Reversal(UpdateableAPIResource): @classmethod def modify(cls, sid, **params) -> NoReturn: ... @classmethod - def retrieve(cls, id, api_key: Any | None = ..., **params) -> NoReturn: ... + def retrieve(cls, id, api_key: Incomplete | None = ..., **params) -> NoReturn: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/search_result_object.pyi b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/search_result_object.pyi new file mode 100644 index 000000000..e447b5824 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/search_result_object.pyi @@ -0,0 +1,32 @@ +from collections.abc import Iterator +from typing import Any, ClassVar, Generic, TypeVar +from typing_extensions import Literal, Self + +from stripe.stripe_object import StripeObject + +_T = TypeVar("_T") + +class SearchResultObject(StripeObject, Generic[_T]): + OBJECT_NAME: ClassVar[Literal["search_result"]] + url: str + has_more: bool + data: list[_T] + next_page: str + total_count: int + + def search( + self, api_key: str | None = ..., stripe_version: str | None = ..., stripe_account: str | None = ..., **params + ) -> Self: ... + def __getitem__(self, k: str) -> Any: ... + def __iter__(self) -> Iterator[_T]: ... + def __len__(self) -> int: ... + def auto_paging_iter(self) -> Iterator[_T]: ... + @classmethod + def empty_search_result( + cls, api_key: str | None = ..., stripe_version: str | None = ..., stripe_account: str | None = ... + ) -> Self: ... + @property + def is_empty(self) -> bool: ... + def next_search_result_page( + self, api_key: str | None = ..., stripe_version: str | None = ..., stripe_account: str | None = ..., **params + ) -> Self: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/subscription.pyi b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/subscription.pyi index ddd2ce49b..511d2aefe 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/subscription.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/subscription.pyi @@ -3,10 +3,13 @@ from stripe.api_resources.abstract import ( CreateableAPIResource as CreateableAPIResource, DeletableAPIResource as DeletableAPIResource, ListableAPIResource as ListableAPIResource, + SearchableAPIResource as SearchableAPIResource, UpdateableAPIResource as UpdateableAPIResource, custom_method as custom_method, ) -class Subscription(CreateableAPIResource, DeletableAPIResource, ListableAPIResource, UpdateableAPIResource): +class Subscription( + CreateableAPIResource, DeletableAPIResource, ListableAPIResource, SearchableAPIResource, UpdateableAPIResource +): OBJECT_NAME: str def delete_discount(self, **params) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/tax_id.pyi b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/tax_id.pyi index 3bd167ad4..38432e329 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/tax_id.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/tax_id.pyi @@ -1,4 +1,5 @@ -from typing import Any, NoReturn +from _typeshed import Incomplete +from typing import NoReturn from stripe.api_resources.abstract import APIResource as APIResource from stripe.api_resources.customer import Customer as Customer @@ -7,4 +8,4 @@ class TaxId(APIResource): OBJECT_NAME: str def instance_url(self) -> str: ... @classmethod - def retrieve(cls, id, api_key: Any | None = ..., **params) -> NoReturn: ... + def retrieve(cls, id, api_key: Incomplete | None = ..., **params) -> NoReturn: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/test_helpers/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/test_helpers/__init__.pyi new file mode 100644 index 000000000..ec08b0c25 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/test_helpers/__init__.pyi @@ -0,0 +1 @@ +from stripe.api_resources.test_helpers.test_clock import TestClock as TestClock diff --git a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/test_helpers/test_clock.pyi b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/test_helpers/test_clock.pyi new file mode 100644 index 000000000..3caf15ecc --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/test_helpers/test_clock.pyi @@ -0,0 +1,10 @@ +from typing import Any +from typing_extensions import Literal, Self + +from stripe.api_resources.abstract import CreateableAPIResource, DeletableAPIResource, ListableAPIResource + +class TestClock(CreateableAPIResource, DeletableAPIResource, ListableAPIResource): + OBJECT_NAME: Literal["test_helpers.test_clock"] + + @classmethod + def advance(cls, idempotency_key: str | None = ..., **params: Any) -> Self: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/usage_record.pyi b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/usage_record.pyi index 14dd15c2d..61bd11ab0 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/usage_record.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/usage_record.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete from stripe import api_requestor as api_requestor from stripe.api_resources.abstract.api_resource import APIResource as APIResource @@ -8,9 +8,9 @@ class UsageRecord(APIResource): @classmethod def create( cls, - api_key: Any | None = ..., + api_key: Incomplete | None = ..., idempotency_key: str | None = ..., - stripe_version: Any | None = ..., - stripe_account: Any | None = ..., + stripe_version: Incomplete | None = ..., + stripe_account: Incomplete | None = ..., **params, ): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/error.pyi b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/error.pyi index fcda1ba3e..98b8bc17e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/error.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/error.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any class StripeError(Exception): @@ -10,12 +11,12 @@ class StripeError(Exception): error: Any def __init__( self, - message: Any | None = ..., - http_body: Any | None = ..., - http_status: Any | None = ..., - json_body: Any | None = ..., - headers: Any | None = ..., - code: Any | None = ..., + message: Incomplete | None = ..., + http_body: Incomplete | None = ..., + http_status: Incomplete | None = ..., + json_body: Incomplete | None = ..., + headers: Incomplete | None = ..., + code: Incomplete | None = ..., ) -> None: ... @property def user_message(self): ... @@ -28,11 +29,11 @@ class APIConnectionError(StripeError): def __init__( self, message, - http_body: Any | None = ..., - http_status: Any | None = ..., - json_body: Any | None = ..., - headers: Any | None = ..., - code: Any | None = ..., + http_body: Incomplete | None = ..., + http_status: Incomplete | None = ..., + json_body: Incomplete | None = ..., + headers: Incomplete | None = ..., + code: Incomplete | None = ..., should_retry: bool = ..., ) -> None: ... @@ -45,10 +46,10 @@ class CardError(StripeErrorWithParamCode): message, param, code, - http_body: Any | None = ..., - http_status: Any | None = ..., - json_body: Any | None = ..., - headers: Any | None = ..., + http_body: Incomplete | None = ..., + http_status: Incomplete | None = ..., + json_body: Incomplete | None = ..., + headers: Incomplete | None = ..., ) -> None: ... class IdempotencyError(StripeError): ... @@ -59,11 +60,11 @@ class InvalidRequestError(StripeErrorWithParamCode): self, message, param, - code: Any | None = ..., - http_body: Any | None = ..., - http_status: Any | None = ..., - json_body: Any | None = ..., - headers: Any | None = ..., + code: Incomplete | None = ..., + http_body: Incomplete | None = ..., + http_status: Incomplete | None = ..., + json_body: Incomplete | None = ..., + headers: Incomplete | None = ..., ) -> None: ... class AuthenticationError(StripeError): ... @@ -72,4 +73,4 @@ class RateLimitError(StripeError): ... class SignatureVerificationError(StripeError): sig_header: Any - def __init__(self, message, sig_header, http_body: Any | None = ...) -> None: ... + def __init__(self, message, sig_header, http_body: Incomplete | None = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/http_client.pyi b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/http_client.pyi index cc65f9c6a..968e29ba7 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/http_client.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/http_client.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from stripe import error as error @@ -14,38 +15,38 @@ class HTTPClient: MAX_DELAY: int INITIAL_DELAY: float MAX_RETRY_AFTER: int - def __init__(self, verify_ssl_certs: bool = ..., proxy: Any | None = ...) -> None: ... - def request_with_retries(self, method, url, headers, post_data: Any | None = ...): ... - def request_stream_with_retries(self, method, url, headers, post_data: Any | None = ...): ... - def request(self, method, url, headers, post_data: Any | None = ...) -> None: ... - def request_stream(self, method, url, headers, post_data: Any | None = ...) -> None: ... + def __init__(self, verify_ssl_certs: bool = ..., proxy: Incomplete | None = ...) -> None: ... + def request_with_retries(self, method, url, headers, post_data: Incomplete | None = ...): ... + def request_stream_with_retries(self, method, url, headers, post_data: Incomplete | None = ...): ... + def request(self, method, url, headers, post_data: Incomplete | None = ...) -> None: ... + def request_stream(self, method, url, headers, post_data: Incomplete | None = ...) -> None: ... def close(self) -> None: ... class RequestsClient(HTTPClient): name: str - def __init__(self, timeout: int = ..., session: Any | None = ..., **kwargs) -> None: ... - def request(self, method, url, headers, post_data: Any | None = ...): ... - def request_stream(self, method, url, headers, post_data: Any | None = ...): ... + def __init__(self, timeout: int = ..., session: Incomplete | None = ..., **kwargs) -> None: ... + def request(self, method, url, headers, post_data: Incomplete | None = ...): ... + def request_stream(self, method, url, headers, post_data: Incomplete | None = ...): ... def close(self) -> None: ... class UrlFetchClient(HTTPClient): name: str - def __init__(self, verify_ssl_certs: bool = ..., proxy: Any | None = ..., deadline: int = ...) -> None: ... - def request(self, method, url, headers, post_data: Any | None = ...): ... - def request_stream(self, method, url, headers, post_data: Any | None = ...): ... + def __init__(self, verify_ssl_certs: bool = ..., proxy: Incomplete | None = ..., deadline: int = ...) -> None: ... + def request(self, method, url, headers, post_data: Incomplete | None = ...): ... + def request_stream(self, method, url, headers, post_data: Incomplete | None = ...): ... def close(self) -> None: ... class PycurlClient(HTTPClient): name: str - def __init__(self, verify_ssl_certs: bool = ..., proxy: Any | None = ...) -> None: ... + def __init__(self, verify_ssl_certs: bool = ..., proxy: Incomplete | None = ...) -> None: ... def parse_headers(self, data): ... - def request(self, method, url, headers, post_data: Any | None = ...): ... - def request_stream(self, method, url, headers, post_data: Any | None = ...): ... + def request(self, method, url, headers, post_data: Incomplete | None = ...): ... + def request_stream(self, method, url, headers, post_data: Incomplete | None = ...): ... def close(self) -> None: ... class Urllib2Client(HTTPClient): name: str - def __init__(self, verify_ssl_certs: bool = ..., proxy: Any | None = ...) -> None: ... - def request(self, method, url, headers, post_data: Any | None = ...): ... - def request_stream(self, method, url, headers, post_data: Any | None = ...): ... + def __init__(self, verify_ssl_certs: bool = ..., proxy: Incomplete | None = ...) -> None: ... + def request(self, method, url, headers, post_data: Incomplete | None = ...): ... + def request_stream(self, method, url, headers, post_data: Incomplete | None = ...): ... def close(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/oauth.pyi b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/oauth.pyi index 979652c02..ecec5d532 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/oauth.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/oauth.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete from stripe import api_requestor as api_requestor, connect_api_base as connect_api_base, error as error @@ -6,6 +6,6 @@ class OAuth: @staticmethod def authorize_url(express: bool = ..., **params): ... @staticmethod - def token(api_key: Any | None = ..., **params): ... + def token(api_key: Incomplete | None = ..., **params): ... @staticmethod - def deauthorize(api_key: Any | None = ..., **params): ... + def deauthorize(api_key: Incomplete | None = ..., **params): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/oauth_error.pyi b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/oauth_error.pyi index b963512e7..a639ed027 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/oauth_error.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/oauth_error.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete from stripe.error import StripeError as StripeError @@ -7,10 +7,10 @@ class OAuthError(StripeError): self, code, description, - http_body: Any | None = ..., - http_status: Any | None = ..., - json_body: Any | None = ..., - headers: Any | None = ..., + http_body: Incomplete | None = ..., + http_status: Incomplete | None = ..., + json_body: Incomplete | None = ..., + headers: Incomplete | None = ..., ) -> None: ... def construct_error_object(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/stripe_object.pyi b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/stripe_object.pyi index 6b93f44c7..cfb021b26 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/stripe_object.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/stripe_object.pyi @@ -1,6 +1,7 @@ import json -from _typeshed import Self +from _typeshed import Incomplete from typing import Any +from typing_extensions import Self from stripe import api_requestor as api_requestor @@ -10,31 +11,31 @@ class StripeObject(dict[Any, Any]): def __init__( self, - id: Any | None = ..., - api_key: Any | None = ..., - stripe_version: Any | None = ..., - stripe_account: Any | None = ..., - last_response: Any | None = ..., + id: Incomplete | None = ..., + api_key: Incomplete | None = ..., + stripe_version: Incomplete | None = ..., + stripe_account: Incomplete | None = ..., + last_response: Incomplete | None = ..., **params, ) -> None: ... @property def last_response(self): ... def update(self, update_dict): ... - def __setattr__(self, k, v): ... - def __getattr__(self, k): ... - def __delattr__(self, k): ... + def __setattr__(self, k: str, v) -> None: ... + def __getattr__(self, k: str): ... + def __delattr__(self, k: str) -> None: ... def __setitem__(self, k, v) -> None: ... def __getitem__(self, k): ... def __delitem__(self, k) -> None: ... def __reduce__(self): ... @classmethod def construct_from( - cls: type[Self], + cls, values: Any, key: str | None, - stripe_version: Any | None = ..., - stripe_account: Any | None = ..., - last_response: Any | None = ..., + stripe_version: Incomplete | None = ..., + stripe_account: Incomplete | None = ..., + last_response: Incomplete | None = ..., ) -> Self: ... api_key: Any stripe_version: Any @@ -42,16 +43,16 @@ class StripeObject(dict[Any, Any]): def refresh_from( self, values: Any, - api_key: Any | None = ..., + api_key: Incomplete | None = ..., partial: bool = ..., - stripe_version: Any | None = ..., - stripe_account: Any | None = ..., - last_response: Any | None = ..., + stripe_version: Incomplete | None = ..., + stripe_account: Incomplete | None = ..., + last_response: Incomplete | None = ..., ) -> None: ... @classmethod def api_base(cls) -> None: ... - def request(self, method, url, params: Any | None = ..., headers: Any | None = ...): ... - def request_stream(self, method, url, params: Any | None = ..., headers: Any | None = ...): ... + def request(self, method, url, params: Incomplete | None = ..., headers: Incomplete | None = ...): ... + def request_stream(self, method, url, params: Incomplete | None = ..., headers: Incomplete | None = ...): ... def to_dict(self): ... def to_dict_recursive(self): ... @property diff --git a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/util.pyi b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/util.pyi index 7aef8744b..af50ed9bc 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/util.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/util.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any, overload from typing_extensions import TypeAlias @@ -15,7 +16,7 @@ class class_method_variant: def __init__(self, class_method_name) -> None: ... method: Any def __call__(self, method): ... - def __get__(self, obj, objtype: Any | None = ...): ... + def __get__(self, obj, objtype: Incomplete | None = ...): ... @overload def populate_headers(idempotency_key: None) -> None: ... @@ -27,9 +28,15 @@ _RespType: TypeAlias = dict[Any, Any] | StripeObject | StripeResponse # undocumented @overload def convert_to_stripe_object( - resp: list[Any], api_key: Any | None = ..., stripe_version: Any | None = ..., stripe_account: Any | None = ... + resp: list[Any], + api_key: Incomplete | None = ..., + stripe_version: Incomplete | None = ..., + stripe_account: Incomplete | None = ..., ) -> list[Any]: ... @overload def convert_to_stripe_object( - resp: _RespType, api_key: Any | None = ..., stripe_version: Any | None = ..., stripe_account: Any | None = ... + resp: _RespType, + api_key: Incomplete | None = ..., + stripe_version: Incomplete | None = ..., + stripe_account: Incomplete | None = ..., ) -> StripeObject: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/tabulate/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/tabulate/METADATA.toml index 54042496d..51e869b47 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/tabulate/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/tabulate/METADATA.toml @@ -1,4 +1 @@ -version = "0.8.*" - -[tool.stubtest] -ignore_missing_stub = false +version = "0.9.*" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/tabulate/tabulate.pyi b/packages/pyright-internal/typeshed-fallback/stubs/tabulate/tabulate.pyi deleted file mode 100644 index bba1e8d2f..000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/tabulate/tabulate.pyi +++ /dev/null @@ -1,49 +0,0 @@ -from collections.abc import Callable, Container, Iterable, Mapping, Sequence -from typing import Any, NamedTuple -from typing_extensions import TypeAlias - -LATEX_ESCAPE_RULES: dict[str, str] -MIN_PADDING: int -PRESERVE_WHITESPACE: bool -WIDE_CHARS_MODE: bool -multiline_formats: dict[str, str] -tabulate_formats: list[str] - -class Line(NamedTuple): - begin: str - hline: str - sep: str - end: str - -class DataRow(NamedTuple): - begin: str - sep: str - end: str - -_TableFormatLine: TypeAlias = None | Line | Callable[[list[int], list[str]], str] -_TableFormatRow: TypeAlias = None | DataRow | Callable[[list[Any], list[int], list[str]], str] - -class TableFormat(NamedTuple): - lineabove: _TableFormatLine - linebelowheader: _TableFormatLine - linebetweenrows: _TableFormatLine - linebelow: _TableFormatLine - headerrow: _TableFormatRow - datarow: _TableFormatRow - padding: int - with_header_hide: Container[str] | None - -def simple_separated_format(separator: str) -> TableFormat: ... -def tabulate( - tabular_data: Mapping[str, Iterable[Any]] | Iterable[Iterable[Any]], - headers: str | dict[str, str] | Sequence[str] = ..., - tablefmt: str | TableFormat = ..., - floatfmt: str | Iterable[str] = ..., - numalign: str | None = ..., - stralign: str | None = ..., - missingval: str | Iterable[str] = ..., - showindex: str | bool | Iterable[Any] = ..., - disable_numparse: bool | Iterable[int] = ..., - colalign: Iterable[str | None] | None = ..., - maxcolwidths: int | Iterable[int | None] | None = ..., -) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/tabulate/tabulate/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/tabulate/tabulate/__init__.pyi new file mode 100644 index 000000000..31d625e76 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/tabulate/tabulate/__init__.pyi @@ -0,0 +1,65 @@ +from collections.abc import Callable, Container, Iterable, Mapping, Sequence +from typing import Any, NamedTuple +from typing_extensions import Final, Self, TypeAlias + +from .version import __version__ as __version__ + +__all__ = ["tabulate", "tabulate_formats", "simple_separated_format"] + +# These constants are meant to be configurable +# https://github.com/astanin/python-tabulate#text-formatting +PRESERVE_WHITESPACE: bool +MIN_PADDING: int +# https://github.com/astanin/python-tabulate#wide-fullwidth-cjk-symbols +WIDE_CHARS_MODE: bool +SEPARATING_LINE: str + +class Line(NamedTuple): + begin: str + hline: str + sep: str + end: str + +class DataRow(NamedTuple): + begin: str + sep: str + end: str + +_TableFormatLine: TypeAlias = None | Line | Callable[[list[int], list[str]], str] +_TableFormatRow: TypeAlias = None | DataRow | Callable[[list[Any], list[int], list[str]], str] + +class TableFormat(NamedTuple): + lineabove: _TableFormatLine + linebelowheader: _TableFormatLine + linebetweenrows: _TableFormatLine + linebelow: _TableFormatLine + headerrow: _TableFormatRow + datarow: _TableFormatRow + padding: int + with_header_hide: Container[str] | None + +LATEX_ESCAPE_RULES: Final[dict[str, str]] +tabulate_formats: list[str] +multiline_formats: dict[str, str] + +def simple_separated_format(separator: str) -> TableFormat: ... +def tabulate( + tabular_data: Mapping[str, Iterable[Any]] | Iterable[Iterable[Any]], + headers: str | dict[str, str] | Sequence[str] = ..., + tablefmt: str | TableFormat = ..., + floatfmt: str | Iterable[str] = ..., + intfmt: str | Iterable[str] = ..., + numalign: str | None = ..., + stralign: str | None = ..., + missingval: str | Iterable[str] = ..., + showindex: str | bool | Iterable[Any] = ..., + disable_numparse: bool | Iterable[int] = ..., + colalign: Iterable[str | None] | None = ..., + maxcolwidths: int | Iterable[int | None] | None = ..., + rowalign: str | Iterable[str] | None = ..., + maxheadercolwidths: int | Iterable[int] | None = ..., +) -> str: ... + +class JupyterHTMLStr(str): + @property + def str(self) -> Self: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/tabulate/tabulate/version.pyi b/packages/pyright-internal/typeshed-fallback/stubs/tabulate/tabulate/version.pyi new file mode 100644 index 000000000..e77997710 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/tabulate/tabulate/version.pyi @@ -0,0 +1,6 @@ +from typing_extensions import Final + +version: Final[str] +__version__: Final[str] +version_tuple: Final[tuple[int, int, int]] +__version_tuple__: Final[tuple[int, int, int]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/termcolor/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/termcolor/METADATA.toml index 3706c3339..cfdea080c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/termcolor/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/termcolor/METADATA.toml @@ -1,4 +1,2 @@ version = "1.1.*" - -[tool.stubtest] -ignore_missing_stub = false +obsolete_since = "2.0.0" # Released on 2022-09-11 diff --git a/packages/pyright-internal/typeshed-fallback/stubs/toml/toml/encoder.pyi b/packages/pyright-internal/typeshed-fallback/stubs/toml/toml/encoder.pyi index 992b18e2b..c8be27da7 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/toml/toml/encoder.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/toml/toml/encoder.pyi @@ -16,7 +16,7 @@ class TomlEncoder(Generic[_MappingT]): @overload def __init__(self: TomlEncoder[dict[str, Any]], _dict: type[dict[str, Any]] = ..., preserve: bool = ...) -> None: ... def get_empty_table(self) -> _MappingT: ... - def dump_list(self, v: Iterable[object]) -> str: ... + def dump_list(self, v: Iterable[Any]) -> str: ... def dump_inline_table(self, section: dict[str, Any] | Any) -> str: ... def dump_value(self, v: Any) -> str: ... def dump_sections(self, o: _MappingT, sup: str) -> tuple[str, _MappingT]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/toml/toml/tz.pyi b/packages/pyright-internal/typeshed-fallback/stubs/toml/toml/tz.pyi index 398a3e5cd..054226bf7 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/toml/toml/tz.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/toml/toml/tz.pyi @@ -1,10 +1,10 @@ -from _typeshed import Self from datetime import datetime, timedelta, tzinfo from typing import Any +from typing_extensions import Self class TomlTz(tzinfo): def __init__(self, toml_offset: str) -> None: ... - def __deepcopy__(self: Self, memo: Any) -> Self: ... + def __deepcopy__(self, memo: Any) -> Self: ... def tzname(self, dt: datetime | None) -> str: ... def utcoffset(self, dt: datetime | None) -> timedelta: ... def dst(self, dt: datetime | None) -> timedelta: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/toposort/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/toposort/METADATA.toml index 2312745b6..5e0301ec6 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/toposort/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/toposort/METADATA.toml @@ -1,4 +1 @@ -version = "1.7" - -[tool.stubtest] -ignore_missing_stub = false +version = "1.10" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/tqdm/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/tqdm/METADATA.toml index 328bb0b8b..987d23754 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/tqdm/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/tqdm/METADATA.toml @@ -1 +1,5 @@ -version = "4.64.*" +version = "4.65.*" + +[tool.stubtest] +extras = ["slack", "telegram"] +stubtest_requirements = ["dask", "pandas", "rich", "tensorflow"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/asyncio.pyi b/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/asyncio.pyi index c8997b2d2..488fadbfe 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/asyncio.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/asyncio.pyi @@ -1,6 +1,7 @@ -from _typeshed import Incomplete, Self, SupportsWrite +from _typeshed import Incomplete, SupportsWrite from collections.abc import Awaitable, Callable, Generator, Iterable, Iterator, Mapping from typing import Generic, NoReturn, TypeVar, overload +from typing_extensions import Self from .std import tqdm as std_tqdm @@ -13,7 +14,7 @@ class tqdm_asyncio(Generic[_T], std_tqdm[_T]): iterable_next: Callable[[], _T | Awaitable[_T]] iterable_iterator: Iterator[_T] - def __aiter__(self: Self) -> Self: ... + def __aiter__(self) -> Self: ... async def __anext__(self) -> Awaitable[_T]: ... def send(self, *args, **kwargs): ... @classmethod @@ -25,14 +26,14 @@ class tqdm_asyncio(Generic[_T], std_tqdm[_T]): timeout: float | None = ..., total: int | None = ..., desc: str | None = ..., - leave: bool = ..., + leave: bool | None = ..., file: SupportsWrite[str] | None = ..., ncols: int | None = ..., mininterval: float = ..., maxinterval: float = ..., miniters: float | None = ..., ascii: bool | str | None = ..., - disable: bool = ..., + disable: bool | None = ..., unit: str = ..., unit_scale: bool | float = ..., dynamic_ncols: bool = ..., @@ -57,14 +58,14 @@ class tqdm_asyncio(Generic[_T], std_tqdm[_T]): total: int | None = ..., iterable: Iterable[_T] = ..., desc: str | None = ..., - leave: bool = ..., + leave: bool | None = ..., file: SupportsWrite[str] | None = ..., ncols: int | None = ..., mininterval: float = ..., maxinterval: float = ..., miniters: float | None = ..., ascii: bool | str | None = ..., - disable: bool = ..., + disable: bool | None = ..., unit: str = ..., unit_scale: bool | float = ..., dynamic_ncols: bool = ..., @@ -86,14 +87,14 @@ class tqdm_asyncio(Generic[_T], std_tqdm[_T]): iterable: Iterable[_T], desc: str | None = ..., total: float | None = ..., - leave: bool = ..., + leave: bool | None = ..., file: SupportsWrite[str] | None = ..., ncols: int | None = ..., mininterval: float = ..., maxinterval: float = ..., miniters: float | None = ..., ascii: bool | str | None = ..., - disable: bool = ..., + disable: bool | None = ..., unit: str = ..., unit_scale: bool | float = ..., dynamic_ncols: bool = ..., @@ -117,14 +118,14 @@ class tqdm_asyncio(Generic[_T], std_tqdm[_T]): iterable: None = ..., desc: str | None = ..., total: float | None = ..., - leave: bool = ..., + leave: bool | None = ..., file: SupportsWrite[str] | None = ..., ncols: int | None = ..., mininterval: float = ..., maxinterval: float = ..., miniters: float | None = ..., ascii: bool | str | None = ..., - disable: bool = ..., + disable: bool | None = ..., unit: str = ..., unit_scale: bool | float = ..., dynamic_ncols: bool = ..., @@ -151,14 +152,14 @@ def tarange( *, desc: str | None = ..., total: float | None = ..., - leave: bool = ..., + leave: bool | None = ..., file: SupportsWrite[str] | None = ..., ncols: int | None = ..., mininterval: float = ..., maxinterval: float = ..., miniters: float | None = ..., ascii: bool | str | None = ..., - disable: bool = ..., + disable: bool | None = ..., unit: str = ..., unit_scale: bool | float = ..., dynamic_ncols: bool = ..., @@ -180,14 +181,14 @@ def tarange( *, desc: str | None = ..., total: float | None = ..., - leave: bool = ..., + leave: bool | None = ..., file: SupportsWrite[str] | None = ..., ncols: int | None = ..., mininterval: float = ..., maxinterval: float = ..., miniters: float | None = ..., ascii: bool | str | None = ..., - disable: bool = ..., + disable: bool | None = ..., unit: str = ..., unit_scale: bool | float = ..., dynamic_ncols: bool = ..., diff --git a/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/contrib/discord.pyi b/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/contrib/discord.pyi index 80b448443..4f2702e35 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/contrib/discord.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/contrib/discord.pyi @@ -23,14 +23,14 @@ class tqdm_discord(Generic[_T], tqdm_auto[_T]): iterable: Iterable[_T], desc: str | None = ..., total: float | None = ..., - leave: bool = ..., + leave: bool | None = ..., file: SupportsWrite[str] | None = ..., ncols: int | None = ..., mininterval: float = ..., maxinterval: float = ..., miniters: float | None = ..., ascii: bool | str | None = ..., - disable: bool = ..., + disable: bool | None = ..., unit: str = ..., unit_scale: bool | float = ..., dynamic_ncols: bool = ..., @@ -54,14 +54,14 @@ class tqdm_discord(Generic[_T], tqdm_auto[_T]): iterable: None = ..., desc: str | None = ..., total: float | None = ..., - leave: bool = ..., + leave: bool | None = ..., file: SupportsWrite[str] | None = ..., ncols: int | None = ..., mininterval: float = ..., maxinterval: float = ..., miniters: float | None = ..., ascii: bool | str | None = ..., - disable: bool = ..., + disable: bool | None = ..., unit: str = ..., unit_scale: bool | float = ..., dynamic_ncols: bool = ..., diff --git a/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/contrib/logging.pyi b/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/contrib/logging.pyi index f88587879..0bb9e0e4e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/contrib/logging.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/contrib/logging.pyi @@ -13,7 +13,9 @@ def logging_redirect_tqdm( ) -> _GeneratorContextManager[None]: ... # TODO type *args, **kwargs here more precisely +# The type ignore is because mypy complains that the second overload will never be matched +# (I'm not sure that's true) @overload def tqdm_logging_redirect(*args, tqdm_class: Callable[..., _TqdmT], **kwargs) -> _GeneratorContextManager[_TqdmT]: ... @overload -def tqdm_logging_redirect(*args, **kwargs) -> _GeneratorContextManager[std_tqdm[Incomplete]]: ... +def tqdm_logging_redirect(*args, **kwargs) -> _GeneratorContextManager[std_tqdm[Incomplete]]: ... # type: ignore[misc] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/contrib/slack.pyi b/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/contrib/slack.pyi index e1900c5d7..cf69b09e6 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/contrib/slack.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/contrib/slack.pyi @@ -24,14 +24,14 @@ class tqdm_slack(Generic[_T], tqdm_auto[_T]): iterable: Iterable[_T], desc: str | None = ..., total: float | None = ..., - leave: bool = ..., + leave: bool | None = ..., file: SupportsWrite[str] | None = ..., ncols: int | None = ..., mininterval: float = ..., maxinterval: float = ..., miniters: float | None = ..., ascii: bool | str | None = ..., - disable: bool = ..., + disable: bool | None = ..., unit: str = ..., unit_scale: bool | float = ..., dynamic_ncols: bool = ..., @@ -57,14 +57,14 @@ class tqdm_slack(Generic[_T], tqdm_auto[_T]): iterable: None = ..., desc: str | None = ..., total: float | None = ..., - leave: bool = ..., + leave: bool | None = ..., file: SupportsWrite[str] | None = ..., ncols: int | None = ..., mininterval: float = ..., maxinterval: float = ..., miniters: float | None = ..., ascii: bool | str | None = ..., - disable: bool = ..., + disable: bool | None = ..., unit: str = ..., unit_scale: bool | float = ..., dynamic_ncols: bool = ..., diff --git a/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/contrib/telegram.pyi b/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/contrib/telegram.pyi index 3af87142f..fa77d2db1 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/contrib/telegram.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/contrib/telegram.pyi @@ -29,14 +29,14 @@ class tqdm_telegram(Generic[_T], tqdm_auto[_T]): iterable: Iterable[_T], desc: str | None = ..., total: float | None = ..., - leave: bool = ..., + leave: bool | None = ..., file: SupportsWrite[str] | None = ..., ncols: int | None = ..., mininterval: float = ..., maxinterval: float = ..., miniters: float | None = ..., ascii: bool | str | None = ..., - disable: bool = ..., + disable: bool | None = ..., unit: str = ..., unit_scale: bool | float = ..., dynamic_ncols: bool = ..., @@ -62,14 +62,14 @@ class tqdm_telegram(Generic[_T], tqdm_auto[_T]): iterable: None = ..., desc: str | None = ..., total: float | None = ..., - leave: bool = ..., + leave: bool | None = ..., file: SupportsWrite[str] | None = ..., ncols: int | None = ..., mininterval: float = ..., maxinterval: float = ..., miniters: float | None = ..., ascii: bool | str | None = ..., - disable: bool = ..., + disable: bool | None = ..., unit: str = ..., unit_scale: bool | float = ..., dynamic_ncols: bool = ..., diff --git a/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/contrib/utils_worker.pyi b/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/contrib/utils_worker.pyi index bd84e5154..bff826211 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/contrib/utils_worker.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/contrib/utils_worker.pyi @@ -13,5 +13,4 @@ _R = TypeVar("_R") class MonoWorker: pool: ThreadPoolExecutor futures: deque[Future[Incomplete]] - def __init__(self) -> None: ... def submit(self, func: Callable[_P, _R], *args: _P.args, **kwargs: _P.kwargs) -> Future[_R]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/dask.pyi b/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/dask.pyi index 250975061..28dd1195c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/dask.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/dask.pyi @@ -1,10 +1,25 @@ from _typeshed import Incomplete -from typing import Any -from typing_extensions import TypeAlias +from collections.abc import Callable +from typing import ClassVar +from typing_extensions import Self __all__ = ["TqdmCallback"] -_Callback: TypeAlias = Any # Actually dask.callbacks.Callback +# dask.callbacks.Callback +class _Callback: + active: ClassVar[set[tuple[Callable[..., Incomplete] | None, ...]]] + def __init__( + self, + start: Incomplete | None, + start_state: Incomplete | None, + pretask: Incomplete | None, + posttask: Incomplete | None, + finish: Incomplete | None, + ) -> None: ... + def __enter__(self) -> Self: ... + def __exit__(self, *args: object) -> None: ... + def register(self) -> None: ... + def unregister(self) -> None: ... class TqdmCallback(_Callback): tqdm_class: type[Incomplete] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/gui.pyi b/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/gui.pyi index 3369bd021..a77cc9760 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/gui.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/gui.pyi @@ -29,14 +29,14 @@ class tqdm_gui(Generic[_T], std_tqdm[_T]): iterable: Iterable[_T], desc: str | None = ..., total: float | None = ..., - leave: bool = ..., + leave: bool | None = ..., file: SupportsWrite[str] | None = ..., ncols: int | None = ..., mininterval: float = ..., maxinterval: float = ..., miniters: float | None = ..., ascii: bool | str | None = ..., - disable: bool = ..., + disable: bool | None = ..., unit: str = ..., unit_scale: bool | float = ..., dynamic_ncols: bool = ..., @@ -60,14 +60,14 @@ class tqdm_gui(Generic[_T], std_tqdm[_T]): iterable: None = ..., desc: str | None = ..., total: float | None = ..., - leave: bool = ..., + leave: bool | None = ..., file: SupportsWrite[str] | None = ..., ncols: int | None = ..., mininterval: float = ..., maxinterval: float = ..., miniters: float | None = ..., ascii: bool | str | None = ..., - disable: bool = ..., + disable: bool | None = ..., unit: str = ..., unit_scale: bool | float = ..., dynamic_ncols: bool = ..., diff --git a/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/keras.pyi b/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/keras.pyi index 0a5f5c7bd..75e86e92a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/keras.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/keras.pyi @@ -1,10 +1,31 @@ from _typeshed import Incomplete -from typing import Any -from typing_extensions import TypeAlias __all__ = ["TqdmCallback"] -_Callback: TypeAlias = Any # Actually tensorflow.keras.callbacks.Callback +# keras.callbacks.Callback +class _Callback: + validation_data: Incomplete | None + model: Incomplete | None + params: Incomplete + def __init__(self) -> None: ... + def set_params(self, params) -> None: ... + def set_model(self, model) -> None: ... + def on_batch_begin(self, batch, logs: Incomplete | None = ...) -> None: ... + def on_batch_end(self, batch, logs: Incomplete | None = ...) -> None: ... + def on_epoch_begin(self, epoch, logs: Incomplete | None = ...) -> None: ... + def on_epoch_end(self, epoch, logs: Incomplete | None = ...) -> None: ... + def on_train_batch_begin(self, batch, logs: Incomplete | None = ...) -> None: ... + def on_train_batch_end(self, batch, logs: Incomplete | None = ...) -> None: ... + def on_test_batch_begin(self, batch, logs: Incomplete | None = ...) -> None: ... + def on_test_batch_end(self, batch, logs: Incomplete | None = ...) -> None: ... + def on_predict_batch_begin(self, batch, logs: Incomplete | None = ...) -> None: ... + def on_predict_batch_end(self, batch, logs: Incomplete | None = ...) -> None: ... + def on_train_begin(self, logs: Incomplete | None = ...) -> None: ... + def on_train_end(self, logs: Incomplete | None = ...) -> None: ... + def on_test_begin(self, logs: Incomplete | None = ...) -> None: ... + def on_test_end(self, logs: Incomplete | None = ...) -> None: ... + def on_predict_begin(self, logs: Incomplete | None = ...) -> None: ... + def on_predict_end(self, logs: Incomplete | None = ...) -> None: ... class TqdmCallback(_Callback): @staticmethod diff --git a/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/notebook.pyi b/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/notebook.pyi index 7ecb32b2b..dbd7855b8 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/notebook.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/notebook.pyi @@ -35,7 +35,7 @@ class tqdm_notebook(Generic[_T], std_tqdm[_T]): iterable: Iterable[_T], desc: str | None = ..., total: float | None = ..., - leave: bool = ..., + leave: bool | None = ..., file: SupportsWrite[str] | None = ..., ncols: int | None = ..., mininterval: float = ..., @@ -66,7 +66,7 @@ class tqdm_notebook(Generic[_T], std_tqdm[_T]): iterable: None = ..., desc: str | None = ..., total: float | None = ..., - leave: bool = ..., + leave: bool | None = ..., file: SupportsWrite[str] | None = ..., ncols: int | None = ..., mininterval: float = ..., diff --git a/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/rich.pyi b/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/rich.pyi index b0e1abe43..2a81cc21f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/rich.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/rich.pyi @@ -1,13 +1,20 @@ from _typeshed import Incomplete, SupportsWrite +from abc import ABC, abstractmethod from collections.abc import Iterable, Mapping -from typing import Any, Generic, NoReturn, TypeVar, overload -from typing_extensions import TypeAlias +from typing import Generic, NoReturn, TypeVar, overload from .std import tqdm as std_tqdm __all__ = ["tqdm_rich", "trrange", "tqdm", "trange"] -_ProgressColumn: TypeAlias = Any # Actually rich.progress.ProgressColumn +# Actually rich.progress.ProgressColumn +class _ProgressColumn(ABC): + max_refresh: float | None + def __init__(self, table_column: Incomplete | None = ...) -> None: ... + def get_table_column(self) -> Incomplete: ... + def __call__(self, task: Incomplete) -> Incomplete: ... + @abstractmethod + def render(self, task: Incomplete) -> Incomplete: ... class FractionColumn(_ProgressColumn): unit_scale: bool @@ -37,14 +44,14 @@ class tqdm_rich(Generic[_T], std_tqdm[_T]): iterable: Iterable[_T], desc: str | None = ..., total: float | None = ..., - leave: bool = ..., + leave: bool | None = ..., file: SupportsWrite[str] | None = ..., ncols: int | None = ..., mininterval: float = ..., maxinterval: float = ..., miniters: float | None = ..., ascii: bool | str | None = ..., - disable: bool = ..., + disable: bool | None = ..., unit: str = ..., unit_scale: bool | float = ..., dynamic_ncols: bool = ..., @@ -68,14 +75,14 @@ class tqdm_rich(Generic[_T], std_tqdm[_T]): iterable: None = ..., desc: str | None = ..., total: float | None = ..., - leave: bool = ..., + leave: bool | None = ..., file: SupportsWrite[str] | None = ..., ncols: int | None = ..., mininterval: float = ..., maxinterval: float = ..., miniters: float | None = ..., ascii: bool | str | None = ..., - disable: bool = ..., + disable: bool | None = ..., unit: str = ..., unit_scale: bool | float = ..., dynamic_ncols: bool = ..., diff --git a/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/std.pyi b/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/std.pyi index b4b07b479..65c550c9e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/std.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/std.pyi @@ -1,9 +1,11 @@ import contextlib -from _typeshed import Incomplete, Self, SupportsWrite +from _typeshed import Incomplete, SupportsWrite from collections.abc import Callable, Iterable, Iterator, Mapping, MutableMapping +from types import TracebackType from typing import Any, ClassVar, Generic, NoReturn, TypeVar, overload -from typing_extensions import Literal +from typing_extensions import Literal, Self +from ._monitor import TMonitor from .utils import Comparable __all__ = [ @@ -31,6 +33,7 @@ _T = TypeVar("_T") class tqdm(Generic[_T], Iterable[_T], Comparable): monitor_interval: ClassVar[int] + monitor: ClassVar[TMonitor | None] @staticmethod def format_sizeof(num: float, suffix: str = ..., divisor: float = ...) -> str: ... @@ -63,14 +66,14 @@ class tqdm(Generic[_T], Iterable[_T], Comparable): iterable: Iterable[_T], desc: str | None = ..., total: float | None = ..., - leave: bool = ..., + leave: bool | None = ..., file: SupportsWrite[str] | None = ..., ncols: int | None = ..., mininterval: float = ..., maxinterval: float = ..., miniters: float | None = ..., ascii: bool | str | None = ..., - disable: bool = ..., + disable: bool | None = ..., unit: str = ..., unit_scale: bool | float = ..., dynamic_ncols: bool = ..., @@ -80,7 +83,7 @@ class tqdm(Generic[_T], Iterable[_T], Comparable): position: int | None = ..., postfix: Mapping[str, object] | str | None = ..., unit_divisor: float = ..., - write_bytes: bool | None = ..., + write_bytes: bool = False, lock_args: tuple[bool | None, float | None] | tuple[bool | None] | None = ..., nrows: int | None = ..., colour: str | None = ..., @@ -94,14 +97,14 @@ class tqdm(Generic[_T], Iterable[_T], Comparable): iterable: None = ..., desc: str | None = ..., total: float | None = ..., - leave: bool = ..., + leave: bool | None = ..., file: SupportsWrite[str] | None = ..., ncols: int | None = ..., mininterval: float = ..., maxinterval: float = ..., miniters: float | None = ..., ascii: bool | str | None = ..., - disable: bool = ..., + disable: bool | None = ..., unit: str = ..., unit_scale: bool | float = ..., dynamic_ncols: bool = ..., @@ -119,7 +122,7 @@ class tqdm(Generic[_T], Iterable[_T], Comparable): gui: bool = ..., **kwargs, ) -> None: ... - def __new__(cls: type[Self], *_, **__) -> Self: ... + def __new__(cls, *_, **__) -> Self: ... @classmethod def write(cls, s: str, file: SupportsWrite[str] | None = ..., end: str = ..., nolock: bool = ...) -> None: ... @classmethod @@ -136,14 +139,14 @@ class tqdm(Generic[_T], Iterable[_T], Comparable): *, desc: str | None = ..., total: float | None = ..., - leave: bool = ..., + leave: bool | None = ..., file: SupportsWrite[str] | None = ..., ncols: int | None = ..., mininterval: float = ..., maxinterval: float = ..., miniters: float | None = ..., ascii: bool | str | None = ..., - disable: bool = ..., + disable: bool | None = ..., unit: str = ..., unit_scale: bool | float = ..., dynamic_ncols: bool = ..., @@ -193,12 +196,13 @@ class tqdm(Generic[_T], Iterable[_T], Comparable): start_t: Incomplete def __bool__(self) -> bool: ... - def __nonzero__(self) -> bool: ... def __len__(self) -> int: ... def __reversed__(self) -> Iterator[_T]: ... def __contains__(self, item: object) -> bool: ... - def __enter__(self: Self) -> Self: ... - def __exit__(self, exc_type: object, exc_value: object, traceback: object) -> None: ... + def __enter__(self) -> Self: ... + def __exit__( + self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None + ) -> None: ... def __del__(self) -> None: ... def __hash__(self) -> int: ... def __iter__(self) -> Iterator[_T]: ... @@ -231,14 +235,14 @@ def trange( *, desc: str | None = ..., total: float | None = ..., - leave: bool = ..., + leave: bool | None = ..., file: SupportsWrite[str] | None = ..., ncols: int | None = ..., mininterval: float = ..., maxinterval: float = ..., miniters: float | None = ..., ascii: bool | str | None = ..., - disable: bool = ..., + disable: bool | None = ..., unit: str = ..., unit_scale: bool | float = ..., dynamic_ncols: bool = ..., @@ -260,14 +264,14 @@ def trange( *, desc: str | None = ..., total: float | None = ..., - leave: bool = ..., + leave: bool | None = ..., file: SupportsWrite[str] | None = ..., ncols: int | None = ..., mininterval: float = ..., maxinterval: float = ..., miniters: float | None = ..., ascii: bool | str | None = ..., - disable: bool = ..., + disable: bool | None = ..., unit: str = ..., unit_scale: bool | float = ..., dynamic_ncols: bool = ..., diff --git a/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/tk.pyi b/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/tk.pyi index 5a10272f0..a89732e01 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/tk.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/tk.pyi @@ -15,14 +15,14 @@ class tqdm_tk(Generic[_T], std_tqdm[_T]): iterable: Iterable[_T], desc: str | None = ..., total: float | None = ..., - leave: bool = ..., + leave: bool | None = ..., file: SupportsWrite[str] | None = ..., ncols: int | None = ..., mininterval: float = ..., maxinterval: float = ..., miniters: float | None = ..., ascii: bool | str | None = ..., - disable: bool = ..., + disable: bool | None = ..., unit: str = ..., unit_scale: bool | float = ..., dynamic_ncols: bool = ..., @@ -49,14 +49,14 @@ class tqdm_tk(Generic[_T], std_tqdm[_T]): iterable: None = ..., desc: str | None = ..., total: float | None = ..., - leave: bool = ..., + leave: bool | None = ..., file: SupportsWrite[str] | None = ..., ncols: int | None = ..., mininterval: float = ..., maxinterval: float = ..., miniters: float | None = ..., ascii: bool | str | None = ..., - disable: bool = ..., + disable: bool | None = ..., unit: str = ..., unit_scale: bool | float = ..., dynamic_ncols: bool = ..., diff --git a/packages/pyright-internal/typeshed-fallback/stubs/tree-sitter-languages/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/tree-sitter-languages/METADATA.toml new file mode 100644 index 000000000..1de68d543 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/tree-sitter-languages/METADATA.toml @@ -0,0 +1,2 @@ +version = "1.5.*" +requires = ["types-tree-sitter"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/tree-sitter-languages/tree_sitter_languages/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/tree-sitter-languages/tree_sitter_languages/__init__.pyi new file mode 100644 index 000000000..59a083877 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/tree-sitter-languages/tree_sitter_languages/__init__.pyi @@ -0,0 +1,7 @@ +from .core import get_language as get_language, get_parser as get_parser + +__version__: str +__title__: str +__author__: str +__license__: str +__copyright__: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/tree-sitter-languages/tree_sitter_languages/core.pyi b/packages/pyright-internal/typeshed-fallback/stubs/tree-sitter-languages/tree_sitter_languages/core.pyi new file mode 100644 index 000000000..b59c21d38 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/tree-sitter-languages/tree_sitter_languages/core.pyi @@ -0,0 +1,4 @@ +from tree_sitter import Language, Parser + +def get_language(language: str) -> Language: ... +def get_parser(language: str) -> Parser: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/tree-sitter/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/tree-sitter/METADATA.toml new file mode 100644 index 000000000..ae1fb69ff --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/tree-sitter/METADATA.toml @@ -0,0 +1 @@ +version = "0.20.*" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/tree-sitter/tree_sitter/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/tree-sitter/tree_sitter/__init__.pyi new file mode 100644 index 000000000..d26b17620 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/tree-sitter/tree_sitter/__init__.pyi @@ -0,0 +1,17 @@ +import ctypes +from _typeshed import StrPath +from collections.abc import Sequence + +# At runtime, Query and Range are available only in tree_sitter.binding +from tree_sitter.binding import Node as Node, Parser as Parser, Query, Tree as Tree, TreeCursor as TreeCursor + +class Language: + @staticmethod + def build_library(output_path: str, repo_paths: Sequence[StrPath]) -> bool: ... + name: str + lib: ctypes.CDLL + language_id: int + # library_path is passed into ctypes LoadLibrary + def __init__(self, library_path: str, name: str) -> None: ... + def field_id_for_name(self, name: str) -> int | None: ... + def query(self, source: str) -> Query: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/tree-sitter/tree_sitter/binding.pyi b/packages/pyright-internal/typeshed-fallback/stubs/tree-sitter/tree_sitter/binding.pyi new file mode 100644 index 000000000..f8d4d32d5 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/tree-sitter/tree_sitter/binding.pyi @@ -0,0 +1,116 @@ +from typing import Any, ClassVar +from typing_extensions import final + +from tree_sitter import Language + +@final +class Node: + @property + def start_byte(self) -> int: ... + @property + def start_point(self) -> tuple[int, int]: ... + @property + def end_byte(self) -> int: ... + @property + def end_point(self) -> tuple[int, int]: ... + @property + def has_changes(self) -> bool: ... + @property + def has_error(self) -> bool: ... + @property + def id(self) -> int: ... + @property + def is_missing(self) -> bool: ... + @property + def is_named(self) -> bool: ... + @property + def child_count(self) -> int: ... + @property + def named_child_count(self) -> bool: ... + @property + def children(self) -> list[Node]: ... + @property + def named_children(self) -> list[Node]: ... + @property + def next_named_sibling(self) -> Node | None: ... + @property + def next_sibling(self) -> Node | None: ... + @property + def parent(self) -> Node | None: ... + @property + def prev_named_sibling(self) -> Node | None: ... + @property + def prev_sibling(self) -> Node | None: ... + @property + def text(self) -> bytes | Any: ... # can be None, but annoying to check + @property + def type(self) -> str: ... + def children_by_field_name(self, name: str) -> list[Node]: ... + def children_by_field_id(self, __id: int) -> list[Node]: ... + def field_name_for_child(self, __child_index: int) -> str: ... + def child_by_field_id(self, __id: int) -> Node | None: ... + def child_by_field_name(self, __name: str) -> Node | None: ... + __hash__: ClassVar[None] # type: ignore[assignment] + def sexp(self) -> str: ... + def walk(self) -> TreeCursor: ... + def __eq__(self, other: object) -> bool: ... + def __ne__(self, other: object) -> bool: ... + # There are __ge__, __gt__, __le__, __lt__ methods but they always return False + # + # >>> n + # + # >>> n >= "", n <= "", n >= 0, n <= 0, n >= (0,0), n <= (0,0) + # (False, False, False, False, False, False) + +@final +class Parser: + # At runtime, Parser(1, 2, 3) ignores the arguments, but that's most likely buggy code + def __init__(self) -> None: ... + def parse(self, source: bytes, old_tree: Tree | None = ..., keep_text: bool = ...) -> Tree: ... + def set_language(self, __language: Language) -> None: ... + +@final +class Query: + # start_point and end_point arguments don't seem to do anything + # TODO: sync with + # https://github.com/tree-sitter/py-tree-sitter/blob/d3016edac2c33ce647653d896fbfb435ac2a6245/tree_sitter/binding.c#L1304 + def captures(self, node: Node) -> list[tuple[Node, str]]: ... + +@final +class Range: + @property + def start_byte(self) -> int: ... + @property + def end_byte(self) -> int: ... + @property + def start_point(self) -> tuple[int, int]: ... + @property + def end_point(self) -> tuple[int, int]: ... + +@final +class Tree: + @property + def root_node(self) -> Node: ... + @property + def text(self) -> bytes | Any: ... # technically ReadableBuffer | Any + def edit( + self, + start_byte: int, + old_end_byte: int, + new_end_byte: int, + start_point: tuple[int, int], + old_end_point: tuple[int, int], + new_end_point: tuple[int, int], + ) -> None: ... + def get_changed_ranges(self, new_tree: Tree) -> list[Range]: ... + def walk(self) -> TreeCursor: ... + +@final +class TreeCursor: + @property + def node(self) -> Node: ... + def copy(self) -> TreeCursor: ... + def current_field_name(self) -> str | None: ... + def goto_first_child(self) -> bool: ... + def goto_next_sibling(self) -> bool: ... + def goto_parent(self) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ttkthemes/ttkthemes/_utils.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ttkthemes/ttkthemes/_utils.pyi index 5231ac87b..b60a742f0 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ttkthemes/ttkthemes/_utils.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ttkthemes/ttkthemes/_utils.pyi @@ -1,7 +1,7 @@ -from typing import Any +from _typeshed import Incomplete def temporary_chdir(new_dir) -> None: ... def get_file_directory(): ... def get_temp_directory(): ... -def get_themes_directory(theme_name: Any | None = ..., png: bool = ...): ... +def get_themes_directory(theme_name: Incomplete | None = ..., png: bool = ...): ... def create_directory(directory): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ttkthemes/ttkthemes/themed_tk.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ttkthemes/ttkthemes/themed_tk.pyi index 1cf27bf3a..b39ea3c6e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ttkthemes/ttkthemes/themed_tk.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ttkthemes/ttkthemes/themed_tk.pyi @@ -1,5 +1,5 @@ import tkinter -from typing import Any +from _typeshed import Incomplete from ._widget import ThemedWidget @@ -23,8 +23,8 @@ class ThemedTk(tkinter.Tk, ThemedWidget): ) -> None: ... def set_theme(self, theme_name, toplevel: bool | None = ..., themebg: bool | None = ...) -> None: ... # TODO: currently no good way to say "use the same big list of kwargs as parent class but also add these" - def config(self, kw: Any | None = ..., **kwargs): ... # type: ignore[override] + def config(self, kw: Incomplete | None = ..., **kwargs): ... # type: ignore[override] def cget(self, k): ... - def configure(self, kw: Any | None = ..., **kwargs): ... # type: ignore[override] + def configure(self, kw: Incomplete | None = ..., **kwargs): ... # type: ignore[override] def __getitem__(self, k): ... - def __setitem__(self, k, v): ... + def __setitem__(self, k, v) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/typed-ast/typed_ast/ast27.pyi b/packages/pyright-internal/typeshed-fallback/stubs/typed-ast/typed_ast/ast27.pyi index 4faf50e66..3a4d19938 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/typed-ast/typed_ast/ast27.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/typed-ast/typed_ast/ast27.pyi @@ -1,3 +1,4 @@ +from _typeshed import ReadableBuffer from collections.abc import Iterator from typing import Any from typing_extensions import TypeAlias @@ -9,11 +10,11 @@ class NodeVisitor: class NodeTransformer(NodeVisitor): def generic_visit(self, node: AST) -> None: ... -def parse(source: str | bytes, filename: str | bytes = ..., mode: str = ...) -> AST: ... +def parse(source: str | ReadableBuffer, filename: str | ReadableBuffer = ..., mode: str = ...) -> AST: ... def copy_location(new_node: AST, old_node: AST) -> AST: ... def dump(node: AST, annotate_fields: bool = ..., include_attributes: bool = ...) -> str: ... def fix_missing_locations(node: AST) -> AST: ... -def get_docstring(node: AST, clean: bool = ...) -> bytes | None: ... +def get_docstring(node: AST, clean: bool = ...) -> str | bytes | None: ... def increment_lineno(node: AST, n: int = ...) -> AST: ... def iter_child_nodes(node: AST) -> Iterator[AST]: ... def iter_fields(node: AST) -> Iterator[tuple[str, Any]]: ... @@ -237,7 +238,7 @@ class Repr(expr): value: expr class Num(expr): - n: complex + n: int | float | complex class Str(expr): s: str | bytes diff --git a/packages/pyright-internal/typeshed-fallback/stubs/typed-ast/typed_ast/ast3.pyi b/packages/pyright-internal/typeshed-fallback/stubs/typed-ast/typed_ast/ast3.pyi index ab941d388..154eae07a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/typed-ast/typed_ast/ast3.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/typed-ast/typed_ast/ast3.pyi @@ -1,7 +1,10 @@ +from _typeshed import ReadableBuffer from collections.abc import Iterator from typing import Any from typing_extensions import TypeAlias +LATEST_MINOR_VERSION: int + class NodeVisitor: def visit(self, node: AST) -> Any: ... def generic_visit(self, node: AST) -> None: ... @@ -9,7 +12,9 @@ class NodeVisitor: class NodeTransformer(NodeVisitor): def generic_visit(self, node: AST) -> None: ... -def parse(source: str | bytes, filename: str | bytes = ..., mode: str = ..., feature_version: int = ...) -> AST: ... +def parse( + source: str | ReadableBuffer, filename: str | ReadableBuffer = ..., mode: str = ..., feature_version: int = ... +) -> AST: ... def copy_location(new_node: AST, old_node: AST) -> AST: ... def dump(node: AST, annotate_fields: bool = ..., include_attributes: bool = ...) -> str: ... def fix_missing_locations(node: AST) -> AST: ... @@ -252,7 +257,7 @@ class Call(expr): keywords: list[keyword] class Num(expr): - n: complex + n: int | float | complex class Str(expr): s: str @@ -358,7 +363,7 @@ class arguments(AST): args: list[arg] vararg: arg | None kwonlyargs: list[arg] - kw_defaults: list[expr] + kw_defaults: list[expr | None] kwarg: arg | None defaults: list[expr] @@ -383,3 +388,4 @@ class withitem(AST): class TypeIgnore(AST): lineno: int + tag: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/tzlocal/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/tzlocal/METADATA.toml index 7d629ef1e..3f6d82f31 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/tzlocal/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/tzlocal/METADATA.toml @@ -1,5 +1,2 @@ -version = "4.2" +version = "4.3" requires = ["types-pytz"] - -[tool.stubtest] -ignore_missing_stub = false diff --git a/packages/pyright-internal/typeshed-fallback/stubs/tzlocal/tzlocal/utils.pyi b/packages/pyright-internal/typeshed-fallback/stubs/tzlocal/tzlocal/utils.pyi index 37e42d31c..aedc34ac5 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/tzlocal/tzlocal/utils.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/tzlocal/tzlocal/utils.pyi @@ -1,3 +1,4 @@ +import datetime import sys import pytz @@ -10,6 +11,6 @@ if sys.version_info >= (3, 9): else: class ZoneInfoNotFoundError(pytz.UnknownTimeZoneError): ... -def get_system_offset(): ... -def get_tz_offset(tz): ... -def assert_tz_offset(tz) -> None: ... +def get_system_offset() -> int: ... +def get_tz_offset(tz: datetime.tzinfo) -> int: ... +def assert_tz_offset(tz: datetime.tzinfo) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/tzlocal/tzlocal/windows_tz.pyi b/packages/pyright-internal/typeshed-fallback/stubs/tzlocal/tzlocal/windows_tz.pyi index 9ff7d81d7..12dbac903 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/tzlocal/tzlocal/windows_tz.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/tzlocal/tzlocal/windows_tz.pyi @@ -1,3 +1,4 @@ +# Auto-generated for tzlocal.win32. But some libraries use it to get the mappings directly win_tz: dict[str, str] tz_names: dict[str, str] tz_win: dict[str, str] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ujson/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/ujson/METADATA.toml index 9d83af83a..17781efc4 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ujson/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/ujson/METADATA.toml @@ -1,4 +1 @@ -version = "5.4.*" - -[tool.stubtest] -ignore_missing_stub = false +version = "5.7.*" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/untangle/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/untangle/METADATA.toml new file mode 100644 index 000000000..249b0a7c0 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/untangle/METADATA.toml @@ -0,0 +1 @@ +version = "1.2.*" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/untangle/untangle.pyi b/packages/pyright-internal/typeshed-fallback/stubs/untangle/untangle.pyi new file mode 100644 index 000000000..f706aee02 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/untangle/untangle.pyi @@ -0,0 +1,37 @@ +from collections.abc import Iterator, Mapping +from typing import Any +from typing_extensions import Self +from xml.sax import handler + +def is_string(x: object) -> bool: ... + +class Element: + children: list[Element] + is_root: bool + cdata: str + def __init__(self, name: str | None, attributes: Mapping[str, Any] | None) -> None: ... + def add_child(self, element: Element) -> None: ... + def add_cdata(self, cdata: str) -> None: ... + def get_attribute(self, key: str) -> Any | None: ... + def get_elements(self, name: str | None = ...) -> list[Element]: ... + def __getitem__(self, key: str) -> Any | None: ... + def __getattr__(self, key: str) -> Element: ... + def __hasattribute__(self, name: str) -> bool: ... + def __iter__(self) -> Iterator[Self]: ... + def __bool__(self) -> bool: ... + __nonzero__ = __bool__ + def __eq__(self, val: object) -> bool: ... + def __dir__(self) -> list[str]: ... + def __len__(self) -> int: ... + def __contains__(self, key: str) -> bool: ... + +class Handler(handler.ContentHandler): + root: Element + elements: list[Element] + def __init__(self) -> None: ... + def startElement(self, name: str, attributes: Mapping[str, Any]) -> None: ... + def endElement(self, name: str) -> None: ... + def characters(self, cdata: str) -> None: ... + +def parse(filename: str, **parser_features: bool) -> Element: ... +def is_url(string: str) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/urllib3/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/urllib3/METADATA.toml index 68342cc21..791b8435e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/urllib3/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/urllib3/METADATA.toml @@ -1 +1,5 @@ version = "1.26.*" + +[tool.stubtest] +ignore_missing_stub = true +extras = ["socks"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/urllib3/urllib3/_collections.pyi b/packages/pyright-internal/typeshed-fallback/stubs/urllib3/urllib3/_collections.pyi index 27366cca4..630fe616a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/urllib3/urllib3/_collections.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/urllib3/urllib3/_collections.pyi @@ -1,4 +1,5 @@ from collections.abc import MutableMapping +from types import TracebackType from typing import Any, NoReturn, TypeVar _KT = TypeVar("_KT") @@ -6,7 +7,9 @@ _VT = TypeVar("_VT") class RLock: def __enter__(self): ... - def __exit__(self, exc_type, exc_value, traceback): ... + def __exit__( + self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None + ) -> None: ... class RecentlyUsedContainer(MutableMapping[_KT, _VT]): ContainerCls: Any @@ -14,18 +17,18 @@ class RecentlyUsedContainer(MutableMapping[_KT, _VT]): lock: Any def __init__(self, maxsize=..., dispose_func=...) -> None: ... def __getitem__(self, key): ... - def __setitem__(self, key, value): ... - def __delitem__(self, key): ... - def __len__(self): ... + def __setitem__(self, key, value) -> None: ... + def __delitem__(self, key) -> None: ... + def __len__(self) -> int: ... def __iter__(self): ... def clear(self): ... def keys(self): ... class HTTPHeaderDict(MutableMapping[str, str]): def __init__(self, headers=..., **kwargs) -> None: ... - def __setitem__(self, key, val): ... + def __setitem__(self, key, val) -> None: ... def __getitem__(self, key): ... - def __delitem__(self, key): ... + def __delitem__(self, key) -> None: ... def __contains__(self, key): ... def __eq__(self, other): ... def __iter__(self) -> NoReturn: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/urllib3/urllib3/connectionpool.pyi b/packages/pyright-internal/typeshed-fallback/stubs/urllib3/urllib3/connectionpool.pyi index b0987dbe6..4d27996de 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/urllib3/urllib3/connectionpool.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/urllib3/urllib3/connectionpool.pyi @@ -1,10 +1,9 @@ import queue -from _typeshed import Self from collections.abc import Mapping from logging import Logger from types import TracebackType from typing import Any, ClassVar -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal, Self, TypeAlias from . import connection, exceptions, request, response from .connection import BaseSSLError as BaseSSLError, ConnectionError as ConnectionError, HTTPException as HTTPException @@ -47,7 +46,7 @@ class ConnectionPool: host: str port: int | None def __init__(self, host: str, port: int | None = ...) -> None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None ) -> Literal[False]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/urllib3/urllib3/fields.pyi b/packages/pyright-internal/typeshed-fallback/stubs/urllib3/urllib3/fields.pyi index 8127d72d6..a7eb02554 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/urllib3/urllib3/fields.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/urllib3/urllib3/fields.pyi @@ -1,9 +1,9 @@ from collections.abc import Callable, Mapping -from typing import Any, Union +from typing import Any from typing_extensions import TypeAlias _FieldValue: TypeAlias = str | bytes -_FieldValueTuple: TypeAlias = Union[_FieldValue, tuple[str, _FieldValue], tuple[str, _FieldValue, str]] +_FieldValueTuple: TypeAlias = _FieldValue | tuple[str, _FieldValue] | tuple[str, _FieldValue, str] def guess_content_type(filename: str | None, default: str = ...) -> str: ... def format_header_param_rfc2231(name: str, value: _FieldValue) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/urllib3/urllib3/poolmanager.pyi b/packages/pyright-internal/typeshed-fallback/stubs/urllib3/urllib3/poolmanager.pyi index 68ad69622..ff8df6277 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/urllib3/urllib3/poolmanager.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/urllib3/urllib3/poolmanager.pyi @@ -1,4 +1,6 @@ +from types import TracebackType from typing import Any +from typing_extensions import Literal from .request import RequestMethods @@ -8,7 +10,9 @@ class PoolManager(RequestMethods): pools: Any def __init__(self, num_pools=..., headers=..., **connection_pool_kw) -> None: ... def __enter__(self): ... - def __exit__(self, exc_type, exc_val, exc_tb): ... + def __exit__( + self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None + ) -> Literal[False]: ... def clear(self): ... def connection_from_host(self, host, port=..., scheme=...): ... def connection_from_url(self, url): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/urllib3/urllib3/response.pyi b/packages/pyright-internal/typeshed-fallback/stubs/urllib3/urllib3/response.pyi index f5b8d25cb..a4f76d312 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/urllib3/urllib3/response.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/urllib3/urllib3/response.pyi @@ -1,9 +1,8 @@ import io -from _typeshed import Self from collections.abc import Iterable, Iterator, Mapping from http.client import HTTPMessage as _HttplibHTTPMessage, HTTPResponse as _HttplibHTTPResponse from typing import IO, Any -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal, Self, TypeAlias from urllib3.connectionpool import HTTPConnection @@ -13,7 +12,6 @@ from ._collections import HTTPHeaderDict _TYPE_BODY: TypeAlias = bytes | IO[Any] | Iterable[bytes] | str class DeflateDecoder: - def __init__(self) -> None: ... def __getattr__(self, name: str) -> Any: ... def decompress(self, data: bytes) -> bytes: ... @@ -23,14 +21,12 @@ class GzipDecoderState: SWALLOW_DATA: Literal[2] class GzipDecoder: - def __init__(self) -> None: ... def __getattr__(self, name: str) -> Any: ... def decompress(self, data: bytes) -> bytes: ... # This class is only available if # `brotli` is available for import. class BrotliDecoder: - def __init__(self) -> None: ... def flush(self) -> bytes: ... class MultiDecoder: @@ -86,7 +82,7 @@ class HTTPResponse(io.IOBase): def read(self, amt: int | None = ..., decode_content: bool | None = ..., cache_content: bool = ...) -> bytes: ... def stream(self, amt: int | None = ..., decode_content: bool | None = ...) -> Iterator[bytes]: ... @classmethod - def from_httplib(cls: type[Self], r: _HttplibHTTPResponse, **response_kw: Any) -> Self: ... + def from_httplib(cls, r: _HttplibHTTPResponse, **response_kw: Any) -> Self: ... def getheaders(self) -> HTTPHeaderDict: ... def getheader(self, name, default=...) -> str | None: ... def info(self) -> HTTPHeaderDict: ... @@ -99,4 +95,4 @@ class HTTPResponse(io.IOBase): def readinto(self, b: bytearray) -> int: ... def supports_chunked_reads(self) -> bool: ... def read_chunked(self, amt: int | None = ..., decode_content: bool | None = ...) -> Iterator[bytes]: ... - def geturl(self) -> bool | str: ... + def geturl(self) -> str | None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/urllib3/urllib3/util/retry.pyi b/packages/pyright-internal/typeshed-fallback/stubs/urllib3/urllib3/util/retry.pyi index bd1a5ff44..8fdb97685 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/urllib3/urllib3/util/retry.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/urllib3/urllib3/util/retry.pyi @@ -1,9 +1,8 @@ import logging -from _typeshed import Self from collections.abc import Collection from types import TracebackType from typing import Any, ClassVar, NamedTuple -from typing_extensions import Literal +from typing_extensions import Literal, Self from .. import exceptions from ..connectionpool import ConnectionPool @@ -62,7 +61,7 @@ class Retry: remove_headers_on_redirect: Collection[str] = ..., method_whitelist: Collection[str] | None = ..., ) -> None: ... - def new(self: Self, **kw: Any) -> Self: ... + def new(self, **kw: Any) -> Self: ... @classmethod def from_int( cls, retries: Retry | bool | int | None, redirect: bool | int | None = ..., default: Retry | bool | int | None = ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/urllib3/urllib3/util/url.pyi b/packages/pyright-internal/typeshed-fallback/stubs/urllib3/urllib3/util/url.pyi index 91a36abb9..fe98d2a1c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/urllib3/urllib3/util/url.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/urllib3/urllib3/util/url.pyi @@ -11,7 +11,7 @@ class _UrlBase(NamedTuple): fragment: str | None host: str | None path: str | None - port: str | None + port: int | None query: str | None scheme: str | None @@ -21,7 +21,7 @@ class Url(_UrlBase): scheme: str | None = ..., auth: str | None = ..., host: str | None = ..., - port: str | None = ..., + port: int | None = ..., path: str | None = ..., query: str | None = ..., fragment: str | None = ..., diff --git a/packages/pyright-internal/typeshed-fallback/stubs/vobject/vobject/base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/vobject/vobject/base.pyi index 165a608da..138794c44 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/vobject/vobject/base.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/vobject/vobject/base.pyi @@ -1,8 +1,10 @@ -from _typeshed import SupportsWrite +import logging +from _typeshed import Incomplete, SupportsWrite from collections.abc import Iterable, Iterator from typing import Any, TypeVar, overload from typing_extensions import Literal +logger: logging.Logger DEBUG: bool CR: str LF: str @@ -15,11 +17,11 @@ _V = TypeVar("_V", bound=VBase) _W = TypeVar("_W", bound=SupportsWrite[bytes]) class VBase: - group: Any | None - behavior: Any | None - parentBehavior: Any | None + group: Incomplete | None + behavior: Incomplete | None + parentBehavior: Incomplete | None isNative: bool - def __init__(self, group: Any | None = ...) -> None: ... + def __init__(self, group: Incomplete | None = ...) -> None: ... def copy(self, copyit: VBase) -> None: ... def validate(self, *args, **kwds) -> bool: ... def getChildren(self) -> list[Any]: ... @@ -31,9 +33,11 @@ class VBase: def transformChildrenToNative(self) -> None: ... def transformChildrenFromNative(self, clearBehavior: bool = ...) -> None: ... @overload - def serialize(self, buf: None = ..., lineLength: int = ..., validate: bool = ..., behavior: Any | None = ...) -> str: ... + def serialize( + self, buf: None = ..., lineLength: int = ..., validate: bool = ..., behavior: Incomplete | None = ... + ) -> str: ... @overload - def serialize(self, buf: _W, lineLength: int = ..., validate: bool = ..., behavior: Any | None = ...) -> _W: ... + def serialize(self, buf: _W, lineLength: int = ..., validate: bool = ..., behavior: Incomplete | None = ...) -> _W: ... def toVName(name, stripNum: int = ..., upper: bool = ...): ... @@ -50,10 +54,10 @@ class ContentLine(VBase): name, params, value, - group: Any | None = ..., + group: Incomplete | None = ..., encoded: bool = ..., isNative: bool = ..., - lineNumber: Any | None = ..., + lineNumber: Incomplete | None = ..., *args, **kwds, ) -> None: ... @@ -61,27 +65,27 @@ class ContentLine(VBase): def duplicate(cls, copyit): ... def copy(self, copyit) -> None: ... def __eq__(self, other): ... - def __getattr__(self, name): ... - def __setattr__(self, name, value) -> None: ... - def __delattr__(self, name) -> None: ... + def __getattr__(self, name: str): ... + def __setattr__(self, name: str, value) -> None: ... + def __delattr__(self, name: str) -> None: ... def valueRepr(self): ... - def __unicode__(self): ... + def __unicode__(self) -> str: ... def prettyPrint(self, level: int = ..., tabwidth: int = ...) -> None: ... class Component(VBase): contents: dict[str, list[VBase]] name: Any useBegin: bool - def __init__(self, name: Any | None = ..., *args, **kwds) -> None: ... + def __init__(self, name: Incomplete | None = ..., *args, **kwds) -> None: ... @classmethod def duplicate(cls, copyit): ... def copy(self, copyit) -> None: ... def setProfile(self, name) -> None: ... - def __getattr__(self, name): ... + def __getattr__(self, name: str): ... normal_attributes: Any - def __setattr__(self, name, value) -> None: ... - def __delattr__(self, name) -> None: ... - def getChildValue(self, childName, default: Any | None = ..., childNumber: int = ...): ... + def __setattr__(self, name: str, value) -> None: ... + def __delattr__(self, name: str) -> None: ... + def getChildValue(self, childName, default: Incomplete | None = ..., childNumber: int = ...): ... @overload def add(self, objOrName: _V, group: str | None = ...) -> _V: ... @overload @@ -106,7 +110,7 @@ class Component(VBase): class VObjectError(Exception): msg: Any lineNumber: Any - def __init__(self, msg, lineNumber: Any | None = ...) -> None: ... + def __init__(self, msg, lineNumber: Incomplete | None = ...) -> None: ... class ParseError(VObjectError): ... class ValidateError(VObjectError): ... @@ -119,22 +123,21 @@ line_re: Any begin_re: Any def parseParams(string): ... -def parseLine(line, lineNumber: Any | None = ...): ... +def parseLine(line, lineNumber: Incomplete | None = ...): ... wrap_re: Any logical_lines_re: Any testLines: str def getLogicalLines(fp, allowQP: bool = ...) -> None: ... -def textLineToContentLine(text, n: Any | None = ...): ... +def textLineToContentLine(text, n: Incomplete | None = ...): ... def dquoteEscape(param): ... def foldOneLine(outbuf, input, lineLength: int = ...) -> None: ... def defaultSerialize(obj, buf, lineLength): ... class Stack: stack: Any - def __init__(self) -> None: ... - def __len__(self): ... + def __len__(self) -> int: ... def top(self): ... def topName(self): ... def modifyTop(self, item) -> None: ... @@ -145,7 +148,7 @@ def readComponents( streamOrString, validate: bool = ..., transform: bool = ..., ignoreUnreadable: bool = ..., allowQP: bool = ... ) -> Iterator[Component]: ... def readOne(stream, validate: bool = ..., transform: bool = ..., ignoreUnreadable: bool = ..., allowQP: bool = ...): ... -def registerBehavior(behavior, name: Any | None = ..., default: bool = ..., id: Any | None = ...) -> None: ... -def getBehavior(name, id: Any | None = ...): ... -def newFromBehavior(name, id: Any | None = ...): ... +def registerBehavior(behavior, name: Incomplete | None = ..., default: bool = ..., id: Incomplete | None = ...) -> None: ... +def getBehavior(name, id: Incomplete | None = ...): ... +def newFromBehavior(name, id: Incomplete | None = ...): ... def backslashEscape(s): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/vobject/vobject/behavior.pyi b/packages/pyright-internal/typeshed-fallback/stubs/vobject/vobject/behavior.pyi index c165c7239..9c6e5a6ec 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/vobject/vobject/behavior.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/vobject/vobject/behavior.pyi @@ -12,7 +12,6 @@ class Behavior: allowGroup: bool forceUTC: bool sortFirst: Any - def __init__(self) -> None: ... @classmethod def validate(cls, obj, raiseException: bool = ..., complainUnrecognized: bool = ...): ... @classmethod diff --git a/packages/pyright-internal/typeshed-fallback/stubs/vobject/vobject/hcalendar.pyi b/packages/pyright-internal/typeshed-fallback/stubs/vobject/vobject/hcalendar.pyi index f9472f354..0c29d239d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/vobject/vobject/hcalendar.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/vobject/vobject/hcalendar.pyi @@ -1,8 +1,8 @@ -from typing import Any +from _typeshed import Incomplete from .icalendar import VCalendar2_0 class HCalendar(VCalendar2_0): name: str @classmethod - def serialize(cls, obj, buf: Any | None = ..., lineLength: Any | None = ..., validate: bool = ...): ... + def serialize(cls, obj, buf: Incomplete | None = ..., lineLength: Incomplete | None = ..., validate: bool = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/vobject/vobject/icalendar.pyi b/packages/pyright-internal/typeshed-fallback/stubs/vobject/vobject/icalendar.pyi index 6a9728e0a..ecfe79a18 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/vobject/vobject/icalendar.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/vobject/vobject/icalendar.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from datetime import timedelta from typing import Any @@ -25,7 +26,7 @@ class TimezoneComponent(Component): tzinfo: Any name: str useBegin: bool - def __init__(self, tzinfo: Any | None = ..., *args, **kwds) -> None: ... + def __init__(self, tzinfo: Incomplete | None = ..., *args, **kwds) -> None: ... @classmethod def registerTzinfo(cls, tzinfo): ... def gettzinfo(self): ... @@ -224,13 +225,13 @@ def deltaToOffset(delta): ... def periodToString(period, convertToUTC: bool = ...): ... def isDuration(s): ... def stringToDate(s): ... -def stringToDateTime(s, tzinfo: Any | None = ...): ... +def stringToDateTime(s, tzinfo: Incomplete | None = ...): ... escapableCharList: str -def stringToTextValues(s, listSeparator: str = ..., charList: Any | None = ..., strict: bool = ...): ... +def stringToTextValues(s, listSeparator: str = ..., charList: Incomplete | None = ..., strict: bool = ...): ... def stringToDurations(s, strict: bool = ...): ... def parseDtstart(contentline, allowSignatureMismatch: bool = ...): ... -def stringToPeriod(s, tzinfo: Any | None = ...): ... +def stringToPeriod(s, tzinfo: Incomplete | None = ...): ... def getTransition(transitionTo, year, tzinfo): ... def tzinfo_eq(tzinfo1, tzinfo2, startYear: int = ..., endYear: int = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/vobject/vobject/vcard.pyi b/packages/pyright-internal/typeshed-fallback/stubs/vobject/vobject/vcard.pyi index 8dfd0bec3..54bdc9bed 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/vobject/vobject/vcard.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/vobject/vobject/vcard.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from typing import Any from .behavior import Behavior @@ -83,7 +84,7 @@ class Photo(VCardTextBehavior): def toListOrString(string): ... def splitFields(string): ... def toList(stringOrList): ... -def serializeFields(obj, order: Any | None = ...): ... +def serializeFields(obj, order: Incomplete | None = ...): ... NAME_ORDER: Any ADDRESS_ORDER: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/waitress/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/waitress/METADATA.toml index 91331cf6a..1819293d3 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/waitress/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/waitress/METADATA.toml @@ -1,2 +1,7 @@ version = "2.1.*" requires = [] + +[tool.stubtest] +ignore_missing_stub = true +# linux and darwin are equivalent +platforms = ["linux", "win32"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/waitress/waitress/compat.pyi b/packages/pyright-internal/typeshed-fallback/stubs/waitress/waitress/compat.pyi index 4c00c6990..e0bb2a304 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/waitress/waitress/compat.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/waitress/waitress/compat.pyi @@ -1,8 +1,9 @@ from io import TextIOWrapper from typing import Any +from typing_extensions import Literal -PY2: bool -PY3: bool +PY2: Literal[False] +PY3: Literal[True] WIN: bool string_types: tuple[str] integer_types: tuple[int] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/waitress/waitress/server.pyi b/packages/pyright-internal/typeshed-fallback/stubs/waitress/waitress/server.pyi index e8cb00ae2..ada4b1b22 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/waitress/waitress/server.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/waitress/waitress/server.pyi @@ -1,16 +1,17 @@ +import sys +from _typeshed import Incomplete from collections.abc import Sequence from socket import socket from typing import Any +from waitress import wasyncore from waitress.adjustments import Adjustments from waitress.channel import HTTPChannel from waitress.task import Task, ThreadedTaskDispatcher -from . import wasyncore - def create_server( application: Any, - map: Any | None = ..., + map: Incomplete | None = ..., _start: bool = ..., _sock: socket | None = ..., _dispatcher: ThreadedTaskDispatcher | None = ..., @@ -25,7 +26,7 @@ class MultiSocketServer: task_dispatcher: ThreadedTaskDispatcher = ... def __init__( self, - map: Any | None = ..., + map: Incomplete | None = ..., adj: Adjustments | None = ..., effective_listen: Sequence[tuple[str, int]] | None = ..., dispatcher: ThreadedTaskDispatcher | None = ..., @@ -51,12 +52,12 @@ class BaseWSGIServer(wasyncore.dispatcher): def __init__( self, application: Any, - map: Any | None = ..., + map: Incomplete | None = ..., _start: bool = ..., - _sock: Any | None = ..., + _sock: Incomplete | None = ..., dispatcher: ThreadedTaskDispatcher | None = ..., adj: Adjustments | None = ..., - sockinfo: Any | None = ..., + sockinfo: Incomplete | None = ..., bind_socket: bool = ..., **kw: Any, ) -> None: ... @@ -84,21 +85,22 @@ class TcpWSGIServer(BaseWSGIServer): def getsockname(self) -> tuple[str, tuple[str, int]]: ... def set_socket_options(self, conn: socket) -> None: ... -class UnixWSGIServer(BaseWSGIServer): - def __init__( - self, - application: Any, - map: Any | None = ..., - _start: bool = ..., - _sock: Any | None = ..., - dispatcher: Any | None = ..., - adj: Adjustments | None = ..., - sockinfo: Any | None = ..., - **kw: Any, - ) -> None: ... - def bind_server_socket(self) -> None: ... - def getsockname(self) -> tuple[str, tuple[str, int]]: ... - def fix_addr(self, addr: Any) -> tuple[str, None]: ... - def get_server_name(self, ip: Any) -> str: ... +if sys.platform != "win32": + class UnixWSGIServer(BaseWSGIServer): + def __init__( + self, + application: Any, + map: Incomplete | None = ..., + _start: bool = ..., + _sock: Incomplete | None = ..., + dispatcher: Incomplete | None = ..., + adj: Adjustments | None = ..., + sockinfo: Incomplete | None = ..., + **kw: Any, + ) -> None: ... + def bind_server_socket(self) -> None: ... + def getsockname(self) -> tuple[str, tuple[str, int]]: ... + def fix_addr(self, addr: Any) -> tuple[str, None]: ... + def get_server_name(self, ip: Any) -> str: ... WSGIServer: TcpWSGIServer diff --git a/packages/pyright-internal/typeshed-fallback/stubs/waitress/waitress/task.pyi b/packages/pyright-internal/typeshed-fallback/stubs/waitress/waitress/task.pyi index cb8e67591..1f33f1891 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/waitress/waitress/task.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/waitress/waitress/task.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from collections import deque from collections.abc import Mapping, Sequence from logging import Logger @@ -20,7 +21,6 @@ class ThreadedTaskDispatcher: lock: Lock = ... queue_cv: Condition = ... thread_exit_cv: Condition = ... - def __init__(self) -> None: ... def start_new_thread(self, target: Any, args: Any) -> None: ... def handler_thread(self, thread_no: int) -> None: ... def set_thread_count(self, count: int) -> None: ... @@ -61,7 +61,7 @@ class ErrorTask(Task): def execute(self) -> None: ... class WSGITask(Task): - environ: Any | None = ... + environ: Incomplete | None = ... response_headers: Sequence[tuple[str, str]] = ... complete: bool = ... status: str = ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/waitress/waitress/trigger.pyi b/packages/pyright-internal/typeshed-fallback/stubs/waitress/waitress/trigger.pyi index 0908963ba..45d1a40dc 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/waitress/waitress/trigger.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/waitress/waitress/trigger.pyi @@ -4,13 +4,12 @@ from socket import socket from threading import Lock from typing_extensions import Literal -from . import wasyncore as wasyncore +from waitress import wasyncore as wasyncore class _triggerbase: kind: str | None = ... lock: Lock = ... thunks: Callable[[None], None] = ... - def __init__(self) -> None: ... def readable(self) -> Literal[True]: ... def writable(self) -> Literal[False]: ... def handle_connect(self) -> None: ... @@ -19,7 +18,7 @@ class _triggerbase: def pull_trigger(self, thunk: Callable[[None], object] | None = ...) -> None: ... def handle_read(self) -> None: ... -if sys.platform == "linux" or sys.platform == "darwin": +if sys.platform != "win32": class trigger(_triggerbase, wasyncore.file_dispatcher): kind: str = ... def __init__(self, map: Mapping[str, _triggerbase]) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/waitress/waitress/wasyncore.pyi b/packages/pyright-internal/typeshed-fallback/stubs/waitress/waitress/wasyncore.pyi index 0338799fe..0125447f3 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/waitress/waitress/wasyncore.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/waitress/waitress/wasyncore.pyi @@ -1,3 +1,4 @@ +import sys from collections.abc import Callable, Mapping from io import BytesIO from logging import Logger @@ -5,7 +6,7 @@ from socket import socket from typing import Any from typing_extensions import TypeAlias -from . import compat as compat, utilities as utilities +from waitress import compat as compat, utilities as utilities _Socket: TypeAlias = socket @@ -77,20 +78,21 @@ class dispatcher_with_send(dispatcher): def close_all(map: Mapping[int, socket] | None = ..., ignore_all: bool = ...) -> None: ... -class file_wrapper: - fd: BytesIO = ... - def __init__(self, fd: BytesIO) -> None: ... - def __del__(self) -> None: ... - def recv(self, *args: Any) -> bytes: ... - def send(self, *args: Any) -> bytes: ... - def getsockopt(self, level: int, optname: int, buflen: bool | None = ...) -> int: ... - read: Callable[..., bytes] = ... - write: Callable[..., bytes] = ... - def close(self) -> None: ... - def fileno(self) -> BytesIO: ... +if sys.platform != "win32": + class file_wrapper: + fd: BytesIO = ... + def __init__(self, fd: BytesIO) -> None: ... + def __del__(self) -> None: ... + def recv(self, *args: Any) -> bytes: ... + def send(self, *args: Any) -> bytes: ... + def getsockopt(self, level: int, optname: int, buflen: bool | None = ...) -> int: ... + read: Callable[..., bytes] = ... + write: Callable[..., bytes] = ... + def close(self) -> None: ... + def fileno(self) -> BytesIO: ... -class file_dispatcher(dispatcher): - connected: bool = ... - def __init__(self, fd: BytesIO, map: Mapping[int, _Socket] | None = ...) -> None: ... - socket: _Socket = ... - def set_file(self, fd: BytesIO) -> None: ... + class file_dispatcher(dispatcher): + connected: bool = ... + def __init__(self, fd: BytesIO, map: Mapping[int, _Socket] | None = ...) -> None: ... + socket: _Socket = ... + def set_file(self, fd: BytesIO) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/whatthepatch/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/whatthepatch/METADATA.toml index 516f11f6b..f3e83f9c4 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/whatthepatch/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/whatthepatch/METADATA.toml @@ -1,4 +1 @@ version = "1.0.*" - -[tool.stubtest] -ignore_missing_stub = false diff --git a/packages/pyright-internal/typeshed-fallback/stubs/whatthepatch/whatthepatch/patch.pyi b/packages/pyright-internal/typeshed-fallback/stubs/whatthepatch/whatthepatch/patch.pyi index 9e03e3d91..488646774 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/whatthepatch/whatthepatch/patch.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/whatthepatch/whatthepatch/patch.pyi @@ -24,33 +24,44 @@ class Change(NamedTuple): hunk: int file_timestamp_str: str + diffcmd_header: Pattern[str] unified_header_index: Pattern[str] unified_header_old_line: Pattern[str] unified_header_new_line: Pattern[str] unified_hunk_start: Pattern[str] unified_change: Pattern[str] + context_header_old_line: Pattern[str] context_header_new_line: Pattern[str] context_hunk_start: Pattern[str] context_hunk_old: Pattern[str] context_hunk_new: Pattern[str] context_change: Pattern[str] + ed_hunk_start: Pattern[str] ed_hunk_end: Pattern[str] rcs_ed_hunk_start: Pattern[str] + default_hunk_start: Pattern[str] default_hunk_mid: Pattern[str] default_change: Pattern[str] + git_diffcmd_header: Pattern[str] git_header_index: Pattern[str] git_header_old_line: Pattern[str] git_header_new_line: Pattern[str] git_header_file_mode: Pattern[str] git_header_binary_file: Pattern[str] +git_binary_patch_start: Pattern[str] +git_binary_literal_start: Pattern[str] +git_binary_delta_start: Pattern[str] +base85string: Pattern[str] + bzr_header_index: Pattern[str] bzr_header_old_line: Pattern[str] bzr_header_new_line: Pattern[str] + svn_header_index: Pattern[str] svn_header_timestamp_version: Pattern[str] svn_header_timestamp: Pattern[str] @@ -76,3 +87,4 @@ def parse_unified_diff(text: str | Iterable[str]) -> list[Change] | None: ... def parse_context_diff(text: str | Iterable[str]) -> list[Change] | None: ... def parse_ed_diff(text: str | Iterable[str]) -> list[Change] | None: ... def parse_rcs_ed_diff(text: str | Iterable[str]) -> list[Change] | None: ... +def parse_git_binary_diff(text: str | Iterable[str]) -> list[Change]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/xmltodict/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/xmltodict/METADATA.toml index 18912b609..9f7bb49c0 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/xmltodict/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/xmltodict/METADATA.toml @@ -1,4 +1 @@ version = "0.13.*" - -[tool.stubtest] -ignore_missing_stub = false diff --git a/packages/pyright-internal/typeshed-fallback/stubs/xmltodict/xmltodict.pyi b/packages/pyright-internal/typeshed-fallback/stubs/xmltodict/xmltodict.pyi index f71105a9d..c370329f5 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/xmltodict/xmltodict.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/xmltodict/xmltodict.pyi @@ -1,6 +1,7 @@ -from _typeshed import SupportsRead, SupportsWrite +from _typeshed import ReadableBuffer, SupportsRead, SupportsWrite from collections import OrderedDict from collections.abc import Mapping +from types import GeneratorType from typing import Any, overload __license__: str @@ -8,7 +9,7 @@ __license__: str class ParsingInterrupted(Exception): ... def parse( - xml_input: str | bytes | SupportsRead[bytes], + xml_input: str | ReadableBuffer | SupportsRead[bytes] | GeneratorType[ReadableBuffer, Any, Any], encoding: str | None = ..., expat: Any = ..., process_namespaces: bool = ..., diff --git a/packages/pyright-internal/typeshed-fallback/stubs/xxhash/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/xxhash/METADATA.toml index d9f5a3241..82b4d3336 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/xxhash/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/xxhash/METADATA.toml @@ -1,4 +1,2 @@ version = "3.0.*" - -[tool.stubtest] -ignore_missing_stub = false +obsolete_since = "3.1.0" # Released on 2022-10-19 diff --git a/packages/pyright-internal/typeshed-fallback/stubs/zstd/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/zstd/METADATA.toml new file mode 100644 index 000000000..97ceca8aa --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/zstd/METADATA.toml @@ -0,0 +1 @@ +version = "1.5.*" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/zstd/zstd.pyi b/packages/pyright-internal/typeshed-fallback/stubs/zstd/zstd.pyi new file mode 100644 index 000000000..3384e905f --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/zstd/zstd.pyi @@ -0,0 +1,15 @@ +from _typeshed import ReadableBuffer + +class Error(Exception): ... + +def ZSTD_compress(__data: ReadableBuffer, __level: int = ..., __threads: int = ...) -> bytes: ... +def ZSTD_external() -> int: ... +def ZSTD_uncompress(__data: ReadableBuffer) -> bytes: ... +def ZSTD_version() -> str: ... +def ZSTD_version_number() -> int: ... +def compress(__data: ReadableBuffer, __level: int = ..., __threads: int = ...) -> bytes: ... +def decompress(__data: ReadableBuffer) -> bytes: ... +def dumps(__data: ReadableBuffer, __level: int = ..., __threads: int = ...) -> bytes: ... +def loads(__data: ReadableBuffer) -> bytes: ... +def uncompress(__data: ReadableBuffer) -> bytes: ... +def version() -> str: ... diff --git a/packages/pyright-scip/package-lock.json b/packages/pyright-scip/package-lock.json index cf70891e0..d493ae617 100644 --- a/packages/pyright-scip/package-lock.json +++ b/packages/pyright-scip/package-lock.json @@ -1,12 +1,12 @@ { "name": "@sourcegraph/scip-python", - "version": "0.3.2", + "version": "0.3.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@sourcegraph/scip-python", - "version": "0.3.2", + "version": "0.3.3", "license": "MIT", "dependencies": { "commander": "^9.2.0", diff --git a/packages/pyright-scip/snapshots/output/aliased_import/actual.py b/packages/pyright-scip/snapshots/output/aliased_import/actual.py index 5aa791aee..8e1121700 100644 --- a/packages/pyright-scip/snapshots/output/aliased_import/actual.py +++ b/packages/pyright-scip/snapshots/output/aliased_import/actual.py @@ -11,12 +11,15 @@ # > ``` print(A.SOME_CONSTANT) -#^^^^ reference python-stdlib 3.10 builtins/__init__:print(). +#^^^^ reference python-stdlib 3.11 builtins/__init__:print(). #external documentation ```python -# > (function) -# > print(*values: object, sep: str | None =... -# > -# > print(*values: object, sep: str | None =... +# > (function) def print( +# > *values: object, +# > sep: str | None = " ", +# > end: str | None = "\n", +# > file: SupportsWrite[str] | None = No... +# > flush: Literal[False] = False +# > ) -> None # > ``` # ^ reference local 0 # ^^^^^^^^^^^^^ reference snapshot-util 0.1 aliased/SOME_CONSTANT. diff --git a/packages/pyright-scip/snapshots/output/builtin_imports/builtin_imports.py b/packages/pyright-scip/snapshots/output/builtin_imports/builtin_imports.py index a191e04b4..7b939e11d 100644 --- a/packages/pyright-scip/snapshots/output/builtin_imports/builtin_imports.py +++ b/packages/pyright-scip/snapshots/output/builtin_imports/builtin_imports.py @@ -2,30 +2,53 @@ #documentation (module) builtin_imports import re -# ^^ reference python-stdlib 3.10 re/__init__: +# ^^ reference python-stdlib 3.11 re/__init__: from typing import Callable, Optional -# ^^^^^^ reference python-stdlib 3.10 typing/__init__: +# ^^^^^^ reference python-stdlib 3.11 typing/__init__: # external documentation ```python # > (module) typing # > ``` -# ^^^^^^^^ reference python-stdlib 3.10 typing/Callable. +# external documentation --- +# > +# external documentation The typing module: Support for gradual t... +# > +# > At large scale, the structure of the mod... +# > * Imports and exports, all public names... +# > * Internal helper functions: these shou... +# > * \_SpecialForm and its instances (spec... +# > Any, NoReturn, ClassVar, Union, Optional... +# > * Classes whose instances can be type a... +# > ForwardRef, TypeVar and ParamSpec +# > * The core of internal generics API: \_... +# > currently only used by Tuple and Callabl... +# > etc., are instances of either of these c... +# > * The public counterpart of the generic... +# > * Public helper functions: get\_type\_h... +# > no\_type\_check\_decorator. +# > * Generic aliases for collections.abc A... +# > * Special types: NewType, NamedTuple, T... +# > * Wrapper submodules for re and io rela... +# ^^^^^^^^ reference python-stdlib 3.11 typing/Callable. # external documentation ```python # > (class) Callable # > ``` -# ^^^^^^^^ reference python-stdlib 3.10 typing/Optional. +# ^^^^^^^^ reference python-stdlib 3.11 typing/Optional. # external documentation ```python # > (class) Optional # > ``` print(re, Callable, Optional) -#^^^^ reference python-stdlib 3.10 builtins/__init__:print(). +#^^^^ reference python-stdlib 3.11 builtins/__init__:print(). #external documentation ```python -# > (function) -# > print(*values: object, sep: str | None =... -# > -# > print(*values: object, sep: str | None =... +# > (function) def print( +# > *values: object, +# > sep: str | None = " ", +# > end: str | None = "\n", +# > file: SupportsWrite[str] | None = No... +# > flush: Literal[False] = False +# > ) -> None # > ``` -# ^^ reference python-stdlib 3.10 re/__init__: -# ^^^^^^^^ reference python-stdlib 3.10 typing/Callable. -# ^^^^^^^^ reference python-stdlib 3.10 typing/Optional. +# ^^ reference python-stdlib 3.11 re/__init__: +# ^^^^^^^^ reference python-stdlib 3.11 typing/Callable. +# ^^^^^^^^ reference python-stdlib 3.11 typing/Optional. diff --git a/packages/pyright-scip/snapshots/output/class_nohint/class_nohint.py b/packages/pyright-scip/snapshots/output/class_nohint/class_nohint.py index 12f56fb03..545b17d76 100644 --- a/packages/pyright-scip/snapshots/output/class_nohint/class_nohint.py +++ b/packages/pyright-scip/snapshots/output/class_nohint/class_nohint.py @@ -12,7 +12,7 @@ class Example: # documentation ```python # > (variable) y: int # > ``` -# ^^^ reference python-stdlib 3.10 builtins/int# +# ^^^ reference python-stdlib 3.11 builtins/int# # external documentation ```python # > (class) int # > ``` @@ -53,17 +53,20 @@ def something(self): # > ``` # ^^^^ definition snapshot-util 0.1 class_nohint/Example#something().(self) print(self.x) -# ^^^^^ reference python-stdlib 3.10 builtins/__init__:print(). +# ^^^^^ reference python-stdlib 3.11 builtins/__init__:print(). # external documentation ```python -# > (function) -# > print(*values: object, sep: str | None =... -# > -# > print(*values: object, sep: str | None =... +# > (function) def print( +# > *values: object, +# > sep: str | None = " ", +# > end: str | None = "\n", +# > file: SupportsWrite[str] | None = No... +# > flush: Literal[False] = False +# > ) -> None # > ``` # ^^^^ reference snapshot-util 0.1 class_nohint/Example#something().(self) # ^ reference snapshot-util 0.1 class_nohint/Example#x. print(self.y) -# ^^^^^ reference python-stdlib 3.10 builtins/__init__:print(). +# ^^^^^ reference python-stdlib 3.11 builtins/__init__:print(). # ^^^^ reference snapshot-util 0.1 class_nohint/Example#something().(self) # ^ reference snapshot-util 0.1 class_nohint/Example#y. diff --git a/packages/pyright-scip/snapshots/output/comprehensions/comp.py b/packages/pyright-scip/snapshots/output/comprehensions/comp.py index cbf8d1be8..8c696fde0 100644 --- a/packages/pyright-scip/snapshots/output/comprehensions/comp.py +++ b/packages/pyright-scip/snapshots/output/comprehensions/comp.py @@ -44,13 +44,19 @@ def something(x): # documentation ```python # > (variable) x: int # > ``` -# ^^^^^^^^^ reference python-stdlib 3.10 builtins/enumerate# +# ^^^^^^^^^ reference python-stdlib 3.11 builtins/enumerate# # external documentation ```python -# > (class) enumerate(iterable: Iterable[int... +# > class enumerate( +# > iterable: Iterable[int], +# > start: int = ... +# > ) # > ``` -# ^^^^^ reference python-stdlib 3.10 builtins/range# +# ^^^^^ reference python-stdlib 3.11 builtins/range# # external documentation ```python -# > (class) range +# > class range( +# > __stop: SupportsIndex, +# > / +# > ) # > ``` @@ -69,12 +75,15 @@ def something(x): # ^^^ definition snapshot-util 0.1 comp/var. # ^^^^ reference snapshot-util 0.1 comp/asdf. print(var) -# ^^^^^ reference python-stdlib 3.10 builtins/__init__:print(). +# ^^^^^ reference python-stdlib 3.11 builtins/__init__:print(). # external documentation ```python -# > (function) -# > print(*values: object, sep: str | None =... -# > -# > print(*values: object, sep: str | None =... +# > (function) def print( +# > *values: object, +# > sep: str | None = " ", +# > end: str | None = "\n", +# > file: SupportsWrite[str] | None = No... +# > flush: Literal[False] = False +# > ) -> None # > ``` # ^^^ reference snapshot-util 0.1 comp/var. diff --git a/packages/pyright-scip/snapshots/output/dunder_vars/__main__.py b/packages/pyright-scip/snapshots/output/dunder_vars/__main__.py index 8d79affbe..ee44e14a6 100644 --- a/packages/pyright-scip/snapshots/output/dunder_vars/__main__.py +++ b/packages/pyright-scip/snapshots/output/dunder_vars/__main__.py @@ -3,17 +3,20 @@ if __name__ == '__main__': -# ^^^^^^^^ reference python-stdlib 3.10 builtins/__name__# +# ^^^^^^^^ reference python-stdlib 3.11 builtins/__name__# # external documentation ```python # > __name__: str # > ``` print("main") -# ^^^^^ reference python-stdlib 3.10 builtins/__init__:print(). +# ^^^^^ reference python-stdlib 3.11 builtins/__init__:print(). # external documentation ```python -# > (function) -# > print(*values: object, sep: str | None =... -# > -# > print(*values: object, sep: str | None =... +# > (function) def print( +# > *values: object, +# > sep: str | None = " ", +# > end: str | None = "\n", +# > file: SupportsWrite[str] | None = No... +# > flush: Literal[False] = False +# > ) -> None # > ``` diff --git a/packages/pyright-scip/snapshots/output/f_string/fstring.py b/packages/pyright-scip/snapshots/output/f_string/fstring.py index 3287f11bc..c4d954cc5 100644 --- a/packages/pyright-scip/snapshots/output/f_string/fstring.py +++ b/packages/pyright-scip/snapshots/output/f_string/fstring.py @@ -8,12 +8,15 @@ # > ``` print(f"var: hello {var}") -#^^^^ reference python-stdlib 3.10 builtins/__init__:print(). +#^^^^ reference python-stdlib 3.11 builtins/__init__:print(). #external documentation ```python -# > (function) -# > print(*values: object, sep: str | None =... -# > -# > print(*values: object, sep: str | None =... +# > (function) def print( +# > *values: object, +# > sep: str | None = " ", +# > end: str | None = "\n", +# > file: SupportsWrite[str] | None = No... +# > flush: Literal[False] = False +# > ) -> None # > ``` # ^^^ reference snapshot-util 0.1 fstring/var. diff --git a/packages/pyright-scip/snapshots/output/file_from_module_import/abc/file.py b/packages/pyright-scip/snapshots/output/file_from_module_import/abc/file.py index 73e723a5b..bb8df66dd 100644 --- a/packages/pyright-scip/snapshots/output/file_from_module_import/abc/file.py +++ b/packages/pyright-scip/snapshots/output/file_from_module_import/abc/file.py @@ -6,12 +6,15 @@ # ^^^^^^^^^^^ reference snapshot-util 0.1 `xyz.nested_file`/__init__: print(nested_file.X) -#^^^^ reference python-stdlib 3.10 builtins/__init__:print(). +#^^^^ reference python-stdlib 3.11 builtins/__init__:print(). #external documentation ```python -# > (function) -# > print(*values: object, sep: str | None =... -# > -# > print(*values: object, sep: str | None =... +# > (function) def print( +# > *values: object, +# > sep: str | None = " ", +# > end: str | None = "\n", +# > file: SupportsWrite[str] | None = No... +# > flush: Literal[False] = False +# > ) -> None # > ``` # ^^^^^^^^^^^ reference snapshot-util 0.1 `xyz.nested_file`/__init__: # ^ reference snapshot-util 0.1 `xyz.nested_file`/X. diff --git a/packages/pyright-scip/snapshots/output/file_from_module_import/file_from_module.py b/packages/pyright-scip/snapshots/output/file_from_module_import/file_from_module.py index 8c995e710..9fbeee51a 100644 --- a/packages/pyright-scip/snapshots/output/file_from_module_import/file_from_module.py +++ b/packages/pyright-scip/snapshots/output/file_from_module_import/file_from_module.py @@ -6,12 +6,15 @@ # ^^^^^^^^^^^ reference snapshot-util 0.1 `xyz.nested_file`/__init__: print(nested_file.X) -#^^^^ reference python-stdlib 3.10 builtins/__init__:print(). +#^^^^ reference python-stdlib 3.11 builtins/__init__:print(). #external documentation ```python -# > (function) -# > print(*values: object, sep: str | None =... -# > -# > print(*values: object, sep: str | None =... +# > (function) def print( +# > *values: object, +# > sep: str | None = " ", +# > end: str | None = "\n", +# > file: SupportsWrite[str] | None = No... +# > flush: Literal[False] = False +# > ) -> None # > ``` # ^^^^^^^^^^^ reference snapshot-util 0.1 `xyz.nested_file`/__init__: # ^ reference snapshot-util 0.1 `xyz.nested_file`/X. diff --git a/packages/pyright-scip/snapshots/output/nameparts_import/nameparts.py b/packages/pyright-scip/snapshots/output/nameparts_import/nameparts.py index 474da726c..ae1223cc5 100644 --- a/packages/pyright-scip/snapshots/output/nameparts_import/nameparts.py +++ b/packages/pyright-scip/snapshots/output/nameparts_import/nameparts.py @@ -2,20 +2,20 @@ #documentation (module) nameparts import importlib.resources -# ^^^^^^^^^^^^^^^^^^^ reference python-stdlib 3.10 `importlib.resources`/__init__: +# ^^^^^^^^^^^^^^^^^^^ reference python-stdlib 3.11 `importlib.resources`/__init__: importlib.resources.read_text('pre_commit.resources', 'filename') -#^^^^^^^^^^^^^^^^^^ reference python-stdlib 3.10 `importlib.resources`/__init__: +#^^^^^^^^^^^^^^^^^^ reference python-stdlib 3.11 `importlib.resources`/__init__: # ^^^^^^^^^ reference local 0 # documentation ```python # > def read_text( # > package: Package, # > resource: Resource, -# > encoding: str = ..., -# > errors: str = ... +# > encoding: str = "utf-8", +# > errors: str = "strict" # > ) -> str: # > ``` importlib.resources.read_text('pre_commit.resources', 'filename') -#^^^^^^^^ reference python-stdlib 3.10 `importlib.resources`/__init__: +#^^^^^^^^ reference python-stdlib 3.11 `importlib.resources`/__init__: # ^^^^^^^^^ reference local 0 diff --git a/packages/pyright-scip/snapshots/output/nested_items/src/foo/bar/baz/mod.py b/packages/pyright-scip/snapshots/output/nested_items/src/foo/bar/baz/mod.py index 047040fc9..c0c2c66d5 100644 --- a/packages/pyright-scip/snapshots/output/nested_items/src/foo/bar/baz/mod.py +++ b/packages/pyright-scip/snapshots/output/nested_items/src/foo/bar/baz/mod.py @@ -11,7 +11,7 @@ class SuchNestedMuchWow: # documentation ```python # > (variable) class_item: Literal[42] # > ``` -# ^^^ reference python-stdlib 3.10 builtins/int# +# ^^^ reference python-stdlib 3.11 builtins/int# # external documentation ```python # > (class) int # > ``` @@ -26,5 +26,5 @@ class AnotherNestedMuchWow: # documentation ```python # > (variable) other_item: Literal[42] # > ``` -# ^^^ reference python-stdlib 3.10 builtins/int# +# ^^^ reference python-stdlib 3.11 builtins/int# diff --git a/packages/pyright-scip/snapshots/output/nested_items/src/importer.py b/packages/pyright-scip/snapshots/output/nested_items/src/importer.py index fd56b8a92..f22d6d5b9 100644 --- a/packages/pyright-scip/snapshots/output/nested_items/src/importer.py +++ b/packages/pyright-scip/snapshots/output/nested_items/src/importer.py @@ -10,21 +10,24 @@ # ^^^^^^^^^^^^^^^^^^^^ reference snapshot-util 0.1 `src.foo.bar.baz.mod`/AnotherNestedMuchWow# print(SuchNestedMuchWow().class_item) -#^^^^ reference python-stdlib 3.10 builtins/__init__:print(). +#^^^^ reference python-stdlib 3.11 builtins/__init__:print(). #external documentation ```python -# > (function) -# > print(*values: object, sep: str | None =... -# > -# > print(*values: object, sep: str | None =... +# > (function) def print( +# > *values: object, +# > sep: str | None = " ", +# > end: str | None = "\n", +# > file: SupportsWrite[str] | None = No... +# > flush: Literal[False] = False +# > ) -> None # > ``` # ^^^^^^^^^^^^^^^^^ reference snapshot-util 0.1 `src.foo.bar.baz.mod`/SuchNestedMuchWow# # ^^^^^^^^^^ reference snapshot-util 0.1 `src.foo.bar.baz.mod`/SuchNestedMuchWow#class_item. print(AnotherNestedMuchWow().other_item) -#^^^^ reference python-stdlib 3.10 builtins/__init__:print(). +#^^^^ reference python-stdlib 3.11 builtins/__init__:print(). # ^^^^^^^^^^^^^^^^^^^^ reference snapshot-util 0.1 `src.foo.bar.baz.mod`/AnotherNestedMuchWow# # ^^^^^^^^^^ reference snapshot-util 0.1 `src.foo.bar.baz.mod`/AnotherNestedMuchWow#other_item. print(InitClass().init_item) -#^^^^ reference python-stdlib 3.10 builtins/__init__:print(). +#^^^^ reference python-stdlib 3.11 builtins/__init__:print(). # ^^^^^^^^^ reference snapshot-util 0.1 `src.foo.bar`/InitClass# # ^^^^^^^^^ reference snapshot-util 0.1 `src.foo.bar`/InitClass#init_item. diff --git a/packages/pyright-scip/snapshots/output/nested_items/src/long_importer.py b/packages/pyright-scip/snapshots/output/nested_items/src/long_importer.py index 09bdfb632..7a487298e 100644 --- a/packages/pyright-scip/snapshots/output/nested_items/src/long_importer.py +++ b/packages/pyright-scip/snapshots/output/nested_items/src/long_importer.py @@ -5,12 +5,15 @@ # ^^^^^^^^^^^^^^^ reference snapshot-util 0.1 `foo.bar.baz.mod`/__init__: print(foo.bar.baz.mod.SuchNestedMuchWow) -#^^^^ reference python-stdlib 3.10 builtins/__init__:print(). +#^^^^ reference python-stdlib 3.11 builtins/__init__:print(). #external documentation ```python -# > (function) -# > print(*values: object, sep: str | None =... -# > -# > print(*values: object, sep: str | None =... +# > (function) def print( +# > *values: object, +# > sep: str | None = " ", +# > end: str | None = "\n", +# > file: SupportsWrite[str] | None = No... +# > flush: Literal[False] = False +# > ) -> None # > ``` # ^^^^^^^^^^^^^^^ reference snapshot-util 0.1 `foo.bar.baz.mod`/__init__: # ^^^^^^^^^^^^^^^^^ reference snapshot-util 0.1 `src.foo.bar.baz.mod`/SuchNestedMuchWow# diff --git a/packages/pyright-scip/snapshots/output/request_goofiness/goofy.py b/packages/pyright-scip/snapshots/output/request_goofiness/goofy.py index e0c48f1d4..01c76b5c4 100644 --- a/packages/pyright-scip/snapshots/output/request_goofiness/goofy.py +++ b/packages/pyright-scip/snapshots/output/request_goofiness/goofy.py @@ -5,12 +5,15 @@ # ^^^^^^^^ reference requests 2.0.0 requests/__init__: print(requests.get("https://sourcegraph.com")) -#^^^^ reference python-stdlib 3.10 builtins/__init__:print(). +#^^^^ reference python-stdlib 3.11 builtins/__init__:print(). #external documentation ```python -# > (function) -# > print(*values: object, sep: str | None =... -# > -# > print(*values: object, sep: str | None =... +# > (function) def print( +# > *values: object, +# > sep: str | None = " ", +# > end: str | None = "\n", +# > file: SupportsWrite[str] | None = No... +# > flush: Literal[False] = False +# > ) -> None # > ``` # ^^^^^^^^ reference requests 2.0.0 requests/__init__: # ^^^ reference requests 2.0.0 `requests.api`/get(). diff --git a/packages/pyright-scip/snapshots/output/single_class/src/single_class.py b/packages/pyright-scip/snapshots/output/single_class/src/single_class.py index 20e56cb4c..35b12aa7c 100644 --- a/packages/pyright-scip/snapshots/output/single_class/src/single_class.py +++ b/packages/pyright-scip/snapshots/output/single_class/src/single_class.py @@ -11,7 +11,7 @@ class ExampleClass: # documentation ```python # > (variable) a: int # > ``` -# ^^^ reference python-stdlib 3.10 builtins/int# +# ^^^ reference python-stdlib 3.11 builtins/int# # external documentation ```python # > (class) int # > ``` @@ -20,13 +20,13 @@ class ExampleClass: # documentation ```python # > (variable) b: int # > ``` -# ^^^ reference python-stdlib 3.10 builtins/int# +# ^^^ reference python-stdlib 3.11 builtins/int# c: str # ^ definition snapshot-util 0.1 `src.single_class`/ExampleClass#c. # documentation ```python # > (variable) c: str # > ``` -# ^^^ reference python-stdlib 3.10 builtins/str# +# ^^^ reference python-stdlib 3.11 builtins/str# # external documentation ```python # > (class) str # > ``` @@ -48,9 +48,9 @@ def __init__(self, a: int, b: int): # > ``` # ^^^^ definition snapshot-util 0.1 `src.single_class`/ExampleClass#__init__().(self) # ^ definition snapshot-util 0.1 `src.single_class`/ExampleClass#__init__().(a) -# ^^^ reference python-stdlib 3.10 builtins/int# +# ^^^ reference python-stdlib 3.11 builtins/int# # ^ definition snapshot-util 0.1 `src.single_class`/ExampleClass#__init__().(b) -# ^^^ reference python-stdlib 3.10 builtins/int# +# ^^^ reference python-stdlib 3.11 builtins/int# local_c = ", world!" # ^^^^^^^ definition local 0 # documentation ```python diff --git a/packages/pyright-scip/snapshots/output/single_function/src/single_function.py b/packages/pyright-scip/snapshots/output/single_function/src/single_function.py index 7e2a7be57..812f1e362 100644 --- a/packages/pyright-scip/snapshots/output/single_function/src/single_function.py +++ b/packages/pyright-scip/snapshots/output/single_function/src/single_function.py @@ -9,11 +9,11 @@ def my_cool_function(a: str) -> str: # > ) -> str: # > ``` # ^ definition snapshot-util 0.1 `src.single_function`/my_cool_function().(a) -# ^^^ reference python-stdlib 3.10 builtins/str# +# ^^^ reference python-stdlib 3.11 builtins/str# # external documentation ```python # > (class) str # > ``` -# ^^^ reference python-stdlib 3.10 builtins/str# +# ^^^ reference python-stdlib 3.11 builtins/str# x = ", world" # ^ definition local 0 # documentation ```python @@ -31,7 +31,7 @@ def my_cool_function_2(a: str): # > ): # > ``` # ^ definition snapshot-util 0.1 `src.single_function`/my_cool_function_2().(a) -# ^^^ reference python-stdlib 3.10 builtins/str# +# ^^^ reference python-stdlib 3.11 builtins/str# x = ", world" # ^ definition local 1 # documentation ```python diff --git a/packages/pyright-scip/snapshots/output/unique/builtin_import_refs.py b/packages/pyright-scip/snapshots/output/unique/builtin_import_refs.py index 809af61aa..1c7e7282f 100644 --- a/packages/pyright-scip/snapshots/output/unique/builtin_import_refs.py +++ b/packages/pyright-scip/snapshots/output/unique/builtin_import_refs.py @@ -2,22 +2,45 @@ #documentation (module) builtin_import_refs from typing import Any -# ^^^^^^ reference python-stdlib 3.10 typing/__init__: +# ^^^^^^ reference python-stdlib 3.11 typing/__init__: # external documentation ```python # > (module) typing # > ``` -# ^^^ reference python-stdlib 3.10 typing/Any. +# external documentation --- +# > +# external documentation The typing module: Support for gradual t... +# > +# > At large scale, the structure of the mod... +# > * Imports and exports, all public names... +# > * Internal helper functions: these shou... +# > * \_SpecialForm and its instances (spec... +# > Any, NoReturn, ClassVar, Union, Optional... +# > * Classes whose instances can be type a... +# > ForwardRef, TypeVar and ParamSpec +# > * The core of internal generics API: \_... +# > currently only used by Tuple and Callabl... +# > etc., are instances of either of these c... +# > * The public counterpart of the generic... +# > * Public helper functions: get\_type\_h... +# > no\_type\_check\_decorator. +# > * Generic aliases for collections.abc A... +# > * Special types: NewType, NamedTuple, T... +# > * Wrapper submodules for re and io rela... +# ^^^ reference python-stdlib 3.11 typing/Any. # external documentation ```python # > (variable) Any: Any # > ``` print(Any) -#^^^^ reference python-stdlib 3.10 builtins/__init__:print(). +#^^^^ reference python-stdlib 3.11 builtins/__init__:print(). #external documentation ```python -# > (function) -# > print(*values: object, sep: str | None =... -# > -# > print(*values: object, sep: str | None =... +# > (function) def print( +# > *values: object, +# > sep: str | None = " ", +# > end: str | None = "\n", +# > file: SupportsWrite[str] | None = No... +# > flush: Literal[False] = False +# > ) -> None # > ``` -# ^^^ reference python-stdlib 3.10 typing/Any. +# ^^^ reference python-stdlib 3.11 typing/Any. diff --git a/packages/pyright-scip/snapshots/output/unique/field_docstring.py b/packages/pyright-scip/snapshots/output/unique/field_docstring.py index 0d3b620e5..0be01ab7e 100644 --- a/packages/pyright-scip/snapshots/output/unique/field_docstring.py +++ b/packages/pyright-scip/snapshots/output/unique/field_docstring.py @@ -15,7 +15,7 @@ class ClassWithField: # documentation --- # > # documentation Hello world, this is a -# ^^^ reference python-stdlib 3.10 builtins/int# +# ^^^ reference python-stdlib 3.11 builtins/int# # external documentation ```python # > (class) int # > ``` diff --git a/packages/pyright-scip/snapshots/output/unique/grandparent_impl.py b/packages/pyright-scip/snapshots/output/unique/grandparent_impl.py index bdbace65f..a932a6d4b 100644 --- a/packages/pyright-scip/snapshots/output/unique/grandparent_impl.py +++ b/packages/pyright-scip/snapshots/output/unique/grandparent_impl.py @@ -14,7 +14,7 @@ def grandparent(self) -> bool: # > ) -> bool: # > ``` # ^^^^ definition snapshot-util 0.1 grandparent_impl/A#grandparent().(self) -# ^^^^ reference python-stdlib 3.10 builtins/bool# +# ^^^^ reference python-stdlib 3.11 builtins/bool# # external documentation ```python # > (class) bool # > ``` @@ -45,6 +45,6 @@ def grandparent(self) -> bool: # > ``` # relationship implementation scip-python python snapshot-util 0.1 grandparent_impl/A#grandparent(). # ^^^^ definition snapshot-util 0.1 grandparent_impl/C#grandparent().(self) -# ^^^^ reference python-stdlib 3.10 builtins/bool# +# ^^^^ reference python-stdlib 3.11 builtins/bool# return False diff --git a/packages/pyright-scip/snapshots/output/unique/inferred_field_docstring.py b/packages/pyright-scip/snapshots/output/unique/inferred_field_docstring.py index c3565ebc2..58396834b 100644 --- a/packages/pyright-scip/snapshots/output/unique/inferred_field_docstring.py +++ b/packages/pyright-scip/snapshots/output/unique/inferred_field_docstring.py @@ -16,7 +16,7 @@ def __init__(self, b: int): # > ``` # ^^^^ definition snapshot-util 0.1 inferred_field_docstring/ClassWithInferredField#__init__().(self) # ^ definition snapshot-util 0.1 inferred_field_docstring/ClassWithInferredField#__init__().(b) -# ^^^ reference python-stdlib 3.10 builtins/int# +# ^^^ reference python-stdlib 3.11 builtins/int# # external documentation ```python # > (class) int # > ``` diff --git a/packages/pyright-scip/snapshots/output/unique/inherits_class.py b/packages/pyright-scip/snapshots/output/unique/inherits_class.py index 4fa0f81ec..7f1965818 100644 --- a/packages/pyright-scip/snapshots/output/unique/inherits_class.py +++ b/packages/pyright-scip/snapshots/output/unique/inherits_class.py @@ -14,12 +14,12 @@ def x(self) -> int: # > ) -> int: # > ``` # ^^^^ definition snapshot-util 0.1 inherits_class/A#x().(self) -# ^^^ reference python-stdlib 3.10 builtins/int# +# ^^^ reference python-stdlib 3.11 builtins/int# # external documentation ```python # > (class) int # > ``` raise NotImplemented -# ^^^^^^^^^^^^^^ reference python-stdlib 3.10 builtins/NotImplemented# +# ^^^^^^^^^^^^^^ reference python-stdlib 3.11 builtins/NotImplemented# # external documentation ```python # > (variable) NotImplemented: _NotImplement... # > ``` @@ -34,7 +34,7 @@ def unmatched(self, x: int): # > ``` # ^^^^ definition snapshot-util 0.1 inherits_class/A#unmatched().(self) # ^ definition snapshot-util 0.1 inherits_class/A#unmatched().(x) -# ^^^ reference python-stdlib 3.10 builtins/int# +# ^^^ reference python-stdlib 3.11 builtins/int# pass class B(A): @@ -53,7 +53,7 @@ def x(self) -> int: # > ``` # relationship implementation scip-python python snapshot-util 0.1 inherits_class/A#x(). # ^^^^ definition snapshot-util 0.1 inherits_class/B#x().(self) -# ^^^ reference python-stdlib 3.10 builtins/int# +# ^^^ reference python-stdlib 3.11 builtins/int# return 5 def unmatched(self, x: int, y: int): @@ -67,9 +67,9 @@ def unmatched(self, x: int, y: int): # > ``` # ^^^^ definition snapshot-util 0.1 inherits_class/B#unmatched().(self) # ^ definition snapshot-util 0.1 inherits_class/B#unmatched().(x) -# ^^^ reference python-stdlib 3.10 builtins/int# +# ^^^ reference python-stdlib 3.11 builtins/int# # ^ definition snapshot-util 0.1 inherits_class/B#unmatched().(y) -# ^^^ reference python-stdlib 3.10 builtins/int# +# ^^^ reference python-stdlib 3.11 builtins/int# pass def unrelated(self): diff --git a/packages/pyright-scip/snapshots/output/unique/multiinherits_test.py b/packages/pyright-scip/snapshots/output/unique/multiinherits_test.py index 66c0d8239..467ff399b 100644 --- a/packages/pyright-scip/snapshots/output/unique/multiinherits_test.py +++ b/packages/pyright-scip/snapshots/output/unique/multiinherits_test.py @@ -14,7 +14,7 @@ def one(self) -> int: # > ) -> int: # > ``` # ^^^^ definition snapshot-util 0.1 multiinherits_test/Left#one().(self) -# ^^^ reference python-stdlib 3.10 builtins/int# +# ^^^ reference python-stdlib 3.11 builtins/int# # external documentation ```python # > (class) int # > ``` @@ -28,7 +28,7 @@ def shared(self) -> bool: # > ) -> bool: # > ``` # ^^^^ definition snapshot-util 0.1 multiinherits_test/Left#shared().(self) -# ^^^^ reference python-stdlib 3.10 builtins/bool# +# ^^^^ reference python-stdlib 3.11 builtins/bool# # external documentation ```python # > (class) bool # > ``` @@ -57,7 +57,7 @@ def shared(self) -> bool: # > ) -> bool: # > ``` # ^^^^ definition snapshot-util 0.1 multiinherits_test/Right#shared().(self) -# ^^^^ reference python-stdlib 3.10 builtins/bool# +# ^^^^ reference python-stdlib 3.11 builtins/bool# return False class Multi(Left, Right): @@ -78,7 +78,7 @@ def one(self) -> int: # > ``` # relationship implementation scip-python python snapshot-util 0.1 multiinherits_test/Left#one(). # ^^^^ definition snapshot-util 0.1 multiinherits_test/Multi#one().(self) -# ^^^ reference python-stdlib 3.10 builtins/int# +# ^^^ reference python-stdlib 3.11 builtins/int# return 1 def two(self): @@ -112,6 +112,6 @@ def shared(self) -> bool: # relationship implementation scip-python python snapshot-util 0.1 multiinherits_test/Left#shared(). # relationship implementation scip-python python snapshot-util 0.1 multiinherits_test/Right#shared(). # ^^^^ definition snapshot-util 0.1 multiinherits_test/Multi#shared().(self) -# ^^^^ reference python-stdlib 3.10 builtins/bool# +# ^^^^ reference python-stdlib 3.11 builtins/bool# return True diff --git a/packages/pyright-scip/snapshots/output/unique/property_access.py b/packages/pyright-scip/snapshots/output/unique/property_access.py index 60b0debd0..87ac02a54 100644 --- a/packages/pyright-scip/snapshots/output/unique/property_access.py +++ b/packages/pyright-scip/snapshots/output/unique/property_access.py @@ -2,11 +2,31 @@ #documentation (module) property_access from typing import Sequence -# ^^^^^^ reference python-stdlib 3.10 typing/__init__: +# ^^^^^^ reference python-stdlib 3.11 typing/__init__: # external documentation ```python # > (module) typing # > ``` -# ^^^^^^^^ reference python-stdlib 3.10 typing/Sequence# +# external documentation --- +# > +# external documentation The typing module: Support for gradual t... +# > +# > At large scale, the structure of the mod... +# > * Imports and exports, all public names... +# > * Internal helper functions: these shou... +# > * \_SpecialForm and its instances (spec... +# > Any, NoReturn, ClassVar, Union, Optional... +# > * Classes whose instances can be type a... +# > ForwardRef, TypeVar and ParamSpec +# > * The core of internal generics API: \_... +# > currently only used by Tuple and Callabl... +# > etc., are instances of either of these c... +# > * The public counterpart of the generic... +# > * Public helper functions: get\_type\_h... +# > no\_type\_check\_decorator. +# > * Generic aliases for collections.abc A... +# > * Special types: NewType, NamedTuple, T... +# > * Wrapper submodules for re and io rela... +# ^^^^^^^^ reference python-stdlib 3.11 typing/Sequence# class PropertyClass: # ^^^^^^^^^^^^^ definition snapshot-util 0.1 property_access/PropertyClass# @@ -24,7 +44,7 @@ def __init__(self): pass @property -# ^^^^^^^^ reference python-stdlib 3.10 builtins/property# +# ^^^^^^^^ reference python-stdlib 3.11 builtins/property# # external documentation ```python # > (class) property # > ``` @@ -55,7 +75,7 @@ def usage(xs: Sequence[PropertyClass]): # > ): # -> None: # > ``` # ^^ definition snapshot-util 0.1 property_access/usage().(xs) -# ^^^^^^^^ reference python-stdlib 3.10 typing/Sequence# +# ^^^^^^^^ reference python-stdlib 3.11 typing/Sequence# # ^^^^^^^^^^^^^ reference snapshot-util 0.1 property_access/PropertyClass# def nested(): # ^^^^^^ definition snapshot-util 0.1 property_access/usage().nested(). @@ -66,12 +86,15 @@ def nested(): # ^ definition local 0 # ^^ reference snapshot-util 0.1 property_access/usage().(xs) print(x.prop_ref) -# ^^^^^ reference python-stdlib 3.10 builtins/__init__:print(). +# ^^^^^ reference python-stdlib 3.11 builtins/__init__:print(). # external documentation ```python -# > (function) -# > print(*values: object, sep: str | None =... -# > -# > print(*values: object, sep: str | None =... +# > (function) def print( +# > *values: object, +# > sep: str | None = " ", +# > end: str | None = "\n", +# > file: SupportsWrite[str] | None = No... +# > flush: Literal[False] = False +# > ) -> None # > ``` # ^ reference local 0 # ^^^^^^^^ reference snapshot-util 0.1 property_access/PropertyClass#prop_ref(). diff --git a/packages/pyright-scip/snapshots/output/unique/vars_inside_scopes.py b/packages/pyright-scip/snapshots/output/unique/vars_inside_scopes.py index 1c2c45bcf..f750116c0 100644 --- a/packages/pyright-scip/snapshots/output/unique/vars_inside_scopes.py +++ b/packages/pyright-scip/snapshots/output/unique/vars_inside_scopes.py @@ -2,11 +2,31 @@ #documentation (module) vars_inside_scopes from typing import List -# ^^^^^^ reference python-stdlib 3.10 typing/__init__: +# ^^^^^^ reference python-stdlib 3.11 typing/__init__: # external documentation ```python # > (module) typing # > ``` -# ^^^^ reference python-stdlib 3.10 typing/List. +# external documentation --- +# > +# external documentation The typing module: Support for gradual t... +# > +# > At large scale, the structure of the mod... +# > * Imports and exports, all public names... +# > * Internal helper functions: these shou... +# > * \_SpecialForm and its instances (spec... +# > Any, NoReturn, ClassVar, Union, Optional... +# > * Classes whose instances can be type a... +# > ForwardRef, TypeVar and ParamSpec +# > * The core of internal generics API: \_... +# > currently only used by Tuple and Callabl... +# > etc., are instances of either of these c... +# > * The public counterpart of the generic... +# > * Public helper functions: get\_type\_h... +# > no\_type\_check\_decorator. +# > * Generic aliases for collections.abc A... +# > * Special types: NewType, NamedTuple, T... +# > * Wrapper submodules for re and io rela... +# ^^^^ reference python-stdlib 3.11 typing/List. # external documentation ```python # > (variable) List: Type[List[_T@list]] # > ``` @@ -21,8 +41,8 @@ class X: # documentation ```python # > (variable) items: List[int] # > ``` -# ^^^^ reference python-stdlib 3.10 typing/List. -# ^^^ reference python-stdlib 3.10 builtins/int# +# ^^^^ reference python-stdlib 3.11 typing/List. +# ^^^ reference python-stdlib 3.11 builtins/int# # external documentation ```python # > (class) int # > ``` diff --git a/packages/pyright-scip/snapshots/output/unresolved_import/unresolved.py b/packages/pyright-scip/snapshots/output/unresolved_import/unresolved.py index 98e3c9594..c47b33fcb 100644 --- a/packages/pyright-scip/snapshots/output/unresolved_import/unresolved.py +++ b/packages/pyright-scip/snapshots/output/unresolved_import/unresolved.py @@ -6,16 +6,19 @@ # documentation (module): this_is_not_real [unable to re... print(this_is_not_real.x) -#^^^^ reference python-stdlib 3.10 builtins/__init__:print(). +#^^^^ reference python-stdlib 3.11 builtins/__init__:print(). #external documentation ```python -# > (function) -# > print(*values: object, sep: str | None =... -# > -# > print(*values: object, sep: str | None =... +# > (function) def print( +# > *values: object, +# > sep: str | None = " ", +# > end: str | None = "\n", +# > file: SupportsWrite[str] | None = No... +# > flush: Literal[False] = False +# > ) -> None # > ``` # ^^^^^^^^^^^^^^^^ reference local 0 print(this_is_not_real.x) -#^^^^ reference python-stdlib 3.10 builtins/__init__:print(). +#^^^^ reference python-stdlib 3.11 builtins/__init__:print(). # ^^^^^^^^^^^^^^^^ reference local 0 diff --git a/packages/pyright-scip/src/ModifiedTypeUtils.ts b/packages/pyright-scip/src/ModifiedTypeUtils.ts index 6bc8a8917..5fd7967f8 100644 --- a/packages/pyright-scip/src/ModifiedTypeUtils.ts +++ b/packages/pyright-scip/src/ModifiedTypeUtils.ts @@ -252,8 +252,10 @@ export function isTypeImplementable( // The types do not have a particular order, so we need to // do the comparison in an order-independent manner. return ( - findSubtype(type1, (subtype) => !UnionType.containsType(unionType2, subtype, recursionCount)) === - undefined + findSubtype( + type1, + (subtype) => !UnionType.containsType(unionType2, subtype, undefined, recursionCount) + ) === undefined ); } diff --git a/packages/pyright-scip/src/TypeStubExtendedWriter.ts b/packages/pyright-scip/src/TypeStubExtendedWriter.ts index c99695d42..68423cd0f 100644 --- a/packages/pyright-scip/src/TypeStubExtendedWriter.ts +++ b/packages/pyright-scip/src/TypeStubExtendedWriter.ts @@ -87,7 +87,7 @@ export class TypeStubExtendedWriter extends TypeStubWriter { line += node.isAsync ? 'async ' : ''; line += `def ${functionName}`; - const mappedParameters = node.parameters.map((param, index) => this._printParameter(param, node, index)) + const mappedParameters = node.parameters.map((param, index) => this._printParameter(param, node, index)); if (mappedParameters.length <= 0) { line += `(${mappedParameters.join(', ')})`; } else { @@ -133,7 +133,7 @@ export class TypeStubExtendedWriter extends TypeStubWriter { let returnType = this.evaluator.getFunctionInferredReturnType(functionType.functionType); returnType = removeUnknownFromUnion(returnType); if (!isNever(returnType) && !isUnknown(returnType)) { - line += ` # -> ${this.evaluator.printType(returnType, /* expandTypeAlias */ false)}:`; + line += ` # -> ${this.evaluator.printType(returnType, { expandTypeAlias: false })}:`; } } } diff --git a/packages/pyright-scip/src/treeVisitor.ts b/packages/pyright-scip/src/treeVisitor.ts index 7e59bca8c..2b61f042b 100644 --- a/packages/pyright-scip/src/treeVisitor.ts +++ b/packages/pyright-scip/src/treeVisitor.ts @@ -690,7 +690,7 @@ export class TreeVisitor extends ParseTreeWalker { return true; } - const type = this.evaluator.getTypeForDeclaration(decl); + const typeInfo = this.evaluator.getTypeForDeclaration(decl); if (isAliasDeclaration(decl)) { const resolved = this.evaluator.resolveAliasDeclaration(decl, true, true); const resolvedType = resolved ? this.evaluator.getTypeForDeclaration(resolved) : undefined; @@ -699,12 +699,12 @@ export class TreeVisitor extends ParseTreeWalker { log.info('Missing dependency for:', node); } - if (type) { - this.pushTypeReference(node, decl.node, type); + if (typeInfo.type) { + this.pushTypeReference(node, decl.node, typeInfo.type); return true; } - if (resolved && resolvedType) { + if (resolved && resolvedType && resolvedType.type) { const isDefinition = node.id === resolved?.node.id; const resolvedInfo = getFileInfo(node); const hoverResult = this.program.getHoverForPosition( @@ -715,7 +715,7 @@ export class TreeVisitor extends ParseTreeWalker { ); if (hoverResult) { - const symbol = this.typeToSymbol(node, declNode, resolvedType); + const symbol = this.typeToSymbol(node, declNode, resolvedType.type); this.rawSetLsifSymbol(declNode, symbol, symbol.isLocal()); if (isDefinition) { @@ -723,7 +723,7 @@ export class TreeVisitor extends ParseTreeWalker { } } - this.pushTypeReference(node, resolved.node, resolvedType); + this.pushTypeReference(node, resolved.node, resolvedType.type); return true; } @@ -747,6 +747,8 @@ export class TreeVisitor extends ParseTreeWalker { documentation.push(convertDocStringToMarkdown(doc)); } + let type = typeInfo.type; + let relationships: scip.Relationship[] | undefined = undefined; if (type && type.category === TypeCategory.Class) { // TODO: Add Protocol support with: diff --git a/packages/pyright/package-lock.json b/packages/pyright/package-lock.json index 85f271574..4092c0c2c 100644 --- a/packages/pyright/package-lock.json +++ b/packages/pyright/package-lock.json @@ -1,12 +1,11 @@ { "name": "pyright", - "version": "1.1.267", + "version": "1.1.301", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "pyright", - "version": "1.1.267", + "version": "1.1.301", "license": "MIT", "bin": { "pyright": "index.js", @@ -16,11 +15,11 @@ "@types/copy-webpack-plugin": "^10.1.0", "@types/node": "^17.0.45", "copy-webpack-plugin": "^10.2.4", - "esbuild-loader": "^2.19.0", + "esbuild-loader": "^3.0.1", "shx": "^0.3.4", - "ts-loader": "^9.3.1", + "ts-loader": "^9.4.2", "typescript": "~4.4.4", - "webpack": "^5.74.0", + "webpack": "^5.76.0", "webpack-cli": "^4.10.0" }, "engines": { @@ -36,6 +35,358 @@ "node": ">=10.0.0" } }, + "node_modules/@esbuild/android-arm": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.17.8.tgz", + "integrity": "sha512-0/rb91GYKhrtbeglJXOhAv9RuYimgI8h623TplY2X+vA4EXnk3Zj1fXZreJ0J3OJJu1bwmb0W7g+2cT/d8/l/w==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.17.8.tgz", + "integrity": "sha512-oa/N5j6v1svZQs7EIRPqR8f+Bf8g6HBDjD/xHC02radE/NjKHK7oQmtmLxPs1iVwYyvE+Kolo6lbpfEQ9xnhxQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.8.tgz", + "integrity": "sha512-bTliMLqD7pTOoPg4zZkXqCDuzIUguEWLpeqkNfC41ODBHwoUgZ2w5JBeYimv4oP6TDVocoYmEhZrCLQTrH89bg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.17.8.tgz", + "integrity": "sha512-ghAbV3ia2zybEefXRRm7+lx8J/rnupZT0gp9CaGy/3iolEXkJ6LYRq4IpQVI9zR97ID80KJVoUlo3LSeA/sMAg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.17.8.tgz", + "integrity": "sha512-n5WOpyvZ9TIdv2V1K3/iIkkJeKmUpKaCTdun9buhGRWfH//osmUjlv4Z5mmWdPWind/VGcVxTHtLfLCOohsOXw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.8.tgz", + "integrity": "sha512-a/SATTaOhPIPFWvHZDoZYgxaZRVHn0/LX1fHLGfZ6C13JqFUZ3K6SMD6/HCtwOQ8HnsNaEeokdiDSFLuizqv5A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.17.8.tgz", + "integrity": "sha512-xpFJb08dfXr5+rZc4E+ooZmayBW6R3q59daCpKZ/cDU96/kvDM+vkYzNeTJCGd8rtO6fHWMq5Rcv/1cY6p6/0Q==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.17.8.tgz", + "integrity": "sha512-6Ij8gfuGszcEwZpi5jQIJCVIACLS8Tz2chnEBfYjlmMzVsfqBP1iGmHQPp7JSnZg5xxK9tjCc+pJ2WtAmPRFVA==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.17.8.tgz", + "integrity": "sha512-v3iwDQuDljLTxpsqQDl3fl/yihjPAyOguxuloON9kFHYwopeJEf1BkDXODzYyXEI19gisEsQlG1bM65YqKSIww==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.17.8.tgz", + "integrity": "sha512-8svILYKhE5XetuFk/B6raFYIyIqydQi+GngEXJgdPdI7OMKUbSd7uzR02wSY4kb53xBrClLkhH4Xs8P61Q2BaA==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.17.8.tgz", + "integrity": "sha512-B6FyMeRJeV0NpyEOYlm5qtQfxbdlgmiGdD+QsipzKfFky0K5HW5Td6dyK3L3ypu1eY4kOmo7wW0o94SBqlqBSA==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.17.8.tgz", + "integrity": "sha512-CCb67RKahNobjm/eeEqeD/oJfJlrWyw29fgiyB6vcgyq97YAf3gCOuP6qMShYSPXgnlZe/i4a8WFHBw6N8bYAA==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.17.8.tgz", + "integrity": "sha512-bytLJOi55y55+mGSdgwZ5qBm0K9WOCh0rx+vavVPx+gqLLhxtSFU0XbeYy/dsAAD6xECGEv4IQeFILaSS2auXw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.17.8.tgz", + "integrity": "sha512-2YpRyQJmKVBEHSBLa8kBAtbhucaclb6ex4wchfY0Tj3Kg39kpjeJ9vhRU7x4mUpq8ISLXRXH1L0dBYjAeqzZAw==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.17.8.tgz", + "integrity": "sha512-QgbNY/V3IFXvNf11SS6exkpVcX0LJcob+0RWCgV9OiDAmVElnxciHIisoSix9uzYzScPmS6dJFbZULdSAEkQVw==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.8.tgz", + "integrity": "sha512-mM/9S0SbAFDBc4OPoyP6SEOo5324LpUxdpeIUUSrSTOfhHU9hEfqRngmKgqILqwx/0DVJBzeNW7HmLEWp9vcOA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.17.8.tgz", + "integrity": "sha512-eKUYcWaWTaYr9zbj8GertdVtlt1DTS1gNBWov+iQfWuWyuu59YN6gSEJvFzC5ESJ4kMcKR0uqWThKUn5o8We6Q==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.17.8.tgz", + "integrity": "sha512-Vc9J4dXOboDyMXKD0eCeW0SIeEzr8K9oTHJU+Ci1mZc5njPfhKAqkRt3B/fUNU7dP+mRyralPu8QUkiaQn7iIg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.17.8.tgz", + "integrity": "sha512-0xvOTNuPXI7ft1LYUgiaXtpCEjp90RuBBYovdd2lqAFxje4sEucurg30M1WIm03+3jxByd3mfo+VUmPtRSVuOw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.17.8.tgz", + "integrity": "sha512-G0JQwUI5WdEFEnYNKzklxtBheCPkuDdu1YrtRrjuQv30WsYbkkoixKxLLv8qhJmNI+ATEWquZe/N0d0rpr55Mg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.17.8.tgz", + "integrity": "sha512-Fqy63515xl20OHGFykjJsMnoIWS+38fqfg88ClvPXyDbLtgXal2DTlhb1TfTX34qWi3u4I7Cq563QcHpqgLx8w==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.17.8.tgz", + "integrity": "sha512-1iuezdyDNngPnz8rLRDO2C/ZZ/emJLb72OsZeqQ6gL6Avko/XCXZw+NuxBSNhBAP13Hie418V7VMt9et1FMvpg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, "node_modules/@jridgewell/gen-mapping": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", @@ -652,451 +1003,128 @@ "engines": { "node": ">= 8" } - }, - "node_modules/dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, - "dependencies": { - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/electron-to-chromium": { - "version": "1.4.64", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.64.tgz", - "integrity": "sha512-8mec/99xgLUZCIZZq3wt61Tpxg55jnOSpxGYapE/1Ma9MpFEYYaz4QNYm0CM1rrnCo7i3FRHhbaWjeCLsveGjQ==", - "dev": true - }, - "node_modules/emojis-list": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", - "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", - "dev": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/enhanced-resolve": { - "version": "5.10.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.10.0.tgz", - "integrity": "sha512-T0yTFjdpldGY8PmuXXR0PyQ1ufZpEGiHVrp7zHKB7jdR4qlmZHhONVM5AQOAWXuF/w3dnHbEQVrNptJgt7F+cQ==", - "dev": true, - "dependencies": { - "graceful-fs": "^4.2.4", - "tapable": "^2.2.0" - }, - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/envinfo": { - "version": "7.8.1", - "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.8.1.tgz", - "integrity": "sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw==", - "dev": true, - "bin": { - "envinfo": "dist/cli.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/es-module-lexer": { - "version": "0.9.3", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.9.3.tgz", - "integrity": "sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ==", - "dev": true - }, - "node_modules/esbuild": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.14.47.tgz", - "integrity": "sha512-wI4ZiIfFxpkuxB8ju4MHrGwGLyp1+awEHAHVpx6w7a+1pmYIq8T9FGEVVwFo0iFierDoMj++Xq69GXWYn2EiwA==", - "dev": true, - "hasInstallScript": true, - "bin": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=12" - }, - "optionalDependencies": { - "esbuild-android-64": "0.14.47", - "esbuild-android-arm64": "0.14.47", - "esbuild-darwin-64": "0.14.47", - "esbuild-darwin-arm64": "0.14.47", - "esbuild-freebsd-64": "0.14.47", - "esbuild-freebsd-arm64": "0.14.47", - "esbuild-linux-32": "0.14.47", - "esbuild-linux-64": "0.14.47", - "esbuild-linux-arm": "0.14.47", - "esbuild-linux-arm64": "0.14.47", - "esbuild-linux-mips64le": "0.14.47", - "esbuild-linux-ppc64le": "0.14.47", - "esbuild-linux-riscv64": "0.14.47", - "esbuild-linux-s390x": "0.14.47", - "esbuild-netbsd-64": "0.14.47", - "esbuild-openbsd-64": "0.14.47", - "esbuild-sunos-64": "0.14.47", - "esbuild-windows-32": "0.14.47", - "esbuild-windows-64": "0.14.47", - "esbuild-windows-arm64": "0.14.47" - } - }, - "node_modules/esbuild-android-64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.14.47.tgz", - "integrity": "sha512-R13Bd9+tqLVFndncMHssZrPWe6/0Kpv2/dt4aA69soX4PRxlzsVpCvoJeFE8sOEoeVEiBkI0myjlkDodXlHa0g==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-android-arm64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.14.47.tgz", - "integrity": "sha512-OkwOjj7ts4lBp/TL6hdd8HftIzOy/pdtbrNA4+0oVWgGG64HrdVzAF5gxtJufAPOsEjkyh1oIYvKAUinKKQRSQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-darwin-64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.14.47.tgz", - "integrity": "sha512-R6oaW0y5/u6Eccti/TS6c/2c1xYTb1izwK3gajJwi4vIfNs1s8B1dQzI1UiC9T61YovOQVuePDcfqHLT3mUZJA==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-darwin-arm64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.47.tgz", - "integrity": "sha512-seCmearlQyvdvM/noz1L9+qblC5vcBrhUaOoLEDDoLInF/VQ9IkobGiLlyTPYP5dW1YD4LXhtBgOyevoIHGGnw==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-freebsd-64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.47.tgz", - "integrity": "sha512-ZH8K2Q8/Ux5kXXvQMDsJcxvkIwut69KVrYQhza/ptkW50DC089bCVrJZZ3sKzIoOx+YPTrmsZvqeZERjyYrlvQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-freebsd-arm64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.47.tgz", - "integrity": "sha512-ZJMQAJQsIOhn3XTm7MPQfCzEu5b9STNC+s90zMWe2afy9EwnHV7Ov7ohEMv2lyWlc2pjqLW8QJnz2r0KZmeAEQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-linux-32": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.14.47.tgz", - "integrity": "sha512-FxZOCKoEDPRYvq300lsWCTv1kcHgiiZfNrPtEhFAiqD7QZaXrad8LxyJ8fXGcWzIFzRiYZVtB3ttvITBvAFhKw==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-linux-64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.14.47.tgz", - "integrity": "sha512-nFNOk9vWVfvWYF9YNYksZptgQAdstnDCMtR6m42l5Wfugbzu11VpMCY9XrD4yFxvPo9zmzcoUL/88y0lfJZJJw==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-linux-arm": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.14.47.tgz", - "integrity": "sha512-ZGE1Bqg/gPRXrBpgpvH81tQHpiaGxa8c9Rx/XOylkIl2ypLuOcawXEAo8ls+5DFCcRGt/o3sV+PzpAFZobOsmA==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-linux-arm64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.47.tgz", - "integrity": "sha512-ywfme6HVrhWcevzmsufjd4iT3PxTfCX9HOdxA7Hd+/ZM23Y9nXeb+vG6AyA6jgq/JovkcqRHcL9XwRNpWG6XRw==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-linux-mips64le": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.47.tgz", - "integrity": "sha512-mg3D8YndZ1LvUiEdDYR3OsmeyAew4MA/dvaEJxvyygahWmpv1SlEEnhEZlhPokjsUMfRagzsEF/d/2XF+kTQGg==", - "cpu": [ - "mips64el" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-linux-ppc64le": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.47.tgz", - "integrity": "sha512-WER+f3+szmnZiWoK6AsrTKGoJoErG2LlauSmk73LEZFQ/iWC+KhhDsOkn1xBUpzXWsxN9THmQFltLoaFEH8F8w==", - "cpu": [ - "ppc64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-linux-riscv64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.14.47.tgz", - "integrity": "sha512-1fI6bP3A3rvI9BsaaXbMoaOjLE3lVkJtLxsgLHqlBhLlBVY7UqffWBvkrX/9zfPhhVMd9ZRFiaqXnB1T7BsL2g==", - "cpu": [ - "riscv64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-linux-s390x": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.47.tgz", - "integrity": "sha512-eZrWzy0xFAhki1CWRGnhsHVz7IlSKX6yT2tj2Eg8lhAwlRE5E96Hsb0M1mPSE1dHGpt1QVwwVivXIAacF/G6mw==", - "cpu": [ - "s390x" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-loader": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/esbuild-loader/-/esbuild-loader-2.19.0.tgz", - "integrity": "sha512-urGNVE6Tl2rqx92ElKi/LiExXjGvcH6HfDBFzJ9Ppwqh4n6Jmx8x7RKAyMzSM78b6CAaJLhDncG5sPrL0ROh5Q==", - "dev": true, - "dependencies": { - "esbuild": "^0.14.39", - "joycon": "^3.0.1", - "json5": "^2.2.0", - "loader-utils": "^2.0.0", - "tapable": "^2.2.0", - "webpack-sources": "^2.2.0" - }, - "funding": { - "url": "https://github.com/privatenumber/esbuild-loader?sponsor=1" - }, - "peerDependencies": { - "webpack": "^4.40.0 || ^5.0.0" - } - }, - "node_modules/esbuild-loader/node_modules/webpack-sources": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-2.3.1.tgz", - "integrity": "sha512-y9EI9AO42JjEcrTJFOYmVywVZdKVUfOvDUPsJea5GIr1JOEGFVqwlY2K098fFoIjOkDzHn2AjRvM8dsBZu+gCA==", + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", "dev": true, "dependencies": { - "source-list-map": "^2.0.1", - "source-map": "^0.6.1" + "path-type": "^4.0.0" }, "engines": { - "node": ">=10.13.0" + "node": ">=8" } }, - "node_modules/esbuild-netbsd-64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.47.tgz", - "integrity": "sha512-Qjdjr+KQQVH5Q2Q1r6HBYswFTToPpss3gqCiSw2Fpq/ua8+eXSQyAMG+UvULPqXceOwpnPo4smyZyHdlkcPppQ==", - "cpu": [ - "x64" - ], + "node_modules/electron-to-chromium": { + "version": "1.4.64", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.64.tgz", + "integrity": "sha512-8mec/99xgLUZCIZZq3wt61Tpxg55jnOSpxGYapE/1Ma9MpFEYYaz4QNYm0CM1rrnCo7i3FRHhbaWjeCLsveGjQ==", + "dev": true + }, + "node_modules/emojis-list": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", + "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", "dev": true, - "optional": true, - "os": [ - "netbsd" - ], "engines": { - "node": ">=12" + "node": ">= 4" } }, - "node_modules/esbuild-openbsd-64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.47.tgz", - "integrity": "sha512-QpgN8ofL7B9z8g5zZqJE+eFvD1LehRlxr25PBkjyyasakm4599iroUpaj96rdqRlO2ShuyqwJdr+oNqWwTUmQw==", - "cpu": [ - "x64" - ], + "node_modules/enhanced-resolve": { + "version": "5.10.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.10.0.tgz", + "integrity": "sha512-T0yTFjdpldGY8PmuXXR0PyQ1ufZpEGiHVrp7zHKB7jdR4qlmZHhONVM5AQOAWXuF/w3dnHbEQVrNptJgt7F+cQ==", "dev": true, - "optional": true, - "os": [ - "openbsd" - ], + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.2.0" + }, "engines": { - "node": ">=12" + "node": ">=10.13.0" } }, - "node_modules/esbuild-sunos-64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.14.47.tgz", - "integrity": "sha512-uOeSgLUwukLioAJOiGYm3kNl+1wJjgJA8R671GYgcPgCx7QR73zfvYqXFFcIO93/nBdIbt5hd8RItqbbf3HtAQ==", - "cpu": [ - "x64" - ], + "node_modules/envinfo": { + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.8.1.tgz", + "integrity": "sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw==", "dev": true, - "optional": true, - "os": [ - "sunos" - ], + "bin": { + "envinfo": "dist/cli.js" + }, "engines": { - "node": ">=12" + "node": ">=4" } }, - "node_modules/esbuild-windows-32": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.14.47.tgz", - "integrity": "sha512-H0fWsLTp2WBfKLBgwYT4OTfFly4Im/8B5f3ojDv1Kx//kiubVY0IQunP2Koc/fr/0wI7hj3IiBDbSrmKlrNgLQ==", - "cpu": [ - "ia32" - ], + "node_modules/es-module-lexer": { + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.9.3.tgz", + "integrity": "sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ==", + "dev": true + }, + "node_modules/esbuild": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.17.8.tgz", + "integrity": "sha512-g24ybC3fWhZddZK6R3uD2iF/RIPnRpwJAqLov6ouX3hMbY4+tKolP0VMF3zuIYCaXun+yHwS5IPQ91N2BT191g==", "dev": true, - "optional": true, - "os": [ - "win32" - ], + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, "engines": { "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/android-arm": "0.17.8", + "@esbuild/android-arm64": "0.17.8", + "@esbuild/android-x64": "0.17.8", + "@esbuild/darwin-arm64": "0.17.8", + "@esbuild/darwin-x64": "0.17.8", + "@esbuild/freebsd-arm64": "0.17.8", + "@esbuild/freebsd-x64": "0.17.8", + "@esbuild/linux-arm": "0.17.8", + "@esbuild/linux-arm64": "0.17.8", + "@esbuild/linux-ia32": "0.17.8", + "@esbuild/linux-loong64": "0.17.8", + "@esbuild/linux-mips64el": "0.17.8", + "@esbuild/linux-ppc64": "0.17.8", + "@esbuild/linux-riscv64": "0.17.8", + "@esbuild/linux-s390x": "0.17.8", + "@esbuild/linux-x64": "0.17.8", + "@esbuild/netbsd-x64": "0.17.8", + "@esbuild/openbsd-x64": "0.17.8", + "@esbuild/sunos-x64": "0.17.8", + "@esbuild/win32-arm64": "0.17.8", + "@esbuild/win32-ia32": "0.17.8", + "@esbuild/win32-x64": "0.17.8" } }, - "node_modules/esbuild-windows-64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.14.47.tgz", - "integrity": "sha512-/Pk5jIEH34T68r8PweKRi77W49KwanZ8X6lr3vDAtOlH5EumPE4pBHqkCUdELanvsT14yMXLQ/C/8XPi1pAtkQ==", - "cpu": [ - "x64" - ], + "node_modules/esbuild-loader": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/esbuild-loader/-/esbuild-loader-3.0.1.tgz", + "integrity": "sha512-aZfGybqTeuyCd4AsVvWOOfkhIuN+wfZFjMyh3gyQEU1Uvsl8L6vye9HqP93iRa0iTA+6Jclap514PJIC3cLnMA==", "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" + "dependencies": { + "esbuild": "^0.17.6", + "get-tsconfig": "^4.4.0", + "loader-utils": "^2.0.4", + "webpack-sources": "^1.4.3" + }, + "funding": { + "url": "https://github.com/esbuild-kit/esbuild-loader?sponsor=1" + }, + "peerDependencies": { + "webpack": "^4.40.0 || ^5.0.0" } }, - "node_modules/esbuild-windows-arm64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.47.tgz", - "integrity": "sha512-HFSW2lnp62fl86/qPQlqw6asIwCnEsEoNIL1h2uVMgakddf+vUuMcCbtUY1i8sst7KkgHrVKCJQB33YhhOweCQ==", - "cpu": [ - "arm64" - ], + "node_modules/esbuild-loader/node_modules/webpack-sources": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.4.3.tgz", + "integrity": "sha512-lgTS3Xhv1lCOKo7SA5TjKXMjpSM4sBjNV5+q2bqesbSPs5FjGmU6jjtBSkX9b4qW87vDIsCIlUPOEhbZrMdjeQ==", "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" + "dependencies": { + "source-list-map": "^2.0.0", + "source-map": "~0.6.1" } }, "node_modules/escalade": { @@ -1252,6 +1280,15 @@ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, + "node_modules/get-tsconfig": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.4.0.tgz", + "integrity": "sha512-0Gdjo/9+FzsYhXCEFueo2aY1z1tpXrxWZzP7k8ul9qt1U5o8rYJwTJYmaeHdrVosYIVYkOy2iwCJ9FdpocJhPQ==", + "dev": true, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, "node_modules/glob": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", @@ -1488,15 +1525,6 @@ "url": "https://github.com/chalk/supports-color?sponsor=1" } }, - "node_modules/joycon": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/joycon/-/joycon-3.1.1.tgz", - "integrity": "sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==", - "dev": true, - "engines": { - "node": ">=10" - } - }, "node_modules/json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", @@ -1510,9 +1538,9 @@ "dev": true }, "node_modules/json5": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", - "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "dev": true, "bin": { "json5": "lib/cli.js" @@ -1540,9 +1568,9 @@ } }, "node_modules/loader-utils": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.2.tgz", - "integrity": "sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz", + "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==", "dev": true, "dependencies": { "big.js": "^5.2.2", @@ -1627,9 +1655,9 @@ } }, "node_modules/minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "dependencies": { "brace-expansion": "^1.1.7" @@ -2225,9 +2253,9 @@ } }, "node_modules/ts-loader": { - "version": "9.3.1", - "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.3.1.tgz", - "integrity": "sha512-OkyShkcZTsTwyS3Kt7a4rsT/t2qvEVQuKCTg4LJmpj9fhFR7ukGdZwV6Qq3tRUkqcXtfGpPR7+hFKHCG/0d3Lw==", + "version": "9.4.2", + "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.4.2.tgz", + "integrity": "sha512-OmlC4WVmFv5I0PpaxYb+qGeGOdm5giHU7HwDDUjw59emP2UYMHy9fFSDcYgSNoH8sXcj4hGCSEhlDZ9ULeDraA==", "dev": true, "dependencies": { "chalk": "^4.1.0", @@ -2279,9 +2307,9 @@ } }, "node_modules/webpack": { - "version": "5.74.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.74.0.tgz", - "integrity": "sha512-A2InDwnhhGN4LYctJj6M1JEaGL7Luj6LOmyBHjcI8529cm5p6VXiTIW2sn6ffvEAKmveLzvu4jrihwXtPojlAA==", + "version": "5.76.1", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.76.1.tgz", + "integrity": "sha512-4+YIK4Abzv8172/SGqObnUjaIHjLEuUasz9EwQj/9xmPPkYJy2Mh03Q/lJfSD3YLzbxy5FeTq5Uw0323Oh6SJQ==", "dev": true, "dependencies": { "@types/eslint-scope": "^3.7.3", @@ -2514,6 +2542,160 @@ "integrity": "sha512-ws57AidsDvREKrZKYffXddNkyaF14iHNHm8VQnZH6t99E8gczjNN0GpvcGny0imC80yQ0tHz1xVUKk/KFQSUyA==", "dev": true }, + "@esbuild/android-arm": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.17.8.tgz", + "integrity": "sha512-0/rb91GYKhrtbeglJXOhAv9RuYimgI8h623TplY2X+vA4EXnk3Zj1fXZreJ0J3OJJu1bwmb0W7g+2cT/d8/l/w==", + "dev": true, + "optional": true + }, + "@esbuild/android-arm64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.17.8.tgz", + "integrity": "sha512-oa/N5j6v1svZQs7EIRPqR8f+Bf8g6HBDjD/xHC02radE/NjKHK7oQmtmLxPs1iVwYyvE+Kolo6lbpfEQ9xnhxQ==", + "dev": true, + "optional": true + }, + "@esbuild/android-x64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.8.tgz", + "integrity": "sha512-bTliMLqD7pTOoPg4zZkXqCDuzIUguEWLpeqkNfC41ODBHwoUgZ2w5JBeYimv4oP6TDVocoYmEhZrCLQTrH89bg==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-arm64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.17.8.tgz", + "integrity": "sha512-ghAbV3ia2zybEefXRRm7+lx8J/rnupZT0gp9CaGy/3iolEXkJ6LYRq4IpQVI9zR97ID80KJVoUlo3LSeA/sMAg==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-x64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.17.8.tgz", + "integrity": "sha512-n5WOpyvZ9TIdv2V1K3/iIkkJeKmUpKaCTdun9buhGRWfH//osmUjlv4Z5mmWdPWind/VGcVxTHtLfLCOohsOXw==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-arm64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.8.tgz", + "integrity": "sha512-a/SATTaOhPIPFWvHZDoZYgxaZRVHn0/LX1fHLGfZ6C13JqFUZ3K6SMD6/HCtwOQ8HnsNaEeokdiDSFLuizqv5A==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-x64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.17.8.tgz", + "integrity": "sha512-xpFJb08dfXr5+rZc4E+ooZmayBW6R3q59daCpKZ/cDU96/kvDM+vkYzNeTJCGd8rtO6fHWMq5Rcv/1cY6p6/0Q==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.17.8.tgz", + "integrity": "sha512-6Ij8gfuGszcEwZpi5jQIJCVIACLS8Tz2chnEBfYjlmMzVsfqBP1iGmHQPp7JSnZg5xxK9tjCc+pJ2WtAmPRFVA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.17.8.tgz", + "integrity": "sha512-v3iwDQuDljLTxpsqQDl3fl/yihjPAyOguxuloON9kFHYwopeJEf1BkDXODzYyXEI19gisEsQlG1bM65YqKSIww==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ia32": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.17.8.tgz", + "integrity": "sha512-8svILYKhE5XetuFk/B6raFYIyIqydQi+GngEXJgdPdI7OMKUbSd7uzR02wSY4kb53xBrClLkhH4Xs8P61Q2BaA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-loong64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.17.8.tgz", + "integrity": "sha512-B6FyMeRJeV0NpyEOYlm5qtQfxbdlgmiGdD+QsipzKfFky0K5HW5Td6dyK3L3ypu1eY4kOmo7wW0o94SBqlqBSA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-mips64el": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.17.8.tgz", + "integrity": "sha512-CCb67RKahNobjm/eeEqeD/oJfJlrWyw29fgiyB6vcgyq97YAf3gCOuP6qMShYSPXgnlZe/i4a8WFHBw6N8bYAA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ppc64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.17.8.tgz", + "integrity": "sha512-bytLJOi55y55+mGSdgwZ5qBm0K9WOCh0rx+vavVPx+gqLLhxtSFU0XbeYy/dsAAD6xECGEv4IQeFILaSS2auXw==", + "dev": true, + "optional": true + }, + "@esbuild/linux-riscv64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.17.8.tgz", + "integrity": "sha512-2YpRyQJmKVBEHSBLa8kBAtbhucaclb6ex4wchfY0Tj3Kg39kpjeJ9vhRU7x4mUpq8ISLXRXH1L0dBYjAeqzZAw==", + "dev": true, + "optional": true + }, + "@esbuild/linux-s390x": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.17.8.tgz", + "integrity": "sha512-QgbNY/V3IFXvNf11SS6exkpVcX0LJcob+0RWCgV9OiDAmVElnxciHIisoSix9uzYzScPmS6dJFbZULdSAEkQVw==", + "dev": true, + "optional": true + }, + "@esbuild/linux-x64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.8.tgz", + "integrity": "sha512-mM/9S0SbAFDBc4OPoyP6SEOo5324LpUxdpeIUUSrSTOfhHU9hEfqRngmKgqILqwx/0DVJBzeNW7HmLEWp9vcOA==", + "dev": true, + "optional": true + }, + "@esbuild/netbsd-x64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.17.8.tgz", + "integrity": "sha512-eKUYcWaWTaYr9zbj8GertdVtlt1DTS1gNBWov+iQfWuWyuu59YN6gSEJvFzC5ESJ4kMcKR0uqWThKUn5o8We6Q==", + "dev": true, + "optional": true + }, + "@esbuild/openbsd-x64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.17.8.tgz", + "integrity": "sha512-Vc9J4dXOboDyMXKD0eCeW0SIeEzr8K9oTHJU+Ci1mZc5njPfhKAqkRt3B/fUNU7dP+mRyralPu8QUkiaQn7iIg==", + "dev": true, + "optional": true + }, + "@esbuild/sunos-x64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.17.8.tgz", + "integrity": "sha512-0xvOTNuPXI7ft1LYUgiaXtpCEjp90RuBBYovdd2lqAFxje4sEucurg30M1WIm03+3jxByd3mfo+VUmPtRSVuOw==", + "dev": true, + "optional": true + }, + "@esbuild/win32-arm64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.17.8.tgz", + "integrity": "sha512-G0JQwUI5WdEFEnYNKzklxtBheCPkuDdu1YrtRrjuQv30WsYbkkoixKxLLv8qhJmNI+ATEWquZe/N0d0rpr55Mg==", + "dev": true, + "optional": true + }, + "@esbuild/win32-ia32": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.17.8.tgz", + "integrity": "sha512-Fqy63515xl20OHGFykjJsMnoIWS+38fqfg88ClvPXyDbLtgXal2DTlhb1TfTX34qWi3u4I7Cq563QcHpqgLx8w==", + "dev": true, + "optional": true + }, + "@esbuild/win32-x64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.17.8.tgz", + "integrity": "sha512-1iuezdyDNngPnz8rLRDO2C/ZZ/emJLb72OsZeqQ6gL6Avko/XCXZw+NuxBSNhBAP13Hie418V7VMt9et1FMvpg==", + "dev": true, + "optional": true + }, "@jridgewell/gen-mapping": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", @@ -3060,199 +3242,59 @@ "dev": true }, "esbuild": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.14.47.tgz", - "integrity": "sha512-wI4ZiIfFxpkuxB8ju4MHrGwGLyp1+awEHAHVpx6w7a+1pmYIq8T9FGEVVwFo0iFierDoMj++Xq69GXWYn2EiwA==", + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.17.8.tgz", + "integrity": "sha512-g24ybC3fWhZddZK6R3uD2iF/RIPnRpwJAqLov6ouX3hMbY4+tKolP0VMF3zuIYCaXun+yHwS5IPQ91N2BT191g==", "dev": true, "requires": { - "esbuild-android-64": "0.14.47", - "esbuild-android-arm64": "0.14.47", - "esbuild-darwin-64": "0.14.47", - "esbuild-darwin-arm64": "0.14.47", - "esbuild-freebsd-64": "0.14.47", - "esbuild-freebsd-arm64": "0.14.47", - "esbuild-linux-32": "0.14.47", - "esbuild-linux-64": "0.14.47", - "esbuild-linux-arm": "0.14.47", - "esbuild-linux-arm64": "0.14.47", - "esbuild-linux-mips64le": "0.14.47", - "esbuild-linux-ppc64le": "0.14.47", - "esbuild-linux-riscv64": "0.14.47", - "esbuild-linux-s390x": "0.14.47", - "esbuild-netbsd-64": "0.14.47", - "esbuild-openbsd-64": "0.14.47", - "esbuild-sunos-64": "0.14.47", - "esbuild-windows-32": "0.14.47", - "esbuild-windows-64": "0.14.47", - "esbuild-windows-arm64": "0.14.47" - } - }, - "esbuild-android-64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.14.47.tgz", - "integrity": "sha512-R13Bd9+tqLVFndncMHssZrPWe6/0Kpv2/dt4aA69soX4PRxlzsVpCvoJeFE8sOEoeVEiBkI0myjlkDodXlHa0g==", - "dev": true, - "optional": true - }, - "esbuild-android-arm64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.14.47.tgz", - "integrity": "sha512-OkwOjj7ts4lBp/TL6hdd8HftIzOy/pdtbrNA4+0oVWgGG64HrdVzAF5gxtJufAPOsEjkyh1oIYvKAUinKKQRSQ==", - "dev": true, - "optional": true - }, - "esbuild-darwin-64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.14.47.tgz", - "integrity": "sha512-R6oaW0y5/u6Eccti/TS6c/2c1xYTb1izwK3gajJwi4vIfNs1s8B1dQzI1UiC9T61YovOQVuePDcfqHLT3mUZJA==", - "dev": true, - "optional": true - }, - "esbuild-darwin-arm64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.47.tgz", - "integrity": "sha512-seCmearlQyvdvM/noz1L9+qblC5vcBrhUaOoLEDDoLInF/VQ9IkobGiLlyTPYP5dW1YD4LXhtBgOyevoIHGGnw==", - "dev": true, - "optional": true - }, - "esbuild-freebsd-64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.47.tgz", - "integrity": "sha512-ZH8K2Q8/Ux5kXXvQMDsJcxvkIwut69KVrYQhza/ptkW50DC089bCVrJZZ3sKzIoOx+YPTrmsZvqeZERjyYrlvQ==", - "dev": true, - "optional": true - }, - "esbuild-freebsd-arm64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.47.tgz", - "integrity": "sha512-ZJMQAJQsIOhn3XTm7MPQfCzEu5b9STNC+s90zMWe2afy9EwnHV7Ov7ohEMv2lyWlc2pjqLW8QJnz2r0KZmeAEQ==", - "dev": true, - "optional": true - }, - "esbuild-linux-32": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.14.47.tgz", - "integrity": "sha512-FxZOCKoEDPRYvq300lsWCTv1kcHgiiZfNrPtEhFAiqD7QZaXrad8LxyJ8fXGcWzIFzRiYZVtB3ttvITBvAFhKw==", - "dev": true, - "optional": true - }, - "esbuild-linux-64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.14.47.tgz", - "integrity": "sha512-nFNOk9vWVfvWYF9YNYksZptgQAdstnDCMtR6m42l5Wfugbzu11VpMCY9XrD4yFxvPo9zmzcoUL/88y0lfJZJJw==", - "dev": true, - "optional": true - }, - "esbuild-linux-arm": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.14.47.tgz", - "integrity": "sha512-ZGE1Bqg/gPRXrBpgpvH81tQHpiaGxa8c9Rx/XOylkIl2ypLuOcawXEAo8ls+5DFCcRGt/o3sV+PzpAFZobOsmA==", - "dev": true, - "optional": true - }, - "esbuild-linux-arm64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.47.tgz", - "integrity": "sha512-ywfme6HVrhWcevzmsufjd4iT3PxTfCX9HOdxA7Hd+/ZM23Y9nXeb+vG6AyA6jgq/JovkcqRHcL9XwRNpWG6XRw==", - "dev": true, - "optional": true - }, - "esbuild-linux-mips64le": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.47.tgz", - "integrity": "sha512-mg3D8YndZ1LvUiEdDYR3OsmeyAew4MA/dvaEJxvyygahWmpv1SlEEnhEZlhPokjsUMfRagzsEF/d/2XF+kTQGg==", - "dev": true, - "optional": true - }, - "esbuild-linux-ppc64le": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.47.tgz", - "integrity": "sha512-WER+f3+szmnZiWoK6AsrTKGoJoErG2LlauSmk73LEZFQ/iWC+KhhDsOkn1xBUpzXWsxN9THmQFltLoaFEH8F8w==", - "dev": true, - "optional": true - }, - "esbuild-linux-riscv64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.14.47.tgz", - "integrity": "sha512-1fI6bP3A3rvI9BsaaXbMoaOjLE3lVkJtLxsgLHqlBhLlBVY7UqffWBvkrX/9zfPhhVMd9ZRFiaqXnB1T7BsL2g==", - "dev": true, - "optional": true - }, - "esbuild-linux-s390x": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.47.tgz", - "integrity": "sha512-eZrWzy0xFAhki1CWRGnhsHVz7IlSKX6yT2tj2Eg8lhAwlRE5E96Hsb0M1mPSE1dHGpt1QVwwVivXIAacF/G6mw==", - "dev": true, - "optional": true + "@esbuild/android-arm": "0.17.8", + "@esbuild/android-arm64": "0.17.8", + "@esbuild/android-x64": "0.17.8", + "@esbuild/darwin-arm64": "0.17.8", + "@esbuild/darwin-x64": "0.17.8", + "@esbuild/freebsd-arm64": "0.17.8", + "@esbuild/freebsd-x64": "0.17.8", + "@esbuild/linux-arm": "0.17.8", + "@esbuild/linux-arm64": "0.17.8", + "@esbuild/linux-ia32": "0.17.8", + "@esbuild/linux-loong64": "0.17.8", + "@esbuild/linux-mips64el": "0.17.8", + "@esbuild/linux-ppc64": "0.17.8", + "@esbuild/linux-riscv64": "0.17.8", + "@esbuild/linux-s390x": "0.17.8", + "@esbuild/linux-x64": "0.17.8", + "@esbuild/netbsd-x64": "0.17.8", + "@esbuild/openbsd-x64": "0.17.8", + "@esbuild/sunos-x64": "0.17.8", + "@esbuild/win32-arm64": "0.17.8", + "@esbuild/win32-ia32": "0.17.8", + "@esbuild/win32-x64": "0.17.8" + } }, "esbuild-loader": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/esbuild-loader/-/esbuild-loader-2.19.0.tgz", - "integrity": "sha512-urGNVE6Tl2rqx92ElKi/LiExXjGvcH6HfDBFzJ9Ppwqh4n6Jmx8x7RKAyMzSM78b6CAaJLhDncG5sPrL0ROh5Q==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/esbuild-loader/-/esbuild-loader-3.0.1.tgz", + "integrity": "sha512-aZfGybqTeuyCd4AsVvWOOfkhIuN+wfZFjMyh3gyQEU1Uvsl8L6vye9HqP93iRa0iTA+6Jclap514PJIC3cLnMA==", "dev": true, "requires": { - "esbuild": "^0.14.39", - "joycon": "^3.0.1", - "json5": "^2.2.0", - "loader-utils": "^2.0.0", - "tapable": "^2.2.0", - "webpack-sources": "^2.2.0" + "esbuild": "^0.17.6", + "get-tsconfig": "^4.4.0", + "loader-utils": "^2.0.4", + "webpack-sources": "^1.4.3" }, "dependencies": { "webpack-sources": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-2.3.1.tgz", - "integrity": "sha512-y9EI9AO42JjEcrTJFOYmVywVZdKVUfOvDUPsJea5GIr1JOEGFVqwlY2K098fFoIjOkDzHn2AjRvM8dsBZu+gCA==", + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.4.3.tgz", + "integrity": "sha512-lgTS3Xhv1lCOKo7SA5TjKXMjpSM4sBjNV5+q2bqesbSPs5FjGmU6jjtBSkX9b4qW87vDIsCIlUPOEhbZrMdjeQ==", "dev": true, "requires": { - "source-list-map": "^2.0.1", - "source-map": "^0.6.1" + "source-list-map": "^2.0.0", + "source-map": "~0.6.1" } } } }, - "esbuild-netbsd-64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.47.tgz", - "integrity": "sha512-Qjdjr+KQQVH5Q2Q1r6HBYswFTToPpss3gqCiSw2Fpq/ua8+eXSQyAMG+UvULPqXceOwpnPo4smyZyHdlkcPppQ==", - "dev": true, - "optional": true - }, - "esbuild-openbsd-64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.47.tgz", - "integrity": "sha512-QpgN8ofL7B9z8g5zZqJE+eFvD1LehRlxr25PBkjyyasakm4599iroUpaj96rdqRlO2ShuyqwJdr+oNqWwTUmQw==", - "dev": true, - "optional": true - }, - "esbuild-sunos-64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.14.47.tgz", - "integrity": "sha512-uOeSgLUwukLioAJOiGYm3kNl+1wJjgJA8R671GYgcPgCx7QR73zfvYqXFFcIO93/nBdIbt5hd8RItqbbf3HtAQ==", - "dev": true, - "optional": true - }, - "esbuild-windows-32": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.14.47.tgz", - "integrity": "sha512-H0fWsLTp2WBfKLBgwYT4OTfFly4Im/8B5f3ojDv1Kx//kiubVY0IQunP2Koc/fr/0wI7hj3IiBDbSrmKlrNgLQ==", - "dev": true, - "optional": true - }, - "esbuild-windows-64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.14.47.tgz", - "integrity": "sha512-/Pk5jIEH34T68r8PweKRi77W49KwanZ8X6lr3vDAtOlH5EumPE4pBHqkCUdELanvsT14yMXLQ/C/8XPi1pAtkQ==", - "dev": true, - "optional": true - }, - "esbuild-windows-arm64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.47.tgz", - "integrity": "sha512-HFSW2lnp62fl86/qPQlqw6asIwCnEsEoNIL1h2uVMgakddf+vUuMcCbtUY1i8sst7KkgHrVKCJQB33YhhOweCQ==", - "dev": true, - "optional": true - }, "escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", @@ -3380,6 +3422,12 @@ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, + "get-tsconfig": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.4.0.tgz", + "integrity": "sha512-0Gdjo/9+FzsYhXCEFueo2aY1z1tpXrxWZzP7k8ul9qt1U5o8rYJwTJYmaeHdrVosYIVYkOy2iwCJ9FdpocJhPQ==", + "dev": true + }, "glob": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", @@ -3555,12 +3603,6 @@ } } }, - "joycon": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/joycon/-/joycon-3.1.1.tgz", - "integrity": "sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==", - "dev": true - }, "json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", @@ -3574,9 +3616,9 @@ "dev": true }, "json5": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", - "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "dev": true }, "kind-of": { @@ -3592,9 +3634,9 @@ "dev": true }, "loader-utils": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.2.tgz", - "integrity": "sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz", + "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==", "dev": true, "requires": { "big.js": "^5.2.2", @@ -3658,9 +3700,9 @@ } }, "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "requires": { "brace-expansion": "^1.1.7" @@ -4054,9 +4096,9 @@ } }, "ts-loader": { - "version": "9.3.1", - "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.3.1.tgz", - "integrity": "sha512-OkyShkcZTsTwyS3Kt7a4rsT/t2qvEVQuKCTg4LJmpj9fhFR7ukGdZwV6Qq3tRUkqcXtfGpPR7+hFKHCG/0d3Lw==", + "version": "9.4.2", + "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.4.2.tgz", + "integrity": "sha512-OmlC4WVmFv5I0PpaxYb+qGeGOdm5giHU7HwDDUjw59emP2UYMHy9fFSDcYgSNoH8sXcj4hGCSEhlDZ9ULeDraA==", "dev": true, "requires": { "chalk": "^4.1.0", @@ -4091,9 +4133,9 @@ } }, "webpack": { - "version": "5.74.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.74.0.tgz", - "integrity": "sha512-A2InDwnhhGN4LYctJj6M1JEaGL7Luj6LOmyBHjcI8529cm5p6VXiTIW2sn6ffvEAKmveLzvu4jrihwXtPojlAA==", + "version": "5.76.1", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.76.1.tgz", + "integrity": "sha512-4+YIK4Abzv8172/SGqObnUjaIHjLEuUasz9EwQj/9xmPPkYJy2Mh03Q/lJfSD3YLzbxy5FeTq5Uw0323Oh6SJQ==", "dev": true, "requires": { "@types/eslint-scope": "^3.7.3", diff --git a/packages/pyright/package.json b/packages/pyright/package.json index 8ad123ddd..e68a803fd 100644 --- a/packages/pyright/package.json +++ b/packages/pyright/package.json @@ -2,7 +2,7 @@ "name": "pyright", "displayName": "Pyright", "description": "Type checker for the Python language", - "version": "1.1.267", + "version": "1.1.301", "license": "MIT", "author": { "name": "Microsoft Corporation" @@ -26,11 +26,11 @@ "@types/copy-webpack-plugin": "^10.1.0", "@types/node": "^17.0.45", "copy-webpack-plugin": "^10.2.4", - "esbuild-loader": "^2.19.0", + "esbuild-loader": "^3.0.1", "shx": "^0.3.4", - "ts-loader": "^9.3.1", + "ts-loader": "^9.4.2", "typescript": "~4.4.4", - "webpack": "^5.74.0", + "webpack": "^5.76.0", "webpack-cli": "^4.10.0" }, "files": [ diff --git a/packages/vscode-pyright/README.md b/packages/vscode-pyright/README.md index 9ad70dfce..7be170b1a 100644 --- a/packages/vscode-pyright/README.md +++ b/packages/vscode-pyright/README.md @@ -1,60 +1,10 @@ -# Static type checker for Python +# Static Type Checker for Python -### Speed +Pyright is a full-featured, standards-based static type checker for Python. It is designed for high performance and can be used with large Python source bases. -Pyright is a fast type checker meant for large Python source bases. It can run in a "watch" mode and performs fast incremental updates when files are modified. +Pyright includes both a [command-line tool](/docs/command-line.md) and an [extension for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=ms-pyright.pyright). -### Configurability -Pyright supports [configuration files](/docs/configuration.md) that provide granular control over settings. Different "execution environments" can be associated with subdirectories within a source base. Each environment can specify different module search paths, python language versions, and platform targets. +## Documentation -### Type Checking Features - -* [PEP 484](https://www.python.org/dev/peps/pep-0484/) type hints including generics -* [PEP 487](https://www.python.org/dev/peps/pep-0487/) simpler customization of class creation -* [PEP 526](https://www.python.org/dev/peps/pep-0526/) syntax for variable annotations -* [PEP 544](https://www.python.org/dev/peps/pep-0544/) structural subtyping -* [PEP 561](https://www.python.org/dev/peps/pep-0561/) distributing and packaging type information -* [PEP 563](https://www.python.org/dev/peps/pep-0563/) postponed evaluation of annotations -* [PEP 570](https://www.python.org/dev/peps/pep-0570/) position-only parameters -* [PEP 585](https://www.python.org/dev/peps/pep-0585/) type hinting generics in standard collections -* [PEP 586](https://www.python.org/dev/peps/pep-0586/) literal types -* [PEP 589](https://www.python.org/dev/peps/pep-0589/) typed dictionaries -* [PEP 591](https://www.python.org/dev/peps/pep-0591/) final qualifier -* [PEP 593](https://www.python.org/dev/peps/pep-0593/) flexible variable annotations -* [PEP 604](https://www.python.org/dev/peps/pep-0604/) complementary syntax for unions -* [PEP 612](https://www.python.org/dev/peps/pep-0612/) parameter specification variables -* [PEP 613](https://www.python.org/dev/peps/pep-0613/) explicit type aliases -* [PEP 635](https://www.python.org/dev/peps/pep-0635/) structural pattern matching -* [PEP 646](https://www.python.org/dev/peps/pep-0646/) variadic generics -* [PEP 647](https://www.python.org/dev/peps/pep-0647/) user-defined type guards -* [PEP 655](https://www.python.org/dev/peps/pep-0655/) required typed dictionary items -* [PEP 673](https://www.python.org/dev/peps/pep-0673/) Self type -* [PEP 675](https://www.python.org/dev/peps/pep-0675/) arbitrary literal strings -* [PEP 681](https://www.python.org/dev/peps/pep-0681/) dataclass transform -* [PEP 692](https://www.python.org/dev/peps/pep-0692/) (draft) TypedDict for kwargs typing -* [PEP 695](https://www.python.org/dev/peps/pep-0695/) (draft) Type parameter syntax -* Type inference for function return values, instance variables, class variables, and globals -* Type guards that understand conditional code flow constructs like if/else statements - -### VS Code Language Features - -The VS Code extension supports many time-saving language features including: - -* Intelligent type completion of keywords, symbols, and import names appears when editing -* Import statements are automatically inserted when necessary for type completions -* Signature completion tips help when filling in arguments for a call -* Hover over symbols to provide type information and doc strings -* Find Definitions to quickly go to the location of a symbol’s definition -* Find References to find all references to a symbol within a code base -* Rename Symbol to rename all references to a symbol within a code base -* Find Symbols within the current document or within the entire workspace -* View call hierarchy information — calls made within a function and places where a function is called -* Organize Imports command for automatically ordering imports according to PEP8 rules -* Type stub generation for third-party libraries - -### Built-in Type Stubs - -Pyright includes a recent copy of the stdlib type stubs from [Typeshed](https://github.com/python/typeshed). It can be configured to use another (perhaps more recent or modified) copy of the Typeshed type stubs. Of course, it also works with custom type stub files that are part of your project. - -For more details, refer to the [README](https://github.com/microsoft/pyright/blob/main/README.md) on the Pyright GitHub site. +Refer to [the documentation](https://microsoft.github.io/pyright) for installation, configuration, and usage details. diff --git a/packages/vscode-pyright/package-lock.json b/packages/vscode-pyright/package-lock.json index d5e6520e5..7cfdc584d 100644 --- a/packages/vscode-pyright/package-lock.json +++ b/packages/vscode-pyright/package-lock.json @@ -1,18 +1,17 @@ { "name": "vscode-pyright", - "version": "1.1.267", + "version": "1.1.301", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "vscode-pyright", - "version": "1.1.267", + "version": "1.1.301", "license": "MIT", "dependencies": { - "vscode-jsonrpc": "8.0.2-next.1", - "vscode-languageclient": "8.0.2-next.4", - "vscode-languageserver": "8.0.2-next.4", - "vscode-languageserver-protocol": "3.17.2-next.5" + "vscode-jsonrpc": "8.1.0", + "vscode-languageclient": "8.1.0", + "vscode-languageserver": "8.1.0", + "vscode-languageserver-protocol": "3.17.3" }, "devDependencies": { "@types/copy-webpack-plugin": "^10.1.0", @@ -21,10 +20,10 @@ "copy-webpack-plugin": "^10.2.4", "detect-indent": "^6.1.0", "shx": "^0.3.4", - "ts-loader": "^9.3.1", + "ts-loader": "^9.4.2", "typescript": "~4.4.4", "vsce": "^2.7.0", - "webpack": "^5.74.0", + "webpack": "^5.76.0", "webpack-cli": "^4.10.0" }, "engines": { @@ -575,6 +574,7 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -804,7 +804,8 @@ "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true }, "node_modules/console-control-strings": { "version": "1.1.0", @@ -1140,9 +1141,9 @@ "dev": true }, "node_modules/fast-glob": { - "version": "3.2.11", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz", - "integrity": "sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew==", + "version": "3.2.12", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", + "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", "dev": true, "dependencies": { "@nodelib/fs.stat": "^2.0.2", @@ -1180,9 +1181,9 @@ "dev": true }, "node_modules/fastq": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", - "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", + "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", "dev": true, "dependencies": { "reusify": "^1.0.4" @@ -1431,9 +1432,9 @@ ] }, "node_modules/ignore": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", - "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", + "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", "dev": true, "engines": { "node": ">= 4" @@ -1792,9 +1793,10 @@ } }, "node_modules/minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, "dependencies": { "brace-expansion": "^1.1.7" }, @@ -2369,9 +2371,9 @@ } }, "node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", "dependencies": { "lru-cache": "^6.0.0" }, @@ -2816,9 +2818,9 @@ } }, "node_modules/ts-loader": { - "version": "9.3.1", - "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.3.1.tgz", - "integrity": "sha512-OkyShkcZTsTwyS3Kt7a4rsT/t2qvEVQuKCTg4LJmpj9fhFR7ukGdZwV6Qq3tRUkqcXtfGpPR7+hFKHCG/0d3Lw==", + "version": "9.4.2", + "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.4.2.tgz", + "integrity": "sha512-OmlC4WVmFv5I0PpaxYb+qGeGOdm5giHU7HwDDUjw59emP2UYMHy9fFSDcYgSNoH8sXcj4hGCSEhlDZ9ULeDraA==", "dev": true, "dependencies": { "chalk": "^4.1.0", @@ -3024,50 +3026,69 @@ } }, "node_modules/vscode-jsonrpc": { - "version": "8.0.2-next.1", - "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.0.2-next.1.tgz", - "integrity": "sha512-sbbvGSWja7NVBLHPGawtgezc8DHYJaP4qfr/AaJiyDapWcSFtHyPtm18+LnYMLTmB7bhOUW/lf5PeeuLpP6bKA==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.1.0.tgz", + "integrity": "sha512-6TDy/abTQk+zDGYazgbIPc+4JoXdwC8NHU9Pbn4UJP1fehUyZmM4RHp5IthX7A6L5KS30PRui+j+tbbMMMafdw==", "engines": { "node": ">=14.0.0" } }, "node_modules/vscode-languageclient": { - "version": "8.0.2-next.4", - "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-8.0.2-next.4.tgz", - "integrity": "sha512-j9BEiCYMN9IoKwYdk9iickV6WNPVGPoVO11SMdoxFnWPIT3y5UAe3qf/WsfA9OdklAIaxxYasfgyKCpBjSPNuw==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-8.1.0.tgz", + "integrity": "sha512-GL4QdbYUF/XxQlAsvYWZRV3V34kOkpRlvV60/72ghHfsYFnS/v2MANZ9P6sHmxFcZKOse8O+L9G7Czg0NUWing==", "dependencies": { - "minimatch": "^3.0.4", - "semver": "^7.3.5", - "vscode-languageserver-protocol": "3.17.2-next.5" + "minimatch": "^5.1.0", + "semver": "^7.3.7", + "vscode-languageserver-protocol": "3.17.3" }, "engines": { "vscode": "^1.67.0" } }, + "node_modules/vscode-languageclient/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/vscode-languageclient/node_modules/minimatch": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", + "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/vscode-languageserver": { - "version": "8.0.2-next.4", - "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-8.0.2-next.4.tgz", - "integrity": "sha512-B3roWH4TmJiB6Zh5+r7zu0QdlLqJsPdGo0LeEi6OiLfrHYCDlcI7DNcQ7F17vWmxC3C82SrxMt/EuLBMpKQM0A==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-8.1.0.tgz", + "integrity": "sha512-eUt8f1z2N2IEUDBsKaNapkz7jl5QpskN2Y0G01T/ItMxBxw1fJwvtySGB9QMecatne8jFIWJGWI61dWjyTLQsw==", "dependencies": { - "vscode-languageserver-protocol": "3.17.2-next.5" + "vscode-languageserver-protocol": "3.17.3" }, "bin": { "installServerIntoExtension": "bin/installServerIntoExtension" } }, "node_modules/vscode-languageserver-protocol": { - "version": "3.17.2-next.5", - "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.2-next.5.tgz", - "integrity": "sha512-UlH+QL4Q4lX94of/UPDDwwWIkd8w7dtMW4khzvEDUoykiG9tba0iG6V0bAiv8XVpnBIUYjL2FNFiL3zl+TY1Sw==", + "version": "3.17.3", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.3.tgz", + "integrity": "sha512-924/h0AqsMtA5yK22GgMtCYiMdCOtWTSGgUOkgEDX+wk2b0x4sAfLiO4NxBxqbiVtz7K7/1/RgVrVI0NClZwqA==", "dependencies": { - "vscode-jsonrpc": "8.0.2-next.1", - "vscode-languageserver-types": "3.17.2-next.2" + "vscode-jsonrpc": "8.1.0", + "vscode-languageserver-types": "3.17.3" } }, "node_modules/vscode-languageserver-types": { - "version": "3.17.2-next.2", - "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.2-next.2.tgz", - "integrity": "sha512-TiAkLABgqkVWdAlC3XlOfdhdjIAdVU4YntPUm9kKGbXr+MGwpVnKz2KZMNBcvG0CFx8Hi8qliL0iq+ndPB720w==" + "version": "3.17.3", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.3.tgz", + "integrity": "sha512-SYU4z1dL0PyIMd4Vj8YOqFvHu7Hz/enbWtpfnVbJHU4Nd1YNYx8u0ennumc6h48GQNeOLxmwySmnADouT/AuZA==" }, "node_modules/watchpack": { "version": "2.4.0", @@ -3083,9 +3104,9 @@ } }, "node_modules/webpack": { - "version": "5.74.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.74.0.tgz", - "integrity": "sha512-A2InDwnhhGN4LYctJj6M1JEaGL7Luj6LOmyBHjcI8529cm5p6VXiTIW2sn6ffvEAKmveLzvu4jrihwXtPojlAA==", + "version": "5.76.1", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.76.1.tgz", + "integrity": "sha512-4+YIK4Abzv8172/SGqObnUjaIHjLEuUasz9EwQj/9xmPPkYJy2Mh03Q/lJfSD3YLzbxy5FeTq5Uw0323Oh6SJQ==", "dev": true, "dependencies": { "@types/eslint-scope": "^3.7.3", @@ -3817,6 +3838,7 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -3979,7 +4001,8 @@ "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true }, "console-control-strings": { "version": "1.1.0", @@ -4223,9 +4246,9 @@ "dev": true }, "fast-glob": { - "version": "3.2.11", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz", - "integrity": "sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew==", + "version": "3.2.12", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", + "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", "dev": true, "requires": { "@nodelib/fs.stat": "^2.0.2", @@ -4259,9 +4282,9 @@ "dev": true }, "fastq": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", - "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", + "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", "dev": true, "requires": { "reusify": "^1.0.4" @@ -4450,9 +4473,9 @@ "dev": true }, "ignore": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", - "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", + "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", "dev": true }, "import-local": { @@ -4724,9 +4747,10 @@ "dev": true }, "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, "requires": { "brace-expansion": "^1.1.7" } @@ -5150,9 +5174,9 @@ } }, "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", "requires": { "lru-cache": "^6.0.0" } @@ -5465,9 +5489,9 @@ } }, "ts-loader": { - "version": "9.3.1", - "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.3.1.tgz", - "integrity": "sha512-OkyShkcZTsTwyS3Kt7a4rsT/t2qvEVQuKCTg4LJmpj9fhFR7ukGdZwV6Qq3tRUkqcXtfGpPR7+hFKHCG/0d3Lw==", + "version": "9.4.2", + "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.4.2.tgz", + "integrity": "sha512-OmlC4WVmFv5I0PpaxYb+qGeGOdm5giHU7HwDDUjw59emP2UYMHy9fFSDcYgSNoH8sXcj4hGCSEhlDZ9ULeDraA==", "dev": true, "requires": { "chalk": "^4.1.0", @@ -5634,41 +5658,59 @@ } }, "vscode-jsonrpc": { - "version": "8.0.2-next.1", - "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.0.2-next.1.tgz", - "integrity": "sha512-sbbvGSWja7NVBLHPGawtgezc8DHYJaP4qfr/AaJiyDapWcSFtHyPtm18+LnYMLTmB7bhOUW/lf5PeeuLpP6bKA==" + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.1.0.tgz", + "integrity": "sha512-6TDy/abTQk+zDGYazgbIPc+4JoXdwC8NHU9Pbn4UJP1fehUyZmM4RHp5IthX7A6L5KS30PRui+j+tbbMMMafdw==" }, "vscode-languageclient": { - "version": "8.0.2-next.4", - "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-8.0.2-next.4.tgz", - "integrity": "sha512-j9BEiCYMN9IoKwYdk9iickV6WNPVGPoVO11SMdoxFnWPIT3y5UAe3qf/WsfA9OdklAIaxxYasfgyKCpBjSPNuw==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-8.1.0.tgz", + "integrity": "sha512-GL4QdbYUF/XxQlAsvYWZRV3V34kOkpRlvV60/72ghHfsYFnS/v2MANZ9P6sHmxFcZKOse8O+L9G7Czg0NUWing==", "requires": { - "minimatch": "^3.0.4", - "semver": "^7.3.5", - "vscode-languageserver-protocol": "3.17.2-next.5" + "minimatch": "^5.1.0", + "semver": "^7.3.7", + "vscode-languageserver-protocol": "3.17.3" + }, + "dependencies": { + "brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "requires": { + "balanced-match": "^1.0.0" + } + }, + "minimatch": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", + "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", + "requires": { + "brace-expansion": "^2.0.1" + } + } } }, "vscode-languageserver": { - "version": "8.0.2-next.4", - "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-8.0.2-next.4.tgz", - "integrity": "sha512-B3roWH4TmJiB6Zh5+r7zu0QdlLqJsPdGo0LeEi6OiLfrHYCDlcI7DNcQ7F17vWmxC3C82SrxMt/EuLBMpKQM0A==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-8.1.0.tgz", + "integrity": "sha512-eUt8f1z2N2IEUDBsKaNapkz7jl5QpskN2Y0G01T/ItMxBxw1fJwvtySGB9QMecatne8jFIWJGWI61dWjyTLQsw==", "requires": { - "vscode-languageserver-protocol": "3.17.2-next.5" + "vscode-languageserver-protocol": "3.17.3" } }, "vscode-languageserver-protocol": { - "version": "3.17.2-next.5", - "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.2-next.5.tgz", - "integrity": "sha512-UlH+QL4Q4lX94of/UPDDwwWIkd8w7dtMW4khzvEDUoykiG9tba0iG6V0bAiv8XVpnBIUYjL2FNFiL3zl+TY1Sw==", + "version": "3.17.3", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.3.tgz", + "integrity": "sha512-924/h0AqsMtA5yK22GgMtCYiMdCOtWTSGgUOkgEDX+wk2b0x4sAfLiO4NxBxqbiVtz7K7/1/RgVrVI0NClZwqA==", "requires": { - "vscode-jsonrpc": "8.0.2-next.1", - "vscode-languageserver-types": "3.17.2-next.2" + "vscode-jsonrpc": "8.1.0", + "vscode-languageserver-types": "3.17.3" } }, "vscode-languageserver-types": { - "version": "3.17.2-next.2", - "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.2-next.2.tgz", - "integrity": "sha512-TiAkLABgqkVWdAlC3XlOfdhdjIAdVU4YntPUm9kKGbXr+MGwpVnKz2KZMNBcvG0CFx8Hi8qliL0iq+ndPB720w==" + "version": "3.17.3", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.3.tgz", + "integrity": "sha512-SYU4z1dL0PyIMd4Vj8YOqFvHu7Hz/enbWtpfnVbJHU4Nd1YNYx8u0ennumc6h48GQNeOLxmwySmnADouT/AuZA==" }, "watchpack": { "version": "2.4.0", @@ -5681,9 +5723,9 @@ } }, "webpack": { - "version": "5.74.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.74.0.tgz", - "integrity": "sha512-A2InDwnhhGN4LYctJj6M1JEaGL7Luj6LOmyBHjcI8529cm5p6VXiTIW2sn6ffvEAKmveLzvu4jrihwXtPojlAA==", + "version": "5.76.1", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.76.1.tgz", + "integrity": "sha512-4+YIK4Abzv8172/SGqObnUjaIHjLEuUasz9EwQj/9xmPPkYJy2Mh03Q/lJfSD3YLzbxy5FeTq5Uw0323Oh6SJQ==", "dev": true, "requires": { "@types/eslint-scope": "^3.7.3", diff --git a/packages/vscode-pyright/package.json b/packages/vscode-pyright/package.json index 567a9cc88..1e58ca8c9 100644 --- a/packages/vscode-pyright/package.json +++ b/packages/vscode-pyright/package.json @@ -2,7 +2,7 @@ "name": "vscode-pyright", "displayName": "Pyright", "description": "VS Code static type checking for Python", - "version": "1.1.267", + "version": "1.1.301", "private": true, "license": "MIT", "author": { @@ -51,6 +51,36 @@ "command": "pyright.restartserver", "title": "Restart Server", "category": "Pyright" + }, + { + "command": "pyright.dumpTokens", + "title": "Dump token streams ...", + "category": "Pyright", + "enablement": "editorLangId == python && pyright.development" + }, + { + "command": "pyright.dumpNodes", + "title": "Dump parse tree ...", + "category": "Pyright", + "enablement": "editorLangId == python && pyright.development" + }, + { + "command": "pyright.dumpTypes", + "title": "Dump type info ...", + "category": "Pyright", + "enablement": "editorLangId == python && pyright.development" + }, + { + "command": "pyright.dumpCachedTypes", + "title": "Dump cached type info ...", + "category": "Pyright", + "enablement": "editorLangId == python && pyright.development" + }, + { + "command": "pyright.dumpCodeFlowGraph", + "title": "Dump code flow graph for node ...", + "category": "Pyright", + "enablement": "editorLangId == python && pyright.development" } ], "menus": { @@ -61,6 +91,28 @@ "group": "Pyright", "when": "editorLangId == python" } + ], + "commandPalette": [ + { + "command": "pyright.dumpTokens", + "when": "editorLangId == python && pyright.development" + }, + { + "command": "pyright.dumpNodes", + "when": "editorLangId == python && pyright.development" + }, + { + "command": "pyright.dumpTypes", + "when": "editorLangId == python && pyright.development" + }, + { + "command": "pyright.dumpCachedTypes", + "when": "editorLangId == python && pyright.development" + }, + { + "command": "pyright.dumpCodeFlowGraph", + "when": "editorLangId == python && pyright.development" + } ] }, "configuration": { @@ -109,7 +161,6 @@ }, "python.analysis.diagnosticSeverityOverrides": { "type": "object", - "default": {}, "description": "Allows a user to override the severity levels for individual diagnostics.", "scope": "resource", "properties": { @@ -421,6 +472,17 @@ "error" ] }, + "reportDeprecated": { + "type": "string", + "description": "Diagnostics for use of deprecated classes or functions.", + "default": "none", + "enum": [ + "none", + "information", + "warning", + "error" + ] + }, "reportIncompatibleMethodOverride": { "type": "string", "description": "Diagnostics for methods that override a method of the same name in a base class in an incompatible manner (wrong number of parameters, incompatible parameter types, or incompatible return type).", @@ -698,7 +760,7 @@ }, "reportUndefinedVariable": { "type": "string", - "description": "Diagnostics for a missing or misnamed “self” parameter in instance methods and “cls” parameter in class methods. Instance methods in metaclasses (classes that derive from “type”) are allowed to use “cls” for instance methods.", + "description": "Diagnostics for undefined variables.", "default": "error", "enum": [ "none", @@ -783,6 +845,28 @@ "warning", "error" ] + }, + "reportShadowedImports": { + "type": "string", + "description": "Diagnostics for files that are overriding a module in the stdlib.", + "default": "none", + "enum": [ + "none", + "information", + "warning", + "error" + ] + }, + "reportImplicitOverride": { + "type": "string", + "description": "Diagnostics for overridden methods that do not include an `@override` decorator.", + "default": "none", + "enum": [ + "none", + "information", + "warning", + "error" + ] } } }, @@ -866,10 +950,10 @@ "webpack-dev": "npm run clean && webpack --mode development --watch --progress" }, "dependencies": { - "vscode-jsonrpc": "8.0.2-next.1", - "vscode-languageclient": "8.0.2-next.4", - "vscode-languageserver": "8.0.2-next.4", - "vscode-languageserver-protocol": "3.17.2-next.5" + "vscode-jsonrpc": "8.1.0", + "vscode-languageclient": "8.1.0", + "vscode-languageserver": "8.1.0", + "vscode-languageserver-protocol": "3.17.3" }, "devDependencies": { "@types/copy-webpack-plugin": "^10.1.0", @@ -878,10 +962,10 @@ "copy-webpack-plugin": "^10.2.4", "detect-indent": "^6.1.0", "shx": "^0.3.4", - "ts-loader": "^9.3.1", + "ts-loader": "^9.4.2", "typescript": "~4.4.4", "vsce": "^2.7.0", - "webpack": "^5.74.0", + "webpack": "^5.76.0", "webpack-cli": "^4.10.0" } } diff --git a/packages/vscode-pyright/schemas/pyrightconfig.schema.json b/packages/vscode-pyright/schemas/pyrightconfig.schema.json index b15d44707..b5d8287a5 100644 --- a/packages/vscode-pyright/schemas/pyrightconfig.schema.json +++ b/packages/vscode-pyright/schemas/pyrightconfig.schema.json @@ -130,6 +130,12 @@ "title": "Infer strict types for dictionary expressions", "default": false }, + "analyzeUnannotatedFunctions": { + "$id": "#/properties/analyzeUnannotatedFunctions", + "type": "boolean", + "title": "Analyze and report diagnostics for functions that have no annotations", + "default": true + }, "strictParameterNoneValue": { "$id": "#/properties/strictParameterNoneValue", "type": "boolean", @@ -310,6 +316,12 @@ "title": "Controls reporting of attempts to redefine variables that are in all-caps", "default": "none" }, + "reportDeprecated": { + "$id": "#/properties/reportDeprecated", + "$ref": "#/definitions/diagnostic", + "title": "Controls reporting of use of deprecated class or function", + "default": "none" + }, "reportIncompatibleMethodOverride": { "$id": "#/properties/reportIncompatibleMethodOverride", "$ref": "#/definitions/diagnostic", @@ -508,6 +520,18 @@ "title": "Controls reporting of 'match' statements that do not exhaustively match all possible values", "default": "none" }, + "reportShadowedImports": { + "$id": "#/properties/reportShadowedImports", + "$ref": "#/definitions/diagnostic", + "title": "Controls reporting of shadowed imports of stdlib modules", + "default": "none" + }, + "reportImplicitOverride": { + "$id": "#/properties/reportImplicitOverride", + "$ref": "#/definitions/diagnostic", + "title": "Controls reporting overridden methods that are missing an `@override` decorator", + "default": "none" + }, "extraPaths": { "$id": "#/properties/extraPaths", "type": "array", diff --git a/packages/vscode-pyright/src/extension.ts b/packages/vscode-pyright/src/extension.ts index 4aae97d50..d10422cfa 100644 --- a/packages/vscode-pyright/src/extension.ts +++ b/packages/vscode-pyright/src/extension.ts @@ -13,6 +13,7 @@ import * as path from 'path'; import { commands, ExtensionContext, + ExtensionMode, extensions, OutputChannel, Position, @@ -210,6 +211,81 @@ export async function activate(context: ExtensionContext) { ); }); + // Register the debug only commands when running under the debugger. + if (context.extensionMode === ExtensionMode.Development) { + // Create a 'when' context for development. + commands.executeCommand('setContext', 'pyright.development', true); + + // Register the commands that only work when in development mode. + context.subscriptions.push( + commands.registerCommand(Commands.dumpTokens, () => { + const fileName = window.activeTextEditor?.document.fileName; + if (fileName) { + client.sendRequest('workspace/executeCommand', { + command: Commands.dumpFileDebugInfo, + arguments: [fileName, 'tokens'], + }); + } + }) + ); + + context.subscriptions.push( + commands.registerCommand(Commands.dumpNodes, () => { + const fileName = window.activeTextEditor?.document.fileName; + if (fileName) { + client.sendRequest('workspace/executeCommand', { + command: Commands.dumpFileDebugInfo, + arguments: [fileName, 'nodes'], + }); + } + }) + ); + + context.subscriptions.push( + commands.registerCommand(Commands.dumpTypes, () => { + const fileName = window.activeTextEditor?.document.fileName; + if (fileName) { + const start = window.activeTextEditor!.selection.start; + const end = window.activeTextEditor!.selection.end; + const startOffset = window.activeTextEditor!.document.offsetAt(start); + const endOffset = window.activeTextEditor!.document.offsetAt(end); + client.sendRequest('workspace/executeCommand', { + command: Commands.dumpFileDebugInfo, + arguments: [fileName, 'types', startOffset, endOffset], + }); + } + }) + ); + context.subscriptions.push( + commands.registerCommand(Commands.dumpCachedTypes, () => { + const fileName = window.activeTextEditor?.document.fileName; + if (fileName) { + const start = window.activeTextEditor!.selection.start; + const end = window.activeTextEditor!.selection.end; + const startOffset = window.activeTextEditor!.document.offsetAt(start); + const endOffset = window.activeTextEditor!.document.offsetAt(end); + client.sendRequest('workspace/executeCommand', { + command: Commands.dumpFileDebugInfo, + arguments: [fileName, 'cachedtypes', startOffset, endOffset], + }); + } + }) + ); + context.subscriptions.push( + commands.registerCommand(Commands.dumpCodeFlowGraph, () => { + const fileName = window.activeTextEditor?.document.fileName; + if (fileName) { + const start = window.activeTextEditor!.selection.start; + const startOffset = window.activeTextEditor!.document.offsetAt(start); + client.sendRequest('workspace/executeCommand', { + command: Commands.dumpFileDebugInfo, + arguments: [fileName, 'codeflowgraph', startOffset], + }); + } + }) + ); + } + await client.start(); } diff --git a/pyright-last-commit b/pyright-last-commit index 0f8aea6de..3a5afc258 100644 --- a/pyright-last-commit +++ b/pyright-last-commit @@ -1 +1 @@ -f444ffa5356af6377f6f5902816f128446e91a19 +fac54273791fde77408b1b5f7161117b9f934c22 diff --git a/specs/dataclass_transforms.md b/specs/dataclass_transforms.md deleted file mode 100644 index fce1cb556..000000000 --- a/specs/dataclass_transforms.md +++ /dev/null @@ -1,579 +0,0 @@ -Motivation -========== - -PEP 557 introduced the dataclass to the Python stdlib. Several popular -libraries (including attrs, pydantic, and various libraries that support -database ORMs such as django and edgedb) have behaviors that are similar -to dataclass, but these behaviors cannot be described using standard type -annotations. - -To work around this limitation, mypy custom plugins have been developed for -many of these libraries, but these plugins don't work with other type -checkers, linters or language servers. They are also costly to maintain for -library authors, and they require that Python developers know about the -existence of these plugins and download and configure them within their -environment. - -Most type checkers, linters and language servers have full support for -dataclass. This proposal aims to generalize this functionality and provide -a way for third-party libraries to indicate that certain decorator functions -or metaclasses provide behaviors similar to dataclass. - -The desired behaviors include the following: -1. Optionally synthesizing an `__init__` method based on declared data fields. -2. Optionally synthesizing `__eq__` and `__ne__` methods. -3. Optionally synthesizing `__lt__`, `__le__`, `__gt__`, and `__ge__` methods. -4. Supporting "frozen" classes, a way to enforce immutability during static type -checking. -5. Supporting "field descriptors" that describe attributes of individual -fields that a static type checker must be aware of, such as whether a -default value is provided for the field. - - -Specification -============= - -The `dataclass_transform` Decorator ------------------------------------ - -This specification introduces a new decorator function exported from the -`typing` module named `dataclass_transform`. This decorator can be applied -to either a function (which is typically a decorator function itself) or a -class (which is intended to be used as a metaclass). The presence of -`dataclass_transform` tells a static type checker that the decorated function -or metaclass performs runtime "magic" that transforms a class, endowing it -dataclass-like behaviors. - -If `dataclass_transform` is applied to a function, the use of this function -as a decorator will apply dataclass type semantics. If `dataclass_transform` -is applied to a class, dataclass type semantics will be assumed for any -class that uses the decorated class as a metaclass. - -Here is an example of using `dataclass_transform` to decorate a decorator -function named `create_model`. We assume here that this function modifies -the class that it decorates in the following ways: -1. It synthesizes an `__init__` method using data fields declared within -the class and its parent classes. -2. It synthesizes an `__eq__` and `__ne__` method. - -The implementation details of `create_model` are omitted for brevity. - -```python -# The `create_model` decorator is defined by a library. This could be -# in a type stub or inline. -_T = TypeVar("_T") - -@typing.dataclass_transform() -def create_model(cls: Type[_T]) -> Type[_T]: - cls.__init__ = ... - cls.__eq__ = ... - cls.__ne__ = ... - return cls - - -# The `create_model` decorator can now be used to create new model -# classes, like this: -@create_model -class CustomerModel: - id: int - name: str -``` - -Here is an example of using `dataclass_transform` to decorate a metaclass. -We assume here that the `ModelMeta` class, when used as a metaclass, modifies -the classes that it creates in the following ways: -1. It synthesizes an `__init__` method using data fields declared within -the class and its parent classes. -2. It synthesizes an `__eq__` and `__ne__` method. -The implementation details of `ModelMeta` are omitted for brevity. - -```python -# The `ModelMeta` metaclass and `ModelBase` class are defined by a library. -# This could be in a type stub or inline. -@typing.dataclass_transform() -class ModelMeta(type): ... - -class ModelBase(metaclass=ModelMeta): ... - - -# The `ModelBase` class can now be used to create new model -# subclasses, like this: -class CustomerModel(ModelBase): - id: int - name: str -``` - -In both of the above examples, the resulting `CustomerModel` class can now be -instantiated using the synthesized `__init__` method: - -```python -# Using positional arguments -c1 = CustomerModel(327, "John Smith") - -# Using keyword arguments -c2 = CustomerModel(id=327, name="John Smith") - -# These will generate runtime errors and should likewise be flagged as -# errors by a static type checker. -c3 = CustomerModel() -c4 = CustomerModel(327, first_name="John") -c5 = CustomerModel(327, "John Smith", 0) -``` - -A decorator function or metaclass that provides dataclass-like functionality -may accept parameters that modify certain behaviors. This specification -defines the following parameters that static type checkers must honor if -they are used by a dataclass transform. Each of these parameters accepts a bool -argument, and it must be possible for the bool value (True or False) to be -statically evaluated. - -`eq` is a parameter supported in the stdlib dataclass, and its meaning is -defined in PEP 557. - -`order` is a parameter supported in the stdlib dataclass, and its meaning is -defined in PEP 557. - -`frozen` is a parameter supported in the stdlib dataclass, and its meaning is -defined in PEP 557. - -`init` is a parameter supported in the stdlib dataclass, and its meaning is -defined in PEP 557. - -`unsafe_hash` is a parameter supported in the stdlib dataclass, and its meaning is -defined in PEP 557. - -`hash` is an alias for the `unsafe_hash` parameter. - -`kw_only` is a parameter supported in the stdlib dataclass, first introduced -in Python 3.10. - -`slots` is a parameter supported in the stdlib dataclass, first introduced -in Python 3.10. - - -Parameters to `dataclass_transform` allow for some basic customization of -default behaviors. - -```python -_T = TypeVar("_T") - -def dataclass_transform( - *, - eq_default: bool = True, - order_default: bool = False, - kw_only_default: bool = False, - field_specifiers: Tuple[type, ...] = (()), -) -> Callable[[_T], _T]: ... -``` - -`eq_default` indicates whether the `eq` parameter is assumed to be True -or False if it is omitted by the caller. If not specified, it will default -to True (the default assumption for dataclass). - -`order_default` indicates whether the `order` parameter is assumed to be -True or False if it is omitted by the caller. If not specified, it will default -to False (the default assumption for dataclass). - -`kw_only_default` indicates whether the `kw_only` parameter is -assumed to be True or False if it is omitted by the caller. If not specified, -it will default to False (the default assumption for dataclass). - -`field_specifiers` specifies a static list of supported classes that describe -fields. Some libraries also supply functions to allocate instances of field -descriptors, and those functions may also be specified in this tuple. If not -specified, it will default to an empty tuple (no field descriptors supported). -The standard dataclass behavior supports only one type of field descriptor -called `Field` plus a helper function (`field`) that instantiates this class, -so if we were describing the stdlib dataclass behavior, we would provide the -following tuple argument: `(dataclasses.Field, dataclasses.field)`. - - -Here are some additional examples that show how these parameters are used. - -Example of using `dataclass_transform` to decorate a decorator function: -```python -# Indicate that the `create_model` function assumes keyword-only -# parameters for the synthesized `__init__` method unless it is invoked -# with `kw_only=False`. It always synthesizes order-related methods -# and provides no way to override this behavior. -@typing.dataclass_transform(kw_only_default=True, order_default=True) -def create_model( - *, - frozen: bool = False, - kw_only: bool = True, -) -> Callable[[Type[_T]], Type[_T]]: ... - - -# Example of how this decorator would be used by code that imports -# from this library: -@create_model(frozen=True, kw_only=False) -class CustomerModel: - id: int - name: str -``` - -Example of using `dataclass_transform` to decorate a metaclass. -```python -# Indicate that classes that use this metaclass default to synthesizing -# comparison methods. -@typing.dataclass_transform(eq_default=True, order_default=True) -class ModelMeta(type): - def __init_subclass__( - cls, - *, - init: bool = True, - frozen: bool = False, - eq: bool = True, - order: bool = True, - ): - ... - -class ModelBase(metaclass=ModelMeta): - ... - - -# Example of how this class would be used by code that imports -# from this library: -class CustomerModel(ModelBase, init=False, frozen=True, eq=False, order=False): - id: int - name: str -``` - - - -Field descriptors ------------------ - -Most libraries that support dataclass-like semantics provide one or more -"field descriptor" types that allow a class definition to provide additional -metadata about each field in the class. This metadata can describe, for example, -default values or indicate whether the field should be included in the -synthesized `__init__` method. - -Field descriptors can be omitted in cases where additional metadata is not -required. - -```python -@dataclass -class Employee: - # Field with no descriptor - name: str - - # Field that uses field descriptor class instance - age: Optional[int] = field(default=None, init=False) - - # Field with type annotation and simple initializer to - # describe default value - is_paid_hourly: bool = True - - # Not a field (but rather a class variable) because type annotation - # is not provided. - office_number = "unassigned" -``` - -Libraries that support dataclass-like semantics and support field descriptor -classes typically use common parameter names to construct these field -descriptors. This specification formalizes the names and meanings of the -parameters that must be understood for static type checkers. These standardized -parameters must be keyword-only parameters. Field descriptor classes are -allowed to use other parameters in their constructors, and those parameters -can be positional and may use other names. - - -`init` is an optional bool parameter that indicates whether the field should -be included in the synthesized `__init__` method. If unspecified, it defaults -to True. Field descriptor functions can use overloads that implicitly specify -the value of `init` using a literal bool value type (Literal[False] or -Literal[True]). - - -`default` is an optional parameter that provides the default value for the -field. - -`default_factory` or `factory` is an optional parameter that provides a runtime -callback that returns the default value for the field. If `default` and -`default_value` are both unspecified, the field is assumed to have no default -value and must be provided a value when the class is instantiated. - -`alias` is an optional str parameter that provides an alternative name for -the field. This alternative name is used in the synthesized `__init__` method. - - - -This example demonstrates -```python -# Library code (within type stub or inline): -@overload -def model_field( - *, - default: Optional[Any] = ..., - resolver: Callable[[], Any], - init: Literal[False] = False, - ) -> Any: ... - -@overload -def model_field( - *, - default: Optional[Any] = ..., - resolver: None = None, - init: bool = True, - ) -> Any: ... - -@typing.dataclass_transform(kw_only_default=True, field_specifiers=(model_field, )) -def create_model( - *, - init: bool = True -) -> Callable[[Type[_T]], Type[_T]]: ... - - -# Code that imports this library: -@create_model(init=False) -class CustomerModel: - id: int = model_field(resolver=lambda : 0) - name: str -``` - - -Runtime Behavior ----------------- - -At runtime, the `dataclass_transform` decorator has no effect. It simply returns -a function that accepts a single argument and returns that argument as the -return value. - -Here is its complete implementation. - -```python -def dataclass_transform( - *, - eq_default: bool = True, - order_default: bool = False, - kw_only_default: bool = False, - field_specifiers: Tuple[Union[type, Callable[..., Any]], ...] = (()), -) -> Callable[[_T], _T]: - return lambda a: a -``` - - -Dataclass Semantics -------------------- - -The following dataclass semantics are implied when dataclass_transform is -specified. - -Frozen classes cannot inherit from non-frozen classes. A class that -directly specifies a metaclass that has been decorated with -`dataclass_transform` will not be considered non-frozen. In the example - -```python -@typing.dataclass_transform() -class ModelMeta(type): ... - -# ModelBase is not considered either "frozen" or "non-frozen" -# because it directly specifies ModelMeta as its metaclass. -class ModelBase(metaclass=ModelMeta): ... - -# Vehicle is considered non-frozen because it does not specify -# "frozen=True". -class Vehicle(ModelBase): - name: str - -# Car is a frozen class that derives from Vehicle, which is a -# non-frozen class, which is an error condition. -class Car(Vehicle, frozen=True): - wheel_count: int -``` - -Field ordering and inheritance is assumed to follow the same rules specified -in PEP 557. This includes the effects of overrides (redefining a field -in a child class that has already been defined in a parent class). - -PEP 557 indicates that all fields without default values must appear before -fields with default values. Although not explicitly stated in PEP 557, this -rule is ignored when `init=False`, and this specification likewise ignores -this requirement in this situation. Likewise, there is no need to enforce -this ordering when keyword-only parameters are used for `__init__`, so the -rule is not enforced if `kw_only` semantics are in effect. - -As with dataclass, method synthesis is skipped if it would overwrite -a method that is explicitly declared within the class. For example, if a class -declares an `__init__` method explicitly, an `__init__` method will not be -synthesized for that class. - - -Alternate Form --------------- - -To avoid delaying adoption of this proposal until after `dataclass_transform` -has been added to the `typing` module, type checkers may support an alternative -form `__dataclass_transform__`. This form can be defined locally without any -reliance on the `typing` or `typing_extensions` modules. It allows immediate -adoption of the specification by library authors. Type checkers that have -not yet adopted this specification will retain their current behavior. - -To use this alternate form, library authors should include the following -declaration within their type stubs or source files. - -```python -_T = TypeVar("_T") - -def __dataclass_transform__( - *, - eq_default: bool = True, - order_default: bool = False, - kw_only_default: bool = False, - field_specifiers: Tuple[Union[type, Callable[..., Any]], ...] = (()), -) -> Callable[[_T], _T]: - # If used within a stub file, the following implementation can be - # replaced with "...". - return lambda a: a -``` - - -Limitations -=========== - -Attrs ------ - -The attrs library supports an "auto_attribs" parameter that indicates whether -class members decorated with PEP 526 variable annotations but with no assignment -should be treated as data fields. We considered supporting "auto_attribs" and -a corresponding "auto_attribs_default" parameter. We decided against this -because it is specific to attrs and appears to be a legacy behavior. Instead -of supporting this in the new standard, we recommend that the maintainers of -attrs move away from the legacy semantics and adopt "auto_attribs" behaviors -by default. - -The attrs library also supports a concept called "converters", which we -propose not to support in this proposal. Converters can still be used, but -an explicit type annotation must be provided. - -```python -@attr.s -class C: - x: int = attr.ib(converter=int) -``` - -The attrs library also performs automatic aliasing of field names that start -with a single underscore. This proposal omits this behavior. - -The attrs library determines the order of fields within a class hierarchy -based not on MRO but based on some other algorithm. It allows callers to -specify MRO behavior by specifying `collect_by_mro=True`. Dataclass field -order is based on MRO, and this proposal would not support the legacy attrs -ordering. This affects only cases of multiple inheritance and only when -`collect_by_mro=False`. - -The attrs library supports a bool parameter `cmp` that is the equivalent of -setting `eq` and `order` to True. This is not supported in this proposal. -Attrs users should use the dataclass-standard parameter names. - -The attrs library also supports a "kw_only" parameter for individual fields. -This is not currently supported in this spec, but it could be added in the -future if there was sufficient demand. - -The attrs library also differs from stdlib dataclasses in how it handles -inherited fields that are redeclared in subclasses. The dataclass specification -preserves the original order, but attrs defines a new order based on subclasses. -Users of attrs who rely on this ordering will not see the correct order -of parameters in the synthesized `__init__` method. - - -Django ------- - -Django does not support declaring fields using type annotations only, so -users of this mechanism would need to know that they should always supply -assigned values. - -Furthermore, django applies additional logic for primary keys and foreign -keys. For example, it automatically adds an "id" field (and `__init__` -parameter) if there is no field designated as a primary key. This additional -logic is not accommodated with this proposal, so users of django would need -to explicitly declare the id field. - -These limitations may make it impractical to use the dataclass_transform -mechanism with django. - - -Using Dataclass Transform In Existing Libraries -=============================================== - -Applying To Attrs ------------------ - -This section explains which modifications need to be made to attrs to -incorporate support for this specification. This assumes recent versions of -attrs (I used 20.3.0). - -Step 1: Open `attr/__init__.pyi` and paste the following function declaration -somewhere within the file: - -```python -def __dataclass_transform__( - *, - eq_default: bool = True, - order_default: bool = False, - kw_only_default: bool = False, - field_specifiers: Tuple[Union[type, Callable[..., Any]], ...] = (()), -) -> Callable[[_T], _T]: ... -``` - -Step 2: Within the same file, search for the definition of the `attrs` function. -It is an overloaded function with two overloads. Paste the following line -between `@overload` and `def attrs(`. Repeat this for each of the two overloads. - -```python -@__dataclass_transform__(order_default=True, field_specifiers=(attrib, field)) -``` - -Step 3: Within the same file, search for the definition of the `define` -function. Paste the following line between `@overload` and `def define(`. Repeat -this for each of the two overloads. - -```python -@__dataclass_transform__(field_specifiers=(attrib, field)) -``` - - -Applying To Pydantic --------------------- - -This section explains which modifications need to be made to pydantic to -incorporate support for this specification. This assumes recent versions of -pydantic (I used 1.8.1). - -Step 1: Open `pydantic/main.py` and search for the class definition for -`ModelMetaclass`. Before this class definition, paste the following function -declaration: - -```python -def __dataclass_transform__( - *, - eq_default: bool = True, - order_default: bool = False, - kw_only_default: bool = False, - field_specifiers: Tuple[Union[type, Callable[..., Any]], ...] = (()), -) -> Callable[[_T], _T]: - return lambda a: a -``` - -Step 2: Add the following decorator to the `ModelMetaclass` class definition: - -```python -@__dataclass_transform__(kw_only_default=True, field_specifiers=(Field, FieldInfo)) -``` - - -Change History -============== - -18-May-2021: Documented additional limitations for attrs (factory vs default_factory). - -15-May-2021: Documented additional limitations for attrs and django. - -29-Apr-2021: Clarified that fields with no type annotation are not included -in the synthesized `__init__` method. - -24-Apr-2021: Fixed bugs in the spec relating to return types of decorators.